Skip to content

Instantly share code, notes, and snippets.

@Sajjon
Created April 2, 2021 15:42
Show Gist options
  • Save Sajjon/ccbdc5c36f1b77d6e34ab72a77d1d7e9 to your computer and use it in GitHub Desktop.
Save Sajjon/ccbdc5c36f1b77d6e34ab72a77d1d7e9 to your computer and use it in GitHub Desktop.
Make tx flow
  1. πŸ™‹πŸΎβ€β™€οΈ userinputs transaction details (recipient, amount, token etc) and passes inputs to library.
  2. πŸ’» wallettransforms unsafe inputs into validated TransactionIntent.
  3. πŸ›  libraryrequests Radix Core API to build transaction from intent and returns built transaction with human-readable fee to wallet.
  4. πŸ›  librarysigns transaction
  5. πŸ›  librarysubmits signed transaction to Radix Core API which promtly returns initial OK/ERR response, wallet handles this initial response. Response contains txID.
  6. OPTIONAL πŸ’» walletdisplays transaction fee and txID and waits for user to confirm transaction with PIN code.
  7. πŸ›  libraryfinalizes signed transaction with txID to Radix Core API which promtly returns initial OK/ERR response, wallet handles this initial response.
  8. πŸ’» walletpolls status of transaction (using txID from step 5), using appropriate library api, and informs user of final CONFIRMED/REJECTED result.
  9. πŸ™‹πŸΎβ€β™€οΈ useracts on any failures, e.g. presses "Retry"-button, if prompted with one because of network connection issues during step 7.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment