2019-05-15 01:25:46 +03:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
import { Contract, ContractFactory } from "@ethersproject/contracts";
|
|
|
|
|
|
|
|
import { BigNumber, FixedNumber } from "@ethersproject/bignumber";
|
|
|
|
|
|
|
|
import { Signer, VoidSigner } from "@ethersproject/abstract-signer";
|
|
|
|
import { Wallet } from "@ethersproject/wallet";
|
|
|
|
|
|
|
|
import * as constants from "@ethersproject/constants";
|
|
|
|
import * as errors from "@ethersproject/errors";
|
|
|
|
|
|
|
|
import * as providers from "@ethersproject/providers";
|
2019-06-12 16:35:44 +03:00
|
|
|
import { Wordlist, wordlists} from "@ethersproject/wordlists";
|
2019-05-15 01:25:46 +03:00
|
|
|
|
|
|
|
import * as utils from "./utils";
|
|
|
|
|
|
|
|
////////////////////////
|
|
|
|
// Types
|
|
|
|
|
|
|
|
import { BigNumberish } from "@ethersproject/bignumber";
|
|
|
|
import { Bytes, BytesLike, Signature } from "@ethersproject/bytes";
|
|
|
|
import { Transaction, UnsignedTransaction } from "@ethersproject/transactions";
|
|
|
|
|
|
|
|
|
|
|
|
////////////////////////
|
|
|
|
// Compile-Time Constants
|
|
|
|
|
|
|
|
// This is empty in node, and used by browserify to inject extra goodies
|
|
|
|
import { platform } from "./platform";
|
|
|
|
|
|
|
|
// This is generated by "npm run dist"
|
2019-06-12 16:35:44 +03:00
|
|
|
import { version } from "./_version";
|
2019-05-15 01:25:46 +03:00
|
|
|
|
|
|
|
|
|
|
|
////////////////////////
|
|
|
|
// Types
|
|
|
|
|
|
|
|
import {
|
|
|
|
ContractFunction,
|
|
|
|
ContractReceipt,
|
|
|
|
ContractTransaction,
|
|
|
|
|
|
|
|
Event,
|
|
|
|
EventFilter,
|
|
|
|
|
|
|
|
Overrides,
|
|
|
|
PayableOverrides,
|
|
|
|
CallOverrides,
|
|
|
|
|
|
|
|
ContractInterface
|
|
|
|
} from "@ethersproject/contracts";
|
|
|
|
|
|
|
|
|
|
|
|
////////////////////////
|
|
|
|
// Helper Functions
|
|
|
|
|
|
|
|
function getDefaultProvider(network?: providers.Network | string, options?: any): providers.BaseProvider {
|
|
|
|
if (network == null) { network = "homestead"; }
|
|
|
|
let n = providers.getNetwork(network);
|
|
|
|
if (!n || !n._defaultProvider) {
|
|
|
|
errors.throwError("unsupported getDefaultProvider network", errors.NETWORK_ERROR, {
|
|
|
|
operation: "getDefaultProvider",
|
|
|
|
network: network
|
|
|
|
});
|
|
|
|
}
|
|
|
|
return n._defaultProvider(providers, options);
|
|
|
|
}
|
|
|
|
|
|
|
|
////////////////////////
|
|
|
|
// Exports
|
|
|
|
|
|
|
|
export {
|
|
|
|
version,
|
|
|
|
|
|
|
|
Signer,
|
|
|
|
|
|
|
|
Wallet,
|
|
|
|
VoidSigner,
|
|
|
|
|
|
|
|
getDefaultProvider,
|
|
|
|
providers,
|
|
|
|
|
|
|
|
Contract,
|
|
|
|
ContractFactory,
|
|
|
|
|
|
|
|
BigNumber,
|
|
|
|
FixedNumber,
|
|
|
|
|
|
|
|
constants,
|
|
|
|
errors,
|
|
|
|
|
|
|
|
utils,
|
|
|
|
|
|
|
|
wordlists,
|
|
|
|
|
|
|
|
|
|
|
|
////////////////////////
|
|
|
|
// Compile-Time Constants
|
|
|
|
|
|
|
|
platform,
|
|
|
|
// version,
|
|
|
|
|
|
|
|
|
|
|
|
////////////////////////
|
|
|
|
// Types
|
|
|
|
|
|
|
|
ContractFunction,
|
|
|
|
ContractReceipt,
|
|
|
|
ContractTransaction,
|
|
|
|
Event,
|
|
|
|
EventFilter,
|
|
|
|
|
|
|
|
Overrides,
|
|
|
|
PayableOverrides,
|
|
|
|
CallOverrides,
|
|
|
|
|
|
|
|
ContractInterface,
|
|
|
|
|
|
|
|
BigNumberish,
|
|
|
|
|
|
|
|
Bytes,
|
|
|
|
BytesLike,
|
|
|
|
|
|
|
|
Signature,
|
|
|
|
|
|
|
|
Transaction,
|
|
|
|
UnsignedTransaction,
|
|
|
|
|
|
|
|
Wordlist
|
|
|
|
};
|
|
|
|
|