@depay/widgets 12.0.2 → 12.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.bundle.js +2 -2
- package/dist/esm/index.evm.js +102 -28
- package/dist/esm/index.evm.js.map +1 -1
- package/dist/esm/index.js +102 -28
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.solana.js +102 -28
- package/dist/esm/index.solana.js.map +1 -1
- package/dist/umd/index.bundle.js +2 -2
- package/dist/umd/index.evm.js +102 -28
- package/dist/umd/index.evm.js.map +1 -1
- package/dist/umd/index.js +102 -28
- package/dist/umd/index.js.map +1 -1
- package/dist/umd/index.solana.js +102 -28
- package/dist/umd/index.solana.js.map +1 -1
- package/package.json +1 -1
package/dist/umd/index.solana.js
CHANGED
|
@@ -21966,7 +21966,28 @@
|
|
|
21966
21966
|
className: "Alert"
|
|
21967
21967
|
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
21968
21968
|
className: "FontWeightBold PaddingBottomXS"
|
|
21969
|
-
}, "You wallet extension window is already asking to connect. It might be hidden."))), /*#__PURE__*/React__default["default"].createElement("
|
|
21969
|
+
}, "You wallet extension window is already asking to connect. It might be hidden."))), props.connectingExtension && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
21970
|
+
className: "Card disabled small PaddingTopS PaddingRightXS PaddingBottomS PaddingLeftXS",
|
|
21971
|
+
style: {
|
|
21972
|
+
height: '50px'
|
|
21973
|
+
}
|
|
21974
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
21975
|
+
className: "PaddingTopXS PaddingRightXS PaddingLeftS TextCenter",
|
|
21976
|
+
style: {
|
|
21977
|
+
width: "50px"
|
|
21978
|
+
}
|
|
21979
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
21980
|
+
className: "Loading Icon medium",
|
|
21981
|
+
style: {
|
|
21982
|
+
position: 'relative',
|
|
21983
|
+
top: '4px',
|
|
21984
|
+
left: '1px'
|
|
21985
|
+
}
|
|
21986
|
+
})), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
21987
|
+
className: "PaddingLeftS LineHeightXS"
|
|
21988
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
21989
|
+
className: "CardText FontWeightMedium"
|
|
21990
|
+
}, "Connecting extension"))), !props.connectingExtension && /*#__PURE__*/React__default["default"].createElement("button", {
|
|
21970
21991
|
onClick: function onClick() {
|
|
21971
21992
|
return props.connectExtension(props.wallet);
|
|
21972
21993
|
},
|
|
@@ -21992,7 +22013,28 @@
|
|
|
21992
22013
|
className: "CardText FontWeightMedium"
|
|
21993
22014
|
}, "Connect extension")))), connectAppIsAvailable && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
21994
22015
|
className: "PaddingBottomXS"
|
|
21995
|
-
}, /*#__PURE__*/React__default["default"].createElement("
|
|
22016
|
+
}, props.connectingApp && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
22017
|
+
className: "Card disabled small PaddingTopS PaddingRightXS PaddingBottomS PaddingLeftXS",
|
|
22018
|
+
style: {
|
|
22019
|
+
height: '50px'
|
|
22020
|
+
}
|
|
22021
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
22022
|
+
className: "PaddingTopXS PaddingRightXS PaddingLeftS TextCenter",
|
|
22023
|
+
style: {
|
|
22024
|
+
width: "50px"
|
|
22025
|
+
}
|
|
22026
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
22027
|
+
className: "Loading Icon medium",
|
|
22028
|
+
style: {
|
|
22029
|
+
position: 'relative',
|
|
22030
|
+
top: '4px',
|
|
22031
|
+
left: '1px'
|
|
22032
|
+
}
|
|
22033
|
+
})), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
22034
|
+
className: "PaddingLeftS LineHeightXS"
|
|
22035
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
22036
|
+
className: "CardText FontWeightMedium"
|
|
22037
|
+
}, "Connecting app"))), !props.connectingApp && /*#__PURE__*/React__default["default"].createElement("button", {
|
|
21996
22038
|
onClick: function onClick() {
|
|
21997
22039
|
return props.connectViaRedirect(props.wallet);
|
|
21998
22040
|
},
|
|
@@ -22585,20 +22627,28 @@
|
|
|
22585
22627
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
22586
22628
|
platform = _useState4[0],
|
|
22587
22629
|
setPlatform = _useState4[1];
|
|
22588
|
-
var _useState5 = React.useState(),
|
|
22630
|
+
var _useState5 = React.useState(false),
|
|
22589
22631
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
22590
|
-
|
|
22591
|
-
|
|
22592
|
-
var _useState7 = React.useState(
|
|
22593
|
-
blockchain: undefined
|
|
22594
|
-
}),
|
|
22632
|
+
connectingExtension = _useState6[0],
|
|
22633
|
+
setConnectingExtension = _useState6[1];
|
|
22634
|
+
var _useState7 = React.useState(false),
|
|
22595
22635
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
22596
|
-
|
|
22597
|
-
_useState8[1];
|
|
22598
|
-
var _useState9 = React.useState(
|
|
22636
|
+
connectingApp = _useState8[0],
|
|
22637
|
+
setConnectingApp = _useState8[1];
|
|
22638
|
+
var _useState9 = React.useState(),
|
|
22599
22639
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
22600
|
-
|
|
22601
|
-
|
|
22640
|
+
redirectUri = _useState10[0],
|
|
22641
|
+
setRedirectUri = _useState10[1];
|
|
22642
|
+
var _useState11 = React.useState({
|
|
22643
|
+
blockchain: undefined
|
|
22644
|
+
}),
|
|
22645
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
22646
|
+
selection = _useState12[0];
|
|
22647
|
+
_useState12[1];
|
|
22648
|
+
var _useState13 = React.useState(false),
|
|
22649
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
22650
|
+
showConnectExtensionWarning = _useState14[0],
|
|
22651
|
+
setShowConnectExtensionWarning = _useState14[1];
|
|
22602
22652
|
var resolve = function resolve(account, wallet) {
|
|
22603
22653
|
if (account && wallet) {
|
|
22604
22654
|
var walletMeta = allWallets.find(function (walletMeta) {
|
|
@@ -22616,10 +22666,18 @@
|
|
|
22616
22666
|
};
|
|
22617
22667
|
var connectExtension = function connectExtension(wallet) {
|
|
22618
22668
|
setShowConnectExtensionWarning(false);
|
|
22669
|
+
setConnectingExtension(true);
|
|
22619
22670
|
wallet = new web3WalletsSolana.wallets[wallet.extension]();
|
|
22671
|
+
var resetConnectingTimeout = setTimeout(function () {
|
|
22672
|
+
setConnectingExtension(false);
|
|
22673
|
+
}, 5000);
|
|
22620
22674
|
wallet.connect().then(function (account) {
|
|
22621
22675
|
resolve(account, wallet);
|
|
22676
|
+
setConnectingExtension(false);
|
|
22677
|
+
clearTimeout(resetConnectingTimeout);
|
|
22622
22678
|
})["catch"](function (error) {
|
|
22679
|
+
setConnectingExtension(false);
|
|
22680
|
+
clearTimeout(resetConnectingTimeout);
|
|
22623
22681
|
if ((error === null || error === void 0 ? void 0 : error.code) == -32002) {
|
|
22624
22682
|
// Request of type 'wallet_requestPermissions' already pending...
|
|
22625
22683
|
setShowConnectExtensionWarning(true);
|
|
@@ -22696,6 +22754,10 @@
|
|
|
22696
22754
|
if (!platform) {
|
|
22697
22755
|
return;
|
|
22698
22756
|
}
|
|
22757
|
+
setConnectingApp(true);
|
|
22758
|
+
setTimeout(function () {
|
|
22759
|
+
setConnectingApp(false);
|
|
22760
|
+
}, 5000);
|
|
22699
22761
|
if (['WalletConnectV1', 'WalletConnectV2'].includes(platform.connect)) {
|
|
22700
22762
|
localStorage[atob('ZGVwYXk6d2FsbGV0czp3YzI6cHJvamVjdElk')] = atob('YjFmYzJmMDZlYTIxMDdmY2Q5OWM2OGY0MTI3MTQxYWI=');
|
|
22701
22763
|
var _wallet = new web3WalletsSolana.wallets[platform.connect]();
|
|
@@ -22720,7 +22782,10 @@
|
|
|
22720
22782
|
});
|
|
22721
22783
|
}
|
|
22722
22784
|
}).then(function (account) {
|
|
22785
|
+
setConnectingApp(false);
|
|
22723
22786
|
resolve(account, _wallet);
|
|
22787
|
+
})["catch"](function () {
|
|
22788
|
+
setConnectingApp(false);
|
|
22724
22789
|
});
|
|
22725
22790
|
} else if (platform.connect === 'SolanaMobileWalletAdapter') {
|
|
22726
22791
|
var _wallet2 = new web3WalletsSolana.wallets[platform.connect]();
|
|
@@ -22728,7 +22793,10 @@
|
|
|
22728
22793
|
name: walletMetaData.name,
|
|
22729
22794
|
logo: walletMetaData.logo
|
|
22730
22795
|
}).then(function (account) {
|
|
22796
|
+
setConnectingApp(false);
|
|
22731
22797
|
resolve(account, _wallet2);
|
|
22798
|
+
})["catch"](function () {
|
|
22799
|
+
setConnectingApp(false);
|
|
22732
22800
|
});
|
|
22733
22801
|
}
|
|
22734
22802
|
};
|
|
@@ -22771,6 +22839,8 @@
|
|
|
22771
22839
|
openInApp: openInApp,
|
|
22772
22840
|
connectViaRedirect: connectViaRedirect,
|
|
22773
22841
|
connectExtension: connectExtension,
|
|
22842
|
+
connectingExtension: connectingExtension,
|
|
22843
|
+
connectingApp: connectingApp,
|
|
22774
22844
|
showConnectExtensionWarning: showConnectExtensionWarning,
|
|
22775
22845
|
continueWithSolanaPay: props.continueWithSolanaPay
|
|
22776
22846
|
})
|
|
@@ -23171,7 +23241,7 @@
|
|
|
23171
23241
|
});
|
|
23172
23242
|
|
|
23173
23243
|
var IconStyle = (function (style) {
|
|
23174
|
-
return "\n\n .Icon {\n fill: ".concat(style.colors.icons, ";\n stroke: ").concat(style.colors.icons, ";\n }\n\n .QuestionMarkIcon {\n fill: transparent;\n }\n\n .ChevronLeft, .ChevronRight {\n position: relative;\n top: 1px;\n }\n\n .ChevronLeft.small, .ChevronRight.small {\n height: 12px;\n width: 12px;\n }\n\n .Checkmark {\n height: 24px;\n position: relative;\n top: -1px;\n vertical-align: middle;\n width: 24px;\n }\n\n .AlertIcon {\n height: 20px;\n position: relative;\n top: -1px;\n vertical-align: middle;\n width: 20px;\n fill: #e42626;\n stroke: transparent;\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
|
|
23244
|
+
return "\n\n .Icon {\n fill: ".concat(style.colors.icons, ";\n stroke: ").concat(style.colors.icons, ";\n }\n\n .QuestionMarkIcon {\n fill: transparent;\n }\n\n .ChevronLeft, .ChevronRight {\n position: relative;\n top: 1px;\n }\n\n .ChevronLeft.small, .ChevronRight.small {\n height: 12px;\n width: 12px;\n }\n\n .Checkmark {\n height: 24px;\n position: relative;\n top: -1px;\n vertical-align: middle;\n width: 24px;\n }\n\n .AlertIcon {\n height: 20px;\n position: relative;\n top: -1px;\n vertical-align: middle;\n width: 20px;\n fill: #e42626;\n stroke: transparent;\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 animation: spin 1.5s linear infinite;\n border-radius: 100%;\n border: 3px solid ").concat(style.colors.primary, ";\n border-top: 3px solid rgba(0,0,0,0.1);\n display: inline-block;\n height: 18px;\n left: -1px;\n position: relative;\n width: 18px;\n }\n\n .Loading.medium {\n border: 4px solid ").concat(style.colors.primary, ";\n border-top: 4px solid rgba(0,0,0,0.1);\n display: inline-block;\n height: 22px;\n position: relative;\n width: 22px; \n }\n\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n ");
|
|
23175
23245
|
});
|
|
23176
23246
|
|
|
23177
23247
|
var ImageStyle = (function (style) {
|
|
@@ -23511,8 +23581,10 @@
|
|
|
23511
23581
|
var PUBLIC_KEY = "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtqsu0wy94cpz90W4pGsJ\nSf0bfvmsq3su+R1J4AoAYz0XoAu2MXJZM8vrQvG3op7OgB3zze8pj4joaoPU2piT\ndH7kcF4Mde6QG4qKEL3VE+J8CL3qK2dUY0Umu20x/O9O792tlv8+Q/qAVv8yPfdM\nn5Je9Wc7VI5XeIBKP2AzsCkrXuzQlR48Ac5LpViNSSLu0mz5NTBoHkW2sz1sNWc6\nUpYISJkiKTvYc8Bo4p5xD6+ZmlL4hj1Ad/+26SjYcisX2Ut4QD7YKRBP2SbItVkI\nqp9mp6c6MCKNmEUkosxAr0KVfOcrk6/fcc4tI8g+KYZ32G11Ri8Xo4fgHH06DLYP\n3QIDAQAB\n-----END PUBLIC KEY-----\n";
|
|
23512
23582
|
var ConfigurationProvider = (function (props) {
|
|
23513
23583
|
var _props$configuration, _props$configuration5;
|
|
23514
|
-
var currencyCode = new localCurrency.Currency({
|
|
23584
|
+
var currencyCode = typeof props.configuration.currency === 'string' ? new localCurrency.Currency({
|
|
23515
23585
|
code: props.configuration.currency
|
|
23586
|
+
}).code : new localCurrency.Currency({
|
|
23587
|
+
amount: 0
|
|
23516
23588
|
}).code;
|
|
23517
23589
|
var _useState = React.useState(!((_props$configuration = props.configuration) !== null && _props$configuration !== void 0 && _props$configuration.integration) ? _objectSpread$6(_objectSpread$6({}, props.configuration), {}, {
|
|
23518
23590
|
currencyCode: currencyCode
|
|
@@ -24197,10 +24269,10 @@
|
|
|
24197
24269
|
});
|
|
24198
24270
|
};
|
|
24199
24271
|
var _useContext = React.useContext(ConfigurationContext),
|
|
24200
|
-
accept = _useContext.accept,
|
|
24201
24272
|
configuredAmount = _useContext.amount;
|
|
24202
24273
|
_useContext.toAmount;
|
|
24203
|
-
var recover = _useContext.recover
|
|
24274
|
+
var recover = _useContext.recover,
|
|
24275
|
+
accept = _useContext.accept;
|
|
24204
24276
|
React.useContext(ConfigurationContext);
|
|
24205
24277
|
var _useState = React.useState(recover == undefined ? configurationsMissAmounts(accept) : false),
|
|
24206
24278
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -24818,9 +24890,12 @@
|
|
|
24818
24890
|
_useContext.navigate;
|
|
24819
24891
|
var set = _useContext.set;
|
|
24820
24892
|
var _useContext2 = React.useContext(ConfigurationContext),
|
|
24821
|
-
accept = _useContext2.accept
|
|
24822
|
-
|
|
24823
|
-
|
|
24893
|
+
accept = _useContext2.accept,
|
|
24894
|
+
sell = _useContext2.sell;
|
|
24895
|
+
var _useContext3 = React.useContext(ChangableAmountContext),
|
|
24896
|
+
acceptWithAmount = _useContext3.acceptWithAmount;
|
|
24897
|
+
var _useContext4 = React.useContext(ClosableContext),
|
|
24898
|
+
close = _useContext4.close;
|
|
24824
24899
|
var setRecommendation = function setRecommendation(_x) {
|
|
24825
24900
|
return (_ref2 = _ref2 || _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee3(_ref) {
|
|
24826
24901
|
var route, accept, nativeAvailableAsset, token, asset, _ref3, _ref4;
|
|
@@ -25031,7 +25106,7 @@
|
|
|
25031
25106
|
return regenerator.wrap(function _callee6$(_context6) {
|
|
25032
25107
|
while (1) switch (_context6.prev = _context6.next) {
|
|
25033
25108
|
case 0:
|
|
25034
|
-
directTransfer = accept.find(function (accept) {
|
|
25109
|
+
directTransfer = !sell && (acceptWithAmount || accept).find(function (accept) {
|
|
25035
25110
|
return props.assets.find(function (asset) {
|
|
25036
25111
|
return accept.blockchain === asset.blockchain && accept.token.toLowerCase() === asset.address.toLowerCase();
|
|
25037
25112
|
});
|
|
@@ -25083,7 +25158,7 @@
|
|
|
25083
25158
|
})) {
|
|
25084
25159
|
return;
|
|
25085
25160
|
} // consdier only major tokens for this
|
|
25086
|
-
return accept.map(function (_x4) {
|
|
25161
|
+
return (acceptWithAmount || accept).map(function (_x4) {
|
|
25087
25162
|
return (_ref6 = _ref6 || _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee4(accept) {
|
|
25088
25163
|
return regenerator.wrap(function _callee4$(_context4) {
|
|
25089
25164
|
while (1) switch (_context4.prev = _context4.next) {
|
|
@@ -25128,15 +25203,15 @@
|
|
|
25128
25203
|
return regenerator.wrap(function _callee5$(_context5) {
|
|
25129
25204
|
while (1) switch (_context5.prev = _context5.next) {
|
|
25130
25205
|
case 0:
|
|
25131
|
-
route = (routes || []).flat().find(function (route) {
|
|
25132
|
-
return accept.find(function (accept) {
|
|
25206
|
+
route = (routes.filter(Boolean) || []).flat().find(function (route) {
|
|
25207
|
+
return (acceptWithAmount || accept).find(function (accept) {
|
|
25133
25208
|
return accept.blockchain === route.blockchain && accept.token.toLowerCase() === route.tokenOut.toLowerCase();
|
|
25134
25209
|
});
|
|
25135
25210
|
}) || routes.flat()[0];
|
|
25136
25211
|
if (!route) {
|
|
25137
25212
|
set(['NoPaymentOptionFound']);
|
|
25138
25213
|
} else {
|
|
25139
|
-
recommendedAccept = accept.find(function (accept) {
|
|
25214
|
+
recommendedAccept = (acceptWithAmount || accept).find(function (accept) {
|
|
25140
25215
|
return accept.blockchain === route.blockchain && accept.token.toLowerCase() === route.tokenOut.toLowerCase();
|
|
25141
25216
|
}) || accept.find(function (accept) {
|
|
25142
25217
|
return accept.blockchain === route.blockchain;
|
|
@@ -37188,6 +37263,7 @@
|
|
|
37188
37263
|
}, /*#__PURE__*/React__default["default"].createElement(ConfigurationProvider, {
|
|
37189
37264
|
configuration: {
|
|
37190
37265
|
type: 'sale',
|
|
37266
|
+
accept: accept,
|
|
37191
37267
|
tokenImage: tokenImage,
|
|
37192
37268
|
amount: amount,
|
|
37193
37269
|
sell: sell,
|
|
@@ -37207,9 +37283,7 @@
|
|
|
37207
37283
|
container: container,
|
|
37208
37284
|
connected: connected,
|
|
37209
37285
|
unmount: unmount
|
|
37210
|
-
}, /*#__PURE__*/React__default["default"].createElement(NavigateProvider, null, /*#__PURE__*/React__default["default"].createElement(ConversionRateProvider, null, /*#__PURE__*/React__default["default"].createElement(ChangableAmountProvider, {
|
|
37211
|
-
accept: accept
|
|
37212
|
-
}, /*#__PURE__*/React__default["default"].createElement(TransactionTrackingProvider, null, /*#__PURE__*/React__default["default"].createElement(PaymentTrackingProvider, {
|
|
37286
|
+
}, /*#__PURE__*/React__default["default"].createElement(NavigateProvider, null, /*#__PURE__*/React__default["default"].createElement(ConversionRateProvider, null, /*#__PURE__*/React__default["default"].createElement(ChangableAmountProvider, null, /*#__PURE__*/React__default["default"].createElement(TransactionTrackingProvider, null, /*#__PURE__*/React__default["default"].createElement(PaymentTrackingProvider, {
|
|
37213
37287
|
document: ensureDocument(document)
|
|
37214
37288
|
}, /*#__PURE__*/React__default["default"].createElement(SaleRoutingProvider, {
|
|
37215
37289
|
container: container,
|