Fixed build process to re-target browser field to ES version.
This commit is contained in:
parent
73a0077fd3
commit
3a91e91df5
@ -5,7 +5,7 @@ const resolve = require("path").resolve;
|
||||
const spawn = require("child_process").spawn;
|
||||
|
||||
const { dirnames } = require("./local");
|
||||
const { loadPackage } = require("./depgraph");
|
||||
const { loadPackage, savePackage } = require("./local");
|
||||
const { loadJson, saveJson } = require("./utils");
|
||||
|
||||
function run(progname, args, ignoreErrorStream) {
|
||||
@ -49,6 +49,14 @@ function run(progname, args, ignoreErrorStream) {
|
||||
}
|
||||
|
||||
function setupConfig(outDir, moduleType, targetType) {
|
||||
function update(value) {
|
||||
let comps = value.split("/");
|
||||
if (comps.length >= 3 && comps[0] === "." && comps[1].match(/^lib(\.esm)?$/)) {
|
||||
return outDir + comps.slice(2).join("/");
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
// Configure the tsconfit.package.json...
|
||||
const path = resolve(__dirname, "../tsconfig.package.json");
|
||||
const content = loadJson(path);
|
||||
@ -57,7 +65,20 @@ function setupConfig(outDir, moduleType, targetType) {
|
||||
saveJson(path, content);
|
||||
|
||||
dirnames.forEach((dirname) => {
|
||||
if (loadPackage(dirname)._ethers_nobuild) { return; }
|
||||
let info = loadPackage(dirname);
|
||||
|
||||
if (info._ethers_nobuild) { return; }
|
||||
|
||||
if (info.browser) {
|
||||
if (typeof(info.browser) === "string") {
|
||||
info.browser = update(info.browser);
|
||||
} else {
|
||||
for (let key in info.browser) {
|
||||
info.browser[key] = update(info.browser[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
savePackage(dirname, info);
|
||||
|
||||
let path = resolve(__dirname, "../packages", dirname, "tsconfig.json");
|
||||
let content = loadJson(path);
|
||||
@ -82,7 +103,7 @@ function runBuild(buildModule) {
|
||||
}
|
||||
|
||||
function runDist() {
|
||||
return run("npx", [ "lerna", "run", "dist" ], true);
|
||||
return run("npm", [ "run", "_dist_ethers" ], true);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
@ -18,7 +18,7 @@ const { getPackageVersion } = require("../npm");
|
||||
const { resolve } = require("../utils");
|
||||
const { colorify, log } = require("../log");
|
||||
|
||||
const { getProgressBar } = require("../../packages/cli/prompt");
|
||||
const { prompt } = require("../../packages/cli");
|
||||
|
||||
let dirnames = getOrdered();
|
||||
|
||||
@ -41,7 +41,7 @@ if (process.argv.length > 2) {
|
||||
}
|
||||
|
||||
(async function() {
|
||||
let progress = getProgressBar(colorify("Updating versions", "bold"));
|
||||
let progress = prompt.getProgressBar(colorify("Updating versions", "bold"));
|
||||
|
||||
for (let i = 0; i < dirnames.length; i++) {
|
||||
progress(i / dirnames.length);
|
||||
@ -87,7 +87,7 @@ if (process.argv.length > 2) {
|
||||
log("<bold:Building TypeScript source (es6)...>");
|
||||
await runBuild(true);
|
||||
log("<bold:Building TypeScript source (commonjs)...>");
|
||||
await runBuild();
|
||||
await runBuild(false);
|
||||
log("<bold:Building distribution files...>");
|
||||
let content = await runDist();
|
||||
console.log(content);
|
||||
@ -98,7 +98,7 @@ if (process.argv.length > 2) {
|
||||
}
|
||||
|
||||
// Update the tarball hash now that _version and package.json may have changed.
|
||||
progress = getProgressBar(colorify("Updating tarballHash", "bold"));
|
||||
progress = prompt.getProgressBar(colorify("Updating tarballHash", "bold"));
|
||||
for (let i = 0; i < dirnames.length; i++) {
|
||||
progress(i / dirnames.length);
|
||||
await updatePackage(dirnames[i]);
|
||||
|
@ -7,7 +7,7 @@ const resolve = require("path").resolve;
|
||||
const AES = require("aes-js");
|
||||
const scrypt = require("scrypt-js");
|
||||
|
||||
const prompt = require("../packages/cli/prompt");
|
||||
const { prompt } = require("../packages/cli");
|
||||
const randomBytes = require("../packages/random").randomBytes;
|
||||
const computeHmac = require("../packages/sha2").computeHmac;
|
||||
|
||||
|
@ -6,7 +6,7 @@ const resolve = require("path").resolve;
|
||||
const diff = require("diff");
|
||||
const semver = require("semver");
|
||||
|
||||
const { getProgressBar, prompt } = require("../packages/cli/prompt");
|
||||
const { prompt } = require("../packages/cli");
|
||||
|
||||
const build = require("./build");
|
||||
const changelog = require("./changelog");
|
||||
@ -158,7 +158,7 @@ async function runUpdate(dirnames) {
|
||||
// @TODO: Root
|
||||
|
||||
// Update all the package.json and _version.ts
|
||||
let progress = getProgressBar(colorify("Updating versions", "bold"));
|
||||
let progress = prompt.getProgressBar(colorify("Updating versions", "bold"));
|
||||
for (let i = 0; i < dirnames.length; i++) {
|
||||
progress(i / dirnames.length);
|
||||
|
||||
@ -205,7 +205,7 @@ async function runUpdate(dirnames) {
|
||||
// @TODO:
|
||||
|
||||
// Update the tarball hash now that _version and package.json may have changed.
|
||||
progress = getProgressBar(colorify("Updating tarballHash", "bold"));
|
||||
progress = prompt.getProgressBar(colorify("Updating tarballHash", "bold"));
|
||||
for (let i = 0; i < dirnames.length; i++) {
|
||||
progress(i / dirnames.length);
|
||||
await local.updatePackage(dirnames[i]);
|
||||
|
@ -9,7 +9,7 @@ const local = require("./local");
|
||||
|
||||
const keccak256 = require("../packages/keccak256").keccak256;
|
||||
const fetchJson = require("../packages/web").fetchJson;
|
||||
const prompt = require("../packages/cli/prompt");
|
||||
const { prompt } = require("../packages/cli");
|
||||
|
||||
const colorify = require("./log").colorify;
|
||||
const git = require("./git");
|
||||
|
@ -6,15 +6,12 @@
|
||||
"bootstrap": "node ./admin/cmds/reset-build.js && node ./admin/cmds/update-depgraph && lerna bootstrap --hoist",
|
||||
"build": "tsc --build ./tsconfig.project.json",
|
||||
"clean": "node ./admin/cmds/reset-build.js && tsc --build --clean ./tsconfig.project.json",
|
||||
|
||||
"_dist_prepare": "npm run clean && npm run bootstrap && npm run build",
|
||||
"_dist_ethers": "rollup -c && rollup -c --configMinify && rollup -c --configModule && rollup -c --configModule --configMinify",
|
||||
"_dist_tests": "rollup -c --configTest && rollup -c --configTest --configMinify && rollup -c --configTest --configModule && rollup -c --configTest --configModule --configMinify",
|
||||
|
||||
"_test_prepare": "npm run _dist_prepare && npm run _dist_tests",
|
||||
"_test_node": "cd packages/tests && mocha --no-colors --reporter ./tests/reporter ./tests/test-*.js",
|
||||
"test_node": "npm run _test_prepare && npm run _test_node",
|
||||
|
||||
"_dist_old": "npm run clean && npm run bootstrap && npm run build && lerna run dist",
|
||||
"old-test": "npm run _dist_old && npm run test-check",
|
||||
"old-test-check": "if [ \"$RUN_PHANTOMJS\" = \"1\" ]; then npm run-script test-phantomjs; else npm run-script test-node; fi",
|
||||
@ -22,7 +19,6 @@
|
||||
"old-test-phantomjs": "cd packages/tests && npm run dist-phantomjs && phantomjs --web-security=false ../../node_modules/mocha-phantomjs-core/mocha-phantomjs-core.js ./test.html ./tests/reporter.js",
|
||||
"old-test-aion": "npm run dist && npm run test-aion-node",
|
||||
"old-test-aion-node": "cd packages/aion-tests && mocha --no-colors --reporter ../tests/tests/reporter ./tests/test-*.js",
|
||||
|
||||
"update-versions": "npm run _dist_prepare && node ./admin/cmds/update-versions",
|
||||
"publish-all": "node ./admin/cmds/publish",
|
||||
"build-docs": "flatworm docs.wrm docs"
|
||||
|
@ -31,5 +31,5 @@
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"module": "./lib.esm/index.js",
|
||||
"tarballHash": "0x39e9e020225c070444d3030a0423e986c5c8b25ee3279341641f4b6bf343f4a2"
|
||||
"tarballHash": "0x48cbad8938a128d8f52b87e30c92a1ad2b28af9aee2d1faf1a4c23d60a14b2d3"
|
||||
}
|
||||
|
@ -3,10 +3,6 @@
|
||||
"version": "5.0.0-beta.131",
|
||||
"description": "An Abstract Class for describing an Ethereum Provider for ethers.",
|
||||
"main": "./lib/index.js",
|
||||
"browser": {
|
||||
"net": "./browser-net.js",
|
||||
"./ipc-provider": "./browser-ipc-provider"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
@ -33,5 +29,5 @@
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"module": "./lib.esm/index.js",
|
||||
"tarballHash": "0x4b955417ad50b4c8fa7d7ac8f3de84a9f7948381e3f79f6e301a1bdfdd95066c"
|
||||
"tarballHash": "0x478d4364ced856f3b5ee51da258a5ae239b97a5d1a58f25dd25b8e81f692683c"
|
||||
}
|
||||
|
@ -27,5 +27,5 @@
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"module": "./lib.esm/index.js",
|
||||
"tarballHash": "0xaa4a4086f9fea3265ac7918227914cf63bf4dc082ea2bc4457dc009fafb51437"
|
||||
"tarballHash": "0xc1853f4ac83975080e51babe4f0613122ce5b1b5d68287c84d44a5663cf5546c"
|
||||
}
|
||||
|
@ -28,5 +28,5 @@
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"module": "./lib.esm/index.js",
|
||||
"tarballHash": "0xf52fe7ac31abf75d751e23e06fad681acee39ae9d1153f9c24d5feae7018f22d"
|
||||
"tarballHash": "0x3f3fd1c8422ddd05719dfb37df8292d27e93ae1ce0d0d48e5cdc263082e35a78"
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
"version": "5.0.0-beta.126",
|
||||
"description": "Base64 coder.",
|
||||
"main": "./lib/index.js",
|
||||
"browser": "browser.js",
|
||||
"browser": "./lib/browser.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
@ -24,5 +24,5 @@
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"module": "./lib.esm/index.js",
|
||||
"tarballHash": "0xf6efb1c57508f4e699d90f6423068a95189bc5b750430f294661e2dcf75d919c"
|
||||
"tarballHash": "0x390db88947a298518774fc7b8d5f9b36191df44152bca2370a890d44d44e731f"
|
||||
}
|
||||
|
@ -24,5 +24,5 @@
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"module": "./lib.esm/index.js",
|
||||
"tarballHash": "0x07d12f5f71d62ecbc4240de5bc05e6031f4e0e0620e280eba2c18b2e294d4ff5"
|
||||
"tarballHash": "0x6375a21ec47208aa3a867f26061dbd56afcb7eb51f70c6955b99718fe3ebc32a"
|
||||
}
|
||||
|
2
packages/bignumber/lib.esm/index.d.ts
vendored
2
packages/bignumber/lib.esm/index.d.ts
vendored
@ -1,2 +1,2 @@
|
||||
export { BigNumber, BigNumberish } from "./bignumber";
|
||||
export { FixedNumber } from "./fixednumber";
|
||||
export { formatFixed, FixedFormat, FixedNumber, parseFixed } from "./fixednumber";
|
||||
|
@ -1,2 +1,2 @@
|
||||
export { BigNumber } from "./bignumber";
|
||||
export { FixedNumber } from "./fixednumber";
|
||||
export { formatFixed, FixedFormat, FixedNumber, parseFixed } from "./fixednumber";
|
||||
|
@ -27,5 +27,5 @@
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"module": "./lib.esm/index.js",
|
||||
"tarballHash": "0x78dadd02c7c23e71e8bc51a5a21843437363b7ab29d16de0290e25f12d7fe6f6"
|
||||
"tarballHash": "0x3b0c080f96f262333cb2191f8160e1aef0d93f9af107c1aa0876d007817c9e76"
|
||||
}
|
||||
|
@ -25,5 +25,5 @@
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"module": "./lib.esm/index.js",
|
||||
"tarballHash": "0x7092fb4f0431cc7edeabb25e101d0d73a378bbb842c38e48b8eb41031d97d2f2"
|
||||
"tarballHash": "0x4b7f4f6a34bc4d5c4fe15a01b7c698e8250f828933bb6202248a660d0fb5edfb"
|
||||
}
|
||||
|
5
packages/cli/lib.esm/index.d.ts
vendored
Normal file
5
packages/cli/lib.esm/index.d.ts
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
import * as cli from "./cli";
|
||||
import * as prompt from "./prompt";
|
||||
import * as solc from "./solc";
|
||||
import * as typescript from "./typescript";
|
||||
export { cli, prompt, solc, typescript, };
|
6
packages/cli/lib.esm/index.js
Normal file
6
packages/cli/lib.esm/index.js
Normal file
@ -0,0 +1,6 @@
|
||||
"use strict";
|
||||
import * as cli from "./cli";
|
||||
import * as prompt from "./prompt";
|
||||
import * as solc from "./solc";
|
||||
import * as typescript from "./typescript";
|
||||
export { cli, prompt, solc, typescript, };
|
@ -35,5 +35,5 @@
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"module": "./lib.esm/index.js",
|
||||
"tarballHash": "0xba8cdd7f8648de30fba61ce68e7592be382a490cb92217765fb926cdd99942b8"
|
||||
"tarballHash": "0x047aa677370e57a4c356aa7ca5d3e692038f4863413141cd1f325526c59a4096"
|
||||
}
|
||||
|
@ -23,5 +23,5 @@
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"module": "./lib.esm/index.js",
|
||||
"tarballHash": "0x3ece9df573db39c560dac46836c5bc16d4c46a504991a726262f5f0ca8b1b2f1"
|
||||
"tarballHash": "0x29b69bfc747774d3debf9874b27f05d4c8ea232d709ce955d931d18624a7b0d3"
|
||||
}
|
||||
|
@ -32,5 +32,5 @@
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"module": "./lib.esm/index.js",
|
||||
"tarballHash": "0x2b3d95a50f2ca8c9bfc0537b3ba0709961462384296311ea188b3b96e3f58b83"
|
||||
"tarballHash": "0xd9caa174a4d078052aef924411d3175358bd4539b192b625b3ee3a7a9ba9d653"
|
||||
}
|
||||
|
@ -20,5 +20,5 @@
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"module": "./lib.esm/index.js",
|
||||
"tarballHash": "0x38cdacb3663d11ec01cd55e8b13e4d77c8aa5b754dbaa9424bb4bb3de18071db"
|
||||
"tarballHash": "0x7acbc055896e553d4aa8a18f61197c58d726ef6f44d01a403c323f28ce41330d"
|
||||
}
|
||||
|
674
packages/ethers/dist/ethers.esm.js
vendored
674
packages/ethers/dist/ethers.esm.js
vendored
@ -3455,7 +3455,7 @@ var bn = createCommonjsModule(function (module) {
|
||||
});
|
||||
var bn_1 = bn.BN;
|
||||
|
||||
const version = "logger/5.0.0-beta.129";
|
||||
const version = "logger/5.0.0-beta.128";
|
||||
|
||||
"use strict";
|
||||
let _permanentCensorErrors = false;
|
||||
@ -3721,11 +3721,11 @@ Logger.levels = {
|
||||
OFF: "OFF"
|
||||
};
|
||||
|
||||
var module = /*#__PURE__*/Object.freeze({
|
||||
var lib_esm = /*#__PURE__*/Object.freeze({
|
||||
Logger: Logger
|
||||
});
|
||||
|
||||
const version$1 = "bytes/5.0.0-beta.129";
|
||||
const version$1 = "bytes/5.0.0-beta.128";
|
||||
|
||||
"use strict";
|
||||
const logger = new Logger(version$1);
|
||||
@ -4089,7 +4089,7 @@ function joinSignature(signature) {
|
||||
]));
|
||||
}
|
||||
|
||||
var module$1 = /*#__PURE__*/Object.freeze({
|
||||
var lib_esm$1 = /*#__PURE__*/Object.freeze({
|
||||
isBytesLike: isBytesLike,
|
||||
isBytes: isBytes,
|
||||
arrayify: arrayify,
|
||||
@ -4108,7 +4108,7 @@ var module$1 = /*#__PURE__*/Object.freeze({
|
||||
joinSignature: joinSignature
|
||||
});
|
||||
|
||||
const version$2 = "bignumber/5.0.0-beta.130";
|
||||
const version$2 = "bignumber/5.0.0-beta.129";
|
||||
|
||||
"use strict";
|
||||
const logger$1 = new Logger(version$2);
|
||||
@ -4612,7 +4612,7 @@ class FixedNumber {
|
||||
}
|
||||
}
|
||||
|
||||
const version$3 = "properties/5.0.0-beta.131";
|
||||
const version$3 = "properties/5.0.0-beta.130";
|
||||
|
||||
"use strict";
|
||||
const logger$3 = new Logger(version$3);
|
||||
@ -4713,7 +4713,7 @@ class Description {
|
||||
}
|
||||
}
|
||||
|
||||
var module$2 = /*#__PURE__*/Object.freeze({
|
||||
var lib_esm$2 = /*#__PURE__*/Object.freeze({
|
||||
defineReadOnly: defineReadOnly,
|
||||
getStatic: getStatic,
|
||||
resolveProperties: resolveProperties,
|
||||
@ -4723,7 +4723,7 @@ var module$2 = /*#__PURE__*/Object.freeze({
|
||||
Description: Description
|
||||
});
|
||||
|
||||
const version$4 = "abi/5.0.0-beta.137";
|
||||
const version$4 = "abi/5.0.0-beta.136";
|
||||
|
||||
"use strict";
|
||||
const logger$4 = new Logger(version$4);
|
||||
@ -6179,7 +6179,7 @@ var index = /*#__PURE__*/Object.freeze({
|
||||
decode: decode
|
||||
});
|
||||
|
||||
const version$5 = "address/5.0.0-beta.128";
|
||||
const version$5 = "address/5.0.0-beta.127";
|
||||
|
||||
"use strict";
|
||||
const logger$6 = new Logger(version$5);
|
||||
@ -6596,7 +6596,7 @@ class NumberCoder extends Coder {
|
||||
}
|
||||
}
|
||||
|
||||
const version$6 = "strings/5.0.0-beta.130";
|
||||
const version$6 = "strings/5.0.0-beta.129";
|
||||
|
||||
"use strict";
|
||||
const logger$8 = new Logger(version$6);
|
||||
@ -7117,7 +7117,7 @@ class AbiCoder {
|
||||
}
|
||||
const defaultAbiCoder = new AbiCoder();
|
||||
|
||||
const version$7 = "hash/5.0.0-beta.128";
|
||||
const version$7 = "hash/5.0.0-beta.127";
|
||||
|
||||
"use strict";
|
||||
const logger$a = new Logger(version$7);
|
||||
@ -7165,7 +7165,7 @@ function hashMessage(message) {
|
||||
]));
|
||||
}
|
||||
|
||||
var module$3 = /*#__PURE__*/Object.freeze({
|
||||
var lib_esm$3 = /*#__PURE__*/Object.freeze({
|
||||
isValidName: isValidName,
|
||||
namehash: namehash,
|
||||
id: id,
|
||||
@ -7508,7 +7508,7 @@ function getNameCount(fragments) {
|
||||
|
||||
"use strict";
|
||||
|
||||
const version$8 = "abstract-provider/5.0.0-beta.131";
|
||||
const version$8 = "abstract-provider/5.0.0-beta.130";
|
||||
|
||||
"use strict";
|
||||
const logger$c = new Logger(version$8);
|
||||
@ -7585,7 +7585,7 @@ class Provider {
|
||||
}
|
||||
}
|
||||
|
||||
const version$9 = "abstract-signer/5.0.0-beta.132";
|
||||
const version$9 = "abstract-signer/5.0.0-beta.131";
|
||||
|
||||
"use strict";
|
||||
const logger$d = new Logger(version$9);
|
||||
@ -7753,7 +7753,7 @@ class VoidSigner extends Signer {
|
||||
}
|
||||
}
|
||||
|
||||
const version$a = "contracts/5.0.0-beta.137";
|
||||
const version$a = "contracts/5.0.0-beta.136";
|
||||
|
||||
"use strict";
|
||||
const logger$e = new Logger(version$a);
|
||||
@ -9727,13 +9727,13 @@ hash.ripemd160 = hash.ripemd.ripemd160;
|
||||
var _version = createCommonjsModule(function (module, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.version = "sha2/5.0.0-beta.129";
|
||||
exports.version = "sha2/5.0.0-beta.128";
|
||||
});
|
||||
|
||||
var _version$1 = unwrapExports(_version);
|
||||
var _version_1 = _version.version;
|
||||
|
||||
var browser = createCommonjsModule(function (module$2, exports) {
|
||||
var browser = createCommonjsModule(function (module, exports) {
|
||||
"use strict";
|
||||
var __importStar = (commonjsGlobal && commonjsGlobal.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
@ -9747,7 +9747,7 @@ var hash = __importStar(hash_1);
|
||||
|
||||
|
||||
|
||||
var logger = new module.Logger(_version.version);
|
||||
var logger = new lib_esm.Logger(_version.version);
|
||||
var SupportedAlgorithms;
|
||||
(function (SupportedAlgorithms) {
|
||||
SupportedAlgorithms["sha256"] = "sha256";
|
||||
@ -9755,25 +9755,25 @@ var SupportedAlgorithms;
|
||||
})(SupportedAlgorithms = exports.SupportedAlgorithms || (exports.SupportedAlgorithms = {}));
|
||||
;
|
||||
function ripemd160(data) {
|
||||
return "0x" + (hash.ripemd160().update(module$1.arrayify(data)).digest("hex"));
|
||||
return "0x" + (hash.ripemd160().update(lib_esm$1.arrayify(data)).digest("hex"));
|
||||
}
|
||||
exports.ripemd160 = ripemd160;
|
||||
function sha256(data) {
|
||||
return "0x" + (hash.sha256().update(module$1.arrayify(data)).digest("hex"));
|
||||
return "0x" + (hash.sha256().update(lib_esm$1.arrayify(data)).digest("hex"));
|
||||
}
|
||||
exports.sha256 = sha256;
|
||||
function sha512(data) {
|
||||
return "0x" + (hash.sha512().update(module$1.arrayify(data)).digest("hex"));
|
||||
return "0x" + (hash.sha512().update(lib_esm$1.arrayify(data)).digest("hex"));
|
||||
}
|
||||
exports.sha512 = sha512;
|
||||
function computeHmac(algorithm, key, data) {
|
||||
if (!SupportedAlgorithms[algorithm]) {
|
||||
logger.throwError("unsupported algorithm " + algorithm, module.Logger.errors.UNSUPPORTED_OPERATION, {
|
||||
logger.throwError("unsupported algorithm " + algorithm, lib_esm.Logger.errors.UNSUPPORTED_OPERATION, {
|
||||
operation: "hmac",
|
||||
algorithm: algorithm
|
||||
});
|
||||
}
|
||||
return "0x" + hash.hmac(hash[algorithm], module$1.arrayify(key)).update(module$1.arrayify(data)).digest("hex");
|
||||
return "0x" + hash.hmac(hash[algorithm], lib_esm$1.arrayify(key)).update(lib_esm$1.arrayify(data)).digest("hex");
|
||||
}
|
||||
exports.computeHmac = computeHmac;
|
||||
});
|
||||
@ -9791,8 +9791,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||
|
||||
|
||||
function pbkdf2(password, salt, iterations, keylen, hashAlgorithm) {
|
||||
password = module$1.arrayify(password);
|
||||
salt = module$1.arrayify(salt);
|
||||
password = lib_esm$1.arrayify(password);
|
||||
salt = lib_esm$1.arrayify(salt);
|
||||
var hLen;
|
||||
var l = 1;
|
||||
var DK = new Uint8Array(keylen);
|
||||
@ -9808,7 +9808,7 @@ function pbkdf2(password, salt, iterations, keylen, hashAlgorithm) {
|
||||
block1[salt.length + 2] = (i >> 8) & 0xff;
|
||||
block1[salt.length + 3] = i & 0xff;
|
||||
//let U = createHmac(password).update(block1).digest();
|
||||
var U = module$1.arrayify(browser.computeHmac(hashAlgorithm, password, block1));
|
||||
var U = lib_esm$1.arrayify(browser.computeHmac(hashAlgorithm, password, block1));
|
||||
if (!hLen) {
|
||||
hLen = U.length;
|
||||
T = new Uint8Array(hLen);
|
||||
@ -9819,16 +9819,16 @@ function pbkdf2(password, salt, iterations, keylen, hashAlgorithm) {
|
||||
T.set(U);
|
||||
for (var j = 1; j < iterations; j++) {
|
||||
//U = createHmac(password).update(U).digest();
|
||||
U = module$1.arrayify(browser.computeHmac(hashAlgorithm, password, U));
|
||||
U = lib_esm$1.arrayify(browser.computeHmac(hashAlgorithm, password, U));
|
||||
for (var k = 0; k < hLen; k++)
|
||||
T[k] ^= U[k];
|
||||
}
|
||||
var destPos = (i - 1) * hLen;
|
||||
var len = (i === l ? r : hLen);
|
||||
//T.copy(DK, destPos, 0, len)
|
||||
DK.set(module$1.arrayify(T).slice(0, len), destPos);
|
||||
DK.set(lib_esm$1.arrayify(T).slice(0, len), destPos);
|
||||
}
|
||||
return module$1.hexlify(DK);
|
||||
return lib_esm$1.hexlify(DK);
|
||||
}
|
||||
exports.pbkdf2 = pbkdf2;
|
||||
});
|
||||
@ -12200,7 +12200,7 @@ elliptic.eddsa = eddsa;
|
||||
});
|
||||
var elliptic_2 = elliptic_1.ec;
|
||||
|
||||
const version$c = "signing-key/5.0.0-beta.129";
|
||||
const version$c = "signing-key/5.0.0-beta.128";
|
||||
|
||||
"use strict";
|
||||
const logger$f = new Logger(version$c);
|
||||
@ -12272,7 +12272,7 @@ function computePublicKey(key, compressed) {
|
||||
return logger$f.throwArgumentError("invalid public or private key", "key", "[REDACTED]");
|
||||
}
|
||||
|
||||
const version$d = "transactions/5.0.0-beta.128";
|
||||
const version$d = "transactions/5.0.0-beta.127";
|
||||
|
||||
"use strict";
|
||||
const logger$g = new Logger(version$d);
|
||||
@ -12413,13 +12413,13 @@ function parse(rawTransaction) {
|
||||
var _version$2 = createCommonjsModule(function (module, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.version = "wordlists/5.0.0-beta.128";
|
||||
exports.version = "wordlists/5.0.0-beta.127";
|
||||
});
|
||||
|
||||
var _version$3 = unwrapExports(_version$2);
|
||||
var _version_1$1 = _version$2.version;
|
||||
|
||||
var wordlist = createCommonjsModule(function (module$1, exports) {
|
||||
var wordlist = createCommonjsModule(function (module, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
// This gets overriddenby gulp during bip39-XX
|
||||
@ -12428,7 +12428,7 @@ var exportWordlist = false;
|
||||
|
||||
|
||||
|
||||
var logger = new module.Logger(_version$2.version);
|
||||
var logger = new lib_esm.Logger(_version$2.version);
|
||||
function check(wordlist) {
|
||||
var words = [];
|
||||
for (var i = 0; i < 2048; i++) {
|
||||
@ -12438,14 +12438,14 @@ function check(wordlist) {
|
||||
}
|
||||
words.push(word);
|
||||
}
|
||||
return module$3.id(words.join("\n") + "\n");
|
||||
return lib_esm$3.id(words.join("\n") + "\n");
|
||||
}
|
||||
exports.check = check;
|
||||
var Wordlist = /** @class */ (function () {
|
||||
function Wordlist(locale) {
|
||||
var _newTarget = this.constructor;
|
||||
logger.checkAbstract(_newTarget, Wordlist);
|
||||
module$2.defineReadOnly(this, "locale", locale);
|
||||
lib_esm$2.defineReadOnly(this, "locale", locale);
|
||||
}
|
||||
// Subclasses may override this
|
||||
Wordlist.prototype.split = function (mnemonic) {
|
||||
@ -12465,14 +12465,14 @@ function register(lang, name) {
|
||||
if (exportWordlist) {
|
||||
var g = commonjsGlobal;
|
||||
if (!(g.wordlists)) {
|
||||
module$2.defineReadOnly(g, "wordlists", {});
|
||||
lib_esm$2.defineReadOnly(g, "wordlists", {});
|
||||
}
|
||||
if (!g.wordlists[name]) {
|
||||
module$2.defineReadOnly(g.wordlists, name, lang);
|
||||
lib_esm$2.defineReadOnly(g.wordlists, name, lang);
|
||||
}
|
||||
if (g.ethers && g.ethers.wordlists) {
|
||||
if (!g.ethers.wordlists[name]) {
|
||||
module$2.defineReadOnly(g.ethers.wordlists, name, lang);
|
||||
lib_esm$2.defineReadOnly(g.ethers.wordlists, name, lang);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -12553,7 +12553,7 @@ var browser$5 = unwrapExports(browser$4);
|
||||
var browser_1$2 = browser$4.Wordlist;
|
||||
var browser_2$1 = browser$4.wordlists;
|
||||
|
||||
const version$e = "hdnode/5.0.0-beta.130";
|
||||
const version$e = "hdnode/5.0.0-beta.129";
|
||||
|
||||
"use strict";
|
||||
const logger$h = new Logger(version$e);
|
||||
@ -12835,7 +12835,7 @@ function isValidMnemonic(mnemonic, wordlist) {
|
||||
var _version$4 = createCommonjsModule(function (module, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.version = "random/5.0.0-beta.128";
|
||||
exports.version = "random/5.0.0-beta.127";
|
||||
});
|
||||
|
||||
var _version$5 = unwrapExports(_version$4);
|
||||
@ -12860,13 +12860,13 @@ exports.shuffled = shuffled;
|
||||
var shuffle$1 = unwrapExports(shuffle);
|
||||
var shuffle_1 = shuffle.shuffled;
|
||||
|
||||
var browser$6 = createCommonjsModule(function (module$2, exports) {
|
||||
var browser$6 = createCommonjsModule(function (module, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
|
||||
|
||||
|
||||
var logger = new module.Logger(_version$4.version);
|
||||
var logger = new lib_esm.Logger(_version$4.version);
|
||||
|
||||
exports.shuffled = shuffle.shuffled;
|
||||
var crypto = commonjsGlobal.crypto || commonjsGlobal.msCrypto;
|
||||
@ -12874,7 +12874,7 @@ if (!crypto || !crypto.getRandomValues) {
|
||||
logger.warn("WARNING: Missing strong random number source");
|
||||
crypto = {
|
||||
getRandomValues: function (buffer) {
|
||||
return logger.throwError("no secure random source avaialble", module.Logger.errors.UNSUPPORTED_OPERATION, {
|
||||
return logger.throwError("no secure random source avaialble", lib_esm.Logger.errors.UNSUPPORTED_OPERATION, {
|
||||
operation: "crypto.getRandomValues"
|
||||
});
|
||||
}
|
||||
@ -12886,7 +12886,7 @@ function randomBytes(length) {
|
||||
}
|
||||
var result = new Uint8Array(length);
|
||||
crypto.getRandomValues(result);
|
||||
return module$1.arrayify(result);
|
||||
return lib_esm$1.arrayify(result);
|
||||
}
|
||||
exports.randomBytes = randomBytes;
|
||||
;
|
||||
@ -13697,7 +13697,7 @@ var aesJs = createCommonjsModule(function (module, exports) {
|
||||
})(commonjsGlobal);
|
||||
});
|
||||
|
||||
const version$f = "json-wallets/5.0.0-beta.129";
|
||||
const version$f = "json-wallets/5.0.0-beta.128";
|
||||
|
||||
"use strict";
|
||||
/*
|
||||
@ -14851,7 +14851,7 @@ function decryptJsonWallet(json, password, progressCallback) {
|
||||
return Promise.reject(new Error("invalid JSON wallet"));
|
||||
}
|
||||
|
||||
const version$g = "wallet/5.0.0-beta.130";
|
||||
const version$g = "wallet/5.0.0-beta.129";
|
||||
|
||||
"use strict";
|
||||
const logger$j = new Logger(version$g);
|
||||
@ -14971,7 +14971,7 @@ function verifyMessage(message, signature) {
|
||||
return recoverAddress(hashMessage(message), signature);
|
||||
}
|
||||
|
||||
const version$h = "networks/5.0.0-beta.129";
|
||||
const version$h = "networks/5.0.0-beta.128";
|
||||
|
||||
"use strict";
|
||||
const logger$k = new Logger(version$h);
|
||||
@ -15705,11 +15705,11 @@ function decode(textData) {
|
||||
for (var i = 0; i < textData.length; i++) {
|
||||
data.push(textData.charCodeAt(i));
|
||||
}
|
||||
return module$1.arrayify(data);
|
||||
return lib_esm$1.arrayify(data);
|
||||
}
|
||||
exports.decode = decode;
|
||||
function encode(data) {
|
||||
data = module$1.arrayify(data);
|
||||
data = lib_esm$1.arrayify(data);
|
||||
var textData = "";
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
textData += String.fromCharCode(data[i]);
|
||||
@ -15730,7 +15730,7 @@ var browser$a = /*#__PURE__*/Object.freeze({
|
||||
encode: browser_2$3
|
||||
});
|
||||
|
||||
const version$i = "web/5.0.0-beta.129";
|
||||
const version$i = "web/5.0.0-beta.128";
|
||||
|
||||
"use strict";
|
||||
const logger$l = new Logger(version$i);
|
||||
@ -15927,7 +15927,7 @@ function poll(func, options) {
|
||||
});
|
||||
}
|
||||
|
||||
const version$j = "providers/5.0.0-beta.141";
|
||||
const version$j = "providers/5.0.0-beta.140";
|
||||
|
||||
"use strict";
|
||||
const logger$m = new Logger(version$j);
|
||||
@ -18514,567 +18514,7 @@ function sha256$1(types, values) {
|
||||
return browser_3(pack$1(types, values));
|
||||
}
|
||||
|
||||
var _version$6 = createCommonjsModule(function (module, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.version = "bignumber/5.0.0-beta.130";
|
||||
});
|
||||
|
||||
var _version$7 = unwrapExports(_version$6);
|
||||
var _version_1$3 = _version$6.version;
|
||||
|
||||
var bignumber = createCommonjsModule(function (module$2, exports) {
|
||||
"use strict";
|
||||
var __importStar = (commonjsGlobal && commonjsGlobal.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
||||
result["default"] = mod;
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
/**
|
||||
* BigNumber
|
||||
*
|
||||
* A wrapper around the BN.js object. We use the BN.js library
|
||||
* because it is used by elliptic, so it is required regardles.
|
||||
*
|
||||
*/
|
||||
var BN = __importStar(bn);
|
||||
|
||||
|
||||
|
||||
var logger = new module.Logger(_version$6.version);
|
||||
var _constructorGuard = {};
|
||||
var MAX_SAFE = 0x1fffffffffffff;
|
||||
function isBigNumberish(value) {
|
||||
return (value != null) && (BigNumber.isBigNumber(value) ||
|
||||
(typeof (value) === "number" && (value % 1) === 0) ||
|
||||
(typeof (value) === "string" && !!value.match(/^-?[0-9]+$/)) ||
|
||||
module$1.isHexString(value) ||
|
||||
(typeof (value) === "bigint") ||
|
||||
module$1.isBytes(value));
|
||||
}
|
||||
exports.isBigNumberish = isBigNumberish;
|
||||
var BigNumber = /** @class */ (function () {
|
||||
function BigNumber(constructorGuard, hex) {
|
||||
var _newTarget = this.constructor;
|
||||
logger.checkNew(_newTarget, BigNumber);
|
||||
if (constructorGuard !== _constructorGuard) {
|
||||
logger.throwError("cannot call consturtor directly; use BigNumber.from", module.Logger.errors.UNSUPPORTED_OPERATION, {
|
||||
operation: "new (BigNumber)"
|
||||
});
|
||||
}
|
||||
this._hex = hex;
|
||||
this._isBigNumber = true;
|
||||
Object.freeze(this);
|
||||
}
|
||||
BigNumber.prototype.fromTwos = function (value) {
|
||||
return toBigNumber(toBN(this).fromTwos(value));
|
||||
};
|
||||
BigNumber.prototype.toTwos = function (value) {
|
||||
return toBigNumber(toBN(this).toTwos(value));
|
||||
};
|
||||
BigNumber.prototype.abs = function () {
|
||||
if (this._hex[0] === "-") {
|
||||
return BigNumber.from(this._hex.substring(1));
|
||||
}
|
||||
return this;
|
||||
};
|
||||
BigNumber.prototype.add = function (other) {
|
||||
return toBigNumber(toBN(this).add(toBN(other)));
|
||||
};
|
||||
BigNumber.prototype.sub = function (other) {
|
||||
return toBigNumber(toBN(this).sub(toBN(other)));
|
||||
};
|
||||
BigNumber.prototype.div = function (other) {
|
||||
var o = BigNumber.from(other);
|
||||
if (o.isZero()) {
|
||||
throwFault("division by zero", "div");
|
||||
}
|
||||
return toBigNumber(toBN(this).div(toBN(other)));
|
||||
};
|
||||
BigNumber.prototype.mul = function (other) {
|
||||
return toBigNumber(toBN(this).mul(toBN(other)));
|
||||
};
|
||||
BigNumber.prototype.mod = function (other) {
|
||||
return toBigNumber(toBN(this).mod(toBN(other)));
|
||||
};
|
||||
BigNumber.prototype.pow = function (other) {
|
||||
return toBigNumber(toBN(this).pow(toBN(other)));
|
||||
};
|
||||
BigNumber.prototype.maskn = function (value) {
|
||||
return toBigNumber(toBN(this).maskn(value));
|
||||
};
|
||||
BigNumber.prototype.eq = function (other) {
|
||||
return toBN(this).eq(toBN(other));
|
||||
};
|
||||
BigNumber.prototype.lt = function (other) {
|
||||
return toBN(this).lt(toBN(other));
|
||||
};
|
||||
BigNumber.prototype.lte = function (other) {
|
||||
return toBN(this).lte(toBN(other));
|
||||
};
|
||||
BigNumber.prototype.gt = function (other) {
|
||||
return toBN(this).gt(toBN(other));
|
||||
};
|
||||
BigNumber.prototype.gte = function (other) {
|
||||
return toBN(this).gte(toBN(other));
|
||||
};
|
||||
BigNumber.prototype.isZero = function () {
|
||||
return toBN(this).isZero();
|
||||
};
|
||||
BigNumber.prototype.toNumber = function () {
|
||||
try {
|
||||
return toBN(this).toNumber();
|
||||
}
|
||||
catch (error) {
|
||||
throwFault("overflow", "toNumber", this.toString());
|
||||
}
|
||||
return null;
|
||||
};
|
||||
BigNumber.prototype.toString = function () {
|
||||
// Lots of people expect this, which we do not support, so check
|
||||
if (arguments.length !== 0) {
|
||||
logger.throwError("bigNumber.toString does not accept parameters", module.Logger.errors.UNEXPECTED_ARGUMENT, {});
|
||||
}
|
||||
return toBN(this).toString(10);
|
||||
};
|
||||
BigNumber.prototype.toHexString = function () {
|
||||
return this._hex;
|
||||
};
|
||||
BigNumber.from = function (value) {
|
||||
if (value instanceof BigNumber) {
|
||||
return value;
|
||||
}
|
||||
if (typeof (value) === "string") {
|
||||
if (value.match(/-?0x[0-9a-f]+/i)) {
|
||||
return new BigNumber(_constructorGuard, toHex(value));
|
||||
}
|
||||
if (value.match(/^-?[0-9]+$/)) {
|
||||
return new BigNumber(_constructorGuard, toHex(new BN.BN(value)));
|
||||
}
|
||||
return logger.throwArgumentError("invalid BigNumber string", "value", value);
|
||||
}
|
||||
if (typeof (value) === "number") {
|
||||
if (value % 1) {
|
||||
throwFault("underflow", "BigNumber.from", value);
|
||||
}
|
||||
if (value >= MAX_SAFE || value <= -MAX_SAFE) {
|
||||
throwFault("overflow", "BigNumber.from", value);
|
||||
}
|
||||
return BigNumber.from(String(value));
|
||||
}
|
||||
if (typeof (value) === "bigint") {
|
||||
return BigNumber.from(value.toString());
|
||||
}
|
||||
if (module$1.isBytes(value)) {
|
||||
return BigNumber.from(module$1.hexlify(value));
|
||||
}
|
||||
if (value._hex && module$1.isHexString(value._hex)) {
|
||||
return BigNumber.from(value._hex);
|
||||
}
|
||||
if (value.toHexString) {
|
||||
value = value.toHexString();
|
||||
if (typeof (value) === "string") {
|
||||
return BigNumber.from(value);
|
||||
}
|
||||
}
|
||||
return logger.throwArgumentError("invalid BigNumber value", "value", value);
|
||||
};
|
||||
BigNumber.isBigNumber = function (value) {
|
||||
return !!(value && value._isBigNumber);
|
||||
};
|
||||
return BigNumber;
|
||||
}());
|
||||
exports.BigNumber = BigNumber;
|
||||
// Normalize the hex string
|
||||
function toHex(value) {
|
||||
// For BN, call on the hex string
|
||||
if (typeof (value) !== "string") {
|
||||
return toHex(value.toString(16));
|
||||
}
|
||||
// If negative, prepend the negative sign to the normalized positive value
|
||||
if (value[0] === "-") {
|
||||
// Strip off the negative sign
|
||||
value = value.substring(1);
|
||||
// Cannot have mulitple negative signs (e.g. "--0x04")
|
||||
if (value[0] === "-") {
|
||||
logger.throwArgumentError("invalid hex", "value", value);
|
||||
}
|
||||
// Call toHex on the positive component
|
||||
value = toHex(value);
|
||||
// Do not allow "-0x00"
|
||||
if (value === "0x00") {
|
||||
return value;
|
||||
}
|
||||
// Negate the value
|
||||
return "-" + value;
|
||||
}
|
||||
// Add a "0x" prefix if missing
|
||||
if (value.substring(0, 2) !== "0x") {
|
||||
value = "0x" + value;
|
||||
}
|
||||
// Normalize zero
|
||||
if (value === "0x") {
|
||||
return "0x00";
|
||||
}
|
||||
// Make the string even length
|
||||
if (value.length % 2) {
|
||||
value = "0x0" + value.substring(2);
|
||||
}
|
||||
// Trim to smallest even-length string
|
||||
while (value.length > 4 && value.substring(0, 4) === "0x00") {
|
||||
value = "0x" + value.substring(4);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
function toBigNumber(value) {
|
||||
return BigNumber.from(toHex(value));
|
||||
}
|
||||
function toBN(value) {
|
||||
var hex = BigNumber.from(value).toHexString();
|
||||
if (hex[0] === "-") {
|
||||
return (new BN.BN("-" + hex.substring(3), 16));
|
||||
}
|
||||
return new BN.BN(hex.substring(2), 16);
|
||||
}
|
||||
function throwFault(fault, operation, value) {
|
||||
var params = { fault: fault, operation: operation };
|
||||
if (value != null) {
|
||||
params.value = value;
|
||||
}
|
||||
return logger.throwError(fault, module.Logger.errors.NUMERIC_FAULT, params);
|
||||
}
|
||||
});
|
||||
|
||||
var bignumber$1 = unwrapExports(bignumber);
|
||||
var bignumber_1 = bignumber.isBigNumberish;
|
||||
var bignumber_2 = bignumber.BigNumber;
|
||||
|
||||
var fixednumber = createCommonjsModule(function (module$2, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
|
||||
|
||||
|
||||
var logger = new module.Logger(_version$6.version);
|
||||
|
||||
var _constructorGuard = {};
|
||||
var Zero = bignumber.BigNumber.from(0);
|
||||
var NegativeOne = bignumber.BigNumber.from(-1);
|
||||
function throwFault(message, fault, operation, value) {
|
||||
var params = { fault: fault, operation: operation };
|
||||
if (value !== undefined) {
|
||||
params.value = value;
|
||||
}
|
||||
return logger.throwError(message, module.Logger.errors.NUMERIC_FAULT, params);
|
||||
}
|
||||
// Constant to pull zeros from for multipliers
|
||||
var zeros = "0";
|
||||
while (zeros.length < 256) {
|
||||
zeros += zeros;
|
||||
}
|
||||
// Returns a string "1" followed by decimal "0"s
|
||||
function getMultiplier(decimals) {
|
||||
if (typeof (decimals) !== "number") {
|
||||
try {
|
||||
decimals = bignumber.BigNumber.from(decimals).toNumber();
|
||||
}
|
||||
catch (e) { }
|
||||
}
|
||||
if (typeof (decimals) === "number" && decimals >= 0 && decimals <= 256 && !(decimals % 1)) {
|
||||
return ("1" + zeros.substring(0, decimals));
|
||||
}
|
||||
return logger.throwArgumentError("invalid decimal size", "decimals", decimals);
|
||||
}
|
||||
function formatFixed(value, decimals) {
|
||||
if (decimals == null) {
|
||||
decimals = 0;
|
||||
}
|
||||
var multiplier = getMultiplier(decimals);
|
||||
// Make sure wei is a big number (convert as necessary)
|
||||
value = bignumber.BigNumber.from(value);
|
||||
var negative = value.lt(Zero);
|
||||
if (negative) {
|
||||
value = value.mul(NegativeOne);
|
||||
}
|
||||
var fraction = value.mod(multiplier).toString();
|
||||
while (fraction.length < multiplier.length - 1) {
|
||||
fraction = "0" + fraction;
|
||||
}
|
||||
// Strip training 0
|
||||
fraction = fraction.match(/^([0-9]*[1-9]|0)(0*)/)[1];
|
||||
var whole = value.div(multiplier).toString();
|
||||
value = whole + "." + fraction;
|
||||
if (negative) {
|
||||
value = "-" + value;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
exports.formatFixed = formatFixed;
|
||||
function parseFixed(value, decimals) {
|
||||
if (decimals == null) {
|
||||
decimals = 0;
|
||||
}
|
||||
var multiplier = getMultiplier(decimals);
|
||||
if (typeof (value) !== "string" || !value.match(/^-?[0-9.,]+$/)) {
|
||||
logger.throwArgumentError("invalid decimal value", "value", value);
|
||||
}
|
||||
if (multiplier.length - 1 === 0) {
|
||||
return bignumber.BigNumber.from(value);
|
||||
}
|
||||
// Is it negative?
|
||||
var negative = (value.substring(0, 1) === "-");
|
||||
if (negative) {
|
||||
value = value.substring(1);
|
||||
}
|
||||
if (value === ".") {
|
||||
logger.throwArgumentError("missing value", "value", value);
|
||||
}
|
||||
// Split it into a whole and fractional part
|
||||
var comps = value.split(".");
|
||||
if (comps.length > 2) {
|
||||
logger.throwArgumentError("too many decimal points", "value", value);
|
||||
}
|
||||
var whole = comps[0], fraction = comps[1];
|
||||
if (!whole) {
|
||||
whole = "0";
|
||||
}
|
||||
if (!fraction) {
|
||||
fraction = "0";
|
||||
}
|
||||
// Prevent underflow
|
||||
if (fraction.length > multiplier.length - 1) {
|
||||
throwFault("fractional component exceeds decimals", "underflow", "parseFixed");
|
||||
}
|
||||
// Fully pad the string with zeros to get to wei
|
||||
while (fraction.length < multiplier.length - 1) {
|
||||
fraction += "0";
|
||||
}
|
||||
var wholeValue = bignumber.BigNumber.from(whole);
|
||||
var fractionValue = bignumber.BigNumber.from(fraction);
|
||||
var wei = (wholeValue.mul(multiplier)).add(fractionValue);
|
||||
if (negative) {
|
||||
wei = wei.mul(NegativeOne);
|
||||
}
|
||||
return wei;
|
||||
}
|
||||
exports.parseFixed = parseFixed;
|
||||
var FixedFormat = /** @class */ (function () {
|
||||
function FixedFormat(constructorGuard, signed, width, decimals) {
|
||||
this.signed = signed;
|
||||
this.width = width;
|
||||
this.decimals = decimals;
|
||||
this.name = (signed ? "" : "u") + "fixed" + String(width) + "x" + String(decimals);
|
||||
this._multiplier = getMultiplier(decimals);
|
||||
Object.freeze(this);
|
||||
}
|
||||
FixedFormat.from = function (value) {
|
||||
if (value instanceof FixedFormat) {
|
||||
return value;
|
||||
}
|
||||
var signed = true;
|
||||
var width = 128;
|
||||
var decimals = 18;
|
||||
if (typeof (value) === "string") {
|
||||
if (value === "fixed") {
|
||||
// defaults...
|
||||
}
|
||||
else if (value === "ufixed") {
|
||||
signed = false;
|
||||
}
|
||||
else if (value != null) {
|
||||
var match = value.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);
|
||||
if (!match) {
|
||||
logger.throwArgumentError("invalid fixed format", "format", value);
|
||||
}
|
||||
signed = (match[1] !== "u");
|
||||
width = parseInt(match[2]);
|
||||
decimals = parseInt(match[3]);
|
||||
}
|
||||
}
|
||||
else if (value) {
|
||||
var check = function (key, type, defaultValue) {
|
||||
if (value[key] == null) {
|
||||
return defaultValue;
|
||||
}
|
||||
if (typeof (value[key]) !== type) {
|
||||
logger.throwArgumentError("invalid fixed format (" + key + " not " + type + ")", "format." + key, value[key]);
|
||||
}
|
||||
return value[key];
|
||||
};
|
||||
signed = check("signed", "boolean", signed);
|
||||
width = check("width", "number", width);
|
||||
decimals = check("decimals", "number", decimals);
|
||||
}
|
||||
if (width % 8) {
|
||||
logger.throwArgumentError("invalid fixed format width (not byte aligned)", "format.width", width);
|
||||
}
|
||||
if (decimals > 80) {
|
||||
logger.throwArgumentError("invalid fixed format (decimals too large)", "format.decimals", decimals);
|
||||
}
|
||||
return new FixedFormat(_constructorGuard, signed, width, decimals);
|
||||
};
|
||||
return FixedFormat;
|
||||
}());
|
||||
exports.FixedFormat = FixedFormat;
|
||||
var FixedNumber = /** @class */ (function () {
|
||||
function FixedNumber(constructorGuard, hex, value, format) {
|
||||
var _newTarget = this.constructor;
|
||||
logger.checkNew(_newTarget, FixedNumber);
|
||||
this.format = format;
|
||||
this._hex = hex;
|
||||
this._value = value;
|
||||
this._isFixedNumber = true;
|
||||
Object.freeze(this);
|
||||
}
|
||||
FixedNumber.prototype._checkFormat = function (other) {
|
||||
if (this.format.name !== other.format.name) {
|
||||
logger.throwArgumentError("incompatible format; use fixedNumber.toFormat", "other", other);
|
||||
}
|
||||
};
|
||||
FixedNumber.prototype.addUnsafe = function (other) {
|
||||
this._checkFormat(other);
|
||||
var a = parseFixed(this._value, this.format.decimals);
|
||||
var b = parseFixed(other._value, other.format.decimals);
|
||||
return FixedNumber.fromValue(a.add(b), this.format.decimals, this.format);
|
||||
};
|
||||
FixedNumber.prototype.subUnsafe = function (other) {
|
||||
this._checkFormat(other);
|
||||
var a = parseFixed(this._value, this.format.decimals);
|
||||
var b = parseFixed(other._value, other.format.decimals);
|
||||
return FixedNumber.fromValue(a.sub(b), this.format.decimals, this.format);
|
||||
};
|
||||
FixedNumber.prototype.mulUnsafe = function (other) {
|
||||
this._checkFormat(other);
|
||||
var a = parseFixed(this._value, this.format.decimals);
|
||||
var b = parseFixed(other._value, other.format.decimals);
|
||||
return FixedNumber.fromValue(a.mul(b).div(this.format._multiplier), this.format.decimals, this.format);
|
||||
};
|
||||
FixedNumber.prototype.divUnsafe = function (other) {
|
||||
this._checkFormat(other);
|
||||
var a = parseFixed(this._value, this.format.decimals);
|
||||
var b = parseFixed(other._value, other.format.decimals);
|
||||
return FixedNumber.fromValue(a.mul(this.format._multiplier).div(b), this.format.decimals, this.format);
|
||||
};
|
||||
// @TODO: Support other rounding algorithms
|
||||
FixedNumber.prototype.round = function (decimals) {
|
||||
if (decimals == null) {
|
||||
decimals = 0;
|
||||
}
|
||||
if (decimals < 0 || decimals > 80 || (decimals % 1)) {
|
||||
logger.throwArgumentError("invalid decimal cound", "decimals", decimals);
|
||||
}
|
||||
// If we are already in range, we're done
|
||||
var comps = this.toString().split(".");
|
||||
if (comps[1].length <= decimals) {
|
||||
return this;
|
||||
}
|
||||
// Bump the value up by the 0.00...0005
|
||||
var bump = "0." + zeros.substring(0, decimals) + "5";
|
||||
comps = this.addUnsafe(FixedNumber.fromString(bump, this.format))._value.split(".");
|
||||
// Now it is safe to truncate
|
||||
return FixedNumber.fromString(comps[0] + "." + comps[1].substring(0, decimals));
|
||||
};
|
||||
FixedNumber.prototype.toString = function () { return this._value; };
|
||||
FixedNumber.prototype.toHexString = function (width) {
|
||||
if (width == null) {
|
||||
return this._hex;
|
||||
}
|
||||
if (width % 8) {
|
||||
logger.throwArgumentError("invalid byte width", "width", width);
|
||||
}
|
||||
var hex = bignumber.BigNumber.from(this._hex).fromTwos(this.format.width).toTwos(width).toHexString();
|
||||
return module$1.hexZeroPad(hex, width / 8);
|
||||
};
|
||||
FixedNumber.prototype.toUnsafeFloat = function () { return parseFloat(this.toString()); };
|
||||
FixedNumber.prototype.toFormat = function (format) {
|
||||
return FixedNumber.fromString(this._value, format);
|
||||
};
|
||||
FixedNumber.fromValue = function (value, decimals, format) {
|
||||
// If decimals looks more like a format, and there is no format, shift the parameters
|
||||
if (format == null && decimals != null && !bignumber.isBigNumberish(decimals)) {
|
||||
format = decimals;
|
||||
decimals = null;
|
||||
}
|
||||
if (decimals == null) {
|
||||
decimals = 0;
|
||||
}
|
||||
if (format == null) {
|
||||
format = "fixed";
|
||||
}
|
||||
return FixedNumber.fromString(formatFixed(value, decimals), FixedFormat.from(format));
|
||||
};
|
||||
FixedNumber.fromString = function (value, format) {
|
||||
if (format == null) {
|
||||
format = "fixed";
|
||||
}
|
||||
var fixedFormat = FixedFormat.from(format);
|
||||
var numeric = parseFixed(value, fixedFormat.decimals);
|
||||
if (!fixedFormat.signed && numeric.lt(Zero)) {
|
||||
throwFault("unsigned value cannot be negative", "overflow", "value", value);
|
||||
}
|
||||
var hex = null;
|
||||
if (fixedFormat.signed) {
|
||||
hex = numeric.toTwos(fixedFormat.width).toHexString();
|
||||
}
|
||||
else {
|
||||
hex = numeric.toHexString();
|
||||
hex = module$1.hexZeroPad(hex, fixedFormat.width / 8);
|
||||
}
|
||||
var decimal = formatFixed(numeric, fixedFormat.decimals);
|
||||
return new FixedNumber(_constructorGuard, hex, decimal, fixedFormat);
|
||||
};
|
||||
FixedNumber.fromBytes = function (value, format) {
|
||||
if (format == null) {
|
||||
format = "fixed";
|
||||
}
|
||||
var fixedFormat = FixedFormat.from(format);
|
||||
if (module$1.arrayify(value).length > fixedFormat.width / 8) {
|
||||
throw new Error("overflow");
|
||||
}
|
||||
var numeric = bignumber.BigNumber.from(value);
|
||||
if (fixedFormat.signed) {
|
||||
numeric = numeric.fromTwos(fixedFormat.width);
|
||||
}
|
||||
var hex = numeric.toTwos((fixedFormat.signed ? 0 : 1) + fixedFormat.width).toHexString();
|
||||
var decimal = formatFixed(numeric, fixedFormat.decimals);
|
||||
return new FixedNumber(_constructorGuard, hex, decimal, fixedFormat);
|
||||
};
|
||||
FixedNumber.from = function (value, format) {
|
||||
if (typeof (value) === "string") {
|
||||
return FixedNumber.fromString(value, format);
|
||||
}
|
||||
if (module$1.isBytes(value)) {
|
||||
return FixedNumber.fromBytes(value, format);
|
||||
}
|
||||
try {
|
||||
return FixedNumber.fromValue(value, 0, format);
|
||||
}
|
||||
catch (error) {
|
||||
// Allow NUMERIC_FAULT to bubble up
|
||||
if (error.code !== module.Logger.errors.INVALID_ARGUMENT) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
return logger.throwArgumentError("invalid FixedNumber value", "value", value);
|
||||
};
|
||||
FixedNumber.isFixedNumber = function (value) {
|
||||
return !!(value && value._isFixedNumber);
|
||||
};
|
||||
return FixedNumber;
|
||||
}());
|
||||
exports.FixedNumber = FixedNumber;
|
||||
});
|
||||
|
||||
var fixednumber$1 = unwrapExports(fixednumber);
|
||||
var fixednumber_1 = fixednumber.formatFixed;
|
||||
var fixednumber_2 = fixednumber.parseFixed;
|
||||
var fixednumber_3 = fixednumber.FixedFormat;
|
||||
var fixednumber_4 = fixednumber.FixedNumber;
|
||||
|
||||
const version$k = "units/5.0.0-beta.127";
|
||||
const version$k = "units/5.0.0-beta.126";
|
||||
|
||||
"use strict";
|
||||
const logger$y = new Logger(version$k);
|
||||
@ -19133,7 +18573,7 @@ function formatUnits(value, unitName) {
|
||||
unitName = 3 * index;
|
||||
}
|
||||
}
|
||||
return fixednumber_1(value, (unitName != null) ? unitName : 18);
|
||||
return formatFixed(value, (unitName != null) ? unitName : 18);
|
||||
}
|
||||
function parseUnits(value, unitName) {
|
||||
if (typeof (unitName) === "string") {
|
||||
@ -19142,7 +18582,7 @@ function parseUnits(value, unitName) {
|
||||
unitName = 3 * index;
|
||||
}
|
||||
}
|
||||
return fixednumber_2(value, (unitName != null) ? unitName : 18);
|
||||
return parseFixed(value, (unitName != null) ? unitName : 18);
|
||||
}
|
||||
function formatEther(wei) {
|
||||
return formatUnits(wei, 18);
|
||||
@ -19235,7 +18675,7 @@ var utils$1 = /*#__PURE__*/Object.freeze({
|
||||
"use strict";
|
||||
const platform = "node";
|
||||
|
||||
const version$l = "ethers/5.0.0-beta.156";
|
||||
const version$l = "ethers/5.0.0-beta.155";
|
||||
|
||||
"use strict";
|
||||
const errors = Logger.errors;
|
||||
@ -19278,6 +18718,4 @@ var ethers = /*#__PURE__*/Object.freeze({
|
||||
|
||||
"use strict";
|
||||
|
||||
window.ethers = ethers;
|
||||
|
||||
export { BigNumber, Contract, ContractFactory, FixedNumber, Signer, VoidSigner, Wallet, browser_1$2 as Wordlist, index$1 as constants, errors, ethers, getDefaultProvider, logger$z as logger, platform, providers, utils$1 as utils, version$l as version, browser_2$1 as wordlists };
|
||||
|
2
packages/ethers/dist/ethers.esm.min.js
vendored
2
packages/ethers/dist/ethers.esm.min.js
vendored
File diff suppressed because one or more lines are too long
19944
packages/ethers/dist/ethers.js
vendored
19944
packages/ethers/dist/ethers.js
vendored
File diff suppressed because one or more lines are too long
1
packages/ethers/dist/ethers.min.js
vendored
1
packages/ethers/dist/ethers.min.js
vendored
File diff suppressed because one or more lines are too long
2226
packages/ethers/dist/ethers.umd.js
vendored
2226
packages/ethers/dist/ethers.umd.js
vendored
File diff suppressed because it is too large
Load Diff
2
packages/ethers/dist/ethers.umd.min.js
vendored
2
packages/ethers/dist/ethers.umd.min.js
vendored
File diff suppressed because one or more lines are too long
@ -61,5 +61,5 @@
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"module": "./lib.esm/index.js",
|
||||
"tarballHash": "0xb405e54456bb9eda893991365e18b295b0ce48a434319f02299afee7c7c15320"
|
||||
"tarballHash": "0x75cf66f7ca99a6b0c1b4a1efc948fdec6efb877ceda8cc749adc0afb1925e1d2"
|
||||
}
|
||||
|
@ -25,5 +25,5 @@
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"module": "./lib.esm/index.js",
|
||||
"tarballHash": "0xf5f098266abb3959cec1221ea114f9c9f4330440fd0ebe1e0993961c576675f8"
|
||||
"tarballHash": "0xaef8cc57062b7338b34d09bae80d7e320fd3f33d2623b76e30efb1a2b064bcc9"
|
||||
}
|
||||
|
@ -26,5 +26,5 @@
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"module": "./lib.esm/index.js",
|
||||
"tarballHash": "0x94e31ec73b1932a42dd0ddd31c4684252d8306336f04ad6c20d6fe99e6723e05"
|
||||
"tarballHash": "0x3bf4cb63c74debd7ce364c5193bc17eeb89162846505175bddd8eae172724d12"
|
||||
}
|
||||
|
@ -34,5 +34,5 @@
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"module": "./lib.esm/index.js",
|
||||
"tarballHash": "0x2b740d2841d6666fdbed43d6bd35217d731e93ca51761a5e710140a230f7b159"
|
||||
"tarballHash": "0x1aa41472296a4ab9726dfaa3c12a9ec142120e45fa76441bd4001f23f7c6c71f"
|
||||
}
|
||||
|
@ -36,5 +36,5 @@
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"module": "./lib.esm/index.js",
|
||||
"tarballHash": "0xe51c8db7ea4eac9042c499bb95f21eeeb75205133771e2c65f965fcec53446f9"
|
||||
"tarballHash": "0x7bdd9f912bcc5995dd1556175bf3b9b2569e7bf31fec95e4a6fee21fc9c91308"
|
||||
}
|
||||
|
@ -24,5 +24,5 @@
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"module": "./lib.esm/index.js",
|
||||
"tarballHash": "0x321ddc3fd8264b4555fc6017e46fcd721aaefc45c72d8dfd42259abf2d7af9d1"
|
||||
"tarballHash": "0x1292347cbf0e4d2c969b299a48c285da51c2b5c87eee432e1a0ca1316d3c4df3"
|
||||
}
|
||||
|
@ -20,5 +20,5 @@
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"module": "./lib.esm/index.js",
|
||||
"tarballHash": "0xbed8c881ec0bb9bc2aed81dbac8c2bcf51889b7b8caed2053939a1344e402475"
|
||||
"tarballHash": "0xe63bdaccfd4ac8b5650dfc22ab48a27ae30db28f1e7e5148d5e278d88bca9f06"
|
||||
}
|
||||
|
@ -23,5 +23,5 @@
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"module": "./lib.esm/index.js",
|
||||
"tarballHash": "0xd9e67edd9e4e88e2f320e073abc4f3e7ff0f41f7cb90cf94122c55ec17ce0f27"
|
||||
"tarballHash": "0xf3d4268851266407e27c78868f6274203dd14bb6d52a9568f179862f3d00f786"
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
"version": "5.0.0-beta.127",
|
||||
"description": "The PBKDF2 password-pbased key derivation function for ethers.",
|
||||
"main": "./lib/index.js",
|
||||
"browser": "browser.js",
|
||||
"browser": "./lib/browser.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
@ -26,5 +26,5 @@
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"module": "./lib.esm/index.js",
|
||||
"tarballHash": "0x4830330866b12fb72d882f27189212d4edbda5ad2257d5d5903ea265f28786e9"
|
||||
"tarballHash": "0x5f104b9b5186d943d4b4f6fd7bc7a7e866ea355e39291c3aff275d57dd8badbd"
|
||||
}
|
||||
|
@ -25,5 +25,5 @@
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"module": "./lib.esm/index.js",
|
||||
"tarballHash": "0x68656684c2b7d12224e1a4dc73bdead0b1043aadfedd139aa082036cbffc5a0e"
|
||||
"tarballHash": "0x776280f444c3bf1c8c3581c88f3289253d6795adc776a401d17954e096bb60cb"
|
||||
}
|
||||
|
@ -4,8 +4,8 @@
|
||||
"description": "Ethereum Providers for ethers.",
|
||||
"main": "./lib/index.js",
|
||||
"browser": {
|
||||
"net": "./browser-net.js",
|
||||
"./ipc-provider": "./browser-ipc-provider.js"
|
||||
"net": "./lib/browser-net.js",
|
||||
"./ipc-provider": "./lib/browser-ipc-provider.js"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
@ -44,5 +44,5 @@
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"module": "./lib.esm/index.js",
|
||||
"tarballHash": "0x7d6d0ea53f6c97c8a247450d2ca7f3a6d85f9fc3911bbadb86c63f12e5295e63"
|
||||
"tarballHash": "0xb65f2fd000fd23cfc0ae137cf9f039249380b6639e0019ee5d2b43abec7e6271"
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
"version": "5.0.0-beta.128",
|
||||
"description": "Random utility functions for ethers.",
|
||||
"main": "./lib/index.js",
|
||||
"browser": "browser.js",
|
||||
"browser": "./lib/browser.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
@ -29,5 +29,5 @@
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"module": "./lib.esm/index.js",
|
||||
"tarballHash": "0x12bbfa545217fbf34da3e01d4e42d231a202b4b8a615d2f4e10b84c6fa354edb"
|
||||
"tarballHash": "0xc6450e8215ec6b6d0fccda331c5541d2a5a7ebf86b7d4d0fd83429c08437f826"
|
||||
}
|
||||
|
@ -24,5 +24,5 @@
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"module": "./lib.esm/index.js",
|
||||
"tarballHash": "0xb8ddada3158be8ee0419832c53ef51c466a07b862c56e5402567f5a096ce1f6d"
|
||||
"tarballHash": "0x33e977a875ac88214d1dd31b62f4a4fb4c18710c3b0ea453b973656c80d4d824"
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
"version": "5.0.0-beta.129",
|
||||
"description": "The SHA2 family hash functions and HMAC functions for ethers.",
|
||||
"main": "./lib/index.js",
|
||||
"browser": "browser.js",
|
||||
"browser": "./lib/browser.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
@ -26,5 +26,5 @@
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"module": "./lib.esm/index.js",
|
||||
"tarballHash": "0x1550ecce4b5da09b8f7b95a4313b68d767a73e3f5920ea5636d34022e2971957"
|
||||
"tarballHash": "0x87b6ff04df9c0df26a7afaf9880262797538b004b0581a72d108510f5b1f9235"
|
||||
}
|
||||
|
@ -26,5 +26,5 @@
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"module": "./lib.esm/index.js",
|
||||
"tarballHash": "0xf65693a06f04727d25829cc27edc77c7d0514ca87ecdd1593e968526380cad4b"
|
||||
"tarballHash": "0x0126d28a0bb036b3a68821568153fc33edd738f21757dcd79f8dfca33d5b09e7"
|
||||
}
|
||||
|
@ -27,5 +27,5 @@
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"module": "./lib.esm/index.js",
|
||||
"tarballHash": "0x12c5fdd83ae961c1474dc119a576fd069d15dfd81c555072d8271f7da8b98bef"
|
||||
"tarballHash": "0x5a24d578f0111ef50d2380aa3f1958e6143d7edab3b1330647e3ac4b77f9115b"
|
||||
}
|
||||
|
@ -27,5 +27,5 @@
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"module": "./lib.esm/index.js",
|
||||
"tarballHash": "0xc677425c7f1ff6b76a370731692da0995eba3a44861dd93b147874b8fae74007"
|
||||
"tarballHash": "0xcbb038765fe741066b9e003c1e805d9a6e8c617aeb4a1d96ab40425122fc9dd3"
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
"use strict";
|
||||
//let web3 = new Web3(new Web3.providers.HttpProvider('http://127.0.0.1:8549'));
|
||||
//import { compile as _compile } from "solc";
|
||||
import { compile } from "@ethersproject/cli/solc";
|
||||
import { solc } from "@ethersproject/cli";
|
||||
import { randomHexString, randomNumber } from "..";
|
||||
import { BN, keccak256, toChecksumAddress } from "ethereumjs-util";
|
||||
function hasPrefix(str, prefix) {
|
||||
@ -510,7 +510,7 @@ for (let i = 0; i < 100; i++) {
|
||||
let solidity = generateSolidity(params);
|
||||
console.log(solidity);
|
||||
console.log(i);
|
||||
let bytecode = compile(solidity)[0].bytecode;
|
||||
let bytecode = solc.compile(solidity)[0].bytecode;
|
||||
//console.log(params.map(p => p.type).join(", "));
|
||||
//console.log(bytecode);
|
||||
let testcase = {
|
||||
|
@ -7,12 +7,12 @@ import { keccak256 } from "@ethersproject/keccak256";
|
||||
import { toUtf8Bytes } from "@ethersproject/strings";
|
||||
export function saveTests(tag, data) {
|
||||
//let filename = path.resolve(__dirname, 'testcases', tag + '.json.gz');
|
||||
let filename = path.resolve('testcases', tag + '.json.gz');
|
||||
let filename = path.resolve('../testcases', tag + '.json.gz');
|
||||
fs.writeFileSync(filename, zlib.gzipSync(JSON.stringify(data, undefined, ' ') + '\n'));
|
||||
console.log('Save testcase: ' + filename);
|
||||
}
|
||||
export function loadTests(tag) {
|
||||
let filename = path.resolve(__dirname, 'testcases', tag + '.json.gz');
|
||||
let filename = path.resolve(__dirname, '../testcases', tag + '.json.gz');
|
||||
return JSON.parse(zlib.gunzipSync(fs.readFileSync(filename)).toString());
|
||||
}
|
||||
export function loadData(filename) {
|
||||
|
@ -15,7 +15,7 @@
|
||||
"browserify-zlib": "^0.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ethersproject/cli": ">=5.0.0-beta.133",
|
||||
"@ethersproject/cli": ">=5.0.0-beta.142",
|
||||
"@types/bip39": "2.4.1",
|
||||
"@types/bitcoinjs-lib": "3.3.2",
|
||||
"bip39": "2.5.0",
|
||||
@ -37,5 +37,5 @@
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"module": "./lib.esm/index.js",
|
||||
"tarballHash": "0xecb1966755ccacc53768d87bf4a91cf0ca5b46d1ce30268daf651f27bd2a07a9"
|
||||
"tarballHash": "0x3eecab2eb7ec5cb3a83064cef11b20e9be3abaf360fc24dc22ddb890ba072544"
|
||||
}
|
||||
|
@ -37,5 +37,5 @@
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"module": "./lib.esm/index.js",
|
||||
"tarballHash": "0x6cb1911af4d7c3550c1225b39891e54a8c67276f2d1f9b38ed0b6168711c7dd0"
|
||||
"tarballHash": "0xbe37358972f6b48eaf05ca1a30f164a3da3370372aa81b5f71a6ced50f93f741"
|
||||
}
|
||||
|
@ -31,5 +31,5 @@
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"module": "./lib.esm/index.js",
|
||||
"tarballHash": "0x98659289537d6259256584ecd435405580a14f5219f8312be9d95ce30eea5b21"
|
||||
"tarballHash": "0x5a7f7a0edf47aeda2379fb0759b59d538bb6d68b05508e1ee047643239d3beba"
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
"use strict";
|
||||
import { formatFixed, parseFixed } from "@ethersproject/bignumber/fixednumber";
|
||||
import { formatFixed, parseFixed } from "@ethersproject/bignumber";
|
||||
import { Logger } from "@ethersproject/logger";
|
||||
import { version } from "./_version";
|
||||
const logger = new Logger(version);
|
||||
|
@ -27,5 +27,5 @@
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"module": "./lib.esm/index.js",
|
||||
"tarballHash": "0x5479e371548e25506a64d279c312e51f06828b3802cece3c5f3f621b67b61abd"
|
||||
"tarballHash": "0x03fcf14ceb26ccd22b4bde2095d99815d33a3ee10c663c66863098cb04e5a949"
|
||||
}
|
||||
|
2
packages/wallet/lib.esm/index.d.ts
vendored
2
packages/wallet/lib.esm/index.d.ts
vendored
@ -3,7 +3,7 @@ import { ExternallyOwnedAccount, Signer } from "@ethersproject/abstract-signer";
|
||||
import { Bytes, BytesLike, SignatureLike } from "@ethersproject/bytes";
|
||||
import { SigningKey } from "@ethersproject/signing-key";
|
||||
import { ProgressCallback } from "@ethersproject/json-wallets";
|
||||
import { Wordlist } from "@ethersproject/wordlists/wordlist";
|
||||
import { Wordlist } from "@ethersproject/wordlists";
|
||||
export declare class Wallet extends Signer implements ExternallyOwnedAccount {
|
||||
readonly address: string;
|
||||
readonly provider: Provider;
|
||||
|
@ -37,5 +37,5 @@
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"module": "./lib.esm/index.js",
|
||||
"tarballHash": "0x460a045fc0b735ecdb14c5dd2c93c0dc45658ff46071f41dbf4a7cc6d3af1450"
|
||||
"tarballHash": "0x089e1006fc830b53ddc8c3c4eb83774a600b56d16e7a86846ff5a82b209d22d6"
|
||||
}
|
||||
|
@ -27,5 +27,5 @@
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"module": "./lib.esm/index.js",
|
||||
"tarballHash": "0x79ab00f43c26bd2e93155b849eabaaac737c689bcee3dd73f401b4b2f953f82e"
|
||||
"tarballHash": "0x10b30a94e8417a1835f4b0468b9cf5523959c856598bbdc914cb5902c0618e50"
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
"version": "5.0.0-beta.128",
|
||||
"description": "Word lists for BIP39 wallets.",
|
||||
"main": "./lib/index.js",
|
||||
"browser": "browser.js",
|
||||
"browser": "./lib/browser.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
@ -28,5 +28,5 @@
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"module": "./lib.esm/index.js",
|
||||
"tarballHash": "0x2c13e3b70876f57cc7a6f8ad6240f177e2a5b65c80f865aff28c890e784ae1d8"
|
||||
"tarballHash": "0x7c5bb7cc5b54a118fd80e310c83087a8fbe5c4680812cc8bc78f0205052fbbb7"
|
||||
}
|
||||
|
@ -44,13 +44,13 @@ export default commandLineArgs => {
|
||||
let buildModule = commandLineArgs.configModule;
|
||||
let testing = commandLineArgs.configTest;
|
||||
|
||||
let input = "packages/ethers/index.js"
|
||||
let input = "packages/ethers/lib/index.js"
|
||||
let output = [ "umd" ];
|
||||
let format = "umd";
|
||||
let mainFields = [ "browser", "main" ];
|
||||
|
||||
if (buildModule) {
|
||||
input = "packages/ethers/module/index.js";
|
||||
input = "packages/ethers/lib.esm/index.js";
|
||||
output = [ "esm" ];
|
||||
format = "esm";
|
||||
mainFields = [ "browser", "module", "main" ];
|
||||
|
Loading…
Reference in New Issue
Block a user