@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/es/index.bundle.js
CHANGED
|
@@ -37,17 +37,11 @@ function _asyncToGenerator(fn) {
|
|
|
37
37
|
function _typeof(obj) {
|
|
38
38
|
"@babel/helpers - typeof";
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
_typeof = function _typeof(obj) {
|
|
46
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return _typeof(obj);
|
|
40
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
41
|
+
return typeof obj;
|
|
42
|
+
} : function (obj) {
|
|
43
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
44
|
+
}, _typeof(obj);
|
|
51
45
|
}
|
|
52
46
|
|
|
53
47
|
var commonjsGlobal$4 = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
@@ -1028,6 +1022,8 @@ var react = createCommonjsModule$4(function (module) {
|
|
|
1028
1022
|
|
|
1029
1023
|
var ClosableContext = /*#__PURE__*/react.createContext();
|
|
1030
1024
|
|
|
1025
|
+
var UpdatableContext = /*#__PURE__*/react.createContext();
|
|
1026
|
+
|
|
1031
1027
|
var ClosableProvider = (function (props) {
|
|
1032
1028
|
var _useState = react.useState(true),
|
|
1033
1029
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -1039,11 +1035,15 @@ var ClosableProvider = (function (props) {
|
|
|
1039
1035
|
open = _useState4[0],
|
|
1040
1036
|
setOpen = _useState4[1];
|
|
1041
1037
|
|
|
1038
|
+
var _useContext = react.useContext(UpdatableContext),
|
|
1039
|
+
setUpdatable = _useContext.setUpdatable;
|
|
1040
|
+
|
|
1042
1041
|
var close = function close() {
|
|
1043
1042
|
if (!closable) {
|
|
1044
1043
|
return;
|
|
1045
1044
|
}
|
|
1046
1045
|
|
|
1046
|
+
setUpdatable(false);
|
|
1047
1047
|
setOpen(false);
|
|
1048
1048
|
setTimeout(props.unmount, 300);
|
|
1049
1049
|
};
|
|
@@ -1989,12 +1989,7 @@ var Dialog = (function (props) {
|
|
|
1989
1989
|
className: "DialogBody"
|
|
1990
1990
|
}, props.body), /*#__PURE__*/react.createElement("div", {
|
|
1991
1991
|
className: "DialogFooter"
|
|
1992
|
-
}, props.footer
|
|
1993
|
-
href: 'https://depay.fi?utm_source=' + window.location.hostname + '&utm_medium=widget&utm_campaign=WidgetV2',
|
|
1994
|
-
rel: "noopener noreferrer",
|
|
1995
|
-
target: "_blank",
|
|
1996
|
-
className: "FooterLink"
|
|
1997
|
-
}, "by DePay")));
|
|
1992
|
+
}, props.footer));
|
|
1998
1993
|
});
|
|
1999
1994
|
|
|
2000
1995
|
var ConnectingWalletDialog = (function (props) {
|
|
@@ -2044,9 +2039,9 @@ var ConnectingWalletDialog = (function (props) {
|
|
|
2044
2039
|
className: "TextButton"
|
|
2045
2040
|
}, "Connect with another wallet")))),
|
|
2046
2041
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
2047
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
2042
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
2048
2043
|
}, /*#__PURE__*/react.createElement("button", {
|
|
2049
|
-
className: "ButtonPrimary
|
|
2044
|
+
className: "ButtonPrimary",
|
|
2050
2045
|
onClick: function onClick() {
|
|
2051
2046
|
return props.connect(wallet);
|
|
2052
2047
|
}
|
|
@@ -2409,7 +2404,7 @@ var es$1 = /*#__PURE__*/Object.freeze({
|
|
|
2409
2404
|
let CONSTANTS = {
|
|
2410
2405
|
ZERO: '0x0000000000000000000000000000000000000000',
|
|
2411
2406
|
MAXINT: '115792089237316195423570985008687907853269984665640564039457584007913129639935',
|
|
2412
|
-
WRAPPED: '
|
|
2407
|
+
WRAPPED: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
|
|
2413
2408
|
NATIVE: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
|
|
2414
2409
|
DECIMALS: 18,
|
|
2415
2410
|
SYMBOL: 'ETH',
|
|
@@ -11354,7 +11349,7 @@ function throwFault$6(fault, operation, value) {
|
|
|
11354
11349
|
return logger$H.throwError(fault, Logger$4.errors.NUMERIC_FAULT, params);
|
|
11355
11350
|
}
|
|
11356
11351
|
// value should have no prefix
|
|
11357
|
-
function _base36To16$
|
|
11352
|
+
function _base36To16$3(value) {
|
|
11358
11353
|
return (new BN$4(value, 36)).toString(16);
|
|
11359
11354
|
}
|
|
11360
11355
|
|
|
@@ -12819,7 +12814,7 @@ class Reader$1 {
|
|
|
12819
12814
|
}
|
|
12820
12815
|
}
|
|
12821
12816
|
|
|
12822
|
-
var sha3$
|
|
12817
|
+
var sha3$4 = createCommonjsModule$4(function (module) {
|
|
12823
12818
|
/*jslint bitwise: true */
|
|
12824
12819
|
(function () {
|
|
12825
12820
|
|
|
@@ -13463,10 +13458,10 @@ var sha3$3 = createCommonjsModule$4(function (module) {
|
|
|
13463
13458
|
})();
|
|
13464
13459
|
});
|
|
13465
13460
|
|
|
13466
|
-
var sha3$
|
|
13461
|
+
var sha3$5 = sha3$4;
|
|
13467
13462
|
|
|
13468
|
-
function keccak256$
|
|
13469
|
-
return '0x' + sha3$
|
|
13463
|
+
function keccak256$3(data) {
|
|
13464
|
+
return '0x' + sha3$5.keccak_256(arrayify$3(data));
|
|
13470
13465
|
}
|
|
13471
13466
|
|
|
13472
13467
|
const version$s = "rlp/5.5.0";
|
|
@@ -13516,7 +13511,7 @@ function encode$4(object) {
|
|
|
13516
13511
|
const version$r = "address/5.5.0";
|
|
13517
13512
|
|
|
13518
13513
|
const logger$B = new Logger$4(version$r);
|
|
13519
|
-
function getChecksumAddress$
|
|
13514
|
+
function getChecksumAddress$3(address) {
|
|
13520
13515
|
if (!isHexString$4(address, 20)) {
|
|
13521
13516
|
logger$B.throwArgumentError("invalid address", "address", address);
|
|
13522
13517
|
}
|
|
@@ -13526,7 +13521,7 @@ function getChecksumAddress$2(address) {
|
|
|
13526
13521
|
for (let i = 0; i < 40; i++) {
|
|
13527
13522
|
expanded[i] = chars[i].charCodeAt(0);
|
|
13528
13523
|
}
|
|
13529
|
-
const hashed = arrayify$3(keccak256$
|
|
13524
|
+
const hashed = arrayify$3(keccak256$3(expanded));
|
|
13530
13525
|
for (let i = 0; i < 40; i += 2) {
|
|
13531
13526
|
if ((hashed[i >> 1] >> 4) >= 8) {
|
|
13532
13527
|
chars[i] = chars[i].toUpperCase();
|
|
@@ -13538,8 +13533,8 @@ function getChecksumAddress$2(address) {
|
|
|
13538
13533
|
return "0x" + chars.join("");
|
|
13539
13534
|
}
|
|
13540
13535
|
// Shims for environments that are missing some required constants and functions
|
|
13541
|
-
const MAX_SAFE_INTEGER$
|
|
13542
|
-
function log10$
|
|
13536
|
+
const MAX_SAFE_INTEGER$4 = 0x1fffffffffffff;
|
|
13537
|
+
function log10$4(x) {
|
|
13543
13538
|
if (Math.log10) {
|
|
13544
13539
|
return Math.log10(x);
|
|
13545
13540
|
}
|
|
@@ -13547,22 +13542,22 @@ function log10$3(x) {
|
|
|
13547
13542
|
}
|
|
13548
13543
|
// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number
|
|
13549
13544
|
// Create lookup table
|
|
13550
|
-
const ibanLookup$
|
|
13545
|
+
const ibanLookup$3 = {};
|
|
13551
13546
|
for (let i = 0; i < 10; i++) {
|
|
13552
|
-
ibanLookup$
|
|
13547
|
+
ibanLookup$3[String(i)] = String(i);
|
|
13553
13548
|
}
|
|
13554
13549
|
for (let i = 0; i < 26; i++) {
|
|
13555
|
-
ibanLookup$
|
|
13550
|
+
ibanLookup$3[String.fromCharCode(65 + i)] = String(10 + i);
|
|
13556
13551
|
}
|
|
13557
13552
|
// How many decimal digits can we process? (for 64-bit float, this is 15)
|
|
13558
|
-
const safeDigits$
|
|
13559
|
-
function ibanChecksum$
|
|
13553
|
+
const safeDigits$3 = Math.floor(log10$4(MAX_SAFE_INTEGER$4));
|
|
13554
|
+
function ibanChecksum$3(address) {
|
|
13560
13555
|
address = address.toUpperCase();
|
|
13561
13556
|
address = address.substring(4) + address.substring(0, 2) + "00";
|
|
13562
|
-
let expanded = address.split("").map((c) => { return ibanLookup$
|
|
13557
|
+
let expanded = address.split("").map((c) => { return ibanLookup$3[c]; }).join("");
|
|
13563
13558
|
// Javascript can handle integers safely up to 15 (decimal) digits
|
|
13564
|
-
while (expanded.length >= safeDigits$
|
|
13565
|
-
let block = expanded.substring(0, safeDigits$
|
|
13559
|
+
while (expanded.length >= safeDigits$3) {
|
|
13560
|
+
let block = expanded.substring(0, safeDigits$3);
|
|
13566
13561
|
expanded = parseInt(block, 10) % 97 + expanded.substring(block.length);
|
|
13567
13562
|
}
|
|
13568
13563
|
let checksum = String(98 - (parseInt(expanded, 10) % 97));
|
|
@@ -13571,7 +13566,7 @@ function ibanChecksum$2(address) {
|
|
|
13571
13566
|
}
|
|
13572
13567
|
return checksum;
|
|
13573
13568
|
}
|
|
13574
|
-
function getAddress$
|
|
13569
|
+
function getAddress$3(address) {
|
|
13575
13570
|
let result = null;
|
|
13576
13571
|
if (typeof (address) !== "string") {
|
|
13577
13572
|
logger$B.throwArgumentError("invalid address", "address", address);
|
|
@@ -13581,7 +13576,7 @@ function getAddress$2(address) {
|
|
|
13581
13576
|
if (address.substring(0, 2) !== "0x") {
|
|
13582
13577
|
address = "0x" + address;
|
|
13583
13578
|
}
|
|
13584
|
-
result = getChecksumAddress$
|
|
13579
|
+
result = getChecksumAddress$3(address);
|
|
13585
13580
|
// It is a checksummed address with a bad checksum
|
|
13586
13581
|
if (address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) && result !== address) {
|
|
13587
13582
|
logger$B.throwArgumentError("bad address checksum", "address", address);
|
|
@@ -13590,14 +13585,14 @@ function getAddress$2(address) {
|
|
|
13590
13585
|
}
|
|
13591
13586
|
else if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {
|
|
13592
13587
|
// It is an ICAP address with a bad checksum
|
|
13593
|
-
if (address.substring(2, 4) !== ibanChecksum$
|
|
13588
|
+
if (address.substring(2, 4) !== ibanChecksum$3(address)) {
|
|
13594
13589
|
logger$B.throwArgumentError("bad icap checksum", "address", address);
|
|
13595
13590
|
}
|
|
13596
|
-
result = _base36To16$
|
|
13591
|
+
result = _base36To16$3(address.substring(4));
|
|
13597
13592
|
while (result.length < 40) {
|
|
13598
13593
|
result = "0" + result;
|
|
13599
13594
|
}
|
|
13600
|
-
result = getChecksumAddress$
|
|
13595
|
+
result = getChecksumAddress$3("0x" + result);
|
|
13601
13596
|
}
|
|
13602
13597
|
else {
|
|
13603
13598
|
logger$B.throwArgumentError("invalid address", "address", address);
|
|
@@ -13608,13 +13603,13 @@ function getAddress$2(address) {
|
|
|
13608
13603
|
function getContractAddress$2(transaction) {
|
|
13609
13604
|
let from = null;
|
|
13610
13605
|
try {
|
|
13611
|
-
from = getAddress$
|
|
13606
|
+
from = getAddress$3(transaction.from);
|
|
13612
13607
|
}
|
|
13613
13608
|
catch (error) {
|
|
13614
13609
|
logger$B.throwArgumentError("missing from address", "transaction", transaction);
|
|
13615
13610
|
}
|
|
13616
13611
|
const nonce = stripZeros$2(arrayify$3(BigNumber$4.from(transaction.nonce).toHexString()));
|
|
13617
|
-
return getAddress$
|
|
13612
|
+
return getAddress$3(hexDataSlice$2(keccak256$3(encode$4([from, nonce])), 12));
|
|
13618
13613
|
}
|
|
13619
13614
|
|
|
13620
13615
|
class AddressCoder$1 extends Coder$1 {
|
|
@@ -13626,7 +13621,7 @@ class AddressCoder$1 extends Coder$1 {
|
|
|
13626
13621
|
}
|
|
13627
13622
|
encode(writer, value) {
|
|
13628
13623
|
try {
|
|
13629
|
-
value = getAddress$
|
|
13624
|
+
value = getAddress$3(value);
|
|
13630
13625
|
}
|
|
13631
13626
|
catch (error) {
|
|
13632
13627
|
this._throwError(error.message, value);
|
|
@@ -13634,7 +13629,7 @@ class AddressCoder$1 extends Coder$1 {
|
|
|
13634
13629
|
return writer.writeValue(value);
|
|
13635
13630
|
}
|
|
13636
13631
|
decode(reader) {
|
|
13637
|
-
return getAddress$
|
|
13632
|
+
return getAddress$3(hexZeroPad$3(reader.readValue().toHexString(), 20));
|
|
13638
13633
|
}
|
|
13639
13634
|
}
|
|
13640
13635
|
|
|
@@ -14347,7 +14342,7 @@ class AbiCoder$1 {
|
|
|
14347
14342
|
const defaultAbiCoder$1 = new AbiCoder$1();
|
|
14348
14343
|
|
|
14349
14344
|
function id$2(text) {
|
|
14350
|
-
return keccak256$
|
|
14345
|
+
return keccak256$3(toUtf8Bytes$2(text));
|
|
14351
14346
|
}
|
|
14352
14347
|
|
|
14353
14348
|
const logger$x = new Logger$4(version$t);
|
|
@@ -14464,7 +14459,7 @@ class Interface$1 {
|
|
|
14464
14459
|
return defaultAbiCoder$1;
|
|
14465
14460
|
}
|
|
14466
14461
|
static getAddress(address) {
|
|
14467
|
-
return getAddress$
|
|
14462
|
+
return getAddress$3(address);
|
|
14468
14463
|
}
|
|
14469
14464
|
static getSighash(fragment) {
|
|
14470
14465
|
return hexDataSlice$2(id$2(fragment.format()), 0, 4);
|
|
@@ -14709,7 +14704,7 @@ class Interface$1 {
|
|
|
14709
14704
|
return id$2(value);
|
|
14710
14705
|
}
|
|
14711
14706
|
else if (param.type === "bytes") {
|
|
14712
|
-
return keccak256$
|
|
14707
|
+
return keccak256$3(hexlify$4(value));
|
|
14713
14708
|
}
|
|
14714
14709
|
// Check addresses are valid
|
|
14715
14710
|
if (param.type === "address") {
|
|
@@ -14764,7 +14759,7 @@ class Interface$1 {
|
|
|
14764
14759
|
topics.push(id$2(value));
|
|
14765
14760
|
}
|
|
14766
14761
|
else if (param.type === "bytes") {
|
|
14767
|
-
topics.push(keccak256$
|
|
14762
|
+
topics.push(keccak256$3(value));
|
|
14768
14763
|
}
|
|
14769
14764
|
else if (param.baseType === "tuple" || param.baseType === "array") {
|
|
14770
14765
|
// @TODO
|
|
@@ -15301,7 +15296,7 @@ var TransactionTypes$2;
|
|
|
15301
15296
|
})(TransactionTypes$2 || (TransactionTypes$2 = {}));
|
|
15302
15297
|
function accessSetify$2(addr, storageKeys) {
|
|
15303
15298
|
return {
|
|
15304
|
-
address: getAddress$
|
|
15299
|
+
address: getAddress$3(addr),
|
|
15305
15300
|
storageKeys: (storageKeys || []).map((storageKey, index) => {
|
|
15306
15301
|
if (hexDataLength$2(storageKey) !== 32) {
|
|
15307
15302
|
logger$u.throwArgumentError("invalid access list storageKey", `accessList[${addr}:${index}]`, storageKey);
|
|
@@ -15353,7 +15348,7 @@ function resolveName$1(resolver, nameOrPromise) {
|
|
|
15353
15348
|
}
|
|
15354
15349
|
// If it is already an address, just use it (after adding checksum)
|
|
15355
15350
|
try {
|
|
15356
|
-
return getAddress$
|
|
15351
|
+
return getAddress$3(name);
|
|
15357
15352
|
}
|
|
15358
15353
|
catch (error) { }
|
|
15359
15354
|
if (!resolver) {
|
|
@@ -15412,7 +15407,7 @@ function populateTransaction$1(contract, fragment, args) {
|
|
|
15412
15407
|
override: resolveName$1(contract.signer, overrides.from),
|
|
15413
15408
|
signer: contract.signer.getAddress()
|
|
15414
15409
|
}).then((check) => __awaiter$a(this, void 0, void 0, function* () {
|
|
15415
|
-
if (getAddress$
|
|
15410
|
+
if (getAddress$3(check.signer) !== check.override) {
|
|
15416
15411
|
logger$t.throwError("Contract with a Signer cannot override from", Logger$4.errors.UNSUPPORTED_OPERATION, {
|
|
15417
15412
|
operation: "overrides.from"
|
|
15418
15413
|
});
|
|
@@ -15848,7 +15843,7 @@ class BaseContract$1 {
|
|
|
15848
15843
|
}
|
|
15849
15844
|
else {
|
|
15850
15845
|
try {
|
|
15851
|
-
defineReadOnly$2(this, "resolvedAddress", Promise.resolve(getAddress$
|
|
15846
|
+
defineReadOnly$2(this, "resolvedAddress", Promise.resolve(getAddress$3(addressOrName)));
|
|
15852
15847
|
}
|
|
15853
15848
|
catch (error) {
|
|
15854
15849
|
// Without a provider, we cannot use ENS names
|
|
@@ -20913,7 +20908,7 @@ function throwFault$4(fault, operation, value) {
|
|
|
20913
20908
|
return logger$e$1.throwError(fault, Logger$3.errors.NUMERIC_FAULT, params);
|
|
20914
20909
|
}
|
|
20915
20910
|
// value should have no prefix
|
|
20916
|
-
function _base36To16$
|
|
20911
|
+
function _base36To16$2(value) {
|
|
20917
20912
|
return (new BN$3(value, 36)).toString(16);
|
|
20918
20913
|
}
|
|
20919
20914
|
|
|
@@ -22119,7 +22114,7 @@ const Base58$1 = new BaseX$1("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqr
|
|
|
22119
22114
|
* @license MIT
|
|
22120
22115
|
*/
|
|
22121
22116
|
|
|
22122
|
-
var sha3$
|
|
22117
|
+
var sha3$3 = createCommonjsModule$1$2(function (module) {
|
|
22123
22118
|
/*jslint bitwise: true */
|
|
22124
22119
|
(function () {
|
|
22125
22120
|
|
|
@@ -22588,14 +22583,14 @@ var sha3$2 = createCommonjsModule$1$2(function (module) {
|
|
|
22588
22583
|
})();
|
|
22589
22584
|
});
|
|
22590
22585
|
|
|
22591
|
-
var sha3$1$
|
|
22586
|
+
var sha3$1$2 = sha3$3;
|
|
22592
22587
|
|
|
22593
|
-
function keccak256$
|
|
22594
|
-
return '0x' + sha3$1$
|
|
22588
|
+
function keccak256$2(data) {
|
|
22589
|
+
return '0x' + sha3$1$2.keccak_256(arrayify$2(data));
|
|
22595
22590
|
}
|
|
22596
22591
|
|
|
22597
22592
|
function id$1(text) {
|
|
22598
|
-
return keccak256$
|
|
22593
|
+
return keccak256$2(toUtf8Bytes$1(text));
|
|
22599
22594
|
}
|
|
22600
22595
|
|
|
22601
22596
|
const version$7$1 = "hash/5.4.0";
|
|
@@ -22617,7 +22612,7 @@ function namehash$1(name) {
|
|
|
22617
22612
|
logger$9$1.throwArgumentError("invalid ENS address; missing component", "name", name);
|
|
22618
22613
|
}
|
|
22619
22614
|
const label = toUtf8Bytes$1(nameprep$1(partition[3]));
|
|
22620
|
-
result = keccak256$
|
|
22615
|
+
result = keccak256$2(concat$1([result, keccak256$2(label)]));
|
|
22621
22616
|
current = partition[2] || "";
|
|
22622
22617
|
}
|
|
22623
22618
|
return hexlify$3(result);
|
|
@@ -22740,10 +22735,10 @@ function decode$1$1(data) {
|
|
|
22740
22735
|
return decoded.result;
|
|
22741
22736
|
}
|
|
22742
22737
|
|
|
22743
|
-
const version$5$
|
|
22738
|
+
const version$5$2 = "address/5.4.0";
|
|
22744
22739
|
|
|
22745
|
-
const logger$7$1 = new Logger$3(version$5$
|
|
22746
|
-
function getChecksumAddress$
|
|
22740
|
+
const logger$7$1 = new Logger$3(version$5$2);
|
|
22741
|
+
function getChecksumAddress$2(address) {
|
|
22747
22742
|
if (!isHexString$3(address, 20)) {
|
|
22748
22743
|
logger$7$1.throwArgumentError("invalid address", "address", address);
|
|
22749
22744
|
}
|
|
@@ -22753,7 +22748,7 @@ function getChecksumAddress$1(address) {
|
|
|
22753
22748
|
for (let i = 0; i < 40; i++) {
|
|
22754
22749
|
expanded[i] = chars[i].charCodeAt(0);
|
|
22755
22750
|
}
|
|
22756
|
-
const hashed = arrayify$2(keccak256$
|
|
22751
|
+
const hashed = arrayify$2(keccak256$2(expanded));
|
|
22757
22752
|
for (let i = 0; i < 40; i += 2) {
|
|
22758
22753
|
if ((hashed[i >> 1] >> 4) >= 8) {
|
|
22759
22754
|
chars[i] = chars[i].toUpperCase();
|
|
@@ -22765,8 +22760,8 @@ function getChecksumAddress$1(address) {
|
|
|
22765
22760
|
return "0x" + chars.join("");
|
|
22766
22761
|
}
|
|
22767
22762
|
// Shims for environments that are missing some required constants and functions
|
|
22768
|
-
const MAX_SAFE_INTEGER$
|
|
22769
|
-
function log10$
|
|
22763
|
+
const MAX_SAFE_INTEGER$3 = 0x1fffffffffffff;
|
|
22764
|
+
function log10$3(x) {
|
|
22770
22765
|
if (Math.log10) {
|
|
22771
22766
|
return Math.log10(x);
|
|
22772
22767
|
}
|
|
@@ -22774,22 +22769,22 @@ function log10$2(x) {
|
|
|
22774
22769
|
}
|
|
22775
22770
|
// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number
|
|
22776
22771
|
// Create lookup table
|
|
22777
|
-
const ibanLookup$
|
|
22772
|
+
const ibanLookup$2 = {};
|
|
22778
22773
|
for (let i = 0; i < 10; i++) {
|
|
22779
|
-
ibanLookup$
|
|
22774
|
+
ibanLookup$2[String(i)] = String(i);
|
|
22780
22775
|
}
|
|
22781
22776
|
for (let i = 0; i < 26; i++) {
|
|
22782
|
-
ibanLookup$
|
|
22777
|
+
ibanLookup$2[String.fromCharCode(65 + i)] = String(10 + i);
|
|
22783
22778
|
}
|
|
22784
22779
|
// How many decimal digits can we process? (for 64-bit float, this is 15)
|
|
22785
|
-
const safeDigits$
|
|
22786
|
-
function ibanChecksum$
|
|
22780
|
+
const safeDigits$2 = Math.floor(log10$3(MAX_SAFE_INTEGER$3));
|
|
22781
|
+
function ibanChecksum$2(address) {
|
|
22787
22782
|
address = address.toUpperCase();
|
|
22788
22783
|
address = address.substring(4) + address.substring(0, 2) + "00";
|
|
22789
|
-
let expanded = address.split("").map((c) => { return ibanLookup$
|
|
22784
|
+
let expanded = address.split("").map((c) => { return ibanLookup$2[c]; }).join("");
|
|
22790
22785
|
// Javascript can handle integers safely up to 15 (decimal) digits
|
|
22791
|
-
while (expanded.length >= safeDigits$
|
|
22792
|
-
let block = expanded.substring(0, safeDigits$
|
|
22786
|
+
while (expanded.length >= safeDigits$2) {
|
|
22787
|
+
let block = expanded.substring(0, safeDigits$2);
|
|
22793
22788
|
expanded = parseInt(block, 10) % 97 + expanded.substring(block.length);
|
|
22794
22789
|
}
|
|
22795
22790
|
let checksum = String(98 - (parseInt(expanded, 10) % 97));
|
|
@@ -22798,7 +22793,7 @@ function ibanChecksum$1(address) {
|
|
|
22798
22793
|
}
|
|
22799
22794
|
return checksum;
|
|
22800
22795
|
}
|
|
22801
|
-
function getAddress$
|
|
22796
|
+
function getAddress$2(address) {
|
|
22802
22797
|
let result = null;
|
|
22803
22798
|
if (typeof (address) !== "string") {
|
|
22804
22799
|
logger$7$1.throwArgumentError("invalid address", "address", address);
|
|
@@ -22808,7 +22803,7 @@ function getAddress$1(address) {
|
|
|
22808
22803
|
if (address.substring(0, 2) !== "0x") {
|
|
22809
22804
|
address = "0x" + address;
|
|
22810
22805
|
}
|
|
22811
|
-
result = getChecksumAddress$
|
|
22806
|
+
result = getChecksumAddress$2(address);
|
|
22812
22807
|
// It is a checksummed address with a bad checksum
|
|
22813
22808
|
if (address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) && result !== address) {
|
|
22814
22809
|
logger$7$1.throwArgumentError("bad address checksum", "address", address);
|
|
@@ -22817,14 +22812,14 @@ function getAddress$1(address) {
|
|
|
22817
22812
|
}
|
|
22818
22813
|
else if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {
|
|
22819
22814
|
// It is an ICAP address with a bad checksum
|
|
22820
|
-
if (address.substring(2, 4) !== ibanChecksum$
|
|
22815
|
+
if (address.substring(2, 4) !== ibanChecksum$2(address)) {
|
|
22821
22816
|
logger$7$1.throwArgumentError("bad icap checksum", "address", address);
|
|
22822
22817
|
}
|
|
22823
|
-
result = _base36To16$
|
|
22818
|
+
result = _base36To16$2(address.substring(4));
|
|
22824
22819
|
while (result.length < 40) {
|
|
22825
22820
|
result = "0" + result;
|
|
22826
22821
|
}
|
|
22827
|
-
result = getChecksumAddress$
|
|
22822
|
+
result = getChecksumAddress$2("0x" + result);
|
|
22828
22823
|
}
|
|
22829
22824
|
else {
|
|
22830
22825
|
logger$7$1.throwArgumentError("invalid address", "address", address);
|
|
@@ -22835,13 +22830,13 @@ function getAddress$1(address) {
|
|
|
22835
22830
|
function getContractAddress$1(transaction) {
|
|
22836
22831
|
let from = null;
|
|
22837
22832
|
try {
|
|
22838
|
-
from = getAddress$
|
|
22833
|
+
from = getAddress$2(transaction.from);
|
|
22839
22834
|
}
|
|
22840
22835
|
catch (error) {
|
|
22841
22836
|
logger$7$1.throwArgumentError("missing from address", "transaction", transaction);
|
|
22842
22837
|
}
|
|
22843
22838
|
const nonce = stripZeros$1(arrayify$2(BigNumber$3.from(transaction.nonce).toHexString()));
|
|
22844
|
-
return getAddress$
|
|
22839
|
+
return getAddress$2(hexDataSlice$1(keccak256$2(encode$1$1([from, nonce])), 12));
|
|
22845
22840
|
}
|
|
22846
22841
|
|
|
22847
22842
|
var __awaiter$3$1 = function (thisArg, _arguments, P, generator) {
|
|
@@ -22900,7 +22895,7 @@ const domainChecks$1 = {
|
|
|
22900
22895
|
},
|
|
22901
22896
|
verifyingContract: function (value) {
|
|
22902
22897
|
try {
|
|
22903
|
-
return getAddress$
|
|
22898
|
+
return getAddress$2(value).toLowerCase();
|
|
22904
22899
|
}
|
|
22905
22900
|
catch (error) { }
|
|
22906
22901
|
return logger$6$1.throwArgumentError(`invalid domain value "verifyingContract"`, "domain.verifyingContract", value);
|
|
@@ -22957,13 +22952,13 @@ function getBaseEncoder$1(type) {
|
|
|
22957
22952
|
}
|
|
22958
22953
|
switch (type) {
|
|
22959
22954
|
case "address": return function (value) {
|
|
22960
|
-
return hexZeroPad$2(getAddress$
|
|
22955
|
+
return hexZeroPad$2(getAddress$2(value), 32);
|
|
22961
22956
|
};
|
|
22962
22957
|
case "bool": return function (value) {
|
|
22963
22958
|
return ((!value) ? hexFalse$1 : hexTrue$1);
|
|
22964
22959
|
};
|
|
22965
22960
|
case "bytes": return function (value) {
|
|
22966
|
-
return keccak256$
|
|
22961
|
+
return keccak256$2(value);
|
|
22967
22962
|
};
|
|
22968
22963
|
case "string": return function (value) {
|
|
22969
22964
|
return id$1(value);
|
|
@@ -23079,9 +23074,9 @@ class TypedDataEncoder$1 {
|
|
|
23079
23074
|
}
|
|
23080
23075
|
let result = value.map(subEncoder);
|
|
23081
23076
|
if (this._types[subtype]) {
|
|
23082
|
-
result = result.map(keccak256$
|
|
23077
|
+
result = result.map(keccak256$2);
|
|
23083
23078
|
}
|
|
23084
|
-
return keccak256$
|
|
23079
|
+
return keccak256$2(hexConcat$1(result));
|
|
23085
23080
|
};
|
|
23086
23081
|
}
|
|
23087
23082
|
// Struct
|
|
@@ -23092,7 +23087,7 @@ class TypedDataEncoder$1 {
|
|
|
23092
23087
|
const values = fields.map(({ name, type }) => {
|
|
23093
23088
|
const result = this.getEncoder(type)(value[name]);
|
|
23094
23089
|
if (this._types[type]) {
|
|
23095
|
-
return keccak256$
|
|
23090
|
+
return keccak256$2(result);
|
|
23096
23091
|
}
|
|
23097
23092
|
return result;
|
|
23098
23093
|
});
|
|
@@ -23113,7 +23108,7 @@ class TypedDataEncoder$1 {
|
|
|
23113
23108
|
return this.getEncoder(type)(value);
|
|
23114
23109
|
}
|
|
23115
23110
|
hashStruct(name, value) {
|
|
23116
|
-
return keccak256$
|
|
23111
|
+
return keccak256$2(this.encodeData(name, value));
|
|
23117
23112
|
}
|
|
23118
23113
|
encode(value) {
|
|
23119
23114
|
return this.encodeData(this.primaryType, value);
|
|
@@ -23183,7 +23178,7 @@ class TypedDataEncoder$1 {
|
|
|
23183
23178
|
]);
|
|
23184
23179
|
}
|
|
23185
23180
|
static hash(domain, types, value) {
|
|
23186
|
-
return keccak256$
|
|
23181
|
+
return keccak256$2(TypedDataEncoder$1.encode(domain, types, value));
|
|
23187
23182
|
}
|
|
23188
23183
|
// Replaces all address types with ENS names with their looked up address
|
|
23189
23184
|
static resolveNames(domain, types, value, resolveName) {
|
|
@@ -27174,7 +27169,7 @@ var EC$1$1 = elliptic_1$1.ec;
|
|
|
27174
27169
|
|
|
27175
27170
|
const version$2$3 = "signing-key/5.4.0";
|
|
27176
27171
|
|
|
27177
|
-
const logger$5$
|
|
27172
|
+
const logger$5$2 = new Logger$3(version$2$3);
|
|
27178
27173
|
let _curve$1 = null;
|
|
27179
27174
|
function getCurve$1() {
|
|
27180
27175
|
if (!_curve$1) {
|
|
@@ -27200,7 +27195,7 @@ class SigningKey$1 {
|
|
|
27200
27195
|
const keyPair = getCurve$1().keyFromPrivate(arrayify$2(this.privateKey));
|
|
27201
27196
|
const digestBytes = arrayify$2(digest);
|
|
27202
27197
|
if (digestBytes.length !== 32) {
|
|
27203
|
-
logger$5$
|
|
27198
|
+
logger$5$2.throwArgumentError("bad digest length", "digest", digest);
|
|
27204
27199
|
}
|
|
27205
27200
|
const signature = keyPair.sign(digestBytes, { canonical: true });
|
|
27206
27201
|
return splitSignature$1({
|
|
@@ -27244,7 +27239,7 @@ function computePublicKey$1(key, compressed) {
|
|
|
27244
27239
|
}
|
|
27245
27240
|
return "0x" + getCurve$1().keyFromPublic(bytes).getPublic(true, "hex");
|
|
27246
27241
|
}
|
|
27247
|
-
return logger$5$
|
|
27242
|
+
return logger$5$2.throwArgumentError("invalid public or private key", "key", "[REDACTED]");
|
|
27248
27243
|
}
|
|
27249
27244
|
|
|
27250
27245
|
const version$1$3 = "transactions/5.4.0";
|
|
@@ -27261,7 +27256,7 @@ function handleAddress$1(value) {
|
|
|
27261
27256
|
if (value === "0x") {
|
|
27262
27257
|
return null;
|
|
27263
27258
|
}
|
|
27264
|
-
return getAddress$
|
|
27259
|
+
return getAddress$2(value);
|
|
27265
27260
|
}
|
|
27266
27261
|
function handleNumber$1(value) {
|
|
27267
27262
|
if (value === "0x") {
|
|
@@ -27271,7 +27266,7 @@ function handleNumber$1(value) {
|
|
|
27271
27266
|
}
|
|
27272
27267
|
function computeAddress$1(key) {
|
|
27273
27268
|
const publicKey = computePublicKey$1(key);
|
|
27274
|
-
return getAddress$
|
|
27269
|
+
return getAddress$2(hexDataSlice$1(keccak256$2(hexDataSlice$1(publicKey, 1)), 12));
|
|
27275
27270
|
}
|
|
27276
27271
|
function recoverAddress$1(digest, signature) {
|
|
27277
27272
|
return computeAddress$1(recoverPublicKey$1(arrayify$2(digest), signature));
|
|
@@ -27285,7 +27280,7 @@ function formatNumber$1(value, name) {
|
|
|
27285
27280
|
}
|
|
27286
27281
|
function accessSetify$1(addr, storageKeys) {
|
|
27287
27282
|
return {
|
|
27288
|
-
address: getAddress$
|
|
27283
|
+
address: getAddress$2(addr),
|
|
27289
27284
|
storageKeys: (storageKeys || []).map((storageKey, index) => {
|
|
27290
27285
|
if (hexDataLength$1(storageKey) !== 32) {
|
|
27291
27286
|
logger$4$2.throwArgumentError("invalid access list storageKey", `accessList[${addr}:${index}]`, storageKey);
|
|
@@ -27338,7 +27333,7 @@ function _serializeEip1559$1(transaction, signature) {
|
|
|
27338
27333
|
formatNumber$1(transaction.maxPriorityFeePerGas || 0, "maxPriorityFeePerGas"),
|
|
27339
27334
|
formatNumber$1(transaction.maxFeePerGas || 0, "maxFeePerGas"),
|
|
27340
27335
|
formatNumber$1(transaction.gasLimit || 0, "gasLimit"),
|
|
27341
|
-
((transaction.to != null) ? getAddress$
|
|
27336
|
+
((transaction.to != null) ? getAddress$2(transaction.to) : "0x"),
|
|
27342
27337
|
formatNumber$1(transaction.value || 0, "value"),
|
|
27343
27338
|
(transaction.data || "0x"),
|
|
27344
27339
|
(formatAccessList$1(transaction.accessList || []))
|
|
@@ -27357,7 +27352,7 @@ function _serializeEip2930$1(transaction, signature) {
|
|
|
27357
27352
|
formatNumber$1(transaction.nonce || 0, "nonce"),
|
|
27358
27353
|
formatNumber$1(transaction.gasPrice || 0, "gasPrice"),
|
|
27359
27354
|
formatNumber$1(transaction.gasLimit || 0, "gasLimit"),
|
|
27360
|
-
((transaction.to != null) ? getAddress$
|
|
27355
|
+
((transaction.to != null) ? getAddress$2(transaction.to) : "0x"),
|
|
27361
27356
|
formatNumber$1(transaction.value || 0, "value"),
|
|
27362
27357
|
(transaction.data || "0x"),
|
|
27363
27358
|
(formatAccessList$1(transaction.accessList || []))
|
|
@@ -27384,7 +27379,7 @@ function _parseEipSignature$1(tx, fields, serialize) {
|
|
|
27384
27379
|
tx.r = hexZeroPad$2(fields[1], 32);
|
|
27385
27380
|
tx.s = hexZeroPad$2(fields[2], 32);
|
|
27386
27381
|
try {
|
|
27387
|
-
const digest = keccak256$
|
|
27382
|
+
const digest = keccak256$2(serialize(tx));
|
|
27388
27383
|
tx.from = recoverAddress$1(digest, { r: tx.r, s: tx.s, recoveryParam: tx.v });
|
|
27389
27384
|
}
|
|
27390
27385
|
catch (error) {
|
|
@@ -27415,7 +27410,7 @@ function _parseEip1559$1(payload) {
|
|
|
27415
27410
|
if (transaction.length === 9) {
|
|
27416
27411
|
return tx;
|
|
27417
27412
|
}
|
|
27418
|
-
tx.hash = keccak256$
|
|
27413
|
+
tx.hash = keccak256$2(payload);
|
|
27419
27414
|
_parseEipSignature$1(tx, transaction.slice(9), _serializeEip1559$1);
|
|
27420
27415
|
return tx;
|
|
27421
27416
|
}
|
|
@@ -27439,7 +27434,7 @@ function _parseEip2930$1(payload) {
|
|
|
27439
27434
|
if (transaction.length === 8) {
|
|
27440
27435
|
return tx;
|
|
27441
27436
|
}
|
|
27442
|
-
tx.hash = keccak256$
|
|
27437
|
+
tx.hash = keccak256$2(payload);
|
|
27443
27438
|
_parseEipSignature$1(tx, transaction.slice(8), _serializeEip2930$1);
|
|
27444
27439
|
return tx;
|
|
27445
27440
|
}
|
|
@@ -27490,14 +27485,14 @@ function _parse$1(rawTransaction) {
|
|
|
27490
27485
|
raw.push("0x");
|
|
27491
27486
|
recoveryParam -= tx.chainId * 2 + 8;
|
|
27492
27487
|
}
|
|
27493
|
-
const digest = keccak256$
|
|
27488
|
+
const digest = keccak256$2(encode$1$1(raw));
|
|
27494
27489
|
try {
|
|
27495
27490
|
tx.from = recoverAddress$1(digest, { r: hexlify$3(tx.r), s: hexlify$3(tx.s), recoveryParam: recoveryParam });
|
|
27496
27491
|
}
|
|
27497
27492
|
catch (error) {
|
|
27498
27493
|
console.log(error);
|
|
27499
27494
|
}
|
|
27500
|
-
tx.hash = keccak256$
|
|
27495
|
+
tx.hash = keccak256$2(rawTransaction);
|
|
27501
27496
|
}
|
|
27502
27497
|
tx.type = null;
|
|
27503
27498
|
return tx;
|
|
@@ -27699,13 +27694,13 @@ class Formatter$1 {
|
|
|
27699
27694
|
// Requires an address
|
|
27700
27695
|
// Strict! Used on input.
|
|
27701
27696
|
address(value) {
|
|
27702
|
-
return getAddress$
|
|
27697
|
+
return getAddress$2(value);
|
|
27703
27698
|
}
|
|
27704
27699
|
callAddress(value) {
|
|
27705
27700
|
if (!isHexString$3(value, 32)) {
|
|
27706
27701
|
return null;
|
|
27707
27702
|
}
|
|
27708
|
-
const address = getAddress$
|
|
27703
|
+
const address = getAddress$2(hexDataSlice$1(value, 12));
|
|
27709
27704
|
return (address === AddressZero$1) ? null : address;
|
|
27710
27705
|
}
|
|
27711
27706
|
contractAddress(value) {
|
|
@@ -30524,6 +30519,8 @@ let balance = ({ address, provider }) => {
|
|
|
30524
30519
|
var request$1 = async ({ provider, address, api, method, params }) => {
|
|
30525
30520
|
if (api) {
|
|
30526
30521
|
return contractCall({ address, api, method, params, provider })
|
|
30522
|
+
} else if (method === 'latestBlockNumber') {
|
|
30523
|
+
return provider.getBlockNumber()
|
|
30527
30524
|
} else if (method === 'balance') {
|
|
30528
30525
|
return balance({ address, provider })
|
|
30529
30526
|
}
|
|
@@ -30580,8 +30577,20 @@ var parseUrl = (url) => {
|
|
|
30580
30577
|
if (typeof url == 'object') {
|
|
30581
30578
|
return url
|
|
30582
30579
|
}
|
|
30583
|
-
let deconstructed = url.match(/(?<blockchain>\w+):\/\/(?<
|
|
30584
|
-
|
|
30580
|
+
let deconstructed = url.match(/(?<blockchain>\w+):\/\/(?<part1>[\w\d]+)(\/(?<part2>[\w\d]+))?/);
|
|
30581
|
+
|
|
30582
|
+
if(deconstructed.groups.part2 == undefined) {
|
|
30583
|
+
return {
|
|
30584
|
+
blockchain: deconstructed.groups.blockchain,
|
|
30585
|
+
method: deconstructed.groups.part1
|
|
30586
|
+
}
|
|
30587
|
+
} else {
|
|
30588
|
+
return {
|
|
30589
|
+
blockchain: deconstructed.groups.blockchain,
|
|
30590
|
+
address: deconstructed.groups.part1,
|
|
30591
|
+
method: deconstructed.groups.part2
|
|
30592
|
+
}
|
|
30593
|
+
}
|
|
30585
30594
|
};
|
|
30586
30595
|
|
|
30587
30596
|
let request = async function (url, options) {
|
|
@@ -35070,7 +35079,7 @@ function throwFault$1$1(fault, operation, value) {
|
|
|
35070
35079
|
return logger$o.throwError(fault, Logger$2.errors.NUMERIC_FAULT, params);
|
|
35071
35080
|
}
|
|
35072
35081
|
// value should have no prefix
|
|
35073
|
-
function _base36To16(value) {
|
|
35082
|
+
function _base36To16$1(value) {
|
|
35074
35083
|
return (new BN$2(value, 36)).toString(16);
|
|
35075
35084
|
}
|
|
35076
35085
|
|
|
@@ -36554,7 +36563,7 @@ class Reader {
|
|
|
36554
36563
|
* @license MIT
|
|
36555
36564
|
*/
|
|
36556
36565
|
|
|
36557
|
-
var sha3 = createCommonjsModule$1$1(function (module) {
|
|
36566
|
+
var sha3$2 = createCommonjsModule$1$1(function (module) {
|
|
36558
36567
|
/*jslint bitwise: true */
|
|
36559
36568
|
(function () {
|
|
36560
36569
|
|
|
@@ -37023,10 +37032,10 @@ var sha3 = createCommonjsModule$1$1(function (module) {
|
|
|
37023
37032
|
})();
|
|
37024
37033
|
});
|
|
37025
37034
|
|
|
37026
|
-
var sha3$1 = sha3;
|
|
37035
|
+
var sha3$1$1 = sha3$2;
|
|
37027
37036
|
|
|
37028
|
-
function keccak256(data) {
|
|
37029
|
-
return '0x' + sha3$1.keccak_256(arrayify$1(data));
|
|
37037
|
+
function keccak256$1(data) {
|
|
37038
|
+
return '0x' + sha3$1$1.keccak_256(arrayify$1(data));
|
|
37030
37039
|
}
|
|
37031
37040
|
|
|
37032
37041
|
const version$d = "rlp/5.4.0";
|
|
@@ -37149,7 +37158,7 @@ function decode$1(data) {
|
|
|
37149
37158
|
const version$c = "address/5.4.0";
|
|
37150
37159
|
|
|
37151
37160
|
const logger$i = new Logger$2(version$c);
|
|
37152
|
-
function getChecksumAddress(address) {
|
|
37161
|
+
function getChecksumAddress$1(address) {
|
|
37153
37162
|
if (!isHexString$2(address, 20)) {
|
|
37154
37163
|
logger$i.throwArgumentError("invalid address", "address", address);
|
|
37155
37164
|
}
|
|
@@ -37159,7 +37168,7 @@ function getChecksumAddress(address) {
|
|
|
37159
37168
|
for (let i = 0; i < 40; i++) {
|
|
37160
37169
|
expanded[i] = chars[i].charCodeAt(0);
|
|
37161
37170
|
}
|
|
37162
|
-
const hashed = arrayify$1(keccak256(expanded));
|
|
37171
|
+
const hashed = arrayify$1(keccak256$1(expanded));
|
|
37163
37172
|
for (let i = 0; i < 40; i += 2) {
|
|
37164
37173
|
if ((hashed[i >> 1] >> 4) >= 8) {
|
|
37165
37174
|
chars[i] = chars[i].toUpperCase();
|
|
@@ -37171,8 +37180,8 @@ function getChecksumAddress(address) {
|
|
|
37171
37180
|
return "0x" + chars.join("");
|
|
37172
37181
|
}
|
|
37173
37182
|
// Shims for environments that are missing some required constants and functions
|
|
37174
|
-
const MAX_SAFE_INTEGER$
|
|
37175
|
-
function log10$
|
|
37183
|
+
const MAX_SAFE_INTEGER$2 = 0x1fffffffffffff;
|
|
37184
|
+
function log10$2(x) {
|
|
37176
37185
|
if (Math.log10) {
|
|
37177
37186
|
return Math.log10(x);
|
|
37178
37187
|
}
|
|
@@ -37180,22 +37189,22 @@ function log10$1(x) {
|
|
|
37180
37189
|
}
|
|
37181
37190
|
// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number
|
|
37182
37191
|
// Create lookup table
|
|
37183
|
-
const ibanLookup = {};
|
|
37192
|
+
const ibanLookup$1 = {};
|
|
37184
37193
|
for (let i = 0; i < 10; i++) {
|
|
37185
|
-
ibanLookup[String(i)] = String(i);
|
|
37194
|
+
ibanLookup$1[String(i)] = String(i);
|
|
37186
37195
|
}
|
|
37187
37196
|
for (let i = 0; i < 26; i++) {
|
|
37188
|
-
ibanLookup[String.fromCharCode(65 + i)] = String(10 + i);
|
|
37197
|
+
ibanLookup$1[String.fromCharCode(65 + i)] = String(10 + i);
|
|
37189
37198
|
}
|
|
37190
37199
|
// How many decimal digits can we process? (for 64-bit float, this is 15)
|
|
37191
|
-
const safeDigits = Math.floor(log10$
|
|
37192
|
-
function ibanChecksum(address) {
|
|
37200
|
+
const safeDigits$1 = Math.floor(log10$2(MAX_SAFE_INTEGER$2));
|
|
37201
|
+
function ibanChecksum$1(address) {
|
|
37193
37202
|
address = address.toUpperCase();
|
|
37194
37203
|
address = address.substring(4) + address.substring(0, 2) + "00";
|
|
37195
|
-
let expanded = address.split("").map((c) => { return ibanLookup[c]; }).join("");
|
|
37204
|
+
let expanded = address.split("").map((c) => { return ibanLookup$1[c]; }).join("");
|
|
37196
37205
|
// Javascript can handle integers safely up to 15 (decimal) digits
|
|
37197
|
-
while (expanded.length >= safeDigits) {
|
|
37198
|
-
let block = expanded.substring(0, safeDigits);
|
|
37206
|
+
while (expanded.length >= safeDigits$1) {
|
|
37207
|
+
let block = expanded.substring(0, safeDigits$1);
|
|
37199
37208
|
expanded = parseInt(block, 10) % 97 + expanded.substring(block.length);
|
|
37200
37209
|
}
|
|
37201
37210
|
let checksum = String(98 - (parseInt(expanded, 10) % 97));
|
|
@@ -37204,7 +37213,7 @@ function ibanChecksum(address) {
|
|
|
37204
37213
|
}
|
|
37205
37214
|
return checksum;
|
|
37206
37215
|
}
|
|
37207
|
-
function getAddress(address) {
|
|
37216
|
+
function getAddress$1(address) {
|
|
37208
37217
|
let result = null;
|
|
37209
37218
|
if (typeof (address) !== "string") {
|
|
37210
37219
|
logger$i.throwArgumentError("invalid address", "address", address);
|
|
@@ -37214,7 +37223,7 @@ function getAddress(address) {
|
|
|
37214
37223
|
if (address.substring(0, 2) !== "0x") {
|
|
37215
37224
|
address = "0x" + address;
|
|
37216
37225
|
}
|
|
37217
|
-
result = getChecksumAddress(address);
|
|
37226
|
+
result = getChecksumAddress$1(address);
|
|
37218
37227
|
// It is a checksummed address with a bad checksum
|
|
37219
37228
|
if (address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) && result !== address) {
|
|
37220
37229
|
logger$i.throwArgumentError("bad address checksum", "address", address);
|
|
@@ -37223,14 +37232,14 @@ function getAddress(address) {
|
|
|
37223
37232
|
}
|
|
37224
37233
|
else if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {
|
|
37225
37234
|
// It is an ICAP address with a bad checksum
|
|
37226
|
-
if (address.substring(2, 4) !== ibanChecksum(address)) {
|
|
37235
|
+
if (address.substring(2, 4) !== ibanChecksum$1(address)) {
|
|
37227
37236
|
logger$i.throwArgumentError("bad icap checksum", "address", address);
|
|
37228
37237
|
}
|
|
37229
|
-
result = _base36To16(address.substring(4));
|
|
37238
|
+
result = _base36To16$1(address.substring(4));
|
|
37230
37239
|
while (result.length < 40) {
|
|
37231
37240
|
result = "0" + result;
|
|
37232
37241
|
}
|
|
37233
|
-
result = getChecksumAddress("0x" + result);
|
|
37242
|
+
result = getChecksumAddress$1("0x" + result);
|
|
37234
37243
|
}
|
|
37235
37244
|
else {
|
|
37236
37245
|
logger$i.throwArgumentError("invalid address", "address", address);
|
|
@@ -37241,13 +37250,13 @@ function getAddress(address) {
|
|
|
37241
37250
|
function getContractAddress(transaction) {
|
|
37242
37251
|
let from = null;
|
|
37243
37252
|
try {
|
|
37244
|
-
from = getAddress(transaction.from);
|
|
37253
|
+
from = getAddress$1(transaction.from);
|
|
37245
37254
|
}
|
|
37246
37255
|
catch (error) {
|
|
37247
37256
|
logger$i.throwArgumentError("missing from address", "transaction", transaction);
|
|
37248
37257
|
}
|
|
37249
37258
|
const nonce = stripZeros(arrayify$1(BigNumber$2.from(transaction.nonce).toHexString()));
|
|
37250
|
-
return getAddress(hexDataSlice(keccak256(encode$2([from, nonce])), 12));
|
|
37259
|
+
return getAddress$1(hexDataSlice(keccak256$1(encode$2([from, nonce])), 12));
|
|
37251
37260
|
}
|
|
37252
37261
|
|
|
37253
37262
|
class AddressCoder extends Coder {
|
|
@@ -37259,7 +37268,7 @@ class AddressCoder extends Coder {
|
|
|
37259
37268
|
}
|
|
37260
37269
|
encode(writer, value) {
|
|
37261
37270
|
try {
|
|
37262
|
-
value = getAddress(value);
|
|
37271
|
+
value = getAddress$1(value);
|
|
37263
37272
|
}
|
|
37264
37273
|
catch (error) {
|
|
37265
37274
|
this._throwError(error.message, value);
|
|
@@ -37267,7 +37276,7 @@ class AddressCoder extends Coder {
|
|
|
37267
37276
|
return writer.writeValue(value);
|
|
37268
37277
|
}
|
|
37269
37278
|
decode(reader) {
|
|
37270
|
-
return getAddress(hexZeroPad$1(reader.readValue().toHexString(), 20));
|
|
37279
|
+
return getAddress$1(hexZeroPad$1(reader.readValue().toHexString(), 20));
|
|
37271
37280
|
}
|
|
37272
37281
|
}
|
|
37273
37282
|
|
|
@@ -38173,7 +38182,7 @@ class AbiCoder {
|
|
|
38173
38182
|
const defaultAbiCoder = new AbiCoder();
|
|
38174
38183
|
|
|
38175
38184
|
function id(text) {
|
|
38176
|
-
return keccak256(toUtf8Bytes(text));
|
|
38185
|
+
return keccak256$1(toUtf8Bytes(text));
|
|
38177
38186
|
}
|
|
38178
38187
|
|
|
38179
38188
|
const version$a = "hash/5.4.0";
|
|
@@ -38195,7 +38204,7 @@ function namehash(name) {
|
|
|
38195
38204
|
logger$e.throwArgumentError("invalid ENS address; missing component", "name", name);
|
|
38196
38205
|
}
|
|
38197
38206
|
const label = toUtf8Bytes(nameprep(partition[3]));
|
|
38198
|
-
result = keccak256(concat([result, keccak256(label)]));
|
|
38207
|
+
result = keccak256$1(concat([result, keccak256$1(label)]));
|
|
38199
38208
|
current = partition[2] || "";
|
|
38200
38209
|
}
|
|
38201
38210
|
return hexlify$2(result);
|
|
@@ -38257,7 +38266,7 @@ const domainChecks = {
|
|
|
38257
38266
|
},
|
|
38258
38267
|
verifyingContract: function (value) {
|
|
38259
38268
|
try {
|
|
38260
|
-
return getAddress(value).toLowerCase();
|
|
38269
|
+
return getAddress$1(value).toLowerCase();
|
|
38261
38270
|
}
|
|
38262
38271
|
catch (error) { }
|
|
38263
38272
|
return logger$d.throwArgumentError(`invalid domain value "verifyingContract"`, "domain.verifyingContract", value);
|
|
@@ -38314,13 +38323,13 @@ function getBaseEncoder(type) {
|
|
|
38314
38323
|
}
|
|
38315
38324
|
switch (type) {
|
|
38316
38325
|
case "address": return function (value) {
|
|
38317
|
-
return hexZeroPad$1(getAddress(value), 32);
|
|
38326
|
+
return hexZeroPad$1(getAddress$1(value), 32);
|
|
38318
38327
|
};
|
|
38319
38328
|
case "bool": return function (value) {
|
|
38320
38329
|
return ((!value) ? hexFalse : hexTrue);
|
|
38321
38330
|
};
|
|
38322
38331
|
case "bytes": return function (value) {
|
|
38323
|
-
return keccak256(value);
|
|
38332
|
+
return keccak256$1(value);
|
|
38324
38333
|
};
|
|
38325
38334
|
case "string": return function (value) {
|
|
38326
38335
|
return id(value);
|
|
@@ -38436,9 +38445,9 @@ class TypedDataEncoder {
|
|
|
38436
38445
|
}
|
|
38437
38446
|
let result = value.map(subEncoder);
|
|
38438
38447
|
if (this._types[subtype]) {
|
|
38439
|
-
result = result.map(keccak256);
|
|
38448
|
+
result = result.map(keccak256$1);
|
|
38440
38449
|
}
|
|
38441
|
-
return keccak256(hexConcat(result));
|
|
38450
|
+
return keccak256$1(hexConcat(result));
|
|
38442
38451
|
};
|
|
38443
38452
|
}
|
|
38444
38453
|
// Struct
|
|
@@ -38449,7 +38458,7 @@ class TypedDataEncoder {
|
|
|
38449
38458
|
const values = fields.map(({ name, type }) => {
|
|
38450
38459
|
const result = this.getEncoder(type)(value[name]);
|
|
38451
38460
|
if (this._types[type]) {
|
|
38452
|
-
return keccak256(result);
|
|
38461
|
+
return keccak256$1(result);
|
|
38453
38462
|
}
|
|
38454
38463
|
return result;
|
|
38455
38464
|
});
|
|
@@ -38470,7 +38479,7 @@ class TypedDataEncoder {
|
|
|
38470
38479
|
return this.getEncoder(type)(value);
|
|
38471
38480
|
}
|
|
38472
38481
|
hashStruct(name, value) {
|
|
38473
|
-
return keccak256(this.encodeData(name, value));
|
|
38482
|
+
return keccak256$1(this.encodeData(name, value));
|
|
38474
38483
|
}
|
|
38475
38484
|
encode(value) {
|
|
38476
38485
|
return this.encodeData(this.primaryType, value);
|
|
@@ -38540,7 +38549,7 @@ class TypedDataEncoder {
|
|
|
38540
38549
|
]);
|
|
38541
38550
|
}
|
|
38542
38551
|
static hash(domain, types, value) {
|
|
38543
|
-
return keccak256(TypedDataEncoder.encode(domain, types, value));
|
|
38552
|
+
return keccak256$1(TypedDataEncoder.encode(domain, types, value));
|
|
38544
38553
|
}
|
|
38545
38554
|
// Replaces all address types with ENS names with their looked up address
|
|
38546
38555
|
static resolveNames(domain, types, value, resolveName) {
|
|
@@ -38748,7 +38757,7 @@ class Interface {
|
|
|
38748
38757
|
return defaultAbiCoder;
|
|
38749
38758
|
}
|
|
38750
38759
|
static getAddress(address) {
|
|
38751
|
-
return getAddress(address);
|
|
38760
|
+
return getAddress$1(address);
|
|
38752
38761
|
}
|
|
38753
38762
|
static getSighash(fragment) {
|
|
38754
38763
|
return hexDataSlice(id(fragment.format()), 0, 4);
|
|
@@ -38993,7 +39002,7 @@ class Interface {
|
|
|
38993
39002
|
return id(value);
|
|
38994
39003
|
}
|
|
38995
39004
|
else if (param.type === "bytes") {
|
|
38996
|
-
return keccak256(hexlify$2(value));
|
|
39005
|
+
return keccak256$1(hexlify$2(value));
|
|
38997
39006
|
}
|
|
38998
39007
|
// Check addresses are valid
|
|
38999
39008
|
if (param.type === "address") {
|
|
@@ -39048,7 +39057,7 @@ class Interface {
|
|
|
39048
39057
|
topics.push(id(value));
|
|
39049
39058
|
}
|
|
39050
39059
|
else if (param.type === "bytes") {
|
|
39051
|
-
topics.push(keccak256(value));
|
|
39060
|
+
topics.push(keccak256$1(value));
|
|
39052
39061
|
}
|
|
39053
39062
|
else if (param.baseType === "tuple" || param.baseType === "array") {
|
|
39054
39063
|
// @TOOD
|
|
@@ -46821,7 +46830,7 @@ function handleAddress(value) {
|
|
|
46821
46830
|
if (value === "0x") {
|
|
46822
46831
|
return null;
|
|
46823
46832
|
}
|
|
46824
|
-
return getAddress(value);
|
|
46833
|
+
return getAddress$1(value);
|
|
46825
46834
|
}
|
|
46826
46835
|
function handleNumber(value) {
|
|
46827
46836
|
if (value === "0x") {
|
|
@@ -46831,7 +46840,7 @@ function handleNumber(value) {
|
|
|
46831
46840
|
}
|
|
46832
46841
|
function computeAddress(key) {
|
|
46833
46842
|
const publicKey = computePublicKey(key);
|
|
46834
|
-
return getAddress(hexDataSlice(keccak256(hexDataSlice(publicKey, 1)), 12));
|
|
46843
|
+
return getAddress$1(hexDataSlice(keccak256$1(hexDataSlice(publicKey, 1)), 12));
|
|
46835
46844
|
}
|
|
46836
46845
|
function recoverAddress(digest, signature) {
|
|
46837
46846
|
return computeAddress(recoverPublicKey(arrayify$1(digest), signature));
|
|
@@ -46845,7 +46854,7 @@ function formatNumber(value, name) {
|
|
|
46845
46854
|
}
|
|
46846
46855
|
function accessSetify(addr, storageKeys) {
|
|
46847
46856
|
return {
|
|
46848
|
-
address: getAddress(addr),
|
|
46857
|
+
address: getAddress$1(addr),
|
|
46849
46858
|
storageKeys: (storageKeys || []).map((storageKey, index) => {
|
|
46850
46859
|
if (hexDataLength(storageKey) !== 32) {
|
|
46851
46860
|
logger$8.throwArgumentError("invalid access list storageKey", `accessList[${addr}:${index}]`, storageKey);
|
|
@@ -46898,7 +46907,7 @@ function _serializeEip1559(transaction, signature) {
|
|
|
46898
46907
|
formatNumber(transaction.maxPriorityFeePerGas || 0, "maxPriorityFeePerGas"),
|
|
46899
46908
|
formatNumber(transaction.maxFeePerGas || 0, "maxFeePerGas"),
|
|
46900
46909
|
formatNumber(transaction.gasLimit || 0, "gasLimit"),
|
|
46901
|
-
((transaction.to != null) ? getAddress(transaction.to) : "0x"),
|
|
46910
|
+
((transaction.to != null) ? getAddress$1(transaction.to) : "0x"),
|
|
46902
46911
|
formatNumber(transaction.value || 0, "value"),
|
|
46903
46912
|
(transaction.data || "0x"),
|
|
46904
46913
|
(formatAccessList(transaction.accessList || []))
|
|
@@ -46917,7 +46926,7 @@ function _serializeEip2930(transaction, signature) {
|
|
|
46917
46926
|
formatNumber(transaction.nonce || 0, "nonce"),
|
|
46918
46927
|
formatNumber(transaction.gasPrice || 0, "gasPrice"),
|
|
46919
46928
|
formatNumber(transaction.gasLimit || 0, "gasLimit"),
|
|
46920
|
-
((transaction.to != null) ? getAddress(transaction.to) : "0x"),
|
|
46929
|
+
((transaction.to != null) ? getAddress$1(transaction.to) : "0x"),
|
|
46921
46930
|
formatNumber(transaction.value || 0, "value"),
|
|
46922
46931
|
(transaction.data || "0x"),
|
|
46923
46932
|
(formatAccessList(transaction.accessList || []))
|
|
@@ -46944,7 +46953,7 @@ function _parseEipSignature(tx, fields, serialize) {
|
|
|
46944
46953
|
tx.r = hexZeroPad$1(fields[1], 32);
|
|
46945
46954
|
tx.s = hexZeroPad$1(fields[2], 32);
|
|
46946
46955
|
try {
|
|
46947
|
-
const digest = keccak256(serialize(tx));
|
|
46956
|
+
const digest = keccak256$1(serialize(tx));
|
|
46948
46957
|
tx.from = recoverAddress(digest, { r: tx.r, s: tx.s, recoveryParam: tx.v });
|
|
46949
46958
|
}
|
|
46950
46959
|
catch (error) {
|
|
@@ -46975,7 +46984,7 @@ function _parseEip1559(payload) {
|
|
|
46975
46984
|
if (transaction.length === 9) {
|
|
46976
46985
|
return tx;
|
|
46977
46986
|
}
|
|
46978
|
-
tx.hash = keccak256(payload);
|
|
46987
|
+
tx.hash = keccak256$1(payload);
|
|
46979
46988
|
_parseEipSignature(tx, transaction.slice(9), _serializeEip1559);
|
|
46980
46989
|
return tx;
|
|
46981
46990
|
}
|
|
@@ -46999,7 +47008,7 @@ function _parseEip2930(payload) {
|
|
|
46999
47008
|
if (transaction.length === 8) {
|
|
47000
47009
|
return tx;
|
|
47001
47010
|
}
|
|
47002
|
-
tx.hash = keccak256(payload);
|
|
47011
|
+
tx.hash = keccak256$1(payload);
|
|
47003
47012
|
_parseEipSignature(tx, transaction.slice(8), _serializeEip2930);
|
|
47004
47013
|
return tx;
|
|
47005
47014
|
}
|
|
@@ -47050,14 +47059,14 @@ function _parse(rawTransaction) {
|
|
|
47050
47059
|
raw.push("0x");
|
|
47051
47060
|
recoveryParam -= tx.chainId * 2 + 8;
|
|
47052
47061
|
}
|
|
47053
|
-
const digest = keccak256(encode$2(raw));
|
|
47062
|
+
const digest = keccak256$1(encode$2(raw));
|
|
47054
47063
|
try {
|
|
47055
47064
|
tx.from = recoverAddress(digest, { r: hexlify$2(tx.r), s: hexlify$2(tx.s), recoveryParam: recoveryParam });
|
|
47056
47065
|
}
|
|
47057
47066
|
catch (error) {
|
|
47058
47067
|
console.log(error);
|
|
47059
47068
|
}
|
|
47060
|
-
tx.hash = keccak256(rawTransaction);
|
|
47069
|
+
tx.hash = keccak256$1(rawTransaction);
|
|
47061
47070
|
}
|
|
47062
47071
|
tx.type = null;
|
|
47063
47072
|
return tx;
|
|
@@ -47081,7 +47090,7 @@ function parse(rawTransaction) {
|
|
|
47081
47090
|
});
|
|
47082
47091
|
}
|
|
47083
47092
|
|
|
47084
|
-
const version$5 = "contracts/5.4.1";
|
|
47093
|
+
const version$5$1 = "contracts/5.4.1";
|
|
47085
47094
|
|
|
47086
47095
|
var __awaiter$4 = function (thisArg, _arguments, P, generator) {
|
|
47087
47096
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -47092,13 +47101,13 @@ var __awaiter$4 = function (thisArg, _arguments, P, generator) {
|
|
|
47092
47101
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
47093
47102
|
});
|
|
47094
47103
|
};
|
|
47095
|
-
const logger$7 = new Logger$2(version$5);
|
|
47104
|
+
const logger$7 = new Logger$2(version$5$1);
|
|
47096
47105
|
function resolveName(resolver, nameOrPromise) {
|
|
47097
47106
|
return __awaiter$4(this, void 0, void 0, function* () {
|
|
47098
47107
|
const name = yield nameOrPromise;
|
|
47099
47108
|
// If it is already an address, just use it (after adding checksum)
|
|
47100
47109
|
try {
|
|
47101
|
-
return getAddress(name);
|
|
47110
|
+
return getAddress$1(name);
|
|
47102
47111
|
}
|
|
47103
47112
|
catch (error) { }
|
|
47104
47113
|
if (!resolver) {
|
|
@@ -47154,7 +47163,7 @@ function populateTransaction(contract, fragment, args) {
|
|
|
47154
47163
|
override: resolveName(contract.signer, overrides.from),
|
|
47155
47164
|
signer: contract.signer.getAddress()
|
|
47156
47165
|
}).then((check) => __awaiter$4(this, void 0, void 0, function* () {
|
|
47157
|
-
if (getAddress(check.signer) !== check.override) {
|
|
47166
|
+
if (getAddress$1(check.signer) !== check.override) {
|
|
47158
47167
|
logger$7.throwError("Contract with a Signer cannot override from", Logger$2.errors.UNSUPPORTED_OPERATION, {
|
|
47159
47168
|
operation: "overrides.from"
|
|
47160
47169
|
});
|
|
@@ -47583,7 +47592,7 @@ class BaseContract {
|
|
|
47583
47592
|
}
|
|
47584
47593
|
else {
|
|
47585
47594
|
try {
|
|
47586
|
-
defineReadOnly(this, "resolvedAddress", Promise.resolve(getAddress(addressOrName)));
|
|
47595
|
+
defineReadOnly(this, "resolvedAddress", Promise.resolve(getAddress$1(addressOrName)));
|
|
47587
47596
|
}
|
|
47588
47597
|
catch (error) {
|
|
47589
47598
|
// Without a provider, we cannot use ENS names
|
|
@@ -48347,7 +48356,7 @@ var __awaiter$2 = function (thisArg, _arguments, P, generator) {
|
|
|
48347
48356
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
48348
48357
|
});
|
|
48349
48358
|
};
|
|
48350
|
-
const logger$5 = new Logger$2(version$2$2);
|
|
48359
|
+
const logger$5$1 = new Logger$2(version$2$2);
|
|
48351
48360
|
function staller(duration) {
|
|
48352
48361
|
return new Promise((resolve) => {
|
|
48353
48362
|
setTimeout(resolve, duration);
|
|
@@ -48380,10 +48389,10 @@ function bodyify(value, type) {
|
|
|
48380
48389
|
function _fetchData(connection, body, processFunc) {
|
|
48381
48390
|
// How many times to retry in the event of a throttle
|
|
48382
48391
|
const attemptLimit = (typeof (connection) === "object" && connection.throttleLimit != null) ? connection.throttleLimit : 12;
|
|
48383
|
-
logger$5.assertArgument((attemptLimit > 0 && (attemptLimit % 1) === 0), "invalid connection throttle limit", "connection.throttleLimit", attemptLimit);
|
|
48392
|
+
logger$5$1.assertArgument((attemptLimit > 0 && (attemptLimit % 1) === 0), "invalid connection throttle limit", "connection.throttleLimit", attemptLimit);
|
|
48384
48393
|
const throttleCallback = ((typeof (connection) === "object") ? connection.throttleCallback : null);
|
|
48385
48394
|
const throttleSlotInterval = ((typeof (connection) === "object" && typeof (connection.throttleSlotInterval) === "number") ? connection.throttleSlotInterval : 100);
|
|
48386
|
-
logger$5.assertArgument((throttleSlotInterval > 0 && (throttleSlotInterval % 1) === 0), "invalid connection throttle slot interval", "connection.throttleSlotInterval", throttleSlotInterval);
|
|
48395
|
+
logger$5$1.assertArgument((throttleSlotInterval > 0 && (throttleSlotInterval % 1) === 0), "invalid connection throttle slot interval", "connection.throttleSlotInterval", throttleSlotInterval);
|
|
48387
48396
|
const headers = {};
|
|
48388
48397
|
let url = null;
|
|
48389
48398
|
// @TODO: Allow ConnectionInfo to override some of these values
|
|
@@ -48397,7 +48406,7 @@ function _fetchData(connection, body, processFunc) {
|
|
|
48397
48406
|
}
|
|
48398
48407
|
else if (typeof (connection) === "object") {
|
|
48399
48408
|
if (connection == null || connection.url == null) {
|
|
48400
|
-
logger$5.throwArgumentError("missing URL", "connection.url", connection);
|
|
48409
|
+
logger$5$1.throwArgumentError("missing URL", "connection.url", connection);
|
|
48401
48410
|
}
|
|
48402
48411
|
url = connection.url;
|
|
48403
48412
|
if (typeof (connection.timeout) === "number" && connection.timeout > 0) {
|
|
@@ -48414,7 +48423,7 @@ function _fetchData(connection, body, processFunc) {
|
|
|
48414
48423
|
options.allowGzip = !!connection.allowGzip;
|
|
48415
48424
|
if (connection.user != null && connection.password != null) {
|
|
48416
48425
|
if (url.substring(0, 6) !== "https:" && connection.allowInsecureAuthentication !== true) {
|
|
48417
|
-
logger$5.throwError("basic authentication requires a secure https url", Logger$2.errors.INVALID_ARGUMENT, { argument: "url", url: url, user: connection.user, password: "[REDACTED]" });
|
|
48426
|
+
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]" });
|
|
48418
48427
|
}
|
|
48419
48428
|
const authorization = connection.user + ":" + connection.password;
|
|
48420
48429
|
headers["authorization"] = {
|
|
@@ -48448,7 +48457,7 @@ function _fetchData(connection, body, processFunc) {
|
|
|
48448
48457
|
return;
|
|
48449
48458
|
}
|
|
48450
48459
|
timer = null;
|
|
48451
|
-
reject(logger$5.makeError("timeout", Logger$2.errors.TIMEOUT, {
|
|
48460
|
+
reject(logger$5$1.makeError("timeout", Logger$2.errors.TIMEOUT, {
|
|
48452
48461
|
requestBody: bodyify(options.body, flatHeaders["content-type"]),
|
|
48453
48462
|
requestMethod: options.method,
|
|
48454
48463
|
timeout: timeout,
|
|
@@ -48497,7 +48506,7 @@ function _fetchData(connection, body, processFunc) {
|
|
|
48497
48506
|
response = error.response;
|
|
48498
48507
|
if (response == null) {
|
|
48499
48508
|
runningTimeout.cancel();
|
|
48500
|
-
logger$5.throwError("missing response", Logger$2.errors.SERVER_ERROR, {
|
|
48509
|
+
logger$5$1.throwError("missing response", Logger$2.errors.SERVER_ERROR, {
|
|
48501
48510
|
requestBody: bodyify(options.body, flatHeaders["content-type"]),
|
|
48502
48511
|
requestMethod: options.method,
|
|
48503
48512
|
serverError: error,
|
|
@@ -48511,7 +48520,7 @@ function _fetchData(connection, body, processFunc) {
|
|
|
48511
48520
|
}
|
|
48512
48521
|
else if (response.statusCode < 200 || response.statusCode >= 300) {
|
|
48513
48522
|
runningTimeout.cancel();
|
|
48514
|
-
logger$5.throwError("bad response", Logger$2.errors.SERVER_ERROR, {
|
|
48523
|
+
logger$5$1.throwError("bad response", Logger$2.errors.SERVER_ERROR, {
|
|
48515
48524
|
status: response.statusCode,
|
|
48516
48525
|
headers: response.headers,
|
|
48517
48526
|
body: bodyify(body, ((response.headers) ? response.headers["content-type"] : null)),
|
|
@@ -48541,7 +48550,7 @@ function _fetchData(connection, body, processFunc) {
|
|
|
48541
48550
|
}
|
|
48542
48551
|
}
|
|
48543
48552
|
runningTimeout.cancel();
|
|
48544
|
-
logger$5.throwError("processing response error", Logger$2.errors.SERVER_ERROR, {
|
|
48553
|
+
logger$5$1.throwError("processing response error", Logger$2.errors.SERVER_ERROR, {
|
|
48545
48554
|
body: bodyify(body, ((response.headers) ? response.headers["content-type"] : null)),
|
|
48546
48555
|
error: error,
|
|
48547
48556
|
requestBody: bodyify(options.body, flatHeaders["content-type"]),
|
|
@@ -48555,7 +48564,7 @@ function _fetchData(connection, body, processFunc) {
|
|
|
48555
48564
|
// The "body" is now a Uint8Array.
|
|
48556
48565
|
return body;
|
|
48557
48566
|
}
|
|
48558
|
-
return logger$5.throwError("failed response", Logger$2.errors.SERVER_ERROR, {
|
|
48567
|
+
return logger$5$1.throwError("failed response", Logger$2.errors.SERVER_ERROR, {
|
|
48559
48568
|
requestBody: bodyify(options.body, flatHeaders["content-type"]),
|
|
48560
48569
|
requestMethod: options.method,
|
|
48561
48570
|
url: url
|
|
@@ -48572,7 +48581,7 @@ function fetchJson(connection, json, processFunc) {
|
|
|
48572
48581
|
result = JSON.parse(toUtf8String(value));
|
|
48573
48582
|
}
|
|
48574
48583
|
catch (error) {
|
|
48575
|
-
logger$5.throwError("invalid JSON", Logger$2.errors.SERVER_ERROR, {
|
|
48584
|
+
logger$5$1.throwError("invalid JSON", Logger$2.errors.SERVER_ERROR, {
|
|
48576
48585
|
body: value,
|
|
48577
48586
|
error: error
|
|
48578
48587
|
});
|
|
@@ -49047,13 +49056,13 @@ class Formatter {
|
|
|
49047
49056
|
// Requires an address
|
|
49048
49057
|
// Strict! Used on input.
|
|
49049
49058
|
address(value) {
|
|
49050
|
-
return getAddress(value);
|
|
49059
|
+
return getAddress$1(value);
|
|
49051
49060
|
}
|
|
49052
49061
|
callAddress(value) {
|
|
49053
49062
|
if (!isHexString$2(value, 32)) {
|
|
49054
49063
|
return null;
|
|
49055
49064
|
}
|
|
49056
|
-
const address = getAddress(hexDataSlice(value, 12));
|
|
49065
|
+
const address = getAddress$1(hexDataSlice(value, 12));
|
|
49057
49066
|
return (address === AddressZero) ? null : address;
|
|
49058
49067
|
}
|
|
49059
49068
|
contractAddress(value) {
|
|
@@ -51562,10 +51571,11 @@ function parseUnits$1(value, unitName) {
|
|
|
51562
51571
|
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; }
|
|
51563
51572
|
class Transaction {
|
|
51564
51573
|
|
|
51565
|
-
constructor({ blockchain, from, to, api, method, params, value, sent, confirmed, ensured, failed }) {
|
|
51574
|
+
constructor({ blockchain, from, nonce, to, api, method, params, value, sent, confirmed, ensured, failed }) {
|
|
51566
51575
|
|
|
51567
51576
|
this.blockchain = blockchain;
|
|
51568
51577
|
this.from = from;
|
|
51578
|
+
this.nonce = nonce;
|
|
51569
51579
|
this.to = to;
|
|
51570
51580
|
this.api = api;
|
|
51571
51581
|
this.method = method;
|
|
@@ -51673,6 +51683,7 @@ const sendTransaction$1 = async ({ transaction, wallet })=> {
|
|
|
51673
51683
|
await executeSubmit$1({ transaction, provider, signer }).then((sentTransaction)=>{
|
|
51674
51684
|
if (sentTransaction) {
|
|
51675
51685
|
transaction.id = sentTransaction.hash;
|
|
51686
|
+
transaction.nonce = sentTransaction.nonce;
|
|
51676
51687
|
transaction.url = Blockchain.findByName(transaction.blockchain).explorerUrlFor({ transaction });
|
|
51677
51688
|
if (transaction.sent) transaction.sent(transaction);
|
|
51678
51689
|
sentTransaction.wait(1).then(() => {
|
|
@@ -51873,6 +51884,7 @@ const sendTransaction = async ({ transaction, wallet })=> {
|
|
|
51873
51884
|
transaction.url = blockchain.explorerUrlFor({ transaction });
|
|
51874
51885
|
if (transaction.sent) transaction.sent(transaction);
|
|
51875
51886
|
let sentTransaction = await retrieveTransaction(tx, transaction.blockchain);
|
|
51887
|
+
transaction.nonce = sentTransaction.nonce;
|
|
51876
51888
|
if(!sentTransaction) {
|
|
51877
51889
|
transaction._failed = true;
|
|
51878
51890
|
console.log('Error retrieving transaction');
|
|
@@ -52160,7 +52172,7 @@ var SelectWalletDialog = (function (props) {
|
|
|
52160
52172
|
return connect(wallet);
|
|
52161
52173
|
}
|
|
52162
52174
|
}, /*#__PURE__*/react.createElement("div", {
|
|
52163
|
-
className: "CardImage
|
|
52175
|
+
className: "CardImage"
|
|
52164
52176
|
}, /*#__PURE__*/react.createElement("img", {
|
|
52165
52177
|
src: wallet.logo
|
|
52166
52178
|
})), /*#__PURE__*/react.createElement("div", {
|
|
@@ -52173,9 +52185,9 @@ var SelectWalletDialog = (function (props) {
|
|
|
52173
52185
|
});
|
|
52174
52186
|
return /*#__PURE__*/react.createElement(Dialog, {
|
|
52175
52187
|
header: /*#__PURE__*/react.createElement("div", {
|
|
52176
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
52188
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
52177
52189
|
}, /*#__PURE__*/react.createElement("h1", {
|
|
52178
|
-
className: "LineHeightL FontSizeL
|
|
52190
|
+
className: "LineHeightL FontSizeL"
|
|
52179
52191
|
}, "Select a wallet")),
|
|
52180
52192
|
body: /*#__PURE__*/react.createElement("div", {
|
|
52181
52193
|
className: "PaddingTopS PaddingBottomXS PaddingLeftS PaddingRightS"
|
|
@@ -52183,11 +52195,13 @@ var SelectWalletDialog = (function (props) {
|
|
|
52183
52195
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
52184
52196
|
className: "PaddingBottomS"
|
|
52185
52197
|
}, /*#__PURE__*/react.createElement("button", {
|
|
52186
|
-
className: "FontSizeS FontWeightBold
|
|
52198
|
+
className: "FontSizeS FontWeightBold TextButton",
|
|
52187
52199
|
onClick: function onClick() {
|
|
52188
52200
|
return setShowExplanation(!showExplanation);
|
|
52189
52201
|
}
|
|
52190
|
-
}, /*#__PURE__*/react.createElement("strong",
|
|
52202
|
+
}, /*#__PURE__*/react.createElement("strong", {
|
|
52203
|
+
className: "Opacity05"
|
|
52204
|
+
}, "What is a wallet?")), showExplanation && /*#__PURE__*/react.createElement("p", {
|
|
52191
52205
|
className: "PaddingLeftM PaddingRightM"
|
|
52192
52206
|
}, "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."))
|
|
52193
52207
|
});
|
|
@@ -52340,6 +52354,9 @@ function _defineProperties(target, props) {
|
|
|
52340
52354
|
function _createClass$1(Constructor, protoProps, staticProps) {
|
|
52341
52355
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
52342
52356
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
52357
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
52358
|
+
writable: false
|
|
52359
|
+
});
|
|
52343
52360
|
return Constructor;
|
|
52344
52361
|
}
|
|
52345
52362
|
|
|
@@ -52357,12 +52374,15 @@ function _inherits$1(subClass, superClass) {
|
|
|
52357
52374
|
throw new TypeError("Super expression must either be null or a function");
|
|
52358
52375
|
}
|
|
52359
52376
|
|
|
52360
|
-
|
|
52361
|
-
|
|
52362
|
-
|
|
52363
|
-
|
|
52364
|
-
|
|
52365
|
-
|
|
52377
|
+
Object.defineProperty(subClass, "prototype", {
|
|
52378
|
+
value: Object.create(superClass && superClass.prototype, {
|
|
52379
|
+
constructor: {
|
|
52380
|
+
value: subClass,
|
|
52381
|
+
writable: true,
|
|
52382
|
+
configurable: true
|
|
52383
|
+
}
|
|
52384
|
+
}),
|
|
52385
|
+
writable: false
|
|
52366
52386
|
});
|
|
52367
52387
|
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
52368
52388
|
}
|
|
@@ -52465,7 +52485,7 @@ var ErrorProvider = (function (props) {
|
|
|
52465
52485
|
})), /*#__PURE__*/react.createElement("div", {
|
|
52466
52486
|
className: "DialogBody"
|
|
52467
52487
|
}, /*#__PURE__*/react.createElement("div", {
|
|
52468
|
-
className: "GraphicWrapper"
|
|
52488
|
+
className: "GraphicWrapper PaddingTopS"
|
|
52469
52489
|
}, /*#__PURE__*/react.createElement("img", {
|
|
52470
52490
|
className: "Graphic",
|
|
52471
52491
|
src: ErrorGraphic
|
|
@@ -52483,15 +52503,12 @@ var ErrorProvider = (function (props) {
|
|
|
52483
52503
|
className: "FontSizeM PaddingTopS"
|
|
52484
52504
|
}, "If this keeps happening, please report it.")))), /*#__PURE__*/react.createElement("div", {
|
|
52485
52505
|
className: "DialogFooter"
|
|
52486
|
-
}, /*#__PURE__*/react.createElement("div",
|
|
52506
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
52507
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
52508
|
+
}, /*#__PURE__*/react.createElement("button", {
|
|
52487
52509
|
className: "ButtonPrimary",
|
|
52488
52510
|
onClick: close
|
|
52489
|
-
}, "Try again"))
|
|
52490
|
-
href: 'https://depay.fi?utm_source=' + window.location.hostname + '&utm_medium=widget&utm_campaign=WidgetV2',
|
|
52491
|
-
rel: "noopener noreferrer",
|
|
52492
|
-
target: "_blank",
|
|
52493
|
-
className: "FooterLink"
|
|
52494
|
-
}, "by DePay"))));
|
|
52511
|
+
}, "Try again")))));
|
|
52495
52512
|
} else {
|
|
52496
52513
|
return /*#__PURE__*/react.createElement(ErrorContext.Provider, {
|
|
52497
52514
|
value: {
|
|
@@ -52503,28 +52520,28 @@ var ErrorProvider = (function (props) {
|
|
|
52503
52520
|
}
|
|
52504
52521
|
});
|
|
52505
52522
|
|
|
52523
|
+
var BlockchainLogoStyle = (function (style) {
|
|
52524
|
+
return "\n\n .BlockchainLogo {\n border-radius: 999px;\n }\n\n .BlockchainLogo.small {\n height: 18px;\n width: 18px;\n }\n ";
|
|
52525
|
+
});
|
|
52526
|
+
|
|
52506
52527
|
var ButtonCircularStyle = (function () {
|
|
52507
52528
|
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 ";
|
|
52508
52529
|
});
|
|
52509
52530
|
|
|
52510
52531
|
var ButtonPrimaryStyle = (function (style) {
|
|
52511
|
-
return "\n\n .ButtonPrimary {\n align-items: center;\n align-self: center;\n background: ".concat(style.colors.primary, ";\n border-radius:
|
|
52532
|
+
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 ");
|
|
52512
52533
|
});
|
|
52513
52534
|
|
|
52514
52535
|
var CardStyle = (function (style) {
|
|
52515
|
-
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.
|
|
52536
|
+
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 ");
|
|
52516
52537
|
});
|
|
52517
52538
|
|
|
52518
52539
|
var DialogStyle = (function (style) {
|
|
52519
|
-
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 .
|
|
52540
|
+
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 ";
|
|
52520
52541
|
});
|
|
52521
52542
|
|
|
52522
52543
|
var FontStyle = (function (style) {
|
|
52523
|
-
return "\n\n
|
|
52524
|
-
});
|
|
52525
|
-
|
|
52526
|
-
var FooterStyle = (function (style) {
|
|
52527
|
-
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 ");
|
|
52544
|
+
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 ");
|
|
52528
52545
|
});
|
|
52529
52546
|
|
|
52530
52547
|
var GraphicStyle = (function () {
|
|
@@ -52536,7 +52553,7 @@ var HeightStyle = (function () {
|
|
|
52536
52553
|
});
|
|
52537
52554
|
|
|
52538
52555
|
var IconStyle = (function (style) {
|
|
52539
|
-
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:
|
|
52556
|
+
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 ");
|
|
52540
52557
|
});
|
|
52541
52558
|
|
|
52542
52559
|
var ImageStyle = (function (style) {
|
|
@@ -52555,10 +52572,18 @@ var LoadingTextStyle = (function (style) {
|
|
|
52555
52572
|
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 ");
|
|
52556
52573
|
});
|
|
52557
52574
|
|
|
52575
|
+
var OpacityStyle = (function (style) {
|
|
52576
|
+
return "\n\n .Opacity05 {\n opacity: 0.5;\n }\n ";
|
|
52577
|
+
});
|
|
52578
|
+
|
|
52558
52579
|
var PaddingStyle = (function () {
|
|
52559
52580
|
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 ";
|
|
52560
52581
|
});
|
|
52561
52582
|
|
|
52583
|
+
var PoweredByStyle = (function (style) {
|
|
52584
|
+
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 ");
|
|
52585
|
+
});
|
|
52586
|
+
|
|
52562
52587
|
var RangeSliderStyle = (function (style) {
|
|
52563
52588
|
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 ";
|
|
52564
52589
|
});
|
|
@@ -52568,15 +52593,15 @@ var ResetStyle = (function () {
|
|
|
52568
52593
|
});
|
|
52569
52594
|
|
|
52570
52595
|
var SkeletonStyle = (function () {
|
|
52571
|
-
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 ";
|
|
52596
|
+
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 ";
|
|
52572
52597
|
});
|
|
52573
52598
|
|
|
52574
52599
|
var TextButtonStyle = (function (style) {
|
|
52575
|
-
return "\n\n .TextButton {\n cursor: pointer;\n font-size: 16px;\n color: ".concat(style.colors.primary, "\n }\n\n .TextButton
|
|
52600
|
+
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 ");
|
|
52576
52601
|
});
|
|
52577
52602
|
|
|
52578
52603
|
var TextStyle = (function (style) {
|
|
52579
|
-
return "\n\n * {\n color: ".concat(style.colors.text, ";\n }\n\n
|
|
52604
|
+
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 ");
|
|
52580
52605
|
});
|
|
52581
52606
|
|
|
52582
52607
|
var TokenAmountStyle = (function () {
|
|
@@ -52593,7 +52618,7 @@ var styleRenderer = (function (style) {
|
|
|
52593
52618
|
},
|
|
52594
52619
|
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'
|
|
52595
52620
|
}, style);
|
|
52596
|
-
return [ResetStyle(), FontStyle(style), DialogStyle(), ButtonCircularStyle(), ButtonPrimaryStyle(style), CardStyle(style),
|
|
52621
|
+
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('');
|
|
52597
52622
|
});
|
|
52598
52623
|
|
|
52599
52624
|
function _interopDefaultLegacy$1 (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -52713,6 +52738,31 @@ var mount = (function (_ref, content) {
|
|
|
52713
52738
|
return unmount;
|
|
52714
52739
|
});
|
|
52715
52740
|
|
|
52741
|
+
var PoweredBy = (function () {
|
|
52742
|
+
return /*#__PURE__*/react.createElement("div", {
|
|
52743
|
+
className: "PoweredByWrapper"
|
|
52744
|
+
}, /*#__PURE__*/react.createElement("a", {
|
|
52745
|
+
href: 'https://depay.fi?utm_source=' + window.location.hostname + '&utm_medium=widget&utm_campaign=WidgetV2',
|
|
52746
|
+
rel: "noopener noreferrer",
|
|
52747
|
+
target: "_blank",
|
|
52748
|
+
className: "PoweredByLink"
|
|
52749
|
+
}, "by DePay"));
|
|
52750
|
+
});
|
|
52751
|
+
|
|
52752
|
+
var UpdatableProvider = (function (props) {
|
|
52753
|
+
var _useState = react.useState(true),
|
|
52754
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
52755
|
+
updatable = _useState2[0],
|
|
52756
|
+
setUpdatable = _useState2[1];
|
|
52757
|
+
|
|
52758
|
+
return /*#__PURE__*/react.createElement(UpdatableContext.Provider, {
|
|
52759
|
+
value: {
|
|
52760
|
+
updatable: updatable,
|
|
52761
|
+
setUpdatable: setUpdatable
|
|
52762
|
+
}
|
|
52763
|
+
}, props.children);
|
|
52764
|
+
});
|
|
52765
|
+
|
|
52716
52766
|
var Connect = function Connect(options) {
|
|
52717
52767
|
var style, error, document;
|
|
52718
52768
|
|
|
@@ -52768,7 +52818,7 @@ var Connect = function Connect(options) {
|
|
|
52768
52818
|
error: error,
|
|
52769
52819
|
container: container,
|
|
52770
52820
|
unmount: unmount
|
|
52771
|
-
}, /*#__PURE__*/react.createElement(ClosableProvider, {
|
|
52821
|
+
}, /*#__PURE__*/react.createElement(UpdatableProvider, null, /*#__PURE__*/react.createElement(ClosableProvider, {
|
|
52772
52822
|
unmount: rejectBeforeUnmount
|
|
52773
52823
|
}, /*#__PURE__*/react.createElement(ConnectStack, {
|
|
52774
52824
|
document: document,
|
|
@@ -52776,7 +52826,7 @@ var Connect = function Connect(options) {
|
|
|
52776
52826
|
resolve: resolve,
|
|
52777
52827
|
reject: reject,
|
|
52778
52828
|
autoClose: true
|
|
52779
|
-
})));
|
|
52829
|
+
}), /*#__PURE__*/react.createElement(PoweredBy, null))));
|
|
52780
52830
|
};
|
|
52781
52831
|
});
|
|
52782
52832
|
|
|
@@ -53000,7 +53050,7 @@ var EXP_LIMIT = 9e15, // 0 to 9e15
|
|
|
53000
53050
|
|
|
53001
53051
|
BASE = 1e7,
|
|
53002
53052
|
LOG_BASE = 7,
|
|
53003
|
-
MAX_SAFE_INTEGER = 9007199254740991,
|
|
53053
|
+
MAX_SAFE_INTEGER$1 = 9007199254740991,
|
|
53004
53054
|
|
|
53005
53055
|
LN10_PRECISION = LN10.length - 1,
|
|
53006
53056
|
PI_PRECISION = PI.length - 1,
|
|
@@ -55170,7 +55220,7 @@ P.toPower = P.pow = function (y) {
|
|
|
55170
55220
|
e = mathfloor(y.e / LOG_BASE);
|
|
55171
55221
|
|
|
55172
55222
|
// If y is a small integer use the 'exponentiation by squaring' algorithm.
|
|
55173
|
-
if (e >= y.d.length - 1 && (k = yn < 0 ? -yn : yn) <= MAX_SAFE_INTEGER) {
|
|
55223
|
+
if (e >= y.d.length - 1 && (k = yn < 0 ? -yn : yn) <= MAX_SAFE_INTEGER$1) {
|
|
55174
55224
|
r = intPow(Ctor, x, k, pr);
|
|
55175
55225
|
return y.s < 0 ? new Ctor(1).div(r) : finalise(r, pr, rm);
|
|
55176
55226
|
}
|
|
@@ -57304,7 +57354,7 @@ function clone(obj) {
|
|
|
57304
57354
|
Decimal.hypot = hypot; // ES6
|
|
57305
57355
|
Decimal.ln = ln;
|
|
57306
57356
|
Decimal.log = log;
|
|
57307
|
-
Decimal.log10 = log10; // ES6
|
|
57357
|
+
Decimal.log10 = log10$1; // ES6
|
|
57308
57358
|
Decimal.log2 = log2; // ES6
|
|
57309
57359
|
Decimal.max = max;
|
|
57310
57360
|
Decimal.min = min;
|
|
@@ -57463,7 +57513,7 @@ function log2(x) {
|
|
|
57463
57513
|
* x {number|string|Decimal}
|
|
57464
57514
|
*
|
|
57465
57515
|
*/
|
|
57466
|
-
function log10(x) {
|
|
57516
|
+
function log10$1(x) {
|
|
57467
57517
|
return new this(x).log(10);
|
|
57468
57518
|
}
|
|
57469
57519
|
|
|
@@ -58297,7 +58347,7 @@ class Token {
|
|
|
58297
58347
|
|
|
58298
58348
|
constructor({ blockchain, address }) {
|
|
58299
58349
|
this.blockchain = blockchain;
|
|
58300
|
-
this.address = getAddress$
|
|
58350
|
+
this.address = getAddress$3(address);
|
|
58301
58351
|
}
|
|
58302
58352
|
|
|
58303
58353
|
async decimals() {
|
|
@@ -62095,7 +62145,7 @@ var bn$1 = createCommonjsModule$1(function (module) {
|
|
|
62095
62145
|
})(module, commonjsGlobal$1);
|
|
62096
62146
|
});
|
|
62097
62147
|
|
|
62098
|
-
const version$
|
|
62148
|
+
const version$4 = "logger/5.4.1";
|
|
62099
62149
|
|
|
62100
62150
|
let _permanentCensorErrors$1 = false;
|
|
62101
62151
|
let _censorErrors$1 = false;
|
|
@@ -62371,7 +62421,7 @@ class Logger$1 {
|
|
|
62371
62421
|
}
|
|
62372
62422
|
static globalLogger() {
|
|
62373
62423
|
if (!_globalLogger$1) {
|
|
62374
|
-
_globalLogger$1 = new Logger$1(version$
|
|
62424
|
+
_globalLogger$1 = new Logger$1(version$4);
|
|
62375
62425
|
}
|
|
62376
62426
|
return _globalLogger$1;
|
|
62377
62427
|
}
|
|
@@ -62407,9 +62457,9 @@ class Logger$1 {
|
|
|
62407
62457
|
Logger$1.errors = ErrorCode$1;
|
|
62408
62458
|
Logger$1.levels = LogLevel$1;
|
|
62409
62459
|
|
|
62410
|
-
const version$
|
|
62460
|
+
const version$3 = "bytes/5.4.0";
|
|
62411
62461
|
|
|
62412
|
-
const logger$
|
|
62462
|
+
const logger$4 = new Logger$1(version$3);
|
|
62413
62463
|
///////////////////////////////
|
|
62414
62464
|
function isHexable$1(value) {
|
|
62415
62465
|
return !!(value.toHexString);
|
|
@@ -62450,7 +62500,7 @@ function arrayify(value, options) {
|
|
|
62450
62500
|
options = {};
|
|
62451
62501
|
}
|
|
62452
62502
|
if (typeof (value) === "number") {
|
|
62453
|
-
logger$
|
|
62503
|
+
logger$4.checkSafeUint53(value, "invalid arrayify value");
|
|
62454
62504
|
const result = [];
|
|
62455
62505
|
while (value) {
|
|
62456
62506
|
result.unshift(value & 0xff);
|
|
@@ -62477,7 +62527,7 @@ function arrayify(value, options) {
|
|
|
62477
62527
|
hex += "0";
|
|
62478
62528
|
}
|
|
62479
62529
|
else {
|
|
62480
|
-
logger$
|
|
62530
|
+
logger$4.throwArgumentError("hex data is odd-length", "value", value);
|
|
62481
62531
|
}
|
|
62482
62532
|
}
|
|
62483
62533
|
const result = [];
|
|
@@ -62489,7 +62539,7 @@ function arrayify(value, options) {
|
|
|
62489
62539
|
if (isBytes$1(value)) {
|
|
62490
62540
|
return addSlice(new Uint8Array(value));
|
|
62491
62541
|
}
|
|
62492
|
-
return logger$
|
|
62542
|
+
return logger$4.throwArgumentError("invalid arrayify value", "value", value);
|
|
62493
62543
|
}
|
|
62494
62544
|
function isHexString$1(value, length) {
|
|
62495
62545
|
if (typeof (value) !== "string" || !value.match(/^0x[0-9A-Fa-f]*$/)) {
|
|
@@ -62506,7 +62556,7 @@ function hexlify$1(value, options) {
|
|
|
62506
62556
|
options = {};
|
|
62507
62557
|
}
|
|
62508
62558
|
if (typeof (value) === "number") {
|
|
62509
|
-
logger$
|
|
62559
|
+
logger$4.checkSafeUint53(value, "invalid hexlify value");
|
|
62510
62560
|
let hex = "";
|
|
62511
62561
|
while (value) {
|
|
62512
62562
|
hex = HexCharacters$1[value & 0xf] + hex;
|
|
@@ -62542,7 +62592,7 @@ function hexlify$1(value, options) {
|
|
|
62542
62592
|
value += "0";
|
|
62543
62593
|
}
|
|
62544
62594
|
else {
|
|
62545
|
-
logger$
|
|
62595
|
+
logger$4.throwArgumentError("hex data is odd-length", "value", value);
|
|
62546
62596
|
}
|
|
62547
62597
|
}
|
|
62548
62598
|
return value.toLowerCase();
|
|
@@ -62555,17 +62605,17 @@ function hexlify$1(value, options) {
|
|
|
62555
62605
|
}
|
|
62556
62606
|
return result;
|
|
62557
62607
|
}
|
|
62558
|
-
return logger$
|
|
62608
|
+
return logger$4.throwArgumentError("invalid hexlify value", "value", value);
|
|
62559
62609
|
}
|
|
62560
62610
|
function hexZeroPad(value, length) {
|
|
62561
62611
|
if (typeof (value) !== "string") {
|
|
62562
62612
|
value = hexlify$1(value);
|
|
62563
62613
|
}
|
|
62564
62614
|
else if (!isHexString$1(value)) {
|
|
62565
|
-
logger$
|
|
62615
|
+
logger$4.throwArgumentError("invalid hex string", "value", value);
|
|
62566
62616
|
}
|
|
62567
62617
|
if (value.length > 2 * length + 2) {
|
|
62568
|
-
logger$
|
|
62618
|
+
logger$4.throwArgumentError("value out of range", "value", arguments[1]);
|
|
62569
62619
|
}
|
|
62570
62620
|
while (value.length < 2 * length + 2) {
|
|
62571
62621
|
value = "0x0" + value.substring(2);
|
|
@@ -62573,10 +62623,10 @@ function hexZeroPad(value, length) {
|
|
|
62573
62623
|
return value;
|
|
62574
62624
|
}
|
|
62575
62625
|
|
|
62576
|
-
const version$
|
|
62626
|
+
const version$2$1 = "bignumber/5.4.1";
|
|
62577
62627
|
|
|
62578
62628
|
var BN$1 = bn$1.BN;
|
|
62579
|
-
const logger$
|
|
62629
|
+
const logger$3 = new Logger$1(version$2$1);
|
|
62580
62630
|
const _constructorGuard$1 = {};
|
|
62581
62631
|
const MAX_SAFE$1 = 0x1fffffffffffff;
|
|
62582
62632
|
function isBigNumberish(value) {
|
|
@@ -62591,9 +62641,9 @@ function isBigNumberish(value) {
|
|
|
62591
62641
|
let _warnedToStringRadix$1 = false;
|
|
62592
62642
|
class BigNumber$1 {
|
|
62593
62643
|
constructor(constructorGuard, hex) {
|
|
62594
|
-
logger$
|
|
62644
|
+
logger$3.checkNew(new.target, BigNumber$1);
|
|
62595
62645
|
if (constructorGuard !== _constructorGuard$1) {
|
|
62596
|
-
logger$
|
|
62646
|
+
logger$3.throwError("cannot call constructor directly; use BigNumber.from", Logger$1.errors.UNSUPPORTED_OPERATION, {
|
|
62597
62647
|
operation: "new (BigNumber)"
|
|
62598
62648
|
});
|
|
62599
62649
|
}
|
|
@@ -62717,7 +62767,7 @@ class BigNumber$1 {
|
|
|
62717
62767
|
return BigInt(this.toString());
|
|
62718
62768
|
}
|
|
62719
62769
|
catch (e) { }
|
|
62720
|
-
return logger$
|
|
62770
|
+
return logger$3.throwError("this platform does not support BigInt", Logger$1.errors.UNSUPPORTED_OPERATION, {
|
|
62721
62771
|
value: this.toString()
|
|
62722
62772
|
});
|
|
62723
62773
|
}
|
|
@@ -62727,14 +62777,14 @@ class BigNumber$1 {
|
|
|
62727
62777
|
if (arguments[0] === 10) {
|
|
62728
62778
|
if (!_warnedToStringRadix$1) {
|
|
62729
62779
|
_warnedToStringRadix$1 = true;
|
|
62730
|
-
logger$
|
|
62780
|
+
logger$3.warn("BigNumber.toString does not accept any parameters; base-10 is assumed");
|
|
62731
62781
|
}
|
|
62732
62782
|
}
|
|
62733
62783
|
else if (arguments[0] === 16) {
|
|
62734
|
-
logger$
|
|
62784
|
+
logger$3.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()", Logger$1.errors.UNEXPECTED_ARGUMENT, {});
|
|
62735
62785
|
}
|
|
62736
62786
|
else {
|
|
62737
|
-
logger$
|
|
62787
|
+
logger$3.throwError("BigNumber.toString does not accept parameters", Logger$1.errors.UNEXPECTED_ARGUMENT, {});
|
|
62738
62788
|
}
|
|
62739
62789
|
}
|
|
62740
62790
|
return toBN$1(this).toString(10);
|
|
@@ -62756,7 +62806,7 @@ class BigNumber$1 {
|
|
|
62756
62806
|
if (value.match(/^-?[0-9]+$/)) {
|
|
62757
62807
|
return new BigNumber$1(_constructorGuard$1, toHex$1(new BN$1(value)));
|
|
62758
62808
|
}
|
|
62759
|
-
return logger$
|
|
62809
|
+
return logger$3.throwArgumentError("invalid BigNumber string", "value", value);
|
|
62760
62810
|
}
|
|
62761
62811
|
if (typeof (value) === "number") {
|
|
62762
62812
|
if (value % 1) {
|
|
@@ -62796,7 +62846,7 @@ class BigNumber$1 {
|
|
|
62796
62846
|
}
|
|
62797
62847
|
}
|
|
62798
62848
|
}
|
|
62799
|
-
return logger$
|
|
62849
|
+
return logger$3.throwArgumentError("invalid BigNumber value", "value", value);
|
|
62800
62850
|
}
|
|
62801
62851
|
static isBigNumber(value) {
|
|
62802
62852
|
return !!(value && value._isBigNumber);
|
|
@@ -62814,7 +62864,7 @@ function toHex$1(value) {
|
|
|
62814
62864
|
value = value.substring(1);
|
|
62815
62865
|
// Cannot have mulitple negative signs (e.g. "--0x04")
|
|
62816
62866
|
if (value[0] === "-") {
|
|
62817
|
-
logger$
|
|
62867
|
+
logger$3.throwArgumentError("invalid hex", "value", value);
|
|
62818
62868
|
}
|
|
62819
62869
|
// Call toHex on the positive component
|
|
62820
62870
|
value = toHex$1(value);
|
|
@@ -62858,10 +62908,14 @@ function throwFault$1(fault, operation, value) {
|
|
|
62858
62908
|
if (value != null) {
|
|
62859
62909
|
params.value = value;
|
|
62860
62910
|
}
|
|
62861
|
-
return logger$
|
|
62911
|
+
return logger$3.throwError(fault, Logger$1.errors.NUMERIC_FAULT, params);
|
|
62912
|
+
}
|
|
62913
|
+
// value should have no prefix
|
|
62914
|
+
function _base36To16(value) {
|
|
62915
|
+
return (new BN$1(value, 36)).toString(16);
|
|
62862
62916
|
}
|
|
62863
62917
|
|
|
62864
|
-
const logger$
|
|
62918
|
+
const logger$2 = new Logger$1(version$2$1);
|
|
62865
62919
|
const _constructorGuard$2 = {};
|
|
62866
62920
|
const Zero = BigNumber$1.from(0);
|
|
62867
62921
|
const NegativeOne = BigNumber$1.from(-1);
|
|
@@ -62870,7 +62924,7 @@ function throwFault$2(message, fault, operation, value) {
|
|
|
62870
62924
|
if (value !== undefined) {
|
|
62871
62925
|
params.value = value;
|
|
62872
62926
|
}
|
|
62873
|
-
return logger$
|
|
62927
|
+
return logger$2.throwError(message, Logger$1.errors.NUMERIC_FAULT, params);
|
|
62874
62928
|
}
|
|
62875
62929
|
// Constant to pull zeros from for multipliers
|
|
62876
62930
|
let zeros = "0";
|
|
@@ -62888,7 +62942,7 @@ function getMultiplier(decimals) {
|
|
|
62888
62942
|
if (typeof (decimals) === "number" && decimals >= 0 && decimals <= 256 && !(decimals % 1)) {
|
|
62889
62943
|
return ("1" + zeros.substring(0, decimals));
|
|
62890
62944
|
}
|
|
62891
|
-
return logger$
|
|
62945
|
+
return logger$2.throwArgumentError("invalid decimal size", "decimals", decimals);
|
|
62892
62946
|
}
|
|
62893
62947
|
function formatFixed(value, decimals) {
|
|
62894
62948
|
if (decimals == null) {
|
|
@@ -62925,7 +62979,7 @@ function parseFixed(value, decimals) {
|
|
|
62925
62979
|
}
|
|
62926
62980
|
const multiplier = getMultiplier(decimals);
|
|
62927
62981
|
if (typeof (value) !== "string" || !value.match(/^-?[0-9.,]+$/)) {
|
|
62928
|
-
logger$
|
|
62982
|
+
logger$2.throwArgumentError("invalid decimal value", "value", value);
|
|
62929
62983
|
}
|
|
62930
62984
|
// Is it negative?
|
|
62931
62985
|
const negative = (value.substring(0, 1) === "-");
|
|
@@ -62933,12 +62987,12 @@ function parseFixed(value, decimals) {
|
|
|
62933
62987
|
value = value.substring(1);
|
|
62934
62988
|
}
|
|
62935
62989
|
if (value === ".") {
|
|
62936
|
-
logger$
|
|
62990
|
+
logger$2.throwArgumentError("missing value", "value", value);
|
|
62937
62991
|
}
|
|
62938
62992
|
// Split it into a whole and fractional part
|
|
62939
62993
|
const comps = value.split(".");
|
|
62940
62994
|
if (comps.length > 2) {
|
|
62941
|
-
logger$
|
|
62995
|
+
logger$2.throwArgumentError("too many decimal points", "value", value);
|
|
62942
62996
|
}
|
|
62943
62997
|
let whole = comps[0], fraction = comps[1];
|
|
62944
62998
|
if (!whole) {
|
|
@@ -62969,7 +63023,7 @@ function parseFixed(value, decimals) {
|
|
|
62969
63023
|
class FixedFormat {
|
|
62970
63024
|
constructor(constructorGuard, signed, width, decimals) {
|
|
62971
63025
|
if (constructorGuard !== _constructorGuard$2) {
|
|
62972
|
-
logger$
|
|
63026
|
+
logger$2.throwError("cannot use FixedFormat constructor; use FixedFormat.from", Logger$1.errors.UNSUPPORTED_OPERATION, {
|
|
62973
63027
|
operation: "new FixedFormat"
|
|
62974
63028
|
});
|
|
62975
63029
|
}
|
|
@@ -62998,7 +63052,7 @@ class FixedFormat {
|
|
|
62998
63052
|
else {
|
|
62999
63053
|
const match = value.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);
|
|
63000
63054
|
if (!match) {
|
|
63001
|
-
logger$
|
|
63055
|
+
logger$2.throwArgumentError("invalid fixed format", "format", value);
|
|
63002
63056
|
}
|
|
63003
63057
|
signed = (match[1] !== "u");
|
|
63004
63058
|
width = parseInt(match[2]);
|
|
@@ -63011,7 +63065,7 @@ class FixedFormat {
|
|
|
63011
63065
|
return defaultValue;
|
|
63012
63066
|
}
|
|
63013
63067
|
if (typeof (value[key]) !== type) {
|
|
63014
|
-
logger$
|
|
63068
|
+
logger$2.throwArgumentError("invalid fixed format (" + key + " not " + type + ")", "format." + key, value[key]);
|
|
63015
63069
|
}
|
|
63016
63070
|
return value[key];
|
|
63017
63071
|
};
|
|
@@ -63020,19 +63074,19 @@ class FixedFormat {
|
|
|
63020
63074
|
decimals = check("decimals", "number", decimals);
|
|
63021
63075
|
}
|
|
63022
63076
|
if (width % 8) {
|
|
63023
|
-
logger$
|
|
63077
|
+
logger$2.throwArgumentError("invalid fixed format width (not byte aligned)", "format.width", width);
|
|
63024
63078
|
}
|
|
63025
63079
|
if (decimals > 80) {
|
|
63026
|
-
logger$
|
|
63080
|
+
logger$2.throwArgumentError("invalid fixed format (decimals too large)", "format.decimals", decimals);
|
|
63027
63081
|
}
|
|
63028
63082
|
return new FixedFormat(_constructorGuard$2, signed, width, decimals);
|
|
63029
63083
|
}
|
|
63030
63084
|
}
|
|
63031
63085
|
class FixedNumber {
|
|
63032
63086
|
constructor(constructorGuard, hex, value, format) {
|
|
63033
|
-
logger$
|
|
63087
|
+
logger$2.checkNew(new.target, FixedNumber);
|
|
63034
63088
|
if (constructorGuard !== _constructorGuard$2) {
|
|
63035
|
-
logger$
|
|
63089
|
+
logger$2.throwError("cannot use FixedNumber constructor; use FixedNumber.from", Logger$1.errors.UNSUPPORTED_OPERATION, {
|
|
63036
63090
|
operation: "new FixedFormat"
|
|
63037
63091
|
});
|
|
63038
63092
|
}
|
|
@@ -63044,7 +63098,7 @@ class FixedNumber {
|
|
|
63044
63098
|
}
|
|
63045
63099
|
_checkFormat(other) {
|
|
63046
63100
|
if (this.format.name !== other.format.name) {
|
|
63047
|
-
logger$
|
|
63101
|
+
logger$2.throwArgumentError("incompatible format; use fixedNumber.toFormat", "other", other);
|
|
63048
63102
|
}
|
|
63049
63103
|
}
|
|
63050
63104
|
addUnsafe(other) {
|
|
@@ -63106,7 +63160,7 @@ class FixedNumber {
|
|
|
63106
63160
|
comps.push("0");
|
|
63107
63161
|
}
|
|
63108
63162
|
if (decimals < 0 || decimals > 80 || (decimals % 1)) {
|
|
63109
|
-
logger$
|
|
63163
|
+
logger$2.throwArgumentError("invalid decimal count", "decimals", decimals);
|
|
63110
63164
|
}
|
|
63111
63165
|
if (comps[1].length <= decimals) {
|
|
63112
63166
|
return this;
|
|
@@ -63127,7 +63181,7 @@ class FixedNumber {
|
|
|
63127
63181
|
return this._hex;
|
|
63128
63182
|
}
|
|
63129
63183
|
if (width % 8) {
|
|
63130
|
-
logger$
|
|
63184
|
+
logger$2.throwArgumentError("invalid byte width", "width", width);
|
|
63131
63185
|
}
|
|
63132
63186
|
const hex = BigNumber$1.from(this._hex).fromTwos(this.format.width).toTwos(width).toHexString();
|
|
63133
63187
|
return hexZeroPad(hex, width / 8);
|
|
@@ -63202,7 +63256,7 @@ class FixedNumber {
|
|
|
63202
63256
|
throw error;
|
|
63203
63257
|
}
|
|
63204
63258
|
}
|
|
63205
|
-
return logger$
|
|
63259
|
+
return logger$2.throwArgumentError("invalid FixedNumber value", "value", value);
|
|
63206
63260
|
}
|
|
63207
63261
|
static isFixedNumber(value) {
|
|
63208
63262
|
return !!(value && value._isFixedNumber);
|
|
@@ -63211,9 +63265,585 @@ class FixedNumber {
|
|
|
63211
63265
|
const ONE = FixedNumber.from(1);
|
|
63212
63266
|
const BUMP = FixedNumber.from("0.5");
|
|
63213
63267
|
|
|
63214
|
-
|
|
63268
|
+
/**
|
|
63269
|
+
* [js-sha3]{@link https://github.com/emn178/js-sha3}
|
|
63270
|
+
*
|
|
63271
|
+
* @version 0.5.7
|
|
63272
|
+
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
|
63273
|
+
* @copyright Chen, Yi-Cyuan 2015-2016
|
|
63274
|
+
* @license MIT
|
|
63275
|
+
*/
|
|
63276
|
+
|
|
63277
|
+
var sha3 = createCommonjsModule$1(function (module) {
|
|
63278
|
+
/*jslint bitwise: true */
|
|
63279
|
+
(function () {
|
|
63280
|
+
|
|
63281
|
+
var root = typeof window === 'object' ? window : {};
|
|
63282
|
+
var NODE_JS = !root.JS_SHA3_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node;
|
|
63283
|
+
if (NODE_JS) {
|
|
63284
|
+
root = commonjsGlobal$1;
|
|
63285
|
+
}
|
|
63286
|
+
var COMMON_JS = !root.JS_SHA3_NO_COMMON_JS && 'object' === 'object' && module.exports;
|
|
63287
|
+
var HEX_CHARS = '0123456789abcdef'.split('');
|
|
63288
|
+
var SHAKE_PADDING = [31, 7936, 2031616, 520093696];
|
|
63289
|
+
var KECCAK_PADDING = [1, 256, 65536, 16777216];
|
|
63290
|
+
var PADDING = [6, 1536, 393216, 100663296];
|
|
63291
|
+
var SHIFT = [0, 8, 16, 24];
|
|
63292
|
+
var RC = [1, 0, 32898, 0, 32906, 2147483648, 2147516416, 2147483648, 32907, 0, 2147483649,
|
|
63293
|
+
0, 2147516545, 2147483648, 32777, 2147483648, 138, 0, 136, 0, 2147516425, 0,
|
|
63294
|
+
2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, 2147483648, 32771,
|
|
63295
|
+
2147483648, 32770, 2147483648, 128, 2147483648, 32778, 0, 2147483658, 2147483648,
|
|
63296
|
+
2147516545, 2147483648, 32896, 2147483648, 2147483649, 0, 2147516424, 2147483648];
|
|
63297
|
+
var BITS = [224, 256, 384, 512];
|
|
63298
|
+
var SHAKE_BITS = [128, 256];
|
|
63299
|
+
var OUTPUT_TYPES = ['hex', 'buffer', 'arrayBuffer', 'array'];
|
|
63300
|
+
|
|
63301
|
+
var createOutputMethod = function (bits, padding, outputType) {
|
|
63302
|
+
return function (message) {
|
|
63303
|
+
return new Keccak(bits, padding, bits).update(message)[outputType]();
|
|
63304
|
+
};
|
|
63305
|
+
};
|
|
63306
|
+
|
|
63307
|
+
var createShakeOutputMethod = function (bits, padding, outputType) {
|
|
63308
|
+
return function (message, outputBits) {
|
|
63309
|
+
return new Keccak(bits, padding, outputBits).update(message)[outputType]();
|
|
63310
|
+
};
|
|
63311
|
+
};
|
|
63312
|
+
|
|
63313
|
+
var createMethod = function (bits, padding) {
|
|
63314
|
+
var method = createOutputMethod(bits, padding, 'hex');
|
|
63315
|
+
method.create = function () {
|
|
63316
|
+
return new Keccak(bits, padding, bits);
|
|
63317
|
+
};
|
|
63318
|
+
method.update = function (message) {
|
|
63319
|
+
return method.create().update(message);
|
|
63320
|
+
};
|
|
63321
|
+
for (var i = 0; i < OUTPUT_TYPES.length; ++i) {
|
|
63322
|
+
var type = OUTPUT_TYPES[i];
|
|
63323
|
+
method[type] = createOutputMethod(bits, padding, type);
|
|
63324
|
+
}
|
|
63325
|
+
return method;
|
|
63326
|
+
};
|
|
63327
|
+
|
|
63328
|
+
var createShakeMethod = function (bits, padding) {
|
|
63329
|
+
var method = createShakeOutputMethod(bits, padding, 'hex');
|
|
63330
|
+
method.create = function (outputBits) {
|
|
63331
|
+
return new Keccak(bits, padding, outputBits);
|
|
63332
|
+
};
|
|
63333
|
+
method.update = function (message, outputBits) {
|
|
63334
|
+
return method.create(outputBits).update(message);
|
|
63335
|
+
};
|
|
63336
|
+
for (var i = 0; i < OUTPUT_TYPES.length; ++i) {
|
|
63337
|
+
var type = OUTPUT_TYPES[i];
|
|
63338
|
+
method[type] = createShakeOutputMethod(bits, padding, type);
|
|
63339
|
+
}
|
|
63340
|
+
return method;
|
|
63341
|
+
};
|
|
63342
|
+
|
|
63343
|
+
var algorithms = [
|
|
63344
|
+
{name: 'keccak', padding: KECCAK_PADDING, bits: BITS, createMethod: createMethod},
|
|
63345
|
+
{name: 'sha3', padding: PADDING, bits: BITS, createMethod: createMethod},
|
|
63346
|
+
{name: 'shake', padding: SHAKE_PADDING, bits: SHAKE_BITS, createMethod: createShakeMethod}
|
|
63347
|
+
];
|
|
63348
|
+
|
|
63349
|
+
var methods = {}, methodNames = [];
|
|
63350
|
+
|
|
63351
|
+
for (var i = 0; i < algorithms.length; ++i) {
|
|
63352
|
+
var algorithm = algorithms[i];
|
|
63353
|
+
var bits = algorithm.bits;
|
|
63354
|
+
for (var j = 0; j < bits.length; ++j) {
|
|
63355
|
+
var methodName = algorithm.name +'_' + bits[j];
|
|
63356
|
+
methodNames.push(methodName);
|
|
63357
|
+
methods[methodName] = algorithm.createMethod(bits[j], algorithm.padding);
|
|
63358
|
+
}
|
|
63359
|
+
}
|
|
63360
|
+
|
|
63361
|
+
function Keccak(bits, padding, outputBits) {
|
|
63362
|
+
this.blocks = [];
|
|
63363
|
+
this.s = [];
|
|
63364
|
+
this.padding = padding;
|
|
63365
|
+
this.outputBits = outputBits;
|
|
63366
|
+
this.reset = true;
|
|
63367
|
+
this.block = 0;
|
|
63368
|
+
this.start = 0;
|
|
63369
|
+
this.blockCount = (1600 - (bits << 1)) >> 5;
|
|
63370
|
+
this.byteCount = this.blockCount << 2;
|
|
63371
|
+
this.outputBlocks = outputBits >> 5;
|
|
63372
|
+
this.extraBytes = (outputBits & 31) >> 3;
|
|
63373
|
+
|
|
63374
|
+
for (var i = 0; i < 50; ++i) {
|
|
63375
|
+
this.s[i] = 0;
|
|
63376
|
+
}
|
|
63377
|
+
}
|
|
63378
|
+
|
|
63379
|
+
Keccak.prototype.update = function (message) {
|
|
63380
|
+
var notString = typeof message !== 'string';
|
|
63381
|
+
if (notString && message.constructor === ArrayBuffer) {
|
|
63382
|
+
message = new Uint8Array(message);
|
|
63383
|
+
}
|
|
63384
|
+
var length = message.length, blocks = this.blocks, byteCount = this.byteCount,
|
|
63385
|
+
blockCount = this.blockCount, index = 0, s = this.s, i, code;
|
|
63386
|
+
|
|
63387
|
+
while (index < length) {
|
|
63388
|
+
if (this.reset) {
|
|
63389
|
+
this.reset = false;
|
|
63390
|
+
blocks[0] = this.block;
|
|
63391
|
+
for (i = 1; i < blockCount + 1; ++i) {
|
|
63392
|
+
blocks[i] = 0;
|
|
63393
|
+
}
|
|
63394
|
+
}
|
|
63395
|
+
if (notString) {
|
|
63396
|
+
for (i = this.start; index < length && i < byteCount; ++index) {
|
|
63397
|
+
blocks[i >> 2] |= message[index] << SHIFT[i++ & 3];
|
|
63398
|
+
}
|
|
63399
|
+
} else {
|
|
63400
|
+
for (i = this.start; index < length && i < byteCount; ++index) {
|
|
63401
|
+
code = message.charCodeAt(index);
|
|
63402
|
+
if (code < 0x80) {
|
|
63403
|
+
blocks[i >> 2] |= code << SHIFT[i++ & 3];
|
|
63404
|
+
} else if (code < 0x800) {
|
|
63405
|
+
blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3];
|
|
63406
|
+
blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
|
|
63407
|
+
} else if (code < 0xd800 || code >= 0xe000) {
|
|
63408
|
+
blocks[i >> 2] |= (0xe0 | (code >> 12)) << SHIFT[i++ & 3];
|
|
63409
|
+
blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];
|
|
63410
|
+
blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
|
|
63411
|
+
} else {
|
|
63412
|
+
code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));
|
|
63413
|
+
blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3];
|
|
63414
|
+
blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3];
|
|
63415
|
+
blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];
|
|
63416
|
+
blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
|
|
63417
|
+
}
|
|
63418
|
+
}
|
|
63419
|
+
}
|
|
63420
|
+
this.lastByteIndex = i;
|
|
63421
|
+
if (i >= byteCount) {
|
|
63422
|
+
this.start = i - byteCount;
|
|
63423
|
+
this.block = blocks[blockCount];
|
|
63424
|
+
for (i = 0; i < blockCount; ++i) {
|
|
63425
|
+
s[i] ^= blocks[i];
|
|
63426
|
+
}
|
|
63427
|
+
f(s);
|
|
63428
|
+
this.reset = true;
|
|
63429
|
+
} else {
|
|
63430
|
+
this.start = i;
|
|
63431
|
+
}
|
|
63432
|
+
}
|
|
63433
|
+
return this;
|
|
63434
|
+
};
|
|
63435
|
+
|
|
63436
|
+
Keccak.prototype.finalize = function () {
|
|
63437
|
+
var blocks = this.blocks, i = this.lastByteIndex, blockCount = this.blockCount, s = this.s;
|
|
63438
|
+
blocks[i >> 2] |= this.padding[i & 3];
|
|
63439
|
+
if (this.lastByteIndex === this.byteCount) {
|
|
63440
|
+
blocks[0] = blocks[blockCount];
|
|
63441
|
+
for (i = 1; i < blockCount + 1; ++i) {
|
|
63442
|
+
blocks[i] = 0;
|
|
63443
|
+
}
|
|
63444
|
+
}
|
|
63445
|
+
blocks[blockCount - 1] |= 0x80000000;
|
|
63446
|
+
for (i = 0; i < blockCount; ++i) {
|
|
63447
|
+
s[i] ^= blocks[i];
|
|
63448
|
+
}
|
|
63449
|
+
f(s);
|
|
63450
|
+
};
|
|
63451
|
+
|
|
63452
|
+
Keccak.prototype.toString = Keccak.prototype.hex = function () {
|
|
63453
|
+
this.finalize();
|
|
63454
|
+
|
|
63455
|
+
var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks,
|
|
63456
|
+
extraBytes = this.extraBytes, i = 0, j = 0;
|
|
63457
|
+
var hex = '', block;
|
|
63458
|
+
while (j < outputBlocks) {
|
|
63459
|
+
for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {
|
|
63460
|
+
block = s[i];
|
|
63461
|
+
hex += HEX_CHARS[(block >> 4) & 0x0F] + HEX_CHARS[block & 0x0F] +
|
|
63462
|
+
HEX_CHARS[(block >> 12) & 0x0F] + HEX_CHARS[(block >> 8) & 0x0F] +
|
|
63463
|
+
HEX_CHARS[(block >> 20) & 0x0F] + HEX_CHARS[(block >> 16) & 0x0F] +
|
|
63464
|
+
HEX_CHARS[(block >> 28) & 0x0F] + HEX_CHARS[(block >> 24) & 0x0F];
|
|
63465
|
+
}
|
|
63466
|
+
if (j % blockCount === 0) {
|
|
63467
|
+
f(s);
|
|
63468
|
+
i = 0;
|
|
63469
|
+
}
|
|
63470
|
+
}
|
|
63471
|
+
if (extraBytes) {
|
|
63472
|
+
block = s[i];
|
|
63473
|
+
if (extraBytes > 0) {
|
|
63474
|
+
hex += HEX_CHARS[(block >> 4) & 0x0F] + HEX_CHARS[block & 0x0F];
|
|
63475
|
+
}
|
|
63476
|
+
if (extraBytes > 1) {
|
|
63477
|
+
hex += HEX_CHARS[(block >> 12) & 0x0F] + HEX_CHARS[(block >> 8) & 0x0F];
|
|
63478
|
+
}
|
|
63479
|
+
if (extraBytes > 2) {
|
|
63480
|
+
hex += HEX_CHARS[(block >> 20) & 0x0F] + HEX_CHARS[(block >> 16) & 0x0F];
|
|
63481
|
+
}
|
|
63482
|
+
}
|
|
63483
|
+
return hex;
|
|
63484
|
+
};
|
|
63485
|
+
|
|
63486
|
+
Keccak.prototype.arrayBuffer = function () {
|
|
63487
|
+
this.finalize();
|
|
63488
|
+
|
|
63489
|
+
var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks,
|
|
63490
|
+
extraBytes = this.extraBytes, i = 0, j = 0;
|
|
63491
|
+
var bytes = this.outputBits >> 3;
|
|
63492
|
+
var buffer;
|
|
63493
|
+
if (extraBytes) {
|
|
63494
|
+
buffer = new ArrayBuffer((outputBlocks + 1) << 2);
|
|
63495
|
+
} else {
|
|
63496
|
+
buffer = new ArrayBuffer(bytes);
|
|
63497
|
+
}
|
|
63498
|
+
var array = new Uint32Array(buffer);
|
|
63499
|
+
while (j < outputBlocks) {
|
|
63500
|
+
for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {
|
|
63501
|
+
array[j] = s[i];
|
|
63502
|
+
}
|
|
63503
|
+
if (j % blockCount === 0) {
|
|
63504
|
+
f(s);
|
|
63505
|
+
}
|
|
63506
|
+
}
|
|
63507
|
+
if (extraBytes) {
|
|
63508
|
+
array[i] = s[i];
|
|
63509
|
+
buffer = buffer.slice(0, bytes);
|
|
63510
|
+
}
|
|
63511
|
+
return buffer;
|
|
63512
|
+
};
|
|
63513
|
+
|
|
63514
|
+
Keccak.prototype.buffer = Keccak.prototype.arrayBuffer;
|
|
63515
|
+
|
|
63516
|
+
Keccak.prototype.digest = Keccak.prototype.array = function () {
|
|
63517
|
+
this.finalize();
|
|
63518
|
+
|
|
63519
|
+
var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks,
|
|
63520
|
+
extraBytes = this.extraBytes, i = 0, j = 0;
|
|
63521
|
+
var array = [], offset, block;
|
|
63522
|
+
while (j < outputBlocks) {
|
|
63523
|
+
for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {
|
|
63524
|
+
offset = j << 2;
|
|
63525
|
+
block = s[i];
|
|
63526
|
+
array[offset] = block & 0xFF;
|
|
63527
|
+
array[offset + 1] = (block >> 8) & 0xFF;
|
|
63528
|
+
array[offset + 2] = (block >> 16) & 0xFF;
|
|
63529
|
+
array[offset + 3] = (block >> 24) & 0xFF;
|
|
63530
|
+
}
|
|
63531
|
+
if (j % blockCount === 0) {
|
|
63532
|
+
f(s);
|
|
63533
|
+
}
|
|
63534
|
+
}
|
|
63535
|
+
if (extraBytes) {
|
|
63536
|
+
offset = j << 2;
|
|
63537
|
+
block = s[i];
|
|
63538
|
+
if (extraBytes > 0) {
|
|
63539
|
+
array[offset] = block & 0xFF;
|
|
63540
|
+
}
|
|
63541
|
+
if (extraBytes > 1) {
|
|
63542
|
+
array[offset + 1] = (block >> 8) & 0xFF;
|
|
63543
|
+
}
|
|
63544
|
+
if (extraBytes > 2) {
|
|
63545
|
+
array[offset + 2] = (block >> 16) & 0xFF;
|
|
63546
|
+
}
|
|
63547
|
+
}
|
|
63548
|
+
return array;
|
|
63549
|
+
};
|
|
63550
|
+
|
|
63551
|
+
var f = function (s) {
|
|
63552
|
+
var h, l, n, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9,
|
|
63553
|
+
b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16, b17,
|
|
63554
|
+
b18, b19, b20, b21, b22, b23, b24, b25, b26, b27, b28, b29, b30, b31, b32, b33,
|
|
63555
|
+
b34, b35, b36, b37, b38, b39, b40, b41, b42, b43, b44, b45, b46, b47, b48, b49;
|
|
63556
|
+
for (n = 0; n < 48; n += 2) {
|
|
63557
|
+
c0 = s[0] ^ s[10] ^ s[20] ^ s[30] ^ s[40];
|
|
63558
|
+
c1 = s[1] ^ s[11] ^ s[21] ^ s[31] ^ s[41];
|
|
63559
|
+
c2 = s[2] ^ s[12] ^ s[22] ^ s[32] ^ s[42];
|
|
63560
|
+
c3 = s[3] ^ s[13] ^ s[23] ^ s[33] ^ s[43];
|
|
63561
|
+
c4 = s[4] ^ s[14] ^ s[24] ^ s[34] ^ s[44];
|
|
63562
|
+
c5 = s[5] ^ s[15] ^ s[25] ^ s[35] ^ s[45];
|
|
63563
|
+
c6 = s[6] ^ s[16] ^ s[26] ^ s[36] ^ s[46];
|
|
63564
|
+
c7 = s[7] ^ s[17] ^ s[27] ^ s[37] ^ s[47];
|
|
63565
|
+
c8 = s[8] ^ s[18] ^ s[28] ^ s[38] ^ s[48];
|
|
63566
|
+
c9 = s[9] ^ s[19] ^ s[29] ^ s[39] ^ s[49];
|
|
63567
|
+
|
|
63568
|
+
h = c8 ^ ((c2 << 1) | (c3 >>> 31));
|
|
63569
|
+
l = c9 ^ ((c3 << 1) | (c2 >>> 31));
|
|
63570
|
+
s[0] ^= h;
|
|
63571
|
+
s[1] ^= l;
|
|
63572
|
+
s[10] ^= h;
|
|
63573
|
+
s[11] ^= l;
|
|
63574
|
+
s[20] ^= h;
|
|
63575
|
+
s[21] ^= l;
|
|
63576
|
+
s[30] ^= h;
|
|
63577
|
+
s[31] ^= l;
|
|
63578
|
+
s[40] ^= h;
|
|
63579
|
+
s[41] ^= l;
|
|
63580
|
+
h = c0 ^ ((c4 << 1) | (c5 >>> 31));
|
|
63581
|
+
l = c1 ^ ((c5 << 1) | (c4 >>> 31));
|
|
63582
|
+
s[2] ^= h;
|
|
63583
|
+
s[3] ^= l;
|
|
63584
|
+
s[12] ^= h;
|
|
63585
|
+
s[13] ^= l;
|
|
63586
|
+
s[22] ^= h;
|
|
63587
|
+
s[23] ^= l;
|
|
63588
|
+
s[32] ^= h;
|
|
63589
|
+
s[33] ^= l;
|
|
63590
|
+
s[42] ^= h;
|
|
63591
|
+
s[43] ^= l;
|
|
63592
|
+
h = c2 ^ ((c6 << 1) | (c7 >>> 31));
|
|
63593
|
+
l = c3 ^ ((c7 << 1) | (c6 >>> 31));
|
|
63594
|
+
s[4] ^= h;
|
|
63595
|
+
s[5] ^= l;
|
|
63596
|
+
s[14] ^= h;
|
|
63597
|
+
s[15] ^= l;
|
|
63598
|
+
s[24] ^= h;
|
|
63599
|
+
s[25] ^= l;
|
|
63600
|
+
s[34] ^= h;
|
|
63601
|
+
s[35] ^= l;
|
|
63602
|
+
s[44] ^= h;
|
|
63603
|
+
s[45] ^= l;
|
|
63604
|
+
h = c4 ^ ((c8 << 1) | (c9 >>> 31));
|
|
63605
|
+
l = c5 ^ ((c9 << 1) | (c8 >>> 31));
|
|
63606
|
+
s[6] ^= h;
|
|
63607
|
+
s[7] ^= l;
|
|
63608
|
+
s[16] ^= h;
|
|
63609
|
+
s[17] ^= l;
|
|
63610
|
+
s[26] ^= h;
|
|
63611
|
+
s[27] ^= l;
|
|
63612
|
+
s[36] ^= h;
|
|
63613
|
+
s[37] ^= l;
|
|
63614
|
+
s[46] ^= h;
|
|
63615
|
+
s[47] ^= l;
|
|
63616
|
+
h = c6 ^ ((c0 << 1) | (c1 >>> 31));
|
|
63617
|
+
l = c7 ^ ((c1 << 1) | (c0 >>> 31));
|
|
63618
|
+
s[8] ^= h;
|
|
63619
|
+
s[9] ^= l;
|
|
63620
|
+
s[18] ^= h;
|
|
63621
|
+
s[19] ^= l;
|
|
63622
|
+
s[28] ^= h;
|
|
63623
|
+
s[29] ^= l;
|
|
63624
|
+
s[38] ^= h;
|
|
63625
|
+
s[39] ^= l;
|
|
63626
|
+
s[48] ^= h;
|
|
63627
|
+
s[49] ^= l;
|
|
63628
|
+
|
|
63629
|
+
b0 = s[0];
|
|
63630
|
+
b1 = s[1];
|
|
63631
|
+
b32 = (s[11] << 4) | (s[10] >>> 28);
|
|
63632
|
+
b33 = (s[10] << 4) | (s[11] >>> 28);
|
|
63633
|
+
b14 = (s[20] << 3) | (s[21] >>> 29);
|
|
63634
|
+
b15 = (s[21] << 3) | (s[20] >>> 29);
|
|
63635
|
+
b46 = (s[31] << 9) | (s[30] >>> 23);
|
|
63636
|
+
b47 = (s[30] << 9) | (s[31] >>> 23);
|
|
63637
|
+
b28 = (s[40] << 18) | (s[41] >>> 14);
|
|
63638
|
+
b29 = (s[41] << 18) | (s[40] >>> 14);
|
|
63639
|
+
b20 = (s[2] << 1) | (s[3] >>> 31);
|
|
63640
|
+
b21 = (s[3] << 1) | (s[2] >>> 31);
|
|
63641
|
+
b2 = (s[13] << 12) | (s[12] >>> 20);
|
|
63642
|
+
b3 = (s[12] << 12) | (s[13] >>> 20);
|
|
63643
|
+
b34 = (s[22] << 10) | (s[23] >>> 22);
|
|
63644
|
+
b35 = (s[23] << 10) | (s[22] >>> 22);
|
|
63645
|
+
b16 = (s[33] << 13) | (s[32] >>> 19);
|
|
63646
|
+
b17 = (s[32] << 13) | (s[33] >>> 19);
|
|
63647
|
+
b48 = (s[42] << 2) | (s[43] >>> 30);
|
|
63648
|
+
b49 = (s[43] << 2) | (s[42] >>> 30);
|
|
63649
|
+
b40 = (s[5] << 30) | (s[4] >>> 2);
|
|
63650
|
+
b41 = (s[4] << 30) | (s[5] >>> 2);
|
|
63651
|
+
b22 = (s[14] << 6) | (s[15] >>> 26);
|
|
63652
|
+
b23 = (s[15] << 6) | (s[14] >>> 26);
|
|
63653
|
+
b4 = (s[25] << 11) | (s[24] >>> 21);
|
|
63654
|
+
b5 = (s[24] << 11) | (s[25] >>> 21);
|
|
63655
|
+
b36 = (s[34] << 15) | (s[35] >>> 17);
|
|
63656
|
+
b37 = (s[35] << 15) | (s[34] >>> 17);
|
|
63657
|
+
b18 = (s[45] << 29) | (s[44] >>> 3);
|
|
63658
|
+
b19 = (s[44] << 29) | (s[45] >>> 3);
|
|
63659
|
+
b10 = (s[6] << 28) | (s[7] >>> 4);
|
|
63660
|
+
b11 = (s[7] << 28) | (s[6] >>> 4);
|
|
63661
|
+
b42 = (s[17] << 23) | (s[16] >>> 9);
|
|
63662
|
+
b43 = (s[16] << 23) | (s[17] >>> 9);
|
|
63663
|
+
b24 = (s[26] << 25) | (s[27] >>> 7);
|
|
63664
|
+
b25 = (s[27] << 25) | (s[26] >>> 7);
|
|
63665
|
+
b6 = (s[36] << 21) | (s[37] >>> 11);
|
|
63666
|
+
b7 = (s[37] << 21) | (s[36] >>> 11);
|
|
63667
|
+
b38 = (s[47] << 24) | (s[46] >>> 8);
|
|
63668
|
+
b39 = (s[46] << 24) | (s[47] >>> 8);
|
|
63669
|
+
b30 = (s[8] << 27) | (s[9] >>> 5);
|
|
63670
|
+
b31 = (s[9] << 27) | (s[8] >>> 5);
|
|
63671
|
+
b12 = (s[18] << 20) | (s[19] >>> 12);
|
|
63672
|
+
b13 = (s[19] << 20) | (s[18] >>> 12);
|
|
63673
|
+
b44 = (s[29] << 7) | (s[28] >>> 25);
|
|
63674
|
+
b45 = (s[28] << 7) | (s[29] >>> 25);
|
|
63675
|
+
b26 = (s[38] << 8) | (s[39] >>> 24);
|
|
63676
|
+
b27 = (s[39] << 8) | (s[38] >>> 24);
|
|
63677
|
+
b8 = (s[48] << 14) | (s[49] >>> 18);
|
|
63678
|
+
b9 = (s[49] << 14) | (s[48] >>> 18);
|
|
63679
|
+
|
|
63680
|
+
s[0] = b0 ^ (~b2 & b4);
|
|
63681
|
+
s[1] = b1 ^ (~b3 & b5);
|
|
63682
|
+
s[10] = b10 ^ (~b12 & b14);
|
|
63683
|
+
s[11] = b11 ^ (~b13 & b15);
|
|
63684
|
+
s[20] = b20 ^ (~b22 & b24);
|
|
63685
|
+
s[21] = b21 ^ (~b23 & b25);
|
|
63686
|
+
s[30] = b30 ^ (~b32 & b34);
|
|
63687
|
+
s[31] = b31 ^ (~b33 & b35);
|
|
63688
|
+
s[40] = b40 ^ (~b42 & b44);
|
|
63689
|
+
s[41] = b41 ^ (~b43 & b45);
|
|
63690
|
+
s[2] = b2 ^ (~b4 & b6);
|
|
63691
|
+
s[3] = b3 ^ (~b5 & b7);
|
|
63692
|
+
s[12] = b12 ^ (~b14 & b16);
|
|
63693
|
+
s[13] = b13 ^ (~b15 & b17);
|
|
63694
|
+
s[22] = b22 ^ (~b24 & b26);
|
|
63695
|
+
s[23] = b23 ^ (~b25 & b27);
|
|
63696
|
+
s[32] = b32 ^ (~b34 & b36);
|
|
63697
|
+
s[33] = b33 ^ (~b35 & b37);
|
|
63698
|
+
s[42] = b42 ^ (~b44 & b46);
|
|
63699
|
+
s[43] = b43 ^ (~b45 & b47);
|
|
63700
|
+
s[4] = b4 ^ (~b6 & b8);
|
|
63701
|
+
s[5] = b5 ^ (~b7 & b9);
|
|
63702
|
+
s[14] = b14 ^ (~b16 & b18);
|
|
63703
|
+
s[15] = b15 ^ (~b17 & b19);
|
|
63704
|
+
s[24] = b24 ^ (~b26 & b28);
|
|
63705
|
+
s[25] = b25 ^ (~b27 & b29);
|
|
63706
|
+
s[34] = b34 ^ (~b36 & b38);
|
|
63707
|
+
s[35] = b35 ^ (~b37 & b39);
|
|
63708
|
+
s[44] = b44 ^ (~b46 & b48);
|
|
63709
|
+
s[45] = b45 ^ (~b47 & b49);
|
|
63710
|
+
s[6] = b6 ^ (~b8 & b0);
|
|
63711
|
+
s[7] = b7 ^ (~b9 & b1);
|
|
63712
|
+
s[16] = b16 ^ (~b18 & b10);
|
|
63713
|
+
s[17] = b17 ^ (~b19 & b11);
|
|
63714
|
+
s[26] = b26 ^ (~b28 & b20);
|
|
63715
|
+
s[27] = b27 ^ (~b29 & b21);
|
|
63716
|
+
s[36] = b36 ^ (~b38 & b30);
|
|
63717
|
+
s[37] = b37 ^ (~b39 & b31);
|
|
63718
|
+
s[46] = b46 ^ (~b48 & b40);
|
|
63719
|
+
s[47] = b47 ^ (~b49 & b41);
|
|
63720
|
+
s[8] = b8 ^ (~b0 & b2);
|
|
63721
|
+
s[9] = b9 ^ (~b1 & b3);
|
|
63722
|
+
s[18] = b18 ^ (~b10 & b12);
|
|
63723
|
+
s[19] = b19 ^ (~b11 & b13);
|
|
63724
|
+
s[28] = b28 ^ (~b20 & b22);
|
|
63725
|
+
s[29] = b29 ^ (~b21 & b23);
|
|
63726
|
+
s[38] = b38 ^ (~b30 & b32);
|
|
63727
|
+
s[39] = b39 ^ (~b31 & b33);
|
|
63728
|
+
s[48] = b48 ^ (~b40 & b42);
|
|
63729
|
+
s[49] = b49 ^ (~b41 & b43);
|
|
63730
|
+
|
|
63731
|
+
s[0] ^= RC[n];
|
|
63732
|
+
s[1] ^= RC[n + 1];
|
|
63733
|
+
}
|
|
63734
|
+
};
|
|
63735
|
+
|
|
63736
|
+
if (COMMON_JS) {
|
|
63737
|
+
module.exports = methods;
|
|
63738
|
+
} else {
|
|
63739
|
+
for (var i = 0; i < methodNames.length; ++i) {
|
|
63740
|
+
root[methodNames[i]] = methods[methodNames[i]];
|
|
63741
|
+
}
|
|
63742
|
+
}
|
|
63743
|
+
})();
|
|
63744
|
+
});
|
|
63745
|
+
|
|
63746
|
+
var sha3$1 = sha3;
|
|
63215
63747
|
|
|
63216
|
-
|
|
63748
|
+
function keccak256(data) {
|
|
63749
|
+
return '0x' + sha3$1.keccak_256(arrayify(data));
|
|
63750
|
+
}
|
|
63751
|
+
|
|
63752
|
+
const version$1$1 = "address/5.4.0";
|
|
63753
|
+
|
|
63754
|
+
const logger$1$1 = new Logger$1(version$1$1);
|
|
63755
|
+
function getChecksumAddress(address) {
|
|
63756
|
+
if (!isHexString$1(address, 20)) {
|
|
63757
|
+
logger$1$1.throwArgumentError("invalid address", "address", address);
|
|
63758
|
+
}
|
|
63759
|
+
address = address.toLowerCase();
|
|
63760
|
+
const chars = address.substring(2).split("");
|
|
63761
|
+
const expanded = new Uint8Array(40);
|
|
63762
|
+
for (let i = 0; i < 40; i++) {
|
|
63763
|
+
expanded[i] = chars[i].charCodeAt(0);
|
|
63764
|
+
}
|
|
63765
|
+
const hashed = arrayify(keccak256(expanded));
|
|
63766
|
+
for (let i = 0; i < 40; i += 2) {
|
|
63767
|
+
if ((hashed[i >> 1] >> 4) >= 8) {
|
|
63768
|
+
chars[i] = chars[i].toUpperCase();
|
|
63769
|
+
}
|
|
63770
|
+
if ((hashed[i >> 1] & 0x0f) >= 8) {
|
|
63771
|
+
chars[i + 1] = chars[i + 1].toUpperCase();
|
|
63772
|
+
}
|
|
63773
|
+
}
|
|
63774
|
+
return "0x" + chars.join("");
|
|
63775
|
+
}
|
|
63776
|
+
// Shims for environments that are missing some required constants and functions
|
|
63777
|
+
const MAX_SAFE_INTEGER = 0x1fffffffffffff;
|
|
63778
|
+
function log10(x) {
|
|
63779
|
+
if (Math.log10) {
|
|
63780
|
+
return Math.log10(x);
|
|
63781
|
+
}
|
|
63782
|
+
return Math.log(x) / Math.LN10;
|
|
63783
|
+
}
|
|
63784
|
+
// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number
|
|
63785
|
+
// Create lookup table
|
|
63786
|
+
const ibanLookup = {};
|
|
63787
|
+
for (let i = 0; i < 10; i++) {
|
|
63788
|
+
ibanLookup[String(i)] = String(i);
|
|
63789
|
+
}
|
|
63790
|
+
for (let i = 0; i < 26; i++) {
|
|
63791
|
+
ibanLookup[String.fromCharCode(65 + i)] = String(10 + i);
|
|
63792
|
+
}
|
|
63793
|
+
// How many decimal digits can we process? (for 64-bit float, this is 15)
|
|
63794
|
+
const safeDigits = Math.floor(log10(MAX_SAFE_INTEGER));
|
|
63795
|
+
function ibanChecksum(address) {
|
|
63796
|
+
address = address.toUpperCase();
|
|
63797
|
+
address = address.substring(4) + address.substring(0, 2) + "00";
|
|
63798
|
+
let expanded = address.split("").map((c) => { return ibanLookup[c]; }).join("");
|
|
63799
|
+
// Javascript can handle integers safely up to 15 (decimal) digits
|
|
63800
|
+
while (expanded.length >= safeDigits) {
|
|
63801
|
+
let block = expanded.substring(0, safeDigits);
|
|
63802
|
+
expanded = parseInt(block, 10) % 97 + expanded.substring(block.length);
|
|
63803
|
+
}
|
|
63804
|
+
let checksum = String(98 - (parseInt(expanded, 10) % 97));
|
|
63805
|
+
while (checksum.length < 2) {
|
|
63806
|
+
checksum = "0" + checksum;
|
|
63807
|
+
}
|
|
63808
|
+
return checksum;
|
|
63809
|
+
}
|
|
63810
|
+
function getAddress(address) {
|
|
63811
|
+
let result = null;
|
|
63812
|
+
if (typeof (address) !== "string") {
|
|
63813
|
+
logger$1$1.throwArgumentError("invalid address", "address", address);
|
|
63814
|
+
}
|
|
63815
|
+
if (address.match(/^(0x)?[0-9a-fA-F]{40}$/)) {
|
|
63816
|
+
// Missing the 0x prefix
|
|
63817
|
+
if (address.substring(0, 2) !== "0x") {
|
|
63818
|
+
address = "0x" + address;
|
|
63819
|
+
}
|
|
63820
|
+
result = getChecksumAddress(address);
|
|
63821
|
+
// It is a checksummed address with a bad checksum
|
|
63822
|
+
if (address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) && result !== address) {
|
|
63823
|
+
logger$1$1.throwArgumentError("bad address checksum", "address", address);
|
|
63824
|
+
}
|
|
63825
|
+
// Maybe ICAP? (we only support direct mode)
|
|
63826
|
+
}
|
|
63827
|
+
else if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {
|
|
63828
|
+
// It is an ICAP address with a bad checksum
|
|
63829
|
+
if (address.substring(2, 4) !== ibanChecksum(address)) {
|
|
63830
|
+
logger$1$1.throwArgumentError("bad icap checksum", "address", address);
|
|
63831
|
+
}
|
|
63832
|
+
result = _base36To16(address.substring(4));
|
|
63833
|
+
while (result.length < 40) {
|
|
63834
|
+
result = "0" + result;
|
|
63835
|
+
}
|
|
63836
|
+
result = getChecksumAddress("0x" + result);
|
|
63837
|
+
}
|
|
63838
|
+
else {
|
|
63839
|
+
logger$1$1.throwArgumentError("invalid address", "address", address);
|
|
63840
|
+
}
|
|
63841
|
+
return result;
|
|
63842
|
+
}
|
|
63843
|
+
|
|
63844
|
+
const version$5 = "units/5.4.0";
|
|
63845
|
+
|
|
63846
|
+
const logger$5 = new Logger$1(version$5);
|
|
63217
63847
|
const names = [
|
|
63218
63848
|
"wei",
|
|
63219
63849
|
"kwei",
|
|
@@ -63225,7 +63855,7 @@ const names = [
|
|
|
63225
63855
|
];
|
|
63226
63856
|
function parseUnits(value, unitName) {
|
|
63227
63857
|
if (typeof (value) !== "string") {
|
|
63228
|
-
logger$
|
|
63858
|
+
logger$5.throwArgumentError("value must be a string", "value", value);
|
|
63229
63859
|
}
|
|
63230
63860
|
if (typeof (unitName) === "string") {
|
|
63231
63861
|
const index = names.indexOf(unitName);
|
|
@@ -63365,7 +63995,8 @@ let getAmountsOut$1 = ({ path, amountIn, tokenIn, tokenOut }) => {
|
|
|
63365
63995
|
})
|
|
63366
63996
|
.then((amountsOut)=>{
|
|
63367
63997
|
resolve(amountsOut[amountsOut.length - 1]);
|
|
63368
|
-
})
|
|
63998
|
+
})
|
|
63999
|
+
.catch(()=>resolve());
|
|
63369
64000
|
})
|
|
63370
64001
|
};
|
|
63371
64002
|
|
|
@@ -63488,6 +64119,10 @@ let getTransaction$1 = ({
|
|
|
63488
64119
|
return transaction
|
|
63489
64120
|
};
|
|
63490
64121
|
|
|
64122
|
+
const fixCheckSum = (address)=>{
|
|
64123
|
+
return getAddress(address)
|
|
64124
|
+
};
|
|
64125
|
+
|
|
63491
64126
|
let route$6 = ({
|
|
63492
64127
|
exchange,
|
|
63493
64128
|
tokenIn,
|
|
@@ -63499,6 +64134,8 @@ let route$6 = ({
|
|
|
63499
64134
|
amountInMax = undefined,
|
|
63500
64135
|
amountOutMin = undefined,
|
|
63501
64136
|
}) => {
|
|
64137
|
+
tokenIn = fixCheckSum(tokenIn);
|
|
64138
|
+
tokenOut = fixCheckSum(tokenOut);
|
|
63502
64139
|
return new Promise(async (resolve)=> {
|
|
63503
64140
|
let path = await findPath$1({ tokenIn, tokenOut });
|
|
63504
64141
|
if (path === undefined || path.length == 0) { return resolve() }
|
|
@@ -63704,7 +64341,8 @@ let getAmountsOut = ({ path, amountIn, tokenIn, tokenOut }) => {
|
|
|
63704
64341
|
})
|
|
63705
64342
|
.then((amountsOut)=>{
|
|
63706
64343
|
resolve(amountsOut[amountsOut.length - 1]);
|
|
63707
|
-
})
|
|
64344
|
+
})
|
|
64345
|
+
.catch(()=>resolve());
|
|
63708
64346
|
})
|
|
63709
64347
|
};
|
|
63710
64348
|
|
|
@@ -63836,6 +64474,8 @@ let route$4 = ({
|
|
|
63836
64474
|
amountInMax = undefined,
|
|
63837
64475
|
amountOutMin = undefined,
|
|
63838
64476
|
}) => {
|
|
64477
|
+
tokenIn = fixCheckSum(tokenIn);
|
|
64478
|
+
tokenOut = fixCheckSum(tokenOut);
|
|
63839
64479
|
return new Promise(async (resolve)=> {
|
|
63840
64480
|
let path = await findPath({ tokenIn, tokenOut });
|
|
63841
64481
|
if (path === undefined || path.length == 0) { return resolve() }
|
|
@@ -64185,12 +64825,18 @@ var ChangableAmountProvider = (function (props) {
|
|
|
64185
64825
|
});
|
|
64186
64826
|
})).then(function (amounts) {
|
|
64187
64827
|
setAcceptWithAmount(props.accept.map(function (configuration, index) {
|
|
64828
|
+
if (amounts[index] == undefined) {
|
|
64829
|
+
return;
|
|
64830
|
+
}
|
|
64831
|
+
|
|
64188
64832
|
return {
|
|
64189
64833
|
blockchain: configuration.blockchain,
|
|
64190
|
-
amount: round$1(amounts[index])
|
|
64834
|
+
amount: round$1(amounts[index]),
|
|
64191
64835
|
token: configuration.token,
|
|
64192
64836
|
receiver: configuration.receiver || account
|
|
64193
64837
|
};
|
|
64838
|
+
}).filter(function (configuration) {
|
|
64839
|
+
return !!configuration;
|
|
64194
64840
|
}));
|
|
64195
64841
|
})["catch"](setError);
|
|
64196
64842
|
})["catch"](setError);
|
|
@@ -64769,7 +65415,9 @@ var NoPaymentMethodFoundDialog = (function () {
|
|
|
64769
65415
|
}, /*#__PURE__*/react.createElement("strong", {
|
|
64770
65416
|
className: "FontSizeM"
|
|
64771
65417
|
}, "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."))),
|
|
64772
|
-
footer: /*#__PURE__*/react.createElement("div",
|
|
65418
|
+
footer: /*#__PURE__*/react.createElement("div", {
|
|
65419
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
65420
|
+
}, /*#__PURE__*/react.createElement("button", {
|
|
64773
65421
|
className: "ButtonPrimary",
|
|
64774
65422
|
onClick: close
|
|
64775
65423
|
}, "Ok"))
|
|
@@ -64780,7 +65428,7 @@ var PaymentContext = /*#__PURE__*/react.createContext();
|
|
|
64780
65428
|
|
|
64781
65429
|
var PaymentRoutingContext = /*#__PURE__*/react.createContext();
|
|
64782
65430
|
|
|
64783
|
-
var
|
|
65431
|
+
var TrackingContext = /*#__PURE__*/react.createContext();
|
|
64784
65432
|
|
|
64785
65433
|
var PaymentProvider = (function (props) {
|
|
64786
65434
|
var _useContext = react.useContext(ErrorContext),
|
|
@@ -64789,7 +65437,6 @@ var PaymentProvider = (function (props) {
|
|
|
64789
65437
|
var _useContext2 = react.useContext(ConfigurationContext),
|
|
64790
65438
|
_sent = _useContext2.sent,
|
|
64791
65439
|
_confirmed = _useContext2.confirmed,
|
|
64792
|
-
_ensured = _useContext2.ensured,
|
|
64793
65440
|
_failed = _useContext2.failed;
|
|
64794
65441
|
|
|
64795
65442
|
var _useContext3 = react.useContext(PaymentRoutingContext),
|
|
@@ -64803,13 +65450,17 @@ var PaymentProvider = (function (props) {
|
|
|
64803
65450
|
var _useContext5 = react.useContext(PaymentRoutingContext),
|
|
64804
65451
|
allRoutes = _useContext5.allRoutes;
|
|
64805
65452
|
|
|
64806
|
-
var _useContext6 = react.useContext(
|
|
64807
|
-
_useContext6.
|
|
64808
|
-
var setUpdate = _useContext6.setUpdate;
|
|
65453
|
+
var _useContext6 = react.useContext(UpdatableContext),
|
|
65454
|
+
setUpdatable = _useContext6.setUpdatable;
|
|
64809
65455
|
|
|
64810
65456
|
var _useContext7 = react.useContext(WalletContext),
|
|
64811
65457
|
wallet = _useContext7.wallet;
|
|
64812
65458
|
|
|
65459
|
+
var _useContext8 = react.useContext(TrackingContext),
|
|
65460
|
+
forward = _useContext8.forward,
|
|
65461
|
+
tracking = _useContext8.tracking,
|
|
65462
|
+
initializeTracking = _useContext8.initializeTracking;
|
|
65463
|
+
|
|
64813
65464
|
var _useState = react.useState(),
|
|
64814
65465
|
_useState2 = _slicedToArray(_useState, 2),
|
|
64815
65466
|
payment = _useState2[0],
|
|
@@ -64830,53 +65481,81 @@ var PaymentProvider = (function (props) {
|
|
|
64830
65481
|
paymentState = _useState8[0],
|
|
64831
65482
|
setPaymentState = _useState8[1];
|
|
64832
65483
|
|
|
64833
|
-
var pay = function
|
|
64834
|
-
var
|
|
64835
|
-
|
|
64836
|
-
|
|
64837
|
-
|
|
64838
|
-
|
|
64839
|
-
|
|
64840
|
-
|
|
64841
|
-
|
|
64842
|
-
|
|
64843
|
-
|
|
64844
|
-
|
|
64845
|
-
|
|
64846
|
-
|
|
65484
|
+
var pay = /*#__PURE__*/function () {
|
|
65485
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(_ref) {
|
|
65486
|
+
var navigate, currentBlock;
|
|
65487
|
+
return regenerator.wrap(function _callee$(_context) {
|
|
65488
|
+
while (1) {
|
|
65489
|
+
switch (_context.prev = _context.next) {
|
|
65490
|
+
case 0:
|
|
65491
|
+
navigate = _ref.navigate;
|
|
65492
|
+
setClosable(false);
|
|
65493
|
+
setPaymentState('paying');
|
|
65494
|
+
setUpdatable(false);
|
|
65495
|
+
_context.next = 6;
|
|
65496
|
+
return request({
|
|
65497
|
+
blockchain: payment.route.transaction.blockchain,
|
|
65498
|
+
method: 'latestBlockNumber'
|
|
65499
|
+
});
|
|
64847
65500
|
|
|
64848
|
-
|
|
64849
|
-
|
|
64850
|
-
|
|
64851
|
-
|
|
64852
|
-
|
|
64853
|
-
|
|
64854
|
-
|
|
64855
|
-
|
|
64856
|
-
|
|
64857
|
-
|
|
64858
|
-
|
|
64859
|
-
|
|
64860
|
-
}
|
|
65501
|
+
case 6:
|
|
65502
|
+
currentBlock = _context.sent;
|
|
65503
|
+
wallet.sendTransaction(Object.assign({}, payment.route.transaction, {
|
|
65504
|
+
sent: function sent(transaction) {
|
|
65505
|
+
if (_sent) {
|
|
65506
|
+
_sent(transaction);
|
|
65507
|
+
}
|
|
65508
|
+
},
|
|
65509
|
+
confirmed: function confirmed(transaction) {
|
|
65510
|
+
if (tracking != true) {
|
|
65511
|
+
setClosable(true);
|
|
65512
|
+
}
|
|
64861
65513
|
|
|
64862
|
-
|
|
64863
|
-
setClosable(true);
|
|
64864
|
-
setUpdate(true);
|
|
64865
|
-
navigate('PaymentError');
|
|
64866
|
-
}
|
|
64867
|
-
})).then(function (sentTransaction) {
|
|
64868
|
-
setTransaction(sentTransaction);
|
|
64869
|
-
})["catch"](function (error) {
|
|
64870
|
-
console.log('error', error);
|
|
64871
|
-
setPaymentState('initialized');
|
|
64872
|
-
setClosable(true);
|
|
64873
|
-
setUpdate(true);
|
|
65514
|
+
setPaymentState('confirmed');
|
|
64874
65515
|
|
|
64875
|
-
|
|
64876
|
-
|
|
64877
|
-
|
|
64878
|
-
|
|
64879
|
-
|
|
65516
|
+
if (_confirmed) {
|
|
65517
|
+
_confirmed(transaction);
|
|
65518
|
+
}
|
|
65519
|
+
},
|
|
65520
|
+
failed: function failed(transaction, error) {
|
|
65521
|
+
if (_failed) {
|
|
65522
|
+
_failed(transaction, error);
|
|
65523
|
+
}
|
|
65524
|
+
|
|
65525
|
+
setPaymentState('initialized');
|
|
65526
|
+
setClosable(true);
|
|
65527
|
+
setUpdatable(true);
|
|
65528
|
+
navigate('PaymentError');
|
|
65529
|
+
}
|
|
65530
|
+
})).then(function (sentTransaction) {
|
|
65531
|
+
if (tracking) {
|
|
65532
|
+
initializeTracking(sentTransaction, currentBlock);
|
|
65533
|
+
}
|
|
65534
|
+
|
|
65535
|
+
setTransaction(sentTransaction);
|
|
65536
|
+
})["catch"](function (error) {
|
|
65537
|
+
console.log('error', error);
|
|
65538
|
+
setPaymentState('initialized');
|
|
65539
|
+
setClosable(true);
|
|
65540
|
+
setUpdatable(true);
|
|
65541
|
+
|
|
65542
|
+
if ((error === null || error === void 0 ? void 0 : error.code) == 'WRONG_NETWORK') {
|
|
65543
|
+
navigate('WrongNetwork');
|
|
65544
|
+
}
|
|
65545
|
+
});
|
|
65546
|
+
|
|
65547
|
+
case 8:
|
|
65548
|
+
case "end":
|
|
65549
|
+
return _context.stop();
|
|
65550
|
+
}
|
|
65551
|
+
}
|
|
65552
|
+
}, _callee);
|
|
65553
|
+
}));
|
|
65554
|
+
|
|
65555
|
+
return function pay(_x) {
|
|
65556
|
+
return _ref2.apply(this, arguments);
|
|
65557
|
+
};
|
|
65558
|
+
}();
|
|
64880
65559
|
|
|
64881
65560
|
var approve = function approve() {
|
|
64882
65561
|
setClosable(false);
|
|
@@ -64897,15 +65576,20 @@ var PaymentProvider = (function (props) {
|
|
|
64897
65576
|
});
|
|
64898
65577
|
};
|
|
64899
65578
|
|
|
65579
|
+
react.useEffect(function () {
|
|
65580
|
+
if (forward) {
|
|
65581
|
+
setPaymentState('confirmed');
|
|
65582
|
+
}
|
|
65583
|
+
}, [forward]);
|
|
64900
65584
|
react.useEffect(function () {
|
|
64901
65585
|
if (selectedRoute) {
|
|
64902
65586
|
var fromToken = selectedRoute.fromToken;
|
|
64903
65587
|
selectedRoute.transaction.params;
|
|
64904
|
-
Promise.all([fromToken.name(), fromToken.symbol(), fromToken.readable(selectedRoute.fromAmount)]).then(function (
|
|
64905
|
-
var
|
|
64906
|
-
name =
|
|
64907
|
-
symbol =
|
|
64908
|
-
amount =
|
|
65588
|
+
Promise.all([fromToken.name(), fromToken.symbol(), fromToken.readable(selectedRoute.fromAmount)]).then(function (_ref3) {
|
|
65589
|
+
var _ref4 = _slicedToArray(_ref3, 3),
|
|
65590
|
+
name = _ref4[0],
|
|
65591
|
+
symbol = _ref4[1],
|
|
65592
|
+
amount = _ref4[2];
|
|
64909
65593
|
|
|
64910
65594
|
setPayment({
|
|
64911
65595
|
route: selectedRoute,
|
|
@@ -64921,9 +65605,9 @@ var PaymentProvider = (function (props) {
|
|
|
64921
65605
|
}, [selectedRoute]);
|
|
64922
65606
|
react.useEffect(function () {
|
|
64923
65607
|
if (allRoutes && allRoutes.length == 0) {
|
|
64924
|
-
|
|
65608
|
+
setUpdatable(false);
|
|
64925
65609
|
} else if (allRoutes && allRoutes.length > 0) {
|
|
64926
|
-
|
|
65610
|
+
setUpdatable(true);
|
|
64927
65611
|
}
|
|
64928
65612
|
}, [allRoutes]);
|
|
64929
65613
|
|
|
@@ -69723,9 +70407,9 @@ let addTransactions = ({ routes, event }) => {
|
|
|
69723
70407
|
})
|
|
69724
70408
|
};
|
|
69725
70409
|
|
|
69726
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
70410
|
+
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; }
|
|
69727
70411
|
|
|
69728
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
70412
|
+
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; }
|
|
69729
70413
|
var PaymentRoutingProvider = (function (props) {
|
|
69730
70414
|
var _useState = react.useState(),
|
|
69731
70415
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -69745,8 +70429,8 @@ var PaymentRoutingProvider = (function (props) {
|
|
|
69745
70429
|
var _useContext = react.useContext(WalletContext),
|
|
69746
70430
|
account = _useContext.account;
|
|
69747
70431
|
|
|
69748
|
-
var _useContext2 = react.useContext(
|
|
69749
|
-
|
|
70432
|
+
var _useContext2 = react.useContext(UpdatableContext),
|
|
70433
|
+
updatable = _useContext2.updatable;
|
|
69750
70434
|
|
|
69751
70435
|
var prepareAcceptedPayments = function prepareAcceptedPayments(accept) {
|
|
69752
70436
|
var toAddress = _typeof(accept.receiver) == 'object' ? accept.receiver.address : accept.receiver;
|
|
@@ -69761,9 +70445,9 @@ var PaymentRoutingProvider = (function (props) {
|
|
|
69761
70445
|
var getPaymentRoutes = function getPaymentRoutes(_ref) {
|
|
69762
70446
|
var allRoutes = _ref.allRoutes,
|
|
69763
70447
|
selectedRoute = _ref.selectedRoute,
|
|
69764
|
-
|
|
70448
|
+
updatable = _ref.updatable;
|
|
69765
70449
|
|
|
69766
|
-
if (
|
|
70450
|
+
if (updatable == false || !props.accept || !account) {
|
|
69767
70451
|
return;
|
|
69768
70452
|
}
|
|
69769
70453
|
|
|
@@ -69866,13 +70550,13 @@ var PaymentRoutingProvider = (function (props) {
|
|
|
69866
70550
|
getPaymentRoutes({
|
|
69867
70551
|
allRoutes: allRoutes,
|
|
69868
70552
|
selectedRoute: selectedRoute,
|
|
69869
|
-
|
|
70553
|
+
updatable: updatable
|
|
69870
70554
|
});
|
|
69871
70555
|
}, 15000);
|
|
69872
70556
|
return function () {
|
|
69873
70557
|
return clearTimeout(timeout);
|
|
69874
70558
|
};
|
|
69875
|
-
}, [reloadCount, allRoutes, selectedRoute,
|
|
70559
|
+
}, [reloadCount, allRoutes, selectedRoute, updatable]);
|
|
69876
70560
|
react.useEffect(function () {
|
|
69877
70561
|
if (account && props.accept) {
|
|
69878
70562
|
setAllRoutes(undefined);
|
|
@@ -69902,8 +70586,8 @@ var PaymentValueProvider = (function (props) {
|
|
|
69902
70586
|
var _useContext2 = react.useContext(WalletContext),
|
|
69903
70587
|
account = _useContext2.account;
|
|
69904
70588
|
|
|
69905
|
-
var _useContext3 = react.useContext(
|
|
69906
|
-
|
|
70589
|
+
var _useContext3 = react.useContext(UpdatableContext),
|
|
70590
|
+
updatable = _useContext3.updatable;
|
|
69907
70591
|
|
|
69908
70592
|
var _useContext4 = react.useContext(PaymentContext),
|
|
69909
70593
|
payment = _useContext4.payment;
|
|
@@ -69922,10 +70606,10 @@ var PaymentValueProvider = (function (props) {
|
|
|
69922
70606
|
setReloadCount = _useState4[1];
|
|
69923
70607
|
|
|
69924
70608
|
var getToTokenLocalValue = function getToTokenLocalValue(_ref) {
|
|
69925
|
-
var
|
|
70609
|
+
var updatable = _ref.updatable,
|
|
69926
70610
|
payment = _ref.payment;
|
|
69927
70611
|
|
|
69928
|
-
if (
|
|
70612
|
+
if (updatable == false || (payment === null || payment === void 0 ? void 0 : payment.route) == undefined) {
|
|
69929
70613
|
return;
|
|
69930
70614
|
}
|
|
69931
70615
|
|
|
@@ -69968,7 +70652,7 @@ var PaymentValueProvider = (function (props) {
|
|
|
69968
70652
|
react.useEffect(function () {
|
|
69969
70653
|
if (account && payment) {
|
|
69970
70654
|
getToTokenLocalValue({
|
|
69971
|
-
|
|
70655
|
+
updatable: updatable,
|
|
69972
70656
|
payment: payment
|
|
69973
70657
|
});
|
|
69974
70658
|
}
|
|
@@ -69977,13 +70661,13 @@ var PaymentValueProvider = (function (props) {
|
|
|
69977
70661
|
var timeout = setTimeout(function () {
|
|
69978
70662
|
setReloadCount(reloadCount + 1);
|
|
69979
70663
|
getToTokenLocalValue({
|
|
69980
|
-
|
|
70664
|
+
updatable: updatable
|
|
69981
70665
|
});
|
|
69982
70666
|
}, 15000);
|
|
69983
70667
|
return function () {
|
|
69984
70668
|
return clearTimeout(timeout);
|
|
69985
70669
|
};
|
|
69986
|
-
}, [reloadCount,
|
|
70670
|
+
}, [reloadCount, updatable]);
|
|
69987
70671
|
return /*#__PURE__*/react.createElement(PaymentValueContext.Provider, {
|
|
69988
70672
|
value: {
|
|
69989
70673
|
paymentValue: paymentValue
|
|
@@ -71870,7 +72554,9 @@ var ChangeAmountDialog = (function (props) {
|
|
|
71870
72554
|
changeAmount(toValidValue(maxAmount));
|
|
71871
72555
|
}
|
|
71872
72556
|
}, "(Max)")))))),
|
|
71873
|
-
footer: /*#__PURE__*/react.createElement("div",
|
|
72557
|
+
footer: /*#__PURE__*/react.createElement("div", {
|
|
72558
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
72559
|
+
}, /*#__PURE__*/react.createElement("button", {
|
|
71874
72560
|
className: "ButtonPrimary",
|
|
71875
72561
|
onClick: changeAmountAndGoBack
|
|
71876
72562
|
}, "Done"))
|
|
@@ -71957,6 +72643,7 @@ var ChangePaymentDialog = (function (props) {
|
|
|
71957
72643
|
}, [allRoutes]);
|
|
71958
72644
|
react.useEffect(function () {
|
|
71959
72645
|
setCards(allPaymentRoutesWithData.map(function (payment, index) {
|
|
72646
|
+
var blockchain = Blockchain.findByName(payment.route.blockchain);
|
|
71960
72647
|
return /*#__PURE__*/react.createElement("div", {
|
|
71961
72648
|
key: index,
|
|
71962
72649
|
className: "Card",
|
|
@@ -71970,6 +72657,11 @@ var ChangePaymentDialog = (function (props) {
|
|
|
71970
72657
|
}, /*#__PURE__*/react.createElement(TokenImage_1, {
|
|
71971
72658
|
blockchain: payment.route.blockchain,
|
|
71972
72659
|
address: payment.route.fromToken.address
|
|
72660
|
+
}), /*#__PURE__*/react.createElement("img", {
|
|
72661
|
+
className: "BlockchainLogo small",
|
|
72662
|
+
src: blockchain.logo,
|
|
72663
|
+
alt: blockchain.label,
|
|
72664
|
+
title: blockchain.label
|
|
71973
72665
|
})), /*#__PURE__*/react.createElement("div", {
|
|
71974
72666
|
className: "CardBody"
|
|
71975
72667
|
}, /*#__PURE__*/react.createElement("div", {
|
|
@@ -71984,11 +72676,7 @@ var ChangePaymentDialog = (function (props) {
|
|
|
71984
72676
|
className: "TokenAmountCell"
|
|
71985
72677
|
}, format(payment.amount)))), /*#__PURE__*/react.createElement("h3", {
|
|
71986
72678
|
className: "CardText"
|
|
71987
|
-
}, /*#__PURE__*/react.createElement("small", null, format(round$1(parseFloat(payment.route.fromBalance.toString()) / Math.pow(10, payment.decimals), 'down'))))))
|
|
71988
|
-
className: "CardInfo"
|
|
71989
|
-
}, payment.route.approvalRequired && /*#__PURE__*/react.createElement("span", {
|
|
71990
|
-
className: "Label"
|
|
71991
|
-
}, "Requires Approval")));
|
|
72679
|
+
}, /*#__PURE__*/react.createElement("small", null, format(round$1(parseFloat(payment.route.fromBalance.toString()) / Math.pow(10, payment.decimals), 'down')))))));
|
|
71992
72680
|
}));
|
|
71993
72681
|
}, [allPaymentRoutesWithData]);
|
|
71994
72682
|
|
|
@@ -72014,25 +72702,12 @@ var ChangePaymentDialog = (function (props) {
|
|
|
72014
72702
|
});
|
|
72015
72703
|
});
|
|
72016
72704
|
|
|
72017
|
-
var Checkmark = (function () {
|
|
72018
|
-
return /*#__PURE__*/react.createElement("svg", {
|
|
72019
|
-
className: "Checkmark Icon",
|
|
72020
|
-
version: "1.1",
|
|
72021
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
72022
|
-
x: "0px",
|
|
72023
|
-
y: "0px",
|
|
72024
|
-
viewBox: "0 0 24 24"
|
|
72025
|
-
}, /*#__PURE__*/react.createElement("path", {
|
|
72026
|
-
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"
|
|
72027
|
-
}));
|
|
72028
|
-
});
|
|
72029
|
-
|
|
72030
72705
|
var DonationOverviewSkeleton = (function (props) {
|
|
72031
72706
|
return /*#__PURE__*/react.createElement(Dialog, {
|
|
72032
72707
|
header: /*#__PURE__*/react.createElement("div", {
|
|
72033
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
72708
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
72034
72709
|
}, /*#__PURE__*/react.createElement("h1", {
|
|
72035
|
-
className: "LineHeightL FontSizeL
|
|
72710
|
+
className: "LineHeightL FontSizeL"
|
|
72036
72711
|
}, "Donation")),
|
|
72037
72712
|
body: /*#__PURE__*/react.createElement("div", {
|
|
72038
72713
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -72046,7 +72721,7 @@ var DonationOverviewSkeleton = (function (props) {
|
|
|
72046
72721
|
className: "SkeletonBackground"
|
|
72047
72722
|
}))),
|
|
72048
72723
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
72049
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
72724
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
72050
72725
|
}, /*#__PURE__*/react.createElement("div", {
|
|
72051
72726
|
className: "SkeletonWrapper"
|
|
72052
72727
|
}, /*#__PURE__*/react.createElement("div", {
|
|
@@ -72057,6 +72732,60 @@ var DonationOverviewSkeleton = (function (props) {
|
|
|
72057
72732
|
});
|
|
72058
72733
|
});
|
|
72059
72734
|
|
|
72735
|
+
var Checkmark = (function (props) {
|
|
72736
|
+
return /*#__PURE__*/react.createElement("svg", {
|
|
72737
|
+
className: "Checkmark Icon " + props.className,
|
|
72738
|
+
version: "1.1",
|
|
72739
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
72740
|
+
x: "0px",
|
|
72741
|
+
y: "0px",
|
|
72742
|
+
viewBox: "0 0 24 24"
|
|
72743
|
+
}, /*#__PURE__*/react.createElement("path", {
|
|
72744
|
+
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"
|
|
72745
|
+
}));
|
|
72746
|
+
});
|
|
72747
|
+
|
|
72748
|
+
var DigitalWalletIcon = (function (props) {
|
|
72749
|
+
return /*#__PURE__*/react.createElement("svg", {
|
|
72750
|
+
className: "DigitalWalletIcon Icon " + props.className,
|
|
72751
|
+
version: "1.1",
|
|
72752
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
72753
|
+
height: "24",
|
|
72754
|
+
width: "24",
|
|
72755
|
+
viewBox: "0 0 24 24"
|
|
72756
|
+
}, /*#__PURE__*/react.createElement("path", {
|
|
72757
|
+
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",
|
|
72758
|
+
transform: "translate(-0.81 -1)"
|
|
72759
|
+
}), /*#__PURE__*/react.createElement("path", {
|
|
72760
|
+
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",
|
|
72761
|
+
transform: "translate(-0.81 -1)"
|
|
72762
|
+
}), /*#__PURE__*/react.createElement("path", {
|
|
72763
|
+
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",
|
|
72764
|
+
transform: "translate(-0.81 -1)"
|
|
72765
|
+
}), /*#__PURE__*/react.createElement("path", {
|
|
72766
|
+
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",
|
|
72767
|
+
transform: "translate(-0.81 -1)"
|
|
72768
|
+
}), /*#__PURE__*/react.createElement("path", {
|
|
72769
|
+
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",
|
|
72770
|
+
transform: "translate(-0.81 -1)"
|
|
72771
|
+
}), /*#__PURE__*/react.createElement("path", {
|
|
72772
|
+
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",
|
|
72773
|
+
transform: "translate(-0.81 -1)"
|
|
72774
|
+
}), /*#__PURE__*/react.createElement("path", {
|
|
72775
|
+
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",
|
|
72776
|
+
transform: "translate(-0.81 -1)"
|
|
72777
|
+
}), /*#__PURE__*/react.createElement("rect", {
|
|
72778
|
+
x: "0.33",
|
|
72779
|
+
y: "11.77",
|
|
72780
|
+
width: "4.72",
|
|
72781
|
+
height: "0.66"
|
|
72782
|
+
}), /*#__PURE__*/react.createElement("polygon", {
|
|
72783
|
+
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"
|
|
72784
|
+
}), /*#__PURE__*/react.createElement("polygon", {
|
|
72785
|
+
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"
|
|
72786
|
+
}));
|
|
72787
|
+
});
|
|
72788
|
+
|
|
72060
72789
|
var LoadingText = (function (props) {
|
|
72061
72790
|
return /*#__PURE__*/react.createElement("div", {
|
|
72062
72791
|
className: "LoadingText"
|
|
@@ -72069,26 +72798,143 @@ var LoadingText = (function (props) {
|
|
|
72069
72798
|
}, "."));
|
|
72070
72799
|
});
|
|
72071
72800
|
|
|
72072
|
-
var
|
|
72801
|
+
var Footer = (function () {
|
|
72073
72802
|
var _useContext = react.useContext(ConfigurationContext),
|
|
72074
72803
|
currencyCode = _useContext.currencyCode;
|
|
72075
72804
|
|
|
72076
72805
|
var _useContext2 = react.useContext(ChangableAmountContext),
|
|
72077
72806
|
amount = _useContext2.amount;
|
|
72807
|
+
_useContext2.amountsMissing;
|
|
72078
72808
|
|
|
72079
|
-
var _useContext3 = react.useContext(
|
|
72080
|
-
|
|
72081
|
-
|
|
72082
|
-
|
|
72083
|
-
transaction = _useContext3.transaction,
|
|
72084
|
-
approve = _useContext3.approve,
|
|
72085
|
-
approvalTransaction = _useContext3.approvalTransaction;
|
|
72809
|
+
var _useContext3 = react.useContext(TrackingContext),
|
|
72810
|
+
tracking = _useContext3.tracking,
|
|
72811
|
+
forward = _useContext3.forward,
|
|
72812
|
+
forwardTo = _useContext3.forwardTo;
|
|
72086
72813
|
|
|
72087
|
-
var _useContext4 = react.useContext(
|
|
72088
|
-
|
|
72814
|
+
var _useContext4 = react.useContext(PaymentContext),
|
|
72815
|
+
payment = _useContext4.payment,
|
|
72816
|
+
paymentState = _useContext4.paymentState,
|
|
72817
|
+
pay = _useContext4.pay,
|
|
72818
|
+
transaction = _useContext4.transaction,
|
|
72819
|
+
approve = _useContext4.approve,
|
|
72820
|
+
approvalTransaction = _useContext4.approvalTransaction;
|
|
72821
|
+
|
|
72822
|
+
var _useContext5 = react.useContext(PaymentValueContext),
|
|
72823
|
+
paymentValue = _useContext5.paymentValue;
|
|
72824
|
+
|
|
72825
|
+
var _useContext6 = react.useContext(NavigateStackContext_1),
|
|
72826
|
+
navigate = _useContext6.navigate;
|
|
72827
|
+
|
|
72828
|
+
var _useContext7 = react.useContext(ClosableContext),
|
|
72829
|
+
close = _useContext7.close;
|
|
72830
|
+
|
|
72831
|
+
var trackingInfo = function trackingInfo() {
|
|
72832
|
+
if (tracking != true) {
|
|
72833
|
+
return null;
|
|
72834
|
+
}
|
|
72835
|
+
|
|
72836
|
+
if (forward) {
|
|
72837
|
+
return /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("a", {
|
|
72838
|
+
className: "Card transparent small disabled"
|
|
72839
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72840
|
+
className: "CardImage"
|
|
72841
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72842
|
+
className: "TextCenter Opacity05"
|
|
72843
|
+
}, /*#__PURE__*/react.createElement(Checkmark, {
|
|
72844
|
+
className: "small"
|
|
72845
|
+
}))), /*#__PURE__*/react.createElement("div", {
|
|
72846
|
+
className: "CardBody"
|
|
72847
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72848
|
+
className: "CardBodyWrapper"
|
|
72849
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72850
|
+
className: "Opacity05"
|
|
72851
|
+
}, "Payment confirmation has been stored")))));
|
|
72852
|
+
} else {
|
|
72853
|
+
return /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("a", {
|
|
72854
|
+
className: "Card transparent small disabled"
|
|
72855
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72856
|
+
className: "CardImage"
|
|
72857
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72858
|
+
className: "TextCenter"
|
|
72859
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72860
|
+
className: "Loading Icon"
|
|
72861
|
+
}))), /*#__PURE__*/react.createElement("div", {
|
|
72862
|
+
className: "CardBody"
|
|
72863
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72864
|
+
className: "CardBodyWrapper"
|
|
72865
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72866
|
+
className: "Opacity05"
|
|
72867
|
+
}, "Storing payment confirmation")))));
|
|
72868
|
+
}
|
|
72869
|
+
};
|
|
72870
|
+
|
|
72871
|
+
var additionalPaymentInformation = function additionalPaymentInformation() {
|
|
72872
|
+
if (paymentState == 'paying' && transaction == undefined) {
|
|
72873
|
+
return /*#__PURE__*/react.createElement("div", {
|
|
72874
|
+
className: "PaddingBottomS"
|
|
72875
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72876
|
+
className: "Card transparent disabled small"
|
|
72877
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72878
|
+
className: "CardImage"
|
|
72879
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72880
|
+
className: "TextCenter Opacity05"
|
|
72881
|
+
}, /*#__PURE__*/react.createElement(DigitalWalletIcon, {
|
|
72882
|
+
className: "small"
|
|
72883
|
+
}))), /*#__PURE__*/react.createElement("div", {
|
|
72884
|
+
className: "CardBody"
|
|
72885
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72886
|
+
className: "CardBodyWrapper"
|
|
72887
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72888
|
+
className: "Opacity05"
|
|
72889
|
+
}, "Confirm transaction in your wallet")))));
|
|
72890
|
+
} else if (paymentState == 'confirmed') {
|
|
72891
|
+
return /*#__PURE__*/react.createElement("div", {
|
|
72892
|
+
className: "PaddingBottomS"
|
|
72893
|
+
}, /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("a", {
|
|
72894
|
+
className: "Card transparent small",
|
|
72895
|
+
title: "Payment has been confirmed by the network",
|
|
72896
|
+
href: transaction === null || transaction === void 0 ? void 0 : transaction.url,
|
|
72897
|
+
target: "_blank",
|
|
72898
|
+
rel: "noopener noreferrer"
|
|
72899
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72900
|
+
className: "CardImage"
|
|
72901
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72902
|
+
className: "TextCenter Opacity05"
|
|
72903
|
+
}, /*#__PURE__*/react.createElement(Checkmark, {
|
|
72904
|
+
className: "small"
|
|
72905
|
+
}))), /*#__PURE__*/react.createElement("div", {
|
|
72906
|
+
className: "CardBody"
|
|
72907
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72908
|
+
className: "CardBodyWrapper"
|
|
72909
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72910
|
+
className: "Opacity05"
|
|
72911
|
+
}, "Payment has been confirmed"))))), trackingInfo());
|
|
72912
|
+
}
|
|
72913
|
+
};
|
|
72089
72914
|
|
|
72090
|
-
var
|
|
72091
|
-
|
|
72915
|
+
var approvalButton = function approvalButton() {
|
|
72916
|
+
if (!payment.route.approvalRequired || payment.route.directTransfer) {
|
|
72917
|
+
return null;
|
|
72918
|
+
} else if (paymentState == 'initialized') {
|
|
72919
|
+
return /*#__PURE__*/react.createElement("div", {
|
|
72920
|
+
className: "PaddingBottomS"
|
|
72921
|
+
}, /*#__PURE__*/react.createElement("button", {
|
|
72922
|
+
className: "ButtonPrimary",
|
|
72923
|
+
onClick: approve,
|
|
72924
|
+
title: "Allow ".concat(payment.symbol, " to be used as payment")
|
|
72925
|
+
}, "Allow ", payment.symbol, " to be used as payment"));
|
|
72926
|
+
} else if (paymentState == 'approving') {
|
|
72927
|
+
return /*#__PURE__*/react.createElement("div", {
|
|
72928
|
+
className: "PaddingBottomS"
|
|
72929
|
+
}, /*#__PURE__*/react.createElement("a", {
|
|
72930
|
+
className: "ButtonPrimary",
|
|
72931
|
+
title: "Approving payment token - please wait",
|
|
72932
|
+
href: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
|
|
72933
|
+
target: "_blank",
|
|
72934
|
+
rel: "noopener noreferrer"
|
|
72935
|
+
}, /*#__PURE__*/react.createElement(LoadingText, null, "Approving")));
|
|
72936
|
+
}
|
|
72937
|
+
};
|
|
72092
72938
|
|
|
72093
72939
|
var mainAction = function mainAction() {
|
|
72094
72940
|
if (paymentState == 'initialized' || paymentState == 'approving') {
|
|
@@ -72103,10 +72949,10 @@ var DonationOverviewDialog = (function (props) {
|
|
|
72103
72949
|
navigate: navigate
|
|
72104
72950
|
});
|
|
72105
72951
|
}
|
|
72106
|
-
}, "Pay ", new Currency({
|
|
72952
|
+
}, "Pay ", amount ? new Currency({
|
|
72107
72953
|
amount: amount.toFixed(2),
|
|
72108
72954
|
code: currencyCode
|
|
72109
|
-
}).toString());
|
|
72955
|
+
}).toString() : paymentValue.toString().length ? paymentValue.toString() : "".concat(payment.amount));
|
|
72110
72956
|
} else if (paymentState == 'paying') {
|
|
72111
72957
|
return /*#__PURE__*/react.createElement("a", {
|
|
72112
72958
|
className: "ButtonPrimary",
|
|
@@ -72116,39 +72962,51 @@ var DonationOverviewDialog = (function (props) {
|
|
|
72116
72962
|
rel: "noopener noreferrer"
|
|
72117
72963
|
}, /*#__PURE__*/react.createElement(LoadingText, null, "Paying"));
|
|
72118
72964
|
} else if (paymentState == 'confirmed') {
|
|
72119
|
-
|
|
72120
|
-
|
|
72121
|
-
|
|
72122
|
-
|
|
72123
|
-
|
|
72965
|
+
if (tracking == true) {
|
|
72966
|
+
if (forward) {
|
|
72967
|
+
if (forwardTo) {
|
|
72968
|
+
return /*#__PURE__*/react.createElement("a", {
|
|
72969
|
+
className: "ButtonPrimary",
|
|
72970
|
+
href: forwardTo,
|
|
72971
|
+
rel: "noopener noreferrer"
|
|
72972
|
+
}, "Continue");
|
|
72973
|
+
} else {
|
|
72974
|
+
return /*#__PURE__*/react.createElement("button", {
|
|
72975
|
+
className: "ButtonPrimary",
|
|
72976
|
+
onClick: close
|
|
72977
|
+
}, "Continue");
|
|
72978
|
+
}
|
|
72979
|
+
} else {
|
|
72980
|
+
return /*#__PURE__*/react.createElement("button", {
|
|
72981
|
+
className: "ButtonPrimary disabled",
|
|
72982
|
+
onClick: function onClick() {}
|
|
72983
|
+
}, "Continue");
|
|
72984
|
+
}
|
|
72985
|
+
} else {
|
|
72986
|
+
return /*#__PURE__*/react.createElement("button", {
|
|
72987
|
+
className: "ButtonPrimary",
|
|
72988
|
+
onClick: close
|
|
72989
|
+
}, "Close");
|
|
72990
|
+
}
|
|
72124
72991
|
}
|
|
72125
72992
|
};
|
|
72126
72993
|
|
|
72127
|
-
|
|
72128
|
-
|
|
72129
|
-
return /*#__PURE__*/react.createElement("div", {
|
|
72130
|
-
className: "PaddingBottomS"
|
|
72131
|
-
}, /*#__PURE__*/react.createElement("button", {
|
|
72132
|
-
className: "ButtonPrimary wide",
|
|
72133
|
-
onClick: approve,
|
|
72134
|
-
title: "Allow ".concat(payment.symbol, " to be used as payment")
|
|
72135
|
-
}, "Allow ", payment.symbol, " to be used as payment"));
|
|
72136
|
-
} else if (paymentState == 'approving') {
|
|
72137
|
-
return /*#__PURE__*/react.createElement("div", {
|
|
72138
|
-
className: "PaddingBottomS"
|
|
72139
|
-
}, /*#__PURE__*/react.createElement("a", {
|
|
72140
|
-
className: "ButtonPrimary wide",
|
|
72141
|
-
title: "Approving payment token - please wait",
|
|
72142
|
-
href: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
|
|
72143
|
-
target: "_blank",
|
|
72144
|
-
rel: "noopener noreferrer"
|
|
72145
|
-
}, /*#__PURE__*/react.createElement(LoadingText, null, "Approving")));
|
|
72146
|
-
}
|
|
72147
|
-
};
|
|
72994
|
+
return /*#__PURE__*/react.createElement("div", null, approvalButton(), additionalPaymentInformation(), mainAction());
|
|
72995
|
+
});
|
|
72148
72996
|
|
|
72149
|
-
|
|
72150
|
-
|
|
72151
|
-
|
|
72997
|
+
var DonationOverviewDialog = (function (props) {
|
|
72998
|
+
var _useContext = react.useContext(ConfigurationContext),
|
|
72999
|
+
currencyCode = _useContext.currencyCode;
|
|
73000
|
+
|
|
73001
|
+
var _useContext2 = react.useContext(ChangableAmountContext),
|
|
73002
|
+
amount = _useContext2.amount;
|
|
73003
|
+
|
|
73004
|
+
var _useContext3 = react.useContext(PaymentContext),
|
|
73005
|
+
payment = _useContext3.payment,
|
|
73006
|
+
paymentState = _useContext3.paymentState;
|
|
73007
|
+
|
|
73008
|
+
var _useContext4 = react.useContext(NavigateStackContext_1),
|
|
73009
|
+
navigate = _useContext4.navigate;
|
|
72152
73010
|
|
|
72153
73011
|
if (payment == undefined) {
|
|
72154
73012
|
return /*#__PURE__*/react.createElement(DonationOverviewSkeleton, null);
|
|
@@ -72156,9 +73014,9 @@ var DonationOverviewDialog = (function (props) {
|
|
|
72156
73014
|
|
|
72157
73015
|
return /*#__PURE__*/react.createElement(Dialog, {
|
|
72158
73016
|
header: /*#__PURE__*/react.createElement("div", {
|
|
72159
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
73017
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
72160
73018
|
}, /*#__PURE__*/react.createElement("h1", {
|
|
72161
|
-
className: "LineHeightL FontSizeL
|
|
73019
|
+
className: "LineHeightL FontSizeL"
|
|
72162
73020
|
}, "Donation")),
|
|
72163
73021
|
body: /*#__PURE__*/react.createElement("div", {
|
|
72164
73022
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -72221,8 +73079,8 @@ var DonationOverviewDialog = (function (props) {
|
|
|
72221
73079
|
className: "CardAction"
|
|
72222
73080
|
}, /*#__PURE__*/react.createElement(ChevronRight, null)))),
|
|
72223
73081
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
72224
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
72225
|
-
},
|
|
73082
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
73083
|
+
}, /*#__PURE__*/react.createElement(Footer, null))
|
|
72226
73084
|
});
|
|
72227
73085
|
});
|
|
72228
73086
|
|
|
@@ -72259,9 +73117,9 @@ var PaymentErrorDialog = (function () {
|
|
|
72259
73117
|
rel: "noopener noreferrer"
|
|
72260
73118
|
}, "View on explorer")))),
|
|
72261
73119
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
72262
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
73120
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
72263
73121
|
}, /*#__PURE__*/react.createElement("button", {
|
|
72264
|
-
className: "ButtonPrimary
|
|
73122
|
+
className: "ButtonPrimary",
|
|
72265
73123
|
onClick: function onClick() {
|
|
72266
73124
|
return navigate('back');
|
|
72267
73125
|
}
|
|
@@ -72282,9 +73140,9 @@ var WrongNetworkDialog = (function (props) {
|
|
|
72282
73140
|
return /*#__PURE__*/react.createElement(Dialog, {
|
|
72283
73141
|
stacked: true,
|
|
72284
73142
|
header: /*#__PURE__*/react.createElement("div", {
|
|
72285
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
73143
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
72286
73144
|
}, /*#__PURE__*/react.createElement("h1", {
|
|
72287
|
-
className: "LineHeightL FontSizeL
|
|
73145
|
+
className: "LineHeightL FontSizeL"
|
|
72288
73146
|
}, "Wrong Network")),
|
|
72289
73147
|
body: /*#__PURE__*/react.createElement("div", {
|
|
72290
73148
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -72301,7 +73159,7 @@ var WrongNetworkDialog = (function (props) {
|
|
|
72301
73159
|
className: "FontSizeM"
|
|
72302
73160
|
}, "Please make sure you connect your wallet to the correct network before you try again!"))),
|
|
72303
73161
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
72304
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
73162
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
72305
73163
|
}, /*#__PURE__*/react.createElement("button", {
|
|
72306
73164
|
className: "ButtonPrimary",
|
|
72307
73165
|
onClick: function onClick() {
|
|
@@ -72332,16 +73190,122 @@ var DonationStack = (function (props) {
|
|
|
72332
73190
|
});
|
|
72333
73191
|
});
|
|
72334
73192
|
|
|
72335
|
-
var
|
|
72336
|
-
var
|
|
73193
|
+
var TrackingProvider = (function (props) {
|
|
73194
|
+
var _useContext = react.useContext(ConfigurationContext),
|
|
73195
|
+
track = _useContext.track;
|
|
73196
|
+
|
|
73197
|
+
var _useState = react.useState(track && !!track.endpoint),
|
|
72337
73198
|
_useState2 = _slicedToArray(_useState, 2),
|
|
72338
|
-
|
|
72339
|
-
|
|
73199
|
+
tracking = _useState2[0],
|
|
73200
|
+
setTracking = _useState2[1];
|
|
73201
|
+
|
|
73202
|
+
var _useState3 = react.useState(false),
|
|
73203
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
73204
|
+
forward = _useState4[0],
|
|
73205
|
+
setForward = _useState4[1];
|
|
73206
|
+
|
|
73207
|
+
var _useState5 = react.useState(),
|
|
73208
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
73209
|
+
forwardTo = _useState6[0],
|
|
73210
|
+
setForwardTo = _useState6[1];
|
|
73211
|
+
|
|
73212
|
+
var _useContext2 = react.useContext(ClosableContext),
|
|
73213
|
+
setClosable = _useContext2.setClosable;
|
|
73214
|
+
|
|
73215
|
+
react.useEffect(function () {
|
|
73216
|
+
setTracking(track && !!track.endpoint);
|
|
73217
|
+
}, [track]);
|
|
73218
|
+
|
|
73219
|
+
var openSocket = function openSocket(transaction) {
|
|
73220
|
+
var socket = new WebSocket('wss://integrate.depay.fi/cable');
|
|
73221
|
+
|
|
73222
|
+
socket.onopen = function (event) {
|
|
73223
|
+
var msg = {
|
|
73224
|
+
command: 'subscribe',
|
|
73225
|
+
identifier: JSON.stringify({
|
|
73226
|
+
blockchain: transaction.blockchain,
|
|
73227
|
+
sender: transaction.from.toLowerCase(),
|
|
73228
|
+
nonce: transaction.nonce,
|
|
73229
|
+
channel: 'PaymentChannel'
|
|
73230
|
+
})
|
|
73231
|
+
};
|
|
73232
|
+
socket.send(JSON.stringify(msg));
|
|
73233
|
+
};
|
|
73234
|
+
|
|
73235
|
+
socket.onclose = function (event) {};
|
|
73236
|
+
|
|
73237
|
+
socket.onmessage = function (event) {
|
|
73238
|
+
var item = JSON.parse(event.data);
|
|
73239
|
+
|
|
73240
|
+
if (item.type === "ping") {
|
|
73241
|
+
return;
|
|
73242
|
+
}
|
|
73243
|
+
|
|
73244
|
+
if (item.message && item.message.forward) {
|
|
73245
|
+
setClosable(!item.message.forward_to);
|
|
73246
|
+
setForwardTo(item.message.forward_to);
|
|
73247
|
+
setForward(item.message.forward);
|
|
73248
|
+
socket.close();
|
|
73249
|
+
|
|
73250
|
+
if (!!item.message.forward_to) {
|
|
73251
|
+
setTimeout(function () {
|
|
73252
|
+
props.document.location.href = item.message.forward_to;
|
|
73253
|
+
}, 500);
|
|
73254
|
+
}
|
|
73255
|
+
}
|
|
73256
|
+
};
|
|
72340
73257
|
|
|
72341
|
-
|
|
73258
|
+
socket.onerror = function (error) {
|
|
73259
|
+
console.log('WebSocket Error: ' + error);
|
|
73260
|
+
};
|
|
73261
|
+
};
|
|
73262
|
+
|
|
73263
|
+
var retryStartTracking = function retryStartTracking(transaction, afterBlock, attempt) {
|
|
73264
|
+
attempt = parseInt(attempt || 1, 10);
|
|
73265
|
+
console.log('RETRY TRACKING ATTEMPT ', attempt);
|
|
73266
|
+
|
|
73267
|
+
if (attempt < 3) {
|
|
73268
|
+
setTimeout(function () {
|
|
73269
|
+
startTracking(transaction, afterBlock, attempt + 1);
|
|
73270
|
+
}, 3000);
|
|
73271
|
+
} else {
|
|
73272
|
+
console.log('TRACKING FAILED AFTER 3 ATTEMPTS!');
|
|
73273
|
+
}
|
|
73274
|
+
};
|
|
73275
|
+
|
|
73276
|
+
var startTracking = function startTracking(transaction, afterBlock, attempt) {
|
|
73277
|
+
fetch(track.endpoint, {
|
|
73278
|
+
method: 'POST',
|
|
73279
|
+
body: JSON.stringify({
|
|
73280
|
+
blockchain: transaction.blockchain,
|
|
73281
|
+
transaction: transaction.id.toLowerCase(),
|
|
73282
|
+
sender: transaction.from.toLowerCase(),
|
|
73283
|
+
nonce: transaction.nonce,
|
|
73284
|
+
after_block: afterBlock
|
|
73285
|
+
})
|
|
73286
|
+
}).then(function (response) {
|
|
73287
|
+
if (response.status == 200) {
|
|
73288
|
+
console.log('TRACKING INITIALIZED');
|
|
73289
|
+
} else {
|
|
73290
|
+
retryStartTracking(transaction, afterBlock, attempt);
|
|
73291
|
+
}
|
|
73292
|
+
})["catch"](function (error) {
|
|
73293
|
+
console.log('TRACKING FAILED', error);
|
|
73294
|
+
retryStartTracking(transaction, afterBlock, attempt);
|
|
73295
|
+
});
|
|
73296
|
+
};
|
|
73297
|
+
|
|
73298
|
+
var initializeTracking = function initializeTracking(transaction, afterBlock) {
|
|
73299
|
+
openSocket(transaction);
|
|
73300
|
+
startTracking(transaction, afterBlock);
|
|
73301
|
+
};
|
|
73302
|
+
|
|
73303
|
+
return /*#__PURE__*/react.createElement(TrackingContext.Provider, {
|
|
72342
73304
|
value: {
|
|
72343
|
-
|
|
72344
|
-
|
|
73305
|
+
tracking: tracking,
|
|
73306
|
+
initializeTracking: initializeTracking,
|
|
73307
|
+
forward: forward,
|
|
73308
|
+
forwardTo: forwardTo
|
|
72345
73309
|
}
|
|
72346
73310
|
}, props.children);
|
|
72347
73311
|
});
|
|
@@ -72444,12 +73408,12 @@ var preflight$2 = /*#__PURE__*/function () {
|
|
|
72444
73408
|
|
|
72445
73409
|
var Donation = /*#__PURE__*/function () {
|
|
72446
73410
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(_ref3) {
|
|
72447
|
-
var amount, accept, event, sent, confirmed,
|
|
73411
|
+
var amount, accept, event, sent, confirmed, failed, error, critical, style, blacklist, providers, currency, connected, closed, document, unmount;
|
|
72448
73412
|
return regenerator.wrap(function _callee2$(_context2) {
|
|
72449
73413
|
while (1) {
|
|
72450
73414
|
switch (_context2.prev = _context2.next) {
|
|
72451
73415
|
case 0:
|
|
72452
|
-
amount = _ref3.amount, accept = _ref3.accept, event = _ref3.event, sent = _ref3.sent, confirmed = _ref3.confirmed,
|
|
73416
|
+
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;
|
|
72453
73417
|
_context2.prev = 1;
|
|
72454
73418
|
_context2.next = 4;
|
|
72455
73419
|
return preflight$2({
|
|
@@ -72475,26 +73439,27 @@ var Donation = /*#__PURE__*/function () {
|
|
|
72475
73439
|
event: event,
|
|
72476
73440
|
sent: sent,
|
|
72477
73441
|
confirmed: confirmed,
|
|
72478
|
-
ensured: ensured,
|
|
72479
73442
|
failed: failed,
|
|
72480
73443
|
blacklist: blacklist,
|
|
72481
73444
|
providers: providers
|
|
72482
73445
|
}
|
|
72483
|
-
}, /*#__PURE__*/react.createElement(ClosableProvider, {
|
|
73446
|
+
}, /*#__PURE__*/react.createElement(UpdatableProvider, null, /*#__PURE__*/react.createElement(ClosableProvider, {
|
|
72484
73447
|
unmount: unmount
|
|
72485
|
-
}, /*#__PURE__*/react.createElement(
|
|
73448
|
+
}, /*#__PURE__*/react.createElement(WalletProvider, {
|
|
72486
73449
|
container: container,
|
|
72487
73450
|
connected: connected,
|
|
72488
73451
|
unmount: unmount
|
|
72489
73452
|
}, /*#__PURE__*/react.createElement(ConversionRateProvider, null, /*#__PURE__*/react.createElement(ChangableAmountProvider, {
|
|
72490
73453
|
accept: accept
|
|
73454
|
+
}, /*#__PURE__*/react.createElement(TrackingProvider, {
|
|
73455
|
+
document: ensureDocument(document)
|
|
72491
73456
|
}, /*#__PURE__*/react.createElement(DonationRoutingProvider, {
|
|
72492
73457
|
container: container,
|
|
72493
73458
|
document: document
|
|
72494
73459
|
}, /*#__PURE__*/react.createElement(DonationStack, {
|
|
72495
73460
|
document: document,
|
|
72496
73461
|
container: container
|
|
72497
|
-
})))))))));
|
|
73462
|
+
}), /*#__PURE__*/react.createElement(PoweredBy, null))))))))));
|
|
72498
73463
|
};
|
|
72499
73464
|
});
|
|
72500
73465
|
return _context2.abrupt("return", {
|
|
@@ -72562,9 +73527,9 @@ var PaymentOverviewSkeleton = (function (props) {
|
|
|
72562
73527
|
|
|
72563
73528
|
return /*#__PURE__*/react.createElement(Dialog, {
|
|
72564
73529
|
header: /*#__PURE__*/react.createElement("div", {
|
|
72565
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
73530
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
72566
73531
|
}, /*#__PURE__*/react.createElement("h1", {
|
|
72567
|
-
className: "LineHeightL FontSizeL
|
|
73532
|
+
className: "LineHeightL FontSizeL"
|
|
72568
73533
|
}, "Payment")),
|
|
72569
73534
|
body: /*#__PURE__*/react.createElement("div", {
|
|
72570
73535
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -72578,7 +73543,7 @@ var PaymentOverviewSkeleton = (function (props) {
|
|
|
72578
73543
|
className: "SkeletonBackground"
|
|
72579
73544
|
}))),
|
|
72580
73545
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
72581
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
73546
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
72582
73547
|
}, /*#__PURE__*/react.createElement("div", {
|
|
72583
73548
|
className: "SkeletonWrapper"
|
|
72584
73549
|
}, /*#__PURE__*/react.createElement("div", {
|
|
@@ -72593,17 +73558,13 @@ var PaymentOverviewDialog = (function (props) {
|
|
|
72593
73558
|
var _useContext = react.useContext(ConfigurationContext),
|
|
72594
73559
|
currencyCode = _useContext.currencyCode;
|
|
72595
73560
|
|
|
72596
|
-
var _useContext2 = react.useContext(
|
|
72597
|
-
|
|
72598
|
-
|
|
73561
|
+
var _useContext2 = react.useContext(PaymentContext),
|
|
73562
|
+
payment = _useContext2.payment,
|
|
73563
|
+
paymentState = _useContext2.paymentState;
|
|
72599
73564
|
|
|
72600
|
-
var _useContext3 = react.useContext(
|
|
72601
|
-
|
|
72602
|
-
|
|
72603
|
-
pay = _useContext3.pay,
|
|
72604
|
-
transaction = _useContext3.transaction,
|
|
72605
|
-
approve = _useContext3.approve,
|
|
72606
|
-
approvalTransaction = _useContext3.approvalTransaction;
|
|
73565
|
+
var _useContext3 = react.useContext(ChangableAmountContext),
|
|
73566
|
+
amount = _useContext3.amount,
|
|
73567
|
+
amountsMissing = _useContext3.amountsMissing;
|
|
72607
73568
|
|
|
72608
73569
|
var _useContext4 = react.useContext(PaymentValueContext),
|
|
72609
73570
|
paymentValue = _useContext4.paymentValue;
|
|
@@ -72611,78 +73572,15 @@ var PaymentOverviewDialog = (function (props) {
|
|
|
72611
73572
|
var _useContext5 = react.useContext(NavigateStackContext_1),
|
|
72612
73573
|
navigate = _useContext5.navigate;
|
|
72613
73574
|
|
|
72614
|
-
var _useContext6 = react.useContext(ClosableContext),
|
|
72615
|
-
close = _useContext6.close;
|
|
72616
|
-
|
|
72617
|
-
var mainAction = function mainAction() {
|
|
72618
|
-
if (paymentState == 'initialized' || paymentState == 'approving') {
|
|
72619
|
-
return /*#__PURE__*/react.createElement("button", {
|
|
72620
|
-
className: ["ButtonPrimary", payment.route.approvalRequired && !payment.route.directTransfer ? 'disabled' : ''].join(' '),
|
|
72621
|
-
onClick: function onClick() {
|
|
72622
|
-
if (payment.route.approvalRequired && !payment.route.directTransfer) {
|
|
72623
|
-
return;
|
|
72624
|
-
}
|
|
72625
|
-
|
|
72626
|
-
pay({
|
|
72627
|
-
navigate: navigate
|
|
72628
|
-
});
|
|
72629
|
-
}
|
|
72630
|
-
}, "Pay ", amount ? new Currency({
|
|
72631
|
-
amount: amount.toFixed(2),
|
|
72632
|
-
code: currencyCode
|
|
72633
|
-
}).toString() : paymentValue.toString().length ? paymentValue.toString() : "".concat(payment.amount));
|
|
72634
|
-
} else if (paymentState == 'paying') {
|
|
72635
|
-
return /*#__PURE__*/react.createElement("a", {
|
|
72636
|
-
className: "ButtonPrimary",
|
|
72637
|
-
title: "Performing the payment - please wait",
|
|
72638
|
-
href: transaction === null || transaction === void 0 ? void 0 : transaction.url,
|
|
72639
|
-
target: "_blank",
|
|
72640
|
-
rel: "noopener noreferrer"
|
|
72641
|
-
}, /*#__PURE__*/react.createElement(LoadingText, null, "Paying"));
|
|
72642
|
-
} else if (paymentState == 'confirmed') {
|
|
72643
|
-
return /*#__PURE__*/react.createElement("button", {
|
|
72644
|
-
className: "ButtonPrimary round",
|
|
72645
|
-
title: "Done",
|
|
72646
|
-
onClick: close
|
|
72647
|
-
}, /*#__PURE__*/react.createElement(Checkmark, null));
|
|
72648
|
-
}
|
|
72649
|
-
};
|
|
72650
|
-
|
|
72651
|
-
var approvalAction = function approvalAction() {
|
|
72652
|
-
if (paymentState == 'initialized') {
|
|
72653
|
-
return /*#__PURE__*/react.createElement("div", {
|
|
72654
|
-
className: "PaddingBottomS"
|
|
72655
|
-
}, /*#__PURE__*/react.createElement("button", {
|
|
72656
|
-
className: "ButtonPrimary wide",
|
|
72657
|
-
onClick: approve,
|
|
72658
|
-
title: "Allow ".concat(payment.symbol, " to be used as payment")
|
|
72659
|
-
}, "Allow ", payment.symbol, " to be used as payment"));
|
|
72660
|
-
} else if (paymentState == 'approving') {
|
|
72661
|
-
return /*#__PURE__*/react.createElement("div", {
|
|
72662
|
-
className: "PaddingBottomS"
|
|
72663
|
-
}, /*#__PURE__*/react.createElement("a", {
|
|
72664
|
-
className: "ButtonPrimary wide",
|
|
72665
|
-
title: "Approving payment token - please wait",
|
|
72666
|
-
href: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
|
|
72667
|
-
target: "_blank",
|
|
72668
|
-
rel: "noopener noreferrer"
|
|
72669
|
-
}, /*#__PURE__*/react.createElement(LoadingText, null, "Approving")));
|
|
72670
|
-
}
|
|
72671
|
-
};
|
|
72672
|
-
|
|
72673
|
-
var actions = function actions() {
|
|
72674
|
-
return /*#__PURE__*/react.createElement("div", null, payment.route.approvalRequired && !payment.route.directTransfer && approvalAction(), mainAction());
|
|
72675
|
-
};
|
|
72676
|
-
|
|
72677
73575
|
if (payment == undefined || paymentValue == undefined) {
|
|
72678
73576
|
return /*#__PURE__*/react.createElement(PaymentOverviewSkeleton, null);
|
|
72679
73577
|
}
|
|
72680
73578
|
|
|
72681
73579
|
return /*#__PURE__*/react.createElement(Dialog, {
|
|
72682
73580
|
header: /*#__PURE__*/react.createElement("div", {
|
|
72683
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
73581
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
72684
73582
|
}, /*#__PURE__*/react.createElement("h1", {
|
|
72685
|
-
className: "LineHeightL FontSizeL
|
|
73583
|
+
className: "LineHeightL FontSizeL"
|
|
72686
73584
|
}, "Payment")),
|
|
72687
73585
|
body: /*#__PURE__*/react.createElement("div", {
|
|
72688
73586
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -72745,8 +73643,8 @@ var PaymentOverviewDialog = (function (props) {
|
|
|
72745
73643
|
className: "CardAction"
|
|
72746
73644
|
}, /*#__PURE__*/react.createElement(ChevronRight, null)))),
|
|
72747
73645
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
72748
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
72749
|
-
},
|
|
73646
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
73647
|
+
}, /*#__PURE__*/react.createElement(Footer, null))
|
|
72750
73648
|
});
|
|
72751
73649
|
});
|
|
72752
73650
|
|
|
@@ -72812,12 +73710,12 @@ var preflight$1 = /*#__PURE__*/function () {
|
|
|
72812
73710
|
|
|
72813
73711
|
var Payment = /*#__PURE__*/function () {
|
|
72814
73712
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(_ref3) {
|
|
72815
|
-
var accept, amount, event, sent, confirmed,
|
|
73713
|
+
var accept, amount, event, sent, confirmed, failed, error, critical, style, whitelist, blacklist, providers, currency, connected, closed, track, document, unmount;
|
|
72816
73714
|
return regenerator.wrap(function _callee2$(_context2) {
|
|
72817
73715
|
while (1) {
|
|
72818
73716
|
switch (_context2.prev = _context2.next) {
|
|
72819
73717
|
case 0:
|
|
72820
|
-
accept = _ref3.accept, amount = _ref3.amount, event = _ref3.event, sent = _ref3.sent, confirmed = _ref3.confirmed,
|
|
73718
|
+
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;
|
|
72821
73719
|
_context2.prev = 1;
|
|
72822
73720
|
_context2.next = 4;
|
|
72823
73721
|
return preflight$1({
|
|
@@ -72843,15 +73741,15 @@ var Payment = /*#__PURE__*/function () {
|
|
|
72843
73741
|
event: event,
|
|
72844
73742
|
sent: sent,
|
|
72845
73743
|
confirmed: confirmed,
|
|
72846
|
-
ensured: ensured,
|
|
72847
73744
|
failed: failed,
|
|
72848
73745
|
whitelist: whitelist,
|
|
72849
73746
|
blacklist: blacklist,
|
|
72850
|
-
providers: providers
|
|
73747
|
+
providers: providers,
|
|
73748
|
+
track: track
|
|
72851
73749
|
}
|
|
72852
|
-
}, /*#__PURE__*/react.createElement(ClosableProvider, {
|
|
73750
|
+
}, /*#__PURE__*/react.createElement(UpdatableProvider, null, /*#__PURE__*/react.createElement(ClosableProvider, {
|
|
72853
73751
|
unmount: unmount
|
|
72854
|
-
}, /*#__PURE__*/react.createElement(
|
|
73752
|
+
}, /*#__PURE__*/react.createElement(WalletProvider, {
|
|
72855
73753
|
document: document,
|
|
72856
73754
|
container: container,
|
|
72857
73755
|
connected: connected,
|
|
@@ -72863,13 +73761,15 @@ var Payment = /*#__PURE__*/function () {
|
|
|
72863
73761
|
whitelist: whitelist,
|
|
72864
73762
|
blacklist: blacklist,
|
|
72865
73763
|
event: event
|
|
73764
|
+
}, /*#__PURE__*/react.createElement(TrackingProvider, {
|
|
73765
|
+
document: ensureDocument(document)
|
|
72866
73766
|
}, /*#__PURE__*/react.createElement(PaymentProvider, {
|
|
72867
73767
|
container: container,
|
|
72868
73768
|
document: document
|
|
72869
73769
|
}, /*#__PURE__*/react.createElement(PaymentValueProvider, null, /*#__PURE__*/react.createElement(PaymentStack, {
|
|
72870
73770
|
document: document,
|
|
72871
73771
|
container: container
|
|
72872
|
-
})))))))))));
|
|
73772
|
+
}), /*#__PURE__*/react.createElement(PoweredBy, null))))))))))));
|
|
72873
73773
|
};
|
|
72874
73774
|
});
|
|
72875
73775
|
return _context2.abrupt("return", {
|
|
@@ -72979,9 +73879,9 @@ var SaleRoutingProvider = (function (props) {
|
|
|
72979
73879
|
var SaleOverviewSkeleton = (function (props) {
|
|
72980
73880
|
return /*#__PURE__*/react.createElement(Dialog, {
|
|
72981
73881
|
header: /*#__PURE__*/react.createElement("div", {
|
|
72982
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
73882
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
72983
73883
|
}, /*#__PURE__*/react.createElement("h1", {
|
|
72984
|
-
className: "LineHeightL FontSizeL
|
|
73884
|
+
className: "LineHeightL FontSizeL"
|
|
72985
73885
|
}, "Purchase")),
|
|
72986
73886
|
body: /*#__PURE__*/react.createElement("div", {
|
|
72987
73887
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -72998,7 +73898,7 @@ var SaleOverviewSkeleton = (function (props) {
|
|
|
72998
73898
|
className: "SkeletonBackground"
|
|
72999
73899
|
}))),
|
|
73000
73900
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
73001
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
73901
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
73002
73902
|
}, /*#__PURE__*/react.createElement("div", {
|
|
73003
73903
|
className: "SkeletonWrapper"
|
|
73004
73904
|
}, /*#__PURE__*/react.createElement("div", {
|
|
@@ -73010,11 +73910,10 @@ var SaleOverviewSkeleton = (function (props) {
|
|
|
73010
73910
|
});
|
|
73011
73911
|
|
|
73012
73912
|
var SaleOverviewDialog = (function (props) {
|
|
73013
|
-
var _useContext = react.useContext(ChangableAmountContext)
|
|
73014
|
-
|
|
73913
|
+
var _useContext = react.useContext(ChangableAmountContext);
|
|
73914
|
+
_useContext.amount;
|
|
73015
73915
|
|
|
73016
73916
|
var _useContext2 = react.useContext(ConfigurationContext),
|
|
73017
|
-
currencyCode = _useContext2.currencyCode,
|
|
73018
73917
|
tokenImage = _useContext2.tokenImage;
|
|
73019
73918
|
|
|
73020
73919
|
var _useContext3 = react.useContext(PaymentValueContext),
|
|
@@ -73022,87 +73921,20 @@ var SaleOverviewDialog = (function (props) {
|
|
|
73022
73921
|
|
|
73023
73922
|
var _useContext4 = react.useContext(PaymentContext),
|
|
73024
73923
|
payment = _useContext4.payment,
|
|
73025
|
-
paymentState = _useContext4.paymentState
|
|
73026
|
-
pay = _useContext4.pay,
|
|
73027
|
-
transaction = _useContext4.transaction,
|
|
73028
|
-
approve = _useContext4.approve,
|
|
73029
|
-
approvalTransaction = _useContext4.approvalTransaction;
|
|
73924
|
+
paymentState = _useContext4.paymentState;
|
|
73030
73925
|
|
|
73031
73926
|
var _useContext5 = react.useContext(NavigateStackContext_1),
|
|
73032
73927
|
navigate = _useContext5.navigate;
|
|
73033
73928
|
|
|
73034
|
-
var _useContext6 = react.useContext(
|
|
73035
|
-
|
|
73036
|
-
|
|
73037
|
-
var _useContext7 = react.useContext(ToTokenContext),
|
|
73038
|
-
toToken = _useContext7.toToken,
|
|
73039
|
-
toTokenReadableAmount = _useContext7.toTokenReadableAmount;
|
|
73929
|
+
var _useContext6 = react.useContext(ToTokenContext),
|
|
73930
|
+
toToken = _useContext6.toToken,
|
|
73931
|
+
toTokenReadableAmount = _useContext6.toTokenReadableAmount;
|
|
73040
73932
|
|
|
73041
73933
|
var _useState = react.useState(),
|
|
73042
73934
|
_useState2 = _slicedToArray(_useState, 2),
|
|
73043
73935
|
salePerTokenValue = _useState2[0],
|
|
73044
73936
|
setSalePerTokenValue = _useState2[1];
|
|
73045
73937
|
|
|
73046
|
-
var mainAction = function mainAction() {
|
|
73047
|
-
if (paymentState == 'initialized' || paymentState == 'approving') {
|
|
73048
|
-
return /*#__PURE__*/react.createElement("button", {
|
|
73049
|
-
className: ["ButtonPrimary", payment.route.approvalRequired && !payment.route.directTransfer ? 'disabled' : ''].join(' '),
|
|
73050
|
-
onClick: function onClick() {
|
|
73051
|
-
if (payment.route.approvalRequired && !payment.route.directTransfer) {
|
|
73052
|
-
return;
|
|
73053
|
-
}
|
|
73054
|
-
|
|
73055
|
-
pay({
|
|
73056
|
-
navigate: navigate
|
|
73057
|
-
});
|
|
73058
|
-
}
|
|
73059
|
-
}, "Pay ", new Currency({
|
|
73060
|
-
amount: amount.toFixed(2),
|
|
73061
|
-
code: currencyCode
|
|
73062
|
-
}).toString());
|
|
73063
|
-
} else if (paymentState == 'paying') {
|
|
73064
|
-
return /*#__PURE__*/react.createElement("a", {
|
|
73065
|
-
className: "ButtonPrimary",
|
|
73066
|
-
title: "Performing the payment - please wait",
|
|
73067
|
-
href: transaction === null || transaction === void 0 ? void 0 : transaction.url,
|
|
73068
|
-
target: "_blank",
|
|
73069
|
-
rel: "noopener noreferrer"
|
|
73070
|
-
}, /*#__PURE__*/react.createElement(LoadingText, null, "Paying"));
|
|
73071
|
-
} else if (paymentState == 'confirmed') {
|
|
73072
|
-
return /*#__PURE__*/react.createElement("button", {
|
|
73073
|
-
className: "ButtonPrimary round",
|
|
73074
|
-
title: "Done",
|
|
73075
|
-
onClick: close
|
|
73076
|
-
}, /*#__PURE__*/react.createElement(Checkmark, null));
|
|
73077
|
-
}
|
|
73078
|
-
};
|
|
73079
|
-
|
|
73080
|
-
var approvalAction = function approvalAction() {
|
|
73081
|
-
if (paymentState == 'initialized') {
|
|
73082
|
-
return /*#__PURE__*/react.createElement("div", {
|
|
73083
|
-
className: "PaddingBottomS"
|
|
73084
|
-
}, /*#__PURE__*/react.createElement("button", {
|
|
73085
|
-
className: "ButtonPrimary wide",
|
|
73086
|
-
onClick: approve,
|
|
73087
|
-
title: "Allow ".concat(payment.symbol, " to be used as payment")
|
|
73088
|
-
}, "Allow ", payment.symbol, " to be used as payment"));
|
|
73089
|
-
} else if (paymentState == 'approving') {
|
|
73090
|
-
return /*#__PURE__*/react.createElement("div", {
|
|
73091
|
-
className: "PaddingBottomS"
|
|
73092
|
-
}, /*#__PURE__*/react.createElement("a", {
|
|
73093
|
-
className: "ButtonPrimary wide",
|
|
73094
|
-
title: "Approving payment token - please wait",
|
|
73095
|
-
href: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
|
|
73096
|
-
target: "_blank",
|
|
73097
|
-
rel: "noopener noreferrer"
|
|
73098
|
-
}, /*#__PURE__*/react.createElement(LoadingText, null, "Approving")));
|
|
73099
|
-
}
|
|
73100
|
-
};
|
|
73101
|
-
|
|
73102
|
-
var actions = function actions() {
|
|
73103
|
-
return /*#__PURE__*/react.createElement("div", null, payment.route.approvalRequired && !payment.route.directTransfer && approvalAction(), mainAction());
|
|
73104
|
-
};
|
|
73105
|
-
|
|
73106
73938
|
react.useEffect(function () {
|
|
73107
73939
|
if (paymentValue) {
|
|
73108
73940
|
setSalePerTokenValue(new Currency({
|
|
@@ -73131,9 +73963,9 @@ var SaleOverviewDialog = (function (props) {
|
|
|
73131
73963
|
|
|
73132
73964
|
return /*#__PURE__*/react.createElement(Dialog, {
|
|
73133
73965
|
header: /*#__PURE__*/react.createElement("div", {
|
|
73134
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
73966
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
73135
73967
|
}, /*#__PURE__*/react.createElement("h1", {
|
|
73136
|
-
className: "LineHeightL FontSizeL
|
|
73968
|
+
className: "LineHeightL FontSizeL"
|
|
73137
73969
|
}, "Purchase")),
|
|
73138
73970
|
body: /*#__PURE__*/react.createElement("div", {
|
|
73139
73971
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -73202,8 +74034,8 @@ var SaleOverviewDialog = (function (props) {
|
|
|
73202
74034
|
className: "CardAction"
|
|
73203
74035
|
}, /*#__PURE__*/react.createElement(ChevronRight, null)))),
|
|
73204
74036
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
73205
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
73206
|
-
},
|
|
74037
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
74038
|
+
}, /*#__PURE__*/react.createElement(Footer, null))
|
|
73207
74039
|
});
|
|
73208
74040
|
});
|
|
73209
74041
|
|
|
@@ -73276,12 +74108,12 @@ var preflight = /*#__PURE__*/function () {
|
|
|
73276
74108
|
|
|
73277
74109
|
var Sale = /*#__PURE__*/function () {
|
|
73278
74110
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(_ref3) {
|
|
73279
|
-
var amount, sell, sent, confirmed,
|
|
74111
|
+
var amount, sell, sent, confirmed, failed, error, critical, style, blacklist, providers, currency, connected, closed, tokenImage, document, accept, unmount;
|
|
73280
74112
|
return regenerator.wrap(function _callee2$(_context2) {
|
|
73281
74113
|
while (1) {
|
|
73282
74114
|
switch (_context2.prev = _context2.next) {
|
|
73283
74115
|
case 0:
|
|
73284
|
-
amount = _ref3.amount, sell = _ref3.sell, sent = _ref3.sent, confirmed = _ref3.confirmed,
|
|
74116
|
+
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;
|
|
73285
74117
|
_context2.prev = 1;
|
|
73286
74118
|
_context2.next = 4;
|
|
73287
74119
|
return preflight({
|
|
@@ -73313,26 +74145,27 @@ var Sale = /*#__PURE__*/function () {
|
|
|
73313
74145
|
currency: currency,
|
|
73314
74146
|
sent: sent,
|
|
73315
74147
|
confirmed: confirmed,
|
|
73316
|
-
ensured: ensured,
|
|
73317
74148
|
failed: failed,
|
|
73318
74149
|
blacklist: blacklist,
|
|
73319
74150
|
providers: providers
|
|
73320
74151
|
}
|
|
73321
|
-
}, /*#__PURE__*/react.createElement(ClosableProvider, {
|
|
74152
|
+
}, /*#__PURE__*/react.createElement(UpdatableProvider, null, /*#__PURE__*/react.createElement(ClosableProvider, {
|
|
73322
74153
|
unmount: unmount
|
|
73323
|
-
}, /*#__PURE__*/react.createElement(
|
|
74154
|
+
}, /*#__PURE__*/react.createElement(WalletProvider, {
|
|
73324
74155
|
container: container,
|
|
73325
74156
|
connected: connected,
|
|
73326
74157
|
unmount: unmount
|
|
73327
74158
|
}, /*#__PURE__*/react.createElement(ConversionRateProvider, null, /*#__PURE__*/react.createElement(ChangableAmountProvider, {
|
|
73328
74159
|
accept: accept
|
|
74160
|
+
}, /*#__PURE__*/react.createElement(TrackingProvider, {
|
|
74161
|
+
document: ensureDocument(document)
|
|
73329
74162
|
}, /*#__PURE__*/react.createElement(SaleRoutingProvider, {
|
|
73330
74163
|
container: container,
|
|
73331
74164
|
document: document
|
|
73332
74165
|
}, /*#__PURE__*/react.createElement(SaleStack, {
|
|
73333
74166
|
document: document,
|
|
73334
74167
|
container: container
|
|
73335
|
-
})))))))));
|
|
74168
|
+
}), /*#__PURE__*/react.createElement(PoweredBy, null))))))))));
|
|
73336
74169
|
};
|
|
73337
74170
|
});
|
|
73338
74171
|
return _context2.abrupt("return", {
|