def payment(self, destination, sender, amount, sequence, seed) -> bool: my_tx_payment = Payment( account=sender, amount=xrp_to_drops(amount), destination=destination, sequence=sequence, ) sign_wallet = Wallet(seed, sequence) my_tx_payment_signed = safe_sign_and_autofill_transaction( my_tx_payment, sign_wallet, self.client) tx_response = send_reliable_submission(my_tx_payment_signed, self.client) return True
# Derive an x-address from the classic address: # https://xrpaddress.info/ from xrpl.core import addresscodec test_xaddress = addresscodec.classic_address_to_xaddress(test_account, tag=12345, is_test_network=True) print("\nClassic address:\n\n", test_account) print("X-address:\n\n", test_xaddress) # Prepare payment from xrpl.models.transactions import Payment from xrpl.utils import xrp_to_drops my_tx_payment = Payment( account=test_account, amount=xrp_to_drops(22), destination="rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe", ) # print prepared payment print(my_tx_payment) # Sign the transaction from xrpl.transaction import safe_sign_and_autofill_transaction my_tx_payment_signed = safe_sign_and_autofill_transaction( my_tx_payment, test_wallet, client) # Print signed tx print("Signed tx:", my_tx_payment_signed)