2

Is there an efficient way to solve the verification of a particular transaction in the server? For example, I want the user to transfer 100 XYZ tokens. But while confirming the transaction in the server, I don't want to check the transfer instructions. Is there a nonce/hashing mechanism that can be used here? This leads to unnecessary fetching of the transaction instructions and double verifying them.

1 Answer 1

1

If all you care about is the movement of tokens from account to account, you can use the getTransaction API.

The relevant parts of the response are these:

  • result.meta.{pre|post}Balances – Array of u64 lamport balances from before/after the transaction was processed
  • result.meta.{pre|post}TokenBalances – List of token balances from before/after the transaction was processed or omitted if token balance recording was not yet enabled during this transaction. Read more about this data structure here.

The balances are in the same order as the accounts in result.transaction.message.accountKeys.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.