2018-07-16 03:27:49 -04:00
|
|
|
'use strict';
|
|
|
|
|
2018-09-26 15:47:09 -04:00
|
|
|
import { Contract, ContractFactory, VoidSigner } from './contract';
|
2018-08-01 17:35:23 -04:00
|
|
|
|
2018-09-24 15:55:17 -04:00
|
|
|
import { Signer } from './abstract-signer';
|
|
|
|
import { Wallet } from './wallet';
|
2018-07-30 18:59:52 -04:00
|
|
|
|
2018-09-24 15:55:17 -04:00
|
|
|
import * as constants from './constants';
|
|
|
|
import * as errors from './errors';
|
2018-08-13 16:58:19 +01:00
|
|
|
|
2018-09-24 15:55:17 -04:00
|
|
|
import * as providers from './providers';
|
2018-07-30 18:59:52 -04:00
|
|
|
import * as utils from './utils';
|
2018-09-24 15:55:17 -04:00
|
|
|
import * as wordlists from './wordlists';
|
2018-07-16 03:27:49 -04:00
|
|
|
|
|
|
|
|
2018-09-24 15:55:17 -04:00
|
|
|
////////////////////////
|
|
|
|
// Compile-Time Constants
|
2018-07-16 03:27:49 -04:00
|
|
|
|
2018-08-01 17:35:23 -04:00
|
|
|
// This is empty in node, and used by browserify to inject extra goodies
|
|
|
|
import { platform } from './utils/shims';
|
|
|
|
|
|
|
|
// This is generated by "npm run dist"
|
2018-07-16 03:27:49 -04:00
|
|
|
import { version } from './_version';
|
|
|
|
|
2018-09-24 15:55:17 -04:00
|
|
|
|
|
|
|
////////////////////////
|
|
|
|
// Types
|
|
|
|
|
2018-10-04 19:54:15 -04:00
|
|
|
import { ContractFunction, ContractTransaction, Event, EventFilter } from './contract';
|
2018-09-24 15:55:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
////////////////////////
|
|
|
|
// Helper Functions
|
|
|
|
|
|
|
|
function getDefaultProvider(network?: utils.Network | string): providers.BaseProvider {
|
2018-11-21 16:23:44 -05:00
|
|
|
if (network == null) { network = 'homestead'; }
|
|
|
|
let n = utils.getNetwork(network);
|
|
|
|
if (!n || !n._defaultProvider) {
|
|
|
|
errors.throwError('unsupported getDefaultProvider network', errors.UNSUPPORTED_OPERATION, {
|
|
|
|
operation: 'getDefaultProvider',
|
|
|
|
network: network
|
|
|
|
});
|
|
|
|
}
|
2018-11-20 15:41:12 -05:00
|
|
|
return n._defaultProvider(providers);
|
2018-08-01 17:35:23 -04:00
|
|
|
}
|
|
|
|
|
2018-09-24 15:55:17 -04:00
|
|
|
|
|
|
|
////////////////////////
|
|
|
|
// Exports
|
|
|
|
|
2018-07-16 03:27:49 -04:00
|
|
|
export {
|
2018-09-24 15:55:17 -04:00
|
|
|
Signer,
|
|
|
|
|
2018-07-16 03:27:49 -04:00
|
|
|
Wallet,
|
2018-09-04 10:28:26 -04:00
|
|
|
VoidSigner,
|
2018-07-16 03:27:49 -04:00
|
|
|
|
2018-07-30 18:59:52 -04:00
|
|
|
getDefaultProvider,
|
2018-08-01 17:35:23 -04:00
|
|
|
providers,
|
2018-07-16 03:27:49 -04:00
|
|
|
|
2018-09-24 15:55:17 -04:00
|
|
|
Contract,
|
2018-09-26 15:47:09 -04:00
|
|
|
ContractFactory,
|
2018-09-24 15:55:17 -04:00
|
|
|
|
2018-07-16 03:27:49 -04:00
|
|
|
constants,
|
2018-09-24 15:55:17 -04:00
|
|
|
errors,
|
2018-07-16 03:27:49 -04:00
|
|
|
|
2018-09-24 15:55:17 -04:00
|
|
|
utils,
|
2018-08-01 17:35:23 -04:00
|
|
|
|
2018-07-16 03:27:49 -04:00
|
|
|
wordlists,
|
|
|
|
|
2018-09-24 15:55:17 -04:00
|
|
|
////////////////////////
|
|
|
|
// Compile-Time Constants
|
|
|
|
|
2018-07-17 02:05:24 -04:00
|
|
|
platform,
|
2018-09-24 15:55:17 -04:00
|
|
|
version,
|
|
|
|
|
|
|
|
////////////////////////
|
|
|
|
// Types
|
|
|
|
|
|
|
|
ContractFunction,
|
2018-10-04 19:54:15 -04:00
|
|
|
ContractTransaction,
|
2018-09-24 15:55:17 -04:00
|
|
|
Event,
|
|
|
|
EventFilter
|
2018-07-16 03:27:49 -04:00
|
|
|
};
|
|
|
|
|