chain_id
of 0
means that no other LP with the same address as yours has added liquidity, and you can proceed with the rest of this tutorial. Otherwise, confirm that you have control of the address on the returned chain_id
. If not, it means the address has been occupied by someone else and you need to use a different address._wdSeq
is a unique identifier for each withdrawal._receiver
is the receiver address on _toChain
._toChain
is the chain ID to receive the tokens withdrawn._fromChains
are a list of chain IDs to withdraw the tokens from. We support cross-chain withdrawals, that is to withdraw the liquidity from multiple chains to a single chain._tokens
are the token addresses on each chain. Make sure they refer to the same token symbol and they are supported by cBridge on all the chains involved._ratios
are the percentages of liquidity to be withdrawn from each chain. They should be all positive. The max ratio is 100000000, which means 100%._slippages
are the maximal allowed slippages for cross-chain withdrawals. Usually a small number such as 5000, which means 0.5%, should suffice. The max slippage is 1000000, which means 100%.<_wdSeq>
, <_receiver>
and <_toChain>
with the input parameters when you submitted the withdrawal request to WithdrawInbox. Leave type
as 2
and tx_hash
empty.status
field in the response:0
means no withdrawal request found. Check your query command first. If the fields were set correctly, it is possible that your withdrawal request has not been reflected in the cBridge / SGN system yet so please retry after a little while. If it keeps being 0
after quite a while, your request is likely rejected due to bad arguments. Check the instructions and try again. If you are sure the arguments are correct, it is possible that the withdraw amount is too large that it hit certain rate limits. Please contact us before you make another try.1
means the withdrawal request has been accepted, but not yet co-signed by validators. Please query again after a little while.2
means the withdrawal request is ready to be submitted on-chain. In this case, you will see a hex string in wd_onchain
along with a number of strings in sorted_sigs
, signers
, powers
.3
means the withdrawal request is being submitted on-chain.4
means the withdrawal request is completed, and tokens have been sent to the given address on the given chain if the request is not delayed due to large amount.5
means the withdrawal request has failed. Probably due to slippage being too small, but could be caused by other reasons such as insufficient liquidity or token transfer being disabled. Contact us for details before you make another try.6
means the withdrawal request has been delayed due to the amount being too large. It should usually turn into a 4
after about 30 minutes.2
, copy and save the wd_onchain
, sorted_sigs
, signers
and powers
fields for later use.2
, prepare the input parameters for the on-chain withdrawal transaction. As described in the withdraw function, you need to supply _wdmsg
, _sigs
, _signers
and _powers
. You can use an explorer like Etherscan to send the transaction.wd_onchain
you saved corresponds to _wdmsg
. Go to base64-to-hex, paste wd_onchain
on the left, switch GROUP BY
to NONE
on the right, add a hex prefix 0x
to the result on the right, and you will get _wdmsg
.sorted_sigs
, signers
and powers
, do not change the order of parameters within the arrays.sorted_sigs
corresponds to _sigs
. Convert the signature strings in sorted_sigs
one by one using the same way as with wd_onchain
, and put all 0x
prefixed strings in an array []
to get _sigs
.signers
corresponds to _signers
. Prepare them the same way as sorted_sigs
.powers
corresponds to _powers
. First, convert the strings the same way as with wd_onchain
but this time without adding 0x
prefixes. Second, go to hex-binary, switch CONVERT TO
to Decimal(10)
in the middle and convert the result from the first step to decimal number. Put all the numbers you get in an array []
to get _powers
.