You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// for karura-kusama cross-chains,constkaruraAdapter=newKaruraAdapter(karuraWalletSDK);constkusamaAdapter=newKusmaAdapter(kusamaApi);constcrossChain=newCrossChain({adapters: [acalaAdapter,kusamaAdapter]});
subscribe cross-chain transfer status need setup destination chain adapter
judged based on the balance change, not very accurate
consttransfer=crossChain.createTransfer({from: 'karura',to: 'kusama',account: string,amount: newFixedpointNumber(1,12),});awaittransfer.tx.signAndSend(ACCOUNT)transfer.watch({timeout: 3*60*1000// will wait 3 mins for checking destiantion balance change}).subscribe({next: ()=>{// do something}})
How To Support A New Chain
add chain data at configschains.tx
add CrossChainAdapter by creating a new adapters/[CHIAN_NAME]Dapter.ts file
implement the adapter
propertes:
chain
routers
methods:
subscrineEnv
subscribe the transfer environments include min/max input amount, token ED.etc.
getCrossChainFeeConfigs
get the cross-chain fee configs
subscribeBalance
subscribe the balance informations for token
createTx
used for create cross-chain transfer
The text was updated successfully, but these errors were encountered:
How To Use
1. Init SDK
2. Query Available Destination Chains
3. Query Available From Chains
4. Query Available Tokens
5. Query Transfer Configs
transfer configs contain the important information for the cross-chain transfer
6. Create Cross Chain Transfer
7. Subscribe Cross Chain Transfer Success Or Not
NOTICES:
How To Support A New Chain
subscribe the transfer environments include min/max input amount, token ED.etc.
get the cross-chain fee configs
subscribe the balance informations for token
used for create cross-chain transfer
The text was updated successfully, but these errors were encountered: