For that we can't just make a transaction because we may override others transactions in the same block.
So, when we receive a new request to withdraw, we add this withdraw transaction at the end of the transactions queue.
To sum up:
withdraw endpoint on API
check if amount is negative
check that the correct user has requested the withdraw
We need to add withdraw in API.
For that we can't just make a transaction because we may override others transactions in the same block. So, when we receive a new request to withdraw, we add this withdraw transaction at the end of the transactions queue.
To sum up: