diff --git a/.DS_Store b/.DS_Store
new file mode 100644
index 0000000..d673c50
Binary files /dev/null and b/.DS_Store differ
diff --git a/.env b/.env
new file mode 100644
index 0000000..98d5215
--- /dev/null
+++ b/.env
@@ -0,0 +1,3 @@
+RPC_URL = 'http://35.185.112.219:80'
+NODE_ADDRESS = '0xad730de8c4bfc3d845f7ce851bcf2ea17c049585'
+TRUSTED_FORWARDER = '0xa4B5eE2906090ce2cDbf5dfff944db26f397037D'
\ No newline at end of file
diff --git a/.prettierrc b/.prettierrc
deleted file mode 100644
index 65acf44..0000000
--- a/.prettierrc
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "printWidth": 120,
- "trailingComma": "all",
- "singleQuote": true
-}
\ No newline at end of file
diff --git a/.prettierrc.json b/.prettierrc.json
new file mode 100644
index 0000000..69eb82f
--- /dev/null
+++ b/.prettierrc.json
@@ -0,0 +1,8 @@
+{
+ "semi": true,
+ "singleQuote": true,
+ "printWidth": 80,
+ "tabWidth": 2,
+ "trailingComma": "all",
+ "arrowParens": "always"
+}
\ No newline at end of file
diff --git a/.vscode/launch.json b/.vscode/launch.json
new file mode 100644
index 0000000..90bff42
--- /dev/null
+++ b/.vscode/launch.json
@@ -0,0 +1,20 @@
+{
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "name": "ts-node",
+ "type": "node",
+ "request": "launch",
+ "args": [
+ "${relativeFile}"
+ ],
+ "runtimeArgs": [
+ "-r",
+ "ts-node/register"
+ ],
+ "cwd": "${workspaceRoot}",
+ "protocol": "inspector",
+ "internalConsoleOptions": "openOnSessionStart"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/README.md b/README.md
index a669452..6cd3f46 100644
--- a/README.md
+++ b/README.md
@@ -1,13 +1,25 @@
## LAC-NET Gas Model provider for ether.js
This repository contains the GasModelProvider ethers.js provider, an additional Provider to ethers.js to enable work with the gas model of LAC-NET.
+Ethers.js v6 compatible
+
+### Getting Started
+Installation
+
+ npm i @lacchain/gas-model-provider
+
### Usage
``` javascript
-import provider from "@lacchain/gas-model-provider";
+import { LacchainProvider, LacchainSigner } from '@lacchain/gas-model-provider';
-const provider = new provider.GasModelProvider( RPC_URL );
-const signer = new provider.GasModelSigner( PRIVATE_KEY, provider, NODE_ADDRESS, EXPIRATION );
+const provider = new LacchainProvider(RPC_URL);
+const signer: LacchainSigner = new LacchainSigner(
+ PRIVATE_KEY,
+ provider,
+ NODE_ADDRESS,
+ EXPIRATION
+);
```
Where:
@@ -21,13 +33,25 @@ Where:
#### Deploy smart contract
``` javascript
-import ethers from "ethers";
+import { ContractFactory } from 'ethers';
+import { LacchainProvider, LacchainSigner } from '@lacchain/gas-model-provider';
+
+const signer: LacchainSigner = new LacchainSigner(
+ PRIVATE_KEY,
+ new LacchainProvider(RPC_URL!),
+ NODE_ADDRESS!,
+ EXPIRATION
+);
+
+const contractFactory = new ContractFactory(
+ CONTRACT_ABI,
+ CONTRACT_BYTECODE,
+ signer
+);
-const factory = new ethers.ContractFactory( CONTRACT_ABI, CONTRACT_BYTECODE, signer )
-const contract = await factory.deploy( { gasLimit: 100000, gasPrice: 0 } )
-const receipt = await contract.deployTransaction.wait();
-console.log( `Contract Address: ${receipt.contractAddress}` );
-contractAddress = receipt.contractAddress;
+const contract = await contractFactory.deploy();
+const txReceipt = await contract.deploymentTransaction()?.wait();
+console.log( `Contract Address: ${txReceipt?.contractAddress}` );
```
Where:
@@ -39,16 +63,22 @@ Where:
#### Invoke and call contract
``` javascript
-const hash = "0x7465737400000000000000000000000000000000000000000000000000000000";
-const contract = new ethers.Contract(CONTRACT_ADDRESS, CONTRACT_ABI, signer);
-const tx = await contract.store(hash);
-const receipt = await tx.wait();
-console.log('Receipt', receipt);
-const stored = await contract.retreiveHash(SENDER_ADDRESS);
-console.log(stored);
+import { Contract } from 'ethers';
+import { LacchainProvider, LacchainSigner } from '@lacchain/gas-model-provider';
+
+const signer: LacchainSigner = new LacchainSigner(
+ PRIVATE_KEY,
+ new LacchainProvider(RPC_URL!),
+ NODE_ADDRESS!,
+ EXPIRATION
+);
+
+const contract = new Contract(CONTRACT_ADDRESS, CONTRACT_ABI, signer);
+
+await (await contract.someContractFunction()).wait();
```
Where:
- CONTRACT_ADDRESS: is the contract address
- CONTRACT_ABI: is the contract ABI
-- SENDER_ADDRESS: is the sender address
+
diff --git a/dist/ethers.js/src.ts/_admin/create-release.d.ts b/dist/ethers.js/src.ts/_admin/create-release.d.ts
new file mode 100644
index 0000000..9c0e274
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/create-release.d.ts
@@ -0,0 +1,2 @@
+export {};
+//# sourceMappingURL=create-release.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/create-release.d.ts.map b/dist/ethers.js/src.ts/_admin/create-release.d.ts.map
new file mode 100644
index 0000000..49cc95b
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/create-release.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"create-release.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_admin/create-release.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/create-release.js b/dist/ethers.js/src.ts/_admin/create-release.js
new file mode 100644
index 0000000..e04be9b
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/create-release.js
@@ -0,0 +1,51 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const changelog_js_1 = require("./utils/changelog.js");
+const date_js_1 = require("./utils/date.js");
+const path_js_1 = require("./utils/path.js");
+const run_js_1 = require("./utils/run.js");
+const npm_js_1 = require("./utils/npm.js");
+const version = process.argv[2] || null;
+(function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ // Get the change from the CHANGELOG
+ const changes = (0, changelog_js_1.getChanges)();
+ const change = version ? changes.filter((c) => (c.version === version))[0] : changes.shift();
+ if (change == null) {
+ throw new Error(`version not found: ${version}`);
+ }
+ console.log(change);
+ // Find the gitHead and release date
+ const versions = yield (0, npm_js_1.getVersions)("ethers");
+ const ver = versions.filter((c) => (c.version === change.version))[0];
+ if (ver == null) {
+ throw new Error(`no npm version found: ${change.version}`);
+ }
+ console.log(ver);
+ const title = `${change.title.split("(")[0].trim()} (${(0, date_js_1.getDateTime)(new Date(ver.date))})`;
+ const args = [
+ "release", "create", `v${change.version}`,
+ // "--draft", // DEBUGGING
+ "--title", title,
+ "--target", ver.gitHead,
+ "--notes", change.body.join("\n"),
+ ];
+ console.log(args);
+ const result = yield (0, run_js_1.run)("gh", args, (0, path_js_1.resolve)("."));
+ console.log("Published");
+ console.log(`See: ${(result.stdout || "").trim()}`);
+ });
+})().catch((e) => {
+ console.log("ERROR");
+ console.log(e);
+});
+//# sourceMappingURL=create-release.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/create-release.js.map b/dist/ethers.js/src.ts/_admin/create-release.js.map
new file mode 100644
index 0000000..f19af09
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/create-release.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"create-release.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_admin/create-release.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,uDAAkD;AAClD,6CAA8C;AAC9C,6CAA0C;AAC1C,2CAAqC;AACrC,2CAA6C;AAG7C,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;AAExC,CAAC;;QAEG,oCAAoC;QACpC,MAAM,OAAO,GAAG,IAAA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,CAAC;SACpC,CAAC;QACF,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAClB,MAAM,MAAM,GAAG,MAAM,IAAA,YAAG,EAAC,IAAI,EAAE,IAAI,EAAE,IAAA,iBAAO,EAAC,GAAG,CAAC,CAAC,CAAC;QACnD,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACzB,OAAO,CAAC,GAAG,CAAC,QAAS,CAAC,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,IAAI,EAAG,EAAE,CAAC,CAAC;IAC1D,CAAC;CAAA,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;IACb,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACrB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACnB,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/generate-diffs.d.ts b/dist/ethers.js/src.ts/_admin/generate-diffs.d.ts
new file mode 100644
index 0000000..35ddf43
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/generate-diffs.d.ts
@@ -0,0 +1,2 @@
+export {};
+//# sourceMappingURL=generate-diffs.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/generate-diffs.d.ts.map b/dist/ethers.js/src.ts/_admin/generate-diffs.d.ts.map
new file mode 100644
index 0000000..34e2525
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/generate-diffs.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"generate-diffs.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_admin/generate-diffs.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/generate-diffs.js b/dist/ethers.js/src.ts/_admin/generate-diffs.js
new file mode 100644
index 0000000..0503cbe
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/generate-diffs.js
@@ -0,0 +1,41 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const fs_1 = __importDefault(require("fs"));
+const npm_js_1 = require("./utils/npm.js");
+const path_js_1 = require("./utils/path.js");
+const git_js_1 = require("./utils/git.js");
+function escver(v) {
+ return v.replace(/\./, "-");
+}
+(function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ let versions = yield (0, npm_js_1.getVersions)("ethers");
+ versions = versions.filter((h) => (h.version.match(/^6\.[0-9]+\.[0-9]+$/)));
+ fs_1.default.writeFileSync((0, path_js_1.resolve)("misc/diffs/versions.txt"), versions.map((h) => h.version).join(","));
+ for (let i = 0; i < versions.length; i++) {
+ for (let j = i + 1; j < versions.length; j++) {
+ const filename = (0, path_js_1.resolve)(`misc/diffs/diff-${escver(versions[i].version)}_${escver(versions[j].version)}.txt`);
+ if (fs_1.default.existsSync(filename)) {
+ continue;
+ }
+ const tag0 = versions[i].gitHead, tag1 = versions[j].gitHead;
+ const diff = yield (0, git_js_1.getDiff)((0, path_js_1.resolve)("src.ts"), tag0, tag1);
+ console.log({ diff });
+ fs_1.default.writeFileSync(filename, diff);
+ }
+ }
+ });
+})();
+//# sourceMappingURL=generate-diffs.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/generate-diffs.js.map b/dist/ethers.js/src.ts/_admin/generate-diffs.js.map
new file mode 100644
index 0000000..6c9cfc7
---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S;iBAAE;gBAC1C,MAAM,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;gBAC7D,MAAM,IAAI,GAAG,MAAM,IAAA,gBAAO,EAAC,IAAA,iBAAO,EAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;gBAC1D,OAAO,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;gBACtB,YAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;aACpC;SACJ;IACL,CAAC;CAAA,CAAC,EAAE,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/test-browser.d.ts b/dist/ethers.js/src.ts/_admin/test-browser.d.ts
new file mode 100644
index 0000000..3c3ec88
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/test-browser.d.ts
@@ -0,0 +1,32 @@
+/**
+ *
+ *
+ * Paths
+ * /index.js => dist/ethers.js
+ * /tests/utils.js => in-memory hijack
+ * /static/* => output/*
+ * - index.html
+ * - assert.js
+ * /tests/* => lib.esm/_tests/*
+ */
+///
+import { WebSocket } from "ws";
+import { Server } from "http";
+export declare function getMime(filename: string): string;
+export declare class CDPSession {
+ #private;
+ readonly websocket: WebSocket;
+ constructor(url: string);
+ get target(): string;
+ get ready(): Promise;
+ get done(): Promise;
+ send(method: string, params: any): Promise;
+ _send(method: string, params: any): Promise;
+ navigate(url: string): Promise;
+}
+export type Options = {
+ port?: number;
+ redirects?: Record;
+};
+export declare function start(_root: string, options: Options): Promise;
+//# sourceMappingURL=test-browser.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/test-browser.d.ts.map b/dist/ethers.js/src.ts/_admin/test-browser.d.ts.map
new file mode 100644
index 0000000..b1629d5
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/test-browser.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-browser.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_admin/test-browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;;AAQH,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAE/B,OAAO,EAAgB,MAAM,EAAE,MAAM,MAAM,CAAC;AAuB5C,wBAAgB,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAShD;AAOD,qBAAa,UAAU;;IACnB,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;gBAclB,GAAG,EAAE,MAAM;IA4EvB,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAKzB;IAED,IAAI,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,CAE1B;IAEK,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IAO/C,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IAahD,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAG7C;AAED,MAAM,MAAM,OAAO,GAAG;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC,CAAC;AAgCF,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAyGtE"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/test-browser.js b/dist/ethers.js/src.ts/_admin/test-browser.js
new file mode 100644
index 0000000..f1bd60a
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/test-browser.js
@@ -0,0 +1,365 @@
+"use strict";
+/**
+ *
+ *
+ * Paths
+ * /index.js => dist/ethers.js
+ * /tests/utils.js => in-memory hijack
+ * /static/* => output/*
+ * - index.html
+ * - assert.js
+ * /tests/* => lib.esm/_tests/*
+ */
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
+ if (kind === "m") throw new TypeError("Private method is not writable");
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
+};
+var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+var _CDPSession_id, _CDPSession_resp, _CDPSession_readyOpen, _CDPSession_readyPage, _CDPSession_target, _CDPSession_session, _CDPSession_done, _CDPSession_exit;
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.start = exports.CDPSession = exports.getMime = void 0;
+// See: https://vanilla.aslushnikov.com/?Console
+const fs_1 = __importDefault(require("fs"));
+const child_process_1 = __importDefault(require("child_process"));
+const zlib_1 = __importDefault(require("zlib"));
+const ws_1 = require("ws");
+const http_1 = require("http");
+const path_1 = require("path");
+const mimes = {
+ css: "text/css",
+ doctree: "application/x-doctree",
+ eot: "application/vnd.ms-fontobject",
+ gif: "image/gif",
+ html: "text/html",
+ ico: "image/x-icon",
+ js: "application/javascript",
+ jpg: "image/jpeg",
+ jpeg: "image/jpeg",
+ json: "application/json",
+ map: "application/json",
+ md: "text/markdown",
+ png: "image/png",
+ svg: "image/svg+xml",
+ ttf: "application/x-font-ttf",
+ txt: "text/plain",
+ woff: "application/font-woff"
+};
+function getMime(filename) {
+ const mime = mimes[(filename.split('.').pop() || "").toLowerCase()];
+ if (mime == null) {
+ console.log(`WARN: NO MIME for ${filename}`);
+ return "application/octet-stream";
+ }
+ return mime;
+}
+exports.getMime = getMime;
+class CDPSession {
+ constructor(url) {
+ _CDPSession_id.set(this, void 0);
+ _CDPSession_resp.set(this, void 0);
+ _CDPSession_readyOpen.set(this, void 0);
+ _CDPSession_readyPage.set(this, void 0);
+ _CDPSession_target.set(this, void 0);
+ _CDPSession_session.set(this, void 0);
+ _CDPSession_done.set(this, void 0);
+ _CDPSession_exit.set(this, void 0);
+ this.websocket = new ws_1.WebSocket(url);
+ __classPrivateFieldSet(this, _CDPSession_id, 1, "f");
+ __classPrivateFieldSet(this, _CDPSession_resp, new Map(), "f");
+ __classPrivateFieldSet(this, _CDPSession_exit, (status) => { }, "f");
+ __classPrivateFieldSet(this, _CDPSession_done, new Promise((resolve) => {
+ __classPrivateFieldSet(this, _CDPSession_exit, resolve, "f");
+ }), "f");
+ __classPrivateFieldSet(this, _CDPSession_target, "", "f");
+ __classPrivateFieldSet(this, _CDPSession_session, "", "f");
+ const readyOpen = new Promise((resolve, reject) => {
+ this.websocket.onopen = () => __awaiter(this, void 0, void 0, function* () { resolve(); });
+ });
+ const readyPage = (() => __awaiter(this, void 0, void 0, function* () {
+ yield readyOpen;
+ const target = yield this._send("Target.getTargets", {});
+ if (target.targetInfos.length) {
+ __classPrivateFieldSet(this, _CDPSession_target, target.targetInfos[0].targetId, "f");
+ }
+ else {
+ const target = yield this._send("Target.createTarget", { url: "" });
+ __classPrivateFieldSet(this, _CDPSession_target, target.targetId, "f");
+ }
+ const attached = yield this._send("Target.attachToTarget", {
+ targetId: __classPrivateFieldGet(this, _CDPSession_target, "f"),
+ flatten: true
+ });
+ __classPrivateFieldSet(this, _CDPSession_session, attached.sessionId, "f");
+ }))();
+ __classPrivateFieldSet(this, _CDPSession_readyOpen, readyOpen, "f");
+ __classPrivateFieldSet(this, _CDPSession_readyPage, readyPage, "f");
+ this.websocket.onmessage = (_msg) => {
+ const msg = JSON.parse(_msg.data);
+ if (msg.id != null) {
+ const responder = __classPrivateFieldGet(this, _CDPSession_resp, "f").get(msg.id);
+ __classPrivateFieldGet(this, _CDPSession_resp, "f").delete(msg.id);
+ if (responder == null) {
+ console.log("WARN: unknown request ${ msg.id }");
+ return;
+ }
+ if (msg.error) {
+ responder.reject(new Error(msg.error));
+ }
+ else {
+ responder.resolve(msg.result);
+ }
+ }
+ else {
+ if (msg.method === "Console.messageAdded") {
+ const text = msg.params.message.text;
+ if (text.startsWith("#status")) {
+ __classPrivateFieldGet(this, _CDPSession_exit, "f").call(this, parseInt(text.split("=").pop()));
+ }
+ console.log(text);
+ //console.log(msg.params.message.text, `${ msg.params.message.url }:${ msg.params.message.line }`);
+ }
+ else if (msg.method === "Target.attachedToTarget") {
+ }
+ else {
+ console.log(`WARN: Unhandled event - ${JSON.stringify(msg)}`);
+ }
+ }
+ };
+ this.websocket.onerror = (error) => {
+ console.log(`WARN: WebSocket error - ${JSON.stringify(error)}`);
+ };
+ }
+ get target() {
+ return __classPrivateFieldGet(this, _CDPSession_target, "f");
+ }
+ get ready() {
+ return (() => __awaiter(this, void 0, void 0, function* () {
+ yield __classPrivateFieldGet(this, _CDPSession_readyOpen, "f");
+ yield __classPrivateFieldGet(this, _CDPSession_readyPage, "f");
+ }))();
+ }
+ get done() {
+ return __classPrivateFieldGet(this, _CDPSession_done, "f");
+ }
+ send(method, params) {
+ return __awaiter(this, void 0, void 0, function* () {
+ yield __classPrivateFieldGet(this, _CDPSession_readyOpen, "f");
+ yield __classPrivateFieldGet(this, _CDPSession_readyPage, "f");
+ return this._send(method, params);
+ });
+ }
+ _send(method, params) {
+ var _a, _b;
+ return __awaiter(this, void 0, void 0, function* () {
+ const id = (__classPrivateFieldSet(this, _CDPSession_id, (_b = __classPrivateFieldGet(this, _CDPSession_id, "f"), _a = _b++, _b), "f"), _a);
+ const payload = { id, method, params };
+ if (__classPrivateFieldGet(this, _CDPSession_session, "f")) {
+ payload.sessionId = __classPrivateFieldGet(this, _CDPSession_session, "f");
+ }
+ this.websocket.send(JSON.stringify(payload));
+ return new Promise((resolve, reject) => {
+ __classPrivateFieldGet(this, _CDPSession_resp, "f").set(id, { resolve, reject });
+ });
+ });
+ }
+ navigate(url) {
+ return __awaiter(this, void 0, void 0, function* () {
+ yield this.send("Page.navigate", { url });
+ });
+ }
+}
+exports.CDPSession = CDPSession;
+_CDPSession_id = new WeakMap(), _CDPSession_resp = new WeakMap(), _CDPSession_readyOpen = new WeakMap(), _CDPSession_readyPage = new WeakMap(), _CDPSession_target = new WeakMap(), _CDPSession_session = new WeakMap(), _CDPSession_done = new WeakMap(), _CDPSession_exit = new WeakMap();
+const TestData = (function () {
+ function load(tag) {
+ const filename = (0, path_1.resolve)("testcases", tag + ".json.gz");
+ const data = zlib_1.default.gunzipSync(fs_1.default.readFileSync(filename));
+ return [String(data.length), zlib_1.default.deflateRawSync(data).toString("base64")].join(",");
+ }
+ let data = [];
+ data.push(`import { ethers } from "/index.js";`);
+ data.push(`import { inflate } from "/static/tiny-inflate.js";`);
+ data.push(`const fs = new Map();`);
+ for (const filename of fs_1.default.readdirSync("testcases")) {
+ if (!filename.endsWith(".json.gz")) {
+ continue;
+ }
+ const tag = filename.split(".")[0];
+ data.push(`fs.set(${JSON.stringify(tag)}, ${JSON.stringify(load(tag))});`);
+ }
+ data.push(`export function loadTests(tag) {`);
+ data.push(` const data = fs.get(tag);`);
+ data.push(` if (data == null) { throw new Error("missing tag: " + tag); }`);
+ data.push(` const comps = data.split(",");`);
+ data.push(` const result = new Uint8Array(parseInt(comps[0]));`);
+ data.push(` inflate(ethers.decodeBase64(comps[1]), result);`);
+ data.push(` return JSON.parse(ethers.toUtf8String(result))`);
+ data.push(`}`);
+ return data.join("\n");
+})();
+function start(_root, options) {
+ if (options == null) {
+ options = {};
+ }
+ if (options.port == null) {
+ options.port = 8000;
+ }
+ const server = (0, http_1.createServer)((req, resp) => {
+ const url = (req.url || "").split("?")[0];
+ let transform = false;
+ let filename;
+ if (url === "/") {
+ filename = "./misc/test-browser/index.html";
+ }
+ else if (url === "/ethers.js" || url === "/index.js") {
+ filename = "./dist/ethers.js";
+ }
+ else if (url === "/ethers.js.map") {
+ filename = "./dist/ethers.js.map";
+ }
+ else if (url.startsWith("/static/")) {
+ filename = "./misc/test-browser/" + url.substring(8);
+ }
+ else if (url === "/tests/utils.js") {
+ //console.log({ status: 200, content: `<>` });
+ resp.writeHead(200, {
+ "Content-Length": TestData.length,
+ "Content-Type": getMime("testdata.js")
+ });
+ resp.end(TestData);
+ return;
+ }
+ else if (url.startsWith("/tests/")) {
+ transform = true;
+ filename = (0, path_1.join)("./lib.esm/_tests", url.substring(7));
+ }
+ else {
+ //console.log("FALLBACK");
+ filename = url.substring(1);
+ }
+ // Make sure we aren't crawling out of our sandbox
+ if (url[0] !== "/" || filename.substring(0, filename.length) !== filename) {
+ //console.log({ status: 403, reason: "escaping" });
+ resp.writeHead(403);
+ resp.end();
+ return;
+ }
+ try {
+ const stat = fs_1.default.statSync(filename);
+ if (stat.isDirectory()) {
+ // Redirect bare directory to its path (i.e. "/foo" => "/foo/")
+ if (url[url.length - 1] !== "/") {
+ //console.log({ status: 301, location: (url + "/") });
+ resp.writeHead(301, { Location: url + "/" });
+ resp.end();
+ return;
+ }
+ filename += "/index.html";
+ }
+ let content = fs_1.default.readFileSync(filename);
+ if (transform) {
+ content = Buffer.from(content.toString().replace(/import ([^;]*) from "([^"]*)";/g, (all, names, filename) => {
+ switch (filename) {
+ case "assert":
+ //case "path":
+ //case "fs":
+ //case "zlib":
+ return `import ${names} from "/static/${filename}.js"`;
+ }
+ return all;
+ }));
+ }
+ //console.log({ status: 200, filename });
+ resp.writeHead(200, {
+ "Content-Length": content.length,
+ "Content-Type": getMime(filename)
+ });
+ resp.end(content);
+ return;
+ }
+ catch (error) {
+ if (error.code === "ENOENT") {
+ //console.log({ status: 404, filename });
+ console.log(`WARN: Not found - ${filename}`);
+ resp.writeHead(404, {});
+ resp.end();
+ return;
+ }
+ //console.log({ status: 500, error: error.toString() });
+ console.log(`WARN: Server error - ${error.toString()}`);
+ resp.writeHead(500, {});
+ resp.end();
+ return;
+ }
+ });
+ return new Promise((resolve, reject) => {
+ server.listen(options.port, () => {
+ console.log(`Server running on: http://localhost:${options.port}`);
+ resolve(server);
+ });
+ });
+}
+exports.start = start;
+(function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ yield start((0, path_1.resolve)("."), { port: 8000 });
+ const cmds = [
+ "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
+ "/usr/bin/chromium"
+ ].filter((f) => { try {
+ fs_1.default.accessSync(f);
+ return true;
+ }
+ catch (error) {
+ return false;
+ } });
+ if (cmds.length === 0) {
+ throw new Error("no installed browser found");
+ }
+ const cmd = cmds[0];
+ const args = ["--headless", "--disable-gpu", "--remote-debugging-port=8022"];
+ const browser = child_process_1.default.spawn(cmd, args);
+ let url = yield new Promise((resolve, reject) => {
+ browser.stdout.on("data", (data) => {
+ console.log("OUT", data.toString());
+ });
+ browser.stderr.on("data", (data) => {
+ const text = data.toString();
+ for (const line of text.split("\n")) {
+ const match = line.match(/^DevTools listening on (.*)$/);
+ if (match) {
+ resolve(match[1]);
+ return;
+ }
+ }
+ });
+ });
+ console.log("URL:", url);
+ const session = new CDPSession(url);
+ yield session.ready;
+ yield session.send("Console.enable", {});
+ yield session.navigate("http:/\/localhost:8000");
+ const status = yield session.done;
+ console.log("STATUS:", status);
+ process.exit(status);
+ });
+})();
+//# sourceMappingURL=test-browser.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/test-browser.js.map b/dist/ethers.js/src.ts/_admin/test-browser.js.map
new file mode 100644
index 0000000..6de2ea2
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/test-browser.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-browser.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_admin/test-browser.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,gDAAgD;AAEhD,4CAAoB;AACpB,kEAA0C;AAC1C,gDAAwB;AAExB,2BAA+B;AAE/B,+BAA4C;AAC5C,+BAAqC;AAErC,MAAM,KAAK,GAA2B;IACpC,GAAG,EAAE,UAAU;IACf,OAAO,EAAE,uBAAuB;IAChC,GAAG,EAAE,+BAA+B;IACpC,GAAG,EAAE,WAAW;IAChB,IAAI,EAAE,WAAW;IACjB,GAAG,EAAE,cAAc;IACnB,EAAE,EAAE,wBAAwB;IAC5B,GAAG,EAAE,YAAY;IACjB,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,kBAAkB;IACxB,GAAG,EAAE,kBAAkB;IACvB,EAAE,EAAE,eAAe;IACnB,GAAG,EAAE,WAAW;IAChB,GAAG,EAAE,eAAe;IACpB,GAAG,EAAE,wBAAwB;IAC7B,GAAG,EAAE,YAAY;IACjB,IAAI,EAAE,uBAAuB;CAC9B,CAAC;AAEF,SAAgB,OAAO,CAAC,QAAgB;IACpC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;IAEpE,IAAI,IAAI,IAAI,IAAI,EAAE;QAChB,OAAO,CA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,UAAU,CAAC,GAAG,CAAC,CAAC;QACpC,MAAM,OAAO,CAAC,KAAK,CAAC;QACpB,MAAM,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAG,CAAC,CAAC;QAC1C,MAAM,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CAAC,CAAC;QAEjD,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC;QAClC,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QAC/B,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACzB,CAAC;CAAA,CAAC,EAAE,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/update-changelog.d.ts b/dist/ethers.js/src.ts/_admin/update-changelog.d.ts
new file mode 100644
index 0000000..9559d61
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/update-changelog.d.ts
@@ -0,0 +1,2 @@
+export {};
+//# sourceMappingURL=update-changelog.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/update-changelog.d.ts.map b/dist/ethers.js/src.ts/_admin/update-changelog.d.ts.map
new file mode 100644
index 0000000..7fea9d3
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/update-changelog.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"update-changelog.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_admin/update-changelog.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/update-changelog.js b/dist/ethers.js/src.ts/_admin/update-changelog.js
new file mode 100644
index 0000000..a1b6645
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/update-changelog.js
@@ -0,0 +1,178 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const fs_1 = __importDefault(require("fs"));
+const git_js_1 = require("./utils/git.js");
+const json_js_1 = require("./utils/json.js");
+const path_js_1 = require("./utils/path.js");
+const npm_js_1 = require("./utils/npm.js");
+const date_js_1 = require("./utils/date.js");
+function repeat(c, length) {
+ if (c.length === 0) {
+ throw new Error("too short");
+ }
+ while (c.length < length) {
+ c += c;
+ }
+ return c.substring(0, length);
+}
+function getChanges(tag0, tag1) {
+ return __awaiter(this, void 0, void 0, function* () {
+ const result = [];
+ const logs = yield (0, git_js_1.getLogs)(null, { tag0, tag1 });
+ for (const log of logs) {
+ if (log.body.startsWith("admin:") || log.body.startsWith("docs:")) {
+ continue;
+ }
+ let message = log.body;
+ const issues = [];
+ message = message.replace(/\((([0-9#,]|\s)*)\)/g, (all, text) => {
+ text = text.replace(/#([0-9]+)/g, (all, issue) => {
+ issues.push(issue);
+ return "";
+ });
+ if (text.replace(/,/g, "").trim()) {
+ console.log(`WARNING: commit leftovers ${JSON.stringify(text)}`);
+ }
+ return "";
+ }).replace(/\.+\s*$/, "").trim();
+ result.push({ message, issues, commit: log.commit });
+ }
+ return result;
+ });
+}
+(function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ // Get the already included versions in the CHANGELOG
+ const present = [{ version: "null", body: [] }];
+ {
+ const content = fs_1.default.readFileSync((0, path_js_1.resolve)("CHANGELOG.md")).toString();
+ for (const line of content.split("\n")) {
+ let match = line.match(/^ethers\/v(\S+)\s/);
+ if (match) {
+ present.push({ version: match[1], body: [line] });
+ }
+ else {
+ present[present.length - 1].body.push(line);
+ }
+ }
+ for (const { body } of present) {
+ while (body[body.length - 1].trim() === "") {
+ body.pop();
+ }
+ }
+ }
+ // Get the remote versions (along with their date and gitHead)
+ let versions = yield (0, npm_js_1.getVersions)("ethers");
+ versions = versions.filter((v) => (v.version.match(/^6\.[0-9]+\.[0-9]+$/)));
+ const entries = [];
+ const getPresent = (version) => {
+ const pres = present.filter((p) => (p.version === version));
+ return pres.length ? pres[0] : null;
+ };
+ // Add the first entry, which has no previous version to compare against
+ {
+ const pres = getPresent(versions[0].version);
+ if (pres) {
+ entries.push(pres);
+ }
+ else {
+ entries.push({
+ date: (0, date_js_1.getDateTime)(new Date(versions[0].date)),
+ version: versions[0].version,
+ changes: [{
+ message: "Initial release",
+ issues: [],
+ commit: versions[0].gitHead
+ }]
+ });
+ }
+ }
+ // Add each version, with preference given to present entries, as
+ // they may have been updated manually
+ let lastVer = versions[0];
+ for (let i = 1; i < versions.length; i++) {
+ const ver = versions[i];
+ // Prefer present entries
+ const pres = getPresent(ver.version);
+ if (pres) {
+ entries.push(pres);
+ lastVer = ver;
+ continue;
+ }
+ // Get the entry info from git
+ const version = ver.version;
+ const date = (0, date_js_1.getDateTime)(new Date(ver.date));
+ const changes = yield getChanges(lastVer.gitHead, ver.gitHead);
+ entries.push({ date, version, changes });
+ lastVer = ver;
+ }
+ // If this is a new version (not present in npm) add the changes
+ // from the lastest version until HEAD.
+ const curVer = (0, json_js_1.loadJson)((0, path_js_1.resolve)("package.json")).version;
+ if (curVer !== lastVer) {
+ // Include any present entry, as it was placed here by a
+ // previous run of update-changelog and may have been
+ // modified manually
+ const pres = getPresent(curVer);
+ if (pres) {
+ console.log(`WARNING: existing entry for ${curVer}; duplicating`);
+ entries.push(pres);
+ }
+ // Also include theentry from git
+ const latest = yield getChanges(lastVer.gitHead, "HEAD");
+ if (latest.length) {
+ entries.push({
+ date: (0, date_js_1.getDateTime)(new Date()),
+ version: curVer,
+ changes: latest
+ });
+ }
+ }
+ // Gerenate the CHANGELOG.md output
+ const output = [];
+ output.push("Change Log");
+ output.push("==========");
+ output.push("");
+ output.push("This change log is maintained by `src.ts/_admin/update-changelog.ts` but may also be manually updated.");
+ output.push("");
+ for (const ver of entries.reverse()) {
+ // Present entry; include verbatim
+ if ("body" in ver) {
+ ver.body.forEach((line) => output.push(line));
+ output.push("");
+ continue;
+ }
+ // Entry from git; format it nicely
+ const title = `ethers/v${ver.version} (${ver.date})`;
+ output.push(title);
+ output.push(repeat("-", title.length));
+ output.push("");
+ for (const change of ver.changes) {
+ let line = ` - ${change.message} (`;
+ line += change.issues.map((i) => {
+ return `[#${i}](https:/\/github.com/ethers-io/ethers.js/issues/${i})`;
+ }).join(", ");
+ if (change.issues.length) {
+ line += "; ";
+ }
+ line += `[${change.commit.substring(0, 7)}](https:/\/github.com/ethers-io/ethers.js/commit/${change.commit})).`;
+ output.push(line);
+ }
+ output.push("");
+ }
+ fs_1.default.writeFileSync((0, path_js_1.resolve)("CHANGELOG.md"), output.join("\n"));
+ });
+})();
+//# sourceMappingURL=update-changelog.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/update-changelog.js.map b/dist/ethers.js/src.ts/_admin/update-changelog.js.map
new file mode 100644
index 0000000..2d36e67
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/update-changelog.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"update-changelog.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_admin/update-changelog.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,4CAAoB;AAEpB,2CAAyC;AACzC,6CAA2C;AAC3C,6CAA0C;AAC1C,2CAA6C;AAC7C,6CAA8C;AAE9C,SAAS,MAAM,CAAC,CAAS,EAAE,MAAc;IACrC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,WAAW,CAAC,CAAC;KAAE;IACrD,OAAM,CAAC,CAAC,MAAM,GAAG,MAAM,EAAE;QAAE,CAAC,IAAI,CAAC,C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C,EAAE,CAAC,CAAE,oDAAqD,MAAM,CAAC,MAAO,KAAK,CAAC;gBACpH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;aACpB;YACD,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;SACnB;QAED,YAAE,CAAC,aAAa,CAAC,IAAA,iBAAO,EAAC,cAAc,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACjE,CAAC;CAAA,CAAC,EAAE,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/update-version.d.ts b/dist/ethers.js/src.ts/_admin/update-version.d.ts
new file mode 100644
index 0000000..933287b
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/update-version.d.ts
@@ -0,0 +1,2 @@
+export {};
+//# sourceMappingURL=update-version.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/update-version.d.ts.map b/dist/ethers.js/src.ts/_admin/update-version.d.ts.map
new file mode 100644
index 0000000..852166a
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/update-version.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"update-version.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_admin/update-version.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/update-version.js b/dist/ethers.js/src.ts/_admin/update-version.js
new file mode 100644
index 0000000..49ce46d
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/update-version.js
@@ -0,0 +1,118 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const semver_1 = __importDefault(require("semver"));
+const index_js_1 = require("../utils/index.js");
+const fs_js_1 = require("./utils/fs.js");
+const git_js_1 = require("./utils/git.js");
+const json_js_1 = require("./utils/json.js");
+const path_js_1 = require("./utils/path.js");
+const cache = {};
+function getNpmPackage(name) {
+ return __awaiter(this, void 0, void 0, function* () {
+ if (!cache[name]) {
+ const resp = yield (new index_js_1.FetchRequest("https:/\/registry.npmjs.org/" + name)).send();
+ resp.assertOk();
+ cache[name] = resp.bodyJson;
+ }
+ return cache[name] || null;
+ });
+}
+function writeVersion(version) {
+ const content = `/* Do NOT modify this file; see /src.ts/_admin/update-version.ts */\n\n/**\n * The current version of Ethers.\n */\nexport const version: string = "${version}";\n`;
+ (0, fs_js_1.atomicWrite)((0, path_js_1.resolve)("src.ts/_version.ts"), content);
+}
+(function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ // Local pkg
+ const pkgPath = (0, path_js_1.resolve)("package.json");
+ const pkgInfo = (0, json_js_1.loadJson)(pkgPath);
+ const tag = pkgInfo.publishConfig.tag;
+ // Get the remote version that matches our dist-tag
+ const remoteInfo = yield getNpmPackage(pkgInfo.name);
+ const remoteVersion = remoteInfo["dist-tags"][tag];
+ // Remote pkg
+ const remotePkgInfo = remoteInfo.versions[remoteVersion];
+ const remoteGitHead = remotePkgInfo.gitHead;
+ let gitHead = "";
+ for (const log of yield (0, git_js_1.getLogs)(["."])) {
+ if (log.body.startsWith("admin:")) {
+ continue;
+ }
+ if (log.body.startsWith("docs:")) {
+ continue;
+ }
+ if (log.body.startsWith("tests:")) {
+ continue;
+ }
+ gitHead = log.commit;
+ break;
+ }
+ if (gitHead === "") {
+ throw new Error("no meaningful commit found");
+ }
+ // There are new commits, not reflected in the package
+ // published on npm; update the gitHead and version
+ if (gitHead !== remoteGitHead) {
+ // Bump the version from the remote version
+ if (tag.indexOf("beta") >= 0) {
+ // Still a beta branch; advance the beta version
+ const prerelease = semver_1.default.prerelease(remoteVersion);
+ if (prerelease == null || prerelease.length !== 2) {
+ throw new Error("no prerelease found");
+ }
+ pkgInfo.version = semver_1.default.inc(remoteVersion, "prerelease", String(prerelease[0]));
+ }
+ else if (semver_1.default.minor(remoteVersion) == semver_1.default.minor(pkgInfo.version)) {
+ // If we want to bump the minor version, it was done explicitly in the pkg
+ pkgInfo.version = semver_1.default.inc(remoteVersion, "patch");
+ }
+ pkgInfo.gitHead = gitHead;
+ // Save the package.json
+ const check = { "default": 1, "require": 1, "import": 1, "types": 1 };
+ (0, json_js_1.saveJson)(pkgPath, pkgInfo, (path, a, b) => {
+ if ((path.startsWith("./") || path === ".") && check[a] && check[b]) {
+ const cmp = a.localeCompare(b);
+ if (cmp === 0) {
+ return cmp;
+ }
+ // Make sure require comes first; it has the types built-in
+ // so its ok
+ if (a === "require") {
+ return -1;
+ }
+ if (b === "require") {
+ return 1;
+ }
+ // Favour types the next-first and default for last
+ if (a === "types" || b === "default") {
+ return -1;
+ }
+ if (b === "types" || a === "default") {
+ return 1;
+ }
+ return cmp;
+ }
+ return a.localeCompare(b);
+ });
+ // Save the src.ts/_version.ts
+ writeVersion(pkgInfo.version);
+ }
+ });
+})().catch((error) => {
+ console.log("ERROR");
+ console.log(error);
+ process.exit(1);
+});
+//# sourceMappingURL=update-version.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/update-version.js.map b/dist/ethers.js/src.ts/_admin/update-version.js.map
new file mode 100644
index 0000000..43391c2
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/update-version.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"update-version.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_admin/update-version.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,oDAA4B;AAE5B,gDAAi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,CAAC,KAAK,CAAC,CAAC;IACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACnB,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/utils/changelog.d.ts b/dist/ethers.js/src.ts/_admin/utils/changelog.d.ts
new file mode 100644
index 0000000..27d912f
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/utils/changelog.d.ts
@@ -0,0 +1,7 @@
+export type ChangeVersion = {
+ version: string;
+ title: string;
+ body: Array;
+};
+export declare function getChanges(): Array;
+//# sourceMappingURL=changelog.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/utils/changelog.d.ts.map b/dist/ethers.js/src.ts/_admin/utils/changelog.d.ts.map
new file mode 100644
index 0000000..6f15011
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/utils/changelog.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"changelog.d.ts","sourceRoot":"","sources":["../../../../../src/ethers.js/src.ts/_admin/utils/changelog.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,aAAa,GAAG;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACvB,CAAC;AAEF,wBAAgB,UAAU,IAAI,KAAK,CAAC,aAAa,CAAC,CAqBjD"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/utils/changelog.js b/dist/ethers.js/src.ts/_admin/utils/changelog.js
new file mode 100644
index 0000000..fbb7102
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/utils/changelog.js
@@ -0,0 +1,30 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.getChanges = void 0;
+const fs_1 = __importDefault(require("fs"));
+const path_js_1 = require("./path.js");
+function getChanges() {
+ const changes = [
+ { title: "", version: "null", body: [] }
+ ];
+ const content = fs_1.default.readFileSync((0, path_js_1.resolve)("CHANGELOG.md")).toString();
+ for (const line of content.split("\n")) {
+ let match = line.match(/^ethers\/v(\S+)\s/);
+ if (match) {
+ changes.push({ version: match[1], title: line.trim(), body: [] });
+ }
+ else {
+ const l = line.trim();
+ if (l && !l.match(/^-+$/)) {
+ changes[changes.length - 1].body.push(l);
+ }
+ }
+ }
+ changes.shift();
+ return changes;
+}
+exports.getChanges = getChanges;
+//# sourceMappingURL=changelog.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/utils/changelog.js.map b/dist/ethers.js/src.ts/_admin/utils/changelog.js.map
new file mode 100644
index 0000000..14a99a6
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/utils/changelog.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"changelog.js","sourceRoot":"","sources":["../../../../../src/ethers.js/src.ts/_admin/utils/changelog.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,uCAAoC;AAQpC,SAAgB,UAAU;IACtB,MAAM,OAAO,GAAyB;QAClC,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,EAAG,EAAE;KAC5C,CAAC;IAEF,MAAM,OAAO,GAAG,YAAE,CAAC,YAAY,CAAC,IAAA,iBAAO,EAAC,cAAc,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;IACpE,KAAK,MAAM,IAAI,IAAI,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;QACpC,IAAI,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAC5C,IAAI,KAAK,EAAE;YACP,OAAO,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,EAAG,EAAE,CAAC,CAAC;SACtE;aAAM;YACH,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;YACtB,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE;gBACvB,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aAC5C;SACJ;KACJ;IAED,OAAO,CAAC,KAAK,EAAE,CAAC;IAEhB,OAAO,OAAO,CAAC;AACnB,CAAC;AArBD,gCAqBC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/utils/date.d.ts b/dist/ethers.js/src.ts/_admin/utils/date.d.ts
new file mode 100644
index 0000000..73e011d
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/utils/date.d.ts
@@ -0,0 +1,2 @@
+export declare function getDateTime(date: Date): string;
+//# sourceMappingURL=date.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/utils/date.d.ts.map b/dist/ethers.js/src.ts/_admin/utils/date.d.ts.map
new file mode 100644
index 0000000..a2e4235
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/utils/date.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../../../../src/ethers.js/src.ts/_admin/utils/date.ts"],"names":[],"mappings":"AAqBA,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAK9C"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/utils/date.js b/dist/ethers.js/src.ts/_admin/utils/date.js
new file mode 100644
index 0000000..57fb29b
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/utils/date.js
@@ -0,0 +1,34 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.getDateTime = void 0;
+function repeat(c, length) {
+ if (c.length === 0) {
+ throw new Error("too short");
+ }
+ while (c.length < length) {
+ c += c;
+ }
+ return c.substring(0, length);
+}
+function zpad(value, length) {
+ if (length == null) {
+ length = 2;
+ }
+ const str = String(value);
+ return repeat("0", length - str.length) + str;
+}
+function getDate(date) {
+ return [
+ date.getFullYear(),
+ zpad(date.getMonth() + 1),
+ zpad(date.getDate())
+ ].join("-");
+}
+function getDateTime(date) {
+ return getDate(date) + " " + [
+ zpad(date.getHours()),
+ zpad(date.getMinutes() + 1)
+ ].join(":");
+}
+exports.getDateTime = getDateTime;
+//# sourceMappingURL=date.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/utils/date.js.map b/dist/ethers.js/src.ts/_admin/utils/date.js.map
new file mode 100644
index 0000000..40906e1
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/utils/date.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"date.js","sourceRoot":"","sources":["../../../../../src/ethers.js/src.ts/_admin/utils/date.ts"],"names":[],"mappings":";;;AACA,SAAS,MAAM,CAAC,CAAS,EAAE,MAAc;IACrC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,WAAW,CAAC,CAAC;KAAE;IACrD,OAAM,CAAC,CAAC,MAAM,GAAG,MAAM,EAAE;QAAE,CAAC,IAAI,CAAC,CAAC;KAAE;IACpC,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AAClC,CAAC;AAED,SAAS,IAAI,CAAC,KAAa,EAAE,MAAe;IACxC,IAAI,MAAM,IAAI,IAAI,EAAE;QAAE,MAAM,GAAG,CAAC,CAAC;KAAE;IACnC,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC1B,OAAO,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC;AAClD,CAAC;AAED,SAAS,OAAO,CAAC,IAAU;IACvB,OAAO;QACH,IAAI,CAAC,WAAW,EAAE;QAClB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;QACzB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;KACvB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAChB,CAAC;AAED,SAAgB,WAAW,CAAC,IAAU;IAClC,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,GAAG,GAAG;QACzB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACrB,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;KAC9B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAChB,CAAC;AALD,kCAKC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/utils/fs.d.ts b/dist/ethers.js/src.ts/_admin/utils/fs.d.ts
new file mode 100644
index 0000000..fc65297
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/utils/fs.d.ts
@@ -0,0 +1,2 @@
+export declare function atomicWrite(path: string, value: string | Uint8Array): void;
+//# sourceMappingURL=fs.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/utils/fs.d.ts.map b/dist/ethers.js/src.ts/_admin/utils/fs.d.ts.map
new file mode 100644
index 0000000..2303bd9
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/utils/fs.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../../../../src/ethers.js/src.ts/_admin/utils/fs.ts"],"names":[],"mappings":"AAIA,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAI1E"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/utils/fs.js b/dist/ethers.js/src.ts/_admin/utils/fs.js
new file mode 100644
index 0000000..d81a3da
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/utils/fs.js
@@ -0,0 +1,15 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.atomicWrite = void 0;
+const fs_1 = __importDefault(require("fs"));
+const path_js_1 = require("./path.js");
+function atomicWrite(path, value) {
+ const tmp = (0, path_js_1.resolve)(".atomic-tmp");
+ fs_1.default.writeFileSync(tmp, value);
+ fs_1.default.renameSync(tmp, path);
+}
+exports.atomicWrite = atomicWrite;
+//# sourceMappingURL=fs.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/utils/fs.js.map b/dist/ethers.js/src.ts/_admin/utils/fs.js.map
new file mode 100644
index 0000000..36363d2
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/utils/fs.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"fs.js","sourceRoot":"","sources":["../../../../../src/ethers.js/src.ts/_admin/utils/fs.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AAEpB,uCAAoC;AAEpC,SAAgB,WAAW,CAAC,IAAY,EAAE,KAA0B;IAChE,MAAM,GAAG,GAAG,IAAA,iBAAO,EAAC,aAAa,CAAC,CAAC;IACnC,YAAE,CAAC,aAAa,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC7B,YAAE,CAAC,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AAC7B,CAAC;AAJD,kCAIC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/utils/git.d.ts b/dist/ethers.js/src.ts/_admin/utils/git.d.ts
new file mode 100644
index 0000000..4fe7e80
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/utils/git.d.ts
@@ -0,0 +1,15 @@
+export declare function getGitTag(filename: string): Promise;
+export declare function getModifiedTime(filename: string): Promise;
+export interface GitLog {
+ commit: string;
+ author: string;
+ date: string;
+ body: string;
+}
+export declare function getLogs(files?: null | Array, range?: null | {
+ tag0: string;
+ tag1: string;
+}, limit?: null | number): Promise>;
+export declare function getDiff(filename: string, tag0: string, tag1: string): Promise;
+export declare function getTags(): Promise>;
+//# sourceMappingURL=git.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/utils/git.d.ts.map b/dist/ethers.js/src.ts/_admin/utils/git.d.ts.map
new file mode 100644
index 0000000..c009540
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/utils/git.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../../../../src/ethers.js/src.ts/_admin/utils/git.ts"],"names":[],"mappings":"AASA,wBAAsB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,CAUxE;AAED,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,CAiB9E;AAED,MAAM,WAAW,MAAM;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,wBAAsB,OAAO,CAAC,KAAK,CAAC,EAAE,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,EAAE,IAAI,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAsCxJ;AAED,wBAAsB,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAI3F;AAED,wBAAsB,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAItD"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/utils/git.js b/dist/ethers.js/src.ts/_admin/utils/git.js
new file mode 100644
index 0000000..f1a6888
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/utils/git.js
@@ -0,0 +1,124 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.getTags = exports.getDiff = exports.getLogs = exports.getModifiedTime = exports.getGitTag = void 0;
+const path_1 = require("path");
+const url_1 = require("url");
+const run_js_1 = require("./run.js");
+const __filename = (0, url_1.fileURLToPath)(import.meta.url);
+const __dirname = (0, path_1.dirname)(__filename);
+// Returns the most recent git commit hash for a given filename
+function getGitTag(filename) {
+ return __awaiter(this, void 0, void 0, function* () {
+ const result = yield (0, run_js_1.run)("git", ["log", "-n", "1", "--", filename], __dirname);
+ if (!result.ok) {
+ throw new Error(`git log error`);
+ }
+ let log = result.stdout.trim();
+ if (!log) {
+ return null;
+ }
+ const hashMatch = log.match(/^commit\s+([0-9a-f]{40})\n/i);
+ if (!hashMatch) {
+ return null;
+ }
+ return hashMatch[1];
+ });
+}
+exports.getGitTag = getGitTag;
+function getModifiedTime(filename) {
+ return __awaiter(this, void 0, void 0, function* () {
+ const result = yield (0, run_js_1.run)("git", ["log", "-n", "1", "--", filename], __dirname);
+ if (!result.ok) {
+ throw new Error(`git log error`);
+ }
+ let log = result.stdout.trim();
+ if (!log) {
+ return null;
+ }
+ for (let line of log.split("\n")) {
+ line = line.trim();
+ if (!line) {
+ break;
+ }
+ const match = line.match(/^date:\s+(.*)$/i);
+ if (match) {
+ return (new Date(match[1].trim())).getTime();
+ ;
+ }
+ }
+ return null;
+ });
+}
+exports.getModifiedTime = getModifiedTime;
+function getLogs(files, range, limit) {
+ return __awaiter(this, void 0, void 0, function* () {
+ const args = ["log", "-n", String((limit != null) ? limit : 100)];
+ if (range) {
+ args.push(`${range.tag0}..${range.tag1}`);
+ }
+ if (files) {
+ args.push("--");
+ files.forEach((f) => args.push(f));
+ }
+ const exec = yield (0, run_js_1.run)("git", args);
+ if (!exec.ok) {
+ throw new Error(`git log error`);
+ }
+ const log = exec.stdout.trim();
+ if (!log) {
+ return [];
+ }
+ const results = [{ commit: "", author: "", date: "", body: "" }];
+ for (const line of log.split("\n")) {
+ const hashMatch = line.match(/^commit\s+([0-9a-f]{40})/i);
+ if (hashMatch) {
+ results.push({ commit: hashMatch[1], author: "", date: "", body: "" });
+ }
+ else {
+ if (line.startsWith("Author:")) {
+ results[results.length - 1].author = line.substring(7).trim();
+ }
+ else if (line.startsWith("Date:")) {
+ results[results.length - 1].date = line.substring(5).trim();
+ }
+ else {
+ results[results.length - 1].body = (results[results.length - 1].body + " " + line).trim();
+ }
+ }
+ }
+ // Nix the bootstrap entry
+ results.shift();
+ return results;
+ });
+}
+exports.getLogs = getLogs;
+function getDiff(filename, tag0, tag1) {
+ return __awaiter(this, void 0, void 0, function* () {
+ const result = yield (0, run_js_1.run)("git", ["diff", `${tag0}..${tag1}`, "--", filename]);
+ if (!result.ok) {
+ throw new Error(`git log error`);
+ }
+ return result.stdout.trim();
+ });
+}
+exports.getDiff = getDiff;
+function getTags() {
+ return __awaiter(this, void 0, void 0, function* () {
+ const result = yield (0, run_js_1.run)("git", ["tag"]);
+ if (!result.ok) {
+ throw new Error(`git log error`);
+ }
+ return result.stdout.trim().split("\n");
+ });
+}
+exports.getTags = getTags;
+//# sourceMappingURL=git.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/utils/git.js.map b/dist/ethers.js/src.ts/_admin/utils/git.js.map
new file mode 100644
index 0000000..2257bcb
--- /dev/null
+++ b/dist/ethers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AAG,GAAG,GAAG,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;iBAC7F;aACJ;SACL;QAED,0BAA0B;QAC1B,OAAO,CAAC,KAAK,EAAE,CAAC;QAEhB,OAAO,OAAO,CAAC;IACnB,CAAC;CAAA;AAtCD,0BAsCC;AAED,SAAsB,OAAO,CAAC,QAAgB,EAAE,IAAY,EAAE,IAAY;;QACtE,MAAM,MAAM,GAAG,MAAM,IAAA,YAAG,EAAC,KAAK,EAAE,CAAE,MAAM,EAAE,GAAI,IAAK,KAAM,IAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,CAAE,CAAC,CAAC;QACpF,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE;YAAE,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;SAAE;QACrD,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IAChC,CAAC;CAAA;AAJD,0BAIC;AAED,SAAsB,OAAO;;QACzB,MAAM,MAAM,GAAG,MAAM,IAAA,YAAG,EAAC,KAAK,EAAE,CAAE,KAAK,CAAE,CAAC,CAAC;QAC3C,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE;YAAE,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;SAAE;QACrD,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC5C,CAAC;CAAA;AAJD,0BAIC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/utils/json.d.ts b/dist/ethers.js/src.ts/_admin/utils/json.d.ts
new file mode 100644
index 0000000..23d3a44
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/utils/json.d.ts
@@ -0,0 +1,4 @@
+export declare function loadJson(path: string): any;
+export type SortFunc = (parent: string, a: string, b: string) => number;
+export declare function saveJson(filename: string, data: any, sort?: boolean | SortFunc): any;
+//# sourceMappingURL=json.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/utils/json.d.ts.map b/dist/ethers.js/src.ts/_admin/utils/json.d.ts.map
new file mode 100644
index 0000000..dcd7c28
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/utils/json.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../../../../src/ethers.js/src.ts/_admin/utils/json.ts"],"names":[],"mappings":"AAKA,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAE1C;AAID,MAAM,MAAM,QAAQ,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;AAExE,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,GAAG,CA0BpF"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/utils/json.js b/dist/ethers.js/src.ts/_admin/utils/json.js
new file mode 100644
index 0000000..e110a7c
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/utils/json.js
@@ -0,0 +1,40 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.saveJson = exports.loadJson = void 0;
+const fs_1 = __importDefault(require("fs"));
+const fs_js_1 = require("./fs.js");
+function loadJson(path) {
+ return JSON.parse(fs_1.default.readFileSync(path).toString());
+}
+exports.loadJson = loadJson;
+function saveJson(filename, data, sort) {
+ let replacer = undefined;
+ if (sort) {
+ replacer = (key, value) => {
+ if (Array.isArray(value)) {
+ // pass
+ }
+ else if (value && typeof (value) === "object") {
+ const keys = Object.keys(value);
+ let sortFunc;
+ if (typeof (sort) === "function") {
+ sortFunc = function (a, b) {
+ return sort(key, a, b);
+ };
+ }
+ keys.sort(sortFunc);
+ return keys.reduce((accum, key) => {
+ accum[key] = value[key];
+ return accum;
+ }, {});
+ }
+ return value;
+ };
+ }
+ (0, fs_js_1.atomicWrite)(filename, JSON.stringify(data, replacer, 2) + "\n");
+}
+exports.saveJson = saveJson;
+//# sourceMappingURL=json.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/utils/json.js.map b/dist/ethers.js/src.ts/_admin/utils/json.js.map
new file mode 100644
index 0000000..1893d52
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/utils/json.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"json.js","sourceRoot":"","sources":["../../../../../src/ethers.js/src.ts/_admin/utils/json.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AAEpB,mCAAsC;AAGtC,SAAgB,QAAQ,CAAC,IAAY;IACjC,OAAO,IAAI,CAAC,KAAK,CAAC,YAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;AACxD,CAAC;AAFD,4BAEC;AAMD,SAAgB,QAAQ,CAAC,QAAgB,EAAE,IAAS,EAAE,IAAyB;IAE3E,IAAI,QAAQ,GAA2B,SAAS,CAAC;IACjD,IAAI,IAAI,EAAE;QACN,QAAQ,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;YACtB,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;gBACtB,OAAO;aACV;iBAAM,IAAI,KAAK,IAAI,OAAM,CAAC,KAAK,CAAC,KAAK,QAAQ,EAAE;gBAC5C,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBAChC,IAAI,QAAwD,CAAC;gBAC7D,IAAI,OAAM,CAAC,IAAI,CAAC,KAAK,UAAU,EAAE;oBAC7B,QAAQ,GAAG,UAAS,CAAS,EAAE,CAAS;wBACpC,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;oBAC3B,CAAC,CAAA;iBACJ;gBACD,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBACpB,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;oBAC9B,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;oBACxB,OAAO,KAAK,CAAC;gBACjB,CAAC,EAAuB,EAAE,CAAC,CAAC;aAC/B;YACD,OAAO,KAAK,CAAC;QACjB,CAAC,CAAC;KACL;IAED,IAAA,mBAAW,EAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;AACpE,CAAC;AA1BD,4BA0BC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/utils/npm.d.ts b/dist/ethers.js/src.ts/_admin/utils/npm.d.ts
new file mode 100644
index 0000000..28b8b6b
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/utils/npm.d.ts
@@ -0,0 +1,8 @@
+export declare function _getNpmPackage(name: string): Promise;
+export type Version = {
+ version: string;
+ gitHead: string;
+ date: string;
+};
+export declare function getVersions(name: string): Promise>;
+//# sourceMappingURL=npm.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/utils/npm.d.ts.map b/dist/ethers.js/src.ts/_admin/utils/npm.d.ts.map
new file mode 100644
index 0000000..407e7d1
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/utils/npm.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"npm.d.ts","sourceRoot":"","sources":["../../../../../src/ethers.js/src.ts/_admin/utils/npm.ts"],"names":[],"mappings":"AAIA,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAQ/D;AAED,MAAM,MAAM,OAAO,GAAG;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAYvE"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/utils/npm.js b/dist/ethers.js/src.ts/_admin/utils/npm.js
new file mode 100644
index 0000000..dbc70f4
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/utils/npm.js
@@ -0,0 +1,124 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.getVersions = exports._getNpmPackage = void 0;
+const index_js_1 = require("../../utils/index.js");
+const cache = {};
+function _getNpmPackage(name) {
+ return __awaiter(this, void 0, void 0, function* () {
+ if (!cache[name]) {
+ const resp = yield (new index_js_1.FetchRequest("https:/\/registry.npmjs.org/" + name)).send();
+ resp.assertOk();
+ cache[name] = resp.bodyJson;
+ }
+ return cache[name] || null;
+ });
+}
+exports._getNpmPackage = _getNpmPackage;
+function getVersions(name) {
+ return __awaiter(this, void 0, void 0, function* () {
+ const result = [];
+ const pkg = yield _getNpmPackage(name);
+ for (const version in pkg.versions) {
+ const gitHead = pkg.versions[version].gitHead;
+ const date = pkg.time[version];
+ if (gitHead == null || date == null) {
+ continue;
+ }
+ result.push({ date, gitHead, version });
+ }
+ return result;
+ });
+}
+exports.getVersions = getVersions;
+/*
+(async function() {
+ //console.log(await _getNpmPackage("ethers"));
+ console.log(await getGitHeads("ethers"));
+})();
+*/
+/*
+import semver from "semver";
+
+import { FetchRequest } from "../../utils/index.js";
+
+export type PackageInfo = {
+ dependencies: { [ name: string ]: string };
+ devDependencies: { [ name: string ]: string };
+ gitHead: string;
+ name: string;
+ version: string;
+ tarballHash: string;
+ location: "remote" | "local";
+ _ethers_nobuild: boolean;
+};
+
+export class Package {
+ readonly #info: PackageInfo;
+
+ constructor(info: PackageInfo) {
+ this.#info = info;
+ }
+
+ get name(): string { return this.#info.name; }
+ get version(): string { return this.#info.version; }
+
+ get dependencies(): Record { return this.#info.dependencies; }
+ get devDependencies(): Record { return this.#info.devDependencies; }
+
+ get gitHead(): string { return this.#info.gitHead; }
+ get tarballHash(): string { return this.#info.tarballHash; }
+
+}
+
+
+const cache: Record = { };
+
+async function getPackageInfo(name: string): Promise {
+ if (!cache[name]) {
+ const resp = await (new FetchRequest("https:/\/registry.npmjs.org/" + name)).send();
+ resp.assertOk();
+ cache[name] = resp.bodyJson();
+ }
+
+ return cache[name] || null;
+}
+
+export async function getPackage(name: string, version?: string): Promise {
+ const infos = await getPackageInfo(name);
+ if (infos == null) { return null; }
+
+ if (version == null) {
+ const versions = Object.keys(infos.versions);
+ versions.sort(semver.compare);
+
+ // HACK: So v5 continues working while v6 is managed by reticulate
+ version = "6.0.0";
+ while (version.indexOf("beta") >= 0 || semver.gte(version, "6.0.0")) {
+ version = versions.pop();
+ }
+ }
+
+ const info = infos.versions[version];
+
+ return new Package({
+ dependencies: (info.dependencies || {}),
+ devDependencies: (info.devDependencies || {}),
+ gitHead: info.gitHead,
+ location: "remote",
+ name: info.name,
+ tarballHash: info.tarballHash,
+ version : info.version,
+ _ethers_nobuild: !!info._ethers_nobuild,
+ });
+}
+*/
+//# sourceMappingURL=npm.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/utils/npm.js.map b/dist/ethers.js/src.ts/_admin/utils/npm.js.map
new file mode 100644
index 0000000..298c053
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/utils/npm.js.map
@@ -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newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/utils/path.d.ts b/dist/ethers.js/src.ts/_admin/utils/path.d.ts
new file mode 100644
index 0000000..e146d5d
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/utils/path.d.ts
@@ -0,0 +1,3 @@
+export declare const ROOT: string;
+export declare function resolve(...args: Array): string;
+//# sourceMappingURL=path.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/utils/path.d.ts.map b/dist/ethers.js/src.ts/_admin/utils/path.d.ts.map
new file mode 100644
index 0000000..3871fab
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/utils/path.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../../../../src/ethers.js/src.ts/_admin/utils/path.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,IAAI,QAAmC,CAAC;AAErD,wBAAgB,OAAO,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,CAItD"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/utils/path.js b/dist/ethers.js/src.ts/_admin/utils/path.js
new file mode 100644
index 0000000..8bd585d
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/utils/path.js
@@ -0,0 +1,15 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.resolve = exports.ROOT = void 0;
+const path_1 = require("path");
+const url_1 = require("url");
+const __filename = (0, url_1.fileURLToPath)(import.meta.url);
+const __dirname = (0, path_1.dirname)(__filename);
+exports.ROOT = (0, path_1.resolve)(__dirname, "../../../");
+function resolve(...args) {
+ args = args.slice();
+ args.unshift(exports.ROOT);
+ return path_1.resolve.apply(null, args);
+}
+exports.resolve = resolve;
+//# sourceMappingURL=path.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/utils/path.js.map b/dist/ethers.js/src.ts/_admin/utils/path.js.map
new file mode 100644
index 0000000..ac6d8ae
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/utils/path.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"path.js","sourceRoot":"","sources":["../../../../../src/ethers.js/src.ts/_admin/utils/path.ts"],"names":[],"mappings":";;;AAAA,+BAAoD;AACpD,6BAAoC;AAEpC,MAAM,UAAU,GAAG,IAAA,mBAAa,EAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,IAAA,cAAO,EAAC,UAAU,CAAC,CAAC;AAEzB,QAAA,IAAI,GAAG,IAAA,cAAQ,EAAC,SAAS,EAAE,WAAW,CAAC,CAAC;AAErD,SAAgB,OAAO,CAAC,GAAG,IAAmB;IAC1C,IAAI,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;IACpB,IAAI,CAAC,OAAO,CAAC,YAAI,CAAC,CAAC;IACnB,OAAO,cAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AACtC,CAAC;AAJD,0BAIC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/utils/run.d.ts b/dist/ethers.js/src.ts/_admin/utils/run.d.ts
new file mode 100644
index 0000000..393e7d4
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/utils/run.d.ts
@@ -0,0 +1,15 @@
+///
+export declare class RunResult {
+ #private;
+ constructor(progname: string, args: Array, status: null | number, stdout: string | Buffer, stderr: string | Buffer);
+ get cmd(): string;
+ get stderr(): string | null;
+ get _stderr(): string | Buffer;
+ get stdout(): string;
+ get _stdout(): string | Buffer;
+ get status(): null | number;
+ get ok(): boolean;
+ assertOk(message?: string): void;
+}
+export declare function run(progname: string, args?: Array, currentWorkingDirectory?: string): RunResult;
+//# sourceMappingURL=run.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/utils/run.d.ts.map b/dist/ethers.js/src.ts/_admin/utils/run.d.ts.map
new file mode 100644
index 0000000..a2683cd
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/utils/run.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../../../src/ethers.js/src.ts/_admin/utils/run.ts"],"names":[],"mappings":";AAEA,qBAAa,SAAS;;gBAMN,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,GAAG,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM;IAO1H,IAAI,GAAG,IAAI,MAAM,CAAsB;IAEvC,IAAI,MAAM,IAAI,MAAM,GAAG,IAAI,CAE1B;IAED,IAAI,OAAO,IAAI,MAAM,GAAG,MAAM,CAE7B;IAED,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,OAAO,IAAI,MAAM,GAAG,MAAM,CAE7B;IAED,IAAI,MAAM,IAAI,IAAI,GAAG,MAAM,CAAyB;IAEpD,IAAI,EAAE,IAAI,OAAO,CAEhB;IAED,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;CAKnC;AAED,wBAAgB,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,uBAAuB,CAAC,EAAE,MAAM,GAAG,SAAS,CAgBvG"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/utils/run.js b/dist/ethers.js/src.ts/_admin/utils/run.js
new file mode 100644
index 0000000..15b3f10
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/utils/run.js
@@ -0,0 +1,72 @@
+"use strict";
+var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
+ if (kind === "m") throw new TypeError("Private method is not writable");
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
+};
+var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
+};
+var _RunResult_cmd, _RunResult_status, _RunResult_stdout, _RunResult_stderr;
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.run = exports.RunResult = void 0;
+const child_process_1 = require("child_process");
+class RunResult {
+ constructor(progname, args, status, stdout, stderr) {
+ _RunResult_cmd.set(this, void 0);
+ _RunResult_status.set(this, void 0);
+ _RunResult_stdout.set(this, void 0);
+ _RunResult_stderr.set(this, void 0);
+ __classPrivateFieldSet(this, _RunResult_cmd, `${progname} ${args.map((a) => JSON.stringify(a))}`, "f");
+ __classPrivateFieldSet(this, _RunResult_status, status, "f");
+ __classPrivateFieldSet(this, _RunResult_stdout, stdout, "f");
+ __classPrivateFieldSet(this, _RunResult_stderr, stderr, "f");
+ }
+ get cmd() { return __classPrivateFieldGet(this, _RunResult_cmd, "f"); }
+ get stderr() {
+ return this._stderr.toString() || null;
+ }
+ get _stderr() {
+ return __classPrivateFieldGet(this, _RunResult_stderr, "f");
+ }
+ get stdout() {
+ return this._stdout.toString();
+ }
+ get _stdout() {
+ return __classPrivateFieldGet(this, _RunResult_stdout, "f");
+ }
+ get status() { return __classPrivateFieldGet(this, _RunResult_status, "f"); }
+ get ok() {
+ return (__classPrivateFieldGet(this, _RunResult_stderr, "f").length === 0 && __classPrivateFieldGet(this, _RunResult_status, "f") === 0);
+ }
+ assertOk(message) {
+ if (!this.ok) {
+ throw new Error(message || `failed to run: ${__classPrivateFieldGet(this, _RunResult_cmd, "f")}`);
+ }
+ }
+}
+exports.RunResult = RunResult;
+_RunResult_cmd = new WeakMap(), _RunResult_status = new WeakMap(), _RunResult_stdout = new WeakMap(), _RunResult_stderr = new WeakMap();
+;
+function run(progname, args, currentWorkingDirectory) {
+ if (args == null) {
+ args = [];
+ }
+ const options = {};
+ if (currentWorkingDirectory) {
+ options.cwd = currentWorkingDirectory;
+ }
+ const child = (0, child_process_1.spawnSync)(progname, args, options);
+ const result = new RunResult(progname, args, child.status, child.stdout, child.stderr);
+ if (child.error) {
+ const error = child.error;
+ error.result = result;
+ throw error;
+ }
+ return result;
+}
+exports.run = run;
+//# sourceMappingURL=run.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_admin/utils/run.js.map b/dist/ethers.js/src.ts/_admin/utils/run.js.map
new file mode 100644
index 0000000..9c059ec
--- /dev/null
+++ b/dist/ethers.js/src.ts/_admin/utils/run.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"run.js","sourceRoot":"","sources":["../../../../../src/ethers.js/src.ts/_admin/utils/run.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,iDAA0C;AAE1C,MAAa,SAAS;IAMlB,YAAY,QAAgB,EAAE,IAAmB,EAAE,MAAqB,EAAE,MAAuB,EAAE,MAAuB;QALjH,iCAAa;QACb,oCAAuB;QACvB,oCAAyB;QACzB,oCAAyB;QAG9B,uBAAA,IAAI,kBAAQ,GAAI,QAAS,IAAK,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,MAAA,CAAC;QACnE,uBAAA,IAAI,qBAAW,MAAM,MAAA,CAAC;QACtB,uBAAA,IAAI,qBAAW,MAAM,MAAA,CAAC;QACtB,uBAAA,IAAI,qBAAW,MAAM,MAAA,CAAC;IAC1B,CAAC;IAED,IAAI,GAAG,KAAa,OAAO,uBAAA,IAAI,sBAAK,CAAC,CAAC,CAAC;IAEvC,IAAI,MAAM;QACN,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,I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CAAC;QACpB,KAAM,CAAC,MAAM,GAAG,MAAM,CAAC;QAC7B,MAAM,KAAK,CAAC;KACf;IAED,OAAO,MAAM,CAAC;AAClB,CAAC;AAhBD,kBAgBC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/blockchain-data.d.ts b/dist/ethers.js/src.ts/_tests/blockchain-data.d.ts
new file mode 100644
index 0000000..1af3cb5
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/blockchain-data.d.ts
@@ -0,0 +1,85 @@
+export type TestBlockchainNetwork = "mainnet" | "goerli";
+export interface TestBlockchainAddress {
+ test: string;
+ address: string;
+ code?: string;
+ nonce?: number;
+ name?: string;
+ balance?: bigint;
+ storage?: Record;
+}
+export interface TestBlockchainBlock {
+ test: string;
+ hash: string;
+ parentHash: string;
+ number: number;
+ timestamp: number;
+ nonce: string;
+ difficulty: bigint;
+ gasLimit: bigint;
+ gasUsed: bigint;
+ miner: string;
+ extraData: string;
+ transactions: Array;
+ baseFeePerGas?: bigint;
+}
+export interface TestBlockchainTransaction {
+ test: string;
+ hash: string;
+ blockHash: string;
+ blockNumber: number;
+ type: number;
+ from: string;
+ gasPrice: bigint;
+ gasLimit: bigint;
+ to: string;
+ value: bigint;
+ nonce: number;
+ data: string;
+ signature: {
+ r: string;
+ s: string;
+ yParity: 0 | 1;
+ v: number;
+ networkV: null | bigint;
+ };
+ creates: null | string;
+ chainId: bigint;
+ accessList?: Array>>;
+ maxPriorityFeePerGas?: bigint;
+ maxFeePerGas?: bigint;
+}
+export interface TestBlockchainReceipt {
+ test: string;
+ blockHash: string;
+ blockNumber: number;
+ type: number;
+ contractAddress: null | string;
+ cumulativeGasUsed: bigint;
+ from: string;
+ gasUsed: bigint;
+ gasPrice: bigint;
+ logs: Array<{
+ address: string;
+ blockHash: string;
+ blockNumber: number;
+ data: string;
+ index: number;
+ topics: Array;
+ transactionHash: string;
+ transactionIndex: number;
+ }>;
+ logsBloom: string;
+ root: null | string;
+ status: null | number;
+ to: string;
+ hash: string;
+ index: number;
+}
+export declare const testAddress: Record>;
+export declare const testBlock: Record>;
+export declare const testTransaction: Record>;
+export declare const testReceipt: Record>;
+export declare const networkNames: Array;
+export declare function networkFeatureAtBlock(feature: string, block: number): boolean;
+//# sourceMappingURL=blockchain-data.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/blockchain-data.d.ts.map b/dist/ethers.js/src.ts/_tests/blockchain-data.d.ts.map
new file mode 100644
index 0000000..8a22af0
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/blockchain-data.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"blockchain-data.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/blockchain-data.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAC7B,SAAS,GAAG,QAAQ,CAAC;AAEzB,MAAM,WAAW,qBAAqB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACnC;AAED,MAAM,WAAW,mBAAmB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;I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EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;QAClB,WAAW,EAAE,MAAM,CAAC;QACpB,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QACtB,eAAe,EAAE,MAAM,CAAC;QACxB,gBAAgB,EAAE,MAAM,CAAC;KAC5B,CAAC,CAAA;IACF,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,IAAI,GAAG,MAAM,CAAC;IACpB,MAAM,EAAE,IAAI,GAAG,MAAM,CAAC;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAA;CAChB;AAED,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,qBAAqB,EAAE,KAAK,CAAC,qBAAqB,CAAC,CAuBnF,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,qBAAqB,EAAE,KAAK,CAAC,mBAAmB,CAAC,CA8D/E,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,qBAAqB,EAAE,KAAK,CAAC,yBAAyB,CAAC,CAwD3F,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,qBAAqB,EAAE,KAAK,CAAC,qBAAqB,CAAC,CAsFnF,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,qBAAqB,CAErD,CAAC;AACF,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAQ7E"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/blockchain-data.js b/dist/ethers.js/src.ts/_tests/blockchain-data.js
new file mode 100644
index 0000000..b109fea
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/blockchain-data.js
@@ -0,0 +1,245 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.networkFeatureAtBlock = exports.networkNames = exports.testReceipt = exports.testTransaction = exports.testBlock = exports.testAddress = void 0;
+;
+exports.testAddress = {
+ mainnet: [
+ {
+ test: "old-account",
+ address: "0xAC1639CF97a3A46D431e6d1216f576622894cBB5",
+ balance: BigInt("4813414100000000"),
+ nonce: 3,
+ code: "0x"
+ }, {
+ test: "TheDAO-splitter-contract",
+ address: "0x3474627D4F63A678266BC17171D87f8570936622",
+ code: "0x606060405260e060020a60003504630b3ed5368114602e57806337b0574a14605257806356fa47f0146062575b005b602c6004356000546101009004600160a060020a03908116339091161460bb575b50565b60005460ff166060908152602090f35b602c60043560005460ff1615609657600160a060020a038116600034606082818181858883f193505050501515604f576002565b33600160a060020a0316600034606082818181858883f193505050501515604f576002565b600080546101009004600160a060020a03169082606082818181858883f193505050501515604f57600256",
+ storage: {
+ "0": "0x0000000000000000000000b2682160c482eb985ec9f3e364eec0a904c44c2300"
+ }
+ }, {
+ test: "ricmoo.firefly.eth",
+ address: "0x8ba1f109551bD432803012645Ac136ddd64DBA72",
+ name: "ricmoo.firefly.eth"
+ },
+ ],
+ goerli: []
+};
+exports.testBlock = {
+ mainnet: [
+ {
+ test: "old-homestead-block",
+ hash: "0x3d6122660cc824376f11ee842f83addc3525e2dd6756b9bcf0affa6aa88cf741",
+ parentHash: "0xb495a1d7e6663152ae92708da4843337b958146015a2802f4193a410044698c9",
+ number: 3,
+ timestamp: 1438270048,
+ nonce: "0x2e9344e0cbde83ce",
+ difficulty: BigInt(17154715646),
+ gasLimit: BigInt("0x1388"),
+ gasUsed: BigInt("0"),
+ miner: "0x5088D623ba0fcf0131E0897a91734A4D83596AA0",
+ extraData: "0x476574682f76312e302e302d66633739643332642f6c696e75782f676f312e34",
+ transactions: []
+ },
+ {
+ test: "london-block",
+ number: 14413999,
+ hash: "0x6c79356d40ebb6ed63dc19f5d407f8f1c876047b59dc1a4598cce0e64dcabec5",
+ parentHash: "0xbf09b0e215f247a5066d19ece5b4c66960771d45fae62985e8d751fb1adcfe2f",
+ timestamp: 1647654576,
+ nonce: "0xb4bc9979af5369fe",
+ difficulty: BigInt("12841513359509721"),
+ gasLimit: BigInt("30087914"),
+ gasUsed: BigInt("2008910"),
+ miner: "0x2A20380DcA5bC24D052acfbf79ba23e988ad0050",
+ extraData: "0x706f6f6c696e2e636f6d21f7092f019bb92a76",
+ baseFeePerGas: BigInt("40911884304"),
+ transactions: [
+ "0x1c3a398933db10634631f54b435c40c8805c13f12bbac7c3dab858ca44213fa2",
+ "0xd98947cbdd892cc7f679c903903e6d18a5c5afb19e94437beba79372ad71c347",
+ "0x4d66190deb55b5820cb0ce9adb972f646fa0f3e64eaeee674bbf3d054bf3d883",
+ "0x9db7bd5f4c91d6103c714bcbc35df3dc708daa668aaef7449b589dbd3be24dac",
+ "0x126a43ae4ade4b7fc5c8ac9ebd3dbcf7314f63c60f2804fb49aa25b5c7d80bb1",
+ "0x82a90aa4b3b1b7873b117c3ff1ca7165ae34b2fc0788cc0cbfd41805d588590d",
+ "0x7f694a6a9972457753ed3dec164f17272b1c8b1da4eab149df95e31a3e72f606",
+ "0xdce1cba1ff33f0c23881087d49de3b34fe84c8a6883f3edd75b04fc23e458aac",
+ "0xbe1c69f825279cebef42d1f0e07397dcddef7fb278b0195e295ede3e156836c4",
+ "0x1d2f007b3c0f894403973a30e5ffaa78589f873d963e9554c6bb1bd7a3127245",
+ "0x9c8c78191cf4ae9ae8eee1165153eabe24dbd8b9509b83d5f0caeea85251bb2f",
+ "0x42e956f4b3dd6535359b272a0d2dab995c364cb48baaf8d0a1981995f3f8c808",
+ "0xdc2c2e99393e24d5dc66e38665fa1d1ff007d92088ef3fd2549545fdbe862ef6",
+ "0xaad7be28fffd2e77e8e40bf57f2ac140aa8283ec93c7f3f61a82c79405602f53",
+ "0x4735f1421b7b30283e87e0799e82e54307d3e5ba14cd54ad8420b57577489a71",
+ "0x0b9d6aa23aa439b41e86595f2ad91f498adffa3e6e7cb26ac7d73252e59fd3de",
+ "0xcd93e19bd5d5c5a834fec613116fa01f46eddfd2faa20ef302271b874b9d812a",
+ "0x5bf1976574a637f5ac0b8bda1a792fa16cc7ce9624d32e9bd6bd9aa6a8f19d2f",
+ "0x2e778da4f66f10f7b681b605635c6599cdbeea167fc1c4396a097aef5d06de61",
+ "0xd5fd68eebc4c870ccda081786a74c75c250e9e2d8269b8935edb3adb11b80bb2",
+ "0x2aec42a11c1d8c1e5198d54aacbc6bebb09bcd5e78f6af81ea09d65c9064734a",
+ "0xbea2e364ea4959ec438d9ccc2d2f7120c7eaba3b177cc0d7df8ff65d866ef89f",
+ "0xf48bbb0f838353060da4126a555ce532abf497a9d1108001afffaac513a59ddf",
+ "0xf5664e4372cce62733a6610efb7701a4a0e552d81f8caa764d8474b3070c6617",
+ "0x9d3732ddbd20610008ff737da2f61120734a1cbfa864374bcbcf10051e6048cb",
+ "0xc4d0df5bc6fa51b34ac3c898866d779d4e51a6be4d13be1ec3084b7229b03b47",
+ "0x90c86ec98b8ad98049b4ee54cb3aa72c5ae743077b830e8a294aa5dc47a1fb18"
+ ]
+ }
+ ],
+ goerli: [],
+};
+exports.testTransaction = {
+ mainnet: [
+ {
+ test: "legacy",
+ hash: "0xccc90ab97a74c952fb3376c4a3efb566a58a10df62eb4d44a61e106fcf10ec61",
+ blockHash: "0x9653f180a5720f3634816eb945a6d722adee52cc47526f6357ac10adaf368135",
+ blockNumber: 4097745,
+ // index: 18,
+ type: 0,
+ from: "0x32DEF047DeFd076DB21A2D759aff2A591c972248",
+ gasPrice: BigInt("0x4a817c800"),
+ gasLimit: BigInt("0x3d090"),
+ to: "0x6fC21092DA55B392b045eD78F4732bff3C580e2c",
+ value: BigInt("0x186cc6acd4b0000"),
+ nonce: 0,
+ data: "0xf2c298be000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000067269636d6f6f0000000000000000000000000000000000000000000000000000",
+ signature: {
+ r: "0x1e5605197a03e3f0a168f14749168dfeefc44c9228312dacbffdcbbb13263265",
+ s: "0x269c3e5b3558267ad91b0a887d51f9f10098771c67b82ea6cb74f29638754f54",
+ yParity: 1,
+ v: 28,
+ networkV: BigInt(38),
+ },
+ creates: null,
+ chainId: BigInt(1)
+ },
+ {
+ test: "EIP-1559",
+ hash: "0x8ff41d0ba5d239acc8c123ff12451a2c15721c838f657e583d355999af4a4349",
+ blockHash: '0x9d4c3bef68e119841281105da96beb1c7252f357340d7a3355236b3332b197b0',
+ blockNumber: 12966000,
+ // index: 185,
+ type: 2,
+ from: '0x5afFBa12E9332bbc0E221c8E7BEf7CB7cfB3F281',
+ to: '0x2258CcD34ae29E6B199b6CD64eb2aEF157df7CdE',
+ gasLimit: BigInt("21000"),
+ nonce: 2,
+ data: '0x',
+ value: BigInt("1100000000000000"),
+ gasPrice: BigInt("70578812137"),
+ maxPriorityFeePerGas: BigInt("1000000000"),
+ maxFeePerGas: BigInt("131115411100"),
+ chainId: BigInt(1),
+ signature: {
+ r: "0xdd26e5478d0aa84e334a0393d335ab24b83de8ecae9290305f15ab884ded246c",
+ s: "0x6494b4f61b0d9a5a82ecb86d72b301f859f404f0bec9682bbfff619903ecfbe2",
+ yParity: 1,
+ v: 28,
+ networkV: null
+ },
+ creates: null,
+ accessList: []
+ }
+ ],
+ goerli: []
+};
+exports.testReceipt = {
+ mainnet: [
+ {
+ test: "legacy",
+ //byzantium: false,
+ blockHash: "0x36b4af7f0538559e581c8588f16477df0f676439ea67fe8d7a2ae4abb20e2566",
+ blockNumber: 0x3c92b5,
+ type: 0,
+ contractAddress: null,
+ cumulativeGasUsed: BigInt(0x1cca2e),
+ from: "0x18C6045651826824FEBBD39d8560584078d1b247",
+ gasUsed: BigInt(0x14bb7),
+ gasPrice: BigInt(4100000000),
+ logs: [
+ {
+ address: "0x314159265dD8dbb310642f98f50C066173C1259b",
+ blockHash: "0x36b4af7f0538559e581c8588f16477df0f676439ea67fe8d7a2ae4abb20e2566",
+ blockNumber: 0x3c92b5,
+ data: "0x00000000000000000000000018c6045651826824febbd39d8560584078d1b247",
+ index: 0x1a,
+ topics: [
+ "0xce0457fe73731f824cc272376169235128c118b49d344817417c6d108d155e82",
+ "0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae",
+ "0xf0106919d12469348e14ad6a051d0656227e1aba2fefed41737fdf78421b20e1"
+ ],
+ transactionHash: "0xc6fcb7d00d536e659a4559d2de29afa9e364094438fef3e72ba80728ce1cb616",
+ transactionIndex: 0x39,
+ },
+ {
+ address: "0x6090A6e47849629b7245Dfa1Ca21D94cd15878Ef",
+ blockHash: "0x36b4af7f0538559e581c8588f16477df0f676439ea67fe8d7a2ae4abb20e2566",
+ blockNumber: 0x3c92b5,
+ data: "0x000000000000000000000000000000000000000000000000002386f26fc1000000000000000000000000000000000000000000000000000000000000595a32ce",
+ index: 0x1b,
+ topics: [
+ "0x0f0c27adfd84b60b6f456b0e87cdccb1e5fb9603991588d87fa99f5b6b61e670",
+ "0xf0106919d12469348e14ad6a051d0656227e1aba2fefed41737fdf78421b20e1",
+ "0x00000000000000000000000018c6045651826824febbd39d8560584078d1b247"
+ ],
+ transactionHash: "0xc6fcb7d00d536e659a4559d2de29afa9e364094438fef3e72ba80728ce1cb616",
+ transactionIndex: 0x39,
+ }
+ ],
+ logsBloom: "0x00000000000000040000000000100000010000000000000040000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000200000010000000004000000000000000000000000000000000002000000000000000000000000400000000020000000000000000000000000000000000000004000000000000000000000000000000000000000000000000801000000000000000000000020000000000040000000040000000000000000002000000004000000000000000000000000000000000000000000000010000000000000000000000000000000000200000000000000000",
+ root: "0x9b550a9a640ce50331b64504ef87aaa7e2aaf97344acb6ff111f879b319d2590",
+ // Should be null for pre-byzantium, but some nodes have backfilled it
+ status: 1,
+ to: "0x6090A6e47849629b7245Dfa1Ca21D94cd15878Ef",
+ hash: "0xc6fcb7d00d536e659a4559d2de29afa9e364094438fef3e72ba80728ce1cb616",
+ index: 0x39
+ }, {
+ test: "byzantium",
+ //byzantium: true,
+ blockHash: "0x34e5a6cfbdbb84f7625df1de69d218ade4da72f4a2558064a156674e72e976c9",
+ blockNumber: 0x444f76,
+ type: 0,
+ contractAddress: null,
+ cumulativeGasUsed: BigInt(0x15bfe7),
+ from: "0x18C6045651826824FEBBD39d8560584078d1b247",
+ gasUsed: BigInt(0x1b968),
+ gasPrice: BigInt(1000000000),
+ logs: [
+ {
+ address: "0xb90E64082D00437e65A76d4c8187596BC213480a",
+ blockHash: "0x34e5a6cfbdbb84f7625df1de69d218ade4da72f4a2558064a156674e72e976c9",
+ blockNumber: 0x444f76,
+ data: "0x",
+ index: 0x10,
+ topics: [
+ "0x748d071d1992ee1bfe7a39058114d0a50d5798fe8eb3a9bfb4687f024629a2ce",
+ "0x5574aa58f7191ccab6de6cf75fe2ea0484f010b852fdd8c6b7ae151d6c2f4b83"
+ ],
+ transactionHash: "0x7f1c6a58dc880438236d0b0a4ae166e9e9a038dbea8ec074149bd8b176332cac",
+ transactionIndex: 0x1e,
+ }
+ ],
+ logsBloom: "0x00000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000200000000000000008000000000000000000000000000000000000000000000000000000000000000010000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000800000000000000000800000000000000000000000000000000000000",
+ root: null,
+ status: 1,
+ to: "0xb90E64082D00437e65A76d4c8187596BC213480a",
+ hash: "0x7f1c6a58dc880438236d0b0a4ae166e9e9a038dbea8ec074149bd8b176332cac",
+ index: 0x1e
+ }
+ ],
+ goerli: []
+};
+exports.networkNames = [
+ "mainnet", "goerli"
+];
+function networkFeatureAtBlock(feature, block) {
+ switch (feature) {
+ case "byzantium":
+ return block >= 4370000;
+ default:
+ break;
+ }
+ throw new Error(`unknown feature: ${feature}`);
+}
+exports.networkFeatureAtBlock = networkFeatureAtBlock;
+//# sourceMappingURL=blockchain-data.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/blockchain-data.js.map b/dist/ethers.js/src.ts/_tests/blockchain-data.js.map
new file mode 100644
index 0000000..f66e321
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/blockchain-data.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"blockchain-data.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/blockchain-data.ts"],"names":[],"mappings":";;;AAuFC,CAAC;AAEW,QAAA,WAAW,GAAgE;IACpF,OAAO,EAAE;QACL;YACI,IAAI,EAAE,aAAa;YACnB,OAAO,EAAE,4CAA4C;YACrD,OAAO,EAAE,MAAM,CAAC,kBAAkB,CAAC;YACnC,KAAK,EAAE,CAAC;YACR,IAAI,EAAE,IAAI;SACb,EAAE;YACC,IAAI,EAAE,0BAA0B;YAChC,OAAO,EAAE,4CAA4C;YACrD,IAAI,EAAE,kdAAkd;YACxd,OAAO,EAAE;gBACL,GAAG,EAAE,oEAAoE;aAC5E;SACJ,EAAE;YACC,IAAI,EAAE,oBAAoB;YAC1B,OAAO,EAAE,4CAA4C;YACrD,IAAI,EAAE,oBAAoB;SAC7B;KACJ;IACD,MAAM,EAAE,EACP;CACJ,CAAC;AAEW,QAAA,SAAS,GAA8D;IAChF,OAAO,EAAE;QACL;YACI,IAAI,EAAE,qBAAqB;YAC3B,IAAI,EAAE,oEAAoE;YAC1E,UAAU,EAAE,oEAAoE;YAChF,MAAM,EAAE,CAAC;YACT,SAAS,EAAE,UAAU;YACrB,KAAK,EAAE,oBAAoB;YAC3B,UAAU,EAAE,MAAM,CAAC,WAAW,CAAC;YAC/B,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC;YAC1B,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC;YACpB,KAAK,EAAE,4CAA4C;YACnD,SAAS,EAAE,oEAAoE;YAC/E,YAAY,EAAE,EAAG;SACpB;QACD;YACI,IAAI,EAAE,cAAc;YACpB,MAAM,EAAE,QAAQ;YAChB,IAAI,EAAE,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;oBAC/E,WAAW,EAAE,QAAQ;oBACrB,IAAI,EAAE,IAAI;oBACV,KAAK,EAAE,IAAI;oBACX,MAAM,EAAE;wBACJ,oEAAoE;wBACpE,oEAAoE;qBACvE;oBACD,eAAe,EAAE,oEAAoE;oBACrF,gBAAgB,EAAE,IAAI;iBACzB;aACJ;YACD,SAAS,EAAE,ogBAAogB;YAC/gB,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,CAAC;YACT,EAAE,EAAE,4CAA4C;YAChD,IAAI,EAAE,oEAAoE;YAC1E,KAAK,EAAE,IAAI;SACd;KACJ;IACD,MAAM,EAAE,EACP;CACJ,CAAC;AAEW,QAAA,YAAY,GAAiC;IACtD,SAAS,EAAE,QAAQ;CACtB,CAAC;AACF,SAAgB,qBAAqB,CAAC,OAAe,EAAE,KAAa;IAChE,QAAQ,OAAO,EAAE;QACb,KAAK,WAAW;YACZ,OAAO,KAAK,IAAI,OAAO,CAAC;QAC5B;YACI,MAAM;KACb;IACD,MAAM,IAAI,KAAK,CAAC,oBAAqB,OAAQ,EAAE,CAAC,CAAC;AACrD,CAAC;AARD,sDAQC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/create-provider.d.ts b/dist/ethers.js/src.ts/_tests/create-provider.d.ts
new file mode 100644
index 0000000..ef373e8
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/create-provider.d.ts
@@ -0,0 +1,8 @@
+import type { AbstractProvider } from "../index.js";
+export declare function setupProviders(): void;
+export declare const providerNames: readonly string[];
+export declare function getProviderNetworks(provider: string): Array;
+export declare function getProvider(provider: string, network: string): null | AbstractProvider;
+export declare function checkProvider(provider: string, network: string): boolean;
+export declare function connect(network: string): AbstractProvider;
+//# sourceMappingURL=create-provider.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/create-provider.d.ts.map b/dist/ethers.js/src.ts/_tests/create-provider.d.ts.map
new file mode 100644
index 0000000..1055d23
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/create-provider.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"create-provider.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/create-provider.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AA2FpD,wBAAgB,cAAc,IAAI,IAAI,CAKrC;AAED,eAAO,MAAM,aAAa,mBAAuD,CAAC;AAQlF,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAInE;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,gBAAgB,CAgBtF;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAGxE;AAED,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,CAIzD"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/create-provider.js b/dist/ethers.js/src.ts/_tests/create-provider.js
new file mode 100644
index 0000000..4def72c
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/create-provider.js
@@ -0,0 +1,151 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.connect = exports.checkProvider = exports.getProvider = exports.getProviderNetworks = exports.providerNames = exports.setupProviders = void 0;
+const index_js_1 = require("../index.js");
+;
+const ethNetworks = ["default", "mainnet", "goerli"];
+//const maticNetworks = [ "matic", "maticmum" ];
+const ProviderCreators = [
+ {
+ name: "AlchemyProvider",
+ networks: ethNetworks,
+ create: function (network) {
+ return new index_js_1.AlchemyProvider(network, "YrPw6SWb20vJDRFkhWq8aKnTQ8JRNRHM");
+ }
+ },
+ /*
+ {
+ name: "AnkrProvider",
+ networks: ethNetworks.concat([ "matic", "arbitrum" ]),
+ create: function(network: string) {
+ return new AnkrProvider(network);
+ }
+ },
+ */
+ /*
+ {
+ name: "CloudflareProvider",
+ networks: [ "default", "mainnet" ],
+ create: function(network: string) {
+ return new CloudflareProvider(network);
+ }
+ },
+ */
+ {
+ name: "EtherscanProvider",
+ networks: ethNetworks,
+ create: function (network) {
+ return new index_js_1.EtherscanProvider(network, "FPFGK6JSW2UHJJ2666FG93KP7WC999MNW7");
+ }
+ },
+ {
+ name: "InfuraProvider",
+ networks: ethNetworks,
+ create: function (network) {
+ return new index_js_1.InfuraProvider(network, "49a0efa3aaee4fd99797bfa94d8ce2f1");
+ }
+ },
+ {
+ name: "InfuraWebsocketProvider",
+ networks: ethNetworks,
+ create: function (network) {
+ return index_js_1.InfuraProvider.getWebSocketProvider(network, "49a0efa3aaee4fd99797bfa94d8ce2f1");
+ }
+ },
+ /*
+ {
+ name: "PocketProvider",
+ networks: ethNetworks,
+ create: function(network: string) {
+ return new PocketProvider(network);
+ }
+ },
+ */
+ {
+ name: "QuickNodeProvider",
+ networks: ethNetworks,
+ create: function (network) {
+ return new index_js_1.QuickNodeProvider(network);
+ }
+ },
+ {
+ name: "FallbackProvider",
+ networks: ethNetworks,
+ create: function (network) {
+ const providers = [];
+ for (const providerName of ["AlchemyProvider", "AnkrProvider", "EtherscanProvider", "InfuraProvider"]) {
+ const provider = getProvider(providerName, network);
+ if (provider) {
+ providers.push(provider);
+ }
+ }
+ if (providers.length === 0) {
+ throw new Error("UNSUPPORTED NETWORK");
+ }
+ return new index_js_1.FallbackProvider(providers);
+ }
+ },
+];
+let setup = false;
+const cleanup = [];
+function setupProviders() {
+ after(function () {
+ for (const func of cleanup) {
+ func();
+ }
+ });
+ setup = true;
+}
+exports.setupProviders = setupProviders;
+exports.providerNames = Object.freeze(ProviderCreators.map((c) => (c.name)));
+function getCreator(provider) {
+ const creators = ProviderCreators.filter((c) => (c.name === provider));
+ if (creators.length === 1) {
+ return creators[0];
+ }
+ return null;
+}
+function getProviderNetworks(provider) {
+ const creator = getCreator(provider);
+ if (creator) {
+ return creator.networks;
+ }
+ return [];
+}
+exports.getProviderNetworks = getProviderNetworks;
+function getProvider(provider, network) {
+ if (setup == false) {
+ throw new Error("MUST CALL setupProviders in root context");
+ }
+ const creator = getCreator(provider);
+ try {
+ if (creator) {
+ const provider = creator.create(network);
+ if (provider) {
+ cleanup.push(() => { provider.destroy(); });
+ }
+ return provider;
+ }
+ }
+ catch (error) {
+ if (!(0, index_js_1.isError)(error, "INVALID_ARGUMENT")) {
+ throw error;
+ }
+ }
+ return null;
+}
+exports.getProvider = getProvider;
+function checkProvider(provider, network) {
+ const creator = getCreator(provider);
+ return (creator != null);
+}
+exports.checkProvider = checkProvider;
+function connect(network) {
+ const provider = getProvider("InfuraProvider", network);
+ if (provider == null) {
+ throw new Error(`could not connect to ${network}`);
+ }
+ return provider;
+}
+exports.connect = connect;
+//# sourceMappingURL=create-provider.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/create-provider.js.map b/dist/ethers.js/src.ts/_tests/create-provider.js.map
new file mode 100644
index 0000000..c89c6da
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/create-provider.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"create-provider.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/create-provider.ts"],"names":[],"mappings":";;;AAAA,0CAWqB;AAQpB,CAAC;AAEF,MAAM,WAAW,GAAG,CAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAE,CAAC;AACvD,gDAAgD;AAEhD,MAAM,gBAAgB,GAA2B;IAC7C;QACI,IAAI,EAAE,iBAAiB;QACvB,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,UAAS,OAAe;YAC5B,OAAO,IAAI,0BAAe,CAAC,OAAO,EAAE,kCAAkC,CAAC,CAAC;QAC5E,CAAC;KACJ;IACD;;;;;;;;MAQE;IACF;;;;;;;;MAQE;IACF;QACI,IAAI,EAAE,mBAAmB;QACzB,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,UAAS,OAAe;YAC5B,OAAO,IA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OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;aAC/C;YACD,OAAO,QAAQ,CAAC;SACnB;KACJ;IAAC,OAAO,KAAK,EAAE;QACZ,IAAI,CAAC,IAAA,kBAAO,EAAC,KAAK,EAAE,kBAAkB,CAAC,EAAE;YAAE,MAAM,KAAK,CAAC;SAAE;KAC5D;IACD,OAAO,IAAI,CAAC;AAChB,CAAC;AAhBD,kCAgBC;AAED,SAAgB,aAAa,CAAC,QAAgB,EAAE,OAAe;IAC3D,MAAM,OAAO,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;IACrC,OAAO,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC;AAC7B,CAAC;AAHD,sCAGC;AAED,SAAgB,OAAO,CAAC,OAAe;IACnC,MAAM,QAAQ,GAAG,WAAW,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;IACxD,IAAI,QAAQ,IAAI,IAAI,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,wBAAyB,OAAQ,EAAE,CAAC,CAAC;KAAE;IAC/E,OAAO,QAAQ,CAAC;AACpB,CAAC;AAJD,0BAIC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/index.d.ts b/dist/ethers.js/src.ts/_tests/index.d.ts
new file mode 100644
index 0000000..2fa3fd5
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/index.d.ts
@@ -0,0 +1,21 @@
+import "./test-abi.js";
+import "./test-address.js";
+import "./test-contract.js";
+import "./test-crypto.js";
+import "./test-hash.js";
+import "./test-hash-typeddata.js";
+import "./test-providers-avatar.js";
+import "./test-providers-ccip.js";
+import "./test-providers-wildcard.js";
+import "./test-rlp.js";
+import "./test-transaction.js";
+import "./test-utils-maths.js";
+import "./test-utils-misc.js";
+import "./test-utils-units.js";
+import "./test-utils-utf8.js";
+import "./test-wallet.js";
+import "./test-wallet-hd.js";
+import "./test-wallet-json.js";
+import "./test-wallet-mnemonic.js";
+import "./test-wordlists.js";
+//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/index.d.ts.map b/dist/ethers.js/src.ts/_tests/index.d.ts.map
new file mode 100644
index 0000000..fc63218
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/index.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAC;AACvB,OAAO,mBAAmB,CAAA;AAC1B,OAAO,oBAAoB,CAAC;AAC5B,OAAO,kBAAkB,CAAC;AAC1B,OAAO,gBAAgB,CAAC;AACxB,OAAO,0BAA0B,CAAC;AAClC,OAAO,4BAA4B,CAAC;AACpC,OAAO,0BAA0B,CAAC;AAClC,OAAO,8BAA8B,CAAC;AACtC,OAAO,eAAe,CAAA;AACtB,OAAO,uBAAuB,CAAC;AAC/B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,sBAAsB,CAAC;AAC9B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,sBAAsB,CAAC;AAC9B,OAAO,kBAAkB,CAAC;AAC1B,OAAO,qBAAqB,CAAC;AAC7B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,2BAA2B,CAAC;AACnC,OAAO,qBAAqB,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/index.js b/dist/ethers.js/src.ts/_tests/index.js
new file mode 100644
index 0000000..525dba3
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/index.js
@@ -0,0 +1,31 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+require("./test-abi.js");
+require("./test-address.js");
+require("./test-contract.js");
+require("./test-crypto.js");
+require("./test-hash.js");
+require("./test-hash-typeddata.js");
+require("./test-providers-avatar.js");
+require("./test-providers-ccip.js");
+require("./test-providers-wildcard.js");
+require("./test-rlp.js");
+require("./test-transaction.js");
+require("./test-utils-maths.js");
+require("./test-utils-misc.js");
+require("./test-utils-units.js");
+require("./test-utils-utf8.js");
+require("./test-wallet.js");
+require("./test-wallet-hd.js");
+require("./test-wallet-json.js");
+require("./test-wallet-mnemonic.js");
+require("./test-wordlists.js");
+////import "./test-contract-integ.js";
+////import "./test-providers-data.js";
+//import "./test-providers-errors.js";
+////import "./test-providers-extra.js";
+////import "./test-providers-send.js";
+/*
+test-crypto-algoswap.ts
+*/
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/index.js.map b/dist/ethers.js/src.ts/_tests/index.js.map
new file mode 100644
index 0000000..f004ac6
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/index.ts"],"names":[],"mappings":";;AAAA,yBAAuB;AACvB,6BAA0B;AAC1B,8BAA4B;AAC5B,4BAA0B;AAC1B,0BAAwB;AACxB,oCAAkC;AAClC,sCAAoC;AACpC,oCAAkC;AAClC,wCAAsC;AACtC,yBAAsB;AACtB,iCAA+B;AAC/B,iCAA+B;AAC/B,gCAA8B;AAC9B,iCAA+B;AAC/B,gCAA8B;AAC9B,4BAA0B;AAC1B,+BAA6B;AAC7B,iCAA+B;AAC/B,qCAAmC;AACnC,+BAA6B;AAE7B,sCAAsC;AAEtC,sCAAsC;AACtC,sCAAsC;AACtC,uCAAuC;AACvC,sCAAsC;AAEtC;;EAEE"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-abi.d.ts b/dist/ethers.js/src.ts/_tests/test-abi.d.ts
new file mode 100644
index 0000000..5a0731b
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-abi.d.ts
@@ -0,0 +1,2 @@
+export {};
+//# sourceMappingURL=test-abi.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-abi.d.ts.map b/dist/ethers.js/src.ts/_tests/test-abi.d.ts.map
new file mode 100644
index 0000000..44f0318
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-abi.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-abi.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-abi.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-abi.js b/dist/ethers.js/src.ts/_tests/test-abi.js
new file mode 100644
index 0000000..7f55c7b
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-abi.js
@@ -0,0 +1,286 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const assert_1 = __importDefault(require("assert"));
+const utils_js_1 = require("./utils.js");
+const index_js_1 = require("../index.js");
+function equal(actual, expected) {
+ switch (expected.type) {
+ case "address":
+ case "boolean":
+ case "hexstring":
+ case "string":
+ assert_1.default.equal(actual, expected.value);
+ return;
+ case "number":
+ assert_1.default.equal(actual, BigInt(expected.value));
+ return;
+ case "array":
+ case "object":
+ assert_1.default.ok(Array.isArray(actual), "!array");
+ assert_1.default.equal(actual.length, expected.value.length, ".length mismatch");
+ for (let i = 0; i < actual.length; i++) {
+ equal(actual[i], expected.value[i]);
+ }
+ return;
+ }
+ throw new Error(`unsupported: ${expected}`);
+}
+describe("Tests ABI Coder", function () {
+ const tests = (0, utils_js_1.loadTests)("abi");
+ for (const test of tests) {
+ it(`tests ABI encoding: (${test.name})`, function () {
+ const encoded = index_js_1.AbiCoder.defaultAbiCoder().encode([test.type], [test.value]);
+ assert_1.default.equal(encoded, test.encoded, "encoded");
+ });
+ }
+ for (const test of tests) {
+ it(`tests ABI decoding: (${test.name})`, function () {
+ const decoded = index_js_1.AbiCoder.defaultAbiCoder().decode([test.type], test.encoded)[0];
+ equal(decoded, test.verbose);
+ });
+ }
+});
+describe("Test Bytes32 strings", function () {
+ const tests = [
+ {
+ name: "ricmoo.firefly.eth",
+ str: "ricmoo.firefly.eth",
+ expected: '0x7269636d6f6f2e66697265666c792e6574680000000000000000000000000000'
+ },
+ {
+ name: "empty string",
+ str: "",
+ expected: '0x0000000000000000000000000000000000000000000000000000000000000000'
+ }
+ ];
+ for (const { name, str, expected } of tests) {
+ it(`encodes and decodes Bytes32 strings: ${name}`, function () {
+ const bytes32 = (0, index_js_1.encodeBytes32String)(str);
+ const decoded = (0, index_js_1.decodeBytes32String)(bytes32);
+ assert_1.default.equal(bytes32, expected, 'formatted correctly');
+ assert_1.default.equal(decoded, str, "parsed correctly");
+ });
+ }
+});
+describe("Test Interface", function () {
+ const iface = new index_js_1.Interface([
+ "function balanceOf(address owner) returns (uint)",
+ "event Transfer(address indexed from, address indexed to, uint amount)",
+ // #4244
+ "event RedemptionRequested(bytes20 indexed walletPubKeyHash, bytes redeemerOutputScript, address indexed redeemer, uint64 requestedAmount, uint64 treasuryFee, uint64 txMaxFee)"
+ ]);
+ it("does interface stuff; @TODO expand this", function () {
+ const addr = "0x8ba1f109551bD432803012645Ac136ddd64DBA72";
+ const addr2 = "0xAC1639CF97a3A46D431e6d1216f576622894cBB5";
+ const data = iface.encodeFunctionData("balanceOf", [addr]);
+ assert_1.default.equal(data, "0x70a082310000000000000000000000008ba1f109551bd432803012645ac136ddd64dba72", "encoded");
+ const decoded = iface.decodeFunctionData("balanceOf", data);
+ assert_1.default.equal(decoded.length, 1, "decoded.length");
+ assert_1.default.equal(decoded[0], addr, "decoded[0]");
+ const tx = iface.parseTransaction({ data, value: 10 });
+ assert_1.default.ok(tx != null, "tx == null");
+ assert_1.default.equal(tx.name, "balanceOf", "tx.balanceOf");
+ assert_1.default.equal(tx.signature, "balanceOf(address)", "tx.balanceOf");
+ assert_1.default.equal(tx.args.length, 1, "tx.args.length");
+ assert_1.default.equal(tx.args[0], addr, "tx.args[0]");
+ assert_1.default.equal(tx.selector, "0x70a08231", "tx.selector");
+ assert_1.default.equal(tx.value, BigInt(10), "tx.value");
+ const result = iface.encodeFunctionResult("balanceOf", [123]);
+ assert_1.default.equal(result, "0x000000000000000000000000000000000000000000000000000000000000007b", "result");
+ const value = iface.decodeFunctionResult("balanceOf", result);
+ assert_1.default.equal(value.length, 1, "result.length");
+ assert_1.default.equal(value[0], BigInt(123), "result.value[0]");
+ // @TODO: parseResult
+ const filter = iface.encodeFilterTopics("Transfer", [addr, addr2]);
+ assert_1.default.equal(filter.length, 3);
+ assert_1.default.equal(filter[0], "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef");
+ assert_1.default.equal(filter[1], "0x0000000000000000000000008ba1f109551bd432803012645ac136ddd64dba72");
+ assert_1.default.equal(filter[2], "0x000000000000000000000000ac1639cf97a3a46d431e6d1216f576622894cbb5");
+ // See: #4244
+ // https://goerli.etherscan.io/tx/0xe61cef4cd706db8e23114717a207d76cc6b0df0b74ec52805551c4d1bf347a27#eventlog
+ // See `RedemptionRequested` event.
+ {
+ const walletPubKeyHash = "0x03b74d6893ad46dfdd01b9e0e3b3385f4fce2d1e";
+ const redeemer = "0x086813525A7dC7dafFf015Cdf03896Fd276eab60";
+ const filterWithBytes20 = iface.encodeFilterTopics("RedemptionRequested", [walletPubKeyHash, undefined, redeemer]);
+ assert_1.default.equal(filterWithBytes20.length, 3);
+ assert_1.default.equal(filterWithBytes20[0], "0x97a0199072f487232635d50ab75860891afe0b91c976ed2fc76502c4d82d0d95");
+ assert_1.default.equal(filterWithBytes20[1], "0x03b74d6893ad46dfdd01b9e0e3b3385f4fce2d1e000000000000000000000000");
+ assert_1.default.equal(filterWithBytes20[2], "0x000000000000000000000000086813525a7dc7dafff015cdf03896fd276eab60");
+ }
+ const eventLog = iface.encodeEventLog("Transfer", [addr, addr2, 234]);
+ assert_1.default.equal(eventLog.data, "0x00000000000000000000000000000000000000000000000000000000000000ea");
+ assert_1.default.deepEqual(eventLog.topics, [
+ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
+ "0x0000000000000000000000008ba1f109551bd432803012645ac136ddd64dba72",
+ "0x000000000000000000000000ac1639cf97a3a46d431e6d1216f576622894cbb5"
+ ]);
+ const values = iface.decodeEventLog("Transfer", eventLog.data, eventLog.topics);
+ assert_1.default.equal(values.length, 3);
+ assert_1.default.equal(values[0], addr);
+ assert_1.default.equal(values[1], addr2);
+ assert_1.default.equal(values[2], BigInt(234));
+ const log = iface.parseLog(eventLog);
+ assert_1.default.ok(log != null);
+ assert_1.default.equal(log.name, "Transfer");
+ assert_1.default.equal(log.signature, "Transfer(address,address,uint256)");
+ assert_1.default.equal(log.topic, "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef");
+ assert_1.default.equal(log.args.length, 3);
+ assert_1.default.equal(log.args[0], "0x8ba1f109551bD432803012645Ac136ddd64DBA72");
+ assert_1.default.equal(log.args[1], "0xAC1639CF97a3A46D431e6d1216f576622894cBB5");
+ assert_1.default.equal(log.args[2], BigInt(234));
+ });
+ // See #4248
+ it("formats JSON ABI parameters with default empty string for `name` key", function () {
+ assert_1.default.deepEqual(JSON.parse(iface.getFunction("balanceOf").format('json')), {
+ constant: false,
+ inputs: [
+ { name: "owner", type: "address" }
+ ],
+ name: "balanceOf",
+ outputs: [
+ { name: "", type: "uint256" }
+ ],
+ payable: false,
+ type: "function",
+ });
+ });
+});
+describe("Tests Legacy ABI formats", function () {
+ // See: #3932
+ const iface = new index_js_1.Interface([
+ {
+ name: "implicitView",
+ outputs: [],
+ inputs: [
+ { type: "int128", name: "arg0" }
+ ],
+ "constant": true,
+ "payable": false,
+ "type": "function"
+ },
+ {
+ name: "implicitSendNonpay",
+ outputs: [],
+ inputs: [
+ { type: "int128", name: "arg0" }
+ ],
+ "constant": false,
+ "payable": false,
+ "type": "function"
+ },
+ {
+ name: "implicitSendPay",
+ outputs: [],
+ inputs: [
+ { type: "int128", name: "arg0" }
+ ],
+ "constant": false,
+ "payable": true,
+ "type": "function"
+ },
+ {
+ name: "implicitSendImplicitPay",
+ outputs: [],
+ inputs: [
+ { type: "int128", name: "arg0" }
+ ],
+ "constant": false,
+ "type": "function"
+ },
+ {
+ name: "implicitSendExplicitPay",
+ outputs: [],
+ inputs: [
+ { type: "int128", name: "arg0" }
+ ],
+ payable: true,
+ type: "function"
+ },
+ {
+ name: "implicitSendExplicitNonpay",
+ outputs: [],
+ inputs: [
+ { type: "int128", name: "arg0" }
+ ],
+ payable: false,
+ type: "function"
+ },
+ {
+ name: "implicitAll",
+ outputs: [],
+ inputs: [
+ { type: "int128", name: "arg0" }
+ ],
+ "type": "function"
+ },
+ {
+ name: "explicitView",
+ outputs: [],
+ inputs: [
+ { type: "int128", name: "arg0" }
+ ],
+ "stateMutability": "view",
+ "constant": true,
+ "payable": false,
+ "type": "function"
+ },
+ {
+ name: "explicitPure",
+ outputs: [],
+ inputs: [
+ { type: "int128", name: "arg0" }
+ ],
+ "stateMutability": "pure",
+ "constant": true,
+ "payable": false,
+ "type": "function"
+ },
+ {
+ name: "explicitPay",
+ outputs: [],
+ inputs: [
+ { type: "int128", name: "arg0" }
+ ],
+ "stateMutability": "payable",
+ "constant": true,
+ "payable": true,
+ "type": "function"
+ },
+ {
+ name: "explicitNonpay",
+ outputs: [],
+ inputs: [
+ { type: "int128", name: "arg0" }
+ ],
+ "stateMutability": "nonpayable",
+ "constant": true,
+ "payable": false,
+ "type": "function"
+ },
+ ]);
+ function test(name, isConst, payable, stateMutability) {
+ it(`tests ABI configuration: ${name}`, function () {
+ const f = iface.getFunction(name);
+ assert_1.default.ok(!!f, `missing ${name}`);
+ assert_1.default.equal(f.constant, isConst, `${name}.constant`);
+ assert_1.default.equal(f.stateMutability, stateMutability, `${name}.stateMutability`);
+ assert_1.default.equal(f.payable, payable, `${name}.payable`);
+ });
+ }
+ test("explicitView", true, false, "view");
+ test("explicitPure", true, false, "pure");
+ test("explicitPay", false, true, "payable");
+ test("explicitNonpay", false, false, "nonpayable");
+ test("implicitView", true, false, "view");
+ test("implicitSendNonpay", false, false, "nonpayable");
+ test("implicitSendPay", false, true, "payable");
+ test("implicitSendImplicitPay", false, true, "payable");
+ test("implicitSendExplicitPay", false, true, "payable");
+ test("implicitSendExplicitNonpay", false, false, "nonpayable");
+ test("implicitAll", false, true, "payable");
+});
+//# sourceMappingURL=test-abi.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-abi.js.map b/dist/ethers.js/src.ts/_tests/test-abi.js.map
new file mode 100644
index 0000000..959a216
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-abi.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-abi.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-abi.ts"],"names":[],"mappings":";;;;;AAAA,oDAA4B;AAC5B,yCAAuC;AAIvC,0CAGqB;AAErB,SAAS,KAAK,CAAC,MAAW,EAAE,QAA4B;IACpD,QAAQ,QAAQ,CAAC,IAAI,EAAE;QACnB,KAAK,SAAS,CAAC;QAAC,KAAK,SAAS,CAAC;QAAC,KAAK,WAAW,CAAC;QAAC,KAAK,QAAQ;YAC3D,gBAAM,CAAC,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;YACrC,OAAO;QACX,KAAK,QAAQ;YACT,gBAAM,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;YAC7C,OAAM;QACV,KAAK,OAAO,CAAC;QAAC,KAAK,QAAQ;YACvB,gBAAM,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,CAAC;YAC3C,gBAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;YACvE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBACpC,KAAK,CAAC,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,MAAM,CAAC,CAAC;IAC1C,IAAI,CAAC,aAAa,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;IAC5C,IAAI,CAAC,gBAAgB,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC;IAEnD,IAAI,CAAC,cAAc,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;IAC1C,IAAI,CAAC,oBAAoB,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC;IACvD,IAAI,CAAC,iBAAiB,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;IAChD,IAAI,CAAC,yBAAyB,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;IACxD,IAAI,CAAC,yBAAyB,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;IACxD,IAAI,CAAC,4BAA4B,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC;IAC/D,IAAI,CAAC,aAAa,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;AAChD,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-address.d.ts b/dist/ethers.js/src.ts/_tests/test-address.d.ts
new file mode 100644
index 0000000..afa579d
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-address.d.ts
@@ -0,0 +1,2 @@
+export {};
+//# sourceMappingURL=test-address.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-address.d.ts.map b/dist/ethers.js/src.ts/_tests/test-address.d.ts.map
new file mode 100644
index 0000000..9bb44b8
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-address.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-address.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-address.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-address.js b/dist/ethers.js/src.ts/_tests/test-address.js
new file mode 100644
index 0000000..a5be0ee
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-address.js
@@ -0,0 +1,115 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const assert_1 = __importDefault(require("assert"));
+const utils_js_1 = require("./utils.js");
+const index_js_1 = require("../index.js");
+describe("computes checksum address", function () {
+ const tests = (0, utils_js_1.loadTests)("accounts");
+ for (const test of tests) {
+ it(`computes the checksum address: ${test.name}`, function () {
+ assert_1.default.equal((0, index_js_1.getAddress)(test.address), test.address);
+ assert_1.default.equal((0, index_js_1.getAddress)(test.icap), test.address);
+ assert_1.default.equal((0, index_js_1.getAddress)(test.address.substring(2)), test.address);
+ assert_1.default.equal((0, index_js_1.getAddress)(test.address.toLowerCase()), test.address);
+ assert_1.default.equal((0, index_js_1.getAddress)("0x" + test.address.substring(2).toUpperCase()), test.address);
+ });
+ }
+ const invalidAddresses = [
+ { name: "null", value: null },
+ { name: "number", value: 1234 },
+ { name: "emtpy bytes", value: "0x" },
+ { name: "too short", value: "0x8ba1f109551bd432803012645ac136ddd64dba" },
+ { name: "too long", value: "0x8ba1f109551bd432803012645ac136ddd64dba7200" },
+ ];
+ invalidAddresses.forEach(({ name, value }) => {
+ it(`correctly fails on invalid address: ${name}`, function () {
+ assert_1.default.throws(function () {
+ (0, index_js_1.getAddress)(value);
+ }, function (error) {
+ return (error.code === "INVALID_ARGUMENT" &&
+ error.message.match(/^invalid address/) &&
+ error.argument === "address" &&
+ error.value === value);
+ });
+ });
+ });
+ it("correctly fails on invalid checksum", function () {
+ const value = "0x8ba1f109551bD432803012645Ac136ddd64DBa72";
+ assert_1.default.throws(function () {
+ (0, index_js_1.getAddress)(value);
+ }, function (error) {
+ return (error.code === "INVALID_ARGUMENT" &&
+ error.message.match(/^bad address checksum/) &&
+ error.argument === "address" &&
+ error.value === value);
+ });
+ });
+ it("correctly fails on invalid IBAN checksum", function () {
+ const value = "XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK37";
+ assert_1.default.throws(function () {
+ (0, index_js_1.getAddress)(value);
+ }, function (error) {
+ return (error.code === "INVALID_ARGUMENT" &&
+ error.message.match(/^bad icap checksum/) &&
+ error.argument === "address" &&
+ error.value === value);
+ });
+ });
+});
+describe("computes ICAP address", function () {
+ const tests = (0, utils_js_1.loadTests)("accounts");
+ for (const test of tests) {
+ it(`computes the ICAP address: ${test.name}`, function () {
+ assert_1.default.equal((0, index_js_1.getIcapAddress)(test.address), test.icap);
+ assert_1.default.equal((0, index_js_1.getAddress)(test.address.toLowerCase()), test.address);
+ assert_1.default.equal((0, index_js_1.getAddress)("0x" + test.address.substring(2).toUpperCase()), test.address);
+ });
+ }
+});
+describe("computes create address", function () {
+ const tests = (0, utils_js_1.loadTests)("create");
+ for (const { sender, creates } of tests) {
+ for (const { name, nonce, address } of creates) {
+ it(`computes the create address: ${name}`, function () {
+ assert_1.default.equal((0, index_js_1.getCreateAddress)({ from: sender, nonce }), address);
+ });
+ }
+ }
+});
+describe("computes create2 address", function () {
+ const tests = (0, utils_js_1.loadTests)("create2");
+ for (const { sender, creates } of tests) {
+ for (const { name, salt, initCodeHash, address } of creates) {
+ it(`computes the create2 address: ${name}`, function () {
+ assert_1.default.equal((0, index_js_1.getCreate2Address)(sender, salt, initCodeHash), address);
+ });
+ }
+ }
+ const sender = "0x8ba1f109551bD432803012645Ac136ddd64DBA72";
+ const salt = "0x1c8aff950685c2ed4bc3174f3472287b56d9517b9c948127319a09a7a36deac8";
+ const initCodeHash = "0x8452c9b9140222b08593a26daa782707297be9f7b3e8281d7b4974769f19afd0";
+ it("correctly fails on invalid salt", function () {
+ const badSalt = "0x1c8aff950685c2ed4bc3174f3472287b56d9517b9c948127319a09a7a36dea";
+ assert_1.default.throws(function () {
+ (0, index_js_1.getCreate2Address)(sender, badSalt, initCodeHash);
+ }, function (error) {
+ return (error.code === "INVALID_ARGUMENT" &&
+ error.argument === "salt" &&
+ error.value === badSalt);
+ });
+ });
+ it("correctly fails on invalid initCodeHash", function () {
+ const badInitCodeHash = "0x8452c9b9140222b08593a26daa782707297be9f7b3e8281d7b4974769f19af";
+ assert_1.default.throws(function () {
+ (0, index_js_1.getCreate2Address)(sender, salt, badInitCodeHash);
+ }, function (error) {
+ return (error.code === "INVALID_ARGUMENT" &&
+ error.argument === "initCodeHash" &&
+ error.value === badInitCodeHash);
+ });
+ });
+});
+//# sourceMappingURL=test-address.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-address.js.map b/dist/ethers.js/src.ts/_tests/test-address.js.map
new file mode 100644
index 0000000..a48d0c2
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-address.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-address.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-address.ts"],"names":[],"mappings":";;;;;AAAA,oDAA4B;AAE5B,yCAAuC;AAQvC,0CAGqB;AAGrB,QAAQ,CAAC,2BAA2B,EAAE;IAClC,MAAM,KAAK,GAAG,IAAA,oBAAS,EAAkB,UAAU,CAAC,CAAC;IACrD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACtB,EAAE,CAAC,kCAAmC,IAAI,CAAC,IAAK,EAAE,EAAE;YAChD,gBAAM,CAAC,KAAK,CAAC,IAAA,qBAAU,EAAC,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;YACrD,gBAAM,CAAC,KAAK,CAAC,IAAA,qBAAU,EAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;YAClD,gBAAM,CAAC,KAAK,CAAC,IAAA,qBAAU,EAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;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AC;IAClF,MAAM,YAAY,GAAG,oEAAoE,CAAC;IAE1F,EAAE,CAAC,iCAAiC,EAAE;QAClC,MAAM,OAAO,GAAG,kEAAkE,CAAC;QACnF,gBAAM,CAAC,MAAM,CAAC;YACV,IAAA,4BAAiB,EAAC,MAAM,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC;QACrD,CAAC,EAAE,UAAS,KAAU;YAClB,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,kBAAkB;gBACrC,KAAK,CAAC,QAAQ,KAAK,MAAM;gBACzB,KAAK,CAAC,KAAK,KAAK,OAAO,CAAC,CAAC;QACjC,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yCAAyC,EAAE;QAC1C,MAAM,eAAe,GAAG,kEAAkE,CAAC;QAC3F,gBAAM,CAAC,MAAM,CAAC;YACV,IAAA,4BAAiB,EAAC,MAAM,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC;QACrD,CAAC,EAAE,UAAS,KAAU;YAClB,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,kBAAkB;gBACrC,KAAK,CAAC,QAAQ,KAAK,cAAc;gBACjC,KAAK,CAAC,KAAK,KAAK,eAAe,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-contract-integ.d.ts b/dist/ethers.js/src.ts/_tests/test-contract-integ.d.ts
new file mode 100644
index 0000000..404e7e4
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-contract-integ.d.ts
@@ -0,0 +1,2 @@
+export {};
+//# sourceMappingURL=test-contract-integ.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-contract-integ.d.ts.map b/dist/ethers.js/src.ts/_tests/test-contract-integ.d.ts.map
new file mode 100644
index 0000000..89e37f6
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-contract-integ.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-contract-integ.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-contract-integ.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-contract-integ.js b/dist/ethers.js/src.ts/_tests/test-contract-integ.js
new file mode 100644
index 0000000..becdda4
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-contract-integ.js
@@ -0,0 +1,93 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const assert_1 = __importDefault(require("assert"));
+const index_js_1 = require("../index.js");
+describe("Tests contract integration", function () {
+ const provider = new index_js_1.ethers.JsonRpcProvider("http:/\/127.0.0.1:8545");
+ const abi = [
+ "constructor(address owner, uint maxSupply)",
+ "function mint(address target) returns (bool minted)",
+ "function totalSupply() view returns (uint supply)",
+ "function balanceOf(address target) view returns (uint balance)",
+ "event Minted(address target)"
+ ];
+ let address = null;
+ it("deploys a contract", function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.timeout(10000);
+ const bytecode = "0x60c060405234801561001057600080fd5b506040516105863803806105868339818101604052810190610032919061010e565b8173ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff16815250508060a08181525050505061014e565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100a58261007a565b9050919050565b6100b58161009a565b81146100c057600080fd5b50565b6000815190506100d2816100ac565b92915050565b6000819050919050565b6100eb816100d8565b81146100f657600080fd5b50565b600081519050610108816100e2565b92915050565b6000806040838503121561012557610124610075565b5b6000610133858286016100c3565b9250506020610144858286016100f9565b9150509250929050565b60805160a051610414610172600039600060fa0152600061021f01526104146000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c806318160ddd146100515780636a6278421461006f57806370a082311461009f5780638da5cb5b146100cf575b600080fd5b6100596100ed565b604051610066919061025c565b60405180910390f35b610089600480360381019061008491906102da565b6100f6565b6040516100969190610322565b60405180910390f35b6100b960048036038101906100b491906102da565b6101d2565b6040516100c6919061025c565b60405180910390f35b6100d761021b565b6040516100e4919061034c565b60405180910390f35b60008054905090565b60007f00000000000000000000000000000000000000000000000000000000000000006000541061012657600080fd5b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919061017690610396565b919050555060008081548092919061018d90610396565b91905055507f90ddedd5a25821bba11fbb98de02ec1f75c1be90ae147d6450ce873e7b78b5d8826040516101c1919061034c565b60405180910390a160019050919050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60007f0000000000000000000000000000000000000000000000000000000000000000905090565b6000819050919050565b61025681610243565b82525050565b6000602082019050610271600083018461024d565b92915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006102a78261027c565b9050919050565b6102b78161029c565b81146102c257600080fd5b50565b6000813590506102d4816102ae565b92915050565b6000602082840312156102f0576102ef610277565b5b60006102fe848285016102c5565b91505092915050565b60008115159050919050565b61031c81610307565b82525050565b60006020820190506103376000830184610313565b92915050565b6103468161029c565b82525050565b6000602082019050610361600083018461033d565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006103a182610243565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036103d3576103d2610367565b5b60018201905091905056fea26469706673582212200a979ea2bfdf429b5546fa25906c9d20a3d67ef5fbe531f31d2cc83533e3239564736f6c63430008120033";
+ const signer = yield provider.getSigner(0);
+ const factory = new index_js_1.ethers.ContractFactory(abi, bytecode, signer);
+ const contract = yield factory.deploy(signer, 100);
+ address = yield contract.getAddress();
+ yield contract.waitForDeployment();
+ const deployed = yield provider.getCode(address);
+ assert_1.default.ok(deployed != "0x", "has bytescode");
+ });
+ });
+ it("runs contract operations", function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.timeout(10000);
+ assert_1.default.ok(address != null);
+ const signer = yield provider.getSigner(0);
+ const CustomContract = index_js_1.ethers.BaseContract.buildClass(abi);
+ const contract = new CustomContract(address, signer); //ethers.Contract.from(address, abi, signer);
+ // Test implicit staticCall (i.e. view/pure)
+ {
+ const supply0 = yield contract.totalSupply();
+ assert_1.default.equal(supply0, BigInt(0), "initial supply 0; default");
+ }
+ // Test explicit staticCall
+ {
+ const supply0 = yield contract.totalSupply.staticCall();
+ assert_1.default.equal(supply0, BigInt(0), "initial supply 0; staticCall");
+ }
+ // Test staticCallResult (positional and named)
+ {
+ const supply0 = yield contract.totalSupply.staticCallResult();
+ assert_1.default.equal(supply0[0], BigInt(0), "initial supply 0; staticCallResult");
+ assert_1.default.equal(supply0.supply, BigInt(0), "initial supply 0; staticCallResult");
+ }
+ // Test populateTransaction
+ const txInfo = yield contract.mint.populateTransaction(signer);
+ assert_1.default.equal(txInfo.to, address, "populateTransaction.to");
+ const txInfoData = index_js_1.ethers.hexlify(index_js_1.ethers.concat([
+ "0x6a627842",
+ index_js_1.ethers.zeroPadValue(yield signer.getAddress(), 32)
+ ]));
+ assert_1.default.equal(txInfo.data, txInfoData, "populateTransaction.data");
+ // Test minting (default)
+ const tx = yield contract.mint(signer);
+ const receipt = yield tx.wait();
+ assert_1.default.ok(receipt, "receipt");
+ // Check the receipt has parsed the events
+ assert_1.default.equal(receipt.logs.length, 1, "logs.length");
+ assert_1.default.ok(receipt instanceof index_js_1.ethers.ContractTransactionReceipt, "receipt typeof");
+ assert_1.default.ok(receipt.logs[0] instanceof index_js_1.ethers.EventLog, "receipt.log typeof");
+ assert_1.default.equal(receipt.logs[0].fragment && receipt.logs[0].fragment.name, "Minted", "logs[0].fragment.name");
+ assert_1.default.equal(receipt.logs[0].args[0], yield signer.getAddress(), "logs[0].args[0]");
+ assert_1.default.equal(receipt.logs[0].args.target, yield signer.getAddress(), "logs[0].args.target");
+ // Check the state has been adjusted
+ assert_1.default.equal(yield contract.totalSupply(), BigInt(1), "initial supply 1; default");
+ assert_1.default.equal(yield contract.balanceOf(signer), BigInt(1), "balanceOf(signer)");
+ // Test minting (explicit)
+ const tx2 = yield contract.mint.send(signer);
+ yield tx2.wait();
+ // Check the state has been adjusted
+ assert_1.default.equal(yield contract.totalSupply(), BigInt(2), "initial supply 2; default");
+ });
+ });
+});
+//# sourceMappingURL=test-contract-integ.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-contract-integ.js.map b/dist/ethers.js/src.ts/_tests/test-contract-integ.js.map
new file mode 100644
index 0000000..dee49f9
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-contract-integ.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-contract-integ.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-contract-integ.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,oDAA4B;AAG5B,0CAAqC;AAQrC,QAAQ,CAAC,4BAA4B,EAAE;IACnC,MAAM,QAAQ,GAAG,IAAI,iBAAM,CAAC,eAAe,CAAC,wBAAwB,CAAC,CAAC;IAEtE,MAAM,GAAG,GAAG;QACR,4CAA4C;QAC5C,qDAAqD;QACrD,mDAAmD;QACnD,gEAAgE;QAChE,8BAA8B;KACjC,CAAC;IAEF,IAAI,OAAO,GAAkB,IAAI,CAAC;IAElC,EAAE,CAAC,oBAAoB,EAAE;;Y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AAC,MAAM,QAAQ,CAAC,WAAW,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,2BAA2B,CAAC,CAAC;QACvF,CAAC;KAAA,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-contract.d.ts b/dist/ethers.js/src.ts/_tests/test-contract.d.ts
new file mode 100644
index 0000000..1427a86
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-contract.d.ts
@@ -0,0 +1,2 @@
+export {};
+//# sourceMappingURL=test-contract.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-contract.d.ts.map b/dist/ethers.js/src.ts/_tests/test-contract.d.ts.map
new file mode 100644
index 0000000..fa77a18
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-contract.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-contract.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-contract.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-contract.js b/dist/ethers.js/src.ts/_tests/test-contract.js
new file mode 100644
index 0000000..4f1fc82
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-contract.js
@@ -0,0 +1,386 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const assert_1 = __importDefault(require("assert"));
+const create_provider_js_1 = require("./create-provider.js");
+const index_js_1 = require("../index.js");
+(0, create_provider_js_1.setupProviders)();
+describe("Test Contract", function () {
+ const addr = "0x99417252Aad7B065940eBdF50d665Fb8879c5958";
+ const abi = [
+ "error CustomError1(uint256 code, string message)",
+ "event EventUint256(uint256 indexed value)",
+ "event EventAddress(address indexed value)",
+ "event EventString(string value)",
+ "event EventBytes(bytes value)",
+ "function testCustomError1(bool pass, uint code, string calldata message) pure returns (uint256)",
+ "function testErrorString(bool pass, string calldata message) pure returns (uint256)",
+ "function testPanic(uint256 code) returns (uint256)",
+ "function testEvent(uint256 valueUint256, address valueAddress, string valueString, bytes valueBytes) public",
+ "function testCallAdd(uint256 a, uint256 b) pure returns (uint256 result)",
+ ];
+ it("tests contract calls", function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.timeout(10000);
+ const provider = (0, create_provider_js_1.getProvider)("InfuraProvider", "goerli");
+ const contract = new index_js_1.Contract(addr, abi, provider);
+ assert_1.default.equal(yield contract.testCallAdd(4, 5), BigInt(9), "testCallAdd(4, 5)");
+ assert_1.default.equal(yield contract.testCallAdd(6, 0), BigInt(6), "testCallAdd(6, 0)");
+ });
+ });
+ it("tests events", function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.timeout(60000);
+ const provider = (0, create_provider_js_1.getProvider)("InfuraProvider", "goerli");
+ assert_1.default.ok(provider);
+ const contract = new index_js_1.Contract(addr, abi, provider);
+ const signer = new index_js_1.Wallet((process.env.FAUCET_PRIVATEKEY), provider);
+ const contractSigner = contract.connect(signer);
+ const vUint256 = 42;
+ const vAddrName = "ethers.eth";
+ const vAddr = "0x228568EA92aC5Bc281c1E30b1893735c60a139F1";
+ const vString = "Hello";
+ const vBytes = "0x12345678";
+ let hash = null;
+ // Test running a listener for a specific event
+ const specificEvent = new Promise((resolve, reject) => {
+ contract.on("EventUint256", (value, event) => __awaiter(this, void 0, void 0, function* () {
+ // Triggered by someone else
+ if (hash == null || hash !== event.log.transactionHash) {
+ return;
+ }
+ try {
+ assert_1.default.equal(event.filter, "EventUint256", "event.filter");
+ assert_1.default.equal(event.fragment.name, "EventUint256", "event.fragment.name");
+ assert_1.default.equal(event.log.address, addr, "event.log.address");
+ assert_1.default.equal(event.args.length, 1, "event.args.length");
+ assert_1.default.equal(event.args[0], BigInt(42), "event.args[0]");
+ const count = yield contract.listenerCount("EventUint256");
+ yield event.removeListener();
+ assert_1.default.equal(yield contract.listenerCount("EventUint256"), count - 1, "decrement event count");
+ resolve(null);
+ }
+ catch (e) {
+ event.removeListener();
+ reject(e);
+ }
+ }));
+ });
+ // Test running a listener on all (i.e. "*") events
+ const allEvents = new Promise((resolve, reject) => {
+ const waitingFor = {
+ EventUint256: vUint256,
+ EventAddress: vAddr,
+ EventString: vString,
+ EventBytes: vBytes
+ };
+ contract.on("*", (event) => {
+ // Triggered by someone else
+ if (hash == null || hash !== event.log.transactionHash) {
+ return;
+ }
+ try {
+ const name = event.eventName;
+ assert_1.default.equal(event.args[0], waitingFor[name], `${name}`);
+ delete waitingFor[name];
+ if (Object.keys(waitingFor).length === 0) {
+ event.removeListener();
+ resolve(null);
+ }
+ }
+ catch (error) {
+ reject(error);
+ }
+ });
+ });
+ // Send a transaction to trigger some events
+ const tx = yield contractSigner.testEvent(vUint256, vAddr, vString, vBytes);
+ hash = tx.hash;
+ const checkEvent = (filter, event) => {
+ const values = {
+ EventUint256: vUint256,
+ EventString: vString,
+ EventAddress: vAddr,
+ EventBytes: vBytes
+ };
+ assert_1.default.ok(event instanceof index_js_1.EventLog, `queryFilter(${filter}):isEventLog`);
+ const name = event.eventName;
+ assert_1.default.equal(event.address, addr, `queryFilter(${filter}):address`);
+ assert_1.default.equal(event.args[0], values[name], `queryFilter(${filter}):args[0]`);
+ };
+ const checkEventFilter = (filter) => __awaiter(this, void 0, void 0, function* () {
+ const events = (yield contract.queryFilter(filter, -10)).filter((e) => (e.transactionHash === hash));
+ assert_1.default.equal(events.length, 1, `queryFilter(${filter}).length`);
+ checkEvent(filter, events[0]);
+ return events[0];
+ });
+ const receipt = yield tx.wait();
+ // Check the logs in the receipt
+ for (const log of receipt.logs) {
+ checkEvent("receipt", log);
+ }
+ // Various options for queryFilter
+ yield checkEventFilter("EventUint256");
+ yield checkEventFilter(["EventUint256"]);
+ yield checkEventFilter([["EventUint256"]]);
+ yield checkEventFilter("EventUint256(uint)");
+ yield checkEventFilter(["EventUint256(uint)"]);
+ yield checkEventFilter([["EventUint256(uint)"]]);
+ yield checkEventFilter([["EventUint256", "EventUint256(uint)"]]);
+ yield checkEventFilter("0x85c55bbb820e6d71c71f4894e57751de334b38c421f9c170b0e66d32eafea337");
+ // Query by Event
+ yield checkEventFilter(contract.filters.EventUint256);
+ // Query by Deferred Topic Filter; address
+ yield checkEventFilter(contract.filters.EventUint256(vUint256));
+ // Query by Deferred Topic Filter; address
+ yield checkEventFilter(contract.filters.EventAddress(vAddr));
+ // Query by Deferred Topic Filter; ENS name => address
+ yield checkEventFilter(contract.filters.EventAddress(vAddrName));
+ // Multiple Methods
+ {
+ const filter = [["EventUint256", "EventString"]];
+ const events = (yield contract.queryFilter(filter, -10)).filter((e) => (e.transactionHash === hash));
+ assert_1.default.equal(events.length, 2, `queryFilter(${filter}).length`);
+ for (const event of events) {
+ checkEvent(filter, event);
+ }
+ }
+ yield specificEvent;
+ yield allEvents;
+ });
+ });
+ it("tests the _in_ operator for functions", function () {
+ const contract = new index_js_1.Contract(addr, abi);
+ assert_1.default.equal("testCallAdd" in contract, true, "has(testCallAdd)");
+ assert_1.default.equal("nonExist" in contract, false, "has(nonExist)");
+ {
+ const sig = "function testCallAdd(uint256 a, uint256 b) pure returns (uint256 result)";
+ assert_1.default.equal(sig in contract, true, `has(${sig})`);
+ assert_1.default.equal("function nonExist()" in contract, false, "has(function nonExist())");
+ }
+ assert_1.default.equal("0xf24684e5" in contract, true, "has(0xf24684e5)");
+ assert_1.default.equal("0xbad01234" in contract, false, "has(0xbad01234)");
+ });
+ it("tests the _in_ operator for events", function () {
+ const contract = new index_js_1.Contract(addr, abi);
+ assert_1.default.equal("EventUint256" in contract.filters, true, "has(EventUint256)");
+ assert_1.default.equal("NonExist" in contract.filters, false, "has(NonExist)");
+ {
+ const sig = "event EventUint256(uint256 indexed value)";
+ assert_1.default.equal(sig in contract.filters, true, `has(${sig})`);
+ assert_1.default.equal("event NonExist()" in contract.filters, false, "has(event NonExist())");
+ }
+ {
+ const hash = "0x85c55bbb820e6d71c71f4894e57751de334b38c421f9c170b0e66d32eafea337";
+ const badHash = "0xbad01234567890ffbad01234567890ffbad01234567890ffbad01234567890ff";
+ assert_1.default.equal(hash in contract.filters, true, `has(${hash})`);
+ assert_1.default.equal(badHash in contract.filters, false, `has(${badHash})`);
+ }
+ });
+});
+describe("Test Typed Contract Interaction", function () {
+ const tests = [
+ {
+ types: ["uint8", "uint16", "uint24", "uint32", "uint40", "uint48", "uint56", "uint64", "uint72", "uint80", "uint88", "uint96", "uint104", "uint112", "uint120", "uint128", "uint136", "uint144", "uint152", "uint160", "uint168", "uint176", "uint184", "uint192", "uint200", "uint208", "uint216", "uint224", "uint232", "uint240", "uint248", "uint256", "int8", "int16", "int24", "int32", "int40", "int48", "int56", "int64", "int72", "int80", "int88", "int96", "int104", "int112", "int120", "int128", "int136", "int144", "int152", "int160", "int168", "int176", "int184", "int192", "int200", "int208", "int216", "int224", "int232", "int240", "int248", "int256"],
+ valueFunc: (type) => { return 42; }
+ },
+ {
+ types: [
+ "bytes1", "bytes2", "bytes3", "bytes4", "bytes5", "bytes6", "bytes7", "bytes8", "bytes9", "bytes10", "bytes11", "bytes12", "bytes13", "bytes14", "bytes15", "bytes16", "bytes17", "bytes18", "bytes19", "bytes20", "bytes21", "bytes22", "bytes23", "bytes24", "bytes25", "bytes26", "bytes27", "bytes28", "bytes29", "bytes30", "bytes31", "bytes32",
+ "bytes"
+ ],
+ valueFunc: (type) => {
+ const length = type.substring(5);
+ if (length) {
+ const value = new Uint8Array(parseInt(length));
+ value.fill(42);
+ return value;
+ }
+ return "0x123456";
+ }
+ }, {
+ types: ["bool"],
+ valueFunc: (type) => { return true; }
+ }, {
+ types: ["address"],
+ valueFunc: (type) => { return "0x643aA0A61eADCC9Cc202D1915D942d35D005400C"; }
+ }, {
+ types: ["string"],
+ valueFunc: (type) => { return "someString"; }
+ }
+ ];
+ const abi = [];
+ for (let i = 1; i <= 32; i++) {
+ abi.push(`function testTyped(uint${i * 8}) public pure returns (string memory)`);
+ abi.push(`function testTyped(int${i * 8}) public pure returns (string memory)`);
+ abi.push(`function testTyped(bytes${i}) public pure returns (string memory)`);
+ }
+ abi.push(`function testTyped(address) public pure returns (string memory)`);
+ abi.push(`function testTyped(bool) public pure returns (string memory)`);
+ abi.push(`function testTyped(bytes memory) public pure returns (string memory)`);
+ abi.push(`function testTyped(string memory) public pure returns (string memory)`);
+ const addr = "0x838f41545DA5e18AA0e1ab391085d22E172B7B02";
+ const provider = (0, create_provider_js_1.getProvider)("InfuraProvider", "goerli");
+ const contract = new index_js_1.Contract(addr, abi, provider);
+ for (const { types, valueFunc } of tests) {
+ for (const type of types) {
+ const value = valueFunc(type);
+ it(`tests typed value: Typed.from(${type})`, function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.timeout(10000);
+ const v = index_js_1.Typed.from(type, value);
+ const result = yield contract.testTyped(v);
+ assert_1.default.equal(result, type);
+ });
+ });
+ it(`tests typed value: Typed.${type}()`, function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.timeout(10000);
+ const v = index_js_1.Typed[type](value);
+ const result = yield contract.testTyped(v);
+ assert_1.default.equal(result, type);
+ });
+ });
+ }
+ }
+});
+describe("Test Contract Fallback", function () {
+ const tests = [
+ {
+ name: "none",
+ address: "0x0ccdace3d8353fed9b87a2d63c40452923ccdae5",
+ abi: [],
+ sendNone: { error: "no fallback" },
+ sendData: { error: "no fallback" },
+ sendValue: { error: "no fallback" },
+ sendDataAndValue: { error: "no fallback" },
+ },
+ {
+ name: "non-payable fallback",
+ address: "0x3f10193f79a639b11ec9d2ab42a25a4a905a8870",
+ abi: [
+ "fallback()"
+ ],
+ sendNone: { data: "0x" },
+ sendData: { data: "0x1234" },
+ sendValue: { error: "overrides.value" },
+ sendDataAndValue: { error: "overrides.value" },
+ },
+ {
+ name: "payable fallback",
+ address: "0xe2de6b97c5eb9fee8a47ca6c0fa642331e0b6330",
+ abi: [
+ "fallback() payable"
+ ],
+ sendNone: { data: "0x" },
+ sendData: { data: "0x1234" },
+ sendValue: { data: "0x" },
+ sendDataAndValue: { data: "0x1234" },
+ },
+ {
+ name: "receive-only",
+ address: "0xf8f2afbbe37f6a4520e4db7f99495655aa31229b",
+ abi: [
+ "receive()"
+ ],
+ sendNone: { data: "0x" },
+ sendData: { error: "overrides.data" },
+ sendValue: { data: "0x" },
+ sendDataAndValue: { error: "overrides.data" },
+ },
+ {
+ name: "receive and payable fallback",
+ address: "0x7d97ca5d9dea1cd0364f1d493252006a3c4e18a0",
+ abi: [
+ "fallback() payable",
+ "receive()"
+ ],
+ sendNone: { data: "0x" },
+ sendData: { data: "0x1234" },
+ sendValue: { data: "0x" },
+ sendDataAndValue: { data: "0x1234" },
+ },
+ {
+ name: "receive and non-payable fallback",
+ address: "0x5b59d934f0d22b15e73b5d6b9ae83486b70df67e",
+ abi: [
+ "fallback()",
+ "receive()"
+ ],
+ sendNone: { data: "0x" },
+ sendData: { data: "0x" },
+ sendValue: { data: "0x" },
+ sendDataAndValue: { error: "overrides" },
+ },
+ ];
+ const provider = (0, create_provider_js_1.getProvider)("InfuraProvider", "goerli");
+ const testGroups = [
+ {
+ group: "sendNone",
+ tx: {}
+ },
+ {
+ group: "sendData",
+ tx: { data: "0x1234" }
+ },
+ {
+ group: "sendValue",
+ tx: { value: 123 }
+ },
+ {
+ group: "sendDataAndValue",
+ tx: { data: "0x1234", value: 123 }
+ },
+ ];
+ for (const { group, tx } of testGroups) {
+ for (const test of tests) {
+ const { name, address, abi } = test;
+ const send = test[group];
+ const contract = new index_js_1.Contract(address, abi, provider);
+ it(`test contract fallback checks: ${group} - ${name}`, function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ const func = function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ if (abi.length === 0) {
+ throw new Error("no fallback");
+ }
+ assert_1.default.ok(contract.fallback);
+ return yield contract.fallback.populateTransaction(tx);
+ });
+ };
+ if ("data" in send) {
+ yield func();
+ //const result = await func();
+ //@TODO: Test for the correct populated tx
+ //console.log(result);
+ assert_1.default.ok(true);
+ }
+ else {
+ yield assert_1.default.rejects(func, function (error) {
+ if (error.message === send.error) {
+ return true;
+ }
+ if ((0, index_js_1.isError)(error, "INVALID_ARGUMENT")) {
+ return error.argument === send.error;
+ }
+ console.log("EE", error);
+ return true;
+ });
+ }
+ });
+ });
+ }
+ }
+});
+//# sourceMappingURL=test-contract.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-contract.js.map b/dist/ethers.js/src.ts/_tests/test-contract.js.map
new file mode 100644
index 0000000..3522540
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-contract.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-contract.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-contract.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,oDAA4B;AAE5B,6DAAmE;AAEnE,0CAEqB;AAGrB,IAAA,mCAAc,GAAE,CAAC;AAEjB,QAAQ,CAAC,eAAe,EAAE;IACtB,MAAM,IAAI,GAAG,4CAA4C,CAAC;IAC1D,MAAM,GAAG,GAAG;QACR,kDAAkD;QAElD,2CAA2C;QAC3C,2CAA2C;QAC3C,iCAAiC;QACjC,+BAA+B;QAE/B,iGAAiG;QACjG,qFAAqF;QACrF,oDAAoD;QACpD,6GAA6G;QAC7G,0EAA0E;KAC7E,CAAC;IAEF,EAAE,CAAC,sBAAsB,EAAE;;YACvB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YAEpB,MAAM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C1D,CAAC;qBAAA,CAAC;oBAEF,IAAI,MAAM,IAAI,IAAI,EAAE;wBAChB,MAAM,IAAI,EAAE,CAAC;wBACb,8BAA8B;wBAC9B,0CAA0C;wBAC1C,sBAAsB;wBACtB,gBAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;qBACnB;yBAAM;wBACH,MAAM,gBAAM,CAAC,OAAO,CAAC,IAAI,EAAE,UAAS,KAAU;4BAC1C,IAAI,KAAK,CAAC,OAAO,KAAK,IAAI,CAAC,KAAK,EAAE;gCAAE,OAAO,IAAI,CAAC;6BAAE;4BAClD,IAAI,IAAA,kBAAO,EAAC,KAAK,EAAE,kBAAkB,CAAC,EAAE;gCACpC,OAAO,KAAK,CAAC,QAAQ,KAAK,IAAI,CAAC,KAAK,CAAC;6BACxC;4BACD,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;4BACzB,OAAO,IAAI,CAAC;wBAChB,CAAC,CAAC,CAAC;qBACN;gBACL,CAAC;aAAA,CAAC,CAAC;SACN;KACJ;AACL,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-crypto-algoswap.d.ts b/dist/ethers.js/src.ts/_tests/test-crypto-algoswap.d.ts
new file mode 100644
index 0000000..8c2f71d
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-crypto-algoswap.d.ts
@@ -0,0 +1,2 @@
+export {};
+//# sourceMappingURL=test-crypto-algoswap.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-crypto-algoswap.d.ts.map b/dist/ethers.js/src.ts/_tests/test-crypto-algoswap.d.ts.map
new file mode 100644
index 0000000..5aee820
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-crypto-algoswap.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-crypto-algoswap.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-crypto-algoswap.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-crypto-algoswap.js b/dist/ethers.js/src.ts/_tests/test-crypto-algoswap.js
new file mode 100644
index 0000000..4f279bf
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-crypto-algoswap.js
@@ -0,0 +1,112 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const assert_1 = __importDefault(require("assert"));
+const index_js_1 = require("../index.js");
+describe("test registration", function () {
+ let hijack = "";
+ function getHijack(algo) {
+ return function (...args) {
+ hijack = `hijacked ${algo}: ${JSON.stringify(args)}`;
+ return "0x42";
+ };
+ }
+ const tests = [
+ {
+ name: "keccak256",
+ params: ["0x"],
+ hijackTag: 'hijacked keccak256: [{}]',
+ algorithm: index_js_1.keccak256
+ },
+ {
+ name: "sha256",
+ params: ["0x"],
+ hijackTag: 'hijacked sha256: [{}]',
+ algorithm: index_js_1.sha256
+ },
+ {
+ name: "sha512",
+ params: ["0x"],
+ hijackTag: 'hijacked sha512: [{}]',
+ algorithm: index_js_1.sha512
+ },
+ {
+ name: "ripemd160",
+ params: ["0x"],
+ hijackTag: 'hijacked ripemd160: [{}]',
+ algorithm: index_js_1.ripemd160
+ },
+ {
+ name: "pbkdf2",
+ params: ["0x", "0x", 1024, 32, "sha256"],
+ hijackTag: 'hijacked pbkdf2: [{},{},1024,32,"sha256"]',
+ algorithm: index_js_1.pbkdf2
+ },
+ {
+ name: "scryptSync",
+ params: ["0x", "0x", 1024, 8, 1, 32],
+ hijackTag: 'hijacked scryptSync: [{},{},1024,8,1,32]',
+ algorithm: index_js_1.scryptSync
+ },
+ {
+ name: "scrypt",
+ params: ["0x", "0x", 1024, 8, 1, 32],
+ hijackTag: 'hijacked scrypt: [{},{},1024,8,1,32,null]',
+ algorithm: index_js_1.scrypt
+ },
+ {
+ name: "computeHmac",
+ params: ["sha256", "0x", "0x"],
+ hijackTag: 'hijacked computeHmac: ["sha256",{},{}]',
+ algorithm: index_js_1.computeHmac
+ },
+ {
+ name: "randomBytes",
+ params: [32],
+ hijackTag: "hijacked randomBytes: [32]",
+ algorithm: index_js_1.randomBytes,
+ postCheck: (value) => {
+ return (value instanceof Uint8Array && value.length === 32);
+ }
+ }
+ ];
+ tests.forEach(({ name, params, hijackTag, algorithm, postCheck }) => {
+ it(`swaps in hijacked callback: ${name}`, function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ const initial = yield algorithm(...params);
+ algorithm.register(getHijack(name));
+ assert_1.default.equal(yield algorithm(...params), "0x42");
+ assert_1.default.equal(hijack, hijackTag);
+ algorithm.register(algorithm._);
+ if (postCheck) {
+ assert_1.default.ok(postCheck(yield algorithm(...params)));
+ }
+ else {
+ assert_1.default.equal(yield algorithm(...params), initial);
+ }
+ });
+ });
+ });
+ it("prevents swapping after locked", function () {
+ (0, index_js_1.lock)();
+ tests.forEach(({ name, params, hijackTag, algorithm }) => {
+ assert_1.default.throws(function () {
+ algorithm.register(getHijack("test"));
+ }, function (error) {
+ return (error.message === `${name} is locked`);
+ });
+ });
+ });
+});
+//# sourceMappingURL=test-crypto-algoswap.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-crypto-algoswap.js.map b/dist/ethers.js/src.ts/_tests/test-crypto-algoswap.js.map
new file mode 100644
index 0000000..fa1eb4b
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-crypto-algoswap.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-crypto-algoswap.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-crypto-algoswap.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,oDAA4B;AAE5B,0CAMqB;AAmBrB,QAAQ,CAAC,mBAAmB,EAAE;IAE1B,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,SAAS,SAAS,CAAC,IAAY;QAC3B,OAAO,UAAS,GAAG,IAAgB;YAC/B,MAAM,GAAG,YAAa,IAAK,KAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAE,EAAE,CAAC;YACzD,OAAO,MAAM,CAAC;QAClB,CAAC,CAAA;IACL,CAAC;IAED,MAAM,KAAK,GAAoB;QAC3B;YACI,IAAI,EAAE,WAAW;YACjB,MAAM,EAAE,CAAE,IAAI,CAAE;YAChB,SAAS,EAAE,0BAA0B;YACrC,SAAS,EAAE,oBAAS;SACvB;QACD;YACI,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,CAAE,IAAI,CAAE;YAChB,SAAS,EAAE,uBAAuB;YAClC,SAAS,EAAE,iBAAM;SACpB;QACD;YACI,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,CAAE,IAAI,CAAE;YAChB,SAAS,EAAE,uBAAuB;YAClC,SAAS,EAAE,iBAAM;SACpB;QACD;YACI,IAAI,EAAE,WAAW;YACjB,MAAM,EAAE,CAAE,IAAI,CAAE;YAChB,SAAS,EAAE,0BAA0B;YACrC,SAAS,EAAE,oBAAS;SACvB;QACD;YACI,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,CAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,CAAE;YAC1C,SAAS,EAAE,2CAA2C;YACtD,SAAS,EAAE,iBAAM;SACpB;QACD;YACI,IAAI,EAAE,YAAY;YAClB,MAAM,EAAE,CAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CA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E;oBACX,gBAAM,CAAC,EAAE,CAAC,SAAS,CAAC,MAAM,SAAS,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;iBACpD;qBAAM;oBACH,gBAAM,CAAC,KAAK,CAAC,MAAM,SAAS,CAAC,GAAG,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC;iBACrD;YACL,CAAC;SAAA,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gCAAgC,EAAE;QACjC,IAAA,eAAI,GAAE,CAAC;QAEP,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE;YACrD,gBAAM,CAAC,MAAM,CAAC;gBACV,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;YAC1C,CAAC,EAAE,UAAS,KAAU;gBAClB,OAAO,CAAC,KAAK,CAAC,OAAO,KAAK,GAAI,IAAK,YAAY,CAAC,CAAC;YACrD,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AAEP,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-crypto.d.ts b/dist/ethers.js/src.ts/_tests/test-crypto.d.ts
new file mode 100644
index 0000000..5e2048d
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-crypto.d.ts
@@ -0,0 +1,2 @@
+export {};
+//# sourceMappingURL=test-crypto.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-crypto.d.ts.map b/dist/ethers.js/src.ts/_tests/test-crypto.d.ts.map
new file mode 100644
index 0000000..fbc52e5
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-crypto.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-crypto.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-crypto.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-crypto.js b/dist/ethers.js/src.ts/_tests/test-crypto.js
new file mode 100644
index 0000000..eac99c2
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-crypto.js
@@ -0,0 +1,493 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const assert_1 = __importDefault(require("assert"));
+const utils_js_1 = require("./utils.js");
+const index_js_1 = require("../index.js");
+const index_js_2 = require("../index.js");
+describe("test hashing", function () {
+ const tests = (0, utils_js_1.loadTests)("hashes");
+ tests.forEach((test) => {
+ it(`computes sha2-256: ${test.name}`, function () {
+ assert_1.default.equal((0, index_js_2.sha256)(test.data), test.sha256);
+ });
+ });
+ tests.forEach((test) => {
+ it(`computes sha2-512: ${test.name}`, function () {
+ assert_1.default.equal((0, index_js_2.sha512)(test.data), test.sha512);
+ });
+ });
+ tests.forEach((test) => {
+ it(`computes ripemd160: ${test.name}`, function () {
+ assert_1.default.equal((0, index_js_2.ripemd160)(test.data), test.ripemd160);
+ });
+ });
+ tests.forEach((test) => {
+ it(`computes keccak256: ${test.name}`, function () {
+ assert_1.default.equal((0, index_js_2.keccak256)(test.data), test.keccak256);
+ });
+ });
+});
+describe("test password-based key derivation", function () {
+ const tests = (0, utils_js_1.loadTests)("pbkdf");
+ tests.forEach((test) => {
+ it(`computes pbkdf2: ${test.name}`, function () {
+ const password = (0, index_js_1.getBytes)(test.password);
+ const salt = (0, index_js_1.getBytes)(test.salt);
+ const { iterations, algorithm, key } = test.pbkdf2;
+ const result = (0, index_js_2.pbkdf2)(password, salt, iterations, test.dkLen, algorithm);
+ assert_1.default.equal(result, key);
+ });
+ });
+ tests.forEach((test) => {
+ it(`computes scrypt (sync): ${test.name}`, function () {
+ this.timeout(1000);
+ const password = (0, index_js_1.getBytes)(test.password);
+ const salt = (0, index_js_1.getBytes)(test.salt);
+ const { N, r, p, key } = test.scrypt;
+ const result = (0, index_js_2.scryptSync)(password, salt, N, r, p, test.dkLen);
+ assert_1.default.equal(result, key);
+ });
+ });
+ tests.forEach((test) => {
+ it(`computes scrypt (async): ${test.name}`, function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.timeout(1000);
+ const password = (0, index_js_1.getBytes)(test.password);
+ const salt = (0, index_js_1.getBytes)(test.salt);
+ const { N, r, p, key } = test.scrypt;
+ let progressCount = 0, progressOk = true, lastProgress = -1;
+ const result = yield (0, index_js_2.scrypt)(password, salt, N, r, p, test.dkLen, (progress) => {
+ if (progress < lastProgress) {
+ progressOk = false;
+ }
+ lastProgress = progress;
+ progressCount++;
+ });
+ assert_1.default.ok(progressOk, "progress was not monotonically increasing");
+ assert_1.default.ok(progressCount > 100, "progress callback was called at leat 100 times");
+ assert_1.default.equal(result, key);
+ });
+ });
+ });
+});
+describe("test hmac", function () {
+ const tests = (0, utils_js_1.loadTests)("hmac");
+ tests.forEach((test) => {
+ it(`computes hmac: ${test.name}`, function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ const { algorithm, key, data } = test;
+ assert_1.default.equal((0, index_js_2.computeHmac)(algorithm, key, data), test.hmac);
+ });
+ });
+ });
+});
+describe("tests ECDH shared secret", function () {
+ const tests = [
+ {
+ "name": "test-0",
+ "keyA": "0xb484f7e25b06a887c3a01c97db40b5d96a1bd1ce69f342442a8395bfc995c34c",
+ "keyB": "0x407f75dc7d9f420c54bcc51189a16841b75aab53827d3ed54d5548448136f577",
+ "shared": "0x04131c0361e18fbdfb1575b06763225e8e7d4b6d33a6b6f369f20ff05bb6bb79cf6f510154615774f14a68ec405244fc8cba9fecdf012d22988575bf7f72f55cea"
+ },
+ {
+ "name": "test-1",
+ "keyA": "0x953287b3e32f93c3ae8974d380b88f9a6d89ce2969c4b589cf4d068ec719c885",
+ "keyB": "0xf92ec8bea281236772a90219e9c661d475c6dd457dbf71f3076e9f136a7dee2b",
+ "shared": "0x04b0d910de1a56e19a300e4cf7d8946fab088da26bad0be01b3139af7f61633387c110d00a9f4059a75808c7471665242996b0999677bfef0f8c9b2eb9cb7ff3f0"
+ },
+ {
+ "name": "test-2",
+ "keyA": "0xe47de7c043683a3facabbd72097c5c1c9148fc2d66854dfc32df924bfdb45a13",
+ "keyB": "0x5bfe0ef6a3c40797a4b013d01bbc02dfb150c46cb04c85a52be5d5d370d1f60a",
+ "shared": "0x04abcb75054302b210ac0ab42d412e47cc08bfc0d29298edc3a1c0f11d88c49240a8f922ca57dfbc003e6655337c75d5598b704ea91546206d9495aa61213aa96a"
+ },
+ {
+ "name": "test-3",
+ "keyA": "0x3f0b65deb1a95ec280649e81b933ef382441fdc875f6280d782e45628f0dccd7",
+ "keyB": "0x3aeb016c64f23b276f816aa5494a2cec07361d2a4a0d4992a5b99764127e8f9e",
+ "shared": "0x04de883e02e1842f87796a83790b646615902e2a0612477bc63002f23a94d700c15632660cf6018f10a81785a9f294dd100309e397e88e7d1b7d70f601a4cf3b1b"
+ },
+ {
+ "name": "test-4",
+ "keyA": "0xb9f059a915d6421848ae4344c64f1803342a7991c1fd567d61238aaaab583a5a",
+ "keyB": "0x0beb07549d6496d635c45152673455268f4beb89c07ff049c6e269dfa867ac2c",
+ "shared": "0x0411f59f62bd3033dba981f23fac5cc0718737dabeea9f060d0fd572383007402b539dd60b23b936c7842fcf16f4fb0524cc07ab02a06c3be8b33113a20f3d47d0"
+ },
+ {
+ "name": "test-5",
+ "keyA": "0xb48da3af696d7893c818b5e38ff682ab77818dccb80599f36b5108ad25214cf0",
+ "keyB": "0xac732d7e814ef45ef8a7acf31c4f04eef30247c992b558c8523f4894e599e772",
+ "shared": "0x0499778f55f0e87e28d72991c380a2ea5147f0336f5bc7d7ef6a1b2ef25e8949d05e3a5e60a1d605abe69427daf321a118f648c4b4da2529843b5409df921fb927"
+ },
+ {
+ "name": "test-6",
+ "keyA": "0x90b5123740bf282e9622ff8a2511692e0abc897bd61a64f49c2497967cb45dd5",
+ "keyB": "0x471e8f4b20e3328d4a25c20dad734e0bdc160c6c3dd3709858ca6ba6ce74d24b",
+ "shared": "0x04428de953d7409c419a6f11622c4a4d087082b54bc8207c514534ecf7901723c1f58359631ba94e95c05d934a2eedcecd705bbb61dd8f57cbb08572dc69e6a782"
+ },
+ {
+ "name": "test-7",
+ "keyA": "0x9f7f6431c1318481003fd21871b4b8a86ca779caaef10fec2209479b5072ea15",
+ "keyB": "0xb6be68f448ac1092a704613f3a75324b5c58157f3595c48a3825a0089d7f9d3c",
+ "shared": "0x0468218704c8c364d4d1838c7f66ccab205797eab0b02b93b75cf4e4437dbe13e7d9d0830971758b3a65e75eab577954b42f6721c104e4b876b77b8db63d23d43d"
+ },
+ {
+ "name": "test-8",
+ "keyA": "0xb9113e35ac2f7ba2a315e9f4301275cf561b91860f612d14a351273e38c04966",
+ "keyB": "0x00c3101f5d3d6272299180fd426dc1554854cb06dc911bc85fa97327d4fa3f21",
+ "shared": "0x04532cc9a89b735f0a11a0dbbbd40b05460dcf8e41e9da8359c727336a245d5d9babcca050434b81c01a6c70bd27692123f99377f22c0651bc0b01ae9871624894"
+ },
+ {
+ "name": "test-9",
+ "keyA": "0xf569179eccaaf12c837a7362b7fbe41976dbf760270fa759e3dff18ae2bbe5fd",
+ "keyB": "0xc8654bad899f2e827d581f45db8b7f295a0dcfe5253577d8604c08d589180527",
+ "shared": "0x04d3568b0d1203d09cf9d1707c3ed1a44eb0230d2169c19c89433df8330010160885e6e626ce4505ac6ce7dda68bd57d2ddaa07a5ef5a4685c6a4e3784b8ad9184"
+ },
+ {
+ "name": "test-10",
+ "keyA": "0x0ffd74c78276a1bcffe332b0545400e5992c87f2a2f91caa71ad76215ed2b229",
+ "keyB": "0x47dcfdf847d5b572784d546e0c5048aa4e613e74936fcc5438b75370d5f5525a",
+ "shared": "0x040fc7a5c5a7f9bfb98b596d698dbb0a87e1dcd50457544644acfb09ee3802835bbadc7717d06f4cc19af3bd308755eedfb162055b08134d63a49231ef9a38e503"
+ },
+ {
+ "name": "test-11",
+ "keyA": "0x9777dd28dd62dbf7b17244b8e7b49b3cb673b81ef9dabbb196c23ccd3d0b22e6",
+ "keyB": "0xbc1f73ca7cdc51e1264429d6f6b581c75b3a5986cb993f09ab779156764ae1b1",
+ "shared": "0x04493d9be34f59077b11f56f8f883bb1f9ff247500f482f3ff6c1adcee9860442529b957a92ddc3a40391859e3b853b95c8e2159cf2dcfcf70ad4d6b7b55386f37"
+ },
+ {
+ "name": "test-12",
+ "keyA": "0xd0ae54b6b72ddc5b8ed416251671bb488f9bd18e63fc60ed10dbcd12920d2f65",
+ "keyB": "0x2bcfd3837358a43cb181613ebdb152d72efc9fe7dada0c6bc44eb84d61070e2a",
+ "shared": "0x049f2d2eb2a6ba4937ab44c8ab1769c4b64b74b4d187f965c5ec1272cbe53d79858c8bcadfc17a37d95633da3881fb0e2900a1dfd1ac7160d67fa3dbd81b3de268"
+ },
+ {
+ "name": "test-13",
+ "keyA": "0x14dbcd45b32a3ece2adb1691352096d395354928f7ceb5197c85cfe95b4e23eb",
+ "keyB": "0x111ed2f1a9fafbe021cb07033f0a1d45084fbb6b2facd008fe1d89e7ad029ae8",
+ "shared": "0x0441389bf60228a087c317d6a07b41ce9da09a4749c6b595ba5d8deef7eb7d8c21d266450b3df6a2a2d29ed149e909b3381604c74b5154da7cdcb9bb26336a6aa5"
+ },
+ {
+ "name": "test-14",
+ "keyA": "0x3e7d474097eb34d76c38d4bc586f9cefc3bed6d8c172e4e5fea4016e0f820e1c",
+ "keyB": "0x3d8c224427a5cc554fd064020017c20f655c347f344afa68d133b1e3b8bfb0d6",
+ "shared": "0x04acd1f4ff562dd474f6ecda6f94b9d6eac65c497f0b103f1b6bcf03fd306f82505d5c5aa9de302f9c0577e479392795eaa13d68e2c6fe665ed7dc249d5a9ca7bd"
+ },
+ {
+ "name": "test-15",
+ "keyA": "0xa79deef7a811761554cc019967eeb15ad61b6a69b266e3a091c1e00d3bcd2057",
+ "keyB": "0x43fcca9678c66d1ef35617ade47cf015f75da19d1b7189144a0be0c1631a4a00",
+ "shared": "0x0470131669ac84dc65ada0c23469b39cc42a54df3482577427a7aab58bddaf13dc05469397717be0882fa7c37b8b7bbfbf49b500d1f17a3b6fe8c7f233eb2ac2b1"
+ },
+ {
+ "name": "test-16",
+ "keyA": "0x1945930000f6a3bdf339d5b632c3864f9ce8a0370243dd2bdcf805aa8f9e80e8",
+ "keyB": "0xa97c423f9cc5827730b33ba804d15c8c97406f154a71561e3ed263299781e591",
+ "shared": "0x0414fca0eb5db9d0b52f64b5e7b794659e87f2ee6816e83076d1e16446f5e9646fb1dd042027eee659363958d472f4a38f9bc400556dd85c7802eb1b87d4250581"
+ },
+ {
+ "name": "test-17",
+ "keyA": "0x5f6e300343975539ba132a6bf26c2b3fa827ee558bb6698c86bbc84ea8a71577",
+ "keyB": "0xc015b1dddc249815a81d9c7f54f4676b10a3ec321d9d0ddd35b800557fed6431",
+ "shared": "0x0476371203edee28e291a2b0fabccdf1018c395b090a8ffff2feec116d3cd103e6d3fa1ea02ddecdbd392dc076ea959c318abf2d69c06e35a92e4f09249d4d73b6"
+ },
+ {
+ "name": "test-18",
+ "keyA": "0x3f4f0a728833e864f96e202060239743ceb1150cc75094195e6bd4f53e7bf62a",
+ "keyB": "0x5a7b89392da6f39464967d315ecfbe8822b75062d68f3a43cc2a928a6abf2993",
+ "shared": "0x04959db3cb80d503579bc587399d09b043778c66115d1354ce449e060d3599bf2faa4adcf7da0419aa0af732ab5b82fe3ed68e5e5860dd2f6610f3f4f2ca7351eb"
+ },
+ {
+ "name": "test-19",
+ "keyA": "0xc3106be0925e0d69703e4ea6d3dbee7903a8b8bb293ae59b2f90b0efdb0b3a1a",
+ "keyB": "0x44cf9575f03af5afc03c36f62433ebd52579d894c759cab76d29a4b9d0bae083",
+ "shared": "0x04a980b037da455ec856a7e3a9f63e8b9daf73f8e1e929f3f10e2c4b603b5bca48264c057ce04a25f5f48d87d27a43f7192aaac3340d7d5972e2ad3efc5de20c13"
+ },
+ {
+ "name": "test-20",
+ "keyA": "0xb6c7bd2ba0d2b30d3e56d038398c2c937fb5cae348accdc060fb882903312008",
+ "keyB": "0x9ed8d5fb02fa0e825e7e095cfd32f9e817e8cd030c4363470f55d17e37cf73ef",
+ "shared": "0x042aa9b64ce873f5a3005a8eaee54e823f17633eec0a808ce0e24286f3c169485c2b7145f10deee39073056ce69c7d8bbbd2ff693b33b8749ae2b2f47e2e342397"
+ },
+ {
+ "name": "test-21",
+ "keyA": "0x9f44756603bca7e87e2dd718ef2323f12854056aae86dc9e31715f97c0b3dc12",
+ "keyB": "0xd1ae23664d6320f9989b031cd7357fe346e207ffe73ed51de7c485754b8f1578",
+ "shared": "0x04037ab94245dad8282b4fabfec79ae5ca26367db2f45a183eb4c0f0c9ab7bf0d2b33503981159468f660711fb956eb730675b1e34f1e7d0aca07b936b64c47d56"
+ },
+ {
+ "name": "test-22",
+ "keyA": "0x4c6307b149f1052290dc0140d6d597c25ddd23bc0ca826a9f44215009d13dad5",
+ "keyB": "0x9845254fdb40c7c74d0f9f3c6f73ce97a27f4306368685448b1f72dfbb3dd5d9",
+ "shared": "0x04f0ea5528a2efa16d424dbc07d49d3d2943e842289c6472f1cdeded965438326af76bb47449b417ef3b82130096f3c019d0ae3ffc3c9631f065a3285ba8539bfd"
+ },
+ {
+ "name": "test-23",
+ "keyA": "0xab6ac9d67466cae30d31584104970e1093ebda6690dc9bf7bea1f66f07ddfcb7",
+ "keyB": "0xc0f58e549e7984e780cbc307b2a6b4c4863302474d271637586fa7cc0e389df8",
+ "shared": "0x045d5fd0d76d168b746462231a5bfb07fc175f43b206622781614e3df3491ba4c3738c4d3ae2d7f18ab0570c86aeb139778219fcc57cac3d42726de0f38d31b52a"
+ },
+ {
+ "name": "test-24",
+ "keyA": "0x5b0e950974450f38dba31e01379814f0ed1b0f983cfda62dfecff5cd3e8db391",
+ "keyB": "0x4739f9e168dee9af2c8a9107b18738c9e3335115af8a431810ecce5269fba577",
+ "shared": "0x04da8ab5cf841804f0b5845f36e46e3463dfa3d6d9e7a306962062b729c680b2e8fdbf2b3eb2bdcc90d2884b9217dbdb3ad3620cd844982f19920e5d4f59353504"
+ },
+ {
+ "name": "test-25",
+ "keyA": "0x9f3583cffcbe992d4a537defb5d8479c2bfa96a39a3f33fcf40123854bc96ea4",
+ "keyB": "0x42fe9367ef668babd70d4f5e836627cc78990b8a1738a56adf23baebf9410b48",
+ "shared": "0x0414edfdae5d2db370a51b5cf45ee6049621f52dd15eb5136c795ed364221c0a5c0f32e9ebbc9211b121ccc06516756e9280b210abe5b1a8f6c658dc69c39341f5"
+ },
+ {
+ "name": "test-26",
+ "keyA": "0x289406a24a7794b04469a4acf9846e905ed4cae37349101db835f90e25d09605",
+ "keyB": "0xb2d58cdc470106c12f538b4516559d8ecaad0bcae063848a44f8639168453b93",
+ "shared": "0x04a9a80e466ea54aa0651eccde081e47637d2c142e1aaaf42572ee0753a49f7667c94b99f5bc2bf632b1330e3ffef95d009560e61084cbc07aab020282af5721f9"
+ },
+ {
+ "name": "test-27",
+ "keyA": "0xd9bcf36ef585f59e1570904784f0a3df6435c798bec7e1c406e922d51f98b510",
+ "keyB": "0x40244928c9d371a427a0ce96530120deee3d31af086db679ee6bd8c1a7773030",
+ "shared": "0x04ac55594d87dfdd8af303c5f92745d49fba6ff15afb628212bc5d432d97bbd909938873c298fb93c851d901bf178e14ef1d590ff0dca7f7ead5613e97e3a824db"
+ },
+ {
+ "name": "test-28",
+ "keyA": "0x301b79d85431a2c8bc21236cc58e1221eeb0862d3e3cfb29534423e6992e7591",
+ "keyB": "0xe6a62f0c49971b7b11477fc964d777de92267ab09f1465520ca31edcd7abaffe",
+ "shared": "0x049b7326b33eacc5ee3c102cae791d1835219253b70596f6a36892f2bb35fda1aebd661c781ac38b2461ac67b80ea1c18cd0230d024712a4e1826a6c5463874b0f"
+ },
+ {
+ "name": "test-29",
+ "keyA": "0x49542517ff2bd70e851405cf285cf2280f84af838e2b0a68ed779f96d0ce62eb",
+ "keyB": "0x48ffc78034851d2f4e610bc11b97c21d42f5d7bbada2415ee8f03f6b643c92b7",
+ "shared": "0x04dc12a233b08ff25ee7806cfede3565dedd663e0cd25108ad233b6c5c8f8c25fe82d4b2820fa44e0ef86d51d0eada0033854a1199644204f9233887e457775bb0"
+ },
+ {
+ "name": "test-30",
+ "keyA": "0x6597a9b39b58bd47561fd4058894ee327368fdd8b8b267efa0596793c3852ed8",
+ "keyB": "0xbcab19f22f0cca9fc791f998a5717bc4c81853ff4f1c974a7dde7ecef41b4802",
+ "shared": "0x043d622a7f3255437c9f6459e68d5e3333d377b76ac053a50affbdf88c555508c42000b092dbb07b72ecf5887766ebb2e47afdb3d8324b7938d9255171d971b1a8"
+ },
+ {
+ "name": "test-31",
+ "keyA": "0x4127797885e7b8b7c882fec5cf38be273f42de47261e8ea4aab49769d606dd01",
+ "keyB": "0xc82a9b18f2f060adaf4f7cf56f29a2f4859d12a452b8b9f079f8850423fba666",
+ "shared": "0x045e7b62ced9cebd94d2115b11f2e9ca6f9a66119a17296613a60439d2960747f927c305822fe15582bb62f48c574aa7c89e7b2c8e5d4affc86f097e794bdf029d"
+ },
+ {
+ "name": "test-32",
+ "keyA": "0xf5ffbd9bf88dd867ace131df25fc9bd9ab87b7834d91786f110f40eb2e7b73b2",
+ "keyB": "0x203fe0bd83081d65fe45f194c373dd84c61fcdcfd4783d18e0e060f56efde038",
+ "shared": "0x04cddff70996f116a874442da0a33ac3df0e99f063bd1066644e6ca88442bda15d5b46fe8c6de7467a13c65febf4a6d258ffae99784c21fa61fa8a3b384b666154"
+ },
+ {
+ "name": "test-33",
+ "keyA": "0x5073d19c09be03d0c41cef0b950e13b85ee87c4c1642061addbdfd34c3258618",
+ "keyB": "0x37cf3617c1728e613c738c9b61fc84b76490128b3a584a861862416b1bb5ca60",
+ "shared": "0x046234004e627b076d7bb6b6aedae341ab755f5f3dbca295fb2a70ae3206f26543c8f031605764e7dfb377a12c0be3a61df6983707ba62955487cc36ba8e8c0812"
+ },
+ {
+ "name": "test-34",
+ "keyA": "0x0378dd63bb9f1fd4b0b7c266239ca574c7f6f7ca62645b3e9edcf763918eb110",
+ "keyB": "0xfd144b5e82bb6dbbcc9e9b714d64e283b748e85ba93b0113727fc1670251c6dc",
+ "shared": "0x0481f04971c2282e9850ee373aba6ec92390e3ff12b95d86d339dfce7dfa592f012ef71875aba27adec232a90f209f420c6e7c73fd40f165ba9b6196a10ca5e82b"
+ },
+ {
+ "name": "test-35",
+ "keyA": "0xfa99235e06ec83c103ab50653ff5af505b085892781a6e743c7398219562ffe4",
+ "keyB": "0x6a8850083fdf6ecb9f9bdb613f1c6706fe233e2e74fad460f7c650751bf999e9",
+ "shared": "0x0407117676960073ab08890efd07eb6222584b2c8ad9a1eb64f9e610138c10a4d59f4ca496910ac35a1fad24e56fc08020ffac2dfabb2d79bbcc041e70dffb203c"
+ },
+ {
+ "name": "test-36",
+ "keyA": "0x3abcf36699a174e462196891e49e72759f707d7f82ae5e64a49f1273927802ae",
+ "keyB": "0x44212cd650066f2371908cc6ba520061745db823c64b8b99dae535e364fe7034",
+ "shared": "0x04c354916600479cbbf9d91f5b851ee075f0aac99befa434f3f3b30fa887a0a7af71129ea47b388ac41538a71f9e52f68473ccc2611ace7cdd999ee036bc43b459"
+ },
+ {
+ "name": "test-37",
+ "keyA": "0x858512678a61f3d286fd1a90cb8fb8960d8cffaa31686706d0a879d66acabc7f",
+ "keyB": "0x490e29655cb5da0dcd2f60e4583cb41b7ad9a801fbc00a2927968f06b0c14852",
+ "shared": "0x040dde94c952ec15bcba15d773ba0dfa9cb5ed7731cda1b7f8110fa91f843173f83d577f601b61f2df21b9f7cbf2b1d54792a6f9403c2446a480af7b69e23b8d21"
+ },
+ {
+ "name": "test-38",
+ "keyA": "0xaeb4d6c2a817e5882f991f0c3c81d0f6f2d3d8854d472511a211cae67adae695",
+ "keyB": "0x72c297384a02544ba9719c0ce1f0ad3cb4e89b57536880f65c0462d1f058a55f",
+ "shared": "0x041a61bd828eacb1aaacbbb3b0291d691f5fc1462f16fc55f828b1f28e73342957de6b718501e66c3a1885ce16e124adb600457095ba770f58be012d0b69ca949a"
+ },
+ {
+ "name": "test-39",
+ "keyA": "0xb0fc529ff1bb4a7985663d54b279cbf4a597ec922a810ca16b87697ef3ef0dd3",
+ "keyB": "0xaf6019921bc7db54c334102a766d32d3ff06fd68ed08efe8ca2a35ce5074dcd0",
+ "shared": "0x04b49b24610350fde84bf067affc1d9f7ac549b3c4c05fa963aade41e65d6645cf867466f6c87e11298cb433f45f65eec4c5d88e76acdd5515a92802ded42c6e0a"
+ },
+ {
+ "name": "test-40",
+ "keyA": "0x160fdb84df11195fb0d33335e593499c3505cadce25ffdf6cdd8af0cb78d400c",
+ "keyB": "0xb37568a52ead1debcb2d402fa3d58f212a37321aae2cea1b90b263a3276bfdce",
+ "shared": "0x04091c2e14e517d9990425bb5d0a9e48f3bfe27a1cb673182fe1f7dc27bd6a56043a7745c9d27052e60ce72a1d82357f6675fadf9994add784c45821f52f2b094e"
+ },
+ {
+ "name": "test-41",
+ "keyA": "0x253ca7443d94998bab1f508e3424c662831c6be6ec5d387e97c79f078087ff15",
+ "keyB": "0x38102245618fddf8a1bd7de152c6fa630523223b89a1649d5f2fa5f9e47ffe4a",
+ "shared": "0x04046754be94d9ad925f67b1bc80fe32cd6920f9f80327cdc83f68e95d999b1d8ab7b41844db1c1ea66662b42737169daefc675c9364583565e3982b674d8a30dd"
+ },
+ {
+ "name": "test-42",
+ "keyA": "0xef558874b5b1d5915c83e3c1e4554d73de1e9943af445eba3f6516b731cc0126",
+ "keyB": "0x956e32c2e87263215b8c31c7f2e7311d6acad863f3c428b0625c9376cbc405cd",
+ "shared": "0x047e9265334e20ad8747098147b0eabb6d01c8ab12722cf0bbede05c1beaa67e8e770e04e19cf6035f48289fbe85cd4b9496a9ca5a90d088f8e75a0c1c6c7f1cc8"
+ },
+ {
+ "name": "test-43",
+ "keyA": "0x32c00e0d3a2ba3db6685058e1327dcee6425068190890439391fdb95857f27b0",
+ "keyB": "0x8b39021f7ad57a101534977d323c0349cecc8405d93286c6e71a441f4cc16c86",
+ "shared": "0x04c8095c862e64f6866fd3c177ed898fa3ca5da2d585c60ea4646d8f2cb9f332dbd54ca9d3b2a9e852a15189a0eb97a8edfaa114a01277418aa2ecfdfb3770caa0"
+ },
+ {
+ "name": "test-44",
+ "keyA": "0x40627c6987e20c07014833e23a0b9304bbaf66525a59b892e224944b56d3117a",
+ "keyB": "0xe23607bff98d5699816836f65e5405f2e60d4fe2449979acd43ee2b3e9bfc218",
+ "shared": "0x04be3ec3c188e7c74944d42beddf19003aeb0ccf8cccf8532b220dc666520f277e8b98b87ee694e8c76256e51ebf69433479c69a4ccef3032e9cb550632db539f8"
+ },
+ {
+ "name": "test-45",
+ "keyA": "0x46c25bcd7d2f8ce6d27148a11f18e0314046260433f8cc6421be4dcd72a6e088",
+ "keyB": "0xf29022ca90a60d455d0b1470034d1c7fbba27a9997b1940a9373a97d092f965e",
+ "shared": "0x041f5fd1dd02afa8ce5d2877a05ce92a4db5aef022a8203551590343352c1bd6e71cad811974a74f49d140949aa091dc4262cf7da0b48bdfa26939cf4b9c461f52"
+ },
+ {
+ "name": "test-46",
+ "keyA": "0x6d6b69d4f9fafd986e5b1a9c36f3021aae9ce64c027f1bf9bd9e9e12d86a276b",
+ "keyB": "0xeed0cabb4ae5a696e762c98e6d697bd88a89d9a0b38458c6e696f0748e404fe6",
+ "shared": "0x04f2f9c8fa945577d7188292f5c4a4fad80bdcc3db44d6d5c15bda5a23971ac7046cb8af44bb5864a9e0e82c921805663c539a22f8c5ef22187062564f1359f4d2"
+ },
+ {
+ "name": "test-47",
+ "keyA": "0xf6b6d733b8c473a562f7a23c7cbb23f40273d809d13aeb308149ad709c674300",
+ "keyB": "0xd873a7d24c1f498a43c181f566f265cda248f9e2df8a825e69a73aeb1437dad9",
+ "shared": "0x0495f669c1c7271be4c8e628017ef570a0cb903887c3ea4897f09cc9ecd2a4f6b043e1fa41d1ddbf8f01e60368bc95e81ae2a8bf4922374294b0836ff7e43ad2ab"
+ },
+ {
+ "name": "test-48",
+ "keyA": "0x28410a640558a5da5b7746a46a9cdefc704ba2944f23699d3767f6505a97eb78",
+ "keyB": "0xfd1a548275be4d922cc294276d7b059cea0fbbcb629be29bb8072de597a96597",
+ "shared": "0x04fca25ec051c8532f664fe2c2e213d1bd3e298422232dd34e821245256e0bff4ff80fb1f03524fd57d1d4a6effc076899cc21dde0be10d60016c20c33b7524d00"
+ },
+ {
+ "name": "test-49",
+ "keyA": "0x89e51abd416ad4579d523bed183da74b991c589decb982649a0abedfe6061c0f",
+ "keyB": "0x22b4cad2ade397b86756c2457516cd23d0858700b0597fdb2433e891efa435e3",
+ "shared": "0x049316e68898db5d7c987fbfa371b1fbd6a56d585bde1017a825d1dfaad406b428a505e773e63ddd0244b0e25ddc1b08dda6dd9968673f7b10c40d8fe8a1e1d55f"
+ },
+ {
+ "name": "test-50",
+ "keyA": "0x2c645e1abac8e5848617067e6c3d739a6f126484d27f73bc8fdfdc9f0ac3ff04",
+ "keyB": "0x71252585fb806d9273c0103dcf642b419e7632ef3aeba3efc6c71863b50ae177",
+ "shared": "0x04886ec11347e30fc5e68a353201d702c4425358791ea6a6213c444c7489e38103c953fe13f4238dbe769f0d6208f693e356f81e7037977cf8a5b04661e37d2569"
+ },
+ {
+ "name": "test-51",
+ "keyA": "0x572a1ce3adfc10ca3afc39262d36c329ba44d7cfa6ca5c62d2e882ac25480d47",
+ "keyB": "0x2b9081d499417315277663c86e25dd7898ea67e969b632dd11e80d29e92b557f",
+ "shared": "0x0424c5ae82f447c156d97ed31c83f36cf3416cb4a72666bb4e8a61687a4ba4ae22b42f7d18579ff204f7974af9f8dcc51d8f9eabc45c720f607478ba78c2b2921c"
+ },
+ {
+ "name": "test-52",
+ "keyA": "0x60ba350fb7e0729ad992f53a314eacce65da6897856e362d2ef0959e890b9e99",
+ "keyB": "0x6a9629c655cf4f8b8816e95df1c14f769cb946431c6da17a04423ceef8979ee1",
+ "shared": "0x04831e236ece1bde7db14b819c06e0a17964b88b5fc4e8253a8dc316d613fad8ffdb5117eb920f34ce838d6861caa0e885e3c20d37cfd20e19d1092d52976e0f91"
+ },
+ {
+ "name": "test-53",
+ "keyA": "0x32eb6769ade64560a016e080f5e16ea97b2d0cb96b730e9c5c809bfd19a002c4",
+ "keyB": "0x7dff2eb8455b0e9c0fd38838db3d3de96067a6efc05d21d1bb303ca0bd52d87d",
+ "shared": "0x04b0cf54b0590546e434a5e3d2071c3c022d4b3b571660b359cee7d199e525965e9f38d12436affda7741d5b752e0b430149a1ec6d7835a6999e64b3ea324e91c6"
+ },
+ {
+ "name": "test-54",
+ "keyA": "0x70446e5ede6e26b96d3cecfe8afc35055a0a90f83c7db4d1b8a819d5cddb6642",
+ "keyB": "0x2df217bf6e92875e35af50bfa301059b2ddf593c0694b70116a8c87ee27ef4c9",
+ "shared": "0x0458e1554b06a40b9508d86d5cedeb3dccb82053881393306b1894d198412500dc0efa4dad2265d7532e59d06f71cf33f3d48728b4707434a5c722eea8d9a9acbc"
+ },
+ {
+ "name": "test-55",
+ "keyA": "0x64e16f672ec5aba6be5a4965d44bd7224aae65d444ceee6dd58690e527b36186",
+ "keyB": "0xefb054ff4222e8e493cb667f56129dc1b6a3437581280a3f984ff0ea09ec3029",
+ "shared": "0x04c806576fb79b4d7d38d00a3ee2c2896dfb1b29ef3a42ac72a82c7bf7626f2073a79aec8ee2c3c101845ce5171b27a9f23075ed74ccdae088956e3dcdbae74e7d"
+ },
+ {
+ "name": "test-56",
+ "keyA": "0x284a5592ab3fa9b8df2bf927761a667118697cd7413c255ef3cce9e9de76c321",
+ "keyB": "0x52d0033d83fbdeb0b7c8d21b475ec637fabfcc7c2593494d7e846ecd974083af",
+ "shared": "0x04e092613c7552c3180bdb041c32b9763804e6703c2c116009f1012526002472b5b627a85cb50c90942fe177bd36e2d4fbd8e9d835c72a607ee07ffead29cf12eb"
+ },
+ {
+ "name": "test-57",
+ "keyA": "0x488e6c2d97fe0ff3f5357254658ae487ade54bdf7bf871ffdfe27079cbeff103",
+ "keyB": "0x00f8632a6982d58c25236ce1952c19052f6b08edad61edd166570a8679a98f5c",
+ "shared": "0x048f02436bb55798561a6a78aacbeec67f0acd8ba88e99af6ec1b7b5152d9a5d7691a905c11fe26c2ba3d72be918f6ee7c3e66115a31a7f199f33073f6f5087181"
+ },
+ {
+ "name": "test-58",
+ "keyA": "0x0067fd2eec16c7ddf9a364f591d47394bfc12fd2b3ccff1bf1013e92e969f6f0",
+ "keyB": "0x76f1e3f4abfb237ec3ac6e72a56f25bfa06e7561bc5fdc4823282f9db40c49d4",
+ "shared": "0x04975e88ffcd670b06e7752d3d375613d0cd614f2b3a812e684342dcc16be6de336af2bb30ab25da0362ecf43752b477b412081d723f5c6840ea78deacd5f76b4a"
+ },
+ {
+ "name": "test-59",
+ "keyA": "0x4ff02743564c317a3578c08f7961a204d48e511e31688ba069037f6090235b37",
+ "keyB": "0xcf22489e1b9058b4a645e38504eaa32e031dea44e1465eb1122e14e4847c9744",
+ "shared": "0x04e584b571a9f99087bc6cb7818741cfc3b630ec412f64da1ada72de17279afa60258c5844cc2c7c1416548497b083f2aeb035c8945c0aa03a25b97bad7870c136"
+ },
+ {
+ "name": "test-60",
+ "keyA": "0xd140deee768594cea37e2eb5c89c60228083f93866ebd62c7c07a1a9f8a9bf58",
+ "keyB": "0xc9f2edf7ccd6db9f21ef5a3966ee11694dec652d60ef21a540802db8b990c370",
+ "shared": "0x0451b4a54b1fcdcbe4f5b97b3003bce3cc91f362cf2baa696ad0abca3cd21b12d4e4f3d1b0dc1c18599917f5fc9be7825d23999769d3811edf61a7ecc34525b403"
+ },
+ {
+ "name": "test-61",
+ "keyA": "0x63dcf1d3db0d89a37df3734e88f601412a184030f15474a0d9687e3105361161",
+ "keyB": "0x5370bec049bcd28507f4078783d9378cd84b8e05230089e8987d3a485c945b08",
+ "shared": "0x04e27e5ec5eb72fa6bda376f832b4730d6f7b9104594fa191ac87198f0d4aeed47c79568cf8f59fae0e43e8bf0931c491eda0cce1f19efc4153aacde94e673ba7f"
+ },
+ {
+ "name": "test-62",
+ "keyA": "0x465d0d758d8c7664d9e1bfa46fb5fb8e27265cb4bc28c0f7752d596910545028",
+ "keyB": "0xeff55416a21e627ec4c55a08c9a3f7378ae2953fd5bf0926bde15965cf6b4d5d",
+ "shared": "0x0487b20dbad3b5443594fc66470559206c37440a01ef91c24c38a51bc7bcf7676409789c6bc214087947ab8d0359927080422b2ecbd23e765bf6a79e4bbb456796"
+ },
+ {
+ "name": "test-63",
+ "keyA": "0x28469aab3ebc9efdec35b19e7c42a26311c649267ac92ae2ef2f5c8880eb517c",
+ "keyB": "0x786e828e92abb73818380b37395c67dcb6a72f3e0a440bdf1f5f132a0621fc78",
+ "shared": "0x046bfff91c9b31abb6df020018b66734c7f9fc4f7294c809c706b76c308982e5d75c10200fbdf67d75ba4b154223f591bfe3504006ba69634d4025c57b9af4ab73"
+ }
+ ];
+ for (const { name, keyA, keyB, shared } of tests) {
+ it(`tests shared secrets match: ${name}`, function () {
+ const signA = new index_js_2.SigningKey(keyA);
+ const signB = new index_js_2.SigningKey(keyB);
+ assert_1.default.equal(signA.computeSharedSecret(signB.publicKey), shared, "privA + pubB");
+ assert_1.default.equal(signB.computeSharedSecret(signA.publicKey), shared, "pubA + privB");
+ assert_1.default.equal(signA.computeSharedSecret(signB.privateKey), shared, "privA + privB");
+ });
+ }
+});
+//# sourceMappingURL=test-crypto.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-crypto.js.map b/dist/ethers.js/src.ts/_tests/test-crypto.js.map
new file mode 100644
index 0000000..1850444
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-crypto.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-crypto.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-crypto.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,oDAA4B;AAE5B,yCAAuC;AAEvC,0CAAuC;AAIvC,0CAKqB;AAGrB,QAAQ,CAAC,cAAc,EAAE;IACrB,MAAM,KAAK,GAAG,IAAA,oBAAS,EAAe,QAAQ,CAAC,CAAC;IAEhD,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACnB,EAAE,CAAC,sBAAuB,IAAI,CAAC,IAAK,EAAE,EAAE;YACpC,gBAAM,CAAC,KAAK,CAAC,IAAA,iBAAM,EAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACjD,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACnB,EAAE,CAAC,sBAAuB,IAAI,CAAC,IAAK,EAAE,EAAE;YACpC,gBAAM,CAAC,KAAK,CAAC,IAAA,iBAAM,EAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACjD,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACnB,EAAE,CAAC,uBAAwB,IAAI,CAAC,IAAK,EAAE,EAAE;YACrC,gBAAM,CAAC,KAAK,CAAC,IAAA,oBAAS,EAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QACvD,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;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,CAAC,CAAC;YAEnC,gBAAM,CAAC,KAAK,CAAC,KAAK,CAAC,mBAAmB,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,cAAc,CAAC,CAAC;YACjF,gBAAM,CAAC,KAAK,CAAC,KAAK,CAAC,mBAAmB,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,cAAc,CAAC,CAAC;YACjF,gBAAM,CAAC,KAAK,CAAC,KAAK,CAAC,mBAAmB,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,eAAe,CAAC,CAAC;QACvF,CAAC,CAAC,CAAC;KACN;AACL,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-hash-typeddata.d.ts b/dist/ethers.js/src.ts/_tests/test-hash-typeddata.d.ts
new file mode 100644
index 0000000..ff78269
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-hash-typeddata.d.ts
@@ -0,0 +1,2 @@
+export {};
+//# sourceMappingURL=test-hash-typeddata.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-hash-typeddata.d.ts.map b/dist/ethers.js/src.ts/_tests/test-hash-typeddata.d.ts.map
new file mode 100644
index 0000000..d98e0de
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-hash-typeddata.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-hash-typeddata.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-hash-typeddata.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-hash-typeddata.js b/dist/ethers.js/src.ts/_tests/test-hash-typeddata.js
new file mode 100644
index 0000000..575d578
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-hash-typeddata.js
@@ -0,0 +1,21 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const assert_1 = __importDefault(require("assert"));
+const utils_js_1 = require("./utils.js");
+const index_js_1 = require("../index.js");
+describe("Tests Typed Data (EIP-712)", function () {
+ const tests = (0, utils_js_1.loadTests)("typed-data");
+ for (const test of tests) {
+ it(`tests encoding typed-data: ${test.name}`, function () {
+ const encoder = index_js_1.TypedDataEncoder.from(test.types);
+ assert_1.default.equal(encoder.primaryType, test.primaryType, "primaryType");
+ assert_1.default.equal(encoder.encode(test.data), test.encoded, "encoded");
+ assert_1.default.equal(index_js_1.TypedDataEncoder.getPrimaryType(test.types), test.primaryType, "primaryType");
+ assert_1.default.equal(index_js_1.TypedDataEncoder.hash(test.domain, test.types, test.data), test.digest, "digest");
+ });
+ }
+});
+//# sourceMappingURL=test-hash-typeddata.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-hash-typeddata.js.map b/dist/ethers.js/src.ts/_tests/test-hash-typeddata.js.map
new file mode 100644
index 0000000..c319707
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-hash-typeddata.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-hash-typeddata.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-hash-typeddata.ts"],"names":[],"mappings":";;;;;AAAA,oDAA4B;AAC5B,yCAAuC;AAGvC,0CAA+C;AAG/C,QAAQ,CAAC,4BAA4B,EAAE;IACnC,MAAM,KAAK,GAAG,IAAA,oBAAS,EAAoB,YAAY,CAAC,CAAC;IACzD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACtB,EAAE,CAAC,8BAA+B,IAAI,CAAC,IAAK,EAAE,EAAE;YAC5C,MAAM,OAAO,GAAG,2BAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAClD,gBAAM,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;YACnE,gBAAM,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;YAEjE,gBAAM,CAAC,KAAK,CAAC,2BAAgB,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;YAC3F,gBAAM,CAAC,KAAK,CAAC,2BAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QACnG,CAAC,CAAC,CAAC;KACN;AACL,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-hash.d.ts b/dist/ethers.js/src.ts/_tests/test-hash.d.ts
new file mode 100644
index 0000000..ca5de7a
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-hash.d.ts
@@ -0,0 +1,2 @@
+export {};
+//# sourceMappingURL=test-hash.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-hash.d.ts.map b/dist/ethers.js/src.ts/_tests/test-hash.d.ts.map
new file mode 100644
index 0000000..0aa5c54
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-hash.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-hash.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-hash.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-hash.js b/dist/ethers.js/src.ts/_tests/test-hash.js
new file mode 100644
index 0000000..2d24383
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-hash.js
@@ -0,0 +1,182 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const assert_1 = __importDefault(require("assert"));
+const index_js_1 = require("../index.js");
+const utils_js_1 = require("./utils.js");
+//import { dnsEncode, isValidName, namehash } from "../index.js";
+describe("Tests Namehash", function () {
+ const tests = (0, utils_js_1.loadTests)("namehash");
+ for (const test of tests) {
+ if (!test.error) {
+ it(`hashes ENS name: ${JSON.stringify(test.name)}`, function () {
+ const actual = (0, index_js_1.namehash)(test.ensName);
+ assert_1.default.equal(actual, test.namehash, "namehash");
+ // The empty string is not a valid ENS name
+ if (test.ensName) {
+ assert_1.default.ok((0, index_js_1.isValidName)(test.ensName), "isValidName");
+ }
+ });
+ }
+ }
+ for (const test of tests) {
+ if (test.error) {
+ it(`correctly fails to hash ENS name: ${test.error} ${JSON.stringify(test.name)}`, function () {
+ assert_1.default.throws(function () {
+ const actual = (0, index_js_1.namehash)(test.ensName);
+ console.log("Failed to throw", actual);
+ }, (error) => {
+ return ((0, index_js_1.isError)(error, "INVALID_ARGUMENT") &&
+ error.argument === "name" && error.value === test.ensName);
+ });
+ // The empty string is not a valid ENS name
+ if (test.ensName) {
+ assert_1.default.ok(!(0, index_js_1.isValidName)(test.ensName), "!isValidName");
+ }
+ });
+ }
+ }
+});
+/*
+describe("Tests Bad ENS Names", function() {
+ const badTests: Array<{ ensName: any, prefix: string }> = [
+ { ensName: ".", prefix: "missing component" },
+ { ensName:"..", prefix: "missing component" },
+ { ensName:"ricmoo..eth", prefix: "missing component" },
+ { ensName:"ricmoo...eth", prefix: "missing component" },
+ { ensName:".foo", prefix: "missing component" },
+ { ensName:"foo.", prefix: "missing component" },
+ { ensName: 1234, prefix: "not a string" },
+ { ensName: true, prefix: "not a string" },
+ ];
+
+ // The empty string is not a valid name, but has a valid namehash
+ // (the zero hash) as it is the base case for recursion
+ it("empty ENS name", function() {
+ assert.ok(!isValidName(""), "!isValidName");
+ });
+
+ for (const { ensName, prefix } of badTests) {
+ it(`fails on bad ENS name: ${ JSON.stringify(ensName) }`, function() {
+ assert.ok(!isValidName(ensName), "!isValidName");
+ assert.throws(() => {
+ const result = namehash(ensName);
+ console.log(result);
+ }, (error) => {
+ const errorPrefix = `invalid ENS name; ${ prefix }`;
+ return (error.code === "INVALID_ARGUMENT" &&
+ error.argument === "name" && error.value === ensName &&
+ error.message.substring(0, errorPrefix.length) === errorPrefix);
+ });
+ });
+ }
+});
+
+describe("Tests DNS Encoding", function() {
+ const tests: Array<{ ensName: string, dnsEncoded: string}> = [
+ { ensName: "", dnsEncoded: "0x00" },
+ { ensName: "ricmoo.eth", dnsEncoded: "0x067269636d6f6f0365746800" },
+ ];
+
+ for (const { ensName, dnsEncoded } of tests) {
+ it(`computes the DNS Encoding: ${ JSON.stringify(ensName) }`, function() {
+ assert.equal(dnsEncode(ensName), dnsEncoded, "dnsEncoded");
+ });
+ }
+});
+
+describe("Tests DNS Names", function() {
+ const badTests: Array<{ ensName: any, prefix: string}> = [
+ { ensName: ".", prefix: "invalid DNS name; missing component" },
+ { ensName: "foo..bar", prefix: "invalid DNS name; missing component" },
+ { ensName: ".foo", prefix: "invalid DNS name; missing component" },
+ { ensName: "foo.", prefix: "invalid DNS name; missing component" },
+ { ensName: 1234, prefix: "invalid DNS name; not a string" },
+ { ensName: true, prefix: "invalid DNS name; not a string" },
+ ];
+
+ for (const { ensName, prefix } of badTests) {
+ it(`fails on bad DNS name: ${ JSON.stringify(ensName) }`, function() {
+ assert.throws(() => {
+ const result = dnsEncode(ensName);
+ console.log(result);
+ }, (error) => {
+ return (error.code === "INVALID_ARGUMENT" &&
+ error.argument === "name" && error.value === ensName &&
+ error.message.substring(0, prefix.length) === prefix);
+ });
+ });
+ }
+
+ {
+ const ensName = "foobar012345678901234567890123456789012345678901234567890123456789";
+ const prefix = "too long";
+ it(`fails on bad DNS name: ${ JSON.stringify(ensName) }`, function() {
+ assert.throws(() => {
+ const result = dnsEncode(ensName);
+ console.log(result);
+ }, (error) => {
+ return (error.code === "INVALID_ARGUMENT" &&
+ error.argument === "value" && error.value === ensName &&
+ error.message.substring(0, prefix.length) === prefix);
+ });
+ });
+ }
+
+});
+*/
+describe("Test EIP-191 Personal Message Hash", function () {
+ const tests = [
+ {
+ test: "hello-world",
+ message: "Hello World",
+ hash: "0xa1de988600a42c4b4ab089b619297c17d53cffae5d5120d82d8a92d0bb3b78f2"
+ },
+ {
+ test: "binary-message",
+ message: new Uint8Array([0x42, 0x43]),
+ hash: "0x0d3abc18ec299cf9b42ba439ac6f7e3e6ec9f5c048943704e30fc2d9c7981438"
+ },
+ {
+ test: "hex-looking-string",
+ message: "0x4243",
+ hash: "0x6d91b221f765224b256762dcba32d62209cf78e9bebb0a1b758ca26c76db3af4"
+ }
+ ];
+ for (const test of tests) {
+ it(`tests hashMessage: ${test.test}`, function () {
+ assert_1.default.equal((0, index_js_1.hashMessage)(test.message), test.hash);
+ });
+ }
+});
+describe("Test Solidity Hash functions", function () {
+ const tests = (0, utils_js_1.loadTests)("solidity-hashes");
+ for (const test of tests) {
+ it(`computes the solidity keccak256: ${test.name}`, function () {
+ assert_1.default.equal((0, index_js_1.solidityPackedKeccak256)(test.types, test.values), test.keccak256);
+ });
+ }
+ for (const test of tests) {
+ it(`computes the solidity sha256: ${test.name}`, function () {
+ assert_1.default.equal((0, index_js_1.solidityPackedSha256)(test.types, test.values), test.sha256);
+ });
+ }
+ const badTypes = [
+ { types: ["uint5"], values: [1] },
+ { types: ["bytes0"], values: ["0x"] },
+ { types: ["blorb"], values: [false] },
+ ];
+ for (const { types, values } of badTypes) {
+ it("correctly fails on invalid type", function () {
+ assert_1.default.throws(function () {
+ const result = (0, index_js_1.solidityPacked)(types, values);
+ console.log(result);
+ }, function (error) {
+ return ((0, index_js_1.isError)(error, "INVALID_ARGUMENT") && error.argument === "type");
+ });
+ });
+ }
+});
+//# sourceMappingURL=test-hash.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-hash.js.map b/dist/ethers.js/src.ts/_tests/test-hash.js.map
new file mode 100644
index 0000000..3648cf5
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-hash.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-hash.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-hash.ts"],"names":[],"mappings":";;;;;AAAA,oDAA4B;AAE5B,0CAKqB;AAErB,yCAAsC;AAKtC,iEAAiE;AAEjE,QAAQ,CAAC,gBAAgB,EAAE;IACvB,MAAM,KAAK,GAAG,IAAA,oBAAS,EAAmB,UAAU,CAAC,CAAC;IAEtD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACtB,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;YACb,EAAE,CAAC,oBAAqB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAE,EAAE,EAAE;gBAClD,MAAM,MAAM,GAAG,IAAA,mBAAQ,EAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBAEtC,gBAAM,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;gBAEhD,2CAA2C;gBAC3C,IAAI,IAAI,CAAC,OAAO,EAAE;oBACd,gBAAM,CAAC,EAAE,CAAC,IAAA,sBAAW,EAAC,IAAI,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC,CAAC;iBACvD;YACL,CAAC,CAAC,CAAC;SACN;KACJ;IAED,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACtB,IAAI,IAAI,CAAC,KAAK,EAAE;YACZ,EAAE,CAAC,qCAAsC,IAAI,CAAC,KAAM,IAAK,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAE,EAAE,EAAE;gBACnF,gBAAM,CAAC,MAAM,CAAC;oBACV,MAAM,MAAM,GAAG,IAAA,mBAAQ,EAAC,IAAI,CAAC,OAAO,CAAC,CAAC;oBACtC,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC;gBAC3C,CAAC,EAAE,CAAC,KAAK,EA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,QAAQ,KAAK,MAAM,CAAC,CAAC;YAC7E,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;KACN;AACL,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-providers-avatar.d.ts b/dist/ethers.js/src.ts/_tests/test-providers-avatar.d.ts
new file mode 100644
index 0000000..437efc5
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-providers-avatar.d.ts
@@ -0,0 +1,2 @@
+export {};
+//# sourceMappingURL=test-providers-avatar.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-providers-avatar.d.ts.map b/dist/ethers.js/src.ts/_tests/test-providers-avatar.d.ts.map
new file mode 100644
index 0000000..467ce3f
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-providers-avatar.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-providers-avatar.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-providers-avatar.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-providers-avatar.js b/dist/ethers.js/src.ts/_tests/test-providers-avatar.js
new file mode 100644
index 0000000..0fd1ebc
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-providers-avatar.js
@@ -0,0 +1,48 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const assert_1 = __importDefault(require("assert"));
+const create_provider_js_1 = require("./create-provider.js");
+(0, create_provider_js_1.setupProviders)();
+describe("Resolve ENS avatar", function () {
+ [
+ { title: "data", name: "data-avatar.tests.ethers.eth", value: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAMAAACeL25MAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyVpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDYuMC1jMDAyIDc5LjE2NDQ4OCwgMjAyMC8wNy8xMC0yMjowNjo1MyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIDIyLjAgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NUQ4NTEyNUIyOEIwMTFFQzg0NTBDNTU2RDk1NTA5NzgiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NUQ4NTEyNUMyOEIwMTFFQzg0NTBDNTU2RDk1NTA5NzgiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo1RDg1MTI1OTI4QjAxMUVDODQ1MEM1NTZEOTU1MDk3OCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo1RDg1MTI1QTI4QjAxMUVDODQ1MEM1NTZEOTU1MDk3OCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PkbM0uMAAAAGUExURQAA/wAAAHtivz4AAAAOSURBVHjaYmDABAABBgAAFAABaEkyYwAAAABJRU5ErkJggg==" },
+ { title: "ipfs", name: "ipfs-avatar.tests.ethers.eth", value: "https:/\/gateway.ipfs.io/ipfs/QmQsQgpda6JAYkFoeVcj5iPbwV3xRcvaiXv3bhp1VuYUqw" },
+ { title: "url", name: "url-avatar.tests.ethers.eth", value: "https:/\/ethers.org/static/logo.png" },
+ ].forEach((test) => {
+ it(`Resolves avatar for ${test.title}`, function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.timeout(60000);
+ const provider = (0, create_provider_js_1.connect)("goerli");
+ const avatar = yield provider.getAvatar(test.name);
+ assert_1.default.equal(test.value, avatar, "avatar url");
+ });
+ });
+ });
+ /*
+ // @TODO: Set up some examples on goerli
+ [
+ { title: "ERC-1155", name: "nick.eth", value: "https:/\/lh3.googleusercontent.com/hKHZTZSTmcznonu8I6xcVZio1IF76fq0XmcxnvUykC-FGuVJ75UPdLDlKJsfgVXH9wOSmkyHw0C39VAYtsGyxT7WNybjQ6s3fM3macE" },
+ // { title: "ERC-721", name: "brantly.eth", value: "https:/\/api.wrappedpunks.com/images/punks/2430.png" }
+ ].forEach((test) => {
+ it(`Resolves avatar for ${ test.title }`, async function() {
+ this.timeout(60000);
+ const provider = connect("mainnet");
+ const avatar = await provider.getAvatar(test.name);
+ assert.equal(avatar, test.value, "avatar url");
+ });
+ });
+ */
+});
+//# sourceMappingURL=test-providers-avatar.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-providers-avatar.js.map b/dist/ethers.js/src.ts/_tests/test-providers-avatar.js.map
new file mode 100644
index 0000000..d23f0c6
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-providers-avatar.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-providers-avatar.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-providers-avatar.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,oDAA4B;AAE5B,6DAA+D;AAE/D,IAAA,mCAAc,GAAE,CAAC;AAEjB,QAAQ,CAAC,oBAAoB,EAAE;IAC3B;QACI,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,8BAA8B,EAAE,KAAK,EAAE,owCAAowC,EAAE;QACp0C,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,8BAA8B,EAAE,KAAK,EAAE,8EAA8E,EAAE;QAC9I,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,6BAA6B,EAAE,KAAK,EAAE,qCAAqC,EAAE;KACtG,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACf,EAAE,CAAC,uBAAwB,IAAI,CAAC,KAAM,EAAE,EAAE;;gBACtC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;gBACpB,MAAM,QAAQ,GAAG,IAAA,4BAAO,EAAC,QAAQ,CAAC,CAAC;gBACnC,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACnD,gBAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;YACnD,CAAC;SAAA,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IACP;;;;;;;;;;;;;MAaE;AACF,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-providers-ccip.d.ts b/dist/ethers.js/src.ts/_tests/test-providers-ccip.d.ts
new file mode 100644
index 0000000..7fb8212
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-providers-ccip.d.ts
@@ -0,0 +1,2 @@
+export {};
+//# sourceMappingURL=test-providers-ccip.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-providers-ccip.d.ts.map b/dist/ethers.js/src.ts/_tests/test-providers-ccip.d.ts.map
new file mode 100644
index 0000000..28feb2d
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-providers-ccip.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-providers-ccip.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-providers-ccip.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-providers-ccip.js b/dist/ethers.js/src.ts/_tests/test-providers-ccip.js
new file mode 100644
index 0000000..fbe6dba
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-providers-ccip.js
@@ -0,0 +1,178 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const assert_1 = __importDefault(require("assert"));
+const index_js_1 = require("../index.js");
+const create_provider_js_1 = require("./create-provider.js");
+(0, create_provider_js_1.setupProviders)();
+describe("Test CCIP execution", function () {
+ // This matches the verify method in the Solidity contract against the
+ // processed data from the endpoint
+ const verify = function (sender, data, result) {
+ const check = (0, index_js_1.concat)([
+ (0, index_js_1.toBeArray)((0, index_js_1.dataLength)(sender)), sender,
+ (0, index_js_1.toBeArray)((0, index_js_1.dataLength)(data)), data
+ ]);
+ assert_1.default.equal(result, (0, index_js_1.keccak256)(check), "response is equal");
+ };
+ const address = "0x6C5ed35574a9b4d163f75bBf0595F7540D8FCc2d";
+ const calldata = "0x1234";
+ it("testGet passes under normal operation", function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.timeout(60000);
+ const provider = (0, create_provider_js_1.connect)("goerli");
+ // testGet(bytes callData = "0x1234")
+ const tx = {
+ to: address, enableCcipRead: true,
+ data: "0xa5f3271e000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000021234000000000000000000000000000000000000000000000000000000000000"
+ };
+ const result = yield provider.call(tx);
+ verify(address, calldata, result);
+ });
+ });
+ it("testGet should fail with CCIP not explicitly enabled by overrides", function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.timeout(60000);
+ const provider = (0, create_provider_js_1.connect)("goerli");
+ // testGet(bytes callData = "0x1234")
+ const tx = {
+ to: address,
+ data: "0xa5f3271e000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000021234000000000000000000000000000000000000000000000000000000000000"
+ };
+ yield assert_1.default.rejects(function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ const result = yield provider.call(tx);
+ console.log(result);
+ });
+ }, (error) => {
+ const offchainErrorData = "0x556f18300000000000000000000000006c5ed35574a9b4d163f75bbf0595f7540d8fcc2d00000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000140b1494be100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004068747470733a2f2f6574686572732e7269636d6f6f2e776f726b6572732e6465762f746573742d636369702d726561642f7b73656e6465727d2f7b646174617d00000000000000000000000000000000000000000000000000000000000000021234000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d4d79206578747261206461746100000000000000000000000000000000000000";
+ return ((0, index_js_1.isCallException)(error) && error.data === offchainErrorData);
+ });
+ });
+ });
+ it("testGet should fail with CCIP explicitly disabled on provider", function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.timeout(60000);
+ const provider = (0, create_provider_js_1.connect)("goerli");
+ provider.disableCcipRead = true;
+ // testGetFail(bytes callData = "0x1234")
+ const tx = {
+ to: address, enableCcipRead: true,
+ data: "0xa5f3271e000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000021234000000000000000000000000000000000000000000000000000000000000"
+ };
+ yield assert_1.default.rejects(function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ const result = yield provider.call(tx);
+ console.log(result);
+ });
+ }, (error) => {
+ const offchainErrorData = "0x556f18300000000000000000000000006c5ed35574a9b4d163f75bbf0595f7540d8fcc2d00000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000140b1494be100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004068747470733a2f2f6574686572732e7269636d6f6f2e776f726b6572732e6465762f746573742d636369702d726561642f7b73656e6465727d2f7b646174617d00000000000000000000000000000000000000000000000000000000000000021234000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d4d79206578747261206461746100000000000000000000000000000000000000";
+ return ((0, index_js_1.isCallException)(error) && error.data === offchainErrorData);
+ });
+ });
+ });
+ it("testGetFail should fail if all URLs 5xx", function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.timeout(60000);
+ const provider = (0, create_provider_js_1.connect)("goerli");
+ // testGetFail(bytes callData = "0x1234")
+ const tx = {
+ to: address, enableCcipRead: true,
+ data: "0x36f9cea6000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000021234000000000000000000000000000000000000000000000000000000000000"
+ };
+ yield assert_1.default.rejects(function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ const result = yield provider.call(tx);
+ console.log(result);
+ });
+ }, (error) => {
+ const infoJson = '{"urls":["https:/\/ethers.ricmoo.workers.dev/status/500/{sender}/{data}"],"errorMessages":["hello world"]}';
+ return ((0, index_js_1.isError)(error, "OFFCHAIN_FAULT") && error.reason === "500_SERVER_ERROR" &&
+ JSON.stringify(error.info) === infoJson);
+ });
+ });
+ });
+ it("testGetSenderFail should fail if sender does not match", function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.timeout(60000);
+ const provider = (0, create_provider_js_1.connect)("goerli");
+ // testGetSenderFail(bytes callData = "0x1234")
+ const tx = {
+ to: address, enableCcipRead: true,
+ data: "0x64bff6d1000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000021234000000000000000000000000000000000000000000000000000000000000",
+ };
+ yield assert_1.default.rejects(function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ const result = yield provider.call(tx);
+ console.log(result);
+ });
+ }, (error) => {
+ const errorArgsJson = '["0x0000000000000000000000000000000000000000",["https://ethers.ricmoo.workers.dev/test-ccip-read/{sender}/{data}"],"0x1234","0xb1494be1","0x4d792065787472612064617461"]';
+ const offchainErrorData = "0x556f1830000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000140b1494be100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004068747470733a2f2f6574686572732e7269636d6f6f2e776f726b6572732e6465762f746573742d636369702d726561642f7b73656e6465727d2f7b646174617d00000000000000000000000000000000000000000000000000000000000000021234000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d4d79206578747261206461746100000000000000000000000000000000000000";
+ return ((0, index_js_1.isCallException)(error) && error.data === offchainErrorData &&
+ error.revert &&
+ error.revert.signature === "OffchainLookup(address,string[],bytes,bytes4,bytes)" &&
+ JSON.stringify(error.revert.args) === errorArgsJson);
+ });
+ });
+ });
+ it("testGetMissing should fail if early URL 4xx", function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.timeout(60000);
+ const provider = (0, create_provider_js_1.connect)("goerli");
+ // testGetMissing(bytes callData = "0x1234")
+ const tx = {
+ to: address, enableCcipRead: true,
+ data: "0x4ece8d7d000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000021234000000000000000000000000000000000000000000000000000000000000"
+ };
+ yield assert_1.default.rejects(function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ const result = yield provider.call(tx);
+ console.log(result);
+ });
+ }, (error) => {
+ const infoJson = '{"url":"https:/\/ethers.ricmoo.workers.dev/status/404/{sender}/{data}","errorMessage":"hello world"}';
+ return ((0, index_js_1.isError)(error, "OFFCHAIN_FAULT") && error.reason === "404_MISSING_RESOURCE" &&
+ JSON.stringify(error.info || "") === infoJson);
+ });
+ });
+ });
+ it("testGetFallback passes if any URL returns correctly", function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.timeout(60000);
+ const provider = (0, create_provider_js_1.connect)("goerli");
+ // testGetFallback(bytes callData = "0x1234")
+ const tx = {
+ to: address, enableCcipRead: true,
+ data: "0xedf4a021000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000021234000000000000000000000000000000000000000000000000000000000000"
+ };
+ const result = yield provider.call(tx);
+ verify(address, calldata, result);
+ });
+ });
+ it("testPost passes under normal operation", function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.timeout(60000);
+ const provider = (0, create_provider_js_1.connect)("goerli");
+ // testPost(bytes callData = "0x1234")
+ const tx = {
+ to: address, enableCcipRead: true,
+ data: "0x66cab49d000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000021234000000000000000000000000000000000000000000000000000000000000"
+ };
+ const result = yield provider.call(tx);
+ verify(address, calldata, result);
+ });
+ });
+});
+//# sourceMappingURL=test-providers-ccip.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-providers-ccip.js.map b/dist/ethers.js/src.ts/_tests/test-providers-ccip.js.map
new file mode 100644
index 0000000..499526b
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-providers-ccip.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-providers-ccip.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-providers-ccip.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,oDAA4B;AAE5B,0CAKqB;AAErB,6DAA+D;AAE/D,IAAA,mCAAc,GAAE,CAAC;AAEjB,QAAQ,CAAC,qBAAqB,EAAE;IAE5B,sEAAsE;IACtE,mCAAmC;IACnC,MAAM,MAAM,GAAG,UAAS,MAAc,EAAE,IAAY,EAAE,MAAc;QAChE,MAAM,KAAK,GAAG,IAAA,iBAAM,EAAC;YACjB,IAAA,oBAAS,EAAC,IAAA,qBAAU,EAAC,MAAM,CAAC,CAAC,EAAE,MAAM;YACrC,IAAA,oBAAS,EAAC,IAAA,qBAAU,EAAC,IAAI,CAAC,CAAC,EAAE,IAAI;SACpC,CAAC,CAAC;QACH,gBAAM,CAAC,KAAK,CAAC,MAAM,EAAE,IAAA,oBAAS,EAAC,KAAK,CAAC,EAAE,mBAAmB,CAAC,CAAC;IAChE,CAAC,CAAA;IAED,MAAM,OAAO,GAAG,4CAA4C,CAAC;IAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC;IAE1B,EAAE,CAAC,uCAAuC,EAAE;;YACxC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YAEpB,MAAM,QAAQ,GAAG,IAAA,4BAAO,EAAC,QAAQ,CAAC,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,EAAE,MAAM,CAAC,CAAC;QACtC,CAAC;KAAA,CAAC,CAAC;AACP,CAAC,CAAC,CAAA"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-providers-data.d.ts b/dist/ethers.js/src.ts/_tests/test-providers-data.d.ts
new file mode 100644
index 0000000..c9920ec
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-providers-data.d.ts
@@ -0,0 +1,2 @@
+export {};
+//# sourceMappingURL=test-providers-data.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-providers-data.d.ts.map b/dist/ethers.js/src.ts/_tests/test-providers-data.d.ts.map
new file mode 100644
index 0000000..7332b62
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-providers-data.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-providers-data.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-providers-data.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-providers-data.js b/dist/ethers.js/src.ts/_tests/test-providers-data.js
new file mode 100644
index 0000000..6b58a14
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-providers-data.js
@@ -0,0 +1,218 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const assert_1 = __importDefault(require("assert"));
+const create_provider_js_1 = require("./create-provider.js");
+const utils_js_1 = require("./utils.js");
+const blockchain_data_js_1 = require("./blockchain-data.js");
+(0, create_provider_js_1.setupProviders)();
+function forEach(prefix, tests, func) {
+ for (const networkName of blockchain_data_js_1.networkNames) {
+ const networkTests = tests[networkName];
+ if (networkTests == null) {
+ continue;
+ }
+ for (const test of networkTests) {
+ for (const providerName of create_provider_js_1.providerNames) {
+ if (!(0, create_provider_js_1.checkProvider)(providerName, networkName)) {
+ continue;
+ }
+ // Let the testcase skip this by returning null
+ const testFunc = func(providerName, test);
+ if (testFunc == null) {
+ continue;
+ }
+ // Prepare the testcase
+ (0, utils_js_1.retryIt)(`${prefix}: ${providerName}:${networkName}.${test.test}`, function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ // Create a provider
+ const provider = (0, create_provider_js_1.getProvider)(providerName, networkName);
+ try {
+ assert_1.default.ok(provider != null, "missing provider");
+ yield testFunc(provider);
+ }
+ catch (error) {
+ // Shutdown socket-based provider, otherwise its socket will prevent
+ // this process from exiting
+ if (provider.destroy) {
+ provider.destroy();
+ }
+ throw error;
+ }
+ // Shutdown socket-based provider, otherwise its socket will prevent
+ // this process from exiting
+ if (provider.destroy) {
+ provider.destroy();
+ }
+ });
+ });
+ }
+ }
+ }
+}
+describe("Test Provider Address operations", function () {
+ forEach("test getBalance(address)", blockchain_data_js_1.testAddress, (providerName, test) => {
+ if (test.balance == null) {
+ return null;
+ }
+ return (provider) => __awaiter(this, void 0, void 0, function* () {
+ assert_1.default.equal(yield provider.getBalance(test.address), test.balance);
+ });
+ });
+ forEach("test getCode(address)", blockchain_data_js_1.testAddress, (providerName, test) => {
+ if (test.code == null) {
+ return null;
+ }
+ return (provider) => __awaiter(this, void 0, void 0, function* () {
+ assert_1.default.equal(yield provider.getCode(test.address), test.code);
+ });
+ });
+ /*
+ forEach("test lookupAddress(address)", testAddress, (provider, test) => {
+ if (test.name == null) { return null; }
+ return async () => {
+ assert.equal(await provider.lookupAddress(test.address), test.name);
+ };
+ });
+
+ forEach("test resolveName(name)", testAddress, (provider, test) => {
+ if (test.name == null) { return null; }
+ return async () => {
+ assert.equal(await provider.lookupAddress((test.name)), test.address);
+ };
+ });
+ */
+ forEach("test getStorage(address)", blockchain_data_js_1.testAddress, (providerName, test) => {
+ if (test.storage == null) {
+ return null;
+ }
+ return (provider) => __awaiter(this, void 0, void 0, function* () {
+ for (const key in test.storage) {
+ assert_1.default.equal(yield provider.getStorage(test.address, key), test.storage[key]);
+ }
+ });
+ });
+ forEach("test getTransactionCount(address)", blockchain_data_js_1.testAddress, (providerName, test) => {
+ if (test.balance == null) {
+ return null;
+ }
+ return (provider) => __awaiter(this, void 0, void 0, function* () {
+ assert_1.default.equal(yield provider.getTransactionCount(test.address), test.nonce);
+ });
+ });
+});
+function assertObj(prefix, actual, expected) {
+ assert_1.default.ok(actual != null, `${prefix} is null`);
+ for (const key in expected) {
+ if (expected[key] === undefined) {
+ continue;
+ }
+ assert_1.default.equal(actual[key], expected[key], `${prefix}.${key}`);
+ }
+}
+function assertBlock(actual, expected) {
+ // Check transactions
+ for (let i = 0; i < expected.transactions.length; i++) {
+ const expectedTx = expected.transactions[i];
+ if (typeof (expectedTx) === "string") {
+ assert_1.default.equal(actual.transactions[i], expectedTx, `block.transactions[${i}]`);
+ }
+ else {
+ throw new Error("@TODO");
+ }
+ }
+ // Remove the transactions and test keys
+ expected = Object.assign({}, expected, { transactions: undefined, test: undefined });
+ // Check remaining keys
+ assertObj("block", actual, expected);
+}
+function assertTransaction(actual, expected) {
+ // @TODO: Accesslist
+ // Check signature
+ assertObj("tx.signature", actual.signature, expected.signature);
+ // Remove the transactions and test keys
+ expected = Object.assign({}, expected, {
+ accessList: undefined,
+ signature: undefined,
+ test: undefined
+ });
+ // Check remaining keys
+ assertObj("tx", actual, expected);
+}
+function assertReceipt(actual, expected) {
+ // Check logs
+ for (let i = 0; i < expected.logs.length; i++) {
+ let expectedLog = expected.logs[i];
+ for (let j = 0; j < expectedLog.topics.length; j++) {
+ assert_1.default.equal(actual.logs[i].topics[j], expectedLog.topics[j], `receipt.logs[${i}].topics[${j}]`);
+ }
+ expectedLog = Object.assign({}, expectedLog, { topics: undefined });
+ assertObj(`receipt.log[${i}]`, actual.logs[i], expectedLog);
+ }
+ // Remove the transactions and test keys
+ expected = Object.assign({}, expected, { logs: undefined, test: undefined });
+ // In Byzantium, the root was dropped and the status was added
+ if ((0, blockchain_data_js_1.networkFeatureAtBlock)("byzantium", expected.blockNumber)) {
+ expected = Object.assign({}, expected, { root: undefined });
+ }
+ else {
+ expected = Object.assign({}, expected, { status: undefined });
+ }
+ // Check remaining keys
+ assertObj("receipt", actual, expected);
+}
+describe("Test Provider Block operations", function () {
+ forEach("test getBlock(blockHash)", blockchain_data_js_1.testBlock, (providerName, test) => {
+ // Etherscan does not support getting a block by blockhash
+ if (providerName === "EtherscanProvider") {
+ return null;
+ }
+ return (provider) => __awaiter(this, void 0, void 0, function* () {
+ assertBlock(yield provider.getBlock(test.hash), test);
+ });
+ });
+ forEach("test getBlock(blockNumber)", blockchain_data_js_1.testBlock, (providerName, test) => {
+ return (provider) => __awaiter(this, void 0, void 0, function* () {
+ assertBlock(yield provider.getBlock(test.number), test);
+ });
+ });
+});
+describe("Test Provider Transaction operations", function () {
+ forEach("test getTransaction(hash)", blockchain_data_js_1.testTransaction, (providerName, test) => {
+ return (provider) => __awaiter(this, void 0, void 0, function* () {
+ assertTransaction(yield provider.getTransaction(test.hash), test);
+ });
+ });
+ forEach("test getTransactionReceipt(hash)", blockchain_data_js_1.testReceipt, (providerName, test) => {
+ return (provider) => __awaiter(this, void 0, void 0, function* () {
+ const receipt = yield provider.getTransactionReceipt(test.hash);
+ assert_1.default.ok(receipt != null, "receipt != null");
+ // Cloudflare doesn't return the root in legacy receipts; but it isn't
+ // *actually* that important, so we'll give it a pass...
+ if (providerName === "CloudflareProvider" || providerName === "AnkrProvider" || providerName === "PocketProvider") {
+ test = Object.assign({}, test, { root: undefined });
+ }
+ //if (providerName === "PocketProvider") {
+ //}
+ assertReceipt(receipt, test);
+ });
+ });
+ forEach("test lookupAddress(addr) == null", blockchain_data_js_1.testReceipt, (providerName, test) => {
+ return (provider) => __awaiter(this, void 0, void 0, function* () {
+ const name = yield provider.lookupAddress("0x0123456789012345678901234567890123456789");
+ assert_1.default.ok(name == null, "name == null");
+ });
+ });
+});
+//# sourceMappingURL=test-providers-data.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-providers-data.js.map b/dist/ethers.js/src.ts/_tests/test-providers-data.js.map
new file mode 100644
index 0000000..c40b079
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-providers-data.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-providers-data.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-providers-data.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,oDAA4B;AAE5B,6DAE8B;AAC9B,yCAAqC;AAKrC,6DAG8B;AAK9B,IAAA,mCAAc,GAAE,CAAC;AAGjB,SAAS,OAAO,CAA6B,MAAc,EAAE,KAA8C,EAAE,IAAkF;IAC3L,KAAK,MAAM,WAAW,IAAI,iCAAY,EAAE;QACpC,MAAM,YAAY,GAAa,KAAK,CAAC,WAAW,CAAC,CAAC;QAClD,IAAI,YAAY,IAAI,IAAI,EAAE;YAAE,SAAS;SAAE;QAEvC,KAAK,MAAM,IAAI,IAAI,YAAY,EAAE;YAC7B,KAAK,MAAM,YAAY,IAAI,kCAAa,EAAE;gBACtC,IAAI,CAAC,IAAA,kCAAa,EAAC,YAAY,EAAE,WAAW,CAAC,EAAE;oBAAE,SAAS;iBAAE;gBAE5D,+CAA+C;gBAC/C,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;gBAC1C,IAAI,QAAQ,IAAI,IAAI,EAAE;oBAAE,SAAS;iBAAE;gBAEnC,uBAAuB;gBACvB,IAAA,kBAAO,EAAC,GAAI,MAAO,KAAM,YAAa,IAAK,WA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,CAAC,YAAY,EAAE,IAAI,EAAE,EAAE;QAC5E,OAAO,CAAO,QAAQ,EAAE,EAAE;YACtB,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YAC/D,gBAAM,CAAC,EAAE,CAAC,OAAO,IAAI,IAAI,EAAE,iBAAiB,CAAC,CAAC;YAE9C,sEAAsE;YACtE,wDAAwD;YACxD,IAAI,YAAY,KAAK,oBAAoB,IAAI,YAAY,KAAK,cAAc,IAAI,YAAY,KAAK,gBAAgB,EAAE;gBAC/G,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,EAAG,EAAG,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;aACzD;YAED,0CAA0C;YAC1C,GAAG;YAEH,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QACjC,CAAC,CAAA,CAAC;IACN,CAAC,CAAC,CAAC;IAEH,OAAO,CAAC,kCAAkC,EAAE,gCAAW,EAAE,CAAC,YAAY,EAAE,IAAI,EAAE,EAAE;QAC5E,OAAO,CAAO,QAAQ,EAAE,EAAE;YACtB,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,aAAa,CAAC,4CAA4C,CAAC,CAAA;YACvF,gBAAM,CAAC,EAAE,CAAC,IAAI,IAAI,IAAI,EAAE,cAAc,CAAC,CAAC;QAC5C,CAAC,CAAA,CAAC;IACN,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-providers-errors.d.ts b/dist/ethers.js/src.ts/_tests/test-providers-errors.d.ts
new file mode 100644
index 0000000..c179d1a
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-providers-errors.d.ts
@@ -0,0 +1,2 @@
+export {};
+//# sourceMappingURL=test-providers-errors.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-providers-errors.d.ts.map b/dist/ethers.js/src.ts/_tests/test-providers-errors.d.ts.map
new file mode 100644
index 0000000..63f68b6
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-providers-errors.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-providers-errors.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-providers-errors.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-providers-errors.js b/dist/ethers.js/src.ts/_tests/test-providers-errors.js
new file mode 100644
index 0000000..b91e6c4
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-providers-errors.js
@@ -0,0 +1,257 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const assert_1 = __importDefault(require("assert"));
+const index_js_1 = require("../index.js");
+const create_provider_js_1 = require("./create-provider.js");
+const utils_js_1 = require("./utils.js");
+(0, create_provider_js_1.setupProviders)();
+describe("Tests Provider Call Exception", function () {
+ const panics = [
+ //{ code: 0x00, reason: "GENERIC_PANIC" },
+ { code: 0x01, reason: "ASSERT_FALSE" },
+ { code: 0x11, reason: "OVERFLOW" },
+ { code: 0x12, reason: "DIVIDE_BY_ZERO" },
+ //{ code: 0x21, reason: "ENUM_RANGE_ERROR" },
+ //{ code: 0x22, reason: "BAD_STORAGE_DATA" },
+ { code: 0x31, reason: "STACK_UNDERFLOW" },
+ { code: 0x32, reason: "ARRAY_RANGE_ERROR" },
+ //{ code: 0x41, reason: "OUT_OF_MEMORY" },
+ //{ code: 0x51, reason: "UNINITIALIZED_FUNCTION_CALL" },
+ ];
+ const testAddr = "0xF20Ba47c47a32fc2d9ad846fF06f2fa6e89eeC74";
+ const networkName = "goerli";
+ for (const { code, reason } of panics) {
+ for (const method of ["call", "estimateGas"]) {
+ for (const providerName of create_provider_js_1.providerNames) {
+ const provider = (0, create_provider_js_1.getProvider)(providerName, networkName);
+ if (provider == null) {
+ continue;
+ }
+ it(`tests panic code: ${providerName}.${method}.${reason}`, function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.timeout(10000);
+ const data = (0, index_js_1.concat)([
+ (0, index_js_1.dataSlice)((0, index_js_1.id)("testPanic(uint256)"), 0, 4),
+ (0, index_js_1.zeroPadValue)((0, index_js_1.toBeArray)(code), 32)
+ ]);
+ yield (0, utils_js_1.stall)(1000);
+ const tx = { to: testAddr, data };
+ try {
+ const result = yield (method === "call" ? provider.call(tx) : provider.estimateGas(tx));
+ console.log(result);
+ assert_1.default.ok(false, "panic call did not throw");
+ }
+ catch (error) {
+ assert_1.default.ok((0, index_js_1.isCallException)(error), "isCallException");
+ // Check some basics
+ assert_1.default.equal(error.action, method, `error.action == ${method}`);
+ assert_1.default.equal(error.reason, `Panic due to ${reason}(${code})`, "error.reason");
+ // Check the transaciton
+ assert_1.default.equal(error.transaction.to, tx.to, `error.transaction.to`);
+ assert_1.default.equal(error.transaction.data, tx.data, `error.transaction.data`);
+ // We have no invocation data
+ assert_1.default.equal(error.invocation, null, `error.invocation != null`);
+ // Check the revert
+ assert_1.default.ok(error.revert != null, "error.revert == null");
+ assert_1.default.equal(error.revert.name, "Panic", `error.revert.name`);
+ assert_1.default.equal(error.revert.signature, "Panic(uint256)", `error.revert.signature`);
+ assert_1.default.equal(error.revert.args.length, 1, `error.revert.args.length`);
+ assert_1.default.equal(error.revert.args[0], code, `error.revert.args[0]`);
+ }
+ });
+ });
+ }
+ }
+ }
+ const customErrors = [
+ {
+ name: "CustomError1",
+ signature: "testCustomError1(bool,uint256,string)",
+ data: "0xdb7342480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002a0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000b68656c6c6f20776f726c64000000000000000000000000000000000000000000",
+ //data: "0x852d0c740000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002a0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000b48656c6c6f20576f726c64000000000000000000000000000000000000000000",
+ message: `execution reverted (unknown custom error)`,
+ reason: null,
+ revert: null,
+ },
+ {
+ name: "Error",
+ signature: "testErrorString(bool,string)",
+ data: "0xb206699b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000b68656c6c6f20776f726c64000000000000000000000000000000000000000000",
+ //data: "0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000b48656c6c6f20576f726c64000000000000000000000000000000000000000000"
+ message: `execution reverted: "hello world"`,
+ reason: "hello world",
+ revert: {
+ signature: "Error(string)",
+ name: "Error",
+ args: ['hello world']
+ }
+ },
+ ];
+ for (const { data, message, name, reason, revert } of customErrors) {
+ for (const method of ["call", "estimateGas"]) {
+ const tx = { to: testAddr, data };
+ for (const providerName of create_provider_js_1.providerNames) {
+ const provider = (0, create_provider_js_1.getProvider)(providerName, networkName);
+ if (provider == null) {
+ continue;
+ }
+ it(`tests custom errors: ${providerName}.${method}.${name}`, function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.timeout(10000);
+ try {
+ const result = yield (method === "call" ? provider.call(tx) : provider.estimateGas(tx));
+ console.log(result);
+ assert_1.default.ok(false, "panic call did not throw");
+ }
+ catch (error) {
+ assert_1.default.ok((0, index_js_1.isCallException)(error), "isCallException");
+ // Check some basics
+ assert_1.default.equal(error.action, method, `error.action == ${method}`);
+ assert_1.default.ok(error.message.startsWith(message), "error.message == message");
+ if (reason) {
+ assert_1.default.equal(error.reason, reason, "error.reason");
+ }
+ else {
+ assert_1.default.ok(error.reason == null, "error.reason != null");
+ }
+ if (revert) {
+ assert_1.default.ok(error.revert != null, "error.revert == null");
+ assert_1.default.equal(error.revert.name, revert.name, "error.revert.name");
+ assert_1.default.equal(error.revert.signature, revert.signature, "error.revert.signature");
+ assert_1.default.equal(error.revert.args.length, revert.args.length, "error.revert.args.length");
+ for (let i = 0; i < revert.args.length; i++) {
+ assert_1.default.equal(error.revert.args[i], revert.args[i], `error.revert.args[${i}]`);
+ }
+ }
+ else {
+ assert_1.default.ok(error.revert == null, "error.revert != null");
+ }
+ }
+ });
+ });
+ }
+ }
+ }
+});
+describe("Test Provider Blockchain Errors", function () {
+ const wallet = new index_js_1.Wallet((process.env.FAUCET_PRIVATEKEY));
+ const networkName = "goerli";
+ for (const providerName of create_provider_js_1.providerNames) {
+ const provider = (0, create_provider_js_1.getProvider)(providerName, networkName);
+ if (provider == null) {
+ continue;
+ }
+ // The CI runs multiple tests at once; minimize colliding with
+ // the initial tx by using a random value, so we can detect
+ // replacements we didn't do.
+ const value = Math.trunc(Math.random() * 2048) + 2;
+ it(`tests underpriced replacement transaction: ${providerName}`, function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.timeout(60000);
+ const w = wallet.connect(provider);
+ let tx1 = null;
+ let nonce = null;
+ ;
+ for (let i = 0; i < 10; i++) {
+ nonce = yield w.getNonce("pending");
+ try {
+ tx1 = yield w.sendTransaction({
+ nonce, to: wallet, value
+ });
+ }
+ catch (error) {
+ // Another CI host beat us to this nonce
+ if ((0, index_js_1.isError)(error, "REPLACEMENT_UNDERPRICED") || (0, index_js_1.isError)(error, "NONCE_EXPIRED")) {
+ yield (0, utils_js_1.stall)(1000);
+ continue;
+ }
+ console.log("EE-tx1", nonce, value, error);
+ throw error;
+ }
+ break;
+ }
+ if (tx1 == null || nonce == null) {
+ throw new Error("could not send initial tx");
+ }
+ const rejection = assert_1.default.rejects(function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ // Send another tx with the same nonce
+ const tx2 = yield w.sendTransaction({
+ nonce, to: wallet, value: 1
+ });
+ console.log({ tx1, tx2 });
+ });
+ }, (error) => {
+ return (0, index_js_1.isError)(error, "REPLACEMENT_UNDERPRICED");
+ });
+ // Wait for the first tx to get mined so we start with a
+ // clean slate on the next provider
+ yield tx1.wait();
+ // This should have already happened
+ yield rejection;
+ });
+ });
+ }
+ for (const providerName of create_provider_js_1.providerNames) {
+ const provider = (0, create_provider_js_1.getProvider)(providerName, networkName);
+ if (provider == null) {
+ continue;
+ }
+ it(`tests insufficient funds: ${providerName}`, function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.timeout(60000);
+ const w = index_js_1.Wallet.createRandom().connect(provider);
+ yield assert_1.default.rejects(function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ const tx = yield w.sendTransaction({
+ to: wallet, value: 1
+ });
+ console.log(tx);
+ });
+ }, (error) => {
+ return ((0, index_js_1.isError)(error, "INSUFFICIENT_FUNDS") &&
+ typeof (error.transaction.from) === "string" &&
+ error.transaction.from.toLowerCase() === w.address.toLowerCase());
+ });
+ });
+ });
+ }
+ for (const providerName of create_provider_js_1.providerNames) {
+ const provider = (0, create_provider_js_1.getProvider)(providerName, networkName);
+ if (provider == null) {
+ continue;
+ }
+ it(`tests nonce expired: ${providerName}`, function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.timeout(60000);
+ const w = wallet.connect(provider);
+ yield assert_1.default.rejects(function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ const tx = yield w.sendTransaction({
+ to: wallet, nonce: 1, value: 1
+ });
+ console.log(tx);
+ });
+ }, (error) => {
+ if (!(0, index_js_1.isError)(error, "NONCE_EXPIRED")) {
+ console.log(error);
+ }
+ return (0, index_js_1.isError)(error, "NONCE_EXPIRED");
+ });
+ });
+ });
+ }
+});
+//# sourceMappingURL=test-providers-errors.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-providers-errors.js.map b/dist/ethers.js/src.ts/_tests/test-providers-errors.js.map
new file mode 100644
index 0000000..a1d1bd4
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-providers-errors.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-providers-errors.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-providers-errors.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,oDAA4B;AAE5B,0CAIqB;AAErB,6DAAkF;AAClF,yCAAmC;AAiBnC,IAAA,mCAAc,GAAE,CAAC;AAEjB,QAAQ,CAAC,+BAA+B,EAAE;IAEtC,MAAM,MAAM,GAA4C;QACpD,0CAA0C;QAC1C,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE;QACtC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE;QAClC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,gBAAgB,EAAE;QACxC,6CAA6C;QAC7C,6CAA6C;QAC7C,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,iBAAiB,EAAE;QACzC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,mBAAmB,EAAE;QAC3C,0CAA0C;QAC1C,wDAAwD;KAC3D,CAAC;IAEF,MAAM,QAAQ,GAAG,4CAA4C,CAAC;IAE9D,MAAM,WAAW,GAAG,QAAQ,CAAC;IAC7B,KAAK,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,MAAM,EAAE;QACnC,KAAK,MAAM,MAAM,IAAI,CAAE,MAAM,EAAE,aAAa,CAAE,EAAE;YAC5C,KAAK,MAAM,YAAY,IAAI,kCAAa,EAAE;gBACtC,MAAM,QAAQ,GAAG,IAAA,gCAAW,EAAC,YAAY,EAAE,WAAW,CAAC,CAAC;gBACxD,IAAI,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E,EAAE;oBACT,IAAI,CAAC,IAAA,kBAAO,EAAC,KAAK,EAAE,eAAe,CAAC,EAAE;wBAClC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;qBACtB;oBACD,OAAO,IAAA,kBAAO,EAAC,KAAK,EAAE,eAAe,CAAC,CAAC;gBAC3C,CAAC,CAAC,CAAC;YACP,CAAC;SAAA,CAAC,CAAC;KACN;AAEL,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-providers-extra.d.ts b/dist/ethers.js/src.ts/_tests/test-providers-extra.d.ts
new file mode 100644
index 0000000..63c52de
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-providers-extra.d.ts
@@ -0,0 +1,2 @@
+export {};
+//# sourceMappingURL=test-providers-extra.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-providers-extra.d.ts.map b/dist/ethers.js/src.ts/_tests/test-providers-extra.d.ts.map
new file mode 100644
index 0000000..03af117
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-providers-extra.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-providers-extra.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-providers-extra.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-providers-extra.js b/dist/ethers.js/src.ts/_tests/test-providers-extra.js
new file mode 100644
index 0000000..4d5a7d4
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-providers-extra.js
@@ -0,0 +1,28 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const assert_1 = __importDefault(require("assert"));
+const index_js_1 = require("../index.js");
+const utils_js_1 = require("./utils.js");
+describe("Test Etherscan extra APIs", function () {
+ (0, utils_js_1.retryIt)("test etherscanProvider.getContract", function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ const provider = new index_js_1.EtherscanProvider("mainnet", "FPFGK6JSW2UHJJ2666FG93KP7WC999MNW7");
+ const contract = yield provider.getContract("dai.tokens.ethers.eth");
+ assert_1.default.ok(contract != null, "contract == null");
+ assert_1.default.equal(yield contract.symbol(), "DAI", "contract.symbol");
+ });
+ });
+});
+//# sourceMappingURL=test-providers-extra.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-providers-extra.js.map b/dist/ethers.js/src.ts/_tests/test-providers-extra.js.map
new file mode 100644
index 0000000..2fb1a58
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-providers-extra.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-providers-extra.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-providers-extra.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,oDAA4B;AAE5B,0CAAgD;AAEhD,yCAAqC;AAGrC,QAAQ,CAAC,2BAA2B,EAAE;IAClC,IAAA,kBAAO,EAAC,oCAAoC,EAAE;;YAC1C,MAAM,QAAQ,GAAG,IAAI,4BAAiB,CAAC,SAAS,EAAE,oCAAoC,CAAC,CAAC;YACxF,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,WAAW,CAAC,uBAAuB,CAAC,CAAC;YACrE,gBAAM,CAAC,EAAE,CAAC,QAAQ,IAAI,IAAI,EAAE,kBAAkB,CAAC,CAAC;YAChD,gBAAM,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC;QACpE,CAAC;KAAA,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-providers-fallback.d.ts b/dist/ethers.js/src.ts/_tests/test-providers-fallback.d.ts
new file mode 100644
index 0000000..6b3b554
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-providers-fallback.d.ts
@@ -0,0 +1,10 @@
+import { AbstractProvider, Network } from "../index.js";
+import type { PerformActionRequest } from "../index.js";
+export type Performer = (req: PerformActionRequest) => Promise;
+export declare class MockProvider extends AbstractProvider {
+ readonly _perform: Performer;
+ constructor(perform: Performer);
+ _detectNetwork(): Promise;
+ perform(req: PerformActionRequest): Promise;
+}
+//# sourceMappingURL=test-providers-fallback.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-providers-fallback.d.ts.map b/dist/ethers.js/src.ts/_tests/test-providers-fallback.d.ts.map
new file mode 100644
index 0000000..8890e23
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-providers-fallback.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-providers-fallback.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-providers-fallback.ts"],"names":[],"mappings":"AAEA,OAAO,EAGH,gBAAgB,EAAoB,OAAO,EAE9C,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EACR,oBAAoB,EACvB,MAAM,aAAa,CAAC;AAWrB,MAAM,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE,oBAAoB,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;AAEpE,qBAAa,YAAa,SAAQ,gBAAgB;IAC9C,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;gBAEjB,OAAO,EAAE,SAAS;IAKxB,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;IAElC,OAAO,CAAC,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC;CAGzD"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-providers-fallback.js b/dist/ethers.js/src.ts/_tests/test-providers-fallback.js
new file mode 100644
index 0000000..ed11f03
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-providers-fallback.js
@@ -0,0 +1,166 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.MockProvider = void 0;
+const assert_1 = __importDefault(require("assert"));
+const index_js_1 = require("../index.js");
+const network = index_js_1.Network.from("mainnet");
+function stall(duration) {
+ return new Promise((resolve) => { setTimeout(resolve, duration); });
+}
+class MockProvider extends index_js_1.AbstractProvider {
+ constructor(perform) {
+ super(network, { cacheTimeout: -1 });
+ this._perform = perform;
+ }
+ _detectNetwork() {
+ return __awaiter(this, void 0, void 0, function* () { return network; });
+ }
+ perform(req) {
+ return __awaiter(this, void 0, void 0, function* () {
+ return yield this._perform(req);
+ });
+ }
+}
+exports.MockProvider = MockProvider;
+describe("Test Fallback broadcast", function () {
+ const txHash = "0x33017397ef7c7943dee3b422aec52b0a210de58d73d49c1b3ce455970f01c83a";
+ function test(actions) {
+ return __awaiter(this, void 0, void 0, function* () {
+ // https://sepolia.etherscan.io/tx/0x33017397ef7c7943dee3b422aec52b0a210de58d73d49c1b3ce455970f01c83a
+ const tx = "0x02f87683aa36a7048459682f00845d899ef982520894b5bdaa442bb34f27e793861c456cd5bdc527ac8c89056bc75e2d6310000080c001a07503893743e94445b2361a444343757e6f59d52e19e9b3f65eb138d802eaa972a06e4e9bc10ff55474f9aac0a4c284733b4195cb7b273de5e7465ce75a168e0c38";
+ const providers = actions.map(({ timeout, error }) => {
+ return new MockProvider((r) => __awaiter(this, void 0, void 0, function* () {
+ if (r.method === "getBlockNumber") {
+ return 1;
+ }
+ if (r.method === "broadcastTransaction") {
+ yield stall(timeout);
+ if (error) {
+ throw error;
+ }
+ return txHash;
+ }
+ throw new Error(`unhandled method: ${r.method}`);
+ }));
+ });
+ ;
+ const provider = new index_js_1.FallbackProvider(providers);
+ return yield provider.broadcastTransaction(tx);
+ });
+ }
+ it("picks late non-failed broadcasts", function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ const result = yield test([
+ { timeout: 200, error: (0, index_js_1.makeError)("already seen", "UNKNOWN_ERROR") },
+ { timeout: 4000, error: (0, index_js_1.makeError)("already seen", "UNKNOWN_ERROR") },
+ { timeout: 400 },
+ ]);
+ (0, assert_1.default)(result.hash === txHash, "result.hash === txHash");
+ });
+ });
+ it("picks late non-failed broadcasts with quorum-met red-herrings", function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ const result = yield test([
+ { timeout: 200, error: (0, index_js_1.makeError)("bad nonce", "NONCE_EXPIRED") },
+ { timeout: 400, error: (0, index_js_1.makeError)("bad nonce", "NONCE_EXPIRED") },
+ { timeout: 1000 },
+ ]);
+ (0, assert_1.default)(result.hash === txHash, "result.hash === txHash");
+ });
+ });
+ it("insufficient funds short-circuit broadcast", function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ yield assert_1.default.rejects(function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ const result = yield test([
+ { timeout: 200, error: (0, index_js_1.makeError)("is broke", "INSUFFICIENT_FUNDS") },
+ { timeout: 400, error: (0, index_js_1.makeError)("is broke", "INSUFFICIENT_FUNDS") },
+ { timeout: 800 },
+ { timeout: 1000 },
+ ]);
+ console.log(result);
+ });
+ }, function (error) {
+ (0, assert_1.default)((0, index_js_1.isError)(error, "INSUFFICIENT_FUNDS"));
+ return true;
+ });
+ });
+ });
+});
+describe("Test Inflight Quorum", function () {
+ // Fires the %%actions%% as providers which will delay before returning,
+ // and returns an array of arrays, where each sub-array indicates which
+ // providers were inflight at once.
+ function test(actions, quorum) {
+ return __awaiter(this, void 0, void 0, function* () {
+ const inflights = [[]];
+ const configs = actions.map(({ delay, stallTimeout, priority, weight }, index) => ({
+ provider: new MockProvider((r) => __awaiter(this, void 0, void 0, function* () {
+ if (r.method === "getBlockNumber") {
+ return 1;
+ }
+ if (r.method === "getBalance") {
+ // Add this as inflight
+ let last = inflights.pop();
+ if (last == null) {
+ throw new Error("no elements");
+ }
+ inflights.push(last);
+ last = last.slice();
+ last.push(index);
+ inflights.push(last);
+ // Do the thing
+ yield stall(delay);
+ // Remove as inflight
+ last = inflights.pop();
+ if (last == null) {
+ throw new Error("no elements");
+ }
+ inflights.push(last);
+ last = last.filter((v) => (v !== index));
+ inflights.push(last);
+ return 0;
+ }
+ console.log(r);
+ throw new Error(`unhandled method: ${r.method}`);
+ })),
+ stallTimeout, priority, weight
+ }));
+ const provider = new index_js_1.FallbackProvider(configs, network, {
+ cacheTimeout: -1, pollingInterval: 100,
+ quorum
+ });
+ yield provider.getBalance(index_js_1.ZeroAddress);
+ return inflights;
+ });
+ }
+ // See: #4298
+ it("applies weights against inflight requests", function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.timeout(2000);
+ const inflights = yield test([
+ { delay: 50, stallTimeout: 1000, priority: 1, weight: 2 },
+ { delay: 50, stallTimeout: 1000, priority: 1, weight: 2 },
+ ], 2);
+ // Make sure there is never more than 1 inflight provider at once
+ for (const running of inflights) {
+ assert_1.default.ok(running.length <= 1, `too many inflight requests: ${JSON.stringify(inflights)}`);
+ }
+ });
+ });
+ // @TODO: add lots more tests, checking on priority, weight and stall
+ // configurations
+});
+//# sourceMappingURL=test-providers-fallback.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-providers-fallback.js.map b/dist/ethers.js/src.ts/_tests/test-providers-fallback.js.map
new file mode 100644
index 0000000..ec1982b
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-providers-fallback.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-providers-fallback.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-providers-fallback.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAA4B;AAE5B,0CAKqB;AAQrB,MAAM,OAAO,GAAG,kBAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAExC,SAAS,KAAK,CAAC,QAAgB;IAC3B,OAAQ,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,GAAG,UAAU,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACzE,CAAC;AAKD,MAAa,YAAa,SAAQ,2BAAgB;IAG9C,YAAY,OAAkB;QAC1B,KAAK,CAAC,OAAO,EAAE,EAAE,YAAY,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;QACrC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC5B,CAAC;IAEK,cAAc;8DAAuB,OAAO,OAAO,CAAC,CAAC,CAAC;KAAA;IAEtD,OAAO,CAAC,GAAyB;;YACnC,OAAO,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QACpC,CAAC;KAAA;CACJ;AAbD,oCAaC;AAED,QAAQ,CAAC,yBAAyB,EAAE;IAEhC,MAAM,MAAM,GAAG,oEAAoE,CAAC;IAEpF,SAAe,IAAI,CAAC,OAAkD;;YAClE,qGAAqG;YACrG,MAAM,EAAE,GAAG,sPAAsP,CAAC;YAElQ,MAAM,SAAS,GAAwB,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,E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;gBACF,YAAY,EAAE,QAAQ,EAAE,MAAM;aACjC,CAAC,CAAC,CAAC;YAEJ,MAAM,QAAQ,GAAG,IAAI,2BAAgB,CAAC,OAAO,EAAE,OAAO,EAAE;gBACpD,YAAY,EAAE,CAAC,CAAC,EAAE,eAAe,EAAE,GAAG;gBACtC,MAAM;aACT,CAAC,CAAC;YACH,MAAM,QAAQ,CAAC,UAAU,CAAC,sBAAW,CAAC,CAAC;YAEvC,OAAO,SAAS,CAAC;QACrB,CAAC;KAAA;IAED,aAAa;IACb,EAAE,CAAC,2CAA2C,EAAE;;YAC5C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAEnB,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC;gBACzB,EAAE,KAAK,EAAE,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;gBACzD,EAAE,KAAK,EAAE,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;aAC5D,EAAE,CAAC,CAAC,CAAC;YAEN,iEAAiE;YACjE,KAAK,MAAM,OAAO,IAAI,SAAS,EAAE;gBAC7B,gBAAM,CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,EAAE,+BAAgC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAE,EAAE,CAAC,CAAC;aAChG;QACL,CAAC;KAAA,CAAC,CAAC;IAEH,qEAAqE;IACrE,wBAAwB;AAC5B,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-providers-send.d.ts b/dist/ethers.js/src.ts/_tests/test-providers-send.d.ts
new file mode 100644
index 0000000..f13272e
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-providers-send.d.ts
@@ -0,0 +1,2 @@
+export {};
+//# sourceMappingURL=test-providers-send.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-providers-send.d.ts.map b/dist/ethers.js/src.ts/_tests/test-providers-send.d.ts.map
new file mode 100644
index 0000000..90910f4
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-providers-send.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-providers-send.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-providers-send.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-providers-send.js b/dist/ethers.js/src.ts/_tests/test-providers-send.js
new file mode 100644
index 0000000..a5caf44
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-providers-send.js
@@ -0,0 +1,65 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const assert_1 = __importDefault(require("assert"));
+const index_js_1 = require("../index.js");
+const create_provider_js_1 = require("./create-provider.js");
+function stall(duration) {
+ return new Promise((resolve) => { setTimeout(resolve, duration); });
+}
+(0, create_provider_js_1.setupProviders)();
+describe("Sends Transactions", function () {
+ const wallet = new index_js_1.Wallet((process.env.FAUCET_PRIVATEKEY));
+ console.log("Faucet Address:", wallet.address);
+ const networkName = "goerli";
+ for (const providerName of create_provider_js_1.providerNames) {
+ const provider = (0, create_provider_js_1.getProvider)(providerName, networkName);
+ if (provider == null) {
+ continue;
+ }
+ it(`tests sending: ${providerName}`, function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.timeout(180000);
+ const w = wallet.connect(provider);
+ const dustAddr = index_js_1.Wallet.createRandom().address;
+ // Retry if another CI instance used our value
+ let tx = null;
+ for (let i = 0; i < 10; i++) {
+ try {
+ tx = yield w.sendTransaction({
+ to: dustAddr,
+ value: 42,
+ type: 2
+ });
+ break;
+ }
+ catch (error) {
+ if ((0, index_js_1.isError)(error, "REPLACEMENT_UNDERPRICED") || (0, index_js_1.isError)(error, "NONCE_EXPIRED")) {
+ yield stall(1000);
+ continue;
+ }
+ throw error;
+ }
+ }
+ assert_1.default.ok(!!tx, "too many retries");
+ //const receipt =
+ yield provider.waitForTransaction(tx.hash, null, 60000); //tx.wait();
+ //console.log(receipt);
+ const balance = yield provider.getBalance(dustAddr);
+ assert_1.default.equal(balance, BigInt(42), "target balance after send");
+ });
+ });
+ }
+});
+//# sourceMappingURL=test-providers-send.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-providers-send.js.map b/dist/ethers.js/src.ts/_tests/test-providers-send.js.map
new file mode 100644
index 0000000..84f3bde
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-providers-send.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-providers-send.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-providers-send.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,oDAA4B;AAE5B,0CAA8C;AAE9C,6DAAkF;AAIlF,SAAS,KAAK,CAAC,QAAgB;IAC3B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,GAAG,UAAU,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACxE,CAAC;AAED,IAAA,mCAAc,GAAE,CAAC;AAEjB,QAAQ,CAAC,oBAAoB,EAAE;IAE3B,MAAM,MAAM,GAAG,IAAI,iBAAM,CAAS,CAAC,OAAO,CAAC,GAAG,CAAC,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kB,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,YAAY;gBACrE,uBAAuB;gBAEvB,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;gBACpD,gBAAM,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,CAAC,EAAE,2BAA2B,CAAC,CAAC;YACnE,CAAC;SAAA,CAAC,CAAC;KACN;AAGL,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-providers-wildcard.d.ts b/dist/ethers.js/src.ts/_tests/test-providers-wildcard.d.ts
new file mode 100644
index 0000000..b6f58c0
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-providers-wildcard.d.ts
@@ -0,0 +1,2 @@
+export {};
+//# sourceMappingURL=test-providers-wildcard.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-providers-wildcard.d.ts.map b/dist/ethers.js/src.ts/_tests/test-providers-wildcard.d.ts.map
new file mode 100644
index 0000000..c6f73fe
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-providers-wildcard.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-providers-wildcard.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-providers-wildcard.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-providers-wildcard.js b/dist/ethers.js/src.ts/_tests/test-providers-wildcard.js
new file mode 100644
index 0000000..2e28331
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-providers-wildcard.js
@@ -0,0 +1,32 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const assert_1 = __importDefault(require("assert"));
+const create_provider_js_1 = require("./create-provider.js");
+(0, create_provider_js_1.setupProviders)();
+describe("Test EIP-2544 ENS wildcards", function () {
+ const provider = (0, create_provider_js_1.connect)("goerli");
+ it("Resolves recursively", function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ const resolver = yield provider.getResolver("ricmoose.hatch.eth");
+ assert_1.default.ok(resolver, "failed to get resolver");
+ assert_1.default.equal(resolver.address, "0x15abA1fa74Bfdecd63A71218DC632d4328Db8168", "address");
+ assert_1.default.equal(yield resolver.supportsWildcard(), true, "supportsWildcard()");
+ // Test pass-through avatar
+ assert_1.default.equal(yield resolver.getAvatar(), "https:/\/static.ricmoo.com/uploads/profile-06cb9c3031c9.jpg", "getAvatar()");
+ assert_1.default.equal(yield resolver.getAddress(), "0x4B711A377B1b3534749FBe5e59Bcf7F94d92EA98", "getAddress()");
+ });
+ });
+});
+//# sourceMappingURL=test-providers-wildcard.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-providers-wildcard.js.map b/dist/ethers.js/src.ts/_tests/test-providers-wildcard.js.map
new file mode 100644
index 0000000..49f3536
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-providers-wildcard.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-providers-wildcard.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-providers-wildcard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,oDAA4B;AAE5B,6DAA+D;AAE/D,IAAA,mCAAc,GAAE,CAAC;AAEjB,QAAQ,CAAC,6BAA6B,EAAE;IACpC,MAAM,QAAQ,GAAG,IAAA,4BAAO,EAAC,QAAQ,CAAC,CAAC;IAEnC,EAAE,CAAC,sBAAsB,EAAE;;YACvB,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC;YAClE,gBAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,wBAAwB,CAAC,CAAC;YAE9C,gBAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,EAAE,4CAA4C,EAAE,SAAS,CAAC,CAAC;YACxF,gBAAM,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,oBAAoB,CAAC,CAAC;YAE5E,2BAA2B;YAC3B,gBAAM,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,SAAS,EAAE,EAAE,6DAA6D,EAAE,aAAa,CAAC,CAAC;YAEvH,gBAAM,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,UAAU,EAAE,EAAE,4CAA4C,EAAE,cAAc,CAAC,CAAC;QAC5G,CAAC;KAAA,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-rlp.d.ts b/dist/ethers.js/src.ts/_tests/test-rlp.d.ts
new file mode 100644
index 0000000..2a353b7
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-rlp.d.ts
@@ -0,0 +1,2 @@
+export {};
+//# sourceMappingURL=test-rlp.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-rlp.d.ts.map b/dist/ethers.js/src.ts/_tests/test-rlp.d.ts.map
new file mode 100644
index 0000000..b679e11
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-rlp.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-rlp.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-rlp.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-rlp.js b/dist/ethers.js/src.ts/_tests/test-rlp.js
new file mode 100644
index 0000000..58c6ac0
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-rlp.js
@@ -0,0 +1,93 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const assert_1 = __importDefault(require("assert"));
+const utils_js_1 = require("./utils.js");
+const index_js_1 = require("../index.js");
+describe("Test RLP Coder", function () {
+ const tests = (0, utils_js_1.loadTests)("rlp");
+ tests.forEach(({ name, encoded, decoded }) => {
+ it(`encodes RLP: ${name}`, function () {
+ assert_1.default.equal((0, index_js_1.encodeRlp)(decoded), encoded);
+ });
+ });
+ tests.forEach(({ name, encoded, decoded }) => {
+ it(`decodes RLP: ${name}`, function () {
+ assert_1.default.deepEqual((0, index_js_1.decodeRlp)(encoded), decoded);
+ });
+ });
+});
+describe("Test bad RLP Data", function () {
+ it("correctly fails encoding data with invalid values", function () {
+ assert_1.default.throws(() => {
+ (0, index_js_1.encodeRlp)(["0x1234", 1234]);
+ }, (error) => {
+ return (error.code === "INVALID_ARGUMENT" &&
+ error.argument === "object" &&
+ error.value === 1234);
+ });
+ });
+ it("correctlyfails decoding data with trailing junk", function () {
+ assert_1.default.throws(() => {
+ // Zeros_1
+ (0, index_js_1.decodeRlp)("0x0042");
+ }, (error) => {
+ return (error.code === "INVALID_ARGUMENT" &&
+ error.message.match(/^unexpected junk after rlp payload/) &&
+ error.argument === "data" &&
+ error.value === "0x0042");
+ });
+ });
+ it("correctlyfails decoding short data", function () {
+ assert_1.default.throws(() => {
+ (0, index_js_1.decodeRlp)("0x");
+ }, (error) => {
+ return (error.code === "BUFFER_OVERRUN" &&
+ error.message.match(/^data too short/) &&
+ (0, index_js_1.hexlify)(error.buffer) === "0x" &&
+ error.offset === 1 &&
+ error.length === 0);
+ });
+ });
+ it("correctlyfails decoding short data in child", function () {
+ assert_1.default.throws(() => {
+ (0, index_js_1.decodeRlp)("0xc8880102030405060708");
+ }, (error) => {
+ return (error.code === "BUFFER_OVERRUN" &&
+ error.message.match(/^child data too short/) &&
+ (0, index_js_1.hexlify)(error.buffer) === "0xc8880102030405060708" &&
+ error.offset === 0 &&
+ error.length === 8);
+ });
+ });
+ it("correctlyfails decoding short segment data", function () {
+ assert_1.default.throws(() => {
+ // [["0x4243"], ["0x3145"]] = 0xc8 c3 82 4243 c3 82 3145
+ // XXXX
+ (0, index_js_1.decodeRlp)("0xc8c382c3823145");
+ }, (error) => {
+ return (error.code === "BUFFER_OVERRUN" &&
+ error.message.match(/^data short segment too short/) &&
+ (0, index_js_1.hexlify)(error.buffer) === "0xc8c382c3823145" &&
+ error.offset === 9 &&
+ error.length === 7);
+ });
+ });
+});
+/*
+ utils.RLP.encode([["0x4243"], ["0x3145"]])
+
+ 0xc8 c3 82 4243 c3 82 3145
+
+ {
+ "name": "arrayShort2",
+ "decoded": [
+ "0x48656c6c6f20576f726c64",
+ "0x48656c6c6f20576f726c64"
+ ],
+ "encoded": "0xd8 8b 48656c6c6f20576f726c64 8b 48656c6c6f20576f726c64"
+ },
+*/
+//# sourceMappingURL=test-rlp.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-rlp.js.map b/dist/ethers.js/src.ts/_tests/test-rlp.js.map
new file mode 100644
index 0000000..592600c
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-rlp.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-rlp.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-rlp.ts"],"names":[],"mappings":";;;;;AAAA,oDAA4B;AAE5B,yCAAuC;AAEvC,0CAA4D;AAI5D,QAAQ,CAAC,gBAAgB,EAAE;IAEvB,MAAM,KAAK,GAAG,IAAA,oBAAS,EAAc,KAAK,CAAC,CAAC;IAE5C,KAAK,CAAC,OAAO,CAA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CAAC,KAAU,EAAE,EAAE;YACd,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,gBAAgB;gBACnC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,+BAA+B,CAAC;gBACpD,IAAA,kBAAO,EAAC,KAAK,CAAC,MAAM,CAAC,KAAK,kBAAkB;gBAC5C,KAAK,CAAC,MAAM,KAAK,CAAC;gBAClB,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAA;QAC3B,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC;AAEH;;;;;;;;;;;;;EAaE"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-transaction.d.ts b/dist/ethers.js/src.ts/_tests/test-transaction.d.ts
new file mode 100644
index 0000000..5da5478
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-transaction.d.ts
@@ -0,0 +1,2 @@
+export {};
+//# sourceMappingURL=test-transaction.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-transaction.d.ts.map b/dist/ethers.js/src.ts/_tests/test-transaction.d.ts.map
new file mode 100644
index 0000000..6059622
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-transaction.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-transaction.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-transaction.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-transaction.js b/dist/ethers.js/src.ts/_tests/test-transaction.js
new file mode 100644
index 0000000..bc7b56b
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-transaction.js
@@ -0,0 +1,340 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const assert_1 = __importDefault(require("assert"));
+const utils_js_1 = require("./utils.js");
+const index_js_1 = require("../index.js");
+const BN_0 = BigInt(0);
+describe("Tests Unsigned Transaction Serializing", function () {
+ const tests = (0, utils_js_1.loadTests)("transactions");
+ for (const test of tests) {
+ it(`serialized unsigned legacy transaction: ${test.name}`, function () {
+ const txData = Object.assign({}, test.transaction, {
+ type: 0,
+ accessList: undefined,
+ maxFeePerGas: undefined,
+ maxPriorityFeePerGas: undefined
+ });
+ // Use the testcase sans the chainId for a legacy test
+ if (txData.chainId != null && parseInt(txData.chainId) != 0) {
+ txData.chainId = "0x00";
+ }
+ const tx = index_js_1.Transaction.from(txData);
+ assert_1.default.equal(tx.unsignedSerialized, test.unsignedLegacy, "unsignedLegacy");
+ });
+ }
+ for (const test of tests) {
+ // Unsupported parameters for EIP-155; i.e. unspecified chain ID
+ if (!test.unsignedEip155) {
+ continue;
+ }
+ it(`serialized unsigned EIP-155 transaction: ${test.name}`, function () {
+ const txData = Object.assign({}, test.transaction, {
+ type: 0,
+ accessList: undefined,
+ maxFeePerGas: undefined,
+ maxPriorityFeePerGas: undefined
+ });
+ const tx = index_js_1.Transaction.from(txData);
+ assert_1.default.equal(tx.unsignedSerialized, test.unsignedEip155, "unsignedEip155");
+ });
+ }
+ for (const test of tests) {
+ it(`serialized unsigned Berlin transaction: ${test.name}`, function () {
+ const txData = Object.assign({}, test.transaction, {
+ type: 1,
+ maxFeePerGas: undefined,
+ maxPriorityFeePerGas: undefined
+ });
+ const tx = index_js_1.Transaction.from(txData);
+ assert_1.default.equal(tx.unsignedSerialized, test.unsignedBerlin, "unsignedBerlin");
+ });
+ }
+ for (const test of tests) {
+ it(`serialized unsigned London transaction: ${test.name}`, function () {
+ const txData = Object.assign({}, test.transaction, { type: 2 });
+ const tx = index_js_1.Transaction.from(txData);
+ assert_1.default.equal(tx.unsignedSerialized, test.unsignedLondon, "unsignedLondon");
+ });
+ }
+});
+describe("Tests Signed Transaction Serializing", function () {
+ const tests = (0, utils_js_1.loadTests)("transactions");
+ for (const test of tests) {
+ it(`serialized signed legacy transaction: ${test.name}`, function () {
+ const txData = Object.assign({}, test.transaction, {
+ type: 0,
+ accessList: undefined,
+ maxFeePerGas: undefined,
+ maxPriorityFeePerGas: undefined,
+ signature: test.signatureLegacy
+ });
+ // Use the testcase sans the chainId for a legacy test
+ if (txData.chainId != null && parseInt(txData.chainId) != 0) {
+ txData.chainId = "0x00";
+ }
+ const tx = index_js_1.Transaction.from(txData);
+ assert_1.default.equal(tx.serialized, test.signedLegacy, "signedLegacy");
+ });
+ }
+ for (const test of tests) {
+ if (!test.unsignedEip155) {
+ continue;
+ }
+ it(`serialized signed EIP-155 transaction: ${test.name}`, function () {
+ const txData = Object.assign({}, test.transaction, {
+ type: 0,
+ accessList: undefined,
+ maxFeePerGas: undefined,
+ maxPriorityFeePerGas: undefined,
+ signature: test.signatureEip155
+ });
+ const tx = index_js_1.Transaction.from(txData);
+ assert_1.default.equal(tx.serialized, test.signedEip155, "signedEip155");
+ });
+ }
+ for (const test of tests) {
+ it(`serialized signed Berlin transaction: ${test.name}`, function () {
+ const txData = Object.assign({}, test.transaction, {
+ type: 1,
+ maxFeePerGas: undefined,
+ maxPriorityFeePerGas: undefined
+ }, { signature: test.signatureBerlin });
+ const tx = index_js_1.Transaction.from(txData);
+ assert_1.default.equal(tx.serialized, test.signedBerlin, "signedBerlin");
+ });
+ }
+ for (const test of tests) {
+ it(`serialized signed London transaction: ${test.name}`, function () {
+ const txData = Object.assign({}, test.transaction, {
+ type: 2,
+ signature: test.signatureLondon
+ });
+ const tx = index_js_1.Transaction.from(txData);
+ assert_1.default.equal(tx.serialized, test.signedLondon, "signedLondon");
+ });
+ }
+});
+function assertTxUint(actual, _expected, name) {
+ const expected = (_expected != null ? BigInt(_expected) : null);
+ assert_1.default.equal(actual, expected, name);
+}
+function assertTxEqual(actual, expected) {
+ assert_1.default.equal(actual.to, expected.to, "to");
+ assert_1.default.equal(actual.nonce, expected.nonce, "nonce");
+ assertTxUint(actual.gasLimit, expected.gasLimit, "gasLimit");
+ assertTxUint(actual.gasPrice, expected.gasPrice, "gasPrice");
+ assertTxUint(actual.maxFeePerGas, expected.maxFeePerGas, "maxFeePerGas");
+ assertTxUint(actual.maxPriorityFeePerGas, expected.maxPriorityFeePerGas, "maxPriorityFeePerGas");
+ assert_1.default.equal(actual.data, expected.data, "data");
+ assertTxUint(actual.value, expected.value, "value");
+ if (expected.accessList) {
+ assert_1.default.equal(JSON.stringify(actual.accessList), JSON.stringify(expected.accessList), "accessList");
+ }
+ else {
+ assert_1.default.equal(actual.accessList, null, "accessList:!null");
+ }
+ assertTxUint(actual.chainId, expected.chainId, "chainId");
+}
+function addDefault(tx, key, defaultValue) {
+ if (tx[key] == null) {
+ tx[key] = defaultValue;
+ }
+}
+function addDefaults(tx) {
+ tx = Object.assign({}, tx);
+ addDefault(tx, "nonce", 0);
+ addDefault(tx, "gasLimit", BN_0);
+ addDefault(tx, "gasPrice", BN_0);
+ addDefault(tx, "maxFeePerGas", BN_0);
+ addDefault(tx, "maxPriorityFeePerGas", BN_0);
+ addDefault(tx, "value", BN_0);
+ addDefault(tx, "data", "0x");
+ addDefault(tx, "accessList", []);
+ addDefault(tx, "chainId", BN_0);
+ return tx;
+}
+describe("Tests Unsigned Transaction Parsing", function () {
+ const tests = (0, utils_js_1.loadTests)("transactions");
+ for (const test of tests) {
+ it(`parses unsigned legacy transaction: ${test.name}`, function () {
+ const tx = index_js_1.Transaction.from(test.unsignedLegacy);
+ const expected = addDefaults(test.transaction);
+ expected.maxFeePerGas = null;
+ expected.maxPriorityFeePerGas = null;
+ expected.accessList = null;
+ expected.chainId = BN_0;
+ assertTxEqual(tx, expected);
+ });
+ }
+ for (const test of tests) {
+ if (!test.unsignedEip155) {
+ continue;
+ }
+ it(`parses unsigned EIP-155 transaction: ${test.name}`, function () {
+ const tx = index_js_1.Transaction.from(test.unsignedEip155);
+ const expected = addDefaults(test.transaction);
+ expected.maxFeePerGas = null;
+ expected.maxPriorityFeePerGas = null;
+ expected.accessList = null;
+ assertTxEqual(tx, expected);
+ });
+ }
+ for (const test of tests) {
+ it(`parses unsigned Berlin transaction: ${test.name}`, function () {
+ const tx = index_js_1.Transaction.from(test.unsignedBerlin);
+ const expected = addDefaults(test.transaction);
+ expected.maxFeePerGas = null;
+ expected.maxPriorityFeePerGas = null;
+ assertTxEqual(tx, expected);
+ });
+ }
+ for (const test of tests) {
+ it(`parses unsigned London transaction: ${test.name}`, function () {
+ const tx = index_js_1.Transaction.from(test.unsignedLondon);
+ const expected = addDefaults(test.transaction);
+ expected.gasPrice = null;
+ assertTxEqual(tx, expected);
+ });
+ }
+});
+describe("Tests Signed Transaction Parsing", function () {
+ const tests = (0, utils_js_1.loadTests)("transactions");
+ for (const test of tests) {
+ it(`parses signed legacy transaction: ${test.name}`, function () {
+ let tx = index_js_1.Transaction.from(test.signedLegacy);
+ const expected = addDefaults(test.transaction);
+ expected.maxFeePerGas = null;
+ expected.maxPriorityFeePerGas = null;
+ expected.accessList = null;
+ expected.chainId = BN_0;
+ for (let i = 0; i < 2; i++) {
+ assertTxEqual(tx, expected);
+ assert_1.default.equal(tx.typeName, "legacy", "typeName");
+ assert_1.default.equal(tx.isLegacy(), true, "isLegacy");
+ assert_1.default.equal(tx.isBerlin(), false, "isBerlin");
+ assert_1.default.equal(tx.isLondon(), false, "isLondon");
+ assert_1.default.ok(!!tx.signature, "signature:!null");
+ assert_1.default.equal(tx.signature.r, test.signatureLegacy.r, "signature.r");
+ assert_1.default.equal(tx.signature.s, test.signatureLegacy.s, "signature.s");
+ assert_1.default.equal(BigInt(tx.signature.v), BigInt(test.signatureLegacy.v), "signature.v");
+ tx = tx.clone();
+ }
+ });
+ }
+ for (const test of tests) {
+ if (!test.unsignedEip155) {
+ continue;
+ }
+ it(`parses signed EIP-155 transaction: ${test.name}`, function () {
+ let tx = index_js_1.Transaction.from(test.signedEip155);
+ const expected = addDefaults(test.transaction);
+ expected.maxFeePerGas = null;
+ expected.maxPriorityFeePerGas = null;
+ expected.accessList = null;
+ for (let i = 0; i < 2; i++) {
+ assertTxEqual(tx, expected);
+ assert_1.default.equal(tx.typeName, "legacy", "typeName");
+ assert_1.default.equal(tx.isLegacy(), true, "isLegacy");
+ assert_1.default.equal(tx.isBerlin(), false, "isBerlin");
+ assert_1.default.equal(tx.isLondon(), false, "isLondon");
+ assert_1.default.ok(!!tx.signature, "signature:!null");
+ assert_1.default.equal(tx.signature.r, test.signatureEip155.r, "signature.r");
+ assert_1.default.equal(tx.signature.s, test.signatureEip155.s, "signature.s");
+ assert_1.default.equal(tx.signature.networkV, BigInt(test.signatureEip155.v), "signature.v");
+ tx = tx.clone();
+ }
+ });
+ }
+ for (const test of tests) {
+ it(`parses signed Berlin transaction: ${test.name}`, function () {
+ let tx = index_js_1.Transaction.from(test.signedBerlin);
+ const expected = addDefaults(test.transaction);
+ expected.maxFeePerGas = null;
+ expected.maxPriorityFeePerGas = null;
+ for (let i = 0; i < 2; i++) {
+ assertTxEqual(tx, expected);
+ assert_1.default.equal(tx.typeName, "eip-2930", "typeName");
+ assert_1.default.equal(tx.isLegacy(), false, "isLegacy");
+ assert_1.default.equal(tx.isBerlin(), true, "isBerlin");
+ assert_1.default.equal(tx.isLondon(), false, "isLondon");
+ assert_1.default.ok(!!tx.signature, "signature:!null");
+ assert_1.default.equal(tx.signature.r, test.signatureBerlin.r, "signature.r");
+ assert_1.default.equal(tx.signature.s, test.signatureBerlin.s, "signature.s");
+ assert_1.default.equal(tx.signature.yParity, parseInt(test.signatureBerlin.v), "signature.v");
+ tx = tx.clone();
+ }
+ });
+ }
+ for (const test of tests) {
+ it(`parses signed London transaction: ${test.name}`, function () {
+ let tx = index_js_1.Transaction.from(test.signedLondon);
+ const expected = addDefaults(test.transaction);
+ expected.gasPrice = null;
+ for (let i = 0; i < 2; i++) {
+ assertTxEqual(tx, expected);
+ assert_1.default.equal(tx.typeName, "eip-1559", "typeName");
+ assert_1.default.equal(tx.isLegacy(), false, "isLegacy");
+ assert_1.default.equal(tx.isBerlin(), false, "isBerlin");
+ assert_1.default.equal(tx.isLondon(), true, "isLondon");
+ assert_1.default.ok(!!tx.signature, "signature:!null");
+ assert_1.default.equal(tx.signature.r, test.signatureLondon.r, "signature.r");
+ assert_1.default.equal(tx.signature.s, test.signatureLondon.s, "signature.s");
+ assert_1.default.equal(tx.signature.yParity, parseInt(test.signatureLondon.v), "signature.v");
+ // Test cloning
+ tx = tx.clone();
+ }
+ });
+ }
+});
+describe("Tests Transaction Parameters", function () {
+ const badData = [
+ {
+ name: "accessList=0x09",
+ data: "0x02c9010203040580070809",
+ message: "invalid access list",
+ argument: "accessList"
+ },
+ {
+ name: "accessList=[0x09]",
+ data: "0x02ca0102030405800708c109",
+ message: "invalid address-slot set",
+ argument: "accessList"
+ },
+ {
+ name: "accessList=[0x09,0x10]",
+ data: "0x02cb0102030405800708c20910",
+ message: "invalid address-slot set",
+ argument: "accessList"
+ },
+ {
+ name: "accessList=[0x09,[HASH]] (bad address)",
+ data: "0x02ed0102030405800708e4e309e1a024412927c99a717115f5308c0ebd11136659b3cb6291abb4a8f87e9856a12538",
+ message: "invalid address",
+ argument: "accessList"
+ },
+ {
+ name: "accessList=[ADDR,[0x09]] (bad slot)",
+ data: "0x02e10102030405800708d8d794939d33ff01840e9eeeb67525ec2f7035af41a4b1c109",
+ message: "invalid slot",
+ argument: "accessList"
+ }
+ ];
+ for (const { name, data, argument, message } of badData) {
+ it(`correctly fails on bad accessList: ${name}`, function () {
+ assert_1.default.throws(() => {
+ // The access list is a single value: 0x09 instead of
+ // structured data
+ const result = index_js_1.Transaction.from(data);
+ console.log(result);
+ }, (error) => {
+ return ((0, index_js_1.isError)(error, "INVALID_ARGUMENT") &&
+ error.argument === argument &&
+ (message == null || error.message.startsWith(message)));
+ });
+ });
+ }
+});
+//# sourceMappingURL=test-transaction.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-transaction.js.map b/dist/ethers.js/src.ts/_tests/test-transaction.js.map
new file mode 100644
index 0000000..0c0e5c1
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-transaction.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-transaction.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-transaction.ts"],"names":[],"mappings":";;;;;AAAA,oDAA4B;AAC5B,yCAAuC;AAIvC,0CAAmD;AAGnD,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAEvB,QAAQ,CAAC,wCAAwC,EAAE;IAC/C,MAAM,KAAK,GAAG,IAAA,oBAAS,EAAsB,cAAc,CAAC,CAAC;IAE7D,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACtB,EAAE,CAAC,2CAA4C,IAAI,CAAC,IAAK,EAAE,EAAE;YACzD,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,EAAG,EAAE,IAAI,CAAC,WAAW,EAAE;gBAChD,IAAI,EAAE,CAAC;gBACP,UAAU,EAAE,SAAS;gBACrB,YAAY,EAAE,SAAS;gBACvB,oBAAoB,EAAE,SAAS;aAClC,CAAC,CAAC;YAEH,sDAAsD;YACtD,IAAI,MAAM,CAAC,OAAO,IAAI,IAAI,IAAI,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;gBAAE,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC;aAAE;YAEzF,MAAM,EAAE,GAAG,sBAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACpC,gBAAM,CAAC,KAAK,CAAC,EAAE,CAAC,kBAAkB,EAAE,IAAI,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC;QAC/E,CAAC,CAAC,CAAC;KACN;IAED,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACtB,gEAAgE;QAChE,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE;YAAE,SAAS;SAAE;QACvC,EAAE,CAAC,4CAA6C,IAAI,CAAC,IAAK,EAAE,EAAE;YAC1D,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,EAAG,EA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AC,GAAG,CAAC,MAAM,CAAC,CAAC;YACxB,CAAC,EAAE,CAAC,KAAU,EAAE,EAAE;gBACd,OAAO,CAAC,IAAA,kBAAO,EAAC,KAAK,EAAE,kBAAkB,CAAC;oBACtC,KAAK,CAAC,QAAQ,KAAK,QAAQ;oBAC3B,CAAC,OAAO,IAAI,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YAChE,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;KAEN;AACL,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-utils-maths.d.ts b/dist/ethers.js/src.ts/_tests/test-utils-maths.d.ts
new file mode 100644
index 0000000..af3deca
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-utils-maths.d.ts
@@ -0,0 +1,2 @@
+export {};
+//# sourceMappingURL=test-utils-maths.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-utils-maths.d.ts.map b/dist/ethers.js/src.ts/_tests/test-utils-maths.d.ts.map
new file mode 100644
index 0000000..a065106
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-utils-maths.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-utils-maths.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-utils-maths.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-utils-maths.js b/dist/ethers.js/src.ts/_tests/test-utils-maths.js
new file mode 100644
index 0000000..9be8765
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-utils-maths.js
@@ -0,0 +1,194 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const assert_1 = __importDefault(require("assert"));
+const index_js_1 = require("../index.js");
+describe("Tests Quantity Functions", function () {
+ const quantities = [
+ {
+ name: "zero number",
+ value: 0,
+ expected: "0x0"
+ },
+ {
+ name: "zero single hex",
+ value: "0x0",
+ expected: "0x0"
+ },
+ {
+ name: "zero double hex",
+ value: "0x00",
+ expected: "0x0"
+ },
+ {
+ name: "zero array(0)",
+ value: new Uint8Array([]),
+ expected: "0x0"
+ },
+ {
+ name: "zero array(1)",
+ value: new Uint8Array([0]),
+ expected: "0x0"
+ },
+ {
+ name: "single hex digit",
+ value: 0x5,
+ expected: "0x5"
+ },
+ {
+ name: "double hex digit",
+ value: 0x42,
+ expected: "0x42"
+ },
+ {
+ name: "big array, odd output",
+ value: new Uint8Array([0x0f, 254, 253, 252]),
+ expected: "0xffefdfc"
+ },
+ {
+ name: "big array, even output",
+ value: new Uint8Array([255, 254, 253, 252]),
+ expected: "0xfffefdfc"
+ },
+ ];
+ for (const { name, value, expected } of quantities) {
+ it(`computes quantity: ${name}`, function () {
+ assert_1.default.equal((0, index_js_1.toQuantity)(value), expected);
+ });
+ }
+});
+describe("Tests Bad Math Values", function () {
+ const badBigInts = [
+ {
+ name: "empty string",
+ value: "",
+ error: "invalid BigNumberish string"
+ },
+ {
+ name: "non-numeric string",
+ value: "foobar",
+ error: "invalid BigNumberish string"
+ },
+ {
+ name: "double negative sign",
+ value: "--42",
+ error: "invalid BigNumberish string"
+ },
+ {
+ name: "non-numeric thing",
+ value: true,
+ error: "invalid BigNumberish value"
+ },
+ ];
+ for (const { name, value, error } of badBigInts) {
+ it(`correctly fails on bad bigint: ${name}`, function () {
+ assert_1.default.throws(() => {
+ const result = (0, index_js_1.getBigInt)(value);
+ console.log(result);
+ }, (e) => {
+ return ((0, index_js_1.isError)(e, "INVALID_ARGUMENT") &&
+ e.message.startsWith(error));
+ });
+ });
+ }
+ const badNumbers = [
+ {
+ name: "empty string",
+ value: "",
+ error: "invalid numeric string"
+ },
+ {
+ name: "non-numeric string",
+ value: "foobar",
+ error: "invalid numeric string"
+ },
+ {
+ name: "double negative sign",
+ value: "--42",
+ error: "invalid numeric string"
+ },
+ {
+ name: "non-numeric thing",
+ value: true,
+ error: "invalid numeric value"
+ },
+ {
+ name: "too big",
+ value: Number.MAX_SAFE_INTEGER + 10,
+ error: "overflow"
+ },
+ {
+ name: "too small",
+ value: -Number.MAX_SAFE_INTEGER - 10,
+ error: "overflow"
+ },
+ ];
+ for (const { name, value, error } of badNumbers) {
+ it(`correctly fails on bad numeric: ${name}`, function () {
+ assert_1.default.throws(() => {
+ const result = (0, index_js_1.getNumber)(value);
+ console.log(result);
+ }, (e) => {
+ return ((0, index_js_1.isError)(e, "INVALID_ARGUMENT") &&
+ e.message.startsWith(error));
+ });
+ });
+ }
+ const badHex = [
+ {
+ name: "negative value",
+ value: -4,
+ error: "unsigned value cannot be negative"
+ },
+ {
+ name: "width too short",
+ value: 0x123456,
+ width: 2,
+ error: "value exceeds width"
+ },
+ ];
+ for (const { name, value, error, width } of badHex) {
+ it(`correctly fails on bad toBeHex values: ${name}`, function () {
+ assert_1.default.throws(() => {
+ const result = (0, index_js_1.toBeHex)(value, width);
+ console.log(result);
+ }, (e) => {
+ return ((0, index_js_1.isError)(e, "NUMERIC_FAULT") && e.fault === "overflow" &&
+ e.message.startsWith(error));
+ });
+ });
+ }
+ it(`correctly fails on nad toBeArray values: negative value`, function () {
+ assert_1.default.throws(() => {
+ const result = (0, index_js_1.toBeArray)(-4);
+ console.log(result);
+ }, (e) => {
+ return ((0, index_js_1.isError)(e, "NUMERIC_FAULT") && e.fault === "overflow" &&
+ e.message.startsWith("unsigned value cannot be negative"));
+ });
+ });
+});
+describe("Tests Twos Compliemnts Functions", function () {
+ const tests = [
+ { width: 8, value: 0, twos: 0 },
+ { width: 8, value: 1, twos: 1 },
+ { width: 8, value: -1, twos: 0xff },
+ { width: 8, value: 127, twos: 127 },
+ { width: 8, value: -128, twos: 0x80 },
+ ];
+ for (const { twos, width, value } of tests) {
+ it(`computes twos compliment values: ${value}[${width} bits]`, function () {
+ const result = (0, index_js_1.toTwos)(value, width);
+ assert_1.default.equal(result, twos);
+ });
+ }
+ for (const { twos, width, value } of tests) {
+ it(`computes values from twos compliment: ${value}[${width} bits]`, function () {
+ const result = (0, index_js_1.fromTwos)(twos, width);
+ assert_1.default.equal(result, value);
+ });
+ }
+});
+//# sourceMappingURL=test-utils-maths.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-utils-maths.js.map b/dist/ethers.js/src.ts/_tests/test-utils-maths.js.map
new file mode 100644
index 0000000..fed09b9
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-utils-maths.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-utils-maths.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-utils-maths.ts"],"names":[],"mappings":";;;;;AAAA,oDAA4B;AAE5B,0CAIqB;AAErB,QAAQ,CAAC,0BAA0B,EAAE;IACjC,MAAM,UAAU,GAA0D;QACtE;YACI,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,CAAC;YACR,QAAQ,EAAE,KAAK;SAClB;QACD;YACI,IAAI,EAAE,iBAAiB;YACvB,KAAK,EAAE,KAAK;YACZ,QAAQ,EAAE,KAAK;SAClB;QACD;YACI,IAAI,EAAE,iBAAiB;YACvB,KAAK,EAAE,MAAM;YACb,QAAQ,EAAE,KAAK;SAClB;QACD;YACI,IAAI,EAAE,eAAe;YACrB,KAAK,EAAE,IAAI,UAAU,CAAC,EAAG,CAAC;YAC1B,QAAQ,EAAE,KAAK;SAClB;QACD;YACI,IAAI,EAAE,eAAe;YACrB,KAAK,EAAE,IAAI,UAAU,CAAC,CAAE,CAAC,CAAE,CAAC;YAC5B,QAAQ,EAAE,KAAK;SAClB;QACD;YACI,IAAI,EAAE,kBAAkB;YACxB,KAAK,EAAE,GAAG;YACV,QAAQ,EAAE,KAAK;SAClB;QACD;YACI,IAAI,EAAE,kBAAkB;YACxB,KAAK,EAAE,IAAI;YACX,QAAQ,EAAE,MAAM;SACnB;QACD;YACI,I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C,MAAM,EAAE,KAAK,CAAC,CAAC;QAChC,CAAC,CAAC,CAAC;KACN;AACL,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-utils-misc.d.ts b/dist/ethers.js/src.ts/_tests/test-utils-misc.d.ts
new file mode 100644
index 0000000..db71352
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-utils-misc.d.ts
@@ -0,0 +1,2 @@
+export {};
+//# sourceMappingURL=test-utils-misc.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-utils-misc.d.ts.map b/dist/ethers.js/src.ts/_tests/test-utils-misc.d.ts.map
new file mode 100644
index 0000000..c260b20
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-utils-misc.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-utils-misc.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-utils-misc.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-utils-misc.js b/dist/ethers.js/src.ts/_tests/test-utils-misc.js
new file mode 100644
index 0000000..c479320
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-utils-misc.js
@@ -0,0 +1,67 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const assert_1 = __importDefault(require("assert"));
+const index_js_1 = require("../index.js");
+describe("Base64 Coding", function () {
+ const tests = [
+ {
+ name: "wikipedia",
+ plaintext: (0, index_js_1.toUtf8Bytes)("Many hands make light work."),
+ encoded: "TWFueSBoYW5kcyBtYWtlIGxpZ2h0IHdvcmsu"
+ }
+ ];
+ for (const test of tests) {
+ it(`encodes base64: ${test.name}`, function () {
+ assert_1.default.equal((0, index_js_1.encodeBase64)(test.plaintext), test.encoded);
+ });
+ }
+ for (const test of tests) {
+ it(`decodes base64: ${test.name}`, function () {
+ const decoded = (0, index_js_1.decodeBase64)(test.encoded);
+ assert_1.default.equal(decoded.length, test.plaintext.length, "data.length");
+ for (let i = 0; i < decoded.length; i++) {
+ assert_1.default.equal(decoded[i], test.plaintext[i]);
+ }
+ });
+ }
+});
+describe("Test Minor Features", function () {
+ it("checks types in defineProperties", function () {
+ const any = {};
+ const values = {
+ vAny: any,
+ vBigint: BigInt(60),
+ vBoolean: true,
+ vNumber: 42,
+ vString: "some string",
+ };
+ const item = {};
+ (0, index_js_1.defineProperties)(item, values, {
+ vAny: "any",
+ vBigint: "bigint",
+ vBoolean: "boolean",
+ vNumber: "number",
+ vString: "string"
+ });
+ assert_1.default.equal(item.vAny, any, "vAny");
+ assert_1.default.equal(item.vBoolean, true, "vBoolenay");
+ assert_1.default.equal(item.vNumber, 42, "nNumber");
+ assert_1.default.equal(item.vString, "some string", "any");
+ });
+ it("correctly throws if defineProperty type mismatch", function () {
+ assert_1.default.throws(() => {
+ const item = {};
+ const values = { vBoolean: 42 };
+ (0, index_js_1.defineProperties)(item, values, { vBoolean: "boolean" });
+ console.log(values);
+ }, (error) => {
+ return ((0, index_js_1.isError)(error, "INVALID_ARGUMENT") &&
+ error.argument === "value.vBoolean" &&
+ error.value === 42);
+ });
+ });
+});
+//# sourceMappingURL=test-utils-misc.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-utils-misc.js.map b/dist/ethers.js/src.ts/_tests/test-utils-misc.js.map
new file mode 100644
index 0000000..f8f7590
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-utils-misc.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-utils-misc.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-utils-misc.ts"],"names":[],"mappings":";;;;;AAAA,oDAA4B;AAE5B,0CAIqB;AAGrB,QAAQ,CAAC,eAAe,EAAE;IACtB,MAAM,KAAK,GAAG;QACV;YACI,IAAI,EAAE,WAAW;YACjB,SAAS,EAAE,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B,IAAI,EAAE,KAAK;YACX,OAAO,EAAE,QAAQ;YACjB,QAAQ,EAAE,SAAS;YACnB,OAAO,EAAE,QAAQ;YACjB,OAAO,EAAE,QAAQ;SACpB,CAAC,CAAC;QAEH,gBAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QACrC,gBAAM,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;QAC/C,gBAAM,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,EAAE,SAAS,CAAC,CAAC;QAC1C,gBAAM,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kDAAkD,EAAE;QACnD,gBAAM,CAAC,MAAM,CAAC,GAAG,EAAE;YACf,MAAM,IAAI,GAAQ,EAAG,CAAC;YAEtB,MAAM,MAAM,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;YAChC,IAAA,2BAAgB,EAAC,IAAI,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC;YAExD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACxB,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE;YACT,OAAO,CAAC,IAAA,kBAAO,EAAC,KAAK,EAAE,kBAAkB,CAAC;gBACtC,KAAK,CAAC,QAAQ,KAAK,gBAAgB;gBACnC,KAAK,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC;QAC5B,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-utils-units.d.ts b/dist/ethers.js/src.ts/_tests/test-utils-units.d.ts
new file mode 100644
index 0000000..989039c
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-utils-units.d.ts
@@ -0,0 +1,2 @@
+export {};
+//# sourceMappingURL=test-utils-units.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-utils-units.d.ts.map b/dist/ethers.js/src.ts/_tests/test-utils-units.d.ts.map
new file mode 100644
index 0000000..6e3c998
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-utils-units.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-utils-units.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-utils-units.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-utils-units.js b/dist/ethers.js/src.ts/_tests/test-utils-units.js
new file mode 100644
index 0000000..6be8c4e
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-utils-units.js
@@ -0,0 +1,68 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const assert_1 = __importDefault(require("assert"));
+const utils_js_1 = require("./utils.js");
+const index_js_1 = require("../index.js");
+describe("Tests unit conversion", function () {
+ const tests = (0, utils_js_1.loadTests)("units");
+ const units = [
+ { unit: "ether", format: "ether_format", decimals: 18 },
+ { unit: "kwei", format: "kwei_format", decimals: 3 },
+ { unit: "mwei", format: "mwei_format", decimals: 6 },
+ { unit: "gwei", format: "gwei_format", decimals: 9 },
+ { unit: "szabo", format: "szabo_format", decimals: 12 },
+ { unit: "finney", format: "finney_format", decimals: 15 },
+ ];
+ for (const { unit, format, decimals } of units) {
+ for (const test of tests) {
+ const str = (test[format]);
+ if (str == null) {
+ continue;
+ }
+ it(`converts wei to ${unit} string: ${test.name}`, function () {
+ const wei = BigInt(test.wei);
+ if (decimals === 18) {
+ assert_1.default.equal((0, index_js_1.formatEther)(wei), str, "formatEther");
+ assert_1.default.equal((0, index_js_1.formatUnits)(wei), str, "formatUnits");
+ }
+ assert_1.default.equal((0, index_js_1.formatUnits)(wei, unit), str, `formatUnits(${unit})`);
+ assert_1.default.equal((0, index_js_1.formatUnits)(wei, decimals), str, `formatUnits(${decimals})`);
+ });
+ }
+ for (const test of tests) {
+ const str = (test[format]);
+ if (str == null) {
+ continue;
+ }
+ it(`converts ${format} string to wei: ${test.name}`, function () {
+ const wei = BigInt(test.wei);
+ if (decimals === 18) {
+ assert_1.default.equal((0, index_js_1.parseEther)(str), wei, "parseEther");
+ assert_1.default.equal((0, index_js_1.parseUnits)(str), wei, "parseUnits");
+ }
+ assert_1.default.equal((0, index_js_1.parseUnits)(str, unit), wei, `parseUnits(${unit})`);
+ assert_1.default.equal((0, index_js_1.parseUnits)(str, decimals), wei, `parseUnits(${decimals})`);
+ });
+ }
+ }
+});
+describe("Tests bad unit conversion", function () {
+ it("correctly fails to convert non-string value", function () {
+ assert_1.default.throws(() => {
+ (0, index_js_1.parseUnits)(3, "ether");
+ }, (error) => {
+ return error.message.startsWith("value must be a string");
+ });
+ });
+ it("correctly fails to convert unknown unit", function () {
+ assert_1.default.throws(() => {
+ (0, index_js_1.parseUnits)("3", "foobar");
+ }, (error) => {
+ return error.message.startsWith("invalid unit");
+ });
+ });
+});
+//# sourceMappingURL=test-utils-units.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-utils-units.js.map b/dist/ethers.js/src.ts/_tests/test-utils-units.js.map
new file mode 100644
index 0000000..d431bf3
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-utils-units.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-utils-units.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-utils-units.ts"],"names":[],"mappings":";;;;;AAAA,oDAA4B;AAE5B,yCAAuC;AAEvC,0CAA+E;AAK/E,QAAQ,CAAC,uBAAuB,EAAE;IAC9B,MAAM,KAAK,GAAG,IAAA,oBAAS,EAAe,OAAO,CAAC,CAAC;IAE/C,MAAM,K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;QAChC,CAAC,EAAE,CAAC,KAAU,EAAE,EAAE;YACd,OAAO,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,wBAAwB,CAAC,CAAC;QAC9D,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yCAAyC,EAAE;QAC1C,gBAAM,CAAC,MAAM,CAAC,GAAG,EAAE;YACf,IAAA,qBAAU,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QAC9B,CAAC,EAAE,CAAC,KAAU,EAAE,EAAE;YACd,OAAO,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-utils-utf8.d.ts b/dist/ethers.js/src.ts/_tests/test-utils-utf8.d.ts
new file mode 100644
index 0000000..04d7c49
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-utils-utf8.d.ts
@@ -0,0 +1,13 @@
+export type TestCaseBadString = {
+ name: string;
+ bytes: Uint8Array;
+ ignore: string;
+ replace: string;
+ error: string;
+};
+export type TestCaseCodePoints = {
+ name: string;
+ text: string;
+ codepoints: Array;
+};
+//# sourceMappingURL=test-utils-utf8.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-utils-utf8.d.ts.map b/dist/ethers.js/src.ts/_tests/test-utils-utf8.d.ts.map
new file mode 100644
index 0000000..8578b27
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-utils-utf8.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-utils-utf8.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-utils-utf8.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,iBAAiB,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,UAAU,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAA;CAChB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CAC7B,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-utils-utf8.js b/dist/ethers.js/src.ts/_tests/test-utils-utf8.js
new file mode 100644
index 0000000..fa58749
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-utils-utf8.js
@@ -0,0 +1,131 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const assert_1 = __importDefault(require("assert"));
+const index_js_1 = require("../index.js");
+describe("Tests UTF-8 bad strings", function () {
+ const tests = [
+ {
+ name: "unexpected continue",
+ bytes: new Uint8Array([0x41, 0x80, 0x42, 0x43]),
+ ignore: "ABC",
+ replace: "A\ufffdBC",
+ error: "UNEXPECTED_CONTINUE"
+ },
+ {
+ name: "bad prefix",
+ bytes: new Uint8Array([0x41, 0xf8, 0x42, 0x43]),
+ ignore: "ABC",
+ replace: "A\ufffdBC",
+ error: "BAD_PREFIX"
+ },
+ {
+ name: "bad prefix (multiple)",
+ bytes: new Uint8Array([0x41, 0xf8, 0x88, 0x88, 0x42, 0x43]),
+ ignore: "ABC",
+ replace: "A\ufffdBC",
+ error: "BAD_PREFIX"
+ },
+ {
+ name: "OVERRUN",
+ bytes: new Uint8Array([0x41, 0x42, 0xe2, 0x82 /* 0xac */]),
+ ignore: "AB",
+ replace: "AB\ufffd",
+ error: "OVERRUN"
+ },
+ {
+ name: "missing continue",
+ bytes: new Uint8Array([0x41, 0x42, 0xe2, 0xe2, 0x82, 0xac, 0x43]),
+ ignore: "AB\u20acC",
+ replace: "AB\ufffd\u20acC",
+ error: "MISSING_CONTINUE"
+ },
+ {
+ name: "out-of-range",
+ bytes: new Uint8Array([0x41, 0x42, 0xf7, 0xbf, 0xbf, 0xbf, 0x43]),
+ ignore: "ABC",
+ replace: "AB\ufffdC",
+ error: "OUT_OF_RANGE"
+ },
+ {
+ name: "UTF-16 surrogate (low)",
+ bytes: new Uint8Array([0x41, 0x42, 0xed, 0xa0, 0x80, 0x43]),
+ ignore: "ABC",
+ replace: "AB\ufffdC",
+ error: "UTF16_SURROGATE"
+ },
+ {
+ name: "UTF-16 surrogate (high)",
+ bytes: new Uint8Array([0x41, 0x42, 0xed, 0xbf, 0xbf, 0x43]),
+ ignore: "ABC",
+ replace: "AB\ufffdC",
+ error: "UTF16_SURROGATE"
+ },
+ {
+ name: "overlong",
+ bytes: new Uint8Array([0xf0, 0x82, 0x82, 0xac]),
+ ignore: "",
+ replace: "\u20ac",
+ error: "OVERLONG"
+ }
+ ];
+ for (const { name, bytes, ignore, replace, error } of tests) {
+ it(`correctly handles ${name}: replace strategy`, function () {
+ const result = (0, index_js_1.toUtf8String)(bytes, index_js_1.Utf8ErrorFuncs.replace);
+ assert_1.default.equal(result, replace);
+ });
+ it(`correctly handles ${name}: ignore strategy`, function () {
+ const result = (0, index_js_1.toUtf8String)(bytes, index_js_1.Utf8ErrorFuncs.ignore);
+ assert_1.default.equal(result, ignore);
+ });
+ it(`correctly handles ${name}: error strategy`, function () {
+ assert_1.default.throws(() => {
+ const result = (0, index_js_1.toUtf8String)(bytes);
+ console.log(result);
+ }, (e) => {
+ return (e.message.indexOf(error) >= 0);
+ });
+ });
+ }
+ it("correctly fails to get UTF-8 bytes from incomplete surrogate", function () {
+ assert_1.default.throws(() => {
+ const text = String.fromCharCode(0xd800);
+ ;
+ const result = (0, index_js_1.toUtf8Bytes)(text);
+ console.log(result);
+ }, (error) => {
+ return (error.message.startsWith("invalid surrogate pair"));
+ });
+ });
+ it("correctly fails to get UTF-8 bytes from invalid surrogate pair", function () {
+ assert_1.default.throws(() => {
+ const text = String.fromCharCode(0xd800, 0xdbff);
+ ;
+ const result = (0, index_js_1.toUtf8Bytes)(text);
+ console.log(result);
+ }, (error) => {
+ return (error.message.startsWith("invalid surrogate pair"));
+ });
+ });
+});
+describe("Tests UTF-8 bad strings", function () {
+ const tests = [
+ {
+ name: "the Euro symbol",
+ text: "AB\u20acC",
+ codepoints: [0x41, 0x42, 0x20ac, 0x43]
+ },
+ ];
+ for (const { name, text, codepoints } of tests) {
+ it(`expands strings to codepoints: ${name}`, function () {
+ const result = (0, index_js_1.toUtf8CodePoints)(text);
+ assert_1.default.equal(result.length, codepoints.length, "codepoints.length");
+ for (let i = 0; i < result.length; i++) {
+ assert_1.default.equal(result[i], codepoints[i], `codepoints[${i}]`);
+ }
+ });
+ }
+});
+//# sourceMappingURL=test-utils-utf8.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-utils-utf8.js.map b/dist/ethers.js/src.ts/_tests/test-utils-utf8.js.map
new file mode 100644
index 0000000..ce244fe
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-utils-utf8.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-utils-utf8.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-utils-utf8.ts"],"names":[],"mappings":";;;;;AAAA,oDAA4B;AAE5B,0CAGqB;AAgBrB,QAAQ,CAAC,yBAAyB,EAAE;IAEhC,MAAM,KAAK,GAA6B;QACpC;YACI,IAAI,EAAE,qBAAqB;YAC3B,KAAK,EAAE,IAAI,UAAU,CAAC,CAAE,IAAI,EAAG,IAAI,EAAG,IAAI,EAAG,IAAI,CAAE,CAAC;YACpD,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,WAAW;YACpB,KAAK,EAAE,qBAAqB;SAC/B;QACD;YACI,IAAI,EAAE,YAAY;YAClB,KAAK,EAAE,IAAI,UAAU,CAAC,CAAE,IAAI,EAAG,IAAI,EAAG,IAAI,EAAG,IAAI,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AAE,IAAI,CAAE;SAC3C;KACJ,CAAC;IAEF,KAAK,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,KAAK,EAAE;QAC5C,EAAE,CAAC,kCAAmC,IAAK,EAAE,EAAE;YAC3C,MAAM,MAAM,GAAG,IAAA,2BAAgB,EAAC,IAAI,CAAC,CAAC;YACtC,gBAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;YACpE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBACpC,gBAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,cAAe,CAAE,GAAG,CAAC,CAAC;aAChE;QACL,CAAC,CAAC,CAAC;KACN;AAEL,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-wallet-hd.d.ts b/dist/ethers.js/src.ts/_tests/test-wallet-hd.d.ts
new file mode 100644
index 0000000..da7ceeb
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-wallet-hd.d.ts
@@ -0,0 +1,2 @@
+export {};
+//# sourceMappingURL=test-wallet-hd.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-wallet-hd.d.ts.map b/dist/ethers.js/src.ts/_tests/test-wallet-hd.d.ts.map
new file mode 100644
index 0000000..b5e0927
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-wallet-hd.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-wallet-hd.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-wallet-hd.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-wallet-hd.js b/dist/ethers.js/src.ts/_tests/test-wallet-hd.js
new file mode 100644
index 0000000..ac92c6d
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-wallet-hd.js
@@ -0,0 +1,124 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const assert_1 = __importDefault(require("assert"));
+const utils_js_1 = require("./utils.js");
+const index_js_1 = require("../index.js");
+const decoder = new TextDecoder();
+function fromHex(hex) {
+ const data = (0, index_js_1.getBytes)(hex);
+ return decoder.decode(data);
+}
+describe("Test HDWallets", function () {
+ function checkWallet(wallet, test) {
+ assert_1.default.equal(wallet.chainCode, test.chainCode, "chainCode");
+ assert_1.default.equal(wallet.depth, test.depth, "depth");
+ assert_1.default.equal(wallet.index, test.index, "index");
+ assert_1.default.equal(wallet.fingerprint, test.fingerprint, "fingerprint");
+ assert_1.default.equal(wallet.parentFingerprint, test.parentFingerprint, "parentFingerprint");
+ assert_1.default.equal(wallet.publicKey, test.publicKey, "publicKey");
+ if (wallet instanceof index_js_1.HDNodeWallet) {
+ assert_1.default.equal(wallet.extendedKey, test.xpriv, "xpriv");
+ assert_1.default.equal(wallet.privateKey, test.privateKey, "privateKey");
+ assert_1.default.equal(wallet.neuter().extendedKey, test.xpub, "xpub");
+ }
+ else if (wallet instanceof index_js_1.HDNodeVoidWallet) {
+ assert_1.default.equal(wallet.extendedKey, test.xpub, "xpub");
+ }
+ }
+ const tests = (0, utils_js_1.loadTests)("mnemonics");
+ const checks = [];
+ tests.forEach((test) => {
+ // The phrase and password are stored in the test as hex so they
+ // are safe as ascii7 values for viewing, printing, etc.
+ const phrase = fromHex(test.phrase);
+ const password = fromHex(test.password);
+ const wordlist = index_js_1.wordlists[test.locale];
+ if (wordlist == null) {
+ it(`tests ${test.name}`, function () {
+ this.skip();
+ });
+ return;
+ }
+ const mnemonic = index_js_1.Mnemonic.fromPhrase(phrase, password, wordlist);
+ function checkMnemonic(actual) {
+ assert_1.default.equal(actual.phrase, phrase, "phrase");
+ assert_1.default.equal(actual.password, password, "password");
+ assert_1.default.equal(actual.wordlist.locale, test.locale, "locale");
+ assert_1.default.equal(actual.entropy, mnemonic.entropy, "entropy");
+ assert_1.default.equal(actual.computeSeed(), mnemonic.computeSeed(), "seed");
+ }
+ checks.push({
+ phrase, password, wordlist, mnemonic, checkMnemonic, test
+ });
+ });
+ for (const { test, checkMnemonic, phrase, password, wordlist } of checks) {
+ it(`computes the HD keys by mnemonic: ${test.name}`, function () {
+ for (const subtest of test.nodes) {
+ const w = index_js_1.HDNodeWallet.fromPhrase(phrase, password, subtest.path, wordlist);
+ assert_1.default.ok(w instanceof index_js_1.HDNodeWallet, "instanceof HDNodeWallet");
+ assert_1.default.equal(w.path, subtest.path, "path");
+ checkWallet(w, subtest);
+ assert_1.default.ok(!!w.mnemonic, "has mnemonic");
+ checkMnemonic(w.mnemonic);
+ }
+ });
+ }
+ for (const { test } of checks) {
+ it(`computes the HD keys by entropy: ${test.name}`, function () {
+ const seedRoot = index_js_1.HDNodeWallet.fromSeed(test.seed);
+ for (const subtest of test.nodes) {
+ const w = seedRoot.derivePath(subtest.path);
+ assert_1.default.ok(w instanceof index_js_1.HDNodeWallet, "instanceof HDNodeWallet");
+ assert_1.default.equal(w.path, subtest.path, "path");
+ checkWallet(w, subtest);
+ assert_1.default.equal(w.mnemonic, null);
+ }
+ });
+ }
+ for (const { test } of checks) {
+ it(`computes the HD keys by enxtended private key: ${test.name}`, function () {
+ for (const subtest of test.nodes) {
+ const w = index_js_1.HDNodeWallet.fromExtendedKey(subtest.xpriv);
+ assert_1.default.ok(w instanceof index_js_1.HDNodeWallet, "instanceof HDNodeWallet");
+ checkWallet(w, subtest);
+ assert_1.default.equal(w.mnemonic, null);
+ }
+ });
+ }
+ for (const { test, phrase, password, wordlist } of checks) {
+ it(`computes the neutered HD keys by paths: ${test.name}`, function () {
+ const root = index_js_1.HDNodeWallet.fromPhrase(phrase, password, "m", wordlist).neuter();
+ for (const subtest of test.nodes) {
+ if (subtest.path.indexOf("'") >= 0) {
+ assert_1.default.throws(() => {
+ const w = root.derivePath(subtest.path);
+ console.log(w);
+ }, (error) => {
+ return (error.code === "UNSUPPORTED_OPERATION" &&
+ error.message.match(/^cannot derive child of neutered node/) &&
+ error.operation === "deriveChild");
+ });
+ }
+ else {
+ const w = root.derivePath(subtest.path);
+ assert_1.default.ok(w instanceof index_js_1.HDNodeVoidWallet, "instanceof HDNodeVoidWallet");
+ assert_1.default.equal(w.path, subtest.path, "path");
+ checkWallet(w, subtest);
+ }
+ }
+ });
+ }
+ for (const { test } of checks) {
+ it(`computes the neutered HD keys by enxtended public key: ${test.name}`, function () {
+ for (const subtest of test.nodes) {
+ const w = index_js_1.HDNodeWallet.fromExtendedKey(subtest.xpub);
+ assert_1.default.ok(w instanceof index_js_1.HDNodeVoidWallet, "instanceof HDNodeVoidWallet");
+ checkWallet(w, subtest);
+ }
+ });
+ }
+});
+//# sourceMappingURL=test-wallet-hd.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-wallet-hd.js.map b/dist/ethers.js/src.ts/_tests/test-wallet-hd.js.map
new file mode 100644
index 0000000..970c341
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-wallet-hd.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-wallet-hd.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-wallet-hd.ts"],"names":[],"mappings":";;;;;AACA,oDAA4B;AAE5B,yCAAuC;AAEvC,0CAGqB;AAOrB,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;AAClC,SAAS,OAAO,CAAC,GAAW;IACxB,MAAM,IAAI,GAAG,IAAA,mBAAQ,EAAC,GAAG,CAAC,CAAC;IAC3B,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAChC,CAAC;AAWD,QAAQ,CAAC,gBAAgB,EAAE;IACvB,SAAS,WAAW,CAAC,MAAuC,EAAE,IAA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AE,CAAC,KAAU,EAAE,EAAE;wBACd,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,uBAAuB;4BAC1C,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,uCAAuC,CAAC;4BAC5D,KAAK,CAAC,SAAS,KAAK,aAAa,CAAC,CAAC;oBAC3C,CAAC,CAAC,CAAC;iBACN;qBAAM;oBACH,MAAM,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;oBACxC,gBAAM,CAAC,EAAE,CAAC,CAAC,YAAY,2BAAgB,EAAE,6BAA6B,CAAC,CAAC;oBACxE,gBAAM,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;oBAC1C,WAAW,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;iBAC3B;aACJ;QACL,CAAC,CAAC,CAAC;KACN;IAED,KAAK,MAAM,EAAE,IAAI,EAAE,IAAI,MAAM,EAAE;QAC3B,EAAE,CAAC,0DAA2D,IAAI,CAAC,IAAK,EAAE,EAAE;YACxE,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,KAAK,EAAE;gBAC9B,MAAM,CAAC,GAAG,uBAAY,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;gBACrD,gBAAM,CAAC,EAAE,CAAC,CAAC,YAAY,2BAAgB,EAAE,6BAA6B,CAAC,CAAC;gBACxE,WAAW,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;aAC3B;QACL,CAAC,CAAC,CAAC;KACN;AACL,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-wallet-json.d.ts b/dist/ethers.js/src.ts/_tests/test-wallet-json.d.ts
new file mode 100644
index 0000000..f6b292d
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-wallet-json.d.ts
@@ -0,0 +1,2 @@
+export {};
+//# sourceMappingURL=test-wallet-json.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-wallet-json.d.ts.map b/dist/ethers.js/src.ts/_tests/test-wallet-json.d.ts.map
new file mode 100644
index 0000000..06acc1e
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-wallet-json.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-wallet-json.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-wallet-json.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-wallet-json.js b/dist/ethers.js/src.ts/_tests/test-wallet-json.js
new file mode 100644
index 0000000..67c3a91
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-wallet-json.js
@@ -0,0 +1,186 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const assert_1 = __importDefault(require("assert"));
+const utils_js_1 = require("./utils.js");
+const index_js_1 = require("../index.js");
+describe("Tests JSON Wallet Formats", function () {
+ const tests = (0, utils_js_1.loadTests)("wallets");
+ tests.forEach((test) => {
+ if (test.type !== "crowdsale") {
+ return;
+ }
+ it(`tests decrypting Crowdsale JSON: ${test.name}`, function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ const password = (0, index_js_1.getBytes)(test.password);
+ const account = (0, index_js_1.decryptCrowdsaleJson)(test.content, password);
+ assert_1.default.equal(account.address, test.address, "address");
+ });
+ });
+ });
+ tests.forEach((test) => {
+ if (test.type !== "keystore") {
+ return;
+ }
+ it(`tests decrypting Keystore JSON (sync): ${test.name}`, function () {
+ this.timeout(20000);
+ const password = (0, index_js_1.getBytes)(test.password);
+ const account = (0, index_js_1.decryptKeystoreJsonSync)(test.content, password);
+ //console.log(account);
+ assert_1.default.equal(account.address, test.address, "address");
+ });
+ });
+ tests.forEach((test) => {
+ if (test.type !== "keystore") {
+ return;
+ }
+ it(`tests decrypting Keystore JSON (async): ${test.name}`, function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.timeout(20000);
+ const password = (0, index_js_1.getBytes)(test.password);
+ const account = yield (0, index_js_1.decryptKeystoreJson)(test.content, password);
+ //console.log(account);
+ assert_1.default.equal(account.address, test.address, "address");
+ });
+ });
+ });
+ tests.forEach((test) => {
+ it(`tests decrypting JSON (sync): ${test.name}`, function () {
+ this.timeout(20000);
+ const password = (0, index_js_1.getBytes)(test.password);
+ const wallet = index_js_1.Wallet.fromEncryptedJsonSync(test.content, password);
+ //console.log(wallet);
+ assert_1.default.equal(wallet.address, test.address, "address");
+ });
+ });
+ tests.forEach((test) => {
+ it(`tests decrypting JSON (async): ${test.name}`, function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.timeout(20000);
+ const password = (0, index_js_1.getBytes)(test.password);
+ const wallet = yield index_js_1.Wallet.fromEncryptedJson(test.content, password);
+ //console.log(wallet);
+ assert_1.default.equal(wallet.address, test.address, "address");
+ });
+ });
+ });
+ it("tests encrypting wallet with mnemonic", function () {
+ this.timeout(20000);
+ const wallet = index_js_1.HDNodeWallet.createRandom();
+ assert_1.default.ok(wallet.mnemonic, "mnemonic");
+ const phrase = wallet.mnemonic.phrase;
+ const json = wallet.encryptSync("foobar");
+ const wallet2 = index_js_1.Wallet.fromEncryptedJsonSync(json, "foobar");
+ assert_1.default.ok(wallet2 instanceof index_js_1.HDNodeWallet && wallet2.mnemonic);
+ assert_1.default.equal(wallet2.mnemonic.phrase, phrase, "phrase");
+ assert_1.default.equal(wallet2.address, wallet.address, "address");
+ });
+});
+describe("Tests Extra JSON Wallet Functions", function () {
+ const badCrowdsales = [
+ {
+ name: "undefined",
+ value: undefined
+ },
+ {
+ name: "junk string",
+ value: "junk!"
+ },
+ {
+ name: "non-string",
+ value: 42
+ },
+ {
+ name: "JSON without encseed",
+ value: JSON.stringify({ foo: "bar" })
+ },
+ ];
+ for (const { name, value } of badCrowdsales) {
+ it(`tests the invalid isCrowdsale wallet: ${name}`, function () {
+ assert_1.default.equal((0, index_js_1.isCrowdsaleJson)(value), false);
+ });
+ }
+ const badKeystoreOptions = [
+ {
+ name: "invalid salt type",
+ options: { salt: 42 },
+ error: "invalid BytesLike value"
+ },
+ {
+ name: "invalid uuid type",
+ options: { uuid: 42 },
+ error: "invalid BytesLike value"
+ },
+ {
+ name: "invalid uuid length",
+ options: { uuid: "0x1234" },
+ error: "invalid options.uuid"
+ },
+ {
+ name: "invalid iv type",
+ options: { iv: 42 },
+ error: "invalid BytesLike value"
+ },
+ {
+ name: "invalid iv length",
+ options: { iv: "0x1234" },
+ error: "invalid options.iv"
+ },
+ {
+ name: "invalid scrypt N (non-one-hot-encoded)",
+ options: { scrypt: { N: 1023 } },
+ error: "invalid scrypt N parameter"
+ },
+ {
+ name: "invalid scrypt N (non-integer)",
+ options: { scrypt: { N: 1.5 } },
+ error: "invalid scrypt N parameter"
+ },
+ {
+ name: "invalid scrypt r",
+ options: { scrypt: { r: 1.5 } },
+ error: "invalid scrypt r parameter"
+ },
+ {
+ name: "invalid scrypt p",
+ options: { scrypt: { p: 1.5 } },
+ error: "invalid scrypt p parameter"
+ },
+ ];
+ const wallet = index_js_1.Wallet.createRandom();
+ const account = { address: wallet.address, privateKey: wallet.privateKey };
+ const password = "foobar";
+ for (const { name, options, error } of badKeystoreOptions) {
+ it(`tests bad keystore options: ${name}`, function () {
+ assert_1.default.throws(() => {
+ const result = (0, index_js_1.encryptKeystoreJsonSync)(account, password, options);
+ console.log(result);
+ }, (e) => {
+ return ((0, index_js_1.isError)(e, "INVALID_ARGUMENT") &&
+ e.message.startsWith(error));
+ });
+ });
+ }
+ // Mainly to round out weird edge cases in coverage
+ it("tests encryption with options (sync)", function () {
+ assert_1.default.ok((0, index_js_1.encryptKeystoreJsonSync)(account, password));
+ });
+ // Mainly to round out weird edge cases in coverage
+ it("tests encryption with options (async)", function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ assert_1.default.ok(yield (0, index_js_1.encryptKeystoreJson)(account, password));
+ });
+ });
+});
+//# sourceMappingURL=test-wallet-json.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-wallet-json.js.map b/dist/ethers.js/src.ts/_tests/test-wallet-json.js.map
new file mode 100644
index 0000000..8920987
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-wallet-json.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-wallet-json.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-wallet-json.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,oDAA4B;AAE5B,yCAAuC;AAIvC,0CAQqB;AAGrB,QAAQ,CAAC,2BAA2B,EAAE;IACjC,MAAM,KAAK,GAAG,IAAA,oBAAS,EAAiB,SAAS,CAAC,CAAC;IACnD,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACnB,IAAI,IAAI,CAAC,IAAI,KAAK,WAAW,EAAE;YAAE,OAAO;SAAE;QAC1C,EAAE,CAAC,oCAAqC,IAAI,CAAC,IAAK,EAAE,EAAE;;gBAClD,MAAM,QAAQ,GAAG,IAAA,mBAAQ,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBACzC,MAAM,OAAO,GAAG,IAAA,+BAAoB,EAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;gBAC7D,gBAAM,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAA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,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,kBAAkB,EAAE;QACvD,EAAE,CAAC,+BAAgC,IAAK,EAAE,EAAE;YACxC,gBAAM,CAAC,MAAM,CAAC,GAAG,EAAE;gBACf,MAAM,MAAM,GAAG,IAAA,kCAAuB,EAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;gBACnE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YACxB,CAAC,EAAE,CAAC,CAAM,EAAE,EAAE;gBACV,OAAO,CAAC,IAAA,kBAAO,EAAC,CAAC,EAAE,kBAAkB,CAAC;oBAClC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;YACrC,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;KACN;IAED,mDAAmD;IACnD,EAAE,CAAC,sCAAsC,EAAE;QACvC,gBAAM,CAAC,EAAE,CAAC,IAAA,kCAAuB,EAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;IAEH,mDAAmD;IACnD,EAAE,CAAC,uCAAuC,EAAE;;YACxC,gBAAM,CAAC,EAAE,CAAC,MAAM,IAAA,8BAAmB,EAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;QAC5D,CAAC;KAAA,CAAC,CAAC;AAEP,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-wallet-mnemonic.d.ts b/dist/ethers.js/src.ts/_tests/test-wallet-mnemonic.d.ts
new file mode 100644
index 0000000..7b51aed
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-wallet-mnemonic.d.ts
@@ -0,0 +1,2 @@
+export {};
+//# sourceMappingURL=test-wallet-mnemonic.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-wallet-mnemonic.d.ts.map b/dist/ethers.js/src.ts/_tests/test-wallet-mnemonic.d.ts.map
new file mode 100644
index 0000000..1bfa675
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-wallet-mnemonic.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-wallet-mnemonic.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-wallet-mnemonic.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-wallet-mnemonic.js b/dist/ethers.js/src.ts/_tests/test-wallet-mnemonic.js
new file mode 100644
index 0000000..ebcfadb
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-wallet-mnemonic.js
@@ -0,0 +1,123 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const assert_1 = __importDefault(require("assert"));
+const index_js_1 = require("../index.js");
+const utils_js_1 = require("./utils.js");
+const decoder = new TextDecoder();
+function fromHex(hex) {
+ const data = (0, index_js_1.getBytes)(hex);
+ return decoder.decode(data);
+}
+function repeat(text, length) {
+ const result = [];
+ while (result.length < length) {
+ result.push(text);
+ }
+ return result;
+}
+describe("Tests Mnemonics", function () {
+ const tests = (0, utils_js_1.loadTests)("mnemonics");
+ function runTest(phrase, mnemonic, test) {
+ assert_1.default.ok(index_js_1.Mnemonic.isValidMnemonic(phrase, mnemonic.wordlist), "isValidMnemonic");
+ if (test.locale === "en") {
+ assert_1.default.ok(index_js_1.Mnemonic.isValidMnemonic(phrase), "isValidMnemonic (default)");
+ }
+ assert_1.default.equal(mnemonic.wordlist.locale, test.locale, "locale");
+ assert_1.default.equal(mnemonic.entropy, test.entropy, "entropy");
+ assert_1.default.equal(mnemonic.computeSeed(), test.seed, "seed");
+ assert_1.default.equal((0, index_js_1.sha256)((0, index_js_1.toUtf8Bytes)(phrase)), test.phraseHash, "phraseHash");
+ }
+ for (const test of tests) {
+ const wordlist = index_js_1.wordlists[test.locale];
+ it(`computes mnemonic from phrase: ${test.name}`, function () {
+ if (wordlist == null) {
+ this.skip();
+ return;
+ }
+ const phrase = fromHex(test.phrase);
+ const password = fromHex(test.password);
+ const mnemonic = index_js_1.Mnemonic.fromPhrase(phrase, password, wordlist);
+ runTest(phrase, mnemonic, test);
+ });
+ }
+ for (const test of tests) {
+ const wordlist = index_js_1.wordlists[test.locale];
+ it(`computes mnemonic from entropy: ${test.name}`, function () {
+ if (wordlist == null) {
+ this.skip();
+ return;
+ }
+ const phrase = fromHex(test.phrase);
+ const password = fromHex(test.password);
+ const mnemonic = index_js_1.Mnemonic.fromEntropy(test.entropy, password, wordlist);
+ runTest(phrase, mnemonic, test);
+ });
+ }
+});
+describe("Tests Bad Mnemonics Fail", function () {
+ const badLengths = [
+ repeat("abandon", 9),
+ repeat("abandon", 16),
+ repeat("abandon", 27), // 27 words; too long
+ ];
+ for (const _phrase of badLengths) {
+ const phrase = _phrase.join(" ");
+ it(`correctly fails on invalid mnemonic length: ${_phrase.length}`, function () {
+ assert_1.default.ok(!index_js_1.Mnemonic.isValidMnemonic(phrase));
+ assert_1.default.throws(function () {
+ index_js_1.Mnemonic.fromPhrase(phrase);
+ }, function (error) {
+ return (error.code === "INVALID_ARGUMENT" &&
+ error.message.match(/^invalid mnemonic length/) &&
+ error.argument === "mnemonic" &&
+ error.value === "[ REDACTED ]");
+ });
+ });
+ }
+ it("correctly fails on invalid mnemonic word", function () {
+ const phrase = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon wagmi";
+ assert_1.default.ok(!index_js_1.Mnemonic.isValidMnemonic(phrase));
+ assert_1.default.throws(function () {
+ index_js_1.Mnemonic.fromPhrase(phrase);
+ }, function (error) {
+ return (error.code === "INVALID_ARGUMENT" &&
+ error.message.match(/^invalid mnemonic word at index 11/) &&
+ error.argument === "mnemonic" &&
+ error.value === "[ REDACTED ]");
+ });
+ });
+ it("correctly fails on invalid mnemonic checksum", function () {
+ const phrase = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon";
+ assert_1.default.ok(!index_js_1.Mnemonic.isValidMnemonic(phrase));
+ assert_1.default.throws(function () {
+ index_js_1.Mnemonic.fromPhrase(phrase);
+ }, function (error) {
+ return (error.code === "INVALID_ARGUMENT" &&
+ error.message.match(/^invalid mnemonic checksum/) &&
+ error.argument === "mnemonic" &&
+ error.value === "[ REDACTED ]");
+ });
+ });
+ const badEntropyLengths = [
+ repeat("42", 12),
+ repeat("42", 15),
+ repeat("42", 36), // 36 bytes; too long
+ ];
+ for (const _entropy of badEntropyLengths) {
+ const entropy = "0x" + _entropy.join("");
+ it(`correctly fails on invalid entropy length: ${_entropy.length}`, function () {
+ assert_1.default.throws(function () {
+ index_js_1.Mnemonic.fromEntropy(entropy);
+ }, function (error) {
+ return (error.code === "INVALID_ARGUMENT" &&
+ error.message.match(/^invalid entropy size/) &&
+ error.argument === "entropy" &&
+ error.value === "[ REDACTED ]");
+ });
+ });
+ }
+});
+//# sourceMappingURL=test-wallet-mnemonic.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-wallet-mnemonic.js.map b/dist/ethers.js/src.ts/_tests/test-wallet-mnemonic.js.map
new file mode 100644
index 0000000..f4344b9
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-wallet-mnemonic.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-wallet-mnemonic.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-wallet-mnemonic.ts"],"names":[],"mappings":";;;;;AACA,oDAA4B;AAE5B,0CAGqB;AAErB,yCAAuC;AAKvC,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;AAClC,SAAS,OAAO,CAAC,GAAW;IACxB,MAAM,IAAI,GAAG,IAAA,mBAAQ,EAAC,GAAG,CAAC,CAAC;IAC3B,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAChC,CAAC;AAED,SAAS,MAAM,CAAC,IAAY,EAAE,MAAc;IACxC,MAAM,MA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ts/_tests/test-wallet.d.ts
new file mode 100644
index 0000000..918eb2f
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-wallet.d.ts
@@ -0,0 +1,2 @@
+export {};
+//# sourceMappingURL=test-wallet.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-wallet.d.ts.map b/dist/ethers.js/src.ts/_tests/test-wallet.d.ts.map
new file mode 100644
index 0000000..45cc1b2
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-wallet.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-wallet.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-wallet.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-wallet.js b/dist/ethers.js/src.ts/_tests/test-wallet.js
new file mode 100644
index 0000000..e55fb2d
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-wallet.js
@@ -0,0 +1,120 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const assert_1 = __importDefault(require("assert"));
+const utils_js_1 = require("./utils.js");
+const index_js_1 = require("../index.js");
+describe("Test Private Key Wallet", function () {
+ const tests = (0, utils_js_1.loadTests)("accounts");
+ tests.forEach(({ name, privateKey, address }) => {
+ it(`creates wallet: ${name}`, function () {
+ const wallet = new index_js_1.Wallet(privateKey);
+ assert_1.default.equal(wallet.privateKey, privateKey);
+ assert_1.default.equal(wallet.address, address);
+ });
+ });
+});
+describe("Test Transaction Signing", function () {
+ const tests = (0, utils_js_1.loadTests)("transactions");
+ for (const test of tests) {
+ it(`tests signing a legacy transaction: ${test.name}`, function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ const wallet = new index_js_1.Wallet(test.privateKey);
+ const txData = Object.assign({}, test.transaction, { type: 0, accessList: undefined, maxFeePerGas: undefined, maxPriorityFeePerGas: undefined });
+ // Use the testcase sans the chainId for a legacy test
+ if (txData.chainId != null && parseInt(txData.chainId) != 0) {
+ txData.chainId = "0x00";
+ }
+ const signed = yield wallet.signTransaction(txData);
+ assert_1.default.equal(signed, test.signedLegacy, "signedLegacy");
+ });
+ });
+ }
+ for (const test of tests) {
+ if (!test.signedEip155) {
+ continue;
+ }
+ it(`tests signing an EIP-155 transaction: ${test.name}`, function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ const wallet = new index_js_1.Wallet(test.privateKey);
+ const txData = Object.assign({}, test.transaction, { type: 0, accessList: undefined, maxFeePerGas: undefined, maxPriorityFeePerGas: undefined });
+ const signed = yield wallet.signTransaction(txData);
+ assert_1.default.equal(signed, test.signedEip155, "signedEip155");
+ });
+ });
+ }
+ for (const test of tests) {
+ it(`tests signing a Berlin transaction: ${test.name}`, function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ const wallet = new index_js_1.Wallet(test.privateKey);
+ const txData = Object.assign({}, test.transaction, { type: 1, maxFeePerGas: undefined, maxPriorityFeePerGas: undefined });
+ const signed = yield wallet.signTransaction(txData);
+ assert_1.default.equal(signed, test.signedBerlin, "signedBerlin");
+ });
+ });
+ }
+ for (const test of tests) {
+ it(`tests signing a London transaction: ${test.name}`, function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ const wallet = new index_js_1.Wallet(test.privateKey);
+ const txData = Object.assign({}, test.transaction, { type: 2 });
+ const signed = yield wallet.signTransaction(txData);
+ assert_1.default.equal(signed, test.signedLondon, "signedLondon");
+ });
+ });
+ }
+});
+describe("Test Message Signing (EIP-191)", function () {
+});
+describe("Test Typed-Data Signing (EIP-712)", function () {
+ const tests = (0, utils_js_1.loadTests)("typed-data");
+ for (const test of tests) {
+ const { privateKey, signature } = test;
+ if (privateKey == null || signature == null) {
+ continue;
+ }
+ it(`tests signing typed-data: ${test.name}`, function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ const wallet = new index_js_1.Wallet(privateKey);
+ const sig = yield wallet.signTypedData(test.domain, test.types, test.data);
+ assert_1.default.equal(sig, signature, "signature");
+ });
+ });
+ }
+});
+describe("Test Wallet Encryption", function () {
+ const password = "foobar";
+ // Loop:
+ // 1 : random wallet (uses HDNodeWallet under the hood)
+ // 2 : Wallet using private key (uses Wallet explicitly)
+ for (let i = 0; i < 2; i++) {
+ let wallet = index_js_1.Wallet.createRandom();
+ it("encrypts a random wallet: sync", function () {
+ this.timeout(30000);
+ const json = wallet.encryptSync(password);
+ const decrypted = index_js_1.Wallet.fromEncryptedJsonSync(json, password);
+ assert_1.default.equal(decrypted.address, wallet.address, "address");
+ });
+ it("encrypts a random wallet: async", function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.timeout(30000);
+ const json = yield wallet.encrypt(password);
+ const decrypted = yield index_js_1.Wallet.fromEncryptedJson(json, password);
+ assert_1.default.equal(decrypted.address, wallet.address, "address");
+ });
+ });
+ wallet = new index_js_1.Wallet((0, index_js_1.hexlify)((0, index_js_1.randomBytes)(32)));
+ }
+});
+//# sourceMappingURL=test-wallet.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-wallet.js.map b/dist/ethers.js/src.ts/_tests/test-wallet.js.map
new file mode 100644
index 0000000..99313d3
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-wallet.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-wallet.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-wallet.ts"],"names":[],"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,EAAE,CAAC,CAAC,CAAC,CAAC;KACjD;AACL,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-wordlists.d.ts b/dist/ethers.js/src.ts/_tests/test-wordlists.d.ts
new file mode 100644
index 0000000..ea3f51d
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-wordlists.d.ts
@@ -0,0 +1,2 @@
+export {};
+//# sourceMappingURL=test-wordlists.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-wordlists.d.ts.map b/dist/ethers.js/src.ts/_tests/test-wordlists.d.ts.map
new file mode 100644
index 0000000..881367a
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-wordlists.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-wordlists.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-wordlists.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-wordlists.js b/dist/ethers.js/src.ts/_tests/test-wordlists.js
new file mode 100644
index 0000000..6f21f73
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-wordlists.js
@@ -0,0 +1,71 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const assert_1 = __importDefault(require("assert"));
+const index_js_1 = require("../index.js");
+const utils_js_1 = require("./utils.js");
+describe('Check Wordlists', function () {
+ const tests = (0, utils_js_1.loadTests)("wordlists");
+ tests.forEach((test) => {
+ let wordlist = index_js_1.wordlists[test.locale];
+ if (wordlist == null) {
+ return;
+ }
+ it(`matches wordlists: ${test.locale}`, function () {
+ const words = test.content.split('\n');
+ let check = "";
+ for (let i = 0; i < 2048; i++) {
+ let word = wordlist.getWord(i);
+ check += (word + "\n");
+ assert_1.default.equal(word, words[i]);
+ assert_1.default.equal(wordlist.getWordIndex(word), i);
+ }
+ assert_1.default.equal(check, test.content);
+ });
+ });
+ tests.forEach((test) => {
+ let wordlist = index_js_1.wordlists[test.locale];
+ if (wordlist == null) {
+ return;
+ }
+ it(`splitting and joining are equivalent: ${test.locale}`, function () {
+ const words = [];
+ for (let i = 0; i < 12; i++) {
+ words.push(wordlist.getWord(i));
+ }
+ const phrase = wordlist.join(words);
+ const words2 = wordlist.split(phrase);
+ const phrase2 = wordlist.join(words2);
+ assert_1.default.deepEqual(words2, words, "split words");
+ assert_1.default.deepEqual(phrase2, phrase, "re-joined words");
+ });
+ });
+ tests.forEach((test) => {
+ let wordlist = index_js_1.wordlists[test.locale];
+ if (wordlist == null) {
+ return;
+ }
+ it(`handles out-of-range values: ${test.locale}`, function () {
+ assert_1.default.equal(wordlist.getWordIndex("foobar"), -1);
+ assert_1.default.throws(() => {
+ wordlist.getWord(-1);
+ }, (error) => {
+ return (error.code === "INVALID_ARGUMENT" &&
+ error.message.match(/^invalid word index/) &&
+ error.argument === "index" &&
+ error.value === -1);
+ });
+ assert_1.default.throws(() => {
+ wordlist.getWord(2048);
+ }, (error) => {
+ return (error.code === "INVALID_ARGUMENT" &&
+ error.message.match(/^invalid word index/) &&
+ error.argument === "index" &&
+ error.value === 2048);
+ });
+ });
+ });
+});
+//# sourceMappingURL=test-wordlists.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/test-wordlists.js.map b/dist/ethers.js/src.ts/_tests/test-wordlists.js.map
new file mode 100644
index 0000000..8a7d3f4
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/test-wordlists.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"test-wordlists.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/test-wordlists.ts"],"names":[],"mappings":";;;;;AAAA,oDAA4B;AAE5B,0CAAwC;AAExC,yCAAuC;AAKvC,QAAQ,CAAC,iBAAiB,EAAE;IACxB,MAAM,KAAK,GAAG,IAAA,oBAAS,EAAmB,WAAW,CAAC,CA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ACf,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAC3B,CAAC,EAAE,CAAC,KAAU,EAAE,EAAE;gBACd,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,kBAAkB;oBACrC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,qBAAqB,CAAC;oBAC1C,KAAK,CAAC,QAAQ,KAAK,OAAO;oBAC1B,KAAK,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC;YAC9B,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IAEP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/types.d.ts b/dist/ethers.js/src.ts/_tests/types.d.ts
new file mode 100644
index 0000000..ea189c9
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/types.d.ts
@@ -0,0 +1,217 @@
+export type TestCaseAbiVerbose = {
+ type: "address" | "hexstring" | "number" | "string";
+ value: string;
+} | {
+ type: "boolean";
+ value: boolean;
+} | {
+ type: "array";
+ value: Array;
+} | {
+ type: "object";
+ value: Array;
+};
+export interface TestCaseAbi {
+ name: string;
+ type: string;
+ value: any;
+ verbose: TestCaseAbiVerbose;
+ bytecode: string;
+ encoded: string;
+}
+export interface TestCaseAccount {
+ name: string;
+ privateKey: string;
+ address: string;
+ icap: string;
+}
+export type TestCaseCreate = {
+ sender: string;
+ creates: Array<{
+ name: string;
+ nonce: number;
+ address: string;
+ }>;
+};
+export type TestCaseCreate2 = {
+ sender: string;
+ creates: Array<{
+ name: string;
+ salt: string;
+ initCode: string;
+ initCodeHash: string;
+ address: string;
+ }>;
+};
+export interface TestCaseHash {
+ name: string;
+ data: string;
+ sha256: string;
+ sha512: string;
+ ripemd160: string;
+ keccak256: string;
+}
+export interface TestCasePbkdf {
+ name: string;
+ password: string;
+ salt: string;
+ dkLen: number;
+ pbkdf2: {
+ iterations: number;
+ algorithm: "sha256" | "sha512";
+ key: string;
+ };
+ scrypt: {
+ N: number;
+ r: number;
+ p: number;
+ key: string;
+ };
+}
+export interface TestCaseHmac {
+ name: string;
+ data: string;
+ key: string;
+ algorithm: "sha256" | "sha512";
+ hmac: string;
+}
+export interface TestCaseHash {
+ name: string;
+ data: string;
+ sha256: string;
+ sha512: string;
+ ripemd160: string;
+ keccak256: string;
+}
+export interface TestCaseNamehash {
+ name: string;
+ ensName: string;
+ error?: string;
+ namehash?: string;
+}
+export interface TestCaseTypedDataDomain {
+ name?: string;
+ version?: string;
+ chainId?: number;
+ verifyingContract?: string;
+ salt?: string;
+}
+export interface TestCaseTypedDataType {
+ name: string;
+ type: string;
+}
+export interface TestCaseTypedData {
+ name: string;
+ domain: TestCaseTypedDataDomain;
+ primaryType: string;
+ types: Record>;
+ data: any;
+ encoded: string;
+ digest: string;
+ privateKey?: string;
+ signature?: string;
+}
+export interface TestCaseSolidityHash {
+ name: string;
+ types: Array;
+ keccak256: string;
+ ripemd160: string;
+ sha256: string;
+ values: Array;
+}
+export interface TestCaseUnit {
+ name: string;
+ wei: string;
+ ethers: string;
+ ether_format: string;
+ kwei?: string;
+ mwei?: string;
+ gwei?: string;
+ szabo?: string;
+ finney?: string;
+ finney_format?: string;
+ szabo_format?: string;
+ gwei_format?: string;
+ mwei_format?: string;
+ kwei_format?: string;
+}
+export type NestedHexString = string | Array;
+export interface TestCaseRlp {
+ name: string;
+ encoded: string;
+ decoded: NestedHexString;
+}
+export interface TestCaseTransactionTx {
+ to?: string;
+ nonce?: number;
+ gasLimit?: string;
+ gasPrice?: string;
+ maxFeePerGas?: string;
+ maxPriorityFeePerGas?: string;
+ data?: string;
+ value?: string;
+ accessList?: Array<{
+ address: string;
+ storageKeys: Array;
+ }>;
+ chainId?: string;
+}
+export interface TestCaseTransactionSig {
+ r: string;
+ s: string;
+ v: string;
+}
+export interface TestCaseTransaction {
+ name: string;
+ transaction: TestCaseTransactionTx;
+ privateKey: string;
+ unsignedLegacy: string;
+ signedLegacy: string;
+ unsignedEip155: string;
+ signedEip155: string;
+ unsignedBerlin: string;
+ signedBerlin: string;
+ unsignedLondon: string;
+ signedLondon: string;
+ signatureLegacy: TestCaseTransactionSig;
+ signatureEip155: TestCaseTransactionSig;
+ signatureBerlin: TestCaseTransactionSig;
+ signatureLondon: TestCaseTransactionSig;
+}
+export interface TestCaseMnemonicNode {
+ path: string;
+ chainCode: string;
+ depth: number;
+ index: number;
+ parentFingerprint: string;
+ fingerprint: string;
+ publicKey: string;
+ privateKey: string;
+ xpriv: string;
+ xpub: string;
+}
+export interface TestCaseMnemonic {
+ name: string;
+ phrase: string;
+ phraseHash: string;
+ password: string;
+ locale: string;
+ entropy: string;
+ seed: string;
+ nodes: Array;
+}
+export interface TestCaseWallet {
+ name: string;
+ filename: string;
+ type: string;
+ address: string;
+ password: string;
+ content: string;
+}
+export interface TestCaseWordlist {
+ name: string;
+ filename: string;
+ locale: string;
+ content: string;
+}
+//# sourceMappingURL=types.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/types.d.ts.map b/dist/ethers.js/src.ts/_tests/types.d.ts.map
new file mode 100644
index 0000000..6a44442
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/types.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/types.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,kBAAkB,GAAG;IAC7B,IAAI,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACpD,KAAK,EAAE,MAAM,CAAA;CAChB,GAAG;IACA,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,OAAO,CAAA;CACjB,GAAG;IACA,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,KAAK,CAAC,kBAAkB,CAAC,CAAA;CACnC,GAAG;IACA,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,KAAK,CAAC,kBAAkB,CAAC,CAAA;CACn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AAE,MAAM,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,KAAK,CAAC,oBAAoB,CAAC,CAAC;CACtC;AAED,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACnB;AAKD,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACnB"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/types.js b/dist/ethers.js/src.ts/_tests/types.js
new file mode 100644
index 0000000..2004e03
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/types.js
@@ -0,0 +1,4 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+;
+//# sourceMappingURL=types.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/types.js.map b/dist/ethers.js/src.ts/_tests/types.js.map
new file mode 100644
index 0000000..d73e0b9
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/types.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/types.ts"],"names":[],"mappings":";;AA4PC,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/utils.d.ts b/dist/ethers.js/src.ts/_tests/utils.d.ts
new file mode 100644
index 0000000..4621f77
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/utils.d.ts
@@ -0,0 +1,9 @@
+export declare function loadTests(tag: string): Array;
+export declare function log(context: any, text: string): void;
+export declare function stall(duration: number): Promise;
+export interface MochaRunnable {
+ timeout: (value: number) => void;
+ skip: () => void;
+}
+export declare function retryIt(name: string, func: (this: MochaRunnable) => Promise): Promise;
+//# sourceMappingURL=utils.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/utils.d.ts.map b/dist/ethers.js/src.ts/_tests/utils.d.ts.map
new file mode 100644
index 0000000..7c7b308
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/utils.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/utils.ts"],"names":[],"mappings":"AAoBA,wBAAgB,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,CAGlD;AAED,wBAAgB,GAAG,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAMpD;AAED,wBAAsB,KAAK,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE3D;AAED,MAAM,WAAW,aAAa;IAC1B,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,IAAI,EAAE,MAAM,IAAI,CAAC;CACpB;AAGD,wBAAsB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAoCvG"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/utils.js b/dist/ethers.js/src.ts/_tests/utils.js
new file mode 100644
index 0000000..797ff85
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/utils.js
@@ -0,0 +1,150 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.retryIt = exports.stall = exports.log = exports.loadTests = void 0;
+const fs_1 = __importDefault(require("fs"));
+const path_1 = __importDefault(require("path"));
+const zlib_1 = __importDefault(require("zlib"));
+// Find the package root (based on the nyc output/ folder)
+const root = (function () {
+ let root = process.cwd();
+ while (true) {
+ if (fs_1.default.existsSync(path_1.default.join(root, "output"))) {
+ return root;
+ }
+ const parent = path_1.default.join(root, "..");
+ if (parent === root) {
+ break;
+ }
+ root = parent;
+ }
+ throw new Error("could not find root");
+})();
+// Load the tests
+function loadTests(tag) {
+ const filename = path_1.default.resolve(root, "testcases", tag + ".json.gz");
+ return JSON.parse(zlib_1.default.gunzipSync(fs_1.default.readFileSync(filename)).toString());
+}
+exports.loadTests = loadTests;
+function log(context, text) {
+ if (context && context.test && typeof (context.test._ethersLog) === "function") {
+ context.test._ethersLog(text);
+ }
+ else {
+ console.log(text);
+ }
+}
+exports.log = log;
+function stall(duration) {
+ return __awaiter(this, void 0, void 0, function* () {
+ return new Promise((resolve) => { setTimeout(resolve, duration); });
+ });
+}
+exports.stall = stall;
+const ATTEMPTS = 5;
+function retryIt(name, func) {
+ return __awaiter(this, void 0, void 0, function* () {
+ //const errors: Array = [ ];
+ it(name, function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.timeout(ATTEMPTS * 5000);
+ for (let i = 0; i < ATTEMPTS; i++) {
+ try {
+ yield func.call(this);
+ return;
+ }
+ catch (error) {
+ if (error.message === "sync skip; aborting execution") {
+ // Skipping a test; let mocha handle it
+ throw error;
+ }
+ else if (error.code === "ERR_ASSERTION") {
+ // Assertion error; let mocha scold us
+ throw error;
+ }
+ else {
+ //errors.push(error);
+ if (i === ATTEMPTS - 1) {
+ throw error;
+ //stats.pushRetry(i, name, error);
+ }
+ else {
+ yield stall(500 * (1 << i));
+ //stats.pushRetry(i, name, null);
+ }
+ }
+ }
+ }
+ // All hope is lost.
+ throw new Error(`Failed after ${ATTEMPTS} attempts; ${name}`);
+ });
+ });
+ });
+}
+exports.retryIt = retryIt;
+/*
+export interface StatSet {
+ name: string;
+ retries: Array<{ message: string, error: null | Error }>;
+}
+
+const _guard = { };
+
+export class Stats {
+// #stats: Array;
+
+ constructor(guard: any) {
+ if (guard !== _guard) { throw new Error("private constructor"); }
+// this.#stats = [ ];
+ }
+
+ #currentStats(): StatSet {
+ if (this.#stats.length === 0) { throw new Error("no active stats"); }
+ return this.#stats[this.#stats.length - 1];
+ }
+
+ pushRetry(attempt: number, line: string, error: null | Error): void {
+ const { retries } = this.#currentStats();
+
+ if (attempt > 0) { retries.pop(); }
+ if (retries.length < 100) {
+ retries.push({
+ message: `${ attempt + 1 } failures: ${ line }`,
+ error
+ });
+ }
+ }
+
+ start(name: string): void {
+ this.#stats.push({ name, retries: [ ] });
+ }
+
+ end(context?: any): void {
+ let log = console.log.bind(console);
+ if (context && typeof(context._ethersLog) === "function") {
+ log = context._ethersLog;
+ }
+ const { name, retries } = this.#currentStats();
+ if (retries.length === 0) { return; }
+ log(`Warning: The following tests required retries (${ name })`);
+ retries.forEach(({ error, message }) => {
+ log(" " + message);
+ if (error) { log(error); }
+ });
+ }
+}
+
+export const stats = new Stats(_guard);
+*/
+//# sourceMappingURL=utils.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_tests/utils.js.map b/dist/ethers.js/src.ts/_tests/utils.js.map
new file mode 100644
index 0000000..dfa2df3
--- /dev/null
+++ b/dist/ethers.js/src.ts/_tests/utils.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/_tests/utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,4CAAmB;AACnB,gDAAwB;AACxB,gDAAwB;AAExB,0DAA0D;AAC1D,MAAM,IAAI,GAAG,CAAC;IACV,IAAI,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAEzB,OAAO,IAAI,EAAE;QACT,IAAI,YAAE,CAAC,UAAU,CAAC,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,EAAE;YAAE,OAAO,IAAI,CAAC;SAAE;QAC9D,MAAM,MAAM,GAAG,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACrC,IAAI,MAAM,KAAK,IAAI,EAAE;YAAE,MAAM;SAAE;QAC/B,IAAI,GAAG,MAAM,CAAC;KACjB;IAED,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;AAC3C,CAAC,CAAC,EAAE,CAAC;AAEL,iBAAiB;AACjB,SAAgB,SAAS,CAAI,GAAW;IACrC,MAAM,QAAQ,GAAG,cAAI,CAAC,OAAO,CAAC,IAAI,EAAE,WAAW,EAAE,GAAG,GAAG,UAAU,CAAC,CAAC;IACnE,OAAO,IAAI,CAAC,KAAK,CAAC,cAAI,CAAC,UAAU,CAAC,YAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;AAC5E,CAAC;AAHD,8BAGC;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,CAAC,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gCAC5B,iCAAiC;6BACpC;yBACJ;qBACJ;iBACJ;gBAED,oBAAoB;gBACpB,MAAM,IAAI,KAAK,CAAC,gBAAiB,QAAS,cAAe,IAAK,EAAE,CAAC,CAAC;YACtE,CAAC;SAAA,CAAC,CAAC;IACP,CAAC;CAAA;AApCD,0BAoCC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqDE"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_version.d.ts b/dist/ethers.js/src.ts/_version.d.ts
new file mode 100644
index 0000000..37c501a
--- /dev/null
+++ b/dist/ethers.js/src.ts/_version.d.ts
@@ -0,0 +1,5 @@
+/**
+ * The current version of Ethers.
+ */
+export declare const version: string;
+//# sourceMappingURL=_version.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_version.d.ts.map b/dist/ethers.js/src.ts/_version.d.ts.map
new file mode 100644
index 0000000..04ea860
--- /dev/null
+++ b/dist/ethers.js/src.ts/_version.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"_version.d.ts","sourceRoot":"","sources":["../../../src/ethers.js/src.ts/_version.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,MAAgB,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_version.js b/dist/ethers.js/src.ts/_version.js
new file mode 100644
index 0000000..68cb659
--- /dev/null
+++ b/dist/ethers.js/src.ts/_version.js
@@ -0,0 +1,9 @@
+"use strict";
+/* Do NOT modify this file; see /src.ts/_admin/update-version.ts */
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.version = void 0;
+/**
+ * The current version of Ethers.
+ */
+exports.version = "6.9.0";
+//# sourceMappingURL=_version.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/_version.js.map b/dist/ethers.js/src.ts/_version.js.map
new file mode 100644
index 0000000..df3bb56
--- /dev/null
+++ b/dist/ethers.js/src.ts/_version.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"_version.js","sourceRoot":"","sources":["../../../src/ethers.js/src.ts/_version.ts"],"names":[],"mappings":";AAAA,mEAAmE;;;AAEnE;;GAEG;AACU,QAAA,OAAO,GAAW,OAAO,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/abi-coder.d.ts b/dist/ethers.js/src.ts/abi/abi-coder.d.ts
new file mode 100644
index 0000000..4afe611
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/abi-coder.d.ts
@@ -0,0 +1,60 @@
+/**
+ * When sending values to or receiving values from a [[Contract]], the
+ * data is generally encoded using the [ABI standard](link-solc-abi).
+ *
+ * The AbiCoder provides a utility to encode values to ABI data and
+ * decode values from ABI data.
+ *
+ * Most of the time, developers should favour the [[Contract]] class,
+ * which further abstracts a lot of the finer details of ABI data.
+ *
+ * @_section api/abi/abi-coder:ABI Encoding
+ */
+import { Result } from "./coders/abstract-coder.js";
+import { ParamType } from "./fragments.js";
+import type { BytesLike, CallExceptionAction, CallExceptionError } from "../utils/index.js";
+/**
+ * The **AbiCoder** is a low-level class responsible for encoding JavaScript
+ * values into binary data and decoding binary data into JavaScript values.
+ */
+export declare class AbiCoder {
+ #private;
+ /**
+ * Get the default values for the given %%types%%.
+ *
+ * For example, a ``uint`` is by default ``0`` and ``bool``
+ * is by default ``false``.
+ */
+ getDefaultValue(types: ReadonlyArray): Result;
+ /**
+ * Encode the %%values%% as the %%types%% into ABI data.
+ *
+ * @returns DataHexstring
+ */
+ encode(types: ReadonlyArray, values: ReadonlyArray): string;
+ /**
+ * Decode the ABI %%data%% as the %%types%% into values.
+ *
+ * If %%loose%% decoding is enabled, then strict padding is
+ * not enforced. Some older versions of Solidity incorrectly
+ * padded event data emitted from ``external`` functions.
+ */
+ decode(types: ReadonlyArray, data: BytesLike, loose?: boolean): Result;
+ /**
+ * Returns the shared singleton instance of a default [[AbiCoder]].
+ *
+ * On the first call, the instance is created internally.
+ */
+ static defaultAbiCoder(): AbiCoder;
+ /**
+ * Returns an ethers-compatible [[CallExceptionError]] Error for the given
+ * result %%data%% for the [[CallExceptionAction]] %%action%% against
+ * the Transaction %%tx%%.
+ */
+ static getBuiltinCallException(action: CallExceptionAction, tx: {
+ to?: null | string;
+ from?: null | string;
+ data?: string;
+ }, data: null | BytesLike): CallExceptionError;
+}
+//# sourceMappingURL=abi-coder.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/abi-coder.d.ts.map b/dist/ethers.js/src.ts/abi/abi-coder.d.ts.map
new file mode 100644
index 0000000..43102e2
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/abi-coder.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"abi-coder.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/abi/abi-coder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH,OAAO,EAAiB,MAAM,EAAU,MAAM,4BAA4B,CAAC;AAU3E,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAK3C,OAAO,KAAK,EACR,SAAS,EACT,mBAAmB,EAAE,kBAAkB,EAC1C,MAAM,mBAAmB,CAAC;AAuF3B;;;GAGG;AACH,qBAAa,QAAQ;;IA4CjB;;;;;OAKG;IACH,eAAe,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,MAAM;IAMjE;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GAAG,MAAM;IAWpF;;;;;;OAMG;IACH,MAAM,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM;IAM1F;;;;OAIG;IACH,MAAM,CAAC,eAAe,IAAI,QAAQ;IAOlC;;;;OAIG;IACH,MAAM,CAAC,uBAAuB,CAAC,MAAM,EAAE,mBAAmB,EAAE,EAAE,EAAE;QAAE,EAAE,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,IAAI,EAAE,IAAI,GAAG,SAAS,GAAG,kBAAkB;CAG3K"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/abi-coder.js b/dist/ethers.js/src.ts/abi/abi-coder.js
new file mode 100644
index 0000000..a11155d
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/abi-coder.js
@@ -0,0 +1,214 @@
+"use strict";
+/**
+ * When sending values to or receiving values from a [[Contract]], the
+ * data is generally encoded using the [ABI standard](link-solc-abi).
+ *
+ * The AbiCoder provides a utility to encode values to ABI data and
+ * decode values from ABI data.
+ *
+ * Most of the time, developers should favour the [[Contract]] class,
+ * which further abstracts a lot of the finer details of ABI data.
+ *
+ * @_section api/abi/abi-coder:ABI Encoding
+ */
+var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
+};
+var _AbiCoder_instances, _AbiCoder_getCoder;
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.AbiCoder = void 0;
+// See: https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI
+const index_js_1 = require("../utils/index.js");
+const abstract_coder_js_1 = require("./coders/abstract-coder.js");
+const address_js_1 = require("./coders/address.js");
+const array_js_1 = require("./coders/array.js");
+const boolean_js_1 = require("./coders/boolean.js");
+const bytes_js_1 = require("./coders/bytes.js");
+const fixed_bytes_js_1 = require("./coders/fixed-bytes.js");
+const null_js_1 = require("./coders/null.js");
+const number_js_1 = require("./coders/number.js");
+const string_js_1 = require("./coders/string.js");
+const tuple_js_1 = require("./coders/tuple.js");
+const fragments_js_1 = require("./fragments.js");
+const index_js_2 = require("../address/index.js");
+const index_js_3 = require("../utils/index.js");
+// https://docs.soliditylang.org/en/v0.8.17/control-structures.html
+const PanicReasons = new Map();
+PanicReasons.set(0x00, "GENERIC_PANIC");
+PanicReasons.set(0x01, "ASSERT_FALSE");
+PanicReasons.set(0x11, "OVERFLOW");
+PanicReasons.set(0x12, "DIVIDE_BY_ZERO");
+PanicReasons.set(0x21, "ENUM_RANGE_ERROR");
+PanicReasons.set(0x22, "BAD_STORAGE_DATA");
+PanicReasons.set(0x31, "STACK_UNDERFLOW");
+PanicReasons.set(0x32, "ARRAY_RANGE_ERROR");
+PanicReasons.set(0x41, "OUT_OF_MEMORY");
+PanicReasons.set(0x51, "UNINITIALIZED_FUNCTION_CALL");
+const paramTypeBytes = new RegExp(/^bytes([0-9]*)$/);
+const paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/);
+let defaultCoder = null;
+function getBuiltinCallException(action, tx, data, abiCoder) {
+ let message = "missing revert data";
+ let reason = null;
+ const invocation = null;
+ let revert = null;
+ if (data) {
+ message = "execution reverted";
+ const bytes = (0, index_js_3.getBytes)(data);
+ data = (0, index_js_3.hexlify)(data);
+ if (bytes.length === 0) {
+ message += " (no data present; likely require(false) occurred";
+ reason = "require(false)";
+ }
+ else if (bytes.length % 32 !== 4) {
+ message += " (could not decode reason; invalid data length)";
+ }
+ else if ((0, index_js_3.hexlify)(bytes.slice(0, 4)) === "0x08c379a0") {
+ // Error(string)
+ try {
+ reason = abiCoder.decode(["string"], bytes.slice(4))[0];
+ revert = {
+ signature: "Error(string)",
+ name: "Error",
+ args: [reason]
+ };
+ message += `: ${JSON.stringify(reason)}`;
+ }
+ catch (error) {
+ message += " (could not decode reason; invalid string data)";
+ }
+ }
+ else if ((0, index_js_3.hexlify)(bytes.slice(0, 4)) === "0x4e487b71") {
+ // Panic(uint256)
+ try {
+ const code = Number(abiCoder.decode(["uint256"], bytes.slice(4))[0]);
+ revert = {
+ signature: "Panic(uint256)",
+ name: "Panic",
+ args: [code]
+ };
+ reason = `Panic due to ${PanicReasons.get(code) || "UNKNOWN"}(${code})`;
+ message += `: ${reason}`;
+ }
+ catch (error) {
+ message += " (could not decode panic code)";
+ }
+ }
+ else {
+ message += " (unknown custom error)";
+ }
+ }
+ const transaction = {
+ to: (tx.to ? (0, index_js_2.getAddress)(tx.to) : null),
+ data: (tx.data || "0x")
+ };
+ if (tx.from) {
+ transaction.from = (0, index_js_2.getAddress)(tx.from);
+ }
+ return (0, index_js_3.makeError)(message, "CALL_EXCEPTION", {
+ action, data, reason, transaction, invocation, revert
+ });
+}
+/**
+ * The **AbiCoder** is a low-level class responsible for encoding JavaScript
+ * values into binary data and decoding binary data into JavaScript values.
+ */
+class AbiCoder {
+ constructor() {
+ _AbiCoder_instances.add(this);
+ }
+ /**
+ * Get the default values for the given %%types%%.
+ *
+ * For example, a ``uint`` is by default ``0`` and ``bool``
+ * is by default ``false``.
+ */
+ getDefaultValue(types) {
+ const coders = types.map((type) => __classPrivateFieldGet(this, _AbiCoder_instances, "m", _AbiCoder_getCoder).call(this, fragments_js_1.ParamType.from(type)));
+ const coder = new tuple_js_1.TupleCoder(coders, "_");
+ return coder.defaultValue();
+ }
+ /**
+ * Encode the %%values%% as the %%types%% into ABI data.
+ *
+ * @returns DataHexstring
+ */
+ encode(types, values) {
+ (0, index_js_1.assertArgumentCount)(values.length, types.length, "types/values length mismatch");
+ const coders = types.map((type) => __classPrivateFieldGet(this, _AbiCoder_instances, "m", _AbiCoder_getCoder).call(this, fragments_js_1.ParamType.from(type)));
+ const coder = (new tuple_js_1.TupleCoder(coders, "_"));
+ const writer = new abstract_coder_js_1.Writer();
+ coder.encode(writer, values);
+ return writer.data;
+ }
+ /**
+ * Decode the ABI %%data%% as the %%types%% into values.
+ *
+ * If %%loose%% decoding is enabled, then strict padding is
+ * not enforced. Some older versions of Solidity incorrectly
+ * padded event data emitted from ``external`` functions.
+ */
+ decode(types, data, loose) {
+ const coders = types.map((type) => __classPrivateFieldGet(this, _AbiCoder_instances, "m", _AbiCoder_getCoder).call(this, fragments_js_1.ParamType.from(type)));
+ const coder = new tuple_js_1.TupleCoder(coders, "_");
+ return coder.decode(new abstract_coder_js_1.Reader(data, loose));
+ }
+ /**
+ * Returns the shared singleton instance of a default [[AbiCoder]].
+ *
+ * On the first call, the instance is created internally.
+ */
+ static defaultAbiCoder() {
+ if (defaultCoder == null) {
+ defaultCoder = new AbiCoder();
+ }
+ return defaultCoder;
+ }
+ /**
+ * Returns an ethers-compatible [[CallExceptionError]] Error for the given
+ * result %%data%% for the [[CallExceptionAction]] %%action%% against
+ * the Transaction %%tx%%.
+ */
+ static getBuiltinCallException(action, tx, data) {
+ return getBuiltinCallException(action, tx, data, AbiCoder.defaultAbiCoder());
+ }
+}
+exports.AbiCoder = AbiCoder;
+_AbiCoder_instances = new WeakSet(), _AbiCoder_getCoder = function _AbiCoder_getCoder(param) {
+ if (param.isArray()) {
+ return new array_js_1.ArrayCoder(__classPrivateFieldGet(this, _AbiCoder_instances, "m", _AbiCoder_getCoder).call(this, param.arrayChildren), param.arrayLength, param.name);
+ }
+ if (param.isTuple()) {
+ return new tuple_js_1.TupleCoder(param.components.map((c) => __classPrivateFieldGet(this, _AbiCoder_instances, "m", _AbiCoder_getCoder).call(this, c)), param.name);
+ }
+ switch (param.baseType) {
+ case "address":
+ return new address_js_1.AddressCoder(param.name);
+ case "bool":
+ return new boolean_js_1.BooleanCoder(param.name);
+ case "string":
+ return new string_js_1.StringCoder(param.name);
+ case "bytes":
+ return new bytes_js_1.BytesCoder(param.name);
+ case "":
+ return new null_js_1.NullCoder(param.name);
+ }
+ // u?int[0-9]*
+ let match = param.type.match(paramTypeNumber);
+ if (match) {
+ let size = parseInt(match[2] || "256");
+ (0, index_js_1.assertArgument)(size !== 0 && size <= 256 && (size % 8) === 0, "invalid " + match[1] + " bit length", "param", param);
+ return new number_js_1.NumberCoder(size / 8, (match[1] === "int"), param.name);
+ }
+ // bytes[0-9]+
+ match = param.type.match(paramTypeBytes);
+ if (match) {
+ let size = parseInt(match[1]);
+ (0, index_js_1.assertArgument)(size !== 0 && size <= 32, "invalid bytes length", "param", param);
+ return new fixed_bytes_js_1.FixedBytesCoder(size, param.name);
+ }
+ (0, index_js_1.assertArgument)(false, "invalid type", "type", param.type);
+};
+//# sourceMappingURL=abi-coder.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/abi-coder.js.map b/dist/ethers.js/src.ts/abi/abi-coder.js.map
new file mode 100644
index 0000000..76e4856
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/abi-coder.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"abi-coder.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/abi/abi-coder.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;;;;;;;AAEH,mEAAmE;AAEnE,gDAAwE;AAExE,kEAA2E;AAC3E,oDAAmD;AACnD,gDAA+C;AAC/C,oDAAmD;AACnD,gDAA+C;AAC/C,4DAA0D;AAC1D,8CAA6C;AAC7C,kDAAiD;AACjD,kDAAiD;AACjD,gDAA+C;AAC/C,iDAA2C;AAE3C,kDAAiD;AACjD,gDAAiE;AAOjE,mEAAmE;AACnE,MAAM,YAAY,GAAwB,IAAI,GAAG,EAAE,CAAC;AACpD,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;AACxC,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;AACvC,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;AACnC,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;AACzC,YAAY,CAAC,GAAG,C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AAE;QACP,IAAI,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAC9B,IAAA,yBAAc,EAAC,IAAI,KAAK,CAAC,IAAI,IAAI,IAAI,EAAE,EAAE,sBAAsB,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;QACjF,OAAO,IAAI,gCAAe,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;KAChD;IAED,IAAA,yBAAc,EAAC,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;AAC9D,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/bytes32.d.ts b/dist/ethers.js/src.ts/abi/bytes32.d.ts
new file mode 100644
index 0000000..73455cb
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/bytes32.d.ts
@@ -0,0 +1,15 @@
+/**
+ * About bytes32 strings...
+ *
+ * @_docloc: api/utils:Bytes32 Strings
+ */
+import type { BytesLike } from "../utils/index.js";
+/**
+ * Encodes %%text%% as a Bytes32 string.
+ */
+export declare function encodeBytes32String(text: string): string;
+/**
+ * Encodes the Bytes32-encoded %%bytes%% into a string.
+ */
+export declare function decodeBytes32String(_bytes: BytesLike): string;
+//# sourceMappingURL=bytes32.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/bytes32.d.ts.map b/dist/ethers.js/src.ts/abi/bytes32.d.ts.map
new file mode 100644
index 0000000..5e2fe73
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/bytes32.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"bytes32.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/abi/bytes32.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAUxD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAa7D"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/bytes32.js b/dist/ethers.js/src.ts/abi/bytes32.js
new file mode 100644
index 0000000..e5c22aa
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/bytes32.js
@@ -0,0 +1,45 @@
+"use strict";
+/**
+ * About bytes32 strings...
+ *
+ * @_docloc: api/utils:Bytes32 Strings
+ */
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.decodeBytes32String = exports.encodeBytes32String = void 0;
+const index_js_1 = require("../utils/index.js");
+/**
+ * Encodes %%text%% as a Bytes32 string.
+ */
+function encodeBytes32String(text) {
+ // Get the bytes
+ const bytes = (0, index_js_1.toUtf8Bytes)(text);
+ // Check we have room for null-termination
+ if (bytes.length > 31) {
+ throw new Error("bytes32 string must be less than 32 bytes");
+ }
+ // Zero-pad (implicitly null-terminates)
+ return (0, index_js_1.zeroPadBytes)(bytes, 32);
+}
+exports.encodeBytes32String = encodeBytes32String;
+/**
+ * Encodes the Bytes32-encoded %%bytes%% into a string.
+ */
+function decodeBytes32String(_bytes) {
+ const data = (0, index_js_1.getBytes)(_bytes, "bytes");
+ // Must be 32 bytes with a null-termination
+ if (data.length !== 32) {
+ throw new Error("invalid bytes32 - not 32 bytes long");
+ }
+ if (data[31] !== 0) {
+ throw new Error("invalid bytes32 string - no null terminator");
+ }
+ // Find the null termination
+ let length = 31;
+ while (data[length - 1] === 0) {
+ length--;
+ }
+ // Determine the string value
+ return (0, index_js_1.toUtf8String)(data.slice(0, length));
+}
+exports.decodeBytes32String = decodeBytes32String;
+//# sourceMappingURL=bytes32.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/bytes32.js.map b/dist/ethers.js/src.ts/abi/bytes32.js.map
new file mode 100644
index 0000000..9ee375b
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/bytes32.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"bytes32.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/abi/bytes32.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,gDAE2B;AAI3B;;GAEG;AACH,SAAgB,mBAAmB,CAAC,IAAY;IAE5C,gBAAgB;IAChB,MAAM,KAAK,GAAG,IAAA,sBAAW,EAAC,IAAI,CAAC,CAAC;IAEhC,0CAA0C;IAC1C,IAAI,KAAK,CAAC,MAAM,GAAG,EAAE,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;KAAE;IAExF,wCAAwC;IACxC,OAAO,IAAA,uBAAY,EAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACnC,CAAC;AAVD,kDAUC;AAED;;GAEG;AACH,SAAgB,mBAAmB,CAAC,MAAiB;IACjD,MAAM,IAAI,GAAG,IAAA,mBAAQ,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEvC,2CAA2C;IAC3C,IAAI,IAAI,CAAC,MAAM,KAAK,EAAE,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;KAAE;IACnF,IAAI,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;KAAE;IAEvF,4BAA4B;IAC5B,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE;QAAE,MAAM,EAAE,CAAC;KAAE;IAE5C,6BAA6B;IAC7B,OAAO,IAAA,uBAAY,EAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;AAC/C,CAAC;AAbD,kDAaC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/abstract-coder.d.ts b/dist/ethers.js/src.ts/abi/coders/abstract-coder.d.ts
new file mode 100644
index 0000000..674dc6f
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/abstract-coder.d.ts
@@ -0,0 +1,121 @@
+import type { BigNumberish, BytesLike } from "../../utils/index.js";
+/**
+ * @_ignore:
+ */
+export declare const WordSize: number;
+/**
+ * A [[Result]] is a sub-class of Array, which allows accessing any
+ * of its values either positionally by its index or, if keys are
+ * provided by its name.
+ *
+ * @_docloc: api/abi
+ */
+export declare class Result extends Array {
+ #private;
+ [K: string | number]: any;
+ /**
+ * @private
+ */
+ constructor(...args: Array);
+ /**
+ * Returns the Result as a normal Array.
+ *
+ * This will throw if there are any outstanding deferred
+ * errors.
+ */
+ toArray(): Array;
+ /**
+ * Returns the Result as an Object with each name-value pair.
+ *
+ * This will throw if any value is unnamed, or if there are
+ * any outstanding deferred errors.
+ */
+ toObject(): Record;
+ /**
+ * @_ignore
+ */
+ slice(start?: number | undefined, end?: number | undefined): Result;
+ /**
+ * @_ignore
+ */
+ filter(callback: (el: any, index: number, array: Result) => boolean, thisArg?: any): Result;
+ /**
+ * @_ignore
+ */
+ map(callback: (el: any, index: number, array: Result) => T, thisArg?: any): Array;
+ /**
+ * Returns the value for %%name%%.
+ *
+ * Since it is possible to have a key whose name conflicts with
+ * a method on a [[Result]] or its superclass Array, or any
+ * JavaScript keyword, this ensures all named values are still
+ * accessible by name.
+ */
+ getValue(name: string): any;
+ /**
+ * Creates a new [[Result]] for %%items%% with each entry
+ * also accessible by its corresponding name in %%keys%%.
+ */
+ static fromItems(items: Array, keys?: Array): Result;
+}
+/**
+ * Returns all errors found in a [[Result]].
+ *
+ * Since certain errors encountered when creating a [[Result]] do
+ * not impact the ability to continue parsing data, they are
+ * deferred until they are actually accessed. Hence a faulty string
+ * in an Event that is never used does not impact the program flow.
+ *
+ * However, sometimes it may be useful to access, identify or
+ * validate correctness of a [[Result]].
+ *
+ * @_docloc api/abi
+ */
+export declare function checkResultErrors(result: Result): Array<{
+ path: Array;
+ error: Error;
+}>;
+/**
+ * @_ignore
+ */
+export declare abstract class Coder {
+ readonly name: string;
+ readonly type: string;
+ readonly localName: string;
+ readonly dynamic: boolean;
+ constructor(name: string, type: string, localName: string, dynamic: boolean);
+ _throwError(message: string, value: any): never;
+ abstract encode(writer: Writer, value: any): number;
+ abstract decode(reader: Reader): any;
+ abstract defaultValue(): any;
+}
+/**
+ * @_ignore
+ */
+export declare class Writer {
+ #private;
+ constructor();
+ get data(): string;
+ get length(): number;
+ appendWriter(writer: Writer): number;
+ writeBytes(value: BytesLike): number;
+ writeValue(value: BigNumberish): number;
+ writeUpdatableValue(): (value: BigNumberish) => void;
+}
+/**
+ * @_ignore
+ */
+export declare class Reader {
+ #private;
+ readonly allowLoose: boolean;
+ constructor(data: BytesLike, allowLoose?: boolean);
+ get data(): string;
+ get dataLength(): number;
+ get consumed(): number;
+ get bytes(): Uint8Array;
+ subReader(offset: number): Reader;
+ readBytes(length: number, loose?: boolean): Uint8Array;
+ readValue(): bigint;
+ readIndex(): number;
+}
+//# sourceMappingURL=abstract-coder.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/abstract-coder.d.ts.map b/dist/ethers.js/src.ts/abi/coders/abstract-coder.d.ts.map
new file mode 100644
index 0000000..2178dcb
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/abstract-coder.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"abstract-coder.d.ts","sourceRoot":"","sources":["../../../../../src/ethers.js/src.ts/abi/coders/abstract-coder.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,MAAW,CAAC;AAenC;;;;;;GAMG;AACH,qBAAa,MAAO,SAAQ,KAAK,CAAC,GAAG,CAAC;;IAGlC,CAAE,CAAC,EAAE,MAAM,GAAG,MAAM,GAAI,GAAG,CAAA;IAE3B;;OAEG;gBACS,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CA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a/dist/ethers.js/src.ts/abi/coders/abstract-coder.js b/dist/ethers.js/src.ts/abi/coders/abstract-coder.js
new file mode 100644
index 0000000..bddb331
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/abstract-coder.js
@@ -0,0 +1,404 @@
+"use strict";
+var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
+ if (kind === "m") throw new TypeError("Private method is not writable");
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
+};
+var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
+};
+var _Result_names, _Writer_instances, _Writer_data, _Writer_dataLength, _Writer_writeData, _Reader_instances, _Reader_data, _Reader_offset, _Reader_peekBytes;
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.Reader = exports.Writer = exports.Coder = exports.checkResultErrors = exports.Result = exports.WordSize = void 0;
+const index_js_1 = require("../../utils/index.js");
+/**
+ * @_ignore:
+ */
+exports.WordSize = 32;
+const Padding = new Uint8Array(exports.WordSize);
+// Properties used to immediate pass through to the underlying object
+// - `then` is used to detect if an object is a Promise for await
+const passProperties = ["then"];
+const _guard = {};
+function throwError(name, error) {
+ const wrapped = new Error(`deferred error during ABI decoding triggered accessing ${name}`);
+ wrapped.error = error;
+ throw wrapped;
+}
+/**
+ * A [[Result]] is a sub-class of Array, which allows accessing any
+ * of its values either positionally by its index or, if keys are
+ * provided by its name.
+ *
+ * @_docloc: api/abi
+ */
+class Result extends Array {
+ /**
+ * @private
+ */
+ constructor(...args) {
+ // To properly sub-class Array so the other built-in
+ // functions work, the constructor has to behave fairly
+ // well. So, in the event we are created via fromItems()
+ // we build the read-only Result object we want, but on
+ // any other input, we use the default constructor
+ // constructor(guard: any, items: Array, keys?: Array);
+ const guard = args[0];
+ let items = args[1];
+ let names = (args[2] || []).slice();
+ let wrap = true;
+ if (guard !== _guard) {
+ items = args;
+ names = [];
+ wrap = false;
+ }
+ // Can't just pass in ...items since an array of length 1
+ // is a special case in the super.
+ super(items.length);
+ _Result_names.set(this, void 0);
+ items.forEach((item, index) => { this[index] = item; });
+ // Find all unique keys
+ const nameCounts = names.reduce((accum, name) => {
+ if (typeof (name) === "string") {
+ accum.set(name, (accum.get(name) || 0) + 1);
+ }
+ return accum;
+ }, (new Map()));
+ // Remove any key thats not unique
+ __classPrivateFieldSet(this, _Result_names, Object.freeze(items.map((item, index) => {
+ const name = names[index];
+ if (name != null && nameCounts.get(name) === 1) {
+ return name;
+ }
+ return null;
+ })), "f");
+ if (!wrap) {
+ return;
+ }
+ // A wrapped Result is immutable
+ Object.freeze(this);
+ // Proxy indices and names so we can trap deferred errors
+ return new Proxy(this, {
+ get: (target, prop, receiver) => {
+ if (typeof (prop) === "string") {
+ // Index accessor
+ if (prop.match(/^[0-9]+$/)) {
+ const index = (0, index_js_1.getNumber)(prop, "%index");
+ if (index < 0 || index >= this.length) {
+ throw new RangeError("out of result range");
+ }
+ const item = target[index];
+ if (item instanceof Error) {
+ throwError(`index ${index}`, item);
+ }
+ return item;
+ }
+ // Pass important checks (like `then` for Promise) through
+ if (passProperties.indexOf(prop) >= 0) {
+ return Reflect.get(target, prop, receiver);
+ }
+ const value = target[prop];
+ if (value instanceof Function) {
+ // Make sure functions work with private variables
+ // See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy#no_private_property_forwarding
+ return function (...args) {
+ return value.apply((this === receiver) ? target : this, args);
+ };
+ }
+ else if (!(prop in target)) {
+ // Possible name accessor
+ return target.getValue.apply((this === receiver) ? target : this, [prop]);
+ }
+ }
+ return Reflect.get(target, prop, receiver);
+ }
+ });
+ }
+ /**
+ * Returns the Result as a normal Array.
+ *
+ * This will throw if there are any outstanding deferred
+ * errors.
+ */
+ toArray() {
+ const result = [];
+ this.forEach((item, index) => {
+ if (item instanceof Error) {
+ throwError(`index ${index}`, item);
+ }
+ result.push(item);
+ });
+ return result;
+ }
+ /**
+ * Returns the Result as an Object with each name-value pair.
+ *
+ * This will throw if any value is unnamed, or if there are
+ * any outstanding deferred errors.
+ */
+ toObject() {
+ return __classPrivateFieldGet(this, _Result_names, "f").reduce((accum, name, index) => {
+ (0, index_js_1.assert)(name != null, "value at index ${ index } unnamed", "UNSUPPORTED_OPERATION", {
+ operation: "toObject()"
+ });
+ // Add values for names that don't conflict
+ if (!(name in accum)) {
+ accum[name] = this.getValue(name);
+ }
+ return accum;
+ }, {});
+ }
+ /**
+ * @_ignore
+ */
+ slice(start, end) {
+ if (start == null) {
+ start = 0;
+ }
+ if (start < 0) {
+ start += this.length;
+ if (start < 0) {
+ start = 0;
+ }
+ }
+ if (end == null) {
+ end = this.length;
+ }
+ if (end < 0) {
+ end += this.length;
+ if (end < 0) {
+ end = 0;
+ }
+ }
+ if (end > this.length) {
+ end = this.length;
+ }
+ const result = [], names = [];
+ for (let i = start; i < end; i++) {
+ result.push(this[i]);
+ names.push(__classPrivateFieldGet(this, _Result_names, "f")[i]);
+ }
+ return new Result(_guard, result, names);
+ }
+ /**
+ * @_ignore
+ */
+ filter(callback, thisArg) {
+ const result = [], names = [];
+ for (let i = 0; i < this.length; i++) {
+ const item = this[i];
+ if (item instanceof Error) {
+ throwError(`index ${i}`, item);
+ }
+ if (callback.call(thisArg, item, i, this)) {
+ result.push(item);
+ names.push(__classPrivateFieldGet(this, _Result_names, "f")[i]);
+ }
+ }
+ return new Result(_guard, result, names);
+ }
+ /**
+ * @_ignore
+ */
+ map(callback, thisArg) {
+ const result = [];
+ for (let i = 0; i < this.length; i++) {
+ const item = this[i];
+ if (item instanceof Error) {
+ throwError(`index ${i}`, item);
+ }
+ result.push(callback.call(thisArg, item, i, this));
+ }
+ return result;
+ }
+ /**
+ * Returns the value for %%name%%.
+ *
+ * Since it is possible to have a key whose name conflicts with
+ * a method on a [[Result]] or its superclass Array, or any
+ * JavaScript keyword, this ensures all named values are still
+ * accessible by name.
+ */
+ getValue(name) {
+ const index = __classPrivateFieldGet(this, _Result_names, "f").indexOf(name);
+ if (index === -1) {
+ return undefined;
+ }
+ const value = this[index];
+ if (value instanceof Error) {
+ throwError(`property ${JSON.stringify(name)}`, value.error);
+ }
+ return value;
+ }
+ /**
+ * Creates a new [[Result]] for %%items%% with each entry
+ * also accessible by its corresponding name in %%keys%%.
+ */
+ static fromItems(items, keys) {
+ return new Result(_guard, items, keys);
+ }
+}
+exports.Result = Result;
+_Result_names = new WeakMap();
+/**
+ * Returns all errors found in a [[Result]].
+ *
+ * Since certain errors encountered when creating a [[Result]] do
+ * not impact the ability to continue parsing data, they are
+ * deferred until they are actually accessed. Hence a faulty string
+ * in an Event that is never used does not impact the program flow.
+ *
+ * However, sometimes it may be useful to access, identify or
+ * validate correctness of a [[Result]].
+ *
+ * @_docloc api/abi
+ */
+function checkResultErrors(result) {
+ // Find the first error (if any)
+ const errors = [];
+ const checkErrors = function (path, object) {
+ if (!Array.isArray(object)) {
+ return;
+ }
+ for (let key in object) {
+ const childPath = path.slice();
+ childPath.push(key);
+ try {
+ checkErrors(childPath, object[key]);
+ }
+ catch (error) {
+ errors.push({ path: childPath, error: error });
+ }
+ }
+ };
+ checkErrors([], result);
+ return errors;
+}
+exports.checkResultErrors = checkResultErrors;
+function getValue(value) {
+ let bytes = (0, index_js_1.toBeArray)(value);
+ (0, index_js_1.assert)(bytes.length <= exports.WordSize, "value out-of-bounds", "BUFFER_OVERRUN", { buffer: bytes, length: exports.WordSize, offset: bytes.length });
+ if (bytes.length !== exports.WordSize) {
+ bytes = (0, index_js_1.getBytesCopy)((0, index_js_1.concat)([Padding.slice(bytes.length % exports.WordSize), bytes]));
+ }
+ return bytes;
+}
+/**
+ * @_ignore
+ */
+class Coder {
+ constructor(name, type, localName, dynamic) {
+ (0, index_js_1.defineProperties)(this, { name, type, localName, dynamic }, {
+ name: "string", type: "string", localName: "string", dynamic: "boolean"
+ });
+ }
+ _throwError(message, value) {
+ (0, index_js_1.assertArgument)(false, message, this.localName, value);
+ }
+}
+exports.Coder = Coder;
+/**
+ * @_ignore
+ */
+class Writer {
+ constructor() {
+ _Writer_instances.add(this);
+ // An array of WordSize lengthed objects to concatenation
+ _Writer_data.set(this, void 0);
+ _Writer_dataLength.set(this, void 0);
+ __classPrivateFieldSet(this, _Writer_data, [], "f");
+ __classPrivateFieldSet(this, _Writer_dataLength, 0, "f");
+ }
+ get data() {
+ return (0, index_js_1.concat)(__classPrivateFieldGet(this, _Writer_data, "f"));
+ }
+ get length() { return __classPrivateFieldGet(this, _Writer_dataLength, "f"); }
+ appendWriter(writer) {
+ return __classPrivateFieldGet(this, _Writer_instances, "m", _Writer_writeData).call(this, (0, index_js_1.getBytesCopy)(writer.data));
+ }
+ // Arrayish item; pad on the right to *nearest* WordSize
+ writeBytes(value) {
+ let bytes = (0, index_js_1.getBytesCopy)(value);
+ const paddingOffset = bytes.length % exports.WordSize;
+ if (paddingOffset) {
+ bytes = (0, index_js_1.getBytesCopy)((0, index_js_1.concat)([bytes, Padding.slice(paddingOffset)]));
+ }
+ return __classPrivateFieldGet(this, _Writer_instances, "m", _Writer_writeData).call(this, bytes);
+ }
+ // Numeric item; pad on the left *to* WordSize
+ writeValue(value) {
+ return __classPrivateFieldGet(this, _Writer_instances, "m", _Writer_writeData).call(this, getValue(value));
+ }
+ // Inserts a numeric place-holder, returning a callback that can
+ // be used to asjust the value later
+ writeUpdatableValue() {
+ const offset = __classPrivateFieldGet(this, _Writer_data, "f").length;
+ __classPrivateFieldGet(this, _Writer_data, "f").push(Padding);
+ __classPrivateFieldSet(this, _Writer_dataLength, __classPrivateFieldGet(this, _Writer_dataLength, "f") + exports.WordSize, "f");
+ return (value) => {
+ __classPrivateFieldGet(this, _Writer_data, "f")[offset] = getValue(value);
+ };
+ }
+}
+exports.Writer = Writer;
+_Writer_data = new WeakMap(), _Writer_dataLength = new WeakMap(), _Writer_instances = new WeakSet(), _Writer_writeData = function _Writer_writeData(data) {
+ __classPrivateFieldGet(this, _Writer_data, "f").push(data);
+ __classPrivateFieldSet(this, _Writer_dataLength, __classPrivateFieldGet(this, _Writer_dataLength, "f") + data.length, "f");
+ return data.length;
+};
+/**
+ * @_ignore
+ */
+class Reader {
+ constructor(data, allowLoose) {
+ _Reader_instances.add(this);
+ _Reader_data.set(this, void 0);
+ _Reader_offset.set(this, void 0);
+ (0, index_js_1.defineProperties)(this, { allowLoose: !!allowLoose });
+ __classPrivateFieldSet(this, _Reader_data, (0, index_js_1.getBytesCopy)(data), "f");
+ __classPrivateFieldSet(this, _Reader_offset, 0, "f");
+ }
+ get data() { return (0, index_js_1.hexlify)(__classPrivateFieldGet(this, _Reader_data, "f")); }
+ get dataLength() { return __classPrivateFieldGet(this, _Reader_data, "f").length; }
+ get consumed() { return __classPrivateFieldGet(this, _Reader_offset, "f"); }
+ get bytes() { return new Uint8Array(__classPrivateFieldGet(this, _Reader_data, "f")); }
+ // Create a sub-reader with the same underlying data, but offset
+ subReader(offset) {
+ return new Reader(__classPrivateFieldGet(this, _Reader_data, "f").slice(__classPrivateFieldGet(this, _Reader_offset, "f") + offset), this.allowLoose);
+ }
+ // Read bytes
+ readBytes(length, loose) {
+ let bytes = __classPrivateFieldGet(this, _Reader_instances, "m", _Reader_peekBytes).call(this, 0, length, !!loose);
+ __classPrivateFieldSet(this, _Reader_offset, __classPrivateFieldGet(this, _Reader_offset, "f") + bytes.length, "f");
+ // @TODO: Make sure the length..end bytes are all 0?
+ return bytes.slice(0, length);
+ }
+ // Read a numeric values
+ readValue() {
+ return (0, index_js_1.toBigInt)(this.readBytes(exports.WordSize));
+ }
+ readIndex() {
+ return (0, index_js_1.toNumber)(this.readBytes(exports.WordSize));
+ }
+}
+exports.Reader = Reader;
+_Reader_data = new WeakMap(), _Reader_offset = new WeakMap(), _Reader_instances = new WeakSet(), _Reader_peekBytes = function _Reader_peekBytes(offset, length, loose) {
+ let alignedLength = Math.ceil(length / exports.WordSize) * exports.WordSize;
+ if (__classPrivateFieldGet(this, _Reader_offset, "f") + alignedLength > __classPrivateFieldGet(this, _Reader_data, "f").length) {
+ if (this.allowLoose && loose && __classPrivateFieldGet(this, _Reader_offset, "f") + length <= __classPrivateFieldGet(this, _Reader_data, "f").length) {
+ alignedLength = length;
+ }
+ else {
+ (0, index_js_1.assert)(false, "data out-of-bounds", "BUFFER_OVERRUN", {
+ buffer: (0, index_js_1.getBytesCopy)(__classPrivateFieldGet(this, _Reader_data, "f")),
+ length: __classPrivateFieldGet(this, _Reader_data, "f").length,
+ offset: __classPrivateFieldGet(this, _Reader_offset, "f") + alignedLength
+ });
+ }
+ }
+ return __classPrivateFieldGet(this, _Reader_data, "f").slice(__classPrivateFieldGet(this, _Reader_offset, "f"), __classPrivateFieldGet(this, _Reader_offset, "f") + alignedLength);
+};
+//# sourceMappingURL=abstract-coder.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/abstract-coder.js.map b/dist/ethers.js/src.ts/abi/coders/abstract-coder.js.map
new file mode 100644
index 0000000..4cb96d1
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/abstract-coder.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"abstract-coder.js","sourceRoot":"","sources":["../../../../../src/ethers.js/src.ts/abi/coders/abstract-coder.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,mDAI8B;AAI9B;;GAEG;AACU,QAAA,QAAQ,GAAW,EAAE,CAAC;AACnC,MAAM,OAAO,GAAG,IAAI,UAAU,CAAC,gBAAQ,CAAC,CAAC;AAEzC,qEAAqE;AACrE,iEAAiE;AACjE,MAAM,cAAc,GAAG,CAAE,M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AAM;gBACzB,MAAM,EAAE,uBAAA,IAAI,sBAAQ,GAAG,aAAa;aACvC,CAAC,CAAC;SACN;KACJ;IACD,OAAO,uBAAA,IAAI,oBAAM,CAAC,KAAK,CAAC,uBAAA,IAAI,sBAAQ,EAAE,uBAAA,IAAI,sBAAQ,GAAG,aAAa,CAAC,CAAA;AACvE,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/address.d.ts b/dist/ethers.js/src.ts/abi/coders/address.d.ts
new file mode 100644
index 0000000..8befac0
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/address.d.ts
@@ -0,0 +1,13 @@
+import { Typed } from "../typed.js";
+import { Coder } from "./abstract-coder.js";
+import type { Reader, Writer } from "./abstract-coder.js";
+/**
+ * @_ignore
+ */
+export declare class AddressCoder extends Coder {
+ constructor(localName: string);
+ defaultValue(): string;
+ encode(writer: Writer, _value: string | Typed): number;
+ decode(reader: Reader): any;
+}
+//# sourceMappingURL=address.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/address.d.ts.map b/dist/ethers.js/src.ts/abi/coders/address.d.ts.map
new file mode 100644
index 0000000..1dbcb8e
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/address.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../../../../src/ethers.js/src.ts/abi/coders/address.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAG1D;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;gBAEvB,SAAS,EAAE,MAAM;IAI7B,YAAY,IAAI,MAAM;IAItB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM;IAUtD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG9B"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/address.js b/dist/ethers.js/src.ts/abi/coders/address.js
new file mode 100644
index 0000000..6594083
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/address.js
@@ -0,0 +1,33 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.AddressCoder = void 0;
+const index_js_1 = require("../../address/index.js");
+const maths_js_1 = require("../../utils/maths.js");
+const typed_js_1 = require("../typed.js");
+const abstract_coder_js_1 = require("./abstract-coder.js");
+/**
+ * @_ignore
+ */
+class AddressCoder extends abstract_coder_js_1.Coder {
+ constructor(localName) {
+ super("address", "address", localName, false);
+ }
+ defaultValue() {
+ return "0x0000000000000000000000000000000000000000";
+ }
+ encode(writer, _value) {
+ let value = typed_js_1.Typed.dereference(_value, "string");
+ try {
+ value = (0, index_js_1.getAddress)(value);
+ }
+ catch (error) {
+ return this._throwError(error.message, _value);
+ }
+ return writer.writeValue(value);
+ }
+ decode(reader) {
+ return (0, index_js_1.getAddress)((0, maths_js_1.toBeHex)(reader.readValue(), 20));
+ }
+}
+exports.AddressCoder = AddressCoder;
+//# sourceMappingURL=address.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/address.js.map b/dist/ethers.js/src.ts/abi/coders/address.js.map
new file mode 100644
index 0000000..5230de5
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/address.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"address.js","sourceRoot":"","sources":["../../../../../src/ethers.js/src.ts/abi/coders/address.ts"],"names":[],"mappings":";;;AAAA,qDAAoD;AACpD,mDAA+C;AAE/C,0CAAoC;AACpC,2DAA4C;AAK5C;;GAEG;AACH,MAAa,YAAa,SAAQ,yBAAK;IAEnC,YAAY,SAAiB;QACzB,KAAK,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IAClD,CAAC;IAED,YAAY;QACR,OAAO,4CAA4C,CAAC;IACxD,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,MAAsB;QACzC,IAAI,KAAK,GAAG,gBAAK,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAChD,IAAI;YACA,KAAK,GAAG,IAAA,qBAAU,EAAC,KAAK,CAAC,CAAC;SAC7B;QAAC,OAAO,KAAU,EAAE;YACjB,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;SAClD;QACD,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;IAED,MAAM,CAAC,MAAc;QACjB,OAAO,IAAA,qBAAU,EAAC,IAAA,kBAAO,EAAC,MAAM,CAAC,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IACvD,CAAC;CACJ;AAvBD,oCAuBC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/anonymous.d.ts b/dist/ethers.js/src.ts/abi/coders/anonymous.d.ts
new file mode 100644
index 0000000..554bf03
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/anonymous.d.ts
@@ -0,0 +1,15 @@
+import { Coder } from "./abstract-coder.js";
+import type { Reader, Writer } from "./abstract-coder.js";
+/**
+ * Clones the functionality of an existing Coder, but without a localName
+ *
+ * @_ignore
+ */
+export declare class AnonymousCoder extends Coder {
+ private coder;
+ constructor(coder: Coder);
+ defaultValue(): any;
+ encode(writer: Writer, value: any): number;
+ decode(reader: Reader): any;
+}
+//# sourceMappingURL=anonymous.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/anonymous.d.ts.map b/dist/ethers.js/src.ts/abi/coders/anonymous.d.ts.map
new file mode 100644
index 0000000..488cdba
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/anonymous.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"anonymous.d.ts","sourceRoot":"","sources":["../../../../../src/ethers.js/src.ts/abi/coders/anonymous.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;;;GAIG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACrC,OAAO,CAAC,KAAK,CAAQ;gBAET,KAAK,EAAE,KAAK;IAKxB,YAAY,IAAI,GAAG;IAInB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM;IAI1C,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG9B"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/anonymous.js b/dist/ethers.js/src.ts/abi/coders/anonymous.js
new file mode 100644
index 0000000..89edf22
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/anonymous.js
@@ -0,0 +1,26 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.AnonymousCoder = void 0;
+const abstract_coder_js_1 = require("./abstract-coder.js");
+/**
+ * Clones the functionality of an existing Coder, but without a localName
+ *
+ * @_ignore
+ */
+class AnonymousCoder extends abstract_coder_js_1.Coder {
+ constructor(coder) {
+ super(coder.name, coder.type, "_", coder.dynamic);
+ this.coder = coder;
+ }
+ defaultValue() {
+ return this.coder.defaultValue();
+ }
+ encode(writer, value) {
+ return this.coder.encode(writer, value);
+ }
+ decode(reader) {
+ return this.coder.decode(reader);
+ }
+}
+exports.AnonymousCoder = AnonymousCoder;
+//# sourceMappingURL=anonymous.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/anonymous.js.map b/dist/ethers.js/src.ts/abi/coders/anonymous.js.map
new file mode 100644
index 0000000..2836a87
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/anonymous.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"anonymous.js","sourceRoot":"","sources":["../../../../../src/ethers.js/src.ts/abi/coders/anonymous.ts"],"names":[],"mappings":";;;AAAA,2DAA4C;AAI5C;;;;GAIG;AACH,MAAa,cAAe,SAAQ,yBAAK;IAGrC,YAAY,KAAY;QACpB,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QAClD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;IAED,YAAY;QACR,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC;IACrC,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,KAAU;QAC7B,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC5C,CAAC;IAED,MAAM,CAAC,MAAc;QACjB,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACrC,CAAC;CACJ;AAnBD,wCAmBC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/array.d.ts b/dist/ethers.js/src.ts/abi/coders/array.d.ts
new file mode 100644
index 0000000..954c4e1
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/array.d.ts
@@ -0,0 +1,25 @@
+import { Typed } from "../typed.js";
+import { Coder, Result, Writer } from "./abstract-coder.js";
+import type { Reader } from "./abstract-coder.js";
+/**
+ * @_ignore
+ */
+export declare function pack(writer: Writer, coders: ReadonlyArray, values: Array | {
+ [name: string]: any;
+}): number;
+/**
+ * @_ignore
+ */
+export declare function unpack(reader: Reader, coders: ReadonlyArray): Result;
+/**
+ * @_ignore
+ */
+export declare class ArrayCoder extends Coder {
+ readonly coder: Coder;
+ readonly length: number;
+ constructor(coder: Coder, length: number, localName: string);
+ defaultValue(): Array;
+ encode(writer: Writer, _value: Array | Typed): number;
+ decode(reader: Reader): any;
+}
+//# sourceMappingURL=array.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/array.d.ts.map b/dist/ethers.js/src.ts/abi/coders/array.d.ts.map
new file mode 100644
index 0000000..be62d6f
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/array.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../../../../src/ethers.js/src.ts/abi/coders/array.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAY,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAGtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD;;GAEG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG;IAAE,CAAE,IAAI,EAAE,MAAM,GAAI,GAAG,CAAA;CAAE,GAAG,MAAM,CA2DzH;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC,GAAG,MAAM,CAoD3E;AAED;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACjC,QAAQ,CAAC,KAAK,EAAG,KAAK,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;gBAEb,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAO3D,YAAY,IAAI,KAAK,CAAC,GAAG,CAAC;IAW1B,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,GAAG,MAAM;IAsB1D,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAkB9B"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/array.js b/dist/ethers.js/src.ts/abi/coders/array.js
new file mode 100644
index 0000000..8eb50a3
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/array.js
@@ -0,0 +1,163 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.ArrayCoder = exports.unpack = exports.pack = void 0;
+const index_js_1 = require("../../utils/index.js");
+const typed_js_1 = require("../typed.js");
+const abstract_coder_js_1 = require("./abstract-coder.js");
+const anonymous_js_1 = require("./anonymous.js");
+/**
+ * @_ignore
+ */
+function pack(writer, coders, values) {
+ let arrayValues = [];
+ if (Array.isArray(values)) {
+ arrayValues = values;
+ }
+ else if (values && typeof (values) === "object") {
+ let unique = {};
+ arrayValues = coders.map((coder) => {
+ const name = coder.localName;
+ (0, index_js_1.assert)(name, "cannot encode object for signature with missing names", "INVALID_ARGUMENT", { argument: "values", info: { coder }, value: values });
+ (0, index_js_1.assert)(!unique[name], "cannot encode object for signature with duplicate names", "INVALID_ARGUMENT", { argument: "values", info: { coder }, value: values });
+ unique[name] = true;
+ return values[name];
+ });
+ }
+ else {
+ (0, index_js_1.assertArgument)(false, "invalid tuple value", "tuple", values);
+ }
+ (0, index_js_1.assertArgument)(coders.length === arrayValues.length, "types/value length mismatch", "tuple", values);
+ let staticWriter = new abstract_coder_js_1.Writer();
+ let dynamicWriter = new abstract_coder_js_1.Writer();
+ let updateFuncs = [];
+ coders.forEach((coder, index) => {
+ let value = arrayValues[index];
+ if (coder.dynamic) {
+ // Get current dynamic offset (for the future pointer)
+ let dynamicOffset = dynamicWriter.length;
+ // Encode the dynamic value into the dynamicWriter
+ coder.encode(dynamicWriter, value);
+ // Prepare to populate the correct offset once we are done
+ let updateFunc = staticWriter.writeUpdatableValue();
+ updateFuncs.push((baseOffset) => {
+ updateFunc(baseOffset + dynamicOffset);
+ });
+ }
+ else {
+ coder.encode(staticWriter, value);
+ }
+ });
+ // Backfill all the dynamic offsets, now that we know the static length
+ updateFuncs.forEach((func) => { func(staticWriter.length); });
+ let length = writer.appendWriter(staticWriter);
+ length += writer.appendWriter(dynamicWriter);
+ return length;
+}
+exports.pack = pack;
+/**
+ * @_ignore
+ */
+function unpack(reader, coders) {
+ let values = [];
+ let keys = [];
+ // A reader anchored to this base
+ let baseReader = reader.subReader(0);
+ coders.forEach((coder) => {
+ let value = null;
+ if (coder.dynamic) {
+ let offset = reader.readIndex();
+ let offsetReader = baseReader.subReader(offset);
+ try {
+ value = coder.decode(offsetReader);
+ }
+ catch (error) {
+ // Cannot recover from this
+ if ((0, index_js_1.isError)(error, "BUFFER_OVERRUN")) {
+ throw error;
+ }
+ value = error;
+ value.baseType = coder.name;
+ value.name = coder.localName;
+ value.type = coder.type;
+ }
+ }
+ else {
+ try {
+ value = coder.decode(reader);
+ }
+ catch (error) {
+ // Cannot recover from this
+ if ((0, index_js_1.isError)(error, "BUFFER_OVERRUN")) {
+ throw error;
+ }
+ value = error;
+ value.baseType = coder.name;
+ value.name = coder.localName;
+ value.type = coder.type;
+ }
+ }
+ if (value == undefined) {
+ throw new Error("investigate");
+ }
+ values.push(value);
+ keys.push(coder.localName || null);
+ });
+ return abstract_coder_js_1.Result.fromItems(values, keys);
+}
+exports.unpack = unpack;
+/**
+ * @_ignore
+ */
+class ArrayCoder extends abstract_coder_js_1.Coder {
+ constructor(coder, length, localName) {
+ const type = (coder.type + "[" + (length >= 0 ? length : "") + "]");
+ const dynamic = (length === -1 || coder.dynamic);
+ super("array", type, localName, dynamic);
+ (0, index_js_1.defineProperties)(this, { coder, length });
+ }
+ defaultValue() {
+ // Verifies the child coder is valid (even if the array is dynamic or 0-length)
+ const defaultChild = this.coder.defaultValue();
+ const result = [];
+ for (let i = 0; i < this.length; i++) {
+ result.push(defaultChild);
+ }
+ return result;
+ }
+ encode(writer, _value) {
+ const value = typed_js_1.Typed.dereference(_value, "array");
+ if (!Array.isArray(value)) {
+ this._throwError("expected array value", value);
+ }
+ let count = this.length;
+ if (count === -1) {
+ count = value.length;
+ writer.writeValue(value.length);
+ }
+ (0, index_js_1.assertArgumentCount)(value.length, count, "coder array" + (this.localName ? (" " + this.localName) : ""));
+ let coders = [];
+ for (let i = 0; i < value.length; i++) {
+ coders.push(this.coder);
+ }
+ return pack(writer, coders, value);
+ }
+ decode(reader) {
+ let count = this.length;
+ if (count === -1) {
+ count = reader.readIndex();
+ // Check that there is *roughly* enough data to ensure
+ // stray random data is not being read as a length. Each
+ // slot requires at least 32 bytes for their value (or 32
+ // bytes as a link to the data). This could use a much
+ // tighter bound, but we are erroring on the side of safety.
+ (0, index_js_1.assert)(count * abstract_coder_js_1.WordSize <= reader.dataLength, "insufficient data length", "BUFFER_OVERRUN", { buffer: reader.bytes, offset: count * abstract_coder_js_1.WordSize, length: reader.dataLength });
+ }
+ let coders = [];
+ for (let i = 0; i < count; i++) {
+ coders.push(new anonymous_js_1.AnonymousCoder(this.coder));
+ }
+ return unpack(reader, coders);
+ }
+}
+exports.ArrayCoder = ArrayCoder;
+//# sourceMappingURL=array.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/array.js.map b/dist/ethers.js/src.ts/abi/coders/array.js.map
new file mode 100644
index 0000000..2369808
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/array.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"array.js","sourceRoot":"","sources":["../../../../../src/ethers.js/src.ts/abi/coders/array.ts"],"names":[],"mappings":";;;AAAA,mDAE8B;AAE9B,0CAAoC;AAEpC,2DAAsE;AACtE,iDAAgD;AAIhD;;GAEG;AACH,SAAgB,IAAI,CAAC,MAAc,EAAE,MAA4B,EAAE,MAA8C;IAC7G,IAAI,WAAW,GAAe,EAAG,CAAC;IAElC,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QACxB,WAAW,GAAG,MAAM,CAAC;KAEvB;SAAM,IAAI,MAAM,IAAI,OAAM,CAAC,MAAM,CAAC,KAAK,QAAQ,EAAE;QAC9C,IAAI,MA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olean.d.ts
new file mode 100644
index 0000000..f073e37
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/boolean.d.ts
@@ -0,0 +1,13 @@
+import { Typed } from "../typed.js";
+import { Coder } from "./abstract-coder.js";
+import type { Reader, Writer } from "./abstract-coder.js";
+/**
+ * @_ignore
+ */
+export declare class BooleanCoder extends Coder {
+ constructor(localName: string);
+ defaultValue(): boolean;
+ encode(writer: Writer, _value: boolean | Typed): number;
+ decode(reader: Reader): any;
+}
+//# sourceMappingURL=boolean.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/boolean.d.ts.map b/dist/ethers.js/src.ts/abi/coders/boolean.d.ts.map
new file mode 100644
index 0000000..2c0457d
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/boolean.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"boolean.d.ts","sourceRoot":"","sources":["../../../../../src/ethers.js/src.ts/abi/coders/boolean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;gBAEvB,SAAS,EAAE,MAAM;IAI7B,YAAY,IAAI,OAAO;IAIvB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM;IAKvD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG9B"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/boolean.js b/dist/ethers.js/src.ts/abi/coders/boolean.js
new file mode 100644
index 0000000..bc8b507
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/boolean.js
@@ -0,0 +1,25 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.BooleanCoder = void 0;
+const typed_js_1 = require("../typed.js");
+const abstract_coder_js_1 = require("./abstract-coder.js");
+/**
+ * @_ignore
+ */
+class BooleanCoder extends abstract_coder_js_1.Coder {
+ constructor(localName) {
+ super("bool", "bool", localName, false);
+ }
+ defaultValue() {
+ return false;
+ }
+ encode(writer, _value) {
+ const value = typed_js_1.Typed.dereference(_value, "bool");
+ return writer.writeValue(value ? 1 : 0);
+ }
+ decode(reader) {
+ return !!reader.readValue();
+ }
+}
+exports.BooleanCoder = BooleanCoder;
+//# sourceMappingURL=boolean.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/boolean.js.map b/dist/ethers.js/src.ts/abi/coders/boolean.js.map
new file mode 100644
index 0000000..d4841ff
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/boolean.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"boolean.js","sourceRoot":"","sources":["../../../../../src/ethers.js/src.ts/abi/coders/boolean.ts"],"names":[],"mappings":";;;AAAA,0CAAoC;AACpC,2DAA4C;AAI5C;;GAEG;AACH,MAAa,YAAa,SAAQ,yBAAK;IAEnC,YAAY,SAAiB;QACzB,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IAC5C,CAAC;IAED,YAAY;QACR,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,MAAuB;QAC1C,MAAM,KAAK,GAAG,gBAAK,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAChD,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3C,CAAC;IAED,MAAM,CAAC,MAAc;QACjB,OAAO,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;IAChC,CAAC;CACJ;AAlBD,oCAkBC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/bytes.d.ts b/dist/ethers.js/src.ts/abi/coders/bytes.d.ts
new file mode 100644
index 0000000..1e55458
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/bytes.d.ts
@@ -0,0 +1,19 @@
+import { Coder } from "./abstract-coder.js";
+import type { Reader, Writer } from "./abstract-coder.js";
+/**
+ * @_ignore
+ */
+export declare class DynamicBytesCoder extends Coder {
+ constructor(type: string, localName: string);
+ defaultValue(): string;
+ encode(writer: Writer, value: any): number;
+ decode(reader: Reader): any;
+}
+/**
+ * @_ignore
+ */
+export declare class BytesCoder extends DynamicBytesCoder {
+ constructor(localName: string);
+ decode(reader: Reader): any;
+}
+//# sourceMappingURL=bytes.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/bytes.d.ts.map b/dist/ethers.js/src.ts/abi/coders/bytes.d.ts.map
new file mode 100644
index 0000000..648b308
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/bytes.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"bytes.d.ts","sourceRoot":"","sources":["../../../../../src/ethers.js/src.ts/abi/coders/bytes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAG1D;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;gBAC5B,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAI3C,YAAY,IAAI,MAAM;IAItB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM;IAO1C,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG9B;AAED;;GAEG;AACH,qBAAa,UAAW,SAAQ,iBAAiB;gBACjC,SAAS,EAAE,MAAM;IAI7B,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG9B"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/bytes.js b/dist/ethers.js/src.ts/abi/coders/bytes.js
new file mode 100644
index 0000000..0788ed6
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/bytes.js
@@ -0,0 +1,39 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.BytesCoder = exports.DynamicBytesCoder = void 0;
+const index_js_1 = require("../../utils/index.js");
+const abstract_coder_js_1 = require("./abstract-coder.js");
+/**
+ * @_ignore
+ */
+class DynamicBytesCoder extends abstract_coder_js_1.Coder {
+ constructor(type, localName) {
+ super(type, type, localName, true);
+ }
+ defaultValue() {
+ return "0x";
+ }
+ encode(writer, value) {
+ value = (0, index_js_1.getBytesCopy)(value);
+ let length = writer.writeValue(value.length);
+ length += writer.writeBytes(value);
+ return length;
+ }
+ decode(reader) {
+ return reader.readBytes(reader.readIndex(), true);
+ }
+}
+exports.DynamicBytesCoder = DynamicBytesCoder;
+/**
+ * @_ignore
+ */
+class BytesCoder extends DynamicBytesCoder {
+ constructor(localName) {
+ super("bytes", localName);
+ }
+ decode(reader) {
+ return (0, index_js_1.hexlify)(super.decode(reader));
+ }
+}
+exports.BytesCoder = BytesCoder;
+//# sourceMappingURL=bytes.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/bytes.js.map b/dist/ethers.js/src.ts/abi/coders/bytes.js.map
new file mode 100644
index 0000000..699ad70
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/bytes.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"bytes.js","sourceRoot":"","sources":["../../../../../src/ethers.js/src.ts/abi/coders/bytes.ts"],"names":[],"mappings":";;;AAAA,mDAA6D;AAE7D,2DAA4C;AAK5C;;GAEG;AACH,MAAa,iBAAkB,SAAQ,yBAAK;IACxC,YAAY,IAAY,EAAE,SAAiB;QACxC,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;IACtC,CAAC;IAED,YAAY;QACR,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,KAAU;QAC7B,KAAK,GAAG,IAAA,uBAAY,EAAC,KAAK,CAAC,CAAC;QAC5B,IAAI,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC7C,MAAM,IAAI,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACnC,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,MAAM,CAAC,MAAc;QACjB,OAAO,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,IAAI,CAAC,CAAC;IACtD,CAAC;CACJ;AAnBD,8CAmBC;AAED;;GAEG;AACH,MAAa,UAAW,SAAQ,iBAAiB;IAC7C,YAAY,SAAiB;QACzB,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAC9B,CAAC;IAED,MAAM,CAAC,MAAc;QACjB,OAAO,IAAA,kBAAO,EAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IACzC,CAAC;CACJ;AARD,gCAQC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/fixed-bytes.d.ts b/dist/ethers.js/src.ts/abi/coders/fixed-bytes.d.ts
new file mode 100644
index 0000000..5c485fe
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/fixed-bytes.d.ts
@@ -0,0 +1,15 @@
+import { Typed } from "../typed.js";
+import { Coder } from "./abstract-coder.js";
+import type { BytesLike } from "../../utils/index.js";
+import type { Reader, Writer } from "./abstract-coder.js";
+/**
+ * @_ignore
+ */
+export declare class FixedBytesCoder extends Coder {
+ readonly size: number;
+ constructor(size: number, localName: string);
+ defaultValue(): string;
+ encode(writer: Writer, _value: BytesLike | Typed): number;
+ decode(reader: Reader): any;
+}
+//# sourceMappingURL=fixed-bytes.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/fixed-bytes.d.ts.map b/dist/ethers.js/src.ts/abi/coders/fixed-bytes.d.ts.map
new file mode 100644
index 0000000..bab1583
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/fixed-bytes.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"fixed-bytes.d.ts","sourceRoot":"","sources":["../../../../../src/ethers.js/src.ts/abi/coders/fixed-bytes.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAG1D;;GAEG;AACH,qBAAa,eAAgB,SAAQ,KAAK;IACtC,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;gBAEX,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAM3C,YAAY,IAAI,MAAM;IAItB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,GAAG,KAAK,GAAG,MAAM;IAMzD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG9B"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/fixed-bytes.js b/dist/ethers.js/src.ts/abi/coders/fixed-bytes.js
new file mode 100644
index 0000000..13b8403
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/fixed-bytes.js
@@ -0,0 +1,31 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.FixedBytesCoder = void 0;
+const index_js_1 = require("../../utils/index.js");
+const typed_js_1 = require("../typed.js");
+const abstract_coder_js_1 = require("./abstract-coder.js");
+/**
+ * @_ignore
+ */
+class FixedBytesCoder extends abstract_coder_js_1.Coder {
+ constructor(size, localName) {
+ let name = "bytes" + String(size);
+ super(name, name, localName, false);
+ (0, index_js_1.defineProperties)(this, { size }, { size: "number" });
+ }
+ defaultValue() {
+ return ("0x0000000000000000000000000000000000000000000000000000000000000000").substring(0, 2 + this.size * 2);
+ }
+ encode(writer, _value) {
+ let data = (0, index_js_1.getBytesCopy)(typed_js_1.Typed.dereference(_value, this.type));
+ if (data.length !== this.size) {
+ this._throwError("incorrect data length", _value);
+ }
+ return writer.writeBytes(data);
+ }
+ decode(reader) {
+ return (0, index_js_1.hexlify)(reader.readBytes(this.size));
+ }
+}
+exports.FixedBytesCoder = FixedBytesCoder;
+//# sourceMappingURL=fixed-bytes.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/fixed-bytes.js.map b/dist/ethers.js/src.ts/abi/coders/fixed-bytes.js.map
new file mode 100644
index 0000000..2b88a00
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/fixed-bytes.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"fixed-bytes.js","sourceRoot":"","sources":["../../../../../src/ethers.js/src.ts/abi/coders/fixed-bytes.ts"],"names":[],"mappings":";;;AACA,mDAA+E;AAE/E,0CAAoC;AACpC,2DAA4C;AAO5C;;GAEG;AACH,MAAa,eAAgB,SAAQ,yBAAK;IAGtC,YAAY,IAAY,EAAE,SAAiB;QACvC,IAAI,IAAI,GAAG,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;QAClC,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;QACpC,IAAA,2BAAgB,EAAkB,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC1E,CAAC;IAED,YAAY;QACR,OAAO,CAAC,oEAAoE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;IAClH,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,MAAyB;QAC5C,IAAI,IAAI,GAAG,IAAA,uBAAY,EAAC,gBAAK,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC9D,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,IAAI,EAAE;YAAE,IAAI,CAAC,WAAW,CAAC,uBAAuB,EAAE,MAAM,CAAC,CAAC;SAAE;QACrF,OAAO,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,MAAM,CAAC,MAAc;QACjB,OAAO,IAAA,kBAAO,EAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAChD,CAAC;CACJ;AAtBD,0CAsBC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/null.d.ts b/dist/ethers.js/src.ts/abi/coders/null.d.ts
new file mode 100644
index 0000000..5df5da3
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/null.d.ts
@@ -0,0 +1,12 @@
+import { Coder } from "./abstract-coder.js";
+import type { Reader, Writer } from "./abstract-coder.js";
+/**
+ * @_ignore
+ */
+export declare class NullCoder extends Coder {
+ constructor(localName: string);
+ defaultValue(): null;
+ encode(writer: Writer, value: any): number;
+ decode(reader: Reader): any;
+}
+//# sourceMappingURL=null.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/null.d.ts.map b/dist/ethers.js/src.ts/abi/coders/null.d.ts.map
new file mode 100644
index 0000000..c2af4d9
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/null.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"null.d.ts","sourceRoot":"","sources":["../../../../../src/ethers.js/src.ts/abi/coders/null.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAI1D;;GAEG;AACH,qBAAa,SAAU,SAAQ,KAAK;gBAEpB,SAAS,EAAE,MAAM;IAI7B,YAAY,IAAI,IAAI;IAIpB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM;IAK1C,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAI9B"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/null.js b/dist/ethers.js/src.ts/abi/coders/null.js
new file mode 100644
index 0000000..e9af005
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/null.js
@@ -0,0 +1,28 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.NullCoder = void 0;
+const abstract_coder_js_1 = require("./abstract-coder.js");
+const Empty = new Uint8Array([]);
+/**
+ * @_ignore
+ */
+class NullCoder extends abstract_coder_js_1.Coder {
+ constructor(localName) {
+ super("null", "", localName, false);
+ }
+ defaultValue() {
+ return null;
+ }
+ encode(writer, value) {
+ if (value != null) {
+ this._throwError("not null", value);
+ }
+ return writer.writeBytes(Empty);
+ }
+ decode(reader) {
+ reader.readBytes(0);
+ return null;
+ }
+}
+exports.NullCoder = NullCoder;
+//# sourceMappingURL=null.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/null.js.map b/dist/ethers.js/src.ts/abi/coders/null.js.map
new file mode 100644
index 0000000..762f792
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/null.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"null.js","sourceRoot":"","sources":["../../../../../src/ethers.js/src.ts/abi/coders/null.ts"],"names":[],"mappings":";;;AAAA,2DAA4C;AAG5C,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,EAAG,CAAC,CAAC;AAElC;;GAEG;AACH,MAAa,SAAU,SAAQ,yBAAK;IAEhC,YAAY,SAAiB;QACzB,KAAK,CAAC,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IACxC,CAAC;IAED,YAAY;QACR,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,KAAU;QAC7B,IAAI,KAAK,IAAI,IAAI,EAAE;YAAE,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;SAAE;QAC3D,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;IAED,MAAM,CAAC,MAAc;QACjB,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QACpB,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAnBD,8BAmBC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/number.d.ts b/dist/ethers.js/src.ts/abi/coders/number.d.ts
new file mode 100644
index 0000000..822cc6d
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/number.d.ts
@@ -0,0 +1,16 @@
+import { Typed } from "../typed.js";
+import { Coder } from "./abstract-coder.js";
+import type { BigNumberish } from "../../utils/index.js";
+import type { Reader, Writer } from "./abstract-coder.js";
+/**
+ * @_ignore
+ */
+export declare class NumberCoder extends Coder {
+ readonly size: number;
+ readonly signed: boolean;
+ constructor(size: number, signed: boolean, localName: string);
+ defaultValue(): number;
+ encode(writer: Writer, _value: BigNumberish | Typed): number;
+ decode(reader: Reader): any;
+}
+//# sourceMappingURL=number.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/number.d.ts.map b/dist/ethers.js/src.ts/abi/coders/number.d.ts.map
new file mode 100644
index 0000000..3a1a9c7
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/number.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../../../../src/ethers.js/src.ts/abi/coders/number.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAY,MAAM,qBAAqB,CAAC;AAEtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAO1D;;GAEG;AACH,qBAAa,WAAY,SAAQ,KAAK;IAClC,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAG,OAAO,CAAC;gBAEd,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM;IAO5D,YAAY,IAAI,MAAM;IAItB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,KAAK,GAAG,MAAM;IAkB5D,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAS9B"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/number.js b/dist/ethers.js/src.ts/abi/coders/number.js
new file mode 100644
index 0000000..1f220ef
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/number.js
@@ -0,0 +1,47 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.NumberCoder = void 0;
+const index_js_1 = require("../../utils/index.js");
+const typed_js_1 = require("../typed.js");
+const abstract_coder_js_1 = require("./abstract-coder.js");
+const BN_0 = BigInt(0);
+const BN_1 = BigInt(1);
+const BN_MAX_UINT256 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
+/**
+ * @_ignore
+ */
+class NumberCoder extends abstract_coder_js_1.Coder {
+ constructor(size, signed, localName) {
+ const name = ((signed ? "int" : "uint") + (size * 8));
+ super(name, name, localName, false);
+ (0, index_js_1.defineProperties)(this, { size, signed }, { size: "number", signed: "boolean" });
+ }
+ defaultValue() {
+ return 0;
+ }
+ encode(writer, _value) {
+ let value = (0, index_js_1.getBigInt)(typed_js_1.Typed.dereference(_value, this.type));
+ // Check bounds are safe for encoding
+ let maxUintValue = (0, index_js_1.mask)(BN_MAX_UINT256, abstract_coder_js_1.WordSize * 8);
+ if (this.signed) {
+ let bounds = (0, index_js_1.mask)(maxUintValue, (this.size * 8) - 1);
+ if (value > bounds || value < -(bounds + BN_1)) {
+ this._throwError("value out-of-bounds", _value);
+ }
+ value = (0, index_js_1.toTwos)(value, 8 * abstract_coder_js_1.WordSize);
+ }
+ else if (value < BN_0 || value > (0, index_js_1.mask)(maxUintValue, this.size * 8)) {
+ this._throwError("value out-of-bounds", _value);
+ }
+ return writer.writeValue(value);
+ }
+ decode(reader) {
+ let value = (0, index_js_1.mask)(reader.readValue(), this.size * 8);
+ if (this.signed) {
+ value = (0, index_js_1.fromTwos)(value, this.size * 8);
+ }
+ return value;
+ }
+}
+exports.NumberCoder = NumberCoder;
+//# sourceMappingURL=number.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/number.js.map b/dist/ethers.js/src.ts/abi/coders/number.js.map
new file mode 100644
index 0000000..55fc111
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/number.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"number.js","sourceRoot":"","sources":["../../../../../src/ethers.js/src.ts/abi/coders/number.ts"],"names":[],"mappings":";;;AAAA,mDAE8B;AAE9B,0CAAoC;AACpC,2DAAsD;AAOtD,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,cAAc,GAAG,MAAM,CAAC,oEAAoE,CAAC,CAAC;AAEpG;;GAEG;AACH,MAAa,WAAY,SAAQ,yBAAK;IAIlC,YAAY,IAAY,EAAE,MAAe,EAAE,SAAiB;QACxD,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAA,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC;QACrD,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,SA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AE,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;QAEpD,IAAI,IAAI,CAAC,MAAM,EAAE;YACb,KAAK,GAAG,IAAA,mBAAQ,EAAC,KAAK,EAAE,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;SAC1C;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ;AA1CD,kCA0CC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/string.d.ts b/dist/ethers.js/src.ts/abi/coders/string.d.ts
new file mode 100644
index 0000000..8e1c635
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/string.d.ts
@@ -0,0 +1,13 @@
+import { Typed } from "../typed.js";
+import { DynamicBytesCoder } from "./bytes.js";
+import type { Reader, Writer } from "./abstract-coder.js";
+/**
+ * @_ignore
+ */
+export declare class StringCoder extends DynamicBytesCoder {
+ constructor(localName: string);
+ defaultValue(): string;
+ encode(writer: Writer, _value: string | Typed): number;
+ decode(reader: Reader): any;
+}
+//# sourceMappingURL=string.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/string.d.ts.map b/dist/ethers.js/src.ts/abi/coders/string.d.ts.map
new file mode 100644
index 0000000..08d9f86
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/string.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../../../../src/ethers.js/src.ts/abi/coders/string.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAG1D;;GAEG;AACH,qBAAa,WAAY,SAAQ,iBAAiB;gBAElC,SAAS,EAAE,MAAM;IAI7B,YAAY,IAAI,MAAM;IAItB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM;IAItD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG9B"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/string.js b/dist/ethers.js/src.ts/abi/coders/string.js
new file mode 100644
index 0000000..7370af0
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/string.js
@@ -0,0 +1,25 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.StringCoder = void 0;
+const utf8_js_1 = require("../../utils/utf8.js");
+const typed_js_1 = require("../typed.js");
+const bytes_js_1 = require("./bytes.js");
+/**
+ * @_ignore
+ */
+class StringCoder extends bytes_js_1.DynamicBytesCoder {
+ constructor(localName) {
+ super("string", localName);
+ }
+ defaultValue() {
+ return "";
+ }
+ encode(writer, _value) {
+ return super.encode(writer, (0, utf8_js_1.toUtf8Bytes)(typed_js_1.Typed.dereference(_value, "string")));
+ }
+ decode(reader) {
+ return (0, utf8_js_1.toUtf8String)(super.decode(reader));
+ }
+}
+exports.StringCoder = StringCoder;
+//# sourceMappingURL=string.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/string.js.map b/dist/ethers.js/src.ts/abi/coders/string.js.map
new file mode 100644
index 0000000..b75d7cc
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/string.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"string.js","sourceRoot":"","sources":["../../../../../src/ethers.js/src.ts/abi/coders/string.ts"],"names":[],"mappings":";;;AAAA,iDAAgE;AAEhE,0CAAoC;AACpC,yCAA+C;AAK/C;;GAEG;AACH,MAAa,WAAY,SAAQ,4BAAiB;IAE9C,YAAY,SAAiB;QACzB,KAAK,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IAC/B,CAAC;IAED,YAAY;QACR,OAAO,EAAE,CAAC;IACd,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,MAAsB;QACzC,OAAO,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,IAAA,qBAAW,EAAC,gBAAK,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IAClF,CAAC;IAED,MAAM,CAAC,MAAc;QACjB,OAAO,IAAA,sBAAY,EAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9C,CAAC;CACJ;AAjBD,kCAiBC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/tuple.d.ts b/dist/ethers.js/src.ts/abi/coders/tuple.d.ts
new file mode 100644
index 0000000..fe3ec03
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/tuple.d.ts
@@ -0,0 +1,16 @@
+import { Typed } from "../typed.js";
+import { Coder } from "./abstract-coder.js";
+import type { Reader, Writer } from "./abstract-coder.js";
+/**
+ * @_ignore
+ */
+export declare class TupleCoder extends Coder {
+ readonly coders: ReadonlyArray;
+ constructor(coders: Array, localName: string);
+ defaultValue(): any;
+ encode(writer: Writer, _value: Array | {
+ [name: string]: any;
+ } | Typed): number;
+ decode(reader: Reader): any;
+}
+//# sourceMappingURL=tuple.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/tuple.d.ts.map b/dist/ethers.js/src.ts/abi/coders/tuple.d.ts.map
new file mode 100644
index 0000000..ec4d13f
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/tuple.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"tuple.d.ts","sourceRoot":"","sources":["../../../../../src/ethers.js/src.ts/abi/coders/tuple.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAI5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACjC,QAAQ,CAAC,MAAM,EAAG,aAAa,CAAC,KAAK,CAAC,CAAC;gBAE3B,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,MAAM;IAanD,YAAY,IAAI,GAAG;IA+BnB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG;QAAE,CAAE,IAAI,EAAE,MAAM,GAAI,GAAG,CAAA;KAAE,GAAG,KAAK,GAAG,MAAM;IAKtF,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG9B"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/tuple.js b/dist/ethers.js/src.ts/abi/coders/tuple.js
new file mode 100644
index 0000000..641a9d9
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/tuple.js
@@ -0,0 +1,66 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.TupleCoder = void 0;
+const properties_js_1 = require("../../utils/properties.js");
+const typed_js_1 = require("../typed.js");
+const abstract_coder_js_1 = require("./abstract-coder.js");
+const array_js_1 = require("./array.js");
+/**
+ * @_ignore
+ */
+class TupleCoder extends abstract_coder_js_1.Coder {
+ constructor(coders, localName) {
+ let dynamic = false;
+ const types = [];
+ coders.forEach((coder) => {
+ if (coder.dynamic) {
+ dynamic = true;
+ }
+ types.push(coder.type);
+ });
+ const type = ("tuple(" + types.join(",") + ")");
+ super("tuple", type, localName, dynamic);
+ (0, properties_js_1.defineProperties)(this, { coders: Object.freeze(coders.slice()) });
+ }
+ defaultValue() {
+ const values = [];
+ this.coders.forEach((coder) => {
+ values.push(coder.defaultValue());
+ });
+ // We only output named properties for uniquely named coders
+ const uniqueNames = this.coders.reduce((accum, coder) => {
+ const name = coder.localName;
+ if (name) {
+ if (!accum[name]) {
+ accum[name] = 0;
+ }
+ accum[name]++;
+ }
+ return accum;
+ }, {});
+ // Add named values
+ this.coders.forEach((coder, index) => {
+ let name = coder.localName;
+ if (!name || uniqueNames[name] !== 1) {
+ return;
+ }
+ if (name === "length") {
+ name = "_length";
+ }
+ if (values[name] != null) {
+ return;
+ }
+ values[name] = values[index];
+ });
+ return Object.freeze(values);
+ }
+ encode(writer, _value) {
+ const value = typed_js_1.Typed.dereference(_value, "tuple");
+ return (0, array_js_1.pack)(writer, this.coders, value);
+ }
+ decode(reader) {
+ return (0, array_js_1.unpack)(reader, this.coders);
+ }
+}
+exports.TupleCoder = TupleCoder;
+//# sourceMappingURL=tuple.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/coders/tuple.js.map b/dist/ethers.js/src.ts/abi/coders/tuple.js.map
new file mode 100644
index 0000000..f51b31f
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/coders/tuple.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"tuple.js","sourceRoot":"","sources":["../../../../../src/ethers.js/src.ts/abi/coders/tuple.ts"],"names":[],"mappings":";;;AAAA,6DAA6D;AAE7D,0CAAoC;AACpC,2DAA4C;AAE5C,yCAA0C;AAI1C;;GAEG;AACH,MAAa,UAAW,SAAQ,yBAAK;IAGjC,YAAY,MAAoB,EAAE,SAAiB;QAC/C,IAAI,OAAO,GAAG,KAAK,CAAC;QACpB,MAAM,KAAK,GAAkB,EAAE,CAAC;QAChC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YACrB,IAAI,KAAK,CAAC,OAAO,EAAE;gBAAE,OAAO,GAAG,IAAI,CAAC;aAAE;YACtC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC3B,CAAC,CAAC,CAAC;QACH,MAAM,IAAI,GAAG,CAAC,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC;QAEhD,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;QACzC,IAAA,gCAAgB,EAAa,IAAI,EAAE,EAAE,MAAM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AAC;IAED,MAAM,CAAC,MAAc,EAAE,MAAsD;QACzE,MAAM,KAAK,GAAG,gBAAK,CAAC,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACjD,OAAO,IAAA,eAAI,EAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC5C,CAAC;IAED,MAAM,CAAC,MAAc;QACjB,OAAO,IAAA,iBAAM,EAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACvC,CAAC;CACJ;AAvDD,gCAuDC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/fragments.d.ts b/dist/ethers.js/src.ts/abi/fragments.d.ts
new file mode 100644
index 0000000..2605805
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/fragments.d.ts
@@ -0,0 +1,466 @@
+/**
+ * A fragment is a single item from an ABI, which may represent any of:
+ *
+ * - [Functions](FunctionFragment)
+ * - [Events](EventFragment)
+ * - [Constructors](ConstructorFragment)
+ * - Custom [Errors](ErrorFragment)
+ * - [Fallback or Receive](FallbackFragment) functions
+ *
+ * @_subsection api/abi/abi-coder:Fragments [about-fragments]
+ */
+/**
+ * A Type description in a [JSON ABI format](link-solc-jsonabi).
+ */
+export interface JsonFragmentType {
+ /**
+ * The parameter name.
+ */
+ readonly name?: string;
+ /**
+ * If the parameter is indexed.
+ */
+ readonly indexed?: boolean;
+ /**
+ * The type of the parameter.
+ */
+ readonly type?: string;
+ /**
+ * The internal Solidity type.
+ */
+ readonly internalType?: string;
+ /**
+ * The components for a tuple.
+ */
+ readonly components?: ReadonlyArray;
+}
+/**
+ * A fragment for a method, event or error in a [JSON ABI format](link-solc-jsonabi).
+ */
+export interface JsonFragment {
+ /**
+ * The name of the error, event, function, etc.
+ */
+ readonly name?: string;
+ /**
+ * The type of the fragment (e.g. ``event``, ``"function"``, etc.)
+ */
+ readonly type?: string;
+ /**
+ * If the event is anonymous.
+ */
+ readonly anonymous?: boolean;
+ /**
+ * If the function is payable.
+ */
+ readonly payable?: boolean;
+ /**
+ * If the function is constant.
+ */
+ readonly constant?: boolean;
+ /**
+ * The mutability state of the function.
+ */
+ readonly stateMutability?: string;
+ /**
+ * The input parameters.
+ */
+ readonly inputs?: ReadonlyArray;
+ /**
+ * The output parameters.
+ */
+ readonly outputs?: ReadonlyArray;
+ /**
+ * The gas limit to use when sending a transaction for this function.
+ */
+ readonly gas?: string;
+}
+/**
+ * The format to serialize the output as.
+ *
+ * **``"sighash"``** - the bare formatting, used to compute the selector
+ * or topic hash; this format cannot be reversed (as it discards ``indexed``)
+ * so cannot by used to export an [[Interface]].
+ *
+ * **``"minimal"``** - Human-Readable ABI with minimal spacing and without
+ * names, so it is compact, but will result in Result objects that cannot
+ * be accessed by name.
+ *
+ * **``"full"``** - Full Human-Readable ABI, with readable spacing and names
+ * intact; this is generally the recommended format.
+ *
+ * **``"json"``** - The [JSON ABI format](link-solc-jsonabi).
+ */
+export type FormatType = "sighash" | "minimal" | "full" | "json";
+/**
+ * When [walking](ParamType-walk) a [[ParamType]], this is called
+ * on each component.
+ */
+export type ParamTypeWalkFunc = (type: string, value: any) => any;
+/**
+ * When [walking asynchronously](ParamType-walkAsync) a [[ParamType]],
+ * this is called on each component.
+ */
+export type ParamTypeWalkAsyncFunc = (type: string, value: any) => any | Promise;
+/**
+ * Each input and output of a [[Fragment]] is an Array of **ParamType**.
+ */
+export declare class ParamType {
+ #private;
+ /**
+ * The local name of the parameter (or ``""`` if unbound)
+ */
+ readonly name: string;
+ /**
+ * The fully qualified type (e.g. ``"address"``, ``"tuple(address)"``,
+ * ``"uint256[3][]"``)
+ */
+ readonly type: string;
+ /**
+ * The base type (e.g. ``"address"``, ``"tuple"``, ``"array"``)
+ */
+ readonly baseType: string;
+ /**
+ * True if the parameters is indexed.
+ *
+ * For non-indexable types this is ``null``.
+ */
+ readonly indexed: null | boolean;
+ /**
+ * The components for the tuple.
+ *
+ * For non-tuple types this is ``null``.
+ */
+ readonly components: null | ReadonlyArray;
+ /**
+ * The array length, or ``-1`` for dynamic-lengthed arrays.
+ *
+ * For non-array types this is ``null``.
+ */
+ readonly arrayLength: null | number;
+ /**
+ * The type of each child in the array.
+ *
+ * For non-array types this is ``null``.
+ */
+ readonly arrayChildren: null | ParamType;
+ /**
+ * @private
+ */
+ constructor(guard: any, name: string, type: string, baseType: string, indexed: null | boolean, components: null | ReadonlyArray, arrayLength: null | number, arrayChildren: null | ParamType);
+ /**
+ * Return a string representation of this type.
+ *
+ * For example,
+ *
+ * ``sighash" => "(uint256,address)"``
+ *
+ * ``"minimal" => "tuple(uint256,address) indexed"``
+ *
+ * ``"full" => "tuple(uint256 foo, address bar) indexed baz"``
+ */
+ format(format?: FormatType): string;
+ /**
+ * Returns true if %%this%% is an Array type.
+ *
+ * This provides a type gaurd ensuring that [[arrayChildren]]
+ * and [[arrayLength]] are non-null.
+ */
+ isArray(): this is (ParamType & {
+ arrayChildren: ParamType;
+ arrayLength: number;
+ });
+ /**
+ * Returns true if %%this%% is a Tuple type.
+ *
+ * This provides a type gaurd ensuring that [[components]]
+ * is non-null.
+ */
+ isTuple(): this is (ParamType & {
+ components: ReadonlyArray;
+ });
+ /**
+ * Returns true if %%this%% is an Indexable type.
+ *
+ * This provides a type gaurd ensuring that [[indexed]]
+ * is non-null.
+ */
+ isIndexable(): this is (ParamType & {
+ indexed: boolean;
+ });
+ /**
+ * Walks the **ParamType** with %%value%%, calling %%process%%
+ * on each type, destructing the %%value%% recursively.
+ */
+ walk(value: any, process: ParamTypeWalkFunc): any;
+ /**
+ * Walks the **ParamType** with %%value%%, asynchronously calling
+ * %%process%% on each type, destructing the %%value%% recursively.
+ *
+ * This can be used to resolve ENS naes by walking and resolving each
+ * ``"address"`` type.
+ */
+ walkAsync(value: any, process: ParamTypeWalkAsyncFunc): Promise;
+ /**
+ * Creates a new **ParamType** for %%obj%%.
+ *
+ * If %%allowIndexed%% then the ``indexed`` keyword is permitted,
+ * otherwise the ``indexed`` keyword will throw an error.
+ */
+ static from(obj: any, allowIndexed?: boolean): ParamType;
+ /**
+ * Returns true if %%value%% is a **ParamType**.
+ */
+ static isParamType(value: any): value is ParamType;
+}
+/**
+ * The type of a [[Fragment]].
+ */
+export type FragmentType = "constructor" | "error" | "event" | "fallback" | "function" | "struct";
+/**
+ * An abstract class to represent An individual fragment from a parse ABI.
+ */
+export declare abstract class Fragment {
+ /**
+ * The type of the fragment.
+ */
+ readonly type: FragmentType;
+ /**
+ * The inputs for the fragment.
+ */
+ readonly inputs: ReadonlyArray;
+ /**
+ * @private
+ */
+ constructor(guard: any, type: FragmentType, inputs: ReadonlyArray);
+ /**
+ * Returns a string representation of this fragment as %%format%%.
+ */
+ abstract format(format?: FormatType): string;
+ /**
+ * Creates a new **Fragment** for %%obj%%, wich can be any supported
+ * ABI frgament type.
+ */
+ static from(obj: any): Fragment;
+ /**
+ * Returns true if %%value%% is a [[ConstructorFragment]].
+ */
+ static isConstructor(value: any): value is ConstructorFragment;
+ /**
+ * Returns true if %%value%% is an [[ErrorFragment]].
+ */
+ static isError(value: any): value is ErrorFragment;
+ /**
+ * Returns true if %%value%% is an [[EventFragment]].
+ */
+ static isEvent(value: any): value is EventFragment;
+ /**
+ * Returns true if %%value%% is a [[FunctionFragment]].
+ */
+ static isFunction(value: any): value is FunctionFragment;
+ /**
+ * Returns true if %%value%% is a [[StructFragment]].
+ */
+ static isStruct(value: any): value is StructFragment;
+}
+/**
+ * An abstract class to represent An individual fragment
+ * which has a name from a parse ABI.
+ */
+export declare abstract class NamedFragment extends Fragment {
+ /**
+ * The name of the fragment.
+ */
+ readonly name: string;
+ /**
+ * @private
+ */
+ constructor(guard: any, type: FragmentType, name: string, inputs: ReadonlyArray);
+}
+/**
+ * A Fragment which represents a //Custom Error//.
+ */
+export declare class ErrorFragment extends NamedFragment {
+ /**
+ * @private
+ */
+ constructor(guard: any, name: string, inputs: ReadonlyArray);
+ /**
+ * The Custom Error selector.
+ */
+ get selector(): string;
+ /**
+ * Returns a string representation of this fragment as %%format%%.
+ */
+ format(format?: FormatType): string;
+ /**
+ * Returns a new **ErrorFragment** for %%obj%%.
+ */
+ static from(obj: any): ErrorFragment;
+ /**
+ * Returns ``true`` and provides a type guard if %%value%% is an
+ * **ErrorFragment**.
+ */
+ static isFragment(value: any): value is ErrorFragment;
+}
+/**
+ * A Fragment which represents an Event.
+ */
+export declare class EventFragment extends NamedFragment {
+ /**
+ * Whether this event is anonymous.
+ */
+ readonly anonymous: boolean;
+ /**
+ * @private
+ */
+ constructor(guard: any, name: string, inputs: ReadonlyArray, anonymous: boolean);
+ /**
+ * The Event topic hash.
+ */
+ get topicHash(): string;
+ /**
+ * Returns a string representation of this event as %%format%%.
+ */
+ format(format?: FormatType): string;
+ /**
+ * Return the topic hash for an event with %%name%% and %%params%%.
+ */
+ static getTopicHash(name: string, params?: Array): string;
+ /**
+ * Returns a new **EventFragment** for %%obj%%.
+ */
+ static from(obj: any): EventFragment;
+ /**
+ * Returns ``true`` and provides a type guard if %%value%% is an
+ * **EventFragment**.
+ */
+ static isFragment(value: any): value is EventFragment;
+}
+/**
+ * A Fragment which represents a constructor.
+ */
+export declare class ConstructorFragment extends Fragment {
+ /**
+ * Whether the constructor can receive an endowment.
+ */
+ readonly payable: boolean;
+ /**
+ * The recommended gas limit for deployment or ``null``.
+ */
+ readonly gas: null | bigint;
+ /**
+ * @private
+ */
+ constructor(guard: any, type: FragmentType, inputs: ReadonlyArray, payable: boolean, gas: null | bigint);
+ /**
+ * Returns a string representation of this constructor as %%format%%.
+ */
+ format(format?: FormatType): string;
+ /**
+ * Returns a new **ConstructorFragment** for %%obj%%.
+ */
+ static from(obj: any): ConstructorFragment;
+ /**
+ * Returns ``true`` and provides a type guard if %%value%% is a
+ * **ConstructorFragment**.
+ */
+ static isFragment(value: any): value is ConstructorFragment;
+}
+/**
+ * A Fragment which represents a method.
+ */
+export declare class FallbackFragment extends Fragment {
+ /**
+ * If the function can be sent value during invocation.
+ */
+ readonly payable: boolean;
+ constructor(guard: any, inputs: ReadonlyArray, payable: boolean);
+ /**
+ * Returns a string representation of this fallback as %%format%%.
+ */
+ format(format?: FormatType): string;
+ /**
+ * Returns a new **FallbackFragment** for %%obj%%.
+ */
+ static from(obj: any): FallbackFragment;
+ /**
+ * Returns ``true`` and provides a type guard if %%value%% is a
+ * **FallbackFragment**.
+ */
+ static isFragment(value: any): value is FallbackFragment;
+}
+/**
+ * A Fragment which represents a method.
+ */
+export declare class FunctionFragment extends NamedFragment {
+ /**
+ * If the function is constant (e.g. ``pure`` or ``view`` functions).
+ */
+ readonly constant: boolean;
+ /**
+ * The returned types for the result of calling this function.
+ */
+ readonly outputs: ReadonlyArray;
+ /**
+ * The state mutability (e.g. ``payable``, ``nonpayable``, ``view``
+ * or ``pure``)
+ */
+ readonly stateMutability: "payable" | "nonpayable" | "view" | "pure";
+ /**
+ * If the function can be sent value during invocation.
+ */
+ readonly payable: boolean;
+ /**
+ * The recommended gas limit to send when calling this function.
+ */
+ readonly gas: null | bigint;
+ /**
+ * @private
+ */
+ constructor(guard: any, name: string, stateMutability: "payable" | "nonpayable" | "view" | "pure", inputs: ReadonlyArray, outputs: ReadonlyArray, gas: null | bigint);
+ /**
+ * The Function selector.
+ */
+ get selector(): string;
+ /**
+ * Returns a string representation of this function as %%format%%.
+ */
+ format(format?: FormatType): string;
+ /**
+ * Return the selector for a function with %%name%% and %%params%%.
+ */
+ static getSelector(name: string, params?: Array): string;
+ /**
+ * Returns a new **FunctionFragment** for %%obj%%.
+ */
+ static from(obj: any): FunctionFragment;
+ /**
+ * Returns ``true`` and provides a type guard if %%value%% is a
+ * **FunctionFragment**.
+ */
+ static isFragment(value: any): value is FunctionFragment;
+}
+/**
+ * A Fragment which represents a structure.
+ */
+export declare class StructFragment extends NamedFragment {
+ /**
+ * @private
+ */
+ constructor(guard: any, name: string, inputs: ReadonlyArray);
+ /**
+ * Returns a string representation of this struct as %%format%%.
+ */
+ format(): string;
+ /**
+ * Returns a new **StructFragment** for %%obj%%.
+ */
+ static from(obj: any): StructFragment;
+ /**
+ * Returns ``true`` and provides a type guard if %%value%% is a
+ * **StructFragment**.
+ */
+ static isFragment(value: any): value is FunctionFragment;
+}
+//# sourceMappingURL=fragments.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/fragments.d.ts.map b/dist/ethers.js/src.ts/abi/fragments.d.ts.map
new file mode 100644
index 0000000..22f3024
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/fragments.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"fragments.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/abi/fragments.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAQH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAE/B;;OAEG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;CACzD;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAE5B;;OAEG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAElC;;OAEG;IACH,QAAQ,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,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED;;OAEG;IACH,MAAM,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,MAAM;IAoCnC;;OAEG;IACH,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM;IAM7D;;OAEG;IACH,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG,gBAAgB;IAuDvC;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,gBAAgB;CAG3D;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,aAAa;IAE7C;;OAEG;gBACS,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC;IAKtE;;OAEG;IACH,MAAM,IAAI,MAAM;IAIhB;;OAEG;IACH,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG,cAAc;IAmBrC;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,gBAAgB;CAG3D"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/fragments.js b/dist/ethers.js/src.ts/abi/fragments.js
new file mode 100644
index 0000000..bf822da
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/fragments.js
@@ -0,0 +1,1273 @@
+"use strict";
+/**
+ * A fragment is a single item from an ABI, which may represent any of:
+ *
+ * - [Functions](FunctionFragment)
+ * - [Events](EventFragment)
+ * - [Constructors](ConstructorFragment)
+ * - Custom [Errors](ErrorFragment)
+ * - [Fallback or Receive](FallbackFragment) functions
+ *
+ * @_subsection api/abi/abi-coder:Fragments [about-fragments]
+ */
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
+};
+var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
+ if (kind === "m") throw new TypeError("Private method is not writable");
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
+};
+var _TokenString_instances, _TokenString_offset, _TokenString_tokens, _TokenString_subTokenString, _ParamType_instances, _ParamType_walkAsync;
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.StructFragment = exports.FunctionFragment = exports.FallbackFragment = exports.ConstructorFragment = exports.EventFragment = exports.ErrorFragment = exports.NamedFragment = exports.Fragment = exports.ParamType = void 0;
+const index_js_1 = require("../utils/index.js");
+const index_js_2 = require("../hash/index.js");
+;
+// [ "a", "b" ] => { "a": 1, "b": 1 }
+function setify(items) {
+ const result = new Set();
+ 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(" "));
+const _kwTypes = "constructor error event fallback function receive struct";
+const KwTypes = setify(_kwTypes.split(" "));
+const _kwModifiers = "calldata memory storage payable indexed";
+const KwModifiers = setify(_kwModifiers.split(" "));
+const _kwOther = "tuple returns";
+// All Keywords
+const _keywords = [_kwTypes, _kwModifiers, _kwOther, _kwVisib].join(" ");
+const Keywords = setify(_keywords.split(" "));
+// Single character tokens
+const SimpleTokens = {
+ "(": "OPEN_PAREN", ")": "CLOSE_PAREN",
+ "[": "OPEN_BRACKET", "]": "CLOSE_BRACKET",
+ ",": "COMMA", "@": "AT"
+};
+// Parser regexes to consume the next token
+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 {
+ get offset() { return __classPrivateFieldGet(this, _TokenString_offset, "f"); }
+ get length() { return __classPrivateFieldGet(this, _TokenString_tokens, "f").length - __classPrivateFieldGet(this, _TokenString_offset, "f"); }
+ constructor(tokens) {
+ _TokenString_instances.add(this);
+ _TokenString_offset.set(this, void 0);
+ _TokenString_tokens.set(this, void 0);
+ __classPrivateFieldSet(this, _TokenString_offset, 0, "f");
+ __classPrivateFieldSet(this, _TokenString_tokens, tokens.slice(), "f");
+ }
+ clone() { return new TokenString(__classPrivateFieldGet(this, _TokenString_tokens, "f")); }
+ reset() { __classPrivateFieldSet(this, _TokenString_offset, 0, "f"); }
+ // Pops and returns the value of the next token, if it is a keyword in allowed; throws if out of tokens
+ popKeyword(allowed) {
+ const top = this.peek();
+ if (top.type !== "KEYWORD" || !allowed.has(top.text)) {
+ throw new Error(`expected keyword ${top.text}`);
+ }
+ return this.pop().text;
+ }
+ // Pops and returns the value of the next token if it is `type`; throws if out of tokens
+ popType(type) {
+ if (this.peek().type !== type) {
+ throw new Error(`expected ${type}; got ${JSON.stringify(this.peek())}`);
+ }
+ return this.pop().text;
+ }
+ // Pops and returns a "(" TOKENS ")"
+ popParen() {
+ const top = this.peek();
+ if (top.type !== "OPEN_PAREN") {
+ throw new Error("bad start");
+ }
+ const result = __classPrivateFieldGet(this, _TokenString_instances, "m", _TokenString_subTokenString).call(this, __classPrivateFieldGet(this, _TokenString_offset, "f") + 1, top.match + 1);
+ __classPrivateFieldSet(this, _TokenString_offset, top.match + 1, "f");
+ return result;
+ }
+ // Pops and returns the items within "(" ITEM1 "," ITEM2 "," ... ")"
+ popParams() {
+ const top = this.peek();
+ if (top.type !== "OPEN_PAREN") {
+ throw new Error("bad start");
+ }
+ const result = [];
+ while (__classPrivateFieldGet(this, _TokenString_offset, "f") < top.match - 1) {
+ const link = this.peek().linkNext;
+ result.push(__classPrivateFieldGet(this, _TokenString_instances, "m", _TokenString_subTokenString).call(this, __classPrivateFieldGet(this, _TokenString_offset, "f") + 1, link));
+ __classPrivateFieldSet(this, _TokenString_offset, link, "f");
+ }
+ __classPrivateFieldSet(this, _TokenString_offset, top.match + 1, "f");
+ return result;
+ }
+ // Returns the top Token, throwing if out of tokens
+ peek() {
+ if (__classPrivateFieldGet(this, _TokenString_offset, "f") >= __classPrivateFieldGet(this, _TokenString_tokens, "f").length) {
+ throw new Error("out-of-bounds");
+ }
+ return __classPrivateFieldGet(this, _TokenString_tokens, "f")[__classPrivateFieldGet(this, _TokenString_offset, "f")];
+ }
+ // Returns the next value, if it is a keyword in `allowed`
+ peekKeyword(allowed) {
+ const top = this.peekType("KEYWORD");
+ return (top != null && allowed.has(top)) ? top : null;
+ }
+ // Returns the value of the next token if it is `type`
+ peekType(type) {
+ if (this.length === 0) {
+ return null;
+ }
+ const top = this.peek();
+ return (top.type === type) ? top.text : null;
+ }
+ // Returns the next token; throws if out of tokens
+ pop() {
+ var _a;
+ const result = this.peek();
+ __classPrivateFieldSet(this, _TokenString_offset, (_a = __classPrivateFieldGet(this, _TokenString_offset, "f"), _a++, _a), "f");
+ return result;
+ }
+ toString() {
+ const tokens = [];
+ for (let i = __classPrivateFieldGet(this, _TokenString_offset, "f"); i < __classPrivateFieldGet(this, _TokenString_tokens, "f").length; i++) {
+ const token = __classPrivateFieldGet(this, _TokenString_tokens, "f")[i];
+ tokens.push(`${token.type}:${token.text}`);
+ }
+ return ``;
+ }
+}
+_TokenString_offset = new WeakMap(), _TokenString_tokens = new WeakMap(), _TokenString_instances = new WeakSet(), _TokenString_subTokenString = function _TokenString_subTokenString(from = 0, to = 0) {
+ return new TokenString(__classPrivateFieldGet(this, _TokenString_tokens, "f").slice(from, to).map((t) => {
+ return Object.freeze(Object.assign({}, t, {
+ match: (t.match - from),
+ linkBack: (t.linkBack - from),
+ linkNext: (t.linkNext - from),
+ }));
+ }));
+};
+function lex(text) {
+ const tokens = [];
+ const throwError = (message) => {
+ const token = (offset < text.length) ? JSON.stringify(text[offset]) : "$EOI";
+ throw new Error(`invalid token ${token} at ${offset}: ${message}`);
+ };
+ let brackets = [];
+ let commas = [];
+ let offset = 0;
+ while (offset < text.length) {
+ // Strip off any leading whitespace
+ let cur = text.substring(offset);
+ let match = cur.match(regexWhitespacePrefix);
+ if (match) {
+ offset += match[1].length;
+ cur = text.substring(offset);
+ }
+ const token = { depth: brackets.length, linkBack: -1, linkNext: -1, match: -1, type: "", text: "", offset, value: -1 };
+ tokens.push(token);
+ let type = (SimpleTokens[cur[0]] || "");
+ if (type) {
+ token.type = type;
+ token.text = cur[0];
+ offset++;
+ if (type === "OPEN_PAREN") {
+ brackets.push(tokens.length - 1);
+ commas.push(tokens.length - 1);
+ }
+ else if (type == "CLOSE_PAREN") {
+ if (brackets.length === 0) {
+ throwError("no matching open bracket");
+ }
+ token.match = brackets.pop();
+ (tokens[token.match]).match = tokens.length - 1;
+ token.depth--;
+ token.linkBack = commas.pop();
+ (tokens[token.linkBack]).linkNext = tokens.length - 1;
+ }
+ else if (type === "COMMA") {
+ token.linkBack = commas.pop();
+ (tokens[token.linkBack]).linkNext = tokens.length - 1;
+ commas.push(tokens.length - 1);
+ }
+ else if (type === "OPEN_BRACKET") {
+ token.type = "BRACKET";
+ }
+ else if (type === "CLOSE_BRACKET") {
+ // Remove the CLOSE_BRACKET
+ let suffix = tokens.pop().text;
+ if (tokens.length > 0 && tokens[tokens.length - 1].type === "NUMBER") {
+ const value = tokens.pop().text;
+ suffix = value + suffix;
+ (tokens[tokens.length - 1]).value = (0, index_js_1.getNumber)(value);
+ }
+ if (tokens.length === 0 || tokens[tokens.length - 1].type !== "BRACKET") {
+ throw new Error("missing opening bracket");
+ }
+ (tokens[tokens.length - 1]).text += suffix;
+ }
+ continue;
+ }
+ match = cur.match(regexIdPrefix);
+ if (match) {
+ token.text = match[1];
+ offset += token.text.length;
+ if (Keywords.has(token.text)) {
+ token.type = "KEYWORD";
+ continue;
+ }
+ if (token.text.match(regexType)) {
+ token.type = "TYPE";
+ continue;
+ }
+ token.type = "ID";
+ continue;
+ }
+ match = cur.match(regexNumberPrefix);
+ if (match) {
+ token.text = match[1];
+ token.type = "NUMBER";
+ offset += token.text.length;
+ continue;
+ }
+ throw new Error(`unexpected token ${JSON.stringify(cur[0])} at position ${offset}`);
+ }
+ return new TokenString(tokens.map((t) => Object.freeze(t)));
+}
+// Check only one of `allowed` is in `set`
+function allowSingle(set, allowed) {
+ let included = [];
+ for (const key in allowed.keys()) {
+ if (set.has(key)) {
+ included.push(key);
+ }
+ }
+ if (included.length > 1) {
+ throw new Error(`conflicting types: ${included.join(", ")}`);
+ }
+}
+// Functions to process a Solidity Signature TokenString from left-to-right for...
+// ...the name with an optional type, returning the name
+function consumeName(type, tokens) {
+ if (tokens.peekKeyword(KwTypes)) {
+ const keyword = tokens.pop().text;
+ if (keyword !== type) {
+ throw new Error(`expected ${type}, got ${keyword}`);
+ }
+ }
+ return tokens.popType("ID");
+}
+// ...all keywords matching allowed, returning the keywords
+function consumeKeywords(tokens, allowed) {
+ const keywords = new Set();
+ while (true) {
+ const keyword = tokens.peekType("KEYWORD");
+ if (keyword == null || (allowed && !allowed.has(keyword))) {
+ break;
+ }
+ tokens.pop();
+ if (keywords.has(keyword)) {
+ throw new Error(`duplicate keywords: ${JSON.stringify(keyword)}`);
+ }
+ keywords.add(keyword);
+ }
+ return Object.freeze(keywords);
+}
+// ...all visibility keywords, returning the coalesced mutability
+function consumeMutability(tokens) {
+ let modifiers = consumeKeywords(tokens, KwVisib);
+ // Detect conflicting modifiers
+ allowSingle(modifiers, setify("constant payable nonpayable".split(" ")));
+ allowSingle(modifiers, setify("pure view payable nonpayable".split(" ")));
+ // Process mutability states
+ if (modifiers.has("view")) {
+ return "view";
+ }
+ if (modifiers.has("pure")) {
+ return "pure";
+ }
+ if (modifiers.has("payable")) {
+ return "payable";
+ }
+ if (modifiers.has("nonpayable")) {
+ return "nonpayable";
+ }
+ // Process legacy `constant` last
+ if (modifiers.has("constant")) {
+ return "view";
+ }
+ return "nonpayable";
+}
+// ...a parameter list, returning the ParamType list
+function consumeParams(tokens, allowIndexed) {
+ return tokens.popParams().map((t) => ParamType.from(t, allowIndexed));
+}
+// ...a gas limit, returning a BigNumber or null if none
+function consumeGas(tokens) {
+ if (tokens.peekType("AT")) {
+ tokens.pop();
+ if (tokens.peekType("NUMBER")) {
+ return (0, index_js_1.getBigInt)(tokens.pop().text);
+ }
+ throw new Error("invalid gas");
+ }
+ return null;
+}
+function consumeEoi(tokens) {
+ if (tokens.length) {
+ throw new Error(`unexpected tokens: ${tokens.toString()}`);
+ }
+}
+const regexArrayType = new RegExp(/^(.*)\[([0-9]*)\]$/);
+function verifyBasicType(type) {
+ const match = type.match(regexType);
+ (0, index_js_1.assertArgument)(match, "invalid type", "type", type);
+ if (type === "uint") {
+ return "uint256";
+ }
+ if (type === "int") {
+ return "int256";
+ }
+ if (match[2]) {
+ // bytesXX
+ const length = parseInt(match[2]);
+ (0, index_js_1.assertArgument)(length !== 0 && length <= 32, "invalid bytes length", "type", type);
+ }
+ else if (match[3]) {
+ // intXX or uintXX
+ const size = parseInt(match[3]);
+ (0, index_js_1.assertArgument)(size !== 0 && size <= 256 && (size % 8) === 0, "invalid numeric width", "type", type);
+ }
+ return type;
+}
+// Make the Fragment constructors effectively private
+const _guard = {};
+const internal = Symbol.for("_ethers_internal");
+const ParamTypeInternal = "_ParamTypeInternal";
+const ErrorFragmentInternal = "_ErrorInternal";
+const EventFragmentInternal = "_EventInternal";
+const ConstructorFragmentInternal = "_ConstructorInternal";
+const FallbackFragmentInternal = "_FallbackInternal";
+const FunctionFragmentInternal = "_FunctionInternal";
+const StructFragmentInternal = "_StructInternal";
+/**
+ * Each input and output of a [[Fragment]] is an Array of **ParamType**.
+ */
+class ParamType {
+ /**
+ * @private
+ */
+ constructor(guard, name, type, baseType, indexed, components, arrayLength, arrayChildren) {
+ _ParamType_instances.add(this);
+ (0, index_js_1.assertPrivate)(guard, _guard, "ParamType");
+ Object.defineProperty(this, internal, { value: ParamTypeInternal });
+ if (components) {
+ components = Object.freeze(components.slice());
+ }
+ if (baseType === "array") {
+ if (arrayLength == null || arrayChildren == null) {
+ throw new Error("");
+ }
+ }
+ else if (arrayLength != null || arrayChildren != null) {
+ throw new Error("");
+ }
+ if (baseType === "tuple") {
+ if (components == null) {
+ throw new Error("");
+ }
+ }
+ else if (components != null) {
+ throw new Error("");
+ }
+ (0, index_js_1.defineProperties)(this, {
+ name, type, baseType, indexed, components, arrayLength, arrayChildren
+ });
+ }
+ /**
+ * Return a string representation of this type.
+ *
+ * For example,
+ *
+ * ``sighash" => "(uint256,address)"``
+ *
+ * ``"minimal" => "tuple(uint256,address) indexed"``
+ *
+ * ``"full" => "tuple(uint256 foo, address bar) indexed baz"``
+ */
+ format(format) {
+ if (format == null) {
+ format = "sighash";
+ }
+ if (format === "json") {
+ const name = this.name || "";
+ if (this.isArray()) {
+ const result = JSON.parse(this.arrayChildren.format("json"));
+ result.name = name;
+ result.type += `[${(this.arrayLength < 0 ? "" : String(this.arrayLength))}]`;
+ return JSON.stringify(result);
+ }
+ const result = {
+ type: ((this.baseType === "tuple") ? "tuple" : this.type),
+ name
+ };
+ if (typeof (this.indexed) === "boolean") {
+ result.indexed = this.indexed;
+ }
+ if (this.isTuple()) {
+ result.components = this.components.map((c) => JSON.parse(c.format(format)));
+ }
+ return JSON.stringify(result);
+ }
+ let result = "";
+ // Array
+ if (this.isArray()) {
+ result += this.arrayChildren.format(format);
+ result += `[${(this.arrayLength < 0 ? "" : String(this.arrayLength))}]`;
+ }
+ else {
+ if (this.isTuple()) {
+ result += "(" + this.components.map((comp) => comp.format(format)).join((format === "full") ? ", " : ",") + ")";
+ }
+ else {
+ result += this.type;
+ }
+ }
+ if (format !== "sighash") {
+ if (this.indexed === true) {
+ result += " indexed";
+ }
+ if (format === "full" && this.name) {
+ result += " " + this.name;
+ }
+ }
+ return result;
+ }
+ /**
+ * Returns true if %%this%% is an Array type.
+ *
+ * This provides a type gaurd ensuring that [[arrayChildren]]
+ * and [[arrayLength]] are non-null.
+ */
+ isArray() {
+ return (this.baseType === "array");
+ }
+ /**
+ * Returns true if %%this%% is a Tuple type.
+ *
+ * This provides a type gaurd ensuring that [[components]]
+ * is non-null.
+ */
+ isTuple() {
+ return (this.baseType === "tuple");
+ }
+ /**
+ * Returns true if %%this%% is an Indexable type.
+ *
+ * This provides a type gaurd ensuring that [[indexed]]
+ * is non-null.
+ */
+ isIndexable() {
+ return (this.indexed != null);
+ }
+ /**
+ * Walks the **ParamType** with %%value%%, calling %%process%%
+ * on each type, destructing the %%value%% recursively.
+ */
+ walk(value, process) {
+ if (this.isArray()) {
+ if (!Array.isArray(value)) {
+ throw new Error("invalid array value");
+ }
+ if (this.arrayLength !== -1 && value.length !== this.arrayLength) {
+ throw new Error("array is wrong length");
+ }
+ const _this = this;
+ return value.map((v) => (_this.arrayChildren.walk(v, process)));
+ }
+ if (this.isTuple()) {
+ if (!Array.isArray(value)) {
+ throw new Error("invalid tuple value");
+ }
+ if (value.length !== this.components.length) {
+ throw new Error("array is wrong length");
+ }
+ const _this = this;
+ return value.map((v, i) => (_this.components[i].walk(v, process)));
+ }
+ return process(this.type, value);
+ }
+ /**
+ * Walks the **ParamType** with %%value%%, asynchronously calling
+ * %%process%% on each type, destructing the %%value%% recursively.
+ *
+ * This can be used to resolve ENS naes by walking and resolving each
+ * ``"address"`` type.
+ */
+ walkAsync(value, process) {
+ return __awaiter(this, void 0, void 0, function* () {
+ const promises = [];
+ const result = [value];
+ __classPrivateFieldGet(this, _ParamType_instances, "m", _ParamType_walkAsync).call(this, promises, value, process, (value) => {
+ result[0] = value;
+ });
+ if (promises.length) {
+ yield Promise.all(promises);
+ }
+ return result[0];
+ });
+ }
+ /**
+ * Creates a new **ParamType** for %%obj%%.
+ *
+ * If %%allowIndexed%% then the ``indexed`` keyword is permitted,
+ * otherwise the ``indexed`` keyword will throw an error.
+ */
+ static from(obj, allowIndexed) {
+ if (ParamType.isParamType(obj)) {
+ return obj;
+ }
+ if (typeof (obj) === "string") {
+ try {
+ return ParamType.from(lex(obj), allowIndexed);
+ }
+ catch (error) {
+ (0, index_js_1.assertArgument)(false, "invalid param type", "obj", obj);
+ }
+ }
+ else if (obj instanceof TokenString) {
+ let type = "", baseType = "";
+ let comps = null;
+ if (consumeKeywords(obj, setify(["tuple"])).has("tuple") || obj.peekType("OPEN_PAREN")) {
+ // Tuple
+ baseType = "tuple";
+ comps = obj.popParams().map((t) => ParamType.from(t));
+ type = `tuple(${comps.map((c) => c.format()).join(",")})`;
+ }
+ else {
+ // Normal
+ type = verifyBasicType(obj.popType("TYPE"));
+ baseType = type;
+ }
+ // Check for Array
+ let arrayChildren = null;
+ let arrayLength = null;
+ while (obj.length && obj.peekType("BRACKET")) {
+ const bracket = obj.pop(); //arrays[i];
+ arrayChildren = new ParamType(_guard, "", type, baseType, null, comps, arrayLength, arrayChildren);
+ arrayLength = bracket.value;
+ type += bracket.text;
+ baseType = "array";
+ comps = null;
+ }
+ let indexed = null;
+ const keywords = consumeKeywords(obj, KwModifiers);
+ if (keywords.has("indexed")) {
+ if (!allowIndexed) {
+ throw new Error("");
+ }
+ indexed = true;
+ }
+ const name = (obj.peekType("ID") ? obj.pop().text : "");
+ if (obj.length) {
+ throw new Error("leftover tokens");
+ }
+ 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(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);
+ indexed = !!indexed;
+ }
+ let type = obj.type;
+ let arrayMatch = type.match(regexArrayType);
+ if (arrayMatch) {
+ const arrayLength = parseInt(arrayMatch[2] || "-1");
+ const arrayChildren = ParamType.from({
+ type: arrayMatch[1],
+ components: obj.components
+ });
+ return new ParamType(_guard, name || "", type, "array", indexed, null, arrayLength, arrayChildren);
+ }
+ if (type === "tuple" || type.startsWith("tuple(" /* fix: ) */) || type.startsWith("(" /* fix: ) */)) {
+ const comps = (obj.components != null) ? obj.components.map((c) => ParamType.from(c)) : null;
+ const tuple = new ParamType(_guard, name || "", type, "tuple", indexed, comps, null, null);
+ // @TODO: use lexer to validate and normalize type
+ return tuple;
+ }
+ type = verifyBasicType(obj.type);
+ return new ParamType(_guard, name || "", type, type, indexed, null, null, null);
+ }
+ /**
+ * Returns true if %%value%% is a **ParamType**.
+ */
+ static isParamType(value) {
+ return (value && value[internal] === ParamTypeInternal);
+ }
+}
+exports.ParamType = ParamType;
+_ParamType_instances = new WeakSet(), _ParamType_walkAsync = function _ParamType_walkAsync(promises, value, process, setValue) {
+ if (this.isArray()) {
+ if (!Array.isArray(value)) {
+ throw new Error("invalid array value");
+ }
+ if (this.arrayLength !== -1 && value.length !== this.arrayLength) {
+ throw new Error("array is wrong length");
+ }
+ const childType = this.arrayChildren;
+ const result = value.slice();
+ result.forEach((value, index) => {
+ __classPrivateFieldGet(childType, _ParamType_instances, "m", _ParamType_walkAsync).call(childType, promises, value, process, (value) => {
+ result[index] = value;
+ });
+ });
+ setValue(result);
+ return;
+ }
+ if (this.isTuple()) {
+ const components = this.components;
+ // Convert the object into an array
+ let result;
+ if (Array.isArray(value)) {
+ result = value.slice();
+ }
+ else {
+ if (value == null || typeof (value) !== "object") {
+ throw new Error("invalid tuple value");
+ }
+ result = components.map((param) => {
+ if (!param.name) {
+ throw new Error("cannot use object value with unnamed components");
+ }
+ if (!(param.name in value)) {
+ throw new Error(`missing value for component ${param.name}`);
+ }
+ return value[param.name];
+ });
+ }
+ if (result.length !== this.components.length) {
+ throw new Error("array is wrong length");
+ }
+ result.forEach((value, index) => {
+ var _a;
+ __classPrivateFieldGet((_a = components[index]), _ParamType_instances, "m", _ParamType_walkAsync).call(_a, promises, value, process, (value) => {
+ result[index] = value;
+ });
+ });
+ setValue(result);
+ return;
+ }
+ const result = process(this.type, value);
+ if (result.then) {
+ promises.push((function () {
+ return __awaiter(this, void 0, void 0, function* () { setValue(yield result); });
+ })());
+ }
+ else {
+ setValue(result);
+ }
+};
+/**
+ * An abstract class to represent An individual fragment from a parse ABI.
+ */
+class Fragment {
+ /**
+ * @private
+ */
+ constructor(guard, type, inputs) {
+ (0, index_js_1.assertPrivate)(guard, _guard, "Fragment");
+ inputs = Object.freeze(inputs.slice());
+ (0, index_js_1.defineProperties)(this, { type, inputs });
+ }
+ /**
+ * Creates a new **Fragment** for %%obj%%, wich can be any supported
+ * ABI frgament type.
+ */
+ static from(obj) {
+ if (typeof (obj) === "string") {
+ // Try parsing JSON...
+ try {
+ Fragment.from(JSON.parse(obj));
+ }
+ catch (e) { }
+ // ...otherwise, use the human-readable lexer
+ return Fragment.from(lex(obj));
+ }
+ if (obj instanceof TokenString) {
+ // Human-readable ABI (already lexed)
+ const type = obj.peekKeyword(KwTypes);
+ switch (type) {
+ case "constructor": return ConstructorFragment.from(obj);
+ case "error": return ErrorFragment.from(obj);
+ case "event": return EventFragment.from(obj);
+ case "fallback":
+ case "receive":
+ return FallbackFragment.from(obj);
+ case "function": return FunctionFragment.from(obj);
+ case "struct": return StructFragment.from(obj);
+ }
+ }
+ else if (typeof (obj) === "object") {
+ // JSON ABI
+ switch (obj.type) {
+ case "constructor": return ConstructorFragment.from(obj);
+ case "error": return ErrorFragment.from(obj);
+ case "event": return EventFragment.from(obj);
+ case "fallback":
+ case "receive":
+ return FallbackFragment.from(obj);
+ case "function": return FunctionFragment.from(obj);
+ case "struct": return StructFragment.from(obj);
+ }
+ (0, index_js_1.assert)(false, `unsupported type: ${obj.type}`, "UNSUPPORTED_OPERATION", {
+ operation: "Fragment.from"
+ });
+ }
+ (0, index_js_1.assertArgument)(false, "unsupported frgament object", "obj", obj);
+ }
+ /**
+ * Returns true if %%value%% is a [[ConstructorFragment]].
+ */
+ static isConstructor(value) {
+ return ConstructorFragment.isFragment(value);
+ }
+ /**
+ * Returns true if %%value%% is an [[ErrorFragment]].
+ */
+ static isError(value) {
+ return ErrorFragment.isFragment(value);
+ }
+ /**
+ * Returns true if %%value%% is an [[EventFragment]].
+ */
+ static isEvent(value) {
+ return EventFragment.isFragment(value);
+ }
+ /**
+ * Returns true if %%value%% is a [[FunctionFragment]].
+ */
+ static isFunction(value) {
+ return FunctionFragment.isFragment(value);
+ }
+ /**
+ * Returns true if %%value%% is a [[StructFragment]].
+ */
+ static isStruct(value) {
+ return StructFragment.isFragment(value);
+ }
+}
+exports.Fragment = Fragment;
+/**
+ * An abstract class to represent An individual fragment
+ * which has a name from a parse ABI.
+ */
+class NamedFragment extends Fragment {
+ /**
+ * @private
+ */
+ constructor(guard, type, name, inputs) {
+ super(guard, type, inputs);
+ (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 });
+ }
+}
+exports.NamedFragment = NamedFragment;
+function joinParams(format, params) {
+ return "(" + params.map((p) => p.format(format)).join((format === "full") ? ", " : ",") + ")";
+}
+/**
+ * A Fragment which represents a //Custom Error//.
+ */
+class ErrorFragment extends NamedFragment {
+ /**
+ * @private
+ */
+ constructor(guard, name, inputs) {
+ super(guard, "error", name, inputs);
+ Object.defineProperty(this, internal, { value: ErrorFragmentInternal });
+ }
+ /**
+ * The Custom Error selector.
+ */
+ get selector() {
+ return (0, index_js_2.id)(this.format("sighash")).substring(0, 10);
+ }
+ /**
+ * Returns a string representation of this fragment as %%format%%.
+ */
+ format(format) {
+ if (format == null) {
+ format = "sighash";
+ }
+ if (format === "json") {
+ return JSON.stringify({
+ type: "error",
+ name: this.name,
+ inputs: this.inputs.map((input) => JSON.parse(input.format(format))),
+ });
+ }
+ const result = [];
+ if (format !== "sighash") {
+ result.push("error");
+ }
+ result.push(this.name + joinParams(format, this.inputs));
+ return result.join(" ");
+ }
+ /**
+ * Returns a new **ErrorFragment** for %%obj%%.
+ */
+ static from(obj) {
+ if (ErrorFragment.isFragment(obj)) {
+ return obj;
+ }
+ if (typeof (obj) === "string") {
+ return ErrorFragment.from(lex(obj));
+ }
+ else if (obj instanceof TokenString) {
+ const name = consumeName("error", obj);
+ const inputs = consumeParams(obj);
+ consumeEoi(obj);
+ return new ErrorFragment(_guard, name, inputs);
+ }
+ return new ErrorFragment(_guard, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []);
+ }
+ /**
+ * Returns ``true`` and provides a type guard if %%value%% is an
+ * **ErrorFragment**.
+ */
+ static isFragment(value) {
+ return (value && value[internal] === ErrorFragmentInternal);
+ }
+}
+exports.ErrorFragment = ErrorFragment;
+/**
+ * A Fragment which represents an Event.
+ */
+class EventFragment extends NamedFragment {
+ /**
+ * @private
+ */
+ constructor(guard, name, inputs, anonymous) {
+ super(guard, "event", name, inputs);
+ Object.defineProperty(this, internal, { value: EventFragmentInternal });
+ (0, index_js_1.defineProperties)(this, { anonymous });
+ }
+ /**
+ * The Event topic hash.
+ */
+ get topicHash() {
+ return (0, index_js_2.id)(this.format("sighash"));
+ }
+ /**
+ * Returns a string representation of this event as %%format%%.
+ */
+ format(format) {
+ if (format == null) {
+ format = "sighash";
+ }
+ if (format === "json") {
+ return JSON.stringify({
+ type: "event",
+ anonymous: this.anonymous,
+ name: this.name,
+ inputs: this.inputs.map((i) => JSON.parse(i.format(format)))
+ });
+ }
+ const result = [];
+ if (format !== "sighash") {
+ result.push("event");
+ }
+ result.push(this.name + joinParams(format, this.inputs));
+ if (format !== "sighash" && this.anonymous) {
+ result.push("anonymous");
+ }
+ return result.join(" ");
+ }
+ /**
+ * Return the topic hash for an event with %%name%% and %%params%%.
+ */
+ static getTopicHash(name, params) {
+ params = (params || []).map((p) => ParamType.from(p));
+ const fragment = new EventFragment(_guard, name, params, false);
+ return fragment.topicHash;
+ }
+ /**
+ * Returns a new **EventFragment** for %%obj%%.
+ */
+ static from(obj) {
+ if (EventFragment.isFragment(obj)) {
+ return obj;
+ }
+ if (typeof (obj) === "string") {
+ try {
+ return EventFragment.from(lex(obj));
+ }
+ catch (error) {
+ (0, index_js_1.assertArgument)(false, "invalid event fragment", "obj", obj);
+ }
+ }
+ else if (obj instanceof TokenString) {
+ const name = consumeName("event", obj);
+ const inputs = consumeParams(obj, true);
+ const anonymous = !!consumeKeywords(obj, setify(["anonymous"])).has("anonymous");
+ consumeEoi(obj);
+ return new EventFragment(_guard, name, inputs, anonymous);
+ }
+ return new EventFragment(_guard, obj.name, obj.inputs ? obj.inputs.map((p) => ParamType.from(p, true)) : [], !!obj.anonymous);
+ }
+ /**
+ * Returns ``true`` and provides a type guard if %%value%% is an
+ * **EventFragment**.
+ */
+ static isFragment(value) {
+ return (value && value[internal] === EventFragmentInternal);
+ }
+}
+exports.EventFragment = EventFragment;
+/**
+ * A Fragment which represents a constructor.
+ */
+class ConstructorFragment extends Fragment {
+ /**
+ * @private
+ */
+ constructor(guard, type, inputs, payable, gas) {
+ super(guard, type, inputs);
+ Object.defineProperty(this, internal, { value: ConstructorFragmentInternal });
+ (0, index_js_1.defineProperties)(this, { payable, gas });
+ }
+ /**
+ * Returns a string representation of this constructor as %%format%%.
+ */
+ format(format) {
+ (0, index_js_1.assert)(format != null && format !== "sighash", "cannot format a constructor for sighash", "UNSUPPORTED_OPERATION", { operation: "format(sighash)" });
+ if (format === "json") {
+ return JSON.stringify({
+ type: "constructor",
+ stateMutability: (this.payable ? "payable" : "undefined"),
+ payable: this.payable,
+ gas: ((this.gas != null) ? this.gas : undefined),
+ inputs: this.inputs.map((i) => JSON.parse(i.format(format)))
+ });
+ }
+ const result = [`constructor${joinParams(format, this.inputs)}`];
+ if (this.payable) {
+ result.push("payable");
+ }
+ if (this.gas != null) {
+ result.push(`@${this.gas.toString()}`);
+ }
+ return result.join(" ");
+ }
+ /**
+ * Returns a new **ConstructorFragment** for %%obj%%.
+ */
+ static from(obj) {
+ if (ConstructorFragment.isFragment(obj)) {
+ return obj;
+ }
+ if (typeof (obj) === "string") {
+ try {
+ return ConstructorFragment.from(lex(obj));
+ }
+ catch (error) {
+ (0, index_js_1.assertArgument)(false, "invalid constuctor fragment", "obj", obj);
+ }
+ }
+ else if (obj instanceof TokenString) {
+ consumeKeywords(obj, setify(["constructor"]));
+ const inputs = consumeParams(obj);
+ const payable = !!consumeKeywords(obj, KwVisibDeploy).has("payable");
+ const gas = consumeGas(obj);
+ consumeEoi(obj);
+ return new ConstructorFragment(_guard, "constructor", inputs, payable, gas);
+ }
+ return new ConstructorFragment(_guard, "constructor", obj.inputs ? obj.inputs.map(ParamType.from) : [], !!obj.payable, (obj.gas != null) ? obj.gas : null);
+ }
+ /**
+ * Returns ``true`` and provides a type guard if %%value%% is a
+ * **ConstructorFragment**.
+ */
+ static isFragment(value) {
+ return (value && value[internal] === ConstructorFragmentInternal);
+ }
+}
+exports.ConstructorFragment = ConstructorFragment;
+/**
+ * A Fragment which represents a method.
+ */
+class FallbackFragment extends Fragment {
+ constructor(guard, inputs, payable) {
+ super(guard, "fallback", inputs);
+ Object.defineProperty(this, internal, { value: FallbackFragmentInternal });
+ (0, index_js_1.defineProperties)(this, { payable });
+ }
+ /**
+ * Returns a string representation of this fallback as %%format%%.
+ */
+ format(format) {
+ const type = ((this.inputs.length === 0) ? "receive" : "fallback");
+ if (format === "json") {
+ const stateMutability = (this.payable ? "payable" : "nonpayable");
+ return JSON.stringify({ type, stateMutability });
+ }
+ return `${type}()${this.payable ? " payable" : ""}`;
+ }
+ /**
+ * Returns a new **FallbackFragment** for %%obj%%.
+ */
+ static from(obj) {
+ if (FallbackFragment.isFragment(obj)) {
+ return obj;
+ }
+ if (typeof (obj) === "string") {
+ try {
+ return FallbackFragment.from(lex(obj));
+ }
+ catch (error) {
+ (0, index_js_1.assertArgument)(false, "invalid fallback fragment", "obj", obj);
+ }
+ }
+ else if (obj instanceof TokenString) {
+ const errorObj = obj.toString();
+ const topIsValid = obj.peekKeyword(setify(["fallback", "receive"]));
+ (0, index_js_1.assertArgument)(topIsValid, "type must be fallback or receive", "obj", errorObj);
+ const type = obj.popKeyword(setify(["fallback", "receive"]));
+ // receive()
+ if (type === "receive") {
+ const inputs = consumeParams(obj);
+ (0, index_js_1.assertArgument)(inputs.length === 0, `receive cannot have arguments`, "obj.inputs", inputs);
+ consumeKeywords(obj, setify(["payable"]));
+ consumeEoi(obj);
+ return new FallbackFragment(_guard, [], true);
+ }
+ // fallback() [payable]
+ // fallback(bytes) [payable] returns (bytes)
+ let inputs = consumeParams(obj);
+ if (inputs.length) {
+ (0, index_js_1.assertArgument)(inputs.length === 1 && inputs[0].type === "bytes", "invalid fallback inputs", "obj.inputs", inputs.map((i) => i.format("minimal")).join(", "));
+ }
+ else {
+ inputs = [ParamType.from("bytes")];
+ }
+ const mutability = consumeMutability(obj);
+ (0, index_js_1.assertArgument)(mutability === "nonpayable" || mutability === "payable", "fallback cannot be constants", "obj.stateMutability", mutability);
+ if (consumeKeywords(obj, setify(["returns"])).has("returns")) {
+ const outputs = consumeParams(obj);
+ (0, index_js_1.assertArgument)(outputs.length === 1 && outputs[0].type === "bytes", "invalid fallback outputs", "obj.outputs", outputs.map((i) => i.format("minimal")).join(", "));
+ }
+ consumeEoi(obj);
+ return new FallbackFragment(_guard, inputs, mutability === "payable");
+ }
+ if (obj.type === "receive") {
+ return new FallbackFragment(_guard, [], true);
+ }
+ if (obj.type === "fallback") {
+ const inputs = [ParamType.from("bytes")];
+ const payable = (obj.stateMutability === "payable");
+ return new FallbackFragment(_guard, inputs, payable);
+ }
+ (0, index_js_1.assertArgument)(false, "invalid fallback description", "obj", obj);
+ }
+ /**
+ * Returns ``true`` and provides a type guard if %%value%% is a
+ * **FallbackFragment**.
+ */
+ static isFragment(value) {
+ return (value && value[internal] === FallbackFragmentInternal);
+ }
+}
+exports.FallbackFragment = FallbackFragment;
+/**
+ * A Fragment which represents a method.
+ */
+class FunctionFragment extends NamedFragment {
+ /**
+ * @private
+ */
+ constructor(guard, name, stateMutability, inputs, outputs, gas) {
+ super(guard, "function", name, inputs);
+ Object.defineProperty(this, internal, { value: FunctionFragmentInternal });
+ outputs = Object.freeze(outputs.slice());
+ const constant = (stateMutability === "view" || stateMutability === "pure");
+ const payable = (stateMutability === "payable");
+ (0, index_js_1.defineProperties)(this, { constant, gas, outputs, payable, stateMutability });
+ }
+ /**
+ * The Function selector.
+ */
+ get selector() {
+ return (0, index_js_2.id)(this.format("sighash")).substring(0, 10);
+ }
+ /**
+ * Returns a string representation of this function as %%format%%.
+ */
+ format(format) {
+ if (format == null) {
+ format = "sighash";
+ }
+ if (format === "json") {
+ return JSON.stringify({
+ type: "function",
+ name: this.name,
+ constant: this.constant,
+ stateMutability: ((this.stateMutability !== "nonpayable") ? this.stateMutability : undefined),
+ payable: this.payable,
+ gas: ((this.gas != null) ? this.gas : undefined),
+ inputs: this.inputs.map((i) => JSON.parse(i.format(format))),
+ outputs: this.outputs.map((o) => JSON.parse(o.format(format))),
+ });
+ }
+ const result = [];
+ if (format !== "sighash") {
+ result.push("function");
+ }
+ result.push(this.name + joinParams(format, this.inputs));
+ if (format !== "sighash") {
+ if (this.stateMutability !== "nonpayable") {
+ result.push(this.stateMutability);
+ }
+ if (this.outputs && this.outputs.length) {
+ result.push("returns");
+ result.push(joinParams(format, this.outputs));
+ }
+ if (this.gas != null) {
+ result.push(`@${this.gas.toString()}`);
+ }
+ }
+ return result.join(" ");
+ }
+ /**
+ * Return the selector for a function with %%name%% and %%params%%.
+ */
+ static getSelector(name, params) {
+ params = (params || []).map((p) => ParamType.from(p));
+ const fragment = new FunctionFragment(_guard, name, "view", params, [], null);
+ return fragment.selector;
+ }
+ /**
+ * Returns a new **FunctionFragment** for %%obj%%.
+ */
+ static from(obj) {
+ if (FunctionFragment.isFragment(obj)) {
+ return obj;
+ }
+ if (typeof (obj) === "string") {
+ try {
+ return FunctionFragment.from(lex(obj));
+ }
+ catch (error) {
+ (0, index_js_1.assertArgument)(false, "invalid function fragment", "obj", obj);
+ }
+ }
+ else if (obj instanceof TokenString) {
+ const name = consumeName("function", obj);
+ const inputs = consumeParams(obj);
+ const mutability = consumeMutability(obj);
+ let outputs = [];
+ if (consumeKeywords(obj, setify(["returns"])).has("returns")) {
+ outputs = consumeParams(obj);
+ }
+ const gas = consumeGas(obj);
+ consumeEoi(obj);
+ return new FunctionFragment(_guard, name, mutability, inputs, outputs, gas);
+ }
+ let stateMutability = obj.stateMutability;
+ // Use legacy Solidity ABI logic if stateMutability is missing
+ if (stateMutability == null) {
+ stateMutability = "payable";
+ if (typeof (obj.constant) === "boolean") {
+ stateMutability = "view";
+ if (!obj.constant) {
+ stateMutability = "payable";
+ if (typeof (obj.payable) === "boolean" && !obj.payable) {
+ stateMutability = "nonpayable";
+ }
+ }
+ }
+ else if (typeof (obj.payable) === "boolean" && !obj.payable) {
+ stateMutability = "nonpayable";
+ }
+ }
+ // @TODO: verifyState for stateMutability (e.g. throw if
+ // payable: false but stateMutability is "nonpayable")
+ return new FunctionFragment(_guard, obj.name, stateMutability, obj.inputs ? obj.inputs.map(ParamType.from) : [], obj.outputs ? obj.outputs.map(ParamType.from) : [], (obj.gas != null) ? obj.gas : null);
+ }
+ /**
+ * Returns ``true`` and provides a type guard if %%value%% is a
+ * **FunctionFragment**.
+ */
+ static isFragment(value) {
+ return (value && value[internal] === FunctionFragmentInternal);
+ }
+}
+exports.FunctionFragment = FunctionFragment;
+/**
+ * A Fragment which represents a structure.
+ */
+class StructFragment extends NamedFragment {
+ /**
+ * @private
+ */
+ constructor(guard, name, inputs) {
+ super(guard, "struct", name, inputs);
+ Object.defineProperty(this, internal, { value: StructFragmentInternal });
+ }
+ /**
+ * Returns a string representation of this struct as %%format%%.
+ */
+ format() {
+ throw new Error("@TODO");
+ }
+ /**
+ * Returns a new **StructFragment** for %%obj%%.
+ */
+ static from(obj) {
+ if (typeof (obj) === "string") {
+ try {
+ return StructFragment.from(lex(obj));
+ }
+ catch (error) {
+ (0, index_js_1.assertArgument)(false, "invalid struct fragment", "obj", obj);
+ }
+ }
+ else if (obj instanceof TokenString) {
+ const name = consumeName("struct", obj);
+ const inputs = consumeParams(obj);
+ consumeEoi(obj);
+ return new StructFragment(_guard, name, inputs);
+ }
+ return new StructFragment(_guard, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []);
+ }
+ // @TODO: fix this return type
+ /**
+ * Returns ``true`` and provides a type guard if %%value%% is a
+ * **StructFragment**.
+ */
+ static isFragment(value) {
+ return (value && value[internal] === StructFragmentInternal);
+ }
+}
+exports.StructFragment = StructFragment;
+//# sourceMappingURL=fragments.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/fragments.js.map b/dist/ethers.js/src.ts/abi/fragments.js.map
new file mode 100644
index 0000000..80c1c9c
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/fragments.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"fragments.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/abi/fragments.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;;;;;;;;;AAEH,gDAG2B;AAC3B,+CAAsC;AAgFrC,CAAC;AAoBF,qCAAqC;AACr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;SAEJ;aAAM,IAAI,GAAG,YAAY,WAAW,EAAE;YACnC,MAAM,IAAI,GAAG,WAAW,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;YACxC,MAAM,MAAM,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;YAClC,UAAU,CAAC,GAAG,CAAC,CAAC;YAChB,OAAO,IAAI,cAAc,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;SACnD;QAED,OAAO,IAAI,cAAc,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA,CAAC,CAAC,EAAG,CAAC,CAAC;IAClG,CAAC;IAEL,8BAA8B;IAC1B;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,KAAU;QACxB,OAAO,CAAC,KAAK,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,sBAAsB,CAAC,CAAC;IACjE,CAAC;CACJ;AA9CD,wCA8CC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/index.d.ts b/dist/ethers.js/src.ts/abi/index.d.ts
new file mode 100644
index 0000000..2bf3993
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/index.d.ts
@@ -0,0 +1,18 @@
+/**
+ * The Application Binary Interface (ABI) describes how method input
+ * parameters should be encoded, their results decoded, and how to
+ * decode events and errors.
+ *
+ * See [About ABIs](docs-abi) for more details how they are used.
+ *
+ * @_section api/abi:Application Binary Interface [about-abi]
+ * @_navTitle: ABI
+ */
+export { AbiCoder } from "./abi-coder.js";
+export { decodeBytes32String, encodeBytes32String } from "./bytes32.js";
+export { ConstructorFragment, ErrorFragment, EventFragment, FallbackFragment, Fragment, FunctionFragment, NamedFragment, ParamType, StructFragment, } from "./fragments.js";
+export { checkResultErrors, Indexed, Interface, ErrorDescription, LogDescription, TransactionDescription, Result } from "./interface.js";
+export { Typed } from "./typed.js";
+export type { JsonFragment, JsonFragmentType, FormatType, FragmentType, ParamTypeWalkAsyncFunc, ParamTypeWalkFunc } from "./fragments.js";
+export type { InterfaceAbi, } from "./interface.js";
+//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/index.d.ts.map b/dist/ethers.js/src.ts/abi/index.d.ts.map
new file mode 100644
index 0000000..4937120
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/abi/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAExE,OAAO,EACH,mBAAmB,EAAE,aAAa,EAAE,aAAa,EAAE,gBAAgB,EACnE,QAAQ,EAAE,gBAAgB,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,GACvE,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACH,iBAAiB,EACjB,OAAO,EACP,SAAS,EACT,gBAAgB,EAAE,cAAc,EAAE,sBAAsB,EACxD,MAAM,EACT,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,YAAY,EACR,YAAY,EAAE,gBAAgB,EAC9B,UAAU,EAAE,YAAY,EAAE,sBAAsB,EAAE,iBAAiB,EACtE,MAAM,gBAAgB,CAAC;AAExB,YAAY,EACR,YAAY,GACf,MAAM,gBAAgB,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/index.js b/dist/ethers.js/src.ts/abi/index.js
new file mode 100644
index 0000000..b7bb84a
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/index.js
@@ -0,0 +1,40 @@
+"use strict";
+/**
+ * The Application Binary Interface (ABI) describes how method input
+ * parameters should be encoded, their results decoded, and how to
+ * decode events and errors.
+ *
+ * See [About ABIs](docs-abi) for more details how they are used.
+ *
+ * @_section api/abi:Application Binary Interface [about-abi]
+ * @_navTitle: ABI
+ */
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.Typed = exports.Result = exports.TransactionDescription = exports.LogDescription = exports.ErrorDescription = exports.Interface = exports.Indexed = exports.checkResultErrors = exports.StructFragment = exports.ParamType = exports.NamedFragment = exports.FunctionFragment = exports.Fragment = exports.FallbackFragment = exports.EventFragment = exports.ErrorFragment = exports.ConstructorFragment = exports.encodeBytes32String = exports.decodeBytes32String = exports.AbiCoder = void 0;
+//////
+var abi_coder_js_1 = require("./abi-coder.js");
+Object.defineProperty(exports, "AbiCoder", { enumerable: true, get: function () { return abi_coder_js_1.AbiCoder; } });
+var bytes32_js_1 = require("./bytes32.js");
+Object.defineProperty(exports, "decodeBytes32String", { enumerable: true, get: function () { return bytes32_js_1.decodeBytes32String; } });
+Object.defineProperty(exports, "encodeBytes32String", { enumerable: true, get: function () { return bytes32_js_1.encodeBytes32String; } });
+var fragments_js_1 = require("./fragments.js");
+Object.defineProperty(exports, "ConstructorFragment", { enumerable: true, get: function () { return fragments_js_1.ConstructorFragment; } });
+Object.defineProperty(exports, "ErrorFragment", { enumerable: true, get: function () { return fragments_js_1.ErrorFragment; } });
+Object.defineProperty(exports, "EventFragment", { enumerable: true, get: function () { return fragments_js_1.EventFragment; } });
+Object.defineProperty(exports, "FallbackFragment", { enumerable: true, get: function () { return fragments_js_1.FallbackFragment; } });
+Object.defineProperty(exports, "Fragment", { enumerable: true, get: function () { return fragments_js_1.Fragment; } });
+Object.defineProperty(exports, "FunctionFragment", { enumerable: true, get: function () { return fragments_js_1.FunctionFragment; } });
+Object.defineProperty(exports, "NamedFragment", { enumerable: true, get: function () { return fragments_js_1.NamedFragment; } });
+Object.defineProperty(exports, "ParamType", { enumerable: true, get: function () { return fragments_js_1.ParamType; } });
+Object.defineProperty(exports, "StructFragment", { enumerable: true, get: function () { return fragments_js_1.StructFragment; } });
+var interface_js_1 = require("./interface.js");
+Object.defineProperty(exports, "checkResultErrors", { enumerable: true, get: function () { return interface_js_1.checkResultErrors; } });
+Object.defineProperty(exports, "Indexed", { enumerable: true, get: function () { return interface_js_1.Indexed; } });
+Object.defineProperty(exports, "Interface", { enumerable: true, get: function () { return interface_js_1.Interface; } });
+Object.defineProperty(exports, "ErrorDescription", { enumerable: true, get: function () { return interface_js_1.ErrorDescription; } });
+Object.defineProperty(exports, "LogDescription", { enumerable: true, get: function () { return interface_js_1.LogDescription; } });
+Object.defineProperty(exports, "TransactionDescription", { enumerable: true, get: function () { return interface_js_1.TransactionDescription; } });
+Object.defineProperty(exports, "Result", { enumerable: true, get: function () { return interface_js_1.Result; } });
+var typed_js_1 = require("./typed.js");
+Object.defineProperty(exports, "Typed", { enumerable: true, get: function () { return typed_js_1.Typed; } });
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/index.js.map b/dist/ethers.js/src.ts/abi/index.js.map
new file mode 100644
index 0000000..1edcd89
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/abi/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AAGH,MAAM;AACN,+CAA0C;AAAjC,wGAAA,QAAQ,OAAA;AAEjB,2CAAwE;AAA/D,iHAAA,mBAAmB,OAAA;AAAE,iHAAA,mBAAmB,OAAA;AAEjD,+CAGwB;AAFpB,mHAAA,mBAAmB,OAAA;AAAE,6GAAA,aAAa,OAAA;AAAE,6GAAA,aAAa,OAAA;AAAE,gHAAA,gBAAgB,OAAA;AACnE,wGAAA,QAAQ,OAAA;AAAE,gHAAA,gBAAgB,OAAA;AAAE,6GAAA,aAAa,OAAA;AAAE,yGAAA,SAAS,OAAA;AAAE,8GAAA,cAAc,OAAA;AAGxE,+CAMwB;AALpB,iHAAA,iBAAiB,OAAA;AACjB,uGAAA,OAAO,OAAA;AACP,yGAAA,SAAS,OAAA;AACT,gHAAA,gBAAgB,OAAA;AAAE,8GAAA,cAAc,OAAA;AAAE,sHAAA,sBAAsB,OAAA;AACxD,sGAAA,MAAM,OAAA;AAGV,uCAAmC;AAA1B,iGAAA,KAAK,OAAA"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/interface.d.ts b/dist/ethers.js/src.ts/abi/interface.d.ts
new file mode 100644
index 0000000..0801fe4
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/interface.d.ts
@@ -0,0 +1,382 @@
+/**
+ * The Interface class is a low-level class that accepts an
+ * ABI and provides all the necessary functionality to encode
+ * and decode paramaters to and results from methods, events
+ * and errors.
+ *
+ * It also provides several convenience methods to automatically
+ * search and find matching transactions and events to parse them.
+ *
+ * @_subsection api/abi:Interfaces [interfaces]
+ */
+import { AbiCoder } from "./abi-coder.js";
+import { checkResultErrors, Result } from "./coders/abstract-coder.js";
+import { ConstructorFragment, ErrorFragment, EventFragment, FallbackFragment, Fragment, FunctionFragment, ParamType } from "./fragments.js";
+import { Typed } from "./typed.js";
+import type { BigNumberish, BytesLike, CallExceptionError, CallExceptionTransaction } from "../utils/index.js";
+import type { JsonFragment } from "./fragments.js";
+export { checkResultErrors, Result };
+/**
+ * When using the [[Interface-parseLog]] to automatically match a Log to its event
+ * for parsing, a **LogDescription** is returned.
+ */
+export declare class LogDescription {
+ /**
+ * The matching fragment for the ``topic0``.
+ */
+ readonly fragment: EventFragment;
+ /**
+ * The name of the Event.
+ */
+ readonly name: string;
+ /**
+ * The full Event signature.
+ */
+ readonly signature: string;
+ /**
+ * The topic hash for the Event.
+ */
+ readonly topic: string;
+ /**
+ * The arguments passed into the Event with ``emit``.
+ */
+ readonly args: Result;
+ /**
+ * @_ignore:
+ */
+ constructor(fragment: EventFragment, topic: string, args: Result);
+}
+/**
+ * When using the [[Interface-parseTransaction]] to automatically match
+ * a transaction data to its function for parsing,
+ * a **TransactionDescription** is returned.
+ */
+export declare class TransactionDescription {
+ /**
+ * The matching fragment from the transaction ``data``.
+ */
+ readonly fragment: FunctionFragment;
+ /**
+ * The name of the Function from the transaction ``data``.
+ */
+ readonly name: string;
+ /**
+ * The arguments passed to the Function from the transaction ``data``.
+ */
+ readonly args: Result;
+ /**
+ * The full Function signature from the transaction ``data``.
+ */
+ readonly signature: string;
+ /**
+ * The selector for the Function from the transaction ``data``.
+ */
+ readonly selector: string;
+ /**
+ * The ``value`` (in wei) from the transaction.
+ */
+ readonly value: bigint;
+ /**
+ * @_ignore:
+ */
+ constructor(fragment: FunctionFragment, selector: string, args: Result, value: bigint);
+}
+/**
+ * When using the [[Interface-parseError]] to automatically match an
+ * error for a call result for parsing, an **ErrorDescription** is returned.
+ */
+export declare class ErrorDescription {
+ /**
+ * The matching fragment.
+ */
+ readonly fragment: ErrorFragment;
+ /**
+ * The name of the Error.
+ */
+ readonly name: string;
+ /**
+ * The arguments passed to the Error with ``revert``.
+ */
+ readonly args: Result;
+ /**
+ * The full Error signature.
+ */
+ readonly signature: string;
+ /**
+ * The selector for the Error.
+ */
+ readonly selector: string;
+ /**
+ * @_ignore:
+ */
+ constructor(fragment: ErrorFragment, selector: string, args: Result);
+}
+/**
+ * An **Indexed** is used as a value when a value that does not
+ * fit within a topic (i.e. not a fixed-length, 32-byte type). It
+ * is the ``keccak256`` of the value, and used for types such as
+ * arrays, tuples, bytes and strings.
+ */
+export declare class Indexed {
+ /**
+ * The ``keccak256`` of the value logged.
+ */
+ readonly hash: null | string;
+ /**
+ * @_ignore:
+ */
+ readonly _isIndexed: boolean;
+ /**
+ * Returns ``true`` if %%value%% is an **Indexed**.
+ *
+ * This provides a Type Guard for property access.
+ */
+ static isIndexed(value: any): value is Indexed;
+ /**
+ * @_ignore:
+ */
+ constructor(hash: null | string);
+}
+/**
+ * An **InterfaceAbi** may be any supported ABI format.
+ *
+ * A string is expected to be a JSON string, which will be parsed
+ * using ``JSON.parse``. This means that the value **must** be a valid
+ * JSON string, with no stray commas, etc.
+ *
+ * An array may contain any combination of:
+ * - Human-Readable fragments
+ * - Parsed JSON fragment
+ * - [[Fragment]] instances
+ *
+ * A **Human-Readable Fragment** is a string which resembles a Solidity
+ * signature and is introduced in [this blog entry](link-ricmoo-humanreadableabi).
+ * For example, ``function balanceOf(address) view returns (uint)``.
+ *
+ * A **Parsed JSON Fragment** is a JavaScript Object desribed in the
+ * [Solidity documentation](link-solc-jsonabi).
+ */
+export type InterfaceAbi = string | ReadonlyArray;
+/**
+ * An Interface abstracts many of the low-level details for
+ * encoding and decoding the data on the blockchain.
+ *
+ * An ABI provides information on how to encode data to send to
+ * a Contract, how to decode the results and events and how to
+ * interpret revert errors.
+ *
+ * The ABI can be specified by [any supported format](InterfaceAbi).
+ */
+export declare class Interface {
+ #private;
+ /**
+ * All the Contract ABI members (i.e. methods, events, errors, etc).
+ */
+ readonly fragments: ReadonlyArray;
+ /**
+ * The Contract constructor.
+ */
+ readonly deploy: ConstructorFragment;
+ /**
+ * The Fallback method, if any.
+ */
+ readonly fallback: null | FallbackFragment;
+ /**
+ * If receiving ether is supported.
+ */
+ readonly receive: boolean;
+ /**
+ * Create a new Interface for the %%fragments%%.
+ */
+ constructor(fragments: InterfaceAbi);
+ /**
+ * Returns the entire Human-Readable ABI, as an array of
+ * signatures, optionally as %%minimal%% strings, which
+ * removes parameter names and unneceesary spaces.
+ */
+ format(minimal?: boolean): Array;
+ /**
+ * Return the JSON-encoded ABI. This is the format Solidiy
+ * returns.
+ */
+ formatJson(): string;
+ /**
+ * The ABI coder that will be used to encode and decode binary
+ * data.
+ */
+ getAbiCoder(): AbiCoder;
+ /**
+ * Get the function name for %%key%%, which may be a function selector,
+ * function name or function signature that belongs to the ABI.
+ */
+ getFunctionName(key: string): string;
+ /**
+ * Returns true if %%key%% (a function selector, function name or
+ * function signature) is present in the ABI.
+ *
+ * In the case of a function name, the name may be ambiguous, so
+ * accessing the [[FunctionFragment]] may require refinement.
+ */
+ hasFunction(key: string): boolean;
+ /**
+ * Get the [[FunctionFragment]] for %%key%%, which may be a function
+ * selector, function name or function signature that belongs to the ABI.
+ *
+ * If %%values%% is provided, it will use the Typed API to handle
+ * ambiguous cases where multiple functions match by name.
+ *
+ * If the %%key%% and %%values%% do not refine to a single function in
+ * the ABI, this will throw.
+ */
+ getFunction(key: string, values?: Array): null | FunctionFragment;
+ /**
+ * Iterate over all functions, calling %%callback%%, sorted by their name.
+ */
+ forEachFunction(callback: (func: FunctionFragment, index: number) => void): void;
+ /**
+ * Get the event name for %%key%%, which may be a topic hash,
+ * event name or event signature that belongs to the ABI.
+ */
+ getEventName(key: string): string;
+ /**
+ * Returns true if %%key%% (an event topic hash, event name or
+ * event signature) is present in the ABI.
+ *
+ * In the case of an event name, the name may be ambiguous, so
+ * accessing the [[EventFragment]] may require refinement.
+ */
+ hasEvent(key: string): boolean;
+ /**
+ * Get the [[EventFragment]] for %%key%%, which may be a topic hash,
+ * event name or event signature that belongs to the ABI.
+ *
+ * If %%values%% is provided, it will use the Typed API to handle
+ * ambiguous cases where multiple events match by name.
+ *
+ * If the %%key%% and %%values%% do not refine to a single event in
+ * the ABI, this will throw.
+ */
+ getEvent(key: string, values?: Array): null | EventFragment;
+ /**
+ * Iterate over all events, calling %%callback%%, sorted by their name.
+ */
+ forEachEvent(callback: (func: EventFragment, index: number) => void): void;
+ /**
+ * Get the [[ErrorFragment]] for %%key%%, which may be an error
+ * selector, error name or error signature that belongs to the ABI.
+ *
+ * If %%values%% is provided, it will use the Typed API to handle
+ * ambiguous cases where multiple errors match by name.
+ *
+ * If the %%key%% and %%values%% do not refine to a single error in
+ * the ABI, this will throw.
+ */
+ getError(key: string, values?: Array): null | ErrorFragment;
+ /**
+ * Iterate over all errors, calling %%callback%%, sorted by their name.
+ */
+ forEachError(callback: (func: ErrorFragment, index: number) => void): void;
+ _decodeParams(params: ReadonlyArray, data: BytesLike): Result;
+ _encodeParams(params: ReadonlyArray, values: ReadonlyArray): string;
+ /**
+ * Encodes a ``tx.data`` object for deploying the Contract with
+ * the %%values%% as the constructor arguments.
+ */
+ encodeDeploy(values?: ReadonlyArray): string;
+ /**
+ * Decodes the result %%data%% (e.g. from an ``eth_call``) for the
+ * specified error (see [[getError]] for valid values for
+ * %%key%%).
+ *
+ * Most developers should prefer the [[parseCallResult]] method instead,
+ * which will automatically detect a ``CALL_EXCEPTION`` and throw the
+ * corresponding error.
+ */
+ decodeErrorResult(fragment: ErrorFragment | string, data: BytesLike): Result;
+ /**
+ * Encodes the transaction revert data for a call result that
+ * reverted from the the Contract with the sepcified %%error%%
+ * (see [[getError]] for valid values for %%fragment%%) with the %%values%%.
+ *
+ * This is generally not used by most developers, unless trying to mock
+ * a result from a Contract.
+ */
+ encodeErrorResult(fragment: ErrorFragment | string, values?: ReadonlyArray): string;
+ /**
+ * Decodes the %%data%% from a transaction ``tx.data`` for
+ * the function specified (see [[getFunction]] for valid values
+ * for %%fragment%%).
+ *
+ * Most developers should prefer the [[parseTransaction]] method
+ * instead, which will automatically detect the fragment.
+ */
+ decodeFunctionData(fragment: FunctionFragment | string, data: BytesLike): Result;
+ /**
+ * Encodes the ``tx.data`` for a transaction that calls the function
+ * specified (see [[getFunction]] for valid values for %%fragment%%) with
+ * the %%values%%.
+ */
+ encodeFunctionData(fragment: FunctionFragment | string, values?: ReadonlyArray): string;
+ /**
+ * Decodes the result %%data%% (e.g. from an ``eth_call``) for the
+ * specified function (see [[getFunction]] for valid values for
+ * %%key%%).
+ *
+ * Most developers should prefer the [[parseCallResult]] method instead,
+ * which will automatically detect a ``CALL_EXCEPTION`` and throw the
+ * corresponding error.
+ */
+ decodeFunctionResult(fragment: FunctionFragment | string, data: BytesLike): Result;
+ makeError(_data: BytesLike, tx: CallExceptionTransaction): CallExceptionError;
+ /**
+ * Encodes the result data (e.g. from an ``eth_call``) for the
+ * specified function (see [[getFunction]] for valid values
+ * for %%fragment%%) with %%values%%.
+ *
+ * This is generally not used by most developers, unless trying to mock
+ * a result from a Contract.
+ */
+ encodeFunctionResult(fragment: FunctionFragment | string, values?: ReadonlyArray): string;
+ encodeFilterTopics(fragment: EventFragment | string, values: ReadonlyArray): Array>;
+ encodeEventLog(fragment: EventFragment | string, values: ReadonlyArray): {
+ data: string;
+ topics: Array;
+ };
+ decodeEventLog(fragment: EventFragment | string, data: BytesLike, topics?: ReadonlyArray): Result;
+ /**
+ * Parses a transaction, finding the matching function and extracts
+ * the parameter values along with other useful function details.
+ *
+ * If the matching function cannot be found, return null.
+ */
+ parseTransaction(tx: {
+ data: string;
+ value?: BigNumberish;
+ }): null | TransactionDescription;
+ parseCallResult(data: BytesLike): Result;
+ /**
+ * Parses a receipt log, finding the matching event and extracts
+ * the parameter values along with other useful event details.
+ *
+ * If the matching event cannot be found, returns null.
+ */
+ parseLog(log: {
+ topics: Array;
+ data: string;
+ }): null | LogDescription;
+ /**
+ * Parses a revert data, finding the matching error and extracts
+ * the parameter values along with other useful error details.
+ *
+ * If the matching error cannot be found, returns null.
+ */
+ parseError(data: BytesLike): null | ErrorDescription;
+ /**
+ * Creates a new [[Interface]] from the ABI %%value%%.
+ *
+ * The %%value%% may be provided as an existing [[Interface]] object,
+ * a JSON-encoded ABI or any Human-Readable ABI format.
+ */
+ static from(value: InterfaceAbi | Interface): Interface;
+}
+//# sourceMappingURL=interface.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/interface.d.ts.map b/dist/ethers.js/src.ts/abi/interface.d.ts.map
new file mode 100644
index 0000000..6954244
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/interface.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/abi/interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAUH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAA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AAC,MAAM,CAAC,CAAC;IAgEtH,cAAc,CAAC,QAAQ,EAAE,aAAa,GAAG,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;KAAE;IA6CrH,cAAc,CAAC,QAAQ,EAAE,aAAa,GAAG,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,MAAM;IAuEzG;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,YAAY,CAAA;KAAE,GAAG,IAAI,GAAG,sBAAsB;IAY3F,eAAe,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM;IAIxC;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,EAAE;QAAE,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,GAAG,IAAI,GAAG,cAAc;IAa5E;;;;;OAKG;IACH,UAAU,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,GAAG,gBAAgB;IAWpD;;;;;OAKG;IACH,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,GAAG,SAAS;CAe1D"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/interface.js b/dist/ethers.js/src.ts/abi/interface.js
new file mode 100644
index 0000000..23036a3
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/interface.js
@@ -0,0 +1,1028 @@
+"use strict";
+/**
+ * The Interface class is a low-level class that accepts an
+ * ABI and provides all the necessary functionality to encode
+ * and decode paramaters to and results from methods, events
+ * and errors.
+ *
+ * It also provides several convenience methods to automatically
+ * search and find matching transactions and events to parse them.
+ *
+ * @_subsection api/abi:Interfaces [interfaces]
+ */
+var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
+ if (kind === "m") throw new TypeError("Private method is not writable");
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
+};
+var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
+};
+var _Interface_instances, _Interface_errors, _Interface_events, _Interface_functions, _Interface_abiCoder, _Interface_getFunction, _Interface_getEvent;
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.Interface = exports.Indexed = exports.ErrorDescription = exports.TransactionDescription = exports.LogDescription = exports.Result = exports.checkResultErrors = void 0;
+const index_js_1 = require("../crypto/index.js");
+const index_js_2 = require("../hash/index.js");
+const index_js_3 = require("../utils/index.js");
+const abi_coder_js_1 = require("./abi-coder.js");
+const abstract_coder_js_1 = require("./coders/abstract-coder.js");
+Object.defineProperty(exports, "checkResultErrors", { enumerable: true, get: function () { return abstract_coder_js_1.checkResultErrors; } });
+Object.defineProperty(exports, "Result", { enumerable: true, get: function () { return abstract_coder_js_1.Result; } });
+const fragments_js_1 = require("./fragments.js");
+const typed_js_1 = require("./typed.js");
+/**
+ * When using the [[Interface-parseLog]] to automatically match a Log to its event
+ * for parsing, a **LogDescription** is returned.
+ */
+class LogDescription {
+ /**
+ * @_ignore:
+ */
+ constructor(fragment, topic, args) {
+ const name = fragment.name, signature = fragment.format();
+ (0, index_js_3.defineProperties)(this, {
+ fragment, name, signature, topic, args
+ });
+ }
+}
+exports.LogDescription = LogDescription;
+/**
+ * When using the [[Interface-parseTransaction]] to automatically match
+ * a transaction data to its function for parsing,
+ * a **TransactionDescription** is returned.
+ */
+class TransactionDescription {
+ /**
+ * @_ignore:
+ */
+ constructor(fragment, selector, args, value) {
+ const name = fragment.name, signature = fragment.format();
+ (0, index_js_3.defineProperties)(this, {
+ fragment, name, args, signature, selector, value
+ });
+ }
+}
+exports.TransactionDescription = TransactionDescription;
+/**
+ * When using the [[Interface-parseError]] to automatically match an
+ * error for a call result for parsing, an **ErrorDescription** is returned.
+ */
+class ErrorDescription {
+ /**
+ * @_ignore:
+ */
+ constructor(fragment, selector, args) {
+ const name = fragment.name, signature = fragment.format();
+ (0, index_js_3.defineProperties)(this, {
+ fragment, name, args, signature, selector
+ });
+ }
+}
+exports.ErrorDescription = ErrorDescription;
+/**
+ * An **Indexed** is used as a value when a value that does not
+ * fit within a topic (i.e. not a fixed-length, 32-byte type). It
+ * is the ``keccak256`` of the value, and used for types such as
+ * arrays, tuples, bytes and strings.
+ */
+class Indexed {
+ /**
+ * Returns ``true`` if %%value%% is an **Indexed**.
+ *
+ * This provides a Type Guard for property access.
+ */
+ static isIndexed(value) {
+ return !!(value && value._isIndexed);
+ }
+ /**
+ * @_ignore:
+ */
+ constructor(hash) {
+ (0, index_js_3.defineProperties)(this, { hash, _isIndexed: true });
+ }
+}
+exports.Indexed = Indexed;
+// https://docs.soliditylang.org/en/v0.8.13/control-structures.html?highlight=panic#panic-via-assert-and-error-via-require
+const PanicReasons = {
+ "0": "generic panic",
+ "1": "assert(false)",
+ "17": "arithmetic overflow",
+ "18": "division or modulo by zero",
+ "33": "enum overflow",
+ "34": "invalid encoded storage byte array accessed",
+ "49": "out-of-bounds array access; popping on an empty array",
+ "50": "out-of-bounds access of an array or bytesN",
+ "65": "out of memory",
+ "81": "uninitialized function",
+};
+const BuiltinErrors = {
+ "0x08c379a0": {
+ signature: "Error(string)",
+ name: "Error",
+ inputs: ["string"],
+ reason: (message) => {
+ return `reverted with reason string ${JSON.stringify(message)}`;
+ }
+ },
+ "0x4e487b71": {
+ signature: "Panic(uint256)",
+ name: "Panic",
+ inputs: ["uint256"],
+ reason: (code) => {
+ let reason = "unknown panic code";
+ if (code >= 0 && code <= 0xff && PanicReasons[code.toString()]) {
+ reason = PanicReasons[code.toString()];
+ }
+ return `reverted with panic code 0x${code.toString(16)} (${reason})`;
+ }
+ }
+};
+/**
+ * An Interface abstracts many of the low-level details for
+ * encoding and decoding the data on the blockchain.
+ *
+ * An ABI provides information on how to encode data to send to
+ * a Contract, how to decode the results and events and how to
+ * interpret revert errors.
+ *
+ * The ABI can be specified by [any supported format](InterfaceAbi).
+ */
+class Interface {
+ /**
+ * Create a new Interface for the %%fragments%%.
+ */
+ constructor(fragments) {
+ _Interface_instances.add(this);
+ _Interface_errors.set(this, void 0);
+ _Interface_events.set(this, void 0);
+ _Interface_functions.set(this, void 0);
+ // #structs: Map;
+ _Interface_abiCoder.set(this, void 0);
+ let abi = [];
+ if (typeof (fragments) === "string") {
+ abi = JSON.parse(fragments);
+ }
+ else {
+ abi = fragments;
+ }
+ __classPrivateFieldSet(this, _Interface_functions, new Map(), "f");
+ __classPrivateFieldSet(this, _Interface_errors, new Map(), "f");
+ __classPrivateFieldSet(this, _Interface_events, new Map(), "f");
+ // this.#structs = new Map();
+ const frags = [];
+ for (const a of abi) {
+ try {
+ frags.push(fragments_js_1.Fragment.from(a));
+ }
+ catch (error) {
+ console.log("EE", error);
+ }
+ }
+ (0, index_js_3.defineProperties)(this, {
+ fragments: Object.freeze(frags)
+ });
+ let fallback = null;
+ let receive = false;
+ __classPrivateFieldSet(this, _Interface_abiCoder, this.getAbiCoder(), "f");
+ // Add all fragments by their signature
+ this.fragments.forEach((fragment, index) => {
+ let bucket;
+ switch (fragment.type) {
+ case "constructor":
+ if (this.deploy) {
+ console.log("duplicate definition - constructor");
+ return;
+ }
+ //checkNames(fragment, "input", fragment.inputs);
+ (0, index_js_3.defineProperties)(this, { deploy: fragment });
+ return;
+ case "fallback":
+ if (fragment.inputs.length === 0) {
+ receive = true;
+ }
+ else {
+ (0, index_js_3.assertArgument)(!fallback || fragment.payable !== fallback.payable, "conflicting fallback fragments", `fragments[${index}]`, fragment);
+ fallback = fragment;
+ receive = fallback.payable;
+ }
+ return;
+ case "function":
+ //checkNames(fragment, "input", fragment.inputs);
+ //checkNames(fragment, "output", (fragment).outputs);
+ bucket = __classPrivateFieldGet(this, _Interface_functions, "f");
+ break;
+ case "event":
+ //checkNames(fragment, "input", fragment.inputs);
+ bucket = __classPrivateFieldGet(this, _Interface_events, "f");
+ break;
+ case "error":
+ bucket = __classPrivateFieldGet(this, _Interface_errors, "f");
+ break;
+ default:
+ return;
+ }
+ // Two identical entries; ignore it
+ const signature = fragment.format();
+ if (bucket.has(signature)) {
+ return;
+ }
+ bucket.set(signature, fragment);
+ });
+ // If we do not have a constructor add a default
+ if (!this.deploy) {
+ (0, index_js_3.defineProperties)(this, {
+ deploy: fragments_js_1.ConstructorFragment.from("constructor()")
+ });
+ }
+ (0, index_js_3.defineProperties)(this, { fallback, receive });
+ }
+ /**
+ * Returns the entire Human-Readable ABI, as an array of
+ * signatures, optionally as %%minimal%% strings, which
+ * removes parameter names and unneceesary spaces.
+ */
+ format(minimal) {
+ const format = (minimal ? "minimal" : "full");
+ const abi = this.fragments.map((f) => f.format(format));
+ return abi;
+ }
+ /**
+ * Return the JSON-encoded ABI. This is the format Solidiy
+ * returns.
+ */
+ formatJson() {
+ const abi = this.fragments.map((f) => f.format("json"));
+ // We need to re-bundle the JSON fragments a bit
+ return JSON.stringify(abi.map((j) => JSON.parse(j)));
+ }
+ /**
+ * The ABI coder that will be used to encode and decode binary
+ * data.
+ */
+ getAbiCoder() {
+ return abi_coder_js_1.AbiCoder.defaultAbiCoder();
+ }
+ /**
+ * Get the function name for %%key%%, which may be a function selector,
+ * function name or function signature that belongs to the ABI.
+ */
+ getFunctionName(key) {
+ const fragment = __classPrivateFieldGet(this, _Interface_instances, "m", _Interface_getFunction).call(this, key, null, false);
+ (0, index_js_3.assertArgument)(fragment, "no matching function", "key", key);
+ return fragment.name;
+ }
+ /**
+ * Returns true if %%key%% (a function selector, function name or
+ * function signature) is present in the ABI.
+ *
+ * In the case of a function name, the name may be ambiguous, so
+ * accessing the [[FunctionFragment]] may require refinement.
+ */
+ hasFunction(key) {
+ return !!__classPrivateFieldGet(this, _Interface_instances, "m", _Interface_getFunction).call(this, key, null, false);
+ }
+ /**
+ * Get the [[FunctionFragment]] for %%key%%, which may be a function
+ * selector, function name or function signature that belongs to the ABI.
+ *
+ * If %%values%% is provided, it will use the Typed API to handle
+ * ambiguous cases where multiple functions match by name.
+ *
+ * If the %%key%% and %%values%% do not refine to a single function in
+ * the ABI, this will throw.
+ */
+ getFunction(key, values) {
+ return __classPrivateFieldGet(this, _Interface_instances, "m", _Interface_getFunction).call(this, key, values || null, true);
+ }
+ /**
+ * Iterate over all functions, calling %%callback%%, sorted by their name.
+ */
+ forEachFunction(callback) {
+ const names = Array.from(__classPrivateFieldGet(this, _Interface_functions, "f").keys());
+ names.sort((a, b) => a.localeCompare(b));
+ for (let i = 0; i < names.length; i++) {
+ const name = names[i];
+ callback((__classPrivateFieldGet(this, _Interface_functions, "f").get(name)), i);
+ }
+ }
+ /**
+ * Get the event name for %%key%%, which may be a topic hash,
+ * event name or event signature that belongs to the ABI.
+ */
+ getEventName(key) {
+ const fragment = __classPrivateFieldGet(this, _Interface_instances, "m", _Interface_getEvent).call(this, key, null, false);
+ (0, index_js_3.assertArgument)(fragment, "no matching event", "key", key);
+ return fragment.name;
+ }
+ /**
+ * Returns true if %%key%% (an event topic hash, event name or
+ * event signature) is present in the ABI.
+ *
+ * In the case of an event name, the name may be ambiguous, so
+ * accessing the [[EventFragment]] may require refinement.
+ */
+ hasEvent(key) {
+ return !!__classPrivateFieldGet(this, _Interface_instances, "m", _Interface_getEvent).call(this, key, null, false);
+ }
+ /**
+ * Get the [[EventFragment]] for %%key%%, which may be a topic hash,
+ * event name or event signature that belongs to the ABI.
+ *
+ * If %%values%% is provided, it will use the Typed API to handle
+ * ambiguous cases where multiple events match by name.
+ *
+ * If the %%key%% and %%values%% do not refine to a single event in
+ * the ABI, this will throw.
+ */
+ getEvent(key, values) {
+ return __classPrivateFieldGet(this, _Interface_instances, "m", _Interface_getEvent).call(this, key, values || null, true);
+ }
+ /**
+ * Iterate over all events, calling %%callback%%, sorted by their name.
+ */
+ forEachEvent(callback) {
+ const names = Array.from(__classPrivateFieldGet(this, _Interface_events, "f").keys());
+ names.sort((a, b) => a.localeCompare(b));
+ for (let i = 0; i < names.length; i++) {
+ const name = names[i];
+ callback((__classPrivateFieldGet(this, _Interface_events, "f").get(name)), i);
+ }
+ }
+ /**
+ * Get the [[ErrorFragment]] for %%key%%, which may be an error
+ * selector, error name or error signature that belongs to the ABI.
+ *
+ * If %%values%% is provided, it will use the Typed API to handle
+ * ambiguous cases where multiple errors match by name.
+ *
+ * If the %%key%% and %%values%% do not refine to a single error in
+ * the ABI, this will throw.
+ */
+ getError(key, values) {
+ if ((0, index_js_3.isHexString)(key)) {
+ const selector = key.toLowerCase();
+ if (BuiltinErrors[selector]) {
+ return fragments_js_1.ErrorFragment.from(BuiltinErrors[selector].signature);
+ }
+ for (const fragment of __classPrivateFieldGet(this, _Interface_errors, "f").values()) {
+ if (selector === fragment.selector) {
+ return fragment;
+ }
+ }
+ return null;
+ }
+ // It is a bare name, look up the function (will return null if ambiguous)
+ if (key.indexOf("(") === -1) {
+ const matching = [];
+ for (const [name, fragment] of __classPrivateFieldGet(this, _Interface_errors, "f")) {
+ if (name.split("(" /* fix:) */)[0] === key) {
+ matching.push(fragment);
+ }
+ }
+ if (matching.length === 0) {
+ if (key === "Error") {
+ return fragments_js_1.ErrorFragment.from("error Error(string)");
+ }
+ if (key === "Panic") {
+ return fragments_js_1.ErrorFragment.from("error Panic(uint256)");
+ }
+ return null;
+ }
+ else if (matching.length > 1) {
+ const matchStr = matching.map((m) => JSON.stringify(m.format())).join(", ");
+ (0, index_js_3.assertArgument)(false, `ambiguous error description (i.e. ${matchStr})`, "name", key);
+ }
+ return matching[0];
+ }
+ // Normalize the signature and lookup the function
+ key = fragments_js_1.ErrorFragment.from(key).format();
+ if (key === "Error(string)") {
+ return fragments_js_1.ErrorFragment.from("error Error(string)");
+ }
+ if (key === "Panic(uint256)") {
+ return fragments_js_1.ErrorFragment.from("error Panic(uint256)");
+ }
+ const result = __classPrivateFieldGet(this, _Interface_errors, "f").get(key);
+ if (result) {
+ return result;
+ }
+ return null;
+ }
+ /**
+ * Iterate over all errors, calling %%callback%%, sorted by their name.
+ */
+ forEachError(callback) {
+ const names = Array.from(__classPrivateFieldGet(this, _Interface_errors, "f").keys());
+ names.sort((a, b) => a.localeCompare(b));
+ for (let i = 0; i < names.length; i++) {
+ const name = names[i];
+ callback((__classPrivateFieldGet(this, _Interface_errors, "f").get(name)), i);
+ }
+ }
+ // Get the 4-byte selector used by Solidity to identify a function
+ /*
+getSelector(fragment: ErrorFragment | FunctionFragment): string {
+ if (typeof(fragment) === "string") {
+ const matches: Array = [ ];
+
+ try { matches.push(this.getFunction(fragment)); } catch (error) { }
+ try { matches.push(this.getError(fragment)); } catch (_) { }
+
+ if (matches.length === 0) {
+ logger.throwArgumentError("unknown fragment", "key", fragment);
+ } else if (matches.length > 1) {
+ logger.throwArgumentError("ambiguous fragment matches function and error", "key", fragment);
+ }
+
+ fragment = matches[0];
+ }
+
+ return dataSlice(id(fragment.format()), 0, 4);
+}
+ */
+ // Get the 32-byte topic hash used by Solidity to identify an event
+ /*
+ getEventTopic(fragment: EventFragment): string {
+ //if (typeof(fragment) === "string") { fragment = this.getEvent(eventFragment); }
+ return id(fragment.format());
+ }
+ */
+ _decodeParams(params, data) {
+ return __classPrivateFieldGet(this, _Interface_abiCoder, "f").decode(params, data);
+ }
+ _encodeParams(params, values) {
+ return __classPrivateFieldGet(this, _Interface_abiCoder, "f").encode(params, values);
+ }
+ /**
+ * Encodes a ``tx.data`` object for deploying the Contract with
+ * the %%values%% as the constructor arguments.
+ */
+ encodeDeploy(values) {
+ return this._encodeParams(this.deploy.inputs, values || []);
+ }
+ /**
+ * Decodes the result %%data%% (e.g. from an ``eth_call``) for the
+ * specified error (see [[getError]] for valid values for
+ * %%key%%).
+ *
+ * Most developers should prefer the [[parseCallResult]] method instead,
+ * which will automatically detect a ``CALL_EXCEPTION`` and throw the
+ * corresponding error.
+ */
+ decodeErrorResult(fragment, data) {
+ if (typeof (fragment) === "string") {
+ const f = this.getError(fragment);
+ (0, index_js_3.assertArgument)(f, "unknown error", "fragment", fragment);
+ fragment = f;
+ }
+ (0, index_js_3.assertArgument)((0, index_js_3.dataSlice)(data, 0, 4) === fragment.selector, `data signature does not match error ${fragment.name}.`, "data", data);
+ return this._decodeParams(fragment.inputs, (0, index_js_3.dataSlice)(data, 4));
+ }
+ /**
+ * Encodes the transaction revert data for a call result that
+ * reverted from the the Contract with the sepcified %%error%%
+ * (see [[getError]] for valid values for %%fragment%%) with the %%values%%.
+ *
+ * This is generally not used by most developers, unless trying to mock
+ * a result from a Contract.
+ */
+ encodeErrorResult(fragment, values) {
+ if (typeof (fragment) === "string") {
+ const f = this.getError(fragment);
+ (0, index_js_3.assertArgument)(f, "unknown error", "fragment", fragment);
+ fragment = f;
+ }
+ return (0, index_js_3.concat)([
+ fragment.selector,
+ this._encodeParams(fragment.inputs, values || [])
+ ]);
+ }
+ /**
+ * Decodes the %%data%% from a transaction ``tx.data`` for
+ * the function specified (see [[getFunction]] for valid values
+ * for %%fragment%%).
+ *
+ * Most developers should prefer the [[parseTransaction]] method
+ * instead, which will automatically detect the fragment.
+ */
+ decodeFunctionData(fragment, data) {
+ if (typeof (fragment) === "string") {
+ const f = this.getFunction(fragment);
+ (0, index_js_3.assertArgument)(f, "unknown function", "fragment", fragment);
+ fragment = f;
+ }
+ (0, index_js_3.assertArgument)((0, index_js_3.dataSlice)(data, 0, 4) === fragment.selector, `data signature does not match function ${fragment.name}.`, "data", data);
+ return this._decodeParams(fragment.inputs, (0, index_js_3.dataSlice)(data, 4));
+ }
+ /**
+ * Encodes the ``tx.data`` for a transaction that calls the function
+ * specified (see [[getFunction]] for valid values for %%fragment%%) with
+ * the %%values%%.
+ */
+ encodeFunctionData(fragment, values) {
+ if (typeof (fragment) === "string") {
+ const f = this.getFunction(fragment);
+ (0, index_js_3.assertArgument)(f, "unknown function", "fragment", fragment);
+ fragment = f;
+ }
+ return (0, index_js_3.concat)([
+ fragment.selector,
+ this._encodeParams(fragment.inputs, values || [])
+ ]);
+ }
+ /**
+ * Decodes the result %%data%% (e.g. from an ``eth_call``) for the
+ * specified function (see [[getFunction]] for valid values for
+ * %%key%%).
+ *
+ * Most developers should prefer the [[parseCallResult]] method instead,
+ * which will automatically detect a ``CALL_EXCEPTION`` and throw the
+ * corresponding error.
+ */
+ decodeFunctionResult(fragment, data) {
+ if (typeof (fragment) === "string") {
+ const f = this.getFunction(fragment);
+ (0, index_js_3.assertArgument)(f, "unknown function", "fragment", fragment);
+ fragment = f;
+ }
+ let message = "invalid length for result data";
+ const bytes = (0, index_js_3.getBytesCopy)(data);
+ if ((bytes.length % 32) === 0) {
+ try {
+ return __classPrivateFieldGet(this, _Interface_abiCoder, "f").decode(fragment.outputs, bytes);
+ }
+ catch (error) {
+ message = "could not decode result data";
+ }
+ }
+ // Call returned data with no error, but the data is junk
+ (0, index_js_3.assert)(false, message, "BAD_DATA", {
+ value: (0, index_js_3.hexlify)(bytes),
+ info: { method: fragment.name, signature: fragment.format() }
+ });
+ }
+ makeError(_data, tx) {
+ const data = (0, index_js_3.getBytes)(_data, "data");
+ const error = abi_coder_js_1.AbiCoder.getBuiltinCallException("call", tx, data);
+ // Not a built-in error; try finding a custom error
+ const customPrefix = "execution reverted (unknown custom error)";
+ if (error.message.startsWith(customPrefix)) {
+ const selector = (0, index_js_3.hexlify)(data.slice(0, 4));
+ const ef = this.getError(selector);
+ if (ef) {
+ try {
+ const args = __classPrivateFieldGet(this, _Interface_abiCoder, "f").decode(ef.inputs, data.slice(4));
+ error.revert = {
+ name: ef.name, signature: ef.format(), args
+ };
+ error.reason = error.revert.signature;
+ error.message = `execution reverted: ${error.reason}`;
+ }
+ catch (e) {
+ error.message = `execution reverted (coult not decode custom error)`;
+ }
+ }
+ }
+ // Add the invocation, if available
+ const parsed = this.parseTransaction(tx);
+ if (parsed) {
+ error.invocation = {
+ method: parsed.name,
+ signature: parsed.signature,
+ args: parsed.args
+ };
+ }
+ return error;
+ }
+ /**
+ * Encodes the result data (e.g. from an ``eth_call``) for the
+ * specified function (see [[getFunction]] for valid values
+ * for %%fragment%%) with %%values%%.
+ *
+ * This is generally not used by most developers, unless trying to mock
+ * a result from a Contract.
+ */
+ encodeFunctionResult(fragment, values) {
+ if (typeof (fragment) === "string") {
+ const f = this.getFunction(fragment);
+ (0, index_js_3.assertArgument)(f, "unknown function", "fragment", fragment);
+ fragment = f;
+ }
+ return (0, index_js_3.hexlify)(__classPrivateFieldGet(this, _Interface_abiCoder, "f").encode(fragment.outputs, values || []));
+ }
+ /*
+ spelunk(inputs: Array, values: ReadonlyArray, processfunc: (type: string, value: any) => Promise): Promise> {
+ const promises: Array> = [ ];
+ const process = function(type: ParamType, value: any): any {
+ if (type.baseType === "array") {
+ return descend(type.child
+ }
+ if (type. === "address") {
+ }
+ };
+
+ const descend = function (inputs: Array, values: ReadonlyArray) {
+ if (inputs.length !== values.length) { throw new Error("length mismatch"); }
+
+ };
+
+ const result: Array = [ ];
+ values.forEach((value, index) => {
+ if (value == null) {
+ topics.push(null);
+ } else if (param.baseType === "array" || param.baseType === "tuple") {
+ logger.throwArgumentError("filtering with tuples or arrays not supported", ("contract." + param.name), value);
+ } else if (Array.isArray(value)) {
+ topics.push(value.map((value) => encodeTopic(param, value)));
+ } else {
+ topics.push(encodeTopic(param, value));
+ }
+ });
+ }
+ */
+ // Create the filter for the event with search criteria (e.g. for eth_filterLog)
+ encodeFilterTopics(fragment, values) {
+ if (typeof (fragment) === "string") {
+ const f = this.getEvent(fragment);
+ (0, index_js_3.assertArgument)(f, "unknown event", "eventFragment", fragment);
+ fragment = f;
+ }
+ (0, index_js_3.assert)(values.length <= fragment.inputs.length, `too many arguments for ${fragment.format()}`, "UNEXPECTED_ARGUMENT", { count: values.length, expectedCount: fragment.inputs.length });
+ const topics = [];
+ if (!fragment.anonymous) {
+ topics.push(fragment.topicHash);
+ }
+ // @TODO: Use the coders for this; to properly support tuples, etc.
+ const encodeTopic = (param, value) => {
+ if (param.type === "string") {
+ return (0, index_js_2.id)(value);
+ }
+ else if (param.type === "bytes") {
+ return (0, index_js_1.keccak256)((0, index_js_3.hexlify)(value));
+ }
+ if (param.type === "bool" && typeof (value) === "boolean") {
+ value = (value ? "0x01" : "0x00");
+ }
+ else if (param.type.match(/^u?int/)) {
+ value = (0, index_js_3.toBeHex)(value); // @TODO: Should this toTwos??
+ }
+ else if (param.type.match(/^bytes/)) {
+ value = (0, index_js_3.zeroPadBytes)(value, 32);
+ }
+ else if (param.type === "address") {
+ // Check addresses are valid
+ __classPrivateFieldGet(this, _Interface_abiCoder, "f").encode(["address"], [value]);
+ }
+ return (0, index_js_3.zeroPadValue)((0, index_js_3.hexlify)(value), 32);
+ };
+ values.forEach((value, index) => {
+ const param = fragment.inputs[index];
+ if (!param.indexed) {
+ (0, index_js_3.assertArgument)(value == null, "cannot filter non-indexed parameters; must be null", ("contract." + param.name), value);
+ return;
+ }
+ if (value == null) {
+ topics.push(null);
+ }
+ else if (param.baseType === "array" || param.baseType === "tuple") {
+ (0, index_js_3.assertArgument)(false, "filtering with tuples or arrays not supported", ("contract." + param.name), value);
+ }
+ else if (Array.isArray(value)) {
+ topics.push(value.map((value) => encodeTopic(param, value)));
+ }
+ else {
+ topics.push(encodeTopic(param, value));
+ }
+ });
+ // Trim off trailing nulls
+ while (topics.length && topics[topics.length - 1] === null) {
+ topics.pop();
+ }
+ return topics;
+ }
+ encodeEventLog(fragment, values) {
+ if (typeof (fragment) === "string") {
+ const f = this.getEvent(fragment);
+ (0, index_js_3.assertArgument)(f, "unknown event", "eventFragment", fragment);
+ fragment = f;
+ }
+ const topics = [];
+ const dataTypes = [];
+ const dataValues = [];
+ if (!fragment.anonymous) {
+ topics.push(fragment.topicHash);
+ }
+ (0, index_js_3.assertArgument)(values.length === fragment.inputs.length, "event arguments/values mismatch", "values", values);
+ fragment.inputs.forEach((param, index) => {
+ const value = values[index];
+ if (param.indexed) {
+ if (param.type === "string") {
+ topics.push((0, index_js_2.id)(value));
+ }
+ else if (param.type === "bytes") {
+ topics.push((0, index_js_1.keccak256)(value));
+ }
+ else if (param.baseType === "tuple" || param.baseType === "array") {
+ // @TODO
+ throw new Error("not implemented");
+ }
+ else {
+ topics.push(__classPrivateFieldGet(this, _Interface_abiCoder, "f").encode([param.type], [value]));
+ }
+ }
+ else {
+ dataTypes.push(param);
+ dataValues.push(value);
+ }
+ });
+ return {
+ data: __classPrivateFieldGet(this, _Interface_abiCoder, "f").encode(dataTypes, dataValues),
+ topics: topics
+ };
+ }
+ // Decode a filter for the event and the search criteria
+ decodeEventLog(fragment, data, topics) {
+ if (typeof (fragment) === "string") {
+ const f = this.getEvent(fragment);
+ (0, index_js_3.assertArgument)(f, "unknown event", "eventFragment", fragment);
+ fragment = f;
+ }
+ if (topics != null && !fragment.anonymous) {
+ const eventTopic = fragment.topicHash;
+ (0, index_js_3.assertArgument)((0, index_js_3.isHexString)(topics[0], 32) && topics[0].toLowerCase() === eventTopic, "fragment/topic mismatch", "topics[0]", topics[0]);
+ topics = topics.slice(1);
+ }
+ const indexed = [];
+ const nonIndexed = [];
+ const dynamic = [];
+ fragment.inputs.forEach((param, index) => {
+ if (param.indexed) {
+ if (param.type === "string" || param.type === "bytes" || param.baseType === "tuple" || param.baseType === "array") {
+ indexed.push(fragments_js_1.ParamType.from({ type: "bytes32", name: param.name }));
+ dynamic.push(true);
+ }
+ else {
+ indexed.push(param);
+ dynamic.push(false);
+ }
+ }
+ else {
+ nonIndexed.push(param);
+ dynamic.push(false);
+ }
+ });
+ const resultIndexed = (topics != null) ? __classPrivateFieldGet(this, _Interface_abiCoder, "f").decode(indexed, (0, index_js_3.concat)(topics)) : null;
+ const resultNonIndexed = __classPrivateFieldGet(this, _Interface_abiCoder, "f").decode(nonIndexed, data, true);
+ //const result: (Array & { [ key: string ]: any }) = [ ];
+ const values = [];
+ const keys = [];
+ let nonIndexedIndex = 0, indexedIndex = 0;
+ fragment.inputs.forEach((param, index) => {
+ let value = null;
+ if (param.indexed) {
+ if (resultIndexed == null) {
+ value = new Indexed(null);
+ }
+ else if (dynamic[index]) {
+ value = new Indexed(resultIndexed[indexedIndex++]);
+ }
+ else {
+ try {
+ value = resultIndexed[indexedIndex++];
+ }
+ catch (error) {
+ value = error;
+ }
+ }
+ }
+ else {
+ try {
+ value = resultNonIndexed[nonIndexedIndex++];
+ }
+ catch (error) {
+ value = error;
+ }
+ }
+ values.push(value);
+ keys.push(param.name || null);
+ });
+ return abstract_coder_js_1.Result.fromItems(values, keys);
+ }
+ /**
+ * Parses a transaction, finding the matching function and extracts
+ * the parameter values along with other useful function details.
+ *
+ * If the matching function cannot be found, return null.
+ */
+ parseTransaction(tx) {
+ const data = (0, index_js_3.getBytes)(tx.data, "tx.data");
+ const value = (0, index_js_3.getBigInt)((tx.value != null) ? tx.value : 0, "tx.value");
+ const fragment = this.getFunction((0, index_js_3.hexlify)(data.slice(0, 4)));
+ if (!fragment) {
+ return null;
+ }
+ const args = __classPrivateFieldGet(this, _Interface_abiCoder, "f").decode(fragment.inputs, data.slice(4));
+ return new TransactionDescription(fragment, fragment.selector, args, value);
+ }
+ parseCallResult(data) {
+ throw new Error("@TODO");
+ }
+ /**
+ * Parses a receipt log, finding the matching event and extracts
+ * the parameter values along with other useful event details.
+ *
+ * If the matching event cannot be found, returns null.
+ */
+ parseLog(log) {
+ const fragment = this.getEvent(log.topics[0]);
+ if (!fragment || fragment.anonymous) {
+ return null;
+ }
+ // @TODO: If anonymous, and the only method, and the input count matches, should we parse?
+ // Probably not, because just because it is the only event in the ABI does
+ // not mean we have the full ABI; maybe just a fragment?
+ return new LogDescription(fragment, fragment.topicHash, this.decodeEventLog(fragment, log.data, log.topics));
+ }
+ /**
+ * Parses a revert data, finding the matching error and extracts
+ * the parameter values along with other useful error details.
+ *
+ * If the matching error cannot be found, returns null.
+ */
+ parseError(data) {
+ const hexData = (0, index_js_3.hexlify)(data);
+ const fragment = this.getError((0, index_js_3.dataSlice)(hexData, 0, 4));
+ if (!fragment) {
+ return null;
+ }
+ const args = __classPrivateFieldGet(this, _Interface_abiCoder, "f").decode(fragment.inputs, (0, index_js_3.dataSlice)(hexData, 4));
+ return new ErrorDescription(fragment, fragment.selector, args);
+ }
+ /**
+ * Creates a new [[Interface]] from the ABI %%value%%.
+ *
+ * The %%value%% may be provided as an existing [[Interface]] object,
+ * a JSON-encoded ABI or any Human-Readable ABI format.
+ */
+ static from(value) {
+ // Already an Interface, which is immutable
+ if (value instanceof Interface) {
+ return value;
+ }
+ // JSON
+ if (typeof (value) === "string") {
+ return new Interface(JSON.parse(value));
+ }
+ // Maybe an interface from an older version, or from a symlinked copy
+ if (typeof (value.format) === "function") {
+ return new Interface(value.format("json"));
+ }
+ // Array of fragments
+ return new Interface(value);
+ }
+}
+exports.Interface = Interface;
+_Interface_errors = new WeakMap(), _Interface_events = new WeakMap(), _Interface_functions = new WeakMap(), _Interface_abiCoder = new WeakMap(), _Interface_instances = new WeakSet(), _Interface_getFunction = function _Interface_getFunction(key, values, forceUnique) {
+ // Selector
+ if ((0, index_js_3.isHexString)(key)) {
+ const selector = key.toLowerCase();
+ for (const fragment of __classPrivateFieldGet(this, _Interface_functions, "f").values()) {
+ if (selector === fragment.selector) {
+ return fragment;
+ }
+ }
+ return null;
+ }
+ // It is a bare name, look up the function (will return null if ambiguous)
+ if (key.indexOf("(") === -1) {
+ const matching = [];
+ for (const [name, fragment] of __classPrivateFieldGet(this, _Interface_functions, "f")) {
+ if (name.split("(" /* fix:) */)[0] === key) {
+ matching.push(fragment);
+ }
+ }
+ if (values) {
+ const lastValue = (values.length > 0) ? values[values.length - 1] : null;
+ let valueLength = values.length;
+ let allowOptions = true;
+ if (typed_js_1.Typed.isTyped(lastValue) && lastValue.type === "overrides") {
+ allowOptions = false;
+ valueLength--;
+ }
+ // Remove all matches that don't have a compatible length. The args
+ // may contain an overrides, so the match may have n or n - 1 parameters
+ for (let i = matching.length - 1; i >= 0; i--) {
+ const inputs = matching[i].inputs.length;
+ if (inputs !== valueLength && (!allowOptions || inputs !== valueLength - 1)) {
+ matching.splice(i, 1);
+ }
+ }
+ // Remove all matches that don't match the Typed signature
+ for (let i = matching.length - 1; i >= 0; i--) {
+ const inputs = matching[i].inputs;
+ for (let j = 0; j < values.length; j++) {
+ // Not a typed value
+ if (!typed_js_1.Typed.isTyped(values[j])) {
+ continue;
+ }
+ // We are past the inputs
+ if (j >= inputs.length) {
+ if (values[j].type === "overrides") {
+ continue;
+ }
+ matching.splice(i, 1);
+ break;
+ }
+ // Make sure the value type matches the input type
+ if (values[j].type !== inputs[j].baseType) {
+ matching.splice(i, 1);
+ break;
+ }
+ }
+ }
+ }
+ // We found a single matching signature with an overrides, but the
+ // last value is something that cannot possibly be an options
+ if (matching.length === 1 && values && values.length !== matching[0].inputs.length) {
+ const lastArg = values[values.length - 1];
+ if (lastArg == null || Array.isArray(lastArg) || typeof (lastArg) !== "object") {
+ matching.splice(0, 1);
+ }
+ }
+ if (matching.length === 0) {
+ return null;
+ }
+ if (matching.length > 1 && forceUnique) {
+ const matchStr = matching.map((m) => JSON.stringify(m.format())).join(", ");
+ (0, index_js_3.assertArgument)(false, `ambiguous function description (i.e. matches ${matchStr})`, "key", key);
+ }
+ return matching[0];
+ }
+ // Normalize the signature and lookup the function
+ const result = __classPrivateFieldGet(this, _Interface_functions, "f").get(fragments_js_1.FunctionFragment.from(key).format());
+ if (result) {
+ return result;
+ }
+ return null;
+}, _Interface_getEvent = function _Interface_getEvent(key, values, forceUnique) {
+ // EventTopic
+ if ((0, index_js_3.isHexString)(key)) {
+ const eventTopic = key.toLowerCase();
+ for (const fragment of __classPrivateFieldGet(this, _Interface_events, "f").values()) {
+ if (eventTopic === fragment.topicHash) {
+ return fragment;
+ }
+ }
+ return null;
+ }
+ // It is a bare name, look up the function (will return null if ambiguous)
+ if (key.indexOf("(") === -1) {
+ const matching = [];
+ for (const [name, fragment] of __classPrivateFieldGet(this, _Interface_events, "f")) {
+ if (name.split("(" /* fix:) */)[0] === key) {
+ matching.push(fragment);
+ }
+ }
+ if (values) {
+ // Remove all matches that don't have a compatible length.
+ for (let i = matching.length - 1; i >= 0; i--) {
+ if (matching[i].inputs.length < values.length) {
+ matching.splice(i, 1);
+ }
+ }
+ // Remove all matches that don't match the Typed signature
+ for (let i = matching.length - 1; i >= 0; i--) {
+ const inputs = matching[i].inputs;
+ for (let j = 0; j < values.length; j++) {
+ // Not a typed value
+ if (!typed_js_1.Typed.isTyped(values[j])) {
+ continue;
+ }
+ // Make sure the value type matches the input type
+ if (values[j].type !== inputs[j].baseType) {
+ matching.splice(i, 1);
+ break;
+ }
+ }
+ }
+ }
+ if (matching.length === 0) {
+ return null;
+ }
+ if (matching.length > 1 && forceUnique) {
+ const matchStr = matching.map((m) => JSON.stringify(m.format())).join(", ");
+ (0, index_js_3.assertArgument)(false, `ambiguous event description (i.e. matches ${matchStr})`, "key", key);
+ }
+ return matching[0];
+ }
+ // Normalize the signature and lookup the function
+ const result = __classPrivateFieldGet(this, _Interface_events, "f").get(fragments_js_1.EventFragment.from(key).format());
+ if (result) {
+ return result;
+ }
+ return null;
+};
+//# sourceMappingURL=interface.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/interface.js.map b/dist/ethers.js/src.ts/abi/interface.js.map
new file mode 100644
index 0000000..840d11e
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/interface.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/abi/interface.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;AAEH,i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d.ts
new file mode 100644
index 0000000..8707a62
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/typed.d.ts
@@ -0,0 +1,570 @@
+/**
+ * A Typed object allows a value to have its type explicitly
+ * specified.
+ *
+ * For example, in Solidity, the value ``45`` could represent a
+ * ``uint8`` or a ``uint256``. The value ``0x1234`` could represent
+ * a ``bytes2`` or ``bytes``.
+ *
+ * Since JavaScript has no meaningful way to explicitly inform any
+ * APIs which what the type is, this allows transparent interoperation
+ * with Soldity.
+ *
+ * @_subsection: api/abi:Typed Values
+ */
+import type { Addressable } from "../address/index.js";
+import type { BigNumberish, BytesLike } from "../utils/index.js";
+import type { Result } from "./coders/abstract-coder.js";
+/**
+ * @_ignore:
+ */
+export interface TypedNumber extends Typed {
+ value: number;
+ defaultValue(): number;
+ minValue(): number;
+ maxValue(): number;
+}
+/**
+ * A **Typed** that represents a numeric value.
+ */
+export interface TypedBigInt extends Typed {
+ /**
+ * The value.
+ */
+ value: bigint;
+ /**
+ * The default value for all numeric types is ``0``.
+ */
+ defaultValue(): bigint;
+ /**
+ * The minimum value for this type, accounting for bit-width and signed-ness.
+ */
+ minValue(): bigint;
+ /**
+ * The minimum value for this type, accounting for bit-width.
+ */
+ maxValue(): bigint;
+}
+/**
+ * A **Typed** that represents a binary sequence of data as bytes.
+ */
+export interface TypedData extends Typed {
+ /**
+ * The value.
+ */
+ value: string;
+ /**
+ * The default value for this type.
+ */
+ defaultValue(): string;
+}
+/**
+ * A **Typed** that represents a UTF-8 sequence of bytes.
+ */
+export interface TypedString extends Typed {
+ /**
+ * The value.
+ */
+ value: string;
+ /**
+ * The default value for the string type is the empty string (i.e. ``""``).
+ */
+ defaultValue(): string;
+}
+/**
+ * The **Typed** class to wrap values providing explicit type information.
+ */
+export declare class Typed {
+ #private;
+ /**
+ * The type, as a Solidity-compatible type.
+ */
+ readonly type: string;
+ /**
+ * The actual value.
+ */
+ readonly value: any;
+ /**
+ * @_ignore:
+ */
+ readonly _typedSymbol: Symbol;
+ /**
+ * @_ignore:
+ */
+ constructor(gaurd: any, type: string, value: any, options?: any);
+ /**
+ * Format the type as a Human-Readable type.
+ */
+ format(): string;
+ /**
+ * The default value returned by this type.
+ */
+ defaultValue(): string | number | bigint | Result;
+ /**
+ * The minimum value for numeric types.
+ */
+ minValue(): string | number | bigint;
+ /**
+ * The maximum value for numeric types.
+ */
+ maxValue(): string | number | bigint;
+ /**
+ * Returns ``true`` and provides a type guard is this is a [[TypedBigInt]].
+ */
+ isBigInt(): this is TypedBigInt;
+ /**
+ * Returns ``true`` and provides a type guard is this is a [[TypedData]].
+ */
+ isData(): this is TypedData;
+ /**
+ * Returns ``true`` and provides a type guard is this is a [[TypedString]].
+ */
+ isString(): this is TypedString;
+ /**
+ * Returns the tuple name, if this is a tuple. Throws otherwise.
+ */
+ get tupleName(): null | string;
+ /**
+ * Returns the length of the array type or ``-1`` if it is dynamic.
+ *
+ * Throws if the type is not an array.
+ */
+ get arrayLength(): null | number;
+ /**
+ * Returns a new **Typed** of %%type%% with the %%value%%.
+ */
+ static from(type: string, value: any): Typed;
+ /**
+ * Return a new ``uint8`` type for %%v%%.
+ */
+ static uint8(v: BigNumberish): Typed;
+ /**
+ * Return a new ``uint16`` type for %%v%%.
+ */
+ static uint16(v: BigNumberish): Typed;
+ /**
+ * Return a new ``uint24`` type for %%v%%.
+ */
+ static uint24(v: BigNumberish): Typed;
+ /**
+ * Return a new ``uint32`` type for %%v%%.
+ */
+ static uint32(v: BigNumberish): Typed;
+ /**
+ * Return a new ``uint40`` type for %%v%%.
+ */
+ static uint40(v: BigNumberish): Typed;
+ /**
+ * Return a new ``uint48`` type for %%v%%.
+ */
+ static uint48(v: BigNumberish): Typed;
+ /**
+ * Return a new ``uint56`` type for %%v%%.
+ */
+ static uint56(v: BigNumberish): Typed;
+ /**
+ * Return a new ``uint64`` type for %%v%%.
+ */
+ static uint64(v: BigNumberish): Typed;
+ /**
+ * Return a new ``uint72`` type for %%v%%.
+ */
+ static uint72(v: BigNumberish): Typed;
+ /**
+ * Return a new ``uint80`` type for %%v%%.
+ */
+ static uint80(v: BigNumberish): Typed;
+ /**
+ * Return a new ``uint88`` type for %%v%%.
+ */
+ static uint88(v: BigNumberish): Typed;
+ /**
+ * Return a new ``uint96`` type for %%v%%.
+ */
+ static uint96(v: BigNumberish): Typed;
+ /**
+ * Return a new ``uint104`` type for %%v%%.
+ */
+ static uint104(v: BigNumberish): Typed;
+ /**
+ * Return a new ``uint112`` type for %%v%%.
+ */
+ static uint112(v: BigNumberish): Typed;
+ /**
+ * Return a new ``uint120`` type for %%v%%.
+ */
+ static uint120(v: BigNumberish): Typed;
+ /**
+ * Return a new ``uint128`` type for %%v%%.
+ */
+ static uint128(v: BigNumberish): Typed;
+ /**
+ * Return a new ``uint136`` type for %%v%%.
+ */
+ static uint136(v: BigNumberish): Typed;
+ /**
+ * Return a new ``uint144`` type for %%v%%.
+ */
+ static uint144(v: BigNumberish): Typed;
+ /**
+ * Return a new ``uint152`` type for %%v%%.
+ */
+ static uint152(v: BigNumberish): Typed;
+ /**
+ * Return a new ``uint160`` type for %%v%%.
+ */
+ static uint160(v: BigNumberish): Typed;
+ /**
+ * Return a new ``uint168`` type for %%v%%.
+ */
+ static uint168(v: BigNumberish): Typed;
+ /**
+ * Return a new ``uint176`` type for %%v%%.
+ */
+ static uint176(v: BigNumberish): Typed;
+ /**
+ * Return a new ``uint184`` type for %%v%%.
+ */
+ static uint184(v: BigNumberish): Typed;
+ /**
+ * Return a new ``uint192`` type for %%v%%.
+ */
+ static uint192(v: BigNumberish): Typed;
+ /**
+ * Return a new ``uint200`` type for %%v%%.
+ */
+ static uint200(v: BigNumberish): Typed;
+ /**
+ * Return a new ``uint208`` type for %%v%%.
+ */
+ static uint208(v: BigNumberish): Typed;
+ /**
+ * Return a new ``uint216`` type for %%v%%.
+ */
+ static uint216(v: BigNumberish): Typed;
+ /**
+ * Return a new ``uint224`` type for %%v%%.
+ */
+ static uint224(v: BigNumberish): Typed;
+ /**
+ * Return a new ``uint232`` type for %%v%%.
+ */
+ static uint232(v: BigNumberish): Typed;
+ /**
+ * Return a new ``uint240`` type for %%v%%.
+ */
+ static uint240(v: BigNumberish): Typed;
+ /**
+ * Return a new ``uint248`` type for %%v%%.
+ */
+ static uint248(v: BigNumberish): Typed;
+ /**
+ * Return a new ``uint256`` type for %%v%%.
+ */
+ static uint256(v: BigNumberish): Typed;
+ /**
+ * Return a new ``uint256`` type for %%v%%.
+ */
+ static uint(v: BigNumberish): Typed;
+ /**
+ * Return a new ``int8`` type for %%v%%.
+ */
+ static int8(v: BigNumberish): Typed;
+ /**
+ * Return a new ``int16`` type for %%v%%.
+ */
+ static int16(v: BigNumberish): Typed;
+ /**
+ * Return a new ``int24`` type for %%v%%.
+ */
+ static int24(v: BigNumberish): Typed;
+ /**
+ * Return a new ``int32`` type for %%v%%.
+ */
+ static int32(v: BigNumberish): Typed;
+ /**
+ * Return a new ``int40`` type for %%v%%.
+ */
+ static int40(v: BigNumberish): Typed;
+ /**
+ * Return a new ``int48`` type for %%v%%.
+ */
+ static int48(v: BigNumberish): Typed;
+ /**
+ * Return a new ``int56`` type for %%v%%.
+ */
+ static int56(v: BigNumberish): Typed;
+ /**
+ * Return a new ``int64`` type for %%v%%.
+ */
+ static int64(v: BigNumberish): Typed;
+ /**
+ * Return a new ``int72`` type for %%v%%.
+ */
+ static int72(v: BigNumberish): Typed;
+ /**
+ * Return a new ``int80`` type for %%v%%.
+ */
+ static int80(v: BigNumberish): Typed;
+ /**
+ * Return a new ``int88`` type for %%v%%.
+ */
+ static int88(v: BigNumberish): Typed;
+ /**
+ * Return a new ``int96`` type for %%v%%.
+ */
+ static int96(v: BigNumberish): Typed;
+ /**
+ * Return a new ``int104`` type for %%v%%.
+ */
+ static int104(v: BigNumberish): Typed;
+ /**
+ * Return a new ``int112`` type for %%v%%.
+ */
+ static int112(v: BigNumberish): Typed;
+ /**
+ * Return a new ``int120`` type for %%v%%.
+ */
+ static int120(v: BigNumberish): Typed;
+ /**
+ * Return a new ``int128`` type for %%v%%.
+ */
+ static int128(v: BigNumberish): Typed;
+ /**
+ * Return a new ``int136`` type for %%v%%.
+ */
+ static int136(v: BigNumberish): Typed;
+ /**
+ * Return a new ``int144`` type for %%v%%.
+ */
+ static int144(v: BigNumberish): Typed;
+ /**
+ * Return a new ``int52`` type for %%v%%.
+ */
+ static int152(v: BigNumberish): Typed;
+ /**
+ * Return a new ``int160`` type for %%v%%.
+ */
+ static int160(v: BigNumberish): Typed;
+ /**
+ * Return a new ``int168`` type for %%v%%.
+ */
+ static int168(v: BigNumberish): Typed;
+ /**
+ * Return a new ``int176`` type for %%v%%.
+ */
+ static int176(v: BigNumberish): Typed;
+ /**
+ * Return a new ``int184`` type for %%v%%.
+ */
+ static int184(v: BigNumberish): Typed;
+ /**
+ * Return a new ``int92`` type for %%v%%.
+ */
+ static int192(v: BigNumberish): Typed;
+ /**
+ * Return a new ``int200`` type for %%v%%.
+ */
+ static int200(v: BigNumberish): Typed;
+ /**
+ * Return a new ``int208`` type for %%v%%.
+ */
+ static int208(v: BigNumberish): Typed;
+ /**
+ * Return a new ``int216`` type for %%v%%.
+ */
+ static int216(v: BigNumberish): Typed;
+ /**
+ * Return a new ``int224`` type for %%v%%.
+ */
+ static int224(v: BigNumberish): Typed;
+ /**
+ * Return a new ``int232`` type for %%v%%.
+ */
+ static int232(v: BigNumberish): Typed;
+ /**
+ * Return a new ``int240`` type for %%v%%.
+ */
+ static int240(v: BigNumberish): Typed;
+ /**
+ * Return a new ``int248`` type for %%v%%.
+ */
+ static int248(v: BigNumberish): Typed;
+ /**
+ * Return a new ``int256`` type for %%v%%.
+ */
+ static int256(v: BigNumberish): Typed;
+ /**
+ * Return a new ``int256`` type for %%v%%.
+ */
+ static int(v: BigNumberish): Typed;
+ /**
+ * Return a new ``bytes1`` type for %%v%%.
+ */
+ static bytes1(v: BytesLike): Typed;
+ /**
+ * Return a new ``bytes2`` type for %%v%%.
+ */
+ static bytes2(v: BytesLike): Typed;
+ /**
+ * Return a new ``bytes3`` type for %%v%%.
+ */
+ static bytes3(v: BytesLike): Typed;
+ /**
+ * Return a new ``bytes4`` type for %%v%%.
+ */
+ static bytes4(v: BytesLike): Typed;
+ /**
+ * Return a new ``bytes5`` type for %%v%%.
+ */
+ static bytes5(v: BytesLike): Typed;
+ /**
+ * Return a new ``bytes6`` type for %%v%%.
+ */
+ static bytes6(v: BytesLike): Typed;
+ /**
+ * Return a new ``bytes7`` type for %%v%%.
+ */
+ static bytes7(v: BytesLike): Typed;
+ /**
+ * Return a new ``bytes8`` type for %%v%%.
+ */
+ static bytes8(v: BytesLike): Typed;
+ /**
+ * Return a new ``bytes9`` type for %%v%%.
+ */
+ static bytes9(v: BytesLike): Typed;
+ /**
+ * Return a new ``bytes10`` type for %%v%%.
+ */
+ static bytes10(v: BytesLike): Typed;
+ /**
+ * Return a new ``bytes11`` type for %%v%%.
+ */
+ static bytes11(v: BytesLike): Typed;
+ /**
+ * Return a new ``bytes12`` type for %%v%%.
+ */
+ static bytes12(v: BytesLike): Typed;
+ /**
+ * Return a new ``bytes13`` type for %%v%%.
+ */
+ static bytes13(v: BytesLike): Typed;
+ /**
+ * Return a new ``bytes14`` type for %%v%%.
+ */
+ static bytes14(v: BytesLike): Typed;
+ /**
+ * Return a new ``bytes15`` type for %%v%%.
+ */
+ static bytes15(v: BytesLike): Typed;
+ /**
+ * Return a new ``bytes16`` type for %%v%%.
+ */
+ static bytes16(v: BytesLike): Typed;
+ /**
+ * Return a new ``bytes17`` type for %%v%%.
+ */
+ static bytes17(v: BytesLike): Typed;
+ /**
+ * Return a new ``bytes18`` type for %%v%%.
+ */
+ static bytes18(v: BytesLike): Typed;
+ /**
+ * Return a new ``bytes19`` type for %%v%%.
+ */
+ static bytes19(v: BytesLike): Typed;
+ /**
+ * Return a new ``bytes20`` type for %%v%%.
+ */
+ static bytes20(v: BytesLike): Typed;
+ /**
+ * Return a new ``bytes21`` type for %%v%%.
+ */
+ static bytes21(v: BytesLike): Typed;
+ /**
+ * Return a new ``bytes22`` type for %%v%%.
+ */
+ static bytes22(v: BytesLike): Typed;
+ /**
+ * Return a new ``bytes23`` type for %%v%%.
+ */
+ static bytes23(v: BytesLike): Typed;
+ /**
+ * Return a new ``bytes24`` type for %%v%%.
+ */
+ static bytes24(v: BytesLike): Typed;
+ /**
+ * Return a new ``bytes25`` type for %%v%%.
+ */
+ static bytes25(v: BytesLike): Typed;
+ /**
+ * Return a new ``bytes26`` type for %%v%%.
+ */
+ static bytes26(v: BytesLike): Typed;
+ /**
+ * Return a new ``bytes27`` type for %%v%%.
+ */
+ static bytes27(v: BytesLike): Typed;
+ /**
+ * Return a new ``bytes28`` type for %%v%%.
+ */
+ static bytes28(v: BytesLike): Typed;
+ /**
+ * Return a new ``bytes29`` type for %%v%%.
+ */
+ static bytes29(v: BytesLike): Typed;
+ /**
+ * Return a new ``bytes30`` type for %%v%%.
+ */
+ static bytes30(v: BytesLike): Typed;
+ /**
+ * Return a new ``bytes31`` type for %%v%%.
+ */
+ static bytes31(v: BytesLike): Typed;
+ /**
+ * Return a new ``bytes32`` type for %%v%%.
+ */
+ static bytes32(v: BytesLike): Typed;
+ /**
+ * Return a new ``address`` type for %%v%%.
+ */
+ static address(v: string | Addressable): Typed;
+ /**
+ * Return a new ``bool`` type for %%v%%.
+ */
+ static bool(v: any): Typed;
+ /**
+ * Return a new ``bytes`` type for %%v%%.
+ */
+ static bytes(v: BytesLike): Typed;
+ /**
+ * Return a new ``string`` type for %%v%%.
+ */
+ static string(v: string): Typed;
+ /**
+ * Return a new ``array`` type for %%v%%, allowing %%dynamic%% length.
+ */
+ static array(v: Array, dynamic?: null | boolean): Typed;
+ /**
+ * Return a new ``tuple`` type for %%v%%, with the optional %%name%%.
+ */
+ static tuple(v: Array | Record, name?: string): Typed;
+ /**
+ * Return a new ``uint8`` type for %%v%%.
+ */
+ static overrides(v: Record): Typed;
+ /**
+ * Returns true only if %%value%% is a [[Typed]] instance.
+ */
+ static isTyped(value: any): value is Typed;
+ /**
+ * If the value is a [[Typed]] instance, validates the underlying value
+ * and returns it, otherwise returns value directly.
+ *
+ * This is useful for functions that with to accept either a [[Typed]]
+ * object or values.
+ */
+ static dereference(value: Typed | T, type: string): T;
+}
+//# sourceMappingURL=typed.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/typed.d.ts.map b/dist/ethers.js/src.ts/abi/typed.d.ts.map
new file mode 100644
index 0000000..cf2310d
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/typed.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"typed.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/abi/typed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEjE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAqBzD;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,KAAK;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,IAAI,MAAM,CAAC;IACvB,QAAQ,IAAI,MAAM,CAAC;IACnB,QAAQ,IAAI,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,KAAK;IACtC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,YAAY,IAAI,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,IAAI,MAAM,CAAC;IAEnB;;OAEG;IACH,QAAQ,IAAI,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,SAAU,SAAQ,KAAK;IACpC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,YAAY,IAAI,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,KAAK;IACtC;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AAM,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,GAAG,KAAK,CAAC,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK;IAMvF;;OAEG;IACH,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,KAAK;IAI/C;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,KAAK;IAO1C;;;;;;OAMG;IACH,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC;CAS3D"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/typed.js b/dist/ethers.js/src.ts/abi/typed.js
new file mode 100644
index 0000000..89b90fc
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/typed.js
@@ -0,0 +1,607 @@
+"use strict";
+/**
+ * A Typed object allows a value to have its type explicitly
+ * specified.
+ *
+ * For example, in Solidity, the value ``45`` could represent a
+ * ``uint8`` or a ``uint256``. The value ``0x1234`` could represent
+ * a ``bytes2`` or ``bytes``.
+ *
+ * Since JavaScript has no meaningful way to explicitly inform any
+ * APIs which what the type is, this allows transparent interoperation
+ * with Soldity.
+ *
+ * @_subsection: api/abi:Typed Values
+ */
+var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
+ if (kind === "m") throw new TypeError("Private method is not writable");
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
+};
+var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
+};
+var _Typed_options;
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.Typed = void 0;
+const index_js_1 = require("../utils/index.js");
+const _gaurd = {};
+function n(value, width) {
+ let signed = false;
+ if (width < 0) {
+ signed = true;
+ width *= -1;
+ }
+ // @TODO: Check range is valid for value
+ return new Typed(_gaurd, `${signed ? "" : "u"}int${width}`, value, { signed, width });
+}
+function b(value, size) {
+ // @TODO: Check range is valid for value
+ return new Typed(_gaurd, `bytes${(size) ? size : ""}`, value, { size });
+}
+const _typedSymbol = Symbol.for("_ethers_typed");
+/**
+ * The **Typed** class to wrap values providing explicit type information.
+ */
+class Typed {
+ /**
+ * @_ignore:
+ */
+ constructor(gaurd, type, value, options) {
+ _Typed_options.set(this, void 0);
+ if (options == null) {
+ options = null;
+ }
+ (0, index_js_1.assertPrivate)(_gaurd, gaurd, "Typed");
+ (0, index_js_1.defineProperties)(this, { _typedSymbol, type, value });
+ __classPrivateFieldSet(this, _Typed_options, options, "f");
+ // Check the value is valid
+ this.format();
+ }
+ /**
+ * Format the type as a Human-Readable type.
+ */
+ format() {
+ if (this.type === "array") {
+ throw new Error("");
+ }
+ else if (this.type === "dynamicArray") {
+ throw new Error("");
+ }
+ else if (this.type === "tuple") {
+ return `tuple(${this.value.map((v) => v.format()).join(",")})`;
+ }
+ return this.type;
+ }
+ /**
+ * The default value returned by this type.
+ */
+ defaultValue() {
+ return 0;
+ }
+ /**
+ * The minimum value for numeric types.
+ */
+ minValue() {
+ return 0;
+ }
+ /**
+ * The maximum value for numeric types.
+ */
+ maxValue() {
+ return 0;
+ }
+ /**
+ * Returns ``true`` and provides a type guard is this is a [[TypedBigInt]].
+ */
+ isBigInt() {
+ return !!(this.type.match(/^u?int[0-9]+$/));
+ }
+ /**
+ * Returns ``true`` and provides a type guard is this is a [[TypedData]].
+ */
+ isData() {
+ return this.type.startsWith("bytes");
+ }
+ /**
+ * Returns ``true`` and provides a type guard is this is a [[TypedString]].
+ */
+ isString() {
+ return (this.type === "string");
+ }
+ /**
+ * Returns the tuple name, if this is a tuple. Throws otherwise.
+ */
+ get tupleName() {
+ if (this.type !== "tuple") {
+ throw TypeError("not a tuple");
+ }
+ return __classPrivateFieldGet(this, _Typed_options, "f");
+ }
+ // Returns the length of this type as an array
+ // - `null` indicates the length is unforced, it could be dynamic
+ // - `-1` indicates the length is dynamic
+ // - any other value indicates it is a static array and is its length
+ /**
+ * Returns the length of the array type or ``-1`` if it is dynamic.
+ *
+ * Throws if the type is not an array.
+ */
+ get arrayLength() {
+ if (this.type !== "array") {
+ throw TypeError("not an array");
+ }
+ if (__classPrivateFieldGet(this, _Typed_options, "f") === true) {
+ return -1;
+ }
+ if (__classPrivateFieldGet(this, _Typed_options, "f") === false) {
+ return (this.value).length;
+ }
+ return null;
+ }
+ /**
+ * Returns a new **Typed** of %%type%% with the %%value%%.
+ */
+ static from(type, value) {
+ return new Typed(_gaurd, type, value);
+ }
+ /**
+ * Return a new ``uint8`` type for %%v%%.
+ */
+ static uint8(v) { return n(v, 8); }
+ /**
+ * Return a new ``uint16`` type for %%v%%.
+ */
+ static uint16(v) { return n(v, 16); }
+ /**
+ * Return a new ``uint24`` type for %%v%%.
+ */
+ static uint24(v) { return n(v, 24); }
+ /**
+ * Return a new ``uint32`` type for %%v%%.
+ */
+ static uint32(v) { return n(v, 32); }
+ /**
+ * Return a new ``uint40`` type for %%v%%.
+ */
+ static uint40(v) { return n(v, 40); }
+ /**
+ * Return a new ``uint48`` type for %%v%%.
+ */
+ static uint48(v) { return n(v, 48); }
+ /**
+ * Return a new ``uint56`` type for %%v%%.
+ */
+ static uint56(v) { return n(v, 56); }
+ /**
+ * Return a new ``uint64`` type for %%v%%.
+ */
+ static uint64(v) { return n(v, 64); }
+ /**
+ * Return a new ``uint72`` type for %%v%%.
+ */
+ static uint72(v) { return n(v, 72); }
+ /**
+ * Return a new ``uint80`` type for %%v%%.
+ */
+ static uint80(v) { return n(v, 80); }
+ /**
+ * Return a new ``uint88`` type for %%v%%.
+ */
+ static uint88(v) { return n(v, 88); }
+ /**
+ * Return a new ``uint96`` type for %%v%%.
+ */
+ static uint96(v) { return n(v, 96); }
+ /**
+ * Return a new ``uint104`` type for %%v%%.
+ */
+ static uint104(v) { return n(v, 104); }
+ /**
+ * Return a new ``uint112`` type for %%v%%.
+ */
+ static uint112(v) { return n(v, 112); }
+ /**
+ * Return a new ``uint120`` type for %%v%%.
+ */
+ static uint120(v) { return n(v, 120); }
+ /**
+ * Return a new ``uint128`` type for %%v%%.
+ */
+ static uint128(v) { return n(v, 128); }
+ /**
+ * Return a new ``uint136`` type for %%v%%.
+ */
+ static uint136(v) { return n(v, 136); }
+ /**
+ * Return a new ``uint144`` type for %%v%%.
+ */
+ static uint144(v) { return n(v, 144); }
+ /**
+ * Return a new ``uint152`` type for %%v%%.
+ */
+ static uint152(v) { return n(v, 152); }
+ /**
+ * Return a new ``uint160`` type for %%v%%.
+ */
+ static uint160(v) { return n(v, 160); }
+ /**
+ * Return a new ``uint168`` type for %%v%%.
+ */
+ static uint168(v) { return n(v, 168); }
+ /**
+ * Return a new ``uint176`` type for %%v%%.
+ */
+ static uint176(v) { return n(v, 176); }
+ /**
+ * Return a new ``uint184`` type for %%v%%.
+ */
+ static uint184(v) { return n(v, 184); }
+ /**
+ * Return a new ``uint192`` type for %%v%%.
+ */
+ static uint192(v) { return n(v, 192); }
+ /**
+ * Return a new ``uint200`` type for %%v%%.
+ */
+ static uint200(v) { return n(v, 200); }
+ /**
+ * Return a new ``uint208`` type for %%v%%.
+ */
+ static uint208(v) { return n(v, 208); }
+ /**
+ * Return a new ``uint216`` type for %%v%%.
+ */
+ static uint216(v) { return n(v, 216); }
+ /**
+ * Return a new ``uint224`` type for %%v%%.
+ */
+ static uint224(v) { return n(v, 224); }
+ /**
+ * Return a new ``uint232`` type for %%v%%.
+ */
+ static uint232(v) { return n(v, 232); }
+ /**
+ * Return a new ``uint240`` type for %%v%%.
+ */
+ static uint240(v) { return n(v, 240); }
+ /**
+ * Return a new ``uint248`` type for %%v%%.
+ */
+ static uint248(v) { return n(v, 248); }
+ /**
+ * Return a new ``uint256`` type for %%v%%.
+ */
+ static uint256(v) { return n(v, 256); }
+ /**
+ * Return a new ``uint256`` type for %%v%%.
+ */
+ static uint(v) { return n(v, 256); }
+ /**
+ * Return a new ``int8`` type for %%v%%.
+ */
+ static int8(v) { return n(v, -8); }
+ /**
+ * Return a new ``int16`` type for %%v%%.
+ */
+ static int16(v) { return n(v, -16); }
+ /**
+ * Return a new ``int24`` type for %%v%%.
+ */
+ static int24(v) { return n(v, -24); }
+ /**
+ * Return a new ``int32`` type for %%v%%.
+ */
+ static int32(v) { return n(v, -32); }
+ /**
+ * Return a new ``int40`` type for %%v%%.
+ */
+ static int40(v) { return n(v, -40); }
+ /**
+ * Return a new ``int48`` type for %%v%%.
+ */
+ static int48(v) { return n(v, -48); }
+ /**
+ * Return a new ``int56`` type for %%v%%.
+ */
+ static int56(v) { return n(v, -56); }
+ /**
+ * Return a new ``int64`` type for %%v%%.
+ */
+ static int64(v) { return n(v, -64); }
+ /**
+ * Return a new ``int72`` type for %%v%%.
+ */
+ static int72(v) { return n(v, -72); }
+ /**
+ * Return a new ``int80`` type for %%v%%.
+ */
+ static int80(v) { return n(v, -80); }
+ /**
+ * Return a new ``int88`` type for %%v%%.
+ */
+ static int88(v) { return n(v, -88); }
+ /**
+ * Return a new ``int96`` type for %%v%%.
+ */
+ static int96(v) { return n(v, -96); }
+ /**
+ * Return a new ``int104`` type for %%v%%.
+ */
+ static int104(v) { return n(v, -104); }
+ /**
+ * Return a new ``int112`` type for %%v%%.
+ */
+ static int112(v) { return n(v, -112); }
+ /**
+ * Return a new ``int120`` type for %%v%%.
+ */
+ static int120(v) { return n(v, -120); }
+ /**
+ * Return a new ``int128`` type for %%v%%.
+ */
+ static int128(v) { return n(v, -128); }
+ /**
+ * Return a new ``int136`` type for %%v%%.
+ */
+ static int136(v) { return n(v, -136); }
+ /**
+ * Return a new ``int144`` type for %%v%%.
+ */
+ static int144(v) { return n(v, -144); }
+ /**
+ * Return a new ``int52`` type for %%v%%.
+ */
+ static int152(v) { return n(v, -152); }
+ /**
+ * Return a new ``int160`` type for %%v%%.
+ */
+ static int160(v) { return n(v, -160); }
+ /**
+ * Return a new ``int168`` type for %%v%%.
+ */
+ static int168(v) { return n(v, -168); }
+ /**
+ * Return a new ``int176`` type for %%v%%.
+ */
+ static int176(v) { return n(v, -176); }
+ /**
+ * Return a new ``int184`` type for %%v%%.
+ */
+ static int184(v) { return n(v, -184); }
+ /**
+ * Return a new ``int92`` type for %%v%%.
+ */
+ static int192(v) { return n(v, -192); }
+ /**
+ * Return a new ``int200`` type for %%v%%.
+ */
+ static int200(v) { return n(v, -200); }
+ /**
+ * Return a new ``int208`` type for %%v%%.
+ */
+ static int208(v) { return n(v, -208); }
+ /**
+ * Return a new ``int216`` type for %%v%%.
+ */
+ static int216(v) { return n(v, -216); }
+ /**
+ * Return a new ``int224`` type for %%v%%.
+ */
+ static int224(v) { return n(v, -224); }
+ /**
+ * Return a new ``int232`` type for %%v%%.
+ */
+ static int232(v) { return n(v, -232); }
+ /**
+ * Return a new ``int240`` type for %%v%%.
+ */
+ static int240(v) { return n(v, -240); }
+ /**
+ * Return a new ``int248`` type for %%v%%.
+ */
+ static int248(v) { return n(v, -248); }
+ /**
+ * Return a new ``int256`` type for %%v%%.
+ */
+ static int256(v) { return n(v, -256); }
+ /**
+ * Return a new ``int256`` type for %%v%%.
+ */
+ static int(v) { return n(v, -256); }
+ /**
+ * Return a new ``bytes1`` type for %%v%%.
+ */
+ static bytes1(v) { return b(v, 1); }
+ /**
+ * Return a new ``bytes2`` type for %%v%%.
+ */
+ static bytes2(v) { return b(v, 2); }
+ /**
+ * Return a new ``bytes3`` type for %%v%%.
+ */
+ static bytes3(v) { return b(v, 3); }
+ /**
+ * Return a new ``bytes4`` type for %%v%%.
+ */
+ static bytes4(v) { return b(v, 4); }
+ /**
+ * Return a new ``bytes5`` type for %%v%%.
+ */
+ static bytes5(v) { return b(v, 5); }
+ /**
+ * Return a new ``bytes6`` type for %%v%%.
+ */
+ static bytes6(v) { return b(v, 6); }
+ /**
+ * Return a new ``bytes7`` type for %%v%%.
+ */
+ static bytes7(v) { return b(v, 7); }
+ /**
+ * Return a new ``bytes8`` type for %%v%%.
+ */
+ static bytes8(v) { return b(v, 8); }
+ /**
+ * Return a new ``bytes9`` type for %%v%%.
+ */
+ static bytes9(v) { return b(v, 9); }
+ /**
+ * Return a new ``bytes10`` type for %%v%%.
+ */
+ static bytes10(v) { return b(v, 10); }
+ /**
+ * Return a new ``bytes11`` type for %%v%%.
+ */
+ static bytes11(v) { return b(v, 11); }
+ /**
+ * Return a new ``bytes12`` type for %%v%%.
+ */
+ static bytes12(v) { return b(v, 12); }
+ /**
+ * Return a new ``bytes13`` type for %%v%%.
+ */
+ static bytes13(v) { return b(v, 13); }
+ /**
+ * Return a new ``bytes14`` type for %%v%%.
+ */
+ static bytes14(v) { return b(v, 14); }
+ /**
+ * Return a new ``bytes15`` type for %%v%%.
+ */
+ static bytes15(v) { return b(v, 15); }
+ /**
+ * Return a new ``bytes16`` type for %%v%%.
+ */
+ static bytes16(v) { return b(v, 16); }
+ /**
+ * Return a new ``bytes17`` type for %%v%%.
+ */
+ static bytes17(v) { return b(v, 17); }
+ /**
+ * Return a new ``bytes18`` type for %%v%%.
+ */
+ static bytes18(v) { return b(v, 18); }
+ /**
+ * Return a new ``bytes19`` type for %%v%%.
+ */
+ static bytes19(v) { return b(v, 19); }
+ /**
+ * Return a new ``bytes20`` type for %%v%%.
+ */
+ static bytes20(v) { return b(v, 20); }
+ /**
+ * Return a new ``bytes21`` type for %%v%%.
+ */
+ static bytes21(v) { return b(v, 21); }
+ /**
+ * Return a new ``bytes22`` type for %%v%%.
+ */
+ static bytes22(v) { return b(v, 22); }
+ /**
+ * Return a new ``bytes23`` type for %%v%%.
+ */
+ static bytes23(v) { return b(v, 23); }
+ /**
+ * Return a new ``bytes24`` type for %%v%%.
+ */
+ static bytes24(v) { return b(v, 24); }
+ /**
+ * Return a new ``bytes25`` type for %%v%%.
+ */
+ static bytes25(v) { return b(v, 25); }
+ /**
+ * Return a new ``bytes26`` type for %%v%%.
+ */
+ static bytes26(v) { return b(v, 26); }
+ /**
+ * Return a new ``bytes27`` type for %%v%%.
+ */
+ static bytes27(v) { return b(v, 27); }
+ /**
+ * Return a new ``bytes28`` type for %%v%%.
+ */
+ static bytes28(v) { return b(v, 28); }
+ /**
+ * Return a new ``bytes29`` type for %%v%%.
+ */
+ static bytes29(v) { return b(v, 29); }
+ /**
+ * Return a new ``bytes30`` type for %%v%%.
+ */
+ static bytes30(v) { return b(v, 30); }
+ /**
+ * Return a new ``bytes31`` type for %%v%%.
+ */
+ static bytes31(v) { return b(v, 31); }
+ /**
+ * Return a new ``bytes32`` type for %%v%%.
+ */
+ static bytes32(v) { return b(v, 32); }
+ /**
+ * Return a new ``address`` type for %%v%%.
+ */
+ static address(v) { return new Typed(_gaurd, "address", v); }
+ /**
+ * Return a new ``bool`` type for %%v%%.
+ */
+ static bool(v) { return new Typed(_gaurd, "bool", !!v); }
+ /**
+ * Return a new ``bytes`` type for %%v%%.
+ */
+ static bytes(v) { return new Typed(_gaurd, "bytes", v); }
+ /**
+ * Return a new ``string`` type for %%v%%.
+ */
+ static string(v) { return new Typed(_gaurd, "string", v); }
+ /**
+ * Return a new ``array`` type for %%v%%, allowing %%dynamic%% length.
+ */
+ static array(v, dynamic) {
+ throw new Error("not implemented yet");
+ return new Typed(_gaurd, "array", v, dynamic);
+ }
+ /**
+ * Return a new ``tuple`` type for %%v%%, with the optional %%name%%.
+ */
+ static tuple(v, name) {
+ throw new Error("not implemented yet");
+ return new Typed(_gaurd, "tuple", v, name);
+ }
+ /**
+ * Return a new ``uint8`` type for %%v%%.
+ */
+ static overrides(v) {
+ return new Typed(_gaurd, "overrides", Object.assign({}, v));
+ }
+ /**
+ * Returns true only if %%value%% is a [[Typed]] instance.
+ */
+ static isTyped(value) {
+ return (value
+ && typeof (value) === "object"
+ && "_typedSymbol" in value
+ && value._typedSymbol === _typedSymbol);
+ }
+ /**
+ * If the value is a [[Typed]] instance, validates the underlying value
+ * and returns it, otherwise returns value directly.
+ *
+ * This is useful for functions that with to accept either a [[Typed]]
+ * object or values.
+ */
+ static dereference(value, type) {
+ if (Typed.isTyped(value)) {
+ if (value.type !== type) {
+ throw new Error(`invalid type: expecetd ${type}, got ${value.type}`);
+ }
+ return value.value;
+ }
+ return value;
+ }
+}
+exports.Typed = Typed;
+_Typed_options = new WeakMap();
+//# sourceMappingURL=typed.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/abi/typed.js.map b/dist/ethers.js/src.ts/abi/typed.js.map
new file mode 100644
index 0000000..22e0629
--- /dev/null
+++ b/dist/ethers.js/src.ts/abi/typed.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"typed.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/abi/typed.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;;;;;;;;;;;;;AAEH,gDAAoE;AAOpE,MAAM,MAAM,GAAG,EAAG,CAAC;AAEnB,SAAS,CAAC,CAAC,KAAmB,EAAE,KAAa;IACzC,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,IAAI,KAAK,GAAG,CAAC,EAAE;QACX,MAAM,GAAG,IAAI,CAAC;QACd,KAAK,IAAI,CAAC,CAAC,CAAC;KACf;IAED,wCAAwC;IACxC,OAAO,IAAI,KAAK,CAAC,MAAM,EAAE,GAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAA,CAAC,CAAC,GAAI,MAAO,KAAM,EAAE,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAA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C,KAAK,CAAC,CAAmD,EAAE,IAAa;QAC3E,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;QACvC,OAAO,IAAI,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;IAC/C,CAAC;IAGD;;OAEG;IACH,MAAM,CAAC,SAAS,CAAC,CAAsB;QACnC,OAAO,IAAI,KAAK,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,EAAG,EAAE,CAAC,CAAC,CAAC,CAAC;IACjE,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,KAAU;QACrB,OAAO,CAAC,KAAK;eACN,OAAM,CAAC,KAAK,CAAC,KAAK,QAAQ;eAC1B,cAAc,IAAI,KAAK;eACvB,KAAK,CAAC,YAAY,KAAK,YAAY,CAAC,CAAC;IAChD,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,WAAW,CAAI,KAAgB,EAAE,IAAY;QAChD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YACtB,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,EAAE;gBACrB,MAAM,IAAI,KAAK,CAAC,0BAA2B,IAAK,SAAU,KAAK,CAAC,IAAK,EAAE,CAAC,CAAC;aAC5E;YACD,OAAO,KAAK,CAAC,KAAK,CAAC;SACtB;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ;AA5qBD,sBA4qBC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/address/address.d.ts b/dist/ethers.js/src.ts/address/address.d.ts
new file mode 100644
index 0000000..581be4f
--- /dev/null
+++ b/dist/ethers.js/src.ts/address/address.d.ts
@@ -0,0 +1,56 @@
+/**
+ * Returns a normalized and checksumed address for %%address%%.
+ * This accepts non-checksum addresses, checksum addresses and
+ * [[getIcapAddress]] formats.
+ *
+ * The checksum in Ethereum uses the capitalization (upper-case
+ * vs lower-case) of the characters within an address to encode
+ * its checksum, which offers, on average, a checksum of 15-bits.
+ *
+ * If %%address%% contains both upper-case and lower-case, it is
+ * assumed to already be a checksum address and its checksum is
+ * validated, and if the address fails its expected checksum an
+ * error is thrown.
+ *
+ * If you wish the checksum of %%address%% to be ignore, it should
+ * be converted to lower-case (i.e. ``.toLowercase()``) before
+ * being passed in. This should be a very rare situation though,
+ * that you wish to bypass the safegaurds in place to protect
+ * against an address that has been incorrectly copied from another
+ * source.
+ *
+ * @example:
+ * // Adds the checksum (via upper-casing specific letters)
+ * getAddress("0x8ba1f109551bd432803012645ac136ddd64dba72")
+ * //_result:
+ *
+ * // Converts ICAP address and adds checksum
+ * getAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36");
+ * //_result:
+ *
+ * // Throws an error if an address contains mixed case,
+ * // but the checksum fails
+ * getAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBA72")
+ * //_error:
+ */
+export declare function getAddress(address: string): string;
+/**
+ * The [ICAP Address format](link-icap) format is an early checksum
+ * format which attempts to be compatible with the banking
+ * industry [IBAN format](link-wiki-iban) for bank accounts.
+ *
+ * It is no longer common or a recommended format.
+ *
+ * @example:
+ * getIcapAddress("0x8ba1f109551bd432803012645ac136ddd64dba72");
+ * //_result:
+ *
+ * getIcapAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36");
+ * //_result:
+ *
+ * // Throws an error if the ICAP checksum is wrong
+ * getIcapAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK37");
+ * //_error:
+ */
+export declare function getIcapAddress(address: string): string;
+//# sourceMappingURL=address.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/address/address.d.ts.map b/dist/ethers.js/src.ts/address/address.d.ts.map
new file mode 100644
index 0000000..0c26a5a
--- /dev/null
+++ b/dist/ethers.js/src.ts/address/address.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/address/address.ts"],"names":[],"mappings":"AAmFA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CA6BlD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAKtD"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/address/address.js b/dist/ethers.js/src.ts/address/address.js
new file mode 100644
index 0000000..991c5dd
--- /dev/null
+++ b/dist/ethers.js/src.ts/address/address.js
@@ -0,0 +1,161 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.getIcapAddress = exports.getAddress = void 0;
+const index_js_1 = require("../crypto/index.js");
+const index_js_2 = require("../utils/index.js");
+const BN_0 = BigInt(0);
+const BN_36 = BigInt(36);
+function getChecksumAddress(address) {
+ // if (!isHexString(address, 20)) {
+ // logger.throwArgumentError("invalid address", "address", address);
+ // }
+ address = address.toLowerCase();
+ const chars = address.substring(2).split("");
+ const expanded = new Uint8Array(40);
+ for (let i = 0; i < 40; i++) {
+ expanded[i] = chars[i].charCodeAt(0);
+ }
+ const hashed = (0, index_js_2.getBytes)((0, index_js_1.keccak256)(expanded));
+ for (let i = 0; i < 40; i += 2) {
+ if ((hashed[i >> 1] >> 4) >= 8) {
+ chars[i] = chars[i].toUpperCase();
+ }
+ if ((hashed[i >> 1] & 0x0f) >= 8) {
+ chars[i + 1] = chars[i + 1].toUpperCase();
+ }
+ }
+ return "0x" + chars.join("");
+}
+// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number
+// Create lookup table
+const ibanLookup = {};
+for (let i = 0; i < 10; i++) {
+ ibanLookup[String(i)] = String(i);
+}
+for (let i = 0; i < 26; i++) {
+ ibanLookup[String.fromCharCode(65 + i)] = String(10 + i);
+}
+// How many decimal digits can we process? (for 64-bit float, this is 15)
+// i.e. Math.floor(Math.log10(Number.MAX_SAFE_INTEGER));
+const safeDigits = 15;
+function ibanChecksum(address) {
+ address = address.toUpperCase();
+ address = address.substring(4) + address.substring(0, 2) + "00";
+ let expanded = address.split("").map((c) => { return ibanLookup[c]; }).join("");
+ // Javascript can handle integers safely up to 15 (decimal) digits
+ while (expanded.length >= safeDigits) {
+ let block = expanded.substring(0, safeDigits);
+ expanded = parseInt(block, 10) % 97 + expanded.substring(block.length);
+ }
+ let checksum = String(98 - (parseInt(expanded, 10) % 97));
+ while (checksum.length < 2) {
+ checksum = "0" + checksum;
+ }
+ return checksum;
+}
+;
+const Base36 = (function () {
+ ;
+ const result = {};
+ for (let i = 0; i < 36; i++) {
+ const key = "0123456789abcdefghijklmnopqrstuvwxyz"[i];
+ result[key] = BigInt(i);
+ }
+ return result;
+})();
+function fromBase36(value) {
+ value = value.toLowerCase();
+ let result = BN_0;
+ for (let i = 0; i < value.length; i++) {
+ result = result * BN_36 + Base36[value[i]];
+ }
+ return result;
+}
+/**
+ * Returns a normalized and checksumed address for %%address%%.
+ * This accepts non-checksum addresses, checksum addresses and
+ * [[getIcapAddress]] formats.
+ *
+ * The checksum in Ethereum uses the capitalization (upper-case
+ * vs lower-case) of the characters within an address to encode
+ * its checksum, which offers, on average, a checksum of 15-bits.
+ *
+ * If %%address%% contains both upper-case and lower-case, it is
+ * assumed to already be a checksum address and its checksum is
+ * validated, and if the address fails its expected checksum an
+ * error is thrown.
+ *
+ * If you wish the checksum of %%address%% to be ignore, it should
+ * be converted to lower-case (i.e. ``.toLowercase()``) before
+ * being passed in. This should be a very rare situation though,
+ * that you wish to bypass the safegaurds in place to protect
+ * against an address that has been incorrectly copied from another
+ * source.
+ *
+ * @example:
+ * // Adds the checksum (via upper-casing specific letters)
+ * getAddress("0x8ba1f109551bd432803012645ac136ddd64dba72")
+ * //_result:
+ *
+ * // Converts ICAP address and adds checksum
+ * getAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36");
+ * //_result:
+ *
+ * // Throws an error if an address contains mixed case,
+ * // but the checksum fails
+ * getAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBA72")
+ * //_error:
+ */
+function getAddress(address) {
+ (0, index_js_2.assertArgument)(typeof (address) === "string", "invalid address", "address", address);
+ if (address.match(/^(0x)?[0-9a-fA-F]{40}$/)) {
+ // Missing the 0x prefix
+ if (!address.startsWith("0x")) {
+ address = "0x" + address;
+ }
+ const result = getChecksumAddress(address);
+ // It is a checksummed address with a bad checksum
+ (0, index_js_2.assertArgument)(!address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) || result === address, "bad address checksum", "address", address);
+ return result;
+ }
+ // Maybe ICAP? (we only support direct mode)
+ if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {
+ // It is an ICAP address with a bad checksum
+ (0, index_js_2.assertArgument)(address.substring(2, 4) === ibanChecksum(address), "bad icap checksum", "address", address);
+ let result = fromBase36(address.substring(4)).toString(16);
+ while (result.length < 40) {
+ result = "0" + result;
+ }
+ return getChecksumAddress("0x" + result);
+ }
+ (0, index_js_2.assertArgument)(false, "invalid address", "address", address);
+}
+exports.getAddress = getAddress;
+/**
+ * The [ICAP Address format](link-icap) format is an early checksum
+ * format which attempts to be compatible with the banking
+ * industry [IBAN format](link-wiki-iban) for bank accounts.
+ *
+ * It is no longer common or a recommended format.
+ *
+ * @example:
+ * getIcapAddress("0x8ba1f109551bd432803012645ac136ddd64dba72");
+ * //_result:
+ *
+ * getIcapAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36");
+ * //_result:
+ *
+ * // Throws an error if the ICAP checksum is wrong
+ * getIcapAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK37");
+ * //_error:
+ */
+function getIcapAddress(address) {
+ //let base36 = _base16To36(getAddress(address).substring(2)).toUpperCase();
+ let base36 = BigInt(getAddress(address)).toString(36).toUpperCase();
+ while (base36.length < 30) {
+ base36 = "0" + base36;
+ }
+ return "XE" + ibanChecksum("XE00" + base36) + base36;
+}
+exports.getIcapAddress = getIcapAddress;
+//# sourceMappingURL=address.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/address/address.js.map b/dist/ethers.js/src.ts/address/address.js.map
new file mode 100644
index 0000000..236d5ca
--- /dev/null
+++ b/dist/ethers.js/src.ts/address/address.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"address.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/address/address.ts"],"names":[],"mappings":";;;AAAA,iDAA+C;AAC/C,gDAA6D;AAG7D,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;AAEzB,SAAS,kBAAkB,CAAC,OAAe;IAC3C,sCAAsC;IACtC,2EAA2E;IAC3E,OAAO;IAEH,OAAO,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAEhC,MAAM,KAAK,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAE7C,MAAM,QAAQ,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;IACpC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE;QACzB,QAAQ,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;KACxC;IAED,MAAM,MAAM,GAAG,IAAA,mBAAQ,EAAC,IAAA,oBAAS,EAAC,QAAQ,CAAC,CAAC,CAAC;IAE7C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE;QAC5B,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE;YAC5B,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;SACrC;QACD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C;AA7BD,gCA6BC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,cAAc,CAAC,OAAe;IAC1C,2EAA2E;IAC3E,IAAI,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;IACpE,OAAO,MAAM,CAAC,MAAM,GAAG,EAAE,EAAE;QAAE,MAAM,GAAG,GAAG,GAAG,MAAM,CAAC;KAAE;IACrD,OAAO,IAAI,GAAG,YAAY,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,MAAM,CAAC;AACzD,CAAC;AALD,wCAKC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/address/checks.d.ts b/dist/ethers.js/src.ts/address/checks.d.ts
new file mode 100644
index 0000000..24e781f
--- /dev/null
+++ b/dist/ethers.js/src.ts/address/checks.d.ts
@@ -0,0 +1,81 @@
+import type { Addressable, AddressLike, NameResolver } from "./index.js";
+/**
+ * Returns true if %%value%% is an object which implements the
+ * [[Addressable]] interface.
+ *
+ * @example:
+ * // Wallets and AbstractSigner sub-classes
+ * isAddressable(Wallet.createRandom())
+ * //_result:
+ *
+ * // Contracts
+ * contract = new Contract("dai.tokens.ethers.eth", [ ], provider)
+ * isAddressable(contract)
+ * //_result:
+ */
+export declare function isAddressable(value: any): value is Addressable;
+/**
+ * Returns true if %%value%% is a valid address.
+ *
+ * @example:
+ * // Valid address
+ * isAddress("0x8ba1f109551bD432803012645Ac136ddd64DBA72")
+ * //_result:
+ *
+ * // Valid ICAP address
+ * isAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36")
+ * //_result:
+ *
+ * // Invalid checksum
+ * isAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBa72")
+ * //_result:
+ *
+ * // Invalid ICAP checksum
+ * isAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBA72")
+ * //_result:
+ *
+ * // Not an address (an ENS name requires a provided and an
+ * // asynchronous API to access)
+ * isAddress("ricmoo.eth")
+ * //_result:
+ */
+export declare function isAddress(value: any): value is string;
+/**
+ * Resolves to an address for the %%target%%, which may be any
+ * supported address type, an [[Addressable]] or a Promise which
+ * resolves to an address.
+ *
+ * If an ENS name is provided, but that name has not been correctly
+ * configured a [[UnconfiguredNameError]] is thrown.
+ *
+ * @example:
+ * addr = "0x6B175474E89094C44Da98b954EedeAC495271d0F"
+ *
+ * // Addresses are return synchronously
+ * resolveAddress(addr, provider)
+ * //_result:
+ *
+ * // Address promises are resolved asynchronously
+ * resolveAddress(Promise.resolve(addr))
+ * //_result:
+ *
+ * // ENS names are resolved asynchronously
+ * resolveAddress("dai.tokens.ethers.eth", provider)
+ * //_result:
+ *
+ * // Addressable objects are resolved asynchronously
+ * contract = new Contract(addr, [ ])
+ * resolveAddress(contract, provider)
+ * //_result:
+ *
+ * // Unconfigured ENS names reject
+ * resolveAddress("nothing-here.ricmoo.eth", provider)
+ * //_error:
+ *
+ * // ENS names require a NameResolver object passed in
+ * // (notice the provider was omitted)
+ * resolveAddress("nothing-here.ricmoo.eth")
+ * //_error:
+ */
+export declare function resolveAddress(target: AddressLike, resolver?: null | NameResolver): string | Promise;
+//# sourceMappingURL=checks.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/address/checks.d.ts.map b/dist/ethers.js/src.ts/address/checks.d.ts.map
new file mode 100644
index 0000000..d7d9416
--- /dev/null
+++ b/dist/ethers.js/src.ts/address/checks.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"checks.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/address/checks.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAGzE;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,WAAW,CAE9D;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,MAAM,CAMrD;AAWD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,IAAI,GAAG,YAAY,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAkB5G"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/address/checks.js b/dist/ethers.js/src.ts/address/checks.js
new file mode 100644
index 0000000..ae224c4
--- /dev/null
+++ b/dist/ethers.js/src.ts/address/checks.js
@@ -0,0 +1,131 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.resolveAddress = exports.isAddress = exports.isAddressable = void 0;
+const index_js_1 = require("../utils/index.js");
+const address_js_1 = require("./address.js");
+/**
+ * Returns true if %%value%% is an object which implements the
+ * [[Addressable]] interface.
+ *
+ * @example:
+ * // Wallets and AbstractSigner sub-classes
+ * isAddressable(Wallet.createRandom())
+ * //_result:
+ *
+ * // Contracts
+ * contract = new Contract("dai.tokens.ethers.eth", [ ], provider)
+ * isAddressable(contract)
+ * //_result:
+ */
+function isAddressable(value) {
+ return (value && typeof (value.getAddress) === "function");
+}
+exports.isAddressable = isAddressable;
+/**
+ * Returns true if %%value%% is a valid address.
+ *
+ * @example:
+ * // Valid address
+ * isAddress("0x8ba1f109551bD432803012645Ac136ddd64DBA72")
+ * //_result:
+ *
+ * // Valid ICAP address
+ * isAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36")
+ * //_result:
+ *
+ * // Invalid checksum
+ * isAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBa72")
+ * //_result:
+ *
+ * // Invalid ICAP checksum
+ * isAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBA72")
+ * //_result:
+ *
+ * // Not an address (an ENS name requires a provided and an
+ * // asynchronous API to access)
+ * isAddress("ricmoo.eth")
+ * //_result:
+ */
+function isAddress(value) {
+ try {
+ (0, address_js_1.getAddress)(value);
+ return true;
+ }
+ catch (error) { }
+ return false;
+}
+exports.isAddress = isAddress;
+function checkAddress(target, promise) {
+ return __awaiter(this, void 0, void 0, function* () {
+ const result = yield promise;
+ if (result == null || result === "0x0000000000000000000000000000000000000000") {
+ (0, index_js_1.assert)(typeof (target) !== "string", "unconfigured name", "UNCONFIGURED_NAME", { value: target });
+ (0, index_js_1.assertArgument)(false, "invalid AddressLike value; did not resolve to a value address", "target", target);
+ }
+ return (0, address_js_1.getAddress)(result);
+ });
+}
+/**
+ * Resolves to an address for the %%target%%, which may be any
+ * supported address type, an [[Addressable]] or a Promise which
+ * resolves to an address.
+ *
+ * If an ENS name is provided, but that name has not been correctly
+ * configured a [[UnconfiguredNameError]] is thrown.
+ *
+ * @example:
+ * addr = "0x6B175474E89094C44Da98b954EedeAC495271d0F"
+ *
+ * // Addresses are return synchronously
+ * resolveAddress(addr, provider)
+ * //_result:
+ *
+ * // Address promises are resolved asynchronously
+ * resolveAddress(Promise.resolve(addr))
+ * //_result:
+ *
+ * // ENS names are resolved asynchronously
+ * resolveAddress("dai.tokens.ethers.eth", provider)
+ * //_result:
+ *
+ * // Addressable objects are resolved asynchronously
+ * contract = new Contract(addr, [ ])
+ * resolveAddress(contract, provider)
+ * //_result:
+ *
+ * // Unconfigured ENS names reject
+ * resolveAddress("nothing-here.ricmoo.eth", provider)
+ * //_error:
+ *
+ * // ENS names require a NameResolver object passed in
+ * // (notice the provider was omitted)
+ * resolveAddress("nothing-here.ricmoo.eth")
+ * //_error:
+ */
+function resolveAddress(target, resolver) {
+ if (typeof (target) === "string") {
+ if (target.match(/^0x[0-9a-f]{40}$/i)) {
+ return (0, address_js_1.getAddress)(target);
+ }
+ (0, index_js_1.assert)(resolver != null, "ENS resolution requires a provider", "UNSUPPORTED_OPERATION", { operation: "resolveName" });
+ return checkAddress(target, resolver.resolveName(target));
+ }
+ else if (isAddressable(target)) {
+ return checkAddress(target, target.getAddress());
+ }
+ else if (target && typeof (target.then) === "function") {
+ return checkAddress(target, target);
+ }
+ (0, index_js_1.assertArgument)(false, "unsupported addressable value", "target", target);
+}
+exports.resolveAddress = resolveAddress;
+//# sourceMappingURL=checks.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/address/checks.js.map b/dist/ethers.js/src.ts/address/checks.js.map
new file mode 100644
index 0000000..d6ab947
--- /dev/null
+++ b/dist/ethers.js/src.ts/address/checks.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"checks.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/address/checks.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gDAA2D;AAE3D,6CAA0C;AAK1C;;;;;;;;;;;;;GAaG;AACH,SAAgB,aAAa,CAAC,KAAU;IACpC,OAAO,CAAC,KAAK,IAAI,OAAM,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,UAAU,CAAC,CAAC;AAC9D,CAAC;AAFD,sCAEC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,SAAgB,SAAS,CAAC,KAAU;IAChC,IAAI;QACA,IAAA,uBAAU,EAAC,KAAK,CAAC,CAAC;QAClB,OAAO,IAAI,CAAC;KACf;IAAC,OAAO,KAAK,EAAE,GAAG;IACnB,OAAO,KAAK,CAAC;AACjB,CAAC;AAND,8BAMC;AAED,SAAe,YAAY,CAAC,MAAW,EAAE,OAA+B;;QACpE,MAA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C;AAlBD,wCAkBC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/address/contract-address.d.ts b/dist/ethers.js/src.ts/address/contract-address.d.ts
new file mode 100644
index 0000000..42b36f7
--- /dev/null
+++ b/dist/ethers.js/src.ts/address/contract-address.d.ts
@@ -0,0 +1,48 @@
+import type { BigNumberish, BytesLike } from "../utils/index.js";
+/**
+ * Returns the address that would result from a ``CREATE`` for %%tx%%.
+ *
+ * This can be used to compute the address a contract will be
+ * deployed to by an EOA when sending a deployment transaction (i.e.
+ * when the ``to`` address is ``null``).
+ *
+ * This can also be used to compute the address a contract will be
+ * deployed to by a contract, by using the contract's address as the
+ * ``to`` and the contract's nonce.
+ *
+ * @example
+ * from = "0x8ba1f109551bD432803012645Ac136ddd64DBA72";
+ * nonce = 5;
+ *
+ * getCreateAddress({ from, nonce });
+ * //_result:
+ */
+export declare function getCreateAddress(tx: {
+ from: string;
+ nonce: BigNumberish;
+}): string;
+/**
+ * Returns the address that would result from a ``CREATE2`` operation
+ * with the given %%from%%, %%salt%% and %%initCodeHash%%.
+ *
+ * To compute the %%initCodeHash%% from a contract's init code, use
+ * the [[keccak256]] function.
+ *
+ * For a quick overview and example of ``CREATE2``, see [[link-ricmoo-wisps]].
+ *
+ * @example
+ * // The address of the contract
+ * from = "0x8ba1f109551bD432803012645Ac136ddd64DBA72"
+ *
+ * // The salt
+ * salt = id("HelloWorld")
+ *
+ * // The hash of the initCode
+ * initCode = "0x6394198df16000526103ff60206004601c335afa6040516060f3";
+ * initCodeHash = keccak256(initCode)
+ *
+ * getCreate2Address(from, salt, initCodeHash)
+ * //_result:
+ */
+export declare function getCreate2Address(_from: string, _salt: BytesLike, _initCodeHash: BytesLike): string;
+//# sourceMappingURL=contract-address.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/address/contract-address.d.ts.map b/dist/ethers.js/src.ts/address/contract-address.d.ts.map
new file mode 100644
index 0000000..0881e7a
--- /dev/null
+++ b/dist/ethers.js/src.ts/address/contract-address.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"contract-address.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/address/contract-address.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAKjE;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,YAAY,CAAA;CAAE,GAAG,MAAM,CAclF;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS,GAAG,MAAM,CAUnG"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/address/contract-address.js b/dist/ethers.js/src.ts/address/contract-address.js
new file mode 100644
index 0000000..6c545bb
--- /dev/null
+++ b/dist/ethers.js/src.ts/address/contract-address.js
@@ -0,0 +1,74 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.getCreate2Address = exports.getCreateAddress = void 0;
+const index_js_1 = require("../crypto/index.js");
+const index_js_2 = require("../utils/index.js");
+const address_js_1 = require("./address.js");
+// http://ethereum.stackexchange.com/questions/760/how-is-the-address-of-an-ethereum-contract-computed
+/**
+ * Returns the address that would result from a ``CREATE`` for %%tx%%.
+ *
+ * This can be used to compute the address a contract will be
+ * deployed to by an EOA when sending a deployment transaction (i.e.
+ * when the ``to`` address is ``null``).
+ *
+ * This can also be used to compute the address a contract will be
+ * deployed to by a contract, by using the contract's address as the
+ * ``to`` and the contract's nonce.
+ *
+ * @example
+ * from = "0x8ba1f109551bD432803012645Ac136ddd64DBA72";
+ * nonce = 5;
+ *
+ * getCreateAddress({ from, nonce });
+ * //_result:
+ */
+function getCreateAddress(tx) {
+ const from = (0, address_js_1.getAddress)(tx.from);
+ const nonce = (0, index_js_2.getBigInt)(tx.nonce, "tx.nonce");
+ let nonceHex = nonce.toString(16);
+ if (nonceHex === "0") {
+ nonceHex = "0x";
+ }
+ else if (nonceHex.length % 2) {
+ nonceHex = "0x0" + nonceHex;
+ }
+ else {
+ nonceHex = "0x" + nonceHex;
+ }
+ return (0, address_js_1.getAddress)((0, index_js_2.dataSlice)((0, index_js_1.keccak256)((0, index_js_2.encodeRlp)([from, nonceHex])), 12));
+}
+exports.getCreateAddress = getCreateAddress;
+/**
+ * Returns the address that would result from a ``CREATE2`` operation
+ * with the given %%from%%, %%salt%% and %%initCodeHash%%.
+ *
+ * To compute the %%initCodeHash%% from a contract's init code, use
+ * the [[keccak256]] function.
+ *
+ * For a quick overview and example of ``CREATE2``, see [[link-ricmoo-wisps]].
+ *
+ * @example
+ * // The address of the contract
+ * from = "0x8ba1f109551bD432803012645Ac136ddd64DBA72"
+ *
+ * // The salt
+ * salt = id("HelloWorld")
+ *
+ * // The hash of the initCode
+ * initCode = "0x6394198df16000526103ff60206004601c335afa6040516060f3";
+ * initCodeHash = keccak256(initCode)
+ *
+ * getCreate2Address(from, salt, initCodeHash)
+ * //_result:
+ */
+function getCreate2Address(_from, _salt, _initCodeHash) {
+ const from = (0, address_js_1.getAddress)(_from);
+ const salt = (0, index_js_2.getBytes)(_salt, "salt");
+ const initCodeHash = (0, index_js_2.getBytes)(_initCodeHash, "initCodeHash");
+ (0, index_js_2.assertArgument)(salt.length === 32, "salt must be 32 bytes", "salt", _salt);
+ (0, index_js_2.assertArgument)(initCodeHash.length === 32, "initCodeHash must be 32 bytes", "initCodeHash", _initCodeHash);
+ return (0, address_js_1.getAddress)((0, index_js_2.dataSlice)((0, index_js_1.keccak256)((0, index_js_2.concat)(["0xff", from, salt, initCodeHash])), 12));
+}
+exports.getCreate2Address = getCreate2Address;
+//# sourceMappingURL=contract-address.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/address/contract-address.js.map b/dist/ethers.js/src.ts/address/contract-address.js.map
new file mode 100644
index 0000000..ace9769
--- /dev/null
+++ b/dist/ethers.js/src.ts/address/contract-address.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"contract-address.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/address/contract-address.ts"],"names":[],"mappings":";;;AAAA,iDAA+C;AAC/C,gDAE2B;AAE3B,6CAA0C;AAK1C,sGAAsG;AAEtG;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,gBAAgB,CAAC,EAAyC;IACtE,MAAM,IAAI,GAAG,IAAA,uBAAU,EAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IACjC,MAAM,KAAK,GAAG,IAAA,oBAAS,EAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;IAE9C,IAAI,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAClC,IAAI,QAAQ,KAAK,GAAG,EAAE;QAClB,QAAQ,GAAG,IAAI,CAAC;KACnB;SAAM,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;QAC5B,QAAQ,GAAG,KAAK,GAAG,QAAQ,CAAC;KAC/B;SAAM;QACH,QAAQ,GAAG,IAAI,GAAG,QAAQ,CAAC;KAC9B;IAED,OAAO,IAAA,uBAAU,EAAC,IAAA,oBAAS,EAAC,IAAA,oBAAS,EAAC,IAAA,oBAAS,EAAC,CAAE,IAAI,EAAE,QAAQ,CAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/E,CAAC;AAdD,4CAcC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,SAAgB,iBAAiB,CAAC,KAAa,EAAE,KAAgB,EAAE,aAAwB;IACvF,MAAM,IAAI,GAAG,IAAA,uBAAU,EAAC,KAAK,CAAC,CAAC;IAC/B,MAAM,IAAI,GAAG,IAAA,mBAAQ,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,MAAM,YAAY,GAAG,IAAA,mBAAQ,EAAC,aAAa,EAAE,cAAc,CAAC,CAAC;IAE7D,IAAA,yBAAc,EAAC,IAAI,CAAC,MAAM,KAAK,EAAE,EAAE,uBAAuB,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IAE3E,IAAA,yBAAc,EAAC,YAAY,CAAC,MAAM,KAAK,EAAE,EAAE,+BAA+B,EAAE,cAAc,EAAE,aAAa,CAAC,CAAC;IAE3G,OAAO,IAAA,uBAAU,EAAC,IAAA,oBAAS,EAAC,IAAA,oBAAS,EAAC,IAAA,iBAAM,EAAC,CAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,CAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;AAC7F,CAAC;AAVD,8CAUC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/address/index.d.ts b/dist/ethers.js/src.ts/address/index.d.ts
new file mode 100644
index 0000000..744a8e0
--- /dev/null
+++ b/dist/ethers.js/src.ts/address/index.d.ts
@@ -0,0 +1,49 @@
+/**
+ * Addresses are a fundamental part of interacting with Ethereum. They
+ * represent the gloabal identity of Externally Owned Accounts (accounts
+ * backed by a private key) and contracts.
+ *
+ * The Ethereum Naming Service (ENS) provides an interconnected ecosystem
+ * of contracts, standards and libraries which enable looking up an
+ * address for an ENS name.
+ *
+ * These functions help convert between various formats, validate
+ * addresses and safely resolve ENS names.
+ *
+ * @_section: api/address:Addresses [about-addresses]
+ */
+/**
+ * An interface for objects which have an address, and can
+ * resolve it asyncronously.
+ *
+ * This allows objects such as [[Signer]] or [[Contract]] to
+ * be used most places an address can be, for example getting
+ * the [balance](Provider-getBalance).
+ */
+export interface Addressable {
+ /**
+ * Get the object address.
+ */
+ getAddress(): Promise;
+}
+/**
+ * Anything that can be used to return or resolve an address.
+ */
+export type AddressLike = string | Promise | Addressable;
+/**
+ * An interface for any object which can resolve an ENS name.
+ */
+export interface NameResolver {
+ /**
+ * Resolve to the address for the ENS %%name%%.
+ *
+ * Resolves to ``null`` if the name is unconfigued. Use
+ * [[resolveAddress]] (passing this object as %%resolver%%) to
+ * throw for names that are unconfigured.
+ */
+ resolveName(name: string): Promise;
+}
+export { getAddress, getIcapAddress } from "./address.js";
+export { getCreateAddress, getCreate2Address } from "./contract-address.js";
+export { isAddressable, isAddress, resolveAddress } from "./checks.js";
+//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/address/index.d.ts.map b/dist/ethers.js/src.ts/address/index.d.ts.map
new file mode 100644
index 0000000..d99c700
--- /dev/null
+++ b/dist/ethers.js/src.ts/address/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/address/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW;IACxB;;OAEG;IACH,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB;;;;;;OAMG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;CACrD;AAED,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE1D,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG5E,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/address/index.js b/dist/ethers.js/src.ts/address/index.js
new file mode 100644
index 0000000..c9bbb74
--- /dev/null
+++ b/dist/ethers.js/src.ts/address/index.js
@@ -0,0 +1,29 @@
+"use strict";
+/**
+ * Addresses are a fundamental part of interacting with Ethereum. They
+ * represent the gloabal identity of Externally Owned Accounts (accounts
+ * backed by a private key) and contracts.
+ *
+ * The Ethereum Naming Service (ENS) provides an interconnected ecosystem
+ * of contracts, standards and libraries which enable looking up an
+ * address for an ENS name.
+ *
+ * These functions help convert between various formats, validate
+ * addresses and safely resolve ENS names.
+ *
+ * @_section: api/address:Addresses [about-addresses]
+ */
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.resolveAddress = exports.isAddress = exports.isAddressable = exports.getCreate2Address = exports.getCreateAddress = exports.getIcapAddress = exports.getAddress = void 0;
+null;
+var address_js_1 = require("./address.js");
+Object.defineProperty(exports, "getAddress", { enumerable: true, get: function () { return address_js_1.getAddress; } });
+Object.defineProperty(exports, "getIcapAddress", { enumerable: true, get: function () { return address_js_1.getIcapAddress; } });
+var contract_address_js_1 = require("./contract-address.js");
+Object.defineProperty(exports, "getCreateAddress", { enumerable: true, get: function () { return contract_address_js_1.getCreateAddress; } });
+Object.defineProperty(exports, "getCreate2Address", { enumerable: true, get: function () { return contract_address_js_1.getCreate2Address; } });
+var checks_js_1 = require("./checks.js");
+Object.defineProperty(exports, "isAddressable", { enumerable: true, get: function () { return checks_js_1.isAddressable; } });
+Object.defineProperty(exports, "isAddress", { enumerable: true, get: function () { return checks_js_1.isAddress; } });
+Object.defineProperty(exports, "resolveAddress", { enumerable: true, get: function () { return checks_js_1.resolveAddress; } });
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/address/index.js.map b/dist/ethers.js/src.ts/address/index.js.map
new file mode 100644
index 0000000..4c7d997
--- /dev/null
+++ b/dist/ethers.js/src.ts/address/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/address/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAEH,IAAI,CAAC;AAoCL,2CAA0D;AAAjD,wGAAA,UAAU,OAAA;AAAE,4GAAA,cAAc,OAAA;AAEnC,6DAA4E;AAAnE,uHAAA,gBAAgB,OAAA;AAAE,wHAAA,iBAAiB,OAAA;AAG5C,yCAAuE;AAA9D,0GAAA,aAAa,OAAA;AAAE,sGAAA,SAAS,OAAA;AAAE,2GAAA,cAAc,OAAA"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/constants/addresses.d.ts b/dist/ethers.js/src.ts/constants/addresses.d.ts
new file mode 100644
index 0000000..a32d6be
--- /dev/null
+++ b/dist/ethers.js/src.ts/constants/addresses.d.ts
@@ -0,0 +1,7 @@
+/**
+ * A constant for the zero address.
+ *
+ * (**i.e.** ``"0x0000000000000000000000000000000000000000"``)
+ */
+export declare const ZeroAddress: string;
+//# sourceMappingURL=addresses.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/constants/addresses.d.ts.map b/dist/ethers.js/src.ts/constants/addresses.d.ts.map
new file mode 100644
index 0000000..285ea7f
--- /dev/null
+++ b/dist/ethers.js/src.ts/constants/addresses.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"addresses.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/constants/addresses.ts"],"names":[],"mappings":"AACA;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,MAAqD,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/constants/addresses.js b/dist/ethers.js/src.ts/constants/addresses.js
new file mode 100644
index 0000000..ff4fb40
--- /dev/null
+++ b/dist/ethers.js/src.ts/constants/addresses.js
@@ -0,0 +1,10 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.ZeroAddress = void 0;
+/**
+ * A constant for the zero address.
+ *
+ * (**i.e.** ``"0x0000000000000000000000000000000000000000"``)
+ */
+exports.ZeroAddress = "0x0000000000000000000000000000000000000000";
+//# sourceMappingURL=addresses.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/constants/addresses.js.map b/dist/ethers.js/src.ts/constants/addresses.js.map
new file mode 100644
index 0000000..4edfd17
--- /dev/null
+++ b/dist/ethers.js/src.ts/constants/addresses.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"addresses.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/constants/addresses.ts"],"names":[],"mappings":";;;AACA;;;;GAIG;AACU,QAAA,WAAW,GAAW,4CAA4C,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/constants/hashes.d.ts b/dist/ethers.js/src.ts/constants/hashes.d.ts
new file mode 100644
index 0000000..784df71
--- /dev/null
+++ b/dist/ethers.js/src.ts/constants/hashes.d.ts
@@ -0,0 +1,7 @@
+/**
+ * A constant for the zero hash.
+ *
+ * (**i.e.** ``"0x0000000000000000000000000000000000000000000000000000000000000000"``)
+ */
+export declare const ZeroHash: string;
+//# sourceMappingURL=hashes.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/constants/hashes.d.ts.map b/dist/ethers.js/src.ts/constants/hashes.d.ts.map
new file mode 100644
index 0000000..5aea905
--- /dev/null
+++ b/dist/ethers.js/src.ts/constants/hashes.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"hashes.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/constants/hashes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,QAAQ,EAAE,MAA6E,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/constants/hashes.js b/dist/ethers.js/src.ts/constants/hashes.js
new file mode 100644
index 0000000..fbcd74c
--- /dev/null
+++ b/dist/ethers.js/src.ts/constants/hashes.js
@@ -0,0 +1,10 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.ZeroHash = void 0;
+/**
+ * A constant for the zero hash.
+ *
+ * (**i.e.** ``"0x0000000000000000000000000000000000000000000000000000000000000000"``)
+ */
+exports.ZeroHash = "0x0000000000000000000000000000000000000000000000000000000000000000";
+//# sourceMappingURL=hashes.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/constants/hashes.js.map b/dist/ethers.js/src.ts/constants/hashes.js.map
new file mode 100644
index 0000000..2ec9b1b
--- /dev/null
+++ b/dist/ethers.js/src.ts/constants/hashes.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"hashes.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/constants/hashes.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACU,QAAA,QAAQ,GAAW,oEAAoE,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/constants/index.d.ts b/dist/ethers.js/src.ts/constants/index.d.ts
new file mode 100644
index 0000000..fa4e9e7
--- /dev/null
+++ b/dist/ethers.js/src.ts/constants/index.d.ts
@@ -0,0 +1,10 @@
+/**
+ * Some common constants useful for Ethereum.
+ *
+ * @_section: api/constants: Constants [about-constants]
+ */
+export { ZeroAddress } from "./addresses.js";
+export { ZeroHash } from "./hashes.js";
+export { N, WeiPerEther, MaxUint256, MinInt256, MaxInt256 } from "./numbers.js";
+export { EtherSymbol, MessagePrefix } from "./strings.js";
+//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/constants/index.d.ts.map b/dist/ethers.js/src.ts/constants/index.d.ts.map
new file mode 100644
index 0000000..b845468
--- /dev/null
+++ b/dist/ethers.js/src.ts/constants/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/constants/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EACH,CAAC,EACD,WAAW,EACX,UAAU,EACV,SAAS,EACT,SAAS,EACZ,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/constants/index.js b/dist/ethers.js/src.ts/constants/index.js
new file mode 100644
index 0000000..6be74a7
--- /dev/null
+++ b/dist/ethers.js/src.ts/constants/index.js
@@ -0,0 +1,22 @@
+"use strict";
+/**
+ * Some common constants useful for Ethereum.
+ *
+ * @_section: api/constants: Constants [about-constants]
+ */
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.MessagePrefix = exports.EtherSymbol = exports.MaxInt256 = exports.MinInt256 = exports.MaxUint256 = exports.WeiPerEther = exports.N = exports.ZeroHash = exports.ZeroAddress = void 0;
+var addresses_js_1 = require("./addresses.js");
+Object.defineProperty(exports, "ZeroAddress", { enumerable: true, get: function () { return addresses_js_1.ZeroAddress; } });
+var hashes_js_1 = require("./hashes.js");
+Object.defineProperty(exports, "ZeroHash", { enumerable: true, get: function () { return hashes_js_1.ZeroHash; } });
+var numbers_js_1 = require("./numbers.js");
+Object.defineProperty(exports, "N", { enumerable: true, get: function () { return numbers_js_1.N; } });
+Object.defineProperty(exports, "WeiPerEther", { enumerable: true, get: function () { return numbers_js_1.WeiPerEther; } });
+Object.defineProperty(exports, "MaxUint256", { enumerable: true, get: function () { return numbers_js_1.MaxUint256; } });
+Object.defineProperty(exports, "MinInt256", { enumerable: true, get: function () { return numbers_js_1.MinInt256; } });
+Object.defineProperty(exports, "MaxInt256", { enumerable: true, get: function () { return numbers_js_1.MaxInt256; } });
+var strings_js_1 = require("./strings.js");
+Object.defineProperty(exports, "EtherSymbol", { enumerable: true, get: function () { return strings_js_1.EtherSymbol; } });
+Object.defineProperty(exports, "MessagePrefix", { enumerable: true, get: function () { return strings_js_1.MessagePrefix; } });
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/constants/index.js.map b/dist/ethers.js/src.ts/constants/index.js.map
new file mode 100644
index 0000000..f0d286f
--- /dev/null
+++ b/dist/ethers.js/src.ts/constants/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/constants/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,+CAA6C;AAApC,2GAAA,WAAW,OAAA;AACpB,yCAAuC;AAA9B,qGAAA,QAAQ,OAAA;AACjB,2CAMsB;AALlB,+FAAA,CAAC,OAAA;AACD,yGAAA,WAAW,OAAA;AACX,wGAAA,UAAU,OAAA;AACV,uGAAA,SAAS,OAAA;AACT,uGAAA,SAAS,OAAA;AAEb,2CAA0D;AAAjD,yGAAA,WAAW,OAAA;AAAE,2GAAA,aAAa,OAAA"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/constants/numbers.d.ts b/dist/ethers.js/src.ts/constants/numbers.d.ts
new file mode 100644
index 0000000..7c84eaa
--- /dev/null
+++ b/dist/ethers.js/src.ts/constants/numbers.d.ts
@@ -0,0 +1,31 @@
+/**
+ * A constant for the order N for the secp256k1 curve.
+ *
+ * (**i.e.** ``0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n``)
+ */
+export declare const N: bigint;
+/**
+ * A constant for the number of wei in a single ether.
+ *
+ * (**i.e.** ``1000000000000000000n``)
+ */
+export declare const WeiPerEther: bigint;
+/**
+ * A constant for the maximum value for a ``uint256``.
+ *
+ * (**i.e.** ``0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``)
+ */
+export declare const MaxUint256: bigint;
+/**
+ * A constant for the minimum value for an ``int256``.
+ *
+ * (**i.e.** ``-8000000000000000000000000000000000000000000000000000000000000000n``)
+ */
+export declare const MinInt256: bigint;
+/**
+ * A constant for the maximum value for an ``int256``.
+ *
+ * (**i.e.** ``0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``)
+ */
+export declare const MaxInt256: bigint;
+//# sourceMappingURL=numbers.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/constants/numbers.d.ts.map b/dist/ethers.js/src.ts/constants/numbers.d.ts.map
new file mode 100644
index 0000000..a5f2d0e
--- /dev/null
+++ b/dist/ethers.js/src.ts/constants/numbers.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"numbers.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/constants/numbers.ts"],"names":[],"mappings":"AACA;;;;GAIG;AACH,eAAO,MAAM,CAAC,EAAE,MAAqF,CAAC;AAEtG;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,MAAsC,CAAC;AAEjE;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,MAAqF,CAAC;AAE/G;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,MAAkG,CAAC;AAE3H;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,MAAqF,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/constants/numbers.js b/dist/ethers.js/src.ts/constants/numbers.js
new file mode 100644
index 0000000..2ab9150
--- /dev/null
+++ b/dist/ethers.js/src.ts/constants/numbers.js
@@ -0,0 +1,34 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.MaxInt256 = exports.MinInt256 = exports.MaxUint256 = exports.WeiPerEther = exports.N = void 0;
+/**
+ * A constant for the order N for the secp256k1 curve.
+ *
+ * (**i.e.** ``0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n``)
+ */
+exports.N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");
+/**
+ * A constant for the number of wei in a single ether.
+ *
+ * (**i.e.** ``1000000000000000000n``)
+ */
+exports.WeiPerEther = BigInt("1000000000000000000");
+/**
+ * A constant for the maximum value for a ``uint256``.
+ *
+ * (**i.e.** ``0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``)
+ */
+exports.MaxUint256 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
+/**
+ * A constant for the minimum value for an ``int256``.
+ *
+ * (**i.e.** ``-8000000000000000000000000000000000000000000000000000000000000000n``)
+ */
+exports.MinInt256 = BigInt("0x8000000000000000000000000000000000000000000000000000000000000000") * BigInt(-1);
+/**
+ * A constant for the maximum value for an ``int256``.
+ *
+ * (**i.e.** ``0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``)
+ */
+exports.MaxInt256 = BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
+//# sourceMappingURL=numbers.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/constants/numbers.js.map b/dist/ethers.js/src.ts/constants/numbers.js.map
new file mode 100644
index 0000000..5aad474
--- /dev/null
+++ b/dist/ethers.js/src.ts/constants/numbers.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"numbers.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/constants/numbers.ts"],"names":[],"mappings":";;;AACA;;;;GAIG;AACU,QAAA,CAAC,GAAW,MAAM,CAAC,oEAAoE,CAAC,CAAC;AAEtG;;;;GAIG;AACU,QAAA,WAAW,GAAW,MAAM,CAAC,qBAAqB,CAAC,CAAC;AAEjE;;;;GAIG;AACU,QAAA,UAAU,GAAW,MAAM,CAAC,oEAAoE,CAAC,CAAC;AAE/G;;;;GAIG;AACU,QAAA,SAAS,GAAW,MAAM,CAAC,oEAAoE,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAE3H;;;;GAIG;AACU,QAAA,SAAS,GAAW,MAAM,CAAC,oEAAoE,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/constants/strings.d.ts b/dist/ethers.js/src.ts/constants/strings.d.ts
new file mode 100644
index 0000000..0ad1c86
--- /dev/null
+++ b/dist/ethers.js/src.ts/constants/strings.d.ts
@@ -0,0 +1,13 @@
+/**
+ * A constant for the ether symbol (normalized using NFKC).
+ *
+ * (**i.e.** ``"\\u039e"``)
+ */
+export declare const EtherSymbol: string;
+/**
+ * A constant for the [[link-eip-191]] personal message prefix.
+ *
+ * (**i.e.** ``"\\x19Ethereum Signed Message:\\n"``)
+ */
+export declare const MessagePrefix: string;
+//# sourceMappingURL=strings.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/constants/strings.d.ts.map b/dist/ethers.js/src.ts/constants/strings.d.ts.map
new file mode 100644
index 0000000..ccc532d
--- /dev/null
+++ b/dist/ethers.js/src.ts/constants/strings.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/constants/strings.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,MAAiB,CAAC;AAG5C;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,MAAyC,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/constants/strings.js b/dist/ethers.js/src.ts/constants/strings.js
new file mode 100644
index 0000000..78ebe30
--- /dev/null
+++ b/dist/ethers.js/src.ts/constants/strings.js
@@ -0,0 +1,17 @@
+"use strict";
+// NFKC (composed) // (decomposed)
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.MessagePrefix = exports.EtherSymbol = void 0;
+/**
+ * A constant for the ether symbol (normalized using NFKC).
+ *
+ * (**i.e.** ``"\\u039e"``)
+ */
+exports.EtherSymbol = "\u039e"; // "\uD835\uDF63";
+/**
+ * A constant for the [[link-eip-191]] personal message prefix.
+ *
+ * (**i.e.** ``"\\x19Ethereum Signed Message:\\n"``)
+ */
+exports.MessagePrefix = "\x19Ethereum Signed Message:\n";
+//# sourceMappingURL=strings.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/constants/strings.js.map b/dist/ethers.js/src.ts/constants/strings.js.map
new file mode 100644
index 0000000..33cb433
--- /dev/null
+++ b/dist/ethers.js/src.ts/constants/strings.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"strings.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/constants/strings.ts"],"names":[],"mappings":";AAAA,8CAA8C;;;AAE9C;;;;GAIG;AACU,QAAA,WAAW,GAAW,QAAQ,CAAC,CAAE,kBAAkB;AAGhE;;;;GAIG;AACU,QAAA,aAAa,GAAW,gCAAgC,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/contract/contract.d.ts b/dist/ethers.js/src.ts/contract/contract.d.ts
new file mode 100644
index 0000000..53ad50c
--- /dev/null
+++ b/dist/ethers.js/src.ts/contract/contract.d.ts
@@ -0,0 +1,168 @@
+import { Interface } from "../abi/index.js";
+import { Log, TransactionResponse } from "../providers/provider.js";
+import { ContractTransactionResponse, EventLog } from "./wrappers.js";
+import type { EventFragment, FunctionFragment, InterfaceAbi, ParamType } from "../abi/index.js";
+import type { Addressable } from "../address/index.js";
+import type { EventEmitterable, Listener } from "../utils/index.js";
+import type { BlockTag, ContractRunner } from "../providers/index.js";
+import type { ContractEventName, ContractInterface, ContractMethod, ContractEvent, ContractTransaction, WrappedFallback } from "./types.js";
+/**
+ * @_ignore:
+ */
+export declare function copyOverrides(arg: any, allowed?: Array): Promise>;
+/**
+ * @_ignore:
+ */
+export declare function resolveArgs(_runner: null | ContractRunner, inputs: ReadonlyArray, args: Array): Promise>;
+declare const internal: unique symbol;
+export declare class BaseContract implements Addressable, EventEmitterable {
+ /**
+ * The target to connect to.
+ *
+ * This can be an address, ENS name or any [[Addressable]], such as
+ * another contract. To get the resovled address, use the ``getAddress``
+ * method.
+ */
+ readonly target: string | Addressable;
+ /**
+ * The contract Interface.
+ */
+ readonly interface: Interface;
+ /**
+ * The connected runner. This is generally a [[Provider]] or a
+ * [[Signer]], which dictates what operations are supported.
+ *
+ * For example, a **Contract** connected to a [[Provider]] may
+ * only execute read-only operations.
+ */
+ readonly runner: null | ContractRunner;
+ /**
+ * All the Events available on this contract.
+ */
+ readonly filters: Record;
+ /**
+ * @_ignore:
+ */
+ readonly [internal]: any;
+ /**
+ * The fallback or receive function if any.
+ */
+ readonly fallback: null | WrappedFallback;
+ /**
+ * Creates a new contract connected to %%target%% with the %%abi%% and
+ * optionally connected to a %%runner%% to perform operations on behalf
+ * of.
+ */
+ constructor(target: string | Addressable, abi: Interface | InterfaceAbi, runner?: null | ContractRunner, _deployTx?: null | TransactionResponse);
+ /**
+ * Return a new Contract instance with the same target and ABI, but
+ * a different %%runner%%.
+ */
+ connect(runner: null | ContractRunner): BaseContract;
+ /**
+ * Return a new Contract instance with the same ABI and runner, but
+ * a different %%target%%.
+ */
+ attach(target: string | Addressable): BaseContract;
+ /**
+ * Return the resolved address of this Contract.
+ */
+ getAddress(): Promise;
+ /**
+ * Return the deployed bytecode or null if no bytecode is found.
+ */
+ getDeployedCode(): Promise;
+ /**
+ * Resolve to this Contract once the bytecode has been deployed, or
+ * resolve immediately if already deployed.
+ */
+ waitForDeployment(): Promise;
+ /**
+ * Return the transaction used to deploy this contract.
+ *
+ * This is only available if this instance was returned from a
+ * [[ContractFactory]].
+ */
+ deploymentTransaction(): null | ContractTransactionResponse;
+ /**
+ * Return the function for a given name. This is useful when a contract
+ * method name conflicts with a JavaScript name such as ``prototype`` or
+ * when using a Contract programatically.
+ */
+ getFunction(key: string | FunctionFragment): T;
+ /**
+ * Return the event for a given name. This is useful when a contract
+ * event name conflicts with a JavaScript name such as ``prototype`` or
+ * when using a Contract programatically.
+ */
+ getEvent(key: string | EventFragment): ContractEvent;
+ /**
+ * @_ignore:
+ */
+ queryTransaction(hash: string): Promise>;
+ /**
+ * Provide historic access to event data for %%event%% in the range
+ * %%fromBlock%% (default: ``0``) to %%toBlock%% (default: ``"latest"``)
+ * inclusive.
+ */
+ queryFilter(event: ContractEventName, fromBlock?: BlockTag, toBlock?: BlockTag): Promise>;
+ /**
+ * Add an event %%listener%% for the %%event%%.
+ */
+ on(event: ContractEventName, listener: Listener): Promise;
+ /**
+ * Add an event %%listener%% for the %%event%%, but remove the listener
+ * after it is fired once.
+ */
+ once(event: ContractEventName, listener: Listener): Promise;
+ /**
+ * Emit an %%event%% calling all listeners with %%args%%.
+ *
+ * Resolves to ``true`` if any listeners were called.
+ */
+ emit(event: ContractEventName, ...args: Array): Promise;
+ /**
+ * Resolves to the number of listeners of %%event%% or the total number
+ * of listeners if unspecified.
+ */
+ listenerCount(event?: ContractEventName): Promise;
+ /**
+ * Resolves to the listeners subscribed to %%event%% or all listeners
+ * if unspecified.
+ */
+ listeners(event?: ContractEventName): Promise>;
+ /**
+ * Remove the %%listener%% from the listeners for %%event%% or remove
+ * all listeners if unspecified.
+ */
+ off(event: ContractEventName, listener?: Listener): Promise;
+ /**
+ * Remove all the listeners for %%event%% or remove all listeners if
+ * unspecified.
+ */
+ removeAllListeners(event?: ContractEventName): Promise;
+ /**
+ * Alias for [on].
+ */
+ addListener(event: ContractEventName, listener: Listener): Promise;
+ /**
+ * Alias for [off].
+ */
+ removeListener(event: ContractEventName, listener: Listener): Promise;
+ /**
+ * Create a new Class for the %%abi%%.
+ */
+ static buildClass(abi: Interface | InterfaceAbi): new (target: string, runner?: null | ContractRunner) => BaseContract & Omit;
+ /**
+ * Create a new BaseContract with a specified Interface.
+ */
+ static from(target: string, abi: Interface | InterfaceAbi, runner?: null | ContractRunner): BaseContract & Omit;
+}
+declare const Contract_base: new (target: string, abi: Interface | InterfaceAbi, runner?: ContractRunner | null | undefined) => BaseContract & Omit;
+/**
+ * A [[BaseContract]] with no type guards on its methods or events.
+ */
+export declare class Contract extends Contract_base {
+}
+export {};
+//# sourceMappingURL=contract.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/contract/contract.d.ts.map b/dist/ethers.js/src.ts/contract/contract.d.ts.map
new file mode 100644
index 0000000..dde5ee4
--- /dev/null
+++ b/dist/ethers.js/src.ts/contract/contract.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/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,E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AC,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"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/contract/contract.js b/dist/ethers.js/src.ts/contract/contract.js
new file mode 100644
index 0000000..fa8bd8c
--- /dev/null
+++ b/dist/ethers.js/src.ts/contract/contract.js
@@ -0,0 +1,1011 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
+ if (kind === "m") throw new TypeError("Private method is not writable");
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
+};
+var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
+};
+var _PreparedTopicFilter_filter;
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.Contract = exports.BaseContract = exports.resolveArgs = exports.copyOverrides = void 0;
+const index_js_1 = require("../abi/index.js");
+const index_js_2 = require("../address/index.js");
+// import from provider.ts instead of index.ts to prevent circular dep
+// from EtherscanProvider
+const provider_js_1 = require("../providers/provider.js");
+const index_js_3 = require("../utils/index.js");
+const wrappers_js_1 = require("./wrappers.js");
+const BN_0 = BigInt(0);
+function canCall(value) {
+ return (value && typeof (value.call) === "function");
+}
+function canEstimate(value) {
+ return (value && typeof (value.estimateGas) === "function");
+}
+function canResolve(value) {
+ return (value && typeof (value.resolveName) === "function");
+}
+function canSend(value) {
+ return (value && typeof (value.sendTransaction) === "function");
+}
+function getResolver(value) {
+ if (value != null) {
+ if (canResolve(value)) {
+ return value;
+ }
+ if (value.provider) {
+ return value.provider;
+ }
+ }
+ return undefined;
+}
+class PreparedTopicFilter {
+ constructor(contract, fragment, args) {
+ _PreparedTopicFilter_filter.set(this, void 0);
+ (0, index_js_3.defineProperties)(this, { fragment });
+ if (fragment.inputs.length < args.length) {
+ throw new Error("too many arguments");
+ }
+ // Recursively descend into args and resolve any addresses
+ const runner = getRunner(contract.runner, "resolveName");
+ const resolver = canResolve(runner) ? runner : null;
+ __classPrivateFieldSet(this, _PreparedTopicFilter_filter, (function () {
+ return __awaiter(this, void 0, void 0, function* () {
+ const resolvedArgs = yield Promise.all(fragment.inputs.map((param, index) => {
+ const arg = args[index];
+ if (arg == null) {
+ return null;
+ }
+ return param.walkAsync(args[index], (type, value) => {
+ if (type === "address") {
+ if (Array.isArray(value)) {
+ return Promise.all(value.map((v) => (0, index_js_2.resolveAddress)(v, resolver)));
+ }
+ return (0, index_js_2.resolveAddress)(value, resolver);
+ }
+ return value;
+ });
+ }));
+ return contract.interface.encodeFilterTopics(fragment, resolvedArgs);
+ });
+ })(), "f");
+ }
+ getTopicFilter() {
+ return __classPrivateFieldGet(this, _PreparedTopicFilter_filter, "f");
+ }
+}
+_PreparedTopicFilter_filter = new WeakMap();
+// A = Arguments passed in as a tuple
+// R = The result type of the call (i.e. if only one return type,
+// the qualified type, otherwise Result)
+// D = The type the default call will return (i.e. R for view/pure,
+// TransactionResponse otherwise)
+//export interface ContractMethod = Array, R = any, D extends R | ContractTransactionResponse = ContractTransactionResponse> {
+function getRunner(value, feature) {
+ if (value == null) {
+ return null;
+ }
+ if (typeof (value[feature]) === "function") {
+ return value;
+ }
+ if (value.provider && typeof (value.provider[feature]) === "function") {
+ return value.provider;
+ }
+ return null;
+}
+function getProvider(value) {
+ if (value == null) {
+ return null;
+ }
+ return value.provider || null;
+}
+/**
+ * @_ignore:
+ */
+function copyOverrides(arg, allowed) {
+ return __awaiter(this, void 0, void 0, function* () {
+ // 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)(_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
+ if (overrides.from) {
+ overrides.from = overrides.from;
+ }
+ return overrides;
+ });
+}
+exports.copyOverrides = copyOverrides;
+/**
+ * @_ignore:
+ */
+function resolveArgs(_runner, inputs, args) {
+ return __awaiter(this, void 0, void 0, function* () {
+ // Recursively descend into args and resolve any addresses
+ const runner = getRunner(_runner, "resolveName");
+ const resolver = canResolve(runner) ? runner : null;
+ return yield Promise.all(inputs.map((param, index) => {
+ return param.walkAsync(args[index], (type, value) => {
+ value = index_js_1.Typed.dereference(value, type);
+ if (type === "address") {
+ return (0, index_js_2.resolveAddress)(value, resolver);
+ }
+ return value;
+ });
+ }));
+ });
+}
+exports.resolveArgs = resolveArgs;
+function buildWrappedFallback(contract) {
+ const populateTransaction = function (overrides) {
+ return __awaiter(this, void 0, void 0, function* () {
+ // If an overrides was passed in, copy it and normalize the values
+ const tx = (yield copyOverrides(overrides, ["data"]));
+ tx.to = yield contract.getAddress();
+ if (tx.from) {
+ tx.from = yield (0, index_js_2.resolveAddress)(tx.from, getResolver(contract.runner));
+ }
+ const iface = contract.interface;
+ const noValue = ((0, index_js_3.getBigInt)((tx.value || BN_0), "overrides.value") === BN_0);
+ const noData = ((tx.data || "0x") === "0x");
+ if (iface.fallback && !iface.fallback.payable && iface.receive && !noData && !noValue) {
+ (0, index_js_3.assertArgument)(false, "cannot send data to receive or send value to non-payable fallback", "overrides", overrides);
+ }
+ (0, index_js_3.assertArgument)(iface.fallback || noData, "cannot send data to receive-only contract", "overrides.data", tx.data);
+ // Only allow payable contracts to set non-zero value
+ const payable = iface.receive || (iface.fallback && iface.fallback.payable);
+ (0, index_js_3.assertArgument)(payable || noValue, "cannot send value to non-payable fallback", "overrides.value", tx.value);
+ // Only allow fallback contracts to set non-empty data
+ (0, index_js_3.assertArgument)(iface.fallback || noData, "cannot send data to receive-only contract", "overrides.data", tx.data);
+ return tx;
+ });
+ };
+ const staticCall = function (overrides) {
+ return __awaiter(this, void 0, void 0, function* () {
+ const runner = getRunner(contract.runner, "call");
+ (0, index_js_3.assert)(canCall(runner), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" });
+ const tx = yield populateTransaction(overrides);
+ try {
+ return yield runner.call(tx);
+ }
+ catch (error) {
+ if ((0, index_js_3.isCallException)(error) && error.data) {
+ throw contract.interface.makeError(error.data, tx);
+ }
+ throw error;
+ }
+ });
+ };
+ const send = function (overrides) {
+ return __awaiter(this, void 0, void 0, function* () {
+ const runner = contract.runner;
+ (0, index_js_3.assert)(canSend(runner), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" });
+ const tx = yield runner.sendTransaction(yield populateTransaction(overrides));
+ const provider = getProvider(contract.runner);
+ // @TODO: the provider can be null; make a custom dummy provider that will throw a
+ // meaningful error
+ return new wrappers_js_1.ContractTransactionResponse(contract.interface, provider, tx);
+ });
+ };
+ const estimateGas = function (overrides) {
+ return __awaiter(this, void 0, void 0, function* () {
+ const runner = getRunner(contract.runner, "estimateGas");
+ (0, index_js_3.assert)(canEstimate(runner), "contract runner does not support gas estimation", "UNSUPPORTED_OPERATION", { operation: "estimateGas" });
+ return yield runner.estimateGas(yield populateTransaction(overrides));
+ });
+ };
+ const method = (overrides) => __awaiter(this, void 0, void 0, function* () {
+ return yield send(overrides);
+ });
+ (0, index_js_3.defineProperties)(method, {
+ _contract: contract,
+ estimateGas,
+ populateTransaction,
+ send, staticCall
+ });
+ return method;
+}
+function buildWrappedMethod(contract, key) {
+ const getFragment = function (...args) {
+ const fragment = contract.interface.getFunction(key, args);
+ (0, index_js_3.assert)(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", {
+ operation: "fragment",
+ info: { key, args }
+ });
+ return fragment;
+ };
+ const populateTransaction = function (...args) {
+ return __awaiter(this, void 0, void 0, function* () {
+ const fragment = getFragment(...args);
+ // If an overrides was passed in, copy it and normalize the values
+ let overrides = {};
+ if (fragment.inputs.length + 1 === args.length) {
+ overrides = yield copyOverrides(args.pop());
+ if (overrides.from) {
+ overrides.from = yield (0, index_js_2.resolveAddress)(overrides.from, getResolver(contract.runner));
+ }
+ }
+ if (fragment.inputs.length !== args.length) {
+ throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");
+ }
+ const resolvedArgs = yield resolveArgs(contract.runner, fragment.inputs, args);
+ return Object.assign({}, overrides, yield (0, index_js_3.resolveProperties)({
+ to: contract.getAddress(),
+ data: contract.interface.encodeFunctionData(fragment, resolvedArgs)
+ }));
+ });
+ };
+ const staticCall = function (...args) {
+ return __awaiter(this, void 0, void 0, function* () {
+ const result = yield staticCallResult(...args);
+ if (result.length === 1) {
+ return result[0];
+ }
+ return result;
+ });
+ };
+ const send = function (...args) {
+ return __awaiter(this, void 0, void 0, function* () {
+ const runner = contract.runner;
+ (0, index_js_3.assert)(canSend(runner), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" });
+ const tx = yield runner.sendTransaction(yield populateTransaction(...args));
+ const provider = getProvider(contract.runner);
+ // @TODO: the provider can be null; make a custom dummy provider that will throw a
+ // meaningful error
+ return new wrappers_js_1.ContractTransactionResponse(contract.interface, provider, tx);
+ });
+ };
+ const estimateGas = function (...args) {
+ return __awaiter(this, void 0, void 0, function* () {
+ const runner = getRunner(contract.runner, "estimateGas");
+ (0, index_js_3.assert)(canEstimate(runner), "contract runner does not support gas estimation", "UNSUPPORTED_OPERATION", { operation: "estimateGas" });
+ return yield runner.estimateGas(yield populateTransaction(...args));
+ });
+ };
+ const staticCallResult = function (...args) {
+ return __awaiter(this, void 0, void 0, function* () {
+ const runner = getRunner(contract.runner, "call");
+ (0, index_js_3.assert)(canCall(runner), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" });
+ const tx = yield populateTransaction(...args);
+ let result = "0x";
+ try {
+ result = yield runner.call(tx);
+ }
+ catch (error) {
+ if ((0, index_js_3.isCallException)(error) && error.data) {
+ throw contract.interface.makeError(error.data, tx);
+ }
+ throw error;
+ }
+ const fragment = getFragment(...args);
+ return contract.interface.decodeFunctionResult(fragment, result);
+ });
+ };
+ const method = (...args) => __awaiter(this, void 0, void 0, function* () {
+ const fragment = getFragment(...args);
+ if (fragment.constant) {
+ return yield staticCall(...args);
+ }
+ return yield send(...args);
+ });
+ (0, index_js_3.defineProperties)(method, {
+ name: contract.interface.getFunctionName(key),
+ _contract: contract, _key: key,
+ getFragment,
+ estimateGas,
+ populateTransaction,
+ send, staticCall, staticCallResult,
+ });
+ // Only works on non-ambiguous keys (refined fragment is always non-ambiguous)
+ Object.defineProperty(method, "fragment", {
+ configurable: false,
+ enumerable: true,
+ get: () => {
+ const fragment = contract.interface.getFunction(key);
+ (0, index_js_3.assert)(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", {
+ operation: "fragment",
+ info: { key }
+ });
+ return fragment;
+ }
+ });
+ return method;
+}
+function buildWrappedEvent(contract, key) {
+ const getFragment = function (...args) {
+ const fragment = contract.interface.getEvent(key, args);
+ (0, index_js_3.assert)(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", {
+ operation: "fragment",
+ info: { key, args }
+ });
+ return fragment;
+ };
+ const method = function (...args) {
+ return new PreparedTopicFilter(contract, getFragment(...args), args);
+ };
+ (0, index_js_3.defineProperties)(method, {
+ name: contract.interface.getEventName(key),
+ _contract: contract, _key: key,
+ getFragment
+ });
+ // Only works on non-ambiguous keys (refined fragment is always non-ambiguous)
+ Object.defineProperty(method, "fragment", {
+ configurable: false,
+ enumerable: true,
+ get: () => {
+ const fragment = contract.interface.getEvent(key);
+ (0, index_js_3.assert)(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", {
+ operation: "fragment",
+ info: { key }
+ });
+ return fragment;
+ }
+ });
+ return method;
+}
+// The combination of TypeScrype, Private Fields and Proxies makes
+// the world go boom; so we hide variables with some trickery keeping
+// a symbol attached to each BaseContract which its sub-class (even
+// via a Proxy) can reach and use to look up its internal values.
+const internal = Symbol.for("_ethersInternal_contract");
+const internalValues = new WeakMap();
+function setInternal(contract, values) {
+ internalValues.set(contract[internal], values);
+}
+function getInternal(contract) {
+ return internalValues.get(contract[internal]);
+}
+function isDeferred(value) {
+ return (value && typeof (value) === "object" && ("getTopicFilter" in value) &&
+ (typeof (value.getTopicFilter) === "function") && value.fragment);
+}
+function getSubInfo(contract, event) {
+ return __awaiter(this, void 0, void 0, function* () {
+ let topics;
+ let fragment = null;
+ // Convert named events to topicHash and get the fragment for
+ // events which need deconstructing.
+ if (Array.isArray(event)) {
+ const topicHashify = function (name) {
+ if ((0, index_js_3.isHexString)(name, 32)) {
+ return name;
+ }
+ const fragment = contract.interface.getEvent(name);
+ (0, index_js_3.assertArgument)(fragment, "unknown fragment", "name", name);
+ return fragment.topicHash;
+ };
+ // Array of Topics and Names; e.g. `[ "0x1234...89ab", "Transfer(address)" ]`
+ topics = event.map((e) => {
+ if (e == null) {
+ return null;
+ }
+ if (Array.isArray(e)) {
+ return e.map(topicHashify);
+ }
+ return topicHashify(e);
+ });
+ }
+ else if (event === "*") {
+ topics = [null];
+ }
+ else if (typeof (event) === "string") {
+ if ((0, index_js_3.isHexString)(event, 32)) {
+ // Topic Hash
+ topics = [event];
+ }
+ else {
+ // Name or Signature; e.g. `"Transfer", `"Transfer(address)"`
+ fragment = contract.interface.getEvent(event);
+ (0, index_js_3.assertArgument)(fragment, "unknown fragment", "event", event);
+ topics = [fragment.topicHash];
+ }
+ }
+ else if (isDeferred(event)) {
+ // Deferred Topic Filter; e.g. `contract.filter.Transfer(from)`
+ topics = yield event.getTopicFilter();
+ }
+ else if ("fragment" in event) {
+ // ContractEvent; e.g. `contract.filter.Transfer`
+ fragment = event.fragment;
+ topics = [fragment.topicHash];
+ }
+ else {
+ (0, index_js_3.assertArgument)(false, "unknown event name", "event", event);
+ }
+ // Normalize topics and sort TopicSets
+ topics = topics.map((t) => {
+ if (t == null) {
+ return null;
+ }
+ if (Array.isArray(t)) {
+ const items = Array.from(new Set(t.map((t) => t.toLowerCase())).values());
+ if (items.length === 1) {
+ return items[0];
+ }
+ items.sort();
+ return items;
+ }
+ return t.toLowerCase();
+ });
+ const tag = topics.map((t) => {
+ if (t == null) {
+ return "null";
+ }
+ if (Array.isArray(t)) {
+ return t.join("|");
+ }
+ return t;
+ }).join("&");
+ return { fragment, tag, topics };
+ });
+}
+function hasSub(contract, event) {
+ return __awaiter(this, void 0, void 0, function* () {
+ const { subs } = getInternal(contract);
+ return subs.get((yield getSubInfo(contract, event)).tag) || null;
+ });
+}
+function getSub(contract, operation, event) {
+ return __awaiter(this, void 0, void 0, function* () {
+ // Make sure our runner can actually subscribe to events
+ const provider = getProvider(contract.runner);
+ (0, index_js_3.assert)(provider, "contract runner does not support subscribing", "UNSUPPORTED_OPERATION", { operation });
+ const { fragment, tag, topics } = yield getSubInfo(contract, event);
+ const { addr, subs } = getInternal(contract);
+ let sub = subs.get(tag);
+ if (!sub) {
+ const address = (addr ? addr : contract);
+ const filter = { address, topics };
+ const listener = (log) => {
+ let foundFragment = fragment;
+ if (foundFragment == null) {
+ try {
+ foundFragment = contract.interface.getEvent(log.topics[0]);
+ }
+ catch (error) { }
+ }
+ // If fragment is null, we do not deconstruct the args to emit
+ if (foundFragment) {
+ const _foundFragment = foundFragment;
+ const args = fragment ? contract.interface.decodeEventLog(fragment, log.data, log.topics) : [];
+ emit(contract, event, args, (listener) => {
+ return new wrappers_js_1.ContractEventPayload(contract, listener, event, _foundFragment, log);
+ });
+ }
+ else {
+ emit(contract, event, [], (listener) => {
+ return new wrappers_js_1.ContractUnknownEventPayload(contract, listener, event, log);
+ });
+ }
+ };
+ let starting = [];
+ const start = () => {
+ if (starting.length) {
+ return;
+ }
+ starting.push(provider.on(filter, listener));
+ };
+ const stop = () => __awaiter(this, void 0, void 0, function* () {
+ if (starting.length == 0) {
+ return;
+ }
+ let started = starting;
+ starting = [];
+ yield Promise.all(started);
+ provider.off(filter, listener);
+ });
+ sub = { tag, listeners: [], start, stop };
+ subs.set(tag, sub);
+ }
+ return sub;
+ });
+}
+// We use this to ensure one emit resolves before firing the next to
+// ensure correct ordering (note this cannot throw and just adds the
+// notice to the event queu using setTimeout).
+let lastEmit = Promise.resolve();
+function _emit(contract, event, args, payloadFunc) {
+ return __awaiter(this, void 0, void 0, function* () {
+ yield lastEmit;
+ const sub = yield hasSub(contract, event);
+ if (!sub) {
+ return false;
+ }
+ const count = sub.listeners.length;
+ sub.listeners = sub.listeners.filter(({ listener, once }) => {
+ const passArgs = Array.from(args);
+ if (payloadFunc) {
+ passArgs.push(payloadFunc(once ? null : listener));
+ }
+ try {
+ listener.call(contract, ...passArgs);
+ }
+ catch (error) { }
+ return !once;
+ });
+ if (sub.listeners.length === 0) {
+ sub.stop();
+ getInternal(contract).subs.delete(sub.tag);
+ }
+ return (count > 0);
+ });
+}
+function emit(contract, event, args, payloadFunc) {
+ return __awaiter(this, void 0, void 0, function* () {
+ try {
+ yield lastEmit;
+ }
+ catch (error) { }
+ const resultPromise = _emit(contract, event, args, payloadFunc);
+ lastEmit = resultPromise;
+ return yield resultPromise;
+ });
+}
+const passProperties = ["then"];
+class BaseContract {
+ /**
+ * Creates a new contract connected to %%target%% with the %%abi%% and
+ * optionally connected to a %%runner%% to perform operations on behalf
+ * of.
+ */
+ constructor(target, abi, runner, _deployTx) {
+ (0, index_js_3.assertArgument)(typeof (target) === "string" || (0, index_js_2.isAddressable)(target), "invalid value for Contract target", "target", target);
+ if (runner == null) {
+ runner = null;
+ }
+ const iface = index_js_1.Interface.from(abi);
+ (0, index_js_3.defineProperties)(this, { target, runner, interface: iface });
+ Object.defineProperty(this, internal, { value: {} });
+ let addrPromise;
+ let addr = null;
+ let deployTx = null;
+ if (_deployTx) {
+ const provider = getProvider(runner);
+ // @TODO: the provider can be null; make a custom dummy provider that will throw a
+ // meaningful error
+ deployTx = new wrappers_js_1.ContractTransactionResponse(this.interface, provider, _deployTx);
+ }
+ let subs = new Map();
+ // Resolve the target as the address
+ if (typeof (target) === "string") {
+ if ((0, index_js_3.isHexString)(target)) {
+ addr = target;
+ addrPromise = Promise.resolve(target);
+ }
+ else {
+ const resolver = getRunner(runner, "resolveName");
+ if (!canResolve(resolver)) {
+ throw (0, index_js_3.makeError)("contract runner does not support name resolution", "UNSUPPORTED_OPERATION", {
+ operation: "resolveName"
+ });
+ }
+ addrPromise = resolver.resolveName(target).then((addr) => {
+ if (addr == null) {
+ throw (0, index_js_3.makeError)("an ENS name used for a contract target must be correctly configured", "UNCONFIGURED_NAME", {
+ value: target
+ });
+ }
+ getInternal(this).addr = addr;
+ return addr;
+ });
+ }
+ }
+ else {
+ addrPromise = target.getAddress().then((addr) => {
+ if (addr == null) {
+ throw new Error("TODO");
+ }
+ getInternal(this).addr = addr;
+ return addr;
+ });
+ }
+ // Set our private values
+ setInternal(this, { addrPromise, addr, deployTx, subs });
+ // Add the event filters
+ const filters = new Proxy({}, {
+ get: (target, prop, receiver) => {
+ // Pass important checks (like `then` for Promise) through
+ if (typeof (prop) === "symbol" || passProperties.indexOf(prop) >= 0) {
+ return Reflect.get(target, prop, receiver);
+ }
+ try {
+ return this.getEvent(prop);
+ }
+ catch (error) {
+ if (!(0, index_js_3.isError)(error, "INVALID_ARGUMENT") || error.argument !== "key") {
+ throw error;
+ }
+ }
+ return undefined;
+ },
+ has: (target, prop) => {
+ // Pass important checks (like `then` for Promise) through
+ if (passProperties.indexOf(prop) >= 0) {
+ return Reflect.has(target, prop);
+ }
+ return Reflect.has(target, prop) || this.interface.hasEvent(String(prop));
+ }
+ });
+ (0, index_js_3.defineProperties)(this, { filters });
+ (0, index_js_3.defineProperties)(this, {
+ fallback: ((iface.receive || iface.fallback) ? (buildWrappedFallback(this)) : null)
+ });
+ // Return a Proxy that will respond to functions
+ return new Proxy(this, {
+ get: (target, prop, receiver) => {
+ if (typeof (prop) === "symbol" || prop in target || passProperties.indexOf(prop) >= 0) {
+ return Reflect.get(target, prop, receiver);
+ }
+ // Undefined properties should return undefined
+ try {
+ return target.getFunction(prop);
+ }
+ catch (error) {
+ if (!(0, index_js_3.isError)(error, "INVALID_ARGUMENT") || error.argument !== "key") {
+ throw error;
+ }
+ }
+ return undefined;
+ },
+ has: (target, prop) => {
+ if (typeof (prop) === "symbol" || prop in target || passProperties.indexOf(prop) >= 0) {
+ return Reflect.has(target, prop);
+ }
+ return target.interface.hasFunction(prop);
+ }
+ });
+ }
+ /**
+ * Return a new Contract instance with the same target and ABI, but
+ * a different %%runner%%.
+ */
+ connect(runner) {
+ return new BaseContract(this.target, this.interface, runner);
+ }
+ /**
+ * Return a new Contract instance with the same ABI and runner, but
+ * a different %%target%%.
+ */
+ attach(target) {
+ return new BaseContract(target, this.interface, this.runner);
+ }
+ /**
+ * Return the resolved address of this Contract.
+ */
+ getAddress() {
+ return __awaiter(this, void 0, void 0, function* () { return yield getInternal(this).addrPromise; });
+ }
+ /**
+ * Return the deployed bytecode or null if no bytecode is found.
+ */
+ getDeployedCode() {
+ return __awaiter(this, void 0, void 0, function* () {
+ const provider = getProvider(this.runner);
+ (0, index_js_3.assert)(provider, "runner does not support .provider", "UNSUPPORTED_OPERATION", { operation: "getDeployedCode" });
+ const code = yield provider.getCode(yield this.getAddress());
+ if (code === "0x") {
+ return null;
+ }
+ return code;
+ });
+ }
+ /**
+ * Resolve to this Contract once the bytecode has been deployed, or
+ * resolve immediately if already deployed.
+ */
+ waitForDeployment() {
+ return __awaiter(this, void 0, void 0, function* () {
+ // We have the deployement transaction; just use that (throws if deployement fails)
+ const deployTx = this.deploymentTransaction();
+ if (deployTx) {
+ yield deployTx.wait();
+ return this;
+ }
+ // Check for code
+ const code = yield this.getDeployedCode();
+ if (code != null) {
+ return this;
+ }
+ // Make sure we can subscribe to a provider event
+ const provider = getProvider(this.runner);
+ (0, index_js_3.assert)(provider != null, "contract runner does not support .provider", "UNSUPPORTED_OPERATION", { operation: "waitForDeployment" });
+ return new Promise((resolve, reject) => {
+ const checkCode = () => __awaiter(this, void 0, void 0, function* () {
+ try {
+ const code = yield this.getDeployedCode();
+ if (code != null) {
+ return resolve(this);
+ }
+ provider.once("block", checkCode);
+ }
+ catch (error) {
+ reject(error);
+ }
+ });
+ checkCode();
+ });
+ });
+ }
+ /**
+ * Return the transaction used to deploy this contract.
+ *
+ * This is only available if this instance was returned from a
+ * [[ContractFactory]].
+ */
+ deploymentTransaction() {
+ return getInternal(this).deployTx;
+ }
+ /**
+ * Return the function for a given name. This is useful when a contract
+ * method name conflicts with a JavaScript name such as ``prototype`` or
+ * when using a Contract programatically.
+ */
+ getFunction(key) {
+ if (typeof (key) !== "string") {
+ key = key.format();
+ }
+ const func = buildWrappedMethod(this, key);
+ return func;
+ }
+ /**
+ * Return the event for a given name. This is useful when a contract
+ * event name conflicts with a JavaScript name such as ``prototype`` or
+ * when using a Contract programatically.
+ */
+ getEvent(key) {
+ if (typeof (key) !== "string") {
+ key = key.format();
+ }
+ return buildWrappedEvent(this, key);
+ }
+ /**
+ * @_ignore:
+ */
+ queryTransaction(hash) {
+ return __awaiter(this, void 0, void 0, function* () {
+ throw new Error("@TODO");
+ });
+ }
+ /*
+ // @TODO: this is a non-backwards compatible change, but will be added
+ // in v7 and in a potential SmartContract class in an upcoming
+ // v6 release
+ async getTransactionReceipt(hash: string): Promise {
+ const provider = getProvider(this.runner);
+ assert(provider, "contract runner does not have a provider",
+ "UNSUPPORTED_OPERATION", { operation: "queryTransaction" });
+
+ const receipt = await provider.getTransactionReceipt(hash);
+ if (receipt == null) { return null; }
+
+ return new ContractTransactionReceipt(this.interface, provider, receipt);
+ }
+ */
+ /**
+ * Provide historic access to event data for %%event%% in the range
+ * %%fromBlock%% (default: ``0``) to %%toBlock%% (default: ``"latest"``)
+ * inclusive.
+ */
+ queryFilter(event, fromBlock, toBlock) {
+ return __awaiter(this, void 0, void 0, function* () {
+ if (fromBlock == null) {
+ fromBlock = 0;
+ }
+ if (toBlock == null) {
+ toBlock = "latest";
+ }
+ const { addr, addrPromise } = getInternal(this);
+ const address = (addr ? addr : (yield addrPromise));
+ const { fragment, topics } = yield getSubInfo(this, event);
+ const filter = { address, topics, fromBlock, toBlock };
+ const provider = getProvider(this.runner);
+ (0, index_js_3.assert)(provider, "contract runner does not have a provider", "UNSUPPORTED_OPERATION", { operation: "queryFilter" });
+ return (yield provider.getLogs(filter)).map((log) => {
+ let foundFragment = fragment;
+ if (foundFragment == null) {
+ try {
+ foundFragment = this.interface.getEvent(log.topics[0]);
+ }
+ catch (error) { }
+ }
+ if (foundFragment) {
+ try {
+ return new wrappers_js_1.EventLog(log, this.interface, foundFragment);
+ }
+ catch (error) {
+ return new wrappers_js_1.UndecodedEventLog(log, error);
+ }
+ }
+ return new provider_js_1.Log(log, provider);
+ });
+ });
+ }
+ /**
+ * Add an event %%listener%% for the %%event%%.
+ */
+ on(event, listener) {
+ return __awaiter(this, void 0, void 0, function* () {
+ const sub = yield getSub(this, "on", event);
+ sub.listeners.push({ listener, once: false });
+ sub.start();
+ return this;
+ });
+ }
+ /**
+ * Add an event %%listener%% for the %%event%%, but remove the listener
+ * after it is fired once.
+ */
+ once(event, listener) {
+ return __awaiter(this, void 0, void 0, function* () {
+ const sub = yield getSub(this, "once", event);
+ sub.listeners.push({ listener, once: true });
+ sub.start();
+ return this;
+ });
+ }
+ /**
+ * Emit an %%event%% calling all listeners with %%args%%.
+ *
+ * Resolves to ``true`` if any listeners were called.
+ */
+ emit(event, ...args) {
+ return __awaiter(this, void 0, void 0, function* () {
+ return yield emit(this, event, args, null);
+ });
+ }
+ /**
+ * Resolves to the number of listeners of %%event%% or the total number
+ * of listeners if unspecified.
+ */
+ listenerCount(event) {
+ return __awaiter(this, void 0, void 0, function* () {
+ if (event) {
+ const sub = yield hasSub(this, event);
+ if (!sub) {
+ return 0;
+ }
+ return sub.listeners.length;
+ }
+ const { subs } = getInternal(this);
+ let total = 0;
+ for (const { listeners } of subs.values()) {
+ total += listeners.length;
+ }
+ return total;
+ });
+ }
+ /**
+ * Resolves to the listeners subscribed to %%event%% or all listeners
+ * if unspecified.
+ */
+ listeners(event) {
+ return __awaiter(this, void 0, void 0, function* () {
+ if (event) {
+ const sub = yield hasSub(this, event);
+ if (!sub) {
+ return [];
+ }
+ return sub.listeners.map(({ listener }) => listener);
+ }
+ const { subs } = getInternal(this);
+ let result = [];
+ for (const { listeners } of subs.values()) {
+ result = result.concat(listeners.map(({ listener }) => listener));
+ }
+ return result;
+ });
+ }
+ /**
+ * Remove the %%listener%% from the listeners for %%event%% or remove
+ * all listeners if unspecified.
+ */
+ off(event, listener) {
+ return __awaiter(this, void 0, void 0, function* () {
+ const sub = yield hasSub(this, event);
+ if (!sub) {
+ return this;
+ }
+ if (listener) {
+ const index = sub.listeners.map(({ listener }) => listener).indexOf(listener);
+ if (index >= 0) {
+ sub.listeners.splice(index, 1);
+ }
+ }
+ if (listener == null || sub.listeners.length === 0) {
+ sub.stop();
+ getInternal(this).subs.delete(sub.tag);
+ }
+ return this;
+ });
+ }
+ /**
+ * Remove all the listeners for %%event%% or remove all listeners if
+ * unspecified.
+ */
+ removeAllListeners(event) {
+ return __awaiter(this, void 0, void 0, function* () {
+ if (event) {
+ const sub = yield hasSub(this, event);
+ if (!sub) {
+ return this;
+ }
+ sub.stop();
+ getInternal(this).subs.delete(sub.tag);
+ }
+ else {
+ const { subs } = getInternal(this);
+ for (const { tag, stop } of subs.values()) {
+ stop();
+ subs.delete(tag);
+ }
+ }
+ return this;
+ });
+ }
+ /**
+ * Alias for [on].
+ */
+ addListener(event, listener) {
+ return __awaiter(this, void 0, void 0, function* () {
+ return yield this.on(event, listener);
+ });
+ }
+ /**
+ * Alias for [off].
+ */
+ removeListener(event, listener) {
+ return __awaiter(this, void 0, void 0, function* () {
+ return yield this.off(event, listener);
+ });
+ }
+ /**
+ * Create a new Class for the %%abi%%.
+ */
+ static buildClass(abi) {
+ class CustomContract extends BaseContract {
+ constructor(address, runner = null) {
+ super(address, abi, runner);
+ }
+ }
+ return CustomContract;
+ }
+ ;
+ /**
+ * Create a new BaseContract with a specified Interface.
+ */
+ static from(target, abi, runner) {
+ if (runner == null) {
+ runner = null;
+ }
+ const contract = new this(target, abi, runner);
+ return contract;
+ }
+}
+exports.BaseContract = BaseContract;
+function _ContractBase() {
+ return BaseContract;
+}
+/**
+ * A [[BaseContract]] with no type guards on its methods or events.
+ */
+class Contract extends _ContractBase() {
+}
+exports.Contract = Contract;
+//# sourceMappingURL=contract.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/contract/contract.js.map b/dist/ethers.js/src.ts/contract/contract.js.map
new file mode 100644
index 0000000..308bf41
--- /dev/null
+++ b/dist/ethers.js/src.ts/contract/contract.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"contract.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/contract/contract.ts"],"names":[],"mappings":";;;;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AAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;iBACpB;aACJ;YAED,OAAO,IAAI,CAAC;QAChB,CAAC;KAAA;IAED;;OAEG;IACG,WAAW,CAAC,KAAwB,EAAE,QAAkB;;YAC1D,OAAO,MAAM,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QAC1C,CAAC;KAAA;IAED;;OAEG;IACG,cAAc,CAAC,KAAwB,EAAE,QAAkB;;YAC7D,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QAC3C,CAAC;KAAA;IAED;;OAEG;IACH,MAAM,CAAC,UAAU,CAAwB,GAA6B;QAClE,MAAM,cAAe,SAAQ,YAAY;YACrC,YAAY,OAAe,EAAE,SAAgC,IAAI;gBAC7D,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;YAChC,CAAC;SACJ;QACD,OAAO,cAAqB,CAAC;IACjC,CAAC;IAAA,CAAC;IAEF;;OAEG;IACH,MAAM,CAAC,IAAI,CAAwB,MAAc,EAAE,GAA6B,EAAE,MAA8B;QAC5G,IAAI,MAAM,IAAI,IAAI,EAAE;YAAE,MAAM,GAAG,IAAI,CAAC;SAAE;QACtC,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,CAAE,CAAC;QAChD,OAAO,QAAe,CAAC;IAC3B,CAAC;CACJ;AAtdD,oCAsdC;AAED,SAAS,aAAa;IAClB,OAAO,YAAmB,CAAC;AAC/B,CAAC;AAED;;GAEG;AACH,MAAa,QAAS,SAAQ,aAAa,EAAE;CAAI;AAAjD,4BAAiD"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/contract/factory.d.ts b/dist/ethers.js/src.ts/contract/factory.d.ts
new file mode 100644
index 0000000..4de0ccc
--- /dev/null
+++ b/dist/ethers.js/src.ts/contract/factory.d.ts
@@ -0,0 +1,62 @@
+import { Interface } from "../abi/index.js";
+import { BaseContract } from "./contract.js";
+import type { InterfaceAbi } from "../abi/index.js";
+import type { Addressable } from "../address/index.js";
+import type { ContractRunner } from "../providers/index.js";
+import type { BytesLike } from "../utils/index.js";
+import type { ContractInterface, ContractMethodArgs, ContractDeployTransaction } from "./types.js";
+import type { ContractTransactionResponse } from "./wrappers.js";
+/**
+ * A **ContractFactory** is used to deploy a Contract to the blockchain.
+ */
+export declare class ContractFactory = Array, I = BaseContract> {
+ /**
+ * The Contract Interface.
+ */
+ readonly interface: Interface;
+ /**
+ * The Contract deployment bytecode. Often called the initcode.
+ */
+ readonly bytecode: string;
+ /**
+ * The ContractRunner to deploy the Contract as.
+ */
+ readonly runner: null | ContractRunner;
+ /**
+ * Create a new **ContractFactory** with %%abi%% and %%bytecode%%,
+ * optionally connected to %%runner%%.
+ *
+ * The %%bytecode%% may be the ``bytecode`` property within the
+ * standard Solidity JSON output.
+ */
+ constructor(abi: Interface | InterfaceAbi, bytecode: BytesLike | {
+ object: string;
+ }, runner?: null | ContractRunner);
+ attach(target: string | Addressable): BaseContract & Omit;
+ /**
+ * Resolves to the transaction to deploy the contract, passing %%args%%
+ * into the constructor.
+ */
+ getDeployTransaction(...args: ContractMethodArgs): Promise;
+ /**
+ * Resolves to the Contract deployed by passing %%args%% into the
+ * constructor.
+ *
+ * This will resovle to the Contract before it has been deployed to the
+ * network, so the [[BaseContract-waitForDeployment]] should be used before
+ * sending any transactions to it.
+ */
+ deploy(...args: ContractMethodArgs): Promise>;
+ /**
+ * Return a new **ContractFactory** with the same ABI and bytecode,
+ * but connected to %%runner%%.
+ */
+ connect(runner: null | ContractRunner): ContractFactory;
+ /**
+ * Create a new **ContractFactory** from the standard Solidity JSON output.
+ */
+ static fromSolidity = Array, I = ContractInterface>(output: any, runner?: ContractRunner): ContractFactory;
+}
+//# sourceMappingURL=factory.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/contract/factory.d.ts.map b/dist/ethers.js/src.ts/contract/factory.d.ts.map
new file mode 100644
index 0000000..087f082
--- /dev/null
+++ b/dist/ethers.js/src.ts/contract/factory.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/contract/factory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAO5C,OAAO,EAAE,YAAY,EAA8B,MAAM,eAAe,CAAC;AAEzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,KAAK,EACR,iBAAiB,EAAE,kBAAkB,EAAE,yBAAyB,EACnE,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAMjE;;GAEG;AACH,qBAAa,eAAe,CAAC,CAAC,SAAS,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY;IAE5E;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAG,SAAS,CAAC;IAE/B;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAG,MAAM,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAG,IAAI,GAAG,cAAc,CAAC;IAExC;;;;;;OAMG;gBACS,GAAG,EAAE,SAAS,GAAG,YAAY,EAAE,QAAQ,EAAE,SAAS,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,cAAc;IAiBnH,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,YAAY,GAAG,IAAI,CAAC,CAAC,EAAE,MAAM,YAAY,CAAC;IAIhF;;;OAGG;IACG,oBAAoB,CAAC,GAAG,IAAI,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAmB9F;;;;;;;OAOG;IACG,MAAM,CAAC,GAAG,IAAI,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,YAAY,GAAG;QAAE,qBAAqB,IAAI,2BAA2B,CAAA;KAAE,GAAG,IAAI,CAAC,CAAC,EAAE,MAAM,YAAY,CAAC,CAAC;IAY5J;;;OAGG;IACH,OAAO,CAAC,MAAM,EAAE,IAAI,GAAG,cAAc,GAAG,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC;IAI7D;;OAEG;IACH,MAAM,CAAC,YAAY,CAAC,CAAC,SAAS,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,iBAAiB,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,cAAc,GAAG,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC;CAgB7I"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/contract/factory.js b/dist/ethers.js/src.ts/contract/factory.js
new file mode 100644
index 0000000..764659c
--- /dev/null
+++ b/dist/ethers.js/src.ts/contract/factory.js
@@ -0,0 +1,117 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.ContractFactory = void 0;
+const index_js_1 = require("../abi/index.js");
+const index_js_2 = require("../address/index.js");
+const index_js_3 = require("../utils/index.js");
+const contract_js_1 = require("./contract.js");
+// A = Arguments to the constructor
+// I = Interface of deployed contracts
+/**
+ * A **ContractFactory** is used to deploy a Contract to the blockchain.
+ */
+class ContractFactory {
+ /**
+ * Create a new **ContractFactory** with %%abi%% and %%bytecode%%,
+ * optionally connected to %%runner%%.
+ *
+ * The %%bytecode%% may be the ``bytecode`` property within the
+ * standard Solidity JSON output.
+ */
+ constructor(abi, bytecode, runner) {
+ const iface = index_js_1.Interface.from(abi);
+ // Dereference Solidity bytecode objects and allow a missing `0x`-prefix
+ if (bytecode instanceof Uint8Array) {
+ bytecode = (0, index_js_3.hexlify)((0, index_js_3.getBytes)(bytecode));
+ }
+ else {
+ if (typeof (bytecode) === "object") {
+ bytecode = bytecode.object;
+ }
+ if (!bytecode.startsWith("0x")) {
+ bytecode = "0x" + bytecode;
+ }
+ bytecode = (0, index_js_3.hexlify)((0, index_js_3.getBytes)(bytecode));
+ }
+ (0, index_js_3.defineProperties)(this, {
+ bytecode, interface: iface, runner: (runner || null)
+ });
+ }
+ attach(target) {
+ return new contract_js_1.BaseContract(target, this.interface, this.runner);
+ }
+ /**
+ * Resolves to the transaction to deploy the contract, passing %%args%%
+ * into the constructor.
+ */
+ getDeployTransaction(...args) {
+ return __awaiter(this, void 0, void 0, function* () {
+ let overrides = {};
+ const fragment = this.interface.deploy;
+ if (fragment.inputs.length + 1 === args.length) {
+ overrides = yield (0, contract_js_1.copyOverrides)(args.pop());
+ }
+ if (fragment.inputs.length !== args.length) {
+ throw new Error("incorrect number of arguments to constructor");
+ }
+ const resolvedArgs = yield (0, contract_js_1.resolveArgs)(this.runner, fragment.inputs, args);
+ const data = (0, index_js_3.concat)([this.bytecode, this.interface.encodeDeploy(resolvedArgs)]);
+ return Object.assign({}, overrides, { data });
+ });
+ }
+ /**
+ * Resolves to the Contract deployed by passing %%args%% into the
+ * constructor.
+ *
+ * This will resovle to the Contract before it has been deployed to the
+ * network, so the [[BaseContract-waitForDeployment]] should be used before
+ * sending any transactions to it.
+ */
+ deploy(...args) {
+ return __awaiter(this, void 0, void 0, function* () {
+ const tx = yield this.getDeployTransaction(...args);
+ (0, index_js_3.assert)(this.runner && typeof (this.runner.sendTransaction) === "function", "factory runner does not support sending transactions", "UNSUPPORTED_OPERATION", {
+ operation: "sendTransaction"
+ });
+ const sentTx = yield this.runner.sendTransaction(tx);
+ const address = (0, index_js_2.getCreateAddress)(sentTx);
+ return new contract_js_1.BaseContract(address, this.interface, this.runner, sentTx);
+ });
+ }
+ /**
+ * Return a new **ContractFactory** with the same ABI and bytecode,
+ * but connected to %%runner%%.
+ */
+ connect(runner) {
+ return new ContractFactory(this.interface, this.bytecode, runner);
+ }
+ /**
+ * Create a new **ContractFactory** from the standard Solidity JSON output.
+ */
+ static fromSolidity(output, runner) {
+ (0, index_js_3.assertArgument)(output != null, "bad compiler output", "output", output);
+ if (typeof (output) === "string") {
+ output = JSON.parse(output);
+ }
+ const abi = output.abi;
+ let bytecode = "";
+ if (output.bytecode) {
+ bytecode = output.bytecode;
+ }
+ else if (output.evm && output.evm.bytecode) {
+ bytecode = output.evm.bytecode;
+ }
+ return new this(abi, bytecode, runner);
+ }
+}
+exports.ContractFactory = ContractFactory;
+//# sourceMappingURL=factory.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/contract/factory.js.map b/dist/ethers.js/src.ts/contract/factory.js.map
new file mode 100644
index 0000000..4dd7760
--- /dev/null
+++ b/dist/ethers.js/src.ts/contract/factory.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"factory.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/contract/factory.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,8CAA4C;AAC5C,kDAAuD;AACvD,gDAG2B;AAE3B,+CAAyE;AAazE,mCAAmC;AACnC,sCAAsC;AAEtC;;GAEG;AACH,MAAa,eAAe;IAiBxB;;;;;;OAMG;IACH,YAAY,GAA6B,EAAE,QAAwC,EAAE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BAAc,EAAC,MAAM,IAAI,IAAI,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;QAExE,IAAI,OAAM,CAAC,MAAM,CAAC,KAAK,QAAQ,EAAE;YAAE,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;SAAE;QAEjE,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;QAEvB,IAAI,QAAQ,GAAG,EAAE,CAAC;QAClB,IAAI,MAAM,CAAC,QAAQ,EAAE;YACjB,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;SAC9B;aAAM,IAAI,MAAM,CAAC,GAAG,IAAI,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE;YAC1C,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;SAClC;QAED,OAAO,IAAI,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC3C,CAAC;CACJ;AAnHD,0CAmHC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/contract/index.d.ts b/dist/ethers.js/src.ts/contract/index.d.ts
new file mode 100644
index 0000000..b7f2c81
--- /dev/null
+++ b/dist/ethers.js/src.ts/contract/index.d.ts
@@ -0,0 +1,13 @@
+/**
+ * A **Contract** object is a meta-class (a class whose definition is
+ * defined at runtime), which communicates with a deployed smart contract
+ * on the blockchain and provides a simple JavaScript interface to call
+ * methods, send transaction, query historic logs and listen for its events.
+ *
+ * @_section: api/contract:Contracts [about-contracts]
+ */
+export { BaseContract, Contract } from "./contract.js";
+export { ContractFactory } from "./factory.js";
+export { ContractEventPayload, ContractUnknownEventPayload, ContractTransactionReceipt, ContractTransactionResponse, EventLog, UndecodedEventLog } from "./wrappers.js";
+export type { BaseContractMethod, ConstantContractMethod, PostfixOverrides, ContractEvent, ContractEventArgs, ContractEventName, ContractDeployTransaction, ContractInterface, ContractMethod, ContractMethodArgs, ContractTransaction, DeferredTopicFilter, Overrides, WrappedFallback } from "./types.js";
+//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/contract/index.d.ts.map b/dist/ethers.js/src.ts/contract/index.d.ts.map
new file mode 100644
index 0000000..953a24b
--- /dev/null
+++ b/dist/ethers.js/src.ts/contract/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/contract/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACH,YAAY,EAAE,QAAQ,EACzB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACH,eAAe,EAClB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACH,oBAAoB,EAAE,2BAA2B,EACjD,0BAA0B,EAAE,2BAA2B,EACvD,QAAQ,EAAE,iBAAiB,EAC9B,MAAM,eAAe,CAAC;AAEvB,YAAY,EACR,kBAAkB,EAAE,sBAAsB,EAC1C,gBAAgB,EAChB,aAAa,EAAE,iBAAiB,EAAE,iBAAiB,EACnD,yBAAyB,EACzB,iBAAiB,EAAE,cAAc,EAAE,kBAAkB,EAAE,mBAAmB,EAC1E,mBAAmB,EAAE,SAAS,EAC9B,eAAe,EAClB,MAAM,YAAY,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/contract/index.js b/dist/ethers.js/src.ts/contract/index.js
new file mode 100644
index 0000000..331b92f
--- /dev/null
+++ b/dist/ethers.js/src.ts/contract/index.js
@@ -0,0 +1,24 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.UndecodedEventLog = exports.EventLog = exports.ContractTransactionResponse = exports.ContractTransactionReceipt = exports.ContractUnknownEventPayload = exports.ContractEventPayload = exports.ContractFactory = exports.Contract = exports.BaseContract = void 0;
+/**
+ * A **Contract** object is a meta-class (a class whose definition is
+ * defined at runtime), which communicates with a deployed smart contract
+ * on the blockchain and provides a simple JavaScript interface to call
+ * methods, send transaction, query historic logs and listen for its events.
+ *
+ * @_section: api/contract:Contracts [about-contracts]
+ */
+var contract_js_1 = require("./contract.js");
+Object.defineProperty(exports, "BaseContract", { enumerable: true, get: function () { return contract_js_1.BaseContract; } });
+Object.defineProperty(exports, "Contract", { enumerable: true, get: function () { return contract_js_1.Contract; } });
+var factory_js_1 = require("./factory.js");
+Object.defineProperty(exports, "ContractFactory", { enumerable: true, get: function () { return factory_js_1.ContractFactory; } });
+var wrappers_js_1 = require("./wrappers.js");
+Object.defineProperty(exports, "ContractEventPayload", { enumerable: true, get: function () { return wrappers_js_1.ContractEventPayload; } });
+Object.defineProperty(exports, "ContractUnknownEventPayload", { enumerable: true, get: function () { return wrappers_js_1.ContractUnknownEventPayload; } });
+Object.defineProperty(exports, "ContractTransactionReceipt", { enumerable: true, get: function () { return wrappers_js_1.ContractTransactionReceipt; } });
+Object.defineProperty(exports, "ContractTransactionResponse", { enumerable: true, get: function () { return wrappers_js_1.ContractTransactionResponse; } });
+Object.defineProperty(exports, "EventLog", { enumerable: true, get: function () { return wrappers_js_1.EventLog; } });
+Object.defineProperty(exports, "UndecodedEventLog", { enumerable: true, get: function () { return wrappers_js_1.UndecodedEventLog; } });
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/contract/index.js.map b/dist/ethers.js/src.ts/contract/index.js.map
new file mode 100644
index 0000000..4172730
--- /dev/null
+++ b/dist/ethers.js/src.ts/contract/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/contract/index.ts"],"names":[],"mappings":";;;AAAA;;;;;;;GAOG;AACH,6CAEuB;AADnB,2GAAA,YAAY,OAAA;AAAE,uGAAA,QAAQ,OAAA;AAG1B,2CAEsB;AADlB,6GAAA,eAAe,OAAA;AAGnB,6CAIuB;AAHnB,mHAAA,oBAAoB,OAAA;AAAE,0HAAA,2BAA2B,OAAA;AACjD,yHAAA,0BAA0B,OAAA;AAAE,0HAAA,2BAA2B,OAAA;AACvD,uGAAA,QAAQ,OAAA;AAAE,gHAAA,iBAAiB,OAAA"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/contract/types.d.ts b/dist/ethers.js/src.ts/contract/types.d.ts
new file mode 100644
index 0000000..79d0f21
--- /dev/null
+++ b/dist/ethers.js/src.ts/contract/types.d.ts
@@ -0,0 +1,193 @@
+import type { EventFragment, FunctionFragment, Result, Typed } from "../abi/index.js";
+import type { TransactionRequest, PreparedTransactionRequest, TopicFilter } from "../providers/index.js";
+import type { ContractTransactionResponse } from "./wrappers.js";
+/**
+ * The name for an event used for subscribing to Contract events.
+ *
+ * **``string``** - An event by name. The event must be non-ambiguous.
+ * The parameters will be dereferenced when passed into the listener.
+ *
+ * [[ContractEvent]] - A filter from the ``contract.filters``, which will
+ * pass only the EventPayload as a single parameter, which includes a
+ * ``.signature`` property that can be used to further filter the event.
+ *
+ * [[TopicFilter]] - A filter defined using the standard Ethereum API
+ * which provides the specific topic hash or topic hashes to watch for along
+ * with any additional values to filter by. This will only pass a single
+ * parameter to the listener, the EventPayload which will include additional
+ * details to refine by, such as the event name and signature.
+ *
+ * [[DeferredTopicFilter]] - A filter created by calling a [[ContractEvent]]
+ * with parameters, which will create a filter for a specific event
+ * signautre and dereference each parameter when calling the listener.
+ */
+export type ContractEventName = string | ContractEvent | TopicFilter | DeferredTopicFilter;
+/**
+ * A Contract with no method constraints.
+ */
+export interface ContractInterface {
+ [name: string]: BaseContractMethod;
+}
+/**
+ * When creating a filter using the ``contract.filters``, this is returned.
+ */
+export interface DeferredTopicFilter {
+ getTopicFilter(): Promise;
+ fragment: EventFragment;
+}
+/**
+ * When populating a transaction this type is returned.
+ */
+export interface ContractTransaction extends PreparedTransactionRequest {
+ /**
+ * The target address.
+ */
+ to: string;
+ /**
+ * The transaction data.
+ */
+ data: string;
+ /**
+ * The from address, if any.
+ */
+ from?: string;
+}
+/**
+ * A deployment transaction for a contract.
+ */
+export interface ContractDeployTransaction extends Omit {
+}
+/**
+ * The overrides for a contract transaction.
+ */
+export interface Overrides extends Omit {
+}
+/**
+ * Arguments to a Contract method can always include an additional and
+ * optional overrides parameter.
+ *
+ * @_ignore:
+ */
+export type PostfixOverrides> = A | [...A, Overrides];
+/**
+ * Arguments to a Contract method can always include an additional and
+ * optional overrides parameter, and each parameter can optionally be
+ * [[Typed]].
+ *
+ * @_ignore:
+ */
+export type ContractMethodArgs> = PostfixOverrides<{
+ [I in keyof A]-?: A[I] | Typed;
+}>;
+/**
+ * A Contract method can be called directly, or used in various ways.
+ */
+export interface BaseContractMethod = Array, R = any, D extends R | ContractTransactionResponse = R | ContractTransactionResponse> {
+ (...args: ContractMethodArgs): Promise;
+ /**
+ * The name of the Contract method.
+ */
+ name: string;
+ /**
+ * The fragment of the Contract method. This will throw on ambiguous
+ * method names.
+ */
+ fragment: FunctionFragment;
+ /**
+ * Returns the fragment constrained by %%args%%. This can be used to
+ * resolve ambiguous method names.
+ */
+ getFragment(...args: ContractMethodArgs): FunctionFragment;
+ /**
+ * Returns a populated transaction that can be used to perform the
+ * contract method with %%args%%.
+ */
+ populateTransaction(...args: ContractMethodArgs): Promise;
+ /**
+ * Call the contract method with %%args%% and return the value.
+ *
+ * If the return value is a single type, it will be dereferenced and
+ * returned directly, otherwise the full Result will be returned.
+ */
+ staticCall(...args: ContractMethodArgs): Promise;
+ /**
+ * Send a transaction for the contract method with %%args%%.
+ */
+ send(...args: ContractMethodArgs): Promise;
+ /**
+ * Estimate the gas to send the contract method with %%args%%.
+ */
+ estimateGas(...args: ContractMethodArgs): Promise;
+ /**
+ * Call the contract method with %%args%% and return the Result
+ * without any dereferencing.
+ */
+ staticCallResult(...args: ContractMethodArgs): Promise;
+}
+/**
+ * A contract method on a Contract.
+ */
+export interface ContractMethod = Array, R = any, D extends R | ContractTransactionResponse = R | ContractTransactionResponse> extends BaseContractMethod {
+}
+/**
+ * A pure of view method on a Contract.
+ */
+export interface ConstantContractMethod, R = any> extends ContractMethod {
+}
+/**
+ * Each argument of an event is nullable (to indicate matching //any//.
+ *
+ * @_ignore:
+ */
+export type ContractEventArgs> = {
+ [I in keyof A]?: A[I] | Typed | null;
+};
+export interface ContractEvent = Array> {
+ (...args: ContractEventArgs): DeferredTopicFilter;
+ /**
+ * The name of the Contract event.
+ */
+ name: string;
+ /**
+ * The fragment of the Contract event. This will throw on ambiguous
+ * method names.
+ */
+ fragment: EventFragment;
+ /**
+ * Returns the fragment constrained by %%args%%. This can be used to
+ * resolve ambiguous event names.
+ */
+ getFragment(...args: ContractEventArgs): EventFragment;
+}
+/**
+ * A Fallback or Receive function on a Contract.
+ */
+export interface WrappedFallback {
+ (overrides?: Omit): Promise;
+ /**
+ * Returns a populated transaction that can be used to perform the
+ * fallback method.
+ *
+ * For non-receive fallback, ``data`` may be overridden.
+ */
+ populateTransaction(overrides?: Omit): Promise;
+ /**
+ * Call the contract fallback and return the result.
+ *
+ * For non-receive fallback, ``data`` may be overridden.
+ */
+ staticCall(overrides?: Omit): Promise;
+ /**
+ * Send a transaction to the contract fallback.
+ *
+ * For non-receive fallback, ``data`` may be overridden.
+ */
+ send(overrides?: Omit): Promise;
+ /**
+ * Estimate the gas to send a transaction to the contract fallback.
+ *
+ * For non-receive fallback, ``data`` may be overridden.
+ */
+ estimateGas(overrides?: Omit): Promise;
+}
+//# sourceMappingURL=types.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/contract/types.d.ts.map b/dist/ethers.js/src.ts/contract/types.d.ts.map
new file mode 100644
index 0000000..672259d
--- /dev/null
+++ b/dist/ethers.js/src.ts/contract/types.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/contract/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,aAAa,EAAE,gBAAgB,EAAE,MAAM,EAAE,KAAK,EACjD,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACR,kBAAkB,EAAE,0BAA0B,EAAE,WAAW,EAC9D,MAAM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I,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;IAEvF;;;;OAIG;IACH,WAAW,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC5E"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/contract/types.js b/dist/ethers.js/src.ts/contract/types.js
new file mode 100644
index 0000000..c132526
--- /dev/null
+++ b/dist/ethers.js/src.ts/contract/types.js
@@ -0,0 +1,6 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+;
+;
+;
+//# sourceMappingURL=types.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/contract/types.js.map b/dist/ethers.js/src.ts/contract/types.js.map
new file mode 100644
index 0000000..5790e2d
--- /dev/null
+++ b/dist/ethers.js/src.ts/contract/types.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/contract/types.ts"],"names":[],"mappings":";;AAqCC,CAAC;AAsC4E,CAAC;AA4H9E,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/contract/wrappers.d.ts b/dist/ethers.js/src.ts/contract/wrappers.d.ts
new file mode 100644
index 0000000..4eab8cf
--- /dev/null
+++ b/dist/ethers.js/src.ts/contract/wrappers.d.ts
@@ -0,0 +1,143 @@
+import { Block, Log, TransactionReceipt, TransactionResponse } from "../providers/provider.js";
+import { EventPayload } from "../utils/index.js";
+import type { EventFragment, Interface, Result } from "../abi/index.js";
+import type { Listener } from "../utils/index.js";
+import type { Provider } from "../providers/index.js";
+import type { BaseContract } from "./contract.js";
+import type { ContractEventName } from "./types.js";
+/**
+ * An **EventLog** contains additional properties parsed from the [[Log]].
+ */
+export declare class EventLog extends Log {
+ /**
+ * The Contract Interface.
+ */
+ readonly interface: Interface;
+ /**
+ * The matching event.
+ */
+ readonly fragment: EventFragment;
+ /**
+ * The parsed arguments passed to the event by ``emit``.
+ */
+ readonly args: Result;
+ /**
+ * @_ignore:
+ */
+ constructor(log: Log, iface: Interface, fragment: EventFragment);
+ /**
+ * The name of the event.
+ */
+ get eventName(): string;
+ /**
+ * The signature of the event.
+ */
+ get eventSignature(): string;
+}
+/**
+ * An **EventLog** contains additional properties parsed from the [[Log]].
+ */
+export declare class UndecodedEventLog extends Log {
+ /**
+ * The error encounted when trying to decode the log.
+ */
+ readonly error: Error;
+ /**
+ * @_ignore:
+ */
+ constructor(log: Log, error: Error);
+}
+/**
+ * A **ContractTransactionReceipt** includes the parsed logs from a
+ * [[TransactionReceipt]].
+ */
+export declare class ContractTransactionReceipt extends TransactionReceipt {
+ #private;
+ /**
+ * @_ignore:
+ */
+ constructor(iface: Interface, provider: Provider, tx: TransactionReceipt);
+ /**
+ * The parsed logs for any [[Log]] which has a matching event in the
+ * Contract ABI.
+ */
+ get logs(): Array;
+}
+/**
+ * A **ContractTransactionResponse** will return a
+ * [[ContractTransactionReceipt]] when waited on.
+ */
+export declare class ContractTransactionResponse extends TransactionResponse {
+ #private;
+ /**
+ * @_ignore:
+ */
+ constructor(iface: Interface, provider: Provider, tx: TransactionResponse);
+ /**
+ * Resolves once this transaction has been mined and has
+ * %%confirms%% blocks including it (default: ``1``) with an
+ * optional %%timeout%%.
+ *
+ * This can resolve to ``null`` only if %%confirms%% is ``0``
+ * and the transaction has not been mined, otherwise this will
+ * wait until enough confirmations have completed.
+ */
+ wait(confirms?: number): Promise;
+}
+/**
+ * A **ContractUnknownEventPayload** is included as the last parameter to
+ * Contract Events when the event does not match any events in the ABI.
+ */
+export declare class ContractUnknownEventPayload extends EventPayload {
+ /**
+ * The log with no matching events.
+ */
+ readonly log: Log;
+ /**
+ * @_event:
+ */
+ constructor(contract: BaseContract, listener: null | Listener, filter: ContractEventName, log: Log);
+ /**
+ * Resolves to the block the event occured in.
+ */
+ getBlock(): Promise;
+ /**
+ * Resolves to the transaction the event occured in.
+ */
+ getTransaction(): Promise;
+ /**
+ * Resolves to the transaction receipt the event occured in.
+ */
+ getTransactionReceipt(): Promise;
+}
+/**
+ * A **ContractEventPayload** is included as the last parameter to
+ * Contract Events when the event is known.
+ */
+export declare class ContractEventPayload extends ContractUnknownEventPayload {
+ /**
+ * The matching event.
+ */
+ readonly fragment: EventFragment;
+ /**
+ * The log, with parsed properties.
+ */
+ readonly log: EventLog;
+ /**
+ * The parsed arguments passed to the event by ``emit``.
+ */
+ readonly args: Result;
+ /**
+ * @_ignore:
+ */
+ constructor(contract: BaseContract, listener: null | Listener, filter: ContractEventName, fragment: EventFragment, _log: Log);
+ /**
+ * The event name.
+ */
+ get eventName(): string;
+ /**
+ * The event signature.
+ */
+ get eventSignature(): string;
+}
+//# sourceMappingURL=wrappers.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/contract/wrappers.d.ts.map b/dist/ethers.js/src.ts/contract/wrappers.d.ts.map
new file mode 100644
index 0000000..7e36684
--- /dev/null
+++ b/dist/ethers.js/src.ts/contract/wrappers.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"wrappers.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/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;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,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"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/contract/wrappers.js b/dist/ethers.js/src.ts/contract/wrappers.js
new file mode 100644
index 0000000..3555308
--- /dev/null
+++ b/dist/ethers.js/src.ts/contract/wrappers.js
@@ -0,0 +1,200 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
+ if (kind === "m") throw new TypeError("Private method is not writable");
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
+};
+var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
+};
+var _ContractTransactionReceipt_iface, _ContractTransactionResponse_iface;
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.ContractEventPayload = exports.ContractUnknownEventPayload = exports.ContractTransactionResponse = exports.ContractTransactionReceipt = exports.UndecodedEventLog = exports.EventLog = void 0;
+// import from provider.ts instead of index.ts to prevent circular dep
+// from EtherscanProvider
+const provider_js_1 = require("../providers/provider.js");
+const index_js_1 = require("../utils/index.js");
+/**
+ * An **EventLog** contains additional properties parsed from the [[Log]].
+ */
+class EventLog extends provider_js_1.Log {
+ /**
+ * @_ignore:
+ */
+ constructor(log, iface, fragment) {
+ super(log, log.provider);
+ const args = iface.decodeEventLog(fragment, log.data, log.topics);
+ (0, index_js_1.defineProperties)(this, { args, fragment, interface: iface });
+ }
+ /**
+ * The name of the event.
+ */
+ get eventName() { return this.fragment.name; }
+ /**
+ * The signature of the event.
+ */
+ get eventSignature() { return this.fragment.format(); }
+}
+exports.EventLog = EventLog;
+/**
+ * An **EventLog** contains additional properties parsed from the [[Log]].
+ */
+class UndecodedEventLog extends provider_js_1.Log {
+ /**
+ * @_ignore:
+ */
+ constructor(log, error) {
+ super(log, log.provider);
+ (0, index_js_1.defineProperties)(this, { error });
+ }
+}
+exports.UndecodedEventLog = UndecodedEventLog;
+/**
+ * A **ContractTransactionReceipt** includes the parsed logs from a
+ * [[TransactionReceipt]].
+ */
+class ContractTransactionReceipt extends provider_js_1.TransactionReceipt {
+ /**
+ * @_ignore:
+ */
+ constructor(iface, provider, tx) {
+ super(tx, provider);
+ _ContractTransactionReceipt_iface.set(this, void 0);
+ __classPrivateFieldSet(this, _ContractTransactionReceipt_iface, iface, "f");
+ }
+ /**
+ * The parsed logs for any [[Log]] which has a matching event in the
+ * Contract ABI.
+ */
+ get logs() {
+ return super.logs.map((log) => {
+ const fragment = log.topics.length ? __classPrivateFieldGet(this, _ContractTransactionReceipt_iface, "f").getEvent(log.topics[0]) : null;
+ if (fragment) {
+ try {
+ return new EventLog(log, __classPrivateFieldGet(this, _ContractTransactionReceipt_iface, "f"), fragment);
+ }
+ catch (error) {
+ return new UndecodedEventLog(log, error);
+ }
+ }
+ return log;
+ });
+ }
+}
+exports.ContractTransactionReceipt = ContractTransactionReceipt;
+_ContractTransactionReceipt_iface = new WeakMap();
+/**
+ * A **ContractTransactionResponse** will return a
+ * [[ContractTransactionReceipt]] when waited on.
+ */
+class ContractTransactionResponse extends provider_js_1.TransactionResponse {
+ /**
+ * @_ignore:
+ */
+ constructor(iface, provider, tx) {
+ super(tx, provider);
+ _ContractTransactionResponse_iface.set(this, void 0);
+ __classPrivateFieldSet(this, _ContractTransactionResponse_iface, iface, "f");
+ }
+ /**
+ * Resolves once this transaction has been mined and has
+ * %%confirms%% blocks including it (default: ``1``) with an
+ * optional %%timeout%%.
+ *
+ * This can resolve to ``null`` only if %%confirms%% is ``0``
+ * and the transaction has not been mined, otherwise this will
+ * wait until enough confirmations have completed.
+ */
+ wait(confirms) {
+ const _super = Object.create(null, {
+ wait: { get: () => super.wait }
+ });
+ return __awaiter(this, void 0, void 0, function* () {
+ const receipt = yield _super.wait.call(this, confirms);
+ if (receipt == null) {
+ return null;
+ }
+ return new ContractTransactionReceipt(__classPrivateFieldGet(this, _ContractTransactionResponse_iface, "f"), this.provider, receipt);
+ });
+ }
+}
+exports.ContractTransactionResponse = ContractTransactionResponse;
+_ContractTransactionResponse_iface = new WeakMap();
+/**
+ * A **ContractUnknownEventPayload** is included as the last parameter to
+ * Contract Events when the event does not match any events in the ABI.
+ */
+class ContractUnknownEventPayload extends index_js_1.EventPayload {
+ /**
+ * @_event:
+ */
+ constructor(contract, listener, filter, log) {
+ super(contract, listener, filter);
+ (0, index_js_1.defineProperties)(this, { log });
+ }
+ /**
+ * Resolves to the block the event occured in.
+ */
+ getBlock() {
+ return __awaiter(this, void 0, void 0, function* () {
+ return yield this.log.getBlock();
+ });
+ }
+ /**
+ * Resolves to the transaction the event occured in.
+ */
+ getTransaction() {
+ return __awaiter(this, void 0, void 0, function* () {
+ return yield this.log.getTransaction();
+ });
+ }
+ /**
+ * Resolves to the transaction receipt the event occured in.
+ */
+ getTransactionReceipt() {
+ return __awaiter(this, void 0, void 0, function* () {
+ return yield this.log.getTransactionReceipt();
+ });
+ }
+}
+exports.ContractUnknownEventPayload = ContractUnknownEventPayload;
+/**
+ * A **ContractEventPayload** is included as the last parameter to
+ * Contract Events when the event is known.
+ */
+class ContractEventPayload extends ContractUnknownEventPayload {
+ /**
+ * @_ignore:
+ */
+ constructor(contract, listener, filter, fragment, _log) {
+ super(contract, listener, filter, new EventLog(_log, contract.interface, fragment));
+ const args = contract.interface.decodeEventLog(fragment, this.log.data, this.log.topics);
+ (0, index_js_1.defineProperties)(this, { args, fragment });
+ }
+ /**
+ * The event name.
+ */
+ get eventName() {
+ return this.fragment.name;
+ }
+ /**
+ * The event signature.
+ */
+ get eventSignature() {
+ return this.fragment.format();
+ }
+}
+exports.ContractEventPayload = ContractEventPayload;
+//# sourceMappingURL=wrappers.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/contract/wrappers.js.map b/dist/ethers.js/src.ts/contract/wrappers.js.map
new file mode 100644
index 0000000..ca096f1
--- /dev/null
+++ b/dist/ethers.js/src.ts/contract/wrappers.js.map
@@ -0,0 +1 @@
+{"version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AAC,MAAM,EAAE,CAAC;IAClC,CAAC;CACJ;AAvCD,oDAuCC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/crypto-browser.d.ts b/dist/ethers.js/src.ts/crypto/crypto-browser.d.ts
new file mode 100644
index 0000000..ba0bbf1
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/crypto-browser.d.ts
@@ -0,0 +1,15 @@
+declare global {
+ interface Window {
+ }
+ const window: Window;
+ const self: Window;
+}
+export interface CryptoHasher {
+ update(data: Uint8Array): CryptoHasher;
+ digest(): Uint8Array;
+}
+export declare function createHash(algo: string): CryptoHasher;
+export declare function createHmac(_algo: string, key: Uint8Array): CryptoHasher;
+export declare function pbkdf2Sync(password: Uint8Array, salt: Uint8Array, iterations: number, keylen: number, _algo: "sha256" | "sha512"): Uint8Array;
+export declare function randomBytes(length: number): Uint8Array;
+//# sourceMappingURL=crypto-browser.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/crypto-browser.d.ts.map b/dist/ethers.js/src.ts/crypto/crypto-browser.d.ts.map
new file mode 100644
index 0000000..774294c
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/crypto-browser.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"crypto-browser.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/crypto/crypto-browser.ts"],"names":[],"mappings":"AAUA,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;KAAI;IAEpB,MAAM,MAAM,EAAE,MAAM,CAAC;IACrB,MAAM,IAAI,EAAE,MAAM,CAAC;CACtB;AAcD,MAAM,WAAW,YAAY;IACzB,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,YAAY,CAAC;IACvC,MAAM,IAAI,UAAU,CAAC;CACxB;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAMrD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,GAAG,YAAY,CAIvE;AAED,wBAAgB,UAAU,CAAC,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAI7I;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAStD"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/crypto-browser.js b/dist/ethers.js/src.ts/crypto/crypto-browser.js
new file mode 100644
index 0000000..69e20e6
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/crypto-browser.js
@@ -0,0 +1,55 @@
+"use strict";
+/* Browser Crypto Shims */
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.randomBytes = exports.pbkdf2Sync = exports.createHmac = exports.createHash = void 0;
+const hmac_1 = require("@noble/hashes/hmac");
+const pbkdf2_1 = require("@noble/hashes/pbkdf2");
+const sha256_1 = require("@noble/hashes/sha256");
+const sha512_1 = require("@noble/hashes/sha512");
+const index_js_1 = require("../utils/index.js");
+function getGlobal() {
+ if (typeof self !== 'undefined') {
+ return self;
+ }
+ if (typeof window !== 'undefined') {
+ return window;
+ }
+ if (typeof global !== 'undefined') {
+ return global;
+ }
+ throw new Error('unable to locate global object');
+}
+;
+const anyGlobal = getGlobal();
+const crypto = anyGlobal.crypto || anyGlobal.msCrypto;
+function createHash(algo) {
+ switch (algo) {
+ case "sha256": return sha256_1.sha256.create();
+ case "sha512": return sha512_1.sha512.create();
+ }
+ (0, index_js_1.assertArgument)(false, "invalid hashing algorithm name", "algorithm", algo);
+}
+exports.createHash = createHash;
+function createHmac(_algo, key) {
+ const algo = ({ sha256: sha256_1.sha256, sha512: sha512_1.sha512 }[_algo]);
+ (0, index_js_1.assertArgument)(algo != null, "invalid hmac algorithm", "algorithm", _algo);
+ return hmac_1.hmac.create(algo, key);
+}
+exports.createHmac = createHmac;
+function pbkdf2Sync(password, salt, iterations, keylen, _algo) {
+ const algo = ({ sha256: sha256_1.sha256, sha512: sha512_1.sha512 }[_algo]);
+ (0, index_js_1.assertArgument)(algo != null, "invalid pbkdf2 algorithm", "algorithm", _algo);
+ return (0, pbkdf2_1.pbkdf2)(algo, password, salt, { c: iterations, dkLen: keylen });
+}
+exports.pbkdf2Sync = pbkdf2Sync;
+function randomBytes(length) {
+ (0, index_js_1.assert)(crypto != null, "platform does not support secure random numbers", "UNSUPPORTED_OPERATION", {
+ operation: "randomBytes"
+ });
+ (0, index_js_1.assertArgument)(Number.isInteger(length) && length > 0 && length <= 1024, "invalid length", "length", length);
+ const result = new Uint8Array(length);
+ crypto.getRandomValues(result);
+ return result;
+}
+exports.randomBytes = randomBytes;
+//# sourceMappingURL=crypto-browser.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/crypto-browser.js.map b/dist/ethers.js/src.ts/crypto/crypto-browser.js.map
new file mode 100644
index 0000000..89332cc
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/crypto-browser.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"crypto-browser.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/crypto/crypto-browser.ts"],"names":[],"mappings":";AAAA,0BAA0B;;;AAE1B,6CAA0C;AAC1C,iDAA8C;AAC9C,iDAA8C;AAC9C,iDAA8C;AAE9C,gDAA2D;AAW3D,SAAS,SAAS;IAChB,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;QAAE,OAAO,IAAI,CAAC;KAAE;IACjD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QAAE,OAAO,MAAM,CAAC;KAAE;IACrD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QAAE,OAAO,MAAM,CAAC;KAAE;IACrD,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;AACpD,CAAC;AAAA,CAAC;AAEF,MAAM,SAAS,GAAG,SAAS,EAAE,CAAC;AAC9B,MAAM,MAAM,GAAQ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DAAiD,EAAE,uBAAuB,EAAE;QAC/F,SAAS,EAAE,aAAa;KAAE,CAAC,CAAC;IAEhC,IAAA,yBAAc,EAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,IAAI,MAAM,IAAI,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAE7G,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;IACtC,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;IAC/B,OAAO,MAAM,CAAC;AAClB,CAAC;AATD,kCASC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/crypto.d.ts b/dist/ethers.js/src.ts/crypto/crypto.d.ts
new file mode 100644
index 0000000..e9c555d
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/crypto.d.ts
@@ -0,0 +1,2 @@
+export { createHash, createHmac, pbkdf2Sync, randomBytes } from "crypto";
+//# sourceMappingURL=crypto.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/crypto.d.ts.map b/dist/ethers.js/src.ts/crypto/crypto.d.ts.map
new file mode 100644
index 0000000..cc222e0
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/crypto.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/crypto/crypto.ts"],"names":[],"mappings":"AACA,OAAO,EACH,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAClD,MAAM,QAAQ,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/crypto.js b/dist/ethers.js/src.ts/crypto/crypto.js
new file mode 100644
index 0000000..31e54d5
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/crypto.js
@@ -0,0 +1,9 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.randomBytes = exports.pbkdf2Sync = exports.createHmac = exports.createHash = void 0;
+var crypto_1 = require("crypto");
+Object.defineProperty(exports, "createHash", { enumerable: true, get: function () { return crypto_1.createHash; } });
+Object.defineProperty(exports, "createHmac", { enumerable: true, get: function () { return crypto_1.createHmac; } });
+Object.defineProperty(exports, "pbkdf2Sync", { enumerable: true, get: function () { return crypto_1.pbkdf2Sync; } });
+Object.defineProperty(exports, "randomBytes", { enumerable: true, get: function () { return crypto_1.randomBytes; } });
+//# sourceMappingURL=crypto.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/crypto.js.map b/dist/ethers.js/src.ts/crypto/crypto.js.map
new file mode 100644
index 0000000..c20843e
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/crypto.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"crypto.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/crypto/crypto.ts"],"names":[],"mappings":";;;AACA,iCAEgB;AADZ,oGAAA,UAAU,OAAA;AAAE,oGAAA,UAAU,OAAA;AAAE,oGAAA,UAAU,OAAA;AAAE,qGAAA,WAAW,OAAA"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/hmac.d.ts b/dist/ethers.js/src.ts/crypto/hmac.d.ts
new file mode 100644
index 0000000..4c5e322
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/hmac.d.ts
@@ -0,0 +1,25 @@
+import type { BytesLike } from "../utils/index.js";
+/**
+ * Return the HMAC for %%data%% using the %%key%% key with the underlying
+ * %%algo%% used for compression.
+ *
+ * @example:
+ * key = id("some-secret")
+ *
+ * // Compute the HMAC
+ * computeHmac("sha256", key, "0x1337")
+ * //_result:
+ *
+ * // To compute the HMAC of UTF-8 data, the data must be
+ * // converted to UTF-8 bytes
+ * computeHmac("sha256", key, toUtf8Bytes("Hello World"))
+ * //_result:
+ *
+ */
+export declare function computeHmac(algorithm: "sha256" | "sha512", _key: BytesLike, _data: BytesLike): string;
+export declare namespace computeHmac {
+ var _: (algorithm: "sha256" | "sha512", key: Uint8Array, data: Uint8Array) => BytesLike;
+ var lock: () => void;
+ var register: (func: (algorithm: "sha256" | "sha512", key: Uint8Array, data: Uint8Array) => BytesLike) => void;
+}
+//# sourceMappingURL=hmac.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/hmac.d.ts.map b/dist/ethers.js/src.ts/crypto/hmac.d.ts.map
new file mode 100644
index 0000000..01c6d1d
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/hmac.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"hmac.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/crypto/hmac.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAWnD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,QAAQ,GAAG,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,GAAG,MAAM,CAIrG;yBAJe,WAAW"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/hmac.js b/dist/ethers.js/src.ts/crypto/hmac.js
new file mode 100644
index 0000000..a13ef91
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/hmac.js
@@ -0,0 +1,51 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.computeHmac = void 0;
+/**
+ * An **HMAC** enables verification that a given key was used
+ * to authenticate a payload.
+ *
+ * See: [[link-wiki-hmac]]
+ *
+ * @_subsection: api/crypto:HMAC [about-hmac]
+ */
+const crypto_js_1 = require("./crypto.js");
+const index_js_1 = require("../utils/index.js");
+let locked = false;
+const _computeHmac = function (algorithm, key, data) {
+ return (0, crypto_js_1.createHmac)(algorithm, key).update(data).digest();
+};
+let __computeHmac = _computeHmac;
+/**
+ * Return the HMAC for %%data%% using the %%key%% key with the underlying
+ * %%algo%% used for compression.
+ *
+ * @example:
+ * key = id("some-secret")
+ *
+ * // Compute the HMAC
+ * computeHmac("sha256", key, "0x1337")
+ * //_result:
+ *
+ * // To compute the HMAC of UTF-8 data, the data must be
+ * // converted to UTF-8 bytes
+ * computeHmac("sha256", key, toUtf8Bytes("Hello World"))
+ * //_result:
+ *
+ */
+function computeHmac(algorithm, _key, _data) {
+ const key = (0, index_js_1.getBytes)(_key, "key");
+ const data = (0, index_js_1.getBytes)(_data, "data");
+ return (0, index_js_1.hexlify)(__computeHmac(algorithm, key, data));
+}
+exports.computeHmac = computeHmac;
+computeHmac._ = _computeHmac;
+computeHmac.lock = function () { locked = true; };
+computeHmac.register = function (func) {
+ if (locked) {
+ throw new Error("computeHmac is locked");
+ }
+ __computeHmac = func;
+};
+Object.freeze(computeHmac);
+//# sourceMappingURL=hmac.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/hmac.js.map b/dist/ethers.js/src.ts/crypto/hmac.js.map
new file mode 100644
index 0000000..53431bf
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/hmac.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"hmac.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/crypto/hmac.ts"],"names":[],"mappings":";;;AAAA;;;;;;;GAOG;AACH,2CAAyC;AACzC,gDAAsD;AAKtD,IAAI,MAAM,GAAG,KAAK,CAAC;AAEnB,MAAM,YAAY,GAAG,UAAS,SAA8B,EAAE,GAAe,EAAE,IAAgB;IAC3F,OAAO,IAAA,sBAAU,EAAC,SAAS,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;AAC5D,CAAC,CAAA;AAED,IAAI,aAAa,GAAG,YAAY,CAAC;AAEjC;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,WAAW,CAAC,SAA8B,EAAE,IAAe,EAAE,KAAgB;IACzF,MAAM,GAAG,GAAG,IAAA,mBAAQ,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAClC,MAAM,IAAI,GAAG,IAAA,mBAAQ,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,IAAA,kBAAO,EAAC,aAAa,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;AACxD,CAAC;AAJD,kCAIC;AACD,WAAW,CAAC,CAAC,GAAG,YAAY,CAAC;AAC7B,WAAW,CAAC,IAAI,GAAI,cAAa,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;AACjD,WAAW,CAAC,QAAQ,GAAG,UAAS,IAAsF;IAClH,IAAI,MAAM,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;KAAE;IACzD,aAAa,GAAG,IAAI,CAAC;AACzB,CAAC,CAAA;AACD,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/index.d.ts b/dist/ethers.js/src.ts/crypto/index.d.ts
new file mode 100644
index 0000000..8d6bc56
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/index.d.ts
@@ -0,0 +1,25 @@
+/**
+ * A fundamental building block of Ethereum is the underlying
+ * cryptographic primitives.
+ *
+ * @_section: api/crypto:Cryptographic Functions [about-crypto]
+ */
+import { computeHmac } from "./hmac.js";
+import { keccak256 } from "./keccak.js";
+import { ripemd160 } from "./ripemd160.js";
+import { pbkdf2 } from "./pbkdf2.js";
+import { randomBytes } from "./random.js";
+import { scrypt, scryptSync } from "./scrypt.js";
+import { sha256, sha512 } from "./sha2.js";
+export { computeHmac, randomBytes, keccak256, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync };
+export { SigningKey } from "./signing-key.js";
+export { Signature } from "./signature.js";
+/**
+ * Once called, prevents any future change to the underlying cryptographic
+ * primitives using the ``.register`` feature for hooks.
+ */
+declare function lock(): void;
+export { lock };
+export type { ProgressCallback } from "./scrypt.js";
+export type { SignatureLike } from "./signature.js";
+//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/index.d.ts.map b/dist/ethers.js/src.ts/crypto/index.d.ts.map
new file mode 100644
index 0000000..87fdba4
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/crypto/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EACH,WAAW,EAEX,WAAW,EAEX,SAAS,EACT,SAAS,EACT,MAAM,EAAE,MAAM,EAEd,MAAM,EACN,MAAM,EAAE,UAAU,EACrB,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C;;;GAGG;AACH,iBAAS,IAAI,IAAI,IAAI,CAWpB;AAED,OAAO,EAAE,IAAI,EAAE,CAAC;AAKhB,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/index.js b/dist/ethers.js/src.ts/crypto/index.js
new file mode 100644
index 0000000..39a4b35
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/index.js
@@ -0,0 +1,49 @@
+"use strict";
+/**
+ * A fundamental building block of Ethereum is the underlying
+ * cryptographic primitives.
+ *
+ * @_section: api/crypto:Cryptographic Functions [about-crypto]
+ */
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.lock = exports.Signature = exports.SigningKey = exports.scryptSync = exports.scrypt = exports.pbkdf2 = exports.sha512 = exports.sha256 = exports.ripemd160 = exports.keccak256 = exports.randomBytes = exports.computeHmac = void 0;
+null;
+// We import all these so we can export lock()
+const hmac_js_1 = require("./hmac.js");
+Object.defineProperty(exports, "computeHmac", { enumerable: true, get: function () { return hmac_js_1.computeHmac; } });
+const keccak_js_1 = require("./keccak.js");
+Object.defineProperty(exports, "keccak256", { enumerable: true, get: function () { return keccak_js_1.keccak256; } });
+const ripemd160_js_1 = require("./ripemd160.js");
+Object.defineProperty(exports, "ripemd160", { enumerable: true, get: function () { return ripemd160_js_1.ripemd160; } });
+const pbkdf2_js_1 = require("./pbkdf2.js");
+Object.defineProperty(exports, "pbkdf2", { enumerable: true, get: function () { return pbkdf2_js_1.pbkdf2; } });
+const random_js_1 = require("./random.js");
+Object.defineProperty(exports, "randomBytes", { enumerable: true, get: function () { return random_js_1.randomBytes; } });
+const scrypt_js_1 = require("./scrypt.js");
+Object.defineProperty(exports, "scrypt", { enumerable: true, get: function () { return scrypt_js_1.scrypt; } });
+Object.defineProperty(exports, "scryptSync", { enumerable: true, get: function () { return scrypt_js_1.scryptSync; } });
+const sha2_js_1 = require("./sha2.js");
+Object.defineProperty(exports, "sha256", { enumerable: true, get: function () { return sha2_js_1.sha256; } });
+Object.defineProperty(exports, "sha512", { enumerable: true, get: function () { return sha2_js_1.sha512; } });
+var signing_key_js_1 = require("./signing-key.js");
+Object.defineProperty(exports, "SigningKey", { enumerable: true, get: function () { return signing_key_js_1.SigningKey; } });
+var signature_js_1 = require("./signature.js");
+Object.defineProperty(exports, "Signature", { enumerable: true, get: function () { return signature_js_1.Signature; } });
+/**
+ * Once called, prevents any future change to the underlying cryptographic
+ * primitives using the ``.register`` feature for hooks.
+ */
+function lock() {
+ hmac_js_1.computeHmac.lock();
+ keccak_js_1.keccak256.lock();
+ pbkdf2_js_1.pbkdf2.lock();
+ random_js_1.randomBytes.lock();
+ ripemd160_js_1.ripemd160.lock();
+ scrypt_js_1.scrypt.lock();
+ scrypt_js_1.scryptSync.lock();
+ sha2_js_1.sha256.lock();
+ sha2_js_1.sha512.lock();
+ random_js_1.randomBytes.lock();
+}
+exports.lock = lock;
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/index.js.map b/dist/ethers.js/src.ts/crypto/index.js.map
new file mode 100644
index 0000000..243bae9
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/crypto/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,IAAI,CAAA;AAEJ,8CAA8C;AAC9C,uCAAwC;AASpC,4FATK,qBAAW,OASL;AARf,2CAAwC;AAYpC,0FAZK,qBAAS,OAYL;AAXb,iDAA2C;AAYvC,0FAZK,wBAAS,OAYL;AAXb,2CAAqC;AAcjC,uFAdK,kBAAM,OAcL;AAbV,2CAA0C;AAOtC,4FAPK,uBAAW,OAOL;AANf,2CAAiD;AAa7C,uFAbK,kBAAM,OAaL;AAAE,2FAbK,sBAAU,OAaL;AAZtB,uCAA2C;AASvC,uFATK,gBAAM,OASL;AAAE,uFATK,gBAAM,OASL;AAMlB,mDAA8C;AAArC,4GAAA,UAAU,OAAA;AACnB,+CAA2C;AAAlC,yGAAA,SAAS,OAAA;AAElB;;;GAGG;AACH,SAAS,IAAI;IACT,qBAAW,CAAC,IAAI,EAAE,CAAC;IACnB,qBAAS,CAAC,IAAI,EAAE,CAAC;IACjB,kBAAM,CAAC,IAAI,EAAE,CAAC;IACd,uBAAW,CAAC,IAAI,EAAE,CAAC;IACnB,wBAAS,CAAC,IAAI,EAAE,CAAC;IACjB,kBAAM,CAAC,IAAI,EAAE,CAAC;IACd,sBAAU,CAAC,IAAI,EAAE,CAAC;IAClB,gBAAM,CAAC,IAAI,EAAE,CAAC;IACd,gBAAM,CAAC,IAAI,EAAE,CAAC;IACd,uBAAW,CAAC,IAAI,EAAE,CAAC;AACvB,CAAC;AAEQ,oBAAI"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/keccak.d.ts b/dist/ethers.js/src.ts/crypto/keccak.d.ts
new file mode 100644
index 0000000..533f46d
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/keccak.d.ts
@@ -0,0 +1,35 @@
+/**
+ * Cryptographic hashing functions
+ *
+ * @_subsection: api/crypto:Hash Functions [about-crypto-hashing]
+ */
+import type { BytesLike } from "../utils/index.js";
+/**
+ * Compute the cryptographic KECCAK256 hash of %%data%%.
+ *
+ * The %%data%% **must** be a data representation, to compute the
+ * hash of UTF-8 data use the [[id]] function.
+ *
+ * @returns DataHexstring
+ * @example:
+ * keccak256("0x")
+ * //_result:
+ *
+ * keccak256("0x1337")
+ * //_result:
+ *
+ * keccak256(new Uint8Array([ 0x13, 0x37 ]))
+ * //_result:
+ *
+ * // Strings are assumed to be DataHexString, otherwise it will
+ * // throw. To hash UTF-8 data, see the note above.
+ * keccak256("Hello World")
+ * //_error:
+ */
+export declare function keccak256(_data: BytesLike): string;
+export declare namespace keccak256 {
+ var _: (data: Uint8Array) => Uint8Array;
+ var lock: () => void;
+ var register: (func: (data: Uint8Array) => BytesLike) => void;
+}
+//# sourceMappingURL=keccak.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/keccak.d.ts.map b/dist/ethers.js/src.ts/crypto/keccak.d.ts.map
new file mode 100644
index 0000000..989b19c
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/keccak.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"keccak.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/crypto/keccak.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAWnD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAGlD;yBAHe,SAAS"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/keccak.js b/dist/ethers.js/src.ts/crypto/keccak.js
new file mode 100644
index 0000000..ea51d66
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/keccak.js
@@ -0,0 +1,52 @@
+"use strict";
+/**
+ * Cryptographic hashing functions
+ *
+ * @_subsection: api/crypto:Hash Functions [about-crypto-hashing]
+ */
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.keccak256 = void 0;
+const sha3_1 = require("@noble/hashes/sha3");
+const index_js_1 = require("../utils/index.js");
+let locked = false;
+const _keccak256 = function (data) {
+ return (0, sha3_1.keccak_256)(data);
+};
+let __keccak256 = _keccak256;
+/**
+ * Compute the cryptographic KECCAK256 hash of %%data%%.
+ *
+ * The %%data%% **must** be a data representation, to compute the
+ * hash of UTF-8 data use the [[id]] function.
+ *
+ * @returns DataHexstring
+ * @example:
+ * keccak256("0x")
+ * //_result:
+ *
+ * keccak256("0x1337")
+ * //_result:
+ *
+ * keccak256(new Uint8Array([ 0x13, 0x37 ]))
+ * //_result:
+ *
+ * // Strings are assumed to be DataHexString, otherwise it will
+ * // throw. To hash UTF-8 data, see the note above.
+ * keccak256("Hello World")
+ * //_error:
+ */
+function keccak256(_data) {
+ const data = (0, index_js_1.getBytes)(_data, "data");
+ return (0, index_js_1.hexlify)(__keccak256(data));
+}
+exports.keccak256 = keccak256;
+keccak256._ = _keccak256;
+keccak256.lock = function () { locked = true; };
+keccak256.register = function (func) {
+ if (locked) {
+ throw new TypeError("keccak256 is locked");
+ }
+ __keccak256 = func;
+};
+Object.freeze(keccak256);
+//# sourceMappingURL=keccak.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/keccak.js.map b/dist/ethers.js/src.ts/crypto/keccak.js.map
new file mode 100644
index 0000000..71944ea
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/keccak.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"keccak.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/crypto/keccak.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,6CAAgD;AAEhD,gDAAsD;AAKtD,IAAI,MAAM,GAAG,KAAK,CAAC;AAEnB,MAAM,UAAU,GAAG,UAAS,IAAgB;IACxC,OAAO,IAAA,iBAAU,EAAC,IAAI,CAAC,CAAC;AAC5B,CAAC,CAAA;AAED,IAAI,WAAW,GAAoC,UAAU,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAgB,SAAS,CAAC,KAAgB;IACtC,MAAM,IAAI,GAAG,IAAA,mBAAQ,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,IAAA,kBAAO,EAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;AACtC,CAAC;AAHD,8BAGC;AACD,SAAS,CAAC,CAAC,GAAG,UAAU,CAAC;AACzB,SAAS,CAAC,IAAI,GAAG,cAAmB,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;AACpD,SAAS,CAAC,QAAQ,GAAG,UAAS,IAAqC;IAC/D,IAAI,MAAM,EAAE;QAAE,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAC;KAAE;IAC3D,WAAW,GAAG,IAAI,CAAC;AACvB,CAAC,CAAA;AACD,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/pbkdf2.d.ts b/dist/ethers.js/src.ts/crypto/pbkdf2.d.ts
new file mode 100644
index 0000000..400e974
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/pbkdf2.d.ts
@@ -0,0 +1,35 @@
+/**
+ * A **Password-Based Key-Derivation Function** is designed to create
+ * a sequence of bytes suitible as a **key** from a human-rememberable
+ * password.
+ *
+ * @_subsection: api/crypto:Passwords [about-pbkdf]
+ */
+import type { BytesLike } from "../utils/index.js";
+/**
+ * Return the [[link-pbkdf2]] for %%keylen%% bytes for %%password%% using
+ * the %%salt%% and using %%iterations%% of %%algo%%.
+ *
+ * This PBKDF is outdated and should not be used in new projects, but is
+ * required to decrypt older files.
+ *
+ * @example:
+ * // The password must be converted to bytes, and it is generally
+ * // best practices to ensure the string has been normalized. Many
+ * // formats explicitly indicate the normalization form to use.
+ * password = "hello"
+ * passwordBytes = toUtf8Bytes(password, "NFKC")
+ *
+ * salt = id("some-salt")
+ *
+ * // Compute the PBKDF2
+ * pbkdf2(passwordBytes, salt, 1024, 16, "sha256")
+ * //_result:
+ */
+export declare function pbkdf2(_password: BytesLike, _salt: BytesLike, iterations: number, keylen: number, algo: "sha256" | "sha512"): string;
+export declare namespace pbkdf2 {
+ var _: (password: Uint8Array, salt: Uint8Array, iterations: number, keylen: number, algo: "sha256" | "sha512") => BytesLike;
+ var lock: () => void;
+ var register: (func: (password: Uint8Array, salt: Uint8Array, iterations: number, keylen: number, algo: "sha256" | "sha512") => BytesLike) => void;
+}
+//# sourceMappingURL=pbkdf2.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/pbkdf2.d.ts.map b/dist/ethers.js/src.ts/crypto/pbkdf2.d.ts.map
new file mode 100644
index 0000000..d8c7b12
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/pbkdf2.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"pbkdf2.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/crypto/pbkdf2.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAWnD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,MAAM,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAIpI;yBAJe,MAAM"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/pbkdf2.js b/dist/ethers.js/src.ts/crypto/pbkdf2.js
new file mode 100644
index 0000000..b771a19
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/pbkdf2.js
@@ -0,0 +1,53 @@
+"use strict";
+/**
+ * A **Password-Based Key-Derivation Function** is designed to create
+ * a sequence of bytes suitible as a **key** from a human-rememberable
+ * password.
+ *
+ * @_subsection: api/crypto:Passwords [about-pbkdf]
+ */
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.pbkdf2 = void 0;
+const crypto_js_1 = require("./crypto.js");
+const index_js_1 = require("../utils/index.js");
+let locked = false;
+const _pbkdf2 = function (password, salt, iterations, keylen, algo) {
+ return (0, crypto_js_1.pbkdf2Sync)(password, salt, iterations, keylen, algo);
+};
+let __pbkdf2 = _pbkdf2;
+/**
+ * Return the [[link-pbkdf2]] for %%keylen%% bytes for %%password%% using
+ * the %%salt%% and using %%iterations%% of %%algo%%.
+ *
+ * This PBKDF is outdated and should not be used in new projects, but is
+ * required to decrypt older files.
+ *
+ * @example:
+ * // The password must be converted to bytes, and it is generally
+ * // best practices to ensure the string has been normalized. Many
+ * // formats explicitly indicate the normalization form to use.
+ * password = "hello"
+ * passwordBytes = toUtf8Bytes(password, "NFKC")
+ *
+ * salt = id("some-salt")
+ *
+ * // Compute the PBKDF2
+ * pbkdf2(passwordBytes, salt, 1024, 16, "sha256")
+ * //_result:
+ */
+function pbkdf2(_password, _salt, iterations, keylen, algo) {
+ const password = (0, index_js_1.getBytes)(_password, "password");
+ const salt = (0, index_js_1.getBytes)(_salt, "salt");
+ return (0, index_js_1.hexlify)(__pbkdf2(password, salt, iterations, keylen, algo));
+}
+exports.pbkdf2 = pbkdf2;
+pbkdf2._ = _pbkdf2;
+pbkdf2.lock = function () { locked = true; };
+pbkdf2.register = function (func) {
+ if (locked) {
+ throw new Error("pbkdf2 is locked");
+ }
+ __pbkdf2 = func;
+};
+Object.freeze(pbkdf2);
+//# sourceMappingURL=pbkdf2.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/pbkdf2.js.map b/dist/ethers.js/src.ts/crypto/pbkdf2.js.map
new file mode 100644
index 0000000..c7d04e4
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/pbkdf2.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"pbkdf2.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/crypto/pbkdf2.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,2CAAyC;AAEzC,gDAAsD;AAKtD,IAAI,MAAM,GAAG,KAAK,CAAC;AAEnB,MAAM,OAAO,GAAG,UAAS,QAAoB,EAAE,IAAgB,EAAE,UAAkB,EAAE,MAAc,EAAE,IAAyB;IAC1H,OAAO,IAAA,sBAAU,EAAC,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;AAChE,CAAC,CAAA;AAED,IAAI,QAAQ,GAAG,OAAO,CAAC;AAEvB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,MAAM,CAAC,SAAoB,EAAE,KAAgB,EAAE,UAAkB,EAAE,MAAc,EAAE,IAAyB;IACxH,MAAM,QAAQ,GAAG,IAAA,mBAAQ,EAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IACjD,MAAM,IAAI,GAAG,IAAA,mBAAQ,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,IAAA,kBAAO,EAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;AACvE,CAAC;AAJD,wBAIC;AACD,MAAM,CAAC,CAAC,GAAG,OAAO,CAAC;AACnB,MAAM,CAAC,IAAI,GAAG,cAAmB,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;AACjD,MAAM,CAAC,QAAQ,GAAG,UAAS,IAA0H;IACjJ,IAAI,MAAM,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;KAAE;IACpD,QAAQ,GAAG,IAAI,CAAC;AACpB,CAAC,CAAA;AACD,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/random.d.ts b/dist/ethers.js/src.ts/crypto/random.d.ts
new file mode 100644
index 0000000..fd93780
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/random.d.ts
@@ -0,0 +1,14 @@
+/**
+ * Return %%length%% bytes of cryptographically secure random data.
+ *
+ * @example:
+ * randomBytes(8)
+ * //_result:
+ */
+export declare function randomBytes(length: number): Uint8Array;
+export declare namespace randomBytes {
+ var _: (length: number) => Uint8Array;
+ var lock: () => void;
+ var register: (func: (length: number) => Uint8Array) => void;
+}
+//# sourceMappingURL=random.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/random.d.ts.map b/dist/ethers.js/src.ts/crypto/random.d.ts.map
new file mode 100644
index 0000000..45e1d99
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/random.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/crypto/random.ts"],"names":[],"mappings":"AAkBA;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAEtD;yBAFe,WAAW"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/random.js b/dist/ethers.js/src.ts/crypto/random.js
new file mode 100644
index 0000000..b8e4aca
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/random.js
@@ -0,0 +1,38 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.randomBytes = void 0;
+/**
+ * A **Cryptographically Secure Random Value** is one that has been
+ * generated with additional care take to prevent side-channels
+ * from allowing others to detect it and prevent others from through
+ * coincidence generate the same values.
+ *
+ * @_subsection: api/crypto:Random Values [about-crypto-random]
+ */
+const crypto_js_1 = require("./crypto.js");
+let locked = false;
+const _randomBytes = function (length) {
+ return new Uint8Array((0, crypto_js_1.randomBytes)(length));
+};
+let __randomBytes = _randomBytes;
+/**
+ * Return %%length%% bytes of cryptographically secure random data.
+ *
+ * @example:
+ * randomBytes(8)
+ * //_result:
+ */
+function randomBytes(length) {
+ return __randomBytes(length);
+}
+exports.randomBytes = randomBytes;
+randomBytes._ = _randomBytes;
+randomBytes.lock = function () { locked = true; };
+randomBytes.register = function (func) {
+ if (locked) {
+ throw new Error("randomBytes is locked");
+ }
+ __randomBytes = func;
+};
+Object.freeze(randomBytes);
+//# sourceMappingURL=random.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/random.js.map b/dist/ethers.js/src.ts/crypto/random.js.map
new file mode 100644
index 0000000..7ec6934
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/random.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"random.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/crypto/random.ts"],"names":[],"mappings":";;;AAAA;;;;;;;GAOG;AACH,2CAA2D;AAE3D,IAAI,MAAM,GAAG,KAAK,CAAC;AAEnB,MAAM,YAAY,GAAG,UAAS,MAAc;IACxC,OAAO,IAAI,UAAU,CAAC,IAAA,uBAAa,EAAC,MAAM,CAAC,CAAC,CAAC;AACjD,CAAC,CAAA;AAED,IAAI,aAAa,GAAG,YAAY,CAAC;AAEjC;;;;;;GAMG;AACH,SAAgB,WAAW,CAAC,MAAc;IACtC,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC;AACjC,CAAC;AAFD,kCAEC;AAED,WAAW,CAAC,CAAC,GAAG,YAAY,CAAC;AAC7B,WAAW,CAAC,IAAI,GAAG,cAAmB,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;AACtD,WAAW,CAAC,QAAQ,GAAG,UAAS,IAAoC;IAChE,IAAI,MAAM,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;KAAE;IACzD,aAAa,GAAG,IAAI,CAAC;AACzB,CAAC,CAAA;AACD,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/ripemd160.d.ts b/dist/ethers.js/src.ts/crypto/ripemd160.d.ts
new file mode 100644
index 0000000..27b7b4a
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/ripemd160.d.ts
@@ -0,0 +1,25 @@
+import type { BytesLike } from "../utils/index.js";
+/**
+ * Compute the cryptographic RIPEMD-160 hash of %%data%%.
+ *
+ * @_docloc: api/crypto:Hash Functions
+ * @returns DataHexstring
+ *
+ * @example:
+ * ripemd160("0x")
+ * //_result:
+ *
+ * ripemd160("0x1337")
+ * //_result:
+ *
+ * ripemd160(new Uint8Array([ 0x13, 0x37 ]))
+ * //_result:
+ *
+ */
+export declare function ripemd160(_data: BytesLike): string;
+export declare namespace ripemd160 {
+ var _: (data: Uint8Array) => Uint8Array;
+ var lock: () => void;
+ var register: (func: (data: Uint8Array) => BytesLike) => void;
+}
+//# sourceMappingURL=ripemd160.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/ripemd160.d.ts.map b/dist/ethers.js/src.ts/crypto/ripemd160.d.ts.map
new file mode 100644
index 0000000..853e968
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/ripemd160.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"ripemd160.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/crypto/ripemd160.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAWnD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAGlD;yBAHe,SAAS"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/ripemd160.js b/dist/ethers.js/src.ts/crypto/ripemd160.js
new file mode 100644
index 0000000..ac69f3a
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/ripemd160.js
@@ -0,0 +1,42 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.ripemd160 = void 0;
+const ripemd160_1 = require("@noble/hashes/ripemd160");
+const index_js_1 = require("../utils/index.js");
+let locked = false;
+const _ripemd160 = function (data) {
+ return (0, ripemd160_1.ripemd160)(data);
+};
+let __ripemd160 = _ripemd160;
+/**
+ * Compute the cryptographic RIPEMD-160 hash of %%data%%.
+ *
+ * @_docloc: api/crypto:Hash Functions
+ * @returns DataHexstring
+ *
+ * @example:
+ * ripemd160("0x")
+ * //_result:
+ *
+ * ripemd160("0x1337")
+ * //_result:
+ *
+ * ripemd160(new Uint8Array([ 0x13, 0x37 ]))
+ * //_result:
+ *
+ */
+function ripemd160(_data) {
+ const data = (0, index_js_1.getBytes)(_data, "data");
+ return (0, index_js_1.hexlify)(__ripemd160(data));
+}
+exports.ripemd160 = ripemd160;
+ripemd160._ = _ripemd160;
+ripemd160.lock = function () { locked = true; };
+ripemd160.register = function (func) {
+ if (locked) {
+ throw new TypeError("ripemd160 is locked");
+ }
+ __ripemd160 = func;
+};
+Object.freeze(ripemd160);
+//# sourceMappingURL=ripemd160.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/ripemd160.js.map b/dist/ethers.js/src.ts/crypto/ripemd160.js.map
new file mode 100644
index 0000000..4b04bc5
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/ripemd160.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"ripemd160.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/crypto/ripemd160.ts"],"names":[],"mappings":";;;AAAA,uDAAuE;AAEvE,gDAAuD;AAKvD,IAAI,MAAM,GAAG,KAAK,CAAC;AAEnB,MAAM,UAAU,GAAG,UAAS,IAAgB;IACxC,OAAO,IAAA,qBAAe,EAAC,IAAI,CAAC,CAAC;AACjC,CAAC,CAAA;AAED,IAAI,WAAW,GAAoC,UAAU,CAAC;AAE9D;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,SAAS,CAAC,KAAgB;IACtC,MAAM,IAAI,GAAG,IAAA,mBAAQ,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,IAAA,kBAAO,EAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;AACtC,CAAC;AAHD,8BAGC;AACD,SAAS,CAAC,CAAC,GAAG,UAAU,CAAC;AACzB,SAAS,CAAC,IAAI,GAAG,cAAmB,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;AACpD,SAAS,CAAC,QAAQ,GAAG,UAAS,IAAqC;IAC/D,IAAI,MAAM,EAAE;QAAE,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAC;KAAE;IAC3D,WAAW,GAAG,IAAI,CAAC;AACvB,CAAC,CAAA;AACD,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/scrypt.d.ts b/dist/ethers.js/src.ts/crypto/scrypt.d.ts
new file mode 100644
index 0000000..b0e678f
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/scrypt.d.ts
@@ -0,0 +1,82 @@
+import type { BytesLike } from "../utils/index.js";
+/**
+ * A callback during long-running operations to update any
+ * UI or provide programatic access to the progress.
+ *
+ * The %%percent%% is a value between ``0`` and ``1``.
+ *
+ * @_docloc: api/crypto:Passwords
+ */
+export type ProgressCallback = (percent: number) => void;
+/**
+ * The [[link-wiki-scrypt]] uses a memory and cpu hard method of
+ * derivation to increase the resource cost to brute-force a password
+ * for a given key.
+ *
+ * This means this algorithm is intentionally slow, and can be tuned to
+ * become slower. As computation and memory speed improve over time,
+ * increasing the difficulty maintains the cost of an attacker.
+ *
+ * For example, if a target time of 5 seconds is used, a legitimate user
+ * which knows their password requires only 5 seconds to unlock their
+ * account. A 6 character password has 68 billion possibilities, which
+ * would require an attacker to invest over 10,000 years of CPU time. This
+ * is of course a crude example (as password generally aren't random),
+ * but demonstrates to value of imposing large costs to decryption.
+ *
+ * For this reason, if building a UI which involved decrypting or
+ * encrypting datsa using scrypt, it is recommended to use a
+ * [[ProgressCallback]] (as event short periods can seem lik an eternity
+ * if the UI freezes). Including the phrase //"decrypting"// in the UI
+ * can also help, assuring the user their waiting is for a good reason.
+ *
+ * @_docloc: api/crypto:Passwords
+ *
+ * @example:
+ * // The password must be converted to bytes, and it is generally
+ * // best practices to ensure the string has been normalized. Many
+ * // formats explicitly indicate the normalization form to use.
+ * password = "hello"
+ * passwordBytes = toUtf8Bytes(password, "NFKC")
+ *
+ * salt = id("some-salt")
+ *
+ * // Compute the scrypt
+ * scrypt(passwordBytes, salt, 1024, 8, 1, 16)
+ * //_result:
+ */
+export declare function scrypt(_passwd: BytesLike, _salt: BytesLike, N: number, r: number, p: number, dkLen: number, progress?: ProgressCallback): Promise;
+export declare namespace scrypt {
+ var _: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number, onProgress?: ProgressCallback | undefined) => Promise;
+ var lock: () => void;
+ var register: (func: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number, progress?: ProgressCallback | undefined) => Promise) => void;
+}
+/**
+ * Provides a synchronous variant of [[scrypt]].
+ *
+ * This will completely lock up and freeze the UI in a browser and will
+ * prevent any event loop from progressing. For this reason, it is
+ * preferred to use the [async variant](scrypt).
+ *
+ * @_docloc: api/crypto:Passwords
+ *
+ * @example:
+ * // The password must be converted to bytes, and it is generally
+ * // best practices to ensure the string has been normalized. Many
+ * // formats explicitly indicate the normalization form to use.
+ * password = "hello"
+ * passwordBytes = toUtf8Bytes(password, "NFKC")
+ *
+ * salt = id("some-salt")
+ *
+ * // Compute the scrypt
+ * scryptSync(passwordBytes, salt, 1024, 8, 1, 16)
+ * //_result:
+ */
+export declare function scryptSync(_passwd: BytesLike, _salt: BytesLike, N: number, r: number, p: number, dkLen: number): string;
+export declare namespace scryptSync {
+ var _: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number) => Uint8Array;
+ var lock: () => void;
+ var register: (func: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number) => BytesLike) => void;
+}
+//# sourceMappingURL=scrypt.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/scrypt.d.ts.map b/dist/ethers.js/src.ts/crypto/scrypt.d.ts.map
new file mode 100644
index 0000000..6ab76e4
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/scrypt.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"scrypt.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/crypto/scrypt.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;AAgBzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAsB,MAAM,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CAI/J;yBAJqB,MAAM;;;;;AAa5B;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAIvH;yBAJe,UAAU"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/scrypt.js b/dist/ethers.js/src.ts/crypto/scrypt.js
new file mode 100644
index 0000000..1a37c19
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/scrypt.js
@@ -0,0 +1,117 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.scryptSync = exports.scrypt = void 0;
+const scrypt_1 = require("@noble/hashes/scrypt");
+const index_js_1 = require("../utils/index.js");
+let lockedSync = false, lockedAsync = false;
+const _scryptAsync = function (passwd, salt, N, r, p, dkLen, onProgress) {
+ return __awaiter(this, void 0, void 0, function* () {
+ return yield (0, scrypt_1.scryptAsync)(passwd, salt, { N, r, p, dkLen, onProgress });
+ });
+};
+const _scryptSync = function (passwd, salt, N, r, p, dkLen) {
+ return (0, scrypt_1.scrypt)(passwd, salt, { N, r, p, dkLen });
+};
+let __scryptAsync = _scryptAsync;
+let __scryptSync = _scryptSync;
+/**
+ * The [[link-wiki-scrypt]] uses a memory and cpu hard method of
+ * derivation to increase the resource cost to brute-force a password
+ * for a given key.
+ *
+ * This means this algorithm is intentionally slow, and can be tuned to
+ * become slower. As computation and memory speed improve over time,
+ * increasing the difficulty maintains the cost of an attacker.
+ *
+ * For example, if a target time of 5 seconds is used, a legitimate user
+ * which knows their password requires only 5 seconds to unlock their
+ * account. A 6 character password has 68 billion possibilities, which
+ * would require an attacker to invest over 10,000 years of CPU time. This
+ * is of course a crude example (as password generally aren't random),
+ * but demonstrates to value of imposing large costs to decryption.
+ *
+ * For this reason, if building a UI which involved decrypting or
+ * encrypting datsa using scrypt, it is recommended to use a
+ * [[ProgressCallback]] (as event short periods can seem lik an eternity
+ * if the UI freezes). Including the phrase //"decrypting"// in the UI
+ * can also help, assuring the user their waiting is for a good reason.
+ *
+ * @_docloc: api/crypto:Passwords
+ *
+ * @example:
+ * // The password must be converted to bytes, and it is generally
+ * // best practices to ensure the string has been normalized. Many
+ * // formats explicitly indicate the normalization form to use.
+ * password = "hello"
+ * passwordBytes = toUtf8Bytes(password, "NFKC")
+ *
+ * salt = id("some-salt")
+ *
+ * // Compute the scrypt
+ * scrypt(passwordBytes, salt, 1024, 8, 1, 16)
+ * //_result:
+ */
+function scrypt(_passwd, _salt, N, r, p, dkLen, progress) {
+ return __awaiter(this, void 0, void 0, function* () {
+ const passwd = (0, index_js_1.getBytes)(_passwd, "passwd");
+ const salt = (0, index_js_1.getBytes)(_salt, "salt");
+ return (0, index_js_1.hexlify)(yield __scryptAsync(passwd, salt, N, r, p, dkLen, progress));
+ });
+}
+exports.scrypt = scrypt;
+scrypt._ = _scryptAsync;
+scrypt.lock = function () { lockedAsync = true; };
+scrypt.register = function (func) {
+ if (lockedAsync) {
+ throw new Error("scrypt is locked");
+ }
+ __scryptAsync = func;
+};
+Object.freeze(scrypt);
+/**
+ * Provides a synchronous variant of [[scrypt]].
+ *
+ * This will completely lock up and freeze the UI in a browser and will
+ * prevent any event loop from progressing. For this reason, it is
+ * preferred to use the [async variant](scrypt).
+ *
+ * @_docloc: api/crypto:Passwords
+ *
+ * @example:
+ * // The password must be converted to bytes, and it is generally
+ * // best practices to ensure the string has been normalized. Many
+ * // formats explicitly indicate the normalization form to use.
+ * password = "hello"
+ * passwordBytes = toUtf8Bytes(password, "NFKC")
+ *
+ * salt = id("some-salt")
+ *
+ * // Compute the scrypt
+ * scryptSync(passwordBytes, salt, 1024, 8, 1, 16)
+ * //_result:
+ */
+function scryptSync(_passwd, _salt, N, r, p, dkLen) {
+ const passwd = (0, index_js_1.getBytes)(_passwd, "passwd");
+ const salt = (0, index_js_1.getBytes)(_salt, "salt");
+ return (0, index_js_1.hexlify)(__scryptSync(passwd, salt, N, r, p, dkLen));
+}
+exports.scryptSync = scryptSync;
+scryptSync._ = _scryptSync;
+scryptSync.lock = function () { lockedSync = true; };
+scryptSync.register = function (func) {
+ if (lockedSync) {
+ throw new Error("scryptSync is locked");
+ }
+ __scryptSync = func;
+};
+Object.freeze(scryptSync);
+//# sourceMappingURL=scrypt.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/scrypt.js.map b/dist/ethers.js/src.ts/crypto/scrypt.js.map
new file mode 100644
index 0000000..00a22fa
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/scrypt.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"scrypt.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/crypto/scrypt.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAAwF;AAExF,gDAA2D;AAe3D,IAAI,UAAU,GAAG,KAAK,EAAE,WAAW,GAAG,KAAK,CAAC;AAE5C,MAAM,YAAY,GAAG,UAAe,MAAkB,EAAE,IAAgB,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,KAAa,EAAE,UAA6B;;QACnJ,OAAO,MAAM,IAAA,oBAAW,EAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;IAC3E,CAAC;CAAA,CAAA;AACD,MAAM,WAAW,GAAG,UAAS,MAAkB,EAAE,IAAgB,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,KAAa;IAC7G,OAAO,IAAA,eAAU,EAAC,MAAM,EAAE,IA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,GAAG,IAAA,mBAAQ,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,IAAA,kBAAC,EAAC,YAAY,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;AACzD,CAAC;AAJD,gCAIC;AACD,UAAU,CAAC,CAAC,GAAG,WAAW,CAAC;AAC3B,UAAU,CAAC,IAAI,GAAG,cAAmB,UAAU,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;AACzD,UAAU,CAAC,QAAQ,GAAG,UAAS,IAAyG;IACpI,IAAI,UAAU,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;KAAE;IAC5D,YAAY,GAAG,IAAI,CAAC;AACxB,CAAC,CAAA;AACD,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/sha2.d.ts b/dist/ethers.js/src.ts/crypto/sha2.d.ts
new file mode 100644
index 0000000..348ccdc
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/sha2.d.ts
@@ -0,0 +1,47 @@
+import type { BytesLike } from "../utils/index.js";
+/**
+ * Compute the cryptographic SHA2-256 hash of %%data%%.
+ *
+ * @_docloc: api/crypto:Hash Functions
+ * @returns DataHexstring
+ *
+ * @example:
+ * sha256("0x")
+ * //_result:
+ *
+ * sha256("0x1337")
+ * //_result:
+ *
+ * sha256(new Uint8Array([ 0x13, 0x37 ]))
+ * //_result:
+ *
+ */
+export declare function sha256(_data: BytesLike): string;
+export declare namespace sha256 {
+ var _: (data: Uint8Array) => Uint8Array;
+ var lock: () => void;
+ var register: (func: (data: Uint8Array) => BytesLike) => void;
+}
+/**
+ * Compute the cryptographic SHA2-512 hash of %%data%%.
+ *
+ * @_docloc: api/crypto:Hash Functions
+ * @returns DataHexstring
+ *
+ * @example:
+ * sha512("0x")
+ * //_result:
+ *
+ * sha512("0x1337")
+ * //_result:
+ *
+ * sha512(new Uint8Array([ 0x13, 0x37 ]))
+ * //_result:
+ */
+export declare function sha512(_data: BytesLike): string;
+export declare namespace sha512 {
+ var _: (data: Uint8Array) => Uint8Array;
+ var lock: () => void;
+ var register: (func: (data: Uint8Array) => BytesLike) => void;
+}
+//# sourceMappingURL=sha2.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/sha2.d.ts.map b/dist/ethers.js/src.ts/crypto/sha2.d.ts.map
new file mode 100644
index 0000000..770b98f
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/sha2.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"sha2.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/crypto/sha2.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAiBnD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAG/C;yBAHe,MAAM;;;;;AAatB;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAG/C;yBAHe,MAAM"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/sha2.js b/dist/ethers.js/src.ts/crypto/sha2.js
new file mode 100644
index 0000000..c5ed991
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/sha2.js
@@ -0,0 +1,76 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.sha512 = exports.sha256 = void 0;
+const crypto_js_1 = require("./crypto.js");
+const index_js_1 = require("../utils/index.js");
+const _sha256 = function (data) {
+ return (0, crypto_js_1.createHash)("sha256").update(data).digest();
+};
+const _sha512 = function (data) {
+ return (0, crypto_js_1.createHash)("sha512").update(data).digest();
+};
+let __sha256 = _sha256;
+let __sha512 = _sha512;
+let locked256 = false, locked512 = false;
+/**
+ * Compute the cryptographic SHA2-256 hash of %%data%%.
+ *
+ * @_docloc: api/crypto:Hash Functions
+ * @returns DataHexstring
+ *
+ * @example:
+ * sha256("0x")
+ * //_result:
+ *
+ * sha256("0x1337")
+ * //_result:
+ *
+ * sha256(new Uint8Array([ 0x13, 0x37 ]))
+ * //_result:
+ *
+ */
+function sha256(_data) {
+ const data = (0, index_js_1.getBytes)(_data, "data");
+ return (0, index_js_1.hexlify)(__sha256(data));
+}
+exports.sha256 = sha256;
+sha256._ = _sha256;
+sha256.lock = function () { locked256 = true; };
+sha256.register = function (func) {
+ if (locked256) {
+ throw new Error("sha256 is locked");
+ }
+ __sha256 = func;
+};
+Object.freeze(sha256);
+/**
+ * Compute the cryptographic SHA2-512 hash of %%data%%.
+ *
+ * @_docloc: api/crypto:Hash Functions
+ * @returns DataHexstring
+ *
+ * @example:
+ * sha512("0x")
+ * //_result:
+ *
+ * sha512("0x1337")
+ * //_result:
+ *
+ * sha512(new Uint8Array([ 0x13, 0x37 ]))
+ * //_result:
+ */
+function sha512(_data) {
+ const data = (0, index_js_1.getBytes)(_data, "data");
+ return (0, index_js_1.hexlify)(__sha512(data));
+}
+exports.sha512 = sha512;
+sha512._ = _sha512;
+sha512.lock = function () { locked512 = true; };
+sha512.register = function (func) {
+ if (locked512) {
+ throw new Error("sha512 is locked");
+ }
+ __sha512 = func;
+};
+Object.freeze(sha256);
+//# sourceMappingURL=sha2.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/sha2.js.map b/dist/ethers.js/src.ts/crypto/sha2.js.map
new file mode 100644
index 0000000..33dcb7b
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/sha2.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"sha2.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/crypto/sha2.ts"],"names":[],"mappings":";;;AAAA,2CAAyC;AAEzC,gDAAsD;AAKtD,MAAM,OAAO,GAAG,UAAS,IAAgB;IACrC,OAAO,IAAA,sBAAU,EAAC,Q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AAC,IAAI,GAAG,cAAmB,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;AACpD,MAAM,CAAC,QAAQ,GAAG,UAAS,IAAqC;IAC5D,IAAI,SAAS,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;KAAE;IACvD,QAAQ,GAAG,IAAI,CAAC;AACpB,CAAC,CAAA;AACD,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/signature.d.ts b/dist/ethers.js/src.ts/crypto/signature.d.ts
new file mode 100644
index 0000000..8cfe966
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/signature.d.ts
@@ -0,0 +1,158 @@
+import type { BigNumberish, BytesLike } from "../utils/index.js";
+/**
+ * A SignatureLike
+ *
+ * @_docloc: api/crypto:Signing
+ */
+export type SignatureLike = Signature | string | {
+ r: string;
+ s: string;
+ v: BigNumberish;
+ yParity?: 0 | 1;
+ yParityAndS?: string;
+} | {
+ r: string;
+ yParityAndS: string;
+ yParity?: 0 | 1;
+ s?: string;
+ v?: number;
+} | {
+ r: string;
+ s: string;
+ yParity: 0 | 1;
+ v?: BigNumberish;
+ yParityAndS?: string;
+};
+/**
+ * A Signature @TODO
+ *
+ *
+ * @_docloc: api/crypto:Signing
+ */
+export declare class Signature {
+ #private;
+ /**
+ * The ``r`` value for a signautre.
+ *
+ * This represents the ``x`` coordinate of a "reference" or
+ * challenge point, from which the ``y`` can be computed.
+ */
+ get r(): string;
+ set r(value: BytesLike);
+ /**
+ * The ``s`` value for a signature.
+ */
+ get s(): string;
+ set s(_value: BytesLike);
+ /**
+ * The ``v`` value for a signature.
+ *
+ * Since a given ``x`` value for ``r`` has two possible values for
+ * its correspondin ``y``, the ``v`` indicates which of the two ``y``
+ * values to use.
+ *
+ * It is normalized to the values ``27`` or ``28`` for legacy
+ * purposes.
+ */
+ get v(): 27 | 28;
+ set v(value: BigNumberish);
+ /**
+ * The EIP-155 ``v`` for legacy transactions. For non-legacy
+ * transactions, this value is ``null``.
+ */
+ get networkV(): null | bigint;
+ /**
+ * The chain ID for EIP-155 legacy transactions. For non-legacy
+ * transactions, this value is ``null``.
+ */
+ get legacyChainId(): null | bigint;
+ /**
+ * The ``yParity`` for the signature.
+ *
+ * See ``v`` for more details on how this value is used.
+ */
+ get yParity(): 0 | 1;
+ /**
+ * The [[link-eip-2098]] compact representation of the ``yParity``
+ * and ``s`` compacted into a single ``bytes32``.
+ */
+ get yParityAndS(): string;
+ /**
+ * The [[link-eip-2098]] compact representation.
+ */
+ get compactSerialized(): string;
+ /**
+ * The serialized representation.
+ */
+ get serialized(): string;
+ /**
+ * @private
+ */
+ constructor(guard: any, r: string, s: string, v: 27 | 28);
+ /**
+ * Returns a new identical [[Signature]].
+ */
+ clone(): Signature;
+ /**
+ * Returns a representation that is compatible with ``JSON.stringify``.
+ */
+ toJSON(): any;
+ /**
+ * Compute the chain ID from the ``v`` in a legacy EIP-155 transactions.
+ *
+ * @example:
+ * Signature.getChainId(45)
+ * //_result:
+ *
+ * Signature.getChainId(46)
+ * //_result:
+ */
+ static getChainId(v: BigNumberish): bigint;
+ /**
+ * Compute the ``v`` for a chain ID for a legacy EIP-155 transactions.
+ *
+ * Legacy transactions which use [[link-eip-155]] hijack the ``v``
+ * property to include the chain ID.
+ *
+ * @example:
+ * Signature.getChainIdV(5, 27)
+ * //_result:
+ *
+ * Signature.getChainIdV(5, 28)
+ * //_result:
+ *
+ */
+ static getChainIdV(chainId: BigNumberish, v: 27 | 28): bigint;
+ /**
+ * Compute the normalized legacy transaction ``v`` from a ``yParirty``,
+ * a legacy transaction ``v`` or a legacy [[link-eip-155]] transaction.
+ *
+ * @example:
+ * // The values 0 and 1 imply v is actually yParity
+ * Signature.getNormalizedV(0)
+ * //_result:
+ *
+ * // Legacy non-EIP-1559 transaction (i.e. 27 or 28)
+ * Signature.getNormalizedV(27)
+ * //_result:
+ *
+ * // Legacy EIP-155 transaction (i.e. >= 35)
+ * Signature.getNormalizedV(46)
+ * //_result:
+ *
+ * // Invalid values throw
+ * Signature.getNormalizedV(5)
+ * //_error:
+ */
+ static getNormalizedV(v: BigNumberish): 27 | 28;
+ /**
+ * Creates a new [[Signature]].
+ *
+ * If no %%sig%% is provided, a new [[Signature]] is created
+ * with default values.
+ *
+ * If %%sig%% is a string, it is parsed.
+ */
+ static from(sig?: SignatureLike): Signature;
+}
+//# sourceMappingURL=signature.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/signature.d.ts.map b/dist/ethers.js/src.ts/crypto/signature.d.ts.map
new file mode 100644
index 0000000..de26411
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/signature.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"signature.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/crypto/signature.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACR,YAAY,EAAE,SAAS,EAC1B,MAAM,mBAAmB,CAAC;AAgB3B;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,MAAM,GAAG;IAC7C,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,YAAY,CAAC;IAChB,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB,GAAG;IACA,CAAC,EAAE,MAAM,CAAC;IACV,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IAChB,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;CACd,GAAG;IACA,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;IACf,CAAC,CAAC,EAAE,YAAY,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM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;IACH,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,aAAa,GAAG,SAAS;CAuF9C"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/signature.js b/dist/ethers.js/src.ts/crypto/signature.js
new file mode 100644
index 0000000..cd7dfe8
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/signature.js
@@ -0,0 +1,317 @@
+"use strict";
+var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
+};
+var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
+ if (kind === "m") throw new TypeError("Private method is not writable");
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
+};
+var _Signature_r, _Signature_s, _Signature_v, _Signature_networkV;
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.Signature = void 0;
+const index_js_1 = require("../constants/index.js");
+const index_js_2 = require("../utils/index.js");
+// Constants
+const BN_0 = BigInt(0);
+const BN_1 = BigInt(1);
+const BN_2 = BigInt(2);
+const BN_27 = BigInt(27);
+const BN_28 = BigInt(28);
+const BN_35 = BigInt(35);
+const _guard = {};
+function toUint256(value) {
+ return (0, index_js_2.zeroPadValue)((0, index_js_2.toBeArray)(value), 32);
+}
+/**
+ * A Signature @TODO
+ *
+ *
+ * @_docloc: api/crypto:Signing
+ */
+class Signature {
+ /**
+ * The ``r`` value for a signautre.
+ *
+ * This represents the ``x`` coordinate of a "reference" or
+ * challenge point, from which the ``y`` can be computed.
+ */
+ get r() { return __classPrivateFieldGet(this, _Signature_r, "f"); }
+ set r(value) {
+ (0, index_js_2.assertArgument)((0, index_js_2.dataLength)(value) === 32, "invalid r", "value", value);
+ __classPrivateFieldSet(this, _Signature_r, (0, index_js_2.hexlify)(value), "f");
+ }
+ /**
+ * The ``s`` value for a signature.
+ */
+ get s() { return __classPrivateFieldGet(this, _Signature_s, "f"); }
+ set s(_value) {
+ (0, index_js_2.assertArgument)((0, index_js_2.dataLength)(_value) === 32, "invalid s", "value", _value);
+ const value = (0, index_js_2.hexlify)(_value);
+ (0, index_js_2.assertArgument)(parseInt(value.substring(0, 3)) < 8, "non-canonical s", "value", value);
+ __classPrivateFieldSet(this, _Signature_s, value, "f");
+ }
+ /**
+ * The ``v`` value for a signature.
+ *
+ * Since a given ``x`` value for ``r`` has two possible values for
+ * its correspondin ``y``, the ``v`` indicates which of the two ``y``
+ * values to use.
+ *
+ * It is normalized to the values ``27`` or ``28`` for legacy
+ * purposes.
+ */
+ get v() { return __classPrivateFieldGet(this, _Signature_v, "f"); }
+ set v(value) {
+ const v = (0, index_js_2.getNumber)(value, "value");
+ (0, index_js_2.assertArgument)(v === 27 || v === 28, "invalid v", "v", value);
+ __classPrivateFieldSet(this, _Signature_v, v, "f");
+ }
+ /**
+ * The EIP-155 ``v`` for legacy transactions. For non-legacy
+ * transactions, this value is ``null``.
+ */
+ get networkV() { return __classPrivateFieldGet(this, _Signature_networkV, "f"); }
+ /**
+ * The chain ID for EIP-155 legacy transactions. For non-legacy
+ * transactions, this value is ``null``.
+ */
+ get legacyChainId() {
+ const v = this.networkV;
+ if (v == null) {
+ return null;
+ }
+ return Signature.getChainId(v);
+ }
+ /**
+ * The ``yParity`` for the signature.
+ *
+ * See ``v`` for more details on how this value is used.
+ */
+ get yParity() {
+ return (this.v === 27) ? 0 : 1;
+ }
+ /**
+ * The [[link-eip-2098]] compact representation of the ``yParity``
+ * and ``s`` compacted into a single ``bytes32``.
+ */
+ get yParityAndS() {
+ // The EIP-2098 compact representation
+ const yParityAndS = (0, index_js_2.getBytes)(this.s);
+ if (this.yParity) {
+ yParityAndS[0] |= 0x80;
+ }
+ return (0, index_js_2.hexlify)(yParityAndS);
+ }
+ /**
+ * The [[link-eip-2098]] compact representation.
+ */
+ get compactSerialized() {
+ return (0, index_js_2.concat)([this.r, this.yParityAndS]);
+ }
+ /**
+ * The serialized representation.
+ */
+ get serialized() {
+ return (0, index_js_2.concat)([this.r, this.s, (this.yParity ? "0x1c" : "0x1b")]);
+ }
+ /**
+ * @private
+ */
+ constructor(guard, r, s, v) {
+ _Signature_r.set(this, void 0);
+ _Signature_s.set(this, void 0);
+ _Signature_v.set(this, void 0);
+ _Signature_networkV.set(this, void 0);
+ (0, index_js_2.assertPrivate)(guard, _guard, "Signature");
+ __classPrivateFieldSet(this, _Signature_r, r, "f");
+ __classPrivateFieldSet(this, _Signature_s, s, "f");
+ __classPrivateFieldSet(this, _Signature_v, v, "f");
+ __classPrivateFieldSet(this, _Signature_networkV, null, "f");
+ }
+ [(_Signature_r = new WeakMap(), _Signature_s = new WeakMap(), _Signature_v = new WeakMap(), _Signature_networkV = new WeakMap(), Symbol.for('nodejs.util.inspect.custom'))]() {
+ return `Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`;
+ }
+ /**
+ * Returns a new identical [[Signature]].
+ */
+ clone() {
+ const clone = new Signature(_guard, this.r, this.s, this.v);
+ if (this.networkV) {
+ __classPrivateFieldSet(clone, _Signature_networkV, this.networkV, "f");
+ }
+ return clone;
+ }
+ /**
+ * Returns a representation that is compatible with ``JSON.stringify``.
+ */
+ toJSON() {
+ const networkV = this.networkV;
+ return {
+ _type: "signature",
+ networkV: ((networkV != null) ? networkV.toString() : null),
+ r: this.r, s: this.s, v: this.v,
+ };
+ }
+ /**
+ * Compute the chain ID from the ``v`` in a legacy EIP-155 transactions.
+ *
+ * @example:
+ * Signature.getChainId(45)
+ * //_result:
+ *
+ * Signature.getChainId(46)
+ * //_result:
+ */
+ static getChainId(v) {
+ const bv = (0, index_js_2.getBigInt)(v, "v");
+ // The v is not an EIP-155 v, so it is the unspecified chain ID
+ if ((bv == BN_27) || (bv == BN_28)) {
+ return BN_0;
+ }
+ // Bad value for an EIP-155 v
+ (0, index_js_2.assertArgument)(bv >= BN_35, "invalid EIP-155 v", "v", v);
+ return (bv - BN_35) / BN_2;
+ }
+ /**
+ * Compute the ``v`` for a chain ID for a legacy EIP-155 transactions.
+ *
+ * Legacy transactions which use [[link-eip-155]] hijack the ``v``
+ * property to include the chain ID.
+ *
+ * @example:
+ * Signature.getChainIdV(5, 27)
+ * //_result:
+ *
+ * Signature.getChainIdV(5, 28)
+ * //_result:
+ *
+ */
+ static getChainIdV(chainId, v) {
+ return ((0, index_js_2.getBigInt)(chainId) * BN_2) + BigInt(35 + v - 27);
+ }
+ /**
+ * Compute the normalized legacy transaction ``v`` from a ``yParirty``,
+ * a legacy transaction ``v`` or a legacy [[link-eip-155]] transaction.
+ *
+ * @example:
+ * // The values 0 and 1 imply v is actually yParity
+ * Signature.getNormalizedV(0)
+ * //_result:
+ *
+ * // Legacy non-EIP-1559 transaction (i.e. 27 or 28)
+ * Signature.getNormalizedV(27)
+ * //_result:
+ *
+ * // Legacy EIP-155 transaction (i.e. >= 35)
+ * Signature.getNormalizedV(46)
+ * //_result:
+ *
+ * // Invalid values throw
+ * Signature.getNormalizedV(5)
+ * //_error:
+ */
+ static getNormalizedV(v) {
+ const bv = (0, index_js_2.getBigInt)(v);
+ if (bv === BN_0 || bv === BN_27) {
+ return 27;
+ }
+ if (bv === BN_1 || bv === BN_28) {
+ return 28;
+ }
+ (0, index_js_2.assertArgument)(bv >= BN_35, "invalid v", "v", v);
+ // Otherwise, EIP-155 v means odd is 27 and even is 28
+ return (bv & BN_1) ? 27 : 28;
+ }
+ /**
+ * Creates a new [[Signature]].
+ *
+ * If no %%sig%% is provided, a new [[Signature]] is created
+ * with default values.
+ *
+ * If %%sig%% is a string, it is parsed.
+ */
+ static from(sig) {
+ function assertError(check, message) {
+ (0, index_js_2.assertArgument)(check, message, "signature", sig);
+ }
+ ;
+ if (sig == null) {
+ return new Signature(_guard, index_js_1.ZeroHash, index_js_1.ZeroHash, 27);
+ }
+ if (typeof (sig) === "string") {
+ const bytes = (0, index_js_2.getBytes)(sig, "signature");
+ if (bytes.length === 64) {
+ const r = (0, index_js_2.hexlify)(bytes.slice(0, 32));
+ const s = bytes.slice(32, 64);
+ const v = (s[0] & 0x80) ? 28 : 27;
+ s[0] &= 0x7f;
+ return new Signature(_guard, r, (0, index_js_2.hexlify)(s), v);
+ }
+ if (bytes.length === 65) {
+ const r = (0, index_js_2.hexlify)(bytes.slice(0, 32));
+ const s = bytes.slice(32, 64);
+ assertError((s[0] & 0x80) === 0, "non-canonical s");
+ const v = Signature.getNormalizedV(bytes[64]);
+ return new Signature(_guard, r, (0, index_js_2.hexlify)(s), v);
+ }
+ assertError(false, "invalid raw signature length");
+ }
+ if (sig instanceof Signature) {
+ return sig.clone();
+ }
+ // Get r
+ const _r = sig.r;
+ assertError(_r != null, "missing r");
+ const r = toUint256(_r);
+ // Get s; by any means necessary (we check consistency below)
+ const s = (function (s, yParityAndS) {
+ if (s != null) {
+ return toUint256(s);
+ }
+ if (yParityAndS != null) {
+ assertError((0, index_js_2.isHexString)(yParityAndS, 32), "invalid yParityAndS");
+ const bytes = (0, index_js_2.getBytes)(yParityAndS);
+ bytes[0] &= 0x7f;
+ return (0, index_js_2.hexlify)(bytes);
+ }
+ assertError(false, "missing s");
+ })(sig.s, sig.yParityAndS);
+ assertError(((0, index_js_2.getBytes)(s)[0] & 0x80) == 0, "non-canonical s");
+ // Get v; by any means necessary (we check consistency below)
+ const { networkV, v } = (function (_v, yParityAndS, yParity) {
+ if (_v != null) {
+ const v = (0, index_js_2.getBigInt)(_v);
+ return {
+ networkV: ((v >= BN_35) ? v : undefined),
+ v: Signature.getNormalizedV(v)
+ };
+ }
+ if (yParityAndS != null) {
+ assertError((0, index_js_2.isHexString)(yParityAndS, 32), "invalid yParityAndS");
+ return { v: (((0, index_js_2.getBytes)(yParityAndS)[0] & 0x80) ? 28 : 27) };
+ }
+ if (yParity != null) {
+ switch ((0, index_js_2.getNumber)(yParity, "sig.yParity")) {
+ case 0: return { v: 27 };
+ case 1: return { v: 28 };
+ }
+ assertError(false, "invalid yParity");
+ }
+ assertError(false, "missing v");
+ })(sig.v, sig.yParityAndS, sig.yParity);
+ const result = new Signature(_guard, r, s, v);
+ if (networkV) {
+ __classPrivateFieldSet(result, _Signature_networkV, networkV, "f");
+ }
+ // If multiple of v, yParity, yParityAndS we given, check they match
+ assertError(sig.yParity == null || (0, index_js_2.getNumber)(sig.yParity, "sig.yParity") === result.yParity, "yParity mismatch");
+ assertError(sig.yParityAndS == null || sig.yParityAndS === result.yParityAndS, "yParityAndS mismatch");
+ return result;
+ }
+}
+exports.Signature = Signature;
+//# sourceMappingURL=signature.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/signature.js.map b/dist/ethers.js/src.ts/crypto/signature.js.map
new file mode 100644
index 0000000..1dc86ff
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/signature.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"signature.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/crypto/signature.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,oDAAiD;AACjD,gDAI2B;AAO3B,YAAY;AACZ,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;AACzB,MAAM,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;AACzB,MAAM,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;AAGzB,MAAM,MAAM,GA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AAI,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAC9C,IAAI,QAAQ,EAAE;YAAE,uBAAA,MAAM,uBAAc,QAAQ,MAAA,CAAC;SAAE;QAE/C,oEAAoE;QACpE,WAAW,CAAC,GAAG,CAAC,OAAO,IAAI,IAAI,IAAI,IAAA,oBAAS,EAAC,GAAG,CAAC,OAAO,EAAE,aAAa,CAAC,KAAK,MAAM,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;QACjH,WAAW,CAAC,GAAG,CAAC,WAAW,IAAI,IAAI,IAAI,GAAG,CAAC,WAAW,KAAK,MAAM,CAAC,WAAW,EAAE,sBAAsB,CAAC,CAAC;QAEvG,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AA5SD,8BA4SC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/signing-key.d.ts b/dist/ethers.js/src.ts/crypto/signing-key.d.ts
new file mode 100644
index 0000000..0864d3b
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/signing-key.d.ts
@@ -0,0 +1,122 @@
+/**
+ * Add details about signing here.
+ *
+ * @_subsection: api/crypto:Signing [about-signing]
+ */
+import { Signature } from "./signature.js";
+import type { BytesLike } from "../utils/index.js";
+import type { SignatureLike } from "./index.js";
+/**
+ * A **SigningKey** provides high-level access to the elliptic curve
+ * cryptography (ECC) operations and key management.
+ */
+export declare class SigningKey {
+ #private;
+ /**
+ * Creates a new **SigningKey** for %%privateKey%%.
+ */
+ constructor(privateKey: BytesLike);
+ /**
+ * The private key.
+ */
+ get privateKey(): string;
+ /**
+ * The uncompressed public key.
+ *
+ * This will always begin with the prefix ``0x04`` and be 132
+ * characters long (the ``0x`` prefix and 130 hexadecimal nibbles).
+ */
+ get publicKey(): string;
+ /**
+ * The compressed public key.
+ *
+ * This will always begin with either the prefix ``0x02`` or ``0x03``
+ * and be 68 characters long (the ``0x`` prefix and 33 hexadecimal
+ * nibbles)
+ */
+ get compressedPublicKey(): string;
+ /**
+ * Return the signature of the signed %%digest%%.
+ */
+ sign(digest: BytesLike): Signature;
+ /**
+ * Returns the [[link-wiki-ecdh]] shared secret between this
+ * private key and the %%other%% key.
+ *
+ * The %%other%% key may be any type of key, a raw public key,
+ * a compressed/uncompressed pubic key or aprivate key.
+ *
+ * Best practice is usually to use a cryptographic hash on the
+ * returned value before using it as a symetric secret.
+ *
+ * @example:
+ * sign1 = new SigningKey(id("some-secret-1"))
+ * sign2 = new SigningKey(id("some-secret-2"))
+ *
+ * // Notice that privA.computeSharedSecret(pubB)...
+ * sign1.computeSharedSecret(sign2.publicKey)
+ * //_result:
+ *
+ * // ...is equal to privB.computeSharedSecret(pubA).
+ * sign2.computeSharedSecret(sign1.publicKey)
+ * //_result:
+ */
+ computeSharedSecret(other: BytesLike): string;
+ /**
+ * Compute the public key for %%key%%, optionally %%compressed%%.
+ *
+ * The %%key%% may be any type of key, a raw public key, a
+ * compressed/uncompressed public key or private key.
+ *
+ * @example:
+ * sign = new SigningKey(id("some-secret"));
+ *
+ * // Compute the uncompressed public key for a private key
+ * SigningKey.computePublicKey(sign.privateKey)
+ * //_result:
+ *
+ * // Compute the compressed public key for a private key
+ * SigningKey.computePublicKey(sign.privateKey, true)
+ * //_result:
+ *
+ * // Compute the uncompressed public key
+ * SigningKey.computePublicKey(sign.publicKey, false);
+ * //_result:
+ *
+ * // Compute the Compressed a public key
+ * SigningKey.computePublicKey(sign.publicKey, true);
+ * //_result:
+ */
+ static computePublicKey(key: BytesLike, compressed?: boolean): string;
+ /**
+ * Returns the public key for the private key which produced the
+ * %%signature%% for the given %%digest%%.
+ *
+ * @example:
+ * key = new SigningKey(id("some-secret"))
+ * digest = id("hello world")
+ * sig = key.sign(digest)
+ *
+ * // Notice the signer public key...
+ * key.publicKey
+ * //_result:
+ *
+ * // ...is equal to the recovered public key
+ * SigningKey.recoverPublicKey(digest, sig)
+ * //_result:
+ *
+ */
+ static recoverPublicKey(digest: BytesLike, signature: SignatureLike): string;
+ /**
+ * Returns the point resulting from adding the ellipic curve points
+ * %%p0%% and %%p1%%.
+ *
+ * This is not a common function most developers should require, but
+ * can be useful for certain privacy-specific techniques.
+ *
+ * For example, it is used by [[HDNodeWallet]] to compute child
+ * addresses from parent public keys and chain codes.
+ */
+ static addPoints(p0: BytesLike, p1: BytesLike, compressed?: boolean): string;
+}
+//# sourceMappingURL=signing-key.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/signing-key.d.ts.map b/dist/ethers.js/src.ts/crypto/signing-key.d.ts.map
new file mode 100644
index 0000000..0670d24
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/signing-key.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"signing-key.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/crypto/signing-key.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGhD;;;GAGG;AACH,qBAAa,UAAU;;IAGnB;;OAEG;gBACS,UAAU,EAAE,SAAS;IAKjC;;OAEG;IACH,IAAI,UAAU,IAAI,MAAM,CAA6B;IAErD;;;;;OAKG;IACH,IAAI,SAAS,IAAI,MAAM,CAA0D;IAEjF;;;;;;OAMG;IACH,IAAI,mBAAmB,IAAI,MAAM,CAAgE;IAEjG;;OAEG;IACH,IAAI,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS;IAclC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM;IAK7C;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM;IAqBrE;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,GAAG,MAAM;IAc5E;;;;;;;;;OASG;IACH,MAAM,CAAC,SAAS,CAAC,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM;CAK/E"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/signing-key.js b/dist/ethers.js/src.ts/crypto/signing-key.js
new file mode 100644
index 0000000..c7bc5ce
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/signing-key.js
@@ -0,0 +1,183 @@
+"use strict";
+/**
+ * Add details about signing here.
+ *
+ * @_subsection: api/crypto:Signing [about-signing]
+ */
+var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
+ if (kind === "m") throw new TypeError("Private method is not writable");
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
+};
+var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
+};
+var _SigningKey_privateKey;
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.SigningKey = void 0;
+const secp256k1_1 = require("@noble/curves/secp256k1");
+const index_js_1 = require("../utils/index.js");
+const signature_js_1 = require("./signature.js");
+/**
+ * A **SigningKey** provides high-level access to the elliptic curve
+ * cryptography (ECC) operations and key management.
+ */
+class SigningKey {
+ /**
+ * Creates a new **SigningKey** for %%privateKey%%.
+ */
+ constructor(privateKey) {
+ _SigningKey_privateKey.set(this, void 0);
+ (0, index_js_1.assertArgument)((0, index_js_1.dataLength)(privateKey) === 32, "invalid private key", "privateKey", "[REDACTED]");
+ __classPrivateFieldSet(this, _SigningKey_privateKey, (0, index_js_1.hexlify)(privateKey), "f");
+ }
+ /**
+ * The private key.
+ */
+ get privateKey() { return __classPrivateFieldGet(this, _SigningKey_privateKey, "f"); }
+ /**
+ * The uncompressed public key.
+ *
+ * This will always begin with the prefix ``0x04`` and be 132
+ * characters long (the ``0x`` prefix and 130 hexadecimal nibbles).
+ */
+ get publicKey() { return SigningKey.computePublicKey(__classPrivateFieldGet(this, _SigningKey_privateKey, "f")); }
+ /**
+ * The compressed public key.
+ *
+ * This will always begin with either the prefix ``0x02`` or ``0x03``
+ * and be 68 characters long (the ``0x`` prefix and 33 hexadecimal
+ * nibbles)
+ */
+ get compressedPublicKey() { return SigningKey.computePublicKey(__classPrivateFieldGet(this, _SigningKey_privateKey, "f"), true); }
+ /**
+ * Return the signature of the signed %%digest%%.
+ */
+ sign(digest) {
+ (0, index_js_1.assertArgument)((0, index_js_1.dataLength)(digest) === 32, "invalid digest length", "digest", digest);
+ const sig = secp256k1_1.secp256k1.sign((0, index_js_1.getBytesCopy)(digest), (0, index_js_1.getBytesCopy)(__classPrivateFieldGet(this, _SigningKey_privateKey, "f")), {
+ lowS: true
+ });
+ return signature_js_1.Signature.from({
+ r: (0, index_js_1.toBeHex)(sig.r, 32),
+ s: (0, index_js_1.toBeHex)(sig.s, 32),
+ v: (sig.recovery ? 0x1c : 0x1b)
+ });
+ }
+ /**
+ * Returns the [[link-wiki-ecdh]] shared secret between this
+ * private key and the %%other%% key.
+ *
+ * The %%other%% key may be any type of key, a raw public key,
+ * a compressed/uncompressed pubic key or aprivate key.
+ *
+ * Best practice is usually to use a cryptographic hash on the
+ * returned value before using it as a symetric secret.
+ *
+ * @example:
+ * sign1 = new SigningKey(id("some-secret-1"))
+ * sign2 = new SigningKey(id("some-secret-2"))
+ *
+ * // Notice that privA.computeSharedSecret(pubB)...
+ * sign1.computeSharedSecret(sign2.publicKey)
+ * //_result:
+ *
+ * // ...is equal to privB.computeSharedSecret(pubA).
+ * sign2.computeSharedSecret(sign1.publicKey)
+ * //_result:
+ */
+ computeSharedSecret(other) {
+ const pubKey = SigningKey.computePublicKey(other);
+ return (0, index_js_1.hexlify)(secp256k1_1.secp256k1.getSharedSecret((0, index_js_1.getBytesCopy)(__classPrivateFieldGet(this, _SigningKey_privateKey, "f")), (0, index_js_1.getBytes)(pubKey), false));
+ }
+ /**
+ * Compute the public key for %%key%%, optionally %%compressed%%.
+ *
+ * The %%key%% may be any type of key, a raw public key, a
+ * compressed/uncompressed public key or private key.
+ *
+ * @example:
+ * sign = new SigningKey(id("some-secret"));
+ *
+ * // Compute the uncompressed public key for a private key
+ * SigningKey.computePublicKey(sign.privateKey)
+ * //_result:
+ *
+ * // Compute the compressed public key for a private key
+ * SigningKey.computePublicKey(sign.privateKey, true)
+ * //_result:
+ *
+ * // Compute the uncompressed public key
+ * SigningKey.computePublicKey(sign.publicKey, false);
+ * //_result:
+ *
+ * // Compute the Compressed a public key
+ * SigningKey.computePublicKey(sign.publicKey, true);
+ * //_result:
+ */
+ static computePublicKey(key, compressed) {
+ let bytes = (0, index_js_1.getBytes)(key, "key");
+ // private key
+ if (bytes.length === 32) {
+ const pubKey = secp256k1_1.secp256k1.getPublicKey(bytes, !!compressed);
+ return (0, index_js_1.hexlify)(pubKey);
+ }
+ // raw public key; use uncompressed key with 0x04 prefix
+ if (bytes.length === 64) {
+ const pub = new Uint8Array(65);
+ pub[0] = 0x04;
+ pub.set(bytes, 1);
+ bytes = pub;
+ }
+ const point = secp256k1_1.secp256k1.ProjectivePoint.fromHex(bytes);
+ return (0, index_js_1.hexlify)(point.toRawBytes(compressed));
+ }
+ /**
+ * Returns the public key for the private key which produced the
+ * %%signature%% for the given %%digest%%.
+ *
+ * @example:
+ * key = new SigningKey(id("some-secret"))
+ * digest = id("hello world")
+ * sig = key.sign(digest)
+ *
+ * // Notice the signer public key...
+ * key.publicKey
+ * //_result:
+ *
+ * // ...is equal to the recovered public key
+ * SigningKey.recoverPublicKey(digest, sig)
+ * //_result:
+ *
+ */
+ static recoverPublicKey(digest, signature) {
+ (0, index_js_1.assertArgument)((0, index_js_1.dataLength)(digest) === 32, "invalid digest length", "digest", digest);
+ const sig = signature_js_1.Signature.from(signature);
+ let secpSig = secp256k1_1.secp256k1.Signature.fromCompact((0, index_js_1.getBytesCopy)((0, index_js_1.concat)([sig.r, sig.s])));
+ secpSig = secpSig.addRecoveryBit(sig.yParity);
+ const pubKey = secpSig.recoverPublicKey((0, index_js_1.getBytesCopy)(digest));
+ (0, index_js_1.assertArgument)(pubKey != null, "invalid signautre for digest", "signature", signature);
+ return "0x" + pubKey.toHex(false);
+ }
+ /**
+ * Returns the point resulting from adding the ellipic curve points
+ * %%p0%% and %%p1%%.
+ *
+ * This is not a common function most developers should require, but
+ * can be useful for certain privacy-specific techniques.
+ *
+ * For example, it is used by [[HDNodeWallet]] to compute child
+ * addresses from parent public keys and chain codes.
+ */
+ static addPoints(p0, p1, compressed) {
+ const pub0 = secp256k1_1.secp256k1.ProjectivePoint.fromHex(SigningKey.computePublicKey(p0).substring(2));
+ const pub1 = secp256k1_1.secp256k1.ProjectivePoint.fromHex(SigningKey.computePublicKey(p1).substring(2));
+ return "0x" + pub0.add(pub1).toHex(!!compressed);
+ }
+}
+exports.SigningKey = SigningKey;
+_SigningKey_privateKey = new WeakMap();
+//# sourceMappingURL=signing-key.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/crypto/signing-key.js.map b/dist/ethers.js/src.ts/crypto/signing-key.js.map
new file mode 100644
index 0000000..0f22cd2
--- /dev/null
+++ b/dist/ethers.js/src.ts/crypto/signing-key.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"signing-key.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/crypto/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AAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,CAAA;IACpD,CAAC;CACJ;AA1KD,gCA0KC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/ethers.d.ts b/dist/ethers.js/src.ts/ethers.d.ts
new file mode 100644
index 0000000..c5225fa
--- /dev/null
+++ b/dist/ethers.js/src.ts/ethers.d.ts
@@ -0,0 +1,22 @@
+export { version } from "./_version.js";
+export { decodeBytes32String, encodeBytes32String, AbiCoder, ConstructorFragment, ErrorFragment, EventFragment, Fragment, FallbackFragment, FunctionFragment, NamedFragment, ParamType, StructFragment, checkResultErrors, ErrorDescription, Indexed, Interface, LogDescription, Result, TransactionDescription, Typed, } from "./abi/index.js";
+export { getAddress, getIcapAddress, getCreateAddress, getCreate2Address, isAddressable, isAddress, resolveAddress } from "./address/index.js";
+export { ZeroAddress, WeiPerEther, MaxUint256, MinInt256, MaxInt256, N, ZeroHash, EtherSymbol, MessagePrefix } from "./constants/index.js";
+export { BaseContract, Contract, ContractFactory, ContractEventPayload, ContractTransactionReceipt, ContractTransactionResponse, ContractUnknownEventPayload, EventLog, UndecodedEventLog } 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, 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";
+export { Wordlist, LangEn, WordlistOwl, WordlistOwlA, wordlists } from "./wordlists/index.js";
+export type { JsonFragment, JsonFragmentType, FormatType, FragmentType, InterfaceAbi, ParamTypeWalkFunc, ParamTypeWalkAsyncFunc } from "./abi/index.js";
+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, 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, RlpStructuredDataish, 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";
+//# sourceMappingURL=ethers.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/ethers.d.ts.map b/dist/ethers.js/src.ts/ethers.d.ts.map
new file mode 100644
index 0000000..18e31b2
--- /dev/null
+++ b/dist/ethers.js/src.ts/ethers.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"ethers.d.ts","sourceRoot":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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,EAAE,oBAAoB,EAEvC,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"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/ethers.js b/dist/ethers.js/src.ts/ethers.js
new file mode 100644
index 0000000..47b3e70
--- /dev/null
+++ b/dist/ethers.js/src.ts/ethers.js
@@ -0,0 +1,209 @@
+"use strict";
+/////////////////////////////
+//
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.ripemd160 = exports.keccak256 = exports.randomBytes = exports.computeHmac = exports.UndecodedEventLog = 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.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 = exports.sha256 = void 0;
+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 = exports.FeeDataNetworkPlugin = 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 = exports.toBigInt = 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");
+Object.defineProperty(exports, "decodeBytes32String", { enumerable: true, get: function () { return index_js_1.decodeBytes32String; } });
+Object.defineProperty(exports, "encodeBytes32String", { enumerable: true, get: function () { return index_js_1.encodeBytes32String; } });
+Object.defineProperty(exports, "AbiCoder", { enumerable: true, get: function () { return index_js_1.AbiCoder; } });
+Object.defineProperty(exports, "ConstructorFragment", { enumerable: true, get: function () { return index_js_1.ConstructorFragment; } });
+Object.defineProperty(exports, "ErrorFragment", { enumerable: true, get: function () { return index_js_1.ErrorFragment; } });
+Object.defineProperty(exports, "EventFragment", { enumerable: true, get: function () { return index_js_1.EventFragment; } });
+Object.defineProperty(exports, "Fragment", { enumerable: true, get: function () { return index_js_1.Fragment; } });
+Object.defineProperty(exports, "FallbackFragment", { enumerable: true, get: function () { return index_js_1.FallbackFragment; } });
+Object.defineProperty(exports, "FunctionFragment", { enumerable: true, get: function () { return index_js_1.FunctionFragment; } });
+Object.defineProperty(exports, "NamedFragment", { enumerable: true, get: function () { return index_js_1.NamedFragment; } });
+Object.defineProperty(exports, "ParamType", { enumerable: true, get: function () { return index_js_1.ParamType; } });
+Object.defineProperty(exports, "StructFragment", { enumerable: true, get: function () { return index_js_1.StructFragment; } });
+Object.defineProperty(exports, "checkResultErrors", { enumerable: true, get: function () { return index_js_1.checkResultErrors; } });
+Object.defineProperty(exports, "ErrorDescription", { enumerable: true, get: function () { return index_js_1.ErrorDescription; } });
+Object.defineProperty(exports, "Indexed", { enumerable: true, get: function () { return index_js_1.Indexed; } });
+Object.defineProperty(exports, "Interface", { enumerable: true, get: function () { return index_js_1.Interface; } });
+Object.defineProperty(exports, "LogDescription", { enumerable: true, get: function () { return index_js_1.LogDescription; } });
+Object.defineProperty(exports, "Result", { enumerable: true, get: function () { return index_js_1.Result; } });
+Object.defineProperty(exports, "TransactionDescription", { enumerable: true, get: function () { return index_js_1.TransactionDescription; } });
+Object.defineProperty(exports, "Typed", { enumerable: true, get: function () { return index_js_1.Typed; } });
+var index_js_2 = require("./address/index.js");
+Object.defineProperty(exports, "getAddress", { enumerable: true, get: function () { return index_js_2.getAddress; } });
+Object.defineProperty(exports, "getIcapAddress", { enumerable: true, get: function () { return index_js_2.getIcapAddress; } });
+Object.defineProperty(exports, "getCreateAddress", { enumerable: true, get: function () { return index_js_2.getCreateAddress; } });
+Object.defineProperty(exports, "getCreate2Address", { enumerable: true, get: function () { return index_js_2.getCreate2Address; } });
+Object.defineProperty(exports, "isAddressable", { enumerable: true, get: function () { return index_js_2.isAddressable; } });
+Object.defineProperty(exports, "isAddress", { enumerable: true, get: function () { return index_js_2.isAddress; } });
+Object.defineProperty(exports, "resolveAddress", { enumerable: true, get: function () { return index_js_2.resolveAddress; } });
+var index_js_3 = require("./constants/index.js");
+Object.defineProperty(exports, "ZeroAddress", { enumerable: true, get: function () { return index_js_3.ZeroAddress; } });
+Object.defineProperty(exports, "WeiPerEther", { enumerable: true, get: function () { return index_js_3.WeiPerEther; } });
+Object.defineProperty(exports, "MaxUint256", { enumerable: true, get: function () { return index_js_3.MaxUint256; } });
+Object.defineProperty(exports, "MinInt256", { enumerable: true, get: function () { return index_js_3.MinInt256; } });
+Object.defineProperty(exports, "MaxInt256", { enumerable: true, get: function () { return index_js_3.MaxInt256; } });
+Object.defineProperty(exports, "N", { enumerable: true, get: function () { return index_js_3.N; } });
+Object.defineProperty(exports, "ZeroHash", { enumerable: true, get: function () { return index_js_3.ZeroHash; } });
+Object.defineProperty(exports, "EtherSymbol", { enumerable: true, get: function () { return index_js_3.EtherSymbol; } });
+Object.defineProperty(exports, "MessagePrefix", { enumerable: true, get: function () { return index_js_3.MessagePrefix; } });
+var index_js_4 = require("./contract/index.js");
+Object.defineProperty(exports, "BaseContract", { enumerable: true, get: function () { return index_js_4.BaseContract; } });
+Object.defineProperty(exports, "Contract", { enumerable: true, get: function () { return index_js_4.Contract; } });
+Object.defineProperty(exports, "ContractFactory", { enumerable: true, get: function () { return index_js_4.ContractFactory; } });
+Object.defineProperty(exports, "ContractEventPayload", { enumerable: true, get: function () { return index_js_4.ContractEventPayload; } });
+Object.defineProperty(exports, "ContractTransactionReceipt", { enumerable: true, get: function () { return index_js_4.ContractTransactionReceipt; } });
+Object.defineProperty(exports, "ContractTransactionResponse", { enumerable: true, get: function () { return index_js_4.ContractTransactionResponse; } });
+Object.defineProperty(exports, "ContractUnknownEventPayload", { enumerable: true, get: function () { return index_js_4.ContractUnknownEventPayload; } });
+Object.defineProperty(exports, "EventLog", { enumerable: true, get: function () { return index_js_4.EventLog; } });
+Object.defineProperty(exports, "UndecodedEventLog", { enumerable: true, get: function () { return index_js_4.UndecodedEventLog; } });
+var index_js_5 = require("./crypto/index.js");
+Object.defineProperty(exports, "computeHmac", { enumerable: true, get: function () { return index_js_5.computeHmac; } });
+Object.defineProperty(exports, "randomBytes", { enumerable: true, get: function () { return index_js_5.randomBytes; } });
+Object.defineProperty(exports, "keccak256", { enumerable: true, get: function () { return index_js_5.keccak256; } });
+Object.defineProperty(exports, "ripemd160", { enumerable: true, get: function () { return index_js_5.ripemd160; } });
+Object.defineProperty(exports, "sha256", { enumerable: true, get: function () { return index_js_5.sha256; } });
+Object.defineProperty(exports, "sha512", { enumerable: true, get: function () { return index_js_5.sha512; } });
+Object.defineProperty(exports, "pbkdf2", { enumerable: true, get: function () { return index_js_5.pbkdf2; } });
+Object.defineProperty(exports, "scrypt", { enumerable: true, get: function () { return index_js_5.scrypt; } });
+Object.defineProperty(exports, "scryptSync", { enumerable: true, get: function () { return index_js_5.scryptSync; } });
+Object.defineProperty(exports, "lock", { enumerable: true, get: function () { return index_js_5.lock; } });
+Object.defineProperty(exports, "Signature", { enumerable: true, get: function () { return index_js_5.Signature; } });
+Object.defineProperty(exports, "SigningKey", { enumerable: true, get: function () { return index_js_5.SigningKey; } });
+var index_js_6 = require("./hash/index.js");
+Object.defineProperty(exports, "id", { enumerable: true, get: function () { return index_js_6.id; } });
+Object.defineProperty(exports, "ensNormalize", { enumerable: true, get: function () { return index_js_6.ensNormalize; } });
+Object.defineProperty(exports, "isValidName", { enumerable: true, get: function () { return index_js_6.isValidName; } });
+Object.defineProperty(exports, "namehash", { enumerable: true, get: function () { return index_js_6.namehash; } });
+Object.defineProperty(exports, "dnsEncode", { enumerable: true, get: function () { return index_js_6.dnsEncode; } });
+Object.defineProperty(exports, "hashMessage", { enumerable: true, get: function () { return index_js_6.hashMessage; } });
+Object.defineProperty(exports, "verifyMessage", { enumerable: true, get: function () { return index_js_6.verifyMessage; } });
+Object.defineProperty(exports, "solidityPacked", { enumerable: true, get: function () { return index_js_6.solidityPacked; } });
+Object.defineProperty(exports, "solidityPackedKeccak256", { enumerable: true, get: function () { return index_js_6.solidityPackedKeccak256; } });
+Object.defineProperty(exports, "solidityPackedSha256", { enumerable: true, get: function () { return index_js_6.solidityPackedSha256; } });
+Object.defineProperty(exports, "TypedDataEncoder", { enumerable: true, get: function () { return index_js_6.TypedDataEncoder; } });
+Object.defineProperty(exports, "verifyTypedData", { enumerable: true, get: function () { return index_js_6.verifyTypedData; } });
+var index_js_7 = require("./providers/index.js");
+Object.defineProperty(exports, "getDefaultProvider", { enumerable: true, get: function () { return index_js_7.getDefaultProvider; } });
+Object.defineProperty(exports, "Block", { enumerable: true, get: function () { return index_js_7.Block; } });
+Object.defineProperty(exports, "FeeData", { enumerable: true, get: function () { return index_js_7.FeeData; } });
+Object.defineProperty(exports, "Log", { enumerable: true, get: function () { return index_js_7.Log; } });
+Object.defineProperty(exports, "TransactionReceipt", { enumerable: true, get: function () { return index_js_7.TransactionReceipt; } });
+Object.defineProperty(exports, "TransactionResponse", { enumerable: true, get: function () { return index_js_7.TransactionResponse; } });
+Object.defineProperty(exports, "AbstractSigner", { enumerable: true, get: function () { return index_js_7.AbstractSigner; } });
+Object.defineProperty(exports, "NonceManager", { enumerable: true, get: function () { return index_js_7.NonceManager; } });
+Object.defineProperty(exports, "VoidSigner", { enumerable: true, get: function () { return index_js_7.VoidSigner; } });
+Object.defineProperty(exports, "AbstractProvider", { enumerable: true, get: function () { return index_js_7.AbstractProvider; } });
+Object.defineProperty(exports, "FallbackProvider", { enumerable: true, get: function () { return index_js_7.FallbackProvider; } });
+Object.defineProperty(exports, "JsonRpcApiProvider", { enumerable: true, get: function () { return index_js_7.JsonRpcApiProvider; } });
+Object.defineProperty(exports, "JsonRpcProvider", { enumerable: true, get: function () { return index_js_7.JsonRpcProvider; } });
+Object.defineProperty(exports, "JsonRpcSigner", { enumerable: true, get: function () { return index_js_7.JsonRpcSigner; } });
+Object.defineProperty(exports, "BrowserProvider", { enumerable: true, get: function () { return index_js_7.BrowserProvider; } });
+Object.defineProperty(exports, "AlchemyProvider", { enumerable: true, get: function () { return index_js_7.AlchemyProvider; } });
+Object.defineProperty(exports, "AnkrProvider", { enumerable: true, get: function () { return index_js_7.AnkrProvider; } });
+Object.defineProperty(exports, "CloudflareProvider", { enumerable: true, get: function () { return index_js_7.CloudflareProvider; } });
+Object.defineProperty(exports, "EtherscanProvider", { enumerable: true, get: function () { return index_js_7.EtherscanProvider; } });
+Object.defineProperty(exports, "InfuraProvider", { enumerable: true, get: function () { return index_js_7.InfuraProvider; } });
+Object.defineProperty(exports, "InfuraWebSocketProvider", { enumerable: true, get: function () { return index_js_7.InfuraWebSocketProvider; } });
+Object.defineProperty(exports, "PocketProvider", { enumerable: true, get: function () { return index_js_7.PocketProvider; } });
+Object.defineProperty(exports, "QuickNodeProvider", { enumerable: true, get: function () { return index_js_7.QuickNodeProvider; } });
+Object.defineProperty(exports, "IpcSocketProvider", { enumerable: true, get: function () { return index_js_7.IpcSocketProvider; } });
+Object.defineProperty(exports, "SocketProvider", { enumerable: true, get: function () { return index_js_7.SocketProvider; } });
+Object.defineProperty(exports, "WebSocketProvider", { enumerable: true, get: function () { return index_js_7.WebSocketProvider; } });
+Object.defineProperty(exports, "EnsResolver", { enumerable: true, get: function () { return index_js_7.EnsResolver; } });
+Object.defineProperty(exports, "Network", { enumerable: true, get: function () { return index_js_7.Network; } });
+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; } });
+Object.defineProperty(exports, "SocketBlockSubscriber", { enumerable: true, get: function () { return index_js_7.SocketBlockSubscriber; } });
+Object.defineProperty(exports, "SocketEventSubscriber", { enumerable: true, get: function () { return index_js_7.SocketEventSubscriber; } });
+Object.defineProperty(exports, "SocketPendingSubscriber", { enumerable: true, get: function () { return index_js_7.SocketPendingSubscriber; } });
+Object.defineProperty(exports, "SocketSubscriber", { enumerable: true, get: function () { return index_js_7.SocketSubscriber; } });
+Object.defineProperty(exports, "UnmanagedSubscriber", { enumerable: true, get: function () { return index_js_7.UnmanagedSubscriber; } });
+Object.defineProperty(exports, "copyRequest", { enumerable: true, get: function () { return index_js_7.copyRequest; } });
+Object.defineProperty(exports, "showThrottleMessage", { enumerable: true, get: function () { return index_js_7.showThrottleMessage; } });
+var index_js_8 = require("./transaction/index.js");
+Object.defineProperty(exports, "accessListify", { enumerable: true, get: function () { return index_js_8.accessListify; } });
+Object.defineProperty(exports, "computeAddress", { enumerable: true, get: function () { return index_js_8.computeAddress; } });
+Object.defineProperty(exports, "recoverAddress", { enumerable: true, get: function () { return index_js_8.recoverAddress; } });
+Object.defineProperty(exports, "Transaction", { enumerable: true, get: function () { return index_js_8.Transaction; } });
+var index_js_9 = require("./utils/index.js");
+Object.defineProperty(exports, "decodeBase58", { enumerable: true, get: function () { return index_js_9.decodeBase58; } });
+Object.defineProperty(exports, "encodeBase58", { enumerable: true, get: function () { return index_js_9.encodeBase58; } });
+Object.defineProperty(exports, "decodeBase64", { enumerable: true, get: function () { return index_js_9.decodeBase64; } });
+Object.defineProperty(exports, "encodeBase64", { enumerable: true, get: function () { return index_js_9.encodeBase64; } });
+Object.defineProperty(exports, "concat", { enumerable: true, get: function () { return index_js_9.concat; } });
+Object.defineProperty(exports, "dataLength", { enumerable: true, get: function () { return index_js_9.dataLength; } });
+Object.defineProperty(exports, "dataSlice", { enumerable: true, get: function () { return index_js_9.dataSlice; } });
+Object.defineProperty(exports, "getBytes", { enumerable: true, get: function () { return index_js_9.getBytes; } });
+Object.defineProperty(exports, "getBytesCopy", { enumerable: true, get: function () { return index_js_9.getBytesCopy; } });
+Object.defineProperty(exports, "hexlify", { enumerable: true, get: function () { return index_js_9.hexlify; } });
+Object.defineProperty(exports, "isHexString", { enumerable: true, get: function () { return index_js_9.isHexString; } });
+Object.defineProperty(exports, "isBytesLike", { enumerable: true, get: function () { return index_js_9.isBytesLike; } });
+Object.defineProperty(exports, "stripZerosLeft", { enumerable: true, get: function () { return index_js_9.stripZerosLeft; } });
+Object.defineProperty(exports, "zeroPadBytes", { enumerable: true, get: function () { return index_js_9.zeroPadBytes; } });
+Object.defineProperty(exports, "zeroPadValue", { enumerable: true, get: function () { return index_js_9.zeroPadValue; } });
+Object.defineProperty(exports, "defineProperties", { enumerable: true, get: function () { return index_js_9.defineProperties; } });
+Object.defineProperty(exports, "resolveProperties", { enumerable: true, get: function () { return index_js_9.resolveProperties; } });
+Object.defineProperty(exports, "assert", { enumerable: true, get: function () { return index_js_9.assert; } });
+Object.defineProperty(exports, "assertArgument", { enumerable: true, get: function () { return index_js_9.assertArgument; } });
+Object.defineProperty(exports, "assertArgumentCount", { enumerable: true, get: function () { return index_js_9.assertArgumentCount; } });
+Object.defineProperty(exports, "assertNormalize", { enumerable: true, get: function () { return index_js_9.assertNormalize; } });
+Object.defineProperty(exports, "assertPrivate", { enumerable: true, get: function () { return index_js_9.assertPrivate; } });
+Object.defineProperty(exports, "makeError", { enumerable: true, get: function () { return index_js_9.makeError; } });
+Object.defineProperty(exports, "isCallException", { enumerable: true, get: function () { return index_js_9.isCallException; } });
+Object.defineProperty(exports, "isError", { enumerable: true, get: function () { return index_js_9.isError; } });
+Object.defineProperty(exports, "EventPayload", { enumerable: true, get: function () { return index_js_9.EventPayload; } });
+Object.defineProperty(exports, "FetchRequest", { enumerable: true, get: function () { return index_js_9.FetchRequest; } });
+Object.defineProperty(exports, "FetchResponse", { enumerable: true, get: function () { return index_js_9.FetchResponse; } });
+Object.defineProperty(exports, "FetchCancelSignal", { enumerable: true, get: function () { return index_js_9.FetchCancelSignal; } });
+Object.defineProperty(exports, "FixedNumber", { enumerable: true, get: function () { return index_js_9.FixedNumber; } });
+Object.defineProperty(exports, "getBigInt", { enumerable: true, get: function () { return index_js_9.getBigInt; } });
+Object.defineProperty(exports, "getNumber", { enumerable: true, get: function () { return index_js_9.getNumber; } });
+Object.defineProperty(exports, "getUint", { enumerable: true, get: function () { return index_js_9.getUint; } });
+Object.defineProperty(exports, "toBeArray", { enumerable: true, get: function () { return index_js_9.toBeArray; } });
+Object.defineProperty(exports, "toBigInt", { enumerable: true, get: function () { return index_js_9.toBigInt; } });
+Object.defineProperty(exports, "toBeHex", { enumerable: true, get: function () { return index_js_9.toBeHex; } });
+Object.defineProperty(exports, "toNumber", { enumerable: true, get: function () { return index_js_9.toNumber; } });
+Object.defineProperty(exports, "toQuantity", { enumerable: true, get: function () { return index_js_9.toQuantity; } });
+Object.defineProperty(exports, "fromTwos", { enumerable: true, get: function () { return index_js_9.fromTwos; } });
+Object.defineProperty(exports, "toTwos", { enumerable: true, get: function () { return index_js_9.toTwos; } });
+Object.defineProperty(exports, "mask", { enumerable: true, get: function () { return index_js_9.mask; } });
+Object.defineProperty(exports, "formatEther", { enumerable: true, get: function () { return index_js_9.formatEther; } });
+Object.defineProperty(exports, "parseEther", { enumerable: true, get: function () { return index_js_9.parseEther; } });
+Object.defineProperty(exports, "formatUnits", { enumerable: true, get: function () { return index_js_9.formatUnits; } });
+Object.defineProperty(exports, "parseUnits", { enumerable: true, get: function () { return index_js_9.parseUnits; } });
+Object.defineProperty(exports, "toUtf8Bytes", { enumerable: true, get: function () { return index_js_9.toUtf8Bytes; } });
+Object.defineProperty(exports, "toUtf8CodePoints", { enumerable: true, get: function () { return index_js_9.toUtf8CodePoints; } });
+Object.defineProperty(exports, "toUtf8String", { enumerable: true, get: function () { return index_js_9.toUtf8String; } });
+Object.defineProperty(exports, "Utf8ErrorFuncs", { enumerable: true, get: function () { return index_js_9.Utf8ErrorFuncs; } });
+Object.defineProperty(exports, "decodeRlp", { enumerable: true, get: function () { return index_js_9.decodeRlp; } });
+Object.defineProperty(exports, "encodeRlp", { enumerable: true, get: function () { return index_js_9.encodeRlp; } });
+Object.defineProperty(exports, "uuidV4", { enumerable: true, get: function () { return index_js_9.uuidV4; } });
+var index_js_10 = require("./wallet/index.js");
+Object.defineProperty(exports, "Mnemonic", { enumerable: true, get: function () { return index_js_10.Mnemonic; } });
+Object.defineProperty(exports, "BaseWallet", { enumerable: true, get: function () { return index_js_10.BaseWallet; } });
+Object.defineProperty(exports, "HDNodeWallet", { enumerable: true, get: function () { return index_js_10.HDNodeWallet; } });
+Object.defineProperty(exports, "HDNodeVoidWallet", { enumerable: true, get: function () { return index_js_10.HDNodeVoidWallet; } });
+Object.defineProperty(exports, "Wallet", { enumerable: true, get: function () { return index_js_10.Wallet; } });
+Object.defineProperty(exports, "defaultPath", { enumerable: true, get: function () { return index_js_10.defaultPath; } });
+Object.defineProperty(exports, "getAccountPath", { enumerable: true, get: function () { return index_js_10.getAccountPath; } });
+Object.defineProperty(exports, "getIndexedAccountPath", { enumerable: true, get: function () { return index_js_10.getIndexedAccountPath; } });
+Object.defineProperty(exports, "isCrowdsaleJson", { enumerable: true, get: function () { return index_js_10.isCrowdsaleJson; } });
+Object.defineProperty(exports, "isKeystoreJson", { enumerable: true, get: function () { return index_js_10.isKeystoreJson; } });
+Object.defineProperty(exports, "decryptCrowdsaleJson", { enumerable: true, get: function () { return index_js_10.decryptCrowdsaleJson; } });
+Object.defineProperty(exports, "decryptKeystoreJsonSync", { enumerable: true, get: function () { return index_js_10.decryptKeystoreJsonSync; } });
+Object.defineProperty(exports, "decryptKeystoreJson", { enumerable: true, get: function () { return index_js_10.decryptKeystoreJson; } });
+Object.defineProperty(exports, "encryptKeystoreJson", { enumerable: true, get: function () { return index_js_10.encryptKeystoreJson; } });
+Object.defineProperty(exports, "encryptKeystoreJsonSync", { enumerable: true, get: function () { return index_js_10.encryptKeystoreJsonSync; } });
+var index_js_11 = require("./wordlists/index.js");
+Object.defineProperty(exports, "Wordlist", { enumerable: true, get: function () { return index_js_11.Wordlist; } });
+Object.defineProperty(exports, "LangEn", { enumerable: true, get: function () { return index_js_11.LangEn; } });
+Object.defineProperty(exports, "WordlistOwl", { enumerable: true, get: function () { return index_js_11.WordlistOwl; } });
+Object.defineProperty(exports, "WordlistOwlA", { enumerable: true, get: function () { return index_js_11.WordlistOwlA; } });
+Object.defineProperty(exports, "wordlists", { enumerable: true, get: function () { return index_js_11.wordlists; } });
+//# sourceMappingURL=ethers.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/ethers.js.map b/dist/ethers.js/src.ts/ethers.js.map
new file mode 100644
index 0000000..b9f2516
--- /dev/null
+++ b/dist/ethers.js/src.ts/ethers.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"ethers.js","sourceRoot":"","sources":["../../../src/ethers.js/src.ts/ethers.ts"],"names":[],"mappings":";AAEA,6BAA6B;AAC7B,EAAE;;;;;;AAEF,6CAAwC;AAA/B,sGAAA,OAAO,OAAA;AAEh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A,QAAQ,OAAA;AAAE,mGAAA,MAAM,OAAA;AAAE,wGAAA,WAAW,OAAA;AAAE,yGAAA,YAAY,OAAA;AAAE,sGAAA,SAAS,OAAA"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/hash/id.d.ts b/dist/ethers.js/src.ts/hash/id.d.ts
new file mode 100644
index 0000000..8d5e057
--- /dev/null
+++ b/dist/ethers.js/src.ts/hash/id.d.ts
@@ -0,0 +1,13 @@
+/**
+ * A simple hashing function which operates on UTF-8 strings to
+ * compute an 32-byte identifier.
+ *
+ * This simply computes the [UTF-8 bytes](toUtf8Bytes) and computes
+ * the [[keccak256]].
+ *
+ * @example:
+ * id("hello world")
+ * //_result:
+ */
+export declare function id(value: string): string;
+//# sourceMappingURL=id.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/hash/id.d.ts.map b/dist/ethers.js/src.ts/hash/id.d.ts.map
new file mode 100644
index 0000000..0386835
--- /dev/null
+++ b/dist/ethers.js/src.ts/hash/id.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"id.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/hash/id.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AACH,wBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAExC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/hash/id.js b/dist/ethers.js/src.ts/hash/id.js
new file mode 100644
index 0000000..47dc591
--- /dev/null
+++ b/dist/ethers.js/src.ts/hash/id.js
@@ -0,0 +1,21 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.id = void 0;
+const index_js_1 = require("../crypto/index.js");
+const index_js_2 = require("../utils/index.js");
+/**
+ * A simple hashing function which operates on UTF-8 strings to
+ * compute an 32-byte identifier.
+ *
+ * This simply computes the [UTF-8 bytes](toUtf8Bytes) and computes
+ * the [[keccak256]].
+ *
+ * @example:
+ * id("hello world")
+ * //_result:
+ */
+function id(value) {
+ return (0, index_js_1.keccak256)((0, index_js_2.toUtf8Bytes)(value));
+}
+exports.id = id;
+//# sourceMappingURL=id.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/hash/id.js.map b/dist/ethers.js/src.ts/hash/id.js.map
new file mode 100644
index 0000000..60ef238
--- /dev/null
+++ b/dist/ethers.js/src.ts/hash/id.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"id.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/hash/id.ts"],"names":[],"mappings":";;;AAAA,iDAA+C;AAC/C,gDAAgD;AAEhD;;;;;;;;;;GAUG;AACH,SAAgB,EAAE,CAAC,KAAa;IAC5B,OAAO,IAAA,oBAAS,EAAC,IAAA,sBAAW,EAAC,KAAK,CAAC,CAAC,CAAC;AACzC,CAAC;AAFD,gBAEC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/hash/index.d.ts b/dist/ethers.js/src.ts/hash/index.d.ts
new file mode 100644
index 0000000..0b165fd
--- /dev/null
+++ b/dist/ethers.js/src.ts/hash/index.d.ts
@@ -0,0 +1,13 @@
+/**
+ * Utilities for common tasks involving hashing. Also see
+ * [cryptographic hashing](about-crypto-hashing).
+ *
+ * @_section: api/hashing:Hashing Utilities [about-hashing]
+ */
+export { id } from "./id.js";
+export { ensNormalize, isValidName, namehash, dnsEncode } from "./namehash.js";
+export { hashMessage, verifyMessage } from "./message.js";
+export { solidityPacked, solidityPackedKeccak256, solidityPackedSha256 } from "./solidity.js";
+export { TypedDataEncoder, verifyTypedData } from "./typed-data.js";
+export type { TypedDataDomain, TypedDataField } from "./typed-data.js";
+//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/hash/index.d.ts.map b/dist/ethers.js/src.ts/hash/index.d.ts.map
new file mode 100644
index 0000000..833b1d6
--- /dev/null
+++ b/dist/ethers.js/src.ts/hash/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/hash/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EACH,cAAc,EAAE,uBAAuB,EAAE,oBAAoB,EAChE,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEpE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/hash/index.js b/dist/ethers.js/src.ts/hash/index.js
new file mode 100644
index 0000000..e2253a4
--- /dev/null
+++ b/dist/ethers.js/src.ts/hash/index.js
@@ -0,0 +1,27 @@
+"use strict";
+/**
+ * Utilities for common tasks involving hashing. Also see
+ * [cryptographic hashing](about-crypto-hashing).
+ *
+ * @_section: api/hashing:Hashing Utilities [about-hashing]
+ */
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.verifyTypedData = exports.TypedDataEncoder = exports.solidityPackedSha256 = exports.solidityPackedKeccak256 = exports.solidityPacked = exports.verifyMessage = exports.hashMessage = exports.dnsEncode = exports.namehash = exports.isValidName = exports.ensNormalize = exports.id = void 0;
+var id_js_1 = require("./id.js");
+Object.defineProperty(exports, "id", { enumerable: true, get: function () { return id_js_1.id; } });
+var namehash_js_1 = require("./namehash.js");
+Object.defineProperty(exports, "ensNormalize", { enumerable: true, get: function () { return namehash_js_1.ensNormalize; } });
+Object.defineProperty(exports, "isValidName", { enumerable: true, get: function () { return namehash_js_1.isValidName; } });
+Object.defineProperty(exports, "namehash", { enumerable: true, get: function () { return namehash_js_1.namehash; } });
+Object.defineProperty(exports, "dnsEncode", { enumerable: true, get: function () { return namehash_js_1.dnsEncode; } });
+var message_js_1 = require("./message.js");
+Object.defineProperty(exports, "hashMessage", { enumerable: true, get: function () { return message_js_1.hashMessage; } });
+Object.defineProperty(exports, "verifyMessage", { enumerable: true, get: function () { return message_js_1.verifyMessage; } });
+var solidity_js_1 = require("./solidity.js");
+Object.defineProperty(exports, "solidityPacked", { enumerable: true, get: function () { return solidity_js_1.solidityPacked; } });
+Object.defineProperty(exports, "solidityPackedKeccak256", { enumerable: true, get: function () { return solidity_js_1.solidityPackedKeccak256; } });
+Object.defineProperty(exports, "solidityPackedSha256", { enumerable: true, get: function () { return solidity_js_1.solidityPackedSha256; } });
+var typed_data_js_1 = require("./typed-data.js");
+Object.defineProperty(exports, "TypedDataEncoder", { enumerable: true, get: function () { return typed_data_js_1.TypedDataEncoder; } });
+Object.defineProperty(exports, "verifyTypedData", { enumerable: true, get: function () { return typed_data_js_1.verifyTypedData; } });
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/hash/index.js.map b/dist/ethers.js/src.ts/hash/index.js.map
new file mode 100644
index 0000000..a6656d2
--- /dev/null
+++ b/dist/ethers.js/src.ts/hash/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/hash/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,iCAA4B;AAAnB,2FAAA,EAAE,OAAA;AACX,6CAA+E;AAAtE,2GAAA,YAAY,OAAA;AAAE,0GAAA,WAAW,OAAA;AAAE,uGAAA,QAAQ,OAAA;AAAE,wGAAA,SAAS,OAAA;AACvD,2CAA0D;AAAjD,yGAAA,WAAW,OAAA;AAAE,2GAAA,aAAa,OAAA;AACnC,6CAEuB;AADnB,6GAAA,cAAc,OAAA;AAAE,sHAAA,uBAAuB,OAAA;AAAE,mHAAA,oBAAoB,OAAA;AAEjE,iDAAoE;AAA3D,iHAAA,gBAAgB,OAAA;AAAE,gHAAA,eAAe,OAAA"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/hash/message.d.ts b/dist/ethers.js/src.ts/hash/message.d.ts
new file mode 100644
index 0000000..9e088be
--- /dev/null
+++ b/dist/ethers.js/src.ts/hash/message.d.ts
@@ -0,0 +1,36 @@
+import type { SignatureLike } from "../crypto/index.js";
+/**
+ * Computes the [[link-eip-191]] personal-sign message digest to sign.
+ *
+ * This prefixes the message with [[MessagePrefix]] and the decimal length
+ * of %%message%% and computes the [[keccak256]] digest.
+ *
+ * If %%message%% is a string, it is converted to its UTF-8 bytes
+ * first. To compute the digest of a [[DataHexString]], it must be converted
+ * to [bytes](getBytes).
+ *
+ * @example:
+ * hashMessage("Hello World")
+ * //_result:
+ *
+ * // Hashes the SIX (6) string characters, i.e.
+ * // [ "0", "x", "4", "2", "4", "3" ]
+ * hashMessage("0x4243")
+ * //_result:
+ *
+ * // Hashes the TWO (2) bytes [ 0x42, 0x43 ]...
+ * hashMessage(getBytes("0x4243"))
+ * //_result:
+ *
+ * // ...which is equal to using data
+ * hashMessage(new Uint8Array([ 0x42, 0x43 ]))
+ * //_result:
+ *
+ */
+export declare function hashMessage(message: Uint8Array | string): string;
+/**
+ * Return the address of the private key that produced
+ * the signature %%sig%% during signing for %%message%%.
+ */
+export declare function verifyMessage(message: Uint8Array | string, sig: SignatureLike): string;
+//# sourceMappingURL=message.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/hash/message.d.ts.map b/dist/ethers.js/src.ts/hash/message.d.ts.map
new file mode 100644
index 0000000..b6b5db0
--- /dev/null
+++ b/dist/ethers.js/src.ts/hash/message.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/hash/message.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,CAOhE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,EAAE,GAAG,EAAE,aAAa,GAAG,MAAM,CAGtF"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/hash/message.js b/dist/ethers.js/src.ts/hash/message.js
new file mode 100644
index 0000000..cc5da95
--- /dev/null
+++ b/dist/ethers.js/src.ts/hash/message.js
@@ -0,0 +1,56 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.verifyMessage = exports.hashMessage = void 0;
+const index_js_1 = require("../crypto/index.js");
+const index_js_2 = require("../constants/index.js");
+const index_js_3 = require("../transaction/index.js");
+const index_js_4 = require("../utils/index.js");
+/**
+ * Computes the [[link-eip-191]] personal-sign message digest to sign.
+ *
+ * This prefixes the message with [[MessagePrefix]] and the decimal length
+ * of %%message%% and computes the [[keccak256]] digest.
+ *
+ * If %%message%% is a string, it is converted to its UTF-8 bytes
+ * first. To compute the digest of a [[DataHexString]], it must be converted
+ * to [bytes](getBytes).
+ *
+ * @example:
+ * hashMessage("Hello World")
+ * //_result:
+ *
+ * // Hashes the SIX (6) string characters, i.e.
+ * // [ "0", "x", "4", "2", "4", "3" ]
+ * hashMessage("0x4243")
+ * //_result:
+ *
+ * // Hashes the TWO (2) bytes [ 0x42, 0x43 ]...
+ * hashMessage(getBytes("0x4243"))
+ * //_result:
+ *
+ * // ...which is equal to using data
+ * hashMessage(new Uint8Array([ 0x42, 0x43 ]))
+ * //_result:
+ *
+ */
+function hashMessage(message) {
+ if (typeof (message) === "string") {
+ message = (0, index_js_4.toUtf8Bytes)(message);
+ }
+ return (0, index_js_1.keccak256)((0, index_js_4.concat)([
+ (0, index_js_4.toUtf8Bytes)(index_js_2.MessagePrefix),
+ (0, index_js_4.toUtf8Bytes)(String(message.length)),
+ message
+ ]));
+}
+exports.hashMessage = hashMessage;
+/**
+ * Return the address of the private key that produced
+ * the signature %%sig%% during signing for %%message%%.
+ */
+function verifyMessage(message, sig) {
+ const digest = hashMessage(message);
+ return (0, index_js_3.recoverAddress)(digest, sig);
+}
+exports.verifyMessage = verifyMessage;
+//# sourceMappingURL=message.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/hash/message.js.map b/dist/ethers.js/src.ts/hash/message.js.map
new file mode 100644
index 0000000..1eb402f
--- /dev/null
+++ b/dist/ethers.js/src.ts/hash/message.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"message.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/hash/message.ts"],"names":[],"mappings":";;;AAAA,iDAA+C;AAC/C,oDAAsD;AACtD,sDAAyD;AACzD,gDAAwD;AAGxD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,SAAgB,WAAW,CAAC,OAA4B;IACpD,IAAI,OAAM,CAAC,OAAO,CAAC,KAAK,QAAQ,EAAE;QAAE,OAAO,GAAG,IAAA,sBAAW,EAAC,OAAO,CAAC,CAAC;KAAE;IACrE,OAAO,IAAA,oBAAS,EAAC,IAAA,iBAAM,EAAC;QACpB,IAAA,sBAAW,EAAC,wBAAa,CAAC;QAC1B,IAAA,sBAAW,EAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACnC,OAAO;KACV,CAAC,CAAC,CAAC;AACR,CAAC;AAPD,kCAOC;AAED;;;GAGG;AACH,SAAgB,aAAa,CAAC,OAA4B,EAAE,GAAkB;IAC1E,MAAM,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;IACpC,OAAO,IAAA,yBAAc,EAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AACvC,CAAC;AAHD,sCAGC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/hash/namehash.d.ts b/dist/ethers.js/src.ts/hash/namehash.d.ts
new file mode 100644
index 0000000..1f3937b
--- /dev/null
+++ b/dist/ethers.js/src.ts/hash/namehash.d.ts
@@ -0,0 +1,20 @@
+/**
+ * Returns the ENS %%name%% normalized.
+ */
+export declare function ensNormalize(name: string): string;
+/**
+ * Returns ``true`` if %%name%% is a valid ENS name.
+ */
+export declare function isValidName(name: string): name is string;
+/**
+ * Returns the [[link-namehash]] for %%name%%.
+ */
+export declare function namehash(name: string): string;
+/**
+ * Returns the DNS encoded %%name%%.
+ *
+ * This is used for various parts of ENS name resolution, such
+ * as the wildcard resolution.
+ */
+export declare function dnsEncode(name: string): string;
+//# sourceMappingURL=namehash.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/hash/namehash.d.ts.map b/dist/ethers.js/src.ts/hash/namehash.d.ts.map
new file mode 100644
index 0000000..5f1aa76
--- /dev/null
+++ b/dist/ethers.js/src.ts/hash/namehash.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"namehash.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/hash/namehash.ts"],"names":[],"mappings":"AAyCA;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOjD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,MAAM,CAKxD;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAa7C;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAa9C"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/hash/namehash.js b/dist/ethers.js/src.ts/hash/namehash.js
new file mode 100644
index 0000000..60838b9
--- /dev/null
+++ b/dist/ethers.js/src.ts/hash/namehash.js
@@ -0,0 +1,92 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.dnsEncode = exports.namehash = exports.isValidName = exports.ensNormalize = void 0;
+const index_js_1 = require("../crypto/index.js");
+const index_js_2 = require("../utils/index.js");
+const ens_normalize_1 = require("@adraffy/ens-normalize");
+const Zeros = new Uint8Array(32);
+Zeros.fill(0);
+function checkComponent(comp) {
+ (0, index_js_2.assertArgument)(comp.length !== 0, "invalid ENS name; empty component", "comp", comp);
+ return comp;
+}
+function ensNameSplit(name) {
+ const bytes = (0, index_js_2.toUtf8Bytes)(ensNormalize(name));
+ const comps = [];
+ if (name.length === 0) {
+ return comps;
+ }
+ let last = 0;
+ for (let i = 0; i < bytes.length; i++) {
+ const d = bytes[i];
+ // A separator (i.e. "."); copy this component
+ if (d === 0x2e) {
+ comps.push(checkComponent(bytes.slice(last, i)));
+ last = i + 1;
+ }
+ }
+ // There was a stray separator at the end of the name
+ (0, index_js_2.assertArgument)(last < bytes.length, "invalid ENS name; empty component", "name", name);
+ comps.push(checkComponent(bytes.slice(last)));
+ return comps;
+}
+/**
+ * Returns the ENS %%name%% normalized.
+ */
+function ensNormalize(name) {
+ try {
+ if (name.length === 0) {
+ throw new Error("empty label");
+ }
+ return (0, ens_normalize_1.ens_normalize)(name);
+ }
+ catch (error) {
+ (0, index_js_2.assertArgument)(false, `invalid ENS name (${error.message})`, "name", name);
+ }
+}
+exports.ensNormalize = ensNormalize;
+/**
+ * Returns ``true`` if %%name%% is a valid ENS name.
+ */
+function isValidName(name) {
+ try {
+ return (ensNameSplit(name).length !== 0);
+ }
+ catch (error) { }
+ return false;
+}
+exports.isValidName = isValidName;
+/**
+ * Returns the [[link-namehash]] for %%name%%.
+ */
+function namehash(name) {
+ (0, index_js_2.assertArgument)(typeof (name) === "string", "invalid ENS name; not a string", "name", name);
+ (0, index_js_2.assertArgument)(name.length, `invalid ENS name (empty label)`, "name", name);
+ let result = Zeros;
+ const comps = ensNameSplit(name);
+ while (comps.length) {
+ result = (0, index_js_1.keccak256)((0, index_js_2.concat)([result, (0, index_js_1.keccak256)((comps.pop()))]));
+ }
+ return (0, index_js_2.hexlify)(result);
+}
+exports.namehash = namehash;
+/**
+ * Returns the DNS encoded %%name%%.
+ *
+ * This is used for various parts of ENS name resolution, such
+ * as the wildcard resolution.
+ */
+function dnsEncode(name) {
+ return (0, index_js_2.hexlify)((0, index_js_2.concat)(ensNameSplit(name).map((comp) => {
+ // DNS does not allow components over 63 bytes in length
+ if (comp.length > 63) {
+ throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");
+ }
+ const bytes = new Uint8Array(comp.length + 1);
+ bytes.set(comp, 1);
+ bytes[0] = bytes.length - 1;
+ return bytes;
+ }))) + "00";
+}
+exports.dnsEncode = dnsEncode;
+//# sourceMappingURL=namehash.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/hash/namehash.js.map b/dist/ethers.js/src.ts/hash/namehash.js.map
new file mode 100644
index 0000000..2c81f0f
--- /dev/null
+++ b/dist/ethers.js/src.ts/hash/namehash.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"namehash.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/hash/namehash.ts"],"names":[],"mappings":";;;AACA,iDAA+C;AAC/C,gDAE2B;AAG3B,0DAAuD;AAEvD,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;AACjC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAEd,SAAS,cAAc,CAAC,IAAgB;IACpC,IAAA,yBAAc,EAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,mCAAmC,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;IACpF,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,YAAY,CAAC,IAAY;IAC9B,MAAM,KAAK,GAAG,IAAA,sBAAW,EAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9C,MAAM,KAAK,GAAsB,EAAG,CAAC;IAErC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;QAAE,OAAO,KAAK,CAAC;KAAE;IAExC,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE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/dev/null
+++ b/dist/ethers.js/src.ts/hash/solidity.d.ts
@@ -0,0 +1,31 @@
+/**
+ * Computes the [[link-solc-packed]] representation of %%values%%
+ * respectively to their %%types%%.
+ *
+ * @example:
+ * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72"
+ * solidityPacked([ "address", "uint" ], [ addr, 45 ]);
+ * //_result:
+ */
+export declare function solidityPacked(types: ReadonlyArray, values: ReadonlyArray): string;
+/**
+ * Computes the [[link-solc-packed]] [[keccak256]] hash of %%values%%
+ * respectively to their %%types%%.
+ *
+ * @example:
+ * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72"
+ * solidityPackedKeccak256([ "address", "uint" ], [ addr, 45 ]);
+ * //_result:
+ */
+export declare function solidityPackedKeccak256(types: ReadonlyArray, values: ReadonlyArray): string;
+/**
+ * Computes the [[link-solc-packed]] [[sha256]] hash of %%values%%
+ * respectively to their %%types%%.
+ *
+ * @example:
+ * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72"
+ * solidityPackedSha256([ "address", "uint" ], [ addr, 45 ]);
+ * //_result:
+ */
+export declare function solidityPackedSha256(types: ReadonlyArray, values: ReadonlyArray): string;
+//# sourceMappingURL=solidity.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/hash/solidity.d.ts.map b/dist/ethers.js/src.ts/hash/solidity.d.ts.map
new file mode 100644
index 0000000..e719d3f
--- /dev/null
+++ b/dist/ethers.js/src.ts/hash/solidity.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"solidity.d.ts","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/hash/solidity.ts"],"names":[],"mappings":"AAyEA;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GAAG,MAAM,CAQ/F;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GAAG,MAAM,CAExG;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GAAG,MAAM,CAErG"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/hash/solidity.js b/dist/ethers.js/src.ts/hash/solidity.js
new file mode 100644
index 0000000..c828e27
--- /dev/null
+++ b/dist/ethers.js/src.ts/hash/solidity.js
@@ -0,0 +1,109 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.solidityPackedSha256 = exports.solidityPackedKeccak256 = exports.solidityPacked = void 0;
+const index_js_1 = require("../address/index.js");
+const index_js_2 = require("../crypto/index.js");
+const index_js_3 = require("../utils/index.js");
+const regexBytes = new RegExp("^bytes([0-9]+)$");
+const regexNumber = new RegExp("^(u?int)([0-9]*)$");
+const regexArray = new RegExp("^(.*)\\[([0-9]*)\\]$");
+function _pack(type, value, isArray) {
+ switch (type) {
+ case "address":
+ if (isArray) {
+ return (0, index_js_3.getBytes)((0, index_js_3.zeroPadValue)(value, 32));
+ }
+ return (0, index_js_3.getBytes)((0, index_js_1.getAddress)(value));
+ case "string":
+ return (0, index_js_3.toUtf8Bytes)(value);
+ case "bytes":
+ return (0, index_js_3.getBytes)(value);
+ case "bool":
+ value = (!!value ? "0x01" : "0x00");
+ if (isArray) {
+ return (0, index_js_3.getBytes)((0, index_js_3.zeroPadValue)(value, 32));
+ }
+ return (0, index_js_3.getBytes)(value);
+ }
+ let match = type.match(regexNumber);
+ if (match) {
+ let signed = (match[1] === "int");
+ let size = parseInt(match[2] || "256");
+ (0, index_js_3.assertArgument)((!match[2] || match[2] === String(size)) && (size % 8 === 0) && size !== 0 && size <= 256, "invalid number type", "type", type);
+ if (isArray) {
+ size = 256;
+ }
+ if (signed) {
+ value = (0, index_js_3.toTwos)(value, size);
+ }
+ return (0, index_js_3.getBytes)((0, index_js_3.zeroPadValue)((0, index_js_3.toBeArray)(value), size / 8));
+ }
+ match = type.match(regexBytes);
+ if (match) {
+ const size = parseInt(match[1]);
+ (0, index_js_3.assertArgument)(String(size) === match[1] && size !== 0 && size <= 32, "invalid bytes type", "type", type);
+ (0, index_js_3.assertArgument)((0, index_js_3.dataLength)(value) === size, `invalid value for ${type}`, "value", value);
+ if (isArray) {
+ return (0, index_js_3.getBytes)((0, index_js_3.zeroPadBytes)(value, 32));
+ }
+ return value;
+ }
+ match = type.match(regexArray);
+ if (match && Array.isArray(value)) {
+ const baseType = match[1];
+ const count = parseInt(match[2] || String(value.length));
+ (0, index_js_3.assertArgument)(count === value.length, `invalid array length for ${type}`, "value", value);
+ const result = [];
+ value.forEach(function (value) {
+ result.push(_pack(baseType, value, true));
+ });
+ return (0, index_js_3.getBytes)((0, index_js_3.concat)(result));
+ }
+ (0, index_js_3.assertArgument)(false, "invalid type", "type", type);
+}
+// @TODO: Array Enum
+/**
+ * Computes the [[link-solc-packed]] representation of %%values%%
+ * respectively to their %%types%%.
+ *
+ * @example:
+ * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72"
+ * solidityPacked([ "address", "uint" ], [ addr, 45 ]);
+ * //_result:
+ */
+function solidityPacked(types, values) {
+ (0, index_js_3.assertArgument)(types.length === values.length, "wrong number of values; expected ${ types.length }", "values", values);
+ const tight = [];
+ types.forEach(function (type, index) {
+ tight.push(_pack(type, values[index]));
+ });
+ return (0, index_js_3.hexlify)((0, index_js_3.concat)(tight));
+}
+exports.solidityPacked = solidityPacked;
+/**
+ * Computes the [[link-solc-packed]] [[keccak256]] hash of %%values%%
+ * respectively to their %%types%%.
+ *
+ * @example:
+ * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72"
+ * solidityPackedKeccak256([ "address", "uint" ], [ addr, 45 ]);
+ * //_result:
+ */
+function solidityPackedKeccak256(types, values) {
+ return (0, index_js_2.keccak256)(solidityPacked(types, values));
+}
+exports.solidityPackedKeccak256 = solidityPackedKeccak256;
+/**
+ * Computes the [[link-solc-packed]] [[sha256]] hash of %%values%%
+ * respectively to their %%types%%.
+ *
+ * @example:
+ * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72"
+ * solidityPackedSha256([ "address", "uint" ], [ addr, 45 ]);
+ * //_result:
+ */
+function solidityPackedSha256(types, values) {
+ return (0, index_js_2.sha256)(solidityPacked(types, values));
+}
+exports.solidityPackedSha256 = solidityPackedSha256;
+//# sourceMappingURL=solidity.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/hash/solidity.js.map b/dist/ethers.js/src.ts/hash/solidity.js.map
new file mode 100644
index 0000000..f0232c0
--- /dev/null
+++ b/dist/ethers.js/src.ts/hash/solidity.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"solidity.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/hash/solidity.ts"],"names":[],"mappings":";;;AAAA,kDAAiD;AACjD,iDAE4B;AAC5B,gDAG2B;AAG3B,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,iBAAiB,CAAC,CAAC;AACjD,MAAM,WAAW,GAAG,IAAI,MAAM,CAAC,mBAAmB,CAAC,CAAC;AACpD,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,sBAAsB,CAAC,CAAC;AAGtD,SAAS,KAAK,CAAC,IAAY,EAAE,KAAU,EAAE,OAAiB;IACtD,QAAO,IAAI,EAAE;QACT,KAAK,SAAS;YACV,IAAI,OAAO,EAAE;gBAAE,OAAO,IAAA,mBAAQ,EAAC,IAAA,uBAAY,EAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;aAAE;YAC1D,OAAO,IAAA,mBAAQ,EAAC,IAAA,qBAAU,EAAC,KAAK,CAAC,CAAC,CAAC;QACvC,KAAK,QAAQ;YACT,OAAO,IAAA,sBAAW,EAAC,KAAK,CAAC,CAAC;QAC9B,KAAK,OAAO;YACR,OAAO,IAAA,mBAAQ,EAAC,KAAK,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AAC,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;AACvD,CAAC;AAED,oBAAoB;AAEpB;;;;;;;;GAQG;AACH,SAAgB,cAAc,CAAC,KAA4B,EAAE,MAA0B;IACnF,IAAA,yBAAc,EAAC,KAAK,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,oDAAoD,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAEvH,MAAM,KAAK,GAAsB,EAAE,CAAC;IACpC,KAAK,CAAC,OAAO,CAAC,UAAS,IAAI,EAAE,KAAK;QAC9B,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;IACH,OAAO,IAAA,kBAAO,EAAC,IAAA,iBAAM,EAAC,KAAK,CAAC,CAAC,CAAC;AAClC,CAAC;AARD,wCAQC;AAED;;;;;;;;GAQG;AACH,SAAgB,uBAAuB,CAAC,KAA4B,EAAE,MAA0B;IAC5F,OAAO,IAAA,oBAAU,EAAC,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;AACrD,CAAC;AAFD,0DAEC;AAED;;;;;;;;GAQG;AACH,SAAgB,oBAAoB,CAAC,KAA4B,EAAE,MAA0B;IACzF,OAAO,IAAA,iBAAO,EAAC,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;AAClD,CAAC;AAFD,oDAEC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/hash/typed-data.d.ts b/dist/ethers.js/src.ts/hash/typed-data.d.ts
new file mode 100644
index 0000000..e827817
--- /dev/null
+++ b/dist/ethers.js/src.ts/hash/typed-data.d.ts
@@ -0,0 +1,150 @@
+import type { SignatureLike } from "../crypto/index.js";
+import type { BigNumberish, BytesLike } from "../utils/index.js";
+/**
+ * The domain for an [[link-eip-712]] payload.
+ */
+export interface TypedDataDomain {
+ /**
+ * The human-readable name of the signing domain.
+ */
+ name?: null | string;
+ /**
+ * The major version of the signing domain.
+ */
+ version?: null | string;
+ /**
+ * The chain ID of the signing domain.
+ */
+ chainId?: null | BigNumberish;
+ /**
+ * The the address of the contract that will verify the signature.
+ */
+ verifyingContract?: null | string;
+ /**
+ * A salt used for purposes decided by the specific domain.
+ */
+ salt?: null | BytesLike;
+}
+/**
+ * A specific field of a structured [[link-eip-712]] type.
+ */
+export interface TypedDataField {
+ /**
+ * The field name.
+ */
+ name: string;
+ /**
+ * The type of the field.
+ */
+ type: string;
+}
+/**
+ * A **TypedDataEncode** prepares and encodes [[link-eip-712]] payloads
+ * for signed typed data.
+ *
+ * This is useful for those that wish to compute various components of a
+ * typed data hash, primary types, or sub-components, but generally the
+ * higher level [[Signer-signTypedData]] is more useful.
+ */
+export declare class TypedDataEncoder {
+ #private;
+ /**
+ * The primary type for the structured [[types]].
+ *
+ * This is derived automatically from the [[types]], since no
+ * recursion is possible, once the DAG for the types is consturcted
+ * internally, the primary type must be the only remaining type with
+ * no parent nodes.
+ */
+ readonly primaryType: string;
+ /**
+ * The types.
+ */
+ get types(): Record>;
+ /**
+ * Create a new **TypedDataEncoder** for %%types%%.
+ *
+ * This performs all necessary checking that types are valid and
+ * do not violate the [[link-eip-712]] structural constraints as
+ * well as computes the [[primaryType]].
+ */
+ constructor(types: Record>);
+ /**
+ * Returnthe encoder for the specific %%type%%.
+ */
+ getEncoder(type: string): (value: any) => string;
+ /**
+ * Return the full type for %%name%%.
+ */
+ encodeType(name: string): string;
+ /**
+ * Return the encoded %%value%% for the %%type%%.
+ */
+ encodeData(type: string, value: any): string;
+ /**
+ * Returns the hash of %%value%% for the type of %%name%%.
+ */
+ hashStruct(name: string, value: Record): string;
+ /**
+ * Return the fulled encoded %%value%% for the [[types]].
+ */
+ encode(value: Record): string;
+ /**
+ * Return the hash of the fully encoded %%value%% for the [[types]].
+ */
+ hash(value: Record): string;
+ /**
+ * @_ignore:
+ */
+ _visit(type: string, value: any, callback: (type: string, data: any) => any): any;
+ /**
+ * Call %%calback%% for each value in %%value%%, passing the type and
+ * component within %%value%%.
+ *
+ * This is useful for replacing addresses or other transformation that
+ * may be desired on each component, based on its type.
+ */
+ visit(value: Record, callback: (type: string, data: any) => any): any;
+ /**
+ * Create a new **TypedDataEncoder** for %%types%%.
+ */
+ static from(types: Record>): TypedDataEncoder;
+ /**
+ * Return the primary type for %%types%%.
+ */
+ static getPrimaryType(types: Record>): string;
+ /**
+ * Return the hashed struct for %%value%% using %%types%% and %%name%%.
+ */
+ static hashStruct(name: string, types: Record>, value: Record): string;
+ /**
+ * Return the domain hash for %%domain%%.
+ */
+ static hashDomain(domain: TypedDataDomain): string;
+ /**
+ * Return the fully encoded [[link-eip-712]] %%value%% for %%types%% with %%domain%%.
+ */
+ static encode(domain: TypedDataDomain, types: Record>, value: Record): string;
+ /**
+ * Return the hash of the fully encoded [[link-eip-712]] %%value%% for %%types%% with %%domain%%.
+ */
+ static hash(domain: TypedDataDomain, types: Record>, value: Record): string;
+ /**
+ * Resolves to the value from resolving all addresses in %%value%% for
+ * %%types%% and the %%domain%%.
+ */
+ static resolveNames(domain: TypedDataDomain, types: Record>, value: Record, resolveName: (name: string) => Promise): Promise<{
+ domain: TypedDataDomain;
+ value: any;
+ }>;
+ /**
+ * Returns the JSON-encoded payload expected by nodes which implement
+ * the JSON-RPC [[link-eip-712]] method.
+ */
+ static getPayload(domain: TypedDataDomain, types: Record>, value: Record): any;
+}
+/**
+ * Compute the address used to sign the typed data for the %%signature%%.
+ */
+export declare function verifyTypedData(domain: TypedDataDomain, types: Record>, value: Record, signature: SignatureLike): string;
+//# sourceMappingURL=typed-data.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/hash/typed-data.d.ts.map b/dist/ethers.js/src.ts/hash/typed-data.d.ts.map
new file mode 100644
index 0000000..3c34368
--- /dev/null
+++ b/dist/ethers.js/src.ts/hash/typed-data.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"typed-data.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E,KAAK,CAAC,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM;IAQxH;;OAEG;IACH,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM;IAKtH;;;OAGG;WACU,YAAY,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,eAAe,CAAC;QAAC,KAAK,EAAE,GAAG,CAAA;KAAE,CAAC;IAiD9N;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG;CAuD5H;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,SAAS,EAAE,aAAa,GAAG,MAAM,CAEnK"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/hash/typed-data.js b/dist/ethers.js/src.ts/hash/typed-data.js
new file mode 100644
index 0000000..660260d
--- /dev/null
+++ b/dist/ethers.js/src.ts/hash/typed-data.js
@@ -0,0 +1,508 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
+};
+var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
+ if (kind === "m") throw new TypeError("Private method is not writable");
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
+};
+var _TypedDataEncoder_instances, _TypedDataEncoder_types, _TypedDataEncoder_fullTypes, _TypedDataEncoder_encoderCache, _TypedDataEncoder_getEncoder;
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.verifyTypedData = exports.TypedDataEncoder = void 0;
+//import { TypedDataDomain, TypedDataField } from "@ethersproject/providerabstract-signer";
+const index_js_1 = require("../address/index.js");
+const index_js_2 = require("../crypto/index.js");
+const index_js_3 = require("../transaction/index.js");
+const index_js_4 = require("../utils/index.js");
+const id_js_1 = require("./id.js");
+const padding = new Uint8Array(32);
+padding.fill(0);
+const BN__1 = BigInt(-1);
+const BN_0 = BigInt(0);
+const BN_1 = BigInt(1);
+const BN_MAX_UINT256 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
+;
+;
+function hexPadRight(value) {
+ const bytes = (0, index_js_4.getBytes)(value);
+ const padOffset = bytes.length % 32;
+ if (padOffset) {
+ return (0, index_js_4.concat)([bytes, padding.slice(padOffset)]);
+ }
+ return (0, index_js_4.hexlify)(bytes);
+}
+const hexTrue = (0, index_js_4.toBeHex)(BN_1, 32);
+const hexFalse = (0, index_js_4.toBeHex)(BN_0, 32);
+const domainFieldTypes = {
+ name: "string",
+ version: "string",
+ chainId: "uint256",
+ verifyingContract: "address",
+ salt: "bytes32"
+};
+const domainFieldNames = [
+ "name", "version", "chainId", "verifyingContract", "salt"
+];
+function checkString(key) {
+ return function (value) {
+ (0, index_js_4.assertArgument)(typeof (value) === "string", `invalid domain value for ${JSON.stringify(key)}`, `domain.${key}`, value);
+ return value;
+ };
+}
+const domainChecks = {
+ name: checkString("name"),
+ version: checkString("version"),
+ chainId: function (_value) {
+ const value = (0, index_js_4.getBigInt)(_value, "domain.chainId");
+ (0, index_js_4.assertArgument)(value >= 0, "invalid chain ID", "domain.chainId", _value);
+ if (Number.isSafeInteger(value)) {
+ return Number(value);
+ }
+ return (0, index_js_4.toQuantity)(value);
+ },
+ verifyingContract: function (value) {
+ try {
+ return (0, index_js_1.getAddress)(value).toLowerCase();
+ }
+ catch (error) { }
+ (0, index_js_4.assertArgument)(false, `invalid domain value "verifyingContract"`, "domain.verifyingContract", value);
+ },
+ salt: function (value) {
+ const bytes = (0, index_js_4.getBytes)(value, "domain.salt");
+ (0, index_js_4.assertArgument)(bytes.length === 32, `invalid domain value "salt"`, "domain.salt", value);
+ return (0, index_js_4.hexlify)(bytes);
+ }
+};
+function getBaseEncoder(type) {
+ // intXX and uintXX
+ {
+ const match = type.match(/^(u?)int(\d*)$/);
+ if (match) {
+ const signed = (match[1] === "");
+ const width = parseInt(match[2] || "256");
+ (0, index_js_4.assertArgument)(width % 8 === 0 && width !== 0 && width <= 256 && (match[2] == null || match[2] === String(width)), "invalid numeric width", "type", type);
+ const boundsUpper = (0, index_js_4.mask)(BN_MAX_UINT256, signed ? (width - 1) : width);
+ const boundsLower = signed ? ((boundsUpper + BN_1) * BN__1) : BN_0;
+ return function (_value) {
+ const value = (0, index_js_4.getBigInt)(_value, "value");
+ (0, index_js_4.assertArgument)(value >= boundsLower && value <= boundsUpper, `value out-of-bounds for ${type}`, "value", value);
+ return (0, index_js_4.toBeHex)(signed ? (0, index_js_4.toTwos)(value, 256) : value, 32);
+ };
+ }
+ }
+ // bytesXX
+ {
+ const match = type.match(/^bytes(\d+)$/);
+ if (match) {
+ const width = parseInt(match[1]);
+ (0, index_js_4.assertArgument)(width !== 0 && width <= 32 && match[1] === String(width), "invalid bytes width", "type", type);
+ return function (value) {
+ const bytes = (0, index_js_4.getBytes)(value);
+ (0, index_js_4.assertArgument)(bytes.length === width, `invalid length for ${type}`, "value", value);
+ return hexPadRight(value);
+ };
+ }
+ }
+ switch (type) {
+ case "address": return function (value) {
+ return (0, index_js_4.zeroPadValue)((0, index_js_1.getAddress)(value), 32);
+ };
+ case "bool": return function (value) {
+ return ((!value) ? hexFalse : hexTrue);
+ };
+ case "bytes": return function (value) {
+ return (0, index_js_2.keccak256)(value);
+ };
+ case "string": return function (value) {
+ return (0, id_js_1.id)(value);
+ };
+ }
+ return null;
+}
+function encodeType(name, fields) {
+ return `${name}(${fields.map(({ name, type }) => (type + " " + name)).join(",")})`;
+}
+/**
+ * A **TypedDataEncode** prepares and encodes [[link-eip-712]] payloads
+ * for signed typed data.
+ *
+ * This is useful for those that wish to compute various components of a
+ * typed data hash, primary types, or sub-components, but generally the
+ * higher level [[Signer-signTypedData]] is more useful.
+ */
+class TypedDataEncoder {
+ /**
+ * The types.
+ */
+ get types() {
+ return JSON.parse(__classPrivateFieldGet(this, _TypedDataEncoder_types, "f"));
+ }
+ /**
+ * Create a new **TypedDataEncoder** for %%types%%.
+ *
+ * This performs all necessary checking that types are valid and
+ * do not violate the [[link-eip-712]] structural constraints as
+ * well as computes the [[primaryType]].
+ */
+ constructor(types) {
+ _TypedDataEncoder_instances.add(this);
+ _TypedDataEncoder_types.set(this, void 0);
+ _TypedDataEncoder_fullTypes.set(this, void 0);
+ _TypedDataEncoder_encoderCache.set(this, void 0);
+ __classPrivateFieldSet(this, _TypedDataEncoder_types, JSON.stringify(types), "f");
+ __classPrivateFieldSet(this, _TypedDataEncoder_fullTypes, new Map(), "f");
+ __classPrivateFieldSet(this, _TypedDataEncoder_encoderCache, new Map(), "f");
+ // Link struct types to their direct child structs
+ const links = new Map();
+ // Link structs to structs which contain them as a child
+ const parents = new Map();
+ // Link all subtypes within a given struct
+ const subtypes = new Map();
+ Object.keys(types).forEach((type) => {
+ links.set(type, new Set());
+ parents.set(type, []);
+ subtypes.set(type, new Set());
+ });
+ for (const name in types) {
+ const uniqueNames = new Set();
+ for (const field of types[name]) {
+ // Check each field has a unique name
+ (0, index_js_4.assertArgument)(!uniqueNames.has(field.name), `duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name)}`, "types", types);
+ uniqueNames.add(field.name);
+ // Get the base type (drop any array specifiers)
+ const baseType = (field.type.match(/^([^\x5b]*)(\x5b|$)/))[1] || null;
+ (0, index_js_4.assertArgument)(baseType !== name, `circular type reference to ${JSON.stringify(baseType)}`, "types", types);
+ // Is this a base encoding type?
+ const encoder = getBaseEncoder(baseType);
+ if (encoder) {
+ continue;
+ }
+ (0, index_js_4.assertArgument)(parents.has(baseType), `unknown type ${JSON.stringify(baseType)}`, "types", types);
+ // Add linkage
+ parents.get(baseType).push(name);
+ links.get(name).add(baseType);
+ }
+ }
+ // Deduce the primary type
+ const primaryTypes = Array.from(parents.keys()).filter((n) => (parents.get(n).length === 0));
+ (0, index_js_4.assertArgument)(primaryTypes.length !== 0, "missing primary type", "types", types);
+ (0, index_js_4.assertArgument)(primaryTypes.length === 1, `ambiguous primary types or unused types: ${primaryTypes.map((t) => (JSON.stringify(t))).join(", ")}`, "types", types);
+ (0, index_js_4.defineProperties)(this, { primaryType: primaryTypes[0] });
+ // Check for circular type references
+ function checkCircular(type, found) {
+ (0, index_js_4.assertArgument)(!found.has(type), `circular type reference to ${JSON.stringify(type)}`, "types", types);
+ found.add(type);
+ for (const child of links.get(type)) {
+ if (!parents.has(child)) {
+ continue;
+ }
+ // Recursively check children
+ checkCircular(child, found);
+ // Mark all ancestors as having this decendant
+ for (const subtype of found) {
+ subtypes.get(subtype).add(child);
+ }
+ }
+ found.delete(type);
+ }
+ checkCircular(this.primaryType, new Set());
+ // Compute each fully describe type
+ for (const [name, set] of subtypes) {
+ const st = Array.from(set);
+ st.sort();
+ __classPrivateFieldGet(this, _TypedDataEncoder_fullTypes, "f").set(name, encodeType(name, types[name]) + st.map((t) => encodeType(t, types[t])).join(""));
+ }
+ }
+ /**
+ * Returnthe encoder for the specific %%type%%.
+ */
+ getEncoder(type) {
+ let encoder = __classPrivateFieldGet(this, _TypedDataEncoder_encoderCache, "f").get(type);
+ if (!encoder) {
+ encoder = __classPrivateFieldGet(this, _TypedDataEncoder_instances, "m", _TypedDataEncoder_getEncoder).call(this, type);
+ __classPrivateFieldGet(this, _TypedDataEncoder_encoderCache, "f").set(type, encoder);
+ }
+ return encoder;
+ }
+ /**
+ * Return the full type for %%name%%.
+ */
+ encodeType(name) {
+ const result = __classPrivateFieldGet(this, _TypedDataEncoder_fullTypes, "f").get(name);
+ (0, index_js_4.assertArgument)(result, `unknown type: ${JSON.stringify(name)}`, "name", name);
+ return result;
+ }
+ /**
+ * Return the encoded %%value%% for the %%type%%.
+ */
+ encodeData(type, value) {
+ return this.getEncoder(type)(value);
+ }
+ /**
+ * Returns the hash of %%value%% for the type of %%name%%.
+ */
+ hashStruct(name, value) {
+ return (0, index_js_2.keccak256)(this.encodeData(name, value));
+ }
+ /**
+ * Return the fulled encoded %%value%% for the [[types]].
+ */
+ encode(value) {
+ return this.encodeData(this.primaryType, value);
+ }
+ /**
+ * Return the hash of the fully encoded %%value%% for the [[types]].
+ */
+ hash(value) {
+ return this.hashStruct(this.primaryType, value);
+ }
+ /**
+ * @_ignore:
+ */
+ _visit(type, value, callback) {
+ // Basic encoder type (address, bool, uint256, etc)
+ {
+ const encoder = getBaseEncoder(type);
+ if (encoder) {
+ return callback(type, value);
+ }
+ }
+ // Array
+ const match = type.match(/^(.*)(\x5b(\d*)\x5d)$/);
+ if (match) {
+ (0, index_js_4.assertArgument)(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, "value", value);
+ return value.map((v) => this._visit(match[1], v, callback));
+ }
+ // Struct
+ const fields = this.types[type];
+ if (fields) {
+ return fields.reduce((accum, { name, type }) => {
+ accum[name] = this._visit(type, value[name], callback);
+ return accum;
+ }, {});
+ }
+ (0, index_js_4.assertArgument)(false, `unknown type: ${type}`, "type", type);
+ }
+ /**
+ * Call %%calback%% for each value in %%value%%, passing the type and
+ * component within %%value%%.
+ *
+ * This is useful for replacing addresses or other transformation that
+ * may be desired on each component, based on its type.
+ */
+ visit(value, callback) {
+ return this._visit(this.primaryType, value, callback);
+ }
+ /**
+ * Create a new **TypedDataEncoder** for %%types%%.
+ */
+ static from(types) {
+ return new TypedDataEncoder(types);
+ }
+ /**
+ * Return the primary type for %%types%%.
+ */
+ static getPrimaryType(types) {
+ return TypedDataEncoder.from(types).primaryType;
+ }
+ /**
+ * Return the hashed struct for %%value%% using %%types%% and %%name%%.
+ */
+ static hashStruct(name, types, value) {
+ return TypedDataEncoder.from(types).hashStruct(name, value);
+ }
+ /**
+ * Return the domain hash for %%domain%%.
+ */
+ static hashDomain(domain) {
+ const domainFields = [];
+ for (const name in domain) {
+ if (domain[name] == null) {
+ continue;
+ }
+ const type = domainFieldTypes[name];
+ (0, index_js_4.assertArgument)(type, `invalid typed-data domain key: ${JSON.stringify(name)}`, "domain", domain);
+ domainFields.push({ name, type });
+ }
+ domainFields.sort((a, b) => {
+ return domainFieldNames.indexOf(a.name) - domainFieldNames.indexOf(b.name);
+ });
+ return TypedDataEncoder.hashStruct("EIP712Domain", { EIP712Domain: domainFields }, domain);
+ }
+ /**
+ * Return the fully encoded [[link-eip-712]] %%value%% for %%types%% with %%domain%%.
+ */
+ static encode(domain, types, value) {
+ return (0, index_js_4.concat)([
+ "0x1901",
+ TypedDataEncoder.hashDomain(domain),
+ TypedDataEncoder.from(types).hash(value)
+ ]);
+ }
+ /**
+ * Return the hash of the fully encoded [[link-eip-712]] %%value%% for %%types%% with %%domain%%.
+ */
+ static hash(domain, types, value) {
+ return (0, index_js_2.keccak256)(TypedDataEncoder.encode(domain, types, value));
+ }
+ // Replaces all address types with ENS names with their looked up address
+ /**
+ * Resolves to the value from resolving all addresses in %%value%% for
+ * %%types%% and the %%domain%%.
+ */
+ static resolveNames(domain, types, value, resolveName) {
+ return __awaiter(this, void 0, void 0, function* () {
+ // Make a copy to isolate it from the object passed in
+ domain = Object.assign({}, domain);
+ // Allow passing null to ignore value
+ for (const key in domain) {
+ if (domain[key] == null) {
+ delete domain[key];
+ }
+ }
+ // Look up all ENS names
+ const ensCache = {};
+ // Do we need to look up the domain's verifyingContract?
+ if (domain.verifyingContract && !(0, index_js_4.isHexString)(domain.verifyingContract, 20)) {
+ ensCache[domain.verifyingContract] = "0x";
+ }
+ // We are going to use the encoder to visit all the base values
+ const encoder = TypedDataEncoder.from(types);
+ // Get a list of all the addresses
+ encoder.visit(value, (type, value) => {
+ if (type === "address" && !(0, index_js_4.isHexString)(value, 20)) {
+ ensCache[value] = "0x";
+ }
+ return value;
+ });
+ // Lookup each name
+ for (const name in ensCache) {
+ ensCache[name] = yield resolveName(name);
+ }
+ // Replace the domain verifyingContract if needed
+ if (domain.verifyingContract && ensCache[domain.verifyingContract]) {
+ domain.verifyingContract = ensCache[domain.verifyingContract];
+ }
+ // Replace all ENS names with their address
+ value = encoder.visit(value, (type, value) => {
+ if (type === "address" && ensCache[value]) {
+ return ensCache[value];
+ }
+ return value;
+ });
+ return { domain, value };
+ });
+ }
+ /**
+ * Returns the JSON-encoded payload expected by nodes which implement
+ * the JSON-RPC [[link-eip-712]] method.
+ */
+ static getPayload(domain, types, value) {
+ // Validate the domain fields
+ TypedDataEncoder.hashDomain(domain);
+ // Derive the EIP712Domain Struct reference type
+ const domainValues = {};
+ const domainTypes = [];
+ domainFieldNames.forEach((name) => {
+ const value = domain[name];
+ if (value == null) {
+ return;
+ }
+ domainValues[name] = domainChecks[name](value);
+ domainTypes.push({ name, type: domainFieldTypes[name] });
+ });
+ const encoder = TypedDataEncoder.from(types);
+ const typesWithDomain = Object.assign({}, types);
+ (0, index_js_4.assertArgument)(typesWithDomain.EIP712Domain == null, "types must not contain EIP712Domain type", "types.EIP712Domain", types);
+ typesWithDomain.EIP712Domain = domainTypes;
+ // Validate the data structures and types
+ encoder.encode(value);
+ return {
+ types: typesWithDomain,
+ domain: domainValues,
+ primaryType: encoder.primaryType,
+ message: encoder.visit(value, (type, value) => {
+ // bytes
+ if (type.match(/^bytes(\d*)/)) {
+ return (0, index_js_4.hexlify)((0, index_js_4.getBytes)(value));
+ }
+ // uint or int
+ if (type.match(/^u?int/)) {
+ return (0, index_js_4.getBigInt)(value).toString();
+ }
+ switch (type) {
+ case "address":
+ return value.toLowerCase();
+ case "bool":
+ return !!value;
+ case "string":
+ (0, index_js_4.assertArgument)(typeof (value) === "string", "invalid string", "value", value);
+ return value;
+ }
+ (0, index_js_4.assertArgument)(false, "unsupported type", "type", type);
+ })
+ };
+ }
+}
+exports.TypedDataEncoder = TypedDataEncoder;
+_TypedDataEncoder_types = new WeakMap(), _TypedDataEncoder_fullTypes = new WeakMap(), _TypedDataEncoder_encoderCache = new WeakMap(), _TypedDataEncoder_instances = new WeakSet(), _TypedDataEncoder_getEncoder = function _TypedDataEncoder_getEncoder(type) {
+ // Basic encoder type (address, bool, uint256, etc)
+ {
+ const encoder = getBaseEncoder(type);
+ if (encoder) {
+ return encoder;
+ }
+ }
+ // Array
+ const match = type.match(/^(.*)(\x5b(\d*)\x5d)$/);
+ if (match) {
+ const subtype = match[1];
+ const subEncoder = this.getEncoder(subtype);
+ return (value) => {
+ (0, index_js_4.assertArgument)(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, "value", value);
+ let result = value.map(subEncoder);
+ if (__classPrivateFieldGet(this, _TypedDataEncoder_fullTypes, "f").has(subtype)) {
+ result = result.map(index_js_2.keccak256);
+ }
+ return (0, index_js_2.keccak256)((0, index_js_4.concat)(result));
+ };
+ }
+ // Struct
+ const fields = this.types[type];
+ if (fields) {
+ const encodedType = (0, id_js_1.id)(__classPrivateFieldGet(this, _TypedDataEncoder_fullTypes, "f").get(type));
+ return (value) => {
+ const values = fields.map(({ name, type }) => {
+ const result = this.getEncoder(type)(value[name]);
+ if (__classPrivateFieldGet(this, _TypedDataEncoder_fullTypes, "f").has(type)) {
+ return (0, index_js_2.keccak256)(result);
+ }
+ return result;
+ });
+ values.unshift(encodedType);
+ return (0, index_js_4.concat)(values);
+ };
+ }
+ (0, index_js_4.assertArgument)(false, `unknown type: ${type}`, "type", type);
+};
+/**
+ * Compute the address used to sign the typed data for the %%signature%%.
+ */
+function verifyTypedData(domain, types, value, signature) {
+ return (0, index_js_3.recoverAddress)(TypedDataEncoder.hash(domain, types, value), signature);
+}
+exports.verifyTypedData = verifyTypedData;
+//# sourceMappingURL=typed-data.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/hash/typed-data.js.map b/dist/ethers.js/src.ts/hash/typed-data.js.map
new file mode 100644
index 0000000..d0ee447
--- /dev/null
+++ b/dist/ethers.js/src.ts/hash/typed-data.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"typed-data.js","sourceRoot":"","sources":["../../../../src/ethers.js/src.ts/hash/typed-data.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,2FAA2F;AAC3F,kDAAiD;AACjD,iDAA+C;AAC/C,sDAAyD;AACzD,gDAG2B;AAE3B,mCAA6B;AAM7B,MAAM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AAI,CAAC,EAAE;oBAAE,OAAO,IAAA,oBAAS,EAAC,MAAM,CAAC,CAAC;iBAAE;gBAC5D,OAAO,MAAM,CAAC;YAClB,CAAC,CAAC,CAAC;YACH,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;YAC5B,OAAO,IAAA,iBAAM,EAAC,MAAM,CAAC,CAAC;QAC1B,CAAC,CAAA;KACJ;IAED,IAAA,yBAAc,EAAC,KAAK,EAAE,iBAAkB,IAAK,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;AACnE,CAAC;AA4PL;;GAEG;AACH,SAAgB,eAAe,CAAC,MAAuB,EAAE,KAA4C,EAAE,KAA0B,EAAE,SAAwB;IACvJ,OAAO,IAAA,yBAAc,EAAC,gBAAgB,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,SAAS,CAAC,CAAC;AAClF,CAAC;AAFD,0CAEC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/index.d.ts b/dist/ethers.js/src.ts/index.d.ts
new file mode 100644
index 0000000..558c263
--- /dev/null
+++ b/dist/ethers.js/src.ts/index.d.ts
@@ -0,0 +1,11 @@
+/**
+ * The Application Programming Interface (API) is the collection of
+ * functions, classes and types offered by the Ethers library.
+ *
+ * @_section: api:Application Programming Interface [about-api]
+ * @_navTitle: API
+ */
+import * as ethers from "./ethers.js";
+export { ethers };
+export * from "./ethers.js";
+//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/index.d.ts.map b/dist/ethers.js/src.ts/index.d.ts.map
new file mode 100644
index 0000000..ea77bd7
--- /dev/null
+++ b/dist/ethers.js/src.ts/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ethers.js/src.ts/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,MAAM,EAAE,CAAC;AAElB,cAAc,aAAa,CAAC"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/index.js b/dist/ethers.js/src.ts/index.js
new file mode 100644
index 0000000..121369a
--- /dev/null
+++ b/dist/ethers.js/src.ts/index.js
@@ -0,0 +1,40 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ var desc = Object.getOwnPropertyDescriptor(m, k);
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+ desc = { enumerable: true, get: function() { return m[k]; } };
+ }
+ Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+ o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || function (mod) {
+ if (mod && mod.__esModule) return mod;
+ var result = {};
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
+ __setModuleDefault(result, mod);
+ return result;
+};
+var __exportStar = (this && this.__exportStar) || function(m, exports) {
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.ethers = void 0;
+/**
+ * The Application Programming Interface (API) is the collection of
+ * functions, classes and types offered by the Ethers library.
+ *
+ * @_section: api:Application Programming Interface [about-api]
+ * @_navTitle: API
+ */
+const ethers = __importStar(require("./ethers.js"));
+exports.ethers = ethers;
+__exportStar(require("./ethers.js"), exports);
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/index.js.map b/dist/ethers.js/src.ts/index.js.map
new file mode 100644
index 0000000..dba5dc5
--- /dev/null
+++ b/dist/ethers.js/src.ts/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ethers.js/src.ts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;GAMG;AACH,oDAAsC;AAE7B,wBAAM;AAEf,8CAA4B"}
\ No newline at end of file
diff --git a/dist/ethers.js/src.ts/providers/abstract-provider.d.ts b/dist/ethers.js/src.ts/providers/abstract-provider.d.ts
new file mode 100644
index 0000000..8f4a18b
--- /dev/null
+++ b/dist/ethers.js/src.ts/providers/abstract-provider.d.ts
@@ -0,0 +1,451 @@
+/**
+ * The available providers should suffice for most developers purposes,
+ * but the [[AbstractProvider]] class has many features which enable
+ * sub-classing it for specific purposes.
+ *
+ * @_section: api/providers/abstract-provider: Subclassing Provider [abstract-provider]
+ */
+import { FetchRequest } from "../utils/index.js";
+import { EnsResolver } from "./ens-resolver.js";
+import { Network } from "./network.js";
+import { Block, FeeData, Log, TransactionReceipt, TransactionResponse } from "./provider.js";
+import type { AddressLike } from "../address/index.js";
+import type { BigNumberish } from "../utils/index.js";
+import type { Listener } from "../utils/index.js";
+import type { Networkish } from "./network.js";
+import type { BlockParams, LogParams, TransactionReceiptParams, TransactionResponseParams } from "./formatting.js";
+import type { BlockTag, EventFilter, Filter, FilterByBlockHash, OrphanFilter, PreparedTransactionRequest, Provider, ProviderEvent, TransactionRequest } from "./provider.js";
+/**
+ * The types of additional event values that can be emitted for the
+ * ``"debug"`` event.
+ */
+export type DebugEventAbstractProvider = {
+ action: "sendCcipReadFetchRequest";
+ request: FetchRequest;
+ index: number;
+ urls: Array;
+} | {
+ action: "receiveCcipReadFetchResult";
+ request: FetchRequest;
+ result: any;
+} | {
+ action: "receiveCcipReadFetchError";
+ request: FetchRequest;
+ result: any;
+} | {
+ action: "sendCcipReadCall";
+ transaction: {
+ to: string;
+ data: string;
+ };
+} | {
+ action: "receiveCcipReadCallResult";
+ transaction: {
+ to: string;
+ data: string;
+ };
+ result: string;
+} | {
+ action: "receiveCcipReadCallError";
+ transaction: {
+ to: string;
+ data: string;
+ };
+ error: Error;
+};
+/**
+ * The value passed to the [[AbstractProvider-_getSubscriber]] method.
+ *
+ * Only developers sub-classing [[AbstractProvider[[ will care about this,
+ * if they are modifying a low-level feature of how subscriptions operate.
+ */
+export type Subscription = {
+ type: "block" | "close" | "debug" | "error" | "finalized" | "network" | "pending" | "safe";
+ tag: string;
+} | {
+ type: "transaction";
+ tag: string;
+ hash: string;
+} | {
+ type: "event";
+ tag: string;
+ filter: EventFilter;
+} | {
+ type: "orphan";
+ tag: string;
+ filter: OrphanFilter;
+};
+/**
+ * A **Subscriber** manages a subscription.
+ *
+ * Only developers sub-classing [[AbstractProvider[[ will care about this,
+ * if they are modifying a low-level feature of how subscriptions operate.
+ */
+export interface Subscriber {
+ /**
+ * Called initially when a subscriber is added the first time.
+ */
+ start(): void;
+ /**
+ * Called when there are no more subscribers to the event.
+ */
+ stop(): void;
+ /**
+ * Called when the subscription should pause.
+ *
+ * If %%dropWhilePaused%%, events that occur while paused should not
+ * be emitted [[resume]].
+ */
+ pause(dropWhilePaused?: boolean): void;
+ /**
+ * Resume a paused subscriber.
+ */
+ resume(): void;
+ /**
+ * The frequency (in ms) to poll for events, if polling is used by
+ * the subscriber.
+ *
+ * For non-polling subscribers, this must return ``undefined``.
+ */
+ pollingInterval?: number;
+}
+/**
+ * An **UnmanagedSubscriber** is useful for events which do not require
+ * any additional management, such as ``"debug"`` which only requires
+ * emit in synchronous event loop triggered calls.
+ */
+export declare class UnmanagedSubscriber implements Subscriber {
+ /**
+ * The name fof the event.
+ */
+ name: string;
+ /**
+ * Create a new UnmanagedSubscriber with %%name%%.
+ */
+ constructor(name: string);
+ start(): void;
+ stop(): void;
+ pause(dropWhilePaused?: boolean): void;
+ resume(): void;
+}
+/**
+ * An **AbstractPlugin** is used to provide additional internal services
+ * to an [[AbstractProvider]] without adding backwards-incompatible changes
+ * to method signatures or other internal and complex logic.
+ */
+export interface AbstractProviderPlugin {
+ /**
+ * The reverse domain notation of the plugin.
+ */
+ readonly name: string;
+ /**
+ * Creates a new instance of the plugin, connected to %%provider%%.
+ */
+ connect(provider: AbstractProvider): AbstractProviderPlugin;
+}
+/**
+ * A normalized filter used for [[PerformActionRequest]] objects.
+ */
+export type PerformActionFilter = {
+ address?: string | Array