VA - Withdrawal Delete and Register

Deleting a VA Withdrawal

With the Virtual Account ledger, it is possible to delete a withdrawal stuck with the status "InProgress". You can do so the following - v3 REST API endpoint.

Example request:

curl --request DELETE \
     --url 'https://api.tatum.io/v3/offchain/withdrawal/{Withdrawal_ID}?revert=true' \
     --header 'accept: application/json' \
     --header 'x-api-key: [API_KEY]'

Good to know:

  • Deleting a withdrawal from the VA ledger to the blockchain should only be done when the associated blockchain transaction failed and/or it was dropped from the mempool.
  • When deleting a withdrawal, be mindful of the optional parameter "revert"
    Defines IF the fee should be reverted to the account balance as well as with the amount. Defaults is true.
    Revert == true would be typically used when withdrawal was not broadcast to the blockchain.
    Revert == false is used usually for Ethereum based currencies when gas was consumed but transaction was reverted.
  • Deleting a withdrawal successfully processed by the blockchain will likely break your Virtual Account ledger. To fix this accounting issue, you will have to register the withdrawal again.

How to register a deleted Virtual Account withdrawal

  1. Use "StoreWithdrawal" - v3 REST API endpoint.
  2. Use "CompleteWithdrawal" - v3 REST API endpoint.

🚧

Make sure the asset amount, fee and any other parameters match with the intended values as seen in the blockchain as well as the Virtual Account ledger.

Disclaimer

On-chain balance has prevalence over the VA ledger balance. Balance desync on a VA ledger can be "fixed". On-chain operations are permanent and non-reversible.

We strongly encourage developers to implement redundant on-chain balance checks in their environment:

  1. After each deposit.
  2. Before executing any withdrawal from a VA ledger to the blockchain.

🚧

It is the responsability of the user to ensure on-chain balance liquidity.