Resubmit Python2 updates

This commit is contained in:
ddawson
2023-09-05 13:58:05 -07:00
parent 3de3aa68f0
commit 757bfd4c07
17 changed files with 1406 additions and 352 deletions

View File

@@ -1,5 +1,4 @@
import xrpl
import json
from xrpl.clients import JsonRpcClient
from xrpl.wallet import Wallet
testnet_url = "https://s.altnet.rippletest.net:51234"
@@ -7,7 +6,7 @@ testnet_url = "https://s.altnet.rippletest.net:51234"
def broker_sale(seed, sell_offer_index, buy_offer_index, broker_fee):
"""broker_sale"""
broker_wallet=Wallet(seed, sequence=16237283)
broker_wallet=Wallet.from_seed(seed)
client=JsonRpcClient(testnet_url)
accept_offer_tx=xrpl.models.transactions.NFTokenAcceptOffer(
account=broker_wallet.classic_address,
@@ -15,13 +14,10 @@ def broker_sale(seed, sell_offer_index, buy_offer_index, broker_fee):
nftoken_buy_offer=buy_offer_index,
nftoken_broker_fee=broker_fee
)
# Sign and fill the transaction
signed_tx=xrpl.transaction.safe_sign_and_autofill_transaction(
accept_offer_tx, broker_wallet, client)
# Submit the transaction and report the results
reply=""
try:
response=xrpl.transaction.send_reliable_submission(signed_tx,client)
response=xrpl.transaction.submit_and_wait(accept_offer_tx,client,broker_wallet)
reply=response.result
except xrpl.transaction.XRPLReliableSubmissionException as e:
reply=f"Submit failed: {e}"