Fixed internal exports to use types.

This commit is contained in:
Richard Moore 2018-07-16 00:09:13 -04:00
parent 8d6fa3dc93
commit b61643fecb
No known key found for this signature in database
GPG Key ID: 525F70A6FCABC295
12 changed files with 45 additions and 14 deletions

View File

@ -1,6 +1,6 @@
'use strict';
import { EventDescription, Interface } from './interface';
import { Interface } from './interface';
import { defaultAbiCoder, formatSignature, ParamType, parseSignature } from '../utils/abi-coder';
import { getAddress, getContractAddress } from '../utils/address';
@ -10,8 +10,8 @@ import { defineReadOnly, jsonCopy, shallowCopy } from '../utils/properties';
import { poll } from '../utils/web';
import { MinimalProvider, Signer } from '../utils/types';
import { EventFilter, Event, Listener, Log, TransactionRequest, TransactionResponse } from '../utils/types';
export { EventFilter, Event, Listener, Log, TransactionRequest, TransactionResponse };
import { EventDescription, EventFilter, Listener, Log, TransactionRequest, TransactionResponse } from '../utils/types';
//export { EventFilter, Event, Listener, Log, TransactionRequest, TransactionResponse };
import * as errors from '../utils/errors';

View File

@ -8,8 +8,9 @@ export {
Interface
}
/*
export default {
Contract,
Interface
}
*/

View File

@ -11,7 +11,7 @@ import { keccak256 } from '../utils/keccak256';
import { defineReadOnly, defineFrozen } from '../utils/properties';
import { DeployDescription, EventDescription, FunctionDescription, Indexed } from '../utils/types';
export { DeployDescription, EventDescription, FunctionDescription, Indexed };
//export { DeployDescription, EventDescription, FunctionDescription, Indexed };
import * as errors from '../utils/errors';

View File

@ -6,13 +6,15 @@ import {} from './utils/shims';
import { Contract, Interface } from './contracts';
import * as providers from './providers';
import * as errors from './utils/errors';
import { getNetwork } from './providers/networks';
import * as types from './utils/types';
import * as utils from './utils';
import { HDNode, SigningKey, Wallet } from './wallet';
import * as wordlists from './wordlists';
import * as types from './utils/types';
import * as errors from './utils/errors';
import { version } from './_version';
const constants = utils.constants;

View File

@ -33,7 +33,7 @@ export {
JsonRpcSigner
};
/*
export default {
Provider,
getDefaultProvider,
@ -49,3 +49,4 @@ export default {
JsonRpcSigner
};
*/

View File

@ -14,7 +14,7 @@ import { poll } from '../utils/web';
import { MinimalProvider } from '../utils/types';
import { Block, BlockTag, EventType, Filter, Listener, Log, TransactionReceipt, TransactionRequest, TransactionResponse } from '../utils/types';
export { Block, BlockTag, EventType, Filter, Listener, Log, TransactionReceipt, TransactionRequest, TransactionResponse };
//export { Block, BlockTag, EventType, Filter, Listener, Log, TransactionReceipt, TransactionRequest, TransactionResponse };
import * as errors from '../utils/errors';

View File

@ -5,6 +5,7 @@ import { JsonRpcProvider } from './json-rpc-provider';
import { defineReadOnly } from '../utils/properties';
import { AsyncProvider } from '../utils/types';
import * as errors from '../utils/errors';
/*
@ -12,7 +13,6 @@ import * as errors from '../utils/errors';
utils.defineProperty(Web3Signer, 'onchange', {
});
*/
export type AsyncProvider = {
isMetaMask: boolean;
@ -21,6 +21,8 @@ export type AsyncProvider = {
sendAsync: (request: any, callback: (error: any, response: any) => void) => void
}
*/
export class Web3Provider extends JsonRpcProvider {
readonly _web3Provider: AsyncProvider;

View File

@ -110,7 +110,7 @@ export {
errors
}
/*
export default {
AbiCoder,
defaultAbiCoder,
@ -180,3 +180,4 @@ export default {
errors
}
*/

View File

@ -345,6 +345,12 @@ export abstract class MinimalProvider {
abstract waitForTransaction(transactionHash: string, timeout?: number): Promise<TransactionReceipt>;
}
export type AsyncProvider = {
isMetaMask: boolean;
host?: string;
path?: string;
sendAsync: (request: any, callback: (error: any, response: any) => void) => void
}
///////////////////////////////
// Signer
@ -381,3 +387,17 @@ export abstract class Signer {
abstract sendTransaction(transaction: TransactionRequest): Promise<TransactionResponse>;
}
///////////////////////////////
// Wordlist (BIP39 mnemonic)
export interface Wordlist {
locale: string;
getWord(index: number): string;
getWordIndex(word: string): number;
split(mnemonic: string): Array<string>;
join(words: Array<string>): string;
}

View File

@ -7,7 +7,9 @@
// For additional word lists, please see /src.tc/wordlists/
import { langEn } from '../wordlists/lang-en';
import { Wordlist } from '../wordlists/wordlist';
// Automatically register English?
//import { register } from '../wordlists/wordlist';
//register(langEn);
import { arrayify, Arrayish, hexlify } from '../utils/bytes';
import { bigNumberify } from '../utils/bignumber';
@ -18,6 +20,8 @@ import { defineReadOnly } from '../utils/properties';
import { KeyPair, N } from '../utils/secp256k1';
import { sha256 } from '../utils/sha2';
import { Wordlist } from '../utils/types';
import * as errors from '../utils/errors';
// "Bitcoin seed"

View File

@ -7,5 +7,5 @@ import { SigningKey } from './signing-key';
export { HDNode, SigningKey, Wallet };
export default { HDNode, SigningKey, Wallet };
//export default { HDNode, SigningKey, Wallet };

View File

@ -17,7 +17,7 @@ import { recoverAddress } from '../utils/secp256k1';
import { serialize as serializeTransaction } from '../utils/transaction';
import { BlockTag, ProgressCallback, Signer, TransactionRequest, TransactionResponse } from '../utils/types';
export { BlockTag, ProgressCallback, Signer, TransactionRequest, TransactionResponse };
//export { BlockTag, ProgressCallback, Signer, TransactionRequest, TransactionResponse };
import * as errors from '../utils/errors';