Skip to content

Commit

Permalink
L1-287: Add yearly_inflation and current_era_payout runtime calls…
Browse files Browse the repository at this point in the history
… types
  • Loading branch information
youPickItUp committed Oct 8, 2024
1 parent 25467cd commit e23aa5a
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/apps-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 10 additions & 0 deletions packages/apps-config/src/api/spec/aleph-zero.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions packages/apps-config/src/api/typesBundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 20 additions & 0 deletions packages/apps-config/src/types.ts
Original file line number Diff line number Diff line change
@@ -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<ApiType extends ApiTypes> {
/** 0xbc9d89904f5b923f/1 */
alephSessionApi?: {
/**
* The API to query account nonce (aka transaction index)
**/
yearlyInflation?: AugmentedCall<ApiType, () => Observable<Perbill>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType> | undefined;
};
}
}

export interface TOptions {
ns?: string;
replace?: Record<string, unknown>
Expand Down
1 change: 1 addition & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit e23aa5a

Please sign in to comment.