def test_build_account(): remote = Remote() options_property = { 'type': 'property', 'account': 'j9fE48ebcvwnKSGnPdtN6jGNM9yVBMVaH8', 'set_flag': '2' } options_delegate = { 'type': 'delegate', 'account': 'j9fE48ebcvwnKSGnPdtN6jGNM9yVBMVaH8', 'delegate_key': 'jEmEWuLQXgtBaro86hScnBpjN3TgKSoQGD', 'set_flag': '123' } if not isinstance(remote.connect(), Exception): tx = remote.build_account_set_tx(options_property) tx.set_secret('ssTkYQLLYiZs7Sosp12sB43TocUbd') s = tx.submit() result = remote.parse_payment(s) logger.info(result) tx = remote.build_account_set_tx(options_delegate) tx.set_secret('ssTkYQLLYiZs7Sosp12sB43TocUbd') s = tx.submit() result = remote.parse_payment(s) logger.info(result)
def test_set_relation(): remote = Remote() options_trust = { 'type': 'trust', 'account': 'j9fE48ebcvwnKSGnPdtN6jGNM9yVBMVaH8', 'target': 'jEmEWuLQXgtBaro86hScnBpjN3TgKSoQGD', 'limit': { "value": "600000000000", "currency": "CCA", "issuer": "js7M6x28mYDiZVJJtfJ84ydrv2PthY9W9u" } } options_authorize = { 'type': 'authorize', 'account': 'j9fE48ebcvwnKSGnPdtN6jGNM9yVBMVaH8', 'target': 'jEmEWuLQXgtBaro86hScnBpjN3TgKSoQGD', 'limit': { "value": "0.5", "currency": "CCA", "issuer": "js7M6x28mYDiZVJJtfJ84ydrv2PthY9W9u" } } options_freeze = { 'type': 'freeze', 'account': 'j9fE48ebcvwnKSGnPdtN6jGNM9yVBMVaH8', 'target': 'jEmEWuLQXgtBaro86hScnBpjN3TgKSoQGD', 'limit': { "value": "0.5", "currency": "CCA", "issuer": "js7M6x28mYDiZVJJtfJ84ydrv2PthY9W9u" } } if not isinstance(remote.connect(), Exception): tx = remote.build_relation_tx(options_trust) tx.set_secret('ssTkYQLLYiZs7Sosp12sB43TocUbd') s = tx.submit() result = remote.parse_payment(s) logger.info(result) tx = remote.build_relation_tx(options_authorize) tx.set_secret('ssTkYQLLYiZs7Sosp12sB43TocUbd') s = tx.submit() result = remote.parse_payment(s) logger.info(result) tx = remote.build_relation_tx(options_freeze) tx.set_secret('ssTkYQLLYiZs7Sosp12sB43TocUbd') s = tx.submit() result = remote.parse_payment(s) logger.info(result)
def test_build_offer_cancel(): remote = Remote(local_sign=True) options = { 'sequence': 1777, 'account': 'jB7rxgh43ncbTX4WeMoeadiGMfmfqY2xLZ', } if not isinstance(remote.connect(), Exception): tx = remote.build_offer_cancel_tx(options) tx.set_secret('sn37nYrQ6KPJvTFmaBYokS3FjXUWd') s = tx.submit() result = remote.parse_payment(s) logger.info(result)
def test_create_pay_object(): remote = Remote(local_sign=True) if not isinstance(remote.connect(), Exception): options = { 'account': 'j9fE48ebcvwnKSGnPdtN6jGNM9yVBMVaH8', 'to': 'jEmEWuLQXgtBaro86hScnBpjN3TgKSoQGD', 'amount': { "value": 0.01, "currency": "SWT", "issuer": "" } } tx = remote.build_payment_tx(options) tx.set_secret('ssTkYQLLYiZs7Sosp12sB43TocUbd') tx.add_memo('给jDUjqoDZLhzx4DCf6pvSivjkjgtRESY62c支付0.5swt.') # 可选 tx.add_memo('给') # 可选 s = tx.submit() result = remote.parse_payment(s) logger.info(result)
def test_create_pay_object(): remote = Remote(local_sign=True) if not isinstance(remote.connect(), Exception): options = { 'account': 'jB7rxgh43ncbTX4WeMoeadiGMfmfqY2xLZ', 'to': 'jEmEWuLQXgtBaro86hScnBpjN3TgKSoQGD', 'amount': { "value": 444440.01, "currency": "SWT", "issuer": "" } } tx = remote.build_payment_tx(options) tx.set_secret('sn37nYrQ6KPJvTFmaBYokS3FjXUWd') tx.add_memo('给jDUjqoDZLhzx4DCf6pvSivjkjgtRESY62c支付0.5swt.') # 可选 #tx.add_memo('给') # 可选 s = tx.submit() result = remote.parse_payment(s) logger.info(result)
def test_build_offer_create(): remote = Remote(local_sign=True) options = { 'type': 'Sell', 'account': 'jB7rxgh43ncbTX4WeMoeadiGMfmfqY2xLZ', 'taker_gets': { 'value': '0.01', 'currency': '8100000036000020160622201606300120000002', 'issuer': 'jBciDE8Q3uJjf111VeiUNM775AMKHEbBLS' }, 'taker_pays': { 'value': '1', 'currency': 'SWT', 'issuer': '' } } if not isinstance(remote.connect(), Exception): tx = remote.build_offer_create_tx(options) tx.set_secret('sn37nYrQ6KPJvTFmaBYokS3FjXUWd') s = tx.submit() result = remote.parse_payment(s) logger.info(result)