@depay/widgets 4.4.0 → 5.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -57
- package/dist/cjs/index.bundle.js +1427 -594
- package/dist/cjs/index.js +613 -387
- package/dist/es/index.bundle.js +1427 -594
- package/dist/es/index.js +614 -388
- package/dist/umd/index.bundle.js +1427 -594
- package/dist/umd/index.js +613 -387
- package/package.json +8 -7
package/dist/es/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { Decimal } from 'decimal.js';
|
|
|
9
9
|
import { route } from '@depay/web3-exchanges';
|
|
10
10
|
import { Token } from '@depay/web3-tokens';
|
|
11
11
|
import { Currency } from '@depay/local-currency';
|
|
12
|
-
import { setProviderEndpoints, provider } from '@depay/web3-client';
|
|
12
|
+
import { setProviderEndpoints, request, provider } from '@depay/web3-client';
|
|
13
13
|
import { route as route$1 } from '@depay/web3-payments';
|
|
14
14
|
import Slider from 'react-rangeslider';
|
|
15
15
|
import { TokenImage } from '@depay/react-token-image';
|
|
@@ -54,17 +54,11 @@ function _asyncToGenerator(fn) {
|
|
|
54
54
|
function _typeof(obj) {
|
|
55
55
|
"@babel/helpers - typeof";
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
_typeof = function _typeof(obj) {
|
|
63
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return _typeof(obj);
|
|
57
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
58
|
+
return typeof obj;
|
|
59
|
+
} : function (obj) {
|
|
60
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
61
|
+
}, _typeof(obj);
|
|
68
62
|
}
|
|
69
63
|
|
|
70
64
|
function createCommonjsModule(fn) {
|
|
@@ -893,6 +887,8 @@ function _slicedToArray(arr, i) {
|
|
|
893
887
|
|
|
894
888
|
var ClosableContext = /*#__PURE__*/React.createContext();
|
|
895
889
|
|
|
890
|
+
var UpdatableContext = /*#__PURE__*/React.createContext();
|
|
891
|
+
|
|
896
892
|
var ClosableProvider = (function (props) {
|
|
897
893
|
var _useState = useState(true),
|
|
898
894
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -904,11 +900,15 @@ var ClosableProvider = (function (props) {
|
|
|
904
900
|
open = _useState4[0],
|
|
905
901
|
setOpen = _useState4[1];
|
|
906
902
|
|
|
903
|
+
var _useContext = useContext(UpdatableContext),
|
|
904
|
+
setUpdatable = _useContext.setUpdatable;
|
|
905
|
+
|
|
907
906
|
var close = function close() {
|
|
908
907
|
if (!closable) {
|
|
909
908
|
return;
|
|
910
909
|
}
|
|
911
910
|
|
|
911
|
+
setUpdatable(false);
|
|
912
912
|
setOpen(false);
|
|
913
913
|
setTimeout(props.unmount, 300);
|
|
914
914
|
};
|
|
@@ -992,12 +992,7 @@ var Dialog$1 = (function (props) {
|
|
|
992
992
|
className: "DialogBody"
|
|
993
993
|
}, props.body), /*#__PURE__*/React.createElement("div", {
|
|
994
994
|
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")));
|
|
995
|
+
}, props.footer));
|
|
1001
996
|
});
|
|
1002
997
|
|
|
1003
998
|
var ConnectingWalletDialog = (function (props) {
|
|
@@ -1047,9 +1042,9 @@ var ConnectingWalletDialog = (function (props) {
|
|
|
1047
1042
|
className: "TextButton"
|
|
1048
1043
|
}, "Connect with another wallet")))),
|
|
1049
1044
|
footer: /*#__PURE__*/React.createElement("div", {
|
|
1050
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
1045
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
1051
1046
|
}, /*#__PURE__*/React.createElement("button", {
|
|
1052
|
-
className: "ButtonPrimary
|
|
1047
|
+
className: "ButtonPrimary",
|
|
1053
1048
|
onClick: function onClick() {
|
|
1054
1049
|
return props.connect(wallet);
|
|
1055
1050
|
}
|
|
@@ -1132,7 +1127,7 @@ var SelectWalletDialog = (function (props) {
|
|
|
1132
1127
|
return connect(wallet);
|
|
1133
1128
|
}
|
|
1134
1129
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1135
|
-
className: "CardImage
|
|
1130
|
+
className: "CardImage"
|
|
1136
1131
|
}, /*#__PURE__*/React.createElement("img", {
|
|
1137
1132
|
src: wallet.logo
|
|
1138
1133
|
})), /*#__PURE__*/React.createElement("div", {
|
|
@@ -1145,9 +1140,9 @@ var SelectWalletDialog = (function (props) {
|
|
|
1145
1140
|
});
|
|
1146
1141
|
return /*#__PURE__*/React.createElement(Dialog$1, {
|
|
1147
1142
|
header: /*#__PURE__*/React.createElement("div", {
|
|
1148
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
1143
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
1149
1144
|
}, /*#__PURE__*/React.createElement("h1", {
|
|
1150
|
-
className: "LineHeightL FontSizeL
|
|
1145
|
+
className: "LineHeightL FontSizeL"
|
|
1151
1146
|
}, "Select a wallet")),
|
|
1152
1147
|
body: /*#__PURE__*/React.createElement("div", {
|
|
1153
1148
|
className: "PaddingTopS PaddingBottomXS PaddingLeftS PaddingRightS"
|
|
@@ -1155,11 +1150,13 @@ var SelectWalletDialog = (function (props) {
|
|
|
1155
1150
|
footer: /*#__PURE__*/React.createElement("div", {
|
|
1156
1151
|
className: "PaddingBottomS"
|
|
1157
1152
|
}, /*#__PURE__*/React.createElement("button", {
|
|
1158
|
-
className: "FontSizeS FontWeightBold
|
|
1153
|
+
className: "FontSizeS FontWeightBold TextButton",
|
|
1159
1154
|
onClick: function onClick() {
|
|
1160
1155
|
return setShowExplanation(!showExplanation);
|
|
1161
1156
|
}
|
|
1162
|
-
}, /*#__PURE__*/React.createElement("strong",
|
|
1157
|
+
}, /*#__PURE__*/React.createElement("strong", {
|
|
1158
|
+
className: "Opacity05"
|
|
1159
|
+
}, "What is a wallet?")), showExplanation && /*#__PURE__*/React.createElement("p", {
|
|
1163
1160
|
className: "PaddingLeftM PaddingRightM"
|
|
1164
1161
|
}, "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
1162
|
});
|
|
@@ -1312,6 +1309,9 @@ function _defineProperties(target, props) {
|
|
|
1312
1309
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
1313
1310
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
1314
1311
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
1312
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
1313
|
+
writable: false
|
|
1314
|
+
});
|
|
1315
1315
|
return Constructor;
|
|
1316
1316
|
}
|
|
1317
1317
|
|
|
@@ -1329,12 +1329,15 @@ function _inherits(subClass, superClass) {
|
|
|
1329
1329
|
throw new TypeError("Super expression must either be null or a function");
|
|
1330
1330
|
}
|
|
1331
1331
|
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1332
|
+
Object.defineProperty(subClass, "prototype", {
|
|
1333
|
+
value: Object.create(superClass && superClass.prototype, {
|
|
1334
|
+
constructor: {
|
|
1335
|
+
value: subClass,
|
|
1336
|
+
writable: true,
|
|
1337
|
+
configurable: true
|
|
1338
|
+
}
|
|
1339
|
+
}),
|
|
1340
|
+
writable: false
|
|
1338
1341
|
});
|
|
1339
1342
|
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
1340
1343
|
}
|
|
@@ -1613,7 +1616,7 @@ var ErrorProvider = (function (props) {
|
|
|
1613
1616
|
})), /*#__PURE__*/React.createElement("div", {
|
|
1614
1617
|
className: "DialogBody"
|
|
1615
1618
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1616
|
-
className: "GraphicWrapper"
|
|
1619
|
+
className: "GraphicWrapper PaddingTopS"
|
|
1617
1620
|
}, /*#__PURE__*/React.createElement("img", {
|
|
1618
1621
|
className: "Graphic",
|
|
1619
1622
|
src: ErrorGraphic
|
|
@@ -1631,15 +1634,12 @@ var ErrorProvider = (function (props) {
|
|
|
1631
1634
|
className: "FontSizeM PaddingTopS"
|
|
1632
1635
|
}, "If this keeps happening, please report it.")))), /*#__PURE__*/React.createElement("div", {
|
|
1633
1636
|
className: "DialogFooter"
|
|
1634
|
-
}, /*#__PURE__*/React.createElement("div",
|
|
1637
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
1638
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
1639
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
1635
1640
|
className: "ButtonPrimary",
|
|
1636
1641
|
onClick: close
|
|
1637
|
-
}, "Try again"))
|
|
1638
|
-
href: 'https://depay.fi?utm_source=' + window.location.hostname + '&utm_medium=widget&utm_campaign=WidgetV2',
|
|
1639
|
-
rel: "noopener noreferrer",
|
|
1640
|
-
target: "_blank",
|
|
1641
|
-
className: "FooterLink"
|
|
1642
|
-
}, "by DePay"))));
|
|
1642
|
+
}, "Try again")))));
|
|
1643
1643
|
} else {
|
|
1644
1644
|
return /*#__PURE__*/React.createElement(ErrorContext.Provider, {
|
|
1645
1645
|
value: {
|
|
@@ -1651,28 +1651,28 @@ var ErrorProvider = (function (props) {
|
|
|
1651
1651
|
}
|
|
1652
1652
|
});
|
|
1653
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
|
+
|
|
1654
1658
|
var ButtonCircularStyle = (function () {
|
|
1655
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 ";
|
|
1656
1660
|
});
|
|
1657
1661
|
|
|
1658
1662
|
var ButtonPrimaryStyle = (function (style) {
|
|
1659
|
-
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 ");
|
|
1660
1664
|
});
|
|
1661
1665
|
|
|
1662
1666
|
var CardStyle = (function (style) {
|
|
1663
|
-
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 ");
|
|
1664
1668
|
});
|
|
1665
1669
|
|
|
1666
1670
|
var DialogStyle = (function (style) {
|
|
1667
|
-
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 ";
|
|
1668
1672
|
});
|
|
1669
1673
|
|
|
1670
1674
|
var FontStyle = (function (style) {
|
|
1671
|
-
return "\n\n
|
|
1672
|
-
});
|
|
1673
|
-
|
|
1674
|
-
var FooterStyle = (function (style) {
|
|
1675
|
-
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 ");
|
|
1676
1676
|
});
|
|
1677
1677
|
|
|
1678
1678
|
var GraphicStyle = (function () {
|
|
@@ -1684,7 +1684,7 @@ var HeightStyle = (function () {
|
|
|
1684
1684
|
});
|
|
1685
1685
|
|
|
1686
1686
|
var IconStyle = (function (style) {
|
|
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:
|
|
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 ");
|
|
1688
1688
|
});
|
|
1689
1689
|
|
|
1690
1690
|
var ImageStyle = (function (style) {
|
|
@@ -1703,10 +1703,18 @@ var LoadingTextStyle = (function (style) {
|
|
|
1703
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 ");
|
|
1704
1704
|
});
|
|
1705
1705
|
|
|
1706
|
+
var OpacityStyle = (function (style) {
|
|
1707
|
+
return "\n\n .Opacity05 {\n opacity: 0.5;\n }\n ";
|
|
1708
|
+
});
|
|
1709
|
+
|
|
1706
1710
|
var PaddingStyle = (function () {
|
|
1707
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 ";
|
|
1708
1712
|
});
|
|
1709
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 font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\" !important;\n color: white;\n opacity: 0.4;\n display: inline-block;\n font-size: 0.78rem;\n font-style: italic;\n font-weight: bold;\n letter-spacing: -0.2px;\n margin-left: 0.5rem;\n text-decoration: none;\n }\n\n .PoweredByLink:hover, .PoweredByLink:active {\n opacity: 1.0;\n color: ".concat(style.colors.primary, ";\n }\n ");
|
|
1716
|
+
});
|
|
1717
|
+
|
|
1710
1718
|
var RangeSliderStyle = (function (style) {
|
|
1711
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 ";
|
|
1712
1720
|
});
|
|
@@ -1716,15 +1724,15 @@ var ResetStyle = (function () {
|
|
|
1716
1724
|
});
|
|
1717
1725
|
|
|
1718
1726
|
var SkeletonStyle = (function () {
|
|
1719
|
-
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 ";
|
|
1720
1728
|
});
|
|
1721
1729
|
|
|
1722
1730
|
var TextButtonStyle = (function (style) {
|
|
1723
|
-
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 ");
|
|
1724
1732
|
});
|
|
1725
1733
|
|
|
1726
1734
|
var TextStyle = (function (style) {
|
|
1727
|
-
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 ");
|
|
1728
1736
|
});
|
|
1729
1737
|
|
|
1730
1738
|
var TokenAmountStyle = (function () {
|
|
@@ -1741,7 +1749,7 @@ var styleRenderer = (function (style) {
|
|
|
1741
1749
|
},
|
|
1742
1750
|
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'
|
|
1743
1751
|
}, style);
|
|
1744
|
-
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('');
|
|
1745
1753
|
});
|
|
1746
1754
|
|
|
1747
1755
|
var mount = (function (_ref, content) {
|
|
@@ -1777,6 +1785,31 @@ var mount = (function (_ref, content) {
|
|
|
1777
1785
|
return unmount;
|
|
1778
1786
|
});
|
|
1779
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
|
+
|
|
1780
1813
|
var Connect = function Connect(options) {
|
|
1781
1814
|
var style, error, document;
|
|
1782
1815
|
|
|
@@ -1832,7 +1865,7 @@ var Connect = function Connect(options) {
|
|
|
1832
1865
|
error: error,
|
|
1833
1866
|
container: container,
|
|
1834
1867
|
unmount: unmount
|
|
1835
|
-
}, /*#__PURE__*/React.createElement(ClosableProvider, {
|
|
1868
|
+
}, /*#__PURE__*/React.createElement(UpdatableProvider, null, /*#__PURE__*/React.createElement(ClosableProvider, {
|
|
1836
1869
|
unmount: rejectBeforeUnmount
|
|
1837
1870
|
}, /*#__PURE__*/React.createElement(ConnectStack, {
|
|
1838
1871
|
document: document,
|
|
@@ -1840,7 +1873,7 @@ var Connect = function Connect(options) {
|
|
|
1840
1873
|
resolve: resolve,
|
|
1841
1874
|
reject: reject,
|
|
1842
1875
|
autoClose: true
|
|
1843
|
-
})));
|
|
1876
|
+
}), /*#__PURE__*/React.createElement(PoweredBy, null))));
|
|
1844
1877
|
};
|
|
1845
1878
|
});
|
|
1846
1879
|
|
|
@@ -2020,12 +2053,18 @@ var ChangableAmountProvider = (function (props) {
|
|
|
2020
2053
|
});
|
|
2021
2054
|
})).then(function (amounts) {
|
|
2022
2055
|
setAcceptWithAmount(props.accept.map(function (configuration, index) {
|
|
2056
|
+
if (amounts[index] == undefined) {
|
|
2057
|
+
return;
|
|
2058
|
+
}
|
|
2059
|
+
|
|
2023
2060
|
return {
|
|
2024
2061
|
blockchain: configuration.blockchain,
|
|
2025
|
-
amount: round(amounts[index])
|
|
2062
|
+
amount: round(amounts[index]),
|
|
2026
2063
|
token: configuration.token,
|
|
2027
2064
|
receiver: configuration.receiver || account
|
|
2028
2065
|
};
|
|
2066
|
+
}).filter(function (configuration) {
|
|
2067
|
+
return !!configuration;
|
|
2029
2068
|
}));
|
|
2030
2069
|
})["catch"](setError);
|
|
2031
2070
|
})["catch"](setError);
|
|
@@ -2147,7 +2186,9 @@ var NoPaymentMethodFoundDialog = (function () {
|
|
|
2147
2186
|
}, /*#__PURE__*/React.createElement("strong", {
|
|
2148
2187
|
className: "FontSizeM"
|
|
2149
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."))),
|
|
2150
|
-
footer: /*#__PURE__*/React.createElement("div",
|
|
2189
|
+
footer: /*#__PURE__*/React.createElement("div", {
|
|
2190
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
2191
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
2151
2192
|
className: "ButtonPrimary",
|
|
2152
2193
|
onClick: close
|
|
2153
2194
|
}, "Ok"))
|
|
@@ -2158,7 +2199,7 @@ var PaymentContext = /*#__PURE__*/React.createContext();
|
|
|
2158
2199
|
|
|
2159
2200
|
var PaymentRoutingContext = /*#__PURE__*/React.createContext();
|
|
2160
2201
|
|
|
2161
|
-
var
|
|
2202
|
+
var TrackingContext = /*#__PURE__*/React.createContext();
|
|
2162
2203
|
|
|
2163
2204
|
var PaymentProvider = (function (props) {
|
|
2164
2205
|
var _useContext = useContext(ErrorContext),
|
|
@@ -2167,7 +2208,6 @@ var PaymentProvider = (function (props) {
|
|
|
2167
2208
|
var _useContext2 = useContext(ConfigurationContext),
|
|
2168
2209
|
_sent = _useContext2.sent,
|
|
2169
2210
|
_confirmed = _useContext2.confirmed,
|
|
2170
|
-
_ensured = _useContext2.ensured,
|
|
2171
2211
|
_failed = _useContext2.failed;
|
|
2172
2212
|
|
|
2173
2213
|
var _useContext3 = useContext(PaymentRoutingContext),
|
|
@@ -2181,13 +2221,17 @@ var PaymentProvider = (function (props) {
|
|
|
2181
2221
|
var _useContext5 = useContext(PaymentRoutingContext),
|
|
2182
2222
|
allRoutes = _useContext5.allRoutes;
|
|
2183
2223
|
|
|
2184
|
-
var _useContext6 = useContext(
|
|
2185
|
-
_useContext6.
|
|
2186
|
-
var setUpdate = _useContext6.setUpdate;
|
|
2224
|
+
var _useContext6 = useContext(UpdatableContext),
|
|
2225
|
+
setUpdatable = _useContext6.setUpdatable;
|
|
2187
2226
|
|
|
2188
2227
|
var _useContext7 = useContext(WalletContext),
|
|
2189
2228
|
wallet = _useContext7.wallet;
|
|
2190
2229
|
|
|
2230
|
+
var _useContext8 = useContext(TrackingContext),
|
|
2231
|
+
forward = _useContext8.forward,
|
|
2232
|
+
tracking = _useContext8.tracking,
|
|
2233
|
+
initializeTracking = _useContext8.initializeTracking;
|
|
2234
|
+
|
|
2191
2235
|
var _useState = useState(),
|
|
2192
2236
|
_useState2 = _slicedToArray(_useState, 2),
|
|
2193
2237
|
payment = _useState2[0],
|
|
@@ -2208,53 +2252,81 @@ var PaymentProvider = (function (props) {
|
|
|
2208
2252
|
paymentState = _useState8[0],
|
|
2209
2253
|
setPaymentState = _useState8[1];
|
|
2210
2254
|
|
|
2211
|
-
var pay = function
|
|
2212
|
-
var
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
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
|
+
});
|
|
2225
2271
|
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
}
|
|
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
|
+
}
|
|
2239
2284
|
|
|
2240
|
-
|
|
2241
|
-
setClosable(true);
|
|
2242
|
-
setUpdate(true);
|
|
2243
|
-
navigate('PaymentError');
|
|
2244
|
-
}
|
|
2245
|
-
})).then(function (sentTransaction) {
|
|
2246
|
-
setTransaction(sentTransaction);
|
|
2247
|
-
})["catch"](function (error) {
|
|
2248
|
-
console.log('error', error);
|
|
2249
|
-
setPaymentState('initialized');
|
|
2250
|
-
setClosable(true);
|
|
2251
|
-
setUpdate(true);
|
|
2285
|
+
setPaymentState('confirmed');
|
|
2252
2286
|
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
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
|
+
}();
|
|
2258
2330
|
|
|
2259
2331
|
var approve = function approve() {
|
|
2260
2332
|
setClosable(false);
|
|
@@ -2275,15 +2347,20 @@ var PaymentProvider = (function (props) {
|
|
|
2275
2347
|
});
|
|
2276
2348
|
};
|
|
2277
2349
|
|
|
2350
|
+
useEffect(function () {
|
|
2351
|
+
if (forward) {
|
|
2352
|
+
setPaymentState('confirmed');
|
|
2353
|
+
}
|
|
2354
|
+
}, [forward]);
|
|
2278
2355
|
useEffect(function () {
|
|
2279
2356
|
if (selectedRoute) {
|
|
2280
2357
|
var fromToken = selectedRoute.fromToken;
|
|
2281
2358
|
selectedRoute.transaction.params;
|
|
2282
|
-
Promise.all([fromToken.name(), fromToken.symbol(), fromToken.readable(selectedRoute.fromAmount)]).then(function (
|
|
2283
|
-
var
|
|
2284
|
-
name =
|
|
2285
|
-
symbol =
|
|
2286
|
-
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];
|
|
2287
2364
|
|
|
2288
2365
|
setPayment({
|
|
2289
2366
|
route: selectedRoute,
|
|
@@ -2299,9 +2376,9 @@ var PaymentProvider = (function (props) {
|
|
|
2299
2376
|
}, [selectedRoute]);
|
|
2300
2377
|
useEffect(function () {
|
|
2301
2378
|
if (allRoutes && allRoutes.length == 0) {
|
|
2302
|
-
|
|
2379
|
+
setUpdatable(false);
|
|
2303
2380
|
} else if (allRoutes && allRoutes.length > 0) {
|
|
2304
|
-
|
|
2381
|
+
setUpdatable(true);
|
|
2305
2382
|
}
|
|
2306
2383
|
}, [allRoutes]);
|
|
2307
2384
|
|
|
@@ -2345,9 +2422,9 @@ function _defineProperty(obj, key, value) {
|
|
|
2345
2422
|
return obj;
|
|
2346
2423
|
}
|
|
2347
2424
|
|
|
2348
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
2425
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2349
2426
|
|
|
2350
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
2427
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2351
2428
|
var PaymentRoutingProvider = (function (props) {
|
|
2352
2429
|
var _useState = useState(),
|
|
2353
2430
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -2367,8 +2444,8 @@ var PaymentRoutingProvider = (function (props) {
|
|
|
2367
2444
|
var _useContext = useContext(WalletContext),
|
|
2368
2445
|
account = _useContext.account;
|
|
2369
2446
|
|
|
2370
|
-
var _useContext2 = useContext(
|
|
2371
|
-
|
|
2447
|
+
var _useContext2 = useContext(UpdatableContext),
|
|
2448
|
+
updatable = _useContext2.updatable;
|
|
2372
2449
|
|
|
2373
2450
|
var prepareAcceptedPayments = function prepareAcceptedPayments(accept) {
|
|
2374
2451
|
var toAddress = _typeof(accept.receiver) == 'object' ? accept.receiver.address : accept.receiver;
|
|
@@ -2383,9 +2460,9 @@ var PaymentRoutingProvider = (function (props) {
|
|
|
2383
2460
|
var getPaymentRoutes = function getPaymentRoutes(_ref) {
|
|
2384
2461
|
var allRoutes = _ref.allRoutes,
|
|
2385
2462
|
selectedRoute = _ref.selectedRoute,
|
|
2386
|
-
|
|
2463
|
+
updatable = _ref.updatable;
|
|
2387
2464
|
|
|
2388
|
-
if (
|
|
2465
|
+
if (updatable == false || !props.accept || !account) {
|
|
2389
2466
|
return;
|
|
2390
2467
|
}
|
|
2391
2468
|
|
|
@@ -2488,13 +2565,13 @@ var PaymentRoutingProvider = (function (props) {
|
|
|
2488
2565
|
getPaymentRoutes({
|
|
2489
2566
|
allRoutes: allRoutes,
|
|
2490
2567
|
selectedRoute: selectedRoute,
|
|
2491
|
-
|
|
2568
|
+
updatable: updatable
|
|
2492
2569
|
});
|
|
2493
2570
|
}, 15000);
|
|
2494
2571
|
return function () {
|
|
2495
2572
|
return clearTimeout(timeout);
|
|
2496
2573
|
};
|
|
2497
|
-
}, [reloadCount, allRoutes, selectedRoute,
|
|
2574
|
+
}, [reloadCount, allRoutes, selectedRoute, updatable]);
|
|
2498
2575
|
useEffect(function () {
|
|
2499
2576
|
if (account && props.accept) {
|
|
2500
2577
|
setAllRoutes(undefined);
|
|
@@ -2524,8 +2601,8 @@ var PaymentValueProvider = (function (props) {
|
|
|
2524
2601
|
var _useContext2 = useContext(WalletContext),
|
|
2525
2602
|
account = _useContext2.account;
|
|
2526
2603
|
|
|
2527
|
-
var _useContext3 = useContext(
|
|
2528
|
-
|
|
2604
|
+
var _useContext3 = useContext(UpdatableContext),
|
|
2605
|
+
updatable = _useContext3.updatable;
|
|
2529
2606
|
|
|
2530
2607
|
var _useContext4 = useContext(PaymentContext),
|
|
2531
2608
|
payment = _useContext4.payment;
|
|
@@ -2544,10 +2621,10 @@ var PaymentValueProvider = (function (props) {
|
|
|
2544
2621
|
setReloadCount = _useState4[1];
|
|
2545
2622
|
|
|
2546
2623
|
var getToTokenLocalValue = function getToTokenLocalValue(_ref) {
|
|
2547
|
-
var
|
|
2624
|
+
var updatable = _ref.updatable,
|
|
2548
2625
|
payment = _ref.payment;
|
|
2549
2626
|
|
|
2550
|
-
if (
|
|
2627
|
+
if (updatable == false || (payment === null || payment === void 0 ? void 0 : payment.route) == undefined) {
|
|
2551
2628
|
return;
|
|
2552
2629
|
}
|
|
2553
2630
|
|
|
@@ -2590,7 +2667,7 @@ var PaymentValueProvider = (function (props) {
|
|
|
2590
2667
|
useEffect(function () {
|
|
2591
2668
|
if (account && payment) {
|
|
2592
2669
|
getToTokenLocalValue({
|
|
2593
|
-
|
|
2670
|
+
updatable: updatable,
|
|
2594
2671
|
payment: payment
|
|
2595
2672
|
});
|
|
2596
2673
|
}
|
|
@@ -2599,13 +2676,13 @@ var PaymentValueProvider = (function (props) {
|
|
|
2599
2676
|
var timeout = setTimeout(function () {
|
|
2600
2677
|
setReloadCount(reloadCount + 1);
|
|
2601
2678
|
getToTokenLocalValue({
|
|
2602
|
-
|
|
2679
|
+
updatable: updatable
|
|
2603
2680
|
});
|
|
2604
2681
|
}, 15000);
|
|
2605
2682
|
return function () {
|
|
2606
2683
|
return clearTimeout(timeout);
|
|
2607
2684
|
};
|
|
2608
|
-
}, [reloadCount,
|
|
2685
|
+
}, [reloadCount, updatable]);
|
|
2609
2686
|
return /*#__PURE__*/React.createElement(PaymentValueContext.Provider, {
|
|
2610
2687
|
value: {
|
|
2611
2688
|
paymentValue: paymentValue
|
|
@@ -2760,7 +2837,9 @@ var ChangeAmountDialog = (function (props) {
|
|
|
2760
2837
|
changeAmount(toValidValue(maxAmount));
|
|
2761
2838
|
}
|
|
2762
2839
|
}, "(Max)")))))),
|
|
2763
|
-
footer: /*#__PURE__*/React.createElement("div",
|
|
2840
|
+
footer: /*#__PURE__*/React.createElement("div", {
|
|
2841
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
2842
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
2764
2843
|
className: "ButtonPrimary",
|
|
2765
2844
|
onClick: changeAmountAndGoBack
|
|
2766
2845
|
}, "Done"))
|
|
@@ -2847,6 +2926,7 @@ var ChangePaymentDialog = (function (props) {
|
|
|
2847
2926
|
}, [allRoutes]);
|
|
2848
2927
|
useEffect(function () {
|
|
2849
2928
|
setCards(allPaymentRoutesWithData.map(function (payment, index) {
|
|
2929
|
+
var blockchain = Blockchain.findByName(payment.route.blockchain);
|
|
2850
2930
|
return /*#__PURE__*/React.createElement("div", {
|
|
2851
2931
|
key: index,
|
|
2852
2932
|
className: "Card",
|
|
@@ -2860,6 +2940,11 @@ var ChangePaymentDialog = (function (props) {
|
|
|
2860
2940
|
}, /*#__PURE__*/React.createElement(TokenImage, {
|
|
2861
2941
|
blockchain: payment.route.blockchain,
|
|
2862
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
|
|
2863
2948
|
})), /*#__PURE__*/React.createElement("div", {
|
|
2864
2949
|
className: "CardBody"
|
|
2865
2950
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -2874,11 +2959,7 @@ var ChangePaymentDialog = (function (props) {
|
|
|
2874
2959
|
className: "TokenAmountCell"
|
|
2875
2960
|
}, format(payment.amount)))), /*#__PURE__*/React.createElement("h3", {
|
|
2876
2961
|
className: "CardText"
|
|
2877
|
-
}, /*#__PURE__*/React.createElement("small", null, format(round(parseFloat(payment.route.fromBalance.toString()) / Math.pow(10, payment.decimals), 'down'))))))
|
|
2878
|
-
className: "CardInfo"
|
|
2879
|
-
}, payment.route.approvalRequired && /*#__PURE__*/React.createElement("span", {
|
|
2880
|
-
className: "Label"
|
|
2881
|
-
}, "Requires Approval")));
|
|
2962
|
+
}, /*#__PURE__*/React.createElement("small", null, format(round(parseFloat(payment.route.fromBalance.toString()) / Math.pow(10, payment.decimals), 'down')))))));
|
|
2882
2963
|
}));
|
|
2883
2964
|
}, [allPaymentRoutesWithData]);
|
|
2884
2965
|
|
|
@@ -2904,25 +2985,12 @@ var ChangePaymentDialog = (function (props) {
|
|
|
2904
2985
|
});
|
|
2905
2986
|
});
|
|
2906
2987
|
|
|
2907
|
-
var Checkmark = (function () {
|
|
2908
|
-
return /*#__PURE__*/React.createElement("svg", {
|
|
2909
|
-
className: "Checkmark Icon",
|
|
2910
|
-
version: "1.1",
|
|
2911
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2912
|
-
x: "0px",
|
|
2913
|
-
y: "0px",
|
|
2914
|
-
viewBox: "0 0 24 24"
|
|
2915
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
2916
|
-
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"
|
|
2917
|
-
}));
|
|
2918
|
-
});
|
|
2919
|
-
|
|
2920
2988
|
var DonationOverviewSkeleton = (function (props) {
|
|
2921
2989
|
return /*#__PURE__*/React.createElement(Dialog$1, {
|
|
2922
2990
|
header: /*#__PURE__*/React.createElement("div", {
|
|
2923
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
2991
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
2924
2992
|
}, /*#__PURE__*/React.createElement("h1", {
|
|
2925
|
-
className: "LineHeightL FontSizeL
|
|
2993
|
+
className: "LineHeightL FontSizeL"
|
|
2926
2994
|
}, "Donation")),
|
|
2927
2995
|
body: /*#__PURE__*/React.createElement("div", {
|
|
2928
2996
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -2936,7 +3004,7 @@ var DonationOverviewSkeleton = (function (props) {
|
|
|
2936
3004
|
className: "SkeletonBackground"
|
|
2937
3005
|
}))),
|
|
2938
3006
|
footer: /*#__PURE__*/React.createElement("div", {
|
|
2939
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
3007
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
2940
3008
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2941
3009
|
className: "SkeletonWrapper"
|
|
2942
3010
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -2947,6 +3015,60 @@ var DonationOverviewSkeleton = (function (props) {
|
|
|
2947
3015
|
});
|
|
2948
3016
|
});
|
|
2949
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
|
+
|
|
2950
3072
|
var LoadingText = (function (props) {
|
|
2951
3073
|
return /*#__PURE__*/React.createElement("div", {
|
|
2952
3074
|
className: "LoadingText"
|
|
@@ -2959,26 +3081,143 @@ var LoadingText = (function (props) {
|
|
|
2959
3081
|
}, "."));
|
|
2960
3082
|
});
|
|
2961
3083
|
|
|
2962
|
-
var
|
|
3084
|
+
var Footer = (function () {
|
|
2963
3085
|
var _useContext = useContext(ConfigurationContext),
|
|
2964
3086
|
currencyCode = _useContext.currencyCode;
|
|
2965
3087
|
|
|
2966
3088
|
var _useContext2 = useContext(ChangableAmountContext),
|
|
2967
3089
|
amount = _useContext2.amount;
|
|
3090
|
+
_useContext2.amountsMissing;
|
|
2968
3091
|
|
|
2969
|
-
var _useContext3 = useContext(
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
transaction = _useContext3.transaction,
|
|
2974
|
-
approve = _useContext3.approve,
|
|
2975
|
-
approvalTransaction = _useContext3.approvalTransaction;
|
|
3092
|
+
var _useContext3 = useContext(TrackingContext),
|
|
3093
|
+
tracking = _useContext3.tracking,
|
|
3094
|
+
forward = _useContext3.forward,
|
|
3095
|
+
forwardTo = _useContext3.forwardTo;
|
|
2976
3096
|
|
|
2977
|
-
var _useContext4 = useContext(
|
|
2978
|
-
|
|
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
|
+
};
|
|
2979
3153
|
|
|
2980
|
-
var
|
|
2981
|
-
|
|
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
|
+
};
|
|
3197
|
+
|
|
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
|
+
};
|
|
2982
3221
|
|
|
2983
3222
|
var mainAction = function mainAction() {
|
|
2984
3223
|
if (paymentState == 'initialized' || paymentState == 'approving') {
|
|
@@ -2993,10 +3232,10 @@ var DonationOverviewDialog = (function (props) {
|
|
|
2993
3232
|
navigate: navigate
|
|
2994
3233
|
});
|
|
2995
3234
|
}
|
|
2996
|
-
}, "Pay ", new Currency({
|
|
3235
|
+
}, "Pay ", amount ? new Currency({
|
|
2997
3236
|
amount: amount.toFixed(2),
|
|
2998
3237
|
code: currencyCode
|
|
2999
|
-
}).toString());
|
|
3238
|
+
}).toString() : paymentValue.toString().length ? paymentValue.toString() : "".concat(payment.amount));
|
|
3000
3239
|
} else if (paymentState == 'paying') {
|
|
3001
3240
|
return /*#__PURE__*/React.createElement("a", {
|
|
3002
3241
|
className: "ButtonPrimary",
|
|
@@ -3006,39 +3245,51 @@ var DonationOverviewDialog = (function (props) {
|
|
|
3006
3245
|
rel: "noopener noreferrer"
|
|
3007
3246
|
}, /*#__PURE__*/React.createElement(LoadingText, null, "Paying"));
|
|
3008
3247
|
} else if (paymentState == 'confirmed') {
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
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
|
+
}
|
|
3014
3274
|
}
|
|
3015
3275
|
};
|
|
3016
3276
|
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
3020
|
-
className: "PaddingBottomS"
|
|
3021
|
-
}, /*#__PURE__*/React.createElement("button", {
|
|
3022
|
-
className: "ButtonPrimary wide",
|
|
3023
|
-
onClick: approve,
|
|
3024
|
-
title: "Allow ".concat(payment.symbol, " to be used as payment")
|
|
3025
|
-
}, "Allow ", payment.symbol, " to be used as payment"));
|
|
3026
|
-
} else if (paymentState == 'approving') {
|
|
3027
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
3028
|
-
className: "PaddingBottomS"
|
|
3029
|
-
}, /*#__PURE__*/React.createElement("a", {
|
|
3030
|
-
className: "ButtonPrimary wide",
|
|
3031
|
-
title: "Approving payment token - please wait",
|
|
3032
|
-
href: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
|
|
3033
|
-
target: "_blank",
|
|
3034
|
-
rel: "noopener noreferrer"
|
|
3035
|
-
}, /*#__PURE__*/React.createElement(LoadingText, null, "Approving")));
|
|
3036
|
-
}
|
|
3037
|
-
};
|
|
3277
|
+
return /*#__PURE__*/React.createElement("div", null, approvalButton(), additionalPaymentInformation(), mainAction());
|
|
3278
|
+
});
|
|
3038
3279
|
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
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;
|
|
3042
3293
|
|
|
3043
3294
|
if (payment == undefined) {
|
|
3044
3295
|
return /*#__PURE__*/React.createElement(DonationOverviewSkeleton, null);
|
|
@@ -3046,9 +3297,9 @@ var DonationOverviewDialog = (function (props) {
|
|
|
3046
3297
|
|
|
3047
3298
|
return /*#__PURE__*/React.createElement(Dialog$1, {
|
|
3048
3299
|
header: /*#__PURE__*/React.createElement("div", {
|
|
3049
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
3300
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
3050
3301
|
}, /*#__PURE__*/React.createElement("h1", {
|
|
3051
|
-
className: "LineHeightL FontSizeL
|
|
3302
|
+
className: "LineHeightL FontSizeL"
|
|
3052
3303
|
}, "Donation")),
|
|
3053
3304
|
body: /*#__PURE__*/React.createElement("div", {
|
|
3054
3305
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -3111,8 +3362,8 @@ var DonationOverviewDialog = (function (props) {
|
|
|
3111
3362
|
className: "CardAction"
|
|
3112
3363
|
}, /*#__PURE__*/React.createElement(ChevronRight, null)))),
|
|
3113
3364
|
footer: /*#__PURE__*/React.createElement("div", {
|
|
3114
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
3115
|
-
},
|
|
3365
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
3366
|
+
}, /*#__PURE__*/React.createElement(Footer, null))
|
|
3116
3367
|
});
|
|
3117
3368
|
});
|
|
3118
3369
|
|
|
@@ -3149,9 +3400,9 @@ var PaymentErrorDialog = (function () {
|
|
|
3149
3400
|
rel: "noopener noreferrer"
|
|
3150
3401
|
}, "View on explorer")))),
|
|
3151
3402
|
footer: /*#__PURE__*/React.createElement("div", {
|
|
3152
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
3403
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
3153
3404
|
}, /*#__PURE__*/React.createElement("button", {
|
|
3154
|
-
className: "ButtonPrimary
|
|
3405
|
+
className: "ButtonPrimary",
|
|
3155
3406
|
onClick: function onClick() {
|
|
3156
3407
|
return navigate('back');
|
|
3157
3408
|
}
|
|
@@ -3172,9 +3423,9 @@ var WrongNetworkDialog = (function (props) {
|
|
|
3172
3423
|
return /*#__PURE__*/React.createElement(Dialog$1, {
|
|
3173
3424
|
stacked: true,
|
|
3174
3425
|
header: /*#__PURE__*/React.createElement("div", {
|
|
3175
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
3426
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
3176
3427
|
}, /*#__PURE__*/React.createElement("h1", {
|
|
3177
|
-
className: "LineHeightL FontSizeL
|
|
3428
|
+
className: "LineHeightL FontSizeL"
|
|
3178
3429
|
}, "Wrong Network")),
|
|
3179
3430
|
body: /*#__PURE__*/React.createElement("div", {
|
|
3180
3431
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -3191,7 +3442,7 @@ var WrongNetworkDialog = (function (props) {
|
|
|
3191
3442
|
className: "FontSizeM"
|
|
3192
3443
|
}, "Please make sure you connect your wallet to the correct network before you try again!"))),
|
|
3193
3444
|
footer: /*#__PURE__*/React.createElement("div", {
|
|
3194
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
3445
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
3195
3446
|
}, /*#__PURE__*/React.createElement("button", {
|
|
3196
3447
|
className: "ButtonPrimary",
|
|
3197
3448
|
onClick: function onClick() {
|
|
@@ -3222,16 +3473,122 @@ var DonationStack = (function (props) {
|
|
|
3222
3473
|
});
|
|
3223
3474
|
});
|
|
3224
3475
|
|
|
3225
|
-
var
|
|
3226
|
-
var
|
|
3476
|
+
var TrackingProvider = (function (props) {
|
|
3477
|
+
var _useContext = useContext(ConfigurationContext),
|
|
3478
|
+
track = _useContext.track;
|
|
3479
|
+
|
|
3480
|
+
var _useState = useState(track && !!track.endpoint),
|
|
3227
3481
|
_useState2 = _slicedToArray(_useState, 2),
|
|
3228
|
-
|
|
3229
|
-
|
|
3482
|
+
tracking = _useState2[0],
|
|
3483
|
+
setTracking = _useState2[1];
|
|
3230
3484
|
|
|
3231
|
-
|
|
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
|
+
};
|
|
3517
|
+
|
|
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, {
|
|
3232
3587
|
value: {
|
|
3233
|
-
|
|
3234
|
-
|
|
3588
|
+
tracking: tracking,
|
|
3589
|
+
initializeTracking: initializeTracking,
|
|
3590
|
+
forward: forward,
|
|
3591
|
+
forwardTo: forwardTo
|
|
3235
3592
|
}
|
|
3236
3593
|
}, props.children);
|
|
3237
3594
|
});
|
|
@@ -3334,12 +3691,12 @@ var preflight$2 = /*#__PURE__*/function () {
|
|
|
3334
3691
|
|
|
3335
3692
|
var Donation = /*#__PURE__*/function () {
|
|
3336
3693
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(_ref3) {
|
|
3337
|
-
var amount, accept, event, sent, confirmed,
|
|
3694
|
+
var amount, accept, event, sent, confirmed, failed, error, critical, style, blacklist, providers, currency, connected, closed, document, unmount;
|
|
3338
3695
|
return regenerator.wrap(function _callee2$(_context2) {
|
|
3339
3696
|
while (1) {
|
|
3340
3697
|
switch (_context2.prev = _context2.next) {
|
|
3341
3698
|
case 0:
|
|
3342
|
-
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;
|
|
3343
3700
|
_context2.prev = 1;
|
|
3344
3701
|
_context2.next = 4;
|
|
3345
3702
|
return preflight$2({
|
|
@@ -3365,26 +3722,27 @@ var Donation = /*#__PURE__*/function () {
|
|
|
3365
3722
|
event: event,
|
|
3366
3723
|
sent: sent,
|
|
3367
3724
|
confirmed: confirmed,
|
|
3368
|
-
ensured: ensured,
|
|
3369
3725
|
failed: failed,
|
|
3370
3726
|
blacklist: blacklist,
|
|
3371
3727
|
providers: providers
|
|
3372
3728
|
}
|
|
3373
|
-
}, /*#__PURE__*/React.createElement(ClosableProvider, {
|
|
3729
|
+
}, /*#__PURE__*/React.createElement(UpdatableProvider, null, /*#__PURE__*/React.createElement(ClosableProvider, {
|
|
3374
3730
|
unmount: unmount
|
|
3375
|
-
}, /*#__PURE__*/React.createElement(
|
|
3731
|
+
}, /*#__PURE__*/React.createElement(WalletProvider, {
|
|
3376
3732
|
container: container,
|
|
3377
3733
|
connected: connected,
|
|
3378
3734
|
unmount: unmount
|
|
3379
3735
|
}, /*#__PURE__*/React.createElement(ConversionRateProvider, null, /*#__PURE__*/React.createElement(ChangableAmountProvider, {
|
|
3380
3736
|
accept: accept
|
|
3737
|
+
}, /*#__PURE__*/React.createElement(TrackingProvider, {
|
|
3738
|
+
document: ensureDocument(document)
|
|
3381
3739
|
}, /*#__PURE__*/React.createElement(DonationRoutingProvider, {
|
|
3382
3740
|
container: container,
|
|
3383
3741
|
document: document
|
|
3384
3742
|
}, /*#__PURE__*/React.createElement(DonationStack, {
|
|
3385
3743
|
document: document,
|
|
3386
3744
|
container: container
|
|
3387
|
-
})))))))));
|
|
3745
|
+
}), /*#__PURE__*/React.createElement(PoweredBy, null))))))))));
|
|
3388
3746
|
};
|
|
3389
3747
|
});
|
|
3390
3748
|
return _context2.abrupt("return", {
|
|
@@ -3452,9 +3810,9 @@ var PaymentOverviewSkeleton = (function (props) {
|
|
|
3452
3810
|
|
|
3453
3811
|
return /*#__PURE__*/React.createElement(Dialog$1, {
|
|
3454
3812
|
header: /*#__PURE__*/React.createElement("div", {
|
|
3455
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
3813
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
3456
3814
|
}, /*#__PURE__*/React.createElement("h1", {
|
|
3457
|
-
className: "LineHeightL FontSizeL
|
|
3815
|
+
className: "LineHeightL FontSizeL"
|
|
3458
3816
|
}, "Payment")),
|
|
3459
3817
|
body: /*#__PURE__*/React.createElement("div", {
|
|
3460
3818
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -3468,7 +3826,7 @@ var PaymentOverviewSkeleton = (function (props) {
|
|
|
3468
3826
|
className: "SkeletonBackground"
|
|
3469
3827
|
}))),
|
|
3470
3828
|
footer: /*#__PURE__*/React.createElement("div", {
|
|
3471
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
3829
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
3472
3830
|
}, /*#__PURE__*/React.createElement("div", {
|
|
3473
3831
|
className: "SkeletonWrapper"
|
|
3474
3832
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -3483,17 +3841,13 @@ var PaymentOverviewDialog = (function (props) {
|
|
|
3483
3841
|
var _useContext = useContext(ConfigurationContext),
|
|
3484
3842
|
currencyCode = _useContext.currencyCode;
|
|
3485
3843
|
|
|
3486
|
-
var _useContext2 = useContext(
|
|
3487
|
-
|
|
3488
|
-
|
|
3844
|
+
var _useContext2 = useContext(PaymentContext),
|
|
3845
|
+
payment = _useContext2.payment,
|
|
3846
|
+
paymentState = _useContext2.paymentState;
|
|
3489
3847
|
|
|
3490
|
-
var _useContext3 = useContext(
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
pay = _useContext3.pay,
|
|
3494
|
-
transaction = _useContext3.transaction,
|
|
3495
|
-
approve = _useContext3.approve,
|
|
3496
|
-
approvalTransaction = _useContext3.approvalTransaction;
|
|
3848
|
+
var _useContext3 = useContext(ChangableAmountContext),
|
|
3849
|
+
amount = _useContext3.amount,
|
|
3850
|
+
amountsMissing = _useContext3.amountsMissing;
|
|
3497
3851
|
|
|
3498
3852
|
var _useContext4 = useContext(PaymentValueContext),
|
|
3499
3853
|
paymentValue = _useContext4.paymentValue;
|
|
@@ -3501,78 +3855,15 @@ var PaymentOverviewDialog = (function (props) {
|
|
|
3501
3855
|
var _useContext5 = useContext(NavigateStackContext),
|
|
3502
3856
|
navigate = _useContext5.navigate;
|
|
3503
3857
|
|
|
3504
|
-
var _useContext6 = useContext(ClosableContext),
|
|
3505
|
-
close = _useContext6.close;
|
|
3506
|
-
|
|
3507
|
-
var mainAction = function mainAction() {
|
|
3508
|
-
if (paymentState == 'initialized' || paymentState == 'approving') {
|
|
3509
|
-
return /*#__PURE__*/React.createElement("button", {
|
|
3510
|
-
className: ["ButtonPrimary", payment.route.approvalRequired && !payment.route.directTransfer ? 'disabled' : ''].join(' '),
|
|
3511
|
-
onClick: function onClick() {
|
|
3512
|
-
if (payment.route.approvalRequired && !payment.route.directTransfer) {
|
|
3513
|
-
return;
|
|
3514
|
-
}
|
|
3515
|
-
|
|
3516
|
-
pay({
|
|
3517
|
-
navigate: navigate
|
|
3518
|
-
});
|
|
3519
|
-
}
|
|
3520
|
-
}, "Pay ", amount ? new Currency({
|
|
3521
|
-
amount: amount.toFixed(2),
|
|
3522
|
-
code: currencyCode
|
|
3523
|
-
}).toString() : paymentValue.toString().length ? paymentValue.toString() : "".concat(payment.amount));
|
|
3524
|
-
} else if (paymentState == 'paying') {
|
|
3525
|
-
return /*#__PURE__*/React.createElement("a", {
|
|
3526
|
-
className: "ButtonPrimary",
|
|
3527
|
-
title: "Performing the payment - please wait",
|
|
3528
|
-
href: transaction === null || transaction === void 0 ? void 0 : transaction.url,
|
|
3529
|
-
target: "_blank",
|
|
3530
|
-
rel: "noopener noreferrer"
|
|
3531
|
-
}, /*#__PURE__*/React.createElement(LoadingText, null, "Paying"));
|
|
3532
|
-
} else if (paymentState == 'confirmed') {
|
|
3533
|
-
return /*#__PURE__*/React.createElement("button", {
|
|
3534
|
-
className: "ButtonPrimary round",
|
|
3535
|
-
title: "Done",
|
|
3536
|
-
onClick: close
|
|
3537
|
-
}, /*#__PURE__*/React.createElement(Checkmark, null));
|
|
3538
|
-
}
|
|
3539
|
-
};
|
|
3540
|
-
|
|
3541
|
-
var approvalAction = function approvalAction() {
|
|
3542
|
-
if (paymentState == 'initialized') {
|
|
3543
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
3544
|
-
className: "PaddingBottomS"
|
|
3545
|
-
}, /*#__PURE__*/React.createElement("button", {
|
|
3546
|
-
className: "ButtonPrimary wide",
|
|
3547
|
-
onClick: approve,
|
|
3548
|
-
title: "Allow ".concat(payment.symbol, " to be used as payment")
|
|
3549
|
-
}, "Allow ", payment.symbol, " to be used as payment"));
|
|
3550
|
-
} else if (paymentState == 'approving') {
|
|
3551
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
3552
|
-
className: "PaddingBottomS"
|
|
3553
|
-
}, /*#__PURE__*/React.createElement("a", {
|
|
3554
|
-
className: "ButtonPrimary wide",
|
|
3555
|
-
title: "Approving payment token - please wait",
|
|
3556
|
-
href: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
|
|
3557
|
-
target: "_blank",
|
|
3558
|
-
rel: "noopener noreferrer"
|
|
3559
|
-
}, /*#__PURE__*/React.createElement(LoadingText, null, "Approving")));
|
|
3560
|
-
}
|
|
3561
|
-
};
|
|
3562
|
-
|
|
3563
|
-
var actions = function actions() {
|
|
3564
|
-
return /*#__PURE__*/React.createElement("div", null, payment.route.approvalRequired && !payment.route.directTransfer && approvalAction(), mainAction());
|
|
3565
|
-
};
|
|
3566
|
-
|
|
3567
3858
|
if (payment == undefined || paymentValue == undefined) {
|
|
3568
3859
|
return /*#__PURE__*/React.createElement(PaymentOverviewSkeleton, null);
|
|
3569
3860
|
}
|
|
3570
3861
|
|
|
3571
3862
|
return /*#__PURE__*/React.createElement(Dialog$1, {
|
|
3572
3863
|
header: /*#__PURE__*/React.createElement("div", {
|
|
3573
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
3864
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
3574
3865
|
}, /*#__PURE__*/React.createElement("h1", {
|
|
3575
|
-
className: "LineHeightL FontSizeL
|
|
3866
|
+
className: "LineHeightL FontSizeL"
|
|
3576
3867
|
}, "Payment")),
|
|
3577
3868
|
body: /*#__PURE__*/React.createElement("div", {
|
|
3578
3869
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -3635,8 +3926,8 @@ var PaymentOverviewDialog = (function (props) {
|
|
|
3635
3926
|
className: "CardAction"
|
|
3636
3927
|
}, /*#__PURE__*/React.createElement(ChevronRight, null)))),
|
|
3637
3928
|
footer: /*#__PURE__*/React.createElement("div", {
|
|
3638
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
3639
|
-
},
|
|
3929
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
3930
|
+
}, /*#__PURE__*/React.createElement(Footer, null))
|
|
3640
3931
|
});
|
|
3641
3932
|
});
|
|
3642
3933
|
|
|
@@ -3702,12 +3993,12 @@ var preflight$1 = /*#__PURE__*/function () {
|
|
|
3702
3993
|
|
|
3703
3994
|
var Payment = /*#__PURE__*/function () {
|
|
3704
3995
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(_ref3) {
|
|
3705
|
-
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;
|
|
3706
3997
|
return regenerator.wrap(function _callee2$(_context2) {
|
|
3707
3998
|
while (1) {
|
|
3708
3999
|
switch (_context2.prev = _context2.next) {
|
|
3709
4000
|
case 0:
|
|
3710
|
-
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;
|
|
3711
4002
|
_context2.prev = 1;
|
|
3712
4003
|
_context2.next = 4;
|
|
3713
4004
|
return preflight$1({
|
|
@@ -3733,15 +4024,15 @@ var Payment = /*#__PURE__*/function () {
|
|
|
3733
4024
|
event: event,
|
|
3734
4025
|
sent: sent,
|
|
3735
4026
|
confirmed: confirmed,
|
|
3736
|
-
ensured: ensured,
|
|
3737
4027
|
failed: failed,
|
|
3738
4028
|
whitelist: whitelist,
|
|
3739
4029
|
blacklist: blacklist,
|
|
3740
|
-
providers: providers
|
|
4030
|
+
providers: providers,
|
|
4031
|
+
track: track
|
|
3741
4032
|
}
|
|
3742
|
-
}, /*#__PURE__*/React.createElement(ClosableProvider, {
|
|
4033
|
+
}, /*#__PURE__*/React.createElement(UpdatableProvider, null, /*#__PURE__*/React.createElement(ClosableProvider, {
|
|
3743
4034
|
unmount: unmount
|
|
3744
|
-
}, /*#__PURE__*/React.createElement(
|
|
4035
|
+
}, /*#__PURE__*/React.createElement(WalletProvider, {
|
|
3745
4036
|
document: document,
|
|
3746
4037
|
container: container,
|
|
3747
4038
|
connected: connected,
|
|
@@ -3753,13 +4044,15 @@ var Payment = /*#__PURE__*/function () {
|
|
|
3753
4044
|
whitelist: whitelist,
|
|
3754
4045
|
blacklist: blacklist,
|
|
3755
4046
|
event: event
|
|
4047
|
+
}, /*#__PURE__*/React.createElement(TrackingProvider, {
|
|
4048
|
+
document: ensureDocument(document)
|
|
3756
4049
|
}, /*#__PURE__*/React.createElement(PaymentProvider, {
|
|
3757
4050
|
container: container,
|
|
3758
4051
|
document: document
|
|
3759
4052
|
}, /*#__PURE__*/React.createElement(PaymentValueProvider, null, /*#__PURE__*/React.createElement(PaymentStack, {
|
|
3760
4053
|
document: document,
|
|
3761
4054
|
container: container
|
|
3762
|
-
})))))))))));
|
|
4055
|
+
}), /*#__PURE__*/React.createElement(PoweredBy, null))))))))))));
|
|
3763
4056
|
};
|
|
3764
4057
|
});
|
|
3765
4058
|
return _context2.abrupt("return", {
|
|
@@ -3869,9 +4162,9 @@ var SaleRoutingProvider = (function (props) {
|
|
|
3869
4162
|
var SaleOverviewSkeleton = (function (props) {
|
|
3870
4163
|
return /*#__PURE__*/React.createElement(Dialog$1, {
|
|
3871
4164
|
header: /*#__PURE__*/React.createElement("div", {
|
|
3872
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
4165
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
3873
4166
|
}, /*#__PURE__*/React.createElement("h1", {
|
|
3874
|
-
className: "LineHeightL FontSizeL
|
|
4167
|
+
className: "LineHeightL FontSizeL"
|
|
3875
4168
|
}, "Purchase")),
|
|
3876
4169
|
body: /*#__PURE__*/React.createElement("div", {
|
|
3877
4170
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -3888,7 +4181,7 @@ var SaleOverviewSkeleton = (function (props) {
|
|
|
3888
4181
|
className: "SkeletonBackground"
|
|
3889
4182
|
}))),
|
|
3890
4183
|
footer: /*#__PURE__*/React.createElement("div", {
|
|
3891
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
4184
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
3892
4185
|
}, /*#__PURE__*/React.createElement("div", {
|
|
3893
4186
|
className: "SkeletonWrapper"
|
|
3894
4187
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -3900,11 +4193,10 @@ var SaleOverviewSkeleton = (function (props) {
|
|
|
3900
4193
|
});
|
|
3901
4194
|
|
|
3902
4195
|
var SaleOverviewDialog = (function (props) {
|
|
3903
|
-
var _useContext = useContext(ChangableAmountContext)
|
|
3904
|
-
|
|
4196
|
+
var _useContext = useContext(ChangableAmountContext);
|
|
4197
|
+
_useContext.amount;
|
|
3905
4198
|
|
|
3906
4199
|
var _useContext2 = useContext(ConfigurationContext),
|
|
3907
|
-
currencyCode = _useContext2.currencyCode,
|
|
3908
4200
|
tokenImage = _useContext2.tokenImage;
|
|
3909
4201
|
|
|
3910
4202
|
var _useContext3 = useContext(PaymentValueContext),
|
|
@@ -3912,87 +4204,20 @@ var SaleOverviewDialog = (function (props) {
|
|
|
3912
4204
|
|
|
3913
4205
|
var _useContext4 = useContext(PaymentContext),
|
|
3914
4206
|
payment = _useContext4.payment,
|
|
3915
|
-
paymentState = _useContext4.paymentState
|
|
3916
|
-
pay = _useContext4.pay,
|
|
3917
|
-
transaction = _useContext4.transaction,
|
|
3918
|
-
approve = _useContext4.approve,
|
|
3919
|
-
approvalTransaction = _useContext4.approvalTransaction;
|
|
4207
|
+
paymentState = _useContext4.paymentState;
|
|
3920
4208
|
|
|
3921
4209
|
var _useContext5 = useContext(NavigateStackContext),
|
|
3922
4210
|
navigate = _useContext5.navigate;
|
|
3923
4211
|
|
|
3924
|
-
var _useContext6 = useContext(
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
var _useContext7 = useContext(ToTokenContext),
|
|
3928
|
-
toToken = _useContext7.toToken,
|
|
3929
|
-
toTokenReadableAmount = _useContext7.toTokenReadableAmount;
|
|
4212
|
+
var _useContext6 = useContext(ToTokenContext),
|
|
4213
|
+
toToken = _useContext6.toToken,
|
|
4214
|
+
toTokenReadableAmount = _useContext6.toTokenReadableAmount;
|
|
3930
4215
|
|
|
3931
4216
|
var _useState = useState(),
|
|
3932
4217
|
_useState2 = _slicedToArray(_useState, 2),
|
|
3933
4218
|
salePerTokenValue = _useState2[0],
|
|
3934
4219
|
setSalePerTokenValue = _useState2[1];
|
|
3935
4220
|
|
|
3936
|
-
var mainAction = function mainAction() {
|
|
3937
|
-
if (paymentState == 'initialized' || paymentState == 'approving') {
|
|
3938
|
-
return /*#__PURE__*/React.createElement("button", {
|
|
3939
|
-
className: ["ButtonPrimary", payment.route.approvalRequired && !payment.route.directTransfer ? 'disabled' : ''].join(' '),
|
|
3940
|
-
onClick: function onClick() {
|
|
3941
|
-
if (payment.route.approvalRequired && !payment.route.directTransfer) {
|
|
3942
|
-
return;
|
|
3943
|
-
}
|
|
3944
|
-
|
|
3945
|
-
pay({
|
|
3946
|
-
navigate: navigate
|
|
3947
|
-
});
|
|
3948
|
-
}
|
|
3949
|
-
}, "Pay ", new Currency({
|
|
3950
|
-
amount: amount.toFixed(2),
|
|
3951
|
-
code: currencyCode
|
|
3952
|
-
}).toString());
|
|
3953
|
-
} else if (paymentState == 'paying') {
|
|
3954
|
-
return /*#__PURE__*/React.createElement("a", {
|
|
3955
|
-
className: "ButtonPrimary",
|
|
3956
|
-
title: "Performing the payment - please wait",
|
|
3957
|
-
href: transaction === null || transaction === void 0 ? void 0 : transaction.url,
|
|
3958
|
-
target: "_blank",
|
|
3959
|
-
rel: "noopener noreferrer"
|
|
3960
|
-
}, /*#__PURE__*/React.createElement(LoadingText, null, "Paying"));
|
|
3961
|
-
} else if (paymentState == 'confirmed') {
|
|
3962
|
-
return /*#__PURE__*/React.createElement("button", {
|
|
3963
|
-
className: "ButtonPrimary round",
|
|
3964
|
-
title: "Done",
|
|
3965
|
-
onClick: close
|
|
3966
|
-
}, /*#__PURE__*/React.createElement(Checkmark, null));
|
|
3967
|
-
}
|
|
3968
|
-
};
|
|
3969
|
-
|
|
3970
|
-
var approvalAction = function approvalAction() {
|
|
3971
|
-
if (paymentState == 'initialized') {
|
|
3972
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
3973
|
-
className: "PaddingBottomS"
|
|
3974
|
-
}, /*#__PURE__*/React.createElement("button", {
|
|
3975
|
-
className: "ButtonPrimary wide",
|
|
3976
|
-
onClick: approve,
|
|
3977
|
-
title: "Allow ".concat(payment.symbol, " to be used as payment")
|
|
3978
|
-
}, "Allow ", payment.symbol, " to be used as payment"));
|
|
3979
|
-
} else if (paymentState == 'approving') {
|
|
3980
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
3981
|
-
className: "PaddingBottomS"
|
|
3982
|
-
}, /*#__PURE__*/React.createElement("a", {
|
|
3983
|
-
className: "ButtonPrimary wide",
|
|
3984
|
-
title: "Approving payment token - please wait",
|
|
3985
|
-
href: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
|
|
3986
|
-
target: "_blank",
|
|
3987
|
-
rel: "noopener noreferrer"
|
|
3988
|
-
}, /*#__PURE__*/React.createElement(LoadingText, null, "Approving")));
|
|
3989
|
-
}
|
|
3990
|
-
};
|
|
3991
|
-
|
|
3992
|
-
var actions = function actions() {
|
|
3993
|
-
return /*#__PURE__*/React.createElement("div", null, payment.route.approvalRequired && !payment.route.directTransfer && approvalAction(), mainAction());
|
|
3994
|
-
};
|
|
3995
|
-
|
|
3996
4221
|
useEffect(function () {
|
|
3997
4222
|
if (paymentValue) {
|
|
3998
4223
|
setSalePerTokenValue(new Currency({
|
|
@@ -4021,9 +4246,9 @@ var SaleOverviewDialog = (function (props) {
|
|
|
4021
4246
|
|
|
4022
4247
|
return /*#__PURE__*/React.createElement(Dialog$1, {
|
|
4023
4248
|
header: /*#__PURE__*/React.createElement("div", {
|
|
4024
|
-
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
4249
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
|
|
4025
4250
|
}, /*#__PURE__*/React.createElement("h1", {
|
|
4026
|
-
className: "LineHeightL FontSizeL
|
|
4251
|
+
className: "LineHeightL FontSizeL"
|
|
4027
4252
|
}, "Purchase")),
|
|
4028
4253
|
body: /*#__PURE__*/React.createElement("div", {
|
|
4029
4254
|
className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
|
|
@@ -4092,8 +4317,8 @@ var SaleOverviewDialog = (function (props) {
|
|
|
4092
4317
|
className: "CardAction"
|
|
4093
4318
|
}, /*#__PURE__*/React.createElement(ChevronRight, null)))),
|
|
4094
4319
|
footer: /*#__PURE__*/React.createElement("div", {
|
|
4095
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM"
|
|
4096
|
-
},
|
|
4320
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
4321
|
+
}, /*#__PURE__*/React.createElement(Footer, null))
|
|
4097
4322
|
});
|
|
4098
4323
|
});
|
|
4099
4324
|
|
|
@@ -4166,12 +4391,12 @@ var preflight = /*#__PURE__*/function () {
|
|
|
4166
4391
|
|
|
4167
4392
|
var Sale = /*#__PURE__*/function () {
|
|
4168
4393
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(_ref3) {
|
|
4169
|
-
var amount, sell, sent, confirmed,
|
|
4394
|
+
var amount, sell, sent, confirmed, failed, error, critical, style, blacklist, providers, currency, connected, closed, tokenImage, document, accept, unmount;
|
|
4170
4395
|
return regenerator.wrap(function _callee2$(_context2) {
|
|
4171
4396
|
while (1) {
|
|
4172
4397
|
switch (_context2.prev = _context2.next) {
|
|
4173
4398
|
case 0:
|
|
4174
|
-
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;
|
|
4175
4400
|
_context2.prev = 1;
|
|
4176
4401
|
_context2.next = 4;
|
|
4177
4402
|
return preflight({
|
|
@@ -4203,26 +4428,27 @@ var Sale = /*#__PURE__*/function () {
|
|
|
4203
4428
|
currency: currency,
|
|
4204
4429
|
sent: sent,
|
|
4205
4430
|
confirmed: confirmed,
|
|
4206
|
-
ensured: ensured,
|
|
4207
4431
|
failed: failed,
|
|
4208
4432
|
blacklist: blacklist,
|
|
4209
4433
|
providers: providers
|
|
4210
4434
|
}
|
|
4211
|
-
}, /*#__PURE__*/React.createElement(ClosableProvider, {
|
|
4435
|
+
}, /*#__PURE__*/React.createElement(UpdatableProvider, null, /*#__PURE__*/React.createElement(ClosableProvider, {
|
|
4212
4436
|
unmount: unmount
|
|
4213
|
-
}, /*#__PURE__*/React.createElement(
|
|
4437
|
+
}, /*#__PURE__*/React.createElement(WalletProvider, {
|
|
4214
4438
|
container: container,
|
|
4215
4439
|
connected: connected,
|
|
4216
4440
|
unmount: unmount
|
|
4217
4441
|
}, /*#__PURE__*/React.createElement(ConversionRateProvider, null, /*#__PURE__*/React.createElement(ChangableAmountProvider, {
|
|
4218
4442
|
accept: accept
|
|
4443
|
+
}, /*#__PURE__*/React.createElement(TrackingProvider, {
|
|
4444
|
+
document: ensureDocument(document)
|
|
4219
4445
|
}, /*#__PURE__*/React.createElement(SaleRoutingProvider, {
|
|
4220
4446
|
container: container,
|
|
4221
4447
|
document: document
|
|
4222
4448
|
}, /*#__PURE__*/React.createElement(SaleStack, {
|
|
4223
4449
|
document: document,
|
|
4224
4450
|
container: container
|
|
4225
|
-
})))))))));
|
|
4451
|
+
}), /*#__PURE__*/React.createElement(PoweredBy, null))))))))));
|
|
4226
4452
|
};
|
|
4227
4453
|
});
|
|
4228
4454
|
return _context2.abrupt("return", {
|