Adjust runtime decoration & typegen (#4996)
This commit is contained in:
@@ -2,8 +2,7 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
import type { Observable } from 'rxjs';
|
import type { Observable } from 'rxjs';
|
||||||
import type { AnyFunction, Codec, DefinitionCall } from '@polkadot/types/types';
|
import type { AnyFunction, Codec, DefinitionCallNamed } from '@polkadot/types/types';
|
||||||
import type { HexString } from '@polkadot/util/types';
|
|
||||||
import type { ApiTypes, ReturnCodec } from './base';
|
import type { ApiTypes, ReturnCodec } from './base';
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/no-empty-interface
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/no-empty-interface
|
||||||
@@ -28,11 +27,3 @@ export type DecoratedCallBase<ApiType extends ApiTypes, F extends AnyFunction =
|
|||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
export type AugmentedCall<ApiType extends ApiTypes, F extends AnyFunction = (...args: any[]) => Observable<Codec>> =
|
export type AugmentedCall<ApiType extends ApiTypes, F extends AnyFunction = (...args: any[]) => Observable<Codec>> =
|
||||||
DecoratedCallBase<ApiType, F> & { meta: DefinitionCallNamed };
|
DecoratedCallBase<ApiType, F> & { meta: DefinitionCallNamed };
|
||||||
|
|
||||||
export interface DefinitionCallNamed extends DefinitionCall {
|
|
||||||
method: string;
|
|
||||||
name: string;
|
|
||||||
section: string;
|
|
||||||
sectionHash: HexString;
|
|
||||||
version: number;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -2,13 +2,13 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
import type { Observable } from 'rxjs';
|
import type { Observable } from 'rxjs';
|
||||||
import type { AugmentedCall, DefinitionCallNamed, DeriveCustom, QueryableCalls } from '@polkadot/api-base/types';
|
import type { AugmentedCall, DeriveCustom, QueryableCalls } from '@polkadot/api-base/types';
|
||||||
import type { RpcInterface } from '@polkadot/rpc-core/types';
|
import type { RpcInterface } from '@polkadot/rpc-core/types';
|
||||||
import type { Option, Raw, StorageKey, Text, u64 } from '@polkadot/types';
|
import type { Option, Raw, StorageKey, Text, u64 } from '@polkadot/types';
|
||||||
import type { Call, Hash, RuntimeVersion } from '@polkadot/types/interfaces';
|
import type { Call, Hash, RuntimeVersion } from '@polkadot/types/interfaces';
|
||||||
import type { DecoratedMeta } from '@polkadot/types/metadata/decorate/types';
|
import type { DecoratedMeta } from '@polkadot/types/metadata/decorate/types';
|
||||||
import type { StorageEntry } from '@polkadot/types/primitive/types';
|
import type { StorageEntry } from '@polkadot/types/primitive/types';
|
||||||
import type { AnyFunction, AnyTuple, CallFunction, Codec, DefinitionRpc, DefinitionRpcSub, Definitions, DefinitionsCall, DetectCodec, IMethod, IStorageKey, Registry, RegistryError, RegistryTypes } from '@polkadot/types/types';
|
import type { AnyFunction, AnyTuple, CallFunction, Codec, DefinitionCallNamed, DefinitionRpc, DefinitionRpcSub, Definitions, DefinitionsCall, DetectCodec, IMethod, IStorageKey, Registry, RegistryError, RegistryTypes } from '@polkadot/types/types';
|
||||||
import type { HexString } from '@polkadot/util/types';
|
import type { HexString } from '@polkadot/util/types';
|
||||||
import type { SubmittableExtrinsic } from '../submittable/types';
|
import type { SubmittableExtrinsic } from '../submittable/types';
|
||||||
import type { ApiDecoration, ApiInterfaceRx, ApiOptions, ApiTypes, AugmentedQuery, DecoratedErrors, DecoratedEvents, DecoratedRpc, DecorateMethod, GenericStorageEntryFunction, PaginationOptions, QueryableConsts, QueryableStorage, QueryableStorageEntry, QueryableStorageEntryAt, QueryableStorageMulti, QueryableStorageMultiArg, SubmittableExtrinsicFunction, SubmittableExtrinsics } from '../types';
|
import type { ApiDecoration, ApiInterfaceRx, ApiOptions, ApiTypes, AugmentedQuery, DecoratedErrors, DecoratedEvents, DecoratedRpc, DecorateMethod, GenericStorageEntryFunction, PaginationOptions, QueryableConsts, QueryableStorage, QueryableStorageEntry, QueryableStorageEntryAt, QueryableStorageMulti, QueryableStorageMultiArg, SubmittableExtrinsicFunction, SubmittableExtrinsics } from '../types';
|
||||||
|
|||||||
@@ -35,7 +35,6 @@
|
|||||||
"@babel/runtime": "^7.18.3",
|
"@babel/runtime": "^7.18.3",
|
||||||
"@polkadot/api": "8.10.2-4-x",
|
"@polkadot/api": "8.10.2-4-x",
|
||||||
"@polkadot/api-augment": "8.10.2-4-x",
|
"@polkadot/api-augment": "8.10.2-4-x",
|
||||||
"@polkadot/api-base": "8.10.2-4-x",
|
|
||||||
"@polkadot/rpc-augment": "8.10.2-4-x",
|
"@polkadot/rpc-augment": "8.10.2-4-x",
|
||||||
"@polkadot/rpc-provider": "8.10.2-4-x",
|
"@polkadot/rpc-provider": "8.10.2-4-x",
|
||||||
"@polkadot/types": "8.10.2-4-x",
|
"@polkadot/types": "8.10.2-4-x",
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
// Copyright 2017-2022 @polkadot/typegen authors & contributors
|
// Copyright 2017-2022 @polkadot/typegen authors & contributors
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
import type { DefinitionCallNamed } from '@polkadot/api-base/types';
|
|
||||||
import type { TypeRegistry } from '@polkadot/types/create';
|
import type { TypeRegistry } from '@polkadot/types/create';
|
||||||
import type { Definitions } from '@polkadot/types/types';
|
import type { DefinitionCallNamed, Definitions } from '@polkadot/types/types';
|
||||||
import type { HexString } from '@polkadot/util/types';
|
import type { HexString } from '@polkadot/util/types';
|
||||||
import type { ExtraTypes } from './types';
|
import type { ExtraTypes } from './types';
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
"references": [
|
"references": [
|
||||||
{ "path": "../api/tsconfig.build.json" },
|
{ "path": "../api/tsconfig.build.json" },
|
||||||
{ "path": "../api-augment/tsconfig.build.json" },
|
{ "path": "../api-augment/tsconfig.build.json" },
|
||||||
{ "path": "../api-base/tsconfig.build.json" },
|
|
||||||
{ "path": "../rpc-augment/tsconfig.build.json" },
|
{ "path": "../rpc-augment/tsconfig.build.json" },
|
||||||
{ "path": "../rpc-provider/tsconfig.build.json" },
|
{ "path": "../rpc-provider/tsconfig.build.json" },
|
||||||
{ "path": "../types/tsconfig.build.json" },
|
{ "path": "../types/tsconfig.build.json" },
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
// Copyright 2017-2022 @polkadot/types authors & contributors
|
// Copyright 2017-2022 @polkadot/types authors & contributors
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
import type { HexString } from '@polkadot/util/types';
|
||||||
|
|
||||||
export type DefinitionTypeType = string;
|
export type DefinitionTypeType = string;
|
||||||
|
|
||||||
export type DefinitionTypeEnum = { _fallback?: DefinitionTypeType } & ({ _enum: DefinitionTypeType[] } | { _enum: Record<string, DefinitionTypeType | null> });
|
export type DefinitionTypeEnum = { _fallback?: DefinitionTypeType } & ({ _enum: DefinitionTypeType[] } | { _enum: Record<string, DefinitionTypeType | null> });
|
||||||
@@ -64,6 +66,14 @@ export type DefinitionsCall = Record<string, {
|
|||||||
version: number;
|
version: number;
|
||||||
}[]>;
|
}[]>;
|
||||||
|
|
||||||
|
export interface DefinitionCallNamed extends DefinitionCall {
|
||||||
|
method: string;
|
||||||
|
name: string;
|
||||||
|
section: string;
|
||||||
|
sectionHash: HexString;
|
||||||
|
version: number;
|
||||||
|
}
|
||||||
|
|
||||||
export type DefinitionsTypes = Record<string, DefinitionType>;
|
export type DefinitionsTypes = Record<string, DefinitionType>;
|
||||||
|
|
||||||
export interface Definitions {
|
export interface Definitions {
|
||||||
|
|||||||
@@ -2213,7 +2213,6 @@ __metadata:
|
|||||||
"@babel/runtime": ^7.18.3
|
"@babel/runtime": ^7.18.3
|
||||||
"@polkadot/api": 8.10.2-4-x
|
"@polkadot/api": 8.10.2-4-x
|
||||||
"@polkadot/api-augment": 8.10.2-4-x
|
"@polkadot/api-augment": 8.10.2-4-x
|
||||||
"@polkadot/api-base": 8.10.2-4-x
|
|
||||||
"@polkadot/rpc-augment": 8.10.2-4-x
|
"@polkadot/rpc-augment": 8.10.2-4-x
|
||||||
"@polkadot/rpc-provider": 8.10.2-4-x
|
"@polkadot/rpc-provider": 8.10.2-4-x
|
||||||
"@polkadot/types": 8.10.2-4-x
|
"@polkadot/types": 8.10.2-4-x
|
||||||
|
|||||||
Reference in New Issue
Block a user