XRPL Transaction Methods

Top-level exports for the transaction package.

exception xrpl.transaction.XRPLReliableSubmissionException

Bases: xrpl.constants.XRPLException

General XRPL Reliable Submission Exception.

xrpl.transaction.get_transaction_from_hash(tx_hash: str, client: xrpl.clients.client.Client)xrpl.models.response.Response

Given a transaction hash, fetch the corresponding transaction from the ledger.

Parameters
  • tx_hash – the transaction hash.

  • client – the network client used to communicate with a rippled node.

Returns

The Response object containing the transaction info.

Raises

XRPLRequestFailureException – if the transaction fails.

xrpl.transaction.safe_sign_and_autofill_transaction(transaction: xrpl.models.transactions.transaction.Transaction, wallet: xrpl.wallet.main.Wallet, client: xrpl.clients.client.Client)xrpl.models.transactions.transaction.Transaction

Signs a transaction locally, without trusting external rippled nodes. Autofills relevant fields.

Parameters
  • transaction – the transaction to be signed.

  • wallet – the wallet with which to sign the transaction.

  • client – a network client.

Returns

The signed transaction.

xrpl.transaction.safe_sign_and_submit_transaction(transaction: xrpl.models.transactions.transaction.Transaction, wallet: xrpl.wallet.main.Wallet, client: xrpl.clients.client.Client, autofill: bool = True)xrpl.models.response.Response

Signs a transaction (locally, without trusting external rippled nodes) and submits it to the XRPL.

Parameters
  • transaction – the transaction to be signed and submitted.

  • wallet – the wallet with which to sign the transaction.

  • client – the network client with which to submit the transaction.

  • autofill – whether to autofill the relevant fields. Defaults to True.

Returns

The response from the ledger.

xrpl.transaction.safe_sign_transaction(transaction: xrpl.models.transactions.transaction.Transaction, wallet: xrpl.wallet.main.Wallet)xrpl.models.transactions.transaction.Transaction

Signs a transaction locally, without trusting external rippled nodes.

Parameters
  • transaction – the transaction to be signed.

  • wallet – the wallet with which to sign the transaction.

Returns

The signed transaction blob.

xrpl.transaction.send_reliable_submission(transaction: xrpl.models.transactions.transaction.Transaction, client: xrpl.clients.client.Client)xrpl.models.response.Response

Submits a transaction and verifies that it has been included in a validated ledger (or has errored/will not be included for some reason).

See Reliable Transaction Submission

Parameters
  • transaction – the signed transaction to submit to the ledger. Requires a last_ledger_sequence param.

  • client – the network client used to submit the transaction to a rippled node.

Returns

The response from a validated ledger.

Raises

XRPLReliableSubmissionException – if the transaction fails or is misisng a last_ledger_sequence param.

xrpl.transaction.submit_transaction(transaction: xrpl.models.transactions.transaction.Transaction, client: xrpl.clients.client.Client)xrpl.models.response.Response

Submits a transaction to the ledger.

Parameters
  • transaction – the Transaction to be submitted.

  • client – the network client with which to submit the transaction.

Returns

The response from the ledger.

Raises

XRPLRequestFailureException – if the rippled API call fails.

xrpl.transaction.transaction_json_to_binary_codec_form(dictionary: Dict[str, Any])Dict[str, Any]

Returns a new dictionary in which the keys have been formatted as CamelCase and standardized to be serialized by the binary codec.

Parameters

dictionary – The dictionary to be reformatted.

Returns

A new dictionary object that has been reformatted.