I'm trying to create the encoded element for an XCM V0 transact call such as:
const message = {
V0: {
Transact: {
originType: "Native",
requireWeightAtMost: 100000,
call: {
encoded: "0x280016000000" //ex: templatePallet.doSomething(22)
}
}
}
}
But how to create the encoded call ?
I've tried this without success:
let templatePallet_hex_call = await parachainApiInstInsurance.tx.templatePallet.doSomething(22).signAsync(account);
...
const message = {
V0: {
Transact: {
originType: "Native",
requireWeightAtMost: 100000,
call: {
encoded: compactAddLength(hexToU8a(templatePallet_hex_call.toHex()))
}
}
}
}
Any clue or documentation for this ? Thanks in advance.
PS: I've seen this thread but it's not using javascript.