Merge branch 'v2-prototype' into eth-lightwallet-subprovider-final

This commit is contained in:
Jacob Evans
2018-07-02 11:21:16 +10:00
committed by GitHub
282 changed files with 9352 additions and 8812 deletions

View File

@@ -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
}
]
},

View File

@@ -1,6 +1,6 @@
{
"name": "@0xproject/typescript-typings",
"version": "0.4.1",
"version": "0.4.2",
"engines": {
"node": ">=6.12"
},

View File

@@ -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>;
}
}

View File

@@ -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',
}
}

View File

@@ -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;

View File

@@ -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;