Use assertReturn to cleanup (#2804)
* Use assertReturn to cleanup * Remove Uint/Int duplication * Adjust * ws errors, part 2 * . * Adj. manual * adj * switchMap * Revert "switchMap" This reverts commit edfa4a2258f09042b61a27fd3812f0c53039fe4f. * Revert. * Revert. * protected constructor * Correct isHexJson flag * Remove isHexJson (always detect) * Adjust * Flags
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
"@polkadot/api": "^2.4.2-12",
|
||||
"@polkadot/rpc-core": "^2.4.2-12",
|
||||
"@polkadot/types": "^2.4.2-12",
|
||||
"@polkadot/util": "^3.6.2-8",
|
||||
"@polkadot/util": "^3.6.2-10",
|
||||
"bn.js": "^5.1.3",
|
||||
"rxjs": "^6.6.3"
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import { AnyJson, Codec, CodecArg } from '@polkadot/types/types';
|
||||
import { ChainProperties, ContractConstructorSpec, ContractEventSpec, ContractMessageSpec, ContractMessageParamSpec, ContractProject } from '@polkadot/types/interfaces';
|
||||
import { AbiConstructor, AbiEvent, AbiMessage, AbiParam, DecodedEvent, DecodedMessage } from './types';
|
||||
|
||||
import { assert, compactAddLength, compactStripLength, isNumber, isObject, isString, logger, stringCamelCase, u8aConcat, u8aToHex } from '@polkadot/util';
|
||||
import { assert, assertReturn, compactAddLength, compactStripLength, isNumber, isObject, isString, logger, stringCamelCase, u8aConcat, u8aToHex } from '@polkadot/util';
|
||||
|
||||
import MetaRegistry from './MetaRegistry';
|
||||
|
||||
@@ -18,9 +18,7 @@ function findMessage <T extends AbiMessage> (list: T[], messageOrId: T | string
|
||||
? list.find(({ identifier }) => [identifier, stringCamelCase(identifier)].includes(messageOrId.toString()))
|
||||
: messageOrId;
|
||||
|
||||
assert(message, `Attempted to call an invalid contract interface, ${JSON.stringify(messageOrId)}`);
|
||||
|
||||
return message;
|
||||
return assertReturn(message, `Attempted to call an invalid contract interface, ${JSON.stringify(messageOrId)}`);
|
||||
}
|
||||
|
||||
export default class Abi {
|
||||
|
||||
@@ -32,13 +32,13 @@
|
||||
"@polkadot/rpc-core": "^2.4.2-12",
|
||||
"@polkadot/rpc-provider": "^2.4.2-12",
|
||||
"@polkadot/types": "^2.4.2-12",
|
||||
"@polkadot/util": "^3.6.2-8",
|
||||
"@polkadot/util-crypto": "^3.6.2-8",
|
||||
"@polkadot/util": "^3.6.2-10",
|
||||
"@polkadot/util-crypto": "^3.6.2-10",
|
||||
"bn.js": "^5.1.3",
|
||||
"memoizee": "^0.4.14",
|
||||
"rxjs": "^6.6.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^3.6.2-8"
|
||||
"@polkadot/keyring": "^3.6.2-10"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces';
|
||||
import { Observable, of } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { ApiInterfaceRx } from '@polkadot/api/types';
|
||||
import { isU8a, assert } from '@polkadot/util';
|
||||
import { isU8a, assertReturn } from '@polkadot/util';
|
||||
import { decodeAddress } from '@polkadot/util-crypto';
|
||||
|
||||
import { memo } from '../util';
|
||||
@@ -23,11 +23,7 @@ function retrieve (api: ApiInterfaceRx, address: Address | AccountId | AccountIn
|
||||
const accountIndex = api.registry.createType('AccountIndex', decoded);
|
||||
|
||||
return api.derive.accounts.indexToId(accountIndex.toString()).pipe(
|
||||
map((accountId) => {
|
||||
assert(accountId, 'Unable to retrieve accountId');
|
||||
|
||||
return accountId;
|
||||
})
|
||||
map((accountId) => assertReturn(accountId, 'Unable to retrieve accountId'))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -28,19 +28,19 @@
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.1",
|
||||
"@polkadot/api-derive": "^2.4.2-12",
|
||||
"@polkadot/keyring": "^3.6.2-8",
|
||||
"@polkadot/keyring": "^3.6.2-10",
|
||||
"@polkadot/metadata": "^2.4.2-12",
|
||||
"@polkadot/rpc-core": "^2.4.2-12",
|
||||
"@polkadot/rpc-provider": "^2.4.2-12",
|
||||
"@polkadot/types": "^2.4.2-12",
|
||||
"@polkadot/types-known": "^2.4.2-12",
|
||||
"@polkadot/util": "^3.6.2-8",
|
||||
"@polkadot/util-crypto": "^3.6.2-8",
|
||||
"@polkadot/util": "^3.6.2-10",
|
||||
"@polkadot/util-crypto": "^3.6.2-10",
|
||||
"bn.js": "^5.1.3",
|
||||
"eventemitter3": "^4.0.7",
|
||||
"rxjs": "^6.6.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^3.6.2-8"
|
||||
"@polkadot/keyring": "^3.6.2-10"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,214 @@
|
||||
// Copyright 2017-2020 @polkadot/api authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { RpcInterface } from '@polkadot/rpc-core/types';
|
||||
import { Hash, RuntimeVersion } from '@polkadot/types/interfaces';
|
||||
import { ApiInterfaceRx, ApiTypes, DecoratedRpc, QueryableConsts, QueryableStorage, QueryableStorageMulti, SubmittableExtrinsics } from '../types';
|
||||
|
||||
import { Metadata, Text } from '@polkadot/types';
|
||||
import { assertReturn } from '@polkadot/util';
|
||||
|
||||
import Init from './Init';
|
||||
|
||||
interface PkgJson {
|
||||
name: string;
|
||||
version: string;
|
||||
}
|
||||
|
||||
let pkgJson: PkgJson = { name: '@polkadot/api', version: '-' };
|
||||
|
||||
import('../package.json')
|
||||
.then((_pkgJson: unknown): void => {
|
||||
pkgJson = _pkgJson as PkgJson;
|
||||
})
|
||||
.catch((): void => {
|
||||
// ignore
|
||||
});
|
||||
|
||||
function assertResult<T> (value: T | undefined): T {
|
||||
return assertReturn(value, 'Api needs to be initialized before using, listen on \'ready\'');
|
||||
}
|
||||
|
||||
export default abstract class Getters<ApiType extends ApiTypes> extends Init<ApiType> {
|
||||
/**
|
||||
* @description Contains the parameter types (constants) of all modules.
|
||||
*
|
||||
* The values are instances of the appropriate type and are accessible using `section`.`constantName`,
|
||||
*
|
||||
* @example
|
||||
* <BR>
|
||||
*
|
||||
* ```javascript
|
||||
* console.log(api.consts.democracy.enactmentPeriod.toString())
|
||||
* ```
|
||||
*/
|
||||
public get consts (): QueryableConsts<ApiType> {
|
||||
return assertResult(this._consts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Derived results that are injected into the API, allowing for combinations of various query results.
|
||||
*
|
||||
* @example
|
||||
* <BR>
|
||||
*
|
||||
* ```javascript
|
||||
* api.derive.chain.bestNumber((number) => {
|
||||
* console.log('best number', number);
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
public get derive (): ReturnType<Getters<ApiType>['_decorateDerive']> {
|
||||
return assertResult(this._derive);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns the version of extrinsics in-use on this chain
|
||||
*/
|
||||
public get extrinsicVersion (): number {
|
||||
return this._extrinsicType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Contains the genesis Hash of the attached chain. Apart from being useful to determine the actual chain, it can also be used to sign immortal transactions.
|
||||
*/
|
||||
public get genesisHash (): Hash {
|
||||
return assertResult(this._genesisHash);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description `true` when subscriptions are supported
|
||||
*/
|
||||
public get hasSubscriptions (): boolean {
|
||||
return this._rpcCore.provider.hasSubscriptions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description true is the underlying provider is connected
|
||||
*/
|
||||
public get isConnected (): boolean {
|
||||
return this._isConnected.getValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* @description The library information name & version (from package.json)
|
||||
*/
|
||||
public get libraryInfo (): string {
|
||||
return `${pkgJson.name} v${pkgJson.version}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Contains all the chain state modules and their subsequent methods in the API. These are attached dynamically from the runtime metadata.
|
||||
*
|
||||
* All calls inside the namespace, is denoted by `section`.`method` and may take an optional query parameter. As an example, `api.query.timestamp.now()` (current block timestamp) does not take parameters, while `api.query.system.account(<accountId>)` (retrieving the associated nonce & balances for an account), takes the `AccountId` as a parameter.
|
||||
*
|
||||
* @example
|
||||
* <BR>
|
||||
*
|
||||
* ```javascript
|
||||
* api.query.system.account(<accountId>, ([nonce, balance]) => {
|
||||
* console.log('new free balance', balance.free, 'new nonce', nonce);
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
public get query (): QueryableStorage<ApiType> {
|
||||
return assertResult(this._query);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Allows for the querying of multiple storage entries and the combination thereof into a single result. This is a very optimal way to make multiple queries since it only makes a single connection to the node and retrieves the data over one subscription.
|
||||
*
|
||||
* @example
|
||||
* <BR>
|
||||
*
|
||||
* ```javascript
|
||||
* const unsub = await api.queryMulti(
|
||||
* [
|
||||
* // you can include the storage without any parameters
|
||||
* api.query.balances.totalIssuance,
|
||||
* // or you can pass parameters to the storage query
|
||||
* [api.query.system.account, '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY']
|
||||
* ],
|
||||
* ([existential, [, { free }]]) => {
|
||||
* console.log(`You have ${free.sub(existential)} more than the existential deposit`);
|
||||
*
|
||||
* unsub();
|
||||
* }
|
||||
* );
|
||||
* ```
|
||||
*/
|
||||
public get queryMulti (): QueryableStorageMulti<ApiType> {
|
||||
return assertResult(this._queryMulti);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Contains all the raw rpc sections and their subsequent methods in the API as defined by the jsonrpc interface definitions. Unlike the dynamic `api.query` and `api.tx` sections, these methods are fixed (although extensible with node upgrades) and not determined by the runtime.
|
||||
*
|
||||
* RPC endpoints available here allow for the query of chain, node and system information, in addition to providing interfaces for the raw queries of state (using known keys) and the submission of transactions.
|
||||
*
|
||||
* @example
|
||||
* <BR>
|
||||
*
|
||||
* ```javascript
|
||||
* api.rpc.chain.subscribeNewHeads((header) => {
|
||||
* console.log('new header', header);
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
public get rpc (): DecoratedRpc<ApiType, RpcInterface> {
|
||||
return assertResult(this._rpc);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Contains the chain information for the current node.
|
||||
*/
|
||||
public get runtimeChain (): Text {
|
||||
return assertResult(this._runtimeChain);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Yields the current attached runtime metadata. Generally this is only used to construct extrinsics & storage, but is useful for current runtime inspection.
|
||||
*/
|
||||
public get runtimeMetadata (): Metadata {
|
||||
return assertResult(this._runtimeMetadata);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Contains the version information for the current runtime.
|
||||
*/
|
||||
public get runtimeVersion (): RuntimeVersion {
|
||||
return assertResult(this._runtimeVersion);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description The underlying Rx API interface
|
||||
*/
|
||||
public get rx (): Pick<ApiInterfaceRx, 'tx' | 'rpc'> {
|
||||
return assertResult(this._rx as Pick<ApiInterfaceRx, 'tx' | 'rpc'>);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description The type of this API instance, either 'rxjs' or 'promise'
|
||||
*/
|
||||
public get type (): ApiTypes {
|
||||
return this._type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Contains all the extrinsic modules and their subsequent methods in the API. It allows for the construction of transactions and the submission thereof. These are attached dynamically from the runtime metadata.
|
||||
*
|
||||
* @example
|
||||
* <BR>
|
||||
*
|
||||
* ```javascript
|
||||
* api.tx.balances
|
||||
* .transfer(<recipientId>, <balance>)
|
||||
* .signAndSend(<keyPair>, ({status}) => {
|
||||
* console.log('tx status', status.asFinalized.toHex());
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
public get tx (): SubmittableExtrinsics<ApiType> {
|
||||
return assertResult(this._extrinsics);
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,12 @@
|
||||
// Copyright 2017-2020 @polkadot/api authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { RpcInterface } from '@polkadot/rpc-core/types';
|
||||
import { Hash, RuntimeVersion } from '@polkadot/types/interfaces';
|
||||
import { CallFunction, RegistryError, SignerPayloadRawBase } from '@polkadot/types/types';
|
||||
import { ApiInterfaceRx, ApiOptions, ApiTypes, DecoratedRpc, DecorateMethod, QueryableConsts, QueryableStorage, QueryableStorageMulti, SubmittableExtrinsics, Signer } from '../types';
|
||||
import { ApiOptions, ApiTypes, DecorateMethod, Signer } from '../types';
|
||||
|
||||
import { Metadata, Text } from '@polkadot/types';
|
||||
import { assert, isString, isUndefined, u8aToHex, u8aToU8a } from '@polkadot/util';
|
||||
import { assert, isString, u8aToHex, u8aToU8a } from '@polkadot/util';
|
||||
|
||||
import Init from './Init';
|
||||
import Getters from './Getters';
|
||||
|
||||
interface KeyringSigner {
|
||||
sign (message: Uint8Array): Uint8Array;
|
||||
@@ -19,28 +16,7 @@ interface SignerRawOptions {
|
||||
signer?: Signer;
|
||||
}
|
||||
|
||||
interface PkgJson {
|
||||
name: string;
|
||||
version: string;
|
||||
}
|
||||
|
||||
let pkgJson: PkgJson = { name: '@polkadot/api', version: '-' };
|
||||
|
||||
import('../package.json')
|
||||
.then((_pkgJson: unknown): void => {
|
||||
pkgJson = _pkgJson as PkgJson;
|
||||
})
|
||||
.catch((): void => {
|
||||
// ignore
|
||||
});
|
||||
|
||||
function assertResult<T> (value: T | undefined): T {
|
||||
assert(!isUndefined(value), 'Api needs to be initialized before using, listen on \'ready\'');
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
export default abstract class ApiBase<ApiType extends ApiTypes> extends Init<ApiType> {
|
||||
export default abstract class ApiBase<ApiType extends ApiTypes> extends Getters<ApiType> {
|
||||
/**
|
||||
* @description Create an instance of the class
|
||||
*
|
||||
@@ -63,188 +39,6 @@ export default abstract class ApiBase<ApiType extends ApiTypes> extends Init<Api
|
||||
super(options, type, decorateMethod);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Contains the parameter types (constants) of all modules.
|
||||
*
|
||||
* The values are instances of the appropriate type and are accessible using `section`.`constantName`,
|
||||
*
|
||||
* @example
|
||||
* <BR>
|
||||
*
|
||||
* ```javascript
|
||||
* console.log(api.consts.democracy.enactmentPeriod.toString())
|
||||
* ```
|
||||
*/
|
||||
public get consts (): QueryableConsts<ApiType> {
|
||||
return assertResult(this._consts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Derived results that are injected into the API, allowing for combinations of various query results.
|
||||
*
|
||||
* @example
|
||||
* <BR>
|
||||
*
|
||||
* ```javascript
|
||||
* api.derive.chain.bestNumber((number) => {
|
||||
* console.log('best number', number);
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
public get derive (): ReturnType<ApiBase<ApiType>['_decorateDerive']> {
|
||||
return assertResult(this._derive);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns the version of extrinsics in-use on this chain
|
||||
*/
|
||||
public get extrinsicVersion (): number {
|
||||
return this._extrinsicType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Contains the genesis Hash of the attached chain. Apart from being useful to determine the actual chain, it can also be used to sign immortal transactions.
|
||||
*/
|
||||
public get genesisHash (): Hash {
|
||||
return assertResult(this._genesisHash);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description `true` when subscriptions are supported
|
||||
*/
|
||||
public get hasSubscriptions (): boolean {
|
||||
return this._rpcCore.provider.hasSubscriptions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description true is the underlying provider is connected
|
||||
*/
|
||||
public get isConnected (): boolean {
|
||||
return this._isConnected.getValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* @description The library information name & version (from package.json)
|
||||
*/
|
||||
public get libraryInfo (): string {
|
||||
return `${pkgJson.name} v${pkgJson.version}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Contains all the chain state modules and their subsequent methods in the API. These are attached dynamically from the runtime metadata.
|
||||
*
|
||||
* All calls inside the namespace, is denoted by `section`.`method` and may take an optional query parameter. As an example, `api.query.timestamp.now()` (current block timestamp) does not take parameters, while `api.query.system.account(<accountId>)` (retrieving the associated nonce & balances for an account), takes the `AccountId` as a parameter.
|
||||
*
|
||||
* @example
|
||||
* <BR>
|
||||
*
|
||||
* ```javascript
|
||||
* api.query.system.account(<accountId>, ([nonce, balance]) => {
|
||||
* console.log('new free balance', balance.free, 'new nonce', nonce);
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
public get query (): QueryableStorage<ApiType> {
|
||||
return assertResult(this._query);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Allows for the querying of multiple storage entries and the combination thereof into a single result. This is a very optimal way to make multiple queries since it only makes a single connection to the node and retrieves the data over one subscription.
|
||||
*
|
||||
* @example
|
||||
* <BR>
|
||||
*
|
||||
* ```javascript
|
||||
* const unsub = await api.queryMulti(
|
||||
* [
|
||||
* // you can include the storage without any parameters
|
||||
* api.query.balances.totalIssuance,
|
||||
* // or you can pass parameters to the storage query
|
||||
* [api.query.system.account, '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY']
|
||||
* ],
|
||||
* ([existential, [, { free }]]) => {
|
||||
* console.log(`You have ${free.sub(existential)} more than the existential deposit`);
|
||||
*
|
||||
* unsub();
|
||||
* }
|
||||
* );
|
||||
* ```
|
||||
*/
|
||||
public get queryMulti (): QueryableStorageMulti<ApiType> {
|
||||
return assertResult(this._queryMulti);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Contains all the raw rpc sections and their subsequent methods in the API as defined by the jsonrpc interface definitions. Unlike the dynamic `api.query` and `api.tx` sections, these methods are fixed (although extensible with node upgrades) and not determined by the runtime.
|
||||
*
|
||||
* RPC endpoints available here allow for the query of chain, node and system information, in addition to providing interfaces for the raw queries of state (using known keys) and the submission of transactions.
|
||||
*
|
||||
* @example
|
||||
* <BR>
|
||||
*
|
||||
* ```javascript
|
||||
* api.rpc.chain.subscribeNewHeads((header) => {
|
||||
* console.log('new header', header);
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
public get rpc (): DecoratedRpc<ApiType, RpcInterface> {
|
||||
return assertResult(this._rpc);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Contains the chain information for the current node.
|
||||
*/
|
||||
public get runtimeChain (): Text {
|
||||
return assertResult(this._runtimeChain);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Yields the current attached runtime metadata. Generally this is only used to construct extrinsics & storage, but is useful for current runtime inspection.
|
||||
*/
|
||||
public get runtimeMetadata (): Metadata {
|
||||
return assertResult(this._runtimeMetadata);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Contains the version information for the current runtime.
|
||||
*/
|
||||
public get runtimeVersion (): RuntimeVersion {
|
||||
return assertResult(this._runtimeVersion);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description The underlying Rx API interface
|
||||
*/
|
||||
public get rx (): Pick<ApiInterfaceRx, 'tx' | 'rpc'> {
|
||||
return assertResult(this._rx as Pick<ApiInterfaceRx, 'tx' | 'rpc'>);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description The type of this API instance, either 'rxjs' or 'promise'
|
||||
*/
|
||||
public get type (): ApiTypes {
|
||||
return this._type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Contains all the extrinsic modules and their subsequent methods in the API. It allows for the construction of transactions and the submission thereof. These are attached dynamically from the runtime metadata.
|
||||
*
|
||||
* @example
|
||||
* <BR>
|
||||
*
|
||||
* ```javascript
|
||||
* api.tx.balances
|
||||
* .transfer(<recipientId>, <balance>)
|
||||
* .signAndSend(<keyPair>, ({status}) => {
|
||||
* console.log('tx status', status.asFinalized.toHex());
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
public get tx (): SubmittableExtrinsics<ApiType> {
|
||||
return assertResult(this._extrinsics);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Connect from the underlying provider, halting all network traffic
|
||||
*/
|
||||
|
||||
@@ -53,9 +53,8 @@ async function query (api: ApiPromise, keyring: TestKeyringMap): Promise<void> {
|
||||
|
||||
// check multi for unsub
|
||||
const multiUnsub = await api.queryMulti([
|
||||
[api.query.system.account, keyring.eve.address],
|
||||
// older chains only
|
||||
[api.query.system.accountNonce, keyring.bob.address]
|
||||
[api.query.staking.validators],
|
||||
[api.query.system.events]
|
||||
], (values): void => {
|
||||
console.log('values', values);
|
||||
|
||||
@@ -66,7 +65,7 @@ async function query (api: ApiPromise, keyring: TestKeyringMap): Promise<void> {
|
||||
const multiRes = await api.queryMulti([
|
||||
[api.query.system.account, keyring.eve.address],
|
||||
// older chains only
|
||||
[api.query.system.accountNonce, keyring.bob.address]
|
||||
[api.query.system.accountNonce, keyring.eve.address]
|
||||
]);
|
||||
|
||||
console.log(multiRes);
|
||||
|
||||
@@ -29,11 +29,11 @@
|
||||
"@babel/runtime": "^7.12.1",
|
||||
"@polkadot/types": "^2.4.2-12",
|
||||
"@polkadot/types-known": "^2.4.2-12",
|
||||
"@polkadot/util": "^3.6.2-8",
|
||||
"@polkadot/util-crypto": "^3.6.2-8",
|
||||
"@polkadot/util": "^3.6.2-10",
|
||||
"@polkadot/util-crypto": "^3.6.2-10",
|
||||
"bn.js": "^5.1.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^3.6.2-8"
|
||||
"@polkadot/keyring": "^3.6.2-10"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
"@polkadot/metadata": "^2.4.2-12",
|
||||
"@polkadot/rpc-provider": "^2.4.2-12",
|
||||
"@polkadot/types": "^2.4.2-12",
|
||||
"@polkadot/util": "^3.6.2-8",
|
||||
"@polkadot/util": "^3.6.2-10",
|
||||
"memoizee": "^0.4.14",
|
||||
"rxjs": "^6.6.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^3.6.2-8"
|
||||
"@polkadot/keyring": "^3.6.2-10"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,15 +29,15 @@
|
||||
"@babel/runtime": "^7.12.1",
|
||||
"@polkadot/metadata": "^2.4.2-12",
|
||||
"@polkadot/types": "^2.4.2-12",
|
||||
"@polkadot/util": "^3.6.2-8",
|
||||
"@polkadot/util-crypto": "^3.6.2-8",
|
||||
"@polkadot/util": "^3.6.2-10",
|
||||
"@polkadot/util-crypto": "^3.6.2-10",
|
||||
"@polkadot/x-fetch": "^0.3.6",
|
||||
"@polkadot/x-ws": "^0.3.6",
|
||||
"bn.js": "^5.1.3",
|
||||
"eventemitter3": "^4.0.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^3.6.2-8",
|
||||
"@polkadot/keyring": "^3.6.2-10",
|
||||
"mock-socket": "^9.0.3",
|
||||
"nock": "^13.0.4"
|
||||
}
|
||||
|
||||
@@ -22,20 +22,22 @@ const known: Record<number, string> = {
|
||||
1015: 'TLS Handshake'
|
||||
};
|
||||
|
||||
function getUnmapped (code: number): string | void {
|
||||
if (code <= 1999) {
|
||||
return '(For WebSocket standard)';
|
||||
} else if (code <= 2999) {
|
||||
return '(For WebSocket extensions)';
|
||||
} else if (code <= 3999) {
|
||||
return '(For libraries and frameworks)';
|
||||
} else if (code <= 4999) {
|
||||
return '(For applications)';
|
||||
}
|
||||
}
|
||||
|
||||
export function getWSErrorString (code: number): string {
|
||||
if (code >= 0 && code <= 999) {
|
||||
return '(Unused)';
|
||||
} else if (code >= 1016) {
|
||||
if (code <= 1999) {
|
||||
return '(For WebSocket standard)';
|
||||
} else if (code <= 2999) {
|
||||
return '(For WebSocket extensions)';
|
||||
} else if (code <= 3999) {
|
||||
return '(For libraries and frameworks)';
|
||||
} else if (code <= 4999) {
|
||||
return '(For applications)';
|
||||
}
|
||||
}
|
||||
|
||||
return known[code] || '(Unknown)';
|
||||
return known[code] || getUnmapped(code) || '(Unknown)';
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
"@polkadot/metadata": "^2.4.2-12",
|
||||
"@polkadot/rpc-provider": "^2.4.2-12",
|
||||
"@polkadot/types": "^2.4.2-12",
|
||||
"@polkadot/util": "^3.6.2-8",
|
||||
"@polkadot/util": "^3.6.2-10",
|
||||
"handlebars": "^4.7.6",
|
||||
"websocket": "^1.0.32",
|
||||
"yargs": "^16.1.0"
|
||||
|
||||
@@ -122,7 +122,7 @@ function tsSet (definitions: Record<string, ModuleTypes>, { name: setName, sub }
|
||||
setImports(definitions, imports, ['Set']);
|
||||
|
||||
const types = (sub as TypeDef[]).map(({ name }): string => {
|
||||
assert(!!name, 'Invalid TypeDef found, no name specified');
|
||||
assert(name, 'Invalid TypeDef found, no name specified');
|
||||
|
||||
return createGetter(definitions, `is${name}`, 'boolean', imports);
|
||||
});
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.1",
|
||||
"@polkadot/types": "^2.4.2-12",
|
||||
"@polkadot/util": "^3.6.2-8",
|
||||
"@polkadot/util": "^3.6.2-10",
|
||||
"bn.js": "^5.1.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -28,15 +28,15 @@
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.1",
|
||||
"@polkadot/metadata": "^2.4.2-12",
|
||||
"@polkadot/util": "^3.6.2-8",
|
||||
"@polkadot/util-crypto": "^3.6.2-8",
|
||||
"@polkadot/util": "^3.6.2-10",
|
||||
"@polkadot/util-crypto": "^3.6.2-10",
|
||||
"@types/bn.js": "^4.11.6",
|
||||
"bn.js": "^5.1.3",
|
||||
"memoizee": "^0.4.14",
|
||||
"rxjs": "^6.6.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^3.6.2-8",
|
||||
"@polkadot/keyring": "^3.6.2-10",
|
||||
"@types/memoizee": "^0.4.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ function decodeAbstracIntU8a (value: Uint8Array, bitLength: UIntBitLength, isNeg
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
function decodeAbstracInt (value: AnyNumber, bitLength: UIntBitLength, isNegative: boolean): string {
|
||||
function decodeAbstractInt (value: AnyNumber, bitLength: UIntBitLength, isNegative: boolean): string {
|
||||
// This function returns a string, which will be passed in the BN
|
||||
// constructor. It would be ideal to actually return a BN, but there's a
|
||||
// bug: https://github.com/indutny/bn.js/issues/206.
|
||||
@@ -66,16 +66,13 @@ export default abstract class AbstractInt extends BN implements Codec {
|
||||
|
||||
readonly #bitLength: UIntBitLength;
|
||||
|
||||
readonly #isHexJson: boolean;
|
||||
|
||||
readonly #isSigned: boolean;
|
||||
|
||||
protected constructor (registry: Registry, isSigned: boolean, value: AnyNumber = 0, bitLength: UIntBitLength = DEFAULT_UINT_BITS, isHexJson = true) {
|
||||
super(decodeAbstracInt(value, bitLength, isSigned));
|
||||
constructor (registry: Registry, value: AnyNumber = 0, bitLength: UIntBitLength = DEFAULT_UINT_BITS, isSigned = false) {
|
||||
super(decodeAbstractInt(value, bitLength, isSigned));
|
||||
|
||||
this.registry = registry;
|
||||
this.#bitLength = bitLength;
|
||||
this.#isHexJson = isHexJson;
|
||||
this.#isSigned = isSigned;
|
||||
|
||||
assert(isSigned || this.gte(BN_ZERO), `${this.toRawType()}: Negative number passed to unsigned type`);
|
||||
@@ -193,7 +190,7 @@ export default abstract class AbstractInt extends BN implements Codec {
|
||||
// FIXME this return type should by string | number, but BN's return type
|
||||
// is string.
|
||||
// Maximum allowed integer for JS is 2^53 - 1, set limit at 52
|
||||
return this.#isHexJson || (super.bitLength() > 52)
|
||||
return super.bitLength() > 52
|
||||
? this.toHex()
|
||||
: this.toNumber();
|
||||
}
|
||||
|
||||
@@ -52,11 +52,6 @@ describe('Int', (): void => {
|
||||
).toEqual(-123);
|
||||
});
|
||||
|
||||
it('converts to JSON depending on flags', (): void => {
|
||||
expect(new Int(registry, 0x12, 16).toJSON()).toEqual('0x0012');
|
||||
expect(new Int(registry, 0x12, 16, false).toJSON()).toEqual(0x12);
|
||||
});
|
||||
|
||||
describe('static with', (): void => {
|
||||
it('allows default toRawType', (): void => {
|
||||
expect(
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { AnyNumber, Constructor, Registry } from '../types';
|
||||
|
||||
import AbstractInt, { DEFAULT_UINT_BITS, UIntBitLength } from './AbstractInt';
|
||||
import AbstractInt, { UIntBitLength } from './AbstractInt';
|
||||
|
||||
/**
|
||||
* @name Int
|
||||
@@ -16,8 +16,8 @@ import AbstractInt, { DEFAULT_UINT_BITS, UIntBitLength } from './AbstractInt';
|
||||
* @noInheritDoc
|
||||
*/
|
||||
export default class Int extends AbstractInt {
|
||||
constructor (registry: Registry, value: AnyNumber = 0, bitLength: UIntBitLength = DEFAULT_UINT_BITS, isHexJson = true) {
|
||||
super(registry, true, value, bitLength, isHexJson);
|
||||
constructor (registry: Registry, value: AnyNumber = 0, bitLength?: UIntBitLength) {
|
||||
super(registry, value, bitLength, true);
|
||||
}
|
||||
|
||||
public static with (bitLength: UIntBitLength, typeName?: string): Constructor<Int> {
|
||||
|
||||
@@ -72,10 +72,10 @@ describe('UInt', (): void => {
|
||||
).toEqual(123);
|
||||
});
|
||||
|
||||
it('converts to JSON representation based on flags/size', (): void => {
|
||||
expect(new UInt(registry, '0x12345678', 64, true).toJSON()).toEqual('0x0000000012345678');
|
||||
expect(new UInt(registry, '0x1234567890', 64, false).toJSON()).toEqual(0x1234567890);
|
||||
expect(new UInt(registry, '0x1234567890abcdef', 64, false).toJSON()).toEqual('0x1234567890abcdef');
|
||||
it('converts to JSON representation based on size', (): void => {
|
||||
expect(new UInt(registry, '0x12345678', 64).toJSON()).toEqual(0x12345678);
|
||||
expect(new UInt(registry, '0x1234567890', 64).toJSON()).toEqual(0x1234567890);
|
||||
expect(new UInt(registry, '0x1234567890abcdef', 64).toJSON()).toEqual('0x1234567890abcdef');
|
||||
});
|
||||
|
||||
describe('eq', (): void => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { AnyNumber, Constructor, Registry } from '../types';
|
||||
|
||||
import AbstractInt, { DEFAULT_UINT_BITS, UIntBitLength } from './AbstractInt';
|
||||
import AbstractInt, { UIntBitLength } from './AbstractInt';
|
||||
|
||||
/**
|
||||
* @name UInt
|
||||
@@ -16,10 +16,6 @@ import AbstractInt, { DEFAULT_UINT_BITS, UIntBitLength } from './AbstractInt';
|
||||
* @noInheritDoc
|
||||
*/
|
||||
export default class UInt extends AbstractInt {
|
||||
constructor (registry: Registry, value: AnyNumber = 0, bitLength: UIntBitLength = DEFAULT_UINT_BITS, isHexJson = false) {
|
||||
super(registry, false, value, bitLength, isHexJson);
|
||||
}
|
||||
|
||||
public static with (bitLength: UIntBitLength, typeName?: string): Constructor<UInt> {
|
||||
return class extends UInt {
|
||||
constructor (registry: Registry, value?: AnyNumber) {
|
||||
|
||||
@@ -7,7 +7,7 @@ import { ChainProperties, DispatchErrorModule, H256 } from '../interfaces/types'
|
||||
import { CallFunction, Codec, Constructor, InterfaceTypes, RegistryError, RegistryTypes, Registry, RegistryMetadata, RegisteredTypes } from '../types';
|
||||
|
||||
import { extrinsicsFromMeta } from '@polkadot/metadata';
|
||||
import { BN_ZERO, assert, formatBalance, isFunction, isString, isU8a, isUndefined, logger, stringCamelCase, u8aToHex } from '@polkadot/util';
|
||||
import { BN_ZERO, assert, assertReturn, formatBalance, isFunction, isString, isU8a, logger, stringCamelCase, u8aToHex } from '@polkadot/util';
|
||||
import { blake2AsU8a } from '@polkadot/util-crypto';
|
||||
|
||||
import Json from '../codec/Json';
|
||||
@@ -194,11 +194,8 @@ export class TypeRegistry implements Registry {
|
||||
// find a specific call
|
||||
public findMetaCall (callIndex: Uint8Array): CallFunction {
|
||||
const hexIndex = u8aToHex(callIndex);
|
||||
const fn = this.#metadataCalls[hexIndex];
|
||||
|
||||
assert(!isUndefined(fn), `findMetaCall: Unable to find Call with index ${hexIndex}/[${callIndex.toString()}]`);
|
||||
|
||||
return fn;
|
||||
return assertReturn(this.#metadataCalls[hexIndex], `findMetaCall: Unable to find Call with index ${hexIndex}/[${callIndex.toString()}]`);
|
||||
}
|
||||
|
||||
// finds an error
|
||||
@@ -208,20 +205,14 @@ export class TypeRegistry implements Registry {
|
||||
? errorIndex
|
||||
: new Uint8Array([errorIndex.index.toNumber(), errorIndex.error.toNumber()])
|
||||
);
|
||||
const error = this.#metadataErrors[hexIndex];
|
||||
|
||||
assert(!isUndefined(error), `findMetaError: Unable to find Error with index ${hexIndex}/[${errorIndex.toString()}]`);
|
||||
|
||||
return error;
|
||||
return assertReturn(this.#metadataErrors[hexIndex], `findMetaError: Unable to find Error with index ${hexIndex}/[${errorIndex.toString()}]`);
|
||||
}
|
||||
|
||||
public findMetaEvent (eventIndex: Uint8Array): Constructor<EventData> {
|
||||
const hexIndex = u8aToHex(eventIndex);
|
||||
const Event = this.#metadataEvents[hexIndex];
|
||||
|
||||
assert(!isUndefined(Event), `findMetaEvent: Unable to find Event with index ${hexIndex}/[${eventIndex.toString()}]`);
|
||||
|
||||
return Event;
|
||||
return assertReturn(this.#metadataEvents[hexIndex], `findMetaEvent: Unable to find Event with index ${hexIndex}/[${eventIndex.toString()}]`);
|
||||
}
|
||||
|
||||
public get <T extends Codec = Codec> (name: string, withUnknown?: boolean): Constructor<T> | undefined {
|
||||
@@ -272,11 +263,7 @@ export class TypeRegistry implements Registry {
|
||||
}
|
||||
|
||||
public getOrThrow <T extends Codec = Codec> (name: string, msg?: string): Constructor<T> {
|
||||
const Type = this.get<T>(name);
|
||||
|
||||
assert(!isUndefined(Type), msg || `type ${name} not found`);
|
||||
|
||||
return Type;
|
||||
return assertReturn(this.get<T>(name), msg || `type ${name} not found`);
|
||||
}
|
||||
|
||||
public getOrUnknown <T extends Codec = Codec> (name: string): Constructor<T> {
|
||||
|
||||
@@ -47,7 +47,7 @@ function decodeVote (registry: Registry, value?: InputTypes): Uint8Array {
|
||||
}
|
||||
|
||||
const vote = new Bool(registry, value.aye).isTrue ? AYE_BITS : NAY_BITS;
|
||||
const conviction = registry.createType('Conviction', isUndefined(value.conviction) ? DEF_CONV : value.conviction);
|
||||
const conviction = registry.createType('Conviction', value.conviction || DEF_CONV);
|
||||
|
||||
return new Uint8Array([vote | conviction.index]);
|
||||
}
|
||||
|
||||
@@ -10,15 +10,11 @@ import Enum from '../codec/Enum';
|
||||
import Bytes from './Bytes';
|
||||
|
||||
/** @internal */
|
||||
function decodeDataU8a (registry: Registry, value: Uint8Array): [undefined | null | Uint8Array, number | undefined] {
|
||||
if (!value.length) {
|
||||
return [undefined, undefined];
|
||||
}
|
||||
|
||||
function decodeDataU8a (registry: Registry, value: Uint8Array): [undefined | Uint8Array, number | undefined] {
|
||||
const indicator = value[0];
|
||||
|
||||
if (indicator === 0) {
|
||||
return [null, 0];
|
||||
if (!indicator) {
|
||||
return [undefined, undefined];
|
||||
} else if (indicator >= 1 && indicator <= 33) {
|
||||
const length = indicator - 1;
|
||||
const data = value.subarray(1, length + 1);
|
||||
@@ -36,10 +32,8 @@ function decodeDataU8a (registry: Registry, value: Uint8Array): [undefined | nul
|
||||
function decodeData (registry: Registry, value?: Record<string, any> | Uint8Array | Enum | string): [any, number | undefined] {
|
||||
if (!value) {
|
||||
return [undefined, undefined];
|
||||
} else if (isString(value)) {
|
||||
} else if (isU8a(value) || isString(value)) {
|
||||
return decodeDataU8a(registry, u8aToU8a(value));
|
||||
} else if (isU8a(value)) {
|
||||
return decodeDataU8a(registry, value);
|
||||
}
|
||||
|
||||
// assume we have an Enum or an object input, handle this via the normal Enum decoding
|
||||
|
||||
@@ -1720,7 +1720,7 @@ __metadata:
|
||||
"@polkadot/api": ^2.4.2-12
|
||||
"@polkadot/rpc-core": ^2.4.2-12
|
||||
"@polkadot/types": ^2.4.2-12
|
||||
"@polkadot/util": ^3.6.2-8
|
||||
"@polkadot/util": ^3.6.2-10
|
||||
bn.js: ^5.1.3
|
||||
rxjs: ^6.6.3
|
||||
languageName: unknown
|
||||
@@ -1732,12 +1732,12 @@ __metadata:
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.1
|
||||
"@polkadot/api": ^2.4.2-12
|
||||
"@polkadot/keyring": ^3.6.2-8
|
||||
"@polkadot/keyring": ^3.6.2-10
|
||||
"@polkadot/rpc-core": ^2.4.2-12
|
||||
"@polkadot/rpc-provider": ^2.4.2-12
|
||||
"@polkadot/types": ^2.4.2-12
|
||||
"@polkadot/util": ^3.6.2-8
|
||||
"@polkadot/util-crypto": ^3.6.2-8
|
||||
"@polkadot/util": ^3.6.2-10
|
||||
"@polkadot/util-crypto": ^3.6.2-10
|
||||
bn.js: ^5.1.3
|
||||
memoizee: ^0.4.14
|
||||
rxjs: ^6.6.3
|
||||
@@ -1750,14 +1750,14 @@ __metadata:
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.1
|
||||
"@polkadot/api-derive": ^2.4.2-12
|
||||
"@polkadot/keyring": ^3.6.2-8
|
||||
"@polkadot/keyring": ^3.6.2-10
|
||||
"@polkadot/metadata": ^2.4.2-12
|
||||
"@polkadot/rpc-core": ^2.4.2-12
|
||||
"@polkadot/rpc-provider": ^2.4.2-12
|
||||
"@polkadot/types": ^2.4.2-12
|
||||
"@polkadot/types-known": ^2.4.2-12
|
||||
"@polkadot/util": ^3.6.2-8
|
||||
"@polkadot/util-crypto": ^3.6.2-8
|
||||
"@polkadot/util": ^3.6.2-10
|
||||
"@polkadot/util-crypto": ^3.6.2-10
|
||||
bn.js: ^5.1.3
|
||||
eventemitter3: ^4.0.7
|
||||
rxjs: ^6.6.3
|
||||
@@ -1857,14 +1857,14 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/keyring@npm:^3.6.2-8":
|
||||
version: 3.6.2-8
|
||||
resolution: "@polkadot/keyring@npm:3.6.2-8"
|
||||
"@polkadot/keyring@npm:^3.6.2-10":
|
||||
version: 3.6.2-10
|
||||
resolution: "@polkadot/keyring@npm:3.6.2-10"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.1
|
||||
"@polkadot/util": ^3.6.2-8
|
||||
"@polkadot/util-crypto": ^3.6.2-8
|
||||
checksum: 7d38e2c308c1a9b229f3346c22fda46377abace39ed94f070f7af8c0f1a14cab4359074c918b6cf2a416044b2b8f5642438603b08fcf87ab95afd0328a714207
|
||||
"@polkadot/util": ^3.6.2-10
|
||||
"@polkadot/util-crypto": ^3.6.2-10
|
||||
checksum: dd5838b37521dbeb9306a215b7b5f29813a0dcf682b773857c7a8b9f19ab1586f01c8aef7db24b487685e3fc3553a0e8d5ff1d89c2013229241a929c7754c0e2
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -1873,21 +1873,21 @@ __metadata:
|
||||
resolution: "@polkadot/metadata@workspace:packages/metadata"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.1
|
||||
"@polkadot/keyring": ^3.6.2-8
|
||||
"@polkadot/keyring": ^3.6.2-10
|
||||
"@polkadot/types": ^2.4.2-12
|
||||
"@polkadot/types-known": ^2.4.2-12
|
||||
"@polkadot/util": ^3.6.2-8
|
||||
"@polkadot/util-crypto": ^3.6.2-8
|
||||
"@polkadot/util": ^3.6.2-10
|
||||
"@polkadot/util-crypto": ^3.6.2-10
|
||||
bn.js: ^5.1.3
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@polkadot/networks@npm:^3.6.2-8":
|
||||
version: 3.6.2-8
|
||||
resolution: "@polkadot/networks@npm:3.6.2-8"
|
||||
"@polkadot/networks@npm:^3.6.2-10":
|
||||
version: 3.6.2-10
|
||||
resolution: "@polkadot/networks@npm:3.6.2-10"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.1
|
||||
checksum: 523efecd010254b155aa426960fa1dfeda0c96ecf36c4156fbeaaffc1bddc8ef24df62c779cff756aee7c4493cdd5443e4894020980339166b74e16a398bf01e
|
||||
checksum: 5be7cc526937a89dbdbc65161513969260999a0696ffba4e7704d25b6a5cb1ea438f6748c131d26839fc8dab0c4c83207c0195add322ffc1396269fea22a0ca1
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -1896,11 +1896,11 @@ __metadata:
|
||||
resolution: "@polkadot/rpc-core@workspace:packages/rpc-core"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.1
|
||||
"@polkadot/keyring": ^3.6.2-8
|
||||
"@polkadot/keyring": ^3.6.2-10
|
||||
"@polkadot/metadata": ^2.4.2-12
|
||||
"@polkadot/rpc-provider": ^2.4.2-12
|
||||
"@polkadot/types": ^2.4.2-12
|
||||
"@polkadot/util": ^3.6.2-8
|
||||
"@polkadot/util": ^3.6.2-10
|
||||
memoizee: ^0.4.14
|
||||
rxjs: ^6.6.3
|
||||
languageName: unknown
|
||||
@@ -1911,11 +1911,11 @@ __metadata:
|
||||
resolution: "@polkadot/rpc-provider@workspace:packages/rpc-provider"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.1
|
||||
"@polkadot/keyring": ^3.6.2-8
|
||||
"@polkadot/keyring": ^3.6.2-10
|
||||
"@polkadot/metadata": ^2.4.2-12
|
||||
"@polkadot/types": ^2.4.2-12
|
||||
"@polkadot/util": ^3.6.2-8
|
||||
"@polkadot/util-crypto": ^3.6.2-8
|
||||
"@polkadot/util": ^3.6.2-10
|
||||
"@polkadot/util-crypto": ^3.6.2-10
|
||||
"@polkadot/x-fetch": ^0.3.6
|
||||
"@polkadot/x-ws": ^0.3.6
|
||||
bn.js: ^5.1.3
|
||||
@@ -1945,7 +1945,7 @@ __metadata:
|
||||
"@polkadot/metadata": ^2.4.2-12
|
||||
"@polkadot/rpc-provider": ^2.4.2-12
|
||||
"@polkadot/types": ^2.4.2-12
|
||||
"@polkadot/util": ^3.6.2-8
|
||||
"@polkadot/util": ^3.6.2-10
|
||||
"@types/websocket": ^1.0.1
|
||||
"@types/yargs": ^15.0.9
|
||||
handlebars: ^4.7.6
|
||||
@@ -1966,7 +1966,7 @@ __metadata:
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.1
|
||||
"@polkadot/types": ^2.4.2-12
|
||||
"@polkadot/util": ^3.6.2-8
|
||||
"@polkadot/util": ^3.6.2-10
|
||||
"@types/bn.js": ^4.11.6
|
||||
bn.js: ^5.1.3
|
||||
languageName: unknown
|
||||
@@ -1977,10 +1977,10 @@ __metadata:
|
||||
resolution: "@polkadot/types@workspace:packages/types"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.1
|
||||
"@polkadot/keyring": ^3.6.2-8
|
||||
"@polkadot/keyring": ^3.6.2-10
|
||||
"@polkadot/metadata": ^2.4.2-12
|
||||
"@polkadot/util": ^3.6.2-8
|
||||
"@polkadot/util-crypto": ^3.6.2-8
|
||||
"@polkadot/util": ^3.6.2-10
|
||||
"@polkadot/util-crypto": ^3.6.2-10
|
||||
"@types/bn.js": ^4.11.6
|
||||
"@types/memoizee": ^0.4.4
|
||||
bn.js: ^5.1.3
|
||||
@@ -1989,13 +1989,13 @@ __metadata:
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@polkadot/util-crypto@npm:^3.6.2-8":
|
||||
version: 3.6.2-8
|
||||
resolution: "@polkadot/util-crypto@npm:3.6.2-8"
|
||||
"@polkadot/util-crypto@npm:^3.6.2-10":
|
||||
version: 3.6.2-10
|
||||
resolution: "@polkadot/util-crypto@npm:3.6.2-10"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.1
|
||||
"@polkadot/networks": ^3.6.2-8
|
||||
"@polkadot/util": ^3.6.2-8
|
||||
"@polkadot/networks": ^3.6.2-10
|
||||
"@polkadot/util": ^3.6.2-10
|
||||
"@polkadot/wasm-crypto": ^1.4.1
|
||||
base-x: ^3.0.8
|
||||
blakejs: ^1.1.0
|
||||
@@ -2007,13 +2007,13 @@ __metadata:
|
||||
scryptsy: ^2.1.0
|
||||
tweetnacl: ^1.0.3
|
||||
xxhashjs: ^0.2.2
|
||||
checksum: 11369598bbfa017d9a918779f734f6ec8ca86a2c5550b7b48848cda7d1a93f8d03816e9785b1858969eb54fa979b02d4693ea4a6ebdc373660dfde6f5a94ec4d
|
||||
checksum: d8d3534a95d761d4eafb73627df5814567ea2576e685ea60ce42a1ee55feb93cbca6bd27240acc668e5b671306736f33cb6eb4215f82d3a8a9cd151e21e250d0
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/util@npm:^3.6.2-8":
|
||||
version: 3.6.2-8
|
||||
resolution: "@polkadot/util@npm:3.6.2-8"
|
||||
"@polkadot/util@npm:^3.6.2-10":
|
||||
version: 3.6.2-10
|
||||
resolution: "@polkadot/util@npm:3.6.2-10"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.1
|
||||
"@polkadot/x-textdecoder": ^0.3.6
|
||||
@@ -2022,7 +2022,7 @@ __metadata:
|
||||
bn.js: ^5.1.3
|
||||
camelcase: ^5.3.1
|
||||
ip-regex: ^4.2.0
|
||||
checksum: 0e978c5f6dd31c462fafbd6edc4959a091deadc0fa7d51c8097db02885d24b6f186e3c81c084cc1e03133c91d1efb1ff477ef4ee9ecd4d0c4c0fc45709d067d4
|
||||
checksum: 48d4a099e95168e85fae70a94f1fc208ab5e55e5c61ac1eb8c04dab542b6db3707f38f97c7e7fdeb4ea1b18b4ab16c7fdb088891a0ef7d684e6b795362f52f42
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
||||
Reference in New Issue
Block a user