diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c13072a62..e4788966b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,9 +5,10 @@ Changes: - Add `derive.chain.subscribeFinalized{Heads, Blocks}` which returns all finalized, no skips -- Support Moonbeam author extraction on `derive.chain.*` (w/ shared logic extraction) -- Cater for `BlockBuilder 2/3/4` & `GrandpaApi 2` runtime interface definitions +- Support Moonbeam author extraction on `derive.chain.*` (w/ shared logic dedupe) +- Cater for older `BlockBuilder 2/3/4` & `GrandpaApi 2` runtime interface definitions - Support for `NominationPoolsApi` runtime interface +- Support for `NimbusApi` runtime interface (& older `AuthorFilterAPI`) - Add Kusama 9250 upgrade block diff --git a/packages/types/src/interfaces/definitions.ts b/packages/types/src/interfaces/definitions.ts index 696b637487..77269a987a 100644 --- a/packages/types/src/interfaces/definitions.ts +++ b/packages/types/src/interfaces/definitions.ts @@ -64,7 +64,8 @@ export { default as xcm } from './xcm/definitions'; export { default as contractsAbi } from './contractsAbi/definitions'; export { default as eth } from './eth/definitions'; -// orml definitions +// additional known/community definitions +export { default as nimbus } from './nimbus/definitions'; export { default as ormlOracle } from './ormlOracle/definitions'; export { default as ormlTokens } from './ormlTokens/definitions'; diff --git a/packages/types/src/interfaces/nimbus/definitions.ts b/packages/types/src/interfaces/nimbus/definitions.ts new file mode 100644 index 0000000000..cf1b866912 --- /dev/null +++ b/packages/types/src/interfaces/nimbus/definitions.ts @@ -0,0 +1,15 @@ +// Copyright 2017-2022 @polkadot/types authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +// order important in structs... :) +/* eslint-disable sort-keys */ + +import type { Definitions } from '../../types'; + +import { runtime } from './runtime'; + +export default { + rpc: {}, + runtime, + types: {} +} as Definitions; diff --git a/packages/types/src/interfaces/nimbus/index.ts b/packages/types/src/interfaces/nimbus/index.ts new file mode 100644 index 0000000000..2d307291c3 --- /dev/null +++ b/packages/types/src/interfaces/nimbus/index.ts @@ -0,0 +1,4 @@ +// Auto-generated via `yarn polkadot-types-from-defs`, do not edit +/* eslint-disable */ + +export * from './types'; diff --git a/packages/types/src/interfaces/nimbus/runtime.ts b/packages/types/src/interfaces/nimbus/runtime.ts new file mode 100644 index 0000000000..95f68f1101 --- /dev/null +++ b/packages/types/src/interfaces/nimbus/runtime.ts @@ -0,0 +1,77 @@ +// Copyright 2017-2022 @polkadot/types authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import type { DefinitionsCall } from '../../types'; + +export const runtime: DefinitionsCall = { + // deprecated, the NimbusApi is current - this is for backwards compat + AuthorFilterAPI: [ + { + methods: { + can_author: { + description: 'The runtime api used to predict whether an author will be eligible in the given slot', + params: [ + { + name: 'author', + type: 'AccountId' + }, + { + name: 'relayParent', + type: 'u32' + }, + { + name: 'parentHeader', + type: 'Header' + } + ], + type: 'bool' + } + }, + version: 2 + }, + { + methods: { + can_author: { + description: 'The runtime api used to predict whether an author will be eligible in the given slot', + params: [ + { + name: 'author', + type: 'AccountId' + }, + { + name: 'relayParent', + type: 'u32' + } + ], + type: 'bool' + } + }, + version: 1 + } + ], + NimbusApi: [ + { + methods: { + can_author: { + description: 'The runtime api used to predict whether a Nimbus author will be eligible in the given slot', + params: [ + { + name: 'author', + type: 'AccountId' + }, + { + name: 'relayParent', + type: 'u32' + }, + { + name: 'parentHeader', + type: 'Header' + } + ], + type: 'bool' + } + }, + version: 1 + } + ] +}; diff --git a/packages/types/src/interfaces/nimbus/types.ts b/packages/types/src/interfaces/nimbus/types.ts new file mode 100644 index 0000000000..b7b11e2de3 --- /dev/null +++ b/packages/types/src/interfaces/nimbus/types.ts @@ -0,0 +1,4 @@ +// Auto-generated via `yarn polkadot-types-from-defs`, do not edit +/* eslint-disable */ + +export type PHANTOM_NIMBUS = 'nimbus'; diff --git a/packages/types/src/interfaces/types.ts b/packages/types/src/interfaces/types.ts index c06d05dd57..6c934ffee8 100644 --- a/packages/types/src/interfaces/types.ts +++ b/packages/types/src/interfaces/types.ts @@ -37,6 +37,7 @@ export * from './identity/types'; export * from './imOnline/types'; export * from './lottery/types'; export * from './mmr/types'; +export * from './nimbus/types'; export * from './nompools/types'; export * from './offchain/types'; export * from './offences/types';