Use shorter names for sign/submit

This commit is contained in:
JST5000
2023-06-15 13:29:54 -07:00
parent 965d8c20a2
commit 9e179c83c0
9 changed files with 16 additions and 16 deletions

View File

@@ -11,7 +11,7 @@ from xrpl import wallet
from xrpl.core import keypairs
from xrpl.utils import xrp_to_drops
from xrpl.models.transactions import Payment
from xrpl.transaction import safe_sign_transaction
from xrpl.transaction import sign
from xrpl.wallet.main import Wallet
@@ -80,7 +80,7 @@ def sign_transaction(xrp_amount, destination, ledger_seq, wallet_seq, password):
)
print("6. Signing transaction...")
my_tx_payment_signed = safe_sign_transaction(transaction=my_tx_payment, wallet=_wallet)
my_tx_payment_signed = sign(transaction=my_tx_payment, wallet=_wallet)
img = qrcode.make(my_tx_payment_signed.to_dict())

View File

@@ -12,7 +12,7 @@ from xrpl.wallet import Wallet
from xrpl.core import keypairs
from xrpl.utils import xrp_to_drops
from xrpl.models.transactions import Payment
from xrpl.transaction import safe_sign_transaction
from xrpl.transaction import sign
def create_wallet():
@@ -75,7 +75,7 @@ def sign_transaction(_xrp_amount, _destination, _ledger_seq, _wallet_seq, passwo
# Signs transaction and displays the signed_tx blob in QR code
# Scan the QR code and transmit the signed_tx blob to an online machine (Machine 2) to relay it to the XRPL
my_tx_payment_signed = safe_sign_transaction(transaction=my_tx_payment, wallet=_wallet)
my_tx_payment_signed = sign(transaction=my_tx_payment, wallet=_wallet)
img = qrcode.make(my_tx_payment_signed.to_dict())
img.save(get_path("/Wallet/transactionID.png"))

View File

@@ -132,7 +132,7 @@ class XRPLMonitorThread(Thread):
# rapidly if you track the sequence number more carefully.
tx_signed = await xrpl.asyncio.transaction.autofill_and_sign(
tx, self.wallet, self.client)
await xrpl.asyncio.transaction.submit_transaction(tx_signed, self.client)
await xrpl.asyncio.transaction.submit(tx_signed, self.client)
wx.CallAfter(self.gui.add_pending_tx, tx_signed)

View File

@@ -186,7 +186,7 @@ class XRPLMonitorThread(Thread):
# rapidly if you track the sequence number more carefully.
tx_signed = await xrpl.asyncio.transaction.autofill_and_sign(
tx, self.wallet, self.client)
await xrpl.asyncio.transaction.submit_transaction(tx_signed, self.client)
await xrpl.asyncio.transaction.submit(tx_signed, self.client)
wx.CallAfter(self.gui.add_pending_tx, tx_signed)

View File

@@ -204,7 +204,7 @@ class XRPLMonitorThread(Thread):
# rapidly if you track the sequence number more carefully.
tx_signed = await xrpl.asyncio.transaction.autofill_and_sign(
tx, self.wallet, self.client)
await xrpl.asyncio.transaction.submit_transaction(tx_signed, self.client)
await xrpl.asyncio.transaction.submit(tx_signed, self.client)
wx.CallAfter(self.gui.add_pending_tx, tx_signed)

View File

@@ -222,7 +222,7 @@ class XRPLMonitorThread(Thread):
# rapidly if you track the sequence number more carefully.
tx_signed = await xrpl.asyncio.transaction.autofill_and_sign(
tx, self.wallet, self.client)
await xrpl.asyncio.transaction.submit_transaction(tx_signed, self.client)
await xrpl.asyncio.transaction.submit(tx_signed, self.client)
wx.CallAfter(self.gui.add_pending_tx, tx_signed)

View File

@@ -24,5 +24,5 @@ print("Payment object:", my_payment)
# Sign transaction -------------------------------------------------------------
import xrpl.transaction
signed = xrpl.transaction.safe_sign_transaction(my_payment, wallet)
signed = xrpl.transaction.sign(my_payment, wallet)
print("Signed transaction blob:", signed)

View File

@@ -1,5 +1,5 @@
from xrpl.models.transactions import TicketCreate, AccountSet, SignerListSet, SignerEntry
from xrpl.transaction import safe_sign_and_submit_transaction, autofill, multisign, sign
from xrpl.transaction import sign_and_submit, autofill, multisign, sign
from xrpl.models.requests.account_objects import AccountObjects, AccountObjectType
from xrpl.models.requests.submit_multisigned import SubmitMultisigned
from xrpl.wallet import generate_faucet_wallet
@@ -55,7 +55,7 @@ tx_set_signer_list = SignerListSet(
# Sign transaction locally and submit
print("Submitting a SignerListSet transaction to update our account to use our new Signers...")
tx_set_signer_list_signed = safe_sign_and_submit_transaction(transaction=tx_set_signer_list, wallet=test_wallet, client=client)
tx_set_signer_list_signed = sign_and_submit(transaction=tx_set_signer_list, wallet=test_wallet, client=client)
# Construct a TicketCreate transaction, 3 tickets will be created
tx_create_ticket = TicketCreate(
@@ -65,7 +65,7 @@ tx_create_ticket = TicketCreate(
# Sign transaction locally and submit
print("Submitting a TicketCreate transaction to get Ticket Sequences for future transactions...")
tx_create_ticket_signed = safe_sign_and_submit_transaction(transaction=tx_create_ticket, wallet=test_wallet, client=client)
tx_create_ticket_signed = sign_and_submit(transaction=tx_create_ticket, wallet=test_wallet, client=client)
# Get a Ticket Sequence
get_ticket_sequence = client.request(AccountObjects(

View File

@@ -1,7 +1,7 @@
from xrpl.clients import JsonRpcClient
from xrpl.models.transactions import TicketCreate, AccountSet
from xrpl.transaction import safe_sign_and_submit_transaction
from xrpl.wallet import Wallet, generate_faucet_wallet
from xrpl.transaction import sign_and_submit
from xrpl.wallet import generate_faucet_wallet
from xrpl.models.requests.account_objects import AccountObjects, AccountObjectType
# Connect to a testnet node
@@ -19,7 +19,7 @@ tx = TicketCreate(
)
# Sign transaction locally and submit
my_tx_payment_signed = safe_sign_and_submit_transaction(transaction=tx, wallet=test_wallet, client=client)
my_tx_payment_signed = sign_and_submit(transaction=tx, wallet=test_wallet, client=client)
# Get a Ticket Sequence
get_ticket_sequence = AccountObjects(
@@ -48,7 +48,7 @@ tx_1 = AccountSet(
)
# Send transaction (w/ Ticket)
tx_result = safe_sign_and_submit_transaction(transaction=tx_1, client=client, wallet=test_wallet)
tx_result = sign_and_submit(transaction=tx_1, client=client, wallet=test_wallet)
result = tx_result.result["engine_result"]
print(f"Account: {myAddr}")