本文整理汇总了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
示例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
示例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