Skip to content

How to sign transaction on the client side and then submit it on the server side on the Aptos #13

Answered by 0xaptosj
0xaptosj asked this question in Questions
Discussion options

You must be logged in to vote

Instead of trying to submit the transaction on the server side, there are a few things you can do on the contract (or even backend) side to ensure they've made a deposit:

Emit an event in your contract on the users' account when they escrow the coins, and have your backend server check their account for that
Run an indexer, and check for the expected interactions that way
If you send their signed txn to your backend, you open yourself up to the race condition of a user completing another txn after/during sending the signed txn to the backend, which increments the users seq_no, making the previously signed txn invalid

Replies: 2 comments

Comment options

0xaptosj
Mar 5, 2024
Maintainer Author

You must be logged in to vote
0 replies
Answer selected by 0xaptosj
Comment options

0xaptosj
Mar 5, 2024
Maintainer Author

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wallet Questions related to Aptos wallets ts-sdk Questions related to the TypeScript SDK
1 participant