diff --git a/CHANGELOG.md b/CHANGELOG.md index eb840ade4a..c7570cba4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ Changes: - Support for `state_call` definitions via API config (exposed on `api.runtime.*`) -- Type generation for runtime call definitions (not exposed by default) +- Type generation for runtime call definitions ## 8.10.1 Jun 26, 2022 diff --git a/packages/api-augment/src/kusama/runtime.ts b/packages/api-augment/src/kusama/runtime.ts index 545df3d744..36d23389c3 100644 --- a/packages/api-augment/src/kusama/runtime.ts +++ b/packages/api-augment/src/kusama/runtime.ts @@ -2,17 +2,23 @@ /* eslint-disable */ import type { ApiTypes } from '@polkadot/api-base/types'; -import type { Bytes, Option, Vec, u32 } from '@polkadot/types-codec'; +import type { Bytes, Null, Option, Result, 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 { BabeEquivocationProof, BabeGenesisConfiguration, Epoch, OpaqueKeyOwnershipProof } from '@polkadot/types/interfaces/babe'; import type { ValidatorSet } from '@polkadot/types/interfaces/beefy'; +import type { CheckInherentsResult, InherentData } from '@polkadot/types/interfaces/blockbuilder'; +import type { BlockHash } from '@polkadot/types/interfaces/chain'; import type { AuthorityId } from '@polkadot/types/interfaces/consensus'; -import type { AuthorityList, SetId } from '@polkadot/types/interfaces/grandpa'; +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 { FeeDetails, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment'; -import type { AccountId, Index, KeyTypeId, Slot } from '@polkadot/types/interfaces/runtime'; +import type { AccountId, Block, Hash, Header, Index, KeyTypeId, Slot } from '@polkadot/types/interfaces/runtime'; import type { RuntimeVersion } from '@polkadot/types/interfaces/state'; -import type { Observable } from '@polkadot/types/types'; +import type { ApplyExtrinsicResult } from '@polkadot/types/interfaces/system'; +import type { TransactionSource, TransactionValidity } from '@polkadot/types/interfaces/txqueue'; +import type { IExtrinsic, Observable } from '@polkadot/types/types'; declare module '@polkadot/api-base/types/calls' { export interface AugmentedCalls { @@ -60,6 +66,10 @@ declare module '@polkadot/api-base/types/calls' { * Returns information regarding the next epoch (which was already previously announced). **/ nextEpoch: AugmentedCall Observable>; + /** + * Submits an unsigned extrinsic to report an equivocation. + **/ + submitReportEquivocationUnsignedExtrinsic: AugmentedCall Observable>>; /** * Generic call **/ @@ -76,8 +86,39 @@ declare module '@polkadot/api-base/types/calls' { **/ [key: string]: DecoratedCallBase; }; + /** 0x40fe3ad401f8959a/6 */ + blockBuilder: { + /** + * Apply the given extrinsic. + **/ + applyExtrinsic: AugmentedCall Observable>; + /** + * Check that the inherents are valid. + **/ + checkInherents: AugmentedCall Observable>; + /** + * Finish the current block. + **/ + finalizeBlock: AugmentedCall Observable
>; + /** + * Generate inherent extrinsics. + **/ + inherentExtrinsics: AugmentedCall Observable>>; + /** + * Generic call + **/ + [key: string]: DecoratedCallBase; + }; /** 0xdf6acb689907609b/4 */ core: { + /** + * Execute the given block. + **/ + executeBlock: AugmentedCall Observable>; + /** + * Initialize a block with the given header. + **/ + initializeBlock: AugmentedCall Observable>; /** * Returns the version of the runtime. **/ @@ -93,10 +134,18 @@ declare module '@polkadot/api-base/types/calls' { * Get current GRANDPA authority set id. **/ currentSetId: AugmentedCall Observable>; + /** + * Generates a proof of key ownership for the given authority in the given set. + **/ + generateKeyOwnershipProof: AugmentedCall Observable>>; /** * Get the current GRANDPA authorities and weights. This should not change except for when changes are scheduled and the corresponding delay has passed. **/ grandpaAuthorities: AugmentedCall Observable>; + /** + * Submits an unsigned extrinsic to report an equivocation. + **/ + submitReportEquivocationUnsignedExtrinsic: AugmentedCall Observable>>; /** * Generic call **/ @@ -113,6 +162,52 @@ declare module '@polkadot/api-base/types/calls' { **/ [key: string]: DecoratedCallBase; }; + /** 0x91d5df18b0d2cf58/1 */ + mmrApi: { + /** + * Generate MMR proof for a series of leaves under given indices. + **/ + generateBatchProof: AugmentedCall | (MmrLeafIndex | AnyNumber | Uint8Array)[]) => Observable, MmrBatchProof]>, MmrError>>>; + /** + * Generate MMR proof for a leaf under given index. + **/ + generateProof: AugmentedCall Observable, MmrError>>>; + /** + * Return the on-chain MMR root hash. + **/ + mmrRoot: AugmentedCall Observable>>; + /** + * Verify MMR proof against on-chain MMR for a batch of leaves. + **/ + verifyBatchProof: AugmentedCall | (MmrEncodableOpaqueLeaf | string | Uint8Array)[], proof: MmrBatchProof | { leafIndices?: any; leafCount?: any; items?: any } | string | Uint8Array) => Observable, MmrError>>>; + /** + * Verify MMR proof against given root hash or a batch of leaves. + **/ + verifyBatchProofStateless: AugmentedCall | (MmrEncodableOpaqueLeaf | string | Uint8Array)[], proof: MmrBatchProof | { leafIndices?: any; leafCount?: any; items?: any } | string | Uint8Array) => Observable, MmrError>>>; + /** + * Verify MMR proof against on-chain MMR. + **/ + verifyProof: AugmentedCall Observable, MmrError>>>; + /** + * Verify MMR proof against given root hash. + **/ + verifyProofStateless: AugmentedCall Observable, MmrError>>>; + /** + * Generic call + **/ + [key: string]: DecoratedCallBase; + }; + /** 0xf78b278be53f454c/2 */ + offchainWorkerApi: { + /** + * Starts the off-chain task for given block header. + **/ + offchainWorker: AugmentedCall Observable>; + /** + * Generic call + **/ + [key: string]: DecoratedCallBase; + }; /** 0xab3c0572291feb8b/1 */ sessionKeys: { /** @@ -128,16 +223,27 @@ declare module '@polkadot/api-base/types/calls' { **/ [key: string]: DecoratedCallBase; }; + /** 0xd2bc9897eed08f15/3 */ + taggedTransactionQueue: { + /** + * Validate the transaction. + **/ + validateTransaction: AugmentedCall Observable>; + /** + * Generic call + **/ + [key: string]: DecoratedCallBase; + }; /** 0x37c8bb1350a9a2a8/1 */ transactionPaymentApi: { /** * The transaction fee details **/ - queryFeeDetails: AugmentedCall Observable>; + queryFeeDetails: AugmentedCall Observable>; /** * The transaction info **/ - queryInfo: AugmentedCall Observable>; + queryInfo: AugmentedCall Observable>; /** * Generic call **/ diff --git a/packages/api-augment/src/polkadot/runtime.ts b/packages/api-augment/src/polkadot/runtime.ts index 545df3d744..36d23389c3 100644 --- a/packages/api-augment/src/polkadot/runtime.ts +++ b/packages/api-augment/src/polkadot/runtime.ts @@ -2,17 +2,23 @@ /* eslint-disable */ import type { ApiTypes } from '@polkadot/api-base/types'; -import type { Bytes, Option, Vec, u32 } from '@polkadot/types-codec'; +import type { Bytes, Null, Option, Result, 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 { BabeEquivocationProof, BabeGenesisConfiguration, Epoch, OpaqueKeyOwnershipProof } from '@polkadot/types/interfaces/babe'; import type { ValidatorSet } from '@polkadot/types/interfaces/beefy'; +import type { CheckInherentsResult, InherentData } from '@polkadot/types/interfaces/blockbuilder'; +import type { BlockHash } from '@polkadot/types/interfaces/chain'; import type { AuthorityId } from '@polkadot/types/interfaces/consensus'; -import type { AuthorityList, SetId } from '@polkadot/types/interfaces/grandpa'; +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 { FeeDetails, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment'; -import type { AccountId, Index, KeyTypeId, Slot } from '@polkadot/types/interfaces/runtime'; +import type { AccountId, Block, Hash, Header, Index, KeyTypeId, Slot } from '@polkadot/types/interfaces/runtime'; import type { RuntimeVersion } from '@polkadot/types/interfaces/state'; -import type { Observable } from '@polkadot/types/types'; +import type { ApplyExtrinsicResult } from '@polkadot/types/interfaces/system'; +import type { TransactionSource, TransactionValidity } from '@polkadot/types/interfaces/txqueue'; +import type { IExtrinsic, Observable } from '@polkadot/types/types'; declare module '@polkadot/api-base/types/calls' { export interface AugmentedCalls { @@ -60,6 +66,10 @@ declare module '@polkadot/api-base/types/calls' { * Returns information regarding the next epoch (which was already previously announced). **/ nextEpoch: AugmentedCall Observable>; + /** + * Submits an unsigned extrinsic to report an equivocation. + **/ + submitReportEquivocationUnsignedExtrinsic: AugmentedCall Observable>>; /** * Generic call **/ @@ -76,8 +86,39 @@ declare module '@polkadot/api-base/types/calls' { **/ [key: string]: DecoratedCallBase; }; + /** 0x40fe3ad401f8959a/6 */ + blockBuilder: { + /** + * Apply the given extrinsic. + **/ + applyExtrinsic: AugmentedCall Observable>; + /** + * Check that the inherents are valid. + **/ + checkInherents: AugmentedCall Observable>; + /** + * Finish the current block. + **/ + finalizeBlock: AugmentedCall Observable
>; + /** + * Generate inherent extrinsics. + **/ + inherentExtrinsics: AugmentedCall Observable>>; + /** + * Generic call + **/ + [key: string]: DecoratedCallBase; + }; /** 0xdf6acb689907609b/4 */ core: { + /** + * Execute the given block. + **/ + executeBlock: AugmentedCall Observable>; + /** + * Initialize a block with the given header. + **/ + initializeBlock: AugmentedCall Observable>; /** * Returns the version of the runtime. **/ @@ -93,10 +134,18 @@ declare module '@polkadot/api-base/types/calls' { * Get current GRANDPA authority set id. **/ currentSetId: AugmentedCall Observable>; + /** + * Generates a proof of key ownership for the given authority in the given set. + **/ + generateKeyOwnershipProof: AugmentedCall Observable>>; /** * Get the current GRANDPA authorities and weights. This should not change except for when changes are scheduled and the corresponding delay has passed. **/ grandpaAuthorities: AugmentedCall Observable>; + /** + * Submits an unsigned extrinsic to report an equivocation. + **/ + submitReportEquivocationUnsignedExtrinsic: AugmentedCall Observable>>; /** * Generic call **/ @@ -113,6 +162,52 @@ declare module '@polkadot/api-base/types/calls' { **/ [key: string]: DecoratedCallBase; }; + /** 0x91d5df18b0d2cf58/1 */ + mmrApi: { + /** + * Generate MMR proof for a series of leaves under given indices. + **/ + generateBatchProof: AugmentedCall | (MmrLeafIndex | AnyNumber | Uint8Array)[]) => Observable, MmrBatchProof]>, MmrError>>>; + /** + * Generate MMR proof for a leaf under given index. + **/ + generateProof: AugmentedCall Observable, MmrError>>>; + /** + * Return the on-chain MMR root hash. + **/ + mmrRoot: AugmentedCall Observable>>; + /** + * Verify MMR proof against on-chain MMR for a batch of leaves. + **/ + verifyBatchProof: AugmentedCall | (MmrEncodableOpaqueLeaf | string | Uint8Array)[], proof: MmrBatchProof | { leafIndices?: any; leafCount?: any; items?: any } | string | Uint8Array) => Observable, MmrError>>>; + /** + * Verify MMR proof against given root hash or a batch of leaves. + **/ + verifyBatchProofStateless: AugmentedCall | (MmrEncodableOpaqueLeaf | string | Uint8Array)[], proof: MmrBatchProof | { leafIndices?: any; leafCount?: any; items?: any } | string | Uint8Array) => Observable, MmrError>>>; + /** + * Verify MMR proof against on-chain MMR. + **/ + verifyProof: AugmentedCall Observable, MmrError>>>; + /** + * Verify MMR proof against given root hash. + **/ + verifyProofStateless: AugmentedCall Observable, MmrError>>>; + /** + * Generic call + **/ + [key: string]: DecoratedCallBase; + }; + /** 0xf78b278be53f454c/2 */ + offchainWorkerApi: { + /** + * Starts the off-chain task for given block header. + **/ + offchainWorker: AugmentedCall Observable>; + /** + * Generic call + **/ + [key: string]: DecoratedCallBase; + }; /** 0xab3c0572291feb8b/1 */ sessionKeys: { /** @@ -128,16 +223,27 @@ declare module '@polkadot/api-base/types/calls' { **/ [key: string]: DecoratedCallBase; }; + /** 0xd2bc9897eed08f15/3 */ + taggedTransactionQueue: { + /** + * Validate the transaction. + **/ + validateTransaction: AugmentedCall Observable>; + /** + * Generic call + **/ + [key: string]: DecoratedCallBase; + }; /** 0x37c8bb1350a9a2a8/1 */ transactionPaymentApi: { /** * The transaction fee details **/ - queryFeeDetails: AugmentedCall Observable>; + queryFeeDetails: AugmentedCall Observable>; /** * The transaction info **/ - queryInfo: AugmentedCall Observable>; + queryInfo: AugmentedCall Observable>; /** * Generic call **/ diff --git a/packages/api-augment/src/substrate/runtime.ts b/packages/api-augment/src/substrate/runtime.ts index c5e18aa3fc..fc761aa876 100644 --- a/packages/api-augment/src/substrate/runtime.ts +++ b/packages/api-augment/src/substrate/runtime.ts @@ -2,17 +2,23 @@ /* eslint-disable */ import type { ApiTypes } from '@polkadot/api-base/types'; -import type { Bytes, Option, Vec, u32, u64 } from '@polkadot/types-codec'; +import type { Bytes, Null, Option, Result, 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 { BabeEquivocationProof, BabeGenesisConfiguration, Epoch, OpaqueKeyOwnershipProof } from '@polkadot/types/interfaces/babe'; +import type { CheckInherentsResult, InherentData } from '@polkadot/types/interfaces/blockbuilder'; +import type { BlockHash } from '@polkadot/types/interfaces/chain'; 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 { 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 { FeeDetails, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment'; -import type { AccountId, Balance, Index, KeyTypeId, Slot } from '@polkadot/types/interfaces/runtime'; +import type { AccountId, Balance, Block, Hash, Header, Index, KeyTypeId, Slot } from '@polkadot/types/interfaces/runtime'; import type { RuntimeVersion } from '@polkadot/types/interfaces/state'; -import type { Observable } from '@polkadot/types/types'; +import type { ApplyExtrinsicResult } from '@polkadot/types/interfaces/system'; +import type { TransactionSource, TransactionValidity } from '@polkadot/types/interfaces/txqueue'; +import type { IExtrinsic, Observable } from '@polkadot/types/types'; declare module '@polkadot/api-base/types/calls' { export interface AugmentedCalls { @@ -60,6 +66,33 @@ declare module '@polkadot/api-base/types/calls' { * Returns information regarding the next epoch (which was already previously announced). **/ nextEpoch: AugmentedCall Observable>; + /** + * Submits an unsigned extrinsic to report an equivocation. + **/ + submitReportEquivocationUnsignedExtrinsic: AugmentedCall Observable>>; + /** + * Generic call + **/ + [key: string]: DecoratedCallBase; + }; + /** 0x40fe3ad401f8959a/6 */ + blockBuilder: { + /** + * Apply the given extrinsic. + **/ + applyExtrinsic: AugmentedCall Observable>; + /** + * Check that the inherents are valid. + **/ + checkInherents: AugmentedCall Observable>; + /** + * Finish the current block. + **/ + finalizeBlock: AugmentedCall Observable
>; + /** + * Generate inherent extrinsics. + **/ + inherentExtrinsics: AugmentedCall Observable>>; /** * Generic call **/ @@ -90,6 +123,14 @@ declare module '@polkadot/api-base/types/calls' { }; /** 0xdf6acb689907609b/4 */ core: { + /** + * Execute the given block. + **/ + executeBlock: AugmentedCall Observable>; + /** + * Initialize a block with the given header. + **/ + initializeBlock: AugmentedCall Observable>; /** * Returns the version of the runtime. **/ @@ -105,10 +146,18 @@ declare module '@polkadot/api-base/types/calls' { * Get current GRANDPA authority set id. **/ currentSetId: AugmentedCall Observable>; + /** + * Generates a proof of key ownership for the given authority in the given set. + **/ + generateKeyOwnershipProof: AugmentedCall Observable>>; /** * Get the current GRANDPA authorities and weights. This should not change except for when changes are scheduled and the corresponding delay has passed. **/ grandpaAuthorities: AugmentedCall Observable>; + /** + * Submits an unsigned extrinsic to report an equivocation. + **/ + submitReportEquivocationUnsignedExtrinsic: AugmentedCall Observable>>; /** * Generic call **/ @@ -125,6 +174,52 @@ declare module '@polkadot/api-base/types/calls' { **/ [key: string]: DecoratedCallBase; }; + /** 0x91d5df18b0d2cf58/1 */ + mmrApi: { + /** + * Generate MMR proof for a series of leaves under given indices. + **/ + generateBatchProof: AugmentedCall | (MmrLeafIndex | AnyNumber | Uint8Array)[]) => Observable, MmrBatchProof]>, MmrError>>>; + /** + * Generate MMR proof for a leaf under given index. + **/ + generateProof: AugmentedCall Observable, MmrError>>>; + /** + * Return the on-chain MMR root hash. + **/ + mmrRoot: AugmentedCall Observable>>; + /** + * Verify MMR proof against on-chain MMR for a batch of leaves. + **/ + verifyBatchProof: AugmentedCall | (MmrEncodableOpaqueLeaf | string | Uint8Array)[], proof: MmrBatchProof | { leafIndices?: any; leafCount?: any; items?: any } | string | Uint8Array) => Observable, MmrError>>>; + /** + * Verify MMR proof against given root hash or a batch of leaves. + **/ + verifyBatchProofStateless: AugmentedCall | (MmrEncodableOpaqueLeaf | string | Uint8Array)[], proof: MmrBatchProof | { leafIndices?: any; leafCount?: any; items?: any } | string | Uint8Array) => Observable, MmrError>>>; + /** + * Verify MMR proof against on-chain MMR. + **/ + verifyProof: AugmentedCall Observable, MmrError>>>; + /** + * Verify MMR proof against given root hash. + **/ + verifyProofStateless: AugmentedCall Observable, MmrError>>>; + /** + * Generic call + **/ + [key: string]: DecoratedCallBase; + }; + /** 0xf78b278be53f454c/2 */ + offchainWorkerApi: { + /** + * Starts the off-chain task for given block header. + **/ + offchainWorker: AugmentedCall Observable>; + /** + * Generic call + **/ + [key: string]: DecoratedCallBase; + }; /** 0xab3c0572291feb8b/1 */ sessionKeys: { /** @@ -140,16 +235,27 @@ declare module '@polkadot/api-base/types/calls' { **/ [key: string]: DecoratedCallBase; }; + /** 0xd2bc9897eed08f15/3 */ + taggedTransactionQueue: { + /** + * Validate the transaction. + **/ + validateTransaction: AugmentedCall Observable>; + /** + * Generic call + **/ + [key: string]: DecoratedCallBase; + }; /** 0x37c8bb1350a9a2a8/1 */ transactionPaymentApi: { /** * The transaction fee details **/ - queryFeeDetails: AugmentedCall Observable>; + queryFeeDetails: AugmentedCall Observable>; /** * The transaction info **/ - queryInfo: AugmentedCall Observable>; + queryInfo: AugmentedCall Observable>; /** * Generic call **/ diff --git a/packages/rpc-augment/src/augment/jsonrpc.ts b/packages/rpc-augment/src/augment/jsonrpc.ts index b7b3911e9d..cd995ccee0 100644 --- a/packages/rpc-augment/src/augment/jsonrpc.ts +++ b/packages/rpc-augment/src/augment/jsonrpc.ts @@ -56,11 +56,11 @@ declare module '@polkadot/rpc-core/types/jsonrpc' { /** * Submit and subscribe to watch an extrinsic until unsubscribed **/ - submitAndWatchExtrinsic: AugmentedRpc<(extrinsic: IExtrinsic) => Observable>; + submitAndWatchExtrinsic: AugmentedRpc<(extrinsic: Extrinsic | IExtrinsic | string | Uint8Array) => Observable>; /** * Submit a fully formatted extrinsic for block inclusion **/ - submitExtrinsic: AugmentedRpc<(extrinsic: IExtrinsic) => Observable>; + submitExtrinsic: AugmentedRpc<(extrinsic: Extrinsic | IExtrinsic | string | Uint8Array) => Observable>; }; babe: { /** diff --git a/packages/typegen/src/util/derived.ts b/packages/typegen/src/util/derived.ts index 367c07d999..c9d78294cc 100644 --- a/packages/typegen/src/util/derived.ts +++ b/packages/typegen/src/util/derived.ts @@ -31,7 +31,7 @@ export function getSimilarTypes (registry: Registry, definitions: Record = { description: 'Returns information regarding the next epoch (which was already previously announced).', params: [], type: 'Epoch' + }, + submit_report_equivocation_unsigned_extrinsic: { + description: 'Submits an unsigned extrinsic to report an equivocation.', + params: [ + { + name: 'equivocationProof', + type: 'BabeEquivocationProof' + }, + { + name: 'keyOwnerProof', + type: 'OpaqueKeyOwnershipProof' + } + ], + type: 'Option' } - // TODO Add submit_report_equivocation_unsigned_extrinsic }; export const runtime: DefinitionsCall = { diff --git a/packages/types/src/interfaces/benchmark/definitions.ts b/packages/types/src/interfaces/benchmark/definitions.ts new file mode 100644 index 0000000000..31a23d2205 --- /dev/null +++ b/packages/types/src/interfaces/benchmark/definitions.ts @@ -0,0 +1,35 @@ +// 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: { + BenchmarkConfig: { + pallet: 'Bytes', + benchmark: 'Bytes', + selectedComponents: 'Vec<(BenchmarkParameter, u32)>', + verify: 'bool', + internalRepeats: 'u32' + }, + BenchmarkList: { + pallet: 'Bytes', + instance: 'Bytes', + benchmarks: 'Vec' + }, + BenchmarkMetadata: { + name: 'Bytes', + components: 'Vec<(BenchmarkParameter, u32, u32)>' + }, + BenchmarkParameter: { + _enum: ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] + } + } +} as Definitions; diff --git a/packages/types/src/interfaces/benchmark/index.ts b/packages/types/src/interfaces/benchmark/index.ts new file mode 100644 index 0000000000..2d307291c3 --- /dev/null +++ b/packages/types/src/interfaces/benchmark/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/benchmark/runtime.ts b/packages/types/src/interfaces/benchmark/runtime.ts new file mode 100644 index 0000000000..0e636fc520 --- /dev/null +++ b/packages/types/src/interfaces/benchmark/runtime.ts @@ -0,0 +1,34 @@ +// Copyright 2017-2022 @polkadot/types authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import type { DefinitionsCall } from '../../types'; + +export const runtime: DefinitionsCall = { + Benchmark: [ + { + methods: { + benchmark_metadata: { + description: 'Get the benchmark metadata available for this runtime.', + params: [ + { + name: 'extra', + type: 'bool' + } + ], + type: '(Vec, Vec)' + }, + dispatch_benchmark: { + description: 'Dispatch the given benchmark.', + params: [ + { + name: 'config', + type: 'BenchmarkConfig' + } + ], + type: 'Result, Text>' + } + }, + version: 1 + } + ] +}; diff --git a/packages/types/src/interfaces/benchmark/types.ts b/packages/types/src/interfaces/benchmark/types.ts new file mode 100644 index 0000000000..976606ab33 --- /dev/null +++ b/packages/types/src/interfaces/benchmark/types.ts @@ -0,0 +1,60 @@ +// Auto-generated via `yarn polkadot-types-from-defs`, do not edit +/* eslint-disable */ + +import type { Bytes, Enum, Struct, Vec, bool, u32 } from '@polkadot/types-codec'; +import type { ITuple } from '@polkadot/types-codec/types'; + +/** @name BenchmarkConfig */ +export interface BenchmarkConfig extends Struct { + readonly pallet: Bytes; + readonly benchmark: Bytes; + readonly selectedComponents: Vec>; + readonly verify: bool; + readonly internalRepeats: u32; +} + +/** @name BenchmarkList */ +export interface BenchmarkList extends Struct { + readonly pallet: Bytes; + readonly instance: Bytes; + readonly benchmarks: Vec; +} + +/** @name BenchmarkMetadata */ +export interface BenchmarkMetadata extends Struct { + readonly name: Bytes; + readonly components: Vec>; +} + +/** @name BenchmarkParameter */ +export interface BenchmarkParameter extends Enum { + readonly isA: boolean; + readonly isB: boolean; + readonly isC: boolean; + readonly isD: boolean; + readonly isE: boolean; + readonly isF: boolean; + readonly isG: boolean; + readonly isH: boolean; + readonly isI: boolean; + readonly isJ: boolean; + readonly isK: boolean; + readonly isL: boolean; + readonly isM: boolean; + readonly isN: boolean; + readonly isO: boolean; + readonly isP: boolean; + readonly isQ: boolean; + readonly isR: boolean; + readonly isS: boolean; + readonly isT: boolean; + readonly isU: boolean; + readonly isV: boolean; + readonly isW: boolean; + readonly isX: boolean; + readonly isY: boolean; + readonly isZ: boolean; + readonly type: 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' | 'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R' | 'S' | 'T' | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z'; +} + +export type PHANTOM_BENCHMARK = 'benchmark'; diff --git a/packages/types/src/interfaces/blockbuilder/definitions.ts b/packages/types/src/interfaces/blockbuilder/definitions.ts new file mode 100644 index 0000000000..3bb6c12fe0 --- /dev/null +++ b/packages/types/src/interfaces/blockbuilder/definitions.ts @@ -0,0 +1,25 @@ +// 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: { + CheckInherentsResult: { + okay: 'bool', + fatalError: 'bool', + errors: 'InherentData' + }, + InherentData: { + data: 'BTreeMap' + }, + InherentIdentifier: '[u8; 8]' + } +} as Definitions; diff --git a/packages/types/src/interfaces/blockbuilder/index.ts b/packages/types/src/interfaces/blockbuilder/index.ts new file mode 100644 index 0000000000..2d307291c3 --- /dev/null +++ b/packages/types/src/interfaces/blockbuilder/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/blockbuilder/runtime.ts b/packages/types/src/interfaces/blockbuilder/runtime.ts new file mode 100644 index 0000000000..74a8134def --- /dev/null +++ b/packages/types/src/interfaces/blockbuilder/runtime.ts @@ -0,0 +1,53 @@ +// Copyright 2017-2022 @polkadot/types authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import type { DefinitionsCall } from '../../types'; + +export const runtime: DefinitionsCall = { + BlockBuilder: [ + { + methods: { + apply_extrinsic: { + description: 'Apply the given extrinsic.', + params: [ + { + name: 'extrinsic', + type: 'Extrinsic' + } + ], + type: 'ApplyExtrinsicResult' + }, + check_inherents: { + description: 'Check that the inherents are valid.', + params: [ + { + name: 'block', + type: 'Block' + }, + { + name: 'data', + type: 'InherentData' + } + ], + type: 'CheckInherentsResult' + }, + finalize_block: { + description: 'Finish the current block.', + params: [], + type: 'Header' + }, + inherent_extrinsics: { + description: 'Generate inherent extrinsics.', + params: [ + { + name: 'inherent', + type: 'InherentData' + } + ], + type: 'Vec' + } + }, + version: 6 + } + ] +}; diff --git a/packages/types/src/interfaces/blockbuilder/types.ts b/packages/types/src/interfaces/blockbuilder/types.ts new file mode 100644 index 0000000000..7a786eb72a --- /dev/null +++ b/packages/types/src/interfaces/blockbuilder/types.ts @@ -0,0 +1,21 @@ +// Auto-generated via `yarn polkadot-types-from-defs`, do not edit +/* eslint-disable */ + +import type { BTreeMap, Bytes, Struct, U8aFixed, bool } from '@polkadot/types-codec'; + +/** @name CheckInherentsResult */ +export interface CheckInherentsResult extends Struct { + readonly okay: bool; + readonly fatalError: bool; + readonly errors: InherentData; +} + +/** @name InherentData */ +export interface InherentData extends Struct { + readonly data: BTreeMap; +} + +/** @name InherentIdentifier */ +export interface InherentIdentifier extends U8aFixed {} + +export type PHANTOM_BLOCKBUILDER = 'blockbuilder'; diff --git a/packages/types/src/interfaces/definitions.ts b/packages/types/src/interfaces/definitions.ts index ab4d301b35..4c0865584e 100644 --- a/packages/types/src/interfaces/definitions.ts +++ b/packages/types/src/interfaces/definitions.ts @@ -10,6 +10,8 @@ export { default as aura } from './aura/definitions'; export { default as babe } from './babe/definitions'; export { default as balances } from './balances/definitions'; export { default as beefy } from './beefy/definitions'; +export { default as benchmark } from './benchmark/definitions'; +export { default as blockbuilder } from './blockbuilder/definitions'; export { default as collective } from './collective/definitions'; export { default as consensus } from './consensus/definitions'; export { default as contracts } from './contracts/definitions'; @@ -39,6 +41,7 @@ export { default as syncstate } from './syncstate/definitions'; export { default as system } from './system/definitions'; export { default as treasury } from './treasury/definitions'; export { default as txpayment } from './txpayment/definitions'; +export { default as txqueue } from './txqueue/definitions'; export { default as uniques } from './uniques/definitions'; export { default as utility } from './utility/definitions'; export { default as vesting } from './vesting/definitions'; diff --git a/packages/types/src/interfaces/eth/definitions.ts b/packages/types/src/interfaces/eth/definitions.ts index fcd7a30c89..7bbc0c19ae 100644 --- a/packages/types/src/interfaces/eth/definitions.ts +++ b/packages/types/src/interfaces/eth/definitions.ts @@ -11,6 +11,7 @@ import type { DefinitionsTypes } from '../../types'; import { objectSpread } from '@polkadot/util'; import { rpc } from './rpc'; +import { runtime } from './runtime'; const V0: DefinitionsTypes = { BlockV0: { @@ -335,4 +336,4 @@ const types: DefinitionsTypes = objectSpread({}, V0, V1, V2, { } }); -export default { rpc, types }; +export default { rpc, runtime, types }; diff --git a/packages/types/src/interfaces/eth/runtime.ts b/packages/types/src/interfaces/eth/runtime.ts new file mode 100644 index 0000000000..b8bc5305d6 --- /dev/null +++ b/packages/types/src/interfaces/eth/runtime.ts @@ -0,0 +1,175 @@ +// Copyright 2017-2022 @polkadot/types authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import type { DefinitionsCall } from '../../types'; + +export const runtime: DefinitionsCall = { + ConvertTransactionRuntimeApi: [ + { + methods: { + convert_transaction: { + description: 'Converts an Ethereum-style transaction to Extrinsic', + params: [ + { + name: 'transaction', + type: 'TransactionV2' + } + ], + type: 'Extrinsic' + } + }, + version: 2 + } + ], + EthereumRuntimeRPCApi: [ + { + methods: { + account_basic: { + description: 'Returns pallet_evm::Accounts by address.', + params: [ + { + name: 'address', + type: 'H160' + } + ], + type: 'EvmAccount' + }, + account_code_at: { + description: 'For a given account address, returns pallet_evm::AccountCodes.', + params: [ + { + name: 'address', + type: 'H160' + } + ], + type: 'Bytes' + }, + author: { + description: 'Returns the converted FindAuthor::find_author authority id.', + params: [], + type: 'H160' + }, + call: { + description: 'Returns a frame_ethereum::call response. If `estimate` is true,', + params: [ + { + name: 'from', + type: 'H160' + }, + { + name: 'to', + type: 'H160' + }, + { + name: 'data', + type: 'Vec' + }, + { + name: 'value', + type: 'U256' + }, + { + name: 'gasLimit', + type: 'U256' + }, + { + name: 'maxFeePerGas', + type: 'Option' + }, + { + name: 'maxPriorityFeePerGas', + type: 'Option' + }, + { + name: 'nonce', + type: 'Option' + }, + { + name: 'estimate', + type: 'bool' + }, + { + name: 'accessList', + type: 'Option)>>' + } + ], + type: 'Result' + }, + chain_id: { + description: 'Returns runtime defined pallet_evm::ChainId.', + params: [], + type: 'u64' + }, + create: { + description: 'Returns a frame_ethereum::call response. If `estimate` is true,', + params: [ + { + name: 'from', + type: 'H160' + }, + { + name: 'data', + type: 'Vec' + }, + { + name: 'value', + type: 'U256' + }, + { + name: 'gasLimit', + type: 'U256' + }, + { + name: 'maxFeePerGas', + type: 'Option' + }, + { + name: 'maxPriorityFeePerGas', + type: 'Option' + }, + { + name: 'nonce', + type: 'Option' + }, + { + name: 'estimate', + type: 'bool' + }, + { + name: 'accessList', + type: 'Option)>>' + } + ], + type: 'Result' + }, + current_block: { + description: 'Return the current block.', + params: [], + type: 'BlockV2' + }, + gas_price: { + description: 'Returns FixedGasPrice::min_gas_price', + params: [], + type: 'u256' + }, + storage_at: { + description: 'For a given account address and index, returns pallet_evm::AccountStorages.', + params: [ + { + name: 'address', + type: 'H160' + }, + { + name: 'index', + type: 'u256' + } + ], + type: 'H256' + } + }, + version: 4 + // TODO This is _very_ incomplete, missing everything from this point onwards is missing - + // https://github.com/paritytech/frontier/blob/87e60b9b67ab31f4ea7285c949997337bb76ffd0/primitives/rpc/src/lib.rs#L131 + } + ] +}; diff --git a/packages/types/src/interfaces/evm/definitions.ts b/packages/types/src/interfaces/evm/definitions.ts index fea0474009..d93e62eae1 100644 --- a/packages/types/src/interfaces/evm/definitions.ts +++ b/packages/types/src/interfaces/evm/definitions.ts @@ -13,6 +13,18 @@ export default { nonce: 'u256', balance: 'u256' }, + EvmCallInfo: { + exitReason: 'ExitReason', + value: 'Bytes', + usedGas: 'U256', + logs: 'Vec' + }, + EvmCreateInfo: { + exitReason: 'ExitReason', + value: 'H160', + usedGas: 'U256', + logs: 'Vec' + }, EvmLog: { address: 'H160', topics: 'Vec', diff --git a/packages/types/src/interfaces/evm/types.ts b/packages/types/src/interfaces/evm/types.ts index 4c4c52f0de..e612bece94 100644 --- a/packages/types/src/interfaces/evm/types.ts +++ b/packages/types/src/interfaces/evm/types.ts @@ -1,7 +1,7 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import type { Bytes, Enum, Struct, Text, Vec, u256 } from '@polkadot/types-codec'; +import type { Bytes, Enum, Struct, Text, U256, Vec, u256 } from '@polkadot/types-codec'; import type { H160, H256 } from '@polkadot/types/interfaces/runtime'; /** @name EvmAccount */ @@ -10,6 +10,22 @@ export interface EvmAccount extends Struct { readonly balance: u256; } +/** @name EvmCallInfo */ +export interface EvmCallInfo extends Struct { + readonly exitReason: ExitReason; + readonly value: Bytes; + readonly usedGas: U256; + readonly logs: Vec; +} + +/** @name EvmCreateInfo */ +export interface EvmCreateInfo extends Struct { + readonly exitReason: ExitReason; + readonly value: H160; + readonly usedGas: U256; + readonly logs: Vec; +} + /** @name EvmLog */ export interface EvmLog extends Struct { readonly address: H160; diff --git a/packages/types/src/interfaces/grandpa/runtime.ts b/packages/types/src/interfaces/grandpa/runtime.ts index 48d0e2633e..ec400ebe21 100644 --- a/packages/types/src/interfaces/grandpa/runtime.ts +++ b/packages/types/src/interfaces/grandpa/runtime.ts @@ -12,12 +12,39 @@ export const runtime: DefinitionsCall = { params: [], type: 'SetId' }, + generate_key_ownership_proof: { + description: 'Generates a proof of key ownership for the given authority in the given set.', + params: [ + { + name: 'setId', + type: 'SetId' + }, + { + name: 'authorityId', + type: 'AuthorityId' + } + ], + type: 'Option' + }, grandpa_authorities: { description: 'Get the current GRANDPA authorities and weights. This should not change except for when changes are scheduled and the corresponding delay has passed.', params: [], type: 'AuthorityList' + }, + submit_report_equivocation_unsigned_extrinsic: { + description: 'Submits an unsigned extrinsic to report an equivocation.', + params: [ + { + name: 'equivocationProof', + type: 'GrandpaEquivocationProof' + }, + { + name: 'keyOwnerProof', + type: 'OpaqueKeyOwnershipProof' + } + ], + type: 'Option' } - // TODO submit_report_equivocation_unsigned_extrinsic, generate_key_ownership_proof }, version: 3 } diff --git a/packages/types/src/interfaces/mmr/definitions.ts b/packages/types/src/interfaces/mmr/definitions.ts index 44e8148148..83622c28bd 100644 --- a/packages/types/src/interfaces/mmr/definitions.ts +++ b/packages/types/src/interfaces/mmr/definitions.ts @@ -7,19 +7,37 @@ import type { Definitions } from '../../types'; import { rpc } from './rpc'; +import { runtime } from './runtime'; export default { rpc, + runtime, types: { + MmrBatchProof: { + leafIndices: 'Vec', + leafCount: 'MmrNodeIndex', + items: 'Vec' + }, + MmrEncodableOpaqueLeaf: 'Bytes', + MmrError: { + _enum: ['Push', 'GetRoot', 'Commit', 'GenerateProof', 'Verify', 'LeafNotFound', ' PalletNotIncluded', 'InvalidLeafIndex'] + }, MmrLeafBatchProof: { blockHash: 'BlockHash', leaves: 'Bytes', proof: 'Bytes' }, + MmrLeafIndex: 'u64', MmrLeafProof: { blockHash: 'BlockHash', leaf: 'Bytes', proof: 'Bytes' + }, + MmrNodeIndex: 'u64', + MmrProof: { + leafIndex: 'MmrLeafIndex', + leafCount: 'MmrNodeIndex', + items: 'Vec' } } } as Definitions; diff --git a/packages/types/src/interfaces/mmr/runtime.ts b/packages/types/src/interfaces/mmr/runtime.ts new file mode 100644 index 0000000000..b7fb2bf31b --- /dev/null +++ b/packages/types/src/interfaces/mmr/runtime.ts @@ -0,0 +1,103 @@ +// Copyright 2017-2022 @polkadot/types authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import type { DefinitionsCall } from '../../types'; + +export const runtime: DefinitionsCall = { + MmrApi: [ + { + methods: { + generate_batch_proof: { + description: 'Generate MMR proof for a series of leaves under given indices.', + params: [ + { + name: 'leafIndices', + type: 'Vec' + } + ], + type: 'Result<(Vec, MmrBatchProof), MmrError>' + }, + generate_proof: { + description: 'Generate MMR proof for a leaf under given index.', + params: [ + { + name: 'leafIndex', + type: 'MmrLeafIndex' + } + ], + type: 'Result<(MmrEncodableOpaqueLeaf, MmrProof), MmrError>' + }, + mmr_root: { + description: 'Return the on-chain MMR root hash.', + params: [], + type: 'Result' + }, + verify_batch_proof: { + description: 'Verify MMR proof against on-chain MMR for a batch of leaves.', + params: [ + { + name: 'leaves', + type: 'Vec' + }, + { + name: 'proof', + type: 'MmrBatchProof' + } + ], + type: 'Result<(), MmrError>' + }, + verify_batch_proof_stateless: { + description: 'Verify MMR proof against given root hash or a batch of leaves.', + params: [ + { + name: 'root', + type: 'Hash' + }, + { + name: 'leaves', + type: 'Vec' + }, + { + name: 'proof', + type: 'MmrBatchProof' + } + ], + type: 'Result<(), MmrError>' + }, + verify_proof: { + description: 'Verify MMR proof against on-chain MMR.', + params: [ + { + name: 'leaf', + type: 'MmrEncodableOpaqueLeaf' + }, + { + name: 'proof', + type: 'MmrProof' + } + ], + type: 'Result<(), MmrError>' + }, + verify_proof_stateless: { + description: 'Verify MMR proof against given root hash.', + params: [ + { + name: 'root', + type: 'Hash' + }, + { + name: 'leaf', + type: 'MmrEncodableOpaqueLeaf' + }, + { + name: 'proof', + type: 'MmrProof' + } + ], + type: 'Result<(), MmrError>' + } + }, + version: 1 + } + ] +}; diff --git a/packages/types/src/interfaces/mmr/types.ts b/packages/types/src/interfaces/mmr/types.ts index 1e072a31b7..27dbec51d6 100644 --- a/packages/types/src/interfaces/mmr/types.ts +++ b/packages/types/src/interfaces/mmr/types.ts @@ -1,8 +1,32 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import type { Bytes, Struct } from '@polkadot/types-codec'; +import type { Bytes, Enum, Struct, Vec, u64 } from '@polkadot/types-codec'; import type { BlockHash } from '@polkadot/types/interfaces/chain'; +import type { Hash } from '@polkadot/types/interfaces/runtime'; + +/** @name MmrBatchProof */ +export interface MmrBatchProof extends Struct { + readonly leafIndices: Vec; + readonly leafCount: MmrNodeIndex; + readonly items: Vec; +} + +/** @name MmrEncodableOpaqueLeaf */ +export interface MmrEncodableOpaqueLeaf extends Bytes {} + +/** @name MmrError */ +export interface MmrError extends Enum { + readonly isPush: boolean; + readonly isGetRoot: boolean; + readonly isCommit: boolean; + readonly isGenerateProof: boolean; + readonly isVerify: boolean; + readonly isLeafNotFound: boolean; + readonly isPalletNotIncluded: boolean; + readonly isInvalidLeafIndex: boolean; + readonly type: 'Push' | 'GetRoot' | 'Commit' | 'GenerateProof' | 'Verify' | 'LeafNotFound' | 'PalletNotIncluded' | 'InvalidLeafIndex'; +} /** @name MmrLeafBatchProof */ export interface MmrLeafBatchProof extends Struct { @@ -11,6 +35,9 @@ export interface MmrLeafBatchProof extends Struct { readonly proof: Bytes; } +/** @name MmrLeafIndex */ +export interface MmrLeafIndex extends u64 {} + /** @name MmrLeafProof */ export interface MmrLeafProof extends Struct { readonly blockHash: BlockHash; @@ -18,4 +45,14 @@ export interface MmrLeafProof extends Struct { readonly proof: Bytes; } +/** @name MmrNodeIndex */ +export interface MmrNodeIndex extends u64 {} + +/** @name MmrProof */ +export interface MmrProof extends Struct { + readonly leafIndex: MmrLeafIndex; + readonly leafCount: MmrNodeIndex; + readonly items: Vec; +} + export type PHANTOM_MMR = 'mmr'; diff --git a/packages/types/src/interfaces/offchain/definitions.ts b/packages/types/src/interfaces/offchain/definitions.ts index 5bdec52dfa..f6565c80e2 100644 --- a/packages/types/src/interfaces/offchain/definitions.ts +++ b/packages/types/src/interfaces/offchain/definitions.ts @@ -7,9 +7,11 @@ import type { Definitions } from '../../types'; import { rpc } from './rpc'; +import { runtime } from './runtime'; export default { rpc, + runtime, types: { StorageKind: { _enum: { diff --git a/packages/types/src/interfaces/offchain/runtime.ts b/packages/types/src/interfaces/offchain/runtime.ts new file mode 100644 index 0000000000..b089bf93e5 --- /dev/null +++ b/packages/types/src/interfaces/offchain/runtime.ts @@ -0,0 +1,24 @@ +// Copyright 2017-2022 @polkadot/types authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import type { DefinitionsCall } from '../../types'; + +export const runtime: DefinitionsCall = { + OffchainWorkerApi: [ + { + methods: { + offchain_worker: { + description: 'Starts the off-chain task for given block header.', + params: [ + { + name: 'header', + type: 'Header' + } + ], + type: 'Null' + } + }, + version: 2 + } + ] +}; diff --git a/packages/types/src/interfaces/payment/runtime.ts b/packages/types/src/interfaces/payment/runtime.ts index d8498907db..0fe306cfcb 100644 --- a/packages/types/src/interfaces/payment/runtime.ts +++ b/packages/types/src/interfaces/payment/runtime.ts @@ -12,7 +12,7 @@ export const runtime: DefinitionsCall = { params: [ { name: 'uxt', - type: 'Bytes' + type: 'Extrinsic' }, { name: 'len', @@ -26,7 +26,7 @@ export const runtime: DefinitionsCall = { params: [ { name: 'uxt', - type: 'Bytes' + type: 'Extrinsic' }, { name: 'len', diff --git a/packages/types/src/interfaces/runtime/definitions.ts b/packages/types/src/interfaces/runtime/definitions.ts index 90c5a8d4e4..fba5e68a57 100644 --- a/packages/types/src/interfaces/runtime/definitions.ts +++ b/packages/types/src/interfaces/runtime/definitions.ts @@ -183,10 +183,19 @@ export default { Slot: 'u64', SlotDuration: 'u64', StorageData: 'Bytes', + StorageInfo: { + palletName: 'Bytes', + storage_name: 'Bytes', + prefix: 'Bytes', + maxValues: 'Option', + maxSize: 'Option' + }, StorageProof: { trieNodes: 'Vec' }, TransactionPriority: 'u64', + TransactionLongevity: 'u64', + TransactionTag: 'Bytes', TransactionInfo: { _alias: { dataSize: 'size' diff --git a/packages/types/src/interfaces/runtime/runtime.ts b/packages/types/src/interfaces/runtime/runtime.ts index 4d015430f8..aac58a5c9d 100644 --- a/packages/types/src/interfaces/runtime/runtime.ts +++ b/packages/types/src/interfaces/runtime/runtime.ts @@ -7,6 +7,26 @@ export const runtime: DefinitionsCall = { Core: [ { methods: { + execute_block: { + description: 'Execute the given block.', + params: [ + { + name: 'block', + type: 'Block' + } + ], + type: 'Null' + }, + initialize_block: { + description: 'Initialize a block with the given header.', + params: [ + { + name: 'header', + type: 'Header' + } + ], + type: 'Null' + }, version: { description: 'Returns the version of the runtime.', params: [], @@ -14,7 +34,28 @@ export const runtime: DefinitionsCall = { } }, version: 4 - // TODO Add execute_block & initialize_block + } + ], + TryRuntime: [ + { + methods: { + execute_block_no_check: { + description: "Execute the given block, but don't check that its state root matches that of yours.", + params: [ + { + name: 'block', + type: 'Block' + } + ], + type: 'Weight' + }, + on_runtime_upgrade: { + description: 'dry-run runtime upgrades, returning the total weight consumed.', + params: [], + type: '(Weight, Weight)' + } + }, + version: 1 } ] }; diff --git a/packages/types/src/interfaces/runtime/types.ts b/packages/types/src/interfaces/runtime/types.ts index 167aadab5f..6996860f01 100644 --- a/packages/types/src/interfaces/runtime/types.ts +++ b/packages/types/src/interfaces/runtime/types.ts @@ -339,6 +339,15 @@ export interface SlotDuration extends u64 {} /** @name StorageData */ export interface StorageData extends Bytes {} +/** @name StorageInfo */ +export interface StorageInfo extends Struct { + readonly palletName: Bytes; + readonly storage_name: Bytes; + readonly prefix: Bytes; + readonly maxValues: Option; + readonly maxSize: Option; +} + /** @name StorageProof */ export interface StorageProof extends Struct { readonly trieNodes: Vec; @@ -352,6 +361,9 @@ export interface TransactionInfo extends Struct { readonly blockChunks: u32; } +/** @name TransactionLongevity */ +export interface TransactionLongevity extends u64 {} + /** @name TransactionPriority */ export interface TransactionPriority extends u64 {} @@ -361,6 +373,9 @@ export interface TransactionStorageProof extends Struct { readonly proof: Vec; } +/** @name TransactionTag */ +export interface TransactionTag extends Bytes {} + /** @name U32F32 */ export interface U32F32 extends UInt {} diff --git a/packages/types/src/interfaces/system/definitions.ts b/packages/types/src/interfaces/system/definitions.ts index 046c3c6367..505235ff9b 100644 --- a/packages/types/src/interfaces/system/definitions.ts +++ b/packages/types/src/interfaces/system/definitions.ts @@ -141,7 +141,8 @@ export default { ExhaustsResources: 'Null', Custom: 'u8', BadMandatory: 'Null', - MandatoryDispatch: 'Null' + MandatoryDispatch: 'Null', + BadSigner: 'Null' } }, Key: 'Bytes', diff --git a/packages/types/src/interfaces/system/types.ts b/packages/types/src/interfaces/system/types.ts index 9406642f62..e4ca77492f 100644 --- a/packages/types/src/interfaces/system/types.ts +++ b/packages/types/src/interfaces/system/types.ts @@ -238,7 +238,8 @@ export interface InvalidTransaction extends Enum { readonly asCustom: u8; readonly isBadMandatory: boolean; readonly isMandatoryDispatch: boolean; - readonly type: 'Call' | 'Payment' | 'Future' | 'Stale' | 'BadProof' | 'AncientBirthBlock' | 'ExhaustsResources' | 'Custom' | 'BadMandatory' | 'MandatoryDispatch'; + readonly isBadSigner: boolean; + readonly type: 'Call' | 'Payment' | 'Future' | 'Stale' | 'BadProof' | 'AncientBirthBlock' | 'ExhaustsResources' | 'Custom' | 'BadMandatory' | 'MandatoryDispatch' | 'BadSigner'; } /** @name Key */ diff --git a/packages/types/src/interfaces/txqueue/definitions.ts b/packages/types/src/interfaces/txqueue/definitions.ts new file mode 100644 index 0000000000..1fceb6d416 --- /dev/null +++ b/packages/types/src/interfaces/txqueue/definitions.ts @@ -0,0 +1,27 @@ +// 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: { + TransactionSource: { + _enum: ['InBlock', 'Local', 'External'] + }, + TransactionValidity: 'Result', + ValidTransaction: { + priority: 'TransactionPriority', + requires: 'Vec', + provides: 'Vec', + longevity: 'TransactionLongevity', + propagate: 'bool' + } + } +} as Definitions; diff --git a/packages/types/src/interfaces/txqueue/index.ts b/packages/types/src/interfaces/txqueue/index.ts new file mode 100644 index 0000000000..2d307291c3 --- /dev/null +++ b/packages/types/src/interfaces/txqueue/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/txqueue/runtime.ts b/packages/types/src/interfaces/txqueue/runtime.ts new file mode 100644 index 0000000000..b466bbf34d --- /dev/null +++ b/packages/types/src/interfaces/txqueue/runtime.ts @@ -0,0 +1,32 @@ +// Copyright 2017-2022 @polkadot/types authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import type { DefinitionsCall } from '../../types'; + +export const runtime: DefinitionsCall = { + TaggedTransactionQueue: [ + { + methods: { + validate_transaction: { + description: 'Validate the transaction.', + params: [ + { + name: 'source', + type: 'TransactionSource' + }, + { + name: 'tx', + type: 'Extrinsic' + }, + { + name: 'blockHash', + type: 'BlockHash' + } + ], + type: 'TransactionValidity' + } + }, + version: 3 + } + ] +}; diff --git a/packages/types/src/interfaces/txqueue/types.ts b/packages/types/src/interfaces/txqueue/types.ts new file mode 100644 index 0000000000..652c2b712b --- /dev/null +++ b/packages/types/src/interfaces/txqueue/types.ts @@ -0,0 +1,37 @@ +// Auto-generated via `yarn polkadot-types-from-defs`, do not edit +/* eslint-disable */ + +import type { Enum, Result, Struct, Vec, bool } from '@polkadot/types-codec'; +import type { TransactionLongevity, TransactionPriority, TransactionTag } from '@polkadot/types/interfaces/runtime'; +import type { TransactionValidityError } from '@polkadot/types/interfaces/system'; + +/** @name TransactionSource */ +export interface TransactionSource extends Enum { + readonly isInBlock: boolean; + readonly isLocal: boolean; + readonly isExternal: boolean; + readonly type: 'InBlock' | 'Local' | 'External'; +} + +/** @name TransactionValidity */ +export interface TransactionValidity extends Result { + readonly isErr: boolean; + readonly asErr: TransactionValidityError; + /** @deprecated Use isErr */ + readonly isError: boolean; + /** @deprecated Use asErr */ + readonly asError: TransactionValidityError; + readonly isOk: boolean; + readonly asOk: ValidTransaction; +} + +/** @name ValidTransaction */ +export interface ValidTransaction extends Struct { + readonly priority: TransactionPriority; + readonly requires: Vec; + readonly provides: Vec; + readonly longevity: TransactionLongevity; + readonly propagate: bool; +} + +export type PHANTOM_TXQUEUE = 'txqueue'; diff --git a/packages/types/src/interfaces/types.ts b/packages/types/src/interfaces/types.ts index 1947b9ca68..ff77c3ab56 100644 --- a/packages/types/src/interfaces/types.ts +++ b/packages/types/src/interfaces/types.ts @@ -9,6 +9,8 @@ export * from './authorship/types'; export * from './babe/types'; export * from './balances/types'; export * from './beefy/types'; +export * from './benchmark/types'; +export * from './blockbuilder/types'; export * from './bridges/types'; export * from './chain/types'; export * from './childstate/types'; @@ -54,6 +56,7 @@ export * from './syncstate/types'; export * from './system/types'; export * from './treasury/types'; export * from './txpayment/types'; +export * from './txqueue/types'; export * from './uniques/types'; export * from './utility/types'; export * from './vesting/types'; diff --git a/packages/types/src/types/definitions.ts b/packages/types/src/types/definitions.ts index 670dc0d7d1..88f56cc915 100644 --- a/packages/types/src/types/definitions.ts +++ b/packages/types/src/types/definitions.ts @@ -61,10 +61,12 @@ export interface DefinitionRpcSub extends DefinitionRpc { export type DefinitionsRpc = Record; -export type DefinitionsCall = Record; version: number; -}[]>; +} + +export type DefinitionsCall = Record; export interface DefinitionCallNamed extends DefinitionCall { method: string;