Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add high-level methods for transactions #36

Open
6 tasks
LimpidCrypto opened this issue Sep 2, 2022 · 0 comments · May be fixed by #71
Open
6 tasks

Add high-level methods for transactions #36

LimpidCrypto opened this issue Sep 2, 2022 · 0 comments · May be fixed by #71
Labels
3rd month Planned to be worked on in the third month. Estimate budget: 10,000 $ enhancement New feature or request XRPL Grants This issue is planned to get resoled as part of the XRPL Grants program (within 8 months)

Comments

@LimpidCrypto
Copy link
Collaborator

  • get_transaction_from_hash
  1. Queries the Ledger for a transaction using the given transaction hash.

  2. 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:

  1. Signs a transaction locally.

  2. 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.
  • sign_and_submit_transaction
  1. Signs a transaction locally and submits it to the network.

  2. 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.
  • autofill_and_sign_transaction
  1. Autofills and locally signs a transaction.

  2. Autofills fields like fee and signs the given transaction locally by calling sign_transaction.

  3. 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.
  • submit_transaction -> Response
  1. Submits a signed transaction to the XRP Ledger.

  2. 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. Submits a transaction to the XRP Ledger and waits until it got a result from the Ledger back.

  2. 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:

@LimpidCrypto LimpidCrypto added enhancement New feature or request 3rd month Planned to be worked on in the third month. Estimate budget: 10,000 $ XRPL Grants This issue is planned to get resoled as part of the XRPL Grants program (within 8 months) labels Sep 2, 2022
@LimpidCrypto LimpidCrypto added this to the Add high-level methods milestone Sep 2, 2022
@LimpidCrypto LimpidCrypto linked a pull request Sep 10, 2023 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3rd month Planned to be worked on in the third month. Estimate budget: 10,000 $ enhancement New feature or request XRPL Grants This issue is planned to get resoled as part of the XRPL Grants program (within 8 months)
Projects
Status: 🔖 Ready
Development

Successfully merging a pull request may close this issue.

1 participant