💰Withdraw Digital Assets
Last updated
Last updated
Withdraw Digital Assets
Transfer assets from the aelf chain to other chains.
Withdraw processSDK - Withdraw Assets
Based on the token, network and other information selected by the user, generate TransactionRaw and submit it to the server to complete the creation of the withdrawal order.
First, init the ETransferCore instance. You can find it in ETransfer SDK Quick Start.
First, init the ETransferCore instance. You can find it in ETransfer SDK Quick Start.
Acquire the list of assets supported by ETransfer.You can find which assets are supported for withdrawal.
Example
Http Headers
Header | Type | Required | Remarks |
---|---|---|---|
Authorization |
|
| The authorization token is the result returned by /connect/token. How to acquire: ETransfer SDK Auth. |
Method Parameters
Field | Type | Required | Remarks |
---|---|---|---|
type |
|
| Business type: |
chainId |
|
|
|
Method return value
Field | Type | Remarks |
---|---|---|
tokenList |
| Crypto array |
TTokenItem
type
Field | Type | Remarks |
---|---|---|
name |
| Crypto name |
symbol |
| Crypto symbol |
icon |
| Crypto logo url |
contractAddress |
| ETransfer contract address |
decimals |
| Crypto decimals |
Acquire the list of networks supported by ETransfer.You can find which networks are supported for withdrawal.You can get the basic information and the block confirmations of the network, etc.
Example
Http Headers
Header | Type | Required | Remarks |
---|---|---|---|
Authorization |
|
| The authorization token is the result returned by /connect/token. How to acquire: ETransfer SDK Auth. |
Method Parameters
Field | Type | Required | Remarks |
---|---|---|---|
type |
|
| Business type: |
chainId |
|
|
|
symbol |
|
| Get data from eTransferCore.services.getTokenList |
address |
|
| Withdrawal address. Please remove the prefix and suffix of the ELF-DID address. |
Method return value
Field | Type | Remarks |
---|---|---|
network |
| Network |
name |
| Network name |
multiConfirm |
| Network block confirmations |
multiConfirmTime |
| Network block confirmation time |
contractAddress |
| Network contract address |
explorerUrl |
| Network explorer address |
status |
| Network health status |
withdrawFee |
| Network withdrawal fee |
withdrawFeeUnit |
| Network withdrawal fee unit |
Acquire the withdrawal information and transaction fee.
Please check the minimum withdrawal limit and remaining limit.
Example
Http Headers
Header | Type | Required | Remarks |
---|---|---|---|
Authorization |
|
| The authorization token is the result returned by /connect/token. How to acquire: ETransfer SDK Auth. |
Method Parameters
Field | Type | Required | Remarks |
chainId |
|
|
|
network |
|
| Get data from eTransferCore.services.getNetworkList |
symbol |
|
| Get data from eTransferCore.services.getTokenList |
amount |
|
| Withdrawal amount, without decimals |
address |
|
| Withdrawal address. Please remove the prefix and suffix of the ELF-DID address |
version |
|
|
Recommend using |
Method return value
Field | Type | Remarks |
amountUsd |
| Withdrawal amount in USD |
maxAmount |
| Maximum withdrawal amount |
minAmount |
| Minimum withdrawal amount |
receiveAmount |
| Estimated amount to be received |
receiveAmountUsd |
| Estimated USD received |
limitCurrency |
| Withdrawal crypto |
totalLimit |
| Total limit |
remainingLimit |
| Remaining Limit |
transactionFee |
| Transaction fee |
transactionUnit |
| Transaction fee unit |
aelfTransactionFee |
| Aelf transaction fee |
aelfTransactionUnit |
| Aelf transaction fee unit |
feeUsd |
| Total transaction fees in USD |
expiredTimestamp |
| The expiration time of this response |
There are two ways to create an order:
Create a withdrawal order, including additional business logic.
Before generating TransactionRaw, a series of transaction strategies such as balance judgment, allowance judgment, and approval are required, and finally TransactionRaw is generated and submitted to the ETransfer server.This method includes the above series of verification processes.
Example
Http Headers
Header | Type | Required | Remarks |
---|---|---|---|
Authorization |
|
| The authorization token is the result returned by /connect/token. How to acquire: ETransfer SDK Auth. |
Method Parameters
Field | Type | Required | Remarks |
---|---|---|---|
tokenContractAddress |
|
| Token contract address |
endPoint |
|
| End point url |
symbol |
|
| Withdrawal crypto, Get data from eTransferCore.services.getTokenList |
decimals |
|
| Withdrawal crypto decimals |
amount |
|
| Withdrawal amount, without decimals |
accountAddress |
|
| Aelf chain account address |
eTransferContractAddress |
|
| ETransfer contract address |
toAddress |
|
| Withdrawal address |
caContractAddress |
|
| Aelf ca contract address |
caHash |
|
| User 's ca hash |
network |
|
| Withdrawal network, Get data from eTransferCore.services.getNetworkList |
chainId |
|
|
|
managerAddress |
|
| User 's manager address |
getSignature |
|
| Get wallet signature method |
tokenContractCallSendMethod |
|
| Send token contract method |
Method return value
Field | Type | Remarks |
---|---|---|
orderId |
| Order id |
transactionId |
| Transaction id. You can use this transactionId to view transaction details in the browser. |
Only create orders, no additional business logic required.
This method does not include a series of verification processes.
Example
Http Headers
Header | Type | Required | Remarks |
---|---|---|---|
Authorization |
|
| The authorization token is the result returned by /connect/token. How to acquire: ETransfer SDK Auth. |
Method Parameters
Field | Type | Required | Remarks |
network |
|
| Get data from eTransferCore.services.getNetworkList |
symbol |
|
| Get data from eTransferCore.services.getTokenList |
amount |
|
| Withdrawal amount, without decimals |
fromChainId |
|
|
|
toAddress |
|
| Withdrawal address. Please remove the prefix and suffix of the ELF-DID address |
rawTransaction |
|
| Transaction raw |
Method return value
Field | Type | Remarks |
orderId |
| Order id |
transactionId |
| Transaction id. You can use this transactionId to view transaction details in the browser. |