Aura, Babe & Session runtime definitions (#4992)
This commit is contained in:
@@ -2,12 +2,14 @@
|
||||
/* eslint-disable */
|
||||
|
||||
import type { ApiTypes } from '@polkadot/api-base/types';
|
||||
import type { Bytes, u32 } from '@polkadot/types-codec';
|
||||
import type { AnyNumber } from '@polkadot/types-codec/types';
|
||||
import type { Bytes, Option, Vec, u32 } from '@polkadot/types-codec';
|
||||
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
|
||||
import type { BabeGenesisConfiguration, Epoch, OpaqueKeyOwnershipProof } from '@polkadot/types/interfaces/babe';
|
||||
import type { AuthorityId } from '@polkadot/types/interfaces/consensus';
|
||||
import type { AuthorityList, SetId } from '@polkadot/types/interfaces/grandpa';
|
||||
import type { OpaqueMetadata } from '@polkadot/types/interfaces/metadata';
|
||||
import type { FeeDetails, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment';
|
||||
import type { AccountId, Index } from '@polkadot/types/interfaces/runtime';
|
||||
import type { AccountId, Index, KeyTypeId, Slot } from '@polkadot/types/interfaces/runtime';
|
||||
import type { Observable } from '@polkadot/types/types';
|
||||
|
||||
declare module '@polkadot/api-base/types/calls' {
|
||||
@@ -22,6 +24,32 @@ declare module '@polkadot/api-base/types/calls' {
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
babeApi: {
|
||||
/**
|
||||
* Return the genesis configuration for BABE. The configuration is only read on genesis.
|
||||
**/
|
||||
configuration: AugmentedCall<ApiType, () => Observable<BabeGenesisConfiguration>>;
|
||||
/**
|
||||
* Returns information regarding the current epoch.
|
||||
**/
|
||||
currentEpoch: AugmentedCall<ApiType, () => Observable<Epoch>>;
|
||||
/**
|
||||
* Returns the slot that started the current epoch.
|
||||
**/
|
||||
currentEpochStart: AugmentedCall<ApiType, () => Observable<Slot>>;
|
||||
/**
|
||||
* Generates a proof of key ownership for the given authority in the current epoch.
|
||||
**/
|
||||
generateKeyOwnershipProof: AugmentedCall<ApiType, (slot: Slot | AnyNumber | Uint8Array, authorityId: AuthorityId | string | Uint8Array) => Observable<Option<OpaqueKeyOwnershipProof>>>;
|
||||
/**
|
||||
* Returns information regarding the next epoch (which was already previously announced).
|
||||
**/
|
||||
nextEpoch: AugmentedCall<ApiType, () => Observable<Epoch>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
grandpaApi: {
|
||||
/**
|
||||
* Get current GRANDPA authority set id.
|
||||
@@ -46,6 +74,20 @@ declare module '@polkadot/api-base/types/calls' {
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
sessionKeys: {
|
||||
/**
|
||||
* Decode the given public session keys.
|
||||
**/
|
||||
decodeSessionKeys: AugmentedCall<ApiType, (encoded: Bytes | string | Uint8Array) => Observable<Option<Vec<ITuple<[Bytes, KeyTypeId]>>>>>;
|
||||
/**
|
||||
* Generate a set of session keys with optionally using the given seed.
|
||||
**/
|
||||
generateSessionKeys: AugmentedCall<ApiType, (seed: Option<Bytes> | null | object | string | Uint8Array) => Observable<Bytes>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
transactionPaymentApi: {
|
||||
/**
|
||||
* The transaction fee details
|
||||
|
||||
@@ -2,12 +2,14 @@
|
||||
/* eslint-disable */
|
||||
|
||||
import type { ApiTypes } from '@polkadot/api-base/types';
|
||||
import type { Bytes, u32 } from '@polkadot/types-codec';
|
||||
import type { AnyNumber } from '@polkadot/types-codec/types';
|
||||
import type { Bytes, Option, Vec, u32 } from '@polkadot/types-codec';
|
||||
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
|
||||
import type { BabeGenesisConfiguration, Epoch, OpaqueKeyOwnershipProof } from '@polkadot/types/interfaces/babe';
|
||||
import type { AuthorityId } from '@polkadot/types/interfaces/consensus';
|
||||
import type { AuthorityList, SetId } from '@polkadot/types/interfaces/grandpa';
|
||||
import type { OpaqueMetadata } from '@polkadot/types/interfaces/metadata';
|
||||
import type { FeeDetails, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment';
|
||||
import type { AccountId, Index } from '@polkadot/types/interfaces/runtime';
|
||||
import type { AccountId, Index, KeyTypeId, Slot } from '@polkadot/types/interfaces/runtime';
|
||||
import type { Observable } from '@polkadot/types/types';
|
||||
|
||||
declare module '@polkadot/api-base/types/calls' {
|
||||
@@ -22,6 +24,32 @@ declare module '@polkadot/api-base/types/calls' {
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
babeApi: {
|
||||
/**
|
||||
* Return the genesis configuration for BABE. The configuration is only read on genesis.
|
||||
**/
|
||||
configuration: AugmentedCall<ApiType, () => Observable<BabeGenesisConfiguration>>;
|
||||
/**
|
||||
* Returns information regarding the current epoch.
|
||||
**/
|
||||
currentEpoch: AugmentedCall<ApiType, () => Observable<Epoch>>;
|
||||
/**
|
||||
* Returns the slot that started the current epoch.
|
||||
**/
|
||||
currentEpochStart: AugmentedCall<ApiType, () => Observable<Slot>>;
|
||||
/**
|
||||
* Generates a proof of key ownership for the given authority in the current epoch.
|
||||
**/
|
||||
generateKeyOwnershipProof: AugmentedCall<ApiType, (slot: Slot | AnyNumber | Uint8Array, authorityId: AuthorityId | string | Uint8Array) => Observable<Option<OpaqueKeyOwnershipProof>>>;
|
||||
/**
|
||||
* Returns information regarding the next epoch (which was already previously announced).
|
||||
**/
|
||||
nextEpoch: AugmentedCall<ApiType, () => Observable<Epoch>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
grandpaApi: {
|
||||
/**
|
||||
* Get current GRANDPA authority set id.
|
||||
@@ -46,6 +74,20 @@ declare module '@polkadot/api-base/types/calls' {
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
sessionKeys: {
|
||||
/**
|
||||
* Decode the given public session keys.
|
||||
**/
|
||||
decodeSessionKeys: AugmentedCall<ApiType, (encoded: Bytes | string | Uint8Array) => Observable<Option<Vec<ITuple<[Bytes, KeyTypeId]>>>>>;
|
||||
/**
|
||||
* Generate a set of session keys with optionally using the given seed.
|
||||
**/
|
||||
generateSessionKeys: AugmentedCall<ApiType, (seed: Option<Bytes> | null | object | string | Uint8Array) => Observable<Bytes>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
transactionPaymentApi: {
|
||||
/**
|
||||
* The transaction fee details
|
||||
|
||||
@@ -2,13 +2,15 @@
|
||||
/* eslint-disable */
|
||||
|
||||
import type { ApiTypes } from '@polkadot/api-base/types';
|
||||
import type { Bytes, Option, u32, u64 } from '@polkadot/types-codec';
|
||||
import type { AnyNumber } from '@polkadot/types-codec/types';
|
||||
import type { Bytes, Option, Vec, u32, u64 } from '@polkadot/types-codec';
|
||||
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
|
||||
import type { BabeGenesisConfiguration, Epoch, OpaqueKeyOwnershipProof } from '@polkadot/types/interfaces/babe';
|
||||
import type { AuthorityId } from '@polkadot/types/interfaces/consensus';
|
||||
import type { CodeUploadResult, ContractExecResult, ContractInstantiateResult } from '@polkadot/types/interfaces/contracts';
|
||||
import type { AuthorityList, SetId } from '@polkadot/types/interfaces/grandpa';
|
||||
import type { OpaqueMetadata } from '@polkadot/types/interfaces/metadata';
|
||||
import type { FeeDetails, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment';
|
||||
import type { AccountId, Balance, Index } from '@polkadot/types/interfaces/runtime';
|
||||
import type { AccountId, Balance, Index, KeyTypeId, Slot } from '@polkadot/types/interfaces/runtime';
|
||||
import type { Observable } from '@polkadot/types/types';
|
||||
|
||||
declare module '@polkadot/api-base/types/calls' {
|
||||
@@ -23,6 +25,32 @@ declare module '@polkadot/api-base/types/calls' {
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
babeApi: {
|
||||
/**
|
||||
* Return the genesis configuration for BABE. The configuration is only read on genesis.
|
||||
**/
|
||||
configuration: AugmentedCall<ApiType, () => Observable<BabeGenesisConfiguration>>;
|
||||
/**
|
||||
* Returns information regarding the current epoch.
|
||||
**/
|
||||
currentEpoch: AugmentedCall<ApiType, () => Observable<Epoch>>;
|
||||
/**
|
||||
* Returns the slot that started the current epoch.
|
||||
**/
|
||||
currentEpochStart: AugmentedCall<ApiType, () => Observable<Slot>>;
|
||||
/**
|
||||
* Generates a proof of key ownership for the given authority in the current epoch.
|
||||
**/
|
||||
generateKeyOwnershipProof: AugmentedCall<ApiType, (slot: Slot | AnyNumber | Uint8Array, authorityId: AuthorityId | string | Uint8Array) => Observable<Option<OpaqueKeyOwnershipProof>>>;
|
||||
/**
|
||||
* Returns information regarding the next epoch (which was already previously announced).
|
||||
**/
|
||||
nextEpoch: AugmentedCall<ApiType, () => Observable<Epoch>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
contractsApi: {
|
||||
/**
|
||||
* Perform a call from a specified account to a given contract.
|
||||
@@ -69,6 +97,20 @@ declare module '@polkadot/api-base/types/calls' {
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
sessionKeys: {
|
||||
/**
|
||||
* Decode the given public session keys.
|
||||
**/
|
||||
decodeSessionKeys: AugmentedCall<ApiType, (encoded: Bytes | string | Uint8Array) => Observable<Option<Vec<ITuple<[Bytes, KeyTypeId]>>>>>;
|
||||
/**
|
||||
* Generate a set of session keys with optionally using the given seed.
|
||||
**/
|
||||
generateSessionKeys: AugmentedCall<ApiType, (seed: Option<Bytes> | null | object | string | Uint8Array) => Observable<Bytes>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
transactionPaymentApi: {
|
||||
/**
|
||||
* The transaction fee details
|
||||
|
||||
@@ -8,7 +8,7 @@ import type { BlockAttestations, IncludedBlocks, MoreAttestations } from '@polka
|
||||
import type { RawAuraPreDigest } from '@polkadot/types/interfaces/aura';
|
||||
import type { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author';
|
||||
import type { UncleEntryItem } from '@polkadot/types/interfaces/authorship';
|
||||
import type { AllowedSlots, BabeAuthorityWeight, BabeBlockWeight, BabeEpochConfiguration, BabeEquivocationProof, BabeWeight, EpochAuthorship, MaybeRandomness, MaybeVrf, NextConfigDescriptor, NextConfigDescriptorV1, Randomness, RawBabePreDigest, RawBabePreDigestCompat, RawBabePreDigestPrimary, RawBabePreDigestPrimaryTo159, RawBabePreDigestSecondaryPlain, RawBabePreDigestSecondaryTo159, RawBabePreDigestSecondaryVRF, RawBabePreDigestTo159, SlotNumber, VrfData, VrfOutput, VrfProof } from '@polkadot/types/interfaces/babe';
|
||||
import type { AllowedSlots, BabeAuthorityWeight, BabeBlockWeight, BabeEpochConfiguration, BabeEquivocationProof, BabeGenesisConfiguration, BabeGenesisConfigurationV1, BabeWeight, Epoch, EpochAuthorship, MaybeRandomness, MaybeVrf, NextConfigDescriptor, NextConfigDescriptorV1, OpaqueKeyOwnershipProof, Randomness, RawBabePreDigest, RawBabePreDigestCompat, RawBabePreDigestPrimary, RawBabePreDigestPrimaryTo159, RawBabePreDigestSecondaryPlain, RawBabePreDigestSecondaryTo159, RawBabePreDigestSecondaryVRF, RawBabePreDigestTo159, SlotNumber, VrfData, VrfOutput, VrfProof } from '@polkadot/types/interfaces/babe';
|
||||
import type { AccountData, BalanceLock, BalanceLockTo212, BalanceStatus, Reasons, ReserveData, ReserveIdentifier, VestingSchedule, WithdrawReasons } from '@polkadot/types/interfaces/balances';
|
||||
import type { BeefyAuthoritySet, BeefyCommitment, BeefyId, BeefyNextAuthoritySet, BeefyPayload, BeefyPayloadId, BeefySignedCommitment, MmrRootHash, ValidatorSetId } from '@polkadot/types/interfaces/beefy';
|
||||
import type { BridgeMessageId, BridgedBlockHash, BridgedBlockNumber, BridgedHeader, CallOrigin, ChainId, DeliveredMessages, DispatchFeePayment, InboundLaneData, InboundRelayer, InitializationData, LaneId, MessageData, MessageKey, MessageNonce, MessagesDeliveryProofOf, MessagesProofOf, OperatingMode, OutboundLaneData, OutboundMessageFee, OutboundPayload, Parameter, RelayerId, UnrewardedRelayer, UnrewardedRelayersState } from '@polkadot/types/interfaces/bridges';
|
||||
@@ -45,7 +45,7 @@ import type { ProxyAnnouncement, ProxyDefinition, ProxyType } from '@polkadot/ty
|
||||
import type { AccountStatus, AccountValidity } from '@polkadot/types/interfaces/purchase';
|
||||
import type { ActiveRecovery, RecoveryConfig } from '@polkadot/types/interfaces/recovery';
|
||||
import type { RpcMethods } from '@polkadot/types/interfaces/rpc';
|
||||
import type { AccountId, AccountId20, AccountId32, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, BlockNumberFor, BlockNumberOf, Call, CallHash, CallHashOf, ChangesTrieConfiguration, ChangesTrieSignal, CodecHash, Consensus, ConsensusEngineId, CrateVersion, Digest, DigestItem, EncodedJustification, ExtrinsicsWeight, Fixed128, Fixed64, FixedI128, FixedI64, FixedU128, FixedU64, H1024, H128, H160, H2048, H256, H32, H512, H64, Hash, Header, HeaderPartial, I32F32, Index, IndicesLookupSource, Justification, Justifications, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, MultiAddress, MultiSigner, OpaqueCall, Origin, OriginCaller, PalletId, PalletVersion, PalletsOrigin, Pays, PerU16, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Releases, RuntimeDbWeight, Seal, SealV0, SignedBlock, SignedBlockWithJustification, SignedBlockWithJustifications, Slot, StorageData, StorageProof, TransactionInfo, TransactionPriority, TransactionStorageProof, U32F32, ValidatorId, ValidatorIdOf, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime';
|
||||
import type { AccountId, AccountId20, AccountId32, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, BlockNumberFor, BlockNumberOf, Call, CallHash, CallHashOf, ChangesTrieConfiguration, ChangesTrieSignal, CodecHash, Consensus, ConsensusEngineId, CrateVersion, Digest, DigestItem, EncodedJustification, ExtrinsicsWeight, Fixed128, Fixed64, FixedI128, FixedI64, FixedU128, FixedU64, H1024, H128, H160, H2048, H256, H32, H512, H64, Hash, Header, HeaderPartial, I32F32, Index, IndicesLookupSource, Justification, Justifications, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, MultiAddress, MultiSigner, OpaqueCall, Origin, OriginCaller, PalletId, PalletVersion, PalletsOrigin, Pays, PerU16, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Releases, RuntimeDbWeight, Seal, SealV0, SignedBlock, SignedBlockWithJustification, SignedBlockWithJustifications, Slot, SlotDuration, StorageData, StorageProof, TransactionInfo, TransactionPriority, TransactionStorageProof, U32F32, ValidatorId, ValidatorIdOf, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime';
|
||||
import type { Si0Field, Si0LookupTypeId, Si0Path, Si0Type, Si0TypeDef, Si0TypeDefArray, Si0TypeDefBitSequence, Si0TypeDefCompact, Si0TypeDefComposite, Si0TypeDefPhantom, Si0TypeDefPrimitive, Si0TypeDefSequence, Si0TypeDefTuple, Si0TypeDefVariant, Si0TypeParameter, Si0Variant, Si1Field, Si1LookupTypeId, Si1Path, Si1Type, Si1TypeDef, Si1TypeDefArray, Si1TypeDefBitSequence, Si1TypeDefCompact, Si1TypeDefComposite, Si1TypeDefPrimitive, Si1TypeDefSequence, Si1TypeDefTuple, Si1TypeDefVariant, Si1TypeParameter, Si1Variant, SiField, SiLookupTypeId, SiPath, SiType, SiTypeDef, SiTypeDefArray, SiTypeDefBitSequence, SiTypeDefCompact, SiTypeDefComposite, SiTypeDefPrimitive, SiTypeDefSequence, SiTypeDefTuple, SiTypeDefVariant, SiTypeParameter, SiVariant } from '@polkadot/types/interfaces/scaleInfo';
|
||||
import type { Period, Priority, SchedulePeriod, SchedulePriority, Scheduled, ScheduledTo254, TaskAddress } from '@polkadot/types/interfaces/scheduler';
|
||||
import type { BeefyKey, FullIdentification, IdentificationTuple, Keys, MembershipProof, SessionIndex, SessionKeys1, SessionKeys10, SessionKeys10B, SessionKeys2, SessionKeys3, SessionKeys4, SessionKeys5, SessionKeys6, SessionKeys6B, SessionKeys7, SessionKeys7B, SessionKeys8, SessionKeys8B, SessionKeys9, SessionKeys9B, ValidatorCount } from '@polkadot/types/interfaces/session';
|
||||
@@ -129,6 +129,8 @@ declare module '@polkadot/types/types/registry' {
|
||||
BabeBlockWeight: BabeBlockWeight;
|
||||
BabeEpochConfiguration: BabeEpochConfiguration;
|
||||
BabeEquivocationProof: BabeEquivocationProof;
|
||||
BabeGenesisConfiguration: BabeGenesisConfiguration;
|
||||
BabeGenesisConfigurationV1: BabeGenesisConfigurationV1;
|
||||
BabeWeight: BabeWeight;
|
||||
BackedCandidate: BackedCandidate;
|
||||
Balance: Balance;
|
||||
@@ -338,6 +340,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
ElectionStatus: ElectionStatus;
|
||||
EncodedFinalityProofs: EncodedFinalityProofs;
|
||||
EncodedJustification: EncodedJustification;
|
||||
Epoch: Epoch;
|
||||
EpochAuthorship: EpochAuthorship;
|
||||
Era: Era;
|
||||
EraIndex: EraIndex;
|
||||
@@ -658,6 +661,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
OffenceDetails: OffenceDetails;
|
||||
Offender: Offender;
|
||||
OpaqueCall: OpaqueCall;
|
||||
OpaqueKeyOwnershipProof: OpaqueKeyOwnershipProof;
|
||||
OpaqueMetadata: OpaqueMetadata;
|
||||
OpaqueMultiaddr: OpaqueMultiaddr;
|
||||
OpaqueNetworkState: OpaqueNetworkState;
|
||||
@@ -926,6 +930,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
SlashingSpansTo204: SlashingSpansTo204;
|
||||
SlashJournalEntry: SlashJournalEntry;
|
||||
Slot: Slot;
|
||||
SlotDuration: SlotDuration;
|
||||
SlotNumber: SlotNumber;
|
||||
SlotRange: SlotRange;
|
||||
SlotRange10: SlotRange10;
|
||||
|
||||
@@ -6,8 +6,11 @@
|
||||
|
||||
import type { Definitions } from '../../types';
|
||||
|
||||
import { runtime } from './runtime';
|
||||
|
||||
export default {
|
||||
rpc: {},
|
||||
runtime,
|
||||
types: {
|
||||
RawAuraPreDigest: {
|
||||
slotNumber: 'u64'
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
// Copyright 2017-2022 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { DefinitionsCall } from '../../types';
|
||||
|
||||
export const runtime: DefinitionsCall = {
|
||||
AuraApi: [
|
||||
{
|
||||
methods: {
|
||||
authorities: {
|
||||
description: 'Return the current set of authorities.',
|
||||
params: [],
|
||||
type: 'Vec<AuthorityId>'
|
||||
},
|
||||
slot_duration: {
|
||||
description: 'Returns the slot duration for Aura.',
|
||||
params: [],
|
||||
type: 'SlotDuration'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
@@ -7,9 +7,11 @@
|
||||
import type { Definitions } from '../../types';
|
||||
|
||||
import { rpc } from './rpc';
|
||||
import { runtime } from './runtime';
|
||||
|
||||
export default {
|
||||
rpc,
|
||||
runtime,
|
||||
types: {
|
||||
AllowedSlots: {
|
||||
_enum: ['PrimarySlots', 'PrimaryAndSecondaryPlainSlots', 'PrimaryAndSecondaryVRFSlots']
|
||||
@@ -26,9 +28,33 @@ export default {
|
||||
firstHeader: 'Header',
|
||||
secondHeader: 'Header'
|
||||
},
|
||||
BabeGenesisConfiguration: {
|
||||
slotDuration: 'u64',
|
||||
epochLength: 'u64',
|
||||
c: '(u64, u64)',
|
||||
genesisAuthorities: 'Vec<(AuthorityId, BabeAuthorityWeight)>',
|
||||
randomness: 'Randomness',
|
||||
allowedSlots: 'AllowedSlots'
|
||||
},
|
||||
BabeGenesisConfigurationV1: {
|
||||
slotDuration: 'u64',
|
||||
epochLength: 'u64',
|
||||
c: '(u64, u64)',
|
||||
genesisAuthorities: 'Vec<(AuthorityId, BabeAuthorityWeight)>',
|
||||
randomness: 'Randomness',
|
||||
secondarySlots: 'bool'
|
||||
},
|
||||
BabeWeight: 'u64',
|
||||
MaybeRandomness: 'Option<Randomness>',
|
||||
MaybeVrf: 'Option<VrfData>',
|
||||
Epoch: {
|
||||
epochIndex: 'u64',
|
||||
startSlot: 'Slot',
|
||||
duration: 'u64',
|
||||
authorities: 'Vec<(AuthorityId, BabeAuthorityWeight)>',
|
||||
randomness: 'Hash', // [u8; VRF_OUTPUT_LENGTH],
|
||||
config: 'BabeEpochConfiguration'
|
||||
},
|
||||
EpochAuthorship: {
|
||||
primary: 'Vec<u64>',
|
||||
secondary: 'Vec<u64>',
|
||||
@@ -44,7 +70,8 @@ export default {
|
||||
c: '(u64, u64)',
|
||||
allowedSlots: 'AllowedSlots'
|
||||
},
|
||||
Randomness: 'Hash',
|
||||
OpaqueKeyOwnershipProof: 'Bytes',
|
||||
Randomness: 'Hash', // [u8; RANDOMNESS_LENGTH],
|
||||
RawBabePreDigest: {
|
||||
_enum: {
|
||||
Phantom: 'Null', // index starts at 1... empty slot at 0
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
// Copyright 2017-2022 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { DefinitionCall, DefinitionsCall } from '../../types';
|
||||
|
||||
import { objectSpread } from '@polkadot/util';
|
||||
|
||||
const V1_V2_SHARED: Record<string, DefinitionCall> = {
|
||||
current_epoch: {
|
||||
description: 'Returns information regarding the current epoch.',
|
||||
params: [],
|
||||
type: 'Epoch'
|
||||
},
|
||||
current_epoch_start: {
|
||||
description: 'Returns the slot that started the current epoch.',
|
||||
params: [],
|
||||
type: 'Slot'
|
||||
},
|
||||
generate_key_ownership_proof: {
|
||||
description: 'Generates a proof of key ownership for the given authority in the current epoch.',
|
||||
params: [
|
||||
{
|
||||
name: 'slot',
|
||||
type: 'Slot'
|
||||
},
|
||||
{
|
||||
name: 'authorityId',
|
||||
type: 'AuthorityId'
|
||||
}
|
||||
],
|
||||
type: 'Option<OpaqueKeyOwnershipProof>'
|
||||
},
|
||||
next_epoch: {
|
||||
description: 'Returns information regarding the next epoch (which was already previously announced).',
|
||||
params: [],
|
||||
type: 'Epoch'
|
||||
}
|
||||
// TDODO Add submit_report_equivocation_unsigned_extrinsic
|
||||
};
|
||||
|
||||
export const runtime: DefinitionsCall = {
|
||||
BabeApi: [
|
||||
{
|
||||
methods: objectSpread({
|
||||
configuration: {
|
||||
description: 'Return the genesis configuration for BABE. The configuration is only read on genesis.',
|
||||
params: [],
|
||||
type: 'BabeGenesisConfiguration'
|
||||
}
|
||||
}, V1_V2_SHARED),
|
||||
version: 2
|
||||
},
|
||||
{
|
||||
methods: objectSpread({
|
||||
configuration: {
|
||||
description: 'Return the configuration for BABE. Version 1.',
|
||||
params: [],
|
||||
type: 'BabeGenesisConfigurationV1'
|
||||
}
|
||||
}, V1_V2_SHARED),
|
||||
version: 1
|
||||
}
|
||||
]
|
||||
};
|
||||
@@ -1,10 +1,10 @@
|
||||
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
|
||||
/* eslint-disable */
|
||||
|
||||
import type { Enum, Option, Struct, U8aFixed, Vec, u32, u64 } from '@polkadot/types-codec';
|
||||
import type { Bytes, Enum, Option, Struct, U8aFixed, Vec, bool, u32, u64 } from '@polkadot/types-codec';
|
||||
import type { ITuple } from '@polkadot/types-codec/types';
|
||||
import type { AuthorityId } from '@polkadot/types/interfaces/consensus';
|
||||
import type { Hash, Header } from '@polkadot/types/interfaces/runtime';
|
||||
import type { Hash, Header, Slot } from '@polkadot/types/interfaces/runtime';
|
||||
|
||||
/** @name AllowedSlots */
|
||||
export interface AllowedSlots extends Enum {
|
||||
@@ -34,9 +34,39 @@ export interface BabeEquivocationProof extends Struct {
|
||||
readonly secondHeader: Header;
|
||||
}
|
||||
|
||||
/** @name BabeGenesisConfiguration */
|
||||
export interface BabeGenesisConfiguration extends Struct {
|
||||
readonly slotDuration: u64;
|
||||
readonly epochLength: u64;
|
||||
readonly c: ITuple<[u64, u64]>;
|
||||
readonly genesisAuthorities: Vec<ITuple<[AuthorityId, BabeAuthorityWeight]>>;
|
||||
readonly randomness: Randomness;
|
||||
readonly allowedSlots: AllowedSlots;
|
||||
}
|
||||
|
||||
/** @name BabeGenesisConfigurationV1 */
|
||||
export interface BabeGenesisConfigurationV1 extends Struct {
|
||||
readonly slotDuration: u64;
|
||||
readonly epochLength: u64;
|
||||
readonly c: ITuple<[u64, u64]>;
|
||||
readonly genesisAuthorities: Vec<ITuple<[AuthorityId, BabeAuthorityWeight]>>;
|
||||
readonly randomness: Randomness;
|
||||
readonly secondarySlots: bool;
|
||||
}
|
||||
|
||||
/** @name BabeWeight */
|
||||
export interface BabeWeight extends u64 {}
|
||||
|
||||
/** @name Epoch */
|
||||
export interface Epoch extends Struct {
|
||||
readonly epochIndex: u64;
|
||||
readonly startSlot: Slot;
|
||||
readonly duration: u64;
|
||||
readonly authorities: Vec<ITuple<[AuthorityId, BabeAuthorityWeight]>>;
|
||||
readonly randomness: Hash;
|
||||
readonly config: BabeEpochConfiguration;
|
||||
}
|
||||
|
||||
/** @name EpochAuthorship */
|
||||
export interface EpochAuthorship extends Struct {
|
||||
readonly primary: Vec<u64>;
|
||||
@@ -64,6 +94,9 @@ export interface NextConfigDescriptorV1 extends Struct {
|
||||
readonly allowedSlots: AllowedSlots;
|
||||
}
|
||||
|
||||
/** @name OpaqueKeyOwnershipProof */
|
||||
export interface OpaqueKeyOwnershipProof extends Bytes {}
|
||||
|
||||
/** @name Randomness */
|
||||
export interface Randomness extends Hash {}
|
||||
|
||||
|
||||
@@ -178,6 +178,7 @@ export default {
|
||||
justifications: 'Option<Justifications>'
|
||||
},
|
||||
Slot: 'u64',
|
||||
SlotDuration: 'u64',
|
||||
StorageData: 'Bytes',
|
||||
StorageProof: {
|
||||
trieNodes: 'Vec<Bytes>'
|
||||
|
||||
@@ -333,6 +333,9 @@ export interface SignedBlockWithJustifications extends Struct {
|
||||
/** @name Slot */
|
||||
export interface Slot extends u64 {}
|
||||
|
||||
/** @name SlotDuration */
|
||||
export interface SlotDuration extends u64 {}
|
||||
|
||||
/** @name StorageData */
|
||||
export interface StorageData extends Bytes {}
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ import type { Definitions } from '../../types';
|
||||
|
||||
import { objectSpread } from '@polkadot/util';
|
||||
|
||||
import { runtime } from './runtime';
|
||||
|
||||
// The runtime definition of SessionKeys are passed as a Trait to session
|
||||
// Defined in `node/runtime/src/lib.rs` as follow
|
||||
// impl_opaque_keys! {
|
||||
@@ -39,12 +41,13 @@ const keyTypes = {
|
||||
|
||||
export default {
|
||||
rpc: {},
|
||||
runtime,
|
||||
types: objectSpread({}, keyTypes, {
|
||||
FullIdentification: 'Exposure',
|
||||
IdentificationTuple: '(ValidatorId, FullIdentification)',
|
||||
MembershipProof: {
|
||||
session: 'SessionIndex',
|
||||
trieNodes: 'Vec<Vec<u8>>',
|
||||
trieNodes: 'Vec<Bytes>',
|
||||
validatorCount: 'ValidatorCount'
|
||||
},
|
||||
SessionIndex: 'u32',
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
// Copyright 2017-2022 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { DefinitionsCall } from '../../types';
|
||||
|
||||
export const runtime: DefinitionsCall = {
|
||||
SessionKeys: [
|
||||
{
|
||||
methods: {
|
||||
decode_session_keys: {
|
||||
description: 'Decode the given public session keys.',
|
||||
params: [
|
||||
{
|
||||
name: 'encoded',
|
||||
type: 'Bytes'
|
||||
}
|
||||
],
|
||||
type: 'Option<Vec<(Bytes, KeyTypeId)>>'
|
||||
},
|
||||
generate_session_keys: {
|
||||
description: 'Generate a set of session keys with optionally using the given seed.',
|
||||
params: [
|
||||
{
|
||||
name: 'seed',
|
||||
type: 'Option<Bytes>'
|
||||
}
|
||||
],
|
||||
type: 'Bytes'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
Reference in New Issue
Block a user