SDK API
Static method
utils
Utils provides some basic conversion methods.
utils.bufferToHex
utils.bigIntToHex
utils.toBuffer
utils.intToHex
decodeRaw(raw)
Parse transaction RAW as a transaction object
Params | Type | Desc |
raw | String |
|
getBalance(walletAddress, rpcUrls, address):Promise
Get the balance
walletAddress: wallet address
rpcUrls: rpcUrl array
address: Contract address
Params | Type | Desc |
---|---|---|
walletAddress | String | wallet address |
rpcUrls | String | rpcUrl array |
address | String | Contract address |
getValueForHashRpc(rpc, hash, decimals):Promise
Get basic transaction information based on txHash
Params | Type | Desc |
---|---|---|
rpc | String | rpc |
hash | String | the transaction hash |
decimals | Number | decimals number |
Instance methods
getSupportChains(): Promise
Returns the supported chain
getSupportTokens():Promise
Returns the supported token
getCrossChainQuote(params):Promise
Get a quote for a cross chain transaction
Params | subParams | Type | Desc |
---|---|---|---|
params | Object | ||
amount | Number | token amount to be crossed without token decimal | |
feeLevel | String | Please refer to FeeLevel | |
fromChain | String | from chain name | |
toChain | String | to chain name | |
token | String | token to be crossed |
getAggregateQuote(params):Promise
Get a quote for a cross chain liquidity aggregator transaction
Params | subParams | Type | Desc |
---|---|---|---|
params | Object | ||
feeLevel | Number | Please refer to FeeLevel | |
fromAmount | String | token amount to be swapped without token decimal | |
fromToken | String | token to be swapped | |
toChain | String | to chain name | |
toToken | String | token swapped to |
getOrderDetail(sn):Promise
Get Order Detail
Params | Type | Desc |
---|---|---|
sn | String |
|
getTransferToMinterRaw(params):Promise
Get a raw for users to sign and then broadcast
Params | subParams | Type | Desc |
---|---|---|---|
params | Object | ||
amount | Number | token amount to be crossed without token decimal | |
chain | String | original chain name | |
evmAddress | String | user evm Address | |
fromAddress | String | user from address (If it is from a EVM chain, the address is same as evmAddress) | |
token | String | token to be crossed |
getTransferToMinterParams(params):Promise
Get Minter params for users to sign and then broadcast
Params | subParams | Type | Desc |
---|---|---|---|
params | Object | ||
amount | Number | token amount to be crossed without token decimal | |
chain | String | original chain name | |
evmAddress | String | user evm Address | |
fromAddress | String | user from address (If it is from a EVM chain, the address is same as evmAddress) | |
token | String | token to be crossed |
submitCrossChain(params):Promise
Submit transaction hash and start cross-chain
Params | subParams | Type | Desc |
---|---|---|---|
params | Object | ||
certHash | String | the transaction hash | |
evmAddress | String | user evm Address | |
feeLevel | Number | Please refer to FeelEvel | |
fromAddress | String | user from address (If it is from a EVM chain, the address is same as evmAddress) | |
fromAmount | Number | token amount to be swapped without token decimal | |
fromChain | String | from chain name | |
fromToken | String | token to be swapped | |
toChain | String | to chain name |
submitAggregate(params):Promise
Submit transaction hash and start cross chain liquidity swap
Params | subParams | Type | Desc |
---|---|---|---|
params | Object | ||
certHash | String | the transaction hash | |
evmAddress | String | user evm Address | |
feeLevel | Number | Please refer to FeelEvel | |
fromAddress | String | user from address (If it is from a EVM chain, the address is same as evmAddress) | |
fromAmount | Number | token amount to be swapped without token decimal | |
fromChain | String | from chain name | |
fromToken | String | token to be swapped | |
toChain | String | to chain name | |
toToken | String | token swapped to |
getOrderDetailByHashAndEvmAddress(params):Promise
Get order Detail By Hash And EvmAddress
Params | subParams | Desc | |
---|---|---|---|
params | |||
chain | String | original chain name | |
evmAddress | String | user evm Address | |
hash | String | the transaction hash |
executeCrossChainByHash(params, time = 10000, callback):Promise<Funciton>
Submit transaction hash and start cross-chain, return Order detail subscribe function.
Params | subParams | Type | Desc |
---|---|---|---|
params | Object | ||
certHash | String | the transaction hash | |
evmAddress | String | user evm Address | |
feeLevel | Number | Please refer to FeelEvel | |
fromAddress | String | user from address (If it is from a EVM chain, the address is same as evmAddress) | |
fromAmount | Number | token amount to be swapped without token decimal | |
fromChain | String | from chain name | |
fromToken | String | token to be swapped | |
toChain | String | to chain name | |
time | Number | The data update interval for the subscription function | |
callback | Function | Listening to the cross chain status |
executeAggregateByHash(params, time = 10000, callback):Promise<Funciton>
Submit transaction hash and start cross chain liquidity swap, return Order detail subscribe function.
Params | subParams | Type | Desc |
---|---|---|---|
params | Object | ||
certHash | String | the transaction hash | |
evmAddress | String | user evm Address | |
feeLevel | Number | Please refer to FeelEvel | |
fromAddress | String | user from address (If it is from a EVM chain, the address is same as evmAddress) | |
fromAmount | Number | token amount to be swapped without token decimal | |
fromChain | String | from chain name | |
fromToken | String | token to be swapped | |
toChain | String | to chain name | |
toToken | String | token swapped to | |
time | Number | The data update interval for the subscription function | |
callback | Function | Listening to the cross chain status |
executeCrossChain(params, time = 10000, callback):Promise<Funciton>
Submit transaction hash and start cross-chain, return Order detail subscribe function.
Params | subParams | Type | Desc |
---|---|---|---|
params | Object | ||
evmAddress | String | user evm Address | |
feeLevel | Number | Please refer to FeelEvel | |
fromAddress | String | user from address (If it is from a EVM chain, the address is same as evmAddress) | |
fromAmount | Number | token amount to be swapped without token decimal | |
fromChain | String | from chain name | |
fromToken | String | token to be swapped | |
toChain | String | to chain name | |
time | Number | The data update interval for the subscription function | |
callback | Function | Listening to the cross chain status |
executeAggregate(params, time = 10000, callback):Promise<Function>
Submit transaction hash and start cross chain liquidity swap, return Order detail subscribe function.
Params | subParams | Type | Desc |
params | | Object | |
| evmAddress | String | user evm Address |
| feeLevel | Number | Please refer to FeelEvel |
| fromAddress | String | user from address (If it is from a EVM chain, the address is same as evmAddress) |
| fromAmount | Number | token amount to be swapped without token decimal |
| fromChain | String | from chain name |
| fromToken | String | token to be swapped |
| toChain | String | to chain name |
| toToken | String | token swapped to |
time | | Number | The data update interval for the subscription function |
callback | | Function | Listening to the cross chain status |
execute(params, time = 10000, callback):Promise<Function>
Wrapper methods for
executeAggregate
andexecuteCrossChain
Params | subParams | Type | Desc |
params | | Object | |
| evmAddress | String | user evm Address |
| feeLevel | Number | Please refer to FeelEvel |
| fromAddress | String | user from address (If it is from a EVM chain, the address is same as evmAddress) |
| fromAmount | Number | token amount to be swapped without token decimal |
| fromChain | String | from chain name |
| fromToken | String | token to be swapped |
| toChain | String | to chain name |
| toToken | String | token swapped to |
time | | Number | The data update interval for the subscription function |
callback | | Function | Listening to the cross chain status |
executeByHash(params, time = 10000, callback):Promise<Function>Wrapper methods for executeCrossChainByHash and executeAggregateByHash
Params | subParams | Type | Desc |
params | | Object | |
| certHash | String | the transaction hash |
| evmAddress | String | user evm Address |
| feeLevel | Number | Please refer to FeelEvel |
| fromAddress | String | user from address (If it is from a EVM chain, the address is same as evmAddress) |
| fromAmount | Number | token amount to be swapped without token decimal |
| fromChain | String | from chain name |
| fromToken | String | token to be swapped |
| toChain | String | to chain name |
| toToken | String | token swapped to |
time | | Number | The data update interval for the subscription function |
callback | | Function | Listening to the cross chain status |
Last updated