mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-19 19:25:51 +00:00
Fixup
This commit is contained in:
@@ -1,16 +1,12 @@
|
||||
from xrpl.clients import JsonRpcClient
|
||||
from xrpl.models.transactions import AccountSet
|
||||
from xrpl.transaction import safe_sign_transaction, send_reliable_submission
|
||||
from xrpl.account import get_next_valid_seq_number
|
||||
from xrpl.ledger import get_latest_validated_ledger_sequence
|
||||
from xrpl.transaction import safe_sign_and_autofill_transaction, send_reliable_submission
|
||||
from xrpl.wallet import Wallet
|
||||
from xrpl.core import keypairs
|
||||
|
||||
myAddr = "r31FLxNkfFJwRXbJw82RYB6Fa7jmfA3ix1"
|
||||
mySeed = "sn51LT5QeaPYhjM1HL9-----------"
|
||||
myAddr = "rM4vA4uRpc2MtCoc4vdhhTwWqsWcncwaLL"
|
||||
mySeed = "ssJ4QYQLXomJLSKBT----------"
|
||||
|
||||
# Derive and initialize wallet
|
||||
public, private = keypairs.derive_keypair(mySeed)
|
||||
wallet_from_seed = Wallet(mySeed, 0)
|
||||
|
||||
# Connect to a testnet node
|
||||
@@ -19,14 +15,12 @@ client = JsonRpcClient(JSON_RPC_URL)
|
||||
|
||||
# Construct AccountSet transaction
|
||||
tx = AccountSet(
|
||||
account=myAddr,
|
||||
fee="10",
|
||||
sequence=get_next_valid_seq_number(address=myAddr, client=client),
|
||||
last_ledger_sequence=get_latest_validated_ledger_sequence(client=client)+20,
|
||||
account=myAddr
|
||||
)
|
||||
|
||||
# Sign the transaction locally & submit transaction and verify its validity on the ledger
|
||||
my_tx_payment_signed = safe_sign_transaction(transaction=tx, wallet=wallet_from_seed)
|
||||
# Sign the transaction locally
|
||||
my_tx_payment_signed = safe_sign_and_autofill_transaction(transaction=tx, wallet=wallet_from_seed, client=client)
|
||||
# Submit transaction and verify its validity on the ledger
|
||||
response = send_reliable_submission(transaction=my_tx_payment_signed, client=client)
|
||||
result = response.result["meta"]["TransactionResult"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user