mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-22 20:55:50 +00:00
revise per Rome feedback
This commit is contained in:
@@ -1,32 +1,20 @@
|
|||||||
from xrpl.core import keypairs
|
|
||||||
|
|
||||||
# Define network client
|
|
||||||
from xrpl.clients import JsonRpcClient
|
|
||||||
JSON_RPC_URL = "https://s.altnet.rippletest.net:51234/"
|
|
||||||
client = JsonRpcClient(JSON_RPC_URL)
|
|
||||||
|
|
||||||
# Define signer address
|
# Define signer address
|
||||||
|
import os
|
||||||
|
my_secret = os.getenv("MY_SECRET")
|
||||||
from xrpl.wallet import Wallet
|
from xrpl.wallet import Wallet
|
||||||
test_wallet_1 = Wallet(seed="shrPSF6vV3v3yoND9J3NeKks6M3xd")
|
wallet = Wallet(seed="MY_SECRET")
|
||||||
print(test_wallet_1.classic_address) # "raaFKKmgf6CRZttTVABeTcsqzRQ51bNR6Q"
|
print(wallet.classic_address) # "raaFKKmgf6CRZttTVABeTcsqzRQ51bNR6Q"
|
||||||
|
|
||||||
# Prepate the tranaaction
|
|
||||||
from xrpl.ledger import get_latest_validated_ledger_sequence
|
|
||||||
current_validated_ledger = get_latest_validated_ledger_sequence(client)
|
|
||||||
min_ledger = current_validated_ledger + 1
|
|
||||||
max_ledger = min_ledger + 20
|
|
||||||
|
|
||||||
from xrpl.models.transactions import Payment
|
from xrpl.models.transactions import Payment
|
||||||
# not working in testing
|
from xrpl.utils import xrp_to_drops
|
||||||
# from xrpl.utils import xrp_to_drops
|
|
||||||
my_payment = Payment(
|
my_payment = Payment(
|
||||||
account=test_wallet_1.classic_address,
|
account=test_wallet_1.classic_address,
|
||||||
amount="2200000",
|
amount=xrp_to_drops(22),
|
||||||
|
fee=xrp_to_drops(10),
|
||||||
destination="rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe",
|
destination="rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe",
|
||||||
sequence=test_wallet_1.next_sequence_num,
|
sequence="16126889",
|
||||||
)
|
)
|
||||||
print("Payment object:", my_payment)
|
print("Payment object:", my_payment)
|
||||||
print(f"Can be validated in ledger range: {min_ledger} - {max_ledger}")
|
|
||||||
|
|
||||||
# Sign transaction -------------------------------------------------------------
|
# Sign transaction -------------------------------------------------------------
|
||||||
import xrpl.transaction
|
import xrpl.transaction
|
||||||
|
|||||||
Reference in New Issue
Block a user