Skip to content

Commit

Permalink
Merge pull request #674 from bvotteler/fix-manual-def-transactionpaym…
Browse files Browse the repository at this point in the history
…entapi-queryinfo

Fix: manual def transactionpaymentapi queryinfo
  • Loading branch information
bvotteler authored Aug 15, 2023
2 parents a3012ae + 6794946 commit 3a85386
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
8 changes: 7 additions & 1 deletion src/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
25 changes: 25 additions & 0 deletions src/interfaces/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 3a85386

Please sign in to comment.