Beispiel #1
0
    def GetSlaveTxn(self, request: xrd_pb2.SlaveTxnReq,
                    context) -> xrd_pb2.TransferCoinsResp:
        logger.debug("[PublicAPI] GetSlaveTxn")
        tx = self.xrdnode.create_slave_tx(slave_pks=request.slave_pks,
                                          access_types=request.access_types,
                                          fee=request.fee,
                                          xmss_pk=request.xmss_pk,
                                          master_addr=request.master_addr)

        extended_transaction_unsigned = xrd_pb2.TransactionExtended(
            tx=tx.pbdata, addr_from=tx.addr_from, size=tx.size)
        return xrd_pb2.TransferCoinsResp(
            extended_transaction_unsigned=extended_transaction_unsigned)
Beispiel #2
0
    def GetMessageTxn(self, request: xrd_pb2.MessageTxnReq,
                      context) -> xrd_pb2.TransferCoinsResp:
        logger.debug("[PublicAPI] GetMessageTxn")
        tx = self.xrdnode.create_message_txn(message_hash=request.message,
                                             addr_to=request.addr_to,
                                             fee=request.fee,
                                             xmss_pk=request.xmss_pk,
                                             master_addr=request.master_addr)

        extended_transaction_unsigned = xrd_pb2.TransactionExtended(
            tx=tx.pbdata, addr_from=tx.addr_from, size=tx.size)
        return xrd_pb2.TransferCoinsResp(
            extended_transaction_unsigned=extended_transaction_unsigned)
Beispiel #3
0
    def GetLatticeTxn(self, request: xrd_pb2.LatticeTxnReq,
                      context) -> xrd_pb2.TransferCoinsResp:
        logger.debug("[PublicAPI] GetLatticeTxn")
        tx = self.xrdnode.create_lattice_tx(pk1=request.pk1,
                                            pk2=request.pk2,
                                            pk3=request.pk3,
                                            fee=request.fee,
                                            xmss_pk=request.xmss_pk,
                                            master_addr=request.master_addr)

        extended_transaction_unsigned = xrd_pb2.TransactionExtended(
            tx=tx.pbdata, addr_from=tx.addr_from, size=tx.size)
        return xrd_pb2.TransferCoinsResp(
            extended_transaction_unsigned=extended_transaction_unsigned)
Beispiel #4
0
    def GetMultiSigVoteTxn(self, request: xrd_pb2.MultiSigVoteTxnReq,
                           context) -> xrd_pb2.TransferCoinsResp:
        logger.debug("[PublicAPI] GetMultiSigSpendTxnReq")
        tx = self.xrdnode.create_multi_sig_vote_txn(
            shared_key=request.shared_key,
            unvote=request.unvote,
            fee=request.fee,
            xmss_pk=request.xmss_pk,
            master_addr=request.master_addr)

        extended_transaction_unsigned = xrd_pb2.TransactionExtended(
            tx=tx.pbdata, addr_from=tx.addr_from, size=tx.size)
        return xrd_pb2.TransferCoinsResp(
            extended_transaction_unsigned=extended_transaction_unsigned)
Beispiel #5
0
    def GetMultiSigCreateTxn(self, request: xrd_pb2.MultiSigCreateTxnReq,
                             context) -> xrd_pb2.TransferCoinsResp:
        logger.debug("[PublicAPI] GetMultiSigCreateTxnReq")
        tx = self.xrdnode.create_multi_sig_txn(signatories=request.signatories,
                                               weights=request.weights,
                                               threshold=request.threshold,
                                               fee=request.fee,
                                               xmss_pk=request.xmss_pk,
                                               master_addr=request.master_addr)

        extended_transaction_unsigned = xrd_pb2.TransactionExtended(
            tx=tx.pbdata, addr_from=tx.addr_from, size=tx.size)
        return xrd_pb2.TransferCoinsResp(
            extended_transaction_unsigned=extended_transaction_unsigned)
Beispiel #6
0
    def TransferCoins(self, request: xrd_pb2.TransferCoinsReq,
                      context) -> xrd_pb2.TransferCoinsResp:
        logger.debug("[PublicAPI] TransferCoins")
        tx = self.xrdnode.create_send_tx(addrs_to=request.addresses_to,
                                         amounts=request.amounts,
                                         message_data=request.message_data,
                                         fee=request.fee,
                                         xmss_pk=request.xmss_pk,
                                         master_addr=request.master_addr)

        extended_transaction_unsigned = xrd_pb2.TransactionExtended(
            tx=tx.pbdata, addr_from=tx.addr_from, size=tx.size)
        return xrd_pb2.TransferCoinsResp(
            extended_transaction_unsigned=extended_transaction_unsigned)
Beispiel #7
0
    def GetTransferTokenTxn(self, request: xrd_pb2.TransferTokenTxnReq,
                            context) -> xrd_pb2.TransferCoinsResp:
        logger.debug("[PublicAPI] GetTransferTokenTxn")
        bin_token_txhash = bytes(hstr2bin(request.token_txhash.decode()))
        tx = self.xrdnode.create_transfer_token_txn(
            addrs_to=request.addresses_to,
            token_txhash=bin_token_txhash,
            amounts=request.amounts,
            fee=request.fee,
            xmss_pk=request.xmss_pk,
            master_addr=request.master_addr)

        extended_transaction_unsigned = xrd_pb2.TransactionExtended(
            tx=tx.pbdata, addr_from=tx.addr_from, size=tx.size)
        return xrd_pb2.TransferCoinsResp(
            extended_transaction_unsigned=extended_transaction_unsigned)
Beispiel #8
0
    def GetMultiSigSpendTxn(self, request: xrd_pb2.MultiSigSpendTxnReq,
                            context) -> xrd_pb2.TransferCoinsResp:
        logger.debug("[PublicAPI] GetMultiSigSpendTxnReq")
        tx = self.xrdnode.create_multi_sig_spend_txn(
            multi_sig_address=request.multi_sig_address,
            addrs_to=request.addrs_to,
            amounts=request.amounts,
            expiry_block_number=request.expiry_block_number,
            fee=request.fee,
            xmss_pk=request.xmss_pk,
            master_addr=request.master_addr)

        extended_transaction_unsigned = xrd_pb2.TransactionExtended(
            tx=tx.pbdata, addr_from=tx.addr_from, size=tx.size)
        return xrd_pb2.TransferCoinsResp(
            extended_transaction_unsigned=extended_transaction_unsigned)
Beispiel #9
0
    def GetTokenTxn(self, request: xrd_pb2.TokenTxnReq,
                    context) -> xrd_pb2.TransferCoinsResp:
        logger.debug("[PublicAPI] GetTokenTxn")
        tx = self.xrdnode.create_token_txn(
            symbol=request.symbol,
            name=request.name,
            owner=request.owner,
            decimals=request.decimals,
            initial_balances=request.initial_balances,
            fee=request.fee,
            xmss_pk=request.xmss_pk,
            master_addr=request.master_addr)

        extended_transaction_unsigned = xrd_pb2.TransactionExtended(
            tx=tx.pbdata, addr_from=tx.addr_from, size=tx.size)
        return xrd_pb2.TransferCoinsResp(
            extended_transaction_unsigned=extended_transaction_unsigned)