CHAINGE SDK API V1.0
API:
getConfig(): Config
Get basic information about the current instance
decodeRaw(raw:string): Raw|undefined
Parse transaction RAW as a transaction object
getBalances(walletAddress: string, tokens: string[]):Promise<string[]>
Get the balance list
Params | Type | Desc |
---|---|---|
walletAddress | String | wallet address |
tokens | String[] | Contract address |
resolveHash(ethereum: window.ethereum | Signer | ExternalProvider, txHash: string):Promise<TransactonInfo | undefined>
Get basic transaction information based on txHash
Params | Type | Desc |
---|---|---|
ethereum | ethereum | window.ethereum, Signer or ExternalProvider |
txHash | String | the transaction hash |
execute(ethereum: window.ethereum | Signer | ExternalProvider, params: ExecuteParams, options: StatusOptions):Promise<void>
Cross-chain polymerization method
Params | subParams | Type | Desc |
---|---|---|---|
ethereum | ethereum | window.ethereum, Signer or ExternalProvider | |
params | ExecuteParams | main params | |
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 | string | 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 | |
options | StatusOptions | config info | |
mills | number | Order refresh frequency | |
progressCallback | Function | Cross-chain state request function | |
orderCallback | Function | Order status callback function |
getSupportChains(): Promise<BaseResponse>
Returns the supported chain
getSupportTokens():Promise<BaseResponse>
Returns the supported token
getCrossChainQuote(params):Promise<BaseResponse>
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<BaseResponse>
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: string):Promise<BaseResponse>
Get Order Detail
Params | Type | Desc |
---|---|---|
sn | String |
|
getTransferToMinterRaw(params):Promise<BaseResponse>
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<BaseResponse>
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<BaseResponse>
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<BaseResponse>
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<BaseResponse>
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 |
getFeeLevelInfo():Promise<BaseResponse>
Return feeLevel ratio
getServerTime():Promise<BaseResponse>
A reasonable time to return the service signature
getAllExternalChainInfo():Promise<BaseResponse>
Get additional information about related links, such as rpcUrls, browerUrls, etc
getTokenSortByKey(appKey: string):Promise<BaseResponse>
Get your custom sorted token list according to appKey
getTokenPrice(token:string):Promise<BaseResponse>
Gets the current price of the token
Last updated