38 lines
1.4 KiB
JavaScript
38 lines
1.4 KiB
JavaScript
"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 providers from "@ethersproject/providers";
|
|
import { Wordlist, wordlists } from "@ethersproject/wordlists";
|
|
import * as utils from "./utils";
|
|
import { Logger } from "@ethersproject/logger";
|
|
const errors = Logger.errors;
|
|
////////////////////////
|
|
// Compile-Time Constants
|
|
// This is generated by "npm run dist"
|
|
import { version } from "./_version";
|
|
const logger = new Logger(version);
|
|
////////////////////////
|
|
// Helper Functions
|
|
function getDefaultProvider(network, options) {
|
|
if (network == null) {
|
|
network = "homestead";
|
|
}
|
|
let n = providers.getNetwork(network);
|
|
if (!n || !n._defaultProvider) {
|
|
logger.throwError("unsupported getDefaultProvider network", Logger.errors.NETWORK_ERROR, {
|
|
operation: "getDefaultProvider",
|
|
network: network
|
|
});
|
|
}
|
|
return n._defaultProvider(providers, options);
|
|
}
|
|
////////////////////////
|
|
// Exports
|
|
export { Signer, Wallet, VoidSigner, getDefaultProvider, providers, Contract, ContractFactory, BigNumber, FixedNumber, constants, errors, logger, utils, wordlists,
|
|
////////////////////////
|
|
// Compile-Time Constants
|
|
version, Wordlist };
|