// Copyright 2017-2021 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 // order important in structs... :) /* eslint-disable sort-keys */ import type { Definitions } from '../../types'; const deprecated = { Points: 'u32', EraPoints: { total: 'Points', individual: 'Vec' } }; const phragmen = { CompactAssignments: { votes1: 'Vec<(NominatorIndexCompact, ValidatorIndexCompact)>', votes2: 'Vec<(NominatorIndexCompact, CompactScoreCompact, ValidatorIndexCompact)>', votes3: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 2], ValidatorIndexCompact)>', votes4: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 3], ValidatorIndexCompact)>', votes5: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 4], ValidatorIndexCompact)>', votes6: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 5], ValidatorIndexCompact)>', votes7: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 6], ValidatorIndexCompact)>', votes8: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 7], ValidatorIndexCompact)>', votes9: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 8], ValidatorIndexCompact)>', votes10: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 9], ValidatorIndexCompact)>', votes11: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 10], ValidatorIndexCompact)>', votes12: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 11], ValidatorIndexCompact)>', votes13: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 12], ValidatorIndexCompact)>', votes14: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 13], ValidatorIndexCompact)>', votes15: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 14], ValidatorIndexCompact)>', votes16: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 15], ValidatorIndexCompact)>' }, CompactAssignmentsTo257: { votes1: 'Vec<(NominatorIndex, [CompactScore; 0], ValidatorIndex)>', votes2: 'Vec<(NominatorIndex, [CompactScore; 1], ValidatorIndex)>', votes3: 'Vec<(NominatorIndex, [CompactScore; 2], ValidatorIndex)>', votes4: 'Vec<(NominatorIndex, [CompactScore; 3], ValidatorIndex)>', votes5: 'Vec<(NominatorIndex, [CompactScore; 4], ValidatorIndex)>', votes6: 'Vec<(NominatorIndex, [CompactScore; 5], ValidatorIndex)>', votes7: 'Vec<(NominatorIndex, [CompactScore; 6], ValidatorIndex)>', votes8: 'Vec<(NominatorIndex, [CompactScore; 7], ValidatorIndex)>', votes9: 'Vec<(NominatorIndex, [CompactScore; 8], ValidatorIndex)>', votes10: 'Vec<(NominatorIndex, [CompactScore; 9], ValidatorIndex)>', votes11: 'Vec<(NominatorIndex, [CompactScore; 10], ValidatorIndex)>', votes12: 'Vec<(NominatorIndex, [CompactScore; 11], ValidatorIndex)>', votes13: 'Vec<(NominatorIndex, [CompactScore; 12], ValidatorIndex)>', votes14: 'Vec<(NominatorIndex, [CompactScore; 13], ValidatorIndex)>', votes15: 'Vec<(NominatorIndex, [CompactScore; 14], ValidatorIndex)>', votes16: 'Vec<(NominatorIndex, [CompactScore; 15], ValidatorIndex)>' }, CompactScore: '(ValidatorIndex, OffchainAccuracy)', CompactScoreCompact: '(ValidatorIndexCompact, OffchainAccuracyCompact)', ElectionCompute: { // in previous versions the last entry was "AuthorityId" // (since no data attached, and it is via SCALE can rename) _enum: ['OnChain', 'Signed', 'Unsigned'] }, ElectionPhase: { _enum: { Off: null, Signed: null, Unsigned: '(bool, BlockNumber)' } }, ElectionResult: { compute: 'ElectionCompute', slotStake: 'Balance', electedStashes: 'Vec', exposures: 'Vec<(AccountId, Exposure)>' }, ElectionScore: '[u128; 3]', ElectionSize: { validators: 'Compact', nominators: 'Compact' }, ElectionStatus: { _enum: { Close: 'Null', Open: 'BlockNumber' } }, ExtendedBalance: 'u128', RawSolution: { compact: 'CompactAssignments', score: 'ElectionScore', round: 'u32' }, ReadySolution: { supports: 'SolutionSupports', score: 'ElectionScore', compute: 'ElectionCompute' }, RoundSnapshot: { voters: 'Vec<(AccountId, VoteWeight, Vec)>', targets: 'Vec' }, SeatHolder: { who: 'AccountId', stake: 'Balance', deposit: 'Balance' }, SolutionOrSnapshotSize: { voters: 'Compact', targets: 'Compact' }, SolutionSupport: { total: 'ExtendedBalance', voters: 'Vec<(AccountId, ExtendedBalance)>' }, SolutionSupports: 'Vec<(AccountId, SolutionSupport)>', Voter: { votes: 'Vec', stake: 'Balance', deposit: 'Balance' }, VoteWeight: 'u64' }; export default { rpc: {}, types: { ...deprecated, ...phragmen, ActiveEraInfo: { index: 'EraIndex', start: 'Option' }, EraIndex: 'u32', EraRewardPoints: { total: 'RewardPoint', individual: 'BTreeMap' }, EraRewards: { total: 'u32', rewards: 'Vec' }, Exposure: { total: 'Compact', own: 'Compact', others: 'Vec' }, Forcing: { _enum: [ 'NotForcing', 'ForceNew', 'ForceNone', 'ForceAlways' ] }, IndividualExposure: { who: 'AccountId', value: 'Compact' }, KeyType: 'AccountId', MomentOf: 'Moment', Nominations: { targets: 'Vec', submittedIn: 'EraIndex', suppressed: 'bool' }, NominatorIndex: 'u32', NominatorIndexCompact: 'Compact', OffchainAccuracy: 'PerU16', OffchainAccuracyCompact: 'Compact', PhragmenScore: '[u128; 3]', Points: 'u32', RewardDestination: { _enum: { Staked: 'Null', Stash: 'Null', Controller: 'Null', Account: 'AccountId' } }, RewardPoint: 'u32', SlashJournalEntry: { who: 'AccountId', amount: 'Balance', ownSlash: 'Balance' }, SlashingSpansTo204: { spanIndex: 'SpanIndex', lastStart: 'EraIndex', prior: 'Vec' }, SlashingSpans: { spanIndex: 'SpanIndex', lastStart: 'EraIndex', lastNonzeroSlash: 'EraIndex', prior: 'Vec' }, SpanIndex: 'u32', SpanRecord: { slashed: 'Balance', paidOut: 'Balance' }, StakingLedgerTo223: { stash: 'AccountId', total: 'Compact', active: 'Compact', unlocking: 'Vec' }, StakingLedgerTo240: { stash: 'AccountId', total: 'Compact', active: 'Compact', unlocking: 'Vec', lastReward: 'Option' }, StakingLedger: { stash: 'AccountId', total: 'Compact', active: 'Compact', unlocking: 'Vec', claimedRewards: 'Vec' }, UnappliedSlashOther: '(AccountId, Balance)', UnappliedSlash: { validator: 'AccountId', own: 'Balance', others: 'Vec', reporters: 'Vec', payout: 'Balance' }, UnlockChunk: { value: 'Compact', era: 'Compact' }, ValidatorIndex: 'u16', ValidatorIndexCompact: 'Compact', ValidatorPrefs: 'ValidatorPrefsWithBlocked', ValidatorPrefsWithCommission: { commission: 'Compact' }, ValidatorPrefsWithBlocked: { commission: 'Compact', blocked: 'bool' }, ValidatorPrefsTo196: { validatorPayment: 'Compact' }, ValidatorPrefsTo145: { unstakeThreshold: 'Compact', validatorPayment: 'Compact' } } } as Definitions;