mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-23 13:15:49 +00:00
update code
This commit is contained in:
@@ -5,21 +5,24 @@ from xrpl.wallet import Wallet
|
||||
testnet_url = "https://s.altnet.rippletest.net:51234"
|
||||
|
||||
|
||||
def broker_sale(_seed, _sell_offer_index, _buy_offer_index, _broker_fee):
|
||||
broker_wallet = Wallet(_seed, sequence = 16237283)
|
||||
client = JsonRpcClient(testnet_url)
|
||||
accept_offer_tx = xrpl.models.transactions.NFTokenAcceptOffer(
|
||||
account = broker_wallet.classic_address,
|
||||
nftoken_sell_offer = _sell_offer_index,
|
||||
nftoken_buy_offer = _buy_offer_index,
|
||||
nftoken_broker_fee = _broker_fee
|
||||
def broker_sale(seed, sell_offer_index, buy_offer_index, broker_fee):
|
||||
"""broker_sale"""
|
||||
broker_wallet=Wallet(seed, sequence=16237283)
|
||||
client=JsonRpcClient(testnet_url)
|
||||
accept_offer_tx=xrpl.models.transactions.NFTokenAcceptOffer(
|
||||
account=broker_wallet.classic_address,
|
||||
nftoken_sell_offer=sell_offer_index,
|
||||
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)
|
||||
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.send_reliable_submission(signed_tx,client)
|
||||
reply=response.result
|
||||
except xrpl.transaction.XRPLReliableSubmissionException as e:
|
||||
response = f"Submit failed: {e}"
|
||||
return response.result
|
||||
reply=f"Submit failed: {e}"
|
||||
return reply
|
||||
|
||||
Reference in New Issue
Block a user