## Kusama -> Karura ```javascript= const provider = new WsProvider(); const api = await ApiPromise.create({ provider }); const tx = api.tx.xcmPallet.reserveTransferAssets; const account = api.createType('AccountId32', '2xxxxxxxxxxxxxxxxxxxxxxxxxxx').toHex(); const dst = { X1: { ParaChain: '2000' }, parents: 0 }; const acc = { X1: { AccountId32: { id: account, network: 'Any' } } }; const ass = [{ ConcreteFungible: { amount: '1000000000000' } }] const call = tx( { V0: dst }, { V0: acc }, { V0: ass }, 0 ); // send call await call.signAndSend(...); ``` ## Karura -> Kusama ```javascript= const provider = new WsProvider('KARURA_ENDPOINT'); const api = await ApiPromise.create(options({ provider })); const tx = api.tx.xTokens.transfer; const account = api.createType('AccountId32', '2xxxxxxxxxxxxxxxxxxxxxxxxxxx').toHex(); const acc = { interior: { X1: { AccountId32: { id: accountId, network: 'Any' } } }, parents: 1 }; const call = tx( { Token: "KSM" }, '1000000000000', { V1: acc }, 5 * 1_000_000_000 ); // send call await call.signAndSend(...); ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up