Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b2c8e748c3 | ||
|
|
be9feced65 | ||
|
|
f73ed3ef36 | ||
|
|
cf1fabaecf | ||
|
|
ac8446b30c | ||
|
|
abb802bc92 | ||
|
|
9cc2cd8240 | ||
|
|
efbbde74fc | ||
|
|
ba5a02b5f5 | ||
|
|
e035ba20ac | ||
|
|
116b6ee1b5 | ||
|
|
8d1736c047 | ||
|
|
4408f3a3ac | ||
|
|
058edbe9c5 | ||
|
|
0c5211c1a6 | ||
|
|
7a5ef6249e |
@@ -1,10 +1,18 @@
|
||||
# CHANGELOG
|
||||
|
||||
## 10.1.4 Mar 19, 2023
|
||||
|
||||
Changes:
|
||||
|
||||
- Add methods for v2 `Metadata_*` runtime calls
|
||||
|
||||
|
||||
## 10.1.3 Mar 15, 2023
|
||||
|
||||
Changes:
|
||||
|
||||
- Remove incorrect `.module.` specifiers in typegen code
|
||||
- Mark unsafe RPC methods (and include in `rpc.md` generation)
|
||||
|
||||
|
||||
## 10.1.2 Mar 11, 2023
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
3401 Jaco 10.1.3: Remove wrong .module specifier in typegen (#5541)
|
||||
3409 Jaco 10.1.4 (#5550)
|
||||
83 Amaury Martiny StatementKind: Regular and Saft (#2303)
|
||||
37 Keith Ingram Update contract types and rpc (#4541)
|
||||
35 Stefanie Doll Updated child storage parameters (#1709)
|
||||
|
||||
+6
-6
@@ -14,10 +14,10 @@
|
||||
},
|
||||
"sideEffects": false,
|
||||
"type": "module",
|
||||
"version": "10.1.3",
|
||||
"version": "10.1.4",
|
||||
"versions": {
|
||||
"git": "10.1.3",
|
||||
"npm": "10.1.3"
|
||||
"git": "10.1.4",
|
||||
"npm": "10.1.4"
|
||||
},
|
||||
"workspaces": [
|
||||
"packages/*"
|
||||
@@ -25,7 +25,7 @@
|
||||
"scripts": {
|
||||
"build": "yarn build:interfaces && polkadot-dev-build-ts",
|
||||
"build:before": "(cd packages/typegen && polkadot-dev-copy-dir scripts build/scripts)",
|
||||
"build:interfaces": "node --loader @polkadot/dev/node/ts packages/typegen/scripts/polkadot-types-internal-interfaces.mjs",
|
||||
"build:interfaces": "node --loader @polkadot/dev-ts packages/typegen/scripts/polkadot-types-internal-interfaces.mjs",
|
||||
"build:metadata": "yarn build:interfaces && polkadot-dev-run-test packages/types/src/metadata/v14",
|
||||
"build:release": "polkadot-ci-ghact-build",
|
||||
"build:rollup": "polkadot-exec-rollup --config",
|
||||
@@ -40,11 +40,11 @@
|
||||
"test:one": "polkadot-dev-run-test --env node"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/dev": "^0.71.10",
|
||||
"@polkadot/dev": "^0.72.15",
|
||||
"@polkadot/typegen": "workspace:packages/typegen",
|
||||
"@types/node": "^18.15.3"
|
||||
},
|
||||
"resolutions": {
|
||||
"typescript": "^4.9.5"
|
||||
"typescript": "^5.0.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,15 +18,15 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "10.1.3",
|
||||
"version": "10.1.4",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@polkadot/api-base": "10.1.3",
|
||||
"@polkadot/rpc-augment": "10.1.3",
|
||||
"@polkadot/types": "10.1.3",
|
||||
"@polkadot/types-augment": "10.1.3",
|
||||
"@polkadot/types-codec": "10.1.3",
|
||||
"@polkadot/util": "^11.0.2",
|
||||
"@polkadot/api-base": "10.1.4",
|
||||
"@polkadot/rpc-augment": "10.1.4",
|
||||
"@polkadot/types": "10.1.4",
|
||||
"@polkadot/types-augment": "10.1.4",
|
||||
"@polkadot/types-codec": "10.1.4",
|
||||
"@polkadot/util": "^11.1.1",
|
||||
"tslib": "^2.5.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '10.1.3' };
|
||||
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '10.1.4' };
|
||||
|
||||
@@ -18,12 +18,12 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "10.1.3",
|
||||
"version": "10.1.4",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@polkadot/rpc-core": "10.1.3",
|
||||
"@polkadot/types": "10.1.3",
|
||||
"@polkadot/util": "^11.0.2",
|
||||
"@polkadot/rpc-core": "10.1.4",
|
||||
"@polkadot/types": "10.1.4",
|
||||
"@polkadot/util": "^11.1.1",
|
||||
"rxjs": "^7.8.0",
|
||||
"tslib": "^2.5.0"
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '10.1.3' };
|
||||
export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '10.1.4' };
|
||||
|
||||
@@ -62,8 +62,7 @@ export interface PaginationOptions<A = unknown> {
|
||||
startKey?: string;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
export type DecorateMethod<ApiType extends ApiTypes, T = any> =
|
||||
export type DecorateMethod<_ApiType extends ApiTypes, T = any> =
|
||||
<M extends (...args: any[]) => Observable<any>>(method: M, options?: DecorateMethodOptions) => T;
|
||||
|
||||
type AsCodec<R extends Codec | any> = R extends Codec
|
||||
@@ -71,3 +70,9 @@ type AsCodec<R extends Codec | any> = R extends Codec
|
||||
: Codec;
|
||||
|
||||
export type ReturnCodec<F extends AnyFunction> = AsCodec<ObsInnerType<ReturnType<F>>>;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
||||
export interface EmptyBase<_> {
|
||||
// this is use to allow use to have unused vars in augmented interfaces,
|
||||
// so intentionally left empty
|
||||
}
|
||||
|
||||
@@ -3,14 +3,13 @@
|
||||
|
||||
import type { Observable } from 'rxjs';
|
||||
import type { AnyFunction, Codec, DefinitionCallNamed } from '@polkadot/types/types';
|
||||
import type { ApiTypes, ReturnCodec } from './base.js';
|
||||
import type { ApiTypes, EmptyBase, ReturnCodec } from './base.js';
|
||||
|
||||
export type DecoratedCallBase<ApiType extends ApiTypes, F extends AnyFunction = (...args: any[]) => Observable<Codec>> =
|
||||
ApiType extends 'rxjs'
|
||||
? <T extends Codec | any = ReturnCodec<F>> (...args: Parameters<F>) => Observable<T>
|
||||
: <T extends Codec | any = ReturnCodec<F>> (...args: Parameters<F>) => Promise<T>;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
export type AugmentedCall<ApiType extends ApiTypes, F extends AnyFunction = (...args: any[]) => Observable<Codec>> = DecoratedCallBase<ApiType, F> & {
|
||||
/** The metadata/description/definition for this method */
|
||||
meta: DefinitionCallNamed
|
||||
@@ -18,8 +17,8 @@ export type AugmentedCall<ApiType extends ApiTypes, F extends AnyFunction = (...
|
||||
|
||||
// augmented interfaces
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/no-empty-interface
|
||||
export interface AugmentedCalls<ApiType extends ApiTypes> {
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
||||
export interface AugmentedCalls<ApiType extends ApiTypes> extends EmptyBase<ApiType> {
|
||||
// augmented
|
||||
}
|
||||
|
||||
|
||||
@@ -3,17 +3,16 @@
|
||||
|
||||
import type { PalletConstantMetadataLatest } from '@polkadot/types/interfaces';
|
||||
import type { Codec } from '@polkadot/types/types';
|
||||
import type { ApiTypes } from './base.js';
|
||||
import type { ApiTypes, EmptyBase } from './base.js';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
export interface AugmentedConst<ApiType extends ApiTypes> {
|
||||
export interface AugmentedConst<_ extends ApiTypes> {
|
||||
meta: PalletConstantMetadataLatest;
|
||||
}
|
||||
|
||||
// augmented interfaces
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/no-empty-interface
|
||||
export interface AugmentedConsts<ApiType extends ApiTypes> {
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
||||
export interface AugmentedConsts<ApiType extends ApiTypes> extends EmptyBase<ApiType> {
|
||||
// augmented
|
||||
}
|
||||
|
||||
|
||||
@@ -2,15 +2,14 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { IsError } from '@polkadot/types/metadata/decorate/types';
|
||||
import type { ApiTypes } from './base.js';
|
||||
import type { ApiTypes, EmptyBase } from './base.js';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
export type AugmentedError<ApiType extends ApiTypes> = IsError;
|
||||
export type AugmentedError<_ extends ApiTypes> = IsError;
|
||||
|
||||
// augmented interfaces
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/no-empty-interface
|
||||
export interface AugmentedErrors<ApiType extends ApiTypes> {
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
||||
export interface AugmentedErrors<ApiType extends ApiTypes> extends EmptyBase<ApiType> {
|
||||
// augmented
|
||||
}
|
||||
|
||||
|
||||
@@ -3,15 +3,14 @@
|
||||
|
||||
import type { IsEvent } from '@polkadot/types/metadata/decorate/types';
|
||||
import type { AnyTuple } from '@polkadot/types/types';
|
||||
import type { ApiTypes } from './base.js';
|
||||
import type { ApiTypes, EmptyBase } from './base.js';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
export type AugmentedEvent<ApiType extends ApiTypes, T extends AnyTuple = AnyTuple, N = unknown> = IsEvent<T, N>;
|
||||
export type AugmentedEvent<_ extends ApiTypes, T extends AnyTuple = AnyTuple, N = unknown> = IsEvent<T, N>;
|
||||
|
||||
// augmented interfaces
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/no-empty-interface
|
||||
export interface AugmentedEvents<ApiType extends ApiTypes> {
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
||||
export interface AugmentedEvents<ApiType extends ApiTypes> extends EmptyBase<ApiType> {
|
||||
// augmented
|
||||
}
|
||||
|
||||
|
||||
@@ -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.js';
|
||||
import type { ApiTypes, DropLast, EmptyBase, MethodResult, PaginationOptions, PromiseOrObs, ReturnCodec, UnsubscribePromise } from './base.js';
|
||||
|
||||
interface StorageEntryObservableMulti<R extends Codec = Codec> {
|
||||
<T extends Codec = R>(args: (unknown[] | unknown)[]): Observable<T[]>;
|
||||
@@ -114,8 +114,8 @@ export type AugmentedQueryDoubleMap<ApiType extends ApiTypes, F extends AnyFunct
|
||||
|
||||
// augmented interfaces
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/no-empty-interface
|
||||
export interface AugmentedQueries<ApiType extends ApiTypes> {
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
||||
export interface AugmentedQueries<ApiType extends ApiTypes> extends EmptyBase<ApiType> {
|
||||
// augmented
|
||||
}
|
||||
|
||||
|
||||
@@ -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.js';
|
||||
import type { ApiTypes, EmptyBase, PromiseOrObs } from './base.js';
|
||||
|
||||
export type AugmentedSubmittable<T extends AnyFunction, A extends AnyTuple = AnyTuple> = T & CallBase<A>;
|
||||
|
||||
@@ -81,8 +81,8 @@ export interface SubmittableExtrinsicFunction<ApiType extends ApiTypes, A extend
|
||||
|
||||
// augmented interfaces
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/no-empty-interface
|
||||
export interface AugmentedSubmittables<ApiType extends ApiTypes> {
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
||||
export interface AugmentedSubmittables<ApiType extends ApiTypes> extends EmptyBase<ApiType> {
|
||||
// augmented
|
||||
}
|
||||
|
||||
|
||||
@@ -18,20 +18,20 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "10.1.3",
|
||||
"version": "10.1.4",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@polkadot/api": "10.1.3",
|
||||
"@polkadot/types": "10.1.3",
|
||||
"@polkadot/types-codec": "10.1.3",
|
||||
"@polkadot/types-create": "10.1.3",
|
||||
"@polkadot/util": "^11.0.2",
|
||||
"@polkadot/util-crypto": "^11.0.2",
|
||||
"@polkadot/api": "10.1.4",
|
||||
"@polkadot/types": "10.1.4",
|
||||
"@polkadot/types-codec": "10.1.4",
|
||||
"@polkadot/types-create": "10.1.4",
|
||||
"@polkadot/util": "^11.1.1",
|
||||
"@polkadot/util-crypto": "^11.1.1",
|
||||
"rxjs": "^7.8.0",
|
||||
"tslib": "^2.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/api-augment": "10.1.3",
|
||||
"@polkadot/keyring": "^11.0.2"
|
||||
"@polkadot/api-augment": "10.1.4",
|
||||
"@polkadot/keyring": "^11.1.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import type { Registry } from '@polkadot/types/types';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import { TypeRegistry } from '@polkadot/types';
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ function createConverter <I, O> (next: (registry: Registry, input: O) => Contrac
|
||||
next(registry, step(registry, input));
|
||||
}
|
||||
|
||||
export function v4ToLatest (registry: Registry, v4: ContractMetadataV4): ContractMetadataLatest {
|
||||
export function v4ToLatest (_registry: Registry, v4: ContractMetadataV4): ContractMetadataLatest {
|
||||
return v4;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,6 @@
|
||||
import type { ContractMetadataV3, ContractMetadataV4 } from '@polkadot/types/interfaces';
|
||||
import type { Registry } from '@polkadot/types/types';
|
||||
|
||||
export function v3ToV4 (registry: Registry, v3: ContractMetadataV3): ContractMetadataV4 {
|
||||
export function v3ToV4 (_registry: Registry, v3: ContractMetadataV3): ContractMetadataV4 {
|
||||
return v3;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '10.1.3' };
|
||||
export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '10.1.4' };
|
||||
|
||||
@@ -18,25 +18,25 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "10.1.3",
|
||||
"version": "10.1.4",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@polkadot/api": "10.1.3",
|
||||
"@polkadot/api-augment": "10.1.3",
|
||||
"@polkadot/api-base": "10.1.3",
|
||||
"@polkadot/rpc-core": "10.1.3",
|
||||
"@polkadot/types": "10.1.3",
|
||||
"@polkadot/types-codec": "10.1.3",
|
||||
"@polkadot/util": "^11.0.2",
|
||||
"@polkadot/util-crypto": "^11.0.2",
|
||||
"@polkadot/api": "10.1.4",
|
||||
"@polkadot/api-augment": "10.1.4",
|
||||
"@polkadot/api-base": "10.1.4",
|
||||
"@polkadot/rpc-core": "10.1.4",
|
||||
"@polkadot/types": "10.1.4",
|
||||
"@polkadot/types-codec": "10.1.4",
|
||||
"@polkadot/util": "^11.1.1",
|
||||
"@polkadot/util-crypto": "^11.1.1",
|
||||
"rxjs": "^7.8.0",
|
||||
"tslib": "^2.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/api": "10.1.3",
|
||||
"@polkadot/api-augment": "10.1.3",
|
||||
"@polkadot/rpc-augment": "10.1.3",
|
||||
"@polkadot/rpc-provider": "10.1.3",
|
||||
"@polkadot/types-support": "10.1.3"
|
||||
"@polkadot/api": "10.1.4",
|
||||
"@polkadot/api-augment": "10.1.4",
|
||||
"@polkadot/rpc-augment": "10.1.4",
|
||||
"@polkadot/rpc-provider": "10.1.4",
|
||||
"@polkadot/types-support": "10.1.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ export function idAndIndex (instanceId: string, api: DeriveApi): (address?: Addr
|
||||
return api.derive.accounts.indexToId(accountIndex.toString()).pipe(
|
||||
map((accountId): AccountIdAndIndex => [accountId, accountIndex])
|
||||
);
|
||||
} catch (error) {
|
||||
} catch {
|
||||
return of([undefined, undefined]);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/api-derive authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import type { SubmittableExtrinsic } from '@polkadot/api-base/types';
|
||||
import type { Bytes, Option, StorageKey } from '@polkadot/types';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/api-derive authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '10.1.3' };
|
||||
export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '10.1.4' };
|
||||
|
||||
@@ -11,7 +11,6 @@ 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<DeriveOwnExposure[]> {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
return memo(instanceId, (accountId: Uint8Array | string, eras: EraIndex[], _withActive: boolean): Observable<DeriveOwnExposure[]> =>
|
||||
eras.length
|
||||
? combineLatest([
|
||||
|
||||
@@ -12,7 +12,6 @@ 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<DeriveStakerSlashes[]> {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
return memo(instanceId, (accountId: Uint8Array | string, eras: EraIndex[], _withActive: boolean): Observable<DeriveStakerSlashes[]> =>
|
||||
eras.length
|
||||
? combineLatest([
|
||||
|
||||
@@ -11,7 +11,6 @@ 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<DeriveStakerPrefs[]> {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
return memo(instanceId, (accountId: Uint8Array | string, eras: EraIndex[], _withActive: boolean): Observable<DeriveStakerPrefs[]> =>
|
||||
api.query.staking.erasValidatorPrefs.multi(eras.map((e) => [e, accountId])).pipe(
|
||||
map((all): DeriveStakerPrefs[] =>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/api-derive authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import type { ApprovalFlag } from '@polkadot/types/interfaces';
|
||||
|
||||
|
||||
+17
-17
@@ -18,29 +18,29 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "10.1.3",
|
||||
"version": "10.1.4",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@polkadot/api-augment": "10.1.3",
|
||||
"@polkadot/api-base": "10.1.3",
|
||||
"@polkadot/api-derive": "10.1.3",
|
||||
"@polkadot/keyring": "^11.0.2",
|
||||
"@polkadot/rpc-augment": "10.1.3",
|
||||
"@polkadot/rpc-core": "10.1.3",
|
||||
"@polkadot/rpc-provider": "10.1.3",
|
||||
"@polkadot/types": "10.1.3",
|
||||
"@polkadot/types-augment": "10.1.3",
|
||||
"@polkadot/types-codec": "10.1.3",
|
||||
"@polkadot/types-create": "10.1.3",
|
||||
"@polkadot/types-known": "10.1.3",
|
||||
"@polkadot/util": "^11.0.2",
|
||||
"@polkadot/util-crypto": "^11.0.2",
|
||||
"@polkadot/api-augment": "10.1.4",
|
||||
"@polkadot/api-base": "10.1.4",
|
||||
"@polkadot/api-derive": "10.1.4",
|
||||
"@polkadot/keyring": "^11.1.1",
|
||||
"@polkadot/rpc-augment": "10.1.4",
|
||||
"@polkadot/rpc-core": "10.1.4",
|
||||
"@polkadot/rpc-provider": "10.1.4",
|
||||
"@polkadot/types": "10.1.4",
|
||||
"@polkadot/types-augment": "10.1.4",
|
||||
"@polkadot/types-codec": "10.1.4",
|
||||
"@polkadot/types-create": "10.1.4",
|
||||
"@polkadot/types-known": "10.1.4",
|
||||
"@polkadot/util": "^11.1.1",
|
||||
"@polkadot/util-crypto": "^11.1.1",
|
||||
"eventemitter3": "^5.0.0",
|
||||
"rxjs": "^7.8.0",
|
||||
"tslib": "^2.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/api-augment": "10.1.3",
|
||||
"@polkadot/types-support": "10.1.3"
|
||||
"@polkadot/api-augment": "10.1.4",
|
||||
"@polkadot/types-support": "10.1.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '10.1.3' };
|
||||
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '10.1.4' };
|
||||
|
||||
@@ -62,7 +62,7 @@ export class Combinator<T extends unknown[] = unknown[]> {
|
||||
try {
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
this.#callback(this.#results as T);
|
||||
} catch (error) {
|
||||
} catch {
|
||||
// swallow, we don't want the handler to trip us up
|
||||
}
|
||||
}
|
||||
@@ -82,7 +82,7 @@ export class Combinator<T extends unknown[] = unknown[]> {
|
||||
if (isFunction(unsubscribe)) {
|
||||
unsubscribe();
|
||||
}
|
||||
} catch (error) {
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/api authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import type { UnsubscribePromise } from '../types/index.js';
|
||||
|
||||
@@ -98,8 +98,7 @@ describe('Combinator', (): void => {
|
||||
mocker,
|
||||
// eslint-disable-next-line @typescript-eslint/require-await
|
||||
async (): UnsubscribePromise => (): void => undefined
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
], (value: any[]): void => {
|
||||
], (_: any[]): void => {
|
||||
// ignore
|
||||
});
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/api authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { SubmittableExtrinsic } from '../types/index.js';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/api authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import { augmentObject } from './augmentObject.js';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/api authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import { decorateStorage, Metadata, TypeRegistry } from '@polkadot/types';
|
||||
import metaStatic from '@polkadot/types-support/metadata/static-substrate';
|
||||
|
||||
@@ -18,13 +18,13 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "10.1.3",
|
||||
"version": "10.1.4",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@polkadot/rpc-core": "10.1.3",
|
||||
"@polkadot/types": "10.1.3",
|
||||
"@polkadot/types-codec": "10.1.3",
|
||||
"@polkadot/util": "^11.0.2",
|
||||
"@polkadot/rpc-core": "10.1.4",
|
||||
"@polkadot/types": "10.1.4",
|
||||
"@polkadot/types-codec": "10.1.4",
|
||||
"@polkadot/util": "^11.1.1",
|
||||
"tslib": "^2.5.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '10.1.3' };
|
||||
export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '10.1.4' };
|
||||
|
||||
@@ -18,18 +18,18 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "10.1.3",
|
||||
"version": "10.1.4",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@polkadot/rpc-augment": "10.1.3",
|
||||
"@polkadot/rpc-provider": "10.1.3",
|
||||
"@polkadot/types": "10.1.3",
|
||||
"@polkadot/util": "^11.0.2",
|
||||
"@polkadot/rpc-augment": "10.1.4",
|
||||
"@polkadot/rpc-provider": "10.1.4",
|
||||
"@polkadot/types": "10.1.4",
|
||||
"@polkadot/util": "^11.1.1",
|
||||
"rxjs": "^7.8.0",
|
||||
"tslib": "^2.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^11.0.2",
|
||||
"@polkadot/rpc-augment": "10.1.3"
|
||||
"@polkadot/keyring": "^11.1.1",
|
||||
"@polkadot/rpc-augment": "10.1.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/rpc-core authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import type { RpcInterface } from './types/index.js';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/rpc-core authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import type { ProviderInterface } from '@polkadot/rpc-provider/types';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/rpc-core authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import type { ProviderInterface } from '@polkadot/rpc-provider/types';
|
||||
import type { DefinitionRpc } from '@polkadot/types/types';
|
||||
@@ -33,7 +33,7 @@ describe('methodSend', (): void => {
|
||||
};
|
||||
|
||||
provider = {
|
||||
send: jest.fn((method: string, params: unknown[]): Promise<unknown> =>
|
||||
send: jest.fn((_method: string, params: unknown[]): Promise<unknown> =>
|
||||
Promise.resolve(params[0])
|
||||
)
|
||||
} as unknown as ProviderInterface;
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '10.1.3' };
|
||||
export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '10.1.4' };
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/rpc-core authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import type { RpcInterface } from './types/index.js';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/api-derive authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import { of, timer } from 'rxjs';
|
||||
|
||||
|
||||
@@ -18,26 +18,26 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "10.1.3",
|
||||
"version": "10.1.4",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@polkadot/keyring": "^11.0.2",
|
||||
"@polkadot/types": "10.1.3",
|
||||
"@polkadot/types-support": "10.1.3",
|
||||
"@polkadot/util": "^11.0.2",
|
||||
"@polkadot/util-crypto": "^11.0.2",
|
||||
"@polkadot/x-fetch": "^11.0.2",
|
||||
"@polkadot/x-global": "^11.0.2",
|
||||
"@polkadot/x-ws": "^11.0.2",
|
||||
"@polkadot/keyring": "^11.1.1",
|
||||
"@polkadot/types": "10.1.4",
|
||||
"@polkadot/types-support": "10.1.4",
|
||||
"@polkadot/util": "^11.1.1",
|
||||
"@polkadot/util-crypto": "^11.1.1",
|
||||
"@polkadot/x-fetch": "^11.1.1",
|
||||
"@polkadot/x-global": "^11.1.1",
|
||||
"@polkadot/x-ws": "^11.1.1",
|
||||
"eventemitter3": "^5.0.0",
|
||||
"mock-socket": "^9.2.1",
|
||||
"nock": "^13.3.0",
|
||||
"tslib": "^2.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@substrate/connect": "0.7.20"
|
||||
"@substrate/connect": "0.7.21"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@substrate/connect": "0.7.20"
|
||||
"@substrate/connect": "0.7.21"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/rpc-provider authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import type { JsonRpcResponse } from '../types.js';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/rpc-provider authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import { RpcCoder } from './index.js';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/rpc-provider authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import { RpcCoder } from './index.js';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/rpc-provider authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import { isError } from '@polkadot/util';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/rpc-provider authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import { TEST_HTTP_URL } from '../mock/mockHttp.js';
|
||||
import { HttpProvider } from './index.js';
|
||||
|
||||
@@ -112,8 +112,7 @@ export class HttpProvider implements ProviderInterface {
|
||||
* @summary Events are not supported with the HttpProvider, see [[WsProvider]].
|
||||
* @description HTTP Provider does not have 'on' emitters. WebSockets should be used instead.
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
public on (type: ProviderInterfaceEmitted, sub: ProviderInterfaceEmitCb): () => void {
|
||||
public on (_type: ProviderInterfaceEmitted, _sub: ProviderInterfaceEmitCb): () => void {
|
||||
l.error('HTTP Provider does not have \'on\' emitters, use WebSockets instead');
|
||||
|
||||
return (): void => {
|
||||
@@ -185,8 +184,8 @@ export class HttpProvider implements ProviderInterface {
|
||||
/**
|
||||
* @summary Subscriptions are not supported with the HttpProvider, see [[WsProvider]].
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/require-await
|
||||
public async subscribe (types: string, method: string, params: unknown[], cb: ProviderInterfaceCallback): Promise<number> {
|
||||
// eslint-disable-next-line @typescript-eslint/require-await
|
||||
public async subscribe (_types: string, _method: string, _params: unknown[], _cb: ProviderInterfaceCallback): Promise<number> {
|
||||
l.error(ERROR_SUBSCRIBE);
|
||||
|
||||
throw new Error(ERROR_SUBSCRIBE);
|
||||
@@ -195,8 +194,8 @@ export class HttpProvider implements ProviderInterface {
|
||||
/**
|
||||
* @summary Subscriptions are not supported with the HttpProvider, see [[WsProvider]].
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/require-await
|
||||
public async unsubscribe (type: string, method: string, id: number): Promise<boolean> {
|
||||
// eslint-disable-next-line @typescript-eslint/require-await
|
||||
public async unsubscribe (_type: string, _method: string, _id: number): Promise<boolean> {
|
||||
l.error(ERROR_SUBSCRIBE);
|
||||
|
||||
throw new Error(ERROR_SUBSCRIBE);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/rpc-provider authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import type { Mock } from '../mock/types.js';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/rpc-provider authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import { LRUCache } from './lru.js';
|
||||
|
||||
|
||||
@@ -53,9 +53,8 @@ export class MockProvider implements ProviderInterface {
|
||||
private prevNumber = new BN(-1);
|
||||
|
||||
private requests: Record<string, (...params: any[]) => unknown> = {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/no-unsafe-member-access
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
chain_getBlock: () => this.registry.createType('SignedBlock', rpcSignedBlock.result).toJSON(),
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
chain_getBlockHash: () => '0x1234000000000000000000000000000000000000000000000000000000000000',
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
chain_getFinalizedHead: () => this.registry.createType('Header', rpcHeader.result).hash,
|
||||
@@ -144,7 +143,7 @@ export class MockProvider implements ProviderInterface {
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/require-await
|
||||
public async subscribe (type: string, method: string, ...params: unknown[]): Promise<number> {
|
||||
public async subscribe (_type: string, method: string, ...params: unknown[]): Promise<number> {
|
||||
l.debug(() => ['subscribe', method, params]);
|
||||
|
||||
if (!this.subscriptions[method]) {
|
||||
@@ -165,7 +164,7 @@ export class MockProvider implements ProviderInterface {
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/require-await
|
||||
public async unsubscribe (type: string, method: string, id: number): Promise<boolean> {
|
||||
public async unsubscribe (_type: string, _method: string, id: number): Promise<boolean> {
|
||||
const sub = this.subscriptionMap[id];
|
||||
|
||||
l.debug(() => ['unsubscribe', id, sub]);
|
||||
|
||||
@@ -25,7 +25,7 @@ export function mockHttp (requests: Request[]): Mock {
|
||||
return requests.reduce((scope: HttpMock, request: Request) =>
|
||||
scope
|
||||
.post('/')
|
||||
.reply(request.code || 200, (uri: string, body: { id: string }) => {
|
||||
.reply(request.code || 200, (_uri: string, body: { id: string }) => {
|
||||
scope.body = scope.body || {};
|
||||
scope.body[request.method] = body;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/rpc-provider authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import type { ProviderInterfaceEmitted } from '../types.js';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/rpc-provider authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import { TypeRegistry } from '@polkadot/types/create';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/rpc-provider authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import { TypeRegistry } from '@polkadot/types/create';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/rpc-provider authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import { TypeRegistry } from '@polkadot/types/create';
|
||||
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/rpc-provider', path: 'auto', type: 'auto', version: '10.1.3' };
|
||||
export const packageInfo = { name: '@polkadot/rpc-provider', path: 'auto', type: 'auto', version: '10.1.4' };
|
||||
|
||||
@@ -113,7 +113,7 @@ class InnerChecker {
|
||||
|
||||
try {
|
||||
parsedRequest = JSON.parse(request) as JSONRequest;
|
||||
} catch (err) {
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ class InnerChecker {
|
||||
|
||||
try {
|
||||
parsedResponse = JSON.parse(jsonRpcResponse) as { id: string, result: undefined | SmoldotHealth };
|
||||
} catch (err) {
|
||||
} catch {
|
||||
return jsonRpcResponse;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/rpc-provider authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
/* eslint-disable sort-keys */
|
||||
/* eslint-disable promise/param-names */
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/rpc-provider authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import type { Mock } from '../mock/types.js';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/rpc-provider authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import type { Request } from '../mock/mockWs.js';
|
||||
import type { Mock } from '../mock/types.js';
|
||||
|
||||
@@ -138,7 +138,7 @@ export class WsProvider implements ProviderInterface {
|
||||
this.#endpointStats = defaultEndpointStats();
|
||||
this.#timeout = timeout || DEFAULT_TIMEOUT_MS;
|
||||
|
||||
if (autoConnectMs > 0) {
|
||||
if (autoConnectMs && autoConnectMs > 0) {
|
||||
this.connectWithRetry().catch((): void => {
|
||||
// does not throw
|
||||
});
|
||||
@@ -243,7 +243,7 @@ export class WsProvider implements ProviderInterface {
|
||||
if (this.#autoConnectMs > 0) {
|
||||
try {
|
||||
await this.connect();
|
||||
} catch (error) {
|
||||
} catch {
|
||||
setTimeout((): void => {
|
||||
this.connectWithRetry().catch((): void => {
|
||||
// does not throw
|
||||
@@ -417,7 +417,7 @@ export class WsProvider implements ProviderInterface {
|
||||
return this.isConnected && !isNull(this.#websocket)
|
||||
? this.send<boolean>(method, [id])
|
||||
: true;
|
||||
} catch (error) {
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/rpc-provider authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import type { Request } from '../mock/mockWs.js';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/rpc-provider authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import { WsProvider } from './index.js';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/rpc-provider authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import type { Request } from '../mock/mockWs.js';
|
||||
import type { Global, Mock } from './../mock/types.js';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/rpc-provider authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import type { Request } from '../mock/mockWs.js';
|
||||
import type { Global, Mock } from './../mock/types.js';
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "10.1.3",
|
||||
"version": "10.1.4",
|
||||
"main": "index.js",
|
||||
"bin": {
|
||||
"polkadot-types-chain-info": "./scripts/polkadot-types-chain-info.mjs",
|
||||
@@ -28,18 +28,18 @@
|
||||
"polkadot-types-internal-metadata": "./scripts/polkadot-types-internal-metadata.mjs"
|
||||
},
|
||||
"dependencies": {
|
||||
"@polkadot/api": "10.1.3",
|
||||
"@polkadot/api-augment": "10.1.3",
|
||||
"@polkadot/rpc-augment": "10.1.3",
|
||||
"@polkadot/rpc-provider": "10.1.3",
|
||||
"@polkadot/types": "10.1.3",
|
||||
"@polkadot/types-augment": "10.1.3",
|
||||
"@polkadot/types-codec": "10.1.3",
|
||||
"@polkadot/types-create": "10.1.3",
|
||||
"@polkadot/types-support": "10.1.3",
|
||||
"@polkadot/util": "^11.0.2",
|
||||
"@polkadot/util-crypto": "^11.0.2",
|
||||
"@polkadot/x-ws": "^11.0.2",
|
||||
"@polkadot/api": "10.1.4",
|
||||
"@polkadot/api-augment": "10.1.4",
|
||||
"@polkadot/rpc-augment": "10.1.4",
|
||||
"@polkadot/rpc-provider": "10.1.4",
|
||||
"@polkadot/types": "10.1.4",
|
||||
"@polkadot/types-augment": "10.1.4",
|
||||
"@polkadot/types-codec": "10.1.4",
|
||||
"@polkadot/types-create": "10.1.4",
|
||||
"@polkadot/types-support": "10.1.4",
|
||||
"@polkadot/util": "^11.1.1",
|
||||
"@polkadot/util-crypto": "^11.1.1",
|
||||
"@polkadot/x-ws": "^11.1.1",
|
||||
"handlebars": "^4.7.7",
|
||||
"tslib": "^2.5.0",
|
||||
"yargs": "^17.7.1"
|
||||
|
||||
@@ -218,7 +218,7 @@ function generateLookupTypes (registry: Registry, filtered: [PortableType, TypeD
|
||||
writeFile(path.join(destDir, 'index.ts'), () => generateLookupIndexTmpl({ headerType: 'defs' }), true);
|
||||
}
|
||||
|
||||
function generateRegistry (registry: Registry, filtered: [PortableType, TypeDef][], destDir: string, subPath: string): void {
|
||||
function generateRegistry (_registry: Registry, filtered: [PortableType, TypeDef][], destDir: string, subPath: string): void {
|
||||
writeFile(path.join(destDir, `${subPath}.ts`), (): string => {
|
||||
const items = filtered
|
||||
.map(([, { lookupName }]) => lookupName)
|
||||
|
||||
@@ -32,8 +32,7 @@ export function createGetter (definitions: Record<string, ModuleTypes>, name = '
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
function errorUnhandled (_: Registry, definitions: Record<string, ModuleTypes>, def: TypeDef, imports: TypeImports): string {
|
||||
function errorUnhandled (_: Registry, _definitions: Record<string, ModuleTypes>, def: TypeDef, _imports: TypeImports): string {
|
||||
throw new Error(`Generate: ${def.name || ''}: Unhandled type ${TypeDefInfo[def.info]}`);
|
||||
}
|
||||
|
||||
@@ -96,7 +95,7 @@ function tsInt (_: Registry, definitions: Record<string, ModuleTypes>, def: Type
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
function tsNull (registry: Registry, definitions: Record<string, ModuleTypes>, { lookupIndex = -1, name }: TypeDef, imports: TypeImports): string {
|
||||
function tsNull (_registry: Registry, definitions: Record<string, ModuleTypes>, { lookupIndex = -1, name }: TypeDef, imports: TypeImports): string {
|
||||
setImports(definitions, imports, ['Null']);
|
||||
|
||||
// * @description extends [[${base}]]
|
||||
@@ -151,8 +150,7 @@ function tsResult (registry: Registry, definitions: Record<string, ModuleTypes>,
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
function tsSi (registry: Registry, definitions: Record<string, ModuleTypes>, typeDef: TypeDef, imports: TypeImports): string {
|
||||
function tsSi (_registry: Registry, _definitions: Record<string, ModuleTypes>, typeDef: TypeDef, _imports: TypeImports): string {
|
||||
// FIXME
|
||||
return `// SI: ${JSON.stringify(typeDef)}`;
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '10.1.3' };
|
||||
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '10.1.4' };
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/typegen authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import { TypeRegistry } from '@polkadot/types/create';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/typegen authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import { TypeRegistry } from '@polkadot/types';
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
// Copyright 2017-2023 @polkadot/typegen authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
|
||||
import type { AnyString, Registry } from '@polkadot/types/types';
|
||||
import type { LookupString } from '@polkadot/types-codec/types';
|
||||
import type { TypeDef } from '@polkadot/types-create/types';
|
||||
@@ -139,13 +137,13 @@ const formatters: Record<TypeDefInfo, (registry: Registry, typeDef: TypeDef, def
|
||||
return singleParamNotation(registry, 'Compact', typeDef, definitions, imports, withShortcut);
|
||||
},
|
||||
|
||||
[TypeDefInfo.DoNotConstruct]: (registry: Registry, { lookupName }: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
[TypeDefInfo.DoNotConstruct]: (_registry: Registry, _typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, _withShortcut: boolean) => {
|
||||
setImports(definitions, imports, ['DoNotConstruct']);
|
||||
|
||||
return 'DoNotConstruct';
|
||||
},
|
||||
|
||||
[TypeDefInfo.Enum]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
[TypeDefInfo.Enum]: (_registry: Registry, typeDef: TypeDef, _definitions: Record<string, ModuleTypes>, _imports: TypeImports, _withShortcut: boolean) => {
|
||||
if (typeDef.lookupName) {
|
||||
return typeDef.lookupName;
|
||||
}
|
||||
@@ -153,15 +151,15 @@ const formatters: Record<TypeDefInfo, (registry: Registry, typeDef: TypeDef, def
|
||||
throw new Error(`TypeDefInfo.Enum: Parameter formatting not implemented on ${stringify(typeDef)}`);
|
||||
},
|
||||
|
||||
[TypeDefInfo.Int]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
[TypeDefInfo.Int]: (_registry: Registry, typeDef: TypeDef, _definitions: Record<string, ModuleTypes>, _imports: TypeImports, _withShortcut: boolean) => {
|
||||
throw new Error(`TypeDefInfo.Int: Parameter formatting not implemented on ${stringify(typeDef)}`);
|
||||
},
|
||||
|
||||
[TypeDefInfo.UInt]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
[TypeDefInfo.UInt]: (_registry: Registry, typeDef: TypeDef, _definitions: Record<string, ModuleTypes>, _imports: TypeImports, _withShortcut: boolean) => {
|
||||
throw new Error(`TypeDefInfo.UInt: Parameter formatting not implemented on ${stringify(typeDef)}`);
|
||||
},
|
||||
|
||||
[TypeDefInfo.Null]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
[TypeDefInfo.Null]: (_registry: Registry, _typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, _withShortcut: boolean) => {
|
||||
setImports(definitions, imports, ['Null']);
|
||||
|
||||
return 'Null';
|
||||
@@ -171,7 +169,7 @@ const formatters: Record<TypeDefInfo, (registry: Registry, typeDef: TypeDef, def
|
||||
return singleParamNotation(registry, 'Option', typeDef, definitions, imports, withShortcut);
|
||||
},
|
||||
|
||||
[TypeDefInfo.Plain]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
[TypeDefInfo.Plain]: (_registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, _withShortcut: boolean) => {
|
||||
setImports(definitions, imports, [typeDef.type]);
|
||||
|
||||
return typeDef.type;
|
||||
@@ -185,7 +183,7 @@ const formatters: Record<TypeDefInfo, (registry: Registry, typeDef: TypeDef, def
|
||||
return singleParamNotation(registry, 'RangeInclusive', typeDef, definitions, imports, withShortcut);
|
||||
},
|
||||
|
||||
[TypeDefInfo.Set]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
[TypeDefInfo.Set]: (_registry: Registry, typeDef: TypeDef, _definitions: Record<string, ModuleTypes>, _imports: TypeImports, _withShortcut: boolean) => {
|
||||
throw new Error(`TypeDefInfo.Set: Parameter formatting not implemented on ${stringify(typeDef)}`);
|
||||
},
|
||||
|
||||
|
||||
@@ -36,6 +36,9 @@ async function getWsData <T> (endpoint: string, method: 'rpc_methods' | 'state_g
|
||||
websocket.close();
|
||||
};
|
||||
} catch (error) {
|
||||
console.error();
|
||||
console.error(error);
|
||||
console.error();
|
||||
process.exit(1);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -18,12 +18,12 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "10.1.3",
|
||||
"version": "10.1.4",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@polkadot/types": "10.1.3",
|
||||
"@polkadot/types-codec": "10.1.3",
|
||||
"@polkadot/util": "^11.0.2",
|
||||
"@polkadot/types": "10.1.4",
|
||||
"@polkadot/types-codec": "10.1.4",
|
||||
"@polkadot/util": "^11.1.1",
|
||||
"tslib": "^2.5.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/types-augment', path: 'auto', type: 'auto', version: '10.1.3' };
|
||||
export const packageInfo = { name: '@polkadot/types-augment', path: 'auto', type: 'auto', version: '10.1.4' };
|
||||
|
||||
@@ -18,17 +18,17 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "10.1.3",
|
||||
"version": "10.1.4",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@polkadot/util": "^11.0.2",
|
||||
"@polkadot/x-bigint": "^11.0.2",
|
||||
"@polkadot/util": "^11.1.1",
|
||||
"@polkadot/x-bigint": "^11.1.1",
|
||||
"tslib": "^2.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/types": "10.1.3",
|
||||
"@polkadot/types-augment": "10.1.3",
|
||||
"@polkadot/types-support": "10.1.3",
|
||||
"@polkadot/util-crypto": "^11.0.2"
|
||||
"@polkadot/types": "10.1.4",
|
||||
"@polkadot/types-augment": "10.1.4",
|
||||
"@polkadot/types-support": "10.1.4",
|
||||
"@polkadot/util-crypto": "^11.1.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -197,8 +197,7 @@ export abstract class AbstractInt extends BN implements INumber {
|
||||
/**
|
||||
* @description Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
public toHuman (isExpanded?: boolean): string {
|
||||
public toHuman (_isExpanded?: boolean): string {
|
||||
const rawType = this.toRawType();
|
||||
|
||||
if (rawType === 'Balance') {
|
||||
@@ -263,8 +262,7 @@ export abstract class AbstractInt extends BN implements INumber {
|
||||
* @description Encodes the value as a Uint8Array as per the SCALE specifications
|
||||
* @param isBare true when the value has none of the type-specific prefixes (internal)
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
public toU8a (isBare?: boolean): Uint8Array {
|
||||
public toU8a (_isBare?: boolean): Uint8Array {
|
||||
return bnToU8a(this, {
|
||||
bitLength: this.bitLength(),
|
||||
isLe: true,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/types-codec authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import { TypeRegistry } from '@polkadot/types';
|
||||
import { CodecDate, Compact, U32 } from '@polkadot/types-codec';
|
||||
|
||||
@@ -195,8 +195,7 @@ export class Compact<T extends INumber> implements ICompact<T> {
|
||||
* @description Encodes the value as a Uint8Array as per the SCALE specifications
|
||||
* @param isBare true when the value has none of the type-specific prefixes (internal)
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
public toU8a (isBare?: boolean): Uint8Array {
|
||||
public toU8a (_isBare?: boolean): Uint8Array {
|
||||
return compactToU8a(this.#raw.toBn());
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/types-codec authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import { TypeRegistry } from '@polkadot/types';
|
||||
import { DoNotConstruct } from '@polkadot/types-codec';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/types-codec authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import type { Registry } from '@polkadot/types-codec/types';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/types-codec authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import { TypeRegistry } from '@polkadot/types';
|
||||
import { Int } from '@polkadot/types-codec';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/types-codec authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import { TypeRegistry } from '@polkadot/types';
|
||||
import { Null } from '@polkadot/types-codec';
|
||||
|
||||
@@ -91,8 +91,7 @@ export class Null implements Codec {
|
||||
* @description Encodes the value as a Uint8Array as per the SCALE specifications
|
||||
* @param isBare true when the value has none of the type-specific prefixes (internal)
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
public toU8a (isBare?: boolean): Uint8Array {
|
||||
public toU8a (_isBare?: boolean): Uint8Array {
|
||||
return new Uint8Array();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/types-codec authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import { TypeRegistry } from '@polkadot/types';
|
||||
import { bool, Bytes, Null, Option, Text, U32 } from '@polkadot/types-codec';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/types-codec authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import { TypeRegistry } from '@polkadot/types';
|
||||
import { Result, Text, u32 } from '@polkadot/types-codec';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/types-codec authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import type { BlockNumber, VoteThreshold } from '@polkadot/types/interfaces';
|
||||
import type { AnyTupleValue, CodecTo } from '@polkadot/types-codec/types';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/types-codec authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import { TypeRegistry } from '@polkadot/types';
|
||||
import { UInt } from '@polkadot/types-codec';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/types-codec authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import type { PropIndex } from '@polkadot/types/interfaces/democracy';
|
||||
import type { Codec, CodecTo, ITuple } from '@polkadot/types-codec/types';
|
||||
@@ -131,7 +131,7 @@ describe('Vec', (): void => {
|
||||
|
||||
it('exposes a working filter', (): void => {
|
||||
expect(
|
||||
vector.filter((e, i): boolean => i >= 3).toString()
|
||||
vector.filter((_, i): boolean => i >= 3).toString()
|
||||
).toEqual('4567,56789');
|
||||
});
|
||||
|
||||
|
||||
@@ -118,14 +118,14 @@ export class Vec<T extends Codec> extends AbstractArray<T> {
|
||||
/**
|
||||
* @description Finds the index of the value in the array
|
||||
*/
|
||||
public override indexOf (_other?: unknown): number {
|
||||
public override indexOf (other?: unknown): number {
|
||||
// convert type first, this removes overhead from the eq
|
||||
const other = _other instanceof this.#Type
|
||||
? _other
|
||||
: new this.#Type(this.registry, _other);
|
||||
const check = other instanceof this.#Type
|
||||
? other
|
||||
: new this.#Type(this.registry, other);
|
||||
|
||||
for (let i = 0; i < this.length; i++) {
|
||||
if (other.eq(this[i])) {
|
||||
if (check.eq(this[i])) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/types-codec authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import { TypeRegistry } from '@polkadot/types';
|
||||
import { Text, u16, VecFixed } from '@polkadot/types-codec';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/types-codec authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import type { CodecClass, ITuple } from '@polkadot/types-codec/types';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/types-codec authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import type { CodecClass, CodecTo } from '@polkadot/types-codec/types';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/types-codec authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev/node/test/node.d.ts" />
|
||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||
|
||||
import { TypeRegistry } from '@polkadot/types';
|
||||
import { hexToU8a } from '@polkadot/util';
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user