From a8b38b09d6841fb094b20090b0e2840a656bb333 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Mon, 17 Jul 2023 10:25:44 +0200 Subject: [PATCH] Added FungiblesApi version 2 (#5687) * Added FungiblesApi version 2 * Add exception to inspectType --- packages/types/src/interfaces/definitions.spec.ts | 4 +++- .../types/src/interfaces/fungibles/runtime.ts | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/packages/types/src/interfaces/definitions.spec.ts b/packages/types/src/interfaces/definitions.spec.ts index d0d7741914..ca871b124a 100644 --- a/packages/types/src/interfaces/definitions.spec.ts +++ b/packages/types/src/interfaces/definitions.spec.ts @@ -126,7 +126,9 @@ describe('runtime definitions', (): void => { for (const [key, { params, type }] of methodsEntries) { describe(`${key}`, (): void => { // Applied from runtime, used in Funglibles - if (type !== 'Result, FungiblesAccessError>') { + const skipInspectType = type === 'Result, FungiblesAccessError>' || type === 'Result'; + + if (!skipInspectType) { it(`output ${type} is known`, (): void => { expect(() => inspectType(type)).not.toThrow(); }); diff --git a/packages/types/src/interfaces/fungibles/runtime.ts b/packages/types/src/interfaces/fungibles/runtime.ts index 5a580ccc44..b6525fc34b 100644 --- a/packages/types/src/interfaces/fungibles/runtime.ts +++ b/packages/types/src/interfaces/fungibles/runtime.ts @@ -19,6 +19,21 @@ export const runtime: DefinitionsCall = { } }, version: 1 + }, + { + methods: { + query_account_balances: { + description: 'Returns the list of all `MultiAsset` that an `AccountId` has', + params: [ + { + name: 'account', + type: 'AccountId' + } + ], + type: 'Result' + } + }, + version: 2 } ] };