I am trying to figure out correct way how to type MultiLocation type
I thought that I would do
import {MultiLocation} from "@polkadot/types/interfaces"
const location: MultiLocation = {
parents: 0,
interior: {
x1: { generalKey: "0x0001" }
}
};
but this does not work cause parents is u8 and number does not work there etc So I tried this solution which works
const loc: MultiLocation = api.createType(
"MultiLocation",
JSON.parse(
JSON.stringify({
parents: "0",
interior: {
x1: { generalKey: "0x0001" }
}
})
)
);
but I do not like this solution. IS there a correct way how to type this ? Thanks