Skip to content

Commit 3a85386

Browse files
authored
Merge pull request #674 from bvotteler/fix-manual-def-transactionpaymentapi-queryinfo
Fix: manual def transactionpaymentapi queryinfo
2 parents a3012ae + 6794946 commit 3a85386

File tree

3 files changed

+33
-2
lines changed

3 files changed

+33
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@interlay/interbtc-api",
3-
"version": "2.4.1",
3+
"version": "2.4.2",
44
"description": "JavaScript library to interact with interBTC",
55
"main": "build/src/index.js",
66
"typings": "build/src/index.d.ts",

src/factory.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,13 @@ export function createSubstrateAPI(
2929

3030
const types = getAPITypes();
3131
const rpc = getRPCTypes();
32-
return ApiPromise.create({ provider, types, rpc, noInitWarn: noInitWarn || true });
32+
return ApiPromise.create({
33+
provider,
34+
types,
35+
rpc,
36+
noInitWarn: noInitWarn || true,
37+
runtime: definitions.default.runtime
38+
});
3339
}
3440

3541
export async function createInterBtcApi(

src/interfaces/definitions.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,31 @@ export default {
33
types: definitions.types[0].types,
44
rpc: parseProviderRpcDefinitions(definitions.rpc),
55
providerRpc: definitions.rpc,
6+
// manual definition for transactionPaymentApi.queryInfo until polkadot-js/api can be upgraded
7+
// TODO: revert when this work is merged: https://github.com/interlay/interbtc-api/pull/672
8+
runtime: {
9+
TransactionPaymentApi: [
10+
{
11+
methods: {
12+
queryInfo: {
13+
description: 'Retrieves the fee information for an encoded extrinsic',
14+
params: [
15+
{
16+
name: 'uxt',
17+
type: 'Extrinsic'
18+
},
19+
{
20+
name: 'len',
21+
type: 'u32'
22+
}
23+
],
24+
type: 'RuntimeDispatchInfo'
25+
}
26+
},
27+
version: 4
28+
}
29+
]
30+
}
631
};
732

833
function parseProviderRpcDefinitions(

0 commit comments

Comments
 (0)