aboutsummaryrefslogtreecommitdiffstats
path: root/packages/typescript-typings
diff options
context:
space:
mode:
authorJacob Evans <dekz@dekz.net>2018-07-02 09:21:16 +0800
committerGitHub <noreply@github.com>2018-07-02 09:21:16 +0800
commitad570b8ae162a213b4b88c417ecd64d4661df18b (patch)
treed9acfb9e2459c4dfcac191061fefebe015ff5771 /packages/typescript-typings
parentb9165c03af40983d885af2b18e729f11746de91d (diff)
parentb9b00e10d39c3c84bc72892ef37f1313e904414d (diff)
downloaddexon-sol-tools-ad570b8ae162a213b4b88c417ecd64d4661df18b.tar.gz
dexon-sol-tools-ad570b8ae162a213b4b88c417ecd64d4661df18b.tar.zst
dexon-sol-tools-ad570b8ae162a213b4b88c417ecd64d4661df18b.zip
Merge branch 'v2-prototype' into eth-lightwallet-subprovider-final
Diffstat (limited to 'packages/typescript-typings')
-rw-r--r--packages/typescript-typings/CHANGELOG.json14
-rw-r--r--packages/typescript-typings/package.json2
-rw-r--r--packages/typescript-typings/types/@ledgerhq/index.d.ts45
-rw-r--r--packages/typescript-typings/types/ethers/index.d.ts3
-rw-r--r--packages/typescript-typings/types/ganache-core/index.d.ts2
-rw-r--r--packages/typescript-typings/types/web3-provider-engine/index.d.ts10
6 files changed, 73 insertions, 3 deletions
diff --git a/packages/typescript-typings/CHANGELOG.json b/packages/typescript-typings/CHANGELOG.json
index e5b9edc70..2e4b8dfdf 100644
--- a/packages/typescript-typings/CHANGELOG.json
+++ b/packages/typescript-typings/CHANGELOG.json
@@ -3,7 +3,19 @@
"version": "0.4.2",
"changes": [
{
- "note": "Add types for `eth-lightwallet`"
+ "note": "Add types for `eth-lightwallet`",
+ "pr": 775
+ },
+ "note": "Improve 'web3-provider-engine' typings",
+ "pr": 768
+ },
+ {
+ "note": "Additional error type for `ethers.js`",
+ "pr": 763
+ },
+ {
+ "note": "Add @ledgerhq typings",
+ "pr": 770
}
]
},
diff --git a/packages/typescript-typings/package.json b/packages/typescript-typings/package.json
index f10d35666..3ba7c10ba 100644
--- a/packages/typescript-typings/package.json
+++ b/packages/typescript-typings/package.json
@@ -1,6 +1,6 @@
{
"name": "@0xproject/typescript-typings",
- "version": "0.4.1",
+ "version": "0.4.2",
"engines": {
"node": ">=6.12"
},
diff --git a/packages/typescript-typings/types/@ledgerhq/index.d.ts b/packages/typescript-typings/types/@ledgerhq/index.d.ts
new file mode 100644
index 000000000..724dacb76
--- /dev/null
+++ b/packages/typescript-typings/types/@ledgerhq/index.d.ts
@@ -0,0 +1,45 @@
+// Ledgerco declarations
+interface ECSignatureString {
+ v: string;
+ r: string;
+ s: string;
+}
+interface ECSignature {
+ v: number;
+ r: string;
+ s: string;
+}
+
+interface LedgerTransport {
+ close(): Promise<void>;
+}
+
+declare module '@ledgerhq/hw-app-eth' {
+ class Eth {
+ public transport: LedgerTransport;
+ constructor(transport: LedgerTransport);
+ public getAddress(
+ path: string,
+ boolDisplay?: boolean,
+ boolChaincode?: boolean,
+ ): Promise<{ publicKey: string; address: string; chainCode: string }>;
+ public signTransaction(path: string, rawTxHex: string): Promise<ECSignatureString>;
+ public getAppConfiguration(): Promise<{ arbitraryDataEnabled: number; version: string }>;
+ public signPersonalMessage(path: string, messageHex: string): Promise<ECSignature>;
+ }
+ export default Eth;
+}
+
+declare module '@ledgerhq/hw-transport-u2f' {
+ export default class TransportU2F implements LedgerTransport {
+ public static create(): Promise<LedgerTransport>;
+ public close(): Promise<void>;
+ }
+}
+
+declare module '@ledgerhq/hw-transport-node-hid' {
+ export default class TransportNodeHid implements LedgerTransport {
+ public static create(): Promise<LedgerTransport>;
+ public close(): Promise<void>;
+ }
+}
diff --git a/packages/typescript-typings/types/ethers/index.d.ts b/packages/typescript-typings/types/ethers/index.d.ts
index d40428a9b..f869196e0 100644
--- a/packages/typescript-typings/types/ethers/index.d.ts
+++ b/packages/typescript-typings/types/ethers/index.d.ts
@@ -31,4 +31,7 @@ declare module 'ethers' {
public static getDeployTransaction(bytecode: string, abi: any, ...args: any[]): Partial<TxData>;
constructor(address: string, abi: any, provider: any);
}
+ const enum errors {
+ INVALID_ARGUMENT = 'INVALID_ARGUMENT',
+ }
}
diff --git a/packages/typescript-typings/types/ganache-core/index.d.ts b/packages/typescript-typings/types/ganache-core/index.d.ts
index 84635038f..c07e6a78e 100644
--- a/packages/typescript-typings/types/ganache-core/index.d.ts
+++ b/packages/typescript-typings/types/ganache-core/index.d.ts
@@ -7,7 +7,9 @@ declare module 'ganache-core' {
};
port?: number;
network_id?: number;
+ networkId?: number;
mnemonic?: string;
+ gasLimit?: number;
}
// tslint:disable-next-line:completed-docs
export function provider(opts: GanacheOpts): Provider;
diff --git a/packages/typescript-typings/types/web3-provider-engine/index.d.ts b/packages/typescript-typings/types/web3-provider-engine/index.d.ts
index 1733f2731..72ef434a7 100644
--- a/packages/typescript-typings/types/web3-provider-engine/index.d.ts
+++ b/packages/typescript-typings/types/web3-provider-engine/index.d.ts
@@ -1,6 +1,12 @@
declare module 'web3-provider-engine' {
import { Provider, JSONRPCRequestPayload, JSONRPCResponsePayload } from 'ethereum-types';
+ interface Web3ProviderEngineOptions {
+ pollingInterval?: number;
+ blockTracker?: any;
+ blockTrackerProvider?: any;
+ }
class Web3ProviderEngine implements Provider {
+ constructor(options?: Web3ProviderEngineOptions);
public on(event: string, handler: () => void): void;
public send(payload: JSONRPCRequestPayload): void;
public sendAsync(
@@ -8,7 +14,9 @@ declare module 'web3-provider-engine' {
callback: (error: null | Error, response: JSONRPCResponsePayload) => void,
): void;
public addProvider(provider: any): void;
- public start(): void;
+ // start block polling
+ public start(callback?: () => void): void;
+ // stop block polling
public stop(): void;
}
export = Web3ProviderEngine;