0

i have not found the examples to teleport between statemint and polkadot. is ther any one can give some examples in javascript.what i use is

@polkadot/api

this is my code:

i have found the teleport function.but there is some error

async function teleport() {
    let api = await getConn();
    
    let fromAddr = ADDR_1;
    let mnemonic = MNEMONIC_1;
    let toAddr=ADDR_2;
    let amount = new BigNumber(5).multipliedBy(westendDecimal).toString(10);
    let tx = api.tx.polkadotXcm.limitedTeleportAssets(toAddr,toAddr,amount,0,100000);
    await sendTransaction(mnemonic,fromAddr,tx);
}

but it execute error:

xecute error: Error: createType(Call):: Call: failed decoding polkadotXcm.limitedTeleportAssets:: Struct: failed on args: {"dest":"{\"_enum\":{\"V0\":\"XcmV0MultiLocation\",\"V1\":\"XcmV1MultiLocation\"}}","beneficiary":"{\"_enum\":{\"V0\":\"XcmV0MultiLocation\",\"V1\":\"XcmV1MultiLocation\"}}","assets":"{\"_enum\":{\"V0\":\"Vec<XcmV0MultiAsset>\",\"V1\":\"XcmV1MultiassetMultiAssets\"}}","fee_asset_item":"u32","weight_limit":"{\"_enum\":{\"Unlimited\":\"Null\",\"Limited\":\"Compact<u64>\"}}"}:: Struct: failed on dest: {"_enum":{"V0":"XcmV0MultiLocation","V1":"XcmV1MultiLocation"}}:: Cannot map Enum JSON, unable to find '5EWFCfvUqSkUVbsPSJNAkfGVqVTVwfc1c5XAg3qomDUR5eiR' in v0, v1

0

1 Answer 1

1

well~.i have found the result finaly.any one has the question can see https://github.com/polkadot-js/apps/blob/master/packages/page-parachains/src/Teleport.tsx#L77-L126

my test code is as follows: https://github.com/polariseye/polka_statemint_test

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.