@depay/widgets 4.4.0 → 5.0.3
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 +42 -57
- package/dist/cjs/index.bundle.js +1427 -594
- package/dist/cjs/index.js +613 -387
- package/dist/es/index.bundle.js +1427 -594
- package/dist/es/index.js +614 -388
- package/dist/umd/index.bundle.js +1427 -594
- package/dist/umd/index.js +613 -387
- package/package.json +8 -7
package/dist/cjs/index.bundle.js
CHANGED
|
@@ -39,17 +39,11 @@ function _asyncToGenerator(fn) {
|
|
|
39
39
|
function _typeof(obj) {
|
|
40
40
|
"@babel/helpers - typeof";
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
_typeof = function _typeof(obj) {
|
|
48
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
return _typeof(obj);
|
|
42
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
43
|
+
return typeof obj;
|
|
44
|
+
} : function (obj) {
|
|
45
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
46
|
+
}, _typeof(obj);
|
|
53
47
|
}
|
|
54
48
|
|
|
55
49
|
var commonjsGlobal$4 = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
@@ -1030,6 +1024,8 @@ var react = createCommonjsModule$4(function (module) {
|
|
|
1030
1024
|
|
|
1031
1025
|
var ClosableContext = /*#__PURE__*/react.createContext();
|
|
1032
1026
|
|
|
1027
|
+
var UpdatableContext = /*#__PURE__*/react.createContext();
|
|
1028
|
+
|
|
1033
1029
|
var ClosableProvider = (function (props) {
|
|
1034
1030
|
var _useState = react.useState(true),
|
|
1035
1031
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -1041,11 +1037,15 @@ var ClosableProvider = (function (props) {
|
|
|
1041
1037
|
open = _useState4[0],
|
|
1042
1038
|
setOpen = _useState4[1];
|
|
1043
1039
|
|
|
1040
|
+
var _useContext = react.useContext(UpdatableContext),
|
|
1041
|
+
setUpdatable = _useContext.setUpdatable;
|
|
1042
|
+
|
|
1044
1043
|
var close = function close() {
|
|
1045
1044
|
if (!closable) {
|
|
1046
1045
|
return;
|
|
1047
1046
|
}
|
|
1048
1047
|
|
|
1048
|
+
setUpdatable(false);
|
|
1049
1049
|
setOpen(false);
|
|
1050
1050
|
setTimeout(props.unmount, 300);
|
|
1051
1051
|
};
|
|
@@ -1991,12 +1991,7 @@ var Dialog = (function (props) {
|
|
|
1991
1991
|
className: "DialogBody"
|
|
1992
1992
|
}, props.body), /*#__PURE__*/react.createElement("div", {
|
|
1993
1993
|
className: "DialogFooter"
|
|
1994
|
-
}, props.footer
|
|
1995
|
-
href: 'https://depay.fi?utm_source=' + window.location.hostname + '&utm_medium=widget&utm_campaign=WidgetV2',
|
|
1996
|
-
rel: "noopener noreferrer",
|
|
1997
|
-
target: "_blank",
|
|
1998
|
-
className: "FooterLink"
|
|
1999
|
-
}, "by DePay")));
|
|
1994
|
+
}, props.footer));
|
|
2000
1995
|
});
|
|
2001
1996
|
|
|
2002
1997
|
var ConnectingWalletDialog = (function (props) {
|
|
@@ -2046,9 +2041,9 @@ var ConnectingWalletDialog = (function (props) {
|
|
|
2046
2041
|
className: "TextButton"
|
|
2047
2042
|
}, "Connect with another wallet")))),
|
|
2048
2043
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
2049
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
2044
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
2050
2045
|
}, /*#__PURE__*/react.createElement("button", {
|
|
2051
|
-
className: "ButtonPrimary
|
|
2046
|
+
className: "ButtonPrimary",
|
|
2052
2047
|
onClick: function onClick() {
|
|
2053
2048
|
return props.connect(wallet);
|
|
2054
2049
|
}
|
|
@@ -2411,7 +2406,7 @@ var es$1 = /*#__PURE__*/Object.freeze({
|
|
|
2411
2406
|
let CONSTANTS = {
|
|
2412
2407
|
ZERO: '0x0000000000000000000000000000000000000000',
|
|
2413
2408
|
MAXINT: '115792089237316195423570985008687907853269984665640564039457584007913129639935',
|
|
2414
|
-
WRAPPED: '
|
|
2409
|
+
WRAPPED: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
|
|
2415
2410
|
NATIVE: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
|
|
2416
2411
|
DECIMALS: 18,
|
|
2417
2412
|
SYMBOL: 'ETH',
|
|
@@ -11356,7 +11351,7 @@ function throwFault$6(fault, operation, value) {
|
|
|
11356
11351
|
return logger$H.throwError(fault, Logger$4.errors.NUMERIC_FAULT, params);
|
|
11357
11352
|
}
|
|
11358
11353
|
// value should have no prefix
|
|
11359
|
-
function _base36To16$
|
|
11354
|
+
function _base36To16$3(value) {
|
|
11360
11355
|
return (new BN$4(value, 36)).toString(16);
|
|
11361
11356
|
}
|
|
11362
11357
|
|
|
@@ -12821,7 +12816,7 @@ class Reader$1 {
|
|
|
12821
12816
|
}
|
|
12822
12817
|
}
|
|
12823
12818
|
|
|
12824
|
-
var sha3$
|
|
12819
|
+
var sha3$4 = createCommonjsModule$4(function (module) {
|
|
12825
12820
|
/*jslint bitwise: true */
|
|
12826
12821
|
(function () {
|
|
12827
12822
|
|
|
@@ -13465,10 +13460,10 @@ var sha3$3 = createCommonjsModule$4(function (module) {
|
|
|
13465
13460
|
})();
|
|
13466
13461
|
});
|
|
13467
13462
|
|
|
13468
|
-
var sha3$
|
|
13463
|
+
var sha3$5 = sha3$4;
|
|
13469
13464
|
|
|
13470
|
-
function keccak256$
|
|
13471
|
-
return '0x' + sha3$
|
|
13465
|
+
function keccak256$3(data) {
|
|
13466
|
+
return '0x' + sha3$5.keccak_256(arrayify$3(data));
|
|
13472
13467
|
}
|
|
13473
13468
|
|
|
13474
13469
|
const version$s = "rlp/5.5.0";
|
|
@@ -13518,7 +13513,7 @@ function encode$4(object) {
|
|
|
13518
13513
|
const version$r = "address/5.5.0";
|
|
13519
13514
|
|
|
13520
13515
|
const logger$B = new Logger$4(version$r);
|
|
13521
|
-
function getChecksumAddress$
|
|
13516
|
+
function getChecksumAddress$3(address) {
|
|
13522
13517
|
if (!isHexString$4(address, 20)) {
|
|
13523
13518
|
logger$B.throwArgumentError("invalid address", "address", address);
|
|
13524
13519
|
}
|
|
@@ -13528,7 +13523,7 @@ function getChecksumAddress$2(address) {
|
|
|
13528
13523
|
for (let i = 0; i < 40; i++) {
|
|
13529
13524
|
expanded[i] = chars[i].charCodeAt(0);
|
|
13530
13525
|
}
|
|
13531
|
-
const hashed = arrayify$3(keccak256$
|
|
13526
|
+
const hashed = arrayify$3(keccak256$3(expanded));
|
|
13532
13527
|
for (let i = 0; i < 40; i += 2) {
|
|
13533
13528
|
if ((hashed[i >> 1] >> 4) >= 8) {
|
|
13534
13529
|
chars[i] = chars[i].toUpperCase();
|
|
@@ -13540,8 +13535,8 @@ function getChecksumAddress$2(address) {
|
|
|
13540
13535
|
return "0x" + chars.join("");
|
|
13541
13536
|
}
|
|
13542
13537
|
// Shims for environments that are missing some required constants and functions
|
|
13543
|
-
const MAX_SAFE_INTEGER$
|
|
13544
|
-
function log10$
|
|
13538
|
+
const MAX_SAFE_INTEGER$4 = 0x1fffffffffffff;
|
|
13539
|
+
function log10$4(x) {
|
|
13545
13540
|
if (Math.log10) {
|
|
13546
13541
|
return Math.log10(x);
|
|
13547
13542
|
}
|
|
@@ -13549,22 +13544,22 @@ function log10$3(x) {
|
|
|
13549
13544
|
}
|
|
13550
13545
|
// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number
|
|
13551
13546
|
// Create lookup table
|
|
13552
|
-
const ibanLookup$
|
|
13547
|
+
const ibanLookup$3 = {};
|
|
13553
13548
|
for (let i = 0; i < 10; i++) {
|
|
13554
|
-
ibanLookup$
|
|
13549
|
+
ibanLookup$3[String(i)] = String(i);
|
|
13555
13550
|
}
|
|
13556
13551
|
for (let i = 0; i < 26; i++) {
|
|
13557
|
-
ibanLookup$
|
|
13552
|
+
ibanLookup$3[String.fromCharCode(65 + i)] = String(10 + i);
|
|
13558
13553
|
}
|
|
13559
13554
|
// How many decimal digits can we process? (for 64-bit float, this is 15)
|
|
13560
|
-
const safeDigits$
|
|
13561
|
-
function ibanChecksum$
|
|
13555
|
+
const safeDigits$3 = Math.floor(log10$4(MAX_SAFE_INTEGER$4));
|
|
13556
|
+
function ibanChecksum$3(address) {
|
|
13562
13557
|
address = address.toUpperCase();
|
|
13563
13558
|
address = address.substring(4) + address.substring(0, 2) + "00";
|
|
13564
|
-
let expanded = address.split("").map((c) => { return ibanLookup$
|
|
13559
|
+
let expanded = address.split("").map((c) => { return ibanLookup$3[c]; }).join("");
|
|
13565
13560
|
// Javascript can handle integers safely up to 15 (decimal) digits
|
|
13566
|
-
while (expanded.length >= safeDigits$
|
|
13567
|
-
let block = expanded.substring(0, safeDigits$
|
|
13561
|
+
while (expanded.length >= safeDigits$3) {
|
|
13562
|
+
let block = expanded.substring(0, safeDigits$3);
|
|
13568
13563
|
expanded = parseInt(block, 10) % 97 + expanded.substring(block.length);
|
|
13569
13564
|
}
|
|
13570
13565
|
let checksum = String(98 - (parseInt(expanded, 10) % 97));
|
|
@@ -13573,7 +13568,7 @@ function ibanChecksum$2(address) {
|
|
|
13573
13568
|
}
|
|
13574
13569
|
return checksum;
|
|
13575
13570
|
}
|
|
13576
|
-
function getAddress$
|
|
13571
|
+
function getAddress$3(address) {
|
|
13577
13572
|
let result = null;
|
|
13578
13573
|
if (typeof (address) !== "string") {
|
|
13579
13574
|
logger$B.throwArgumentError("invalid address", "address", address);
|
|
@@ -13583,7 +13578,7 @@ function getAddress$2(address) {
|
|
|
13583
13578
|
if (address.substring(0, 2) !== "0x") {
|
|
13584
13579
|
address = "0x" + address;
|
|
13585
13580
|
}
|
|
13586
|
-
result = getChecksumAddress$
|
|
13581
|
+
result = getChecksumAddress$3(address);
|
|
13587
13582
|
// It is a checksummed address with a bad checksum
|
|
13588
13583
|
if (address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) && result !== address) {
|
|
13589
13584
|
logger$B.throwArgumentError("bad address checksum", "address", address);
|
|
@@ -13592,14 +13587,14 @@ function getAddress$2(address) {
|
|
|
13592
13587
|
}
|
|
13593
13588
|
else if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {
|
|
13594
13589
|
// It is an ICAP address with a bad checksum
|
|
13595
|
-
if (address.substring(2, 4) !== ibanChecksum$
|
|
13590
|
+
if (address.substring(2, 4) !== ibanChecksum$3(address)) {
|
|
13596
13591
|
logger$B.throwArgumentError("bad icap checksum", "address", address);
|
|
13597
13592
|
}
|
|
13598
|
-
result = _base36To16$
|
|
13593
|
+
result = _base36To16$3(address.substring(4));
|
|
13599
13594
|
while (result.length < 40) {
|
|
13600
13595
|
result = "0" + result;
|
|
13601
13596
|
}
|
|
13602
|
-
result = getChecksumAddress$
|
|
13597
|
+
result = getChecksumAddress$3("0x" + result);
|
|
13603
13598
|
}
|
|
13604
13599
|
else {
|
|
13605
13600
|
logger$B.throwArgumentError("invalid address", "address", address);
|
|
@@ -13610,13 +13605,13 @@ function getAddress$2(address) {
|
|
|
13610
13605
|
function getContractAddress$2(transaction) {
|
|
13611
13606
|
let from = null;
|
|
13612
13607
|
try {
|
|
13613
|
-
from = getAddress$
|
|
13608
|
+
from = getAddress$3(transaction.from);
|
|
13614
13609
|
}
|
|
13615
13610
|
catch (error) {
|
|
13616
13611
|
logger$B.throwArgumentError("missing from address", "transaction", transaction);
|
|
13617
13612
|
}
|
|
13618
13613
|
const nonce = stripZeros$2(arrayify$3(BigNumber$4.from(transaction.nonce).toHexString()));
|
|
13619
|
-
return getAddress$
|
|
13614
|
+
return getAddress$3(hexDataSlice$2(keccak256$3(encode$4([from, nonce])), 12));
|
|
13620
13615
|
}
|
|
13621
13616
|
|
|
13622
13617
|
class AddressCoder$1 extends Coder$1 {
|
|
@@ -13628,7 +13623,7 @@ class AddressCoder$1 extends Coder$1 {
|
|
|
13628
13623
|
}
|
|
13629
13624
|
encode(writer, value) {
|
|
13630
13625
|
try {
|
|
13631
|
-
value = getAddress$
|
|
13626
|
+
value = getAddress$3(value);
|
|
13632
13627
|
}
|
|
13633
13628
|
catch (error) {
|
|
13634
13629
|
this._throwError(error.message, value);
|
|
@@ -13636,7 +13631,7 @@ class AddressCoder$1 extends Coder$1 {
|
|
|
13636
13631
|
return writer.writeValue(value);
|
|
13637
13632
|
}
|
|
13638
13633
|
decode(reader) {
|
|
13639
|
-
return getAddress$
|
|
13634
|
+
return getAddress$3(hexZeroPad$3(reader.readValue().toHexString(), 20));
|
|
13640
13635
|
}
|
|
13641
13636
|
}
|
|
13642
13637
|
|
|
@@ -14349,7 +14344,7 @@ class AbiCoder$1 {
|
|
|
14349
14344
|
const defaultAbiCoder$1 = new AbiCoder$1();
|
|
14350
14345
|
|
|
14351
14346
|
function id$2(text) {
|
|
14352
|
-
return keccak256$
|
|
14347
|
+
return keccak256$3(toUtf8Bytes$2(text));
|
|
14353
14348
|
}
|
|
14354
14349
|
|
|
14355
14350
|
const logger$x = new Logger$4(version$t);
|
|
@@ -14466,7 +14461,7 @@ class Interface$1 {
|
|
|
14466
14461
|
return defaultAbiCoder$1;
|
|
14467
14462
|
}
|
|
14468
14463
|
static getAddress(address) {
|
|
14469
|
-
return getAddress$
|
|
14464
|
+
return getAddress$3(address);
|
|
14470
14465
|
}
|
|
14471
14466
|
static getSighash(fragment) {
|
|
14472
14467
|
return hexDataSlice$2(id$2(fragment.format()), 0, 4);
|
|
@@ -14711,7 +14706,7 @@ class Interface$1 {
|
|
|
14711
14706
|
return id$2(value);
|
|
14712
14707
|
}
|
|
14713
14708
|
else if (param.type === "bytes") {
|
|
14714
|
-
return keccak256$
|
|
14709
|
+
return keccak256$3(hexlify$4(value));
|
|
14715
14710
|
}
|
|
14716
14711
|
// Check addresses are valid
|
|
14717
14712
|
if (param.type === "address") {
|
|
@@ -14766,7 +14761,7 @@ class Interface$1 {
|
|
|
14766
14761
|
topics.push(id$2(value));
|
|
14767
14762
|
}
|
|
14768
14763
|
else if (param.type === "bytes") {
|
|
14769
|
-
topics.push(keccak256$
|
|
14764
|
+
topics.push(keccak256$3(value));
|
|
14770
14765
|
}
|
|
14771
14766
|
else if (param.baseType === "tuple" || param.baseType === "array") {
|
|
14772
14767
|
// @TODO
|
|
@@ -15303,7 +15298,7 @@ var TransactionTypes$2;
|
|
|
15303
15298
|
})(TransactionTypes$2 || (TransactionTypes$2 = {}));
|
|
15304
15299
|
function accessSetify$2(addr, storageKeys) {
|
|
15305
15300
|
return {
|
|
15306
|
-
address: getAddress$
|
|
15301
|
+
address: getAddress$3(addr),
|
|
15307
15302
|
storageKeys: (storageKeys || []).map((storageKey, index) => {
|
|
15308
15303
|
if (hexDataLength$2(storageKey) !== 32) {
|
|
15309
15304
|
logger$u.throwArgumentError("invalid access list storageKey", `accessList[${addr}:${index}]`, storageKey);
|
|
@@ -15355,7 +15350,7 @@ function resolveName$1(resolver, nameOrPromise) {
|
|
|
15355
15350
|
}
|
|
15356
15351
|
// If it is already an address, just use it (after adding checksum)
|
|
15357
15352
|
try {
|
|
15358
|
-
return getAddress$
|
|
15353
|
+
return getAddress$3(name);
|
|
15359
15354
|
}
|
|
15360
15355
|
catch (error) { }
|
|
15361
15356
|
if (!resolver) {
|
|
@@ -15414,7 +15409,7 @@ function populateTransaction$1(contract, fragment, args) {
|
|
|
15414
15409
|
override: resolveName$1(contract.signer, overrides.from),
|
|
15415
15410
|
signer: contract.signer.getAddress()
|
|
15416
15411
|
}).then((check) => __awaiter$a(this, void 0, void 0, function* () {
|
|
15417
|
-
if (getAddress$
|
|
15412
|
+
if (getAddress$3(check.signer) !== check.override) {
|
|
15418
15413
|
logger$t.throwError("Contract with a Signer cannot override from", Logger$4.errors.UNSUPPORTED_OPERATION, {
|
|
15419
15414
|
operation: "overrides.from"
|
|
15420
15415
|
});
|
|
@@ -15850,7 +15845,7 @@ class BaseContract$1 {
|
|
|
15850
15845
|
}
|
|
15851
15846
|
else {
|
|
15852
15847
|
try {
|
|
15853
|
-
defineReadOnly$2(this, "resolvedAddress", Promise.resolve(getAddress$
|
|
15848
|
+
defineReadOnly$2(this, "resolvedAddress", Promise.resolve(getAddress$3(addressOrName)));
|
|
15854
15849
|
}
|
|
15855
15850
|
catch (error) {
|
|
15856
15851
|
// Without a provider, we cannot use ENS names
|
|
@@ -20915,7 +20910,7 @@ function throwFault$4(fault, operation, value) {
|
|
|
20915
20910
|
return logger$e$1.throwError(fault, Logger$3.errors.NUMERIC_FAULT, params);
|
|
20916
20911
|
}
|
|
20917
20912
|
// value should have no prefix
|
|
20918
|
-
function _base36To16$
|
|
20913
|
+
function _base36To16$2(value) {
|
|
20919
20914
|
return (new BN$3(value, 36)).toString(16);
|
|
20920
20915
|
}
|
|
20921
20916
|
|
|
@@ -22121,7 +22116,7 @@ const Base58$1 = new BaseX$1("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqr
|
|
|
22121
22116
|
* @license MIT
|
|
22122
22117
|
*/
|
|
22123
22118
|
|
|
22124
|
-
var sha3$
|
|
22119
|
+
var sha3$3 = createCommonjsModule$1$2(function (module) {
|
|
22125
22120
|
/*jslint bitwise: true */
|
|
22126
22121
|
(function () {
|
|
22127
22122
|
|
|
@@ -22590,14 +22585,14 @@ var sha3$2 = createCommonjsModule$1$2(function (module) {
|
|
|
22590
22585
|
})();
|
|
22591
22586
|
});
|
|
22592
22587
|
|
|
22593
|
-
var sha3$1$
|
|
22588
|
+
var sha3$1$2 = sha3$3;
|
|
22594
22589
|
|
|
22595
|
-
function keccak256$
|
|
22596
|
-
return '0x' + sha3$1$
|
|
22590
|
+
function keccak256$2(data) {
|
|
22591
|
+
return '0x' + sha3$1$2.keccak_256(arrayify$2(data));
|
|
22597
22592
|
}
|
|
22598
22593
|
|
|
22599
22594
|
function id$1(text) {
|
|
22600
|
-
return keccak256$
|
|
22595
|
+
return keccak256$2(toUtf8Bytes$1(text));
|
|
22601
22596
|
}
|
|
22602
22597
|
|
|
22603
22598
|
const version$7$1 = "hash/5.4.0";
|
|
@@ -22619,7 +22614,7 @@ function namehash$1(name) {
|
|
|
22619
22614
|
logger$9$1.throwArgumentError("invalid ENS address; missing component", "name", name);
|
|
22620
22615
|
}
|
|
22621
22616
|
const label = toUtf8Bytes$1(nameprep$1(partition[3]));
|
|
22622
|
-
result = keccak256$
|
|
22617
|
+
result = keccak256$2(concat$1([result, keccak256$2(label)]));
|
|
22623
22618
|
current = partition[2] || "";
|
|
22624
22619
|
}
|
|
22625
22620
|
return hexlify$3(result);
|
|
@@ -22742,10 +22737,10 @@ function decode$1$1(data) {
|
|
|
22742
22737
|
return decoded.result;
|
|
22743
22738
|
}
|
|
22744
22739
|
|
|
22745
|
-
const version$5$
|
|
22740
|
+
const version$5$2 = "address/5.4.0";
|
|
22746
22741
|
|
|
22747
|
-
const logger$7$1 = new Logger$3(version$5$
|
|
22748
|
-
function getChecksumAddress$
|
|
22742
|
+
const logger$7$1 = new Logger$3(version$5$2);
|
|
22743
|
+
function getChecksumAddress$2(address) {
|
|
22749
22744
|
if (!isHexString$3(address, 20)) {
|
|
22750
22745
|
logger$7$1.throwArgumentError("invalid address", "address", address);
|
|
22751
22746
|
}
|
|
@@ -22755,7 +22750,7 @@ function getChecksumAddress$1(address) {
|
|
|
22755
22750
|
for (let i = 0; i < 40; i++) {
|
|
22756
22751
|
expanded[i] = chars[i].charCodeAt(0);
|
|
22757
22752
|
}
|
|
22758
|
-
const hashed = arrayify$2(keccak256$
|
|
22753
|
+
const hashed = arrayify$2(keccak256$2(expanded));
|
|
22759
22754
|
for (let i = 0; i < 40; i += 2) {
|
|
22760
22755
|
if ((hashed[i >> 1] >> 4) >= 8) {
|
|
22761
22756
|
chars[i] = chars[i].toUpperCase();
|
|
@@ -22767,8 +22762,8 @@ function getChecksumAddress$1(address) {
|
|
|
22767
22762
|
return "0x" + chars.join("");
|
|
22768
22763
|
}
|
|
22769
22764
|
// Shims for environments that are missing some required constants and functions
|
|
22770
|
-
const MAX_SAFE_INTEGER$
|
|
22771
|
-
function log10$
|
|
22765
|
+
const MAX_SAFE_INTEGER$3 = 0x1fffffffffffff;
|
|
22766
|
+
function log10$3(x) {
|
|
22772
22767
|
if (Math.log10) {
|
|
22773
22768
|
return Math.log10(x);
|
|
22774
22769
|
}
|
|
@@ -22776,22 +22771,22 @@ function log10$2(x) {
|
|
|
22776
22771
|
}
|
|
22777
22772
|
// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number
|
|
22778
22773
|
// Create lookup table
|
|
22779
|
-
const ibanLookup$
|
|
22774
|
+
const ibanLookup$2 = {};
|
|
22780
22775
|
for (let i = 0; i < 10; i++) {
|
|
22781
|
-
ibanLookup$
|
|
22776
|
+
ibanLookup$2[String(i)] = String(i);
|
|
22782
22777
|
}
|
|
22783
22778
|
for (let i = 0; i < 26; i++) {
|
|
22784
|
-
ibanLookup$
|
|
22779
|
+
ibanLookup$2[String.fromCharCode(65 + i)] = String(10 + i);
|
|
22785
22780
|
}
|
|
22786
22781
|
// How many decimal digits can we process? (for 64-bit float, this is 15)
|
|
22787
|
-
const safeDigits$
|
|
22788
|
-
function ibanChecksum$
|
|
22782
|
+
const safeDigits$2 = Math.floor(log10$3(MAX_SAFE_INTEGER$3));
|
|
22783
|
+
function ibanChecksum$2(address) {
|
|
22789
22784
|
address = address.toUpperCase();
|
|
22790
22785
|
address = address.substring(4) + address.substring(0, 2) + "00";
|
|
22791
|
-
let expanded = address.split("").map((c) => { return ibanLookup$
|
|
22786
|
+
let expanded = address.split("").map((c) => { return ibanLookup$2[c]; }).join("");
|
|
22792
22787
|
// Javascript can handle integers safely up to 15 (decimal) digits
|
|
22793
|
-
while (expanded.length >= safeDigits$
|
|
22794
|
-
let block = expanded.substring(0, safeDigits$
|
|
22788
|
+
while (expanded.length >= safeDigits$2) {
|
|
22789
|
+
let block = expanded.substring(0, safeDigits$2);
|
|
22795
22790
|
expanded = parseInt(block, 10) % 97 + expanded.substring(block.length);
|
|
22796
22791
|
}
|
|
22797
22792
|
let checksum = String(98 - (parseInt(expanded, 10) % 97));
|
|
@@ -22800,7 +22795,7 @@ function ibanChecksum$1(address) {
|
|
|
22800
22795
|
}
|
|
22801
22796
|
return checksum;
|
|
22802
22797
|
}
|
|
22803
|
-
function getAddress$
|
|
22798
|
+
function getAddress$2(address) {
|
|
22804
22799
|
let result = null;
|
|
22805
22800
|
if (typeof (address) !== "string") {
|
|
22806
22801
|
logger$7$1.throwArgumentError("invalid address", "address", address);
|
|
@@ -22810,7 +22805,7 @@ function getAddress$1(address) {
|
|
|
22810
22805
|
if (address.substring(0, 2) !== "0x") {
|
|
22811
22806
|
address = "0x" + address;
|
|
22812
22807
|
}
|
|
22813
|
-
result = getChecksumAddress$
|
|
22808
|
+
result = getChecksumAddress$2(address);
|
|
22814
22809
|
// It is a checksummed address with a bad checksum
|
|
22815
22810
|
if (address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) && result !== address) {
|
|
22816
22811
|
logger$7$1.throwArgumentError("bad address checksum", "address", address);
|
|
@@ -22819,14 +22814,14 @@ function getAddress$1(address) {
|
|
|
22819
22814
|
}
|
|
22820
22815
|
else if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {
|
|
22821
22816
|
// It is an ICAP address with a bad checksum
|
|
22822
|
-
if (address.substring(2, 4) !== ibanChecksum$
|
|
22817
|
+
if (address.substring(2, 4) !== ibanChecksum$2(address)) {
|
|
22823
22818
|
logger$7$1.throwArgumentError("bad icap checksum", "address", address);
|
|
22824
22819
|
}
|
|
22825
|
-
result = _base36To16$
|
|
22820
|
+
result = _base36To16$2(address.substring(4));
|
|
22826
22821
|
while (result.length < 40) {
|
|
22827
22822
|
result = "0" + result;
|
|
22828
22823
|
}
|
|
22829
|
-
result = getChecksumAddress$
|
|
22824
|
+
result = getChecksumAddress$2("0x" + result);
|
|
22830
22825
|
}
|
|
22831
22826
|
else {
|
|
22832
22827
|
logger$7$1.throwArgumentError("invalid address", "address", address);
|
|
@@ -22837,13 +22832,13 @@ function getAddress$1(address) {
|
|
|
22837
22832
|
function getContractAddress$1(transaction) {
|
|
22838
22833
|
let from = null;
|
|
22839
22834
|
try {
|
|
22840
|
-
from = getAddress$
|
|
22835
|
+
from = getAddress$2(transaction.from);
|
|
22841
22836
|
}
|
|
22842
22837
|
catch (error) {
|
|
22843
22838
|
logger$7$1.throwArgumentError("missing from address", "transaction", transaction);
|
|
22844
22839
|
}
|
|
22845
22840
|
const nonce = stripZeros$1(arrayify$2(BigNumber$3.from(transaction.nonce).toHexString()));
|
|
22846
|
-
return getAddress$
|
|
22841
|
+
return getAddress$2(hexDataSlice$1(keccak256$2(encode$1$1([from, nonce])), 12));
|
|
22847
22842
|
}
|
|
22848
22843
|
|
|
22849
22844
|
var __awaiter$3$1 = function (thisArg, _arguments, P, generator) {
|
|
@@ -22902,7 +22897,7 @@ const domainChecks$1 = {
|
|
|
22902
22897
|
},
|
|
22903
22898
|
verifyingContract: function (value) {
|
|
22904
22899
|
try {
|
|
22905
|
-
return getAddress$
|
|
22900
|
+
return getAddress$2(value).toLowerCase();
|
|
22906
22901
|
}
|
|
22907
22902
|
catch (error) { }
|
|
22908
22903
|
return logger$6$1.throwArgumentError(`invalid domain value "verifyingContract"`, "domain.verifyingContract", value);
|
|
@@ -22959,13 +22954,13 @@ function getBaseEncoder$1(type) {
|
|
|
22959
22954
|
}
|
|
22960
22955
|
switch (type) {
|
|
22961
22956
|
case "address": return function (value) {
|
|
22962
|
-
return hexZeroPad$2(getAddress$
|
|
22957
|
+
return hexZeroPad$2(getAddress$2(value), 32);
|
|
22963
22958
|
};
|
|
22964
22959
|
case "bool": return function (value) {
|
|
22965
22960
|
return ((!value) ? hexFalse$1 : hexTrue$1);
|
|
22966
22961
|
};
|
|
22967
22962
|
case "bytes": return function (value) {
|
|
22968
|
-
return keccak256$
|
|
22963
|
+
return keccak256$2(value);
|
|
22969
22964
|
};
|
|
22970
22965
|
case "string": return function (value) {
|
|
22971
22966
|
return id$1(value);
|
|
@@ -23081,9 +23076,9 @@ class TypedDataEncoder$1 {
|
|
|
23081
23076
|
}
|
|
23082
23077
|
let result = value.map(subEncoder);
|
|
23083
23078
|
if (this._types[subtype]) {
|
|
23084
|
-
result = result.map(keccak256$
|
|
23079
|
+
result = result.map(keccak256$2);
|
|
23085
23080
|
}
|
|
23086
|
-
return keccak256$
|
|
23081
|
+
return keccak256$2(hexConcat$1(result));
|
|
23087
23082
|
};
|
|
23088
23083
|
}
|
|
23089
23084
|
// Struct
|
|
@@ -23094,7 +23089,7 @@ class TypedDataEncoder$1 {
|
|
|
23094
23089
|
const values = fields.map(({ name, type }) => {
|
|
23095
23090
|
const result = this.getEncoder(type)(value[name]);
|
|
23096
23091
|
if (this._types[type]) {
|
|
23097
|
-
return keccak256$
|
|
23092
|
+
return keccak256$2(result);
|
|
23098
23093
|
}
|
|
23099
23094
|
return result;
|
|
23100
23095
|
});
|
|
@@ -23115,7 +23110,7 @@ class TypedDataEncoder$1 {
|
|
|
23115
23110
|
return this.getEncoder(type)(value);
|
|
23116
23111
|
}
|
|
23117
23112
|
hashStruct(name, value) {
|
|
23118
|
-
return keccak256$
|
|
23113
|
+
return keccak256$2(this.encodeData(name, value));
|
|
23119
23114
|
}
|
|
23120
23115
|
encode(value) {
|
|
23121
23116
|
return this.encodeData(this.primaryType, value);
|
|
@@ -23185,7 +23180,7 @@ class TypedDataEncoder$1 {
|
|
|
23185
23180
|
]);
|
|
23186
23181
|
}
|
|
23187
23182
|
static hash(domain, types, value) {
|
|
23188
|
-
return keccak256$
|
|
23183
|
+
return keccak256$2(TypedDataEncoder$1.encode(domain, types, value));
|
|
23189
23184
|
}
|
|
23190
23185
|
// Replaces all address types with ENS names with their looked up address
|
|
23191
23186
|
static resolveNames(domain, types, value, resolveName) {
|
|
@@ -27176,7 +27171,7 @@ var EC$1$1 = elliptic_1$1.ec;
|
|
|
27176
27171
|
|
|
27177
27172
|
const version$2$3 = "signing-key/5.4.0";
|
|
27178
27173
|
|
|
27179
|
-
const logger$5$
|
|
27174
|
+
const logger$5$2 = new Logger$3(version$2$3);
|
|
27180
27175
|
let _curve$1 = null;
|
|
27181
27176
|
function getCurve$1() {
|
|
27182
27177
|
if (!_curve$1) {
|
|
@@ -27202,7 +27197,7 @@ class SigningKey$1 {
|
|
|
27202
27197
|
const keyPair = getCurve$1().keyFromPrivate(arrayify$2(this.privateKey));
|
|
27203
27198
|
const digestBytes = arrayify$2(digest);
|
|
27204
27199
|
if (digestBytes.length !== 32) {
|
|
27205
|
-
logger$5$
|
|
27200
|
+
logger$5$2.throwArgumentError("bad digest length", "digest", digest);
|
|
27206
27201
|
}
|
|
27207
27202
|
const signature = keyPair.sign(digestBytes, { canonical: true });
|
|
27208
27203
|
return splitSignature$1({
|
|
@@ -27246,7 +27241,7 @@ function computePublicKey$1(key, compressed) {
|
|
|
27246
27241
|
}
|
|
27247
27242
|
return "0x" + getCurve$1().keyFromPublic(bytes).getPublic(true, "hex");
|
|
27248
27243
|
}
|
|
27249
|
-
return logger$5$
|
|
27244
|
+
return logger$5$2.throwArgumentError("invalid public or private key", "key", "[REDACTED]");
|
|
27250
27245
|
}
|
|
27251
27246
|
|
|
27252
27247
|
const version$1$3 = "transactions/5.4.0";
|
|
@@ -27263,7 +27258,7 @@ function handleAddress$1(value) {
|
|
|
27263
27258
|
if (value === "0x") {
|
|
27264
27259
|
return null;
|
|
27265
27260
|
}
|
|
27266
|
-
return getAddress$
|
|
27261
|
+
return getAddress$2(value);
|
|
27267
27262
|
}
|
|
27268
27263
|
function handleNumber$1(value) {
|
|
27269
27264
|
if (value === "0x") {
|
|
@@ -27273,7 +27268,7 @@ function handleNumber$1(value) {
|
|
|
27273
27268
|
}
|
|
27274
27269
|
function computeAddress$1(key) {
|
|
27275
27270
|
const publicKey = computePublicKey$1(key);
|
|
27276
|
-
return getAddress$
|
|
27271
|
+
return getAddress$2(hexDataSlice$1(keccak256$2(hexDataSlice$1(publicKey, 1)), 12));
|
|
27277
27272
|
}
|
|
27278
27273
|
function recoverAddress$1(digest, signature) {
|
|
27279
27274
|
return computeAddress$1(recoverPublicKey$1(arrayify$2(digest), signature));
|
|
@@ -27287,7 +27282,7 @@ function formatNumber$1(value, name) {
|
|
|
27287
27282
|
}
|
|
27288
27283
|
function accessSetify$1(addr, storageKeys) {
|
|
27289
27284
|
return {
|
|
27290
|
-
address: getAddress$
|
|
27285
|
+
address: getAddress$2(addr),
|
|
27291
27286
|
storageKeys: (storageKeys || []).map((storageKey, index) => {
|
|
27292
27287
|
if (hexDataLength$1(storageKey) !== 32) {
|
|
27293
27288
|
logger$4$2.throwArgumentError("invalid access list storageKey", `accessList[${addr}:${index}]`, storageKey);
|
|
@@ -27340,7 +27335,7 @@ function _serializeEip1559$1(transaction, signature) {
|
|
|
27340
27335
|
formatNumber$1(transaction.maxPriorityFeePerGas || 0, "maxPriorityFeePerGas"),
|
|
27341
27336
|
formatNumber$1(transaction.maxFeePerGas || 0, "maxFeePerGas"),
|
|
27342
27337
|
formatNumber$1(transaction.gasLimit || 0, "gasLimit"),
|
|
27343
|
-
((transaction.to != null) ? getAddress$
|
|
27338
|
+
((transaction.to != null) ? getAddress$2(transaction.to) : "0x"),
|
|
27344
27339
|
formatNumber$1(transaction.value || 0, "value"),
|
|
27345
27340
|
(transaction.data || "0x"),
|
|
27346
27341
|
(formatAccessList$1(transaction.accessList || []))
|
|
@@ -27359,7 +27354,7 @@ function _serializeEip2930$1(transaction, signature) {
|
|
|
27359
27354
|
formatNumber$1(transaction.nonce || 0, "nonce"),
|
|
27360
27355
|
formatNumber$1(transaction.gasPrice || 0, "gasPrice"),
|
|
27361
27356
|
formatNumber$1(transaction.gasLimit || 0, "gasLimit"),
|
|
27362
|
-
((transaction.to != null) ? getAddress$
|
|
27357
|
+
((transaction.to != null) ? getAddress$2(transaction.to) : "0x"),
|
|
27363
27358
|
formatNumber$1(transaction.value || 0, "value"),
|
|
27364
27359
|
(transaction.data || "0x"),
|
|
27365
27360
|
(formatAccessList$1(transaction.accessList || []))
|
|
@@ -27386,7 +27381,7 @@ function _parseEipSignature$1(tx, fields, serialize) {
|
|
|
27386
27381
|
tx.r = hexZeroPad$2(fields[1], 32);
|
|
27387
27382
|
tx.s = hexZeroPad$2(fields[2], 32);
|
|
27388
27383
|
try {
|
|
27389
|
-
const digest = keccak256$
|
|
27384
|
+
const digest = keccak256$2(serialize(tx));
|
|
27390
27385
|
tx.from = recoverAddress$1(digest, { r: tx.r, s: tx.s, recoveryParam: tx.v });
|
|
27391
27386
|
}
|
|
27392
27387
|
catch (error) {
|
|
@@ -27417,7 +27412,7 @@ function _parseEip1559$1(payload) {
|
|
|
27417
27412
|
if (transaction.length === 9) {
|
|
27418
27413
|
return tx;
|
|
27419
27414
|
}
|
|
27420
|
-
tx.hash = keccak256$
|
|
27415
|
+
tx.hash = keccak256$2(payload);
|
|
27421
27416
|
_parseEipSignature$1(tx, transaction.slice(9), _serializeEip1559$1);
|
|
27422
27417
|
return tx;
|
|
27423
27418
|
}
|
|
@@ -27441,7 +27436,7 @@ function _parseEip2930$1(payload) {
|
|
|
27441
27436
|
if (transaction.length === 8) {
|
|
27442
27437
|
return tx;
|
|
27443
27438
|
}
|
|
27444
|
-
tx.hash = keccak256$
|
|
27439
|
+
tx.hash = keccak256$2(payload);
|
|
27445
27440
|
_parseEipSignature$1(tx, transaction.slice(8), _serializeEip2930$1);
|
|
27446
27441
|
return tx;
|
|
27447
27442
|
}
|
|
@@ -27492,14 +27487,14 @@ function _parse$1(rawTransaction) {
|
|
|
27492
27487
|
raw.push("0x");
|
|
27493
27488
|
recoveryParam -= tx.chainId * 2 + 8;
|
|
27494
27489
|
}
|
|
27495
|
-
const digest = keccak256$
|
|
27490
|
+
const digest = keccak256$2(encode$1$1(raw));
|
|
27496
27491
|
try {
|
|
27497
27492
|
tx.from = recoverAddress$1(digest, { r: hexlify$3(tx.r), s: hexlify$3(tx.s), recoveryParam: recoveryParam });
|
|
27498
27493
|
}
|
|
27499
27494
|
catch (error) {
|
|
27500
27495
|
console.log(error);
|
|
27501
27496
|
}
|
|
27502
|
-
tx.hash = keccak256$
|
|
27497
|
+
tx.hash = keccak256$2(rawTransaction);
|
|
27503
27498
|
}
|
|
27504
27499
|
tx.type = null;
|
|
27505
27500
|
return tx;
|
|
@@ -27701,13 +27696,13 @@ class Formatter$1 {
|
|
|
27701
27696
|
// Requires an address
|
|
27702
27697
|
// Strict! Used on input.
|
|
27703
27698
|
address(value) {
|
|
27704
|
-
return getAddress$
|
|
27699
|
+
return getAddress$2(value);
|
|
27705
27700
|
}
|
|
27706
27701
|
callAddress(value) {
|
|
27707
27702
|
if (!isHexString$3(value, 32)) {
|
|
27708
27703
|
return null;
|
|
27709
27704
|
}
|
|
27710
|
-
const address = getAddress$
|
|
27705
|
+
const address = getAddress$2(hexDataSlice$1(value, 12));
|
|
27711
27706
|
return (address === AddressZero$1) ? null : address;
|
|
27712
27707
|
}
|
|
27713
27708
|
contractAddress(value) {
|
|
@@ -30526,6 +30521,8 @@ let balance = ({ address, provider }) => {
|
|
|
30526
30521
|
var request$1 = async ({ provider, address, api, method, params }) => {
|
|
30527
30522
|
if (api) {
|
|
30528
30523
|
return contractCall({ address, api, method, params, provider })
|
|
30524
|
+
} else if (method === 'latestBlockNumber') {
|
|
30525
|
+
return provider.getBlockNumber()
|
|
30529
30526
|
} else if (method === 'balance') {
|
|
30530
30527
|
return balance({ address, provider })
|
|
30531
30528
|
}
|
|
@@ -30582,8 +30579,20 @@ var parseUrl = (url) => {
|
|
|
30582
30579
|
if (typeof url == 'object') {
|
|
30583
30580
|
return url
|
|
30584
30581
|
}
|
|
30585
|
-
let deconstructed = url.match(/(?<blockchain>\w+):\/\/(?<
|
|
30586
|
-
|
|
30582
|
+
let deconstructed = url.match(/(?<blockchain>\w+):\/\/(?<part1>[\w\d]+)(\/(?<part2>[\w\d]+))?/);
|
|
30583
|
+
|
|
30584
|
+
if(deconstructed.groups.part2 == undefined) {
|
|
30585
|
+
return {
|
|
30586
|
+
blockchain: deconstructed.groups.blockchain,
|
|
30587
|
+
method: deconstructed.groups.part1
|
|
30588
|
+
}
|
|
30589
|
+
} else {
|
|
30590
|
+
return {
|
|
30591
|
+
blockchain: deconstructed.groups.blockchain,
|
|
30592
|
+
address: deconstructed.groups.part1,
|
|
30593
|
+
method: deconstructed.groups.part2
|
|
30594
|
+
}
|
|
30595
|
+
}
|
|
30587
30596
|
};
|
|
30588
30597
|
|
|
30589
30598
|
let request = async function (url, options) {
|
|
@@ -35072,7 +35081,7 @@ function throwFault$1$1(fault, operation, value) {
|
|
|
35072
35081
|
return logger$o.throwError(fault, Logger$2.errors.NUMERIC_FAULT, params);
|
|
35073
35082
|
}
|
|
35074
35083
|
// value should have no prefix
|
|
35075
|
-
function _base36To16(value) {
|
|
35084
|
+
function _base36To16$1(value) {
|
|
35076
35085
|
return (new BN$2(value, 36)).toString(16);
|
|
35077
35086
|
}
|
|
35078
35087
|
|
|
@@ -36556,7 +36565,7 @@ class Reader {
|
|
|
36556
36565
|
* @license MIT
|
|
36557
36566
|
*/
|
|
36558
36567
|
|
|
36559
|
-
var sha3 = createCommonjsModule$1$1(function (module) {
|
|
36568
|
+
var sha3$2 = createCommonjsModule$1$1(function (module) {
|
|
36560
36569
|
/*jslint bitwise: true */
|
|
36561
36570
|
(function () {
|
|
36562
36571
|
|
|
@@ -37025,10 +37034,10 @@ var sha3 = createCommonjsModule$1$1(function (module) {
|
|
|
37025
37034
|
})();
|
|
37026
37035
|
});
|
|
37027
37036
|
|
|
37028
|
-
var sha3$1 = sha3;
|
|
37037
|
+
var sha3$1$1 = sha3$2;
|
|
37029
37038
|
|
|
37030
|
-
function keccak256(data) {
|
|
37031
|
-
return '0x' + sha3$1.keccak_256(arrayify$1(data));
|
|
37039
|
+
function keccak256$1(data) {
|
|
37040
|
+
return '0x' + sha3$1$1.keccak_256(arrayify$1(data));
|
|
37032
37041
|
}
|
|
37033
37042
|
|
|
37034
37043
|
const version$d = "rlp/5.4.0";
|
|
@@ -37151,7 +37160,7 @@ function decode$1(data) {
|
|
|
37151
37160
|
const version$c = "address/5.4.0";
|
|
37152
37161
|
|
|
37153
37162
|
const logger$i = new Logger$2(version$c);
|
|
37154
|
-
function getChecksumAddress(address) {
|
|
37163
|
+
function getChecksumAddress$1(address) {
|
|
37155
37164
|
if (!isHexString$2(address, 20)) {
|
|
37156
37165
|
logger$i.throwArgumentError("invalid address", "address", address);
|
|
37157
37166
|
}
|
|
@@ -37161,7 +37170,7 @@ function getChecksumAddress(address) {
|
|
|
37161
37170
|
for (let i = 0; i < 40; i++) {
|
|
37162
37171
|
expanded[i] = chars[i].charCodeAt(0);
|
|
37163
37172
|
}
|
|
37164
|
-
const hashed = arrayify$1(keccak256(expanded));
|
|
37173
|
+
const hashed = arrayify$1(keccak256$1(expanded));
|
|
37165
37174
|
for (let i = 0; i < 40; i += 2) {
|
|
37166
37175
|
if ((hashed[i >> 1] >> 4) >= 8) {
|
|
37167
37176
|
chars[i] = chars[i].toUpperCase();
|
|
@@ -37173,8 +37182,8 @@ function getChecksumAddress(address) {
|
|
|
37173
37182
|
return "0x" + chars.join("");
|
|
37174
37183
|
}
|
|
37175
37184
|
// Shims for environments that are missing some required constants and functions
|
|
37176
|
-
const MAX_SAFE_INTEGER$
|
|
37177
|
-
function log10$
|
|
37185
|
+
const MAX_SAFE_INTEGER$2 = 0x1fffffffffffff;
|
|
37186
|
+
function log10$2(x) {
|
|
37178
37187
|
if (Math.log10) {
|
|
37179
37188
|
return Math.log10(x);
|
|
37180
37189
|
}
|
|
@@ -37182,22 +37191,22 @@ function log10$1(x) {
|
|
|
37182
37191
|
}
|
|
37183
37192
|
// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number
|
|
37184
37193
|
// Create lookup table
|
|
37185
|
-
const ibanLookup = {};
|
|
37194
|
+
const ibanLookup$1 = {};
|
|
37186
37195
|
for (let i = 0; i < 10; i++) {
|
|
37187
|
-
ibanLookup[String(i)] = String(i);
|
|
37196
|
+
ibanLookup$1[String(i)] = String(i);
|
|
37188
37197
|
}
|
|
37189
37198
|
for (let i = 0; i < 26; i++) {
|
|
37190
|
-
ibanLookup[String.fromCharCode(65 + i)] = String(10 + i);
|
|
37199
|
+
ibanLookup$1[String.fromCharCode(65 + i)] = String(10 + i);
|
|
37191
37200
|
}
|
|
37192
37201
|
// How many decimal digits can we process? (for 64-bit float, this is 15)
|
|
37193
|
-
const safeDigits = Math.floor(log10$
|
|
37194
|
-
function ibanChecksum(address) {
|
|
37202
|
+
const safeDigits$1 = Math.floor(log10$2(MAX_SAFE_INTEGER$2));
|
|
37203
|
+
function ibanChecksum$1(address) {
|
|
37195
37204
|
address = address.toUpperCase();
|
|
37196
37205
|
address = address.substring(4) + address.substring(0, 2) + "00";
|
|
37197
|
-
let expanded = address.split("").map((c) => { return ibanLookup[c]; }).join("");
|
|
37206
|
+
let expanded = address.split("").map((c) => { return ibanLookup$1[c]; }).join("");
|
|
37198
37207
|
// Javascript can handle integers safely up to 15 (decimal) digits
|
|
37199
|
-
while (expanded.length >= safeDigits) {
|
|
37200
|
-
let block = expanded.substring(0, safeDigits);
|
|
37208
|
+
while (expanded.length >= safeDigits$1) {
|
|
37209
|
+
let block = expanded.substring(0, safeDigits$1);
|
|
37201
37210
|
expanded = parseInt(block, 10) % 97 + expanded.substring(block.length);
|
|
37202
37211
|
}
|
|
37203
37212
|
let checksum = String(98 - (parseInt(expanded, 10) % 97));
|
|
@@ -37206,7 +37215,7 @@ function ibanChecksum(address) {
|
|
|
37206
37215
|
}
|
|
37207
37216
|
return checksum;
|
|
37208
37217
|
}
|
|
37209
|
-
function getAddress(address) {
|
|
37218
|
+
function getAddress$1(address) {
|
|
37210
37219
|
let result = null;
|
|
37211
37220
|
if (typeof (address) !== "string") {
|
|
37212
37221
|
logger$i.throwArgumentError("invalid address", "address", address);
|
|
@@ -37216,7 +37225,7 @@ function getAddress(address) {
|
|
|
37216
37225
|
if (address.substring(0, 2) !== "0x") {
|
|
37217
37226
|
address = "0x" + address;
|
|
37218
37227
|
}
|
|
37219
|
-
result = getChecksumAddress(address);
|
|
37228
|
+
result = getChecksumAddress$1(address);
|
|
37220
37229
|
// It is a checksummed address with a bad checksum
|
|
37221
37230
|
if (address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) && result !== address) {
|
|
37222
37231
|
logger$i.throwArgumentError("bad address checksum", "address", address);
|
|
@@ -37225,14 +37234,14 @@ function getAddress(address) {
|
|
|
37225
37234
|
}
|
|
37226
37235
|
else if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {
|
|
37227
37236
|
// It is an ICAP address with a bad checksum
|
|
37228
|
-
if (address.substring(2, 4) !== ibanChecksum(address)) {
|
|
37237
|
+
if (address.substring(2, 4) !== ibanChecksum$1(address)) {
|
|
37229
37238
|
logger$i.throwArgumentError("bad icap checksum", "address", address);
|
|
37230
37239
|
}
|
|
37231
|
-
result = _base36To16(address.substring(4));
|
|
37240
|
+
result = _base36To16$1(address.substring(4));
|
|
37232
37241
|
while (result.length < 40) {
|
|
37233
37242
|
result = "0" + result;
|
|
37234
37243
|
}
|
|
37235
|
-
result = getChecksumAddress("0x" + result);
|
|
37244
|
+
result = getChecksumAddress$1("0x" + result);
|
|
37236
37245
|
}
|
|
37237
37246
|
else {
|
|
37238
37247
|
logger$i.throwArgumentError("invalid address", "address", address);
|
|
@@ -37243,13 +37252,13 @@ function getAddress(address) {
|
|
|
37243
37252
|
function getContractAddress(transaction) {
|
|
37244
37253
|
let from = null;
|
|
37245
37254
|
try {
|
|
37246
|
-
from = getAddress(transaction.from);
|
|
37255
|
+
from = getAddress$1(transaction.from);
|
|
37247
37256
|
}
|
|
37248
37257
|
catch (error) {
|
|
37249
37258
|
logger$i.throwArgumentError("missing from address", "transaction", transaction);
|
|
37250
37259
|
}
|
|
37251
37260
|
const nonce = stripZeros(arrayify$1(BigNumber$2.from(transaction.nonce).toHexString()));
|
|
37252
|
-
return getAddress(hexDataSlice(keccak256(encode$2([from, nonce])), 12));
|
|
37261
|
+
return getAddress$1(hexDataSlice(keccak256$1(encode$2([from, nonce])), 12));
|
|
37253
37262
|
}
|
|
37254
37263
|
|
|
37255
37264
|
class AddressCoder extends Coder {
|
|
@@ -37261,7 +37270,7 @@ class AddressCoder extends Coder {
|
|
|
37261
37270
|
}
|
|
37262
37271
|
encode(writer, value) {
|
|
37263
37272
|
try {
|
|
37264
|
-
value = getAddress(value);
|
|
37273
|
+
value = getAddress$1(value);
|
|
37265
37274
|
}
|
|
37266
37275
|
catch (error) {
|
|
37267
37276
|
this._throwError(error.message, value);
|
|
@@ -37269,7 +37278,7 @@ class AddressCoder extends Coder {
|
|
|
37269
37278
|
return writer.writeValue(value);
|
|
37270
37279
|
}
|
|
37271
37280
|
decode(reader) {
|
|
37272
|
-
return getAddress(hexZeroPad$1(reader.readValue().toHexString(), 20));
|
|
37281
|
+
return getAddress$1(hexZeroPad$1(reader.readValue().toHexString(), 20));
|
|
37273
37282
|
}
|
|
37274
37283
|
}
|
|
37275
37284
|
|
|
@@ -38175,7 +38184,7 @@ class AbiCoder {
|
|
|
38175
38184
|
const defaultAbiCoder = new AbiCoder();
|
|
38176
38185
|
|
|
38177
38186
|
function id(text) {
|
|
38178
|
-
return keccak256(toUtf8Bytes(text));
|
|
38187
|
+
return keccak256$1(toUtf8Bytes(text));
|
|
38179
38188
|
}
|
|
38180
38189
|
|
|
38181
38190
|
const version$a = "hash/5.4.0";
|
|
@@ -38197,7 +38206,7 @@ function namehash(name) {
|
|
|
38197
38206
|
logger$e.throwArgumentError("invalid ENS address; missing component", "name", name);
|
|
38198
38207
|
}
|
|
38199
38208
|
const label = toUtf8Bytes(nameprep(partition[3]));
|
|
38200
|
-
result = keccak256(concat([result, keccak256(label)]));
|
|
38209
|
+
result = keccak256$1(concat([result, keccak256$1(label)]));
|
|
38201
38210
|
current = partition[2] || "";
|
|
38202
38211
|
}
|
|
38203
38212
|
return hexlify$2(result);
|
|
@@ -38259,7 +38268,7 @@ const domainChecks = {
|
|
|
38259
38268
|
},
|
|
38260
38269
|
verifyingContract: function (value) {
|
|
38261
38270
|
try {
|
|
38262
|
-
return getAddress(value).toLowerCase();
|
|
38271
|
+
return getAddress$1(value).toLowerCase();
|
|
38263
38272
|
}
|
|
38264
38273
|
catch (error) { }
|
|
38265
38274
|
return logger$d.throwArgumentError(`invalid domain value "verifyingContract"`, "domain.verifyingContract", value);
|
|
@@ -38316,13 +38325,13 @@ function getBaseEncoder(type) {
|
|
|
38316
38325
|
}
|
|
38317
38326
|
switch (type) {
|
|
38318
38327
|
case "address": return function (value) {
|
|
38319
|
-
return hexZeroPad$1(getAddress(value), 32);
|
|
38328
|
+
return hexZeroPad$1(getAddress$1(value), 32);
|
|
38320
38329
|
};
|
|
38321
38330
|
case "bool": return function (value) {
|
|
38322
38331
|
return ((!value) ? hexFalse : hexTrue);
|
|
38323
38332
|
};
|
|
38324
38333
|
case "bytes": return function (value) {
|
|
38325
|
-
return keccak256(value);
|
|
38334
|
+
return keccak256$1(value);
|
|
38326
38335
|
};
|
|
38327
38336
|
case "string": return function (value) {
|
|
38328
38337
|
return id(value);
|
|
@@ -38438,9 +38447,9 @@ class TypedDataEncoder {
|
|
|
38438
38447
|
}
|
|
38439
38448
|
let result = value.map(subEncoder);
|
|
38440
38449
|
if (this._types[subtype]) {
|
|
38441
|
-
result = result.map(keccak256);
|
|
38450
|
+
result = result.map(keccak256$1);
|
|
38442
38451
|
}
|
|
38443
|
-
return keccak256(hexConcat(result));
|
|
38452
|
+
return keccak256$1(hexConcat(result));
|
|
38444
38453
|
};
|
|
38445
38454
|
}
|
|
38446
38455
|
// Struct
|
|
@@ -38451,7 +38460,7 @@ class TypedDataEncoder {
|
|
|
38451
38460
|
const values = fields.map(({ name, type }) => {
|
|
38452
38461
|
const result = this.getEncoder(type)(value[name]);
|
|
38453
38462
|
if (this._types[type]) {
|
|
38454
|
-
return keccak256(result);
|
|
38463
|
+
return keccak256$1(result);
|
|
38455
38464
|
}
|
|
38456
38465
|
return result;
|
|
38457
38466
|
});
|
|
@@ -38472,7 +38481,7 @@ class TypedDataEncoder {
|
|
|
38472
38481
|
return this.getEncoder(type)(value);
|
|
38473
38482
|
}
|
|
38474
38483
|
hashStruct(name, value) {
|
|
38475
|
-
return keccak256(this.encodeData(name, value));
|
|
38484
|
+
return keccak256$1(this.encodeData(name, value));
|
|
38476
38485
|
}
|
|
38477
38486
|
encode(value) {
|
|
38478
38487
|
return this.encodeData(this.primaryType, value);
|
|
@@ -38542,7 +38551,7 @@ class TypedDataEncoder {
|
|
|
38542
38551
|
]);
|
|
38543
38552
|
}
|
|
38544
38553
|
static hash(domain, types, value) {
|
|
38545
|
-
return keccak256(TypedDataEncoder.encode(domain, types, value));
|
|
38554
|
+
return keccak256$1(TypedDataEncoder.encode(domain, types, value));
|
|
38546
38555
|
}
|
|
38547
38556
|
// Replaces all address types with ENS names with their looked up address
|
|
38548
38557
|
static resolveNames(domain, types, value, resolveName) {
|
|
@@ -38750,7 +38759,7 @@ class Interface {
|
|
|
38750
38759
|
return defaultAbiCoder;
|
|
38751
38760
|
}
|
|
38752
38761
|
static getAddress(address) {
|
|
38753
|
-
return getAddress(address);
|
|
38762
|
+
return getAddress$1(address);
|
|
38754
38763
|
}
|
|
38755
38764
|
static getSighash(fragment) {
|
|
38756
38765
|
return hexDataSlice(id(fragment.format()), 0, 4);
|
|
@@ -38995,7 +39004,7 @@ class Interface {
|
|
|
38995
39004
|
return id(value);
|
|
38996
39005
|
}
|
|
38997
39006
|
else if (param.type === "bytes") {
|
|
38998
|
-
return keccak256(hexlify$2(value));
|
|
39007
|
+
return keccak256$1(hexlify$2(value));
|
|
38999
39008
|
}
|
|
39000
39009
|
// Check addresses are valid
|
|
39001
39010
|
if (param.type === "address") {
|
|
@@ -39050,7 +39059,7 @@ class Interface {
|
|
|
39050
39059
|
topics.push(id(value));
|
|
39051
39060
|
}
|
|
39052
39061
|
else if (param.type === "bytes") {
|
|
39053
|
-
topics.push(keccak256(value));
|
|
39062
|
+
topics.push(keccak256$1(value));
|
|
39054
39063
|
}
|
|
39055
39064
|
else if (param.baseType === "tuple" || param.baseType === "array") {
|
|
39056
39065
|
// @TOOD
|
|
@@ -46823,7 +46832,7 @@ function handleAddress(value) {
|
|
|
46823
46832
|
if (value === "0x") {
|
|
46824
46833
|
return null;
|
|
46825
46834
|
}
|
|
46826
|
-
return getAddress(value);
|
|
46835
|
+
return getAddress$1(value);
|
|
46827
46836
|
}
|
|
46828
46837
|
function handleNumber(value) {
|
|
46829
46838
|
if (value === "0x") {
|
|
@@ -46833,7 +46842,7 @@ function handleNumber(value) {
|
|
|
46833
46842
|
}
|
|
46834
46843
|
function computeAddress(key) {
|
|
46835
46844
|
const publicKey = computePublicKey(key);
|
|
46836
|
-
return getAddress(hexDataSlice(keccak256(hexDataSlice(publicKey, 1)), 12));
|
|
46845
|
+
return getAddress$1(hexDataSlice(keccak256$1(hexDataSlice(publicKey, 1)), 12));
|
|
46837
46846
|
}
|
|
46838
46847
|
function recoverAddress(digest, signature) {
|
|
46839
46848
|
return computeAddress(recoverPublicKey(arrayify$1(digest), signature));
|
|
@@ -46847,7 +46856,7 @@ function formatNumber(value, name) {
|
|
|
46847
46856
|
}
|
|
46848
46857
|
function accessSetify(addr, storageKeys) {
|
|
46849
46858
|
return {
|
|
46850
|
-
address: getAddress(addr),
|
|
46859
|
+
address: getAddress$1(addr),
|
|
46851
46860
|
storageKeys: (storageKeys || []).map((storageKey, index) => {
|
|
46852
46861
|
if (hexDataLength(storageKey) !== 32) {
|
|
46853
46862
|
logger$8.throwArgumentError("invalid access list storageKey", `accessList[${addr}:${index}]`, storageKey);
|
|
@@ -46900,7 +46909,7 @@ function _serializeEip1559(transaction, signature) {
|
|
|
46900
46909
|
formatNumber(transaction.maxPriorityFeePerGas || 0, "maxPriorityFeePerGas"),
|
|
46901
46910
|
formatNumber(transaction.maxFeePerGas || 0, "maxFeePerGas"),
|
|
46902
46911
|
formatNumber(transaction.gasLimit || 0, "gasLimit"),
|
|
46903
|
-
((transaction.to != null) ? getAddress(transaction.to) : "0x"),
|
|
46912
|
+
((transaction.to != null) ? getAddress$1(transaction.to) : "0x"),
|
|
46904
46913
|
formatNumber(transaction.value || 0, "value"),
|
|
46905
46914
|
(transaction.data || "0x"),
|
|
46906
46915
|
(formatAccessList(transaction.accessList || []))
|
|
@@ -46919,7 +46928,7 @@ function _serializeEip2930(transaction, signature) {
|
|
|
46919
46928
|
formatNumber(transaction.nonce || 0, "nonce"),
|
|
46920
46929
|
formatNumber(transaction.gasPrice || 0, "gasPrice"),
|
|
46921
46930
|
formatNumber(transaction.gasLimit || 0, "gasLimit"),
|
|
46922
|
-
((transaction.to != null) ? getAddress(transaction.to) : "0x"),
|
|
46931
|
+
((transaction.to != null) ? getAddress$1(transaction.to) : "0x"),
|
|
46923
46932
|
formatNumber(transaction.value || 0, "value"),
|
|
46924
46933
|
(transaction.data || "0x"),
|
|
46925
46934
|
(formatAccessList(transaction.accessList || []))
|
|
@@ -46946,7 +46955,7 @@ function _parseEipSignature(tx, fields, serialize) {
|
|
|
46946
46955
|
tx.r = hexZeroPad$1(fields[1], 32);
|
|
46947
46956
|
tx.s = hexZeroPad$1(fields[2], 32);
|
|
46948
46957
|
try {
|
|
46949
|
-
const digest = keccak256(serialize(tx));
|
|
46958
|
+
const digest = keccak256$1(serialize(tx));
|
|
46950
46959
|
tx.from = recoverAddress(digest, { r: tx.r, s: tx.s, recoveryParam: tx.v });
|
|
46951
46960
|
}
|
|
46952
46961
|
catch (error) {
|
|
@@ -46977,7 +46986,7 @@ function _parseEip1559(payload) {
|
|
|
46977
46986
|
if (transaction.length === 9) {
|
|
46978
46987
|
return tx;
|
|
46979
46988
|
}
|
|
46980
|
-
tx.hash = keccak256(payload);
|
|
46989
|
+
tx.hash = keccak256$1(payload);
|
|
46981
46990
|
_parseEipSignature(tx, transaction.slice(9), _serializeEip1559);
|
|
46982
46991
|
return tx;
|
|
46983
46992
|
}
|
|
@@ -47001,7 +47010,7 @@ function _parseEip2930(payload) {
|
|
|
47001
47010
|
if (transaction.length === 8) {
|
|
47002
47011
|
return tx;
|
|
47003
47012
|
}
|
|
47004
|
-
tx.hash = keccak256(payload);
|
|
47013
|
+
tx.hash = keccak256$1(payload);
|
|
47005
47014
|
_parseEipSignature(tx, transaction.slice(8), _serializeEip2930);
|
|
47006
47015
|
return tx;
|
|
47007
47016
|
}
|
|
@@ -47052,14 +47061,14 @@ function _parse(rawTransaction) {
|
|
|
47052
47061
|
raw.push("0x");
|
|
47053
47062
|
recoveryParam -= tx.chainId * 2 + 8;
|
|
47054
47063
|
}
|
|
47055
|
-
const digest = keccak256(encode$2(raw));
|
|
47064
|
+
const digest = keccak256$1(encode$2(raw));
|
|
47056
47065
|
try {
|
|
47057
47066
|
tx.from = recoverAddress(digest, { r: hexlify$2(tx.r), s: hexlify$2(tx.s), recoveryParam: recoveryParam });
|
|
47058
47067
|
}
|
|
47059
47068
|
catch (error) {
|
|
47060
47069
|
console.log(error);
|
|
47061
47070
|
}
|
|
47062
|
-
tx.hash = keccak256(rawTransaction);
|
|
47071
|
+
tx.hash = keccak256$1(rawTransaction);
|
|
47063
47072
|
}
|
|
47064
47073
|
tx.type = null;
|
|
47065
47074
|
return tx;
|
|
@@ -47083,7 +47092,7 @@ function parse(rawTransaction) {
|
|
|
47083
47092
|
});
|
|
47084
47093
|
}
|
|
47085
47094
|
|
|
47086
|
-
const version$5 = "contracts/5.4.1";
|
|
47095
|
+
const version$5$1 = "contracts/5.4.1";
|
|
47087
47096
|
|
|
47088
47097
|
var __awaiter$4 = function (thisArg, _arguments, P, generator) {
|
|
47089
47098
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -47094,13 +47103,13 @@ var __awaiter$4 = function (thisArg, _arguments, P, generator) {
|
|
|
47094
47103
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
47095
47104
|
});
|
|
47096
47105
|
};
|
|
47097
|
-
const logger$7 = new Logger$2(version$5);
|
|
47106
|
+
const logger$7 = new Logger$2(version$5$1);
|
|
47098
47107
|
function resolveName(resolver, nameOrPromise) {
|
|
47099
47108
|
return __awaiter$4(this, void 0, void 0, function* () {
|
|
47100
47109
|
const name = yield nameOrPromise;
|
|
47101
47110
|
// If it is already an address, just use it (after adding checksum)
|
|
47102
47111
|
try {
|
|
47103
|
-
return getAddress(name);
|
|
47112
|
+
return getAddress$1(name);
|
|
47104
47113
|
}
|
|
47105
47114
|
catch (error) { }
|
|
47106
47115
|
if (!resolver) {
|
|
@@ -47156,7 +47165,7 @@ function populateTransaction(contract, fragment, args) {
|
|
|
47156
47165
|
override: resolveName(contract.signer, overrides.from),
|
|
47157
47166
|
signer: contract.signer.getAddress()
|
|
47158
47167
|
}).then((check) => __awaiter$4(this, void 0, void 0, function* () {
|
|
47159
|
-
if (getAddress(check.signer) !== check.override) {
|
|
47168
|
+
if (getAddress$1(check.signer) !== check.override) {
|
|
47160
47169
|
logger$7.throwError("Contract with a Signer cannot override from", Logger$2.errors.UNSUPPORTED_OPERATION, {
|
|
47161
47170
|
operation: "overrides.from"
|
|
47162
47171
|
});
|
|
@@ -47585,7 +47594,7 @@ class BaseContract {
|
|
|
47585
47594
|
}
|
|
47586
47595
|
else {
|
|
47587
47596
|
try {
|
|
47588
|
-
defineReadOnly(this, "resolvedAddress", Promise.resolve(getAddress(addressOrName)));
|
|
47597
|
+
defineReadOnly(this, "resolvedAddress", Promise.resolve(getAddress$1(addressOrName)));
|
|
47589
47598
|
}
|
|
47590
47599
|
catch (error) {
|
|
47591
47600
|
// Without a provider, we cannot use ENS names
|
|
@@ -48349,7 +48358,7 @@ var __awaiter$2 = function (thisArg, _arguments, P, generator) {
|
|
|
48349
48358
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
48350
48359
|
});
|
|
48351
48360
|
};
|
|
48352
|
-
const logger$5 = new Logger$2(version$2$2);
|
|
48361
|
+
const logger$5$1 = new Logger$2(version$2$2);
|
|
48353
48362
|
function staller(duration) {
|
|
48354
48363
|
return new Promise((resolve) => {
|
|
48355
48364
|
setTimeout(resolve, duration);
|
|
@@ -48382,10 +48391,10 @@ function bodyify(value, type) {
|
|
|
48382
48391
|
function _fetchData(connection, body, processFunc) {
|
|
48383
48392
|
// How many times to retry in the event of a throttle
|
|
48384
48393
|
const attemptLimit = (typeof (connection) === "object" && connection.throttleLimit != null) ? connection.throttleLimit : 12;
|
|
48385
|
-
logger$5.assertArgument((attemptLimit > 0 && (attemptLimit % 1) === 0), "invalid connection throttle limit", "connection.throttleLimit", attemptLimit);
|
|
48394
|
+
logger$5$1.assertArgument((attemptLimit > 0 && (attemptLimit % 1) === 0), "invalid connection throttle limit", "connection.throttleLimit", attemptLimit);
|
|
48386
48395
|
const throttleCallback = ((typeof (connection) === "object") ? connection.throttleCallback : null);
|
|
48387
48396
|
const throttleSlotInterval = ((typeof (connection) === "object" && typeof (connection.throttleSlotInterval) === "number") ? connection.throttleSlotInterval : 100);
|
|
48388
|
-
logger$5.assertArgument((throttleSlotInterval > 0 && (throttleSlotInterval % 1) === 0), "invalid connection throttle slot interval", "connection.throttleSlotInterval", throttleSlotInterval);
|
|
48397
|
+
logger$5$1.assertArgument((throttleSlotInterval > 0 && (throttleSlotInterval % 1) === 0), "invalid connection throttle slot interval", "connection.throttleSlotInterval", throttleSlotInterval);
|
|
48389
48398
|
const headers = {};
|
|
48390
48399
|
let url = null;
|
|
48391
48400
|
// @TODO: Allow ConnectionInfo to override some of these values
|
|
@@ -48399,7 +48408,7 @@ function _fetchData(connection, body, processFunc) {
|
|
|
48399
48408
|
}
|
|
48400
48409
|
else if (typeof (connection) === "object") {
|
|
48401
48410
|
if (connection == null || connection.url == null) {
|
|
48402
|
-
logger$5.throwArgumentError("missing URL", "connection.url", connection);
|
|
48411
|
+
logger$5$1.throwArgumentError("missing URL", "connection.url", connection);
|
|
48403
48412
|
}
|
|
48404
48413
|
url = connection.url;
|
|
48405
48414
|
if (typeof (connection.timeout) === "number" && connection.timeout > 0) {
|
|
@@ -48416,7 +48425,7 @@ function _fetchData(connection, body, processFunc) {
|
|
|
48416
48425
|
options.allowGzip = !!connection.allowGzip;
|
|
48417
48426
|
if (connection.user != null && connection.password != null) {
|
|
48418
48427
|
if (url.substring(0, 6) !== "https:" && connection.allowInsecureAuthentication !== true) {
|
|
48419
|
-
logger$5.throwError("basic authentication requires a secure https url", Logger$2.errors.INVALID_ARGUMENT, { argument: "url", url: url, user: connection.user, password: "[REDACTED]" });
|
|
48428
|
+
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]" });
|
|
48420
48429
|
}
|
|
48421
48430
|
const authorization = connection.user + ":" + connection.password;
|
|
48422
48431
|
headers["authorization"] = {
|
|
@@ -48450,7 +48459,7 @@ function _fetchData(connection, body, processFunc) {
|
|
|
48450
48459
|
return;
|
|
48451
48460
|
}
|
|
48452
48461
|
timer = null;
|
|
48453
|
-
reject(logger$5.makeError("timeout", Logger$2.errors.TIMEOUT, {
|
|
48462
|
+
reject(logger$5$1.makeError("timeout", Logger$2.errors.TIMEOUT, {
|
|
48454
48463
|
requestBody: bodyify(options.body, flatHeaders["content-type"]),
|
|
48455
48464
|
requestMethod: options.method,
|
|
48456
48465
|
timeout: timeout,
|
|
@@ -48499,7 +48508,7 @@ function _fetchData(connection, body, processFunc) {
|
|
|
48499
48508
|
response = error.response;
|
|
48500
48509
|
if (response == null) {
|
|
48501
48510
|
runningTimeout.cancel();
|
|
48502
|
-
logger$5.throwError("missing response", Logger$2.errors.SERVER_ERROR, {
|
|
48511
|
+
logger$5$1.throwError("missing response", Logger$2.errors.SERVER_ERROR, {
|
|
48503
48512
|
requestBody: bodyify(options.body, flatHeaders["content-type"]),
|
|
48504
48513
|
requestMethod: options.method,
|
|
48505
48514
|
serverError: error,
|
|
@@ -48513,7 +48522,7 @@ function _fetchData(connection, body, processFunc) {
|
|
|
48513
48522
|
}
|
|
48514
48523
|
else if (response.statusCode < 200 || response.statusCode >= 300) {
|
|
48515
48524
|
runningTimeout.cancel();
|
|
48516
|
-
logger$5.throwError("bad response", Logger$2.errors.SERVER_ERROR, {
|
|
48525
|
+
logger$5$1.throwError("bad response", Logger$2.errors.SERVER_ERROR, {
|
|
48517
48526
|
status: response.statusCode,
|
|
48518
48527
|
headers: response.headers,
|
|
48519
48528
|
body: bodyify(body, ((response.headers) ? response.headers["content-type"] : null)),
|
|
@@ -48543,7 +48552,7 @@ function _fetchData(connection, body, processFunc) {
|
|
|
48543
48552
|
}
|
|
48544
48553
|
}
|
|
48545
48554
|
runningTimeout.cancel();
|
|
48546
|
-
logger$5.throwError("processing response error", Logger$2.errors.SERVER_ERROR, {
|
|
48555
|
+
logger$5$1.throwError("processing response error", Logger$2.errors.SERVER_ERROR, {
|
|
48547
48556
|
body: bodyify(body, ((response.headers) ? response.headers["content-type"] : null)),
|
|
48548
48557
|
error: error,
|
|
48549
48558
|
requestBody: bodyify(options.body, flatHeaders["content-type"]),
|
|
@@ -48557,7 +48566,7 @@ function _fetchData(connection, body, processFunc) {
|
|
|
48557
48566
|
// The "body" is now a Uint8Array.
|
|
48558
48567
|
return body;
|
|
48559
48568
|
}
|
|
48560
|
-
return logger$5.throwError("failed response", Logger$2.errors.SERVER_ERROR, {
|
|
48569
|
+
return logger$5$1.throwError("failed response", Logger$2.errors.SERVER_ERROR, {
|
|
48561
48570
|
requestBody: bodyify(options.body, flatHeaders["content-type"]),
|
|
48562
48571
|
requestMethod: options.method,
|
|
48563
48572
|
url: url
|
|
@@ -48574,7 +48583,7 @@ function fetchJson(connection, json, processFunc) {
|
|
|
48574
48583
|
result = JSON.parse(toUtf8String(value));
|
|
48575
48584
|
}
|
|
48576
48585
|
catch (error) {
|
|
48577
|
-
logger$5.throwError("invalid JSON", Logger$2.errors.SERVER_ERROR, {
|
|
48586
|
+
logger$5$1.throwError("invalid JSON", Logger$2.errors.SERVER_ERROR, {
|
|
48578
48587
|
body: value,
|
|
48579
48588
|
error: error
|
|
48580
48589
|
});
|
|
@@ -49049,13 +49058,13 @@ class Formatter {
|
|
|
49049
49058
|
// Requires an address
|
|
49050
49059
|
// Strict! Used on input.
|
|
49051
49060
|
address(value) {
|
|
49052
|
-
return getAddress(value);
|
|
49061
|
+
return getAddress$1(value);
|
|
49053
49062
|
}
|
|
49054
49063
|
callAddress(value) {
|
|
49055
49064
|
if (!isHexString$2(value, 32)) {
|
|
49056
49065
|
return null;
|
|
49057
49066
|
}
|
|
49058
|
-
const address = getAddress(hexDataSlice(value, 12));
|
|
49067
|
+
const address = getAddress$1(hexDataSlice(value, 12));
|
|
49059
49068
|
return (address === AddressZero) ? null : address;
|
|
49060
49069
|
}
|
|
49061
49070
|
contractAddress(value) {
|
|
@@ -51564,10 +51573,11 @@ function parseUnits$1(value, unitName) {
|
|
|
51564
51573
|
function _optionalChain$5(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
51565
51574
|
class Transaction {
|
|
51566
51575
|
|
|
51567
|
-
constructor({ blockchain, from, to, api, method, params, value, sent, confirmed, ensured, failed }) {
|
|
51576
|
+
constructor({ blockchain, from, nonce, to, api, method, params, value, sent, confirmed, ensured, failed }) {
|
|
51568
51577
|
|
|
51569
51578
|
this.blockchain = blockchain;
|
|
51570
51579
|
this.from = from;
|
|
51580
|
+
this.nonce = nonce;
|
|
51571
51581
|
this.to = to;
|
|
51572
51582
|
this.api = api;
|
|
51573
51583
|
this.method = method;
|
|
@@ -51675,6 +51685,7 @@ const sendTransaction$1 = async ({ transaction, wallet })=> {
|
|
|
51675
51685
|
await executeSubmit$1({ transaction, provider, signer }).then((sentTransaction)=>{
|
|
51676
51686
|
if (sentTransaction) {
|
|
51677
51687
|
transaction.id = sentTransaction.hash;
|
|
51688
|
+
transaction.nonce = sentTransaction.nonce;
|
|
51678
51689
|
transaction.url = Blockchain.findByName(transaction.blockchain).explorerUrlFor({ transaction });
|
|
51679
51690
|
if (transaction.sent) transaction.sent(transaction);
|
|
51680
51691
|
sentTransaction.wait(1).then(() => {
|
|
@@ -51875,6 +51886,7 @@ const sendTransaction = async ({ transaction, wallet })=> {
|
|
|
51875
51886
|
transaction.url = blockchain.explorerUrlFor({ transaction });
|
|
51876
51887
|
if (transaction.sent) transaction.sent(transaction);
|
|
51877
51888
|
let sentTransaction = await retrieveTransaction(tx, transaction.blockchain);
|
|
51889
|
+
transaction.nonce = sentTransaction.nonce;
|
|
51878
51890
|
if(!sentTransaction) {
|
|
51879
51891
|
transaction._failed = true;
|
|
51880
51892
|
console.log('Error retrieving transaction');
|
|
@@ -52162,7 +52174,7 @@ var SelectWalletDialog = (function (props) {
|
|
|
52162
52174
|
return connect(wallet);
|
|
52163
52175
|
}
|
|
52164
52176
|
}, /*#__PURE__*/react.createElement("div", {
|
|
52165
|
-
className: "CardImage
|
|
52177
|
+
className: "CardImage"
|
|
52166
52178
|
}, /*#__PURE__*/react.createElement("img", {
|
|
52167
52179
|
src: wallet.logo
|
|
52168
52180
|
})), /*#__PURE__*/react.createElement("div", {
|
|
@@ -52175,9 +52187,9 @@ var SelectWalletDialog = (function (props) {
|
|
|
52175
52187
|
});
|
|
52176
52188
|
return /*#__PURE__*/react.createElement(Dialog, {
|
|
52177
52189
|
header: /*#__PURE__*/react.createElement("div", {
|
|
52178
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
52190
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
52179
52191
|
}, /*#__PURE__*/react.createElement("h1", {
|
|
52180
|
-
className: "LineHeightL FontSizeL
|
|
52192
|
+
className: "LineHeightL FontSizeL"
|
|
52181
52193
|
}, "Select a wallet")),
|
|
52182
52194
|
body: /*#__PURE__*/react.createElement("div", {
|
|
52183
52195
|
className: "PaddingTopS PaddingBottomXS PaddingLeftS PaddingRightS"
|
|
@@ -52185,11 +52197,13 @@ var SelectWalletDialog = (function (props) {
|
|
|
52185
52197
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
52186
52198
|
className: "PaddingBottomS"
|
|
52187
52199
|
}, /*#__PURE__*/react.createElement("button", {
|
|
52188
|
-
className: "FontSizeS FontWeightBold
|
|
52200
|
+
className: "FontSizeS FontWeightBold TextButton",
|
|
52189
52201
|
onClick: function onClick() {
|
|
52190
52202
|
return setShowExplanation(!showExplanation);
|
|
52191
52203
|
}
|
|
52192
|
-
}, /*#__PURE__*/react.createElement("strong",
|
|
52204
|
+
}, /*#__PURE__*/react.createElement("strong", {
|
|
52205
|
+
className: "Opacity05"
|
|
52206
|
+
}, "What is a wallet?")), showExplanation && /*#__PURE__*/react.createElement("p", {
|
|
52193
52207
|
className: "PaddingLeftM PaddingRightM"
|
|
52194
52208
|
}, "Wallets are used to send, receive, and store digital assets. Wallets come in many forms. They are either built into your browser, an extension added to your browser, a piece of hardware plugged into your computer or even an app on your phone."))
|
|
52195
52209
|
});
|
|
@@ -52342,6 +52356,9 @@ function _defineProperties(target, props) {
|
|
|
52342
52356
|
function _createClass$1(Constructor, protoProps, staticProps) {
|
|
52343
52357
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
52344
52358
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
52359
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
52360
|
+
writable: false
|
|
52361
|
+
});
|
|
52345
52362
|
return Constructor;
|
|
52346
52363
|
}
|
|
52347
52364
|
|
|
@@ -52359,12 +52376,15 @@ function _inherits$1(subClass, superClass) {
|
|
|
52359
52376
|
throw new TypeError("Super expression must either be null or a function");
|
|
52360
52377
|
}
|
|
52361
52378
|
|
|
52362
|
-
|
|
52363
|
-
|
|
52364
|
-
|
|
52365
|
-
|
|
52366
|
-
|
|
52367
|
-
|
|
52379
|
+
Object.defineProperty(subClass, "prototype", {
|
|
52380
|
+
value: Object.create(superClass && superClass.prototype, {
|
|
52381
|
+
constructor: {
|
|
52382
|
+
value: subClass,
|
|
52383
|
+
writable: true,
|
|
52384
|
+
configurable: true
|
|
52385
|
+
}
|
|
52386
|
+
}),
|
|
52387
|
+
writable: false
|
|
52368
52388
|
});
|
|
52369
52389
|
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
52370
52390
|
}
|
|
@@ -52467,7 +52487,7 @@ var ErrorProvider = (function (props) {
|
|
|
52467
52487
|
})), /*#__PURE__*/react.createElement("div", {
|
|
52468
52488
|
className: "DialogBody"
|
|
52469
52489
|
}, /*#__PURE__*/react.createElement("div", {
|
|
52470
|
-
className: "GraphicWrapper"
|
|
52490
|
+
className: "GraphicWrapper PaddingTopS"
|
|
52471
52491
|
}, /*#__PURE__*/react.createElement("img", {
|
|
52472
52492
|
className: "Graphic",
|
|
52473
52493
|
src: ErrorGraphic
|
|
@@ -52485,15 +52505,12 @@ var ErrorProvider = (function (props) {
|
|
|
52485
52505
|
className: "FontSizeM PaddingTopS"
|
|
52486
52506
|
}, "If this keeps happening, please report it.")))), /*#__PURE__*/react.createElement("div", {
|
|
52487
52507
|
className: "DialogFooter"
|
|
52488
|
-
}, /*#__PURE__*/react.createElement("div",
|
|
52508
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
52509
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
52510
|
+
}, /*#__PURE__*/react.createElement("button", {
|
|
52489
52511
|
className: "ButtonPrimary",
|
|
52490
52512
|
onClick: close
|
|
52491
|
-
}, "Try again"))
|
|
52492
|
-
href: 'https://depay.fi?utm_source=' + window.location.hostname + '&utm_medium=widget&utm_campaign=WidgetV2',
|
|
52493
|
-
rel: "noopener noreferrer",
|
|
52494
|
-
target: "_blank",
|
|
52495
|
-
className: "FooterLink"
|
|
52496
|
-
}, "by DePay"))));
|
|
52513
|
+
}, "Try again")))));
|
|
52497
52514
|
} else {
|
|
52498
52515
|
return /*#__PURE__*/react.createElement(ErrorContext.Provider, {
|
|
52499
52516
|
value: {
|
|
@@ -52505,28 +52522,28 @@ var ErrorProvider = (function (props) {
|
|
|
52505
52522
|
}
|
|
52506
52523
|
});
|
|
52507
52524
|
|
|
52525
|
+
var BlockchainLogoStyle = (function (style) {
|
|
52526
|
+
return "\n\n .BlockchainLogo {\n border-radius: 999px;\n }\n\n .BlockchainLogo.small {\n height: 18px;\n width: 18px;\n }\n ";
|
|
52527
|
+
});
|
|
52528
|
+
|
|
52508
52529
|
var ButtonCircularStyle = (function () {
|
|
52509
52530
|
return "\n\n .ButtonCircular {\n border-radius: 99rem;\n cursor: pointer;\n height: 34px;\n opacity: 0.5;\n padding: 5px 4px 4px 4px;\n width: 34px;\n }\n\n .ButtonCircular:hover {\n background: rgba(0,0,0,0.1);\n opacity: 1;\n }\n\n .ButtonCircular:active {\n background: rgba(0,0,0,0.25);\n opacity: 1;\n }\n ";
|
|
52510
52531
|
});
|
|
52511
52532
|
|
|
52512
52533
|
var ButtonPrimaryStyle = (function (style) {
|
|
52513
|
-
return "\n\n .ButtonPrimary {\n align-items: center;\n align-self: center;\n background: ".concat(style.colors.primary, ";\n border-radius:
|
|
52534
|
+
return "\n\n .ButtonPrimary {\n align-items: center;\n align-self: center;\n background: ".concat(style.colors.primary, ";\n border-radius: 0.8rem;\n border: 1px solid transparent;\n box-shadow: 0 0 16px rgba(0,0,0,0.1);\n font-size: 1.3rem;\n font-weight: 400;\n line-height: 2.8rem;\n height: 3.6rem;\n justify-content: center;\n width: 100%;\n overflow: hidden;\n padding: 0.4rem 0;\n position: relative;\n text-align: center;\n text-decoration: none;\n text-overflow: ellipsis;\n transition: background 0.1s;\n vertical-align: middle;\n display: inline-block;\n }\n\n .ButtonPrimary, .ButtonPrimary * {\n color: ").concat(style.colors.buttonText, ";\n }\n\n .ButtonPrimary.disabled {\n background: rgb(210,210,210);\n color: rgb(140,140,140);\n }\n\n .ButtonPrimary:not(.disabled){\n cursor: pointer;\n }\n .ButtonPrimary:not(.disabled):hover {\n box-shadow: inset 0 0 300px rgba(0,0,0,0.1);\n }\n .ButtonPrimary:not(.disabled):active {\n box-shadow: inset 0 0 300px rgba(0,0,0,0.2);\n }\n ");
|
|
52514
52535
|
});
|
|
52515
52536
|
|
|
52516
52537
|
var CardStyle = (function (style) {
|
|
52517
|
-
return "\n\n .Card {\n align-items: center;\n background: rgb(255,255,255);\n border-radius: 0.8rem;\n box-shadow: 0 0 8px rgba(0,0,0,0.03);\n cursor: pointer;\n display: flex;\n flex-direction: row;\n margin-bottom: 0.5rem;\n min-height: 4.78rem;\n padding: 1rem 0.6rem;\n width: 100%;\n }\n\n a.Card, a.Card * {\n color: inherit;\n text-decoration: none;\n }\n\n .Card.small {\n min-height: auto;\n padding: 0.
|
|
52538
|
+
return "\n\n .Card {\n align-items: center;\n background: rgb(255,255,255);\n border-radius: 0.8rem;\n box-shadow: 0 0 8px rgba(0,0,0,0.03);\n cursor: pointer;\n display: flex;\n flex-direction: row;\n margin-bottom: 0.5rem;\n min-height: 4.78rem;\n padding: 1rem 0.6rem;\n width: 100%;\n }\n\n a.Card, a.Card * {\n color: inherit;\n text-decoration: none;\n }\n\n .Card.transparent {\n background: none;\n box-shadow: none;\n }\n\n .Card.small {\n min-height: auto;\n padding: 0.5rem 0.5rem;\n margin: 0;\n }\n\n .Card.disabled {\n cursor: default;\n }\n\n .Card:hover:not(.disabled) {\n background: rgb(240,240,240);\n box-shadow: 0 0 0 rgba(0,0,0,0); \n }\n\n .Card:active:not(.disabled) {\n background: rgb(235,235,235);\n box-shadow: inset 0 0 6px rgba(0,0,0,0.02);\n color: inherit;\n }\n\n .Card:hover:not(.disabled) .CardAction {\n opacity: 0.4;\n }\n\n .CardImage, .CardBody, .CardAction, .CardInfo {\n align-items: center;\n display: flex;\n min-width: 0;\n padding: 0 0.4rem;\n }\n\n .CardImage {\n flex-basis: auto;\n flex-grow: 0;\n flex-shrink: 0;\n justify-content: center;\n position: relative;\n width: 3.6rem;\n }\n\n .CardBody {\n flex-basis: auto;\n flex-grow: 1;\n flex-shrink: 1;\n line-height: 1.4rem;\n padding-left: 0.6rem;\n text-align: left;\n }\n\n .CardBodyWrapper {\n min-width: 0;\n }\n\n .CardAction {\n flex-basis: auto;\n flex-shrink: 0;\n flex-grow: 0;\n padding-right: 0;\n margin-left: auto;\n }\n\n .Card.disabled .CardAction {\n opacity: 0; \n }\n\n .CardInfo {\n display: flex;\n flex-basis: auto;\n flex-direction: column;\n flex-grow: 0;\n flex-shrink: 1;\n justify-content: center;\n margin-left: auto; \n padding-right: 0;\n }\n\n .CardImage img {\n background: white;\n border-radius: 99rem;\n border: 1px solid white;\n box-shadow: 0 2px 8px rgb(0 0 0 / 10%);\n height: 2.8rem;\n position: relative;\n vertical-align: middle;\n width: 2.8rem;\n }\n\n .CardImage .BlockchainLogo {\n position: absolute;\n bottom: 0;\n right: 0;\n }\n\n .CardTitle {\n font-size: 0.9rem;\n color: rgb(150,150,150);\n }\n \n .CardText, a .CardText {\n color: ".concat(style.colors.text, ";\n flex: 1;\n font-size: 1.3rem;\n }\n\n .CardText strong {\n font-weight: 500;\n }\n\n .CardText small {\n font-size: 1.1rem;\n color: rgb(150,150,150);\n }\n\n .CardAction {\n opacity: 0.2;\n }\n\n .Card.More {\n display: inline-block;\n text-align: center;\n }\n ");
|
|
52518
52539
|
});
|
|
52519
52540
|
|
|
52520
52541
|
var DialogStyle = (function (style) {
|
|
52521
|
-
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 .
|
|
52542
|
+
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 .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 ";
|
|
52522
52543
|
});
|
|
52523
52544
|
|
|
52524
52545
|
var FontStyle = (function (style) {
|
|
52525
|
-
return "\n\n
|
|
52526
|
-
});
|
|
52527
|
-
|
|
52528
|
-
var FooterStyle = (function (style) {
|
|
52529
|
-
return "\n\n .FooterLink {\n color: rgba(0,0,0,0.2);\n display: inline-block;\n font-size: 0.9rem;\n text-decoration: none;\n }\n\n .FooterLink:hover, .FooterLink:active {\n color: ".concat(style.colors.primary, ";\n }\n ");
|
|
52546
|
+
return "\n\n *, div, div * {\n font-family: ".concat(style.fontFamily, ";\n }\n\n .FontSizeS {\n font-size: 1rem;\n }\n\n .FontSizeM {\n font-size: 1.2rem;\n }\n\n .FontSizeL {\n font-size: 1.4rem;\n }\n\n .FontSizeXL {\n font-size: 2.0rem;\n }\n\n .FontWeightBold {\n font-weight: bold;\n }\n\n .FontItalic {\n font-style: italic;\n }\n ");
|
|
52530
52547
|
});
|
|
52531
52548
|
|
|
52532
52549
|
var GraphicStyle = (function () {
|
|
@@ -52538,7 +52555,7 @@ var HeightStyle = (function () {
|
|
|
52538
52555
|
});
|
|
52539
52556
|
|
|
52540
52557
|
var IconStyle = (function (style) {
|
|
52541
|
-
return "\n\n .Icon {\n fill : ".concat(style.colors.icons, ";\n stroke : ").concat(style.colors.icons, ";\n }\n\n .ChevronLeft, .ChevronRight {\n position: relative;\n top: 1px;\n }\n\n .Checkmark {\n height:
|
|
52558
|
+
return "\n\n .Icon {\n fill : ".concat(style.colors.icons, ";\n stroke : ").concat(style.colors.icons, ";\n }\n\n .ChevronLeft, .ChevronRight {\n position: relative;\n top: 1px;\n }\n\n .Checkmark {\n height: 24px;\n position: relative;\n top: -1px;\n vertical-align: middle;\n width: 24px;\n }\n\n .CheckMark.small {\n height: 16px;\n width: 16px;\n }\n\n .DigitalWalletIcon {\n height: 24px;\n position: relative;\n top: -1px;\n vertical-align: middle;\n width: 24px;\n }\n\n .ButtonPrimary .Icon {\n fill : ").concat(style.colors.buttonText, ";\n stroke : ").concat(style.colors.buttonText, ";\n }\n\n .Loading {\n border: 3px solid ").concat(style.colors.primary, ";\n border-top: 3px solid rgba(0,0,0,0.1);\n border-radius: 100%;\n position: relative;\n left: -1px;\n width: 18px;\n height: 18px;\n animation: spin 1.5s linear infinite;\n }\n\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n ");
|
|
52542
52559
|
});
|
|
52543
52560
|
|
|
52544
52561
|
var ImageStyle = (function (style) {
|
|
@@ -52557,10 +52574,18 @@ var LoadingTextStyle = (function (style) {
|
|
|
52557
52574
|
return "\n\n .LoadingText {\n color: ".concat(style.colors.buttonText, ";\n display: inline-block;\n text-decoration: none;\n }\n\n @keyframes blink {\n 0% { opacity: .2; }\n 20% { opacity: 1; }\n 100% { opacity: .2; }\n }\n \n .LoadingText .dot {\n animation-name: blink;\n animation-duration: 1.4s;\n animation-iteration-count: infinite;\n animation-fill-mode: both;\n }\n \n .LoadingText .dot:nth-child(2) {\n animation-delay: .2s;\n }\n \n .LoadingText .dot:nth-child(3) {\n animation-delay: .4s;\n }\n ");
|
|
52558
52575
|
});
|
|
52559
52576
|
|
|
52577
|
+
var OpacityStyle = (function (style) {
|
|
52578
|
+
return "\n\n .Opacity05 {\n opacity: 0.5;\n }\n ";
|
|
52579
|
+
});
|
|
52580
|
+
|
|
52560
52581
|
var PaddingStyle = (function () {
|
|
52561
52582
|
return "\n\n .PaddingTopXS {\n padding-top: 0.2rem;\n }\n\n .PaddingRightXS {\n padding-right: 0.2rem;\n }\n\n .PaddingBottomXS {\n padding-bottom: 0.2rem;\n }\n\n .PaddingLeftXS {\n padding-left: 0.2rem; \n }\n\n .PaddingTopS {\n padding-top: 0.8rem;\n }\n\n .PaddingRightS {\n padding-right: 0.8rem;\n }\n\n .PaddingBottomS {\n padding-bottom: 0.8rem;\n }\n\n .PaddingLeftS {\n padding-left: 0.8rem; \n }\n\n .PaddingTopM {\n padding-top: 1.2rem;\n }\n\n .PaddingRightM {\n padding-right: 1.2rem;\n }\n\n .PaddingBottomM {\n padding-bottom: 1.2rem;\n }\n\n .PaddingLeftM {\n padding-left: 1.2rem; \n }\n\n .PaddingTopL {\n padding-top: 1.8rem;\n }\n\n .PaddingRightL {\n padding-right: 1.8rem;\n }\n\n .PaddingBottomL {\n padding-bottom: 1.8rem;\n }\n\n .PaddingLeftL {\n padding-left: 1.28em; \n }\n ";
|
|
52562
52583
|
});
|
|
52563
52584
|
|
|
52585
|
+
var PoweredByStyle = (function (style) {
|
|
52586
|
+
return "\n\n .PoweredByWrapper {\n display: block;\n left: 0;\n padding-top: 0.2rem;\n position: fixed;\n right: 0;\n text-align: center;\n top: 0;\n }\n\n .PoweredByLink {\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\" !important;\n color: white;\n opacity: 0.4;\n display: inline-block;\n font-size: 0.78rem;\n font-style: italic;\n font-weight: bold;\n letter-spacing: -0.2px;\n margin-left: 0.5rem;\n text-decoration: none;\n }\n\n .PoweredByLink:hover, .PoweredByLink:active {\n opacity: 1.0;\n color: ".concat(style.colors.primary, ";\n }\n ");
|
|
52587
|
+
});
|
|
52588
|
+
|
|
52564
52589
|
var RangeSliderStyle = (function (style) {
|
|
52565
52590
|
return "\n\n .rangeslider {\n margin: 20px 0;\n position: relative;\n background: #e6e6e6;\n -ms-touch-action: none;\n touch-action: none;\n }\n\n .rangeslider,\n .rangeslider__fill {\n display: block;\n box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);\n }\n\n .rangeslider__handle {\n outline: none;\n cursor: pointer;\n display: inline-block;\n position: absolute;\n border-radius: 50%;\n background-color: " + style.colors.primary + ";\n border: 1px solid white;\n box-shadow: 0 0 8px rgba(0,0,0,0.1);\n }\n\n .rangeslider__handle:hover {\n box-shadow: inset 0 0 300px rgba(0,0,0,0.2);\n }\n\n .rangeslider__handle:active {\n box-shadow: inset 0 0 300px rgba(0,0,0,0.3);\n }\n\n .rangeslider__active {\n opacity: 1;\n }\n\n .rangeslider__handle-tooltip {\n display: none;\n }\n\n .rangeslider-horizontal {\n height: 12px;\n border-radius: 10px;\n }\n\n .rangeslider-horizontal .rangeslider__fill {\n height: 100%;\n background-color: " + style.colors.primary + ";\n border-radius: 10px;\n top: 0;\n }\n .rangeslider-horizontal .rangeslider__handle {\n width: 18px;\n height: 18px;\n border-radius: 30px;\n top: 50%;\n transform: translate3d(-50%, -50%, 0);\n }\n\n\n .rangeslider-horizontal .rangeslider__handle-tooltip {\n top: -55px;\n }\n\n ";
|
|
52566
52591
|
});
|
|
@@ -52570,15 +52595,15 @@ var ResetStyle = (function () {
|
|
|
52570
52595
|
});
|
|
52571
52596
|
|
|
52572
52597
|
var SkeletonStyle = (function () {
|
|
52573
|
-
return "\n \n .Skeleton {\n background: rgb(230,230,230) !important;\n box-shadow: none !important;\n cursor: inherit !important;\n line-height: 0;\n overflow: hidden;\n position: relative;\n }\n\n @keyframes SkeletonBackgroundAnimation {\n from {\n left: -500px;\n }\n to {\n left: +120%;\n }\n }\n\n .SkeletonBackground {\n animation: 2s SkeletonBackgroundAnimation 0.2s ease infinite;\n background: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.1) 50%, transparent 100%);\n height: 100%;\n left: -140%;\n position: absolute;\n top: 0;\n width: 400px;\n }\n\n .SkeletonWrapper {\n line-height: 0;\n }\n ";
|
|
52598
|
+
return "\n \n .Skeleton {\n background: rgb(230,230,230) !important;\n border: 0px solid transparent !important;\n box-shadow: none !important;\n cursor: inherit !important;\n line-height: 0;\n overflow: hidden;\n position: relative;\n }\n\n @keyframes SkeletonBackgroundAnimation {\n from {\n left: -500px;\n }\n to {\n left: +120%;\n }\n }\n\n .SkeletonBackground {\n animation: 2s SkeletonBackgroundAnimation 0.2s ease infinite;\n background: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.1) 50%, transparent 100%);\n height: 100%;\n left: -140%;\n position: absolute;\n top: 0;\n width: 400px;\n }\n\n .SkeletonWrapper {\n line-height: 0;\n }\n ";
|
|
52574
52599
|
});
|
|
52575
52600
|
|
|
52576
52601
|
var TextButtonStyle = (function (style) {
|
|
52577
|
-
return "\n\n .TextButton {\n cursor: pointer;\n font-size: 16px;\n color: ".concat(style.colors.primary, "\n }\n\n .TextButton
|
|
52602
|
+
return "\n\n .TextButton {\n cursor: pointer;\n font-size: 16px;\n color: ".concat(style.colors.primary, "\n }\n\n .TextButton:hover * {\n opacity: 1.0;\n }\n ");
|
|
52578
52603
|
});
|
|
52579
52604
|
|
|
52580
52605
|
var TextStyle = (function (style) {
|
|
52581
|
-
return "\n\n * {\n color: ".concat(style.colors.text, ";\n }\n\n
|
|
52606
|
+
return "\n\n * {\n color: ".concat(style.colors.text, ";\n }\n\n h1, h2, h3, h4, h5, h6 {\n display: block;\n }\n\n .TextLeft, .TextLeft * {\n text-align: left;\n }\n\n .TextCenter, .TextCenter * {\n text-align: center;\n }\n\n .LineHeightL {\n line-height: 2.0rem;\n }\n\n .ErrorSnippetText {\n background: rgb(30, 30, 20);\n border-radius: 1.2rem;\n border: 0.5rem solid rgb(30, 30, 20);\n color: #00FF41;\n font-size: 0.9rem;\n font-style: italic;\n max-height: 100px;\n padding: 6px;\n overflow-wrap: break-word;\n overflow-y: auto;\n white-space: pre-wrap;\n word-wrap: break-word;\n }\n ");
|
|
52582
52607
|
});
|
|
52583
52608
|
|
|
52584
52609
|
var TokenAmountStyle = (function () {
|
|
@@ -52595,7 +52620,7 @@ var styleRenderer = (function (style) {
|
|
|
52595
52620
|
},
|
|
52596
52621
|
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'
|
|
52597
52622
|
}, style);
|
|
52598
|
-
return [ResetStyle(), FontStyle(style), DialogStyle(), ButtonCircularStyle(), ButtonPrimaryStyle(style), CardStyle(style),
|
|
52623
|
+
return [ResetStyle(), FontStyle(style), DialogStyle(), ButtonCircularStyle(), ButtonPrimaryStyle(style), CardStyle(style), PoweredByStyle(style), GraphicStyle(), SkeletonStyle(), TokenAmountStyle(), TextStyle(style), IconStyle(style), OpacityStyle(), PaddingStyle(), HeightStyle(), LabelStyle(style), LoadingTextStyle(style), RangeSliderStyle(style), InputStyle(), TextButtonStyle(style), ImageStyle(), BlockchainLogoStyle()].join('');
|
|
52599
52624
|
});
|
|
52600
52625
|
|
|
52601
52626
|
function _interopDefaultLegacy$2 (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -52715,6 +52740,31 @@ var mount = (function (_ref, content) {
|
|
|
52715
52740
|
return unmount;
|
|
52716
52741
|
});
|
|
52717
52742
|
|
|
52743
|
+
var PoweredBy = (function () {
|
|
52744
|
+
return /*#__PURE__*/react.createElement("div", {
|
|
52745
|
+
className: "PoweredByWrapper"
|
|
52746
|
+
}, /*#__PURE__*/react.createElement("a", {
|
|
52747
|
+
href: 'https://depay.fi?utm_source=' + window.location.hostname + '&utm_medium=widget&utm_campaign=WidgetV2',
|
|
52748
|
+
rel: "noopener noreferrer",
|
|
52749
|
+
target: "_blank",
|
|
52750
|
+
className: "PoweredByLink"
|
|
52751
|
+
}, "by DePay"));
|
|
52752
|
+
});
|
|
52753
|
+
|
|
52754
|
+
var UpdatableProvider = (function (props) {
|
|
52755
|
+
var _useState = react.useState(true),
|
|
52756
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
52757
|
+
updatable = _useState2[0],
|
|
52758
|
+
setUpdatable = _useState2[1];
|
|
52759
|
+
|
|
52760
|
+
return /*#__PURE__*/react.createElement(UpdatableContext.Provider, {
|
|
52761
|
+
value: {
|
|
52762
|
+
updatable: updatable,
|
|
52763
|
+
setUpdatable: setUpdatable
|
|
52764
|
+
}
|
|
52765
|
+
}, props.children);
|
|
52766
|
+
});
|
|
52767
|
+
|
|
52718
52768
|
var Connect = function Connect(options) {
|
|
52719
52769
|
var style, error, document;
|
|
52720
52770
|
|
|
@@ -52770,7 +52820,7 @@ var Connect = function Connect(options) {
|
|
|
52770
52820
|
error: error,
|
|
52771
52821
|
container: container,
|
|
52772
52822
|
unmount: unmount
|
|
52773
|
-
}, /*#__PURE__*/react.createElement(ClosableProvider, {
|
|
52823
|
+
}, /*#__PURE__*/react.createElement(UpdatableProvider, null, /*#__PURE__*/react.createElement(ClosableProvider, {
|
|
52774
52824
|
unmount: rejectBeforeUnmount
|
|
52775
52825
|
}, /*#__PURE__*/react.createElement(ConnectStack, {
|
|
52776
52826
|
document: document,
|
|
@@ -52778,7 +52828,7 @@ var Connect = function Connect(options) {
|
|
|
52778
52828
|
resolve: resolve,
|
|
52779
52829
|
reject: reject,
|
|
52780
52830
|
autoClose: true
|
|
52781
|
-
})));
|
|
52831
|
+
}), /*#__PURE__*/react.createElement(PoweredBy, null))));
|
|
52782
52832
|
};
|
|
52783
52833
|
});
|
|
52784
52834
|
|
|
@@ -53002,7 +53052,7 @@ var EXP_LIMIT = 9e15, // 0 to 9e15
|
|
|
53002
53052
|
|
|
53003
53053
|
BASE = 1e7,
|
|
53004
53054
|
LOG_BASE = 7,
|
|
53005
|
-
MAX_SAFE_INTEGER = 9007199254740991,
|
|
53055
|
+
MAX_SAFE_INTEGER$1 = 9007199254740991,
|
|
53006
53056
|
|
|
53007
53057
|
LN10_PRECISION = LN10.length - 1,
|
|
53008
53058
|
PI_PRECISION = PI.length - 1,
|
|
@@ -55172,7 +55222,7 @@ P.toPower = P.pow = function (y) {
|
|
|
55172
55222
|
e = mathfloor(y.e / LOG_BASE);
|
|
55173
55223
|
|
|
55174
55224
|
// If y is a small integer use the 'exponentiation by squaring' algorithm.
|
|
55175
|
-
if (e >= y.d.length - 1 && (k = yn < 0 ? -yn : yn) <= MAX_SAFE_INTEGER) {
|
|
55225
|
+
if (e >= y.d.length - 1 && (k = yn < 0 ? -yn : yn) <= MAX_SAFE_INTEGER$1) {
|
|
55176
55226
|
r = intPow(Ctor, x, k, pr);
|
|
55177
55227
|
return y.s < 0 ? new Ctor(1).div(r) : finalise(r, pr, rm);
|
|
55178
55228
|
}
|
|
@@ -57306,7 +57356,7 @@ function clone(obj) {
|
|
|
57306
57356
|
Decimal.hypot = hypot; // ES6
|
|
57307
57357
|
Decimal.ln = ln;
|
|
57308
57358
|
Decimal.log = log;
|
|
57309
|
-
Decimal.log10 = log10; // ES6
|
|
57359
|
+
Decimal.log10 = log10$1; // ES6
|
|
57310
57360
|
Decimal.log2 = log2; // ES6
|
|
57311
57361
|
Decimal.max = max;
|
|
57312
57362
|
Decimal.min = min;
|
|
@@ -57465,7 +57515,7 @@ function log2(x) {
|
|
|
57465
57515
|
* x {number|string|Decimal}
|
|
57466
57516
|
*
|
|
57467
57517
|
*/
|
|
57468
|
-
function log10(x) {
|
|
57518
|
+
function log10$1(x) {
|
|
57469
57519
|
return new this(x).log(10);
|
|
57470
57520
|
}
|
|
57471
57521
|
|
|
@@ -58299,7 +58349,7 @@ class Token {
|
|
|
58299
58349
|
|
|
58300
58350
|
constructor({ blockchain, address }) {
|
|
58301
58351
|
this.blockchain = blockchain;
|
|
58302
|
-
this.address = getAddress$
|
|
58352
|
+
this.address = getAddress$3(address);
|
|
58303
58353
|
}
|
|
58304
58354
|
|
|
58305
58355
|
async decimals() {
|
|
@@ -62097,7 +62147,7 @@ var bn$1 = createCommonjsModule$1(function (module) {
|
|
|
62097
62147
|
})(module, commonjsGlobal$1);
|
|
62098
62148
|
});
|
|
62099
62149
|
|
|
62100
|
-
const version$
|
|
62150
|
+
const version$4 = "logger/5.4.1";
|
|
62101
62151
|
|
|
62102
62152
|
let _permanentCensorErrors$1 = false;
|
|
62103
62153
|
let _censorErrors$1 = false;
|
|
@@ -62373,7 +62423,7 @@ class Logger$1 {
|
|
|
62373
62423
|
}
|
|
62374
62424
|
static globalLogger() {
|
|
62375
62425
|
if (!_globalLogger$1) {
|
|
62376
|
-
_globalLogger$1 = new Logger$1(version$
|
|
62426
|
+
_globalLogger$1 = new Logger$1(version$4);
|
|
62377
62427
|
}
|
|
62378
62428
|
return _globalLogger$1;
|
|
62379
62429
|
}
|
|
@@ -62409,9 +62459,9 @@ class Logger$1 {
|
|
|
62409
62459
|
Logger$1.errors = ErrorCode$1;
|
|
62410
62460
|
Logger$1.levels = LogLevel$1;
|
|
62411
62461
|
|
|
62412
|
-
const version$
|
|
62462
|
+
const version$3 = "bytes/5.4.0";
|
|
62413
62463
|
|
|
62414
|
-
const logger$
|
|
62464
|
+
const logger$4 = new Logger$1(version$3);
|
|
62415
62465
|
///////////////////////////////
|
|
62416
62466
|
function isHexable$1(value) {
|
|
62417
62467
|
return !!(value.toHexString);
|
|
@@ -62452,7 +62502,7 @@ function arrayify(value, options) {
|
|
|
62452
62502
|
options = {};
|
|
62453
62503
|
}
|
|
62454
62504
|
if (typeof (value) === "number") {
|
|
62455
|
-
logger$
|
|
62505
|
+
logger$4.checkSafeUint53(value, "invalid arrayify value");
|
|
62456
62506
|
const result = [];
|
|
62457
62507
|
while (value) {
|
|
62458
62508
|
result.unshift(value & 0xff);
|
|
@@ -62479,7 +62529,7 @@ function arrayify(value, options) {
|
|
|
62479
62529
|
hex += "0";
|
|
62480
62530
|
}
|
|
62481
62531
|
else {
|
|
62482
|
-
logger$
|
|
62532
|
+
logger$4.throwArgumentError("hex data is odd-length", "value", value);
|
|
62483
62533
|
}
|
|
62484
62534
|
}
|
|
62485
62535
|
const result = [];
|
|
@@ -62491,7 +62541,7 @@ function arrayify(value, options) {
|
|
|
62491
62541
|
if (isBytes$1(value)) {
|
|
62492
62542
|
return addSlice(new Uint8Array(value));
|
|
62493
62543
|
}
|
|
62494
|
-
return logger$
|
|
62544
|
+
return logger$4.throwArgumentError("invalid arrayify value", "value", value);
|
|
62495
62545
|
}
|
|
62496
62546
|
function isHexString$1(value, length) {
|
|
62497
62547
|
if (typeof (value) !== "string" || !value.match(/^0x[0-9A-Fa-f]*$/)) {
|
|
@@ -62508,7 +62558,7 @@ function hexlify$1(value, options) {
|
|
|
62508
62558
|
options = {};
|
|
62509
62559
|
}
|
|
62510
62560
|
if (typeof (value) === "number") {
|
|
62511
|
-
logger$
|
|
62561
|
+
logger$4.checkSafeUint53(value, "invalid hexlify value");
|
|
62512
62562
|
let hex = "";
|
|
62513
62563
|
while (value) {
|
|
62514
62564
|
hex = HexCharacters$1[value & 0xf] + hex;
|
|
@@ -62544,7 +62594,7 @@ function hexlify$1(value, options) {
|
|
|
62544
62594
|
value += "0";
|
|
62545
62595
|
}
|
|
62546
62596
|
else {
|
|
62547
|
-
logger$
|
|
62597
|
+
logger$4.throwArgumentError("hex data is odd-length", "value", value);
|
|
62548
62598
|
}
|
|
62549
62599
|
}
|
|
62550
62600
|
return value.toLowerCase();
|
|
@@ -62557,17 +62607,17 @@ function hexlify$1(value, options) {
|
|
|
62557
62607
|
}
|
|
62558
62608
|
return result;
|
|
62559
62609
|
}
|
|
62560
|
-
return logger$
|
|
62610
|
+
return logger$4.throwArgumentError("invalid hexlify value", "value", value);
|
|
62561
62611
|
}
|
|
62562
62612
|
function hexZeroPad(value, length) {
|
|
62563
62613
|
if (typeof (value) !== "string") {
|
|
62564
62614
|
value = hexlify$1(value);
|
|
62565
62615
|
}
|
|
62566
62616
|
else if (!isHexString$1(value)) {
|
|
62567
|
-
logger$
|
|
62617
|
+
logger$4.throwArgumentError("invalid hex string", "value", value);
|
|
62568
62618
|
}
|
|
62569
62619
|
if (value.length > 2 * length + 2) {
|
|
62570
|
-
logger$
|
|
62620
|
+
logger$4.throwArgumentError("value out of range", "value", arguments[1]);
|
|
62571
62621
|
}
|
|
62572
62622
|
while (value.length < 2 * length + 2) {
|
|
62573
62623
|
value = "0x0" + value.substring(2);
|
|
@@ -62575,10 +62625,10 @@ function hexZeroPad(value, length) {
|
|
|
62575
62625
|
return value;
|
|
62576
62626
|
}
|
|
62577
62627
|
|
|
62578
|
-
const version$
|
|
62628
|
+
const version$2$1 = "bignumber/5.4.1";
|
|
62579
62629
|
|
|
62580
62630
|
var BN$1 = bn$1.BN;
|
|
62581
|
-
const logger$
|
|
62631
|
+
const logger$3 = new Logger$1(version$2$1);
|
|
62582
62632
|
const _constructorGuard$1 = {};
|
|
62583
62633
|
const MAX_SAFE$1 = 0x1fffffffffffff;
|
|
62584
62634
|
function isBigNumberish(value) {
|
|
@@ -62593,9 +62643,9 @@ function isBigNumberish(value) {
|
|
|
62593
62643
|
let _warnedToStringRadix$1 = false;
|
|
62594
62644
|
class BigNumber$1 {
|
|
62595
62645
|
constructor(constructorGuard, hex) {
|
|
62596
|
-
logger$
|
|
62646
|
+
logger$3.checkNew(new.target, BigNumber$1);
|
|
62597
62647
|
if (constructorGuard !== _constructorGuard$1) {
|
|
62598
|
-
logger$
|
|
62648
|
+
logger$3.throwError("cannot call constructor directly; use BigNumber.from", Logger$1.errors.UNSUPPORTED_OPERATION, {
|
|
62599
62649
|
operation: "new (BigNumber)"
|
|
62600
62650
|
});
|
|
62601
62651
|
}
|
|
@@ -62719,7 +62769,7 @@ class BigNumber$1 {
|
|
|
62719
62769
|
return BigInt(this.toString());
|
|
62720
62770
|
}
|
|
62721
62771
|
catch (e) { }
|
|
62722
|
-
return logger$
|
|
62772
|
+
return logger$3.throwError("this platform does not support BigInt", Logger$1.errors.UNSUPPORTED_OPERATION, {
|
|
62723
62773
|
value: this.toString()
|
|
62724
62774
|
});
|
|
62725
62775
|
}
|
|
@@ -62729,14 +62779,14 @@ class BigNumber$1 {
|
|
|
62729
62779
|
if (arguments[0] === 10) {
|
|
62730
62780
|
if (!_warnedToStringRadix$1) {
|
|
62731
62781
|
_warnedToStringRadix$1 = true;
|
|
62732
|
-
logger$
|
|
62782
|
+
logger$3.warn("BigNumber.toString does not accept any parameters; base-10 is assumed");
|
|
62733
62783
|
}
|
|
62734
62784
|
}
|
|
62735
62785
|
else if (arguments[0] === 16) {
|
|
62736
|
-
logger$
|
|
62786
|
+
logger$3.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()", Logger$1.errors.UNEXPECTED_ARGUMENT, {});
|
|
62737
62787
|
}
|
|
62738
62788
|
else {
|
|
62739
|
-
logger$
|
|
62789
|
+
logger$3.throwError("BigNumber.toString does not accept parameters", Logger$1.errors.UNEXPECTED_ARGUMENT, {});
|
|
62740
62790
|
}
|
|
62741
62791
|
}
|
|
62742
62792
|
return toBN$1(this).toString(10);
|
|
@@ -62758,7 +62808,7 @@ class BigNumber$1 {
|
|
|
62758
62808
|
if (value.match(/^-?[0-9]+$/)) {
|
|
62759
62809
|
return new BigNumber$1(_constructorGuard$1, toHex$1(new BN$1(value)));
|
|
62760
62810
|
}
|
|
62761
|
-
return logger$
|
|
62811
|
+
return logger$3.throwArgumentError("invalid BigNumber string", "value", value);
|
|
62762
62812
|
}
|
|
62763
62813
|
if (typeof (value) === "number") {
|
|
62764
62814
|
if (value % 1) {
|
|
@@ -62798,7 +62848,7 @@ class BigNumber$1 {
|
|
|
62798
62848
|
}
|
|
62799
62849
|
}
|
|
62800
62850
|
}
|
|
62801
|
-
return logger$
|
|
62851
|
+
return logger$3.throwArgumentError("invalid BigNumber value", "value", value);
|
|
62802
62852
|
}
|
|
62803
62853
|
static isBigNumber(value) {
|
|
62804
62854
|
return !!(value && value._isBigNumber);
|
|
@@ -62816,7 +62866,7 @@ function toHex$1(value) {
|
|
|
62816
62866
|
value = value.substring(1);
|
|
62817
62867
|
// Cannot have mulitple negative signs (e.g. "--0x04")
|
|
62818
62868
|
if (value[0] === "-") {
|
|
62819
|
-
logger$
|
|
62869
|
+
logger$3.throwArgumentError("invalid hex", "value", value);
|
|
62820
62870
|
}
|
|
62821
62871
|
// Call toHex on the positive component
|
|
62822
62872
|
value = toHex$1(value);
|
|
@@ -62860,10 +62910,14 @@ function throwFault$1(fault, operation, value) {
|
|
|
62860
62910
|
if (value != null) {
|
|
62861
62911
|
params.value = value;
|
|
62862
62912
|
}
|
|
62863
|
-
return logger$
|
|
62913
|
+
return logger$3.throwError(fault, Logger$1.errors.NUMERIC_FAULT, params);
|
|
62914
|
+
}
|
|
62915
|
+
// value should have no prefix
|
|
62916
|
+
function _base36To16(value) {
|
|
62917
|
+
return (new BN$1(value, 36)).toString(16);
|
|
62864
62918
|
}
|
|
62865
62919
|
|
|
62866
|
-
const logger$
|
|
62920
|
+
const logger$2 = new Logger$1(version$2$1);
|
|
62867
62921
|
const _constructorGuard$2 = {};
|
|
62868
62922
|
const Zero = BigNumber$1.from(0);
|
|
62869
62923
|
const NegativeOne = BigNumber$1.from(-1);
|
|
@@ -62872,7 +62926,7 @@ function throwFault$2(message, fault, operation, value) {
|
|
|
62872
62926
|
if (value !== undefined) {
|
|
62873
62927
|
params.value = value;
|
|
62874
62928
|
}
|
|
62875
|
-
return logger$
|
|
62929
|
+
return logger$2.throwError(message, Logger$1.errors.NUMERIC_FAULT, params);
|
|
62876
62930
|
}
|
|
62877
62931
|
// Constant to pull zeros from for multipliers
|
|
62878
62932
|
let zeros = "0";
|
|
@@ -62890,7 +62944,7 @@ function getMultiplier(decimals) {
|
|
|
62890
62944
|
if (typeof (decimals) === "number" && decimals >= 0 && decimals <= 256 && !(decimals % 1)) {
|
|
62891
62945
|
return ("1" + zeros.substring(0, decimals));
|
|
62892
62946
|
}
|
|
62893
|
-
return logger$
|
|
62947
|
+
return logger$2.throwArgumentError("invalid decimal size", "decimals", decimals);
|
|
62894
62948
|
}
|
|
62895
62949
|
function formatFixed(value, decimals) {
|
|
62896
62950
|
if (decimals == null) {
|
|
@@ -62927,7 +62981,7 @@ function parseFixed(value, decimals) {
|
|
|
62927
62981
|
}
|
|
62928
62982
|
const multiplier = getMultiplier(decimals);
|
|
62929
62983
|
if (typeof (value) !== "string" || !value.match(/^-?[0-9.,]+$/)) {
|
|
62930
|
-
logger$
|
|
62984
|
+
logger$2.throwArgumentError("invalid decimal value", "value", value);
|
|
62931
62985
|
}
|
|
62932
62986
|
// Is it negative?
|
|
62933
62987
|
const negative = (value.substring(0, 1) === "-");
|
|
@@ -62935,12 +62989,12 @@ function parseFixed(value, decimals) {
|
|
|
62935
62989
|
value = value.substring(1);
|
|
62936
62990
|
}
|
|
62937
62991
|
if (value === ".") {
|
|
62938
|
-
logger$
|
|
62992
|
+
logger$2.throwArgumentError("missing value", "value", value);
|
|
62939
62993
|
}
|
|
62940
62994
|
// Split it into a whole and fractional part
|
|
62941
62995
|
const comps = value.split(".");
|
|
62942
62996
|
if (comps.length > 2) {
|
|
62943
|
-
logger$
|
|
62997
|
+
logger$2.throwArgumentError("too many decimal points", "value", value);
|
|
62944
62998
|
}
|
|
62945
62999
|
let whole = comps[0], fraction = comps[1];
|
|
62946
63000
|
if (!whole) {
|
|
@@ -62971,7 +63025,7 @@ function parseFixed(value, decimals) {
|
|
|
62971
63025
|
class FixedFormat {
|
|
62972
63026
|
constructor(constructorGuard, signed, width, decimals) {
|
|
62973
63027
|
if (constructorGuard !== _constructorGuard$2) {
|
|
62974
|
-
logger$
|
|
63028
|
+
logger$2.throwError("cannot use FixedFormat constructor; use FixedFormat.from", Logger$1.errors.UNSUPPORTED_OPERATION, {
|
|
62975
63029
|
operation: "new FixedFormat"
|
|
62976
63030
|
});
|
|
62977
63031
|
}
|
|
@@ -63000,7 +63054,7 @@ class FixedFormat {
|
|
|
63000
63054
|
else {
|
|
63001
63055
|
const match = value.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);
|
|
63002
63056
|
if (!match) {
|
|
63003
|
-
logger$
|
|
63057
|
+
logger$2.throwArgumentError("invalid fixed format", "format", value);
|
|
63004
63058
|
}
|
|
63005
63059
|
signed = (match[1] !== "u");
|
|
63006
63060
|
width = parseInt(match[2]);
|
|
@@ -63013,7 +63067,7 @@ class FixedFormat {
|
|
|
63013
63067
|
return defaultValue;
|
|
63014
63068
|
}
|
|
63015
63069
|
if (typeof (value[key]) !== type) {
|
|
63016
|
-
logger$
|
|
63070
|
+
logger$2.throwArgumentError("invalid fixed format (" + key + " not " + type + ")", "format." + key, value[key]);
|
|
63017
63071
|
}
|
|
63018
63072
|
return value[key];
|
|
63019
63073
|
};
|
|
@@ -63022,19 +63076,19 @@ class FixedFormat {
|
|
|
63022
63076
|
decimals = check("decimals", "number", decimals);
|
|
63023
63077
|
}
|
|
63024
63078
|
if (width % 8) {
|
|
63025
|
-
logger$
|
|
63079
|
+
logger$2.throwArgumentError("invalid fixed format width (not byte aligned)", "format.width", width);
|
|
63026
63080
|
}
|
|
63027
63081
|
if (decimals > 80) {
|
|
63028
|
-
logger$
|
|
63082
|
+
logger$2.throwArgumentError("invalid fixed format (decimals too large)", "format.decimals", decimals);
|
|
63029
63083
|
}
|
|
63030
63084
|
return new FixedFormat(_constructorGuard$2, signed, width, decimals);
|
|
63031
63085
|
}
|
|
63032
63086
|
}
|
|
63033
63087
|
class FixedNumber {
|
|
63034
63088
|
constructor(constructorGuard, hex, value, format) {
|
|
63035
|
-
logger$
|
|
63089
|
+
logger$2.checkNew(new.target, FixedNumber);
|
|
63036
63090
|
if (constructorGuard !== _constructorGuard$2) {
|
|
63037
|
-
logger$
|
|
63091
|
+
logger$2.throwError("cannot use FixedNumber constructor; use FixedNumber.from", Logger$1.errors.UNSUPPORTED_OPERATION, {
|
|
63038
63092
|
operation: "new FixedFormat"
|
|
63039
63093
|
});
|
|
63040
63094
|
}
|
|
@@ -63046,7 +63100,7 @@ class FixedNumber {
|
|
|
63046
63100
|
}
|
|
63047
63101
|
_checkFormat(other) {
|
|
63048
63102
|
if (this.format.name !== other.format.name) {
|
|
63049
|
-
logger$
|
|
63103
|
+
logger$2.throwArgumentError("incompatible format; use fixedNumber.toFormat", "other", other);
|
|
63050
63104
|
}
|
|
63051
63105
|
}
|
|
63052
63106
|
addUnsafe(other) {
|
|
@@ -63108,7 +63162,7 @@ class FixedNumber {
|
|
|
63108
63162
|
comps.push("0");
|
|
63109
63163
|
}
|
|
63110
63164
|
if (decimals < 0 || decimals > 80 || (decimals % 1)) {
|
|
63111
|
-
logger$
|
|
63165
|
+
logger$2.throwArgumentError("invalid decimal count", "decimals", decimals);
|
|
63112
63166
|
}
|
|
63113
63167
|
if (comps[1].length <= decimals) {
|
|
63114
63168
|
return this;
|
|
@@ -63129,7 +63183,7 @@ class FixedNumber {
|
|
|
63129
63183
|
return this._hex;
|
|
63130
63184
|
}
|
|
63131
63185
|
if (width % 8) {
|
|
63132
|
-
logger$
|
|
63186
|
+
logger$2.throwArgumentError("invalid byte width", "width", width);
|
|
63133
63187
|
}
|
|
63134
63188
|
const hex = BigNumber$1.from(this._hex).fromTwos(this.format.width).toTwos(width).toHexString();
|
|
63135
63189
|
return hexZeroPad(hex, width / 8);
|
|
@@ -63204,7 +63258,7 @@ class FixedNumber {
|
|
|
63204
63258
|
throw error;
|
|
63205
63259
|
}
|
|
63206
63260
|
}
|
|
63207
|
-
return logger$
|
|
63261
|
+
return logger$2.throwArgumentError("invalid FixedNumber value", "value", value);
|
|
63208
63262
|
}
|
|
63209
63263
|
static isFixedNumber(value) {
|
|
63210
63264
|
return !!(value && value._isFixedNumber);
|
|
@@ -63213,9 +63267,585 @@ class FixedNumber {
|
|
|
63213
63267
|
const ONE = FixedNumber.from(1);
|
|
63214
63268
|
const BUMP = FixedNumber.from("0.5");
|
|
63215
63269
|
|
|
63216
|
-
|
|
63270
|
+
/**
|
|
63271
|
+
* [js-sha3]{@link https://github.com/emn178/js-sha3}
|
|
63272
|
+
*
|
|
63273
|
+
* @version 0.5.7
|
|
63274
|
+
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
|
63275
|
+
* @copyright Chen, Yi-Cyuan 2015-2016
|
|
63276
|
+
* @license MIT
|
|
63277
|
+
*/
|
|
63278
|
+
|
|
63279
|
+
var sha3 = createCommonjsModule$1(function (module) {
|
|
63280
|
+
/*jslint bitwise: true */
|
|
63281
|
+
(function () {
|
|
63282
|
+
|
|
63283
|
+
var root = typeof window === 'object' ? window : {};
|
|
63284
|
+
var NODE_JS = !root.JS_SHA3_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node;
|
|
63285
|
+
if (NODE_JS) {
|
|
63286
|
+
root = commonjsGlobal$1;
|
|
63287
|
+
}
|
|
63288
|
+
var COMMON_JS = !root.JS_SHA3_NO_COMMON_JS && 'object' === 'object' && module.exports;
|
|
63289
|
+
var HEX_CHARS = '0123456789abcdef'.split('');
|
|
63290
|
+
var SHAKE_PADDING = [31, 7936, 2031616, 520093696];
|
|
63291
|
+
var KECCAK_PADDING = [1, 256, 65536, 16777216];
|
|
63292
|
+
var PADDING = [6, 1536, 393216, 100663296];
|
|
63293
|
+
var SHIFT = [0, 8, 16, 24];
|
|
63294
|
+
var RC = [1, 0, 32898, 0, 32906, 2147483648, 2147516416, 2147483648, 32907, 0, 2147483649,
|
|
63295
|
+
0, 2147516545, 2147483648, 32777, 2147483648, 138, 0, 136, 0, 2147516425, 0,
|
|
63296
|
+
2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, 2147483648, 32771,
|
|
63297
|
+
2147483648, 32770, 2147483648, 128, 2147483648, 32778, 0, 2147483658, 2147483648,
|
|
63298
|
+
2147516545, 2147483648, 32896, 2147483648, 2147483649, 0, 2147516424, 2147483648];
|
|
63299
|
+
var BITS = [224, 256, 384, 512];
|
|
63300
|
+
var SHAKE_BITS = [128, 256];
|
|
63301
|
+
var OUTPUT_TYPES = ['hex', 'buffer', 'arrayBuffer', 'array'];
|
|
63302
|
+
|
|
63303
|
+
var createOutputMethod = function (bits, padding, outputType) {
|
|
63304
|
+
return function (message) {
|
|
63305
|
+
return new Keccak(bits, padding, bits).update(message)[outputType]();
|
|
63306
|
+
};
|
|
63307
|
+
};
|
|
63308
|
+
|
|
63309
|
+
var createShakeOutputMethod = function (bits, padding, outputType) {
|
|
63310
|
+
return function (message, outputBits) {
|
|
63311
|
+
return new Keccak(bits, padding, outputBits).update(message)[outputType]();
|
|
63312
|
+
};
|
|
63313
|
+
};
|
|
63314
|
+
|
|
63315
|
+
var createMethod = function (bits, padding) {
|
|
63316
|
+
var method = createOutputMethod(bits, padding, 'hex');
|
|
63317
|
+
method.create = function () {
|
|
63318
|
+
return new Keccak(bits, padding, bits);
|
|
63319
|
+
};
|
|
63320
|
+
method.update = function (message) {
|
|
63321
|
+
return method.create().update(message);
|
|
63322
|
+
};
|
|
63323
|
+
for (var i = 0; i < OUTPUT_TYPES.length; ++i) {
|
|
63324
|
+
var type = OUTPUT_TYPES[i];
|
|
63325
|
+
method[type] = createOutputMethod(bits, padding, type);
|
|
63326
|
+
}
|
|
63327
|
+
return method;
|
|
63328
|
+
};
|
|
63329
|
+
|
|
63330
|
+
var createShakeMethod = function (bits, padding) {
|
|
63331
|
+
var method = createShakeOutputMethod(bits, padding, 'hex');
|
|
63332
|
+
method.create = function (outputBits) {
|
|
63333
|
+
return new Keccak(bits, padding, outputBits);
|
|
63334
|
+
};
|
|
63335
|
+
method.update = function (message, outputBits) {
|
|
63336
|
+
return method.create(outputBits).update(message);
|
|
63337
|
+
};
|
|
63338
|
+
for (var i = 0; i < OUTPUT_TYPES.length; ++i) {
|
|
63339
|
+
var type = OUTPUT_TYPES[i];
|
|
63340
|
+
method[type] = createShakeOutputMethod(bits, padding, type);
|
|
63341
|
+
}
|
|
63342
|
+
return method;
|
|
63343
|
+
};
|
|
63344
|
+
|
|
63345
|
+
var algorithms = [
|
|
63346
|
+
{name: 'keccak', padding: KECCAK_PADDING, bits: BITS, createMethod: createMethod},
|
|
63347
|
+
{name: 'sha3', padding: PADDING, bits: BITS, createMethod: createMethod},
|
|
63348
|
+
{name: 'shake', padding: SHAKE_PADDING, bits: SHAKE_BITS, createMethod: createShakeMethod}
|
|
63349
|
+
];
|
|
63350
|
+
|
|
63351
|
+
var methods = {}, methodNames = [];
|
|
63352
|
+
|
|
63353
|
+
for (var i = 0; i < algorithms.length; ++i) {
|
|
63354
|
+
var algorithm = algorithms[i];
|
|
63355
|
+
var bits = algorithm.bits;
|
|
63356
|
+
for (var j = 0; j < bits.length; ++j) {
|
|
63357
|
+
var methodName = algorithm.name +'_' + bits[j];
|
|
63358
|
+
methodNames.push(methodName);
|
|
63359
|
+
methods[methodName] = algorithm.createMethod(bits[j], algorithm.padding);
|
|
63360
|
+
}
|
|
63361
|
+
}
|
|
63362
|
+
|
|
63363
|
+
function Keccak(bits, padding, outputBits) {
|
|
63364
|
+
this.blocks = [];
|
|
63365
|
+
this.s = [];
|
|
63366
|
+
this.padding = padding;
|
|
63367
|
+
this.outputBits = outputBits;
|
|
63368
|
+
this.reset = true;
|
|
63369
|
+
this.block = 0;
|
|
63370
|
+
this.start = 0;
|
|
63371
|
+
this.blockCount = (1600 - (bits << 1)) >> 5;
|
|
63372
|
+
this.byteCount = this.blockCount << 2;
|
|
63373
|
+
this.outputBlocks = outputBits >> 5;
|
|
63374
|
+
this.extraBytes = (outputBits & 31) >> 3;
|
|
63375
|
+
|
|
63376
|
+
for (var i = 0; i < 50; ++i) {
|
|
63377
|
+
this.s[i] = 0;
|
|
63378
|
+
}
|
|
63379
|
+
}
|
|
63380
|
+
|
|
63381
|
+
Keccak.prototype.update = function (message) {
|
|
63382
|
+
var notString = typeof message !== 'string';
|
|
63383
|
+
if (notString && message.constructor === ArrayBuffer) {
|
|
63384
|
+
message = new Uint8Array(message);
|
|
63385
|
+
}
|
|
63386
|
+
var length = message.length, blocks = this.blocks, byteCount = this.byteCount,
|
|
63387
|
+
blockCount = this.blockCount, index = 0, s = this.s, i, code;
|
|
63388
|
+
|
|
63389
|
+
while (index < length) {
|
|
63390
|
+
if (this.reset) {
|
|
63391
|
+
this.reset = false;
|
|
63392
|
+
blocks[0] = this.block;
|
|
63393
|
+
for (i = 1; i < blockCount + 1; ++i) {
|
|
63394
|
+
blocks[i] = 0;
|
|
63395
|
+
}
|
|
63396
|
+
}
|
|
63397
|
+
if (notString) {
|
|
63398
|
+
for (i = this.start; index < length && i < byteCount; ++index) {
|
|
63399
|
+
blocks[i >> 2] |= message[index] << SHIFT[i++ & 3];
|
|
63400
|
+
}
|
|
63401
|
+
} else {
|
|
63402
|
+
for (i = this.start; index < length && i < byteCount; ++index) {
|
|
63403
|
+
code = message.charCodeAt(index);
|
|
63404
|
+
if (code < 0x80) {
|
|
63405
|
+
blocks[i >> 2] |= code << SHIFT[i++ & 3];
|
|
63406
|
+
} else if (code < 0x800) {
|
|
63407
|
+
blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3];
|
|
63408
|
+
blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
|
|
63409
|
+
} else if (code < 0xd800 || code >= 0xe000) {
|
|
63410
|
+
blocks[i >> 2] |= (0xe0 | (code >> 12)) << SHIFT[i++ & 3];
|
|
63411
|
+
blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];
|
|
63412
|
+
blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
|
|
63413
|
+
} else {
|
|
63414
|
+
code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));
|
|
63415
|
+
blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3];
|
|
63416
|
+
blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3];
|
|
63417
|
+
blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];
|
|
63418
|
+
blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
|
|
63419
|
+
}
|
|
63420
|
+
}
|
|
63421
|
+
}
|
|
63422
|
+
this.lastByteIndex = i;
|
|
63423
|
+
if (i >= byteCount) {
|
|
63424
|
+
this.start = i - byteCount;
|
|
63425
|
+
this.block = blocks[blockCount];
|
|
63426
|
+
for (i = 0; i < blockCount; ++i) {
|
|
63427
|
+
s[i] ^= blocks[i];
|
|
63428
|
+
}
|
|
63429
|
+
f(s);
|
|
63430
|
+
this.reset = true;
|
|
63431
|
+
} else {
|
|
63432
|
+
this.start = i;
|
|
63433
|
+
}
|
|
63434
|
+
}
|
|
63435
|
+
return this;
|
|
63436
|
+
};
|
|
63437
|
+
|
|
63438
|
+
Keccak.prototype.finalize = function () {
|
|
63439
|
+
var blocks = this.blocks, i = this.lastByteIndex, blockCount = this.blockCount, s = this.s;
|
|
63440
|
+
blocks[i >> 2] |= this.padding[i & 3];
|
|
63441
|
+
if (this.lastByteIndex === this.byteCount) {
|
|
63442
|
+
blocks[0] = blocks[blockCount];
|
|
63443
|
+
for (i = 1; i < blockCount + 1; ++i) {
|
|
63444
|
+
blocks[i] = 0;
|
|
63445
|
+
}
|
|
63446
|
+
}
|
|
63447
|
+
blocks[blockCount - 1] |= 0x80000000;
|
|
63448
|
+
for (i = 0; i < blockCount; ++i) {
|
|
63449
|
+
s[i] ^= blocks[i];
|
|
63450
|
+
}
|
|
63451
|
+
f(s);
|
|
63452
|
+
};
|
|
63453
|
+
|
|
63454
|
+
Keccak.prototype.toString = Keccak.prototype.hex = function () {
|
|
63455
|
+
this.finalize();
|
|
63456
|
+
|
|
63457
|
+
var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks,
|
|
63458
|
+
extraBytes = this.extraBytes, i = 0, j = 0;
|
|
63459
|
+
var hex = '', block;
|
|
63460
|
+
while (j < outputBlocks) {
|
|
63461
|
+
for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {
|
|
63462
|
+
block = s[i];
|
|
63463
|
+
hex += HEX_CHARS[(block >> 4) & 0x0F] + HEX_CHARS[block & 0x0F] +
|
|
63464
|
+
HEX_CHARS[(block >> 12) & 0x0F] + HEX_CHARS[(block >> 8) & 0x0F] +
|
|
63465
|
+
HEX_CHARS[(block >> 20) & 0x0F] + HEX_CHARS[(block >> 16) & 0x0F] +
|
|
63466
|
+
HEX_CHARS[(block >> 28) & 0x0F] + HEX_CHARS[(block >> 24) & 0x0F];
|
|
63467
|
+
}
|
|
63468
|
+
if (j % blockCount === 0) {
|
|
63469
|
+
f(s);
|
|
63470
|
+
i = 0;
|
|
63471
|
+
}
|
|
63472
|
+
}
|
|
63473
|
+
if (extraBytes) {
|
|
63474
|
+
block = s[i];
|
|
63475
|
+
if (extraBytes > 0) {
|
|
63476
|
+
hex += HEX_CHARS[(block >> 4) & 0x0F] + HEX_CHARS[block & 0x0F];
|
|
63477
|
+
}
|
|
63478
|
+
if (extraBytes > 1) {
|
|
63479
|
+
hex += HEX_CHARS[(block >> 12) & 0x0F] + HEX_CHARS[(block >> 8) & 0x0F];
|
|
63480
|
+
}
|
|
63481
|
+
if (extraBytes > 2) {
|
|
63482
|
+
hex += HEX_CHARS[(block >> 20) & 0x0F] + HEX_CHARS[(block >> 16) & 0x0F];
|
|
63483
|
+
}
|
|
63484
|
+
}
|
|
63485
|
+
return hex;
|
|
63486
|
+
};
|
|
63487
|
+
|
|
63488
|
+
Keccak.prototype.arrayBuffer = function () {
|
|
63489
|
+
this.finalize();
|
|
63490
|
+
|
|
63491
|
+
var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks,
|
|
63492
|
+
extraBytes = this.extraBytes, i = 0, j = 0;
|
|
63493
|
+
var bytes = this.outputBits >> 3;
|
|
63494
|
+
var buffer;
|
|
63495
|
+
if (extraBytes) {
|
|
63496
|
+
buffer = new ArrayBuffer((outputBlocks + 1) << 2);
|
|
63497
|
+
} else {
|
|
63498
|
+
buffer = new ArrayBuffer(bytes);
|
|
63499
|
+
}
|
|
63500
|
+
var array = new Uint32Array(buffer);
|
|
63501
|
+
while (j < outputBlocks) {
|
|
63502
|
+
for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {
|
|
63503
|
+
array[j] = s[i];
|
|
63504
|
+
}
|
|
63505
|
+
if (j % blockCount === 0) {
|
|
63506
|
+
f(s);
|
|
63507
|
+
}
|
|
63508
|
+
}
|
|
63509
|
+
if (extraBytes) {
|
|
63510
|
+
array[i] = s[i];
|
|
63511
|
+
buffer = buffer.slice(0, bytes);
|
|
63512
|
+
}
|
|
63513
|
+
return buffer;
|
|
63514
|
+
};
|
|
63515
|
+
|
|
63516
|
+
Keccak.prototype.buffer = Keccak.prototype.arrayBuffer;
|
|
63517
|
+
|
|
63518
|
+
Keccak.prototype.digest = Keccak.prototype.array = function () {
|
|
63519
|
+
this.finalize();
|
|
63520
|
+
|
|
63521
|
+
var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks,
|
|
63522
|
+
extraBytes = this.extraBytes, i = 0, j = 0;
|
|
63523
|
+
var array = [], offset, block;
|
|
63524
|
+
while (j < outputBlocks) {
|
|
63525
|
+
for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {
|
|
63526
|
+
offset = j << 2;
|
|
63527
|
+
block = s[i];
|
|
63528
|
+
array[offset] = block & 0xFF;
|
|
63529
|
+
array[offset + 1] = (block >> 8) & 0xFF;
|
|
63530
|
+
array[offset + 2] = (block >> 16) & 0xFF;
|
|
63531
|
+
array[offset + 3] = (block >> 24) & 0xFF;
|
|
63532
|
+
}
|
|
63533
|
+
if (j % blockCount === 0) {
|
|
63534
|
+
f(s);
|
|
63535
|
+
}
|
|
63536
|
+
}
|
|
63537
|
+
if (extraBytes) {
|
|
63538
|
+
offset = j << 2;
|
|
63539
|
+
block = s[i];
|
|
63540
|
+
if (extraBytes > 0) {
|
|
63541
|
+
array[offset] = block & 0xFF;
|
|
63542
|
+
}
|
|
63543
|
+
if (extraBytes > 1) {
|
|
63544
|
+
array[offset + 1] = (block >> 8) & 0xFF;
|
|
63545
|
+
}
|
|
63546
|
+
if (extraBytes > 2) {
|
|
63547
|
+
array[offset + 2] = (block >> 16) & 0xFF;
|
|
63548
|
+
}
|
|
63549
|
+
}
|
|
63550
|
+
return array;
|
|
63551
|
+
};
|
|
63552
|
+
|
|
63553
|
+
var f = function (s) {
|
|
63554
|
+
var h, l, n, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9,
|
|
63555
|
+
b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16, b17,
|
|
63556
|
+
b18, b19, b20, b21, b22, b23, b24, b25, b26, b27, b28, b29, b30, b31, b32, b33,
|
|
63557
|
+
b34, b35, b36, b37, b38, b39, b40, b41, b42, b43, b44, b45, b46, b47, b48, b49;
|
|
63558
|
+
for (n = 0; n < 48; n += 2) {
|
|
63559
|
+
c0 = s[0] ^ s[10] ^ s[20] ^ s[30] ^ s[40];
|
|
63560
|
+
c1 = s[1] ^ s[11] ^ s[21] ^ s[31] ^ s[41];
|
|
63561
|
+
c2 = s[2] ^ s[12] ^ s[22] ^ s[32] ^ s[42];
|
|
63562
|
+
c3 = s[3] ^ s[13] ^ s[23] ^ s[33] ^ s[43];
|
|
63563
|
+
c4 = s[4] ^ s[14] ^ s[24] ^ s[34] ^ s[44];
|
|
63564
|
+
c5 = s[5] ^ s[15] ^ s[25] ^ s[35] ^ s[45];
|
|
63565
|
+
c6 = s[6] ^ s[16] ^ s[26] ^ s[36] ^ s[46];
|
|
63566
|
+
c7 = s[7] ^ s[17] ^ s[27] ^ s[37] ^ s[47];
|
|
63567
|
+
c8 = s[8] ^ s[18] ^ s[28] ^ s[38] ^ s[48];
|
|
63568
|
+
c9 = s[9] ^ s[19] ^ s[29] ^ s[39] ^ s[49];
|
|
63569
|
+
|
|
63570
|
+
h = c8 ^ ((c2 << 1) | (c3 >>> 31));
|
|
63571
|
+
l = c9 ^ ((c3 << 1) | (c2 >>> 31));
|
|
63572
|
+
s[0] ^= h;
|
|
63573
|
+
s[1] ^= l;
|
|
63574
|
+
s[10] ^= h;
|
|
63575
|
+
s[11] ^= l;
|
|
63576
|
+
s[20] ^= h;
|
|
63577
|
+
s[21] ^= l;
|
|
63578
|
+
s[30] ^= h;
|
|
63579
|
+
s[31] ^= l;
|
|
63580
|
+
s[40] ^= h;
|
|
63581
|
+
s[41] ^= l;
|
|
63582
|
+
h = c0 ^ ((c4 << 1) | (c5 >>> 31));
|
|
63583
|
+
l = c1 ^ ((c5 << 1) | (c4 >>> 31));
|
|
63584
|
+
s[2] ^= h;
|
|
63585
|
+
s[3] ^= l;
|
|
63586
|
+
s[12] ^= h;
|
|
63587
|
+
s[13] ^= l;
|
|
63588
|
+
s[22] ^= h;
|
|
63589
|
+
s[23] ^= l;
|
|
63590
|
+
s[32] ^= h;
|
|
63591
|
+
s[33] ^= l;
|
|
63592
|
+
s[42] ^= h;
|
|
63593
|
+
s[43] ^= l;
|
|
63594
|
+
h = c2 ^ ((c6 << 1) | (c7 >>> 31));
|
|
63595
|
+
l = c3 ^ ((c7 << 1) | (c6 >>> 31));
|
|
63596
|
+
s[4] ^= h;
|
|
63597
|
+
s[5] ^= l;
|
|
63598
|
+
s[14] ^= h;
|
|
63599
|
+
s[15] ^= l;
|
|
63600
|
+
s[24] ^= h;
|
|
63601
|
+
s[25] ^= l;
|
|
63602
|
+
s[34] ^= h;
|
|
63603
|
+
s[35] ^= l;
|
|
63604
|
+
s[44] ^= h;
|
|
63605
|
+
s[45] ^= l;
|
|
63606
|
+
h = c4 ^ ((c8 << 1) | (c9 >>> 31));
|
|
63607
|
+
l = c5 ^ ((c9 << 1) | (c8 >>> 31));
|
|
63608
|
+
s[6] ^= h;
|
|
63609
|
+
s[7] ^= l;
|
|
63610
|
+
s[16] ^= h;
|
|
63611
|
+
s[17] ^= l;
|
|
63612
|
+
s[26] ^= h;
|
|
63613
|
+
s[27] ^= l;
|
|
63614
|
+
s[36] ^= h;
|
|
63615
|
+
s[37] ^= l;
|
|
63616
|
+
s[46] ^= h;
|
|
63617
|
+
s[47] ^= l;
|
|
63618
|
+
h = c6 ^ ((c0 << 1) | (c1 >>> 31));
|
|
63619
|
+
l = c7 ^ ((c1 << 1) | (c0 >>> 31));
|
|
63620
|
+
s[8] ^= h;
|
|
63621
|
+
s[9] ^= l;
|
|
63622
|
+
s[18] ^= h;
|
|
63623
|
+
s[19] ^= l;
|
|
63624
|
+
s[28] ^= h;
|
|
63625
|
+
s[29] ^= l;
|
|
63626
|
+
s[38] ^= h;
|
|
63627
|
+
s[39] ^= l;
|
|
63628
|
+
s[48] ^= h;
|
|
63629
|
+
s[49] ^= l;
|
|
63630
|
+
|
|
63631
|
+
b0 = s[0];
|
|
63632
|
+
b1 = s[1];
|
|
63633
|
+
b32 = (s[11] << 4) | (s[10] >>> 28);
|
|
63634
|
+
b33 = (s[10] << 4) | (s[11] >>> 28);
|
|
63635
|
+
b14 = (s[20] << 3) | (s[21] >>> 29);
|
|
63636
|
+
b15 = (s[21] << 3) | (s[20] >>> 29);
|
|
63637
|
+
b46 = (s[31] << 9) | (s[30] >>> 23);
|
|
63638
|
+
b47 = (s[30] << 9) | (s[31] >>> 23);
|
|
63639
|
+
b28 = (s[40] << 18) | (s[41] >>> 14);
|
|
63640
|
+
b29 = (s[41] << 18) | (s[40] >>> 14);
|
|
63641
|
+
b20 = (s[2] << 1) | (s[3] >>> 31);
|
|
63642
|
+
b21 = (s[3] << 1) | (s[2] >>> 31);
|
|
63643
|
+
b2 = (s[13] << 12) | (s[12] >>> 20);
|
|
63644
|
+
b3 = (s[12] << 12) | (s[13] >>> 20);
|
|
63645
|
+
b34 = (s[22] << 10) | (s[23] >>> 22);
|
|
63646
|
+
b35 = (s[23] << 10) | (s[22] >>> 22);
|
|
63647
|
+
b16 = (s[33] << 13) | (s[32] >>> 19);
|
|
63648
|
+
b17 = (s[32] << 13) | (s[33] >>> 19);
|
|
63649
|
+
b48 = (s[42] << 2) | (s[43] >>> 30);
|
|
63650
|
+
b49 = (s[43] << 2) | (s[42] >>> 30);
|
|
63651
|
+
b40 = (s[5] << 30) | (s[4] >>> 2);
|
|
63652
|
+
b41 = (s[4] << 30) | (s[5] >>> 2);
|
|
63653
|
+
b22 = (s[14] << 6) | (s[15] >>> 26);
|
|
63654
|
+
b23 = (s[15] << 6) | (s[14] >>> 26);
|
|
63655
|
+
b4 = (s[25] << 11) | (s[24] >>> 21);
|
|
63656
|
+
b5 = (s[24] << 11) | (s[25] >>> 21);
|
|
63657
|
+
b36 = (s[34] << 15) | (s[35] >>> 17);
|
|
63658
|
+
b37 = (s[35] << 15) | (s[34] >>> 17);
|
|
63659
|
+
b18 = (s[45] << 29) | (s[44] >>> 3);
|
|
63660
|
+
b19 = (s[44] << 29) | (s[45] >>> 3);
|
|
63661
|
+
b10 = (s[6] << 28) | (s[7] >>> 4);
|
|
63662
|
+
b11 = (s[7] << 28) | (s[6] >>> 4);
|
|
63663
|
+
b42 = (s[17] << 23) | (s[16] >>> 9);
|
|
63664
|
+
b43 = (s[16] << 23) | (s[17] >>> 9);
|
|
63665
|
+
b24 = (s[26] << 25) | (s[27] >>> 7);
|
|
63666
|
+
b25 = (s[27] << 25) | (s[26] >>> 7);
|
|
63667
|
+
b6 = (s[36] << 21) | (s[37] >>> 11);
|
|
63668
|
+
b7 = (s[37] << 21) | (s[36] >>> 11);
|
|
63669
|
+
b38 = (s[47] << 24) | (s[46] >>> 8);
|
|
63670
|
+
b39 = (s[46] << 24) | (s[47] >>> 8);
|
|
63671
|
+
b30 = (s[8] << 27) | (s[9] >>> 5);
|
|
63672
|
+
b31 = (s[9] << 27) | (s[8] >>> 5);
|
|
63673
|
+
b12 = (s[18] << 20) | (s[19] >>> 12);
|
|
63674
|
+
b13 = (s[19] << 20) | (s[18] >>> 12);
|
|
63675
|
+
b44 = (s[29] << 7) | (s[28] >>> 25);
|
|
63676
|
+
b45 = (s[28] << 7) | (s[29] >>> 25);
|
|
63677
|
+
b26 = (s[38] << 8) | (s[39] >>> 24);
|
|
63678
|
+
b27 = (s[39] << 8) | (s[38] >>> 24);
|
|
63679
|
+
b8 = (s[48] << 14) | (s[49] >>> 18);
|
|
63680
|
+
b9 = (s[49] << 14) | (s[48] >>> 18);
|
|
63681
|
+
|
|
63682
|
+
s[0] = b0 ^ (~b2 & b4);
|
|
63683
|
+
s[1] = b1 ^ (~b3 & b5);
|
|
63684
|
+
s[10] = b10 ^ (~b12 & b14);
|
|
63685
|
+
s[11] = b11 ^ (~b13 & b15);
|
|
63686
|
+
s[20] = b20 ^ (~b22 & b24);
|
|
63687
|
+
s[21] = b21 ^ (~b23 & b25);
|
|
63688
|
+
s[30] = b30 ^ (~b32 & b34);
|
|
63689
|
+
s[31] = b31 ^ (~b33 & b35);
|
|
63690
|
+
s[40] = b40 ^ (~b42 & b44);
|
|
63691
|
+
s[41] = b41 ^ (~b43 & b45);
|
|
63692
|
+
s[2] = b2 ^ (~b4 & b6);
|
|
63693
|
+
s[3] = b3 ^ (~b5 & b7);
|
|
63694
|
+
s[12] = b12 ^ (~b14 & b16);
|
|
63695
|
+
s[13] = b13 ^ (~b15 & b17);
|
|
63696
|
+
s[22] = b22 ^ (~b24 & b26);
|
|
63697
|
+
s[23] = b23 ^ (~b25 & b27);
|
|
63698
|
+
s[32] = b32 ^ (~b34 & b36);
|
|
63699
|
+
s[33] = b33 ^ (~b35 & b37);
|
|
63700
|
+
s[42] = b42 ^ (~b44 & b46);
|
|
63701
|
+
s[43] = b43 ^ (~b45 & b47);
|
|
63702
|
+
s[4] = b4 ^ (~b6 & b8);
|
|
63703
|
+
s[5] = b5 ^ (~b7 & b9);
|
|
63704
|
+
s[14] = b14 ^ (~b16 & b18);
|
|
63705
|
+
s[15] = b15 ^ (~b17 & b19);
|
|
63706
|
+
s[24] = b24 ^ (~b26 & b28);
|
|
63707
|
+
s[25] = b25 ^ (~b27 & b29);
|
|
63708
|
+
s[34] = b34 ^ (~b36 & b38);
|
|
63709
|
+
s[35] = b35 ^ (~b37 & b39);
|
|
63710
|
+
s[44] = b44 ^ (~b46 & b48);
|
|
63711
|
+
s[45] = b45 ^ (~b47 & b49);
|
|
63712
|
+
s[6] = b6 ^ (~b8 & b0);
|
|
63713
|
+
s[7] = b7 ^ (~b9 & b1);
|
|
63714
|
+
s[16] = b16 ^ (~b18 & b10);
|
|
63715
|
+
s[17] = b17 ^ (~b19 & b11);
|
|
63716
|
+
s[26] = b26 ^ (~b28 & b20);
|
|
63717
|
+
s[27] = b27 ^ (~b29 & b21);
|
|
63718
|
+
s[36] = b36 ^ (~b38 & b30);
|
|
63719
|
+
s[37] = b37 ^ (~b39 & b31);
|
|
63720
|
+
s[46] = b46 ^ (~b48 & b40);
|
|
63721
|
+
s[47] = b47 ^ (~b49 & b41);
|
|
63722
|
+
s[8] = b8 ^ (~b0 & b2);
|
|
63723
|
+
s[9] = b9 ^ (~b1 & b3);
|
|
63724
|
+
s[18] = b18 ^ (~b10 & b12);
|
|
63725
|
+
s[19] = b19 ^ (~b11 & b13);
|
|
63726
|
+
s[28] = b28 ^ (~b20 & b22);
|
|
63727
|
+
s[29] = b29 ^ (~b21 & b23);
|
|
63728
|
+
s[38] = b38 ^ (~b30 & b32);
|
|
63729
|
+
s[39] = b39 ^ (~b31 & b33);
|
|
63730
|
+
s[48] = b48 ^ (~b40 & b42);
|
|
63731
|
+
s[49] = b49 ^ (~b41 & b43);
|
|
63732
|
+
|
|
63733
|
+
s[0] ^= RC[n];
|
|
63734
|
+
s[1] ^= RC[n + 1];
|
|
63735
|
+
}
|
|
63736
|
+
};
|
|
63737
|
+
|
|
63738
|
+
if (COMMON_JS) {
|
|
63739
|
+
module.exports = methods;
|
|
63740
|
+
} else {
|
|
63741
|
+
for (var i = 0; i < methodNames.length; ++i) {
|
|
63742
|
+
root[methodNames[i]] = methods[methodNames[i]];
|
|
63743
|
+
}
|
|
63744
|
+
}
|
|
63745
|
+
})();
|
|
63746
|
+
});
|
|
63747
|
+
|
|
63748
|
+
var sha3$1 = sha3;
|
|
63217
63749
|
|
|
63218
|
-
|
|
63750
|
+
function keccak256(data) {
|
|
63751
|
+
return '0x' + sha3$1.keccak_256(arrayify(data));
|
|
63752
|
+
}
|
|
63753
|
+
|
|
63754
|
+
const version$1$1 = "address/5.4.0";
|
|
63755
|
+
|
|
63756
|
+
const logger$1$1 = new Logger$1(version$1$1);
|
|
63757
|
+
function getChecksumAddress(address) {
|
|
63758
|
+
if (!isHexString$1(address, 20)) {
|
|
63759
|
+
logger$1$1.throwArgumentError("invalid address", "address", address);
|
|
63760
|
+
}
|
|
63761
|
+
address = address.toLowerCase();
|
|
63762
|
+
const chars = address.substring(2).split("");
|
|
63763
|
+
const expanded = new Uint8Array(40);
|
|
63764
|
+
for (let i = 0; i < 40; i++) {
|
|
63765
|
+
expanded[i] = chars[i].charCodeAt(0);
|
|
63766
|
+
}
|
|
63767
|
+
const hashed = arrayify(keccak256(expanded));
|
|
63768
|
+
for (let i = 0; i < 40; i += 2) {
|
|
63769
|
+
if ((hashed[i >> 1] >> 4) >= 8) {
|
|
63770
|
+
chars[i] = chars[i].toUpperCase();
|
|
63771
|
+
}
|
|
63772
|
+
if ((hashed[i >> 1] & 0x0f) >= 8) {
|
|
63773
|
+
chars[i + 1] = chars[i + 1].toUpperCase();
|
|
63774
|
+
}
|
|
63775
|
+
}
|
|
63776
|
+
return "0x" + chars.join("");
|
|
63777
|
+
}
|
|
63778
|
+
// Shims for environments that are missing some required constants and functions
|
|
63779
|
+
const MAX_SAFE_INTEGER = 0x1fffffffffffff;
|
|
63780
|
+
function log10(x) {
|
|
63781
|
+
if (Math.log10) {
|
|
63782
|
+
return Math.log10(x);
|
|
63783
|
+
}
|
|
63784
|
+
return Math.log(x) / Math.LN10;
|
|
63785
|
+
}
|
|
63786
|
+
// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number
|
|
63787
|
+
// Create lookup table
|
|
63788
|
+
const ibanLookup = {};
|
|
63789
|
+
for (let i = 0; i < 10; i++) {
|
|
63790
|
+
ibanLookup[String(i)] = String(i);
|
|
63791
|
+
}
|
|
63792
|
+
for (let i = 0; i < 26; i++) {
|
|
63793
|
+
ibanLookup[String.fromCharCode(65 + i)] = String(10 + i);
|
|
63794
|
+
}
|
|
63795
|
+
// How many decimal digits can we process? (for 64-bit float, this is 15)
|
|
63796
|
+
const safeDigits = Math.floor(log10(MAX_SAFE_INTEGER));
|
|
63797
|
+
function ibanChecksum(address) {
|
|
63798
|
+
address = address.toUpperCase();
|
|
63799
|
+
address = address.substring(4) + address.substring(0, 2) + "00";
|
|
63800
|
+
let expanded = address.split("").map((c) => { return ibanLookup[c]; }).join("");
|
|
63801
|
+
// Javascript can handle integers safely up to 15 (decimal) digits
|
|
63802
|
+
while (expanded.length >= safeDigits) {
|
|
63803
|
+
let block = expanded.substring(0, safeDigits);
|
|
63804
|
+
expanded = parseInt(block, 10) % 97 + expanded.substring(block.length);
|
|
63805
|
+
}
|
|
63806
|
+
let checksum = String(98 - (parseInt(expanded, 10) % 97));
|
|
63807
|
+
while (checksum.length < 2) {
|
|
63808
|
+
checksum = "0" + checksum;
|
|
63809
|
+
}
|
|
63810
|
+
return checksum;
|
|
63811
|
+
}
|
|
63812
|
+
function getAddress(address) {
|
|
63813
|
+
let result = null;
|
|
63814
|
+
if (typeof (address) !== "string") {
|
|
63815
|
+
logger$1$1.throwArgumentError("invalid address", "address", address);
|
|
63816
|
+
}
|
|
63817
|
+
if (address.match(/^(0x)?[0-9a-fA-F]{40}$/)) {
|
|
63818
|
+
// Missing the 0x prefix
|
|
63819
|
+
if (address.substring(0, 2) !== "0x") {
|
|
63820
|
+
address = "0x" + address;
|
|
63821
|
+
}
|
|
63822
|
+
result = getChecksumAddress(address);
|
|
63823
|
+
// It is a checksummed address with a bad checksum
|
|
63824
|
+
if (address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) && result !== address) {
|
|
63825
|
+
logger$1$1.throwArgumentError("bad address checksum", "address", address);
|
|
63826
|
+
}
|
|
63827
|
+
// Maybe ICAP? (we only support direct mode)
|
|
63828
|
+
}
|
|
63829
|
+
else if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {
|
|
63830
|
+
// It is an ICAP address with a bad checksum
|
|
63831
|
+
if (address.substring(2, 4) !== ibanChecksum(address)) {
|
|
63832
|
+
logger$1$1.throwArgumentError("bad icap checksum", "address", address);
|
|
63833
|
+
}
|
|
63834
|
+
result = _base36To16(address.substring(4));
|
|
63835
|
+
while (result.length < 40) {
|
|
63836
|
+
result = "0" + result;
|
|
63837
|
+
}
|
|
63838
|
+
result = getChecksumAddress("0x" + result);
|
|
63839
|
+
}
|
|
63840
|
+
else {
|
|
63841
|
+
logger$1$1.throwArgumentError("invalid address", "address", address);
|
|
63842
|
+
}
|
|
63843
|
+
return result;
|
|
63844
|
+
}
|
|
63845
|
+
|
|
63846
|
+
const version$5 = "units/5.4.0";
|
|
63847
|
+
|
|
63848
|
+
const logger$5 = new Logger$1(version$5);
|
|
63219
63849
|
const names = [
|
|
63220
63850
|
"wei",
|
|
63221
63851
|
"kwei",
|
|
@@ -63227,7 +63857,7 @@ const names = [
|
|
|
63227
63857
|
];
|
|
63228
63858
|
function parseUnits(value, unitName) {
|
|
63229
63859
|
if (typeof (value) !== "string") {
|
|
63230
|
-
logger$
|
|
63860
|
+
logger$5.throwArgumentError("value must be a string", "value", value);
|
|
63231
63861
|
}
|
|
63232
63862
|
if (typeof (unitName) === "string") {
|
|
63233
63863
|
const index = names.indexOf(unitName);
|
|
@@ -63367,7 +63997,8 @@ let getAmountsOut$1 = ({ path, amountIn, tokenIn, tokenOut }) => {
|
|
|
63367
63997
|
})
|
|
63368
63998
|
.then((amountsOut)=>{
|
|
63369
63999
|
resolve(amountsOut[amountsOut.length - 1]);
|
|
63370
|
-
})
|
|
64000
|
+
})
|
|
64001
|
+
.catch(()=>resolve());
|
|
63371
64002
|
})
|
|
63372
64003
|
};
|
|
63373
64004
|
|
|
@@ -63490,6 +64121,10 @@ let getTransaction$1 = ({
|
|
|
63490
64121
|
return transaction
|
|
63491
64122
|
};
|
|
63492
64123
|
|
|
64124
|
+
const fixCheckSum = (address)=>{
|
|
64125
|
+
return getAddress(address)
|
|
64126
|
+
};
|
|
64127
|
+
|
|
63493
64128
|
let route$6 = ({
|
|
63494
64129
|
exchange,
|
|
63495
64130
|
tokenIn,
|
|
@@ -63501,6 +64136,8 @@ let route$6 = ({
|
|
|
63501
64136
|
amountInMax = undefined,
|
|
63502
64137
|
amountOutMin = undefined,
|
|
63503
64138
|
}) => {
|
|
64139
|
+
tokenIn = fixCheckSum(tokenIn);
|
|
64140
|
+
tokenOut = fixCheckSum(tokenOut);
|
|
63504
64141
|
return new Promise(async (resolve)=> {
|
|
63505
64142
|
let path = await findPath$1({ tokenIn, tokenOut });
|
|
63506
64143
|
if (path === undefined || path.length == 0) { return resolve() }
|
|
@@ -63706,7 +64343,8 @@ let getAmountsOut = ({ path, amountIn, tokenIn, tokenOut }) => {
|
|
|
63706
64343
|
})
|
|
63707
64344
|
.then((amountsOut)=>{
|
|
63708
64345
|
resolve(amountsOut[amountsOut.length - 1]);
|
|
63709
|
-
})
|
|
64346
|
+
})
|
|
64347
|
+
.catch(()=>resolve());
|
|
63710
64348
|
})
|
|
63711
64349
|
};
|
|
63712
64350
|
|
|
@@ -63838,6 +64476,8 @@ let route$4 = ({
|
|
|
63838
64476
|
amountInMax = undefined,
|
|
63839
64477
|
amountOutMin = undefined,
|
|
63840
64478
|
}) => {
|
|
64479
|
+
tokenIn = fixCheckSum(tokenIn);
|
|
64480
|
+
tokenOut = fixCheckSum(tokenOut);
|
|
63841
64481
|
return new Promise(async (resolve)=> {
|
|
63842
64482
|
let path = await findPath({ tokenIn, tokenOut });
|
|
63843
64483
|
if (path === undefined || path.length == 0) { return resolve() }
|
|
@@ -64187,12 +64827,18 @@ var ChangableAmountProvider = (function (props) {
|
|
|
64187
64827
|
});
|
|
64188
64828
|
})).then(function (amounts) {
|
|
64189
64829
|
setAcceptWithAmount(props.accept.map(function (configuration, index) {
|
|
64830
|
+
if (amounts[index] == undefined) {
|
|
64831
|
+
return;
|
|
64832
|
+
}
|
|
64833
|
+
|
|
64190
64834
|
return {
|
|
64191
64835
|
blockchain: configuration.blockchain,
|
|
64192
|
-
amount: round$1(amounts[index])
|
|
64836
|
+
amount: round$1(amounts[index]),
|
|
64193
64837
|
token: configuration.token,
|
|
64194
64838
|
receiver: configuration.receiver || account
|
|
64195
64839
|
};
|
|
64840
|
+
}).filter(function (configuration) {
|
|
64841
|
+
return !!configuration;
|
|
64196
64842
|
}));
|
|
64197
64843
|
})["catch"](setError);
|
|
64198
64844
|
})["catch"](setError);
|
|
@@ -64771,7 +65417,9 @@ var NoPaymentMethodFoundDialog = (function () {
|
|
|
64771
65417
|
}, /*#__PURE__*/react.createElement("strong", {
|
|
64772
65418
|
className: "FontSizeM"
|
|
64773
65419
|
}, "We were not able to find any asset of value in your wallet. Please top up your account in order to proceed with this payment."))),
|
|
64774
|
-
footer: /*#__PURE__*/react.createElement("div",
|
|
65420
|
+
footer: /*#__PURE__*/react.createElement("div", {
|
|
65421
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
65422
|
+
}, /*#__PURE__*/react.createElement("button", {
|
|
64775
65423
|
className: "ButtonPrimary",
|
|
64776
65424
|
onClick: close
|
|
64777
65425
|
}, "Ok"))
|
|
@@ -64782,7 +65430,7 @@ var PaymentContext = /*#__PURE__*/react.createContext();
|
|
|
64782
65430
|
|
|
64783
65431
|
var PaymentRoutingContext = /*#__PURE__*/react.createContext();
|
|
64784
65432
|
|
|
64785
|
-
var
|
|
65433
|
+
var TrackingContext = /*#__PURE__*/react.createContext();
|
|
64786
65434
|
|
|
64787
65435
|
var PaymentProvider = (function (props) {
|
|
64788
65436
|
var _useContext = react.useContext(ErrorContext),
|
|
@@ -64791,7 +65439,6 @@ var PaymentProvider = (function (props) {
|
|
|
64791
65439
|
var _useContext2 = react.useContext(ConfigurationContext),
|
|
64792
65440
|
_sent = _useContext2.sent,
|
|
64793
65441
|
_confirmed = _useContext2.confirmed,
|
|
64794
|
-
_ensured = _useContext2.ensured,
|
|
64795
65442
|
_failed = _useContext2.failed;
|
|
64796
65443
|
|
|
64797
65444
|
var _useContext3 = react.useContext(PaymentRoutingContext),
|
|
@@ -64805,13 +65452,17 @@ var PaymentProvider = (function (props) {
|
|
|
64805
65452
|
var _useContext5 = react.useContext(PaymentRoutingContext),
|
|
64806
65453
|
allRoutes = _useContext5.allRoutes;
|
|
64807
65454
|
|
|
64808
|
-
var _useContext6 = react.useContext(
|
|
64809
|
-
_useContext6.
|
|
64810
|
-
var setUpdate = _useContext6.setUpdate;
|
|
65455
|
+
var _useContext6 = react.useContext(UpdatableContext),
|
|
65456
|
+
setUpdatable = _useContext6.setUpdatable;
|
|
64811
65457
|
|
|
64812
65458
|
var _useContext7 = react.useContext(WalletContext),
|
|
64813
65459
|
wallet = _useContext7.wallet;
|
|
64814
65460
|
|
|
65461
|
+
var _useContext8 = react.useContext(TrackingContext),
|
|
65462
|
+
forward = _useContext8.forward,
|
|
65463
|
+
tracking = _useContext8.tracking,
|
|
65464
|
+
initializeTracking = _useContext8.initializeTracking;
|
|
65465
|
+
|
|
64815
65466
|
var _useState = react.useState(),
|
|
64816
65467
|
_useState2 = _slicedToArray(_useState, 2),
|
|
64817
65468
|
payment = _useState2[0],
|
|
@@ -64832,53 +65483,81 @@ var PaymentProvider = (function (props) {
|
|
|
64832
65483
|
paymentState = _useState8[0],
|
|
64833
65484
|
setPaymentState = _useState8[1];
|
|
64834
65485
|
|
|
64835
|
-
var pay = function
|
|
64836
|
-
var
|
|
64837
|
-
|
|
64838
|
-
|
|
64839
|
-
|
|
64840
|
-
|
|
64841
|
-
|
|
64842
|
-
|
|
64843
|
-
|
|
64844
|
-
|
|
64845
|
-
|
|
64846
|
-
|
|
64847
|
-
|
|
64848
|
-
|
|
65486
|
+
var pay = /*#__PURE__*/function () {
|
|
65487
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(_ref) {
|
|
65488
|
+
var navigate, currentBlock;
|
|
65489
|
+
return regenerator.wrap(function _callee$(_context) {
|
|
65490
|
+
while (1) {
|
|
65491
|
+
switch (_context.prev = _context.next) {
|
|
65492
|
+
case 0:
|
|
65493
|
+
navigate = _ref.navigate;
|
|
65494
|
+
setClosable(false);
|
|
65495
|
+
setPaymentState('paying');
|
|
65496
|
+
setUpdatable(false);
|
|
65497
|
+
_context.next = 6;
|
|
65498
|
+
return request({
|
|
65499
|
+
blockchain: payment.route.transaction.blockchain,
|
|
65500
|
+
method: 'latestBlockNumber'
|
|
65501
|
+
});
|
|
64849
65502
|
|
|
64850
|
-
|
|
64851
|
-
|
|
64852
|
-
|
|
64853
|
-
|
|
64854
|
-
|
|
64855
|
-
|
|
64856
|
-
|
|
64857
|
-
|
|
64858
|
-
|
|
64859
|
-
|
|
64860
|
-
|
|
64861
|
-
|
|
64862
|
-
}
|
|
65503
|
+
case 6:
|
|
65504
|
+
currentBlock = _context.sent;
|
|
65505
|
+
wallet.sendTransaction(Object.assign({}, payment.route.transaction, {
|
|
65506
|
+
sent: function sent(transaction) {
|
|
65507
|
+
if (_sent) {
|
|
65508
|
+
_sent(transaction);
|
|
65509
|
+
}
|
|
65510
|
+
},
|
|
65511
|
+
confirmed: function confirmed(transaction) {
|
|
65512
|
+
if (tracking != true) {
|
|
65513
|
+
setClosable(true);
|
|
65514
|
+
}
|
|
64863
65515
|
|
|
64864
|
-
|
|
64865
|
-
setClosable(true);
|
|
64866
|
-
setUpdate(true);
|
|
64867
|
-
navigate('PaymentError');
|
|
64868
|
-
}
|
|
64869
|
-
})).then(function (sentTransaction) {
|
|
64870
|
-
setTransaction(sentTransaction);
|
|
64871
|
-
})["catch"](function (error) {
|
|
64872
|
-
console.log('error', error);
|
|
64873
|
-
setPaymentState('initialized');
|
|
64874
|
-
setClosable(true);
|
|
64875
|
-
setUpdate(true);
|
|
65516
|
+
setPaymentState('confirmed');
|
|
64876
65517
|
|
|
64877
|
-
|
|
64878
|
-
|
|
64879
|
-
|
|
64880
|
-
|
|
64881
|
-
|
|
65518
|
+
if (_confirmed) {
|
|
65519
|
+
_confirmed(transaction);
|
|
65520
|
+
}
|
|
65521
|
+
},
|
|
65522
|
+
failed: function failed(transaction, error) {
|
|
65523
|
+
if (_failed) {
|
|
65524
|
+
_failed(transaction, error);
|
|
65525
|
+
}
|
|
65526
|
+
|
|
65527
|
+
setPaymentState('initialized');
|
|
65528
|
+
setClosable(true);
|
|
65529
|
+
setUpdatable(true);
|
|
65530
|
+
navigate('PaymentError');
|
|
65531
|
+
}
|
|
65532
|
+
})).then(function (sentTransaction) {
|
|
65533
|
+
if (tracking) {
|
|
65534
|
+
initializeTracking(sentTransaction, currentBlock);
|
|
65535
|
+
}
|
|
65536
|
+
|
|
65537
|
+
setTransaction(sentTransaction);
|
|
65538
|
+
})["catch"](function (error) {
|
|
65539
|
+
console.log('error', error);
|
|
65540
|
+
setPaymentState('initialized');
|
|
65541
|
+
setClosable(true);
|
|
65542
|
+
setUpdatable(true);
|
|
65543
|
+
|
|
65544
|
+
if ((error === null || error === void 0 ? void 0 : error.code) == 'WRONG_NETWORK') {
|
|
65545
|
+
navigate('WrongNetwork');
|
|
65546
|
+
}
|
|
65547
|
+
});
|
|
65548
|
+
|
|
65549
|
+
case 8:
|
|
65550
|
+
case "end":
|
|
65551
|
+
return _context.stop();
|
|
65552
|
+
}
|
|
65553
|
+
}
|
|
65554
|
+
}, _callee);
|
|
65555
|
+
}));
|
|
65556
|
+
|
|
65557
|
+
return function pay(_x) {
|
|
65558
|
+
return _ref2.apply(this, arguments);
|
|
65559
|
+
};
|
|
65560
|
+
}();
|
|
64882
65561
|
|
|
64883
65562
|
var approve = function approve() {
|
|
64884
65563
|
setClosable(false);
|
|
@@ -64899,15 +65578,20 @@ var PaymentProvider = (function (props) {
|
|
|
64899
65578
|
});
|
|
64900
65579
|
};
|
|
64901
65580
|
|
|
65581
|
+
react.useEffect(function () {
|
|
65582
|
+
if (forward) {
|
|
65583
|
+
setPaymentState('confirmed');
|
|
65584
|
+
}
|
|
65585
|
+
}, [forward]);
|
|
64902
65586
|
react.useEffect(function () {
|
|
64903
65587
|
if (selectedRoute) {
|
|
64904
65588
|
var fromToken = selectedRoute.fromToken;
|
|
64905
65589
|
selectedRoute.transaction.params;
|
|
64906
|
-
Promise.all([fromToken.name(), fromToken.symbol(), fromToken.readable(selectedRoute.fromAmount)]).then(function (
|
|
64907
|
-
var
|
|
64908
|
-
name =
|
|
64909
|
-
symbol =
|
|
64910
|
-
amount =
|
|
65590
|
+
Promise.all([fromToken.name(), fromToken.symbol(), fromToken.readable(selectedRoute.fromAmount)]).then(function (_ref3) {
|
|
65591
|
+
var _ref4 = _slicedToArray(_ref3, 3),
|
|
65592
|
+
name = _ref4[0],
|
|
65593
|
+
symbol = _ref4[1],
|
|
65594
|
+
amount = _ref4[2];
|
|
64911
65595
|
|
|
64912
65596
|
setPayment({
|
|
64913
65597
|
route: selectedRoute,
|
|
@@ -64923,9 +65607,9 @@ var PaymentProvider = (function (props) {
|
|
|
64923
65607
|
}, [selectedRoute]);
|
|
64924
65608
|
react.useEffect(function () {
|
|
64925
65609
|
if (allRoutes && allRoutes.length == 0) {
|
|
64926
|
-
|
|
65610
|
+
setUpdatable(false);
|
|
64927
65611
|
} else if (allRoutes && allRoutes.length > 0) {
|
|
64928
|
-
|
|
65612
|
+
setUpdatable(true);
|
|
64929
65613
|
}
|
|
64930
65614
|
}, [allRoutes]);
|
|
64931
65615
|
|
|
@@ -69725,9 +70409,9 @@ let addTransactions = ({ routes, event }) => {
|
|
|
69725
70409
|
})
|
|
69726
70410
|
};
|
|
69727
70411
|
|
|
69728
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
70412
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
69729
70413
|
|
|
69730
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
70414
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
69731
70415
|
var PaymentRoutingProvider = (function (props) {
|
|
69732
70416
|
var _useState = react.useState(),
|
|
69733
70417
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -69747,8 +70431,8 @@ var PaymentRoutingProvider = (function (props) {
|
|
|
69747
70431
|
var _useContext = react.useContext(WalletContext),
|
|
69748
70432
|
account = _useContext.account;
|
|
69749
70433
|
|
|
69750
|
-
var _useContext2 = react.useContext(
|
|
69751
|
-
|
|
70434
|
+
var _useContext2 = react.useContext(UpdatableContext),
|
|
70435
|
+
updatable = _useContext2.updatable;
|
|
69752
70436
|
|
|
69753
70437
|
var prepareAcceptedPayments = function prepareAcceptedPayments(accept) {
|
|
69754
70438
|
var toAddress = _typeof(accept.receiver) == 'object' ? accept.receiver.address : accept.receiver;
|
|
@@ -69763,9 +70447,9 @@ var PaymentRoutingProvider = (function (props) {
|
|
|
69763
70447
|
var getPaymentRoutes = function getPaymentRoutes(_ref) {
|
|
69764
70448
|
var allRoutes = _ref.allRoutes,
|
|
69765
70449
|
selectedRoute = _ref.selectedRoute,
|
|
69766
|
-
|
|
70450
|
+
updatable = _ref.updatable;
|
|
69767
70451
|
|
|
69768
|
-
if (
|
|
70452
|
+
if (updatable == false || !props.accept || !account) {
|
|
69769
70453
|
return;
|
|
69770
70454
|
}
|
|
69771
70455
|
|
|
@@ -69868,13 +70552,13 @@ var PaymentRoutingProvider = (function (props) {
|
|
|
69868
70552
|
getPaymentRoutes({
|
|
69869
70553
|
allRoutes: allRoutes,
|
|
69870
70554
|
selectedRoute: selectedRoute,
|
|
69871
|
-
|
|
70555
|
+
updatable: updatable
|
|
69872
70556
|
});
|
|
69873
70557
|
}, 15000);
|
|
69874
70558
|
return function () {
|
|
69875
70559
|
return clearTimeout(timeout);
|
|
69876
70560
|
};
|
|
69877
|
-
}, [reloadCount, allRoutes, selectedRoute,
|
|
70561
|
+
}, [reloadCount, allRoutes, selectedRoute, updatable]);
|
|
69878
70562
|
react.useEffect(function () {
|
|
69879
70563
|
if (account && props.accept) {
|
|
69880
70564
|
setAllRoutes(undefined);
|
|
@@ -69904,8 +70588,8 @@ var PaymentValueProvider = (function (props) {
|
|
|
69904
70588
|
var _useContext2 = react.useContext(WalletContext),
|
|
69905
70589
|
account = _useContext2.account;
|
|
69906
70590
|
|
|
69907
|
-
var _useContext3 = react.useContext(
|
|
69908
|
-
|
|
70591
|
+
var _useContext3 = react.useContext(UpdatableContext),
|
|
70592
|
+
updatable = _useContext3.updatable;
|
|
69909
70593
|
|
|
69910
70594
|
var _useContext4 = react.useContext(PaymentContext),
|
|
69911
70595
|
payment = _useContext4.payment;
|
|
@@ -69924,10 +70608,10 @@ var PaymentValueProvider = (function (props) {
|
|
|
69924
70608
|
setReloadCount = _useState4[1];
|
|
69925
70609
|
|
|
69926
70610
|
var getToTokenLocalValue = function getToTokenLocalValue(_ref) {
|
|
69927
|
-
var
|
|
70611
|
+
var updatable = _ref.updatable,
|
|
69928
70612
|
payment = _ref.payment;
|
|
69929
70613
|
|
|
69930
|
-
if (
|
|
70614
|
+
if (updatable == false || (payment === null || payment === void 0 ? void 0 : payment.route) == undefined) {
|
|
69931
70615
|
return;
|
|
69932
70616
|
}
|
|
69933
70617
|
|
|
@@ -69970,7 +70654,7 @@ var PaymentValueProvider = (function (props) {
|
|
|
69970
70654
|
react.useEffect(function () {
|
|
69971
70655
|
if (account && payment) {
|
|
69972
70656
|
getToTokenLocalValue({
|
|
69973
|
-
|
|
70657
|
+
updatable: updatable,
|
|
69974
70658
|
payment: payment
|
|
69975
70659
|
});
|
|
69976
70660
|
}
|
|
@@ -69979,13 +70663,13 @@ var PaymentValueProvider = (function (props) {
|
|
|
69979
70663
|
var timeout = setTimeout(function () {
|
|
69980
70664
|
setReloadCount(reloadCount + 1);
|
|
69981
70665
|
getToTokenLocalValue({
|
|
69982
|
-
|
|
70666
|
+
updatable: updatable
|
|
69983
70667
|
});
|
|
69984
70668
|
}, 15000);
|
|
69985
70669
|
return function () {
|
|
69986
70670
|
return clearTimeout(timeout);
|
|
69987
70671
|
};
|
|
69988
|
-
}, [reloadCount,
|
|
70672
|
+
}, [reloadCount, updatable]);
|
|
69989
70673
|
return /*#__PURE__*/react.createElement(PaymentValueContext.Provider, {
|
|
69990
70674
|
value: {
|
|
69991
70675
|
paymentValue: paymentValue
|
|
@@ -71872,7 +72556,9 @@ var ChangeAmountDialog = (function (props) {
|
|
|
71872
72556
|
changeAmount(toValidValue(maxAmount));
|
|
71873
72557
|
}
|
|
71874
72558
|
}, "(Max)")))))),
|
|
71875
|
-
footer: /*#__PURE__*/react.createElement("div",
|
|
72559
|
+
footer: /*#__PURE__*/react.createElement("div", {
|
|
72560
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
72561
|
+
}, /*#__PURE__*/react.createElement("button", {
|
|
71876
72562
|
className: "ButtonPrimary",
|
|
71877
72563
|
onClick: changeAmountAndGoBack
|
|
71878
72564
|
}, "Done"))
|
|
@@ -71959,6 +72645,7 @@ var ChangePaymentDialog = (function (props) {
|
|
|
71959
72645
|
}, [allRoutes]);
|
|
71960
72646
|
react.useEffect(function () {
|
|
71961
72647
|
setCards(allPaymentRoutesWithData.map(function (payment, index) {
|
|
72648
|
+
var blockchain = Blockchain.findByName(payment.route.blockchain);
|
|
71962
72649
|
return /*#__PURE__*/react.createElement("div", {
|
|
71963
72650
|
key: index,
|
|
71964
72651
|
className: "Card",
|
|
@@ -71972,6 +72659,11 @@ var ChangePaymentDialog = (function (props) {
|
|
|
71972
72659
|
}, /*#__PURE__*/react.createElement(TokenImage_1, {
|
|
71973
72660
|
blockchain: payment.route.blockchain,
|
|
71974
72661
|
address: payment.route.fromToken.address
|
|
72662
|
+
}), /*#__PURE__*/react.createElement("img", {
|
|
72663
|
+
className: "BlockchainLogo small",
|
|
72664
|
+
src: blockchain.logo,
|
|
72665
|
+
alt: blockchain.label,
|
|
72666
|
+
title: blockchain.label
|
|
71975
72667
|
})), /*#__PURE__*/react.createElement("div", {
|
|
71976
72668
|
className: "CardBody"
|
|
71977
72669
|
}, /*#__PURE__*/react.createElement("div", {
|
|
@@ -71986,11 +72678,7 @@ var ChangePaymentDialog = (function (props) {
|
|
|
71986
72678
|
className: "TokenAmountCell"
|
|
71987
72679
|
}, format(payment.amount)))), /*#__PURE__*/react.createElement("h3", {
|
|
71988
72680
|
className: "CardText"
|
|
71989
|
-
}, /*#__PURE__*/react.createElement("small", null, format(round$1(parseFloat(payment.route.fromBalance.toString()) / Math.pow(10, payment.decimals), 'down'))))))
|
|
71990
|
-
className: "CardInfo"
|
|
71991
|
-
}, payment.route.approvalRequired && /*#__PURE__*/react.createElement("span", {
|
|
71992
|
-
className: "Label"
|
|
71993
|
-
}, "Requires Approval")));
|
|
72681
|
+
}, /*#__PURE__*/react.createElement("small", null, format(round$1(parseFloat(payment.route.fromBalance.toString()) / Math.pow(10, payment.decimals), 'down')))))));
|
|
71994
72682
|
}));
|
|
71995
72683
|
}, [allPaymentRoutesWithData]);
|
|
71996
72684
|
|
|
@@ -72016,25 +72704,12 @@ var ChangePaymentDialog = (function (props) {
|
|
|
72016
72704
|
});
|
|
72017
72705
|
});
|
|
72018
72706
|
|
|
72019
|
-
var Checkmark = (function () {
|
|
72020
|
-
return /*#__PURE__*/react.createElement("svg", {
|
|
72021
|
-
className: "Checkmark Icon",
|
|
72022
|
-
version: "1.1",
|
|
72023
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
72024
|
-
x: "0px",
|
|
72025
|
-
y: "0px",
|
|
72026
|
-
viewBox: "0 0 24 24"
|
|
72027
|
-
}, /*#__PURE__*/react.createElement("path", {
|
|
72028
|
-
d: "M20,4.9L9.2,16l-5.4-3.9c-0.7-0.5-1.6-0.3-2.1,0.3c-0.5,0.7-0.3,1.6,0.3,2.1l6.4,4.7c0.3,0.2,0.6,0.3,0.9,0.3 c0.4,0,0.8-0.2,1.1-0.5l11.7-12c0.6-0.6,0.6-1.6,0-2.2C21.6,4.3,20.6,4.3,20,4.9z"
|
|
72029
|
-
}));
|
|
72030
|
-
});
|
|
72031
|
-
|
|
72032
72707
|
var DonationOverviewSkeleton = (function (props) {
|
|
72033
72708
|
return /*#__PURE__*/react.createElement(Dialog, {
|
|
72034
72709
|
header: /*#__PURE__*/react.createElement("div", {
|
|
72035
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
72710
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
72036
72711
|
}, /*#__PURE__*/react.createElement("h1", {
|
|
72037
|
-
className: "LineHeightL FontSizeL
|
|
72712
|
+
className: "LineHeightL FontSizeL"
|
|
72038
72713
|
}, "Donation")),
|
|
72039
72714
|
body: /*#__PURE__*/react.createElement("div", {
|
|
72040
72715
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -72048,7 +72723,7 @@ var DonationOverviewSkeleton = (function (props) {
|
|
|
72048
72723
|
className: "SkeletonBackground"
|
|
72049
72724
|
}))),
|
|
72050
72725
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
72051
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
72726
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
72052
72727
|
}, /*#__PURE__*/react.createElement("div", {
|
|
72053
72728
|
className: "SkeletonWrapper"
|
|
72054
72729
|
}, /*#__PURE__*/react.createElement("div", {
|
|
@@ -72059,6 +72734,60 @@ var DonationOverviewSkeleton = (function (props) {
|
|
|
72059
72734
|
});
|
|
72060
72735
|
});
|
|
72061
72736
|
|
|
72737
|
+
var Checkmark = (function (props) {
|
|
72738
|
+
return /*#__PURE__*/react.createElement("svg", {
|
|
72739
|
+
className: "Checkmark Icon " + props.className,
|
|
72740
|
+
version: "1.1",
|
|
72741
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
72742
|
+
x: "0px",
|
|
72743
|
+
y: "0px",
|
|
72744
|
+
viewBox: "0 0 24 24"
|
|
72745
|
+
}, /*#__PURE__*/react.createElement("path", {
|
|
72746
|
+
d: "M20,4.9L9.2,16l-5.4-3.9c-0.7-0.5-1.6-0.3-2.1,0.3c-0.5,0.7-0.3,1.6,0.3,2.1l6.4,4.7c0.3,0.2,0.6,0.3,0.9,0.3 c0.4,0,0.8-0.2,1.1-0.5l11.7-12c0.6-0.6,0.6-1.6,0-2.2C21.6,4.3,20.6,4.3,20,4.9z"
|
|
72747
|
+
}));
|
|
72748
|
+
});
|
|
72749
|
+
|
|
72750
|
+
var DigitalWalletIcon = (function (props) {
|
|
72751
|
+
return /*#__PURE__*/react.createElement("svg", {
|
|
72752
|
+
className: "DigitalWalletIcon Icon " + props.className,
|
|
72753
|
+
version: "1.1",
|
|
72754
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
72755
|
+
height: "24",
|
|
72756
|
+
width: "24",
|
|
72757
|
+
viewBox: "0 0 24 24"
|
|
72758
|
+
}, /*#__PURE__*/react.createElement("path", {
|
|
72759
|
+
d: "M8.51,4.84l-.39-.53,4-2.89a2.2,2.2,0,0,1,3.06.48l.4.56-.53.39-.4-.56A1.54,1.54,0,0,0,12.5,2Z",
|
|
72760
|
+
transform: "translate(-0.81 -1)"
|
|
72761
|
+
}), /*#__PURE__*/react.createElement("path", {
|
|
72762
|
+
d: "M9.77,4.89l-.21-.62,6.31-2.13h0a2.18,2.18,0,0,1,.67-.1h0a2.21,2.21,0,0,1,2.08,1.49l.32.95-.63.21L18,3.73a1.53,1.53,0,0,0-1.45-1h0a1.61,1.61,0,0,0-.48.08h0Z",
|
|
72763
|
+
transform: "translate(-0.81 -1)"
|
|
72764
|
+
}), /*#__PURE__*/react.createElement("path", {
|
|
72765
|
+
d: "M19.72,16.2H18.27a3.28,3.28,0,1,1,0-6.56h1.45a3.21,3.21,0,0,1,1.33.28h0a3.28,3.28,0,0,1,0,6A3.21,3.21,0,0,1,19.72,16.2Zm-1.45-5.9a2.63,2.63,0,0,0,0,5.25h1.45a2.56,2.56,0,0,0,1.06-.23,2.62,2.62,0,0,0,0-4.8,2.55,2.55,0,0,0-1.06-.22ZM19,14.53a1.61,1.61,0,1,1,1.61-1.61A1.62,1.62,0,0,1,19,14.53ZM19,12a1,1,0,1,0,.95.95A1,1,0,0,0,19,12Z",
|
|
72766
|
+
transform: "translate(-0.81 -1)"
|
|
72767
|
+
}), /*#__PURE__*/react.createElement("path", {
|
|
72768
|
+
d: "M10.49,19.69a1.58,1.58,0,1,1,1.58-1.57A1.57,1.57,0,0,1,10.49,19.69Zm0-2.49a.92.92,0,1,0,.92.92A.92.92,0,0,0,10.49,17.2Z",
|
|
72769
|
+
transform: "translate(-0.81 -1)"
|
|
72770
|
+
}), /*#__PURE__*/react.createElement("path", {
|
|
72771
|
+
d: "M19.09,22.14H2.79a2,2,0,0,1-2-2V6.25a2.1,2.1,0,0,1,0-.43,2,2,0,0,1,.48-.92,2,2,0,0,1,1.48-.65H19.09a2,2,0,0,1,.64.1,2,2,0,0,1,1.36,1.79v0a.28.28,0,0,1,0,.09v3.91h-.66v-4a1.49,1.49,0,0,0-.23-.69A1.35,1.35,0,0,0,19.52,5a1.26,1.26,0,0,0-.43-.08H2.82a1.34,1.34,0,0,0-1,.44A1.49,1.49,0,0,0,1.5,6a1.5,1.5,0,0,0,0,.29V20.13a1.36,1.36,0,0,0,1.34,1.35H19.09a1.35,1.35,0,0,0,1.35-1.35V15.68h.66v4.45A2,2,0,0,1,19.09,22.14Z",
|
|
72772
|
+
transform: "translate(-0.81 -1)"
|
|
72773
|
+
}), /*#__PURE__*/react.createElement("path", {
|
|
72774
|
+
d: "M9.27,9.31a1.58,1.58,0,1,1,0-3.15,1.58,1.58,0,0,1,0,3.15Zm0-2.5a.92.92,0,1,0,.92.92A.92.92,0,0,0,9.27,6.81Z",
|
|
72775
|
+
transform: "translate(-0.81 -1)"
|
|
72776
|
+
}), /*#__PURE__*/react.createElement("path", {
|
|
72777
|
+
d: "M7.11,14.67A1.58,1.58,0,1,1,8.69,13.1,1.57,1.57,0,0,1,7.11,14.67Zm0-2.49A.92.92,0,1,0,8,13.1.92.92,0,0,0,7.11,12.18Z",
|
|
72778
|
+
transform: "translate(-0.81 -1)"
|
|
72779
|
+
}), /*#__PURE__*/react.createElement("rect", {
|
|
72780
|
+
x: "0.33",
|
|
72781
|
+
y: "11.77",
|
|
72782
|
+
width: "4.72",
|
|
72783
|
+
height: "0.66"
|
|
72784
|
+
}), /*#__PURE__*/react.createElement("polygon", {
|
|
72785
|
+
points: "2.08 9.53 0.33 9.53 0.33 8.87 1.8 8.87 4.28 6.39 7.21 6.39 7.21 7.05 4.55 7.05 2.08 9.53"
|
|
72786
|
+
}), /*#__PURE__*/react.createElement("polygon", {
|
|
72787
|
+
points: "8.43 17.45 4.53 17.45 2.63 15.55 0.33 15.55 0.33 14.89 2.9 14.89 4.8 16.79 8.43 16.79 8.43 17.45"
|
|
72788
|
+
}));
|
|
72789
|
+
});
|
|
72790
|
+
|
|
72062
72791
|
var LoadingText = (function (props) {
|
|
72063
72792
|
return /*#__PURE__*/react.createElement("div", {
|
|
72064
72793
|
className: "LoadingText"
|
|
@@ -72071,26 +72800,143 @@ var LoadingText = (function (props) {
|
|
|
72071
72800
|
}, "."));
|
|
72072
72801
|
});
|
|
72073
72802
|
|
|
72074
|
-
var
|
|
72803
|
+
var Footer = (function () {
|
|
72075
72804
|
var _useContext = react.useContext(ConfigurationContext),
|
|
72076
72805
|
currencyCode = _useContext.currencyCode;
|
|
72077
72806
|
|
|
72078
72807
|
var _useContext2 = react.useContext(ChangableAmountContext),
|
|
72079
72808
|
amount = _useContext2.amount;
|
|
72809
|
+
_useContext2.amountsMissing;
|
|
72080
72810
|
|
|
72081
|
-
var _useContext3 = react.useContext(
|
|
72082
|
-
|
|
72083
|
-
|
|
72084
|
-
|
|
72085
|
-
transaction = _useContext3.transaction,
|
|
72086
|
-
approve = _useContext3.approve,
|
|
72087
|
-
approvalTransaction = _useContext3.approvalTransaction;
|
|
72811
|
+
var _useContext3 = react.useContext(TrackingContext),
|
|
72812
|
+
tracking = _useContext3.tracking,
|
|
72813
|
+
forward = _useContext3.forward,
|
|
72814
|
+
forwardTo = _useContext3.forwardTo;
|
|
72088
72815
|
|
|
72089
|
-
var _useContext4 = react.useContext(
|
|
72090
|
-
|
|
72816
|
+
var _useContext4 = react.useContext(PaymentContext),
|
|
72817
|
+
payment = _useContext4.payment,
|
|
72818
|
+
paymentState = _useContext4.paymentState,
|
|
72819
|
+
pay = _useContext4.pay,
|
|
72820
|
+
transaction = _useContext4.transaction,
|
|
72821
|
+
approve = _useContext4.approve,
|
|
72822
|
+
approvalTransaction = _useContext4.approvalTransaction;
|
|
72823
|
+
|
|
72824
|
+
var _useContext5 = react.useContext(PaymentValueContext),
|
|
72825
|
+
paymentValue = _useContext5.paymentValue;
|
|
72826
|
+
|
|
72827
|
+
var _useContext6 = react.useContext(NavigateStackContext_1),
|
|
72828
|
+
navigate = _useContext6.navigate;
|
|
72829
|
+
|
|
72830
|
+
var _useContext7 = react.useContext(ClosableContext),
|
|
72831
|
+
close = _useContext7.close;
|
|
72832
|
+
|
|
72833
|
+
var trackingInfo = function trackingInfo() {
|
|
72834
|
+
if (tracking != true) {
|
|
72835
|
+
return null;
|
|
72836
|
+
}
|
|
72837
|
+
|
|
72838
|
+
if (forward) {
|
|
72839
|
+
return /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("a", {
|
|
72840
|
+
className: "Card transparent small disabled"
|
|
72841
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72842
|
+
className: "CardImage"
|
|
72843
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72844
|
+
className: "TextCenter Opacity05"
|
|
72845
|
+
}, /*#__PURE__*/react.createElement(Checkmark, {
|
|
72846
|
+
className: "small"
|
|
72847
|
+
}))), /*#__PURE__*/react.createElement("div", {
|
|
72848
|
+
className: "CardBody"
|
|
72849
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72850
|
+
className: "CardBodyWrapper"
|
|
72851
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72852
|
+
className: "Opacity05"
|
|
72853
|
+
}, "Payment confirmation has been stored")))));
|
|
72854
|
+
} else {
|
|
72855
|
+
return /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("a", {
|
|
72856
|
+
className: "Card transparent small disabled"
|
|
72857
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72858
|
+
className: "CardImage"
|
|
72859
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72860
|
+
className: "TextCenter"
|
|
72861
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72862
|
+
className: "Loading Icon"
|
|
72863
|
+
}))), /*#__PURE__*/react.createElement("div", {
|
|
72864
|
+
className: "CardBody"
|
|
72865
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72866
|
+
className: "CardBodyWrapper"
|
|
72867
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72868
|
+
className: "Opacity05"
|
|
72869
|
+
}, "Storing payment confirmation")))));
|
|
72870
|
+
}
|
|
72871
|
+
};
|
|
72872
|
+
|
|
72873
|
+
var additionalPaymentInformation = function additionalPaymentInformation() {
|
|
72874
|
+
if (paymentState == 'paying' && transaction == undefined) {
|
|
72875
|
+
return /*#__PURE__*/react.createElement("div", {
|
|
72876
|
+
className: "PaddingBottomS"
|
|
72877
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72878
|
+
className: "Card transparent disabled small"
|
|
72879
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72880
|
+
className: "CardImage"
|
|
72881
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72882
|
+
className: "TextCenter Opacity05"
|
|
72883
|
+
}, /*#__PURE__*/react.createElement(DigitalWalletIcon, {
|
|
72884
|
+
className: "small"
|
|
72885
|
+
}))), /*#__PURE__*/react.createElement("div", {
|
|
72886
|
+
className: "CardBody"
|
|
72887
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72888
|
+
className: "CardBodyWrapper"
|
|
72889
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72890
|
+
className: "Opacity05"
|
|
72891
|
+
}, "Confirm transaction in your wallet")))));
|
|
72892
|
+
} else if (paymentState == 'confirmed') {
|
|
72893
|
+
return /*#__PURE__*/react.createElement("div", {
|
|
72894
|
+
className: "PaddingBottomS"
|
|
72895
|
+
}, /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("a", {
|
|
72896
|
+
className: "Card transparent small",
|
|
72897
|
+
title: "Payment has been confirmed by the network",
|
|
72898
|
+
href: transaction === null || transaction === void 0 ? void 0 : transaction.url,
|
|
72899
|
+
target: "_blank",
|
|
72900
|
+
rel: "noopener noreferrer"
|
|
72901
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72902
|
+
className: "CardImage"
|
|
72903
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72904
|
+
className: "TextCenter Opacity05"
|
|
72905
|
+
}, /*#__PURE__*/react.createElement(Checkmark, {
|
|
72906
|
+
className: "small"
|
|
72907
|
+
}))), /*#__PURE__*/react.createElement("div", {
|
|
72908
|
+
className: "CardBody"
|
|
72909
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72910
|
+
className: "CardBodyWrapper"
|
|
72911
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72912
|
+
className: "Opacity05"
|
|
72913
|
+
}, "Payment has been confirmed"))))), trackingInfo());
|
|
72914
|
+
}
|
|
72915
|
+
};
|
|
72091
72916
|
|
|
72092
|
-
var
|
|
72093
|
-
|
|
72917
|
+
var approvalButton = function approvalButton() {
|
|
72918
|
+
if (!payment.route.approvalRequired || payment.route.directTransfer) {
|
|
72919
|
+
return null;
|
|
72920
|
+
} else if (paymentState == 'initialized') {
|
|
72921
|
+
return /*#__PURE__*/react.createElement("div", {
|
|
72922
|
+
className: "PaddingBottomS"
|
|
72923
|
+
}, /*#__PURE__*/react.createElement("button", {
|
|
72924
|
+
className: "ButtonPrimary",
|
|
72925
|
+
onClick: approve,
|
|
72926
|
+
title: "Allow ".concat(payment.symbol, " to be used as payment")
|
|
72927
|
+
}, "Allow ", payment.symbol, " to be used as payment"));
|
|
72928
|
+
} else if (paymentState == 'approving') {
|
|
72929
|
+
return /*#__PURE__*/react.createElement("div", {
|
|
72930
|
+
className: "PaddingBottomS"
|
|
72931
|
+
}, /*#__PURE__*/react.createElement("a", {
|
|
72932
|
+
className: "ButtonPrimary",
|
|
72933
|
+
title: "Approving payment token - please wait",
|
|
72934
|
+
href: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
|
|
72935
|
+
target: "_blank",
|
|
72936
|
+
rel: "noopener noreferrer"
|
|
72937
|
+
}, /*#__PURE__*/react.createElement(LoadingText, null, "Approving")));
|
|
72938
|
+
}
|
|
72939
|
+
};
|
|
72094
72940
|
|
|
72095
72941
|
var mainAction = function mainAction() {
|
|
72096
72942
|
if (paymentState == 'initialized' || paymentState == 'approving') {
|
|
@@ -72105,10 +72951,10 @@ var DonationOverviewDialog = (function (props) {
|
|
|
72105
72951
|
navigate: navigate
|
|
72106
72952
|
});
|
|
72107
72953
|
}
|
|
72108
|
-
}, "Pay ", new Currency({
|
|
72954
|
+
}, "Pay ", amount ? new Currency({
|
|
72109
72955
|
amount: amount.toFixed(2),
|
|
72110
72956
|
code: currencyCode
|
|
72111
|
-
}).toString());
|
|
72957
|
+
}).toString() : paymentValue.toString().length ? paymentValue.toString() : "".concat(payment.amount));
|
|
72112
72958
|
} else if (paymentState == 'paying') {
|
|
72113
72959
|
return /*#__PURE__*/react.createElement("a", {
|
|
72114
72960
|
className: "ButtonPrimary",
|
|
@@ -72118,39 +72964,51 @@ var DonationOverviewDialog = (function (props) {
|
|
|
72118
72964
|
rel: "noopener noreferrer"
|
|
72119
72965
|
}, /*#__PURE__*/react.createElement(LoadingText, null, "Paying"));
|
|
72120
72966
|
} else if (paymentState == 'confirmed') {
|
|
72121
|
-
|
|
72122
|
-
|
|
72123
|
-
|
|
72124
|
-
|
|
72125
|
-
|
|
72967
|
+
if (tracking == true) {
|
|
72968
|
+
if (forward) {
|
|
72969
|
+
if (forwardTo) {
|
|
72970
|
+
return /*#__PURE__*/react.createElement("a", {
|
|
72971
|
+
className: "ButtonPrimary",
|
|
72972
|
+
href: forwardTo,
|
|
72973
|
+
rel: "noopener noreferrer"
|
|
72974
|
+
}, "Continue");
|
|
72975
|
+
} else {
|
|
72976
|
+
return /*#__PURE__*/react.createElement("button", {
|
|
72977
|
+
className: "ButtonPrimary",
|
|
72978
|
+
onClick: close
|
|
72979
|
+
}, "Continue");
|
|
72980
|
+
}
|
|
72981
|
+
} else {
|
|
72982
|
+
return /*#__PURE__*/react.createElement("button", {
|
|
72983
|
+
className: "ButtonPrimary disabled",
|
|
72984
|
+
onClick: function onClick() {}
|
|
72985
|
+
}, "Continue");
|
|
72986
|
+
}
|
|
72987
|
+
} else {
|
|
72988
|
+
return /*#__PURE__*/react.createElement("button", {
|
|
72989
|
+
className: "ButtonPrimary",
|
|
72990
|
+
onClick: close
|
|
72991
|
+
}, "Close");
|
|
72992
|
+
}
|
|
72126
72993
|
}
|
|
72127
72994
|
};
|
|
72128
72995
|
|
|
72129
|
-
|
|
72130
|
-
|
|
72131
|
-
return /*#__PURE__*/react.createElement("div", {
|
|
72132
|
-
className: "PaddingBottomS"
|
|
72133
|
-
}, /*#__PURE__*/react.createElement("button", {
|
|
72134
|
-
className: "ButtonPrimary wide",
|
|
72135
|
-
onClick: approve,
|
|
72136
|
-
title: "Allow ".concat(payment.symbol, " to be used as payment")
|
|
72137
|
-
}, "Allow ", payment.symbol, " to be used as payment"));
|
|
72138
|
-
} else if (paymentState == 'approving') {
|
|
72139
|
-
return /*#__PURE__*/react.createElement("div", {
|
|
72140
|
-
className: "PaddingBottomS"
|
|
72141
|
-
}, /*#__PURE__*/react.createElement("a", {
|
|
72142
|
-
className: "ButtonPrimary wide",
|
|
72143
|
-
title: "Approving payment token - please wait",
|
|
72144
|
-
href: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
|
|
72145
|
-
target: "_blank",
|
|
72146
|
-
rel: "noopener noreferrer"
|
|
72147
|
-
}, /*#__PURE__*/react.createElement(LoadingText, null, "Approving")));
|
|
72148
|
-
}
|
|
72149
|
-
};
|
|
72996
|
+
return /*#__PURE__*/react.createElement("div", null, approvalButton(), additionalPaymentInformation(), mainAction());
|
|
72997
|
+
});
|
|
72150
72998
|
|
|
72151
|
-
|
|
72152
|
-
|
|
72153
|
-
|
|
72999
|
+
var DonationOverviewDialog = (function (props) {
|
|
73000
|
+
var _useContext = react.useContext(ConfigurationContext),
|
|
73001
|
+
currencyCode = _useContext.currencyCode;
|
|
73002
|
+
|
|
73003
|
+
var _useContext2 = react.useContext(ChangableAmountContext),
|
|
73004
|
+
amount = _useContext2.amount;
|
|
73005
|
+
|
|
73006
|
+
var _useContext3 = react.useContext(PaymentContext),
|
|
73007
|
+
payment = _useContext3.payment,
|
|
73008
|
+
paymentState = _useContext3.paymentState;
|
|
73009
|
+
|
|
73010
|
+
var _useContext4 = react.useContext(NavigateStackContext_1),
|
|
73011
|
+
navigate = _useContext4.navigate;
|
|
72154
73012
|
|
|
72155
73013
|
if (payment == undefined) {
|
|
72156
73014
|
return /*#__PURE__*/react.createElement(DonationOverviewSkeleton, null);
|
|
@@ -72158,9 +73016,9 @@ var DonationOverviewDialog = (function (props) {
|
|
|
72158
73016
|
|
|
72159
73017
|
return /*#__PURE__*/react.createElement(Dialog, {
|
|
72160
73018
|
header: /*#__PURE__*/react.createElement("div", {
|
|
72161
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
73019
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
72162
73020
|
}, /*#__PURE__*/react.createElement("h1", {
|
|
72163
|
-
className: "LineHeightL FontSizeL
|
|
73021
|
+
className: "LineHeightL FontSizeL"
|
|
72164
73022
|
}, "Donation")),
|
|
72165
73023
|
body: /*#__PURE__*/react.createElement("div", {
|
|
72166
73024
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -72223,8 +73081,8 @@ var DonationOverviewDialog = (function (props) {
|
|
|
72223
73081
|
className: "CardAction"
|
|
72224
73082
|
}, /*#__PURE__*/react.createElement(ChevronRight, null)))),
|
|
72225
73083
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
72226
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
72227
|
-
},
|
|
73084
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
73085
|
+
}, /*#__PURE__*/react.createElement(Footer, null))
|
|
72228
73086
|
});
|
|
72229
73087
|
});
|
|
72230
73088
|
|
|
@@ -72261,9 +73119,9 @@ var PaymentErrorDialog = (function () {
|
|
|
72261
73119
|
rel: "noopener noreferrer"
|
|
72262
73120
|
}, "View on explorer")))),
|
|
72263
73121
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
72264
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
73122
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
72265
73123
|
}, /*#__PURE__*/react.createElement("button", {
|
|
72266
|
-
className: "ButtonPrimary
|
|
73124
|
+
className: "ButtonPrimary",
|
|
72267
73125
|
onClick: function onClick() {
|
|
72268
73126
|
return navigate('back');
|
|
72269
73127
|
}
|
|
@@ -72284,9 +73142,9 @@ var WrongNetworkDialog = (function (props) {
|
|
|
72284
73142
|
return /*#__PURE__*/react.createElement(Dialog, {
|
|
72285
73143
|
stacked: true,
|
|
72286
73144
|
header: /*#__PURE__*/react.createElement("div", {
|
|
72287
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
73145
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
72288
73146
|
}, /*#__PURE__*/react.createElement("h1", {
|
|
72289
|
-
className: "LineHeightL FontSizeL
|
|
73147
|
+
className: "LineHeightL FontSizeL"
|
|
72290
73148
|
}, "Wrong Network")),
|
|
72291
73149
|
body: /*#__PURE__*/react.createElement("div", {
|
|
72292
73150
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -72303,7 +73161,7 @@ var WrongNetworkDialog = (function (props) {
|
|
|
72303
73161
|
className: "FontSizeM"
|
|
72304
73162
|
}, "Please make sure you connect your wallet to the correct network before you try again!"))),
|
|
72305
73163
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
72306
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
73164
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
72307
73165
|
}, /*#__PURE__*/react.createElement("button", {
|
|
72308
73166
|
className: "ButtonPrimary",
|
|
72309
73167
|
onClick: function onClick() {
|
|
@@ -72334,16 +73192,122 @@ var DonationStack = (function (props) {
|
|
|
72334
73192
|
});
|
|
72335
73193
|
});
|
|
72336
73194
|
|
|
72337
|
-
var
|
|
72338
|
-
var
|
|
73195
|
+
var TrackingProvider = (function (props) {
|
|
73196
|
+
var _useContext = react.useContext(ConfigurationContext),
|
|
73197
|
+
track = _useContext.track;
|
|
73198
|
+
|
|
73199
|
+
var _useState = react.useState(track && !!track.endpoint),
|
|
72339
73200
|
_useState2 = _slicedToArray(_useState, 2),
|
|
72340
|
-
|
|
72341
|
-
|
|
73201
|
+
tracking = _useState2[0],
|
|
73202
|
+
setTracking = _useState2[1];
|
|
73203
|
+
|
|
73204
|
+
var _useState3 = react.useState(false),
|
|
73205
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
73206
|
+
forward = _useState4[0],
|
|
73207
|
+
setForward = _useState4[1];
|
|
73208
|
+
|
|
73209
|
+
var _useState5 = react.useState(),
|
|
73210
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
73211
|
+
forwardTo = _useState6[0],
|
|
73212
|
+
setForwardTo = _useState6[1];
|
|
73213
|
+
|
|
73214
|
+
var _useContext2 = react.useContext(ClosableContext),
|
|
73215
|
+
setClosable = _useContext2.setClosable;
|
|
73216
|
+
|
|
73217
|
+
react.useEffect(function () {
|
|
73218
|
+
setTracking(track && !!track.endpoint);
|
|
73219
|
+
}, [track]);
|
|
73220
|
+
|
|
73221
|
+
var openSocket = function openSocket(transaction) {
|
|
73222
|
+
var socket = new WebSocket('wss://integrate.depay.fi/cable');
|
|
73223
|
+
|
|
73224
|
+
socket.onopen = function (event) {
|
|
73225
|
+
var msg = {
|
|
73226
|
+
command: 'subscribe',
|
|
73227
|
+
identifier: JSON.stringify({
|
|
73228
|
+
blockchain: transaction.blockchain,
|
|
73229
|
+
sender: transaction.from.toLowerCase(),
|
|
73230
|
+
nonce: transaction.nonce,
|
|
73231
|
+
channel: 'PaymentChannel'
|
|
73232
|
+
})
|
|
73233
|
+
};
|
|
73234
|
+
socket.send(JSON.stringify(msg));
|
|
73235
|
+
};
|
|
73236
|
+
|
|
73237
|
+
socket.onclose = function (event) {};
|
|
73238
|
+
|
|
73239
|
+
socket.onmessage = function (event) {
|
|
73240
|
+
var item = JSON.parse(event.data);
|
|
73241
|
+
|
|
73242
|
+
if (item.type === "ping") {
|
|
73243
|
+
return;
|
|
73244
|
+
}
|
|
73245
|
+
|
|
73246
|
+
if (item.message && item.message.forward) {
|
|
73247
|
+
setClosable(!item.message.forward_to);
|
|
73248
|
+
setForwardTo(item.message.forward_to);
|
|
73249
|
+
setForward(item.message.forward);
|
|
73250
|
+
socket.close();
|
|
73251
|
+
|
|
73252
|
+
if (!!item.message.forward_to) {
|
|
73253
|
+
setTimeout(function () {
|
|
73254
|
+
props.document.location.href = item.message.forward_to;
|
|
73255
|
+
}, 500);
|
|
73256
|
+
}
|
|
73257
|
+
}
|
|
73258
|
+
};
|
|
72342
73259
|
|
|
72343
|
-
|
|
73260
|
+
socket.onerror = function (error) {
|
|
73261
|
+
console.log('WebSocket Error: ' + error);
|
|
73262
|
+
};
|
|
73263
|
+
};
|
|
73264
|
+
|
|
73265
|
+
var retryStartTracking = function retryStartTracking(transaction, afterBlock, attempt) {
|
|
73266
|
+
attempt = parseInt(attempt || 1, 10);
|
|
73267
|
+
console.log('RETRY TRACKING ATTEMPT ', attempt);
|
|
73268
|
+
|
|
73269
|
+
if (attempt < 3) {
|
|
73270
|
+
setTimeout(function () {
|
|
73271
|
+
startTracking(transaction, afterBlock, attempt + 1);
|
|
73272
|
+
}, 3000);
|
|
73273
|
+
} else {
|
|
73274
|
+
console.log('TRACKING FAILED AFTER 3 ATTEMPTS!');
|
|
73275
|
+
}
|
|
73276
|
+
};
|
|
73277
|
+
|
|
73278
|
+
var startTracking = function startTracking(transaction, afterBlock, attempt) {
|
|
73279
|
+
fetch(track.endpoint, {
|
|
73280
|
+
method: 'POST',
|
|
73281
|
+
body: JSON.stringify({
|
|
73282
|
+
blockchain: transaction.blockchain,
|
|
73283
|
+
transaction: transaction.id.toLowerCase(),
|
|
73284
|
+
sender: transaction.from.toLowerCase(),
|
|
73285
|
+
nonce: transaction.nonce,
|
|
73286
|
+
after_block: afterBlock
|
|
73287
|
+
})
|
|
73288
|
+
}).then(function (response) {
|
|
73289
|
+
if (response.status == 200) {
|
|
73290
|
+
console.log('TRACKING INITIALIZED');
|
|
73291
|
+
} else {
|
|
73292
|
+
retryStartTracking(transaction, afterBlock, attempt);
|
|
73293
|
+
}
|
|
73294
|
+
})["catch"](function (error) {
|
|
73295
|
+
console.log('TRACKING FAILED', error);
|
|
73296
|
+
retryStartTracking(transaction, afterBlock, attempt);
|
|
73297
|
+
});
|
|
73298
|
+
};
|
|
73299
|
+
|
|
73300
|
+
var initializeTracking = function initializeTracking(transaction, afterBlock) {
|
|
73301
|
+
openSocket(transaction);
|
|
73302
|
+
startTracking(transaction, afterBlock);
|
|
73303
|
+
};
|
|
73304
|
+
|
|
73305
|
+
return /*#__PURE__*/react.createElement(TrackingContext.Provider, {
|
|
72344
73306
|
value: {
|
|
72345
|
-
|
|
72346
|
-
|
|
73307
|
+
tracking: tracking,
|
|
73308
|
+
initializeTracking: initializeTracking,
|
|
73309
|
+
forward: forward,
|
|
73310
|
+
forwardTo: forwardTo
|
|
72347
73311
|
}
|
|
72348
73312
|
}, props.children);
|
|
72349
73313
|
});
|
|
@@ -72446,12 +73410,12 @@ var preflight$2 = /*#__PURE__*/function () {
|
|
|
72446
73410
|
|
|
72447
73411
|
var Donation = /*#__PURE__*/function () {
|
|
72448
73412
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(_ref3) {
|
|
72449
|
-
var amount, accept, event, sent, confirmed,
|
|
73413
|
+
var amount, accept, event, sent, confirmed, failed, error, critical, style, blacklist, providers, currency, connected, closed, document, unmount;
|
|
72450
73414
|
return regenerator.wrap(function _callee2$(_context2) {
|
|
72451
73415
|
while (1) {
|
|
72452
73416
|
switch (_context2.prev = _context2.next) {
|
|
72453
73417
|
case 0:
|
|
72454
|
-
amount = _ref3.amount, accept = _ref3.accept, event = _ref3.event, sent = _ref3.sent, confirmed = _ref3.confirmed,
|
|
73418
|
+
amount = _ref3.amount, accept = _ref3.accept, event = _ref3.event, sent = _ref3.sent, confirmed = _ref3.confirmed, failed = _ref3.failed, error = _ref3.error, critical = _ref3.critical, style = _ref3.style, blacklist = _ref3.blacklist, providers = _ref3.providers, currency = _ref3.currency, connected = _ref3.connected, closed = _ref3.closed, document = _ref3.document;
|
|
72455
73419
|
_context2.prev = 1;
|
|
72456
73420
|
_context2.next = 4;
|
|
72457
73421
|
return preflight$2({
|
|
@@ -72477,26 +73441,27 @@ var Donation = /*#__PURE__*/function () {
|
|
|
72477
73441
|
event: event,
|
|
72478
73442
|
sent: sent,
|
|
72479
73443
|
confirmed: confirmed,
|
|
72480
|
-
ensured: ensured,
|
|
72481
73444
|
failed: failed,
|
|
72482
73445
|
blacklist: blacklist,
|
|
72483
73446
|
providers: providers
|
|
72484
73447
|
}
|
|
72485
|
-
}, /*#__PURE__*/react.createElement(ClosableProvider, {
|
|
73448
|
+
}, /*#__PURE__*/react.createElement(UpdatableProvider, null, /*#__PURE__*/react.createElement(ClosableProvider, {
|
|
72486
73449
|
unmount: unmount
|
|
72487
|
-
}, /*#__PURE__*/react.createElement(
|
|
73450
|
+
}, /*#__PURE__*/react.createElement(WalletProvider, {
|
|
72488
73451
|
container: container,
|
|
72489
73452
|
connected: connected,
|
|
72490
73453
|
unmount: unmount
|
|
72491
73454
|
}, /*#__PURE__*/react.createElement(ConversionRateProvider, null, /*#__PURE__*/react.createElement(ChangableAmountProvider, {
|
|
72492
73455
|
accept: accept
|
|
73456
|
+
}, /*#__PURE__*/react.createElement(TrackingProvider, {
|
|
73457
|
+
document: ensureDocument(document)
|
|
72493
73458
|
}, /*#__PURE__*/react.createElement(DonationRoutingProvider, {
|
|
72494
73459
|
container: container,
|
|
72495
73460
|
document: document
|
|
72496
73461
|
}, /*#__PURE__*/react.createElement(DonationStack, {
|
|
72497
73462
|
document: document,
|
|
72498
73463
|
container: container
|
|
72499
|
-
})))))))));
|
|
73464
|
+
}), /*#__PURE__*/react.createElement(PoweredBy, null))))))))));
|
|
72500
73465
|
};
|
|
72501
73466
|
});
|
|
72502
73467
|
return _context2.abrupt("return", {
|
|
@@ -72564,9 +73529,9 @@ var PaymentOverviewSkeleton = (function (props) {
|
|
|
72564
73529
|
|
|
72565
73530
|
return /*#__PURE__*/react.createElement(Dialog, {
|
|
72566
73531
|
header: /*#__PURE__*/react.createElement("div", {
|
|
72567
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
73532
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
72568
73533
|
}, /*#__PURE__*/react.createElement("h1", {
|
|
72569
|
-
className: "LineHeightL FontSizeL
|
|
73534
|
+
className: "LineHeightL FontSizeL"
|
|
72570
73535
|
}, "Payment")),
|
|
72571
73536
|
body: /*#__PURE__*/react.createElement("div", {
|
|
72572
73537
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -72580,7 +73545,7 @@ var PaymentOverviewSkeleton = (function (props) {
|
|
|
72580
73545
|
className: "SkeletonBackground"
|
|
72581
73546
|
}))),
|
|
72582
73547
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
72583
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
73548
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
72584
73549
|
}, /*#__PURE__*/react.createElement("div", {
|
|
72585
73550
|
className: "SkeletonWrapper"
|
|
72586
73551
|
}, /*#__PURE__*/react.createElement("div", {
|
|
@@ -72595,17 +73560,13 @@ var PaymentOverviewDialog = (function (props) {
|
|
|
72595
73560
|
var _useContext = react.useContext(ConfigurationContext),
|
|
72596
73561
|
currencyCode = _useContext.currencyCode;
|
|
72597
73562
|
|
|
72598
|
-
var _useContext2 = react.useContext(
|
|
72599
|
-
|
|
72600
|
-
|
|
73563
|
+
var _useContext2 = react.useContext(PaymentContext),
|
|
73564
|
+
payment = _useContext2.payment,
|
|
73565
|
+
paymentState = _useContext2.paymentState;
|
|
72601
73566
|
|
|
72602
|
-
var _useContext3 = react.useContext(
|
|
72603
|
-
|
|
72604
|
-
|
|
72605
|
-
pay = _useContext3.pay,
|
|
72606
|
-
transaction = _useContext3.transaction,
|
|
72607
|
-
approve = _useContext3.approve,
|
|
72608
|
-
approvalTransaction = _useContext3.approvalTransaction;
|
|
73567
|
+
var _useContext3 = react.useContext(ChangableAmountContext),
|
|
73568
|
+
amount = _useContext3.amount,
|
|
73569
|
+
amountsMissing = _useContext3.amountsMissing;
|
|
72609
73570
|
|
|
72610
73571
|
var _useContext4 = react.useContext(PaymentValueContext),
|
|
72611
73572
|
paymentValue = _useContext4.paymentValue;
|
|
@@ -72613,78 +73574,15 @@ var PaymentOverviewDialog = (function (props) {
|
|
|
72613
73574
|
var _useContext5 = react.useContext(NavigateStackContext_1),
|
|
72614
73575
|
navigate = _useContext5.navigate;
|
|
72615
73576
|
|
|
72616
|
-
var _useContext6 = react.useContext(ClosableContext),
|
|
72617
|
-
close = _useContext6.close;
|
|
72618
|
-
|
|
72619
|
-
var mainAction = function mainAction() {
|
|
72620
|
-
if (paymentState == 'initialized' || paymentState == 'approving') {
|
|
72621
|
-
return /*#__PURE__*/react.createElement("button", {
|
|
72622
|
-
className: ["ButtonPrimary", payment.route.approvalRequired && !payment.route.directTransfer ? 'disabled' : ''].join(' '),
|
|
72623
|
-
onClick: function onClick() {
|
|
72624
|
-
if (payment.route.approvalRequired && !payment.route.directTransfer) {
|
|
72625
|
-
return;
|
|
72626
|
-
}
|
|
72627
|
-
|
|
72628
|
-
pay({
|
|
72629
|
-
navigate: navigate
|
|
72630
|
-
});
|
|
72631
|
-
}
|
|
72632
|
-
}, "Pay ", amount ? new Currency({
|
|
72633
|
-
amount: amount.toFixed(2),
|
|
72634
|
-
code: currencyCode
|
|
72635
|
-
}).toString() : paymentValue.toString().length ? paymentValue.toString() : "".concat(payment.amount));
|
|
72636
|
-
} else if (paymentState == 'paying') {
|
|
72637
|
-
return /*#__PURE__*/react.createElement("a", {
|
|
72638
|
-
className: "ButtonPrimary",
|
|
72639
|
-
title: "Performing the payment - please wait",
|
|
72640
|
-
href: transaction === null || transaction === void 0 ? void 0 : transaction.url,
|
|
72641
|
-
target: "_blank",
|
|
72642
|
-
rel: "noopener noreferrer"
|
|
72643
|
-
}, /*#__PURE__*/react.createElement(LoadingText, null, "Paying"));
|
|
72644
|
-
} else if (paymentState == 'confirmed') {
|
|
72645
|
-
return /*#__PURE__*/react.createElement("button", {
|
|
72646
|
-
className: "ButtonPrimary round",
|
|
72647
|
-
title: "Done",
|
|
72648
|
-
onClick: close
|
|
72649
|
-
}, /*#__PURE__*/react.createElement(Checkmark, null));
|
|
72650
|
-
}
|
|
72651
|
-
};
|
|
72652
|
-
|
|
72653
|
-
var approvalAction = function approvalAction() {
|
|
72654
|
-
if (paymentState == 'initialized') {
|
|
72655
|
-
return /*#__PURE__*/react.createElement("div", {
|
|
72656
|
-
className: "PaddingBottomS"
|
|
72657
|
-
}, /*#__PURE__*/react.createElement("button", {
|
|
72658
|
-
className: "ButtonPrimary wide",
|
|
72659
|
-
onClick: approve,
|
|
72660
|
-
title: "Allow ".concat(payment.symbol, " to be used as payment")
|
|
72661
|
-
}, "Allow ", payment.symbol, " to be used as payment"));
|
|
72662
|
-
} else if (paymentState == 'approving') {
|
|
72663
|
-
return /*#__PURE__*/react.createElement("div", {
|
|
72664
|
-
className: "PaddingBottomS"
|
|
72665
|
-
}, /*#__PURE__*/react.createElement("a", {
|
|
72666
|
-
className: "ButtonPrimary wide",
|
|
72667
|
-
title: "Approving payment token - please wait",
|
|
72668
|
-
href: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
|
|
72669
|
-
target: "_blank",
|
|
72670
|
-
rel: "noopener noreferrer"
|
|
72671
|
-
}, /*#__PURE__*/react.createElement(LoadingText, null, "Approving")));
|
|
72672
|
-
}
|
|
72673
|
-
};
|
|
72674
|
-
|
|
72675
|
-
var actions = function actions() {
|
|
72676
|
-
return /*#__PURE__*/react.createElement("div", null, payment.route.approvalRequired && !payment.route.directTransfer && approvalAction(), mainAction());
|
|
72677
|
-
};
|
|
72678
|
-
|
|
72679
73577
|
if (payment == undefined || paymentValue == undefined) {
|
|
72680
73578
|
return /*#__PURE__*/react.createElement(PaymentOverviewSkeleton, null);
|
|
72681
73579
|
}
|
|
72682
73580
|
|
|
72683
73581
|
return /*#__PURE__*/react.createElement(Dialog, {
|
|
72684
73582
|
header: /*#__PURE__*/react.createElement("div", {
|
|
72685
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
73583
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
72686
73584
|
}, /*#__PURE__*/react.createElement("h1", {
|
|
72687
|
-
className: "LineHeightL FontSizeL
|
|
73585
|
+
className: "LineHeightL FontSizeL"
|
|
72688
73586
|
}, "Payment")),
|
|
72689
73587
|
body: /*#__PURE__*/react.createElement("div", {
|
|
72690
73588
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -72747,8 +73645,8 @@ var PaymentOverviewDialog = (function (props) {
|
|
|
72747
73645
|
className: "CardAction"
|
|
72748
73646
|
}, /*#__PURE__*/react.createElement(ChevronRight, null)))),
|
|
72749
73647
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
72750
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
72751
|
-
},
|
|
73648
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
73649
|
+
}, /*#__PURE__*/react.createElement(Footer, null))
|
|
72752
73650
|
});
|
|
72753
73651
|
});
|
|
72754
73652
|
|
|
@@ -72814,12 +73712,12 @@ var preflight$1 = /*#__PURE__*/function () {
|
|
|
72814
73712
|
|
|
72815
73713
|
var Payment = /*#__PURE__*/function () {
|
|
72816
73714
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(_ref3) {
|
|
72817
|
-
var accept, amount, event, sent, confirmed,
|
|
73715
|
+
var accept, amount, event, sent, confirmed, failed, error, critical, style, whitelist, blacklist, providers, currency, connected, closed, track, document, unmount;
|
|
72818
73716
|
return regenerator.wrap(function _callee2$(_context2) {
|
|
72819
73717
|
while (1) {
|
|
72820
73718
|
switch (_context2.prev = _context2.next) {
|
|
72821
73719
|
case 0:
|
|
72822
|
-
accept = _ref3.accept, amount = _ref3.amount, event = _ref3.event, sent = _ref3.sent, confirmed = _ref3.confirmed,
|
|
73720
|
+
accept = _ref3.accept, amount = _ref3.amount, event = _ref3.event, sent = _ref3.sent, confirmed = _ref3.confirmed, failed = _ref3.failed, error = _ref3.error, critical = _ref3.critical, style = _ref3.style, whitelist = _ref3.whitelist, blacklist = _ref3.blacklist, providers = _ref3.providers, currency = _ref3.currency, connected = _ref3.connected, closed = _ref3.closed, track = _ref3.track, document = _ref3.document;
|
|
72823
73721
|
_context2.prev = 1;
|
|
72824
73722
|
_context2.next = 4;
|
|
72825
73723
|
return preflight$1({
|
|
@@ -72845,15 +73743,15 @@ var Payment = /*#__PURE__*/function () {
|
|
|
72845
73743
|
event: event,
|
|
72846
73744
|
sent: sent,
|
|
72847
73745
|
confirmed: confirmed,
|
|
72848
|
-
ensured: ensured,
|
|
72849
73746
|
failed: failed,
|
|
72850
73747
|
whitelist: whitelist,
|
|
72851
73748
|
blacklist: blacklist,
|
|
72852
|
-
providers: providers
|
|
73749
|
+
providers: providers,
|
|
73750
|
+
track: track
|
|
72853
73751
|
}
|
|
72854
|
-
}, /*#__PURE__*/react.createElement(ClosableProvider, {
|
|
73752
|
+
}, /*#__PURE__*/react.createElement(UpdatableProvider, null, /*#__PURE__*/react.createElement(ClosableProvider, {
|
|
72855
73753
|
unmount: unmount
|
|
72856
|
-
}, /*#__PURE__*/react.createElement(
|
|
73754
|
+
}, /*#__PURE__*/react.createElement(WalletProvider, {
|
|
72857
73755
|
document: document,
|
|
72858
73756
|
container: container,
|
|
72859
73757
|
connected: connected,
|
|
@@ -72865,13 +73763,15 @@ var Payment = /*#__PURE__*/function () {
|
|
|
72865
73763
|
whitelist: whitelist,
|
|
72866
73764
|
blacklist: blacklist,
|
|
72867
73765
|
event: event
|
|
73766
|
+
}, /*#__PURE__*/react.createElement(TrackingProvider, {
|
|
73767
|
+
document: ensureDocument(document)
|
|
72868
73768
|
}, /*#__PURE__*/react.createElement(PaymentProvider, {
|
|
72869
73769
|
container: container,
|
|
72870
73770
|
document: document
|
|
72871
73771
|
}, /*#__PURE__*/react.createElement(PaymentValueProvider, null, /*#__PURE__*/react.createElement(PaymentStack, {
|
|
72872
73772
|
document: document,
|
|
72873
73773
|
container: container
|
|
72874
|
-
})))))))))));
|
|
73774
|
+
}), /*#__PURE__*/react.createElement(PoweredBy, null))))))))))));
|
|
72875
73775
|
};
|
|
72876
73776
|
});
|
|
72877
73777
|
return _context2.abrupt("return", {
|
|
@@ -72981,9 +73881,9 @@ var SaleRoutingProvider = (function (props) {
|
|
|
72981
73881
|
var SaleOverviewSkeleton = (function (props) {
|
|
72982
73882
|
return /*#__PURE__*/react.createElement(Dialog, {
|
|
72983
73883
|
header: /*#__PURE__*/react.createElement("div", {
|
|
72984
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
73884
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
72985
73885
|
}, /*#__PURE__*/react.createElement("h1", {
|
|
72986
|
-
className: "LineHeightL FontSizeL
|
|
73886
|
+
className: "LineHeightL FontSizeL"
|
|
72987
73887
|
}, "Purchase")),
|
|
72988
73888
|
body: /*#__PURE__*/react.createElement("div", {
|
|
72989
73889
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -73000,7 +73900,7 @@ var SaleOverviewSkeleton = (function (props) {
|
|
|
73000
73900
|
className: "SkeletonBackground"
|
|
73001
73901
|
}))),
|
|
73002
73902
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
73003
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
73903
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
73004
73904
|
}, /*#__PURE__*/react.createElement("div", {
|
|
73005
73905
|
className: "SkeletonWrapper"
|
|
73006
73906
|
}, /*#__PURE__*/react.createElement("div", {
|
|
@@ -73012,11 +73912,10 @@ var SaleOverviewSkeleton = (function (props) {
|
|
|
73012
73912
|
});
|
|
73013
73913
|
|
|
73014
73914
|
var SaleOverviewDialog = (function (props) {
|
|
73015
|
-
var _useContext = react.useContext(ChangableAmountContext)
|
|
73016
|
-
|
|
73915
|
+
var _useContext = react.useContext(ChangableAmountContext);
|
|
73916
|
+
_useContext.amount;
|
|
73017
73917
|
|
|
73018
73918
|
var _useContext2 = react.useContext(ConfigurationContext),
|
|
73019
|
-
currencyCode = _useContext2.currencyCode,
|
|
73020
73919
|
tokenImage = _useContext2.tokenImage;
|
|
73021
73920
|
|
|
73022
73921
|
var _useContext3 = react.useContext(PaymentValueContext),
|
|
@@ -73024,87 +73923,20 @@ var SaleOverviewDialog = (function (props) {
|
|
|
73024
73923
|
|
|
73025
73924
|
var _useContext4 = react.useContext(PaymentContext),
|
|
73026
73925
|
payment = _useContext4.payment,
|
|
73027
|
-
paymentState = _useContext4.paymentState
|
|
73028
|
-
pay = _useContext4.pay,
|
|
73029
|
-
transaction = _useContext4.transaction,
|
|
73030
|
-
approve = _useContext4.approve,
|
|
73031
|
-
approvalTransaction = _useContext4.approvalTransaction;
|
|
73926
|
+
paymentState = _useContext4.paymentState;
|
|
73032
73927
|
|
|
73033
73928
|
var _useContext5 = react.useContext(NavigateStackContext_1),
|
|
73034
73929
|
navigate = _useContext5.navigate;
|
|
73035
73930
|
|
|
73036
|
-
var _useContext6 = react.useContext(
|
|
73037
|
-
|
|
73038
|
-
|
|
73039
|
-
var _useContext7 = react.useContext(ToTokenContext),
|
|
73040
|
-
toToken = _useContext7.toToken,
|
|
73041
|
-
toTokenReadableAmount = _useContext7.toTokenReadableAmount;
|
|
73931
|
+
var _useContext6 = react.useContext(ToTokenContext),
|
|
73932
|
+
toToken = _useContext6.toToken,
|
|
73933
|
+
toTokenReadableAmount = _useContext6.toTokenReadableAmount;
|
|
73042
73934
|
|
|
73043
73935
|
var _useState = react.useState(),
|
|
73044
73936
|
_useState2 = _slicedToArray(_useState, 2),
|
|
73045
73937
|
salePerTokenValue = _useState2[0],
|
|
73046
73938
|
setSalePerTokenValue = _useState2[1];
|
|
73047
73939
|
|
|
73048
|
-
var mainAction = function mainAction() {
|
|
73049
|
-
if (paymentState == 'initialized' || paymentState == 'approving') {
|
|
73050
|
-
return /*#__PURE__*/react.createElement("button", {
|
|
73051
|
-
className: ["ButtonPrimary", payment.route.approvalRequired && !payment.route.directTransfer ? 'disabled' : ''].join(' '),
|
|
73052
|
-
onClick: function onClick() {
|
|
73053
|
-
if (payment.route.approvalRequired && !payment.route.directTransfer) {
|
|
73054
|
-
return;
|
|
73055
|
-
}
|
|
73056
|
-
|
|
73057
|
-
pay({
|
|
73058
|
-
navigate: navigate
|
|
73059
|
-
});
|
|
73060
|
-
}
|
|
73061
|
-
}, "Pay ", new Currency({
|
|
73062
|
-
amount: amount.toFixed(2),
|
|
73063
|
-
code: currencyCode
|
|
73064
|
-
}).toString());
|
|
73065
|
-
} else if (paymentState == 'paying') {
|
|
73066
|
-
return /*#__PURE__*/react.createElement("a", {
|
|
73067
|
-
className: "ButtonPrimary",
|
|
73068
|
-
title: "Performing the payment - please wait",
|
|
73069
|
-
href: transaction === null || transaction === void 0 ? void 0 : transaction.url,
|
|
73070
|
-
target: "_blank",
|
|
73071
|
-
rel: "noopener noreferrer"
|
|
73072
|
-
}, /*#__PURE__*/react.createElement(LoadingText, null, "Paying"));
|
|
73073
|
-
} else if (paymentState == 'confirmed') {
|
|
73074
|
-
return /*#__PURE__*/react.createElement("button", {
|
|
73075
|
-
className: "ButtonPrimary round",
|
|
73076
|
-
title: "Done",
|
|
73077
|
-
onClick: close
|
|
73078
|
-
}, /*#__PURE__*/react.createElement(Checkmark, null));
|
|
73079
|
-
}
|
|
73080
|
-
};
|
|
73081
|
-
|
|
73082
|
-
var approvalAction = function approvalAction() {
|
|
73083
|
-
if (paymentState == 'initialized') {
|
|
73084
|
-
return /*#__PURE__*/react.createElement("div", {
|
|
73085
|
-
className: "PaddingBottomS"
|
|
73086
|
-
}, /*#__PURE__*/react.createElement("button", {
|
|
73087
|
-
className: "ButtonPrimary wide",
|
|
73088
|
-
onClick: approve,
|
|
73089
|
-
title: "Allow ".concat(payment.symbol, " to be used as payment")
|
|
73090
|
-
}, "Allow ", payment.symbol, " to be used as payment"));
|
|
73091
|
-
} else if (paymentState == 'approving') {
|
|
73092
|
-
return /*#__PURE__*/react.createElement("div", {
|
|
73093
|
-
className: "PaddingBottomS"
|
|
73094
|
-
}, /*#__PURE__*/react.createElement("a", {
|
|
73095
|
-
className: "ButtonPrimary wide",
|
|
73096
|
-
title: "Approving payment token - please wait",
|
|
73097
|
-
href: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
|
|
73098
|
-
target: "_blank",
|
|
73099
|
-
rel: "noopener noreferrer"
|
|
73100
|
-
}, /*#__PURE__*/react.createElement(LoadingText, null, "Approving")));
|
|
73101
|
-
}
|
|
73102
|
-
};
|
|
73103
|
-
|
|
73104
|
-
var actions = function actions() {
|
|
73105
|
-
return /*#__PURE__*/react.createElement("div", null, payment.route.approvalRequired && !payment.route.directTransfer && approvalAction(), mainAction());
|
|
73106
|
-
};
|
|
73107
|
-
|
|
73108
73940
|
react.useEffect(function () {
|
|
73109
73941
|
if (paymentValue) {
|
|
73110
73942
|
setSalePerTokenValue(new Currency({
|
|
@@ -73133,9 +73965,9 @@ var SaleOverviewDialog = (function (props) {
|
|
|
73133
73965
|
|
|
73134
73966
|
return /*#__PURE__*/react.createElement(Dialog, {
|
|
73135
73967
|
header: /*#__PURE__*/react.createElement("div", {
|
|
73136
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
73968
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
73137
73969
|
}, /*#__PURE__*/react.createElement("h1", {
|
|
73138
|
-
className: "LineHeightL FontSizeL
|
|
73970
|
+
className: "LineHeightL FontSizeL"
|
|
73139
73971
|
}, "Purchase")),
|
|
73140
73972
|
body: /*#__PURE__*/react.createElement("div", {
|
|
73141
73973
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -73204,8 +74036,8 @@ var SaleOverviewDialog = (function (props) {
|
|
|
73204
74036
|
className: "CardAction"
|
|
73205
74037
|
}, /*#__PURE__*/react.createElement(ChevronRight, null)))),
|
|
73206
74038
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
73207
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
73208
|
-
},
|
|
74039
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
74040
|
+
}, /*#__PURE__*/react.createElement(Footer, null))
|
|
73209
74041
|
});
|
|
73210
74042
|
});
|
|
73211
74043
|
|
|
@@ -73278,12 +74110,12 @@ var preflight = /*#__PURE__*/function () {
|
|
|
73278
74110
|
|
|
73279
74111
|
var Sale = /*#__PURE__*/function () {
|
|
73280
74112
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(_ref3) {
|
|
73281
|
-
var amount, sell, sent, confirmed,
|
|
74113
|
+
var amount, sell, sent, confirmed, failed, error, critical, style, blacklist, providers, currency, connected, closed, tokenImage, document, accept, unmount;
|
|
73282
74114
|
return regenerator.wrap(function _callee2$(_context2) {
|
|
73283
74115
|
while (1) {
|
|
73284
74116
|
switch (_context2.prev = _context2.next) {
|
|
73285
74117
|
case 0:
|
|
73286
|
-
amount = _ref3.amount, sell = _ref3.sell, sent = _ref3.sent, confirmed = _ref3.confirmed,
|
|
74118
|
+
amount = _ref3.amount, sell = _ref3.sell, sent = _ref3.sent, confirmed = _ref3.confirmed, failed = _ref3.failed, error = _ref3.error, critical = _ref3.critical, style = _ref3.style, blacklist = _ref3.blacklist, providers = _ref3.providers, currency = _ref3.currency, connected = _ref3.connected, closed = _ref3.closed, tokenImage = _ref3.tokenImage, document = _ref3.document;
|
|
73287
74119
|
_context2.prev = 1;
|
|
73288
74120
|
_context2.next = 4;
|
|
73289
74121
|
return preflight({
|
|
@@ -73315,26 +74147,27 @@ var Sale = /*#__PURE__*/function () {
|
|
|
73315
74147
|
currency: currency,
|
|
73316
74148
|
sent: sent,
|
|
73317
74149
|
confirmed: confirmed,
|
|
73318
|
-
ensured: ensured,
|
|
73319
74150
|
failed: failed,
|
|
73320
74151
|
blacklist: blacklist,
|
|
73321
74152
|
providers: providers
|
|
73322
74153
|
}
|
|
73323
|
-
}, /*#__PURE__*/react.createElement(ClosableProvider, {
|
|
74154
|
+
}, /*#__PURE__*/react.createElement(UpdatableProvider, null, /*#__PURE__*/react.createElement(ClosableProvider, {
|
|
73324
74155
|
unmount: unmount
|
|
73325
|
-
}, /*#__PURE__*/react.createElement(
|
|
74156
|
+
}, /*#__PURE__*/react.createElement(WalletProvider, {
|
|
73326
74157
|
container: container,
|
|
73327
74158
|
connected: connected,
|
|
73328
74159
|
unmount: unmount
|
|
73329
74160
|
}, /*#__PURE__*/react.createElement(ConversionRateProvider, null, /*#__PURE__*/react.createElement(ChangableAmountProvider, {
|
|
73330
74161
|
accept: accept
|
|
74162
|
+
}, /*#__PURE__*/react.createElement(TrackingProvider, {
|
|
74163
|
+
document: ensureDocument(document)
|
|
73331
74164
|
}, /*#__PURE__*/react.createElement(SaleRoutingProvider, {
|
|
73332
74165
|
container: container,
|
|
73333
74166
|
document: document
|
|
73334
74167
|
}, /*#__PURE__*/react.createElement(SaleStack, {
|
|
73335
74168
|
document: document,
|
|
73336
74169
|
container: container
|
|
73337
|
-
})))))))));
|
|
74170
|
+
}), /*#__PURE__*/react.createElement(PoweredBy, null))))))))));
|
|
73338
74171
|
};
|
|
73339
74172
|
});
|
|
73340
74173
|
return _context2.abrupt("return", {
|