BigInt support (& some TS typing cleanups) (#1919)

* Some TS typing cleanups

* docs building again

* yarn.lock rewrite

* tweaks

* BigInt support

* Checktypes with BigInt

* AccountIndex support for BigInt

* Fix ApiPromise signAsync
This commit is contained in:
Jaco Greeff
2020-02-21 17:26:05 +01:00
committed by GitHub
parent 429b797b23
commit 4540495a44
34 changed files with 401 additions and 434 deletions
@@ -3,7 +3,7 @@
// of the Apache-2.0 license. See the LICENSE file for details.
import { Call } from '@polkadot/types/interfaces';
import { AnyJsonObject, CallFunction, Registry, RegistryMetadataCall } from '@polkadot/types/types';
import { AnyJson, CallFunction, Registry, RegistryMetadataCall } from '@polkadot/types/types';
// we do a direct import here to remove all circular dependencies (importing from
// /types, /types/codec or /types/create makes all hell break loose)
@@ -31,7 +31,7 @@ export default function createDescriptor (registry: Registry, section: string, s
extrinsicFn.meta = callMetadata;
extrinsicFn.method = funcName;
extrinsicFn.section = section;
extrinsicFn.toJSON = (): string | AnyJsonObject =>
extrinsicFn.toJSON = (): AnyJson =>
callMetadata.toJSON();
return extrinsicFn as CallFunction;
@@ -3,12 +3,12 @@
// of the Apache-2.0 license. See the LICENSE file for details.
import { MetadataLatest } from '@polkadot/types/interfaces/metadata';
import { AnyJsonObject, Registry } from '@polkadot/types/types';
import { AnyJson, Registry } from '@polkadot/types/types';
import { createType } from '@polkadot/types/create';
/** @internal */
export default function toCallsOnly (registry: Registry, { extrinsic, modules }: MetadataLatest): AnyJsonObject | string {
export default function toCallsOnly (registry: Registry, { extrinsic, modules }: MetadataLatest): AnyJson {
return createType(registry, 'MetadataLatest', {
// FIXME, this needs typing, not any
modules: modules.map(({ calls, name }): any => ({