mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-21 04:05:49 +00:00
Update cancel_escrow.py
This commit is contained in:
@@ -2,19 +2,18 @@ from xrpl.models import EscrowCancel
|
|||||||
from xrpl.clients import JsonRpcClient
|
from xrpl.clients import JsonRpcClient
|
||||||
from xrpl.transaction import (safe_sign_and_autofill_transaction,
|
from xrpl.transaction import (safe_sign_and_autofill_transaction,
|
||||||
send_reliable_submission)
|
send_reliable_submission)
|
||||||
from xrpl.wallet import Wallet
|
from xrpl.wallet import Wallet, generate_faucet_wallet
|
||||||
|
|
||||||
client = JsonRpcClient("https://s.altnet.rippletest.net:51234") # connect to the testnetwork
|
client = JsonRpcClient("https://s.altnet.rippletest.net:51234") # connect to the testnetwork
|
||||||
|
|
||||||
# Cancel an escrow
|
# Cancel an escrow
|
||||||
# If the escrow wasnt created with a CancelAfter time, it never expires and this transaction fails
|
# If the escrow wasnt created with a CancelAfter time, it never expires and this transaction fails
|
||||||
|
|
||||||
sender_seed = "sxxxxxxxxxxxxxxxxxxxxxx" # sender seeed
|
escrow_creator = generate_faucet_wallet(client=client).classic_address # escrow creator/ sender address
|
||||||
escrow_creator = "rxxxxxxxxxxxxxxxxxxxxxxxxxxx" # escrow creator/ sender address
|
|
||||||
escrow_seq = int # escrow sequence
|
escrow_seq = int # escrow sequence
|
||||||
|
|
||||||
# generate wallet object
|
# generate wallet object
|
||||||
sender_wallet = Wallet(seed=sender_seed, sequence=0)
|
sender_wallet = generate_faucet_wallet(client=client)
|
||||||
|
|
||||||
# build escrow cancel transaction
|
# build escrow cancel transaction
|
||||||
cancel_txn = EscrowCancel(account=sender_wallet.classic_address, owner=escrow_creator, offer_sequence=escrow_seq)
|
cancel_txn = EscrowCancel(account=sender_wallet.classic_address, owner=escrow_creator, offer_sequence=escrow_seq)
|
||||||
|
|||||||
Reference in New Issue
Block a user