docs
docs copied to clipboard
How to query XCM transaction fees?
Hello, using console.log part from this example from polkadotJS guides I get an error, that class, weight and partial Fee does not exist. I use TS language, could there be problem with that? I can imagine, that problem can be elsewhere also because in XCM transaction it is not so easy to calculate fees on destination chain also.. Thanks for any information regarding this. Code snippet is below:
const info = await api.tx.balances
.transfer(recipient, 123)
.paymentInfo(sender);
// log relevant info, partialFee is Balance, estimated for current
console.log(`
class=${info.class.toString()}, //Here I get error Property 'class' does not exist on type 'Promise<() => void>'.
weight=${info.weight.toString()}, //Here I get error Property 'weight' does not exist on type 'Promise<() => void>'.
partialFee=${info.partialFee.toHuman()} //Here I get error Property 'partialFee' does not exist on type 'Promise<() => void>'.
`);