From 77f7f4397b2adc8706776e75d6791f44cc4630ac Mon Sep 17 00:00:00 2001 From: Brendon Votteler Date: Tue, 15 Aug 2023 16:52:33 +0800 Subject: [PATCH 1/2] fix: manual definition for transactionPaymentApi.queryInfo --- src/factory.ts | 8 +++++++- src/interfaces/definitions.ts | 25 +++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/factory.ts b/src/factory.ts index 2c79abf68..588b267f5 100644 --- a/src/factory.ts +++ b/src/factory.ts @@ -29,7 +29,13 @@ export function createSubstrateAPI( const types = getAPITypes(); const rpc = getRPCTypes(); - return ApiPromise.create({ provider, types, rpc, noInitWarn: noInitWarn || true }); + return ApiPromise.create({ + provider, + types, + rpc, + noInitWarn: noInitWarn || true, + runtime: definitions.default.runtime + }); } export async function createInterBtcApi( diff --git a/src/interfaces/definitions.ts b/src/interfaces/definitions.ts index 33a3b92aa..f14f7b124 100644 --- a/src/interfaces/definitions.ts +++ b/src/interfaces/definitions.ts @@ -3,6 +3,31 @@ export default { types: definitions.types[0].types, rpc: parseProviderRpcDefinitions(definitions.rpc), providerRpc: definitions.rpc, + // manual definition for transactionPaymentApi.queryInfo until polkadot-js/api can be upgraded + // TODO: revert when this work is merged: https://github.com/interlay/interbtc-api/pull/672 + runtime: { + TransactionPaymentApi: [ + { + methods: { + queryInfo: { + description: 'Retrieves the fee information for an encoded extrinsic', + params: [ + { + name: 'uxt', + type: 'Extrinsic' + }, + { + name: 'len', + type: 'u32' + } + ], + type: 'RuntimeDispatchInfo' + } + }, + version: 4 + } + ] + } }; function parseProviderRpcDefinitions( From 67949463f075c44185c484254cad0f3c2ff8f08f Mon Sep 17 00:00:00 2001 From: Brendon Votteler Date: Tue, 15 Aug 2023 16:52:40 +0800 Subject: [PATCH 2/2] chore: bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index edeed1a54..d5cde4213 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@interlay/interbtc-api", - "version": "2.4.1", + "version": "2.4.2", "description": "JavaScript library to interact with interBTC", "main": "build/src/index.js", "typings": "build/src/index.d.ts",