Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
BaseProvider.getNetwork = function (network) {
return networks_1.getNetwork((network == null) ? "homestead" : network);
};
BaseProvider.prototype._getInternalBlockNumber = function (maxAge) {
function getDefaultProvider(network, options) {
if (network == null) {
network = "homestead";
}
const n = getNetwork(network);
if (!n || !n._defaultProvider) {
logger.throwError("unsupported getDefaultProvider network", Logger.errors.NETWORK_ERROR, {
operation: "getDefaultProvider",
network: network
});
}
return n._defaultProvider({
FallbackProvider,
AlchemyProvider,
CloudflareProvider,
EtherscanProvider,
InfuraProvider,
JsonRpcProvider,
NodesmithProvider,
Web3Provider,
IpcProvider,
static getNetwork(network) {
return getNetwork((network == null) ? "homestead" : network);
}
_getInternalBlockNumber(maxAge) {
function getDefaultProvider(network, options) {
if (network == null) {
network = "homestead";
}
var n = networks_1.getNetwork(network);
if (!n || !n._defaultProvider) {
logger.throwError("unsupported getDefaultProvider network", logger_1.Logger.errors.NETWORK_ERROR, {
operation: "getDefaultProvider",
network: network
});
}
return n._defaultProvider({
FallbackProvider: fallback_provider_1.FallbackProvider,
AlchemyProvider: alchemy_provider_1.AlchemyProvider,
CloudflareProvider: cloudflare_provider_1.CloudflareProvider,
EtherscanProvider: etherscan_provider_1.EtherscanProvider,
InfuraProvider: infura_provider_1.InfuraProvider,
JsonRpcProvider: json_rpc_provider_1.JsonRpcProvider,
NodesmithProvider: nodesmith_provider_1.NodesmithProvider,
Web3Provider: web3_provider_1.Web3Provider,
IpcProvider: ipc_provider_1.IpcProvider,
function getDefaultProvider(network?: Network | string, options?: any): BaseProvider {
if (network == null) { network = "homestead"; }
const n = getNetwork(network);
if (!n || !n._defaultProvider) {
logger.throwError("unsupported getDefaultProvider network", Logger.errors.NETWORK_ERROR, {
operation: "getDefaultProvider",
network: network
});
}
return n._defaultProvider({
FallbackProvider,
AlchemyProvider,
CloudflareProvider,
EtherscanProvider,
InfuraProvider,
JsonRpcProvider,
NodesmithProvider,