* 3.2.2

* Patch correctly
This commit is contained in:
Jaco Greeff
2020-12-28 10:07:58 +01:00
committed by GitHub
parent 0d7be67499
commit f34d48ad09
16 changed files with 98 additions and 104 deletions
+1 -1
View File
@@ -34,5 +34,5 @@
"@types/jest": "^26.0.19",
"copyfiles": "^2.4.1"
},
"version": "3.2.1"
"version": "3.2.2"
}
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/api-contract",
"version": "3.2.1",
"version": "3.2.2",
"description": "Interfaces for interacting with contracts and contract ABIs",
"main": "index.js",
"module": "index.mjs",
@@ -14,10 +14,10 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-contract#readme",
"dependencies": {
"@babel/runtime": "^7.12.5",
"@polkadot/api": "3.2.1",
"@polkadot/types": "3.2.1",
"@polkadot/api": "3.2.2",
"@polkadot/types": "3.2.2",
"@polkadot/util": "^5.2.2",
"@polkadot/x-rxjs": "3.2.1",
"@polkadot/x-rxjs": "3.2.2",
"bn.js": "^4.11.9"
}
}
+6 -6
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/api-derive",
"version": "3.2.1",
"version": "3.2.2",
"description": "Common functions used across Polkadot, derived from RPC calls and storage queries.",
"main": "index.js",
"module": "index.mjs",
@@ -14,16 +14,16 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-derive#readme",
"dependencies": {
"@babel/runtime": "^7.12.5",
"@polkadot/api": "3.2.1",
"@polkadot/rpc-core": "3.2.1",
"@polkadot/types": "3.2.1",
"@polkadot/api": "3.2.2",
"@polkadot/rpc-core": "3.2.2",
"@polkadot/types": "3.2.2",
"@polkadot/util": "^5.2.2",
"@polkadot/util-crypto": "^5.2.2",
"@polkadot/x-rxjs": "3.2.1",
"@polkadot/x-rxjs": "3.2.2",
"bn.js": "^4.11.9"
},
"devDependencies": {
"@polkadot/keyring": "^5.2.2",
"@polkadot/rpc-provider": "3.2.1"
"@polkadot/rpc-provider": "3.2.2"
}
}
+8 -8
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/api",
"version": "3.2.1",
"version": "3.2.2",
"description": "Promise and RxJS wrappers around the Polkadot JS RPC",
"main": "index.js",
"module": "index.mjs",
@@ -17,16 +17,16 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api#readme",
"dependencies": {
"@babel/runtime": "^7.12.5",
"@polkadot/api-derive": "3.2.1",
"@polkadot/api-derive": "3.2.2",
"@polkadot/keyring": "^5.2.2",
"@polkadot/metadata": "3.2.1",
"@polkadot/rpc-core": "3.2.1",
"@polkadot/rpc-provider": "3.2.1",
"@polkadot/types": "3.2.1",
"@polkadot/types-known": "3.2.1",
"@polkadot/metadata": "3.2.2",
"@polkadot/rpc-core": "3.2.2",
"@polkadot/rpc-provider": "3.2.2",
"@polkadot/types": "3.2.2",
"@polkadot/types-known": "3.2.2",
"@polkadot/util": "^5.2.2",
"@polkadot/util-crypto": "^5.2.2",
"@polkadot/x-rxjs": "3.2.1",
"@polkadot/x-rxjs": "3.2.2",
"bn.js": "^4.11.9",
"eventemitter3": "^4.0.7"
}
+7 -7
View File
@@ -4,7 +4,7 @@
// Simple non-runnable checks to test type definitions in the editor itself
import type { StorageKey } from '@polkadot/types';
import type { AccountId, Balance, DispatchError, EventRecord, Header, Index } from '@polkadot/types/interfaces';
import type { AccountId, Balance, DispatchErrorModule, Event, Header, Index } from '@polkadot/types/interfaces';
import type { AnyTuple, IExtrinsic, IMethod } from '@polkadot/types/types';
import { ApiPromise } from '@polkadot/api';
@@ -36,7 +36,7 @@ async function derive (api: ApiPromise): Promise<void> {
}
function errors (api: ApiPromise): void {
const someError = {} as DispatchError;
const someError = {} as DispatchErrorModule;
// existing
console.log(api.errors.vesting.AmountLow.is(someError));
@@ -49,20 +49,20 @@ function errors (api: ApiPromise): void {
}
function events (api: ApiPromise): void {
const eventRecord = {} as EventRecord;
const event = {} as Event;
// existing
if (api.events.balances.Transfer.is(eventRecord)) {
if (api.events.balances.Transfer.is(event)) {
// the types are correctly expanded
const [from, to, amount] = eventRecord.event.data;
const [from, to, amount] = event.data;
console.log(from.toHuman(), to.toHuman(), amount.toBn());
}
// something random
if (api.events.something.Random.is(eventRecord)) {
if (api.events.something.Random.is(event)) {
// the types are just codec
const [a, b] = eventRecord.event.data;
const [a, b] = event.data;
console.log(a.toHuman(), b.toHuman());
}
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/metadata",
"version": "3.2.1",
"version": "3.2.2",
"description": "Helpers to extract information from runtime metadata",
"main": "index.js",
"module": "index.mjs",
@@ -17,8 +17,8 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/type-metadata#readme",
"dependencies": {
"@babel/runtime": "^7.12.5",
"@polkadot/types": "3.2.1",
"@polkadot/types-known": "3.2.1",
"@polkadot/types": "3.2.2",
"@polkadot/types-known": "3.2.2",
"@polkadot/util": "^5.2.2",
"@polkadot/util-crypto": "^5.2.2",
"bn.js": "^4.11.9"
+4 -10
View File
@@ -1,19 +1,13 @@
// Copyright 2017-2020 @polkadot/metadata authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { DispatchError, MetadataLatest } from '@polkadot/types/interfaces';
import type { DispatchErrorModule, MetadataLatest } from '@polkadot/types/interfaces';
import type { Registry } from '@polkadot/types/types';
import type { Errors, ModuleErrors } from '../types';
import { stringCamelCase } from '@polkadot/util';
function isError (dispatchError: DispatchError, sectionIndex: number, errorIndex: number): boolean {
if (!dispatchError.isModule) {
return false;
}
const { error, index } = dispatchError.asModule;
function isError ({ error, index }: DispatchErrorModule, sectionIndex: number, errorIndex: number): boolean {
return index.eq(sectionIndex) && error.eq(errorIndex);
}
@@ -29,8 +23,8 @@ export function decorateErrors (_: Registry, { modules }: MetadataLatest, metaVe
result[stringCamelCase(name)] = errors.reduce((newModule: ModuleErrors, meta, errorIndex): ModuleErrors => {
// we don't camelCase the error name
newModule[meta.name.toString()] = {
is: (dispatchError: DispatchError): boolean =>
isError(dispatchError, sectionIndex, errorIndex),
is: (moduleError: DispatchErrorModule): boolean =>
isError(moduleError, sectionIndex, errorIndex),
meta
};
@@ -2,13 +2,13 @@
// SPDX-License-Identifier: Apache-2.0
import type { MetadataLatest } from '@polkadot/types/interfaces';
import type { AnyTuple, IEventRecord, Registry } from '@polkadot/types/types';
import type { AnyTuple, IEvent, Registry } from '@polkadot/types/types';
import type { Events, ModuleEvents } from '../types';
import { stringCamelCase } from '@polkadot/util';
function isEvent <T extends AnyTuple> (eventRecord: IEventRecord<AnyTuple>, sectionIndex: number, eventIndex: number): eventRecord is IEventRecord<T> {
return eventRecord.event.index[0] === sectionIndex && eventRecord.event.index[0] === eventIndex;
function isEvent <T extends AnyTuple> (event: IEvent<AnyTuple>, sectionIndex: number, eventIndex: number): event is IEvent<T> {
return event.index[0] === sectionIndex && event.index[0] === eventIndex;
}
/** @internal */
@@ -23,7 +23,7 @@ export function decorateEvents (_: Registry, { modules }: MetadataLatest, metaVe
result[stringCamelCase(name)] = events.unwrap().reduce((newModule: ModuleEvents, meta, eventIndex): ModuleEvents => {
// we don't camelCase the event name
newModule[meta.name.toString()] = {
is: <T extends AnyTuple> (eventRecord: IEventRecord<AnyTuple>): eventRecord is IEventRecord<T> =>
is: <T extends AnyTuple> (eventRecord: IEvent<AnyTuple>): eventRecord is IEvent<T> =>
isEvent(eventRecord, sectionIndex, eventIndex),
meta
};
+4 -4
View File
@@ -1,9 +1,9 @@
// Copyright 2017-2020 @polkadot/metadata authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { DispatchError, ErrorMetadataLatest, EventMetadataLatest, ModuleConstantMetadataLatest } from '@polkadot/types/interfaces';
import type { DispatchErrorModule, ErrorMetadataLatest, EventMetadataLatest, ModuleConstantMetadataLatest } from '@polkadot/types/interfaces';
import type { StorageEntry } from '@polkadot/types/primitive/types';
import type { AnyTuple, CallFunction, Codec, IEventRecord } from '@polkadot/types/types';
import type { AnyTuple, CallFunction, Codec, IEvent } from '@polkadot/types/types';
export interface ConstantCodec extends Codec {
readonly meta: ModuleConstantMetadataLatest;
@@ -12,13 +12,13 @@ export interface ConstantCodec extends Codec {
export interface IsError {
readonly meta: ErrorMetadataLatest;
is: (dispatchError: DispatchError) => boolean;
is: (moduleError: DispatchErrorModule) => boolean;
}
export interface IsEvent <T extends AnyTuple> {
readonly meta: EventMetadataLatest;
is: (record: IEventRecord<AnyTuple>) => record is IEventRecord<T>;
is: (event: IEvent<AnyTuple>) => event is IEvent<T>;
}
export type ModuleConstants = Record<string, ConstantCodec>;
+5 -5
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/rpc-core",
"version": "3.2.1",
"version": "3.2.2",
"description": "A JavaScript wrapper for the Polkadot JsonRPC interface",
"main": "index.js",
"module": "index.mjs",
@@ -14,11 +14,11 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-core#readme",
"dependencies": {
"@babel/runtime": "^7.12.5",
"@polkadot/metadata": "3.2.1",
"@polkadot/rpc-provider": "3.2.1",
"@polkadot/types": "3.2.1",
"@polkadot/metadata": "3.2.2",
"@polkadot/rpc-provider": "3.2.2",
"@polkadot/types": "3.2.2",
"@polkadot/util": "^5.2.2",
"@polkadot/x-rxjs": "3.2.1"
"@polkadot/x-rxjs": "3.2.2"
},
"devDependencies": {
"@polkadot/keyring": "^5.2.2"
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/rpc-provider",
"version": "3.2.1",
"version": "3.2.2",
"description": "Transport providers for the API",
"main": "index.js",
"module": "index.mjs",
@@ -14,7 +14,7 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-provider#readme",
"dependencies": {
"@babel/runtime": "^7.12.5",
"@polkadot/types": "3.2.1",
"@polkadot/types": "3.2.2",
"@polkadot/util": "^5.2.2",
"@polkadot/util-crypto": "^5.2.2",
"@polkadot/x-fetch": "^5.2.2",
@@ -24,7 +24,7 @@
},
"devDependencies": {
"@polkadot/keyring": "^5.2.2",
"@polkadot/metadata": "3.2.1",
"@polkadot/metadata": "3.2.2",
"mock-socket": "^9.0.3",
"nock": "^13.0.5"
}
+5 -5
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/typegen",
"version": "3.2.1",
"version": "3.2.2",
"description": "Type generation scripts",
"main": "index.js",
"module": "index.mjs",
@@ -23,10 +23,10 @@
"@babel/core": "^7.12.10",
"@babel/register": "^7.12.10",
"@babel/runtime": "^7.12.5",
"@polkadot/api": "3.2.1",
"@polkadot/metadata": "3.2.1",
"@polkadot/rpc-provider": "3.2.1",
"@polkadot/types": "3.2.1",
"@polkadot/api": "3.2.2",
"@polkadot/metadata": "3.2.2",
"@polkadot/rpc-provider": "3.2.2",
"@polkadot/types": "3.2.2",
"@polkadot/util": "^5.2.2",
"handlebars": "^4.7.6",
"websocket": "^1.0.33",
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/types-known",
"version": "3.2.1",
"version": "3.2.2",
"description": "A JavaScript wrapper for the Polkadot JsonRPC interface",
"main": "index.js",
"module": "index.mjs",
@@ -14,7 +14,7 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/types-known#readme",
"dependencies": {
"@babel/runtime": "^7.12.5",
"@polkadot/types": "3.2.1",
"@polkadot/types": "3.2.2",
"@polkadot/util": "^5.2.2",
"bn.js": "^4.11.9"
},
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/types",
"version": "3.2.1",
"version": "3.2.2",
"description": "Implementation of the Parity codec",
"main": "index.js",
"module": "index.mjs",
@@ -17,10 +17,10 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/types#readme",
"dependencies": {
"@babel/runtime": "^7.12.5",
"@polkadot/metadata": "3.2.1",
"@polkadot/metadata": "3.2.2",
"@polkadot/util": "^5.2.2",
"@polkadot/util-crypto": "^5.2.2",
"@polkadot/x-rxjs": "3.2.1",
"@polkadot/x-rxjs": "3.2.2",
"@types/bn.js": "^4.11.6",
"bn.js": "^4.11.9"
},
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/x-rxjs",
"version": "3.2.1",
"version": "3.2.2",
"description": "A pass-through interface for RxJs (allowing node + mjs usage)",
"main": "index.js",
"sideEffects": false,
+38 -38
View File
@@ -1691,46 +1691,46 @@ __metadata:
resolution: "@polkadot/api-contract@workspace:packages/api-contract"
dependencies:
"@babel/runtime": ^7.12.5
"@polkadot/api": 3.2.1
"@polkadot/types": 3.2.1
"@polkadot/api": 3.2.2
"@polkadot/types": 3.2.2
"@polkadot/util": ^5.2.2
"@polkadot/x-rxjs": 3.2.1
"@polkadot/x-rxjs": 3.2.2
bn.js: ^4.11.9
languageName: unknown
linkType: soft
"@polkadot/api-derive@3.2.1, @polkadot/api-derive@workspace:packages/api-derive":
"@polkadot/api-derive@3.2.2, @polkadot/api-derive@workspace:packages/api-derive":
version: 0.0.0-use.local
resolution: "@polkadot/api-derive@workspace:packages/api-derive"
dependencies:
"@babel/runtime": ^7.12.5
"@polkadot/api": 3.2.1
"@polkadot/api": 3.2.2
"@polkadot/keyring": ^5.2.2
"@polkadot/rpc-core": 3.2.1
"@polkadot/rpc-provider": 3.2.1
"@polkadot/types": 3.2.1
"@polkadot/rpc-core": 3.2.2
"@polkadot/rpc-provider": 3.2.2
"@polkadot/types": 3.2.2
"@polkadot/util": ^5.2.2
"@polkadot/util-crypto": ^5.2.2
"@polkadot/x-rxjs": 3.2.1
"@polkadot/x-rxjs": 3.2.2
bn.js: ^4.11.9
languageName: unknown
linkType: soft
"@polkadot/api@3.2.1, @polkadot/api@workspace:packages/api":
"@polkadot/api@3.2.2, @polkadot/api@workspace:packages/api":
version: 0.0.0-use.local
resolution: "@polkadot/api@workspace:packages/api"
dependencies:
"@babel/runtime": ^7.12.5
"@polkadot/api-derive": 3.2.1
"@polkadot/api-derive": 3.2.2
"@polkadot/keyring": ^5.2.2
"@polkadot/metadata": 3.2.1
"@polkadot/rpc-core": 3.2.1
"@polkadot/rpc-provider": 3.2.1
"@polkadot/types": 3.2.1
"@polkadot/types-known": 3.2.1
"@polkadot/metadata": 3.2.2
"@polkadot/rpc-core": 3.2.2
"@polkadot/rpc-provider": 3.2.2
"@polkadot/types": 3.2.2
"@polkadot/types-known": 3.2.2
"@polkadot/util": ^5.2.2
"@polkadot/util-crypto": ^5.2.2
"@polkadot/x-rxjs": 3.2.1
"@polkadot/x-rxjs": 3.2.2
bn.js: ^4.11.9
eventemitter3: ^4.0.7
languageName: unknown
@@ -1843,14 +1843,14 @@ __metadata:
languageName: node
linkType: hard
"@polkadot/metadata@3.2.1, @polkadot/metadata@workspace:packages/metadata":
"@polkadot/metadata@3.2.2, @polkadot/metadata@workspace:packages/metadata":
version: 0.0.0-use.local
resolution: "@polkadot/metadata@workspace:packages/metadata"
dependencies:
"@babel/runtime": ^7.12.5
"@polkadot/keyring": ^5.2.2
"@polkadot/types": 3.2.1
"@polkadot/types-known": 3.2.1
"@polkadot/types": 3.2.2
"@polkadot/types-known": 3.2.2
"@polkadot/util": ^5.2.2
"@polkadot/util-crypto": ^5.2.2
bn.js: ^4.11.9
@@ -1866,28 +1866,28 @@ __metadata:
languageName: node
linkType: hard
"@polkadot/rpc-core@3.2.1, @polkadot/rpc-core@workspace:packages/rpc-core":
"@polkadot/rpc-core@3.2.2, @polkadot/rpc-core@workspace:packages/rpc-core":
version: 0.0.0-use.local
resolution: "@polkadot/rpc-core@workspace:packages/rpc-core"
dependencies:
"@babel/runtime": ^7.12.5
"@polkadot/keyring": ^5.2.2
"@polkadot/metadata": 3.2.1
"@polkadot/rpc-provider": 3.2.1
"@polkadot/types": 3.2.1
"@polkadot/metadata": 3.2.2
"@polkadot/rpc-provider": 3.2.2
"@polkadot/types": 3.2.2
"@polkadot/util": ^5.2.2
"@polkadot/x-rxjs": 3.2.1
"@polkadot/x-rxjs": 3.2.2
languageName: unknown
linkType: soft
"@polkadot/rpc-provider@3.2.1, @polkadot/rpc-provider@workspace:packages/rpc-provider":
"@polkadot/rpc-provider@3.2.2, @polkadot/rpc-provider@workspace:packages/rpc-provider":
version: 0.0.0-use.local
resolution: "@polkadot/rpc-provider@workspace:packages/rpc-provider"
dependencies:
"@babel/runtime": ^7.12.5
"@polkadot/keyring": ^5.2.2
"@polkadot/metadata": 3.2.1
"@polkadot/types": 3.2.1
"@polkadot/metadata": 3.2.2
"@polkadot/types": 3.2.2
"@polkadot/util": ^5.2.2
"@polkadot/util-crypto": ^5.2.2
"@polkadot/x-fetch": ^5.2.2
@@ -1915,10 +1915,10 @@ __metadata:
"@babel/core": ^7.12.10
"@babel/register": ^7.12.10
"@babel/runtime": ^7.12.5
"@polkadot/api": 3.2.1
"@polkadot/metadata": 3.2.1
"@polkadot/rpc-provider": 3.2.1
"@polkadot/types": 3.2.1
"@polkadot/api": 3.2.2
"@polkadot/metadata": 3.2.2
"@polkadot/rpc-provider": 3.2.2
"@polkadot/types": 3.2.2
"@polkadot/util": ^5.2.2
"@types/websocket": ^1.0.1
"@types/yargs": ^15.0.12
@@ -1934,28 +1934,28 @@ __metadata:
languageName: unknown
linkType: soft
"@polkadot/types-known@3.2.1, @polkadot/types-known@workspace:packages/types-known":
"@polkadot/types-known@3.2.2, @polkadot/types-known@workspace:packages/types-known":
version: 0.0.0-use.local
resolution: "@polkadot/types-known@workspace:packages/types-known"
dependencies:
"@babel/runtime": ^7.12.5
"@polkadot/types": 3.2.1
"@polkadot/types": 3.2.2
"@polkadot/util": ^5.2.2
"@types/bn.js": ^4.11.6
bn.js: ^4.11.9
languageName: unknown
linkType: soft
"@polkadot/types@3.2.1, @polkadot/types@workspace:packages/types":
"@polkadot/types@3.2.2, @polkadot/types@workspace:packages/types":
version: 0.0.0-use.local
resolution: "@polkadot/types@workspace:packages/types"
dependencies:
"@babel/runtime": ^7.12.5
"@polkadot/keyring": ^5.2.2
"@polkadot/metadata": 3.2.1
"@polkadot/metadata": 3.2.2
"@polkadot/util": ^5.2.2
"@polkadot/util-crypto": ^5.2.2
"@polkadot/x-rxjs": 3.2.1
"@polkadot/x-rxjs": 3.2.2
"@types/bn.js": ^4.11.6
bn.js: ^4.11.9
languageName: unknown
@@ -2053,7 +2053,7 @@ __metadata:
languageName: node
linkType: hard
"@polkadot/x-rxjs@3.2.1, @polkadot/x-rxjs@workspace:packages/x-rxjs":
"@polkadot/x-rxjs@3.2.2, @polkadot/x-rxjs@workspace:packages/x-rxjs":
version: 0.0.0-use.local
resolution: "@polkadot/x-rxjs@workspace:packages/x-rxjs"
dependencies: