sephynox / xrpl-rust

A 100% Rust library to interact with the XRPL. XRPL Grant Winner
https://crates.io/crates/xrpl-rust
ISC License
16 stars 8 forks source link

Add high-level methods for transactions #36

Open LimpidCrypto opened 1 year ago

LimpidCrypto commented 1 year ago
  1. The function simply calls the Tx request method using the WebsocketClient/AsyncWebsocketClient.

fields type explanation
txn_hash &str The transaction hash.
client WebsocketClient/AsyncWebsocketClient A websocket client object.
binary Option<bool> A boolean to determine wether to return the transaction as binary serialized to hexadecimal strings or as JSON.
min_ledger Option<u32> A Ledger Index to begin search.
max_ledger Option<u32> A Ledger Index to search up to.

Sources:

2.

  1. If check_fee is None, check_fee is True.
fields type explanation
transaction Transaction The transaction that needs to get signed
wallet Wallet The wallet used to sign the transaction.
check_fee Option<bool> Bool if the provided fee defined in the transaction could be lower.
  1. Simply calls the sign_transaction function and uses the submit request method to submit the transaction to the network using the WebsocketClient/AsyncWebsocketClient.
fields type explanation
transaction Transaction The transaction that needs to get signed
wallet Wallet The wallet used to sign the transaction.
check_fee Option<bool> Bool if the provided fee defined in the transaction could be lower.
client WebsocketClient/AsyncWebsocketClient A websocket client object.
  1. Autofills fields like fee and signs the given transaction locally by calling sign_transaction.

  2. The method should have a parameter to choose the get_fee calculation type. This Parameter should be optional. If None the default value should be FeeType::Open.

fields type explanation
transaction Transaction The transaction that needs to get signed
wallet Wallet The wallet used to sign the transaction.
client WebsocketClient/AsyncWebsocketClient A websocket client object.
fee_type Option<FeeType> A enum to determine the fee calculation type.
  1. Turns a transaction into a transaction blob and uses the SubmitOnly request method to submit it using the client.

fields type explanation
transaction Transaction The transaction that needs to get signed
client WebsocketClient/AsyncWebsocketClient A websocket client object.

Sources:

  1. Calls the submit_transaction and waits until get_transaction_from_hash returns a validated transaction.

fields type explanation
transaction Transaction The transaction that needs to get signed
client WebsocketClient/AsyncWebsocketClient A websocket client object.

Sources: