diff --git a/package.json b/package.json index 3c878c5fe5..4c5f473d0a 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "@babel/core": "^7.21.0", "@babel/register": "^7.21.0", "@babel/runtime": "^7.21.0", - "@polkadot/dev": "^0.70.4", + "@polkadot/dev": "^0.71.1", "@polkadot/typegen": "workspace:packages/typegen", "@types/node": "^18.14.5" }, diff --git a/packages/api-augment/src/bundle.ts b/packages/api-augment/src/bundle.ts index 4cfc305ead..8a5a89965b 100644 --- a/packages/api-augment/src/bundle.ts +++ b/packages/api-augment/src/bundle.ts @@ -1,6 +1,6 @@ // Copyright 2017-2023 @polkadot/api-augment authors & contributors // SPDX-License-Identifier: Apache-2.0 -import './substrate'; +import './substrate/index.js'; -export { packageInfo } from './packageInfo'; +export { packageInfo } from './packageInfo.js'; diff --git a/packages/api-augment/src/detectPackage.ts b/packages/api-augment/src/detectPackage.ts index 11c0a4c2c7..02f6d07269 100644 --- a/packages/api-augment/src/detectPackage.ts +++ b/packages/api-augment/src/detectPackage.ts @@ -5,7 +5,7 @@ import { detectPackage } from '@polkadot/util'; -import others from './detectOther'; -import { packageInfo } from './packageInfo'; +import others from './detectOther.js'; +import { packageInfo } from './packageInfo.js'; detectPackage(packageInfo, null, others); diff --git a/packages/api-augment/src/index.ts b/packages/api-augment/src/index.ts index 8e29481ef2..168550cd07 100644 --- a/packages/api-augment/src/index.ts +++ b/packages/api-augment/src/index.ts @@ -1,6 +1,6 @@ // Copyright 2017-2023 @polkadot/api-augment authors & contributors // SPDX-License-Identifier: Apache-2.0 -import './detectPackage'; +import './detectPackage.js'; -export * from './bundle'; +export * from './bundle.js'; diff --git a/packages/api-augment/src/kusama/index.ts b/packages/api-augment/src/kusama/index.ts index 4a2bb5b635..808a3e456e 100644 --- a/packages/api-augment/src/kusama/index.ts +++ b/packages/api-augment/src/kusama/index.ts @@ -1,11 +1,11 @@ // Copyright 2017-2023 @polkadot/api-augment authors & contributors // SPDX-License-Identifier: Apache-2.0 -import '../base'; -import './consts'; -import './errors'; -import './events'; -import './query'; -import './registry'; -import './runtime'; -import './tx'; +import '../base.js'; +import './consts.js'; +import './errors.js'; +import './events.js'; +import './query.js'; +import './registry.js'; +import './runtime.js'; +import './tx.js'; diff --git a/packages/api-augment/src/mod.ts b/packages/api-augment/src/mod.ts index 10bbe7e020..3fa7943a88 100644 --- a/packages/api-augment/src/mod.ts +++ b/packages/api-augment/src/mod.ts @@ -1,4 +1,4 @@ // Copyright 2017-2023 @polkadot/api-augment authors & contributors // SPDX-License-Identifier: Apache-2.0 -export * from './index'; +export * from './index.js'; diff --git a/packages/api-augment/src/polkadot/index.ts b/packages/api-augment/src/polkadot/index.ts index 4a2bb5b635..808a3e456e 100644 --- a/packages/api-augment/src/polkadot/index.ts +++ b/packages/api-augment/src/polkadot/index.ts @@ -1,11 +1,11 @@ // Copyright 2017-2023 @polkadot/api-augment authors & contributors // SPDX-License-Identifier: Apache-2.0 -import '../base'; -import './consts'; -import './errors'; -import './events'; -import './query'; -import './registry'; -import './runtime'; -import './tx'; +import '../base.js'; +import './consts.js'; +import './errors.js'; +import './events.js'; +import './query.js'; +import './registry.js'; +import './runtime.js'; +import './tx.js'; diff --git a/packages/api-augment/src/substrate/index.ts b/packages/api-augment/src/substrate/index.ts index 4a2bb5b635..808a3e456e 100644 --- a/packages/api-augment/src/substrate/index.ts +++ b/packages/api-augment/src/substrate/index.ts @@ -1,11 +1,11 @@ // Copyright 2017-2023 @polkadot/api-augment authors & contributors // SPDX-License-Identifier: Apache-2.0 -import '../base'; -import './consts'; -import './errors'; -import './events'; -import './query'; -import './registry'; -import './runtime'; -import './tx'; +import '../base.js'; +import './consts.js'; +import './errors.js'; +import './events.js'; +import './query.js'; +import './registry.js'; +import './runtime.js'; +import './tx.js'; diff --git a/packages/api-base/src/bundle.ts b/packages/api-base/src/bundle.ts index a3b524ad6d..cd35192653 100644 --- a/packages/api-base/src/bundle.ts +++ b/packages/api-base/src/bundle.ts @@ -1,4 +1,4 @@ // Copyright 2017-2023 @polkadot/api-base authors & contributors // SPDX-License-Identifier: Apache-2.0 -export { packageInfo } from './packageInfo'; +export { packageInfo } from './packageInfo.js'; diff --git a/packages/api-base/src/detectPackage.ts b/packages/api-base/src/detectPackage.ts index ac2f00c8fe..965ec00fc2 100644 --- a/packages/api-base/src/detectPackage.ts +++ b/packages/api-base/src/detectPackage.ts @@ -5,7 +5,7 @@ import { detectPackage } from '@polkadot/util'; -import others from './detectOther'; -import { packageInfo } from './packageInfo'; +import others from './detectOther.js'; +import { packageInfo } from './packageInfo.js'; detectPackage(packageInfo, null, others); diff --git a/packages/api-base/src/index.ts b/packages/api-base/src/index.ts index b472ff69eb..4c749b1696 100644 --- a/packages/api-base/src/index.ts +++ b/packages/api-base/src/index.ts @@ -1,6 +1,6 @@ // Copyright 2017-2023 @polkadot/api-base authors & contributors // SPDX-License-Identifier: Apache-2.0 -import './detectPackage'; +import './detectPackage.js'; -export * from './bundle'; +export * from './bundle.js'; diff --git a/packages/api-base/src/mod.ts b/packages/api-base/src/mod.ts index 9fd0990eac..06d834235a 100644 --- a/packages/api-base/src/mod.ts +++ b/packages/api-base/src/mod.ts @@ -1,4 +1,4 @@ // Copyright 2017-2023 @polkadot/api-base authors & contributors // SPDX-License-Identifier: Apache-2.0 -export * from './index'; +export * from './index.js'; diff --git a/packages/api-base/src/types/calls.ts b/packages/api-base/src/types/calls.ts index cfb7a2d984..b9637c2150 100644 --- a/packages/api-base/src/types/calls.ts +++ b/packages/api-base/src/types/calls.ts @@ -3,7 +3,7 @@ import type { Observable } from 'rxjs'; import type { AnyFunction, Codec, DefinitionCallNamed } from '@polkadot/types/types'; -import type { ApiTypes, ReturnCodec } from './base'; +import type { ApiTypes, ReturnCodec } from './base.js'; export type DecoratedCallBase Observable> = ApiType extends 'rxjs' diff --git a/packages/api-base/src/types/consts.ts b/packages/api-base/src/types/consts.ts index e1942aaab3..98967eb3f8 100644 --- a/packages/api-base/src/types/consts.ts +++ b/packages/api-base/src/types/consts.ts @@ -3,7 +3,7 @@ import type { PalletConstantMetadataLatest } from '@polkadot/types/interfaces'; import type { Codec } from '@polkadot/types/types'; -import type { ApiTypes } from './base'; +import type { ApiTypes } from './base.js'; // eslint-disable-next-line @typescript-eslint/no-unused-vars export interface AugmentedConst { diff --git a/packages/api-base/src/types/errors.ts b/packages/api-base/src/types/errors.ts index c3535680c7..780869d672 100644 --- a/packages/api-base/src/types/errors.ts +++ b/packages/api-base/src/types/errors.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { IsError } from '@polkadot/types/metadata/decorate/types'; -import type { ApiTypes } from './base'; +import type { ApiTypes } from './base.js'; // eslint-disable-next-line @typescript-eslint/no-unused-vars export type AugmentedError = IsError; diff --git a/packages/api-base/src/types/events.ts b/packages/api-base/src/types/events.ts index 50187408a3..2923bd2424 100644 --- a/packages/api-base/src/types/events.ts +++ b/packages/api-base/src/types/events.ts @@ -3,7 +3,7 @@ import type { IsEvent } from '@polkadot/types/metadata/decorate/types'; import type { AnyTuple } from '@polkadot/types/types'; -import type { ApiTypes } from './base'; +import type { ApiTypes } from './base.js'; // eslint-disable-next-line @typescript-eslint/no-unused-vars export type AugmentedEvent = IsEvent; diff --git a/packages/api-base/src/types/index.ts b/packages/api-base/src/types/index.ts index 9073942cce..f5e574e9e7 100644 --- a/packages/api-base/src/types/index.ts +++ b/packages/api-base/src/types/index.ts @@ -10,7 +10,7 @@ export * from '@polkadot/api-base/types/storage'; export * from '@polkadot/api-base/types/submittable'; // normal exports -export * from './api'; -export * from './base'; -export * from './derive'; -export * from './rpc'; +export * from './api.js'; +export * from './base.js'; +export * from './derive.js'; +export * from './rpc.js'; diff --git a/packages/api-base/src/types/rpc.ts b/packages/api-base/src/types/rpc.ts index c4ba15282e..a28d40bd70 100644 --- a/packages/api-base/src/types/rpc.ts +++ b/packages/api-base/src/types/rpc.ts @@ -4,7 +4,7 @@ import type { Observable } from 'rxjs'; import type { AnyFunction, AnyJson, Callback, DefinitionRpc } from '@polkadot/types/types'; -import { ApiTypes, PromiseResult, Push, RxResult, UnsubscribePromise } from './base'; +import { ApiTypes, PromiseResult, Push, RxResult, UnsubscribePromise } from './base.js'; export type { AugmentedRpc } from '@polkadot/rpc-core/types'; diff --git a/packages/api-base/src/types/storage.ts b/packages/api-base/src/types/storage.ts index 7c7d8df6e7..d142439124 100644 --- a/packages/api-base/src/types/storage.ts +++ b/packages/api-base/src/types/storage.ts @@ -6,7 +6,7 @@ import type { StorageKey, u64 } from '@polkadot/types'; import type { Hash } from '@polkadot/types/interfaces'; import type { StorageEntry } from '@polkadot/types/primitive/types'; import type { AnyFunction, AnyTuple, Callback, Codec, IStorageKey } from '@polkadot/types/types'; -import type { ApiTypes, DropLast, MethodResult, PaginationOptions, PromiseOrObs, ReturnCodec, UnsubscribePromise } from './base'; +import type { ApiTypes, DropLast, MethodResult, PaginationOptions, PromiseOrObs, ReturnCodec, UnsubscribePromise } from './base.js'; interface StorageEntryObservableMulti { (args: (unknown[] | unknown)[]): Observable; diff --git a/packages/api-base/src/types/submittable.ts b/packages/api-base/src/types/submittable.ts index ce9c884233..ff956e98a6 100644 --- a/packages/api-base/src/types/submittable.ts +++ b/packages/api-base/src/types/submittable.ts @@ -4,7 +4,7 @@ import type { Observable } from 'rxjs'; import type { AccountId, Address, ApplyExtrinsicResult, BlockNumber, Call, DispatchError, DispatchInfo, EventRecord, Extrinsic, ExtrinsicStatus, Hash, RuntimeDispatchInfo } from '@polkadot/types/interfaces'; import type { AnyFunction, AnyNumber, AnyTuple, Callback, CallBase, Codec, IExtrinsicEra, IKeyringPair, ISubmittableResult, Signer } from '@polkadot/types/types'; -import type { ApiTypes, PromiseOrObs } from './base'; +import type { ApiTypes, PromiseOrObs } from './base.js'; export type AugmentedSubmittable = T & CallBase; diff --git a/packages/api-contract/src/Abi/Abi.spec.ts b/packages/api-contract/src/Abi/Abi.spec.ts index 9d620ee0fc..f2324a5e23 100644 --- a/packages/api-contract/src/Abi/Abi.spec.ts +++ b/packages/api-contract/src/Abi/Abi.spec.ts @@ -12,8 +12,8 @@ import process from 'node:process'; import { TypeDefInfo } from '@polkadot/types/types'; import { blake2AsHex } from '@polkadot/util-crypto'; -import abis from '../test/contracts'; -import { Abi } from '.'; +import abis from '../test/contracts/index.js'; +import { Abi } from './index.js'; interface SpecDef { messages: { diff --git a/packages/api-contract/src/Abi/index.ts b/packages/api-contract/src/Abi/index.ts index 84774123b2..5629d9af1e 100644 --- a/packages/api-contract/src/Abi/index.ts +++ b/packages/api-contract/src/Abi/index.ts @@ -4,13 +4,13 @@ import type { Bytes } from '@polkadot/types'; import type { ChainProperties, ContractConstructorSpecLatest, ContractEventSpecLatest, ContractMessageParamSpecLatest, ContractMessageSpecLatest, ContractMetadata, ContractMetadataLatest, ContractProjectInfo } from '@polkadot/types/interfaces'; import type { Codec, Registry } from '@polkadot/types/types'; -import type { AbiConstructor, AbiEvent, AbiMessage, AbiParam, DecodedEvent, DecodedMessage } from '../types'; +import type { AbiConstructor, AbiEvent, AbiMessage, AbiParam, DecodedEvent, DecodedMessage } from '../types.js'; import { TypeRegistry } from '@polkadot/types'; import { TypeDefInfo } from '@polkadot/types-create'; import { assertReturn, compactAddLength, compactStripLength, isNumber, isObject, isString, logger, stringCamelCase, stringify, u8aConcat, u8aToHex } from '@polkadot/util'; -import { convertVersions, enumVersions } from './toLatest'; +import { convertVersions, enumVersions } from './toLatest.js'; const l = logger('Abi'); diff --git a/packages/api-contract/src/Abi/toLatest.spec.ts b/packages/api-contract/src/Abi/toLatest.spec.ts index d70415cb0a..db0b62d6e9 100644 --- a/packages/api-contract/src/Abi/toLatest.spec.ts +++ b/packages/api-contract/src/Abi/toLatest.spec.ts @@ -5,8 +5,8 @@ import { TypeRegistry } from '@polkadot/types'; -import abis from '../test/contracts'; -import { v0ToLatest, v1ToLatest, v2ToLatest, v3ToLatest, v4ToLatest } from './toLatest'; +import abis from '../test/contracts/index.js'; +import { v0ToLatest, v1ToLatest, v2ToLatest, v3ToLatest, v4ToLatest } from './toLatest.js'; describe('v0ToLatest', (): void => { const registry = new TypeRegistry(); diff --git a/packages/api-contract/src/Abi/toLatest.ts b/packages/api-contract/src/Abi/toLatest.ts index 901c088e73..babc38882d 100644 --- a/packages/api-contract/src/Abi/toLatest.ts +++ b/packages/api-contract/src/Abi/toLatest.ts @@ -4,10 +4,10 @@ import type { ContractMetadataLatest, ContractMetadataV4 } from '@polkadot/types/interfaces'; import type { Registry } from '@polkadot/types/types'; -import { v0ToV1 } from './toV1'; -import { v1ToV2 } from './toV2'; -import { v2ToV3 } from './toV3'; -import { v3ToV4 } from './toV4'; +import { v0ToV1 } from './toV1.js'; +import { v1ToV2 } from './toV2.js'; +import { v2ToV3 } from './toV3.js'; +import { v3ToV4 } from './toV4.js'; // The versions where an enum is used, aka V0 is missing // (Order from newest, i.e. we expect more on newest vs oldest) diff --git a/packages/api-contract/src/base/Base.ts b/packages/api-contract/src/base/Base.ts index 2ce70f194d..0f05beb754 100644 --- a/packages/api-contract/src/base/Base.ts +++ b/packages/api-contract/src/base/Base.ts @@ -8,7 +8,7 @@ import type { Registry } from '@polkadot/types/types'; import { ApiBase } from '@polkadot/api/base'; import { isFunction } from '@polkadot/util'; -import { Abi } from '../Abi'; +import { Abi } from '../Abi/index.js'; export abstract class Base { readonly abi: Abi; diff --git a/packages/api-contract/src/base/Blueprint.ts b/packages/api-contract/src/base/Blueprint.ts index 986519f0e7..cdd4fb80c0 100644 --- a/packages/api-contract/src/base/Blueprint.ts +++ b/packages/api-contract/src/base/Blueprint.ts @@ -5,18 +5,18 @@ import type { SubmittableExtrinsic } from '@polkadot/api/submittable/types'; import type { ApiTypes, DecorateMethod } from '@polkadot/api/types'; import type { AccountId, EventRecord, Hash } from '@polkadot/types/interfaces'; import type { ISubmittableResult } from '@polkadot/types/types'; -import type { AbiConstructor, BlueprintOptions } from '../types'; -import type { MapConstructorExec } from './types'; +import type { AbiConstructor, BlueprintOptions } from '../types.js'; +import type { MapConstructorExec } from './types.js'; import { SubmittableResult } from '@polkadot/api'; import { ApiBase } from '@polkadot/api/base'; import { BN_ZERO, isUndefined } from '@polkadot/util'; -import { Abi } from '../Abi'; -import { applyOnEvent } from '../util'; -import { Base } from './Base'; -import { Contract } from './Contract'; -import { convertWeight, createBluePrintTx, encodeSalt } from './util'; +import { Abi } from '../Abi/index.js'; +import { applyOnEvent } from '../util.js'; +import { Base } from './Base.js'; +import { Contract } from './Contract.js'; +import { convertWeight, createBluePrintTx, encodeSalt } from './util.js'; export interface BlueprintConstructor { new(api: ApiBase, abi: string | Record | Abi, codeHash: string | Hash | Uint8Array): Blueprint; diff --git a/packages/api-contract/src/base/Code.spec.ts b/packages/api-contract/src/base/Code.spec.ts index 64fbda13e0..4e1eb61d7f 100644 --- a/packages/api-contract/src/base/Code.spec.ts +++ b/packages/api-contract/src/base/Code.spec.ts @@ -12,8 +12,8 @@ import { toPromiseMethod } from '@polkadot/api'; import v0contractFlipper from '../test/contracts/ink/v0/flipper.contract.json' assert { type: 'json' }; import v0abiFlipper from '../test/contracts/ink/v0/flipper.json' assert { type: 'json' }; import v1contractFlipper from '../test/contracts/ink/v1/flipper.contract.json' assert { type: 'json' }; -import { Code } from './Code'; -import { mockApi } from './mock'; +import { Code } from './Code.js'; +import { mockApi } from './mock.js'; // FIXME When Jest is removed with ESM tests, this should be converted to use import.meta.url const v0wasmFlipper = fs.readFileSync(path.join(process.cwd(), 'packages/api-contract/src/test/contracts/ink/v0/flipper.wasm'), 'utf-8'); diff --git a/packages/api-contract/src/base/Code.ts b/packages/api-contract/src/base/Code.ts index 1dc5c29330..171e2864ec 100644 --- a/packages/api-contract/src/base/Code.ts +++ b/packages/api-contract/src/base/Code.ts @@ -6,19 +6,19 @@ import type { ApiTypes, DecorateMethod } from '@polkadot/api/types'; import type { AccountId, EventRecord } from '@polkadot/types/interfaces'; import type { ISubmittableResult } from '@polkadot/types/types'; import type { Codec } from '@polkadot/types-codec/types'; -import type { AbiConstructor, BlueprintOptions } from '../types'; -import type { MapConstructorExec } from './types'; +import type { AbiConstructor, BlueprintOptions } from '../types.js'; +import type { MapConstructorExec } from './types.js'; import { SubmittableResult } from '@polkadot/api'; import { ApiBase } from '@polkadot/api/base'; import { BN_ZERO, compactAddLength, isUndefined, isWasm, u8aToU8a } from '@polkadot/util'; -import { Abi } from '../Abi'; -import { applyOnEvent } from '../util'; -import { Base } from './Base'; -import { Blueprint } from './Blueprint'; -import { Contract } from './Contract'; -import { convertWeight, createBluePrintTx, encodeSalt } from './util'; +import { Abi } from '../Abi/index.js'; +import { applyOnEvent } from '../util.js'; +import { Base } from './Base.js'; +import { Blueprint } from './Blueprint.js'; +import { Contract } from './Contract.js'; +import { convertWeight, createBluePrintTx, encodeSalt } from './util.js'; export interface CodeConstructor { new(api: ApiBase, abi: string | Record | Abi, wasm: Uint8Array | string | Buffer | null | undefined): Code; diff --git a/packages/api-contract/src/base/Contract.ts b/packages/api-contract/src/base/Contract.ts index 169aca0aac..48580dc54a 100644 --- a/packages/api-contract/src/base/Contract.ts +++ b/packages/api-contract/src/base/Contract.ts @@ -6,8 +6,8 @@ import type { ApiTypes, DecorateMethod } from '@polkadot/api/types'; import type { Bytes } from '@polkadot/types'; import type { AccountId, ContractExecResult, EventRecord, Weight, WeightV2 } from '@polkadot/types/interfaces'; import type { ISubmittableResult } from '@polkadot/types/types'; -import type { AbiMessage, ContractCallOutcome, ContractOptions, DecodedEvent, WeightAll } from '../types'; -import type { ContractCallResult, ContractCallSend, ContractQuery, ContractTx, MapMessageQuery, MapMessageTx } from './types'; +import type { AbiMessage, ContractCallOutcome, ContractOptions, DecodedEvent, WeightAll } from '../types.js'; +import type { ContractCallResult, ContractCallSend, ContractQuery, ContractTx, MapMessageQuery, MapMessageTx } from './types.js'; import { map } from 'rxjs'; @@ -15,10 +15,10 @@ import { SubmittableResult } from '@polkadot/api'; import { ApiBase } from '@polkadot/api/base'; import { BN, BN_HUNDRED, BN_ONE, BN_ZERO, isUndefined, logger } from '@polkadot/util'; -import { Abi } from '../Abi'; -import { applyOnEvent } from '../util'; -import { Base } from './Base'; -import { convertWeight, withMeta } from './util'; +import { Abi } from '../Abi/index.js'; +import { applyOnEvent } from '../util.js'; +import { Base } from './Base.js'; +import { convertWeight, withMeta } from './util.js'; export interface ContractConstructor { new(api: ApiBase, abi: string | Record | Abi, address: string | AccountId): Contract; diff --git a/packages/api-contract/src/base/index.ts b/packages/api-contract/src/base/index.ts index 1af1e5e9fb..26b9c43386 100644 --- a/packages/api-contract/src/base/index.ts +++ b/packages/api-contract/src/base/index.ts @@ -1,6 +1,6 @@ // Copyright 2017-2023 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -export { Blueprint, BlueprintSubmittableResult, extendBlueprint } from './Blueprint'; -export { Code, CodeSubmittableResult, extendCode } from './Code'; -export { Contract, extendContract } from './Contract'; +export { Blueprint, BlueprintSubmittableResult, extendBlueprint } from './Blueprint.js'; +export { Code, CodeSubmittableResult, extendCode } from './Code.js'; +export { Contract, extendContract } from './Contract.js'; diff --git a/packages/api-contract/src/base/types.ts b/packages/api-contract/src/base/types.ts index e8534ac7e1..c6d7321768 100644 --- a/packages/api-contract/src/base/types.ts +++ b/packages/api-contract/src/base/types.ts @@ -5,7 +5,7 @@ import type { Observable } from 'rxjs'; import type { SubmittableExtrinsic } from '@polkadot/api/submittable/types'; import type { ApiTypes, ObsInnerType } from '@polkadot/api/types'; import type { AccountId } from '@polkadot/types/interfaces'; -import type { AbiMessage, BlueprintOptions, ContractCallOutcome, ContractOptions } from '../types'; +import type { AbiMessage, BlueprintOptions, ContractCallOutcome, ContractOptions } from '../types.js'; export interface MessageMeta { readonly meta: AbiMessage; diff --git a/packages/api-contract/src/base/util.ts b/packages/api-contract/src/base/util.ts index 480dcdb2ba..bb47d958fd 100644 --- a/packages/api-contract/src/base/util.ts +++ b/packages/api-contract/src/base/util.ts @@ -6,8 +6,8 @@ import type { SubmittableExtrinsic } from '@polkadot/api/submittable/types'; import type { ApiTypes } from '@polkadot/api/types'; import type { WeightV1, WeightV2 } from '@polkadot/types/interfaces'; import type { BN } from '@polkadot/util'; -import type { AbiConstructor, AbiMessage, BlueprintOptions, WeightAll } from '../types'; -import type { BlueprintDeploy, ContractGeneric } from './types'; +import type { AbiConstructor, AbiMessage, BlueprintOptions, WeightAll } from '../types.js'; +import type { BlueprintDeploy, ContractGeneric } from './types.js'; import { Bytes } from '@polkadot/types'; import { bnToBn, compactAddLength, u8aToU8a } from '@polkadot/util'; diff --git a/packages/api-contract/src/bundle.ts b/packages/api-contract/src/bundle.ts index 94c90e223c..88a2a1b7ed 100644 --- a/packages/api-contract/src/bundle.ts +++ b/packages/api-contract/src/bundle.ts @@ -1,8 +1,8 @@ // Copyright 2017-2023 @polkadot/api-contract authors & contributors // SPDX-License-Identifier: Apache-2.0 -export { Abi } from './Abi'; -export { packageInfo } from './packageInfo'; +export { Abi } from './Abi/index.js'; +export { packageInfo } from './packageInfo.js'; -export * from './promise'; -export * from './rx'; +export * from './promise/index.js'; +export * from './rx/index.js'; diff --git a/packages/api-contract/src/detectPackage.ts b/packages/api-contract/src/detectPackage.ts index adbbf14e9f..7b7554aaf6 100644 --- a/packages/api-contract/src/detectPackage.ts +++ b/packages/api-contract/src/detectPackage.ts @@ -5,7 +5,7 @@ import { detectPackage } from '@polkadot/util'; -import others from './detectOther'; -import { packageInfo } from './packageInfo'; +import others from './detectOther.js'; +import { packageInfo } from './packageInfo.js'; detectPackage(packageInfo, null, others); diff --git a/packages/api-contract/src/index.ts b/packages/api-contract/src/index.ts index cc88b0c238..d99938929e 100644 --- a/packages/api-contract/src/index.ts +++ b/packages/api-contract/src/index.ts @@ -1,6 +1,6 @@ // Copyright 2017-2023 @polkadot/api-contract authors & contributors // SPDX-License-Identifier: Apache-2.0 -import './detectPackage'; +import './detectPackage.js'; -export * from './bundle'; +export * from './bundle.js'; diff --git a/packages/api-contract/src/mod.ts b/packages/api-contract/src/mod.ts index a998b5af20..8cd6f983a3 100644 --- a/packages/api-contract/src/mod.ts +++ b/packages/api-contract/src/mod.ts @@ -1,4 +1,4 @@ // Copyright 2017-2023 @polkadot/api-contract authors & contributors // SPDX-License-Identifier: Apache-2.0 -export * from './index'; +export * from './index.js'; diff --git a/packages/api-contract/src/promise/index.ts b/packages/api-contract/src/promise/index.ts index f8a268dd65..7ab4f1de33 100644 --- a/packages/api-contract/src/promise/index.ts +++ b/packages/api-contract/src/promise/index.ts @@ -5,8 +5,8 @@ import type { AccountId, Hash } from '@polkadot/types/interfaces'; import { ApiPromise, toPromiseMethod } from '@polkadot/api'; -import { Abi } from '../Abi'; -import { Blueprint, Code, Contract } from '../base'; +import { Abi } from '../Abi/index.js'; +import { Blueprint, Code, Contract } from '../base/index.js'; export class BlueprintPromise extends Blueprint<'promise'> { constructor (api: ApiPromise, abi: string | Record | Abi, codeHash: string | Hash) { diff --git a/packages/api-contract/src/rx/index.ts b/packages/api-contract/src/rx/index.ts index ae94ea29a7..e657c2b93f 100644 --- a/packages/api-contract/src/rx/index.ts +++ b/packages/api-contract/src/rx/index.ts @@ -5,8 +5,8 @@ import type { AccountId, Hash } from '@polkadot/types/interfaces'; import { ApiRx, toRxMethod } from '@polkadot/api'; -import { Abi } from '../Abi'; -import { Blueprint, Code, Contract } from '../base'; +import { Abi } from '../Abi/index.js'; +import { Blueprint, Code, Contract } from '../base/index.js'; export class BlueprintRx extends Blueprint<'rxjs'> { constructor (api: ApiRx, abi: string | Record | Abi, codeHash: string | Hash) { diff --git a/packages/api-contract/src/test/contracts/index.ts b/packages/api-contract/src/test/contracts/index.ts index 12c5067b5a..585ec0e5a8 100644 --- a/packages/api-contract/src/test/contracts/index.ts +++ b/packages/api-contract/src/test/contracts/index.ts @@ -1,9 +1,9 @@ // Copyright 2017-2023 @polkadot/api-contract authors & contributors // SPDX-License-Identifier: Apache-2.0 -import ink from './ink'; -import solang from './solang'; -import user from './user'; +import ink from './ink/index.js'; +import solang from './solang/index.js'; +import user from './user/index.js'; const all: Record> = {}; diff --git a/packages/api-contract/src/test/contracts/ink/index.ts b/packages/api-contract/src/test/contracts/ink/index.ts index 709086383d..080f702ef7 100644 --- a/packages/api-contract/src/test/contracts/ink/index.ts +++ b/packages/api-contract/src/test/contracts/ink/index.ts @@ -1,11 +1,11 @@ // Copyright 2017-2023 @polkadot/api-contract authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { createVersionedExport } from '../util'; -import * as v0 from './v0'; -import * as v1 from './v1'; -import * as v2 from './v2'; -import * as v3 from './v3'; -import * as v4 from './v4'; +import { createVersionedExport } from '../util.js'; +import * as v0 from './v0/index.js'; +import * as v1 from './v1/index.js'; +import * as v2 from './v2/index.js'; +import * as v3 from './v3/index.js'; +import * as v4 from './v4/index.js'; export default createVersionedExport({ v0, v1, v2, v3, v4 }); diff --git a/packages/api-contract/src/test/contracts/solang/index.ts b/packages/api-contract/src/test/contracts/solang/index.ts index e1c637677a..b9f5665a29 100644 --- a/packages/api-contract/src/test/contracts/solang/index.ts +++ b/packages/api-contract/src/test/contracts/solang/index.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/api-contract authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { createVersionedExport } from '../util'; -import * as v0 from './v0'; +import { createVersionedExport } from '../util.js'; +import * as v0 from './v0/index.js'; export default createVersionedExport({ v0 }); diff --git a/packages/api-contract/src/test/contracts/user/index.ts b/packages/api-contract/src/test/contracts/user/index.ts index 0b517bb1bc..f09ee181fe 100644 --- a/packages/api-contract/src/test/contracts/user/index.ts +++ b/packages/api-contract/src/test/contracts/user/index.ts @@ -1,8 +1,8 @@ // Copyright 2017-2023 @polkadot/api-contract authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { createVersionedExport } from '../util'; -import * as v0 from './v0'; -import * as v3 from './v3'; +import { createVersionedExport } from '../util.js'; +import * as v0 from './v0/index.js'; +import * as v3 from './v3/index.js'; export default createVersionedExport({ v0, v3 }); diff --git a/packages/api-contract/src/types.ts b/packages/api-contract/src/types.ts index 3212a3807e..8dde40023f 100644 --- a/packages/api-contract/src/types.ts +++ b/packages/api-contract/src/types.ts @@ -7,7 +7,7 @@ import type { Text } from '@polkadot/types'; import type { ContractExecResultResult, ContractSelector, StorageDeposit, Weight, WeightV2 } from '@polkadot/types/interfaces'; import type { Codec, TypeDef } from '@polkadot/types/types'; import type { BN } from '@polkadot/util'; -import type { Abi } from '.'; +import type { Abi } from './index.js'; export interface ContractBase { readonly abi: Abi; diff --git a/packages/api-derive/src/accounts/accountId.ts b/packages/api-derive/src/accounts/accountId.ts index 00832f3347..d39ab47268 100644 --- a/packages/api-derive/src/accounts/accountId.ts +++ b/packages/api-derive/src/accounts/accountId.ts @@ -3,14 +3,14 @@ import type { Observable } from 'rxjs'; import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; -import type { DeriveApi } from '../types'; +import type { DeriveApi } from '../types.js'; import { map, of } from 'rxjs'; import { assertReturn, isU8a } from '@polkadot/util'; import { decodeAddress } from '@polkadot/util-crypto'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; /** * @name accountId diff --git a/packages/api-derive/src/accounts/flags.ts b/packages/api-derive/src/accounts/flags.ts index e47056c9ca..668dd0a084 100644 --- a/packages/api-derive/src/accounts/flags.ts +++ b/packages/api-derive/src/accounts/flags.ts @@ -6,13 +6,13 @@ import type { AccountId, Address, Balance } from '@polkadot/types/interfaces'; import type{ PalletElectionsPhragmenSeatHolder } from '@polkadot/types/lookup'; import type { Codec } from '@polkadot/types/types'; import type { Option } from '@polkadot/types-codec'; -import type { DeriveAccountFlags, DeriveApi } from '../types'; +import type { DeriveAccountFlags, DeriveApi } from '../types.js'; import { map, of } from 'rxjs'; import { isFunction } from '@polkadot/util'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; type FlagsIntermediate = [ PalletElectionsPhragmenSeatHolder[] | [AccountId, Balance][] | undefined, diff --git a/packages/api-derive/src/accounts/idAndIndex.ts b/packages/api-derive/src/accounts/idAndIndex.ts index 774ec5df4d..876c593b9d 100644 --- a/packages/api-derive/src/accounts/idAndIndex.ts +++ b/packages/api-derive/src/accounts/idAndIndex.ts @@ -3,14 +3,14 @@ import type { Observable } from 'rxjs'; import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; -import type { AccountIdAndIndex, DeriveApi } from '../types'; +import type { AccountIdAndIndex, DeriveApi } from '../types.js'; import { map, of } from 'rxjs'; import { isU8a } from '@polkadot/util'; import { decodeAddress } from '@polkadot/util-crypto'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; /** * @name idAndIndex diff --git a/packages/api-derive/src/accounts/idToIndex.ts b/packages/api-derive/src/accounts/idToIndex.ts index 3aa71a5b9a..e54f9dbe94 100644 --- a/packages/api-derive/src/accounts/idToIndex.ts +++ b/packages/api-derive/src/accounts/idToIndex.ts @@ -3,11 +3,11 @@ import type { Observable } from 'rxjs'; import type { AccountId, AccountIndex } from '@polkadot/types/interfaces'; -import type { AccountIndexes, DeriveApi } from '../types'; +import type { AccountIndexes, DeriveApi } from '../types.js'; import { map } from 'rxjs'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; /** * @name idToIndex diff --git a/packages/api-derive/src/accounts/identity.ts b/packages/api-derive/src/accounts/identity.ts index 79ab42c2ab..8ef8e211c8 100644 --- a/packages/api-derive/src/accounts/identity.ts +++ b/packages/api-derive/src/accounts/identity.ts @@ -7,13 +7,13 @@ import type { AccountId } from '@polkadot/types/interfaces'; import type { PalletIdentityIdentityInfo, PalletIdentityRegistration } from '@polkadot/types/lookup'; import type { Option } from '@polkadot/types-codec'; import type { ITuple } from '@polkadot/types-codec/types'; -import type { DeriveAccountRegistration, DeriveApi, DeriveHasIdentity } from '../types'; +import type { DeriveAccountRegistration, DeriveApi, DeriveHasIdentity } from '../types.js'; import { combineLatest, map, of, switchMap } from 'rxjs'; import { isHex, u8aToString } from '@polkadot/util'; -import { firstMemo, memo } from '../util'; +import { firstMemo, memo } from '../util/index.js'; type IdentityInfoAdditional = PalletIdentityIdentityInfo['additional'][0]; diff --git a/packages/api-derive/src/accounts/index.ts b/packages/api-derive/src/accounts/index.ts index 7dc1272b0d..962ddd2cd1 100644 --- a/packages/api-derive/src/accounts/index.ts +++ b/packages/api-derive/src/accounts/index.ts @@ -1,11 +1,11 @@ // Copyright 2017-2023 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -export * from './accountId'; -export * from './flags'; -export * from './idAndIndex'; -export * from './idToIndex'; -export * from './identity'; -export * from './indexToId'; -export * from './indexes'; -export * from './info'; +export * from './accountId.js'; +export * from './flags.js'; +export * from './idAndIndex.js'; +export * from './idToIndex.js'; +export * from './identity.js'; +export * from './indexToId.js'; +export * from './indexes.js'; +export * from './info.js'; diff --git a/packages/api-derive/src/accounts/indexToId.ts b/packages/api-derive/src/accounts/indexToId.ts index 1c7b14d9dd..165ce79fff 100644 --- a/packages/api-derive/src/accounts/indexToId.ts +++ b/packages/api-derive/src/accounts/indexToId.ts @@ -3,11 +3,11 @@ import type { Observable } from 'rxjs'; import type { AccountId, AccountIndex } from '@polkadot/types/interfaces'; -import type { DeriveApi } from '../types'; +import type { DeriveApi } from '../types.js'; import { map, of } from 'rxjs'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; /** * @name indexToId diff --git a/packages/api-derive/src/accounts/indexes.ts b/packages/api-derive/src/accounts/indexes.ts index 922df3343e..c15f3428d9 100644 --- a/packages/api-derive/src/accounts/indexes.ts +++ b/packages/api-derive/src/accounts/indexes.ts @@ -2,11 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { Observable } from 'rxjs'; -import type { AccountIndexes, DeriveApi } from '../types'; +import type { AccountIndexes, DeriveApi } from '../types.js'; import { map, of, startWith } from 'rxjs'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; let indicesCache: AccountIndexes | null = null; diff --git a/packages/api-derive/src/accounts/info.ts b/packages/api-derive/src/accounts/info.ts index 68adea961c..4bd40252af 100644 --- a/packages/api-derive/src/accounts/info.ts +++ b/packages/api-derive/src/accounts/info.ts @@ -5,13 +5,13 @@ import type { Observable } from 'rxjs'; import type { Bytes, Option, u32 } from '@polkadot/types'; import type { AccountId, AccountIndex, Address, Balance } from '@polkadot/types/interfaces'; import type { ITuple } from '@polkadot/types/types'; -import type { DeriveAccountInfo, DeriveAccountRegistration, DeriveApi } from '../types'; +import type { DeriveAccountInfo, DeriveAccountRegistration, DeriveApi } from '../types.js'; import { combineLatest, map, of, switchMap } from 'rxjs'; import { u8aToString } from '@polkadot/util'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; function retrieveNick (api: DeriveApi, accountId?: AccountId): Observable { return (( diff --git a/packages/api-derive/src/alliance/index.ts b/packages/api-derive/src/alliance/index.ts index 4a6b200150..bca35134ce 100644 --- a/packages/api-derive/src/alliance/index.ts +++ b/packages/api-derive/src/alliance/index.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { hasProposals as collectiveHasProposals, members as collectiveMembers, prime as collectivePrime, proposal as collectiveProposal, proposalCount as collectiveProposalCount, proposalHashes as collectiveProposalHashes, proposals as collectiveProposals } from '../collective'; +import { hasProposals as collectiveHasProposals, members as collectiveMembers, prime as collectivePrime, proposal as collectiveProposal, proposalCount as collectiveProposalCount, proposalHashes as collectiveProposalHashes, proposals as collectiveProposals } from '../collective/index.js'; export const members = collectiveMembers('allianceMotion'); diff --git a/packages/api-derive/src/bagsList/get.ts b/packages/api-derive/src/bagsList/get.ts index 0c9ba27e7f..70079fb2be 100644 --- a/packages/api-derive/src/bagsList/get.ts +++ b/packages/api-derive/src/bagsList/get.ts @@ -5,15 +5,15 @@ import type { Observable } from 'rxjs'; import type { Option, u64 } from '@polkadot/types'; import type { PalletBagsListListBag } from '@polkadot/types/lookup'; import type { BN } from '@polkadot/util'; -import type { DeriveApi } from '../types'; -import type { Bag } from './types'; +import type { DeriveApi } from '../types.js'; +import type { Bag } from './types.js'; import { map, of, switchMap } from 'rxjs'; import { BN_ZERO, bnToBn, objectSpread } from '@polkadot/util'; -import { memo } from '../util'; -import { getQueryInterface } from './util'; +import { memo } from '../util/index.js'; +import { getQueryInterface } from './util.js'; function orderBags (ids: BN[], bags: Option[]): Bag[] { const sorted = ids diff --git a/packages/api-derive/src/bagsList/getExpanded.ts b/packages/api-derive/src/bagsList/getExpanded.ts index 8b32408939..6034bb0a16 100644 --- a/packages/api-derive/src/bagsList/getExpanded.ts +++ b/packages/api-derive/src/bagsList/getExpanded.ts @@ -3,14 +3,14 @@ import type { Observable } from 'rxjs'; import type { BN } from '@polkadot/util'; -import type { DeriveApi } from '../types'; -import type { Bag, BagExpanded } from './types'; +import type { DeriveApi } from '../types.js'; +import type { Bag, BagExpanded } from './types.js'; import { map, switchMap } from 'rxjs'; import { objectSpread } from '@polkadot/util'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; export function expand (instanceId: string, api: DeriveApi): (bag: Bag) => Observable { return memo(instanceId, (bag: Bag): Observable => diff --git a/packages/api-derive/src/bagsList/index.ts b/packages/api-derive/src/bagsList/index.ts index 5b7e8b4b3b..07cdf6aaa3 100644 --- a/packages/api-derive/src/bagsList/index.ts +++ b/packages/api-derive/src/bagsList/index.ts @@ -1,6 +1,6 @@ // Copyright 2017-2023 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -export * from './get'; -export * from './getExpanded'; -export * from './listNodes'; +export * from './get.js'; +export * from './getExpanded.js'; +export * from './listNodes.js'; diff --git a/packages/api-derive/src/bagsList/listNodes.ts b/packages/api-derive/src/bagsList/listNodes.ts index f534239cde..3cce904470 100644 --- a/packages/api-derive/src/bagsList/listNodes.ts +++ b/packages/api-derive/src/bagsList/listNodes.ts @@ -5,14 +5,14 @@ import type { Observable } from 'rxjs'; import type { Option } from '@polkadot/types'; import type { AccountId32 } from '@polkadot/types/interfaces'; import type { PalletBagsListListBag, PalletBagsListListNode } from '@polkadot/types/lookup'; -import type { DeriveApi } from '../types'; +import type { DeriveApi } from '../types.js'; import { BehaviorSubject, map, of, switchMap, tap, toArray } from 'rxjs'; import { nextTick } from '@polkadot/util'; -import { memo } from '../util'; -import { getQueryInterface } from './util'; +import { memo } from '../util/index.js'; +import { getQueryInterface } from './util.js'; function traverseLinks (api: DeriveApi, head: AccountId32 | string): Observable { const subject = new BehaviorSubject(head); diff --git a/packages/api-derive/src/bagsList/util.ts b/packages/api-derive/src/bagsList/util.ts index b29d1a8a99..303a5b900b 100644 --- a/packages/api-derive/src/bagsList/util.ts +++ b/packages/api-derive/src/bagsList/util.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { QueryableStorage } from '@polkadot/api-base/types'; -import type { DeriveApi } from '../types'; +import type { DeriveApi } from '../types.js'; export function getQueryInterface (api: DeriveApi): QueryableStorage<'rxjs'>['voterBagsList'] { return ( diff --git a/packages/api-derive/src/balances/account.ts b/packages/api-derive/src/balances/account.ts index 2f39ea7e32..e99b8b0341 100644 --- a/packages/api-derive/src/balances/account.ts +++ b/packages/api-derive/src/balances/account.ts @@ -5,13 +5,13 @@ import type { Observable } from 'rxjs'; import type { QueryableStorageEntry } from '@polkadot/api-base/types'; import type { AccountData, AccountId, AccountIndex, AccountInfo, Address, Balance, Index } from '@polkadot/types/interfaces'; import type { ITuple } from '@polkadot/types/types'; -import type { DeriveApi, DeriveBalancesAccount, DeriveBalancesAccountData } from '../types'; +import type { DeriveApi, DeriveBalancesAccount, DeriveBalancesAccountData } from '../types.js'; import { combineLatest, map, of, switchMap } from 'rxjs'; import { isFunction, objectSpread } from '@polkadot/util'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; type BalanceResult = [Balance, Balance, Balance, Balance]; diff --git a/packages/api-derive/src/balances/all.ts b/packages/api-derive/src/balances/all.ts index 461883e6db..2cce71f812 100644 --- a/packages/api-derive/src/balances/all.ts +++ b/packages/api-derive/src/balances/all.ts @@ -5,13 +5,13 @@ import type { Observable } from 'rxjs'; import type { Option, Vec } from '@polkadot/types'; import type { AccountId, Balance, BalanceLockTo212, BlockNumber, VestingSchedule } from '@polkadot/types/interfaces'; import type { PalletBalancesBalanceLock, PalletBalancesReserveData, PalletVestingVestingInfo } from '@polkadot/types/lookup'; -import type { DeriveApi, DeriveBalancesAccount, DeriveBalancesAccountData, DeriveBalancesAll, DeriveBalancesAllAccountData, DeriveBalancesAllVesting } from '../types'; +import type { DeriveApi, DeriveBalancesAccount, DeriveBalancesAccountData, DeriveBalancesAll, DeriveBalancesAllAccountData, DeriveBalancesAllVesting } from '../types.js'; import { combineLatest, map, of, switchMap } from 'rxjs'; import { BN, BN_ZERO, bnMax, bnMin, isFunction, objectSpread } from '@polkadot/util'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; type ResultBalance = [PalletVestingVestingInfo[] | null, ((PalletBalancesBalanceLock | BalanceLockTo212)[])[], PalletBalancesReserveData[][]]; type Result = [DeriveBalancesAccount, ResultBalance, BlockNumber]; diff --git a/packages/api-derive/src/balances/index.ts b/packages/api-derive/src/balances/index.ts index 23f2e0621c..535d6f91ea 100644 --- a/packages/api-derive/src/balances/index.ts +++ b/packages/api-derive/src/balances/index.ts @@ -1,10 +1,10 @@ // Copyright 2017-2023 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { all } from './all'; +import { all } from './all.js'; -export * from './account'; -export * from './votingBalances'; +export * from './account.js'; +export * from './votingBalances.js'; const votingBalance = all; diff --git a/packages/api-derive/src/balances/votingBalances.ts b/packages/api-derive/src/balances/votingBalances.ts index afbc7e7da7..e67f3613b3 100644 --- a/packages/api-derive/src/balances/votingBalances.ts +++ b/packages/api-derive/src/balances/votingBalances.ts @@ -3,11 +3,11 @@ import type { Observable } from 'rxjs'; import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; -import type { DeriveApi, DeriveBalancesAccount } from '../types'; +import type { DeriveApi, DeriveBalancesAccount } from '../types.js'; import { combineLatest, of } from 'rxjs'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; export function votingBalances (instanceId: string, api: DeriveApi): (addresses?: (AccountId | AccountIndex | Address | string)[]) => Observable { return memo(instanceId, (addresses?: (AccountId | AccountIndex | Address | string)[]): Observable => diff --git a/packages/api-derive/src/bounties/bounties.spec.ts b/packages/api-derive/src/bounties/bounties.spec.ts index 54d0e97a64..63896d46c9 100644 --- a/packages/api-derive/src/bounties/bounties.spec.ts +++ b/packages/api-derive/src/bounties/bounties.spec.ts @@ -7,17 +7,17 @@ import type { SubmittableExtrinsic } from '@polkadot/api-base/types'; import type { Bytes, Option, StorageKey } from '@polkadot/types'; import type { Bounty, BountyIndex, Proposal, ProposalIndex } from '@polkadot/types/interfaces'; import type { Codec, InterfaceTypes } from '@polkadot/types/types'; -import type { DeriveApi, DeriveCollectiveProposal } from '../types'; +import type { DeriveApi, DeriveCollectiveProposal } from '../types.js'; import { firstValueFrom, of } from 'rxjs'; import { ApiPromise } from '@polkadot/api'; -import { BountyFactory } from '../test/bountyFactory'; -import { BytesFactory } from '../test/bytesFactory'; -import { createApiWithAugmentations } from '../test/helpers'; -import { ProposalFactory } from '../test/proposalFactory'; -import { bounties } from '.'; +import { BountyFactory } from '../test/bountyFactory.js'; +import { BytesFactory } from '../test/bytesFactory.js'; +import { createApiWithAugmentations } from '../test/helpers.js'; +import { ProposalFactory } from '../test/proposalFactory.js'; +import { bounties } from './index.js'; const DEFAULT_PROPOSER = '5C4hrfjw9DjXZTzV3MwzrrAr9P1MJhSrvWGWqi1eSuyUpnhM'; diff --git a/packages/api-derive/src/bounties/bounties.ts b/packages/api-derive/src/bounties/bounties.ts index 7fdba0e2a7..2bdf3cde6f 100644 --- a/packages/api-derive/src/bounties/bounties.ts +++ b/packages/api-derive/src/bounties/bounties.ts @@ -5,12 +5,12 @@ import type { Observable } from 'rxjs'; import type { Bytes, Option } from '@polkadot/types'; import type { BountyIndex } from '@polkadot/types/interfaces'; import type { PalletBountiesBounty } from '@polkadot/types/lookup'; -import type { DeriveApi, DeriveBounties, DeriveCollectiveProposal } from '../types'; +import type { DeriveApi, DeriveBounties, DeriveCollectiveProposal } from '../types.js'; import { combineLatest, map, of, switchMap } from 'rxjs'; -import { memo } from '../util'; -import { filterBountiesProposals } from './helpers/filterBountyProposals'; +import { memo } from '../util/index.js'; +import { filterBountiesProposals } from './helpers/filterBountyProposals.js'; type Result = [Option[], Option[], BountyIndex[], DeriveCollectiveProposal[]]; diff --git a/packages/api-derive/src/bounties/helpers/filterBountyProposals.ts b/packages/api-derive/src/bounties/helpers/filterBountyProposals.ts index d6d32128db..126e43d6bb 100644 --- a/packages/api-derive/src/bounties/helpers/filterBountyProposals.ts +++ b/packages/api-derive/src/bounties/helpers/filterBountyProposals.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveApi, DeriveCollectiveProposal } from '../../types'; +import type { DeriveApi, DeriveCollectiveProposal } from '../../types.js'; export function filterBountiesProposals (api: DeriveApi, allProposals: DeriveCollectiveProposal[]): DeriveCollectiveProposal[] { const bountyTxBase = api.tx.bounties ? api.tx.bounties : api.tx.treasury; diff --git a/packages/api-derive/src/bounties/index.ts b/packages/api-derive/src/bounties/index.ts index 1f6a00e1e5..11dbc6dd2a 100644 --- a/packages/api-derive/src/bounties/index.ts +++ b/packages/api-derive/src/bounties/index.ts @@ -1,4 +1,4 @@ // Copyright 2017-2023 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -export * from './bounties'; +export * from './bounties.js'; diff --git a/packages/api-derive/src/bundle.ts b/packages/api-derive/src/bundle.ts index dabd82dfc8..ac34e71fa4 100644 --- a/packages/api-derive/src/bundle.ts +++ b/packages/api-derive/src/bundle.ts @@ -4,13 +4,13 @@ import type { DeriveCustom } from '@polkadot/api-base/types'; import type { AnyFunction, AnyString } from '@polkadot/types/types'; import type { ExactDerive } from './derive'; -import type { DeriveApi } from './types'; +import type { DeriveApi } from './types.js'; -import { derive } from './derive'; -import { lazyDeriveSection } from './util'; +import { lazyDeriveSection } from './util/index.js'; +import { derive } from './derive.js'; -export * from './derive'; -export * from './type'; +export * from './derive.js'; +export * from './type/index.js'; interface Avail { instances: string[]; diff --git a/packages/api-derive/src/chain/bestNumber.ts b/packages/api-derive/src/chain/bestNumber.ts index 1e5027f8c5..a3f46990f2 100644 --- a/packages/api-derive/src/chain/bestNumber.ts +++ b/packages/api-derive/src/chain/bestNumber.ts @@ -1,9 +1,9 @@ // Copyright 2017-2023 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveApi } from '../types'; +import type { DeriveApi } from '../types.js'; -import { createBlockNumberDerive } from './util'; +import { createBlockNumberDerive } from './util.js'; /** * @name bestNumber diff --git a/packages/api-derive/src/chain/bestNumberFinalized.ts b/packages/api-derive/src/chain/bestNumberFinalized.ts index 4d002ef25b..4b5200e03b 100644 --- a/packages/api-derive/src/chain/bestNumberFinalized.ts +++ b/packages/api-derive/src/chain/bestNumberFinalized.ts @@ -1,9 +1,9 @@ // Copyright 2017-2023 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveApi } from '../types'; +import type { DeriveApi } from '../types.js'; -import { createBlockNumberDerive } from './util'; +import { createBlockNumberDerive } from './util.js'; /** * @name bestNumberFinalized diff --git a/packages/api-derive/src/chain/bestNumberLag.ts b/packages/api-derive/src/chain/bestNumberLag.ts index 6690a366cb..24ced8f9de 100644 --- a/packages/api-derive/src/chain/bestNumberLag.ts +++ b/packages/api-derive/src/chain/bestNumberLag.ts @@ -3,11 +3,11 @@ import type { Observable } from 'rxjs'; import type { BlockNumber } from '@polkadot/types/interfaces'; -import type { DeriveApi } from '../types'; +import type { DeriveApi } from '../types.js'; import { combineLatest, map } from 'rxjs'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; /** * @name bestNumberLag diff --git a/packages/api-derive/src/chain/getBlock.ts b/packages/api-derive/src/chain/getBlock.ts index 70049f5018..bb702bbf65 100644 --- a/packages/api-derive/src/chain/getBlock.ts +++ b/packages/api-derive/src/chain/getBlock.ts @@ -3,13 +3,13 @@ import type { Observable } from 'rxjs'; import type { SignedBlockExtended } from '../type/types'; -import type { DeriveApi } from '../types'; +import type { DeriveApi } from '../types.js'; import { combineLatest, map, of, switchMap } from 'rxjs'; -import { createSignedBlockExtended } from '../type'; -import { memo } from '../util'; -import { getAuthorDetails } from './util'; +import { createSignedBlockExtended } from '../type/index.js'; +import { memo } from '../util/index.js'; +import { getAuthorDetails } from './util.js'; /** * @name getBlock diff --git a/packages/api-derive/src/chain/getBlockByNumber.ts b/packages/api-derive/src/chain/getBlockByNumber.ts index 1f9e988003..bbd2c9e691 100644 --- a/packages/api-derive/src/chain/getBlockByNumber.ts +++ b/packages/api-derive/src/chain/getBlockByNumber.ts @@ -4,11 +4,11 @@ import type { Observable } from 'rxjs'; import type { AnyNumber } from '@polkadot/types/types'; import type { SignedBlockExtended } from '../type/types'; -import type { DeriveApi } from '../types'; +import type { DeriveApi } from '../types.js'; import { switchMap } from 'rxjs'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; export function getBlockByNumber (instanceId: string, api: DeriveApi): (blockNumber: AnyNumber) => Observable { return memo(instanceId, (blockNumber: AnyNumber): Observable => diff --git a/packages/api-derive/src/chain/getHeader.ts b/packages/api-derive/src/chain/getHeader.ts index 56bd1e5b55..1d9f39ab2c 100644 --- a/packages/api-derive/src/chain/getHeader.ts +++ b/packages/api-derive/src/chain/getHeader.ts @@ -3,13 +3,13 @@ import type { Observable } from 'rxjs'; import type { HeaderExtended } from '../type/types'; -import type { DeriveApi } from '../types'; +import type { DeriveApi } from '../types.js'; import { combineLatest, map, switchMap } from 'rxjs'; -import { createHeaderExtended } from '../type'; -import { memo } from '../util'; -import { getAuthorDetails } from './util'; +import { createHeaderExtended } from '../type/index.js'; +import { memo } from '../util/index.js'; +import { getAuthorDetails } from './util.js'; /** * @name getHeader diff --git a/packages/api-derive/src/chain/index.ts b/packages/api-derive/src/chain/index.ts index e0fa21985f..7927ee3bb1 100644 --- a/packages/api-derive/src/chain/index.ts +++ b/packages/api-derive/src/chain/index.ts @@ -1,12 +1,12 @@ // Copyright 2017-2023 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -export * from './bestNumber'; -export * from './bestNumberFinalized'; -export * from './bestNumberLag'; -export * from './getHeader'; -export * from './getBlock'; -export * from './getBlockByNumber'; -export * from './subscribeFinalizedHeads'; -export * from './subscribeNewBlocks'; -export * from './subscribeNewHeads'; +export * from './bestNumber.js'; +export * from './bestNumberFinalized.js'; +export * from './bestNumberLag.js'; +export * from './getHeader.js'; +export * from './getBlock.js'; +export * from './getBlockByNumber.js'; +export * from './subscribeFinalizedHeads.js'; +export * from './subscribeNewBlocks.js'; +export * from './subscribeNewHeads.js'; diff --git a/packages/api-derive/src/chain/subscribeFinalizedBlocks.ts b/packages/api-derive/src/chain/subscribeFinalizedBlocks.ts index ef6a099af1..ecf8fa6e17 100644 --- a/packages/api-derive/src/chain/subscribeFinalizedBlocks.ts +++ b/packages/api-derive/src/chain/subscribeFinalizedBlocks.ts @@ -3,11 +3,11 @@ import type { Observable } from 'rxjs'; import type { SignedBlockExtended } from '../type/types'; -import type { DeriveApi } from '../types'; +import type { DeriveApi } from '../types.js'; import { switchMap } from 'rxjs'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; /** * @name subscribeFinalizedBlocks diff --git a/packages/api-derive/src/chain/subscribeFinalizedHeads.ts b/packages/api-derive/src/chain/subscribeFinalizedHeads.ts index d7f03d7dc4..706d354cb6 100644 --- a/packages/api-derive/src/chain/subscribeFinalizedHeads.ts +++ b/packages/api-derive/src/chain/subscribeFinalizedHeads.ts @@ -3,11 +3,11 @@ import type { Observable } from 'rxjs'; import type { Hash, Header } from '@polkadot/types/interfaces'; -import type { DeriveApi } from '../types'; +import type { DeriveApi } from '../types.js'; import { from, of, switchMap } from 'rxjs'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; /** * Returns a header range from startHash to to (not including) endHash, i.e. lastBlock.parentHash === endHash diff --git a/packages/api-derive/src/chain/subscribeNewBlocks.ts b/packages/api-derive/src/chain/subscribeNewBlocks.ts index 43047f057c..9da87451c1 100644 --- a/packages/api-derive/src/chain/subscribeNewBlocks.ts +++ b/packages/api-derive/src/chain/subscribeNewBlocks.ts @@ -3,11 +3,11 @@ import type { Observable } from 'rxjs'; import type { SignedBlockExtended } from '../type/types'; -import type { DeriveApi } from '../types'; +import type { DeriveApi } from '../types.js'; import { switchMap } from 'rxjs'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; /** * @name subscribeNewBlocks diff --git a/packages/api-derive/src/chain/subscribeNewHeads.ts b/packages/api-derive/src/chain/subscribeNewHeads.ts index 290d457945..53ef93b142 100644 --- a/packages/api-derive/src/chain/subscribeNewHeads.ts +++ b/packages/api-derive/src/chain/subscribeNewHeads.ts @@ -3,13 +3,13 @@ import type { Observable } from 'rxjs'; import type { HeaderExtended } from '../type/types'; -import type { DeriveApi } from '../types'; +import type { DeriveApi } from '../types.js'; import { combineLatest, map, of, switchMap } from 'rxjs'; -import { createHeaderExtended } from '../type'; -import { memo } from '../util'; -import { getAuthorDetails } from './util'; +import { createHeaderExtended } from '../type/index.js'; +import { memo } from '../util/index.js'; +import { getAuthorDetails } from './util.js'; /** * @name subscribeNewHeads diff --git a/packages/api-derive/src/chain/util.ts b/packages/api-derive/src/chain/util.ts index fde7f628a6..82d21fb340 100644 --- a/packages/api-derive/src/chain/util.ts +++ b/packages/api-derive/src/chain/util.ts @@ -6,11 +6,11 @@ import type { QueryableStorage } from '@polkadot/api-base/types'; import type { Compact, Vec } from '@polkadot/types'; import type { AccountId, BlockNumber, Header } from '@polkadot/types/interfaces'; import type { Codec, IOption } from '@polkadot/types/types'; -import type { DeriveApi } from '../types'; +import type { DeriveApi } from '../types.js'; import { combineLatest, map, of } from 'rxjs'; -import { memo, unwrapBlockNumber } from '../util'; +import { memo, unwrapBlockNumber } from '../util/index.js'; // re-export these - since these needs to be resolvable from api-derive, i.e. without this // we would emit code with ..//src embedded in the *.d.ts files diff --git a/packages/api-derive/src/checkTypes.manual.ts b/packages/api-derive/src/checkTypes.manual.ts index 5101cfb5ff..0d025e5fac 100644 --- a/packages/api-derive/src/checkTypes.manual.ts +++ b/packages/api-derive/src/checkTypes.manual.ts @@ -3,6 +3,6 @@ import '@polkadot/api-augment'; -import { derive } from '.'; +import { derive } from './index.js'; console.log(derive.chain.bestNumber); diff --git a/packages/api-derive/src/collective/helpers.ts b/packages/api-derive/src/collective/helpers.ts index 6e44973295..3cd1214577 100644 --- a/packages/api-derive/src/collective/helpers.ts +++ b/packages/api-derive/src/collective/helpers.ts @@ -2,14 +2,14 @@ // SPDX-License-Identifier: Apache-2.0 import type { Observable } from 'rxjs'; -import type { DeriveApi } from '../types'; -import type { Collective } from './types'; +import type { DeriveApi } from '../types.js'; +import type { Collective } from './types.js'; import { of } from 'rxjs'; import { isFunction } from '@polkadot/util'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; export function getInstance (api: DeriveApi, section: string): DeriveApi['query']['council'] { const instances = api.registry.getModuleInstances(api.runtimeVersion.specName, section); diff --git a/packages/api-derive/src/collective/index.ts b/packages/api-derive/src/collective/index.ts index fabbad3c00..a82f397aa5 100644 --- a/packages/api-derive/src/collective/index.ts +++ b/packages/api-derive/src/collective/index.ts @@ -1,6 +1,6 @@ // Copyright 2017-2023 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -export * from './members'; -export * from './prime'; -export * from './proposals'; +export * from './members.js'; +export * from './prime.js'; +export * from './proposals.js'; diff --git a/packages/api-derive/src/collective/members.ts b/packages/api-derive/src/collective/members.ts index 0a279c8a47..4ba65c3066 100644 --- a/packages/api-derive/src/collective/members.ts +++ b/packages/api-derive/src/collective/members.ts @@ -3,7 +3,7 @@ import type { AccountId } from '@polkadot/types/interfaces'; -import { callMethod } from './helpers'; +import { callMethod } from './helpers.js'; // We are re-exporting these from here to ensure that *.d.ts generation is correct export type { AccountId } from '@polkadot/types/interfaces'; diff --git a/packages/api-derive/src/collective/prime.ts b/packages/api-derive/src/collective/prime.ts index 4efee52de6..2cb0459408 100644 --- a/packages/api-derive/src/collective/prime.ts +++ b/packages/api-derive/src/collective/prime.ts @@ -3,14 +3,14 @@ import type { Observable } from 'rxjs'; import type { AccountId } from '@polkadot/types/interfaces'; -import type { DeriveApi } from '../types'; -import type { Collective } from './types'; +import type { DeriveApi } from '../types.js'; +import type { Collective } from './types.js'; import { map, of } from 'rxjs'; import { isFunction } from '@polkadot/util'; -import { withSection } from './helpers'; +import { withSection } from './helpers.js'; // We are re-exporting these from here to ensure that *.d.ts generation is correct export type { AccountId } from '@polkadot/types/interfaces'; diff --git a/packages/api-derive/src/collective/proposals.ts b/packages/api-derive/src/collective/proposals.ts index 19b650646c..bd7fcbaf1e 100644 --- a/packages/api-derive/src/collective/proposals.ts +++ b/packages/api-derive/src/collective/proposals.ts @@ -4,15 +4,15 @@ import type { Observable } from 'rxjs'; import type { Option, u32 } from '@polkadot/types'; import type { Hash, Proposal, Votes } from '@polkadot/types/interfaces'; -import type { DeriveApi, DeriveCollectiveProposal } from '../types'; -import type { Collective } from './types'; +import type { DeriveApi, DeriveCollectiveProposal } from '../types.js'; +import type { Collective } from './types.js'; import { catchError, combineLatest, map, of, switchMap } from 'rxjs'; import { isFunction } from '@polkadot/util'; -import { firstObservable } from '../util'; -import { callMethod, withSection } from './helpers'; +import { firstObservable } from '../util/index.js'; +import { callMethod, withSection } from './helpers.js'; // We are re-exporting these from here to ensure that *.d.ts generation is correct export type { Option, u32 } from '@polkadot/types'; diff --git a/packages/api-derive/src/contracts/fees.ts b/packages/api-derive/src/contracts/fees.ts index 2d455159a4..65e352a416 100644 --- a/packages/api-derive/src/contracts/fees.ts +++ b/packages/api-derive/src/contracts/fees.ts @@ -3,11 +3,11 @@ import type { Observable } from 'rxjs'; import type { BN } from '@polkadot/util'; -import type { DeriveApi, DeriveContractFees } from '../types'; +import type { DeriveApi, DeriveContractFees } from '../types.js'; import { map, of } from 'rxjs'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; type ResultV2 = [BN, BN, BN, BN, BN, BN, BN, BN, BN, BN]; diff --git a/packages/api-derive/src/contracts/index.ts b/packages/api-derive/src/contracts/index.ts index 1af583c252..aaf6e4aa1c 100644 --- a/packages/api-derive/src/contracts/index.ts +++ b/packages/api-derive/src/contracts/index.ts @@ -1,4 +1,4 @@ // Copyright 2017-2023 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -export * from './fees'; +export * from './fees.js'; diff --git a/packages/api-derive/src/council/index.ts b/packages/api-derive/src/council/index.ts index ee4621ab29..be67c374f2 100644 --- a/packages/api-derive/src/council/index.ts +++ b/packages/api-derive/src/council/index.ts @@ -1,10 +1,10 @@ // Copyright 2017-2023 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { hasProposals as collectiveHasProposals, members as collectiveMembers, prime as collectivePrime, proposal as collectiveProposal, proposalCount as collectiveProposalCount, proposalHashes as collectiveProposalHashes, proposals as collectiveProposals } from '../collective'; +import { hasProposals as collectiveHasProposals, members as collectiveMembers, prime as collectivePrime, proposal as collectiveProposal, proposalCount as collectiveProposalCount, proposalHashes as collectiveProposalHashes, proposals as collectiveProposals } from '../collective/index.js'; -export * from './votes'; -export * from './votesOf'; +export * from './votes.js'; +export * from './votesOf.js'; export const members = collectiveMembers('council'); diff --git a/packages/api-derive/src/council/votes.ts b/packages/api-derive/src/council/votes.ts index d1ce962360..da4692b131 100644 --- a/packages/api-derive/src/council/votes.ts +++ b/packages/api-derive/src/council/votes.ts @@ -7,11 +7,11 @@ import type { Vec } from '@polkadot/types'; import type { AccountId, Balance } from '@polkadot/types/interfaces'; import type { PalletElectionsPhragmenVoter } from '@polkadot/types/lookup'; import type { ITuple } from '@polkadot/types/types'; -import type { DeriveApi, DeriveCouncilVote, DeriveCouncilVotes } from '../types'; +import type { DeriveApi, DeriveCouncilVote, DeriveCouncilVotes } from '../types.js'; import { combineLatest, map, of } from 'rxjs'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; // Voter is current tuple is 2.x-era type VoteEntry = PalletElectionsPhragmenVoter | ITuple<[Balance, Vec]>; diff --git a/packages/api-derive/src/council/votesOf.ts b/packages/api-derive/src/council/votesOf.ts index f050e8ec0a..ed76e52a01 100644 --- a/packages/api-derive/src/council/votesOf.ts +++ b/packages/api-derive/src/council/votesOf.ts @@ -3,11 +3,11 @@ import type { Observable } from 'rxjs'; import type { AccountId } from '@polkadot/types/interfaces'; -import type { DeriveApi, DeriveCouncilVote } from '../types'; +import type { DeriveApi, DeriveCouncilVote } from '../types.js'; import { map } from 'rxjs'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; export function votesOf (instanceId: string, api: DeriveApi): (accountId: string | Uint8Array | AccountId) => Observable { return memo(instanceId, (accountId: string | Uint8Array | AccountId): Observable => diff --git a/packages/api-derive/src/crowdloan/childKey.ts b/packages/api-derive/src/crowdloan/childKey.ts index b164ee5a8c..180bd22099 100644 --- a/packages/api-derive/src/crowdloan/childKey.ts +++ b/packages/api-derive/src/crowdloan/childKey.ts @@ -5,14 +5,14 @@ import type { Observable } from 'rxjs'; import type { Option, u32 } from '@polkadot/types'; import type { PolkadotRuntimeCommonCrowdloanFundInfo } from '@polkadot/types/lookup'; import type { BN } from '@polkadot/util'; -import type { DeriveApi } from '../types'; +import type { DeriveApi } from '../types.js'; import { map } from 'rxjs'; import { u8aConcat, u8aToHex } from '@polkadot/util'; import { blake2AsU8a } from '@polkadot/util-crypto'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; interface AllInfo extends PolkadotRuntimeCommonCrowdloanFundInfo { // previously it was named trieIndex diff --git a/packages/api-derive/src/crowdloan/contributions.ts b/packages/api-derive/src/crowdloan/contributions.ts index 1243317599..8dfc00bd4e 100644 --- a/packages/api-derive/src/crowdloan/contributions.ts +++ b/packages/api-derive/src/crowdloan/contributions.ts @@ -4,14 +4,14 @@ import type { Observable } from 'rxjs'; import type { StorageKey } from '@polkadot/types'; import type { BN } from '@polkadot/util'; -import type { DeriveApi, DeriveContributions } from '../types'; +import type { DeriveApi, DeriveContributions } from '../types.js'; import { BehaviorSubject, combineLatest, EMPTY, map, of, startWith, switchMap, tap, toArray } from 'rxjs'; import { arrayFlatten, isFunction, nextTick } from '@polkadot/util'; -import { memo } from '../util'; -import { extractContributed } from './util'; +import { memo } from '../util/index.js'; +import { extractContributed } from './util.js'; interface Changes { added: string[]; diff --git a/packages/api-derive/src/crowdloan/index.ts b/packages/api-derive/src/crowdloan/index.ts index a2ced96242..0823f1d1d4 100644 --- a/packages/api-derive/src/crowdloan/index.ts +++ b/packages/api-derive/src/crowdloan/index.ts @@ -1,6 +1,6 @@ // Copyright 2017-2023 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -export * from './childKey'; -export * from './contributions'; -export * from './ownContributions'; +export * from './childKey.js'; +export * from './contributions.js'; +export * from './ownContributions.js'; diff --git a/packages/api-derive/src/crowdloan/ownContributions.ts b/packages/api-derive/src/crowdloan/ownContributions.ts index 76c52b9ef0..24da3d730e 100644 --- a/packages/api-derive/src/crowdloan/ownContributions.ts +++ b/packages/api-derive/src/crowdloan/ownContributions.ts @@ -3,14 +3,14 @@ import type { Observable } from 'rxjs'; import type { BN } from '@polkadot/util'; -import type { DeriveApi, DeriveOwnContributions } from '../types'; +import type { DeriveApi, DeriveOwnContributions } from '../types.js'; import { combineLatest, EMPTY, map, of, startWith, switchMap } from 'rxjs'; import { objectSpread } from '@polkadot/util'; -import { memo } from '../util'; -import { extractContributed } from './util'; +import { memo } from '../util/index.js'; +import { extractContributed } from './util.js'; function _getValues (api: DeriveApi, childKey: string, keys: string[]): Observable { // We actually would love to use multi-keys https://github.com/paritytech/substrate/issues/9203 diff --git a/packages/api-derive/src/democracy/dispatchQueue.ts b/packages/api-derive/src/democracy/dispatchQueue.ts index 3ff535c5be..6c03edc4a4 100644 --- a/packages/api-derive/src/democracy/dispatchQueue.ts +++ b/packages/api-derive/src/democracy/dispatchQueue.ts @@ -7,15 +7,15 @@ import type { BlockNumber, Call, Hash, ReferendumIndex, Scheduled } from '@polka import type { FrameSupportPreimagesBounded, PalletSchedulerScheduled } from '@polkadot/types/lookup'; import type { Codec, ITuple } from '@polkadot/types/types'; import type { HexString } from '@polkadot/util/types'; -import type { DeriveApi, DeriveDispatch, DeriveProposalImage } from '../types'; +import type { DeriveApi, DeriveDispatch, DeriveProposalImage } from '../types.js'; import { catchError, combineLatest, map, of, switchMap } from 'rxjs'; import { Enum } from '@polkadot/types'; import { isFunction, objectSpread, stringToHex } from '@polkadot/util'; -import { memo } from '../util'; -import { getImageHashBounded } from './util'; +import { memo } from '../util/index.js'; +import { getImageHashBounded } from './util.js'; const DEMOCRACY_ID = stringToHex('democrac'); diff --git a/packages/api-derive/src/democracy/index.ts b/packages/api-derive/src/democracy/index.ts index de59a9742f..77a089265e 100644 --- a/packages/api-derive/src/democracy/index.ts +++ b/packages/api-derive/src/democracy/index.ts @@ -1,14 +1,14 @@ // Copyright 2017-2023 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -export * from './dispatchQueue'; -export * from './locks'; -export * from './nextExternal'; -export * from './preimages'; -export * from './proposals'; -export * from './referendumIds'; -export * from './referendums'; -export * from './referendumsActive'; -export * from './referendumsFinished'; -export * from './referendumsInfo'; -export * from './sqrtElectorate'; +export * from './dispatchQueue.js'; +export * from './locks.js'; +export * from './nextExternal.js'; +export * from './preimages.js'; +export * from './proposals.js'; +export * from './referendumIds.js'; +export * from './referendums.js'; +export * from './referendumsActive.js'; +export * from './referendumsFinished.js'; +export * from './referendumsInfo.js'; +export * from './sqrtElectorate.js'; diff --git a/packages/api-derive/src/democracy/locks.ts b/packages/api-derive/src/democracy/locks.ts index 9be2ea6576..71e65aab77 100644 --- a/packages/api-derive/src/democracy/locks.ts +++ b/packages/api-derive/src/democracy/locks.ts @@ -5,13 +5,13 @@ import type { Observable } from 'rxjs'; import type { AccountId, ReferendumInfoTo239, Vote } from '@polkadot/types/interfaces'; import type { PalletDemocracyReferendumInfo, PalletDemocracyVoteVoting } from '@polkadot/types/lookup'; import type { BN } from '@polkadot/util'; -import type { DeriveApi, DeriveDemocracyLock } from '../types'; +import type { DeriveApi, DeriveDemocracyLock } from '../types.js'; import { map, of, switchMap } from 'rxjs'; import { BN_ZERO, isUndefined } from '@polkadot/util'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; type ReferendumInfoFinished = PalletDemocracyReferendumInfo['asFinished']; type VotingDelegating = PalletDemocracyVoteVoting['asDelegating']; diff --git a/packages/api-derive/src/democracy/nextExternal.ts b/packages/api-derive/src/democracy/nextExternal.ts index ed7c04d589..74dfb88b08 100644 --- a/packages/api-derive/src/democracy/nextExternal.ts +++ b/packages/api-derive/src/democracy/nextExternal.ts @@ -6,12 +6,12 @@ import type { Option } from '@polkadot/types'; import type { H256 } from '@polkadot/types/interfaces'; import type { FrameSupportPreimagesBounded, PalletDemocracyVoteThreshold } from '@polkadot/types/lookup'; import type { ITuple } from '@polkadot/types/types'; -import type { DeriveApi, DeriveProposalExternal } from '../types'; +import type { DeriveApi, DeriveProposalExternal } from '../types.js'; import { map, of, switchMap } from 'rxjs'; -import { memo } from '../util'; -import { getImageHashBounded } from './util'; +import { memo } from '../util/index.js'; +import { getImageHashBounded } from './util.js'; function withImage (api: DeriveApi, nextOpt: Option>): Observable { if (nextOpt.isNone) { diff --git a/packages/api-derive/src/democracy/preimages.ts b/packages/api-derive/src/democracy/preimages.ts index 399c528148..b5b130f12d 100644 --- a/packages/api-derive/src/democracy/preimages.ts +++ b/packages/api-derive/src/democracy/preimages.ts @@ -7,14 +7,14 @@ import type { FrameSupportPreimagesBounded, PalletPreimageRequestStatus } from ' import type { Bytes, Option } from '@polkadot/types-codec'; import type { ITuple } from '@polkadot/types-codec/types'; import type { HexString } from '@polkadot/util/types'; -import type { DeriveApi, DeriveProposalImage } from '../types'; +import type { DeriveApi, DeriveProposalImage } from '../types.js'; import { map, of, switchMap } from 'rxjs'; import { BN_ZERO, isFunction } from '@polkadot/util'; -import { firstMemo, memo } from '../util'; -import { getImageHashBounded } from './util'; +import { firstMemo, memo } from '../util/index.js'; +import { getImageHashBounded } from './util.js'; type PreimageInfo = [Bytes, AccountId, Balance, BlockNumber]; type OldPreimage = ITuple; diff --git a/packages/api-derive/src/democracy/proposals.ts b/packages/api-derive/src/democracy/proposals.ts index 8cdae8f643..5076c74dc4 100644 --- a/packages/api-derive/src/democracy/proposals.ts +++ b/packages/api-derive/src/democracy/proposals.ts @@ -6,14 +6,14 @@ import type { Option, Vec } from '@polkadot/types'; import type { AccountId, Balance, Hash, PropIndex } from '@polkadot/types/interfaces'; import type { FrameSupportPreimagesBounded } from '@polkadot/types/lookup'; import type { ITuple } from '@polkadot/types/types'; -import type { DeriveApi, DeriveProposal, DeriveProposalImage } from '../types'; +import type { DeriveApi, DeriveProposal, DeriveProposalImage } from '../types.js'; import { combineLatest, map, of, switchMap } from 'rxjs'; import { isFunction, objectSpread } from '@polkadot/util'; -import { memo } from '../util'; -import { getImageHashBounded } from './util'; +import { memo } from '../util/index.js'; +import { getImageHashBounded } from './util.js'; type DepositorsNew = Option, Balance]>>; type DepositorsOld = Option]>>; diff --git a/packages/api-derive/src/democracy/referendumIds.ts b/packages/api-derive/src/democracy/referendumIds.ts index ead2dba2ed..4a1c7ebe9b 100644 --- a/packages/api-derive/src/democracy/referendumIds.ts +++ b/packages/api-derive/src/democracy/referendumIds.ts @@ -4,11 +4,11 @@ import type { Observable } from 'rxjs'; import type { ReferendumIndex } from '@polkadot/types/interfaces'; import type { BN } from '@polkadot/util'; -import type { DeriveApi } from '../types'; +import type { DeriveApi } from '../types.js'; import { map, of } from 'rxjs'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; export function referendumIds (instanceId: string, api: DeriveApi): () => Observable { return memo(instanceId, (): Observable => diff --git a/packages/api-derive/src/democracy/referendums.ts b/packages/api-derive/src/democracy/referendums.ts index 750e712e69..74027e6d0c 100644 --- a/packages/api-derive/src/democracy/referendums.ts +++ b/packages/api-derive/src/democracy/referendums.ts @@ -2,13 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 import type { Observable } from 'rxjs'; -import type { DeriveApi, DeriveReferendumExt } from '../types'; +import type { DeriveApi, DeriveReferendumExt } from '../types.js'; import { combineLatest, map, of, switchMap } from 'rxjs'; import { objectSpread } from '@polkadot/util'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; export function referendums (instanceId: string, api: DeriveApi): () => Observable { return memo(instanceId, (): Observable => diff --git a/packages/api-derive/src/democracy/referendumsActive.ts b/packages/api-derive/src/democracy/referendumsActive.ts index 8a1b556e9f..eca7d42fe6 100644 --- a/packages/api-derive/src/democracy/referendumsActive.ts +++ b/packages/api-derive/src/democracy/referendumsActive.ts @@ -2,11 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { Observable } from 'rxjs'; -import type { DeriveApi, DeriveReferendum } from '../types'; +import type { DeriveApi, DeriveReferendum } from '../types.js'; import { of, switchMap } from 'rxjs'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; export function referendumsActive (instanceId: string, api: DeriveApi): () => Observable { return memo(instanceId, (): Observable => diff --git a/packages/api-derive/src/democracy/referendumsFinished.ts b/packages/api-derive/src/democracy/referendumsFinished.ts index da5f2fb954..b18f8cf691 100644 --- a/packages/api-derive/src/democracy/referendumsFinished.ts +++ b/packages/api-derive/src/democracy/referendumsFinished.ts @@ -3,11 +3,11 @@ import type { Observable } from 'rxjs'; import type { PalletDemocracyReferendumInfo } from '@polkadot/types/lookup'; -import type { DeriveApi } from '../types'; +import type { DeriveApi } from '../types.js'; import { map, switchMap } from 'rxjs'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; type ReferendumInfoFinished = PalletDemocracyReferendumInfo['asFinished']; diff --git a/packages/api-derive/src/democracy/referendumsInfo.ts b/packages/api-derive/src/democracy/referendumsInfo.ts index 1ec42a0d6c..2d3c8d953c 100644 --- a/packages/api-derive/src/democracy/referendumsInfo.ts +++ b/packages/api-derive/src/democracy/referendumsInfo.ts @@ -6,14 +6,14 @@ import type { Option, Vec } from '@polkadot/types'; import type { AccountId, Hash, ReferendumInfoTo239, Vote } from '@polkadot/types/interfaces'; import type { PalletDemocracyReferendumInfo, PalletDemocracyReferendumStatus, PalletDemocracyVoteVoting } from '@polkadot/types/lookup'; import type { BN } from '@polkadot/util'; -import type { DeriveApi, DeriveBalancesAccount, DeriveReferendum, DeriveReferendumVote, DeriveReferendumVotes } from '../types'; +import type { DeriveApi, DeriveBalancesAccount, DeriveReferendum, DeriveReferendumVote, DeriveReferendumVotes } from '../types.js'; import { combineLatest, map, of, switchMap } from 'rxjs'; import { isFunction, objectSpread } from '@polkadot/util'; -import { memo } from '../util'; -import { calcVotes, getImageHash, getStatus } from './util'; +import { memo } from '../util/index.js'; +import { calcVotes, getImageHash, getStatus } from './util.js'; type VotingDelegating = PalletDemocracyVoteVoting['asDelegating']; type VotingDirect = PalletDemocracyVoteVoting['asDirect']; diff --git a/packages/api-derive/src/democracy/sqrtElectorate.ts b/packages/api-derive/src/democracy/sqrtElectorate.ts index ffbee3850e..41bba4f0c0 100644 --- a/packages/api-derive/src/democracy/sqrtElectorate.ts +++ b/packages/api-derive/src/democracy/sqrtElectorate.ts @@ -3,13 +3,13 @@ import type { Observable } from 'rxjs'; import type { BN } from '@polkadot/util'; -import type { DeriveApi } from '../types'; +import type { DeriveApi } from '../types.js'; import { map } from 'rxjs'; import { bnSqrt } from '@polkadot/util'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; export function sqrtElectorate (instanceId: string, api: DeriveApi): () => Observable { return memo(instanceId, (): Observable => diff --git a/packages/api-derive/src/democracy/util.ts b/packages/api-derive/src/democracy/util.ts index b950aa406f..d61eba1849 100644 --- a/packages/api-derive/src/democracy/util.ts +++ b/packages/api-derive/src/democracy/util.ts @@ -5,7 +5,7 @@ import type { Hash, ReferendumInfoTo239, Tally } from '@polkadot/types/interface import type { FrameSupportPreimagesBounded, PalletDemocracyReferendumInfo, PalletDemocracyReferendumStatus, PalletDemocracyVoteThreshold } from '@polkadot/types/lookup'; import type { Option } from '@polkadot/types-codec'; import type { HexString } from '@polkadot/util/types'; -import type { DeriveReferendum, DeriveReferendumVote, DeriveReferendumVotes, DeriveReferendumVoteState } from '../types'; +import type { DeriveReferendum, DeriveReferendumVote, DeriveReferendumVotes, DeriveReferendumVoteState } from '../types.js'; import { BN, bnSqrt, isHex, isString, isU8a, objectSpread, stringToHex, u8aToHex } from '@polkadot/util'; diff --git a/packages/api-derive/src/derive.ts b/packages/api-derive/src/derive.ts index a3b2c70f79..aaf3deaf64 100644 --- a/packages/api-derive/src/derive.ts +++ b/packages/api-derive/src/derive.ts @@ -3,26 +3,26 @@ import type { AnyFunction } from '@polkadot/types/types'; -import * as accounts from './accounts'; -import * as alliance from './alliance'; -import * as bagsList from './bagsList'; -import * as balances from './balances'; -import * as bounties from './bounties'; -import * as chain from './chain'; -import * as contracts from './contracts'; -import * as council from './council'; -import * as crowdloan from './crowdloan'; -import * as democracy from './democracy'; -import * as elections from './elections'; -import * as imOnline from './imOnline'; -import * as membership from './membership'; -import * as parachains from './parachains'; -import * as session from './session'; -import * as society from './society'; -import * as staking from './staking'; -import * as technicalCommittee from './technicalCommittee'; -import * as treasury from './treasury'; -import * as tx from './tx'; +import * as accounts from './accounts/index.js'; +import * as alliance from './alliance/index.js'; +import * as bagsList from './bagsList/index.js'; +import * as balances from './balances/index.js'; +import * as bounties from './bounties/index.js'; +import * as chain from './chain/index.js'; +import * as contracts from './contracts/index.js'; +import * as council from './council/index.js'; +import * as crowdloan from './crowdloan/index.js'; +import * as democracy from './democracy/index.js'; +import * as elections from './elections/index.js'; +import * as imOnline from './imOnline/index.js'; +import * as membership from './membership/index.js'; +import * as parachains from './parachains/index.js'; +import * as session from './session/index.js'; +import * as society from './society/index.js'; +import * as staking from './staking/index.js'; +import * as technicalCommittee from './technicalCommittee/index.js'; +import * as treasury from './treasury/index.js'; +import * as tx from './tx/index.js'; export const derive = { accounts, alliance, bagsList, balances, bounties, chain, contracts, council, crowdloan, democracy, elections, imOnline, membership, parachains, session, society, staking, technicalCommittee, treasury, tx }; diff --git a/packages/api-derive/src/detectPackage.ts b/packages/api-derive/src/detectPackage.ts index 1269413c59..f18d4df44d 100644 --- a/packages/api-derive/src/detectPackage.ts +++ b/packages/api-derive/src/detectPackage.ts @@ -5,7 +5,7 @@ import { detectPackage } from '@polkadot/util'; -import others from './detectOther'; -import { packageInfo } from './packageInfo'; +import others from './detectOther.js'; +import { packageInfo } from './packageInfo.js'; detectPackage(packageInfo, null, others); diff --git a/packages/api-derive/src/elections/index.ts b/packages/api-derive/src/elections/index.ts index 4ea172312c..001455225f 100644 --- a/packages/api-derive/src/elections/index.ts +++ b/packages/api-derive/src/elections/index.ts @@ -1,4 +1,4 @@ // Copyright 2017-2023 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -export * from './info'; +export * from './info.js'; diff --git a/packages/api-derive/src/elections/info.ts b/packages/api-derive/src/elections/info.ts index 9cf612fd15..408ef4fb33 100644 --- a/packages/api-derive/src/elections/info.ts +++ b/packages/api-derive/src/elections/info.ts @@ -6,14 +6,14 @@ import type { u32, Vec } from '@polkadot/types'; import type { AccountId32, Balance, BlockNumber } from '@polkadot/types/interfaces'; import type { PalletElectionsPhragmenSeatHolder } from '@polkadot/types/lookup'; import type { ITuple } from '@polkadot/types/types'; -import type { DeriveApi } from '../types'; -import type { DeriveElectionsInfo } from './types'; +import type { DeriveApi } from '../types.js'; +import type { DeriveElectionsInfo } from './types.js'; import { combineLatest, map, of } from 'rxjs'; import { objectSpread } from '@polkadot/util'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; // SeatHolder is current tuple is 2.x-era Substrate type Member = PalletElectionsPhragmenSeatHolder | ITuple<[AccountId32, Balance]>; diff --git a/packages/api-derive/src/imOnline/index.ts b/packages/api-derive/src/imOnline/index.ts index 93b1bd5da3..ab5bfb745b 100644 --- a/packages/api-derive/src/imOnline/index.ts +++ b/packages/api-derive/src/imOnline/index.ts @@ -1,4 +1,4 @@ // Copyright 2017-2023 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -export * from './receivedHeartbeats'; +export * from './receivedHeartbeats.js'; diff --git a/packages/api-derive/src/imOnline/receivedHeartbeats.ts b/packages/api-derive/src/imOnline/receivedHeartbeats.ts index 1decaad614..66908196c8 100644 --- a/packages/api-derive/src/imOnline/receivedHeartbeats.ts +++ b/packages/api-derive/src/imOnline/receivedHeartbeats.ts @@ -5,13 +5,13 @@ import type { Observable } from 'rxjs'; import type { Option, u32, WrapperOpaque } from '@polkadot/types'; import type { AccountId } from '@polkadot/types/interfaces'; import type { PalletImOnlineBoundedOpaqueNetworkState } from '@polkadot/types/lookup'; -import type { DeriveApi, DeriveHeartbeats } from '../types'; +import type { DeriveApi, DeriveHeartbeats } from '../types.js'; import { combineLatest, map, of, switchMap } from 'rxjs'; import { BN_ZERO } from '@polkadot/util'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; type HeartbeatsOpt = Option>; diff --git a/packages/api-derive/src/index.spec.ts b/packages/api-derive/src/index.spec.ts index 79d666bdc5..d1c082a366 100644 --- a/packages/api-derive/src/index.spec.ts +++ b/packages/api-derive/src/index.spec.ts @@ -13,7 +13,7 @@ import { ApiRx } from '@polkadot/api'; import { MockProvider } from '@polkadot/rpc-provider/mock'; import { TypeRegistry } from '@polkadot/types/create'; -import { ExactDerive } from '.'; +import { ExactDerive } from './index.js'; const testFunction = (api: ApiRx): any => { return (section: S, method: M, inputs: any[]): void => { diff --git a/packages/api-derive/src/index.ts b/packages/api-derive/src/index.ts index 925bc93888..0ee2cb4113 100644 --- a/packages/api-derive/src/index.ts +++ b/packages/api-derive/src/index.ts @@ -1,6 +1,6 @@ // Copyright 2017-2023 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import './detectPackage'; +import './detectPackage.js'; -export * from './bundle'; +export * from './bundle.js'; diff --git a/packages/api-derive/src/membership/index.ts b/packages/api-derive/src/membership/index.ts index f41ffc5cf0..7c7aace678 100644 --- a/packages/api-derive/src/membership/index.ts +++ b/packages/api-derive/src/membership/index.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { hasProposals as collectiveHasProposals, members as collectiveMembers, prime as collectivePrime, proposal as collectiveProposal, proposalCount as collectiveProposalCount, proposalHashes as collectiveProposalHashes, proposals as collectiveProposals } from '../collective'; +import { hasProposals as collectiveHasProposals, members as collectiveMembers, prime as collectivePrime, proposal as collectiveProposal, proposalCount as collectiveProposalCount, proposalHashes as collectiveProposalHashes, proposals as collectiveProposals } from '../collective/index.js'; export const members = collectiveMembers('membership'); diff --git a/packages/api-derive/src/mod.ts b/packages/api-derive/src/mod.ts index 1d3da59659..08bebbdf05 100644 --- a/packages/api-derive/src/mod.ts +++ b/packages/api-derive/src/mod.ts @@ -1,4 +1,4 @@ // Copyright 2017-2023 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -export * from './index'; +export * from './index.js'; diff --git a/packages/api-derive/src/parachains/index.ts b/packages/api-derive/src/parachains/index.ts index fb21b3cb9a..2b30f42015 100644 --- a/packages/api-derive/src/parachains/index.ts +++ b/packages/api-derive/src/parachains/index.ts @@ -1,5 +1,5 @@ // Copyright 2017-2023 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -export * from './info'; -export * from './overview'; +export * from './info.js'; +export * from './overview.js'; diff --git a/packages/api-derive/src/parachains/info.ts b/packages/api-derive/src/parachains/info.ts index 77482b838b..3c210510c0 100644 --- a/packages/api-derive/src/parachains/info.ts +++ b/packages/api-derive/src/parachains/info.ts @@ -3,15 +3,15 @@ import type { Observable } from 'rxjs'; import type { CollatorId, ParaId } from '@polkadot/types/interfaces'; -import type { DeriveApi, DeriveParachainActive, DeriveParachainFull, DeriveParachainInfo } from '../types'; -import type { Active, DidUpdate, Heads, ParaInfoResult, PendingSwap, RelayDispatchQueue, RetryQueue, SelectedThreads } from './types'; +import type { DeriveApi, DeriveParachainActive, DeriveParachainFull, DeriveParachainInfo } from '../types.js'; +import type { Active, DidUpdate, Heads, ParaInfoResult, PendingSwap, RelayDispatchQueue, RetryQueue, SelectedThreads } from './types.js'; import { map, of } from 'rxjs'; import { objectSpread } from '@polkadot/util'; -import { memo } from '../util'; -import { didUpdateToBool } from './util'; +import { memo } from '../util/index.js'; +import { didUpdateToBool } from './util.js'; type Result = [ Active, diff --git a/packages/api-derive/src/parachains/overview.ts b/packages/api-derive/src/parachains/overview.ts index a7d301c4b4..d499ba9d1d 100644 --- a/packages/api-derive/src/parachains/overview.ts +++ b/packages/api-derive/src/parachains/overview.ts @@ -3,15 +3,15 @@ import type { Observable } from 'rxjs'; import type { ParaId } from '@polkadot/types/interfaces'; -import type { DeriveApi, DeriveParachain, DeriveParachainInfo } from '../types'; -import type { DidUpdate, ParaInfoResult, PendingSwap, RelayDispatchQueueSize } from './types'; +import type { DeriveApi, DeriveParachain, DeriveParachainInfo } from '../types.js'; +import type { DidUpdate, ParaInfoResult, PendingSwap, RelayDispatchQueueSize } from './types.js'; import { combineLatest, map, of, switchMap } from 'rxjs'; import { objectSpread } from '@polkadot/util'; -import { memo } from '../util'; -import { didUpdateToBool } from './util'; +import { memo } from '../util/index.js'; +import { didUpdateToBool } from './util.js'; type Result = [ ParaId[], diff --git a/packages/api-derive/src/parachains/util.ts b/packages/api-derive/src/parachains/util.ts index 9a0e13afee..7d46f6c562 100644 --- a/packages/api-derive/src/parachains/util.ts +++ b/packages/api-derive/src/parachains/util.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { ParaId } from '@polkadot/types/interfaces'; -import type { DidUpdate } from './types'; +import type { DidUpdate } from './types.js'; export function didUpdateToBool (didUpdate: DidUpdate, id: ParaId): boolean { return didUpdate.isSome diff --git a/packages/api-derive/src/session/index.ts b/packages/api-derive/src/session/index.ts index 2c849a7858..ef9d97045e 100644 --- a/packages/api-derive/src/session/index.ts +++ b/packages/api-derive/src/session/index.ts @@ -1,6 +1,6 @@ // Copyright 2017-2023 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -export * from './indexes'; -export * from './info'; -export * from './progress'; +export * from './indexes.js'; +export * from './info.js'; +export * from './progress.js'; diff --git a/packages/api-derive/src/session/indexes.ts b/packages/api-derive/src/session/indexes.ts index 55d905cbea..4ce1df82e1 100644 --- a/packages/api-derive/src/session/indexes.ts +++ b/packages/api-derive/src/session/indexes.ts @@ -4,11 +4,11 @@ import type { Observable } from 'rxjs'; import type { Option, u32 } from '@polkadot/types'; import type { ActiveEraInfo, EraIndex, Moment, SessionIndex } from '@polkadot/types/interfaces'; -import type { DeriveApi, DeriveSessionIndexes } from '../types'; +import type { DeriveApi, DeriveSessionIndexes } from '../types.js'; import { map, of } from 'rxjs'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; // parse into Indexes function parse ([currentIndex, activeEra, activeEraStart, currentEra, validatorCount]: [SessionIndex, EraIndex, Option, EraIndex, u32]): DeriveSessionIndexes { diff --git a/packages/api-derive/src/session/info.ts b/packages/api-derive/src/session/info.ts index 536810a905..29c590b0d6 100644 --- a/packages/api-derive/src/session/info.ts +++ b/packages/api-derive/src/session/info.ts @@ -2,13 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 import type { Observable } from 'rxjs'; -import type { DeriveApi, DeriveSessionInfo } from '../types'; +import type { DeriveApi, DeriveSessionInfo } from '../types.js'; import { map } from 'rxjs'; import { objectSpread } from '@polkadot/util'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; /** * @description Retrieves all the session and era query and calculates specific values on it as the length of the session and eras diff --git a/packages/api-derive/src/session/progress.ts b/packages/api-derive/src/session/progress.ts index 4a3437a6ae..078b42a244 100644 --- a/packages/api-derive/src/session/progress.ts +++ b/packages/api-derive/src/session/progress.ts @@ -4,13 +4,13 @@ import type { Observable } from 'rxjs'; import type { Option, u64 } from '@polkadot/types'; import type { BlockNumber, SessionIndex } from '@polkadot/types/interfaces'; -import type { DeriveApi, DeriveSessionInfo, DeriveSessionProgress } from '../types'; +import type { DeriveApi, DeriveSessionInfo, DeriveSessionProgress } from '../types.js'; import { combineLatest, map, of, switchMap } from 'rxjs'; import { objectSpread } from '@polkadot/util'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; type ResultSlotsNoSession = [u64, u64, u64]; type ResultSlots = [u64, u64, u64, Option]; diff --git a/packages/api-derive/src/society/candidates.ts b/packages/api-derive/src/society/candidates.ts index 528097c400..951bcac0ea 100644 --- a/packages/api-derive/src/society/candidates.ts +++ b/packages/api-derive/src/society/candidates.ts @@ -6,11 +6,11 @@ import type { BalanceOf } from '@polkadot/types/interfaces'; import type { PalletSocietyBid, PalletSocietyBidKind } from '@polkadot/types/lookup'; import type { ITuple } from '@polkadot/types/types'; import type { Option } from '@polkadot/types-codec'; -import type { DeriveApi, DeriveSocietyCandidate } from '../types'; +import type { DeriveApi, DeriveSocietyCandidate } from '../types.js'; import { combineLatest, map, of, switchMap } from 'rxjs'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; type ResultSuspend = Option>; type Result = [PalletSocietyBid[], ResultSuspend[]] diff --git a/packages/api-derive/src/society/index.ts b/packages/api-derive/src/society/index.ts index 80bebbce5a..89107de520 100644 --- a/packages/api-derive/src/society/index.ts +++ b/packages/api-derive/src/society/index.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -export * from './candidates'; -export * from './info'; -export * from './member'; -export * from './members'; +export * from './candidates.js'; +export * from './info.js'; +export * from './member.js'; +export * from './members.js'; diff --git a/packages/api-derive/src/society/info.ts b/packages/api-derive/src/society/info.ts index d64a0ad20f..554592a852 100644 --- a/packages/api-derive/src/society/info.ts +++ b/packages/api-derive/src/society/info.ts @@ -5,11 +5,11 @@ import type { Observable } from 'rxjs'; import type { Option, u32, Vec } from '@polkadot/types'; import type { AccountId, BalanceOf } from '@polkadot/types/interfaces'; import type { PalletSocietyBid } from '@polkadot/types/lookup'; -import type { DeriveApi, DeriveSociety } from '../types'; +import type { DeriveApi, DeriveSociety } from '../types.js'; import { map } from 'rxjs'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; type Result = [Vec, Option, Option, Option, u32, BalanceOf] diff --git a/packages/api-derive/src/society/member.ts b/packages/api-derive/src/society/member.ts index fe7fbc3c54..abbf22940d 100644 --- a/packages/api-derive/src/society/member.ts +++ b/packages/api-derive/src/society/member.ts @@ -3,11 +3,11 @@ import type { Observable } from 'rxjs'; import type { AccountId } from '@polkadot/types/interfaces'; -import type { DeriveApi, DeriveSocietyMember } from '../types'; +import type { DeriveApi, DeriveSocietyMember } from '../types.js'; import { map } from 'rxjs'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; /** * @description Get the member info for a society diff --git a/packages/api-derive/src/society/members.ts b/packages/api-derive/src/society/members.ts index d8675fb46d..e1a571a9f7 100644 --- a/packages/api-derive/src/society/members.ts +++ b/packages/api-derive/src/society/members.ts @@ -3,11 +3,11 @@ import type { Observable } from 'rxjs'; import type { AccountId } from '@polkadot/types/interfaces'; -import type { DeriveApi, DeriveSocietyMember } from '../types'; +import type { DeriveApi, DeriveSocietyMember } from '../types.js'; import { combineLatest, map, of, switchMap } from 'rxjs'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; export function _members (instanceId: string, api: DeriveApi): (accountIds: AccountId[]) => Observable { return memo(instanceId, (accountIds: AccountId[]): Observable => diff --git a/packages/api-derive/src/staking/account.ts b/packages/api-derive/src/staking/account.ts index 0dab06d186..312710908a 100644 --- a/packages/api-derive/src/staking/account.ts +++ b/packages/api-derive/src/staking/account.ts @@ -4,14 +4,14 @@ import type { Observable } from 'rxjs'; import type { Balance } from '@polkadot/types/interfaces'; import type { PalletStakingStakingLedger, PalletStakingUnlockChunk } from '@polkadot/types/lookup'; -import type { DeriveApi, DeriveSessionInfo, DeriveStakingAccount, DeriveStakingKeys, DeriveStakingQuery, DeriveUnlocking } from '../types'; -import type { StakingQueryFlags } from './types'; +import type { DeriveApi, DeriveSessionInfo, DeriveStakingAccount, DeriveStakingKeys, DeriveStakingQuery, DeriveUnlocking } from '../types.js'; +import type { StakingQueryFlags } from './types.js'; import { combineLatest, map, switchMap } from 'rxjs'; import { BN, BN_ZERO, objectSpread } from '@polkadot/util'; -import { firstMemo, memo } from '../util'; +import { firstMemo, memo } from '../util/index.js'; const QUERY_OPTS = { withDestination: true, diff --git a/packages/api-derive/src/staking/cache.ts b/packages/api-derive/src/staking/cache.ts index ee1cb01431..a2de109f92 100644 --- a/packages/api-derive/src/staking/cache.ts +++ b/packages/api-derive/src/staking/cache.ts @@ -3,7 +3,7 @@ import type { EraIndex } from '@polkadot/types/interfaces'; -import { deriveCache } from '../util'; +import { deriveCache } from '../util/index.js'; export function getEraCache (CACHE_KEY: string, era: EraIndex, withActive?: boolean): [string, T | undefined] { const cacheKey = `${CACHE_KEY}-${era.toString()}`; diff --git a/packages/api-derive/src/staking/currentPoints.ts b/packages/api-derive/src/staking/currentPoints.ts index 97d529ad57..b7b4c44db8 100644 --- a/packages/api-derive/src/staking/currentPoints.ts +++ b/packages/api-derive/src/staking/currentPoints.ts @@ -3,11 +3,11 @@ import type { Observable } from 'rxjs'; import type { PalletStakingEraRewardPoints } from '@polkadot/types/lookup'; -import type { DeriveApi } from '../types'; +import type { DeriveApi } from '../types.js'; import { switchMap } from 'rxjs'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; /** * @description Retrieve the staking overview, including elected and points earned diff --git a/packages/api-derive/src/staking/electedInfo.ts b/packages/api-derive/src/staking/electedInfo.ts index 21967e9a11..aea7608807 100644 --- a/packages/api-derive/src/staking/electedInfo.ts +++ b/packages/api-derive/src/staking/electedInfo.ts @@ -3,13 +3,13 @@ import type { Observable } from 'rxjs'; import type { AccountId } from '@polkadot/types/interfaces'; -import type { DeriveApi, DeriveStakingElected, StakingQueryFlags } from '../types'; +import type { DeriveApi, DeriveStakingElected, StakingQueryFlags } from '../types.js'; import { map, switchMap } from 'rxjs'; import { arrayFlatten } from '@polkadot/util'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; const DEFAULT_FLAGS = { withController: true, withExposure: true, withPrefs: true }; diff --git a/packages/api-derive/src/staking/erasExposure.ts b/packages/api-derive/src/staking/erasExposure.ts index 4d484bbf59..66c3f380e2 100644 --- a/packages/api-derive/src/staking/erasExposure.ts +++ b/packages/api-derive/src/staking/erasExposure.ts @@ -5,13 +5,13 @@ import type { Observable } from 'rxjs'; import type { StorageKey } from '@polkadot/types'; import type { AccountId, EraIndex } from '@polkadot/types/interfaces'; import type { PalletStakingExposure } from '@polkadot/types/lookup'; -import type { DeriveApi, DeriveEraExposure, DeriveEraNominatorExposure, DeriveEraValidatorExposure } from '../types'; +import type { DeriveApi, DeriveEraExposure, DeriveEraNominatorExposure, DeriveEraValidatorExposure } from '../types.js'; import { map, of } from 'rxjs'; -import { memo } from '../util'; -import { getEraCache, setEraCache } from './cache'; -import { combineEras, erasHistoricApply, singleEra } from './util'; +import { memo } from '../util/index.js'; +import { getEraCache, setEraCache } from './cache.js'; +import { combineEras, erasHistoricApply, singleEra } from './util.js'; type KeysAndExposures = [StorageKey<[EraIndex, AccountId]>, PalletStakingExposure][]; diff --git a/packages/api-derive/src/staking/erasHistoric.ts b/packages/api-derive/src/staking/erasHistoric.ts index 12df20029e..d1c7908492 100644 --- a/packages/api-derive/src/staking/erasHistoric.ts +++ b/packages/api-derive/src/staking/erasHistoric.ts @@ -5,13 +5,13 @@ import type { Observable } from 'rxjs'; import type { u32 } from '@polkadot/types'; import type { EraIndex } from '@polkadot/types/interfaces'; import type { BN } from '@polkadot/util'; -import type { DeriveApi } from '../types'; +import type { DeriveApi } from '../types.js'; import { combineLatest, map, of } from 'rxjs'; import { BN_ONE, BN_ZERO } from '@polkadot/util'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; export function erasHistoric (instanceId: string, api: DeriveApi): (withActive?: boolean) => Observable { return memo(instanceId, (withActive?: boolean): Observable => diff --git a/packages/api-derive/src/staking/erasPoints.ts b/packages/api-derive/src/staking/erasPoints.ts index b9f8c0dbbb..c05196fd36 100644 --- a/packages/api-derive/src/staking/erasPoints.ts +++ b/packages/api-derive/src/staking/erasPoints.ts @@ -4,15 +4,15 @@ import type { Observable } from 'rxjs'; import type { EraIndex } from '@polkadot/types/interfaces'; import type { PalletStakingEraRewardPoints } from '@polkadot/types/lookup'; -import type { DeriveApi, DeriveEraPoints, DeriveEraValPoints } from '../types'; +import type { DeriveApi, DeriveEraPoints, DeriveEraValPoints } from '../types.js'; import { map, of } from 'rxjs'; import { BN_ZERO } from '@polkadot/util'; -import { memo } from '../util'; -import { filterCachedEras, getEraMultiCache, setEraMultiCache } from './cache'; -import { erasHistoricApply, filterEras } from './util'; +import { memo } from '../util/index.js'; +import { filterCachedEras, getEraMultiCache, setEraMultiCache } from './cache.js'; +import { erasHistoricApply, filterEras } from './util.js'; const CACHE_KEY = 'eraPoints'; diff --git a/packages/api-derive/src/staking/erasPrefs.ts b/packages/api-derive/src/staking/erasPrefs.ts index 4df049d9d0..b940acc3bf 100644 --- a/packages/api-derive/src/staking/erasPrefs.ts +++ b/packages/api-derive/src/staking/erasPrefs.ts @@ -5,13 +5,13 @@ import type { Observable } from 'rxjs'; import type { StorageKey } from '@polkadot/types'; import type { EraIndex } from '@polkadot/types/interfaces'; import type { PalletStakingValidatorPrefs } from '@polkadot/types/lookup'; -import type { DeriveApi, DeriveEraPrefs, DeriveEraValPrefs } from '../types'; +import type { DeriveApi, DeriveEraPrefs, DeriveEraValPrefs } from '../types.js'; import { map, of } from 'rxjs'; -import { memo } from '../util'; -import { getEraCache, setEraCache } from './cache'; -import { combineEras, erasHistoricApply, singleEra } from './util'; +import { memo } from '../util/index.js'; +import { getEraCache, setEraCache } from './cache.js'; +import { combineEras, erasHistoricApply, singleEra } from './util.js'; const CACHE_KEY = 'eraPrefs'; diff --git a/packages/api-derive/src/staking/erasRewards.ts b/packages/api-derive/src/staking/erasRewards.ts index 37d6c9f8c2..7a87c97425 100644 --- a/packages/api-derive/src/staking/erasRewards.ts +++ b/packages/api-derive/src/staking/erasRewards.ts @@ -4,13 +4,13 @@ import type { Observable } from 'rxjs'; import type { Option } from '@polkadot/types'; import type { Balance, EraIndex } from '@polkadot/types/interfaces'; -import type { DeriveApi, DeriveEraRewards } from '../types'; +import type { DeriveApi, DeriveEraRewards } from '../types.js'; import { map, of } from 'rxjs'; -import { memo } from '../util'; -import { filterCachedEras, getEraMultiCache, setEraMultiCache } from './cache'; -import { erasHistoricApply, filterEras } from './util'; +import { memo } from '../util/index.js'; +import { filterCachedEras, getEraMultiCache, setEraMultiCache } from './cache.js'; +import { erasHistoricApply, filterEras } from './util.js'; const CACHE_KEY = 'eraRewards'; diff --git a/packages/api-derive/src/staking/erasSlashes.ts b/packages/api-derive/src/staking/erasSlashes.ts index 9eb4751d57..a29b0eba0c 100644 --- a/packages/api-derive/src/staking/erasSlashes.ts +++ b/packages/api-derive/src/staking/erasSlashes.ts @@ -5,13 +5,13 @@ import type { Observable } from 'rxjs'; import type { Option, StorageKey } from '@polkadot/types'; import type { BalanceOf, EraIndex, Perbill } from '@polkadot/types/interfaces'; import type { ITuple } from '@polkadot/types/types'; -import type { DeriveApi, DeriveEraSlashes, DeriveEraValSlash } from '../types'; +import type { DeriveApi, DeriveEraSlashes, DeriveEraValSlash } from '../types.js'; import { combineLatest, map, of } from 'rxjs'; -import { memo } from '../util'; -import { getEraCache, setEraCache } from './cache'; -import { combineEras, erasHistoricApply, singleEra } from './util'; +import { memo } from '../util/index.js'; +import { getEraCache, setEraCache } from './cache.js'; +import { combineEras, erasHistoricApply, singleEra } from './util.js'; const CACHE_KEY = 'eraSlashes'; diff --git a/packages/api-derive/src/staking/index.ts b/packages/api-derive/src/staking/index.ts index 397edf5fd4..8fe80c375c 100644 --- a/packages/api-derive/src/staking/index.ts +++ b/packages/api-derive/src/staking/index.ts @@ -1,25 +1,25 @@ // Copyright 2017-2023 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -export * from './account'; -export * from './currentPoints'; -export * from './erasExposure'; -export * from './erasHistoric'; -export * from './erasPoints'; -export * from './erasPrefs'; -export * from './erasRewards'; -export * from './erasSlashes'; -export * from './electedInfo'; -export * from './keys'; -export * from './overview'; -export * from './ownExposure'; -export * from './ownSlashes'; -export * from './query'; -export * from './stakerExposure'; -export * from './stakerPoints'; -export * from './stakerPrefs'; -export * from './stakerRewards'; -export * from './stakerSlashes'; -export * from './stashes'; -export * from './validators'; -export * from './waitingInfo'; +export * from './account.js'; +export * from './currentPoints.js'; +export * from './erasExposure.js'; +export * from './erasHistoric.js'; +export * from './erasPoints.js'; +export * from './erasPrefs.js'; +export * from './erasRewards.js'; +export * from './erasSlashes.js'; +export * from './electedInfo.js'; +export * from './keys.js'; +export * from './overview.js'; +export * from './ownExposure.js'; +export * from './ownSlashes.js'; +export * from './query.js'; +export * from './stakerExposure.js'; +export * from './stakerPoints.js'; +export * from './stakerPrefs.js'; +export * from './stakerRewards.js'; +export * from './stakerSlashes.js'; +export * from './stashes.js'; +export * from './validators.js'; +export * from './waitingInfo.js'; diff --git a/packages/api-derive/src/staking/keys.ts b/packages/api-derive/src/staking/keys.ts index dde5869951..ec59ae5aec 100644 --- a/packages/api-derive/src/staking/keys.ts +++ b/packages/api-derive/src/staking/keys.ts @@ -5,12 +5,12 @@ import type { Observable } from 'rxjs'; import type { Option } from '@polkadot/types'; import type { AccountId } from '@polkadot/types/interfaces'; import type { KitchensinkRuntimeSessionKeys } from '@polkadot/types/lookup'; -import type { DeriveApi } from '../types'; -import type { DeriveStakingKeys } from './types'; +import type { DeriveApi } from '../types.js'; +import type { DeriveStakingKeys } from './types.js'; import { combineLatest, map, of, switchMap } from 'rxjs'; -import { firstMemo, memo } from '../util'; +import { firstMemo, memo } from '../util/index.js'; function extractsIds (stashId: Uint8Array | string, queuedKeys: [AccountId, KitchensinkRuntimeSessionKeys | AccountId[]][], nextKeys: Option): DeriveStakingKeys { const sessionIds = (queuedKeys.find(([currentId]) => currentId.eq(stashId)) || [undefined, [] as AccountId[]])[1]; diff --git a/packages/api-derive/src/staking/overview.ts b/packages/api-derive/src/staking/overview.ts index 2cde8ea02c..460d7a2ee4 100644 --- a/packages/api-derive/src/staking/overview.ts +++ b/packages/api-derive/src/staking/overview.ts @@ -2,13 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 import type { Observable } from 'rxjs'; -import type { DeriveApi, DeriveStakingOverview } from '../types'; +import type { DeriveApi, DeriveStakingOverview } from '../types.js'; import { combineLatest, map } from 'rxjs'; import { objectSpread } from '@polkadot/util'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; /** * @description Retrieve the staking overview, including elected and points earned diff --git a/packages/api-derive/src/staking/ownExposure.ts b/packages/api-derive/src/staking/ownExposure.ts index 928d02932e..8777bbc317 100644 --- a/packages/api-derive/src/staking/ownExposure.ts +++ b/packages/api-derive/src/staking/ownExposure.ts @@ -3,12 +3,12 @@ import type { Observable } from 'rxjs'; import type { EraIndex } from '@polkadot/types/interfaces'; -import type { DeriveApi, DeriveOwnExposure } from '../types'; +import type { DeriveApi, DeriveOwnExposure } from '../types.js'; import { combineLatest, map, of } from 'rxjs'; -import { firstMemo, memo } from '../util'; -import { erasHistoricApplyAccount } from './util'; +import { firstMemo, memo } from '../util/index.js'; +import { erasHistoricApplyAccount } from './util.js'; export function _ownExposures (instanceId: string, api: DeriveApi): (accountId: Uint8Array | string, eras: EraIndex[], withActive: boolean) => Observable { // eslint-disable-next-line @typescript-eslint/no-unused-vars diff --git a/packages/api-derive/src/staking/ownSlashes.ts b/packages/api-derive/src/staking/ownSlashes.ts index 021a108755..6df89f2f12 100644 --- a/packages/api-derive/src/staking/ownSlashes.ts +++ b/packages/api-derive/src/staking/ownSlashes.ts @@ -4,12 +4,12 @@ import type { Observable } from 'rxjs'; import type { BalanceOf, EraIndex, Perbill } from '@polkadot/types/interfaces'; import type { ITuple } from '@polkadot/types/types'; -import type { DeriveApi, DeriveStakerSlashes } from '../types'; +import type { DeriveApi, DeriveStakerSlashes } from '../types.js'; import { combineLatest, map, of } from 'rxjs'; -import { firstMemo, memo } from '../util'; -import { erasHistoricApplyAccount } from './util'; +import { firstMemo, memo } from '../util/index.js'; +import { erasHistoricApplyAccount } from './util.js'; export function _ownSlashes (instanceId: string, api: DeriveApi): (accountId: Uint8Array | string, eras: EraIndex[], withActive: boolean) => Observable { // eslint-disable-next-line @typescript-eslint/no-unused-vars diff --git a/packages/api-derive/src/staking/query.ts b/packages/api-derive/src/staking/query.ts index 7dea871ed7..bb8a43f81c 100644 --- a/packages/api-derive/src/staking/query.ts +++ b/packages/api-derive/src/staking/query.ts @@ -5,11 +5,11 @@ import type { Observable } from 'rxjs'; import type { Option } from '@polkadot/types'; import type { AccountId, EraIndex } from '@polkadot/types/interfaces'; import type { PalletStakingExposure, PalletStakingNominations, PalletStakingRewardDestination, PalletStakingStakingLedger, PalletStakingValidatorPrefs } from '@polkadot/types/lookup'; -import type { DeriveApi, DeriveStakingQuery, StakingQueryFlags } from '../types'; +import type { DeriveApi, DeriveStakingQuery, StakingQueryFlags } from '../types.js'; import { combineLatest, map, of, switchMap } from 'rxjs'; -import { firstMemo, memo } from '../util'; +import { firstMemo, memo } from '../util/index.js'; function parseDetails (stashId: AccountId, controllerIdOpt: Option | null, nominatorsOpt: Option, rewardDestination: PalletStakingRewardDestination, validatorPrefs: PalletStakingValidatorPrefs, exposure: PalletStakingExposure, stakingLedgerOpt: Option): DeriveStakingQuery { return { diff --git a/packages/api-derive/src/staking/stakerExposure.ts b/packages/api-derive/src/staking/stakerExposure.ts index 4478bce690..dda58dbad2 100644 --- a/packages/api-derive/src/staking/stakerExposure.ts +++ b/packages/api-derive/src/staking/stakerExposure.ts @@ -3,12 +3,12 @@ import type { Observable } from 'rxjs'; import type { EraIndex } from '@polkadot/types/interfaces'; -import type { DeriveApi } from '../types'; -import type { DeriveEraValidatorExposure, DeriveStakerExposure } from './types'; +import type { DeriveApi } from '../types.js'; +import type { DeriveEraValidatorExposure, DeriveStakerExposure } from './types.js'; import { map, switchMap } from 'rxjs'; -import { firstMemo, memo } from '../util'; +import { firstMemo, memo } from '../util/index.js'; export function _stakerExposures (instanceId: string, api: DeriveApi): (accountIds: (Uint8Array | string)[], eras: EraIndex[], withActive?: boolean) => Observable { return memo(instanceId, (accountIds: (Uint8Array | string)[], eras: EraIndex[], withActive = false): Observable => { diff --git a/packages/api-derive/src/staking/stakerPoints.ts b/packages/api-derive/src/staking/stakerPoints.ts index 2888734f13..96b5219cba 100644 --- a/packages/api-derive/src/staking/stakerPoints.ts +++ b/packages/api-derive/src/staking/stakerPoints.ts @@ -3,12 +3,12 @@ import type { Observable } from 'rxjs'; import type { EraIndex } from '@polkadot/types/interfaces'; -import type { DeriveApi, DeriveStakerPoints } from '../types'; +import type { DeriveApi, DeriveStakerPoints } from '../types.js'; import { map } from 'rxjs'; -import { memo } from '../util'; -import { erasHistoricApplyAccount } from './util'; +import { memo } from '../util/index.js'; +import { erasHistoricApplyAccount } from './util.js'; export function _stakerPoints (instanceId: string, api: DeriveApi): (accountId: Uint8Array | string, eras: EraIndex[], withActive: boolean) => Observable { return memo(instanceId, (accountId: Uint8Array | string, eras: EraIndex[], withActive: boolean): Observable => { diff --git a/packages/api-derive/src/staking/stakerPrefs.ts b/packages/api-derive/src/staking/stakerPrefs.ts index 986090b31e..6280a7418d 100644 --- a/packages/api-derive/src/staking/stakerPrefs.ts +++ b/packages/api-derive/src/staking/stakerPrefs.ts @@ -3,12 +3,12 @@ import type { Observable } from 'rxjs'; import type { EraIndex } from '@polkadot/types/interfaces'; -import type { DeriveApi, DeriveStakerPrefs } from '../types'; +import type { DeriveApi, DeriveStakerPrefs } from '../types.js'; import { map } from 'rxjs'; -import { memo } from '../util'; -import { erasHistoricApplyAccount } from './util'; +import { memo } from '../util/index.js'; +import { erasHistoricApplyAccount } from './util.js'; export function _stakerPrefs (instanceId: string, api: DeriveApi): (accountId: Uint8Array | string, eras: EraIndex[], withActive: boolean) => Observable { // eslint-disable-next-line @typescript-eslint/no-unused-vars diff --git a/packages/api-derive/src/staking/stakerRewards.ts b/packages/api-derive/src/staking/stakerRewards.ts index ca69d05bc9..a8bddb6c05 100644 --- a/packages/api-derive/src/staking/stakerRewards.ts +++ b/packages/api-derive/src/staking/stakerRewards.ts @@ -5,14 +5,14 @@ import type { Observable } from 'rxjs'; import type { AccountId, EraIndex } from '@polkadot/types/interfaces'; import type { PalletStakingStakingLedger } from '@polkadot/types/lookup'; import type { BN } from '@polkadot/util'; -import type { DeriveApi, DeriveEraPoints, DeriveEraPrefs, DeriveEraRewards, DeriveEraValPoints, DeriveEraValPrefs, DeriveStakerExposure, DeriveStakerReward, DeriveStakerRewardValidator } from '../types'; -import type { DeriveStakingQuery } from './types'; +import type { DeriveApi, DeriveEraPoints, DeriveEraPrefs, DeriveEraRewards, DeriveEraValPoints, DeriveEraValPrefs, DeriveStakerExposure, DeriveStakerReward, DeriveStakerRewardValidator } from '../types.js'; +import type { DeriveStakingQuery } from './types.js'; import { combineLatest, map, of, switchMap } from 'rxjs'; import { BN_BILLION, BN_ZERO, objectSpread } from '@polkadot/util'; -import { firstMemo, memo } from '../util'; +import { firstMemo, memo } from '../util/index.js'; type ErasResult = [DeriveEraPoints[], DeriveEraPrefs[], DeriveEraRewards[]]; diff --git a/packages/api-derive/src/staking/stakerSlashes.ts b/packages/api-derive/src/staking/stakerSlashes.ts index fd567a4eea..d17919b9f0 100644 --- a/packages/api-derive/src/staking/stakerSlashes.ts +++ b/packages/api-derive/src/staking/stakerSlashes.ts @@ -3,12 +3,12 @@ import type { Observable } from 'rxjs'; import type { EraIndex } from '@polkadot/types/interfaces'; -import type { DeriveApi, DeriveStakerSlashes } from '../types'; +import type { DeriveApi, DeriveStakerSlashes } from '../types.js'; import { map } from 'rxjs'; -import { memo } from '../util'; -import { erasHistoricApplyAccount } from './util'; +import { memo } from '../util/index.js'; +import { erasHistoricApplyAccount } from './util.js'; export function _stakerSlashes (instanceId: string, api: DeriveApi): (accountId: Uint8Array | string, eras: EraIndex[], withActive: boolean) => Observable { return memo(instanceId, (accountId: Uint8Array | string, eras: EraIndex[], withActive: boolean): Observable => { diff --git a/packages/api-derive/src/staking/stashes.ts b/packages/api-derive/src/staking/stashes.ts index 285b004905..5aa152c74b 100644 --- a/packages/api-derive/src/staking/stashes.ts +++ b/packages/api-derive/src/staking/stashes.ts @@ -3,11 +3,11 @@ import type { Observable } from 'rxjs'; import type { AccountId } from '@polkadot/types/interfaces'; -import type { DeriveApi } from '../types'; +import type { DeriveApi } from '../types.js'; import { map, startWith, switchMap } from 'rxjs'; -import { drr, memo } from '../util'; +import { drr, memo } from '../util/index.js'; function onBondedEvent (api: DeriveApi): Observable { let current = Date.now(); diff --git a/packages/api-derive/src/staking/util.ts b/packages/api-derive/src/staking/util.ts index f357113446..8ebb96657d 100644 --- a/packages/api-derive/src/staking/util.ts +++ b/packages/api-derive/src/staking/util.ts @@ -5,13 +5,13 @@ import type { Observable } from 'rxjs'; import type { ObsInnerType } from '@polkadot/api-base/types'; import type { EraIndex } from '@polkadot/types/interfaces'; import type { ExactDerive } from '../derive'; -import type { DeriveApi } from '../types'; +import type { DeriveApi } from '../types.js'; import { BehaviorSubject, combineLatest, map, of, switchMap, tap, toArray } from 'rxjs'; import { arrayChunk, arrayFlatten, nextTick } from '@polkadot/util'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; type ApplyReturn = ReturnType; diff --git a/packages/api-derive/src/staking/validators.ts b/packages/api-derive/src/staking/validators.ts index ba49b2c5fb..c21390ab39 100644 --- a/packages/api-derive/src/staking/validators.ts +++ b/packages/api-derive/src/staking/validators.ts @@ -3,11 +3,11 @@ import type { Observable } from 'rxjs'; import type { AccountId } from '@polkadot/types/interfaces'; -import type { DeriveApi, DeriveStakingValidators } from '../types'; +import type { DeriveApi, DeriveStakingValidators } from '../types.js'; import { combineLatest, map, of, switchMap } from 'rxjs'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; export function nextElected (instanceId: string, api: DeriveApi): () => Observable { return memo(instanceId, (): Observable => diff --git a/packages/api-derive/src/staking/waitingInfo.ts b/packages/api-derive/src/staking/waitingInfo.ts index a7001167a1..5d1772c548 100644 --- a/packages/api-derive/src/staking/waitingInfo.ts +++ b/packages/api-derive/src/staking/waitingInfo.ts @@ -2,11 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { Observable } from 'rxjs'; -import type { DeriveApi, DeriveStakingWaiting, StakingQueryFlags } from '../types'; +import type { DeriveApi, DeriveStakingWaiting, StakingQueryFlags } from '../types.js'; import { combineLatest, map, switchMap } from 'rxjs'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; const DEFAULT_FLAGS = { withController: true, withPrefs: true }; diff --git a/packages/api-derive/src/technicalCommittee/index.ts b/packages/api-derive/src/technicalCommittee/index.ts index 149c4c4c2b..c7673b6896 100644 --- a/packages/api-derive/src/technicalCommittee/index.ts +++ b/packages/api-derive/src/technicalCommittee/index.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { hasProposals as collectiveHasProposals, members as collectiveMembers, prime as collectivePrime, proposal as collectiveProposal, proposalCount as collectiveProposalCount, proposalHashes as collectiveProposalHashes, proposals as collectiveProposals } from '../collective'; +import { hasProposals as collectiveHasProposals, members as collectiveMembers, prime as collectivePrime, proposal as collectiveProposal, proposalCount as collectiveProposalCount, proposalHashes as collectiveProposalHashes, proposals as collectiveProposals } from '../collective/index.js'; export const members = collectiveMembers('technicalCommittee'); diff --git a/packages/api-derive/src/treasury/index.ts b/packages/api-derive/src/treasury/index.ts index 2138e1370b..43077ef9e7 100644 --- a/packages/api-derive/src/treasury/index.ts +++ b/packages/api-derive/src/treasury/index.ts @@ -1,4 +1,4 @@ // Copyright 2017-2023 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -export * from './proposals'; +export * from './proposals.js'; diff --git a/packages/api-derive/src/treasury/proposals.ts b/packages/api-derive/src/treasury/proposals.ts index fefa40f978..225598514a 100644 --- a/packages/api-derive/src/treasury/proposals.ts +++ b/packages/api-derive/src/treasury/proposals.ts @@ -5,11 +5,11 @@ import type { Observable } from 'rxjs'; import type { Option } from '@polkadot/types'; import type { ProposalIndex } from '@polkadot/types/interfaces'; import type { PalletTreasuryProposal } from '@polkadot/types/lookup'; -import type { DeriveApi, DeriveCollectiveProposal, DeriveTreasuryProposal, DeriveTreasuryProposals } from '../types'; +import type { DeriveApi, DeriveCollectiveProposal, DeriveTreasuryProposal, DeriveTreasuryProposals } from '../types.js'; import { combineLatest, map, of, switchMap } from 'rxjs'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; interface Result { allIds: ProposalIndex[]; diff --git a/packages/api-derive/src/tx/events.ts b/packages/api-derive/src/tx/events.ts index 27712eff0e..08740bc507 100644 --- a/packages/api-derive/src/tx/events.ts +++ b/packages/api-derive/src/tx/events.ts @@ -3,11 +3,11 @@ import type { Observable } from 'rxjs'; import type { EventRecord, Hash, SignedBlock } from '@polkadot/types/interfaces'; -import type { DeriveApi } from '../types'; +import type { DeriveApi } from '../types.js'; import { combineLatest, map, switchMap } from 'rxjs'; -import { memo } from '../util'; +import { memo } from '../util/index.js'; interface Result { block: SignedBlock; diff --git a/packages/api-derive/src/tx/index.ts b/packages/api-derive/src/tx/index.ts index c97c771074..25eaaf06ce 100644 --- a/packages/api-derive/src/tx/index.ts +++ b/packages/api-derive/src/tx/index.ts @@ -1,5 +1,5 @@ // Copyright 2017-2023 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -export * from './events'; -export * from './signingInfo'; +export * from './events.js'; +export * from './signingInfo.js'; diff --git a/packages/api-derive/src/tx/signingInfo.ts b/packages/api-derive/src/tx/signingInfo.ts index 597518413d..289022ca6e 100644 --- a/packages/api-derive/src/tx/signingInfo.ts +++ b/packages/api-derive/src/tx/signingInfo.ts @@ -4,14 +4,14 @@ import type { Observable } from 'rxjs'; import type { Header, Index } from '@polkadot/types/interfaces'; import type { AnyNumber, Codec, IExtrinsicEra } from '@polkadot/types/types'; -import type { DeriveApi } from '../types'; +import type { DeriveApi } from '../types.js'; import { combineLatest, map, of, switchMap } from 'rxjs'; import { isNumber, isUndefined } from '@polkadot/util'; -import { unwrapBlockNumber } from '../util'; -import { FALLBACK_MAX_HASH_COUNT, FALLBACK_PERIOD, MAX_FINALITY_LAG, MORTAL_PERIOD } from './constants'; +import { unwrapBlockNumber } from '../util/index.js'; +import { FALLBACK_MAX_HASH_COUNT, FALLBACK_PERIOD, MAX_FINALITY_LAG, MORTAL_PERIOD } from './constants.js'; interface Result { header: Header | null; diff --git a/packages/api-derive/src/type/HeaderExtended.ts b/packages/api-derive/src/type/HeaderExtended.ts index d1497f3cfa..bcc707666c 100644 --- a/packages/api-derive/src/type/HeaderExtended.ts +++ b/packages/api-derive/src/type/HeaderExtended.ts @@ -3,9 +3,9 @@ import type { AccountId, Header } from '@polkadot/types/interfaces'; import type { Registry } from '@polkadot/types/types'; -import type { HeaderExtended } from './types'; +import type { HeaderExtended } from './types.js'; -import { extractAuthor } from './util'; +import { extractAuthor } from './util.js'; export function createHeaderExtended (registry: Registry, header?: Header, validators?: AccountId[] | null, author?: AccountId | null): HeaderExtended { // an instance of the base extrinsic for us to extend diff --git a/packages/api-derive/src/type/SignedBlockExtended.ts b/packages/api-derive/src/type/SignedBlockExtended.ts index ce4d9b5a49..721d3a8fa3 100644 --- a/packages/api-derive/src/type/SignedBlockExtended.ts +++ b/packages/api-derive/src/type/SignedBlockExtended.ts @@ -3,9 +3,9 @@ import type { AccountId, DispatchError, DispatchInfo, EventRecord, Extrinsic, SignedBlock } from '@polkadot/types/interfaces'; import type { Registry } from '@polkadot/types/types'; -import type { SignedBlockExtended, TxWithEvent } from './types'; +import type { SignedBlockExtended, TxWithEvent } from './types.js'; -import { extractAuthor } from './util'; +import { extractAuthor } from './util.js'; function mapExtrinsics (extrinsics: Extrinsic[], records: EventRecord[]): TxWithEvent[] { return extrinsics.map((extrinsic, index): TxWithEvent => { diff --git a/packages/api-derive/src/type/index.ts b/packages/api-derive/src/type/index.ts index b9c6395447..ae7f3e646e 100644 --- a/packages/api-derive/src/type/index.ts +++ b/packages/api-derive/src/type/index.ts @@ -1,5 +1,5 @@ // Copyright 2017-2023 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -export { createHeaderExtended } from './HeaderExtended'; -export { createSignedBlockExtended } from './SignedBlockExtended'; +export { createHeaderExtended } from './HeaderExtended.js'; +export { createSignedBlockExtended } from './SignedBlockExtended.js'; diff --git a/packages/api-derive/src/types.ts b/packages/api-derive/src/types.ts index 7b93758d5e..41b9f7a13d 100644 --- a/packages/api-derive/src/types.ts +++ b/packages/api-derive/src/types.ts @@ -8,18 +8,18 @@ import type { PalletBountiesBounty, PalletTreasuryProposal } from '@polkadot/typ import type { BN } from '@polkadot/util'; import type { ExactDerive } from './derive'; -export * from './accounts/types'; -export * from './balances/types'; -export * from './bagsList/types'; -export * from './council/types'; -export * from './crowdloan/types'; -export * from './democracy/types'; -export * from './elections/types'; -export * from './parachains/types'; -export * from './session/types'; -export * from './society/types'; -export * from './staking/types'; -export * from './type/types'; +export * from './accounts/types.js'; +export * from './balances/types.js'; +export * from './bagsList/types.js'; +export * from './council/types.js'; +export * from './crowdloan/types.js'; +export * from './democracy/types.js'; +export * from './elections/types.js'; +export * from './parachains/types.js'; +export * from './session/types.js'; +export * from './society/types.js'; +export * from './staking/types.js'; +export * from './type/types.js'; export interface DeriveApi extends ApiInterfaceRx { derive: ExactDerive; diff --git a/packages/api-derive/src/util/approvalFlagToBools.spec.ts b/packages/api-derive/src/util/approvalFlagToBools.spec.ts index 510371ea65..b117820ac2 100644 --- a/packages/api-derive/src/util/approvalFlagToBools.spec.ts +++ b/packages/api-derive/src/util/approvalFlagToBools.spec.ts @@ -7,7 +7,7 @@ import type { ApprovalFlag } from '@polkadot/types/interfaces'; import { TypeRegistry } from '@polkadot/types/create'; -import { approvalFlagsToBools } from './approvalFlagsToBools'; +import { approvalFlagsToBools } from './approvalFlagsToBools.js'; describe('approvalFlagsToBools', (): void => { const registry = new TypeRegistry(); diff --git a/packages/api-derive/src/util/cache.ts b/packages/api-derive/src/util/cache.ts index 833f454043..684f5fcf6a 100644 --- a/packages/api-derive/src/util/cache.ts +++ b/packages/api-derive/src/util/cache.ts @@ -1,9 +1,9 @@ // Copyright 2017-2023 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveCache } from './types'; +import type { DeriveCache } from './types.js'; -import { deriveNoopCache } from './cacheImpl'; +import { deriveNoopCache } from './cacheImpl.js'; interface CacheValue { v: T; diff --git a/packages/api-derive/src/util/cacheImpl.ts b/packages/api-derive/src/util/cacheImpl.ts index 41f1a58afc..2ac773e628 100644 --- a/packages/api-derive/src/util/cacheImpl.ts +++ b/packages/api-derive/src/util/cacheImpl.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveCache } from './types'; +import type { DeriveCache } from './types.js'; const mapCache = new Map(); diff --git a/packages/api-derive/src/util/first.ts b/packages/api-derive/src/util/first.ts index 882e638380..01afbaf03f 100644 --- a/packages/api-derive/src/util/first.ts +++ b/packages/api-derive/src/util/first.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { Observable } from 'rxjs'; -import type { DeriveApi } from '../types'; +import type { DeriveApi } from '../types.js'; import { map } from 'rxjs'; diff --git a/packages/api-derive/src/util/index.ts b/packages/api-derive/src/util/index.ts index d7361d6a24..0d1c5ee08e 100644 --- a/packages/api-derive/src/util/index.ts +++ b/packages/api-derive/src/util/index.ts @@ -3,9 +3,9 @@ export { drr, memo } from '@polkadot/rpc-core'; -export * from './approvalFlagsToBools'; -export * from './blockNumber'; -export * from './cache'; -export * from './cacheImpl'; -export * from './first'; -export * from './lazy'; +export * from './approvalFlagsToBools.js'; +export * from './blockNumber.js'; +export * from './cache.js'; +export * from './cacheImpl.js'; +export * from './first.js'; +export * from './lazy.js'; diff --git a/packages/api/src/base/Decorate.ts b/packages/api/src/base/Decorate.ts index 66e5b713f4..500242aad2 100644 --- a/packages/api/src/base/Decorate.ts +++ b/packages/api/src/base/Decorate.ts @@ -10,9 +10,9 @@ import type { DecoratedMeta } from '@polkadot/types/metadata/decorate/types'; import type { StorageEntry } from '@polkadot/types/primitive/types'; import type { AnyFunction, AnyJson, AnyTuple, CallFunction, Codec, DefinitionCallNamed, DefinitionRpc, DefinitionRpcSub, DefinitionsCall, DefinitionsCallEntry, DetectCodec, IMethod, IStorageKey, Registry, RegistryError, RegistryTypes } from '@polkadot/types/types'; import type { HexString } from '@polkadot/util/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 { VersionedRegistry } from './types'; +import type { SubmittableExtrinsic } from '../submittable/types.js'; +import type { ApiDecoration, ApiInterfaceRx, ApiOptions, ApiTypes, AugmentedQuery, DecoratedErrors, DecoratedEvents, DecoratedRpc, DecorateMethod, GenericStorageEntryFunction, PaginationOptions, QueryableConsts, QueryableStorage, QueryableStorageEntry, QueryableStorageEntryAt, QueryableStorageMulti, QueryableStorageMultiArg, SubmittableExtrinsicFunction, SubmittableExtrinsics } from '../types/index.js'; +import type { VersionedRegistry } from './types.js'; import { BehaviorSubject, combineLatest, from, map, of, switchMap, tap, toArray } from 'rxjs'; @@ -24,12 +24,12 @@ import { getSpecRuntime } from '@polkadot/types-known'; import { arrayChunk, arrayFlatten, assertReturn, BN, compactStripLength, lazyMethod, lazyMethods, logger, nextTick, objectSpread, stringCamelCase, stringUpperFirst, u8aConcatStrict, u8aToHex } from '@polkadot/util'; import { blake2AsHex } from '@polkadot/util-crypto'; -import { createSubmittable } from '../submittable'; -import { augmentObject } from '../util/augmentObject'; -import { AllDerives, decorateDeriveSections } from '../util/decorate'; -import { extractStorageArgs } from '../util/validate'; -import { Events } from './Events'; -import { findCall, findError } from './find'; +import { createSubmittable } from '../submittable/index.js'; +import { augmentObject } from '../util/augmentObject.js'; +import { AllDerives, decorateDeriveSections } from '../util/decorate.js'; +import { extractStorageArgs } from '../util/validate.js'; +import { Events } from './Events.js'; +import { findCall, findError } from './find.js'; interface MetaDecoration { callIndex?: Uint8Array; diff --git a/packages/api/src/base/Events.ts b/packages/api/src/base/Events.ts index 3b18d53cf8..f2d9796f6a 100644 --- a/packages/api/src/base/Events.ts +++ b/packages/api/src/base/Events.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ApiInterfaceEvents } from '../types'; +import type { ApiInterfaceEvents } from '../types/index.js'; import EventEmitter from 'eventemitter3'; diff --git a/packages/api/src/base/Getters.ts b/packages/api/src/base/Getters.ts index 43922f77ec..7b062f11c9 100644 --- a/packages/api/src/base/Getters.ts +++ b/packages/api/src/base/Getters.ts @@ -7,11 +7,11 @@ import type { Text } from '@polkadot/types'; import type { Hash, RuntimeVersion } from '@polkadot/types/interfaces'; import type { Metadata } from '@polkadot/types/metadata'; import type { CallFunction, RegistryError } from '@polkadot/types/types'; -import type { ApiDecoration, ApiInterfaceRx, ApiTypes, DecoratedErrors, DecoratedEvents, DecoratedRpc, QueryableCalls, QueryableConsts, QueryableStorage, QueryableStorageMulti, SubmittableExtrinsics } from '../types'; +import type { ApiDecoration, ApiInterfaceRx, ApiTypes, DecoratedErrors, DecoratedEvents, DecoratedRpc, QueryableCalls, QueryableConsts, QueryableStorage, QueryableStorageMulti, SubmittableExtrinsics } from '../types/index.js'; -import { packageInfo } from '../packageInfo'; -import { findCall, findError } from './find'; -import { Init } from './Init'; +import { packageInfo } from '../packageInfo.js'; +import { findCall, findError } from './find.js'; +import { Init } from './Init.js'; interface PkgJson { name: string; diff --git a/packages/api/src/base/Init.ts b/packages/api/src/base/Init.ts index 049f12e790..4a826672da 100644 --- a/packages/api/src/base/Init.ts +++ b/packages/api/src/base/Init.ts @@ -8,8 +8,8 @@ import type { ChainProperties, Hash, HeaderPartial, RuntimeVersion, RuntimeVersi import type { Registry } from '@polkadot/types/types'; import type { BN } from '@polkadot/util'; import type { HexString } from '@polkadot/util/types'; -import type { ApiBase, ApiDecoration, ApiOptions, ApiTypes, DecorateMethod } from '../types'; -import type { VersionedRegistry } from './types'; +import type { ApiBase, ApiDecoration, ApiOptions, ApiTypes, DecorateMethod } from '../types/index.js'; +import type { VersionedRegistry } from './types.js'; import { firstValueFrom, map, of, switchMap } from 'rxjs'; @@ -18,7 +18,7 @@ import { getSpecAlias, getSpecExtensions, getSpecHasher, getSpecRpc, getSpecType import { assertReturn, BN_ZERO, isUndefined, logger, objectSpread, u8aEq, u8aToHex, u8aToU8a } from '@polkadot/util'; import { cryptoWaitReady } from '@polkadot/util-crypto'; -import { Decorate } from './Decorate'; +import { Decorate } from './Decorate.js'; const KEEPALIVE_INTERVAL = 10000; const WITH_VERSION_SHORTCUT = false; diff --git a/packages/api/src/base/index.ts b/packages/api/src/base/index.ts index f94e2edbb3..39c69ae6f1 100644 --- a/packages/api/src/base/index.ts +++ b/packages/api/src/base/index.ts @@ -2,11 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { SignerPayloadRawBase } from '@polkadot/types/types'; -import type { ApiOptions, ApiTypes, DecorateMethod, Signer } from '../types'; +import type { ApiOptions, ApiTypes, DecorateMethod, Signer } from '../types/index.js'; import { isString, objectSpread, u8aToHex, u8aToU8a } from '@polkadot/util'; -import { Getters } from './Getters'; +import { Getters } from './Getters.js'; interface KeyringSigner { sign (message: Uint8Array): Uint8Array; diff --git a/packages/api/src/base/types.ts b/packages/api/src/base/types.ts index d8bc158071..1914a391b8 100644 --- a/packages/api/src/base/types.ts +++ b/packages/api/src/base/types.ts @@ -5,7 +5,7 @@ import type { Metadata } from '@polkadot/types'; import type { RuntimeVersionPartial } from '@polkadot/types/interfaces'; import type { DecoratedMeta } from '@polkadot/types/metadata/decorate/types'; import type { Registry } from '@polkadot/types/types'; -import type { ApiDecoration, ApiTypes } from '../types'; +import type { ApiDecoration, ApiTypes } from '../types/index.js'; export interface VersionedRegistry { counter: number; diff --git a/packages/api/src/bundle.ts b/packages/api/src/bundle.ts index 9dd748896e..5585e864dd 100644 --- a/packages/api/src/bundle.ts +++ b/packages/api/src/bundle.ts @@ -6,8 +6,8 @@ import '@polkadot/rpc-augment'; export { Keyring } from '@polkadot/keyring'; export { HttpProvider, ScProvider, WsProvider } from '@polkadot/rpc-provider'; -export { packageInfo } from './packageInfo'; -export { SubmittableResult } from './submittable'; +export { packageInfo } from './packageInfo.js'; +export { SubmittableResult } from './submittable/index.js'; -export * from './promise'; -export * from './rx'; +export * from './promise/index.js'; +export * from './rx/index.js'; diff --git a/packages/api/src/checkTypes.manual.ts b/packages/api/src/checkTypes.manual.ts index 9d723b836d..e3b266f126 100644 --- a/packages/api/src/checkTypes.manual.ts +++ b/packages/api/src/checkTypes.manual.ts @@ -15,7 +15,7 @@ import { ApiPromise } from '@polkadot/api'; import { createTestPairs, TestKeyringMap } from '@polkadot/keyring/testingPairs'; import { createTypeUnsafe, TypeRegistry } from '@polkadot/types/create'; -import { SubmittableResult } from './'; +import { SubmittableResult } from './index.js'; const registry = new TypeRegistry(); diff --git a/packages/api/src/detectPackage.ts b/packages/api/src/detectPackage.ts index d028552081..ef4b515188 100644 --- a/packages/api/src/detectPackage.ts +++ b/packages/api/src/detectPackage.ts @@ -5,7 +5,7 @@ import { detectPackage } from '@polkadot/util'; -import others from './detectOther'; -import { packageInfo } from './packageInfo'; +import others from './detectOther.js'; +import { packageInfo } from './packageInfo.js'; detectPackage(packageInfo, null, others); diff --git a/packages/api/src/index.ts b/packages/api/src/index.ts index c54f9ddb71..7f8d67b863 100644 --- a/packages/api/src/index.ts +++ b/packages/api/src/index.ts @@ -1,6 +1,6 @@ // Copyright 2017-2023 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import './detectPackage'; +import './detectPackage.js'; -export * from './bundle'; +export * from './bundle.js'; diff --git a/packages/api/src/mod.ts b/packages/api/src/mod.ts index 709c8fca6e..2221bc5945 100644 --- a/packages/api/src/mod.ts +++ b/packages/api/src/mod.ts @@ -1,4 +1,4 @@ // Copyright 2017-2023 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -export * from './index'; +export * from './index.js'; diff --git a/packages/api/src/promise/Api.ts b/packages/api/src/promise/Api.ts index eb9263d5c3..f6fd39586a 100644 --- a/packages/api/src/promise/Api.ts +++ b/packages/api/src/promise/Api.ts @@ -1,13 +1,13 @@ // Copyright 2017-2023 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ApiOptions, UnsubscribePromise } from '../types'; +import type { ApiOptions, UnsubscribePromise } from '../types/index.js'; import { objectSpread } from '@polkadot/util'; -import { ApiBase } from '../base'; -import { Combinator, CombinatorCallback, CombinatorFunction } from './Combinator'; -import { promiseTracker, toPromiseMethod } from './decorateMethod'; +import { ApiBase } from '../base/index.js'; +import { Combinator, CombinatorCallback, CombinatorFunction } from './Combinator.js'; +import { promiseTracker, toPromiseMethod } from './decorateMethod.js'; /** * # @polkadot/api/promise diff --git a/packages/api/src/promise/Combinator.ts b/packages/api/src/promise/Combinator.ts index aafbeee1dd..ca1c817fca 100644 --- a/packages/api/src/promise/Combinator.ts +++ b/packages/api/src/promise/Combinator.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { Callback } from '@polkadot/types/types'; -import type { UnsubscribePromise } from '../types'; +import type { UnsubscribePromise } from '../types/index.js'; import { isFunction } from '@polkadot/util'; diff --git a/packages/api/src/promise/Combinators.spec.ts b/packages/api/src/promise/Combinators.spec.ts index 678ec97087..e14db3ac47 100644 --- a/packages/api/src/promise/Combinators.spec.ts +++ b/packages/api/src/promise/Combinators.spec.ts @@ -3,9 +3,9 @@ /// -import type { UnsubscribePromise } from '../types'; +import type { UnsubscribePromise } from '../types/index.js'; -import { Combinator } from './Combinator'; +import { Combinator } from './Combinator.js'; describe('Combinator', (): void => { let fns: ((value: any) => void)[] = []; diff --git a/packages/api/src/promise/decorateMethod.ts b/packages/api/src/promise/decorateMethod.ts index d7357d6e04..38ff459ef5 100644 --- a/packages/api/src/promise/decorateMethod.ts +++ b/packages/api/src/promise/decorateMethod.ts @@ -3,7 +3,7 @@ import type { Observable } from 'rxjs'; import type { Callback, Codec } from '@polkadot/types/types'; -import type { DecorateFn, DecorateMethodOptions, ObsInnerType, StorageEntryPromiseOverloads, UnsubscribePromise, VoidFn } from '../types'; +import type { DecorateFn, DecorateMethodOptions, ObsInnerType, StorageEntryPromiseOverloads, UnsubscribePromise, VoidFn } from '../types/index.js'; import { catchError, EMPTY, Subscription, tap } from 'rxjs'; diff --git a/packages/api/src/promise/index.spec.ts b/packages/api/src/promise/index.spec.ts index d9d3c8b1f9..5999806efe 100644 --- a/packages/api/src/promise/index.spec.ts +++ b/packages/api/src/promise/index.spec.ts @@ -4,7 +4,7 @@ /// import type { HexString } from '@polkadot/util/types'; -import type { SubmittableExtrinsic } from '../types'; +import type { SubmittableExtrinsic } from '../types/index.js'; import { createPair } from '@polkadot/keyring/pair'; import { createTestKeyring } from '@polkadot/keyring/testing'; @@ -12,8 +12,8 @@ import { MockProvider } from '@polkadot/rpc-provider/mock'; import { TypeRegistry } from '@polkadot/types'; import { hexToU8a } from '@polkadot/util'; -import { SingleAccountSigner } from '../test'; -import { ApiPromise } from '.'; +import { SingleAccountSigner } from '../test/index.js'; +import { ApiPromise } from './index.js'; const TRANSFER_SIG = '0xcc277eb341d3801c08f149508221583fa3185cc3944e6cb376cd061640305edd7dc24dfd754adb24768f1d8547389b7720e6f626bc81f5593fba1141e7f7ba07'; diff --git a/packages/api/src/promise/index.ts b/packages/api/src/promise/index.ts index 54aff3b341..9843ac0cb9 100644 --- a/packages/api/src/promise/index.ts +++ b/packages/api/src/promise/index.ts @@ -1,5 +1,5 @@ // Copyright 2017-2023 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -export { ApiPromise } from './Api'; -export { toPromiseMethod } from './decorateMethod'; +export { ApiPromise } from './Api.js'; +export { toPromiseMethod } from './decorateMethod.js'; diff --git a/packages/api/src/promise/types.ts b/packages/api/src/promise/types.ts index 67e8813f82..af00b302c0 100644 --- a/packages/api/src/promise/types.ts +++ b/packages/api/src/promise/types.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { SubmittableExtrinsic as SubmittableExtrinsicBase } from '../submittable/types'; -import type { QueryableStorageEntry as QueryableStorageEntryBase, SubmittableExtrinsicFunction as SubmittableExtrinsicFunctionBase } from '../types'; +import type { QueryableStorageEntry as QueryableStorageEntryBase, SubmittableExtrinsicFunction as SubmittableExtrinsicFunctionBase } from '../types/index.js'; export type QueryableStorageEntry = QueryableStorageEntryBase<'promise'>; export type SubmittableExtrinsic = SubmittableExtrinsicBase<'promise'>; diff --git a/packages/api/src/rx/Api.ts b/packages/api/src/rx/Api.ts index 54aea02de8..a627507ee2 100644 --- a/packages/api/src/rx/Api.ts +++ b/packages/api/src/rx/Api.ts @@ -1,14 +1,14 @@ // Copyright 2017-2023 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ApiOptions } from '../types'; +import type { ApiOptions } from '../types/index.js'; import { from, Observable } from 'rxjs'; import { objectSpread } from '@polkadot/util'; -import { ApiBase } from '../base'; -import { toRxMethod } from './decorateMethod'; +import { ApiBase } from '../base/index.js'; +import { toRxMethod } from './decorateMethod.js'; /** * # @polkadot/api/rx diff --git a/packages/api/src/rx/decorateMethod.ts b/packages/api/src/rx/decorateMethod.ts index 0f56db12e5..2c6ac77d29 100644 --- a/packages/api/src/rx/decorateMethod.ts +++ b/packages/api/src/rx/decorateMethod.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { Codec } from '@polkadot/types/types'; -import type { DecorateFn } from '../types'; +import type { DecorateFn } from '../types/index.js'; export function toRxMethod > (method: M): M { return method; diff --git a/packages/api/src/rx/index.ts b/packages/api/src/rx/index.ts index 17f6290437..add5ce01ce 100644 --- a/packages/api/src/rx/index.ts +++ b/packages/api/src/rx/index.ts @@ -1,5 +1,5 @@ // Copyright 2017-2023 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -export { ApiRx } from './Api'; -export { toRxMethod } from './decorateMethod'; +export { ApiRx } from './Api.js'; +export { toRxMethod } from './decorateMethod.js'; diff --git a/packages/api/src/submittable/Result.ts b/packages/api/src/submittable/Result.ts index 54b2e69b3f..887019babf 100644 --- a/packages/api/src/submittable/Result.ts +++ b/packages/api/src/submittable/Result.ts @@ -3,7 +3,7 @@ import type { BlockNumber, DispatchError, DispatchInfo, EventRecord, ExtrinsicStatus, Hash } from '@polkadot/types/interfaces'; import type { AnyJson, ISubmittableResult } from '@polkadot/types/types'; -import type { SubmittableResultValue } from './types'; +import type { SubmittableResultValue } from './types.js'; const recordIdentity = (record: EventRecord) => record; diff --git a/packages/api/src/submittable/createClass.ts b/packages/api/src/submittable/createClass.ts index 5f31808ef2..f2e63784ae 100644 --- a/packages/api/src/submittable/createClass.ts +++ b/packages/api/src/submittable/createClass.ts @@ -7,16 +7,16 @@ import type { Observable } from 'rxjs'; import type { Address, ApplyExtrinsicResult, Call, Extrinsic, ExtrinsicEra, ExtrinsicStatus, Hash, Header, Index, RuntimeDispatchInfo, SignerPayload } from '@polkadot/types/interfaces'; import type { Callback, Codec, Constructor, ISubmittableResult, SignatureOptions } from '@polkadot/types/types'; import type { Registry } from '@polkadot/types-codec/types'; -import type { ApiInterfaceRx, ApiTypes, PromiseOrObs, SignerResult } from '../types'; -import type { AddressOrPair, SignerOptions, SubmittableDryRunResult, SubmittableExtrinsic, SubmittablePaymentResult, SubmittableResultResult, SubmittableResultSubscription } from './types'; +import type { ApiInterfaceRx, ApiTypes, PromiseOrObs, SignerResult } from '../types/index.js'; +import type { AddressOrPair, SignerOptions, SubmittableDryRunResult, SubmittableExtrinsic, SubmittablePaymentResult, SubmittableResultResult, SubmittableResultSubscription } from './types.js'; import { catchError, first, map, mergeMap, of, switchMap, tap } from 'rxjs'; import { isBn, isFunction, isNumber, isString, isU8a, objectSpread } from '@polkadot/util'; -import { ApiBase } from '../base'; -import { filterEvents, isKeyringPair } from '../util'; -import { SubmittableResult } from './Result'; +import { ApiBase } from '../base/index.js'; +import { filterEvents, isKeyringPair } from '../util/index.js'; +import { SubmittableResult } from './Result.js'; interface SubmittableOptions { api: ApiInterfaceRx; diff --git a/packages/api/src/submittable/createSubmittable.ts b/packages/api/src/submittable/createSubmittable.ts index 812ba6287a..5b95cf5f93 100644 --- a/packages/api/src/submittable/createSubmittable.ts +++ b/packages/api/src/submittable/createSubmittable.ts @@ -3,11 +3,11 @@ import type { Call, Extrinsic } from '@polkadot/types/interfaces'; import type { Registry } from '@polkadot/types-codec/types'; -import type { ApiInterfaceRx, ApiTypes } from '../types'; -import type { SubmittableExtrinsic } from './types'; +import type { ApiInterfaceRx, ApiTypes } from '../types/index.js'; +import type { SubmittableExtrinsic } from './types.js'; -import { ApiBase } from '../base'; -import { createClass } from './createClass'; +import { ApiBase } from '../base/index.js'; +import { createClass } from './createClass.js'; type Creator = (extrinsic: Call | Uint8Array | string) => SubmittableExtrinsic; diff --git a/packages/api/src/submittable/index.ts b/packages/api/src/submittable/index.ts index 0ce0e0513d..e9f86725b1 100644 --- a/packages/api/src/submittable/index.ts +++ b/packages/api/src/submittable/index.ts @@ -1,5 +1,5 @@ // Copyright 2017-2023 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -export { createSubmittable } from './createSubmittable'; -export { SubmittableResult } from './Result'; +export { createSubmittable } from './createSubmittable.js'; +export { SubmittableResult } from './Result.js'; diff --git a/packages/api/src/test/index.ts b/packages/api/src/test/index.ts index fbfd99ac49..a10a86a951 100644 --- a/packages/api/src/test/index.ts +++ b/packages/api/src/test/index.ts @@ -1,5 +1,5 @@ // Copyright 2017-2023 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -export * from './logEvents'; -export * from './SingleAccountSigner'; +export * from './logEvents.js'; +export * from './SingleAccountSigner.js'; diff --git a/packages/api/src/test/logEvents.ts b/packages/api/src/test/logEvents.ts index 6e1c742a75..cb0f726800 100644 --- a/packages/api/src/test/logEvents.ts +++ b/packages/api/src/test/logEvents.ts @@ -3,7 +3,7 @@ import type { EventRecord } from '@polkadot/types/interfaces'; -import { SubmittableResult } from '..'; +import { SubmittableResult } from '../index.js'; // log all events for the transfers, calling done() when finalized export const logEvents = (done: () => Record): (r: SubmittableResult) => void => diff --git a/packages/api/src/types/index.ts b/packages/api/src/types/index.ts index bd41dcec42..8bc9442b8d 100644 --- a/packages/api/src/types/index.ts +++ b/packages/api/src/types/index.ts @@ -14,9 +14,9 @@ import type { Call, Extrinsic, Hash, RuntimeVersionPartial } from '@polkadot/typ import type { CallFunction, DefinitionRpc, DefinitionRpcSub, DefinitionsCall, RegisteredTypes, Registry, RegistryError, SignatureOptions, Signer } from '@polkadot/types/types'; import type { BN } from '@polkadot/util'; import type { HexString } from '@polkadot/util/types'; -import type { ApiBase } from '../base'; -import type { SubmittableExtrinsic } from '../types/submittable'; -import type { AllDerives } from '../util/decorate'; +import type { ApiBase } from '../base/index.js'; +import type { SubmittableExtrinsic } from '../types/submittable.js'; +import type { AllDerives } from '../util/decorate.js'; export * from '@polkadot/api-base/types'; export * from '@polkadot/api/types/calls'; @@ -28,7 +28,7 @@ export * from '@polkadot/api/types/submittable'; export type { Signer, SignerResult } from '@polkadot/types/types'; -export { ApiBase } from '../base'; +export { ApiBase } from '../base/index.js'; // A smaller interface of ApiRx, used in derive and in SubmittableExtrinsic export interface ApiInterfaceRx extends ApiInterfaceBase { diff --git a/packages/api/src/util/augmentObject.spec.ts b/packages/api/src/util/augmentObject.spec.ts index 22301ec0cb..7a280415cd 100644 --- a/packages/api/src/util/augmentObject.spec.ts +++ b/packages/api/src/util/augmentObject.spec.ts @@ -3,7 +3,7 @@ /// -import { augmentObject } from './augmentObject'; +import { augmentObject } from './augmentObject.js'; describe('augmentObject', (): void => { let spy: ReturnType; diff --git a/packages/api/src/util/decorate.ts b/packages/api/src/util/decorate.ts index 7c27a7a2b1..15bd225ac7 100644 --- a/packages/api/src/util/decorate.ts +++ b/packages/api/src/util/decorate.ts @@ -3,7 +3,7 @@ import type { ExactDerive } from '@polkadot/api-derive'; import type { AnyFunction } from '@polkadot/types/types'; -import type { ApiTypes, DecorateMethod, MethodResult } from '../types'; +import type { ApiTypes, DecorateMethod, MethodResult } from '../types/index.js'; import { lazyDeriveSection } from '@polkadot/api-derive'; diff --git a/packages/api/src/util/filterEvents.ts b/packages/api/src/util/filterEvents.ts index 02e5a5e941..a831597071 100644 --- a/packages/api/src/util/filterEvents.ts +++ b/packages/api/src/util/filterEvents.ts @@ -5,7 +5,7 @@ import type { BlockNumber, EventRecord, ExtrinsicStatus, H256, SignedBlock } fro import { isCompact } from '@polkadot/util'; -import { l } from './logging'; +import { l } from './logging.js'; export function filterEvents (txHash: H256, { block: { extrinsics, header } }: SignedBlock, allEvents: EventRecord[], status: ExtrinsicStatus): { events?: EventRecord[], txIndex?: number, blockNumber?: BlockNumber } { // extrinsics to hashes diff --git a/packages/api/src/util/index.ts b/packages/api/src/util/index.ts index e66e561e23..1d884867de 100644 --- a/packages/api/src/util/index.ts +++ b/packages/api/src/util/index.ts @@ -1,8 +1,8 @@ // Copyright 2017-2023 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -export * from './decorate'; +export * from './decorate.js'; -export { filterEvents } from './filterEvents'; -export { isKeyringPair } from './isKeyringPair'; -export { l } from './logging'; +export { filterEvents } from './filterEvents.js'; +export { isKeyringPair } from './isKeyringPair.js'; +export { l } from './logging.js'; diff --git a/packages/api/src/util/validate.spec.ts b/packages/api/src/util/validate.spec.ts index ebf6ddecdf..a2abbd7a60 100644 --- a/packages/api/src/util/validate.spec.ts +++ b/packages/api/src/util/validate.spec.ts @@ -6,7 +6,7 @@ import { decorateStorage, Metadata, TypeRegistry } from '@polkadot/types'; import metaStatic from '@polkadot/types-support/metadata/static-substrate'; -import { extractStorageArgs } from './validate'; +import { extractStorageArgs } from './validate.js'; describe('extractStorageArgs', (): void => { const registry = new TypeRegistry(); diff --git a/packages/rpc-augment/src/augment/index.ts b/packages/rpc-augment/src/augment/index.ts index de6d273ce6..5e8a1f1458 100644 --- a/packages/rpc-augment/src/augment/index.ts +++ b/packages/rpc-augment/src/augment/index.ts @@ -1,4 +1,4 @@ // Copyright 2017-2023 @polkadot/rpc-augment authors & contributors // SPDX-License-Identifier: Apache-2.0 -import './jsonrpc'; +import './jsonrpc.js'; diff --git a/packages/rpc-augment/src/bundle.ts b/packages/rpc-augment/src/bundle.ts index 0d00dcd01d..c6d704cfc7 100644 --- a/packages/rpc-augment/src/bundle.ts +++ b/packages/rpc-augment/src/bundle.ts @@ -1,6 +1,6 @@ // Copyright 2017-2023 @polkadot/rpc-augment authors & contributors // SPDX-License-Identifier: Apache-2.0 -import './augment'; +import './augment/index.js'; -export { packageInfo } from './packageInfo'; +export { packageInfo } from './packageInfo.js'; diff --git a/packages/rpc-augment/src/detectPackage.ts b/packages/rpc-augment/src/detectPackage.ts index 676e117230..e510b2dac5 100644 --- a/packages/rpc-augment/src/detectPackage.ts +++ b/packages/rpc-augment/src/detectPackage.ts @@ -5,7 +5,7 @@ import { detectPackage } from '@polkadot/util'; -import others from './detectOther'; -import { packageInfo } from './packageInfo'; +import others from './detectOther.js'; +import { packageInfo } from './packageInfo.js'; detectPackage(packageInfo, null, others); diff --git a/packages/rpc-augment/src/index.ts b/packages/rpc-augment/src/index.ts index bad5b9b93c..ce890f6d46 100644 --- a/packages/rpc-augment/src/index.ts +++ b/packages/rpc-augment/src/index.ts @@ -1,6 +1,6 @@ // Copyright 2017-2023 @polkadot/rpc-augment authors & contributors // SPDX-License-Identifier: Apache-2.0 -import './detectPackage'; +import './detectPackage.js'; -export * from './bundle'; +export * from './bundle.js'; diff --git a/packages/rpc-augment/src/mod.ts b/packages/rpc-augment/src/mod.ts index 20134aef98..06ce3c2b08 100644 --- a/packages/rpc-augment/src/mod.ts +++ b/packages/rpc-augment/src/mod.ts @@ -1,4 +1,4 @@ // Copyright 2017-2023 @polkadot/rpc-augment authors & contributors // SPDX-License-Identifier: Apache-2.0 -export * from './index'; +export * from './index.js'; diff --git a/packages/rpc-core/src/bundle.ts b/packages/rpc-core/src/bundle.ts index 64ab65d790..c1727cba55 100644 --- a/packages/rpc-core/src/bundle.ts +++ b/packages/rpc-core/src/bundle.ts @@ -7,17 +7,17 @@ import type { StorageKey, Vec } from '@polkadot/types'; import type { Hash } from '@polkadot/types/interfaces'; import type { AnyJson, AnyNumber, Codec, DefinitionRpc, DefinitionRpcExt, DefinitionRpcSub, Registry } from '@polkadot/types/types'; import type { Memoized } from '@polkadot/util/types'; -import type { RpcInterfaceMethod } from './types'; +import type { RpcInterfaceMethod } from './types/index.js'; import { Observable, publishReplay, refCount } from 'rxjs'; import { rpcDefinitions } from '@polkadot/types'; import { hexToU8a, isFunction, isNull, isUndefined, lazyMethod, logger, memoize, objectSpread, u8aConcat, u8aToU8a } from '@polkadot/util'; -import { drr, refCountDelay } from './util'; +import { drr, refCountDelay } from './util/index.js'; -export { packageInfo } from './packageInfo'; -export * from './util'; +export { packageInfo } from './packageInfo.js'; +export * from './util/index.js'; interface StorageChangeSetJSON { block: string; diff --git a/packages/rpc-core/src/cached.spec.ts b/packages/rpc-core/src/cached.spec.ts index ab4c125a24..559e0bdefb 100644 --- a/packages/rpc-core/src/cached.spec.ts +++ b/packages/rpc-core/src/cached.spec.ts @@ -3,13 +3,13 @@ /// -import type { RpcInterface } from './types'; +import type { RpcInterface } from './types/index.js'; import { createTestPairs } from '@polkadot/keyring/testingPairs'; import { MockProvider } from '@polkadot/rpc-provider/mock'; import { TypeRegistry } from '@polkadot/types/create'; -import { RpcCore } from '.'; +import { RpcCore } from './index.js'; describe('Cached Observables', (): void => { const registry = new TypeRegistry(); diff --git a/packages/rpc-core/src/detectPackage.ts b/packages/rpc-core/src/detectPackage.ts index f03ae862ad..d224d2b32a 100644 --- a/packages/rpc-core/src/detectPackage.ts +++ b/packages/rpc-core/src/detectPackage.ts @@ -5,7 +5,7 @@ import { detectPackage } from '@polkadot/util'; -import others from './detectOther'; -import { packageInfo } from './packageInfo'; +import others from './detectOther.js'; +import { packageInfo } from './packageInfo.js'; detectPackage(packageInfo, null, others); diff --git a/packages/rpc-core/src/index.spec.ts b/packages/rpc-core/src/index.spec.ts index cacf82907a..924c51c0ad 100644 --- a/packages/rpc-core/src/index.spec.ts +++ b/packages/rpc-core/src/index.spec.ts @@ -9,7 +9,7 @@ import { MockProvider } from '@polkadot/rpc-provider/mock'; import { TypeRegistry } from '@polkadot/types/create'; import { isFunction } from '@polkadot/util'; -import { RpcCore } from '.'; +import { RpcCore } from './index.js'; describe('Api', (): void => { const registry = new TypeRegistry(); diff --git a/packages/rpc-core/src/index.ts b/packages/rpc-core/src/index.ts index 89b973f3e6..9c0889b005 100644 --- a/packages/rpc-core/src/index.ts +++ b/packages/rpc-core/src/index.ts @@ -1,6 +1,6 @@ // Copyright 2017-2023 @polkadot/rpc-core authors & contributors // SPDX-License-Identifier: Apache-2.0 -import './detectPackage'; +import './detectPackage.js'; -export * from './bundle'; +export * from './bundle.js'; diff --git a/packages/rpc-core/src/methodSend.spec.ts b/packages/rpc-core/src/methodSend.spec.ts index 33a3db46ee..deaaea7b95 100644 --- a/packages/rpc-core/src/methodSend.spec.ts +++ b/packages/rpc-core/src/methodSend.spec.ts @@ -8,7 +8,7 @@ import type { DefinitionRpc } from '@polkadot/types/types'; import { TypeRegistry } from '@polkadot/types/create'; -import { RpcCore } from '.'; +import { RpcCore } from './index.js'; describe('methodSend', (): void => { const registry = new TypeRegistry(); diff --git a/packages/rpc-core/src/mod.ts b/packages/rpc-core/src/mod.ts index 656be701ce..0b5a1e6131 100644 --- a/packages/rpc-core/src/mod.ts +++ b/packages/rpc-core/src/mod.ts @@ -1,4 +1,4 @@ // Copyright 2017-2023 @polkadot/rpc-core authors & contributors // SPDX-License-Identifier: Apache-2.0 -export * from './index'; +export * from './index.js'; diff --git a/packages/rpc-core/src/replay.spec.ts b/packages/rpc-core/src/replay.spec.ts index 400962c722..06e543e68c 100644 --- a/packages/rpc-core/src/replay.spec.ts +++ b/packages/rpc-core/src/replay.spec.ts @@ -3,12 +3,12 @@ /// -import type { RpcInterface } from './types'; +import type { RpcInterface } from './types/index.js'; import { MockProvider } from '@polkadot/rpc-provider/mock'; import { TypeRegistry } from '@polkadot/types/create'; -import { RpcCore } from '.'; +import { RpcCore } from './index.js'; describe('replay', (): void => { const registry = new TypeRegistry(); diff --git a/packages/rpc-core/src/types/index.ts b/packages/rpc-core/src/types/index.ts index 388609dbc2..88ac9f8f3e 100644 --- a/packages/rpc-core/src/types/index.ts +++ b/packages/rpc-core/src/types/index.ts @@ -5,4 +5,4 @@ export * from '@polkadot/rpc-core/types/jsonrpc'; // normal exports -export * from './base'; +export * from './base.js'; diff --git a/packages/rpc-core/src/util/drr.spec.ts b/packages/rpc-core/src/util/drr.spec.ts index 17a71821c4..d40ef1d0a2 100644 --- a/packages/rpc-core/src/util/drr.spec.ts +++ b/packages/rpc-core/src/util/drr.spec.ts @@ -5,7 +5,7 @@ import { of, timer } from 'rxjs'; -import { drr } from '.'; +import { drr } from './index.js'; describe('drr', (): void => { it('should not fire twice the same value', async (): Promise => { diff --git a/packages/rpc-core/src/util/drr.ts b/packages/rpc-core/src/util/drr.ts index 9a8a80c085..cd7f0272ff 100644 --- a/packages/rpc-core/src/util/drr.ts +++ b/packages/rpc-core/src/util/drr.ts @@ -7,7 +7,7 @@ import { catchError, distinctUntilChanged, publishReplay, refCount, tap } from ' import { stringify } from '@polkadot/util'; -import { refCountDelay } from './refCountDelay'; +import { refCountDelay } from './refCountDelay.js'; export type DrrResult = (source$: Observable) => Observable; diff --git a/packages/rpc-core/src/util/index.ts b/packages/rpc-core/src/util/index.ts index c12af6233a..5906cc2796 100644 --- a/packages/rpc-core/src/util/index.ts +++ b/packages/rpc-core/src/util/index.ts @@ -1,6 +1,6 @@ // Copyright 2017-2023 @polkadot/rpc-core authors & contributors // SPDX-License-Identifier: Apache-2.0 -export * from './drr'; -export * from './memo'; -export * from './refCountDelay'; +export * from './drr.js'; +export * from './memo.js'; +export * from './refCountDelay.js'; diff --git a/packages/rpc-core/src/util/memo.ts b/packages/rpc-core/src/util/memo.ts index 14244f8b1a..249038830d 100644 --- a/packages/rpc-core/src/util/memo.ts +++ b/packages/rpc-core/src/util/memo.ts @@ -8,7 +8,7 @@ import { Observable } from 'rxjs'; import { memoize } from '@polkadot/util'; -import { drr } from './drr'; +import { drr } from './drr.js'; type ObsFn = (...params: unknown[]) => Observable; diff --git a/packages/rpc-provider/src/bundle.ts b/packages/rpc-provider/src/bundle.ts index d6d1f8a801..7a851c4219 100644 --- a/packages/rpc-provider/src/bundle.ts +++ b/packages/rpc-provider/src/bundle.ts @@ -1,7 +1,8 @@ // Copyright 2017-2023 @polkadot/rpc-provider authors & contributors // SPDX-License-Identifier: Apache-2.0 -export { HttpProvider } from './http'; -export { packageInfo } from './packageInfo'; -export { ScProvider } from './substrate-connect'; -export { WsProvider } from './ws'; +export { packageInfo } from './packageInfo.js'; + +export { HttpProvider } from './http/index.js'; +export { ScProvider } from './substrate-connect/index.js'; +export { WsProvider } from './ws/index.js'; diff --git a/packages/rpc-provider/src/coder/decodeResponse.spec.ts b/packages/rpc-provider/src/coder/decodeResponse.spec.ts index 23141b76f5..6a590656a0 100644 --- a/packages/rpc-provider/src/coder/decodeResponse.spec.ts +++ b/packages/rpc-provider/src/coder/decodeResponse.spec.ts @@ -3,9 +3,9 @@ /// -import type { JsonRpcResponse } from '../types'; +import type { JsonRpcResponse } from '../types.js'; -import { RpcCoder } from '.'; +import { RpcCoder } from './index.js'; describe('decodeResponse', (): void => { let coder: RpcCoder; diff --git a/packages/rpc-provider/src/coder/encodeJson.spec.ts b/packages/rpc-provider/src/coder/encodeJson.spec.ts index 60460de2ab..76da2ff714 100644 --- a/packages/rpc-provider/src/coder/encodeJson.spec.ts +++ b/packages/rpc-provider/src/coder/encodeJson.spec.ts @@ -3,7 +3,7 @@ /// -import { RpcCoder } from '.'; +import { RpcCoder } from './index.js'; describe('encodeJson', (): void => { let coder: RpcCoder; diff --git a/packages/rpc-provider/src/coder/encodeObject.spec.ts b/packages/rpc-provider/src/coder/encodeObject.spec.ts index 63dde25508..493ea408c0 100644 --- a/packages/rpc-provider/src/coder/encodeObject.spec.ts +++ b/packages/rpc-provider/src/coder/encodeObject.spec.ts @@ -3,7 +3,7 @@ /// -import { RpcCoder } from '.'; +import { RpcCoder } from './index.js'; describe('encodeObject', (): void => { let coder: RpcCoder; diff --git a/packages/rpc-provider/src/coder/error.spec.ts b/packages/rpc-provider/src/coder/error.spec.ts index a2457d3547..e9d6737424 100644 --- a/packages/rpc-provider/src/coder/error.spec.ts +++ b/packages/rpc-provider/src/coder/error.spec.ts @@ -5,7 +5,7 @@ import { isError } from '@polkadot/util/is/error'; -import RpcError from './error'; +import RpcError from './error.js'; describe('RpcError', (): void => { describe('constructor', (): void => { diff --git a/packages/rpc-provider/src/coder/error.ts b/packages/rpc-provider/src/coder/error.ts index 2faaf91360..41015e6816 100644 --- a/packages/rpc-provider/src/coder/error.ts +++ b/packages/rpc-provider/src/coder/error.ts @@ -3,7 +3,7 @@ import { isFunction } from '@polkadot/util/is/function'; -import { RpcErrorInterface } from '../types'; +import { RpcErrorInterface } from '../types.js'; const UNKNOWN = -99999; diff --git a/packages/rpc-provider/src/coder/index.ts b/packages/rpc-provider/src/coder/index.ts index 21c67718a1..88646a5ae7 100644 --- a/packages/rpc-provider/src/coder/index.ts +++ b/packages/rpc-provider/src/coder/index.ts @@ -1,11 +1,11 @@ // Copyright 2017-2023 @polkadot/rpc-provider authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { JsonRpcRequest, JsonRpcResponse, JsonRpcResponseBaseError } from '../types'; +import type { JsonRpcRequest, JsonRpcResponse, JsonRpcResponseBaseError } from '../types.js'; import { isNumber, isString, isUndefined, stringify } from '@polkadot/util'; -import RpcError from './error'; +import RpcError from './error.js'; function formatErrorData (data?: string | number): string { if (isUndefined(data)) { diff --git a/packages/rpc-provider/src/detectPackage.ts b/packages/rpc-provider/src/detectPackage.ts index 4dabd30a21..7b8db3373e 100644 --- a/packages/rpc-provider/src/detectPackage.ts +++ b/packages/rpc-provider/src/detectPackage.ts @@ -5,7 +5,7 @@ import { detectPackage } from '@polkadot/util'; -import others from './detectOther'; -import { packageInfo } from './packageInfo'; +import others from './detectOther.js'; +import { packageInfo } from './packageInfo.js'; detectPackage(packageInfo, null, others); diff --git a/packages/rpc-provider/src/http/index.spec.ts b/packages/rpc-provider/src/http/index.spec.ts index ac6ba05b42..90ee0f04d5 100644 --- a/packages/rpc-provider/src/http/index.spec.ts +++ b/packages/rpc-provider/src/http/index.spec.ts @@ -3,8 +3,8 @@ /// -import { TEST_HTTP_URL } from '../mock/mockHttp'; -import { HttpProvider } from './'; +import { TEST_HTTP_URL } from '../mock/mockHttp.js'; +import { HttpProvider } from './index.js'; describe('Http', (): void => { let http: HttpProvider; diff --git a/packages/rpc-provider/src/http/index.ts b/packages/rpc-provider/src/http/index.ts index 608837ea0b..bac56c7f92 100644 --- a/packages/rpc-provider/src/http/index.ts +++ b/packages/rpc-provider/src/http/index.ts @@ -1,14 +1,14 @@ // Copyright 2017-2023 @polkadot/rpc-provider authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { JsonRpcResponse, ProviderInterface, ProviderInterfaceCallback, ProviderInterfaceEmitCb, ProviderInterfaceEmitted, ProviderStats } from '../types'; +import type { JsonRpcResponse, ProviderInterface, ProviderInterfaceCallback, ProviderInterfaceEmitCb, ProviderInterfaceEmitted, ProviderStats } from '../types.js'; import { logger } from '@polkadot/util'; import { fetch } from '@polkadot/x-fetch'; -import { RpcCoder } from '../coder'; -import defaults from '../defaults'; -import { LRUCache } from '../lru'; +import { RpcCoder } from '../coder/index.js'; +import defaults from '../defaults.js'; +import { LRUCache } from '../lru.js'; const ERROR_SUBSCRIBE = 'HTTP Provider does not have subscriptions, use WebSockets instead'; diff --git a/packages/rpc-provider/src/http/send.spec.ts b/packages/rpc-provider/src/http/send.spec.ts index 13f6314d64..244976bd4c 100644 --- a/packages/rpc-provider/src/http/send.spec.ts +++ b/packages/rpc-provider/src/http/send.spec.ts @@ -5,8 +5,8 @@ import type { Mock } from '../mock/types'; -import { mockHttp, TEST_HTTP_URL } from '../mock/mockHttp'; -import { HttpProvider } from './'; +import { mockHttp, TEST_HTTP_URL } from '../mock/mockHttp.js'; +import { HttpProvider } from './index.js'; // Does not work with Node 18 (native fetch) // See https://github.com/nock/nock/issues/2397 diff --git a/packages/rpc-provider/src/http/types.ts b/packages/rpc-provider/src/http/types.ts index fb30a38914..e3cef75bd0 100644 --- a/packages/rpc-provider/src/http/types.ts +++ b/packages/rpc-provider/src/http/types.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { Logger } from '@polkadot/util/types'; -import type { RpcCoder } from '../coder'; +import type { RpcCoder } from '../coder/index.js'; export interface HttpState { coder: RpcCoder; diff --git a/packages/rpc-provider/src/index.ts b/packages/rpc-provider/src/index.ts index 72d2b18e04..18fc7b615d 100644 --- a/packages/rpc-provider/src/index.ts +++ b/packages/rpc-provider/src/index.ts @@ -1,6 +1,6 @@ // Copyright 2017-2023 @polkadot/rpc-provider authors & contributors // SPDX-License-Identifier: Apache-2.0 -import './detectPackage'; +import './detectPackage.js'; -export * from './bundle'; +export * from './bundle.js'; diff --git a/packages/rpc-provider/src/lru.spec.ts b/packages/rpc-provider/src/lru.spec.ts index afbb0e43fd..4d860b6b19 100644 --- a/packages/rpc-provider/src/lru.spec.ts +++ b/packages/rpc-provider/src/lru.spec.ts @@ -3,7 +3,7 @@ /// -import { LRUCache } from './lru'; +import { LRUCache } from './lru.js'; describe('LRUCache', (): void => { it('allows getting of items below capacity', (): void => { diff --git a/packages/rpc-provider/src/mock/index.ts b/packages/rpc-provider/src/mock/index.ts index 4fcbac0a13..7056c4502d 100644 --- a/packages/rpc-provider/src/mock/index.ts +++ b/packages/rpc-provider/src/mock/index.ts @@ -5,8 +5,8 @@ import type { Header } from '@polkadot/types/interfaces'; import type { Codec, Registry } from '@polkadot/types/types'; -import type { ProviderInterface, ProviderInterfaceEmitCb, ProviderInterfaceEmitted } from '../types'; -import type { MockStateDb, MockStateSubscriptionCallback, MockStateSubscriptions } from './types'; +import type { ProviderInterface, ProviderInterfaceEmitCb, ProviderInterfaceEmitted } from '../types.js'; +import type { MockStateDb, MockStateSubscriptionCallback, MockStateSubscriptions } from './types.js'; import EventEmitter from 'eventemitter3'; diff --git a/packages/rpc-provider/src/mock/mockHttp.ts b/packages/rpc-provider/src/mock/mockHttp.ts index db007e1610..d4f8bd754a 100644 --- a/packages/rpc-provider/src/mock/mockHttp.ts +++ b/packages/rpc-provider/src/mock/mockHttp.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/rpc-provider authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Mock } from './types'; +import type { Mock } from './types.js'; import nock from 'nock'; diff --git a/packages/rpc-provider/src/mock/on.spec.ts b/packages/rpc-provider/src/mock/on.spec.ts index 778be57a73..fdeb7036be 100644 --- a/packages/rpc-provider/src/mock/on.spec.ts +++ b/packages/rpc-provider/src/mock/on.spec.ts @@ -3,11 +3,11 @@ /// -import type { ProviderInterfaceEmitted } from '../types'; +import type { ProviderInterfaceEmitted } from '../types.js'; import { TypeRegistry } from '@polkadot/types/create'; -import { MockProvider } from '.'; +import { MockProvider } from './index.js'; describe('on', (): void => { const registry = new TypeRegistry(); diff --git a/packages/rpc-provider/src/mock/send.spec.ts b/packages/rpc-provider/src/mock/send.spec.ts index 1256552812..719d67f25a 100644 --- a/packages/rpc-provider/src/mock/send.spec.ts +++ b/packages/rpc-provider/src/mock/send.spec.ts @@ -5,7 +5,7 @@ import { TypeRegistry } from '@polkadot/types/create'; -import { MockProvider } from '.'; +import { MockProvider } from './index.js'; describe('send', (): void => { const registry = new TypeRegistry(); diff --git a/packages/rpc-provider/src/mock/subscribe.spec.ts b/packages/rpc-provider/src/mock/subscribe.spec.ts index f00ad28447..fc8cb9b1ee 100644 --- a/packages/rpc-provider/src/mock/subscribe.spec.ts +++ b/packages/rpc-provider/src/mock/subscribe.spec.ts @@ -5,7 +5,7 @@ import { TypeRegistry } from '@polkadot/types/create'; -import { MockProvider } from './'; +import { MockProvider } from './index.js'; describe('subscribe', (): void => { const registry = new TypeRegistry(); diff --git a/packages/rpc-provider/src/mock/unsubscribe.spec.ts b/packages/rpc-provider/src/mock/unsubscribe.spec.ts index 46af8ed8d6..b36297aed8 100644 --- a/packages/rpc-provider/src/mock/unsubscribe.spec.ts +++ b/packages/rpc-provider/src/mock/unsubscribe.spec.ts @@ -5,7 +5,7 @@ import { TypeRegistry } from '@polkadot/types/create'; -import { MockProvider } from '.'; +import { MockProvider } from './index.js'; describe('unsubscribe', (): void => { const registry = new TypeRegistry(); diff --git a/packages/rpc-provider/src/mod.ts b/packages/rpc-provider/src/mod.ts index 2622615aff..86be80cbc6 100644 --- a/packages/rpc-provider/src/mod.ts +++ b/packages/rpc-provider/src/mod.ts @@ -1,4 +1,4 @@ // Copyright 2017-2023 @polkadot/rpc-provider authors & contributors // SPDX-License-Identifier: Apache-2.0 -export * from './index'; +export * from './index.js'; diff --git a/packages/rpc-provider/src/substrate-connect/Health.ts b/packages/rpc-provider/src/substrate-connect/Health.ts index 9758d019da..f7a37c1739 100644 --- a/packages/rpc-provider/src/substrate-connect/Health.ts +++ b/packages/rpc-provider/src/substrate-connect/Health.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/rpc-provider authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { HealthChecker, SmoldotHealth } from './types'; +import type { HealthChecker, SmoldotHealth } from './types.js'; import { stringify } from '@polkadot/util'; diff --git a/packages/rpc-provider/src/substrate-connect/index.spec.ts b/packages/rpc-provider/src/substrate-connect/index.spec.ts index 09a268aff7..aa80b451d7 100644 --- a/packages/rpc-provider/src/substrate-connect/index.spec.ts +++ b/packages/rpc-provider/src/substrate-connect/index.spec.ts @@ -21,9 +21,9 @@ // Jest has "some" issues with `await import` - we don't transform these import type Sc from '@substrate/connect'; -import type { HealthChecker, SmoldotHealth } from './types'; +import type { HealthChecker, SmoldotHealth } from './types.js'; -import { ScProvider } from '.'; +import { ScProvider } from './index.js'; type MockChain = Sc.Chain & { _spec: () => string diff --git a/packages/rpc-provider/src/substrate-connect/index.ts b/packages/rpc-provider/src/substrate-connect/index.ts index 2b2b65046e..7782d8102a 100644 --- a/packages/rpc-provider/src/substrate-connect/index.ts +++ b/packages/rpc-provider/src/substrate-connect/index.ts @@ -2,14 +2,14 @@ // SPDX-License-Identifier: Apache-2.0 import type ScType from '@substrate/connect'; -import type { JsonRpcResponse, ProviderInterface, ProviderInterfaceCallback, ProviderInterfaceEmitCb, ProviderInterfaceEmitted } from '../types'; +import type { JsonRpcResponse, ProviderInterface, ProviderInterfaceCallback, ProviderInterfaceEmitCb, ProviderInterfaceEmitted } from '../types.js'; import EventEmitter from 'eventemitter3'; import { isError, isFunction, isObject, logger, objectSpread } from '@polkadot/util'; -import { RpcCoder } from '../coder'; -import { healthChecker } from './Health'; +import { RpcCoder } from '../coder/index.js'; +import { healthChecker } from './Health.js'; type ResponseCallback = (response: string | Error) => void; diff --git a/packages/rpc-provider/src/ws/connect.spec.ts b/packages/rpc-provider/src/ws/connect.spec.ts index 76a8ca50c5..80d2ace8db 100644 --- a/packages/rpc-provider/src/ws/connect.spec.ts +++ b/packages/rpc-provider/src/ws/connect.spec.ts @@ -5,8 +5,8 @@ import type { Mock } from '../mock/types'; -import { mockWs } from '../mock/mockWs'; -import { WsProvider } from './'; +import { mockWs } from '../mock/mockWs.js'; +import { WsProvider } from './index.js'; const TEST_WS_URL = 'ws://localhost-connect.spec.ts:9988'; diff --git a/packages/rpc-provider/src/ws/index.spec.ts b/packages/rpc-provider/src/ws/index.spec.ts index 03e7ef560a..e9c3f2f1dc 100644 --- a/packages/rpc-provider/src/ws/index.spec.ts +++ b/packages/rpc-provider/src/ws/index.spec.ts @@ -4,10 +4,10 @@ /// import type { Request } from '../mock/mockWs'; +import type { Mock } from '../mock/types.js'; -import { mockWs } from '../mock/mockWs'; -import { Mock } from '../mock/types'; -import { WsProvider } from './'; +import { mockWs } from '../mock/mockWs.js'; +import { WsProvider } from './index.js'; const TEST_WS_URL = 'ws://localhost-index.spec.ts:9977'; diff --git a/packages/rpc-provider/src/ws/index.ts b/packages/rpc-provider/src/ws/index.ts index d506fd2a7b..45596d530f 100644 --- a/packages/rpc-provider/src/ws/index.ts +++ b/packages/rpc-provider/src/ws/index.ts @@ -3,7 +3,7 @@ /* eslint-disable camelcase */ -import type { EndpointStats, JsonRpcResponse, ProviderInterface, ProviderInterfaceCallback, ProviderInterfaceEmitCb, ProviderInterfaceEmitted, ProviderStats } from '../types'; +import type { EndpointStats, JsonRpcResponse, ProviderInterface, ProviderInterfaceCallback, ProviderInterfaceEmitCb, ProviderInterfaceEmitted, ProviderStats } from '../types.js'; import EventEmitter from 'eventemitter3'; @@ -11,10 +11,10 @@ import { isChildClass, isNull, isUndefined, logger, objectSpread } from '@polkad import { xglobal } from '@polkadot/x-global'; import { WebSocket } from '@polkadot/x-ws'; -import { RpcCoder } from '../coder'; -import defaults from '../defaults'; -import { LRUCache } from '../lru'; -import { getWSErrorString } from './errors'; +import { RpcCoder } from '../coder/index.js'; +import defaults from '../defaults.js'; +import { LRUCache } from '../lru.js'; +import { getWSErrorString } from './errors.js'; interface SubscriptionHandler { callback: ProviderInterfaceCallback; diff --git a/packages/rpc-provider/src/ws/send.spec.ts b/packages/rpc-provider/src/ws/send.spec.ts index cb914e27d6..5b39e6f2e0 100644 --- a/packages/rpc-provider/src/ws/send.spec.ts +++ b/packages/rpc-provider/src/ws/send.spec.ts @@ -5,9 +5,9 @@ import type { Request } from '../mock/mockWs'; -import { mockWs } from '../mock/mockWs'; -import { Global, Mock } from '../mock/types'; -import { WsProvider } from './'; +import { mockWs } from '../mock/mockWs.js'; +import { Global, Mock } from '../mock/types.js'; +import { WsProvider } from './index.js'; declare const global: Global; diff --git a/packages/rpc-provider/src/ws/state.spec.ts b/packages/rpc-provider/src/ws/state.spec.ts index 6b6aecdb78..1db84e4fdf 100644 --- a/packages/rpc-provider/src/ws/state.spec.ts +++ b/packages/rpc-provider/src/ws/state.spec.ts @@ -3,7 +3,7 @@ /// -import { WsProvider } from './'; +import { WsProvider } from './index.js'; describe('state', (): void => { it('requires an ws:// prefixed endpoint', (): void => { diff --git a/packages/rpc-provider/src/ws/subscribe.spec.ts b/packages/rpc-provider/src/ws/subscribe.spec.ts index 4c4ed82458..f447a203f8 100644 --- a/packages/rpc-provider/src/ws/subscribe.spec.ts +++ b/packages/rpc-provider/src/ws/subscribe.spec.ts @@ -6,8 +6,8 @@ import type { Request } from '../mock/mockWs'; import type { Global, Mock } from './../mock/types'; -import { mockWs } from '../mock/mockWs'; -import { WsProvider } from '.'; +import { mockWs } from '../mock/mockWs.js'; +import { WsProvider } from './index.js'; declare const global: Global; diff --git a/packages/rpc-provider/src/ws/unsubscribe.spec.ts b/packages/rpc-provider/src/ws/unsubscribe.spec.ts index b90a988a55..1b308e987c 100644 --- a/packages/rpc-provider/src/ws/unsubscribe.spec.ts +++ b/packages/rpc-provider/src/ws/unsubscribe.spec.ts @@ -6,8 +6,8 @@ import type { Request } from '../mock/mockWs'; import type { Global, Mock } from './../mock/types'; -import { mockWs } from '../mock/mockWs'; -import { WsProvider } from './'; +import { mockWs } from '../mock/mockWs.js'; +import { WsProvider } from './index.js'; declare const global: Global; diff --git a/packages/typegen/src/bundle.ts b/packages/typegen/src/bundle.ts index 1235bf973f..78a982aba0 100644 --- a/packages/typegen/src/bundle.ts +++ b/packages/typegen/src/bundle.ts @@ -1,5 +1,5 @@ // Copyright 2017-2023 @polkadot/typegen authors & contributors // SPDX-License-Identifier: Apache-2.0 -export { packageInfo } from './packageInfo'; -export { formatType } from './util/formatting'; +export { packageInfo } from './packageInfo.js'; +export { formatType } from './util/formatting.js'; diff --git a/packages/typegen/src/detectPackage.ts b/packages/typegen/src/detectPackage.ts index b206faa0a0..b8843b1b79 100644 --- a/packages/typegen/src/detectPackage.ts +++ b/packages/typegen/src/detectPackage.ts @@ -5,7 +5,7 @@ import { detectPackage } from '@polkadot/util'; -import others from './detectOther'; -import { packageInfo } from './packageInfo'; +import others from './detectOther.js'; +import { packageInfo } from './packageInfo.js'; detectPackage(packageInfo, null, others); diff --git a/packages/typegen/src/fromChain.ts b/packages/typegen/src/fromChain.ts index 86e4aa413e..4401fc1312 100644 --- a/packages/typegen/src/fromChain.ts +++ b/packages/typegen/src/fromChain.ts @@ -10,8 +10,8 @@ import yargs from 'yargs'; import { Definitions, DefinitionsTypes } from '@polkadot/types/types'; import { formatNumber, isHex } from '@polkadot/util'; -import { generateDefaultConsts, generateDefaultErrors, generateDefaultEvents, generateDefaultQuery, generateDefaultRpc, generateDefaultRuntime, generateDefaultTx } from './generate'; -import { assertDir, assertFile, getMetadataViaWs, HEADER, writeFile } from './util'; +import { generateDefaultConsts, generateDefaultErrors, generateDefaultEvents, generateDefaultQuery, generateDefaultRpc, generateDefaultRuntime, generateDefaultTx } from './generate/index.js'; +import { assertDir, assertFile, getMetadataViaWs, HEADER, writeFile } from './util/index.js'; async function generate (metaHex: HexString, pkg: string | undefined, output: string, isStrict?: boolean): Promise { console.log(`Generating from metadata, ${formatNumber((metaHex.length - 2) / 2)} bytes`); @@ -60,7 +60,7 @@ async function generate (metaHex: HexString, pkg: string | undefined, output: st ...[ ...['consts', 'errors', 'events', 'query', 'tx', 'rpc', 'runtime'] .filter((key) => !!key) - .map((key) => `./augment-api-${key}`) + .map((key) => `./augment-api-${key}.js`) ].map((path) => `import '${path}';\n`) ].join('') ); diff --git a/packages/typegen/src/fromDefs.ts b/packages/typegen/src/fromDefs.ts index 94317264af..0ad20f1858 100644 --- a/packages/typegen/src/fromDefs.ts +++ b/packages/typegen/src/fromDefs.ts @@ -10,10 +10,10 @@ import yargs from 'yargs'; import * as substrateDefs from '@polkadot/types/interfaces/definitions'; import { isHex } from '@polkadot/util'; -import { generateInterfaceTypes } from './generate/interfaceRegistry'; -import { generateTsDef } from './generate/tsDef'; -import { generateDefaultLookup } from './generate'; -import { assertDir, assertFile, getMetadataViaWs } from './util'; +import { generateDefaultLookup } from './generate/index.js'; +import { generateInterfaceTypes } from './generate/interfaceRegistry.js'; +import { generateTsDef } from './generate/tsDef.js'; +import { assertDir, assertFile, getMetadataViaWs } from './util/index.js'; type ArgV = { input: string; package: string; endpoint?: string; }; diff --git a/packages/typegen/src/generate/consts.ts b/packages/typegen/src/generate/consts.ts index 907936309c..9791e7f534 100644 --- a/packages/typegen/src/generate/consts.ts +++ b/packages/typegen/src/generate/consts.ts @@ -3,7 +3,7 @@ import type { Metadata } from '@polkadot/types/metadata/Metadata'; import type { HexString } from '@polkadot/util/types'; -import type { ExtraTypes } from './types'; +import type { ExtraTypes } from './types.js'; import Handlebars from 'handlebars'; @@ -12,7 +12,7 @@ import { Definitions } from '@polkadot/types/types'; import lookupDefinitions from '@polkadot/types-augment/lookup/definitions'; import { stringCamelCase } from '@polkadot/util'; -import { compareName, createImports, formatType, initMeta, readTemplate, setImports, writeFile } from '../util'; +import { compareName, createImports, formatType, initMeta, readTemplate, setImports, writeFile } from '../util/index.js'; const generateForMetaTemplate = Handlebars.compile(readTemplate('consts')); diff --git a/packages/typegen/src/generate/errors.ts b/packages/typegen/src/generate/errors.ts index 5631270252..93ec382379 100644 --- a/packages/typegen/src/generate/errors.ts +++ b/packages/typegen/src/generate/errors.ts @@ -3,13 +3,13 @@ import type { Metadata } from '@polkadot/types/metadata/Metadata'; import type { HexString } from '@polkadot/util/types'; -import type { ExtraTypes } from './types'; +import type { ExtraTypes } from './types.js'; import Handlebars from 'handlebars'; import { stringCamelCase } from '@polkadot/util'; -import { compareName, createImports, initMeta, readTemplate, writeFile } from '../util'; +import { compareName, createImports, initMeta, readTemplate, writeFile } from '../util/index.js'; const generateForMetaTemplate = Handlebars.compile(readTemplate('errors')); diff --git a/packages/typegen/src/generate/events.ts b/packages/typegen/src/generate/events.ts index 17fcf7ce0a..1c42692eea 100644 --- a/packages/typegen/src/generate/events.ts +++ b/packages/typegen/src/generate/events.ts @@ -3,7 +3,7 @@ import type { Metadata } from '@polkadot/types/metadata/Metadata'; import type { HexString } from '@polkadot/util/types'; -import type { ExtraTypes } from './types'; +import type { ExtraTypes } from './types.js'; import Handlebars from 'handlebars'; @@ -12,7 +12,7 @@ import { Definitions } from '@polkadot/types/types'; import lookupDefinitions from '@polkadot/types-augment/lookup/definitions'; import { stringCamelCase } from '@polkadot/util'; -import { compareName, createImports, formatType, initMeta, readTemplate, setImports, writeFile } from '../util'; +import { compareName, createImports, formatType, initMeta, readTemplate, setImports, writeFile } from '../util/index.js'; const generateForMetaTemplate = Handlebars.compile(readTemplate('events')); diff --git a/packages/typegen/src/generate/index.ts b/packages/typegen/src/generate/index.ts index 8d96cf4df0..fc182de628 100644 --- a/packages/typegen/src/generate/index.ts +++ b/packages/typegen/src/generate/index.ts @@ -1,13 +1,13 @@ // Copyright 2017-2023 @polkadot/typegen authors & contributors // SPDX-License-Identifier: Apache-2.0 -export { generateDefaultConsts } from './consts'; -export { generateDefaultErrors } from './errors'; -export { generateDefaultEvents } from './events'; -export { generateDefaultInterface } from './interfaceRegistry'; -export { generateDefaultLookup } from './lookup'; -export { generateDefaultQuery } from './query'; -export { generateDefaultRpc } from './rpc'; -export { generateDefaultRuntime } from './runtime'; -export { generateDefaultTsDef } from './tsDef'; -export { generateDefaultTx } from './tx'; +export { generateDefaultConsts } from './consts.js'; +export { generateDefaultErrors } from './errors.js'; +export { generateDefaultEvents } from './events.js'; +export { generateDefaultInterface } from './interfaceRegistry.js'; +export { generateDefaultLookup } from './lookup.js'; +export { generateDefaultQuery } from './query.js'; +export { generateDefaultRpc } from './rpc.js'; +export { generateDefaultRuntime } from './runtime.js'; +export { generateDefaultTsDef } from './tsDef.js'; +export { generateDefaultTx } from './tx.js'; diff --git a/packages/typegen/src/generate/interfaceRegistry.ts b/packages/typegen/src/generate/interfaceRegistry.ts index a6faec3ad9..55ff492747 100644 --- a/packages/typegen/src/generate/interfaceRegistry.ts +++ b/packages/typegen/src/generate/interfaceRegistry.ts @@ -8,8 +8,8 @@ import { TypeRegistry } from '@polkadot/types/create'; import * as defaultDefinitions from '@polkadot/types/interfaces/definitions'; import * as defaultPrimitives from '@polkadot/types/primitive'; -import { createImports, readTemplate, setImports, writeFile } from '../util'; -import { ModuleTypes } from '../util/imports'; +import { ModuleTypes } from '../util/imports.js'; +import { createImports, readTemplate, setImports, writeFile } from '../util/index.js'; const primitiveClasses = { ...defaultPrimitives, diff --git a/packages/typegen/src/generate/lookup.ts b/packages/typegen/src/generate/lookup.ts index 577f855bf2..fe9612770d 100644 --- a/packages/typegen/src/generate/lookup.ts +++ b/packages/typegen/src/generate/lookup.ts @@ -16,8 +16,8 @@ import staticPolkadot from '@polkadot/types-support/metadata/static-polkadot'; import staticSubstrate from '@polkadot/types-support/metadata/static-substrate'; import { isString, stringify } from '@polkadot/util'; -import { createImports, exportInterface, initMeta, readTemplate, writeFile } from '../util'; -import { typeEncoders } from './tsDef'; +import { createImports, exportInterface, initMeta, readTemplate, writeFile } from '../util/index.js'; +import { typeEncoders } from './tsDef.js'; const WITH_TYPEDEF = false; diff --git a/packages/typegen/src/generate/query.ts b/packages/typegen/src/generate/query.ts index 121d77c42e..6b3bb2cf23 100644 --- a/packages/typegen/src/generate/query.ts +++ b/packages/typegen/src/generate/query.ts @@ -5,7 +5,7 @@ import type { StorageEntryMetadataLatest } from '@polkadot/types/interfaces'; import type { Metadata, PortableRegistry } from '@polkadot/types/metadata'; import type { Definitions, Registry } from '@polkadot/types/types'; import type { HexString } from '@polkadot/util/types'; -import type { ExtraTypes } from './types'; +import type { ExtraTypes } from './types.js'; import Handlebars from 'handlebars'; @@ -14,8 +14,8 @@ import { unwrapStorageSi } from '@polkadot/types/primitive/StorageKey'; import lookupDefinitions from '@polkadot/types-augment/lookup/definitions'; import { stringCamelCase } from '@polkadot/util'; -import { compareName, createImports, formatType, getSimilarTypes, initMeta, readTemplate, setImports, TypeImports, writeFile } from '../util'; -import { ModuleTypes } from '../util/imports'; +import { ModuleTypes } from '../util/imports.js'; +import { compareName, createImports, formatType, getSimilarTypes, initMeta, readTemplate, setImports, TypeImports, writeFile } from '../util/index.js'; const generateForMetaTemplate = Handlebars.compile(readTemplate('query')); diff --git a/packages/typegen/src/generate/rpc.ts b/packages/typegen/src/generate/rpc.ts index d62e1694fa..844dd101ae 100644 --- a/packages/typegen/src/generate/rpc.ts +++ b/packages/typegen/src/generate/rpc.ts @@ -3,14 +3,14 @@ import type { TypeRegistry } from '@polkadot/types/create'; import type { Definitions } from '@polkadot/types/types'; -import type { ExtraTypes } from './types'; +import type { ExtraTypes } from './types.js'; import Handlebars from 'handlebars'; import * as defaultDefinitions from '@polkadot/types/interfaces/definitions'; import staticSubstrate from '@polkadot/types-support/metadata/static-substrate'; -import { createImports, formatType, getSimilarTypes, initMeta, readTemplate, setImports, writeFile } from '../util'; +import { createImports, formatType, getSimilarTypes, initMeta, readTemplate, setImports, writeFile } from '../util/index.js'; interface ItemDef { args: string; diff --git a/packages/typegen/src/generate/runtime.ts b/packages/typegen/src/generate/runtime.ts index 0058e78d99..ff472c1660 100644 --- a/packages/typegen/src/generate/runtime.ts +++ b/packages/typegen/src/generate/runtime.ts @@ -4,7 +4,7 @@ import type { Metadata } from '@polkadot/types/metadata/Metadata'; import type { DefinitionCallNamed, Definitions, Registry } from '@polkadot/types/types'; import type { HexString } from '@polkadot/util/types'; -import type { ExtraTypes } from './types'; +import type { ExtraTypes } from './types.js'; import Handlebars from 'handlebars'; @@ -13,7 +13,7 @@ import lookupDefinitions from '@polkadot/types-augment/lookup/definitions'; import { objectSpread, stringCamelCase } from '@polkadot/util'; import { blake2AsHex } from '@polkadot/util-crypto'; -import { createImports, formatType, getSimilarTypes, initMeta, readTemplate, setImports, writeFile } from '../util'; +import { createImports, formatType, getSimilarTypes, initMeta, readTemplate, setImports, writeFile } from '../util/index.js'; type Apis = [HexString, number][]; diff --git a/packages/typegen/src/generate/tsDef.ts b/packages/typegen/src/generate/tsDef.ts index a10464577b..6df8f4af92 100644 --- a/packages/typegen/src/generate/tsDef.ts +++ b/packages/typegen/src/generate/tsDef.ts @@ -13,7 +13,7 @@ import * as defaultDefinitions from '@polkadot/types/interfaces/definitions'; import { getTypeDef, TypeDefInfo } from '@polkadot/types-create'; import { assert, isString, stringify, stringPascalCase } from '@polkadot/util'; -import { createImports, exportInterface, formatType, readTemplate, setImports, TypeImports, writeFile } from '../util'; +import { createImports, exportInterface, formatType, readTemplate, setImports, TypeImports, writeFile } from '../util/index.js'; interface Imports extends TypeImports { interfaces: [string, string][]; diff --git a/packages/typegen/src/generate/tx.ts b/packages/typegen/src/generate/tx.ts index 96c3cc0673..f0682b7eb0 100644 --- a/packages/typegen/src/generate/tx.ts +++ b/packages/typegen/src/generate/tx.ts @@ -4,7 +4,7 @@ import type { Metadata } from '@polkadot/types/metadata/Metadata'; import type { Definitions, Registry } from '@polkadot/types/types'; import type { HexString } from '@polkadot/util/types'; -import type { ExtraTypes } from './types'; +import type { ExtraTypes } from './types.js'; import Handlebars from 'handlebars'; @@ -13,7 +13,7 @@ import { Text } from '@polkadot/types/primitive'; import lookupDefinitions from '@polkadot/types-augment/lookup/definitions'; import { stringCamelCase } from '@polkadot/util'; -import { compareName, createImports, formatType, getSimilarTypes, initMeta, readTemplate, setImports, writeFile } from '../util'; +import { compareName, createImports, formatType, getSimilarTypes, initMeta, readTemplate, setImports, writeFile } from '../util/index.js'; const MAPPED_NAMES: Record = { class: 'clazz', diff --git a/packages/typegen/src/index.ts b/packages/typegen/src/index.ts index bcc4e0b6cf..e045f7570b 100644 --- a/packages/typegen/src/index.ts +++ b/packages/typegen/src/index.ts @@ -1,6 +1,6 @@ // Copyright 2017-2023 @polkadot/typegen authors & contributors // SPDX-License-Identifier: Apache-2.0 -import './detectPackage'; +import './detectPackage.js'; -export * from './bundle'; +export * from './bundle.js'; diff --git a/packages/typegen/src/interfacesTs.ts b/packages/typegen/src/interfacesTs.ts index 75ee201a5d..bd5eedbb54 100644 --- a/packages/typegen/src/interfacesTs.ts +++ b/packages/typegen/src/interfacesTs.ts @@ -7,7 +7,7 @@ import kusama from '@polkadot/types-support/metadata/static-kusama'; import polkadot from '@polkadot/types-support/metadata/static-polkadot'; import substrate from '@polkadot/types-support/metadata/static-substrate'; -import { generateDefaultConsts, generateDefaultErrors, generateDefaultEvents, generateDefaultInterface, generateDefaultLookup, generateDefaultQuery, generateDefaultRpc, generateDefaultRuntime, generateDefaultTsDef, generateDefaultTx } from './generate'; +import { generateDefaultConsts, generateDefaultErrors, generateDefaultEvents, generateDefaultInterface, generateDefaultLookup, generateDefaultQuery, generateDefaultRpc, generateDefaultRuntime, generateDefaultTsDef, generateDefaultTx } from './generate/index.js'; const BASE = 'packages/api-augment/src'; const METAS = Object.entries({ kusama, polkadot, substrate }); diff --git a/packages/typegen/src/templates/lookup/index.hbs b/packages/typegen/src/templates/lookup/index.hbs index 8438e643bd..52c01575ab 100644 --- a/packages/typegen/src/templates/lookup/index.hbs +++ b/packages/typegen/src/templates/lookup/index.hbs @@ -1,3 +1,3 @@ {{> header }} -export * from './types'; +export * from './types.js'; diff --git a/packages/typegen/src/templates/tsDef/index.hbs b/packages/typegen/src/templates/tsDef/index.hbs index 8438e643bd..52c01575ab 100644 --- a/packages/typegen/src/templates/tsDef/index.hbs +++ b/packages/typegen/src/templates/tsDef/index.hbs @@ -1,3 +1,3 @@ {{> header }} -export * from './types'; +export * from './types.js'; diff --git a/packages/typegen/src/templates/tsDef/types.hbs b/packages/typegen/src/templates/tsDef/types.hbs index 132268d059..2cfd0411d9 100644 --- a/packages/typegen/src/templates/tsDef/types.hbs +++ b/packages/typegen/src/templates/tsDef/types.hbs @@ -1,5 +1,5 @@ {{> header }} {{#each items}} -export * from './{{{this}}}/types'; +export * from './{{{this}}}/types.js'; {{/each}} diff --git a/packages/typegen/src/util/derived.spec.ts b/packages/typegen/src/util/derived.spec.ts index 2a5e65333c..4f91805eeb 100644 --- a/packages/typegen/src/util/derived.spec.ts +++ b/packages/typegen/src/util/derived.spec.ts @@ -5,7 +5,7 @@ import { TypeRegistry } from '@polkadot/types/create'; -import { getSimilarTypes } from './derived'; +import { getSimilarTypes } from './derived.js'; describe('getSimilarTypes', (): void => { const registry = new TypeRegistry(); diff --git a/packages/typegen/src/util/derived.ts b/packages/typegen/src/util/derived.ts index fea45fe6a6..49a71edc1d 100644 --- a/packages/typegen/src/util/derived.ts +++ b/packages/typegen/src/util/derived.ts @@ -10,8 +10,8 @@ import { AbstractInt, bool, Compact, Enum, Null, Option, Struct, Tuple, UInt, Ve import { getTypeDef, TypeDefInfo } from '@polkadot/types-create'; import { isChildClass, stringify } from '@polkadot/util'; -import { formatType } from './formatting'; -import { ModuleTypes, setImports, TypeImports } from './imports'; +import { formatType } from './formatting.js'; +import { ModuleTypes, setImports, TypeImports } from './imports.js'; function arrayToStrType (arr: string[]): string { return `${arr.map((c) => `'${c}'`).join(' | ')}`; diff --git a/packages/typegen/src/util/docs.ts b/packages/typegen/src/util/docs.ts index ae216c3af1..b53adf81b0 100644 --- a/packages/typegen/src/util/docs.ts +++ b/packages/typegen/src/util/docs.ts @@ -3,7 +3,7 @@ import Handlebars from 'handlebars'; -import { readTemplate } from './file'; +import { readTemplate } from './file.js'; Handlebars.registerPartial({ docs: Handlebars.compile(readTemplate('docs')) diff --git a/packages/typegen/src/util/file.ts b/packages/typegen/src/util/file.ts index f6dcef1f50..913dcb36ef 100644 --- a/packages/typegen/src/util/file.ts +++ b/packages/typegen/src/util/file.ts @@ -5,7 +5,7 @@ import fs from 'node:fs'; import path from 'node:path'; import process from 'node:process'; -import { packageInfo } from '../packageInfo'; +import { packageInfo } from '../packageInfo.js'; export function writeFile (dest: string, generator: () => string, noLog?: boolean): void { !noLog && console.log(`${dest}\n\tGenerating`); diff --git a/packages/typegen/src/util/formatting.spec.ts b/packages/typegen/src/util/formatting.spec.ts index 3630acb669..71a0941374 100644 --- a/packages/typegen/src/util/formatting.spec.ts +++ b/packages/typegen/src/util/formatting.spec.ts @@ -5,7 +5,7 @@ import { TypeRegistry } from '@polkadot/types'; -import { formatType } from './formatting'; +import { formatType } from './formatting.js'; describe('formatType', (): void => { const registry = new TypeRegistry(); diff --git a/packages/typegen/src/util/formatting.ts b/packages/typegen/src/util/formatting.ts index 7101226cdf..99ba5ce1cc 100644 --- a/packages/typegen/src/util/formatting.ts +++ b/packages/typegen/src/util/formatting.ts @@ -13,8 +13,8 @@ import * as typesCodec from '@polkadot/types-codec'; import { getTypeDef, paramsNotation, TypeDefInfo } from '@polkadot/types-create'; import { isString, stringify } from '@polkadot/util'; -import { readTemplate } from './file'; -import { ModuleTypes, setImports, TypeImports } from './imports'; +import { readTemplate } from './file.js'; +import { ModuleTypes, setImports, TypeImports } from './imports.js'; interface ImportDef { file: string; diff --git a/packages/typegen/src/util/index.ts b/packages/typegen/src/util/index.ts index eb41b15011..7ac2b420dc 100644 --- a/packages/typegen/src/util/index.ts +++ b/packages/typegen/src/util/index.ts @@ -1,15 +1,15 @@ // Copyright 2017-2023 @polkadot/typegen authors & contributors // SPDX-License-Identifier: Apache-2.0 -export * from './assert'; -export * from './derived'; -export * from './docs'; -export * from './file'; -export * from './formatting'; -export * from './imports'; -export * from './initMeta'; -export * from './register'; -export * from './wsMeta'; +export * from './assert.js'; +export * from './derived.js'; +export * from './docs.js'; +export * from './file.js'; +export * from './formatting.js'; +export * from './imports.js'; +export * from './initMeta.js'; +export * from './register.js'; +export * from './wsMeta.js'; type Cmp = { name: { toString(): string } }; diff --git a/packages/typegen/src/util/initMeta.ts b/packages/typegen/src/util/initMeta.ts index 7572bb3747..8558f5710c 100644 --- a/packages/typegen/src/util/initMeta.ts +++ b/packages/typegen/src/util/initMeta.ts @@ -6,7 +6,7 @@ import type { ExtraTypes } from '../generate/types'; import { Metadata, TypeRegistry } from '@polkadot/types'; -import { registerDefinitions } from './register'; +import { registerDefinitions } from './register.js'; interface Result { metadata: Metadata; diff --git a/packages/types-augment/src/augment.ts b/packages/types-augment/src/augment.ts index 80a12eeada..23477202d4 100644 --- a/packages/types-augment/src/augment.ts +++ b/packages/types-augment/src/augment.ts @@ -1,5 +1,5 @@ // Copyright 2017-2023 @polkadot/types-augment authors & contributors // SPDX-License-Identifier: Apache-2.0 -import './registry'; -import './lookup'; +import './registry/index.js'; +import './lookup/index.js'; diff --git a/packages/types-augment/src/bundle.ts b/packages/types-augment/src/bundle.ts index 4571e3bc2d..3581c0bac2 100644 --- a/packages/types-augment/src/bundle.ts +++ b/packages/types-augment/src/bundle.ts @@ -1,6 +1,6 @@ // Copyright 2017-2023 @polkadot/types-augment authors & contributors // SPDX-License-Identifier: Apache-2.0 -import './augment'; +import './augment.js'; -export { packageInfo } from './packageInfo'; +export { packageInfo } from './packageInfo.js'; diff --git a/packages/types-augment/src/detectPackage.ts b/packages/types-augment/src/detectPackage.ts index 60b68ec1bb..b1c73daa7e 100644 --- a/packages/types-augment/src/detectPackage.ts +++ b/packages/types-augment/src/detectPackage.ts @@ -5,7 +5,7 @@ import { detectPackage } from '@polkadot/util'; -import others from './detectOther'; -import { packageInfo } from './packageInfo'; +import others from './detectOther.js'; +import { packageInfo } from './packageInfo.js'; detectPackage(packageInfo, null, others); diff --git a/packages/types-augment/src/index.ts b/packages/types-augment/src/index.ts index 01ec382836..a90cd0d41c 100644 --- a/packages/types-augment/src/index.ts +++ b/packages/types-augment/src/index.ts @@ -1,6 +1,6 @@ // Copyright 2017-2023 @polkadot/types-augment authors & contributors // SPDX-License-Identifier: Apache-2.0 -import './detectPackage'; +import './detectPackage.js'; -export * from './bundle'; +export * from './bundle.js'; diff --git a/packages/types-augment/src/lookup/definitions.ts b/packages/types-augment/src/lookup/definitions.ts index 66b1781b2a..5f39bfac9b 100644 --- a/packages/types-augment/src/lookup/definitions.ts +++ b/packages/types-augment/src/lookup/definitions.ts @@ -5,9 +5,9 @@ import type { Definitions } from '@polkadot/types/types'; import { objectSpread } from '@polkadot/util'; -import kusama from './kusama'; -import polkadot from './polkadot'; -import substrate from './substrate'; +import kusama from './kusama.js'; +import polkadot from './polkadot.js'; +import substrate from './substrate.js'; export default { rpc: {}, diff --git a/packages/types-augment/src/lookup/index.ts b/packages/types-augment/src/lookup/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types-augment/src/lookup/index.ts +++ b/packages/types-augment/src/lookup/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types-augment/src/lookup/types.ts b/packages/types-augment/src/lookup/types.ts index d2cbb4615b..1c53bf23d6 100644 --- a/packages/types-augment/src/lookup/types.ts +++ b/packages/types-augment/src/lookup/types.ts @@ -1,6 +1,6 @@ // Copyright 2017-2023 @polkadot/types-augment authors & contributors // SPDX-License-Identifier: Apache-2.0 -import './types-substrate'; -import './types-polkadot'; -import './types-kusama'; +import './types-substrate.js'; +import './types-polkadot.js'; +import './types-kusama.js'; diff --git a/packages/types-augment/src/mod.ts b/packages/types-augment/src/mod.ts index b7b9470e73..baf2d93b8b 100644 --- a/packages/types-augment/src/mod.ts +++ b/packages/types-augment/src/mod.ts @@ -1,4 +1,4 @@ // Copyright 2017-2023 @polkadot/types-augment authors & contributors // SPDX-License-Identifier: Apache-2.0 -export * from './index'; +export * from './index.js'; diff --git a/packages/types-augment/src/registry/index.ts b/packages/types-augment/src/registry/index.ts index 332074ff6c..acc0d530fc 100644 --- a/packages/types-augment/src/registry/index.ts +++ b/packages/types-augment/src/registry/index.ts @@ -1,4 +1,4 @@ // Copyright 2017-2023 @polkadot/types-lookup authors & contributors // SPDX-License-Identifier: Apache-2.0 -import './interfaces'; +import './interfaces.js'; diff --git a/packages/types-codec/src/abstract/Array.ts b/packages/types-codec/src/abstract/Array.ts index 1d8dce626f..d6f507521d 100644 --- a/packages/types-codec/src/abstract/Array.ts +++ b/packages/types-codec/src/abstract/Array.ts @@ -2,11 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { HexString } from '@polkadot/util/types'; -import type { AnyJson, Codec, Inspect, IU8a, IVec, Registry } from '../types'; +import type { AnyJson, Codec, Inspect, IU8a, IVec, Registry } from '../types/index.js'; import { compactToU8a, u8aConcatStrict, u8aToHex } from '@polkadot/util'; -import { compareArray } from '../utils/compareArray'; +import { compareArray } from '../utils/compareArray.js'; /** * @name AbstractArray diff --git a/packages/types-codec/src/abstract/Base.ts b/packages/types-codec/src/abstract/Base.ts index dbd673dee1..dcf389312d 100644 --- a/packages/types-codec/src/abstract/Base.ts +++ b/packages/types-codec/src/abstract/Base.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { HexString } from '@polkadot/util/types'; -import type { AnyJson, BareOpts, Codec, Inspect, IU8a, Registry } from '../types'; +import type { AnyJson, BareOpts, Codec, Inspect, IU8a, Registry } from '../types/index.js'; /** * @name Base diff --git a/packages/types-codec/src/abstract/Int.ts b/packages/types-codec/src/abstract/Int.ts index 07f421f6ea..f38d8b6540 100644 --- a/packages/types-codec/src/abstract/Int.ts +++ b/packages/types-codec/src/abstract/Int.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { HexString } from '@polkadot/util/types'; -import type { AnyNumber, Inspect, INumber, IU8a, Registry, ToBn, UIntBitLength } from '../types'; +import type { AnyNumber, Inspect, INumber, IU8a, Registry, ToBn, UIntBitLength } from '../types/index.js'; import { BN, BN_BILLION, BN_HUNDRED, BN_MILLION, BN_QUINTILL, bnToBn, bnToHex, bnToU8a, formatBalance, formatNumber, hexToBn, isBigInt, isBn, isFunction, isHex, isNumber, isObject, isString, isU8a, u8aToBn, u8aToNumber } from '@polkadot/util'; diff --git a/packages/types-codec/src/abstract/Object.ts b/packages/types-codec/src/abstract/Object.ts index ace4b03953..8dfffa82fa 100644 --- a/packages/types-codec/src/abstract/Object.ts +++ b/packages/types-codec/src/abstract/Object.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { HexString } from '@polkadot/util/types'; -import type { AnyJson, BareOpts, CodecObject, Inspect, IU8a, Registry, ToString } from '../types'; +import type { AnyJson, BareOpts, CodecObject, Inspect, IU8a, Registry, ToString } from '../types/index.js'; /** * @name Object diff --git a/packages/types-codec/src/abstract/index.ts b/packages/types-codec/src/abstract/index.ts index 5878db7c9f..ec0389a7c5 100644 --- a/packages/types-codec/src/abstract/index.ts +++ b/packages/types-codec/src/abstract/index.ts @@ -1,6 +1,6 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -export { AbstractArray } from './Array'; -export { AbstractBase } from './Base'; -export { AbstractInt } from './Int'; +export { AbstractArray } from './Array.js'; +export { AbstractBase } from './Base.js'; +export { AbstractInt } from './Int.js'; diff --git a/packages/types-codec/src/base/Compact.spec.ts b/packages/types-codec/src/base/Compact.spec.ts index d32622d7c4..88791f3f85 100644 --- a/packages/types-codec/src/base/Compact.spec.ts +++ b/packages/types-codec/src/base/Compact.spec.ts @@ -7,7 +7,7 @@ import { TypeRegistry } from '@polkadot/types'; import { CodecDate, Compact, U32 } from '@polkadot/types-codec'; import { BN } from '@polkadot/util'; -import { perf } from '../test/performance'; +import { perf } from '../test/performance.js'; const CompactU32 = Compact.with(U32); diff --git a/packages/types-codec/src/base/Compact.ts b/packages/types-codec/src/base/Compact.ts index 74b138b49b..19a254b6f2 100644 --- a/packages/types-codec/src/base/Compact.ts +++ b/packages/types-codec/src/base/Compact.ts @@ -3,11 +3,11 @@ 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'; +import type { AnyJson, AnyNumber, CodecClass, ICompact, Inspect, INumber, IU8a, Registry } from '../types/index.js'; import { compactFromU8a, compactFromU8aLim, compactToU8a, isU8a } from '@polkadot/util'; -import { typeToConstructor } from '../utils'; +import { typeToConstructor } from '../utils/index.js'; interface Options { definition?: CodecClass; diff --git a/packages/types-codec/src/base/DoNotConstruct.ts b/packages/types-codec/src/base/DoNotConstruct.ts index a5216fc600..5f2304e342 100644 --- a/packages/types-codec/src/base/DoNotConstruct.ts +++ b/packages/types-codec/src/base/DoNotConstruct.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { HexString } from '@polkadot/util/types'; -import type { AnyJson, Codec, CodecClass, Inspect, IU8a, Registry } from '../types'; +import type { AnyJson, Codec, CodecClass, Inspect, IU8a, Registry } from '../types/index.js'; /** * @name DoNotConstruct diff --git a/packages/types-codec/src/base/Enum.spec.ts b/packages/types-codec/src/base/Enum.spec.ts index 3c788bb872..d8a4be1635 100644 --- a/packages/types-codec/src/base/Enum.spec.ts +++ b/packages/types-codec/src/base/Enum.spec.ts @@ -9,7 +9,7 @@ import { TypeRegistry } from '@polkadot/types'; import { Enum, Null, Text, U32 } from '@polkadot/types-codec'; import { u8aToHex } from '@polkadot/util'; -import { perf } from '../test/performance'; +import { perf } from '../test/performance.js'; const PEnum = Enum.with({ a: U32, b: U32 }); diff --git a/packages/types-codec/src/base/Enum.ts b/packages/types-codec/src/base/Enum.ts index d385bf8310..225a676417 100644 --- a/packages/types-codec/src/base/Enum.ts +++ b/packages/types-codec/src/base/Enum.ts @@ -2,12 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 import type { HexString } from '@polkadot/util/types'; -import type { AnyJson, Codec, CodecClass, IEnum, Inspect, IU8a, Registry } from '../types'; +import type { AnyJson, Codec, CodecClass, IEnum, Inspect, IU8a, Registry } from '../types/index.js'; import { isHex, isNumber, isObject, isString, isU8a, objectProperties, stringCamelCase, stringify, stringPascalCase, u8aConcatStrict, u8aToHex, u8aToU8a } from '@polkadot/util'; -import { mapToTypeMap, typesToMap } from '../utils'; -import { Null } from './Null'; +import { mapToTypeMap, typesToMap } from '../utils/index.js'; +import { Null } from './Null.js'; // export interface, this is used in Enum.with, so required as public by TS export interface EnumCodecClass { diff --git a/packages/types-codec/src/base/Int.ts b/packages/types-codec/src/base/Int.ts index 6b33a2f9bd..f8a2f415e5 100644 --- a/packages/types-codec/src/base/Int.ts +++ b/packages/types-codec/src/base/Int.ts @@ -1,9 +1,9 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AnyNumber, CodecClass, Registry, UIntBitLength } from '../types'; +import type { AnyNumber, CodecClass, Registry, UIntBitLength } from '../types/index.js'; -import { AbstractInt } from '../abstract/Int'; +import { AbstractInt } from '../abstract/Int.js'; /** * @name Int diff --git a/packages/types-codec/src/base/Null.ts b/packages/types-codec/src/base/Null.ts index b2527ca7f5..e11036a1fa 100644 --- a/packages/types-codec/src/base/Null.ts +++ b/packages/types-codec/src/base/Null.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { HexString } from '@polkadot/util/types'; -import type { Codec, Inspect, IU8a, Registry } from '../types'; +import type { Codec, Inspect, IU8a, Registry } from '../types/index.js'; import { isNull } from '@polkadot/util'; diff --git a/packages/types-codec/src/base/Option.ts b/packages/types-codec/src/base/Option.ts index 3f12cafe79..7d1772ca15 100644 --- a/packages/types-codec/src/base/Option.ts +++ b/packages/types-codec/src/base/Option.ts @@ -2,12 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 import type { HexString } from '@polkadot/util/types'; -import type { AnyJson, Codec, CodecClass, Inspect, IOption, IU8a, Registry } from '../types'; +import type { AnyJson, Codec, CodecClass, Inspect, IOption, IU8a, Registry } from '../types/index.js'; import { isCodec, isNull, isU8a, isUndefined, u8aToHex } from '@polkadot/util'; -import { typeToConstructor } from '../utils'; -import { Null } from './Null'; +import { typeToConstructor } from '../utils/index.js'; +import { Null } from './Null.js'; interface Options { definition?: CodecClass; diff --git a/packages/types-codec/src/base/Result.ts b/packages/types-codec/src/base/Result.ts index 4718ce7f9e..91174bcdb5 100644 --- a/packages/types-codec/src/base/Result.ts +++ b/packages/types-codec/src/base/Result.ts @@ -1,9 +1,9 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Codec, CodecClass, IResult, Registry } from '../types'; +import type { Codec, CodecClass, IResult, Registry } from '../types/index.js'; -import { Enum } from './Enum'; +import { Enum } from './Enum.js'; /** * @name Result diff --git a/packages/types-codec/src/base/Tuple.ts b/packages/types-codec/src/base/Tuple.ts index 0a020c2285..3588a57208 100644 --- a/packages/types-codec/src/base/Tuple.ts +++ b/packages/types-codec/src/base/Tuple.ts @@ -1,12 +1,12 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AnyTupleValue, Codec, CodecClass, Inspect, ITuple, Registry } from '../types'; +import type { AnyTupleValue, Codec, CodecClass, Inspect, ITuple, Registry } from '../types/index.js'; import { isFunction, isHex, isString, isU8a, stringify, u8aConcatStrict, u8aToU8a } from '@polkadot/util'; -import { AbstractArray } from '../abstract/Array'; -import { decodeU8a, mapToTypeMap, typeToConstructor } from '../utils'; +import { AbstractArray } from '../abstract/Array.js'; +import { decodeU8a, mapToTypeMap, typeToConstructor } from '../utils/index.js'; type TupleType = (CodecClass | string); diff --git a/packages/types-codec/src/base/UInt.spec.ts b/packages/types-codec/src/base/UInt.spec.ts index 2f4c357b40..980c9fc4a4 100644 --- a/packages/types-codec/src/base/UInt.spec.ts +++ b/packages/types-codec/src/base/UInt.spec.ts @@ -7,7 +7,7 @@ import { TypeRegistry } from '@polkadot/types'; import { UInt } from '@polkadot/types-codec'; import { BN, BN_TWO, isBn } from '@polkadot/util'; -import { perf } from '../test/performance'; +import { perf } from '../test/performance.js'; describe('UInt', (): void => { const registry = new TypeRegistry(); diff --git a/packages/types-codec/src/base/UInt.ts b/packages/types-codec/src/base/UInt.ts index c4ba874187..55a502d27e 100644 --- a/packages/types-codec/src/base/UInt.ts +++ b/packages/types-codec/src/base/UInt.ts @@ -1,9 +1,9 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AnyNumber, CodecClass, Registry, UIntBitLength } from '../types'; +import type { AnyNumber, CodecClass, Registry, UIntBitLength } from '../types/index.js'; -import { AbstractInt } from '../abstract/Int'; +import { AbstractInt } from '../abstract/Int.js'; /** * @name UInt diff --git a/packages/types-codec/src/base/Vec.spec.ts b/packages/types-codec/src/base/Vec.spec.ts index 355dce14c7..47f2331521 100644 --- a/packages/types-codec/src/base/Vec.spec.ts +++ b/packages/types-codec/src/base/Vec.spec.ts @@ -11,7 +11,7 @@ import { Text, u32, Vec } from '@polkadot/types-codec'; import rpcMetadata from '@polkadot/types-support/metadata/static-substrate'; import { decodeAddress, randomAsU8a } from '@polkadot/util-crypto'; -import { perf } from '../test/performance'; +import { perf } from '../test/performance.js'; const registry = new TypeRegistry(); const metadata = new Metadata(registry, rpcMetadata); diff --git a/packages/types-codec/src/base/Vec.ts b/packages/types-codec/src/base/Vec.ts index 30ad79e41c..4dd52ca01b 100644 --- a/packages/types-codec/src/base/Vec.ts +++ b/packages/types-codec/src/base/Vec.ts @@ -2,12 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 import type { HexString } from '@polkadot/util/types'; -import type { Codec, CodecClass, Registry } from '../types'; +import type { Codec, CodecClass, Registry } from '../types/index.js'; import { compactFromU8aLim, isHex, isU8a, logger, stringify, u8aToU8a } from '@polkadot/util'; -import { AbstractArray } from '../abstract/Array'; -import { decodeU8aVec, typeToConstructor } from '../utils'; +import { AbstractArray } from '../abstract/Array.js'; +import { decodeU8aVec, typeToConstructor } from '../utils/index.js'; const MAX_LENGTH = 64 * 1024; diff --git a/packages/types-codec/src/base/VecAny.ts b/packages/types-codec/src/base/VecAny.ts index dd3f4f0e6d..e4b017918f 100644 --- a/packages/types-codec/src/base/VecAny.ts +++ b/packages/types-codec/src/base/VecAny.ts @@ -1,9 +1,9 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Codec } from '../types'; +import type { Codec } from '../types/index.js'; -import { AbstractArray } from '../abstract/Array'; +import { AbstractArray } from '../abstract/Array.js'; /** * @name VecAny diff --git a/packages/types-codec/src/base/VecFixed.ts b/packages/types-codec/src/base/VecFixed.ts index 2c3995336b..82dc50bc4f 100644 --- a/packages/types-codec/src/base/VecFixed.ts +++ b/packages/types-codec/src/base/VecFixed.ts @@ -2,13 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 import type { HexString } from '@polkadot/util/types'; -import type { Codec, CodecClass, Inspect, Registry } from '../types'; +import type { Codec, CodecClass, Inspect, Registry } from '../types/index.js'; import { isU8a, u8aConcatStrict } from '@polkadot/util'; -import { AbstractArray } from '../abstract/Array'; -import { decodeU8aVec, typeToConstructor } from '../utils'; -import { decodeVec } from './Vec'; +import { AbstractArray } from '../abstract/Array.js'; +import { decodeU8aVec, typeToConstructor } from '../utils/index.js'; +import { decodeVec } from './Vec.js'; interface Options { definition?: CodecClass; diff --git a/packages/types-codec/src/base/index.ts b/packages/types-codec/src/base/index.ts index a9eefc30fe..ccce0f938f 100644 --- a/packages/types-codec/src/base/index.ts +++ b/packages/types-codec/src/base/index.ts @@ -1,15 +1,15 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -export { Compact } from './Compact'; -export { DoNotConstruct } from './DoNotConstruct'; -export { Enum } from './Enum'; -export { Int } from './Int'; -export { Null } from './Null'; -export { Option } from './Option'; -export { Result } from './Result'; -export { Tuple } from './Tuple'; -export { UInt } from './UInt'; -export { Vec } from './Vec'; -export { VecAny } from './VecAny'; -export { VecFixed } from './VecFixed'; +export { Compact } from './Compact.js'; +export { DoNotConstruct } from './DoNotConstruct.js'; +export { Enum } from './Enum.js'; +export { Int } from './Int.js'; +export { Null } from './Null.js'; +export { Option } from './Option.js'; +export { Result } from './Result.js'; +export { Tuple } from './Tuple.js'; +export { UInt } from './UInt.js'; +export { Vec } from './Vec.js'; +export { VecAny } from './VecAny.js'; +export { VecFixed } from './VecFixed.js'; diff --git a/packages/types-codec/src/bundle.ts b/packages/types-codec/src/bundle.ts index 4cbb72bf32..ab90b9c567 100644 --- a/packages/types-codec/src/bundle.ts +++ b/packages/types-codec/src/bundle.ts @@ -1,11 +1,11 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -export { packageInfo } from './packageInfo'; +export { packageInfo } from './packageInfo.js'; -export * from './abstract'; -export * from './base'; -export * from './extended'; -export * from './native'; -export * from './primitive'; -export * from './utils'; +export * from './abstract/index.js'; +export * from './base/index.js'; +export * from './extended/index.js'; +export * from './native/index.js'; +export * from './primitive/index.js'; +export * from './utils/index.js'; diff --git a/packages/types-codec/src/checkTypes.manual.ts b/packages/types-codec/src/checkTypes.manual.ts index 2840b1af3a..f0676ad36c 100644 --- a/packages/types-codec/src/checkTypes.manual.ts +++ b/packages/types-codec/src/checkTypes.manual.ts @@ -5,7 +5,7 @@ import '@polkadot/types-augment'; import { TypeRegistry } from '@polkadot/types'; -import { U32 } from '.'; +import { U32 } from './index.js'; const registry = new TypeRegistry(); diff --git a/packages/types-codec/src/detectPackage.ts b/packages/types-codec/src/detectPackage.ts index 983b9278f8..f970158c7e 100644 --- a/packages/types-codec/src/detectPackage.ts +++ b/packages/types-codec/src/detectPackage.ts @@ -5,7 +5,7 @@ import { detectPackage } from '@polkadot/util'; -import others from './detectOther'; -import { packageInfo } from './packageInfo'; +import others from './detectOther.js'; +import { packageInfo } from './packageInfo.js'; detectPackage(packageInfo, null, others); diff --git a/packages/types-codec/src/extended/BTreeMap.ts b/packages/types-codec/src/extended/BTreeMap.ts index fd73daa4d5..29d6917223 100644 --- a/packages/types-codec/src/extended/BTreeMap.ts +++ b/packages/types-codec/src/extended/BTreeMap.ts @@ -1,9 +1,9 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Codec, CodecClass, Registry } from '../types'; +import type { Codec, CodecClass, Registry } from '../types/index.js'; -import { CodecMap } from './Map'; +import { CodecMap } from './Map.js'; export class BTreeMap extends CodecMap { public static with (keyType: CodecClass | string, valType: CodecClass | string): CodecClass> { diff --git a/packages/types-codec/src/extended/BTreeSet.spec.ts b/packages/types-codec/src/extended/BTreeSet.spec.ts index 359f3ad5ed..b51becee3d 100644 --- a/packages/types-codec/src/extended/BTreeSet.spec.ts +++ b/packages/types-codec/src/extended/BTreeSet.spec.ts @@ -8,7 +8,7 @@ import type { CodecClass, CodecTo } from '@polkadot/types-codec/types'; import { TypeRegistry } from '@polkadot/types'; import { BTreeSet, Enum, I32, Struct, Text, Tuple, U32 } from '@polkadot/types-codec'; -import { ITuple } from '../types/interfaces'; +import { ITuple } from '../types/interfaces.js'; const registry = new TypeRegistry(); diff --git a/packages/types-codec/src/extended/BTreeSet.ts b/packages/types-codec/src/extended/BTreeSet.ts index bc1a643eb6..3f072e0594 100644 --- a/packages/types-codec/src/extended/BTreeSet.ts +++ b/packages/types-codec/src/extended/BTreeSet.ts @@ -2,11 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { HexString } from '@polkadot/util/types'; -import type { AnyJson, Codec, CodecClass, Inspect, ISet, IU8a, Registry } from '../types'; +import type { AnyJson, Codec, CodecClass, Inspect, ISet, IU8a, Registry } from '../types/index.js'; import { compactFromU8aLim, compactToU8a, isHex, isU8a, logger, stringify, u8aConcatStrict, u8aToHex, u8aToU8a } from '@polkadot/util'; -import { compareSet, decodeU8aVec, sortSet, typeToConstructor } from '../utils'; +import { compareSet, decodeU8aVec, sortSet, typeToConstructor } from '../utils/index.js'; const l = logger('BTreeSet'); diff --git a/packages/types-codec/src/extended/BitVec.spec.ts b/packages/types-codec/src/extended/BitVec.spec.ts index df546e13b2..9ba915d9ac 100644 --- a/packages/types-codec/src/extended/BitVec.spec.ts +++ b/packages/types-codec/src/extended/BitVec.spec.ts @@ -6,7 +6,7 @@ import { TypeRegistry } from '@polkadot/types'; import { hexToU8a } from '@polkadot/util'; -import { BitVec } from './'; +import { BitVec } from './index.js'; // form Inclusion BitVec const TESTS = ['0x00', '0x0817', '0x0837', '0x087b', '0x0c33']; diff --git a/packages/types-codec/src/extended/BitVec.ts b/packages/types-codec/src/extended/BitVec.ts index 20bf3b3c72..8912ed9fdc 100644 --- a/packages/types-codec/src/extended/BitVec.ts +++ b/packages/types-codec/src/extended/BitVec.ts @@ -1,11 +1,11 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AnyU8a, Inspect, Registry } from '../types'; +import type { AnyU8a, Inspect, Registry } from '../types/index.js'; import { compactFromU8aLim, compactToU8a, isString, u8aConcatStrict, u8aToU8a } from '@polkadot/util'; -import { Raw } from '../native/Raw'; +import { Raw } from '../native/Raw.js'; /** @internal */ function decodeBitVecU8a (value?: Uint8Array): [number, Uint8Array] { diff --git a/packages/types-codec/src/extended/Bytes.ts b/packages/types-codec/src/extended/Bytes.ts index fba393d180..379deae33d 100644 --- a/packages/types-codec/src/extended/Bytes.ts +++ b/packages/types-codec/src/extended/Bytes.ts @@ -1,11 +1,11 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AnyU8a, Inspect, Registry } from '../types'; +import type { AnyU8a, Inspect, Registry } from '../types/index.js'; import { compactAddLength, compactFromU8aLim, compactToU8a, isString, isU8a, u8aToU8a } from '@polkadot/util'; -import { Raw } from '../native/Raw'; +import { Raw } from '../native/Raw.js'; // Bytes are used for things like on-chain code, so it has a healthy limit const MAX_LENGTH = 10 * 1024 * 1024; diff --git a/packages/types-codec/src/extended/HashMap.ts b/packages/types-codec/src/extended/HashMap.ts index 86bda73ce5..101b21028f 100644 --- a/packages/types-codec/src/extended/HashMap.ts +++ b/packages/types-codec/src/extended/HashMap.ts @@ -1,9 +1,9 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Codec, CodecClass, Registry } from '../types'; +import type { Codec, CodecClass, Registry } from '../types/index.js'; -import { CodecMap } from './Map'; +import { CodecMap } from './Map.js'; export class HashMap extends CodecMap { public static with (keyType: CodecClass | string, valType: CodecClass | string): CodecClass> { diff --git a/packages/types-codec/src/extended/Linkage.ts b/packages/types-codec/src/extended/Linkage.ts index c4e47211ff..9bd1b11069 100644 --- a/packages/types-codec/src/extended/Linkage.ts +++ b/packages/types-codec/src/extended/Linkage.ts @@ -2,12 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 import type { HexString } from '@polkadot/util/types'; -import type { Codec, CodecClass, Registry } from '../types'; +import type { Codec, CodecClass, Registry } from '../types/index.js'; -import { Option } from '../base/Option'; -import { Tuple } from '../base/Tuple'; -import { Vec } from '../base/Vec'; -import { Struct } from '../native/Struct'; +import { Option } from '../base/Option.js'; +import { Tuple } from '../base/Tuple.js'; +import { Vec } from '../base/Vec.js'; +import { Struct } from '../native/Struct.js'; type TypeWithValues = [CodecClass, any[]]; diff --git a/packages/types-codec/src/extended/Map.ts b/packages/types-codec/src/extended/Map.ts index 8b94b49ca6..655490063c 100644 --- a/packages/types-codec/src/extended/Map.ts +++ b/packages/types-codec/src/extended/Map.ts @@ -2,15 +2,15 @@ // SPDX-License-Identifier: Apache-2.0 import type { HexString } from '@polkadot/util/types'; -import type { AnyJson, Codec, CodecClass, IMap, Inspect, IU8a, Registry } from '../types'; +import type { AnyJson, Codec, CodecClass, IMap, Inspect, IU8a, Registry } from '../types/index.js'; import { compactFromU8aLim, compactToU8a, isHex, isObject, isU8a, logger, stringify, u8aConcatStrict, u8aToHex, u8aToU8a } from '@polkadot/util'; -import { AbstractArray } from '../abstract/Array'; -import { Enum } from '../base/Enum'; -import { Raw } from '../native/Raw'; -import { Struct } from '../native/Struct'; -import { compareMap, decodeU8a, sortMap, typeToConstructor } from '../utils'; +import { AbstractArray } from '../abstract/Array.js'; +import { Enum } from '../base/Enum.js'; +import { Raw } from '../native/Raw.js'; +import { Struct } from '../native/Struct.js'; +import { compareMap, decodeU8a, sortMap, typeToConstructor } from '../utils/index.js'; const l = logger('Map'); diff --git a/packages/types-codec/src/extended/OptionBool.ts b/packages/types-codec/src/extended/OptionBool.ts index 33a72cf64b..23b63f268c 100644 --- a/packages/types-codec/src/extended/OptionBool.ts +++ b/packages/types-codec/src/extended/OptionBool.ts @@ -2,12 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 import type { HexString } from '@polkadot/util/types'; -import type { AnyBool, Inspect, Registry } from '../types'; +import type { AnyBool, Inspect, Registry } from '../types/index.js'; import { isHex, isU8a, u8aToU8a } from '@polkadot/util'; -import { Option } from '../base/Option'; -import { bool as Bool } from '../native/Bool'; +import { Option } from '../base/Option.js'; +import { bool as Bool } from '../native/Bool.js'; function decodeU8a (registry: Registry, value: Uint8Array): null | Bool { // Encoded as - diff --git a/packages/types-codec/src/extended/Range.ts b/packages/types-codec/src/extended/Range.ts index c34d186cba..c3c260ded0 100644 --- a/packages/types-codec/src/extended/Range.ts +++ b/packages/types-codec/src/extended/Range.ts @@ -1,9 +1,9 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AnyTuple, CodecClass, INumber, Registry } from '../types'; +import type { AnyTuple, CodecClass, INumber, Registry } from '../types/index.js'; -import { Tuple } from '../base/Tuple'; +import { Tuple } from '../base/Tuple.js'; type RangeType = 'Range' | 'RangeInclusive'; diff --git a/packages/types-codec/src/extended/RangeInclusive.ts b/packages/types-codec/src/extended/RangeInclusive.ts index 3951a18604..a22d70fbae 100644 --- a/packages/types-codec/src/extended/RangeInclusive.ts +++ b/packages/types-codec/src/extended/RangeInclusive.ts @@ -1,9 +1,9 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AnyTuple, CodecClass, INumber, Registry } from '../types'; +import type { AnyTuple, CodecClass, INumber, Registry } from '../types/index.js'; -import { Range } from './Range'; +import { Range } from './Range.js'; export class RangeInclusive extends Range { constructor (registry: Registry, Type: CodecClass | string, value?: AnyTuple) { diff --git a/packages/types-codec/src/extended/Type.ts b/packages/types-codec/src/extended/Type.ts index 6db1e5bb8b..3d33fded2a 100644 --- a/packages/types-codec/src/extended/Type.ts +++ b/packages/types-codec/src/extended/Type.ts @@ -1,10 +1,10 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Registry } from '../types'; +import type { Registry } from '../types/index.js'; -import { Text } from '../native/Text'; -import { sanitize } from '../utils'; +import { Text } from '../native/Text.js'; +import { sanitize } from '../utils/index.js'; /** * @name Type diff --git a/packages/types-codec/src/extended/U8aFixed.ts b/packages/types-codec/src/extended/U8aFixed.ts index 1bf7f68b03..cfafa9f828 100644 --- a/packages/types-codec/src/extended/U8aFixed.ts +++ b/packages/types-codec/src/extended/U8aFixed.ts @@ -1,11 +1,11 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AnyU8a, CodecClass, Registry, U8aBitLength } from '../types'; +import type { AnyU8a, CodecClass, Registry, U8aBitLength } from '../types/index.js'; import { isU8a, u8aToU8a } from '@polkadot/util'; -import { Raw } from '../native/Raw'; +import { Raw } from '../native/Raw.js'; /** @internal */ function decodeU8aFixed (value: AnyU8a, bitLength: U8aBitLength): [AnyU8a, number] { diff --git a/packages/types-codec/src/extended/WrapperKeepOpaque.ts b/packages/types-codec/src/extended/WrapperKeepOpaque.ts index a32b929fbe..461348c0a2 100644 --- a/packages/types-codec/src/extended/WrapperKeepOpaque.ts +++ b/packages/types-codec/src/extended/WrapperKeepOpaque.ts @@ -1,13 +1,13 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AnyJson, AnyU8a, Codec, CodecClass, Inspect, Registry } from '../types'; +import type { AnyJson, AnyU8a, Codec, CodecClass, Inspect, Registry } from '../types/index.js'; import { compactAddLength, compactStripLength, compactToU8a, isHex, isU8a, u8aToU8a } from '@polkadot/util'; -import { Raw } from '../native/Raw'; -import { typeToConstructor } from '../utils'; -import { Bytes } from './Bytes'; +import { Raw } from '../native/Raw.js'; +import { typeToConstructor } from '../utils/index.js'; +import { Bytes } from './Bytes.js'; type OpaqueName = 'WrapperKeepOpaque' | 'WrapperOpaque'; diff --git a/packages/types-codec/src/extended/WrapperOpaque.ts b/packages/types-codec/src/extended/WrapperOpaque.ts index 2184f647c6..4a3bb323b9 100644 --- a/packages/types-codec/src/extended/WrapperOpaque.ts +++ b/packages/types-codec/src/extended/WrapperOpaque.ts @@ -1,9 +1,9 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Codec, CodecClass, Registry } from '../types'; +import type { Codec, CodecClass, Registry } from '../types/index.js'; -import { WrapperKeepOpaque } from './WrapperKeepOpaque'; +import { WrapperKeepOpaque } from './WrapperKeepOpaque.js'; export class WrapperOpaque extends WrapperKeepOpaque { constructor (registry: Registry, typeName: CodecClass | string, value?: unknown) { diff --git a/packages/types-codec/src/extended/index.ts b/packages/types-codec/src/extended/index.ts index 47f272181f..6756f76a14 100644 --- a/packages/types-codec/src/extended/index.ts +++ b/packages/types-codec/src/extended/index.ts @@ -1,17 +1,17 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -export { BitVec } from './BitVec'; -export { BTreeMap } from './BTreeMap'; -export { BTreeSet } from './BTreeSet'; -export { Bytes } from './Bytes'; -export { HashMap } from './HashMap'; -export { Linkage } from './Linkage'; -export { CodecMap, CodecMap as Map } from './Map'; -export { OptionBool } from './OptionBool'; -export { Range } from './Range'; -export { RangeInclusive } from './RangeInclusive'; -export { Type } from './Type'; -export { U8aFixed } from './U8aFixed'; -export { WrapperKeepOpaque } from './WrapperKeepOpaque'; -export { WrapperOpaque } from './WrapperOpaque'; +export { BitVec } from './BitVec.js'; +export { BTreeMap } from './BTreeMap.js'; +export { BTreeSet } from './BTreeSet.js'; +export { Bytes } from './Bytes.js'; +export { HashMap } from './HashMap.js'; +export { Linkage } from './Linkage.js'; +export { CodecMap, CodecMap as Map } from './Map.js'; +export { OptionBool } from './OptionBool.js'; +export { Range } from './Range.js'; +export { RangeInclusive } from './RangeInclusive.js'; +export { Type } from './Type.js'; +export { U8aFixed } from './U8aFixed.js'; +export { WrapperKeepOpaque } from './WrapperKeepOpaque.js'; +export { WrapperOpaque } from './WrapperOpaque.js'; diff --git a/packages/types-codec/src/index.ts b/packages/types-codec/src/index.ts index 9c8c748d02..5fc10812fb 100644 --- a/packages/types-codec/src/index.ts +++ b/packages/types-codec/src/index.ts @@ -1,6 +1,6 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -import './detectPackage'; +import './detectPackage.js'; -export * from './bundle'; +export * from './bundle.js'; diff --git a/packages/types-codec/src/mod.ts b/packages/types-codec/src/mod.ts index cda4581580..9a1a110437 100644 --- a/packages/types-codec/src/mod.ts +++ b/packages/types-codec/src/mod.ts @@ -1,4 +1,4 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -export * from './index'; +export * from './index.js'; diff --git a/packages/types-codec/src/native/Bool.ts b/packages/types-codec/src/native/Bool.ts index 4c08e16b01..575b7db6b0 100644 --- a/packages/types-codec/src/native/Bool.ts +++ b/packages/types-codec/src/native/Bool.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { HexString } from '@polkadot/util/types'; -import type { AnyBool, Codec, Inspect, IU8a, Registry } from '../types'; +import type { AnyBool, Codec, Inspect, IU8a, Registry } from '../types/index.js'; import { isU8a, u8aToHex } from '@polkadot/util'; diff --git a/packages/types-codec/src/native/Date.ts b/packages/types-codec/src/native/Date.ts index caec69d38d..3c72df97a3 100644 --- a/packages/types-codec/src/native/Date.ts +++ b/packages/types-codec/src/native/Date.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { HexString } from '@polkadot/util/types'; -import type { AnyNumber, Inspect, INumber, IU8a, Registry, UIntBitLength } from '../types'; +import type { AnyNumber, Inspect, INumber, IU8a, Registry, UIntBitLength } from '../types/index.js'; import { BN, bnToBn, bnToHex, bnToU8a, isString, isU8a, u8aToBn } from '@polkadot/util'; diff --git a/packages/types-codec/src/native/Float.ts b/packages/types-codec/src/native/Float.ts index 8b3f034afa..66e79ef0f9 100644 --- a/packages/types-codec/src/native/Float.ts +++ b/packages/types-codec/src/native/Float.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { HexString } from '@polkadot/util/types'; -import type { AnyFloat, CodecClass, IFloat, Inspect, IU8a, Registry } from '../types'; +import type { AnyFloat, CodecClass, IFloat, Inspect, IU8a, Registry } from '../types/index.js'; import { floatToU8a, isHex, isU8a, u8aToFloat, u8aToHex, u8aToU8a } from '@polkadot/util'; diff --git a/packages/types-codec/src/native/Json.ts b/packages/types-codec/src/native/Json.ts index 53de1b2a2c..c7f569a739 100644 --- a/packages/types-codec/src/native/Json.ts +++ b/packages/types-codec/src/native/Json.ts @@ -2,11 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { HexString } from '@polkadot/util/types'; -import type { AnyJson, Codec, Inspect, IU8a, Registry } from '../types'; +import type { AnyJson, Codec, Inspect, IU8a, Registry } from '../types/index.js'; import { isFunction, objectProperties, stringify } from '@polkadot/util'; -import { compareMap } from '../utils'; +import { compareMap } from '../utils/index.js'; /** @internal */ function decodeJson (value?: Record | null): [string, any][] { diff --git a/packages/types-codec/src/native/Raw.ts b/packages/types-codec/src/native/Raw.ts index 039e5a4a45..4da879bf48 100644 --- a/packages/types-codec/src/native/Raw.ts +++ b/packages/types-codec/src/native/Raw.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { HexString } from '@polkadot/util/types'; -import type { AnyJson, AnyU8a, Inspect, IU8a, Registry } from '../types'; +import type { AnyJson, AnyU8a, Inspect, IU8a, Registry } from '../types/index.js'; import { isAscii, isUndefined, isUtf8, u8aToHex, u8aToString, u8aToU8a } from '@polkadot/util'; diff --git a/packages/types-codec/src/native/Set.ts b/packages/types-codec/src/native/Set.ts index 2d1d08491e..b4bb74d5d1 100644 --- a/packages/types-codec/src/native/Set.ts +++ b/packages/types-codec/src/native/Set.ts @@ -2,11 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { HexString } from '@polkadot/util/types'; -import type { CodecClass, Inspect, ISet, IU8a, Registry } from '../types'; +import type { CodecClass, Inspect, ISet, IU8a, Registry } from '../types/index.js'; import { BN, bnToBn, bnToU8a, isBn, isNumber, isString, isU8a, isUndefined, objectProperties, stringify, stringPascalCase, u8aToBn, u8aToHex, u8aToU8a } from '@polkadot/util'; -import { compareArray } from '../utils'; +import { compareArray } from '../utils/index.js'; type SetValues = Record; diff --git a/packages/types-codec/src/native/Struct.spec.ts b/packages/types-codec/src/native/Struct.spec.ts index 70a5ce001b..404327def6 100644 --- a/packages/types-codec/src/native/Struct.spec.ts +++ b/packages/types-codec/src/native/Struct.spec.ts @@ -10,7 +10,7 @@ import type { CodecTo } from '@polkadot/types-codec/types'; import { TypeRegistry } from '@polkadot/types'; import { Bool, Enum, Option, Struct, Text, U32, Vec } from '@polkadot/types-codec'; -import { TEST_A } from './Struct.data'; +import { TEST_A } from './Struct.data.js'; describe('Struct', (): void => { const registry = new TypeRegistry(); diff --git a/packages/types-codec/src/native/Struct.ts b/packages/types-codec/src/native/Struct.ts index d400546f08..19b509a5b5 100644 --- a/packages/types-codec/src/native/Struct.ts +++ b/packages/types-codec/src/native/Struct.ts @@ -2,11 +2,11 @@ // 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'; +import type { AnyJson, BareOpts, Codec, CodecClass, Inspect, IStruct, IU8a, Registry } from '../types/index.js'; import { isBoolean, isHex, isObject, isU8a, isUndefined, objectProperties, stringCamelCase, stringify, u8aConcatStrict, u8aToHex, u8aToU8a } from '@polkadot/util'; -import { compareMap, decodeU8aStruct, mapToTypeMap, typesToMap } from '../utils'; +import { compareMap, decodeU8aStruct, mapToTypeMap, typesToMap } from '../utils/index.js'; type TypesDef = Record>; diff --git a/packages/types-codec/src/native/Text.spec.ts b/packages/types-codec/src/native/Text.spec.ts index 6732ad71e9..4a335188b6 100644 --- a/packages/types-codec/src/native/Text.spec.ts +++ b/packages/types-codec/src/native/Text.spec.ts @@ -9,7 +9,7 @@ import { TypeRegistry } from '@polkadot/types'; import { Bytes, Raw, Text } from '@polkadot/types-codec'; import { stringToU8a } from '@polkadot/util'; -import { perf } from '../test/performance'; +import { perf } from '../test/performance.js'; describe('Text', (): void => { const registry = new TypeRegistry(); diff --git a/packages/types-codec/src/native/Text.ts b/packages/types-codec/src/native/Text.ts index f74de59b91..6a92ba24c0 100644 --- a/packages/types-codec/src/native/Text.ts +++ b/packages/types-codec/src/native/Text.ts @@ -2,11 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { HexString } from '@polkadot/util/types'; -import type { AnyString, AnyU8a, Inspect, IText, IU8a, Registry } from '../types'; +import type { AnyString, AnyU8a, Inspect, IText, IU8a, Registry } from '../types/index.js'; import { compactAddLength, compactFromU8aLim, compactToU8a, hexToU8a, isHex, isString, isU8a, stringToU8a, u8aToHex, u8aToString } from '@polkadot/util'; -import { Raw } from './Raw'; +import { Raw } from './Raw.js'; const MAX_LENGTH = 128 * 1024; diff --git a/packages/types-codec/src/native/index.ts b/packages/types-codec/src/native/index.ts index 0ce85b6a9e..1e9e3cf94a 100644 --- a/packages/types-codec/src/native/index.ts +++ b/packages/types-codec/src/native/index.ts @@ -1,11 +1,11 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -export { bool, bool as Bool } from './Bool'; -export { CodecDate, CodecDate as Date } from './Date'; -export { Float } from './Float'; -export { Json } from './Json'; -export { Raw } from './Raw'; -export { CodecSet, CodecSet as Set } from './Set'; -export { Struct } from './Struct'; -export { Text } from './Text'; +export { bool, bool as Bool } from './Bool.js'; +export { CodecDate, CodecDate as Date } from './Date.js'; +export { Float } from './Float.js'; +export { Json } from './Json.js'; +export { Raw } from './Raw.js'; +export { CodecSet, CodecSet as Set } from './Set.js'; +export { Struct } from './Struct.js'; +export { Text } from './Text.js'; diff --git a/packages/types-codec/src/primitive/F32.ts b/packages/types-codec/src/primitive/F32.ts index 6142baff55..244acf8150 100644 --- a/packages/types-codec/src/primitive/F32.ts +++ b/packages/types-codec/src/primitive/F32.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Float } from '../native/Float'; +import { Float } from '../native/Float.js'; /** * @name f32 diff --git a/packages/types-codec/src/primitive/F64.ts b/packages/types-codec/src/primitive/F64.ts index ebeafdf855..f3d3e01830 100644 --- a/packages/types-codec/src/primitive/F64.ts +++ b/packages/types-codec/src/primitive/F64.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Float } from '../native/Float'; +import { Float } from '../native/Float.js'; /** * @name f64 diff --git a/packages/types-codec/src/primitive/I128.ts b/packages/types-codec/src/primitive/I128.ts index 26b14a4008..e61cf11941 100644 --- a/packages/types-codec/src/primitive/I128.ts +++ b/packages/types-codec/src/primitive/I128.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Int } from '../base/Int'; +import { Int } from '../base/Int.js'; /** * @name i128 diff --git a/packages/types-codec/src/primitive/I16.ts b/packages/types-codec/src/primitive/I16.ts index 85fc557a34..1e56108e3e 100644 --- a/packages/types-codec/src/primitive/I16.ts +++ b/packages/types-codec/src/primitive/I16.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Int } from '../base/Int'; +import { Int } from '../base/Int.js'; /** * @name i16 diff --git a/packages/types-codec/src/primitive/I256.ts b/packages/types-codec/src/primitive/I256.ts index 9b7e84f72f..10b939862d 100644 --- a/packages/types-codec/src/primitive/I256.ts +++ b/packages/types-codec/src/primitive/I256.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Int } from '../base/Int'; +import { Int } from '../base/Int.js'; /** * @name i256 diff --git a/packages/types-codec/src/primitive/I32.ts b/packages/types-codec/src/primitive/I32.ts index f52ece53c9..00f8e2490a 100644 --- a/packages/types-codec/src/primitive/I32.ts +++ b/packages/types-codec/src/primitive/I32.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Int } from '../base/Int'; +import { Int } from '../base/Int.js'; /** * @name i32 diff --git a/packages/types-codec/src/primitive/I64.ts b/packages/types-codec/src/primitive/I64.ts index 4e0eade8b8..537ab59650 100644 --- a/packages/types-codec/src/primitive/I64.ts +++ b/packages/types-codec/src/primitive/I64.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Int } from '../base/Int'; +import { Int } from '../base/Int.js'; /** * @name i64 diff --git a/packages/types-codec/src/primitive/I8.ts b/packages/types-codec/src/primitive/I8.ts index 212b8c9605..b93d06fa7a 100644 --- a/packages/types-codec/src/primitive/I8.ts +++ b/packages/types-codec/src/primitive/I8.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Int } from '../base/Int'; +import { Int } from '../base/Int.js'; /** * @name i8 diff --git a/packages/types-codec/src/primitive/U128.ts b/packages/types-codec/src/primitive/U128.ts index 92bc9efa70..126e281913 100644 --- a/packages/types-codec/src/primitive/U128.ts +++ b/packages/types-codec/src/primitive/U128.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { UInt } from '../base/UInt'; +import { UInt } from '../base/UInt.js'; /** * @name u128 diff --git a/packages/types-codec/src/primitive/U16.ts b/packages/types-codec/src/primitive/U16.ts index 0f896857a4..82b9122a27 100644 --- a/packages/types-codec/src/primitive/U16.ts +++ b/packages/types-codec/src/primitive/U16.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { UInt } from '../base/UInt'; +import { UInt } from '../base/UInt.js'; /** * @name u16 diff --git a/packages/types-codec/src/primitive/U256.ts b/packages/types-codec/src/primitive/U256.ts index ce73ce5269..cb4ef92bbb 100644 --- a/packages/types-codec/src/primitive/U256.ts +++ b/packages/types-codec/src/primitive/U256.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { UInt } from '../base/UInt'; +import { UInt } from '../base/UInt.js'; /** * @name u256 diff --git a/packages/types-codec/src/primitive/U32.ts b/packages/types-codec/src/primitive/U32.ts index 970a945831..286b51ebf5 100644 --- a/packages/types-codec/src/primitive/U32.ts +++ b/packages/types-codec/src/primitive/U32.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { UInt } from '../base/UInt'; +import { UInt } from '../base/UInt.js'; /** * @name u32 diff --git a/packages/types-codec/src/primitive/U64.ts b/packages/types-codec/src/primitive/U64.ts index ce284ec148..a64e0ace4a 100644 --- a/packages/types-codec/src/primitive/U64.ts +++ b/packages/types-codec/src/primitive/U64.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { UInt } from '../base/UInt'; +import { UInt } from '../base/UInt.js'; /** * @name u64 diff --git a/packages/types-codec/src/primitive/U8.ts b/packages/types-codec/src/primitive/U8.ts index 1736f32f33..02a35d69ef 100644 --- a/packages/types-codec/src/primitive/U8.ts +++ b/packages/types-codec/src/primitive/U8.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { UInt } from '../base/UInt'; +import { UInt } from '../base/UInt.js'; /** * @name u8 diff --git a/packages/types-codec/src/primitive/USize.ts b/packages/types-codec/src/primitive/USize.ts index 3e710039a6..8f20dfe20c 100644 --- a/packages/types-codec/src/primitive/USize.ts +++ b/packages/types-codec/src/primitive/USize.ts @@ -1,9 +1,9 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Registry } from '../types'; +import type { Registry } from '../types/index.js'; -import { u32 } from './U32'; +import { u32 } from './U32.js'; /** * @name USize diff --git a/packages/types-codec/src/primitive/index.ts b/packages/types-codec/src/primitive/index.ts index eb26a4e08c..397eeb4273 100644 --- a/packages/types-codec/src/primitive/index.ts +++ b/packages/types-codec/src/primitive/index.ts @@ -1,18 +1,18 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -export { f32, f32 as F32 } from './F32'; -export { f64, f64 as F64 } from './F64'; -export { i8, i8 as I8 } from './I8'; -export { i16, i16 as I16 } from './I16'; -export { i32, i32 as I32 } from './I32'; -export { i64, i64 as I64 } from './I64'; -export { i128, i128 as I128 } from './I128'; -export { i256, i256 as I256 } from './I256'; -export { u8, u8 as U8 } from './U8'; -export { u16, u16 as U16 } from './U16'; -export { u32, u32 as U32 } from './U32'; -export { u64, u64 as U64 } from './U64'; -export { u128, u128 as U128 } from './U128'; -export { u256, u256 as U256 } from './U256'; -export { usize, usize as USize } from './USize'; +export { f32, f32 as F32 } from './F32.js'; +export { f64, f64 as F64 } from './F64.js'; +export { i8, i8 as I8 } from './I8.js'; +export { i16, i16 as I16 } from './I16.js'; +export { i32, i32 as I32 } from './I32.js'; +export { i64, i64 as I64 } from './I64.js'; +export { i128, i128 as I128 } from './I128.js'; +export { i256, i256 as I256 } from './I256.js'; +export { u8, u8 as U8 } from './U8.js'; +export { u16, u16 as U16 } from './U16.js'; +export { u32, u32 as U32 } from './U32.js'; +export { u64, u64 as U64 } from './U64.js'; +export { u128, u128 as U128 } from './U128.js'; +export { u256, u256 as U256 } from './U256.js'; +export { usize, usize as USize } from './USize.js'; diff --git a/packages/types-codec/src/types/codec.ts b/packages/types-codec/src/types/codec.ts index c37dc0d36e..fe30e20ad9 100644 --- a/packages/types-codec/src/types/codec.ts +++ b/packages/types-codec/src/types/codec.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 import type { HexString } from '@polkadot/util/types'; -import type { AnyJson, ToString } from './helpers'; -import type { IU8a } from './interfaces'; -import type { Registry } from './registry'; +import type { AnyJson, ToString } from './helpers.js'; +import type { IU8a } from './interfaces.js'; +import type { Registry } from './registry.js'; export type BareOpts = boolean | Record; diff --git a/packages/types-codec/src/types/helpers.ts b/packages/types-codec/src/types/helpers.ts index b809207f80..f0bfcf50ec 100644 --- a/packages/types-codec/src/types/helpers.ts +++ b/packages/types-codec/src/types/helpers.ts @@ -3,7 +3,7 @@ import type { BN } from '@polkadot/util'; import type { HexString } from '@polkadot/util/types'; -import type { Codec } from './codec'; +import type { Codec } from './codec.js'; export type AnyJson = string | number | boolean | null | undefined | AnyJson[] | { [index: string]: AnyJson }; diff --git a/packages/types-codec/src/types/index.ts b/packages/types-codec/src/types/index.ts index 63df139235..c3c9ed6552 100644 --- a/packages/types-codec/src/types/index.ts +++ b/packages/types-codec/src/types/index.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -export * from './codec'; -export * from './helpers'; -export * from './interfaces'; -export * from './registry'; +export * from './codec.js'; +export * from './helpers.js'; +export * from './interfaces.js'; +export * from './registry.js'; diff --git a/packages/types-codec/src/types/interfaces.ts b/packages/types-codec/src/types/interfaces.ts index d32a0ae89d..7a9d5f3f83 100644 --- a/packages/types-codec/src/types/interfaces.ts +++ b/packages/types-codec/src/types/interfaces.ts @@ -3,8 +3,8 @@ // import type { SignOptions } from '@polkadot/keyring/types'; import type { BN } from '@polkadot/util'; -import type { ArgsDef, Codec } from './codec'; -import type { AnyTuple } from './helpers'; +import type { ArgsDef, Codec } from './codec.js'; +import type { AnyTuple } from './helpers.js'; export interface ICompact extends Codec { toBigInt (): bigint; diff --git a/packages/types-codec/src/types/registry.ts b/packages/types-codec/src/types/registry.ts index 7e63987d98..eb34081a31 100644 --- a/packages/types-codec/src/types/registry.ts +++ b/packages/types-codec/src/types/registry.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 import type { BN } from '@polkadot/util'; -import type { Codec, CodecClass } from './codec'; -import type { AnyTuple, LookupString } from './helpers'; -import type { ICompact, IEnum, IMap, IMethod, INumber, IOption, IResult, ISet, IStruct, ITuple, IU8a, IVec } from './interfaces'; +import type { Codec, CodecClass } from './codec.js'; +import type { AnyTuple, LookupString } from './helpers.js'; +import type { ICompact, IEnum, IMap, IMethod, INumber, IOption, IResult, ISet, IStruct, ITuple, IU8a, IVec } from './interfaces.js'; export type OnlyCodec = K extends keyof Types diff --git a/packages/types-codec/src/utils/compareArray.ts b/packages/types-codec/src/utils/compareArray.ts index 946a216210..36f1c7025c 100644 --- a/packages/types-codec/src/utils/compareArray.ts +++ b/packages/types-codec/src/utils/compareArray.ts @@ -3,7 +3,7 @@ import { isUndefined } from '@polkadot/util'; -import { hasEq } from './util'; +import { hasEq } from './util.js'; // NOTE These are used internally and when comparing objects, expects that // when the second is an Codec[] that the first has to be as well diff --git a/packages/types-codec/src/utils/compareMap.ts b/packages/types-codec/src/utils/compareMap.ts index 22e30d0d21..a0a5928012 100644 --- a/packages/types-codec/src/utils/compareMap.ts +++ b/packages/types-codec/src/utils/compareMap.ts @@ -3,7 +3,7 @@ import { isObject, isUndefined } from '@polkadot/util'; -import { hasEq } from './util'; +import { hasEq } from './util.js'; function hasMismatch (a?: unknown, b?: unknown): boolean { return isUndefined(a) || ( diff --git a/packages/types-codec/src/utils/decodeU8a.ts b/packages/types-codec/src/utils/decodeU8a.ts index d52f8f663b..c22e3fae3f 100644 --- a/packages/types-codec/src/utils/decodeU8a.ts +++ b/packages/types-codec/src/utils/decodeU8a.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Codec, CodecClass, Registry } from '../types'; +import type { Codec, CodecClass, Registry } from '../types/index.js'; import { u8aToHex } from '@polkadot/util'; diff --git a/packages/types-codec/src/utils/index.ts b/packages/types-codec/src/utils/index.ts index 8001d8b0fd..6c32bf3aa9 100644 --- a/packages/types-codec/src/utils/index.ts +++ b/packages/types-codec/src/utils/index.ts @@ -1,12 +1,12 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -export { compareArray } from './compareArray'; -export { compareMap } from './compareMap'; -export { compareSet } from './compareSet'; -export { decodeU8a, decodeU8aStruct, decodeU8aVec } from './decodeU8a'; -export { mapToTypeMap } from './mapToTypeMap'; -export { typeToConstructor } from './typeToConstructor'; -export { sanitize } from './sanitize'; -export { sortAsc, sortSet, sortMap } from './sortValues'; -export { typesToMap } from './typesToMap'; +export { compareArray } from './compareArray.js'; +export { compareMap } from './compareMap.js'; +export { compareSet } from './compareSet.js'; +export { decodeU8a, decodeU8aStruct, decodeU8aVec } from './decodeU8a.js'; +export { mapToTypeMap } from './mapToTypeMap.js'; +export { typeToConstructor } from './typeToConstructor.js'; +export { sanitize } from './sanitize.js'; +export { sortAsc, sortSet, sortMap } from './sortValues.js'; +export { typesToMap } from './typesToMap.js'; diff --git a/packages/types-codec/src/utils/mapToTypeMap.ts b/packages/types-codec/src/utils/mapToTypeMap.ts index dba99c87e9..5ff06a36cd 100644 --- a/packages/types-codec/src/utils/mapToTypeMap.ts +++ b/packages/types-codec/src/utils/mapToTypeMap.ts @@ -1,9 +1,9 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { CodecClass, Registry } from '../types'; +import type { CodecClass, Registry } from '../types/index.js'; -import { typeToConstructor } from './typeToConstructor'; +import { typeToConstructor } from './typeToConstructor.js'; /** * @description takes an input map of the form `{ [string]: string | CodecClass }` and returns a map of `{ [string]: CodecClass }` diff --git a/packages/types-codec/src/utils/sanitize.ts b/packages/types-codec/src/utils/sanitize.ts index 9ddbacfcba..72231a339b 100644 --- a/packages/types-codec/src/utils/sanitize.ts +++ b/packages/types-codec/src/utils/sanitize.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AnyString } from '../types'; +import { AnyString } from '../types/index.js'; type Mapper = (value: string) => string; diff --git a/packages/types-codec/src/utils/sortValues.ts b/packages/types-codec/src/utils/sortValues.ts index 4453af22e3..2c5668ab7c 100644 --- a/packages/types-codec/src/utils/sortValues.ts +++ b/packages/types-codec/src/utils/sortValues.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 import type { BN } from '@polkadot/util'; -import type { Enum } from '../base/Enum'; -import type { Codec } from '../types'; +import type { Enum } from '../base/Enum.js'; +import type { Codec } from '../types/index.js'; import { bnToBn, isBigInt, isBn, isFunction, isNumber, stringify } from '@polkadot/util'; diff --git a/packages/types-codec/src/utils/typeToConstructor.ts b/packages/types-codec/src/utils/typeToConstructor.ts index 9a386f4a0b..a0bbb63d15 100644 --- a/packages/types-codec/src/utils/typeToConstructor.ts +++ b/packages/types-codec/src/utils/typeToConstructor.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Codec, CodecClass, Registry } from '../types'; +import type { Codec, CodecClass, Registry } from '../types/index.js'; import { isString } from '@polkadot/util'; diff --git a/packages/types-codec/src/utils/typesToMap.ts b/packages/types-codec/src/utils/typesToMap.ts index cb155edc22..38140e80bc 100644 --- a/packages/types-codec/src/utils/typesToMap.ts +++ b/packages/types-codec/src/utils/typesToMap.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { CodecClass, Registry } from '../types'; +import type { CodecClass, Registry } from '../types/index.js'; export function typesToMap (registry: Registry, [Types, keys]: [CodecClass[], string[]]): Record { const result: Record = {}; diff --git a/packages/types-create/src/bundle.ts b/packages/types-create/src/bundle.ts index 4cc94e53a8..c2395bee87 100644 --- a/packages/types-create/src/bundle.ts +++ b/packages/types-create/src/bundle.ts @@ -1,8 +1,8 @@ // Copyright 2017-2023 @polkadot/types-codec authors & contributors // SPDX-License-Identifier: Apache-2.0 -export { packageInfo } from './packageInfo'; -export { TypeDefInfo } from './types'; +export { packageInfo } from './packageInfo.js'; +export { TypeDefInfo } from './types/index.js'; -export * from './create'; -export * from './util'; +export * from './create/index.js'; +export * from './util/index.js'; diff --git a/packages/types-create/src/create/class.ts b/packages/types-create/src/create/class.ts index c59374a71b..7475129332 100644 --- a/packages/types-create/src/create/class.ts +++ b/packages/types-create/src/create/class.ts @@ -2,13 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 import type { Codec, CodecClass, LookupString, Registry, U8aBitLength, UIntBitLength } from '@polkadot/types-codec/types'; -import type { TypeDef } from '../types'; +import type { TypeDef } from '../types/index.js'; import { BTreeMap, BTreeSet, Bytes, CodecSet, Compact, DoNotConstruct, Enum, HashMap, Int, Null, Option, Range, RangeInclusive, Result, Struct, Tuple, U8aFixed, UInt, Vec, VecFixed, WrapperKeepOpaque, WrapperOpaque } from '@polkadot/types-codec'; import { isNumber, stringify } from '@polkadot/util'; -import { TypeDefInfo } from '../types'; -import { getTypeDef } from '../util/getTypeDef'; +import { TypeDefInfo } from '../types/index.js'; +import { getTypeDef } from '../util/getTypeDef.js'; function getTypeDefType ({ lookupName, type }: TypeDef): string { return lookupName || type; diff --git a/packages/types-create/src/create/index.ts b/packages/types-create/src/create/index.ts index 1cffe932d2..5ee5b376ca 100644 --- a/packages/types-create/src/create/index.ts +++ b/packages/types-create/src/create/index.ts @@ -1,5 +1,5 @@ // Copyright 2017-2023 @polkadot/types-create authors & contributors // SPDX-License-Identifier: Apache-2.0 -export * from './class'; -export * from './type'; +export * from './class.js'; +export * from './type.js'; diff --git a/packages/types-create/src/create/type.ts b/packages/types-create/src/create/type.ts index b53d7f51f3..7f1749fdc9 100644 --- a/packages/types-create/src/create/type.ts +++ b/packages/types-create/src/create/type.ts @@ -2,12 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 import type { Codec, CodecClass, IU8a, Registry } from '@polkadot/types-codec/types'; -import type { CreateOptions } from '../types'; +import type { CreateOptions } from '../types/index.js'; import { Bytes, Option } from '@polkadot/types-codec'; import { isHex, isU8a, u8aEq, u8aToHex, u8aToU8a } from '@polkadot/util'; -import { createClassUnsafe } from './class'; +import { createClassUnsafe } from './class.js'; // With isPedantic, actually check that the encoding matches that supplied. This // is much slower, but verifies that we have the correct types defined diff --git a/packages/types-create/src/detectPackage.ts b/packages/types-create/src/detectPackage.ts index 5534ad376a..072d43eb9d 100644 --- a/packages/types-create/src/detectPackage.ts +++ b/packages/types-create/src/detectPackage.ts @@ -5,7 +5,7 @@ import { detectPackage } from '@polkadot/util'; -import others from './detectOther'; -import { packageInfo } from './packageInfo'; +import others from './detectOther.js'; +import { packageInfo } from './packageInfo.js'; detectPackage(packageInfo, null, others); diff --git a/packages/types-create/src/index.ts b/packages/types-create/src/index.ts index 713edb6eb2..9ac248a7ba 100644 --- a/packages/types-create/src/index.ts +++ b/packages/types-create/src/index.ts @@ -1,6 +1,6 @@ // Copyright 2017-2023 @polkadot/types-create authors & contributors // SPDX-License-Identifier: Apache-2.0 -import './detectPackage'; +import './detectPackage.js'; -export * from './bundle'; +export * from './bundle.js'; diff --git a/packages/types-create/src/mod.ts b/packages/types-create/src/mod.ts index 953d6c4427..c58fdb9a11 100644 --- a/packages/types-create/src/mod.ts +++ b/packages/types-create/src/mod.ts @@ -1,4 +1,4 @@ // Copyright 2017-2023 @polkadot/types-create authors & contributors // SPDX-License-Identifier: Apache-2.0 -export * from './index'; +export * from './index.js'; diff --git a/packages/types-create/src/types/index.ts b/packages/types-create/src/types/index.ts index e4e3f761fd..4300847dba 100644 --- a/packages/types-create/src/types/index.ts +++ b/packages/types-create/src/types/index.ts @@ -1,9 +1,9 @@ // Copyright 2017-2023 @polkadot/types-create authors & contributors // SPDX-License-Identifier: Apache-2.0 -import './augmentRegistry'; +import './augmentRegistry.js'; export type { CodecCreateOptions as CreateOptions } from '@polkadot/types-codec/types'; -export * from './lookup'; -export * from './types'; +export * from './lookup.js'; +export * from './types.js'; diff --git a/packages/types-create/src/types/lookup.ts b/packages/types-create/src/types/lookup.ts index 67e4adec6e..708a1a702b 100644 --- a/packages/types-create/src/types/lookup.ts +++ b/packages/types-create/src/types/lookup.ts @@ -3,7 +3,7 @@ import type { Option, Text } from '@polkadot/types-codec'; import type { ICompact, INumber, LookupString } from '@polkadot/types-codec/types'; -import type { TypeDef } from './types'; +import type { TypeDef } from './types.js'; // A simplified SiType without the need for an interface import // (while type interfaces are still in @polkadot/types). This provides diff --git a/packages/types-create/src/util/encodeTypes.ts b/packages/types-create/src/util/encodeTypes.ts index c22886dd78..a7e536d341 100644 --- a/packages/types-create/src/util/encodeTypes.ts +++ b/packages/types-create/src/util/encodeTypes.ts @@ -6,7 +6,7 @@ import type { TypeDef } from '@polkadot/types-create/types'; import { isNumber, isUndefined, objectSpread, stringify } from '@polkadot/util'; -import { TypeDefInfo } from '../types'; +import { TypeDefInfo } from '../types/index.js'; type ToString = { toString: () => string }; diff --git a/packages/types-create/src/util/getTypeDef.ts b/packages/types-create/src/util/getTypeDef.ts index 695fe36761..2079649b44 100644 --- a/packages/types-create/src/util/getTypeDef.ts +++ b/packages/types-create/src/util/getTypeDef.ts @@ -7,8 +7,8 @@ import type { TypeDef } from '@polkadot/types-create/types'; import { sanitize } from '@polkadot/types-codec'; import { isNumber, isString, objectSpread } from '@polkadot/util'; -import { TypeDefInfo } from '../types'; -import { typeSplit } from './typeSplit'; +import { TypeDefInfo } from '../types/index.js'; +import { typeSplit } from './typeSplit.js'; interface TypeDefOptions { name?: string; diff --git a/packages/types-create/src/util/index.ts b/packages/types-create/src/util/index.ts index b946253307..5f4a763436 100644 --- a/packages/types-create/src/util/index.ts +++ b/packages/types-create/src/util/index.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types-create authors & contributors // SPDX-License-Identifier: Apache-2.0 -export * from './encodeTypes'; -export * from './getTypeDef'; -export * from './typeSplit'; -export * from './xcm'; +export * from './encodeTypes.js'; +export * from './getTypeDef.js'; +export * from './typeSplit.js'; +export * from './xcm.js'; diff --git a/packages/types-known/src/bundle.ts b/packages/types-known/src/bundle.ts index 14059382ff..8160c4d39a 100644 --- a/packages/types-known/src/bundle.ts +++ b/packages/types-known/src/bundle.ts @@ -3,6 +3,6 @@ export { mapXcmTypes } from '@polkadot/types-create'; -export { packageInfo } from './packageInfo'; +export { packageInfo } from './packageInfo.js'; -export * from './util'; +export * from './util.js'; diff --git a/packages/types-known/src/detectPackage.ts b/packages/types-known/src/detectPackage.ts index b2cad21549..d1fc21df9e 100644 --- a/packages/types-known/src/detectPackage.ts +++ b/packages/types-known/src/detectPackage.ts @@ -5,7 +5,7 @@ import { detectPackage } from '@polkadot/util'; -import others from './detectOther'; -import { packageInfo } from './packageInfo'; +import others from './detectOther.js'; +import { packageInfo } from './packageInfo.js'; detectPackage(packageInfo, null, others); diff --git a/packages/types-known/src/index.ts b/packages/types-known/src/index.ts index 1477c91a90..f8852ee7be 100644 --- a/packages/types-known/src/index.ts +++ b/packages/types-known/src/index.ts @@ -1,6 +1,6 @@ // Copyright 2017-2023 @polkadot/types-known authors & contributors // SPDX-License-Identifier: Apache-2.0 -import './detectPackage'; +import './detectPackage.js'; -export * from './bundle'; +export * from './bundle.js'; diff --git a/packages/types-known/src/mod.ts b/packages/types-known/src/mod.ts index b02d4d313d..5aaacf4a25 100644 --- a/packages/types-known/src/mod.ts +++ b/packages/types-known/src/mod.ts @@ -1,4 +1,4 @@ // Copyright 2017-2023 @polkadot/types-known authors & contributors // SPDX-License-Identifier: Apache-2.0 -export * from './index'; +export * from './index.js'; diff --git a/packages/types-known/src/spec/index.ts b/packages/types-known/src/spec/index.ts index 38df9e3b14..939143e098 100644 --- a/packages/types-known/src/spec/index.ts +++ b/packages/types-known/src/spec/index.ts @@ -3,15 +3,15 @@ import type { OverrideVersionedType } from '@polkadot/types/types'; -import centrifugeChain from './centrifuge-chain'; -import kusama from './kusama'; -import node from './node'; -import nodeTemplate from './node-template'; -import polkadot from './polkadot'; -import rococo from './rococo'; -import shell from './shell'; -import statemint from './statemint'; -import westend from './westend'; +import centrifugeChain from './centrifuge-chain.js'; +import kusama from './kusama.js'; +import node from './node.js'; +import nodeTemplate from './node-template.js'; +import polkadot from './polkadot.js'; +import rococo from './rococo.js'; +import shell from './shell.js'; +import statemint from './statemint.js'; +import westend from './westend.js'; // Type overrides for specific spec types & versions as given in runtimeVersion const typesSpec: Record = { diff --git a/packages/types-known/src/upgrades/e2e/index.spec.ts b/packages/types-known/src/upgrades/e2e/index.spec.ts index 7d28315de6..9001104db6 100644 --- a/packages/types-known/src/upgrades/e2e/index.spec.ts +++ b/packages/types-known/src/upgrades/e2e/index.spec.ts @@ -1,15 +1,17 @@ // Copyright 2017-2023 @polkadot/types-known authors & contributors // SPDX-License-Identifier: Apache-2.0 +/// + import type { HexString } from '@polkadot/util/types'; -import type { ChainUpgradesExpanded } from '../types'; +import type { ChainUpgradesExpanded } from '../types.js'; import fs from 'node:fs'; import { ApiPromise, WsProvider } from '@polkadot/api'; -import * as allMan from '../manual'; -import * as allGen from '.'; +import * as allMan from '../manual/index.js'; +import * as allGen from './index.js'; const keys = ['kusama', 'polkadot', 'westend'] as const; const urls = { @@ -35,7 +37,7 @@ for (const chain of keys) { // Auto-generated from on-chain data & manual definitions, do not edit /* eslint-disable quotes, comma-spacing */ - import type { ChainUpgradesExpanded } from '../types'; + import type { ChainUpgradesExpanded } from '../types.js'; const upgrades: ChainUpgradesExpanded = ${JSON.stringify(final, null, 2)}; diff --git a/packages/types-known/src/upgrades/e2e/index.ts b/packages/types-known/src/upgrades/e2e/index.ts index 135af90bb3..f7682849ed 100644 --- a/packages/types-known/src/upgrades/e2e/index.ts +++ b/packages/types-known/src/upgrades/e2e/index.ts @@ -1,6 +1,6 @@ // Copyright 2017-2023 @polkadot/types-known authors & contributors // SPDX-License-Identifier: Apache-2.0 -export { default as kusama } from './kusama'; -export { default as polkadot } from './polkadot'; -export { default as westend } from './westend'; +export { default as kusama } from './kusama.js'; +export { default as polkadot } from './polkadot.js'; +export { default as westend } from './westend.js'; diff --git a/packages/types-known/src/upgrades/e2e/kusama.ts b/packages/types-known/src/upgrades/e2e/kusama.ts index bfd53019dd..ac66622031 100644 --- a/packages/types-known/src/upgrades/e2e/kusama.ts +++ b/packages/types-known/src/upgrades/e2e/kusama.ts @@ -4,7 +4,7 @@ // Auto-generated from on-chain data & manual definitions, do not edit /* eslint-disable quotes, comma-spacing */ -import type { ChainUpgradesExpanded } from '../types'; +import type { ChainUpgradesExpanded } from '../types.js'; const upgrades: ChainUpgradesExpanded = [ [ diff --git a/packages/types-known/src/upgrades/e2e/polkadot.ts b/packages/types-known/src/upgrades/e2e/polkadot.ts index ead3fff5d8..324a34a06c 100644 --- a/packages/types-known/src/upgrades/e2e/polkadot.ts +++ b/packages/types-known/src/upgrades/e2e/polkadot.ts @@ -4,7 +4,7 @@ // Auto-generated from on-chain data & manual definitions, do not edit /* eslint-disable quotes, comma-spacing */ -import type { ChainUpgradesExpanded } from '../types'; +import type { ChainUpgradesExpanded } from '../types.js'; const upgrades: ChainUpgradesExpanded = [ [ diff --git a/packages/types-known/src/upgrades/e2e/westend.ts b/packages/types-known/src/upgrades/e2e/westend.ts index ec751bf25b..2d12c18d94 100644 --- a/packages/types-known/src/upgrades/e2e/westend.ts +++ b/packages/types-known/src/upgrades/e2e/westend.ts @@ -4,7 +4,7 @@ // Auto-generated from on-chain data & manual definitions, do not edit /* eslint-disable quotes, comma-spacing */ -import type { ChainUpgradesExpanded } from '../types'; +import type { ChainUpgradesExpanded } from '../types.js'; const upgrades: ChainUpgradesExpanded = [ [ diff --git a/packages/types-known/src/upgrades/index.spec.ts b/packages/types-known/src/upgrades/index.spec.ts index 8eae5c65a3..d549603769 100644 --- a/packages/types-known/src/upgrades/index.spec.ts +++ b/packages/types-known/src/upgrades/index.spec.ts @@ -3,13 +3,13 @@ /// -import type { ChainUpgradesExpanded, ChainUpgradesRaw } from './types'; +import type { ChainUpgradesExpanded, ChainUpgradesRaw } from './types.js'; import { stringify, u8aEq } from '@polkadot/util'; -import * as allGen from './e2e'; -import * as allMan from './manual'; -import all from '.'; +import * as allGen from './e2e/index.js'; +import * as allMan from './manual/index.js'; +import all from './index.js'; interface TestDef { genesisHash: string; diff --git a/packages/types-known/src/upgrades/index.ts b/packages/types-known/src/upgrades/index.ts index 4cedc9f3b6..6bc0a59162 100644 --- a/packages/types-known/src/upgrades/index.ts +++ b/packages/types-known/src/upgrades/index.ts @@ -3,12 +3,12 @@ import type { ChainUpgrades } from '@polkadot/types/types'; import type { HexString } from '@polkadot/util/types'; -import type { ChainUpgradesExpanded } from './types'; +import type { ChainUpgradesExpanded } from './types.js'; import { selectableNetworks } from '@polkadot/networks'; import { BN, hexToU8a } from '@polkadot/util'; -import * as allKnown from './e2e'; +import * as allKnown from './e2e/index.js'; // testnets are not available in the networks map const NET_EXTRA: Record = { diff --git a/packages/types-known/src/upgrades/manual/index.ts b/packages/types-known/src/upgrades/manual/index.ts index 135af90bb3..f7682849ed 100644 --- a/packages/types-known/src/upgrades/manual/index.ts +++ b/packages/types-known/src/upgrades/manual/index.ts @@ -1,6 +1,6 @@ // Copyright 2017-2023 @polkadot/types-known authors & contributors // SPDX-License-Identifier: Apache-2.0 -export { default as kusama } from './kusama'; -export { default as polkadot } from './polkadot'; -export { default as westend } from './westend'; +export { default as kusama } from './kusama.js'; +export { default as polkadot } from './polkadot.js'; +export { default as westend } from './westend.js'; diff --git a/packages/types-known/src/upgrades/manual/kusama.ts b/packages/types-known/src/upgrades/manual/kusama.ts index d64fd1f4ac..49898f8fe1 100644 --- a/packages/types-known/src/upgrades/manual/kusama.ts +++ b/packages/types-known/src/upgrades/manual/kusama.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types-known authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ChainUpgradesRaw } from '../types'; +import type { ChainUpgradesRaw } from '../types.js'; const upgrades: ChainUpgradesRaw = [ [0, 1020], [26669, 1021], [38245, 1022], [54248, 1023], [59659, 1024], diff --git a/packages/types-known/src/upgrades/manual/polkadot.ts b/packages/types-known/src/upgrades/manual/polkadot.ts index dbc361c6a7..659adaf8e0 100644 --- a/packages/types-known/src/upgrades/manual/polkadot.ts +++ b/packages/types-known/src/upgrades/manual/polkadot.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types-known authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ChainUpgradesRaw } from '../types'; +import type { ChainUpgradesRaw } from '../types.js'; const upgrades: ChainUpgradesRaw = [ [0, 0], [29231, 1], [188836, 5], [199405, 6], [214264, 7], diff --git a/packages/types-known/src/upgrades/manual/westend.ts b/packages/types-known/src/upgrades/manual/westend.ts index 25e5cbb78b..d9432ca5d0 100644 --- a/packages/types-known/src/upgrades/manual/westend.ts +++ b/packages/types-known/src/upgrades/manual/westend.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types-known authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ChainUpgradesRaw } from '../types'; +import type { ChainUpgradesRaw } from '../types.js'; const upgrades: ChainUpgradesRaw = [ [214356, 4], [392764, 7], [409740, 8], [809976, 20], [877581, 24], diff --git a/packages/types-known/src/util.ts b/packages/types-known/src/util.ts index a2aab37a27..0fd66e5915 100644 --- a/packages/types-known/src/util.ts +++ b/packages/types-known/src/util.ts @@ -9,9 +9,9 @@ import type { BN } from '@polkadot/util'; import { bnToBn, objectSpread } from '@polkadot/util'; -import typesChain from './chain'; -import typesSpec from './spec'; -import upgrades from './upgrades'; +import typesChain from './chain/index.js'; +import typesSpec from './spec/index.js'; +import upgrades from './upgrades/index.js'; /** * @description Perform the callback function using the stringified spec/chain diff --git a/packages/types-support/src/detectPackage.ts b/packages/types-support/src/detectPackage.ts index e00759f9db..6a70c8dae3 100644 --- a/packages/types-support/src/detectPackage.ts +++ b/packages/types-support/src/detectPackage.ts @@ -5,7 +5,7 @@ import { detectPackage } from '@polkadot/util'; -import others from './detectOther'; -import { packageInfo } from './packageInfo'; +import others from './detectOther.js'; +import { packageInfo } from './packageInfo.js'; detectPackage(packageInfo, null, others); diff --git a/packages/types-support/src/index.ts b/packages/types-support/src/index.ts index b1056bb04f..1fdbd49d38 100644 --- a/packages/types-support/src/index.ts +++ b/packages/types-support/src/index.ts @@ -1,6 +1,6 @@ // Copyright 2017-2023 @polkadot/types-support authors & contributors // SPDX-License-Identifier: Apache-2.0 -import './detectPackage'; +import './detectPackage.js'; -export { packageInfo } from './packageInfo'; +export { packageInfo } from './packageInfo.js'; diff --git a/packages/types-support/src/metadata/static-kusama.ts b/packages/types-support/src/metadata/static-kusama.ts index 378778796f..934fe077aa 100644 --- a/packages/types-support/src/metadata/static-kusama.ts +++ b/packages/types-support/src/metadata/static-kusama.ts @@ -1,9 +1,9 @@ // Copyright 2017-2023 @polkadot/types-support authors & contributors // SPDX-License-Identifier: Apache-2.0 -import metadata from './v14/kusama-hex'; -import rpc from './v14/kusama-rpc'; -import version from './v14/kusama-ver'; +import metadata from './v14/kusama-hex.js'; +import rpc from './v14/kusama-rpc.js'; +import version from './v14/kusama-ver.js'; export { rpc, version }; diff --git a/packages/types-support/src/metadata/static-polkadot.ts b/packages/types-support/src/metadata/static-polkadot.ts index bcb7419f85..ae9353d505 100644 --- a/packages/types-support/src/metadata/static-polkadot.ts +++ b/packages/types-support/src/metadata/static-polkadot.ts @@ -1,9 +1,9 @@ // Copyright 2017-2023 @polkadot/types-support authors & contributors // SPDX-License-Identifier: Apache-2.0 -import metadata from './v14/polkadot-hex'; -import rpc from './v14/polkadot-rpc'; -import version from './v14/polkadot-ver'; +import metadata from './v14/polkadot-hex.js'; +import rpc from './v14/polkadot-rpc.js'; +import version from './v14/polkadot-ver.js'; export { rpc, version }; diff --git a/packages/types-support/src/metadata/static-substrate.ts b/packages/types-support/src/metadata/static-substrate.ts index 17f0458dcc..22e85b2420 100644 --- a/packages/types-support/src/metadata/static-substrate.ts +++ b/packages/types-support/src/metadata/static-substrate.ts @@ -1,9 +1,9 @@ // Copyright 2017-2023 @polkadot/types-support authors & contributors // SPDX-License-Identifier: Apache-2.0 -import metadata from './v14/substrate-hex'; -import rpc from './v14/substrate-rpc'; -import version from './v14/substrate-ver'; +import metadata from './v14/substrate-hex.js'; +import rpc from './v14/substrate-rpc.js'; +import version from './v14/substrate-ver.js'; export { rpc, version }; diff --git a/packages/types/src/bundle.ts b/packages/types/src/bundle.ts index 31df712886..21f717354c 100644 --- a/packages/types/src/bundle.ts +++ b/packages/types/src/bundle.ts @@ -1,18 +1,18 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import * as typeDefinitions from './interfaces/definitions'; -import rpcDefinitions from './interfaces/jsonrpc'; +import * as typeDefinitions from './interfaces/definitions.js'; +import rpcDefinitions from './interfaces/jsonrpc.js'; -export * from './codec'; -export * from './create'; -export * from './index.types'; -export * from './metadata'; +export * from './codec/index.js'; +export * from './create/index.js'; +export * from './index.types.js'; +export * from './metadata/index.js'; export { TypeDefInfo } from '@polkadot/types-create'; -export { convertSiV0toV1 } from './metadata/PortableRegistry'; -export { packageInfo } from './packageInfo'; -export { unwrapStorageType } from './primitive/StorageKey'; +export { convertSiV0toV1 } from './metadata/PortableRegistry/index.js'; +export { packageInfo } from './packageInfo.js'; +export { unwrapStorageType } from './primitive/StorageKey.js'; export { typeDefinitions, rpcDefinitions }; diff --git a/packages/types/src/checkTypes.manual.ts b/packages/types/src/checkTypes.manual.ts index 27195dc3a3..ec2dd1b636 100644 --- a/packages/types/src/checkTypes.manual.ts +++ b/packages/types/src/checkTypes.manual.ts @@ -5,11 +5,11 @@ import '@polkadot/types-augment'; import type { Bytes, Compact, Option, u32 } from '@polkadot/types-codec'; import type { IOption, ITuple } from '@polkadot/types-codec/types'; -import type { AccountId, BlockAttestations, SessionKeys7 } from './interfaces'; +import type { AccountId, BlockAttestations, SessionKeys7 } from './interfaces/index.js'; import { assert } from '@polkadot/util'; -import { TypeRegistry } from './create'; +import { TypeRegistry } from './create/index.js'; const registry = new TypeRegistry(); diff --git a/packages/types/src/create/createClass.spec.ts b/packages/types/src/create/createClass.spec.ts index d476afb452..008ee41182 100644 --- a/packages/types/src/create/createClass.spec.ts +++ b/packages/types/src/create/createClass.spec.ts @@ -5,7 +5,7 @@ import { TypeDefInfo } from '@polkadot/types-create'; -import { createClass, getTypeClass, TypeRegistry } from '.'; +import { createClass, getTypeClass, TypeRegistry } from './index.js'; describe('createClass', (): void => { const registry = new TypeRegistry(); diff --git a/packages/types/src/create/createClass.ts b/packages/types/src/create/createClass.ts index cd47723a6f..8623ee3217 100644 --- a/packages/types/src/create/createClass.ts +++ b/packages/types/src/create/createClass.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { Codec, CodecClass, Registry } from '@polkadot/types-codec/types'; -import type { DetectCodec } from '../types'; +import type { DetectCodec } from '../types/index.js'; import { createClassUnsafe } from '@polkadot/types-create'; diff --git a/packages/types/src/create/createType.spec.ts b/packages/types/src/create/createType.spec.ts index ee7f5ef070..989cdd8ef4 100644 --- a/packages/types/src/create/createType.spec.ts +++ b/packages/types/src/create/createType.spec.ts @@ -5,7 +5,7 @@ import { CodecSet, Int } from '@polkadot/types-codec'; -import { createClass, TypeRegistry } from '.'; +import { createClass, TypeRegistry } from './index.js'; describe('createType', (): void => { const registry = new TypeRegistry(); diff --git a/packages/types/src/create/createType.ts b/packages/types/src/create/createType.ts index bc5d19858c..f3eb0ea659 100644 --- a/packages/types/src/create/createType.ts +++ b/packages/types/src/create/createType.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { Codec, Registry } from '@polkadot/types-codec/types'; -import type { DetectCodec } from '../types'; +import type { DetectCodec } from '../types/index.js'; import { createTypeUnsafe } from '@polkadot/types-create'; diff --git a/packages/types/src/create/index.ts b/packages/types/src/create/index.ts index 3b837390f5..ce3f39edac 100644 --- a/packages/types/src/create/index.ts +++ b/packages/types/src/create/index.ts @@ -3,7 +3,7 @@ export * from '@polkadot/types-create'; -export * from './createClass'; -export * from './createType'; -export * from './lazy'; -export * from './registry'; +export * from './createClass.js'; +export * from './createType.js'; +export * from './lazy.js'; +export * from './registry.js'; diff --git a/packages/types/src/create/lazy.ts b/packages/types/src/create/lazy.ts index 47b55a2703..e89e021cd9 100644 --- a/packages/types/src/create/lazy.ts +++ b/packages/types/src/create/lazy.ts @@ -1,8 +1,8 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { SiLookupTypeId, SiVariant } from '../interfaces'; -import type { PortableRegistry } from '../metadata'; +import type { SiLookupTypeId, SiVariant } from '../interfaces/index.js'; +import type { PortableRegistry } from '../metadata/index.js'; import { lazyMethod } from '@polkadot/util'; diff --git a/packages/types/src/create/registry.spec.ts b/packages/types/src/create/registry.spec.ts index cd669f1812..79fb72fe63 100644 --- a/packages/types/src/create/registry.spec.ts +++ b/packages/types/src/create/registry.spec.ts @@ -11,7 +11,7 @@ import { DoNotConstruct, Struct, Text, U32 } from '@polkadot/types-codec'; import { isChildClass, u8aToU8a } from '@polkadot/util'; import { keccakAsU8a } from '@polkadot/util-crypto'; -import { TypeRegistry } from '.'; +import { TypeRegistry } from './index.js'; describe('TypeRegistry', (): void => { const registry = new TypeRegistry(); diff --git a/packages/types/src/create/registry.ts b/packages/types/src/create/registry.ts index 9ff617e1c1..4677c8d2f1 100644 --- a/packages/types/src/create/registry.ts +++ b/packages/types/src/create/registry.ts @@ -4,23 +4,23 @@ import type { AnyString, Codec, CodecClass, IU8a, LookupString } from '@polkadot/types-codec/types'; import type { CreateOptions, TypeDef } from '@polkadot/types-create/types'; import type { ExtDef } from '../extrinsic/signedExtensions/types'; -import type { ChainProperties, DispatchErrorModule, DispatchErrorModuleU8, DispatchErrorModuleU8a, EventMetadataLatest, Hash, MetadataLatest, SiField, SiLookupTypeId, SiVariant, WeightV1, WeightV2 } from '../interfaces/types'; -import type { CallFunction, CodecHasher, Definitions, DetectCodec, RegisteredTypes, Registry, RegistryError, RegistryTypes } from '../types'; +import type { ChainProperties, DispatchErrorModule, DispatchErrorModuleU8, DispatchErrorModuleU8a, EventMetadataLatest, Hash, MetadataLatest, SiField, SiLookupTypeId, SiVariant, WeightV1, WeightV2 } from '../interfaces/types.js'; +import type { CallFunction, CodecHasher, Definitions, DetectCodec, RegisteredTypes, Registry, RegistryError, RegistryTypes } from '../types/index.js'; import { DoNotConstruct, Json, Raw } from '@polkadot/types-codec'; import { constructTypeClass, createClassUnsafe, createTypeUnsafe } from '@polkadot/types-create'; import { assertReturn, BN_ZERO, formatBalance, isBn, isFunction, isNumber, isString, isU8a, lazyMethod, logger, objectSpread, stringCamelCase, stringify } from '@polkadot/util'; import { blake2AsU8a } from '@polkadot/util-crypto'; -import { expandExtensionTypes, fallbackExtensions, findUnknownExtensions } from '../extrinsic/signedExtensions'; -import { GenericEventData } from '../generic/Event'; -import * as baseTypes from '../index.types'; -import * as definitions from '../interfaces/definitions'; -import { decorateConstants, filterCallsSome, filterEventsSome } from '../metadata/decorate'; -import { createCallFunction } from '../metadata/decorate/extrinsics'; -import { Metadata } from '../metadata/Metadata'; -import { PortableRegistry } from '../metadata/PortableRegistry'; -import { lazyVariants } from './lazy'; +import { expandExtensionTypes, fallbackExtensions, findUnknownExtensions } from '../extrinsic/signedExtensions/index.js'; +import { GenericEventData } from '../generic/Event.js'; +import * as baseTypes from '../index.types.js'; +import * as definitions from '../interfaces/definitions.js'; +import { createCallFunction } from '../metadata/decorate/extrinsics/index.js'; +import { decorateConstants, filterCallsSome, filterEventsSome } from '../metadata/decorate/index.js'; +import { Metadata } from '../metadata/Metadata.js'; +import { PortableRegistry } from '../metadata/PortableRegistry/index.js'; +import { lazyVariants } from './lazy.js'; const DEFAULT_FIRST_CALL_IDX = new Uint8Array(2); diff --git a/packages/types/src/detectPackage.ts b/packages/types/src/detectPackage.ts index bf893976d7..b0bbd981d6 100644 --- a/packages/types/src/detectPackage.ts +++ b/packages/types/src/detectPackage.ts @@ -5,7 +5,7 @@ import { detectPackage } from '@polkadot/util'; -import others from './detectOther'; -import { packageInfo } from './packageInfo'; +import others from './detectOther.js'; +import { packageInfo } from './packageInfo.js'; detectPackage(packageInfo, null, others); diff --git a/packages/types/src/ethereum/AccountId.spec.ts b/packages/types/src/ethereum/AccountId.spec.ts index afd4b2e098..a1c215a909 100644 --- a/packages/types/src/ethereum/AccountId.spec.ts +++ b/packages/types/src/ethereum/AccountId.spec.ts @@ -7,8 +7,8 @@ import { Raw } from '@polkadot/types-codec'; -import { TypeRegistry } from '../create'; -import { GenericEthereumAccountId as AccountId } from './AccountId'; +import { TypeRegistry } from '../create/index.js'; +import { GenericEthereumAccountId as AccountId } from './AccountId.js'; describe('EthereumAccountId', (): void => { const registry = new TypeRegistry(); diff --git a/packages/types/src/ethereum/LookupSource.spec.ts b/packages/types/src/ethereum/LookupSource.spec.ts index c0036fdac6..d8abb807f0 100644 --- a/packages/types/src/ethereum/LookupSource.spec.ts +++ b/packages/types/src/ethereum/LookupSource.spec.ts @@ -3,9 +3,9 @@ /// -import { TypeRegistry } from '../create'; -import { GenericAccountIndex as AccountIndex } from '../generic'; -import { GenericEthereumAccountId as AccountId, GenericEthereumLookupSource as Address } from '.'; +import { TypeRegistry } from '../create/index.js'; +import { GenericAccountIndex as AccountIndex } from '../generic/index.js'; +import { GenericEthereumAccountId as AccountId, GenericEthereumLookupSource as Address } from './index.js'; describe('EthereumLookupSource', (): void => { const registry = new TypeRegistry(); diff --git a/packages/types/src/ethereum/LookupSource.ts b/packages/types/src/ethereum/LookupSource.ts index af611452f6..af06eca9bf 100644 --- a/packages/types/src/ethereum/LookupSource.ts +++ b/packages/types/src/ethereum/LookupSource.ts @@ -9,8 +9,8 @@ import { AbstractBase } from '@polkadot/types-codec'; import { isBigInt, isBn, isHex, isNumber, isU8a, u8aConcat, u8aToBn, u8aToHex, u8aToU8a } from '@polkadot/util'; import { decodeAddress } from '@polkadot/util-crypto'; -import { GenericAccountIndex } from '../generic/AccountIndex'; -import { GenericEthereumAccountId } from './AccountId'; +import { GenericAccountIndex } from '../generic/AccountIndex.js'; +import { GenericEthereumAccountId } from './AccountId.js'; // eslint-disable-next-line no-use-before-define type AnyAddress = bigint | BN | GenericEthereumLookupSource | GenericEthereumAccountId | GenericAccountIndex | number[] | Uint8Array | number | string; diff --git a/packages/types/src/ethereum/index.ts b/packages/types/src/ethereum/index.ts index 4d9543a22c..8c41bffc3e 100644 --- a/packages/types/src/ethereum/index.ts +++ b/packages/types/src/ethereum/index.ts @@ -1,5 +1,5 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -export { GenericEthereumAccountId } from './AccountId'; -export { GenericEthereumLookupSource } from './LookupSource'; +export { GenericEthereumAccountId } from './AccountId.js'; +export { GenericEthereumLookupSource } from './LookupSource.js'; diff --git a/packages/types/src/extrinsic/Extrinsic.spec.ts b/packages/types/src/extrinsic/Extrinsic.spec.ts index 9cf5702574..87987c4b4e 100644 --- a/packages/types/src/extrinsic/Extrinsic.spec.ts +++ b/packages/types/src/extrinsic/Extrinsic.spec.ts @@ -5,10 +5,10 @@ import rpcMetadata from '@polkadot/types-support/metadata/static-substrate'; -import { TypeRegistry } from '../create'; -import { Metadata } from '../metadata'; -import { fallbackExtensions } from './signedExtensions'; -import { GenericExtrinsic as Extrinsic } from '.'; +import { TypeRegistry } from '../create/index.js'; +import { Metadata } from '../metadata/index.js'; +import { fallbackExtensions } from './signedExtensions/index.js'; +import { GenericExtrinsic as Extrinsic } from './index.js'; const registry = new TypeRegistry(); const metadata = new Metadata(registry, rpcMetadata); diff --git a/packages/types/src/extrinsic/Extrinsic.ts b/packages/types/src/extrinsic/Extrinsic.ts index 173073573c..9792313881 100644 --- a/packages/types/src/extrinsic/Extrinsic.ts +++ b/packages/types/src/extrinsic/Extrinsic.ts @@ -3,18 +3,18 @@ import type { AnyJson, AnyTuple, AnyU8a, ArgsDef, IMethod, Inspect } from '@polkadot/types-codec/types'; import type { HexString } from '@polkadot/util/types'; -import type { EcdsaSignature, Ed25519Signature, ExtrinsicUnknown, ExtrinsicV4, Sr25519Signature } from '../interfaces/extrinsics'; -import type { FunctionMetadataLatest } from '../interfaces/metadata'; -import type { Address, Call, CodecHash } from '../interfaces/runtime'; -import type { CallBase, ExtrinsicPayloadValue, ICompact, IExtrinsic, IKeyringPair, INumber, Registry, SignatureOptions } from '../types'; -import type { GenericExtrinsicEra } from './ExtrinsicEra'; -import type { ExtrinsicValueV4 } from './v4/Extrinsic'; +import type { EcdsaSignature, Ed25519Signature, ExtrinsicUnknown, ExtrinsicV4, Sr25519Signature } from '../interfaces/extrinsics/index.js'; +import type { FunctionMetadataLatest } from '../interfaces/metadata/index.js'; +import type { Address, Call, CodecHash } from '../interfaces/runtime/index.js'; +import type { CallBase, ExtrinsicPayloadValue, ICompact, IExtrinsic, IKeyringPair, INumber, Registry, SignatureOptions } from '../types/index.js'; +import type { GenericExtrinsicEra } from './ExtrinsicEra.js'; +import type { ExtrinsicValueV4 } from './v4/Extrinsic.js'; import { AbstractBase } from '@polkadot/types-codec'; import { compactAddLength, compactFromU8a, compactToU8a, isHex, isU8a, objectProperty, objectSpread, u8aConcat, u8aToHex, u8aToU8a } from '@polkadot/util'; -import { EXTRINSIC_VERSION as LATEST_EXTRINSIC_VERSION } from './v4/Extrinsic'; -import { BIT_SIGNED, BIT_UNSIGNED, DEFAULT_VERSION, UNMASK_VERSION } from './constants'; +import { EXTRINSIC_VERSION as LATEST_EXTRINSIC_VERSION } from './v4/Extrinsic.js'; +import { BIT_SIGNED, BIT_UNSIGNED, DEFAULT_VERSION, UNMASK_VERSION } from './constants.js'; interface CreateOptions { version?: number; diff --git a/packages/types/src/extrinsic/ExtrinsicEra.spec.ts b/packages/types/src/extrinsic/ExtrinsicEra.spec.ts index 4f2d01db38..2e5136ac26 100644 --- a/packages/types/src/extrinsic/ExtrinsicEra.spec.ts +++ b/packages/types/src/extrinsic/ExtrinsicEra.spec.ts @@ -3,8 +3,8 @@ /// -import { TypeRegistry } from '../create'; -import { GenericExtrinsicEra as ExtrinsicEra } from '.'; +import { TypeRegistry } from '../create/index.js'; +import { GenericExtrinsicEra as ExtrinsicEra } from './index.js'; describe('ExtrinsicEra', (): void => { const registry = new TypeRegistry(); diff --git a/packages/types/src/extrinsic/ExtrinsicEra.ts b/packages/types/src/extrinsic/ExtrinsicEra.ts index 3aa3aaba47..31c543ec5f 100644 --- a/packages/types/src/extrinsic/ExtrinsicEra.ts +++ b/packages/types/src/extrinsic/ExtrinsicEra.ts @@ -3,12 +3,12 @@ import type { AnyU8a, Registry } from '@polkadot/types-codec/types'; import type { BN } from '@polkadot/util'; -import type { IExtrinsicEra, INumber } from '../types'; +import type { IExtrinsicEra, INumber } from '../types/index.js'; import { Enum, Raw, Tuple, U64 } from '@polkadot/types-codec'; import { bnToBn, formatNumber, hexToU8a, isHex, isObject, isU8a, u8aToBn, u8aToU8a } from '@polkadot/util'; -import { IMMORTAL_ERA } from './constants'; +import { IMMORTAL_ERA } from './constants.js'; type MortalEraValue = [INumber, INumber]; diff --git a/packages/types/src/extrinsic/ExtrinsicPayload.spec.ts b/packages/types/src/extrinsic/ExtrinsicPayload.spec.ts index 99f8e8743c..a6047e75bc 100644 --- a/packages/types/src/extrinsic/ExtrinsicPayload.spec.ts +++ b/packages/types/src/extrinsic/ExtrinsicPayload.spec.ts @@ -5,8 +5,8 @@ import { u8aToHex } from '@polkadot/util'; -import { TypeRegistry } from '../create'; -import { GenericExtrinsicPayload as ExtrinsicPayload } from '.'; +import { TypeRegistry } from '../create/index.js'; +import { GenericExtrinsicPayload as ExtrinsicPayload } from './index.js'; describe('ExtrinsicPayload', (): void => { const registry = new TypeRegistry(); diff --git a/packages/types/src/extrinsic/ExtrinsicPayload.ts b/packages/types/src/extrinsic/ExtrinsicPayload.ts index 4ed3446fc0..2dac9d9961 100644 --- a/packages/types/src/extrinsic/ExtrinsicPayload.ts +++ b/packages/types/src/extrinsic/ExtrinsicPayload.ts @@ -3,15 +3,15 @@ import type { AnyJson, BareOpts, Registry } from '@polkadot/types-codec/types'; import type { HexString } from '@polkadot/util/types'; -import type { BlockHash } from '../interfaces/chain'; -import type { ExtrinsicPayloadV4 } from '../interfaces/extrinsics'; -import type { ExtrinsicPayloadValue, ICompact, IKeyringPair, INumber } from '../types'; +import type { BlockHash } from '../interfaces/chain/index.js'; +import type { ExtrinsicPayloadV4 } from '../interfaces/extrinsics/index.js'; +import type { ExtrinsicPayloadValue, ICompact, IKeyringPair, INumber } from '../types/index.js'; import { AbstractBase, Bytes } from '@polkadot/types-codec'; import { u8aToHex } from '@polkadot/util'; -import { DEFAULT_VERSION } from './constants'; -import { GenericExtrinsicEra } from './ExtrinsicEra'; +import { DEFAULT_VERSION } from './constants.js'; +import { GenericExtrinsicEra } from './ExtrinsicEra.js'; interface ExtrinsicPayloadOptions { version?: number; diff --git a/packages/types/src/extrinsic/ExtrinsicPayloadUnknown.ts b/packages/types/src/extrinsic/ExtrinsicPayloadUnknown.ts index 329fe8424d..4ed6d68932 100644 --- a/packages/types/src/extrinsic/ExtrinsicPayloadUnknown.ts +++ b/packages/types/src/extrinsic/ExtrinsicPayloadUnknown.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { Registry } from '@polkadot/types-codec/types'; -import type { ExtrinsicPayloadOptions } from './types'; +import type { ExtrinsicPayloadOptions } from './types.js'; import { Struct } from '@polkadot/types-codec'; diff --git a/packages/types/src/extrinsic/ExtrinsicUnknown.ts b/packages/types/src/extrinsic/ExtrinsicUnknown.ts index 1321203b80..54487cb03b 100644 --- a/packages/types/src/extrinsic/ExtrinsicUnknown.ts +++ b/packages/types/src/extrinsic/ExtrinsicUnknown.ts @@ -2,11 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { Registry } from '@polkadot/types-codec/types'; -import type { ExtrinsicOptions } from './types'; +import type { ExtrinsicOptions } from './types.js'; import { Struct } from '@polkadot/types-codec'; -import { UNMASK_VERSION } from './constants'; +import { UNMASK_VERSION } from './constants.js'; /** * @name GenericExtrinsicUnknown diff --git a/packages/types/src/extrinsic/SignerPayload.spec.ts b/packages/types/src/extrinsic/SignerPayload.spec.ts index c21bccf7db..ecce822e46 100644 --- a/packages/types/src/extrinsic/SignerPayload.spec.ts +++ b/packages/types/src/extrinsic/SignerPayload.spec.ts @@ -5,9 +5,9 @@ import rpcMetadata from '@polkadot/types-support/metadata/static-substrate'; -import { TypeRegistry } from '../create'; -import { Metadata } from '../metadata'; -import { GenericSignerPayload as SignerPayload } from '.'; +import { TypeRegistry } from '../create/index.js'; +import { Metadata } from '../metadata/index.js'; +import { GenericSignerPayload as SignerPayload } from './index.js'; const registry = new TypeRegistry(); const metadata = new Metadata(registry, rpcMetadata); diff --git a/packages/types/src/extrinsic/SignerPayload.ts b/packages/types/src/extrinsic/SignerPayload.ts index 6097d5f155..111ca4e7ee 100644 --- a/packages/types/src/extrinsic/SignerPayload.ts +++ b/packages/types/src/extrinsic/SignerPayload.ts @@ -4,7 +4,7 @@ import type { Registry } from '@polkadot/types-codec/types'; import type { HexString } from '@polkadot/util/types'; import type { Address, BlockHash, Call, ExtrinsicEra, Hash } from '../interfaces'; -import type { Codec, ICompact, INumber, IRuntimeVersion, ISignerPayload, SignerPayloadJSON, SignerPayloadRaw } from '../types'; +import type { Codec, ICompact, INumber, IRuntimeVersion, ISignerPayload, SignerPayloadJSON, SignerPayloadRaw } from '../types/index.js'; import { Option, Struct, Text, Vec } from '@polkadot/types-codec'; import { objectProperty, objectSpread, u8aToHex } from '@polkadot/util'; diff --git a/packages/types/src/extrinsic/index.ts b/packages/types/src/extrinsic/index.ts index 728c227d22..5852423fa3 100644 --- a/packages/types/src/extrinsic/index.ts +++ b/packages/types/src/extrinsic/index.ts @@ -1,11 +1,11 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -export { GenericExtrinsic } from './Extrinsic'; -export { GenericExtrinsicEra, MortalEra as GenericMortalEra, ImmortalEra as GenericImmortalEra } from './ExtrinsicEra'; -export { GenericExtrinsicPayload } from './ExtrinsicPayload'; -export { GenericExtrinsicPayloadUnknown } from './ExtrinsicPayloadUnknown'; -export { GenericExtrinsicUnknown } from './ExtrinsicUnknown'; -export { GenericSignerPayload } from './SignerPayload'; +export { GenericExtrinsic } from './Extrinsic.js'; +export { GenericExtrinsicEra, MortalEra as GenericMortalEra, ImmortalEra as GenericImmortalEra } from './ExtrinsicEra.js'; +export { GenericExtrinsicPayload } from './ExtrinsicPayload.js'; +export { GenericExtrinsicPayloadUnknown } from './ExtrinsicPayloadUnknown.js'; +export { GenericExtrinsicUnknown } from './ExtrinsicUnknown.js'; +export { GenericSignerPayload } from './SignerPayload.js'; -export * from './v4'; +export * from './v4/index.js'; diff --git a/packages/types/src/extrinsic/signedExtensions/emptyCheck.ts b/packages/types/src/extrinsic/signedExtensions/emptyCheck.ts index 953f1c85e4..6238780207 100644 --- a/packages/types/src/extrinsic/signedExtensions/emptyCheck.ts +++ b/packages/types/src/extrinsic/signedExtensions/emptyCheck.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ExtInfo } from './types'; +import type { ExtInfo } from './types.js'; export const emptyCheck: ExtInfo = { extrinsic: {}, diff --git a/packages/types/src/extrinsic/signedExtensions/index.ts b/packages/types/src/extrinsic/signedExtensions/index.ts index 8b82c2f97f..67714d1ee0 100644 --- a/packages/types/src/extrinsic/signedExtensions/index.ts +++ b/packages/types/src/extrinsic/signedExtensions/index.ts @@ -1,14 +1,14 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ExtDef, ExtInfo, ExtTypes } from './types'; +import type { ExtDef, ExtInfo, ExtTypes } from './types.js'; import { objectSpread } from '@polkadot/util'; -import { polkadot } from './polkadot'; -import { shell } from './shell'; -import { statemint } from './statemint'; -import { substrate } from './substrate'; +import { polkadot } from './polkadot.js'; +import { shell } from './shell.js'; +import { statemint } from './statemint.js'; +import { substrate } from './substrate.js'; // A mapping of the known signed extensions to the extra fields that they // contain. Unlike in the actual extensions, we define the extra fields not diff --git a/packages/types/src/extrinsic/signedExtensions/polkadot.ts b/packages/types/src/extrinsic/signedExtensions/polkadot.ts index aa891ab19a..c15d0189b9 100644 --- a/packages/types/src/extrinsic/signedExtensions/polkadot.ts +++ b/packages/types/src/extrinsic/signedExtensions/polkadot.ts @@ -1,9 +1,9 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ExtDef } from './types'; +import type { ExtDef } from './types.js'; -import { emptyCheck } from './emptyCheck'; +import { emptyCheck } from './emptyCheck.js'; export const polkadot: ExtDef = { LimitParathreadCommits: emptyCheck, diff --git a/packages/types/src/extrinsic/signedExtensions/shell.ts b/packages/types/src/extrinsic/signedExtensions/shell.ts index 658620b35e..ddabbcb85f 100644 --- a/packages/types/src/extrinsic/signedExtensions/shell.ts +++ b/packages/types/src/extrinsic/signedExtensions/shell.ts @@ -1,9 +1,9 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ExtDef } from './types'; +import type { ExtDef } from './types.js'; -import { emptyCheck } from './emptyCheck'; +import { emptyCheck } from './emptyCheck.js'; export const shell: ExtDef = { DisallowSigned: emptyCheck diff --git a/packages/types/src/extrinsic/signedExtensions/statemint.ts b/packages/types/src/extrinsic/signedExtensions/statemint.ts index e37d8882a1..baad6fea77 100644 --- a/packages/types/src/extrinsic/signedExtensions/statemint.ts +++ b/packages/types/src/extrinsic/signedExtensions/statemint.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ExtDef } from './types'; +import type { ExtDef } from './types.js'; export const statemint: ExtDef = { ChargeAssetTxPayment: { diff --git a/packages/types/src/extrinsic/signedExtensions/substrate.ts b/packages/types/src/extrinsic/signedExtensions/substrate.ts index d7f95b5de8..285608c6ca 100644 --- a/packages/types/src/extrinsic/signedExtensions/substrate.ts +++ b/packages/types/src/extrinsic/signedExtensions/substrate.ts @@ -1,9 +1,9 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ExtDef, ExtInfo } from './types'; +import type { ExtDef, ExtInfo } from './types.js'; -import { emptyCheck } from './emptyCheck'; +import { emptyCheck } from './emptyCheck.js'; const CheckMortality: ExtInfo = { extrinsic: { diff --git a/packages/types/src/extrinsic/util.ts b/packages/types/src/extrinsic/util.ts index 7770653771..69b056a913 100644 --- a/packages/types/src/extrinsic/util.ts +++ b/packages/types/src/extrinsic/util.ts @@ -3,7 +3,7 @@ import type { SignOptions } from '@polkadot/keyring/types'; import type { Registry } from '@polkadot/types-codec/types'; -import type { IKeyringPair } from '../types'; +import type { IKeyringPair } from '../types/index.js'; // a helper function for both types of payloads, Raw and metadata-known export function sign (registry: Registry, signerPair: IKeyringPair, u8a: Uint8Array, options?: SignOptions): Uint8Array { diff --git a/packages/types/src/extrinsic/v4/Extrinsic.spec.ts b/packages/types/src/extrinsic/v4/Extrinsic.spec.ts index fe9b9a913b..25941f69d2 100644 --- a/packages/types/src/extrinsic/v4/Extrinsic.spec.ts +++ b/packages/types/src/extrinsic/v4/Extrinsic.spec.ts @@ -7,9 +7,9 @@ import { createTestPairs } from '@polkadot/keyring/testingPairs'; import rpcMetadata from '@polkadot/types-support/metadata/static-substrate'; import { BN } from '@polkadot/util'; -import { TypeRegistry } from '../../create'; -import { decorateExtrinsics, Metadata } from '../../metadata'; -import { GenericExtrinsicV4 as Extrinsic } from '.'; +import { TypeRegistry } from '../../create/index.js'; +import { decorateExtrinsics, Metadata } from '../../metadata/index.js'; +import { GenericExtrinsicV4 as Extrinsic } from './index.js'; const registry = new TypeRegistry(); const metadata = new Metadata(registry, rpcMetadata); diff --git a/packages/types/src/extrinsic/v4/Extrinsic.ts b/packages/types/src/extrinsic/v4/Extrinsic.ts index 1e9c277e16..067c842dee 100644 --- a/packages/types/src/extrinsic/v4/Extrinsic.ts +++ b/packages/types/src/extrinsic/v4/Extrinsic.ts @@ -4,8 +4,8 @@ import type { HexString } from '@polkadot/util/types'; import type { ExtrinsicSignatureV4 } from '../../interfaces/extrinsics'; import type { Address, Call } from '../../interfaces/runtime'; -import type { ExtrinsicPayloadValue, IExtrinsicImpl, IKeyringPair, Registry, SignatureOptions } from '../../types'; -import type { ExtrinsicOptions } from '../types'; +import type { ExtrinsicPayloadValue, IExtrinsicImpl, IKeyringPair, Registry, SignatureOptions } from '../../types/index.js'; +import type { ExtrinsicOptions } from '../types.js'; import { Struct } from '@polkadot/types-codec'; import { isU8a } from '@polkadot/util'; diff --git a/packages/types/src/extrinsic/v4/ExtrinsicPayload.spec.ts b/packages/types/src/extrinsic/v4/ExtrinsicPayload.spec.ts index dc95220e7a..4faf07ef00 100644 --- a/packages/types/src/extrinsic/v4/ExtrinsicPayload.spec.ts +++ b/packages/types/src/extrinsic/v4/ExtrinsicPayload.spec.ts @@ -5,9 +5,9 @@ import rpcMetadata from '@polkadot/types-support/metadata/static-substrate'; -import { TypeRegistry } from '../../create'; -import { decorateExtrinsics, Metadata } from '../../metadata'; -import { GenericExtrinsicPayloadV4 as ExtrinsicPayload } from '.'; +import { TypeRegistry } from '../../create/index.js'; +import { decorateExtrinsics, Metadata } from '../../metadata/index.js'; +import { GenericExtrinsicPayloadV4 as ExtrinsicPayload } from './index.js'; const registry = new TypeRegistry(); const metadata = new Metadata(registry, rpcMetadata); diff --git a/packages/types/src/extrinsic/v4/ExtrinsicPayload.ts b/packages/types/src/extrinsic/v4/ExtrinsicPayload.ts index 45f42df141..caa938e4d0 100644 --- a/packages/types/src/extrinsic/v4/ExtrinsicPayload.ts +++ b/packages/types/src/extrinsic/v4/ExtrinsicPayload.ts @@ -4,14 +4,14 @@ import type { SignOptions } from '@polkadot/keyring/types'; import type { Inspect, Registry } from '@polkadot/types-codec/types'; import type { HexString } from '@polkadot/util/types'; -import type { BlockHash } from '../../interfaces/chain'; -import type { ExtrinsicEra } from '../../interfaces/extrinsics'; -import type { ExtrinsicPayloadValue, ICompact, IKeyringPair, INumber, IOption } from '../../types'; +import type { BlockHash } from '../../interfaces/chain/index.js'; +import type { ExtrinsicEra } from '../../interfaces/extrinsics/index.js'; +import type { ExtrinsicPayloadValue, ICompact, IKeyringPair, INumber, IOption } from '../../types/index.js'; import { Bytes, Enum, Struct } from '@polkadot/types-codec'; import { objectSpread } from '@polkadot/util'; -import { sign } from '../util'; +import { sign } from '../util.js'; /** * @name GenericExtrinsicPayloadV4 diff --git a/packages/types/src/extrinsic/v4/ExtrinsicSignature.spec.ts b/packages/types/src/extrinsic/v4/ExtrinsicSignature.spec.ts index ebad71ae63..09d32d275a 100644 --- a/packages/types/src/extrinsic/v4/ExtrinsicSignature.spec.ts +++ b/packages/types/src/extrinsic/v4/ExtrinsicSignature.spec.ts @@ -7,9 +7,9 @@ import { createTestPairs } from '@polkadot/keyring/testingPairs'; import metadataStatic from '@polkadot/types-support/metadata/static-substrate'; import { BN_ZERO } from '@polkadot/util'; -import { TypeRegistry } from '../../create'; -import { Metadata } from '../../metadata'; -import { GenericExtrinsicSignatureV4 as ExtrinsicSignature } from '.'; +import { TypeRegistry } from '../../create/index.js'; +import { Metadata } from '../../metadata/index.js'; +import { GenericExtrinsicSignatureV4 as ExtrinsicSignature } from './index.js'; const signOptions = { blockHash: '0x1234567890123456789012345678901234567890123456789012345678901234', diff --git a/packages/types/src/extrinsic/v4/ExtrinsicSignature.ts b/packages/types/src/extrinsic/v4/ExtrinsicSignature.ts index 75173e97e5..596d13f4c8 100644 --- a/packages/types/src/extrinsic/v4/ExtrinsicSignature.ts +++ b/packages/types/src/extrinsic/v4/ExtrinsicSignature.ts @@ -4,14 +4,14 @@ import type { HexString } from '@polkadot/util/types'; import type { EcdsaSignature, Ed25519Signature, ExtrinsicEra, ExtrinsicSignature, Sr25519Signature } from '../../interfaces/extrinsics'; import type { Address, Call } from '../../interfaces/runtime'; -import type { ExtrinsicPayloadValue, ICompact, IExtrinsicSignature, IKeyringPair, INumber, Registry, SignatureOptions } from '../../types'; -import type { ExtrinsicSignatureOptions } from '../types'; +import type { ExtrinsicPayloadValue, ICompact, IExtrinsicSignature, IKeyringPair, INumber, Registry, SignatureOptions } from '../../types/index.js'; +import type { ExtrinsicSignatureOptions } from '../types.js'; import { Struct } from '@polkadot/types-codec'; import { isU8a, isUndefined, objectProperties, objectSpread, stringify, u8aToHex } from '@polkadot/util'; -import { EMPTY_U8A, IMMORTAL_ERA } from '../constants'; -import { GenericExtrinsicPayloadV4 } from './ExtrinsicPayload'; +import { EMPTY_U8A, IMMORTAL_ERA } from '../constants.js'; +import { GenericExtrinsicPayloadV4 } from './ExtrinsicPayload.js'; // Ensure we have enough data for all types of signatures const FAKE_SIGNATURE = new Uint8Array(256).fill(1); diff --git a/packages/types/src/extrinsic/v4/index.ts b/packages/types/src/extrinsic/v4/index.ts index eb3ba65c9b..785109259e 100644 --- a/packages/types/src/extrinsic/v4/index.ts +++ b/packages/types/src/extrinsic/v4/index.ts @@ -1,6 +1,6 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -export { GenericExtrinsicV4 } from './Extrinsic'; -export { GenericExtrinsicPayloadV4 } from './ExtrinsicPayload'; -export { GenericExtrinsicSignatureV4 } from './ExtrinsicSignature'; +export { GenericExtrinsicV4 } from './Extrinsic.js'; +export { GenericExtrinsicPayloadV4 } from './ExtrinsicPayload.js'; +export { GenericExtrinsicSignatureV4 } from './ExtrinsicSignature.js'; diff --git a/packages/types/src/generic/AccountId.spec.ts b/packages/types/src/generic/AccountId.spec.ts index 5c10edd1dd..76236e5111 100644 --- a/packages/types/src/generic/AccountId.spec.ts +++ b/packages/types/src/generic/AccountId.spec.ts @@ -8,7 +8,7 @@ import { Raw } from '@polkadot/types-codec'; import jsonVec from '@polkadot/types-support/json/AccountIdVec.001.json' assert { type: 'json' }; -import { TypeRegistry } from '../create'; +import { TypeRegistry } from '../create/index.js'; describe('AccountId', (): void => { const registry = new TypeRegistry(); diff --git a/packages/types/src/generic/AccountIndex.spec.ts b/packages/types/src/generic/AccountIndex.spec.ts index b6a033313e..63672af348 100644 --- a/packages/types/src/generic/AccountIndex.spec.ts +++ b/packages/types/src/generic/AccountIndex.spec.ts @@ -5,8 +5,8 @@ import { BN } from '@polkadot/util'; -import { TypeRegistry } from '../create'; -import { GenericAccountIndex as AccountIndex } from '.'; +import { TypeRegistry } from '../create/index.js'; +import { GenericAccountIndex as AccountIndex } from './index.js'; describe('AccountIndex', (): void => { const registry = new TypeRegistry(); diff --git a/packages/types/src/generic/Block.spec.ts b/packages/types/src/generic/Block.spec.ts index a36e8c6335..04649ed3b5 100644 --- a/packages/types/src/generic/Block.spec.ts +++ b/packages/types/src/generic/Block.spec.ts @@ -6,14 +6,14 @@ /* eslint-disable sort-keys */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ -import type { BlockValue } from './Block'; +import type { BlockValue } from './Block.js'; import block00300 from '@polkadot/types-support/json/SignedBlock.003.00.json' assert { type: 'json' }; import metadataStatic from '@polkadot/types-support/metadata/static-substrate'; -import { TypeRegistry } from '../create'; -import { Metadata } from '../metadata'; -import { GenericBlock as Block } from './Block'; +import { TypeRegistry } from '../create/index.js'; +import { Metadata } from '../metadata/index.js'; +import { GenericBlock as Block } from './Block.js'; interface BlockJson { result: { diff --git a/packages/types/src/generic/Block.ts b/packages/types/src/generic/Block.ts index aaf4dda287..2ac2ef0457 100644 --- a/packages/types/src/generic/Block.ts +++ b/packages/types/src/generic/Block.ts @@ -3,8 +3,8 @@ import type { Vec } from '@polkadot/types-codec'; import type { AnyNumber, AnyU8a, IU8a, Registry } from '@polkadot/types-codec/types'; -import type { GenericExtrinsic } from '../extrinsic/Extrinsic'; -import type { Digest, DigestItem, Header } from '../interfaces/runtime'; +import type { GenericExtrinsic } from '../extrinsic/Extrinsic.js'; +import type { Digest, DigestItem, Header } from '../interfaces/runtime/index.js'; import { Struct } from '@polkadot/types-codec'; diff --git a/packages/types/src/generic/Call.spec.ts b/packages/types/src/generic/Call.spec.ts index 233490bb28..052a5de0de 100644 --- a/packages/types/src/generic/Call.spec.ts +++ b/packages/types/src/generic/Call.spec.ts @@ -5,9 +5,9 @@ import metadataStatic from '@polkadot/types-support/metadata/static-substrate'; -import { TypeRegistry } from '../create'; -import { Metadata } from '../metadata'; -import { GenericCall as Call } from '.'; +import { TypeRegistry } from '../create/index.js'; +import { Metadata } from '../metadata/index.js'; +import { GenericCall as Call } from './index.js'; const registry = new TypeRegistry(); const metadata = new Metadata(registry, metadataStatic); diff --git a/packages/types/src/generic/Call.ts b/packages/types/src/generic/Call.ts index ef13bafb48..89ac66dab3 100644 --- a/packages/types/src/generic/Call.ts +++ b/packages/types/src/generic/Call.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 import type { AnyJson, AnyTuple, AnyU8a, ArgsDef, Codec, IMethod, Registry } from '@polkadot/types-codec/types'; -import type { FunctionMetadataLatest } from '../interfaces/metadata'; -import type { CallBase, CallFunction, InterfaceTypes } from '../types'; +import type { FunctionMetadataLatest } from '../interfaces/metadata/index.js'; +import type { CallBase, CallFunction, InterfaceTypes } from '../types/index.js'; import { Struct, U8aFixed } from '@polkadot/types-codec'; import { isHex, isObject, isU8a, objectSpread, u8aToU8a } from '@polkadot/util'; diff --git a/packages/types/src/generic/ChainProperties.spec.ts b/packages/types/src/generic/ChainProperties.spec.ts index b419f75902..2ab9450765 100644 --- a/packages/types/src/generic/ChainProperties.spec.ts +++ b/packages/types/src/generic/ChainProperties.spec.ts @@ -3,7 +3,7 @@ /// -import { TypeRegistry } from '../create'; +import { TypeRegistry } from '../create/index.js'; describe('ChainProperties', (): void => { const registry = new TypeRegistry(); diff --git a/packages/types/src/generic/ChainProperties.ts b/packages/types/src/generic/ChainProperties.ts index bc41770bc2..978c22536e 100644 --- a/packages/types/src/generic/ChainProperties.ts +++ b/packages/types/src/generic/ChainProperties.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { Registry } from '@polkadot/types-codec/types'; -import type { Codec } from '../types'; +import type { Codec } from '../types/index.js'; import { Json, Option, Text, u32, Vec } from '@polkadot/types-codec'; import { isFunction, isNull, isUndefined } from '@polkadot/util'; diff --git a/packages/types/src/generic/ConsensusEngineId.spec.ts b/packages/types/src/generic/ConsensusEngineId.spec.ts index d2ab23bcf9..29c0d0040f 100644 --- a/packages/types/src/generic/ConsensusEngineId.spec.ts +++ b/packages/types/src/generic/ConsensusEngineId.spec.ts @@ -3,8 +3,8 @@ /// -import { TypeRegistry } from '../create'; -import { CID_AURA, GenericConsensusEngineId as ConsensusEngineId } from './ConsensusEngineId'; +import { TypeRegistry } from '../create/index.js'; +import { CID_AURA, GenericConsensusEngineId as ConsensusEngineId } from './ConsensusEngineId.js'; describe('ConsensusEngineId', (): void => { const registry = new TypeRegistry(); diff --git a/packages/types/src/generic/Event.ts b/packages/types/src/generic/Event.ts index 2282150ef2..71fcb1448d 100644 --- a/packages/types/src/generic/Event.ts +++ b/packages/types/src/generic/Event.ts @@ -3,9 +3,9 @@ import type { AnyJson, Codec, CodecClass } from '@polkadot/types-codec/types'; import type { TypeDef } from '@polkadot/types-create/types'; -import type { EventMetadataLatest } from '../interfaces/metadata'; -import type { EventId } from '../interfaces/system'; -import type { IEvent, IEventData, InterfaceTypes, Registry } from '../types'; +import type { EventMetadataLatest } from '../interfaces/metadata/index.js'; +import type { EventId } from '../interfaces/system/index.js'; +import type { IEvent, IEventData, InterfaceTypes, Registry } from '../types/index.js'; import { Null, Struct, Tuple } from '@polkadot/types-codec'; import { objectProperties, objectSpread } from '@polkadot/util'; diff --git a/packages/types/src/generic/LookupSource.spec.ts b/packages/types/src/generic/LookupSource.spec.ts index 4b8f306e66..8aaca884df 100644 --- a/packages/types/src/generic/LookupSource.spec.ts +++ b/packages/types/src/generic/LookupSource.spec.ts @@ -3,8 +3,8 @@ /// -import { TypeRegistry } from '../create'; -import { GenericAccountId as AccountId, GenericAccountIndex as AccountIndex, GenericLookupSource as LookupSource } from '.'; +import { TypeRegistry } from '../create/index.js'; +import { GenericAccountId as AccountId, GenericAccountIndex as AccountIndex, GenericLookupSource as LookupSource } from './index.js'; describe('LookupSource', (): void => { const registry = new TypeRegistry(); diff --git a/packages/types/src/generic/LookupSource.ts b/packages/types/src/generic/LookupSource.ts index df414027e4..1530a40cc7 100644 --- a/packages/types/src/generic/LookupSource.ts +++ b/packages/types/src/generic/LookupSource.ts @@ -9,8 +9,8 @@ import { AbstractBase } from '@polkadot/types-codec'; import { isBigInt, isBn, isHex, isNumber, isU8a, u8aConcat, u8aToBn, u8aToHex, u8aToU8a } from '@polkadot/util'; import { decodeAddress } from '@polkadot/util-crypto'; -import { GenericAccountId } from './AccountId'; -import { GenericAccountIndex } from './AccountIndex'; +import { GenericAccountId } from './AccountId.js'; +import { GenericAccountIndex } from './AccountIndex.js'; // eslint-disable-next-line no-use-before-define type AnyAddress = bigint | BN | GenericLookupSource | GenericAccountId | GenericAccountIndex | number[] | Uint8Array | number | string; diff --git a/packages/types/src/generic/MultiAddress.spec.ts b/packages/types/src/generic/MultiAddress.spec.ts index f7a305c7f7..b638d07fb8 100644 --- a/packages/types/src/generic/MultiAddress.spec.ts +++ b/packages/types/src/generic/MultiAddress.spec.ts @@ -3,7 +3,7 @@ /// -import { TypeRegistry } from '../create'; +import { TypeRegistry } from '../create/index.js'; describe('MultiAddress', (): void => { const registry = new TypeRegistry(); diff --git a/packages/types/src/generic/MultiAddress.ts b/packages/types/src/generic/MultiAddress.ts index e203916fbf..3f4080dc46 100644 --- a/packages/types/src/generic/MultiAddress.ts +++ b/packages/types/src/generic/MultiAddress.ts @@ -7,8 +7,8 @@ import { Enum } from '@polkadot/types-codec'; import { isBn, isNumber, isString, isU8a } from '@polkadot/util'; import { decodeAddress } from '@polkadot/util-crypto'; -import { GenericAccountId } from './AccountId'; -import { GenericAccountIndex } from './AccountIndex'; +import { GenericAccountId } from './AccountId.js'; +import { GenericAccountIndex } from './AccountIndex.js'; function decodeU8a (registry: Registry, u8a: Uint8Array): unknown { if ([0, 32].includes(u8a.length)) { diff --git a/packages/types/src/generic/Vote.spec.ts b/packages/types/src/generic/Vote.spec.ts index e832f1b9f1..328496109d 100644 --- a/packages/types/src/generic/Vote.spec.ts +++ b/packages/types/src/generic/Vote.spec.ts @@ -3,8 +3,8 @@ /// -import { TypeRegistry } from '../create'; -import { GenericVote } from '.'; +import { TypeRegistry } from '../create/index.js'; +import { GenericVote } from './index.js'; describe('GenericVote', (): void => { const registry = new TypeRegistry(); diff --git a/packages/types/src/generic/Vote.ts b/packages/types/src/generic/Vote.ts index 21a8abf984..f058aff545 100644 --- a/packages/types/src/generic/Vote.ts +++ b/packages/types/src/generic/Vote.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 import type { AnyJson, Registry } from '@polkadot/types-codec/types'; -import type { Conviction } from '../interfaces/democracy'; -import type { AllConvictions } from '../interfaces/democracy/definitions'; -import type { ArrayElementType } from '../types'; +import type { AllConvictions } from '../interfaces/democracy/definitions.js'; +import type { Conviction } from '../interfaces/democracy/index.js'; +import type { ArrayElementType } from '../types/index.js'; import { Bool, U8aFixed } from '@polkadot/types-codec'; import { isBoolean, isNumber, isU8a, isUndefined } from '@polkadot/util'; diff --git a/packages/types/src/generic/index.ts b/packages/types/src/generic/index.ts index 56d4b77fe1..28ab7f9e00 100644 --- a/packages/types/src/generic/index.ts +++ b/packages/types/src/generic/index.ts @@ -1,15 +1,15 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -export * from '../ethereum'; +export * from '../ethereum/index.js'; -export { GenericAccountId, GenericAccountId as GenericAccountId32, GenericAccountId33 } from './AccountId'; -export { GenericAccountIndex } from './AccountIndex'; -export { GenericBlock } from './Block'; -export { GenericCall } from './Call'; -export { GenericChainProperties } from './ChainProperties'; -export { GenericConsensusEngineId } from './ConsensusEngineId'; -export { GenericEvent, GenericEventData } from './Event'; -export { GenericLookupSource } from './LookupSource'; -export { GenericMultiAddress, GenericMultiAddress as GenericAddress } from './MultiAddress'; -export { GenericVote } from './Vote'; +export { GenericAccountId, GenericAccountId as GenericAccountId32, GenericAccountId33 } from './AccountId.js'; +export { GenericAccountIndex } from './AccountIndex.js'; +export { GenericBlock } from './Block.js'; +export { GenericCall } from './Call.js'; +export { GenericChainProperties } from './ChainProperties.js'; +export { GenericConsensusEngineId } from './ConsensusEngineId.js'; +export { GenericEvent, GenericEventData } from './Event.js'; +export { GenericLookupSource } from './LookupSource.js'; +export { GenericMultiAddress, GenericMultiAddress as GenericAddress } from './MultiAddress.js'; +export { GenericVote } from './Vote.js'; diff --git a/packages/types/src/index.spec.ts b/packages/types/src/index.spec.ts index 8f4d64599d..69e8609ede 100644 --- a/packages/types/src/index.spec.ts +++ b/packages/types/src/index.spec.ts @@ -1,14 +1,14 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Codec } from './types'; +import type { Codec } from './types/index.js'; import metadataStatic from '@polkadot/types-support/metadata/static-substrate'; -import * as definitions from './interfaces/definitions'; -import { TypeRegistry } from './create'; -import * as exported from './index.types'; -import { Metadata } from './metadata'; +import { TypeRegistry } from './create/index.js'; +import * as definitions from './interfaces/definitions.js'; +import { Metadata } from './metadata/index.js'; +import * as exported from './index.types.js'; // NOTE This is not a shortcut to implementing types incorrectly. This is here // specifically for the types that _should_ throw in the constrtuctor, i.e diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index bbc23b96eb..893cb58230 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -1,6 +1,6 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import './detectPackage'; +import './detectPackage.js'; -export * from './bundle'; +export * from './bundle.js'; diff --git a/packages/types/src/index.types.ts b/packages/types/src/index.types.ts index 023f6982f0..2dbe3c9f20 100644 --- a/packages/types/src/index.types.ts +++ b/packages/types/src/index.types.ts @@ -1,6 +1,6 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -export * from './extrinsic'; -export * from './generic'; -export * from './primitive'; +export * from './extrinsic/index.js'; +export * from './generic/index.js'; +export * from './primitive/index.js'; diff --git a/packages/types/src/interfaces/alias.spec.ts b/packages/types/src/interfaces/alias.spec.ts index 9a323661f0..48d99dc28a 100644 --- a/packages/types/src/interfaces/alias.spec.ts +++ b/packages/types/src/interfaces/alias.spec.ts @@ -3,8 +3,8 @@ /// -import { TypeRegistry } from '../create/registry'; -import { getAliasTypes } from './alias'; +import { TypeRegistry } from '../create/registry.js'; +import { getAliasTypes } from './alias.js'; const registry = new TypeRegistry(); diff --git a/packages/types/src/interfaces/alias.ts b/packages/types/src/interfaces/alias.ts index 13352cc6d2..ddb3f1cd58 100644 --- a/packages/types/src/interfaces/alias.ts +++ b/packages/types/src/interfaces/alias.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types-known authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { OverrideModuleType, Registry } from '../types'; +import type { OverrideModuleType, Registry } from '../types/index.js'; import { objectSpread } from '@polkadot/util'; diff --git a/packages/types/src/interfaces/assets/definitions.ts b/packages/types/src/interfaces/assets/definitions.ts index e6bacf8296..281488d344 100644 --- a/packages/types/src/interfaces/assets/definitions.ts +++ b/packages/types/src/interfaces/assets/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/assets/index.ts b/packages/types/src/interfaces/assets/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/assets/index.ts +++ b/packages/types/src/interfaces/assets/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/attestations/definitions.ts b/packages/types/src/interfaces/attestations/definitions.ts index c3b43151c9..d6cbbd64c8 100644 --- a/packages/types/src/interfaces/attestations/definitions.ts +++ b/packages/types/src/interfaces/attestations/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/attestations/index.ts b/packages/types/src/interfaces/attestations/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/attestations/index.ts +++ b/packages/types/src/interfaces/attestations/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/aura/definitions.ts b/packages/types/src/interfaces/aura/definitions.ts index f328317936..931fbf4112 100644 --- a/packages/types/src/interfaces/aura/definitions.ts +++ b/packages/types/src/interfaces/aura/definitions.ts @@ -4,9 +4,9 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; -import { runtime } from './runtime'; +import { runtime } from './runtime.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/aura/index.ts b/packages/types/src/interfaces/aura/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/aura/index.ts +++ b/packages/types/src/interfaces/aura/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/aura/runtime.ts b/packages/types/src/interfaces/aura/runtime.ts index 9837a2f9e7..858eb12ab5 100644 --- a/packages/types/src/interfaces/aura/runtime.ts +++ b/packages/types/src/interfaces/aura/runtime.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsCall } from '../../types'; +import type { DefinitionsCall } from '../../types/index.js'; export const runtime: DefinitionsCall = { AuraApi: [ diff --git a/packages/types/src/interfaces/author/ExtrinsicStatus.spec.ts b/packages/types/src/interfaces/author/ExtrinsicStatus.spec.ts index 7fca9f6486..dd03e23361 100644 --- a/packages/types/src/interfaces/author/ExtrinsicStatus.spec.ts +++ b/packages/types/src/interfaces/author/ExtrinsicStatus.spec.ts @@ -5,11 +5,11 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ -import type { ExtrinsicStatus } from './types'; +import type { ExtrinsicStatus } from './types.js'; import rpc from '@polkadot/types-support/json/ExtrinsicStatus.001.json' assert { type: 'json' }; -import { TypeRegistry } from '../../create'; +import { TypeRegistry } from '../../create/index.js'; describe('ExtrinsicStatus', (): void => { const registry = new TypeRegistry(); diff --git a/packages/types/src/interfaces/author/definitions.ts b/packages/types/src/interfaces/author/definitions.ts index d4846f9616..4e4652db2b 100644 --- a/packages/types/src/interfaces/author/definitions.ts +++ b/packages/types/src/interfaces/author/definitions.ts @@ -4,9 +4,9 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; -import { rpc } from './rpc'; +import { rpc } from './rpc.js'; export default { rpc, diff --git a/packages/types/src/interfaces/author/index.ts b/packages/types/src/interfaces/author/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/author/index.ts +++ b/packages/types/src/interfaces/author/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/author/rpc.ts b/packages/types/src/interfaces/author/rpc.ts index 46701788c2..2bbf6fc093 100644 --- a/packages/types/src/interfaces/author/rpc.ts +++ b/packages/types/src/interfaces/author/rpc.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsRpc } from '../../types'; +import type { DefinitionsRpc } from '../../types/index.js'; export const rpc: DefinitionsRpc = { hasKey: { diff --git a/packages/types/src/interfaces/authorship/definitions.ts b/packages/types/src/interfaces/authorship/definitions.ts index ffc0926ba6..2e8553f615 100644 --- a/packages/types/src/interfaces/authorship/definitions.ts +++ b/packages/types/src/interfaces/authorship/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/authorship/index.ts b/packages/types/src/interfaces/authorship/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/authorship/index.ts +++ b/packages/types/src/interfaces/authorship/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/babe/definitions.ts b/packages/types/src/interfaces/babe/definitions.ts index ce6f65862b..08d349e978 100644 --- a/packages/types/src/interfaces/babe/definitions.ts +++ b/packages/types/src/interfaces/babe/definitions.ts @@ -4,10 +4,10 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; -import { rpc } from './rpc'; -import { runtime } from './runtime'; +import { rpc } from './rpc.js'; +import { runtime } from './runtime.js'; export default { rpc, diff --git a/packages/types/src/interfaces/babe/index.ts b/packages/types/src/interfaces/babe/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/babe/index.ts +++ b/packages/types/src/interfaces/babe/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/babe/rpc.ts b/packages/types/src/interfaces/babe/rpc.ts index f4171aee92..57bf009481 100644 --- a/packages/types/src/interfaces/babe/rpc.ts +++ b/packages/types/src/interfaces/babe/rpc.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsRpc } from '../../types'; +import type { DefinitionsRpc } from '../../types/index.js'; export const rpc: DefinitionsRpc = { epochAuthorship: { diff --git a/packages/types/src/interfaces/babe/runtime.ts b/packages/types/src/interfaces/babe/runtime.ts index 4bfd606a7a..79990a357b 100644 --- a/packages/types/src/interfaces/babe/runtime.ts +++ b/packages/types/src/interfaces/babe/runtime.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionCall, DefinitionsCall } from '../../types'; +import type { DefinitionCall, DefinitionsCall } from '../../types/index.js'; import { objectSpread } from '@polkadot/util'; diff --git a/packages/types/src/interfaces/balances/definitions.ts b/packages/types/src/interfaces/balances/definitions.ts index 17a938cf04..53ce58a76a 100644 --- a/packages/types/src/interfaces/balances/definitions.ts +++ b/packages/types/src/interfaces/balances/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/balances/index.ts b/packages/types/src/interfaces/balances/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/balances/index.ts +++ b/packages/types/src/interfaces/balances/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/beefy/definitions.ts b/packages/types/src/interfaces/beefy/definitions.ts index 47ddbc51a0..f8cf922383 100644 --- a/packages/types/src/interfaces/beefy/definitions.ts +++ b/packages/types/src/interfaces/beefy/definitions.ts @@ -4,10 +4,10 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; -import { rpc } from './rpc'; -import { runtime } from './runtime'; +import { rpc } from './rpc.js'; +import { runtime } from './runtime.js'; export default { rpc, diff --git a/packages/types/src/interfaces/beefy/index.ts b/packages/types/src/interfaces/beefy/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/beefy/index.ts +++ b/packages/types/src/interfaces/beefy/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/beefy/rpc.ts b/packages/types/src/interfaces/beefy/rpc.ts index 9b9bf8aa50..a599ece0d5 100644 --- a/packages/types/src/interfaces/beefy/rpc.ts +++ b/packages/types/src/interfaces/beefy/rpc.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsRpc } from '../../types'; +import type { DefinitionsRpc } from '../../types/index.js'; export const rpc: DefinitionsRpc = { getFinalizedHead: { diff --git a/packages/types/src/interfaces/beefy/runtime.ts b/packages/types/src/interfaces/beefy/runtime.ts index 8bd27c6fe2..b73520b9b2 100644 --- a/packages/types/src/interfaces/beefy/runtime.ts +++ b/packages/types/src/interfaces/beefy/runtime.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsCall } from '../../types'; +import type { DefinitionsCall } from '../../types/index.js'; export const runtime: DefinitionsCall = { BeefyApi: [ diff --git a/packages/types/src/interfaces/benchmark/definitions.ts b/packages/types/src/interfaces/benchmark/definitions.ts index 0dec445e4d..dac773213e 100644 --- a/packages/types/src/interfaces/benchmark/definitions.ts +++ b/packages/types/src/interfaces/benchmark/definitions.ts @@ -4,9 +4,9 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; -import { runtime } from './runtime'; +import { runtime } from './runtime.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/benchmark/index.ts b/packages/types/src/interfaces/benchmark/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/benchmark/index.ts +++ b/packages/types/src/interfaces/benchmark/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/benchmark/runtime.ts b/packages/types/src/interfaces/benchmark/runtime.ts index f0c86941f2..c4c311a01a 100644 --- a/packages/types/src/interfaces/benchmark/runtime.ts +++ b/packages/types/src/interfaces/benchmark/runtime.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsCall } from '../../types'; +import type { DefinitionsCall } from '../../types/index.js'; export const runtime: DefinitionsCall = { Benchmark: [ diff --git a/packages/types/src/interfaces/blockbuilder/definitions.ts b/packages/types/src/interfaces/blockbuilder/definitions.ts index ac1a27f09e..8b666e284f 100644 --- a/packages/types/src/interfaces/blockbuilder/definitions.ts +++ b/packages/types/src/interfaces/blockbuilder/definitions.ts @@ -4,9 +4,9 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; -import { runtime } from './runtime'; +import { runtime } from './runtime.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/blockbuilder/index.ts b/packages/types/src/interfaces/blockbuilder/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/blockbuilder/index.ts +++ b/packages/types/src/interfaces/blockbuilder/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/blockbuilder/runtime.ts b/packages/types/src/interfaces/blockbuilder/runtime.ts index ef5a4f966b..9fb33a52b4 100644 --- a/packages/types/src/interfaces/blockbuilder/runtime.ts +++ b/packages/types/src/interfaces/blockbuilder/runtime.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsCall, DefinitionsCallEntry } from '../../types'; +import type { DefinitionsCall, DefinitionsCallEntry } from '../../types/index.js'; import { objectSpread } from '@polkadot/util'; diff --git a/packages/types/src/interfaces/bridges/definitions.ts b/packages/types/src/interfaces/bridges/definitions.ts index a06e93d880..d01db9d499 100644 --- a/packages/types/src/interfaces/bridges/definitions.ts +++ b/packages/types/src/interfaces/bridges/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/bridges/index.ts b/packages/types/src/interfaces/bridges/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/bridges/index.ts +++ b/packages/types/src/interfaces/bridges/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/chain/definitions.ts b/packages/types/src/interfaces/chain/definitions.ts index e823f27075..8aca3590bc 100644 --- a/packages/types/src/interfaces/chain/definitions.ts +++ b/packages/types/src/interfaces/chain/definitions.ts @@ -4,9 +4,9 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; -import { rpc } from './rpc'; +import { rpc } from './rpc.js'; export default { rpc, diff --git a/packages/types/src/interfaces/chain/index.ts b/packages/types/src/interfaces/chain/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/chain/index.ts +++ b/packages/types/src/interfaces/chain/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/chain/rpc.ts b/packages/types/src/interfaces/chain/rpc.ts index d5de9bfb13..26bb6e5dc8 100644 --- a/packages/types/src/interfaces/chain/rpc.ts +++ b/packages/types/src/interfaces/chain/rpc.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsRpc } from '../../types'; +import type { DefinitionsRpc } from '../../types/index.js'; export const rpc: DefinitionsRpc = { getBlock: { diff --git a/packages/types/src/interfaces/childstate/definitions.ts b/packages/types/src/interfaces/childstate/definitions.ts index a6fcd2eaca..b4fdc577dd 100644 --- a/packages/types/src/interfaces/childstate/definitions.ts +++ b/packages/types/src/interfaces/childstate/definitions.ts @@ -4,9 +4,9 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; -import { rpc } from './rpc'; +import { rpc } from './rpc.js'; export default { rpc, diff --git a/packages/types/src/interfaces/childstate/index.ts b/packages/types/src/interfaces/childstate/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/childstate/index.ts +++ b/packages/types/src/interfaces/childstate/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/childstate/rpc.ts b/packages/types/src/interfaces/childstate/rpc.ts index 13b552e436..4701ec75c9 100644 --- a/packages/types/src/interfaces/childstate/rpc.ts +++ b/packages/types/src/interfaces/childstate/rpc.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsRpc } from '../../types'; +import type { DefinitionsRpc } from '../../types/index.js'; export const rpc: DefinitionsRpc = { getKeys: { diff --git a/packages/types/src/interfaces/claims/definitions.ts b/packages/types/src/interfaces/claims/definitions.ts index 2b3d798c8a..68c63636ac 100644 --- a/packages/types/src/interfaces/claims/definitions.ts +++ b/packages/types/src/interfaces/claims/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/claims/index.ts b/packages/types/src/interfaces/claims/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/claims/index.ts +++ b/packages/types/src/interfaces/claims/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/collective/definitions.ts b/packages/types/src/interfaces/collective/definitions.ts index e74b191724..cb177bd655 100644 --- a/packages/types/src/interfaces/collective/definitions.ts +++ b/packages/types/src/interfaces/collective/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/collective/index.ts b/packages/types/src/interfaces/collective/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/collective/index.ts +++ b/packages/types/src/interfaces/collective/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/consensus/definitions.ts b/packages/types/src/interfaces/consensus/definitions.ts index 3c49a43b36..8b35979a24 100644 --- a/packages/types/src/interfaces/consensus/definitions.ts +++ b/packages/types/src/interfaces/consensus/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/consensus/index.ts b/packages/types/src/interfaces/consensus/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/consensus/index.ts +++ b/packages/types/src/interfaces/consensus/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/contracts/definitions.ts b/packages/types/src/interfaces/contracts/definitions.ts index 192f41abfa..8c6be9bd8a 100644 --- a/packages/types/src/interfaces/contracts/definitions.ts +++ b/packages/types/src/interfaces/contracts/definitions.ts @@ -4,10 +4,10 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; -import { rpc } from './rpc'; -import { runtime } from './runtime'; +import { rpc } from './rpc.js'; +import { runtime } from './runtime.js'; export default { rpc, diff --git a/packages/types/src/interfaces/contracts/index.ts b/packages/types/src/interfaces/contracts/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/contracts/index.ts +++ b/packages/types/src/interfaces/contracts/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/contracts/rpc.ts b/packages/types/src/interfaces/contracts/rpc.ts index fc7446d670..01eb7d2b65 100644 --- a/packages/types/src/interfaces/contracts/rpc.ts +++ b/packages/types/src/interfaces/contracts/rpc.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsRpc } from '../../types'; +import type { DefinitionsRpc } from '../../types/index.js'; export const rpc: DefinitionsRpc = { call: { diff --git a/packages/types/src/interfaces/contracts/runtime.ts b/packages/types/src/interfaces/contracts/runtime.ts index 97f717e55e..e99cee7663 100644 --- a/packages/types/src/interfaces/contracts/runtime.ts +++ b/packages/types/src/interfaces/contracts/runtime.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionCall, DefinitionsCall } from '../../types'; +import type { DefinitionCall, DefinitionsCall } from '../../types/index.js'; import { objectSpread } from '@polkadot/util'; diff --git a/packages/types/src/interfaces/contractsAbi/definitions.ts b/packages/types/src/interfaces/contractsAbi/definitions.ts index 8c43c1943b..0670cf66b7 100644 --- a/packages/types/src/interfaces/contractsAbi/definitions.ts +++ b/packages/types/src/interfaces/contractsAbi/definitions.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; import { objectSpread } from '@polkadot/util'; diff --git a/packages/types/src/interfaces/contractsAbi/index.ts b/packages/types/src/interfaces/contractsAbi/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/contractsAbi/index.ts +++ b/packages/types/src/interfaces/contractsAbi/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/crowdloan/definitions.ts b/packages/types/src/interfaces/crowdloan/definitions.ts index 674c8a7394..35cf04c57a 100644 --- a/packages/types/src/interfaces/crowdloan/definitions.ts +++ b/packages/types/src/interfaces/crowdloan/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/crowdloan/index.ts b/packages/types/src/interfaces/crowdloan/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/crowdloan/index.ts +++ b/packages/types/src/interfaces/crowdloan/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/cumulus/definitions.ts b/packages/types/src/interfaces/cumulus/definitions.ts index a8e2673278..e548966502 100644 --- a/packages/types/src/interfaces/cumulus/definitions.ts +++ b/packages/types/src/interfaces/cumulus/definitions.ts @@ -4,9 +4,9 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; -import { runtime } from './runtime'; +import { runtime } from './runtime.js'; const dmpQueue = { CollationInfo: { diff --git a/packages/types/src/interfaces/cumulus/index.ts b/packages/types/src/interfaces/cumulus/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/cumulus/index.ts +++ b/packages/types/src/interfaces/cumulus/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/cumulus/runtime.ts b/packages/types/src/interfaces/cumulus/runtime.ts index 88a77cfca2..2ba7c5877a 100644 --- a/packages/types/src/interfaces/cumulus/runtime.ts +++ b/packages/types/src/interfaces/cumulus/runtime.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsCall } from '../../types'; +import type { DefinitionsCall } from '../../types/index.js'; export const runtime: DefinitionsCall = { CollectCollationInfo: [ diff --git a/packages/types/src/interfaces/definitions.spec.ts b/packages/types/src/interfaces/definitions.spec.ts index d96b7f5759..18b8e3d6dc 100644 --- a/packages/types/src/interfaces/definitions.spec.ts +++ b/packages/types/src/interfaces/definitions.spec.ts @@ -1,13 +1,13 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionCall, DefinitionRpc, DefinitionsCall, DefinitionsCallEntry, DefinitionsRpc, DefinitionsTypes, RegistryTypes } from '../types'; +import type { DefinitionCall, DefinitionRpc, DefinitionsCall, DefinitionsCallEntry, DefinitionsRpc, DefinitionsTypes, RegistryTypes } from '../types/index.js'; import rpcMetadata from '@polkadot/types-support/metadata/static-substrate'; -import { getTypeDef, TypeRegistry } from '../create'; -import { Metadata } from '../metadata'; -import * as all from './definitions'; +import { getTypeDef, TypeRegistry } from '../create/index.js'; +import { Metadata } from '../metadata/index.js'; +import * as all from './definitions.js'; interface CheckDef { rpc: DefinitionsRpc; diff --git a/packages/types/src/interfaces/definitions.ts b/packages/types/src/interfaces/definitions.ts index 06905df757..05891fdaee 100644 --- a/packages/types/src/interfaces/definitions.ts +++ b/packages/types/src/interfaces/definitions.ts @@ -1,82 +1,82 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -export * from './essentials'; +export * from './essentials.js'; // substrate types -export { default as assets } from './assets/definitions'; -export { default as authorship } from './authorship/definitions'; -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'; -export { default as democracy } from './democracy/definitions'; -export { default as dev } from './dev/definitions'; -export { default as discovery } from './discovery/definitions'; -export { default as elections } from './elections/definitions'; -export { default as engine } from './engine/definitions'; -export { default as evm } from './evm/definitions'; -export { default as extrinsics } from './extrinsics/definitions'; -export { default as genericAsset } from './genericAsset/definitions'; -export { default as gilt } from './gilt/definitions'; -export { default as grandpa } from './grandpa/definitions'; -export { default as identity } from './identity/definitions'; -export { default as imOnline } from './imOnline/definitions'; -export { default as lottery } from './lottery/definitions'; -export { default as mmr } from './mmr/definitions'; -export { default as nfts } from './nfts/definitions'; -export { default as nompools } from './nompools/definitions'; -export { default as offences } from './offences/definitions'; -export { default as pow } from './pow/definitions'; -export { default as proxy } from './proxy/definitions'; -export { default as recovery } from './recovery/definitions'; -export { default as scheduler } from './scheduler/definitions'; -export { default as session } from './session/definitions'; -export { default as society } from './society/definitions'; -export { default as staking } from './staking/definitions'; -export { default as support } from './support/definitions'; -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'; +export { default as assets } from './assets/definitions.js'; +export { default as authorship } from './authorship/definitions.js'; +export { default as aura } from './aura/definitions.js'; +export { default as babe } from './babe/definitions.js'; +export { default as balances } from './balances/definitions.js'; +export { default as beefy } from './beefy/definitions.js'; +export { default as benchmark } from './benchmark/definitions.js'; +export { default as blockbuilder } from './blockbuilder/definitions.js'; +export { default as collective } from './collective/definitions.js'; +export { default as consensus } from './consensus/definitions.js'; +export { default as contracts } from './contracts/definitions.js'; +export { default as democracy } from './democracy/definitions.js'; +export { default as dev } from './dev/definitions.js'; +export { default as discovery } from './discovery/definitions.js'; +export { default as elections } from './elections/definitions.js'; +export { default as engine } from './engine/definitions.js'; +export { default as evm } from './evm/definitions.js'; +export { default as extrinsics } from './extrinsics/definitions.js'; +export { default as genericAsset } from './genericAsset/definitions.js'; +export { default as gilt } from './gilt/definitions.js'; +export { default as grandpa } from './grandpa/definitions.js'; +export { default as identity } from './identity/definitions.js'; +export { default as imOnline } from './imOnline/definitions.js'; +export { default as lottery } from './lottery/definitions.js'; +export { default as mmr } from './mmr/definitions.js'; +export { default as nfts } from './nfts/definitions.js'; +export { default as nompools } from './nompools/definitions.js'; +export { default as offences } from './offences/definitions.js'; +export { default as pow } from './pow/definitions.js'; +export { default as proxy } from './proxy/definitions.js'; +export { default as recovery } from './recovery/definitions.js'; +export { default as scheduler } from './scheduler/definitions.js'; +export { default as session } from './session/definitions.js'; +export { default as society } from './society/definitions.js'; +export { default as staking } from './staking/definitions.js'; +export { default as support } from './support/definitions.js'; +export { default as syncstate } from './syncstate/definitions.js'; +export { default as system } from './system/definitions.js'; +export { default as treasury } from './treasury/definitions.js'; +export { default as txpayment } from './txpayment/definitions.js'; +export { default as txqueue } from './txqueue/definitions.js'; +export { default as uniques } from './uniques/definitions.js'; +export { default as utility } from './utility/definitions.js'; +export { default as vesting } from './vesting/definitions.js'; // polkadot-specific types -export { default as attestations } from './attestations/definitions'; -export { default as bridges } from './bridges/definitions'; -export { default as claims } from './claims/definitions'; -export { default as crowdloan } from './crowdloan/definitions'; -export { default as cumulus } from './cumulus/definitions'; -export { default as finality } from './finality/definitions'; -export { default as parachains } from './parachains/definitions'; -export { default as poll } from './poll/definitions'; -export { default as purchase } from './purchase/definitions'; -export { default as xcm } from './xcm/definitions'; +export { default as attestations } from './attestations/definitions.js'; +export { default as bridges } from './bridges/definitions.js'; +export { default as claims } from './claims/definitions.js'; +export { default as crowdloan } from './crowdloan/definitions.js'; +export { default as cumulus } from './cumulus/definitions.js'; +export { default as finality } from './finality/definitions.js'; +export { default as parachains } from './parachains/definitions.js'; +export { default as poll } from './poll/definitions.js'; +export { default as purchase } from './purchase/definitions.js'; +export { default as xcm } from './xcm/definitions.js'; // other useful types -export { default as contractsAbi } from './contractsAbi/definitions'; -export { default as eth } from './eth/definitions'; +export { default as contractsAbi } from './contractsAbi/definitions.js'; +export { default as eth } from './eth/definitions.js'; // additional known/community definitions -export { default as nimbus } from './nimbus/definitions'; -export { default as ormlOracle } from './ormlOracle/definitions'; -export { default as ormlTokens } from './ormlTokens/definitions'; +export { default as nimbus } from './nimbus/definitions.js'; +export { default as ormlOracle } from './ormlOracle/definitions.js'; +export { default as ormlTokens } from './ormlTokens/definitions.js'; // pull in rpc last, assuming that is uses info from above -export { default as rpc } from './rpc/definitions'; +export { default as rpc } from './rpc/definitions.js'; // rpc-only definitions -export { default as author } from './author/definitions'; -export { default as chain } from './chain/definitions'; -export { default as childstate } from './childstate/definitions'; -export { default as offchain } from './offchain/definitions'; -export { default as payment } from './payment/definitions'; -export { default as state } from './state/definitions'; +export { default as author } from './author/definitions.js'; +export { default as chain } from './chain/definitions.js'; +export { default as childstate } from './childstate/definitions.js'; +export { default as offchain } from './offchain/definitions.js'; +export { default as payment } from './payment/definitions.js'; +export { default as state } from './state/definitions.js'; diff --git a/packages/types/src/interfaces/democracy/definitions.ts b/packages/types/src/interfaces/democracy/definitions.ts index 81e261f235..4e369b6d92 100644 --- a/packages/types/src/interfaces/democracy/definitions.ts +++ b/packages/types/src/interfaces/democracy/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; export const AllConvictions = [ // 0.1x votes, unlocked. diff --git a/packages/types/src/interfaces/democracy/index.ts b/packages/types/src/interfaces/democracy/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/democracy/index.ts +++ b/packages/types/src/interfaces/democracy/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/dev/definitions.ts b/packages/types/src/interfaces/dev/definitions.ts index 709ca82296..761f0dafc3 100644 --- a/packages/types/src/interfaces/dev/definitions.ts +++ b/packages/types/src/interfaces/dev/definitions.ts @@ -4,9 +4,9 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; -import { rpc } from './rpc'; +import { rpc } from './rpc.js'; export default { rpc, diff --git a/packages/types/src/interfaces/dev/index.ts b/packages/types/src/interfaces/dev/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/dev/index.ts +++ b/packages/types/src/interfaces/dev/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/dev/rpc.ts b/packages/types/src/interfaces/dev/rpc.ts index f2dbe4e713..34bf3ea132 100644 --- a/packages/types/src/interfaces/dev/rpc.ts +++ b/packages/types/src/interfaces/dev/rpc.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsRpc } from '../../types'; +import type { DefinitionsRpc } from '../../types/index.js'; export const rpc: DefinitionsRpc = { getBlockStats: { diff --git a/packages/types/src/interfaces/discovery/definitions.ts b/packages/types/src/interfaces/discovery/definitions.ts index 5e687c78ad..391dc8020b 100644 --- a/packages/types/src/interfaces/discovery/definitions.ts +++ b/packages/types/src/interfaces/discovery/definitions.ts @@ -4,9 +4,9 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; -import { runtime } from './runtime'; +import { runtime } from './runtime.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/discovery/index.ts b/packages/types/src/interfaces/discovery/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/discovery/index.ts +++ b/packages/types/src/interfaces/discovery/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/discovery/runtime.ts b/packages/types/src/interfaces/discovery/runtime.ts index 4ae14d7547..ac4e3ef0de 100644 --- a/packages/types/src/interfaces/discovery/runtime.ts +++ b/packages/types/src/interfaces/discovery/runtime.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsCall } from '../../types'; +import type { DefinitionsCall } from '../../types/index.js'; export const runtime: DefinitionsCall = { AuthorityDiscoveryApi: [ diff --git a/packages/types/src/interfaces/elections/definitions.ts b/packages/types/src/interfaces/elections/definitions.ts index fbd42381a2..84877ceef1 100644 --- a/packages/types/src/interfaces/elections/definitions.ts +++ b/packages/types/src/interfaces/elections/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/elections/index.ts b/packages/types/src/interfaces/elections/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/elections/index.ts +++ b/packages/types/src/interfaces/elections/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/engine/definitions.ts b/packages/types/src/interfaces/engine/definitions.ts index 74ac20802a..2f8e813f99 100644 --- a/packages/types/src/interfaces/engine/definitions.ts +++ b/packages/types/src/interfaces/engine/definitions.ts @@ -4,9 +4,9 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; -import { rpc } from './rpc'; +import { rpc } from './rpc.js'; export default { rpc, diff --git a/packages/types/src/interfaces/engine/index.ts b/packages/types/src/interfaces/engine/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/engine/index.ts +++ b/packages/types/src/interfaces/engine/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/engine/rpc.ts b/packages/types/src/interfaces/engine/rpc.ts index 3987e17dc9..3210afdbad 100644 --- a/packages/types/src/interfaces/engine/rpc.ts +++ b/packages/types/src/interfaces/engine/rpc.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsRpc } from '../../types'; +import type { DefinitionsRpc } from '../../types/index.js'; export const rpc: DefinitionsRpc = { createBlock: { diff --git a/packages/types/src/interfaces/essentials.ts b/packages/types/src/interfaces/essentials.ts index 70950ff4d9..987096f141 100644 --- a/packages/types/src/interfaces/essentials.ts +++ b/packages/types/src/interfaces/essentials.ts @@ -1,6 +1,6 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -export { default as metadata } from './metadata/definitions'; -export { default as runtime } from './runtime/definitions'; -export { default as scaleInfo } from './scaleInfo/definitions'; +export { default as metadata } from './metadata/definitions.js'; +export { default as runtime } from './runtime/definitions.js'; +export { default as scaleInfo } from './scaleInfo/definitions.js'; diff --git a/packages/types/src/interfaces/eth/definitions.ts b/packages/types/src/interfaces/eth/definitions.ts index 1b2b6617f1..515f9c213b 100644 --- a/packages/types/src/interfaces/eth/definitions.ts +++ b/packages/types/src/interfaces/eth/definitions.ts @@ -6,12 +6,12 @@ // As per frontier -import type { DefinitionsTypes } from '../../types'; +import type { DefinitionsTypes } from '../../types/index.js'; import { objectSpread } from '@polkadot/util'; -import { rpc } from './rpc'; -import { runtime } from './runtime'; +import { rpc } from './rpc.js'; +import { runtime } from './runtime.js'; const V0: DefinitionsTypes = { BlockV0: { diff --git a/packages/types/src/interfaces/eth/index.ts b/packages/types/src/interfaces/eth/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/eth/index.ts +++ b/packages/types/src/interfaces/eth/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/eth/rpc.ts b/packages/types/src/interfaces/eth/rpc.ts index e67d40296b..38813305b5 100644 --- a/packages/types/src/interfaces/eth/rpc.ts +++ b/packages/types/src/interfaces/eth/rpc.ts @@ -3,7 +3,7 @@ // As per frontier -import type { DefinitionsRpc } from '../../types'; +import type { DefinitionsRpc } from '../../types/index.js'; import { objectSpread } from '@polkadot/util'; diff --git a/packages/types/src/interfaces/eth/runtime.ts b/packages/types/src/interfaces/eth/runtime.ts index 6836b72669..8dd0e977e4 100644 --- a/packages/types/src/interfaces/eth/runtime.ts +++ b/packages/types/src/interfaces/eth/runtime.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsCall } from '../../types'; +import type { DefinitionsCall } from '../../types/index.js'; export const runtime: DefinitionsCall = { ConvertTransactionRuntimeApi: [ diff --git a/packages/types/src/interfaces/evm/definitions.ts b/packages/types/src/interfaces/evm/definitions.ts index 448cb93a06..7858e38bd7 100644 --- a/packages/types/src/interfaces/evm/definitions.ts +++ b/packages/types/src/interfaces/evm/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/evm/index.ts b/packages/types/src/interfaces/evm/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/evm/index.ts +++ b/packages/types/src/interfaces/evm/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/extrinsics/EdcsaSignature.spec.ts b/packages/types/src/interfaces/extrinsics/EdcsaSignature.spec.ts index d25edd8225..75112ee782 100644 --- a/packages/types/src/interfaces/extrinsics/EdcsaSignature.spec.ts +++ b/packages/types/src/interfaces/extrinsics/EdcsaSignature.spec.ts @@ -5,7 +5,7 @@ import { hexToU8a } from '@polkadot/util'; -import { TypeRegistry } from '../../create'; +import { TypeRegistry } from '../../create/index.js'; const TESTS = [ '0x55bd020bdbbdc02de34e915effc9b18a99002f4c29f64e22e8dcbb69e722ea6c28e1bb53b9484063fbbfd205e49dcc1f620929f520c9c4c3695150f05a28f52a01', diff --git a/packages/types/src/interfaces/extrinsics/definitions.ts b/packages/types/src/interfaces/extrinsics/definitions.ts index 56e8dbfb72..0f14e00fcf 100644 --- a/packages/types/src/interfaces/extrinsics/definitions.ts +++ b/packages/types/src/interfaces/extrinsics/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/extrinsics/index.ts b/packages/types/src/interfaces/extrinsics/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/extrinsics/index.ts +++ b/packages/types/src/interfaces/extrinsics/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/finality/definitions.ts b/packages/types/src/interfaces/finality/definitions.ts index 5e687c78ad..391dc8020b 100644 --- a/packages/types/src/interfaces/finality/definitions.ts +++ b/packages/types/src/interfaces/finality/definitions.ts @@ -4,9 +4,9 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; -import { runtime } from './runtime'; +import { runtime } from './runtime.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/finality/index.ts b/packages/types/src/interfaces/finality/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/finality/index.ts +++ b/packages/types/src/interfaces/finality/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/finality/runtime.ts b/packages/types/src/interfaces/finality/runtime.ts index 0a0c8d3d4b..8df06fa29a 100644 --- a/packages/types/src/interfaces/finality/runtime.ts +++ b/packages/types/src/interfaces/finality/runtime.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsCall } from '../../types'; +import type { DefinitionsCall } from '../../types/index.js'; // implemented by chains bridging into the relay, not the relay itself const finalityV1 = { diff --git a/packages/types/src/interfaces/genericAsset/definitions.ts b/packages/types/src/interfaces/genericAsset/definitions.ts index d7e260c1b6..4adc6b034f 100644 --- a/packages/types/src/interfaces/genericAsset/definitions.ts +++ b/packages/types/src/interfaces/genericAsset/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/genericAsset/index.ts b/packages/types/src/interfaces/genericAsset/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/genericAsset/index.ts +++ b/packages/types/src/interfaces/genericAsset/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/gilt/definitions.ts b/packages/types/src/interfaces/gilt/definitions.ts index f3fc90f6c0..c5057bcc2e 100644 --- a/packages/types/src/interfaces/gilt/definitions.ts +++ b/packages/types/src/interfaces/gilt/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/gilt/index.ts b/packages/types/src/interfaces/gilt/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/gilt/index.ts +++ b/packages/types/src/interfaces/gilt/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/grandpa/ReportedRoundStates.spec.ts b/packages/types/src/interfaces/grandpa/ReportedRoundStates.spec.ts index 664163692b..ea6c8b65c2 100644 --- a/packages/types/src/interfaces/grandpa/ReportedRoundStates.spec.ts +++ b/packages/types/src/interfaces/grandpa/ReportedRoundStates.spec.ts @@ -7,7 +7,7 @@ import json3 from '@polkadot/types-support/json/GrandpaRoundstate.001.json' assert { type: 'json' }; -import { TypeRegistry } from '../../create'; +import { TypeRegistry } from '../../create/index.js'; describe('ReportedRoundStates', (): void => { const registry = new TypeRegistry(); diff --git a/packages/types/src/interfaces/grandpa/definitions.ts b/packages/types/src/interfaces/grandpa/definitions.ts index 4d6ff49653..b5ed926fb9 100644 --- a/packages/types/src/interfaces/grandpa/definitions.ts +++ b/packages/types/src/interfaces/grandpa/definitions.ts @@ -4,10 +4,10 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; -import { rpc } from './rpc'; -import { runtime } from './runtime'; +import { rpc } from './rpc.js'; +import { runtime } from './runtime.js'; export default { rpc, diff --git a/packages/types/src/interfaces/grandpa/index.ts b/packages/types/src/interfaces/grandpa/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/grandpa/index.ts +++ b/packages/types/src/interfaces/grandpa/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/grandpa/rpc.ts b/packages/types/src/interfaces/grandpa/rpc.ts index d629f25d0d..bf6db701a8 100644 --- a/packages/types/src/interfaces/grandpa/rpc.ts +++ b/packages/types/src/interfaces/grandpa/rpc.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsRpc } from '../../types'; +import type { DefinitionsRpc } from '../../types/index.js'; export const rpc: DefinitionsRpc = { proveFinality: { diff --git a/packages/types/src/interfaces/grandpa/runtime.ts b/packages/types/src/interfaces/grandpa/runtime.ts index a8c95603a9..27d4edb2bc 100644 --- a/packages/types/src/interfaces/grandpa/runtime.ts +++ b/packages/types/src/interfaces/grandpa/runtime.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsCall, DefinitionsCallEntry } from '../../types'; +import type { DefinitionsCall, DefinitionsCallEntry } from '../../types/index.js'; import { objectSpread } from '@polkadot/util'; diff --git a/packages/types/src/interfaces/identity/IdentityFields.spec.ts b/packages/types/src/interfaces/identity/IdentityFields.spec.ts index 4f6aba7e13..0e88a0b48a 100644 --- a/packages/types/src/interfaces/identity/IdentityFields.spec.ts +++ b/packages/types/src/interfaces/identity/IdentityFields.spec.ts @@ -3,7 +3,7 @@ /// -import { TypeRegistry } from '../../create'; +import { TypeRegistry } from '../../create/index.js'; describe('IdentityFields', (): void => { const registry = new TypeRegistry(); diff --git a/packages/types/src/interfaces/identity/Registration.spec.ts b/packages/types/src/interfaces/identity/Registration.spec.ts index 1340cce3c7..1744042f4c 100644 --- a/packages/types/src/interfaces/identity/Registration.spec.ts +++ b/packages/types/src/interfaces/identity/Registration.spec.ts @@ -3,7 +3,7 @@ /// -import { createType, TypeRegistry } from '../../create'; +import { createType, TypeRegistry } from '../../create/index.js'; const registry = new TypeRegistry(); diff --git a/packages/types/src/interfaces/identity/definitions.ts b/packages/types/src/interfaces/identity/definitions.ts index 171914aeec..d0c5317f48 100644 --- a/packages/types/src/interfaces/identity/definitions.ts +++ b/packages/types/src/interfaces/identity/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/identity/index.ts b/packages/types/src/interfaces/identity/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/identity/index.ts +++ b/packages/types/src/interfaces/identity/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/imOnline/definitions.ts b/packages/types/src/interfaces/imOnline/definitions.ts index 5f40f24d57..f28aec3d0b 100644 --- a/packages/types/src/interfaces/imOnline/definitions.ts +++ b/packages/types/src/interfaces/imOnline/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/imOnline/index.ts b/packages/types/src/interfaces/imOnline/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/imOnline/index.ts +++ b/packages/types/src/interfaces/imOnline/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/index.ts b/packages/types/src/interfaces/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/index.ts +++ b/packages/types/src/interfaces/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/jsonrpc.ts b/packages/types/src/interfaces/jsonrpc.ts index b2d7bb73e2..0d84c76002 100644 --- a/packages/types/src/interfaces/jsonrpc.ts +++ b/packages/types/src/interfaces/jsonrpc.ts @@ -1,11 +1,11 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionRpcExt, DefinitionRpcSub } from '../types'; +import type { DefinitionRpcExt, DefinitionRpcSub } from '../types/index.js'; import { objectSpread } from '@polkadot/util'; -import * as defs from './definitions'; +import * as defs from './definitions.js'; const jsonrpc: Record> = {}; diff --git a/packages/types/src/interfaces/lottery/definitions.ts b/packages/types/src/interfaces/lottery/definitions.ts index d178374769..647ef5e5bd 100644 --- a/packages/types/src/interfaces/lottery/definitions.ts +++ b/packages/types/src/interfaces/lottery/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/lottery/index.ts b/packages/types/src/interfaces/lottery/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/lottery/index.ts +++ b/packages/types/src/interfaces/lottery/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/metadata/definitions.ts b/packages/types/src/interfaces/metadata/definitions.ts index 09f39bcce3..a08dca0b45 100644 --- a/packages/types/src/interfaces/metadata/definitions.ts +++ b/packages/types/src/interfaces/metadata/definitions.ts @@ -4,18 +4,18 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; import { objectSpread } from '@polkadot/util'; -import { AllHashers } from './hashers'; -import { runtime } from './runtime'; -import { v9 } from './v9'; -import { v10 } from './v10'; -import { v11 } from './v11'; -import { v12 } from './v12'; -import { v13 } from './v13'; -import { v14 } from './v14'; +import { AllHashers } from './hashers.js'; +import { runtime } from './runtime.js'; +import { v9 } from './v9.js'; +import { v10 } from './v10.js'; +import { v11 } from './v11.js'; +import { v12 } from './v12.js'; +import { v13 } from './v13.js'; +import { v14 } from './v14.js'; export { AllHashers }; diff --git a/packages/types/src/interfaces/metadata/index.ts b/packages/types/src/interfaces/metadata/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/metadata/index.ts +++ b/packages/types/src/interfaces/metadata/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/metadata/runtime.ts b/packages/types/src/interfaces/metadata/runtime.ts index 0dfdd9073c..72a06977a5 100644 --- a/packages/types/src/interfaces/metadata/runtime.ts +++ b/packages/types/src/interfaces/metadata/runtime.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsCall } from '../../types'; +import type { DefinitionsCall } from '../../types/index.js'; export const runtime: DefinitionsCall = { Metadata: [ diff --git a/packages/types/src/interfaces/metadata/v10.ts b/packages/types/src/interfaces/metadata/v10.ts index c916fa3ca1..c9b3d99128 100644 --- a/packages/types/src/interfaces/metadata/v10.ts +++ b/packages/types/src/interfaces/metadata/v10.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { DefinitionsTypes } from '../../types'; +import type { DefinitionsTypes } from '../../types/index.js'; export const v10: DefinitionsTypes = { // v10 diff --git a/packages/types/src/interfaces/metadata/v11.ts b/packages/types/src/interfaces/metadata/v11.ts index 3f40452eee..022f8f4717 100644 --- a/packages/types/src/interfaces/metadata/v11.ts +++ b/packages/types/src/interfaces/metadata/v11.ts @@ -4,9 +4,9 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { DefinitionsTypes } from '../../types'; +import type { DefinitionsTypes } from '../../types/index.js'; -import { AllHashers } from './hashers'; +import { AllHashers } from './hashers.js'; export const v11: DefinitionsTypes = { // v11 diff --git a/packages/types/src/interfaces/metadata/v12.ts b/packages/types/src/interfaces/metadata/v12.ts index 9ae0f338fb..b93871566f 100644 --- a/packages/types/src/interfaces/metadata/v12.ts +++ b/packages/types/src/interfaces/metadata/v12.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { DefinitionsTypes } from '../../types'; +import type { DefinitionsTypes } from '../../types/index.js'; export const v12: DefinitionsTypes = { // v12 diff --git a/packages/types/src/interfaces/metadata/v13.ts b/packages/types/src/interfaces/metadata/v13.ts index ebc40812e8..e30e71d5db 100644 --- a/packages/types/src/interfaces/metadata/v13.ts +++ b/packages/types/src/interfaces/metadata/v13.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { DefinitionsTypes } from '../../types'; +import type { DefinitionsTypes } from '../../types/index.js'; export const v13: DefinitionsTypes = { // v13 diff --git a/packages/types/src/interfaces/metadata/v14.ts b/packages/types/src/interfaces/metadata/v14.ts index fc5f92428b..817977a090 100644 --- a/packages/types/src/interfaces/metadata/v14.ts +++ b/packages/types/src/interfaces/metadata/v14.ts @@ -4,11 +4,11 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { DefinitionsTypes, DefinitionTypeStruct } from '../../types'; +import type { DefinitionsTypes, DefinitionTypeStruct } from '../../types/index.js'; import { objectSpread } from '@polkadot/util'; -import { Si1Variant } from '../scaleInfo/v1'; +import { Si1Variant } from '../scaleInfo/v1.js'; export const v14: DefinitionsTypes = { // registry diff --git a/packages/types/src/interfaces/metadata/v9.ts b/packages/types/src/interfaces/metadata/v9.ts index 2e281e3a03..9d49c92e87 100644 --- a/packages/types/src/interfaces/metadata/v9.ts +++ b/packages/types/src/interfaces/metadata/v9.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { DefinitionsTypes } from '../../types'; +import type { DefinitionsTypes } from '../../types/index.js'; export const v9: DefinitionsTypes = { // v9 diff --git a/packages/types/src/interfaces/mmr/definitions.ts b/packages/types/src/interfaces/mmr/definitions.ts index 15f2530722..b4485ea147 100644 --- a/packages/types/src/interfaces/mmr/definitions.ts +++ b/packages/types/src/interfaces/mmr/definitions.ts @@ -4,10 +4,10 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; -import { rpc } from './rpc'; -import { runtime } from './runtime'; +import { rpc } from './rpc.js'; +import { runtime } from './runtime.js'; export default { rpc, diff --git a/packages/types/src/interfaces/mmr/index.ts b/packages/types/src/interfaces/mmr/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/mmr/index.ts +++ b/packages/types/src/interfaces/mmr/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/mmr/rpc.ts b/packages/types/src/interfaces/mmr/rpc.ts index 0bee7ed209..5a2dbdeae8 100644 --- a/packages/types/src/interfaces/mmr/rpc.ts +++ b/packages/types/src/interfaces/mmr/rpc.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsRpc } from '../../types'; +import type { DefinitionsRpc } from '../../types/index.js'; export const rpc: DefinitionsRpc = { generateBatchProof: { diff --git a/packages/types/src/interfaces/mmr/runtime.ts b/packages/types/src/interfaces/mmr/runtime.ts index 2a082bb2af..544503db06 100644 --- a/packages/types/src/interfaces/mmr/runtime.ts +++ b/packages/types/src/interfaces/mmr/runtime.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsCall } from '../../types'; +import type { DefinitionsCall } from '../../types/index.js'; export const runtime: DefinitionsCall = { MmrApi: [ diff --git a/packages/types/src/interfaces/nfts/definitions.ts b/packages/types/src/interfaces/nfts/definitions.ts index 076a3ef6ca..e81c474b61 100644 --- a/packages/types/src/interfaces/nfts/definitions.ts +++ b/packages/types/src/interfaces/nfts/definitions.ts @@ -4,9 +4,9 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; -import { runtime } from './runtime'; +import { runtime } from './runtime.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/nfts/index.ts b/packages/types/src/interfaces/nfts/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/nfts/index.ts +++ b/packages/types/src/interfaces/nfts/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/nfts/runtime.ts b/packages/types/src/interfaces/nfts/runtime.ts index b85f202044..1c6ca3ce6a 100644 --- a/packages/types/src/interfaces/nfts/runtime.ts +++ b/packages/types/src/interfaces/nfts/runtime.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsCall } from '../../types'; +import type { DefinitionsCall } from '../../types/index.js'; export const runtime: DefinitionsCall = { NftsApi: [ diff --git a/packages/types/src/interfaces/nimbus/definitions.ts b/packages/types/src/interfaces/nimbus/definitions.ts index 5e687c78ad..391dc8020b 100644 --- a/packages/types/src/interfaces/nimbus/definitions.ts +++ b/packages/types/src/interfaces/nimbus/definitions.ts @@ -4,9 +4,9 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; -import { runtime } from './runtime'; +import { runtime } from './runtime.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/nimbus/index.ts b/packages/types/src/interfaces/nimbus/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/nimbus/index.ts +++ b/packages/types/src/interfaces/nimbus/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/nimbus/runtime.ts b/packages/types/src/interfaces/nimbus/runtime.ts index cc6122965f..80f0d6ace9 100644 --- a/packages/types/src/interfaces/nimbus/runtime.ts +++ b/packages/types/src/interfaces/nimbus/runtime.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsCall } from '../../types'; +import type { DefinitionsCall } from '../../types/index.js'; export const runtime: DefinitionsCall = { // deprecated, the NimbusApi is current - this is for backwards compat diff --git a/packages/types/src/interfaces/nompools/definitions.ts b/packages/types/src/interfaces/nompools/definitions.ts index 4be6d44300..a7460d7a34 100644 --- a/packages/types/src/interfaces/nompools/definitions.ts +++ b/packages/types/src/interfaces/nompools/definitions.ts @@ -4,9 +4,9 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; -import { runtime } from './runtime'; +import { runtime } from './runtime.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/nompools/index.ts b/packages/types/src/interfaces/nompools/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/nompools/index.ts +++ b/packages/types/src/interfaces/nompools/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/nompools/runtime.ts b/packages/types/src/interfaces/nompools/runtime.ts index 123b70eed5..0c91e7c35b 100644 --- a/packages/types/src/interfaces/nompools/runtime.ts +++ b/packages/types/src/interfaces/nompools/runtime.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsCall } from '../../types'; +import type { DefinitionsCall } from '../../types/index.js'; export const runtime: DefinitionsCall = { NominationPoolsApi: [ diff --git a/packages/types/src/interfaces/offchain/definitions.spec.ts b/packages/types/src/interfaces/offchain/definitions.spec.ts index feadd003cf..ed40a2b3ee 100644 --- a/packages/types/src/interfaces/offchain/definitions.spec.ts +++ b/packages/types/src/interfaces/offchain/definitions.spec.ts @@ -3,7 +3,7 @@ /// -import { TypeRegistry } from '../../create'; +import { TypeRegistry } from '../../create/index.js'; describe('offchain definitions', (): void => { const registry = new TypeRegistry(); diff --git a/packages/types/src/interfaces/offchain/definitions.ts b/packages/types/src/interfaces/offchain/definitions.ts index 491cd210cd..d6225f4e1b 100644 --- a/packages/types/src/interfaces/offchain/definitions.ts +++ b/packages/types/src/interfaces/offchain/definitions.ts @@ -4,10 +4,10 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; -import { rpc } from './rpc'; -import { runtime } from './runtime'; +import { rpc } from './rpc.js'; +import { runtime } from './runtime.js'; export default { rpc, diff --git a/packages/types/src/interfaces/offchain/index.ts b/packages/types/src/interfaces/offchain/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/offchain/index.ts +++ b/packages/types/src/interfaces/offchain/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/offchain/rpc.ts b/packages/types/src/interfaces/offchain/rpc.ts index a6517fffd9..e44b0eaadb 100644 --- a/packages/types/src/interfaces/offchain/rpc.ts +++ b/packages/types/src/interfaces/offchain/rpc.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsRpc } from '../../types'; +import type { DefinitionsRpc } from '../../types/index.js'; export const rpc: DefinitionsRpc = { localStorageGet: { diff --git a/packages/types/src/interfaces/offchain/runtime.ts b/packages/types/src/interfaces/offchain/runtime.ts index a12e5a306d..ff6c2931c2 100644 --- a/packages/types/src/interfaces/offchain/runtime.ts +++ b/packages/types/src/interfaces/offchain/runtime.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsCall } from '../../types'; +import type { DefinitionsCall } from '../../types/index.js'; export const runtime: DefinitionsCall = { OffchainWorkerApi: [ diff --git a/packages/types/src/interfaces/offences/definitions.ts b/packages/types/src/interfaces/offences/definitions.ts index 7b37e3711e..92f6ca4ad4 100644 --- a/packages/types/src/interfaces/offences/definitions.ts +++ b/packages/types/src/interfaces/offences/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/offences/index.ts b/packages/types/src/interfaces/offences/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/offences/index.ts +++ b/packages/types/src/interfaces/offences/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/ormlOracle/definitions.ts b/packages/types/src/interfaces/ormlOracle/definitions.ts index 5e687c78ad..391dc8020b 100644 --- a/packages/types/src/interfaces/ormlOracle/definitions.ts +++ b/packages/types/src/interfaces/ormlOracle/definitions.ts @@ -4,9 +4,9 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; -import { runtime } from './runtime'; +import { runtime } from './runtime.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/ormlOracle/index.ts b/packages/types/src/interfaces/ormlOracle/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/ormlOracle/index.ts +++ b/packages/types/src/interfaces/ormlOracle/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/ormlOracle/runtime.ts b/packages/types/src/interfaces/ormlOracle/runtime.ts index 6595f5240a..d349961a75 100644 --- a/packages/types/src/interfaces/ormlOracle/runtime.ts +++ b/packages/types/src/interfaces/ormlOracle/runtime.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsCall } from '../../types'; +import type { DefinitionsCall } from '../../types/index.js'; export const runtime: DefinitionsCall = { // https://github.com/open-web3-stack/open-runtime-module-library/blob/b57f88b39cd547e2fb51727d8bb9bcc64fddf8b5/oracle/rpc/runtime-api/src/lib.rs#L12-L21 diff --git a/packages/types/src/interfaces/ormlTokens/definitions.ts b/packages/types/src/interfaces/ormlTokens/definitions.ts index 5e687c78ad..391dc8020b 100644 --- a/packages/types/src/interfaces/ormlTokens/definitions.ts +++ b/packages/types/src/interfaces/ormlTokens/definitions.ts @@ -4,9 +4,9 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; -import { runtime } from './runtime'; +import { runtime } from './runtime.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/ormlTokens/index.ts b/packages/types/src/interfaces/ormlTokens/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/ormlTokens/index.ts +++ b/packages/types/src/interfaces/ormlTokens/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/ormlTokens/runtime.ts b/packages/types/src/interfaces/ormlTokens/runtime.ts index 1d7cd776f0..15d1845f95 100644 --- a/packages/types/src/interfaces/ormlTokens/runtime.ts +++ b/packages/types/src/interfaces/ormlTokens/runtime.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsCall } from '../../types'; +import type { DefinitionsCall } from '../../types/index.js'; export const runtime: DefinitionsCall = { // https://github.com/open-web3-stack/open-runtime-module-library/blob/b57f88b39cd547e2fb51727d8bb9bcc64fddf8b5/tokens/rpc/runtime-api/src/lib.rs#L11-L18 diff --git a/packages/types/src/interfaces/parachains/SystemInherentData.spec.ts b/packages/types/src/interfaces/parachains/SystemInherentData.spec.ts index 7d9ea30605..61487a90c6 100644 --- a/packages/types/src/interfaces/parachains/SystemInherentData.spec.ts +++ b/packages/types/src/interfaces/parachains/SystemInherentData.spec.ts @@ -3,7 +3,7 @@ /// -import { TypeRegistry } from '../../create'; +import { TypeRegistry } from '../../create/index.js'; const KILT = '0x8d01d51627af4cb8414b6ad454e7204424e7e8489738c5fabe20cee3256bd69b7534d12b2798b04e574d05fb8a4b163745b1e610fb75de59399271bd57e49738506a7a93ee0038dd6a1b3bfbb58f747a7b2052058620839a8e2d03f5a43b48ca6000c66a00299600004412f5d19eed1a0cbafadd3b050b6e87fbcdff0a4b2ab0dce498d2180f7d7fe40000000000000000000000000000000000000000000000000000000000000000000000200318f49e207f03cfdce586301014700e2c25930041585f078d434d6125b40443fe11fd292d13a410000008004c5f0ec2d17a76153ff51817f12d9cfc3c7f0400c106807ff6802ca40549562ffe6b52b99b82732a11693a9f94e719eb6091a28361553b7e1d6f8071c05107fa3ba69c860039b5eaf97de7405f1b96f158678ce0581618e4cb00ed8020617372d0786928a794bc2168d93a97c9934583395972b4d4ab49c99242035380947dbbbf1d13550ebd1c60bdad2e6e4905e72acf2135a3ecf9539b14ac336a1e8048b33fdf9c46b272d66e2467dba4fa4709dd3e560183d5ef462c8bdf09aa14e58083a5a2c804e9dbc8839a7d520a726c0518a82ff872d1ec2932c1142866c945648090bbb5b7644e54d533f3630580cb8074409ddcc510eab64ecc32216c912ac87a8071959a3ccb6903f9fb571c5eb87649e1a4d7fc095b7a9d88fd6941dadf0d251280ba7052563c97b91cccc3a3762e0a8d73a0fd2018bd63932fdf6e6dfb8e998705807970bd80ad702930fe83ab570956c242563c1ea2560e5bed94456168ded1ec2e801c3452fb59635b2a0def7e3a91cd071d57beb4d92294484ee948728d72a8a2ed80974da04ec2f2a432413995b1c30d9903e6c69b63d25ea3564c3fd604513c045480365249e4644cac1c396b92b70c2d8daa355a87236ca6ff3fdcf0e0039351fa911501802100803d7774397092a7bd12ebb498311ea37c46eeeec8460cbf88e03f55bfa109817f80f2ce141c02c934f343545350b70e54c8c2a0bb12f886462797399672b145ff0cad019e0da05ca59913bc38a8630590f2627c014180412934e1ef5da416397acfe5b81b2c604c81fd696fabcb082451b88dd46feafc585f078d434d6125b40443fe11fd292d13a410000008008077b468c9a59a67ed7ae15442240aba9ae23e7b632fe6e5bdb97b2b40b4aa10a135037f0006de3d8a54d27e44a9d5ce189618f22db4b49d95320d9021994c850f25b8e385a50200005000008000000800000000200000000400000500000005000000580200002c010000000020030004000000286bee0000000004000000040000000500000000000000000000000000000000000000000000000000000000000000000000000800000000200000040000000400000000040000b004000000000000000000001400000004000000040000000000000000000000000a000000000000000000000000000000000000009901801804800fcf38b60d2719964e4c4cc392848e51c8ce99e85efc57368586ed54938b6bf180aebb1dfa081e0f528a33c48cc0d64717ff2e6de6f73e001bc0c608d24f5b79b7809ee0a05d790e73768b384a037678e8cdc4fcfcb90ca782824c5119294de00fdb0000'; diff --git a/packages/types/src/interfaces/parachains/definitions.ts b/packages/types/src/interfaces/parachains/definitions.ts index 6b9f5412ff..8be6546147 100644 --- a/packages/types/src/interfaces/parachains/definitions.ts +++ b/packages/types/src/interfaces/parachains/definitions.ts @@ -4,13 +4,13 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; import { objectSpread } from '@polkadot/util'; -import hrmpTypes from './hrmp'; -import { runtime } from './runtime'; -import slotTypes from './slots'; +import hrmpTypes from './hrmp.js'; +import { runtime } from './runtime.js'; +import slotTypes from './slots.js'; // proposeParachain const proposeTypes = { diff --git a/packages/types/src/interfaces/parachains/index.ts b/packages/types/src/interfaces/parachains/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/parachains/index.ts +++ b/packages/types/src/interfaces/parachains/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/parachains/runtime.ts b/packages/types/src/interfaces/parachains/runtime.ts index f1417f10fb..62db429f83 100644 --- a/packages/types/src/interfaces/parachains/runtime.ts +++ b/packages/types/src/interfaces/parachains/runtime.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsCall, DefinitionsCallEntry } from '../../types'; +import type { DefinitionsCall, DefinitionsCallEntry } from '../../types/index.js'; import { objectSpread } from '@polkadot/util'; diff --git a/packages/types/src/interfaces/payment/definitions.ts b/packages/types/src/interfaces/payment/definitions.ts index 1b0b6089fb..47f3d5ff67 100644 --- a/packages/types/src/interfaces/payment/definitions.ts +++ b/packages/types/src/interfaces/payment/definitions.ts @@ -4,10 +4,10 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; -import { rpc } from './rpc'; -import { runtime } from './runtime'; +import { rpc } from './rpc.js'; +import { runtime } from './runtime.js'; export default { rpc, diff --git a/packages/types/src/interfaces/payment/index.ts b/packages/types/src/interfaces/payment/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/payment/index.ts +++ b/packages/types/src/interfaces/payment/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/payment/rpc.ts b/packages/types/src/interfaces/payment/rpc.ts index 3539d227b0..bd1715700c 100644 --- a/packages/types/src/interfaces/payment/rpc.ts +++ b/packages/types/src/interfaces/payment/rpc.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsRpc } from '../../types'; +import type { DefinitionsRpc } from '../../types/index.js'; export const rpc: DefinitionsRpc = { queryFeeDetails: { diff --git a/packages/types/src/interfaces/payment/runtime.ts b/packages/types/src/interfaces/payment/runtime.ts index 778c7f7e33..a1c1a3f79e 100644 --- a/packages/types/src/interfaces/payment/runtime.ts +++ b/packages/types/src/interfaces/payment/runtime.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionCall, DefinitionsCall } from '../../types'; +import type { DefinitionCall, DefinitionsCall } from '../../types/index.js'; import { objectSpread } from '@polkadot/util'; diff --git a/packages/types/src/interfaces/poll/definitions.ts b/packages/types/src/interfaces/poll/definitions.ts index 250eb403fe..fab12bd529 100644 --- a/packages/types/src/interfaces/poll/definitions.ts +++ b/packages/types/src/interfaces/poll/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/poll/index.ts b/packages/types/src/interfaces/poll/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/poll/index.ts +++ b/packages/types/src/interfaces/poll/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/pow/definitions.ts b/packages/types/src/interfaces/pow/definitions.ts index 5e687c78ad..391dc8020b 100644 --- a/packages/types/src/interfaces/pow/definitions.ts +++ b/packages/types/src/interfaces/pow/definitions.ts @@ -4,9 +4,9 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; -import { runtime } from './runtime'; +import { runtime } from './runtime.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/pow/index.ts b/packages/types/src/interfaces/pow/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/pow/index.ts +++ b/packages/types/src/interfaces/pow/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/pow/runtime.ts b/packages/types/src/interfaces/pow/runtime.ts index da5e3e492d..9aeb9d31d0 100644 --- a/packages/types/src/interfaces/pow/runtime.ts +++ b/packages/types/src/interfaces/pow/runtime.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsCall } from '../../types'; +import type { DefinitionsCall } from '../../types/index.js'; export const runtime: DefinitionsCall = { DifficultyApi: [ diff --git a/packages/types/src/interfaces/proxy/definitions.ts b/packages/types/src/interfaces/proxy/definitions.ts index 77e842d5b4..96c902200c 100644 --- a/packages/types/src/interfaces/proxy/definitions.ts +++ b/packages/types/src/interfaces/proxy/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/proxy/index.ts b/packages/types/src/interfaces/proxy/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/proxy/index.ts +++ b/packages/types/src/interfaces/proxy/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/purchase/definitions.ts b/packages/types/src/interfaces/purchase/definitions.ts index e97f1a9a10..e0f8751c43 100644 --- a/packages/types/src/interfaces/purchase/definitions.ts +++ b/packages/types/src/interfaces/purchase/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/purchase/index.ts b/packages/types/src/interfaces/purchase/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/purchase/index.ts +++ b/packages/types/src/interfaces/purchase/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/recovery/definitions.ts b/packages/types/src/interfaces/recovery/definitions.ts index 6bf746e31d..c09e2f6f3e 100644 --- a/packages/types/src/interfaces/recovery/definitions.ts +++ b/packages/types/src/interfaces/recovery/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/recovery/index.ts b/packages/types/src/interfaces/recovery/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/recovery/index.ts +++ b/packages/types/src/interfaces/recovery/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/rpc/definitions.ts b/packages/types/src/interfaces/rpc/definitions.ts index cccc635fdc..de296080b0 100644 --- a/packages/types/src/interfaces/rpc/definitions.ts +++ b/packages/types/src/interfaces/rpc/definitions.ts @@ -4,9 +4,9 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; -import { rpc } from './rpc'; +import { rpc } from './rpc.js'; export default { rpc, diff --git a/packages/types/src/interfaces/rpc/index.ts b/packages/types/src/interfaces/rpc/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/rpc/index.ts +++ b/packages/types/src/interfaces/rpc/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/rpc/rpc.ts b/packages/types/src/interfaces/rpc/rpc.ts index 9a42dfd8d4..4aef6cfb49 100644 --- a/packages/types/src/interfaces/rpc/rpc.ts +++ b/packages/types/src/interfaces/rpc/rpc.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsRpc } from '../../types'; +import type { DefinitionsRpc } from '../../types/index.js'; export const rpc: DefinitionsRpc = { methods: { diff --git a/packages/types/src/interfaces/runtime/Digest.spec.ts b/packages/types/src/interfaces/runtime/Digest.spec.ts index 177495faa3..29f567965c 100644 --- a/packages/types/src/interfaces/runtime/Digest.spec.ts +++ b/packages/types/src/interfaces/runtime/Digest.spec.ts @@ -7,7 +7,7 @@ import json3 from '@polkadot/types-support/json/Header.003.json' assert { type: 'json' }; -import { TypeRegistry } from '../../create'; +import { TypeRegistry } from '../../create/index.js'; describe('Digest', (): void => { const registry = new TypeRegistry(); diff --git a/packages/types/src/interfaces/runtime/Header.spec.ts b/packages/types/src/interfaces/runtime/Header.spec.ts index 11a353d272..d09f50848a 100644 --- a/packages/types/src/interfaces/runtime/Header.spec.ts +++ b/packages/types/src/interfaces/runtime/Header.spec.ts @@ -12,7 +12,7 @@ import block00300 from '@polkadot/types-support/json/SignedBlock.003.00.json' as import block00301 from '@polkadot/types-support/json/SignedBlock.003.01.json' assert { type: 'json' }; import { BN } from '@polkadot/util'; -import { TypeRegistry } from '../../create'; +import { TypeRegistry } from '../../create/index.js'; describe('Header', (): void => { const registry = new TypeRegistry(); diff --git a/packages/types/src/interfaces/runtime/KeyValue.spec.ts b/packages/types/src/interfaces/runtime/KeyValue.spec.ts index 3ce011c52d..f2e6c66f54 100644 --- a/packages/types/src/interfaces/runtime/KeyValue.spec.ts +++ b/packages/types/src/interfaces/runtime/KeyValue.spec.ts @@ -3,7 +3,7 @@ /// -import { TypeRegistry } from '../../create'; +import { TypeRegistry } from '../../create/index.js'; describe('KeyValue', (): void => { const registry = new TypeRegistry(); diff --git a/packages/types/src/interfaces/runtime/definitions.ts b/packages/types/src/interfaces/runtime/definitions.ts index e93488e8a3..b9e7b682ab 100644 --- a/packages/types/src/interfaces/runtime/definitions.ts +++ b/packages/types/src/interfaces/runtime/definitions.ts @@ -4,11 +4,11 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; import { objectSpread } from '@polkadot/util'; -import { runtime } from './runtime'; +import { runtime } from './runtime.js'; const numberTypes = { Fixed64: 'Int<64, Fixed64>', diff --git a/packages/types/src/interfaces/runtime/index.ts b/packages/types/src/interfaces/runtime/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/runtime/index.ts +++ b/packages/types/src/interfaces/runtime/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/runtime/runtime.ts b/packages/types/src/interfaces/runtime/runtime.ts index 681767281e..bac7f4c919 100644 --- a/packages/types/src/interfaces/runtime/runtime.ts +++ b/packages/types/src/interfaces/runtime/runtime.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsCall, DefinitionsCallEntry } from '../../types'; +import type { DefinitionsCall, DefinitionsCallEntry } from '../../types/index.js'; import { objectSpread } from '@polkadot/util'; diff --git a/packages/types/src/interfaces/scaleInfo/definitions.ts b/packages/types/src/interfaces/scaleInfo/definitions.ts index 805efa839f..cf13719d72 100644 --- a/packages/types/src/interfaces/scaleInfo/definitions.ts +++ b/packages/types/src/interfaces/scaleInfo/definitions.ts @@ -1,12 +1,12 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; import { objectSpread } from '@polkadot/util'; -import { v0 } from './v0'; -import { v1 } from './v1'; +import { v0 } from './v0.js'; +import { v1 } from './v1.js'; // order important in structs... :) /* eslint-disable sort-keys */ diff --git a/packages/types/src/interfaces/scaleInfo/index.ts b/packages/types/src/interfaces/scaleInfo/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/scaleInfo/index.ts +++ b/packages/types/src/interfaces/scaleInfo/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/scaleInfo/v0.ts b/packages/types/src/interfaces/scaleInfo/v0.ts index 5d7a65eadc..b5e09319a8 100644 --- a/packages/types/src/interfaces/scaleInfo/v0.ts +++ b/packages/types/src/interfaces/scaleInfo/v0.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsTypes } from '../../types'; +import type { DefinitionsTypes } from '../../types/index.js'; // order important in structs... :) /* eslint-disable sort-keys */ diff --git a/packages/types/src/interfaces/scaleInfo/v1.ts b/packages/types/src/interfaces/scaleInfo/v1.ts index 9e339bbae3..18363514d0 100644 --- a/packages/types/src/interfaces/scaleInfo/v1.ts +++ b/packages/types/src/interfaces/scaleInfo/v1.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsTypes } from '../../types'; +import type { DefinitionsTypes } from '../../types/index.js'; // order important in structs... :) /* eslint-disable sort-keys */ diff --git a/packages/types/src/interfaces/scheduler/definitions.ts b/packages/types/src/interfaces/scheduler/definitions.ts index 7150253e6a..1bc1558c77 100644 --- a/packages/types/src/interfaces/scheduler/definitions.ts +++ b/packages/types/src/interfaces/scheduler/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/scheduler/index.ts b/packages/types/src/interfaces/scheduler/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/scheduler/index.ts +++ b/packages/types/src/interfaces/scheduler/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/session/definitions.ts b/packages/types/src/interfaces/session/definitions.ts index 64dd80d39b..9c9b218c90 100644 --- a/packages/types/src/interfaces/session/definitions.ts +++ b/packages/types/src/interfaces/session/definitions.ts @@ -4,11 +4,11 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; import { objectSpread } from '@polkadot/util'; -import { runtime } from './runtime'; +import { runtime } from './runtime.js'; // The runtime definition of SessionKeys are passed as a Trait to session // Defined in `node/runtime/src/lib.rs` as follow diff --git a/packages/types/src/interfaces/session/index.ts b/packages/types/src/interfaces/session/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/session/index.ts +++ b/packages/types/src/interfaces/session/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/session/runtime.ts b/packages/types/src/interfaces/session/runtime.ts index 35e04003da..718c82e1ba 100644 --- a/packages/types/src/interfaces/session/runtime.ts +++ b/packages/types/src/interfaces/session/runtime.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsCall } from '../../types'; +import type { DefinitionsCall } from '../../types/index.js'; export const runtime: DefinitionsCall = { SessionKeys: [ diff --git a/packages/types/src/interfaces/society/definitions.ts b/packages/types/src/interfaces/society/definitions.ts index c711efcfbd..bb222bf117 100644 --- a/packages/types/src/interfaces/society/definitions.ts +++ b/packages/types/src/interfaces/society/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/society/index.ts b/packages/types/src/interfaces/society/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/society/index.ts +++ b/packages/types/src/interfaces/society/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/staking/CompactAssignments.spec.ts b/packages/types/src/interfaces/staking/CompactAssignments.spec.ts index 3405872ee5..9b2d9ba2b9 100644 --- a/packages/types/src/interfaces/staking/CompactAssignments.spec.ts +++ b/packages/types/src/interfaces/staking/CompactAssignments.spec.ts @@ -3,7 +3,7 @@ /// -import { TypeRegistry } from '../../create'; +import { TypeRegistry } from '../../create/index.js'; const ACTUAL = '0x' + // Vec diff --git a/packages/types/src/interfaces/staking/Exposure.spec.ts b/packages/types/src/interfaces/staking/Exposure.spec.ts index 5a5752f5ab..366e034ec7 100644 --- a/packages/types/src/interfaces/staking/Exposure.spec.ts +++ b/packages/types/src/interfaces/staking/Exposure.spec.ts @@ -3,7 +3,7 @@ /// -import { TypeRegistry } from '../../create'; +import { TypeRegistry } from '../../create/index.js'; describe('Exposure', (): void => { const registry = new TypeRegistry(); diff --git a/packages/types/src/interfaces/staking/definitions.ts b/packages/types/src/interfaces/staking/definitions.ts index 9f136d5599..4fc1ba7347 100644 --- a/packages/types/src/interfaces/staking/definitions.ts +++ b/packages/types/src/interfaces/staking/definitions.ts @@ -4,11 +4,11 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; import { objectSpread } from '@polkadot/util'; -import { runtime } from './runtime'; +import { runtime } from './runtime.js'; const deprecated = { Points: 'u32', diff --git a/packages/types/src/interfaces/staking/index.ts b/packages/types/src/interfaces/staking/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/staking/index.ts +++ b/packages/types/src/interfaces/staking/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/staking/runtime.ts b/packages/types/src/interfaces/staking/runtime.ts index 1be42aa93a..7ada9b0131 100644 --- a/packages/types/src/interfaces/staking/runtime.ts +++ b/packages/types/src/interfaces/staking/runtime.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsCall } from '../../types'; +import type { DefinitionsCall } from '../../types/index.js'; export const runtime: DefinitionsCall = { StakingApi: [ diff --git a/packages/types/src/interfaces/state/KeyValueOption.spec.ts b/packages/types/src/interfaces/state/KeyValueOption.spec.ts index d727bba192..8fadfee6fa 100644 --- a/packages/types/src/interfaces/state/KeyValueOption.spec.ts +++ b/packages/types/src/interfaces/state/KeyValueOption.spec.ts @@ -3,7 +3,7 @@ /// -import { TypeRegistry } from '../../create'; +import { TypeRegistry } from '../../create/index.js'; describe('KeyValueOption', (): void => { const registry = new TypeRegistry(); diff --git a/packages/types/src/interfaces/state/RuntimeVersion.spec.ts b/packages/types/src/interfaces/state/RuntimeVersion.spec.ts index 644d8cdf0a..61b68e5c63 100644 --- a/packages/types/src/interfaces/state/RuntimeVersion.spec.ts +++ b/packages/types/src/interfaces/state/RuntimeVersion.spec.ts @@ -5,11 +5,11 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ -import type { RuntimeVersion } from './types'; +import type { RuntimeVersion } from './types.js'; import rpc from '@polkadot/types-support/json/RuntimeVersion.002.json' assert { type: 'json' }; -import { TypeRegistry } from '../../create'; +import { TypeRegistry } from '../../create/index.js'; describe('RuntimeVersion', (): void => { const registry = new TypeRegistry(); diff --git a/packages/types/src/interfaces/state/definitions.ts b/packages/types/src/interfaces/state/definitions.ts index 7fe4badf7a..a8cede47b0 100644 --- a/packages/types/src/interfaces/state/definitions.ts +++ b/packages/types/src/interfaces/state/definitions.ts @@ -4,9 +4,9 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; -import { rpc } from './rpc'; +import { rpc } from './rpc.js'; export default { rpc, diff --git a/packages/types/src/interfaces/state/index.ts b/packages/types/src/interfaces/state/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/state/index.ts +++ b/packages/types/src/interfaces/state/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/state/rpc.ts b/packages/types/src/interfaces/state/rpc.ts index b03f28f0c9..152eb4ed90 100644 --- a/packages/types/src/interfaces/state/rpc.ts +++ b/packages/types/src/interfaces/state/rpc.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsRpc } from '../../types'; +import type { DefinitionsRpc } from '../../types/index.js'; export const rpc: DefinitionsRpc = { call: { diff --git a/packages/types/src/interfaces/support/definitions.ts b/packages/types/src/interfaces/support/definitions.ts index 96d798bd5d..054d231900 100644 --- a/packages/types/src/interfaces/support/definitions.ts +++ b/packages/types/src/interfaces/support/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/support/index.ts b/packages/types/src/interfaces/support/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/support/index.ts +++ b/packages/types/src/interfaces/support/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/syncstate/definitions.ts b/packages/types/src/interfaces/syncstate/definitions.ts index 436e421585..787c8c6fa0 100644 --- a/packages/types/src/interfaces/syncstate/definitions.ts +++ b/packages/types/src/interfaces/syncstate/definitions.ts @@ -4,9 +4,9 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; -import { rpc } from './rpc'; +import { rpc } from './rpc.js'; export default { rpc, diff --git a/packages/types/src/interfaces/syncstate/index.ts b/packages/types/src/interfaces/syncstate/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/syncstate/index.ts +++ b/packages/types/src/interfaces/syncstate/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/syncstate/rpc.ts b/packages/types/src/interfaces/syncstate/rpc.ts index 5a0b6886e5..cdc7cf589d 100644 --- a/packages/types/src/interfaces/syncstate/rpc.ts +++ b/packages/types/src/interfaces/syncstate/rpc.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsRpc } from '../../types'; +import type { DefinitionsRpc } from '../../types/index.js'; export const rpc: DefinitionsRpc = { genSyncSpec: { diff --git a/packages/types/src/interfaces/system/EventRecord.spec.ts b/packages/types/src/interfaces/system/EventRecord.spec.ts index a7d9117d84..2328f835a1 100644 --- a/packages/types/src/interfaces/system/EventRecord.spec.ts +++ b/packages/types/src/interfaces/system/EventRecord.spec.ts @@ -10,8 +10,8 @@ import json1 from '@polkadot/types-support/json/EventRecord.001.json' assert { t import json3 from '@polkadot/types-support/json/EventRecord.003.json' assert { type: 'json' }; import rpcMetadata from '@polkadot/types-support/metadata/static-substrate'; -import { TypeRegistry } from '../../create'; -import { Metadata } from '../../metadata'; +import { TypeRegistry } from '../../create/index.js'; +import { Metadata } from '../../metadata/index.js'; describe('EventRecord', (): void => { const registry = new TypeRegistry(); diff --git a/packages/types/src/interfaces/system/definitions.ts b/packages/types/src/interfaces/system/definitions.ts index 3aa7231319..a5218255a8 100644 --- a/packages/types/src/interfaces/system/definitions.ts +++ b/packages/types/src/interfaces/system/definitions.ts @@ -4,10 +4,10 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; -import { rpc } from './rpc'; -import { runtime } from './runtime'; +import { rpc } from './rpc.js'; +import { runtime } from './runtime.js'; export default { rpc, diff --git a/packages/types/src/interfaces/system/index.ts b/packages/types/src/interfaces/system/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/system/index.ts +++ b/packages/types/src/interfaces/system/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/system/rpc.ts b/packages/types/src/interfaces/system/rpc.ts index 3efa92cb43..a650c79f31 100644 --- a/packages/types/src/interfaces/system/rpc.ts +++ b/packages/types/src/interfaces/system/rpc.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsRpc } from '../../types'; +import type { DefinitionsRpc } from '../../types/index.js'; export const rpc: DefinitionsRpc = { accountNextIndex: { diff --git a/packages/types/src/interfaces/system/runtime.ts b/packages/types/src/interfaces/system/runtime.ts index 58dcd394a9..2f68aaa40f 100644 --- a/packages/types/src/interfaces/system/runtime.ts +++ b/packages/types/src/interfaces/system/runtime.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsCall } from '../../types'; +import type { DefinitionsCall } from '../../types/index.js'; export const runtime: DefinitionsCall = { AccountNonceApi: [ diff --git a/packages/types/src/interfaces/treasury/definitions.ts b/packages/types/src/interfaces/treasury/definitions.ts index 0bdb1ca302..a30004019b 100644 --- a/packages/types/src/interfaces/treasury/definitions.ts +++ b/packages/types/src/interfaces/treasury/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/treasury/index.ts b/packages/types/src/interfaces/treasury/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/treasury/index.ts +++ b/packages/types/src/interfaces/treasury/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/txpayment/definitions.ts b/packages/types/src/interfaces/txpayment/definitions.ts index d2a2fd8b9b..495cd7ee92 100644 --- a/packages/types/src/interfaces/txpayment/definitions.ts +++ b/packages/types/src/interfaces/txpayment/definitions.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/txpayment/index.ts b/packages/types/src/interfaces/txpayment/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/txpayment/index.ts +++ b/packages/types/src/interfaces/txpayment/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/txqueue/definitions.ts b/packages/types/src/interfaces/txqueue/definitions.ts index 3c7ede317a..a88ee758ab 100644 --- a/packages/types/src/interfaces/txqueue/definitions.ts +++ b/packages/types/src/interfaces/txqueue/definitions.ts @@ -4,9 +4,9 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; -import { runtime } from './runtime'; +import { runtime } from './runtime.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/txqueue/index.ts b/packages/types/src/interfaces/txqueue/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/txqueue/index.ts +++ b/packages/types/src/interfaces/txqueue/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/txqueue/runtime.ts b/packages/types/src/interfaces/txqueue/runtime.ts index fecaa4af1f..812868e2e1 100644 --- a/packages/types/src/interfaces/txqueue/runtime.ts +++ b/packages/types/src/interfaces/txqueue/runtime.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsCall } from '../../types'; +import type { DefinitionsCall } from '../../types/index.js'; export const runtime: DefinitionsCall = { TaggedTransactionQueue: [ diff --git a/packages/types/src/interfaces/types.ts b/packages/types/src/interfaces/types.ts index d73c1a5018..bb6eb8d7e9 100644 --- a/packages/types/src/interfaces/types.ts +++ b/packages/types/src/interfaces/types.ts @@ -1,72 +1,72 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './assets/types'; -export * from './attestations/types'; -export * from './aura/types'; -export * from './author/types'; -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'; -export * from './claims/types'; -export * from './collective/types'; -export * from './consensus/types'; -export * from './contracts/types'; -export * from './contractsAbi/types'; -export * from './crowdloan/types'; -export * from './cumulus/types'; -export * from './democracy/types'; -export * from './dev/types'; -export * from './discovery/types'; -export * from './elections/types'; -export * from './engine/types'; -export * from './eth/types'; -export * from './evm/types'; -export * from './extrinsics/types'; -export * from './finality/types'; -export * from './genericAsset/types'; -export * from './gilt/types'; -export * from './grandpa/types'; -export * from './identity/types'; -export * from './imOnline/types'; -export * from './lottery/types'; -export * from './metadata/types'; -export * from './mmr/types'; -export * from './nfts/types'; -export * from './nimbus/types'; -export * from './nompools/types'; -export * from './offchain/types'; -export * from './offences/types'; -export * from './ormlOracle/types'; -export * from './ormlTokens/types'; -export * from './parachains/types'; -export * from './payment/types'; -export * from './poll/types'; -export * from './pow/types'; -export * from './proxy/types'; -export * from './purchase/types'; -export * from './recovery/types'; -export * from './rpc/types'; -export * from './runtime/types'; -export * from './scaleInfo/types'; -export * from './scheduler/types'; -export * from './session/types'; -export * from './society/types'; -export * from './staking/types'; -export * from './state/types'; -export * from './support/types'; -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'; -export * from './xcm/types'; +export * from './assets/types.js'; +export * from './attestations/types.js'; +export * from './aura/types.js'; +export * from './author/types.js'; +export * from './authorship/types.js'; +export * from './babe/types.js'; +export * from './balances/types.js'; +export * from './beefy/types.js'; +export * from './benchmark/types.js'; +export * from './blockbuilder/types.js'; +export * from './bridges/types.js'; +export * from './chain/types.js'; +export * from './childstate/types.js'; +export * from './claims/types.js'; +export * from './collective/types.js'; +export * from './consensus/types.js'; +export * from './contracts/types.js'; +export * from './contractsAbi/types.js'; +export * from './crowdloan/types.js'; +export * from './cumulus/types.js'; +export * from './democracy/types.js'; +export * from './dev/types.js'; +export * from './discovery/types.js'; +export * from './elections/types.js'; +export * from './engine/types.js'; +export * from './eth/types.js'; +export * from './evm/types.js'; +export * from './extrinsics/types.js'; +export * from './finality/types.js'; +export * from './genericAsset/types.js'; +export * from './gilt/types.js'; +export * from './grandpa/types.js'; +export * from './identity/types.js'; +export * from './imOnline/types.js'; +export * from './lottery/types.js'; +export * from './metadata/types.js'; +export * from './mmr/types.js'; +export * from './nfts/types.js'; +export * from './nimbus/types.js'; +export * from './nompools/types.js'; +export * from './offchain/types.js'; +export * from './offences/types.js'; +export * from './ormlOracle/types.js'; +export * from './ormlTokens/types.js'; +export * from './parachains/types.js'; +export * from './payment/types.js'; +export * from './poll/types.js'; +export * from './pow/types.js'; +export * from './proxy/types.js'; +export * from './purchase/types.js'; +export * from './recovery/types.js'; +export * from './rpc/types.js'; +export * from './runtime/types.js'; +export * from './scaleInfo/types.js'; +export * from './scheduler/types.js'; +export * from './session/types.js'; +export * from './society/types.js'; +export * from './staking/types.js'; +export * from './state/types.js'; +export * from './support/types.js'; +export * from './syncstate/types.js'; +export * from './system/types.js'; +export * from './treasury/types.js'; +export * from './txpayment/types.js'; +export * from './txqueue/types.js'; +export * from './uniques/types.js'; +export * from './utility/types.js'; +export * from './vesting/types.js'; +export * from './xcm/types.js'; diff --git a/packages/types/src/interfaces/uniques/definitions.ts b/packages/types/src/interfaces/uniques/definitions.ts index fff2dbfc2e..326e4699d4 100644 --- a/packages/types/src/interfaces/uniques/definitions.ts +++ b/packages/types/src/interfaces/uniques/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/uniques/index.ts b/packages/types/src/interfaces/uniques/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/uniques/index.ts +++ b/packages/types/src/interfaces/uniques/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/utility/definitions.ts b/packages/types/src/interfaces/utility/definitions.ts index f5dff9b5cd..da2409b4b5 100644 --- a/packages/types/src/interfaces/utility/definitions.ts +++ b/packages/types/src/interfaces/utility/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/utility/index.ts b/packages/types/src/interfaces/utility/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/utility/index.ts +++ b/packages/types/src/interfaces/utility/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/vesting/definitions.ts b/packages/types/src/interfaces/vesting/definitions.ts index 9727bb782b..15ba4a29b8 100644 --- a/packages/types/src/interfaces/vesting/definitions.ts +++ b/packages/types/src/interfaces/vesting/definitions.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; export default { rpc: {}, diff --git a/packages/types/src/interfaces/vesting/index.ts b/packages/types/src/interfaces/vesting/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/vesting/index.ts +++ b/packages/types/src/interfaces/vesting/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/xcm/definitions.ts b/packages/types/src/interfaces/xcm/definitions.ts index c8e66248eb..f24f2cd967 100644 --- a/packages/types/src/interfaces/xcm/definitions.ts +++ b/packages/types/src/interfaces/xcm/definitions.ts @@ -4,14 +4,14 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { Definitions } from '../../types'; +import type { Definitions } from '../../types/index.js'; import { mapXcmTypes } from '@polkadot/types-create'; import { objectSpread } from '@polkadot/util'; -import { v0 } from './v0'; -import { v1 } from './v1'; -import { v2 } from './v2'; +import { v0 } from './v0.js'; +import { v1 } from './v1.js'; +import { v2 } from './v2.js'; const XCM_LATEST = 'V2'; diff --git a/packages/types/src/interfaces/xcm/index.ts b/packages/types/src/interfaces/xcm/index.ts index 2d307291c3..7f1de782f7 100644 --- a/packages/types/src/interfaces/xcm/index.ts +++ b/packages/types/src/interfaces/xcm/index.ts @@ -1,4 +1,4 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './types'; +export * from './types.js'; diff --git a/packages/types/src/interfaces/xcm/v0.ts b/packages/types/src/interfaces/xcm/v0.ts index 7de381dceb..d9204f8b92 100644 --- a/packages/types/src/interfaces/xcm/v0.ts +++ b/packages/types/src/interfaces/xcm/v0.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { DefinitionsTypes } from '../../types'; +import type { DefinitionsTypes } from '../../types/index.js'; export const v0: DefinitionsTypes = { FungibilityV0: 'FungibilityV1', diff --git a/packages/types/src/interfaces/xcm/v1.ts b/packages/types/src/interfaces/xcm/v1.ts index aa08e7a5d6..298df0bd15 100644 --- a/packages/types/src/interfaces/xcm/v1.ts +++ b/packages/types/src/interfaces/xcm/v1.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { DefinitionsTypes } from '../../types'; +import type { DefinitionsTypes } from '../../types/index.js'; export const v1: DefinitionsTypes = { AssetInstanceV1: { diff --git a/packages/types/src/interfaces/xcm/v2.ts b/packages/types/src/interfaces/xcm/v2.ts index 98c5a296e8..0cba1db982 100644 --- a/packages/types/src/interfaces/xcm/v2.ts +++ b/packages/types/src/interfaces/xcm/v2.ts @@ -4,7 +4,7 @@ // order important in structs... :) /* eslint-disable sort-keys */ -import type { DefinitionsTypes } from '../../types'; +import type { DefinitionsTypes } from '../../types/index.js'; export const v2: DefinitionsTypes = { AssetInstanceV2: 'AssetInstanceV1', diff --git a/packages/types/src/metadata/MagicNumber.spec.ts b/packages/types/src/metadata/MagicNumber.spec.ts index e4433d9c20..9dc047db8e 100644 --- a/packages/types/src/metadata/MagicNumber.spec.ts +++ b/packages/types/src/metadata/MagicNumber.spec.ts @@ -3,8 +3,8 @@ /// -import { TypeRegistry } from '../create'; -import { MAGIC_NUMBER, MagicNumber } from './MagicNumber'; +import { TypeRegistry } from '../create/index.js'; +import { MAGIC_NUMBER, MagicNumber } from './MagicNumber.js'; describe('MagicNumber', (): void => { const registry = new TypeRegistry(); diff --git a/packages/types/src/metadata/Metadata.spec.ts b/packages/types/src/metadata/Metadata.spec.ts index 868dc3ac8e..37827bd099 100644 --- a/packages/types/src/metadata/Metadata.spec.ts +++ b/packages/types/src/metadata/Metadata.spec.ts @@ -9,8 +9,8 @@ import kusama from '@polkadot/types-support/metadata/static-kusama'; import polkadot from '@polkadot/types-support/metadata/static-polkadot'; import substrate from '@polkadot/types-support/metadata/static-substrate'; -import { TypeRegistry } from '../create'; -import { Metadata } from './Metadata'; +import { TypeRegistry } from '../create/index.js'; +import { Metadata } from './Metadata.js'; const allData: Record = { kusama, diff --git a/packages/types/src/metadata/Metadata.ts b/packages/types/src/metadata/Metadata.ts index 2f46193227..97fc17852e 100644 --- a/packages/types/src/metadata/Metadata.ts +++ b/packages/types/src/metadata/Metadata.ts @@ -6,7 +6,7 @@ import type { HexString } from '@polkadot/util/types'; import { isString, isU8a, u8aToU8a } from '@polkadot/util'; -import { MetadataVersioned } from './MetadataVersioned'; +import { MetadataVersioned } from './MetadataVersioned.js'; // magic + lowest supported version const EMPTY_METADATA = new Uint8Array([0x6d, 0x65, 0x74, 0x61, 9]); diff --git a/packages/types/src/metadata/MetadataVersioned.ts b/packages/types/src/metadata/MetadataVersioned.ts index a50ac78e64..c7336d4609 100644 --- a/packages/types/src/metadata/MetadataVersioned.ts +++ b/packages/types/src/metadata/MetadataVersioned.ts @@ -3,19 +3,19 @@ import type { AnyJson } from '@polkadot/types-codec/types'; import type { HexString } from '@polkadot/util/types'; -import type { MetadataAll, MetadataLatest, MetadataV9, MetadataV10, MetadataV11, MetadataV12, MetadataV13, MetadataV14 } from '../interfaces/metadata'; -import type { Registry } from '../types'; +import type { MetadataAll, MetadataLatest, MetadataV9, MetadataV10, MetadataV11, MetadataV12, MetadataV13, MetadataV14 } from '../interfaces/metadata/index.js'; +import type { Registry } from '../types/index.js'; import { Struct } from '@polkadot/types-codec'; -import { toV10 } from './v9/toV10'; -import { toV11 } from './v10/toV11'; -import { toV12 } from './v11/toV12'; -import { toV13 } from './v12/toV13'; -import { toV14 } from './v13/toV14'; -import { toLatest } from './v14/toLatest'; -import { MagicNumber } from './MagicNumber'; -import { getUniqTypes, toCallsOnly } from './util'; +import { getUniqTypes, toCallsOnly } from './util/index.js'; +import { toV10 } from './v9/toV10.js'; +import { toV11 } from './v10/toV11.js'; +import { toV12 } from './v11/toV12.js'; +import { toV13 } from './v12/toV13.js'; +import { toV14 } from './v13/toV14.js'; +import { toLatest } from './v14/toLatest.js'; +import { MagicNumber } from './MagicNumber.js'; // Use these to generate all the Meta* types below via template keys // NOTE: Keep from latest -> earliest, see the LATEST_VERSION 0 index diff --git a/packages/types/src/metadata/PortableRegistry/PortableRegistry.Range.spec.ts b/packages/types/src/metadata/PortableRegistry/PortableRegistry.Range.spec.ts index d0d3d73515..e2c5ca8820 100644 --- a/packages/types/src/metadata/PortableRegistry/PortableRegistry.Range.spec.ts +++ b/packages/types/src/metadata/PortableRegistry/PortableRegistry.Range.spec.ts @@ -3,8 +3,8 @@ /// -import { TypeRegistry } from '../../create'; -import { PortableRegistry } from '.'; +import { TypeRegistry } from '../../create/index.js'; +import { PortableRegistry } from './index.js'; const registry = new TypeRegistry(); const types = [ diff --git a/packages/types/src/metadata/PortableRegistry/PortableRegistry.ts b/packages/types/src/metadata/PortableRegistry/PortableRegistry.ts index e1e6b62e02..7687403a61 100644 --- a/packages/types/src/metadata/PortableRegistry/PortableRegistry.ts +++ b/packages/types/src/metadata/PortableRegistry/PortableRegistry.ts @@ -4,7 +4,7 @@ import type { Option, Text, Type, Vec } from '@polkadot/types-codec'; import type { AnyString, LookupString, Registry } from '@polkadot/types-codec/types'; import type { ILookup, TypeDef } from '@polkadot/types-create/types'; -import type { PortableType } from '../../interfaces/metadata'; +import type { PortableType } from '../../interfaces/metadata/index.js'; import type { SiField, SiLookupTypeId, SiType, SiTypeDefArray, SiTypeDefBitSequence, SiTypeDefCompact, SiTypeDefComposite, SiTypeDefSequence, SiTypeDefTuple, SiTypeDefVariant, SiTypeParameter, SiVariant } from '../../interfaces/scaleInfo'; import { sanitize, Struct, u32 } from '@polkadot/types-codec'; diff --git a/packages/types/src/metadata/PortableRegistry/index.ts b/packages/types/src/metadata/PortableRegistry/index.ts index 7b4f4af9b2..d7eacbabaa 100644 --- a/packages/types/src/metadata/PortableRegistry/index.ts +++ b/packages/types/src/metadata/PortableRegistry/index.ts @@ -1,5 +1,5 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -export { PortableRegistry } from './PortableRegistry'; -export { toV1 as convertSiV0toV1 } from './toV1'; +export { PortableRegistry } from './PortableRegistry.js'; +export { toV1 as convertSiV0toV1 } from './toV1.js'; diff --git a/packages/types/src/metadata/PortableRegistry/toV1.ts b/packages/types/src/metadata/PortableRegistry/toV1.ts index 304f410783..70d37882bb 100644 --- a/packages/types/src/metadata/PortableRegistry/toV1.ts +++ b/packages/types/src/metadata/PortableRegistry/toV1.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { PortableType, Si0Field, Si0LookupTypeId, Si0Path, Si0Type, Si0TypeDefArray, Si0TypeDefBitSequence, Si0TypeDefComposite, Si0TypeDefPrimitive, Si0TypeDefSequence, Si0TypeDefVariant, Si1Field, Si1TypeDef, SiTypeDef } from '../../interfaces'; -import type { Registry } from '../../types'; +import type { Registry } from '../../types/index.js'; import { assertUnreachable } from '@polkadot/util'; diff --git a/packages/types/src/metadata/decorate/constants/index.spec.ts b/packages/types/src/metadata/decorate/constants/index.spec.ts index 6f12fe32ce..f25880221c 100644 --- a/packages/types/src/metadata/decorate/constants/index.spec.ts +++ b/packages/types/src/metadata/decorate/constants/index.spec.ts @@ -5,14 +5,14 @@ import type { HexString } from '@polkadot/util/types'; import type { BlockNumber } from '../../../interfaces'; -import type { Constants } from '../types'; +import type { Constants } from '../types.js'; import rpcMetadata from '@polkadot/types-support/metadata/static-substrate'; import rpcMetadataV10 from '@polkadot/types-support/metadata/v10/substrate-hex'; -import { TypeRegistry } from '../../../create'; -import { Metadata } from '../../Metadata'; -import { decorateConstants } from '..'; +import { TypeRegistry } from '../../../create/index.js'; +import { Metadata } from '../../Metadata.js'; +import { decorateConstants } from '../index.js'; function init (meta: HexString): [Constants, TypeRegistry] { const registry = new TypeRegistry(); diff --git a/packages/types/src/metadata/decorate/constants/index.ts b/packages/types/src/metadata/decorate/constants/index.ts index ea90f9ab80..9f7e2362e5 100644 --- a/packages/types/src/metadata/decorate/constants/index.ts +++ b/packages/types/src/metadata/decorate/constants/index.ts @@ -3,11 +3,11 @@ import type { Registry } from '@polkadot/types-codec/types'; import type { MetadataLatest, PalletConstantMetadataLatest } from '../../../interfaces'; -import type { ConstantCodec, Constants } from '../types'; +import type { ConstantCodec, Constants } from '../types.js'; import { hexToU8a, lazyMethod, lazyMethods, stringCamelCase } from '@polkadot/util'; -import { objectNameToCamel } from '../util'; +import { objectNameToCamel } from '../util.js'; /** @internal */ // eslint-disable-next-line @typescript-eslint/no-unused-vars diff --git a/packages/types/src/metadata/decorate/errors/index.spec.ts b/packages/types/src/metadata/decorate/errors/index.spec.ts index 57aaf5382b..bad97cd6c4 100644 --- a/packages/types/src/metadata/decorate/errors/index.spec.ts +++ b/packages/types/src/metadata/decorate/errors/index.spec.ts @@ -5,9 +5,9 @@ import rpcMetadata from '@polkadot/types-support/metadata/static-substrate'; -import { TypeRegistry } from '../../../create'; -import { Metadata } from '../../Metadata'; -import { decorateErrors } from '..'; +import { TypeRegistry } from '../../../create/index.js'; +import { Metadata } from '../../Metadata.js'; +import { decorateErrors } from '../index.js'; const registry = new TypeRegistry(); const metadata = new Metadata(registry, rpcMetadata); diff --git a/packages/types/src/metadata/decorate/errors/index.ts b/packages/types/src/metadata/decorate/errors/index.ts index e3849d0e4c..358e6f57c9 100644 --- a/packages/types/src/metadata/decorate/errors/index.ts +++ b/packages/types/src/metadata/decorate/errors/index.ts @@ -5,12 +5,12 @@ import type { Text, u8 } from '@polkadot/types-codec'; import type { Registry } from '@polkadot/types-codec/types'; import type { DispatchErrorModule, DispatchErrorModuleU8, DispatchErrorModuleU8a, MetadataLatest, SiField, SiVariant } from '../../../interfaces'; import type { PortableRegistry } from '../../../metadata'; -import type { Errors, IsError } from '../types'; +import type { Errors, IsError } from '../types.js'; import { isCodec, isU8a, lazyMethod, objectSpread, stringCamelCase } from '@polkadot/util'; -import { lazyVariants } from '../../../create/lazy'; -import { objectNameToString } from '../util'; +import { lazyVariants } from '../../../create/lazy.js'; +import { objectNameToString } from '../util.js'; interface ItemMeta { args: string[]; diff --git a/packages/types/src/metadata/decorate/events/index.spec.ts b/packages/types/src/metadata/decorate/events/index.spec.ts index 6079b5f2d6..7ba8bbb96c 100644 --- a/packages/types/src/metadata/decorate/events/index.spec.ts +++ b/packages/types/src/metadata/decorate/events/index.spec.ts @@ -5,9 +5,9 @@ import rpcMetadata from '@polkadot/types-support/metadata/static-substrate'; -import { TypeRegistry } from '../../../create'; -import { Metadata } from '../../Metadata'; -import { decorateEvents } from '..'; +import { TypeRegistry } from '../../../create/index.js'; +import { Metadata } from '../../Metadata.js'; +import { decorateEvents } from '../index.js'; const registry = new TypeRegistry(); const metadata = new Metadata(registry, rpcMetadata); diff --git a/packages/types/src/metadata/decorate/events/index.ts b/packages/types/src/metadata/decorate/events/index.ts index 1e8f20dfe4..995ca21ad6 100644 --- a/packages/types/src/metadata/decorate/events/index.ts +++ b/packages/types/src/metadata/decorate/events/index.ts @@ -3,14 +3,14 @@ import type { AnyTuple, Registry } from '@polkadot/types-codec/types'; import type { MetadataLatest, PalletMetadataLatest, SiVariant } from '../../../interfaces'; -import type { IEvent, IEventLike } from '../../../types'; -import type { Events, IsEvent } from '../types'; +import type { IEvent, IEventLike } from '../../../types/index.js'; +import type { Events, IsEvent } from '../types.js'; import { isCodec, isU8a, lazyMethod, stringCamelCase } from '@polkadot/util'; -import { lazyVariants } from '../../../create/lazy'; -import { variantToMeta } from '../errors'; -import { objectNameToString } from '../util'; +import { lazyVariants } from '../../../create/lazy.js'; +import { variantToMeta } from '../errors/index.js'; +import { objectNameToString } from '../util.js'; export function filterEventsSome ({ events }: PalletMetadataLatest): boolean { return events.isSome; diff --git a/packages/types/src/metadata/decorate/extrinsics/createUnchecked.ts b/packages/types/src/metadata/decorate/extrinsics/createUnchecked.ts index 40f8c619ae..2d72a772f0 100644 --- a/packages/types/src/metadata/decorate/extrinsics/createUnchecked.ts +++ b/packages/types/src/metadata/decorate/extrinsics/createUnchecked.ts @@ -3,7 +3,7 @@ import type { AnyJson, AnyTuple, Registry } from '@polkadot/types-codec/types'; import type { Call, FunctionMetadataLatest } from '../../../interfaces'; -import type { CallFunction, IMethod } from '../../../types'; +import type { CallFunction, IMethod } from '../../../types/index.js'; import { stringCamelCase } from '@polkadot/util'; diff --git a/packages/types/src/metadata/decorate/extrinsics/index.spec.ts b/packages/types/src/metadata/decorate/extrinsics/index.spec.ts index ca7822c29f..0bc0ee235b 100644 --- a/packages/types/src/metadata/decorate/extrinsics/index.spec.ts +++ b/packages/types/src/metadata/decorate/extrinsics/index.spec.ts @@ -7,9 +7,9 @@ import { createTestPairs } from '@polkadot/keyring/testingPairs'; import metadataStatic from '@polkadot/types-support/metadata/v13/substrate-hex'; import { BN } from '@polkadot/util'; -import { TypeRegistry } from '../../../create'; -import { Metadata } from '../../Metadata'; -import { decorateExtrinsics } from '..'; +import { TypeRegistry } from '../../../create/index.js'; +import { Metadata } from '../../Metadata.js'; +import { decorateExtrinsics } from './index.js'; const keyring = createTestPairs({ type: 'ed25519' }, false); const registry = new TypeRegistry(); diff --git a/packages/types/src/metadata/decorate/extrinsics/index.ts b/packages/types/src/metadata/decorate/extrinsics/index.ts index 2763e10ec5..0c115e00b3 100644 --- a/packages/types/src/metadata/decorate/extrinsics/index.ts +++ b/packages/types/src/metadata/decorate/extrinsics/index.ts @@ -4,15 +4,15 @@ import type { Registry } from '@polkadot/types-codec/types'; import type { MetadataLatest, PalletMetadataLatest, SiVariant } from '../../../interfaces'; import type { PortableRegistry } from '../../../metadata'; -import type { CallFunction } from '../../../types'; -import type { Extrinsics } from '../types'; +import type { CallFunction } from '../../../types/index.js'; +import type { Extrinsics } from '../types.js'; import { lazyMethod, objectSpread, stringCamelCase } from '@polkadot/util'; -import { lazyVariants } from '../../../create/lazy'; -import { getSiName } from '../../util'; -import { objectNameToCamel } from '../util'; -import { createUnchecked } from './createUnchecked'; +import { lazyVariants } from '../../../create/lazy.js'; +import { getSiName } from '../../util/index.js'; +import { objectNameToCamel } from '../util.js'; +import { createUnchecked } from './createUnchecked.js'; export function filterCallsSome ({ calls }: PalletMetadataLatest): boolean { return calls.isSome; diff --git a/packages/types/src/metadata/decorate/index.spec.ts b/packages/types/src/metadata/decorate/index.spec.ts index 190fc9a97e..913cb6dacc 100644 --- a/packages/types/src/metadata/decorate/index.spec.ts +++ b/packages/types/src/metadata/decorate/index.spec.ts @@ -7,9 +7,9 @@ import { u32 } from '@polkadot/types-codec'; import json from '@polkadot/types-support/metadata/static-substrate'; import { u8aToHex } from '@polkadot/util'; -import { TypeRegistry } from '../../create'; -import { Metadata } from '../Metadata'; -import { decorateConstants, decorateExtrinsics, decorateStorage } from './'; +import { TypeRegistry } from '../../create/index.js'; +import { Metadata } from '../Metadata.js'; +import { decorateConstants, decorateExtrinsics, decorateStorage } from './index.js'; const registry = new TypeRegistry(); const metadata = new Metadata(registry, json); diff --git a/packages/types/src/metadata/decorate/index.ts b/packages/types/src/metadata/decorate/index.ts index 05b10313f9..647cfe8bef 100644 --- a/packages/types/src/metadata/decorate/index.ts +++ b/packages/types/src/metadata/decorate/index.ts @@ -2,14 +2,14 @@ // SPDX-License-Identifier: Apache-2.0 import type { Registry } from '@polkadot/types-codec/types'; -import type { DecoratedMeta } from './types'; +import type { DecoratedMeta } from './types.js'; -import { Metadata } from '../Metadata'; -import { decorateConstants } from './constants'; -import { decorateErrors } from './errors'; -import { decorateEvents, filterEventsSome } from './events'; -import { decorateExtrinsics, filterCallsSome } from './extrinsics'; -import { decorateStorage } from './storage'; +import { Metadata } from '../Metadata.js'; +import { decorateConstants } from './constants/index.js'; +import { decorateErrors } from './errors/index.js'; +import { decorateEvents, filterEventsSome } from './events/index.js'; +import { decorateExtrinsics, filterCallsSome } from './extrinsics/index.js'; +import { decorateStorage } from './storage/index.js'; /** * Expands the metadata by decoration into consts, query and tx sections diff --git a/packages/types/src/metadata/decorate/storage/createFunction.spec.ts b/packages/types/src/metadata/decorate/storage/createFunction.spec.ts index 6084d68f37..e64d000d41 100644 --- a/packages/types/src/metadata/decorate/storage/createFunction.spec.ts +++ b/packages/types/src/metadata/decorate/storage/createFunction.spec.ts @@ -5,9 +5,9 @@ import { u8aToHex } from '@polkadot/util'; -import { TypeRegistry } from '../../../create'; -import { Metadata } from '../../Metadata'; -import { createFunction } from './createFunction'; +import { TypeRegistry } from '../../../create/index.js'; +import { Metadata } from '../../Metadata.js'; +import { createFunction } from './createFunction.js'; describe('createFunction', (): void => { const registry = new TypeRegistry(); diff --git a/packages/types/src/metadata/decorate/storage/createFunction.ts b/packages/types/src/metadata/decorate/storage/createFunction.ts index 8af2057279..d007dd46e6 100644 --- a/packages/types/src/metadata/decorate/storage/createFunction.ts +++ b/packages/types/src/metadata/decorate/storage/createFunction.ts @@ -2,17 +2,17 @@ // SPDX-License-Identifier: Apache-2.0 import type { ICompact, Inspect, INumber } from '@polkadot/types-codec/types'; -import type { StorageEntryMetadataLatest, StorageHasher } from '../../../interfaces/metadata'; -import type { StorageEntry, StorageEntryIterator } from '../../../primitive/types'; -import type { Registry } from '../../../types'; +import type { StorageEntryMetadataLatest, StorageHasher } from '../../../interfaces/metadata/index.js'; +import type { StorageEntry, StorageEntryIterator } from '../../../primitive/types.js'; +import type { Registry } from '../../../types/index.js'; import { Raw } from '@polkadot/types-codec'; import { compactAddLength, compactStripLength, isUndefined, objectSpread, stringCamelCase, u8aConcat, u8aToU8a } from '@polkadot/util'; import { xxhashAsU8a } from '@polkadot/util-crypto'; -import { StorageKey } from '../../../primitive'; -import { getSiName } from '../../util'; -import { getHasher } from './getHasher'; +import { StorageKey } from '../../../primitive/index.js'; +import { getSiName } from '../../util/index.js'; +import { getHasher } from './getHasher.js'; export interface CreateItemOptions { key?: Uint8Array | string; diff --git a/packages/types/src/metadata/decorate/storage/getHasher.spec.ts b/packages/types/src/metadata/decorate/storage/getHasher.spec.ts index 826270e6ca..f6638826bf 100644 --- a/packages/types/src/metadata/decorate/storage/getHasher.spec.ts +++ b/packages/types/src/metadata/decorate/storage/getHasher.spec.ts @@ -6,8 +6,8 @@ import { stringToU8a } from '@polkadot/util'; import { xxhashAsU8a } from '@polkadot/util-crypto'; -import { TypeRegistry } from '../../../create'; -import { getHasher } from './getHasher'; +import { TypeRegistry } from '../../../create/index.js'; +import { getHasher } from './getHasher.js'; describe('getHasher', (): void => { const registry = new TypeRegistry(); diff --git a/packages/types/src/metadata/decorate/storage/getHasher.ts b/packages/types/src/metadata/decorate/storage/getHasher.ts index dfc1a82089..bf2c5bfee1 100644 --- a/packages/types/src/metadata/decorate/storage/getHasher.ts +++ b/packages/types/src/metadata/decorate/storage/getHasher.ts @@ -1,8 +1,8 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { StorageHasher } from '../../../interfaces'; -import type { AllHashers } from '../../../interfaces/metadata/definitions'; +import type { StorageHasher } from '../../../interfaces/index.js'; +import type { AllHashers } from '../../../interfaces/metadata/definitions.js'; import { u8aConcat, u8aToU8a } from '@polkadot/util'; import { blake2AsU8a, xxhashAsU8a } from '@polkadot/util-crypto'; diff --git a/packages/types/src/metadata/decorate/storage/getStorage.spec.ts b/packages/types/src/metadata/decorate/storage/getStorage.spec.ts index 11ebb8070e..c6f13164f9 100644 --- a/packages/types/src/metadata/decorate/storage/getStorage.spec.ts +++ b/packages/types/src/metadata/decorate/storage/getStorage.spec.ts @@ -6,9 +6,9 @@ import metadataStatic from '@polkadot/types-support/metadata/static-substrate'; import { compactAddLength, u8aToU8a } from '@polkadot/util'; -import { TypeRegistry } from '../../../create'; -import { Metadata } from '../../Metadata'; -import { getStorage } from './getStorage'; +import { TypeRegistry } from '../../../create/index.js'; +import { Metadata } from '../../Metadata.js'; +import { getStorage } from './getStorage.js'; const registry = new TypeRegistry(); const metadata = new Metadata(registry, metadataStatic); diff --git a/packages/types/src/metadata/decorate/storage/getStorage.ts b/packages/types/src/metadata/decorate/storage/getStorage.ts index 4edd0d8b51..1d008f8a74 100644 --- a/packages/types/src/metadata/decorate/storage/getStorage.ts +++ b/packages/types/src/metadata/decorate/storage/getStorage.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import type { Registry } from '@polkadot/types-codec/types'; -import type { StorageEntry } from '../../../primitive/types'; -import type { Storage } from '../types'; +import type { StorageEntry } from '../../../primitive/types.js'; +import type { Storage } from '../types.js'; -import { substrate } from './substrate'; +import { substrate } from './substrate.js'; /** @internal */ export function getStorage (registry: Registry): Storage { diff --git a/packages/types/src/metadata/decorate/storage/index.spec.ts b/packages/types/src/metadata/decorate/storage/index.spec.ts index 9cc3e2accb..f3f6e61213 100644 --- a/packages/types/src/metadata/decorate/storage/index.spec.ts +++ b/packages/types/src/metadata/decorate/storage/index.spec.ts @@ -8,9 +8,9 @@ import rpcMetadata from '@polkadot/types-support/metadata/static-substrate'; import { u8aToHex } from '@polkadot/util'; import { xxhashAsHex } from '@polkadot/util-crypto'; -import { TypeRegistry } from '../../../create'; -import { Metadata } from '../../'; -import { decorateStorage } from '..'; +import { TypeRegistry } from '../../../create/index.js'; +import { Metadata } from '../../index.js'; +import { decorateStorage } from '../index.js'; const keyring = createTestPairs({ type: 'ed25519' }); diff --git a/packages/types/src/metadata/decorate/storage/index.ts b/packages/types/src/metadata/decorate/storage/index.ts index ee5fe2f5cb..607d3ec78f 100644 --- a/packages/types/src/metadata/decorate/storage/index.ts +++ b/packages/types/src/metadata/decorate/storage/index.ts @@ -2,15 +2,15 @@ // SPDX-License-Identifier: Apache-2.0 import type { Registry } from '@polkadot/types-codec/types'; -import type { MetadataLatest, StorageEntryMetadataLatest } from '../../../interfaces'; -import type { Storage } from '../types'; +import type { MetadataLatest, StorageEntryMetadataLatest } from '../../../interfaces/index.js'; +import type { Storage } from '../types.js'; import { lazyMethod, lazyMethods, stringCamelCase } from '@polkadot/util'; -import { objectNameToCamel } from '../util'; -import { createFunction, createKeyRaw, NO_RAW_ARGS } from './createFunction'; -import { getStorage } from './getStorage'; -import { createRuntimeFunction } from './util'; +import { objectNameToCamel } from '../util.js'; +import { createFunction, createKeyRaw, NO_RAW_ARGS } from './createFunction.js'; +import { getStorage } from './getStorage.js'; +import { createRuntimeFunction } from './util.js'; const VERSION_NAME = 'palletVersion'; const VERSION_KEY = ':__STORAGE_VERSION__:'; diff --git a/packages/types/src/metadata/decorate/storage/substrate.spec.ts b/packages/types/src/metadata/decorate/storage/substrate.spec.ts index 4fe020b8a4..ab02ed6cc2 100644 --- a/packages/types/src/metadata/decorate/storage/substrate.spec.ts +++ b/packages/types/src/metadata/decorate/storage/substrate.spec.ts @@ -6,9 +6,9 @@ import metadataStatic from '@polkadot/types-support/metadata/static-substrate'; import { compactAddLength, u8aToU8a } from '@polkadot/util'; -import { TypeRegistry } from '../../../create'; -import { Metadata } from '../../Metadata'; -import { substrate } from './substrate'; +import { TypeRegistry } from '../../../create/index.js'; +import { Metadata } from '../../Metadata.js'; +import { substrate } from './substrate.js'; const registry = new TypeRegistry(); const metadata = new Metadata(registry, metadataStatic); diff --git a/packages/types/src/metadata/decorate/storage/substrate.ts b/packages/types/src/metadata/decorate/storage/substrate.ts index 21889741a0..1f030b28e2 100644 --- a/packages/types/src/metadata/decorate/storage/substrate.ts +++ b/packages/types/src/metadata/decorate/storage/substrate.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import type { Registry } from '@polkadot/types-codec/types'; -import type { StorageEntry } from '../../../primitive/types'; -import type { ManualMetadata } from './util'; +import type { StorageEntry } from '../../../primitive/types.js'; +import type { ManualMetadata } from './util.js'; -import { createRuntimeFunction } from './util'; +import { createRuntimeFunction } from './util.js'; type Creator = (registry: Registry) => StorageEntry; diff --git a/packages/types/src/metadata/decorate/storage/util.ts b/packages/types/src/metadata/decorate/storage/util.ts index 87e817e010..bde583f37e 100644 --- a/packages/types/src/metadata/decorate/storage/util.ts +++ b/packages/types/src/metadata/decorate/storage/util.ts @@ -1,11 +1,11 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { PortableType } from '../../../interfaces'; -import type { StorageEntry } from '../../../primitive/types'; -import type { Registry } from '../../../types'; +import type { PortableType } from '../../../interfaces/index.js'; +import type { StorageEntry } from '../../../primitive/types.js'; +import type { Registry } from '../../../types/index.js'; -import { createFunction } from './createFunction'; +import { createFunction } from './createFunction.js'; export interface ManualMetadata { docs: string; diff --git a/packages/types/src/metadata/decorate/types.ts b/packages/types/src/metadata/decorate/types.ts index dab07fb761..2c0a674f36 100644 --- a/packages/types/src/metadata/decorate/types.ts +++ b/packages/types/src/metadata/decorate/types.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 import type { AnyTuple, Codec, Registry } from '@polkadot/types-codec/types'; -import type { DispatchErrorModule, DispatchErrorModuleU8, DispatchErrorModuleU8a, ErrorMetadataLatest, EventMetadataLatest, PalletConstantMetadataLatest } from '../../interfaces'; -import type { StorageEntry } from '../../primitive/types'; -import type { CallFunction, IEvent, IEventLike } from '../../types'; +import type { DispatchErrorModule, DispatchErrorModuleU8, DispatchErrorModuleU8a, ErrorMetadataLatest, EventMetadataLatest, PalletConstantMetadataLatest } from '../../interfaces/index.js'; +import type { StorageEntry } from '../../primitive/types.js'; +import type { CallFunction, IEvent, IEventLike } from '../../types/index.js'; export interface ConstantCodec extends Codec { readonly meta: PalletConstantMetadataLatest; diff --git a/packages/types/src/metadata/index.ts b/packages/types/src/metadata/index.ts index c40dddcbd4..52e58a985a 100644 --- a/packages/types/src/metadata/index.ts +++ b/packages/types/src/metadata/index.ts @@ -1,6 +1,6 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -export { Metadata } from './Metadata'; -export { PortableRegistry } from './PortableRegistry'; -export { decorateConstants, decorateExtrinsics, decorateStorage, expandMetadata } from './decorate'; +export { Metadata } from './Metadata.js'; +export { PortableRegistry } from './PortableRegistry/index.js'; +export { decorateConstants, decorateExtrinsics, decorateStorage, expandMetadata } from './decorate/index.js'; diff --git a/packages/types/src/metadata/types.ts b/packages/types/src/metadata/types.ts index c8023ccc9e..b298c0b093 100644 --- a/packages/types/src/metadata/types.ts +++ b/packages/types/src/metadata/types.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { Vec } from '@polkadot/types-codec'; -import type { Codec } from '../types'; +import type { Codec } from '../types/index.js'; export interface MetadataInterface extends Codec { pallets: Vec; diff --git a/packages/types/src/metadata/util/flattenUniq.spec.ts b/packages/types/src/metadata/util/flattenUniq.spec.ts index 3dedd406b1..35550cce50 100644 --- a/packages/types/src/metadata/util/flattenUniq.spec.ts +++ b/packages/types/src/metadata/util/flattenUniq.spec.ts @@ -3,7 +3,7 @@ /// -import { flattenUniq } from '.'; +import { flattenUniq } from './index.js'; describe('flattenUniq', (): void => { it('flattens nested arrays', (): void => { diff --git a/packages/types/src/metadata/util/getSiName.ts b/packages/types/src/metadata/util/getSiName.ts index 10d798fc28..af03f26a59 100644 --- a/packages/types/src/metadata/util/getSiName.ts +++ b/packages/types/src/metadata/util/getSiName.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { ILookup } from '@polkadot/types-create/types'; -import type { SiLookupTypeId } from '../../interfaces'; +import type { SiLookupTypeId } from '../../interfaces/index.js'; export function getSiName (lookup: ILookup, type: SiLookupTypeId): string { const typeDef = lookup.getTypeDef(type); diff --git a/packages/types/src/metadata/util/getUniqTypes.ts b/packages/types/src/metadata/util/getUniqTypes.ts index 16d3e39b94..a35f4bbddf 100644 --- a/packages/types/src/metadata/util/getUniqTypes.ts +++ b/packages/types/src/metadata/util/getUniqTypes.ts @@ -2,11 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { Registry } from '@polkadot/types-codec/types'; -import type { MetadataLatest, SiLookupTypeId } from '../../interfaces'; -import type { PortableRegistry } from '../../metadata'; +import type { MetadataLatest, SiLookupTypeId } from '../../interfaces/index.js'; +import type { PortableRegistry } from '../../metadata/index.js'; -import { flattenUniq } from './flattenUniq'; -import { validateTypes } from './validateTypes'; +import { flattenUniq } from './flattenUniq.js'; +import { validateTypes } from './validateTypes.js'; /** @internal */ function extractTypes (lookup: PortableRegistry, types: { type: SiLookupTypeId }[]): string[] { diff --git a/packages/types/src/metadata/util/index.ts b/packages/types/src/metadata/util/index.ts index 6ef4addf48..87c36c6c5e 100644 --- a/packages/types/src/metadata/util/index.ts +++ b/packages/types/src/metadata/util/index.ts @@ -1,8 +1,8 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -export { flattenUniq } from './flattenUniq'; -export { getSiName } from './getSiName'; -export { getUniqTypes } from './getUniqTypes'; -export { toCallsOnly } from './toCallsOnly'; -export { validateTypes } from './validateTypes'; +export { flattenUniq } from './flattenUniq.js'; +export { getSiName } from './getSiName.js'; +export { getUniqTypes } from './getUniqTypes.js'; +export { toCallsOnly } from './toCallsOnly.js'; +export { validateTypes } from './validateTypes.js'; diff --git a/packages/types/src/metadata/util/testUtil.ts b/packages/types/src/metadata/util/testUtil.ts index fb28bd7647..51ff4d76c7 100644 --- a/packages/types/src/metadata/util/testUtil.ts +++ b/packages/types/src/metadata/util/testUtil.ts @@ -4,17 +4,17 @@ /// import type { Registry } from '@polkadot/types-codec/types'; -import type { Check } from './types'; +import type { Check } from './types.js'; import fs from 'node:fs'; import path from 'node:path'; import { hexToU8a, stringCamelCase, stringify, u8aToHex } from '@polkadot/util'; -import { TypeRegistry } from '../../create'; -import { unwrapStorageSi, unwrapStorageType } from '../../primitive/StorageKey'; -import { Metadata } from '../Metadata'; -import { getUniqTypes } from './getUniqTypes'; +import { TypeRegistry } from '../../create/index.js'; +import { unwrapStorageSi, unwrapStorageType } from '../../primitive/StorageKey.js'; +import { Metadata } from '../Metadata.js'; +import { getUniqTypes } from './getUniqTypes.js'; function writeJson (json: unknown, version: number, type: string, sub: 'json' | 'types'): void { fs.writeFileSync( diff --git a/packages/types/src/metadata/util/toCallsOnly.spec.ts b/packages/types/src/metadata/util/toCallsOnly.spec.ts index 24e848a3af..10345ebdd7 100644 --- a/packages/types/src/metadata/util/toCallsOnly.spec.ts +++ b/packages/types/src/metadata/util/toCallsOnly.spec.ts @@ -6,8 +6,8 @@ import staticLatest from '@polkadot/types-support/metadata/static-substrate'; import staticV13 from '@polkadot/types-support/metadata/v13/substrate-hex'; -import { TypeRegistry } from '../../create'; -import { Metadata } from '../Metadata'; +import { TypeRegistry } from '../../create/index.js'; +import { Metadata } from '../Metadata.js'; describe('toCallsOnly', (): void => { const registry = new TypeRegistry(); diff --git a/packages/types/src/metadata/util/toCallsOnly.ts b/packages/types/src/metadata/util/toCallsOnly.ts index fa35a0c057..9d2f34b21a 100644 --- a/packages/types/src/metadata/util/toCallsOnly.ts +++ b/packages/types/src/metadata/util/toCallsOnly.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { AnyJson, Registry } from '@polkadot/types-codec/types'; -import type { MetadataLatest, PalletCallMetadataLatest } from '../../interfaces/metadata'; +import type { MetadataLatest, PalletCallMetadataLatest } from '../../interfaces/metadata/index.js'; import { Option, Text, u8 } from '@polkadot/types-codec'; import { objectSpread } from '@polkadot/util'; diff --git a/packages/types/src/metadata/util/validateTypes.ts b/packages/types/src/metadata/util/validateTypes.ts index 9eecb012e8..d92fc0f560 100644 --- a/packages/types/src/metadata/util/validateTypes.ts +++ b/packages/types/src/metadata/util/validateTypes.ts @@ -5,8 +5,8 @@ import type { Registry } from '@polkadot/types-codec/types'; import { logger } from '@polkadot/util'; -import { extractTypes } from './extractTypes'; -import { flattenUniq } from './flattenUniq'; +import { extractTypes } from './extractTypes.js'; +import { flattenUniq } from './flattenUniq.js'; const l = logger('metadata'); diff --git a/packages/types/src/metadata/v10/Metadata.spec.ts b/packages/types/src/metadata/v10/Metadata.spec.ts index ddb97a4060..6993b4cce8 100644 --- a/packages/types/src/metadata/v10/Metadata.spec.ts +++ b/packages/types/src/metadata/v10/Metadata.spec.ts @@ -4,7 +4,7 @@ import substrateData from '@polkadot/types-support/metadata/v10/substrate-hex'; import substrateJson from '@polkadot/types-support/metadata/v10/substrate-json.json' assert { type: 'json' }; -import { testMeta } from '../util/testUtil'; +import { testMeta } from '../util/testUtil.js'; testMeta(10, { substrate: { diff --git a/packages/types/src/metadata/v10/toV11.ts b/packages/types/src/metadata/v10/toV11.ts index 4cff61d6e9..cf47acfc54 100644 --- a/packages/types/src/metadata/v10/toV11.ts +++ b/packages/types/src/metadata/v10/toV11.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { Registry } from '@polkadot/types-codec/types'; -import type { MetadataV10, MetadataV11 } from '../../interfaces/metadata'; +import type { MetadataV10, MetadataV11 } from '../../interfaces/metadata/index.js'; /** @internal */ export function toV11 (registry: Registry, { modules }: MetadataV10): MetadataV11 { diff --git a/packages/types/src/metadata/v11/Metadata.spec.ts b/packages/types/src/metadata/v11/Metadata.spec.ts index 25e201b549..5f10e02cc7 100644 --- a/packages/types/src/metadata/v11/Metadata.spec.ts +++ b/packages/types/src/metadata/v11/Metadata.spec.ts @@ -4,7 +4,7 @@ import substrateData from '@polkadot/types-support/metadata/v11/substrate-hex'; import substrateJson from '@polkadot/types-support/metadata/v11/substrate-json.json' assert { type: 'json' }; -import { testMeta } from '../util/testUtil'; +import { testMeta } from '../util/testUtil.js'; testMeta(11, { substrate: { diff --git a/packages/types/src/metadata/v11/toV12.ts b/packages/types/src/metadata/v11/toV12.ts index ebbf7234cb..6de560bd3d 100644 --- a/packages/types/src/metadata/v11/toV12.ts +++ b/packages/types/src/metadata/v11/toV12.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { Registry } from '@polkadot/types-codec/types'; -import type { MetadataV11, MetadataV12, ModuleMetadataV12 } from '../../interfaces/metadata'; +import type { MetadataV11, MetadataV12, ModuleMetadataV12 } from '../../interfaces/metadata/index.js'; import { objectSpread } from '@polkadot/util'; diff --git a/packages/types/src/metadata/v12/Metadata.spec.ts b/packages/types/src/metadata/v12/Metadata.spec.ts index 3084165440..a912508340 100644 --- a/packages/types/src/metadata/v12/Metadata.spec.ts +++ b/packages/types/src/metadata/v12/Metadata.spec.ts @@ -4,7 +4,7 @@ import substrateData from '@polkadot/types-support/metadata/v12/substrate-hex'; import substrateJson from '@polkadot/types-support/metadata/v12/substrate-json.json' assert { type: 'json' }; -import { testMeta } from '../util/testUtil'; +import { testMeta } from '../util/testUtil.js'; testMeta(12, { substrate: { diff --git a/packages/types/src/metadata/v12/toV13.ts b/packages/types/src/metadata/v12/toV13.ts index 7ac840b991..259dd4baad 100644 --- a/packages/types/src/metadata/v12/toV13.ts +++ b/packages/types/src/metadata/v12/toV13.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { Registry } from '@polkadot/types-codec/types'; -import type { MetadataV12, MetadataV13 } from '../../interfaces/metadata'; +import type { MetadataV12, MetadataV13 } from '../../interfaces/metadata/index.js'; /** * @internal diff --git a/packages/types/src/metadata/v13/Metadata.spec.ts b/packages/types/src/metadata/v13/Metadata.spec.ts index 73ae921ab2..ac6aeb7967 100644 --- a/packages/types/src/metadata/v13/Metadata.spec.ts +++ b/packages/types/src/metadata/v13/Metadata.spec.ts @@ -8,7 +8,7 @@ import polkadotJson from '@polkadot/types-support/metadata/v13/polkadot-json.jso import substrateData from '@polkadot/types-support/metadata/v13/substrate-hex'; import substrateJson from '@polkadot/types-support/metadata/v13/substrate-json.json' assert { type: 'json' }; -import { testMeta } from '../util/testUtil'; +import { testMeta } from '../util/testUtil.js'; testMeta(13, { kusama: { diff --git a/packages/types/src/metadata/v13/toV14.ts b/packages/types/src/metadata/v13/toV14.ts index 80bd97e3cc..c465dcf377 100644 --- a/packages/types/src/metadata/v13/toV14.ts +++ b/packages/types/src/metadata/v13/toV14.ts @@ -2,14 +2,14 @@ // SPDX-License-Identifier: Apache-2.0 import type { Text, Type } from '@polkadot/types-codec'; -import type { ErrorMetadataV13, EventMetadataV13, ExtrinsicMetadataV13, ExtrinsicMetadataV14, FunctionMetadataV13, MetadataV13, MetadataV14, ModuleConstantMetadataV13, ModuleMetadataV13, PalletCallMetadataV14, PalletConstantMetadataV14, PalletErrorMetadataV14, PalletEventMetadataV14, PalletMetadataV14, PalletStorageMetadataV14, StorageEntryMetadataV14, StorageEntryTypeV14, StorageHasherV13, StorageMetadataV13 } from '../../interfaces/metadata'; -import type { SiVariant } from '../../interfaces/scaleInfo'; -import type { OverrideModuleType, Registry } from '../../types'; +import type { ErrorMetadataV13, EventMetadataV13, ExtrinsicMetadataV13, ExtrinsicMetadataV14, FunctionMetadataV13, MetadataV13, MetadataV14, ModuleConstantMetadataV13, ModuleMetadataV13, PalletCallMetadataV14, PalletConstantMetadataV14, PalletErrorMetadataV14, PalletEventMetadataV14, PalletMetadataV14, PalletStorageMetadataV14, StorageEntryMetadataV14, StorageEntryTypeV14, StorageHasherV13, StorageMetadataV13 } from '../../interfaces/metadata/index.js'; +import type { SiVariant } from '../../interfaces/scaleInfo/index.js'; +import type { OverrideModuleType, Registry } from '../../types/index.js'; import { stringCamelCase } from '@polkadot/util'; -import { getAliasTypes } from '../../interfaces/alias'; -import { knownOrigins } from '../../interfaces/runtime/definitions'; +import { getAliasTypes } from '../../interfaces/alias.js'; +import { knownOrigins } from '../../interfaces/runtime/definitions.js'; interface MapDef { hashers: StorageHasherV13[]; diff --git a/packages/types/src/metadata/v14/Metadata.spec.ts b/packages/types/src/metadata/v14/Metadata.spec.ts index 5f82b7c112..efbe57706f 100644 --- a/packages/types/src/metadata/v14/Metadata.spec.ts +++ b/packages/types/src/metadata/v14/Metadata.spec.ts @@ -11,7 +11,7 @@ import substrateData from '@polkadot/types-support/metadata/v14/substrate-hex'; import substrateJson from '@polkadot/types-support/metadata/v14/substrate-json.json' assert { type: 'json' }; import substrateTypes from '@polkadot/types-support/metadata/v14/substrate-types.json' assert { type: 'json' }; -import { testMeta } from '../util/testUtil'; +import { testMeta } from '../util/testUtil.js'; testMeta(14, { kusama: { diff --git a/packages/types/src/metadata/v14/toLatest.ts b/packages/types/src/metadata/v14/toLatest.ts index e865a19e8e..cc0081faca 100644 --- a/packages/types/src/metadata/v14/toLatest.ts +++ b/packages/types/src/metadata/v14/toLatest.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { Registry } from '@polkadot/types-codec/types'; -import type { MetadataLatest, MetadataV14 } from '../../interfaces/metadata'; +import type { MetadataLatest, MetadataV14 } from '../../interfaces/metadata/index.js'; /** * Convert the Metadata (which is an alias) to latest diff --git a/packages/types/src/metadata/v9/Metadata.spec.ts b/packages/types/src/metadata/v9/Metadata.spec.ts index 7f5a96d50a..fe55aa71a1 100644 --- a/packages/types/src/metadata/v9/Metadata.spec.ts +++ b/packages/types/src/metadata/v9/Metadata.spec.ts @@ -4,7 +4,7 @@ import substrateData from '@polkadot/types-support/metadata/v9/substrate-hex'; import substrateJson from '@polkadot/types-support/metadata/v9/substrate-json.json' assert { type: 'json' }; -import { testMeta } from '../util/testUtil'; +import { testMeta } from '../util/testUtil.js'; testMeta(9, { substrate: { diff --git a/packages/types/src/metadata/v9/toV10.ts b/packages/types/src/metadata/v9/toV10.ts index bbaac5e60b..c48dec31bc 100644 --- a/packages/types/src/metadata/v9/toV10.ts +++ b/packages/types/src/metadata/v9/toV10.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { Registry } from '@polkadot/types-codec/types'; -import type { MetadataV9, MetadataV10, ModuleMetadataV9, ModuleMetadataV10, StorageEntryMetadataV9, StorageEntryTypeV9, StorageHasherV9, StorageHasherV10 } from '../../interfaces/metadata'; +import type { MetadataV9, MetadataV10, ModuleMetadataV9, ModuleMetadataV10, StorageEntryMetadataV9, StorageEntryTypeV9, StorageHasherV9, StorageHasherV10 } from '../../interfaces/metadata/index.js'; import { objectSpread } from '@polkadot/util'; diff --git a/packages/types/src/mod.ts b/packages/types/src/mod.ts index 441e7680ab..f91241b7b9 100644 --- a/packages/types/src/mod.ts +++ b/packages/types/src/mod.ts @@ -1,4 +1,4 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -export * from './index'; +export * from './index.js'; diff --git a/packages/types/src/primitive/Data.spec.ts b/packages/types/src/primitive/Data.spec.ts index b58bd08e25..b5a7e0beba 100644 --- a/packages/types/src/primitive/Data.spec.ts +++ b/packages/types/src/primitive/Data.spec.ts @@ -3,8 +3,8 @@ /// -import { TypeRegistry } from '../create'; -import { Data } from '.'; +import { TypeRegistry } from '../create/index.js'; +import { Data } from './index.js'; const registry = new TypeRegistry(); diff --git a/packages/types/src/primitive/Data.ts b/packages/types/src/primitive/Data.ts index e7412aec26..33c1af40f0 100644 --- a/packages/types/src/primitive/Data.ts +++ b/packages/types/src/primitive/Data.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { IU8a, Registry } from '@polkadot/types-codec/types'; -import type { H256 } from '../interfaces/runtime'; +import type { H256 } from '../interfaces/runtime/index.js'; import { Bytes, Enum } from '@polkadot/types-codec'; import { isString, isU8a, u8aToU8a } from '@polkadot/util'; diff --git a/packages/types/src/primitive/StorageKey.spec.ts b/packages/types/src/primitive/StorageKey.spec.ts index 71bf0f2a08..33ba2c7f45 100644 --- a/packages/types/src/primitive/StorageKey.spec.ts +++ b/packages/types/src/primitive/StorageKey.spec.ts @@ -7,9 +7,9 @@ import rpcDataV11 from '@polkadot/types-support//metadata/v11/substrate-hex'; -import { TypeRegistry } from '../create'; -import { decorateStorage, Metadata } from '../metadata'; -import { StorageKey } from '.'; +import { TypeRegistry } from '../create/index.js'; +import { decorateStorage, Metadata } from '../metadata/index.js'; +import { StorageKey } from './index.js'; describe('StorageKey', (): void => { const registry = new TypeRegistry(); diff --git a/packages/types/src/primitive/StorageKey.ts b/packages/types/src/primitive/StorageKey.ts index ce507df8b6..0806954587 100644 --- a/packages/types/src/primitive/StorageKey.ts +++ b/packages/types/src/primitive/StorageKey.ts @@ -2,16 +2,16 @@ // SPDX-License-Identifier: Apache-2.0 import type { AnyJson, AnyTuple, Codec } from '@polkadot/types-codec/types'; -import type { StorageEntryMetadataLatest, StorageEntryTypeLatest, StorageHasher } from '../interfaces/metadata'; -import type { AllHashers } from '../interfaces/metadata/definitions'; -import type { SiLookupTypeId } from '../interfaces/scaleInfo'; -import type { InterfaceTypes, IStorageKey, Registry } from '../types'; -import type { StorageEntry } from './types'; +import type { AllHashers } from '../interfaces/metadata/definitions.js'; +import type { StorageEntryMetadataLatest, StorageEntryTypeLatest, 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 { StorageEntry } from './types.js'; import { Bytes } from '@polkadot/types-codec'; import { isFunction, isString, isU8a } from '@polkadot/util'; -import { getSiName } from '../metadata/util'; +import { getSiName } from '../metadata/util/index.js'; interface Decoded { key?: Uint8Array | string; diff --git a/packages/types/src/primitive/index.ts b/packages/types/src/primitive/index.ts index 23720482c8..48546a6f96 100644 --- a/packages/types/src/primitive/index.ts +++ b/packages/types/src/primitive/index.ts @@ -6,5 +6,5 @@ */ export { BitVec, bool, Bool, Bytes, f32, F32, f64, F64, i8, I8, i16, I16, i32, I32, i64, I64, i128, I128, i256, I256, Null, OptionBool, Text, Type, u8, U8, u16, U16, u32, U32, u64, U64, u128, U128, u256, U256, usize, USize } from '@polkadot/types-codec'; -export { Data } from './Data'; -export { StorageKey } from './StorageKey'; +export { Data } from './Data.js'; +export { StorageKey } from './StorageKey.js'; diff --git a/packages/types/src/primitive/types.ts b/packages/types/src/primitive/types.ts index ad353c5bb1..65f5355591 100644 --- a/packages/types/src/primitive/types.ts +++ b/packages/types/src/primitive/types.ts @@ -1,8 +1,8 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { StorageEntryMetadataLatest } from '../interfaces/metadata'; -import type { Codec, Inspect } from '../types'; +import type { StorageEntryMetadataLatest } from '../interfaces/metadata/index.js'; +import type { Codec, Inspect } from '../types/index.js'; export interface StorageEntryIterator { (...args: unknown[]): Uint8Array & Codec; diff --git a/packages/types/src/types/augmentLookup.ts b/packages/types/src/types/augmentLookup.ts index db114ded11..8398e5cc25 100644 --- a/packages/types/src/types/augmentLookup.ts +++ b/packages/types/src/types/augmentLookup.ts @@ -8,8 +8,8 @@ import '@polkadot/types-create/types/lookup'; import type { Vec } from '@polkadot/types-codec'; import type { LookupString } from '@polkadot/types-codec/types'; import type { TypeDef } from '@polkadot/types-create/types'; -import type { PortableType } from '../interfaces/metadata'; -import type { SiLookupTypeId, SiType } from '../interfaces/scaleInfo'; +import type { PortableType } from '../interfaces/metadata/index.js'; +import type { SiLookupTypeId, SiType } from '../interfaces/scaleInfo/index.js'; declare module '@polkadot/types-create/types/lookup' { interface ILookup { diff --git a/packages/types/src/types/augmentRegistry.ts b/packages/types/src/types/augmentRegistry.ts index 5eb0dd09ea..8f58cba123 100644 --- a/packages/types/src/types/augmentRegistry.ts +++ b/packages/types/src/types/augmentRegistry.ts @@ -8,14 +8,14 @@ import '@polkadot/types-create/types/augmentRegistry'; import type { AnyString, Codec, CodecClass, LookupString } from '@polkadot/types-codec/types'; import type { TypeDef } from '@polkadot/types-create/types'; -import type { ExtDef } from '../extrinsic/signedExtensions/types'; -import type { MetadataLatest } from '../interfaces/metadata'; -import type { SiField, SiLookupTypeId } from '../interfaces/scaleInfo'; -import type { ChainProperties } from '../interfaces/system'; -import type { Metadata, PortableRegistry } from '../metadata'; -import type { CallFunction as CallFunctionExt } from './calls'; -import type { DetectCodec } from './detect'; -import type { CodecHasher, RegisteredTypes } from './registry'; +import type { ExtDef } from '../extrinsic/signedExtensions/types.js'; +import type { MetadataLatest } from '../interfaces/metadata/index.js'; +import type { SiField, SiLookupTypeId } from '../interfaces/scaleInfo/index.js'; +import type { ChainProperties } from '../interfaces/system/index.js'; +import type { Metadata, PortableRegistry } from '../metadata/index.js'; +import type { CallFunction as CallFunctionExt } from './calls.js'; +import type { DetectCodec } from './detect.js'; +import type { CodecHasher, RegisteredTypes } from './registry.js'; declare module '@polkadot/types-codec/types/registry' { interface RegistryError { diff --git a/packages/types/src/types/calls.ts b/packages/types/src/types/calls.ts index fcb0620396..ccc2b8a5ae 100644 --- a/packages/types/src/types/calls.ts +++ b/packages/types/src/types/calls.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 import type { AnyTuple, CallBase as CallBaseBase, CallFunction as CallFunctionBase, IMethod } from '@polkadot/types-codec/types'; -import type { FunctionMetadataLatest } from '../interfaces/metadata'; -import type { Call } from '../interfaces/runtime'; -import type { Registry } from './registry'; +import type { FunctionMetadataLatest } from '../interfaces/metadata/index.js'; +import type { Call } from '../interfaces/runtime/index.js'; +import type { Registry } from './registry.js'; export interface CallBase extends CallBaseBase { registry: Registry; diff --git a/packages/types/src/types/events.ts b/packages/types/src/types/events.ts index 1fe8388ac7..0b71900044 100644 --- a/packages/types/src/types/events.ts +++ b/packages/types/src/types/events.ts @@ -3,9 +3,9 @@ import type { Codec } from '@polkadot/types-codec/types'; import type { TypeDef } from '@polkadot/types-create/types'; -import type { EventMetadataLatest } from '../interfaces/metadata'; -import type { Hash } from '../interfaces/runtime'; -import type { EventId, Phase } from '../interfaces/system'; +import type { EventMetadataLatest } from '../interfaces/metadata/index.js'; +import type { Hash } from '../interfaces/runtime/index.js'; +import type { EventId, Phase } from '../interfaces/system/index.js'; export interface IEventRecord extends Codec { readonly phase: Phase; diff --git a/packages/types/src/types/extrinsic.ts b/packages/types/src/types/extrinsic.ts index 3d9118e5cc..668fb33b77 100644 --- a/packages/types/src/types/extrinsic.ts +++ b/packages/types/src/types/extrinsic.ts @@ -3,12 +3,12 @@ import type { AnyJson, AnyNumber, AnyTuple, AnyU8a, Codec } from '@polkadot/types-codec/types'; import type { HexString } from '@polkadot/util/types'; -import type { ExtrinsicStatus } from '../interfaces/author'; -import type { EcdsaSignature, Ed25519Signature, Sr25519Signature } from '../interfaces/extrinsics'; -import type { Address, Call, H256, Hash } from '../interfaces/runtime'; -import type { DispatchError, DispatchInfo, EventRecord } from '../interfaces/system'; -import type { ICompact, IKeyringPair, IMethod, INumber, IRuntimeVersionBase } from './interfaces'; -import type { Registry } from './registry'; +import type { ExtrinsicStatus } from '../interfaces/author/index.js'; +import type { EcdsaSignature, Ed25519Signature, Sr25519Signature } from '../interfaces/extrinsics/index.js'; +import type { Address, Call, H256, Hash } from '../interfaces/runtime/index.js'; +import type { DispatchError, DispatchInfo, EventRecord } from '../interfaces/system/index.js'; +import type { ICompact, IKeyringPair, IMethod, INumber, IRuntimeVersionBase } from './interfaces.js'; +import type { Registry } from './registry.js'; export interface ISubmittableResult { readonly dispatchError?: DispatchError; diff --git a/packages/types/src/types/index.ts b/packages/types/src/types/index.ts index 3a8bd271ac..a4f2f5b4e7 100644 --- a/packages/types/src/types/index.ts +++ b/packages/types/src/types/index.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 // augment our internal Lookup & Registry interfaces -import './augmentLookup'; -import './augmentRegistry'; +import './augmentLookup.js'; +import './augmentRegistry.js'; // augmented exports export * from '@polkadot/types/types/registry'; @@ -12,11 +12,11 @@ export * from '@polkadot/types/types/registry'; export type { Observable } from 'rxjs'; // other exports -export * from '../create/types'; -export * from './calls'; -export * from './codec'; -export * from './definitions'; -export * from './detect'; -export * from './events'; -export * from './extrinsic'; -export * from './interfaces'; +export * from '../create/types.js'; +export * from './calls.js'; +export * from './codec.js'; +export * from './definitions.js'; +export * from './detect.js'; +export * from './events.js'; +export * from './extrinsic.js'; +export * from './interfaces.js'; diff --git a/packages/types/src/types/interfaces.ts b/packages/types/src/types/interfaces.ts index 916b87c59c..7cd0eda173 100644 --- a/packages/types/src/types/interfaces.ts +++ b/packages/types/src/types/interfaces.ts @@ -3,8 +3,8 @@ import type { SignOptions } from '@polkadot/keyring/types'; import type { AnyTuple, Codec, IMethod as IMethodBase, INumber, IText } from '@polkadot/types-codec/types'; -import type { FunctionMetadataLatest, StorageEntryMetadataLatest } from '../interfaces/metadata'; -import type { Registry } from './registry'; +import type { FunctionMetadataLatest, StorageEntryMetadataLatest } from '../interfaces/metadata/index.js'; +import type { Registry } from './registry.js'; export type { ICompact, IEnum, IMap, INumber, IOption, IResult, ISet, IStruct, IText, ITuple, IU8a, IVec } from '@polkadot/types-codec/types'; diff --git a/packages/types/src/types/registry.ts b/packages/types/src/types/registry.ts index 35ba6f1bfc..6266bed8cf 100644 --- a/packages/types/src/types/registry.ts +++ b/packages/types/src/types/registry.ts @@ -6,14 +6,14 @@ import type { BitVec, Bool, bool, Bytes, F32, f32, F64, f64, I8, i8, I16, i16, I import type { RegistryTypes } from '@polkadot/types-codec/types'; import type { BN } from '@polkadot/util'; import type { HexString } from '@polkadot/util/types'; -import type { GenericExtrinsic, GenericExtrinsicEra, GenericExtrinsicPayload, GenericSignerPayload } from '../extrinsic'; -import type { ExtDef } from '../extrinsic/signedExtensions/types'; -import type { GenericCall } from '../generic'; -import type { HeaderPartial } from '../interfaces/runtime'; -import type { RuntimeVersionPartial } from '../interfaces/state'; -import type { Metadata, PortableRegistry } from '../metadata'; -import type { Data, StorageKey } from '../primitive'; -import type { DefinitionRpc, DefinitionRpcSub, DefinitionsCall } from './definitions'; +import type { GenericExtrinsic, GenericExtrinsicEra, GenericExtrinsicPayload, GenericSignerPayload } from '../extrinsic/index.js'; +import type { ExtDef } from '../extrinsic/signedExtensions/types.js'; +import type { GenericCall } from '../generic/index.js'; +import type { HeaderPartial } from '../interfaces/runtime/index.js'; +import type { RuntimeVersionPartial } from '../interfaces/state/index.js'; +import type { Metadata, PortableRegistry } from '../metadata/index.js'; +import type { Data, StorageKey } from '../primitive/index.js'; +import type { DefinitionRpc, DefinitionRpcSub, DefinitionsCall } from './definitions.js'; export type { Registry, RegistryError, RegistryTypes } from '@polkadot/types-codec/types'; diff --git a/tsconfig.base.json b/tsconfig.base.json index de3fdde315..c17b519ab4 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -33,7 +33,6 @@ "@polkadot/types-support": ["types-support/src"], "@polkadot/types-support/*": ["types-support/src/*"] }, - "skipLibCheck": true, - "target": "es2020" + "skipLibCheck": true } } diff --git a/yarn.lock b/yarn.lock index 13621ebe7d..b6fb59fd78 100644 --- a/yarn.lock +++ b/yarn.lock @@ -651,9 +651,9 @@ __metadata: languageName: unknown linkType: soft -"@polkadot/dev@npm:^0.70.4": - version: 0.70.4 - resolution: "@polkadot/dev@npm:0.70.4" +"@polkadot/dev@npm:^0.71.1": + version: 0.71.1 + resolution: "@polkadot/dev@npm:0.71.1" dependencies: "@eslint/js": ^8.35.0 "@rollup/plugin-alias": ^4.0.3 @@ -663,8 +663,8 @@ __metadata: "@rollup/plugin-json": ^6.0.0 "@rollup/plugin-node-resolve": ^15.0.1 "@rushstack/eslint-patch": ^1.2.0 - "@typescript-eslint/eslint-plugin": ^5.54.0 - "@typescript-eslint/parser": ^5.54.0 + "@typescript-eslint/eslint-plugin": ^5.54.1 + "@typescript-eslint/parser": ^5.54.1 eslint: ^8.35.0 eslint-config-standard: ^17.0.0 eslint-import-resolver-node: ^0.3.7 @@ -718,7 +718,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: 446bc7a0637a91d30829d5fccb2b6c74d9f54bc7e67290c11cfca56a0f528a33b5ee1b066ed9bde6b669d866c89e3895ff7a44b79210bb549dd406afccc0ca9d + checksum: 18505f604cd99a6fa858fe0dd6f9f09f6ae46bc3428616dd8df6f4533b4854de1c517f1c0ede5f7c11a881ffea2175ffd48c8526ea16f7da3320595d0ae67cf8 languageName: node linkType: hard @@ -1519,13 +1519,13 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/eslint-plugin@npm:^5.54.0": - version: 5.54.0 - resolution: "@typescript-eslint/eslint-plugin@npm:5.54.0" +"@typescript-eslint/eslint-plugin@npm:^5.54.1": + version: 5.54.1 + resolution: "@typescript-eslint/eslint-plugin@npm:5.54.1" dependencies: - "@typescript-eslint/scope-manager": 5.54.0 - "@typescript-eslint/type-utils": 5.54.0 - "@typescript-eslint/utils": 5.54.0 + "@typescript-eslint/scope-manager": 5.54.1 + "@typescript-eslint/type-utils": 5.54.1 + "@typescript-eslint/utils": 5.54.1 debug: ^4.3.4 grapheme-splitter: ^1.0.4 ignore: ^5.2.0 @@ -1539,7 +1539,7 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 4fdb520b8e0f6b9eb878206ddfa4212522f170d1507d7aba8a975159a198efa37af6d2d17982dd560317452d0748f2e2da5dd7347b172bc4446d1c5562ce2e94 + checksum: 76476c08ca0142a9bf6e2381f5cd1c037d86fbafa9c0dded4a97bd3b23b5962dd2c3943bade11b21d674195674f0e36dbf80faa15a1906f5a2ca1f699baf1dd5 languageName: node linkType: hard @@ -1554,20 +1554,20 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/parser@npm:^5.54.0": - version: 5.54.0 - resolution: "@typescript-eslint/parser@npm:5.54.0" +"@typescript-eslint/parser@npm:^5.54.1": + version: 5.54.1 + resolution: "@typescript-eslint/parser@npm:5.54.1" dependencies: - "@typescript-eslint/scope-manager": 5.54.0 - "@typescript-eslint/types": 5.54.0 - "@typescript-eslint/typescript-estree": 5.54.0 + "@typescript-eslint/scope-manager": 5.54.1 + "@typescript-eslint/types": 5.54.1 + "@typescript-eslint/typescript-estree": 5.54.1 debug: ^4.3.4 peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 peerDependenciesMeta: typescript: optional: true - checksum: 368d6dd85be42c3f518f0ddeed23ecd1d3c9484a77ae291ee4e08e2703ed379bed613bde014cd8ab2a3e06e85dd8aef201112ae5e3d2a07deba29ae80bb1fe06 + checksum: f466513d306ca926b97c2cec1eebaf2cd15d45bd5633a4358f23ba9a4de1b0ec4630b1c20abc395943934ed1d2ef65f545fd6737c317a7abe579612101e8a83f languageName: node linkType: hard @@ -1581,22 +1581,22 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:5.54.0": - version: 5.54.0 - resolution: "@typescript-eslint/scope-manager@npm:5.54.0" +"@typescript-eslint/scope-manager@npm:5.54.1": + version: 5.54.1 + resolution: "@typescript-eslint/scope-manager@npm:5.54.1" dependencies: - "@typescript-eslint/types": 5.54.0 - "@typescript-eslint/visitor-keys": 5.54.0 - checksum: e50f12396de0ddb94aab119bdd5f4769b80dd2c273e137fd25e5811e25114d7a3d3668cdb3c454aca9537e940744881d62a1fed2ec86f07f60533dc7382ae15c + "@typescript-eslint/types": 5.54.1 + "@typescript-eslint/visitor-keys": 5.54.1 + checksum: 9add24cf3a7852634ad0680a827646860ac4698a6ac8aae31e8b781e29f59e84b51f0cdaacffd0747811012647f01b51969d988da9b302ead374ceebffbe204b languageName: node linkType: hard -"@typescript-eslint/type-utils@npm:5.54.0": - version: 5.54.0 - resolution: "@typescript-eslint/type-utils@npm:5.54.0" +"@typescript-eslint/type-utils@npm:5.54.1": + version: 5.54.1 + resolution: "@typescript-eslint/type-utils@npm:5.54.1" dependencies: - "@typescript-eslint/typescript-estree": 5.54.0 - "@typescript-eslint/utils": 5.54.0 + "@typescript-eslint/typescript-estree": 5.54.1 + "@typescript-eslint/utils": 5.54.1 debug: ^4.3.4 tsutils: ^3.21.0 peerDependencies: @@ -1604,7 +1604,7 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 9cb5b52c7277bdf74b9ea3282fc40f41fda90ea4b1d33039044476e43cf05a766b1294e7d45f429594f2776828f7d17729cfa4ea027315f3df883e748ba57514 + checksum: 0073838b782b7f4619775be124ca6643fec43a2d56043eaf3ceb100960a5193f14ac747b28ce17a5c9ac643fdee8abda82a7d905c81521358de7b27a2dcbc9af languageName: node linkType: hard @@ -1622,10 +1622,10 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/types@npm:5.54.0": - version: 5.54.0 - resolution: "@typescript-eslint/types@npm:5.54.0" - checksum: 0f66b1b93078f3afea6dfcd3d4e2f0abea4f60cd0c613c2cf13f85098e5bf786185484c9846ed80b6c4272de2c31a70c5a8aacb91314cf1b6da7dcb8855cb7ac +"@typescript-eslint/types@npm:5.54.1": + version: 5.54.1 + resolution: "@typescript-eslint/types@npm:5.54.1" + checksum: 84a8f725cfa10646af389659e09c510c38d82c65960c7b613f844a264acc0e197471cba03f3e8f4b6411bc35dca28922c8352a7bd44621411c73fd6dd4096da2 languageName: node linkType: hard @@ -1647,12 +1647,12 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:5.54.0, @typescript-eslint/typescript-estree@npm:^5.13.0": - version: 5.54.0 - resolution: "@typescript-eslint/typescript-estree@npm:5.54.0" +"@typescript-eslint/typescript-estree@npm:5.54.1, @typescript-eslint/typescript-estree@npm:^5.13.0": + version: 5.54.1 + resolution: "@typescript-eslint/typescript-estree@npm:5.54.1" dependencies: - "@typescript-eslint/types": 5.54.0 - "@typescript-eslint/visitor-keys": 5.54.0 + "@typescript-eslint/types": 5.54.1 + "@typescript-eslint/visitor-keys": 5.54.1 debug: ^4.3.4 globby: ^11.1.0 is-glob: ^4.0.3 @@ -1661,7 +1661,7 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 377c75c34c4f95b7ab6218c1d96a6db3ea6ed6727711b6a09354582fe0157861dc1b6fb9e3f7113cd09741f713735d59d5ab5845457f5733a4ebad7470bf600a + checksum: ea42bdb4832fa96fa1121237c9b664ac4506e2836646651e08a8542c8601d78af6c288779707f893ca4c884221829bb7d7b4b43c4a9c3ed959519266d03a139b languageName: node linkType: hard @@ -1701,21 +1701,21 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/utils@npm:5.54.0, @typescript-eslint/utils@npm:^5.10.0": - version: 5.54.0 - resolution: "@typescript-eslint/utils@npm:5.54.0" +"@typescript-eslint/utils@npm:5.54.1, @typescript-eslint/utils@npm:^5.10.0": + version: 5.54.1 + resolution: "@typescript-eslint/utils@npm:5.54.1" dependencies: "@types/json-schema": ^7.0.9 "@types/semver": ^7.3.12 - "@typescript-eslint/scope-manager": 5.54.0 - "@typescript-eslint/types": 5.54.0 - "@typescript-eslint/typescript-estree": 5.54.0 + "@typescript-eslint/scope-manager": 5.54.1 + "@typescript-eslint/types": 5.54.1 + "@typescript-eslint/typescript-estree": 5.54.1 eslint-scope: ^5.1.1 eslint-utils: ^3.0.0 semver: ^7.3.7 peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - checksum: b8f344fc2961c7af530b93e53d5a17b5084cdf550b381082e3fb7f349ef16e718d9eebde1b9fc2d8fc4ecf8d60d334b004359977247554265c1afc87323bed37 + checksum: 8f428ea4d338ce85d55fd0c9ae2b217b323f29f51b7c9f8077fef7001ca21d28b032c5e5165b67ae6057aef69edb0e7a164c3c483703be6f3e4e574248bbc399 languageName: node linkType: hard @@ -1739,13 +1739,13 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/visitor-keys@npm:5.54.0": - version: 5.54.0 - resolution: "@typescript-eslint/visitor-keys@npm:5.54.0" +"@typescript-eslint/visitor-keys@npm:5.54.1": + version: 5.54.1 + resolution: "@typescript-eslint/visitor-keys@npm:5.54.1" dependencies: - "@typescript-eslint/types": 5.54.0 + "@typescript-eslint/types": 5.54.1 eslint-visitor-keys: ^3.3.0 - checksum: 17fc323c09e6272b603cdaec30a99916600fbbb737e1fbc8c1727a487753b4363cea112277fa43e0562bff34bdd1de9ad73ff9433118b1fd469b112fad0313ca + checksum: 3a691abd2a43b86a0c41526d14a2afcc93a2e0512b5f8b9ec43f6029c493870808036eae5ee4fc655d26e1999017c4a4dffb241f47c36c2a1238ec9fbd08719c languageName: node linkType: hard @@ -7760,7 +7760,7 @@ fsevents@~2.3.2: "@babel/core": ^7.21.0 "@babel/register": ^7.21.0 "@babel/runtime": ^7.21.0 - "@polkadot/dev": ^0.70.4 + "@polkadot/dev": ^0.71.1 "@polkadot/typegen": "workspace:packages/typegen" "@types/node": ^18.14.5 languageName: unknown