From e23aa5a9a98ad12a949d82d88cac135f40756c78 Mon Sep 17 00:00:00 2001 From: Wojciech Basiura Date: Tue, 8 Oct 2024 11:09:16 +0200 Subject: [PATCH] L1-287: Add `yearly_inflation` and `current_era_payout` runtime calls types --- packages/apps-config/package.json | 1 + .../apps-config/src/api/spec/aleph-zero.ts | 10 ++++++++++ packages/apps-config/src/api/typesBundle.ts | 10 ++++++++++ packages/apps-config/src/types.ts | 20 +++++++++++++++++++ yarn.lock | 1 + 5 files changed, 42 insertions(+) diff --git a/packages/apps-config/package.json b/packages/apps-config/package.json index 9578394f4d72..2b4a1e2e4a9d 100644 --- a/packages/apps-config/package.json +++ b/packages/apps-config/package.json @@ -39,6 +39,7 @@ "@pendulum-chain/type-definitions": "0.3.8", "@phala/typedefs": "0.2.33", "@polkadot/api": "^10.11.2", + "@polkadot/api-base": "^10.11.2", "@polkadot/api-derive": "^10.11.2", "@polkadot/networks": "^12.6.2", "@polkadot/react-identicon": "^3.6.4", diff --git a/packages/apps-config/src/api/spec/aleph-zero.ts b/packages/apps-config/src/api/spec/aleph-zero.ts index 92b0e99c665e..06d2773b8430 100644 --- a/packages/apps-config/src/api/spec/aleph-zero.ts +++ b/packages/apps-config/src/api/spec/aleph-zero.ts @@ -90,6 +90,16 @@ export default { description: '', params: [], type: 'u32' + }, + yearly_inflation: { + description: 'Returns inflation from now to now + one year.', + params: [], + type: 'Perbill' + }, + current_era_payout: { + description: 'Returns payout. First tuple item is a validators payout, second is the rest.', + params: [], + type: '(Balance, Balance)' } }, version: 1 diff --git a/packages/apps-config/src/api/typesBundle.ts b/packages/apps-config/src/api/typesBundle.ts index 680682da78c3..15adf0c14584 100644 --- a/packages/apps-config/src/api/typesBundle.ts +++ b/packages/apps-config/src/api/typesBundle.ts @@ -98,6 +98,16 @@ export const typesBundle = { "description": "", "params": [], "type": "u32" + }, + "yearly_inflation": { + "description": "Returns inflation from now to now + one year.", + "params": [], + "type": "Perbill" + }, + "current_era_payout": { + "description": "Returns payout. First tuple item is a validators payout, second is the rest.", + "params": [], + "type": "(Balance, Balance)" } }, "version": 1 diff --git a/packages/apps-config/src/types.ts b/packages/apps-config/src/types.ts index 8d57eda9ffae..287e16af098c 100644 --- a/packages/apps-config/src/types.ts +++ b/packages/apps-config/src/types.ts @@ -1,6 +1,26 @@ // Copyright 2017-2024 @polkadot/apps-config authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ApiTypes, AugmentedCall, DecoratedCallBase } from '@polkadot/api-base/types'; +import type { Perbill } from '@polkadot/types/interfaces/runtime'; +import type { Observable } from '@polkadot/types/types'; + +declare module '@polkadot/api-base/types/calls' { + interface AugmentedCalls { + /** 0xbc9d89904f5b923f/1 */ + alephSessionApi?: { + /** + * The API to query account nonce (aka transaction index) + **/ + yearlyInflation?: AugmentedCall Observable>; + /** + * Generic call + **/ + [key: string]: DecoratedCallBase | undefined; + }; + } +} + export interface TOptions { ns?: string; replace?: Record diff --git a/yarn.lock b/yarn.lock index d7d2690bda00..fcbd38aecb5a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1987,6 +1987,7 @@ __metadata: "@pendulum-chain/type-definitions": "npm:0.3.8" "@phala/typedefs": "npm:0.2.33" "@polkadot/api": "npm:^10.11.2" + "@polkadot/api-base": "npm:^10.11.2" "@polkadot/api-derive": "npm:^10.11.2" "@polkadot/networks": "npm:^12.6.2" "@polkadot/react-identicon": "npm:^3.6.4"