@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/umd/index.bundle.js
CHANGED
|
@@ -43,17 +43,11 @@
|
|
|
43
43
|
function _typeof(obj) {
|
|
44
44
|
"@babel/helpers - typeof";
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
_typeof = function _typeof(obj) {
|
|
52
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return _typeof(obj);
|
|
46
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
47
|
+
return typeof obj;
|
|
48
|
+
} : function (obj) {
|
|
49
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
50
|
+
}, _typeof(obj);
|
|
57
51
|
}
|
|
58
52
|
|
|
59
53
|
var commonjsGlobal$4 = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
@@ -1034,6 +1028,8 @@
|
|
|
1034
1028
|
|
|
1035
1029
|
var ClosableContext = /*#__PURE__*/react.createContext();
|
|
1036
1030
|
|
|
1031
|
+
var UpdatableContext = /*#__PURE__*/react.createContext();
|
|
1032
|
+
|
|
1037
1033
|
var ClosableProvider = (function (props) {
|
|
1038
1034
|
var _useState = react.useState(true),
|
|
1039
1035
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -1045,11 +1041,15 @@
|
|
|
1045
1041
|
open = _useState4[0],
|
|
1046
1042
|
setOpen = _useState4[1];
|
|
1047
1043
|
|
|
1044
|
+
var _useContext = react.useContext(UpdatableContext),
|
|
1045
|
+
setUpdatable = _useContext.setUpdatable;
|
|
1046
|
+
|
|
1048
1047
|
var close = function close() {
|
|
1049
1048
|
if (!closable) {
|
|
1050
1049
|
return;
|
|
1051
1050
|
}
|
|
1052
1051
|
|
|
1052
|
+
setUpdatable(false);
|
|
1053
1053
|
setOpen(false);
|
|
1054
1054
|
setTimeout(props.unmount, 300);
|
|
1055
1055
|
};
|
|
@@ -1995,12 +1995,7 @@
|
|
|
1995
1995
|
className: "DialogBody"
|
|
1996
1996
|
}, props.body), /*#__PURE__*/react.createElement("div", {
|
|
1997
1997
|
className: "DialogFooter"
|
|
1998
|
-
}, props.footer
|
|
1999
|
-
href: 'https://depay.fi?utm_source=' + window.location.hostname + '&utm_medium=widget&utm_campaign=WidgetV2',
|
|
2000
|
-
rel: "noopener noreferrer",
|
|
2001
|
-
target: "_blank",
|
|
2002
|
-
className: "FooterLink"
|
|
2003
|
-
}, "by DePay")));
|
|
1998
|
+
}, props.footer));
|
|
2004
1999
|
});
|
|
2005
2000
|
|
|
2006
2001
|
var ConnectingWalletDialog = (function (props) {
|
|
@@ -2050,9 +2045,9 @@
|
|
|
2050
2045
|
className: "TextButton"
|
|
2051
2046
|
}, "Connect with another wallet")))),
|
|
2052
2047
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
2053
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
2048
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
2054
2049
|
}, /*#__PURE__*/react.createElement("button", {
|
|
2055
|
-
className: "ButtonPrimary
|
|
2050
|
+
className: "ButtonPrimary",
|
|
2056
2051
|
onClick: function onClick() {
|
|
2057
2052
|
return props.connect(wallet);
|
|
2058
2053
|
}
|
|
@@ -2415,7 +2410,7 @@
|
|
|
2415
2410
|
let CONSTANTS = {
|
|
2416
2411
|
ZERO: '0x0000000000000000000000000000000000000000',
|
|
2417
2412
|
MAXINT: '115792089237316195423570985008687907853269984665640564039457584007913129639935',
|
|
2418
|
-
WRAPPED: '
|
|
2413
|
+
WRAPPED: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
|
|
2419
2414
|
NATIVE: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
|
|
2420
2415
|
DECIMALS: 18,
|
|
2421
2416
|
SYMBOL: 'ETH',
|
|
@@ -11360,7 +11355,7 @@
|
|
|
11360
11355
|
return logger$H.throwError(fault, Logger$4.errors.NUMERIC_FAULT, params);
|
|
11361
11356
|
}
|
|
11362
11357
|
// value should have no prefix
|
|
11363
|
-
function _base36To16$
|
|
11358
|
+
function _base36To16$3(value) {
|
|
11364
11359
|
return (new BN$4(value, 36)).toString(16);
|
|
11365
11360
|
}
|
|
11366
11361
|
|
|
@@ -12825,7 +12820,7 @@
|
|
|
12825
12820
|
}
|
|
12826
12821
|
}
|
|
12827
12822
|
|
|
12828
|
-
var sha3$
|
|
12823
|
+
var sha3$4 = createCommonjsModule$4(function (module) {
|
|
12829
12824
|
/*jslint bitwise: true */
|
|
12830
12825
|
(function () {
|
|
12831
12826
|
|
|
@@ -13469,10 +13464,10 @@
|
|
|
13469
13464
|
})();
|
|
13470
13465
|
});
|
|
13471
13466
|
|
|
13472
|
-
var sha3$
|
|
13467
|
+
var sha3$5 = sha3$4;
|
|
13473
13468
|
|
|
13474
|
-
function keccak256$
|
|
13475
|
-
return '0x' + sha3$
|
|
13469
|
+
function keccak256$3(data) {
|
|
13470
|
+
return '0x' + sha3$5.keccak_256(arrayify$3(data));
|
|
13476
13471
|
}
|
|
13477
13472
|
|
|
13478
13473
|
const version$s = "rlp/5.5.0";
|
|
@@ -13522,7 +13517,7 @@
|
|
|
13522
13517
|
const version$r = "address/5.5.0";
|
|
13523
13518
|
|
|
13524
13519
|
const logger$B = new Logger$4(version$r);
|
|
13525
|
-
function getChecksumAddress$
|
|
13520
|
+
function getChecksumAddress$3(address) {
|
|
13526
13521
|
if (!isHexString$4(address, 20)) {
|
|
13527
13522
|
logger$B.throwArgumentError("invalid address", "address", address);
|
|
13528
13523
|
}
|
|
@@ -13532,7 +13527,7 @@
|
|
|
13532
13527
|
for (let i = 0; i < 40; i++) {
|
|
13533
13528
|
expanded[i] = chars[i].charCodeAt(0);
|
|
13534
13529
|
}
|
|
13535
|
-
const hashed = arrayify$3(keccak256$
|
|
13530
|
+
const hashed = arrayify$3(keccak256$3(expanded));
|
|
13536
13531
|
for (let i = 0; i < 40; i += 2) {
|
|
13537
13532
|
if ((hashed[i >> 1] >> 4) >= 8) {
|
|
13538
13533
|
chars[i] = chars[i].toUpperCase();
|
|
@@ -13544,8 +13539,8 @@
|
|
|
13544
13539
|
return "0x" + chars.join("");
|
|
13545
13540
|
}
|
|
13546
13541
|
// Shims for environments that are missing some required constants and functions
|
|
13547
|
-
const MAX_SAFE_INTEGER$
|
|
13548
|
-
function log10$
|
|
13542
|
+
const MAX_SAFE_INTEGER$4 = 0x1fffffffffffff;
|
|
13543
|
+
function log10$4(x) {
|
|
13549
13544
|
if (Math.log10) {
|
|
13550
13545
|
return Math.log10(x);
|
|
13551
13546
|
}
|
|
@@ -13553,22 +13548,22 @@
|
|
|
13553
13548
|
}
|
|
13554
13549
|
// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number
|
|
13555
13550
|
// Create lookup table
|
|
13556
|
-
const ibanLookup$
|
|
13551
|
+
const ibanLookup$3 = {};
|
|
13557
13552
|
for (let i = 0; i < 10; i++) {
|
|
13558
|
-
ibanLookup$
|
|
13553
|
+
ibanLookup$3[String(i)] = String(i);
|
|
13559
13554
|
}
|
|
13560
13555
|
for (let i = 0; i < 26; i++) {
|
|
13561
|
-
ibanLookup$
|
|
13556
|
+
ibanLookup$3[String.fromCharCode(65 + i)] = String(10 + i);
|
|
13562
13557
|
}
|
|
13563
13558
|
// How many decimal digits can we process? (for 64-bit float, this is 15)
|
|
13564
|
-
const safeDigits$
|
|
13565
|
-
function ibanChecksum$
|
|
13559
|
+
const safeDigits$3 = Math.floor(log10$4(MAX_SAFE_INTEGER$4));
|
|
13560
|
+
function ibanChecksum$3(address) {
|
|
13566
13561
|
address = address.toUpperCase();
|
|
13567
13562
|
address = address.substring(4) + address.substring(0, 2) + "00";
|
|
13568
|
-
let expanded = address.split("").map((c) => { return ibanLookup$
|
|
13563
|
+
let expanded = address.split("").map((c) => { return ibanLookup$3[c]; }).join("");
|
|
13569
13564
|
// Javascript can handle integers safely up to 15 (decimal) digits
|
|
13570
|
-
while (expanded.length >= safeDigits$
|
|
13571
|
-
let block = expanded.substring(0, safeDigits$
|
|
13565
|
+
while (expanded.length >= safeDigits$3) {
|
|
13566
|
+
let block = expanded.substring(0, safeDigits$3);
|
|
13572
13567
|
expanded = parseInt(block, 10) % 97 + expanded.substring(block.length);
|
|
13573
13568
|
}
|
|
13574
13569
|
let checksum = String(98 - (parseInt(expanded, 10) % 97));
|
|
@@ -13577,7 +13572,7 @@
|
|
|
13577
13572
|
}
|
|
13578
13573
|
return checksum;
|
|
13579
13574
|
}
|
|
13580
|
-
function getAddress$
|
|
13575
|
+
function getAddress$3(address) {
|
|
13581
13576
|
let result = null;
|
|
13582
13577
|
if (typeof (address) !== "string") {
|
|
13583
13578
|
logger$B.throwArgumentError("invalid address", "address", address);
|
|
@@ -13587,7 +13582,7 @@
|
|
|
13587
13582
|
if (address.substring(0, 2) !== "0x") {
|
|
13588
13583
|
address = "0x" + address;
|
|
13589
13584
|
}
|
|
13590
|
-
result = getChecksumAddress$
|
|
13585
|
+
result = getChecksumAddress$3(address);
|
|
13591
13586
|
// It is a checksummed address with a bad checksum
|
|
13592
13587
|
if (address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) && result !== address) {
|
|
13593
13588
|
logger$B.throwArgumentError("bad address checksum", "address", address);
|
|
@@ -13596,14 +13591,14 @@
|
|
|
13596
13591
|
}
|
|
13597
13592
|
else if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {
|
|
13598
13593
|
// It is an ICAP address with a bad checksum
|
|
13599
|
-
if (address.substring(2, 4) !== ibanChecksum$
|
|
13594
|
+
if (address.substring(2, 4) !== ibanChecksum$3(address)) {
|
|
13600
13595
|
logger$B.throwArgumentError("bad icap checksum", "address", address);
|
|
13601
13596
|
}
|
|
13602
|
-
result = _base36To16$
|
|
13597
|
+
result = _base36To16$3(address.substring(4));
|
|
13603
13598
|
while (result.length < 40) {
|
|
13604
13599
|
result = "0" + result;
|
|
13605
13600
|
}
|
|
13606
|
-
result = getChecksumAddress$
|
|
13601
|
+
result = getChecksumAddress$3("0x" + result);
|
|
13607
13602
|
}
|
|
13608
13603
|
else {
|
|
13609
13604
|
logger$B.throwArgumentError("invalid address", "address", address);
|
|
@@ -13614,13 +13609,13 @@
|
|
|
13614
13609
|
function getContractAddress$2(transaction) {
|
|
13615
13610
|
let from = null;
|
|
13616
13611
|
try {
|
|
13617
|
-
from = getAddress$
|
|
13612
|
+
from = getAddress$3(transaction.from);
|
|
13618
13613
|
}
|
|
13619
13614
|
catch (error) {
|
|
13620
13615
|
logger$B.throwArgumentError("missing from address", "transaction", transaction);
|
|
13621
13616
|
}
|
|
13622
13617
|
const nonce = stripZeros$2(arrayify$3(BigNumber$4.from(transaction.nonce).toHexString()));
|
|
13623
|
-
return getAddress$
|
|
13618
|
+
return getAddress$3(hexDataSlice$2(keccak256$3(encode$4([from, nonce])), 12));
|
|
13624
13619
|
}
|
|
13625
13620
|
|
|
13626
13621
|
class AddressCoder$1 extends Coder$1 {
|
|
@@ -13632,7 +13627,7 @@
|
|
|
13632
13627
|
}
|
|
13633
13628
|
encode(writer, value) {
|
|
13634
13629
|
try {
|
|
13635
|
-
value = getAddress$
|
|
13630
|
+
value = getAddress$3(value);
|
|
13636
13631
|
}
|
|
13637
13632
|
catch (error) {
|
|
13638
13633
|
this._throwError(error.message, value);
|
|
@@ -13640,7 +13635,7 @@
|
|
|
13640
13635
|
return writer.writeValue(value);
|
|
13641
13636
|
}
|
|
13642
13637
|
decode(reader) {
|
|
13643
|
-
return getAddress$
|
|
13638
|
+
return getAddress$3(hexZeroPad$3(reader.readValue().toHexString(), 20));
|
|
13644
13639
|
}
|
|
13645
13640
|
}
|
|
13646
13641
|
|
|
@@ -14353,7 +14348,7 @@
|
|
|
14353
14348
|
const defaultAbiCoder$1 = new AbiCoder$1();
|
|
14354
14349
|
|
|
14355
14350
|
function id$2(text) {
|
|
14356
|
-
return keccak256$
|
|
14351
|
+
return keccak256$3(toUtf8Bytes$2(text));
|
|
14357
14352
|
}
|
|
14358
14353
|
|
|
14359
14354
|
const logger$x = new Logger$4(version$t);
|
|
@@ -14470,7 +14465,7 @@
|
|
|
14470
14465
|
return defaultAbiCoder$1;
|
|
14471
14466
|
}
|
|
14472
14467
|
static getAddress(address) {
|
|
14473
|
-
return getAddress$
|
|
14468
|
+
return getAddress$3(address);
|
|
14474
14469
|
}
|
|
14475
14470
|
static getSighash(fragment) {
|
|
14476
14471
|
return hexDataSlice$2(id$2(fragment.format()), 0, 4);
|
|
@@ -14715,7 +14710,7 @@
|
|
|
14715
14710
|
return id$2(value);
|
|
14716
14711
|
}
|
|
14717
14712
|
else if (param.type === "bytes") {
|
|
14718
|
-
return keccak256$
|
|
14713
|
+
return keccak256$3(hexlify$4(value));
|
|
14719
14714
|
}
|
|
14720
14715
|
// Check addresses are valid
|
|
14721
14716
|
if (param.type === "address") {
|
|
@@ -14770,7 +14765,7 @@
|
|
|
14770
14765
|
topics.push(id$2(value));
|
|
14771
14766
|
}
|
|
14772
14767
|
else if (param.type === "bytes") {
|
|
14773
|
-
topics.push(keccak256$
|
|
14768
|
+
topics.push(keccak256$3(value));
|
|
14774
14769
|
}
|
|
14775
14770
|
else if (param.baseType === "tuple" || param.baseType === "array") {
|
|
14776
14771
|
// @TODO
|
|
@@ -15307,7 +15302,7 @@
|
|
|
15307
15302
|
})(TransactionTypes$2 || (TransactionTypes$2 = {}));
|
|
15308
15303
|
function accessSetify$2(addr, storageKeys) {
|
|
15309
15304
|
return {
|
|
15310
|
-
address: getAddress$
|
|
15305
|
+
address: getAddress$3(addr),
|
|
15311
15306
|
storageKeys: (storageKeys || []).map((storageKey, index) => {
|
|
15312
15307
|
if (hexDataLength$2(storageKey) !== 32) {
|
|
15313
15308
|
logger$u.throwArgumentError("invalid access list storageKey", `accessList[${addr}:${index}]`, storageKey);
|
|
@@ -15359,7 +15354,7 @@
|
|
|
15359
15354
|
}
|
|
15360
15355
|
// If it is already an address, just use it (after adding checksum)
|
|
15361
15356
|
try {
|
|
15362
|
-
return getAddress$
|
|
15357
|
+
return getAddress$3(name);
|
|
15363
15358
|
}
|
|
15364
15359
|
catch (error) { }
|
|
15365
15360
|
if (!resolver) {
|
|
@@ -15418,7 +15413,7 @@
|
|
|
15418
15413
|
override: resolveName$1(contract.signer, overrides.from),
|
|
15419
15414
|
signer: contract.signer.getAddress()
|
|
15420
15415
|
}).then((check) => __awaiter$a(this, void 0, void 0, function* () {
|
|
15421
|
-
if (getAddress$
|
|
15416
|
+
if (getAddress$3(check.signer) !== check.override) {
|
|
15422
15417
|
logger$t.throwError("Contract with a Signer cannot override from", Logger$4.errors.UNSUPPORTED_OPERATION, {
|
|
15423
15418
|
operation: "overrides.from"
|
|
15424
15419
|
});
|
|
@@ -15854,7 +15849,7 @@
|
|
|
15854
15849
|
}
|
|
15855
15850
|
else {
|
|
15856
15851
|
try {
|
|
15857
|
-
defineReadOnly$2(this, "resolvedAddress", Promise.resolve(getAddress$
|
|
15852
|
+
defineReadOnly$2(this, "resolvedAddress", Promise.resolve(getAddress$3(addressOrName)));
|
|
15858
15853
|
}
|
|
15859
15854
|
catch (error) {
|
|
15860
15855
|
// Without a provider, we cannot use ENS names
|
|
@@ -20919,7 +20914,7 @@
|
|
|
20919
20914
|
return logger$e$1.throwError(fault, Logger$3.errors.NUMERIC_FAULT, params);
|
|
20920
20915
|
}
|
|
20921
20916
|
// value should have no prefix
|
|
20922
|
-
function _base36To16$
|
|
20917
|
+
function _base36To16$2(value) {
|
|
20923
20918
|
return (new BN$3(value, 36)).toString(16);
|
|
20924
20919
|
}
|
|
20925
20920
|
|
|
@@ -22125,7 +22120,7 @@
|
|
|
22125
22120
|
* @license MIT
|
|
22126
22121
|
*/
|
|
22127
22122
|
|
|
22128
|
-
var sha3$
|
|
22123
|
+
var sha3$3 = createCommonjsModule$1$2(function (module) {
|
|
22129
22124
|
/*jslint bitwise: true */
|
|
22130
22125
|
(function () {
|
|
22131
22126
|
|
|
@@ -22594,14 +22589,14 @@
|
|
|
22594
22589
|
})();
|
|
22595
22590
|
});
|
|
22596
22591
|
|
|
22597
|
-
var sha3$1$
|
|
22592
|
+
var sha3$1$2 = sha3$3;
|
|
22598
22593
|
|
|
22599
|
-
function keccak256$
|
|
22600
|
-
return '0x' + sha3$1$
|
|
22594
|
+
function keccak256$2(data) {
|
|
22595
|
+
return '0x' + sha3$1$2.keccak_256(arrayify$2(data));
|
|
22601
22596
|
}
|
|
22602
22597
|
|
|
22603
22598
|
function id$1(text) {
|
|
22604
|
-
return keccak256$
|
|
22599
|
+
return keccak256$2(toUtf8Bytes$1(text));
|
|
22605
22600
|
}
|
|
22606
22601
|
|
|
22607
22602
|
const version$7$1 = "hash/5.4.0";
|
|
@@ -22623,7 +22618,7 @@
|
|
|
22623
22618
|
logger$9$1.throwArgumentError("invalid ENS address; missing component", "name", name);
|
|
22624
22619
|
}
|
|
22625
22620
|
const label = toUtf8Bytes$1(nameprep$1(partition[3]));
|
|
22626
|
-
result = keccak256$
|
|
22621
|
+
result = keccak256$2(concat$1([result, keccak256$2(label)]));
|
|
22627
22622
|
current = partition[2] || "";
|
|
22628
22623
|
}
|
|
22629
22624
|
return hexlify$3(result);
|
|
@@ -22746,10 +22741,10 @@
|
|
|
22746
22741
|
return decoded.result;
|
|
22747
22742
|
}
|
|
22748
22743
|
|
|
22749
|
-
const version$5$
|
|
22744
|
+
const version$5$2 = "address/5.4.0";
|
|
22750
22745
|
|
|
22751
|
-
const logger$7$1 = new Logger$3(version$5$
|
|
22752
|
-
function getChecksumAddress$
|
|
22746
|
+
const logger$7$1 = new Logger$3(version$5$2);
|
|
22747
|
+
function getChecksumAddress$2(address) {
|
|
22753
22748
|
if (!isHexString$3(address, 20)) {
|
|
22754
22749
|
logger$7$1.throwArgumentError("invalid address", "address", address);
|
|
22755
22750
|
}
|
|
@@ -22759,7 +22754,7 @@
|
|
|
22759
22754
|
for (let i = 0; i < 40; i++) {
|
|
22760
22755
|
expanded[i] = chars[i].charCodeAt(0);
|
|
22761
22756
|
}
|
|
22762
|
-
const hashed = arrayify$2(keccak256$
|
|
22757
|
+
const hashed = arrayify$2(keccak256$2(expanded));
|
|
22763
22758
|
for (let i = 0; i < 40; i += 2) {
|
|
22764
22759
|
if ((hashed[i >> 1] >> 4) >= 8) {
|
|
22765
22760
|
chars[i] = chars[i].toUpperCase();
|
|
@@ -22771,8 +22766,8 @@
|
|
|
22771
22766
|
return "0x" + chars.join("");
|
|
22772
22767
|
}
|
|
22773
22768
|
// Shims for environments that are missing some required constants and functions
|
|
22774
|
-
const MAX_SAFE_INTEGER$
|
|
22775
|
-
function log10$
|
|
22769
|
+
const MAX_SAFE_INTEGER$3 = 0x1fffffffffffff;
|
|
22770
|
+
function log10$3(x) {
|
|
22776
22771
|
if (Math.log10) {
|
|
22777
22772
|
return Math.log10(x);
|
|
22778
22773
|
}
|
|
@@ -22780,22 +22775,22 @@
|
|
|
22780
22775
|
}
|
|
22781
22776
|
// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number
|
|
22782
22777
|
// Create lookup table
|
|
22783
|
-
const ibanLookup$
|
|
22778
|
+
const ibanLookup$2 = {};
|
|
22784
22779
|
for (let i = 0; i < 10; i++) {
|
|
22785
|
-
ibanLookup$
|
|
22780
|
+
ibanLookup$2[String(i)] = String(i);
|
|
22786
22781
|
}
|
|
22787
22782
|
for (let i = 0; i < 26; i++) {
|
|
22788
|
-
ibanLookup$
|
|
22783
|
+
ibanLookup$2[String.fromCharCode(65 + i)] = String(10 + i);
|
|
22789
22784
|
}
|
|
22790
22785
|
// How many decimal digits can we process? (for 64-bit float, this is 15)
|
|
22791
|
-
const safeDigits$
|
|
22792
|
-
function ibanChecksum$
|
|
22786
|
+
const safeDigits$2 = Math.floor(log10$3(MAX_SAFE_INTEGER$3));
|
|
22787
|
+
function ibanChecksum$2(address) {
|
|
22793
22788
|
address = address.toUpperCase();
|
|
22794
22789
|
address = address.substring(4) + address.substring(0, 2) + "00";
|
|
22795
|
-
let expanded = address.split("").map((c) => { return ibanLookup$
|
|
22790
|
+
let expanded = address.split("").map((c) => { return ibanLookup$2[c]; }).join("");
|
|
22796
22791
|
// Javascript can handle integers safely up to 15 (decimal) digits
|
|
22797
|
-
while (expanded.length >= safeDigits$
|
|
22798
|
-
let block = expanded.substring(0, safeDigits$
|
|
22792
|
+
while (expanded.length >= safeDigits$2) {
|
|
22793
|
+
let block = expanded.substring(0, safeDigits$2);
|
|
22799
22794
|
expanded = parseInt(block, 10) % 97 + expanded.substring(block.length);
|
|
22800
22795
|
}
|
|
22801
22796
|
let checksum = String(98 - (parseInt(expanded, 10) % 97));
|
|
@@ -22804,7 +22799,7 @@
|
|
|
22804
22799
|
}
|
|
22805
22800
|
return checksum;
|
|
22806
22801
|
}
|
|
22807
|
-
function getAddress$
|
|
22802
|
+
function getAddress$2(address) {
|
|
22808
22803
|
let result = null;
|
|
22809
22804
|
if (typeof (address) !== "string") {
|
|
22810
22805
|
logger$7$1.throwArgumentError("invalid address", "address", address);
|
|
@@ -22814,7 +22809,7 @@
|
|
|
22814
22809
|
if (address.substring(0, 2) !== "0x") {
|
|
22815
22810
|
address = "0x" + address;
|
|
22816
22811
|
}
|
|
22817
|
-
result = getChecksumAddress$
|
|
22812
|
+
result = getChecksumAddress$2(address);
|
|
22818
22813
|
// It is a checksummed address with a bad checksum
|
|
22819
22814
|
if (address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) && result !== address) {
|
|
22820
22815
|
logger$7$1.throwArgumentError("bad address checksum", "address", address);
|
|
@@ -22823,14 +22818,14 @@
|
|
|
22823
22818
|
}
|
|
22824
22819
|
else if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {
|
|
22825
22820
|
// It is an ICAP address with a bad checksum
|
|
22826
|
-
if (address.substring(2, 4) !== ibanChecksum$
|
|
22821
|
+
if (address.substring(2, 4) !== ibanChecksum$2(address)) {
|
|
22827
22822
|
logger$7$1.throwArgumentError("bad icap checksum", "address", address);
|
|
22828
22823
|
}
|
|
22829
|
-
result = _base36To16$
|
|
22824
|
+
result = _base36To16$2(address.substring(4));
|
|
22830
22825
|
while (result.length < 40) {
|
|
22831
22826
|
result = "0" + result;
|
|
22832
22827
|
}
|
|
22833
|
-
result = getChecksumAddress$
|
|
22828
|
+
result = getChecksumAddress$2("0x" + result);
|
|
22834
22829
|
}
|
|
22835
22830
|
else {
|
|
22836
22831
|
logger$7$1.throwArgumentError("invalid address", "address", address);
|
|
@@ -22841,13 +22836,13 @@
|
|
|
22841
22836
|
function getContractAddress$1(transaction) {
|
|
22842
22837
|
let from = null;
|
|
22843
22838
|
try {
|
|
22844
|
-
from = getAddress$
|
|
22839
|
+
from = getAddress$2(transaction.from);
|
|
22845
22840
|
}
|
|
22846
22841
|
catch (error) {
|
|
22847
22842
|
logger$7$1.throwArgumentError("missing from address", "transaction", transaction);
|
|
22848
22843
|
}
|
|
22849
22844
|
const nonce = stripZeros$1(arrayify$2(BigNumber$3.from(transaction.nonce).toHexString()));
|
|
22850
|
-
return getAddress$
|
|
22845
|
+
return getAddress$2(hexDataSlice$1(keccak256$2(encode$1$1([from, nonce])), 12));
|
|
22851
22846
|
}
|
|
22852
22847
|
|
|
22853
22848
|
var __awaiter$3$1 = function (thisArg, _arguments, P, generator) {
|
|
@@ -22906,7 +22901,7 @@
|
|
|
22906
22901
|
},
|
|
22907
22902
|
verifyingContract: function (value) {
|
|
22908
22903
|
try {
|
|
22909
|
-
return getAddress$
|
|
22904
|
+
return getAddress$2(value).toLowerCase();
|
|
22910
22905
|
}
|
|
22911
22906
|
catch (error) { }
|
|
22912
22907
|
return logger$6$1.throwArgumentError(`invalid domain value "verifyingContract"`, "domain.verifyingContract", value);
|
|
@@ -22963,13 +22958,13 @@
|
|
|
22963
22958
|
}
|
|
22964
22959
|
switch (type) {
|
|
22965
22960
|
case "address": return function (value) {
|
|
22966
|
-
return hexZeroPad$2(getAddress$
|
|
22961
|
+
return hexZeroPad$2(getAddress$2(value), 32);
|
|
22967
22962
|
};
|
|
22968
22963
|
case "bool": return function (value) {
|
|
22969
22964
|
return ((!value) ? hexFalse$1 : hexTrue$1);
|
|
22970
22965
|
};
|
|
22971
22966
|
case "bytes": return function (value) {
|
|
22972
|
-
return keccak256$
|
|
22967
|
+
return keccak256$2(value);
|
|
22973
22968
|
};
|
|
22974
22969
|
case "string": return function (value) {
|
|
22975
22970
|
return id$1(value);
|
|
@@ -23085,9 +23080,9 @@
|
|
|
23085
23080
|
}
|
|
23086
23081
|
let result = value.map(subEncoder);
|
|
23087
23082
|
if (this._types[subtype]) {
|
|
23088
|
-
result = result.map(keccak256$
|
|
23083
|
+
result = result.map(keccak256$2);
|
|
23089
23084
|
}
|
|
23090
|
-
return keccak256$
|
|
23085
|
+
return keccak256$2(hexConcat$1(result));
|
|
23091
23086
|
};
|
|
23092
23087
|
}
|
|
23093
23088
|
// Struct
|
|
@@ -23098,7 +23093,7 @@
|
|
|
23098
23093
|
const values = fields.map(({ name, type }) => {
|
|
23099
23094
|
const result = this.getEncoder(type)(value[name]);
|
|
23100
23095
|
if (this._types[type]) {
|
|
23101
|
-
return keccak256$
|
|
23096
|
+
return keccak256$2(result);
|
|
23102
23097
|
}
|
|
23103
23098
|
return result;
|
|
23104
23099
|
});
|
|
@@ -23119,7 +23114,7 @@
|
|
|
23119
23114
|
return this.getEncoder(type)(value);
|
|
23120
23115
|
}
|
|
23121
23116
|
hashStruct(name, value) {
|
|
23122
|
-
return keccak256$
|
|
23117
|
+
return keccak256$2(this.encodeData(name, value));
|
|
23123
23118
|
}
|
|
23124
23119
|
encode(value) {
|
|
23125
23120
|
return this.encodeData(this.primaryType, value);
|
|
@@ -23189,7 +23184,7 @@
|
|
|
23189
23184
|
]);
|
|
23190
23185
|
}
|
|
23191
23186
|
static hash(domain, types, value) {
|
|
23192
|
-
return keccak256$
|
|
23187
|
+
return keccak256$2(TypedDataEncoder$1.encode(domain, types, value));
|
|
23193
23188
|
}
|
|
23194
23189
|
// Replaces all address types with ENS names with their looked up address
|
|
23195
23190
|
static resolveNames(domain, types, value, resolveName) {
|
|
@@ -27180,7 +27175,7 @@
|
|
|
27180
27175
|
|
|
27181
27176
|
const version$2$3 = "signing-key/5.4.0";
|
|
27182
27177
|
|
|
27183
|
-
const logger$5$
|
|
27178
|
+
const logger$5$2 = new Logger$3(version$2$3);
|
|
27184
27179
|
let _curve$1 = null;
|
|
27185
27180
|
function getCurve$1() {
|
|
27186
27181
|
if (!_curve$1) {
|
|
@@ -27206,7 +27201,7 @@
|
|
|
27206
27201
|
const keyPair = getCurve$1().keyFromPrivate(arrayify$2(this.privateKey));
|
|
27207
27202
|
const digestBytes = arrayify$2(digest);
|
|
27208
27203
|
if (digestBytes.length !== 32) {
|
|
27209
|
-
logger$5$
|
|
27204
|
+
logger$5$2.throwArgumentError("bad digest length", "digest", digest);
|
|
27210
27205
|
}
|
|
27211
27206
|
const signature = keyPair.sign(digestBytes, { canonical: true });
|
|
27212
27207
|
return splitSignature$1({
|
|
@@ -27250,7 +27245,7 @@
|
|
|
27250
27245
|
}
|
|
27251
27246
|
return "0x" + getCurve$1().keyFromPublic(bytes).getPublic(true, "hex");
|
|
27252
27247
|
}
|
|
27253
|
-
return logger$5$
|
|
27248
|
+
return logger$5$2.throwArgumentError("invalid public or private key", "key", "[REDACTED]");
|
|
27254
27249
|
}
|
|
27255
27250
|
|
|
27256
27251
|
const version$1$3 = "transactions/5.4.0";
|
|
@@ -27267,7 +27262,7 @@
|
|
|
27267
27262
|
if (value === "0x") {
|
|
27268
27263
|
return null;
|
|
27269
27264
|
}
|
|
27270
|
-
return getAddress$
|
|
27265
|
+
return getAddress$2(value);
|
|
27271
27266
|
}
|
|
27272
27267
|
function handleNumber$1(value) {
|
|
27273
27268
|
if (value === "0x") {
|
|
@@ -27277,7 +27272,7 @@
|
|
|
27277
27272
|
}
|
|
27278
27273
|
function computeAddress$1(key) {
|
|
27279
27274
|
const publicKey = computePublicKey$1(key);
|
|
27280
|
-
return getAddress$
|
|
27275
|
+
return getAddress$2(hexDataSlice$1(keccak256$2(hexDataSlice$1(publicKey, 1)), 12));
|
|
27281
27276
|
}
|
|
27282
27277
|
function recoverAddress$1(digest, signature) {
|
|
27283
27278
|
return computeAddress$1(recoverPublicKey$1(arrayify$2(digest), signature));
|
|
@@ -27291,7 +27286,7 @@
|
|
|
27291
27286
|
}
|
|
27292
27287
|
function accessSetify$1(addr, storageKeys) {
|
|
27293
27288
|
return {
|
|
27294
|
-
address: getAddress$
|
|
27289
|
+
address: getAddress$2(addr),
|
|
27295
27290
|
storageKeys: (storageKeys || []).map((storageKey, index) => {
|
|
27296
27291
|
if (hexDataLength$1(storageKey) !== 32) {
|
|
27297
27292
|
logger$4$2.throwArgumentError("invalid access list storageKey", `accessList[${addr}:${index}]`, storageKey);
|
|
@@ -27344,7 +27339,7 @@
|
|
|
27344
27339
|
formatNumber$1(transaction.maxPriorityFeePerGas || 0, "maxPriorityFeePerGas"),
|
|
27345
27340
|
formatNumber$1(transaction.maxFeePerGas || 0, "maxFeePerGas"),
|
|
27346
27341
|
formatNumber$1(transaction.gasLimit || 0, "gasLimit"),
|
|
27347
|
-
((transaction.to != null) ? getAddress$
|
|
27342
|
+
((transaction.to != null) ? getAddress$2(transaction.to) : "0x"),
|
|
27348
27343
|
formatNumber$1(transaction.value || 0, "value"),
|
|
27349
27344
|
(transaction.data || "0x"),
|
|
27350
27345
|
(formatAccessList$1(transaction.accessList || []))
|
|
@@ -27363,7 +27358,7 @@
|
|
|
27363
27358
|
formatNumber$1(transaction.nonce || 0, "nonce"),
|
|
27364
27359
|
formatNumber$1(transaction.gasPrice || 0, "gasPrice"),
|
|
27365
27360
|
formatNumber$1(transaction.gasLimit || 0, "gasLimit"),
|
|
27366
|
-
((transaction.to != null) ? getAddress$
|
|
27361
|
+
((transaction.to != null) ? getAddress$2(transaction.to) : "0x"),
|
|
27367
27362
|
formatNumber$1(transaction.value || 0, "value"),
|
|
27368
27363
|
(transaction.data || "0x"),
|
|
27369
27364
|
(formatAccessList$1(transaction.accessList || []))
|
|
@@ -27390,7 +27385,7 @@
|
|
|
27390
27385
|
tx.r = hexZeroPad$2(fields[1], 32);
|
|
27391
27386
|
tx.s = hexZeroPad$2(fields[2], 32);
|
|
27392
27387
|
try {
|
|
27393
|
-
const digest = keccak256$
|
|
27388
|
+
const digest = keccak256$2(serialize(tx));
|
|
27394
27389
|
tx.from = recoverAddress$1(digest, { r: tx.r, s: tx.s, recoveryParam: tx.v });
|
|
27395
27390
|
}
|
|
27396
27391
|
catch (error) {
|
|
@@ -27421,7 +27416,7 @@
|
|
|
27421
27416
|
if (transaction.length === 9) {
|
|
27422
27417
|
return tx;
|
|
27423
27418
|
}
|
|
27424
|
-
tx.hash = keccak256$
|
|
27419
|
+
tx.hash = keccak256$2(payload);
|
|
27425
27420
|
_parseEipSignature$1(tx, transaction.slice(9), _serializeEip1559$1);
|
|
27426
27421
|
return tx;
|
|
27427
27422
|
}
|
|
@@ -27445,7 +27440,7 @@
|
|
|
27445
27440
|
if (transaction.length === 8) {
|
|
27446
27441
|
return tx;
|
|
27447
27442
|
}
|
|
27448
|
-
tx.hash = keccak256$
|
|
27443
|
+
tx.hash = keccak256$2(payload);
|
|
27449
27444
|
_parseEipSignature$1(tx, transaction.slice(8), _serializeEip2930$1);
|
|
27450
27445
|
return tx;
|
|
27451
27446
|
}
|
|
@@ -27496,14 +27491,14 @@
|
|
|
27496
27491
|
raw.push("0x");
|
|
27497
27492
|
recoveryParam -= tx.chainId * 2 + 8;
|
|
27498
27493
|
}
|
|
27499
|
-
const digest = keccak256$
|
|
27494
|
+
const digest = keccak256$2(encode$1$1(raw));
|
|
27500
27495
|
try {
|
|
27501
27496
|
tx.from = recoverAddress$1(digest, { r: hexlify$3(tx.r), s: hexlify$3(tx.s), recoveryParam: recoveryParam });
|
|
27502
27497
|
}
|
|
27503
27498
|
catch (error) {
|
|
27504
27499
|
console.log(error);
|
|
27505
27500
|
}
|
|
27506
|
-
tx.hash = keccak256$
|
|
27501
|
+
tx.hash = keccak256$2(rawTransaction);
|
|
27507
27502
|
}
|
|
27508
27503
|
tx.type = null;
|
|
27509
27504
|
return tx;
|
|
@@ -27705,13 +27700,13 @@
|
|
|
27705
27700
|
// Requires an address
|
|
27706
27701
|
// Strict! Used on input.
|
|
27707
27702
|
address(value) {
|
|
27708
|
-
return getAddress$
|
|
27703
|
+
return getAddress$2(value);
|
|
27709
27704
|
}
|
|
27710
27705
|
callAddress(value) {
|
|
27711
27706
|
if (!isHexString$3(value, 32)) {
|
|
27712
27707
|
return null;
|
|
27713
27708
|
}
|
|
27714
|
-
const address = getAddress$
|
|
27709
|
+
const address = getAddress$2(hexDataSlice$1(value, 12));
|
|
27715
27710
|
return (address === AddressZero$1) ? null : address;
|
|
27716
27711
|
}
|
|
27717
27712
|
contractAddress(value) {
|
|
@@ -30530,6 +30525,8 @@
|
|
|
30530
30525
|
var request$1 = async ({ provider, address, api, method, params }) => {
|
|
30531
30526
|
if (api) {
|
|
30532
30527
|
return contractCall({ address, api, method, params, provider })
|
|
30528
|
+
} else if (method === 'latestBlockNumber') {
|
|
30529
|
+
return provider.getBlockNumber()
|
|
30533
30530
|
} else if (method === 'balance') {
|
|
30534
30531
|
return balance({ address, provider })
|
|
30535
30532
|
}
|
|
@@ -30586,8 +30583,20 @@
|
|
|
30586
30583
|
if (typeof url == 'object') {
|
|
30587
30584
|
return url
|
|
30588
30585
|
}
|
|
30589
|
-
let deconstructed = url.match(/(?<blockchain>\w+):\/\/(?<
|
|
30590
|
-
|
|
30586
|
+
let deconstructed = url.match(/(?<blockchain>\w+):\/\/(?<part1>[\w\d]+)(\/(?<part2>[\w\d]+))?/);
|
|
30587
|
+
|
|
30588
|
+
if(deconstructed.groups.part2 == undefined) {
|
|
30589
|
+
return {
|
|
30590
|
+
blockchain: deconstructed.groups.blockchain,
|
|
30591
|
+
method: deconstructed.groups.part1
|
|
30592
|
+
}
|
|
30593
|
+
} else {
|
|
30594
|
+
return {
|
|
30595
|
+
blockchain: deconstructed.groups.blockchain,
|
|
30596
|
+
address: deconstructed.groups.part1,
|
|
30597
|
+
method: deconstructed.groups.part2
|
|
30598
|
+
}
|
|
30599
|
+
}
|
|
30591
30600
|
};
|
|
30592
30601
|
|
|
30593
30602
|
let request = async function (url, options) {
|
|
@@ -35076,7 +35085,7 @@
|
|
|
35076
35085
|
return logger$o.throwError(fault, Logger$2.errors.NUMERIC_FAULT, params);
|
|
35077
35086
|
}
|
|
35078
35087
|
// value should have no prefix
|
|
35079
|
-
function _base36To16(value) {
|
|
35088
|
+
function _base36To16$1(value) {
|
|
35080
35089
|
return (new BN$2(value, 36)).toString(16);
|
|
35081
35090
|
}
|
|
35082
35091
|
|
|
@@ -36560,7 +36569,7 @@
|
|
|
36560
36569
|
* @license MIT
|
|
36561
36570
|
*/
|
|
36562
36571
|
|
|
36563
|
-
var sha3 = createCommonjsModule$1$1(function (module) {
|
|
36572
|
+
var sha3$2 = createCommonjsModule$1$1(function (module) {
|
|
36564
36573
|
/*jslint bitwise: true */
|
|
36565
36574
|
(function () {
|
|
36566
36575
|
|
|
@@ -37029,10 +37038,10 @@
|
|
|
37029
37038
|
})();
|
|
37030
37039
|
});
|
|
37031
37040
|
|
|
37032
|
-
var sha3$1 = sha3;
|
|
37041
|
+
var sha3$1$1 = sha3$2;
|
|
37033
37042
|
|
|
37034
|
-
function keccak256(data) {
|
|
37035
|
-
return '0x' + sha3$1.keccak_256(arrayify$1(data));
|
|
37043
|
+
function keccak256$1(data) {
|
|
37044
|
+
return '0x' + sha3$1$1.keccak_256(arrayify$1(data));
|
|
37036
37045
|
}
|
|
37037
37046
|
|
|
37038
37047
|
const version$d = "rlp/5.4.0";
|
|
@@ -37155,7 +37164,7 @@
|
|
|
37155
37164
|
const version$c = "address/5.4.0";
|
|
37156
37165
|
|
|
37157
37166
|
const logger$i = new Logger$2(version$c);
|
|
37158
|
-
function getChecksumAddress(address) {
|
|
37167
|
+
function getChecksumAddress$1(address) {
|
|
37159
37168
|
if (!isHexString$2(address, 20)) {
|
|
37160
37169
|
logger$i.throwArgumentError("invalid address", "address", address);
|
|
37161
37170
|
}
|
|
@@ -37165,7 +37174,7 @@
|
|
|
37165
37174
|
for (let i = 0; i < 40; i++) {
|
|
37166
37175
|
expanded[i] = chars[i].charCodeAt(0);
|
|
37167
37176
|
}
|
|
37168
|
-
const hashed = arrayify$1(keccak256(expanded));
|
|
37177
|
+
const hashed = arrayify$1(keccak256$1(expanded));
|
|
37169
37178
|
for (let i = 0; i < 40; i += 2) {
|
|
37170
37179
|
if ((hashed[i >> 1] >> 4) >= 8) {
|
|
37171
37180
|
chars[i] = chars[i].toUpperCase();
|
|
@@ -37177,8 +37186,8 @@
|
|
|
37177
37186
|
return "0x" + chars.join("");
|
|
37178
37187
|
}
|
|
37179
37188
|
// Shims for environments that are missing some required constants and functions
|
|
37180
|
-
const MAX_SAFE_INTEGER$
|
|
37181
|
-
function log10$
|
|
37189
|
+
const MAX_SAFE_INTEGER$2 = 0x1fffffffffffff;
|
|
37190
|
+
function log10$2(x) {
|
|
37182
37191
|
if (Math.log10) {
|
|
37183
37192
|
return Math.log10(x);
|
|
37184
37193
|
}
|
|
@@ -37186,22 +37195,22 @@
|
|
|
37186
37195
|
}
|
|
37187
37196
|
// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number
|
|
37188
37197
|
// Create lookup table
|
|
37189
|
-
const ibanLookup = {};
|
|
37198
|
+
const ibanLookup$1 = {};
|
|
37190
37199
|
for (let i = 0; i < 10; i++) {
|
|
37191
|
-
ibanLookup[String(i)] = String(i);
|
|
37200
|
+
ibanLookup$1[String(i)] = String(i);
|
|
37192
37201
|
}
|
|
37193
37202
|
for (let i = 0; i < 26; i++) {
|
|
37194
|
-
ibanLookup[String.fromCharCode(65 + i)] = String(10 + i);
|
|
37203
|
+
ibanLookup$1[String.fromCharCode(65 + i)] = String(10 + i);
|
|
37195
37204
|
}
|
|
37196
37205
|
// How many decimal digits can we process? (for 64-bit float, this is 15)
|
|
37197
|
-
const safeDigits = Math.floor(log10$
|
|
37198
|
-
function ibanChecksum(address) {
|
|
37206
|
+
const safeDigits$1 = Math.floor(log10$2(MAX_SAFE_INTEGER$2));
|
|
37207
|
+
function ibanChecksum$1(address) {
|
|
37199
37208
|
address = address.toUpperCase();
|
|
37200
37209
|
address = address.substring(4) + address.substring(0, 2) + "00";
|
|
37201
|
-
let expanded = address.split("").map((c) => { return ibanLookup[c]; }).join("");
|
|
37210
|
+
let expanded = address.split("").map((c) => { return ibanLookup$1[c]; }).join("");
|
|
37202
37211
|
// Javascript can handle integers safely up to 15 (decimal) digits
|
|
37203
|
-
while (expanded.length >= safeDigits) {
|
|
37204
|
-
let block = expanded.substring(0, safeDigits);
|
|
37212
|
+
while (expanded.length >= safeDigits$1) {
|
|
37213
|
+
let block = expanded.substring(0, safeDigits$1);
|
|
37205
37214
|
expanded = parseInt(block, 10) % 97 + expanded.substring(block.length);
|
|
37206
37215
|
}
|
|
37207
37216
|
let checksum = String(98 - (parseInt(expanded, 10) % 97));
|
|
@@ -37210,7 +37219,7 @@
|
|
|
37210
37219
|
}
|
|
37211
37220
|
return checksum;
|
|
37212
37221
|
}
|
|
37213
|
-
function getAddress(address) {
|
|
37222
|
+
function getAddress$1(address) {
|
|
37214
37223
|
let result = null;
|
|
37215
37224
|
if (typeof (address) !== "string") {
|
|
37216
37225
|
logger$i.throwArgumentError("invalid address", "address", address);
|
|
@@ -37220,7 +37229,7 @@
|
|
|
37220
37229
|
if (address.substring(0, 2) !== "0x") {
|
|
37221
37230
|
address = "0x" + address;
|
|
37222
37231
|
}
|
|
37223
|
-
result = getChecksumAddress(address);
|
|
37232
|
+
result = getChecksumAddress$1(address);
|
|
37224
37233
|
// It is a checksummed address with a bad checksum
|
|
37225
37234
|
if (address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) && result !== address) {
|
|
37226
37235
|
logger$i.throwArgumentError("bad address checksum", "address", address);
|
|
@@ -37229,14 +37238,14 @@
|
|
|
37229
37238
|
}
|
|
37230
37239
|
else if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {
|
|
37231
37240
|
// It is an ICAP address with a bad checksum
|
|
37232
|
-
if (address.substring(2, 4) !== ibanChecksum(address)) {
|
|
37241
|
+
if (address.substring(2, 4) !== ibanChecksum$1(address)) {
|
|
37233
37242
|
logger$i.throwArgumentError("bad icap checksum", "address", address);
|
|
37234
37243
|
}
|
|
37235
|
-
result = _base36To16(address.substring(4));
|
|
37244
|
+
result = _base36To16$1(address.substring(4));
|
|
37236
37245
|
while (result.length < 40) {
|
|
37237
37246
|
result = "0" + result;
|
|
37238
37247
|
}
|
|
37239
|
-
result = getChecksumAddress("0x" + result);
|
|
37248
|
+
result = getChecksumAddress$1("0x" + result);
|
|
37240
37249
|
}
|
|
37241
37250
|
else {
|
|
37242
37251
|
logger$i.throwArgumentError("invalid address", "address", address);
|
|
@@ -37247,13 +37256,13 @@
|
|
|
37247
37256
|
function getContractAddress(transaction) {
|
|
37248
37257
|
let from = null;
|
|
37249
37258
|
try {
|
|
37250
|
-
from = getAddress(transaction.from);
|
|
37259
|
+
from = getAddress$1(transaction.from);
|
|
37251
37260
|
}
|
|
37252
37261
|
catch (error) {
|
|
37253
37262
|
logger$i.throwArgumentError("missing from address", "transaction", transaction);
|
|
37254
37263
|
}
|
|
37255
37264
|
const nonce = stripZeros(arrayify$1(BigNumber$2.from(transaction.nonce).toHexString()));
|
|
37256
|
-
return getAddress(hexDataSlice(keccak256(encode$2([from, nonce])), 12));
|
|
37265
|
+
return getAddress$1(hexDataSlice(keccak256$1(encode$2([from, nonce])), 12));
|
|
37257
37266
|
}
|
|
37258
37267
|
|
|
37259
37268
|
class AddressCoder extends Coder {
|
|
@@ -37265,7 +37274,7 @@
|
|
|
37265
37274
|
}
|
|
37266
37275
|
encode(writer, value) {
|
|
37267
37276
|
try {
|
|
37268
|
-
value = getAddress(value);
|
|
37277
|
+
value = getAddress$1(value);
|
|
37269
37278
|
}
|
|
37270
37279
|
catch (error) {
|
|
37271
37280
|
this._throwError(error.message, value);
|
|
@@ -37273,7 +37282,7 @@
|
|
|
37273
37282
|
return writer.writeValue(value);
|
|
37274
37283
|
}
|
|
37275
37284
|
decode(reader) {
|
|
37276
|
-
return getAddress(hexZeroPad$1(reader.readValue().toHexString(), 20));
|
|
37285
|
+
return getAddress$1(hexZeroPad$1(reader.readValue().toHexString(), 20));
|
|
37277
37286
|
}
|
|
37278
37287
|
}
|
|
37279
37288
|
|
|
@@ -38179,7 +38188,7 @@
|
|
|
38179
38188
|
const defaultAbiCoder = new AbiCoder();
|
|
38180
38189
|
|
|
38181
38190
|
function id(text) {
|
|
38182
|
-
return keccak256(toUtf8Bytes(text));
|
|
38191
|
+
return keccak256$1(toUtf8Bytes(text));
|
|
38183
38192
|
}
|
|
38184
38193
|
|
|
38185
38194
|
const version$a = "hash/5.4.0";
|
|
@@ -38201,7 +38210,7 @@
|
|
|
38201
38210
|
logger$e.throwArgumentError("invalid ENS address; missing component", "name", name);
|
|
38202
38211
|
}
|
|
38203
38212
|
const label = toUtf8Bytes(nameprep(partition[3]));
|
|
38204
|
-
result = keccak256(concat([result, keccak256(label)]));
|
|
38213
|
+
result = keccak256$1(concat([result, keccak256$1(label)]));
|
|
38205
38214
|
current = partition[2] || "";
|
|
38206
38215
|
}
|
|
38207
38216
|
return hexlify$2(result);
|
|
@@ -38263,7 +38272,7 @@
|
|
|
38263
38272
|
},
|
|
38264
38273
|
verifyingContract: function (value) {
|
|
38265
38274
|
try {
|
|
38266
|
-
return getAddress(value).toLowerCase();
|
|
38275
|
+
return getAddress$1(value).toLowerCase();
|
|
38267
38276
|
}
|
|
38268
38277
|
catch (error) { }
|
|
38269
38278
|
return logger$d.throwArgumentError(`invalid domain value "verifyingContract"`, "domain.verifyingContract", value);
|
|
@@ -38320,13 +38329,13 @@
|
|
|
38320
38329
|
}
|
|
38321
38330
|
switch (type) {
|
|
38322
38331
|
case "address": return function (value) {
|
|
38323
|
-
return hexZeroPad$1(getAddress(value), 32);
|
|
38332
|
+
return hexZeroPad$1(getAddress$1(value), 32);
|
|
38324
38333
|
};
|
|
38325
38334
|
case "bool": return function (value) {
|
|
38326
38335
|
return ((!value) ? hexFalse : hexTrue);
|
|
38327
38336
|
};
|
|
38328
38337
|
case "bytes": return function (value) {
|
|
38329
|
-
return keccak256(value);
|
|
38338
|
+
return keccak256$1(value);
|
|
38330
38339
|
};
|
|
38331
38340
|
case "string": return function (value) {
|
|
38332
38341
|
return id(value);
|
|
@@ -38442,9 +38451,9 @@
|
|
|
38442
38451
|
}
|
|
38443
38452
|
let result = value.map(subEncoder);
|
|
38444
38453
|
if (this._types[subtype]) {
|
|
38445
|
-
result = result.map(keccak256);
|
|
38454
|
+
result = result.map(keccak256$1);
|
|
38446
38455
|
}
|
|
38447
|
-
return keccak256(hexConcat(result));
|
|
38456
|
+
return keccak256$1(hexConcat(result));
|
|
38448
38457
|
};
|
|
38449
38458
|
}
|
|
38450
38459
|
// Struct
|
|
@@ -38455,7 +38464,7 @@
|
|
|
38455
38464
|
const values = fields.map(({ name, type }) => {
|
|
38456
38465
|
const result = this.getEncoder(type)(value[name]);
|
|
38457
38466
|
if (this._types[type]) {
|
|
38458
|
-
return keccak256(result);
|
|
38467
|
+
return keccak256$1(result);
|
|
38459
38468
|
}
|
|
38460
38469
|
return result;
|
|
38461
38470
|
});
|
|
@@ -38476,7 +38485,7 @@
|
|
|
38476
38485
|
return this.getEncoder(type)(value);
|
|
38477
38486
|
}
|
|
38478
38487
|
hashStruct(name, value) {
|
|
38479
|
-
return keccak256(this.encodeData(name, value));
|
|
38488
|
+
return keccak256$1(this.encodeData(name, value));
|
|
38480
38489
|
}
|
|
38481
38490
|
encode(value) {
|
|
38482
38491
|
return this.encodeData(this.primaryType, value);
|
|
@@ -38546,7 +38555,7 @@
|
|
|
38546
38555
|
]);
|
|
38547
38556
|
}
|
|
38548
38557
|
static hash(domain, types, value) {
|
|
38549
|
-
return keccak256(TypedDataEncoder.encode(domain, types, value));
|
|
38558
|
+
return keccak256$1(TypedDataEncoder.encode(domain, types, value));
|
|
38550
38559
|
}
|
|
38551
38560
|
// Replaces all address types with ENS names with their looked up address
|
|
38552
38561
|
static resolveNames(domain, types, value, resolveName) {
|
|
@@ -38754,7 +38763,7 @@
|
|
|
38754
38763
|
return defaultAbiCoder;
|
|
38755
38764
|
}
|
|
38756
38765
|
static getAddress(address) {
|
|
38757
|
-
return getAddress(address);
|
|
38766
|
+
return getAddress$1(address);
|
|
38758
38767
|
}
|
|
38759
38768
|
static getSighash(fragment) {
|
|
38760
38769
|
return hexDataSlice(id(fragment.format()), 0, 4);
|
|
@@ -38999,7 +39008,7 @@
|
|
|
38999
39008
|
return id(value);
|
|
39000
39009
|
}
|
|
39001
39010
|
else if (param.type === "bytes") {
|
|
39002
|
-
return keccak256(hexlify$2(value));
|
|
39011
|
+
return keccak256$1(hexlify$2(value));
|
|
39003
39012
|
}
|
|
39004
39013
|
// Check addresses are valid
|
|
39005
39014
|
if (param.type === "address") {
|
|
@@ -39054,7 +39063,7 @@
|
|
|
39054
39063
|
topics.push(id(value));
|
|
39055
39064
|
}
|
|
39056
39065
|
else if (param.type === "bytes") {
|
|
39057
|
-
topics.push(keccak256(value));
|
|
39066
|
+
topics.push(keccak256$1(value));
|
|
39058
39067
|
}
|
|
39059
39068
|
else if (param.baseType === "tuple" || param.baseType === "array") {
|
|
39060
39069
|
// @TOOD
|
|
@@ -46827,7 +46836,7 @@
|
|
|
46827
46836
|
if (value === "0x") {
|
|
46828
46837
|
return null;
|
|
46829
46838
|
}
|
|
46830
|
-
return getAddress(value);
|
|
46839
|
+
return getAddress$1(value);
|
|
46831
46840
|
}
|
|
46832
46841
|
function handleNumber(value) {
|
|
46833
46842
|
if (value === "0x") {
|
|
@@ -46837,7 +46846,7 @@
|
|
|
46837
46846
|
}
|
|
46838
46847
|
function computeAddress(key) {
|
|
46839
46848
|
const publicKey = computePublicKey(key);
|
|
46840
|
-
return getAddress(hexDataSlice(keccak256(hexDataSlice(publicKey, 1)), 12));
|
|
46849
|
+
return getAddress$1(hexDataSlice(keccak256$1(hexDataSlice(publicKey, 1)), 12));
|
|
46841
46850
|
}
|
|
46842
46851
|
function recoverAddress(digest, signature) {
|
|
46843
46852
|
return computeAddress(recoverPublicKey(arrayify$1(digest), signature));
|
|
@@ -46851,7 +46860,7 @@
|
|
|
46851
46860
|
}
|
|
46852
46861
|
function accessSetify(addr, storageKeys) {
|
|
46853
46862
|
return {
|
|
46854
|
-
address: getAddress(addr),
|
|
46863
|
+
address: getAddress$1(addr),
|
|
46855
46864
|
storageKeys: (storageKeys || []).map((storageKey, index) => {
|
|
46856
46865
|
if (hexDataLength(storageKey) !== 32) {
|
|
46857
46866
|
logger$8.throwArgumentError("invalid access list storageKey", `accessList[${addr}:${index}]`, storageKey);
|
|
@@ -46904,7 +46913,7 @@
|
|
|
46904
46913
|
formatNumber(transaction.maxPriorityFeePerGas || 0, "maxPriorityFeePerGas"),
|
|
46905
46914
|
formatNumber(transaction.maxFeePerGas || 0, "maxFeePerGas"),
|
|
46906
46915
|
formatNumber(transaction.gasLimit || 0, "gasLimit"),
|
|
46907
|
-
((transaction.to != null) ? getAddress(transaction.to) : "0x"),
|
|
46916
|
+
((transaction.to != null) ? getAddress$1(transaction.to) : "0x"),
|
|
46908
46917
|
formatNumber(transaction.value || 0, "value"),
|
|
46909
46918
|
(transaction.data || "0x"),
|
|
46910
46919
|
(formatAccessList(transaction.accessList || []))
|
|
@@ -46923,7 +46932,7 @@
|
|
|
46923
46932
|
formatNumber(transaction.nonce || 0, "nonce"),
|
|
46924
46933
|
formatNumber(transaction.gasPrice || 0, "gasPrice"),
|
|
46925
46934
|
formatNumber(transaction.gasLimit || 0, "gasLimit"),
|
|
46926
|
-
((transaction.to != null) ? getAddress(transaction.to) : "0x"),
|
|
46935
|
+
((transaction.to != null) ? getAddress$1(transaction.to) : "0x"),
|
|
46927
46936
|
formatNumber(transaction.value || 0, "value"),
|
|
46928
46937
|
(transaction.data || "0x"),
|
|
46929
46938
|
(formatAccessList(transaction.accessList || []))
|
|
@@ -46950,7 +46959,7 @@
|
|
|
46950
46959
|
tx.r = hexZeroPad$1(fields[1], 32);
|
|
46951
46960
|
tx.s = hexZeroPad$1(fields[2], 32);
|
|
46952
46961
|
try {
|
|
46953
|
-
const digest = keccak256(serialize(tx));
|
|
46962
|
+
const digest = keccak256$1(serialize(tx));
|
|
46954
46963
|
tx.from = recoverAddress(digest, { r: tx.r, s: tx.s, recoveryParam: tx.v });
|
|
46955
46964
|
}
|
|
46956
46965
|
catch (error) {
|
|
@@ -46981,7 +46990,7 @@
|
|
|
46981
46990
|
if (transaction.length === 9) {
|
|
46982
46991
|
return tx;
|
|
46983
46992
|
}
|
|
46984
|
-
tx.hash = keccak256(payload);
|
|
46993
|
+
tx.hash = keccak256$1(payload);
|
|
46985
46994
|
_parseEipSignature(tx, transaction.slice(9), _serializeEip1559);
|
|
46986
46995
|
return tx;
|
|
46987
46996
|
}
|
|
@@ -47005,7 +47014,7 @@
|
|
|
47005
47014
|
if (transaction.length === 8) {
|
|
47006
47015
|
return tx;
|
|
47007
47016
|
}
|
|
47008
|
-
tx.hash = keccak256(payload);
|
|
47017
|
+
tx.hash = keccak256$1(payload);
|
|
47009
47018
|
_parseEipSignature(tx, transaction.slice(8), _serializeEip2930);
|
|
47010
47019
|
return tx;
|
|
47011
47020
|
}
|
|
@@ -47056,14 +47065,14 @@
|
|
|
47056
47065
|
raw.push("0x");
|
|
47057
47066
|
recoveryParam -= tx.chainId * 2 + 8;
|
|
47058
47067
|
}
|
|
47059
|
-
const digest = keccak256(encode$2(raw));
|
|
47068
|
+
const digest = keccak256$1(encode$2(raw));
|
|
47060
47069
|
try {
|
|
47061
47070
|
tx.from = recoverAddress(digest, { r: hexlify$2(tx.r), s: hexlify$2(tx.s), recoveryParam: recoveryParam });
|
|
47062
47071
|
}
|
|
47063
47072
|
catch (error) {
|
|
47064
47073
|
console.log(error);
|
|
47065
47074
|
}
|
|
47066
|
-
tx.hash = keccak256(rawTransaction);
|
|
47075
|
+
tx.hash = keccak256$1(rawTransaction);
|
|
47067
47076
|
}
|
|
47068
47077
|
tx.type = null;
|
|
47069
47078
|
return tx;
|
|
@@ -47087,7 +47096,7 @@
|
|
|
47087
47096
|
});
|
|
47088
47097
|
}
|
|
47089
47098
|
|
|
47090
|
-
const version$5 = "contracts/5.4.1";
|
|
47099
|
+
const version$5$1 = "contracts/5.4.1";
|
|
47091
47100
|
|
|
47092
47101
|
var __awaiter$4 = function (thisArg, _arguments, P, generator) {
|
|
47093
47102
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -47098,13 +47107,13 @@
|
|
|
47098
47107
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
47099
47108
|
});
|
|
47100
47109
|
};
|
|
47101
|
-
const logger$7 = new Logger$2(version$5);
|
|
47110
|
+
const logger$7 = new Logger$2(version$5$1);
|
|
47102
47111
|
function resolveName(resolver, nameOrPromise) {
|
|
47103
47112
|
return __awaiter$4(this, void 0, void 0, function* () {
|
|
47104
47113
|
const name = yield nameOrPromise;
|
|
47105
47114
|
// If it is already an address, just use it (after adding checksum)
|
|
47106
47115
|
try {
|
|
47107
|
-
return getAddress(name);
|
|
47116
|
+
return getAddress$1(name);
|
|
47108
47117
|
}
|
|
47109
47118
|
catch (error) { }
|
|
47110
47119
|
if (!resolver) {
|
|
@@ -47160,7 +47169,7 @@
|
|
|
47160
47169
|
override: resolveName(contract.signer, overrides.from),
|
|
47161
47170
|
signer: contract.signer.getAddress()
|
|
47162
47171
|
}).then((check) => __awaiter$4(this, void 0, void 0, function* () {
|
|
47163
|
-
if (getAddress(check.signer) !== check.override) {
|
|
47172
|
+
if (getAddress$1(check.signer) !== check.override) {
|
|
47164
47173
|
logger$7.throwError("Contract with a Signer cannot override from", Logger$2.errors.UNSUPPORTED_OPERATION, {
|
|
47165
47174
|
operation: "overrides.from"
|
|
47166
47175
|
});
|
|
@@ -47589,7 +47598,7 @@
|
|
|
47589
47598
|
}
|
|
47590
47599
|
else {
|
|
47591
47600
|
try {
|
|
47592
|
-
defineReadOnly(this, "resolvedAddress", Promise.resolve(getAddress(addressOrName)));
|
|
47601
|
+
defineReadOnly(this, "resolvedAddress", Promise.resolve(getAddress$1(addressOrName)));
|
|
47593
47602
|
}
|
|
47594
47603
|
catch (error) {
|
|
47595
47604
|
// Without a provider, we cannot use ENS names
|
|
@@ -48353,7 +48362,7 @@
|
|
|
48353
48362
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
48354
48363
|
});
|
|
48355
48364
|
};
|
|
48356
|
-
const logger$5 = new Logger$2(version$2$2);
|
|
48365
|
+
const logger$5$1 = new Logger$2(version$2$2);
|
|
48357
48366
|
function staller(duration) {
|
|
48358
48367
|
return new Promise((resolve) => {
|
|
48359
48368
|
setTimeout(resolve, duration);
|
|
@@ -48386,10 +48395,10 @@
|
|
|
48386
48395
|
function _fetchData(connection, body, processFunc) {
|
|
48387
48396
|
// How many times to retry in the event of a throttle
|
|
48388
48397
|
const attemptLimit = (typeof (connection) === "object" && connection.throttleLimit != null) ? connection.throttleLimit : 12;
|
|
48389
|
-
logger$5.assertArgument((attemptLimit > 0 && (attemptLimit % 1) === 0), "invalid connection throttle limit", "connection.throttleLimit", attemptLimit);
|
|
48398
|
+
logger$5$1.assertArgument((attemptLimit > 0 && (attemptLimit % 1) === 0), "invalid connection throttle limit", "connection.throttleLimit", attemptLimit);
|
|
48390
48399
|
const throttleCallback = ((typeof (connection) === "object") ? connection.throttleCallback : null);
|
|
48391
48400
|
const throttleSlotInterval = ((typeof (connection) === "object" && typeof (connection.throttleSlotInterval) === "number") ? connection.throttleSlotInterval : 100);
|
|
48392
|
-
logger$5.assertArgument((throttleSlotInterval > 0 && (throttleSlotInterval % 1) === 0), "invalid connection throttle slot interval", "connection.throttleSlotInterval", throttleSlotInterval);
|
|
48401
|
+
logger$5$1.assertArgument((throttleSlotInterval > 0 && (throttleSlotInterval % 1) === 0), "invalid connection throttle slot interval", "connection.throttleSlotInterval", throttleSlotInterval);
|
|
48393
48402
|
const headers = {};
|
|
48394
48403
|
let url = null;
|
|
48395
48404
|
// @TODO: Allow ConnectionInfo to override some of these values
|
|
@@ -48403,7 +48412,7 @@
|
|
|
48403
48412
|
}
|
|
48404
48413
|
else if (typeof (connection) === "object") {
|
|
48405
48414
|
if (connection == null || connection.url == null) {
|
|
48406
|
-
logger$5.throwArgumentError("missing URL", "connection.url", connection);
|
|
48415
|
+
logger$5$1.throwArgumentError("missing URL", "connection.url", connection);
|
|
48407
48416
|
}
|
|
48408
48417
|
url = connection.url;
|
|
48409
48418
|
if (typeof (connection.timeout) === "number" && connection.timeout > 0) {
|
|
@@ -48420,7 +48429,7 @@
|
|
|
48420
48429
|
options.allowGzip = !!connection.allowGzip;
|
|
48421
48430
|
if (connection.user != null && connection.password != null) {
|
|
48422
48431
|
if (url.substring(0, 6) !== "https:" && connection.allowInsecureAuthentication !== true) {
|
|
48423
|
-
logger$5.throwError("basic authentication requires a secure https url", Logger$2.errors.INVALID_ARGUMENT, { argument: "url", url: url, user: connection.user, password: "[REDACTED]" });
|
|
48432
|
+
logger$5$1.throwError("basic authentication requires a secure https url", Logger$2.errors.INVALID_ARGUMENT, { argument: "url", url: url, user: connection.user, password: "[REDACTED]" });
|
|
48424
48433
|
}
|
|
48425
48434
|
const authorization = connection.user + ":" + connection.password;
|
|
48426
48435
|
headers["authorization"] = {
|
|
@@ -48454,7 +48463,7 @@
|
|
|
48454
48463
|
return;
|
|
48455
48464
|
}
|
|
48456
48465
|
timer = null;
|
|
48457
|
-
reject(logger$5.makeError("timeout", Logger$2.errors.TIMEOUT, {
|
|
48466
|
+
reject(logger$5$1.makeError("timeout", Logger$2.errors.TIMEOUT, {
|
|
48458
48467
|
requestBody: bodyify(options.body, flatHeaders["content-type"]),
|
|
48459
48468
|
requestMethod: options.method,
|
|
48460
48469
|
timeout: timeout,
|
|
@@ -48503,7 +48512,7 @@
|
|
|
48503
48512
|
response = error.response;
|
|
48504
48513
|
if (response == null) {
|
|
48505
48514
|
runningTimeout.cancel();
|
|
48506
|
-
logger$5.throwError("missing response", Logger$2.errors.SERVER_ERROR, {
|
|
48515
|
+
logger$5$1.throwError("missing response", Logger$2.errors.SERVER_ERROR, {
|
|
48507
48516
|
requestBody: bodyify(options.body, flatHeaders["content-type"]),
|
|
48508
48517
|
requestMethod: options.method,
|
|
48509
48518
|
serverError: error,
|
|
@@ -48517,7 +48526,7 @@
|
|
|
48517
48526
|
}
|
|
48518
48527
|
else if (response.statusCode < 200 || response.statusCode >= 300) {
|
|
48519
48528
|
runningTimeout.cancel();
|
|
48520
|
-
logger$5.throwError("bad response", Logger$2.errors.SERVER_ERROR, {
|
|
48529
|
+
logger$5$1.throwError("bad response", Logger$2.errors.SERVER_ERROR, {
|
|
48521
48530
|
status: response.statusCode,
|
|
48522
48531
|
headers: response.headers,
|
|
48523
48532
|
body: bodyify(body, ((response.headers) ? response.headers["content-type"] : null)),
|
|
@@ -48547,7 +48556,7 @@
|
|
|
48547
48556
|
}
|
|
48548
48557
|
}
|
|
48549
48558
|
runningTimeout.cancel();
|
|
48550
|
-
logger$5.throwError("processing response error", Logger$2.errors.SERVER_ERROR, {
|
|
48559
|
+
logger$5$1.throwError("processing response error", Logger$2.errors.SERVER_ERROR, {
|
|
48551
48560
|
body: bodyify(body, ((response.headers) ? response.headers["content-type"] : null)),
|
|
48552
48561
|
error: error,
|
|
48553
48562
|
requestBody: bodyify(options.body, flatHeaders["content-type"]),
|
|
@@ -48561,7 +48570,7 @@
|
|
|
48561
48570
|
// The "body" is now a Uint8Array.
|
|
48562
48571
|
return body;
|
|
48563
48572
|
}
|
|
48564
|
-
return logger$5.throwError("failed response", Logger$2.errors.SERVER_ERROR, {
|
|
48573
|
+
return logger$5$1.throwError("failed response", Logger$2.errors.SERVER_ERROR, {
|
|
48565
48574
|
requestBody: bodyify(options.body, flatHeaders["content-type"]),
|
|
48566
48575
|
requestMethod: options.method,
|
|
48567
48576
|
url: url
|
|
@@ -48578,7 +48587,7 @@
|
|
|
48578
48587
|
result = JSON.parse(toUtf8String(value));
|
|
48579
48588
|
}
|
|
48580
48589
|
catch (error) {
|
|
48581
|
-
logger$5.throwError("invalid JSON", Logger$2.errors.SERVER_ERROR, {
|
|
48590
|
+
logger$5$1.throwError("invalid JSON", Logger$2.errors.SERVER_ERROR, {
|
|
48582
48591
|
body: value,
|
|
48583
48592
|
error: error
|
|
48584
48593
|
});
|
|
@@ -49053,13 +49062,13 @@
|
|
|
49053
49062
|
// Requires an address
|
|
49054
49063
|
// Strict! Used on input.
|
|
49055
49064
|
address(value) {
|
|
49056
|
-
return getAddress(value);
|
|
49065
|
+
return getAddress$1(value);
|
|
49057
49066
|
}
|
|
49058
49067
|
callAddress(value) {
|
|
49059
49068
|
if (!isHexString$2(value, 32)) {
|
|
49060
49069
|
return null;
|
|
49061
49070
|
}
|
|
49062
|
-
const address = getAddress(hexDataSlice(value, 12));
|
|
49071
|
+
const address = getAddress$1(hexDataSlice(value, 12));
|
|
49063
49072
|
return (address === AddressZero) ? null : address;
|
|
49064
49073
|
}
|
|
49065
49074
|
contractAddress(value) {
|
|
@@ -51568,10 +51577,11 @@
|
|
|
51568
51577
|
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; }
|
|
51569
51578
|
class Transaction {
|
|
51570
51579
|
|
|
51571
|
-
constructor({ blockchain, from, to, api, method, params, value, sent, confirmed, ensured, failed }) {
|
|
51580
|
+
constructor({ blockchain, from, nonce, to, api, method, params, value, sent, confirmed, ensured, failed }) {
|
|
51572
51581
|
|
|
51573
51582
|
this.blockchain = blockchain;
|
|
51574
51583
|
this.from = from;
|
|
51584
|
+
this.nonce = nonce;
|
|
51575
51585
|
this.to = to;
|
|
51576
51586
|
this.api = api;
|
|
51577
51587
|
this.method = method;
|
|
@@ -51679,6 +51689,7 @@
|
|
|
51679
51689
|
await executeSubmit$1({ transaction, provider, signer }).then((sentTransaction)=>{
|
|
51680
51690
|
if (sentTransaction) {
|
|
51681
51691
|
transaction.id = sentTransaction.hash;
|
|
51692
|
+
transaction.nonce = sentTransaction.nonce;
|
|
51682
51693
|
transaction.url = Blockchain.findByName(transaction.blockchain).explorerUrlFor({ transaction });
|
|
51683
51694
|
if (transaction.sent) transaction.sent(transaction);
|
|
51684
51695
|
sentTransaction.wait(1).then(() => {
|
|
@@ -51879,6 +51890,7 @@
|
|
|
51879
51890
|
transaction.url = blockchain.explorerUrlFor({ transaction });
|
|
51880
51891
|
if (transaction.sent) transaction.sent(transaction);
|
|
51881
51892
|
let sentTransaction = await retrieveTransaction(tx, transaction.blockchain);
|
|
51893
|
+
transaction.nonce = sentTransaction.nonce;
|
|
51882
51894
|
if(!sentTransaction) {
|
|
51883
51895
|
transaction._failed = true;
|
|
51884
51896
|
console.log('Error retrieving transaction');
|
|
@@ -52166,7 +52178,7 @@
|
|
|
52166
52178
|
return connect(wallet);
|
|
52167
52179
|
}
|
|
52168
52180
|
}, /*#__PURE__*/react.createElement("div", {
|
|
52169
|
-
className: "CardImage
|
|
52181
|
+
className: "CardImage"
|
|
52170
52182
|
}, /*#__PURE__*/react.createElement("img", {
|
|
52171
52183
|
src: wallet.logo
|
|
52172
52184
|
})), /*#__PURE__*/react.createElement("div", {
|
|
@@ -52179,9 +52191,9 @@
|
|
|
52179
52191
|
});
|
|
52180
52192
|
return /*#__PURE__*/react.createElement(Dialog, {
|
|
52181
52193
|
header: /*#__PURE__*/react.createElement("div", {
|
|
52182
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
52194
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
52183
52195
|
}, /*#__PURE__*/react.createElement("h1", {
|
|
52184
|
-
className: "LineHeightL FontSizeL
|
|
52196
|
+
className: "LineHeightL FontSizeL"
|
|
52185
52197
|
}, "Select a wallet")),
|
|
52186
52198
|
body: /*#__PURE__*/react.createElement("div", {
|
|
52187
52199
|
className: "PaddingTopS PaddingBottomXS PaddingLeftS PaddingRightS"
|
|
@@ -52189,11 +52201,13 @@
|
|
|
52189
52201
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
52190
52202
|
className: "PaddingBottomS"
|
|
52191
52203
|
}, /*#__PURE__*/react.createElement("button", {
|
|
52192
|
-
className: "FontSizeS FontWeightBold
|
|
52204
|
+
className: "FontSizeS FontWeightBold TextButton",
|
|
52193
52205
|
onClick: function onClick() {
|
|
52194
52206
|
return setShowExplanation(!showExplanation);
|
|
52195
52207
|
}
|
|
52196
|
-
}, /*#__PURE__*/react.createElement("strong",
|
|
52208
|
+
}, /*#__PURE__*/react.createElement("strong", {
|
|
52209
|
+
className: "Opacity05"
|
|
52210
|
+
}, "What is a wallet?")), showExplanation && /*#__PURE__*/react.createElement("p", {
|
|
52197
52211
|
className: "PaddingLeftM PaddingRightM"
|
|
52198
52212
|
}, "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."))
|
|
52199
52213
|
});
|
|
@@ -52346,6 +52360,9 @@
|
|
|
52346
52360
|
function _createClass$1(Constructor, protoProps, staticProps) {
|
|
52347
52361
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
52348
52362
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
52363
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
52364
|
+
writable: false
|
|
52365
|
+
});
|
|
52349
52366
|
return Constructor;
|
|
52350
52367
|
}
|
|
52351
52368
|
|
|
@@ -52363,12 +52380,15 @@
|
|
|
52363
52380
|
throw new TypeError("Super expression must either be null or a function");
|
|
52364
52381
|
}
|
|
52365
52382
|
|
|
52366
|
-
|
|
52367
|
-
|
|
52368
|
-
|
|
52369
|
-
|
|
52370
|
-
|
|
52371
|
-
|
|
52383
|
+
Object.defineProperty(subClass, "prototype", {
|
|
52384
|
+
value: Object.create(superClass && superClass.prototype, {
|
|
52385
|
+
constructor: {
|
|
52386
|
+
value: subClass,
|
|
52387
|
+
writable: true,
|
|
52388
|
+
configurable: true
|
|
52389
|
+
}
|
|
52390
|
+
}),
|
|
52391
|
+
writable: false
|
|
52372
52392
|
});
|
|
52373
52393
|
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
52374
52394
|
}
|
|
@@ -52471,7 +52491,7 @@
|
|
|
52471
52491
|
})), /*#__PURE__*/react.createElement("div", {
|
|
52472
52492
|
className: "DialogBody"
|
|
52473
52493
|
}, /*#__PURE__*/react.createElement("div", {
|
|
52474
|
-
className: "GraphicWrapper"
|
|
52494
|
+
className: "GraphicWrapper PaddingTopS"
|
|
52475
52495
|
}, /*#__PURE__*/react.createElement("img", {
|
|
52476
52496
|
className: "Graphic",
|
|
52477
52497
|
src: ErrorGraphic
|
|
@@ -52489,15 +52509,12 @@
|
|
|
52489
52509
|
className: "FontSizeM PaddingTopS"
|
|
52490
52510
|
}, "If this keeps happening, please report it.")))), /*#__PURE__*/react.createElement("div", {
|
|
52491
52511
|
className: "DialogFooter"
|
|
52492
|
-
}, /*#__PURE__*/react.createElement("div",
|
|
52512
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
52513
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
52514
|
+
}, /*#__PURE__*/react.createElement("button", {
|
|
52493
52515
|
className: "ButtonPrimary",
|
|
52494
52516
|
onClick: close
|
|
52495
|
-
}, "Try again"))
|
|
52496
|
-
href: 'https://depay.fi?utm_source=' + window.location.hostname + '&utm_medium=widget&utm_campaign=WidgetV2',
|
|
52497
|
-
rel: "noopener noreferrer",
|
|
52498
|
-
target: "_blank",
|
|
52499
|
-
className: "FooterLink"
|
|
52500
|
-
}, "by DePay"))));
|
|
52517
|
+
}, "Try again")))));
|
|
52501
52518
|
} else {
|
|
52502
52519
|
return /*#__PURE__*/react.createElement(ErrorContext.Provider, {
|
|
52503
52520
|
value: {
|
|
@@ -52509,28 +52526,28 @@
|
|
|
52509
52526
|
}
|
|
52510
52527
|
});
|
|
52511
52528
|
|
|
52529
|
+
var BlockchainLogoStyle = (function (style) {
|
|
52530
|
+
return "\n\n .BlockchainLogo {\n border-radius: 999px;\n }\n\n .BlockchainLogo.small {\n height: 18px;\n width: 18px;\n }\n ";
|
|
52531
|
+
});
|
|
52532
|
+
|
|
52512
52533
|
var ButtonCircularStyle = (function () {
|
|
52513
52534
|
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 ";
|
|
52514
52535
|
});
|
|
52515
52536
|
|
|
52516
52537
|
var ButtonPrimaryStyle = (function (style) {
|
|
52517
|
-
return "\n\n .ButtonPrimary {\n align-items: center;\n align-self: center;\n background: ".concat(style.colors.primary, ";\n border-radius:
|
|
52538
|
+
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 ");
|
|
52518
52539
|
});
|
|
52519
52540
|
|
|
52520
52541
|
var CardStyle = (function (style) {
|
|
52521
|
-
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.
|
|
52542
|
+
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 ");
|
|
52522
52543
|
});
|
|
52523
52544
|
|
|
52524
52545
|
var DialogStyle = (function (style) {
|
|
52525
|
-
return "\n\n .ReactDialogBackground {\n background: rgba(0,0,0,0.7);\n }\n\n .Dialog {\n margin: 0 auto;\n position: relative;\n width: 420px;\n box-shadow: 0 0 20px rgba(0,0,0,0.1);\n border-radius: 0.8rem;\n }\n\n @media screen and (max-width: 450px) {\n \n .Dialog, .ReactDialogAnimation {\n width: 100%;\n }\n\n }\n\n @media (orientation: portrait) and (max-width: 900px) {\n\n .Dialog {\n align-content: stretch;\n display: flex;\n flex-direction: column;\n height: 100%;\n }\n\n .DialogBody {\n flex: 1;\n align-items: flex-end;\n max-height: 40vh !important;\n }\n\n .
|
|
52546
|
+
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 ";
|
|
52526
52547
|
});
|
|
52527
52548
|
|
|
52528
52549
|
var FontStyle = (function (style) {
|
|
52529
|
-
return "\n\n
|
|
52530
|
-
});
|
|
52531
|
-
|
|
52532
|
-
var FooterStyle = (function (style) {
|
|
52533
|
-
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 ");
|
|
52550
|
+
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 ");
|
|
52534
52551
|
});
|
|
52535
52552
|
|
|
52536
52553
|
var GraphicStyle = (function () {
|
|
@@ -52542,7 +52559,7 @@
|
|
|
52542
52559
|
});
|
|
52543
52560
|
|
|
52544
52561
|
var IconStyle = (function (style) {
|
|
52545
|
-
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:
|
|
52562
|
+
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 ");
|
|
52546
52563
|
});
|
|
52547
52564
|
|
|
52548
52565
|
var ImageStyle = (function (style) {
|
|
@@ -52561,10 +52578,18 @@
|
|
|
52561
52578
|
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 ");
|
|
52562
52579
|
});
|
|
52563
52580
|
|
|
52581
|
+
var OpacityStyle = (function (style) {
|
|
52582
|
+
return "\n\n .Opacity05 {\n opacity: 0.5;\n }\n ";
|
|
52583
|
+
});
|
|
52584
|
+
|
|
52564
52585
|
var PaddingStyle = (function () {
|
|
52565
52586
|
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 ";
|
|
52566
52587
|
});
|
|
52567
52588
|
|
|
52589
|
+
var PoweredByStyle = (function (style) {
|
|
52590
|
+
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 ");
|
|
52591
|
+
});
|
|
52592
|
+
|
|
52568
52593
|
var RangeSliderStyle = (function (style) {
|
|
52569
52594
|
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 ";
|
|
52570
52595
|
});
|
|
@@ -52574,15 +52599,15 @@
|
|
|
52574
52599
|
});
|
|
52575
52600
|
|
|
52576
52601
|
var SkeletonStyle = (function () {
|
|
52577
|
-
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 ";
|
|
52602
|
+
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 ";
|
|
52578
52603
|
});
|
|
52579
52604
|
|
|
52580
52605
|
var TextButtonStyle = (function (style) {
|
|
52581
|
-
return "\n\n .TextButton {\n cursor: pointer;\n font-size: 16px;\n color: ".concat(style.colors.primary, "\n }\n\n .TextButton
|
|
52606
|
+
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 ");
|
|
52582
52607
|
});
|
|
52583
52608
|
|
|
52584
52609
|
var TextStyle = (function (style) {
|
|
52585
|
-
return "\n\n * {\n color: ".concat(style.colors.text, ";\n }\n\n
|
|
52610
|
+
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 ");
|
|
52586
52611
|
});
|
|
52587
52612
|
|
|
52588
52613
|
var TokenAmountStyle = (function () {
|
|
@@ -52599,7 +52624,7 @@
|
|
|
52599
52624
|
},
|
|
52600
52625
|
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'
|
|
52601
52626
|
}, style);
|
|
52602
|
-
return [ResetStyle(), FontStyle(style), DialogStyle(), ButtonCircularStyle(), ButtonPrimaryStyle(style), CardStyle(style),
|
|
52627
|
+
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('');
|
|
52603
52628
|
});
|
|
52604
52629
|
|
|
52605
52630
|
function _interopDefaultLegacy$2 (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -52719,6 +52744,31 @@
|
|
|
52719
52744
|
return unmount;
|
|
52720
52745
|
});
|
|
52721
52746
|
|
|
52747
|
+
var PoweredBy = (function () {
|
|
52748
|
+
return /*#__PURE__*/react.createElement("div", {
|
|
52749
|
+
className: "PoweredByWrapper"
|
|
52750
|
+
}, /*#__PURE__*/react.createElement("a", {
|
|
52751
|
+
href: 'https://depay.fi?utm_source=' + window.location.hostname + '&utm_medium=widget&utm_campaign=WidgetV2',
|
|
52752
|
+
rel: "noopener noreferrer",
|
|
52753
|
+
target: "_blank",
|
|
52754
|
+
className: "PoweredByLink"
|
|
52755
|
+
}, "by DePay"));
|
|
52756
|
+
});
|
|
52757
|
+
|
|
52758
|
+
var UpdatableProvider = (function (props) {
|
|
52759
|
+
var _useState = react.useState(true),
|
|
52760
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
52761
|
+
updatable = _useState2[0],
|
|
52762
|
+
setUpdatable = _useState2[1];
|
|
52763
|
+
|
|
52764
|
+
return /*#__PURE__*/react.createElement(UpdatableContext.Provider, {
|
|
52765
|
+
value: {
|
|
52766
|
+
updatable: updatable,
|
|
52767
|
+
setUpdatable: setUpdatable
|
|
52768
|
+
}
|
|
52769
|
+
}, props.children);
|
|
52770
|
+
});
|
|
52771
|
+
|
|
52722
52772
|
var Connect = function Connect(options) {
|
|
52723
52773
|
var style, error, document;
|
|
52724
52774
|
|
|
@@ -52774,7 +52824,7 @@
|
|
|
52774
52824
|
error: error,
|
|
52775
52825
|
container: container,
|
|
52776
52826
|
unmount: unmount
|
|
52777
|
-
}, /*#__PURE__*/react.createElement(ClosableProvider, {
|
|
52827
|
+
}, /*#__PURE__*/react.createElement(UpdatableProvider, null, /*#__PURE__*/react.createElement(ClosableProvider, {
|
|
52778
52828
|
unmount: rejectBeforeUnmount
|
|
52779
52829
|
}, /*#__PURE__*/react.createElement(ConnectStack, {
|
|
52780
52830
|
document: document,
|
|
@@ -52782,7 +52832,7 @@
|
|
|
52782
52832
|
resolve: resolve,
|
|
52783
52833
|
reject: reject,
|
|
52784
52834
|
autoClose: true
|
|
52785
|
-
})));
|
|
52835
|
+
}), /*#__PURE__*/react.createElement(PoweredBy, null))));
|
|
52786
52836
|
};
|
|
52787
52837
|
});
|
|
52788
52838
|
|
|
@@ -53006,7 +53056,7 @@
|
|
|
53006
53056
|
|
|
53007
53057
|
BASE = 1e7,
|
|
53008
53058
|
LOG_BASE = 7,
|
|
53009
|
-
MAX_SAFE_INTEGER = 9007199254740991,
|
|
53059
|
+
MAX_SAFE_INTEGER$1 = 9007199254740991,
|
|
53010
53060
|
|
|
53011
53061
|
LN10_PRECISION = LN10.length - 1,
|
|
53012
53062
|
PI_PRECISION = PI.length - 1,
|
|
@@ -55176,7 +55226,7 @@
|
|
|
55176
55226
|
e = mathfloor(y.e / LOG_BASE);
|
|
55177
55227
|
|
|
55178
55228
|
// If y is a small integer use the 'exponentiation by squaring' algorithm.
|
|
55179
|
-
if (e >= y.d.length - 1 && (k = yn < 0 ? -yn : yn) <= MAX_SAFE_INTEGER) {
|
|
55229
|
+
if (e >= y.d.length - 1 && (k = yn < 0 ? -yn : yn) <= MAX_SAFE_INTEGER$1) {
|
|
55180
55230
|
r = intPow(Ctor, x, k, pr);
|
|
55181
55231
|
return y.s < 0 ? new Ctor(1).div(r) : finalise(r, pr, rm);
|
|
55182
55232
|
}
|
|
@@ -57310,7 +57360,7 @@
|
|
|
57310
57360
|
Decimal.hypot = hypot; // ES6
|
|
57311
57361
|
Decimal.ln = ln;
|
|
57312
57362
|
Decimal.log = log;
|
|
57313
|
-
Decimal.log10 = log10; // ES6
|
|
57363
|
+
Decimal.log10 = log10$1; // ES6
|
|
57314
57364
|
Decimal.log2 = log2; // ES6
|
|
57315
57365
|
Decimal.max = max;
|
|
57316
57366
|
Decimal.min = min;
|
|
@@ -57469,7 +57519,7 @@
|
|
|
57469
57519
|
* x {number|string|Decimal}
|
|
57470
57520
|
*
|
|
57471
57521
|
*/
|
|
57472
|
-
function log10(x) {
|
|
57522
|
+
function log10$1(x) {
|
|
57473
57523
|
return new this(x).log(10);
|
|
57474
57524
|
}
|
|
57475
57525
|
|
|
@@ -58303,7 +58353,7 @@
|
|
|
58303
58353
|
|
|
58304
58354
|
constructor({ blockchain, address }) {
|
|
58305
58355
|
this.blockchain = blockchain;
|
|
58306
|
-
this.address = getAddress$
|
|
58356
|
+
this.address = getAddress$3(address);
|
|
58307
58357
|
}
|
|
58308
58358
|
|
|
58309
58359
|
async decimals() {
|
|
@@ -62101,7 +62151,7 @@
|
|
|
62101
62151
|
})(module, commonjsGlobal$1);
|
|
62102
62152
|
});
|
|
62103
62153
|
|
|
62104
|
-
const version$
|
|
62154
|
+
const version$4 = "logger/5.4.1";
|
|
62105
62155
|
|
|
62106
62156
|
let _permanentCensorErrors$1 = false;
|
|
62107
62157
|
let _censorErrors$1 = false;
|
|
@@ -62377,7 +62427,7 @@
|
|
|
62377
62427
|
}
|
|
62378
62428
|
static globalLogger() {
|
|
62379
62429
|
if (!_globalLogger$1) {
|
|
62380
|
-
_globalLogger$1 = new Logger$1(version$
|
|
62430
|
+
_globalLogger$1 = new Logger$1(version$4);
|
|
62381
62431
|
}
|
|
62382
62432
|
return _globalLogger$1;
|
|
62383
62433
|
}
|
|
@@ -62413,9 +62463,9 @@
|
|
|
62413
62463
|
Logger$1.errors = ErrorCode$1;
|
|
62414
62464
|
Logger$1.levels = LogLevel$1;
|
|
62415
62465
|
|
|
62416
|
-
const version$
|
|
62466
|
+
const version$3 = "bytes/5.4.0";
|
|
62417
62467
|
|
|
62418
|
-
const logger$
|
|
62468
|
+
const logger$4 = new Logger$1(version$3);
|
|
62419
62469
|
///////////////////////////////
|
|
62420
62470
|
function isHexable$1(value) {
|
|
62421
62471
|
return !!(value.toHexString);
|
|
@@ -62456,7 +62506,7 @@
|
|
|
62456
62506
|
options = {};
|
|
62457
62507
|
}
|
|
62458
62508
|
if (typeof (value) === "number") {
|
|
62459
|
-
logger$
|
|
62509
|
+
logger$4.checkSafeUint53(value, "invalid arrayify value");
|
|
62460
62510
|
const result = [];
|
|
62461
62511
|
while (value) {
|
|
62462
62512
|
result.unshift(value & 0xff);
|
|
@@ -62483,7 +62533,7 @@
|
|
|
62483
62533
|
hex += "0";
|
|
62484
62534
|
}
|
|
62485
62535
|
else {
|
|
62486
|
-
logger$
|
|
62536
|
+
logger$4.throwArgumentError("hex data is odd-length", "value", value);
|
|
62487
62537
|
}
|
|
62488
62538
|
}
|
|
62489
62539
|
const result = [];
|
|
@@ -62495,7 +62545,7 @@
|
|
|
62495
62545
|
if (isBytes$1(value)) {
|
|
62496
62546
|
return addSlice(new Uint8Array(value));
|
|
62497
62547
|
}
|
|
62498
|
-
return logger$
|
|
62548
|
+
return logger$4.throwArgumentError("invalid arrayify value", "value", value);
|
|
62499
62549
|
}
|
|
62500
62550
|
function isHexString$1(value, length) {
|
|
62501
62551
|
if (typeof (value) !== "string" || !value.match(/^0x[0-9A-Fa-f]*$/)) {
|
|
@@ -62512,7 +62562,7 @@
|
|
|
62512
62562
|
options = {};
|
|
62513
62563
|
}
|
|
62514
62564
|
if (typeof (value) === "number") {
|
|
62515
|
-
logger$
|
|
62565
|
+
logger$4.checkSafeUint53(value, "invalid hexlify value");
|
|
62516
62566
|
let hex = "";
|
|
62517
62567
|
while (value) {
|
|
62518
62568
|
hex = HexCharacters$1[value & 0xf] + hex;
|
|
@@ -62548,7 +62598,7 @@
|
|
|
62548
62598
|
value += "0";
|
|
62549
62599
|
}
|
|
62550
62600
|
else {
|
|
62551
|
-
logger$
|
|
62601
|
+
logger$4.throwArgumentError("hex data is odd-length", "value", value);
|
|
62552
62602
|
}
|
|
62553
62603
|
}
|
|
62554
62604
|
return value.toLowerCase();
|
|
@@ -62561,17 +62611,17 @@
|
|
|
62561
62611
|
}
|
|
62562
62612
|
return result;
|
|
62563
62613
|
}
|
|
62564
|
-
return logger$
|
|
62614
|
+
return logger$4.throwArgumentError("invalid hexlify value", "value", value);
|
|
62565
62615
|
}
|
|
62566
62616
|
function hexZeroPad(value, length) {
|
|
62567
62617
|
if (typeof (value) !== "string") {
|
|
62568
62618
|
value = hexlify$1(value);
|
|
62569
62619
|
}
|
|
62570
62620
|
else if (!isHexString$1(value)) {
|
|
62571
|
-
logger$
|
|
62621
|
+
logger$4.throwArgumentError("invalid hex string", "value", value);
|
|
62572
62622
|
}
|
|
62573
62623
|
if (value.length > 2 * length + 2) {
|
|
62574
|
-
logger$
|
|
62624
|
+
logger$4.throwArgumentError("value out of range", "value", arguments[1]);
|
|
62575
62625
|
}
|
|
62576
62626
|
while (value.length < 2 * length + 2) {
|
|
62577
62627
|
value = "0x0" + value.substring(2);
|
|
@@ -62579,10 +62629,10 @@
|
|
|
62579
62629
|
return value;
|
|
62580
62630
|
}
|
|
62581
62631
|
|
|
62582
|
-
const version$
|
|
62632
|
+
const version$2$1 = "bignumber/5.4.1";
|
|
62583
62633
|
|
|
62584
62634
|
var BN$1 = bn$1.BN;
|
|
62585
|
-
const logger$
|
|
62635
|
+
const logger$3 = new Logger$1(version$2$1);
|
|
62586
62636
|
const _constructorGuard$1 = {};
|
|
62587
62637
|
const MAX_SAFE$1 = 0x1fffffffffffff;
|
|
62588
62638
|
function isBigNumberish(value) {
|
|
@@ -62597,9 +62647,9 @@
|
|
|
62597
62647
|
let _warnedToStringRadix$1 = false;
|
|
62598
62648
|
class BigNumber$1 {
|
|
62599
62649
|
constructor(constructorGuard, hex) {
|
|
62600
|
-
logger$
|
|
62650
|
+
logger$3.checkNew(new.target, BigNumber$1);
|
|
62601
62651
|
if (constructorGuard !== _constructorGuard$1) {
|
|
62602
|
-
logger$
|
|
62652
|
+
logger$3.throwError("cannot call constructor directly; use BigNumber.from", Logger$1.errors.UNSUPPORTED_OPERATION, {
|
|
62603
62653
|
operation: "new (BigNumber)"
|
|
62604
62654
|
});
|
|
62605
62655
|
}
|
|
@@ -62723,7 +62773,7 @@
|
|
|
62723
62773
|
return BigInt(this.toString());
|
|
62724
62774
|
}
|
|
62725
62775
|
catch (e) { }
|
|
62726
|
-
return logger$
|
|
62776
|
+
return logger$3.throwError("this platform does not support BigInt", Logger$1.errors.UNSUPPORTED_OPERATION, {
|
|
62727
62777
|
value: this.toString()
|
|
62728
62778
|
});
|
|
62729
62779
|
}
|
|
@@ -62733,14 +62783,14 @@
|
|
|
62733
62783
|
if (arguments[0] === 10) {
|
|
62734
62784
|
if (!_warnedToStringRadix$1) {
|
|
62735
62785
|
_warnedToStringRadix$1 = true;
|
|
62736
|
-
logger$
|
|
62786
|
+
logger$3.warn("BigNumber.toString does not accept any parameters; base-10 is assumed");
|
|
62737
62787
|
}
|
|
62738
62788
|
}
|
|
62739
62789
|
else if (arguments[0] === 16) {
|
|
62740
|
-
logger$
|
|
62790
|
+
logger$3.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()", Logger$1.errors.UNEXPECTED_ARGUMENT, {});
|
|
62741
62791
|
}
|
|
62742
62792
|
else {
|
|
62743
|
-
logger$
|
|
62793
|
+
logger$3.throwError("BigNumber.toString does not accept parameters", Logger$1.errors.UNEXPECTED_ARGUMENT, {});
|
|
62744
62794
|
}
|
|
62745
62795
|
}
|
|
62746
62796
|
return toBN$1(this).toString(10);
|
|
@@ -62762,7 +62812,7 @@
|
|
|
62762
62812
|
if (value.match(/^-?[0-9]+$/)) {
|
|
62763
62813
|
return new BigNumber$1(_constructorGuard$1, toHex$1(new BN$1(value)));
|
|
62764
62814
|
}
|
|
62765
|
-
return logger$
|
|
62815
|
+
return logger$3.throwArgumentError("invalid BigNumber string", "value", value);
|
|
62766
62816
|
}
|
|
62767
62817
|
if (typeof (value) === "number") {
|
|
62768
62818
|
if (value % 1) {
|
|
@@ -62802,7 +62852,7 @@
|
|
|
62802
62852
|
}
|
|
62803
62853
|
}
|
|
62804
62854
|
}
|
|
62805
|
-
return logger$
|
|
62855
|
+
return logger$3.throwArgumentError("invalid BigNumber value", "value", value);
|
|
62806
62856
|
}
|
|
62807
62857
|
static isBigNumber(value) {
|
|
62808
62858
|
return !!(value && value._isBigNumber);
|
|
@@ -62820,7 +62870,7 @@
|
|
|
62820
62870
|
value = value.substring(1);
|
|
62821
62871
|
// Cannot have mulitple negative signs (e.g. "--0x04")
|
|
62822
62872
|
if (value[0] === "-") {
|
|
62823
|
-
logger$
|
|
62873
|
+
logger$3.throwArgumentError("invalid hex", "value", value);
|
|
62824
62874
|
}
|
|
62825
62875
|
// Call toHex on the positive component
|
|
62826
62876
|
value = toHex$1(value);
|
|
@@ -62864,10 +62914,14 @@
|
|
|
62864
62914
|
if (value != null) {
|
|
62865
62915
|
params.value = value;
|
|
62866
62916
|
}
|
|
62867
|
-
return logger$
|
|
62917
|
+
return logger$3.throwError(fault, Logger$1.errors.NUMERIC_FAULT, params);
|
|
62918
|
+
}
|
|
62919
|
+
// value should have no prefix
|
|
62920
|
+
function _base36To16(value) {
|
|
62921
|
+
return (new BN$1(value, 36)).toString(16);
|
|
62868
62922
|
}
|
|
62869
62923
|
|
|
62870
|
-
const logger$
|
|
62924
|
+
const logger$2 = new Logger$1(version$2$1);
|
|
62871
62925
|
const _constructorGuard$2 = {};
|
|
62872
62926
|
const Zero = BigNumber$1.from(0);
|
|
62873
62927
|
const NegativeOne = BigNumber$1.from(-1);
|
|
@@ -62876,7 +62930,7 @@
|
|
|
62876
62930
|
if (value !== undefined) {
|
|
62877
62931
|
params.value = value;
|
|
62878
62932
|
}
|
|
62879
|
-
return logger$
|
|
62933
|
+
return logger$2.throwError(message, Logger$1.errors.NUMERIC_FAULT, params);
|
|
62880
62934
|
}
|
|
62881
62935
|
// Constant to pull zeros from for multipliers
|
|
62882
62936
|
let zeros = "0";
|
|
@@ -62894,7 +62948,7 @@
|
|
|
62894
62948
|
if (typeof (decimals) === "number" && decimals >= 0 && decimals <= 256 && !(decimals % 1)) {
|
|
62895
62949
|
return ("1" + zeros.substring(0, decimals));
|
|
62896
62950
|
}
|
|
62897
|
-
return logger$
|
|
62951
|
+
return logger$2.throwArgumentError("invalid decimal size", "decimals", decimals);
|
|
62898
62952
|
}
|
|
62899
62953
|
function formatFixed(value, decimals) {
|
|
62900
62954
|
if (decimals == null) {
|
|
@@ -62931,7 +62985,7 @@
|
|
|
62931
62985
|
}
|
|
62932
62986
|
const multiplier = getMultiplier(decimals);
|
|
62933
62987
|
if (typeof (value) !== "string" || !value.match(/^-?[0-9.,]+$/)) {
|
|
62934
|
-
logger$
|
|
62988
|
+
logger$2.throwArgumentError("invalid decimal value", "value", value);
|
|
62935
62989
|
}
|
|
62936
62990
|
// Is it negative?
|
|
62937
62991
|
const negative = (value.substring(0, 1) === "-");
|
|
@@ -62939,12 +62993,12 @@
|
|
|
62939
62993
|
value = value.substring(1);
|
|
62940
62994
|
}
|
|
62941
62995
|
if (value === ".") {
|
|
62942
|
-
logger$
|
|
62996
|
+
logger$2.throwArgumentError("missing value", "value", value);
|
|
62943
62997
|
}
|
|
62944
62998
|
// Split it into a whole and fractional part
|
|
62945
62999
|
const comps = value.split(".");
|
|
62946
63000
|
if (comps.length > 2) {
|
|
62947
|
-
logger$
|
|
63001
|
+
logger$2.throwArgumentError("too many decimal points", "value", value);
|
|
62948
63002
|
}
|
|
62949
63003
|
let whole = comps[0], fraction = comps[1];
|
|
62950
63004
|
if (!whole) {
|
|
@@ -62975,7 +63029,7 @@
|
|
|
62975
63029
|
class FixedFormat {
|
|
62976
63030
|
constructor(constructorGuard, signed, width, decimals) {
|
|
62977
63031
|
if (constructorGuard !== _constructorGuard$2) {
|
|
62978
|
-
logger$
|
|
63032
|
+
logger$2.throwError("cannot use FixedFormat constructor; use FixedFormat.from", Logger$1.errors.UNSUPPORTED_OPERATION, {
|
|
62979
63033
|
operation: "new FixedFormat"
|
|
62980
63034
|
});
|
|
62981
63035
|
}
|
|
@@ -63004,7 +63058,7 @@
|
|
|
63004
63058
|
else {
|
|
63005
63059
|
const match = value.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);
|
|
63006
63060
|
if (!match) {
|
|
63007
|
-
logger$
|
|
63061
|
+
logger$2.throwArgumentError("invalid fixed format", "format", value);
|
|
63008
63062
|
}
|
|
63009
63063
|
signed = (match[1] !== "u");
|
|
63010
63064
|
width = parseInt(match[2]);
|
|
@@ -63017,7 +63071,7 @@
|
|
|
63017
63071
|
return defaultValue;
|
|
63018
63072
|
}
|
|
63019
63073
|
if (typeof (value[key]) !== type) {
|
|
63020
|
-
logger$
|
|
63074
|
+
logger$2.throwArgumentError("invalid fixed format (" + key + " not " + type + ")", "format." + key, value[key]);
|
|
63021
63075
|
}
|
|
63022
63076
|
return value[key];
|
|
63023
63077
|
};
|
|
@@ -63026,19 +63080,19 @@
|
|
|
63026
63080
|
decimals = check("decimals", "number", decimals);
|
|
63027
63081
|
}
|
|
63028
63082
|
if (width % 8) {
|
|
63029
|
-
logger$
|
|
63083
|
+
logger$2.throwArgumentError("invalid fixed format width (not byte aligned)", "format.width", width);
|
|
63030
63084
|
}
|
|
63031
63085
|
if (decimals > 80) {
|
|
63032
|
-
logger$
|
|
63086
|
+
logger$2.throwArgumentError("invalid fixed format (decimals too large)", "format.decimals", decimals);
|
|
63033
63087
|
}
|
|
63034
63088
|
return new FixedFormat(_constructorGuard$2, signed, width, decimals);
|
|
63035
63089
|
}
|
|
63036
63090
|
}
|
|
63037
63091
|
class FixedNumber {
|
|
63038
63092
|
constructor(constructorGuard, hex, value, format) {
|
|
63039
|
-
logger$
|
|
63093
|
+
logger$2.checkNew(new.target, FixedNumber);
|
|
63040
63094
|
if (constructorGuard !== _constructorGuard$2) {
|
|
63041
|
-
logger$
|
|
63095
|
+
logger$2.throwError("cannot use FixedNumber constructor; use FixedNumber.from", Logger$1.errors.UNSUPPORTED_OPERATION, {
|
|
63042
63096
|
operation: "new FixedFormat"
|
|
63043
63097
|
});
|
|
63044
63098
|
}
|
|
@@ -63050,7 +63104,7 @@
|
|
|
63050
63104
|
}
|
|
63051
63105
|
_checkFormat(other) {
|
|
63052
63106
|
if (this.format.name !== other.format.name) {
|
|
63053
|
-
logger$
|
|
63107
|
+
logger$2.throwArgumentError("incompatible format; use fixedNumber.toFormat", "other", other);
|
|
63054
63108
|
}
|
|
63055
63109
|
}
|
|
63056
63110
|
addUnsafe(other) {
|
|
@@ -63112,7 +63166,7 @@
|
|
|
63112
63166
|
comps.push("0");
|
|
63113
63167
|
}
|
|
63114
63168
|
if (decimals < 0 || decimals > 80 || (decimals % 1)) {
|
|
63115
|
-
logger$
|
|
63169
|
+
logger$2.throwArgumentError("invalid decimal count", "decimals", decimals);
|
|
63116
63170
|
}
|
|
63117
63171
|
if (comps[1].length <= decimals) {
|
|
63118
63172
|
return this;
|
|
@@ -63133,7 +63187,7 @@
|
|
|
63133
63187
|
return this._hex;
|
|
63134
63188
|
}
|
|
63135
63189
|
if (width % 8) {
|
|
63136
|
-
logger$
|
|
63190
|
+
logger$2.throwArgumentError("invalid byte width", "width", width);
|
|
63137
63191
|
}
|
|
63138
63192
|
const hex = BigNumber$1.from(this._hex).fromTwos(this.format.width).toTwos(width).toHexString();
|
|
63139
63193
|
return hexZeroPad(hex, width / 8);
|
|
@@ -63208,7 +63262,7 @@
|
|
|
63208
63262
|
throw error;
|
|
63209
63263
|
}
|
|
63210
63264
|
}
|
|
63211
|
-
return logger$
|
|
63265
|
+
return logger$2.throwArgumentError("invalid FixedNumber value", "value", value);
|
|
63212
63266
|
}
|
|
63213
63267
|
static isFixedNumber(value) {
|
|
63214
63268
|
return !!(value && value._isFixedNumber);
|
|
@@ -63217,9 +63271,585 @@
|
|
|
63217
63271
|
const ONE = FixedNumber.from(1);
|
|
63218
63272
|
const BUMP = FixedNumber.from("0.5");
|
|
63219
63273
|
|
|
63220
|
-
|
|
63274
|
+
/**
|
|
63275
|
+
* [js-sha3]{@link https://github.com/emn178/js-sha3}
|
|
63276
|
+
*
|
|
63277
|
+
* @version 0.5.7
|
|
63278
|
+
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
|
63279
|
+
* @copyright Chen, Yi-Cyuan 2015-2016
|
|
63280
|
+
* @license MIT
|
|
63281
|
+
*/
|
|
63282
|
+
|
|
63283
|
+
var sha3 = createCommonjsModule$1(function (module) {
|
|
63284
|
+
/*jslint bitwise: true */
|
|
63285
|
+
(function () {
|
|
63286
|
+
|
|
63287
|
+
var root = typeof window === 'object' ? window : {};
|
|
63288
|
+
var NODE_JS = !root.JS_SHA3_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node;
|
|
63289
|
+
if (NODE_JS) {
|
|
63290
|
+
root = commonjsGlobal$1;
|
|
63291
|
+
}
|
|
63292
|
+
var COMMON_JS = !root.JS_SHA3_NO_COMMON_JS && 'object' === 'object' && module.exports;
|
|
63293
|
+
var HEX_CHARS = '0123456789abcdef'.split('');
|
|
63294
|
+
var SHAKE_PADDING = [31, 7936, 2031616, 520093696];
|
|
63295
|
+
var KECCAK_PADDING = [1, 256, 65536, 16777216];
|
|
63296
|
+
var PADDING = [6, 1536, 393216, 100663296];
|
|
63297
|
+
var SHIFT = [0, 8, 16, 24];
|
|
63298
|
+
var RC = [1, 0, 32898, 0, 32906, 2147483648, 2147516416, 2147483648, 32907, 0, 2147483649,
|
|
63299
|
+
0, 2147516545, 2147483648, 32777, 2147483648, 138, 0, 136, 0, 2147516425, 0,
|
|
63300
|
+
2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, 2147483648, 32771,
|
|
63301
|
+
2147483648, 32770, 2147483648, 128, 2147483648, 32778, 0, 2147483658, 2147483648,
|
|
63302
|
+
2147516545, 2147483648, 32896, 2147483648, 2147483649, 0, 2147516424, 2147483648];
|
|
63303
|
+
var BITS = [224, 256, 384, 512];
|
|
63304
|
+
var SHAKE_BITS = [128, 256];
|
|
63305
|
+
var OUTPUT_TYPES = ['hex', 'buffer', 'arrayBuffer', 'array'];
|
|
63306
|
+
|
|
63307
|
+
var createOutputMethod = function (bits, padding, outputType) {
|
|
63308
|
+
return function (message) {
|
|
63309
|
+
return new Keccak(bits, padding, bits).update(message)[outputType]();
|
|
63310
|
+
};
|
|
63311
|
+
};
|
|
63312
|
+
|
|
63313
|
+
var createShakeOutputMethod = function (bits, padding, outputType) {
|
|
63314
|
+
return function (message, outputBits) {
|
|
63315
|
+
return new Keccak(bits, padding, outputBits).update(message)[outputType]();
|
|
63316
|
+
};
|
|
63317
|
+
};
|
|
63318
|
+
|
|
63319
|
+
var createMethod = function (bits, padding) {
|
|
63320
|
+
var method = createOutputMethod(bits, padding, 'hex');
|
|
63321
|
+
method.create = function () {
|
|
63322
|
+
return new Keccak(bits, padding, bits);
|
|
63323
|
+
};
|
|
63324
|
+
method.update = function (message) {
|
|
63325
|
+
return method.create().update(message);
|
|
63326
|
+
};
|
|
63327
|
+
for (var i = 0; i < OUTPUT_TYPES.length; ++i) {
|
|
63328
|
+
var type = OUTPUT_TYPES[i];
|
|
63329
|
+
method[type] = createOutputMethod(bits, padding, type);
|
|
63330
|
+
}
|
|
63331
|
+
return method;
|
|
63332
|
+
};
|
|
63333
|
+
|
|
63334
|
+
var createShakeMethod = function (bits, padding) {
|
|
63335
|
+
var method = createShakeOutputMethod(bits, padding, 'hex');
|
|
63336
|
+
method.create = function (outputBits) {
|
|
63337
|
+
return new Keccak(bits, padding, outputBits);
|
|
63338
|
+
};
|
|
63339
|
+
method.update = function (message, outputBits) {
|
|
63340
|
+
return method.create(outputBits).update(message);
|
|
63341
|
+
};
|
|
63342
|
+
for (var i = 0; i < OUTPUT_TYPES.length; ++i) {
|
|
63343
|
+
var type = OUTPUT_TYPES[i];
|
|
63344
|
+
method[type] = createShakeOutputMethod(bits, padding, type);
|
|
63345
|
+
}
|
|
63346
|
+
return method;
|
|
63347
|
+
};
|
|
63348
|
+
|
|
63349
|
+
var algorithms = [
|
|
63350
|
+
{name: 'keccak', padding: KECCAK_PADDING, bits: BITS, createMethod: createMethod},
|
|
63351
|
+
{name: 'sha3', padding: PADDING, bits: BITS, createMethod: createMethod},
|
|
63352
|
+
{name: 'shake', padding: SHAKE_PADDING, bits: SHAKE_BITS, createMethod: createShakeMethod}
|
|
63353
|
+
];
|
|
63354
|
+
|
|
63355
|
+
var methods = {}, methodNames = [];
|
|
63356
|
+
|
|
63357
|
+
for (var i = 0; i < algorithms.length; ++i) {
|
|
63358
|
+
var algorithm = algorithms[i];
|
|
63359
|
+
var bits = algorithm.bits;
|
|
63360
|
+
for (var j = 0; j < bits.length; ++j) {
|
|
63361
|
+
var methodName = algorithm.name +'_' + bits[j];
|
|
63362
|
+
methodNames.push(methodName);
|
|
63363
|
+
methods[methodName] = algorithm.createMethod(bits[j], algorithm.padding);
|
|
63364
|
+
}
|
|
63365
|
+
}
|
|
63366
|
+
|
|
63367
|
+
function Keccak(bits, padding, outputBits) {
|
|
63368
|
+
this.blocks = [];
|
|
63369
|
+
this.s = [];
|
|
63370
|
+
this.padding = padding;
|
|
63371
|
+
this.outputBits = outputBits;
|
|
63372
|
+
this.reset = true;
|
|
63373
|
+
this.block = 0;
|
|
63374
|
+
this.start = 0;
|
|
63375
|
+
this.blockCount = (1600 - (bits << 1)) >> 5;
|
|
63376
|
+
this.byteCount = this.blockCount << 2;
|
|
63377
|
+
this.outputBlocks = outputBits >> 5;
|
|
63378
|
+
this.extraBytes = (outputBits & 31) >> 3;
|
|
63379
|
+
|
|
63380
|
+
for (var i = 0; i < 50; ++i) {
|
|
63381
|
+
this.s[i] = 0;
|
|
63382
|
+
}
|
|
63383
|
+
}
|
|
63384
|
+
|
|
63385
|
+
Keccak.prototype.update = function (message) {
|
|
63386
|
+
var notString = typeof message !== 'string';
|
|
63387
|
+
if (notString && message.constructor === ArrayBuffer) {
|
|
63388
|
+
message = new Uint8Array(message);
|
|
63389
|
+
}
|
|
63390
|
+
var length = message.length, blocks = this.blocks, byteCount = this.byteCount,
|
|
63391
|
+
blockCount = this.blockCount, index = 0, s = this.s, i, code;
|
|
63392
|
+
|
|
63393
|
+
while (index < length) {
|
|
63394
|
+
if (this.reset) {
|
|
63395
|
+
this.reset = false;
|
|
63396
|
+
blocks[0] = this.block;
|
|
63397
|
+
for (i = 1; i < blockCount + 1; ++i) {
|
|
63398
|
+
blocks[i] = 0;
|
|
63399
|
+
}
|
|
63400
|
+
}
|
|
63401
|
+
if (notString) {
|
|
63402
|
+
for (i = this.start; index < length && i < byteCount; ++index) {
|
|
63403
|
+
blocks[i >> 2] |= message[index] << SHIFT[i++ & 3];
|
|
63404
|
+
}
|
|
63405
|
+
} else {
|
|
63406
|
+
for (i = this.start; index < length && i < byteCount; ++index) {
|
|
63407
|
+
code = message.charCodeAt(index);
|
|
63408
|
+
if (code < 0x80) {
|
|
63409
|
+
blocks[i >> 2] |= code << SHIFT[i++ & 3];
|
|
63410
|
+
} else if (code < 0x800) {
|
|
63411
|
+
blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3];
|
|
63412
|
+
blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
|
|
63413
|
+
} else if (code < 0xd800 || code >= 0xe000) {
|
|
63414
|
+
blocks[i >> 2] |= (0xe0 | (code >> 12)) << 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
|
+
} else {
|
|
63418
|
+
code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));
|
|
63419
|
+
blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3];
|
|
63420
|
+
blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3];
|
|
63421
|
+
blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];
|
|
63422
|
+
blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
|
|
63423
|
+
}
|
|
63424
|
+
}
|
|
63425
|
+
}
|
|
63426
|
+
this.lastByteIndex = i;
|
|
63427
|
+
if (i >= byteCount) {
|
|
63428
|
+
this.start = i - byteCount;
|
|
63429
|
+
this.block = blocks[blockCount];
|
|
63430
|
+
for (i = 0; i < blockCount; ++i) {
|
|
63431
|
+
s[i] ^= blocks[i];
|
|
63432
|
+
}
|
|
63433
|
+
f(s);
|
|
63434
|
+
this.reset = true;
|
|
63435
|
+
} else {
|
|
63436
|
+
this.start = i;
|
|
63437
|
+
}
|
|
63438
|
+
}
|
|
63439
|
+
return this;
|
|
63440
|
+
};
|
|
63441
|
+
|
|
63442
|
+
Keccak.prototype.finalize = function () {
|
|
63443
|
+
var blocks = this.blocks, i = this.lastByteIndex, blockCount = this.blockCount, s = this.s;
|
|
63444
|
+
blocks[i >> 2] |= this.padding[i & 3];
|
|
63445
|
+
if (this.lastByteIndex === this.byteCount) {
|
|
63446
|
+
blocks[0] = blocks[blockCount];
|
|
63447
|
+
for (i = 1; i < blockCount + 1; ++i) {
|
|
63448
|
+
blocks[i] = 0;
|
|
63449
|
+
}
|
|
63450
|
+
}
|
|
63451
|
+
blocks[blockCount - 1] |= 0x80000000;
|
|
63452
|
+
for (i = 0; i < blockCount; ++i) {
|
|
63453
|
+
s[i] ^= blocks[i];
|
|
63454
|
+
}
|
|
63455
|
+
f(s);
|
|
63456
|
+
};
|
|
63457
|
+
|
|
63458
|
+
Keccak.prototype.toString = Keccak.prototype.hex = function () {
|
|
63459
|
+
this.finalize();
|
|
63460
|
+
|
|
63461
|
+
var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks,
|
|
63462
|
+
extraBytes = this.extraBytes, i = 0, j = 0;
|
|
63463
|
+
var hex = '', block;
|
|
63464
|
+
while (j < outputBlocks) {
|
|
63465
|
+
for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {
|
|
63466
|
+
block = s[i];
|
|
63467
|
+
hex += HEX_CHARS[(block >> 4) & 0x0F] + HEX_CHARS[block & 0x0F] +
|
|
63468
|
+
HEX_CHARS[(block >> 12) & 0x0F] + HEX_CHARS[(block >> 8) & 0x0F] +
|
|
63469
|
+
HEX_CHARS[(block >> 20) & 0x0F] + HEX_CHARS[(block >> 16) & 0x0F] +
|
|
63470
|
+
HEX_CHARS[(block >> 28) & 0x0F] + HEX_CHARS[(block >> 24) & 0x0F];
|
|
63471
|
+
}
|
|
63472
|
+
if (j % blockCount === 0) {
|
|
63473
|
+
f(s);
|
|
63474
|
+
i = 0;
|
|
63475
|
+
}
|
|
63476
|
+
}
|
|
63477
|
+
if (extraBytes) {
|
|
63478
|
+
block = s[i];
|
|
63479
|
+
if (extraBytes > 0) {
|
|
63480
|
+
hex += HEX_CHARS[(block >> 4) & 0x0F] + HEX_CHARS[block & 0x0F];
|
|
63481
|
+
}
|
|
63482
|
+
if (extraBytes > 1) {
|
|
63483
|
+
hex += HEX_CHARS[(block >> 12) & 0x0F] + HEX_CHARS[(block >> 8) & 0x0F];
|
|
63484
|
+
}
|
|
63485
|
+
if (extraBytes > 2) {
|
|
63486
|
+
hex += HEX_CHARS[(block >> 20) & 0x0F] + HEX_CHARS[(block >> 16) & 0x0F];
|
|
63487
|
+
}
|
|
63488
|
+
}
|
|
63489
|
+
return hex;
|
|
63490
|
+
};
|
|
63491
|
+
|
|
63492
|
+
Keccak.prototype.arrayBuffer = function () {
|
|
63493
|
+
this.finalize();
|
|
63494
|
+
|
|
63495
|
+
var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks,
|
|
63496
|
+
extraBytes = this.extraBytes, i = 0, j = 0;
|
|
63497
|
+
var bytes = this.outputBits >> 3;
|
|
63498
|
+
var buffer;
|
|
63499
|
+
if (extraBytes) {
|
|
63500
|
+
buffer = new ArrayBuffer((outputBlocks + 1) << 2);
|
|
63501
|
+
} else {
|
|
63502
|
+
buffer = new ArrayBuffer(bytes);
|
|
63503
|
+
}
|
|
63504
|
+
var array = new Uint32Array(buffer);
|
|
63505
|
+
while (j < outputBlocks) {
|
|
63506
|
+
for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {
|
|
63507
|
+
array[j] = s[i];
|
|
63508
|
+
}
|
|
63509
|
+
if (j % blockCount === 0) {
|
|
63510
|
+
f(s);
|
|
63511
|
+
}
|
|
63512
|
+
}
|
|
63513
|
+
if (extraBytes) {
|
|
63514
|
+
array[i] = s[i];
|
|
63515
|
+
buffer = buffer.slice(0, bytes);
|
|
63516
|
+
}
|
|
63517
|
+
return buffer;
|
|
63518
|
+
};
|
|
63519
|
+
|
|
63520
|
+
Keccak.prototype.buffer = Keccak.prototype.arrayBuffer;
|
|
63521
|
+
|
|
63522
|
+
Keccak.prototype.digest = Keccak.prototype.array = function () {
|
|
63523
|
+
this.finalize();
|
|
63524
|
+
|
|
63525
|
+
var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks,
|
|
63526
|
+
extraBytes = this.extraBytes, i = 0, j = 0;
|
|
63527
|
+
var array = [], offset, block;
|
|
63528
|
+
while (j < outputBlocks) {
|
|
63529
|
+
for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {
|
|
63530
|
+
offset = j << 2;
|
|
63531
|
+
block = s[i];
|
|
63532
|
+
array[offset] = block & 0xFF;
|
|
63533
|
+
array[offset + 1] = (block >> 8) & 0xFF;
|
|
63534
|
+
array[offset + 2] = (block >> 16) & 0xFF;
|
|
63535
|
+
array[offset + 3] = (block >> 24) & 0xFF;
|
|
63536
|
+
}
|
|
63537
|
+
if (j % blockCount === 0) {
|
|
63538
|
+
f(s);
|
|
63539
|
+
}
|
|
63540
|
+
}
|
|
63541
|
+
if (extraBytes) {
|
|
63542
|
+
offset = j << 2;
|
|
63543
|
+
block = s[i];
|
|
63544
|
+
if (extraBytes > 0) {
|
|
63545
|
+
array[offset] = block & 0xFF;
|
|
63546
|
+
}
|
|
63547
|
+
if (extraBytes > 1) {
|
|
63548
|
+
array[offset + 1] = (block >> 8) & 0xFF;
|
|
63549
|
+
}
|
|
63550
|
+
if (extraBytes > 2) {
|
|
63551
|
+
array[offset + 2] = (block >> 16) & 0xFF;
|
|
63552
|
+
}
|
|
63553
|
+
}
|
|
63554
|
+
return array;
|
|
63555
|
+
};
|
|
63556
|
+
|
|
63557
|
+
var f = function (s) {
|
|
63558
|
+
var h, l, n, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9,
|
|
63559
|
+
b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16, b17,
|
|
63560
|
+
b18, b19, b20, b21, b22, b23, b24, b25, b26, b27, b28, b29, b30, b31, b32, b33,
|
|
63561
|
+
b34, b35, b36, b37, b38, b39, b40, b41, b42, b43, b44, b45, b46, b47, b48, b49;
|
|
63562
|
+
for (n = 0; n < 48; n += 2) {
|
|
63563
|
+
c0 = s[0] ^ s[10] ^ s[20] ^ s[30] ^ s[40];
|
|
63564
|
+
c1 = s[1] ^ s[11] ^ s[21] ^ s[31] ^ s[41];
|
|
63565
|
+
c2 = s[2] ^ s[12] ^ s[22] ^ s[32] ^ s[42];
|
|
63566
|
+
c3 = s[3] ^ s[13] ^ s[23] ^ s[33] ^ s[43];
|
|
63567
|
+
c4 = s[4] ^ s[14] ^ s[24] ^ s[34] ^ s[44];
|
|
63568
|
+
c5 = s[5] ^ s[15] ^ s[25] ^ s[35] ^ s[45];
|
|
63569
|
+
c6 = s[6] ^ s[16] ^ s[26] ^ s[36] ^ s[46];
|
|
63570
|
+
c7 = s[7] ^ s[17] ^ s[27] ^ s[37] ^ s[47];
|
|
63571
|
+
c8 = s[8] ^ s[18] ^ s[28] ^ s[38] ^ s[48];
|
|
63572
|
+
c9 = s[9] ^ s[19] ^ s[29] ^ s[39] ^ s[49];
|
|
63573
|
+
|
|
63574
|
+
h = c8 ^ ((c2 << 1) | (c3 >>> 31));
|
|
63575
|
+
l = c9 ^ ((c3 << 1) | (c2 >>> 31));
|
|
63576
|
+
s[0] ^= h;
|
|
63577
|
+
s[1] ^= l;
|
|
63578
|
+
s[10] ^= h;
|
|
63579
|
+
s[11] ^= l;
|
|
63580
|
+
s[20] ^= h;
|
|
63581
|
+
s[21] ^= l;
|
|
63582
|
+
s[30] ^= h;
|
|
63583
|
+
s[31] ^= l;
|
|
63584
|
+
s[40] ^= h;
|
|
63585
|
+
s[41] ^= l;
|
|
63586
|
+
h = c0 ^ ((c4 << 1) | (c5 >>> 31));
|
|
63587
|
+
l = c1 ^ ((c5 << 1) | (c4 >>> 31));
|
|
63588
|
+
s[2] ^= h;
|
|
63589
|
+
s[3] ^= l;
|
|
63590
|
+
s[12] ^= h;
|
|
63591
|
+
s[13] ^= l;
|
|
63592
|
+
s[22] ^= h;
|
|
63593
|
+
s[23] ^= l;
|
|
63594
|
+
s[32] ^= h;
|
|
63595
|
+
s[33] ^= l;
|
|
63596
|
+
s[42] ^= h;
|
|
63597
|
+
s[43] ^= l;
|
|
63598
|
+
h = c2 ^ ((c6 << 1) | (c7 >>> 31));
|
|
63599
|
+
l = c3 ^ ((c7 << 1) | (c6 >>> 31));
|
|
63600
|
+
s[4] ^= h;
|
|
63601
|
+
s[5] ^= l;
|
|
63602
|
+
s[14] ^= h;
|
|
63603
|
+
s[15] ^= l;
|
|
63604
|
+
s[24] ^= h;
|
|
63605
|
+
s[25] ^= l;
|
|
63606
|
+
s[34] ^= h;
|
|
63607
|
+
s[35] ^= l;
|
|
63608
|
+
s[44] ^= h;
|
|
63609
|
+
s[45] ^= l;
|
|
63610
|
+
h = c4 ^ ((c8 << 1) | (c9 >>> 31));
|
|
63611
|
+
l = c5 ^ ((c9 << 1) | (c8 >>> 31));
|
|
63612
|
+
s[6] ^= h;
|
|
63613
|
+
s[7] ^= l;
|
|
63614
|
+
s[16] ^= h;
|
|
63615
|
+
s[17] ^= l;
|
|
63616
|
+
s[26] ^= h;
|
|
63617
|
+
s[27] ^= l;
|
|
63618
|
+
s[36] ^= h;
|
|
63619
|
+
s[37] ^= l;
|
|
63620
|
+
s[46] ^= h;
|
|
63621
|
+
s[47] ^= l;
|
|
63622
|
+
h = c6 ^ ((c0 << 1) | (c1 >>> 31));
|
|
63623
|
+
l = c7 ^ ((c1 << 1) | (c0 >>> 31));
|
|
63624
|
+
s[8] ^= h;
|
|
63625
|
+
s[9] ^= l;
|
|
63626
|
+
s[18] ^= h;
|
|
63627
|
+
s[19] ^= l;
|
|
63628
|
+
s[28] ^= h;
|
|
63629
|
+
s[29] ^= l;
|
|
63630
|
+
s[38] ^= h;
|
|
63631
|
+
s[39] ^= l;
|
|
63632
|
+
s[48] ^= h;
|
|
63633
|
+
s[49] ^= l;
|
|
63634
|
+
|
|
63635
|
+
b0 = s[0];
|
|
63636
|
+
b1 = s[1];
|
|
63637
|
+
b32 = (s[11] << 4) | (s[10] >>> 28);
|
|
63638
|
+
b33 = (s[10] << 4) | (s[11] >>> 28);
|
|
63639
|
+
b14 = (s[20] << 3) | (s[21] >>> 29);
|
|
63640
|
+
b15 = (s[21] << 3) | (s[20] >>> 29);
|
|
63641
|
+
b46 = (s[31] << 9) | (s[30] >>> 23);
|
|
63642
|
+
b47 = (s[30] << 9) | (s[31] >>> 23);
|
|
63643
|
+
b28 = (s[40] << 18) | (s[41] >>> 14);
|
|
63644
|
+
b29 = (s[41] << 18) | (s[40] >>> 14);
|
|
63645
|
+
b20 = (s[2] << 1) | (s[3] >>> 31);
|
|
63646
|
+
b21 = (s[3] << 1) | (s[2] >>> 31);
|
|
63647
|
+
b2 = (s[13] << 12) | (s[12] >>> 20);
|
|
63648
|
+
b3 = (s[12] << 12) | (s[13] >>> 20);
|
|
63649
|
+
b34 = (s[22] << 10) | (s[23] >>> 22);
|
|
63650
|
+
b35 = (s[23] << 10) | (s[22] >>> 22);
|
|
63651
|
+
b16 = (s[33] << 13) | (s[32] >>> 19);
|
|
63652
|
+
b17 = (s[32] << 13) | (s[33] >>> 19);
|
|
63653
|
+
b48 = (s[42] << 2) | (s[43] >>> 30);
|
|
63654
|
+
b49 = (s[43] << 2) | (s[42] >>> 30);
|
|
63655
|
+
b40 = (s[5] << 30) | (s[4] >>> 2);
|
|
63656
|
+
b41 = (s[4] << 30) | (s[5] >>> 2);
|
|
63657
|
+
b22 = (s[14] << 6) | (s[15] >>> 26);
|
|
63658
|
+
b23 = (s[15] << 6) | (s[14] >>> 26);
|
|
63659
|
+
b4 = (s[25] << 11) | (s[24] >>> 21);
|
|
63660
|
+
b5 = (s[24] << 11) | (s[25] >>> 21);
|
|
63661
|
+
b36 = (s[34] << 15) | (s[35] >>> 17);
|
|
63662
|
+
b37 = (s[35] << 15) | (s[34] >>> 17);
|
|
63663
|
+
b18 = (s[45] << 29) | (s[44] >>> 3);
|
|
63664
|
+
b19 = (s[44] << 29) | (s[45] >>> 3);
|
|
63665
|
+
b10 = (s[6] << 28) | (s[7] >>> 4);
|
|
63666
|
+
b11 = (s[7] << 28) | (s[6] >>> 4);
|
|
63667
|
+
b42 = (s[17] << 23) | (s[16] >>> 9);
|
|
63668
|
+
b43 = (s[16] << 23) | (s[17] >>> 9);
|
|
63669
|
+
b24 = (s[26] << 25) | (s[27] >>> 7);
|
|
63670
|
+
b25 = (s[27] << 25) | (s[26] >>> 7);
|
|
63671
|
+
b6 = (s[36] << 21) | (s[37] >>> 11);
|
|
63672
|
+
b7 = (s[37] << 21) | (s[36] >>> 11);
|
|
63673
|
+
b38 = (s[47] << 24) | (s[46] >>> 8);
|
|
63674
|
+
b39 = (s[46] << 24) | (s[47] >>> 8);
|
|
63675
|
+
b30 = (s[8] << 27) | (s[9] >>> 5);
|
|
63676
|
+
b31 = (s[9] << 27) | (s[8] >>> 5);
|
|
63677
|
+
b12 = (s[18] << 20) | (s[19] >>> 12);
|
|
63678
|
+
b13 = (s[19] << 20) | (s[18] >>> 12);
|
|
63679
|
+
b44 = (s[29] << 7) | (s[28] >>> 25);
|
|
63680
|
+
b45 = (s[28] << 7) | (s[29] >>> 25);
|
|
63681
|
+
b26 = (s[38] << 8) | (s[39] >>> 24);
|
|
63682
|
+
b27 = (s[39] << 8) | (s[38] >>> 24);
|
|
63683
|
+
b8 = (s[48] << 14) | (s[49] >>> 18);
|
|
63684
|
+
b9 = (s[49] << 14) | (s[48] >>> 18);
|
|
63685
|
+
|
|
63686
|
+
s[0] = b0 ^ (~b2 & b4);
|
|
63687
|
+
s[1] = b1 ^ (~b3 & b5);
|
|
63688
|
+
s[10] = b10 ^ (~b12 & b14);
|
|
63689
|
+
s[11] = b11 ^ (~b13 & b15);
|
|
63690
|
+
s[20] = b20 ^ (~b22 & b24);
|
|
63691
|
+
s[21] = b21 ^ (~b23 & b25);
|
|
63692
|
+
s[30] = b30 ^ (~b32 & b34);
|
|
63693
|
+
s[31] = b31 ^ (~b33 & b35);
|
|
63694
|
+
s[40] = b40 ^ (~b42 & b44);
|
|
63695
|
+
s[41] = b41 ^ (~b43 & b45);
|
|
63696
|
+
s[2] = b2 ^ (~b4 & b6);
|
|
63697
|
+
s[3] = b3 ^ (~b5 & b7);
|
|
63698
|
+
s[12] = b12 ^ (~b14 & b16);
|
|
63699
|
+
s[13] = b13 ^ (~b15 & b17);
|
|
63700
|
+
s[22] = b22 ^ (~b24 & b26);
|
|
63701
|
+
s[23] = b23 ^ (~b25 & b27);
|
|
63702
|
+
s[32] = b32 ^ (~b34 & b36);
|
|
63703
|
+
s[33] = b33 ^ (~b35 & b37);
|
|
63704
|
+
s[42] = b42 ^ (~b44 & b46);
|
|
63705
|
+
s[43] = b43 ^ (~b45 & b47);
|
|
63706
|
+
s[4] = b4 ^ (~b6 & b8);
|
|
63707
|
+
s[5] = b5 ^ (~b7 & b9);
|
|
63708
|
+
s[14] = b14 ^ (~b16 & b18);
|
|
63709
|
+
s[15] = b15 ^ (~b17 & b19);
|
|
63710
|
+
s[24] = b24 ^ (~b26 & b28);
|
|
63711
|
+
s[25] = b25 ^ (~b27 & b29);
|
|
63712
|
+
s[34] = b34 ^ (~b36 & b38);
|
|
63713
|
+
s[35] = b35 ^ (~b37 & b39);
|
|
63714
|
+
s[44] = b44 ^ (~b46 & b48);
|
|
63715
|
+
s[45] = b45 ^ (~b47 & b49);
|
|
63716
|
+
s[6] = b6 ^ (~b8 & b0);
|
|
63717
|
+
s[7] = b7 ^ (~b9 & b1);
|
|
63718
|
+
s[16] = b16 ^ (~b18 & b10);
|
|
63719
|
+
s[17] = b17 ^ (~b19 & b11);
|
|
63720
|
+
s[26] = b26 ^ (~b28 & b20);
|
|
63721
|
+
s[27] = b27 ^ (~b29 & b21);
|
|
63722
|
+
s[36] = b36 ^ (~b38 & b30);
|
|
63723
|
+
s[37] = b37 ^ (~b39 & b31);
|
|
63724
|
+
s[46] = b46 ^ (~b48 & b40);
|
|
63725
|
+
s[47] = b47 ^ (~b49 & b41);
|
|
63726
|
+
s[8] = b8 ^ (~b0 & b2);
|
|
63727
|
+
s[9] = b9 ^ (~b1 & b3);
|
|
63728
|
+
s[18] = b18 ^ (~b10 & b12);
|
|
63729
|
+
s[19] = b19 ^ (~b11 & b13);
|
|
63730
|
+
s[28] = b28 ^ (~b20 & b22);
|
|
63731
|
+
s[29] = b29 ^ (~b21 & b23);
|
|
63732
|
+
s[38] = b38 ^ (~b30 & b32);
|
|
63733
|
+
s[39] = b39 ^ (~b31 & b33);
|
|
63734
|
+
s[48] = b48 ^ (~b40 & b42);
|
|
63735
|
+
s[49] = b49 ^ (~b41 & b43);
|
|
63736
|
+
|
|
63737
|
+
s[0] ^= RC[n];
|
|
63738
|
+
s[1] ^= RC[n + 1];
|
|
63739
|
+
}
|
|
63740
|
+
};
|
|
63741
|
+
|
|
63742
|
+
if (COMMON_JS) {
|
|
63743
|
+
module.exports = methods;
|
|
63744
|
+
} else {
|
|
63745
|
+
for (var i = 0; i < methodNames.length; ++i) {
|
|
63746
|
+
root[methodNames[i]] = methods[methodNames[i]];
|
|
63747
|
+
}
|
|
63748
|
+
}
|
|
63749
|
+
})();
|
|
63750
|
+
});
|
|
63751
|
+
|
|
63752
|
+
var sha3$1 = sha3;
|
|
63221
63753
|
|
|
63222
|
-
|
|
63754
|
+
function keccak256(data) {
|
|
63755
|
+
return '0x' + sha3$1.keccak_256(arrayify(data));
|
|
63756
|
+
}
|
|
63757
|
+
|
|
63758
|
+
const version$1$1 = "address/5.4.0";
|
|
63759
|
+
|
|
63760
|
+
const logger$1$1 = new Logger$1(version$1$1);
|
|
63761
|
+
function getChecksumAddress(address) {
|
|
63762
|
+
if (!isHexString$1(address, 20)) {
|
|
63763
|
+
logger$1$1.throwArgumentError("invalid address", "address", address);
|
|
63764
|
+
}
|
|
63765
|
+
address = address.toLowerCase();
|
|
63766
|
+
const chars = address.substring(2).split("");
|
|
63767
|
+
const expanded = new Uint8Array(40);
|
|
63768
|
+
for (let i = 0; i < 40; i++) {
|
|
63769
|
+
expanded[i] = chars[i].charCodeAt(0);
|
|
63770
|
+
}
|
|
63771
|
+
const hashed = arrayify(keccak256(expanded));
|
|
63772
|
+
for (let i = 0; i < 40; i += 2) {
|
|
63773
|
+
if ((hashed[i >> 1] >> 4) >= 8) {
|
|
63774
|
+
chars[i] = chars[i].toUpperCase();
|
|
63775
|
+
}
|
|
63776
|
+
if ((hashed[i >> 1] & 0x0f) >= 8) {
|
|
63777
|
+
chars[i + 1] = chars[i + 1].toUpperCase();
|
|
63778
|
+
}
|
|
63779
|
+
}
|
|
63780
|
+
return "0x" + chars.join("");
|
|
63781
|
+
}
|
|
63782
|
+
// Shims for environments that are missing some required constants and functions
|
|
63783
|
+
const MAX_SAFE_INTEGER = 0x1fffffffffffff;
|
|
63784
|
+
function log10(x) {
|
|
63785
|
+
if (Math.log10) {
|
|
63786
|
+
return Math.log10(x);
|
|
63787
|
+
}
|
|
63788
|
+
return Math.log(x) / Math.LN10;
|
|
63789
|
+
}
|
|
63790
|
+
// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number
|
|
63791
|
+
// Create lookup table
|
|
63792
|
+
const ibanLookup = {};
|
|
63793
|
+
for (let i = 0; i < 10; i++) {
|
|
63794
|
+
ibanLookup[String(i)] = String(i);
|
|
63795
|
+
}
|
|
63796
|
+
for (let i = 0; i < 26; i++) {
|
|
63797
|
+
ibanLookup[String.fromCharCode(65 + i)] = String(10 + i);
|
|
63798
|
+
}
|
|
63799
|
+
// How many decimal digits can we process? (for 64-bit float, this is 15)
|
|
63800
|
+
const safeDigits = Math.floor(log10(MAX_SAFE_INTEGER));
|
|
63801
|
+
function ibanChecksum(address) {
|
|
63802
|
+
address = address.toUpperCase();
|
|
63803
|
+
address = address.substring(4) + address.substring(0, 2) + "00";
|
|
63804
|
+
let expanded = address.split("").map((c) => { return ibanLookup[c]; }).join("");
|
|
63805
|
+
// Javascript can handle integers safely up to 15 (decimal) digits
|
|
63806
|
+
while (expanded.length >= safeDigits) {
|
|
63807
|
+
let block = expanded.substring(0, safeDigits);
|
|
63808
|
+
expanded = parseInt(block, 10) % 97 + expanded.substring(block.length);
|
|
63809
|
+
}
|
|
63810
|
+
let checksum = String(98 - (parseInt(expanded, 10) % 97));
|
|
63811
|
+
while (checksum.length < 2) {
|
|
63812
|
+
checksum = "0" + checksum;
|
|
63813
|
+
}
|
|
63814
|
+
return checksum;
|
|
63815
|
+
}
|
|
63816
|
+
function getAddress(address) {
|
|
63817
|
+
let result = null;
|
|
63818
|
+
if (typeof (address) !== "string") {
|
|
63819
|
+
logger$1$1.throwArgumentError("invalid address", "address", address);
|
|
63820
|
+
}
|
|
63821
|
+
if (address.match(/^(0x)?[0-9a-fA-F]{40}$/)) {
|
|
63822
|
+
// Missing the 0x prefix
|
|
63823
|
+
if (address.substring(0, 2) !== "0x") {
|
|
63824
|
+
address = "0x" + address;
|
|
63825
|
+
}
|
|
63826
|
+
result = getChecksumAddress(address);
|
|
63827
|
+
// It is a checksummed address with a bad checksum
|
|
63828
|
+
if (address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) && result !== address) {
|
|
63829
|
+
logger$1$1.throwArgumentError("bad address checksum", "address", address);
|
|
63830
|
+
}
|
|
63831
|
+
// Maybe ICAP? (we only support direct mode)
|
|
63832
|
+
}
|
|
63833
|
+
else if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {
|
|
63834
|
+
// It is an ICAP address with a bad checksum
|
|
63835
|
+
if (address.substring(2, 4) !== ibanChecksum(address)) {
|
|
63836
|
+
logger$1$1.throwArgumentError("bad icap checksum", "address", address);
|
|
63837
|
+
}
|
|
63838
|
+
result = _base36To16(address.substring(4));
|
|
63839
|
+
while (result.length < 40) {
|
|
63840
|
+
result = "0" + result;
|
|
63841
|
+
}
|
|
63842
|
+
result = getChecksumAddress("0x" + result);
|
|
63843
|
+
}
|
|
63844
|
+
else {
|
|
63845
|
+
logger$1$1.throwArgumentError("invalid address", "address", address);
|
|
63846
|
+
}
|
|
63847
|
+
return result;
|
|
63848
|
+
}
|
|
63849
|
+
|
|
63850
|
+
const version$5 = "units/5.4.0";
|
|
63851
|
+
|
|
63852
|
+
const logger$5 = new Logger$1(version$5);
|
|
63223
63853
|
const names = [
|
|
63224
63854
|
"wei",
|
|
63225
63855
|
"kwei",
|
|
@@ -63231,7 +63861,7 @@
|
|
|
63231
63861
|
];
|
|
63232
63862
|
function parseUnits(value, unitName) {
|
|
63233
63863
|
if (typeof (value) !== "string") {
|
|
63234
|
-
logger$
|
|
63864
|
+
logger$5.throwArgumentError("value must be a string", "value", value);
|
|
63235
63865
|
}
|
|
63236
63866
|
if (typeof (unitName) === "string") {
|
|
63237
63867
|
const index = names.indexOf(unitName);
|
|
@@ -63371,7 +64001,8 @@
|
|
|
63371
64001
|
})
|
|
63372
64002
|
.then((amountsOut)=>{
|
|
63373
64003
|
resolve(amountsOut[amountsOut.length - 1]);
|
|
63374
|
-
})
|
|
64004
|
+
})
|
|
64005
|
+
.catch(()=>resolve());
|
|
63375
64006
|
})
|
|
63376
64007
|
};
|
|
63377
64008
|
|
|
@@ -63494,6 +64125,10 @@
|
|
|
63494
64125
|
return transaction
|
|
63495
64126
|
};
|
|
63496
64127
|
|
|
64128
|
+
const fixCheckSum = (address)=>{
|
|
64129
|
+
return getAddress(address)
|
|
64130
|
+
};
|
|
64131
|
+
|
|
63497
64132
|
let route$6 = ({
|
|
63498
64133
|
exchange,
|
|
63499
64134
|
tokenIn,
|
|
@@ -63505,6 +64140,8 @@
|
|
|
63505
64140
|
amountInMax = undefined,
|
|
63506
64141
|
amountOutMin = undefined,
|
|
63507
64142
|
}) => {
|
|
64143
|
+
tokenIn = fixCheckSum(tokenIn);
|
|
64144
|
+
tokenOut = fixCheckSum(tokenOut);
|
|
63508
64145
|
return new Promise(async (resolve)=> {
|
|
63509
64146
|
let path = await findPath$1({ tokenIn, tokenOut });
|
|
63510
64147
|
if (path === undefined || path.length == 0) { return resolve() }
|
|
@@ -63710,7 +64347,8 @@
|
|
|
63710
64347
|
})
|
|
63711
64348
|
.then((amountsOut)=>{
|
|
63712
64349
|
resolve(amountsOut[amountsOut.length - 1]);
|
|
63713
|
-
})
|
|
64350
|
+
})
|
|
64351
|
+
.catch(()=>resolve());
|
|
63714
64352
|
})
|
|
63715
64353
|
};
|
|
63716
64354
|
|
|
@@ -63842,6 +64480,8 @@
|
|
|
63842
64480
|
amountInMax = undefined,
|
|
63843
64481
|
amountOutMin = undefined,
|
|
63844
64482
|
}) => {
|
|
64483
|
+
tokenIn = fixCheckSum(tokenIn);
|
|
64484
|
+
tokenOut = fixCheckSum(tokenOut);
|
|
63845
64485
|
return new Promise(async (resolve)=> {
|
|
63846
64486
|
let path = await findPath({ tokenIn, tokenOut });
|
|
63847
64487
|
if (path === undefined || path.length == 0) { return resolve() }
|
|
@@ -64191,12 +64831,18 @@
|
|
|
64191
64831
|
});
|
|
64192
64832
|
})).then(function (amounts) {
|
|
64193
64833
|
setAcceptWithAmount(props.accept.map(function (configuration, index) {
|
|
64834
|
+
if (amounts[index] == undefined) {
|
|
64835
|
+
return;
|
|
64836
|
+
}
|
|
64837
|
+
|
|
64194
64838
|
return {
|
|
64195
64839
|
blockchain: configuration.blockchain,
|
|
64196
|
-
amount: round$1(amounts[index])
|
|
64840
|
+
amount: round$1(amounts[index]),
|
|
64197
64841
|
token: configuration.token,
|
|
64198
64842
|
receiver: configuration.receiver || account
|
|
64199
64843
|
};
|
|
64844
|
+
}).filter(function (configuration) {
|
|
64845
|
+
return !!configuration;
|
|
64200
64846
|
}));
|
|
64201
64847
|
})["catch"](setError);
|
|
64202
64848
|
})["catch"](setError);
|
|
@@ -64775,7 +65421,9 @@
|
|
|
64775
65421
|
}, /*#__PURE__*/react.createElement("strong", {
|
|
64776
65422
|
className: "FontSizeM"
|
|
64777
65423
|
}, "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."))),
|
|
64778
|
-
footer: /*#__PURE__*/react.createElement("div",
|
|
65424
|
+
footer: /*#__PURE__*/react.createElement("div", {
|
|
65425
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
65426
|
+
}, /*#__PURE__*/react.createElement("button", {
|
|
64779
65427
|
className: "ButtonPrimary",
|
|
64780
65428
|
onClick: close
|
|
64781
65429
|
}, "Ok"))
|
|
@@ -64786,7 +65434,7 @@
|
|
|
64786
65434
|
|
|
64787
65435
|
var PaymentRoutingContext = /*#__PURE__*/react.createContext();
|
|
64788
65436
|
|
|
64789
|
-
var
|
|
65437
|
+
var TrackingContext = /*#__PURE__*/react.createContext();
|
|
64790
65438
|
|
|
64791
65439
|
var PaymentProvider = (function (props) {
|
|
64792
65440
|
var _useContext = react.useContext(ErrorContext),
|
|
@@ -64795,7 +65443,6 @@
|
|
|
64795
65443
|
var _useContext2 = react.useContext(ConfigurationContext),
|
|
64796
65444
|
_sent = _useContext2.sent,
|
|
64797
65445
|
_confirmed = _useContext2.confirmed,
|
|
64798
|
-
_ensured = _useContext2.ensured,
|
|
64799
65446
|
_failed = _useContext2.failed;
|
|
64800
65447
|
|
|
64801
65448
|
var _useContext3 = react.useContext(PaymentRoutingContext),
|
|
@@ -64809,13 +65456,17 @@
|
|
|
64809
65456
|
var _useContext5 = react.useContext(PaymentRoutingContext),
|
|
64810
65457
|
allRoutes = _useContext5.allRoutes;
|
|
64811
65458
|
|
|
64812
|
-
var _useContext6 = react.useContext(
|
|
64813
|
-
_useContext6.
|
|
64814
|
-
var setUpdate = _useContext6.setUpdate;
|
|
65459
|
+
var _useContext6 = react.useContext(UpdatableContext),
|
|
65460
|
+
setUpdatable = _useContext6.setUpdatable;
|
|
64815
65461
|
|
|
64816
65462
|
var _useContext7 = react.useContext(WalletContext),
|
|
64817
65463
|
wallet = _useContext7.wallet;
|
|
64818
65464
|
|
|
65465
|
+
var _useContext8 = react.useContext(TrackingContext),
|
|
65466
|
+
forward = _useContext8.forward,
|
|
65467
|
+
tracking = _useContext8.tracking,
|
|
65468
|
+
initializeTracking = _useContext8.initializeTracking;
|
|
65469
|
+
|
|
64819
65470
|
var _useState = react.useState(),
|
|
64820
65471
|
_useState2 = _slicedToArray(_useState, 2),
|
|
64821
65472
|
payment = _useState2[0],
|
|
@@ -64836,53 +65487,81 @@
|
|
|
64836
65487
|
paymentState = _useState8[0],
|
|
64837
65488
|
setPaymentState = _useState8[1];
|
|
64838
65489
|
|
|
64839
|
-
var pay = function
|
|
64840
|
-
var
|
|
64841
|
-
|
|
64842
|
-
|
|
64843
|
-
|
|
64844
|
-
|
|
64845
|
-
|
|
64846
|
-
|
|
64847
|
-
|
|
64848
|
-
|
|
64849
|
-
|
|
64850
|
-
|
|
64851
|
-
|
|
64852
|
-
|
|
65490
|
+
var pay = /*#__PURE__*/function () {
|
|
65491
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(_ref) {
|
|
65492
|
+
var navigate, currentBlock;
|
|
65493
|
+
return regenerator.wrap(function _callee$(_context) {
|
|
65494
|
+
while (1) {
|
|
65495
|
+
switch (_context.prev = _context.next) {
|
|
65496
|
+
case 0:
|
|
65497
|
+
navigate = _ref.navigate;
|
|
65498
|
+
setClosable(false);
|
|
65499
|
+
setPaymentState('paying');
|
|
65500
|
+
setUpdatable(false);
|
|
65501
|
+
_context.next = 6;
|
|
65502
|
+
return request({
|
|
65503
|
+
blockchain: payment.route.transaction.blockchain,
|
|
65504
|
+
method: 'latestBlockNumber'
|
|
65505
|
+
});
|
|
64853
65506
|
|
|
64854
|
-
|
|
64855
|
-
|
|
64856
|
-
|
|
64857
|
-
|
|
64858
|
-
|
|
64859
|
-
|
|
64860
|
-
|
|
64861
|
-
|
|
64862
|
-
|
|
64863
|
-
|
|
64864
|
-
|
|
64865
|
-
|
|
64866
|
-
}
|
|
65507
|
+
case 6:
|
|
65508
|
+
currentBlock = _context.sent;
|
|
65509
|
+
wallet.sendTransaction(Object.assign({}, payment.route.transaction, {
|
|
65510
|
+
sent: function sent(transaction) {
|
|
65511
|
+
if (_sent) {
|
|
65512
|
+
_sent(transaction);
|
|
65513
|
+
}
|
|
65514
|
+
},
|
|
65515
|
+
confirmed: function confirmed(transaction) {
|
|
65516
|
+
if (tracking != true) {
|
|
65517
|
+
setClosable(true);
|
|
65518
|
+
}
|
|
64867
65519
|
|
|
64868
|
-
|
|
64869
|
-
setClosable(true);
|
|
64870
|
-
setUpdate(true);
|
|
64871
|
-
navigate('PaymentError');
|
|
64872
|
-
}
|
|
64873
|
-
})).then(function (sentTransaction) {
|
|
64874
|
-
setTransaction(sentTransaction);
|
|
64875
|
-
})["catch"](function (error) {
|
|
64876
|
-
console.log('error', error);
|
|
64877
|
-
setPaymentState('initialized');
|
|
64878
|
-
setClosable(true);
|
|
64879
|
-
setUpdate(true);
|
|
65520
|
+
setPaymentState('confirmed');
|
|
64880
65521
|
|
|
64881
|
-
|
|
64882
|
-
|
|
64883
|
-
|
|
64884
|
-
|
|
64885
|
-
|
|
65522
|
+
if (_confirmed) {
|
|
65523
|
+
_confirmed(transaction);
|
|
65524
|
+
}
|
|
65525
|
+
},
|
|
65526
|
+
failed: function failed(transaction, error) {
|
|
65527
|
+
if (_failed) {
|
|
65528
|
+
_failed(transaction, error);
|
|
65529
|
+
}
|
|
65530
|
+
|
|
65531
|
+
setPaymentState('initialized');
|
|
65532
|
+
setClosable(true);
|
|
65533
|
+
setUpdatable(true);
|
|
65534
|
+
navigate('PaymentError');
|
|
65535
|
+
}
|
|
65536
|
+
})).then(function (sentTransaction) {
|
|
65537
|
+
if (tracking) {
|
|
65538
|
+
initializeTracking(sentTransaction, currentBlock);
|
|
65539
|
+
}
|
|
65540
|
+
|
|
65541
|
+
setTransaction(sentTransaction);
|
|
65542
|
+
})["catch"](function (error) {
|
|
65543
|
+
console.log('error', error);
|
|
65544
|
+
setPaymentState('initialized');
|
|
65545
|
+
setClosable(true);
|
|
65546
|
+
setUpdatable(true);
|
|
65547
|
+
|
|
65548
|
+
if ((error === null || error === void 0 ? void 0 : error.code) == 'WRONG_NETWORK') {
|
|
65549
|
+
navigate('WrongNetwork');
|
|
65550
|
+
}
|
|
65551
|
+
});
|
|
65552
|
+
|
|
65553
|
+
case 8:
|
|
65554
|
+
case "end":
|
|
65555
|
+
return _context.stop();
|
|
65556
|
+
}
|
|
65557
|
+
}
|
|
65558
|
+
}, _callee);
|
|
65559
|
+
}));
|
|
65560
|
+
|
|
65561
|
+
return function pay(_x) {
|
|
65562
|
+
return _ref2.apply(this, arguments);
|
|
65563
|
+
};
|
|
65564
|
+
}();
|
|
64886
65565
|
|
|
64887
65566
|
var approve = function approve() {
|
|
64888
65567
|
setClosable(false);
|
|
@@ -64903,15 +65582,20 @@
|
|
|
64903
65582
|
});
|
|
64904
65583
|
};
|
|
64905
65584
|
|
|
65585
|
+
react.useEffect(function () {
|
|
65586
|
+
if (forward) {
|
|
65587
|
+
setPaymentState('confirmed');
|
|
65588
|
+
}
|
|
65589
|
+
}, [forward]);
|
|
64906
65590
|
react.useEffect(function () {
|
|
64907
65591
|
if (selectedRoute) {
|
|
64908
65592
|
var fromToken = selectedRoute.fromToken;
|
|
64909
65593
|
selectedRoute.transaction.params;
|
|
64910
|
-
Promise.all([fromToken.name(), fromToken.symbol(), fromToken.readable(selectedRoute.fromAmount)]).then(function (
|
|
64911
|
-
var
|
|
64912
|
-
name =
|
|
64913
|
-
symbol =
|
|
64914
|
-
amount =
|
|
65594
|
+
Promise.all([fromToken.name(), fromToken.symbol(), fromToken.readable(selectedRoute.fromAmount)]).then(function (_ref3) {
|
|
65595
|
+
var _ref4 = _slicedToArray(_ref3, 3),
|
|
65596
|
+
name = _ref4[0],
|
|
65597
|
+
symbol = _ref4[1],
|
|
65598
|
+
amount = _ref4[2];
|
|
64915
65599
|
|
|
64916
65600
|
setPayment({
|
|
64917
65601
|
route: selectedRoute,
|
|
@@ -64927,9 +65611,9 @@
|
|
|
64927
65611
|
}, [selectedRoute]);
|
|
64928
65612
|
react.useEffect(function () {
|
|
64929
65613
|
if (allRoutes && allRoutes.length == 0) {
|
|
64930
|
-
|
|
65614
|
+
setUpdatable(false);
|
|
64931
65615
|
} else if (allRoutes && allRoutes.length > 0) {
|
|
64932
|
-
|
|
65616
|
+
setUpdatable(true);
|
|
64933
65617
|
}
|
|
64934
65618
|
}, [allRoutes]);
|
|
64935
65619
|
|
|
@@ -69729,9 +70413,9 @@
|
|
|
69729
70413
|
})
|
|
69730
70414
|
};
|
|
69731
70415
|
|
|
69732
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
70416
|
+
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; }
|
|
69733
70417
|
|
|
69734
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
70418
|
+
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; }
|
|
69735
70419
|
var PaymentRoutingProvider = (function (props) {
|
|
69736
70420
|
var _useState = react.useState(),
|
|
69737
70421
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -69751,8 +70435,8 @@
|
|
|
69751
70435
|
var _useContext = react.useContext(WalletContext),
|
|
69752
70436
|
account = _useContext.account;
|
|
69753
70437
|
|
|
69754
|
-
var _useContext2 = react.useContext(
|
|
69755
|
-
|
|
70438
|
+
var _useContext2 = react.useContext(UpdatableContext),
|
|
70439
|
+
updatable = _useContext2.updatable;
|
|
69756
70440
|
|
|
69757
70441
|
var prepareAcceptedPayments = function prepareAcceptedPayments(accept) {
|
|
69758
70442
|
var toAddress = _typeof(accept.receiver) == 'object' ? accept.receiver.address : accept.receiver;
|
|
@@ -69767,9 +70451,9 @@
|
|
|
69767
70451
|
var getPaymentRoutes = function getPaymentRoutes(_ref) {
|
|
69768
70452
|
var allRoutes = _ref.allRoutes,
|
|
69769
70453
|
selectedRoute = _ref.selectedRoute,
|
|
69770
|
-
|
|
70454
|
+
updatable = _ref.updatable;
|
|
69771
70455
|
|
|
69772
|
-
if (
|
|
70456
|
+
if (updatable == false || !props.accept || !account) {
|
|
69773
70457
|
return;
|
|
69774
70458
|
}
|
|
69775
70459
|
|
|
@@ -69872,13 +70556,13 @@
|
|
|
69872
70556
|
getPaymentRoutes({
|
|
69873
70557
|
allRoutes: allRoutes,
|
|
69874
70558
|
selectedRoute: selectedRoute,
|
|
69875
|
-
|
|
70559
|
+
updatable: updatable
|
|
69876
70560
|
});
|
|
69877
70561
|
}, 15000);
|
|
69878
70562
|
return function () {
|
|
69879
70563
|
return clearTimeout(timeout);
|
|
69880
70564
|
};
|
|
69881
|
-
}, [reloadCount, allRoutes, selectedRoute,
|
|
70565
|
+
}, [reloadCount, allRoutes, selectedRoute, updatable]);
|
|
69882
70566
|
react.useEffect(function () {
|
|
69883
70567
|
if (account && props.accept) {
|
|
69884
70568
|
setAllRoutes(undefined);
|
|
@@ -69908,8 +70592,8 @@
|
|
|
69908
70592
|
var _useContext2 = react.useContext(WalletContext),
|
|
69909
70593
|
account = _useContext2.account;
|
|
69910
70594
|
|
|
69911
|
-
var _useContext3 = react.useContext(
|
|
69912
|
-
|
|
70595
|
+
var _useContext3 = react.useContext(UpdatableContext),
|
|
70596
|
+
updatable = _useContext3.updatable;
|
|
69913
70597
|
|
|
69914
70598
|
var _useContext4 = react.useContext(PaymentContext),
|
|
69915
70599
|
payment = _useContext4.payment;
|
|
@@ -69928,10 +70612,10 @@
|
|
|
69928
70612
|
setReloadCount = _useState4[1];
|
|
69929
70613
|
|
|
69930
70614
|
var getToTokenLocalValue = function getToTokenLocalValue(_ref) {
|
|
69931
|
-
var
|
|
70615
|
+
var updatable = _ref.updatable,
|
|
69932
70616
|
payment = _ref.payment;
|
|
69933
70617
|
|
|
69934
|
-
if (
|
|
70618
|
+
if (updatable == false || (payment === null || payment === void 0 ? void 0 : payment.route) == undefined) {
|
|
69935
70619
|
return;
|
|
69936
70620
|
}
|
|
69937
70621
|
|
|
@@ -69974,7 +70658,7 @@
|
|
|
69974
70658
|
react.useEffect(function () {
|
|
69975
70659
|
if (account && payment) {
|
|
69976
70660
|
getToTokenLocalValue({
|
|
69977
|
-
|
|
70661
|
+
updatable: updatable,
|
|
69978
70662
|
payment: payment
|
|
69979
70663
|
});
|
|
69980
70664
|
}
|
|
@@ -69983,13 +70667,13 @@
|
|
|
69983
70667
|
var timeout = setTimeout(function () {
|
|
69984
70668
|
setReloadCount(reloadCount + 1);
|
|
69985
70669
|
getToTokenLocalValue({
|
|
69986
|
-
|
|
70670
|
+
updatable: updatable
|
|
69987
70671
|
});
|
|
69988
70672
|
}, 15000);
|
|
69989
70673
|
return function () {
|
|
69990
70674
|
return clearTimeout(timeout);
|
|
69991
70675
|
};
|
|
69992
|
-
}, [reloadCount,
|
|
70676
|
+
}, [reloadCount, updatable]);
|
|
69993
70677
|
return /*#__PURE__*/react.createElement(PaymentValueContext.Provider, {
|
|
69994
70678
|
value: {
|
|
69995
70679
|
paymentValue: paymentValue
|
|
@@ -71876,7 +72560,9 @@
|
|
|
71876
72560
|
changeAmount(toValidValue(maxAmount));
|
|
71877
72561
|
}
|
|
71878
72562
|
}, "(Max)")))))),
|
|
71879
|
-
footer: /*#__PURE__*/react.createElement("div",
|
|
72563
|
+
footer: /*#__PURE__*/react.createElement("div", {
|
|
72564
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
72565
|
+
}, /*#__PURE__*/react.createElement("button", {
|
|
71880
72566
|
className: "ButtonPrimary",
|
|
71881
72567
|
onClick: changeAmountAndGoBack
|
|
71882
72568
|
}, "Done"))
|
|
@@ -71963,6 +72649,7 @@
|
|
|
71963
72649
|
}, [allRoutes]);
|
|
71964
72650
|
react.useEffect(function () {
|
|
71965
72651
|
setCards(allPaymentRoutesWithData.map(function (payment, index) {
|
|
72652
|
+
var blockchain = Blockchain.findByName(payment.route.blockchain);
|
|
71966
72653
|
return /*#__PURE__*/react.createElement("div", {
|
|
71967
72654
|
key: index,
|
|
71968
72655
|
className: "Card",
|
|
@@ -71976,6 +72663,11 @@
|
|
|
71976
72663
|
}, /*#__PURE__*/react.createElement(TokenImage_1, {
|
|
71977
72664
|
blockchain: payment.route.blockchain,
|
|
71978
72665
|
address: payment.route.fromToken.address
|
|
72666
|
+
}), /*#__PURE__*/react.createElement("img", {
|
|
72667
|
+
className: "BlockchainLogo small",
|
|
72668
|
+
src: blockchain.logo,
|
|
72669
|
+
alt: blockchain.label,
|
|
72670
|
+
title: blockchain.label
|
|
71979
72671
|
})), /*#__PURE__*/react.createElement("div", {
|
|
71980
72672
|
className: "CardBody"
|
|
71981
72673
|
}, /*#__PURE__*/react.createElement("div", {
|
|
@@ -71990,11 +72682,7 @@
|
|
|
71990
72682
|
className: "TokenAmountCell"
|
|
71991
72683
|
}, format(payment.amount)))), /*#__PURE__*/react.createElement("h3", {
|
|
71992
72684
|
className: "CardText"
|
|
71993
|
-
}, /*#__PURE__*/react.createElement("small", null, format(round$1(parseFloat(payment.route.fromBalance.toString()) / Math.pow(10, payment.decimals), 'down'))))))
|
|
71994
|
-
className: "CardInfo"
|
|
71995
|
-
}, payment.route.approvalRequired && /*#__PURE__*/react.createElement("span", {
|
|
71996
|
-
className: "Label"
|
|
71997
|
-
}, "Requires Approval")));
|
|
72685
|
+
}, /*#__PURE__*/react.createElement("small", null, format(round$1(parseFloat(payment.route.fromBalance.toString()) / Math.pow(10, payment.decimals), 'down')))))));
|
|
71998
72686
|
}));
|
|
71999
72687
|
}, [allPaymentRoutesWithData]);
|
|
72000
72688
|
|
|
@@ -72020,25 +72708,12 @@
|
|
|
72020
72708
|
});
|
|
72021
72709
|
});
|
|
72022
72710
|
|
|
72023
|
-
var Checkmark = (function () {
|
|
72024
|
-
return /*#__PURE__*/react.createElement("svg", {
|
|
72025
|
-
className: "Checkmark Icon",
|
|
72026
|
-
version: "1.1",
|
|
72027
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
72028
|
-
x: "0px",
|
|
72029
|
-
y: "0px",
|
|
72030
|
-
viewBox: "0 0 24 24"
|
|
72031
|
-
}, /*#__PURE__*/react.createElement("path", {
|
|
72032
|
-
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"
|
|
72033
|
-
}));
|
|
72034
|
-
});
|
|
72035
|
-
|
|
72036
72711
|
var DonationOverviewSkeleton = (function (props) {
|
|
72037
72712
|
return /*#__PURE__*/react.createElement(Dialog, {
|
|
72038
72713
|
header: /*#__PURE__*/react.createElement("div", {
|
|
72039
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
72714
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
72040
72715
|
}, /*#__PURE__*/react.createElement("h1", {
|
|
72041
|
-
className: "LineHeightL FontSizeL
|
|
72716
|
+
className: "LineHeightL FontSizeL"
|
|
72042
72717
|
}, "Donation")),
|
|
72043
72718
|
body: /*#__PURE__*/react.createElement("div", {
|
|
72044
72719
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -72052,7 +72727,7 @@
|
|
|
72052
72727
|
className: "SkeletonBackground"
|
|
72053
72728
|
}))),
|
|
72054
72729
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
72055
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
72730
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
72056
72731
|
}, /*#__PURE__*/react.createElement("div", {
|
|
72057
72732
|
className: "SkeletonWrapper"
|
|
72058
72733
|
}, /*#__PURE__*/react.createElement("div", {
|
|
@@ -72063,6 +72738,60 @@
|
|
|
72063
72738
|
});
|
|
72064
72739
|
});
|
|
72065
72740
|
|
|
72741
|
+
var Checkmark = (function (props) {
|
|
72742
|
+
return /*#__PURE__*/react.createElement("svg", {
|
|
72743
|
+
className: "Checkmark Icon " + props.className,
|
|
72744
|
+
version: "1.1",
|
|
72745
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
72746
|
+
x: "0px",
|
|
72747
|
+
y: "0px",
|
|
72748
|
+
viewBox: "0 0 24 24"
|
|
72749
|
+
}, /*#__PURE__*/react.createElement("path", {
|
|
72750
|
+
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"
|
|
72751
|
+
}));
|
|
72752
|
+
});
|
|
72753
|
+
|
|
72754
|
+
var DigitalWalletIcon = (function (props) {
|
|
72755
|
+
return /*#__PURE__*/react.createElement("svg", {
|
|
72756
|
+
className: "DigitalWalletIcon Icon " + props.className,
|
|
72757
|
+
version: "1.1",
|
|
72758
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
72759
|
+
height: "24",
|
|
72760
|
+
width: "24",
|
|
72761
|
+
viewBox: "0 0 24 24"
|
|
72762
|
+
}, /*#__PURE__*/react.createElement("path", {
|
|
72763
|
+
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",
|
|
72764
|
+
transform: "translate(-0.81 -1)"
|
|
72765
|
+
}), /*#__PURE__*/react.createElement("path", {
|
|
72766
|
+
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",
|
|
72767
|
+
transform: "translate(-0.81 -1)"
|
|
72768
|
+
}), /*#__PURE__*/react.createElement("path", {
|
|
72769
|
+
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",
|
|
72770
|
+
transform: "translate(-0.81 -1)"
|
|
72771
|
+
}), /*#__PURE__*/react.createElement("path", {
|
|
72772
|
+
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",
|
|
72773
|
+
transform: "translate(-0.81 -1)"
|
|
72774
|
+
}), /*#__PURE__*/react.createElement("path", {
|
|
72775
|
+
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",
|
|
72776
|
+
transform: "translate(-0.81 -1)"
|
|
72777
|
+
}), /*#__PURE__*/react.createElement("path", {
|
|
72778
|
+
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",
|
|
72779
|
+
transform: "translate(-0.81 -1)"
|
|
72780
|
+
}), /*#__PURE__*/react.createElement("path", {
|
|
72781
|
+
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",
|
|
72782
|
+
transform: "translate(-0.81 -1)"
|
|
72783
|
+
}), /*#__PURE__*/react.createElement("rect", {
|
|
72784
|
+
x: "0.33",
|
|
72785
|
+
y: "11.77",
|
|
72786
|
+
width: "4.72",
|
|
72787
|
+
height: "0.66"
|
|
72788
|
+
}), /*#__PURE__*/react.createElement("polygon", {
|
|
72789
|
+
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"
|
|
72790
|
+
}), /*#__PURE__*/react.createElement("polygon", {
|
|
72791
|
+
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"
|
|
72792
|
+
}));
|
|
72793
|
+
});
|
|
72794
|
+
|
|
72066
72795
|
var LoadingText = (function (props) {
|
|
72067
72796
|
return /*#__PURE__*/react.createElement("div", {
|
|
72068
72797
|
className: "LoadingText"
|
|
@@ -72075,26 +72804,143 @@
|
|
|
72075
72804
|
}, "."));
|
|
72076
72805
|
});
|
|
72077
72806
|
|
|
72078
|
-
var
|
|
72807
|
+
var Footer = (function () {
|
|
72079
72808
|
var _useContext = react.useContext(ConfigurationContext),
|
|
72080
72809
|
currencyCode = _useContext.currencyCode;
|
|
72081
72810
|
|
|
72082
72811
|
var _useContext2 = react.useContext(ChangableAmountContext),
|
|
72083
72812
|
amount = _useContext2.amount;
|
|
72813
|
+
_useContext2.amountsMissing;
|
|
72084
72814
|
|
|
72085
|
-
var _useContext3 = react.useContext(
|
|
72086
|
-
|
|
72087
|
-
|
|
72088
|
-
|
|
72089
|
-
transaction = _useContext3.transaction,
|
|
72090
|
-
approve = _useContext3.approve,
|
|
72091
|
-
approvalTransaction = _useContext3.approvalTransaction;
|
|
72815
|
+
var _useContext3 = react.useContext(TrackingContext),
|
|
72816
|
+
tracking = _useContext3.tracking,
|
|
72817
|
+
forward = _useContext3.forward,
|
|
72818
|
+
forwardTo = _useContext3.forwardTo;
|
|
72092
72819
|
|
|
72093
|
-
var _useContext4 = react.useContext(
|
|
72094
|
-
|
|
72820
|
+
var _useContext4 = react.useContext(PaymentContext),
|
|
72821
|
+
payment = _useContext4.payment,
|
|
72822
|
+
paymentState = _useContext4.paymentState,
|
|
72823
|
+
pay = _useContext4.pay,
|
|
72824
|
+
transaction = _useContext4.transaction,
|
|
72825
|
+
approve = _useContext4.approve,
|
|
72826
|
+
approvalTransaction = _useContext4.approvalTransaction;
|
|
72827
|
+
|
|
72828
|
+
var _useContext5 = react.useContext(PaymentValueContext),
|
|
72829
|
+
paymentValue = _useContext5.paymentValue;
|
|
72830
|
+
|
|
72831
|
+
var _useContext6 = react.useContext(NavigateStackContext_1),
|
|
72832
|
+
navigate = _useContext6.navigate;
|
|
72833
|
+
|
|
72834
|
+
var _useContext7 = react.useContext(ClosableContext),
|
|
72835
|
+
close = _useContext7.close;
|
|
72836
|
+
|
|
72837
|
+
var trackingInfo = function trackingInfo() {
|
|
72838
|
+
if (tracking != true) {
|
|
72839
|
+
return null;
|
|
72840
|
+
}
|
|
72841
|
+
|
|
72842
|
+
if (forward) {
|
|
72843
|
+
return /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("a", {
|
|
72844
|
+
className: "Card transparent small disabled"
|
|
72845
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72846
|
+
className: "CardImage"
|
|
72847
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72848
|
+
className: "TextCenter Opacity05"
|
|
72849
|
+
}, /*#__PURE__*/react.createElement(Checkmark, {
|
|
72850
|
+
className: "small"
|
|
72851
|
+
}))), /*#__PURE__*/react.createElement("div", {
|
|
72852
|
+
className: "CardBody"
|
|
72853
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72854
|
+
className: "CardBodyWrapper"
|
|
72855
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72856
|
+
className: "Opacity05"
|
|
72857
|
+
}, "Payment confirmation has been stored")))));
|
|
72858
|
+
} else {
|
|
72859
|
+
return /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("a", {
|
|
72860
|
+
className: "Card transparent small disabled"
|
|
72861
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72862
|
+
className: "CardImage"
|
|
72863
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72864
|
+
className: "TextCenter"
|
|
72865
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72866
|
+
className: "Loading Icon"
|
|
72867
|
+
}))), /*#__PURE__*/react.createElement("div", {
|
|
72868
|
+
className: "CardBody"
|
|
72869
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72870
|
+
className: "CardBodyWrapper"
|
|
72871
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72872
|
+
className: "Opacity05"
|
|
72873
|
+
}, "Storing payment confirmation")))));
|
|
72874
|
+
}
|
|
72875
|
+
};
|
|
72876
|
+
|
|
72877
|
+
var additionalPaymentInformation = function additionalPaymentInformation() {
|
|
72878
|
+
if (paymentState == 'paying' && transaction == undefined) {
|
|
72879
|
+
return /*#__PURE__*/react.createElement("div", {
|
|
72880
|
+
className: "PaddingBottomS"
|
|
72881
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72882
|
+
className: "Card transparent disabled small"
|
|
72883
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72884
|
+
className: "CardImage"
|
|
72885
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72886
|
+
className: "TextCenter Opacity05"
|
|
72887
|
+
}, /*#__PURE__*/react.createElement(DigitalWalletIcon, {
|
|
72888
|
+
className: "small"
|
|
72889
|
+
}))), /*#__PURE__*/react.createElement("div", {
|
|
72890
|
+
className: "CardBody"
|
|
72891
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72892
|
+
className: "CardBodyWrapper"
|
|
72893
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72894
|
+
className: "Opacity05"
|
|
72895
|
+
}, "Confirm transaction in your wallet")))));
|
|
72896
|
+
} else if (paymentState == 'confirmed') {
|
|
72897
|
+
return /*#__PURE__*/react.createElement("div", {
|
|
72898
|
+
className: "PaddingBottomS"
|
|
72899
|
+
}, /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("a", {
|
|
72900
|
+
className: "Card transparent small",
|
|
72901
|
+
title: "Payment has been confirmed by the network",
|
|
72902
|
+
href: transaction === null || transaction === void 0 ? void 0 : transaction.url,
|
|
72903
|
+
target: "_blank",
|
|
72904
|
+
rel: "noopener noreferrer"
|
|
72905
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72906
|
+
className: "CardImage"
|
|
72907
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72908
|
+
className: "TextCenter Opacity05"
|
|
72909
|
+
}, /*#__PURE__*/react.createElement(Checkmark, {
|
|
72910
|
+
className: "small"
|
|
72911
|
+
}))), /*#__PURE__*/react.createElement("div", {
|
|
72912
|
+
className: "CardBody"
|
|
72913
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72914
|
+
className: "CardBodyWrapper"
|
|
72915
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72916
|
+
className: "Opacity05"
|
|
72917
|
+
}, "Payment has been confirmed"))))), trackingInfo());
|
|
72918
|
+
}
|
|
72919
|
+
};
|
|
72095
72920
|
|
|
72096
|
-
var
|
|
72097
|
-
|
|
72921
|
+
var approvalButton = function approvalButton() {
|
|
72922
|
+
if (!payment.route.approvalRequired || payment.route.directTransfer) {
|
|
72923
|
+
return null;
|
|
72924
|
+
} else if (paymentState == 'initialized') {
|
|
72925
|
+
return /*#__PURE__*/react.createElement("div", {
|
|
72926
|
+
className: "PaddingBottomS"
|
|
72927
|
+
}, /*#__PURE__*/react.createElement("button", {
|
|
72928
|
+
className: "ButtonPrimary",
|
|
72929
|
+
onClick: approve,
|
|
72930
|
+
title: "Allow ".concat(payment.symbol, " to be used as payment")
|
|
72931
|
+
}, "Allow ", payment.symbol, " to be used as payment"));
|
|
72932
|
+
} else if (paymentState == 'approving') {
|
|
72933
|
+
return /*#__PURE__*/react.createElement("div", {
|
|
72934
|
+
className: "PaddingBottomS"
|
|
72935
|
+
}, /*#__PURE__*/react.createElement("a", {
|
|
72936
|
+
className: "ButtonPrimary",
|
|
72937
|
+
title: "Approving payment token - please wait",
|
|
72938
|
+
href: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
|
|
72939
|
+
target: "_blank",
|
|
72940
|
+
rel: "noopener noreferrer"
|
|
72941
|
+
}, /*#__PURE__*/react.createElement(LoadingText, null, "Approving")));
|
|
72942
|
+
}
|
|
72943
|
+
};
|
|
72098
72944
|
|
|
72099
72945
|
var mainAction = function mainAction() {
|
|
72100
72946
|
if (paymentState == 'initialized' || paymentState == 'approving') {
|
|
@@ -72109,10 +72955,10 @@
|
|
|
72109
72955
|
navigate: navigate
|
|
72110
72956
|
});
|
|
72111
72957
|
}
|
|
72112
|
-
}, "Pay ", new Currency({
|
|
72958
|
+
}, "Pay ", amount ? new Currency({
|
|
72113
72959
|
amount: amount.toFixed(2),
|
|
72114
72960
|
code: currencyCode
|
|
72115
|
-
}).toString());
|
|
72961
|
+
}).toString() : paymentValue.toString().length ? paymentValue.toString() : "".concat(payment.amount));
|
|
72116
72962
|
} else if (paymentState == 'paying') {
|
|
72117
72963
|
return /*#__PURE__*/react.createElement("a", {
|
|
72118
72964
|
className: "ButtonPrimary",
|
|
@@ -72122,39 +72968,51 @@
|
|
|
72122
72968
|
rel: "noopener noreferrer"
|
|
72123
72969
|
}, /*#__PURE__*/react.createElement(LoadingText, null, "Paying"));
|
|
72124
72970
|
} else if (paymentState == 'confirmed') {
|
|
72125
|
-
|
|
72126
|
-
|
|
72127
|
-
|
|
72128
|
-
|
|
72129
|
-
|
|
72971
|
+
if (tracking == true) {
|
|
72972
|
+
if (forward) {
|
|
72973
|
+
if (forwardTo) {
|
|
72974
|
+
return /*#__PURE__*/react.createElement("a", {
|
|
72975
|
+
className: "ButtonPrimary",
|
|
72976
|
+
href: forwardTo,
|
|
72977
|
+
rel: "noopener noreferrer"
|
|
72978
|
+
}, "Continue");
|
|
72979
|
+
} else {
|
|
72980
|
+
return /*#__PURE__*/react.createElement("button", {
|
|
72981
|
+
className: "ButtonPrimary",
|
|
72982
|
+
onClick: close
|
|
72983
|
+
}, "Continue");
|
|
72984
|
+
}
|
|
72985
|
+
} else {
|
|
72986
|
+
return /*#__PURE__*/react.createElement("button", {
|
|
72987
|
+
className: "ButtonPrimary disabled",
|
|
72988
|
+
onClick: function onClick() {}
|
|
72989
|
+
}, "Continue");
|
|
72990
|
+
}
|
|
72991
|
+
} else {
|
|
72992
|
+
return /*#__PURE__*/react.createElement("button", {
|
|
72993
|
+
className: "ButtonPrimary",
|
|
72994
|
+
onClick: close
|
|
72995
|
+
}, "Close");
|
|
72996
|
+
}
|
|
72130
72997
|
}
|
|
72131
72998
|
};
|
|
72132
72999
|
|
|
72133
|
-
|
|
72134
|
-
|
|
72135
|
-
return /*#__PURE__*/react.createElement("div", {
|
|
72136
|
-
className: "PaddingBottomS"
|
|
72137
|
-
}, /*#__PURE__*/react.createElement("button", {
|
|
72138
|
-
className: "ButtonPrimary wide",
|
|
72139
|
-
onClick: approve,
|
|
72140
|
-
title: "Allow ".concat(payment.symbol, " to be used as payment")
|
|
72141
|
-
}, "Allow ", payment.symbol, " to be used as payment"));
|
|
72142
|
-
} else if (paymentState == 'approving') {
|
|
72143
|
-
return /*#__PURE__*/react.createElement("div", {
|
|
72144
|
-
className: "PaddingBottomS"
|
|
72145
|
-
}, /*#__PURE__*/react.createElement("a", {
|
|
72146
|
-
className: "ButtonPrimary wide",
|
|
72147
|
-
title: "Approving payment token - please wait",
|
|
72148
|
-
href: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
|
|
72149
|
-
target: "_blank",
|
|
72150
|
-
rel: "noopener noreferrer"
|
|
72151
|
-
}, /*#__PURE__*/react.createElement(LoadingText, null, "Approving")));
|
|
72152
|
-
}
|
|
72153
|
-
};
|
|
73000
|
+
return /*#__PURE__*/react.createElement("div", null, approvalButton(), additionalPaymentInformation(), mainAction());
|
|
73001
|
+
});
|
|
72154
73002
|
|
|
72155
|
-
|
|
72156
|
-
|
|
72157
|
-
|
|
73003
|
+
var DonationOverviewDialog = (function (props) {
|
|
73004
|
+
var _useContext = react.useContext(ConfigurationContext),
|
|
73005
|
+
currencyCode = _useContext.currencyCode;
|
|
73006
|
+
|
|
73007
|
+
var _useContext2 = react.useContext(ChangableAmountContext),
|
|
73008
|
+
amount = _useContext2.amount;
|
|
73009
|
+
|
|
73010
|
+
var _useContext3 = react.useContext(PaymentContext),
|
|
73011
|
+
payment = _useContext3.payment,
|
|
73012
|
+
paymentState = _useContext3.paymentState;
|
|
73013
|
+
|
|
73014
|
+
var _useContext4 = react.useContext(NavigateStackContext_1),
|
|
73015
|
+
navigate = _useContext4.navigate;
|
|
72158
73016
|
|
|
72159
73017
|
if (payment == undefined) {
|
|
72160
73018
|
return /*#__PURE__*/react.createElement(DonationOverviewSkeleton, null);
|
|
@@ -72162,9 +73020,9 @@
|
|
|
72162
73020
|
|
|
72163
73021
|
return /*#__PURE__*/react.createElement(Dialog, {
|
|
72164
73022
|
header: /*#__PURE__*/react.createElement("div", {
|
|
72165
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
73023
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
72166
73024
|
}, /*#__PURE__*/react.createElement("h1", {
|
|
72167
|
-
className: "LineHeightL FontSizeL
|
|
73025
|
+
className: "LineHeightL FontSizeL"
|
|
72168
73026
|
}, "Donation")),
|
|
72169
73027
|
body: /*#__PURE__*/react.createElement("div", {
|
|
72170
73028
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -72227,8 +73085,8 @@
|
|
|
72227
73085
|
className: "CardAction"
|
|
72228
73086
|
}, /*#__PURE__*/react.createElement(ChevronRight, null)))),
|
|
72229
73087
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
72230
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
72231
|
-
},
|
|
73088
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
73089
|
+
}, /*#__PURE__*/react.createElement(Footer, null))
|
|
72232
73090
|
});
|
|
72233
73091
|
});
|
|
72234
73092
|
|
|
@@ -72265,9 +73123,9 @@
|
|
|
72265
73123
|
rel: "noopener noreferrer"
|
|
72266
73124
|
}, "View on explorer")))),
|
|
72267
73125
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
72268
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
73126
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
72269
73127
|
}, /*#__PURE__*/react.createElement("button", {
|
|
72270
|
-
className: "ButtonPrimary
|
|
73128
|
+
className: "ButtonPrimary",
|
|
72271
73129
|
onClick: function onClick() {
|
|
72272
73130
|
return navigate('back');
|
|
72273
73131
|
}
|
|
@@ -72288,9 +73146,9 @@
|
|
|
72288
73146
|
return /*#__PURE__*/react.createElement(Dialog, {
|
|
72289
73147
|
stacked: true,
|
|
72290
73148
|
header: /*#__PURE__*/react.createElement("div", {
|
|
72291
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
73149
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
72292
73150
|
}, /*#__PURE__*/react.createElement("h1", {
|
|
72293
|
-
className: "LineHeightL FontSizeL
|
|
73151
|
+
className: "LineHeightL FontSizeL"
|
|
72294
73152
|
}, "Wrong Network")),
|
|
72295
73153
|
body: /*#__PURE__*/react.createElement("div", {
|
|
72296
73154
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -72307,7 +73165,7 @@
|
|
|
72307
73165
|
className: "FontSizeM"
|
|
72308
73166
|
}, "Please make sure you connect your wallet to the correct network before you try again!"))),
|
|
72309
73167
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
72310
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
73168
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
72311
73169
|
}, /*#__PURE__*/react.createElement("button", {
|
|
72312
73170
|
className: "ButtonPrimary",
|
|
72313
73171
|
onClick: function onClick() {
|
|
@@ -72338,16 +73196,122 @@
|
|
|
72338
73196
|
});
|
|
72339
73197
|
});
|
|
72340
73198
|
|
|
72341
|
-
var
|
|
72342
|
-
var
|
|
73199
|
+
var TrackingProvider = (function (props) {
|
|
73200
|
+
var _useContext = react.useContext(ConfigurationContext),
|
|
73201
|
+
track = _useContext.track;
|
|
73202
|
+
|
|
73203
|
+
var _useState = react.useState(track && !!track.endpoint),
|
|
72343
73204
|
_useState2 = _slicedToArray(_useState, 2),
|
|
72344
|
-
|
|
72345
|
-
|
|
73205
|
+
tracking = _useState2[0],
|
|
73206
|
+
setTracking = _useState2[1];
|
|
73207
|
+
|
|
73208
|
+
var _useState3 = react.useState(false),
|
|
73209
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
73210
|
+
forward = _useState4[0],
|
|
73211
|
+
setForward = _useState4[1];
|
|
73212
|
+
|
|
73213
|
+
var _useState5 = react.useState(),
|
|
73214
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
73215
|
+
forwardTo = _useState6[0],
|
|
73216
|
+
setForwardTo = _useState6[1];
|
|
73217
|
+
|
|
73218
|
+
var _useContext2 = react.useContext(ClosableContext),
|
|
73219
|
+
setClosable = _useContext2.setClosable;
|
|
73220
|
+
|
|
73221
|
+
react.useEffect(function () {
|
|
73222
|
+
setTracking(track && !!track.endpoint);
|
|
73223
|
+
}, [track]);
|
|
73224
|
+
|
|
73225
|
+
var openSocket = function openSocket(transaction) {
|
|
73226
|
+
var socket = new WebSocket('wss://integrate.depay.fi/cable');
|
|
73227
|
+
|
|
73228
|
+
socket.onopen = function (event) {
|
|
73229
|
+
var msg = {
|
|
73230
|
+
command: 'subscribe',
|
|
73231
|
+
identifier: JSON.stringify({
|
|
73232
|
+
blockchain: transaction.blockchain,
|
|
73233
|
+
sender: transaction.from.toLowerCase(),
|
|
73234
|
+
nonce: transaction.nonce,
|
|
73235
|
+
channel: 'PaymentChannel'
|
|
73236
|
+
})
|
|
73237
|
+
};
|
|
73238
|
+
socket.send(JSON.stringify(msg));
|
|
73239
|
+
};
|
|
73240
|
+
|
|
73241
|
+
socket.onclose = function (event) {};
|
|
73242
|
+
|
|
73243
|
+
socket.onmessage = function (event) {
|
|
73244
|
+
var item = JSON.parse(event.data);
|
|
73245
|
+
|
|
73246
|
+
if (item.type === "ping") {
|
|
73247
|
+
return;
|
|
73248
|
+
}
|
|
73249
|
+
|
|
73250
|
+
if (item.message && item.message.forward) {
|
|
73251
|
+
setClosable(!item.message.forward_to);
|
|
73252
|
+
setForwardTo(item.message.forward_to);
|
|
73253
|
+
setForward(item.message.forward);
|
|
73254
|
+
socket.close();
|
|
73255
|
+
|
|
73256
|
+
if (!!item.message.forward_to) {
|
|
73257
|
+
setTimeout(function () {
|
|
73258
|
+
props.document.location.href = item.message.forward_to;
|
|
73259
|
+
}, 500);
|
|
73260
|
+
}
|
|
73261
|
+
}
|
|
73262
|
+
};
|
|
72346
73263
|
|
|
72347
|
-
|
|
73264
|
+
socket.onerror = function (error) {
|
|
73265
|
+
console.log('WebSocket Error: ' + error);
|
|
73266
|
+
};
|
|
73267
|
+
};
|
|
73268
|
+
|
|
73269
|
+
var retryStartTracking = function retryStartTracking(transaction, afterBlock, attempt) {
|
|
73270
|
+
attempt = parseInt(attempt || 1, 10);
|
|
73271
|
+
console.log('RETRY TRACKING ATTEMPT ', attempt);
|
|
73272
|
+
|
|
73273
|
+
if (attempt < 3) {
|
|
73274
|
+
setTimeout(function () {
|
|
73275
|
+
startTracking(transaction, afterBlock, attempt + 1);
|
|
73276
|
+
}, 3000);
|
|
73277
|
+
} else {
|
|
73278
|
+
console.log('TRACKING FAILED AFTER 3 ATTEMPTS!');
|
|
73279
|
+
}
|
|
73280
|
+
};
|
|
73281
|
+
|
|
73282
|
+
var startTracking = function startTracking(transaction, afterBlock, attempt) {
|
|
73283
|
+
fetch(track.endpoint, {
|
|
73284
|
+
method: 'POST',
|
|
73285
|
+
body: JSON.stringify({
|
|
73286
|
+
blockchain: transaction.blockchain,
|
|
73287
|
+
transaction: transaction.id.toLowerCase(),
|
|
73288
|
+
sender: transaction.from.toLowerCase(),
|
|
73289
|
+
nonce: transaction.nonce,
|
|
73290
|
+
after_block: afterBlock
|
|
73291
|
+
})
|
|
73292
|
+
}).then(function (response) {
|
|
73293
|
+
if (response.status == 200) {
|
|
73294
|
+
console.log('TRACKING INITIALIZED');
|
|
73295
|
+
} else {
|
|
73296
|
+
retryStartTracking(transaction, afterBlock, attempt);
|
|
73297
|
+
}
|
|
73298
|
+
})["catch"](function (error) {
|
|
73299
|
+
console.log('TRACKING FAILED', error);
|
|
73300
|
+
retryStartTracking(transaction, afterBlock, attempt);
|
|
73301
|
+
});
|
|
73302
|
+
};
|
|
73303
|
+
|
|
73304
|
+
var initializeTracking = function initializeTracking(transaction, afterBlock) {
|
|
73305
|
+
openSocket(transaction);
|
|
73306
|
+
startTracking(transaction, afterBlock);
|
|
73307
|
+
};
|
|
73308
|
+
|
|
73309
|
+
return /*#__PURE__*/react.createElement(TrackingContext.Provider, {
|
|
72348
73310
|
value: {
|
|
72349
|
-
|
|
72350
|
-
|
|
73311
|
+
tracking: tracking,
|
|
73312
|
+
initializeTracking: initializeTracking,
|
|
73313
|
+
forward: forward,
|
|
73314
|
+
forwardTo: forwardTo
|
|
72351
73315
|
}
|
|
72352
73316
|
}, props.children);
|
|
72353
73317
|
});
|
|
@@ -72450,12 +73414,12 @@
|
|
|
72450
73414
|
|
|
72451
73415
|
var Donation = /*#__PURE__*/function () {
|
|
72452
73416
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(_ref3) {
|
|
72453
|
-
var amount, accept, event, sent, confirmed,
|
|
73417
|
+
var amount, accept, event, sent, confirmed, failed, error, critical, style, blacklist, providers, currency, connected, closed, document, unmount;
|
|
72454
73418
|
return regenerator.wrap(function _callee2$(_context2) {
|
|
72455
73419
|
while (1) {
|
|
72456
73420
|
switch (_context2.prev = _context2.next) {
|
|
72457
73421
|
case 0:
|
|
72458
|
-
amount = _ref3.amount, accept = _ref3.accept, event = _ref3.event, sent = _ref3.sent, confirmed = _ref3.confirmed,
|
|
73422
|
+
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;
|
|
72459
73423
|
_context2.prev = 1;
|
|
72460
73424
|
_context2.next = 4;
|
|
72461
73425
|
return preflight$2({
|
|
@@ -72481,26 +73445,27 @@
|
|
|
72481
73445
|
event: event,
|
|
72482
73446
|
sent: sent,
|
|
72483
73447
|
confirmed: confirmed,
|
|
72484
|
-
ensured: ensured,
|
|
72485
73448
|
failed: failed,
|
|
72486
73449
|
blacklist: blacklist,
|
|
72487
73450
|
providers: providers
|
|
72488
73451
|
}
|
|
72489
|
-
}, /*#__PURE__*/react.createElement(ClosableProvider, {
|
|
73452
|
+
}, /*#__PURE__*/react.createElement(UpdatableProvider, null, /*#__PURE__*/react.createElement(ClosableProvider, {
|
|
72490
73453
|
unmount: unmount
|
|
72491
|
-
}, /*#__PURE__*/react.createElement(
|
|
73454
|
+
}, /*#__PURE__*/react.createElement(WalletProvider, {
|
|
72492
73455
|
container: container,
|
|
72493
73456
|
connected: connected,
|
|
72494
73457
|
unmount: unmount
|
|
72495
73458
|
}, /*#__PURE__*/react.createElement(ConversionRateProvider, null, /*#__PURE__*/react.createElement(ChangableAmountProvider, {
|
|
72496
73459
|
accept: accept
|
|
73460
|
+
}, /*#__PURE__*/react.createElement(TrackingProvider, {
|
|
73461
|
+
document: ensureDocument(document)
|
|
72497
73462
|
}, /*#__PURE__*/react.createElement(DonationRoutingProvider, {
|
|
72498
73463
|
container: container,
|
|
72499
73464
|
document: document
|
|
72500
73465
|
}, /*#__PURE__*/react.createElement(DonationStack, {
|
|
72501
73466
|
document: document,
|
|
72502
73467
|
container: container
|
|
72503
|
-
})))))))));
|
|
73468
|
+
}), /*#__PURE__*/react.createElement(PoweredBy, null))))))))));
|
|
72504
73469
|
};
|
|
72505
73470
|
});
|
|
72506
73471
|
return _context2.abrupt("return", {
|
|
@@ -72568,9 +73533,9 @@
|
|
|
72568
73533
|
|
|
72569
73534
|
return /*#__PURE__*/react.createElement(Dialog, {
|
|
72570
73535
|
header: /*#__PURE__*/react.createElement("div", {
|
|
72571
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
73536
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
72572
73537
|
}, /*#__PURE__*/react.createElement("h1", {
|
|
72573
|
-
className: "LineHeightL FontSizeL
|
|
73538
|
+
className: "LineHeightL FontSizeL"
|
|
72574
73539
|
}, "Payment")),
|
|
72575
73540
|
body: /*#__PURE__*/react.createElement("div", {
|
|
72576
73541
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -72584,7 +73549,7 @@
|
|
|
72584
73549
|
className: "SkeletonBackground"
|
|
72585
73550
|
}))),
|
|
72586
73551
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
72587
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
73552
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
72588
73553
|
}, /*#__PURE__*/react.createElement("div", {
|
|
72589
73554
|
className: "SkeletonWrapper"
|
|
72590
73555
|
}, /*#__PURE__*/react.createElement("div", {
|
|
@@ -72599,17 +73564,13 @@
|
|
|
72599
73564
|
var _useContext = react.useContext(ConfigurationContext),
|
|
72600
73565
|
currencyCode = _useContext.currencyCode;
|
|
72601
73566
|
|
|
72602
|
-
var _useContext2 = react.useContext(
|
|
72603
|
-
|
|
72604
|
-
|
|
73567
|
+
var _useContext2 = react.useContext(PaymentContext),
|
|
73568
|
+
payment = _useContext2.payment,
|
|
73569
|
+
paymentState = _useContext2.paymentState;
|
|
72605
73570
|
|
|
72606
|
-
var _useContext3 = react.useContext(
|
|
72607
|
-
|
|
72608
|
-
|
|
72609
|
-
pay = _useContext3.pay,
|
|
72610
|
-
transaction = _useContext3.transaction,
|
|
72611
|
-
approve = _useContext3.approve,
|
|
72612
|
-
approvalTransaction = _useContext3.approvalTransaction;
|
|
73571
|
+
var _useContext3 = react.useContext(ChangableAmountContext),
|
|
73572
|
+
amount = _useContext3.amount,
|
|
73573
|
+
amountsMissing = _useContext3.amountsMissing;
|
|
72613
73574
|
|
|
72614
73575
|
var _useContext4 = react.useContext(PaymentValueContext),
|
|
72615
73576
|
paymentValue = _useContext4.paymentValue;
|
|
@@ -72617,78 +73578,15 @@
|
|
|
72617
73578
|
var _useContext5 = react.useContext(NavigateStackContext_1),
|
|
72618
73579
|
navigate = _useContext5.navigate;
|
|
72619
73580
|
|
|
72620
|
-
var _useContext6 = react.useContext(ClosableContext),
|
|
72621
|
-
close = _useContext6.close;
|
|
72622
|
-
|
|
72623
|
-
var mainAction = function mainAction() {
|
|
72624
|
-
if (paymentState == 'initialized' || paymentState == 'approving') {
|
|
72625
|
-
return /*#__PURE__*/react.createElement("button", {
|
|
72626
|
-
className: ["ButtonPrimary", payment.route.approvalRequired && !payment.route.directTransfer ? 'disabled' : ''].join(' '),
|
|
72627
|
-
onClick: function onClick() {
|
|
72628
|
-
if (payment.route.approvalRequired && !payment.route.directTransfer) {
|
|
72629
|
-
return;
|
|
72630
|
-
}
|
|
72631
|
-
|
|
72632
|
-
pay({
|
|
72633
|
-
navigate: navigate
|
|
72634
|
-
});
|
|
72635
|
-
}
|
|
72636
|
-
}, "Pay ", amount ? new Currency({
|
|
72637
|
-
amount: amount.toFixed(2),
|
|
72638
|
-
code: currencyCode
|
|
72639
|
-
}).toString() : paymentValue.toString().length ? paymentValue.toString() : "".concat(payment.amount));
|
|
72640
|
-
} else if (paymentState == 'paying') {
|
|
72641
|
-
return /*#__PURE__*/react.createElement("a", {
|
|
72642
|
-
className: "ButtonPrimary",
|
|
72643
|
-
title: "Performing the payment - please wait",
|
|
72644
|
-
href: transaction === null || transaction === void 0 ? void 0 : transaction.url,
|
|
72645
|
-
target: "_blank",
|
|
72646
|
-
rel: "noopener noreferrer"
|
|
72647
|
-
}, /*#__PURE__*/react.createElement(LoadingText, null, "Paying"));
|
|
72648
|
-
} else if (paymentState == 'confirmed') {
|
|
72649
|
-
return /*#__PURE__*/react.createElement("button", {
|
|
72650
|
-
className: "ButtonPrimary round",
|
|
72651
|
-
title: "Done",
|
|
72652
|
-
onClick: close
|
|
72653
|
-
}, /*#__PURE__*/react.createElement(Checkmark, null));
|
|
72654
|
-
}
|
|
72655
|
-
};
|
|
72656
|
-
|
|
72657
|
-
var approvalAction = function approvalAction() {
|
|
72658
|
-
if (paymentState == 'initialized') {
|
|
72659
|
-
return /*#__PURE__*/react.createElement("div", {
|
|
72660
|
-
className: "PaddingBottomS"
|
|
72661
|
-
}, /*#__PURE__*/react.createElement("button", {
|
|
72662
|
-
className: "ButtonPrimary wide",
|
|
72663
|
-
onClick: approve,
|
|
72664
|
-
title: "Allow ".concat(payment.symbol, " to be used as payment")
|
|
72665
|
-
}, "Allow ", payment.symbol, " to be used as payment"));
|
|
72666
|
-
} else if (paymentState == 'approving') {
|
|
72667
|
-
return /*#__PURE__*/react.createElement("div", {
|
|
72668
|
-
className: "PaddingBottomS"
|
|
72669
|
-
}, /*#__PURE__*/react.createElement("a", {
|
|
72670
|
-
className: "ButtonPrimary wide",
|
|
72671
|
-
title: "Approving payment token - please wait",
|
|
72672
|
-
href: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
|
|
72673
|
-
target: "_blank",
|
|
72674
|
-
rel: "noopener noreferrer"
|
|
72675
|
-
}, /*#__PURE__*/react.createElement(LoadingText, null, "Approving")));
|
|
72676
|
-
}
|
|
72677
|
-
};
|
|
72678
|
-
|
|
72679
|
-
var actions = function actions() {
|
|
72680
|
-
return /*#__PURE__*/react.createElement("div", null, payment.route.approvalRequired && !payment.route.directTransfer && approvalAction(), mainAction());
|
|
72681
|
-
};
|
|
72682
|
-
|
|
72683
73581
|
if (payment == undefined || paymentValue == undefined) {
|
|
72684
73582
|
return /*#__PURE__*/react.createElement(PaymentOverviewSkeleton, null);
|
|
72685
73583
|
}
|
|
72686
73584
|
|
|
72687
73585
|
return /*#__PURE__*/react.createElement(Dialog, {
|
|
72688
73586
|
header: /*#__PURE__*/react.createElement("div", {
|
|
72689
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
73587
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
72690
73588
|
}, /*#__PURE__*/react.createElement("h1", {
|
|
72691
|
-
className: "LineHeightL FontSizeL
|
|
73589
|
+
className: "LineHeightL FontSizeL"
|
|
72692
73590
|
}, "Payment")),
|
|
72693
73591
|
body: /*#__PURE__*/react.createElement("div", {
|
|
72694
73592
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -72751,8 +73649,8 @@
|
|
|
72751
73649
|
className: "CardAction"
|
|
72752
73650
|
}, /*#__PURE__*/react.createElement(ChevronRight, null)))),
|
|
72753
73651
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
72754
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
72755
|
-
},
|
|
73652
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
73653
|
+
}, /*#__PURE__*/react.createElement(Footer, null))
|
|
72756
73654
|
});
|
|
72757
73655
|
});
|
|
72758
73656
|
|
|
@@ -72818,12 +73716,12 @@
|
|
|
72818
73716
|
|
|
72819
73717
|
var Payment = /*#__PURE__*/function () {
|
|
72820
73718
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(_ref3) {
|
|
72821
|
-
var accept, amount, event, sent, confirmed,
|
|
73719
|
+
var accept, amount, event, sent, confirmed, failed, error, critical, style, whitelist, blacklist, providers, currency, connected, closed, track, document, unmount;
|
|
72822
73720
|
return regenerator.wrap(function _callee2$(_context2) {
|
|
72823
73721
|
while (1) {
|
|
72824
73722
|
switch (_context2.prev = _context2.next) {
|
|
72825
73723
|
case 0:
|
|
72826
|
-
accept = _ref3.accept, amount = _ref3.amount, event = _ref3.event, sent = _ref3.sent, confirmed = _ref3.confirmed,
|
|
73724
|
+
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;
|
|
72827
73725
|
_context2.prev = 1;
|
|
72828
73726
|
_context2.next = 4;
|
|
72829
73727
|
return preflight$1({
|
|
@@ -72849,15 +73747,15 @@
|
|
|
72849
73747
|
event: event,
|
|
72850
73748
|
sent: sent,
|
|
72851
73749
|
confirmed: confirmed,
|
|
72852
|
-
ensured: ensured,
|
|
72853
73750
|
failed: failed,
|
|
72854
73751
|
whitelist: whitelist,
|
|
72855
73752
|
blacklist: blacklist,
|
|
72856
|
-
providers: providers
|
|
73753
|
+
providers: providers,
|
|
73754
|
+
track: track
|
|
72857
73755
|
}
|
|
72858
|
-
}, /*#__PURE__*/react.createElement(ClosableProvider, {
|
|
73756
|
+
}, /*#__PURE__*/react.createElement(UpdatableProvider, null, /*#__PURE__*/react.createElement(ClosableProvider, {
|
|
72859
73757
|
unmount: unmount
|
|
72860
|
-
}, /*#__PURE__*/react.createElement(
|
|
73758
|
+
}, /*#__PURE__*/react.createElement(WalletProvider, {
|
|
72861
73759
|
document: document,
|
|
72862
73760
|
container: container,
|
|
72863
73761
|
connected: connected,
|
|
@@ -72869,13 +73767,15 @@
|
|
|
72869
73767
|
whitelist: whitelist,
|
|
72870
73768
|
blacklist: blacklist,
|
|
72871
73769
|
event: event
|
|
73770
|
+
}, /*#__PURE__*/react.createElement(TrackingProvider, {
|
|
73771
|
+
document: ensureDocument(document)
|
|
72872
73772
|
}, /*#__PURE__*/react.createElement(PaymentProvider, {
|
|
72873
73773
|
container: container,
|
|
72874
73774
|
document: document
|
|
72875
73775
|
}, /*#__PURE__*/react.createElement(PaymentValueProvider, null, /*#__PURE__*/react.createElement(PaymentStack, {
|
|
72876
73776
|
document: document,
|
|
72877
73777
|
container: container
|
|
72878
|
-
})))))))))));
|
|
73778
|
+
}), /*#__PURE__*/react.createElement(PoweredBy, null))))))))))));
|
|
72879
73779
|
};
|
|
72880
73780
|
});
|
|
72881
73781
|
return _context2.abrupt("return", {
|
|
@@ -72985,9 +73885,9 @@
|
|
|
72985
73885
|
var SaleOverviewSkeleton = (function (props) {
|
|
72986
73886
|
return /*#__PURE__*/react.createElement(Dialog, {
|
|
72987
73887
|
header: /*#__PURE__*/react.createElement("div", {
|
|
72988
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
73888
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
72989
73889
|
}, /*#__PURE__*/react.createElement("h1", {
|
|
72990
|
-
className: "LineHeightL FontSizeL
|
|
73890
|
+
className: "LineHeightL FontSizeL"
|
|
72991
73891
|
}, "Purchase")),
|
|
72992
73892
|
body: /*#__PURE__*/react.createElement("div", {
|
|
72993
73893
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -73004,7 +73904,7 @@
|
|
|
73004
73904
|
className: "SkeletonBackground"
|
|
73005
73905
|
}))),
|
|
73006
73906
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
73007
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
73907
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
73008
73908
|
}, /*#__PURE__*/react.createElement("div", {
|
|
73009
73909
|
className: "SkeletonWrapper"
|
|
73010
73910
|
}, /*#__PURE__*/react.createElement("div", {
|
|
@@ -73016,11 +73916,10 @@
|
|
|
73016
73916
|
});
|
|
73017
73917
|
|
|
73018
73918
|
var SaleOverviewDialog = (function (props) {
|
|
73019
|
-
var _useContext = react.useContext(ChangableAmountContext)
|
|
73020
|
-
|
|
73919
|
+
var _useContext = react.useContext(ChangableAmountContext);
|
|
73920
|
+
_useContext.amount;
|
|
73021
73921
|
|
|
73022
73922
|
var _useContext2 = react.useContext(ConfigurationContext),
|
|
73023
|
-
currencyCode = _useContext2.currencyCode,
|
|
73024
73923
|
tokenImage = _useContext2.tokenImage;
|
|
73025
73924
|
|
|
73026
73925
|
var _useContext3 = react.useContext(PaymentValueContext),
|
|
@@ -73028,87 +73927,20 @@
|
|
|
73028
73927
|
|
|
73029
73928
|
var _useContext4 = react.useContext(PaymentContext),
|
|
73030
73929
|
payment = _useContext4.payment,
|
|
73031
|
-
paymentState = _useContext4.paymentState
|
|
73032
|
-
pay = _useContext4.pay,
|
|
73033
|
-
transaction = _useContext4.transaction,
|
|
73034
|
-
approve = _useContext4.approve,
|
|
73035
|
-
approvalTransaction = _useContext4.approvalTransaction;
|
|
73930
|
+
paymentState = _useContext4.paymentState;
|
|
73036
73931
|
|
|
73037
73932
|
var _useContext5 = react.useContext(NavigateStackContext_1),
|
|
73038
73933
|
navigate = _useContext5.navigate;
|
|
73039
73934
|
|
|
73040
|
-
var _useContext6 = react.useContext(
|
|
73041
|
-
|
|
73042
|
-
|
|
73043
|
-
var _useContext7 = react.useContext(ToTokenContext),
|
|
73044
|
-
toToken = _useContext7.toToken,
|
|
73045
|
-
toTokenReadableAmount = _useContext7.toTokenReadableAmount;
|
|
73935
|
+
var _useContext6 = react.useContext(ToTokenContext),
|
|
73936
|
+
toToken = _useContext6.toToken,
|
|
73937
|
+
toTokenReadableAmount = _useContext6.toTokenReadableAmount;
|
|
73046
73938
|
|
|
73047
73939
|
var _useState = react.useState(),
|
|
73048
73940
|
_useState2 = _slicedToArray(_useState, 2),
|
|
73049
73941
|
salePerTokenValue = _useState2[0],
|
|
73050
73942
|
setSalePerTokenValue = _useState2[1];
|
|
73051
73943
|
|
|
73052
|
-
var mainAction = function mainAction() {
|
|
73053
|
-
if (paymentState == 'initialized' || paymentState == 'approving') {
|
|
73054
|
-
return /*#__PURE__*/react.createElement("button", {
|
|
73055
|
-
className: ["ButtonPrimary", payment.route.approvalRequired && !payment.route.directTransfer ? 'disabled' : ''].join(' '),
|
|
73056
|
-
onClick: function onClick() {
|
|
73057
|
-
if (payment.route.approvalRequired && !payment.route.directTransfer) {
|
|
73058
|
-
return;
|
|
73059
|
-
}
|
|
73060
|
-
|
|
73061
|
-
pay({
|
|
73062
|
-
navigate: navigate
|
|
73063
|
-
});
|
|
73064
|
-
}
|
|
73065
|
-
}, "Pay ", new Currency({
|
|
73066
|
-
amount: amount.toFixed(2),
|
|
73067
|
-
code: currencyCode
|
|
73068
|
-
}).toString());
|
|
73069
|
-
} else if (paymentState == 'paying') {
|
|
73070
|
-
return /*#__PURE__*/react.createElement("a", {
|
|
73071
|
-
className: "ButtonPrimary",
|
|
73072
|
-
title: "Performing the payment - please wait",
|
|
73073
|
-
href: transaction === null || transaction === void 0 ? void 0 : transaction.url,
|
|
73074
|
-
target: "_blank",
|
|
73075
|
-
rel: "noopener noreferrer"
|
|
73076
|
-
}, /*#__PURE__*/react.createElement(LoadingText, null, "Paying"));
|
|
73077
|
-
} else if (paymentState == 'confirmed') {
|
|
73078
|
-
return /*#__PURE__*/react.createElement("button", {
|
|
73079
|
-
className: "ButtonPrimary round",
|
|
73080
|
-
title: "Done",
|
|
73081
|
-
onClick: close
|
|
73082
|
-
}, /*#__PURE__*/react.createElement(Checkmark, null));
|
|
73083
|
-
}
|
|
73084
|
-
};
|
|
73085
|
-
|
|
73086
|
-
var approvalAction = function approvalAction() {
|
|
73087
|
-
if (paymentState == 'initialized') {
|
|
73088
|
-
return /*#__PURE__*/react.createElement("div", {
|
|
73089
|
-
className: "PaddingBottomS"
|
|
73090
|
-
}, /*#__PURE__*/react.createElement("button", {
|
|
73091
|
-
className: "ButtonPrimary wide",
|
|
73092
|
-
onClick: approve,
|
|
73093
|
-
title: "Allow ".concat(payment.symbol, " to be used as payment")
|
|
73094
|
-
}, "Allow ", payment.symbol, " to be used as payment"));
|
|
73095
|
-
} else if (paymentState == 'approving') {
|
|
73096
|
-
return /*#__PURE__*/react.createElement("div", {
|
|
73097
|
-
className: "PaddingBottomS"
|
|
73098
|
-
}, /*#__PURE__*/react.createElement("a", {
|
|
73099
|
-
className: "ButtonPrimary wide",
|
|
73100
|
-
title: "Approving payment token - please wait",
|
|
73101
|
-
href: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
|
|
73102
|
-
target: "_blank",
|
|
73103
|
-
rel: "noopener noreferrer"
|
|
73104
|
-
}, /*#__PURE__*/react.createElement(LoadingText, null, "Approving")));
|
|
73105
|
-
}
|
|
73106
|
-
};
|
|
73107
|
-
|
|
73108
|
-
var actions = function actions() {
|
|
73109
|
-
return /*#__PURE__*/react.createElement("div", null, payment.route.approvalRequired && !payment.route.directTransfer && approvalAction(), mainAction());
|
|
73110
|
-
};
|
|
73111
|
-
|
|
73112
73944
|
react.useEffect(function () {
|
|
73113
73945
|
if (paymentValue) {
|
|
73114
73946
|
setSalePerTokenValue(new Currency({
|
|
@@ -73137,9 +73969,9 @@
|
|
|
73137
73969
|
|
|
73138
73970
|
return /*#__PURE__*/react.createElement(Dialog, {
|
|
73139
73971
|
header: /*#__PURE__*/react.createElement("div", {
|
|
73140
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
73972
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
73141
73973
|
}, /*#__PURE__*/react.createElement("h1", {
|
|
73142
|
-
className: "LineHeightL FontSizeL
|
|
73974
|
+
className: "LineHeightL FontSizeL"
|
|
73143
73975
|
}, "Purchase")),
|
|
73144
73976
|
body: /*#__PURE__*/react.createElement("div", {
|
|
73145
73977
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -73208,8 +74040,8 @@
|
|
|
73208
74040
|
className: "CardAction"
|
|
73209
74041
|
}, /*#__PURE__*/react.createElement(ChevronRight, null)))),
|
|
73210
74042
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
73211
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
73212
|
-
},
|
|
74043
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
74044
|
+
}, /*#__PURE__*/react.createElement(Footer, null))
|
|
73213
74045
|
});
|
|
73214
74046
|
});
|
|
73215
74047
|
|
|
@@ -73282,12 +74114,12 @@
|
|
|
73282
74114
|
|
|
73283
74115
|
var Sale = /*#__PURE__*/function () {
|
|
73284
74116
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(_ref3) {
|
|
73285
|
-
var amount, sell, sent, confirmed,
|
|
74117
|
+
var amount, sell, sent, confirmed, failed, error, critical, style, blacklist, providers, currency, connected, closed, tokenImage, document, accept, unmount;
|
|
73286
74118
|
return regenerator.wrap(function _callee2$(_context2) {
|
|
73287
74119
|
while (1) {
|
|
73288
74120
|
switch (_context2.prev = _context2.next) {
|
|
73289
74121
|
case 0:
|
|
73290
|
-
amount = _ref3.amount, sell = _ref3.sell, sent = _ref3.sent, confirmed = _ref3.confirmed,
|
|
74122
|
+
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;
|
|
73291
74123
|
_context2.prev = 1;
|
|
73292
74124
|
_context2.next = 4;
|
|
73293
74125
|
return preflight({
|
|
@@ -73319,26 +74151,27 @@
|
|
|
73319
74151
|
currency: currency,
|
|
73320
74152
|
sent: sent,
|
|
73321
74153
|
confirmed: confirmed,
|
|
73322
|
-
ensured: ensured,
|
|
73323
74154
|
failed: failed,
|
|
73324
74155
|
blacklist: blacklist,
|
|
73325
74156
|
providers: providers
|
|
73326
74157
|
}
|
|
73327
|
-
}, /*#__PURE__*/react.createElement(ClosableProvider, {
|
|
74158
|
+
}, /*#__PURE__*/react.createElement(UpdatableProvider, null, /*#__PURE__*/react.createElement(ClosableProvider, {
|
|
73328
74159
|
unmount: unmount
|
|
73329
|
-
}, /*#__PURE__*/react.createElement(
|
|
74160
|
+
}, /*#__PURE__*/react.createElement(WalletProvider, {
|
|
73330
74161
|
container: container,
|
|
73331
74162
|
connected: connected,
|
|
73332
74163
|
unmount: unmount
|
|
73333
74164
|
}, /*#__PURE__*/react.createElement(ConversionRateProvider, null, /*#__PURE__*/react.createElement(ChangableAmountProvider, {
|
|
73334
74165
|
accept: accept
|
|
74166
|
+
}, /*#__PURE__*/react.createElement(TrackingProvider, {
|
|
74167
|
+
document: ensureDocument(document)
|
|
73335
74168
|
}, /*#__PURE__*/react.createElement(SaleRoutingProvider, {
|
|
73336
74169
|
container: container,
|
|
73337
74170
|
document: document
|
|
73338
74171
|
}, /*#__PURE__*/react.createElement(SaleStack, {
|
|
73339
74172
|
document: document,
|
|
73340
74173
|
container: container
|
|
73341
|
-
})))))))));
|
|
74174
|
+
}), /*#__PURE__*/react.createElement(PoweredBy, null))))))))));
|
|
73342
74175
|
};
|
|
73343
74176
|
});
|
|
73344
74177
|
return _context2.abrupt("return", {
|