Some type imports (interfaces) (#2887)

* Some type imports (interfaces)

* Additional

* Additional

* Small movements/fixes

* Additional

* Additional

* Unsaved...
This commit is contained in:
Jaco Greeff
2020-12-02 10:12:19 +01:00
committed by GitHub
parent 2769336344
commit 0e52e8fe23
342 changed files with 887 additions and 837 deletions
+2 -2
View File
@@ -1,8 +1,8 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { H256 } from '../interfaces/runtime';
import { AnyJson, Codec, Registry } from '../types';
import type { H256 } from '../interfaces/runtime';
import type { AnyJson, Codec, Registry } from '../types';
import { compactToU8a, u8aConcat, u8aToHex } from '@polkadot/util';
+3 -3
View File
@@ -1,9 +1,9 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { H256 } from '../interfaces/runtime';
import { AnyNumber, Codec, Registry } from '../types';
import { UIntBitLength } from './types';
import type { H256 } from '../interfaces/runtime';
import type { AnyNumber, Codec, Registry } from '../types';
import type { UIntBitLength } from './types';
import BN from 'bn.js';
import { BN_ZERO, assert, bnToBn, bnToHex, bnToU8a, formatBalance, formatNumber, hexToBn, isHex, isString, isU8a, u8aToBn } from '@polkadot/util';
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Constructor, Codec, InterfaceTypes, Registry } from '../types';
import type { Constructor, Codec, InterfaceTypes, Registry } from '../types';
import { CodecMap } from './Map';
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { CodecTo } from '../types';
import type { CodecTo } from '../types';
import { TypeRegistry } from '../create';
import { Text, U32 } from '../primitive';
+2 -2
View File
@@ -1,8 +1,8 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { H256 } from '../interfaces/runtime';
import { AnyJson, Constructor, Codec, InterfaceTypes, Registry } from '../types';
import type { H256 } from '../interfaces/runtime';
import type { AnyJson, Constructor, Codec, InterfaceTypes, Registry } from '../types';
import { isHex, hexToU8a, isU8a, logger, u8aConcat, u8aToHex, u8aToU8a, compactFromU8a, compactToU8a } from '@polkadot/util';
+2 -2
View File
@@ -1,8 +1,8 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { H256 } from '../interfaces/runtime';
import { AnyJson, BareOpts, Codec, Registry } from '../types';
import type { H256 } from '../interfaces/runtime';
import type { AnyJson, BareOpts, Codec, Registry } from '../types';
/**
* @name Base
+3 -3
View File
@@ -1,9 +1,9 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { H256 } from '@polkadot/types/interfaces';
import { AnyJson, AnyNumber, Constructor, ICompact, InterfaceTypes, Registry } from '../types';
import { CompactEncodable, UIntBitLength } from './types';
import type { H256 } from '../interfaces';
import type { AnyJson, AnyNumber, Constructor, ICompact, InterfaceTypes, Registry } from '../types';
import type { CompactEncodable, UIntBitLength } from './types';
import BN from 'bn.js';
import { compactFromU8a, compactToU8a, isBigInt, isBn, isNumber, isString } from '@polkadot/util';
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { CodecTo } from '../types';
import type { CodecTo } from '../types';
import BN from 'bn.js';
+3 -3
View File
@@ -1,9 +1,9 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { H256 } from '../interfaces/runtime';
import { AnyNumber, Codec, Registry } from '../types';
import { UIntBitLength } from './types';
import type { H256 } from '../interfaces/runtime';
import type { AnyNumber, Codec, Registry } from '../types';
import type { UIntBitLength } from './types';
import BN from 'bn.js';
import { bnToBn, bnToHex, bnToU8a, isString, isU8a, u8aToBn } from '@polkadot/util';
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Registry } from '../types';
import type { Registry } from '../types';
import { u8aToHex } from '@polkadot/util';
+2 -2
View File
@@ -1,8 +1,8 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { H256 } from '@polkadot/types/interfaces';
import { AnyJson, Codec, Constructor, InterfaceTypes, Registry } from '../types';
import type { H256 } from '../interfaces';
import type { AnyJson, Codec, Constructor, InterfaceTypes, Registry } from '../types';
import { assert, hexToU8a, isHex, isNumber, isObject, isString, isU8a, isUndefined, stringCamelCase, stringUpperFirst, u8aConcat, u8aToHex } from '@polkadot/util';
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Constructor, Codec, InterfaceTypes, Registry } from '../types';
import type { Constructor, Codec, InterfaceTypes, Registry } from '../types';
import { CodecMap } from './Map';
+2 -2
View File
@@ -1,8 +1,8 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { AnyNumber, Constructor, Registry } from '../types';
import { UIntBitLength } from './types';
import type { AnyNumber, Constructor, Registry } from '../types';
import type { UIntBitLength } from './types';
import { AbstractInt } from './AbstractInt';
+2 -2
View File
@@ -1,8 +1,8 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { H256 } from '../interfaces/runtime';
import { AnyJson, Codec, Registry } from '../types';
import type { H256 } from '../interfaces/runtime';
import type { AnyJson, Codec, Registry } from '../types';
import { isUndefined } from '@polkadot/util';
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Constructor, Codec, InterfaceTypes, Registry } from '../types';
import type { Constructor, Codec, InterfaceTypes, Registry } from '../types';
import { Option } from './Option';
import { Struct } from './Struct';
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { CodecTo } from '../types';
import type { CodecTo } from '../types';
import { TypeRegistry } from '../create';
import { Text, U32 } from '../primitive';
+2 -2
View File
@@ -1,8 +1,8 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { H256 } from '../interfaces/runtime';
import { AnyJson, Constructor, Codec, InterfaceTypes, Registry } from '../types';
import type { H256 } from '../interfaces/runtime';
import type { AnyJson, Constructor, Codec, InterfaceTypes, Registry } from '../types';
import { isHex, hexToU8a, isObject, isU8a, logger, u8aConcat, u8aToHex, u8aToU8a, compactFromU8a, compactToU8a } from '@polkadot/util';
+2 -2
View File
@@ -1,8 +1,8 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { H256 } from '@polkadot/types/interfaces';
import { AnyJson, Codec, Constructor, InterfaceTypes, Registry } from '../types';
import type { H256 } from '../interfaces';
import type { AnyJson, Codec, Constructor, InterfaceTypes, Registry } from '../types';
import { assert, isNull, isU8a, isUndefined, u8aToHex } from '@polkadot/util';
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { CodecTo } from '../types';
import type { CodecTo } from '../types';
import { TypeRegistry } from '../create';
import { Raw } from '.';
+2 -2
View File
@@ -1,8 +1,8 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { H256 } from '../interfaces/runtime';
import { AnyJson, AnyU8a, IU8a, Registry } from '../types';
import type { H256 } from '../interfaces/runtime';
import type { AnyJson, AnyU8a, IU8a, Registry } from '../types';
import { assert, isAscii, isU8a, isUndefined, isUtf8, u8aToHex, u8aToString, u8aToU8a } from '@polkadot/util';
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Codec, Constructor, InterfaceTypes, Registry } from '../types';
import type { Codec, Constructor, InterfaceTypes, Registry } from '../types';
import { assert } from '@polkadot/util';
+2 -2
View File
@@ -1,8 +1,8 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { H256 } from '../interfaces/runtime';
import { Codec, Constructor, Registry } from '../types';
import type { H256 } from '../interfaces/runtime';
import type { Codec, Constructor, Registry } from '../types';
import BN from 'bn.js';
import { assert, bnToBn, bnToU8a, isBn, isU8a, isNumber, isString, isUndefined, stringCamelCase, stringUpperFirst, u8aToHex, u8aToBn, u8aToU8a } from '@polkadot/util';
+1 -1
View File
@@ -3,7 +3,7 @@
/* eslint-disable sort-keys */
import { CodecTo } from '../types';
import type { CodecTo } from '../types';
import { TypeRegistry } from '../create';
import { Text, U32 } from '../primitive';
+2 -2
View File
@@ -1,8 +1,8 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { H256 } from '../interfaces/runtime';
import { AnyJson, BareOpts, Codec, Constructor, ConstructorDef, InterfaceTypes, Registry } from '../types';
import type { H256 } from '../interfaces/runtime';
import type { AnyJson, BareOpts, Codec, Constructor, ConstructorDef, InterfaceTypes, Registry } from '../types';
import { hexToU8a, isBoolean, isFunction, isHex, isObject, isU8a, isUndefined, stringCamelCase, u8aConcat, u8aToHex } from '@polkadot/util';
+3 -3
View File
@@ -1,9 +1,9 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { VoteThreshold } from '../interfaces/elections';
import { BlockNumber } from '../interfaces/runtime';
import { CodecTo } from '../types';
import type { VoteThreshold } from '../interfaces/elections';
import type { BlockNumber } from '../interfaces/runtime';
import type { CodecTo } from '../types';
import { Metadata } from '@polkadot/metadata';
import rpcMetadata from '@polkadot/metadata/static';
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { AnyNumber, AnyU8a, AnyString, Codec, Constructor, InterfaceTypes, Registry } from '../types';
import type { AnyNumber, AnyU8a, AnyString, Codec, Constructor, InterfaceTypes, Registry } from '../types';
import { isU8a, isHex, hexToU8a, u8aConcat } from '@polkadot/util';
+2 -2
View File
@@ -1,8 +1,8 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { AnyU8a, Constructor, Registry } from '../types';
import { U8aBitLength } from './types';
import type { AnyU8a, Constructor, Registry } from '../types';
import type { U8aBitLength } from './types';
import { isString, u8aToU8a } from '@polkadot/util';
+2 -2
View File
@@ -1,8 +1,8 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { AnyNumber, Constructor, Registry } from '../types';
import { UIntBitLength } from './types';
import type { AnyNumber, Constructor, Registry } from '../types';
import type { UIntBitLength } from './types';
import { AbstractInt } from './AbstractInt';
+2 -2
View File
@@ -1,8 +1,8 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { PropIndex } from '../interfaces/democracy';
import { Codec, CodecTo } from '../types';
import type { PropIndex } from '../interfaces/democracy';
import type { Codec, CodecTo } from '../types';
import { Metadata } from '@polkadot/metadata';
import rpcMetadata from '@polkadot/metadata/static';
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Codec, Constructor, InterfaceTypes, Registry } from '../types';
import type { Codec, Constructor, InterfaceTypes, Registry } from '../types';
import { assert, compactFromU8a, logger, u8aToU8a } from '@polkadot/util';
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Codec } from '../types';
import type { Codec } from '../types';
import { AbstractArray } from './AbstractArray';
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Codec, Constructor, InterfaceTypes, Registry } from '../types';
import type { Codec, Constructor, InterfaceTypes, Registry } from '../types';
import { assert, isU8a, u8aConcat, compactToU8a } from '@polkadot/util';
+1 -2
View File
@@ -1,9 +1,8 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Codec } from '../types';
import type BN from 'bn.js';
import type { Codec } from '../types';
export interface CompactEncodable extends Codec {
bitLength (): number;
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Codec } from '../../types';
import type { Codec } from '../../types';
import { TypeRegistry } from '../../create';
import { U32 } from '../../primitive';
import { compareMap } from '.';
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Codec, Constructor, Registry } from '../../types';
import type { Codec, Constructor, Registry } from '../../types';
/**
* Given an u8a, and an array of Type constructors, decode the u8a against the
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Constructor, InterfaceTypes, Registry } from '../../types';
import type { Constructor, InterfaceTypes, Registry } from '../../types';
import { typeToConstructor } from './typeToConstructor';
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Codec, Constructor, InterfaceTypes, Registry } from '../../types';
import type { Codec, Constructor, InterfaceTypes, Registry } from '../../types';
import { isString } from '@polkadot/util';
@@ -2,7 +2,6 @@
// SPDX-License-Identifier: Apache-2.0
import { TypeDefInfo } from '../types';
import { createClass, getTypeClass, TypeRegistry } from '.';
describe('createClass', (): void => {
+4 -4
View File
@@ -1,16 +1,16 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { UIntBitLength, U8aBitLength } from '../codec/types';
import { Codec, Constructor, InterfaceTypes, Registry } from '../types';
import { FromReg, TypeDef, TypeDefInfo } from './types';
import type { UIntBitLength, U8aBitLength } from '../codec/types';
import type { Codec, Constructor, InterfaceTypes, Registry } from '../types';
import type { FromReg, TypeDef } from './types';
import { assert, isNumber, isUndefined } from '@polkadot/util';
import { BTreeMap, BTreeSet, CodecSet, Compact, Enum, HashMap, Int, Option, Result, Struct, Tuple, U8aFixed, UInt, Vec, VecFixed } from '../codec';
import { DoNotConstruct } from '../primitive';
import { getTypeDef } from './getTypeDef';
import { TypeDefInfo } from './types';
export function createClass<T extends Codec = Codec, K extends string = string> (registry: Registry, type: K): Constructor<FromReg<T, K>> {
// eslint-disable-next-line @typescript-eslint/no-use-before-define
+2 -2
View File
@@ -1,8 +1,8 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Codec, Constructor, InterfaceTypes, Registry } from '../types';
import { FromReg } from './types';
import type { Codec, Constructor, InterfaceTypes, Registry } from '../types';
import type { FromReg } from './types';
import { isU8a, logger, u8aToHex } from '@polkadot/util';
+3 -1
View File
@@ -1,10 +1,12 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { TypeDef, TypeDefInfo } from './types';
import type { TypeDef } from './types';
import { assert, isNumber, isUndefined } from '@polkadot/util';
import { TypeDefInfo } from './types';
const stringIdentity = <T extends { toString: () => string }> (value: T): string => value.toString();
const INFO_WRAP = ['BTreeMap', 'BTreeSet', 'Compact', 'HashMap', 'Option', 'Result', 'Vec'];
@@ -2,7 +2,6 @@
// SPDX-License-Identifier: Apache-2.0
import { TypeDefInfo } from './types';
import { TypeRegistry, getTypeDef } from '.';
describe('getTypeDef', (): void => {
+2 -1
View File
@@ -1,11 +1,12 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { TypeDef, TypeDefInfo } from './types';
import type { TypeDef } from './types';
import { assert } from '@polkadot/util';
import { sanitize } from './sanitize';
import { TypeDefInfo } from './types';
import { typeSplit } from './typeSplit';
interface TypeDefOptions {
+1 -1
View File
@@ -3,7 +3,7 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
import { Codec, Constructor } from '../types';
import type { Codec, Constructor } from '../types';
import { isChildClass, u8aToU8a } from '@polkadot/util';
import { keccakAsU8a } from '@polkadot/util-crypto';
+2 -2
View File
@@ -3,8 +3,8 @@
/* eslint-disable @typescript-eslint/no-var-requires */
import { ChainProperties, DispatchErrorModule, H256 } from '../interfaces/types';
import { CallFunction, Codec, Constructor, InterfaceTypes, RegistryError, RegistryTypes, Registry, RegistryMetadata, RegisteredTypes } from '../types';
import type { ChainProperties, DispatchErrorModule, H256 } from '../interfaces/types';
import type { CallFunction, Codec, Constructor, InterfaceTypes, RegistryError, RegistryTypes, Registry, RegistryMetadata, RegisteredTypes } from '../types';
import { Metadata, extrinsicsFromMeta } from '@polkadot/metadata';
import { BN_ZERO, assert, assertReturn, formatBalance, isFunction, isString, isU8a, logger, stringCamelCase, u8aToHex } from '@polkadot/util';
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Codec, InterfaceTypes } from '../types';
import type { Codec, InterfaceTypes } from '../types';
// Type which says: if `K` is in the InterfaceTypes, then return InterfaceTypes[K], else fallback to T
export type FromReg<T extends Codec, K extends string> = K extends keyof InterfaceTypes
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { AnyString, AnyU8a, Registry } from '../types';
import type { AnyString, AnyU8a, Registry } from '../types';
import { hexToU8a, isHex, isString, isU8a, u8aToU8a } from '@polkadot/util';
import { ethereumEncode, isEthereumAddress } from '@polkadot/util-crypto';
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Registry } from '../types';
import type { Registry } from '../types';
import BN from 'bn.js';
import { isBigInt, isBn, isHex, isNumber, isU8a, u8aConcat, u8aToHex, u8aToU8a, u8aToBn } from '@polkadot/util';
+4 -4
View File
@@ -1,10 +1,10 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { FunctionMetadataLatest } from '../interfaces/metadata/types';
import { EcdsaSignature, Ed25519Signature, ExtrinsicUnknown, ExtrinsicV4, Sr25519Signature } from '../interfaces/extrinsics';
import { Address, Balance, Call, Index } from '../interfaces/runtime';
import { AnyJson, AnyU8a, ArgsDef, Codec, ExtrinsicPayloadValue, IExtrinsic, IKeyringPair, InterfaceTypes, Registry, SignatureOptions } from '../types';
import type { FunctionMetadataLatest } from '../interfaces/metadata/types';
import type { EcdsaSignature, Ed25519Signature, ExtrinsicUnknown, ExtrinsicV4, Sr25519Signature } from '../interfaces/extrinsics';
import type { Address, Balance, Call, Index } from '../interfaces/runtime';
import type { AnyJson, AnyU8a, ArgsDef, Codec, ExtrinsicPayloadValue, IExtrinsic, IKeyringPair, InterfaceTypes, Registry, SignatureOptions } from '../types';
import { assert, compactAddLength, compactFromU8a, isHex, isU8a, u8aConcat, u8aToHex, u8aToU8a } from '@polkadot/util';
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { AnyU8a, IExtrinsicEra, Registry } from '../types';
import type { AnyU8a, IExtrinsicEra, Registry } from '../types';
import BN from 'bn.js';
import { assert, bnToBn, formatNumber, hexToU8a, isHex, isU8a, isObject, u8aToBn, u8aToU8a } from '@polkadot/util';
@@ -1,9 +1,9 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ExtrinsicPayloadV4 } from '../interfaces/extrinsics';
import { Balance, Hash, Index } from '../interfaces/runtime';
import { AnyJson, BareOpts, ExtrinsicPayloadValue, IKeyringPair, InterfaceTypes, Registry } from '../types';
import type { ExtrinsicPayloadV4 } from '../interfaces/extrinsics';
import type { Balance, Hash, Index } from '../interfaces/runtime';
import type { AnyJson, BareOpts, ExtrinsicPayloadValue, IKeyringPair, InterfaceTypes, Registry } from '../types';
import { u8aToHex } from '@polkadot/util';
@@ -1,8 +1,8 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Registry } from '../types';
import { ExtrinsicPayloadOptions } from './types';
import type { Registry } from '../types';
import type { ExtrinsicPayloadOptions } from './types';
import { Struct } from '../codec/Struct';
@@ -1,8 +1,8 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Registry } from '../types';
import { ExtrinsicOptions } from './types';
import type { Registry } from '../types';
import type { ExtrinsicOptions } from './types';
import { Struct } from '../codec/Struct';
import { UNMASK_VERSION } from './constants';
@@ -1,8 +1,8 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Address, Balance, BlockNumber, Call, ExtrinsicEra, Hash, Index, RuntimeVersion } from '../interfaces';
import { Codec, Constructor, ISignerPayload, SignerPayloadJSON, SignerPayloadRaw } from '../types';
import type { Address, Balance, BlockNumber, Call, ExtrinsicEra, Hash, Index, RuntimeVersion } from '../interfaces';
import type { Codec, Constructor, ISignerPayload, SignerPayloadJSON, SignerPayloadRaw } from '../types';
import { u8aToHex } from '@polkadot/util';
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ExtDef, ExtInfo, ExtTypes } from './types';
import type { ExtDef, ExtInfo, ExtTypes } from './types';
import polkadotExtensions from './polkadot';
import substrateExtensions from './substrate';
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ExtDef } from './types';
import type { ExtDef } from './types';
import { emptyCheck } from './emptyCheck';
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ExtDef } from './types';
import type { ExtDef } from './types';
import { emptyCheck } from './emptyCheck';
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { InterfaceTypes } from '../../types';
import type { InterfaceTypes } from '../../types';
export type ExtTypes = Record<string, keyof InterfaceTypes>;
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { AnyNumber } from '../types';
import type { AnyNumber } from '../types';
export interface ExtrinsicOptions {
isSigned: boolean;
+2 -2
View File
@@ -1,8 +1,8 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { SignOptions } from '@polkadot/keyring/types';
import { IKeyringPair, Registry } from '../types';
import type { SignOptions } from '@polkadot/keyring/types';
import type { IKeyringPair, Registry } from '../types';
// a helper function for both types of payloads, Raw and metadata-known
export function sign (registry: Registry, signerPair: IKeyringPair, u8a: Uint8Array, options?: SignOptions): Uint8Array {
+4 -4
View File
@@ -1,10 +1,10 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ExtrinsicSignatureV4 } from '../../interfaces/extrinsics';
import { Address, Call } from '../../interfaces/runtime';
import { ExtrinsicPayloadValue, IExtrinsicImpl, IKeyringPair, Registry, SignatureOptions } from '../../types';
import { ExtrinsicOptions } from '../types';
import type { ExtrinsicSignatureV4 } from '../../interfaces/extrinsics';
import type { Address, Call } from '../../interfaces/runtime';
import type { ExtrinsicPayloadValue, IExtrinsicImpl, IKeyringPair, Registry, SignatureOptions } from '../../types';
import type { ExtrinsicOptions } from '../types';
import { isU8a } from '@polkadot/util';
@@ -1,10 +1,10 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { SignOptions } from '@polkadot/keyring/types';
import { ExtrinsicEra } from '../../interfaces/extrinsics';
import { Balance, Hash, Index } from '../../interfaces/runtime';
import { ExtrinsicPayloadValue, IKeyringPair, Registry } from '../../types';
import type { SignOptions } from '@polkadot/keyring/types';
import type { ExtrinsicEra } from '../../interfaces/extrinsics';
import type { Balance, Hash, Index } from '../../interfaces/runtime';
import type { ExtrinsicPayloadValue, IKeyringPair, Registry } from '../../types';
import { Compact } from '../../codec/Compact';
import { Enum } from '../../codec/Enum';
@@ -1,10 +1,10 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { EcdsaSignature, Ed25519Signature, ExtrinsicEra, ExtrinsicSignature, Sr25519Signature } from '../../interfaces/extrinsics';
import { Address, Balance, Call, Index } from '../../interfaces/runtime';
import { ExtrinsicPayloadValue, IExtrinsicSignature, IKeyringPair, Registry, SignatureOptions } from '../../types';
import { ExtrinsicSignatureOptions } from '../types';
import type { EcdsaSignature, Ed25519Signature, ExtrinsicEra, ExtrinsicSignature, Sr25519Signature } from '../../interfaces/extrinsics';
import type { Address, Balance, Call, Index } from '../../interfaces/runtime';
import type { ExtrinsicPayloadValue, IExtrinsicSignature, IKeyringPair, Registry, SignatureOptions } from '../../types';
import type { ExtrinsicSignatureOptions } from '../types';
import { u8aConcat } from '@polkadot/util';
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { AnyString, AnyU8a, Registry } from '../types';
import type { AnyString, AnyU8a, Registry } from '../types';
import { hexToU8a, isHex, isString, isU8a, u8aToU8a, assert } from '@polkadot/util';
import { decodeAddress, encodeAddress } from '@polkadot/util-crypto';
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { AnyNumber, Registry } from '../types';
import type { AnyNumber, Registry } from '../types';
import BN from 'bn.js';
import { bnToBn, isBn, isBigInt, isNumber, isU8a, isHex } from '@polkadot/util';
+2 -2
View File
@@ -1,8 +1,8 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Digest, DigestItem, H256, Header } from '../interfaces/runtime';
import { AnyNumber, AnyU8a, Registry } from '../types';
import type { Digest, DigestItem, H256, Header } from '../interfaces/runtime';
import type { AnyNumber, AnyU8a, Registry } from '../types';
import { GenericExtrinsic } from '../extrinsic/Extrinsic';
import { Struct } from '../codec/Struct';
+2 -2
View File
@@ -1,8 +1,8 @@
// Copyright 2017-2020 @polkadot/metadata authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { FunctionArgumentMetadataLatest, FunctionMetadataLatest } from '../interfaces/metadata';
import { AnyJson, AnyU8a, ArgsDef, CallFunction, Codec, IMethod, Registry } from '../types';
import type { FunctionArgumentMetadataLatest, FunctionMetadataLatest } from '../interfaces/metadata';
import type { AnyJson, AnyU8a, ArgsDef, CallFunction, Codec, IMethod, Registry } from '../types';
import { isHex, isObject, isU8a, u8aToU8a } from '@polkadot/util';
+4 -4
View File
@@ -1,10 +1,10 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { TypeDef } from '../create/types';
import { EventMetadataLatest } from '../interfaces/metadata';
import { EventId } from '../interfaces/system';
import { AnyJson, Constructor, Registry, RegistryMetadataEvent } from '../types';
import type { TypeDef } from '../create/types';
import type { EventMetadataLatest } from '../interfaces/metadata';
import type { EventId } from '../interfaces/system';
import type { AnyJson, Constructor, Registry, RegistryMetadataEvent } from '../types';
import { Struct } from '../codec/Struct';
import { Tuple } from '../codec/Tuple';
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Registry } from '../types';
import type { Registry } from '../types';
import BN from 'bn.js';
import { isBigInt, isBn, isHex, isNumber, isU8a, u8aConcat, u8aToHex, u8aToU8a, u8aToBn } from '@polkadot/util';
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Registry } from '../types';
import type { Registry } from '../types';
import { isBn, isNumber, isString, isU8a } from '@polkadot/util';
import { decodeAddress } from '@polkadot/util-crypto';
+3 -3
View File
@@ -1,9 +1,9 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { AnyJson, ArrayElementType, Registry } from '../types';
import { AllConvictions } from '../interfaces/democracy/definitions';
import { Conviction } from '../interfaces/democracy';
import type { AnyJson, ArrayElementType, Registry } from '../types';
import type { AllConvictions } from '../interfaces/democracy/definitions';
import type { Conviction } from '../interfaces/democracy';
import { isBoolean, isNumber, isU8a, isUndefined } from '@polkadot/util';
+2 -1
View File
@@ -1,11 +1,12 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Codec } from './types';
import { Metadata } from '@polkadot/metadata';
import metadataStatic from '@polkadot/metadata/static';
import { createTypeUnsafe, TypeRegistry } from './create';
import { Codec } from './types';
import * as exported from './index.types';
import * as definitions from './interfaces/definitions';
@@ -4,7 +4,7 @@
// order important in structs... :)
/* eslint-disable sort-keys */
import { Definitions } from '../../types';
import type { Definitions } from '../../types';
export default {
rpc: {},
@@ -4,7 +4,7 @@
// order important in structs... :)
/* eslint-disable sort-keys */
import { Definitions } from '../../types';
import type { Definitions } from '../../types';
export default {
rpc: {},
@@ -4,7 +4,7 @@
// order important in structs... :)
/* eslint-disable sort-keys */
import { Definitions } from '../../types';
import type { Definitions } from '../../types';
export default {
rpc: {
@@ -4,7 +4,7 @@
// order important in structs... :)
/* eslint-disable sort-keys */
import { Definitions } from '../../types';
import type { Definitions } from '../../types';
export default {
rpc: {},
@@ -4,7 +4,7 @@
// order important in structs... :)
/* eslint-disable sort-keys */
import { Definitions } from '../../types';
import type { Definitions } from '../../types';
export default {
rpc: {
@@ -4,7 +4,7 @@
// order important in structs... :)
/* eslint-disable sort-keys */
import { Definitions } from '../../types';
import type { Definitions } from '../../types';
export default {
rpc: {},
@@ -4,7 +4,7 @@
// order important in structs... :)
/* eslint-disable sort-keys */
import { Definitions } from '../../types';
import type { Definitions } from '../../types';
export default {
rpc: {
@@ -4,7 +4,7 @@
// order important in structs... :)
/* eslint-disable sort-keys */
import { Definitions } from '../../types';
import type { Definitions } from '../../types';
export default {
rpc: {
@@ -4,7 +4,7 @@
// order important in structs... :)
/* eslint-disable sort-keys */
import { Definitions } from '../../types';
import type { Definitions } from '../../types';
export default {
rpc: {},
@@ -4,7 +4,7 @@
// order important in structs... :)
/* eslint-disable sort-keys */
import { Definitions } from '../../types';
import type { Definitions } from '../../types';
export default {
rpc: {},
@@ -4,7 +4,7 @@
// order important in structs... :)
/* eslint-disable sort-keys */
import { Definitions } from '../../types';
import type { Definitions } from '../../types';
export default {
rpc: {},
@@ -4,7 +4,7 @@
// order important in structs... :)
/* eslint-disable sort-keys */
import { Definitions } from '../../types';
import type { Definitions } from '../../types';
export default {
rpc: {
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Definitions } from '../../types';
import type { Definitions } from '../../types';
// order important in structs... :)
/* eslint-disable sort-keys */
@@ -4,7 +4,7 @@
// order important in structs... :)
/* eslint-disable sort-keys */
import { Definitions } from '../../types';
import type { Definitions } from '../../types';
const AllConvictions = [
// 0.1x votes, unlocked.
@@ -4,7 +4,7 @@
// order important in structs... :)
/* eslint-disable sort-keys */
import { Definitions } from '../../types';
import type { Definitions } from '../../types';
export default {
rpc: {},
@@ -4,7 +4,7 @@
// order important in structs... :)
/* eslint-disable sort-keys */
import { Definitions } from '../../types';
import type { Definitions } from '../../types';
export default {
rpc: {
@@ -4,7 +4,7 @@
// order important in structs... :)
/* eslint-disable sort-keys */
import { Definitions } from '../../types';
import type { Definitions } from '../../types';
export default {
rpc: {},
@@ -4,7 +4,7 @@
// order important in structs... :)
/* eslint-disable sort-keys */
import { Definitions } from '../../types';
import type { Definitions } from '../../types';
export default {
rpc: {},
@@ -4,7 +4,7 @@
// order important in structs... :)
/* eslint-disable sort-keys */
import { Definitions } from '../../types';
import type { Definitions } from '../../types';
export default {
rpc: {},
@@ -4,7 +4,7 @@
// order important in structs... :)
/* eslint-disable sort-keys */
import { Definitions } from '../../types';
import type { Definitions } from '../../types';
export default {
rpc: {},
@@ -4,7 +4,7 @@
// order important in structs... :)
/* eslint-disable sort-keys */
import { Definitions } from '../../types';
import type { Definitions } from '../../types';
export default {
rpc: {
@@ -4,7 +4,7 @@
// order important in structs... :)
/* eslint-disable sort-keys */
import { Definitions } from '../../types';
import type { Definitions } from '../../types';
export default {
rpc: {},
@@ -4,7 +4,7 @@
// order important in structs... :)
/* eslint-disable sort-keys */
import { Definitions } from '../../types';
import type { Definitions } from '../../types';
export default {
rpc: {},
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { DefinitionRpcExt, DefinitionRpcSub } from '../types';
import type { DefinitionRpcExt, DefinitionRpcSub } from '../types';
import * as definitions from './definitions';
@@ -4,7 +4,7 @@
// order important in structs... :)
/* eslint-disable sort-keys */
import { Definitions } from '../../types';
import type { Definitions } from '../../types';
const AllHashers = {
Blake2_128: null, // eslint-disable-line camelcase
@@ -4,7 +4,7 @@
// order important in structs... :)
/* eslint-disable sort-keys */
import { Definitions } from '../../types';
import type { Definitions } from '../../types';
export default {
rpc: {
@@ -4,7 +4,7 @@
// order important in structs... :)
/* eslint-disable sort-keys */
import { Definitions } from '../../types';
import type { Definitions } from '../../types';
export default {
rpc: {},
@@ -4,7 +4,7 @@
// order important in structs... :)
/* eslint-disable sort-keys */
import { Definitions } from '../../types';
import type { Definitions } from '../../types';
const SLOT_RANGE_COUNT = 10;

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