There are two withdrawal methods from a Virtual Account:
- From a Virtual Account deposit address
- From a Master Exchange Address
Additional information is available at the following link.
Steps for Virtual Account asset withdrawal from Exchange Master Address
- Store information about withdrawal
- Check the id of the Virtual Account, the available balance or the UTXO balance
- Decrease the
amount
andfees
from the Virtual Account - Prepare transaction to broadcast transfer to the blockchain
- Blockchain transfer
- Standard blockchain transfer from address to address
- Verify the result of the transfer
- Complete/Rollback
- IF blockchain transfer fails - rollback VA balance
- ELSE complete withdrawal
Example:
User_A
:VirtualAccount_A
balance is 0 MATIC.User_A
:DepositAddress_A
connected toVirtualAccount_A
receives 3 MATIC.VirtualAccount_A
balance is now 3 MATIC.
Exchange_Owner
: Transfers 3 MATIC fromDepositAddress_A
toMasterBlockchainAddress
.- This is a standard Blockchain transfer via: Send MATIC from account to account
VirtualAccount_A
balance remains 3 MATIC.
User_A
: Withdraws and transfers 3 MATIC fromVirtualAccount_A
toVirtualAccount_B
owned byUser_B
.- Endpoint: Send payment
VirtualAccount_A
balance is now 0 MATIC.VirtualAccount_B
balance is now 3 MATIC.
User_B
: Withdraws to transfer out 3 MATIC fromVirtualAccount_B
to an unrelated blockchain address.Exchange_Owner
: Store withdrawal -->/v3/offchain/withdrawal
Exchange_Owner
: Standard blockchain transfer via: Send MATIC from account to accountExchange_Owner
: Completes or Cancels the withdrawal- Complete withdrawal -->
/v3/offchain/withdrawal/{id}/{txId}
- Cancel withdrawal -->
/v3/offchain/withdrawal/{id}
- Complete withdrawal -->
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article