@depay/widgets 4.4.0 → 4.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cjs/index.bundle.js +799 -209
- package/dist/cjs/index.js +9 -7
- package/dist/es/index.bundle.js +799 -209
- package/dist/es/index.js +9 -7
- package/dist/umd/index.bundle.js +799 -209
- package/dist/umd/index.js +9 -7
- package/package.json +4 -4
package/dist/umd/index.bundle.js
CHANGED
|
@@ -2415,7 +2415,7 @@
|
|
|
2415
2415
|
let CONSTANTS = {
|
|
2416
2416
|
ZERO: '0x0000000000000000000000000000000000000000',
|
|
2417
2417
|
MAXINT: '115792089237316195423570985008687907853269984665640564039457584007913129639935',
|
|
2418
|
-
WRAPPED: '
|
|
2418
|
+
WRAPPED: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
|
|
2419
2419
|
NATIVE: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
|
|
2420
2420
|
DECIMALS: 18,
|
|
2421
2421
|
SYMBOL: 'ETH',
|
|
@@ -11360,7 +11360,7 @@
|
|
|
11360
11360
|
return logger$H.throwError(fault, Logger$4.errors.NUMERIC_FAULT, params);
|
|
11361
11361
|
}
|
|
11362
11362
|
// value should have no prefix
|
|
11363
|
-
function _base36To16$
|
|
11363
|
+
function _base36To16$3(value) {
|
|
11364
11364
|
return (new BN$4(value, 36)).toString(16);
|
|
11365
11365
|
}
|
|
11366
11366
|
|
|
@@ -12825,7 +12825,7 @@
|
|
|
12825
12825
|
}
|
|
12826
12826
|
}
|
|
12827
12827
|
|
|
12828
|
-
var sha3$
|
|
12828
|
+
var sha3$4 = createCommonjsModule$4(function (module) {
|
|
12829
12829
|
/*jslint bitwise: true */
|
|
12830
12830
|
(function () {
|
|
12831
12831
|
|
|
@@ -13469,10 +13469,10 @@
|
|
|
13469
13469
|
})();
|
|
13470
13470
|
});
|
|
13471
13471
|
|
|
13472
|
-
var sha3$
|
|
13472
|
+
var sha3$5 = sha3$4;
|
|
13473
13473
|
|
|
13474
|
-
function keccak256$
|
|
13475
|
-
return '0x' + sha3$
|
|
13474
|
+
function keccak256$3(data) {
|
|
13475
|
+
return '0x' + sha3$5.keccak_256(arrayify$3(data));
|
|
13476
13476
|
}
|
|
13477
13477
|
|
|
13478
13478
|
const version$s = "rlp/5.5.0";
|
|
@@ -13522,7 +13522,7 @@
|
|
|
13522
13522
|
const version$r = "address/5.5.0";
|
|
13523
13523
|
|
|
13524
13524
|
const logger$B = new Logger$4(version$r);
|
|
13525
|
-
function getChecksumAddress$
|
|
13525
|
+
function getChecksumAddress$3(address) {
|
|
13526
13526
|
if (!isHexString$4(address, 20)) {
|
|
13527
13527
|
logger$B.throwArgumentError("invalid address", "address", address);
|
|
13528
13528
|
}
|
|
@@ -13532,7 +13532,7 @@
|
|
|
13532
13532
|
for (let i = 0; i < 40; i++) {
|
|
13533
13533
|
expanded[i] = chars[i].charCodeAt(0);
|
|
13534
13534
|
}
|
|
13535
|
-
const hashed = arrayify$3(keccak256$
|
|
13535
|
+
const hashed = arrayify$3(keccak256$3(expanded));
|
|
13536
13536
|
for (let i = 0; i < 40; i += 2) {
|
|
13537
13537
|
if ((hashed[i >> 1] >> 4) >= 8) {
|
|
13538
13538
|
chars[i] = chars[i].toUpperCase();
|
|
@@ -13544,8 +13544,8 @@
|
|
|
13544
13544
|
return "0x" + chars.join("");
|
|
13545
13545
|
}
|
|
13546
13546
|
// Shims for environments that are missing some required constants and functions
|
|
13547
|
-
const MAX_SAFE_INTEGER$
|
|
13548
|
-
function log10$
|
|
13547
|
+
const MAX_SAFE_INTEGER$4 = 0x1fffffffffffff;
|
|
13548
|
+
function log10$4(x) {
|
|
13549
13549
|
if (Math.log10) {
|
|
13550
13550
|
return Math.log10(x);
|
|
13551
13551
|
}
|
|
@@ -13553,22 +13553,22 @@
|
|
|
13553
13553
|
}
|
|
13554
13554
|
// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number
|
|
13555
13555
|
// Create lookup table
|
|
13556
|
-
const ibanLookup$
|
|
13556
|
+
const ibanLookup$3 = {};
|
|
13557
13557
|
for (let i = 0; i < 10; i++) {
|
|
13558
|
-
ibanLookup$
|
|
13558
|
+
ibanLookup$3[String(i)] = String(i);
|
|
13559
13559
|
}
|
|
13560
13560
|
for (let i = 0; i < 26; i++) {
|
|
13561
|
-
ibanLookup$
|
|
13561
|
+
ibanLookup$3[String.fromCharCode(65 + i)] = String(10 + i);
|
|
13562
13562
|
}
|
|
13563
13563
|
// How many decimal digits can we process? (for 64-bit float, this is 15)
|
|
13564
|
-
const safeDigits$
|
|
13565
|
-
function ibanChecksum$
|
|
13564
|
+
const safeDigits$3 = Math.floor(log10$4(MAX_SAFE_INTEGER$4));
|
|
13565
|
+
function ibanChecksum$3(address) {
|
|
13566
13566
|
address = address.toUpperCase();
|
|
13567
13567
|
address = address.substring(4) + address.substring(0, 2) + "00";
|
|
13568
|
-
let expanded = address.split("").map((c) => { return ibanLookup$
|
|
13568
|
+
let expanded = address.split("").map((c) => { return ibanLookup$3[c]; }).join("");
|
|
13569
13569
|
// Javascript can handle integers safely up to 15 (decimal) digits
|
|
13570
|
-
while (expanded.length >= safeDigits$
|
|
13571
|
-
let block = expanded.substring(0, safeDigits$
|
|
13570
|
+
while (expanded.length >= safeDigits$3) {
|
|
13571
|
+
let block = expanded.substring(0, safeDigits$3);
|
|
13572
13572
|
expanded = parseInt(block, 10) % 97 + expanded.substring(block.length);
|
|
13573
13573
|
}
|
|
13574
13574
|
let checksum = String(98 - (parseInt(expanded, 10) % 97));
|
|
@@ -13577,7 +13577,7 @@
|
|
|
13577
13577
|
}
|
|
13578
13578
|
return checksum;
|
|
13579
13579
|
}
|
|
13580
|
-
function getAddress$
|
|
13580
|
+
function getAddress$3(address) {
|
|
13581
13581
|
let result = null;
|
|
13582
13582
|
if (typeof (address) !== "string") {
|
|
13583
13583
|
logger$B.throwArgumentError("invalid address", "address", address);
|
|
@@ -13587,7 +13587,7 @@
|
|
|
13587
13587
|
if (address.substring(0, 2) !== "0x") {
|
|
13588
13588
|
address = "0x" + address;
|
|
13589
13589
|
}
|
|
13590
|
-
result = getChecksumAddress$
|
|
13590
|
+
result = getChecksumAddress$3(address);
|
|
13591
13591
|
// It is a checksummed address with a bad checksum
|
|
13592
13592
|
if (address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) && result !== address) {
|
|
13593
13593
|
logger$B.throwArgumentError("bad address checksum", "address", address);
|
|
@@ -13596,14 +13596,14 @@
|
|
|
13596
13596
|
}
|
|
13597
13597
|
else if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {
|
|
13598
13598
|
// It is an ICAP address with a bad checksum
|
|
13599
|
-
if (address.substring(2, 4) !== ibanChecksum$
|
|
13599
|
+
if (address.substring(2, 4) !== ibanChecksum$3(address)) {
|
|
13600
13600
|
logger$B.throwArgumentError("bad icap checksum", "address", address);
|
|
13601
13601
|
}
|
|
13602
|
-
result = _base36To16$
|
|
13602
|
+
result = _base36To16$3(address.substring(4));
|
|
13603
13603
|
while (result.length < 40) {
|
|
13604
13604
|
result = "0" + result;
|
|
13605
13605
|
}
|
|
13606
|
-
result = getChecksumAddress$
|
|
13606
|
+
result = getChecksumAddress$3("0x" + result);
|
|
13607
13607
|
}
|
|
13608
13608
|
else {
|
|
13609
13609
|
logger$B.throwArgumentError("invalid address", "address", address);
|
|
@@ -13614,13 +13614,13 @@
|
|
|
13614
13614
|
function getContractAddress$2(transaction) {
|
|
13615
13615
|
let from = null;
|
|
13616
13616
|
try {
|
|
13617
|
-
from = getAddress$
|
|
13617
|
+
from = getAddress$3(transaction.from);
|
|
13618
13618
|
}
|
|
13619
13619
|
catch (error) {
|
|
13620
13620
|
logger$B.throwArgumentError("missing from address", "transaction", transaction);
|
|
13621
13621
|
}
|
|
13622
13622
|
const nonce = stripZeros$2(arrayify$3(BigNumber$4.from(transaction.nonce).toHexString()));
|
|
13623
|
-
return getAddress$
|
|
13623
|
+
return getAddress$3(hexDataSlice$2(keccak256$3(encode$4([from, nonce])), 12));
|
|
13624
13624
|
}
|
|
13625
13625
|
|
|
13626
13626
|
class AddressCoder$1 extends Coder$1 {
|
|
@@ -13632,7 +13632,7 @@
|
|
|
13632
13632
|
}
|
|
13633
13633
|
encode(writer, value) {
|
|
13634
13634
|
try {
|
|
13635
|
-
value = getAddress$
|
|
13635
|
+
value = getAddress$3(value);
|
|
13636
13636
|
}
|
|
13637
13637
|
catch (error) {
|
|
13638
13638
|
this._throwError(error.message, value);
|
|
@@ -13640,7 +13640,7 @@
|
|
|
13640
13640
|
return writer.writeValue(value);
|
|
13641
13641
|
}
|
|
13642
13642
|
decode(reader) {
|
|
13643
|
-
return getAddress$
|
|
13643
|
+
return getAddress$3(hexZeroPad$3(reader.readValue().toHexString(), 20));
|
|
13644
13644
|
}
|
|
13645
13645
|
}
|
|
13646
13646
|
|
|
@@ -14353,7 +14353,7 @@
|
|
|
14353
14353
|
const defaultAbiCoder$1 = new AbiCoder$1();
|
|
14354
14354
|
|
|
14355
14355
|
function id$2(text) {
|
|
14356
|
-
return keccak256$
|
|
14356
|
+
return keccak256$3(toUtf8Bytes$2(text));
|
|
14357
14357
|
}
|
|
14358
14358
|
|
|
14359
14359
|
const logger$x = new Logger$4(version$t);
|
|
@@ -14470,7 +14470,7 @@
|
|
|
14470
14470
|
return defaultAbiCoder$1;
|
|
14471
14471
|
}
|
|
14472
14472
|
static getAddress(address) {
|
|
14473
|
-
return getAddress$
|
|
14473
|
+
return getAddress$3(address);
|
|
14474
14474
|
}
|
|
14475
14475
|
static getSighash(fragment) {
|
|
14476
14476
|
return hexDataSlice$2(id$2(fragment.format()), 0, 4);
|
|
@@ -14715,7 +14715,7 @@
|
|
|
14715
14715
|
return id$2(value);
|
|
14716
14716
|
}
|
|
14717
14717
|
else if (param.type === "bytes") {
|
|
14718
|
-
return keccak256$
|
|
14718
|
+
return keccak256$3(hexlify$4(value));
|
|
14719
14719
|
}
|
|
14720
14720
|
// Check addresses are valid
|
|
14721
14721
|
if (param.type === "address") {
|
|
@@ -14770,7 +14770,7 @@
|
|
|
14770
14770
|
topics.push(id$2(value));
|
|
14771
14771
|
}
|
|
14772
14772
|
else if (param.type === "bytes") {
|
|
14773
|
-
topics.push(keccak256$
|
|
14773
|
+
topics.push(keccak256$3(value));
|
|
14774
14774
|
}
|
|
14775
14775
|
else if (param.baseType === "tuple" || param.baseType === "array") {
|
|
14776
14776
|
// @TODO
|
|
@@ -15307,7 +15307,7 @@
|
|
|
15307
15307
|
})(TransactionTypes$2 || (TransactionTypes$2 = {}));
|
|
15308
15308
|
function accessSetify$2(addr, storageKeys) {
|
|
15309
15309
|
return {
|
|
15310
|
-
address: getAddress$
|
|
15310
|
+
address: getAddress$3(addr),
|
|
15311
15311
|
storageKeys: (storageKeys || []).map((storageKey, index) => {
|
|
15312
15312
|
if (hexDataLength$2(storageKey) !== 32) {
|
|
15313
15313
|
logger$u.throwArgumentError("invalid access list storageKey", `accessList[${addr}:${index}]`, storageKey);
|
|
@@ -15359,7 +15359,7 @@
|
|
|
15359
15359
|
}
|
|
15360
15360
|
// If it is already an address, just use it (after adding checksum)
|
|
15361
15361
|
try {
|
|
15362
|
-
return getAddress$
|
|
15362
|
+
return getAddress$3(name);
|
|
15363
15363
|
}
|
|
15364
15364
|
catch (error) { }
|
|
15365
15365
|
if (!resolver) {
|
|
@@ -15418,7 +15418,7 @@
|
|
|
15418
15418
|
override: resolveName$1(contract.signer, overrides.from),
|
|
15419
15419
|
signer: contract.signer.getAddress()
|
|
15420
15420
|
}).then((check) => __awaiter$a(this, void 0, void 0, function* () {
|
|
15421
|
-
if (getAddress$
|
|
15421
|
+
if (getAddress$3(check.signer) !== check.override) {
|
|
15422
15422
|
logger$t.throwError("Contract with a Signer cannot override from", Logger$4.errors.UNSUPPORTED_OPERATION, {
|
|
15423
15423
|
operation: "overrides.from"
|
|
15424
15424
|
});
|
|
@@ -15854,7 +15854,7 @@
|
|
|
15854
15854
|
}
|
|
15855
15855
|
else {
|
|
15856
15856
|
try {
|
|
15857
|
-
defineReadOnly$2(this, "resolvedAddress", Promise.resolve(getAddress$
|
|
15857
|
+
defineReadOnly$2(this, "resolvedAddress", Promise.resolve(getAddress$3(addressOrName)));
|
|
15858
15858
|
}
|
|
15859
15859
|
catch (error) {
|
|
15860
15860
|
// Without a provider, we cannot use ENS names
|
|
@@ -20919,7 +20919,7 @@
|
|
|
20919
20919
|
return logger$e$1.throwError(fault, Logger$3.errors.NUMERIC_FAULT, params);
|
|
20920
20920
|
}
|
|
20921
20921
|
// value should have no prefix
|
|
20922
|
-
function _base36To16$
|
|
20922
|
+
function _base36To16$2(value) {
|
|
20923
20923
|
return (new BN$3(value, 36)).toString(16);
|
|
20924
20924
|
}
|
|
20925
20925
|
|
|
@@ -22125,7 +22125,7 @@
|
|
|
22125
22125
|
* @license MIT
|
|
22126
22126
|
*/
|
|
22127
22127
|
|
|
22128
|
-
var sha3$
|
|
22128
|
+
var sha3$3 = createCommonjsModule$1$2(function (module) {
|
|
22129
22129
|
/*jslint bitwise: true */
|
|
22130
22130
|
(function () {
|
|
22131
22131
|
|
|
@@ -22594,14 +22594,14 @@
|
|
|
22594
22594
|
})();
|
|
22595
22595
|
});
|
|
22596
22596
|
|
|
22597
|
-
var sha3$1$
|
|
22597
|
+
var sha3$1$2 = sha3$3;
|
|
22598
22598
|
|
|
22599
|
-
function keccak256$
|
|
22600
|
-
return '0x' + sha3$1$
|
|
22599
|
+
function keccak256$2(data) {
|
|
22600
|
+
return '0x' + sha3$1$2.keccak_256(arrayify$2(data));
|
|
22601
22601
|
}
|
|
22602
22602
|
|
|
22603
22603
|
function id$1(text) {
|
|
22604
|
-
return keccak256$
|
|
22604
|
+
return keccak256$2(toUtf8Bytes$1(text));
|
|
22605
22605
|
}
|
|
22606
22606
|
|
|
22607
22607
|
const version$7$1 = "hash/5.4.0";
|
|
@@ -22623,7 +22623,7 @@
|
|
|
22623
22623
|
logger$9$1.throwArgumentError("invalid ENS address; missing component", "name", name);
|
|
22624
22624
|
}
|
|
22625
22625
|
const label = toUtf8Bytes$1(nameprep$1(partition[3]));
|
|
22626
|
-
result = keccak256$
|
|
22626
|
+
result = keccak256$2(concat$1([result, keccak256$2(label)]));
|
|
22627
22627
|
current = partition[2] || "";
|
|
22628
22628
|
}
|
|
22629
22629
|
return hexlify$3(result);
|
|
@@ -22746,10 +22746,10 @@
|
|
|
22746
22746
|
return decoded.result;
|
|
22747
22747
|
}
|
|
22748
22748
|
|
|
22749
|
-
const version$5$
|
|
22749
|
+
const version$5$2 = "address/5.4.0";
|
|
22750
22750
|
|
|
22751
|
-
const logger$7$1 = new Logger$3(version$5$
|
|
22752
|
-
function getChecksumAddress$
|
|
22751
|
+
const logger$7$1 = new Logger$3(version$5$2);
|
|
22752
|
+
function getChecksumAddress$2(address) {
|
|
22753
22753
|
if (!isHexString$3(address, 20)) {
|
|
22754
22754
|
logger$7$1.throwArgumentError("invalid address", "address", address);
|
|
22755
22755
|
}
|
|
@@ -22759,7 +22759,7 @@
|
|
|
22759
22759
|
for (let i = 0; i < 40; i++) {
|
|
22760
22760
|
expanded[i] = chars[i].charCodeAt(0);
|
|
22761
22761
|
}
|
|
22762
|
-
const hashed = arrayify$2(keccak256$
|
|
22762
|
+
const hashed = arrayify$2(keccak256$2(expanded));
|
|
22763
22763
|
for (let i = 0; i < 40; i += 2) {
|
|
22764
22764
|
if ((hashed[i >> 1] >> 4) >= 8) {
|
|
22765
22765
|
chars[i] = chars[i].toUpperCase();
|
|
@@ -22771,8 +22771,8 @@
|
|
|
22771
22771
|
return "0x" + chars.join("");
|
|
22772
22772
|
}
|
|
22773
22773
|
// Shims for environments that are missing some required constants and functions
|
|
22774
|
-
const MAX_SAFE_INTEGER$
|
|
22775
|
-
function log10$
|
|
22774
|
+
const MAX_SAFE_INTEGER$3 = 0x1fffffffffffff;
|
|
22775
|
+
function log10$3(x) {
|
|
22776
22776
|
if (Math.log10) {
|
|
22777
22777
|
return Math.log10(x);
|
|
22778
22778
|
}
|
|
@@ -22780,22 +22780,22 @@
|
|
|
22780
22780
|
}
|
|
22781
22781
|
// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number
|
|
22782
22782
|
// Create lookup table
|
|
22783
|
-
const ibanLookup$
|
|
22783
|
+
const ibanLookup$2 = {};
|
|
22784
22784
|
for (let i = 0; i < 10; i++) {
|
|
22785
|
-
ibanLookup$
|
|
22785
|
+
ibanLookup$2[String(i)] = String(i);
|
|
22786
22786
|
}
|
|
22787
22787
|
for (let i = 0; i < 26; i++) {
|
|
22788
|
-
ibanLookup$
|
|
22788
|
+
ibanLookup$2[String.fromCharCode(65 + i)] = String(10 + i);
|
|
22789
22789
|
}
|
|
22790
22790
|
// How many decimal digits can we process? (for 64-bit float, this is 15)
|
|
22791
|
-
const safeDigits$
|
|
22792
|
-
function ibanChecksum$
|
|
22791
|
+
const safeDigits$2 = Math.floor(log10$3(MAX_SAFE_INTEGER$3));
|
|
22792
|
+
function ibanChecksum$2(address) {
|
|
22793
22793
|
address = address.toUpperCase();
|
|
22794
22794
|
address = address.substring(4) + address.substring(0, 2) + "00";
|
|
22795
|
-
let expanded = address.split("").map((c) => { return ibanLookup$
|
|
22795
|
+
let expanded = address.split("").map((c) => { return ibanLookup$2[c]; }).join("");
|
|
22796
22796
|
// Javascript can handle integers safely up to 15 (decimal) digits
|
|
22797
|
-
while (expanded.length >= safeDigits$
|
|
22798
|
-
let block = expanded.substring(0, safeDigits$
|
|
22797
|
+
while (expanded.length >= safeDigits$2) {
|
|
22798
|
+
let block = expanded.substring(0, safeDigits$2);
|
|
22799
22799
|
expanded = parseInt(block, 10) % 97 + expanded.substring(block.length);
|
|
22800
22800
|
}
|
|
22801
22801
|
let checksum = String(98 - (parseInt(expanded, 10) % 97));
|
|
@@ -22804,7 +22804,7 @@
|
|
|
22804
22804
|
}
|
|
22805
22805
|
return checksum;
|
|
22806
22806
|
}
|
|
22807
|
-
function getAddress$
|
|
22807
|
+
function getAddress$2(address) {
|
|
22808
22808
|
let result = null;
|
|
22809
22809
|
if (typeof (address) !== "string") {
|
|
22810
22810
|
logger$7$1.throwArgumentError("invalid address", "address", address);
|
|
@@ -22814,7 +22814,7 @@
|
|
|
22814
22814
|
if (address.substring(0, 2) !== "0x") {
|
|
22815
22815
|
address = "0x" + address;
|
|
22816
22816
|
}
|
|
22817
|
-
result = getChecksumAddress$
|
|
22817
|
+
result = getChecksumAddress$2(address);
|
|
22818
22818
|
// It is a checksummed address with a bad checksum
|
|
22819
22819
|
if (address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) && result !== address) {
|
|
22820
22820
|
logger$7$1.throwArgumentError("bad address checksum", "address", address);
|
|
@@ -22823,14 +22823,14 @@
|
|
|
22823
22823
|
}
|
|
22824
22824
|
else if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {
|
|
22825
22825
|
// It is an ICAP address with a bad checksum
|
|
22826
|
-
if (address.substring(2, 4) !== ibanChecksum$
|
|
22826
|
+
if (address.substring(2, 4) !== ibanChecksum$2(address)) {
|
|
22827
22827
|
logger$7$1.throwArgumentError("bad icap checksum", "address", address);
|
|
22828
22828
|
}
|
|
22829
|
-
result = _base36To16$
|
|
22829
|
+
result = _base36To16$2(address.substring(4));
|
|
22830
22830
|
while (result.length < 40) {
|
|
22831
22831
|
result = "0" + result;
|
|
22832
22832
|
}
|
|
22833
|
-
result = getChecksumAddress$
|
|
22833
|
+
result = getChecksumAddress$2("0x" + result);
|
|
22834
22834
|
}
|
|
22835
22835
|
else {
|
|
22836
22836
|
logger$7$1.throwArgumentError("invalid address", "address", address);
|
|
@@ -22841,13 +22841,13 @@
|
|
|
22841
22841
|
function getContractAddress$1(transaction) {
|
|
22842
22842
|
let from = null;
|
|
22843
22843
|
try {
|
|
22844
|
-
from = getAddress$
|
|
22844
|
+
from = getAddress$2(transaction.from);
|
|
22845
22845
|
}
|
|
22846
22846
|
catch (error) {
|
|
22847
22847
|
logger$7$1.throwArgumentError("missing from address", "transaction", transaction);
|
|
22848
22848
|
}
|
|
22849
22849
|
const nonce = stripZeros$1(arrayify$2(BigNumber$3.from(transaction.nonce).toHexString()));
|
|
22850
|
-
return getAddress$
|
|
22850
|
+
return getAddress$2(hexDataSlice$1(keccak256$2(encode$1$1([from, nonce])), 12));
|
|
22851
22851
|
}
|
|
22852
22852
|
|
|
22853
22853
|
var __awaiter$3$1 = function (thisArg, _arguments, P, generator) {
|
|
@@ -22906,7 +22906,7 @@
|
|
|
22906
22906
|
},
|
|
22907
22907
|
verifyingContract: function (value) {
|
|
22908
22908
|
try {
|
|
22909
|
-
return getAddress$
|
|
22909
|
+
return getAddress$2(value).toLowerCase();
|
|
22910
22910
|
}
|
|
22911
22911
|
catch (error) { }
|
|
22912
22912
|
return logger$6$1.throwArgumentError(`invalid domain value "verifyingContract"`, "domain.verifyingContract", value);
|
|
@@ -22963,13 +22963,13 @@
|
|
|
22963
22963
|
}
|
|
22964
22964
|
switch (type) {
|
|
22965
22965
|
case "address": return function (value) {
|
|
22966
|
-
return hexZeroPad$2(getAddress$
|
|
22966
|
+
return hexZeroPad$2(getAddress$2(value), 32);
|
|
22967
22967
|
};
|
|
22968
22968
|
case "bool": return function (value) {
|
|
22969
22969
|
return ((!value) ? hexFalse$1 : hexTrue$1);
|
|
22970
22970
|
};
|
|
22971
22971
|
case "bytes": return function (value) {
|
|
22972
|
-
return keccak256$
|
|
22972
|
+
return keccak256$2(value);
|
|
22973
22973
|
};
|
|
22974
22974
|
case "string": return function (value) {
|
|
22975
22975
|
return id$1(value);
|
|
@@ -23085,9 +23085,9 @@
|
|
|
23085
23085
|
}
|
|
23086
23086
|
let result = value.map(subEncoder);
|
|
23087
23087
|
if (this._types[subtype]) {
|
|
23088
|
-
result = result.map(keccak256$
|
|
23088
|
+
result = result.map(keccak256$2);
|
|
23089
23089
|
}
|
|
23090
|
-
return keccak256$
|
|
23090
|
+
return keccak256$2(hexConcat$1(result));
|
|
23091
23091
|
};
|
|
23092
23092
|
}
|
|
23093
23093
|
// Struct
|
|
@@ -23098,7 +23098,7 @@
|
|
|
23098
23098
|
const values = fields.map(({ name, type }) => {
|
|
23099
23099
|
const result = this.getEncoder(type)(value[name]);
|
|
23100
23100
|
if (this._types[type]) {
|
|
23101
|
-
return keccak256$
|
|
23101
|
+
return keccak256$2(result);
|
|
23102
23102
|
}
|
|
23103
23103
|
return result;
|
|
23104
23104
|
});
|
|
@@ -23119,7 +23119,7 @@
|
|
|
23119
23119
|
return this.getEncoder(type)(value);
|
|
23120
23120
|
}
|
|
23121
23121
|
hashStruct(name, value) {
|
|
23122
|
-
return keccak256$
|
|
23122
|
+
return keccak256$2(this.encodeData(name, value));
|
|
23123
23123
|
}
|
|
23124
23124
|
encode(value) {
|
|
23125
23125
|
return this.encodeData(this.primaryType, value);
|
|
@@ -23189,7 +23189,7 @@
|
|
|
23189
23189
|
]);
|
|
23190
23190
|
}
|
|
23191
23191
|
static hash(domain, types, value) {
|
|
23192
|
-
return keccak256$
|
|
23192
|
+
return keccak256$2(TypedDataEncoder$1.encode(domain, types, value));
|
|
23193
23193
|
}
|
|
23194
23194
|
// Replaces all address types with ENS names with their looked up address
|
|
23195
23195
|
static resolveNames(domain, types, value, resolveName) {
|
|
@@ -27180,7 +27180,7 @@
|
|
|
27180
27180
|
|
|
27181
27181
|
const version$2$3 = "signing-key/5.4.0";
|
|
27182
27182
|
|
|
27183
|
-
const logger$5$
|
|
27183
|
+
const logger$5$2 = new Logger$3(version$2$3);
|
|
27184
27184
|
let _curve$1 = null;
|
|
27185
27185
|
function getCurve$1() {
|
|
27186
27186
|
if (!_curve$1) {
|
|
@@ -27206,7 +27206,7 @@
|
|
|
27206
27206
|
const keyPair = getCurve$1().keyFromPrivate(arrayify$2(this.privateKey));
|
|
27207
27207
|
const digestBytes = arrayify$2(digest);
|
|
27208
27208
|
if (digestBytes.length !== 32) {
|
|
27209
|
-
logger$5$
|
|
27209
|
+
logger$5$2.throwArgumentError("bad digest length", "digest", digest);
|
|
27210
27210
|
}
|
|
27211
27211
|
const signature = keyPair.sign(digestBytes, { canonical: true });
|
|
27212
27212
|
return splitSignature$1({
|
|
@@ -27250,7 +27250,7 @@
|
|
|
27250
27250
|
}
|
|
27251
27251
|
return "0x" + getCurve$1().keyFromPublic(bytes).getPublic(true, "hex");
|
|
27252
27252
|
}
|
|
27253
|
-
return logger$5$
|
|
27253
|
+
return logger$5$2.throwArgumentError("invalid public or private key", "key", "[REDACTED]");
|
|
27254
27254
|
}
|
|
27255
27255
|
|
|
27256
27256
|
const version$1$3 = "transactions/5.4.0";
|
|
@@ -27267,7 +27267,7 @@
|
|
|
27267
27267
|
if (value === "0x") {
|
|
27268
27268
|
return null;
|
|
27269
27269
|
}
|
|
27270
|
-
return getAddress$
|
|
27270
|
+
return getAddress$2(value);
|
|
27271
27271
|
}
|
|
27272
27272
|
function handleNumber$1(value) {
|
|
27273
27273
|
if (value === "0x") {
|
|
@@ -27277,7 +27277,7 @@
|
|
|
27277
27277
|
}
|
|
27278
27278
|
function computeAddress$1(key) {
|
|
27279
27279
|
const publicKey = computePublicKey$1(key);
|
|
27280
|
-
return getAddress$
|
|
27280
|
+
return getAddress$2(hexDataSlice$1(keccak256$2(hexDataSlice$1(publicKey, 1)), 12));
|
|
27281
27281
|
}
|
|
27282
27282
|
function recoverAddress$1(digest, signature) {
|
|
27283
27283
|
return computeAddress$1(recoverPublicKey$1(arrayify$2(digest), signature));
|
|
@@ -27291,7 +27291,7 @@
|
|
|
27291
27291
|
}
|
|
27292
27292
|
function accessSetify$1(addr, storageKeys) {
|
|
27293
27293
|
return {
|
|
27294
|
-
address: getAddress$
|
|
27294
|
+
address: getAddress$2(addr),
|
|
27295
27295
|
storageKeys: (storageKeys || []).map((storageKey, index) => {
|
|
27296
27296
|
if (hexDataLength$1(storageKey) !== 32) {
|
|
27297
27297
|
logger$4$2.throwArgumentError("invalid access list storageKey", `accessList[${addr}:${index}]`, storageKey);
|
|
@@ -27344,7 +27344,7 @@
|
|
|
27344
27344
|
formatNumber$1(transaction.maxPriorityFeePerGas || 0, "maxPriorityFeePerGas"),
|
|
27345
27345
|
formatNumber$1(transaction.maxFeePerGas || 0, "maxFeePerGas"),
|
|
27346
27346
|
formatNumber$1(transaction.gasLimit || 0, "gasLimit"),
|
|
27347
|
-
((transaction.to != null) ? getAddress$
|
|
27347
|
+
((transaction.to != null) ? getAddress$2(transaction.to) : "0x"),
|
|
27348
27348
|
formatNumber$1(transaction.value || 0, "value"),
|
|
27349
27349
|
(transaction.data || "0x"),
|
|
27350
27350
|
(formatAccessList$1(transaction.accessList || []))
|
|
@@ -27363,7 +27363,7 @@
|
|
|
27363
27363
|
formatNumber$1(transaction.nonce || 0, "nonce"),
|
|
27364
27364
|
formatNumber$1(transaction.gasPrice || 0, "gasPrice"),
|
|
27365
27365
|
formatNumber$1(transaction.gasLimit || 0, "gasLimit"),
|
|
27366
|
-
((transaction.to != null) ? getAddress$
|
|
27366
|
+
((transaction.to != null) ? getAddress$2(transaction.to) : "0x"),
|
|
27367
27367
|
formatNumber$1(transaction.value || 0, "value"),
|
|
27368
27368
|
(transaction.data || "0x"),
|
|
27369
27369
|
(formatAccessList$1(transaction.accessList || []))
|
|
@@ -27390,7 +27390,7 @@
|
|
|
27390
27390
|
tx.r = hexZeroPad$2(fields[1], 32);
|
|
27391
27391
|
tx.s = hexZeroPad$2(fields[2], 32);
|
|
27392
27392
|
try {
|
|
27393
|
-
const digest = keccak256$
|
|
27393
|
+
const digest = keccak256$2(serialize(tx));
|
|
27394
27394
|
tx.from = recoverAddress$1(digest, { r: tx.r, s: tx.s, recoveryParam: tx.v });
|
|
27395
27395
|
}
|
|
27396
27396
|
catch (error) {
|
|
@@ -27421,7 +27421,7 @@
|
|
|
27421
27421
|
if (transaction.length === 9) {
|
|
27422
27422
|
return tx;
|
|
27423
27423
|
}
|
|
27424
|
-
tx.hash = keccak256$
|
|
27424
|
+
tx.hash = keccak256$2(payload);
|
|
27425
27425
|
_parseEipSignature$1(tx, transaction.slice(9), _serializeEip1559$1);
|
|
27426
27426
|
return tx;
|
|
27427
27427
|
}
|
|
@@ -27445,7 +27445,7 @@
|
|
|
27445
27445
|
if (transaction.length === 8) {
|
|
27446
27446
|
return tx;
|
|
27447
27447
|
}
|
|
27448
|
-
tx.hash = keccak256$
|
|
27448
|
+
tx.hash = keccak256$2(payload);
|
|
27449
27449
|
_parseEipSignature$1(tx, transaction.slice(8), _serializeEip2930$1);
|
|
27450
27450
|
return tx;
|
|
27451
27451
|
}
|
|
@@ -27496,14 +27496,14 @@
|
|
|
27496
27496
|
raw.push("0x");
|
|
27497
27497
|
recoveryParam -= tx.chainId * 2 + 8;
|
|
27498
27498
|
}
|
|
27499
|
-
const digest = keccak256$
|
|
27499
|
+
const digest = keccak256$2(encode$1$1(raw));
|
|
27500
27500
|
try {
|
|
27501
27501
|
tx.from = recoverAddress$1(digest, { r: hexlify$3(tx.r), s: hexlify$3(tx.s), recoveryParam: recoveryParam });
|
|
27502
27502
|
}
|
|
27503
27503
|
catch (error) {
|
|
27504
27504
|
console.log(error);
|
|
27505
27505
|
}
|
|
27506
|
-
tx.hash = keccak256$
|
|
27506
|
+
tx.hash = keccak256$2(rawTransaction);
|
|
27507
27507
|
}
|
|
27508
27508
|
tx.type = null;
|
|
27509
27509
|
return tx;
|
|
@@ -27705,13 +27705,13 @@
|
|
|
27705
27705
|
// Requires an address
|
|
27706
27706
|
// Strict! Used on input.
|
|
27707
27707
|
address(value) {
|
|
27708
|
-
return getAddress$
|
|
27708
|
+
return getAddress$2(value);
|
|
27709
27709
|
}
|
|
27710
27710
|
callAddress(value) {
|
|
27711
27711
|
if (!isHexString$3(value, 32)) {
|
|
27712
27712
|
return null;
|
|
27713
27713
|
}
|
|
27714
|
-
const address = getAddress$
|
|
27714
|
+
const address = getAddress$2(hexDataSlice$1(value, 12));
|
|
27715
27715
|
return (address === AddressZero$1) ? null : address;
|
|
27716
27716
|
}
|
|
27717
27717
|
contractAddress(value) {
|
|
@@ -35076,7 +35076,7 @@
|
|
|
35076
35076
|
return logger$o.throwError(fault, Logger$2.errors.NUMERIC_FAULT, params);
|
|
35077
35077
|
}
|
|
35078
35078
|
// value should have no prefix
|
|
35079
|
-
function _base36To16(value) {
|
|
35079
|
+
function _base36To16$1(value) {
|
|
35080
35080
|
return (new BN$2(value, 36)).toString(16);
|
|
35081
35081
|
}
|
|
35082
35082
|
|
|
@@ -36560,7 +36560,7 @@
|
|
|
36560
36560
|
* @license MIT
|
|
36561
36561
|
*/
|
|
36562
36562
|
|
|
36563
|
-
var sha3 = createCommonjsModule$1$1(function (module) {
|
|
36563
|
+
var sha3$2 = createCommonjsModule$1$1(function (module) {
|
|
36564
36564
|
/*jslint bitwise: true */
|
|
36565
36565
|
(function () {
|
|
36566
36566
|
|
|
@@ -37029,10 +37029,10 @@
|
|
|
37029
37029
|
})();
|
|
37030
37030
|
});
|
|
37031
37031
|
|
|
37032
|
-
var sha3$1 = sha3;
|
|
37032
|
+
var sha3$1$1 = sha3$2;
|
|
37033
37033
|
|
|
37034
|
-
function keccak256(data) {
|
|
37035
|
-
return '0x' + sha3$1.keccak_256(arrayify$1(data));
|
|
37034
|
+
function keccak256$1(data) {
|
|
37035
|
+
return '0x' + sha3$1$1.keccak_256(arrayify$1(data));
|
|
37036
37036
|
}
|
|
37037
37037
|
|
|
37038
37038
|
const version$d = "rlp/5.4.0";
|
|
@@ -37155,7 +37155,7 @@
|
|
|
37155
37155
|
const version$c = "address/5.4.0";
|
|
37156
37156
|
|
|
37157
37157
|
const logger$i = new Logger$2(version$c);
|
|
37158
|
-
function getChecksumAddress(address) {
|
|
37158
|
+
function getChecksumAddress$1(address) {
|
|
37159
37159
|
if (!isHexString$2(address, 20)) {
|
|
37160
37160
|
logger$i.throwArgumentError("invalid address", "address", address);
|
|
37161
37161
|
}
|
|
@@ -37165,7 +37165,7 @@
|
|
|
37165
37165
|
for (let i = 0; i < 40; i++) {
|
|
37166
37166
|
expanded[i] = chars[i].charCodeAt(0);
|
|
37167
37167
|
}
|
|
37168
|
-
const hashed = arrayify$1(keccak256(expanded));
|
|
37168
|
+
const hashed = arrayify$1(keccak256$1(expanded));
|
|
37169
37169
|
for (let i = 0; i < 40; i += 2) {
|
|
37170
37170
|
if ((hashed[i >> 1] >> 4) >= 8) {
|
|
37171
37171
|
chars[i] = chars[i].toUpperCase();
|
|
@@ -37177,8 +37177,8 @@
|
|
|
37177
37177
|
return "0x" + chars.join("");
|
|
37178
37178
|
}
|
|
37179
37179
|
// Shims for environments that are missing some required constants and functions
|
|
37180
|
-
const MAX_SAFE_INTEGER$
|
|
37181
|
-
function log10$
|
|
37180
|
+
const MAX_SAFE_INTEGER$2 = 0x1fffffffffffff;
|
|
37181
|
+
function log10$2(x) {
|
|
37182
37182
|
if (Math.log10) {
|
|
37183
37183
|
return Math.log10(x);
|
|
37184
37184
|
}
|
|
@@ -37186,22 +37186,22 @@
|
|
|
37186
37186
|
}
|
|
37187
37187
|
// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number
|
|
37188
37188
|
// Create lookup table
|
|
37189
|
-
const ibanLookup = {};
|
|
37189
|
+
const ibanLookup$1 = {};
|
|
37190
37190
|
for (let i = 0; i < 10; i++) {
|
|
37191
|
-
ibanLookup[String(i)] = String(i);
|
|
37191
|
+
ibanLookup$1[String(i)] = String(i);
|
|
37192
37192
|
}
|
|
37193
37193
|
for (let i = 0; i < 26; i++) {
|
|
37194
|
-
ibanLookup[String.fromCharCode(65 + i)] = String(10 + i);
|
|
37194
|
+
ibanLookup$1[String.fromCharCode(65 + i)] = String(10 + i);
|
|
37195
37195
|
}
|
|
37196
37196
|
// How many decimal digits can we process? (for 64-bit float, this is 15)
|
|
37197
|
-
const safeDigits = Math.floor(log10$
|
|
37198
|
-
function ibanChecksum(address) {
|
|
37197
|
+
const safeDigits$1 = Math.floor(log10$2(MAX_SAFE_INTEGER$2));
|
|
37198
|
+
function ibanChecksum$1(address) {
|
|
37199
37199
|
address = address.toUpperCase();
|
|
37200
37200
|
address = address.substring(4) + address.substring(0, 2) + "00";
|
|
37201
|
-
let expanded = address.split("").map((c) => { return ibanLookup[c]; }).join("");
|
|
37201
|
+
let expanded = address.split("").map((c) => { return ibanLookup$1[c]; }).join("");
|
|
37202
37202
|
// Javascript can handle integers safely up to 15 (decimal) digits
|
|
37203
|
-
while (expanded.length >= safeDigits) {
|
|
37204
|
-
let block = expanded.substring(0, safeDigits);
|
|
37203
|
+
while (expanded.length >= safeDigits$1) {
|
|
37204
|
+
let block = expanded.substring(0, safeDigits$1);
|
|
37205
37205
|
expanded = parseInt(block, 10) % 97 + expanded.substring(block.length);
|
|
37206
37206
|
}
|
|
37207
37207
|
let checksum = String(98 - (parseInt(expanded, 10) % 97));
|
|
@@ -37210,7 +37210,7 @@
|
|
|
37210
37210
|
}
|
|
37211
37211
|
return checksum;
|
|
37212
37212
|
}
|
|
37213
|
-
function getAddress(address) {
|
|
37213
|
+
function getAddress$1(address) {
|
|
37214
37214
|
let result = null;
|
|
37215
37215
|
if (typeof (address) !== "string") {
|
|
37216
37216
|
logger$i.throwArgumentError("invalid address", "address", address);
|
|
@@ -37220,7 +37220,7 @@
|
|
|
37220
37220
|
if (address.substring(0, 2) !== "0x") {
|
|
37221
37221
|
address = "0x" + address;
|
|
37222
37222
|
}
|
|
37223
|
-
result = getChecksumAddress(address);
|
|
37223
|
+
result = getChecksumAddress$1(address);
|
|
37224
37224
|
// It is a checksummed address with a bad checksum
|
|
37225
37225
|
if (address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) && result !== address) {
|
|
37226
37226
|
logger$i.throwArgumentError("bad address checksum", "address", address);
|
|
@@ -37229,14 +37229,14 @@
|
|
|
37229
37229
|
}
|
|
37230
37230
|
else if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {
|
|
37231
37231
|
// It is an ICAP address with a bad checksum
|
|
37232
|
-
if (address.substring(2, 4) !== ibanChecksum(address)) {
|
|
37232
|
+
if (address.substring(2, 4) !== ibanChecksum$1(address)) {
|
|
37233
37233
|
logger$i.throwArgumentError("bad icap checksum", "address", address);
|
|
37234
37234
|
}
|
|
37235
|
-
result = _base36To16(address.substring(4));
|
|
37235
|
+
result = _base36To16$1(address.substring(4));
|
|
37236
37236
|
while (result.length < 40) {
|
|
37237
37237
|
result = "0" + result;
|
|
37238
37238
|
}
|
|
37239
|
-
result = getChecksumAddress("0x" + result);
|
|
37239
|
+
result = getChecksumAddress$1("0x" + result);
|
|
37240
37240
|
}
|
|
37241
37241
|
else {
|
|
37242
37242
|
logger$i.throwArgumentError("invalid address", "address", address);
|
|
@@ -37247,13 +37247,13 @@
|
|
|
37247
37247
|
function getContractAddress(transaction) {
|
|
37248
37248
|
let from = null;
|
|
37249
37249
|
try {
|
|
37250
|
-
from = getAddress(transaction.from);
|
|
37250
|
+
from = getAddress$1(transaction.from);
|
|
37251
37251
|
}
|
|
37252
37252
|
catch (error) {
|
|
37253
37253
|
logger$i.throwArgumentError("missing from address", "transaction", transaction);
|
|
37254
37254
|
}
|
|
37255
37255
|
const nonce = stripZeros(arrayify$1(BigNumber$2.from(transaction.nonce).toHexString()));
|
|
37256
|
-
return getAddress(hexDataSlice(keccak256(encode$2([from, nonce])), 12));
|
|
37256
|
+
return getAddress$1(hexDataSlice(keccak256$1(encode$2([from, nonce])), 12));
|
|
37257
37257
|
}
|
|
37258
37258
|
|
|
37259
37259
|
class AddressCoder extends Coder {
|
|
@@ -37265,7 +37265,7 @@
|
|
|
37265
37265
|
}
|
|
37266
37266
|
encode(writer, value) {
|
|
37267
37267
|
try {
|
|
37268
|
-
value = getAddress(value);
|
|
37268
|
+
value = getAddress$1(value);
|
|
37269
37269
|
}
|
|
37270
37270
|
catch (error) {
|
|
37271
37271
|
this._throwError(error.message, value);
|
|
@@ -37273,7 +37273,7 @@
|
|
|
37273
37273
|
return writer.writeValue(value);
|
|
37274
37274
|
}
|
|
37275
37275
|
decode(reader) {
|
|
37276
|
-
return getAddress(hexZeroPad$1(reader.readValue().toHexString(), 20));
|
|
37276
|
+
return getAddress$1(hexZeroPad$1(reader.readValue().toHexString(), 20));
|
|
37277
37277
|
}
|
|
37278
37278
|
}
|
|
37279
37279
|
|
|
@@ -38179,7 +38179,7 @@
|
|
|
38179
38179
|
const defaultAbiCoder = new AbiCoder();
|
|
38180
38180
|
|
|
38181
38181
|
function id(text) {
|
|
38182
|
-
return keccak256(toUtf8Bytes(text));
|
|
38182
|
+
return keccak256$1(toUtf8Bytes(text));
|
|
38183
38183
|
}
|
|
38184
38184
|
|
|
38185
38185
|
const version$a = "hash/5.4.0";
|
|
@@ -38201,7 +38201,7 @@
|
|
|
38201
38201
|
logger$e.throwArgumentError("invalid ENS address; missing component", "name", name);
|
|
38202
38202
|
}
|
|
38203
38203
|
const label = toUtf8Bytes(nameprep(partition[3]));
|
|
38204
|
-
result = keccak256(concat([result, keccak256(label)]));
|
|
38204
|
+
result = keccak256$1(concat([result, keccak256$1(label)]));
|
|
38205
38205
|
current = partition[2] || "";
|
|
38206
38206
|
}
|
|
38207
38207
|
return hexlify$2(result);
|
|
@@ -38263,7 +38263,7 @@
|
|
|
38263
38263
|
},
|
|
38264
38264
|
verifyingContract: function (value) {
|
|
38265
38265
|
try {
|
|
38266
|
-
return getAddress(value).toLowerCase();
|
|
38266
|
+
return getAddress$1(value).toLowerCase();
|
|
38267
38267
|
}
|
|
38268
38268
|
catch (error) { }
|
|
38269
38269
|
return logger$d.throwArgumentError(`invalid domain value "verifyingContract"`, "domain.verifyingContract", value);
|
|
@@ -38320,13 +38320,13 @@
|
|
|
38320
38320
|
}
|
|
38321
38321
|
switch (type) {
|
|
38322
38322
|
case "address": return function (value) {
|
|
38323
|
-
return hexZeroPad$1(getAddress(value), 32);
|
|
38323
|
+
return hexZeroPad$1(getAddress$1(value), 32);
|
|
38324
38324
|
};
|
|
38325
38325
|
case "bool": return function (value) {
|
|
38326
38326
|
return ((!value) ? hexFalse : hexTrue);
|
|
38327
38327
|
};
|
|
38328
38328
|
case "bytes": return function (value) {
|
|
38329
|
-
return keccak256(value);
|
|
38329
|
+
return keccak256$1(value);
|
|
38330
38330
|
};
|
|
38331
38331
|
case "string": return function (value) {
|
|
38332
38332
|
return id(value);
|
|
@@ -38442,9 +38442,9 @@
|
|
|
38442
38442
|
}
|
|
38443
38443
|
let result = value.map(subEncoder);
|
|
38444
38444
|
if (this._types[subtype]) {
|
|
38445
|
-
result = result.map(keccak256);
|
|
38445
|
+
result = result.map(keccak256$1);
|
|
38446
38446
|
}
|
|
38447
|
-
return keccak256(hexConcat(result));
|
|
38447
|
+
return keccak256$1(hexConcat(result));
|
|
38448
38448
|
};
|
|
38449
38449
|
}
|
|
38450
38450
|
// Struct
|
|
@@ -38455,7 +38455,7 @@
|
|
|
38455
38455
|
const values = fields.map(({ name, type }) => {
|
|
38456
38456
|
const result = this.getEncoder(type)(value[name]);
|
|
38457
38457
|
if (this._types[type]) {
|
|
38458
|
-
return keccak256(result);
|
|
38458
|
+
return keccak256$1(result);
|
|
38459
38459
|
}
|
|
38460
38460
|
return result;
|
|
38461
38461
|
});
|
|
@@ -38476,7 +38476,7 @@
|
|
|
38476
38476
|
return this.getEncoder(type)(value);
|
|
38477
38477
|
}
|
|
38478
38478
|
hashStruct(name, value) {
|
|
38479
|
-
return keccak256(this.encodeData(name, value));
|
|
38479
|
+
return keccak256$1(this.encodeData(name, value));
|
|
38480
38480
|
}
|
|
38481
38481
|
encode(value) {
|
|
38482
38482
|
return this.encodeData(this.primaryType, value);
|
|
@@ -38546,7 +38546,7 @@
|
|
|
38546
38546
|
]);
|
|
38547
38547
|
}
|
|
38548
38548
|
static hash(domain, types, value) {
|
|
38549
|
-
return keccak256(TypedDataEncoder.encode(domain, types, value));
|
|
38549
|
+
return keccak256$1(TypedDataEncoder.encode(domain, types, value));
|
|
38550
38550
|
}
|
|
38551
38551
|
// Replaces all address types with ENS names with their looked up address
|
|
38552
38552
|
static resolveNames(domain, types, value, resolveName) {
|
|
@@ -38754,7 +38754,7 @@
|
|
|
38754
38754
|
return defaultAbiCoder;
|
|
38755
38755
|
}
|
|
38756
38756
|
static getAddress(address) {
|
|
38757
|
-
return getAddress(address);
|
|
38757
|
+
return getAddress$1(address);
|
|
38758
38758
|
}
|
|
38759
38759
|
static getSighash(fragment) {
|
|
38760
38760
|
return hexDataSlice(id(fragment.format()), 0, 4);
|
|
@@ -38999,7 +38999,7 @@
|
|
|
38999
38999
|
return id(value);
|
|
39000
39000
|
}
|
|
39001
39001
|
else if (param.type === "bytes") {
|
|
39002
|
-
return keccak256(hexlify$2(value));
|
|
39002
|
+
return keccak256$1(hexlify$2(value));
|
|
39003
39003
|
}
|
|
39004
39004
|
// Check addresses are valid
|
|
39005
39005
|
if (param.type === "address") {
|
|
@@ -39054,7 +39054,7 @@
|
|
|
39054
39054
|
topics.push(id(value));
|
|
39055
39055
|
}
|
|
39056
39056
|
else if (param.type === "bytes") {
|
|
39057
|
-
topics.push(keccak256(value));
|
|
39057
|
+
topics.push(keccak256$1(value));
|
|
39058
39058
|
}
|
|
39059
39059
|
else if (param.baseType === "tuple" || param.baseType === "array") {
|
|
39060
39060
|
// @TOOD
|
|
@@ -46827,7 +46827,7 @@
|
|
|
46827
46827
|
if (value === "0x") {
|
|
46828
46828
|
return null;
|
|
46829
46829
|
}
|
|
46830
|
-
return getAddress(value);
|
|
46830
|
+
return getAddress$1(value);
|
|
46831
46831
|
}
|
|
46832
46832
|
function handleNumber(value) {
|
|
46833
46833
|
if (value === "0x") {
|
|
@@ -46837,7 +46837,7 @@
|
|
|
46837
46837
|
}
|
|
46838
46838
|
function computeAddress(key) {
|
|
46839
46839
|
const publicKey = computePublicKey(key);
|
|
46840
|
-
return getAddress(hexDataSlice(keccak256(hexDataSlice(publicKey, 1)), 12));
|
|
46840
|
+
return getAddress$1(hexDataSlice(keccak256$1(hexDataSlice(publicKey, 1)), 12));
|
|
46841
46841
|
}
|
|
46842
46842
|
function recoverAddress(digest, signature) {
|
|
46843
46843
|
return computeAddress(recoverPublicKey(arrayify$1(digest), signature));
|
|
@@ -46851,7 +46851,7 @@
|
|
|
46851
46851
|
}
|
|
46852
46852
|
function accessSetify(addr, storageKeys) {
|
|
46853
46853
|
return {
|
|
46854
|
-
address: getAddress(addr),
|
|
46854
|
+
address: getAddress$1(addr),
|
|
46855
46855
|
storageKeys: (storageKeys || []).map((storageKey, index) => {
|
|
46856
46856
|
if (hexDataLength(storageKey) !== 32) {
|
|
46857
46857
|
logger$8.throwArgumentError("invalid access list storageKey", `accessList[${addr}:${index}]`, storageKey);
|
|
@@ -46904,7 +46904,7 @@
|
|
|
46904
46904
|
formatNumber(transaction.maxPriorityFeePerGas || 0, "maxPriorityFeePerGas"),
|
|
46905
46905
|
formatNumber(transaction.maxFeePerGas || 0, "maxFeePerGas"),
|
|
46906
46906
|
formatNumber(transaction.gasLimit || 0, "gasLimit"),
|
|
46907
|
-
((transaction.to != null) ? getAddress(transaction.to) : "0x"),
|
|
46907
|
+
((transaction.to != null) ? getAddress$1(transaction.to) : "0x"),
|
|
46908
46908
|
formatNumber(transaction.value || 0, "value"),
|
|
46909
46909
|
(transaction.data || "0x"),
|
|
46910
46910
|
(formatAccessList(transaction.accessList || []))
|
|
@@ -46923,7 +46923,7 @@
|
|
|
46923
46923
|
formatNumber(transaction.nonce || 0, "nonce"),
|
|
46924
46924
|
formatNumber(transaction.gasPrice || 0, "gasPrice"),
|
|
46925
46925
|
formatNumber(transaction.gasLimit || 0, "gasLimit"),
|
|
46926
|
-
((transaction.to != null) ? getAddress(transaction.to) : "0x"),
|
|
46926
|
+
((transaction.to != null) ? getAddress$1(transaction.to) : "0x"),
|
|
46927
46927
|
formatNumber(transaction.value || 0, "value"),
|
|
46928
46928
|
(transaction.data || "0x"),
|
|
46929
46929
|
(formatAccessList(transaction.accessList || []))
|
|
@@ -46950,7 +46950,7 @@
|
|
|
46950
46950
|
tx.r = hexZeroPad$1(fields[1], 32);
|
|
46951
46951
|
tx.s = hexZeroPad$1(fields[2], 32);
|
|
46952
46952
|
try {
|
|
46953
|
-
const digest = keccak256(serialize(tx));
|
|
46953
|
+
const digest = keccak256$1(serialize(tx));
|
|
46954
46954
|
tx.from = recoverAddress(digest, { r: tx.r, s: tx.s, recoveryParam: tx.v });
|
|
46955
46955
|
}
|
|
46956
46956
|
catch (error) {
|
|
@@ -46981,7 +46981,7 @@
|
|
|
46981
46981
|
if (transaction.length === 9) {
|
|
46982
46982
|
return tx;
|
|
46983
46983
|
}
|
|
46984
|
-
tx.hash = keccak256(payload);
|
|
46984
|
+
tx.hash = keccak256$1(payload);
|
|
46985
46985
|
_parseEipSignature(tx, transaction.slice(9), _serializeEip1559);
|
|
46986
46986
|
return tx;
|
|
46987
46987
|
}
|
|
@@ -47005,7 +47005,7 @@
|
|
|
47005
47005
|
if (transaction.length === 8) {
|
|
47006
47006
|
return tx;
|
|
47007
47007
|
}
|
|
47008
|
-
tx.hash = keccak256(payload);
|
|
47008
|
+
tx.hash = keccak256$1(payload);
|
|
47009
47009
|
_parseEipSignature(tx, transaction.slice(8), _serializeEip2930);
|
|
47010
47010
|
return tx;
|
|
47011
47011
|
}
|
|
@@ -47056,14 +47056,14 @@
|
|
|
47056
47056
|
raw.push("0x");
|
|
47057
47057
|
recoveryParam -= tx.chainId * 2 + 8;
|
|
47058
47058
|
}
|
|
47059
|
-
const digest = keccak256(encode$2(raw));
|
|
47059
|
+
const digest = keccak256$1(encode$2(raw));
|
|
47060
47060
|
try {
|
|
47061
47061
|
tx.from = recoverAddress(digest, { r: hexlify$2(tx.r), s: hexlify$2(tx.s), recoveryParam: recoveryParam });
|
|
47062
47062
|
}
|
|
47063
47063
|
catch (error) {
|
|
47064
47064
|
console.log(error);
|
|
47065
47065
|
}
|
|
47066
|
-
tx.hash = keccak256(rawTransaction);
|
|
47066
|
+
tx.hash = keccak256$1(rawTransaction);
|
|
47067
47067
|
}
|
|
47068
47068
|
tx.type = null;
|
|
47069
47069
|
return tx;
|
|
@@ -47087,7 +47087,7 @@
|
|
|
47087
47087
|
});
|
|
47088
47088
|
}
|
|
47089
47089
|
|
|
47090
|
-
const version$5 = "contracts/5.4.1";
|
|
47090
|
+
const version$5$1 = "contracts/5.4.1";
|
|
47091
47091
|
|
|
47092
47092
|
var __awaiter$4 = function (thisArg, _arguments, P, generator) {
|
|
47093
47093
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -47098,13 +47098,13 @@
|
|
|
47098
47098
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
47099
47099
|
});
|
|
47100
47100
|
};
|
|
47101
|
-
const logger$7 = new Logger$2(version$5);
|
|
47101
|
+
const logger$7 = new Logger$2(version$5$1);
|
|
47102
47102
|
function resolveName(resolver, nameOrPromise) {
|
|
47103
47103
|
return __awaiter$4(this, void 0, void 0, function* () {
|
|
47104
47104
|
const name = yield nameOrPromise;
|
|
47105
47105
|
// If it is already an address, just use it (after adding checksum)
|
|
47106
47106
|
try {
|
|
47107
|
-
return getAddress(name);
|
|
47107
|
+
return getAddress$1(name);
|
|
47108
47108
|
}
|
|
47109
47109
|
catch (error) { }
|
|
47110
47110
|
if (!resolver) {
|
|
@@ -47160,7 +47160,7 @@
|
|
|
47160
47160
|
override: resolveName(contract.signer, overrides.from),
|
|
47161
47161
|
signer: contract.signer.getAddress()
|
|
47162
47162
|
}).then((check) => __awaiter$4(this, void 0, void 0, function* () {
|
|
47163
|
-
if (getAddress(check.signer) !== check.override) {
|
|
47163
|
+
if (getAddress$1(check.signer) !== check.override) {
|
|
47164
47164
|
logger$7.throwError("Contract with a Signer cannot override from", Logger$2.errors.UNSUPPORTED_OPERATION, {
|
|
47165
47165
|
operation: "overrides.from"
|
|
47166
47166
|
});
|
|
@@ -47589,7 +47589,7 @@
|
|
|
47589
47589
|
}
|
|
47590
47590
|
else {
|
|
47591
47591
|
try {
|
|
47592
|
-
defineReadOnly(this, "resolvedAddress", Promise.resolve(getAddress(addressOrName)));
|
|
47592
|
+
defineReadOnly(this, "resolvedAddress", Promise.resolve(getAddress$1(addressOrName)));
|
|
47593
47593
|
}
|
|
47594
47594
|
catch (error) {
|
|
47595
47595
|
// Without a provider, we cannot use ENS names
|
|
@@ -48353,7 +48353,7 @@
|
|
|
48353
48353
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
48354
48354
|
});
|
|
48355
48355
|
};
|
|
48356
|
-
const logger$5 = new Logger$2(version$2$2);
|
|
48356
|
+
const logger$5$1 = new Logger$2(version$2$2);
|
|
48357
48357
|
function staller(duration) {
|
|
48358
48358
|
return new Promise((resolve) => {
|
|
48359
48359
|
setTimeout(resolve, duration);
|
|
@@ -48386,10 +48386,10 @@
|
|
|
48386
48386
|
function _fetchData(connection, body, processFunc) {
|
|
48387
48387
|
// How many times to retry in the event of a throttle
|
|
48388
48388
|
const attemptLimit = (typeof (connection) === "object" && connection.throttleLimit != null) ? connection.throttleLimit : 12;
|
|
48389
|
-
logger$5.assertArgument((attemptLimit > 0 && (attemptLimit % 1) === 0), "invalid connection throttle limit", "connection.throttleLimit", attemptLimit);
|
|
48389
|
+
logger$5$1.assertArgument((attemptLimit > 0 && (attemptLimit % 1) === 0), "invalid connection throttle limit", "connection.throttleLimit", attemptLimit);
|
|
48390
48390
|
const throttleCallback = ((typeof (connection) === "object") ? connection.throttleCallback : null);
|
|
48391
48391
|
const throttleSlotInterval = ((typeof (connection) === "object" && typeof (connection.throttleSlotInterval) === "number") ? connection.throttleSlotInterval : 100);
|
|
48392
|
-
logger$5.assertArgument((throttleSlotInterval > 0 && (throttleSlotInterval % 1) === 0), "invalid connection throttle slot interval", "connection.throttleSlotInterval", throttleSlotInterval);
|
|
48392
|
+
logger$5$1.assertArgument((throttleSlotInterval > 0 && (throttleSlotInterval % 1) === 0), "invalid connection throttle slot interval", "connection.throttleSlotInterval", throttleSlotInterval);
|
|
48393
48393
|
const headers = {};
|
|
48394
48394
|
let url = null;
|
|
48395
48395
|
// @TODO: Allow ConnectionInfo to override some of these values
|
|
@@ -48403,7 +48403,7 @@
|
|
|
48403
48403
|
}
|
|
48404
48404
|
else if (typeof (connection) === "object") {
|
|
48405
48405
|
if (connection == null || connection.url == null) {
|
|
48406
|
-
logger$5.throwArgumentError("missing URL", "connection.url", connection);
|
|
48406
|
+
logger$5$1.throwArgumentError("missing URL", "connection.url", connection);
|
|
48407
48407
|
}
|
|
48408
48408
|
url = connection.url;
|
|
48409
48409
|
if (typeof (connection.timeout) === "number" && connection.timeout > 0) {
|
|
@@ -48420,7 +48420,7 @@
|
|
|
48420
48420
|
options.allowGzip = !!connection.allowGzip;
|
|
48421
48421
|
if (connection.user != null && connection.password != null) {
|
|
48422
48422
|
if (url.substring(0, 6) !== "https:" && connection.allowInsecureAuthentication !== true) {
|
|
48423
|
-
logger$5.throwError("basic authentication requires a secure https url", Logger$2.errors.INVALID_ARGUMENT, { argument: "url", url: url, user: connection.user, password: "[REDACTED]" });
|
|
48423
|
+
logger$5$1.throwError("basic authentication requires a secure https url", Logger$2.errors.INVALID_ARGUMENT, { argument: "url", url: url, user: connection.user, password: "[REDACTED]" });
|
|
48424
48424
|
}
|
|
48425
48425
|
const authorization = connection.user + ":" + connection.password;
|
|
48426
48426
|
headers["authorization"] = {
|
|
@@ -48454,7 +48454,7 @@
|
|
|
48454
48454
|
return;
|
|
48455
48455
|
}
|
|
48456
48456
|
timer = null;
|
|
48457
|
-
reject(logger$5.makeError("timeout", Logger$2.errors.TIMEOUT, {
|
|
48457
|
+
reject(logger$5$1.makeError("timeout", Logger$2.errors.TIMEOUT, {
|
|
48458
48458
|
requestBody: bodyify(options.body, flatHeaders["content-type"]),
|
|
48459
48459
|
requestMethod: options.method,
|
|
48460
48460
|
timeout: timeout,
|
|
@@ -48503,7 +48503,7 @@
|
|
|
48503
48503
|
response = error.response;
|
|
48504
48504
|
if (response == null) {
|
|
48505
48505
|
runningTimeout.cancel();
|
|
48506
|
-
logger$5.throwError("missing response", Logger$2.errors.SERVER_ERROR, {
|
|
48506
|
+
logger$5$1.throwError("missing response", Logger$2.errors.SERVER_ERROR, {
|
|
48507
48507
|
requestBody: bodyify(options.body, flatHeaders["content-type"]),
|
|
48508
48508
|
requestMethod: options.method,
|
|
48509
48509
|
serverError: error,
|
|
@@ -48517,7 +48517,7 @@
|
|
|
48517
48517
|
}
|
|
48518
48518
|
else if (response.statusCode < 200 || response.statusCode >= 300) {
|
|
48519
48519
|
runningTimeout.cancel();
|
|
48520
|
-
logger$5.throwError("bad response", Logger$2.errors.SERVER_ERROR, {
|
|
48520
|
+
logger$5$1.throwError("bad response", Logger$2.errors.SERVER_ERROR, {
|
|
48521
48521
|
status: response.statusCode,
|
|
48522
48522
|
headers: response.headers,
|
|
48523
48523
|
body: bodyify(body, ((response.headers) ? response.headers["content-type"] : null)),
|
|
@@ -48547,7 +48547,7 @@
|
|
|
48547
48547
|
}
|
|
48548
48548
|
}
|
|
48549
48549
|
runningTimeout.cancel();
|
|
48550
|
-
logger$5.throwError("processing response error", Logger$2.errors.SERVER_ERROR, {
|
|
48550
|
+
logger$5$1.throwError("processing response error", Logger$2.errors.SERVER_ERROR, {
|
|
48551
48551
|
body: bodyify(body, ((response.headers) ? response.headers["content-type"] : null)),
|
|
48552
48552
|
error: error,
|
|
48553
48553
|
requestBody: bodyify(options.body, flatHeaders["content-type"]),
|
|
@@ -48561,7 +48561,7 @@
|
|
|
48561
48561
|
// The "body" is now a Uint8Array.
|
|
48562
48562
|
return body;
|
|
48563
48563
|
}
|
|
48564
|
-
return logger$5.throwError("failed response", Logger$2.errors.SERVER_ERROR, {
|
|
48564
|
+
return logger$5$1.throwError("failed response", Logger$2.errors.SERVER_ERROR, {
|
|
48565
48565
|
requestBody: bodyify(options.body, flatHeaders["content-type"]),
|
|
48566
48566
|
requestMethod: options.method,
|
|
48567
48567
|
url: url
|
|
@@ -48578,7 +48578,7 @@
|
|
|
48578
48578
|
result = JSON.parse(toUtf8String(value));
|
|
48579
48579
|
}
|
|
48580
48580
|
catch (error) {
|
|
48581
|
-
logger$5.throwError("invalid JSON", Logger$2.errors.SERVER_ERROR, {
|
|
48581
|
+
logger$5$1.throwError("invalid JSON", Logger$2.errors.SERVER_ERROR, {
|
|
48582
48582
|
body: value,
|
|
48583
48583
|
error: error
|
|
48584
48584
|
});
|
|
@@ -49053,13 +49053,13 @@
|
|
|
49053
49053
|
// Requires an address
|
|
49054
49054
|
// Strict! Used on input.
|
|
49055
49055
|
address(value) {
|
|
49056
|
-
return getAddress(value);
|
|
49056
|
+
return getAddress$1(value);
|
|
49057
49057
|
}
|
|
49058
49058
|
callAddress(value) {
|
|
49059
49059
|
if (!isHexString$2(value, 32)) {
|
|
49060
49060
|
return null;
|
|
49061
49061
|
}
|
|
49062
|
-
const address = getAddress(hexDataSlice(value, 12));
|
|
49062
|
+
const address = getAddress$1(hexDataSlice(value, 12));
|
|
49063
49063
|
return (address === AddressZero) ? null : address;
|
|
49064
49064
|
}
|
|
49065
49065
|
contractAddress(value) {
|
|
@@ -52522,7 +52522,7 @@
|
|
|
52522
52522
|
});
|
|
52523
52523
|
|
|
52524
52524
|
var DialogStyle = (function (style) {
|
|
52525
|
-
return "\n\n .ReactDialogBackground {\n background: rgba(0,0,0,0.7);\n }\n\n .Dialog {\n margin: 0 auto;\n position: relative;\n width: 420px;\n box-shadow: 0 0 20px rgba(0,0,0,0.1);\n border-radius: 0.8rem;\n }\n\n @media screen and (max-width: 450px) {\n \n .Dialog, .ReactDialogAnimation {\n width: 100%;\n }\n\n }\n\n @media (orientation: portrait) and (max-width: 900px) {\n\n .Dialog {\n align-content: stretch;\n display: flex;\n flex-direction: column;\n height: 100%;\n }\n\n .DialogBody {\n flex: 1;\n align-items: flex-end;\n max-height: 40vh !important;\n }\n\n .FooterLink {\n bottom: 0;\n left: 0;\n position: absolute;\n padding-bottom: 1rem;\n right: 0;\n width: 100%;\n }\n\n .DialogFooter {\n padding-bottom: 50px;\n }\n\n .ReactDialogStackCell {\n vertical-align: bottom;\n }\n\n .ReactDialogAnimation {\n bottom: -100px !important;\n max-height: 66vh !important;\n top: inherit !important;\n transition: opacity 0.4s ease, bottom 0.4s ease;\n }\n\n .ReactDialog.ReactDialogOpen .ReactDialogAnimation {\n bottom: 0px !important;\n }\n\n .DialogFooter {\n border-bottom-left-radius: 0 !important;\n border-bottom-right-radius: 0 !important;\n }\n }\n\n .DialogBody {\n background: rgb(248,248,248);\n overflow-x: hidden;\n overflow-y: auto;\n }\n\n .DialogBody.HeightAuto {\n height: auto;\n }\n\n .DialogHeader {\n background: rgb(248,248,248);\n border-top-left-radius: 0.8rem;\n border-top-right-radius: 0.8rem;\n display: flex;\n flex-direction: row;\n position: relative;\n }\n\n .DialogHeaderTitle {\n flex-basis: auto;\n flex-grow: 1;\n }\n \n .DialogHeaderAction {\n height: 3rem;\n }\n\n .DialogFooter {\n background: rgb(248,248,248);\n border-bottom-left-radius: 0.8rem;\n border-bottom-right-radius: 0.8rem;\n line-height: 1.5rem;\n min-height: 2rem;\n position: relative;\n text-align: center;\n }\n\n .ReactShadowDOMInsideContainer > .ReactDialog {\n display: table;\n }\n\n ";
|
|
52525
|
+
return "\n\n .ReactDialogBackground {\n backdrop-filter: blur(5px);\n background: rgba(0,0,0,0.7);\n }\n\n .Dialog {\n margin: 0 auto;\n position: relative;\n width: 420px;\n box-shadow: 0 0 20px rgba(0,0,0,0.1);\n border-radius: 0.8rem;\n }\n\n @media screen and (max-width: 450px) {\n \n .Dialog, .ReactDialogAnimation {\n width: 100%;\n }\n\n }\n\n @media (orientation: portrait) and (max-width: 900px) {\n\n .Dialog {\n align-content: stretch;\n display: flex;\n flex-direction: column;\n height: 100%;\n }\n\n .DialogBody {\n flex: 1;\n align-items: flex-end;\n max-height: 40vh !important;\n }\n\n .FooterLink {\n bottom: 0;\n left: 0;\n position: absolute;\n padding-bottom: 1rem;\n right: 0;\n width: 100%;\n }\n\n .DialogFooter {\n padding-bottom: 50px;\n }\n\n .ReactDialogStackCell {\n vertical-align: bottom;\n }\n\n .ReactDialogAnimation {\n bottom: -100px !important;\n max-height: 66vh !important;\n top: inherit !important;\n transition: opacity 0.4s ease, bottom 0.4s ease;\n }\n\n .ReactDialog.ReactDialogOpen .ReactDialogAnimation {\n bottom: 0px !important;\n }\n\n .DialogFooter {\n border-bottom-left-radius: 0 !important;\n border-bottom-right-radius: 0 !important;\n }\n }\n\n .DialogBody {\n background: rgb(248,248,248);\n overflow-x: hidden;\n overflow-y: auto;\n }\n\n .DialogBody.HeightAuto {\n height: auto;\n }\n\n .DialogHeader {\n background: rgb(248,248,248);\n border-top-left-radius: 0.8rem;\n border-top-right-radius: 0.8rem;\n display: flex;\n flex-direction: row;\n position: relative;\n }\n\n .DialogHeaderTitle {\n flex-basis: auto;\n flex-grow: 1;\n }\n \n .DialogHeaderAction {\n height: 3rem;\n }\n\n .DialogFooter {\n background: rgb(248,248,248);\n border-bottom-left-radius: 0.8rem;\n border-bottom-right-radius: 0.8rem;\n line-height: 1.5rem;\n min-height: 2rem;\n position: relative;\n text-align: center;\n }\n\n .ReactShadowDOMInsideContainer > .ReactDialog {\n display: table;\n }\n\n ";
|
|
52526
52526
|
});
|
|
52527
52527
|
|
|
52528
52528
|
var FontStyle = (function (style) {
|
|
@@ -53006,7 +53006,7 @@
|
|
|
53006
53006
|
|
|
53007
53007
|
BASE = 1e7,
|
|
53008
53008
|
LOG_BASE = 7,
|
|
53009
|
-
MAX_SAFE_INTEGER = 9007199254740991,
|
|
53009
|
+
MAX_SAFE_INTEGER$1 = 9007199254740991,
|
|
53010
53010
|
|
|
53011
53011
|
LN10_PRECISION = LN10.length - 1,
|
|
53012
53012
|
PI_PRECISION = PI.length - 1,
|
|
@@ -55176,7 +55176,7 @@
|
|
|
55176
55176
|
e = mathfloor(y.e / LOG_BASE);
|
|
55177
55177
|
|
|
55178
55178
|
// If y is a small integer use the 'exponentiation by squaring' algorithm.
|
|
55179
|
-
if (e >= y.d.length - 1 && (k = yn < 0 ? -yn : yn) <= MAX_SAFE_INTEGER) {
|
|
55179
|
+
if (e >= y.d.length - 1 && (k = yn < 0 ? -yn : yn) <= MAX_SAFE_INTEGER$1) {
|
|
55180
55180
|
r = intPow(Ctor, x, k, pr);
|
|
55181
55181
|
return y.s < 0 ? new Ctor(1).div(r) : finalise(r, pr, rm);
|
|
55182
55182
|
}
|
|
@@ -57310,7 +57310,7 @@
|
|
|
57310
57310
|
Decimal.hypot = hypot; // ES6
|
|
57311
57311
|
Decimal.ln = ln;
|
|
57312
57312
|
Decimal.log = log;
|
|
57313
|
-
Decimal.log10 = log10; // ES6
|
|
57313
|
+
Decimal.log10 = log10$1; // ES6
|
|
57314
57314
|
Decimal.log2 = log2; // ES6
|
|
57315
57315
|
Decimal.max = max;
|
|
57316
57316
|
Decimal.min = min;
|
|
@@ -57469,7 +57469,7 @@
|
|
|
57469
57469
|
* x {number|string|Decimal}
|
|
57470
57470
|
*
|
|
57471
57471
|
*/
|
|
57472
|
-
function log10(x) {
|
|
57472
|
+
function log10$1(x) {
|
|
57473
57473
|
return new this(x).log(10);
|
|
57474
57474
|
}
|
|
57475
57475
|
|
|
@@ -58303,7 +58303,7 @@
|
|
|
58303
58303
|
|
|
58304
58304
|
constructor({ blockchain, address }) {
|
|
58305
58305
|
this.blockchain = blockchain;
|
|
58306
|
-
this.address = getAddress$
|
|
58306
|
+
this.address = getAddress$3(address);
|
|
58307
58307
|
}
|
|
58308
58308
|
|
|
58309
58309
|
async decimals() {
|
|
@@ -62101,7 +62101,7 @@
|
|
|
62101
62101
|
})(module, commonjsGlobal$1);
|
|
62102
62102
|
});
|
|
62103
62103
|
|
|
62104
|
-
const version$
|
|
62104
|
+
const version$4 = "logger/5.4.1";
|
|
62105
62105
|
|
|
62106
62106
|
let _permanentCensorErrors$1 = false;
|
|
62107
62107
|
let _censorErrors$1 = false;
|
|
@@ -62377,7 +62377,7 @@
|
|
|
62377
62377
|
}
|
|
62378
62378
|
static globalLogger() {
|
|
62379
62379
|
if (!_globalLogger$1) {
|
|
62380
|
-
_globalLogger$1 = new Logger$1(version$
|
|
62380
|
+
_globalLogger$1 = new Logger$1(version$4);
|
|
62381
62381
|
}
|
|
62382
62382
|
return _globalLogger$1;
|
|
62383
62383
|
}
|
|
@@ -62413,9 +62413,9 @@
|
|
|
62413
62413
|
Logger$1.errors = ErrorCode$1;
|
|
62414
62414
|
Logger$1.levels = LogLevel$1;
|
|
62415
62415
|
|
|
62416
|
-
const version$
|
|
62416
|
+
const version$3 = "bytes/5.4.0";
|
|
62417
62417
|
|
|
62418
|
-
const logger$
|
|
62418
|
+
const logger$4 = new Logger$1(version$3);
|
|
62419
62419
|
///////////////////////////////
|
|
62420
62420
|
function isHexable$1(value) {
|
|
62421
62421
|
return !!(value.toHexString);
|
|
@@ -62456,7 +62456,7 @@
|
|
|
62456
62456
|
options = {};
|
|
62457
62457
|
}
|
|
62458
62458
|
if (typeof (value) === "number") {
|
|
62459
|
-
logger$
|
|
62459
|
+
logger$4.checkSafeUint53(value, "invalid arrayify value");
|
|
62460
62460
|
const result = [];
|
|
62461
62461
|
while (value) {
|
|
62462
62462
|
result.unshift(value & 0xff);
|
|
@@ -62483,7 +62483,7 @@
|
|
|
62483
62483
|
hex += "0";
|
|
62484
62484
|
}
|
|
62485
62485
|
else {
|
|
62486
|
-
logger$
|
|
62486
|
+
logger$4.throwArgumentError("hex data is odd-length", "value", value);
|
|
62487
62487
|
}
|
|
62488
62488
|
}
|
|
62489
62489
|
const result = [];
|
|
@@ -62495,7 +62495,7 @@
|
|
|
62495
62495
|
if (isBytes$1(value)) {
|
|
62496
62496
|
return addSlice(new Uint8Array(value));
|
|
62497
62497
|
}
|
|
62498
|
-
return logger$
|
|
62498
|
+
return logger$4.throwArgumentError("invalid arrayify value", "value", value);
|
|
62499
62499
|
}
|
|
62500
62500
|
function isHexString$1(value, length) {
|
|
62501
62501
|
if (typeof (value) !== "string" || !value.match(/^0x[0-9A-Fa-f]*$/)) {
|
|
@@ -62512,7 +62512,7 @@
|
|
|
62512
62512
|
options = {};
|
|
62513
62513
|
}
|
|
62514
62514
|
if (typeof (value) === "number") {
|
|
62515
|
-
logger$
|
|
62515
|
+
logger$4.checkSafeUint53(value, "invalid hexlify value");
|
|
62516
62516
|
let hex = "";
|
|
62517
62517
|
while (value) {
|
|
62518
62518
|
hex = HexCharacters$1[value & 0xf] + hex;
|
|
@@ -62548,7 +62548,7 @@
|
|
|
62548
62548
|
value += "0";
|
|
62549
62549
|
}
|
|
62550
62550
|
else {
|
|
62551
|
-
logger$
|
|
62551
|
+
logger$4.throwArgumentError("hex data is odd-length", "value", value);
|
|
62552
62552
|
}
|
|
62553
62553
|
}
|
|
62554
62554
|
return value.toLowerCase();
|
|
@@ -62561,17 +62561,17 @@
|
|
|
62561
62561
|
}
|
|
62562
62562
|
return result;
|
|
62563
62563
|
}
|
|
62564
|
-
return logger$
|
|
62564
|
+
return logger$4.throwArgumentError("invalid hexlify value", "value", value);
|
|
62565
62565
|
}
|
|
62566
62566
|
function hexZeroPad(value, length) {
|
|
62567
62567
|
if (typeof (value) !== "string") {
|
|
62568
62568
|
value = hexlify$1(value);
|
|
62569
62569
|
}
|
|
62570
62570
|
else if (!isHexString$1(value)) {
|
|
62571
|
-
logger$
|
|
62571
|
+
logger$4.throwArgumentError("invalid hex string", "value", value);
|
|
62572
62572
|
}
|
|
62573
62573
|
if (value.length > 2 * length + 2) {
|
|
62574
|
-
logger$
|
|
62574
|
+
logger$4.throwArgumentError("value out of range", "value", arguments[1]);
|
|
62575
62575
|
}
|
|
62576
62576
|
while (value.length < 2 * length + 2) {
|
|
62577
62577
|
value = "0x0" + value.substring(2);
|
|
@@ -62579,10 +62579,10 @@
|
|
|
62579
62579
|
return value;
|
|
62580
62580
|
}
|
|
62581
62581
|
|
|
62582
|
-
const version$
|
|
62582
|
+
const version$2$1 = "bignumber/5.4.1";
|
|
62583
62583
|
|
|
62584
62584
|
var BN$1 = bn$1.BN;
|
|
62585
|
-
const logger$
|
|
62585
|
+
const logger$3 = new Logger$1(version$2$1);
|
|
62586
62586
|
const _constructorGuard$1 = {};
|
|
62587
62587
|
const MAX_SAFE$1 = 0x1fffffffffffff;
|
|
62588
62588
|
function isBigNumberish(value) {
|
|
@@ -62597,9 +62597,9 @@
|
|
|
62597
62597
|
let _warnedToStringRadix$1 = false;
|
|
62598
62598
|
class BigNumber$1 {
|
|
62599
62599
|
constructor(constructorGuard, hex) {
|
|
62600
|
-
logger$
|
|
62600
|
+
logger$3.checkNew(new.target, BigNumber$1);
|
|
62601
62601
|
if (constructorGuard !== _constructorGuard$1) {
|
|
62602
|
-
logger$
|
|
62602
|
+
logger$3.throwError("cannot call constructor directly; use BigNumber.from", Logger$1.errors.UNSUPPORTED_OPERATION, {
|
|
62603
62603
|
operation: "new (BigNumber)"
|
|
62604
62604
|
});
|
|
62605
62605
|
}
|
|
@@ -62723,7 +62723,7 @@
|
|
|
62723
62723
|
return BigInt(this.toString());
|
|
62724
62724
|
}
|
|
62725
62725
|
catch (e) { }
|
|
62726
|
-
return logger$
|
|
62726
|
+
return logger$3.throwError("this platform does not support BigInt", Logger$1.errors.UNSUPPORTED_OPERATION, {
|
|
62727
62727
|
value: this.toString()
|
|
62728
62728
|
});
|
|
62729
62729
|
}
|
|
@@ -62733,14 +62733,14 @@
|
|
|
62733
62733
|
if (arguments[0] === 10) {
|
|
62734
62734
|
if (!_warnedToStringRadix$1) {
|
|
62735
62735
|
_warnedToStringRadix$1 = true;
|
|
62736
|
-
logger$
|
|
62736
|
+
logger$3.warn("BigNumber.toString does not accept any parameters; base-10 is assumed");
|
|
62737
62737
|
}
|
|
62738
62738
|
}
|
|
62739
62739
|
else if (arguments[0] === 16) {
|
|
62740
|
-
logger$
|
|
62740
|
+
logger$3.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()", Logger$1.errors.UNEXPECTED_ARGUMENT, {});
|
|
62741
62741
|
}
|
|
62742
62742
|
else {
|
|
62743
|
-
logger$
|
|
62743
|
+
logger$3.throwError("BigNumber.toString does not accept parameters", Logger$1.errors.UNEXPECTED_ARGUMENT, {});
|
|
62744
62744
|
}
|
|
62745
62745
|
}
|
|
62746
62746
|
return toBN$1(this).toString(10);
|
|
@@ -62762,7 +62762,7 @@
|
|
|
62762
62762
|
if (value.match(/^-?[0-9]+$/)) {
|
|
62763
62763
|
return new BigNumber$1(_constructorGuard$1, toHex$1(new BN$1(value)));
|
|
62764
62764
|
}
|
|
62765
|
-
return logger$
|
|
62765
|
+
return logger$3.throwArgumentError("invalid BigNumber string", "value", value);
|
|
62766
62766
|
}
|
|
62767
62767
|
if (typeof (value) === "number") {
|
|
62768
62768
|
if (value % 1) {
|
|
@@ -62802,7 +62802,7 @@
|
|
|
62802
62802
|
}
|
|
62803
62803
|
}
|
|
62804
62804
|
}
|
|
62805
|
-
return logger$
|
|
62805
|
+
return logger$3.throwArgumentError("invalid BigNumber value", "value", value);
|
|
62806
62806
|
}
|
|
62807
62807
|
static isBigNumber(value) {
|
|
62808
62808
|
return !!(value && value._isBigNumber);
|
|
@@ -62820,7 +62820,7 @@
|
|
|
62820
62820
|
value = value.substring(1);
|
|
62821
62821
|
// Cannot have mulitple negative signs (e.g. "--0x04")
|
|
62822
62822
|
if (value[0] === "-") {
|
|
62823
|
-
logger$
|
|
62823
|
+
logger$3.throwArgumentError("invalid hex", "value", value);
|
|
62824
62824
|
}
|
|
62825
62825
|
// Call toHex on the positive component
|
|
62826
62826
|
value = toHex$1(value);
|
|
@@ -62864,10 +62864,14 @@
|
|
|
62864
62864
|
if (value != null) {
|
|
62865
62865
|
params.value = value;
|
|
62866
62866
|
}
|
|
62867
|
-
return logger$
|
|
62867
|
+
return logger$3.throwError(fault, Logger$1.errors.NUMERIC_FAULT, params);
|
|
62868
|
+
}
|
|
62869
|
+
// value should have no prefix
|
|
62870
|
+
function _base36To16(value) {
|
|
62871
|
+
return (new BN$1(value, 36)).toString(16);
|
|
62868
62872
|
}
|
|
62869
62873
|
|
|
62870
|
-
const logger$
|
|
62874
|
+
const logger$2 = new Logger$1(version$2$1);
|
|
62871
62875
|
const _constructorGuard$2 = {};
|
|
62872
62876
|
const Zero = BigNumber$1.from(0);
|
|
62873
62877
|
const NegativeOne = BigNumber$1.from(-1);
|
|
@@ -62876,7 +62880,7 @@
|
|
|
62876
62880
|
if (value !== undefined) {
|
|
62877
62881
|
params.value = value;
|
|
62878
62882
|
}
|
|
62879
|
-
return logger$
|
|
62883
|
+
return logger$2.throwError(message, Logger$1.errors.NUMERIC_FAULT, params);
|
|
62880
62884
|
}
|
|
62881
62885
|
// Constant to pull zeros from for multipliers
|
|
62882
62886
|
let zeros = "0";
|
|
@@ -62894,7 +62898,7 @@
|
|
|
62894
62898
|
if (typeof (decimals) === "number" && decimals >= 0 && decimals <= 256 && !(decimals % 1)) {
|
|
62895
62899
|
return ("1" + zeros.substring(0, decimals));
|
|
62896
62900
|
}
|
|
62897
|
-
return logger$
|
|
62901
|
+
return logger$2.throwArgumentError("invalid decimal size", "decimals", decimals);
|
|
62898
62902
|
}
|
|
62899
62903
|
function formatFixed(value, decimals) {
|
|
62900
62904
|
if (decimals == null) {
|
|
@@ -62931,7 +62935,7 @@
|
|
|
62931
62935
|
}
|
|
62932
62936
|
const multiplier = getMultiplier(decimals);
|
|
62933
62937
|
if (typeof (value) !== "string" || !value.match(/^-?[0-9.,]+$/)) {
|
|
62934
|
-
logger$
|
|
62938
|
+
logger$2.throwArgumentError("invalid decimal value", "value", value);
|
|
62935
62939
|
}
|
|
62936
62940
|
// Is it negative?
|
|
62937
62941
|
const negative = (value.substring(0, 1) === "-");
|
|
@@ -62939,12 +62943,12 @@
|
|
|
62939
62943
|
value = value.substring(1);
|
|
62940
62944
|
}
|
|
62941
62945
|
if (value === ".") {
|
|
62942
|
-
logger$
|
|
62946
|
+
logger$2.throwArgumentError("missing value", "value", value);
|
|
62943
62947
|
}
|
|
62944
62948
|
// Split it into a whole and fractional part
|
|
62945
62949
|
const comps = value.split(".");
|
|
62946
62950
|
if (comps.length > 2) {
|
|
62947
|
-
logger$
|
|
62951
|
+
logger$2.throwArgumentError("too many decimal points", "value", value);
|
|
62948
62952
|
}
|
|
62949
62953
|
let whole = comps[0], fraction = comps[1];
|
|
62950
62954
|
if (!whole) {
|
|
@@ -62975,7 +62979,7 @@
|
|
|
62975
62979
|
class FixedFormat {
|
|
62976
62980
|
constructor(constructorGuard, signed, width, decimals) {
|
|
62977
62981
|
if (constructorGuard !== _constructorGuard$2) {
|
|
62978
|
-
logger$
|
|
62982
|
+
logger$2.throwError("cannot use FixedFormat constructor; use FixedFormat.from", Logger$1.errors.UNSUPPORTED_OPERATION, {
|
|
62979
62983
|
operation: "new FixedFormat"
|
|
62980
62984
|
});
|
|
62981
62985
|
}
|
|
@@ -63004,7 +63008,7 @@
|
|
|
63004
63008
|
else {
|
|
63005
63009
|
const match = value.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);
|
|
63006
63010
|
if (!match) {
|
|
63007
|
-
logger$
|
|
63011
|
+
logger$2.throwArgumentError("invalid fixed format", "format", value);
|
|
63008
63012
|
}
|
|
63009
63013
|
signed = (match[1] !== "u");
|
|
63010
63014
|
width = parseInt(match[2]);
|
|
@@ -63017,7 +63021,7 @@
|
|
|
63017
63021
|
return defaultValue;
|
|
63018
63022
|
}
|
|
63019
63023
|
if (typeof (value[key]) !== type) {
|
|
63020
|
-
logger$
|
|
63024
|
+
logger$2.throwArgumentError("invalid fixed format (" + key + " not " + type + ")", "format." + key, value[key]);
|
|
63021
63025
|
}
|
|
63022
63026
|
return value[key];
|
|
63023
63027
|
};
|
|
@@ -63026,19 +63030,19 @@
|
|
|
63026
63030
|
decimals = check("decimals", "number", decimals);
|
|
63027
63031
|
}
|
|
63028
63032
|
if (width % 8) {
|
|
63029
|
-
logger$
|
|
63033
|
+
logger$2.throwArgumentError("invalid fixed format width (not byte aligned)", "format.width", width);
|
|
63030
63034
|
}
|
|
63031
63035
|
if (decimals > 80) {
|
|
63032
|
-
logger$
|
|
63036
|
+
logger$2.throwArgumentError("invalid fixed format (decimals too large)", "format.decimals", decimals);
|
|
63033
63037
|
}
|
|
63034
63038
|
return new FixedFormat(_constructorGuard$2, signed, width, decimals);
|
|
63035
63039
|
}
|
|
63036
63040
|
}
|
|
63037
63041
|
class FixedNumber {
|
|
63038
63042
|
constructor(constructorGuard, hex, value, format) {
|
|
63039
|
-
logger$
|
|
63043
|
+
logger$2.checkNew(new.target, FixedNumber);
|
|
63040
63044
|
if (constructorGuard !== _constructorGuard$2) {
|
|
63041
|
-
logger$
|
|
63045
|
+
logger$2.throwError("cannot use FixedNumber constructor; use FixedNumber.from", Logger$1.errors.UNSUPPORTED_OPERATION, {
|
|
63042
63046
|
operation: "new FixedFormat"
|
|
63043
63047
|
});
|
|
63044
63048
|
}
|
|
@@ -63050,7 +63054,7 @@
|
|
|
63050
63054
|
}
|
|
63051
63055
|
_checkFormat(other) {
|
|
63052
63056
|
if (this.format.name !== other.format.name) {
|
|
63053
|
-
logger$
|
|
63057
|
+
logger$2.throwArgumentError("incompatible format; use fixedNumber.toFormat", "other", other);
|
|
63054
63058
|
}
|
|
63055
63059
|
}
|
|
63056
63060
|
addUnsafe(other) {
|
|
@@ -63112,7 +63116,7 @@
|
|
|
63112
63116
|
comps.push("0");
|
|
63113
63117
|
}
|
|
63114
63118
|
if (decimals < 0 || decimals > 80 || (decimals % 1)) {
|
|
63115
|
-
logger$
|
|
63119
|
+
logger$2.throwArgumentError("invalid decimal count", "decimals", decimals);
|
|
63116
63120
|
}
|
|
63117
63121
|
if (comps[1].length <= decimals) {
|
|
63118
63122
|
return this;
|
|
@@ -63133,7 +63137,7 @@
|
|
|
63133
63137
|
return this._hex;
|
|
63134
63138
|
}
|
|
63135
63139
|
if (width % 8) {
|
|
63136
|
-
logger$
|
|
63140
|
+
logger$2.throwArgumentError("invalid byte width", "width", width);
|
|
63137
63141
|
}
|
|
63138
63142
|
const hex = BigNumber$1.from(this._hex).fromTwos(this.format.width).toTwos(width).toHexString();
|
|
63139
63143
|
return hexZeroPad(hex, width / 8);
|
|
@@ -63208,7 +63212,7 @@
|
|
|
63208
63212
|
throw error;
|
|
63209
63213
|
}
|
|
63210
63214
|
}
|
|
63211
|
-
return logger$
|
|
63215
|
+
return logger$2.throwArgumentError("invalid FixedNumber value", "value", value);
|
|
63212
63216
|
}
|
|
63213
63217
|
static isFixedNumber(value) {
|
|
63214
63218
|
return !!(value && value._isFixedNumber);
|
|
@@ -63217,9 +63221,585 @@
|
|
|
63217
63221
|
const ONE = FixedNumber.from(1);
|
|
63218
63222
|
const BUMP = FixedNumber.from("0.5");
|
|
63219
63223
|
|
|
63220
|
-
|
|
63224
|
+
/**
|
|
63225
|
+
* [js-sha3]{@link https://github.com/emn178/js-sha3}
|
|
63226
|
+
*
|
|
63227
|
+
* @version 0.5.7
|
|
63228
|
+
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
|
63229
|
+
* @copyright Chen, Yi-Cyuan 2015-2016
|
|
63230
|
+
* @license MIT
|
|
63231
|
+
*/
|
|
63232
|
+
|
|
63233
|
+
var sha3 = createCommonjsModule$1(function (module) {
|
|
63234
|
+
/*jslint bitwise: true */
|
|
63235
|
+
(function () {
|
|
63236
|
+
|
|
63237
|
+
var root = typeof window === 'object' ? window : {};
|
|
63238
|
+
var NODE_JS = !root.JS_SHA3_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node;
|
|
63239
|
+
if (NODE_JS) {
|
|
63240
|
+
root = commonjsGlobal$1;
|
|
63241
|
+
}
|
|
63242
|
+
var COMMON_JS = !root.JS_SHA3_NO_COMMON_JS && 'object' === 'object' && module.exports;
|
|
63243
|
+
var HEX_CHARS = '0123456789abcdef'.split('');
|
|
63244
|
+
var SHAKE_PADDING = [31, 7936, 2031616, 520093696];
|
|
63245
|
+
var KECCAK_PADDING = [1, 256, 65536, 16777216];
|
|
63246
|
+
var PADDING = [6, 1536, 393216, 100663296];
|
|
63247
|
+
var SHIFT = [0, 8, 16, 24];
|
|
63248
|
+
var RC = [1, 0, 32898, 0, 32906, 2147483648, 2147516416, 2147483648, 32907, 0, 2147483649,
|
|
63249
|
+
0, 2147516545, 2147483648, 32777, 2147483648, 138, 0, 136, 0, 2147516425, 0,
|
|
63250
|
+
2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, 2147483648, 32771,
|
|
63251
|
+
2147483648, 32770, 2147483648, 128, 2147483648, 32778, 0, 2147483658, 2147483648,
|
|
63252
|
+
2147516545, 2147483648, 32896, 2147483648, 2147483649, 0, 2147516424, 2147483648];
|
|
63253
|
+
var BITS = [224, 256, 384, 512];
|
|
63254
|
+
var SHAKE_BITS = [128, 256];
|
|
63255
|
+
var OUTPUT_TYPES = ['hex', 'buffer', 'arrayBuffer', 'array'];
|
|
63256
|
+
|
|
63257
|
+
var createOutputMethod = function (bits, padding, outputType) {
|
|
63258
|
+
return function (message) {
|
|
63259
|
+
return new Keccak(bits, padding, bits).update(message)[outputType]();
|
|
63260
|
+
};
|
|
63261
|
+
};
|
|
63262
|
+
|
|
63263
|
+
var createShakeOutputMethod = function (bits, padding, outputType) {
|
|
63264
|
+
return function (message, outputBits) {
|
|
63265
|
+
return new Keccak(bits, padding, outputBits).update(message)[outputType]();
|
|
63266
|
+
};
|
|
63267
|
+
};
|
|
63268
|
+
|
|
63269
|
+
var createMethod = function (bits, padding) {
|
|
63270
|
+
var method = createOutputMethod(bits, padding, 'hex');
|
|
63271
|
+
method.create = function () {
|
|
63272
|
+
return new Keccak(bits, padding, bits);
|
|
63273
|
+
};
|
|
63274
|
+
method.update = function (message) {
|
|
63275
|
+
return method.create().update(message);
|
|
63276
|
+
};
|
|
63277
|
+
for (var i = 0; i < OUTPUT_TYPES.length; ++i) {
|
|
63278
|
+
var type = OUTPUT_TYPES[i];
|
|
63279
|
+
method[type] = createOutputMethod(bits, padding, type);
|
|
63280
|
+
}
|
|
63281
|
+
return method;
|
|
63282
|
+
};
|
|
63283
|
+
|
|
63284
|
+
var createShakeMethod = function (bits, padding) {
|
|
63285
|
+
var method = createShakeOutputMethod(bits, padding, 'hex');
|
|
63286
|
+
method.create = function (outputBits) {
|
|
63287
|
+
return new Keccak(bits, padding, outputBits);
|
|
63288
|
+
};
|
|
63289
|
+
method.update = function (message, outputBits) {
|
|
63290
|
+
return method.create(outputBits).update(message);
|
|
63291
|
+
};
|
|
63292
|
+
for (var i = 0; i < OUTPUT_TYPES.length; ++i) {
|
|
63293
|
+
var type = OUTPUT_TYPES[i];
|
|
63294
|
+
method[type] = createShakeOutputMethod(bits, padding, type);
|
|
63295
|
+
}
|
|
63296
|
+
return method;
|
|
63297
|
+
};
|
|
63298
|
+
|
|
63299
|
+
var algorithms = [
|
|
63300
|
+
{name: 'keccak', padding: KECCAK_PADDING, bits: BITS, createMethod: createMethod},
|
|
63301
|
+
{name: 'sha3', padding: PADDING, bits: BITS, createMethod: createMethod},
|
|
63302
|
+
{name: 'shake', padding: SHAKE_PADDING, bits: SHAKE_BITS, createMethod: createShakeMethod}
|
|
63303
|
+
];
|
|
63304
|
+
|
|
63305
|
+
var methods = {}, methodNames = [];
|
|
63306
|
+
|
|
63307
|
+
for (var i = 0; i < algorithms.length; ++i) {
|
|
63308
|
+
var algorithm = algorithms[i];
|
|
63309
|
+
var bits = algorithm.bits;
|
|
63310
|
+
for (var j = 0; j < bits.length; ++j) {
|
|
63311
|
+
var methodName = algorithm.name +'_' + bits[j];
|
|
63312
|
+
methodNames.push(methodName);
|
|
63313
|
+
methods[methodName] = algorithm.createMethod(bits[j], algorithm.padding);
|
|
63314
|
+
}
|
|
63315
|
+
}
|
|
63316
|
+
|
|
63317
|
+
function Keccak(bits, padding, outputBits) {
|
|
63318
|
+
this.blocks = [];
|
|
63319
|
+
this.s = [];
|
|
63320
|
+
this.padding = padding;
|
|
63321
|
+
this.outputBits = outputBits;
|
|
63322
|
+
this.reset = true;
|
|
63323
|
+
this.block = 0;
|
|
63324
|
+
this.start = 0;
|
|
63325
|
+
this.blockCount = (1600 - (bits << 1)) >> 5;
|
|
63326
|
+
this.byteCount = this.blockCount << 2;
|
|
63327
|
+
this.outputBlocks = outputBits >> 5;
|
|
63328
|
+
this.extraBytes = (outputBits & 31) >> 3;
|
|
63329
|
+
|
|
63330
|
+
for (var i = 0; i < 50; ++i) {
|
|
63331
|
+
this.s[i] = 0;
|
|
63332
|
+
}
|
|
63333
|
+
}
|
|
63334
|
+
|
|
63335
|
+
Keccak.prototype.update = function (message) {
|
|
63336
|
+
var notString = typeof message !== 'string';
|
|
63337
|
+
if (notString && message.constructor === ArrayBuffer) {
|
|
63338
|
+
message = new Uint8Array(message);
|
|
63339
|
+
}
|
|
63340
|
+
var length = message.length, blocks = this.blocks, byteCount = this.byteCount,
|
|
63341
|
+
blockCount = this.blockCount, index = 0, s = this.s, i, code;
|
|
63342
|
+
|
|
63343
|
+
while (index < length) {
|
|
63344
|
+
if (this.reset) {
|
|
63345
|
+
this.reset = false;
|
|
63346
|
+
blocks[0] = this.block;
|
|
63347
|
+
for (i = 1; i < blockCount + 1; ++i) {
|
|
63348
|
+
blocks[i] = 0;
|
|
63349
|
+
}
|
|
63350
|
+
}
|
|
63351
|
+
if (notString) {
|
|
63352
|
+
for (i = this.start; index < length && i < byteCount; ++index) {
|
|
63353
|
+
blocks[i >> 2] |= message[index] << SHIFT[i++ & 3];
|
|
63354
|
+
}
|
|
63355
|
+
} else {
|
|
63356
|
+
for (i = this.start; index < length && i < byteCount; ++index) {
|
|
63357
|
+
code = message.charCodeAt(index);
|
|
63358
|
+
if (code < 0x80) {
|
|
63359
|
+
blocks[i >> 2] |= code << SHIFT[i++ & 3];
|
|
63360
|
+
} else if (code < 0x800) {
|
|
63361
|
+
blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3];
|
|
63362
|
+
blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
|
|
63363
|
+
} else if (code < 0xd800 || code >= 0xe000) {
|
|
63364
|
+
blocks[i >> 2] |= (0xe0 | (code >> 12)) << SHIFT[i++ & 3];
|
|
63365
|
+
blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];
|
|
63366
|
+
blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
|
|
63367
|
+
} else {
|
|
63368
|
+
code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));
|
|
63369
|
+
blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3];
|
|
63370
|
+
blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3];
|
|
63371
|
+
blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];
|
|
63372
|
+
blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
|
|
63373
|
+
}
|
|
63374
|
+
}
|
|
63375
|
+
}
|
|
63376
|
+
this.lastByteIndex = i;
|
|
63377
|
+
if (i >= byteCount) {
|
|
63378
|
+
this.start = i - byteCount;
|
|
63379
|
+
this.block = blocks[blockCount];
|
|
63380
|
+
for (i = 0; i < blockCount; ++i) {
|
|
63381
|
+
s[i] ^= blocks[i];
|
|
63382
|
+
}
|
|
63383
|
+
f(s);
|
|
63384
|
+
this.reset = true;
|
|
63385
|
+
} else {
|
|
63386
|
+
this.start = i;
|
|
63387
|
+
}
|
|
63388
|
+
}
|
|
63389
|
+
return this;
|
|
63390
|
+
};
|
|
63391
|
+
|
|
63392
|
+
Keccak.prototype.finalize = function () {
|
|
63393
|
+
var blocks = this.blocks, i = this.lastByteIndex, blockCount = this.blockCount, s = this.s;
|
|
63394
|
+
blocks[i >> 2] |= this.padding[i & 3];
|
|
63395
|
+
if (this.lastByteIndex === this.byteCount) {
|
|
63396
|
+
blocks[0] = blocks[blockCount];
|
|
63397
|
+
for (i = 1; i < blockCount + 1; ++i) {
|
|
63398
|
+
blocks[i] = 0;
|
|
63399
|
+
}
|
|
63400
|
+
}
|
|
63401
|
+
blocks[blockCount - 1] |= 0x80000000;
|
|
63402
|
+
for (i = 0; i < blockCount; ++i) {
|
|
63403
|
+
s[i] ^= blocks[i];
|
|
63404
|
+
}
|
|
63405
|
+
f(s);
|
|
63406
|
+
};
|
|
63407
|
+
|
|
63408
|
+
Keccak.prototype.toString = Keccak.prototype.hex = function () {
|
|
63409
|
+
this.finalize();
|
|
63410
|
+
|
|
63411
|
+
var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks,
|
|
63412
|
+
extraBytes = this.extraBytes, i = 0, j = 0;
|
|
63413
|
+
var hex = '', block;
|
|
63414
|
+
while (j < outputBlocks) {
|
|
63415
|
+
for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {
|
|
63416
|
+
block = s[i];
|
|
63417
|
+
hex += HEX_CHARS[(block >> 4) & 0x0F] + HEX_CHARS[block & 0x0F] +
|
|
63418
|
+
HEX_CHARS[(block >> 12) & 0x0F] + HEX_CHARS[(block >> 8) & 0x0F] +
|
|
63419
|
+
HEX_CHARS[(block >> 20) & 0x0F] + HEX_CHARS[(block >> 16) & 0x0F] +
|
|
63420
|
+
HEX_CHARS[(block >> 28) & 0x0F] + HEX_CHARS[(block >> 24) & 0x0F];
|
|
63421
|
+
}
|
|
63422
|
+
if (j % blockCount === 0) {
|
|
63423
|
+
f(s);
|
|
63424
|
+
i = 0;
|
|
63425
|
+
}
|
|
63426
|
+
}
|
|
63427
|
+
if (extraBytes) {
|
|
63428
|
+
block = s[i];
|
|
63429
|
+
if (extraBytes > 0) {
|
|
63430
|
+
hex += HEX_CHARS[(block >> 4) & 0x0F] + HEX_CHARS[block & 0x0F];
|
|
63431
|
+
}
|
|
63432
|
+
if (extraBytes > 1) {
|
|
63433
|
+
hex += HEX_CHARS[(block >> 12) & 0x0F] + HEX_CHARS[(block >> 8) & 0x0F];
|
|
63434
|
+
}
|
|
63435
|
+
if (extraBytes > 2) {
|
|
63436
|
+
hex += HEX_CHARS[(block >> 20) & 0x0F] + HEX_CHARS[(block >> 16) & 0x0F];
|
|
63437
|
+
}
|
|
63438
|
+
}
|
|
63439
|
+
return hex;
|
|
63440
|
+
};
|
|
63441
|
+
|
|
63442
|
+
Keccak.prototype.arrayBuffer = function () {
|
|
63443
|
+
this.finalize();
|
|
63444
|
+
|
|
63445
|
+
var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks,
|
|
63446
|
+
extraBytes = this.extraBytes, i = 0, j = 0;
|
|
63447
|
+
var bytes = this.outputBits >> 3;
|
|
63448
|
+
var buffer;
|
|
63449
|
+
if (extraBytes) {
|
|
63450
|
+
buffer = new ArrayBuffer((outputBlocks + 1) << 2);
|
|
63451
|
+
} else {
|
|
63452
|
+
buffer = new ArrayBuffer(bytes);
|
|
63453
|
+
}
|
|
63454
|
+
var array = new Uint32Array(buffer);
|
|
63455
|
+
while (j < outputBlocks) {
|
|
63456
|
+
for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {
|
|
63457
|
+
array[j] = s[i];
|
|
63458
|
+
}
|
|
63459
|
+
if (j % blockCount === 0) {
|
|
63460
|
+
f(s);
|
|
63461
|
+
}
|
|
63462
|
+
}
|
|
63463
|
+
if (extraBytes) {
|
|
63464
|
+
array[i] = s[i];
|
|
63465
|
+
buffer = buffer.slice(0, bytes);
|
|
63466
|
+
}
|
|
63467
|
+
return buffer;
|
|
63468
|
+
};
|
|
63469
|
+
|
|
63470
|
+
Keccak.prototype.buffer = Keccak.prototype.arrayBuffer;
|
|
63471
|
+
|
|
63472
|
+
Keccak.prototype.digest = Keccak.prototype.array = function () {
|
|
63473
|
+
this.finalize();
|
|
63474
|
+
|
|
63475
|
+
var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks,
|
|
63476
|
+
extraBytes = this.extraBytes, i = 0, j = 0;
|
|
63477
|
+
var array = [], offset, block;
|
|
63478
|
+
while (j < outputBlocks) {
|
|
63479
|
+
for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {
|
|
63480
|
+
offset = j << 2;
|
|
63481
|
+
block = s[i];
|
|
63482
|
+
array[offset] = block & 0xFF;
|
|
63483
|
+
array[offset + 1] = (block >> 8) & 0xFF;
|
|
63484
|
+
array[offset + 2] = (block >> 16) & 0xFF;
|
|
63485
|
+
array[offset + 3] = (block >> 24) & 0xFF;
|
|
63486
|
+
}
|
|
63487
|
+
if (j % blockCount === 0) {
|
|
63488
|
+
f(s);
|
|
63489
|
+
}
|
|
63490
|
+
}
|
|
63491
|
+
if (extraBytes) {
|
|
63492
|
+
offset = j << 2;
|
|
63493
|
+
block = s[i];
|
|
63494
|
+
if (extraBytes > 0) {
|
|
63495
|
+
array[offset] = block & 0xFF;
|
|
63496
|
+
}
|
|
63497
|
+
if (extraBytes > 1) {
|
|
63498
|
+
array[offset + 1] = (block >> 8) & 0xFF;
|
|
63499
|
+
}
|
|
63500
|
+
if (extraBytes > 2) {
|
|
63501
|
+
array[offset + 2] = (block >> 16) & 0xFF;
|
|
63502
|
+
}
|
|
63503
|
+
}
|
|
63504
|
+
return array;
|
|
63505
|
+
};
|
|
63506
|
+
|
|
63507
|
+
var f = function (s) {
|
|
63508
|
+
var h, l, n, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9,
|
|
63509
|
+
b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16, b17,
|
|
63510
|
+
b18, b19, b20, b21, b22, b23, b24, b25, b26, b27, b28, b29, b30, b31, b32, b33,
|
|
63511
|
+
b34, b35, b36, b37, b38, b39, b40, b41, b42, b43, b44, b45, b46, b47, b48, b49;
|
|
63512
|
+
for (n = 0; n < 48; n += 2) {
|
|
63513
|
+
c0 = s[0] ^ s[10] ^ s[20] ^ s[30] ^ s[40];
|
|
63514
|
+
c1 = s[1] ^ s[11] ^ s[21] ^ s[31] ^ s[41];
|
|
63515
|
+
c2 = s[2] ^ s[12] ^ s[22] ^ s[32] ^ s[42];
|
|
63516
|
+
c3 = s[3] ^ s[13] ^ s[23] ^ s[33] ^ s[43];
|
|
63517
|
+
c4 = s[4] ^ s[14] ^ s[24] ^ s[34] ^ s[44];
|
|
63518
|
+
c5 = s[5] ^ s[15] ^ s[25] ^ s[35] ^ s[45];
|
|
63519
|
+
c6 = s[6] ^ s[16] ^ s[26] ^ s[36] ^ s[46];
|
|
63520
|
+
c7 = s[7] ^ s[17] ^ s[27] ^ s[37] ^ s[47];
|
|
63521
|
+
c8 = s[8] ^ s[18] ^ s[28] ^ s[38] ^ s[48];
|
|
63522
|
+
c9 = s[9] ^ s[19] ^ s[29] ^ s[39] ^ s[49];
|
|
63523
|
+
|
|
63524
|
+
h = c8 ^ ((c2 << 1) | (c3 >>> 31));
|
|
63525
|
+
l = c9 ^ ((c3 << 1) | (c2 >>> 31));
|
|
63526
|
+
s[0] ^= h;
|
|
63527
|
+
s[1] ^= l;
|
|
63528
|
+
s[10] ^= h;
|
|
63529
|
+
s[11] ^= l;
|
|
63530
|
+
s[20] ^= h;
|
|
63531
|
+
s[21] ^= l;
|
|
63532
|
+
s[30] ^= h;
|
|
63533
|
+
s[31] ^= l;
|
|
63534
|
+
s[40] ^= h;
|
|
63535
|
+
s[41] ^= l;
|
|
63536
|
+
h = c0 ^ ((c4 << 1) | (c5 >>> 31));
|
|
63537
|
+
l = c1 ^ ((c5 << 1) | (c4 >>> 31));
|
|
63538
|
+
s[2] ^= h;
|
|
63539
|
+
s[3] ^= l;
|
|
63540
|
+
s[12] ^= h;
|
|
63541
|
+
s[13] ^= l;
|
|
63542
|
+
s[22] ^= h;
|
|
63543
|
+
s[23] ^= l;
|
|
63544
|
+
s[32] ^= h;
|
|
63545
|
+
s[33] ^= l;
|
|
63546
|
+
s[42] ^= h;
|
|
63547
|
+
s[43] ^= l;
|
|
63548
|
+
h = c2 ^ ((c6 << 1) | (c7 >>> 31));
|
|
63549
|
+
l = c3 ^ ((c7 << 1) | (c6 >>> 31));
|
|
63550
|
+
s[4] ^= h;
|
|
63551
|
+
s[5] ^= l;
|
|
63552
|
+
s[14] ^= h;
|
|
63553
|
+
s[15] ^= l;
|
|
63554
|
+
s[24] ^= h;
|
|
63555
|
+
s[25] ^= l;
|
|
63556
|
+
s[34] ^= h;
|
|
63557
|
+
s[35] ^= l;
|
|
63558
|
+
s[44] ^= h;
|
|
63559
|
+
s[45] ^= l;
|
|
63560
|
+
h = c4 ^ ((c8 << 1) | (c9 >>> 31));
|
|
63561
|
+
l = c5 ^ ((c9 << 1) | (c8 >>> 31));
|
|
63562
|
+
s[6] ^= h;
|
|
63563
|
+
s[7] ^= l;
|
|
63564
|
+
s[16] ^= h;
|
|
63565
|
+
s[17] ^= l;
|
|
63566
|
+
s[26] ^= h;
|
|
63567
|
+
s[27] ^= l;
|
|
63568
|
+
s[36] ^= h;
|
|
63569
|
+
s[37] ^= l;
|
|
63570
|
+
s[46] ^= h;
|
|
63571
|
+
s[47] ^= l;
|
|
63572
|
+
h = c6 ^ ((c0 << 1) | (c1 >>> 31));
|
|
63573
|
+
l = c7 ^ ((c1 << 1) | (c0 >>> 31));
|
|
63574
|
+
s[8] ^= h;
|
|
63575
|
+
s[9] ^= l;
|
|
63576
|
+
s[18] ^= h;
|
|
63577
|
+
s[19] ^= l;
|
|
63578
|
+
s[28] ^= h;
|
|
63579
|
+
s[29] ^= l;
|
|
63580
|
+
s[38] ^= h;
|
|
63581
|
+
s[39] ^= l;
|
|
63582
|
+
s[48] ^= h;
|
|
63583
|
+
s[49] ^= l;
|
|
63584
|
+
|
|
63585
|
+
b0 = s[0];
|
|
63586
|
+
b1 = s[1];
|
|
63587
|
+
b32 = (s[11] << 4) | (s[10] >>> 28);
|
|
63588
|
+
b33 = (s[10] << 4) | (s[11] >>> 28);
|
|
63589
|
+
b14 = (s[20] << 3) | (s[21] >>> 29);
|
|
63590
|
+
b15 = (s[21] << 3) | (s[20] >>> 29);
|
|
63591
|
+
b46 = (s[31] << 9) | (s[30] >>> 23);
|
|
63592
|
+
b47 = (s[30] << 9) | (s[31] >>> 23);
|
|
63593
|
+
b28 = (s[40] << 18) | (s[41] >>> 14);
|
|
63594
|
+
b29 = (s[41] << 18) | (s[40] >>> 14);
|
|
63595
|
+
b20 = (s[2] << 1) | (s[3] >>> 31);
|
|
63596
|
+
b21 = (s[3] << 1) | (s[2] >>> 31);
|
|
63597
|
+
b2 = (s[13] << 12) | (s[12] >>> 20);
|
|
63598
|
+
b3 = (s[12] << 12) | (s[13] >>> 20);
|
|
63599
|
+
b34 = (s[22] << 10) | (s[23] >>> 22);
|
|
63600
|
+
b35 = (s[23] << 10) | (s[22] >>> 22);
|
|
63601
|
+
b16 = (s[33] << 13) | (s[32] >>> 19);
|
|
63602
|
+
b17 = (s[32] << 13) | (s[33] >>> 19);
|
|
63603
|
+
b48 = (s[42] << 2) | (s[43] >>> 30);
|
|
63604
|
+
b49 = (s[43] << 2) | (s[42] >>> 30);
|
|
63605
|
+
b40 = (s[5] << 30) | (s[4] >>> 2);
|
|
63606
|
+
b41 = (s[4] << 30) | (s[5] >>> 2);
|
|
63607
|
+
b22 = (s[14] << 6) | (s[15] >>> 26);
|
|
63608
|
+
b23 = (s[15] << 6) | (s[14] >>> 26);
|
|
63609
|
+
b4 = (s[25] << 11) | (s[24] >>> 21);
|
|
63610
|
+
b5 = (s[24] << 11) | (s[25] >>> 21);
|
|
63611
|
+
b36 = (s[34] << 15) | (s[35] >>> 17);
|
|
63612
|
+
b37 = (s[35] << 15) | (s[34] >>> 17);
|
|
63613
|
+
b18 = (s[45] << 29) | (s[44] >>> 3);
|
|
63614
|
+
b19 = (s[44] << 29) | (s[45] >>> 3);
|
|
63615
|
+
b10 = (s[6] << 28) | (s[7] >>> 4);
|
|
63616
|
+
b11 = (s[7] << 28) | (s[6] >>> 4);
|
|
63617
|
+
b42 = (s[17] << 23) | (s[16] >>> 9);
|
|
63618
|
+
b43 = (s[16] << 23) | (s[17] >>> 9);
|
|
63619
|
+
b24 = (s[26] << 25) | (s[27] >>> 7);
|
|
63620
|
+
b25 = (s[27] << 25) | (s[26] >>> 7);
|
|
63621
|
+
b6 = (s[36] << 21) | (s[37] >>> 11);
|
|
63622
|
+
b7 = (s[37] << 21) | (s[36] >>> 11);
|
|
63623
|
+
b38 = (s[47] << 24) | (s[46] >>> 8);
|
|
63624
|
+
b39 = (s[46] << 24) | (s[47] >>> 8);
|
|
63625
|
+
b30 = (s[8] << 27) | (s[9] >>> 5);
|
|
63626
|
+
b31 = (s[9] << 27) | (s[8] >>> 5);
|
|
63627
|
+
b12 = (s[18] << 20) | (s[19] >>> 12);
|
|
63628
|
+
b13 = (s[19] << 20) | (s[18] >>> 12);
|
|
63629
|
+
b44 = (s[29] << 7) | (s[28] >>> 25);
|
|
63630
|
+
b45 = (s[28] << 7) | (s[29] >>> 25);
|
|
63631
|
+
b26 = (s[38] << 8) | (s[39] >>> 24);
|
|
63632
|
+
b27 = (s[39] << 8) | (s[38] >>> 24);
|
|
63633
|
+
b8 = (s[48] << 14) | (s[49] >>> 18);
|
|
63634
|
+
b9 = (s[49] << 14) | (s[48] >>> 18);
|
|
63635
|
+
|
|
63636
|
+
s[0] = b0 ^ (~b2 & b4);
|
|
63637
|
+
s[1] = b1 ^ (~b3 & b5);
|
|
63638
|
+
s[10] = b10 ^ (~b12 & b14);
|
|
63639
|
+
s[11] = b11 ^ (~b13 & b15);
|
|
63640
|
+
s[20] = b20 ^ (~b22 & b24);
|
|
63641
|
+
s[21] = b21 ^ (~b23 & b25);
|
|
63642
|
+
s[30] = b30 ^ (~b32 & b34);
|
|
63643
|
+
s[31] = b31 ^ (~b33 & b35);
|
|
63644
|
+
s[40] = b40 ^ (~b42 & b44);
|
|
63645
|
+
s[41] = b41 ^ (~b43 & b45);
|
|
63646
|
+
s[2] = b2 ^ (~b4 & b6);
|
|
63647
|
+
s[3] = b3 ^ (~b5 & b7);
|
|
63648
|
+
s[12] = b12 ^ (~b14 & b16);
|
|
63649
|
+
s[13] = b13 ^ (~b15 & b17);
|
|
63650
|
+
s[22] = b22 ^ (~b24 & b26);
|
|
63651
|
+
s[23] = b23 ^ (~b25 & b27);
|
|
63652
|
+
s[32] = b32 ^ (~b34 & b36);
|
|
63653
|
+
s[33] = b33 ^ (~b35 & b37);
|
|
63654
|
+
s[42] = b42 ^ (~b44 & b46);
|
|
63655
|
+
s[43] = b43 ^ (~b45 & b47);
|
|
63656
|
+
s[4] = b4 ^ (~b6 & b8);
|
|
63657
|
+
s[5] = b5 ^ (~b7 & b9);
|
|
63658
|
+
s[14] = b14 ^ (~b16 & b18);
|
|
63659
|
+
s[15] = b15 ^ (~b17 & b19);
|
|
63660
|
+
s[24] = b24 ^ (~b26 & b28);
|
|
63661
|
+
s[25] = b25 ^ (~b27 & b29);
|
|
63662
|
+
s[34] = b34 ^ (~b36 & b38);
|
|
63663
|
+
s[35] = b35 ^ (~b37 & b39);
|
|
63664
|
+
s[44] = b44 ^ (~b46 & b48);
|
|
63665
|
+
s[45] = b45 ^ (~b47 & b49);
|
|
63666
|
+
s[6] = b6 ^ (~b8 & b0);
|
|
63667
|
+
s[7] = b7 ^ (~b9 & b1);
|
|
63668
|
+
s[16] = b16 ^ (~b18 & b10);
|
|
63669
|
+
s[17] = b17 ^ (~b19 & b11);
|
|
63670
|
+
s[26] = b26 ^ (~b28 & b20);
|
|
63671
|
+
s[27] = b27 ^ (~b29 & b21);
|
|
63672
|
+
s[36] = b36 ^ (~b38 & b30);
|
|
63673
|
+
s[37] = b37 ^ (~b39 & b31);
|
|
63674
|
+
s[46] = b46 ^ (~b48 & b40);
|
|
63675
|
+
s[47] = b47 ^ (~b49 & b41);
|
|
63676
|
+
s[8] = b8 ^ (~b0 & b2);
|
|
63677
|
+
s[9] = b9 ^ (~b1 & b3);
|
|
63678
|
+
s[18] = b18 ^ (~b10 & b12);
|
|
63679
|
+
s[19] = b19 ^ (~b11 & b13);
|
|
63680
|
+
s[28] = b28 ^ (~b20 & b22);
|
|
63681
|
+
s[29] = b29 ^ (~b21 & b23);
|
|
63682
|
+
s[38] = b38 ^ (~b30 & b32);
|
|
63683
|
+
s[39] = b39 ^ (~b31 & b33);
|
|
63684
|
+
s[48] = b48 ^ (~b40 & b42);
|
|
63685
|
+
s[49] = b49 ^ (~b41 & b43);
|
|
63686
|
+
|
|
63687
|
+
s[0] ^= RC[n];
|
|
63688
|
+
s[1] ^= RC[n + 1];
|
|
63689
|
+
}
|
|
63690
|
+
};
|
|
63691
|
+
|
|
63692
|
+
if (COMMON_JS) {
|
|
63693
|
+
module.exports = methods;
|
|
63694
|
+
} else {
|
|
63695
|
+
for (var i = 0; i < methodNames.length; ++i) {
|
|
63696
|
+
root[methodNames[i]] = methods[methodNames[i]];
|
|
63697
|
+
}
|
|
63698
|
+
}
|
|
63699
|
+
})();
|
|
63700
|
+
});
|
|
63701
|
+
|
|
63702
|
+
var sha3$1 = sha3;
|
|
63703
|
+
|
|
63704
|
+
function keccak256(data) {
|
|
63705
|
+
return '0x' + sha3$1.keccak_256(arrayify(data));
|
|
63706
|
+
}
|
|
63707
|
+
|
|
63708
|
+
const version$1$1 = "address/5.4.0";
|
|
63221
63709
|
|
|
63222
|
-
const logger$
|
|
63710
|
+
const logger$1$1 = new Logger$1(version$1$1);
|
|
63711
|
+
function getChecksumAddress(address) {
|
|
63712
|
+
if (!isHexString$1(address, 20)) {
|
|
63713
|
+
logger$1$1.throwArgumentError("invalid address", "address", address);
|
|
63714
|
+
}
|
|
63715
|
+
address = address.toLowerCase();
|
|
63716
|
+
const chars = address.substring(2).split("");
|
|
63717
|
+
const expanded = new Uint8Array(40);
|
|
63718
|
+
for (let i = 0; i < 40; i++) {
|
|
63719
|
+
expanded[i] = chars[i].charCodeAt(0);
|
|
63720
|
+
}
|
|
63721
|
+
const hashed = arrayify(keccak256(expanded));
|
|
63722
|
+
for (let i = 0; i < 40; i += 2) {
|
|
63723
|
+
if ((hashed[i >> 1] >> 4) >= 8) {
|
|
63724
|
+
chars[i] = chars[i].toUpperCase();
|
|
63725
|
+
}
|
|
63726
|
+
if ((hashed[i >> 1] & 0x0f) >= 8) {
|
|
63727
|
+
chars[i + 1] = chars[i + 1].toUpperCase();
|
|
63728
|
+
}
|
|
63729
|
+
}
|
|
63730
|
+
return "0x" + chars.join("");
|
|
63731
|
+
}
|
|
63732
|
+
// Shims for environments that are missing some required constants and functions
|
|
63733
|
+
const MAX_SAFE_INTEGER = 0x1fffffffffffff;
|
|
63734
|
+
function log10(x) {
|
|
63735
|
+
if (Math.log10) {
|
|
63736
|
+
return Math.log10(x);
|
|
63737
|
+
}
|
|
63738
|
+
return Math.log(x) / Math.LN10;
|
|
63739
|
+
}
|
|
63740
|
+
// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number
|
|
63741
|
+
// Create lookup table
|
|
63742
|
+
const ibanLookup = {};
|
|
63743
|
+
for (let i = 0; i < 10; i++) {
|
|
63744
|
+
ibanLookup[String(i)] = String(i);
|
|
63745
|
+
}
|
|
63746
|
+
for (let i = 0; i < 26; i++) {
|
|
63747
|
+
ibanLookup[String.fromCharCode(65 + i)] = String(10 + i);
|
|
63748
|
+
}
|
|
63749
|
+
// How many decimal digits can we process? (for 64-bit float, this is 15)
|
|
63750
|
+
const safeDigits = Math.floor(log10(MAX_SAFE_INTEGER));
|
|
63751
|
+
function ibanChecksum(address) {
|
|
63752
|
+
address = address.toUpperCase();
|
|
63753
|
+
address = address.substring(4) + address.substring(0, 2) + "00";
|
|
63754
|
+
let expanded = address.split("").map((c) => { return ibanLookup[c]; }).join("");
|
|
63755
|
+
// Javascript can handle integers safely up to 15 (decimal) digits
|
|
63756
|
+
while (expanded.length >= safeDigits) {
|
|
63757
|
+
let block = expanded.substring(0, safeDigits);
|
|
63758
|
+
expanded = parseInt(block, 10) % 97 + expanded.substring(block.length);
|
|
63759
|
+
}
|
|
63760
|
+
let checksum = String(98 - (parseInt(expanded, 10) % 97));
|
|
63761
|
+
while (checksum.length < 2) {
|
|
63762
|
+
checksum = "0" + checksum;
|
|
63763
|
+
}
|
|
63764
|
+
return checksum;
|
|
63765
|
+
}
|
|
63766
|
+
function getAddress(address) {
|
|
63767
|
+
let result = null;
|
|
63768
|
+
if (typeof (address) !== "string") {
|
|
63769
|
+
logger$1$1.throwArgumentError("invalid address", "address", address);
|
|
63770
|
+
}
|
|
63771
|
+
if (address.match(/^(0x)?[0-9a-fA-F]{40}$/)) {
|
|
63772
|
+
// Missing the 0x prefix
|
|
63773
|
+
if (address.substring(0, 2) !== "0x") {
|
|
63774
|
+
address = "0x" + address;
|
|
63775
|
+
}
|
|
63776
|
+
result = getChecksumAddress(address);
|
|
63777
|
+
// It is a checksummed address with a bad checksum
|
|
63778
|
+
if (address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) && result !== address) {
|
|
63779
|
+
logger$1$1.throwArgumentError("bad address checksum", "address", address);
|
|
63780
|
+
}
|
|
63781
|
+
// Maybe ICAP? (we only support direct mode)
|
|
63782
|
+
}
|
|
63783
|
+
else if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {
|
|
63784
|
+
// It is an ICAP address with a bad checksum
|
|
63785
|
+
if (address.substring(2, 4) !== ibanChecksum(address)) {
|
|
63786
|
+
logger$1$1.throwArgumentError("bad icap checksum", "address", address);
|
|
63787
|
+
}
|
|
63788
|
+
result = _base36To16(address.substring(4));
|
|
63789
|
+
while (result.length < 40) {
|
|
63790
|
+
result = "0" + result;
|
|
63791
|
+
}
|
|
63792
|
+
result = getChecksumAddress("0x" + result);
|
|
63793
|
+
}
|
|
63794
|
+
else {
|
|
63795
|
+
logger$1$1.throwArgumentError("invalid address", "address", address);
|
|
63796
|
+
}
|
|
63797
|
+
return result;
|
|
63798
|
+
}
|
|
63799
|
+
|
|
63800
|
+
const version$5 = "units/5.4.0";
|
|
63801
|
+
|
|
63802
|
+
const logger$5 = new Logger$1(version$5);
|
|
63223
63803
|
const names = [
|
|
63224
63804
|
"wei",
|
|
63225
63805
|
"kwei",
|
|
@@ -63231,7 +63811,7 @@
|
|
|
63231
63811
|
];
|
|
63232
63812
|
function parseUnits(value, unitName) {
|
|
63233
63813
|
if (typeof (value) !== "string") {
|
|
63234
|
-
logger$
|
|
63814
|
+
logger$5.throwArgumentError("value must be a string", "value", value);
|
|
63235
63815
|
}
|
|
63236
63816
|
if (typeof (unitName) === "string") {
|
|
63237
63817
|
const index = names.indexOf(unitName);
|
|
@@ -63494,6 +64074,10 @@
|
|
|
63494
64074
|
return transaction
|
|
63495
64075
|
};
|
|
63496
64076
|
|
|
64077
|
+
const fixCheckSum = (address)=>{
|
|
64078
|
+
return getAddress(address)
|
|
64079
|
+
};
|
|
64080
|
+
|
|
63497
64081
|
let route$6 = ({
|
|
63498
64082
|
exchange,
|
|
63499
64083
|
tokenIn,
|
|
@@ -63505,6 +64089,8 @@
|
|
|
63505
64089
|
amountInMax = undefined,
|
|
63506
64090
|
amountOutMin = undefined,
|
|
63507
64091
|
}) => {
|
|
64092
|
+
tokenIn = fixCheckSum(tokenIn);
|
|
64093
|
+
tokenOut = fixCheckSum(tokenOut);
|
|
63508
64094
|
return new Promise(async (resolve)=> {
|
|
63509
64095
|
let path = await findPath$1({ tokenIn, tokenOut });
|
|
63510
64096
|
if (path === undefined || path.length == 0) { return resolve() }
|
|
@@ -63842,6 +64428,8 @@
|
|
|
63842
64428
|
amountInMax = undefined,
|
|
63843
64429
|
amountOutMin = undefined,
|
|
63844
64430
|
}) => {
|
|
64431
|
+
tokenIn = fixCheckSum(tokenIn);
|
|
64432
|
+
tokenOut = fixCheckSum(tokenOut);
|
|
63845
64433
|
return new Promise(async (resolve)=> {
|
|
63846
64434
|
let path = await findPath({ tokenIn, tokenOut });
|
|
63847
64435
|
if (path === undefined || path.length == 0) { return resolve() }
|
|
@@ -64191,12 +64779,18 @@
|
|
|
64191
64779
|
});
|
|
64192
64780
|
})).then(function (amounts) {
|
|
64193
64781
|
setAcceptWithAmount(props.accept.map(function (configuration, index) {
|
|
64782
|
+
if (amounts[index] == undefined) {
|
|
64783
|
+
return;
|
|
64784
|
+
}
|
|
64785
|
+
|
|
64194
64786
|
return {
|
|
64195
64787
|
blockchain: configuration.blockchain,
|
|
64196
|
-
amount: round$1(amounts[index])
|
|
64788
|
+
amount: round$1(amounts[index]),
|
|
64197
64789
|
token: configuration.token,
|
|
64198
64790
|
receiver: configuration.receiver || account
|
|
64199
64791
|
};
|
|
64792
|
+
}).filter(function (configuration) {
|
|
64793
|
+
return !!configuration;
|
|
64200
64794
|
}));
|
|
64201
64795
|
})["catch"](setError);
|
|
64202
64796
|
})["catch"](setError);
|
|
@@ -71990,11 +72584,7 @@
|
|
|
71990
72584
|
className: "TokenAmountCell"
|
|
71991
72585
|
}, format(payment.amount)))), /*#__PURE__*/react.createElement("h3", {
|
|
71992
72586
|
className: "CardText"
|
|
71993
|
-
}, /*#__PURE__*/react.createElement("small", null, format(round$1(parseFloat(payment.route.fromBalance.toString()) / Math.pow(10, payment.decimals), 'down'))))))
|
|
71994
|
-
className: "CardInfo"
|
|
71995
|
-
}, payment.route.approvalRequired && /*#__PURE__*/react.createElement("span", {
|
|
71996
|
-
className: "Label"
|
|
71997
|
-
}, "Requires Approval")));
|
|
72587
|
+
}, /*#__PURE__*/react.createElement("small", null, format(round$1(parseFloat(payment.route.fromBalance.toString()) / Math.pow(10, payment.decimals), 'down')))))));
|
|
71998
72588
|
}));
|
|
71999
72589
|
}, [allPaymentRoutesWithData]);
|
|
72000
72590
|
|