admin: updated dist files

This commit is contained in:
Richard Moore 2023-02-04 03:26:34 -05:00
parent faa556c1e5
commit 24e13fc0f2
55 changed files with 660 additions and 474 deletions

7
dist/README.md vendored
View File

@ -1,7 +0,0 @@
Distribution Files
==================
This folder contains the library reduced to single-file variants.
They are generate with the `npm run build-dist` command, which uses
rollup (via the `/rollup.config.js` configuration).

634
dist/ethers.js vendored

File diff suppressed because it is too large Load Diff

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

View File

@ -145,7 +145,7 @@ const u64 = {
add, add3L, add3H, add4L, add4H, add5H, add5L,
};
const version = "6.0.0";
const version = "6.0.1";
/**
* Property helper functions.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

6
lib.commonjs/README.md Normal file
View File

@ -0,0 +1,6 @@
CommonJS Generated Files
========================
Do not modify the files in this folder. They are deleted on `build-clean`.
These files are generated from the `/tsconfig.commonjs.json`

View File

@ -1,5 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = void 0;
exports.version = "6.0.0";
exports.version = "6.0.1";
//# sourceMappingURL=_version.js.map

View File

@ -33,10 +33,12 @@ const SimpleTokens = {
",": "COMMA", "@": "AT"
};
// Parser regexes to consume the next token
const regexWhitespace = new RegExp("^(\\s*)");
const regexNumber = new RegExp("^([0-9]+)");
const regexIdentifier = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)");
const regexType = new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))");
const regexWhitespacePrefix = new RegExp("^(\\s*)");
const regexNumberPrefix = new RegExp("^([0-9]+)");
const regexIdPrefix = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)");
// Parser regexs to check validity
const regexId = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$");
const regexType = new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");
class TokenString {
#offset;
#tokens;
@ -145,7 +147,7 @@ function lex(text) {
while (offset < text.length) {
// Strip off any leading whitespace
let cur = text.substring(offset);
let match = cur.match(regexWhitespace);
let match = cur.match(regexWhitespacePrefix);
if (match) {
offset += match[1].length;
cur = text.substring(offset);
@ -194,7 +196,7 @@ function lex(text) {
}
continue;
}
match = cur.match(regexIdentifier);
match = cur.match(regexIdPrefix);
if (match) {
token.text = match[1];
offset += token.text.length;
@ -209,7 +211,7 @@ function lex(text) {
token.type = "ID";
continue;
}
match = cur.match(regexNumber);
match = cur.match(regexNumberPrefix);
if (match) {
token.text = match[1];
token.type = "NUMBER";
@ -654,7 +656,7 @@ class ParamType {
return new ParamType(_guard, name, type, baseType, indexed, comps, arrayLength, arrayChildren);
}
const name = obj.name;
(0, index_js_1.assertArgument)(!name || (typeof (name) === "string" && name.match(regexIdentifier)), "invalid name", "obj.name", name);
(0, index_js_1.assertArgument)(!name || (typeof (name) === "string" && name.match(regexId)), "invalid name", "obj.name", name);
let indexed = obj.indexed;
if (indexed != null) {
(0, index_js_1.assertArgument)(allowIndexed, "parameter cannot be indexed", "obj.indexed", obj.indexed);
@ -799,7 +801,7 @@ class NamedFragment extends Fragment {
*/
constructor(guard, type, name, inputs) {
super(guard, type, inputs);
(0, index_js_1.assertArgument)(typeof (name) === "string" && name.match(regexIdentifier), "invalid identifier", "name", name);
(0, index_js_1.assertArgument)(typeof (name) === "string" && name.match(regexId), "invalid identifier", "name", name);
inputs = Object.freeze(inputs.slice());
(0, index_js_1.defineProperties)(this, { name });
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -33,7 +33,7 @@ function showThrottleMessage(service) {
console.log("signing up for your own API keys to improve performance, increase your");
console.log("request rate/limit and enable other perks, such as metrics and advanced APIs.");
console.log("");
console.log("For more details: https:/\/docs.ethers.io/api-keys/");
console.log("For more details: https:/\/docs.ethers.org/api-keys/");
console.log("==========================");
}
exports.showThrottleMessage = showThrottleMessage;

View File

@ -1 +1 @@
{"version":3,"file":"community.js","sourceRoot":"","sources":["../../src.ts/providers/community.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAeH,kDAAkD;AAClD,MAAM,KAAK,GAAgB,IAAI,GAAG,EAAE,CAAC;AAErC;;;;;;;GAOG;AACH,SAAgB,mBAAmB,CAAC,OAAe;IAC/C,IAAI,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;QAAE,OAAO;KAAE;IACnC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAEnB,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAA;IACzC,OAAO,CAAC,GAAG,CAAC,6BAA8B,OAAQ,sCAAsC,CAAC,CAAC;IAC1F,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,2EAA2E,CAAC,CAAC;IACzF,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;IAClF,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,yEAAyE,CAAC,CAAC;IACvF,OAAO,CAAC,GAAG,CAAC,wEAAwE,CAAC,CAAC;IACtF,OAAO,CAAC,GAAG,CAAC,+EAA+E,CAAC,CAAC;IAC7F,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,qDAAqD,CAAC,CAAC;IACnE,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;AAC9C,CAAC;AAhBD,kDAgBC"}
{"version":3,"file":"community.js","sourceRoot":"","sources":["../../src.ts/providers/community.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAeH,kDAAkD;AAClD,MAAM,KAAK,GAAgB,IAAI,GAAG,EAAE,CAAC;AAErC;;;;;;;GAOG;AACH,SAAgB,mBAAmB,CAAC,OAAe;IAC/C,IAAI,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;QAAE,OAAO;KAAE;IACnC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAEnB,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAA;IACzC,OAAO,CAAC,GAAG,CAAC,6BAA8B,OAAQ,sCAAsC,CAAC,CAAC;IAC1F,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,2EAA2E,CAAC,CAAC;IACzF,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;IAClF,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,yEAAyE,CAAC,CAAC;IACvF,OAAO,CAAC,GAAG,CAAC,wEAAwE,CAAC,CAAC;IACtF,OAAO,CAAC,GAAG,CAAC,+EAA+E,CAAC,CAAC;IAC7F,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,sDAAsD,CAAC,CAAC;IACpE,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;AAC9C,CAAC;AAhBD,kDAgBC"}

View File

@ -10,13 +10,19 @@ const index_js_1 = require("../utils/index.js");
class BlockConnectionSubscriber {
#provider;
#blockNumber;
#running;
#filterId;
constructor(provider) {
this.#provider = provider;
this.#blockNumber = -2;
this.#running = false;
this.#filterId = null;
}
start() {
if (this.#running) {
return;
}
this.#running = true;
this.#filterId = this.#provider._subscribe(["newHeads"], (result) => {
const blockNumber = (0, index_js_1.getNumber)(result.number);
const initial = (this.#blockNumber === -2) ? blockNumber : (this.#blockNumber + 1);
@ -27,6 +33,10 @@ class BlockConnectionSubscriber {
});
}
stop() {
if (!this.#running) {
return;
}
this.#running = false;
if (this.#filterId != null) {
this.#provider._unsubscribe(this.#filterId);
this.#filterId = null;

View File

@ -1 +1 @@
{"version":3,"file":"subscriber-connection.js","sourceRoot":"","sources":["../../src.ts/providers/subscriber-connection.ts"],"names":[],"mappings":";;;AACA,gDAA8C;AAm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AO;SAAE;QAC/B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QAEtB,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,EAAE;YACxB,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAC5C,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;SACzB;IACL,CAAC;IAED,KAAK,CAAC,eAAyB;QAC3B,IAAI,eAAe,EAAE;YAAE,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;SAAE;QAChD,IAAI,CAAC,IAAI,EAAE,CAAC;IAChB,CAAC;IAED,MAAM;QACF,IAAI,CAAC,KAAK,EAAE,CAAC;IACjB,CAAC;CACJ;AA/CD,8DA+CC"}

View File

@ -19,12 +19,14 @@ class FilterIdSubscriber {
#provider;
#filterIdPromise;
#poller;
#running;
#network;
#hault;
constructor(provider) {
this.#provider = provider;
this.#filterIdPromise = null;
this.#poller = this.#poll.bind(this);
this.#running = false;
this.#network = null;
this.#hault = false;
}
@ -74,8 +76,18 @@ class FilterIdSubscriber {
});
}
}
start() { this.#poll(-2); }
start() {
if (this.#running) {
return;
}
this.#running = true;
this.#poll(-2);
}
stop() {
if (!this.#running) {
return;
}
this.#running = false;
this.#hault = true;
this.#teardown();
this.#provider.off("block", this.#poller);

View File

@ -1 +1 @@
{"version":3,"file":"subscriber-filterid.js","sourceRoot":"","sources":["../../src.ts/providers/subscriber-filterid.ts"],"names":[],"mappings":";;;AAAA,mEAAiE;AAQjE,SAAS,IAAI,CAAC,GAAQ;IAClB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;AAC3C,CAAC;AAED;;;;;;;;;GASG;AACH,MAAa,kBAAkB;IAC3B,SAAS,CAAqB;IAE9B,gBAAgB,CAAyB;IACzC,OAAO,CAA+B;IAEtC,QAAQ,CAAiB;IAEzB,MAAM,CAAU;IAEhB,YAAY,QAA4B;QACpC,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AAC;QACvE,OAAO,QAAQ,CAAC;IACpB,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,QAA4B,EAAE,OAAmB;QAChE,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;YAC1B,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;SAC5E;IACL,CAAC;CACJ;AAtBD,0DAsBC;AAED;;;;GAIG;AACH,MAAa,yBAA0B,SAAQ,kBAAkB;IAC7D,KAAK,CAAC,UAAU,CAAC,QAA4B;QACzC,OAAO,MAAM,QAAQ,CAAC,IAAI,CAAC,iCAAiC,EAAE,EAAG,CAAC,CAAC;IACvE,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,QAA4B,EAAE,OAAmB;QAChE,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;YAC1B,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;SACpC;IACL,CAAC;CACJ;AAVD,8DAUC"}

View File

@ -68,14 +68,14 @@ class PollingBlockSubscriber {
}
start() {
if (this.#poller) {
throw new Error("subscriber already running");
return;
}
this.#poller = this.#provider._setTimeout(this.#poll.bind(this), this.#interval);
this.#poll();
}
stop() {
if (!this.#poller) {
throw new Error("subscriber not running");
return;
}
this.#provider._clearTimeout(this.#poller);
this.#poller = null;
@ -99,8 +99,10 @@ exports.PollingBlockSubscriber = PollingBlockSubscriber;
class OnBlockSubscriber {
#provider;
#poll;
#running;
constructor(provider) {
this.#provider = provider;
this.#running = false;
this.#poll = (blockNumber) => {
this._poll(blockNumber, this.#provider);
};
@ -109,10 +111,18 @@ class OnBlockSubscriber {
throw new Error("sub-classes must override this");
}
start() {
if (this.#running) {
return;
}
this.#running = true;
this.#poll(-2);
this.#provider.on("block", this.#poll);
}
stop() {
if (!this.#running) {
return;
}
this.#running = false;
this.#provider.off("block", this.#poll);
}
pause(dropWhilePaused) { this.stop(); }
@ -164,6 +174,7 @@ class PollingEventSubscriber {
#provider;
#filter;
#poller;
#running;
// The most recent block we have scanned for events. The value -2
// indicates we still need to fetch an initial block number
#blockNumber;
@ -171,6 +182,7 @@ class PollingEventSubscriber {
this.#provider = provider;
this.#filter = copy(filter);
this.#poller = this.#poll.bind(this);
this.#running = false;
this.#blockNumber = -2;
}
async #poll(blockNumber) {
@ -196,6 +208,10 @@ class PollingEventSubscriber {
}
}
start() {
if (this.#running) {
return;
}
this.#running = true;
if (this.#blockNumber === -2) {
this.#provider.getBlockNumber().then((blockNumber) => {
this.#blockNumber = blockNumber;
@ -204,6 +220,10 @@ class PollingEventSubscriber {
this.#provider.on("block", this.#poller);
}
stop() {
if (!this.#running) {
return;
}
this.#running = false;
this.#provider.off("block", this.#poller);
}
pause(dropWhilePaused) {

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
export {};

View File

@ -1,58 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/*
import { defineProperties } from "@ethersproject/properties";
export type EventCommon = "block" | "debug" | "blockObject";
export type Event = EventCommon | string | { address?: string, topics: Array<string | Array<string>> }
export type EventLike = Event | Array<string>;
export function getTag(eventName: Event): string {
if (typeof(eventName) === "string") { return eventName; }
if (typeof(eventName) === "object") {
return (eventName.address || "*") + (eventName.topics || []).map((topic) => {
if (typeof(topic) === "string") { return topic; }
return topic.join("|");
}).join("&");
}
throw new Error("FOO");
}
export function getEvent(tag: string): Event {
}
let nextId = 1;
export class Subscriber {
readonly id!: number;
readonly tag!: string;
#paused: boolean;
#blockNumber: number;
constructor(tag: string) {
this.#paused = false;
this.#blockNumber = -1;
defineProperties<Subscriber>(this, { id: nextId++, tag });
}
get blockNumber(): number {
return this.#blockNumber;
}
_setBlockNumber(blockNumber: number): void { this.#blockNumber = blockNumber; }
setup(): void { }
teardown(): void { }
isPaused(): boolean { return this.#paused; }
pause(): void { this.#paused = true; }
resume(): void { this.#paused = false; }
resubscribeInfo(): string { return this.tag; }
resubscribe(info: string): boolean { return true; }
}
*/
//# sourceMappingURL=subscriber.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"subscriber.js","sourceRoot":"","sources":["../../src.ts/providers/subscriber.ts"],"names":[],"mappings":";;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsDE"}

View File

@ -10,11 +10,62 @@ export type ErrorInfo<T> = Omit<T, "code" | "name" | "message">;
* All errors emitted by ethers have an **ErrorCode** to help
* identify and coalesce errors to simplfy programatic analysis.
*
* _property: ``"UNKNOWN_ERROR"``
* This is a general puspose fallback when no other error makes sense
* or the error wasn't expected
* Each **ErrorCode** is the %%code%% proerty of a coresponding
* [[EthersError]].
*
* _property: ``"NOT_IMPLEMENTED"``
* **Generic Errors**
*
* **``"UNKNOWN_ERROR"``** - see [[UnknownError]]
*
* **``"NOT_IMPLEMENTED"``** - see [[NotImplementedError]]
*
* **``"UNSUPPORTED_OPERATION"``** - see [[UnsupportedOperationError]]
*
* **``"NETWORK_ERROR"``** - see [[NetworkError]]
*
* **``"SERVER_ERROR"``** - see [[ServerError]]
*
* **``"TIMEOUT"``** - see [[TimeoutError]]
*
* **``"BAD_DATA"``** - see [[BadDataError]]
*
* **``"CANCELLED"``** - see [[CancelledError]]
*
* **Operational Errors**
*
* **``"BUFFER_OVERRUN"``** - see [[BufferOverrunError]]
*
* **``"NUMERIC_FAULT"``** - see [[NumericFaultError]]
*
* **Argument Errors**
*
* **``"INVALID_ARGUMENT"``** - see [[InvalidArgumentError]]
*
* **``"MISSING_ARGUMENT"``** - see [[MissingArgumentError]]
*
* **``"UNEXPECTED_ARGUMENT"``** - see [[UnexpectedArgumentError]]
*
* **``"VALUE_MISMATCH"``** - //unused//
*
* **Blockchain Errors**
*
* **``"CALL_EXCEPTION"``** - see [[CallExceptionError]]
*
* **``"INSUFFICIENT_FUNDS"``** - see [[InsufficientFundsError]]
*
* **``"NONCE_EXPIRED"``** - see [[NonceExpiredError]]
*
* **``"REPLACEMENT_UNDERPRICED"``** - see [[ReplacementUnderpricedError]]
*
* **``"TRANSACTION_REPLACED"``** - see [[TransactionReplacedError]]
*
* **``"UNCONFIGURED_NAME"``** - see [[UnconfiguredNameError]]
*
* **``"OFFCHAIN_FAULT"``** - see [[OffchainFaultError]]
*
* **User Interaction Errors**
*
* **``"ACTION_REJECTED"``** - see [[ActionRejectedError]]
*/
export type ErrorCode = "UNKNOWN_ERROR" | "NOT_IMPLEMENTED" | "UNSUPPORTED_OPERATION" | "NETWORK_ERROR" | "SERVER_ERROR" | "TIMEOUT" | "BAD_DATA" | "CANCELLED" | "BUFFER_OVERRUN" | "NUMERIC_FAULT" | "INVALID_ARGUMENT" | "MISSING_ARGUMENT" | "UNEXPECTED_ARGUMENT" | "VALUE_MISMATCH" | "CALL_EXCEPTION" | "INSUFFICIENT_FUNDS" | "NONCE_EXPIRED" | "REPLACEMENT_UNDERPRICED" | "TRANSACTION_REPLACED" | "UNCONFIGURED_NAME" | "OFFCHAIN_FAULT" | "ACTION_REJECTED";
/**
@ -333,7 +384,7 @@ export interface TransactionReplacedError extends EthersError<"TRANSACTION_REPLA
* been configured.
*
* This could indicate an ENS name is unowned or that the current
* address being pointed to is the [[Zero]].
* address being pointed to is the [[ZeroAddress]].
*/
export interface UnconfiguredNameError extends EthersError<"UNCONFIGURED_NAME"> {
/**
@ -391,7 +442,7 @@ export type CodedEthersError<T> = T extends "UNKNOWN_ERROR" ? UnknownError : T e
*/
export declare function isError<K extends ErrorCode, T extends CodedEthersError<K>>(error: any, code: K): error is T;
/**
* Returns true if %%error%% is a [CALL_EXCEPTION](api:CallExceptionError).
* Returns true if %%error%% is a [[CallExceptionError].
*/
export declare function isCallException(error: any): error is CallExceptionError;
/**

View File

@ -69,7 +69,7 @@ function isError(error, code) {
}
exports.isError = isError;
/**
* Returns true if %%error%% is a [CALL_EXCEPTION](api:CallExceptionError).
* Returns true if %%error%% is a [[CallExceptionError].
*/
function isCallException(error) {
return isError(error, "CALL_EXCEPTION");

File diff suppressed because one or more lines are too long

6
lib.esm/README.md Normal file
View File

@ -0,0 +1,6 @@
ESM Generated Files
===================
Do not modify the files in this folder. They are deleted on `build-clean`.
These files are generated from the `/tsconfig.esm.json`

View File

@ -1,2 +1,2 @@
export const version = "6.0.0";
export const version = "6.0.1";
//# sourceMappingURL=_version.js.map

View File

@ -30,10 +30,12 @@ const SimpleTokens = {
",": "COMMA", "@": "AT"
};
// Parser regexes to consume the next token
const regexWhitespace = new RegExp("^(\\s*)");
const regexNumber = new RegExp("^([0-9]+)");
const regexIdentifier = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)");
const regexType = new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))");
const regexWhitespacePrefix = new RegExp("^(\\s*)");
const regexNumberPrefix = new RegExp("^([0-9]+)");
const regexIdPrefix = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)");
// Parser regexs to check validity
const regexId = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$");
const regexType = new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");
class TokenString {
#offset;
#tokens;
@ -142,7 +144,7 @@ function lex(text) {
while (offset < text.length) {
// Strip off any leading whitespace
let cur = text.substring(offset);
let match = cur.match(regexWhitespace);
let match = cur.match(regexWhitespacePrefix);
if (match) {
offset += match[1].length;
cur = text.substring(offset);
@ -191,7 +193,7 @@ function lex(text) {
}
continue;
}
match = cur.match(regexIdentifier);
match = cur.match(regexIdPrefix);
if (match) {
token.text = match[1];
offset += token.text.length;
@ -206,7 +208,7 @@ function lex(text) {
token.type = "ID";
continue;
}
match = cur.match(regexNumber);
match = cur.match(regexNumberPrefix);
if (match) {
token.text = match[1];
token.type = "NUMBER";
@ -651,7 +653,7 @@ export class ParamType {
return new ParamType(_guard, name, type, baseType, indexed, comps, arrayLength, arrayChildren);
}
const name = obj.name;
assertArgument(!name || (typeof (name) === "string" && name.match(regexIdentifier)), "invalid name", "obj.name", name);
assertArgument(!name || (typeof (name) === "string" && name.match(regexId)), "invalid name", "obj.name", name);
let indexed = obj.indexed;
if (indexed != null) {
assertArgument(allowIndexed, "parameter cannot be indexed", "obj.indexed", obj.indexed);
@ -794,7 +796,7 @@ export class NamedFragment extends Fragment {
*/
constructor(guard, type, name, inputs) {
super(guard, type, inputs);
assertArgument(typeof (name) === "string" && name.match(regexIdentifier), "invalid identifier", "name", name);
assertArgument(typeof (name) === "string" && name.match(regexId), "invalid identifier", "name", name);
inputs = Object.freeze(inputs.slice());
defineProperties(this, { name });
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -30,7 +30,7 @@ export function showThrottleMessage(service) {
console.log("signing up for your own API keys to improve performance, increase your");
console.log("request rate/limit and enable other perks, such as metrics and advanced APIs.");
console.log("");
console.log("For more details: https:/\/docs.ethers.io/api-keys/");
console.log("For more details: https:/\/docs.ethers.org/api-keys/");
console.log("==========================");
}
//# sourceMappingURL=community.js.map

View File

@ -1 +1 @@
{"version":3,"file":"community.js","sourceRoot":"","sources":["../../src.ts/providers/community.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAeH,kDAAkD;AAClD,MAAM,KAAK,GAAgB,IAAI,GAAG,EAAE,CAAC;AAErC;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAe;IAC/C,IAAI,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;QAAE,OAAO;KAAE;IACnC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAEnB,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAA;IACzC,OAAO,CAAC,GAAG,CAAC,6BAA8B,OAAQ,sCAAsC,CAAC,CAAC;IAC1F,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,2EAA2E,CAAC,CAAC;IACzF,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CA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AG,CAAC,sDAAsD,CAAC,CAAC;IACpE,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;AAC9C,CAAC"}

View File

@ -7,13 +7,19 @@ import { getNumber } from "../utils/index.js";
export class BlockConnectionSubscriber {
#provider;
#blockNumber;
#running;
#filterId;
constructor(provider) {
this.#provider = provider;
this.#blockNumber = -2;
this.#running = false;
this.#filterId = null;
}
start() {
if (this.#running) {
return;
}
this.#running = true;
this.#filterId = this.#provider._subscribe(["newHeads"], (result) => {
const blockNumber = getNumber(result.number);
const initial = (this.#blockNumber === -2) ? blockNumber : (this.#blockNumber + 1);
@ -24,6 +30,10 @@ export class BlockConnectionSubscriber {
});
}
stop() {
if (!this.#running) {
return;
}
this.#running = false;
if (this.#filterId != null) {
this.#provider._unsubscribe(this.#filterId);
this.#filterId = null;

View File

@ -1 +1 @@
{"version":3,"file":"subscriber-connection.js","sourceRoot":"","sources":["../../src.ts/providers/subscriber-connection.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAmB9C;;;;GAIG;AACH,MAAM,OAAO,yBAAyB;IAClC,SAAS,CAAwB;IACjC,YAAY,CAAS;IAErB,SAAS,CAAgB;IAEzB,YAAY,QAA+B;QACvC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;QACvB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IAC1B,CAAC;IAED,KAAK;QACD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAE,UAAU,CAAE,EAAE,CAAC,MAAW,EAAE,EAAE;YACvE,MAAM,WAAW,GAAG,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YAC7C,MAAM,OAAO,GAAG,CAAC,IAAI,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAA,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,CAAA;YACjF,KAAK,IAAI,CAAC,GAAG,OAAO,EAAE,CAAC,IAAI,WAAW,EAAE,CAAC,EAAE,EAAE;gBACzC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;aACnC;YACD,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QACpC,CAAC,CAAC,CAAC;IACP,CAAC;IAED,IAAI;QACA,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,EAAE;YACxB,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAC5C,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;SACzB;IACL,CAAC;IAED,KAAK,CAAC,eAAyB;QAC3B,IAAI,eAAe,EAAE;YAAE,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;SAAE;QAChD,IAAI,CAAC,IAAI,EAAE,CAAC;IAChB,CAAC;IAED,MAAM;QACF,IAAI,CAAC,KAAK,EAAE,CAAC;IACjB,CAAC;CACJ"}
{"version":3,"file":"subscriber-connection.js","sourceRoot":"","sources":["../../src.ts/providers/subscriber-connection.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAmB9C;;;;GAIG;AACH,MAAM,OAAO,yBAAyB;IAClC,SAAS,CAAwB;IACjC,YAAY,CAAS;IAErB,QAAQ,CAAU;IAElB,SAAS,CAAgB;IAEzB,YAAY,QAA+B;QACvC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IAC1B,CAAC;IAED,KAAK;QACD,IAAI,IAAI,CAAC,QAAQ,EAAE;YAAE,OAAO;SAAE;QAC9B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QAErB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAE,UAAU,CAAE,EAAE,CAAC,MAAW,EAAE,EAAE;YACvE,MAAM,WAAW,GAAG,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YAC7C,MAAM,OAAO,GAAG,CAAC,IAAI,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAA,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,CAAA;YACjF,KAAK,IAAI,CAAC,GAAG,OAAO,EAAE,CAAC,IAAI,WAAW,EAAE,CAAC,EAAE,EAAE;gBACzC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;aACnC;YACD,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QACpC,CAAC,CAAC,CAAC;IACP,CAAC;IAED,IAAI;QACA,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAAE,OAAO;SAAE;QAC/B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QAEtB,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,EAAE;YACxB,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAC5C,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;SACzB;IACL,CAAC;IAED,KAAK,CAAC,eAAyB;QAC3B,IAAI,eAAe,EAAE;YAAE,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;SAAE;QAChD,IAAI,CAAC,IAAI,EAAE,CAAC;IAChB,CAAC;IAED,MAAM;QACF,IAAI,CAAC,KAAK,EAAE,CAAC;IACjB,CAAC;CACJ"}

View File

@ -16,12 +16,14 @@ export class FilterIdSubscriber {
#provider;
#filterIdPromise;
#poller;
#running;
#network;
#hault;
constructor(provider) {
this.#provider = provider;
this.#filterIdPromise = null;
this.#poller = this.#poll.bind(this);
this.#running = false;
this.#network = null;
this.#hault = false;
}
@ -71,8 +73,18 @@ export class FilterIdSubscriber {
});
}
}
start() { this.#poll(-2); }
start() {
if (this.#running) {
return;
}
this.#running = true;
this.#poll(-2);
}
stop() {
if (!this.#running) {
return;
}
this.#running = false;
this.#hault = true;
this.#teardown();
this.#provider.off("block", this.#poller);

View File

@ -1 +1 @@
{"version":3,"file":"subscriber-filterid.js","sourceRoot":"","sources":["../../src.ts/providers/subscriber-filterid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAQjE,SAAS,IAAI,CAAC,GAAQ;IAClB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;AAC3C,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,OAAO,kBAAkB;IAC3B,SAAS,CAAqB;IAE9B,gBAAgB,CAAyB;IACzC,OAAO,CAA+B;IAEtC,QAAQ,CAAiB;IAEzB,MAAM,CAAU;IAEhB,YAAY,QAA4B;QACpC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAE1B,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAErC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QAErB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACxB,CAAC;IAED,UAAU,CAAC,QAA4B;QACnC,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACrD,CAAC;IAED,YAAY,CAAC,QAA0B,EAAE,MAAkB;QACvD,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACrD,CAAC;IAED,QAAQ,CAAC,QAA0B;QAC/B,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,C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AChE,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;YAC1B,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;SACpC;IACL,CAAC;CACJ"}

View File

@ -64,14 +64,14 @@ export class PollingBlockSubscriber {
}
start() {
if (this.#poller) {
throw new Error("subscriber already running");
return;
}
this.#poller = this.#provider._setTimeout(this.#poll.bind(this), this.#interval);
this.#poll();
}
stop() {
if (!this.#poller) {
throw new Error("subscriber not running");
return;
}
this.#provider._clearTimeout(this.#poller);
this.#poller = null;
@ -94,8 +94,10 @@ export class PollingBlockSubscriber {
export class OnBlockSubscriber {
#provider;
#poll;
#running;
constructor(provider) {
this.#provider = provider;
this.#running = false;
this.#poll = (blockNumber) => {
this._poll(blockNumber, this.#provider);
};
@ -104,10 +106,18 @@ export class OnBlockSubscriber {
throw new Error("sub-classes must override this");
}
start() {
if (this.#running) {
return;
}
this.#running = true;
this.#poll(-2);
this.#provider.on("block", this.#poll);
}
stop() {
if (!this.#running) {
return;
}
this.#running = false;
this.#provider.off("block", this.#poll);
}
pause(dropWhilePaused) { this.stop(); }
@ -156,6 +166,7 @@ export class PollingEventSubscriber {
#provider;
#filter;
#poller;
#running;
// The most recent block we have scanned for events. The value -2
// indicates we still need to fetch an initial block number
#blockNumber;
@ -163,6 +174,7 @@ export class PollingEventSubscriber {
this.#provider = provider;
this.#filter = copy(filter);
this.#poller = this.#poll.bind(this);
this.#running = false;
this.#blockNumber = -2;
}
async #poll(blockNumber) {
@ -188,6 +200,10 @@ export class PollingEventSubscriber {
}
}
start() {
if (this.#running) {
return;
}
this.#running = true;
if (this.#blockNumber === -2) {
this.#provider.getBlockNumber().then((blockNumber) => {
this.#blockNumber = blockNumber;
@ -196,6 +212,10 @@ export class PollingEventSubscriber {
this.#provider.on("block", this.#poller);
}
stop() {
if (!this.#running) {
return;
}
this.#running = false;
this.#provider.off("block", this.#poller);
}
pause(dropWhilePaused) {

File diff suppressed because one or more lines are too long

View File

@ -1,57 +0,0 @@
export {};
/*
import { defineProperties } from "@ethersproject/properties";
export type EventCommon = "block" | "debug" | "blockObject";
export type Event = EventCommon | string | { address?: string, topics: Array<string | Array<string>> }
export type EventLike = Event | Array<string>;
export function getTag(eventName: Event): string {
if (typeof(eventName) === "string") { return eventName; }
if (typeof(eventName) === "object") {
return (eventName.address || "*") + (eventName.topics || []).map((topic) => {
if (typeof(topic) === "string") { return topic; }
return topic.join("|");
}).join("&");
}
throw new Error("FOO");
}
export function getEvent(tag: string): Event {
}
let nextId = 1;
export class Subscriber {
readonly id!: number;
readonly tag!: string;
#paused: boolean;
#blockNumber: number;
constructor(tag: string) {
this.#paused = false;
this.#blockNumber = -1;
defineProperties<Subscriber>(this, { id: nextId++, tag });
}
get blockNumber(): number {
return this.#blockNumber;
}
_setBlockNumber(blockNumber: number): void { this.#blockNumber = blockNumber; }
setup(): void { }
teardown(): void { }
isPaused(): boolean { return this.#paused; }
pause(): void { this.#paused = true; }
resume(): void { this.#paused = false; }
resubscribeInfo(): string { return this.tag; }
resubscribe(info: string): boolean { return true; }
}
*/
//# sourceMappingURL=subscriber.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"subscriber.js","sourceRoot":"","sources":["../../src.ts/providers/subscriber.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsDE"}

View File

@ -65,7 +65,7 @@ export function isError(error, code) {
return (error && error.code === code);
}
/**
* Returns true if %%error%% is a [CALL_EXCEPTION](api:CallExceptionError).
* Returns true if %%error%% is a [[CallExceptionError].
*/
export function isCallException(error) {
return isError(error, "CALL_EXCEPTION");

File diff suppressed because one or more lines are too long

28
package-lock.json generated
View File

@ -1,17 +1,27 @@
{
"name": "ethers",
"version": "6.0.0-beta-exports.16",
"version": "6.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "ethers",
"version": "6.0.0-beta-exports.16",
"version": "6.0.0",
"funding": [
{
"type": "individual",
"url": "https://github.com/sponsors/ethers-io/"
},
{
"type": "individual",
"url": "https://www.buymeacoffee.com/ricmoo"
}
],
"license": "MIT",
"dependencies": {
"@adraffy/ens-normalize": "1.8.9",
"@noble/hashes": "1.1.2",
"@noble/secp256k1": "1.6.3",
"@noble/secp256k1": "1.7.1",
"aes-js": "4.0.0-beta.3",
"tslib": "2.4.0",
"ws": "8.5.0"
@ -88,9 +98,9 @@
]
},
"node_modules/@noble/secp256k1": {
"version": "1.6.3",
"resolved": "https://registry.npmjs.org/@noble/secp256k1/-/secp256k1-1.6.3.tgz",
"integrity": "sha512-T04e4iTurVy7I8Sw4+c5OSN9/RkPlo1uKxAomtxQNLq8j1uPAqnsqG1bqvY3Jv7c13gyr6dui0zmh/I3+f/JaQ==",
"version": "1.7.1",
"resolved": "https://registry.npmjs.org/@noble/secp256k1/-/secp256k1-1.7.1.tgz",
"integrity": "sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw==",
"funding": [
{
"type": "individual",
@ -1609,9 +1619,9 @@
"integrity": "sha512-KYRCASVTv6aeUi1tsF8/vpyR7zpfs3FUzy2Jqm+MU+LmUKhQ0y2FpfwqkCcxSg2ua4GALJd8k2R76WxwZGbQpA=="
},
"@noble/secp256k1": {
"version": "1.6.3",
"resolved": "https://registry.npmjs.org/@noble/secp256k1/-/secp256k1-1.6.3.tgz",
"integrity": "sha512-T04e4iTurVy7I8Sw4+c5OSN9/RkPlo1uKxAomtxQNLq8j1uPAqnsqG1bqvY3Jv7c13gyr6dui0zmh/I3+f/JaQ=="
"version": "1.7.1",
"resolved": "https://registry.npmjs.org/@noble/secp256k1/-/secp256k1-1.7.1.tgz",
"integrity": "sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw=="
},
"@rollup/plugin-node-resolve": {
"version": "13.3.0",

View File

@ -28,10 +28,10 @@
"typescript": "4.9.5",
"uglify-js": "3.17.0"
},
"ethereum": "donations.ethers.eth",
"engines": {
"node": ">=14.0.0"
},
"ethereum": "donations.ethers.eth",
"exports": {
".": {
"import": "./lib.esm/index.js",
@ -104,7 +104,7 @@
"url": "https://www.buymeacoffee.com/ricmoo"
}
],
"gitHead": "90afd9bd81ed1408421a0247fa0845a74c9eb319",
"gitHead": "faa556c1e5f727105ec6cdc5ed25de30095108d6",
"homepage": "https://ethers.org",
"keywords": [
"ethereum",
@ -145,5 +145,5 @@
"sideEffects": false,
"type": "module",
"types": "./types/index.d.ts",
"version": "6.0.0"
"version": "6.0.1"
}

View File

@ -1 +1 @@
export const version: string = "6.0.0";
export const version: string = "6.0.1";

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"version":3,"file":"subscriber-connection.d.ts","sourceRoot":"","sources":["../../src.ts/providers/subscriber-connection.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAIzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C;;;;GAIG;AACH,MAAM,WAAW,qBAAsB,SAAQ,QAAQ;IAEnD,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,GAAG,MAAM,CAAC;IAC1E,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACxC;AAED;;;;GAIG;AACH,qBAAa,yBAA0B,YAAW,UAAU;;gBAM5C,QAAQ,EAAE,qBAAqB;IAM3C,KAAK,IAAI,IAAI;IAWb,IAAI,IAAI,IAAI;IAOZ,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI;IAKtC,MAAM,IAAI,IAAI;CAGjB"}
{"version":3,"file":"subscriber-connection.d.ts","sourceRoot":"","sources":["../../src.ts/providers/subscriber-connection.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAIzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C;;;;GAIG;AACH,MAAM,WAAW,qBAAsB,SAAQ,QAAQ;IAEnD,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,GAAG,MAAM,CAAC;IAC1E,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACxC;AAED;;;;GAIG;AACH,qBAAa,yBAA0B,YAAW,UAAU;;gBAQ5C,QAAQ,EAAE,qBAAqB;IAO3C,KAAK,IAAI,IAAI;IAcb,IAAI,IAAI,IAAI;IAUZ,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI;IAKtC,MAAM,IAAI,IAAI;CAGjB"}

View File

@ -1 +1 @@
{"version":3,"file":"subscriber-filterid.d.ts","sourceRoot":"","sources":["../../src.ts/providers/subscriber-filterid.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAE3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAOhE;;;;;;;;;GASG;AACH,qBAAa,kBAAmB,YAAW,UAAU;;gBAUrC,QAAQ,EAAE,kBAAkB;IAWxC,UAAU,CAAC,QAAQ,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;IAIzD,YAAY,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3E,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,GAAG,UA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AAgB,EAAE,IAAI,EAAE,MAAM;IAK9C,KAAK,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;CAI9E;AAED;;;;GAIG;AACH,qBAAa,sBAAuB,YAAW,UAAU;;gBAWzC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,WAAW;IAiC3D,KAAK,IAAI,IAAI;IAYb,IAAI,IAAI,IAAI;IAOZ,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI;IAKtC,MAAM,IAAI,IAAI;CAGjB"}

View File

@ -1,2 +0,0 @@
export {};
//# sourceMappingURL=subscriber.d.ts.map

View File

@ -1 +0,0 @@
{"version":3,"file":"subscriber.d.ts","sourceRoot":"","sources":["../../src.ts/providers/subscriber.ts"],"names":[],"mappings":""}

View File

@ -10,11 +10,62 @@ export type ErrorInfo<T> = Omit<T, "code" | "name" | "message">;
* All errors emitted by ethers have an **ErrorCode** to help
* identify and coalesce errors to simplfy programatic analysis.
*
* _property: ``"UNKNOWN_ERROR"``
* This is a general puspose fallback when no other error makes sense
* or the error wasn't expected
* Each **ErrorCode** is the %%code%% proerty of a coresponding
* [[EthersError]].
*
* _property: ``"NOT_IMPLEMENTED"``
* **Generic Errors**
*
* **``"UNKNOWN_ERROR"``** - see [[UnknownError]]
*
* **``"NOT_IMPLEMENTED"``** - see [[NotImplementedError]]
*
* **``"UNSUPPORTED_OPERATION"``** - see [[UnsupportedOperationError]]
*
* **``"NETWORK_ERROR"``** - see [[NetworkError]]
*
* **``"SERVER_ERROR"``** - see [[ServerError]]
*
* **``"TIMEOUT"``** - see [[TimeoutError]]
*
* **``"BAD_DATA"``** - see [[BadDataError]]
*
* **``"CANCELLED"``** - see [[CancelledError]]
*
* **Operational Errors**
*
* **``"BUFFER_OVERRUN"``** - see [[BufferOverrunError]]
*
* **``"NUMERIC_FAULT"``** - see [[NumericFaultError]]
*
* **Argument Errors**
*
* **``"INVALID_ARGUMENT"``** - see [[InvalidArgumentError]]
*
* **``"MISSING_ARGUMENT"``** - see [[MissingArgumentError]]
*
* **``"UNEXPECTED_ARGUMENT"``** - see [[UnexpectedArgumentError]]
*
* **``"VALUE_MISMATCH"``** - //unused//
*
* **Blockchain Errors**
*
* **``"CALL_EXCEPTION"``** - see [[CallExceptionError]]
*
* **``"INSUFFICIENT_FUNDS"``** - see [[InsufficientFundsError]]
*
* **``"NONCE_EXPIRED"``** - see [[NonceExpiredError]]
*
* **``"REPLACEMENT_UNDERPRICED"``** - see [[ReplacementUnderpricedError]]
*
* **``"TRANSACTION_REPLACED"``** - see [[TransactionReplacedError]]
*
* **``"UNCONFIGURED_NAME"``** - see [[UnconfiguredNameError]]
*
* **``"OFFCHAIN_FAULT"``** - see [[OffchainFaultError]]
*
* **User Interaction Errors**
*
* **``"ACTION_REJECTED"``** - see [[ActionRejectedError]]
*/
export type ErrorCode = "UNKNOWN_ERROR" | "NOT_IMPLEMENTED" | "UNSUPPORTED_OPERATION" | "NETWORK_ERROR" | "SERVER_ERROR" | "TIMEOUT" | "BAD_DATA" | "CANCELLED" | "BUFFER_OVERRUN" | "NUMERIC_FAULT" | "INVALID_ARGUMENT" | "MISSING_ARGUMENT" | "UNEXPECTED_ARGUMENT" | "VALUE_MISMATCH" | "CALL_EXCEPTION" | "INSUFFICIENT_FUNDS" | "NONCE_EXPIRED" | "REPLACEMENT_UNDERPRICED" | "TRANSACTION_REPLACED" | "UNCONFIGURED_NAME" | "OFFCHAIN_FAULT" | "ACTION_REJECTED";
/**
@ -333,7 +384,7 @@ export interface TransactionReplacedError extends EthersError<"TRANSACTION_REPLA
* been configured.
*
* This could indicate an ENS name is unowned or that the current
* address being pointed to is the [[Zero]].
* address being pointed to is the [[ZeroAddress]].
*/
export interface UnconfiguredNameError extends EthersError<"UNCONFIGURED_NAME"> {
/**
@ -391,7 +442,7 @@ export type CodedEthersError<T> = T extends "UNKNOWN_ERROR" ? UnknownError : T e
*/
export declare function isError<K extends ErrorCode, T extends CodedEthersError<K>>(error: any, code: K): error is T;
/**
* Returns true if %%error%% is a [CALL_EXCEPTION](api:CallExceptionError).
* Returns true if %%error%% is a [[CallExceptionError].
*/
export declare function isCallException(error: any): error is CallExceptionError;
/**

File diff suppressed because one or more lines are too long