Merge branch 'main' into v6.7.0-progress

This commit is contained in:
Richard Moore 2023-07-29 02:37:03 -04:00
commit d32f81b3c3
101 changed files with 995 additions and 597 deletions

@ -3,16 +3,43 @@ Change Log
This change log is maintained by `src.ts/_admin/update-changelog.ts` but may also be manually updated.
ethers/v6.7.0 (2023-07-29 02:33)
--------------------------------
- Added new exports for FallbackProviderOptions and FetchUrlFeeDataNetworkPlugin ([#2828](https://github.com/ethers-io/ethers.js/issues/2828), [#4160](https://github.com/ethers-io/ethers.js/issues/4160); [b1dbbb0](https://github.com/ethers-io/ethers.js/commit/b1dbbb0de3f10a3d9e12d6a84ad5c52bea25c7f6)).
- Allow overriding pollingInterval in JsonRpcProvider constructor (via discord) ([f42f258](https://github.com/ethers-io/ethers.js/commit/f42f258beb305a06e563ad16522f095a72da32eb)).
- Fixed FallbackProvider priority sorting ([#4150](https://github.com/ethers-io/ethers.js/issues/4150); [78538eb](https://github.com/ethers-io/ethers.js/commit/78538eb100addd135d29e60c9fa4fed3946278fa)).
- Added linea network to InfuraProvider and Network ([#4184](https://github.com/ethers-io/ethers.js/issues/4184), [#4190](https://github.com/ethers-io/ethers.js/issues/4190); [d3e5e2c](https://github.com/ethers-io/ethers.js/commit/d3e5e2c45b28c377f306091acfc024e30c49ef20)).
- Added whitelist support to getDefaultProvider ([82bb936](https://github.com/ethers-io/ethers.js/commit/82bb936542e29c6441ac8dc2d3ebbdd4edb708ee)).
- Add Polygon RPC endpoints to the default provider ([#3689](https://github.com/ethers-io/ethers.js/issues/3689); [23704a9](https://github.com/ethers-io/ethers.js/commit/23704a9c44d5857817e138fb19d44ce2103ca005)).
- Added customizable quorum to FallbackProvider ([#4160](https://github.com/ethers-io/ethers.js/issues/4160); [8f0a509](https://github.com/ethers-io/ethers.js/commit/8f0a50921a12a866addcf5b0fabc576bfc287689)).
- Added basic Gas Station support via a NetworkPlugin ([#2828](https://github.com/ethers-io/ethers.js/issues/2828); [229145d](https://github.com/ethers-io/ethers.js/commit/229145ddf566a962517588eaeed155734c7d4598)).
- Add BNB URLs to EtherscanProvider networks ([ec39abe](https://github.com/ethers-io/ethers.js/commit/ec39abe067259fad4ea8607a6c5aece61890eb41)).
- Added tests for JSON format ([#4248](https://github.com/ethers-io/ethers.js/issues/4248); [ba36079](https://github.com/ethers-io/ethers.js/commit/ba36079a285706694532ce726568c4c447acad47)).
- Use empty string for unnamed parameters in JSON output instead of undefined ([#4248](https://github.com/ethers-io/ethers.js/issues/4248); [8c2652c](https://github.com/ethers-io/ethers.js/commit/8c2652c8cb4d054207d89688d30930869d9d3f8b)).
- Return undefined for Contract properties that do not exist instead of throwing an error ([#4266](https://github.com/ethers-io/ethers.js/issues/4266); [5bf7b34](https://github.com/ethers-io/ethers.js/commit/5bf7b3494ed62952fc387b4368a0bdc86dfe163e)).
ethers/v6.7.0 (2023-07-24 17:47)
--------------------------------
- Use empty string for unnamed parameters in JSON output instead of undefined ([#4248](https://github.com/ethers-io/ethers.js/issues/4248); [8c2652c](https://github.com/ethers-io/ethers.js/commit/8c2652c8cb4d054207d89688d30930869d9d3f8b), [ba36079](https://github.com/ethers-io/ethers.js/commit/ba36079a285706694532ce726568c4c447acad47)).
- Return undefined for Contract properties that do not exist instead of throwing an error ([#4266](https://github.com/ethers-io/ethers.js/issues/4266); [5bf7b34](https://github.com/ethers-io/ethers.js/commit/5bf7b3494ed62952fc387b4368a0bdc86dfe163e)).
ethers/v6.6.7 (2023-07-28 14:50)
--------------------------------
- Prevent malformed logs from preventing other logs being decoded ([#4275](https://github.com/ethers-io/ethers.js/issues/4275); [0dca645](https://github.com/ethers-io/ethers.js/commit/0dca645632d73488bf6ad460e0d779361a537bbe)).
- Allow visibility on human-readable constructors ([#4278](https://github.com/ethers-io/ethers.js/issues/4278); [3a52201](https://github.com/ethers-io/ethers.js/commit/3a52201fe2ba68a00105cca2c0901da5ffa18d6b)).
ethers/v6.6.6 (2023-07-28 01:14)
--------------------------------
- Better error message when passing invalid overrides object into a contract deployment ([#4182](https://github.com/ethers-io/ethers.js/issues/4182); [aa2ea3d](https://github.com/ethers-io/ethers.js/commit/aa2ea3d5296956fd0d40b83888e1ca053bb250ee)).
ethers/v6.6.5 (2023-07-24 00:04)
--------------------------------
- Reflect symbols in the Contract Proxy to target ([#4048](https://github.com/ethers-io/ethers.js/issues/4048); [ac2f5e5](https://github.com/ethers-io/ethers.js/commit/ac2f5e563b8ec0e91a931470eb6ea58b0c01fb3d)).
- Reflect symbols in the Contract Proxy to target ([#4084](https://github.com/ethers-io/ethers.js/issues/4048); [ac2f5e5](https://github.com/ethers-io/ethers.js/commit/ac2f5e563b8ec0e91a931470eb6ea58b0c01fb3d)).
- Allow arrays of address for indexed filter topics ([#4259](https://github.com/ethers-io/ethers.js/issues/4259); [93af87c](https://github.com/ethers-io/ethers.js/commit/93af87c447eeb77090e29bd940612603b3f74026)).
- Fixed filter encoding for bytesX ([#4244](https://github.com/ethers-io/ethers.js/issues/4244); [fa3a883](https://github.com/ethers-io/ethers.js/commit/fa3a883ff7c88611ce766f58bdd4b8ac90814470)).
- Fix JSON formatting for tuple arrays ([#4237](https://github.com/ethers-io/ethers.js/issues/4237); [a8bc49b](https://github.com/ethers-io/ethers.js/commit/a8bc49bdcf07a51b35f38cf209db27e116cc1a59)).

336
dist/ethers.js vendored

@ -2505,7 +2505,7 @@ function formatUnits(value, unit) {
* %%unit%% decimal places. The %%unit%% may the number of decimal places
* or the name of a unit (e.g. ``"gwei"`` for 9 decimal places).
*/
function parseUnits(value, unit) {
function parseUnits$1(value, unit) {
assertArgument(typeof (value) === "string", "value must be a string", "value", value);
let decimals = 18;
if (typeof (unit) === "string") {
@ -2529,7 +2529,7 @@ function formatEther(wei) {
* decimal places.
*/
function parseEther(ether) {
return parseUnits(ether, 18);
return parseUnits$1(ether, 18);
}
/**
@ -10038,6 +10038,8 @@ function setify(items) {
items.forEach((k) => result.add(k));
return Object.freeze(result);
}
const _kwVisibDeploy = "external public payable";
const KwVisibDeploy = setify(_kwVisibDeploy.split(" "));
// Visibility Keywords
const _kwVisib = "constant external internal payable private public pure view";
const KwVisib = setify(_kwVisib.split(" "));
@ -11041,7 +11043,7 @@ class ConstructorFragment extends Fragment {
else if (obj instanceof TokenString) {
consumeKeywords(obj, setify(["constructor"]));
const inputs = consumeParams(obj);
const payable = !!consumeKeywords(obj, setify(["payable"])).has("payable");
const payable = !!consumeKeywords(obj, KwVisibDeploy).has("payable");
const gas = consumeGas(obj);
consumeEoi(obj);
return new ConstructorFragment(_guard$2, "constructor", inputs, payable, gas);
@ -13901,11 +13903,12 @@ class ContractTransactionReceipt extends TransactionReceipt {
return super.logs.map((log) => {
const fragment = log.topics.length ? this.#iface.getEvent(log.topics[0]) : null;
if (fragment) {
return new EventLog(log, this.#iface, fragment);
}
else {
return log;
try {
return new EventLog(log, this.#iface, fragment);
}
catch (error) { }
}
return log;
});
}
}
@ -14076,8 +14079,11 @@ function getProvider(value) {
* @_ignore:
*/
async function copyOverrides(arg, allowed) {
// Make sure the overrides passed in are a valid overrides object
const _overrides = Typed.dereference(arg, "overrides");
assertArgument(typeof (_overrides) === "object", "invalid overrides parameter", "overrides", arg);
// Create a shallow copy (we'll deep-ify anything needed during normalizing)
const overrides = copyRequest(Typed.dereference(arg, "overrides"));
const overrides = copyRequest(_overrides);
assertArgument(overrides.to == null || (allowed || []).indexOf("to") >= 0, "cannot override to", "overrides.to", overrides.to);
assertArgument(overrides.data == null || (allowed || []).indexOf("data") >= 0, "cannot override data", "overrides.data", overrides.data);
// Resolve any from
@ -15900,6 +15906,19 @@ class FeeDataNetworkPlugin extends NetworkPlugin {
return new FeeDataNetworkPlugin(this.#feeDataFunc);
}
}
class FetchUrlFeeDataNetworkPlugin extends NetworkPlugin {
#url;
#processFunc;
get url() { return this.#url; }
get processFunc() { return this.#processFunc; }
constructor(url, processFunc) {
super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");
this.#url = url;
this.#processFunc = processFunc;
}
// We are immutable, so we can serve as our own clone
clone() { return this; }
}
/*
export class CustomBlockNetworkPlugin extends NetworkPlugin {
readonly #blockFunc: (provider: Provider, block: BlockParams<string>) => Block<string>;
@ -15948,41 +15967,7 @@ export class LayerOneConnectionPlugin extends NetworkPlugin {
}
}
*/
/* * * *
export class PriceOraclePlugin extends NetworkPlugin {
readonly address!: string;
constructor(address: string) {
super("org.ethers.plugins.price-oracle");
defineProperties<PriceOraclePlugin>(this, { address });
}
clone(): PriceOraclePlugin {
return new PriceOraclePlugin(this.address);
}
}
*/
// Networks or clients with a higher need for security (such as clients
// that may automatically make CCIP requests without user interaction)
// can use this plugin to anonymize requests or intercept CCIP requests
// to notify and/or receive authorization from the user
/* * * *
export type FetchDataFunc = (req: Frozen<FetchRequest>) => Promise<FetchRequest>;
export class CcipPreflightPlugin extends NetworkPlugin {
readonly fetchData!: FetchDataFunc;
constructor(fetchData: FetchDataFunc) {
super("org.ethers.plugins.ccip-preflight");
defineProperties<CcipPreflightPlugin>(this, { fetchData });
}
clone(): CcipPreflightPlugin {
return new CcipPreflightPlugin(this.fetchData);
}
}
*/
const Networks = new Map();
// @TODO: Add a _ethersNetworkObj variable to better detect network ovjects
/**
* A **Network** provides access to a chain's properties and allows
* for plug-ins to extend functionality.
@ -16189,6 +16174,53 @@ class Network {
Networks.set(nameOrChainId, networkFunc);
}
}
// We don't want to bring in formatUnits because it is backed by
// FixedNumber and we want to keep Networks tiny. The values
// included by the Gas Stations are also IEEE 754 with lots of
// rounding issues and exceed the strict checks formatUnits has.
function parseUnits(_value, decimals) {
const value = String(_value);
if (!value.match(/^[0-9.]+$/)) {
throw new Error(`invalid gwei value: ${_value}`);
}
// Break into [ whole, fraction ]
const comps = value.split(".");
if (comps.length === 1) {
comps.push("");
}
// More than 1 decimal point or too many fractional positions
if (comps.length !== 2) {
throw new Error(`invalid gwei value: ${_value}`);
}
// Pad the fraction to 9 decimalplaces
while (comps[1].length < decimals) {
comps[1] += "0";
}
// Too many decimals and some non-zero ending, take the ceiling
if (comps[1].length > 9 && !comps[1].substring(9).match(/^0+$/)) {
comps[1] = (BigInt(comps[1].substring(0, 9)) + BigInt(1)).toString();
}
return BigInt(comps[0] + comps[1]);
}
function getGasStationPlugin(url) {
return new FetchUrlFeeDataNetworkPlugin(url, async (fetchFeeData, provider, request) => {
// Prevent Cloudflare from blocking our request in node.js
request.setHeader("User-Agent", "ethers");
let response;
try {
response = await request.send();
const payload = response.bodyJson.standard;
const feeData = {
maxFeePerGas: parseUnits(payload.maxFee, 9),
maxPriorityFeePerGas: parseUnits(payload.maxPriorityFee, 9),
};
return feeData;
}
catch (error) {
assert$1(false, `error encountered with polygon gas station (${JSON.stringify(request.url)})`, "SERVER_ERROR", { request, response, error });
}
});
}
// See: https://chainlist.org
let injected = false;
function injectCommonNetworks() {
@ -16204,14 +16236,10 @@ function injectCommonNetworks() {
if (options.ensNetwork != null) {
network.attachPlugin(new EnsPlugin(null, options.ensNetwork));
}
if (options.priorityFee) ;
/*
if (options.etherscan) {
const { url, apiKey } = options.etherscan;
network.attachPlugin(new EtherscanPlugin(url, apiKey));
}
*/
network.attachPlugin(new GasCostPlugin());
(options.plugins || []).forEach((plugin) => {
network.attachPlugin(plugin);
});
return network;
};
// Register the network by name and chain ID
@ -16231,51 +16259,31 @@ function injectCommonNetworks() {
registerEth("sepolia", 11155111, {});
registerEth("classic", 61, {});
registerEth("classicKotti", 6, {});
registerEth("xdai", 100, { ensNetwork: 1 });
registerEth("optimism", 10, {
ensNetwork: 1,
etherscan: { url: "https:/\/api-optimistic.etherscan.io/" }
});
registerEth("optimism-goerli", 420, {
etherscan: { url: "https:/\/api-goerli-optimistic.etherscan.io/" }
});
registerEth("arbitrum", 42161, {
ensNetwork: 1,
etherscan: { url: "https:/\/api.arbiscan.io/" }
});
registerEth("arbitrum-goerli", 421613, {
etherscan: { url: "https:/\/api-goerli.arbiscan.io/" }
});
// Polygon has a 35 gwei maxPriorityFee requirement
registerEth("arbitrum-goerli", 421613, {});
registerEth("bnb", 56, { ensNetwork: 1 });
registerEth("bnbt", 97, {});
registerEth("linea", 59144, { ensNetwork: 1 });
registerEth("linea-goerli", 59140, {});
registerEth("matic", 137, {
ensNetwork: 1,
// priorityFee: 35000000000,
etherscan: {
// apiKey: "W6T8DJW654GNTQ34EFEYYP3EZD9DD27CT7",
url: "https:/\/api.polygonscan.com/"
}
plugins: [
getGasStationPlugin("https:/\/gasstation.polygon.technology/v2")
]
});
registerEth("matic-mumbai", 80001, {
altNames: ["maticMumbai", "maticmum"],
// priorityFee: 35000000000,
etherscan: {
// apiKey: "W6T8DJW654GNTQ34EFEYYP3EZD9DD27CT7",
url: "https:/\/api-testnet.polygonscan.com/"
}
plugins: [
getGasStationPlugin("https:/\/gasstation-testnet.polygon.technology/v2")
]
});
registerEth("bnb", 56, {
registerEth("optimism", 10, {
ensNetwork: 1,
etherscan: {
// apiKey: "EVTS3CU31AATZV72YQ55TPGXGMVIFUQ9M9",
url: "http:/\/api.bscscan.com"
}
});
registerEth("bnbt", 97, {
etherscan: {
// apiKey: "EVTS3CU31AATZV72YQ55TPGXGMVIFUQ9M9",
url: "http:/\/api-testnet.bscscan.com"
}
});
registerEth("optimism-goerli", 420, {});
registerEth("xdai", 100, { ensNetwork: 1 });
}
function copy$2(obj) {
@ -16666,7 +16674,8 @@ async function getSubscription(_event, provider) {
}
function getTime$1() { return (new Date()).getTime(); }
const defaultOptions$1 = {
cacheTimeout: 250
cacheTimeout: 250,
pollingInterval: 4000
};
/**
* An **AbstractProvider** provides a base class for other sub-classes to
@ -16720,6 +16729,7 @@ class AbstractProvider {
this.#timers = new Map();
this.#disableCcipRead = false;
}
get pollingInterval() { return this.#options.pollingInterval; }
/**
* Returns ``this``, to allow an **AbstractProvider** to implement
* the [[ContractRunner]] interface.
@ -17089,31 +17099,36 @@ class AbstractProvider {
return expected.clone();
}
async getFeeData() {
const { block, gasPrice } = await resolveProperties({
block: this.getBlock("latest"),
gasPrice: ((async () => {
try {
const gasPrice = await this.#perform({ method: "getGasPrice" });
return getBigInt(gasPrice, "%response");
}
catch (error) { }
return null;
})())
});
let maxFeePerGas = null, maxPriorityFeePerGas = null;
if (block && block.baseFeePerGas) {
// We may want to compute this more accurately in the future,
// using the formula "check if the base fee is correct".
// See: https://eips.ethereum.org/EIPS/eip-1559
maxPriorityFeePerGas = BigInt("1000000000");
// Allow a network to override their maximum priority fee per gas
//const priorityFeePlugin = (await this.getNetwork()).getPlugin<MaxPriorityFeePlugin>("org.ethers.plugins.max-priority-fee");
//if (priorityFeePlugin) {
// maxPriorityFeePerGas = await priorityFeePlugin.getPriorityFee(this);
//}
maxFeePerGas = (block.baseFeePerGas * BN_2$1) + maxPriorityFeePerGas;
const network = await this.getNetwork();
const getFeeDataFunc = async () => {
const { _block, gasPrice } = await resolveProperties({
_block: this.#getBlock("latest", false),
gasPrice: ((async () => {
try {
const gasPrice = await this.#perform({ method: "getGasPrice" });
return getBigInt(gasPrice, "%response");
}
catch (error) { }
return null;
})())
});
let maxFeePerGas = null, maxPriorityFeePerGas = null;
// These are the recommended EIP-1559 heuristics for fee data
const block = this._wrapBlock(_block, network);
if (block && block.baseFeePerGas) {
maxPriorityFeePerGas = BigInt("1000000000");
maxFeePerGas = (block.baseFeePerGas * BN_2$1) + maxPriorityFeePerGas;
}
return new FeeData(gasPrice, maxFeePerGas, maxPriorityFeePerGas);
};
// Check for a FeeDataNetWorkPlugin
const plugin = network.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");
if (plugin) {
const req = new FetchRequest(plugin.url);
const feeData = await plugin.processFunc(getFeeDataFunc, this, req);
return new FeeData(feeData.gasPrice, feeData.maxFeePerGas, feeData.maxPriorityFeePerGas);
}
return new FeeData(gasPrice, maxFeePerGas, maxPriorityFeePerGas);
return await getFeeDataFunc();
}
async estimateGas(_tx) {
let tx = this._getTransactionRequest(_tx);
@ -17474,8 +17489,11 @@ class AbstractProvider {
case "error":
case "network":
return new UnmanagedSubscriber(sub.type);
case "block":
return new PollingBlockSubscriber(this);
case "block": {
const subscriber = new PollingBlockSubscriber(this);
subscriber.pollingInterval = this.pollingInterval;
return subscriber;
}
case "event":
return new PollingEventSubscriber(this, sub.filter);
case "transaction":
@ -18356,7 +18374,8 @@ const defaultOptions = {
batchStallTime: 10,
batchMaxSize: (1 << 20),
batchMaxCount: 100,
cacheTimeout: 250
cacheTimeout: 250,
pollingInterval: 4000
};
// @TODO: Unchecked Signers
class JsonRpcSigner extends AbstractSigner {
@ -18574,11 +18593,7 @@ class JsonRpcApiProvider extends AbstractProvider {
}, stallTime);
}
constructor(network, options) {
const superOptions = {};
if (options && options.cacheTimeout != null) {
superOptions.cacheTimeout = options.cacheTimeout;
}
super(network, superOptions);
super(network, options);
this.#nextId = 1;
this.#options = Object.assign({}, defaultOptions, options || {});
this.#payloads = [];
@ -19030,6 +19045,12 @@ class JsonRpcApiProvider extends AbstractProvider {
super.destroy();
}
}
// @TODO: remove this in v7, it is not exported because this functionality
// is exposed in the JsonRpcApiProvider by setting polling to true. It should
// be safe to remove regardless, because it isn't reachable, but just in case.
/**
* @_ignore:
*/
class JsonRpcApiPollingProvider extends JsonRpcApiProvider {
#pollingInterval;
constructor(network, options) {
@ -19501,6 +19522,10 @@ class EtherscanProvider extends AbstractProvider {
return "https:/\/api-optimistic.etherscan.io";
case "optimism-goerli":
return "https:/\/api-goerli-optimistic.etherscan.io";
case "bnb":
return "http:/\/api.bscscan.com";
case "bnbt":
return "http:/\/api-testnet.bscscan.com";
}
assertArgument(false, "unsupported network", "network", this.network);
}
@ -20239,6 +20264,10 @@ function getHost$2(name) {
return "arbitrum-mainnet.infura.io";
case "arbitrum-goerli":
return "arbitrum-goerli.infura.io";
case "linea":
return "linea-mainnet.infura.io";
case "linea-goerli":
return "linea-goerli.infura.io";
case "matic":
return "polygon-mainnet.infura.io";
case "matic-mumbai":
@ -20699,8 +20728,8 @@ class FallbackProvider extends AbstractProvider {
* If a [[Provider]] is included in %%providers%%, defaults are used
* for the configuration.
*/
constructor(providers, network) {
super(network);
constructor(providers, network, options) {
super(network, options);
this.#configs = providers.map((p) => {
if (p instanceof AbstractProvider) {
return Object.assign({ provider: p }, defaultConfig, defaultState);
@ -20711,7 +20740,15 @@ class FallbackProvider extends AbstractProvider {
});
this.#height = -2;
this.#initialSyncPromise = null;
this.quorum = 2; //Math.ceil(providers.length / 2);
if (options && options.quorum != null) {
this.quorum = options.quorum;
}
else {
this.quorum = Math.ceil(this.#configs.reduce((accum, config) => {
accum += config.weight;
return accum;
}, 0) / 2);
}
this.eventQuorum = 1;
this.eventWorkers = 1;
assertArgument(this.quorum <= this.#configs.reduce((a, c) => (a + c.weight), 0), "quorum exceed provider wieght", "quorum", this.quorum);
@ -20783,7 +20820,7 @@ class FallbackProvider extends AbstractProvider {
// Shuffle the states, sorted by priority
const allConfigs = this.#configs.slice();
shuffle(allConfigs);
allConfigs.sort((a, b) => (b.priority - a.priority));
allConfigs.sort((a, b) => (a.priority - b.priority));
for (const config of allConfigs) {
if (config._lastFatalError) {
continue;
@ -21032,42 +21069,66 @@ function isWebSocketLike(value) {
return (value && typeof (value.send) === "function" &&
typeof (value.close) === "function");
}
const Testnets = "goerli kovan sepolia classicKotti optimism-goerli arbitrum-goerli matic-mumbai bnbt".split(" ");
function getDefaultProvider(network, options) {
if (options == null) {
options = {};
}
const allowService = (name) => {
if (options[name] === "-") {
return false;
}
if (typeof (options.exclusive) === "string") {
return (name === options.exclusive);
}
if (Array.isArray(options.exclusive)) {
return (options.exclusive.indexOf(name) !== -1);
}
return true;
};
if (typeof (network) === "string" && network.match(/^https?:/)) {
return new JsonRpcProvider(network);
}
if (typeof (network) === "string" && network.match(/^wss?:/) || isWebSocketLike(network)) {
return new WebSocketProvider(network);
}
// Get the network and name, if possible
let staticNetwork = null;
try {
staticNetwork = Network.from(network);
}
catch (error) { }
const providers = [];
if (options.alchemy !== "-") {
if (allowService("publicPolygon") && staticNetwork) {
if (staticNetwork.name === "matic") {
providers.push(new JsonRpcProvider("https:/\/polygon-rpc.com/", staticNetwork, { staticNetwork }));
}
}
if (allowService("alchemy")) {
try {
providers.push(new AlchemyProvider(network, options.alchemy));
}
catch (error) { }
}
if (options.ankr !== "-" && options.ankr != null) {
if (allowService("ankr") && options.ankr != null) {
try {
providers.push(new AnkrProvider(network, options.ankr));
}
catch (error) { }
}
if (options.cloudflare !== "-") {
if (allowService("cloudflare")) {
try {
providers.push(new CloudflareProvider(network));
}
catch (error) { }
}
if (options.etherscan !== "-") {
if (allowService("etherscan")) {
try {
providers.push(new EtherscanProvider(network, options.etherscan));
}
catch (error) { }
}
if (options.infura !== "-") {
if (allowService("infura")) {
try {
let projectId = options.infura;
let projectSecret = undefined;
@ -21094,7 +21155,7 @@ function getDefaultProvider(network, options) {
} catch (error) { console.log(error); }
}
*/
if (options.quicknode !== "-") {
if (allowService("quicknode")) {
try {
let token = options.quicknode;
providers.push(new QuickNodeProvider(network, token));
@ -21104,10 +21165,26 @@ function getDefaultProvider(network, options) {
assert$1(providers.length, "unsupported default network", "UNSUPPORTED_OPERATION", {
operation: "getDefaultProvider"
});
// No need for a FallbackProvider
if (providers.length === 1) {
return providers[0];
}
return new FallbackProvider(providers);
// We use the floor because public third-party providers can be unreliable,
// so a low number of providers with a large quorum will fail too often
let quorum = Math.floor(providers.length / 2);
if (quorum > 2) {
quorum = 2;
}
// Testnets don't need as strong a security gaurantee and speed is
// more useful during testing
if (staticNetwork && Testnets.indexOf(staticNetwork.name) !== -1) {
quorum = 1;
}
// Provided override qorum takes priority
if (options && options.quorum) {
quorum = options.quorum;
}
return new FallbackProvider(providers, undefined, { quorum });
}
/**
@ -23425,6 +23502,7 @@ var ethers = /*#__PURE__*/Object.freeze({
FetchCancelSignal: FetchCancelSignal,
FetchRequest: FetchRequest,
FetchResponse: FetchResponse,
FetchUrlFeeDataNetworkPlugin: FetchUrlFeeDataNetworkPlugin,
FixedNumber: FixedNumber,
Fragment: Fragment,
FunctionFragment: FunctionFragment,
@ -23545,7 +23623,7 @@ var ethers = /*#__PURE__*/Object.freeze({
mask: mask,
namehash: namehash,
parseEther: parseEther,
parseUnits: parseUnits,
parseUnits: parseUnits$1,
pbkdf2: pbkdf2,
randomBytes: randomBytes,
recoverAddress: recoverAddress,
@ -23579,5 +23657,5 @@ var ethers = /*#__PURE__*/Object.freeze({
zeroPadValue: zeroPadValue
});
export { AbiCoder, AbstractProvider, AbstractSigner, AlchemyProvider, AnkrProvider, BaseContract, BaseWallet, Block, BrowserProvider, CloudflareProvider, ConstructorFragment, Contract, ContractEventPayload, ContractFactory, ContractTransactionReceipt, ContractTransactionResponse, ContractUnknownEventPayload, EnsPlugin, EnsResolver, ErrorDescription, ErrorFragment, EtherSymbol, EtherscanPlugin, EtherscanProvider, EventFragment, EventLog, EventPayload, FallbackFragment, FallbackProvider, FeeData, FeeDataNetworkPlugin, FetchCancelSignal, FetchRequest, FetchResponse, FixedNumber, Fragment, FunctionFragment, GasCostPlugin, HDNodeVoidWallet, HDNodeWallet, Indexed, InfuraProvider, InfuraWebSocketProvider, Interface, IpcSocketProvider, JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, LangEn, Log, LogDescription, MaxInt256, MaxUint256, MessagePrefix, MinInt256, Mnemonic, MulticoinProviderPlugin, N$1 as N, NamedFragment, Network, NetworkPlugin, NonceManager, ParamType, PocketProvider, QuickNodeProvider, Result, Signature, SigningKey, SocketBlockSubscriber, SocketEventSubscriber, SocketPendingSubscriber, SocketProvider, SocketSubscriber, StructFragment, Transaction, TransactionDescription, TransactionReceipt, TransactionResponse, Typed, TypedDataEncoder, UnmanagedSubscriber, Utf8ErrorFuncs, VoidSigner, Wallet, WebSocketProvider, WeiPerEther, Wordlist, WordlistOwl, WordlistOwlA, ZeroAddress, ZeroHash, accessListify, assert$1 as assert, assertArgument, assertArgumentCount, assertNormalize, assertPrivate, checkResultErrors, computeAddress, computeHmac, concat, copyRequest, dataLength, dataSlice, decodeBase58, decodeBase64, decodeBytes32String, decodeRlp, decryptCrowdsaleJson, decryptKeystoreJson, decryptKeystoreJsonSync, defaultPath, defineProperties, dnsEncode, encodeBase58, encodeBase64, encodeBytes32String, encodeRlp, encryptKeystoreJson, encryptKeystoreJsonSync, ensNormalize, ethers, formatEther, formatUnits, fromTwos, getAccountPath, getAddress, getBigInt, getBytes, getBytesCopy, getCreate2Address, getCreateAddress, getDefaultProvider, getIcapAddress, getIndexedAccountPath, getNumber, getUint, hashMessage, hexlify, id, isAddress, isAddressable, isBytesLike, isCallException, isCrowdsaleJson, isError, isHexString, isKeystoreJson, isValidName, keccak256, lock, makeError, mask, namehash, parseEther, parseUnits, pbkdf2, randomBytes, recoverAddress, resolveAddress, resolveProperties, ripemd160, scrypt, scryptSync, sha256, sha512, showThrottleMessage, solidityPacked, solidityPackedKeccak256, solidityPackedSha256, stripZerosLeft, toBeArray, toBeHex, toBigInt, toNumber, toQuantity, toTwos, toUtf8Bytes, toUtf8CodePoints, toUtf8String, uuidV4, verifyMessage, verifyTypedData, version, wordlists, zeroPadBytes, zeroPadValue };
export { AbiCoder, AbstractProvider, AbstractSigner, AlchemyProvider, AnkrProvider, BaseContract, BaseWallet, Block, BrowserProvider, CloudflareProvider, ConstructorFragment, Contract, ContractEventPayload, ContractFactory, ContractTransactionReceipt, ContractTransactionResponse, ContractUnknownEventPayload, EnsPlugin, EnsResolver, ErrorDescription, ErrorFragment, EtherSymbol, EtherscanPlugin, EtherscanProvider, EventFragment, EventLog, EventPayload, FallbackFragment, FallbackProvider, FeeData, FeeDataNetworkPlugin, FetchCancelSignal, FetchRequest, FetchResponse, FetchUrlFeeDataNetworkPlugin, FixedNumber, Fragment, FunctionFragment, GasCostPlugin, HDNodeVoidWallet, HDNodeWallet, Indexed, InfuraProvider, InfuraWebSocketProvider, Interface, IpcSocketProvider, JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, LangEn, Log, LogDescription, MaxInt256, MaxUint256, MessagePrefix, MinInt256, Mnemonic, MulticoinProviderPlugin, N$1 as N, NamedFragment, Network, NetworkPlugin, NonceManager, ParamType, PocketProvider, QuickNodeProvider, Result, Signature, SigningKey, SocketBlockSubscriber, SocketEventSubscriber, SocketPendingSubscriber, SocketProvider, SocketSubscriber, StructFragment, Transaction, TransactionDescription, TransactionReceipt, TransactionResponse, Typed, TypedDataEncoder, UnmanagedSubscriber, Utf8ErrorFuncs, VoidSigner, Wallet, WebSocketProvider, WeiPerEther, Wordlist, WordlistOwl, WordlistOwlA, ZeroAddress, ZeroHash, accessListify, assert$1 as assert, assertArgument, assertArgumentCount, assertNormalize, assertPrivate, checkResultErrors, computeAddress, computeHmac, concat, copyRequest, dataLength, dataSlice, decodeBase58, decodeBase64, decodeBytes32String, decodeRlp, decryptCrowdsaleJson, decryptKeystoreJson, decryptKeystoreJsonSync, defaultPath, defineProperties, dnsEncode, encodeBase58, encodeBase64, encodeBytes32String, encodeRlp, encryptKeystoreJson, encryptKeystoreJsonSync, ensNormalize, ethers, formatEther, formatUnits, fromTwos, getAccountPath, getAddress, getBigInt, getBytes, getBytesCopy, getCreate2Address, getCreateAddress, getDefaultProvider, getIcapAddress, getIndexedAccountPath, getNumber, getUint, hashMessage, hexlify, id, isAddress, isAddressable, isBytesLike, isCallException, isCrowdsaleJson, isError, isHexString, isKeystoreJson, isValidName, keccak256, lock, makeError, mask, namehash, parseEther, parseUnits$1 as parseUnits, pbkdf2, randomBytes, recoverAddress, resolveAddress, resolveProperties, ripemd160, scrypt, scryptSync, sha256, sha512, showThrottleMessage, solidityPacked, solidityPackedKeccak256, solidityPackedSha256, stripZerosLeft, toBeArray, toBeHex, toBigInt, toNumber, toQuantity, toTwos, toUtf8Bytes, toUtf8CodePoints, toUtf8String, uuidV4, verifyMessage, verifyTypedData, version, wordlists, zeroPadBytes, zeroPadValue };
//# sourceMappingURL=ethers.js.map

2
dist/ethers.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/ethers.min.js vendored

File diff suppressed because one or more lines are too long

337
dist/ethers.umd.js vendored

@ -2511,7 +2511,7 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
* %%unit%% decimal places. The %%unit%% may the number of decimal places
* or the name of a unit (e.g. ``"gwei"`` for 9 decimal places).
*/
function parseUnits(value, unit) {
function parseUnits$1(value, unit) {
assertArgument(typeof (value) === "string", "value must be a string", "value", value);
let decimals = 18;
if (typeof (unit) === "string") {
@ -2535,7 +2535,7 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
* decimal places.
*/
function parseEther(ether) {
return parseUnits(ether, 18);
return parseUnits$1(ether, 18);
}
/**
@ -10044,6 +10044,8 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
items.forEach((k) => result.add(k));
return Object.freeze(result);
}
const _kwVisibDeploy = "external public payable";
const KwVisibDeploy = setify(_kwVisibDeploy.split(" "));
// Visibility Keywords
const _kwVisib = "constant external internal payable private public pure view";
const KwVisib = setify(_kwVisib.split(" "));
@ -11047,7 +11049,7 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
else if (obj instanceof TokenString) {
consumeKeywords(obj, setify(["constructor"]));
const inputs = consumeParams(obj);
const payable = !!consumeKeywords(obj, setify(["payable"])).has("payable");
const payable = !!consumeKeywords(obj, KwVisibDeploy).has("payable");
const gas = consumeGas(obj);
consumeEoi(obj);
return new ConstructorFragment(_guard$2, "constructor", inputs, payable, gas);
@ -13907,11 +13909,12 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
return super.logs.map((log) => {
const fragment = log.topics.length ? this.#iface.getEvent(log.topics[0]) : null;
if (fragment) {
return new EventLog(log, this.#iface, fragment);
}
else {
return log;
try {
return new EventLog(log, this.#iface, fragment);
}
catch (error) { }
}
return log;
});
}
}
@ -14082,8 +14085,11 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
* @_ignore:
*/
async function copyOverrides(arg, allowed) {
// Make sure the overrides passed in are a valid overrides object
const _overrides = Typed.dereference(arg, "overrides");
assertArgument(typeof (_overrides) === "object", "invalid overrides parameter", "overrides", arg);
// Create a shallow copy (we'll deep-ify anything needed during normalizing)
const overrides = copyRequest(Typed.dereference(arg, "overrides"));
const overrides = copyRequest(_overrides);
assertArgument(overrides.to == null || (allowed || []).indexOf("to") >= 0, "cannot override to", "overrides.to", overrides.to);
assertArgument(overrides.data == null || (allowed || []).indexOf("data") >= 0, "cannot override data", "overrides.data", overrides.data);
// Resolve any from
@ -15906,6 +15912,19 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
return new FeeDataNetworkPlugin(this.#feeDataFunc);
}
}
class FetchUrlFeeDataNetworkPlugin extends NetworkPlugin {
#url;
#processFunc;
get url() { return this.#url; }
get processFunc() { return this.#processFunc; }
constructor(url, processFunc) {
super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");
this.#url = url;
this.#processFunc = processFunc;
}
// We are immutable, so we can serve as our own clone
clone() { return this; }
}
/*
export class CustomBlockNetworkPlugin extends NetworkPlugin {
readonly #blockFunc: (provider: Provider, block: BlockParams<string>) => Block<string>;
@ -15954,41 +15973,7 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
}
}
*/
/* * * *
export class PriceOraclePlugin extends NetworkPlugin {
readonly address!: string;
constructor(address: string) {
super("org.ethers.plugins.price-oracle");
defineProperties<PriceOraclePlugin>(this, { address });
}
clone(): PriceOraclePlugin {
return new PriceOraclePlugin(this.address);
}
}
*/
// Networks or clients with a higher need for security (such as clients
// that may automatically make CCIP requests without user interaction)
// can use this plugin to anonymize requests or intercept CCIP requests
// to notify and/or receive authorization from the user
/* * * *
export type FetchDataFunc = (req: Frozen<FetchRequest>) => Promise<FetchRequest>;
export class CcipPreflightPlugin extends NetworkPlugin {
readonly fetchData!: FetchDataFunc;
constructor(fetchData: FetchDataFunc) {
super("org.ethers.plugins.ccip-preflight");
defineProperties<CcipPreflightPlugin>(this, { fetchData });
}
clone(): CcipPreflightPlugin {
return new CcipPreflightPlugin(this.fetchData);
}
}
*/
const Networks = new Map();
// @TODO: Add a _ethersNetworkObj variable to better detect network ovjects
/**
* A **Network** provides access to a chain's properties and allows
* for plug-ins to extend functionality.
@ -16195,6 +16180,53 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
Networks.set(nameOrChainId, networkFunc);
}
}
// We don't want to bring in formatUnits because it is backed by
// FixedNumber and we want to keep Networks tiny. The values
// included by the Gas Stations are also IEEE 754 with lots of
// rounding issues and exceed the strict checks formatUnits has.
function parseUnits(_value, decimals) {
const value = String(_value);
if (!value.match(/^[0-9.]+$/)) {
throw new Error(`invalid gwei value: ${_value}`);
}
// Break into [ whole, fraction ]
const comps = value.split(".");
if (comps.length === 1) {
comps.push("");
}
// More than 1 decimal point or too many fractional positions
if (comps.length !== 2) {
throw new Error(`invalid gwei value: ${_value}`);
}
// Pad the fraction to 9 decimalplaces
while (comps[1].length < decimals) {
comps[1] += "0";
}
// Too many decimals and some non-zero ending, take the ceiling
if (comps[1].length > 9 && !comps[1].substring(9).match(/^0+$/)) {
comps[1] = (BigInt(comps[1].substring(0, 9)) + BigInt(1)).toString();
}
return BigInt(comps[0] + comps[1]);
}
function getGasStationPlugin(url) {
return new FetchUrlFeeDataNetworkPlugin(url, async (fetchFeeData, provider, request) => {
// Prevent Cloudflare from blocking our request in node.js
request.setHeader("User-Agent", "ethers");
let response;
try {
response = await request.send();
const payload = response.bodyJson.standard;
const feeData = {
maxFeePerGas: parseUnits(payload.maxFee, 9),
maxPriorityFeePerGas: parseUnits(payload.maxPriorityFee, 9),
};
return feeData;
}
catch (error) {
assert$1(false, `error encountered with polygon gas station (${JSON.stringify(request.url)})`, "SERVER_ERROR", { request, response, error });
}
});
}
// See: https://chainlist.org
let injected = false;
function injectCommonNetworks() {
@ -16210,14 +16242,10 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
if (options.ensNetwork != null) {
network.attachPlugin(new EnsPlugin(null, options.ensNetwork));
}
if (options.priorityFee) ;
/*
if (options.etherscan) {
const { url, apiKey } = options.etherscan;
network.attachPlugin(new EtherscanPlugin(url, apiKey));
}
*/
network.attachPlugin(new GasCostPlugin());
(options.plugins || []).forEach((plugin) => {
network.attachPlugin(plugin);
});
return network;
};
// Register the network by name and chain ID
@ -16237,51 +16265,31 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
registerEth("sepolia", 11155111, {});
registerEth("classic", 61, {});
registerEth("classicKotti", 6, {});
registerEth("xdai", 100, { ensNetwork: 1 });
registerEth("optimism", 10, {
ensNetwork: 1,
etherscan: { url: "https:/\/api-optimistic.etherscan.io/" }
});
registerEth("optimism-goerli", 420, {
etherscan: { url: "https:/\/api-goerli-optimistic.etherscan.io/" }
});
registerEth("arbitrum", 42161, {
ensNetwork: 1,
etherscan: { url: "https:/\/api.arbiscan.io/" }
});
registerEth("arbitrum-goerli", 421613, {
etherscan: { url: "https:/\/api-goerli.arbiscan.io/" }
});
// Polygon has a 35 gwei maxPriorityFee requirement
registerEth("arbitrum-goerli", 421613, {});
registerEth("bnb", 56, { ensNetwork: 1 });
registerEth("bnbt", 97, {});
registerEth("linea", 59144, { ensNetwork: 1 });
registerEth("linea-goerli", 59140, {});
registerEth("matic", 137, {
ensNetwork: 1,
// priorityFee: 35000000000,
etherscan: {
// apiKey: "W6T8DJW654GNTQ34EFEYYP3EZD9DD27CT7",
url: "https:/\/api.polygonscan.com/"
}
plugins: [
getGasStationPlugin("https:/\/gasstation.polygon.technology/v2")
]
});
registerEth("matic-mumbai", 80001, {
altNames: ["maticMumbai", "maticmum"],
// priorityFee: 35000000000,
etherscan: {
// apiKey: "W6T8DJW654GNTQ34EFEYYP3EZD9DD27CT7",
url: "https:/\/api-testnet.polygonscan.com/"
}
plugins: [
getGasStationPlugin("https:/\/gasstation-testnet.polygon.technology/v2")
]
});
registerEth("bnb", 56, {
registerEth("optimism", 10, {
ensNetwork: 1,
etherscan: {
// apiKey: "EVTS3CU31AATZV72YQ55TPGXGMVIFUQ9M9",
url: "http:/\/api.bscscan.com"
}
});
registerEth("bnbt", 97, {
etherscan: {
// apiKey: "EVTS3CU31AATZV72YQ55TPGXGMVIFUQ9M9",
url: "http:/\/api-testnet.bscscan.com"
}
});
registerEth("optimism-goerli", 420, {});
registerEth("xdai", 100, { ensNetwork: 1 });
}
function copy$2(obj) {
@ -16672,7 +16680,8 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
}
function getTime$1() { return (new Date()).getTime(); }
const defaultOptions$1 = {
cacheTimeout: 250
cacheTimeout: 250,
pollingInterval: 4000
};
/**
* An **AbstractProvider** provides a base class for other sub-classes to
@ -16726,6 +16735,7 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
this.#timers = new Map();
this.#disableCcipRead = false;
}
get pollingInterval() { return this.#options.pollingInterval; }
/**
* Returns ``this``, to allow an **AbstractProvider** to implement
* the [[ContractRunner]] interface.
@ -17095,31 +17105,36 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
return expected.clone();
}
async getFeeData() {
const { block, gasPrice } = await resolveProperties({
block: this.getBlock("latest"),
gasPrice: ((async () => {
try {
const gasPrice = await this.#perform({ method: "getGasPrice" });
return getBigInt(gasPrice, "%response");
}
catch (error) { }
return null;
})())
});
let maxFeePerGas = null, maxPriorityFeePerGas = null;
if (block && block.baseFeePerGas) {
// We may want to compute this more accurately in the future,
// using the formula "check if the base fee is correct".
// See: https://eips.ethereum.org/EIPS/eip-1559
maxPriorityFeePerGas = BigInt("1000000000");
// Allow a network to override their maximum priority fee per gas
//const priorityFeePlugin = (await this.getNetwork()).getPlugin<MaxPriorityFeePlugin>("org.ethers.plugins.max-priority-fee");
//if (priorityFeePlugin) {
// maxPriorityFeePerGas = await priorityFeePlugin.getPriorityFee(this);
//}
maxFeePerGas = (block.baseFeePerGas * BN_2$1) + maxPriorityFeePerGas;
const network = await this.getNetwork();
const getFeeDataFunc = async () => {
const { _block, gasPrice } = await resolveProperties({
_block: this.#getBlock("latest", false),
gasPrice: ((async () => {
try {
const gasPrice = await this.#perform({ method: "getGasPrice" });
return getBigInt(gasPrice, "%response");
}
catch (error) { }
return null;
})())
});
let maxFeePerGas = null, maxPriorityFeePerGas = null;
// These are the recommended EIP-1559 heuristics for fee data
const block = this._wrapBlock(_block, network);
if (block && block.baseFeePerGas) {
maxPriorityFeePerGas = BigInt("1000000000");
maxFeePerGas = (block.baseFeePerGas * BN_2$1) + maxPriorityFeePerGas;
}
return new FeeData(gasPrice, maxFeePerGas, maxPriorityFeePerGas);
};
// Check for a FeeDataNetWorkPlugin
const plugin = network.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");
if (plugin) {
const req = new FetchRequest(plugin.url);
const feeData = await plugin.processFunc(getFeeDataFunc, this, req);
return new FeeData(feeData.gasPrice, feeData.maxFeePerGas, feeData.maxPriorityFeePerGas);
}
return new FeeData(gasPrice, maxFeePerGas, maxPriorityFeePerGas);
return await getFeeDataFunc();
}
async estimateGas(_tx) {
let tx = this._getTransactionRequest(_tx);
@ -17480,8 +17495,11 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
case "error":
case "network":
return new UnmanagedSubscriber(sub.type);
case "block":
return new PollingBlockSubscriber(this);
case "block": {
const subscriber = new PollingBlockSubscriber(this);
subscriber.pollingInterval = this.pollingInterval;
return subscriber;
}
case "event":
return new PollingEventSubscriber(this, sub.filter);
case "transaction":
@ -18362,7 +18380,8 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
batchStallTime: 10,
batchMaxSize: (1 << 20),
batchMaxCount: 100,
cacheTimeout: 250
cacheTimeout: 250,
pollingInterval: 4000
};
// @TODO: Unchecked Signers
class JsonRpcSigner extends AbstractSigner {
@ -18580,11 +18599,7 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
}, stallTime);
}
constructor(network, options) {
const superOptions = {};
if (options && options.cacheTimeout != null) {
superOptions.cacheTimeout = options.cacheTimeout;
}
super(network, superOptions);
super(network, options);
this.#nextId = 1;
this.#options = Object.assign({}, defaultOptions, options || {});
this.#payloads = [];
@ -19036,6 +19051,12 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
super.destroy();
}
}
// @TODO: remove this in v7, it is not exported because this functionality
// is exposed in the JsonRpcApiProvider by setting polling to true. It should
// be safe to remove regardless, because it isn't reachable, but just in case.
/**
* @_ignore:
*/
class JsonRpcApiPollingProvider extends JsonRpcApiProvider {
#pollingInterval;
constructor(network, options) {
@ -19507,6 +19528,10 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
return "https:/\/api-optimistic.etherscan.io";
case "optimism-goerli":
return "https:/\/api-goerli-optimistic.etherscan.io";
case "bnb":
return "http:/\/api.bscscan.com";
case "bnbt":
return "http:/\/api-testnet.bscscan.com";
}
assertArgument(false, "unsupported network", "network", this.network);
}
@ -20245,6 +20270,10 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
return "arbitrum-mainnet.infura.io";
case "arbitrum-goerli":
return "arbitrum-goerli.infura.io";
case "linea":
return "linea-mainnet.infura.io";
case "linea-goerli":
return "linea-goerli.infura.io";
case "matic":
return "polygon-mainnet.infura.io";
case "matic-mumbai":
@ -20705,8 +20734,8 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
* If a [[Provider]] is included in %%providers%%, defaults are used
* for the configuration.
*/
constructor(providers, network) {
super(network);
constructor(providers, network, options) {
super(network, options);
this.#configs = providers.map((p) => {
if (p instanceof AbstractProvider) {
return Object.assign({ provider: p }, defaultConfig, defaultState);
@ -20717,7 +20746,15 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
});
this.#height = -2;
this.#initialSyncPromise = null;
this.quorum = 2; //Math.ceil(providers.length / 2);
if (options && options.quorum != null) {
this.quorum = options.quorum;
}
else {
this.quorum = Math.ceil(this.#configs.reduce((accum, config) => {
accum += config.weight;
return accum;
}, 0) / 2);
}
this.eventQuorum = 1;
this.eventWorkers = 1;
assertArgument(this.quorum <= this.#configs.reduce((a, c) => (a + c.weight), 0), "quorum exceed provider wieght", "quorum", this.quorum);
@ -20789,7 +20826,7 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
// Shuffle the states, sorted by priority
const allConfigs = this.#configs.slice();
shuffle(allConfigs);
allConfigs.sort((a, b) => (b.priority - a.priority));
allConfigs.sort((a, b) => (a.priority - b.priority));
for (const config of allConfigs) {
if (config._lastFatalError) {
continue;
@ -21038,42 +21075,66 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
return (value && typeof (value.send) === "function" &&
typeof (value.close) === "function");
}
const Testnets = "goerli kovan sepolia classicKotti optimism-goerli arbitrum-goerli matic-mumbai bnbt".split(" ");
function getDefaultProvider(network, options) {
if (options == null) {
options = {};
}
const allowService = (name) => {
if (options[name] === "-") {
return false;
}
if (typeof (options.exclusive) === "string") {
return (name === options.exclusive);
}
if (Array.isArray(options.exclusive)) {
return (options.exclusive.indexOf(name) !== -1);
}
return true;
};
if (typeof (network) === "string" && network.match(/^https?:/)) {
return new JsonRpcProvider(network);
}
if (typeof (network) === "string" && network.match(/^wss?:/) || isWebSocketLike(network)) {
return new WebSocketProvider(network);
}
// Get the network and name, if possible
let staticNetwork = null;
try {
staticNetwork = Network.from(network);
}
catch (error) { }
const providers = [];
if (options.alchemy !== "-") {
if (allowService("publicPolygon") && staticNetwork) {
if (staticNetwork.name === "matic") {
providers.push(new JsonRpcProvider("https:/\/polygon-rpc.com/", staticNetwork, { staticNetwork }));
}
}
if (allowService("alchemy")) {
try {
providers.push(new AlchemyProvider(network, options.alchemy));
}
catch (error) { }
}
if (options.ankr !== "-" && options.ankr != null) {
if (allowService("ankr") && options.ankr != null) {
try {
providers.push(new AnkrProvider(network, options.ankr));
}
catch (error) { }
}
if (options.cloudflare !== "-") {
if (allowService("cloudflare")) {
try {
providers.push(new CloudflareProvider(network));
}
catch (error) { }
}
if (options.etherscan !== "-") {
if (allowService("etherscan")) {
try {
providers.push(new EtherscanProvider(network, options.etherscan));
}
catch (error) { }
}
if (options.infura !== "-") {
if (allowService("infura")) {
try {
let projectId = options.infura;
let projectSecret = undefined;
@ -21100,7 +21161,7 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
} catch (error) { console.log(error); }
}
*/
if (options.quicknode !== "-") {
if (allowService("quicknode")) {
try {
let token = options.quicknode;
providers.push(new QuickNodeProvider(network, token));
@ -21110,10 +21171,26 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
assert$1(providers.length, "unsupported default network", "UNSUPPORTED_OPERATION", {
operation: "getDefaultProvider"
});
// No need for a FallbackProvider
if (providers.length === 1) {
return providers[0];
}
return new FallbackProvider(providers);
// We use the floor because public third-party providers can be unreliable,
// so a low number of providers with a large quorum will fail too often
let quorum = Math.floor(providers.length / 2);
if (quorum > 2) {
quorum = 2;
}
// Testnets don't need as strong a security gaurantee and speed is
// more useful during testing
if (staticNetwork && Testnets.indexOf(staticNetwork.name) !== -1) {
quorum = 1;
}
// Provided override qorum takes priority
if (options && options.quorum) {
quorum = options.quorum;
}
return new FallbackProvider(providers, undefined, { quorum });
}
/**
@ -23431,6 +23508,7 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
FetchCancelSignal: FetchCancelSignal,
FetchRequest: FetchRequest,
FetchResponse: FetchResponse,
FetchUrlFeeDataNetworkPlugin: FetchUrlFeeDataNetworkPlugin,
FixedNumber: FixedNumber,
Fragment: Fragment,
FunctionFragment: FunctionFragment,
@ -23551,7 +23629,7 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
mask: mask,
namehash: namehash,
parseEther: parseEther,
parseUnits: parseUnits,
parseUnits: parseUnits$1,
pbkdf2: pbkdf2,
randomBytes: randomBytes,
recoverAddress: recoverAddress,
@ -23619,6 +23697,7 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
exports.FetchCancelSignal = FetchCancelSignal;
exports.FetchRequest = FetchRequest;
exports.FetchResponse = FetchResponse;
exports.FetchUrlFeeDataNetworkPlugin = FetchUrlFeeDataNetworkPlugin;
exports.FixedNumber = FixedNumber;
exports.Fragment = Fragment;
exports.FunctionFragment = FunctionFragment;
@ -23740,7 +23819,7 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
exports.mask = mask;
exports.namehash = namehash;
exports.parseEther = parseEther;
exports.parseUnits = parseUnits;
exports.parseUnits = parseUnits$1;
exports.pbkdf2 = pbkdf2;
exports.randomBytes = randomBytes;
exports.recoverAddress = recoverAddress;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -21,6 +21,8 @@ function setify(items) {
items.forEach((k) => result.add(k));
return Object.freeze(result);
}
const _kwVisibDeploy = "external public payable";
const KwVisibDeploy = setify(_kwVisibDeploy.split(" "));
// Visibility Keywords
const _kwVisib = "constant external internal payable private public pure view";
const KwVisib = setify(_kwVisib.split(" "));
@ -1029,7 +1031,7 @@ class ConstructorFragment extends Fragment {
else if (obj instanceof TokenString) {
consumeKeywords(obj, setify(["constructor"]));
const inputs = consumeParams(obj);
const payable = !!consumeKeywords(obj, setify(["payable"])).has("payable");
const payable = !!consumeKeywords(obj, KwVisibDeploy).has("payable");
const gas = consumeGas(obj);
consumeEoi(obj);
return new ConstructorFragment(_guard, "constructor", inputs, payable, gas);

File diff suppressed because one or more lines are too long

@ -1 +1 @@
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src.ts/contract/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAS,MAAM,iBAAiB,CAAC;AAInD,OAAO,EAAe,GAAG,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAMjF,OAAO,EAEH,2BAA2B,EAC3B,QAAQ,EACX,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,YAAY,EAAE,SAAS,EAAU,MAAM,iBAAiB,CAAC;AACxG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,K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,IAAI,CAAC;IAIjF;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,iBAAiB,EAAE,GAAG,EAAE,SAAS,GAAG,YAAY,GAAG,KAAK,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,cAAc,KAAK,YAAY,GAAG,IAAI,CAAC,CAAC,EAAE,MAAM,YAAY,CAAC;IAS3K;;OAEG;IACH,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,iBAAiB,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,GAAG,YAAY,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,cAAc,GAAG,YAAY,GAAG,IAAI,CAAC,CAAC,EAAE,MAAM,YAAY,CAAC;CAKhK;;AAMD;;GAEG;AACH,qBAAa,QAAS,SAAQ,aAAe;CAAI"}

@ -83,8 +83,11 @@ function getProvider(value) {
* @_ignore:
*/
async function copyOverrides(arg, allowed) {
// Make sure the overrides passed in are a valid overrides object
const _overrides = index_js_1.Typed.dereference(arg, "overrides");
(0, index_js_3.assertArgument)(typeof (_overrides) === "object", "invalid overrides parameter", "overrides", arg);
// Create a shallow copy (we'll deep-ify anything needed during normalizing)
const overrides = (0, provider_js_1.copyRequest)(index_js_1.Typed.dereference(arg, "overrides"));
const overrides = (0, provider_js_1.copyRequest)(_overrides);
(0, index_js_3.assertArgument)(overrides.to == null || (allowed || []).indexOf("to") >= 0, "cannot override to", "overrides.to", overrides.to);
(0, index_js_3.assertArgument)(overrides.data == null || (allowed || []).indexOf("data") >= 0, "cannot override data", "overrides.data", overrides.data);
// Resolve any from

File diff suppressed because one or more lines are too long

@ -1 +1 @@
{"version":3,"file":"wrappers.d.ts","sourceRoot":"","sources":["../../src.ts/contract/wrappers.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,EAAE,GAAG,EAAE,kBAAkB,EAAE,mBAAmB,EACtD,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAoB,YAAY,EA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,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,GAAG,QAAQ,EAAE,MAAM,EAAE,iBAAiB,EAAE,GAAG,EAAE,GAAG;IAKlG;;OAEG;IACG,QAAQ,IAAI,OAAO,CAAC,KAAK,CAAC;IAIhC;;OAEG;IACG,cAAc,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAIpD;;OAEG;IACG,qBAAqB,IAAI,OAAO,CAAC,kBAAkB,CAAC;CAG7D;AAED;;;GAGG;AACH,qBAAa,oBAAqB,SAAQ,2BAA2B;IAEjE;;OAEG;IACH,SAAiB,QAAQ,EAAE,aAAa,CAAC;IAEzC;;OAEG;IACH,SAAiB,GAAG,EAAE,QAAQ,CAAC;IAE/B;;OAEG;IACH,SAAiB,IAAI,EAAE,MAAM,CAAC;IAE9B;;OAEG;gBACS,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,GAAG,QAAQ,EAAE,MAAM,EAAE,iBAAiB,EAAE,QAAQ,EAAE,aAAa,EAAE,IAAI,EAAE,GAAG;IAM5H;;OAEG;IACH,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED;;OAEG;IACH,IAAI,cAAc,IAAI,MAAM,CAE3B;CACJ"}

@ -60,11 +60,12 @@ class ContractTransactionReceipt extends provider_js_1.TransactionReceipt {
return super.logs.map((log) => {
const fragment = log.topics.length ? this.#iface.getEvent(log.topics[0]) : null;
if (fragment) {
return new EventLog(log, this.#iface, fragment);
}
else {
return log;
try {
return new EventLog(log, this.#iface, fragment);
}
catch (error) { }
}
return log;
});
}
}

@ -1 +1 @@
{"version":3,"file":"wrappers.js","sourceRoot":"","sources":["../../src.ts/contract/wrappers.ts"],"names":[],"mappings":";;;AAAA,sEAAsE;AACtE,yBAAyB;AACzB,0DAEkC;AAClC,gDAAmE;AAWnE;;GAEG;AACH,MAAa,QAAS,SAAQ,iBAAG;IAC7B;;OAEG;IACM,SAAS,CAAa;IAE/B;;OAEG;IACM,QAAQ,CAAiB;IAElC;;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AE,MAAyB,EAAE,QAAuB,EAAE,IAAS;QACxH,KAAK,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;QACpF,MAAM,IAAI,GAAG,QAAQ,CAAC,SAAS,CAAC,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACzF,IAAA,2BAAgB,EAAuB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;IACrE,CAAC;IAED;;OAEG;IACH,IAAI,SAAS;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,IAAI,cAAc;QACd,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;IAClC,CAAC;CACJ;AAvCD,oDAuCC"}

@ -5,7 +5,7 @@ export { ZeroAddress, WeiPerEther, MaxUint256, MinInt256, MaxInt256, N, ZeroHash
export { BaseContract, Contract, ContractFactory, ContractEventPayload, ContractTransactionReceipt, ContractTransactionResponse, ContractUnknownEventPayload, EventLog, } from "./contract/index.js";
export { computeHmac, randomBytes, keccak256, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync, lock, Signature, SigningKey } from "./crypto/index.js";
export { id, ensNormalize, isValidName, namehash, dnsEncode, hashMessage, verifyMessage, solidityPacked, solidityPackedKeccak256, solidityPackedSha256, TypedDataEncoder, verifyTypedData } from "./hash/index.js";
export { getDefaultProvider, Block, FeeData, Log, TransactionReceipt, TransactionResponse, AbstractSigner, NonceManager, VoidSigner, AbstractProvider, FallbackProvider, JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, BrowserProvider, AlchemyProvider, AnkrProvider, CloudflareProvider, EtherscanProvider, InfuraProvider, InfuraWebSocketProvider, PocketProvider, QuickNodeProvider, IpcSocketProvider, SocketProvider, WebSocketProvider, EnsResolver, Network, EnsPlugin, EtherscanPlugin, FeeDataNetworkPlugin, GasCostPlugin, NetworkPlugin, MulticoinProviderPlugin, SocketBlockSubscriber, SocketEventSubscriber, SocketPendingSubscriber, SocketSubscriber, UnmanagedSubscriber, copyRequest, showThrottleMessage } from "./providers/index.js";
export { getDefaultProvider, Block, FeeData, Log, TransactionReceipt, TransactionResponse, AbstractSigner, NonceManager, VoidSigner, AbstractProvider, FallbackProvider, JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, BrowserProvider, AlchemyProvider, AnkrProvider, CloudflareProvider, EtherscanProvider, InfuraProvider, InfuraWebSocketProvider, PocketProvider, QuickNodeProvider, IpcSocketProvider, SocketProvider, WebSocketProvider, EnsResolver, Network, EnsPlugin, EtherscanPlugin, FeeDataNetworkPlugin, FetchUrlFeeDataNetworkPlugin, GasCostPlugin, NetworkPlugin, MulticoinProviderPlugin, SocketBlockSubscriber, SocketEventSubscriber, SocketPendingSubscriber, SocketSubscriber, UnmanagedSubscriber, copyRequest, showThrottleMessage } from "./providers/index.js";
export { accessListify, computeAddress, recoverAddress, Transaction } from "./transaction/index.js";
export { decodeBase58, encodeBase58, decodeBase64, encodeBase64, concat, dataLength, dataSlice, getBytes, getBytesCopy, hexlify, isHexString, isBytesLike, stripZerosLeft, zeroPadBytes, zeroPadValue, defineProperties, resolveProperties, assert, assertArgument, assertArgumentCount, assertNormalize, assertPrivate, makeError, isCallException, isError, EventPayload, FetchRequest, FetchResponse, FetchCancelSignal, FixedNumber, getBigInt, getNumber, getUint, toBeArray, toBigInt, toBeHex, toNumber, toQuantity, fromTwos, toTwos, mask, formatEther, parseEther, formatUnits, parseUnits, toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, decodeRlp, encodeRlp, uuidV4, } from "./utils/index.js";
export { Mnemonic, BaseWallet, HDNodeWallet, HDNodeVoidWallet, Wallet, defaultPath, getAccountPath, getIndexedAccountPath, isCrowdsaleJson, isKeystoreJson, decryptCrowdsaleJson, decryptKeystoreJsonSync, decryptKeystoreJson, encryptKeystoreJson, encryptKeystoreJsonSync, } from "./wallet/index.js";
@ -15,7 +15,7 @@ export type { Addressable, AddressLike, NameResolver } from "./address/index.js"
export type { ConstantContractMethod, ContractEvent, ContractEventArgs, ContractEventName, ContractInterface, ContractMethod, ContractMethodArgs, ContractTransaction, DeferredTopicFilter, Overrides, BaseContractMethod, ContractDeployTransaction, PostfixOverrides, WrappedFallback } from "./contract/index.js";
export type { ProgressCallback, SignatureLike } from "./crypto/index.js";
export type { TypedDataDomain, TypedDataField } from "./hash/index.js";
export type { Provider, Signer, AbstractProviderOptions, AbstractProviderPlugin, BlockParams, BlockTag, ContractRunner, DebugEventBrowserProvider, Eip1193Provider, EventFilter, Filter, FilterByBlockHash, GasCostParameters, JsonRpcApiProviderOptions, JsonRpcError, JsonRpcPayload, JsonRpcResult, JsonRpcTransactionRequest, LogParams, MinedBlock, MinedTransactionResponse, Networkish, OrphanFilter, PerformActionFilter, PerformActionRequest, PerformActionTransaction, PreparedTransactionRequest, ProviderEvent, Subscriber, Subscription, TopicFilter, TransactionReceiptParams, TransactionRequest, TransactionResponseParams, WebSocketCreator, WebSocketLike } from "./providers/index.js";
export type { Provider, Signer, AbstractProviderOptions, FallbackProviderOptions, AbstractProviderPlugin, BlockParams, BlockTag, ContractRunner, DebugEventBrowserProvider, Eip1193Provider, EventFilter, Filter, FilterByBlockHash, GasCostParameters, JsonRpcApiProviderOptions, JsonRpcError, JsonRpcPayload, JsonRpcResult, JsonRpcTransactionRequest, LogParams, MinedBlock, MinedTransactionResponse, Networkish, OrphanFilter, PerformActionFilter, PerformActionRequest, PerformActionTransaction, PreparedTransactionRequest, ProviderEvent, Subscriber, Subscription, TopicFilter, TransactionReceiptParams, TransactionRequest, TransactionResponseParams, WebSocketCreator, WebSocketLike } from "./providers/index.js";
export type { AccessList, AccessListish, AccessListEntry, TransactionLike } from "./transaction/index.js";
export type { BytesLike, BigNumberish, Numeric, ErrorCode, FixedFormat, Utf8ErrorFunc, UnicodeNormalizationForm, Utf8ErrorReason, RlpStructuredData, GetUrlResponse, FetchPreflightFunc, FetchProcessFunc, FetchRetryFunc, FetchGatewayFunc, FetchGetUrlFunc, EthersError, UnknownError, NotImplementedError, UnsupportedOperationError, NetworkError, ServerError, TimeoutError, BadDataError, CancelledError, BufferOverrunError, NumericFaultError, InvalidArgumentError, MissingArgumentError, UnexpectedArgumentError, CallExceptionError, InsufficientFundsError, NonceExpiredError, OffchainFaultError, ReplacementUnderpricedError, TransactionReplacedError, UnconfiguredNameError, ActionRejectedError, CodedEthersError, CallExceptionAction, CallExceptionTransaction, EventEmitterable, Listener } from "./utils/index.js";
export type { CrowdsaleAccount, KeystoreAccount, EncryptOptions } from "./wallet/index.js";

@ -1 +1 @@
{"version":3,"file":"ethers.d.ts","sourceRoot":"","sources":["../src.ts/ethers.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EACH,mBAAmB,EAAE,mBAAmB,EAExC,QAAQ,EACR,mBAAmB,EAAE,aAAa,EAAE,aAAa,EAAE,QAAQ,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,EAEzI,iBAAiB,EAAE,gBAAgB,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,sBAAsB,EACvG,KAAK,GACR,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACH,UAAU,EAAE,cAAc,EAC1B,gBAAgB,EAAE,iBAAiB,EACnC,aAAa,EAAE,SAAS,EAAE,cAAc,EAC3C,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACH,WAAW,EACX,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,EAChD,QAAQ,EACR,WAAW,EAAE,aAAa,EAC7B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACH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BAAwB,EAAE,qBAAqB,EAC5E,mBAAmB,EACnB,gBAAgB,EAEhB,mBAAmB,EAAE,wBAAwB,EAC7C,gBAAgB,EAAE,QAAQ,EAC7B,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EACR,gBAAgB,EAAE,eAAe,EAAE,cAAc,EACpD,MAAM,mBAAmB,CAAC"}

@ -4,8 +4,8 @@
Object.defineProperty(exports, "__esModule", { value: true });
exports.sha256 = exports.ripemd160 = exports.keccak256 = exports.randomBytes = exports.computeHmac = exports.EventLog = exports.ContractUnknownEventPayload = exports.ContractTransactionResponse = exports.ContractTransactionReceipt = exports.ContractEventPayload = exports.ContractFactory = exports.Contract = exports.BaseContract = exports.MessagePrefix = exports.EtherSymbol = exports.ZeroHash = exports.N = exports.MaxInt256 = exports.MinInt256 = exports.MaxUint256 = exports.WeiPerEther = exports.ZeroAddress = exports.resolveAddress = exports.isAddress = exports.isAddressable = exports.getCreate2Address = exports.getCreateAddress = exports.getIcapAddress = exports.getAddress = exports.Typed = exports.TransactionDescription = exports.Result = exports.LogDescription = exports.Interface = exports.Indexed = exports.ErrorDescription = exports.checkResultErrors = exports.StructFragment = exports.ParamType = exports.NamedFragment = exports.FunctionFragment = exports.FallbackFragment = exports.Fragment = exports.EventFragment = exports.ErrorFragment = exports.ConstructorFragment = exports.AbiCoder = exports.encodeBytes32String = exports.decodeBytes32String = exports.version = void 0;
exports.FeeDataNetworkPlugin = exports.EtherscanPlugin = exports.EnsPlugin = exports.Network = exports.EnsResolver = exports.WebSocketProvider = exports.SocketProvider = exports.IpcSocketProvider = exports.QuickNodeProvider = exports.PocketProvider = exports.InfuraWebSocketProvider = exports.InfuraProvider = exports.EtherscanProvider = exports.CloudflareProvider = exports.AnkrProvider = exports.AlchemyProvider = exports.BrowserProvider = exports.JsonRpcSigner = exports.JsonRpcProvider = exports.JsonRpcApiProvider = exports.FallbackProvider = exports.AbstractProvider = exports.VoidSigner = exports.NonceManager = exports.AbstractSigner = exports.TransactionResponse = exports.TransactionReceipt = exports.Log = exports.FeeData = exports.Block = exports.getDefaultProvider = exports.verifyTypedData = exports.TypedDataEncoder = exports.solidityPackedSha256 = exports.solidityPackedKeccak256 = exports.solidityPacked = exports.verifyMessage = exports.hashMessage = exports.dnsEncode = exports.namehash = exports.isValidName = exports.ensNormalize = exports.id = exports.SigningKey = exports.Signature = exports.lock = exports.scryptSync = exports.scrypt = exports.pbkdf2 = exports.sha512 = void 0;
exports.toBeHex = exports.toBigInt = exports.toBeArray = exports.getUint = exports.getNumber = exports.getBigInt = exports.FixedNumber = exports.FetchCancelSignal = exports.FetchResponse = exports.FetchRequest = exports.EventPayload = exports.isError = exports.isCallException = exports.makeError = exports.assertPrivate = exports.assertNormalize = exports.assertArgumentCount = exports.assertArgument = exports.assert = exports.resolveProperties = exports.defineProperties = exports.zeroPadValue = exports.zeroPadBytes = exports.stripZerosLeft = exports.isBytesLike = exports.isHexString = exports.hexlify = exports.getBytesCopy = exports.getBytes = exports.dataSlice = exports.dataLength = exports.concat = exports.encodeBase64 = exports.decodeBase64 = exports.encodeBase58 = exports.decodeBase58 = exports.Transaction = exports.recoverAddress = exports.computeAddress = exports.accessListify = exports.showThrottleMessage = exports.copyRequest = exports.UnmanagedSubscriber = exports.SocketSubscriber = exports.SocketPendingSubscriber = exports.SocketEventSubscriber = exports.SocketBlockSubscriber = exports.MulticoinProviderPlugin = exports.NetworkPlugin = exports.GasCostPlugin = void 0;
exports.wordlists = exports.WordlistOwlA = exports.WordlistOwl = exports.LangEn = exports.Wordlist = exports.encryptKeystoreJsonSync = exports.encryptKeystoreJson = exports.decryptKeystoreJson = exports.decryptKeystoreJsonSync = exports.decryptCrowdsaleJson = exports.isKeystoreJson = exports.isCrowdsaleJson = exports.getIndexedAccountPath = exports.getAccountPath = exports.defaultPath = exports.Wallet = exports.HDNodeVoidWallet = exports.HDNodeWallet = exports.BaseWallet = exports.Mnemonic = exports.uuidV4 = exports.encodeRlp = exports.decodeRlp = exports.Utf8ErrorFuncs = exports.toUtf8String = exports.toUtf8CodePoints = exports.toUtf8Bytes = exports.parseUnits = exports.formatUnits = exports.parseEther = exports.formatEther = exports.mask = exports.toTwos = exports.fromTwos = exports.toQuantity = exports.toNumber = void 0;
exports.toBigInt = exports.toBeArray = exports.getUint = exports.getNumber = exports.getBigInt = exports.FixedNumber = exports.FetchCancelSignal = exports.FetchResponse = exports.FetchRequest = exports.EventPayload = exports.isError = exports.isCallException = exports.makeError = exports.assertPrivate = exports.assertNormalize = exports.assertArgumentCount = exports.assertArgument = exports.assert = exports.resolveProperties = exports.defineProperties = exports.zeroPadValue = exports.zeroPadBytes = exports.stripZerosLeft = exports.isBytesLike = exports.isHexString = exports.hexlify = exports.getBytesCopy = exports.getBytes = exports.dataSlice = exports.dataLength = exports.concat = exports.encodeBase64 = exports.decodeBase64 = exports.encodeBase58 = exports.decodeBase58 = exports.Transaction = exports.recoverAddress = exports.computeAddress = exports.accessListify = exports.showThrottleMessage = exports.copyRequest = exports.UnmanagedSubscriber = exports.SocketSubscriber = exports.SocketPendingSubscriber = exports.SocketEventSubscriber = exports.SocketBlockSubscriber = exports.MulticoinProviderPlugin = exports.NetworkPlugin = exports.GasCostPlugin = exports.FetchUrlFeeDataNetworkPlugin = void 0;
exports.wordlists = exports.WordlistOwlA = exports.WordlistOwl = exports.LangEn = exports.Wordlist = exports.encryptKeystoreJsonSync = exports.encryptKeystoreJson = exports.decryptKeystoreJson = exports.decryptKeystoreJsonSync = exports.decryptCrowdsaleJson = exports.isKeystoreJson = exports.isCrowdsaleJson = exports.getIndexedAccountPath = exports.getAccountPath = exports.defaultPath = exports.Wallet = exports.HDNodeVoidWallet = exports.HDNodeWallet = exports.BaseWallet = exports.Mnemonic = exports.uuidV4 = exports.encodeRlp = exports.decodeRlp = exports.Utf8ErrorFuncs = exports.toUtf8String = exports.toUtf8CodePoints = exports.toUtf8Bytes = exports.parseUnits = exports.formatUnits = exports.parseEther = exports.formatEther = exports.mask = exports.toTwos = exports.fromTwos = exports.toQuantity = exports.toNumber = exports.toBeHex = void 0;
var _version_js_1 = require("./_version.js");
Object.defineProperty(exports, "version", { enumerable: true, get: function () { return _version_js_1.version; } });
var index_js_1 = require("./abi/index.js");
@ -114,6 +114,7 @@ Object.defineProperty(exports, "Network", { enumerable: true, get: function () {
Object.defineProperty(exports, "EnsPlugin", { enumerable: true, get: function () { return index_js_7.EnsPlugin; } });
Object.defineProperty(exports, "EtherscanPlugin", { enumerable: true, get: function () { return index_js_7.EtherscanPlugin; } });
Object.defineProperty(exports, "FeeDataNetworkPlugin", { enumerable: true, get: function () { return index_js_7.FeeDataNetworkPlugin; } });
Object.defineProperty(exports, "FetchUrlFeeDataNetworkPlugin", { enumerable: true, get: function () { return index_js_7.FetchUrlFeeDataNetworkPlugin; } });
Object.defineProperty(exports, "GasCostPlugin", { enumerable: true, get: function () { return index_js_7.GasCostPlugin; } });
Object.defineProperty(exports, "NetworkPlugin", { enumerable: true, get: function () { return index_js_7.NetworkPlugin; } });
Object.defineProperty(exports, "MulticoinProviderPlugin", { enumerable: true, get: function () { return index_js_7.MulticoinProviderPlugin; } });

@ -1 +1 @@
{"version":3,"file":"ethers.js","sourceRoot":"","sources":["../src.ts/ethers.ts"],"names":[],"mappings":";AAEA,6BAA6B;AAC7B,EAAE;;;;;;AAEF,6CAAwC;AAA/B,sGAAA,OAAO,OAAA;AAEhB,2CAQwB;AAPpB,+GAAA,mBAAmB,OAAA;AAAE,+GAAA,mBAAmB,OAAA;AAExC,oGAAA,QAAQ,OAAA;AACR,+GAAA,mBAAmB,OAAA;AAAE,yGAAA,aAAa,OAAA;AAAE,yGAAA,aAAa,OAAA;AAAE,oGAAA,QAAQ,OAAA;AAAE,4GAAA,gBAAgB,OAAA;AAAE,4GAAA,gBAAgB,OAAA;AAAE,yGAAA,aAAa,OAAA;AAAE,qGAAA,SAAS,OAAA;AAAE,0GAAA,cAAc,OAAA;AAEzI,6GAAA,iBAAiB,OAAA;AAAE,4GAAA,gBAAgB,OAAA;AAAE,mG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AbstractProvider** provides a base class for other sub-classes to
@ -254,6 +255,7 @@ export declare class AbstractProvider implements Provider {
* [[Network]] if necessary.
*/
constructor(_network?: "any" | Networkish, options?: AbstractProviderOptions);
get pollingInterval(): number;
/**
* Returns ``this``, to allow an **AbstractProvider** to implement
* the [[ContractRunner]] interface.

File diff suppressed because one or more lines are too long

@ -154,7 +154,8 @@ async function getSubscription(_event, provider) {
}
function getTime() { return (new Date()).getTime(); }
const defaultOptions = {
cacheTimeout: 250
cacheTimeout: 250,
pollingInterval: 4000
};
/**
* An **AbstractProvider** provides a base class for other sub-classes to
@ -208,6 +209,7 @@ class AbstractProvider {
this.#timers = new Map();
this.#disableCcipRead = false;
}
get pollingInterval() { return this.#options.pollingInterval; }
/**
* Returns ``this``, to allow an **AbstractProvider** to implement
* the [[ContractRunner]] interface.
@ -577,31 +579,36 @@ class AbstractProvider {
return expected.clone();
}
async getFeeData() {
const { block, gasPrice } = await (0, index_js_6.resolveProperties)({
block: this.getBlock("latest"),
gasPrice: ((async () => {
try {
const gasPrice = await this.#perform({ method: "getGasPrice" });
return (0, index_js_6.getBigInt)(gasPrice, "%response");
}
catch (error) { }
return null;
})())
});
let maxFeePerGas = null, maxPriorityFeePerGas = null;
if (block && block.baseFeePerGas) {
// We may want to compute this more accurately in the future,
// using the formula "check if the base fee is correct".
// See: https://eips.ethereum.org/EIPS/eip-1559
maxPriorityFeePerGas = BigInt("1000000000");
// Allow a network to override their maximum priority fee per gas
//const priorityFeePlugin = (await this.getNetwork()).getPlugin<MaxPriorityFeePlugin>("org.ethers.plugins.max-priority-fee");
//if (priorityFeePlugin) {
// maxPriorityFeePerGas = await priorityFeePlugin.getPriorityFee(this);
//}
maxFeePerGas = (block.baseFeePerGas * BN_2) + maxPriorityFeePerGas;
const network = await this.getNetwork();
const getFeeDataFunc = async () => {
const { _block, gasPrice } = await (0, index_js_6.resolveProperties)({
_block: this.#getBlock("latest", false),
gasPrice: ((async () => {
try {
const gasPrice = await this.#perform({ method: "getGasPrice" });
return (0, index_js_6.getBigInt)(gasPrice, "%response");
}
catch (error) { }
return null;
})())
});
let maxFeePerGas = null, maxPriorityFeePerGas = null;
// These are the recommended EIP-1559 heuristics for fee data
const block = this._wrapBlock(_block, network);
if (block && block.baseFeePerGas) {
maxPriorityFeePerGas = BigInt("1000000000");
maxFeePerGas = (block.baseFeePerGas * BN_2) + maxPriorityFeePerGas;
}
return new provider_js_1.FeeData(gasPrice, maxFeePerGas, maxPriorityFeePerGas);
};
// Check for a FeeDataNetWorkPlugin
const plugin = network.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");
if (plugin) {
const req = new index_js_6.FetchRequest(plugin.url);
const feeData = await plugin.processFunc(getFeeDataFunc, this, req);
return new provider_js_1.FeeData(feeData.gasPrice, feeData.maxFeePerGas, feeData.maxPriorityFeePerGas);
}
return new provider_js_1.FeeData(gasPrice, maxFeePerGas, maxPriorityFeePerGas);
return await getFeeDataFunc();
}
async estimateGas(_tx) {
let tx = this._getTransactionRequest(_tx);
@ -962,8 +969,11 @@ class AbstractProvider {
case "error":
case "network":
return new UnmanagedSubscriber(sub.type);
case "block":
return new subscriber_polling_js_1.PollingBlockSubscriber(this);
case "block": {
const subscriber = new subscriber_polling_js_1.PollingBlockSubscriber(this);
subscriber.pollingInterval = this.pollingInterval;
return subscriber;
}
case "event":
return new subscriber_polling_js_1.PollingEventSubscriber(this, sub.filter);
case "transaction":

File diff suppressed because one or more lines are too long

@ -1 +1 @@
{"version":3,"file":"default-provider.d.ts","sourceRoot":"","sources":["../../src.ts/providers/default-provider.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAOxD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,aAAa,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,gBAAgB,CA6EhH"}
{"version":3,"file":"default-provider.d.ts","sourceRoot":"","sources":["../../src.ts/providers/default-provider.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AASxD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,aAAa,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,gBAAgB,CAkHhH"}

@ -11,47 +11,72 @@ const provider_infura_js_1 = require("./provider-infura.js");
const provider_quicknode_js_1 = require("./provider-quicknode.js");
const provider_fallback_js_1 = require("./provider-fallback.js");
const provider_jsonrpc_js_1 = require("./provider-jsonrpc.js");
const network_js_1 = require("./network.js");
const provider_websocket_js_1 = require("./provider-websocket.js");
function isWebSocketLike(value) {
return (value && typeof (value.send) === "function" &&
typeof (value.close) === "function");
}
const Testnets = "goerli kovan sepolia classicKotti optimism-goerli arbitrum-goerli matic-mumbai bnbt".split(" ");
function getDefaultProvider(network, options) {
if (options == null) {
options = {};
}
const allowService = (name) => {
if (options[name] === "-") {
return false;
}
if (typeof (options.exclusive) === "string") {
return (name === options.exclusive);
}
if (Array.isArray(options.exclusive)) {
return (options.exclusive.indexOf(name) !== -1);
}
return true;
};
if (typeof (network) === "string" && network.match(/^https?:/)) {
return new provider_jsonrpc_js_1.JsonRpcProvider(network);
}
if (typeof (network) === "string" && network.match(/^wss?:/) || isWebSocketLike(network)) {
return new provider_websocket_js_1.WebSocketProvider(network);
}
// Get the network and name, if possible
let staticNetwork = null;
try {
staticNetwork = network_js_1.Network.from(network);
}
catch (error) { }
const providers = [];
if (options.alchemy !== "-") {
if (allowService("publicPolygon") && staticNetwork) {
if (staticNetwork.name === "matic") {
providers.push(new provider_jsonrpc_js_1.JsonRpcProvider("https:/\/polygon-rpc.com/", staticNetwork, { staticNetwork }));
}
}
if (allowService("alchemy")) {
try {
providers.push(new provider_alchemy_js_1.AlchemyProvider(network, options.alchemy));
}
catch (error) { }
}
if (options.ankr !== "-" && options.ankr != null) {
if (allowService("ankr") && options.ankr != null) {
try {
providers.push(new provider_ankr_js_1.AnkrProvider(network, options.ankr));
}
catch (error) { }
}
if (options.cloudflare !== "-") {
if (allowService("cloudflare")) {
try {
providers.push(new provider_cloudflare_js_1.CloudflareProvider(network));
}
catch (error) { }
}
if (options.etherscan !== "-") {
if (allowService("etherscan")) {
try {
providers.push(new provider_etherscan_js_1.EtherscanProvider(network, options.etherscan));
}
catch (error) { }
}
if (options.infura !== "-") {
if (allowService("infura")) {
try {
let projectId = options.infura;
let projectSecret = undefined;
@ -78,7 +103,7 @@ function getDefaultProvider(network, options) {
} catch (error) { console.log(error); }
}
*/
if (options.quicknode !== "-") {
if (allowService("quicknode")) {
try {
let token = options.quicknode;
providers.push(new provider_quicknode_js_1.QuickNodeProvider(network, token));
@ -88,10 +113,26 @@ function getDefaultProvider(network, options) {
(0, index_js_1.assert)(providers.length, "unsupported default network", "UNSUPPORTED_OPERATION", {
operation: "getDefaultProvider"
});
// No need for a FallbackProvider
if (providers.length === 1) {
return providers[0];
}
return new provider_fallback_js_1.FallbackProvider(providers);
// We use the floor because public third-party providers can be unreliable,
// so a low number of providers with a large quorum will fail too often
let quorum = Math.floor(providers.length / 2);
if (quorum > 2) {
quorum = 2;
}
// Testnets don't need as strong a security gaurantee and speed is
// more useful during testing
if (staticNetwork && Testnets.indexOf(staticNetwork.name) !== -1) {
quorum = 1;
}
// Provided override qorum takes priority
if (options && options.quorum) {
quorum = options.quorum;
}
return new provider_fallback_js_1.FallbackProvider(providers, undefined, { quorum });
}
exports.getDefaultProvider = getDefaultProvider;
//# sourceMappingURL=default-provider.js.map

@ -1 +1 @@
{"version":3,"file":"default-provider.js","sourceRoot":"","sources":["../../src.ts/providers/default-provider.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AAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;QAAE,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC;KAAE;IAEpD,2EAA2E;IAC3E,uEAAuE;IACvE,IAAI,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC9C,IAAI,MAAM,GAAG,CAAC,EAAE;QAAE,MAAM,GAAG,CAAC,CAAC;KAAE;IAE/B,kEAAkE;IAClE,6BAA6B;IAC7B,IAAI,aAAa,IAAI,QAAQ,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE;QAAE,MAAM,GAAG,CAAC,CAAC;KAAE;IAEjF,yCAAyC;IACzC,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE;QAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;KAAE;IAE3D,OAAO,IAAI,uCAAgB,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;AAClE,CAAC;AAlHD,gDAkHC"}

@ -16,7 +16,7 @@ export { getDefaultProvider } from "./default-provider.js";
export { EnsResolver, MulticoinProviderPlugin } from "./ens-resolver.js";
export { Network } from "./network.js";
export { NonceManager } from "./signer-noncemanager.js";
export { NetworkPlugin, GasCostPlugin, EnsPlugin, FeeDataNetworkPlugin, } from "./plugins-network.js";
export { NetworkPlugin, GasCostPlugin, EnsPlugin, FeeDataNetworkPlugin, FetchUrlFeeDataNetworkPlugin, } from "./plugins-network.js";
export { Block, FeeData, Log, TransactionReceipt, TransactionResponse, copyRequest, } from "./provider.js";
export { FallbackProvider } from "./provider-fallback.js";
export { JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner } from "./provider-jsonrpc.js";
@ -40,6 +40,7 @@ export type { Networkish } from "./network.js";
export type { GasCostParameters } from "./plugins-network.js";
export type { BlockTag, TransactionRequest, PreparedTransactionRequest, EventFilter, Filter, FilterByBlockHash, OrphanFilter, ProviderEvent, TopicFilter, Provider, MinedBlock, MinedTransactionResponse } from "./provider.js";
export type { DebugEventBrowserProvider, Eip1193Provider } from "./provider-browser.js";
export type { FallbackProviderOptions } from "./provider-fallback.js";
export type { JsonRpcPayload, JsonRpcResult, JsonRpcError, JsonRpcApiProviderOptions, JsonRpcTransactionRequest, } from "./provider-jsonrpc.js";
export type { WebSocketCreator, WebSocketLike } from "./provider-websocket.js";
export type { Signer } from "./signer.js";

@ -1 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/providers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EACH,gBAAgB,EAAE,mBAAmB,EACxC,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACH,cAAc,EACd,UAAU,GACb,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACH,mBAAmB,EACtB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EACH,WAAW,EACX,uBAAuB,EAC1B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EACH,aAAa,EACb,aAAa,EACb,SAAS,EACT,oBAAoB,GACvB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACH,KAAK,EACL,OAAO,EACP,GAAG,EACH,kBAAkB,EAClB,mBAAmB,EAEnB,WAAW,GAEd,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAE1F,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,O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AAE/B,YAAY,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEtE,YAAY,EACR,cAAc,EAAE,aAAa,EAAE,YAAY,EAC3C,yBAAyB,EACzB,yBAAyB,GAC5B,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EACR,gBAAgB,EAAE,aAAa,EAClC,MAAM,yBAAyB,CAAC;AAEjC,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"}

@ -11,7 +11,7 @@
* @_section: api/providers:Providers [about-providers]
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.SocketEventSubscriber = exports.SocketPendingSubscriber = exports.SocketBlockSubscriber = exports.SocketSubscriber = exports.WebSocketProvider = exports.SocketProvider = exports.IpcSocketProvider = exports.QuickNodeProvider = exports.PocketProvider = exports.InfuraWebSocketProvider = exports.InfuraProvider = exports.EtherscanPlugin = exports.EtherscanProvider = exports.CloudflareProvider = exports.AnkrProvider = exports.AlchemyProvider = exports.BrowserProvider = exports.JsonRpcSigner = exports.JsonRpcProvider = exports.JsonRpcApiProvider = exports.FallbackProvider = exports.copyRequest = exports.TransactionResponse = exports.TransactionReceipt = exports.Log = exports.FeeData = exports.Block = exports.FeeDataNetworkPlugin = exports.EnsPlugin = exports.GasCostPlugin = exports.NetworkPlugin = exports.NonceManager = exports.Network = exports.MulticoinProviderPlugin = exports.EnsResolver = exports.getDefaultProvider = exports.showThrottleMessage = exports.VoidSigner = exports.AbstractSigner = exports.UnmanagedSubscriber = exports.AbstractProvider = void 0;
exports.SocketEventSubscriber = exports.SocketPendingSubscriber = exports.SocketBlockSubscriber = exports.SocketSubscriber = exports.WebSocketProvider = exports.SocketProvider = exports.IpcSocketProvider = exports.QuickNodeProvider = exports.PocketProvider = exports.InfuraWebSocketProvider = exports.InfuraProvider = exports.EtherscanPlugin = exports.EtherscanProvider = exports.CloudflareProvider = exports.AnkrProvider = exports.AlchemyProvider = exports.BrowserProvider = exports.JsonRpcSigner = exports.JsonRpcProvider = exports.JsonRpcApiProvider = exports.FallbackProvider = exports.copyRequest = exports.TransactionResponse = exports.TransactionReceipt = exports.Log = exports.FeeData = exports.Block = exports.FetchUrlFeeDataNetworkPlugin = exports.FeeDataNetworkPlugin = exports.EnsPlugin = exports.GasCostPlugin = exports.NetworkPlugin = exports.NonceManager = exports.Network = exports.MulticoinProviderPlugin = exports.EnsResolver = exports.getDefaultProvider = exports.showThrottleMessage = exports.VoidSigner = exports.AbstractSigner = exports.UnmanagedSubscriber = exports.AbstractProvider = void 0;
var abstract_provider_js_1 = require("./abstract-provider.js");
Object.defineProperty(exports, "AbstractProvider", { enumerable: true, get: function () { return abstract_provider_js_1.AbstractProvider; } });
Object.defineProperty(exports, "UnmanagedSubscriber", { enumerable: true, get: function () { return abstract_provider_js_1.UnmanagedSubscriber; } });
@ -34,6 +34,7 @@ Object.defineProperty(exports, "NetworkPlugin", { enumerable: true, get: functio
Object.defineProperty(exports, "GasCostPlugin", { enumerable: true, get: function () { return plugins_network_js_1.GasCostPlugin; } });
Object.defineProperty(exports, "EnsPlugin", { enumerable: true, get: function () { return plugins_network_js_1.EnsPlugin; } });
Object.defineProperty(exports, "FeeDataNetworkPlugin", { enumerable: true, get: function () { return plugins_network_js_1.FeeDataNetworkPlugin; } });
Object.defineProperty(exports, "FetchUrlFeeDataNetworkPlugin", { enumerable: true, get: function () { return plugins_network_js_1.FetchUrlFeeDataNetworkPlugin; } });
var provider_js_1 = require("./provider.js");
Object.defineProperty(exports, "Block", { enumerable: true, get: function () { return provider_js_1.Block; } });
Object.defineProperty(exports, "FeeData", { enumerable: true, get: function () { return provider_js_1.FeeData; } });

@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/providers/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAGH,+DAEgC;AAD5B,wHAAA,gBAAgB,OAAA;AAAE,2HAAA,mBAAmB,OAAA;AAGzC,2DAG8B;AAF1B,oHAAA,cAAc,OAAA;AACd,gHAAA,UAAU,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}
}
*/
/* * * *
export class PriceOraclePlugin extends NetworkPlugin {
readonly address!: string;
constructor(address: string) {
super("org.ethers.plugins.price-oracle");
defineProperties<PriceOraclePlugin>(this, { address });
}
clone(): PriceOraclePlugin {
return new PriceOraclePlugin(this.address);
}
}
*/
// Networks or clients with a higher need for security (such as clients
// that may automatically make CCIP requests without user interaction)
// can use this plugin to anonymize requests or intercept CCIP requests
// to notify and/or receive authorization from the user
/* * * *
export type FetchDataFunc = (req: Frozen<FetchRequest>) => Promise<FetchRequest>;
export class CcipPreflightPlugin extends NetworkPlugin {
readonly fetchData!: FetchDataFunc;
constructor(fetchData: FetchDataFunc) {
super("org.ethers.plugins.ccip-preflight");
defineProperties<CcipPreflightPlugin>(this, { fetchData });
}
clone(): CcipPreflightPlugin {
return new CcipPreflightPlugin(this.fetchData);
}
}
*/
const Networks = new Map();
// @TODO: Add a _ethersNetworkObj variable to better detect network ovjects
/**
* A **Network** provides access to a chain's properties and allows
* for plug-ins to extend functionality.
@ -269,6 +235,53 @@ class Network {
}
}
exports.Network = Network;
// We don't want to bring in formatUnits because it is backed by
// FixedNumber and we want to keep Networks tiny. The values
// included by the Gas Stations are also IEEE 754 with lots of
// rounding issues and exceed the strict checks formatUnits has.
function parseUnits(_value, decimals) {
const value = String(_value);
if (!value.match(/^[0-9.]+$/)) {
throw new Error(`invalid gwei value: ${_value}`);
}
// Break into [ whole, fraction ]
const comps = value.split(".");
if (comps.length === 1) {
comps.push("");
}
// More than 1 decimal point or too many fractional positions
if (comps.length !== 2) {
throw new Error(`invalid gwei value: ${_value}`);
}
// Pad the fraction to 9 decimalplaces
while (comps[1].length < decimals) {
comps[1] += "0";
}
// Too many decimals and some non-zero ending, take the ceiling
if (comps[1].length > 9 && !comps[1].substring(9).match(/^0+$/)) {
comps[1] = (BigInt(comps[1].substring(0, 9)) + BigInt(1)).toString();
}
return BigInt(comps[0] + comps[1]);
}
function getGasStationPlugin(url) {
return new plugins_network_js_1.FetchUrlFeeDataNetworkPlugin(url, async (fetchFeeData, provider, request) => {
// Prevent Cloudflare from blocking our request in node.js
request.setHeader("User-Agent", "ethers");
let response;
try {
response = await request.send();
const payload = response.bodyJson.standard;
const feeData = {
maxFeePerGas: parseUnits(payload.maxFee, 9),
maxPriorityFeePerGas: parseUnits(payload.maxPriorityFee, 9),
};
return feeData;
}
catch (error) {
(0, index_js_2.assert)(false, `error encountered with polygon gas station (${JSON.stringify(request.url)})`, "SERVER_ERROR", { request, response, error });
}
});
}
// See: https://chainlist.org
let injected = false;
function injectCommonNetworks() {
@ -284,16 +297,10 @@ function injectCommonNetworks() {
if (options.ensNetwork != null) {
network.attachPlugin(new plugins_network_js_1.EnsPlugin(null, options.ensNetwork));
}
if (options.priorityFee) {
// network.attachPlugin(new MaxPriorityFeePlugin(options.priorityFee));
}
/*
if (options.etherscan) {
const { url, apiKey } = options.etherscan;
network.attachPlugin(new EtherscanPlugin(url, apiKey));
}
*/
network.attachPlugin(new plugins_network_js_1.GasCostPlugin());
(options.plugins || []).forEach((plugin) => {
network.attachPlugin(plugin);
});
return network;
};
// Register the network by name and chain ID
@ -313,50 +320,30 @@ function injectCommonNetworks() {
registerEth("sepolia", 11155111, {});
registerEth("classic", 61, {});
registerEth("classicKotti", 6, {});
registerEth("xdai", 100, { ensNetwork: 1 });
registerEth("optimism", 10, {
ensNetwork: 1,
etherscan: { url: "https:/\/api-optimistic.etherscan.io/" }
});
registerEth("optimism-goerli", 420, {
etherscan: { url: "https:/\/api-goerli-optimistic.etherscan.io/" }
});
registerEth("arbitrum", 42161, {
ensNetwork: 1,
etherscan: { url: "https:/\/api.arbiscan.io/" }
});
registerEth("arbitrum-goerli", 421613, {
etherscan: { url: "https:/\/api-goerli.arbiscan.io/" }
});
// Polygon has a 35 gwei maxPriorityFee requirement
registerEth("arbitrum-goerli", 421613, {});
registerEth("bnb", 56, { ensNetwork: 1 });
registerEth("bnbt", 97, {});
registerEth("linea", 59144, { ensNetwork: 1 });
registerEth("linea-goerli", 59140, {});
registerEth("matic", 137, {
ensNetwork: 1,
// priorityFee: 35000000000,
etherscan: {
// apiKey: "W6T8DJW654GNTQ34EFEYYP3EZD9DD27CT7",
url: "https:/\/api.polygonscan.com/"
}
plugins: [
getGasStationPlugin("https:/\/gasstation.polygon.technology/v2")
]
});
registerEth("matic-mumbai", 80001, {
altNames: ["maticMumbai", "maticmum"],
// priorityFee: 35000000000,
etherscan: {
// apiKey: "W6T8DJW654GNTQ34EFEYYP3EZD9DD27CT7",
url: "https:/\/api-testnet.polygonscan.com/"
}
plugins: [
getGasStationPlugin("https:/\/gasstation-testnet.polygon.technology/v2")
]
});
registerEth("bnb", 56, {
registerEth("optimism", 10, {
ensNetwork: 1,
etherscan: {
// apiKey: "EVTS3CU31AATZV72YQ55TPGXGMVIFUQ9M9",
url: "http:/\/api.bscscan.com"
}
});
registerEth("bnbt", 97, {
etherscan: {
// apiKey: "EVTS3CU31AATZV72YQ55TPGXGMVIFUQ9M9",
url: "http:/\/api-testnet.bscscan.com"
}
});
registerEth("optimism-goerli", 420, {});
registerEth("xdai", 100, { ensNetwork: 1 });
}
//# sourceMappingURL=network.js.map

File diff suppressed because one or more lines are too long

@ -1,4 +1,5 @@
import type { FeeData, Provider } from "./provider.js";
import type { FetchRequest } from "../utils/fetch.js";
/**
* A **NetworkPlugin** provides additional functionality on a [[Network]].
*/
@ -141,4 +142,19 @@ export declare class FeeDataNetworkPlugin extends NetworkPlugin {
getFeeData(provider: Provider): Promise<FeeData>;
clone(): FeeDataNetworkPlugin;
}
export declare class FetchUrlFeeDataNetworkPlugin extends NetworkPlugin {
#private;
get url(): string;
get processFunc(): (f: () => Promise<FeeData>, p: Provider, r: FetchRequest) => Promise<{
gasPrice?: bigint | null | undefined;
maxFeePerGas?: bigint | null | undefined;
maxPriorityFeePerGas?: bigint | null | undefined;
}>;
constructor(url: string, processFunc: (f: () => Promise<FeeData>, p: Provider, r: FetchRequest) => Promise<{
gasPrice?: null | bigint;
maxFeePerGas?: null | bigint;
maxPriorityFeePerGas?: null | bigint;
}>);
clone(): FetchUrlFeeDataNetworkPlugin;
}
//# sourceMappingURL=plugins-network.d.ts.map

@ -1 +1 @@
{"version":3,"file":"plugins-network.d.ts","sourceRoot":"","sources":["../../src.ts/providers/plugins-network.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACR,OAAO,EAAE,QAAQ,EACpB,MAAM,eAAe,CAAC;AAMvB;;GAEG;AACH,qBAAa,aAAa;IACtB;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;IAEvB;;OAEG;gBACS,IAAI,EAAE,MAAM;IAIxB;;OAEG;IACH,KAAK,IAAI,aAAa;CAOzB;AAGD;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC5B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAEhC;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAChC,CAAC;AAEF;;;GAGG;AACH,qBAAa,aAAc,SAAQ,aAAc,YAAW,iBAAiB;IACzE;;;;;OAKG;IACH,QAAQ,CAAC,cAAc,EAAG,MAAM,CAAC;IAEjC;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;IAEzB;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAG,MAAM,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAG,MAAM,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,aAAa,EAAG,MAAM,CAAC;IAEhC;;OAEG;IACH,QAAQ,CAAC,sBAAsB,EAAG,MAAM,CAAC;IAEzC;;OAEG;IACH,QAAQ,CAAC,mBAAmB,EAAG,MAAM,CA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I,CAAC,QAAQ,EAAE,QAAQ,KAAK,OAAO,CAAC,OAAO,CAAC,CAE1D;IAED;;OAEG;gBACS,WAAW,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,OAAO,CAAC,OAAO,CAAC;IAKjE;;OAEG;IACG,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;IAItD,KAAK,IAAI,oBAAoB;CAGhC;AAED,qBAAa,4BAA6B,SAAQ,aAAa;;IAI3D,IAAI,GAAG,WAAwB;IAC/B,IAAI,WAAW;;;;OAAgC;gBAEnC,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,YAAY,KAAK,OAAO,CAAC;QAAE,QAAQ,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;QAAC,oBAAoB,CAAC,EAAE,IAAI,GAAG,MAAM,CAAA;KAAE,CAAC;IAO5M,KAAK,IAAI,4BAA4B;CACxC"}

@ -1,6 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FeeDataNetworkPlugin = exports.EnsPlugin = exports.GasCostPlugin = exports.NetworkPlugin = void 0;
exports.FetchUrlFeeDataNetworkPlugin = exports.FeeDataNetworkPlugin = exports.EnsPlugin = exports.GasCostPlugin = exports.NetworkPlugin = void 0;
const properties_js_1 = require("../utils/properties.js");
const index_js_1 = require("../utils/index.js");
const EnsAddress = "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";
@ -165,6 +165,20 @@ class FeeDataNetworkPlugin extends NetworkPlugin {
}
}
exports.FeeDataNetworkPlugin = FeeDataNetworkPlugin;
class FetchUrlFeeDataNetworkPlugin extends NetworkPlugin {
#url;
#processFunc;
get url() { return this.#url; }
get processFunc() { return this.#processFunc; }
constructor(url, processFunc) {
super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");
this.#url = url;
this.#processFunc = processFunc;
}
// We are immutable, so we can serve as our own clone
clone() { return this; }
}
exports.FetchUrlFeeDataNetworkPlugin = FetchUrlFeeDataNetworkPlugin;
/*
export class CustomBlockNetworkPlugin extends NetworkPlugin {
readonly #blockFunc: (provider: Provider, block: BlockParams<string>) => Block<string>;

@ -1 +1 @@
{"version":3,"file":"plugins-network.js","sourceRoot":"","sources":["../../src.ts/providers/plugins-network.ts"],"names":[],"mappings":";;;AAAA,0DAA0D;AAE1D,gDAAmD;AAQnD,MAAM,UAAU,GAAG,4CAA4C,CAAC;AAEhE;;GAEG;AACH,MAAa,aAAa;IACtB;;;;;OAKG;IACM,IAAI,CAAU;IAEvB;;OAEG;IACH,YAAY,IAAY;QACpB,IAAA,gCAAgB,EAAgB,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;IACpD,CAAC;IAED;;OAEG;IACH,KAAK;QACD,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;CAKJ;AA1BD,sCA0BC;AAsCD;;;GAGG;AACH,MAAa,aAAc,SAAQ,aAAa;IAC5C;;;;;OAKG;IACM,cAAc,CAAU;IAEjC;;OAEG;IACM,MAAM,CAAU;IAEzB;;OAEG;IACM,QAAQ,CAAU;IAE3B;;OAEG;IACM,UAAU,CAAU;IAE7B;;OAEG;IACM,aAAa,CAAU;IAEhC;;OAEG;IACM,sBAAsB,CAAU;IAEzC;;OAEG;IACM,mBAAmB,CAAU;IAGtC;;;;OAIG;IACH,YAAY,cAAuB,EAAE,KAAyB;QAC1D,IAAI,cAAc,IAAI,IAAI,EAAE;YAAE,cAAc,GAAG,CAAC,CAAC;SAAE;QACnD,KAAK,CAAC,sCAAuC,CAAC,cAAc,IAAI,CAAC,CAAE,EAAE,CAAC,CAAC;QAEvE,MAAM,KAAK,GAA2B,EAAE,cAAc,EAAE,CAAC;QACzD,SAAS,GAAG,CAAC,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,GAAG,KAAK;IAiEvE,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;IAIlC,QAAQ,CAAC,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC;IAiKjD,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC;IAIpC;;;;OAIG;IACG,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC;IAKtC;;;OAGG;IACG,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,QAAQ,CAAC;IAc7D,mBAAmB,IAAI,OAAO;CAGjC"}

@ -121,6 +121,10 @@ class EtherscanProvider extends abstract_provider_js_1.AbstractProvider {
return "https:/\/api-optimistic.etherscan.io";
case "optimism-goerli":
return "https:/\/api-goerli-optimistic.etherscan.io";
case "bnb":
return "http:/\/api.bscscan.com";
case "bnbt":
return "http:/\/api-testnet.bscscan.com";
default:
}
(0, index_js_4.assertArgument)(false, "unsupported network", "network", this.network);

File diff suppressed because one or more lines are too long

@ -67,9 +67,11 @@ export interface FallbackProviderState extends Required<FallbackProviderConfig>
* Additional options to configure a [[FallbackProvider]].
*/
export type FallbackProviderOptions = {
quorum: number;
eventQuorum: number;
eventWorkers: number;
quorum?: number;
eventQuorum?: number;
eventWorkers?: number;
cacheTimeout?: number;
pollingInterval?: number;
};
/**
* A **FallbackProvider** manages several [[Providers]] providing
@ -100,7 +102,7 @@ export declare class FallbackProvider extends AbstractProvider {
* If a [[Provider]] is included in %%providers%%, defaults are used
* for the configuration.
*/
constructor(providers: Array<AbstractProvider | FallbackProviderConfig>, network?: Networkish);
constructor(providers: Array<AbstractProvider | FallbackProviderConfig>, network?: Networkish, options?: FallbackProviderOptions);
get providerConfigs(): Array<FallbackProviderState>;
_detectNetwork(): Promise<Network>;
/**

@ -1 +1 @@
{"version":3,"file":"provider-fallback.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-fallback.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,gBAAgB,EAAE,MAA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{
* If a [[Provider]] is included in %%providers%%, defaults are used
* for the configuration.
*/
constructor(providers, network) {
super(network);
constructor(providers, network, options) {
super(network, options);
this.#configs = providers.map((p) => {
if (p instanceof abstract_provider_js_1.AbstractProvider) {
return Object.assign({ provider: p }, defaultConfig, defaultState);
@ -245,7 +245,15 @@ class FallbackProvider extends abstract_provider_js_1.AbstractProvider {
});
this.#height = -2;
this.#initialSyncPromise = null;
this.quorum = 2; //Math.ceil(providers.length / 2);
if (options && options.quorum != null) {
this.quorum = options.quorum;
}
else {
this.quorum = Math.ceil(this.#configs.reduce((accum, config) => {
accum += config.weight;
return accum;
}, 0) / 2);
}
this.eventQuorum = 1;
this.eventWorkers = 1;
(0, index_js_1.assertArgument)(this.quorum <= this.#configs.reduce((a, c) => (a + c.weight), 0), "quorum exceed provider wieght", "quorum", this.quorum);
@ -317,7 +325,7 @@ class FallbackProvider extends abstract_provider_js_1.AbstractProvider {
// Shuffle the states, sorted by priority
const allConfigs = this.#configs.slice();
shuffle(allConfigs);
allConfigs.sort((a, b) => (b.priority - a.priority));
allConfigs.sort((a, b) => (a.priority - b.priority));
for (const config of allConfigs) {
if (config._lastFatalError) {
continue;

File diff suppressed because one or more lines are too long

@ -1 +1 @@
{"version":3,"file":"provider-infura.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-infura.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EACe,YAAY,EACjC,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MA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IAAI,GAAG,MAAM,GAAG,YAAY;CAiB9G"}

@ -37,6 +37,10 @@ function getHost(name) {
return "arbitrum-mainnet.infura.io";
case "arbitrum-goerli":
return "arbitrum-goerli.infura.io";
case "linea":
return "linea-mainnet.infura.io";
case "linea-goerli":
return "linea-goerli.infura.io";
case "matic":
return "polygon-mainnet.infura.io";
case "matic-mumbai":

@ -1 +1 @@
{"version":3,"file":"provider-infura.js","sourceRoot":"","sources":["../../src.ts/providers/provider-infura.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,gDAE2B;AAE3B,iDAAqD;AACrD,6CAAuC;AACvC,+DAAwD;AACxD,mEAA4D;AAO5D,MAAM,gBAAgB,GAAG,kCAAkC,CAAC;AAE5D,SAAS,OAAO,CAAC,IAAY;IACzB,QAAO,IAAI,EAAE;QACT,KAAK,SAAS;YACV,OAAO,mBAAmB,CAAC;QAC/B,KAAK,QAAQ;YACT,OAAO,kBAAkB,CAAC;QAC9B,KAAK,SAAS;YACV,OAAO,mBAAmB,CAAC;QAE/B,KAAK,UAAU;YACX,OAAO,4BAA4B,CAAC;QACxC,KAAK,iBAAiB;YAClB,OAAO,2BAA2B,CAAC;QACvC,KAAK,OAAO;YACR,OAAO,2BAA2B,CAAC;QACvC,KAAK,cAAc;YACf,OAAO,0BAA0B,CAAC;QACtC,KAAK,UAAU;YACX,OAAO,4BAA4B,CAAC;QACxC,KAAK,iBAAiB;YAClB,OAAO,2BAA2B,CAAC;KAC1C;IAED,IAAA,yBAAc,EAAC,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;AAClE,CAAC;AAED;;;;;;;;GAQG;AACH,MAAa,uBAAwB,SAAQ,yCAAiB;IAE1D;;OAEG;IACM,SAAS,CAAU;IAE5B;;;;;OAKG;IACM,aAAa,CAAiB;IAEvC;;OAEG;IACH,YAAY,OAAoB,EAAE,SAAkB;QAChD,MAAM,QAAQ,GAAG,IAAI,cAAc,CAAC,O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AmB,EAAC,gBAAgB,CAAC,CAAC;gBACtC,OAAO,IAAI,CAAC;YAChB,CAAC,CAAC;SACL;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ;AApED,wCAoEC"}
{"version":3,"file":"provider-infura.js","sourceRoot":"","sources":["../../src.ts/providers/provider-infura.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,gDAE2B;AAE3B,iDAAqD;AACrD,6CAAuC;AACvC,+DAAwD;AACxD,mEAA4D;AAO5D,MAAM,gBAAgB,GAAG,kCAAkC,CAAC;AAE5D,SAAS,OAAO,CAAC,IAAY;IACzB,QAAO,IAAI,EAAE;QACT,KAAK,SAAS;YACV,OAAO,mBAAmB,CAAC;QAC/B,KAAK,QAAQ;YACT,OAAO,kBAAkB,CAAC;QAC9B,KAAK,SAAS;YACV,OAAO,mBAAmB,CAAC;QAE/B,KAAK,UAAU;YACX,OAAO,4BAA4B,CAAC;QACxC,KAAK,iBAAiB;YAClB,OAAO,2BAA2B,CAAC;QACvC,KAAK,OAAO;YACR,OAAO,yBAAyB,CAAC;QACrC,KAAK,cAAc;YACf,OAAO,wBAAwB,CAAC;QACpC,KAAK,OAAO;YACR,OAAO,2BAA2B,CAAC;QACvC,KAAK,cAAc;YACf,OAAO,0BAA0B,CAAC;QACtC,KAAK,UAAU;YACX,OAAO,4BAA4B,CAAC;QACxC,KAAK,iBAAiB;YAClB,OAAO,2BAA2B,CAAC;KAC1C;IAED,IAAA,yBAAc,EAAC,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;AAClE,CAAC;AAED;;;;;;;;GAQG;AACH,MAAa,uBAAwB,SAAQ,yCAAiB;IAE1D;;OAEG;IACM,SAAS,CAAU;IAE5B;;;;;OAKG;IACM,aAAa,CAAiB;IAEvC;;OAEG;IACH,YAAY,OAAoB,EAAE,SAAkB;QAChD,MAAM,QAAQ,GAAG,IAAI,cAAc,CAAC,OAAO,EAAE,SAAS,C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,CAAC,CAAC;gBACtC,OAAO,IAAI,CAAC;YAChB,CAAC,CAAC;SACL;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ;AApED,wCAoEC"}

@ -122,6 +122,7 @@ export type JsonRpcApiProviderOptions = {
batchMaxSize?: number;
batchMaxCount?: number;
cacheTimeout?: number;
pollingInterval?: number;
};
/**
* A **JsonRpcTransactionRequest** is formatted as needed by the JSON-RPC
@ -318,6 +319,9 @@ export declare abstract class JsonRpcApiProvider extends AbstractProvider {
listAccounts(): Promise<Array<JsonRpcSigner>>;
destroy(): void;
}
/**
* @_ignore:
*/
export declare abstract class JsonRpcApiPollingProvider extends JsonRpcApiProvider {
#private;
constructor(network?: Networkish, options?: JsonRpcApiProviderOptions);

File diff suppressed because one or more lines are too long

@ -64,7 +64,8 @@ const defaultOptions = {
batchStallTime: 10,
batchMaxSize: (1 << 20),
batchMaxCount: 100,
cacheTimeout: 250
cacheTimeout: 250,
pollingInterval: 4000
};
// @TODO: Unchecked Signers
class JsonRpcSigner extends abstract_signer_js_1.AbstractSigner {
@ -283,11 +284,7 @@ class JsonRpcApiProvider extends abstract_provider_js_1.AbstractProvider {
}, stallTime);
}
constructor(network, options) {
const superOptions = {};
if (options && options.cacheTimeout != null) {
superOptions.cacheTimeout = options.cacheTimeout;
}
super(network, superOptions);
super(network, options);
this.#nextId = 1;
this.#options = Object.assign({}, defaultOptions, options || {});
this.#payloads = [];
@ -740,6 +737,12 @@ class JsonRpcApiProvider extends abstract_provider_js_1.AbstractProvider {
}
}
exports.JsonRpcApiProvider = JsonRpcApiProvider;
// @TODO: remove this in v7, it is not exported because this functionality
// is exposed in the JsonRpcApiProvider by setting polling to true. It should
// be safe to remove regardless, because it isn't reachable, but just in case.
/**
* @_ignore:
*/
class JsonRpcApiPollingProvider extends JsonRpcApiProvider {
#pollingInterval;
constructor(network, options) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -18,6 +18,8 @@ function setify(items) {
items.forEach((k) => result.add(k));
return Object.freeze(result);
}
const _kwVisibDeploy = "external public payable";
const KwVisibDeploy = setify(_kwVisibDeploy.split(" "));
// Visibility Keywords
const _kwVisib = "constant external internal payable private public pure view";
const KwVisib = setify(_kwVisib.split(" "));
@ -1021,7 +1023,7 @@ export class ConstructorFragment extends Fragment {
else if (obj instanceof TokenString) {
consumeKeywords(obj, setify(["constructor"]));
const inputs = consumeParams(obj);
const payable = !!consumeKeywords(obj, setify(["payable"])).has("payable");
const payable = !!consumeKeywords(obj, KwVisibDeploy).has("payable");
const gas = consumeGas(obj);
consumeEoi(obj);
return new ConstructorFragment(_guard, "constructor", inputs, payable, gas);

File diff suppressed because one or more lines are too long

@ -1 +1 @@
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src.ts/contract/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAS,MAAM,iBAAiB,CAAC;AAInD,OAAO,EAAe,GAAG,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAMjF,OAAO,EAEH,2BAA2B,EAC3B,QAAQ,EACX,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,YAAY,EAAE,SAAS,EAAU,MAAM,iBAAiB,CAAC;AACxG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EACR,QAAQ,EAAE,cAAc,EAC3B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAER,iBAAiB,EACjB,iBAAiB,EAEjB,cAAc,EAEd,aAAa,EACb,mBAAmB,EAEnB,eAAe,EAClB,MAAM,YAAY,CAAC;AAgGpB;;GAEG;AACH,wBAAsB,aAAa,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAA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,CAAC,EAAE,IAAI,GAAG,cAAc,GAAG,YAAY,GAAG,IAAI,CAAC,CAAC,EAAE,MAAM,YAAY,CAAC;CAKhK;;AAMD;;GAEG;AACH,qBAAa,QAAS,SAAQ,aAAe;CAAI"}

@ -80,8 +80,11 @@ function getProvider(value) {
* @_ignore:
*/
export async function copyOverrides(arg, allowed) {
// Make sure the overrides passed in are a valid overrides object
const _overrides = Typed.dereference(arg, "overrides");
assertArgument(typeof (_overrides) === "object", "invalid overrides parameter", "overrides", arg);
// Create a shallow copy (we'll deep-ify anything needed during normalizing)
const overrides = copyRequest(Typed.dereference(arg, "overrides"));
const overrides = copyRequest(_overrides);
assertArgument(overrides.to == null || (allowed || []).indexOf("to") >= 0, "cannot override to", "overrides.to", overrides.to);
assertArgument(overrides.data == null || (allowed || []).indexOf("data") >= 0, "cannot override data", "overrides.data", overrides.data);
// Resolve any from

File diff suppressed because one or more lines are too long

@ -1 +1 @@
{"version":3,"file":"wrappers.d.ts","sourceRoot":"","sources":["../../src.ts/contract/wrappers.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,EAAE,GAAG,EAAE,kBAAkB,EAAE,mBAAmB,EACtD,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAoB,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EACR,QAAQ,EACX,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD;;GAEG;AACH,qBAAa,QAAS,SAAQ,GAAG;IAC7B;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAG,SAAS,CAAC;IAE/B;;OAEG;IACH,QAA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G;IACH,SAAiB,IAAI,EAAE,MAAM,CAAC;IAE9B;;OAEG;gBACS,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,GAAG,QAAQ,EAAE,MAAM,EAAE,iBAAiB,EAAE,QAAQ,EAAE,aAAa,EAAE,IAAI,EAAE,GAAG;IAM5H;;OAEG;IACH,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED;;OAEG;IACH,IAAI,cAAc,IAAI,MAAM,CAE3B;CACJ"}

@ -56,11 +56,12 @@ export class ContractTransactionReceipt extends TransactionReceipt {
return super.logs.map((log) => {
const fragment = log.topics.length ? this.#iface.getEvent(log.topics[0]) : null;
if (fragment) {
return new EventLog(log, this.#iface, fragment);
}
else {
return log;
try {
return new EventLog(log, this.#iface, fragment);
}
catch (error) { }
}
return log;
});
}
}

@ -1 +1 @@
{"version":3,"file":"wrappers.js","sourceRoot":"","sources":["../../src.ts/contract/wrappers.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,yBAAyB;AACzB,OAAO,EACI,GAAG,EAAE,kBAAkB,EAAE,mBAAmB,EACtD,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAWnE;;GAEG;AACH,MAAM,OAAO,QAAS,SAAQ,GAAG;IAC7B;;OAEG;IACM,SAAS,CAAa;IAE/B;;OAEG;IACM,QAAQ,CAAiB;IAElC;;OAEG;IACM,IAAI,CAAU;IAEvB;;OAEG;IACH,YAAY,GAAQ,EAAE,KAAgB,EAAE,QAAuB;QAC3D,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;QACzB,MAAM,IAAI,GAAG,KAAK,CAAC,cAAc,CAAC,QAAQ,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;QAClE,gBAAgB,CAAW,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE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I,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;IACrE,CAAC;IAED;;OAEG;IACH,IAAI,SAAS;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,IAAI,cAAc;QACd,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;IAClC,CAAC;CACJ"}

4
lib.esm/ethers.d.ts vendored

@ -5,7 +5,7 @@ export { ZeroAddress, WeiPerEther, MaxUint256, MinInt256, MaxInt256, N, ZeroHash
export { BaseContract, Contract, ContractFactory, ContractEventPayload, ContractTransactionReceipt, ContractTransactionResponse, ContractUnknownEventPayload, EventLog, } from "./contract/index.js";
export { computeHmac, randomBytes, keccak256, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync, lock, Signature, SigningKey } from "./crypto/index.js";
export { id, ensNormalize, isValidName, namehash, dnsEncode, hashMessage, verifyMessage, solidityPacked, solidityPackedKeccak256, solidityPackedSha256, TypedDataEncoder, verifyTypedData } from "./hash/index.js";
export { getDefaultProvider, Block, FeeData, Log, TransactionReceipt, TransactionResponse, AbstractSigner, NonceManager, VoidSigner, AbstractProvider, FallbackProvider, JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, BrowserProvider, AlchemyProvider, AnkrProvider, CloudflareProvider, EtherscanProvider, InfuraProvider, InfuraWebSocketProvider, PocketProvider, QuickNodeProvider, IpcSocketProvider, SocketProvider, WebSocketProvider, EnsResolver, Network, EnsPlugin, EtherscanPlugin, FeeDataNetworkPlugin, GasCostPlugin, NetworkPlugin, MulticoinProviderPlugin, SocketBlockSubscriber, SocketEventSubscriber, SocketPendingSubscriber, SocketSubscriber, UnmanagedSubscriber, copyRequest, showThrottleMessage } from "./providers/index.js";
export { getDefaultProvider, Block, FeeData, Log, TransactionReceipt, TransactionResponse, AbstractSigner, NonceManager, VoidSigner, AbstractProvider, FallbackProvider, JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, BrowserProvider, AlchemyProvider, AnkrProvider, CloudflareProvider, EtherscanProvider, InfuraProvider, InfuraWebSocketProvider, PocketProvider, QuickNodeProvider, IpcSocketProvider, SocketProvider, WebSocketProvider, EnsResolver, Network, EnsPlugin, EtherscanPlugin, FeeDataNetworkPlugin, FetchUrlFeeDataNetworkPlugin, GasCostPlugin, NetworkPlugin, MulticoinProviderPlugin, SocketBlockSubscriber, SocketEventSubscriber, SocketPendingSubscriber, SocketSubscriber, UnmanagedSubscriber, copyRequest, showThrottleMessage } from "./providers/index.js";
export { accessListify, computeAddress, recoverAddress, Transaction } from "./transaction/index.js";
export { decodeBase58, encodeBase58, decodeBase64, encodeBase64, concat, dataLength, dataSlice, getBytes, getBytesCopy, hexlify, isHexString, isBytesLike, stripZerosLeft, zeroPadBytes, zeroPadValue, defineProperties, resolveProperties, assert, assertArgument, assertArgumentCount, assertNormalize, assertPrivate, makeError, isCallException, isError, EventPayload, FetchRequest, FetchResponse, FetchCancelSignal, FixedNumber, getBigInt, getNumber, getUint, toBeArray, toBigInt, toBeHex, toNumber, toQuantity, fromTwos, toTwos, mask, formatEther, parseEther, formatUnits, parseUnits, toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, decodeRlp, encodeRlp, uuidV4, } from "./utils/index.js";
export { Mnemonic, BaseWallet, HDNodeWallet, HDNodeVoidWallet, Wallet, defaultPath, getAccountPath, getIndexedAccountPath, isCrowdsaleJson, isKeystoreJson, decryptCrowdsaleJson, decryptKeystoreJsonSync, decryptKeystoreJson, encryptKeystoreJson, encryptKeystoreJsonSync, } from "./wallet/index.js";
@ -15,7 +15,7 @@ export type { Addressable, AddressLike, NameResolver } from "./address/index.js"
export type { ConstantContractMethod, ContractEvent, ContractEventArgs, ContractEventName, ContractInterface, ContractMethod, ContractMethodArgs, ContractTransaction, DeferredTopicFilter, Overrides, BaseContractMethod, ContractDeployTransaction, PostfixOverrides, WrappedFallback } from "./contract/index.js";
export type { ProgressCallback, SignatureLike } from "./crypto/index.js";
export type { TypedDataDomain, TypedDataField } from "./hash/index.js";
export type { Provider, Signer, AbstractProviderOptions, AbstractProviderPlugin, BlockParams, BlockTag, ContractRunner, DebugEventBrowserProvider, Eip1193Provider, EventFilter, Filter, FilterByBlockHash, GasCostParameters, JsonRpcApiProviderOptions, JsonRpcError, JsonRpcPayload, JsonRpcResult, JsonRpcTransactionRequest, LogParams, MinedBlock, MinedTransactionResponse, Networkish, OrphanFilter, PerformActionFilter, PerformActionRequest, PerformActionTransaction, PreparedTransactionRequest, ProviderEvent, Subscriber, Subscription, TopicFilter, TransactionReceiptParams, TransactionRequest, TransactionResponseParams, WebSocketCreator, WebSocketLike } from "./providers/index.js";
export type { Provider, Signer, AbstractProviderOptions, FallbackProviderOptions, AbstractProviderPlugin, BlockParams, BlockTag, ContractRunner, DebugEventBrowserProvider, Eip1193Provider, EventFilter, Filter, FilterByBlockHash, GasCostParameters, JsonRpcApiProviderOptions, JsonRpcError, JsonRpcPayload, JsonRpcResult, JsonRpcTransactionRequest, LogParams, MinedBlock, MinedTransactionResponse, Networkish, OrphanFilter, PerformActionFilter, PerformActionRequest, PerformActionTransaction, PreparedTransactionRequest, ProviderEvent, Subscriber, Subscription, TopicFilter, TransactionReceiptParams, TransactionRequest, TransactionResponseParams, WebSocketCreator, WebSocketLike } from "./providers/index.js";
export type { AccessList, AccessListish, AccessListEntry, TransactionLike } from "./transaction/index.js";
export type { BytesLike, BigNumberish, Numeric, ErrorCode, FixedFormat, Utf8ErrorFunc, UnicodeNormalizationForm, Utf8ErrorReason, RlpStructuredData, GetUrlResponse, FetchPreflightFunc, FetchProcessFunc, FetchRetryFunc, FetchGatewayFunc, FetchGetUrlFunc, EthersError, UnknownError, NotImplementedError, UnsupportedOperationError, NetworkError, ServerError, TimeoutError, BadDataError, CancelledError, BufferOverrunError, NumericFaultError, InvalidArgumentError, MissingArgumentError, UnexpectedArgumentError, CallExceptionError, InsufficientFundsError, NonceExpiredError, OffchainFaultError, ReplacementUnderpricedError, TransactionReplacedError, UnconfiguredNameError, ActionRejectedError, CodedEthersError, CallExceptionAction, CallExceptionTransaction, EventEmitterable, Listener } from "./utils/index.js";
export type { CrowdsaleAccount, KeystoreAccount, EncryptOptions } from "./wallet/index.js";

@ -1 +1 @@
{"version":3,"file":"ethers.d.ts","sourceRoot":"","sources":["../src.ts/ethers.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EACH,mBAAmB,EAAE,mBAAmB,EAExC,QAAQ,EACR,mBAAmB,EAAE,aAAa,EAAE,aAAa,EAAE,QAAQ,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,EAEzI,iBAAiB,EAAE,gBAAgB,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,sBAAsB,EACvG,KAAK,GACR,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACH,UAAU,EAAE,cAAc,EAC1B,gBAAgB,EAAE,iBAAiB,EACnC,aAAa,EAAE,SAAS,EAAE,cAAc,EAC3C,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACH,WAAW,EACX,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,EAChD,QAAQ,EACR,WAAW,EAAE,aAAa,EAC7B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACH,YAAY,EAAE,QAAQ,EACtB,eAAe,EACf,oBAAoB,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,QAAQ,GACvH,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACH,WAAW,EACX,WAAW,EACX,SAAS,EACT,SAAS,EACT,MAAM,EAAE,MAAM,EACd,MAAM,EACN,MAAM,EAAE,UAAU,EAClB,IAAI,EACJ,SAAS,EAAE,UAAU,EACxB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACH,EAAE,EACF,YAAY,EAAE,WAAW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E,yBAAyB,EAAE,YAAY,EAAE,cAAc,EAAE,aAAa,EACtE,yBAAyB,EAAE,SAAS,EAAE,UAAU,EAAE,wBAAwB,EAAE,UAAU,EACtF,YAAY,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,wBAAwB,EACjF,0BAA0B,EAAE,aAAa,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAChF,wBAAwB,EAAE,kBAAkB,EAAE,yBAAyB,EACvE,gBAAgB,EAAE,aAAa,EAClC,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EACR,UAAU,EAAE,aAAa,EAAE,eAAe,EAC1C,eAAe,EAClB,MAAM,wBAAwB,CAAC;AAEhC,YAAY,EACR,SAAS,EACT,YAAY,EAAE,OAAO,EACrB,SAAS,EACT,WAAW,EACX,aAAa,EAAE,wBAAwB,EAAE,eAAe,EACxD,iBAAiB,EAEjB,cAAc,EACd,kBAAkB,EAAE,gBAAgB,EAAE,cAAc,EACpD,gBAAgB,EAAE,eAAe,EAEjC,WAAW,EAAE,YAAY,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,YAAY,EACvF,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAC3E,iBAAiB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,uBAAuB,EACtF,kBAAkB,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,kBAAkB,EACjF,2BAA2B,EAAE,wBAAwB,EAAE,qBAAqB,EAC5E,mBAAmB,EACnB,gBAAgB,EAEhB,mBAAmB,EAAE,wBAAwB,EAC7C,gBAAgB,EAAE,QAAQ,EAC7B,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EACR,gBAAgB,EAAE,eAAe,EAAE,cAAc,EACpD,MAAM,mBAAmB,CAAC"}

@ -7,7 +7,7 @@ export { ZeroAddress, WeiPerEther, MaxUint256, MinInt256, MaxInt256, N, ZeroHash
export { BaseContract, Contract, ContractFactory, ContractEventPayload, ContractTransactionReceipt, ContractTransactionResponse, ContractUnknownEventPayload, EventLog, } from "./contract/index.js";
export { computeHmac, randomBytes, keccak256, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync, lock, Signature, SigningKey } from "./crypto/index.js";
export { id, ensNormalize, isValidName, namehash, dnsEncode, hashMessage, verifyMessage, solidityPacked, solidityPackedKeccak256, solidityPackedSha256, TypedDataEncoder, verifyTypedData } from "./hash/index.js";
export { getDefaultProvider, Block, FeeData, Log, TransactionReceipt, TransactionResponse, AbstractSigner, NonceManager, VoidSigner, AbstractProvider, FallbackProvider, JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, BrowserProvider, AlchemyProvider, AnkrProvider, CloudflareProvider, EtherscanProvider, InfuraProvider, InfuraWebSocketProvider, PocketProvider, QuickNodeProvider, IpcSocketProvider, SocketProvider, WebSocketProvider, EnsResolver, Network, EnsPlugin, EtherscanPlugin, FeeDataNetworkPlugin, GasCostPlugin, NetworkPlugin, MulticoinProviderPlugin, SocketBlockSubscriber, SocketEventSubscriber, SocketPendingSubscriber, SocketSubscriber, UnmanagedSubscriber, copyRequest, showThrottleMessage } from "./providers/index.js";
export { getDefaultProvider, Block, FeeData, Log, TransactionReceipt, TransactionResponse, AbstractSigner, NonceManager, VoidSigner, AbstractProvider, FallbackProvider, JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, BrowserProvider, AlchemyProvider, AnkrProvider, CloudflareProvider, EtherscanProvider, InfuraProvider, InfuraWebSocketProvider, PocketProvider, QuickNodeProvider, IpcSocketProvider, SocketProvider, WebSocketProvider, EnsResolver, Network, EnsPlugin, EtherscanPlugin, FeeDataNetworkPlugin, FetchUrlFeeDataNetworkPlugin, GasCostPlugin, NetworkPlugin, MulticoinProviderPlugin, SocketBlockSubscriber, SocketEventSubscriber, SocketPendingSubscriber, SocketSubscriber, UnmanagedSubscriber, copyRequest, showThrottleMessage } from "./providers/index.js";
export { accessListify, computeAddress, recoverAddress, Transaction } from "./transaction/index.js";
export { decodeBase58, encodeBase58, decodeBase64, encodeBase64, concat, dataLength, dataSlice, getBytes, getBytesCopy, hexlify, isHexString, isBytesLike, stripZerosLeft, zeroPadBytes, zeroPadValue, defineProperties, resolveProperties, assert, assertArgument, assertArgumentCount, assertNormalize, assertPrivate, makeError, isCallException, isError, EventPayload, FetchRequest, FetchResponse, FetchCancelSignal, FixedNumber, getBigInt, getNumber, getUint, toBeArray, toBigInt, toBeHex, toNumber, toQuantity, fromTwos, toTwos, mask, formatEther, parseEther, formatUnits, parseUnits, toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, decodeRlp, encodeRlp, uuidV4, } from "./utils/index.js";
export { Mnemonic, BaseWallet, HDNodeWallet, HDNodeVoidWallet, Wallet, defaultPath, getAccountPath, getIndexedAccountPath, isCrowdsaleJson, isKeystoreJson, decryptCrowdsaleJson, decryptKeystoreJsonSync, decryptKeystoreJson, encryptKeystoreJson, encryptKeystoreJsonSync, } from "./wallet/index.js";

@ -1 +1 @@
{"version":3,"file":"ethers.js","sourceRoot":"","sources":["../src.ts/ethers.ts"],"names":[],"mappings":"AAEA,6BAA6B;AAC7B,EAAE;AAEF,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EACH,mBAAmB,EAAE,mBAAmB,EAExC,QAAQ,EACR,mBAAmB,EAAE,aAAa,EAAE,aAAa,EAAE,QAAQ,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,EAEzI,iBAAiB,EAAE,gBAAgB,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,sBAAsB,EACvG,KAAK,GACR,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACH,UAAU,EAAE,cAAc,EAC1B,gBAAgB,EAAE,iBAAiB,EACnC,aAAa,EAAE,SAAS,EAAE,cAAc,EAC3C,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACH,WAAW,EACX,WAAW,EAAE,UAAU,EAAE,SAAS,EAA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,EAAE,YAAY,EAAE,gBAAgB,EAC1C,MAAM,EAEN,WAAW,EAEX,cAAc,EAAE,qBAAqB,EACrC,eAAe,EAAE,cAAc,EAE/B,oBAAoB,EAAE,uBAAuB,EAAE,mBAAmB,EAClE,mBAAmB,EAAE,uBAAuB,GAC/C,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACH,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,SAAS,EACzD,MAAM,sBAAsB,CAAC"}

@ -239,6 +239,7 @@ export type PerformActionRequest = {
*/
export type AbstractProviderOptions = {
cacheTimeout?: number;
pollingInterval?: number;
};
/**
* An **AbstractProvider** provides a base class for other sub-classes to
@ -254,6 +255,7 @@ export declare class AbstractProvider implements Provider {
* [[Network]] if necessary.
*/
constructor(_network?: "any" | Networkish, options?: AbstractProviderOptions);
get pollingInterval(): number;
/**
* Returns ``this``, to allow an **AbstractProvider** to implement
* the [[ContractRunner]] interface.

File diff suppressed because one or more lines are too long

@ -150,7 +150,8 @@ async function getSubscription(_event, provider) {
}
function getTime() { return (new Date()).getTime(); }
const defaultOptions = {
cacheTimeout: 250
cacheTimeout: 250,
pollingInterval: 4000
};
/**
* An **AbstractProvider** provides a base class for other sub-classes to
@ -204,6 +205,7 @@ export class AbstractProvider {
this.#timers = new Map();
this.#disableCcipRead = false;
}
get pollingInterval() { return this.#options.pollingInterval; }
/**
* Returns ``this``, to allow an **AbstractProvider** to implement
* the [[ContractRunner]] interface.
@ -573,31 +575,36 @@ export class AbstractProvider {
return expected.clone();
}
async getFeeData() {
const { block, gasPrice } = await resolveProperties({
block: this.getBlock("latest"),
gasPrice: ((async () => {
try {
const gasPrice = await this.#perform({ method: "getGasPrice" });
return getBigInt(gasPrice, "%response");
}
catch (error) { }
return null;
})())
});
let maxFeePerGas = null, maxPriorityFeePerGas = null;
if (block && block.baseFeePerGas) {
// We may want to compute this more accurately in the future,
// using the formula "check if the base fee is correct".
// See: https://eips.ethereum.org/EIPS/eip-1559
maxPriorityFeePerGas = BigInt("1000000000");
// Allow a network to override their maximum priority fee per gas
//const priorityFeePlugin = (await this.getNetwork()).getPlugin<MaxPriorityFeePlugin>("org.ethers.plugins.max-priority-fee");
//if (priorityFeePlugin) {
// maxPriorityFeePerGas = await priorityFeePlugin.getPriorityFee(this);
//}
maxFeePerGas = (block.baseFeePerGas * BN_2) + maxPriorityFeePerGas;
const network = await this.getNetwork();
const getFeeDataFunc = async () => {
const { _block, gasPrice } = await resolveProperties({
_block: this.#getBlock("latest", false),
gasPrice: ((async () => {
try {
const gasPrice = await this.#perform({ method: "getGasPrice" });
return getBigInt(gasPrice, "%response");
}
catch (error) { }
return null;
})())
});
let maxFeePerGas = null, maxPriorityFeePerGas = null;
// These are the recommended EIP-1559 heuristics for fee data
const block = this._wrapBlock(_block, network);
if (block && block.baseFeePerGas) {
maxPriorityFeePerGas = BigInt("1000000000");
maxFeePerGas = (block.baseFeePerGas * BN_2) + maxPriorityFeePerGas;
}
return new FeeData(gasPrice, maxFeePerGas, maxPriorityFeePerGas);
};
// Check for a FeeDataNetWorkPlugin
const plugin = network.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");
if (plugin) {
const req = new FetchRequest(plugin.url);
const feeData = await plugin.processFunc(getFeeDataFunc, this, req);
return new FeeData(feeData.gasPrice, feeData.maxFeePerGas, feeData.maxPriorityFeePerGas);
}
return new FeeData(gasPrice, maxFeePerGas, maxPriorityFeePerGas);
return await getFeeDataFunc();
}
async estimateGas(_tx) {
let tx = this._getTransactionRequest(_tx);
@ -958,8 +965,11 @@ export class AbstractProvider {
case "error":
case "network":
return new UnmanagedSubscriber(sub.type);
case "block":
return new PollingBlockSubscriber(this);
case "block": {
const subscriber = new PollingBlockSubscriber(this);
subscriber.pollingInterval = this.pollingInterval;
return subscriber;
}
case "event":
return new PollingEventSubscriber(this, sub.filter);
case "transaction":

File diff suppressed because one or more lines are too long

@ -1 +1 @@
{"version":3,"file":"default-provider.d.ts","sourceRoot":"","sources":["../../src.ts/providers/default-provider.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAOxD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,aAAa,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,gBAAgB,CA6EhH"}
{"version":3,"file":"default-provider.d.ts","sourceRoot":"","sources":["../../src.ts/providers/default-provider.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AASxD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,aAAa,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,gBAAgB,CAkHhH"}

@ -8,47 +8,72 @@ import { InfuraProvider } from "./provider-infura.js";
import { QuickNodeProvider } from "./provider-quicknode.js";
import { FallbackProvider } from "./provider-fallback.js";
import { JsonRpcProvider } from "./provider-jsonrpc.js";
import { Network } from "./network.js";
import { WebSocketProvider } from "./provider-websocket.js";
function isWebSocketLike(value) {
return (value && typeof (value.send) === "function" &&
typeof (value.close) === "function");
}
const Testnets = "goerli kovan sepolia classicKotti optimism-goerli arbitrum-goerli matic-mumbai bnbt".split(" ");
export function getDefaultProvider(network, options) {
if (options == null) {
options = {};
}
const allowService = (name) => {
if (options[name] === "-") {
return false;
}
if (typeof (options.exclusive) === "string") {
return (name === options.exclusive);
}
if (Array.isArray(options.exclusive)) {
return (options.exclusive.indexOf(name) !== -1);
}
return true;
};
if (typeof (network) === "string" && network.match(/^https?:/)) {
return new JsonRpcProvider(network);
}
if (typeof (network) === "string" && network.match(/^wss?:/) || isWebSocketLike(network)) {
return new WebSocketProvider(network);
}
// Get the network and name, if possible
let staticNetwork = null;
try {
staticNetwork = Network.from(network);
}
catch (error) { }
const providers = [];
if (options.alchemy !== "-") {
if (allowService("publicPolygon") && staticNetwork) {
if (staticNetwork.name === "matic") {
providers.push(new JsonRpcProvider("https:/\/polygon-rpc.com/", staticNetwork, { staticNetwork }));
}
}
if (allowService("alchemy")) {
try {
providers.push(new AlchemyProvider(network, options.alchemy));
}
catch (error) { }
}
if (options.ankr !== "-" && options.ankr != null) {
if (allowService("ankr") && options.ankr != null) {
try {
providers.push(new AnkrProvider(network, options.ankr));
}
catch (error) { }
}
if (options.cloudflare !== "-") {
if (allowService("cloudflare")) {
try {
providers.push(new CloudflareProvider(network));
}
catch (error) { }
}
if (options.etherscan !== "-") {
if (allowService("etherscan")) {
try {
providers.push(new EtherscanProvider(network, options.etherscan));
}
catch (error) { }
}
if (options.infura !== "-") {
if (allowService("infura")) {
try {
let projectId = options.infura;
let projectSecret = undefined;
@ -75,7 +100,7 @@ export function getDefaultProvider(network, options) {
} catch (error) { console.log(error); }
}
*/
if (options.quicknode !== "-") {
if (allowService("quicknode")) {
try {
let token = options.quicknode;
providers.push(new QuickNodeProvider(network, token));
@ -85,9 +110,25 @@ export function getDefaultProvider(network, options) {
assert(providers.length, "unsupported default network", "UNSUPPORTED_OPERATION", {
operation: "getDefaultProvider"
});
// No need for a FallbackProvider
if (providers.length === 1) {
return providers[0];
}
return new FallbackProvider(providers);
// We use the floor because public third-party providers can be unreliable,
// so a low number of providers with a large quorum will fail too often
let quorum = Math.floor(providers.length / 2);
if (quorum > 2) {
quorum = 2;
}
// Testnets don't need as strong a security gaurantee and speed is
// more useful during testing
if (staticNetwork && Testnets.indexOf(staticNetwork.name) !== -1) {
quorum = 1;
}
// Provided override qorum takes priority
if (options && options.quorum) {
quorum = options.quorum;
}
return new FallbackProvider(providers, undefined, { quorum });
}
//# sourceMappingURL=default-provider.js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,MAAM,GAAG,CAAC,CAAC;KAAE;IAEjF,yCAAyC;IACzC,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE;QAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;KAAE;IAE3D,OAAO,IAAI,gBAAgB,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;AAClE,CAAC"}

@ -16,7 +16,7 @@ export { getDefaultProvider } from "./default-provider.js";
export { EnsResolver, MulticoinProviderPlugin } from "./ens-resolver.js";
export { Network } from "./network.js";
export { NonceManager } from "./signer-noncemanager.js";
export { NetworkPlugin, GasCostPlugin, EnsPlugin, FeeDataNetworkPlugin, } from "./plugins-network.js";
export { NetworkPlugin, GasCostPlugin, EnsPlugin, FeeDataNetworkPlugin, FetchUrlFeeDataNetworkPlugin, } from "./plugins-network.js";
export { Block, FeeData, Log, TransactionReceipt, TransactionResponse, copyRequest, } from "./provider.js";
export { FallbackProvider } from "./provider-fallback.js";
export { JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner } from "./provider-jsonrpc.js";
@ -40,6 +40,7 @@ export type { Networkish } from "./network.js";
export type { GasCostParameters } from "./plugins-network.js";
export type { BlockTag, TransactionRequest, PreparedTransactionRequest, EventFilter, Filter, FilterByBlockHash, OrphanFilter, ProviderEvent, TopicFilter, Provider, MinedBlock, MinedTransactionResponse } from "./provider.js";
export type { DebugEventBrowserProvider, Eip1193Provider } from "./provider-browser.js";
export type { FallbackProviderOptions } from "./provider-fallback.js";
export type { JsonRpcPayload, JsonRpcResult, JsonRpcError, JsonRpcApiProviderOptions, JsonRpcTransactionRequest, } from "./provider-jsonrpc.js";
export type { WebSocketCreator, WebSocketLike } from "./provider-websocket.js";
export type { Signer } from "./signer.js";

@ -1 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/providers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EACH,gBAAgB,EAAE,mBAA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AAsB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EACH,gBAAgB,EAAE,qBAAqB,EAAE,uBAAuB,EAChE,qBAAqB,EACxB,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EACR,uBAAuB,EAAE,YAAY,EAAE,UAAU,EACjD,sBAAsB,EACtB,mBAAmB,EAAE,wBAAwB,EAAE,oBAAoB,GACtE,MAAM,wBAAwB,CAAA;AAE/B,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,YAAY,EACR,WAAW,EAAE,SAAS,EAAE,wBAAwB,EAChD,yBAAyB,GAC5B,MAAM,iBAAiB,CAAC;AAWzB,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,YAAY,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,YAAY,EACR,QAAQ,EACR,kBAAkB,EAAE,0BAA0B,EAC9C,WAAW,EAAE,MAAM,EAAE,iBAAiB,EAAE,YAAY,EAAE,aAAa,EACnE,WAAW,EACX,QAAQ,EACR,UAAU,EAAE,wBAAwB,EACvC,MAAM,eAAe,CAAC;AAEvB,YAAY,EACR,yBAAyB,EAAE,eAAe,EAC7C,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEtE,YAAY,EACR,cAAc,EAAE,aAAa,EAAE,YAAY,EAC3C,yBAAyB,EACzB,yBAAyB,GAC5B,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EACR,gBAAgB,EAAE,aAAa,EAClC,MAAM,yBAAyB,CAAC;AAEjC,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"}

@ -16,7 +16,7 @@ export { getDefaultProvider } from "./default-provider.js";
export { EnsResolver, MulticoinProviderPlugin } from "./ens-resolver.js";
export { Network } from "./network.js";
export { NonceManager } from "./signer-noncemanager.js";
export { NetworkPlugin, GasCostPlugin, EnsPlugin, FeeDataNetworkPlugin, } from "./plugins-network.js";
export { NetworkPlugin, GasCostPlugin, EnsPlugin, FeeDataNetworkPlugin, FetchUrlFeeDataNetworkPlugin, } from "./plugins-network.js";
export { Block, FeeData, Log, TransactionReceipt, TransactionResponse, copyRequest,
//resolveTransactionRequest,
} from "./provider.js";

@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/providers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EACH,gBAAgB,EAAE,mBAAmB,EACxC,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACH,cAAc,EACd,UAAU,GACb,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACH,mBAAmB,EACtB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EACH,WAAW,EACX,uBAAuB,EAC1B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EACH,aAAa,EACb,aAAa,EACb,SAAS,EACT,oBAAoB,GACvB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACH,KAAK,EACL,OAAO,EACP,GAAG,EACH,kBAAkB,EAClB,mBAAmB,EAEnB,WAAW;AACX,4BAA4B;EAC/B,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAE1F,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAA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E;;;OAGG;IACH,UAAU,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,EAAE,QAAQ,EAAE,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC;IAI/E;;OAEG;IACH,KAAK,IAAI,OAAO;IAQhB;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,EAAE,eAAe,GAAG,MAAM;IAyBhD;;OAEG;IACH,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO;IA+C1C;;;OAGG;IACH,MAAM,CAAC,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,WAAW,EAAE,MAAM,OAAO,GAAG,IAAI;CAQ7F"}

@ -5,8 +5,8 @@
* @_subsection: api/providers:Networks [networks]
*/
import { accessListify } from "../transaction/index.js";
import { getBigInt, assertArgument } from "../utils/index.js";
import { EnsPlugin, GasCostPlugin } from "./plugins-network.js";
import { getBigInt, assert, assertArgument } from "../utils/index.js";
import { EnsPlugin, FetchUrlFeeDataNetworkPlugin, GasCostPlugin } from "./plugins-network.js";
/* * * *
// Networks which operation against an L2 can use this plugin to
// specify how to access L1, for the purpose of resolving ENS,
@ -24,41 +24,7 @@ export class LayerOneConnectionPlugin extends NetworkPlugin {
}
}
*/
/* * * *
export class PriceOraclePlugin extends NetworkPlugin {
readonly address!: string;
constructor(address: string) {
super("org.ethers.plugins.price-oracle");
defineProperties<PriceOraclePlugin>(this, { address });
}
clone(): PriceOraclePlugin {
return new PriceOraclePlugin(this.address);
}
}
*/
// Networks or clients with a higher need for security (such as clients
// that may automatically make CCIP requests without user interaction)
// can use this plugin to anonymize requests or intercept CCIP requests
// to notify and/or receive authorization from the user
/* * * *
export type FetchDataFunc = (req: Frozen<FetchRequest>) => Promise<FetchRequest>;
export class CcipPreflightPlugin extends NetworkPlugin {
readonly fetchData!: FetchDataFunc;
constructor(fetchData: FetchDataFunc) {
super("org.ethers.plugins.ccip-preflight");
defineProperties<CcipPreflightPlugin>(this, { fetchData });
}
clone(): CcipPreflightPlugin {
return new CcipPreflightPlugin(this.fetchData);
}
}
*/
const Networks = new Map();
// @TODO: Add a _ethersNetworkObj variable to better detect network ovjects
/**
* A **Network** provides access to a chain's properties and allows
* for plug-ins to extend functionality.
@ -265,6 +231,53 @@ export class Network {
Networks.set(nameOrChainId, networkFunc);
}
}
// We don't want to bring in formatUnits because it is backed by
// FixedNumber and we want to keep Networks tiny. The values
// included by the Gas Stations are also IEEE 754 with lots of
// rounding issues and exceed the strict checks formatUnits has.
function parseUnits(_value, decimals) {
const value = String(_value);
if (!value.match(/^[0-9.]+$/)) {
throw new Error(`invalid gwei value: ${_value}`);
}
// Break into [ whole, fraction ]
const comps = value.split(".");
if (comps.length === 1) {
comps.push("");
}
// More than 1 decimal point or too many fractional positions
if (comps.length !== 2) {
throw new Error(`invalid gwei value: ${_value}`);
}
// Pad the fraction to 9 decimalplaces
while (comps[1].length < decimals) {
comps[1] += "0";
}
// Too many decimals and some non-zero ending, take the ceiling
if (comps[1].length > 9 && !comps[1].substring(9).match(/^0+$/)) {
comps[1] = (BigInt(comps[1].substring(0, 9)) + BigInt(1)).toString();
}
return BigInt(comps[0] + comps[1]);
}
function getGasStationPlugin(url) {
return new FetchUrlFeeDataNetworkPlugin(url, async (fetchFeeData, provider, request) => {
// Prevent Cloudflare from blocking our request in node.js
request.setHeader("User-Agent", "ethers");
let response;
try {
response = await request.send();
const payload = response.bodyJson.standard;
const feeData = {
maxFeePerGas: parseUnits(payload.maxFee, 9),
maxPriorityFeePerGas: parseUnits(payload.maxPriorityFee, 9),
};
return feeData;
}
catch (error) {
assert(false, `error encountered with polygon gas station (${JSON.stringify(request.url)})`, "SERVER_ERROR", { request, response, error });
}
});
}
// See: https://chainlist.org
let injected = false;
function injectCommonNetworks() {
@ -280,16 +293,10 @@ function injectCommonNetworks() {
if (options.ensNetwork != null) {
network.attachPlugin(new EnsPlugin(null, options.ensNetwork));
}
if (options.priorityFee) {
// network.attachPlugin(new MaxPriorityFeePlugin(options.priorityFee));
}
/*
if (options.etherscan) {
const { url, apiKey } = options.etherscan;
network.attachPlugin(new EtherscanPlugin(url, apiKey));
}
*/
network.attachPlugin(new GasCostPlugin());
(options.plugins || []).forEach((plugin) => {
network.attachPlugin(plugin);
});
return network;
};
// Register the network by name and chain ID
@ -309,50 +316,30 @@ function injectCommonNetworks() {
registerEth("sepolia", 11155111, {});
registerEth("classic", 61, {});
registerEth("classicKotti", 6, {});
registerEth("xdai", 100, { ensNetwork: 1 });
registerEth("optimism", 10, {
ensNetwork: 1,
etherscan: { url: "https:/\/api-optimistic.etherscan.io/" }
});
registerEth("optimism-goerli", 420, {
etherscan: { url: "https:/\/api-goerli-optimistic.etherscan.io/" }
});
registerEth("arbitrum", 42161, {
ensNetwork: 1,
etherscan: { url: "https:/\/api.arbiscan.io/" }
});
registerEth("arbitrum-goerli", 421613, {
etherscan: { url: "https:/\/api-goerli.arbiscan.io/" }
});
// Polygon has a 35 gwei maxPriorityFee requirement
registerEth("arbitrum-goerli", 421613, {});
registerEth("bnb", 56, { ensNetwork: 1 });
registerEth("bnbt", 97, {});
registerEth("linea", 59144, { ensNetwork: 1 });
registerEth("linea-goerli", 59140, {});
registerEth("matic", 137, {
ensNetwork: 1,
// priorityFee: 35000000000,
etherscan: {
// apiKey: "W6T8DJW654GNTQ34EFEYYP3EZD9DD27CT7",
url: "https:/\/api.polygonscan.com/"
}
plugins: [
getGasStationPlugin("https:/\/gasstation.polygon.technology/v2")
]
});
registerEth("matic-mumbai", 80001, {
altNames: ["maticMumbai", "maticmum"],
// priorityFee: 35000000000,
etherscan: {
// apiKey: "W6T8DJW654GNTQ34EFEYYP3EZD9DD27CT7",
url: "https:/\/api-testnet.polygonscan.com/"
}
plugins: [
getGasStationPlugin("https:/\/gasstation-testnet.polygon.technology/v2")
]
});
registerEth("bnb", 56, {
registerEth("optimism", 10, {
ensNetwork: 1,
etherscan: {
// apiKey: "EVTS3CU31AATZV72YQ55TPGXGMVIFUQ9M9",
url: "http:/\/api.bscscan.com"
}
});
registerEth("bnbt", 97, {
etherscan: {
// apiKey: "EVTS3CU31AATZV72YQ55TPGXGMVIFUQ9M9",
url: "http:/\/api-testnet.bscscan.com"
}
});
registerEth("optimism-goerli", 420, {});
registerEth("xdai", 100, { ensNetwork: 1 });
}
//# sourceMappingURL=network.js.map

File diff suppressed because one or more lines are too long

@ -1,4 +1,5 @@
import type { FeeData, Provider } from "./provider.js";
import type { FetchRequest } from "../utils/fetch.js";
/**
* A **NetworkPlugin** provides additional functionality on a [[Network]].
*/
@ -141,4 +142,19 @@ export declare class FeeDataNetworkPlugin extends NetworkPlugin {
getFeeData(provider: Provider): Promise<FeeData>;
clone(): FeeDataNetworkPlugin;
}
export declare class FetchUrlFeeDataNetworkPlugin extends NetworkPlugin {
#private;
get url(): string;
get processFunc(): (f: () => Promise<FeeData>, p: Provider, r: FetchRequest) => Promise<{
gasPrice?: bigint | null | undefined;
maxFeePerGas?: bigint | null | undefined;
maxPriorityFeePerGas?: bigint | null | undefined;
}>;
constructor(url: string, processFunc: (f: () => Promise<FeeData>, p: Provider, r: FetchRequest) => Promise<{
gasPrice?: null | bigint;
maxFeePerGas?: null | bigint;
maxPriorityFeePerGas?: null | bigint;
}>);
clone(): FetchUrlFeeDataNetworkPlugin;
}
//# sourceMappingURL=plugins-network.d.ts.map

@ -1 +1 @@
{"version":3,"file":"plugins-network.d.ts","sourceRoot":"","sources":["../../src.ts/providers/plugins-network.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACR,OAAO,EAAE,QAAQ,EACpB,MAAM,eAAe,CAAC;AAMvB;;GAEG;AACH,qBAAa,aAAa;IACtB;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;IAEvB;;OAEG;gBACS,IAAI,EAAE,MAAM;IAIxB;;OAEG;IACH,KAAK,IAAI,aAAa;CAOzB;AAGD;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC5B;;OAEG;IACH,MAAM,C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AAC,EAAE,YAAY,KAAK,OAAO,CAAC;QAAE,QAAQ,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;QAAC,oBAAoB,CAAC,EAAE,IAAI,GAAG,MAAM,CAAA;KAAE,CAAC;IAO5M,KAAK,IAAI,4BAA4B;CACxC"}

@ -158,6 +158,19 @@ export class FeeDataNetworkPlugin extends NetworkPlugin {
return new FeeDataNetworkPlugin(this.#feeDataFunc);
}
}
export class FetchUrlFeeDataNetworkPlugin extends NetworkPlugin {
#url;
#processFunc;
get url() { return this.#url; }
get processFunc() { return this.#processFunc; }
constructor(url, processFunc) {
super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");
this.#url = url;
this.#processFunc = processFunc;
}
// We are immutable, so we can serve as our own clone
clone() { return this; }
}
/*
export class CustomBlockNetworkPlugin extends NetworkPlugin {
readonly #blockFunc: (provider: Provider, block: BlockParams<string>) => Block<string>;

@ -1 +1 @@
{"version":3,"file":"plugins-network.js","sourceRoot":"","sources":["../../src.ts/providers/plugins-network.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAQnD,MAAM,UAAU,GAAG,4CAA4C,CAAC;AAEhE;;GAEG;AACH,MAAM,OAAO,aAAa;IACtB;;;;;OAKG;IACM,IAAI,CAAU;IAEvB;;OAEG;IACH,YAAY,IAAY;QACpB,gBAAgB,CAAgB,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;IACpD,CAAC;IAED;;OAEG;IACH,KAAK;QACD,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;CAKJ;AAsCD;;;GAGG;AACH,MAAM,OAAO,aAAc,SAAQ,aAAa;IAC5C;;;;;OAKG;IACM,cAAc,CAAU;IAEjC;;OAEG;IACM,MAAM,C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OAAO,CAAC,OAAO,CAAC;IAIvC;;;;OAIG;IACG,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC;IAsFtF;;OAEG;IACH,uBAAuB,CAAC,WAAW,EAAE,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAwBhF;;OAEG;IACH,WAAW,CAAC,GAAG,EAAE,oBAAoB,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,GAAG,KAAK;IAiEvE,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;IAIlC,QAAQ,CAAC,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC;IAiKjD,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC;IAIpC;;;;OAIG;IACG,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC;IAKtC;;;OAGG;IACG,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,QAAQ,CAAC;IAc7D,mBAAmB,IAAI,OAAO;CAGjC"}

@ -117,6 +117,10 @@ export class EtherscanProvider extends AbstractProvider {
return "https:/\/api-optimistic.etherscan.io";
case "optimism-goerli":
return "https:/\/api-goerli-optimistic.etherscan.io";
case "bnb":
return "http:/\/api.bscscan.com";
case "bnbt":
return "http:/\/api-testnet.bscscan.com";
default:
}
assertArgument(false, "unsupported network", "network", this.network);

File diff suppressed because one or more lines are too long

@ -67,9 +67,11 @@ export interface FallbackProviderState extends Required<FallbackProviderConfig>
* Additional options to configure a [[FallbackProvider]].
*/
export type FallbackProviderOptions = {
quorum: number;
eventQuorum: number;
eventWorkers: number;
quorum?: number;
eventQuorum?: number;
eventWorkers?: number;
cacheTimeout?: number;
pollingInterval?: number;
};
/**
* A **FallbackProvider** manages several [[Providers]] providing
@ -100,7 +102,7 @@ export declare class FallbackProvider extends AbstractProvider {
* If a [[Provider]] is included in %%providers%%, defaults are used
* for the configuration.
*/
constructor(providers: Array<AbstractProvider | FallbackProviderConfig>, network?: Networkish);
constructor(providers: Array<AbstractProvider | FallbackProviderConfig>, network?: Networkish, options?: FallbackProviderOptions);
get providerConfigs(): Array<FallbackProviderState>;
_detectNetwork(): Promise<Network>;
/**

@ -1 +1 @@
{"version":3,"file":"provider-fallback.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-fallback.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AA6B9C;;GAEG;AACH,MAAM,WAAW,sBAAsB;IAEnC;;OAEG;IACH,QAAQ,EAAE,gBAAgB,CAAC;IAE3B;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAMD;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,QAAQ,CAAC,sBAAsB,CAAC;IAE3E;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACjB;AAyCD;;GAEG;A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,CAQlD;IAEK,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;IASxC;;OAEG;IACG,iBAAiB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC;IA0QtF,QAAQ,CAAC,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,CAAC,CAAC;IA4CxD,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAMjC"}

@ -230,8 +230,8 @@ export class FallbackProvider extends AbstractProvider {
* If a [[Provider]] is included in %%providers%%, defaults are used
* for the configuration.
*/
constructor(providers, network) {
super(network);
constructor(providers, network, options) {
super(network, options);
this.#configs = providers.map((p) => {
if (p instanceof AbstractProvider) {
return Object.assign({ provider: p }, defaultConfig, defaultState);
@ -242,7 +242,15 @@ export class FallbackProvider extends AbstractProvider {
});
this.#height = -2;
this.#initialSyncPromise = null;
this.quorum = 2; //Math.ceil(providers.length / 2);
if (options && options.quorum != null) {
this.quorum = options.quorum;
}
else {
this.quorum = Math.ceil(this.#configs.reduce((accum, config) => {
accum += config.weight;
return accum;
}, 0) / 2);
}
this.eventQuorum = 1;
this.eventWorkers = 1;
assertArgument(this.quorum <= this.#configs.reduce((a, c) => (a + c.weight), 0), "quorum exceed provider wieght", "quorum", this.quorum);
@ -314,7 +322,7 @@ export class FallbackProvider extends AbstractProvider {
// Shuffle the states, sorted by priority
const allConfigs = this.#configs.slice();
shuffle(allConfigs);
allConfigs.sort((a, b) => (b.priority - a.priority));
allConfigs.sort((a, b) => (a.priority - b.priority));
for (const config of allConfigs) {
if (config._lastFatalError) {
continue;

File diff suppressed because one or more lines are too long

@ -1 +1 @@
{"version":3,"file":"provider-infura.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-infura.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EACe,YAAY,EACjC,MAAM,mBAAmB,CAAC;AAG3B,OAA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AAO,EAAE,MAAM,GAAG,gBAAgB;IAO/C,mBAAmB,IAAI,OAAO;IAI9B;;OAEG;IACH,MAAM,CAAC,oBAAoB,CAAC,OAAO,CAAC,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,uBAAuB;IAI9F;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,EAAE,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,YAAY;CAiB9G"}

@ -34,6 +34,10 @@ function getHost(name) {
return "arbitrum-mainnet.infura.io";
case "arbitrum-goerli":
return "arbitrum-goerli.infura.io";
case "linea":
return "linea-mainnet.infura.io";
case "linea-goerli":
return "linea-goerli.infura.io";
case "matic":
return "polygon-mainnet.infura.io";
case "matic-mumbai":

@ -1 +1 @@
{"version":3,"file":"provider-infura.js","sourceRoot":"","sources":["../../src.ts/providers/provider-infura.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EACH,gBAAgB,EAAE,YAAY,EAAE,MAAM,EAAE,cAAc,EACzD,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAO5D,MAAM,gBAAgB,GAAG,kCAAkC,CAAC;AAE5D,SAAS,OAAO,CAAC,IAAY;IACzB,QAAO,IAAI,EAAE;QACT,KAAK,SAAS;YACV,OAAO,mBAAmB,CAAC;QAC/B,KAAK,QAAQ;YACT,OAAO,kBAAkB,CAAC;QAC9B,KAAK,SAAS;YACV,OAAO,mBAAmB,CAAC;QAE/B,KAAK,UAAU;YACX,OAAO,4BAA4B,CAAC;QACxC,KAAK,iBA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,CAAC;IAC3D,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAgB,EAAE,SAAyB,EAAE,aAA6B;QACxF,IAAI,SAAS,IAAI,IAAI,EAAE;YAAE,SAAS,GAAG,gBAAgB,CAAC;SAAE;QACxD,IAAI,aAAa,IAAI,IAAI,EAAE;YAAE,aAAa,GAAG,IAAI,CAAC;SAAE;QAEpD,MAAM,OAAO,GAAG,IAAI,YAAY,CAAC,YAAa,OAAO,CAAC,OAAO,CAAC,IAAI,CAAE,OAAQ,SAAU,EAAE,CAAC,CAAC;QAC1F,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;QACzB,IAAI,aAAa,EAAE;YAAE,OAAO,CAAC,cAAc,CAAC,EAAE,EAAE,aAAa,CAAC,CAAC;SAAE;QAEjE,IAAI,SAAS,KAAK,gBAAgB,EAAE;YAChC,OAAO,CAAC,SAAS,GAAG,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;gBACrD,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;gBACtC,OAAO,IAAI,CAAC;YAChB,CAAC,CAAC;SACL;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ"}

@ -122,6 +122,7 @@ export type JsonRpcApiProviderOptions = {
batchMaxSize?: number;
batchMaxCount?: number;
cacheTimeout?: number;
pollingInterval?: number;
};
/**
* A **JsonRpcTransactionRequest** is formatted as needed by the JSON-RPC
@ -318,6 +319,9 @@ export declare abstract class JsonRpcApiProvider extends AbstractProvider {
listAccounts(): Promise<Array<JsonRpcSigner>>;
destroy(): void;
}
/**
* @_ignore:
*/
export declare abstract class JsonRpcApiPollingProvider extends JsonRpcApiProvider {
#private;
constructor(network?: Networkish, options?: JsonRpcApiProviderOptions);

File diff suppressed because one or more lines are too long

@ -61,7 +61,8 @@ const defaultOptions = {
batchStallTime: 10,
batchMaxSize: (1 << 20),
batchMaxCount: 100,
cacheTimeout: 250
cacheTimeout: 250,
pollingInterval: 4000
};
// @TODO: Unchecked Signers
export class JsonRpcSigner extends AbstractSigner {
@ -279,11 +280,7 @@ export class JsonRpcApiProvider extends AbstractProvider {
}, stallTime);
}
constructor(network, options) {
const superOptions = {};
if (options && options.cacheTimeout != null) {
superOptions.cacheTimeout = options.cacheTimeout;
}
super(network, superOptions);
super(network, options);
this.#nextId = 1;
this.#options = Object.assign({}, defaultOptions, options || {});
this.#payloads = [];
@ -735,6 +732,12 @@ export class JsonRpcApiProvider extends AbstractProvider {
super.destroy();
}
}
// @TODO: remove this in v7, it is not exported because this functionality
// is exposed in the JsonRpcApiProvider by setting polling to true. It should
// be safe to remove regardless, because it isn't reachable, but just in case.
/**
* @_ignore:
*/
export class JsonRpcApiPollingProvider extends JsonRpcApiProvider {
#pollingInterval;
constructor(network, options) {

File diff suppressed because one or more lines are too long

@ -93,7 +93,7 @@
"url": "https://www.buymeacoffee.com/ricmoo"
}
],
"gitHead": "ba36079a285706694532ce726568c4c447acad47",
"gitHead": "b1dbbb0de3f10a3d9e12d6a84ad5c52bea25c7f6",
"homepage": "https://ethers.org",
"keywords": [
"ethereum",

@ -121,6 +121,9 @@ function setify(items: Array<string>): ReadonlySet<string> {
return Object.freeze(result);
}
const _kwVisibDeploy = "external public payable";
const KwVisibDeploy = setify(_kwVisibDeploy.split(" "));
// Visibility Keywords
const _kwVisib = "constant external internal payable private public pure view";
const KwVisib = setify(_kwVisib.split(" "));
@ -1265,7 +1268,7 @@ export class ConstructorFragment extends Fragment {
} else if (obj instanceof TokenString) {
consumeKeywords(obj, setify([ "constructor" ]));
const inputs = consumeParams(obj);
const payable = !!consumeKeywords(obj, setify([ "payable" ])).has("payable");
const payable = !!consumeKeywords(obj, KwVisibDeploy).has("payable");
const gas = consumeGas(obj);
consumeEoi(obj);

@ -133,8 +133,12 @@ function getProvider(value: null | ContractRunner): null | Provider {
*/
export async function copyOverrides<O extends string = "data" | "to">(arg: any, allowed?: Array<string>): Promise<Omit<ContractTransaction, O>> {
// Make sure the overrides passed in are a valid overrides object
const _overrides = Typed.dereference(arg, "overrides");
assertArgument(typeof(_overrides) === "object", "invalid overrides parameter", "overrides", arg);
// Create a shallow copy (we'll deep-ify anything needed during normalizing)
const overrides = copyRequest(Typed.dereference(arg, "overrides"));
const overrides = copyRequest(_overrides);
assertArgument(overrides.to == null || (allowed || [ ]).indexOf("to") >= 0,
"cannot override to", "overrides.to", overrides.to);

Some files were not shown because too many files have changed in this diff Show More