diff --git a/packages/types/src/augment/registry.ts b/packages/types/src/augment/registry.ts index cd420f3283..9dff4f537e 100644 --- a/packages/types/src/augment/registry.ts +++ b/packages/types/src/augment/registry.ts @@ -10,7 +10,7 @@ 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 { AccountData, BalanceLock, BalanceLockTo212, BalanceStatus, Reasons, ReserveData, ReserveIdentifier, VestingSchedule, WithdrawReasons } from '@polkadot/types/interfaces/balances'; import type { BeefyCommitment, BeefyId, BeefyNextAuthoritySet, BeefyPayload, BeefySignedCommitment, MmrRootHash, ValidatorSetId } from '@polkadot/types/interfaces/beefy'; -import type { BridgedBlockHash, BridgedBlockNumber, BridgedHeader, ChainId, Id, InitializationData, LaneId, MessageKey, MessageNonce } from '@polkadot/types/interfaces/bridges'; +import type { BridgedBlockHash, BridgedBlockNumber, BridgedHeader, CallOrigin, DeliveredMessages, DispatchFeePayment, InboundLaneData, InboundRelayer, InitializationData, LaneId, MessageData, MessageKey, MessageNonce, MessagesDeliveryProofOf, MessagesProofOf, OperatingMode, OutboundLaneData, OutboundMessageFee, OutboundPayload, Parameter, RelayerId, UnrewardedRelayer, UnrewardedRelayersState } from '@polkadot/types/interfaces/bridges'; import type { BlockHash } from '@polkadot/types/interfaces/chain'; import type { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate'; import type { EthereumAddress, StatementKind } from '@polkadot/types/interfaces/claims'; @@ -103,6 +103,7 @@ declare module '@polkadot/types/types/registry' { 'Compact': Compact; 'Compact': Compact; 'Compact': Compact; + 'Compact': Compact; 'Compact': Compact; 'Compact': Compact; 'Compact': Compact; @@ -275,13 +276,13 @@ declare module '@polkadot/types/types/registry' { 'Option': Option; 'Option': Option; 'Option': Option; + 'Option': Option; 'Option': Option; 'Option': Option; 'Option': Option; 'Option': Option; 'Option': Option; 'Option': Option; - 'Option': Option; 'Option': Option; 'Option': Option; 'Option': Option; @@ -355,6 +356,7 @@ declare module '@polkadot/types/types/registry' { 'Option': Option; 'Option': Option; 'Option': Option; + 'Option': Option; 'Option': Option; 'Option': Option; 'Option': Option; @@ -365,6 +367,7 @@ declare module '@polkadot/types/types/registry' { 'Option': Option; 'Option': Option; 'Option': Option; + 'Option': Option; 'Option': Option; 'Option': Option; 'Option': Option; @@ -546,7 +549,6 @@ declare module '@polkadot/types/types/registry' { 'Option': Option; 'Option': Option; 'Option': Option; - 'Option': Option; 'Option': Option; 'Option': Option; 'Option': Option; @@ -557,6 +559,8 @@ declare module '@polkadot/types/types/registry' { 'Option': Option; 'Option': Option; 'Option': Option; + 'Option': Option; + 'Option': Option; 'Option': Option; 'Option': Option; 'Option': Option; @@ -604,11 +608,14 @@ declare module '@polkadot/types/types/registry' { 'Option': Option; 'Option': Option; 'Option': Option; + 'Option': Option; 'Option': Option; 'Option': Option; 'Option': Option; 'Option': Option; 'Option': Option; + 'Option': Option; + 'Option': Option; 'Option': Option; 'Option': Option; 'Option': Option; @@ -677,9 +684,13 @@ declare module '@polkadot/types/types/registry' { 'Option': Option; 'Option': Option; 'Option': Option; + 'Option': Option; 'Option': Option; 'Option': Option; 'Option': Option; + 'Option': Option; + 'Option': Option; + 'Option': Option; 'Option': Option; 'Option': Option; 'Option': Option; @@ -709,6 +720,7 @@ declare module '@polkadot/types/types/registry' { 'Option': Option; 'Option': Option; 'Option': Option; + 'Option': Option; 'Option': Option; 'Option': Option; 'Option': Option; @@ -799,6 +811,7 @@ declare module '@polkadot/types/types/registry' { 'Option': Option; 'Option': Option; 'Option': Option; + 'Option': Option; 'Option': Option; 'Option': Option; 'Option': Option; @@ -1003,6 +1016,8 @@ declare module '@polkadot/types/types/registry' { 'Option': Option; 'Option': Option; 'Option': Option; + 'Option': Option; + 'Option': Option; 'Option': Option; 'Option': Option; 'Option': Option; @@ -1199,13 +1214,13 @@ declare module '@polkadot/types/types/registry' { 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; + 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; - 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; @@ -1279,6 +1294,7 @@ declare module '@polkadot/types/types/registry' { 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; + 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; @@ -1289,6 +1305,7 @@ declare module '@polkadot/types/types/registry' { 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; + 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; @@ -1470,7 +1487,6 @@ declare module '@polkadot/types/types/registry' { 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; - 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; @@ -1481,6 +1497,8 @@ declare module '@polkadot/types/types/registry' { 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; + 'Vec': Vec; + 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; @@ -1528,11 +1546,14 @@ declare module '@polkadot/types/types/registry' { 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; + 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; + 'Vec': Vec; + 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; @@ -1601,9 +1622,13 @@ declare module '@polkadot/types/types/registry' { 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; + 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; + 'Vec': Vec; + 'Vec': Vec; + 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; @@ -1633,6 +1658,7 @@ declare module '@polkadot/types/types/registry' { 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; + 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; @@ -1723,6 +1749,7 @@ declare module '@polkadot/types/types/registry' { 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; + 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; @@ -1927,6 +1954,8 @@ declare module '@polkadot/types/types/registry' { 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; + 'Vec': Vec; + 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; @@ -2123,13 +2152,13 @@ declare module '@polkadot/types/types/registry' { CallHash: CallHash; CallHashOf: CallHashOf; CallIndex: CallIndex; + CallOrigin: CallOrigin; CandidateCommitments: CandidateCommitments; CandidateDescriptor: CandidateDescriptor; CandidateHash: CandidateHash; CandidateInfo: CandidateInfo; CandidatePendingAvailability: CandidatePendingAvailability; CandidateReceipt: CandidateReceipt; - ChainId: ChainId; ChainProperties: ChainProperties; ChainType: ChainType; ChangesTrieConfiguration: ChangesTrieConfiguration; @@ -2203,6 +2232,7 @@ declare module '@polkadot/types/types/registry' { DelayKindBest: DelayKindBest; Delegations: Delegations; DeletedContract: DeletedContract; + DeliveredMessages: DeliveredMessages; DepositBalance: DepositBalance; DepositBalanceOf: DepositBalanceOf; DestroyWitness: DestroyWitness; @@ -2213,6 +2243,7 @@ declare module '@polkadot/types/types/registry' { DispatchError: DispatchError; DispatchErrorModule: DispatchErrorModule; DispatchErrorTo198: DispatchErrorTo198; + DispatchFeePayment: DispatchFeePayment; DispatchInfo: DispatchInfo; DispatchInfoTo190: DispatchInfoTo190; DispatchInfoTo244: DispatchInfoTo244; @@ -2394,7 +2425,6 @@ declare module '@polkadot/types/types/registry' { I64: I64; i8: i8; I8: I8; - Id: Id; IdentificationTuple: IdentificationTuple; IdentityFields: IdentityFields; IdentityInfo: IdentityInfo; @@ -2405,6 +2435,8 @@ declare module '@polkadot/types/types/registry' { InboundDownwardMessage: InboundDownwardMessage; InboundHrmpMessage: InboundHrmpMessage; InboundHrmpMessages: InboundHrmpMessages; + InboundLaneData: InboundLaneData; + InboundRelayer: InboundRelayer; InboundStatus: InboundStatus; IncludedBlocks: IncludedBlocks; InclusionFee: InclusionFee; @@ -2452,11 +2484,14 @@ declare module '@polkadot/types/types/registry' { MaybeVrf: MaybeVrf; MemberCount: MemberCount; MembershipProof: MembershipProof; + MessageData: MessageData; MessageId: MessageId; MessageIngestionType: MessageIngestionType; MessageKey: MessageKey; MessageNonce: MessageNonce; MessageQueueChain: MessageQueueChain; + MessagesDeliveryProofOf: MessagesDeliveryProofOf; + MessagesProofOf: MessagesProofOf; MessagingStateSnapshot: MessagingStateSnapshot; MessagingStateSnapshotEgressEntry: MessagingStateSnapshotEgressEntry; MetadataAll: MetadataAll; @@ -2525,9 +2560,13 @@ declare module '@polkadot/types/types/registry' { OpenTipFinderTo225: OpenTipFinderTo225; OpenTipTip: OpenTipTip; OpenTipTo225: OpenTipTo225; + OperatingMode: OperatingMode; Origin: Origin; OriginCaller: OriginCaller; OutboundHrmpMessage: OutboundHrmpMessage; + OutboundLaneData: OutboundLaneData; + OutboundMessageFee: OutboundMessageFee; + OutboundPayload: OutboundPayload; OutboundStatus: OutboundStatus; Outcome: Outcome; OverweightIndex: OverweightIndex; @@ -2557,6 +2596,7 @@ declare module '@polkadot/types/types/registry' { ParaId: ParaId; ParaInfo: ParaInfo; ParaLifecycle: ParaLifecycle; + Parameter: Parameter; ParaPastCodeMeta: ParaPastCodeMeta; ParaScheduling: ParaScheduling; ParathreadClaim: ParathreadClaim; @@ -2647,6 +2687,7 @@ declare module '@polkadot/types/types/registry' { RelayBlockNumber: RelayBlockNumber; RelayChainBlockNumber: RelayChainBlockNumber; RelayChainHash: RelayChainHash; + RelayerId: RelayerId; RelayHash: RelayHash; Releases: Releases; Remark: Remark; @@ -2851,6 +2892,8 @@ declare module '@polkadot/types/types/registry' { UncleEntryItem: UncleEntryItem; UnknownTransaction: UnknownTransaction; UnlockChunk: UnlockChunk; + UnrewardedRelayer: UnrewardedRelayer; + UnrewardedRelayersState: UnrewardedRelayersState; UpwardMessage: UpwardMessage; usize: usize; USize: USize; diff --git a/packages/types/src/interfaces/bridges/definitions.ts b/packages/types/src/interfaces/bridges/definitions.ts index ae484f5d87..3f09d5c673 100644 --- a/packages/types/src/interfaces/bridges/definitions.ts +++ b/packages/types/src/interfaces/bridges/definitions.ts @@ -12,21 +12,81 @@ export default { BridgedBlockHash: 'H256', BridgedBlockNumber: 'BlockNumber', BridgedHeader: 'Header', + CallOrigin: { + _enum: { + SourceRoot: 'Null', + TargetAccount: '(AccountId, MultiSigner, MultiSignature)', + SourceAccount: 'AccountId' + } + }, + DeliveredMessages: { + begin: 'MessageNonce', + end: 'MessageNonce', + // pub type DispatchResultsBitVec = BitVec; + dispatchResults: 'BitVec' + }, + DispatchFeePayment: { + _enum: ['AtSourceChain', 'AtTargetChain'] + }, + InboundLaneData: { + relayers: 'Vec', + lastConfirmedNonce: 'MessageNonce' + }, + InboundRelayer: 'AccountId', InitializationData: { header: 'Header', authorityList: 'AuthorityList', setId: 'SetId', isHalted: 'bool' }, - Id: '[u8; 4]', - ChainId: 'Id', - LaneId: 'Id', - MessageNonce: 'u64', - // Overrides what is in cumulus, however needed - needs an alias - // MessageId: '(Id, u64)', + LaneId: '[u8; 4]', + MessageData: { + payload: 'Bytes', + fee: 'Balance' + }, + MessagesDeliveryProofOf: { + bridgedHeaderHash: 'BlockHash', + storageProof: 'Vec', + lane: 'LaneId' + }, MessageKey: { laneId: 'LaneId', nonce: 'MessageNonce' + }, + MessageNonce: 'u64', + MessagesProofOf: { + bridgedHeaderHash: 'BridgedBlockHash', + storageProof: 'Vec', + lane: 'LaneId', + noncesStart: 'MessageNonce', + noncesEnd: 'MessageNonce' + }, + OperatingMode: { + _enum: ['Normal', 'RejectingOutboundMessages', 'Halted'] + }, + OutboundLaneData: { + latestGeneratedNonce: 'MessageNonce', + latestReceivedNonce: 'MessageNonce', + oldestUnprunedNonce: 'MessageNonce' + }, + OutboundMessageFee: 'Balance', + OutboundPayload: { + specVersion: 'u32', + weight: 'Weight', + origin: 'CallOrigin', + dispatchFeePayment: 'DispatchFeePayment', + call: 'Bytes' + }, + Parameter: 'Null', + RelayerId: 'AccountId', + UnrewardedRelayer: { + relayer: 'RelayerId', + messages: 'DeliveredMessages' + }, + UnrewardedRelayersState: { + unrewardedRelayer_Entries: 'MessageNonce', + messagesInOldestEntry: 'MessageNonce', + totalMessages: 'MessageNonce' } } } as Definitions; diff --git a/packages/types/src/interfaces/bridges/types.ts b/packages/types/src/interfaces/bridges/types.ts index 8939207d2d..42c57f7472 100644 --- a/packages/types/src/interfaces/bridges/types.ts +++ b/packages/types/src/interfaces/bridges/types.ts @@ -1,9 +1,12 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import type { Struct, U8aFixed, bool, u64 } from '@polkadot/types'; +import type { BitVec, Bytes, Enum, Null, Struct, U8aFixed, Vec, bool, u32, u64 } from '@polkadot/types'; +import type { ITuple } from '@polkadot/types/types'; +import type { BlockHash } from '@polkadot/types/interfaces/chain'; +import type { MultiSignature } from '@polkadot/types/interfaces/extrinsics'; import type { AuthorityList, SetId } from '@polkadot/types/interfaces/grandpa'; -import type { BlockNumber, H256, Header } from '@polkadot/types/interfaces/runtime'; +import type { AccountId, Balance, BlockNumber, H256, Header, MultiSigner, Weight } from '@polkadot/types/interfaces/runtime'; /** @name BridgedBlockHash */ export interface BridgedBlockHash extends H256 {} @@ -14,11 +17,36 @@ export interface BridgedBlockNumber extends BlockNumber {} /** @name BridgedHeader */ export interface BridgedHeader extends Header {} -/** @name ChainId */ -export interface ChainId extends Id {} +/** @name CallOrigin */ +export interface CallOrigin extends Enum { + readonly isSourceRoot: boolean; + readonly isTargetAccount: boolean; + readonly asTargetAccount: ITuple<[AccountId, MultiSigner, MultiSignature]>; + readonly isSourceAccount: boolean; + readonly asSourceAccount: AccountId; +} -/** @name Id */ -export interface Id extends U8aFixed {} +/** @name DeliveredMessages */ +export interface DeliveredMessages extends Struct { + readonly begin: MessageNonce; + readonly end: MessageNonce; + readonly dispatchResults: BitVec; +} + +/** @name DispatchFeePayment */ +export interface DispatchFeePayment extends Enum { + readonly isAtSourceChain: boolean; + readonly isAtTargetChain: boolean; +} + +/** @name InboundLaneData */ +export interface InboundLaneData extends Struct { + readonly relayers: Vec; + readonly lastConfirmedNonce: MessageNonce; +} + +/** @name InboundRelayer */ +export interface InboundRelayer extends AccountId {} /** @name InitializationData */ export interface InitializationData extends Struct { @@ -29,7 +57,13 @@ export interface InitializationData extends Struct { } /** @name LaneId */ -export interface LaneId extends Id {} +export interface LaneId extends U8aFixed {} + +/** @name MessageData */ +export interface MessageData extends Struct { + readonly payload: Bytes; + readonly fee: Balance; +} /** @name MessageKey */ export interface MessageKey extends Struct { @@ -40,4 +74,65 @@ export interface MessageKey extends Struct { /** @name MessageNonce */ export interface MessageNonce extends u64 {} +/** @name MessagesDeliveryProofOf */ +export interface MessagesDeliveryProofOf extends Struct { + readonly bridgedHeaderHash: BlockHash; + readonly storageProof: Vec; + readonly lane: LaneId; +} + +/** @name MessagesProofOf */ +export interface MessagesProofOf extends Struct { + readonly bridgedHeaderHash: BridgedBlockHash; + readonly storageProof: Vec; + readonly lane: LaneId; + readonly noncesStart: MessageNonce; + readonly noncesEnd: MessageNonce; +} + +/** @name OperatingMode */ +export interface OperatingMode extends Enum { + readonly isNormal: boolean; + readonly isRejectingOutboundMessages: boolean; + readonly isHalted: boolean; +} + +/** @name OutboundLaneData */ +export interface OutboundLaneData extends Struct { + readonly latestGeneratedNonce: MessageNonce; + readonly latestReceivedNonce: MessageNonce; + readonly oldestUnprunedNonce: MessageNonce; +} + +/** @name OutboundMessageFee */ +export interface OutboundMessageFee extends Balance {} + +/** @name OutboundPayload */ +export interface OutboundPayload extends Struct { + readonly specVersion: u32; + readonly weight: Weight; + readonly origin: CallOrigin; + readonly dispatchFeePayment: DispatchFeePayment; + readonly call: Bytes; +} + +/** @name Parameter */ +export interface Parameter extends Null {} + +/** @name RelayerId */ +export interface RelayerId extends AccountId {} + +/** @name UnrewardedRelayer */ +export interface UnrewardedRelayer extends Struct { + readonly relayer: RelayerId; + readonly messages: DeliveredMessages; +} + +/** @name UnrewardedRelayersState */ +export interface UnrewardedRelayersState extends Struct { + readonly unrewardedRelayer_Entries: MessageNonce; + readonly messagesInOldestEntry: MessageNonce; + readonly totalMessages: MessageNonce; +} + export type PHANTOM_BRIDGES = 'bridges';