Withdraw Funds from Escrow
To withdraw funds deposited previously to an escrow account associated to a chainlet, you will need the chain-id
associated to the chainlet.
Please note that unlike escrow deposits, that allow you to specify a specific amount, withdrawing of funds from an escrow account withdraws all the funds you deposited. This is an all-or-nothing operation. It will only allow you to withdraw funds that have been deposited from an account that you own or control.
To withdraw funds from an escrow account, use
Withdrawal Example
Let us step through the withdrawal with the help of an example.
Let us assume that we have a chainlet with a chain-id
of magicwarriors_1698795593524888-1
Prior to making the withdrawal, this chainlet had access to funds from two separate accounts i.e. one belonging to the chainlet owner, and the other belonging to a different user with a key named fundkey
.
Now, the user with the key fundkey
wishes to withdraw his/her contribution of10,000,000,000
upsaga
tokens from the chainlet's escrow.
Checking the Account Balance Pre-Withdrawal
Before we process this withdrawal, let us take a look at the account balance associated with the key fundkey
:
Account saga14hyhswxf0shnpzup406yvjejmfsrjnvzq897re
(associated with key fundkey
) has a balance of 8,000,000,000 upsaga
tokens.
Process Escrow Withdrawal
Now, we will process an escrow withdrawal from chainlet magicwarriors_1698795593524888-1
To do so, we will execute a withdraw-escrow
transaction in the following manner:
As can be seen from the output above, the withdrawal returned the funds to the account with the key fundkey
whose account address is saga17gk4chqd0lrkyamrxdmu62czmu0dpnemmxlymn
.
Checking the Account Post-Withdrawal
We can also check whether the account address saga17gk4chqd0lrkyamrxdmu62czmu0dpnemmxlymn
received the funds back and that its account balance was updated:
Yes, the account saga17gk4chqd0lrkyamrxdmu62czmu0dpnemmxlymn
received all of the funds (10,000,000,000upsaga
tokens) from the escrow, and its balance was correctly updated.
IMPORTANT: Withdrawing all of the funds in a chainlet escrow account, on behalf of all funders, will change the escrow account balance to zero which will instruct the SAGA Platform to stop running the chainlet and its related RPC and Chainlet Explorer infrastructure and services. In order to keep your chainlet live, make sure the chainlet escrow account has always enough funds to pay for the epoch fees.
Further Details
For further details and options on escrow withdrawal, please see
Last updated