Skip to content

getDestinationXcmWeightToFeeAsset throws an error with Interlay parachain #545

@Imod7

Description

@Imod7

Description

When calling getDestinationXcmWeightToFeeAsset with Interlay parachain, we have following behavior:

  1. If the Interlay url is given in the chainUrl

     const 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')
    
  2. If the Bifrost url is given in the chainUrl

    const 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.

Metadata

Metadata

Assignees

Labels

wontfixThis will not be worked on

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions