@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/es/index.bundle.js
CHANGED
|
@@ -37,17 +37,11 @@ function _asyncToGenerator(fn) {
|
|
|
37
37
|
function _typeof(obj) {
|
|
38
38
|
"@babel/helpers - typeof";
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
_typeof = function _typeof(obj) {
|
|
46
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return _typeof(obj);
|
|
40
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
41
|
+
return typeof obj;
|
|
42
|
+
} : function (obj) {
|
|
43
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
44
|
+
}, _typeof(obj);
|
|
51
45
|
}
|
|
52
46
|
|
|
53
47
|
var commonjsGlobal$4 = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
@@ -1028,6 +1022,8 @@ var react = createCommonjsModule$4(function (module) {
|
|
|
1028
1022
|
|
|
1029
1023
|
var ClosableContext = /*#__PURE__*/react.createContext();
|
|
1030
1024
|
|
|
1025
|
+
var UpdatableContext = /*#__PURE__*/react.createContext();
|
|
1026
|
+
|
|
1031
1027
|
var ClosableProvider = (function (props) {
|
|
1032
1028
|
var _useState = react.useState(true),
|
|
1033
1029
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -1039,11 +1035,15 @@ var ClosableProvider = (function (props) {
|
|
|
1039
1035
|
open = _useState4[0],
|
|
1040
1036
|
setOpen = _useState4[1];
|
|
1041
1037
|
|
|
1038
|
+
var _useContext = react.useContext(UpdatableContext),
|
|
1039
|
+
setUpdatable = _useContext.setUpdatable;
|
|
1040
|
+
|
|
1042
1041
|
var close = function close() {
|
|
1043
1042
|
if (!closable) {
|
|
1044
1043
|
return;
|
|
1045
1044
|
}
|
|
1046
1045
|
|
|
1046
|
+
setUpdatable(false);
|
|
1047
1047
|
setOpen(false);
|
|
1048
1048
|
setTimeout(props.unmount, 300);
|
|
1049
1049
|
};
|
|
@@ -1989,12 +1989,7 @@ var Dialog = (function (props) {
|
|
|
1989
1989
|
className: "DialogBody"
|
|
1990
1990
|
}, props.body), /*#__PURE__*/react.createElement("div", {
|
|
1991
1991
|
className: "DialogFooter"
|
|
1992
|
-
}, props.footer
|
|
1993
|
-
href: 'https://depay.fi?utm_source=' + window.location.hostname + '&utm_medium=widget&utm_campaign=WidgetV2',
|
|
1994
|
-
rel: "noopener noreferrer",
|
|
1995
|
-
target: "_blank",
|
|
1996
|
-
className: "FooterLink"
|
|
1997
|
-
}, "by DePay")));
|
|
1992
|
+
}, props.footer));
|
|
1998
1993
|
});
|
|
1999
1994
|
|
|
2000
1995
|
var ConnectingWalletDialog = (function (props) {
|
|
@@ -2044,9 +2039,9 @@ var ConnectingWalletDialog = (function (props) {
|
|
|
2044
2039
|
className: "TextButton"
|
|
2045
2040
|
}, "Connect with another wallet")))),
|
|
2046
2041
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
2047
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
2042
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
2048
2043
|
}, /*#__PURE__*/react.createElement("button", {
|
|
2049
|
-
className: "ButtonPrimary
|
|
2044
|
+
className: "ButtonPrimary",
|
|
2050
2045
|
onClick: function onClick() {
|
|
2051
2046
|
return props.connect(wallet);
|
|
2052
2047
|
}
|
|
@@ -30524,6 +30519,8 @@ let balance = ({ address, provider }) => {
|
|
|
30524
30519
|
var request$1 = async ({ provider, address, api, method, params }) => {
|
|
30525
30520
|
if (api) {
|
|
30526
30521
|
return contractCall({ address, api, method, params, provider })
|
|
30522
|
+
} else if (method === 'latestBlockNumber') {
|
|
30523
|
+
return provider.getBlockNumber()
|
|
30527
30524
|
} else if (method === 'balance') {
|
|
30528
30525
|
return balance({ address, provider })
|
|
30529
30526
|
}
|
|
@@ -30580,8 +30577,20 @@ var parseUrl = (url) => {
|
|
|
30580
30577
|
if (typeof url == 'object') {
|
|
30581
30578
|
return url
|
|
30582
30579
|
}
|
|
30583
|
-
let deconstructed = url.match(/(?<blockchain>\w+):\/\/(?<
|
|
30584
|
-
|
|
30580
|
+
let deconstructed = url.match(/(?<blockchain>\w+):\/\/(?<part1>[\w\d]+)(\/(?<part2>[\w\d]+))?/);
|
|
30581
|
+
|
|
30582
|
+
if(deconstructed.groups.part2 == undefined) {
|
|
30583
|
+
return {
|
|
30584
|
+
blockchain: deconstructed.groups.blockchain,
|
|
30585
|
+
method: deconstructed.groups.part1
|
|
30586
|
+
}
|
|
30587
|
+
} else {
|
|
30588
|
+
return {
|
|
30589
|
+
blockchain: deconstructed.groups.blockchain,
|
|
30590
|
+
address: deconstructed.groups.part1,
|
|
30591
|
+
method: deconstructed.groups.part2
|
|
30592
|
+
}
|
|
30593
|
+
}
|
|
30585
30594
|
};
|
|
30586
30595
|
|
|
30587
30596
|
let request = async function (url, options) {
|
|
@@ -51562,10 +51571,11 @@ function parseUnits$1(value, unitName) {
|
|
|
51562
51571
|
function _optionalChain$5(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
51563
51572
|
class Transaction {
|
|
51564
51573
|
|
|
51565
|
-
constructor({ blockchain, from, to, api, method, params, value, sent, confirmed, ensured, failed }) {
|
|
51574
|
+
constructor({ blockchain, from, nonce, to, api, method, params, value, sent, confirmed, ensured, failed }) {
|
|
51566
51575
|
|
|
51567
51576
|
this.blockchain = blockchain;
|
|
51568
51577
|
this.from = from;
|
|
51578
|
+
this.nonce = nonce;
|
|
51569
51579
|
this.to = to;
|
|
51570
51580
|
this.api = api;
|
|
51571
51581
|
this.method = method;
|
|
@@ -51673,6 +51683,7 @@ const sendTransaction$1 = async ({ transaction, wallet })=> {
|
|
|
51673
51683
|
await executeSubmit$1({ transaction, provider, signer }).then((sentTransaction)=>{
|
|
51674
51684
|
if (sentTransaction) {
|
|
51675
51685
|
transaction.id = sentTransaction.hash;
|
|
51686
|
+
transaction.nonce = sentTransaction.nonce;
|
|
51676
51687
|
transaction.url = Blockchain.findByName(transaction.blockchain).explorerUrlFor({ transaction });
|
|
51677
51688
|
if (transaction.sent) transaction.sent(transaction);
|
|
51678
51689
|
sentTransaction.wait(1).then(() => {
|
|
@@ -51685,6 +51696,9 @@ const sendTransaction$1 = async ({ transaction, wallet })=> {
|
|
|
51685
51696
|
sentTransaction.wait(12).then(() => {
|
|
51686
51697
|
transaction._ensured = true;
|
|
51687
51698
|
if (transaction.ensured) transaction.ensured(transaction);
|
|
51699
|
+
}).catch((error)=>{
|
|
51700
|
+
transaction._failed = true;
|
|
51701
|
+
if(transaction.failed) transaction.failed(transaction, error);
|
|
51688
51702
|
});
|
|
51689
51703
|
} else {
|
|
51690
51704
|
throw('Submitting transaction failed!')
|
|
@@ -51873,6 +51887,7 @@ const sendTransaction = async ({ transaction, wallet })=> {
|
|
|
51873
51887
|
transaction.url = blockchain.explorerUrlFor({ transaction });
|
|
51874
51888
|
if (transaction.sent) transaction.sent(transaction);
|
|
51875
51889
|
let sentTransaction = await retrieveTransaction(tx, transaction.blockchain);
|
|
51890
|
+
transaction.nonce = sentTransaction.nonce;
|
|
51876
51891
|
if(!sentTransaction) {
|
|
51877
51892
|
transaction._failed = true;
|
|
51878
51893
|
console.log('Error retrieving transaction');
|
|
@@ -51888,6 +51903,9 @@ const sendTransaction = async ({ transaction, wallet })=> {
|
|
|
51888
51903
|
sentTransaction.wait(12).then(() => {
|
|
51889
51904
|
transaction._ensured = true;
|
|
51890
51905
|
if (transaction.ensured) transaction.ensured(transaction);
|
|
51906
|
+
}).catch((error)=>{
|
|
51907
|
+
transaction._failed = true;
|
|
51908
|
+
if(transaction.failed) transaction.failed(transaction, error);
|
|
51891
51909
|
});
|
|
51892
51910
|
}
|
|
51893
51911
|
} else {
|
|
@@ -52160,7 +52178,7 @@ var SelectWalletDialog = (function (props) {
|
|
|
52160
52178
|
return connect(wallet);
|
|
52161
52179
|
}
|
|
52162
52180
|
}, /*#__PURE__*/react.createElement("div", {
|
|
52163
|
-
className: "CardImage
|
|
52181
|
+
className: "CardImage"
|
|
52164
52182
|
}, /*#__PURE__*/react.createElement("img", {
|
|
52165
52183
|
src: wallet.logo
|
|
52166
52184
|
})), /*#__PURE__*/react.createElement("div", {
|
|
@@ -52173,9 +52191,9 @@ var SelectWalletDialog = (function (props) {
|
|
|
52173
52191
|
});
|
|
52174
52192
|
return /*#__PURE__*/react.createElement(Dialog, {
|
|
52175
52193
|
header: /*#__PURE__*/react.createElement("div", {
|
|
52176
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
52194
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
52177
52195
|
}, /*#__PURE__*/react.createElement("h1", {
|
|
52178
|
-
className: "LineHeightL FontSizeL
|
|
52196
|
+
className: "LineHeightL FontSizeL"
|
|
52179
52197
|
}, "Select a wallet")),
|
|
52180
52198
|
body: /*#__PURE__*/react.createElement("div", {
|
|
52181
52199
|
className: "PaddingTopS PaddingBottomXS PaddingLeftS PaddingRightS"
|
|
@@ -52183,11 +52201,13 @@ var SelectWalletDialog = (function (props) {
|
|
|
52183
52201
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
52184
52202
|
className: "PaddingBottomS"
|
|
52185
52203
|
}, /*#__PURE__*/react.createElement("button", {
|
|
52186
|
-
className: "FontSizeS FontWeightBold
|
|
52204
|
+
className: "FontSizeS FontWeightBold TextButton",
|
|
52187
52205
|
onClick: function onClick() {
|
|
52188
52206
|
return setShowExplanation(!showExplanation);
|
|
52189
52207
|
}
|
|
52190
|
-
}, /*#__PURE__*/react.createElement("strong",
|
|
52208
|
+
}, /*#__PURE__*/react.createElement("strong", {
|
|
52209
|
+
className: "Opacity05"
|
|
52210
|
+
}, "What is a wallet?")), showExplanation && /*#__PURE__*/react.createElement("p", {
|
|
52191
52211
|
className: "PaddingLeftM PaddingRightM"
|
|
52192
52212
|
}, "Wallets are used to send, receive, and store digital assets. Wallets come in many forms. They are either built into your browser, an extension added to your browser, a piece of hardware plugged into your computer or even an app on your phone."))
|
|
52193
52213
|
});
|
|
@@ -52340,6 +52360,9 @@ function _defineProperties(target, props) {
|
|
|
52340
52360
|
function _createClass$1(Constructor, protoProps, staticProps) {
|
|
52341
52361
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
52342
52362
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
52363
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
52364
|
+
writable: false
|
|
52365
|
+
});
|
|
52343
52366
|
return Constructor;
|
|
52344
52367
|
}
|
|
52345
52368
|
|
|
@@ -52357,12 +52380,15 @@ function _inherits$1(subClass, superClass) {
|
|
|
52357
52380
|
throw new TypeError("Super expression must either be null or a function");
|
|
52358
52381
|
}
|
|
52359
52382
|
|
|
52360
|
-
|
|
52361
|
-
|
|
52362
|
-
|
|
52363
|
-
|
|
52364
|
-
|
|
52365
|
-
|
|
52383
|
+
Object.defineProperty(subClass, "prototype", {
|
|
52384
|
+
value: Object.create(superClass && superClass.prototype, {
|
|
52385
|
+
constructor: {
|
|
52386
|
+
value: subClass,
|
|
52387
|
+
writable: true,
|
|
52388
|
+
configurable: true
|
|
52389
|
+
}
|
|
52390
|
+
}),
|
|
52391
|
+
writable: false
|
|
52366
52392
|
});
|
|
52367
52393
|
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
52368
52394
|
}
|
|
@@ -52465,7 +52491,7 @@ var ErrorProvider = (function (props) {
|
|
|
52465
52491
|
})), /*#__PURE__*/react.createElement("div", {
|
|
52466
52492
|
className: "DialogBody"
|
|
52467
52493
|
}, /*#__PURE__*/react.createElement("div", {
|
|
52468
|
-
className: "GraphicWrapper"
|
|
52494
|
+
className: "GraphicWrapper PaddingTopS"
|
|
52469
52495
|
}, /*#__PURE__*/react.createElement("img", {
|
|
52470
52496
|
className: "Graphic",
|
|
52471
52497
|
src: ErrorGraphic
|
|
@@ -52483,15 +52509,12 @@ var ErrorProvider = (function (props) {
|
|
|
52483
52509
|
className: "FontSizeM PaddingTopS"
|
|
52484
52510
|
}, "If this keeps happening, please report it.")))), /*#__PURE__*/react.createElement("div", {
|
|
52485
52511
|
className: "DialogFooter"
|
|
52486
|
-
}, /*#__PURE__*/react.createElement("div",
|
|
52512
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
52513
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
52514
|
+
}, /*#__PURE__*/react.createElement("button", {
|
|
52487
52515
|
className: "ButtonPrimary",
|
|
52488
52516
|
onClick: close
|
|
52489
|
-
}, "Try again"))
|
|
52490
|
-
href: 'https://depay.fi?utm_source=' + window.location.hostname + '&utm_medium=widget&utm_campaign=WidgetV2',
|
|
52491
|
-
rel: "noopener noreferrer",
|
|
52492
|
-
target: "_blank",
|
|
52493
|
-
className: "FooterLink"
|
|
52494
|
-
}, "by DePay"))));
|
|
52517
|
+
}, "Try again")))));
|
|
52495
52518
|
} else {
|
|
52496
52519
|
return /*#__PURE__*/react.createElement(ErrorContext.Provider, {
|
|
52497
52520
|
value: {
|
|
@@ -52503,28 +52526,28 @@ var ErrorProvider = (function (props) {
|
|
|
52503
52526
|
}
|
|
52504
52527
|
});
|
|
52505
52528
|
|
|
52529
|
+
var BlockchainLogoStyle = (function (style) {
|
|
52530
|
+
return "\n\n .BlockchainLogo {\n border-radius: 999px;\n }\n\n .BlockchainLogo.small {\n height: 18px;\n width: 18px;\n }\n ";
|
|
52531
|
+
});
|
|
52532
|
+
|
|
52506
52533
|
var ButtonCircularStyle = (function () {
|
|
52507
52534
|
return "\n\n .ButtonCircular {\n border-radius: 99rem;\n cursor: pointer;\n height: 34px;\n opacity: 0.5;\n padding: 5px 4px 4px 4px;\n width: 34px;\n }\n\n .ButtonCircular:hover {\n background: rgba(0,0,0,0.1);\n opacity: 1;\n }\n\n .ButtonCircular:active {\n background: rgba(0,0,0,0.25);\n opacity: 1;\n }\n ";
|
|
52508
52535
|
});
|
|
52509
52536
|
|
|
52510
52537
|
var ButtonPrimaryStyle = (function (style) {
|
|
52511
|
-
return "\n\n .ButtonPrimary {\n align-items: center;\n align-self: center;\n background: ".concat(style.colors.primary, ";\n border-radius:
|
|
52538
|
+
return "\n\n .ButtonPrimary {\n align-items: center;\n align-self: center;\n background: ".concat(style.colors.primary, ";\n border-radius: 0.8rem;\n border: 1px solid transparent;\n box-shadow: 0 0 16px rgba(0,0,0,0.1);\n font-size: 1.3rem;\n font-weight: 400;\n line-height: 2.8rem;\n height: 3.6rem;\n justify-content: center;\n width: 100%;\n overflow: hidden;\n padding: 0.4rem 0;\n position: relative;\n text-align: center;\n text-decoration: none;\n text-overflow: ellipsis;\n transition: background 0.1s;\n vertical-align: middle;\n display: inline-block;\n }\n\n .ButtonPrimary, .ButtonPrimary * {\n color: ").concat(style.colors.buttonText, ";\n }\n\n .ButtonPrimary.disabled {\n background: rgb(210,210,210);\n color: rgb(140,140,140);\n }\n\n .ButtonPrimary:not(.disabled){\n cursor: pointer;\n }\n .ButtonPrimary:not(.disabled):hover {\n box-shadow: inset 0 0 300px rgba(0,0,0,0.1);\n }\n .ButtonPrimary:not(.disabled):active {\n box-shadow: inset 0 0 300px rgba(0,0,0,0.2);\n }\n ");
|
|
52512
52539
|
});
|
|
52513
52540
|
|
|
52514
52541
|
var CardStyle = (function (style) {
|
|
52515
|
-
return "\n\n .Card {\n align-items: center;\n background: rgb(255,255,255);\n border-radius: 0.8rem;\n box-shadow: 0 0 8px rgba(0,0,0,0.03);\n cursor: pointer;\n display: flex;\n flex-direction: row;\n margin-bottom: 0.5rem;\n min-height: 4.78rem;\n padding: 1rem 0.6rem;\n width: 100%;\n }\n\n a.Card, a.Card * {\n color: inherit;\n text-decoration: none;\n }\n\n .Card.small {\n min-height: auto;\n padding: 0.
|
|
52542
|
+
return "\n\n .Card {\n align-items: center;\n background: rgb(255,255,255);\n border-radius: 0.8rem;\n box-shadow: 0 0 8px rgba(0,0,0,0.03);\n cursor: pointer;\n display: flex;\n flex-direction: row;\n margin-bottom: 0.5rem;\n min-height: 4.78rem;\n padding: 1rem 0.6rem;\n width: 100%;\n }\n\n a.Card, a.Card * {\n color: inherit;\n text-decoration: none;\n }\n\n .Card.transparent {\n background: none;\n box-shadow: none;\n }\n\n .Card.small {\n min-height: auto;\n padding: 0.5rem 0.5rem;\n margin: 0;\n }\n\n .Card.disabled {\n cursor: default;\n }\n\n .Card:hover:not(.disabled) {\n background: rgb(240,240,240);\n box-shadow: 0 0 0 rgba(0,0,0,0); \n }\n\n .Card:active:not(.disabled) {\n background: rgb(235,235,235);\n box-shadow: inset 0 0 6px rgba(0,0,0,0.02);\n color: inherit;\n }\n\n .Card:hover:not(.disabled) .CardAction {\n opacity: 0.4;\n }\n\n .CardImage, .CardBody, .CardAction, .CardInfo {\n align-items: center;\n display: flex;\n min-width: 0;\n padding: 0 0.4rem;\n }\n\n .CardImage {\n flex-basis: auto;\n flex-grow: 0;\n flex-shrink: 0;\n justify-content: center;\n position: relative;\n width: 3.6rem;\n }\n\n .CardBody {\n flex-basis: auto;\n flex-grow: 1;\n flex-shrink: 1;\n line-height: 1.4rem;\n padding-left: 0.6rem;\n text-align: left;\n }\n\n .CardBodyWrapper {\n min-width: 0;\n }\n\n .CardAction {\n flex-basis: auto;\n flex-shrink: 0;\n flex-grow: 0;\n padding-right: 0;\n margin-left: auto;\n }\n\n .Card.disabled .CardAction {\n opacity: 0; \n }\n\n .CardInfo {\n display: flex;\n flex-basis: auto;\n flex-direction: column;\n flex-grow: 0;\n flex-shrink: 1;\n justify-content: center;\n margin-left: auto; \n padding-right: 0;\n }\n\n .CardImage img {\n background: white;\n border-radius: 99rem;\n border: 1px solid white;\n box-shadow: 0 2px 8px rgb(0 0 0 / 10%);\n height: 2.8rem;\n position: relative;\n vertical-align: middle;\n width: 2.8rem;\n }\n\n .CardImage .BlockchainLogo {\n position: absolute;\n bottom: 0;\n right: 0;\n }\n\n .CardTitle {\n font-size: 0.9rem;\n color: rgb(150,150,150);\n }\n \n .CardText, a .CardText {\n color: ".concat(style.colors.text, ";\n flex: 1;\n font-size: 1.3rem;\n }\n\n .CardText strong {\n font-weight: 500;\n }\n\n .CardText small {\n font-size: 1.1rem;\n color: rgb(150,150,150);\n }\n\n .CardAction {\n opacity: 0.2;\n }\n\n .Card.More {\n display: inline-block;\n text-align: center;\n }\n ");
|
|
52516
52543
|
});
|
|
52517
52544
|
|
|
52518
52545
|
var DialogStyle = (function (style) {
|
|
52519
|
-
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 .
|
|
52546
|
+
return "\n\n .ReactDialogBackground {\n backdrop-filter: blur(5px);\n background: rgba(0,0,0,0.7);\n }\n\n .Dialog {\n margin: 0 auto;\n position: relative;\n width: 420px;\n box-shadow: 0 0 20px rgba(0,0,0,0.1);\n border-radius: 0.8rem;\n }\n\n @media screen and (max-width: 450px) {\n \n .Dialog, .ReactDialogAnimation {\n width: 100%;\n }\n\n }\n\n @media (orientation: portrait) and (max-width: 900px) {\n\n .Dialog {\n align-content: stretch;\n display: flex;\n flex-direction: column;\n height: 100%;\n }\n\n .DialogBody {\n flex: 1;\n align-items: flex-end;\n max-height: 40vh !important;\n }\n\n .DialogFooter {\n padding-bottom: 50px;\n }\n\n .ReactDialogStackCell {\n vertical-align: bottom;\n }\n\n .ReactDialogAnimation {\n bottom: -100px !important;\n max-height: 66vh !important;\n top: inherit !important;\n transition: opacity 0.4s ease, bottom 0.4s ease;\n }\n\n .ReactDialog.ReactDialogOpen .ReactDialogAnimation {\n bottom: 0px !important;\n }\n\n .DialogFooter {\n border-bottom-left-radius: 0 !important;\n border-bottom-right-radius: 0 !important;\n }\n }\n\n .DialogBody {\n background: rgb(248,248,248);\n overflow-x: hidden;\n overflow-y: auto;\n }\n\n .DialogBody.HeightAuto {\n height: auto;\n }\n\n .DialogHeader {\n background: rgb(248,248,248);\n border-top-left-radius: 0.8rem;\n border-top-right-radius: 0.8rem;\n display: flex;\n flex-direction: row;\n position: relative;\n }\n\n .DialogHeaderTitle {\n flex-basis: auto;\n flex-grow: 1;\n }\n \n .DialogHeaderAction {\n height: 3rem;\n }\n\n .DialogFooter {\n background: rgb(248,248,248);\n border-bottom-left-radius: 0.8rem;\n border-bottom-right-radius: 0.8rem;\n line-height: 1.5rem;\n min-height: 2rem;\n position: relative;\n text-align: center;\n }\n\n .ReactShadowDOMInsideContainer > .ReactDialog {\n display: table;\n }\n\n ";
|
|
52520
52547
|
});
|
|
52521
52548
|
|
|
52522
52549
|
var FontStyle = (function (style) {
|
|
52523
|
-
return "\n\n
|
|
52524
|
-
});
|
|
52525
|
-
|
|
52526
|
-
var FooterStyle = (function (style) {
|
|
52527
|
-
return "\n\n .FooterLink {\n color: rgba(0,0,0,0.2);\n display: inline-block;\n font-size: 0.9rem;\n text-decoration: none;\n }\n\n .FooterLink:hover, .FooterLink:active {\n color: ".concat(style.colors.primary, ";\n }\n ");
|
|
52550
|
+
return "\n\n *, div, div * {\n font-family: ".concat(style.fontFamily, ";\n }\n\n .FontSizeS {\n font-size: 1rem;\n }\n\n .FontSizeM {\n font-size: 1.2rem;\n }\n\n .FontSizeL {\n font-size: 1.4rem;\n }\n\n .FontSizeXL {\n font-size: 2.0rem;\n }\n\n .FontWeightBold {\n font-weight: bold;\n }\n\n .FontItalic {\n font-style: italic;\n }\n ");
|
|
52528
52551
|
});
|
|
52529
52552
|
|
|
52530
52553
|
var GraphicStyle = (function () {
|
|
@@ -52536,7 +52559,7 @@ var HeightStyle = (function () {
|
|
|
52536
52559
|
});
|
|
52537
52560
|
|
|
52538
52561
|
var IconStyle = (function (style) {
|
|
52539
|
-
return "\n\n .Icon {\n fill : ".concat(style.colors.icons, ";\n stroke : ").concat(style.colors.icons, ";\n }\n\n .ChevronLeft, .ChevronRight {\n position: relative;\n top: 1px;\n }\n\n .Checkmark {\n height:
|
|
52562
|
+
return "\n\n .Icon {\n fill : ".concat(style.colors.icons, ";\n stroke : ").concat(style.colors.icons, ";\n }\n\n .ChevronLeft, .ChevronRight {\n position: relative;\n top: 1px;\n }\n\n .Checkmark {\n height: 24px;\n position: relative;\n top: -1px;\n vertical-align: middle;\n width: 24px;\n }\n\n .CheckMark.small {\n height: 16px;\n width: 16px;\n }\n\n .DigitalWalletIcon {\n height: 24px;\n position: relative;\n top: -1px;\n vertical-align: middle;\n width: 24px;\n }\n\n .ButtonPrimary .Icon {\n fill : ").concat(style.colors.buttonText, ";\n stroke : ").concat(style.colors.buttonText, ";\n }\n\n .Loading {\n border: 3px solid ").concat(style.colors.primary, ";\n border-top: 3px solid rgba(0,0,0,0.1);\n border-radius: 100%;\n position: relative;\n left: -1px;\n width: 18px;\n height: 18px;\n animation: spin 1.5s linear infinite;\n }\n\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n ");
|
|
52540
52563
|
});
|
|
52541
52564
|
|
|
52542
52565
|
var ImageStyle = (function (style) {
|
|
@@ -52555,10 +52578,18 @@ var LoadingTextStyle = (function (style) {
|
|
|
52555
52578
|
return "\n\n .LoadingText {\n color: ".concat(style.colors.buttonText, ";\n display: inline-block;\n text-decoration: none;\n }\n\n @keyframes blink {\n 0% { opacity: .2; }\n 20% { opacity: 1; }\n 100% { opacity: .2; }\n }\n \n .LoadingText .dot {\n animation-name: blink;\n animation-duration: 1.4s;\n animation-iteration-count: infinite;\n animation-fill-mode: both;\n }\n \n .LoadingText .dot:nth-child(2) {\n animation-delay: .2s;\n }\n \n .LoadingText .dot:nth-child(3) {\n animation-delay: .4s;\n }\n ");
|
|
52556
52579
|
});
|
|
52557
52580
|
|
|
52581
|
+
var OpacityStyle = (function (style) {
|
|
52582
|
+
return "\n\n .Opacity05 {\n opacity: 0.5;\n }\n ";
|
|
52583
|
+
});
|
|
52584
|
+
|
|
52558
52585
|
var PaddingStyle = (function () {
|
|
52559
52586
|
return "\n\n .PaddingTopXS {\n padding-top: 0.2rem;\n }\n\n .PaddingRightXS {\n padding-right: 0.2rem;\n }\n\n .PaddingBottomXS {\n padding-bottom: 0.2rem;\n }\n\n .PaddingLeftXS {\n padding-left: 0.2rem; \n }\n\n .PaddingTopS {\n padding-top: 0.8rem;\n }\n\n .PaddingRightS {\n padding-right: 0.8rem;\n }\n\n .PaddingBottomS {\n padding-bottom: 0.8rem;\n }\n\n .PaddingLeftS {\n padding-left: 0.8rem; \n }\n\n .PaddingTopM {\n padding-top: 1.2rem;\n }\n\n .PaddingRightM {\n padding-right: 1.2rem;\n }\n\n .PaddingBottomM {\n padding-bottom: 1.2rem;\n }\n\n .PaddingLeftM {\n padding-left: 1.2rem; \n }\n\n .PaddingTopL {\n padding-top: 1.8rem;\n }\n\n .PaddingRightL {\n padding-right: 1.8rem;\n }\n\n .PaddingBottomL {\n padding-bottom: 1.8rem;\n }\n\n .PaddingLeftL {\n padding-left: 1.28em; \n }\n ";
|
|
52560
52587
|
});
|
|
52561
52588
|
|
|
52589
|
+
var PoweredByStyle = (function (style) {
|
|
52590
|
+
return "\n\n .PoweredByWrapper {\n display: block;\n left: 0;\n padding-top: 0.2rem;\n position: fixed;\n right: 0;\n text-align: center;\n top: 0;\n }\n\n .PoweredByLink {\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\" !important;\n color: white;\n opacity: 0.4;\n display: inline-block;\n font-size: 0.78rem;\n font-style: italic;\n font-weight: bold;\n letter-spacing: -0.2px;\n margin-left: 0.5rem;\n text-decoration: none;\n }\n\n .PoweredByLink:hover, .PoweredByLink:active {\n opacity: 1.0;\n color: ".concat(style.colors.primary, ";\n }\n ");
|
|
52591
|
+
});
|
|
52592
|
+
|
|
52562
52593
|
var RangeSliderStyle = (function (style) {
|
|
52563
52594
|
return "\n\n .rangeslider {\n margin: 20px 0;\n position: relative;\n background: #e6e6e6;\n -ms-touch-action: none;\n touch-action: none;\n }\n\n .rangeslider,\n .rangeslider__fill {\n display: block;\n box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);\n }\n\n .rangeslider__handle {\n outline: none;\n cursor: pointer;\n display: inline-block;\n position: absolute;\n border-radius: 50%;\n background-color: " + style.colors.primary + ";\n border: 1px solid white;\n box-shadow: 0 0 8px rgba(0,0,0,0.1);\n }\n\n .rangeslider__handle:hover {\n box-shadow: inset 0 0 300px rgba(0,0,0,0.2);\n }\n\n .rangeslider__handle:active {\n box-shadow: inset 0 0 300px rgba(0,0,0,0.3);\n }\n\n .rangeslider__active {\n opacity: 1;\n }\n\n .rangeslider__handle-tooltip {\n display: none;\n }\n\n .rangeslider-horizontal {\n height: 12px;\n border-radius: 10px;\n }\n\n .rangeslider-horizontal .rangeslider__fill {\n height: 100%;\n background-color: " + style.colors.primary + ";\n border-radius: 10px;\n top: 0;\n }\n .rangeslider-horizontal .rangeslider__handle {\n width: 18px;\n height: 18px;\n border-radius: 30px;\n top: 50%;\n transform: translate3d(-50%, -50%, 0);\n }\n\n\n .rangeslider-horizontal .rangeslider__handle-tooltip {\n top: -55px;\n }\n\n ";
|
|
52564
52595
|
});
|
|
@@ -52568,15 +52599,15 @@ var ResetStyle = (function () {
|
|
|
52568
52599
|
});
|
|
52569
52600
|
|
|
52570
52601
|
var SkeletonStyle = (function () {
|
|
52571
|
-
return "\n \n .Skeleton {\n background: rgb(230,230,230) !important;\n box-shadow: none !important;\n cursor: inherit !important;\n line-height: 0;\n overflow: hidden;\n position: relative;\n }\n\n @keyframes SkeletonBackgroundAnimation {\n from {\n left: -500px;\n }\n to {\n left: +120%;\n }\n }\n\n .SkeletonBackground {\n animation: 2s SkeletonBackgroundAnimation 0.2s ease infinite;\n background: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.1) 50%, transparent 100%);\n height: 100%;\n left: -140%;\n position: absolute;\n top: 0;\n width: 400px;\n }\n\n .SkeletonWrapper {\n line-height: 0;\n }\n ";
|
|
52602
|
+
return "\n \n .Skeleton {\n background: rgb(230,230,230) !important;\n border: 0px solid transparent !important;\n box-shadow: none !important;\n cursor: inherit !important;\n line-height: 0;\n overflow: hidden;\n position: relative;\n }\n\n @keyframes SkeletonBackgroundAnimation {\n from {\n left: -500px;\n }\n to {\n left: +120%;\n }\n }\n\n .SkeletonBackground {\n animation: 2s SkeletonBackgroundAnimation 0.2s ease infinite;\n background: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.1) 50%, transparent 100%);\n height: 100%;\n left: -140%;\n position: absolute;\n top: 0;\n width: 400px;\n }\n\n .SkeletonWrapper {\n line-height: 0;\n }\n ";
|
|
52572
52603
|
});
|
|
52573
52604
|
|
|
52574
52605
|
var TextButtonStyle = (function (style) {
|
|
52575
|
-
return "\n\n .TextButton {\n cursor: pointer;\n font-size: 16px;\n color: ".concat(style.colors.primary, "\n }\n\n .TextButton
|
|
52606
|
+
return "\n\n .TextButton {\n cursor: pointer;\n font-size: 16px;\n color: ".concat(style.colors.primary, "\n }\n\n .TextButton:hover * {\n opacity: 1.0;\n }\n ");
|
|
52576
52607
|
});
|
|
52577
52608
|
|
|
52578
52609
|
var TextStyle = (function (style) {
|
|
52579
|
-
return "\n\n * {\n color: ".concat(style.colors.text, ";\n }\n\n
|
|
52610
|
+
return "\n\n * {\n color: ".concat(style.colors.text, ";\n }\n\n h1, h2, h3, h4, h5, h6 {\n display: block;\n }\n\n .TextLeft, .TextLeft * {\n text-align: left;\n }\n\n .TextCenter, .TextCenter * {\n text-align: center;\n }\n\n .LineHeightL {\n line-height: 2.0rem;\n }\n\n .ErrorSnippetText {\n background: rgb(30, 30, 20);\n border-radius: 1.2rem;\n border: 0.5rem solid rgb(30, 30, 20);\n color: #00FF41;\n font-size: 0.9rem;\n font-style: italic;\n max-height: 100px;\n padding: 6px;\n overflow-wrap: break-word;\n overflow-y: auto;\n white-space: pre-wrap;\n word-wrap: break-word;\n }\n ");
|
|
52580
52611
|
});
|
|
52581
52612
|
|
|
52582
52613
|
var TokenAmountStyle = (function () {
|
|
@@ -52593,7 +52624,7 @@ var styleRenderer = (function (style) {
|
|
|
52593
52624
|
},
|
|
52594
52625
|
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'
|
|
52595
52626
|
}, style);
|
|
52596
|
-
return [ResetStyle(), FontStyle(style), DialogStyle(), ButtonCircularStyle(), ButtonPrimaryStyle(style), CardStyle(style),
|
|
52627
|
+
return [ResetStyle(), FontStyle(style), DialogStyle(), ButtonCircularStyle(), ButtonPrimaryStyle(style), CardStyle(style), PoweredByStyle(style), GraphicStyle(), SkeletonStyle(), TokenAmountStyle(), TextStyle(style), IconStyle(style), OpacityStyle(), PaddingStyle(), HeightStyle(), LabelStyle(style), LoadingTextStyle(style), RangeSliderStyle(style), InputStyle(), TextButtonStyle(style), ImageStyle(), BlockchainLogoStyle()].join('');
|
|
52597
52628
|
});
|
|
52598
52629
|
|
|
52599
52630
|
function _interopDefaultLegacy$1 (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -52713,6 +52744,31 @@ var mount = (function (_ref, content) {
|
|
|
52713
52744
|
return unmount;
|
|
52714
52745
|
});
|
|
52715
52746
|
|
|
52747
|
+
var PoweredBy = (function () {
|
|
52748
|
+
return /*#__PURE__*/react.createElement("div", {
|
|
52749
|
+
className: "PoweredByWrapper"
|
|
52750
|
+
}, /*#__PURE__*/react.createElement("a", {
|
|
52751
|
+
href: 'https://depay.fi?utm_source=' + window.location.hostname + '&utm_medium=widget&utm_campaign=WidgetV2',
|
|
52752
|
+
rel: "noopener noreferrer",
|
|
52753
|
+
target: "_blank",
|
|
52754
|
+
className: "PoweredByLink"
|
|
52755
|
+
}, "by DePay"));
|
|
52756
|
+
});
|
|
52757
|
+
|
|
52758
|
+
var UpdatableProvider = (function (props) {
|
|
52759
|
+
var _useState = react.useState(true),
|
|
52760
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
52761
|
+
updatable = _useState2[0],
|
|
52762
|
+
setUpdatable = _useState2[1];
|
|
52763
|
+
|
|
52764
|
+
return /*#__PURE__*/react.createElement(UpdatableContext.Provider, {
|
|
52765
|
+
value: {
|
|
52766
|
+
updatable: updatable,
|
|
52767
|
+
setUpdatable: setUpdatable
|
|
52768
|
+
}
|
|
52769
|
+
}, props.children);
|
|
52770
|
+
});
|
|
52771
|
+
|
|
52716
52772
|
var Connect = function Connect(options) {
|
|
52717
52773
|
var style, error, document;
|
|
52718
52774
|
|
|
@@ -52768,7 +52824,7 @@ var Connect = function Connect(options) {
|
|
|
52768
52824
|
error: error,
|
|
52769
52825
|
container: container,
|
|
52770
52826
|
unmount: unmount
|
|
52771
|
-
}, /*#__PURE__*/react.createElement(ClosableProvider, {
|
|
52827
|
+
}, /*#__PURE__*/react.createElement(UpdatableProvider, null, /*#__PURE__*/react.createElement(ClosableProvider, {
|
|
52772
52828
|
unmount: rejectBeforeUnmount
|
|
52773
52829
|
}, /*#__PURE__*/react.createElement(ConnectStack, {
|
|
52774
52830
|
document: document,
|
|
@@ -52776,7 +52832,7 @@ var Connect = function Connect(options) {
|
|
|
52776
52832
|
resolve: resolve,
|
|
52777
52833
|
reject: reject,
|
|
52778
52834
|
autoClose: true
|
|
52779
|
-
})));
|
|
52835
|
+
}), /*#__PURE__*/react.createElement(PoweredBy, null))));
|
|
52780
52836
|
};
|
|
52781
52837
|
});
|
|
52782
52838
|
|
|
@@ -63945,7 +64001,8 @@ let getAmountsOut$1 = ({ path, amountIn, tokenIn, tokenOut }) => {
|
|
|
63945
64001
|
})
|
|
63946
64002
|
.then((amountsOut)=>{
|
|
63947
64003
|
resolve(amountsOut[amountsOut.length - 1]);
|
|
63948
|
-
})
|
|
64004
|
+
})
|
|
64005
|
+
.catch(()=>resolve());
|
|
63949
64006
|
})
|
|
63950
64007
|
};
|
|
63951
64008
|
|
|
@@ -64290,7 +64347,8 @@ let getAmountsOut = ({ path, amountIn, tokenIn, tokenOut }) => {
|
|
|
64290
64347
|
})
|
|
64291
64348
|
.then((amountsOut)=>{
|
|
64292
64349
|
resolve(amountsOut[amountsOut.length - 1]);
|
|
64293
|
-
})
|
|
64350
|
+
})
|
|
64351
|
+
.catch(()=>resolve());
|
|
64294
64352
|
})
|
|
64295
64353
|
};
|
|
64296
64354
|
|
|
@@ -65363,7 +65421,9 @@ var NoPaymentMethodFoundDialog = (function () {
|
|
|
65363
65421
|
}, /*#__PURE__*/react.createElement("strong", {
|
|
65364
65422
|
className: "FontSizeM"
|
|
65365
65423
|
}, "We were not able to find any asset of value in your wallet. Please top up your account in order to proceed with this payment."))),
|
|
65366
|
-
footer: /*#__PURE__*/react.createElement("div",
|
|
65424
|
+
footer: /*#__PURE__*/react.createElement("div", {
|
|
65425
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
65426
|
+
}, /*#__PURE__*/react.createElement("button", {
|
|
65367
65427
|
className: "ButtonPrimary",
|
|
65368
65428
|
onClick: close
|
|
65369
65429
|
}, "Ok"))
|
|
@@ -65374,7 +65434,7 @@ var PaymentContext = /*#__PURE__*/react.createContext();
|
|
|
65374
65434
|
|
|
65375
65435
|
var PaymentRoutingContext = /*#__PURE__*/react.createContext();
|
|
65376
65436
|
|
|
65377
|
-
var
|
|
65437
|
+
var TrackingContext = /*#__PURE__*/react.createContext();
|
|
65378
65438
|
|
|
65379
65439
|
var PaymentProvider = (function (props) {
|
|
65380
65440
|
var _useContext = react.useContext(ErrorContext),
|
|
@@ -65383,7 +65443,6 @@ var PaymentProvider = (function (props) {
|
|
|
65383
65443
|
var _useContext2 = react.useContext(ConfigurationContext),
|
|
65384
65444
|
_sent = _useContext2.sent,
|
|
65385
65445
|
_confirmed = _useContext2.confirmed,
|
|
65386
|
-
_ensured = _useContext2.ensured,
|
|
65387
65446
|
_failed = _useContext2.failed;
|
|
65388
65447
|
|
|
65389
65448
|
var _useContext3 = react.useContext(PaymentRoutingContext),
|
|
@@ -65397,13 +65456,17 @@ var PaymentProvider = (function (props) {
|
|
|
65397
65456
|
var _useContext5 = react.useContext(PaymentRoutingContext),
|
|
65398
65457
|
allRoutes = _useContext5.allRoutes;
|
|
65399
65458
|
|
|
65400
|
-
var _useContext6 = react.useContext(
|
|
65401
|
-
_useContext6.
|
|
65402
|
-
var setUpdate = _useContext6.setUpdate;
|
|
65459
|
+
var _useContext6 = react.useContext(UpdatableContext),
|
|
65460
|
+
setUpdatable = _useContext6.setUpdatable;
|
|
65403
65461
|
|
|
65404
65462
|
var _useContext7 = react.useContext(WalletContext),
|
|
65405
65463
|
wallet = _useContext7.wallet;
|
|
65406
65464
|
|
|
65465
|
+
var _useContext8 = react.useContext(TrackingContext),
|
|
65466
|
+
forward = _useContext8.forward,
|
|
65467
|
+
tracking = _useContext8.tracking,
|
|
65468
|
+
initializeTracking = _useContext8.initializeTracking;
|
|
65469
|
+
|
|
65407
65470
|
var _useState = react.useState(),
|
|
65408
65471
|
_useState2 = _slicedToArray(_useState, 2),
|
|
65409
65472
|
payment = _useState2[0],
|
|
@@ -65424,53 +65487,81 @@ var PaymentProvider = (function (props) {
|
|
|
65424
65487
|
paymentState = _useState8[0],
|
|
65425
65488
|
setPaymentState = _useState8[1];
|
|
65426
65489
|
|
|
65427
|
-
var pay = function
|
|
65428
|
-
var
|
|
65429
|
-
|
|
65430
|
-
|
|
65431
|
-
|
|
65432
|
-
|
|
65433
|
-
|
|
65434
|
-
|
|
65435
|
-
|
|
65436
|
-
|
|
65437
|
-
|
|
65438
|
-
|
|
65439
|
-
|
|
65440
|
-
|
|
65490
|
+
var pay = /*#__PURE__*/function () {
|
|
65491
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(_ref) {
|
|
65492
|
+
var navigate, currentBlock;
|
|
65493
|
+
return regenerator.wrap(function _callee$(_context) {
|
|
65494
|
+
while (1) {
|
|
65495
|
+
switch (_context.prev = _context.next) {
|
|
65496
|
+
case 0:
|
|
65497
|
+
navigate = _ref.navigate;
|
|
65498
|
+
setClosable(false);
|
|
65499
|
+
setPaymentState('paying');
|
|
65500
|
+
setUpdatable(false);
|
|
65501
|
+
_context.next = 6;
|
|
65502
|
+
return request({
|
|
65503
|
+
blockchain: payment.route.transaction.blockchain,
|
|
65504
|
+
method: 'latestBlockNumber'
|
|
65505
|
+
});
|
|
65441
65506
|
|
|
65442
|
-
|
|
65443
|
-
|
|
65444
|
-
|
|
65445
|
-
|
|
65446
|
-
|
|
65447
|
-
|
|
65448
|
-
|
|
65449
|
-
|
|
65450
|
-
|
|
65451
|
-
|
|
65452
|
-
|
|
65453
|
-
|
|
65454
|
-
}
|
|
65507
|
+
case 6:
|
|
65508
|
+
currentBlock = _context.sent;
|
|
65509
|
+
wallet.sendTransaction(Object.assign({}, payment.route.transaction, {
|
|
65510
|
+
sent: function sent(transaction) {
|
|
65511
|
+
if (_sent) {
|
|
65512
|
+
_sent(transaction);
|
|
65513
|
+
}
|
|
65514
|
+
},
|
|
65515
|
+
confirmed: function confirmed(transaction) {
|
|
65516
|
+
if (tracking != true) {
|
|
65517
|
+
setClosable(true);
|
|
65518
|
+
}
|
|
65455
65519
|
|
|
65456
|
-
|
|
65457
|
-
setClosable(true);
|
|
65458
|
-
setUpdate(true);
|
|
65459
|
-
navigate('PaymentError');
|
|
65460
|
-
}
|
|
65461
|
-
})).then(function (sentTransaction) {
|
|
65462
|
-
setTransaction(sentTransaction);
|
|
65463
|
-
})["catch"](function (error) {
|
|
65464
|
-
console.log('error', error);
|
|
65465
|
-
setPaymentState('initialized');
|
|
65466
|
-
setClosable(true);
|
|
65467
|
-
setUpdate(true);
|
|
65520
|
+
setPaymentState('confirmed');
|
|
65468
65521
|
|
|
65469
|
-
|
|
65470
|
-
|
|
65471
|
-
|
|
65472
|
-
|
|
65473
|
-
|
|
65522
|
+
if (_confirmed) {
|
|
65523
|
+
_confirmed(transaction);
|
|
65524
|
+
}
|
|
65525
|
+
},
|
|
65526
|
+
failed: function failed(transaction, error) {
|
|
65527
|
+
if (_failed) {
|
|
65528
|
+
_failed(transaction, error);
|
|
65529
|
+
}
|
|
65530
|
+
|
|
65531
|
+
setPaymentState('initialized');
|
|
65532
|
+
setClosable(true);
|
|
65533
|
+
setUpdatable(true);
|
|
65534
|
+
navigate('PaymentError');
|
|
65535
|
+
}
|
|
65536
|
+
})).then(function (sentTransaction) {
|
|
65537
|
+
if (tracking) {
|
|
65538
|
+
initializeTracking(sentTransaction, currentBlock);
|
|
65539
|
+
}
|
|
65540
|
+
|
|
65541
|
+
setTransaction(sentTransaction);
|
|
65542
|
+
})["catch"](function (error) {
|
|
65543
|
+
console.log('error', error);
|
|
65544
|
+
setPaymentState('initialized');
|
|
65545
|
+
setClosable(true);
|
|
65546
|
+
setUpdatable(true);
|
|
65547
|
+
|
|
65548
|
+
if ((error === null || error === void 0 ? void 0 : error.code) == 'WRONG_NETWORK') {
|
|
65549
|
+
navigate('WrongNetwork');
|
|
65550
|
+
}
|
|
65551
|
+
});
|
|
65552
|
+
|
|
65553
|
+
case 8:
|
|
65554
|
+
case "end":
|
|
65555
|
+
return _context.stop();
|
|
65556
|
+
}
|
|
65557
|
+
}
|
|
65558
|
+
}, _callee);
|
|
65559
|
+
}));
|
|
65560
|
+
|
|
65561
|
+
return function pay(_x) {
|
|
65562
|
+
return _ref2.apply(this, arguments);
|
|
65563
|
+
};
|
|
65564
|
+
}();
|
|
65474
65565
|
|
|
65475
65566
|
var approve = function approve() {
|
|
65476
65567
|
setClosable(false);
|
|
@@ -65491,15 +65582,20 @@ var PaymentProvider = (function (props) {
|
|
|
65491
65582
|
});
|
|
65492
65583
|
};
|
|
65493
65584
|
|
|
65585
|
+
react.useEffect(function () {
|
|
65586
|
+
if (forward) {
|
|
65587
|
+
setPaymentState('confirmed');
|
|
65588
|
+
}
|
|
65589
|
+
}, [forward]);
|
|
65494
65590
|
react.useEffect(function () {
|
|
65495
65591
|
if (selectedRoute) {
|
|
65496
65592
|
var fromToken = selectedRoute.fromToken;
|
|
65497
65593
|
selectedRoute.transaction.params;
|
|
65498
|
-
Promise.all([fromToken.name(), fromToken.symbol(), fromToken.readable(selectedRoute.fromAmount)]).then(function (
|
|
65499
|
-
var
|
|
65500
|
-
name =
|
|
65501
|
-
symbol =
|
|
65502
|
-
amount =
|
|
65594
|
+
Promise.all([fromToken.name(), fromToken.symbol(), fromToken.readable(selectedRoute.fromAmount)]).then(function (_ref3) {
|
|
65595
|
+
var _ref4 = _slicedToArray(_ref3, 3),
|
|
65596
|
+
name = _ref4[0],
|
|
65597
|
+
symbol = _ref4[1],
|
|
65598
|
+
amount = _ref4[2];
|
|
65503
65599
|
|
|
65504
65600
|
setPayment({
|
|
65505
65601
|
route: selectedRoute,
|
|
@@ -65515,9 +65611,9 @@ var PaymentProvider = (function (props) {
|
|
|
65515
65611
|
}, [selectedRoute]);
|
|
65516
65612
|
react.useEffect(function () {
|
|
65517
65613
|
if (allRoutes && allRoutes.length == 0) {
|
|
65518
|
-
|
|
65614
|
+
setUpdatable(false);
|
|
65519
65615
|
} else if (allRoutes && allRoutes.length > 0) {
|
|
65520
|
-
|
|
65616
|
+
setUpdatable(true);
|
|
65521
65617
|
}
|
|
65522
65618
|
}, [allRoutes]);
|
|
65523
65619
|
|
|
@@ -70317,9 +70413,9 @@ let addTransactions = ({ routes, event }) => {
|
|
|
70317
70413
|
})
|
|
70318
70414
|
};
|
|
70319
70415
|
|
|
70320
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
70416
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
70321
70417
|
|
|
70322
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
70418
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
70323
70419
|
var PaymentRoutingProvider = (function (props) {
|
|
70324
70420
|
var _useState = react.useState(),
|
|
70325
70421
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -70339,8 +70435,8 @@ var PaymentRoutingProvider = (function (props) {
|
|
|
70339
70435
|
var _useContext = react.useContext(WalletContext),
|
|
70340
70436
|
account = _useContext.account;
|
|
70341
70437
|
|
|
70342
|
-
var _useContext2 = react.useContext(
|
|
70343
|
-
|
|
70438
|
+
var _useContext2 = react.useContext(UpdatableContext),
|
|
70439
|
+
updatable = _useContext2.updatable;
|
|
70344
70440
|
|
|
70345
70441
|
var prepareAcceptedPayments = function prepareAcceptedPayments(accept) {
|
|
70346
70442
|
var toAddress = _typeof(accept.receiver) == 'object' ? accept.receiver.address : accept.receiver;
|
|
@@ -70355,9 +70451,9 @@ var PaymentRoutingProvider = (function (props) {
|
|
|
70355
70451
|
var getPaymentRoutes = function getPaymentRoutes(_ref) {
|
|
70356
70452
|
var allRoutes = _ref.allRoutes,
|
|
70357
70453
|
selectedRoute = _ref.selectedRoute,
|
|
70358
|
-
|
|
70454
|
+
updatable = _ref.updatable;
|
|
70359
70455
|
|
|
70360
|
-
if (
|
|
70456
|
+
if (updatable == false || !props.accept || !account) {
|
|
70361
70457
|
return;
|
|
70362
70458
|
}
|
|
70363
70459
|
|
|
@@ -70460,13 +70556,13 @@ var PaymentRoutingProvider = (function (props) {
|
|
|
70460
70556
|
getPaymentRoutes({
|
|
70461
70557
|
allRoutes: allRoutes,
|
|
70462
70558
|
selectedRoute: selectedRoute,
|
|
70463
|
-
|
|
70559
|
+
updatable: updatable
|
|
70464
70560
|
});
|
|
70465
70561
|
}, 15000);
|
|
70466
70562
|
return function () {
|
|
70467
70563
|
return clearTimeout(timeout);
|
|
70468
70564
|
};
|
|
70469
|
-
}, [reloadCount, allRoutes, selectedRoute,
|
|
70565
|
+
}, [reloadCount, allRoutes, selectedRoute, updatable]);
|
|
70470
70566
|
react.useEffect(function () {
|
|
70471
70567
|
if (account && props.accept) {
|
|
70472
70568
|
setAllRoutes(undefined);
|
|
@@ -70496,8 +70592,8 @@ var PaymentValueProvider = (function (props) {
|
|
|
70496
70592
|
var _useContext2 = react.useContext(WalletContext),
|
|
70497
70593
|
account = _useContext2.account;
|
|
70498
70594
|
|
|
70499
|
-
var _useContext3 = react.useContext(
|
|
70500
|
-
|
|
70595
|
+
var _useContext3 = react.useContext(UpdatableContext),
|
|
70596
|
+
updatable = _useContext3.updatable;
|
|
70501
70597
|
|
|
70502
70598
|
var _useContext4 = react.useContext(PaymentContext),
|
|
70503
70599
|
payment = _useContext4.payment;
|
|
@@ -70516,10 +70612,10 @@ var PaymentValueProvider = (function (props) {
|
|
|
70516
70612
|
setReloadCount = _useState4[1];
|
|
70517
70613
|
|
|
70518
70614
|
var getToTokenLocalValue = function getToTokenLocalValue(_ref) {
|
|
70519
|
-
var
|
|
70615
|
+
var updatable = _ref.updatable,
|
|
70520
70616
|
payment = _ref.payment;
|
|
70521
70617
|
|
|
70522
|
-
if (
|
|
70618
|
+
if (updatable == false || (payment === null || payment === void 0 ? void 0 : payment.route) == undefined) {
|
|
70523
70619
|
return;
|
|
70524
70620
|
}
|
|
70525
70621
|
|
|
@@ -70562,7 +70658,7 @@ var PaymentValueProvider = (function (props) {
|
|
|
70562
70658
|
react.useEffect(function () {
|
|
70563
70659
|
if (account && payment) {
|
|
70564
70660
|
getToTokenLocalValue({
|
|
70565
|
-
|
|
70661
|
+
updatable: updatable,
|
|
70566
70662
|
payment: payment
|
|
70567
70663
|
});
|
|
70568
70664
|
}
|
|
@@ -70571,13 +70667,13 @@ var PaymentValueProvider = (function (props) {
|
|
|
70571
70667
|
var timeout = setTimeout(function () {
|
|
70572
70668
|
setReloadCount(reloadCount + 1);
|
|
70573
70669
|
getToTokenLocalValue({
|
|
70574
|
-
|
|
70670
|
+
updatable: updatable
|
|
70575
70671
|
});
|
|
70576
70672
|
}, 15000);
|
|
70577
70673
|
return function () {
|
|
70578
70674
|
return clearTimeout(timeout);
|
|
70579
70675
|
};
|
|
70580
|
-
}, [reloadCount,
|
|
70676
|
+
}, [reloadCount, updatable]);
|
|
70581
70677
|
return /*#__PURE__*/react.createElement(PaymentValueContext.Provider, {
|
|
70582
70678
|
value: {
|
|
70583
70679
|
paymentValue: paymentValue
|
|
@@ -70746,24 +70842,11 @@ createCommonjsModule$4(function (module) {
|
|
|
70746
70842
|
* LICENSE file in the root directory of this source tree.
|
|
70747
70843
|
*/
|
|
70748
70844
|
|
|
70749
|
-
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
70750
|
-
|
|
70751
|
-
var ReactPropTypesSecret_1 = ReactPropTypesSecret;
|
|
70752
|
-
|
|
70753
|
-
/**
|
|
70754
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
70755
|
-
*
|
|
70756
|
-
* This source code is licensed under the MIT license found in the
|
|
70757
|
-
* LICENSE file in the root directory of this source tree.
|
|
70758
|
-
*/
|
|
70759
|
-
|
|
70760
|
-
|
|
70761
|
-
|
|
70845
|
+
var ReactPropTypesSecret$1 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
70762
70846
|
|
|
70847
|
+
var ReactPropTypesSecret_1 = ReactPropTypesSecret$1;
|
|
70763
70848
|
|
|
70764
|
-
|
|
70765
|
-
|
|
70766
|
-
Function.call.bind(Object.prototype.hasOwnProperty);
|
|
70849
|
+
var ReactPropTypesSecret = ReactPropTypesSecret_1;
|
|
70767
70850
|
|
|
70768
70851
|
/**
|
|
70769
70852
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
@@ -70780,7 +70863,7 @@ emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
|
70780
70863
|
|
|
70781
70864
|
var factoryWithThrowingShims = function() {
|
|
70782
70865
|
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
70783
|
-
if (secret ===
|
|
70866
|
+
if (secret === ReactPropTypesSecret) {
|
|
70784
70867
|
// It is still safe when called from React.
|
|
70785
70868
|
return;
|
|
70786
70869
|
}
|
|
@@ -70798,6 +70881,7 @@ var factoryWithThrowingShims = function() {
|
|
|
70798
70881
|
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
70799
70882
|
var ReactPropTypes = {
|
|
70800
70883
|
array: shim,
|
|
70884
|
+
bigint: shim,
|
|
70801
70885
|
bool: shim,
|
|
70802
70886
|
func: shim,
|
|
70803
70887
|
number: shim,
|
|
@@ -70826,6 +70910,8 @@ var factoryWithThrowingShims = function() {
|
|
|
70826
70910
|
return ReactPropTypes;
|
|
70827
70911
|
};
|
|
70828
70912
|
|
|
70913
|
+
var require$$2 = factoryWithThrowingShims;
|
|
70914
|
+
|
|
70829
70915
|
/**
|
|
70830
70916
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
70831
70917
|
*
|
|
@@ -70837,7 +70923,7 @@ var propTypes = createCommonjsModule$4(function (module) {
|
|
|
70837
70923
|
{
|
|
70838
70924
|
// By explicitly using `prop-types` you are opting into new production behavior.
|
|
70839
70925
|
// http://fb.me/prop-types-in-prod
|
|
70840
|
-
module.exports =
|
|
70926
|
+
module.exports = require$$2();
|
|
70841
70927
|
}
|
|
70842
70928
|
});
|
|
70843
70929
|
|
|
@@ -71801,6 +71887,8 @@ var utils = /*#__PURE__*/Object.defineProperty({
|
|
|
71801
71887
|
clamp: clamp_1
|
|
71802
71888
|
}, '__esModule', {value: true});
|
|
71803
71889
|
|
|
71890
|
+
var _propTypes = propTypes;
|
|
71891
|
+
|
|
71804
71892
|
var _resizeObserverPolyfill = /*@__PURE__*/getAugmentedNamespace(ResizeObserver_es);
|
|
71805
71893
|
|
|
71806
71894
|
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; }; }();
|
|
@@ -71815,7 +71903,7 @@ var _react2 = _interopRequireDefault$1(react);
|
|
|
71815
71903
|
|
|
71816
71904
|
|
|
71817
71905
|
|
|
71818
|
-
var _propTypes2 = _interopRequireDefault$1(
|
|
71906
|
+
var _propTypes2 = _interopRequireDefault$1(_propTypes);
|
|
71819
71907
|
|
|
71820
71908
|
|
|
71821
71909
|
|
|
@@ -72331,7 +72419,7 @@ let TokenImage = function(props){
|
|
|
72331
72419
|
const handleLoadError = (error)=> {
|
|
72332
72420
|
if(source == 'trustwallet') {
|
|
72333
72421
|
setSource('depay');
|
|
72334
|
-
setSrc(`https://
|
|
72422
|
+
setSrc(`https://integrate.depay.fi/tokens/${blockchain}/${address}/image`);
|
|
72335
72423
|
} else {
|
|
72336
72424
|
setSource('unknown');
|
|
72337
72425
|
setSrc('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACABAMAAAAxEHz4AAAAGFBMVEVHcEz///////////////////////////8dS1W+AAAAB3RSTlMAHklzmMLqCsLrGwAAAQ9JREFUeNrtlrsOgkAQRRdFbDcae4IFrZEYazXRVitqQ2Hrk/19BVdX7XYuiQX3VDZzMsxrVYQQQkibGIyzLNHi8OHaVJRLWXgwMy8KLYnfGEchEFTxjp2/wHxRalBg9v4CNAXzwxYVXCSC2ypJstx+g6/ATaAdqImvoHxHzEVFcPGqWwtOnoLFx++6DGdgq9NnG+T0K8EVEPTqnrZbEKGCFO1CDs2BG2UZbpnABEwMJIA1IRSeZfdCgV8wsjdVnEBuLyKyBu51Fb+xpfhPRgdsgYqeM6DlQwQmoA62AvISgIsc2j0EaxgDL0ojx/CCCs4KPGYnVHCk4CEg7SbIKqbqfyeRAgoaERBCCCGESLgDeRfMNogh3QMAAAAASUVORK5CYII=');
|
|
@@ -72464,7 +72552,9 @@ var ChangeAmountDialog = (function (props) {
|
|
|
72464
72552
|
changeAmount(toValidValue(maxAmount));
|
|
72465
72553
|
}
|
|
72466
72554
|
}, "(Max)")))))),
|
|
72467
|
-
footer: /*#__PURE__*/react.createElement("div",
|
|
72555
|
+
footer: /*#__PURE__*/react.createElement("div", {
|
|
72556
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
72557
|
+
}, /*#__PURE__*/react.createElement("button", {
|
|
72468
72558
|
className: "ButtonPrimary",
|
|
72469
72559
|
onClick: changeAmountAndGoBack
|
|
72470
72560
|
}, "Done"))
|
|
@@ -72551,6 +72641,7 @@ var ChangePaymentDialog = (function (props) {
|
|
|
72551
72641
|
}, [allRoutes]);
|
|
72552
72642
|
react.useEffect(function () {
|
|
72553
72643
|
setCards(allPaymentRoutesWithData.map(function (payment, index) {
|
|
72644
|
+
var blockchain = Blockchain.findByName(payment.route.blockchain);
|
|
72554
72645
|
return /*#__PURE__*/react.createElement("div", {
|
|
72555
72646
|
key: index,
|
|
72556
72647
|
className: "Card",
|
|
@@ -72564,6 +72655,11 @@ var ChangePaymentDialog = (function (props) {
|
|
|
72564
72655
|
}, /*#__PURE__*/react.createElement(TokenImage_1, {
|
|
72565
72656
|
blockchain: payment.route.blockchain,
|
|
72566
72657
|
address: payment.route.fromToken.address
|
|
72658
|
+
}), /*#__PURE__*/react.createElement("img", {
|
|
72659
|
+
className: "BlockchainLogo small",
|
|
72660
|
+
src: blockchain.logo,
|
|
72661
|
+
alt: blockchain.label,
|
|
72662
|
+
title: blockchain.label
|
|
72567
72663
|
})), /*#__PURE__*/react.createElement("div", {
|
|
72568
72664
|
className: "CardBody"
|
|
72569
72665
|
}, /*#__PURE__*/react.createElement("div", {
|
|
@@ -72604,25 +72700,12 @@ var ChangePaymentDialog = (function (props) {
|
|
|
72604
72700
|
});
|
|
72605
72701
|
});
|
|
72606
72702
|
|
|
72607
|
-
var Checkmark = (function () {
|
|
72608
|
-
return /*#__PURE__*/react.createElement("svg", {
|
|
72609
|
-
className: "Checkmark Icon",
|
|
72610
|
-
version: "1.1",
|
|
72611
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
72612
|
-
x: "0px",
|
|
72613
|
-
y: "0px",
|
|
72614
|
-
viewBox: "0 0 24 24"
|
|
72615
|
-
}, /*#__PURE__*/react.createElement("path", {
|
|
72616
|
-
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"
|
|
72617
|
-
}));
|
|
72618
|
-
});
|
|
72619
|
-
|
|
72620
72703
|
var DonationOverviewSkeleton = (function (props) {
|
|
72621
72704
|
return /*#__PURE__*/react.createElement(Dialog, {
|
|
72622
72705
|
header: /*#__PURE__*/react.createElement("div", {
|
|
72623
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
72706
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
72624
72707
|
}, /*#__PURE__*/react.createElement("h1", {
|
|
72625
|
-
className: "LineHeightL FontSizeL
|
|
72708
|
+
className: "LineHeightL FontSizeL"
|
|
72626
72709
|
}, "Donation")),
|
|
72627
72710
|
body: /*#__PURE__*/react.createElement("div", {
|
|
72628
72711
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -72636,7 +72719,7 @@ var DonationOverviewSkeleton = (function (props) {
|
|
|
72636
72719
|
className: "SkeletonBackground"
|
|
72637
72720
|
}))),
|
|
72638
72721
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
72639
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
72722
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
72640
72723
|
}, /*#__PURE__*/react.createElement("div", {
|
|
72641
72724
|
className: "SkeletonWrapper"
|
|
72642
72725
|
}, /*#__PURE__*/react.createElement("div", {
|
|
@@ -72647,6 +72730,60 @@ var DonationOverviewSkeleton = (function (props) {
|
|
|
72647
72730
|
});
|
|
72648
72731
|
});
|
|
72649
72732
|
|
|
72733
|
+
var Checkmark = (function (props) {
|
|
72734
|
+
return /*#__PURE__*/react.createElement("svg", {
|
|
72735
|
+
className: "Checkmark Icon " + props.className,
|
|
72736
|
+
version: "1.1",
|
|
72737
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
72738
|
+
x: "0px",
|
|
72739
|
+
y: "0px",
|
|
72740
|
+
viewBox: "0 0 24 24"
|
|
72741
|
+
}, /*#__PURE__*/react.createElement("path", {
|
|
72742
|
+
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"
|
|
72743
|
+
}));
|
|
72744
|
+
});
|
|
72745
|
+
|
|
72746
|
+
var DigitalWalletIcon = (function (props) {
|
|
72747
|
+
return /*#__PURE__*/react.createElement("svg", {
|
|
72748
|
+
className: "DigitalWalletIcon Icon " + props.className,
|
|
72749
|
+
version: "1.1",
|
|
72750
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
72751
|
+
height: "24",
|
|
72752
|
+
width: "24",
|
|
72753
|
+
viewBox: "0 0 24 24"
|
|
72754
|
+
}, /*#__PURE__*/react.createElement("path", {
|
|
72755
|
+
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",
|
|
72756
|
+
transform: "translate(-0.81 -1)"
|
|
72757
|
+
}), /*#__PURE__*/react.createElement("path", {
|
|
72758
|
+
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",
|
|
72759
|
+
transform: "translate(-0.81 -1)"
|
|
72760
|
+
}), /*#__PURE__*/react.createElement("path", {
|
|
72761
|
+
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",
|
|
72762
|
+
transform: "translate(-0.81 -1)"
|
|
72763
|
+
}), /*#__PURE__*/react.createElement("path", {
|
|
72764
|
+
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",
|
|
72765
|
+
transform: "translate(-0.81 -1)"
|
|
72766
|
+
}), /*#__PURE__*/react.createElement("path", {
|
|
72767
|
+
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",
|
|
72768
|
+
transform: "translate(-0.81 -1)"
|
|
72769
|
+
}), /*#__PURE__*/react.createElement("path", {
|
|
72770
|
+
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",
|
|
72771
|
+
transform: "translate(-0.81 -1)"
|
|
72772
|
+
}), /*#__PURE__*/react.createElement("path", {
|
|
72773
|
+
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",
|
|
72774
|
+
transform: "translate(-0.81 -1)"
|
|
72775
|
+
}), /*#__PURE__*/react.createElement("rect", {
|
|
72776
|
+
x: "0.33",
|
|
72777
|
+
y: "11.77",
|
|
72778
|
+
width: "4.72",
|
|
72779
|
+
height: "0.66"
|
|
72780
|
+
}), /*#__PURE__*/react.createElement("polygon", {
|
|
72781
|
+
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"
|
|
72782
|
+
}), /*#__PURE__*/react.createElement("polygon", {
|
|
72783
|
+
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"
|
|
72784
|
+
}));
|
|
72785
|
+
});
|
|
72786
|
+
|
|
72650
72787
|
var LoadingText = (function (props) {
|
|
72651
72788
|
return /*#__PURE__*/react.createElement("div", {
|
|
72652
72789
|
className: "LoadingText"
|
|
@@ -72659,26 +72796,143 @@ var LoadingText = (function (props) {
|
|
|
72659
72796
|
}, "."));
|
|
72660
72797
|
});
|
|
72661
72798
|
|
|
72662
|
-
var
|
|
72799
|
+
var Footer = (function () {
|
|
72663
72800
|
var _useContext = react.useContext(ConfigurationContext),
|
|
72664
72801
|
currencyCode = _useContext.currencyCode;
|
|
72665
72802
|
|
|
72666
72803
|
var _useContext2 = react.useContext(ChangableAmountContext),
|
|
72667
72804
|
amount = _useContext2.amount;
|
|
72805
|
+
_useContext2.amountsMissing;
|
|
72668
72806
|
|
|
72669
|
-
var _useContext3 = react.useContext(
|
|
72670
|
-
|
|
72671
|
-
|
|
72672
|
-
|
|
72673
|
-
transaction = _useContext3.transaction,
|
|
72674
|
-
approve = _useContext3.approve,
|
|
72675
|
-
approvalTransaction = _useContext3.approvalTransaction;
|
|
72807
|
+
var _useContext3 = react.useContext(TrackingContext),
|
|
72808
|
+
tracking = _useContext3.tracking,
|
|
72809
|
+
forward = _useContext3.forward,
|
|
72810
|
+
forwardTo = _useContext3.forwardTo;
|
|
72676
72811
|
|
|
72677
|
-
var _useContext4 = react.useContext(
|
|
72678
|
-
|
|
72812
|
+
var _useContext4 = react.useContext(PaymentContext),
|
|
72813
|
+
payment = _useContext4.payment,
|
|
72814
|
+
paymentState = _useContext4.paymentState,
|
|
72815
|
+
pay = _useContext4.pay,
|
|
72816
|
+
transaction = _useContext4.transaction,
|
|
72817
|
+
approve = _useContext4.approve,
|
|
72818
|
+
approvalTransaction = _useContext4.approvalTransaction;
|
|
72819
|
+
|
|
72820
|
+
var _useContext5 = react.useContext(PaymentValueContext),
|
|
72821
|
+
paymentValue = _useContext5.paymentValue;
|
|
72822
|
+
|
|
72823
|
+
var _useContext6 = react.useContext(NavigateStackContext_1),
|
|
72824
|
+
navigate = _useContext6.navigate;
|
|
72825
|
+
|
|
72826
|
+
var _useContext7 = react.useContext(ClosableContext),
|
|
72827
|
+
close = _useContext7.close;
|
|
72828
|
+
|
|
72829
|
+
var trackingInfo = function trackingInfo() {
|
|
72830
|
+
if (tracking != true) {
|
|
72831
|
+
return null;
|
|
72832
|
+
}
|
|
72679
72833
|
|
|
72680
|
-
|
|
72681
|
-
|
|
72834
|
+
if (forward) {
|
|
72835
|
+
return /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("a", {
|
|
72836
|
+
className: "Card transparent small disabled"
|
|
72837
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72838
|
+
className: "CardImage"
|
|
72839
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72840
|
+
className: "TextCenter Opacity05"
|
|
72841
|
+
}, /*#__PURE__*/react.createElement(Checkmark, {
|
|
72842
|
+
className: "small"
|
|
72843
|
+
}))), /*#__PURE__*/react.createElement("div", {
|
|
72844
|
+
className: "CardBody"
|
|
72845
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72846
|
+
className: "CardBodyWrapper"
|
|
72847
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72848
|
+
className: "Opacity05"
|
|
72849
|
+
}, "Payment confirmation has been stored")))));
|
|
72850
|
+
} else {
|
|
72851
|
+
return /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("a", {
|
|
72852
|
+
className: "Card transparent small disabled"
|
|
72853
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72854
|
+
className: "CardImage"
|
|
72855
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72856
|
+
className: "TextCenter"
|
|
72857
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72858
|
+
className: "Loading Icon"
|
|
72859
|
+
}))), /*#__PURE__*/react.createElement("div", {
|
|
72860
|
+
className: "CardBody"
|
|
72861
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72862
|
+
className: "CardBodyWrapper"
|
|
72863
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72864
|
+
className: "Opacity05"
|
|
72865
|
+
}, "Storing payment confirmation")))));
|
|
72866
|
+
}
|
|
72867
|
+
};
|
|
72868
|
+
|
|
72869
|
+
var additionalPaymentInformation = function additionalPaymentInformation() {
|
|
72870
|
+
if (paymentState == 'paying' && transaction == undefined) {
|
|
72871
|
+
return /*#__PURE__*/react.createElement("div", {
|
|
72872
|
+
className: "PaddingBottomS"
|
|
72873
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72874
|
+
className: "Card transparent disabled small"
|
|
72875
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72876
|
+
className: "CardImage"
|
|
72877
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72878
|
+
className: "TextCenter Opacity05"
|
|
72879
|
+
}, /*#__PURE__*/react.createElement(DigitalWalletIcon, {
|
|
72880
|
+
className: "small"
|
|
72881
|
+
}))), /*#__PURE__*/react.createElement("div", {
|
|
72882
|
+
className: "CardBody"
|
|
72883
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72884
|
+
className: "CardBodyWrapper"
|
|
72885
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72886
|
+
className: "Opacity05"
|
|
72887
|
+
}, "Confirm transaction in your wallet")))));
|
|
72888
|
+
} else if (paymentState == 'confirmed') {
|
|
72889
|
+
return /*#__PURE__*/react.createElement("div", {
|
|
72890
|
+
className: "PaddingBottomS"
|
|
72891
|
+
}, /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("a", {
|
|
72892
|
+
className: "Card transparent small",
|
|
72893
|
+
title: "Payment has been confirmed by the network",
|
|
72894
|
+
href: transaction === null || transaction === void 0 ? void 0 : transaction.url,
|
|
72895
|
+
target: "_blank",
|
|
72896
|
+
rel: "noopener noreferrer"
|
|
72897
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72898
|
+
className: "CardImage"
|
|
72899
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72900
|
+
className: "TextCenter Opacity05"
|
|
72901
|
+
}, /*#__PURE__*/react.createElement(Checkmark, {
|
|
72902
|
+
className: "small"
|
|
72903
|
+
}))), /*#__PURE__*/react.createElement("div", {
|
|
72904
|
+
className: "CardBody"
|
|
72905
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72906
|
+
className: "CardBodyWrapper"
|
|
72907
|
+
}, /*#__PURE__*/react.createElement("div", {
|
|
72908
|
+
className: "Opacity05"
|
|
72909
|
+
}, "Payment has been confirmed"))))), trackingInfo());
|
|
72910
|
+
}
|
|
72911
|
+
};
|
|
72912
|
+
|
|
72913
|
+
var approvalButton = function approvalButton() {
|
|
72914
|
+
if (!payment.route.approvalRequired || payment.route.directTransfer) {
|
|
72915
|
+
return null;
|
|
72916
|
+
} else if (paymentState == 'initialized') {
|
|
72917
|
+
return /*#__PURE__*/react.createElement("div", {
|
|
72918
|
+
className: "PaddingBottomS"
|
|
72919
|
+
}, /*#__PURE__*/react.createElement("button", {
|
|
72920
|
+
className: "ButtonPrimary",
|
|
72921
|
+
onClick: approve,
|
|
72922
|
+
title: "Allow ".concat(payment.symbol, " to be used as payment")
|
|
72923
|
+
}, "Allow ", payment.symbol, " to be used as payment"));
|
|
72924
|
+
} else if (paymentState == 'approving') {
|
|
72925
|
+
return /*#__PURE__*/react.createElement("div", {
|
|
72926
|
+
className: "PaddingBottomS"
|
|
72927
|
+
}, /*#__PURE__*/react.createElement("a", {
|
|
72928
|
+
className: "ButtonPrimary",
|
|
72929
|
+
title: "Approving payment token - please wait",
|
|
72930
|
+
href: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
|
|
72931
|
+
target: "_blank",
|
|
72932
|
+
rel: "noopener noreferrer"
|
|
72933
|
+
}, /*#__PURE__*/react.createElement(LoadingText, null, "Approving")));
|
|
72934
|
+
}
|
|
72935
|
+
};
|
|
72682
72936
|
|
|
72683
72937
|
var mainAction = function mainAction() {
|
|
72684
72938
|
if (paymentState == 'initialized' || paymentState == 'approving') {
|
|
@@ -72693,10 +72947,10 @@ var DonationOverviewDialog = (function (props) {
|
|
|
72693
72947
|
navigate: navigate
|
|
72694
72948
|
});
|
|
72695
72949
|
}
|
|
72696
|
-
}, "Pay ", new Currency({
|
|
72950
|
+
}, "Pay ", amount ? new Currency({
|
|
72697
72951
|
amount: amount.toFixed(2),
|
|
72698
72952
|
code: currencyCode
|
|
72699
|
-
}).toString());
|
|
72953
|
+
}).toString() : paymentValue.toString().length ? paymentValue.toString() : "".concat(payment.amount));
|
|
72700
72954
|
} else if (paymentState == 'paying') {
|
|
72701
72955
|
return /*#__PURE__*/react.createElement("a", {
|
|
72702
72956
|
className: "ButtonPrimary",
|
|
@@ -72706,39 +72960,51 @@ var DonationOverviewDialog = (function (props) {
|
|
|
72706
72960
|
rel: "noopener noreferrer"
|
|
72707
72961
|
}, /*#__PURE__*/react.createElement(LoadingText, null, "Paying"));
|
|
72708
72962
|
} else if (paymentState == 'confirmed') {
|
|
72709
|
-
|
|
72710
|
-
|
|
72711
|
-
|
|
72712
|
-
|
|
72713
|
-
|
|
72963
|
+
if (tracking == true) {
|
|
72964
|
+
if (forward) {
|
|
72965
|
+
if (forwardTo) {
|
|
72966
|
+
return /*#__PURE__*/react.createElement("a", {
|
|
72967
|
+
className: "ButtonPrimary",
|
|
72968
|
+
href: forwardTo,
|
|
72969
|
+
rel: "noopener noreferrer"
|
|
72970
|
+
}, "Continue");
|
|
72971
|
+
} else {
|
|
72972
|
+
return /*#__PURE__*/react.createElement("button", {
|
|
72973
|
+
className: "ButtonPrimary",
|
|
72974
|
+
onClick: close
|
|
72975
|
+
}, "Continue");
|
|
72976
|
+
}
|
|
72977
|
+
} else {
|
|
72978
|
+
return /*#__PURE__*/react.createElement("button", {
|
|
72979
|
+
className: "ButtonPrimary disabled",
|
|
72980
|
+
onClick: function onClick() {}
|
|
72981
|
+
}, "Continue");
|
|
72982
|
+
}
|
|
72983
|
+
} else {
|
|
72984
|
+
return /*#__PURE__*/react.createElement("button", {
|
|
72985
|
+
className: "ButtonPrimary",
|
|
72986
|
+
onClick: close
|
|
72987
|
+
}, "Close");
|
|
72988
|
+
}
|
|
72714
72989
|
}
|
|
72715
72990
|
};
|
|
72716
72991
|
|
|
72717
|
-
|
|
72718
|
-
|
|
72719
|
-
return /*#__PURE__*/react.createElement("div", {
|
|
72720
|
-
className: "PaddingBottomS"
|
|
72721
|
-
}, /*#__PURE__*/react.createElement("button", {
|
|
72722
|
-
className: "ButtonPrimary wide",
|
|
72723
|
-
onClick: approve,
|
|
72724
|
-
title: "Allow ".concat(payment.symbol, " to be used as payment")
|
|
72725
|
-
}, "Allow ", payment.symbol, " to be used as payment"));
|
|
72726
|
-
} else if (paymentState == 'approving') {
|
|
72727
|
-
return /*#__PURE__*/react.createElement("div", {
|
|
72728
|
-
className: "PaddingBottomS"
|
|
72729
|
-
}, /*#__PURE__*/react.createElement("a", {
|
|
72730
|
-
className: "ButtonPrimary wide",
|
|
72731
|
-
title: "Approving payment token - please wait",
|
|
72732
|
-
href: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
|
|
72733
|
-
target: "_blank",
|
|
72734
|
-
rel: "noopener noreferrer"
|
|
72735
|
-
}, /*#__PURE__*/react.createElement(LoadingText, null, "Approving")));
|
|
72736
|
-
}
|
|
72737
|
-
};
|
|
72992
|
+
return /*#__PURE__*/react.createElement("div", null, approvalButton(), additionalPaymentInformation(), mainAction());
|
|
72993
|
+
});
|
|
72738
72994
|
|
|
72739
|
-
|
|
72740
|
-
|
|
72741
|
-
|
|
72995
|
+
var DonationOverviewDialog = (function (props) {
|
|
72996
|
+
var _useContext = react.useContext(ConfigurationContext),
|
|
72997
|
+
currencyCode = _useContext.currencyCode;
|
|
72998
|
+
|
|
72999
|
+
var _useContext2 = react.useContext(ChangableAmountContext),
|
|
73000
|
+
amount = _useContext2.amount;
|
|
73001
|
+
|
|
73002
|
+
var _useContext3 = react.useContext(PaymentContext),
|
|
73003
|
+
payment = _useContext3.payment,
|
|
73004
|
+
paymentState = _useContext3.paymentState;
|
|
73005
|
+
|
|
73006
|
+
var _useContext4 = react.useContext(NavigateStackContext_1),
|
|
73007
|
+
navigate = _useContext4.navigate;
|
|
72742
73008
|
|
|
72743
73009
|
if (payment == undefined) {
|
|
72744
73010
|
return /*#__PURE__*/react.createElement(DonationOverviewSkeleton, null);
|
|
@@ -72746,9 +73012,9 @@ var DonationOverviewDialog = (function (props) {
|
|
|
72746
73012
|
|
|
72747
73013
|
return /*#__PURE__*/react.createElement(Dialog, {
|
|
72748
73014
|
header: /*#__PURE__*/react.createElement("div", {
|
|
72749
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
73015
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
72750
73016
|
}, /*#__PURE__*/react.createElement("h1", {
|
|
72751
|
-
className: "LineHeightL FontSizeL
|
|
73017
|
+
className: "LineHeightL FontSizeL"
|
|
72752
73018
|
}, "Donation")),
|
|
72753
73019
|
body: /*#__PURE__*/react.createElement("div", {
|
|
72754
73020
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -72811,8 +73077,8 @@ var DonationOverviewDialog = (function (props) {
|
|
|
72811
73077
|
className: "CardAction"
|
|
72812
73078
|
}, /*#__PURE__*/react.createElement(ChevronRight, null)))),
|
|
72813
73079
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
72814
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
72815
|
-
},
|
|
73080
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
73081
|
+
}, /*#__PURE__*/react.createElement(Footer, null))
|
|
72816
73082
|
});
|
|
72817
73083
|
});
|
|
72818
73084
|
|
|
@@ -72849,9 +73115,9 @@ var PaymentErrorDialog = (function () {
|
|
|
72849
73115
|
rel: "noopener noreferrer"
|
|
72850
73116
|
}, "View on explorer")))),
|
|
72851
73117
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
72852
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
73118
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
72853
73119
|
}, /*#__PURE__*/react.createElement("button", {
|
|
72854
|
-
className: "ButtonPrimary
|
|
73120
|
+
className: "ButtonPrimary",
|
|
72855
73121
|
onClick: function onClick() {
|
|
72856
73122
|
return navigate('back');
|
|
72857
73123
|
}
|
|
@@ -72872,9 +73138,9 @@ var WrongNetworkDialog = (function (props) {
|
|
|
72872
73138
|
return /*#__PURE__*/react.createElement(Dialog, {
|
|
72873
73139
|
stacked: true,
|
|
72874
73140
|
header: /*#__PURE__*/react.createElement("div", {
|
|
72875
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
73141
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
72876
73142
|
}, /*#__PURE__*/react.createElement("h1", {
|
|
72877
|
-
className: "LineHeightL FontSizeL
|
|
73143
|
+
className: "LineHeightL FontSizeL"
|
|
72878
73144
|
}, "Wrong Network")),
|
|
72879
73145
|
body: /*#__PURE__*/react.createElement("div", {
|
|
72880
73146
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -72891,7 +73157,7 @@ var WrongNetworkDialog = (function (props) {
|
|
|
72891
73157
|
className: "FontSizeM"
|
|
72892
73158
|
}, "Please make sure you connect your wallet to the correct network before you try again!"))),
|
|
72893
73159
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
72894
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
73160
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
72895
73161
|
}, /*#__PURE__*/react.createElement("button", {
|
|
72896
73162
|
className: "ButtonPrimary",
|
|
72897
73163
|
onClick: function onClick() {
|
|
@@ -72922,16 +73188,122 @@ var DonationStack = (function (props) {
|
|
|
72922
73188
|
});
|
|
72923
73189
|
});
|
|
72924
73190
|
|
|
72925
|
-
var
|
|
72926
|
-
var
|
|
73191
|
+
var TrackingProvider = (function (props) {
|
|
73192
|
+
var _useContext = react.useContext(ConfigurationContext),
|
|
73193
|
+
track = _useContext.track;
|
|
73194
|
+
|
|
73195
|
+
var _useState = react.useState(track && !!track.endpoint),
|
|
72927
73196
|
_useState2 = _slicedToArray(_useState, 2),
|
|
72928
|
-
|
|
72929
|
-
|
|
73197
|
+
tracking = _useState2[0],
|
|
73198
|
+
setTracking = _useState2[1];
|
|
73199
|
+
|
|
73200
|
+
var _useState3 = react.useState(false),
|
|
73201
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
73202
|
+
forward = _useState4[0],
|
|
73203
|
+
setForward = _useState4[1];
|
|
73204
|
+
|
|
73205
|
+
var _useState5 = react.useState(),
|
|
73206
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
73207
|
+
forwardTo = _useState6[0],
|
|
73208
|
+
setForwardTo = _useState6[1];
|
|
73209
|
+
|
|
73210
|
+
var _useContext2 = react.useContext(ClosableContext),
|
|
73211
|
+
setClosable = _useContext2.setClosable;
|
|
73212
|
+
|
|
73213
|
+
react.useEffect(function () {
|
|
73214
|
+
setTracking(track && !!track.endpoint);
|
|
73215
|
+
}, [track]);
|
|
73216
|
+
|
|
73217
|
+
var openSocket = function openSocket(transaction) {
|
|
73218
|
+
var socket = new WebSocket('wss://integrate.depay.fi/cable');
|
|
73219
|
+
|
|
73220
|
+
socket.onopen = function (event) {
|
|
73221
|
+
var msg = {
|
|
73222
|
+
command: 'subscribe',
|
|
73223
|
+
identifier: JSON.stringify({
|
|
73224
|
+
blockchain: transaction.blockchain,
|
|
73225
|
+
sender: transaction.from.toLowerCase(),
|
|
73226
|
+
nonce: transaction.nonce,
|
|
73227
|
+
channel: 'PaymentChannel'
|
|
73228
|
+
})
|
|
73229
|
+
};
|
|
73230
|
+
socket.send(JSON.stringify(msg));
|
|
73231
|
+
};
|
|
73232
|
+
|
|
73233
|
+
socket.onclose = function (event) {};
|
|
73234
|
+
|
|
73235
|
+
socket.onmessage = function (event) {
|
|
73236
|
+
var item = JSON.parse(event.data);
|
|
73237
|
+
|
|
73238
|
+
if (item.type === "ping") {
|
|
73239
|
+
return;
|
|
73240
|
+
}
|
|
73241
|
+
|
|
73242
|
+
if (item.message && item.message.forward) {
|
|
73243
|
+
setClosable(!item.message.forward_to);
|
|
73244
|
+
setForwardTo(item.message.forward_to);
|
|
73245
|
+
setForward(item.message.forward);
|
|
73246
|
+
socket.close();
|
|
73247
|
+
|
|
73248
|
+
if (!!item.message.forward_to) {
|
|
73249
|
+
setTimeout(function () {
|
|
73250
|
+
props.document.location.href = item.message.forward_to;
|
|
73251
|
+
}, 500);
|
|
73252
|
+
}
|
|
73253
|
+
}
|
|
73254
|
+
};
|
|
73255
|
+
|
|
73256
|
+
socket.onerror = function (error) {
|
|
73257
|
+
console.log('WebSocket Error: ' + error);
|
|
73258
|
+
};
|
|
73259
|
+
};
|
|
73260
|
+
|
|
73261
|
+
var retryStartTracking = function retryStartTracking(transaction, afterBlock, attempt) {
|
|
73262
|
+
attempt = parseInt(attempt || 1, 10);
|
|
73263
|
+
console.log('RETRY TRACKING ATTEMPT ', attempt);
|
|
73264
|
+
|
|
73265
|
+
if (attempt < 3) {
|
|
73266
|
+
setTimeout(function () {
|
|
73267
|
+
startTracking(transaction, afterBlock, attempt + 1);
|
|
73268
|
+
}, 3000);
|
|
73269
|
+
} else {
|
|
73270
|
+
console.log('TRACKING FAILED AFTER 3 ATTEMPTS!');
|
|
73271
|
+
}
|
|
73272
|
+
};
|
|
73273
|
+
|
|
73274
|
+
var startTracking = function startTracking(transaction, afterBlock, attempt) {
|
|
73275
|
+
fetch(track.endpoint, {
|
|
73276
|
+
method: 'POST',
|
|
73277
|
+
body: JSON.stringify({
|
|
73278
|
+
blockchain: transaction.blockchain,
|
|
73279
|
+
transaction: transaction.id.toLowerCase(),
|
|
73280
|
+
sender: transaction.from.toLowerCase(),
|
|
73281
|
+
nonce: transaction.nonce,
|
|
73282
|
+
after_block: afterBlock
|
|
73283
|
+
})
|
|
73284
|
+
}).then(function (response) {
|
|
73285
|
+
if (response.status == 200) {
|
|
73286
|
+
console.log('TRACKING INITIALIZED');
|
|
73287
|
+
} else {
|
|
73288
|
+
retryStartTracking(transaction, afterBlock, attempt);
|
|
73289
|
+
}
|
|
73290
|
+
})["catch"](function (error) {
|
|
73291
|
+
console.log('TRACKING FAILED', error);
|
|
73292
|
+
retryStartTracking(transaction, afterBlock, attempt);
|
|
73293
|
+
});
|
|
73294
|
+
};
|
|
73295
|
+
|
|
73296
|
+
var initializeTracking = function initializeTracking(transaction, afterBlock) {
|
|
73297
|
+
openSocket(transaction);
|
|
73298
|
+
startTracking(transaction, afterBlock);
|
|
73299
|
+
};
|
|
72930
73300
|
|
|
72931
|
-
return /*#__PURE__*/react.createElement(
|
|
73301
|
+
return /*#__PURE__*/react.createElement(TrackingContext.Provider, {
|
|
72932
73302
|
value: {
|
|
72933
|
-
|
|
72934
|
-
|
|
73303
|
+
tracking: tracking,
|
|
73304
|
+
initializeTracking: initializeTracking,
|
|
73305
|
+
forward: forward,
|
|
73306
|
+
forwardTo: forwardTo
|
|
72935
73307
|
}
|
|
72936
73308
|
}, props.children);
|
|
72937
73309
|
});
|
|
@@ -73034,12 +73406,12 @@ var preflight$2 = /*#__PURE__*/function () {
|
|
|
73034
73406
|
|
|
73035
73407
|
var Donation = /*#__PURE__*/function () {
|
|
73036
73408
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(_ref3) {
|
|
73037
|
-
var amount, accept, event, sent, confirmed,
|
|
73409
|
+
var amount, accept, event, sent, confirmed, failed, error, critical, style, blacklist, providers, currency, connected, closed, document, unmount;
|
|
73038
73410
|
return regenerator.wrap(function _callee2$(_context2) {
|
|
73039
73411
|
while (1) {
|
|
73040
73412
|
switch (_context2.prev = _context2.next) {
|
|
73041
73413
|
case 0:
|
|
73042
|
-
amount = _ref3.amount, accept = _ref3.accept, event = _ref3.event, sent = _ref3.sent, confirmed = _ref3.confirmed,
|
|
73414
|
+
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;
|
|
73043
73415
|
_context2.prev = 1;
|
|
73044
73416
|
_context2.next = 4;
|
|
73045
73417
|
return preflight$2({
|
|
@@ -73065,26 +73437,27 @@ var Donation = /*#__PURE__*/function () {
|
|
|
73065
73437
|
event: event,
|
|
73066
73438
|
sent: sent,
|
|
73067
73439
|
confirmed: confirmed,
|
|
73068
|
-
ensured: ensured,
|
|
73069
73440
|
failed: failed,
|
|
73070
73441
|
blacklist: blacklist,
|
|
73071
73442
|
providers: providers
|
|
73072
73443
|
}
|
|
73073
|
-
}, /*#__PURE__*/react.createElement(ClosableProvider, {
|
|
73444
|
+
}, /*#__PURE__*/react.createElement(UpdatableProvider, null, /*#__PURE__*/react.createElement(ClosableProvider, {
|
|
73074
73445
|
unmount: unmount
|
|
73075
|
-
}, /*#__PURE__*/react.createElement(
|
|
73446
|
+
}, /*#__PURE__*/react.createElement(WalletProvider, {
|
|
73076
73447
|
container: container,
|
|
73077
73448
|
connected: connected,
|
|
73078
73449
|
unmount: unmount
|
|
73079
73450
|
}, /*#__PURE__*/react.createElement(ConversionRateProvider, null, /*#__PURE__*/react.createElement(ChangableAmountProvider, {
|
|
73080
73451
|
accept: accept
|
|
73452
|
+
}, /*#__PURE__*/react.createElement(TrackingProvider, {
|
|
73453
|
+
document: ensureDocument(document)
|
|
73081
73454
|
}, /*#__PURE__*/react.createElement(DonationRoutingProvider, {
|
|
73082
73455
|
container: container,
|
|
73083
73456
|
document: document
|
|
73084
73457
|
}, /*#__PURE__*/react.createElement(DonationStack, {
|
|
73085
73458
|
document: document,
|
|
73086
73459
|
container: container
|
|
73087
|
-
})))))))));
|
|
73460
|
+
}), /*#__PURE__*/react.createElement(PoweredBy, null))))))))));
|
|
73088
73461
|
};
|
|
73089
73462
|
});
|
|
73090
73463
|
return _context2.abrupt("return", {
|
|
@@ -73152,9 +73525,9 @@ var PaymentOverviewSkeleton = (function (props) {
|
|
|
73152
73525
|
|
|
73153
73526
|
return /*#__PURE__*/react.createElement(Dialog, {
|
|
73154
73527
|
header: /*#__PURE__*/react.createElement("div", {
|
|
73155
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
73528
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
73156
73529
|
}, /*#__PURE__*/react.createElement("h1", {
|
|
73157
|
-
className: "LineHeightL FontSizeL
|
|
73530
|
+
className: "LineHeightL FontSizeL"
|
|
73158
73531
|
}, "Payment")),
|
|
73159
73532
|
body: /*#__PURE__*/react.createElement("div", {
|
|
73160
73533
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -73168,7 +73541,7 @@ var PaymentOverviewSkeleton = (function (props) {
|
|
|
73168
73541
|
className: "SkeletonBackground"
|
|
73169
73542
|
}))),
|
|
73170
73543
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
73171
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
73544
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
73172
73545
|
}, /*#__PURE__*/react.createElement("div", {
|
|
73173
73546
|
className: "SkeletonWrapper"
|
|
73174
73547
|
}, /*#__PURE__*/react.createElement("div", {
|
|
@@ -73183,17 +73556,13 @@ var PaymentOverviewDialog = (function (props) {
|
|
|
73183
73556
|
var _useContext = react.useContext(ConfigurationContext),
|
|
73184
73557
|
currencyCode = _useContext.currencyCode;
|
|
73185
73558
|
|
|
73186
|
-
var _useContext2 = react.useContext(
|
|
73187
|
-
|
|
73188
|
-
|
|
73559
|
+
var _useContext2 = react.useContext(PaymentContext),
|
|
73560
|
+
payment = _useContext2.payment,
|
|
73561
|
+
paymentState = _useContext2.paymentState;
|
|
73189
73562
|
|
|
73190
|
-
var _useContext3 = react.useContext(
|
|
73191
|
-
|
|
73192
|
-
|
|
73193
|
-
pay = _useContext3.pay,
|
|
73194
|
-
transaction = _useContext3.transaction,
|
|
73195
|
-
approve = _useContext3.approve,
|
|
73196
|
-
approvalTransaction = _useContext3.approvalTransaction;
|
|
73563
|
+
var _useContext3 = react.useContext(ChangableAmountContext),
|
|
73564
|
+
amount = _useContext3.amount,
|
|
73565
|
+
amountsMissing = _useContext3.amountsMissing;
|
|
73197
73566
|
|
|
73198
73567
|
var _useContext4 = react.useContext(PaymentValueContext),
|
|
73199
73568
|
paymentValue = _useContext4.paymentValue;
|
|
@@ -73201,78 +73570,15 @@ var PaymentOverviewDialog = (function (props) {
|
|
|
73201
73570
|
var _useContext5 = react.useContext(NavigateStackContext_1),
|
|
73202
73571
|
navigate = _useContext5.navigate;
|
|
73203
73572
|
|
|
73204
|
-
var _useContext6 = react.useContext(ClosableContext),
|
|
73205
|
-
close = _useContext6.close;
|
|
73206
|
-
|
|
73207
|
-
var mainAction = function mainAction() {
|
|
73208
|
-
if (paymentState == 'initialized' || paymentState == 'approving') {
|
|
73209
|
-
return /*#__PURE__*/react.createElement("button", {
|
|
73210
|
-
className: ["ButtonPrimary", payment.route.approvalRequired && !payment.route.directTransfer ? 'disabled' : ''].join(' '),
|
|
73211
|
-
onClick: function onClick() {
|
|
73212
|
-
if (payment.route.approvalRequired && !payment.route.directTransfer) {
|
|
73213
|
-
return;
|
|
73214
|
-
}
|
|
73215
|
-
|
|
73216
|
-
pay({
|
|
73217
|
-
navigate: navigate
|
|
73218
|
-
});
|
|
73219
|
-
}
|
|
73220
|
-
}, "Pay ", amount ? new Currency({
|
|
73221
|
-
amount: amount.toFixed(2),
|
|
73222
|
-
code: currencyCode
|
|
73223
|
-
}).toString() : paymentValue.toString().length ? paymentValue.toString() : "".concat(payment.amount));
|
|
73224
|
-
} else if (paymentState == 'paying') {
|
|
73225
|
-
return /*#__PURE__*/react.createElement("a", {
|
|
73226
|
-
className: "ButtonPrimary",
|
|
73227
|
-
title: "Performing the payment - please wait",
|
|
73228
|
-
href: transaction === null || transaction === void 0 ? void 0 : transaction.url,
|
|
73229
|
-
target: "_blank",
|
|
73230
|
-
rel: "noopener noreferrer"
|
|
73231
|
-
}, /*#__PURE__*/react.createElement(LoadingText, null, "Paying"));
|
|
73232
|
-
} else if (paymentState == 'confirmed') {
|
|
73233
|
-
return /*#__PURE__*/react.createElement("button", {
|
|
73234
|
-
className: "ButtonPrimary round",
|
|
73235
|
-
title: "Done",
|
|
73236
|
-
onClick: close
|
|
73237
|
-
}, /*#__PURE__*/react.createElement(Checkmark, null));
|
|
73238
|
-
}
|
|
73239
|
-
};
|
|
73240
|
-
|
|
73241
|
-
var approvalAction = function approvalAction() {
|
|
73242
|
-
if (paymentState == 'initialized') {
|
|
73243
|
-
return /*#__PURE__*/react.createElement("div", {
|
|
73244
|
-
className: "PaddingBottomS"
|
|
73245
|
-
}, /*#__PURE__*/react.createElement("button", {
|
|
73246
|
-
className: "ButtonPrimary wide",
|
|
73247
|
-
onClick: approve,
|
|
73248
|
-
title: "Allow ".concat(payment.symbol, " to be used as payment")
|
|
73249
|
-
}, "Allow ", payment.symbol, " to be used as payment"));
|
|
73250
|
-
} else if (paymentState == 'approving') {
|
|
73251
|
-
return /*#__PURE__*/react.createElement("div", {
|
|
73252
|
-
className: "PaddingBottomS"
|
|
73253
|
-
}, /*#__PURE__*/react.createElement("a", {
|
|
73254
|
-
className: "ButtonPrimary wide",
|
|
73255
|
-
title: "Approving payment token - please wait",
|
|
73256
|
-
href: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
|
|
73257
|
-
target: "_blank",
|
|
73258
|
-
rel: "noopener noreferrer"
|
|
73259
|
-
}, /*#__PURE__*/react.createElement(LoadingText, null, "Approving")));
|
|
73260
|
-
}
|
|
73261
|
-
};
|
|
73262
|
-
|
|
73263
|
-
var actions = function actions() {
|
|
73264
|
-
return /*#__PURE__*/react.createElement("div", null, payment.route.approvalRequired && !payment.route.directTransfer && approvalAction(), mainAction());
|
|
73265
|
-
};
|
|
73266
|
-
|
|
73267
73573
|
if (payment == undefined || paymentValue == undefined) {
|
|
73268
73574
|
return /*#__PURE__*/react.createElement(PaymentOverviewSkeleton, null);
|
|
73269
73575
|
}
|
|
73270
73576
|
|
|
73271
73577
|
return /*#__PURE__*/react.createElement(Dialog, {
|
|
73272
73578
|
header: /*#__PURE__*/react.createElement("div", {
|
|
73273
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
73579
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
73274
73580
|
}, /*#__PURE__*/react.createElement("h1", {
|
|
73275
|
-
className: "LineHeightL FontSizeL
|
|
73581
|
+
className: "LineHeightL FontSizeL"
|
|
73276
73582
|
}, "Payment")),
|
|
73277
73583
|
body: /*#__PURE__*/react.createElement("div", {
|
|
73278
73584
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -73335,8 +73641,8 @@ var PaymentOverviewDialog = (function (props) {
|
|
|
73335
73641
|
className: "CardAction"
|
|
73336
73642
|
}, /*#__PURE__*/react.createElement(ChevronRight, null)))),
|
|
73337
73643
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
73338
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
73339
|
-
},
|
|
73644
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
73645
|
+
}, /*#__PURE__*/react.createElement(Footer, null))
|
|
73340
73646
|
});
|
|
73341
73647
|
});
|
|
73342
73648
|
|
|
@@ -73402,12 +73708,12 @@ var preflight$1 = /*#__PURE__*/function () {
|
|
|
73402
73708
|
|
|
73403
73709
|
var Payment = /*#__PURE__*/function () {
|
|
73404
73710
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(_ref3) {
|
|
73405
|
-
var accept, amount, event, sent, confirmed,
|
|
73711
|
+
var accept, amount, event, sent, confirmed, failed, error, critical, style, whitelist, blacklist, providers, currency, connected, closed, track, document, unmount;
|
|
73406
73712
|
return regenerator.wrap(function _callee2$(_context2) {
|
|
73407
73713
|
while (1) {
|
|
73408
73714
|
switch (_context2.prev = _context2.next) {
|
|
73409
73715
|
case 0:
|
|
73410
|
-
accept = _ref3.accept, amount = _ref3.amount, event = _ref3.event, sent = _ref3.sent, confirmed = _ref3.confirmed,
|
|
73716
|
+
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;
|
|
73411
73717
|
_context2.prev = 1;
|
|
73412
73718
|
_context2.next = 4;
|
|
73413
73719
|
return preflight$1({
|
|
@@ -73433,15 +73739,15 @@ var Payment = /*#__PURE__*/function () {
|
|
|
73433
73739
|
event: event,
|
|
73434
73740
|
sent: sent,
|
|
73435
73741
|
confirmed: confirmed,
|
|
73436
|
-
ensured: ensured,
|
|
73437
73742
|
failed: failed,
|
|
73438
73743
|
whitelist: whitelist,
|
|
73439
73744
|
blacklist: blacklist,
|
|
73440
|
-
providers: providers
|
|
73745
|
+
providers: providers,
|
|
73746
|
+
track: track
|
|
73441
73747
|
}
|
|
73442
|
-
}, /*#__PURE__*/react.createElement(ClosableProvider, {
|
|
73748
|
+
}, /*#__PURE__*/react.createElement(UpdatableProvider, null, /*#__PURE__*/react.createElement(ClosableProvider, {
|
|
73443
73749
|
unmount: unmount
|
|
73444
|
-
}, /*#__PURE__*/react.createElement(
|
|
73750
|
+
}, /*#__PURE__*/react.createElement(WalletProvider, {
|
|
73445
73751
|
document: document,
|
|
73446
73752
|
container: container,
|
|
73447
73753
|
connected: connected,
|
|
@@ -73453,13 +73759,15 @@ var Payment = /*#__PURE__*/function () {
|
|
|
73453
73759
|
whitelist: whitelist,
|
|
73454
73760
|
blacklist: blacklist,
|
|
73455
73761
|
event: event
|
|
73762
|
+
}, /*#__PURE__*/react.createElement(TrackingProvider, {
|
|
73763
|
+
document: ensureDocument(document)
|
|
73456
73764
|
}, /*#__PURE__*/react.createElement(PaymentProvider, {
|
|
73457
73765
|
container: container,
|
|
73458
73766
|
document: document
|
|
73459
73767
|
}, /*#__PURE__*/react.createElement(PaymentValueProvider, null, /*#__PURE__*/react.createElement(PaymentStack, {
|
|
73460
73768
|
document: document,
|
|
73461
73769
|
container: container
|
|
73462
|
-
})))))))))));
|
|
73770
|
+
}), /*#__PURE__*/react.createElement(PoweredBy, null))))))))))));
|
|
73463
73771
|
};
|
|
73464
73772
|
});
|
|
73465
73773
|
return _context2.abrupt("return", {
|
|
@@ -73569,9 +73877,9 @@ var SaleRoutingProvider = (function (props) {
|
|
|
73569
73877
|
var SaleOverviewSkeleton = (function (props) {
|
|
73570
73878
|
return /*#__PURE__*/react.createElement(Dialog, {
|
|
73571
73879
|
header: /*#__PURE__*/react.createElement("div", {
|
|
73572
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
73880
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
73573
73881
|
}, /*#__PURE__*/react.createElement("h1", {
|
|
73574
|
-
className: "LineHeightL FontSizeL
|
|
73882
|
+
className: "LineHeightL FontSizeL"
|
|
73575
73883
|
}, "Purchase")),
|
|
73576
73884
|
body: /*#__PURE__*/react.createElement("div", {
|
|
73577
73885
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -73588,7 +73896,7 @@ var SaleOverviewSkeleton = (function (props) {
|
|
|
73588
73896
|
className: "SkeletonBackground"
|
|
73589
73897
|
}))),
|
|
73590
73898
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
73591
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
73899
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
73592
73900
|
}, /*#__PURE__*/react.createElement("div", {
|
|
73593
73901
|
className: "SkeletonWrapper"
|
|
73594
73902
|
}, /*#__PURE__*/react.createElement("div", {
|
|
@@ -73600,11 +73908,10 @@ var SaleOverviewSkeleton = (function (props) {
|
|
|
73600
73908
|
});
|
|
73601
73909
|
|
|
73602
73910
|
var SaleOverviewDialog = (function (props) {
|
|
73603
|
-
var _useContext = react.useContext(ChangableAmountContext)
|
|
73604
|
-
|
|
73911
|
+
var _useContext = react.useContext(ChangableAmountContext);
|
|
73912
|
+
_useContext.amount;
|
|
73605
73913
|
|
|
73606
73914
|
var _useContext2 = react.useContext(ConfigurationContext),
|
|
73607
|
-
currencyCode = _useContext2.currencyCode,
|
|
73608
73915
|
tokenImage = _useContext2.tokenImage;
|
|
73609
73916
|
|
|
73610
73917
|
var _useContext3 = react.useContext(PaymentValueContext),
|
|
@@ -73612,87 +73919,20 @@ var SaleOverviewDialog = (function (props) {
|
|
|
73612
73919
|
|
|
73613
73920
|
var _useContext4 = react.useContext(PaymentContext),
|
|
73614
73921
|
payment = _useContext4.payment,
|
|
73615
|
-
paymentState = _useContext4.paymentState
|
|
73616
|
-
pay = _useContext4.pay,
|
|
73617
|
-
transaction = _useContext4.transaction,
|
|
73618
|
-
approve = _useContext4.approve,
|
|
73619
|
-
approvalTransaction = _useContext4.approvalTransaction;
|
|
73922
|
+
paymentState = _useContext4.paymentState;
|
|
73620
73923
|
|
|
73621
73924
|
var _useContext5 = react.useContext(NavigateStackContext_1),
|
|
73622
73925
|
navigate = _useContext5.navigate;
|
|
73623
73926
|
|
|
73624
|
-
var _useContext6 = react.useContext(
|
|
73625
|
-
|
|
73626
|
-
|
|
73627
|
-
var _useContext7 = react.useContext(ToTokenContext),
|
|
73628
|
-
toToken = _useContext7.toToken,
|
|
73629
|
-
toTokenReadableAmount = _useContext7.toTokenReadableAmount;
|
|
73927
|
+
var _useContext6 = react.useContext(ToTokenContext),
|
|
73928
|
+
toToken = _useContext6.toToken,
|
|
73929
|
+
toTokenReadableAmount = _useContext6.toTokenReadableAmount;
|
|
73630
73930
|
|
|
73631
73931
|
var _useState = react.useState(),
|
|
73632
73932
|
_useState2 = _slicedToArray(_useState, 2),
|
|
73633
73933
|
salePerTokenValue = _useState2[0],
|
|
73634
73934
|
setSalePerTokenValue = _useState2[1];
|
|
73635
73935
|
|
|
73636
|
-
var mainAction = function mainAction() {
|
|
73637
|
-
if (paymentState == 'initialized' || paymentState == 'approving') {
|
|
73638
|
-
return /*#__PURE__*/react.createElement("button", {
|
|
73639
|
-
className: ["ButtonPrimary", payment.route.approvalRequired && !payment.route.directTransfer ? 'disabled' : ''].join(' '),
|
|
73640
|
-
onClick: function onClick() {
|
|
73641
|
-
if (payment.route.approvalRequired && !payment.route.directTransfer) {
|
|
73642
|
-
return;
|
|
73643
|
-
}
|
|
73644
|
-
|
|
73645
|
-
pay({
|
|
73646
|
-
navigate: navigate
|
|
73647
|
-
});
|
|
73648
|
-
}
|
|
73649
|
-
}, "Pay ", new Currency({
|
|
73650
|
-
amount: amount.toFixed(2),
|
|
73651
|
-
code: currencyCode
|
|
73652
|
-
}).toString());
|
|
73653
|
-
} else if (paymentState == 'paying') {
|
|
73654
|
-
return /*#__PURE__*/react.createElement("a", {
|
|
73655
|
-
className: "ButtonPrimary",
|
|
73656
|
-
title: "Performing the payment - please wait",
|
|
73657
|
-
href: transaction === null || transaction === void 0 ? void 0 : transaction.url,
|
|
73658
|
-
target: "_blank",
|
|
73659
|
-
rel: "noopener noreferrer"
|
|
73660
|
-
}, /*#__PURE__*/react.createElement(LoadingText, null, "Paying"));
|
|
73661
|
-
} else if (paymentState == 'confirmed') {
|
|
73662
|
-
return /*#__PURE__*/react.createElement("button", {
|
|
73663
|
-
className: "ButtonPrimary round",
|
|
73664
|
-
title: "Done",
|
|
73665
|
-
onClick: close
|
|
73666
|
-
}, /*#__PURE__*/react.createElement(Checkmark, null));
|
|
73667
|
-
}
|
|
73668
|
-
};
|
|
73669
|
-
|
|
73670
|
-
var approvalAction = function approvalAction() {
|
|
73671
|
-
if (paymentState == 'initialized') {
|
|
73672
|
-
return /*#__PURE__*/react.createElement("div", {
|
|
73673
|
-
className: "PaddingBottomS"
|
|
73674
|
-
}, /*#__PURE__*/react.createElement("button", {
|
|
73675
|
-
className: "ButtonPrimary wide",
|
|
73676
|
-
onClick: approve,
|
|
73677
|
-
title: "Allow ".concat(payment.symbol, " to be used as payment")
|
|
73678
|
-
}, "Allow ", payment.symbol, " to be used as payment"));
|
|
73679
|
-
} else if (paymentState == 'approving') {
|
|
73680
|
-
return /*#__PURE__*/react.createElement("div", {
|
|
73681
|
-
className: "PaddingBottomS"
|
|
73682
|
-
}, /*#__PURE__*/react.createElement("a", {
|
|
73683
|
-
className: "ButtonPrimary wide",
|
|
73684
|
-
title: "Approving payment token - please wait",
|
|
73685
|
-
href: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
|
|
73686
|
-
target: "_blank",
|
|
73687
|
-
rel: "noopener noreferrer"
|
|
73688
|
-
}, /*#__PURE__*/react.createElement(LoadingText, null, "Approving")));
|
|
73689
|
-
}
|
|
73690
|
-
};
|
|
73691
|
-
|
|
73692
|
-
var actions = function actions() {
|
|
73693
|
-
return /*#__PURE__*/react.createElement("div", null, payment.route.approvalRequired && !payment.route.directTransfer && approvalAction(), mainAction());
|
|
73694
|
-
};
|
|
73695
|
-
|
|
73696
73936
|
react.useEffect(function () {
|
|
73697
73937
|
if (paymentValue) {
|
|
73698
73938
|
setSalePerTokenValue(new Currency({
|
|
@@ -73721,9 +73961,9 @@ var SaleOverviewDialog = (function (props) {
|
|
|
73721
73961
|
|
|
73722
73962
|
return /*#__PURE__*/react.createElement(Dialog, {
|
|
73723
73963
|
header: /*#__PURE__*/react.createElement("div", {
|
|
73724
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
73964
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
73725
73965
|
}, /*#__PURE__*/react.createElement("h1", {
|
|
73726
|
-
className: "LineHeightL FontSizeL
|
|
73966
|
+
className: "LineHeightL FontSizeL"
|
|
73727
73967
|
}, "Purchase")),
|
|
73728
73968
|
body: /*#__PURE__*/react.createElement("div", {
|
|
73729
73969
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -73792,8 +74032,8 @@ var SaleOverviewDialog = (function (props) {
|
|
|
73792
74032
|
className: "CardAction"
|
|
73793
74033
|
}, /*#__PURE__*/react.createElement(ChevronRight, null)))),
|
|
73794
74034
|
footer: /*#__PURE__*/react.createElement("div", {
|
|
73795
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
73796
|
-
},
|
|
74035
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
74036
|
+
}, /*#__PURE__*/react.createElement(Footer, null))
|
|
73797
74037
|
});
|
|
73798
74038
|
});
|
|
73799
74039
|
|
|
@@ -73866,12 +74106,12 @@ var preflight = /*#__PURE__*/function () {
|
|
|
73866
74106
|
|
|
73867
74107
|
var Sale = /*#__PURE__*/function () {
|
|
73868
74108
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(_ref3) {
|
|
73869
|
-
var amount, sell, sent, confirmed,
|
|
74109
|
+
var amount, sell, sent, confirmed, failed, error, critical, style, blacklist, providers, currency, connected, closed, tokenImage, document, accept, unmount;
|
|
73870
74110
|
return regenerator.wrap(function _callee2$(_context2) {
|
|
73871
74111
|
while (1) {
|
|
73872
74112
|
switch (_context2.prev = _context2.next) {
|
|
73873
74113
|
case 0:
|
|
73874
|
-
amount = _ref3.amount, sell = _ref3.sell, sent = _ref3.sent, confirmed = _ref3.confirmed,
|
|
74114
|
+
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;
|
|
73875
74115
|
_context2.prev = 1;
|
|
73876
74116
|
_context2.next = 4;
|
|
73877
74117
|
return preflight({
|
|
@@ -73903,26 +74143,27 @@ var Sale = /*#__PURE__*/function () {
|
|
|
73903
74143
|
currency: currency,
|
|
73904
74144
|
sent: sent,
|
|
73905
74145
|
confirmed: confirmed,
|
|
73906
|
-
ensured: ensured,
|
|
73907
74146
|
failed: failed,
|
|
73908
74147
|
blacklist: blacklist,
|
|
73909
74148
|
providers: providers
|
|
73910
74149
|
}
|
|
73911
|
-
}, /*#__PURE__*/react.createElement(ClosableProvider, {
|
|
74150
|
+
}, /*#__PURE__*/react.createElement(UpdatableProvider, null, /*#__PURE__*/react.createElement(ClosableProvider, {
|
|
73912
74151
|
unmount: unmount
|
|
73913
|
-
}, /*#__PURE__*/react.createElement(
|
|
74152
|
+
}, /*#__PURE__*/react.createElement(WalletProvider, {
|
|
73914
74153
|
container: container,
|
|
73915
74154
|
connected: connected,
|
|
73916
74155
|
unmount: unmount
|
|
73917
74156
|
}, /*#__PURE__*/react.createElement(ConversionRateProvider, null, /*#__PURE__*/react.createElement(ChangableAmountProvider, {
|
|
73918
74157
|
accept: accept
|
|
74158
|
+
}, /*#__PURE__*/react.createElement(TrackingProvider, {
|
|
74159
|
+
document: ensureDocument(document)
|
|
73919
74160
|
}, /*#__PURE__*/react.createElement(SaleRoutingProvider, {
|
|
73920
74161
|
container: container,
|
|
73921
74162
|
document: document
|
|
73922
74163
|
}, /*#__PURE__*/react.createElement(SaleStack, {
|
|
73923
74164
|
document: document,
|
|
73924
74165
|
container: container
|
|
73925
|
-
})))))))));
|
|
74166
|
+
}), /*#__PURE__*/react.createElement(PoweredBy, null))))))))));
|
|
73926
74167
|
};
|
|
73927
74168
|
});
|
|
73928
74169
|
return _context2.abrupt("return", {
|