@depay/widgets 4.2.2 → 5.0.0
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 +51 -52
- package/dist/cjs/index.bundle.js +6988 -2969
- package/dist/cjs/index.js +670 -436
- package/dist/es/index.bundle.js +6988 -2969
- package/dist/es/index.js +625 -391
- package/dist/umd/index.bundle.js +6988 -2969
- package/dist/umd/index.js +662 -428
- package/package.json +15 -14
package/dist/es/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import React, { useState, useContext, useEffect } from 'react';
|
|
2
|
-
import { NavigateStackContext, ReactDialogStack } from 'depay
|
|
3
|
-
import { getWallet, wallets } from 'depay
|
|
2
|
+
import { NavigateStackContext, ReactDialogStack } from '@depay/react-dialog-stack';
|
|
3
|
+
import { getWallet, wallets } from '@depay/web3-wallets';
|
|
4
4
|
import ReactDOM from 'react-dom';
|
|
5
|
-
import { ReactShadowDOM } from 'depay
|
|
5
|
+
import { ReactShadowDOM } from '@depay/react-shadow-dom';
|
|
6
6
|
import { ethers } from 'ethers';
|
|
7
|
-
import { CONSTANTS } from 'depay
|
|
7
|
+
import { CONSTANTS } from '@depay/web3-constants';
|
|
8
8
|
import { Decimal } from 'decimal.js';
|
|
9
|
-
import { route } from 'depay
|
|
10
|
-
import { Token } from 'depay
|
|
11
|
-
import { Currency } from 'depay
|
|
12
|
-
import {
|
|
13
|
-
import { route as route$1 } from 'depay
|
|
9
|
+
import { route } from '@depay/web3-exchanges';
|
|
10
|
+
import { Token } from '@depay/web3-tokens';
|
|
11
|
+
import { Currency } from '@depay/local-currency';
|
|
12
|
+
import { setProviderEndpoints, request, provider } from '@depay/web3-client';
|
|
13
|
+
import { route as route$1 } from '@depay/web3-payments';
|
|
14
14
|
import Slider from 'react-rangeslider';
|
|
15
|
-
import { TokenImage } from 'depay
|
|
16
|
-
import { Blockchain } from 'depay
|
|
15
|
+
import { TokenImage } from '@depay/react-token-image';
|
|
16
|
+
import { Blockchain } from '@depay/web3-blockchains';
|
|
17
17
|
|
|
18
18
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
19
19
|
try {
|
|
@@ -893,6 +893,8 @@ function _slicedToArray(arr, i) {
|
|
|
893
893
|
|
|
894
894
|
var ClosableContext = /*#__PURE__*/React.createContext();
|
|
895
895
|
|
|
896
|
+
var UpdatableContext = /*#__PURE__*/React.createContext();
|
|
897
|
+
|
|
896
898
|
var ClosableProvider = (function (props) {
|
|
897
899
|
var _useState = useState(true),
|
|
898
900
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -904,11 +906,15 @@ var ClosableProvider = (function (props) {
|
|
|
904
906
|
open = _useState4[0],
|
|
905
907
|
setOpen = _useState4[1];
|
|
906
908
|
|
|
909
|
+
var _useContext = useContext(UpdatableContext),
|
|
910
|
+
setUpdatable = _useContext.setUpdatable;
|
|
911
|
+
|
|
907
912
|
var close = function close() {
|
|
908
913
|
if (!closable) {
|
|
909
914
|
return;
|
|
910
915
|
}
|
|
911
916
|
|
|
917
|
+
setUpdatable(false);
|
|
912
918
|
setOpen(false);
|
|
913
919
|
setTimeout(props.unmount, 300);
|
|
914
920
|
};
|
|
@@ -992,12 +998,7 @@ var Dialog$1 = (function (props) {
|
|
|
992
998
|
className: "DialogBody"
|
|
993
999
|
}, props.body), /*#__PURE__*/React.createElement("div", {
|
|
994
1000
|
className: "DialogFooter"
|
|
995
|
-
}, props.footer
|
|
996
|
-
href: 'https://depay.fi?utm_source=' + window.location.hostname + '&utm_medium=widget&utm_campaign=WidgetV2',
|
|
997
|
-
rel: "noopener noreferrer",
|
|
998
|
-
target: "_blank",
|
|
999
|
-
className: "FooterLink"
|
|
1000
|
-
}, "by DePay")));
|
|
1001
|
+
}, props.footer));
|
|
1001
1002
|
});
|
|
1002
1003
|
|
|
1003
1004
|
var ConnectingWalletDialog = (function (props) {
|
|
@@ -1047,9 +1048,9 @@ var ConnectingWalletDialog = (function (props) {
|
|
|
1047
1048
|
className: "TextButton"
|
|
1048
1049
|
}, "Connect with another wallet")))),
|
|
1049
1050
|
footer: /*#__PURE__*/React.createElement("div", {
|
|
1050
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
1051
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
1051
1052
|
}, /*#__PURE__*/React.createElement("button", {
|
|
1052
|
-
className: "ButtonPrimary
|
|
1053
|
+
className: "ButtonPrimary",
|
|
1053
1054
|
onClick: function onClick() {
|
|
1054
1055
|
return props.connect(wallet);
|
|
1055
1056
|
}
|
|
@@ -1132,7 +1133,7 @@ var SelectWalletDialog = (function (props) {
|
|
|
1132
1133
|
return connect(wallet);
|
|
1133
1134
|
}
|
|
1134
1135
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1135
|
-
className: "CardImage
|
|
1136
|
+
className: "CardImage"
|
|
1136
1137
|
}, /*#__PURE__*/React.createElement("img", {
|
|
1137
1138
|
src: wallet.logo
|
|
1138
1139
|
})), /*#__PURE__*/React.createElement("div", {
|
|
@@ -1145,9 +1146,9 @@ var SelectWalletDialog = (function (props) {
|
|
|
1145
1146
|
});
|
|
1146
1147
|
return /*#__PURE__*/React.createElement(Dialog$1, {
|
|
1147
1148
|
header: /*#__PURE__*/React.createElement("div", {
|
|
1148
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
1149
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
1149
1150
|
}, /*#__PURE__*/React.createElement("h1", {
|
|
1150
|
-
className: "LineHeightL FontSizeL
|
|
1151
|
+
className: "LineHeightL FontSizeL"
|
|
1151
1152
|
}, "Select a wallet")),
|
|
1152
1153
|
body: /*#__PURE__*/React.createElement("div", {
|
|
1153
1154
|
className: "PaddingTopS PaddingBottomXS PaddingLeftS PaddingRightS"
|
|
@@ -1155,11 +1156,13 @@ var SelectWalletDialog = (function (props) {
|
|
|
1155
1156
|
footer: /*#__PURE__*/React.createElement("div", {
|
|
1156
1157
|
className: "PaddingBottomS"
|
|
1157
1158
|
}, /*#__PURE__*/React.createElement("button", {
|
|
1158
|
-
className: "FontSizeS FontWeightBold
|
|
1159
|
+
className: "FontSizeS FontWeightBold TextButton",
|
|
1159
1160
|
onClick: function onClick() {
|
|
1160
1161
|
return setShowExplanation(!showExplanation);
|
|
1161
1162
|
}
|
|
1162
|
-
}, /*#__PURE__*/React.createElement("strong",
|
|
1163
|
+
}, /*#__PURE__*/React.createElement("strong", {
|
|
1164
|
+
className: "Opacity05"
|
|
1165
|
+
}, "What is a wallet?")), showExplanation && /*#__PURE__*/React.createElement("p", {
|
|
1163
1166
|
className: "PaddingLeftM PaddingRightM"
|
|
1164
1167
|
}, "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."))
|
|
1165
1168
|
});
|
|
@@ -1377,8 +1380,7 @@ function ReactDialogStyle (styles) {
|
|
|
1377
1380
|
let background =
|
|
1378
1381
|
typeof styles === 'object' && styles.background ? styles.background : 'rgba(0,0,0,0.4)';
|
|
1379
1382
|
|
|
1380
|
-
return
|
|
1381
|
-
`
|
|
1383
|
+
return `
|
|
1382
1384
|
.ReactDialog {
|
|
1383
1385
|
bottom: 0;
|
|
1384
1386
|
display: table;
|
|
@@ -1437,12 +1439,9 @@ function ReactDialogStyle (styles) {
|
|
|
1437
1439
|
top: -5vh;
|
|
1438
1440
|
}
|
|
1439
1441
|
`
|
|
1440
|
-
)
|
|
1441
1442
|
}
|
|
1442
1443
|
|
|
1443
|
-
const _jsxFileName = "/
|
|
1444
|
-
|
|
1445
|
-
|
|
1444
|
+
const _jsxFileName = "/home/runner/work/react-dialog/react-dialog/src/components/Dialog.jsx";
|
|
1446
1445
|
class Dialog extends React__default['default'].Component {
|
|
1447
1446
|
constructor(props) {
|
|
1448
1447
|
super(props);
|
|
@@ -1504,7 +1503,7 @@ class Dialog extends React__default['default'].Component {
|
|
|
1504
1503
|
}
|
|
1505
1504
|
}
|
|
1506
1505
|
|
|
1507
|
-
const _jsxFileName$1 = "/
|
|
1506
|
+
const _jsxFileName$1 = "/home/runner/work/react-dialog/react-dialog/src/index.jsx";
|
|
1508
1507
|
class ReactDialog extends React__default['default'].Component {
|
|
1509
1508
|
constructor(props) {
|
|
1510
1509
|
super(props);
|
|
@@ -1617,7 +1616,7 @@ var ErrorProvider = (function (props) {
|
|
|
1617
1616
|
})), /*#__PURE__*/React.createElement("div", {
|
|
1618
1617
|
className: "DialogBody"
|
|
1619
1618
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1620
|
-
className: "GraphicWrapper"
|
|
1619
|
+
className: "GraphicWrapper PaddingTopS"
|
|
1621
1620
|
}, /*#__PURE__*/React.createElement("img", {
|
|
1622
1621
|
className: "Graphic",
|
|
1623
1622
|
src: ErrorGraphic
|
|
@@ -1635,15 +1634,12 @@ var ErrorProvider = (function (props) {
|
|
|
1635
1634
|
className: "FontSizeM PaddingTopS"
|
|
1636
1635
|
}, "If this keeps happening, please report it.")))), /*#__PURE__*/React.createElement("div", {
|
|
1637
1636
|
className: "DialogFooter"
|
|
1638
|
-
}, /*#__PURE__*/React.createElement("div",
|
|
1637
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
1638
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
1639
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
1639
1640
|
className: "ButtonPrimary",
|
|
1640
1641
|
onClick: close
|
|
1641
|
-
}, "Try again"))
|
|
1642
|
-
href: 'https://depay.fi?utm_source=' + window.location.hostname + '&utm_medium=widget&utm_campaign=WidgetV2',
|
|
1643
|
-
rel: "noopener noreferrer",
|
|
1644
|
-
target: "_blank",
|
|
1645
|
-
className: "FooterLink"
|
|
1646
|
-
}, "by DePay"))));
|
|
1642
|
+
}, "Try again")))));
|
|
1647
1643
|
} else {
|
|
1648
1644
|
return /*#__PURE__*/React.createElement(ErrorContext.Provider, {
|
|
1649
1645
|
value: {
|
|
@@ -1655,28 +1651,28 @@ var ErrorProvider = (function (props) {
|
|
|
1655
1651
|
}
|
|
1656
1652
|
});
|
|
1657
1653
|
|
|
1654
|
+
var BlockchainLogoStyle = (function (style) {
|
|
1655
|
+
return "\n\n .BlockchainLogo {\n border-radius: 999px;\n }\n\n .BlockchainLogo.small {\n height: 18px;\n width: 18px;\n }\n ";
|
|
1656
|
+
});
|
|
1657
|
+
|
|
1658
1658
|
var ButtonCircularStyle = (function () {
|
|
1659
1659
|
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 ";
|
|
1660
1660
|
});
|
|
1661
1661
|
|
|
1662
1662
|
var ButtonPrimaryStyle = (function (style) {
|
|
1663
|
-
return "\n\n .ButtonPrimary {\n align-items: center;\n align-self: center;\n background: ".concat(style.colors.primary, ";\n border-radius:
|
|
1663
|
+
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 ");
|
|
1664
1664
|
});
|
|
1665
1665
|
|
|
1666
1666
|
var CardStyle = (function (style) {
|
|
1667
|
-
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.
|
|
1667
|
+
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 ");
|
|
1668
1668
|
});
|
|
1669
1669
|
|
|
1670
1670
|
var DialogStyle = (function (style) {
|
|
1671
|
-
return "\n\n .ReactDialogBackground {\n background: rgba(0,0,0,0.7);\n }\n\n .Dialog {\n margin: 0 auto;\n position: relative;\n width: 420px;\n box-shadow: 0 0 20px rgba(0,0,0,0.1);\n border-radius: 0.8rem;\n }\n\n @media screen and (max-width: 450px) {\n \n .Dialog, .ReactDialogAnimation {\n width: 100%;\n }\n\n }\n\n @media (orientation: portrait) and (max-width: 900px) {\n\n .Dialog {\n align-content: stretch;\n display: flex;\n flex-direction: column;\n height: 100%;\n }\n\n .DialogBody {\n flex: 1;\n align-items: flex-end;\n max-height: 40vh !important;\n }\n\n .
|
|
1671
|
+
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 ";
|
|
1672
1672
|
});
|
|
1673
1673
|
|
|
1674
1674
|
var FontStyle = (function (style) {
|
|
1675
|
-
return "\n\n
|
|
1676
|
-
});
|
|
1677
|
-
|
|
1678
|
-
var FooterStyle = (function (style) {
|
|
1679
|
-
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 ");
|
|
1675
|
+
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 ");
|
|
1680
1676
|
});
|
|
1681
1677
|
|
|
1682
1678
|
var GraphicStyle = (function () {
|
|
@@ -1688,7 +1684,7 @@ var HeightStyle = (function () {
|
|
|
1688
1684
|
});
|
|
1689
1685
|
|
|
1690
1686
|
var IconStyle = (function (style) {
|
|
1691
|
-
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:
|
|
1687
|
+
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 ");
|
|
1692
1688
|
});
|
|
1693
1689
|
|
|
1694
1690
|
var ImageStyle = (function (style) {
|
|
@@ -1707,10 +1703,18 @@ var LoadingTextStyle = (function (style) {
|
|
|
1707
1703
|
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 ");
|
|
1708
1704
|
});
|
|
1709
1705
|
|
|
1706
|
+
var OpacityStyle = (function (style) {
|
|
1707
|
+
return "\n\n .Opacity05 {\n opacity: 0.5;\n }\n ";
|
|
1708
|
+
});
|
|
1709
|
+
|
|
1710
1710
|
var PaddingStyle = (function () {
|
|
1711
1711
|
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 ";
|
|
1712
1712
|
});
|
|
1713
1713
|
|
|
1714
|
+
var PoweredByStyle = (function (style) {
|
|
1715
|
+
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 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 ");
|
|
1716
|
+
});
|
|
1717
|
+
|
|
1714
1718
|
var RangeSliderStyle = (function (style) {
|
|
1715
1719
|
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 ";
|
|
1716
1720
|
});
|
|
@@ -1720,15 +1724,15 @@ var ResetStyle = (function () {
|
|
|
1720
1724
|
});
|
|
1721
1725
|
|
|
1722
1726
|
var SkeletonStyle = (function () {
|
|
1723
|
-
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 ";
|
|
1727
|
+
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 ";
|
|
1724
1728
|
});
|
|
1725
1729
|
|
|
1726
1730
|
var TextButtonStyle = (function (style) {
|
|
1727
|
-
return "\n\n .TextButton {\n cursor: pointer;\n font-size: 16px;\n color: ".concat(style.colors.primary, "\n }\n\n .TextButton
|
|
1731
|
+
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 ");
|
|
1728
1732
|
});
|
|
1729
1733
|
|
|
1730
1734
|
var TextStyle = (function (style) {
|
|
1731
|
-
return "\n\n * {\n color: ".concat(style.colors.text, ";\n }\n\n
|
|
1735
|
+
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 ");
|
|
1732
1736
|
});
|
|
1733
1737
|
|
|
1734
1738
|
var TokenAmountStyle = (function () {
|
|
@@ -1745,7 +1749,7 @@ var styleRenderer = (function (style) {
|
|
|
1745
1749
|
},
|
|
1746
1750
|
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'
|
|
1747
1751
|
}, style);
|
|
1748
|
-
return [ResetStyle(), FontStyle(style), DialogStyle(), ButtonCircularStyle(), ButtonPrimaryStyle(style), CardStyle(style),
|
|
1752
|
+
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('');
|
|
1749
1753
|
});
|
|
1750
1754
|
|
|
1751
1755
|
var mount = (function (_ref, content) {
|
|
@@ -1781,6 +1785,31 @@ var mount = (function (_ref, content) {
|
|
|
1781
1785
|
return unmount;
|
|
1782
1786
|
});
|
|
1783
1787
|
|
|
1788
|
+
var PoweredBy = (function () {
|
|
1789
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
1790
|
+
className: "PoweredByWrapper"
|
|
1791
|
+
}, /*#__PURE__*/React.createElement("a", {
|
|
1792
|
+
href: 'https://depay.fi?utm_source=' + window.location.hostname + '&utm_medium=widget&utm_campaign=WidgetV2',
|
|
1793
|
+
rel: "noopener noreferrer",
|
|
1794
|
+
target: "_blank",
|
|
1795
|
+
className: "PoweredByLink"
|
|
1796
|
+
}, "by DePay"));
|
|
1797
|
+
});
|
|
1798
|
+
|
|
1799
|
+
var UpdatableProvider = (function (props) {
|
|
1800
|
+
var _useState = useState(true),
|
|
1801
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1802
|
+
updatable = _useState2[0],
|
|
1803
|
+
setUpdatable = _useState2[1];
|
|
1804
|
+
|
|
1805
|
+
return /*#__PURE__*/React.createElement(UpdatableContext.Provider, {
|
|
1806
|
+
value: {
|
|
1807
|
+
updatable: updatable,
|
|
1808
|
+
setUpdatable: setUpdatable
|
|
1809
|
+
}
|
|
1810
|
+
}, props.children);
|
|
1811
|
+
});
|
|
1812
|
+
|
|
1784
1813
|
var Connect = function Connect(options) {
|
|
1785
1814
|
var style, error, document;
|
|
1786
1815
|
|
|
@@ -1836,7 +1865,7 @@ var Connect = function Connect(options) {
|
|
|
1836
1865
|
error: error,
|
|
1837
1866
|
container: container,
|
|
1838
1867
|
unmount: unmount
|
|
1839
|
-
}, /*#__PURE__*/React.createElement(ClosableProvider, {
|
|
1868
|
+
}, /*#__PURE__*/React.createElement(UpdatableProvider, null, /*#__PURE__*/React.createElement(ClosableProvider, {
|
|
1840
1869
|
unmount: rejectBeforeUnmount
|
|
1841
1870
|
}, /*#__PURE__*/React.createElement(ConnectStack, {
|
|
1842
1871
|
document: document,
|
|
@@ -1844,7 +1873,7 @@ var Connect = function Connect(options) {
|
|
|
1844
1873
|
resolve: resolve,
|
|
1845
1874
|
reject: reject,
|
|
1846
1875
|
autoClose: true
|
|
1847
|
-
})));
|
|
1876
|
+
}), /*#__PURE__*/React.createElement(PoweredBy, null))));
|
|
1848
1877
|
};
|
|
1849
1878
|
});
|
|
1850
1879
|
|
|
@@ -2024,12 +2053,18 @@ var ChangableAmountProvider = (function (props) {
|
|
|
2024
2053
|
});
|
|
2025
2054
|
})).then(function (amounts) {
|
|
2026
2055
|
setAcceptWithAmount(props.accept.map(function (configuration, index) {
|
|
2056
|
+
if (amounts[index] == undefined) {
|
|
2057
|
+
return;
|
|
2058
|
+
}
|
|
2059
|
+
|
|
2027
2060
|
return {
|
|
2028
2061
|
blockchain: configuration.blockchain,
|
|
2029
|
-
amount: round(amounts[index])
|
|
2062
|
+
amount: round(amounts[index]),
|
|
2030
2063
|
token: configuration.token,
|
|
2031
2064
|
receiver: configuration.receiver || account
|
|
2032
2065
|
};
|
|
2066
|
+
}).filter(function (configuration) {
|
|
2067
|
+
return !!configuration;
|
|
2033
2068
|
}));
|
|
2034
2069
|
})["catch"](setError);
|
|
2035
2070
|
})["catch"](setError);
|
|
@@ -2086,7 +2121,7 @@ var ConfigurationProvider = (function (props) {
|
|
|
2086
2121
|
useEffect(function () {
|
|
2087
2122
|
if (props.configuration.providers != undefined) {
|
|
2088
2123
|
Object.entries(props.configuration.providers).forEach(function (entry) {
|
|
2089
|
-
|
|
2124
|
+
setProviderEndpoints(entry[0], entry[1]);
|
|
2090
2125
|
});
|
|
2091
2126
|
}
|
|
2092
2127
|
}, [props.configuration]);
|
|
@@ -2151,7 +2186,9 @@ var NoPaymentMethodFoundDialog = (function () {
|
|
|
2151
2186
|
}, /*#__PURE__*/React.createElement("strong", {
|
|
2152
2187
|
className: "FontSizeM"
|
|
2153
2188
|
}, "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."))),
|
|
2154
|
-
footer: /*#__PURE__*/React.createElement("div",
|
|
2189
|
+
footer: /*#__PURE__*/React.createElement("div", {
|
|
2190
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
2191
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
2155
2192
|
className: "ButtonPrimary",
|
|
2156
2193
|
onClick: close
|
|
2157
2194
|
}, "Ok"))
|
|
@@ -2162,7 +2199,7 @@ var PaymentContext = /*#__PURE__*/React.createContext();
|
|
|
2162
2199
|
|
|
2163
2200
|
var PaymentRoutingContext = /*#__PURE__*/React.createContext();
|
|
2164
2201
|
|
|
2165
|
-
var
|
|
2202
|
+
var TrackingContext = /*#__PURE__*/React.createContext();
|
|
2166
2203
|
|
|
2167
2204
|
var PaymentProvider = (function (props) {
|
|
2168
2205
|
var _useContext = useContext(ErrorContext),
|
|
@@ -2171,7 +2208,6 @@ var PaymentProvider = (function (props) {
|
|
|
2171
2208
|
var _useContext2 = useContext(ConfigurationContext),
|
|
2172
2209
|
_sent = _useContext2.sent,
|
|
2173
2210
|
_confirmed = _useContext2.confirmed,
|
|
2174
|
-
_ensured = _useContext2.ensured,
|
|
2175
2211
|
_failed = _useContext2.failed;
|
|
2176
2212
|
|
|
2177
2213
|
var _useContext3 = useContext(PaymentRoutingContext),
|
|
@@ -2185,13 +2221,17 @@ var PaymentProvider = (function (props) {
|
|
|
2185
2221
|
var _useContext5 = useContext(PaymentRoutingContext),
|
|
2186
2222
|
allRoutes = _useContext5.allRoutes;
|
|
2187
2223
|
|
|
2188
|
-
var _useContext6 = useContext(
|
|
2189
|
-
_useContext6.
|
|
2190
|
-
var setUpdate = _useContext6.setUpdate;
|
|
2224
|
+
var _useContext6 = useContext(UpdatableContext),
|
|
2225
|
+
setUpdatable = _useContext6.setUpdatable;
|
|
2191
2226
|
|
|
2192
2227
|
var _useContext7 = useContext(WalletContext),
|
|
2193
2228
|
wallet = _useContext7.wallet;
|
|
2194
2229
|
|
|
2230
|
+
var _useContext8 = useContext(TrackingContext),
|
|
2231
|
+
forward = _useContext8.forward,
|
|
2232
|
+
tracking = _useContext8.tracking,
|
|
2233
|
+
initializeTracking = _useContext8.initializeTracking;
|
|
2234
|
+
|
|
2195
2235
|
var _useState = useState(),
|
|
2196
2236
|
_useState2 = _slicedToArray(_useState, 2),
|
|
2197
2237
|
payment = _useState2[0],
|
|
@@ -2212,53 +2252,81 @@ var PaymentProvider = (function (props) {
|
|
|
2212
2252
|
paymentState = _useState8[0],
|
|
2213
2253
|
setPaymentState = _useState8[1];
|
|
2214
2254
|
|
|
2215
|
-
var pay = function
|
|
2216
|
-
var
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2255
|
+
var pay = /*#__PURE__*/function () {
|
|
2256
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(_ref) {
|
|
2257
|
+
var navigate, currentBlock;
|
|
2258
|
+
return regenerator.wrap(function _callee$(_context) {
|
|
2259
|
+
while (1) {
|
|
2260
|
+
switch (_context.prev = _context.next) {
|
|
2261
|
+
case 0:
|
|
2262
|
+
navigate = _ref.navigate;
|
|
2263
|
+
setClosable(false);
|
|
2264
|
+
setPaymentState('paying');
|
|
2265
|
+
setUpdatable(false);
|
|
2266
|
+
_context.next = 6;
|
|
2267
|
+
return request({
|
|
2268
|
+
blockchain: payment.route.transaction.blockchain,
|
|
2269
|
+
method: 'latestBlockNumber'
|
|
2270
|
+
});
|
|
2229
2271
|
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
}
|
|
2272
|
+
case 6:
|
|
2273
|
+
currentBlock = _context.sent;
|
|
2274
|
+
wallet.sendTransaction(Object.assign({}, payment.route.transaction, {
|
|
2275
|
+
sent: function sent(transaction) {
|
|
2276
|
+
if (_sent) {
|
|
2277
|
+
_sent(transaction);
|
|
2278
|
+
}
|
|
2279
|
+
},
|
|
2280
|
+
confirmed: function confirmed(transaction) {
|
|
2281
|
+
if (tracking != true) {
|
|
2282
|
+
setClosable(true);
|
|
2283
|
+
}
|
|
2243
2284
|
|
|
2244
|
-
|
|
2245
|
-
setClosable(true);
|
|
2246
|
-
setUpdate(true);
|
|
2247
|
-
navigate('PaymentError');
|
|
2248
|
-
}
|
|
2249
|
-
})).then(function (sentTransaction) {
|
|
2250
|
-
setTransaction(sentTransaction);
|
|
2251
|
-
})["catch"](function (error) {
|
|
2252
|
-
console.log('error', error);
|
|
2253
|
-
setPaymentState('initialized');
|
|
2254
|
-
setClosable(true);
|
|
2255
|
-
setUpdate(true);
|
|
2285
|
+
setPaymentState('confirmed');
|
|
2256
2286
|
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2287
|
+
if (_confirmed) {
|
|
2288
|
+
_confirmed(transaction);
|
|
2289
|
+
}
|
|
2290
|
+
},
|
|
2291
|
+
failed: function failed(transaction, error) {
|
|
2292
|
+
if (_failed) {
|
|
2293
|
+
_failed(transaction, error);
|
|
2294
|
+
}
|
|
2295
|
+
|
|
2296
|
+
setPaymentState('initialized');
|
|
2297
|
+
setClosable(true);
|
|
2298
|
+
setUpdatable(true);
|
|
2299
|
+
navigate('PaymentError');
|
|
2300
|
+
}
|
|
2301
|
+
})).then(function (sentTransaction) {
|
|
2302
|
+
if (tracking) {
|
|
2303
|
+
initializeTracking(sentTransaction, currentBlock);
|
|
2304
|
+
}
|
|
2305
|
+
|
|
2306
|
+
setTransaction(sentTransaction);
|
|
2307
|
+
})["catch"](function (error) {
|
|
2308
|
+
console.log('error', error);
|
|
2309
|
+
setPaymentState('initialized');
|
|
2310
|
+
setClosable(true);
|
|
2311
|
+
setUpdatable(true);
|
|
2312
|
+
|
|
2313
|
+
if ((error === null || error === void 0 ? void 0 : error.code) == 'WRONG_NETWORK') {
|
|
2314
|
+
navigate('WrongNetwork');
|
|
2315
|
+
}
|
|
2316
|
+
});
|
|
2317
|
+
|
|
2318
|
+
case 8:
|
|
2319
|
+
case "end":
|
|
2320
|
+
return _context.stop();
|
|
2321
|
+
}
|
|
2322
|
+
}
|
|
2323
|
+
}, _callee);
|
|
2324
|
+
}));
|
|
2325
|
+
|
|
2326
|
+
return function pay(_x) {
|
|
2327
|
+
return _ref2.apply(this, arguments);
|
|
2328
|
+
};
|
|
2329
|
+
}();
|
|
2262
2330
|
|
|
2263
2331
|
var approve = function approve() {
|
|
2264
2332
|
setClosable(false);
|
|
@@ -2279,15 +2347,20 @@ var PaymentProvider = (function (props) {
|
|
|
2279
2347
|
});
|
|
2280
2348
|
};
|
|
2281
2349
|
|
|
2350
|
+
useEffect(function () {
|
|
2351
|
+
if (forward) {
|
|
2352
|
+
setPaymentState('confirmed');
|
|
2353
|
+
}
|
|
2354
|
+
}, [forward]);
|
|
2282
2355
|
useEffect(function () {
|
|
2283
2356
|
if (selectedRoute) {
|
|
2284
2357
|
var fromToken = selectedRoute.fromToken;
|
|
2285
2358
|
selectedRoute.transaction.params;
|
|
2286
|
-
Promise.all([fromToken.name(), fromToken.symbol(), fromToken.readable(selectedRoute.fromAmount)]).then(function (
|
|
2287
|
-
var
|
|
2288
|
-
name =
|
|
2289
|
-
symbol =
|
|
2290
|
-
amount =
|
|
2359
|
+
Promise.all([fromToken.name(), fromToken.symbol(), fromToken.readable(selectedRoute.fromAmount)]).then(function (_ref3) {
|
|
2360
|
+
var _ref4 = _slicedToArray(_ref3, 3),
|
|
2361
|
+
name = _ref4[0],
|
|
2362
|
+
symbol = _ref4[1],
|
|
2363
|
+
amount = _ref4[2];
|
|
2291
2364
|
|
|
2292
2365
|
setPayment({
|
|
2293
2366
|
route: selectedRoute,
|
|
@@ -2303,9 +2376,9 @@ var PaymentProvider = (function (props) {
|
|
|
2303
2376
|
}, [selectedRoute]);
|
|
2304
2377
|
useEffect(function () {
|
|
2305
2378
|
if (allRoutes && allRoutes.length == 0) {
|
|
2306
|
-
|
|
2379
|
+
setUpdatable(false);
|
|
2307
2380
|
} else if (allRoutes && allRoutes.length > 0) {
|
|
2308
|
-
|
|
2381
|
+
setUpdatable(true);
|
|
2309
2382
|
}
|
|
2310
2383
|
}, [allRoutes]);
|
|
2311
2384
|
|
|
@@ -2371,8 +2444,8 @@ var PaymentRoutingProvider = (function (props) {
|
|
|
2371
2444
|
var _useContext = useContext(WalletContext),
|
|
2372
2445
|
account = _useContext.account;
|
|
2373
2446
|
|
|
2374
|
-
var _useContext2 = useContext(
|
|
2375
|
-
|
|
2447
|
+
var _useContext2 = useContext(UpdatableContext),
|
|
2448
|
+
updatable = _useContext2.updatable;
|
|
2376
2449
|
|
|
2377
2450
|
var prepareAcceptedPayments = function prepareAcceptedPayments(accept) {
|
|
2378
2451
|
var toAddress = _typeof(accept.receiver) == 'object' ? accept.receiver.address : accept.receiver;
|
|
@@ -2387,9 +2460,9 @@ var PaymentRoutingProvider = (function (props) {
|
|
|
2387
2460
|
var getPaymentRoutes = function getPaymentRoutes(_ref) {
|
|
2388
2461
|
var allRoutes = _ref.allRoutes,
|
|
2389
2462
|
selectedRoute = _ref.selectedRoute,
|
|
2390
|
-
|
|
2463
|
+
updatable = _ref.updatable;
|
|
2391
2464
|
|
|
2392
|
-
if (
|
|
2465
|
+
if (updatable == false || !props.accept || !account) {
|
|
2393
2466
|
return;
|
|
2394
2467
|
}
|
|
2395
2468
|
|
|
@@ -2492,13 +2565,13 @@ var PaymentRoutingProvider = (function (props) {
|
|
|
2492
2565
|
getPaymentRoutes({
|
|
2493
2566
|
allRoutes: allRoutes,
|
|
2494
2567
|
selectedRoute: selectedRoute,
|
|
2495
|
-
|
|
2568
|
+
updatable: updatable
|
|
2496
2569
|
});
|
|
2497
2570
|
}, 15000);
|
|
2498
2571
|
return function () {
|
|
2499
2572
|
return clearTimeout(timeout);
|
|
2500
2573
|
};
|
|
2501
|
-
}, [reloadCount, allRoutes, selectedRoute,
|
|
2574
|
+
}, [reloadCount, allRoutes, selectedRoute, updatable]);
|
|
2502
2575
|
useEffect(function () {
|
|
2503
2576
|
if (account && props.accept) {
|
|
2504
2577
|
setAllRoutes(undefined);
|
|
@@ -2528,8 +2601,8 @@ var PaymentValueProvider = (function (props) {
|
|
|
2528
2601
|
var _useContext2 = useContext(WalletContext),
|
|
2529
2602
|
account = _useContext2.account;
|
|
2530
2603
|
|
|
2531
|
-
var _useContext3 = useContext(
|
|
2532
|
-
|
|
2604
|
+
var _useContext3 = useContext(UpdatableContext),
|
|
2605
|
+
updatable = _useContext3.updatable;
|
|
2533
2606
|
|
|
2534
2607
|
var _useContext4 = useContext(PaymentContext),
|
|
2535
2608
|
payment = _useContext4.payment;
|
|
@@ -2548,10 +2621,10 @@ var PaymentValueProvider = (function (props) {
|
|
|
2548
2621
|
setReloadCount = _useState4[1];
|
|
2549
2622
|
|
|
2550
2623
|
var getToTokenLocalValue = function getToTokenLocalValue(_ref) {
|
|
2551
|
-
var
|
|
2624
|
+
var updatable = _ref.updatable,
|
|
2552
2625
|
payment = _ref.payment;
|
|
2553
2626
|
|
|
2554
|
-
if (
|
|
2627
|
+
if (updatable == false || (payment === null || payment === void 0 ? void 0 : payment.route) == undefined) {
|
|
2555
2628
|
return;
|
|
2556
2629
|
}
|
|
2557
2630
|
|
|
@@ -2594,7 +2667,7 @@ var PaymentValueProvider = (function (props) {
|
|
|
2594
2667
|
useEffect(function () {
|
|
2595
2668
|
if (account && payment) {
|
|
2596
2669
|
getToTokenLocalValue({
|
|
2597
|
-
|
|
2670
|
+
updatable: updatable,
|
|
2598
2671
|
payment: payment
|
|
2599
2672
|
});
|
|
2600
2673
|
}
|
|
@@ -2603,13 +2676,13 @@ var PaymentValueProvider = (function (props) {
|
|
|
2603
2676
|
var timeout = setTimeout(function () {
|
|
2604
2677
|
setReloadCount(reloadCount + 1);
|
|
2605
2678
|
getToTokenLocalValue({
|
|
2606
|
-
|
|
2679
|
+
updatable: updatable
|
|
2607
2680
|
});
|
|
2608
2681
|
}, 15000);
|
|
2609
2682
|
return function () {
|
|
2610
2683
|
return clearTimeout(timeout);
|
|
2611
2684
|
};
|
|
2612
|
-
}, [reloadCount,
|
|
2685
|
+
}, [reloadCount, updatable]);
|
|
2613
2686
|
return /*#__PURE__*/React.createElement(PaymentValueContext.Provider, {
|
|
2614
2687
|
value: {
|
|
2615
2688
|
paymentValue: paymentValue
|
|
@@ -2764,7 +2837,9 @@ var ChangeAmountDialog = (function (props) {
|
|
|
2764
2837
|
changeAmount(toValidValue(maxAmount));
|
|
2765
2838
|
}
|
|
2766
2839
|
}, "(Max)")))))),
|
|
2767
|
-
footer: /*#__PURE__*/React.createElement("div",
|
|
2840
|
+
footer: /*#__PURE__*/React.createElement("div", {
|
|
2841
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
2842
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
2768
2843
|
className: "ButtonPrimary",
|
|
2769
2844
|
onClick: changeAmountAndGoBack
|
|
2770
2845
|
}, "Done"))
|
|
@@ -2851,6 +2926,7 @@ var ChangePaymentDialog = (function (props) {
|
|
|
2851
2926
|
}, [allRoutes]);
|
|
2852
2927
|
useEffect(function () {
|
|
2853
2928
|
setCards(allPaymentRoutesWithData.map(function (payment, index) {
|
|
2929
|
+
var blockchain = Blockchain.findByName(payment.route.blockchain);
|
|
2854
2930
|
return /*#__PURE__*/React.createElement("div", {
|
|
2855
2931
|
key: index,
|
|
2856
2932
|
className: "Card",
|
|
@@ -2864,6 +2940,11 @@ var ChangePaymentDialog = (function (props) {
|
|
|
2864
2940
|
}, /*#__PURE__*/React.createElement(TokenImage, {
|
|
2865
2941
|
blockchain: payment.route.blockchain,
|
|
2866
2942
|
address: payment.route.fromToken.address
|
|
2943
|
+
}), /*#__PURE__*/React.createElement("img", {
|
|
2944
|
+
className: "BlockchainLogo small",
|
|
2945
|
+
src: blockchain.logo,
|
|
2946
|
+
alt: blockchain.label,
|
|
2947
|
+
title: blockchain.label
|
|
2867
2948
|
})), /*#__PURE__*/React.createElement("div", {
|
|
2868
2949
|
className: "CardBody"
|
|
2869
2950
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -2878,11 +2959,7 @@ var ChangePaymentDialog = (function (props) {
|
|
|
2878
2959
|
className: "TokenAmountCell"
|
|
2879
2960
|
}, format(payment.amount)))), /*#__PURE__*/React.createElement("h3", {
|
|
2880
2961
|
className: "CardText"
|
|
2881
|
-
}, /*#__PURE__*/React.createElement("small", null, format(round(parseFloat(payment.route.fromBalance.toString()) / Math.pow(10, payment.decimals), 'down'))))))
|
|
2882
|
-
className: "CardInfo"
|
|
2883
|
-
}, payment.route.approvalRequired && /*#__PURE__*/React.createElement("span", {
|
|
2884
|
-
className: "Label"
|
|
2885
|
-
}, "Requires Approval")));
|
|
2962
|
+
}, /*#__PURE__*/React.createElement("small", null, format(round(parseFloat(payment.route.fromBalance.toString()) / Math.pow(10, payment.decimals), 'down')))))));
|
|
2886
2963
|
}));
|
|
2887
2964
|
}, [allPaymentRoutesWithData]);
|
|
2888
2965
|
|
|
@@ -2908,25 +2985,12 @@ var ChangePaymentDialog = (function (props) {
|
|
|
2908
2985
|
});
|
|
2909
2986
|
});
|
|
2910
2987
|
|
|
2911
|
-
var Checkmark = (function () {
|
|
2912
|
-
return /*#__PURE__*/React.createElement("svg", {
|
|
2913
|
-
className: "Checkmark Icon",
|
|
2914
|
-
version: "1.1",
|
|
2915
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2916
|
-
x: "0px",
|
|
2917
|
-
y: "0px",
|
|
2918
|
-
viewBox: "0 0 24 24"
|
|
2919
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
2920
|
-
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"
|
|
2921
|
-
}));
|
|
2922
|
-
});
|
|
2923
|
-
|
|
2924
2988
|
var DonationOverviewSkeleton = (function (props) {
|
|
2925
2989
|
return /*#__PURE__*/React.createElement(Dialog$1, {
|
|
2926
2990
|
header: /*#__PURE__*/React.createElement("div", {
|
|
2927
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
2991
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
2928
2992
|
}, /*#__PURE__*/React.createElement("h1", {
|
|
2929
|
-
className: "LineHeightL FontSizeL
|
|
2993
|
+
className: "LineHeightL FontSizeL"
|
|
2930
2994
|
}, "Donation")),
|
|
2931
2995
|
body: /*#__PURE__*/React.createElement("div", {
|
|
2932
2996
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -2940,7 +3004,7 @@ var DonationOverviewSkeleton = (function (props) {
|
|
|
2940
3004
|
className: "SkeletonBackground"
|
|
2941
3005
|
}))),
|
|
2942
3006
|
footer: /*#__PURE__*/React.createElement("div", {
|
|
2943
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
3007
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
2944
3008
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2945
3009
|
className: "SkeletonWrapper"
|
|
2946
3010
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -2951,6 +3015,60 @@ var DonationOverviewSkeleton = (function (props) {
|
|
|
2951
3015
|
});
|
|
2952
3016
|
});
|
|
2953
3017
|
|
|
3018
|
+
var Checkmark = (function (props) {
|
|
3019
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
3020
|
+
className: "Checkmark Icon " + props.className,
|
|
3021
|
+
version: "1.1",
|
|
3022
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3023
|
+
x: "0px",
|
|
3024
|
+
y: "0px",
|
|
3025
|
+
viewBox: "0 0 24 24"
|
|
3026
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
3027
|
+
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"
|
|
3028
|
+
}));
|
|
3029
|
+
});
|
|
3030
|
+
|
|
3031
|
+
var DigitalWalletIcon = (function (props) {
|
|
3032
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
3033
|
+
className: "DigitalWalletIcon Icon " + props.className,
|
|
3034
|
+
version: "1.1",
|
|
3035
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3036
|
+
height: "24",
|
|
3037
|
+
width: "24",
|
|
3038
|
+
viewBox: "0 0 24 24"
|
|
3039
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
3040
|
+
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",
|
|
3041
|
+
transform: "translate(-0.81 -1)"
|
|
3042
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
3043
|
+
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",
|
|
3044
|
+
transform: "translate(-0.81 -1)"
|
|
3045
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
3046
|
+
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",
|
|
3047
|
+
transform: "translate(-0.81 -1)"
|
|
3048
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
3049
|
+
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",
|
|
3050
|
+
transform: "translate(-0.81 -1)"
|
|
3051
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
3052
|
+
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",
|
|
3053
|
+
transform: "translate(-0.81 -1)"
|
|
3054
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
3055
|
+
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",
|
|
3056
|
+
transform: "translate(-0.81 -1)"
|
|
3057
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
3058
|
+
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",
|
|
3059
|
+
transform: "translate(-0.81 -1)"
|
|
3060
|
+
}), /*#__PURE__*/React.createElement("rect", {
|
|
3061
|
+
x: "0.33",
|
|
3062
|
+
y: "11.77",
|
|
3063
|
+
width: "4.72",
|
|
3064
|
+
height: "0.66"
|
|
3065
|
+
}), /*#__PURE__*/React.createElement("polygon", {
|
|
3066
|
+
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"
|
|
3067
|
+
}), /*#__PURE__*/React.createElement("polygon", {
|
|
3068
|
+
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"
|
|
3069
|
+
}));
|
|
3070
|
+
});
|
|
3071
|
+
|
|
2954
3072
|
var LoadingText = (function (props) {
|
|
2955
3073
|
return /*#__PURE__*/React.createElement("div", {
|
|
2956
3074
|
className: "LoadingText"
|
|
@@ -2963,26 +3081,143 @@ var LoadingText = (function (props) {
|
|
|
2963
3081
|
}, "."));
|
|
2964
3082
|
});
|
|
2965
3083
|
|
|
2966
|
-
var
|
|
3084
|
+
var Footer = (function () {
|
|
2967
3085
|
var _useContext = useContext(ConfigurationContext),
|
|
2968
3086
|
currencyCode = _useContext.currencyCode;
|
|
2969
3087
|
|
|
2970
3088
|
var _useContext2 = useContext(ChangableAmountContext),
|
|
2971
3089
|
amount = _useContext2.amount;
|
|
3090
|
+
_useContext2.amountsMissing;
|
|
2972
3091
|
|
|
2973
|
-
var _useContext3 = useContext(
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
transaction = _useContext3.transaction,
|
|
2978
|
-
approve = _useContext3.approve,
|
|
2979
|
-
approvalTransaction = _useContext3.approvalTransaction;
|
|
3092
|
+
var _useContext3 = useContext(TrackingContext),
|
|
3093
|
+
tracking = _useContext3.tracking,
|
|
3094
|
+
forward = _useContext3.forward,
|
|
3095
|
+
forwardTo = _useContext3.forwardTo;
|
|
2980
3096
|
|
|
2981
|
-
var _useContext4 = useContext(
|
|
2982
|
-
|
|
3097
|
+
var _useContext4 = useContext(PaymentContext),
|
|
3098
|
+
payment = _useContext4.payment,
|
|
3099
|
+
paymentState = _useContext4.paymentState,
|
|
3100
|
+
pay = _useContext4.pay,
|
|
3101
|
+
transaction = _useContext4.transaction,
|
|
3102
|
+
approve = _useContext4.approve,
|
|
3103
|
+
approvalTransaction = _useContext4.approvalTransaction;
|
|
3104
|
+
|
|
3105
|
+
var _useContext5 = useContext(PaymentValueContext),
|
|
3106
|
+
paymentValue = _useContext5.paymentValue;
|
|
3107
|
+
|
|
3108
|
+
var _useContext6 = useContext(NavigateStackContext),
|
|
3109
|
+
navigate = _useContext6.navigate;
|
|
3110
|
+
|
|
3111
|
+
var _useContext7 = useContext(ClosableContext),
|
|
3112
|
+
close = _useContext7.close;
|
|
3113
|
+
|
|
3114
|
+
var trackingInfo = function trackingInfo() {
|
|
3115
|
+
if (tracking != true) {
|
|
3116
|
+
return null;
|
|
3117
|
+
}
|
|
3118
|
+
|
|
3119
|
+
if (forward) {
|
|
3120
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("a", {
|
|
3121
|
+
className: "Card transparent small disabled"
|
|
3122
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
3123
|
+
className: "CardImage"
|
|
3124
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
3125
|
+
className: "TextCenter Opacity05"
|
|
3126
|
+
}, /*#__PURE__*/React.createElement(Checkmark, {
|
|
3127
|
+
className: "small"
|
|
3128
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
3129
|
+
className: "CardBody"
|
|
3130
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
3131
|
+
className: "CardBodyWrapper"
|
|
3132
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
3133
|
+
className: "Opacity05"
|
|
3134
|
+
}, "Payment confirmation has been stored")))));
|
|
3135
|
+
} else {
|
|
3136
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("a", {
|
|
3137
|
+
className: "Card transparent small disabled"
|
|
3138
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
3139
|
+
className: "CardImage"
|
|
3140
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
3141
|
+
className: "TextCenter"
|
|
3142
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
3143
|
+
className: "Loading Icon"
|
|
3144
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
3145
|
+
className: "CardBody"
|
|
3146
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
3147
|
+
className: "CardBodyWrapper"
|
|
3148
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
3149
|
+
className: "Opacity05"
|
|
3150
|
+
}, "Storing payment confirmation")))));
|
|
3151
|
+
}
|
|
3152
|
+
};
|
|
3153
|
+
|
|
3154
|
+
var additionalPaymentInformation = function additionalPaymentInformation() {
|
|
3155
|
+
if (paymentState == 'paying' && transaction == undefined) {
|
|
3156
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
3157
|
+
className: "PaddingBottomS"
|
|
3158
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
3159
|
+
className: "Card transparent disabled small"
|
|
3160
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
3161
|
+
className: "CardImage"
|
|
3162
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
3163
|
+
className: "TextCenter Opacity05"
|
|
3164
|
+
}, /*#__PURE__*/React.createElement(DigitalWalletIcon, {
|
|
3165
|
+
className: "small"
|
|
3166
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
3167
|
+
className: "CardBody"
|
|
3168
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
3169
|
+
className: "CardBodyWrapper"
|
|
3170
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
3171
|
+
className: "Opacity05"
|
|
3172
|
+
}, "Confirm transaction in your wallet")))));
|
|
3173
|
+
} else if (paymentState == 'confirmed') {
|
|
3174
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
3175
|
+
className: "PaddingBottomS"
|
|
3176
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("a", {
|
|
3177
|
+
className: "Card transparent small",
|
|
3178
|
+
title: "Payment has been confirmed by the network",
|
|
3179
|
+
href: transaction === null || transaction === void 0 ? void 0 : transaction.url,
|
|
3180
|
+
target: "_blank",
|
|
3181
|
+
rel: "noopener noreferrer"
|
|
3182
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
3183
|
+
className: "CardImage"
|
|
3184
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
3185
|
+
className: "TextCenter Opacity05"
|
|
3186
|
+
}, /*#__PURE__*/React.createElement(Checkmark, {
|
|
3187
|
+
className: "small"
|
|
3188
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
3189
|
+
className: "CardBody"
|
|
3190
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
3191
|
+
className: "CardBodyWrapper"
|
|
3192
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
3193
|
+
className: "Opacity05"
|
|
3194
|
+
}, "Payment has been confirmed"))))), trackingInfo());
|
|
3195
|
+
}
|
|
3196
|
+
};
|
|
2983
3197
|
|
|
2984
|
-
var
|
|
2985
|
-
|
|
3198
|
+
var approvalButton = function approvalButton() {
|
|
3199
|
+
if (!payment.route.approvalRequired || payment.route.directTransfer) {
|
|
3200
|
+
return null;
|
|
3201
|
+
} else if (paymentState == 'initialized') {
|
|
3202
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
3203
|
+
className: "PaddingBottomS"
|
|
3204
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
3205
|
+
className: "ButtonPrimary",
|
|
3206
|
+
onClick: approve,
|
|
3207
|
+
title: "Allow ".concat(payment.symbol, " to be used as payment")
|
|
3208
|
+
}, "Allow ", payment.symbol, " to be used as payment"));
|
|
3209
|
+
} else if (paymentState == 'approving') {
|
|
3210
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
3211
|
+
className: "PaddingBottomS"
|
|
3212
|
+
}, /*#__PURE__*/React.createElement("a", {
|
|
3213
|
+
className: "ButtonPrimary",
|
|
3214
|
+
title: "Approving payment token - please wait",
|
|
3215
|
+
href: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
|
|
3216
|
+
target: "_blank",
|
|
3217
|
+
rel: "noopener noreferrer"
|
|
3218
|
+
}, /*#__PURE__*/React.createElement(LoadingText, null, "Approving")));
|
|
3219
|
+
}
|
|
3220
|
+
};
|
|
2986
3221
|
|
|
2987
3222
|
var mainAction = function mainAction() {
|
|
2988
3223
|
if (paymentState == 'initialized' || paymentState == 'approving') {
|
|
@@ -2997,10 +3232,10 @@ var DonationOverviewDialog = (function (props) {
|
|
|
2997
3232
|
navigate: navigate
|
|
2998
3233
|
});
|
|
2999
3234
|
}
|
|
3000
|
-
}, "Pay ", new Currency({
|
|
3235
|
+
}, "Pay ", amount ? new Currency({
|
|
3001
3236
|
amount: amount.toFixed(2),
|
|
3002
3237
|
code: currencyCode
|
|
3003
|
-
}).toString());
|
|
3238
|
+
}).toString() : paymentValue.toString().length ? paymentValue.toString() : "".concat(payment.amount));
|
|
3004
3239
|
} else if (paymentState == 'paying') {
|
|
3005
3240
|
return /*#__PURE__*/React.createElement("a", {
|
|
3006
3241
|
className: "ButtonPrimary",
|
|
@@ -3010,39 +3245,51 @@ var DonationOverviewDialog = (function (props) {
|
|
|
3010
3245
|
rel: "noopener noreferrer"
|
|
3011
3246
|
}, /*#__PURE__*/React.createElement(LoadingText, null, "Paying"));
|
|
3012
3247
|
} else if (paymentState == 'confirmed') {
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3248
|
+
if (tracking == true) {
|
|
3249
|
+
if (forward) {
|
|
3250
|
+
if (forwardTo) {
|
|
3251
|
+
return /*#__PURE__*/React.createElement("a", {
|
|
3252
|
+
className: "ButtonPrimary",
|
|
3253
|
+
href: forwardTo,
|
|
3254
|
+
rel: "noopener noreferrer"
|
|
3255
|
+
}, "Continue");
|
|
3256
|
+
} else {
|
|
3257
|
+
return /*#__PURE__*/React.createElement("button", {
|
|
3258
|
+
className: "ButtonPrimary",
|
|
3259
|
+
onClick: close
|
|
3260
|
+
}, "Continue");
|
|
3261
|
+
}
|
|
3262
|
+
} else {
|
|
3263
|
+
return /*#__PURE__*/React.createElement("button", {
|
|
3264
|
+
className: "ButtonPrimary disabled",
|
|
3265
|
+
onClick: function onClick() {}
|
|
3266
|
+
}, "Continue");
|
|
3267
|
+
}
|
|
3268
|
+
} else {
|
|
3269
|
+
return /*#__PURE__*/React.createElement("button", {
|
|
3270
|
+
className: "ButtonPrimary",
|
|
3271
|
+
onClick: close
|
|
3272
|
+
}, "Close");
|
|
3273
|
+
}
|
|
3018
3274
|
}
|
|
3019
3275
|
};
|
|
3020
3276
|
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
3024
|
-
className: "PaddingBottomS"
|
|
3025
|
-
}, /*#__PURE__*/React.createElement("button", {
|
|
3026
|
-
className: "ButtonPrimary wide",
|
|
3027
|
-
onClick: approve,
|
|
3028
|
-
title: "Allow ".concat(payment.symbol, " to be used as payment")
|
|
3029
|
-
}, "Allow ", payment.symbol, " to be used as payment"));
|
|
3030
|
-
} else if (paymentState == 'approving') {
|
|
3031
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
3032
|
-
className: "PaddingBottomS"
|
|
3033
|
-
}, /*#__PURE__*/React.createElement("a", {
|
|
3034
|
-
className: "ButtonPrimary wide",
|
|
3035
|
-
title: "Approving payment token - please wait",
|
|
3036
|
-
href: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
|
|
3037
|
-
target: "_blank",
|
|
3038
|
-
rel: "noopener noreferrer"
|
|
3039
|
-
}, /*#__PURE__*/React.createElement(LoadingText, null, "Approving")));
|
|
3040
|
-
}
|
|
3041
|
-
};
|
|
3277
|
+
return /*#__PURE__*/React.createElement("div", null, approvalButton(), additionalPaymentInformation(), mainAction());
|
|
3278
|
+
});
|
|
3042
3279
|
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3280
|
+
var DonationOverviewDialog = (function (props) {
|
|
3281
|
+
var _useContext = useContext(ConfigurationContext),
|
|
3282
|
+
currencyCode = _useContext.currencyCode;
|
|
3283
|
+
|
|
3284
|
+
var _useContext2 = useContext(ChangableAmountContext),
|
|
3285
|
+
amount = _useContext2.amount;
|
|
3286
|
+
|
|
3287
|
+
var _useContext3 = useContext(PaymentContext),
|
|
3288
|
+
payment = _useContext3.payment,
|
|
3289
|
+
paymentState = _useContext3.paymentState;
|
|
3290
|
+
|
|
3291
|
+
var _useContext4 = useContext(NavigateStackContext),
|
|
3292
|
+
navigate = _useContext4.navigate;
|
|
3046
3293
|
|
|
3047
3294
|
if (payment == undefined) {
|
|
3048
3295
|
return /*#__PURE__*/React.createElement(DonationOverviewSkeleton, null);
|
|
@@ -3050,9 +3297,9 @@ var DonationOverviewDialog = (function (props) {
|
|
|
3050
3297
|
|
|
3051
3298
|
return /*#__PURE__*/React.createElement(Dialog$1, {
|
|
3052
3299
|
header: /*#__PURE__*/React.createElement("div", {
|
|
3053
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
3300
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
3054
3301
|
}, /*#__PURE__*/React.createElement("h1", {
|
|
3055
|
-
className: "LineHeightL FontSizeL
|
|
3302
|
+
className: "LineHeightL FontSizeL"
|
|
3056
3303
|
}, "Donation")),
|
|
3057
3304
|
body: /*#__PURE__*/React.createElement("div", {
|
|
3058
3305
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -3115,8 +3362,8 @@ var DonationOverviewDialog = (function (props) {
|
|
|
3115
3362
|
className: "CardAction"
|
|
3116
3363
|
}, /*#__PURE__*/React.createElement(ChevronRight, null)))),
|
|
3117
3364
|
footer: /*#__PURE__*/React.createElement("div", {
|
|
3118
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
3119
|
-
},
|
|
3365
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
3366
|
+
}, /*#__PURE__*/React.createElement(Footer, null))
|
|
3120
3367
|
});
|
|
3121
3368
|
});
|
|
3122
3369
|
|
|
@@ -3153,9 +3400,9 @@ var PaymentErrorDialog = (function () {
|
|
|
3153
3400
|
rel: "noopener noreferrer"
|
|
3154
3401
|
}, "View on explorer")))),
|
|
3155
3402
|
footer: /*#__PURE__*/React.createElement("div", {
|
|
3156
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
3403
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
3157
3404
|
}, /*#__PURE__*/React.createElement("button", {
|
|
3158
|
-
className: "ButtonPrimary
|
|
3405
|
+
className: "ButtonPrimary",
|
|
3159
3406
|
onClick: function onClick() {
|
|
3160
3407
|
return navigate('back');
|
|
3161
3408
|
}
|
|
@@ -3176,9 +3423,9 @@ var WrongNetworkDialog = (function (props) {
|
|
|
3176
3423
|
return /*#__PURE__*/React.createElement(Dialog$1, {
|
|
3177
3424
|
stacked: true,
|
|
3178
3425
|
header: /*#__PURE__*/React.createElement("div", {
|
|
3179
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
3426
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
3180
3427
|
}, /*#__PURE__*/React.createElement("h1", {
|
|
3181
|
-
className: "LineHeightL FontSizeL
|
|
3428
|
+
className: "LineHeightL FontSizeL"
|
|
3182
3429
|
}, "Wrong Network")),
|
|
3183
3430
|
body: /*#__PURE__*/React.createElement("div", {
|
|
3184
3431
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -3195,7 +3442,7 @@ var WrongNetworkDialog = (function (props) {
|
|
|
3195
3442
|
className: "FontSizeM"
|
|
3196
3443
|
}, "Please make sure you connect your wallet to the correct network before you try again!"))),
|
|
3197
3444
|
footer: /*#__PURE__*/React.createElement("div", {
|
|
3198
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
3445
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
3199
3446
|
}, /*#__PURE__*/React.createElement("button", {
|
|
3200
3447
|
className: "ButtonPrimary",
|
|
3201
3448
|
onClick: function onClick() {
|
|
@@ -3226,16 +3473,122 @@ var DonationStack = (function (props) {
|
|
|
3226
3473
|
});
|
|
3227
3474
|
});
|
|
3228
3475
|
|
|
3229
|
-
var
|
|
3230
|
-
var
|
|
3476
|
+
var TrackingProvider = (function (props) {
|
|
3477
|
+
var _useContext = useContext(ConfigurationContext),
|
|
3478
|
+
track = _useContext.track;
|
|
3479
|
+
|
|
3480
|
+
var _useState = useState(track && !!track.endpoint),
|
|
3231
3481
|
_useState2 = _slicedToArray(_useState, 2),
|
|
3232
|
-
|
|
3233
|
-
|
|
3482
|
+
tracking = _useState2[0],
|
|
3483
|
+
setTracking = _useState2[1];
|
|
3484
|
+
|
|
3485
|
+
var _useState3 = useState(false),
|
|
3486
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
3487
|
+
forward = _useState4[0],
|
|
3488
|
+
setForward = _useState4[1];
|
|
3489
|
+
|
|
3490
|
+
var _useState5 = useState(),
|
|
3491
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
3492
|
+
forwardTo = _useState6[0],
|
|
3493
|
+
setForwardTo = _useState6[1];
|
|
3494
|
+
|
|
3495
|
+
var _useContext2 = useContext(ClosableContext),
|
|
3496
|
+
setClosable = _useContext2.setClosable;
|
|
3497
|
+
|
|
3498
|
+
useEffect(function () {
|
|
3499
|
+
setTracking(track && !!track.endpoint);
|
|
3500
|
+
}, [track]);
|
|
3501
|
+
|
|
3502
|
+
var openSocket = function openSocket(transaction) {
|
|
3503
|
+
var socket = new WebSocket('wss://integrate.depay.fi/cable');
|
|
3504
|
+
|
|
3505
|
+
socket.onopen = function (event) {
|
|
3506
|
+
var msg = {
|
|
3507
|
+
command: 'subscribe',
|
|
3508
|
+
identifier: JSON.stringify({
|
|
3509
|
+
blockchain: transaction.blockchain,
|
|
3510
|
+
sender: transaction.from.toLowerCase(),
|
|
3511
|
+
nonce: transaction.nonce,
|
|
3512
|
+
channel: 'PaymentChannel'
|
|
3513
|
+
})
|
|
3514
|
+
};
|
|
3515
|
+
socket.send(JSON.stringify(msg));
|
|
3516
|
+
};
|
|
3234
3517
|
|
|
3235
|
-
|
|
3518
|
+
socket.onclose = function (event) {};
|
|
3519
|
+
|
|
3520
|
+
socket.onmessage = function (event) {
|
|
3521
|
+
var item = JSON.parse(event.data);
|
|
3522
|
+
|
|
3523
|
+
if (item.type === "ping") {
|
|
3524
|
+
return;
|
|
3525
|
+
}
|
|
3526
|
+
|
|
3527
|
+
if (item.message && item.message.forward) {
|
|
3528
|
+
setClosable(!item.message.forward_to);
|
|
3529
|
+
setForwardTo(item.message.forward_to);
|
|
3530
|
+
setForward(item.message.forward);
|
|
3531
|
+
socket.close();
|
|
3532
|
+
|
|
3533
|
+
if (!!item.message.forward_to) {
|
|
3534
|
+
setTimeout(function () {
|
|
3535
|
+
props.document.location.href = item.message.forward_to;
|
|
3536
|
+
}, 500);
|
|
3537
|
+
}
|
|
3538
|
+
}
|
|
3539
|
+
};
|
|
3540
|
+
|
|
3541
|
+
socket.onerror = function (error) {
|
|
3542
|
+
console.log('WebSocket Error: ' + error);
|
|
3543
|
+
};
|
|
3544
|
+
};
|
|
3545
|
+
|
|
3546
|
+
var retryStartTracking = function retryStartTracking(transaction, afterBlock, attempt) {
|
|
3547
|
+
attempt = parseInt(attempt || 1, 10);
|
|
3548
|
+
console.log('RETRY TRACKING ATTEMPT ', attempt);
|
|
3549
|
+
|
|
3550
|
+
if (attempt < 3) {
|
|
3551
|
+
setTimeout(function () {
|
|
3552
|
+
startTracking(transaction, afterBlock, attempt + 1);
|
|
3553
|
+
}, 3000);
|
|
3554
|
+
} else {
|
|
3555
|
+
console.log('TRACKING FAILED AFTER 3 ATTEMPTS!');
|
|
3556
|
+
}
|
|
3557
|
+
};
|
|
3558
|
+
|
|
3559
|
+
var startTracking = function startTracking(transaction, afterBlock, attempt) {
|
|
3560
|
+
fetch(track.endpoint, {
|
|
3561
|
+
method: 'POST',
|
|
3562
|
+
body: JSON.stringify({
|
|
3563
|
+
blockchain: transaction.blockchain,
|
|
3564
|
+
transaction: transaction.id.toLowerCase(),
|
|
3565
|
+
sender: transaction.from.toLowerCase(),
|
|
3566
|
+
nonce: transaction.nonce,
|
|
3567
|
+
after_block: afterBlock
|
|
3568
|
+
})
|
|
3569
|
+
}).then(function (response) {
|
|
3570
|
+
if (response.status == 200) {
|
|
3571
|
+
console.log('TRACKING INITIALIZED');
|
|
3572
|
+
} else {
|
|
3573
|
+
retryStartTracking(transaction, afterBlock, attempt);
|
|
3574
|
+
}
|
|
3575
|
+
})["catch"](function (error) {
|
|
3576
|
+
console.log('TRACKING FAILED', error);
|
|
3577
|
+
retryStartTracking(transaction, afterBlock, attempt);
|
|
3578
|
+
});
|
|
3579
|
+
};
|
|
3580
|
+
|
|
3581
|
+
var initializeTracking = function initializeTracking(transaction, afterBlock) {
|
|
3582
|
+
openSocket(transaction);
|
|
3583
|
+
startTracking(transaction, afterBlock);
|
|
3584
|
+
};
|
|
3585
|
+
|
|
3586
|
+
return /*#__PURE__*/React.createElement(TrackingContext.Provider, {
|
|
3236
3587
|
value: {
|
|
3237
|
-
|
|
3238
|
-
|
|
3588
|
+
tracking: tracking,
|
|
3589
|
+
initializeTracking: initializeTracking,
|
|
3590
|
+
forward: forward,
|
|
3591
|
+
forwardTo: forwardTo
|
|
3239
3592
|
}
|
|
3240
3593
|
}, props.children);
|
|
3241
3594
|
});
|
|
@@ -3338,12 +3691,12 @@ var preflight$2 = /*#__PURE__*/function () {
|
|
|
3338
3691
|
|
|
3339
3692
|
var Donation = /*#__PURE__*/function () {
|
|
3340
3693
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(_ref3) {
|
|
3341
|
-
var amount, accept, event, sent, confirmed,
|
|
3694
|
+
var amount, accept, event, sent, confirmed, failed, error, critical, style, blacklist, providers, currency, connected, closed, document, unmount;
|
|
3342
3695
|
return regenerator.wrap(function _callee2$(_context2) {
|
|
3343
3696
|
while (1) {
|
|
3344
3697
|
switch (_context2.prev = _context2.next) {
|
|
3345
3698
|
case 0:
|
|
3346
|
-
amount = _ref3.amount, accept = _ref3.accept, event = _ref3.event, sent = _ref3.sent, confirmed = _ref3.confirmed,
|
|
3699
|
+
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;
|
|
3347
3700
|
_context2.prev = 1;
|
|
3348
3701
|
_context2.next = 4;
|
|
3349
3702
|
return preflight$2({
|
|
@@ -3369,26 +3722,27 @@ var Donation = /*#__PURE__*/function () {
|
|
|
3369
3722
|
event: event,
|
|
3370
3723
|
sent: sent,
|
|
3371
3724
|
confirmed: confirmed,
|
|
3372
|
-
ensured: ensured,
|
|
3373
3725
|
failed: failed,
|
|
3374
3726
|
blacklist: blacklist,
|
|
3375
3727
|
providers: providers
|
|
3376
3728
|
}
|
|
3377
|
-
}, /*#__PURE__*/React.createElement(ClosableProvider, {
|
|
3729
|
+
}, /*#__PURE__*/React.createElement(UpdatableProvider, null, /*#__PURE__*/React.createElement(ClosableProvider, {
|
|
3378
3730
|
unmount: unmount
|
|
3379
|
-
}, /*#__PURE__*/React.createElement(
|
|
3731
|
+
}, /*#__PURE__*/React.createElement(WalletProvider, {
|
|
3380
3732
|
container: container,
|
|
3381
3733
|
connected: connected,
|
|
3382
3734
|
unmount: unmount
|
|
3383
3735
|
}, /*#__PURE__*/React.createElement(ConversionRateProvider, null, /*#__PURE__*/React.createElement(ChangableAmountProvider, {
|
|
3384
3736
|
accept: accept
|
|
3737
|
+
}, /*#__PURE__*/React.createElement(TrackingProvider, {
|
|
3738
|
+
document: ensureDocument(document)
|
|
3385
3739
|
}, /*#__PURE__*/React.createElement(DonationRoutingProvider, {
|
|
3386
3740
|
container: container,
|
|
3387
3741
|
document: document
|
|
3388
3742
|
}, /*#__PURE__*/React.createElement(DonationStack, {
|
|
3389
3743
|
document: document,
|
|
3390
3744
|
container: container
|
|
3391
|
-
})))))))));
|
|
3745
|
+
}), /*#__PURE__*/React.createElement(PoweredBy, null))))))))));
|
|
3392
3746
|
};
|
|
3393
3747
|
});
|
|
3394
3748
|
return _context2.abrupt("return", {
|
|
@@ -3456,9 +3810,9 @@ var PaymentOverviewSkeleton = (function (props) {
|
|
|
3456
3810
|
|
|
3457
3811
|
return /*#__PURE__*/React.createElement(Dialog$1, {
|
|
3458
3812
|
header: /*#__PURE__*/React.createElement("div", {
|
|
3459
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
3813
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
3460
3814
|
}, /*#__PURE__*/React.createElement("h1", {
|
|
3461
|
-
className: "LineHeightL FontSizeL
|
|
3815
|
+
className: "LineHeightL FontSizeL"
|
|
3462
3816
|
}, "Payment")),
|
|
3463
3817
|
body: /*#__PURE__*/React.createElement("div", {
|
|
3464
3818
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -3472,7 +3826,7 @@ var PaymentOverviewSkeleton = (function (props) {
|
|
|
3472
3826
|
className: "SkeletonBackground"
|
|
3473
3827
|
}))),
|
|
3474
3828
|
footer: /*#__PURE__*/React.createElement("div", {
|
|
3475
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
3829
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
3476
3830
|
}, /*#__PURE__*/React.createElement("div", {
|
|
3477
3831
|
className: "SkeletonWrapper"
|
|
3478
3832
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -3487,17 +3841,13 @@ var PaymentOverviewDialog = (function (props) {
|
|
|
3487
3841
|
var _useContext = useContext(ConfigurationContext),
|
|
3488
3842
|
currencyCode = _useContext.currencyCode;
|
|
3489
3843
|
|
|
3490
|
-
var _useContext2 = useContext(
|
|
3491
|
-
|
|
3492
|
-
|
|
3844
|
+
var _useContext2 = useContext(PaymentContext),
|
|
3845
|
+
payment = _useContext2.payment,
|
|
3846
|
+
paymentState = _useContext2.paymentState;
|
|
3493
3847
|
|
|
3494
|
-
var _useContext3 = useContext(
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
pay = _useContext3.pay,
|
|
3498
|
-
transaction = _useContext3.transaction,
|
|
3499
|
-
approve = _useContext3.approve,
|
|
3500
|
-
approvalTransaction = _useContext3.approvalTransaction;
|
|
3848
|
+
var _useContext3 = useContext(ChangableAmountContext),
|
|
3849
|
+
amount = _useContext3.amount,
|
|
3850
|
+
amountsMissing = _useContext3.amountsMissing;
|
|
3501
3851
|
|
|
3502
3852
|
var _useContext4 = useContext(PaymentValueContext),
|
|
3503
3853
|
paymentValue = _useContext4.paymentValue;
|
|
@@ -3505,78 +3855,15 @@ var PaymentOverviewDialog = (function (props) {
|
|
|
3505
3855
|
var _useContext5 = useContext(NavigateStackContext),
|
|
3506
3856
|
navigate = _useContext5.navigate;
|
|
3507
3857
|
|
|
3508
|
-
var _useContext6 = useContext(ClosableContext),
|
|
3509
|
-
close = _useContext6.close;
|
|
3510
|
-
|
|
3511
|
-
var mainAction = function mainAction() {
|
|
3512
|
-
if (paymentState == 'initialized' || paymentState == 'approving') {
|
|
3513
|
-
return /*#__PURE__*/React.createElement("button", {
|
|
3514
|
-
className: ["ButtonPrimary", payment.route.approvalRequired && !payment.route.directTransfer ? 'disabled' : ''].join(' '),
|
|
3515
|
-
onClick: function onClick() {
|
|
3516
|
-
if (payment.route.approvalRequired && !payment.route.directTransfer) {
|
|
3517
|
-
return;
|
|
3518
|
-
}
|
|
3519
|
-
|
|
3520
|
-
pay({
|
|
3521
|
-
navigate: navigate
|
|
3522
|
-
});
|
|
3523
|
-
}
|
|
3524
|
-
}, "Pay ", amount ? new Currency({
|
|
3525
|
-
amount: amount.toFixed(2),
|
|
3526
|
-
code: currencyCode
|
|
3527
|
-
}).toString() : paymentValue.toString().length ? paymentValue.toString() : "".concat(payment.amount));
|
|
3528
|
-
} else if (paymentState == 'paying') {
|
|
3529
|
-
return /*#__PURE__*/React.createElement("a", {
|
|
3530
|
-
className: "ButtonPrimary",
|
|
3531
|
-
title: "Performing the payment - please wait",
|
|
3532
|
-
href: transaction === null || transaction === void 0 ? void 0 : transaction.url,
|
|
3533
|
-
target: "_blank",
|
|
3534
|
-
rel: "noopener noreferrer"
|
|
3535
|
-
}, /*#__PURE__*/React.createElement(LoadingText, null, "Paying"));
|
|
3536
|
-
} else if (paymentState == 'confirmed') {
|
|
3537
|
-
return /*#__PURE__*/React.createElement("button", {
|
|
3538
|
-
className: "ButtonPrimary round",
|
|
3539
|
-
title: "Done",
|
|
3540
|
-
onClick: close
|
|
3541
|
-
}, /*#__PURE__*/React.createElement(Checkmark, null));
|
|
3542
|
-
}
|
|
3543
|
-
};
|
|
3544
|
-
|
|
3545
|
-
var approvalAction = function approvalAction() {
|
|
3546
|
-
if (paymentState == 'initialized') {
|
|
3547
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
3548
|
-
className: "PaddingBottomS"
|
|
3549
|
-
}, /*#__PURE__*/React.createElement("button", {
|
|
3550
|
-
className: "ButtonPrimary wide",
|
|
3551
|
-
onClick: approve,
|
|
3552
|
-
title: "Allow ".concat(payment.symbol, " to be used as payment")
|
|
3553
|
-
}, "Allow ", payment.symbol, " to be used as payment"));
|
|
3554
|
-
} else if (paymentState == 'approving') {
|
|
3555
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
3556
|
-
className: "PaddingBottomS"
|
|
3557
|
-
}, /*#__PURE__*/React.createElement("a", {
|
|
3558
|
-
className: "ButtonPrimary wide",
|
|
3559
|
-
title: "Approving payment token - please wait",
|
|
3560
|
-
href: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
|
|
3561
|
-
target: "_blank",
|
|
3562
|
-
rel: "noopener noreferrer"
|
|
3563
|
-
}, /*#__PURE__*/React.createElement(LoadingText, null, "Approving")));
|
|
3564
|
-
}
|
|
3565
|
-
};
|
|
3566
|
-
|
|
3567
|
-
var actions = function actions() {
|
|
3568
|
-
return /*#__PURE__*/React.createElement("div", null, payment.route.approvalRequired && !payment.route.directTransfer && approvalAction(), mainAction());
|
|
3569
|
-
};
|
|
3570
|
-
|
|
3571
3858
|
if (payment == undefined || paymentValue == undefined) {
|
|
3572
3859
|
return /*#__PURE__*/React.createElement(PaymentOverviewSkeleton, null);
|
|
3573
3860
|
}
|
|
3574
3861
|
|
|
3575
3862
|
return /*#__PURE__*/React.createElement(Dialog$1, {
|
|
3576
3863
|
header: /*#__PURE__*/React.createElement("div", {
|
|
3577
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
3864
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
3578
3865
|
}, /*#__PURE__*/React.createElement("h1", {
|
|
3579
|
-
className: "LineHeightL FontSizeL
|
|
3866
|
+
className: "LineHeightL FontSizeL"
|
|
3580
3867
|
}, "Payment")),
|
|
3581
3868
|
body: /*#__PURE__*/React.createElement("div", {
|
|
3582
3869
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -3639,8 +3926,8 @@ var PaymentOverviewDialog = (function (props) {
|
|
|
3639
3926
|
className: "CardAction"
|
|
3640
3927
|
}, /*#__PURE__*/React.createElement(ChevronRight, null)))),
|
|
3641
3928
|
footer: /*#__PURE__*/React.createElement("div", {
|
|
3642
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
3643
|
-
},
|
|
3929
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
3930
|
+
}, /*#__PURE__*/React.createElement(Footer, null))
|
|
3644
3931
|
});
|
|
3645
3932
|
});
|
|
3646
3933
|
|
|
@@ -3706,12 +3993,12 @@ var preflight$1 = /*#__PURE__*/function () {
|
|
|
3706
3993
|
|
|
3707
3994
|
var Payment = /*#__PURE__*/function () {
|
|
3708
3995
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(_ref3) {
|
|
3709
|
-
var accept, amount, event, sent, confirmed,
|
|
3996
|
+
var accept, amount, event, sent, confirmed, failed, error, critical, style, whitelist, blacklist, providers, currency, connected, closed, track, document, unmount;
|
|
3710
3997
|
return regenerator.wrap(function _callee2$(_context2) {
|
|
3711
3998
|
while (1) {
|
|
3712
3999
|
switch (_context2.prev = _context2.next) {
|
|
3713
4000
|
case 0:
|
|
3714
|
-
accept = _ref3.accept, amount = _ref3.amount, event = _ref3.event, sent = _ref3.sent, confirmed = _ref3.confirmed,
|
|
4001
|
+
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;
|
|
3715
4002
|
_context2.prev = 1;
|
|
3716
4003
|
_context2.next = 4;
|
|
3717
4004
|
return preflight$1({
|
|
@@ -3737,15 +4024,15 @@ var Payment = /*#__PURE__*/function () {
|
|
|
3737
4024
|
event: event,
|
|
3738
4025
|
sent: sent,
|
|
3739
4026
|
confirmed: confirmed,
|
|
3740
|
-
ensured: ensured,
|
|
3741
4027
|
failed: failed,
|
|
3742
4028
|
whitelist: whitelist,
|
|
3743
4029
|
blacklist: blacklist,
|
|
3744
|
-
providers: providers
|
|
4030
|
+
providers: providers,
|
|
4031
|
+
track: track
|
|
3745
4032
|
}
|
|
3746
|
-
}, /*#__PURE__*/React.createElement(ClosableProvider, {
|
|
4033
|
+
}, /*#__PURE__*/React.createElement(UpdatableProvider, null, /*#__PURE__*/React.createElement(ClosableProvider, {
|
|
3747
4034
|
unmount: unmount
|
|
3748
|
-
}, /*#__PURE__*/React.createElement(
|
|
4035
|
+
}, /*#__PURE__*/React.createElement(WalletProvider, {
|
|
3749
4036
|
document: document,
|
|
3750
4037
|
container: container,
|
|
3751
4038
|
connected: connected,
|
|
@@ -3757,13 +4044,15 @@ var Payment = /*#__PURE__*/function () {
|
|
|
3757
4044
|
whitelist: whitelist,
|
|
3758
4045
|
blacklist: blacklist,
|
|
3759
4046
|
event: event
|
|
4047
|
+
}, /*#__PURE__*/React.createElement(TrackingProvider, {
|
|
4048
|
+
document: ensureDocument(document)
|
|
3760
4049
|
}, /*#__PURE__*/React.createElement(PaymentProvider, {
|
|
3761
4050
|
container: container,
|
|
3762
4051
|
document: document
|
|
3763
4052
|
}, /*#__PURE__*/React.createElement(PaymentValueProvider, null, /*#__PURE__*/React.createElement(PaymentStack, {
|
|
3764
4053
|
document: document,
|
|
3765
4054
|
container: container
|
|
3766
|
-
})))))))))));
|
|
4055
|
+
}), /*#__PURE__*/React.createElement(PoweredBy, null))))))))))));
|
|
3767
4056
|
};
|
|
3768
4057
|
});
|
|
3769
4058
|
return _context2.abrupt("return", {
|
|
@@ -3873,9 +4162,9 @@ var SaleRoutingProvider = (function (props) {
|
|
|
3873
4162
|
var SaleOverviewSkeleton = (function (props) {
|
|
3874
4163
|
return /*#__PURE__*/React.createElement(Dialog$1, {
|
|
3875
4164
|
header: /*#__PURE__*/React.createElement("div", {
|
|
3876
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
4165
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
3877
4166
|
}, /*#__PURE__*/React.createElement("h1", {
|
|
3878
|
-
className: "LineHeightL FontSizeL
|
|
4167
|
+
className: "LineHeightL FontSizeL"
|
|
3879
4168
|
}, "Purchase")),
|
|
3880
4169
|
body: /*#__PURE__*/React.createElement("div", {
|
|
3881
4170
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -3892,7 +4181,7 @@ var SaleOverviewSkeleton = (function (props) {
|
|
|
3892
4181
|
className: "SkeletonBackground"
|
|
3893
4182
|
}))),
|
|
3894
4183
|
footer: /*#__PURE__*/React.createElement("div", {
|
|
3895
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
4184
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
3896
4185
|
}, /*#__PURE__*/React.createElement("div", {
|
|
3897
4186
|
className: "SkeletonWrapper"
|
|
3898
4187
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -3904,98 +4193,31 @@ var SaleOverviewSkeleton = (function (props) {
|
|
|
3904
4193
|
});
|
|
3905
4194
|
|
|
3906
4195
|
var SaleOverviewDialog = (function (props) {
|
|
3907
|
-
var _useContext = useContext(ChangableAmountContext)
|
|
3908
|
-
|
|
4196
|
+
var _useContext = useContext(ChangableAmountContext);
|
|
4197
|
+
_useContext.amount;
|
|
3909
4198
|
|
|
3910
4199
|
var _useContext2 = useContext(ConfigurationContext),
|
|
3911
|
-
|
|
4200
|
+
tokenImage = _useContext2.tokenImage;
|
|
3912
4201
|
|
|
3913
4202
|
var _useContext3 = useContext(PaymentValueContext),
|
|
3914
4203
|
paymentValue = _useContext3.paymentValue;
|
|
3915
4204
|
|
|
3916
4205
|
var _useContext4 = useContext(PaymentContext),
|
|
3917
4206
|
payment = _useContext4.payment,
|
|
3918
|
-
paymentState = _useContext4.paymentState
|
|
3919
|
-
pay = _useContext4.pay,
|
|
3920
|
-
transaction = _useContext4.transaction,
|
|
3921
|
-
approve = _useContext4.approve,
|
|
3922
|
-
approvalTransaction = _useContext4.approvalTransaction;
|
|
4207
|
+
paymentState = _useContext4.paymentState;
|
|
3923
4208
|
|
|
3924
4209
|
var _useContext5 = useContext(NavigateStackContext),
|
|
3925
4210
|
navigate = _useContext5.navigate;
|
|
3926
4211
|
|
|
3927
|
-
var _useContext6 = useContext(
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
var _useContext7 = useContext(ToTokenContext),
|
|
3931
|
-
toToken = _useContext7.toToken,
|
|
3932
|
-
toTokenReadableAmount = _useContext7.toTokenReadableAmount;
|
|
4212
|
+
var _useContext6 = useContext(ToTokenContext),
|
|
4213
|
+
toToken = _useContext6.toToken,
|
|
4214
|
+
toTokenReadableAmount = _useContext6.toTokenReadableAmount;
|
|
3933
4215
|
|
|
3934
4216
|
var _useState = useState(),
|
|
3935
4217
|
_useState2 = _slicedToArray(_useState, 2),
|
|
3936
4218
|
salePerTokenValue = _useState2[0],
|
|
3937
4219
|
setSalePerTokenValue = _useState2[1];
|
|
3938
4220
|
|
|
3939
|
-
var mainAction = function mainAction() {
|
|
3940
|
-
if (paymentState == 'initialized' || paymentState == 'approving') {
|
|
3941
|
-
return /*#__PURE__*/React.createElement("button", {
|
|
3942
|
-
className: ["ButtonPrimary", payment.route.approvalRequired && !payment.route.directTransfer ? 'disabled' : ''].join(' '),
|
|
3943
|
-
onClick: function onClick() {
|
|
3944
|
-
if (payment.route.approvalRequired && !payment.route.directTransfer) {
|
|
3945
|
-
return;
|
|
3946
|
-
}
|
|
3947
|
-
|
|
3948
|
-
pay({
|
|
3949
|
-
navigate: navigate
|
|
3950
|
-
});
|
|
3951
|
-
}
|
|
3952
|
-
}, "Pay ", new Currency({
|
|
3953
|
-
amount: amount.toFixed(2),
|
|
3954
|
-
code: currencyCode
|
|
3955
|
-
}).toString());
|
|
3956
|
-
} else if (paymentState == 'paying') {
|
|
3957
|
-
return /*#__PURE__*/React.createElement("a", {
|
|
3958
|
-
className: "ButtonPrimary",
|
|
3959
|
-
title: "Performing the payment - please wait",
|
|
3960
|
-
href: transaction === null || transaction === void 0 ? void 0 : transaction.url,
|
|
3961
|
-
target: "_blank",
|
|
3962
|
-
rel: "noopener noreferrer"
|
|
3963
|
-
}, /*#__PURE__*/React.createElement(LoadingText, null, "Paying"));
|
|
3964
|
-
} else if (paymentState == 'confirmed') {
|
|
3965
|
-
return /*#__PURE__*/React.createElement("button", {
|
|
3966
|
-
className: "ButtonPrimary round",
|
|
3967
|
-
title: "Done",
|
|
3968
|
-
onClick: close
|
|
3969
|
-
}, /*#__PURE__*/React.createElement(Checkmark, null));
|
|
3970
|
-
}
|
|
3971
|
-
};
|
|
3972
|
-
|
|
3973
|
-
var approvalAction = function approvalAction() {
|
|
3974
|
-
if (paymentState == 'initialized') {
|
|
3975
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
3976
|
-
className: "PaddingBottomS"
|
|
3977
|
-
}, /*#__PURE__*/React.createElement("button", {
|
|
3978
|
-
className: "ButtonPrimary wide",
|
|
3979
|
-
onClick: approve,
|
|
3980
|
-
title: "Allow ".concat(payment.symbol, " to be used as payment")
|
|
3981
|
-
}, "Allow ", payment.symbol, " to be used as payment"));
|
|
3982
|
-
} else if (paymentState == 'approving') {
|
|
3983
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
3984
|
-
className: "PaddingBottomS"
|
|
3985
|
-
}, /*#__PURE__*/React.createElement("a", {
|
|
3986
|
-
className: "ButtonPrimary wide",
|
|
3987
|
-
title: "Approving payment token - please wait",
|
|
3988
|
-
href: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
|
|
3989
|
-
target: "_blank",
|
|
3990
|
-
rel: "noopener noreferrer"
|
|
3991
|
-
}, /*#__PURE__*/React.createElement(LoadingText, null, "Approving")));
|
|
3992
|
-
}
|
|
3993
|
-
};
|
|
3994
|
-
|
|
3995
|
-
var actions = function actions() {
|
|
3996
|
-
return /*#__PURE__*/React.createElement("div", null, payment.route.approvalRequired && !payment.route.directTransfer && approvalAction(), mainAction());
|
|
3997
|
-
};
|
|
3998
|
-
|
|
3999
4221
|
useEffect(function () {
|
|
4000
4222
|
if (paymentValue) {
|
|
4001
4223
|
setSalePerTokenValue(new Currency({
|
|
@@ -4009,11 +4231,24 @@ var SaleOverviewDialog = (function (props) {
|
|
|
4009
4231
|
return /*#__PURE__*/React.createElement(SaleOverviewSkeleton, null);
|
|
4010
4232
|
}
|
|
4011
4233
|
|
|
4234
|
+
var tokenImageElement;
|
|
4235
|
+
|
|
4236
|
+
if (tokenImage) {
|
|
4237
|
+
tokenImageElement = /*#__PURE__*/React.createElement("img", {
|
|
4238
|
+
src: tokenImage
|
|
4239
|
+
});
|
|
4240
|
+
} else {
|
|
4241
|
+
tokenImageElement = /*#__PURE__*/React.createElement(TokenImage, {
|
|
4242
|
+
blockchain: payment.route.blockchain,
|
|
4243
|
+
address: toToken.address
|
|
4244
|
+
});
|
|
4245
|
+
}
|
|
4246
|
+
|
|
4012
4247
|
return /*#__PURE__*/React.createElement(Dialog$1, {
|
|
4013
4248
|
header: /*#__PURE__*/React.createElement("div", {
|
|
4014
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
4249
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
4015
4250
|
}, /*#__PURE__*/React.createElement("h1", {
|
|
4016
|
-
className: "LineHeightL FontSizeL
|
|
4251
|
+
className: "LineHeightL FontSizeL"
|
|
4017
4252
|
}, "Purchase")),
|
|
4018
4253
|
body: /*#__PURE__*/React.createElement("div", {
|
|
4019
4254
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -4030,10 +4265,7 @@ var SaleOverviewDialog = (function (props) {
|
|
|
4030
4265
|
}, /*#__PURE__*/React.createElement("div", {
|
|
4031
4266
|
className: "CardImage",
|
|
4032
4267
|
title: payment.name
|
|
4033
|
-
}, /*#__PURE__*/React.createElement(
|
|
4034
|
-
blockchain: payment.route.blockchain,
|
|
4035
|
-
address: toToken.address
|
|
4036
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
4268
|
+
}, tokenImageElement), /*#__PURE__*/React.createElement("div", {
|
|
4037
4269
|
className: "CardBody"
|
|
4038
4270
|
}, /*#__PURE__*/React.createElement("div", {
|
|
4039
4271
|
className: "CardBodyWrapper"
|
|
@@ -4085,8 +4317,8 @@ var SaleOverviewDialog = (function (props) {
|
|
|
4085
4317
|
className: "CardAction"
|
|
4086
4318
|
}, /*#__PURE__*/React.createElement(ChevronRight, null)))),
|
|
4087
4319
|
footer: /*#__PURE__*/React.createElement("div", {
|
|
4088
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
4089
|
-
},
|
|
4320
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
4321
|
+
}, /*#__PURE__*/React.createElement(Footer, null))
|
|
4090
4322
|
});
|
|
4091
4323
|
});
|
|
4092
4324
|
|
|
@@ -4159,12 +4391,12 @@ var preflight = /*#__PURE__*/function () {
|
|
|
4159
4391
|
|
|
4160
4392
|
var Sale = /*#__PURE__*/function () {
|
|
4161
4393
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(_ref3) {
|
|
4162
|
-
var amount, sell, sent, confirmed,
|
|
4394
|
+
var amount, sell, sent, confirmed, failed, error, critical, style, blacklist, providers, currency, connected, closed, tokenImage, document, accept, unmount;
|
|
4163
4395
|
return regenerator.wrap(function _callee2$(_context2) {
|
|
4164
4396
|
while (1) {
|
|
4165
4397
|
switch (_context2.prev = _context2.next) {
|
|
4166
4398
|
case 0:
|
|
4167
|
-
amount = _ref3.amount, sell = _ref3.sell, sent = _ref3.sent, confirmed = _ref3.confirmed,
|
|
4399
|
+
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;
|
|
4168
4400
|
_context2.prev = 1;
|
|
4169
4401
|
_context2.next = 4;
|
|
4170
4402
|
return preflight({
|
|
@@ -4190,31 +4422,33 @@ var Sale = /*#__PURE__*/function () {
|
|
|
4190
4422
|
unmount: unmount
|
|
4191
4423
|
}, /*#__PURE__*/React.createElement(ConfigurationProvider, {
|
|
4192
4424
|
configuration: {
|
|
4425
|
+
tokenImage: tokenImage,
|
|
4193
4426
|
amount: amount,
|
|
4194
4427
|
sell: sell,
|
|
4195
4428
|
currency: currency,
|
|
4196
4429
|
sent: sent,
|
|
4197
4430
|
confirmed: confirmed,
|
|
4198
|
-
ensured: ensured,
|
|
4199
4431
|
failed: failed,
|
|
4200
4432
|
blacklist: blacklist,
|
|
4201
4433
|
providers: providers
|
|
4202
4434
|
}
|
|
4203
|
-
}, /*#__PURE__*/React.createElement(ClosableProvider, {
|
|
4435
|
+
}, /*#__PURE__*/React.createElement(UpdatableProvider, null, /*#__PURE__*/React.createElement(ClosableProvider, {
|
|
4204
4436
|
unmount: unmount
|
|
4205
|
-
}, /*#__PURE__*/React.createElement(
|
|
4437
|
+
}, /*#__PURE__*/React.createElement(WalletProvider, {
|
|
4206
4438
|
container: container,
|
|
4207
4439
|
connected: connected,
|
|
4208
4440
|
unmount: unmount
|
|
4209
4441
|
}, /*#__PURE__*/React.createElement(ConversionRateProvider, null, /*#__PURE__*/React.createElement(ChangableAmountProvider, {
|
|
4210
4442
|
accept: accept
|
|
4443
|
+
}, /*#__PURE__*/React.createElement(TrackingProvider, {
|
|
4444
|
+
document: ensureDocument(document)
|
|
4211
4445
|
}, /*#__PURE__*/React.createElement(SaleRoutingProvider, {
|
|
4212
4446
|
container: container,
|
|
4213
4447
|
document: document
|
|
4214
4448
|
}, /*#__PURE__*/React.createElement(SaleStack, {
|
|
4215
4449
|
document: document,
|
|
4216
4450
|
container: container
|
|
4217
|
-
})))))))));
|
|
4451
|
+
}), /*#__PURE__*/React.createElement(PoweredBy, null))))))))));
|
|
4218
4452
|
};
|
|
4219
4453
|
});
|
|
4220
4454
|
return _context2.abrupt("return", {
|