@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.evm.js
CHANGED
|
@@ -21965,7 +21965,28 @@
|
|
|
21965
21965
|
className: "Alert"
|
|
21966
21966
|
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
21967
21967
|
className: "FontWeightBold PaddingBottomXS"
|
|
21968
|
-
}, "You wallet extension window is already asking to connect. It might be hidden."))), /*#__PURE__*/React__default["default"].createElement("
|
|
21968
|
+
}, "You wallet extension window is already asking to connect. It might be hidden."))), props.connectingExtension && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
21969
|
+
className: "Card disabled small PaddingTopS PaddingRightXS PaddingBottomS PaddingLeftXS",
|
|
21970
|
+
style: {
|
|
21971
|
+
height: '50px'
|
|
21972
|
+
}
|
|
21973
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
21974
|
+
className: "PaddingTopXS PaddingRightXS PaddingLeftS TextCenter",
|
|
21975
|
+
style: {
|
|
21976
|
+
width: "50px"
|
|
21977
|
+
}
|
|
21978
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
21979
|
+
className: "Loading Icon medium",
|
|
21980
|
+
style: {
|
|
21981
|
+
position: 'relative',
|
|
21982
|
+
top: '4px',
|
|
21983
|
+
left: '1px'
|
|
21984
|
+
}
|
|
21985
|
+
})), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
21986
|
+
className: "PaddingLeftS LineHeightXS"
|
|
21987
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
21988
|
+
className: "CardText FontWeightMedium"
|
|
21989
|
+
}, "Connecting extension"))), !props.connectingExtension && /*#__PURE__*/React__default["default"].createElement("button", {
|
|
21969
21990
|
onClick: function onClick() {
|
|
21970
21991
|
return props.connectExtension(props.wallet);
|
|
21971
21992
|
},
|
|
@@ -21991,7 +22012,28 @@
|
|
|
21991
22012
|
className: "CardText FontWeightMedium"
|
|
21992
22013
|
}, "Connect extension")))), connectAppIsAvailable && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
21993
22014
|
className: "PaddingBottomXS"
|
|
21994
|
-
}, /*#__PURE__*/React__default["default"].createElement("
|
|
22015
|
+
}, props.connectingApp && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
22016
|
+
className: "Card disabled small PaddingTopS PaddingRightXS PaddingBottomS PaddingLeftXS",
|
|
22017
|
+
style: {
|
|
22018
|
+
height: '50px'
|
|
22019
|
+
}
|
|
22020
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
22021
|
+
className: "PaddingTopXS PaddingRightXS PaddingLeftS TextCenter",
|
|
22022
|
+
style: {
|
|
22023
|
+
width: "50px"
|
|
22024
|
+
}
|
|
22025
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
22026
|
+
className: "Loading Icon medium",
|
|
22027
|
+
style: {
|
|
22028
|
+
position: 'relative',
|
|
22029
|
+
top: '4px',
|
|
22030
|
+
left: '1px'
|
|
22031
|
+
}
|
|
22032
|
+
})), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
22033
|
+
className: "PaddingLeftS LineHeightXS"
|
|
22034
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
22035
|
+
className: "CardText FontWeightMedium"
|
|
22036
|
+
}, "Connecting app"))), !props.connectingApp && /*#__PURE__*/React__default["default"].createElement("button", {
|
|
21995
22037
|
onClick: function onClick() {
|
|
21996
22038
|
return props.connectViaRedirect(props.wallet);
|
|
21997
22039
|
},
|
|
@@ -22584,20 +22626,28 @@
|
|
|
22584
22626
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
22585
22627
|
platform = _useState4[0],
|
|
22586
22628
|
setPlatform = _useState4[1];
|
|
22587
|
-
var _useState5 = React.useState(),
|
|
22629
|
+
var _useState5 = React.useState(false),
|
|
22588
22630
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
22589
|
-
|
|
22590
|
-
|
|
22591
|
-
var _useState7 = React.useState(
|
|
22592
|
-
blockchain: undefined
|
|
22593
|
-
}),
|
|
22631
|
+
connectingExtension = _useState6[0],
|
|
22632
|
+
setConnectingExtension = _useState6[1];
|
|
22633
|
+
var _useState7 = React.useState(false),
|
|
22594
22634
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
22595
|
-
|
|
22596
|
-
_useState8[1];
|
|
22597
|
-
var _useState9 = React.useState(
|
|
22635
|
+
connectingApp = _useState8[0],
|
|
22636
|
+
setConnectingApp = _useState8[1];
|
|
22637
|
+
var _useState9 = React.useState(),
|
|
22598
22638
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
22599
|
-
|
|
22600
|
-
|
|
22639
|
+
redirectUri = _useState10[0],
|
|
22640
|
+
setRedirectUri = _useState10[1];
|
|
22641
|
+
var _useState11 = React.useState({
|
|
22642
|
+
blockchain: undefined
|
|
22643
|
+
}),
|
|
22644
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
22645
|
+
selection = _useState12[0];
|
|
22646
|
+
_useState12[1];
|
|
22647
|
+
var _useState13 = React.useState(false),
|
|
22648
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
22649
|
+
showConnectExtensionWarning = _useState14[0],
|
|
22650
|
+
setShowConnectExtensionWarning = _useState14[1];
|
|
22601
22651
|
var resolve = function resolve(account, wallet) {
|
|
22602
22652
|
if (account && wallet) {
|
|
22603
22653
|
var walletMeta = allWallets.find(function (walletMeta) {
|
|
@@ -22615,10 +22665,18 @@
|
|
|
22615
22665
|
};
|
|
22616
22666
|
var connectExtension = function connectExtension(wallet) {
|
|
22617
22667
|
setShowConnectExtensionWarning(false);
|
|
22668
|
+
setConnectingExtension(true);
|
|
22618
22669
|
wallet = new web3WalletsEvm.wallets[wallet.extension]();
|
|
22670
|
+
var resetConnectingTimeout = setTimeout(function () {
|
|
22671
|
+
setConnectingExtension(false);
|
|
22672
|
+
}, 5000);
|
|
22619
22673
|
wallet.connect().then(function (account) {
|
|
22620
22674
|
resolve(account, wallet);
|
|
22675
|
+
setConnectingExtension(false);
|
|
22676
|
+
clearTimeout(resetConnectingTimeout);
|
|
22621
22677
|
})["catch"](function (error) {
|
|
22678
|
+
setConnectingExtension(false);
|
|
22679
|
+
clearTimeout(resetConnectingTimeout);
|
|
22622
22680
|
if ((error === null || error === void 0 ? void 0 : error.code) == -32002) {
|
|
22623
22681
|
// Request of type 'wallet_requestPermissions' already pending...
|
|
22624
22682
|
setShowConnectExtensionWarning(true);
|
|
@@ -22695,6 +22753,10 @@
|
|
|
22695
22753
|
if (!platform) {
|
|
22696
22754
|
return;
|
|
22697
22755
|
}
|
|
22756
|
+
setConnectingApp(true);
|
|
22757
|
+
setTimeout(function () {
|
|
22758
|
+
setConnectingApp(false);
|
|
22759
|
+
}, 5000);
|
|
22698
22760
|
if (['WalletConnectV1', 'WalletConnectV2'].includes(platform.connect)) {
|
|
22699
22761
|
localStorage[atob('ZGVwYXk6d2FsbGV0czp3YzI6cHJvamVjdElk')] = atob('YjFmYzJmMDZlYTIxMDdmY2Q5OWM2OGY0MTI3MTQxYWI=');
|
|
22700
22762
|
var _wallet = new web3WalletsEvm.wallets[platform.connect]();
|
|
@@ -22719,7 +22781,10 @@
|
|
|
22719
22781
|
});
|
|
22720
22782
|
}
|
|
22721
22783
|
}).then(function (account) {
|
|
22784
|
+
setConnectingApp(false);
|
|
22722
22785
|
resolve(account, _wallet);
|
|
22786
|
+
})["catch"](function () {
|
|
22787
|
+
setConnectingApp(false);
|
|
22723
22788
|
});
|
|
22724
22789
|
} else if (platform.connect === 'SolanaMobileWalletAdapter') {
|
|
22725
22790
|
var _wallet2 = new web3WalletsEvm.wallets[platform.connect]();
|
|
@@ -22727,7 +22792,10 @@
|
|
|
22727
22792
|
name: walletMetaData.name,
|
|
22728
22793
|
logo: walletMetaData.logo
|
|
22729
22794
|
}).then(function (account) {
|
|
22795
|
+
setConnectingApp(false);
|
|
22730
22796
|
resolve(account, _wallet2);
|
|
22797
|
+
})["catch"](function () {
|
|
22798
|
+
setConnectingApp(false);
|
|
22731
22799
|
});
|
|
22732
22800
|
}
|
|
22733
22801
|
};
|
|
@@ -22770,6 +22838,8 @@
|
|
|
22770
22838
|
openInApp: openInApp,
|
|
22771
22839
|
connectViaRedirect: connectViaRedirect,
|
|
22772
22840
|
connectExtension: connectExtension,
|
|
22841
|
+
connectingExtension: connectingExtension,
|
|
22842
|
+
connectingApp: connectingApp,
|
|
22773
22843
|
showConnectExtensionWarning: showConnectExtensionWarning,
|
|
22774
22844
|
continueWithSolanaPay: props.continueWithSolanaPay
|
|
22775
22845
|
})
|
|
@@ -23170,7 +23240,7 @@
|
|
|
23170
23240
|
});
|
|
23171
23241
|
|
|
23172
23242
|
var IconStyle = (function (style) {
|
|
23173
|
-
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
|
|
23243
|
+
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 ");
|
|
23174
23244
|
});
|
|
23175
23245
|
|
|
23176
23246
|
var ImageStyle = (function (style) {
|
|
@@ -23510,8 +23580,10 @@
|
|
|
23510
23580
|
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";
|
|
23511
23581
|
var ConfigurationProvider = (function (props) {
|
|
23512
23582
|
var _props$configuration, _props$configuration5;
|
|
23513
|
-
var currencyCode = new localCurrency.Currency({
|
|
23583
|
+
var currencyCode = typeof props.configuration.currency === 'string' ? new localCurrency.Currency({
|
|
23514
23584
|
code: props.configuration.currency
|
|
23585
|
+
}).code : new localCurrency.Currency({
|
|
23586
|
+
amount: 0
|
|
23515
23587
|
}).code;
|
|
23516
23588
|
var _useState = React.useState(!((_props$configuration = props.configuration) !== null && _props$configuration !== void 0 && _props$configuration.integration) ? _objectSpread$5(_objectSpread$5({}, props.configuration), {}, {
|
|
23517
23589
|
currencyCode: currencyCode
|
|
@@ -24196,10 +24268,10 @@
|
|
|
24196
24268
|
});
|
|
24197
24269
|
};
|
|
24198
24270
|
var _useContext = React.useContext(ConfigurationContext),
|
|
24199
|
-
accept = _useContext.accept,
|
|
24200
24271
|
configuredAmount = _useContext.amount;
|
|
24201
24272
|
_useContext.toAmount;
|
|
24202
|
-
var recover = _useContext.recover
|
|
24273
|
+
var recover = _useContext.recover,
|
|
24274
|
+
accept = _useContext.accept;
|
|
24203
24275
|
React.useContext(ConfigurationContext);
|
|
24204
24276
|
var _useState = React.useState(recover == undefined ? configurationsMissAmounts(accept) : false),
|
|
24205
24277
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -24817,9 +24889,12 @@
|
|
|
24817
24889
|
_useContext.navigate;
|
|
24818
24890
|
var set = _useContext.set;
|
|
24819
24891
|
var _useContext2 = React.useContext(ConfigurationContext),
|
|
24820
|
-
accept = _useContext2.accept
|
|
24821
|
-
|
|
24822
|
-
|
|
24892
|
+
accept = _useContext2.accept,
|
|
24893
|
+
sell = _useContext2.sell;
|
|
24894
|
+
var _useContext3 = React.useContext(ChangableAmountContext),
|
|
24895
|
+
acceptWithAmount = _useContext3.acceptWithAmount;
|
|
24896
|
+
var _useContext4 = React.useContext(ClosableContext),
|
|
24897
|
+
close = _useContext4.close;
|
|
24823
24898
|
var setRecommendation = function setRecommendation(_x) {
|
|
24824
24899
|
return (_ref2 = _ref2 || _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee3(_ref) {
|
|
24825
24900
|
var route, accept, nativeAvailableAsset, token, asset, _ref3, _ref4;
|
|
@@ -25030,7 +25105,7 @@
|
|
|
25030
25105
|
return regenerator.wrap(function _callee6$(_context6) {
|
|
25031
25106
|
while (1) switch (_context6.prev = _context6.next) {
|
|
25032
25107
|
case 0:
|
|
25033
|
-
directTransfer = accept.find(function (accept) {
|
|
25108
|
+
directTransfer = !sell && (acceptWithAmount || accept).find(function (accept) {
|
|
25034
25109
|
return props.assets.find(function (asset) {
|
|
25035
25110
|
return accept.blockchain === asset.blockchain && accept.token.toLowerCase() === asset.address.toLowerCase();
|
|
25036
25111
|
});
|
|
@@ -25082,7 +25157,7 @@
|
|
|
25082
25157
|
})) {
|
|
25083
25158
|
return;
|
|
25084
25159
|
} // consdier only major tokens for this
|
|
25085
|
-
return accept.map(function (_x4) {
|
|
25160
|
+
return (acceptWithAmount || accept).map(function (_x4) {
|
|
25086
25161
|
return (_ref6 = _ref6 || _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee4(accept) {
|
|
25087
25162
|
return regenerator.wrap(function _callee4$(_context4) {
|
|
25088
25163
|
while (1) switch (_context4.prev = _context4.next) {
|
|
@@ -25127,15 +25202,15 @@
|
|
|
25127
25202
|
return regenerator.wrap(function _callee5$(_context5) {
|
|
25128
25203
|
while (1) switch (_context5.prev = _context5.next) {
|
|
25129
25204
|
case 0:
|
|
25130
|
-
route = (routes || []).flat().find(function (route) {
|
|
25131
|
-
return accept.find(function (accept) {
|
|
25205
|
+
route = (routes.filter(Boolean) || []).flat().find(function (route) {
|
|
25206
|
+
return (acceptWithAmount || accept).find(function (accept) {
|
|
25132
25207
|
return accept.blockchain === route.blockchain && accept.token.toLowerCase() === route.tokenOut.toLowerCase();
|
|
25133
25208
|
});
|
|
25134
25209
|
}) || routes.flat()[0];
|
|
25135
25210
|
if (!route) {
|
|
25136
25211
|
set(['NoPaymentOptionFound']);
|
|
25137
25212
|
} else {
|
|
25138
|
-
recommendedAccept = accept.find(function (accept) {
|
|
25213
|
+
recommendedAccept = (acceptWithAmount || accept).find(function (accept) {
|
|
25139
25214
|
return accept.blockchain === route.blockchain && accept.token.toLowerCase() === route.tokenOut.toLowerCase();
|
|
25140
25215
|
}) || accept.find(function (accept) {
|
|
25141
25216
|
return accept.blockchain === route.blockchain;
|
|
@@ -28422,6 +28497,7 @@
|
|
|
28422
28497
|
}, /*#__PURE__*/React__default["default"].createElement(ConfigurationProvider, {
|
|
28423
28498
|
configuration: {
|
|
28424
28499
|
type: 'sale',
|
|
28500
|
+
accept: accept,
|
|
28425
28501
|
tokenImage: tokenImage,
|
|
28426
28502
|
amount: amount,
|
|
28427
28503
|
sell: sell,
|
|
@@ -28441,9 +28517,7 @@
|
|
|
28441
28517
|
container: container,
|
|
28442
28518
|
connected: connected,
|
|
28443
28519
|
unmount: unmount
|
|
28444
|
-
}, /*#__PURE__*/React__default["default"].createElement(NavigateProvider, null, /*#__PURE__*/React__default["default"].createElement(ConversionRateProvider, null, /*#__PURE__*/React__default["default"].createElement(ChangableAmountProvider, {
|
|
28445
|
-
accept: accept
|
|
28446
|
-
}, /*#__PURE__*/React__default["default"].createElement(TransactionTrackingProvider, null, /*#__PURE__*/React__default["default"].createElement(PaymentTrackingProvider, {
|
|
28520
|
+
}, /*#__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, {
|
|
28447
28521
|
document: ensureDocument(document)
|
|
28448
28522
|
}, /*#__PURE__*/React__default["default"].createElement(SaleRoutingProvider, {
|
|
28449
28523
|
container: container,
|