Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: manual def transactionpaymentapi queryinfo #674

Merged
merged 2 commits into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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