docs icon indicating copy to clipboard operation
docs copied to clipboard

How to query XCM transaction fees?

Open dudo50 opened this issue 2 years ago • 0 comments

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>'.
`);

dudo50 avatar Aug 14 '22 14:08 dudo50