admin: updated dist files

This commit is contained in:
Richard Moore 2022-11-09 22:45:17 -05:00
parent 84b1c3d41a
commit bbc488a472
30 changed files with 2566 additions and 2383 deletions

4645
dist/ethers.js vendored

File diff suppressed because it is too large Load Diff

2
dist/ethers.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/ethers.min.js vendored

File diff suppressed because one or more lines are too long

@ -31,7 +31,7 @@ function output(out, instance) {
throw new Error(`digestInto() expects output buffer of length at least ${min}`);
}
}
const assert = {
const assert$1 = {
number,
bool,
bytes,
@ -145,7 +145,7 @@ const u64 = {
add, add3L, add3H, add4L, add4H, add5H, add5L,
};
const version = "6.0.0-beta-exports.4";
const version = "6.0.0-beta-exports.7";
function defineReadOnly(object, name, value) {
Object.defineProperty(object, name, {
@ -295,22 +295,14 @@ function makeError(message, code, info) {
}
/**
* Throws an EthersError with %%message%%, %%code%% and additional error
* info.
* %%info%% when %%check%% is falsish..
*
* @see [[api:makeError]]
*/
function throwError(message, code, info) {
throw makeError(message, code, info);
}
/**
* Throws an [[api:ArgumentError]] with %%message%% for the parameter with
* %%name%% and the %%value%%.
*/
function throwArgumentError(message, name, value) {
return throwError(message, "INVALID_ARGUMENT", {
argument: name,
value: value
});
function assert(check, message, code, info) {
if (!check) {
throw makeError(message, code, info);
}
}
/**
* A simple helper to simply ensuring provided arguments match expected
@ -320,9 +312,7 @@ function throwArgumentError(message, name, value) {
* any further code does not need additional compile-time checks.
*/
function assertArgument(check, message, name, value) {
if (!check) {
throwArgumentError(message, name, value);
}
assert(check, message, "INVALID_ARGUMENT", { argument: name, value: value });
}
const _normalizeForms = ["NFD", "NFC", "NFKD", "NFKC"].reduce((accum, form) => {
try {
@ -351,11 +341,9 @@ const _normalizeForms = ["NFD", "NFC", "NFKD", "NFKC"].reduce((accum, form) => {
* Throws if the normalization %%form%% is not supported.
*/
function assertNormalize(form) {
if (_normalizeForms.indexOf(form) === -1) {
throwError("platform missing String.prototype.normalize", "UNSUPPORTED_OPERATION", {
operation: "String.prototype.normalize", info: { form }
});
}
assert(_normalizeForms.indexOf(form) >= 0, "platform missing String.prototype.normalize", "UNSUPPORTED_OPERATION", {
operation: "String.prototype.normalize", info: { form }
});
}
function _getBytes(value, name, copy) {
@ -374,7 +362,7 @@ function _getBytes(value, name, copy) {
}
return result;
}
return throwArgumentError("invalid BytesLike value", name || "value", value);
assertArgument(false, "invalid BytesLike value", name || "value", value);
}
/**
* Get a typed Uint8Array for %%value%%. If already a Uint8Array
@ -401,7 +389,7 @@ function hexlify(data) {
}
function errorFunc(reason, offset, bytes, output, badCodepoint) {
return throwArgumentError(`invalid codepoint at offset ${offset}; ${reason}`, "bytes", bytes);
assertArgument(false, `invalid codepoint at offset ${offset}; ${reason}`, "bytes", bytes);
}
function ignoreFunc(reason, offset, bytes, output, badCodepoint) {
// If there is an invalid prefix (including stray continuation), skip any additional continuation bytes
@ -543,9 +531,7 @@ function toUtf8Bytes(str, form) {
else if ((c & 0xfc00) == 0xd800) {
i++;
const c2 = str.charCodeAt(i);
if (i >= str.length || (c2 & 0xfc00) !== 0xdc00) {
throw new Error("invalid utf-8 string");
}
assertArgument(i < str.length && ((c2 & 0xfc00) === 0xdc00), "invalid surrogate pair", "str", str);
// Surrogate Pair
const pair = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff);
result.push((pair >> 18) | 0xf0);
@ -661,7 +647,7 @@ class Keccak extends Hash {
this.finished = false;
this.destroyed = false;
// Can be passed from user as dkLen
assert.number(outputLen);
assert$1.number(outputLen);
// 1600 = 5x5 matrix of 64bit. 1600 bits === 200 bytes
if (0 >= this.blockLen || this.blockLen >= 200)
throw new Error('Sha3 supports only keccak-f1600 function');
@ -674,7 +660,7 @@ class Keccak extends Hash {
this.pos = 0;
}
update(data) {
assert.exists(this);
assert$1.exists(this);
const { blockLen, state } = this;
data = toBytes(data);
const len = data.length;
@ -700,8 +686,8 @@ class Keccak extends Hash {
this.keccak();
}
writeInto(out) {
assert.exists(this, false);
assert.bytes(out);
assert$1.exists(this, false);
assert$1.bytes(out);
this.finish();
const bufferOut = this.state;
const { blockLen } = this;
@ -722,11 +708,11 @@ class Keccak extends Hash {
return this.writeInto(out);
}
xof(bytes) {
assert.number(bytes);
assert$1.number(bytes);
return this.xofInto(new Uint8Array(bytes));
}
digestInto(out) {
assert.output(out, this);
assert$1.output(out, this);
if (this.finished)
throw new Error('digest() was already called');
this.writeInto(out);
@ -894,9 +880,7 @@ class WordlistOwl extends Wordlist {
}
getWord(index) {
const words = this.#loadWords();
if (index < 0 || index >= words.length) {
throwArgumentError(`invalid word index: ${index}`, "index", index);
}
assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index);
return words[index];
}
getWordIndex(word) {
@ -1102,9 +1086,7 @@ class LangJa extends Wordlist {
constructor() { super("ja"); }
getWord(index) {
const words = loadWords$2();
if (index < 0 || index >= words.length) {
throwArgumentError(`invalid word index: ${index}`, "index", index);
}
assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index);
return words[index];
}
getWordIndex(word) {
@ -1174,9 +1156,7 @@ class LangKo extends Wordlist {
}
getWord(index) {
const words = loadWords$1();
if (index < 0 || index >= words.length) {
throwArgumentError(`invalid word index: ${index}`, "index", index);
}
assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index);
return words[index];
}
getWordIndex(word) {
@ -1246,9 +1226,7 @@ class LangZh extends Wordlist {
constructor(country) { super("zh_" + country); }
getWord(index) {
const words = loadWords(this.locale);
if (index < 0 || index >= words.length) {
throwArgumentError(`invalid word index: ${index}`, "index", index);
}
assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index);
return words[index];
}
getWordIndex(word) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -147,6 +147,66 @@ describe("Test Contract", function () {
await allEvents;
});
});
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})`, async function () {
const v = index_js_1.Typed.from(type, value);
const result = await contract.testTyped(v);
assert_1.default.equal(result, type);
});
it(`tests typed value: Typed.${type}()`, async function () {
const v = index_js_1.Typed[type](value);
const result = await contract.testTyped(v);
assert_1.default.equal(result, type);
});
}
}
});
/*
describe("Test Contract Calls", function() {
it("finds typed methods", async function() {

File diff suppressed because one or more lines are too long

@ -18,16 +18,19 @@ describe("Resolve ENS avatar", function () {
assert_1.default.equal(test.value, avatar, "avatar url");
});
});
[
{ 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 = (0, create_provider_js_1.connect)("mainnet");
const avatar = await provider.getAvatar(test.name);
assert_1.default.equal(avatar, test.value, "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

@ -1 +1 @@
{"version":3,"file":"test-providers-avatar.js","sourceRoot":"","sources":["../../src.ts/_tests/test-providers-avatar.ts"],"names":[],"mappings":";;;;;AAAA,oDAA4B;AAE5B,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K,EAAE,YAAY,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
{"version":3,"file":"test-providers-avatar.js","sourceRoot":"","sources":["../../src.ts/_tests/test-providers-avatar.ts"],"names":[],"mappings":";;;;;AAAA,oDAA4B;AAE5B,6DAA+C;AAE/C,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,KAAK;YAC3C,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YACpB,MAAM,QAAQ,GAAG,IAAA,4BAAO,EAAC,QAAQ,CAAC,CAAC;YACnC,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACnD,gBAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IACP;;;;;;;;;;;;;MAaE;AACF,CAAC,CAAC,CAAC"}

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

@ -23,9 +23,7 @@ class Typed {
#options;
_typedSymbol;
constructor(gaurd, type, value, options = null) {
if (gaurd !== _gaurd) {
throw new Error("private constructor");
}
(0, index_js_1.assertPrivate)(_gaurd, gaurd, "Typed");
(0, index_js_1.defineProperties)(this, { _typedSymbol, type, value });
this.#options = options;
// Check the value is valid
@ -91,7 +89,7 @@ class Typed {
static uint24(v) { return n(v, 24); }
static uint32(v) { return n(v, 32); }
static uint40(v) { return n(v, 40); }
static uint48(v) { return n(v, 46); }
static uint48(v) { return n(v, 48); }
static uint56(v) { return n(v, 56); }
static uint64(v) { return n(v, 64); }
static uint72(v) { return n(v, 72); }
@ -124,7 +122,7 @@ class Typed {
static int24(v) { return n(v, -24); }
static int32(v) { return n(v, -32); }
static int40(v) { return n(v, -40); }
static int48(v) { return n(v, -46); }
static int48(v) { return n(v, -48); }
static int56(v) { return n(v, -56); }
static int64(v) { return n(v, -64); }
static int72(v) { return n(v, -72); }
@ -152,7 +150,6 @@ class Typed {
static int248(v) { return n(v, -248); }
static int256(v) { return n(v, -256); }
static int(v) { return n(v, -256); }
static bytes(v) { return b(v); }
static bytes1(v) { return b(v, 1); }
static bytes2(v) { return b(v, 2); }
static bytes3(v) { return b(v, 3); }
@ -187,6 +184,7 @@ class Typed {
static bytes32(v) { return b(v, 32); }
static address(v) { return new Typed(_gaurd, "address", v); }
static bool(v) { return new Typed(_gaurd, "bool", !!v); }
static bytes(v) { return new Typed(_gaurd, "bytes", v); }
static string(v) { return new Typed(_gaurd, "string", v); }
static array(v, dynamic) {
throw new Error("not implemented yet");

File diff suppressed because one or more lines are too long

@ -96,6 +96,7 @@ async function resolveArgs(_runner, inputs, args) {
const resolver = canResolve(runner) ? runner : null;
return await 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);
}

File diff suppressed because one or more lines are too long

@ -1,6 +1,6 @@
import assert from "assert";
import { getProvider } from "./create-provider.js";
import { Contract, EventLog, Wallet } from "../index.js";
import { Contract, EventLog, Typed, Wallet } from "../index.js";
describe("Test Contract", function () {
const addr = "0x99417252Aad7B065940eBdF50d665Fb8879c5958";
const abi = [
@ -142,6 +142,66 @@ describe("Test Contract", function () {
await allEvents;
});
});
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 = getProvider("InfuraProvider", "goerli");
const contract = new 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})`, async function () {
const v = Typed.from(type, value);
const result = await contract.testTyped(v);
assert.equal(result, type);
});
it(`tests typed value: Typed.${type}()`, async function () {
const v = Typed[type](value);
const result = await contract.testTyped(v);
assert.equal(result, type);
});
}
}
});
/*
describe("Test Contract Calls", function() {
it("finds typed methods", async function() {

File diff suppressed because one or more lines are too long

@ -13,16 +13,19 @@ describe("Resolve ENS avatar", function () {
assert.equal(test.value, avatar, "avatar url");
});
});
[
{ 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");
/*
// @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

@ -1 +1 @@
{"version":3,"file":"test-providers-avatar.js","sourceRoot":"","sources":["../../src.ts/_tests/test-providers-avatar.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,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,KAAK;YAC3C,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YACpB,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;YACnC,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACnD,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH;QACI,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,4IAA4I,EAAE;QACpM,iHAAiH;KAC5G,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACf,EAAE,CAAC,uBAAwB,IAAI,CAAC,KAAM,EAAE,EAAE,KAAK;YAC3C,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;Y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aE;AACF,CAAC,CAAC,CAAC"}

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

@ -1,4 +1,4 @@
import { defineProperties } from "../utils/index.js";
import { assertPrivate, defineProperties } from "../utils/index.js";
const _gaurd = {};
function n(value, width) {
let signed = false;
@ -20,9 +20,7 @@ export class Typed {
#options;
_typedSymbol;
constructor(gaurd, type, value, options = null) {
if (gaurd !== _gaurd) {
throw new Error("private constructor");
}
assertPrivate(_gaurd, gaurd, "Typed");
defineProperties(this, { _typedSymbol, type, value });
this.#options = options;
// Check the value is valid
@ -88,7 +86,7 @@ export class Typed {
static uint24(v) { return n(v, 24); }
static uint32(v) { return n(v, 32); }
static uint40(v) { return n(v, 40); }
static uint48(v) { return n(v, 46); }
static uint48(v) { return n(v, 48); }
static uint56(v) { return n(v, 56); }
static uint64(v) { return n(v, 64); }
static uint72(v) { return n(v, 72); }
@ -121,7 +119,7 @@ export class Typed {
static int24(v) { return n(v, -24); }
static int32(v) { return n(v, -32); }
static int40(v) { return n(v, -40); }
static int48(v) { return n(v, -46); }
static int48(v) { return n(v, -48); }
static int56(v) { return n(v, -56); }
static int64(v) { return n(v, -64); }
static int72(v) { return n(v, -72); }
@ -149,7 +147,6 @@ export class Typed {
static int248(v) { return n(v, -248); }
static int256(v) { return n(v, -256); }
static int(v) { return n(v, -256); }
static bytes(v) { return b(v); }
static bytes1(v) { return b(v, 1); }
static bytes2(v) { return b(v, 2); }
static bytes3(v) { return b(v, 3); }
@ -184,6 +181,7 @@ export class Typed {
static bytes32(v) { return b(v, 32); }
static address(v) { return new Typed(_gaurd, "address", v); }
static bool(v) { return new Typed(_gaurd, "bool", !!v); }
static bytes(v) { return new Typed(_gaurd, "bytes", v); }
static string(v) { return new Typed(_gaurd, "string", v); }
static array(v, dynamic) {
throw new Error("not implemented yet");

File diff suppressed because one or more lines are too long

@ -92,6 +92,7 @@ export async function resolveArgs(_runner, inputs, args) {
const resolver = canResolve(runner) ? runner : null;
return await Promise.all(inputs.map((param, index) => {
return param.walkAsync(args[index], (type, value) => {
value = Typed.dereference(value, type);
if (type === "address") {
return resolveAddress(value, resolver);
}

File diff suppressed because one or more lines are too long

@ -104,7 +104,7 @@
"types": "./types/wordlistsindex.d.ts"
}
},
"gitHead": "6aa853abc32d4824a91f8584e8eaa1d4a178dbb7",
"gitHead": "257654bc5dd95cea2e01f29928da41bd15537b70",
"keywords": [
"ethereum",
"ethers",
@ -144,5 +144,5 @@
"sideEffects": false,
"type": "module",
"types": "./types/index.d.ts",
"version": "6.0.0-beta-exports.6"
"version": "6.0.0-beta-exports.7"
}

@ -1 +1 @@
export const version = "6.0.0-beta-exports.6";
export const version = "6.0.0-beta-exports.7";

2
types/_version.d.ts vendored

@ -1,2 +1,2 @@
export declare const version = "6.0.0-beta-exports.6";
export declare const version = "6.0.0-beta-exports.7";
//# sourceMappingURL=_version.d.ts.map

@ -99,7 +99,6 @@ export declare class Typed {
static int248(v: BigNumberish): Typed;
static int256(v: BigNumberish): Typed;
static int(v: BigNumberish): Typed;
static bytes(v: BytesLike): Typed;
static bytes1(v: BytesLike): Typed;
static bytes2(v: BytesLike): Typed;
static bytes3(v: BytesLike): Typed;
@ -134,6 +133,7 @@ export declare class Typed {
static bytes32(v: BytesLike): Typed;
static address(v: string | Addressable): Typed;
static bool(v: any): Typed;
static bytes(v: BytesLike): Typed;
static string(v: string): Typed;
static array(v: Array<any | Typed>, dynamic?: null | boolean): Typed;
static tuple(v: Array<any | Typed> | Record<string, any | Typed>, name?: string): Typed;

File diff suppressed because one or more lines are too long

@ -1 +1 @@
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src.ts/contract/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAS,MAAM,iBAAiB,CAAC;AAEnD,OAAO,EAAe,GAAG,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAM9E,OAAO,EAEH,2BAA2B,EAC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