當前位置: 首頁>>代碼示例>>Python>>正文


Python TransactionEnvelope.xdr方法代碼示例

本文整理匯總了Python中stellar_base.transaction_envelope.TransactionEnvelope.xdr方法的典型用法代碼示例。如果您正苦於以下問題:Python TransactionEnvelope.xdr方法的具體用法?Python TransactionEnvelope.xdr怎麽用?Python TransactionEnvelope.xdr使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在stellar_base.transaction_envelope.TransactionEnvelope的用法示例。


在下文中一共展示了TransactionEnvelope.xdr方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: do

# 需要導入模塊: from stellar_base.transaction_envelope import TransactionEnvelope [as 別名]
# 或者: from stellar_base.transaction_envelope.TransactionEnvelope import xdr [as 別名]
 def do(self, op):
     from stellar_base.transaction import Transaction
     from stellar_base.keypair import Keypair
     from stellar_base.transaction_envelope import TransactionEnvelope as Te
     tx = Transaction(source=self.source, opts={'sequence': self.seq})
     tx.add_operation(operation=op)
     envelope = Te(tx=tx, opts={"network_id": "TESTNET"})
     signer = Keypair.from_seed(seed=self.seed)
     envelope.sign(keypair=signer)
     envelope_b64 = envelope.xdr()
     print(envelope_b64)
     return envelope_b64
開發者ID:bartekn,項目名稱:py-stellar-base,代碼行數:14,代碼來源:test_envelope.py

示例2: make_envelope

# 需要導入模塊: from stellar_base.transaction_envelope import TransactionEnvelope [as 別名]
# 或者: from stellar_base.transaction_envelope.TransactionEnvelope import xdr [as 別名]
    def make_envelope(self, *args, **kwargs):
        from stellar_base.transaction import Transaction
        from stellar_base.keypair import Keypair
        from stellar_base.transaction_envelope import TransactionEnvelope as Te

        opts = {"sequence": self.seq, "fee": self.fee * len(args)}
        for opt, value in kwargs.items():
            opts[opt] = value
        tx = Transaction(source=self.address, opts=opts)
        for count, op in enumerate(args):
            tx.add_operation(operation=op)
        envelope = Te(tx=tx, opts={"network_id": "TESTNET"})
        signer = Keypair.from_seed(seed=self.seed)
        envelope.sign(keypair=signer)
        envelope_b64 = envelope.xdr()
        print(envelope_b64)
        return envelope_b64
開發者ID:jobforp,項目名稱:py-stellar-base,代碼行數:19,代碼來源:test_envelope.py

示例3: te_xdr_build

# 需要導入模塊: from stellar_base.transaction_envelope import TransactionEnvelope [as 別名]
# 或者: from stellar_base.transaction_envelope.TransactionEnvelope import xdr [as 別名]
def te_xdr_build(tx, secret):
    envelope = Envelope(tx)
    signer = Keypair.from_seed(secret)
    envelope.sign(signer)
    re = envelope.xdr()
    return re
開發者ID:andela-osule,項目名稱:py-stellar-base,代碼行數:8,代碼來源:build.py


注:本文中的stellar_base.transaction_envelope.TransactionEnvelope.xdr方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。