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