Move types.d.ts -> types.ts (#421)
* Move types.d.ts -> types.ts * Bump common deps
This commit is contained in:
@@ -2,9 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { Observable } from 'rxjs';
|
||||
import { AccountId, Balance, BlockNumber, bool as Bool, Header, PropIndex, Proposal, ReferendumIndex, u32, VoteThreshold } from '@polkadot/types/index';
|
||||
import { Tuple } from '@polkadot/types/codec';
|
||||
import { AccountId, Balance, bool as Bool } from '@polkadot/types/index';
|
||||
|
||||
import ApiBase from './Base';
|
||||
import ApiCalls from './Calls';
|
||||
@@ -21,14 +19,14 @@ export type RxBalance = {
|
||||
votingBalance: Balance,
|
||||
stakingBalance: Balance,
|
||||
nominators?: Array<RxBalance>
|
||||
}
|
||||
};
|
||||
|
||||
export type RxFees = {
|
||||
baseFee: Balance,
|
||||
byteFee: Balance,
|
||||
creationFee: Balance,
|
||||
existentialDeposit: Balance,
|
||||
transferFee: Balance,
|
||||
transferFee: Balance
|
||||
};
|
||||
|
||||
export type RxReferendumVote = {
|
||||
@@ -39,4 +37,4 @@ export type RxReferendumVote = {
|
||||
|
||||
export type RxBalanceMap = {
|
||||
[index: string]: RxBalance
|
||||
}
|
||||
};
|
||||
@@ -7,10 +7,7 @@ import { ExtrinsicFunction } from '@polkadot/types/Method';
|
||||
import { StorageFunction } from '@polkadot/types/StorageKey';
|
||||
import { ApiBaseInterface } from '../types';
|
||||
|
||||
import { Observable } from 'rxjs';
|
||||
import Rpc from '@polkadot/rpc-core/index';
|
||||
import { Hash, RuntimeVersion } from '@polkadot/types/index';
|
||||
import RuntimeMetadata, { FunctionMetadata } from '@polkadot/types/Metadata';
|
||||
|
||||
import SubmittableExtrinsic from './SubmittableExtrinsic';
|
||||
|
||||
@@ -9,8 +9,6 @@ import { ApiBaseInterface } from '../types';
|
||||
|
||||
import { Observable } from 'rxjs';
|
||||
import RpcRx from '@polkadot/rpc-rx/index';
|
||||
import { Hash, RuntimeVersion } from '@polkadot/types/index';
|
||||
import RuntimeMetadata, { FunctionMetadata } from '@polkadot/types/Metadata';
|
||||
|
||||
import SubmittableExtrinsic from './SubmittableExtrinsic';
|
||||
|
||||
@@ -2,12 +2,9 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import RpcRx from '@polkadot/rpc-rx/index';
|
||||
import { RpcRxInterface$Events } from '@polkadot/rpc-rx/types';
|
||||
import { Hash, RuntimeVersion } from '@polkadot/types/index';
|
||||
import RuntimeMetadata, { FunctionMetadata } from '@polkadot/types/Metadata';
|
||||
import { ExtrinsicFunction } from '@polkadot/types/Method';
|
||||
import { StorageFunction } from '@polkadot/types/StorageKey';
|
||||
import RuntimeMetadata from '@polkadot/types/Metadata';
|
||||
|
||||
export type ApiInterface$Events = RpcRxInterface$Events | 'ready';
|
||||
|
||||
@@ -17,7 +14,7 @@ export interface ApiBaseInterface<R, S, E> {
|
||||
readonly runtimeVersion: RuntimeVersion;
|
||||
readonly query: S;
|
||||
readonly rpc: R;
|
||||
readonly tx: E
|
||||
readonly tx: E;
|
||||
|
||||
on: (type: ApiInterface$Events, handler: (...args: Array<any>) => any) => void;
|
||||
}
|
||||
@@ -33,6 +33,6 @@
|
||||
"@polkadot/jsonrpc": "^0.32.10",
|
||||
"@polkadot/rpc-provider": "^0.32.10",
|
||||
"@polkadot/types": "^0.32.10",
|
||||
"@polkadot/util": "^0.33.5"
|
||||
"@polkadot/util": "^0.33.6"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import interfaces from '@polkadot/jsonrpc/index';
|
||||
|
||||
export interface RpcInterface$Section$Method {
|
||||
(...params: Array<any>): Promise<any>;
|
||||
|
||||
@@ -30,10 +30,10 @@
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-provider#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.1.5",
|
||||
"@polkadot/keyring": "^0.33.5",
|
||||
"@polkadot/keyring": "^0.33.6",
|
||||
"@polkadot/storage": "^0.32.10",
|
||||
"@polkadot/util": "^0.33.5",
|
||||
"@polkadot/util-crypto": "^0.33.5",
|
||||
"@polkadot/util": "^0.33.6",
|
||||
"@polkadot/util-crypto": "^0.33.6",
|
||||
"@types/nock": "^9.3.0",
|
||||
"eventemitter3": "^3.1.0",
|
||||
"isomorphic-fetch": "^2.2.1",
|
||||
|
||||
@@ -2,9 +2,6 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import EventEmitter from 'eventemitter3';
|
||||
import { Logger } from '@polkadot/util/types';
|
||||
|
||||
export type MockState$Subscription$Callback = (error: Error | null, value: any) => void;
|
||||
|
||||
export type MockState$Subscriptions = {
|
||||
@@ -42,9 +42,9 @@ export type ProviderInterface$Emitted = 'connected' | 'disconnected';
|
||||
export type ProviderInterface$EmitCb = (value?: any) => any;
|
||||
|
||||
export interface ProviderInterface {
|
||||
isConnected (): boolean,
|
||||
on (type: ProviderInterface$Emitted, sub: ProviderInterface$EmitCb): void,
|
||||
send (method: string, params: Array<any>): Promise<any>,
|
||||
subscribe (type: string, method: string, params: Array<any>, cb: ProviderInterface$Callback): Promise<number>,
|
||||
unsubscribe (type: string, method: string, id: number): Promise<boolean>
|
||||
isConnected (): boolean;
|
||||
on (type: ProviderInterface$Emitted, sub: ProviderInterface$EmitCb): void;
|
||||
send (method: string, params: Array<any>): Promise<any>;
|
||||
subscribe (type: string, method: string, params: Array<any>, cb: ProviderInterface$Callback): Promise<number>;
|
||||
unsubscribe (type: string, method: string, id: number): Promise<boolean>;
|
||||
}
|
||||
@@ -20,4 +20,4 @@ export type RpcRxInterface = {
|
||||
|
||||
isConnected: () => Observable<boolean>
|
||||
on: (type: RpcRxInterface$Events, handler: (...args: Array<any>) => any) => void;
|
||||
}
|
||||
};
|
||||
@@ -12,6 +12,6 @@
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.1.5",
|
||||
"@polkadot/types": "^0.32.10",
|
||||
"@polkadot/util": "^0.33.5"
|
||||
"@polkadot/util": "^0.33.6"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,9 +30,9 @@
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/type-storage#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.1.5",
|
||||
"@polkadot/keyring": "^0.33.5",
|
||||
"@polkadot/keyring": "^0.33.6",
|
||||
"@polkadot/types": "^0.32.10",
|
||||
"@polkadot/util": "^0.33.5",
|
||||
"@polkadot/util-crypto": "^0.33.5"
|
||||
"@polkadot/util": "^0.33.6",
|
||||
"@polkadot/util-crypto": "^0.33.6"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
import { StorageFunction } from '@polkadot/types/StorageKey';
|
||||
|
||||
import BN from 'bn.js';
|
||||
import * as substrate from './substrate';
|
||||
|
||||
type Substrate = keyof typeof substrate;
|
||||
@@ -30,7 +30,7 @@
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/types#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.1.5",
|
||||
"@polkadot/keyring": "^0.33.5",
|
||||
"@polkadot/util": "^0.33.5"
|
||||
"@polkadot/keyring": "^0.33.6",
|
||||
"@polkadot/util": "^0.33.6"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,13 +15,13 @@ export type AnyU8a = Uint8Array | Array<number> | string;
|
||||
|
||||
export interface Codec {
|
||||
encodedLength: number;
|
||||
toHex(): string
|
||||
toJSON(): any;
|
||||
toString(): string;
|
||||
toU8a(isBare?: boolean): Uint8Array;
|
||||
toHex (): string;
|
||||
toJSON (): any;
|
||||
toString (): string;
|
||||
toU8a (isBare?: boolean): Uint8Array;
|
||||
}
|
||||
|
||||
export type CodecTo = 'toHex' | 'toJSON' | 'toString' | 'toU8a'
|
||||
export type CodecTo = 'toHex' | 'toJSON' | 'toString' | 'toU8a';
|
||||
|
||||
export type CodecTypes = keyof typeof Classes;
|
||||
|
||||
Reference in New Issue
Block a user