@depay/widgets 4.4.1 → 5.0.4
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 +647 -406
- package/dist/cjs/index.js +605 -381
- package/dist/es/index.bundle.js +647 -406
- package/dist/es/index.js +606 -382
- package/dist/umd/index.bundle.js +647 -406
- package/dist/umd/index.js +605 -381
- 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
|
}
|
|
@@ -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) {
|
|
@@ -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(() => {
|
|
@@ -51691,6 +51702,9 @@
|
|
|
51691
51702
|
sentTransaction.wait(12).then(() => {
|
|
51692
51703
|
transaction._ensured = true;
|
|
51693
51704
|
if (transaction.ensured) transaction.ensured(transaction);
|
|
51705
|
+
}).catch((error)=>{
|
|
51706
|
+
transaction._failed = true;
|
|
51707
|
+
if(transaction.failed) transaction.failed(transaction, error);
|
|
51694
51708
|
});
|
|
51695
51709
|
} else {
|
|
51696
51710
|
throw('Submitting transaction failed!')
|
|
@@ -51879,6 +51893,7 @@
|
|
|
51879
51893
|
transaction.url = blockchain.explorerUrlFor({ transaction });
|
|
51880
51894
|
if (transaction.sent) transaction.sent(transaction);
|
|
51881
51895
|
let sentTransaction = await retrieveTransaction(tx, transaction.blockchain);
|
|
51896
|
+
transaction.nonce = sentTransaction.nonce;
|
|
51882
51897
|
if(!sentTransaction) {
|
|
51883
51898
|
transaction._failed = true;
|
|
51884
51899
|
console.log('Error retrieving transaction');
|
|
@@ -51894,6 +51909,9 @@
|
|
|
51894
51909
|
sentTransaction.wait(12).then(() => {
|
|
51895
51910
|
transaction._ensured = true;
|
|
51896
51911
|
if (transaction.ensured) transaction.ensured(transaction);
|
|
51912
|
+
}).catch((error)=>{
|
|
51913
|
+
transaction._failed = true;
|
|
51914
|
+
if(transaction.failed) transaction.failed(transaction, error);
|
|
51897
51915
|
});
|
|
51898
51916
|
}
|
|
51899
51917
|
} else {
|
|
@@ -52166,7 +52184,7 @@
|
|
|
52166
52184
|
return connect(wallet);
|
|
52167
52185
|
}
|
|
52168
52186
|
}, /*#__PURE__*/react.createElement("div", {
|
|
52169
|
-
className: "CardImage
|
|
52187
|
+
className: "CardImage"
|
|
52170
52188
|
}, /*#__PURE__*/react.createElement("img", {
|
|
52171
52189
|
src: wallet.logo
|
|
52172
52190
|
})), /*#__PURE__*/react.createElement("div", {
|
|
@@ -52179,9 +52197,9 @@
|
|
|
52179
52197
|
});
|
|
52180
52198
|
return /*#__PURE__*/react.createElement(Dialog, {
|
|
52181
52199
|
header: /*#__PURE__*/react.createElement("div", {
|
|
52182
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
52200
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
52183
52201
|
}, /*#__PURE__*/react.createElement("h1", {
|
|
52184
|
-
className: "LineHeightL FontSizeL
|
|
52202
|
+
className: "LineHeightL FontSizeL"
|
|
52185
52203
|
}, "Select a wallet")),
|
|
52186
52204
|
body: /*#__PURE__*/react.createElement("div", {
|
|
52187
52205
|
className: "PaddingTopS PaddingBottomXS PaddingLeftS PaddingRightS"
|
|
@@ -52189,11 +52207,13 @@
|
|
|
52189
52207
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
52190
52208
|
className: "PaddingBottomS"
|
|
52191
52209
|
}, /*#__PURE__*/react.createElement("button", {
|
|
52192
|
-
className: "FontSizeS FontWeightBold
|
|
52210
|
+
className: "FontSizeS FontWeightBold TextButton",
|
|
52193
52211
|
onClick: function onClick() {
|
|
52194
52212
|
return setShowExplanation(!showExplanation);
|
|
52195
52213
|
}
|
|
52196
|
-
}, /*#__PURE__*/react.createElement("strong",
|
|
52214
|
+
}, /*#__PURE__*/react.createElement("strong", {
|
|
52215
|
+
className: "Opacity05"
|
|
52216
|
+
}, "What is a wallet?")), showExplanation && /*#__PURE__*/react.createElement("p", {
|
|
52197
52217
|
className: "PaddingLeftM PaddingRightM"
|
|
52198
52218
|
}, "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
52219
|
});
|
|
@@ -52346,6 +52366,9 @@
|
|
|
52346
52366
|
function _createClass$1(Constructor, protoProps, staticProps) {
|
|
52347
52367
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
52348
52368
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
52369
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
52370
|
+
writable: false
|
|
52371
|
+
});
|
|
52349
52372
|
return Constructor;
|
|
52350
52373
|
}
|
|
52351
52374
|
|
|
@@ -52363,12 +52386,15 @@
|
|
|
52363
52386
|
throw new TypeError("Super expression must either be null or a function");
|
|
52364
52387
|
}
|
|
52365
52388
|
|
|
52366
|
-
|
|
52367
|
-
|
|
52368
|
-
|
|
52369
|
-
|
|
52370
|
-
|
|
52371
|
-
|
|
52389
|
+
Object.defineProperty(subClass, "prototype", {
|
|
52390
|
+
value: Object.create(superClass && superClass.prototype, {
|
|
52391
|
+
constructor: {
|
|
52392
|
+
value: subClass,
|
|
52393
|
+
writable: true,
|
|
52394
|
+
configurable: true
|
|
52395
|
+
}
|
|
52396
|
+
}),
|
|
52397
|
+
writable: false
|
|
52372
52398
|
});
|
|
52373
52399
|
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
52374
52400
|
}
|
|
@@ -52471,7 +52497,7 @@
|
|
|
52471
52497
|
})), /*#__PURE__*/react.createElement("div", {
|
|
52472
52498
|
className: "DialogBody"
|
|
52473
52499
|
}, /*#__PURE__*/react.createElement("div", {
|
|
52474
|
-
className: "GraphicWrapper"
|
|
52500
|
+
className: "GraphicWrapper PaddingTopS"
|
|
52475
52501
|
}, /*#__PURE__*/react.createElement("img", {
|
|
52476
52502
|
className: "Graphic",
|
|
52477
52503
|
src: ErrorGraphic
|
|
@@ -52489,15 +52515,12 @@
|
|
|
52489
52515
|
className: "FontSizeM PaddingTopS"
|
|
52490
52516
|
}, "If this keeps happening, please report it.")))), /*#__PURE__*/react.createElement("div", {
|
|
52491
52517
|
className: "DialogFooter"
|
|
52492
|
-
}, /*#__PURE__*/react.createElement("div",
|
|
52518
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
52519
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
52520
|
+
}, /*#__PURE__*/react.createElement("button", {
|
|
52493
52521
|
className: "ButtonPrimary",
|
|
52494
52522
|
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"))));
|
|
52523
|
+
}, "Try again")))));
|
|
52501
52524
|
} else {
|
|
52502
52525
|
return /*#__PURE__*/react.createElement(ErrorContext.Provider, {
|
|
52503
52526
|
value: {
|
|
@@ -52509,28 +52532,28 @@
|
|
|
52509
52532
|
}
|
|
52510
52533
|
});
|
|
52511
52534
|
|
|
52535
|
+
var BlockchainLogoStyle = (function (style) {
|
|
52536
|
+
return "\n\n .BlockchainLogo {\n border-radius: 999px;\n }\n\n .BlockchainLogo.small {\n height: 18px;\n width: 18px;\n }\n ";
|
|
52537
|
+
});
|
|
52538
|
+
|
|
52512
52539
|
var ButtonCircularStyle = (function () {
|
|
52513
52540
|
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
52541
|
});
|
|
52515
52542
|
|
|
52516
52543
|
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:
|
|
52544
|
+
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
52545
|
});
|
|
52519
52546
|
|
|
52520
52547
|
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.
|
|
52548
|
+
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
52549
|
});
|
|
52523
52550
|
|
|
52524
52551
|
var DialogStyle = (function (style) {
|
|
52525
|
-
return "\n\n .ReactDialogBackground {\n backdrop-filter: blur(5px);\n background: rgba(0,0,0,0.7);\n }\n\n .Dialog {\n margin: 0 auto;\n position: relative;\n width: 420px;\n box-shadow: 0 0 20px rgba(0,0,0,0.1);\n border-radius: 0.8rem;\n }\n\n @media screen and (max-width: 450px) {\n \n .Dialog, .ReactDialogAnimation {\n width: 100%;\n }\n\n }\n\n @media (orientation: portrait) and (max-width: 900px) {\n\n .Dialog {\n align-content: stretch;\n display: flex;\n flex-direction: column;\n height: 100%;\n }\n\n .DialogBody {\n flex: 1;\n align-items: flex-end;\n max-height: 40vh !important;\n }\n\n .
|
|
52552
|
+
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
52553
|
});
|
|
52527
52554
|
|
|
52528
52555
|
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 ");
|
|
52556
|
+
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
52557
|
});
|
|
52535
52558
|
|
|
52536
52559
|
var GraphicStyle = (function () {
|
|
@@ -52542,7 +52565,7 @@
|
|
|
52542
52565
|
});
|
|
52543
52566
|
|
|
52544
52567
|
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:
|
|
52568
|
+
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
52569
|
});
|
|
52547
52570
|
|
|
52548
52571
|
var ImageStyle = (function (style) {
|
|
@@ -52561,10 +52584,18 @@
|
|
|
52561
52584
|
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
52585
|
});
|
|
52563
52586
|
|
|
52587
|
+
var OpacityStyle = (function (style) {
|
|
52588
|
+
return "\n\n .Opacity05 {\n opacity: 0.5;\n }\n ";
|
|
52589
|
+
});
|
|
52590
|
+
|
|
52564
52591
|
var PaddingStyle = (function () {
|
|
52565
52592
|
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
52593
|
});
|
|
52567
52594
|
|
|
52595
|
+
var PoweredByStyle = (function (style) {
|
|
52596
|
+
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 ");
|
|
52597
|
+
});
|
|
52598
|
+
|
|
52568
52599
|
var RangeSliderStyle = (function (style) {
|
|
52569
52600
|
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
52601
|
});
|
|
@@ -52574,15 +52605,15 @@
|
|
|
52574
52605
|
});
|
|
52575
52606
|
|
|
52576
52607
|
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 ";
|
|
52608
|
+
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
52609
|
});
|
|
52579
52610
|
|
|
52580
52611
|
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
|
|
52612
|
+
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
52613
|
});
|
|
52583
52614
|
|
|
52584
52615
|
var TextStyle = (function (style) {
|
|
52585
|
-
return "\n\n * {\n color: ".concat(style.colors.text, ";\n }\n\n
|
|
52616
|
+
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
52617
|
});
|
|
52587
52618
|
|
|
52588
52619
|
var TokenAmountStyle = (function () {
|
|
@@ -52599,7 +52630,7 @@
|
|
|
52599
52630
|
},
|
|
52600
52631
|
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'
|
|
52601
52632
|
}, style);
|
|
52602
|
-
return [ResetStyle(), FontStyle(style), DialogStyle(), ButtonCircularStyle(), ButtonPrimaryStyle(style), CardStyle(style),
|
|
52633
|
+
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
52634
|
});
|
|
52604
52635
|
|
|
52605
52636
|
function _interopDefaultLegacy$2 (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -52719,6 +52750,31 @@
|
|
|
52719
52750
|
return unmount;
|
|
52720
52751
|
});
|
|
52721
52752
|
|
|
52753
|
+
var PoweredBy = (function () {
|
|
52754
|
+
return /*#__PURE__*/react.createElement("div", {
|
|
52755
|
+
className: "PoweredByWrapper"
|
|
52756
|
+
}, /*#__PURE__*/react.createElement("a", {
|
|
52757
|
+
href: 'https://depay.fi?utm_source=' + window.location.hostname + '&utm_medium=widget&utm_campaign=WidgetV2',
|
|
52758
|
+
rel: "noopener noreferrer",
|
|
52759
|
+
target: "_blank",
|
|
52760
|
+
className: "PoweredByLink"
|
|
52761
|
+
}, "by DePay"));
|
|
52762
|
+
});
|
|
52763
|
+
|
|
52764
|
+
var UpdatableProvider = (function (props) {
|
|
52765
|
+
var _useState = react.useState(true),
|
|
52766
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
52767
|
+
updatable = _useState2[0],
|
|
52768
|
+
setUpdatable = _useState2[1];
|
|
52769
|
+
|
|
52770
|
+
return /*#__PURE__*/react.createElement(UpdatableContext.Provider, {
|
|
52771
|
+
value: {
|
|
52772
|
+
updatable: updatable,
|
|
52773
|
+
setUpdatable: setUpdatable
|
|
52774
|
+
}
|
|
52775
|
+
}, props.children);
|
|
52776
|
+
});
|
|
52777
|
+
|
|
52722
52778
|
var Connect = function Connect(options) {
|
|
52723
52779
|
var style, error, document;
|
|
52724
52780
|
|
|
@@ -52774,7 +52830,7 @@
|
|
|
52774
52830
|
error: error,
|
|
52775
52831
|
container: container,
|
|
52776
52832
|
unmount: unmount
|
|
52777
|
-
}, /*#__PURE__*/react.createElement(ClosableProvider, {
|
|
52833
|
+
}, /*#__PURE__*/react.createElement(UpdatableProvider, null, /*#__PURE__*/react.createElement(ClosableProvider, {
|
|
52778
52834
|
unmount: rejectBeforeUnmount
|
|
52779
52835
|
}, /*#__PURE__*/react.createElement(ConnectStack, {
|
|
52780
52836
|
document: document,
|
|
@@ -52782,7 +52838,7 @@
|
|
|
52782
52838
|
resolve: resolve,
|
|
52783
52839
|
reject: reject,
|
|
52784
52840
|
autoClose: true
|
|
52785
|
-
})));
|
|
52841
|
+
}), /*#__PURE__*/react.createElement(PoweredBy, null))));
|
|
52786
52842
|
};
|
|
52787
52843
|
});
|
|
52788
52844
|
|
|
@@ -63951,7 +64007,8 @@
|
|
|
63951
64007
|
})
|
|
63952
64008
|
.then((amountsOut)=>{
|
|
63953
64009
|
resolve(amountsOut[amountsOut.length - 1]);
|
|
63954
|
-
})
|
|
64010
|
+
})
|
|
64011
|
+
.catch(()=>resolve());
|
|
63955
64012
|
})
|
|
63956
64013
|
};
|
|
63957
64014
|
|
|
@@ -64296,7 +64353,8 @@
|
|
|
64296
64353
|
})
|
|
64297
64354
|
.then((amountsOut)=>{
|
|
64298
64355
|
resolve(amountsOut[amountsOut.length - 1]);
|
|
64299
|
-
})
|
|
64356
|
+
})
|
|
64357
|
+
.catch(()=>resolve());
|
|
64300
64358
|
})
|
|
64301
64359
|
};
|
|
64302
64360
|
|
|
@@ -65369,7 +65427,9 @@
|
|
|
65369
65427
|
}, /*#__PURE__*/react.createElement("strong", {
|
|
65370
65428
|
className: "FontSizeM"
|
|
65371
65429
|
}, "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."))),
|
|
65372
|
-
footer: /*#__PURE__*/react.createElement("div",
|
|
65430
|
+
footer: /*#__PURE__*/react.createElement("div", {
|
|
65431
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
65432
|
+
}, /*#__PURE__*/react.createElement("button", {
|
|
65373
65433
|
className: "ButtonPrimary",
|
|
65374
65434
|
onClick: close
|
|
65375
65435
|
}, "Ok"))
|
|
@@ -65380,7 +65440,7 @@
|
|
|
65380
65440
|
|
|
65381
65441
|
var PaymentRoutingContext = /*#__PURE__*/react.createContext();
|
|
65382
65442
|
|
|
65383
|
-
var
|
|
65443
|
+
var TrackingContext = /*#__PURE__*/react.createContext();
|
|
65384
65444
|
|
|
65385
65445
|
var PaymentProvider = (function (props) {
|
|
65386
65446
|
var _useContext = react.useContext(ErrorContext),
|
|
@@ -65389,7 +65449,6 @@
|
|
|
65389
65449
|
var _useContext2 = react.useContext(ConfigurationContext),
|
|
65390
65450
|
_sent = _useContext2.sent,
|
|
65391
65451
|
_confirmed = _useContext2.confirmed,
|
|
65392
|
-
_ensured = _useContext2.ensured,
|
|
65393
65452
|
_failed = _useContext2.failed;
|
|
65394
65453
|
|
|
65395
65454
|
var _useContext3 = react.useContext(PaymentRoutingContext),
|
|
@@ -65403,13 +65462,17 @@
|
|
|
65403
65462
|
var _useContext5 = react.useContext(PaymentRoutingContext),
|
|
65404
65463
|
allRoutes = _useContext5.allRoutes;
|
|
65405
65464
|
|
|
65406
|
-
var _useContext6 = react.useContext(
|
|
65407
|
-
_useContext6.
|
|
65408
|
-
var setUpdate = _useContext6.setUpdate;
|
|
65465
|
+
var _useContext6 = react.useContext(UpdatableContext),
|
|
65466
|
+
setUpdatable = _useContext6.setUpdatable;
|
|
65409
65467
|
|
|
65410
65468
|
var _useContext7 = react.useContext(WalletContext),
|
|
65411
65469
|
wallet = _useContext7.wallet;
|
|
65412
65470
|
|
|
65471
|
+
var _useContext8 = react.useContext(TrackingContext),
|
|
65472
|
+
forward = _useContext8.forward,
|
|
65473
|
+
tracking = _useContext8.tracking,
|
|
65474
|
+
initializeTracking = _useContext8.initializeTracking;
|
|
65475
|
+
|
|
65413
65476
|
var _useState = react.useState(),
|
|
65414
65477
|
_useState2 = _slicedToArray(_useState, 2),
|
|
65415
65478
|
payment = _useState2[0],
|
|
@@ -65430,53 +65493,81 @@
|
|
|
65430
65493
|
paymentState = _useState8[0],
|
|
65431
65494
|
setPaymentState = _useState8[1];
|
|
65432
65495
|
|
|
65433
|
-
var pay = function
|
|
65434
|
-
var
|
|
65435
|
-
|
|
65436
|
-
|
|
65437
|
-
|
|
65438
|
-
|
|
65439
|
-
|
|
65440
|
-
|
|
65441
|
-
|
|
65442
|
-
|
|
65443
|
-
|
|
65444
|
-
|
|
65445
|
-
|
|
65446
|
-
|
|
65496
|
+
var pay = /*#__PURE__*/function () {
|
|
65497
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(_ref) {
|
|
65498
|
+
var navigate, currentBlock;
|
|
65499
|
+
return regenerator.wrap(function _callee$(_context) {
|
|
65500
|
+
while (1) {
|
|
65501
|
+
switch (_context.prev = _context.next) {
|
|
65502
|
+
case 0:
|
|
65503
|
+
navigate = _ref.navigate;
|
|
65504
|
+
setClosable(false);
|
|
65505
|
+
setPaymentState('paying');
|
|
65506
|
+
setUpdatable(false);
|
|
65507
|
+
_context.next = 6;
|
|
65508
|
+
return request({
|
|
65509
|
+
blockchain: payment.route.transaction.blockchain,
|
|
65510
|
+
method: 'latestBlockNumber'
|
|
65511
|
+
});
|
|
65447
65512
|
|
|
65448
|
-
|
|
65449
|
-
|
|
65450
|
-
|
|
65451
|
-
|
|
65452
|
-
|
|
65453
|
-
|
|
65454
|
-
|
|
65455
|
-
|
|
65456
|
-
|
|
65457
|
-
|
|
65458
|
-
|
|
65459
|
-
|
|
65460
|
-
}
|
|
65513
|
+
case 6:
|
|
65514
|
+
currentBlock = _context.sent;
|
|
65515
|
+
wallet.sendTransaction(Object.assign({}, payment.route.transaction, {
|
|
65516
|
+
sent: function sent(transaction) {
|
|
65517
|
+
if (_sent) {
|
|
65518
|
+
_sent(transaction);
|
|
65519
|
+
}
|
|
65520
|
+
},
|
|
65521
|
+
confirmed: function confirmed(transaction) {
|
|
65522
|
+
if (tracking != true) {
|
|
65523
|
+
setClosable(true);
|
|
65524
|
+
}
|
|
65461
65525
|
|
|
65462
|
-
|
|
65463
|
-
setClosable(true);
|
|
65464
|
-
setUpdate(true);
|
|
65465
|
-
navigate('PaymentError');
|
|
65466
|
-
}
|
|
65467
|
-
})).then(function (sentTransaction) {
|
|
65468
|
-
setTransaction(sentTransaction);
|
|
65469
|
-
})["catch"](function (error) {
|
|
65470
|
-
console.log('error', error);
|
|
65471
|
-
setPaymentState('initialized');
|
|
65472
|
-
setClosable(true);
|
|
65473
|
-
setUpdate(true);
|
|
65526
|
+
setPaymentState('confirmed');
|
|
65474
65527
|
|
|
65475
|
-
|
|
65476
|
-
|
|
65477
|
-
|
|
65478
|
-
|
|
65479
|
-
|
|
65528
|
+
if (_confirmed) {
|
|
65529
|
+
_confirmed(transaction);
|
|
65530
|
+
}
|
|
65531
|
+
},
|
|
65532
|
+
failed: function failed(transaction, error) {
|
|
65533
|
+
if (_failed) {
|
|
65534
|
+
_failed(transaction, error);
|
|
65535
|
+
}
|
|
65536
|
+
|
|
65537
|
+
setPaymentState('initialized');
|
|
65538
|
+
setClosable(true);
|
|
65539
|
+
setUpdatable(true);
|
|
65540
|
+
navigate('PaymentError');
|
|
65541
|
+
}
|
|
65542
|
+
})).then(function (sentTransaction) {
|
|
65543
|
+
if (tracking) {
|
|
65544
|
+
initializeTracking(sentTransaction, currentBlock);
|
|
65545
|
+
}
|
|
65546
|
+
|
|
65547
|
+
setTransaction(sentTransaction);
|
|
65548
|
+
})["catch"](function (error) {
|
|
65549
|
+
console.log('error', error);
|
|
65550
|
+
setPaymentState('initialized');
|
|
65551
|
+
setClosable(true);
|
|
65552
|
+
setUpdatable(true);
|
|
65553
|
+
|
|
65554
|
+
if ((error === null || error === void 0 ? void 0 : error.code) == 'WRONG_NETWORK') {
|
|
65555
|
+
navigate('WrongNetwork');
|
|
65556
|
+
}
|
|
65557
|
+
});
|
|
65558
|
+
|
|
65559
|
+
case 8:
|
|
65560
|
+
case "end":
|
|
65561
|
+
return _context.stop();
|
|
65562
|
+
}
|
|
65563
|
+
}
|
|
65564
|
+
}, _callee);
|
|
65565
|
+
}));
|
|
65566
|
+
|
|
65567
|
+
return function pay(_x) {
|
|
65568
|
+
return _ref2.apply(this, arguments);
|
|
65569
|
+
};
|
|
65570
|
+
}();
|
|
65480
65571
|
|
|
65481
65572
|
var approve = function approve() {
|
|
65482
65573
|
setClosable(false);
|
|
@@ -65497,15 +65588,20 @@
|
|
|
65497
65588
|
});
|
|
65498
65589
|
};
|
|
65499
65590
|
|
|
65591
|
+
react.useEffect(function () {
|
|
65592
|
+
if (forward) {
|
|
65593
|
+
setPaymentState('confirmed');
|
|
65594
|
+
}
|
|
65595
|
+
}, [forward]);
|
|
65500
65596
|
react.useEffect(function () {
|
|
65501
65597
|
if (selectedRoute) {
|
|
65502
65598
|
var fromToken = selectedRoute.fromToken;
|
|
65503
65599
|
selectedRoute.transaction.params;
|
|
65504
|
-
Promise.all([fromToken.name(), fromToken.symbol(), fromToken.readable(selectedRoute.fromAmount)]).then(function (
|
|
65505
|
-
var
|
|
65506
|
-
name =
|
|
65507
|
-
symbol =
|
|
65508
|
-
amount =
|
|
65600
|
+
Promise.all([fromToken.name(), fromToken.symbol(), fromToken.readable(selectedRoute.fromAmount)]).then(function (_ref3) {
|
|
65601
|
+
var _ref4 = _slicedToArray(_ref3, 3),
|
|
65602
|
+
name = _ref4[0],
|
|
65603
|
+
symbol = _ref4[1],
|
|
65604
|
+
amount = _ref4[2];
|
|
65509
65605
|
|
|
65510
65606
|
setPayment({
|
|
65511
65607
|
route: selectedRoute,
|
|
@@ -65521,9 +65617,9 @@
|
|
|
65521
65617
|
}, [selectedRoute]);
|
|
65522
65618
|
react.useEffect(function () {
|
|
65523
65619
|
if (allRoutes && allRoutes.length == 0) {
|
|
65524
|
-
|
|
65620
|
+
setUpdatable(false);
|
|
65525
65621
|
} else if (allRoutes && allRoutes.length > 0) {
|
|
65526
|
-
|
|
65622
|
+
setUpdatable(true);
|
|
65527
65623
|
}
|
|
65528
65624
|
}, [allRoutes]);
|
|
65529
65625
|
|
|
@@ -70323,9 +70419,9 @@
|
|
|
70323
70419
|
})
|
|
70324
70420
|
};
|
|
70325
70421
|
|
|
70326
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
70422
|
+
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; }
|
|
70327
70423
|
|
|
70328
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
70424
|
+
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; }
|
|
70329
70425
|
var PaymentRoutingProvider = (function (props) {
|
|
70330
70426
|
var _useState = react.useState(),
|
|
70331
70427
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -70345,8 +70441,8 @@
|
|
|
70345
70441
|
var _useContext = react.useContext(WalletContext),
|
|
70346
70442
|
account = _useContext.account;
|
|
70347
70443
|
|
|
70348
|
-
var _useContext2 = react.useContext(
|
|
70349
|
-
|
|
70444
|
+
var _useContext2 = react.useContext(UpdatableContext),
|
|
70445
|
+
updatable = _useContext2.updatable;
|
|
70350
70446
|
|
|
70351
70447
|
var prepareAcceptedPayments = function prepareAcceptedPayments(accept) {
|
|
70352
70448
|
var toAddress = _typeof(accept.receiver) == 'object' ? accept.receiver.address : accept.receiver;
|
|
@@ -70361,9 +70457,9 @@
|
|
|
70361
70457
|
var getPaymentRoutes = function getPaymentRoutes(_ref) {
|
|
70362
70458
|
var allRoutes = _ref.allRoutes,
|
|
70363
70459
|
selectedRoute = _ref.selectedRoute,
|
|
70364
|
-
|
|
70460
|
+
updatable = _ref.updatable;
|
|
70365
70461
|
|
|
70366
|
-
if (
|
|
70462
|
+
if (updatable == false || !props.accept || !account) {
|
|
70367
70463
|
return;
|
|
70368
70464
|
}
|
|
70369
70465
|
|
|
@@ -70466,13 +70562,13 @@
|
|
|
70466
70562
|
getPaymentRoutes({
|
|
70467
70563
|
allRoutes: allRoutes,
|
|
70468
70564
|
selectedRoute: selectedRoute,
|
|
70469
|
-
|
|
70565
|
+
updatable: updatable
|
|
70470
70566
|
});
|
|
70471
70567
|
}, 15000);
|
|
70472
70568
|
return function () {
|
|
70473
70569
|
return clearTimeout(timeout);
|
|
70474
70570
|
};
|
|
70475
|
-
}, [reloadCount, allRoutes, selectedRoute,
|
|
70571
|
+
}, [reloadCount, allRoutes, selectedRoute, updatable]);
|
|
70476
70572
|
react.useEffect(function () {
|
|
70477
70573
|
if (account && props.accept) {
|
|
70478
70574
|
setAllRoutes(undefined);
|
|
@@ -70502,8 +70598,8 @@
|
|
|
70502
70598
|
var _useContext2 = react.useContext(WalletContext),
|
|
70503
70599
|
account = _useContext2.account;
|
|
70504
70600
|
|
|
70505
|
-
var _useContext3 = react.useContext(
|
|
70506
|
-
|
|
70601
|
+
var _useContext3 = react.useContext(UpdatableContext),
|
|
70602
|
+
updatable = _useContext3.updatable;
|
|
70507
70603
|
|
|
70508
70604
|
var _useContext4 = react.useContext(PaymentContext),
|
|
70509
70605
|
payment = _useContext4.payment;
|
|
@@ -70522,10 +70618,10 @@
|
|
|
70522
70618
|
setReloadCount = _useState4[1];
|
|
70523
70619
|
|
|
70524
70620
|
var getToTokenLocalValue = function getToTokenLocalValue(_ref) {
|
|
70525
|
-
var
|
|
70621
|
+
var updatable = _ref.updatable,
|
|
70526
70622
|
payment = _ref.payment;
|
|
70527
70623
|
|
|
70528
|
-
if (
|
|
70624
|
+
if (updatable == false || (payment === null || payment === void 0 ? void 0 : payment.route) == undefined) {
|
|
70529
70625
|
return;
|
|
70530
70626
|
}
|
|
70531
70627
|
|
|
@@ -70568,7 +70664,7 @@
|
|
|
70568
70664
|
react.useEffect(function () {
|
|
70569
70665
|
if (account && payment) {
|
|
70570
70666
|
getToTokenLocalValue({
|
|
70571
|
-
|
|
70667
|
+
updatable: updatable,
|
|
70572
70668
|
payment: payment
|
|
70573
70669
|
});
|
|
70574
70670
|
}
|
|
@@ -70577,13 +70673,13 @@
|
|
|
70577
70673
|
var timeout = setTimeout(function () {
|
|
70578
70674
|
setReloadCount(reloadCount + 1);
|
|
70579
70675
|
getToTokenLocalValue({
|
|
70580
|
-
|
|
70676
|
+
updatable: updatable
|
|
70581
70677
|
});
|
|
70582
70678
|
}, 15000);
|
|
70583
70679
|
return function () {
|
|
70584
70680
|
return clearTimeout(timeout);
|
|
70585
70681
|
};
|
|
70586
|
-
}, [reloadCount,
|
|
70682
|
+
}, [reloadCount, updatable]);
|
|
70587
70683
|
return /*#__PURE__*/react.createElement(PaymentValueContext.Provider, {
|
|
70588
70684
|
value: {
|
|
70589
70685
|
paymentValue: paymentValue
|
|
@@ -70752,24 +70848,11 @@
|
|
|
70752
70848
|
* LICENSE file in the root directory of this source tree.
|
|
70753
70849
|
*/
|
|
70754
70850
|
|
|
70755
|
-
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
70756
|
-
|
|
70757
|
-
var ReactPropTypesSecret_1 = ReactPropTypesSecret;
|
|
70758
|
-
|
|
70759
|
-
/**
|
|
70760
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
70761
|
-
*
|
|
70762
|
-
* This source code is licensed under the MIT license found in the
|
|
70763
|
-
* LICENSE file in the root directory of this source tree.
|
|
70764
|
-
*/
|
|
70765
|
-
|
|
70766
|
-
|
|
70767
|
-
|
|
70851
|
+
var ReactPropTypesSecret$1 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
70768
70852
|
|
|
70853
|
+
var ReactPropTypesSecret_1 = ReactPropTypesSecret$1;
|
|
70769
70854
|
|
|
70770
|
-
|
|
70771
|
-
|
|
70772
|
-
Function.call.bind(Object.prototype.hasOwnProperty);
|
|
70855
|
+
var ReactPropTypesSecret = ReactPropTypesSecret_1;
|
|
70773
70856
|
|
|
70774
70857
|
/**
|
|
70775
70858
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
@@ -70786,7 +70869,7 @@
|
|
|
70786
70869
|
|
|
70787
70870
|
var factoryWithThrowingShims = function() {
|
|
70788
70871
|
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
70789
|
-
if (secret ===
|
|
70872
|
+
if (secret === ReactPropTypesSecret) {
|
|
70790
70873
|
// It is still safe when called from React.
|
|
70791
70874
|
return;
|
|
70792
70875
|
}
|
|
@@ -70804,6 +70887,7 @@
|
|
|
70804
70887
|
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
70805
70888
|
var ReactPropTypes = {
|
|
70806
70889
|
array: shim,
|
|
70890
|
+
bigint: shim,
|
|
70807
70891
|
bool: shim,
|
|
70808
70892
|
func: shim,
|
|
70809
70893
|
number: shim,
|
|
@@ -70832,6 +70916,8 @@
|
|
|
70832
70916
|
return ReactPropTypes;
|
|
70833
70917
|
};
|
|
70834
70918
|
|
|
70919
|
+
var require$$2 = factoryWithThrowingShims;
|
|
70920
|
+
|
|
70835
70921
|
/**
|
|
70836
70922
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
70837
70923
|
*
|
|
@@ -70843,7 +70929,7 @@
|
|
|
70843
70929
|
{
|
|
70844
70930
|
// By explicitly using `prop-types` you are opting into new production behavior.
|
|
70845
70931
|
// http://fb.me/prop-types-in-prod
|
|
70846
|
-
module.exports =
|
|
70932
|
+
module.exports = require$$2();
|
|
70847
70933
|
}
|
|
70848
70934
|
});
|
|
70849
70935
|
|
|
@@ -71807,6 +71893,8 @@
|
|
|
71807
71893
|
clamp: clamp_1
|
|
71808
71894
|
}, '__esModule', {value: true});
|
|
71809
71895
|
|
|
71896
|
+
var _propTypes = propTypes;
|
|
71897
|
+
|
|
71810
71898
|
var _resizeObserverPolyfill = /*@__PURE__*/getAugmentedNamespace(ResizeObserver_es);
|
|
71811
71899
|
|
|
71812
71900
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
@@ -71821,7 +71909,7 @@
|
|
|
71821
71909
|
|
|
71822
71910
|
|
|
71823
71911
|
|
|
71824
|
-
var _propTypes2 = _interopRequireDefault$1(
|
|
71912
|
+
var _propTypes2 = _interopRequireDefault$1(_propTypes);
|
|
71825
71913
|
|
|
71826
71914
|
|
|
71827
71915
|
|
|
@@ -72337,7 +72425,7 @@
|
|
|
72337
72425
|
const handleLoadError = (error)=> {
|
|
72338
72426
|
if(source == 'trustwallet') {
|
|
72339
72427
|
setSource('depay');
|
|
72340
|
-
setSrc(`https://
|
|
72428
|
+
setSrc(`https://integrate.depay.fi/tokens/${blockchain}/${address}/image`);
|
|
72341
72429
|
} else {
|
|
72342
72430
|
setSource('unknown');
|
|
72343
72431
|
setSrc('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACABAMAAAAxEHz4AAAAGFBMVEVHcEz///////////////////////////8dS1W+AAAAB3RSTlMAHklzmMLqCsLrGwAAAQ9JREFUeNrtlrsOgkAQRRdFbDcae4IFrZEYazXRVitqQ2Hrk/19BVdX7XYuiQX3VDZzMsxrVYQQQkibGIyzLNHi8OHaVJRLWXgwMy8KLYnfGEchEFTxjp2/wHxRalBg9v4CNAXzwxYVXCSC2ypJstx+g6/ATaAdqImvoHxHzEVFcPGqWwtOnoLFx++6DGdgq9NnG+T0K8EVEPTqnrZbEKGCFO1CDs2BG2UZbpnABEwMJIA1IRSeZfdCgV8wsjdVnEBuLyKyBu51Fb+xpfhPRgdsgYqeM6DlQwQmoA62AvISgIsc2j0EaxgDL0ojx/CCCs4KPGYnVHCk4CEg7SbIKqbqfyeRAgoaERBCCCGESLgDeRfMNogh3QMAAAAASUVORK5CYII=');
|
|
@@ -72470,7 +72558,9 @@
|
|
|
72470
72558
|
changeAmount(toValidValue(maxAmount));
|
|
72471
72559
|
}
|
|
72472
72560
|
}, "(Max)")))))),
|
|
72473
|
-
footer: /*#__PURE__*/react.createElement("div",
|
|
72561
|
+
footer: /*#__PURE__*/react.createElement("div", {
|
|
72562
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
72563
|
+
}, /*#__PURE__*/react.createElement("button", {
|
|
72474
72564
|
className: "ButtonPrimary",
|
|
72475
72565
|
onClick: changeAmountAndGoBack
|
|
72476
72566
|
}, "Done"))
|
|
@@ -72557,6 +72647,7 @@
|
|
|
72557
72647
|
}, [allRoutes]);
|
|
72558
72648
|
react.useEffect(function () {
|
|
72559
72649
|
setCards(allPaymentRoutesWithData.map(function (payment, index) {
|
|
72650
|
+
var blockchain = Blockchain.findByName(payment.route.blockchain);
|
|
72560
72651
|
return /*#__PURE__*/react.createElement("div", {
|
|
72561
72652
|
key: index,
|
|
72562
72653
|
className: "Card",
|
|
@@ -72570,6 +72661,11 @@
|
|
|
72570
72661
|
}, /*#__PURE__*/react.createElement(TokenImage_1, {
|
|
72571
72662
|
blockchain: payment.route.blockchain,
|
|
72572
72663
|
address: payment.route.fromToken.address
|
|
72664
|
+
}), /*#__PURE__*/react.createElement("img", {
|
|
72665
|
+
className: "BlockchainLogo small",
|
|
72666
|
+
src: blockchain.logo,
|
|
72667
|
+
alt: blockchain.label,
|
|
72668
|
+
title: blockchain.label
|
|
72573
72669
|
})), /*#__PURE__*/react.createElement("div", {
|
|
72574
72670
|
className: "CardBody"
|
|
72575
72671
|
}, /*#__PURE__*/react.createElement("div", {
|
|
@@ -72610,25 +72706,12 @@
|
|
|
72610
72706
|
});
|
|
72611
72707
|
});
|
|
72612
72708
|
|
|
72613
|
-
var Checkmark = (function () {
|
|
72614
|
-
return /*#__PURE__*/react.createElement("svg", {
|
|
72615
|
-
className: "Checkmark Icon",
|
|
72616
|
-
version: "1.1",
|
|
72617
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
72618
|
-
x: "0px",
|
|
72619
|
-
y: "0px",
|
|
72620
|
-
viewBox: "0 0 24 24"
|
|
72621
|
-
}, /*#__PURE__*/react.createElement("path", {
|
|
72622
|
-
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"
|
|
72623
|
-
}));
|
|
72624
|
-
});
|
|
72625
|
-
|
|
72626
72709
|
var DonationOverviewSkeleton = (function (props) {
|
|
72627
72710
|
return /*#__PURE__*/react.createElement(Dialog, {
|
|
72628
72711
|
header: /*#__PURE__*/react.createElement("div", {
|
|
72629
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
72712
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
72630
72713
|
}, /*#__PURE__*/react.createElement("h1", {
|
|
72631
|
-
className: "LineHeightL FontSizeL
|
|
72714
|
+
className: "LineHeightL FontSizeL"
|
|
72632
72715
|
}, "Donation")),
|
|
72633
72716
|
body: /*#__PURE__*/react.createElement("div", {
|
|
72634
72717
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -72642,7 +72725,7 @@
|
|
|
72642
72725
|
className: "SkeletonBackground"
|
|
72643
72726
|
}))),
|
|
72644
72727
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
72645
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
72728
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
72646
72729
|
}, /*#__PURE__*/react.createElement("div", {
|
|
72647
72730
|
className: "SkeletonWrapper"
|
|
72648
72731
|
}, /*#__PURE__*/react.createElement("div", {
|
|
@@ -72653,6 +72736,60 @@
|
|
|
72653
72736
|
});
|
|
72654
72737
|
});
|
|
72655
72738
|
|
|
72739
|
+
var Checkmark = (function (props) {
|
|
72740
|
+
return /*#__PURE__*/react.createElement("svg", {
|
|
72741
|
+
className: "Checkmark Icon " + props.className,
|
|
72742
|
+
version: "1.1",
|
|
72743
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
72744
|
+
x: "0px",
|
|
72745
|
+
y: "0px",
|
|
72746
|
+
viewBox: "0 0 24 24"
|
|
72747
|
+
}, /*#__PURE__*/react.createElement("path", {
|
|
72748
|
+
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"
|
|
72749
|
+
}));
|
|
72750
|
+
});
|
|
72751
|
+
|
|
72752
|
+
var DigitalWalletIcon = (function (props) {
|
|
72753
|
+
return /*#__PURE__*/react.createElement("svg", {
|
|
72754
|
+
className: "DigitalWalletIcon Icon " + props.className,
|
|
72755
|
+
version: "1.1",
|
|
72756
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
72757
|
+
height: "24",
|
|
72758
|
+
width: "24",
|
|
72759
|
+
viewBox: "0 0 24 24"
|
|
72760
|
+
}, /*#__PURE__*/react.createElement("path", {
|
|
72761
|
+
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",
|
|
72762
|
+
transform: "translate(-0.81 -1)"
|
|
72763
|
+
}), /*#__PURE__*/react.createElement("path", {
|
|
72764
|
+
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",
|
|
72765
|
+
transform: "translate(-0.81 -1)"
|
|
72766
|
+
}), /*#__PURE__*/react.createElement("path", {
|
|
72767
|
+
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",
|
|
72768
|
+
transform: "translate(-0.81 -1)"
|
|
72769
|
+
}), /*#__PURE__*/react.createElement("path", {
|
|
72770
|
+
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",
|
|
72771
|
+
transform: "translate(-0.81 -1)"
|
|
72772
|
+
}), /*#__PURE__*/react.createElement("path", {
|
|
72773
|
+
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",
|
|
72774
|
+
transform: "translate(-0.81 -1)"
|
|
72775
|
+
}), /*#__PURE__*/react.createElement("path", {
|
|
72776
|
+
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",
|
|
72777
|
+
transform: "translate(-0.81 -1)"
|
|
72778
|
+
}), /*#__PURE__*/react.createElement("path", {
|
|
72779
|
+
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",
|
|
72780
|
+
transform: "translate(-0.81 -1)"
|
|
72781
|
+
}), /*#__PURE__*/react.createElement("rect", {
|
|
72782
|
+
x: "0.33",
|
|
72783
|
+
y: "11.77",
|
|
72784
|
+
width: "4.72",
|
|
72785
|
+
height: "0.66"
|
|
72786
|
+
}), /*#__PURE__*/react.createElement("polygon", {
|
|
72787
|
+
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"
|
|
72788
|
+
}), /*#__PURE__*/react.createElement("polygon", {
|
|
72789
|
+
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"
|
|
72790
|
+
}));
|
|
72791
|
+
});
|
|
72792
|
+
|
|
72656
72793
|
var LoadingText = (function (props) {
|
|
72657
72794
|
return /*#__PURE__*/react.createElement("div", {
|
|
72658
72795
|
className: "LoadingText"
|
|
@@ -72665,26 +72802,143 @@
|
|
|
72665
72802
|
}, "."));
|
|
72666
72803
|
});
|
|
72667
72804
|
|
|
72668
|
-
var
|
|
72805
|
+
var Footer = (function () {
|
|
72669
72806
|
var _useContext = react.useContext(ConfigurationContext),
|
|
72670
72807
|
currencyCode = _useContext.currencyCode;
|
|
72671
72808
|
|
|
72672
72809
|
var _useContext2 = react.useContext(ChangableAmountContext),
|
|
72673
72810
|
amount = _useContext2.amount;
|
|
72811
|
+
_useContext2.amountsMissing;
|
|
72674
72812
|
|
|
72675
|
-
var _useContext3 = react.useContext(
|
|
72676
|
-
|
|
72677
|
-
|
|
72678
|
-
|
|
72679
|
-
transaction = _useContext3.transaction,
|
|
72680
|
-
approve = _useContext3.approve,
|
|
72681
|
-
approvalTransaction = _useContext3.approvalTransaction;
|
|
72813
|
+
var _useContext3 = react.useContext(TrackingContext),
|
|
72814
|
+
tracking = _useContext3.tracking,
|
|
72815
|
+
forward = _useContext3.forward,
|
|
72816
|
+
forwardTo = _useContext3.forwardTo;
|
|
72682
72817
|
|
|
72683
|
-
var _useContext4 = react.useContext(
|
|
72684
|
-
|
|
72818
|
+
var _useContext4 = react.useContext(PaymentContext),
|
|
72819
|
+
payment = _useContext4.payment,
|
|
72820
|
+
paymentState = _useContext4.paymentState,
|
|
72821
|
+
pay = _useContext4.pay,
|
|
72822
|
+
transaction = _useContext4.transaction,
|
|
72823
|
+
approve = _useContext4.approve,
|
|
72824
|
+
approvalTransaction = _useContext4.approvalTransaction;
|
|
72825
|
+
|
|
72826
|
+
var _useContext5 = react.useContext(PaymentValueContext),
|
|
72827
|
+
paymentValue = _useContext5.paymentValue;
|
|
72828
|
+
|
|
72829
|
+
var _useContext6 = react.useContext(NavigateStackContext_1),
|
|
72830
|
+
navigate = _useContext6.navigate;
|
|
72831
|
+
|
|
72832
|
+
var _useContext7 = react.useContext(ClosableContext),
|
|
72833
|
+
close = _useContext7.close;
|
|
72834
|
+
|
|
72835
|
+
var trackingInfo = function trackingInfo() {
|
|
72836
|
+
if (tracking != true) {
|
|
72837
|
+
return null;
|
|
72838
|
+
}
|
|
72685
72839
|
|
|
72686
|
-
|
|
72687
|
-
|
|
72840
|
+
if (forward) {
|
|
72841
|
+
return /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("a", {
|
|
72842
|
+
className: "Card transparent small disabled"
|
|
72843
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72844
|
+
className: "CardImage"
|
|
72845
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72846
|
+
className: "TextCenter Opacity05"
|
|
72847
|
+
}, /*#__PURE__*/react.createElement(Checkmark, {
|
|
72848
|
+
className: "small"
|
|
72849
|
+
}))), /*#__PURE__*/react.createElement("div", {
|
|
72850
|
+
className: "CardBody"
|
|
72851
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72852
|
+
className: "CardBodyWrapper"
|
|
72853
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72854
|
+
className: "Opacity05"
|
|
72855
|
+
}, "Payment confirmation has been stored")))));
|
|
72856
|
+
} else {
|
|
72857
|
+
return /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("a", {
|
|
72858
|
+
className: "Card transparent small disabled"
|
|
72859
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72860
|
+
className: "CardImage"
|
|
72861
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72862
|
+
className: "TextCenter"
|
|
72863
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72864
|
+
className: "Loading Icon"
|
|
72865
|
+
}))), /*#__PURE__*/react.createElement("div", {
|
|
72866
|
+
className: "CardBody"
|
|
72867
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72868
|
+
className: "CardBodyWrapper"
|
|
72869
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72870
|
+
className: "Opacity05"
|
|
72871
|
+
}, "Storing payment confirmation")))));
|
|
72872
|
+
}
|
|
72873
|
+
};
|
|
72874
|
+
|
|
72875
|
+
var additionalPaymentInformation = function additionalPaymentInformation() {
|
|
72876
|
+
if (paymentState == 'paying' && transaction == undefined) {
|
|
72877
|
+
return /*#__PURE__*/react.createElement("div", {
|
|
72878
|
+
className: "PaddingBottomS"
|
|
72879
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72880
|
+
className: "Card transparent disabled small"
|
|
72881
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72882
|
+
className: "CardImage"
|
|
72883
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72884
|
+
className: "TextCenter Opacity05"
|
|
72885
|
+
}, /*#__PURE__*/react.createElement(DigitalWalletIcon, {
|
|
72886
|
+
className: "small"
|
|
72887
|
+
}))), /*#__PURE__*/react.createElement("div", {
|
|
72888
|
+
className: "CardBody"
|
|
72889
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72890
|
+
className: "CardBodyWrapper"
|
|
72891
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72892
|
+
className: "Opacity05"
|
|
72893
|
+
}, "Confirm transaction in your wallet")))));
|
|
72894
|
+
} else if (paymentState == 'confirmed') {
|
|
72895
|
+
return /*#__PURE__*/react.createElement("div", {
|
|
72896
|
+
className: "PaddingBottomS"
|
|
72897
|
+
}, /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("a", {
|
|
72898
|
+
className: "Card transparent small",
|
|
72899
|
+
title: "Payment has been confirmed by the network",
|
|
72900
|
+
href: transaction === null || transaction === void 0 ? void 0 : transaction.url,
|
|
72901
|
+
target: "_blank",
|
|
72902
|
+
rel: "noopener noreferrer"
|
|
72903
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72904
|
+
className: "CardImage"
|
|
72905
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72906
|
+
className: "TextCenter Opacity05"
|
|
72907
|
+
}, /*#__PURE__*/react.createElement(Checkmark, {
|
|
72908
|
+
className: "small"
|
|
72909
|
+
}))), /*#__PURE__*/react.createElement("div", {
|
|
72910
|
+
className: "CardBody"
|
|
72911
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72912
|
+
className: "CardBodyWrapper"
|
|
72913
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72914
|
+
className: "Opacity05"
|
|
72915
|
+
}, "Payment has been confirmed"))))), trackingInfo());
|
|
72916
|
+
}
|
|
72917
|
+
};
|
|
72918
|
+
|
|
72919
|
+
var approvalButton = function approvalButton() {
|
|
72920
|
+
if (!payment.route.approvalRequired || payment.route.directTransfer) {
|
|
72921
|
+
return null;
|
|
72922
|
+
} else if (paymentState == 'initialized') {
|
|
72923
|
+
return /*#__PURE__*/react.createElement("div", {
|
|
72924
|
+
className: "PaddingBottomS"
|
|
72925
|
+
}, /*#__PURE__*/react.createElement("button", {
|
|
72926
|
+
className: "ButtonPrimary",
|
|
72927
|
+
onClick: approve,
|
|
72928
|
+
title: "Allow ".concat(payment.symbol, " to be used as payment")
|
|
72929
|
+
}, "Allow ", payment.symbol, " to be used as payment"));
|
|
72930
|
+
} else if (paymentState == 'approving') {
|
|
72931
|
+
return /*#__PURE__*/react.createElement("div", {
|
|
72932
|
+
className: "PaddingBottomS"
|
|
72933
|
+
}, /*#__PURE__*/react.createElement("a", {
|
|
72934
|
+
className: "ButtonPrimary",
|
|
72935
|
+
title: "Approving payment token - please wait",
|
|
72936
|
+
href: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
|
|
72937
|
+
target: "_blank",
|
|
72938
|
+
rel: "noopener noreferrer"
|
|
72939
|
+
}, /*#__PURE__*/react.createElement(LoadingText, null, "Approving")));
|
|
72940
|
+
}
|
|
72941
|
+
};
|
|
72688
72942
|
|
|
72689
72943
|
var mainAction = function mainAction() {
|
|
72690
72944
|
if (paymentState == 'initialized' || paymentState == 'approving') {
|
|
@@ -72699,10 +72953,10 @@
|
|
|
72699
72953
|
navigate: navigate
|
|
72700
72954
|
});
|
|
72701
72955
|
}
|
|
72702
|
-
}, "Pay ", new Currency({
|
|
72956
|
+
}, "Pay ", amount ? new Currency({
|
|
72703
72957
|
amount: amount.toFixed(2),
|
|
72704
72958
|
code: currencyCode
|
|
72705
|
-
}).toString());
|
|
72959
|
+
}).toString() : paymentValue.toString().length ? paymentValue.toString() : "".concat(payment.amount));
|
|
72706
72960
|
} else if (paymentState == 'paying') {
|
|
72707
72961
|
return /*#__PURE__*/react.createElement("a", {
|
|
72708
72962
|
className: "ButtonPrimary",
|
|
@@ -72712,39 +72966,51 @@
|
|
|
72712
72966
|
rel: "noopener noreferrer"
|
|
72713
72967
|
}, /*#__PURE__*/react.createElement(LoadingText, null, "Paying"));
|
|
72714
72968
|
} else if (paymentState == 'confirmed') {
|
|
72715
|
-
|
|
72716
|
-
|
|
72717
|
-
|
|
72718
|
-
|
|
72719
|
-
|
|
72969
|
+
if (tracking == true) {
|
|
72970
|
+
if (forward) {
|
|
72971
|
+
if (forwardTo) {
|
|
72972
|
+
return /*#__PURE__*/react.createElement("a", {
|
|
72973
|
+
className: "ButtonPrimary",
|
|
72974
|
+
href: forwardTo,
|
|
72975
|
+
rel: "noopener noreferrer"
|
|
72976
|
+
}, "Continue");
|
|
72977
|
+
} else {
|
|
72978
|
+
return /*#__PURE__*/react.createElement("button", {
|
|
72979
|
+
className: "ButtonPrimary",
|
|
72980
|
+
onClick: close
|
|
72981
|
+
}, "Continue");
|
|
72982
|
+
}
|
|
72983
|
+
} else {
|
|
72984
|
+
return /*#__PURE__*/react.createElement("button", {
|
|
72985
|
+
className: "ButtonPrimary disabled",
|
|
72986
|
+
onClick: function onClick() {}
|
|
72987
|
+
}, "Continue");
|
|
72988
|
+
}
|
|
72989
|
+
} else {
|
|
72990
|
+
return /*#__PURE__*/react.createElement("button", {
|
|
72991
|
+
className: "ButtonPrimary",
|
|
72992
|
+
onClick: close
|
|
72993
|
+
}, "Close");
|
|
72994
|
+
}
|
|
72720
72995
|
}
|
|
72721
72996
|
};
|
|
72722
72997
|
|
|
72723
|
-
|
|
72724
|
-
|
|
72725
|
-
return /*#__PURE__*/react.createElement("div", {
|
|
72726
|
-
className: "PaddingBottomS"
|
|
72727
|
-
}, /*#__PURE__*/react.createElement("button", {
|
|
72728
|
-
className: "ButtonPrimary wide",
|
|
72729
|
-
onClick: approve,
|
|
72730
|
-
title: "Allow ".concat(payment.symbol, " to be used as payment")
|
|
72731
|
-
}, "Allow ", payment.symbol, " to be used as payment"));
|
|
72732
|
-
} else if (paymentState == 'approving') {
|
|
72733
|
-
return /*#__PURE__*/react.createElement("div", {
|
|
72734
|
-
className: "PaddingBottomS"
|
|
72735
|
-
}, /*#__PURE__*/react.createElement("a", {
|
|
72736
|
-
className: "ButtonPrimary wide",
|
|
72737
|
-
title: "Approving payment token - please wait",
|
|
72738
|
-
href: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
|
|
72739
|
-
target: "_blank",
|
|
72740
|
-
rel: "noopener noreferrer"
|
|
72741
|
-
}, /*#__PURE__*/react.createElement(LoadingText, null, "Approving")));
|
|
72742
|
-
}
|
|
72743
|
-
};
|
|
72998
|
+
return /*#__PURE__*/react.createElement("div", null, approvalButton(), additionalPaymentInformation(), mainAction());
|
|
72999
|
+
});
|
|
72744
73000
|
|
|
72745
|
-
|
|
72746
|
-
|
|
72747
|
-
|
|
73001
|
+
var DonationOverviewDialog = (function (props) {
|
|
73002
|
+
var _useContext = react.useContext(ConfigurationContext),
|
|
73003
|
+
currencyCode = _useContext.currencyCode;
|
|
73004
|
+
|
|
73005
|
+
var _useContext2 = react.useContext(ChangableAmountContext),
|
|
73006
|
+
amount = _useContext2.amount;
|
|
73007
|
+
|
|
73008
|
+
var _useContext3 = react.useContext(PaymentContext),
|
|
73009
|
+
payment = _useContext3.payment,
|
|
73010
|
+
paymentState = _useContext3.paymentState;
|
|
73011
|
+
|
|
73012
|
+
var _useContext4 = react.useContext(NavigateStackContext_1),
|
|
73013
|
+
navigate = _useContext4.navigate;
|
|
72748
73014
|
|
|
72749
73015
|
if (payment == undefined) {
|
|
72750
73016
|
return /*#__PURE__*/react.createElement(DonationOverviewSkeleton, null);
|
|
@@ -72752,9 +73018,9 @@
|
|
|
72752
73018
|
|
|
72753
73019
|
return /*#__PURE__*/react.createElement(Dialog, {
|
|
72754
73020
|
header: /*#__PURE__*/react.createElement("div", {
|
|
72755
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
73021
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
72756
73022
|
}, /*#__PURE__*/react.createElement("h1", {
|
|
72757
|
-
className: "LineHeightL FontSizeL
|
|
73023
|
+
className: "LineHeightL FontSizeL"
|
|
72758
73024
|
}, "Donation")),
|
|
72759
73025
|
body: /*#__PURE__*/react.createElement("div", {
|
|
72760
73026
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -72817,8 +73083,8 @@
|
|
|
72817
73083
|
className: "CardAction"
|
|
72818
73084
|
}, /*#__PURE__*/react.createElement(ChevronRight, null)))),
|
|
72819
73085
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
72820
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
72821
|
-
},
|
|
73086
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
73087
|
+
}, /*#__PURE__*/react.createElement(Footer, null))
|
|
72822
73088
|
});
|
|
72823
73089
|
});
|
|
72824
73090
|
|
|
@@ -72855,9 +73121,9 @@
|
|
|
72855
73121
|
rel: "noopener noreferrer"
|
|
72856
73122
|
}, "View on explorer")))),
|
|
72857
73123
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
72858
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
73124
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
72859
73125
|
}, /*#__PURE__*/react.createElement("button", {
|
|
72860
|
-
className: "ButtonPrimary
|
|
73126
|
+
className: "ButtonPrimary",
|
|
72861
73127
|
onClick: function onClick() {
|
|
72862
73128
|
return navigate('back');
|
|
72863
73129
|
}
|
|
@@ -72878,9 +73144,9 @@
|
|
|
72878
73144
|
return /*#__PURE__*/react.createElement(Dialog, {
|
|
72879
73145
|
stacked: true,
|
|
72880
73146
|
header: /*#__PURE__*/react.createElement("div", {
|
|
72881
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
73147
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
72882
73148
|
}, /*#__PURE__*/react.createElement("h1", {
|
|
72883
|
-
className: "LineHeightL FontSizeL
|
|
73149
|
+
className: "LineHeightL FontSizeL"
|
|
72884
73150
|
}, "Wrong Network")),
|
|
72885
73151
|
body: /*#__PURE__*/react.createElement("div", {
|
|
72886
73152
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -72897,7 +73163,7 @@
|
|
|
72897
73163
|
className: "FontSizeM"
|
|
72898
73164
|
}, "Please make sure you connect your wallet to the correct network before you try again!"))),
|
|
72899
73165
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
72900
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
73166
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
72901
73167
|
}, /*#__PURE__*/react.createElement("button", {
|
|
72902
73168
|
className: "ButtonPrimary",
|
|
72903
73169
|
onClick: function onClick() {
|
|
@@ -72928,16 +73194,122 @@
|
|
|
72928
73194
|
});
|
|
72929
73195
|
});
|
|
72930
73196
|
|
|
72931
|
-
var
|
|
72932
|
-
var
|
|
73197
|
+
var TrackingProvider = (function (props) {
|
|
73198
|
+
var _useContext = react.useContext(ConfigurationContext),
|
|
73199
|
+
track = _useContext.track;
|
|
73200
|
+
|
|
73201
|
+
var _useState = react.useState(track && !!track.endpoint),
|
|
72933
73202
|
_useState2 = _slicedToArray(_useState, 2),
|
|
72934
|
-
|
|
72935
|
-
|
|
73203
|
+
tracking = _useState2[0],
|
|
73204
|
+
setTracking = _useState2[1];
|
|
73205
|
+
|
|
73206
|
+
var _useState3 = react.useState(false),
|
|
73207
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
73208
|
+
forward = _useState4[0],
|
|
73209
|
+
setForward = _useState4[1];
|
|
73210
|
+
|
|
73211
|
+
var _useState5 = react.useState(),
|
|
73212
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
73213
|
+
forwardTo = _useState6[0],
|
|
73214
|
+
setForwardTo = _useState6[1];
|
|
73215
|
+
|
|
73216
|
+
var _useContext2 = react.useContext(ClosableContext),
|
|
73217
|
+
setClosable = _useContext2.setClosable;
|
|
73218
|
+
|
|
73219
|
+
react.useEffect(function () {
|
|
73220
|
+
setTracking(track && !!track.endpoint);
|
|
73221
|
+
}, [track]);
|
|
73222
|
+
|
|
73223
|
+
var openSocket = function openSocket(transaction) {
|
|
73224
|
+
var socket = new WebSocket('wss://integrate.depay.fi/cable');
|
|
73225
|
+
|
|
73226
|
+
socket.onopen = function (event) {
|
|
73227
|
+
var msg = {
|
|
73228
|
+
command: 'subscribe',
|
|
73229
|
+
identifier: JSON.stringify({
|
|
73230
|
+
blockchain: transaction.blockchain,
|
|
73231
|
+
sender: transaction.from.toLowerCase(),
|
|
73232
|
+
nonce: transaction.nonce,
|
|
73233
|
+
channel: 'PaymentChannel'
|
|
73234
|
+
})
|
|
73235
|
+
};
|
|
73236
|
+
socket.send(JSON.stringify(msg));
|
|
73237
|
+
};
|
|
73238
|
+
|
|
73239
|
+
socket.onclose = function (event) {};
|
|
73240
|
+
|
|
73241
|
+
socket.onmessage = function (event) {
|
|
73242
|
+
var item = JSON.parse(event.data);
|
|
73243
|
+
|
|
73244
|
+
if (item.type === "ping") {
|
|
73245
|
+
return;
|
|
73246
|
+
}
|
|
73247
|
+
|
|
73248
|
+
if (item.message && item.message.forward) {
|
|
73249
|
+
setClosable(!item.message.forward_to);
|
|
73250
|
+
setForwardTo(item.message.forward_to);
|
|
73251
|
+
setForward(item.message.forward);
|
|
73252
|
+
socket.close();
|
|
73253
|
+
|
|
73254
|
+
if (!!item.message.forward_to) {
|
|
73255
|
+
setTimeout(function () {
|
|
73256
|
+
props.document.location.href = item.message.forward_to;
|
|
73257
|
+
}, 500);
|
|
73258
|
+
}
|
|
73259
|
+
}
|
|
73260
|
+
};
|
|
73261
|
+
|
|
73262
|
+
socket.onerror = function (error) {
|
|
73263
|
+
console.log('WebSocket Error: ' + error);
|
|
73264
|
+
};
|
|
73265
|
+
};
|
|
73266
|
+
|
|
73267
|
+
var retryStartTracking = function retryStartTracking(transaction, afterBlock, attempt) {
|
|
73268
|
+
attempt = parseInt(attempt || 1, 10);
|
|
73269
|
+
console.log('RETRY TRACKING ATTEMPT ', attempt);
|
|
73270
|
+
|
|
73271
|
+
if (attempt < 3) {
|
|
73272
|
+
setTimeout(function () {
|
|
73273
|
+
startTracking(transaction, afterBlock, attempt + 1);
|
|
73274
|
+
}, 3000);
|
|
73275
|
+
} else {
|
|
73276
|
+
console.log('TRACKING FAILED AFTER 3 ATTEMPTS!');
|
|
73277
|
+
}
|
|
73278
|
+
};
|
|
73279
|
+
|
|
73280
|
+
var startTracking = function startTracking(transaction, afterBlock, attempt) {
|
|
73281
|
+
fetch(track.endpoint, {
|
|
73282
|
+
method: 'POST',
|
|
73283
|
+
body: JSON.stringify({
|
|
73284
|
+
blockchain: transaction.blockchain,
|
|
73285
|
+
transaction: transaction.id.toLowerCase(),
|
|
73286
|
+
sender: transaction.from.toLowerCase(),
|
|
73287
|
+
nonce: transaction.nonce,
|
|
73288
|
+
after_block: afterBlock
|
|
73289
|
+
})
|
|
73290
|
+
}).then(function (response) {
|
|
73291
|
+
if (response.status == 200) {
|
|
73292
|
+
console.log('TRACKING INITIALIZED');
|
|
73293
|
+
} else {
|
|
73294
|
+
retryStartTracking(transaction, afterBlock, attempt);
|
|
73295
|
+
}
|
|
73296
|
+
})["catch"](function (error) {
|
|
73297
|
+
console.log('TRACKING FAILED', error);
|
|
73298
|
+
retryStartTracking(transaction, afterBlock, attempt);
|
|
73299
|
+
});
|
|
73300
|
+
};
|
|
73301
|
+
|
|
73302
|
+
var initializeTracking = function initializeTracking(transaction, afterBlock) {
|
|
73303
|
+
openSocket(transaction);
|
|
73304
|
+
startTracking(transaction, afterBlock);
|
|
73305
|
+
};
|
|
72936
73306
|
|
|
72937
|
-
return /*#__PURE__*/react.createElement(
|
|
73307
|
+
return /*#__PURE__*/react.createElement(TrackingContext.Provider, {
|
|
72938
73308
|
value: {
|
|
72939
|
-
|
|
72940
|
-
|
|
73309
|
+
tracking: tracking,
|
|
73310
|
+
initializeTracking: initializeTracking,
|
|
73311
|
+
forward: forward,
|
|
73312
|
+
forwardTo: forwardTo
|
|
72941
73313
|
}
|
|
72942
73314
|
}, props.children);
|
|
72943
73315
|
});
|
|
@@ -73040,12 +73412,12 @@
|
|
|
73040
73412
|
|
|
73041
73413
|
var Donation = /*#__PURE__*/function () {
|
|
73042
73414
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(_ref3) {
|
|
73043
|
-
var amount, accept, event, sent, confirmed,
|
|
73415
|
+
var amount, accept, event, sent, confirmed, failed, error, critical, style, blacklist, providers, currency, connected, closed, document, unmount;
|
|
73044
73416
|
return regenerator.wrap(function _callee2$(_context2) {
|
|
73045
73417
|
while (1) {
|
|
73046
73418
|
switch (_context2.prev = _context2.next) {
|
|
73047
73419
|
case 0:
|
|
73048
|
-
amount = _ref3.amount, accept = _ref3.accept, event = _ref3.event, sent = _ref3.sent, confirmed = _ref3.confirmed,
|
|
73420
|
+
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;
|
|
73049
73421
|
_context2.prev = 1;
|
|
73050
73422
|
_context2.next = 4;
|
|
73051
73423
|
return preflight$2({
|
|
@@ -73071,26 +73443,27 @@
|
|
|
73071
73443
|
event: event,
|
|
73072
73444
|
sent: sent,
|
|
73073
73445
|
confirmed: confirmed,
|
|
73074
|
-
ensured: ensured,
|
|
73075
73446
|
failed: failed,
|
|
73076
73447
|
blacklist: blacklist,
|
|
73077
73448
|
providers: providers
|
|
73078
73449
|
}
|
|
73079
|
-
}, /*#__PURE__*/react.createElement(ClosableProvider, {
|
|
73450
|
+
}, /*#__PURE__*/react.createElement(UpdatableProvider, null, /*#__PURE__*/react.createElement(ClosableProvider, {
|
|
73080
73451
|
unmount: unmount
|
|
73081
|
-
}, /*#__PURE__*/react.createElement(
|
|
73452
|
+
}, /*#__PURE__*/react.createElement(WalletProvider, {
|
|
73082
73453
|
container: container,
|
|
73083
73454
|
connected: connected,
|
|
73084
73455
|
unmount: unmount
|
|
73085
73456
|
}, /*#__PURE__*/react.createElement(ConversionRateProvider, null, /*#__PURE__*/react.createElement(ChangableAmountProvider, {
|
|
73086
73457
|
accept: accept
|
|
73458
|
+
}, /*#__PURE__*/react.createElement(TrackingProvider, {
|
|
73459
|
+
document: ensureDocument(document)
|
|
73087
73460
|
}, /*#__PURE__*/react.createElement(DonationRoutingProvider, {
|
|
73088
73461
|
container: container,
|
|
73089
73462
|
document: document
|
|
73090
73463
|
}, /*#__PURE__*/react.createElement(DonationStack, {
|
|
73091
73464
|
document: document,
|
|
73092
73465
|
container: container
|
|
73093
|
-
})))))))));
|
|
73466
|
+
}), /*#__PURE__*/react.createElement(PoweredBy, null))))))))));
|
|
73094
73467
|
};
|
|
73095
73468
|
});
|
|
73096
73469
|
return _context2.abrupt("return", {
|
|
@@ -73158,9 +73531,9 @@
|
|
|
73158
73531
|
|
|
73159
73532
|
return /*#__PURE__*/react.createElement(Dialog, {
|
|
73160
73533
|
header: /*#__PURE__*/react.createElement("div", {
|
|
73161
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
73534
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
73162
73535
|
}, /*#__PURE__*/react.createElement("h1", {
|
|
73163
|
-
className: "LineHeightL FontSizeL
|
|
73536
|
+
className: "LineHeightL FontSizeL"
|
|
73164
73537
|
}, "Payment")),
|
|
73165
73538
|
body: /*#__PURE__*/react.createElement("div", {
|
|
73166
73539
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -73174,7 +73547,7 @@
|
|
|
73174
73547
|
className: "SkeletonBackground"
|
|
73175
73548
|
}))),
|
|
73176
73549
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
73177
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
73550
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
73178
73551
|
}, /*#__PURE__*/react.createElement("div", {
|
|
73179
73552
|
className: "SkeletonWrapper"
|
|
73180
73553
|
}, /*#__PURE__*/react.createElement("div", {
|
|
@@ -73189,17 +73562,13 @@
|
|
|
73189
73562
|
var _useContext = react.useContext(ConfigurationContext),
|
|
73190
73563
|
currencyCode = _useContext.currencyCode;
|
|
73191
73564
|
|
|
73192
|
-
var _useContext2 = react.useContext(
|
|
73193
|
-
|
|
73194
|
-
|
|
73565
|
+
var _useContext2 = react.useContext(PaymentContext),
|
|
73566
|
+
payment = _useContext2.payment,
|
|
73567
|
+
paymentState = _useContext2.paymentState;
|
|
73195
73568
|
|
|
73196
|
-
var _useContext3 = react.useContext(
|
|
73197
|
-
|
|
73198
|
-
|
|
73199
|
-
pay = _useContext3.pay,
|
|
73200
|
-
transaction = _useContext3.transaction,
|
|
73201
|
-
approve = _useContext3.approve,
|
|
73202
|
-
approvalTransaction = _useContext3.approvalTransaction;
|
|
73569
|
+
var _useContext3 = react.useContext(ChangableAmountContext),
|
|
73570
|
+
amount = _useContext3.amount,
|
|
73571
|
+
amountsMissing = _useContext3.amountsMissing;
|
|
73203
73572
|
|
|
73204
73573
|
var _useContext4 = react.useContext(PaymentValueContext),
|
|
73205
73574
|
paymentValue = _useContext4.paymentValue;
|
|
@@ -73207,78 +73576,15 @@
|
|
|
73207
73576
|
var _useContext5 = react.useContext(NavigateStackContext_1),
|
|
73208
73577
|
navigate = _useContext5.navigate;
|
|
73209
73578
|
|
|
73210
|
-
var _useContext6 = react.useContext(ClosableContext),
|
|
73211
|
-
close = _useContext6.close;
|
|
73212
|
-
|
|
73213
|
-
var mainAction = function mainAction() {
|
|
73214
|
-
if (paymentState == 'initialized' || paymentState == 'approving') {
|
|
73215
|
-
return /*#__PURE__*/react.createElement("button", {
|
|
73216
|
-
className: ["ButtonPrimary", payment.route.approvalRequired && !payment.route.directTransfer ? 'disabled' : ''].join(' '),
|
|
73217
|
-
onClick: function onClick() {
|
|
73218
|
-
if (payment.route.approvalRequired && !payment.route.directTransfer) {
|
|
73219
|
-
return;
|
|
73220
|
-
}
|
|
73221
|
-
|
|
73222
|
-
pay({
|
|
73223
|
-
navigate: navigate
|
|
73224
|
-
});
|
|
73225
|
-
}
|
|
73226
|
-
}, "Pay ", amount ? new Currency({
|
|
73227
|
-
amount: amount.toFixed(2),
|
|
73228
|
-
code: currencyCode
|
|
73229
|
-
}).toString() : paymentValue.toString().length ? paymentValue.toString() : "".concat(payment.amount));
|
|
73230
|
-
} else if (paymentState == 'paying') {
|
|
73231
|
-
return /*#__PURE__*/react.createElement("a", {
|
|
73232
|
-
className: "ButtonPrimary",
|
|
73233
|
-
title: "Performing the payment - please wait",
|
|
73234
|
-
href: transaction === null || transaction === void 0 ? void 0 : transaction.url,
|
|
73235
|
-
target: "_blank",
|
|
73236
|
-
rel: "noopener noreferrer"
|
|
73237
|
-
}, /*#__PURE__*/react.createElement(LoadingText, null, "Paying"));
|
|
73238
|
-
} else if (paymentState == 'confirmed') {
|
|
73239
|
-
return /*#__PURE__*/react.createElement("button", {
|
|
73240
|
-
className: "ButtonPrimary round",
|
|
73241
|
-
title: "Done",
|
|
73242
|
-
onClick: close
|
|
73243
|
-
}, /*#__PURE__*/react.createElement(Checkmark, null));
|
|
73244
|
-
}
|
|
73245
|
-
};
|
|
73246
|
-
|
|
73247
|
-
var approvalAction = function approvalAction() {
|
|
73248
|
-
if (paymentState == 'initialized') {
|
|
73249
|
-
return /*#__PURE__*/react.createElement("div", {
|
|
73250
|
-
className: "PaddingBottomS"
|
|
73251
|
-
}, /*#__PURE__*/react.createElement("button", {
|
|
73252
|
-
className: "ButtonPrimary wide",
|
|
73253
|
-
onClick: approve,
|
|
73254
|
-
title: "Allow ".concat(payment.symbol, " to be used as payment")
|
|
73255
|
-
}, "Allow ", payment.symbol, " to be used as payment"));
|
|
73256
|
-
} else if (paymentState == 'approving') {
|
|
73257
|
-
return /*#__PURE__*/react.createElement("div", {
|
|
73258
|
-
className: "PaddingBottomS"
|
|
73259
|
-
}, /*#__PURE__*/react.createElement("a", {
|
|
73260
|
-
className: "ButtonPrimary wide",
|
|
73261
|
-
title: "Approving payment token - please wait",
|
|
73262
|
-
href: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
|
|
73263
|
-
target: "_blank",
|
|
73264
|
-
rel: "noopener noreferrer"
|
|
73265
|
-
}, /*#__PURE__*/react.createElement(LoadingText, null, "Approving")));
|
|
73266
|
-
}
|
|
73267
|
-
};
|
|
73268
|
-
|
|
73269
|
-
var actions = function actions() {
|
|
73270
|
-
return /*#__PURE__*/react.createElement("div", null, payment.route.approvalRequired && !payment.route.directTransfer && approvalAction(), mainAction());
|
|
73271
|
-
};
|
|
73272
|
-
|
|
73273
73579
|
if (payment == undefined || paymentValue == undefined) {
|
|
73274
73580
|
return /*#__PURE__*/react.createElement(PaymentOverviewSkeleton, null);
|
|
73275
73581
|
}
|
|
73276
73582
|
|
|
73277
73583
|
return /*#__PURE__*/react.createElement(Dialog, {
|
|
73278
73584
|
header: /*#__PURE__*/react.createElement("div", {
|
|
73279
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
73585
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
73280
73586
|
}, /*#__PURE__*/react.createElement("h1", {
|
|
73281
|
-
className: "LineHeightL FontSizeL
|
|
73587
|
+
className: "LineHeightL FontSizeL"
|
|
73282
73588
|
}, "Payment")),
|
|
73283
73589
|
body: /*#__PURE__*/react.createElement("div", {
|
|
73284
73590
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -73341,8 +73647,8 @@
|
|
|
73341
73647
|
className: "CardAction"
|
|
73342
73648
|
}, /*#__PURE__*/react.createElement(ChevronRight, null)))),
|
|
73343
73649
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
73344
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
73345
|
-
},
|
|
73650
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
73651
|
+
}, /*#__PURE__*/react.createElement(Footer, null))
|
|
73346
73652
|
});
|
|
73347
73653
|
});
|
|
73348
73654
|
|
|
@@ -73408,12 +73714,12 @@
|
|
|
73408
73714
|
|
|
73409
73715
|
var Payment = /*#__PURE__*/function () {
|
|
73410
73716
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(_ref3) {
|
|
73411
|
-
var accept, amount, event, sent, confirmed,
|
|
73717
|
+
var accept, amount, event, sent, confirmed, failed, error, critical, style, whitelist, blacklist, providers, currency, connected, closed, track, document, unmount;
|
|
73412
73718
|
return regenerator.wrap(function _callee2$(_context2) {
|
|
73413
73719
|
while (1) {
|
|
73414
73720
|
switch (_context2.prev = _context2.next) {
|
|
73415
73721
|
case 0:
|
|
73416
|
-
accept = _ref3.accept, amount = _ref3.amount, event = _ref3.event, sent = _ref3.sent, confirmed = _ref3.confirmed,
|
|
73722
|
+
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;
|
|
73417
73723
|
_context2.prev = 1;
|
|
73418
73724
|
_context2.next = 4;
|
|
73419
73725
|
return preflight$1({
|
|
@@ -73439,15 +73745,15 @@
|
|
|
73439
73745
|
event: event,
|
|
73440
73746
|
sent: sent,
|
|
73441
73747
|
confirmed: confirmed,
|
|
73442
|
-
ensured: ensured,
|
|
73443
73748
|
failed: failed,
|
|
73444
73749
|
whitelist: whitelist,
|
|
73445
73750
|
blacklist: blacklist,
|
|
73446
|
-
providers: providers
|
|
73751
|
+
providers: providers,
|
|
73752
|
+
track: track
|
|
73447
73753
|
}
|
|
73448
|
-
}, /*#__PURE__*/react.createElement(ClosableProvider, {
|
|
73754
|
+
}, /*#__PURE__*/react.createElement(UpdatableProvider, null, /*#__PURE__*/react.createElement(ClosableProvider, {
|
|
73449
73755
|
unmount: unmount
|
|
73450
|
-
}, /*#__PURE__*/react.createElement(
|
|
73756
|
+
}, /*#__PURE__*/react.createElement(WalletProvider, {
|
|
73451
73757
|
document: document,
|
|
73452
73758
|
container: container,
|
|
73453
73759
|
connected: connected,
|
|
@@ -73459,13 +73765,15 @@
|
|
|
73459
73765
|
whitelist: whitelist,
|
|
73460
73766
|
blacklist: blacklist,
|
|
73461
73767
|
event: event
|
|
73768
|
+
}, /*#__PURE__*/react.createElement(TrackingProvider, {
|
|
73769
|
+
document: ensureDocument(document)
|
|
73462
73770
|
}, /*#__PURE__*/react.createElement(PaymentProvider, {
|
|
73463
73771
|
container: container,
|
|
73464
73772
|
document: document
|
|
73465
73773
|
}, /*#__PURE__*/react.createElement(PaymentValueProvider, null, /*#__PURE__*/react.createElement(PaymentStack, {
|
|
73466
73774
|
document: document,
|
|
73467
73775
|
container: container
|
|
73468
|
-
})))))))))));
|
|
73776
|
+
}), /*#__PURE__*/react.createElement(PoweredBy, null))))))))))));
|
|
73469
73777
|
};
|
|
73470
73778
|
});
|
|
73471
73779
|
return _context2.abrupt("return", {
|
|
@@ -73575,9 +73883,9 @@
|
|
|
73575
73883
|
var SaleOverviewSkeleton = (function (props) {
|
|
73576
73884
|
return /*#__PURE__*/react.createElement(Dialog, {
|
|
73577
73885
|
header: /*#__PURE__*/react.createElement("div", {
|
|
73578
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
73886
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
73579
73887
|
}, /*#__PURE__*/react.createElement("h1", {
|
|
73580
|
-
className: "LineHeightL FontSizeL
|
|
73888
|
+
className: "LineHeightL FontSizeL"
|
|
73581
73889
|
}, "Purchase")),
|
|
73582
73890
|
body: /*#__PURE__*/react.createElement("div", {
|
|
73583
73891
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -73594,7 +73902,7 @@
|
|
|
73594
73902
|
className: "SkeletonBackground"
|
|
73595
73903
|
}))),
|
|
73596
73904
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
73597
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
73905
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
73598
73906
|
}, /*#__PURE__*/react.createElement("div", {
|
|
73599
73907
|
className: "SkeletonWrapper"
|
|
73600
73908
|
}, /*#__PURE__*/react.createElement("div", {
|
|
@@ -73606,11 +73914,10 @@
|
|
|
73606
73914
|
});
|
|
73607
73915
|
|
|
73608
73916
|
var SaleOverviewDialog = (function (props) {
|
|
73609
|
-
var _useContext = react.useContext(ChangableAmountContext)
|
|
73610
|
-
|
|
73917
|
+
var _useContext = react.useContext(ChangableAmountContext);
|
|
73918
|
+
_useContext.amount;
|
|
73611
73919
|
|
|
73612
73920
|
var _useContext2 = react.useContext(ConfigurationContext),
|
|
73613
|
-
currencyCode = _useContext2.currencyCode,
|
|
73614
73921
|
tokenImage = _useContext2.tokenImage;
|
|
73615
73922
|
|
|
73616
73923
|
var _useContext3 = react.useContext(PaymentValueContext),
|
|
@@ -73618,87 +73925,20 @@
|
|
|
73618
73925
|
|
|
73619
73926
|
var _useContext4 = react.useContext(PaymentContext),
|
|
73620
73927
|
payment = _useContext4.payment,
|
|
73621
|
-
paymentState = _useContext4.paymentState
|
|
73622
|
-
pay = _useContext4.pay,
|
|
73623
|
-
transaction = _useContext4.transaction,
|
|
73624
|
-
approve = _useContext4.approve,
|
|
73625
|
-
approvalTransaction = _useContext4.approvalTransaction;
|
|
73928
|
+
paymentState = _useContext4.paymentState;
|
|
73626
73929
|
|
|
73627
73930
|
var _useContext5 = react.useContext(NavigateStackContext_1),
|
|
73628
73931
|
navigate = _useContext5.navigate;
|
|
73629
73932
|
|
|
73630
|
-
var _useContext6 = react.useContext(
|
|
73631
|
-
|
|
73632
|
-
|
|
73633
|
-
var _useContext7 = react.useContext(ToTokenContext),
|
|
73634
|
-
toToken = _useContext7.toToken,
|
|
73635
|
-
toTokenReadableAmount = _useContext7.toTokenReadableAmount;
|
|
73933
|
+
var _useContext6 = react.useContext(ToTokenContext),
|
|
73934
|
+
toToken = _useContext6.toToken,
|
|
73935
|
+
toTokenReadableAmount = _useContext6.toTokenReadableAmount;
|
|
73636
73936
|
|
|
73637
73937
|
var _useState = react.useState(),
|
|
73638
73938
|
_useState2 = _slicedToArray(_useState, 2),
|
|
73639
73939
|
salePerTokenValue = _useState2[0],
|
|
73640
73940
|
setSalePerTokenValue = _useState2[1];
|
|
73641
73941
|
|
|
73642
|
-
var mainAction = function mainAction() {
|
|
73643
|
-
if (paymentState == 'initialized' || paymentState == 'approving') {
|
|
73644
|
-
return /*#__PURE__*/react.createElement("button", {
|
|
73645
|
-
className: ["ButtonPrimary", payment.route.approvalRequired && !payment.route.directTransfer ? 'disabled' : ''].join(' '),
|
|
73646
|
-
onClick: function onClick() {
|
|
73647
|
-
if (payment.route.approvalRequired && !payment.route.directTransfer) {
|
|
73648
|
-
return;
|
|
73649
|
-
}
|
|
73650
|
-
|
|
73651
|
-
pay({
|
|
73652
|
-
navigate: navigate
|
|
73653
|
-
});
|
|
73654
|
-
}
|
|
73655
|
-
}, "Pay ", new Currency({
|
|
73656
|
-
amount: amount.toFixed(2),
|
|
73657
|
-
code: currencyCode
|
|
73658
|
-
}).toString());
|
|
73659
|
-
} else if (paymentState == 'paying') {
|
|
73660
|
-
return /*#__PURE__*/react.createElement("a", {
|
|
73661
|
-
className: "ButtonPrimary",
|
|
73662
|
-
title: "Performing the payment - please wait",
|
|
73663
|
-
href: transaction === null || transaction === void 0 ? void 0 : transaction.url,
|
|
73664
|
-
target: "_blank",
|
|
73665
|
-
rel: "noopener noreferrer"
|
|
73666
|
-
}, /*#__PURE__*/react.createElement(LoadingText, null, "Paying"));
|
|
73667
|
-
} else if (paymentState == 'confirmed') {
|
|
73668
|
-
return /*#__PURE__*/react.createElement("button", {
|
|
73669
|
-
className: "ButtonPrimary round",
|
|
73670
|
-
title: "Done",
|
|
73671
|
-
onClick: close
|
|
73672
|
-
}, /*#__PURE__*/react.createElement(Checkmark, null));
|
|
73673
|
-
}
|
|
73674
|
-
};
|
|
73675
|
-
|
|
73676
|
-
var approvalAction = function approvalAction() {
|
|
73677
|
-
if (paymentState == 'initialized') {
|
|
73678
|
-
return /*#__PURE__*/react.createElement("div", {
|
|
73679
|
-
className: "PaddingBottomS"
|
|
73680
|
-
}, /*#__PURE__*/react.createElement("button", {
|
|
73681
|
-
className: "ButtonPrimary wide",
|
|
73682
|
-
onClick: approve,
|
|
73683
|
-
title: "Allow ".concat(payment.symbol, " to be used as payment")
|
|
73684
|
-
}, "Allow ", payment.symbol, " to be used as payment"));
|
|
73685
|
-
} else if (paymentState == 'approving') {
|
|
73686
|
-
return /*#__PURE__*/react.createElement("div", {
|
|
73687
|
-
className: "PaddingBottomS"
|
|
73688
|
-
}, /*#__PURE__*/react.createElement("a", {
|
|
73689
|
-
className: "ButtonPrimary wide",
|
|
73690
|
-
title: "Approving payment token - please wait",
|
|
73691
|
-
href: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
|
|
73692
|
-
target: "_blank",
|
|
73693
|
-
rel: "noopener noreferrer"
|
|
73694
|
-
}, /*#__PURE__*/react.createElement(LoadingText, null, "Approving")));
|
|
73695
|
-
}
|
|
73696
|
-
};
|
|
73697
|
-
|
|
73698
|
-
var actions = function actions() {
|
|
73699
|
-
return /*#__PURE__*/react.createElement("div", null, payment.route.approvalRequired && !payment.route.directTransfer && approvalAction(), mainAction());
|
|
73700
|
-
};
|
|
73701
|
-
|
|
73702
73942
|
react.useEffect(function () {
|
|
73703
73943
|
if (paymentValue) {
|
|
73704
73944
|
setSalePerTokenValue(new Currency({
|
|
@@ -73727,9 +73967,9 @@
|
|
|
73727
73967
|
|
|
73728
73968
|
return /*#__PURE__*/react.createElement(Dialog, {
|
|
73729
73969
|
header: /*#__PURE__*/react.createElement("div", {
|
|
73730
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
73970
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
73731
73971
|
}, /*#__PURE__*/react.createElement("h1", {
|
|
73732
|
-
className: "LineHeightL FontSizeL
|
|
73972
|
+
className: "LineHeightL FontSizeL"
|
|
73733
73973
|
}, "Purchase")),
|
|
73734
73974
|
body: /*#__PURE__*/react.createElement("div", {
|
|
73735
73975
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -73798,8 +74038,8 @@
|
|
|
73798
74038
|
className: "CardAction"
|
|
73799
74039
|
}, /*#__PURE__*/react.createElement(ChevronRight, null)))),
|
|
73800
74040
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
73801
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
73802
|
-
},
|
|
74041
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
74042
|
+
}, /*#__PURE__*/react.createElement(Footer, null))
|
|
73803
74043
|
});
|
|
73804
74044
|
});
|
|
73805
74045
|
|
|
@@ -73872,12 +74112,12 @@
|
|
|
73872
74112
|
|
|
73873
74113
|
var Sale = /*#__PURE__*/function () {
|
|
73874
74114
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(_ref3) {
|
|
73875
|
-
var amount, sell, sent, confirmed,
|
|
74115
|
+
var amount, sell, sent, confirmed, failed, error, critical, style, blacklist, providers, currency, connected, closed, tokenImage, document, accept, unmount;
|
|
73876
74116
|
return regenerator.wrap(function _callee2$(_context2) {
|
|
73877
74117
|
while (1) {
|
|
73878
74118
|
switch (_context2.prev = _context2.next) {
|
|
73879
74119
|
case 0:
|
|
73880
|
-
amount = _ref3.amount, sell = _ref3.sell, sent = _ref3.sent, confirmed = _ref3.confirmed,
|
|
74120
|
+
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;
|
|
73881
74121
|
_context2.prev = 1;
|
|
73882
74122
|
_context2.next = 4;
|
|
73883
74123
|
return preflight({
|
|
@@ -73909,26 +74149,27 @@
|
|
|
73909
74149
|
currency: currency,
|
|
73910
74150
|
sent: sent,
|
|
73911
74151
|
confirmed: confirmed,
|
|
73912
|
-
ensured: ensured,
|
|
73913
74152
|
failed: failed,
|
|
73914
74153
|
blacklist: blacklist,
|
|
73915
74154
|
providers: providers
|
|
73916
74155
|
}
|
|
73917
|
-
}, /*#__PURE__*/react.createElement(ClosableProvider, {
|
|
74156
|
+
}, /*#__PURE__*/react.createElement(UpdatableProvider, null, /*#__PURE__*/react.createElement(ClosableProvider, {
|
|
73918
74157
|
unmount: unmount
|
|
73919
|
-
}, /*#__PURE__*/react.createElement(
|
|
74158
|
+
}, /*#__PURE__*/react.createElement(WalletProvider, {
|
|
73920
74159
|
container: container,
|
|
73921
74160
|
connected: connected,
|
|
73922
74161
|
unmount: unmount
|
|
73923
74162
|
}, /*#__PURE__*/react.createElement(ConversionRateProvider, null, /*#__PURE__*/react.createElement(ChangableAmountProvider, {
|
|
73924
74163
|
accept: accept
|
|
74164
|
+
}, /*#__PURE__*/react.createElement(TrackingProvider, {
|
|
74165
|
+
document: ensureDocument(document)
|
|
73925
74166
|
}, /*#__PURE__*/react.createElement(SaleRoutingProvider, {
|
|
73926
74167
|
container: container,
|
|
73927
74168
|
document: document
|
|
73928
74169
|
}, /*#__PURE__*/react.createElement(SaleStack, {
|
|
73929
74170
|
document: document,
|
|
73930
74171
|
container: container
|
|
73931
|
-
})))))))));
|
|
74172
|
+
}), /*#__PURE__*/react.createElement(PoweredBy, null))))))))));
|
|
73932
74173
|
};
|
|
73933
74174
|
});
|
|
73934
74175
|
return _context2.abrupt("return", {
|