diff --git a/package.json b/package.json index a2197ad5cb65..4c47df908b6f 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "test:one": "polkadot-dev-run-test --env node" }, "devDependencies": { - "@polkadot/dev": "^0.72.39", + "@polkadot/dev": "^0.72.42", "@polkadot/typegen": "workspace:packages/typegen", "@types/node": "^18.15.11" }, diff --git a/packages/api-base/src/types/api.ts b/packages/api-base/src/types/api.ts index 8b0d810469f2..1f8d858c9553 100644 --- a/packages/api-base/src/types/api.ts +++ b/packages/api-base/src/types/api.ts @@ -13,7 +13,7 @@ export interface ApiInterfaceRx { call: QueryableCalls<'rxjs'>; consts: QueryableConsts<'rxjs'>; extrinsicType: number; - genesisHash?: Hash; + genesisHash?: Hash | undefined; hasSubscriptions: boolean; registry: Registry; runtimeMetadata: Metadata; @@ -22,7 +22,7 @@ export interface ApiInterfaceRx { queryMulti: QueryableStorageMulti<'rxjs'>; rpc: DecoratedRpc<'rxjs', RpcInterface>; tx: SubmittableExtrinsics<'rxjs'>; - signer?: Signer; + signer?: Signer | undefined; callAt: (blockHash: Uint8Array | string, knownVersion?: RuntimeVersion) => Observable>; queryAt: (blockHash: Uint8Array | string, knownVersion?: RuntimeVersion) => Observable>; diff --git a/packages/api-base/src/types/submittable.ts b/packages/api-base/src/types/submittable.ts index 64c421db5a8a..8e61bca48a1c 100644 --- a/packages/api-base/src/types/submittable.ts +++ b/packages/api-base/src/types/submittable.ts @@ -40,13 +40,13 @@ export type SubmittablePaymentResult = : Promise; export interface SubmittableResultValue { - dispatchError?: DispatchError; - dispatchInfo?: DispatchInfo; + dispatchError?: DispatchError | undefined; + dispatchInfo?: DispatchInfo | undefined; events?: EventRecord[]; - internalError?: Error; + internalError?: Error | undefined; status: ExtrinsicStatus; txHash: Hash; - txIndex?: number; + txIndex?: number | undefined; blockNumber?: BlockNumber; } diff --git a/packages/api-contract/src/base/Blueprint.ts b/packages/api-contract/src/base/Blueprint.ts index cdd4fb80c01c..170c3b2aea98 100644 --- a/packages/api-contract/src/base/Blueprint.ts +++ b/packages/api-contract/src/base/Blueprint.ts @@ -23,7 +23,7 @@ export interface BlueprintConstructor { } export class BlueprintSubmittableResult extends SubmittableResult { - readonly contract?: Contract; + readonly contract?: Contract | undefined; constructor (result: ISubmittableResult, contract?: Contract) { super(result); diff --git a/packages/api-contract/src/base/Code.ts b/packages/api-contract/src/base/Code.ts index 171e2864ec6c..b41094e03e4c 100644 --- a/packages/api-contract/src/base/Code.ts +++ b/packages/api-contract/src/base/Code.ts @@ -25,10 +25,10 @@ export interface CodeConstructor { } export class CodeSubmittableResult extends SubmittableResult { - readonly blueprint?: Blueprint; - readonly contract?: Contract; + readonly blueprint?: Blueprint | undefined; + readonly contract?: Contract | undefined; - constructor (result: ISubmittableResult, blueprint?: Blueprint, contract?: Contract) { + constructor (result: ISubmittableResult, blueprint?: Blueprint | undefined, contract?: Contract | undefined) { super(result); this.blueprint = blueprint; @@ -77,14 +77,14 @@ export class Code extends Base { encodeSalt(salt) ).withResultTransform((result: ISubmittableResult) => new CodeSubmittableResult(result, ...(applyOnEvent(result, ['CodeStored', 'Instantiated'], (records: EventRecord[]) => - records.reduce<[Blueprint?, Contract?]>(([blueprint, contract], { event }) => + records.reduce<[Blueprint | undefined, Contract | undefined]>(([blueprint, contract], { event }) => this.api.events.contracts.Instantiated.is(event) ? [blueprint, new Contract(this.api, this.abi, (event as unknown as { data: [Codec, AccountId] }).data[1], this._decorateMethod)] : this.api.events.contracts.CodeStored.is(event) ? [new Blueprint(this.api, this.abi, (event as unknown as { data: [AccountId] }).data[0], this._decorateMethod), contract] : [blueprint, contract], - []) - ) || [])) + [undefined, undefined]) + ) || [undefined, undefined])) ); }; } diff --git a/packages/api-contract/src/base/Contract.ts b/packages/api-contract/src/base/Contract.ts index 48580dc54ad3..ad2bc5d32537 100644 --- a/packages/api-contract/src/base/Contract.ts +++ b/packages/api-contract/src/base/Contract.ts @@ -42,7 +42,7 @@ function createTx (meta: AbiMessage, fn: (options: Co } export class ContractSubmittableResult extends SubmittableResult { - readonly contractEvents?: DecodedEvent[]; + readonly contractEvents?: DecodedEvent[] | undefined; constructor (result: ISubmittableResult, contractEvents?: DecodedEvent[]) { super(result); diff --git a/packages/api-contract/src/types.ts b/packages/api-contract/src/types.ts index 8dde40023f47..25d2a4392777 100644 --- a/packages/api-contract/src/types.ts +++ b/packages/api-contract/src/types.ts @@ -86,6 +86,6 @@ export interface WeightAll { v1Weight: BN; v2Weight: { refTime: BN; - proofSize?: BN; + proofSize?: BN | undefined; }; } diff --git a/packages/api-derive/src/accounts/info.ts b/packages/api-derive/src/accounts/info.ts index 4bd40252af1f..93cfb65e2fc1 100644 --- a/packages/api-derive/src/accounts/info.ts +++ b/packages/api-derive/src/accounts/info.ts @@ -34,7 +34,7 @@ function retrieveNick (api: DeriveApi, accountId?: AccountId): Observable Observable { return memo(instanceId, (address?: AccountIndex | AccountId | Address | Uint8Array | string | null): Observable => api.derive.accounts.idAndIndex(address).pipe( - switchMap(([accountId, accountIndex]): Observable<[Partial, DeriveAccountRegistration, string?]> => + switchMap(([accountId, accountIndex]): Observable<[Partial, DeriveAccountRegistration, string | undefined]> => combineLatest([ of({ accountId, accountIndex }), api.derive.accounts.identity(accountId), diff --git a/packages/api-derive/src/accounts/types.ts b/packages/api-derive/src/accounts/types.ts index 6403b4296b4c..5edbb514c79d 100644 --- a/packages/api-derive/src/accounts/types.ts +++ b/packages/api-derive/src/accounts/types.ts @@ -3,22 +3,22 @@ import type { AccountId, AccountIndex, RegistrationJudgement } from '@polkadot/types/interfaces'; -export type AccountIdAndIndex = [AccountId?, AccountIndex?]; +export type AccountIdAndIndex = [AccountId | undefined, AccountIndex | undefined]; export type AccountIndexes = Record; export interface DeriveAccountRegistration { - display?: string; - displayParent?: string; - email?: string; - image?: string; - legal?: string; - other?: Record; - parent?: AccountId; - pgp?: string; - riot?: string; - twitter?: string; - web?: string; + display?: string | undefined; + displayParent?: string | undefined; + email?: string | undefined; + image?: string | undefined; + legal?: string | undefined; + other?: Record | undefined; + parent?: AccountId | undefined; + pgp?: string | undefined; + riot?: string | undefined; + twitter?: string | undefined; + web?: string | undefined; judgements: RegistrationJudgement[]; } @@ -30,14 +30,14 @@ export interface DeriveAccountFlags { } export interface DeriveAccountInfo { - accountId?: AccountId; - accountIndex?: AccountIndex; + accountId?: AccountId | undefined; + accountIndex?: AccountIndex | undefined; identity: DeriveAccountRegistration; - nickname?: string; + nickname?: string | undefined; } export interface DeriveHasIdentity { - display?: string; + display?: string | undefined; hasIdentity: boolean; - parentId?: string; + parentId?: string | undefined; } diff --git a/packages/api-derive/src/democracy/types.ts b/packages/api-derive/src/democracy/types.ts index 1417b213661d..5195e727fc2d 100644 --- a/packages/api-derive/src/democracy/types.ts +++ b/packages/api-derive/src/democracy/types.ts @@ -23,7 +23,7 @@ export interface DeriveDemocracyLock { export interface DeriveProposalImage extends AtBlock { balance: Balance; - proposal?: Call; + proposal?: Call | undefined; proposalHash?: HexString; proposalLen?: number; proposer: AccountId; @@ -32,27 +32,27 @@ export interface DeriveProposalImage extends AtBlock { export interface DeriveDispatch extends AtBlock { index: ReferendumIndex; imageHash: HexString; - image?: DeriveProposalImage; + image?: DeriveProposalImage | undefined; } export interface DeriveProposal { balance?: Balance; index: PropIndex; - image?: DeriveProposalImage; + image?: DeriveProposalImage | undefined; imageHash: Hash; proposer: AccountId; seconds: Vec; } export interface DeriveProposalExternal { - image?: DeriveProposalImage; + image?: DeriveProposalImage | undefined; imageHash: HexString; threshold: PalletDemocracyVoteThreshold; } export interface DeriveReferendum { index: ReferendumIndex; - image?: DeriveProposalImage; + image?: DeriveProposalImage | undefined; imageHash: HexString; status: PalletDemocracyReferendumStatus | ReferendumInfoTo239; } diff --git a/packages/api-derive/src/society/types.ts b/packages/api-derive/src/society/types.ts index e72517392d21..a7ae56fbc044 100644 --- a/packages/api-derive/src/society/types.ts +++ b/packages/api-derive/src/society/types.ts @@ -7,10 +7,10 @@ import type { PalletSocietyBid, PalletSocietyBidKind, PalletSocietyVote, PalletS export interface DeriveSociety { bids: PalletSocietyBid[]; - defender?: AccountId; + defender?: AccountId | undefined; hasDefender: boolean; - head?: AccountId; - founder?: AccountId; + head?: AccountId | undefined; + founder?: AccountId | undefined; maxMembers: u32; pot: BalanceOf; } @@ -28,6 +28,6 @@ export interface DeriveSocietyMember { isSuspended: boolean; payouts: [BlockNumber, Balance][]; strikes: StrikeCount; - vote?: PalletSocietyVote; - vouching?: PalletSocietyVouchingStatus; + vote?: PalletSocietyVote | undefined; + vouching?: PalletSocietyVouchingStatus | undefined; } diff --git a/packages/api-derive/src/type/HeaderExtended.ts b/packages/api-derive/src/type/HeaderExtended.ts index bcc707666c3e..12f1b147e034 100644 --- a/packages/api-derive/src/type/HeaderExtended.ts +++ b/packages/api-derive/src/type/HeaderExtended.ts @@ -12,7 +12,7 @@ export function createHeaderExtended (registry: Registry, header?: Header, valid const HeaderBase = registry.createClass('Header'); class Implementation extends HeaderBase implements HeaderExtended { - readonly #author?: AccountId; + readonly #author?: AccountId | undefined; constructor (registry: Registry, header?: Header, validators?: AccountId[] | null, author?: AccountId | null) { super(registry, header); diff --git a/packages/api-derive/src/type/SignedBlockExtended.ts b/packages/api-derive/src/type/SignedBlockExtended.ts index 721d3a8fa3aa..a41275febd7a 100644 --- a/packages/api-derive/src/type/SignedBlockExtended.ts +++ b/packages/api-derive/src/type/SignedBlockExtended.ts @@ -36,7 +36,7 @@ export function createSignedBlockExtended (registry: Registry, block?: SignedBlo const SignedBlockBase = registry.createClass('SignedBlock'); class Implementation extends SignedBlockBase implements SignedBlockExtended { - readonly #author?: AccountId; + readonly #author?: AccountId | undefined; readonly #events: EventRecord[]; readonly #extrinsics: TxWithEvent[]; diff --git a/packages/api-derive/src/type/types.ts b/packages/api-derive/src/type/types.ts index 7a05ba244bbe..3b2c86417524 100644 --- a/packages/api-derive/src/type/types.ts +++ b/packages/api-derive/src/type/types.ts @@ -14,8 +14,8 @@ export interface SignedBlockExtended extends SignedBlock { } export interface TxWithEvent { - dispatchError?: DispatchError; - dispatchInfo?: DispatchInfo; + dispatchError?: DispatchError | undefined; + dispatchInfo?: DispatchInfo | undefined; events: Event[]; extrinsic: Extrinsic; } diff --git a/packages/api/src/base/Decorate.ts b/packages/api/src/base/Decorate.ts index 0248eec837d8..747a8447b6c7 100644 --- a/packages/api/src/base/Decorate.ts +++ b/packages/api/src/base/Decorate.ts @@ -41,7 +41,7 @@ interface MetaDecoration { } interface FullDecoration { - createdAt?: Uint8Array; + createdAt?: Uint8Array | undefined; decoratedApi: ApiDecoration; decoratedMeta: DecoratedMeta; } diff --git a/packages/api/src/submittable/Result.ts b/packages/api/src/submittable/Result.ts index 887019babf64..e2b6d5450fed 100644 --- a/packages/api/src/submittable/Result.ts +++ b/packages/api/src/submittable/Result.ts @@ -35,11 +35,11 @@ function extractInfo (events: EventRecord[] = []): DispatchInfo | undefined { } export class SubmittableResult implements ISubmittableResult { - readonly dispatchError?: DispatchError; + readonly dispatchError?: DispatchError | undefined; - readonly dispatchInfo?: DispatchInfo; + readonly dispatchInfo?: DispatchInfo | undefined; - readonly internalError?: Error; + readonly internalError?: Error | undefined; readonly events: EventRecord[]; @@ -47,9 +47,9 @@ export class SubmittableResult implements ISubmittableResult { readonly txHash: Hash; - readonly txIndex?: number; + readonly txIndex?: number | undefined; - readonly blockNumber?: BlockNumber; + readonly blockNumber?: BlockNumber | undefined; constructor ({ blockNumber, dispatchError, dispatchInfo, events, internalError, status, txHash, txIndex }: SubmittableResultValue) { this.dispatchError = dispatchError || extractError(events); diff --git a/packages/api/src/submittable/createClass.ts b/packages/api/src/submittable/createClass.ts index f2e63784aec5..544028882eda 100644 --- a/packages/api/src/submittable/createClass.ts +++ b/packages/api/src/submittable/createClass.ts @@ -21,7 +21,7 @@ import { SubmittableResult } from './Result.js'; interface SubmittableOptions { api: ApiInterfaceRx; apiType: ApiTypes; - blockHash?: Uint8Array; + blockHash?: Uint8Array | undefined; decorateMethod: ApiBase['_decorateMethod']; } @@ -58,7 +58,7 @@ function makeEraOptions (api: ApiInterfaceRx, registry: Registry, partialOptions }); } -function makeSignAndSendOptions (partialOptions?: Partial | Callback, statusCb?: Callback): [Partial, Callback?] { +function makeSignAndSendOptions (partialOptions?: Partial | Callback, statusCb?: Callback): [Partial, Callback | undefined] { let options: Partial = {}; if (isFunction(partialOptions)) { diff --git a/packages/rpc-provider/src/substrate-connect/Health.ts b/packages/rpc-provider/src/substrate-connect/Health.ts index ba6fcd079d8b..36cbe3eb7e90 100644 --- a/packages/rpc-provider/src/substrate-connect/Health.ts +++ b/packages/rpc-provider/src/substrate-connect/Health.ts @@ -130,7 +130,7 @@ class InnerChecker { let parsedResponse: {id: string, result?: SmoldotHealth, params?: { subscription: string }}; try { - parsedResponse = JSON.parse(jsonRpcResponse) as { id: string, result: undefined | SmoldotHealth }; + parsedResponse = JSON.parse(jsonRpcResponse) as { id: string, result?: SmoldotHealth }; } catch { return jsonRpcResponse; } diff --git a/packages/rpc-provider/src/substrate-connect/index.ts b/packages/rpc-provider/src/substrate-connect/index.ts index fddbb3dee2a4..f80fdc67a36a 100644 --- a/packages/rpc-provider/src/substrate-connect/index.ts +++ b/packages/rpc-provider/src/substrate-connect/index.ts @@ -54,7 +54,7 @@ export class ScProvider implements ProviderInterface { readonly #Sc: SubstrateConnect; readonly #coder: RpcCoder = new RpcCoder(); readonly #spec: string | ScType.WellKnownChain; - readonly #sharedSandbox?: ScProvider; + readonly #sharedSandbox?: ScProvider | undefined; readonly #subscriptions: Map = new Map(); readonly #resubscribeMethods: Map = new Map(); readonly #requests: Map = new Map(); diff --git a/packages/rpc-provider/src/ws/index.ts b/packages/rpc-provider/src/ws/index.ts index 6bbf6ae1d127..f3a4bd5a1dc7 100644 --- a/packages/rpc-provider/src/ws/index.ts +++ b/packages/rpc-provider/src/ws/index.ts @@ -26,7 +26,7 @@ interface WsStateAwaiting { method: string; params: unknown[]; start: number; - subscription?: SubscriptionHandler; + subscription?: SubscriptionHandler | undefined; } interface WsStateSubscription extends SubscriptionHandler { diff --git a/packages/typegen/src/generate/query.ts b/packages/typegen/src/generate/query.ts index f46969f06c87..d687cacd2b82 100644 --- a/packages/typegen/src/generate/query.ts +++ b/packages/typegen/src/generate/query.ts @@ -12,7 +12,7 @@ import type { ExtraTypes } from './types.js'; import Handlebars from 'handlebars'; import * as defaultDefs from '@polkadot/types/interfaces/definitions'; -import { unwrapStorageSi } from '@polkadot/types/primitive/StorageKey'; +import { unwrapStorageSi } from '@polkadot/types/util'; import lookupDefinitions from '@polkadot/types-augment/lookup/definitions'; import { stringCamelCase } from '@polkadot/util'; diff --git a/packages/typegen/src/metadataMd.ts b/packages/typegen/src/metadataMd.ts index f1ed6457a5e0..cac5cf317d5e 100644 --- a/packages/typegen/src/metadataMd.ts +++ b/packages/typegen/src/metadataMd.ts @@ -16,7 +16,7 @@ import { Metadata, TypeRegistry, Vec } from '@polkadot/types'; import * as definitions from '@polkadot/types/interfaces/definitions'; import { getStorage as getSubstrateStorage } from '@polkadot/types/metadata/decorate/storage/getStorage'; import { Text } from '@polkadot/types/primitive'; -import { unwrapStorageType } from '@polkadot/types/primitive/StorageKey'; +import { unwrapStorageType } from '@polkadot/types/util'; import kusamaMeta, { rpc as kusamaRpc, version as kusamaVer } from '@polkadot/types-support/metadata/static-kusama'; import polkadotMeta, { rpc as polkadotRpc, version as polkadotVer } from '@polkadot/types-support/metadata/static-polkadot'; import substrateMeta from '@polkadot/types-support/metadata/static-substrate'; diff --git a/packages/types-codec/src/abstract/Base.ts b/packages/types-codec/src/abstract/Base.ts index dcf389312ddb..fefdab242777 100644 --- a/packages/types-codec/src/abstract/Base.ts +++ b/packages/types-codec/src/abstract/Base.ts @@ -11,8 +11,8 @@ import type { AnyJson, BareOpts, Codec, Inspect, IU8a, Registry } from '../types export abstract class AbstractBase implements Codec { readonly registry: Registry; - public createdAtHash?: IU8a; - public initialU8aLength?: number; + public createdAtHash?: IU8a | undefined; + public initialU8aLength?: number | undefined; public isStorageFallback?: boolean; readonly #raw: T; diff --git a/packages/types-codec/src/abstract/Object.ts b/packages/types-codec/src/abstract/Object.ts index 8dfffa82fa8d..33045068bfca 100644 --- a/packages/types-codec/src/abstract/Object.ts +++ b/packages/types-codec/src/abstract/Object.ts @@ -12,7 +12,7 @@ export abstract class AbstractObject implements CodecObject< readonly registry: Registry; public createdAtHash?: IU8a; - public initialU8aLength?: number; + public initialU8aLength?: number | undefined; public isStorageFallback?: boolean; readonly $: T; diff --git a/packages/types-codec/src/base/Compact.ts b/packages/types-codec/src/base/Compact.ts index d5523bc580c2..50e312a96eb7 100644 --- a/packages/types-codec/src/base/Compact.ts +++ b/packages/types-codec/src/base/Compact.ts @@ -3,17 +3,12 @@ import type { BN } from '@polkadot/util'; import type { HexString } from '@polkadot/util/types'; -import type { AnyJson, AnyNumber, CodecClass, ICompact, Inspect, INumber, IU8a, Registry } from '../types/index.js'; +import type { AnyJson, AnyNumber, CodecClass, DefinitionSetter, ICompact, Inspect, INumber, IU8a, Registry } from '../types/index.js'; import { compactFromU8a, compactFromU8aLim, compactToU8a, isU8a } from '@polkadot/util'; import { typeToConstructor } from '../utils/index.js'; -interface Options { - definition?: CodecClass; - setDefinition?: (d: CodecClass) => CodecClass; -} - function noopSetDefinition (d: CodecClass): CodecClass { return d; } @@ -56,7 +51,7 @@ export class Compact implements ICompact { readonly #Type: CodecClass; readonly #raw: T; - constructor (registry: Registry, Type: CodecClass | string, value: Compact | AnyNumber = 0, { definition, setDefinition = noopSetDefinition }: Options = {}) { + constructor (registry: Registry, Type: CodecClass | string, value: Compact | AnyNumber = 0, { definition, setDefinition = noopSetDefinition }: DefinitionSetter> = {}) { this.registry = registry; this.#Type = definition || setDefinition(typeToConstructor(registry, Type)); diff --git a/packages/types-codec/src/base/Enum.ts b/packages/types-codec/src/base/Enum.ts index 225a67641778..d898405641b6 100644 --- a/packages/types-codec/src/base/Enum.ts +++ b/packages/types-codec/src/base/Enum.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { HexString } from '@polkadot/util/types'; -import type { AnyJson, Codec, CodecClass, IEnum, Inspect, IU8a, Registry } from '../types/index.js'; +import type { AnyJson, Codec, CodecClass, DefinitionSetter, IEnum, Inspect, IU8a, Registry } from '../types/index.js'; import { isHex, isNumber, isObject, isString, isU8a, objectProperties, stringCamelCase, stringify, stringPascalCase, u8aConcatStrict, u8aToHex, u8aToU8a } from '@polkadot/util'; @@ -32,11 +32,6 @@ interface Decoded { value: Codec; } -interface Options { - definition?: Definition; - setDefinition?: (d: Definition) => Definition; -} - function noopSetDefinition (d: Definition): Definition { return d; } @@ -196,7 +191,7 @@ export class Enum implements IEnum { readonly #isIndexed: boolean; readonly #raw: Codec; - constructor (registry: Registry, Types: Record | Record | string[], value?: unknown, index?: number, { definition, setDefinition = noopSetDefinition }: Options = {}) { + constructor (registry: Registry, Types: Record | Record | string[], value?: unknown, index?: number, { definition, setDefinition = noopSetDefinition }: DefinitionSetter = {}) { const { def, isBasic, isIndexed } = definition || setDefinition(extractDef(registry, Types)); // shortcut isU8a as used in SCALE decoding diff --git a/packages/types-codec/src/base/Option.ts b/packages/types-codec/src/base/Option.ts index 7d1772ca150e..167bd38207e0 100644 --- a/packages/types-codec/src/base/Option.ts +++ b/packages/types-codec/src/base/Option.ts @@ -2,18 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 import type { HexString } from '@polkadot/util/types'; -import type { AnyJson, Codec, CodecClass, Inspect, IOption, IU8a, Registry } from '../types/index.js'; +import type { AnyJson, Codec, CodecClass, DefinitionSetter, Inspect, IOption, IU8a, Registry } from '../types/index.js'; import { isCodec, isNull, isU8a, isUndefined, u8aToHex } from '@polkadot/util'; import { typeToConstructor } from '../utils/index.js'; import { Null } from './Null.js'; -interface Options { - definition?: CodecClass; - setDefinition?: (d: CodecClass) => CodecClass; -} - function noopSetDefinition (d: CodecClass): CodecClass { return d; } @@ -75,7 +70,7 @@ export class Option implements IOption { readonly #Type: CodecClass; readonly #raw: T; - constructor (registry: Registry, typeName: CodecClass | string, value?: unknown, { definition, setDefinition = noopSetDefinition }: Options = {}) { + constructor (registry: Registry, typeName: CodecClass | string, value?: unknown, { definition, setDefinition = noopSetDefinition }: DefinitionSetter> = {}) { const Type = definition || setDefinition(typeToConstructor(registry, typeName)); const decoded = isU8a(value) && value.length && !isCodec(value) ? value[0] === 0 diff --git a/packages/types-codec/src/base/Tuple.ts b/packages/types-codec/src/base/Tuple.ts index 3588a5720850..caf159b75e26 100644 --- a/packages/types-codec/src/base/Tuple.ts +++ b/packages/types-codec/src/base/Tuple.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AnyTupleValue, Codec, CodecClass, Inspect, ITuple, Registry } from '../types/index.js'; +import type { AnyTupleValue, Codec, CodecClass, DefinitionSetter, Inspect, ITuple, Registry } from '../types/index.js'; import { isFunction, isHex, isString, isU8a, stringify, u8aConcatStrict, u8aToU8a } from '@polkadot/util'; @@ -16,11 +16,6 @@ type TupleTypes = TupleType[] | { type Definition = [CodecClass[], string[]]; -interface Options { - definition?: Definition; - setDefinition?: (d: Definition) => Definition; -} - function noopSetDefinition (d: Definition): Definition { return d; } @@ -67,7 +62,7 @@ function decodeTuple (registry: Registry, result: Codec[], value: Exclude implements ITuple { #Types: Definition; - constructor (registry: Registry, Types: TupleTypes | TupleType, value?: AnyTupleValue, { definition, setDefinition = noopSetDefinition }: Options = {}) { + constructor (registry: Registry, Types: TupleTypes | TupleType, value?: AnyTupleValue, { definition, setDefinition = noopSetDefinition }: DefinitionSetter = {}) { const Classes = definition || setDefinition( Array.isArray(Types) ? [Types.map((t) => typeToConstructor(registry, t)), []] diff --git a/packages/types-codec/src/base/Vec.ts b/packages/types-codec/src/base/Vec.ts index d25e92ef4546..345660eb9672 100644 --- a/packages/types-codec/src/base/Vec.ts +++ b/packages/types-codec/src/base/Vec.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { HexString } from '@polkadot/util/types'; -import type { Codec, CodecClass, Registry } from '../types/index.js'; +import type { Codec, CodecClass, DefinitionSetter, Registry } from '../types/index.js'; import { compactFromU8aLim, isHex, isU8a, logger, stringify, u8aToU8a } from '@polkadot/util'; @@ -13,11 +13,6 @@ const MAX_LENGTH = 64 * 1024; const l = logger('Vec'); -interface Options { - definition?: CodecClass; - setDefinition?: (d: CodecClass) => CodecClass; -} - function noopSetDefinition (d: CodecClass): CodecClass { return d; } @@ -80,7 +75,7 @@ export function decodeVec (registry: Registry, result: T[], val export class Vec extends AbstractArray { #Type: CodecClass; - constructor (registry: Registry, Type: CodecClass | string, value: Uint8Array | HexString | unknown[] = [], { definition, setDefinition = noopSetDefinition }: Options = {}) { + constructor (registry: Registry, Type: CodecClass | string, value: Uint8Array | HexString | unknown[] = [], { definition, setDefinition = noopSetDefinition }: DefinitionSetter> = {}) { const [decodeFrom, length, startAt] = decodeVecLength(value); super(registry, length); diff --git a/packages/types-codec/src/base/VecFixed.ts b/packages/types-codec/src/base/VecFixed.ts index 82dc50bc4f4d..2961f9c40c0a 100644 --- a/packages/types-codec/src/base/VecFixed.ts +++ b/packages/types-codec/src/base/VecFixed.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { HexString } from '@polkadot/util/types'; -import type { Codec, CodecClass, Inspect, Registry } from '../types/index.js'; +import type { Codec, CodecClass, DefinitionSetter, Inspect, Registry } from '../types/index.js'; import { isU8a, u8aConcatStrict } from '@polkadot/util'; @@ -10,11 +10,6 @@ import { AbstractArray } from '../abstract/Array.js'; import { decodeU8aVec, typeToConstructor } from '../utils/index.js'; import { decodeVec } from './Vec.js'; -interface Options { - definition?: CodecClass; - setDefinition?: (d: CodecClass) => CodecClass; -} - function noopSetDefinition (d: CodecClass): CodecClass { return d; } @@ -27,7 +22,7 @@ function noopSetDefinition (d: CodecClass): CodecClass { export class VecFixed extends AbstractArray { #Type: CodecClass; - constructor (registry: Registry, Type: CodecClass | string, length: number, value: Uint8Array | HexString | unknown[] = [] as unknown[], { definition, setDefinition = noopSetDefinition }: Options = {}) { + constructor (registry: Registry, Type: CodecClass | string, length: number, value: Uint8Array | HexString | unknown[] = [] as unknown[], { definition, setDefinition = noopSetDefinition }: DefinitionSetter> = {}) { super(registry, length); this.#Type = definition || setDefinition(typeToConstructor(registry, Type)); diff --git a/packages/types-codec/src/native/Raw.ts b/packages/types-codec/src/native/Raw.ts index c1233b507391..270dfb795f6f 100644 --- a/packages/types-codec/src/native/Raw.ts +++ b/packages/types-codec/src/native/Raw.ts @@ -18,8 +18,8 @@ import { isAscii, isUndefined, isUtf8, u8aToHex, u8aToString, u8aToU8a } from '@ export class Raw extends Uint8Array implements IU8a { readonly registry: Registry; - public createdAtHash?: IU8a; - public initialU8aLength?: number; + public createdAtHash?: IU8a | undefined; + public initialU8aLength?: number | undefined; public isStorageFallback?: boolean; /** diff --git a/packages/types-codec/src/native/Struct.ts b/packages/types-codec/src/native/Struct.ts index 5d15430c629a..55025c889f59 100644 --- a/packages/types-codec/src/native/Struct.ts +++ b/packages/types-codec/src/native/Struct.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { HexString } from '@polkadot/util/types'; -import type { AnyJson, BareOpts, Codec, CodecClass, Inspect, IStruct, IU8a, Registry } from '../types/index.js'; +import type { AnyJson, BareOpts, Codec, CodecClass, DefinitionSetter, Inspect, IStruct, IU8a, Registry } from '../types/index.js'; import { isBoolean, isHex, isObject, isU8a, isUndefined, objectProperties, stringCamelCase, stringify, u8aConcatStrict, u8aToHex, u8aToU8a } from '@polkadot/util'; @@ -12,11 +12,6 @@ type TypesDef = Record>; type Definition = [CodecClass[], string[]]; -interface Options { - definition?: Definition; - setDefinition?: (d: Definition) => Definition; -} - function noopSetDefinition (d: Definition): Definition { return d; } @@ -105,14 +100,14 @@ export class Struct< E extends { [K in keyof S]: string } = { [K in keyof S]: string }> extends Map implements IStruct { readonly registry: Registry; - public createdAtHash?: IU8a; + public createdAtHash?: IU8a | undefined; public initialU8aLength?: number; public isStorageFallback?: boolean; readonly #jsonMap: Map; readonly #Types: Definition; - constructor (registry: Registry, Types: S, value?: V | Map | unknown[] | HexString | null, jsonMap = new Map(), { definition, setDefinition = noopSetDefinition }: Options = {}) { + constructor (registry: Registry, Types: S, value?: V | Map | unknown[] | HexString | null, jsonMap = new Map(), { definition, setDefinition = noopSetDefinition }: DefinitionSetter = {}) { const typeMap = definition || setDefinition(mapToTypeMap(registry, Types)); const [decoded, decodedLength] = isU8a(value) || isHex(value) ? decodeU8aStruct(registry, new Array<[string, Codec]>(typeMap[0].length), u8aToU8a(value), typeMap) diff --git a/packages/types-codec/src/types/codec.ts b/packages/types-codec/src/types/codec.ts index 6c0b406d490a..1a613d2aec3d 100644 --- a/packages/types-codec/src/types/codec.ts +++ b/packages/types-codec/src/types/codec.ts @@ -9,7 +9,7 @@ import type { Registry } from './registry.js'; export type BareOpts = boolean | Record; export interface Inspect { - inner?: Inspect[]; + inner?: Inspect[] | undefined; name?: string; outer?: Uint8Array[]; } @@ -28,14 +28,14 @@ export interface Codec { * The block at which this value was retrieved/created (set to non-empty when * retrieved from storage) */ - createdAtHash?: IU8a; + createdAtHash?: IU8a | undefined; /** * @description * The length of the initial encoded value (Only available when the value was * constructed from a Uint8Array input) */ - initialU8aLength?: number; + initialU8aLength?: number | undefined; /** * @description diff --git a/packages/types-codec/src/types/helpers.ts b/packages/types-codec/src/types/helpers.ts index f0bfcf50ec0b..8e2973cf2fb4 100644 --- a/packages/types-codec/src/types/helpers.ts +++ b/packages/types-codec/src/types/helpers.ts @@ -42,4 +42,9 @@ export interface ToBn { toBn: () => BN; } +export interface DefinitionSetter { + definition?: T | undefined; + setDefinition?: (d: T) => T; +} + export type LookupString = `Lookup${number}`; diff --git a/packages/types-codec/src/types/registry.ts b/packages/types-codec/src/types/registry.ts index eb34081a31b3..c82de176d57b 100644 --- a/packages/types-codec/src/types/registry.ts +++ b/packages/types-codec/src/types/registry.ts @@ -31,7 +31,7 @@ export type RegistryTypes = { _set: Record }>; export interface CodecCreateOptions { - blockHash?: Uint8Array | string | null; + blockHash?: Uint8Array | string | null | undefined; isFallback?: boolean; isOptional?: boolean; isPedantic?: boolean; diff --git a/packages/types-create/src/types/types.ts b/packages/types-create/src/types/types.ts index 62ea37295c2b..0d9823544cde 100644 --- a/packages/types-create/src/types/types.ts +++ b/packages/types-create/src/types/types.ts @@ -28,20 +28,20 @@ export enum TypeDefInfo { } export interface TypeDef { - alias?: Map; - displayName?: string; - docs?: string[]; - fallbackType?: string; + alias?: Map | undefined; + displayName?: string | undefined; + docs?: string[] | undefined; + fallbackType?: string | undefined; info: TypeDefInfo; index?: number; isFromSi?: boolean; length?: number; lookupIndex?: number; - lookupName?: string; - lookupNameRoot?: string; - name?: string; - namespace?: string; + lookupName?: string | undefined; + lookupNameRoot?: string | undefined; + name?: string | undefined; + namespace?: string | undefined; sub?: TypeDef | TypeDef[]; type: string; - typeName?: string; + typeName?: string | undefined; } diff --git a/packages/types/src/bundle.ts b/packages/types/src/bundle.ts index 21f717354c79..6cb7a4fc711f 100644 --- a/packages/types/src/bundle.ts +++ b/packages/types/src/bundle.ts @@ -12,7 +12,7 @@ export * from './metadata/index.js'; export { TypeDefInfo } from '@polkadot/types-create'; export { convertSiV0toV1 } from './metadata/PortableRegistry/index.js'; +export { unwrapStorageType } from './util/index.js'; export { packageInfo } from './packageInfo.js'; -export { unwrapStorageType } from './primitive/StorageKey.js'; export { typeDefinitions, rpcDefinitions }; diff --git a/packages/types/src/create/registry.ts b/packages/types/src/create/registry.ts index 2657050cf3a9..8d5d35ec053f 100644 --- a/packages/types/src/create/registry.ts +++ b/packages/types/src/create/registry.ts @@ -177,7 +177,7 @@ export class TypeRegistry implements Registry { #metadataVersion = 0; #signedExtensions: string[] = fallbackExtensions; #unknownTypes = new Map(); - #userExtensions?: ExtDef; + #userExtensions?: ExtDef | undefined; readonly #knownDefaults: Record; readonly #knownDefinitions: Record; diff --git a/packages/types/src/extrinsic/Extrinsic.ts b/packages/types/src/extrinsic/Extrinsic.ts index 9792313881f0..ea4d1bd53ae5 100644 --- a/packages/types/src/extrinsic/Extrinsic.ts +++ b/packages/types/src/extrinsic/Extrinsic.ts @@ -234,7 +234,7 @@ abstract class ExtrinsicBase extends AbstractBase extends ExtrinsicBase implements IExtrinsic { - #hashCache?: CodecHash; + #hashCache?: CodecHash | undefined; static LATEST_EXTRINSIC_VERSION = LATEST_EXTRINSIC_VERSION; diff --git a/packages/types/src/metadata/util/testUtil.ts b/packages/types/src/metadata/util/testUtil.ts index a8420da5c9ca..a839193a938f 100644 --- a/packages/types/src/metadata/util/testUtil.ts +++ b/packages/types/src/metadata/util/testUtil.ts @@ -12,7 +12,7 @@ import path from 'node:path'; import { hexToU8a, stringCamelCase, stringify, u8aToHex } from '@polkadot/util'; import { TypeRegistry } from '../../create/index.js'; -import { unwrapStorageSi, unwrapStorageType } from '../../primitive/StorageKey.js'; +import { unwrapStorageSi, unwrapStorageType } from '../../util/index.js'; import { Metadata } from '../Metadata.js'; import { getUniqTypes } from './getUniqTypes.js'; diff --git a/packages/types/src/primitive/StorageKey.ts b/packages/types/src/primitive/StorageKey.ts index f9f8d06357a3..b3a42bc8b8bf 100644 --- a/packages/types/src/primitive/StorageKey.ts +++ b/packages/types/src/primitive/StorageKey.ts @@ -3,20 +3,21 @@ import type { AnyJson, AnyTuple, Codec } from '@polkadot/types-codec/types'; import type { AllHashers } from '../interfaces/metadata/definitions.js'; -import type { StorageEntryMetadataLatest, StorageEntryTypeLatest, StorageHasher } from '../interfaces/metadata/index.js'; +import type { StorageEntryMetadataLatest, StorageHasher } from '../interfaces/metadata/index.js'; import type { SiLookupTypeId } from '../interfaces/scaleInfo/index.js'; -import type { InterfaceTypes, IStorageKey, Registry } from '../types/index.js'; +import type { IStorageKey, Registry } from '../types/index.js'; import type { StorageEntry } from './types.js'; import { Bytes } from '@polkadot/types-codec'; import { isFunction, isString, isU8a } from '@polkadot/util'; import { getSiName } from '../metadata/util/index.js'; +import { unwrapStorageType } from '../util/index.js'; interface Decoded { - key?: Uint8Array | string; - method?: string; - section?: string; + key?: Uint8Array | string | undefined; + method?: string | undefined; + section?: string | undefined; } interface StorageKeyExtra { @@ -36,21 +37,6 @@ const HASHER_MAP: Record = { Twox64Concat: [8, true] }; -export function unwrapStorageSi (type: StorageEntryTypeLatest): SiLookupTypeId { - return type.isPlain - ? type.asPlain - : type.asMap.value; -} - -/** @internal */ -export function unwrapStorageType (registry: Registry, type: StorageEntryTypeLatest, isOptional?: boolean): keyof InterfaceTypes { - const outputType = getSiName(registry.lookup, unwrapStorageSi(type)); - - return isOptional - ? `Option<${outputType}>` as unknown as keyof InterfaceTypes - : outputType as keyof InterfaceTypes; -} - /** @internal */ function decodeStorageKey (value?: string | Uint8Array | StorageKey | StorageEntry | [StorageEntry, unknown[]?]): Decoded { if (isU8a(value) || !value || isString(value)) { @@ -172,10 +158,10 @@ export class StorageKey extends Bytes implements // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore This is assigned via this.decodeArgsFromMeta() #args: A; - #meta?: StorageEntryMetadataLatest; + #meta?: StorageEntryMetadataLatest | undefined; #outputType: string; - #method?: string; - #section?: string; + #method?: string | undefined; + #section?: string | undefined; constructor (registry: Registry, value?: string | Uint8Array | StorageKey | StorageEntry | [StorageEntry, unknown[]?], override: Partial = {}) { const { key, method, section } = decodeStorageKey(value); diff --git a/packages/types/src/types/extrinsic.ts b/packages/types/src/types/extrinsic.ts index 668fb33b77b6..27a77dc17ecd 100644 --- a/packages/types/src/types/extrinsic.ts +++ b/packages/types/src/types/extrinsic.ts @@ -11,10 +11,10 @@ import type { ICompact, IKeyringPair, IMethod, INumber, IRuntimeVersionBase } fr import type { Registry } from './registry.js'; export interface ISubmittableResult { - readonly dispatchError?: DispatchError; - readonly dispatchInfo?: DispatchInfo; + readonly dispatchError?: DispatchError | undefined; + readonly dispatchInfo?: DispatchInfo | undefined; readonly events: EventRecord[]; - readonly internalError?: Error; + readonly internalError?: Error | undefined; readonly status: ExtrinsicStatus; readonly isCompleted: boolean; readonly isError: boolean; @@ -22,7 +22,7 @@ export interface ISubmittableResult { readonly isInBlock: boolean; readonly isWarning: boolean; readonly txHash: Hash; - readonly txIndex?: number; + readonly txIndex?: number | undefined; filterRecords (section: string, method: string): EventRecord[]; findRecord (section: string, method: string): EventRecord | undefined; diff --git a/packages/types/src/util/index.ts b/packages/types/src/util/index.ts new file mode 100644 index 000000000000..6f2086824f6b --- /dev/null +++ b/packages/types/src/util/index.ts @@ -0,0 +1,4 @@ +// Copyright 2017-2023 @polkadot/types authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +export * from './storage.js'; diff --git a/packages/types/src/util/storage.ts b/packages/types/src/util/storage.ts new file mode 100644 index 000000000000..15d96b71845c --- /dev/null +++ b/packages/types/src/util/storage.ts @@ -0,0 +1,24 @@ +// Copyright 2017-2023 @polkadot/types authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import type { StorageEntryTypeLatest } from '../interfaces/metadata/index.js'; +import type { SiLookupTypeId } from '../interfaces/scaleInfo/index.js'; +import type { InterfaceTypes, Registry } from '../types/index.js'; + +import { getSiName } from '../metadata/util/index.js'; + +/** @internal */ +export function unwrapStorageSi (type: StorageEntryTypeLatest): SiLookupTypeId { + return type.isPlain + ? type.asPlain + : type.asMap.value; +} + +/** @internal */ +export function unwrapStorageType (registry: Registry, type: StorageEntryTypeLatest, isOptional?: boolean): keyof InterfaceTypes { + const outputType = getSiName(registry.lookup, unwrapStorageSi(type)); + + return isOptional + ? `Option<${outputType}>` as unknown as keyof InterfaceTypes + : outputType as keyof InterfaceTypes; +} diff --git a/tsconfig.base.json b/tsconfig.base.json index 14859b9a39a5..2ead4ee45a45 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -51,6 +51,7 @@ "@polkadot/types/primitive/*": ["types/src/primitive/*.ts"], "@polkadot/types/types": ["types/src/types/index.ts"], "@polkadot/types/types/*": ["types/src/types/*.ts"], + "@polkadot/types/util": ["types/src/util/index.ts"], "@polkadot/types-augment": ["types-augment/src/index.ts"], "@polkadot/types-augment/lookup/*": ["types-augment/src/lookup/*.ts"], "@polkadot/types-augment/packageInfo": ["types-augment/src/packageInfo.ts"], diff --git a/yarn.lock b/yarn.lock index f7cf2408dd96..366c180aeb3d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -452,34 +452,34 @@ __metadata: languageName: unknown linkType: soft -"@polkadot/dev-test@npm:^0.72.39": - version: 0.72.39 - resolution: "@polkadot/dev-test@npm:0.72.39" +"@polkadot/dev-test@npm:^0.72.42": + version: 0.72.42 + resolution: "@polkadot/dev-test@npm:0.72.42" dependencies: jsdom: ^21.1.1 tslib: ^2.5.0 - checksum: 2731ac8444aa2c5e78516798c18eee69bc850e66c1f61c35076c86938d906b143a2fe0c52a1fc73cf916f8665e0c79710f6e2f3cc4443f5f6eb3904734e35356 + checksum: eff51b13d27cd2dd5815cabe2ef311f485602c28f0573bf0168f125812b254b84819be26406aa18cc6f3252dfb9084671bededd43f29b1a403ed6762161bfeeb languageName: node linkType: hard -"@polkadot/dev-ts@npm:^0.72.39": - version: 0.72.39 - resolution: "@polkadot/dev-ts@npm:0.72.39" +"@polkadot/dev-ts@npm:^0.72.42": + version: 0.72.42 + resolution: "@polkadot/dev-ts@npm:0.72.42" dependencies: json5: ^2.2.3 tslib: ^2.5.0 typescript: ^5.0.4 - checksum: 8782d9a9c567eed0a08ffd9a3a220622d19b68c86e0cedec0c97a652d4b900c59112a87c40c2a3065727fc4a55de5c49bea3538eff02188503ff1903e8741107 + checksum: c679ea2544ef9eb6c4294191d640d50af13efb39008ceaf8f325398e3989c76d7e091ab19669efbe65c96d9fbad80cddfd33bca4d7a6455ea9755d4a806c5053 languageName: node linkType: hard -"@polkadot/dev@npm:^0.72.39": - version: 0.72.39 - resolution: "@polkadot/dev@npm:0.72.39" +"@polkadot/dev@npm:^0.72.42": + version: 0.72.42 + resolution: "@polkadot/dev@npm:0.72.42" dependencies: "@eslint/js": ^8.38.0 - "@polkadot/dev-test": ^0.72.39 - "@polkadot/dev-ts": ^0.72.39 + "@polkadot/dev-test": ^0.72.42 + "@polkadot/dev-ts": ^0.72.42 "@rollup/plugin-alias": ^5.0.0 "@rollup/plugin-commonjs": ^24.0.1 "@rollup/plugin-dynamic-import-vars": ^2.0.3 @@ -487,8 +487,9 @@ __metadata: "@rollup/plugin-json": ^6.0.0 "@rollup/plugin-node-resolve": ^15.0.2 "@rushstack/eslint-patch": ^1.2.0 - "@typescript-eslint/eslint-plugin": ^5.57.1 - "@typescript-eslint/parser": ^5.57.1 + "@tsconfig/strictest": ^2.0.0 + "@typescript-eslint/eslint-plugin": ^5.58.0 + "@typescript-eslint/parser": ^5.58.0 eslint: ^8.38.0 eslint-config-standard: ^17.0.0 eslint-import-resolver-node: ^0.3.7 @@ -540,7 +541,7 @@ __metadata: polkadot-exec-rollup: scripts/polkadot-exec-rollup.mjs polkadot-exec-tsc: scripts/polkadot-exec-tsc.mjs polkadot-exec-webpack: scripts/polkadot-exec-webpack.mjs - checksum: 527602e64635b3ed43e8f7227c7bd5ae108c861bb89b6a1ad4f04ec933c0e9dc8ec8a9d260638eabc71ecf47f25b66672428becbdad4394a8f55e01ab19a040b + checksum: 1ed5062936ea439d225f044cbc84863b4031476be02491b622aac67b18b8421276114ebb1b38bee9ce7283ef544fe6f829076b4da238cad40dc3269b19e8fcd4 languageName: node linkType: hard @@ -1084,6 +1085,13 @@ __metadata: languageName: node linkType: hard +"@tsconfig/strictest@npm:^2.0.0": + version: 2.0.0 + resolution: "@tsconfig/strictest@npm:2.0.0" + checksum: a21d79fb3eb587e3e61b5bf3e4f52bc2a4f471ca4f3b1effe93849b97a36723cecfbef8181bac2c68cba9b44ef6b220cbe64194d17826622402de144383440f3 + languageName: node + linkType: hard + "@types/bn.js@npm:^5.1.1": version: 5.1.1 resolution: "@types/bn.js@npm:5.1.1" @@ -1340,14 +1348,14 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/eslint-plugin@npm:^5.57.1": - version: 5.57.1 - resolution: "@typescript-eslint/eslint-plugin@npm:5.57.1" +"@typescript-eslint/eslint-plugin@npm:^5.58.0": + version: 5.58.0 + resolution: "@typescript-eslint/eslint-plugin@npm:5.58.0" dependencies: "@eslint-community/regexpp": ^4.4.0 - "@typescript-eslint/scope-manager": 5.57.1 - "@typescript-eslint/type-utils": 5.57.1 - "@typescript-eslint/utils": 5.57.1 + "@typescript-eslint/scope-manager": 5.58.0 + "@typescript-eslint/type-utils": 5.58.0 + "@typescript-eslint/utils": 5.58.0 debug: ^4.3.4 grapheme-splitter: ^1.0.4 ignore: ^5.2.0 @@ -1360,43 +1368,43 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 3ea842ef9615e298e28c6687c4dc285577ea0995944410553b3ca514ce9d437534b6e89114e9398c1a370324afe7a4a251c8c49540bb3bf13dcadde9ada3ecc2 + checksum: e5d76d43c466ebd4b552e3307eff72ab5ae8a0c09a1d35fa13b62769ac3336df94d9281728ab5aafd2c14a0a644133583edcd708fce60a9a82df1db3ca3b8e14 languageName: node linkType: hard -"@typescript-eslint/parser@npm:^5.57.1": - version: 5.57.1 - resolution: "@typescript-eslint/parser@npm:5.57.1" +"@typescript-eslint/parser@npm:^5.58.0": + version: 5.58.0 + resolution: "@typescript-eslint/parser@npm:5.58.0" dependencies: - "@typescript-eslint/scope-manager": 5.57.1 - "@typescript-eslint/types": 5.57.1 - "@typescript-eslint/typescript-estree": 5.57.1 + "@typescript-eslint/scope-manager": 5.58.0 + "@typescript-eslint/types": 5.58.0 + "@typescript-eslint/typescript-estree": 5.58.0 debug: ^4.3.4 peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 peerDependenciesMeta: typescript: optional: true - checksum: db61a12a67bc45d814297e7f089768c0849f18162b330279aa15121223ec3b18d80df4c327f4ca0a40a7bddb9150ba1a9379fce00bc0e4a10cc189d04e36f0e3 + checksum: 38681da48a40132c0538579c818ceef9ba2793ab8f79236c3f64980ba1649bb87cb367cd79d37bf2982b8bfbc28f91846b8676f9bd333e8b691c9befffd8874a languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:5.57.1": - version: 5.57.1 - resolution: "@typescript-eslint/scope-manager@npm:5.57.1" +"@typescript-eslint/scope-manager@npm:5.58.0": + version: 5.58.0 + resolution: "@typescript-eslint/scope-manager@npm:5.58.0" dependencies: - "@typescript-eslint/types": 5.57.1 - "@typescript-eslint/visitor-keys": 5.57.1 - checksum: 4f03d54372f0591fbc5f6e0267a6f1b73e3012e8a319c1893829e0b8e71f882e17a696995dc8b11e700162daf74444fd2d8f55dba314e1a95221a9d3eabcfb2b + "@typescript-eslint/types": 5.58.0 + "@typescript-eslint/visitor-keys": 5.58.0 + checksum: f0d3df5cc3c461fe63ef89ad886b53c239cc7c1d9061d83d8a9d9c8e087e5501eac84bebff8a954728c17ccea191f235686373d54d2b8b6370af2bcf2b18e062 languageName: node linkType: hard -"@typescript-eslint/type-utils@npm:5.57.1": - version: 5.57.1 - resolution: "@typescript-eslint/type-utils@npm:5.57.1" +"@typescript-eslint/type-utils@npm:5.58.0": + version: 5.58.0 + resolution: "@typescript-eslint/type-utils@npm:5.58.0" dependencies: - "@typescript-eslint/typescript-estree": 5.57.1 - "@typescript-eslint/utils": 5.57.1 + "@typescript-eslint/typescript-estree": 5.58.0 + "@typescript-eslint/utils": 5.58.0 debug: ^4.3.4 tsutils: ^3.21.0 peerDependencies: @@ -1404,7 +1412,7 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 06fab95315fc1ffdaaa011e6ec1ae538826ef3d9b422e2c926dbe9b83e55d9e8bdaa07c43317a4c0a59b40a24c5c48a7c8284e6a18780475a65894b1b949fc23 + checksum: 803f24daed185152bf86952d4acebb5ea18ff03db5f28750368edf76fdea46b4b0f8803ae0b61c0282b47181c9977113457b16e33d5d2cb33b13855f55c5e5b2 languageName: node linkType: hard @@ -1415,19 +1423,19 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/types@npm:5.57.1": - version: 5.57.1 - resolution: "@typescript-eslint/types@npm:5.57.1" - checksum: 21789eb697904bbb44a18df961d5918e7c5bd90c79df3a8b8b835da81d0c0f42c7eeb2d05f77cafe49a7367ae7f549a0c8281656ea44b6dc56ae1bf19a3a1eae +"@typescript-eslint/types@npm:5.58.0": + version: 5.58.0 + resolution: "@typescript-eslint/types@npm:5.58.0" + checksum: 8622a73d73220c4a7111537825f488c0271272032a1d4e129dc722bc6e8b3ec84f64469b2ca3b8dae7da3a9c18953ce1449af51f5f757dad60835eb579ad1d2c languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:5.57.1, @typescript-eslint/typescript-estree@npm:^5.13.0": - version: 5.57.1 - resolution: "@typescript-eslint/typescript-estree@npm:5.57.1" +"@typescript-eslint/typescript-estree@npm:5.58.0, @typescript-eslint/typescript-estree@npm:^5.13.0": + version: 5.58.0 + resolution: "@typescript-eslint/typescript-estree@npm:5.58.0" dependencies: - "@typescript-eslint/types": 5.57.1 - "@typescript-eslint/visitor-keys": 5.57.1 + "@typescript-eslint/types": 5.58.0 + "@typescript-eslint/visitor-keys": 5.58.0 debug: ^4.3.4 globby: ^11.1.0 is-glob: ^4.0.3 @@ -1436,7 +1444,7 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: bf96520f6de562838a40c3f009fc61fbee5369621071cd0d1dba4470b2b2f746cf79afe4ffa3fbccb8913295a2fbb3d89681d5178529e8da4987c46ed4e5cbed + checksum: 51b668ec858db0c040a71dff526273945cee4ba5a9b240528d503d02526685882d900cf071c6636a4d9061ed3fd4a7274f7f1a23fba55c4b48b143344b4009c7 languageName: node linkType: hard @@ -1458,21 +1466,21 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/utils@npm:5.57.1, @typescript-eslint/utils@npm:^5.10.0, @typescript-eslint/utils@npm:^5.57.0": - version: 5.57.1 - resolution: "@typescript-eslint/utils@npm:5.57.1" +"@typescript-eslint/utils@npm:5.58.0, @typescript-eslint/utils@npm:^5.10.0, @typescript-eslint/utils@npm:^5.57.0": + version: 5.58.0 + resolution: "@typescript-eslint/utils@npm:5.58.0" dependencies: "@eslint-community/eslint-utils": ^4.2.0 "@types/json-schema": ^7.0.9 "@types/semver": ^7.3.12 - "@typescript-eslint/scope-manager": 5.57.1 - "@typescript-eslint/types": 5.57.1 - "@typescript-eslint/typescript-estree": 5.57.1 + "@typescript-eslint/scope-manager": 5.58.0 + "@typescript-eslint/types": 5.58.0 + "@typescript-eslint/typescript-estree": 5.58.0 eslint-scope: ^5.1.1 semver: ^7.3.7 peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - checksum: 12e55144c8087f4e8f0f22e5693f3901b81bb7899dec42c7bfe540ac672a802028b688884bb43bd67bcf3cd3546a7205d207afcd948c731c19f551ea61267205 + checksum: c618ae67963ecf96b1492c09afaeb363f542f0d6780bcac4af3c26034e3b20034666b2d523aa94821df813aafb57a0b150a7d5c2224fe8257452ad1de2237a58 languageName: node linkType: hard @@ -1486,13 +1494,13 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/visitor-keys@npm:5.57.1": - version: 5.57.1 - resolution: "@typescript-eslint/visitor-keys@npm:5.57.1" +"@typescript-eslint/visitor-keys@npm:5.58.0": + version: 5.58.0 + resolution: "@typescript-eslint/visitor-keys@npm:5.58.0" dependencies: - "@typescript-eslint/types": 5.57.1 + "@typescript-eslint/types": 5.58.0 eslint-visitor-keys: ^3.3.0 - checksum: d187dfac044b7c0f24264a9ba5eebcf6651412d840b4aaba8eacabff7e771babcd67c738525b1f7c9eb8c94b7edfe7658f6de99f5fdc9745e409c538c1374674 + checksum: ab2d1f37660559954c840429ef78bbf71834063557e3e68e435005b4987970b9356fdf217ead53f7a57f66f5488dc478062c5c44bf17053a8bf041733539b98f languageName: node linkType: hard @@ -7357,7 +7365,7 @@ fsevents@~2.3.2: version: 0.0.0-use.local resolution: "root-workspace-0b6124@workspace:." dependencies: - "@polkadot/dev": ^0.72.39 + "@polkadot/dev": ^0.72.42 "@polkadot/typegen": "workspace:packages/typegen" "@types/node": ^18.15.11 languageName: unknown