getDestinationXcmWeightToFeeAsset throws an error with Interlay parachain
Description
When calling getDestinationXcmWeightToFeeAsset with Interlay parachain, we have following behavior:
-
If the Interlay url is given in the
chainUrlconst destinationFeesInfo = await AssetTransferApi.getDestinationXcmWeightToFeeAsset( 'interlay-parachain', 'wss://interlay-rpc.dwellir.com', this.safeXcmVersion, dryRunResult, tokenCode, );the following error is thrown:
Error estimating fee:' TypeError: Cannot read properties of undefined (reading 'queryXcmWeight') -
If the Bifrost url is given in the
chainUrlconst destinationFeesInfo = await AssetTransferApi.getDestinationXcmWeightToFeeAsset( 'interlay-parachain', 'wss://bifrost-polkadot.ibp.network', this.safeXcmVersion, dryRunResult, tokenCode, );The fee is retrieved
Root Cause
It seems that Interlay does not currently support the xcmPaymentApi so the queryXcmWeight function is not found when using their runtime.
Suggested Solution
Update the API to check for this error case.
Credits
Creadits to @marshacb for checking this issue.
It seems that Interlay does not currently support the xcmPaymentApi so the queryXcmWeight function is not found when using their runtime.
There are 2 solutions here, neither of which are trivial
- Push adoption of xcmPaymentApi everywhere
- Use dryRuns
dryRuns should effectively be supported everywhere but the computation becomes more complex. We also run into issues such as dryRuns failing due to lack of funds, which then must be hacked around by batching a minting call from root before dry running the desired extrinsic. Changes to the fee asset also become complex.
Related issue: https://github.com/paritytech/asset-transfer-api/issues/609
Marking as won't fix as we are dropping support for asset-transfer-api in favor of ParaSpell. See more in this issue: https://github.com/paritytech/asset-transfer-api/issues/652