Withdraw Digital Assets
Last updated
Last updated
Withdraw Digital Assets
Transfer assets from the aelf chain to other chains.
SDK - 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
Authorization
string
true
The authorization token is the result returned by /connect/token.
Method Parameters
type
BusinessType
true
Business type: 'Deposit'
chainId
ChainId
true
'AELF' | 'tDVV'
Method return value
tokenList
TTokenItem[]
Crypto array
TTokenItem
type
name
string
Crypto name
symbol
string
Crypto symbol
icon
string
Crypto logo url
contractAddress
string
ETransfer contract address
decimals
number
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
Authorization
string
true
The authorization token is the result returned by /connect/token.
Method Parameters
type
BusinessType
true
Business type: 'Withdraw'
chainId
ChainId
true
'AELF' | 'tDVV'
symbol
string
false
Get data from eTransferCore.services.getTokenList
address
string
false
Withdrawal address. Please remove the prefix and suffix of the ELF-DID address.
Method return value
network
string
Network
name
string
Network name
multiConfirm
string
Network block confirmations
multiConfirmTime
string
Network block confirmation time
contractAddress
string
Network contract address
explorerUrl
string
Network explorer address
status
NetworkStatus
Network health status 'Health' | 'Congesting' | 'Offline'
withdrawFee
string
Network withdrawal fee
withdrawFeeUnit
string
Network withdrawal fee unit
Acquire the withdrawal information and transaction fee.
Please check the minimum withdrawal limit and remaining limit.
Example
Http Headers
Authorization
string
true
The authorization token is the result returned by /connect/token.
Method Parameters
Field
Type
Required
Remarks
chainId
ChainId
true
'AELF' | 'tDVV'
network
string
false
Get data from eTransferCore.services.getNetworkList
symbol
string
false
Get data from eTransferCore.services.getTokenList
amount
string
false
Withdrawal amount, without decimals
address
string
false
Withdrawal address. Please remove the prefix and suffix of the ELF-DID address
version
PortkeyVersion
false
'v1' | 'v2'
.
Recommend using 'v2'
Method return value
Field
Type
Remarks
amountUsd
string
Withdrawal amount in USD
maxAmount
string
Maximum withdrawal amount
minAmount
string
Minimum withdrawal amount
receiveAmount
string
Estimated amount to be received
receiveAmountUsd
string
Estimated USD received
limitCurrency
string
Withdrawal crypto
totalLimit
string
Total limit
remainingLimit
string
Remaining Limit
transactionFee
string
Transaction fee
transactionUnit
string
Transaction fee unit
aelfTransactionFee
string
Aelf transaction fee
aelfTransactionUnit
string
Aelf transaction fee unit
feeUsd
string
Total transaction fees in USD
expiredTimestamp
string
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
Authorization
string
true
The authorization token is the result returned by /connect/token.
Method Parameters
tokenContractAddress
string
true
Token contract address
endPoint
string
true
End point url
symbol
string
true
Withdrawal crypto, Get data from eTransferCore.services.getTokenList
decimals
string | number
true
Withdrawal crypto decimals
amount
string
true
Withdrawal amount, without decimals
accountAddress
string
true
Aelf chain account address
eTransferContractAddress
string
true
ETransfer contract address
toAddress
string
true
Withdrawal address
caContractAddress
string
true
Aelf ca contract address
caHash
string
true
User 's ca hash
network
string
true
Withdrawal network, Get data from eTransferCore.services.getNetworkList
chainId
ChainId
true
'AELF' | 'tDVV
'
managerAddress
string
true
User 's manager address
getSignature
TGetSignatureFunc
true
Get wallet signature method
tokenContractCallSendMethod
(params: CallContractParams<T>, sendOptions?: SendOptions): Promise<R & {transactionId: string;}> | undefined
true
Send token contract method
Method return value
orderId
string
Order id
transactionId
string
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
Authorization
string
true
The authorization token is the result returned by /connect/token.
Method Parameters
Field
Type
Required
Remarks
network
string
true
Get data from eTransferCore.services.getNetworkList
symbol
string
true
Get data from eTransferCore.services.getTokenList
amount
string
true
Withdrawal amount, without decimals
fromChainId
ChainId
true
'AELF' | 'tDVV'
toAddress
string
true
Withdrawal address. Please remove the prefix and suffix of the ELF-DID address
rawTransaction
string
true
Transaction raw
Method return value
Field
Type
Remarks
orderId
string
Order id
transactionId
string
Transaction id. You can use this transactionId to view transaction details in the browser.
How to acquire: .
How to acquire: .
How to acquire: .
How to acquire: .
How to acquire: .