Compare commits

..
26 Commits
Author SHA1 Message Date
github-actions[bot] b2c8e748c3 [CI Skip] release/stable 10.1.4
skip-checks: true
2023-03-19 08:20:05 +00:00
Jaco be9feced65 10.1.4 (#5550) 2023-03-19 10:09:54 +02:00
github-actions[bot] f73ed3ef36 [CI Skip] bump/beta 10.1.4-6-x
skip-checks: true
2023-03-18 10:08:36 +00:00
Jaco cf1fabaecf Bump deps (& remove unused overrides) (#5549) 2023-03-18 11:59:42 +02:00
github-actions[bot] ac8446b30c [CI Skip] bump/beta 10.1.4-5-x
skip-checks: true
2023-03-17 06:11:26 +00:00
Jaco abb802bc92 Bump to TS 5.0 (#5548) 2023-03-17 08:00:08 +02:00
github-actions[bot] 9cc2cd8240 [CI Skip] bump/beta 10.1.4-4-x
skip-checks: true
2023-03-16 19:40:55 +00:00
Jaco efbbde74fc Bump dev deps (#5547)
* Bump dev deps

* Bump dev
2023-03-16 21:31:57 +02:00
github-actions[bot] ba5a02b5f5 [CI Skip] bump/beta 10.1.4-3-x
skip-checks: true
2023-03-16 06:47:23 +00:00
Jaco e035ba20ac Adjust CHANGELOG (#5546)
* Adjust CHANGELOG

* typo
2023-03-16 08:38:01 +02:00
github-actions[bot] 116b6ee1b5 [CI Skip] bump/beta 10.1.4-2-x
skip-checks: true
2023-03-16 05:28:33 +00:00
Jaco 8d1736c047 Cater for runtime Metadata_* v2 (#5545)
* Cater for runtime Metadata_* v2

* Swap order, latest first (as elsewhere)
2023-03-16 07:19:32 +02:00
github-actions[bot] 4408f3a3ac [CI Skip] bump/beta 10.1.4-1-x
skip-checks: true
2023-03-15 15:23:51 +00:00
Jaco 058edbe9c5 Bump dev (#5544)
* Bump dev

* Change ref types

* Fix build
2023-03-15 17:14:35 +02:00
github-actions[bot] 0c5211c1a6 [CI Skip] bump/beta 10.1.4-0-x
skip-checks: true
2023-03-15 12:00:44 +00:00
Jaco 7a5ef6249e Bump dev (#5542) 2023-03-15 13:51:48 +02:00
github-actions[bot] 5fa64a9e26 [CI Skip] release/stable 10.1.3
skip-checks: true
2023-03-15 10:50:09 +00:00
Jaco 48d2dbd885 10.1.3: Remove wrong .module specifier in typegen (#5541)
* Remove wrong .module specifier in typegen

* 10.1.3

* Reset

* Revert "10.1.3"

This reverts commit 1c6d8ff0720a8c221fe30e4cca17c5211262ef09.

* Rebump 10.1.3
2023-03-15 12:30:50 +02:00
github-actions[bot] 254e218a7b [CI Skip] bump/beta 10.1.3-3-x
skip-checks: true
2023-03-14 11:27:56 +00:00
Jaco e44cf73a45 Remove stale workflow (#5539) 2023-03-14 13:08:29 +02:00
github-actions[bot] 61589add1b [CI Skip] bump/beta 10.1.3-2-x
skip-checks: true
2023-03-14 08:00:58 +00:00
Jaco 046f51daf6 Extract all unsafe Substrate RPC checks (#5538) 2023-03-14 09:41:27 +02:00
github-actions[bot] 4c3b6a660e [CI Skip] bump/beta 10.1.3-1-x
skip-checks: true
2023-03-12 10:24:50 +00:00
Jaco 5145a0c181 Bump dev (#5537)
* Bump dev

* Adjust dev/node/test/node.d.ts imports

* Fix types-support imports

* Adjust extensionless imports
2023-03-12 12:05:43 +02:00
github-actions[bot] 95fc6c0fd3 [CI Skip] bump/beta 10.1.3-0-x
skip-checks: true
2023-03-11 16:09:05 +00:00
Jaco 84621a26cb Adjust derive definitions for no reexport of types (#5536)
* Adjust derive definitions for no reexport of types

* Additional for hasProposals
2023-03-11 17:49:27 +02:00
237 changed files with 934 additions and 910 deletions
-19
View File
@@ -1,19 +0,0 @@
name: 'Close stale issues and PRs'
on:
schedule:
- cron: '55 1/3 * * *'
jobs:
stale:
runs-on: ubuntu-latest
env:
YARN_ENABLE_SCRIPTS: false
steps:
- uses: actions/stale@v7
with:
repo-token: ${{ secrets.GH_PAT_BOT }}
stale-issue-message: 'This issue has been open for 365 days with no activity and is not labelled as an enhancement. It will be closed in 7 days.'
stale-issue-label: 'stale'
exempt-issue-labels: '-size-l,-size-m,-size-s,-size-xl,-size-xs,[bug]'
days-before-stale: 365
days-before-close: 7
+15
View File
@@ -1,5 +1,20 @@
# 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
Changes:
+1 -1
View File
@@ -1,4 +1,4 @@
3396 Jaco 10.1.2 (#5535)
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)
+10 -7
View File
@@ -1,6 +1,9 @@
{
"author": "Jaco Greeff <jacogr@gmail.com>",
"bugs": "https://github.com/polkadot-js/api/issues",
"engines": {
"node": ">=14"
},
"homepage": "https://github.com/polkadot-js/api#readme",
"license": "Apache-2.0",
"packageManager": "yarn@3.2.0",
@@ -11,10 +14,10 @@
},
"sideEffects": false,
"type": "module",
"version": "10.1.2",
"version": "10.1.4",
"versions": {
"git": "10.1.2",
"npm": "10.1.2"
"git": "10.1.4",
"npm": "10.1.4"
},
"workspaces": [
"packages/*"
@@ -22,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",
@@ -37,11 +40,11 @@
"test:one": "polkadot-dev-run-test --env node"
},
"devDependencies": {
"@polkadot/dev": "^0.71.5",
"@polkadot/dev": "^0.72.15",
"@polkadot/typegen": "workspace:packages/typegen",
"@types/node": "^18.15.0"
"@types/node": "^18.15.3"
},
"resolutions": {
"typescript": "^4.9.5"
"typescript": "^5.0.2"
}
}
+8 -10
View File
@@ -1,14 +1,12 @@
{
"author": "Jaco Greeff <jacogr@gmail.com>",
"bugs": "https://github.com/polkadot-js/api/issues",
"contributors": [],
"description": "API generated augmentation",
"engines": {
"node": ">=14.0.0"
"node": ">=14"
},
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-augment#readme",
"license": "Apache-2.0",
"maintainers": [],
"name": "@polkadot/api-augment",
"repository": {
"directory": "packages/api-augment",
@@ -20,15 +18,15 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "10.1.2",
"version": "10.1.4",
"main": "index.js",
"dependencies": {
"@polkadot/api-base": "10.1.2",
"@polkadot/rpc-augment": "10.1.2",
"@polkadot/types": "10.1.2",
"@polkadot/types-augment": "10.1.2",
"@polkadot/types-codec": "10.1.2",
"@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"
}
}
+1 -1
View File
@@ -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.2' };
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '10.1.4' };
+5 -7
View File
@@ -1,14 +1,12 @@
{
"author": "Jaco Greeff <jacogr@gmail.com>",
"bugs": "https://github.com/polkadot-js/api/issues",
"contributors": [],
"description": "Interfaces for interacting with contracts and contract ABIs",
"engines": {
"node": ">=14.0.0"
"node": ">=14"
},
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-base#readme",
"license": "Apache-2.0",
"maintainers": [],
"name": "@polkadot/api-base",
"repository": {
"directory": "packages/api-base",
@@ -20,12 +18,12 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "10.1.2",
"version": "10.1.4",
"main": "index.js",
"dependencies": {
"@polkadot/rpc-core": "10.1.2",
"@polkadot/types": "10.1.2",
"@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"
}
+1 -1
View File
@@ -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.2' };
export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '10.1.4' };
+7 -2
View File
@@ -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 -4
View File
@@ -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
}
+4 -5
View File
@@ -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
}
+4 -5
View File
@@ -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
}
+4 -5
View File
@@ -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
}
+3 -3
View File
@@ -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
}
+3 -3
View File
@@ -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
}
+10 -12
View File
@@ -1,14 +1,12 @@
{
"author": "Jaco Greeff <jacogr@gmail.com>",
"bugs": "https://github.com/polkadot-js/api/issues",
"contributors": [],
"description": "Interfaces for interacting with contracts and contract ABIs",
"engines": {
"node": ">=14.0.0"
"node": ">=14"
},
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-contract#readme",
"license": "Apache-2.0",
"maintainers": [],
"name": "@polkadot/api-contract",
"repository": {
"directory": "packages/api-contract",
@@ -20,20 +18,20 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "10.1.2",
"version": "10.1.4",
"main": "index.js",
"dependencies": {
"@polkadot/api": "10.1.2",
"@polkadot/types": "10.1.2",
"@polkadot/types-codec": "10.1.2",
"@polkadot/types-create": "10.1.2",
"@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.2",
"@polkadot/keyring": "^11.0.2"
"@polkadot/api-augment": "10.1.4",
"@polkadot/keyring": "^11.1.1"
}
}
+1 -1
View File
@@ -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" />
/// <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" />
/// <reference types="@polkadot/dev-test/globals.d.ts" />
import { TypeRegistry } from '@polkadot/types';
+1 -1
View File
@@ -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;
}
+1 -1
View File
@@ -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 -1
View File
@@ -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" />
/// <reference types="@polkadot/dev-test/globals.d.ts" />
import fs from 'node:fs';
import path from 'node:path';
+1 -1
View File
@@ -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.2' };
export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '10.1.4' };
+15 -17
View File
@@ -1,14 +1,12 @@
{
"author": "Jaco Greeff <jacogr@gmail.com>",
"bugs": "https://github.com/polkadot-js/api/issues",
"contributors": [],
"description": "Common functions used across Polkadot, derived from RPC calls and storage queries.",
"engines": {
"node": ">=14.0.0"
"node": ">=14"
},
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-derive#readme",
"license": "Apache-2.0",
"maintainers": [],
"name": "@polkadot/api-derive",
"repository": {
"directory": "packages/api-derive",
@@ -20,25 +18,25 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "10.1.2",
"version": "10.1.4",
"main": "index.js",
"dependencies": {
"@polkadot/api": "10.1.2",
"@polkadot/api-augment": "10.1.2",
"@polkadot/api-base": "10.1.2",
"@polkadot/rpc-core": "10.1.2",
"@polkadot/types": "10.1.2",
"@polkadot/types-codec": "10.1.2",
"@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.2",
"@polkadot/api-augment": "10.1.2",
"@polkadot/rpc-augment": "10.1.2",
"@polkadot/rpc-provider": "10.1.2",
"@polkadot/types-support": "10.1.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-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]);
}
});
@@ -3,10 +3,6 @@
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';
// We are re-exporting these from here to ensure that *.d.ts generation is correct
export type { u32 } from '@polkadot/types';
export type { AccountId } from '@polkadot/types/interfaces';
export const members = /*#__PURE__*/ collectiveMembers('allianceMotion');
export const hasProposals = /*#__PURE__*/ collectiveHasProposals('allianceMotion');
@@ -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" />
/// <reference types="@polkadot/dev-test/globals.d.ts" />
import type { SubmittableExtrinsic } from '@polkadot/api-base/types';
import type { Bytes, Option, StorageKey } from '@polkadot/types';
@@ -5,9 +5,6 @@ import type { DeriveApi } from '../types.js';
import { createBlockNumberDerive } from './util.js';
// We are re-exporting these from here to ensure that *.d.ts generation is correct
export type { BlockNumber } from '@polkadot/types/interfaces';
/**
* @name bestNumber
* @returns The latest block number.
@@ -5,9 +5,6 @@ import type { DeriveApi } from '../types.js';
import { createBlockNumberDerive } from './util.js';
// We are re-exporting these from here to ensure that *.d.ts generation is correct
export type { BlockNumber } from '@polkadot/types/interfaces';
/**
* @name bestNumberFinalized
* @returns A BlockNumber
+1 -1
View File
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
import type { Observable } from 'rxjs';
import type { SignedBlockExtended } from '../type/types';
import type { SignedBlockExtended } from '../type/types.js';
import type { DeriveApi } from '../types.js';
import { combineLatest, map, of, switchMap } from 'rxjs';
@@ -3,7 +3,7 @@
import type { Observable } from 'rxjs';
import type { AnyNumber } from '@polkadot/types/types';
import type { SignedBlockExtended } from '../type/types';
import type { SignedBlockExtended } from '../type/types.js';
import type { DeriveApi } from '../types.js';
import { switchMap } from 'rxjs';
+1 -1
View File
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
import type { Observable } from 'rxjs';
import type { HeaderExtended } from '../type/types';
import type { HeaderExtended } from '../type/types.js';
import type { DeriveApi } from '../types.js';
import { combineLatest, map, switchMap } from 'rxjs';
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
import type { Observable } from 'rxjs';
import type { SignedBlockExtended } from '../type/types';
import type { SignedBlockExtended } from '../type/types.js';
import type { DeriveApi } from '../types.js';
import { switchMap } from 'rxjs';
+3 -1
View File
@@ -12,7 +12,9 @@ import { combineLatest, map, of } from 'rxjs';
import { memo, unwrapBlockNumber } from '../util/index.js';
export function createBlockNumberDerive <T extends { number: Compact<BlockNumber> | BlockNumber }> (fn: (api: DeriveApi) => Observable<T>): (instanceId: string, api: DeriveApi) => () => Observable<BlockNumber> {
export type BlockNumberDerive = (instanceId: string, api: DeriveApi) => () => Observable<BlockNumber>;
export function createBlockNumberDerive <T extends { number: Compact<BlockNumber> | BlockNumber }> (fn: (api: DeriveApi) => Observable<T>): BlockNumberDerive {
return (instanceId: string, api: DeriveApi) =>
memo(instanceId, () =>
fn(api).pipe(
@@ -1,11 +1,8 @@
// Copyright 2017-2023 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { AccountId } from '@polkadot/types/interfaces';
import type { MembersFn } from './types.js';
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';
export const members = /*#__PURE__*/ callMethod<AccountId[]>('members', []);
export const members: MembersFn = /*#__PURE__*/ callMethod('members', []);
+2 -6
View File
@@ -3,8 +3,7 @@
import type { Observable } from 'rxjs';
import type { AccountId } from '@polkadot/types/interfaces';
import type { DeriveApi } from '../types.js';
import type { Collective } from './types.js';
import type { Collective, PrimeFnRet } from './types.js';
import { map, of } from 'rxjs';
@@ -12,10 +11,7 @@ import { isFunction } from '@polkadot/util';
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';
export function prime (section: Collective): (instanceId: string, api: DeriveApi) => () => Observable<AccountId | null> {
export function prime (section: Collective): PrimeFnRet {
return withSection(section, (query) =>
(): Observable<AccountId | null> =>
isFunction(query?.prime)
@@ -2,10 +2,10 @@
// SPDX-License-Identifier: Apache-2.0
import type { Observable } from 'rxjs';
import type { Option, u32 } from '@polkadot/types';
import type { Option } from '@polkadot/types';
import type { Hash, Proposal, Votes } from '@polkadot/types/interfaces';
import type { DeriveApi, DeriveCollectiveProposal } from '../types.js';
import type { Collective } from './types.js';
import type { Collective, HasProposalsFnRet, ProposalCountFn, ProposalFnRet, ProposalHashesFn, ProposalsFnRet } from './types.js';
import { catchError, combineLatest, map, of, switchMap } from 'rxjs';
@@ -14,10 +14,6 @@ import { isFunction } from '@polkadot/util';
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';
export type { Hash, Proposal, Votes } from '@polkadot/types/interfaces';
type Result = [(Hash | Uint8Array | string)[], (Option<Proposal> | null)[], Option<Votes>[]];
function parse (api: DeriveApi, [hashes, proposals, votes]: Result): DeriveCollectiveProposal[] {
@@ -48,14 +44,14 @@ function _proposalsFrom (api: DeriveApi, query: DeriveApi['query']['council'], h
);
}
export function hasProposals (section: Collective): (instanceId: string, api: DeriveApi) => () => Observable<boolean> {
export function hasProposals (section: Collective): HasProposalsFnRet {
return withSection(section, (query) =>
(): Observable<boolean> =>
of(isFunction(query?.proposals))
);
}
export function proposals (section: Collective): (instanceId: string, api: DeriveApi) => () => Observable<DeriveCollectiveProposal[]> {
export function proposals (section: Collective): ProposalsFnRet {
return withSection(section, (query, api) =>
(): Observable<DeriveCollectiveProposal[]> =>
api.derive[section as 'council'].proposalHashes().pipe(
@@ -64,7 +60,7 @@ export function proposals (section: Collective): (instanceId: string, api: Deriv
);
}
export function proposal (section: Collective): (instanceId: string, api: DeriveApi) => (hash: Hash | Uint8Array | string) => Observable<DeriveCollectiveProposal | null> {
export function proposal (section: Collective): ProposalFnRet {
return withSection(section, (query, api) =>
(hash: Hash | Uint8Array | string): Observable<DeriveCollectiveProposal | null> =>
isFunction(query?.proposals)
@@ -73,5 +69,5 @@ export function proposal (section: Collective): (instanceId: string, api: Derive
);
}
export const proposalCount = /*#__PURE__*/ callMethod<u32 | null>('proposalCount', null);
export const proposalHashes = /*#__PURE__*/ callMethod<Hash[]>('proposals', []);
export const proposalCount: ProposalCountFn = /*#__PURE__*/ callMethod('proposalCount', null);
export const proposalHashes: ProposalHashesFn = /*#__PURE__*/ callMethod('proposals', []);
@@ -1,4 +1,30 @@
// Copyright 2017-2023 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Observable } from 'rxjs';
import type { u32 } from '@polkadot/types';
import type { AccountId, Hash } from '@polkadot/types/interfaces';
import type { DeriveApi, DeriveCollectiveProposal } from '../types.js';
export type Collective = 'allianceMotion' | 'council' | 'membership' | 'technicalCommittee';
export type HasProposalsFnRet = (instanceId: string, api: DeriveApi) => () => Observable<boolean>;
export type HasProposalsFn = (section: Collective) => HasProposalsFnRet;
export type MembersFnRet = (instanceId: string, api: DeriveApi) => () => Observable<AccountId[]>;
export type MembersFn = (section: Collective) => MembersFnRet;
export type PrimeFnRet = (instanceId: string, api: DeriveApi) => () => Observable<AccountId | null>;
export type PrimeFn = (section: Collective) => PrimeFnRet;
export type ProposalFnRet = (instanceId: string, api: DeriveApi) => (hash: Hash | Uint8Array | string) => Observable<DeriveCollectiveProposal | null>;
export type ProposalFn = (section: Collective) => ProposalFnRet;
export type ProposalsFnRet = (instanceId: string, api: DeriveApi) => () => Observable<DeriveCollectiveProposal[]>;
export type ProposalsFn = (section: Collective) => ProposalsFnRet;
export type ProposalCountFnRet = (instanceId: string, api: DeriveApi) => () => Observable<u32 | null>;
export type ProposalCountFn = (section: Collective) => ProposalCountFnRet;
export type ProposalHashesFnRet = (instanceId: string, api: DeriveApi) => () => Observable<Hash[]>;
export type ProposalHashesFn = (section: Collective) => ProposalHashesFnRet;
-4
View File
@@ -6,10 +6,6 @@ import { hasProposals as collectiveHasProposals, members as collectiveMembers, p
export * from './votes.js';
export * from './votesOf.js';
// We are re-exporting these from here to ensure that *.d.ts generation is correct
export type { u32 } from '@polkadot/types';
export type { AccountId } from '@polkadot/types/interfaces';
export const members = /*#__PURE__*/ collectiveMembers('council');
export const hasProposals = /*#__PURE__*/ collectiveHasProposals('council');
+1 -1
View File
@@ -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" />
/// <reference types="@polkadot/dev-test/globals.d.ts" />
/* eslint-disable @typescript-eslint/no-unsafe-return */
/* eslint-disable @typescript-eslint/no-unsafe-call */
@@ -3,10 +3,6 @@
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';
// We are re-exporting these from here to ensure that *.d.ts generation is correct
export type { u32 } from '@polkadot/types';
export type { AccountId } from '@polkadot/types/interfaces';
export const members = /*#__PURE__*/ collectiveMembers('membership');
export const hasProposals = /*#__PURE__*/ collectiveHasProposals('membership');
+1 -1
View File
@@ -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.2' };
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[] =>
@@ -3,10 +3,6 @@
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';
// We are re-exporting these from here to ensure that *.d.ts generation is correct
export type { u32 } from '@polkadot/types';
export type { AccountId } from '@polkadot/types/interfaces';
export const members = /*#__PURE__*/ collectiveMembers('technicalCommittee');
export const hasProposals = /*#__PURE__*/ collectiveHasProposals('technicalCommittee');
@@ -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" />
/// <reference types="@polkadot/dev-test/globals.d.ts" />
import type { ApprovalFlag } from '@polkadot/types/interfaces';
+18 -20
View File
@@ -1,14 +1,12 @@
{
"author": "Jaco Greeff <jacogr@gmail.com>",
"bugs": "https://github.com/polkadot-js/api/issues",
"contributors": [],
"description": "Promise and RxJS wrappers around the Polkadot JS RPC",
"engines": {
"node": ">=14.0.0"
"node": ">=14"
},
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api#readme",
"license": "Apache-2.0",
"maintainers": [],
"name": "@polkadot/api",
"repository": {
"directory": "packages/api",
@@ -20,29 +18,29 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "10.1.2",
"version": "10.1.4",
"main": "index.js",
"dependencies": {
"@polkadot/api-augment": "10.1.2",
"@polkadot/api-base": "10.1.2",
"@polkadot/api-derive": "10.1.2",
"@polkadot/keyring": "^11.0.2",
"@polkadot/rpc-augment": "10.1.2",
"@polkadot/rpc-core": "10.1.2",
"@polkadot/rpc-provider": "10.1.2",
"@polkadot/types": "10.1.2",
"@polkadot/types-augment": "10.1.2",
"@polkadot/types-codec": "10.1.2",
"@polkadot/types-create": "10.1.2",
"@polkadot/types-known": "10.1.2",
"@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.2",
"@polkadot/types-support": "10.1.2"
"@polkadot/api-augment": "10.1.4",
"@polkadot/types-support": "10.1.4"
}
}
+1 -1
View File
@@ -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.2' };
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '10.1.4' };
+2 -2
View File
@@ -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
}
});
+2 -3
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2023 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@polkadot/dev/node/test/node" />
/// <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 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2023 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@polkadot/dev/node/test/node" />
/// <reference types="@polkadot/dev-test/globals.d.ts" />
import type { HexString } from '@polkadot/util/types';
import type { SubmittableExtrinsic } from '../types/index.js';
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2023 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@polkadot/dev/node/test/node" />
/// <reference types="@polkadot/dev-test/globals.d.ts" />
import { augmentObject } from './augmentObject.js';
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2023 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@polkadot/dev/node/test/node" />
/// <reference types="@polkadot/dev-test/globals.d.ts" />
import { decorateStorage, Metadata, TypeRegistry } from '@polkadot/types';
import metaStatic from '@polkadot/types-support/metadata/static-substrate';
+6 -8
View File
@@ -1,14 +1,12 @@
{
"author": "Jaco Greeff <jacogr@gmail.com>",
"bugs": "https://github.com/polkadot-js/api/issues",
"contributors": [],
"description": "RPC generated augmentation",
"engines": {
"node": ">=14.0.0"
"node": ">=14"
},
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-augment#readme",
"license": "Apache-2.0",
"maintainers": [],
"name": "@polkadot/rpc-augment",
"repository": {
"directory": "packages/rpc-augment",
@@ -20,13 +18,13 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "10.1.2",
"version": "10.1.4",
"main": "index.js",
"dependencies": {
"@polkadot/rpc-core": "10.1.2",
"@polkadot/types": "10.1.2",
"@polkadot/types-codec": "10.1.2",
"@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"
}
}
+1 -1
View File
@@ -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.2' };
export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '10.1.4' };
+8 -10
View File
@@ -1,14 +1,12 @@
{
"author": "Jaco Greeff <jacogr@gmail.com>",
"bugs": "https://github.com/polkadot-js/api/issues",
"contributors": [],
"description": "A JavaScript wrapper for the Polkadot JsonRPC interface",
"engines": {
"node": ">=14.0.0"
"node": ">=14"
},
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-core#readme",
"license": "Apache-2.0",
"maintainers": [],
"name": "@polkadot/rpc-core",
"repository": {
"directory": "packages/rpc-core",
@@ -20,18 +18,18 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "10.1.2",
"version": "10.1.4",
"main": "index.js",
"dependencies": {
"@polkadot/rpc-augment": "10.1.2",
"@polkadot/rpc-provider": "10.1.2",
"@polkadot/types": "10.1.2",
"@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.2"
"@polkadot/keyring": "^11.1.1",
"@polkadot/rpc-augment": "10.1.4"
}
}
+1 -1
View File
@@ -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" />
/// <reference types="@polkadot/dev-test/globals.d.ts" />
import type { RpcInterface } from './types/index.js';
+1 -1
View File
@@ -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" />
/// <reference types="@polkadot/dev-test/globals.d.ts" />
import type { ProviderInterface } from '@polkadot/rpc-provider/types';
+2 -2
View File
@@ -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" />
/// <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;
+1 -1
View File
@@ -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.2' };
export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '10.1.4' };
+1 -1
View File
@@ -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" />
/// <reference types="@polkadot/dev-test/globals.d.ts" />
import type { RpcInterface } from './types/index.js';
+1 -1
View File
@@ -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" />
/// <reference types="@polkadot/dev-test/globals.d.ts" />
import { of, timer } from 'rxjs';
+12 -14
View File
@@ -1,14 +1,12 @@
{
"author": "Jaco Greeff <jacogr@gmail.com>",
"bugs": "https://github.com/polkadot-js/api/issues",
"contributors": [],
"description": "Transport providers for the API",
"engines": {
"node": ">=14.0.0"
"node": ">=14"
},
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-provider#readme",
"license": "Apache-2.0",
"maintainers": [],
"name": "@polkadot/rpc-provider",
"repository": {
"directory": "packages/rpc-provider",
@@ -20,26 +18,26 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "10.1.2",
"version": "10.1.4",
"main": "index.js",
"dependencies": {
"@polkadot/keyring": "^11.0.2",
"@polkadot/types": "10.1.2",
"@polkadot/types-support": "10.1.2",
"@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" />
/// <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" />
/// <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" />
/// <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" />
/// <reference types="@polkadot/dev-test/globals.d.ts" />
import { isError } from '@polkadot/util';
+1 -1
View File
@@ -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" />
/// <reference types="@polkadot/dev-test/globals.d.ts" />
import { TEST_HTTP_URL } from '../mock/mockHttp.js';
import { HttpProvider } from './index.js';
+5 -6
View File
@@ -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 -1
View File
@@ -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" />
/// <reference types="@polkadot/dev-test/globals.d.ts" />
import type { Mock } from '../mock/types.js';
+1 -1
View File
@@ -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" />
/// <reference types="@polkadot/dev-test/globals.d.ts" />
import { LRUCache } from './lru.js';
+3 -4
View File
@@ -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]);
+1 -1
View File
@@ -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 -1
View File
@@ -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" />
/// <reference types="@polkadot/dev-test/globals.d.ts" />
import type { ProviderInterfaceEmitted } from '../types.js';
+1 -1
View File
@@ -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" />
/// <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" />
/// <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" />
/// <reference types="@polkadot/dev-test/globals.d.ts" />
import { TypeRegistry } from '@polkadot/types/create';
+1 -1
View File
@@ -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.2' };
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" />
/// <reference types="@polkadot/dev-test/globals.d.ts" />
/* eslint-disable sort-keys */
/* eslint-disable promise/param-names */
+1 -1
View File
@@ -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" />
/// <reference types="@polkadot/dev-test/globals.d.ts" />
import type { Mock } from '../mock/types.js';
+1 -1
View File
@@ -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" />
/// <reference types="@polkadot/dev-test/globals.d.ts" />
import type { Request } from '../mock/mockWs.js';
import type { Mock } from '../mock/types.js';
+3 -3
View File
@@ -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 -1
View File
@@ -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" />
/// <reference types="@polkadot/dev-test/globals.d.ts" />
import type { Request } from '../mock/mockWs.js';
+1 -1
View File
@@ -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" />
/// <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" />
/// <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" />
/// <reference types="@polkadot/dev-test/globals.d.ts" />
import type { Request } from '../mock/mockWs.js';
import type { Global, Mock } from './../mock/types.js';
+14 -16
View File
@@ -1,14 +1,12 @@
{
"author": "Jaco Greeff <jacogr@gmail.com>",
"bugs": "https://github.com/polkadot-js/api/issues",
"contributors": [],
"description": "Type generation scripts",
"engines": {
"node": ">=14.0.0"
"node": ">=14"
},
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/typegen#readme",
"license": "Apache-2.0",
"maintainers": [],
"name": "@polkadot/typegen",
"repository": {
"directory": "packages/typegen",
@@ -20,7 +18,7 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "10.1.2",
"version": "10.1.4",
"main": "index.js",
"bin": {
"polkadot-types-chain-info": "./scripts/polkadot-types-chain-info.mjs",
@@ -30,18 +28,18 @@
"polkadot-types-internal-metadata": "./scripts/polkadot-types-internal-metadata.mjs"
},
"dependencies": {
"@polkadot/api": "10.1.2",
"@polkadot/api-augment": "10.1.2",
"@polkadot/rpc-augment": "10.1.2",
"@polkadot/rpc-provider": "10.1.2",
"@polkadot/types": "10.1.2",
"@polkadot/types-augment": "10.1.2",
"@polkadot/types-codec": "10.1.2",
"@polkadot/types-create": "10.1.2",
"@polkadot/types-support": "10.1.2",
"@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"
+14 -8
View File
@@ -23,12 +23,12 @@ async function generate (metaHex: HexString, pkg: string | undefined, output: st
if (pkg) {
try {
const defPath = assertFile(path.join(outputPath, 'definitions.ts'));
const defCont = await import(defPath) as { module: any };
const defCont = await import(
assertFile(path.join(outputPath, 'definitions.ts'))
) as Record<string, any>;
extraTypes = {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
[pkg]: defCont.module
[pkg]: defCont
};
} catch (error) {
console.error('ERROR: No custom definitions found:', (error as Error).message);
@@ -36,12 +36,13 @@ async function generate (metaHex: HexString, pkg: string | undefined, output: st
}
try {
const lookPath = assertFile(path.join(outputPath, 'lookup.ts'));
const lookCont = await import(lookPath) as { module: { default: DefinitionsTypes } };
const lookCont = await import(
assertFile(path.join(outputPath, 'lookup.ts'))
) as { default: DefinitionsTypes };
customLookupDefinitions = {
rpc: {},
types: lookCont.module.default
types: lookCont.default
};
} catch (error) {
console.error('ERROR: No lookup definitions found:', (error as Error).message);
@@ -113,5 +114,10 @@ async function mainPromise (): Promise<void> {
}
export function main (): void {
mainPromise().catch(() => process.exit(1));
mainPromise().catch((error) => {
console.error();
console.error(error);
console.error();
process.exit(1);
});
}
+9 -2
View File
@@ -40,9 +40,11 @@ async function mainPromise (): Promise<void> {
let userDefs: Record<string, any> = {};
try {
userDefs = await import(
const defCont = await import(
assertFile(path.join(inputPath, 'definitions.ts'))
) as Record<string, any>;
userDefs = defCont;
} catch (error) {
console.error('ERROR: Unable to load user definitions:', (error as Error).message);
}
@@ -95,5 +97,10 @@ async function mainPromise (): Promise<void> {
}
export function main (): void {
mainPromise().catch(() => process.exit(1));
mainPromise().catch((error) => {
console.error();
console.error(error);
console.error();
process.exit(1);
});
}
+1 -1
View File
@@ -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)
+3 -5
View File
@@ -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)}`;
}
+6 -9
View File
@@ -161,19 +161,16 @@ function addRpc (_runtimeDesc: string, rpcMethods?: string[]): string {
return name + (isOptional ? '?' : '') + ': `' + type + '`';
}).join(', ');
const type = '`' + method.type + '`';
const item: SectionItem = {
container.items.push({
interface: '`' + `api.rpc.${sectionName}.${methodName}` + '`',
jsonrpc: '`' + jsonrpc + '`',
// link: jsonrpc,
name: `${methodName}(${args}): ${type}`,
...(method.description && { summary: method.description })
};
if (method.deprecated) {
item.deprecated = method.deprecated;
}
container.items.push(item);
...((method.description && { summary: method.description }) || {}),
...((method.deprecated && { deprecated: method.deprecated }) || {}),
...((method.isUnsafe && { unsafe: 'This method is only active with appropriate flags' }) || {})
});
});
return all;
+1 -1
View File
@@ -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.2' };
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '10.1.4' };
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2023 @polkadot/typegen authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@polkadot/dev/node/test/node" />
/// <reference types="@polkadot/dev-test/globals.d.ts" />
import { TypeRegistry } from '@polkadot/types/create';
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2023 @polkadot/typegen authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@polkadot/dev/node/test/node" />
/// <reference types="@polkadot/dev-test/globals.d.ts" />
import { TypeRegistry } from '@polkadot/types';
+7 -9
View File
@@ -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)}`);
},
+3
View File
@@ -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);
}
});
+5 -7
View File
@@ -1,14 +1,12 @@
{
"author": "Jaco Greeff <jacogr@gmail.com>",
"bugs": "https://github.com/polkadot-js/api/issues",
"contributors": [],
"description": "Types generated augmentation",
"engines": {
"node": ">=14.0.0"
"node": ">=14"
},
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/types-augment#readme",
"license": "Apache-2.0",
"maintainers": [],
"name": "@polkadot/types-augment",
"repository": {
"directory": "packages/types-augment",
@@ -20,12 +18,12 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "10.1.2",
"version": "10.1.4",
"main": "index.js",
"dependencies": {
"@polkadot/types": "10.1.2",
"@polkadot/types-codec": "10.1.2",
"@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"
}
}
+1 -1
View File
@@ -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.2' };
export const packageInfo = { name: '@polkadot/types-augment', path: 'auto', type: 'auto', version: '10.1.4' };

Some files were not shown because too many files have changed in this diff Show More