0

I am attempting to compose an XCM call that sends a message from the relay chain to AssetHub, from one normal account (on Rococo) to the same normal account (on AH), and then executes a call.

Once it has reached that account it will use Transact to execute an encoded call, which is to mint some asset for: asset_id 57, amount: 999,999,999,999, dest: Alice.

The normal account is the owner of the asset and has the authority to mint this asset.

The Transact part i think is pretty simple, its just an encoded call. However how do you curate the rest?

For MultiLocation: I imagine it is X1 and AccountId32 to 0x10b44f78c2668684521fda94a1cd6b9d4035156e8c073018d0d59e4aa8cca01b

DescendOrigin, BuyExecution and WithdrawAsset, i am not sure of...

where's the best place to learn about composing XCM calls?

1 Answer 1

2

You can find examples of using Transact and other XCM primitives at the docs https://paritytech.github.io/xcm-docs/journey/transact.html

Usually if using Transact, you want to also use it with BuyExecution and WithdrawAsset. Here's an example from the docs:

let call = parachain::RuntimeCall::Balances(
    pallet_balances::Call::<parachain::Runtime>::set_balance {
        who: ALICE,
        new_free: 5 * AMOUNT,
        new_reserved: 0,
    },
);

let message = Xcm(vec![
    WithdrawAsset((Here, AMOUNT).into()),
    BuyExecution { fees: (Here, AMOUNT).into(), weight_limit: WeightLimit::Unlimited },
    Transact {
        origin_kind: OriginKind::Superuser,
        require_weight_at_most: Weight::from_parts(INITIAL_BALANCE as u64, 1024 * 1024),
        call: call.encode().into(),
    },
]);

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.