From 97c7625557b30df3835e5e0c1487f8a9201bc48f Mon Sep 17 00:00:00 2001 From: Jaco Date: Tue, 7 Mar 2023 08:49:10 +0200 Subject: [PATCH] Align runtime APIs with latest Substrate (#5521) --- CHANGELOG.md | 7 ++ packages/api-augment/src/kusama/runtime.ts | 26 ++++- packages/api-augment/src/polkadot/runtime.ts | 26 ++++- packages/api-augment/src/substrate/runtime.ts | 52 +++++++++ .../types-augment/src/registry/interfaces.ts | 6 +- .../types/src/interfaces/beefy/runtime.ts | 5 + packages/types/src/interfaces/definitions.ts | 1 + .../types/src/interfaces/nfts/definitions.ts | 18 +++ packages/types/src/interfaces/nfts/index.ts | 4 + packages/types/src/interfaces/nfts/runtime.ts | 110 ++++++++++++++++++ packages/types/src/interfaces/nfts/types.ts | 12 ++ .../src/interfaces/nompools/definitions.ts | 3 +- .../types/src/interfaces/nompools/runtime.ts | 28 +++++ .../types/src/interfaces/nompools/types.ts | 5 +- .../src/interfaces/staking/definitions.ts | 3 + .../types/src/interfaces/staking/runtime.ts | 24 ++++ packages/types/src/interfaces/types.ts | 1 + 17 files changed, 326 insertions(+), 5 deletions(-) create mode 100644 packages/types/src/interfaces/nfts/definitions.ts create mode 100644 packages/types/src/interfaces/nfts/index.ts create mode 100644 packages/types/src/interfaces/nfts/runtime.ts create mode 100644 packages/types/src/interfaces/nfts/types.ts create mode 100644 packages/types/src/interfaces/staking/runtime.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index d6629d618c..bf16151eca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # CHANGELOG +## master + +Changes: + +- Align runtime APIs with latest Substrate + + ## 10.0.1 Mar 4, 2023 Contributed: diff --git a/packages/api-augment/src/kusama/runtime.ts b/packages/api-augment/src/kusama/runtime.ts index 91246c2884..25efde00a5 100644 --- a/packages/api-augment/src/kusama/runtime.ts +++ b/packages/api-augment/src/kusama/runtime.ts @@ -17,9 +17,10 @@ import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics'; import type { AuthorityList, GrandpaEquivocationProof, SetId } from '@polkadot/types/interfaces/grandpa'; import type { OpaqueMetadata } from '@polkadot/types/interfaces/metadata'; import type { MmrBatchProof, MmrEncodableOpaqueLeaf, MmrError, MmrLeafIndex, MmrProof } from '@polkadot/types/interfaces/mmr'; +import type { NpPoolId } from '@polkadot/types/interfaces/nompools'; import type { CandidateCommitments, CandidateEvent, CommittedCandidateReceipt, CoreState, GroupRotationInfo, InboundDownwardMessage, InboundHrmpMessage, OccupiedCoreAssumption, ParaId, ParaValidatorIndex, PersistedValidationData, PvfCheckStatement, ScrapedOnChainVotes, SessionInfo, ValidationCode, ValidationCodeHash, ValidatorSignature } from '@polkadot/types/interfaces/parachains'; import type { FeeDetails, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment'; -import type { AccountId, Balance, Block, Call, Hash, Header, Index, KeyTypeId, Slot, ValidatorId, Weight } from '@polkadot/types/interfaces/runtime'; +import type { AccountId, Balance, Block, BlockNumber, Call, Hash, Header, Index, KeyTypeId, Slot, ValidatorId, Weight } from '@polkadot/types/interfaces/runtime'; import type { SessionIndex } from '@polkadot/types/interfaces/session'; import type { RuntimeVersion } from '@polkadot/types/interfaces/state'; import type { ApplyExtrinsicResult } from '@polkadot/types/interfaces/system'; @@ -86,6 +87,10 @@ declare module '@polkadot/api-base/types/calls' { }; /** 0x49eaaf1b548a0cb0/1 */ beefyApi: { + /** + * Return the block number where BEEFY consensus is enabled/started + **/ + beefyGenesis: AugmentedCall Observable>>; /** * Return the current active BEEFY validator set **/ @@ -208,10 +213,18 @@ declare module '@polkadot/api-base/types/calls' { }; /** 0x17a6bc0d0062aeb3/1 */ nominationPoolsApi: { + /** + * Returns the equivalent points of `new_funds` for a given pool. + **/ + balanceToPoints: AugmentedCall Observable>; /** * Returns the pending rewards for the given member. **/ pendingRewards: AugmentedCall Observable>; + /** + * Returns the equivalent balance of `points` for a given pool. + **/ + pointsToBalance: AugmentedCall Observable>; /** * Generic call **/ @@ -322,6 +335,17 @@ declare module '@polkadot/api-base/types/calls' { **/ [key: string]: DecoratedCallBase; }; + /** 0x18ef58a3b67ba770/1 */ + stakingApi: { + /** + * Returns the nominations quota for a nominator with a given balance. + **/ + nominationsQuota: AugmentedCall Observable>; + /** + * Generic call + **/ + [key: string]: DecoratedCallBase; + }; /** 0xd2bc9897eed08f15/3 */ taggedTransactionQueue: { /** diff --git a/packages/api-augment/src/polkadot/runtime.ts b/packages/api-augment/src/polkadot/runtime.ts index 91246c2884..25efde00a5 100644 --- a/packages/api-augment/src/polkadot/runtime.ts +++ b/packages/api-augment/src/polkadot/runtime.ts @@ -17,9 +17,10 @@ import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics'; import type { AuthorityList, GrandpaEquivocationProof, SetId } from '@polkadot/types/interfaces/grandpa'; import type { OpaqueMetadata } from '@polkadot/types/interfaces/metadata'; import type { MmrBatchProof, MmrEncodableOpaqueLeaf, MmrError, MmrLeafIndex, MmrProof } from '@polkadot/types/interfaces/mmr'; +import type { NpPoolId } from '@polkadot/types/interfaces/nompools'; import type { CandidateCommitments, CandidateEvent, CommittedCandidateReceipt, CoreState, GroupRotationInfo, InboundDownwardMessage, InboundHrmpMessage, OccupiedCoreAssumption, ParaId, ParaValidatorIndex, PersistedValidationData, PvfCheckStatement, ScrapedOnChainVotes, SessionInfo, ValidationCode, ValidationCodeHash, ValidatorSignature } from '@polkadot/types/interfaces/parachains'; import type { FeeDetails, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment'; -import type { AccountId, Balance, Block, Call, Hash, Header, Index, KeyTypeId, Slot, ValidatorId, Weight } from '@polkadot/types/interfaces/runtime'; +import type { AccountId, Balance, Block, BlockNumber, Call, Hash, Header, Index, KeyTypeId, Slot, ValidatorId, Weight } from '@polkadot/types/interfaces/runtime'; import type { SessionIndex } from '@polkadot/types/interfaces/session'; import type { RuntimeVersion } from '@polkadot/types/interfaces/state'; import type { ApplyExtrinsicResult } from '@polkadot/types/interfaces/system'; @@ -86,6 +87,10 @@ declare module '@polkadot/api-base/types/calls' { }; /** 0x49eaaf1b548a0cb0/1 */ beefyApi: { + /** + * Return the block number where BEEFY consensus is enabled/started + **/ + beefyGenesis: AugmentedCall Observable>>; /** * Return the current active BEEFY validator set **/ @@ -208,10 +213,18 @@ declare module '@polkadot/api-base/types/calls' { }; /** 0x17a6bc0d0062aeb3/1 */ nominationPoolsApi: { + /** + * Returns the equivalent points of `new_funds` for a given pool. + **/ + balanceToPoints: AugmentedCall Observable>; /** * Returns the pending rewards for the given member. **/ pendingRewards: AugmentedCall Observable>; + /** + * Returns the equivalent balance of `points` for a given pool. + **/ + pointsToBalance: AugmentedCall Observable>; /** * Generic call **/ @@ -322,6 +335,17 @@ declare module '@polkadot/api-base/types/calls' { **/ [key: string]: DecoratedCallBase; }; + /** 0x18ef58a3b67ba770/1 */ + stakingApi: { + /** + * Returns the nominations quota for a nominator with a given balance. + **/ + nominationsQuota: AugmentedCall Observable>; + /** + * Generic call + **/ + [key: string]: DecoratedCallBase; + }; /** 0xd2bc9897eed08f15/3 */ taggedTransactionQueue: { /** diff --git a/packages/api-augment/src/substrate/runtime.ts b/packages/api-augment/src/substrate/runtime.ts index 508203d30f..9328b6af58 100644 --- a/packages/api-augment/src/substrate/runtime.ts +++ b/packages/api-augment/src/substrate/runtime.ts @@ -17,6 +17,8 @@ import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics'; import type { AuthorityList, GrandpaEquivocationProof, SetId } from '@polkadot/types/interfaces/grandpa'; import type { OpaqueMetadata } from '@polkadot/types/interfaces/metadata'; import type { MmrBatchProof, MmrEncodableOpaqueLeaf, MmrError, MmrLeafIndex, MmrProof } from '@polkadot/types/interfaces/mmr'; +import type { NftCollectionId, NftItemId } from '@polkadot/types/interfaces/nfts'; +import type { NpPoolId } from '@polkadot/types/interfaces/nompools'; import type { FeeDetails, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment'; import type { AccountId, Balance, Block, Call, Hash, Header, Index, KeyTypeId, Slot, Weight, WeightV2 } from '@polkadot/types/interfaces/runtime'; import type { RuntimeVersion } from '@polkadot/types/interfaces/state'; @@ -216,12 +218,51 @@ declare module '@polkadot/api-base/types/calls' { **/ [key: string]: DecoratedCallBase; }; + /** 0x899a250cbe84f250/1 */ + nftsApi: { + /** + * An attribute + **/ + attribute: AugmentedCall Observable>>; + /** + * A collection attribute + **/ + collectionAttribute: AugmentedCall Observable>>; + /** + * A collection owner + **/ + collectionOwner: AugmentedCall Observable>>; + /** + * A custom attribute + **/ + customAttribute: AugmentedCall Observable>>; + /** + * Collection owner + **/ + owner: AugmentedCall Observable>>; + /** + * System attribute + **/ + systemAttribute: AugmentedCall Observable>>; + /** + * Generic call + **/ + [key: string]: DecoratedCallBase; + }; /** 0x17a6bc0d0062aeb3/1 */ nominationPoolsApi: { + /** + * Returns the equivalent points of `new_funds` for a given pool. + **/ + balanceToPoints: AugmentedCall Observable>; /** * Returns the pending rewards for the given member. **/ pendingRewards: AugmentedCall Observable>; + /** + * Returns the equivalent balance of `points` for a given pool. + **/ + pointsToBalance: AugmentedCall Observable>; /** * Generic call **/ @@ -253,6 +294,17 @@ declare module '@polkadot/api-base/types/calls' { **/ [key: string]: DecoratedCallBase; }; + /** 0x18ef58a3b67ba770/1 */ + stakingApi: { + /** + * Returns the nominations quota for a nominator with a given balance. + **/ + nominationsQuota: AugmentedCall Observable>; + /** + * Generic call + **/ + [key: string]: DecoratedCallBase; + }; /** 0xd2bc9897eed08f15/3 */ taggedTransactionQueue: { /** diff --git a/packages/types-augment/src/registry/interfaces.ts b/packages/types-augment/src/registry/interfaces.ts index e173647b12..c08f91b56c 100644 --- a/packages/types-augment/src/registry/interfaces.ts +++ b/packages/types-augment/src/registry/interfaces.ts @@ -42,7 +42,8 @@ import type { AuthIndex, AuthoritySignature, Heartbeat, HeartbeatTo244, OpaqueMu import type { CallIndex, LotteryConfig } from '@polkadot/types/interfaces/lottery'; import type { ErrorMetadataLatest, ErrorMetadataV10, ErrorMetadataV11, ErrorMetadataV12, ErrorMetadataV13, ErrorMetadataV14, ErrorMetadataV9, EventMetadataLatest, EventMetadataV10, EventMetadataV11, EventMetadataV12, EventMetadataV13, EventMetadataV14, EventMetadataV9, ExtrinsicMetadataLatest, ExtrinsicMetadataV11, ExtrinsicMetadataV12, ExtrinsicMetadataV13, ExtrinsicMetadataV14, FunctionArgumentMetadataLatest, FunctionArgumentMetadataV10, FunctionArgumentMetadataV11, FunctionArgumentMetadataV12, FunctionArgumentMetadataV13, FunctionArgumentMetadataV14, FunctionArgumentMetadataV9, FunctionMetadataLatest, FunctionMetadataV10, FunctionMetadataV11, FunctionMetadataV12, FunctionMetadataV13, FunctionMetadataV14, FunctionMetadataV9, MetadataAll, MetadataLatest, MetadataV10, MetadataV11, MetadataV12, MetadataV13, MetadataV14, MetadataV9, ModuleConstantMetadataV10, ModuleConstantMetadataV11, ModuleConstantMetadataV12, ModuleConstantMetadataV13, ModuleConstantMetadataV9, ModuleMetadataV10, ModuleMetadataV11, ModuleMetadataV12, ModuleMetadataV13, ModuleMetadataV9, OpaqueMetadata, PalletCallMetadataLatest, PalletCallMetadataV14, PalletConstantMetadataLatest, PalletConstantMetadataV14, PalletErrorMetadataLatest, PalletErrorMetadataV14, PalletEventMetadataLatest, PalletEventMetadataV14, PalletMetadataLatest, PalletMetadataV14, PalletStorageMetadataLatest, PalletStorageMetadataV14, PortableType, PortableTypeV14, SignedExtensionMetadataLatest, SignedExtensionMetadataV14, StorageEntryMetadataLatest, StorageEntryMetadataV10, StorageEntryMetadataV11, StorageEntryMetadataV12, StorageEntryMetadataV13, StorageEntryMetadataV14, StorageEntryMetadataV9, StorageEntryModifierLatest, StorageEntryModifierV10, StorageEntryModifierV11, StorageEntryModifierV12, StorageEntryModifierV13, StorageEntryModifierV14, StorageEntryModifierV9, StorageEntryTypeLatest, StorageEntryTypeV10, StorageEntryTypeV11, StorageEntryTypeV12, StorageEntryTypeV13, StorageEntryTypeV14, StorageEntryTypeV9, StorageHasher, StorageHasherV10, StorageHasherV11, StorageHasherV12, StorageHasherV13, StorageHasherV14, StorageHasherV9, StorageMetadataV10, StorageMetadataV11, StorageMetadataV12, StorageMetadataV13, StorageMetadataV9 } from '@polkadot/types/interfaces/metadata'; import type { MmrBatchProof, MmrEncodableOpaqueLeaf, MmrError, MmrLeafBatchProof, MmrLeafIndex, MmrLeafProof, MmrNodeIndex, MmrProof } from '@polkadot/types/interfaces/mmr'; -import type { NpApiError } from '@polkadot/types/interfaces/nompools'; +import type { NftCollectionId, NftItemId } from '@polkadot/types/interfaces/nfts'; +import type { NpApiError, NpPoolId } from '@polkadot/types/interfaces/nompools'; import type { StorageKind } from '@polkadot/types/interfaces/offchain'; import type { DeferredOffenceOf, Kind, OffenceDetails, Offender, OpaqueTimeSlot, ReportIdOf, Reporter } from '@polkadot/types/interfaces/offences'; import type { AbridgedCandidateReceipt, AbridgedHostConfiguration, AbridgedHrmpChannel, AssignmentId, AssignmentKind, AttestedCandidate, AuctionIndex, AuthorityDiscoveryId, AvailabilityBitfield, AvailabilityBitfieldRecord, BackedCandidate, Bidder, BufferedSessionChange, CandidateCommitments, CandidateDescriptor, CandidateEvent, CandidateHash, CandidateInfo, CandidatePendingAvailability, CandidateReceipt, CollatorId, CollatorSignature, CommittedCandidateReceipt, CoreAssignment, CoreIndex, CoreOccupied, CoreState, DisputeLocation, DisputeResult, DisputeState, DisputeStatement, DisputeStatementSet, DoubleVoteReport, DownwardMessage, ExplicitDisputeStatement, GlobalValidationData, GlobalValidationSchedule, GroupIndex, GroupRotationInfo, HeadData, HostConfiguration, HrmpChannel, HrmpChannelId, HrmpOpenChannelRequest, InboundDownwardMessage, InboundHrmpMessage, InboundHrmpMessages, IncomingParachain, IncomingParachainDeploy, IncomingParachainFixed, InvalidDisputeStatementKind, LeasePeriod, LeasePeriodOf, LocalValidationData, MessageIngestionType, MessageQueueChain, MessagingStateSnapshot, MessagingStateSnapshotEgressEntry, MultiDisputeStatementSet, NewBidder, OccupiedCore, OccupiedCoreAssumption, OldV1SessionInfo, OutboundHrmpMessage, ParaGenesisArgs, ParaId, ParaInfo, ParaLifecycle, ParaPastCodeMeta, ParaScheduling, ParaValidatorIndex, ParachainDispatchOrigin, ParachainInherentData, ParachainProposal, ParachainsInherentData, ParathreadClaim, ParathreadClaimQueue, ParathreadEntry, PersistedValidationData, PvfCheckStatement, QueuedParathread, RegisteredParachainInfo, RelayBlockNumber, RelayChainBlockNumber, RelayChainHash, RelayHash, Remark, ReplacementTimes, Retriable, ScheduledCore, Scheduling, ScrapedOnChainVotes, ServiceQuality, SessionInfo, SessionInfoValidatorGroup, SignedAvailabilityBitfield, SignedAvailabilityBitfields, SigningContext, SlotRange, SlotRange10, Statement, SubId, SystemInherentData, TransientValidationData, UpgradeGoAhead, UpgradeRestriction, UpwardMessage, ValidDisputeStatementKind, ValidationCode, ValidationCodeHash, ValidationData, ValidationDataType, ValidationFunctionParams, ValidatorSignature, ValidityAttestation, VecInboundHrmpMessage, WinnersData, WinnersData10, WinnersDataTuple, WinnersDataTuple10, WinningData, WinningData10, WinningDataEntry } from '@polkadot/types/interfaces/parachains'; @@ -692,12 +693,15 @@ declare module '@polkadot/types/types/registry' { NextAuthority: NextAuthority; NextConfigDescriptor: NextConfigDescriptor; NextConfigDescriptorV1: NextConfigDescriptorV1; + NftCollectionId: NftCollectionId; + NftItemId: NftItemId; NodeRole: NodeRole; Nominations: Nominations; NominatorIndex: NominatorIndex; NominatorIndexCompact: NominatorIndexCompact; NotConnectedPeer: NotConnectedPeer; NpApiError: NpApiError; + NpPoolId: NpPoolId; Null: Null; OccupiedCore: OccupiedCore; OccupiedCoreAssumption: OccupiedCoreAssumption; diff --git a/packages/types/src/interfaces/beefy/runtime.ts b/packages/types/src/interfaces/beefy/runtime.ts index 9a304abe44..6a7b32a204 100644 --- a/packages/types/src/interfaces/beefy/runtime.ts +++ b/packages/types/src/interfaces/beefy/runtime.ts @@ -7,6 +7,11 @@ export const runtime: DefinitionsCall = { BeefyApi: [ { methods: { + beefy_genesis: { + description: 'Return the block number where BEEFY consensus is enabled/started', + params: [], + type: 'Option' + }, validator_set: { description: 'Return the current active BEEFY validator set', params: [], diff --git a/packages/types/src/interfaces/definitions.ts b/packages/types/src/interfaces/definitions.ts index 62a04fd3d3..06905df757 100644 --- a/packages/types/src/interfaces/definitions.ts +++ b/packages/types/src/interfaces/definitions.ts @@ -29,6 +29,7 @@ export { default as identity } from './identity/definitions'; export { default as imOnline } from './imOnline/definitions'; export { default as lottery } from './lottery/definitions'; export { default as mmr } from './mmr/definitions'; +export { default as nfts } from './nfts/definitions'; export { default as nompools } from './nompools/definitions'; export { default as offences } from './offences/definitions'; export { default as pow } from './pow/definitions'; diff --git a/packages/types/src/interfaces/nfts/definitions.ts b/packages/types/src/interfaces/nfts/definitions.ts new file mode 100644 index 0000000000..076a3ef6ca --- /dev/null +++ b/packages/types/src/interfaces/nfts/definitions.ts @@ -0,0 +1,18 @@ +// Copyright 2017-2023 @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: { + NftCollectionId: 'u32', + NftItemId: 'u32' + } +} as Definitions; diff --git a/packages/types/src/interfaces/nfts/index.ts b/packages/types/src/interfaces/nfts/index.ts new file mode 100644 index 0000000000..2d307291c3 --- /dev/null +++ b/packages/types/src/interfaces/nfts/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/nfts/runtime.ts b/packages/types/src/interfaces/nfts/runtime.ts new file mode 100644 index 0000000000..b85f202044 --- /dev/null +++ b/packages/types/src/interfaces/nfts/runtime.ts @@ -0,0 +1,110 @@ +// Copyright 2017-2023 @polkadot/types authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import type { DefinitionsCall } from '../../types'; + +export const runtime: DefinitionsCall = { + NftsApi: [ + { + methods: { + attribute: { + description: 'An attribute', + params: [ + { + name: 'collection', + type: 'NftCollectionId' + }, + { + name: 'item', + type: 'NftItemId' + }, + { + name: 'key', + type: 'Bytes' + } + ], + type: 'Option' + }, + collection_attribute: { + description: 'A collection attribute', + params: [ + { + name: 'collection', + type: 'NftCollectionId' + }, + { + name: 'key', + type: 'Bytes' + } + ], + type: 'Option' + }, + collection_owner: { + description: 'A collection owner', + params: [ + { + name: 'collection', + type: 'NftCollectionId' + } + ], + type: 'Option' + }, + custom_attribute: { + description: 'A custom attribute', + params: [ + { + name: 'account', + type: 'AccountId' + }, + { + name: 'collection', + type: 'NftCollectionId' + }, + { + name: 'item', + type: 'NftItemId' + }, + { + name: 'key', + type: 'Bytes' + } + ], + type: 'Option' + }, + owner: { + description: 'Collection owner', + params: [ + { + name: 'collection', + type: 'NftCollectionId' + }, + { + name: 'item', + type: 'NftItemId' + } + ], + type: 'Option' + }, + system_attribute: { + description: 'System attribute', + params: [ + { + name: 'collection', + type: 'NftCollectionId' + }, + { + name: 'item', + type: 'NftItemId' + }, + { + name: 'key', + type: 'Bytes' + } + ], + type: 'Option' + } + }, + version: 1 + } + ] +}; diff --git a/packages/types/src/interfaces/nfts/types.ts b/packages/types/src/interfaces/nfts/types.ts new file mode 100644 index 0000000000..e1e96d776b --- /dev/null +++ b/packages/types/src/interfaces/nfts/types.ts @@ -0,0 +1,12 @@ +// Auto-generated via `yarn polkadot-types-from-defs`, do not edit +/* eslint-disable */ + +import type { u32 } from '@polkadot/types-codec'; + +/** @name NftCollectionId */ +export interface NftCollectionId extends u32 {} + +/** @name NftItemId */ +export interface NftItemId extends u32 {} + +export type PHANTOM_NFTS = 'nfts'; diff --git a/packages/types/src/interfaces/nompools/definitions.ts b/packages/types/src/interfaces/nompools/definitions.ts index de87ec6be2..4be6d44300 100644 --- a/packages/types/src/interfaces/nompools/definitions.ts +++ b/packages/types/src/interfaces/nompools/definitions.ts @@ -14,6 +14,7 @@ export default { types: { NpApiError: { _enum: ['MemberNotFound', 'OverflowInPendingRewards'] - } + }, + NpPoolId: 'u32' } } as Definitions; diff --git a/packages/types/src/interfaces/nompools/runtime.ts b/packages/types/src/interfaces/nompools/runtime.ts index 2e11645996..123b70eed5 100644 --- a/packages/types/src/interfaces/nompools/runtime.ts +++ b/packages/types/src/interfaces/nompools/runtime.ts @@ -7,6 +7,20 @@ export const runtime: DefinitionsCall = { NominationPoolsApi: [ { methods: { + balance_to_points: { + description: 'Returns the equivalent points of `new_funds` for a given pool.', + params: [ + { + name: 'poolId', + type: 'NpPoolId' + }, + { + name: 'newFunds', + type: 'Balance' + } + ], + type: 'Balance' + }, pending_rewards: { description: 'Returns the pending rewards for the given member.', params: [ @@ -16,6 +30,20 @@ export const runtime: DefinitionsCall = { } ], type: 'Balance' + }, + points_to_balance: { + description: 'Returns the equivalent balance of `points` for a given pool.', + params: [ + { + name: 'poolId', + type: 'NpPoolId' + }, + { + name: 'points', + type: 'Balance' + } + ], + type: 'Balance' } }, version: 1 diff --git a/packages/types/src/interfaces/nompools/types.ts b/packages/types/src/interfaces/nompools/types.ts index d45e4bf8f0..f4dca19712 100644 --- a/packages/types/src/interfaces/nompools/types.ts +++ b/packages/types/src/interfaces/nompools/types.ts @@ -1,7 +1,7 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import type { Enum } from '@polkadot/types-codec'; +import type { Enum, u32 } from '@polkadot/types-codec'; /** @name NpApiError */ export interface NpApiError extends Enum { @@ -10,4 +10,7 @@ export interface NpApiError extends Enum { readonly type: 'MemberNotFound' | 'OverflowInPendingRewards'; } +/** @name NpPoolId */ +export interface NpPoolId extends u32 {} + export type PHANTOM_NOMPOOLS = 'nompools'; diff --git a/packages/types/src/interfaces/staking/definitions.ts b/packages/types/src/interfaces/staking/definitions.ts index 0375a2a8d2..9f136d5599 100644 --- a/packages/types/src/interfaces/staking/definitions.ts +++ b/packages/types/src/interfaces/staking/definitions.ts @@ -8,6 +8,8 @@ import type { Definitions } from '../../types'; import { objectSpread } from '@polkadot/util'; +import { runtime } from './runtime'; + const deprecated = { Points: 'u32', EraPoints: { @@ -174,6 +176,7 @@ const phragmen = { export default { rpc: {}, + runtime, types: objectSpread({}, deprecated, phragmen, { ActiveEraInfo: { index: 'EraIndex', diff --git a/packages/types/src/interfaces/staking/runtime.ts b/packages/types/src/interfaces/staking/runtime.ts new file mode 100644 index 0000000000..1be42aa93a --- /dev/null +++ b/packages/types/src/interfaces/staking/runtime.ts @@ -0,0 +1,24 @@ +// Copyright 2017-2023 @polkadot/types authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import type { DefinitionsCall } from '../../types'; + +export const runtime: DefinitionsCall = { + StakingApi: [ + { + methods: { + nominations_quota: { + description: 'Returns the nominations quota for a nominator with a given balance.', + params: [ + { + name: 'balance', + type: 'Balance' + } + ], + type: 'u32' + } + }, + version: 1 + } + ] +}; diff --git a/packages/types/src/interfaces/types.ts b/packages/types/src/interfaces/types.ts index f68fa48592..d73c1a5018 100644 --- a/packages/types/src/interfaces/types.ts +++ b/packages/types/src/interfaces/types.ts @@ -38,6 +38,7 @@ export * from './imOnline/types'; export * from './lottery/types'; export * from './metadata/types'; export * from './mmr/types'; +export * from './nfts/types'; export * from './nimbus/types'; export * from './nompools/types'; export * from './offchain/types';