@depay/widgets 11.1.0 → 11.1.2
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 +5 -4
- package/dist/esm/index.evm.js +261 -261
- package/dist/esm/index.evm.js.map +1 -1
- package/dist/esm/index.js +261 -261
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.solana.js +261 -261
- package/dist/esm/index.solana.js.map +1 -1
- package/dist/umd/index.bundle.js +5 -4
- package/dist/umd/index.evm.js +257 -257
- package/dist/umd/index.evm.js.map +1 -1
- package/dist/umd/index.js +257 -257
- package/dist/umd/index.js.map +1 -1
- package/dist/umd/index.solana.js +257 -257
- package/dist/umd/index.solana.js.map +1 -1
- package/package.json +5 -4
package/dist/esm/index.solana.js
CHANGED
|
@@ -10,11 +10,11 @@ import ReactDOM from 'react-dom';
|
|
|
10
10
|
import { ReactShadowDOM } from '@depay/react-shadow-dom';
|
|
11
11
|
import { setProviderEndpoints, request } from '@depay/web3-client-solana';
|
|
12
12
|
import { Currency } from '@depay/local-currency';
|
|
13
|
-
import { route } from '@depay/web3-
|
|
14
|
-
import { route as route$1 } from '@depay/web3-exchanges-solana';
|
|
13
|
+
import { route } from '@depay/web3-exchanges-solana';
|
|
15
14
|
import { Token } from '@depay/web3-tokens-solana';
|
|
16
15
|
import { ethers } from 'ethers';
|
|
17
16
|
import { Decimal } from 'decimal.js';
|
|
17
|
+
import { route as route$1 } from '@depay/web3-payments-solana';
|
|
18
18
|
import { TokenImage } from '@depay/react-token-image-solana';
|
|
19
19
|
import { struct, u64, Buffer, PublicKey } from '@depay/solana-web3.js';
|
|
20
20
|
|
|
@@ -3954,8 +3954,8 @@ var MenuIcon = (function (props) {
|
|
|
3954
3954
|
}));
|
|
3955
3955
|
});
|
|
3956
3956
|
|
|
3957
|
-
function ownKeys$
|
|
3958
|
-
function _objectSpread$
|
|
3957
|
+
function ownKeys$7(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; }
|
|
3958
|
+
function _objectSpread$7(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$7(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$7(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3959
3959
|
var SelectWalletList = (function (props) {
|
|
3960
3960
|
var parentElement = React.useRef();
|
|
3961
3961
|
var fuse = new Fuse(allWallets, {
|
|
@@ -4016,7 +4016,7 @@ var SelectWalletList = (function (props) {
|
|
|
4016
4016
|
className: "Card small",
|
|
4017
4017
|
title: "Connect ".concat(resultList[virtualItem.key].name),
|
|
4018
4018
|
onClick: function onClick() {
|
|
4019
|
-
props.onClickWallet(_objectSpread$
|
|
4019
|
+
props.onClickWallet(_objectSpread$7({}, resultList[virtualItem.key]));
|
|
4020
4020
|
}
|
|
4021
4021
|
}, /*#__PURE__*/React.createElement("div", {
|
|
4022
4022
|
className: "CardImage"
|
|
@@ -4033,8 +4033,8 @@ var SelectWalletList = (function (props) {
|
|
|
4033
4033
|
})));
|
|
4034
4034
|
});
|
|
4035
4035
|
|
|
4036
|
-
function ownKeys$
|
|
4037
|
-
function _objectSpread$
|
|
4036
|
+
function ownKeys$6(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; }
|
|
4037
|
+
function _objectSpread$6(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$6(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$6(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4038
4038
|
var SelectWalletDialog = (function (props) {
|
|
4039
4039
|
var _useState = useState(''),
|
|
4040
4040
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -4130,7 +4130,7 @@ var SelectWalletDialog = (function (props) {
|
|
|
4130
4130
|
className: "Card small",
|
|
4131
4131
|
title: "Connect ".concat(walletMetaData.name),
|
|
4132
4132
|
onClick: function onClick() {
|
|
4133
|
-
onClickWallet(_objectSpread$
|
|
4133
|
+
onClickWallet(_objectSpread$6(_objectSpread$6({}, walletMetaData), {}, {
|
|
4134
4134
|
via: 'detected',
|
|
4135
4135
|
connectionType: connectionType
|
|
4136
4136
|
}), wallet);
|
|
@@ -4165,7 +4165,7 @@ var SelectWalletDialog = (function (props) {
|
|
|
4165
4165
|
className: "Card small",
|
|
4166
4166
|
title: "Connect ".concat(previouslyConnectedWallet.name),
|
|
4167
4167
|
onClick: function onClick() {
|
|
4168
|
-
onClickWallet(_objectSpread$
|
|
4168
|
+
onClickWallet(_objectSpread$6(_objectSpread$6({}, previouslyConnectedWallet), {}, {
|
|
4169
4169
|
via: 'previouslyConnected',
|
|
4170
4170
|
connectionType: 'app'
|
|
4171
4171
|
}));
|
|
@@ -4615,7 +4615,7 @@ class Dialog extends React.Component {
|
|
|
4615
4615
|
const classNames = ['ReactDialog', this.state.open ? 'ReactDialogOpen' : ''];
|
|
4616
4616
|
const style = ReactDialogStyle({ background: this.props.background });
|
|
4617
4617
|
return (
|
|
4618
|
-
React.createElement('div', { className: classNames.join(' '), __self: this, __source: {fileName: _jsxFileName$1, lineNumber: 55}}
|
|
4618
|
+
React.createElement('div', { key: this.props.dialogKey, className: classNames.join(' '), __self: this, __source: {fileName: _jsxFileName$1, lineNumber: 55}}
|
|
4619
4619
|
, React.createElement('style', {__self: this, __source: {fileName: _jsxFileName$1, lineNumber: 56}}, style)
|
|
4620
4620
|
, React.createElement('div', { className: "ReactDialogInner", __self: this, __source: {fileName: _jsxFileName$1, lineNumber: 57}}
|
|
4621
4621
|
, React.createElement('div', { className: "ReactDialogBackground", onClick: this.onClickBackground.bind(this), __self: this, __source: {fileName: _jsxFileName$1, lineNumber: 58}} )
|
|
@@ -5117,39 +5117,6 @@ var NavigateProvider = (function (props) {
|
|
|
5117
5117
|
}, props.children);
|
|
5118
5118
|
});
|
|
5119
5119
|
|
|
5120
|
-
function ownKeys$4(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; }
|
|
5121
|
-
function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$4(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$4(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5122
|
-
var prepareAcceptedPayments = function prepareAcceptedPayments(accept) {
|
|
5123
|
-
var toAddress = _typeof(accept.receiver) == 'object' ? accept.receiver.address : accept.receiver;
|
|
5124
|
-
var toContract = _typeof(accept.receiver) == 'object' ? accept.receiver : undefined;
|
|
5125
|
-
return _objectSpread$4(_objectSpread$4({}, accept), {}, {
|
|
5126
|
-
toAddress: toAddress,
|
|
5127
|
-
toContract: toContract
|
|
5128
|
-
});
|
|
5129
|
-
};
|
|
5130
|
-
var mergeFromAccounts = function mergeFromAccounts(accept, account) {
|
|
5131
|
-
var from = {};
|
|
5132
|
-
accept.forEach(function (accept) {
|
|
5133
|
-
from[accept.blockchain] = account;
|
|
5134
|
-
});
|
|
5135
|
-
return from;
|
|
5136
|
-
};
|
|
5137
|
-
var routePayments = (function (_ref) {
|
|
5138
|
-
var accept = _ref.accept,
|
|
5139
|
-
account = _ref.account,
|
|
5140
|
-
whitelist = _ref.whitelist,
|
|
5141
|
-
blacklist = _ref.blacklist,
|
|
5142
|
-
fee = _ref.fee;
|
|
5143
|
-
return route({
|
|
5144
|
-
accept: accept.map(prepareAcceptedPayments),
|
|
5145
|
-
from: mergeFromAccounts(accept, account),
|
|
5146
|
-
whitelist: whitelist,
|
|
5147
|
-
blacklist: blacklist,
|
|
5148
|
-
event: 'ifRoutedAndNative',
|
|
5149
|
-
fee: fee
|
|
5150
|
-
});
|
|
5151
|
-
});
|
|
5152
|
-
|
|
5153
5120
|
var Loading = /*#__PURE__*/function () {
|
|
5154
5121
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(_ref) {
|
|
5155
5122
|
var text, style, error, critical, container, document, unmount;
|
|
@@ -5317,6 +5284,146 @@ var LoginStack = (function (props) {
|
|
|
5317
5284
|
});
|
|
5318
5285
|
});
|
|
5319
5286
|
|
|
5287
|
+
var round = (function (input) {
|
|
5288
|
+
var _digitsAfterDecimal;
|
|
5289
|
+
var direction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'up';
|
|
5290
|
+
var inputAsFloat = parseFloat(input);
|
|
5291
|
+
var digitsAfterDecimal = inputAsFloat.toString().match(/\d+\.0*(\d{4})/);
|
|
5292
|
+
if ((_digitsAfterDecimal = digitsAfterDecimal) !== null && _digitsAfterDecimal !== void 0 && _digitsAfterDecimal.length) {
|
|
5293
|
+
digitsAfterDecimal = digitsAfterDecimal[0];
|
|
5294
|
+
var focus = digitsAfterDecimal.match(/\d{4}$/)[0];
|
|
5295
|
+
var _float;
|
|
5296
|
+
var focusToFixed;
|
|
5297
|
+
if (focus.match(/^0/)) {
|
|
5298
|
+
if (direction == 'up') {
|
|
5299
|
+
_float = parseFloat("".concat(focus[1], ".").concat(focus[2]).concat(focus[3]));
|
|
5300
|
+
} else {
|
|
5301
|
+
_float = parseFloat("".concat(focus[1], ".").concat(focus[2]).concat(focus[3]));
|
|
5302
|
+
}
|
|
5303
|
+
focusToFixed = parseFloat(_float).toFixed(2);
|
|
5304
|
+
focusToFixed = "0".concat(focusToFixed).replace('.', '');
|
|
5305
|
+
} else {
|
|
5306
|
+
if (direction == 'up') {
|
|
5307
|
+
_float = parseFloat("".concat(focus[0], ".").concat(focus[1]).concat(focus[2], "9"));
|
|
5308
|
+
} else {
|
|
5309
|
+
_float = parseFloat("".concat(focus[0], ".").concat(focus[1]).concat(focus[2], "1"));
|
|
5310
|
+
}
|
|
5311
|
+
focusToFixed = parseFloat(_float).toFixed(2).replace('.', '');
|
|
5312
|
+
}
|
|
5313
|
+
if (focusToFixed == '0999' && parseInt(inputAsFloat.toFixed(0)) == 0) {
|
|
5314
|
+
focusToFixed = direction == 'up' ? '1000' : '0999';
|
|
5315
|
+
return parseFloat(digitsAfterDecimal.replace(/\d{4}$/, focusToFixed));
|
|
5316
|
+
} else if (focusToFixed == '1000' && parseInt(inputAsFloat.toFixed(0)) == 0) {
|
|
5317
|
+
return parseFloat(digitsAfterDecimal.replace(/\d{5}$/, focusToFixed));
|
|
5318
|
+
} else if (focusToFixed.toString()[0] != "0" && focusToFixed.toString().length > 3) {
|
|
5319
|
+
return parseInt(inputAsFloat.toFixed(0));
|
|
5320
|
+
} else {
|
|
5321
|
+
return parseFloat(digitsAfterDecimal.replace(/\d{4}$/, focusToFixed));
|
|
5322
|
+
}
|
|
5323
|
+
} else {
|
|
5324
|
+
return parseFloat(inputAsFloat.toFixed(3));
|
|
5325
|
+
}
|
|
5326
|
+
});
|
|
5327
|
+
|
|
5328
|
+
var format = (function (input) {
|
|
5329
|
+
var _float = round(input);
|
|
5330
|
+
var floatToString = _float.toString();
|
|
5331
|
+
if (new RegExp(/\./).test(floatToString)) {
|
|
5332
|
+
var exploded = floatToString.split('.');
|
|
5333
|
+
return new Intl.NumberFormat().format(parseInt(exploded[0])) + '.' + exploded[1];
|
|
5334
|
+
} else {
|
|
5335
|
+
return new Intl.NumberFormat().format(_float);
|
|
5336
|
+
}
|
|
5337
|
+
});
|
|
5338
|
+
|
|
5339
|
+
var PaymentBlockchainsDialog = (function () {
|
|
5340
|
+
var _useContext = useContext(ConfigurationContext),
|
|
5341
|
+
accept = _useContext.accept;
|
|
5342
|
+
var _useContext2 = useContext(NavigateStackContext),
|
|
5343
|
+
navigate = _useContext2.navigate;
|
|
5344
|
+
var blockchains = _toConsumableArray(new Set(accept.map(function (configuration) {
|
|
5345
|
+
return configuration.blockchain;
|
|
5346
|
+
}))).map(function (blockchainName) {
|
|
5347
|
+
return Blockchains[blockchainName];
|
|
5348
|
+
});
|
|
5349
|
+
return /*#__PURE__*/React.createElement(Dialog$1, {
|
|
5350
|
+
stacked: true,
|
|
5351
|
+
header: /*#__PURE__*/React.createElement("div", {
|
|
5352
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
5353
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h1", {
|
|
5354
|
+
className: "LineHeightL FontSizeL"
|
|
5355
|
+
}, "Available blockchains"))),
|
|
5356
|
+
body: /*#__PURE__*/React.createElement("div", {
|
|
5357
|
+
className: "MaxHeight PaddingTopM PaddingBottomM"
|
|
5358
|
+
}, blockchains.map(function (blockchain, index) {
|
|
5359
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
5360
|
+
key: index,
|
|
5361
|
+
className: "Card Row"
|
|
5362
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
5363
|
+
className: "CardImage"
|
|
5364
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
5365
|
+
className: "transparent",
|
|
5366
|
+
src: blockchain.logo
|
|
5367
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
5368
|
+
className: "CardBody"
|
|
5369
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
5370
|
+
className: "CardText"
|
|
5371
|
+
}, blockchain.label)));
|
|
5372
|
+
})),
|
|
5373
|
+
footer: /*#__PURE__*/React.createElement("div", {
|
|
5374
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
5375
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
5376
|
+
type: "button",
|
|
5377
|
+
className: "ButtonPrimary",
|
|
5378
|
+
onClick: function onClick() {
|
|
5379
|
+
return navigate('back');
|
|
5380
|
+
}
|
|
5381
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
5382
|
+
className: "FontSizeM"
|
|
5383
|
+
}, "\u276E"), " Go back"))
|
|
5384
|
+
});
|
|
5385
|
+
});
|
|
5386
|
+
|
|
5387
|
+
var WalletMissesBlockchainSupportDialog = (function (props) {
|
|
5388
|
+
var _useContext = useContext(NavigateStackContext),
|
|
5389
|
+
navigate = _useContext.navigate;
|
|
5390
|
+
return /*#__PURE__*/React.createElement(Dialog$1, {
|
|
5391
|
+
header: /*#__PURE__*/React.createElement("div", {
|
|
5392
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
5393
|
+
}),
|
|
5394
|
+
body: /*#__PURE__*/React.createElement("div", {
|
|
5395
|
+
className: "TextCenter"
|
|
5396
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
5397
|
+
className: "GraphicWrapper"
|
|
5398
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
5399
|
+
className: "Graphic",
|
|
5400
|
+
src: QuestionsGraphic
|
|
5401
|
+
})), /*#__PURE__*/React.createElement("h1", {
|
|
5402
|
+
className: "LineHeightL Text FontSizeL PaddingTopS FontWeightBold"
|
|
5403
|
+
}, "Wallet Misses Blockchain Support"), /*#__PURE__*/React.createElement("div", {
|
|
5404
|
+
className: "Text PaddingTopS PaddingBottomS PaddingLeftM PaddingRightM"
|
|
5405
|
+
}, /*#__PURE__*/React.createElement("strong", {
|
|
5406
|
+
className: "FontSizeM"
|
|
5407
|
+
}, "The connected wallet does not support the blockchains required by this payment. Try to connect another wallet that does support one of the available blockchains.")), /*#__PURE__*/React.createElement("div", {
|
|
5408
|
+
className: "PaddingBottomM"
|
|
5409
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
5410
|
+
onClick: function onClick() {
|
|
5411
|
+
return navigate('PaymentBlockchains');
|
|
5412
|
+
},
|
|
5413
|
+
className: "Link FontSizeM",
|
|
5414
|
+
title: "Check which blockchains are available"
|
|
5415
|
+
}, "Check available blockchains"))),
|
|
5416
|
+
footer: /*#__PURE__*/React.createElement("div", {
|
|
5417
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
5418
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
5419
|
+
className: "ButtonPrimary",
|
|
5420
|
+
onClick: function onClick() {
|
|
5421
|
+
return props.disconnect();
|
|
5422
|
+
}
|
|
5423
|
+
}, "Connect another wallet"))
|
|
5424
|
+
});
|
|
5425
|
+
});
|
|
5426
|
+
|
|
5320
5427
|
/**
|
|
5321
5428
|
* @license
|
|
5322
5429
|
* Lodash <https://lodash.com/>
|
|
@@ -22517,26 +22624,39 @@ var lodash = createCommonjsModule(function (module, exports) {
|
|
|
22517
22624
|
});
|
|
22518
22625
|
|
|
22519
22626
|
var WalletProvider = (function (props) {
|
|
22520
|
-
var _useContext = useContext(
|
|
22521
|
-
|
|
22522
|
-
|
|
22523
|
-
var _useContext2 = useContext(
|
|
22524
|
-
_useContext2.
|
|
22627
|
+
var _useContext = useContext(ClosableContext),
|
|
22628
|
+
open = _useContext.open,
|
|
22629
|
+
close = _useContext.close;
|
|
22630
|
+
var _useContext2 = useContext(ConfigurationContext),
|
|
22631
|
+
accept = _useContext2.accept,
|
|
22632
|
+
recover = _useContext2.recover,
|
|
22633
|
+
passedWallet = _useContext2.wallet;
|
|
22634
|
+
var _useContext3 = useContext(UpdatableContext),
|
|
22635
|
+
setUpdatable = _useContext3.setUpdatable;
|
|
22636
|
+
var _useContext4 = useContext(ErrorContext);
|
|
22637
|
+
_useContext4.setError;
|
|
22525
22638
|
var _useState = useState(passedWallet),
|
|
22526
22639
|
_useState2 = _slicedToArray(_useState, 2),
|
|
22527
22640
|
wallet = _useState2[0],
|
|
22528
22641
|
setWallet = _useState2[1];
|
|
22529
|
-
var _useState3 = useState(),
|
|
22642
|
+
var _useState3 = useState(false),
|
|
22530
22643
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
22531
|
-
|
|
22532
|
-
|
|
22533
|
-
var _useState5 = useState(
|
|
22644
|
+
walletMissesBlockchainSupport = _useState4[0],
|
|
22645
|
+
setWalletMissesBlockchainSupport = _useState4[1];
|
|
22646
|
+
var _useState5 = useState(),
|
|
22534
22647
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
22535
|
-
|
|
22536
|
-
|
|
22648
|
+
account = _useState6[0],
|
|
22649
|
+
setAccount = _useState6[1];
|
|
22650
|
+
var _useState7 = useState(passedWallet ? 'connected' : undefined),
|
|
22651
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
22652
|
+
walletState = _useState8[0],
|
|
22653
|
+
setWalletState = _useState8[1];
|
|
22537
22654
|
var connect = useCallback(lodash.debounce(function () {
|
|
22538
22655
|
wallet.connect().then(setAccount);
|
|
22539
22656
|
}));
|
|
22657
|
+
var debounceSetWalletMissesBlockchainSupport = useCallback(lodash.debounce(function (value) {
|
|
22658
|
+
setWalletMissesBlockchainSupport(value);
|
|
22659
|
+
}));
|
|
22540
22660
|
var connected = function connected(_ref) {
|
|
22541
22661
|
var account = _ref.account,
|
|
22542
22662
|
wallet = _ref.wallet;
|
|
@@ -22553,11 +22673,21 @@ var WalletProvider = (function (props) {
|
|
|
22553
22673
|
setAccount();
|
|
22554
22674
|
setWallet();
|
|
22555
22675
|
setWalletState();
|
|
22676
|
+
setWalletMissesBlockchainSupport(false);
|
|
22556
22677
|
};
|
|
22557
22678
|
useEffect(function () {
|
|
22558
22679
|
if (!wallet) {
|
|
22559
22680
|
return;
|
|
22560
22681
|
}
|
|
22682
|
+
if (accept && !accept.some(function (configuration) {
|
|
22683
|
+
return wallet.blockchains.includes(configuration.blockchain);
|
|
22684
|
+
})) {
|
|
22685
|
+
setUpdatable(false);
|
|
22686
|
+
setTimeout(function () {
|
|
22687
|
+
return debounceSetWalletMissesBlockchainSupport(true);
|
|
22688
|
+
}, 200);
|
|
22689
|
+
return;
|
|
22690
|
+
}
|
|
22561
22691
|
var onAccountChanged = function onAccountChanged(account) {
|
|
22562
22692
|
if (account) {
|
|
22563
22693
|
setAccount(account);
|
|
@@ -22597,7 +22727,21 @@ var WalletProvider = (function (props) {
|
|
|
22597
22727
|
}, _callee);
|
|
22598
22728
|
}))();
|
|
22599
22729
|
}, []);
|
|
22600
|
-
if (
|
|
22730
|
+
if (walletMissesBlockchainSupport) {
|
|
22731
|
+
return /*#__PURE__*/React.createElement(ReactDialogStack, {
|
|
22732
|
+
open: open,
|
|
22733
|
+
close: close,
|
|
22734
|
+
start: "WalletMissesBlockchainSupport",
|
|
22735
|
+
container: props.container,
|
|
22736
|
+
document: props.document,
|
|
22737
|
+
dialogs: {
|
|
22738
|
+
WalletMissesBlockchainSupport: /*#__PURE__*/React.createElement(WalletMissesBlockchainSupportDialog, {
|
|
22739
|
+
disconnect: disconnect
|
|
22740
|
+
}),
|
|
22741
|
+
PaymentBlockchains: /*#__PURE__*/React.createElement(PaymentBlockchainsDialog, null)
|
|
22742
|
+
}
|
|
22743
|
+
});
|
|
22744
|
+
} else if (walletState == 'connected' || recover != undefined) {
|
|
22601
22745
|
return /*#__PURE__*/React.createElement(WalletContext.Provider, {
|
|
22602
22746
|
value: {
|
|
22603
22747
|
account: account,
|
|
@@ -22713,47 +22857,8 @@ var findMaxRoute = (function (routes) {
|
|
|
22713
22857
|
return sortedLowToHigh[sortedLowToHigh.length - 1];
|
|
22714
22858
|
});
|
|
22715
22859
|
|
|
22716
|
-
var
|
|
22717
|
-
|
|
22718
|
-
var direction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'up';
|
|
22719
|
-
var inputAsFloat = parseFloat(input);
|
|
22720
|
-
var digitsAfterDecimal = inputAsFloat.toString().match(/\d+\.0*(\d{4})/);
|
|
22721
|
-
if ((_digitsAfterDecimal = digitsAfterDecimal) !== null && _digitsAfterDecimal !== void 0 && _digitsAfterDecimal.length) {
|
|
22722
|
-
digitsAfterDecimal = digitsAfterDecimal[0];
|
|
22723
|
-
var focus = digitsAfterDecimal.match(/\d{4}$/)[0];
|
|
22724
|
-
var _float;
|
|
22725
|
-
var focusToFixed;
|
|
22726
|
-
if (focus.match(/^0/)) {
|
|
22727
|
-
if (direction == 'up') {
|
|
22728
|
-
_float = parseFloat("".concat(focus[1], ".").concat(focus[2]).concat(focus[3]));
|
|
22729
|
-
} else {
|
|
22730
|
-
_float = parseFloat("".concat(focus[1], ".").concat(focus[2]).concat(focus[3]));
|
|
22731
|
-
}
|
|
22732
|
-
focusToFixed = parseFloat(_float).toFixed(2);
|
|
22733
|
-
focusToFixed = "0".concat(focusToFixed).replace('.', '');
|
|
22734
|
-
} else {
|
|
22735
|
-
if (direction == 'up') {
|
|
22736
|
-
_float = parseFloat("".concat(focus[0], ".").concat(focus[1]).concat(focus[2], "9"));
|
|
22737
|
-
} else {
|
|
22738
|
-
_float = parseFloat("".concat(focus[0], ".").concat(focus[1]).concat(focus[2], "1"));
|
|
22739
|
-
}
|
|
22740
|
-
focusToFixed = parseFloat(_float).toFixed(2).replace('.', '');
|
|
22741
|
-
}
|
|
22742
|
-
if (focusToFixed == '0999' && parseInt(inputAsFloat.toFixed(0)) == 0) {
|
|
22743
|
-
focusToFixed = direction == 'up' ? '1000' : '0999';
|
|
22744
|
-
return parseFloat(digitsAfterDecimal.replace(/\d{4}$/, focusToFixed));
|
|
22745
|
-
} else if (focusToFixed == '1000' && parseInt(inputAsFloat.toFixed(0)) == 0) {
|
|
22746
|
-
return parseFloat(digitsAfterDecimal.replace(/\d{5}$/, focusToFixed));
|
|
22747
|
-
} else if (focusToFixed.toString()[0] != "0" && focusToFixed.toString().length > 3) {
|
|
22748
|
-
return parseInt(inputAsFloat.toFixed(0));
|
|
22749
|
-
} else {
|
|
22750
|
-
return parseFloat(digitsAfterDecimal.replace(/\d{4}$/, focusToFixed));
|
|
22751
|
-
}
|
|
22752
|
-
} else {
|
|
22753
|
-
return parseFloat(inputAsFloat.toFixed(3));
|
|
22754
|
-
}
|
|
22755
|
-
});
|
|
22756
|
-
|
|
22860
|
+
function ownKeys$5(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; }
|
|
22861
|
+
function _objectSpread$5(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$5(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$5(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
22757
22862
|
var ChangableAmountProvider = (function (props) {
|
|
22758
22863
|
var configurationsMissAmounts = function configurationsMissAmounts(configurations) {
|
|
22759
22864
|
return !configurations.every(function (configuration) {
|
|
@@ -22828,7 +22933,7 @@ var ChangableAmountProvider = (function (props) {
|
|
|
22828
22933
|
if (Blockchains[configuration.blockchain].stables.usd[0] == configuration.token) {
|
|
22829
22934
|
return 1.00 / fixedCurrencyConversionRate * fixedAmount;
|
|
22830
22935
|
} else {
|
|
22831
|
-
return route
|
|
22936
|
+
return route({
|
|
22832
22937
|
blockchain: configuration.blockchain,
|
|
22833
22938
|
tokenIn: Blockchains[configuration.blockchain].stables.usd[0],
|
|
22834
22939
|
amountIn: 1.00 / fixedCurrencyConversionRate * fixedAmount,
|
|
@@ -22841,7 +22946,7 @@ var ChangableAmountProvider = (function (props) {
|
|
|
22841
22946
|
if (Blockchains[configuration.blockchain].stables.usd[0] == configuration.token) {
|
|
22842
22947
|
return 1.00 / conversionRate * amount;
|
|
22843
22948
|
} else {
|
|
22844
|
-
return route
|
|
22949
|
+
return route({
|
|
22845
22950
|
blockchain: configuration.blockchain,
|
|
22846
22951
|
tokenIn: Blockchains[configuration.blockchain].stables.usd[0],
|
|
22847
22952
|
amountIn: 1.00 / conversionRate * amount,
|
|
@@ -22870,8 +22975,8 @@ var ChangableAmountProvider = (function (props) {
|
|
|
22870
22975
|
});
|
|
22871
22976
|
};
|
|
22872
22977
|
var updateAmounts = useCallback(lodash.debounce(function (_ref2) {
|
|
22873
|
-
|
|
22874
|
-
amount = _ref2.amount,
|
|
22978
|
+
_ref2.account;
|
|
22979
|
+
var amount = _ref2.amount,
|
|
22875
22980
|
conversionRate = _ref2.conversionRate,
|
|
22876
22981
|
fixedCurrencyConversionRate = _ref2.fixedCurrencyConversionRate;
|
|
22877
22982
|
getAmounts({
|
|
@@ -22883,12 +22988,9 @@ var ChangableAmountProvider = (function (props) {
|
|
|
22883
22988
|
if (amounts[index] == undefined) {
|
|
22884
22989
|
return;
|
|
22885
22990
|
}
|
|
22886
|
-
return {
|
|
22887
|
-
|
|
22888
|
-
|
|
22889
|
-
token: configuration.token,
|
|
22890
|
-
receiver: configuration.receiver || account
|
|
22891
|
-
};
|
|
22991
|
+
return _objectSpread$5(_objectSpread$5({}, configuration), {}, {
|
|
22992
|
+
amount: round(amounts[index])
|
|
22993
|
+
});
|
|
22892
22994
|
}).filter(function (configuration) {
|
|
22893
22995
|
return !!configuration;
|
|
22894
22996
|
}));
|
|
@@ -22911,7 +23013,7 @@ var ChangableAmountProvider = (function (props) {
|
|
|
22911
23013
|
if (amountsMissing && maxRoute) {
|
|
22912
23014
|
maxRoute.fromToken.readable(maxRoute.fromBalance).then(function (readableMaxAmount) {
|
|
22913
23015
|
if (configuredAmount && configuredAmount.token) {
|
|
22914
|
-
route
|
|
23016
|
+
route({
|
|
22915
23017
|
blockchain: maxRoute.blockchain,
|
|
22916
23018
|
tokenIn: maxRoute.fromToken.address,
|
|
22917
23019
|
tokenOut: maxRoute.toToken.address,
|
|
@@ -22941,7 +23043,7 @@ var ChangableAmountProvider = (function (props) {
|
|
|
22941
23043
|
var _maxAmount = parseFloat(new Decimal(readableMaxAmount).mul(conversionRate).toString());
|
|
22942
23044
|
setMaxAmount(_maxAmount > 10 ? Math.round(_maxAmount - 1) : _maxAmount - 1);
|
|
22943
23045
|
} else {
|
|
22944
|
-
route
|
|
23046
|
+
route({
|
|
22945
23047
|
blockchain: maxRoute.blockchain,
|
|
22946
23048
|
tokenIn: maxRoute.fromToken.address,
|
|
22947
23049
|
tokenOut: Blockchains[maxRoute.blockchain].stables.usd[0],
|
|
@@ -23022,106 +23124,38 @@ var ConversionRateProvider = (function (props) {
|
|
|
23022
23124
|
|
|
23023
23125
|
var PaymentAmountRoutingContext = /*#__PURE__*/React.createContext();
|
|
23024
23126
|
|
|
23025
|
-
var
|
|
23026
|
-
var _float = round(input);
|
|
23027
|
-
var floatToString = _float.toString();
|
|
23028
|
-
if (new RegExp(/\./).test(floatToString)) {
|
|
23029
|
-
var exploded = floatToString.split('.');
|
|
23030
|
-
return new Intl.NumberFormat().format(parseInt(exploded[0])) + '.' + exploded[1];
|
|
23031
|
-
} else {
|
|
23032
|
-
return new Intl.NumberFormat().format(_float);
|
|
23033
|
-
}
|
|
23034
|
-
});
|
|
23127
|
+
var PaymentRoutingContext = /*#__PURE__*/React.createContext();
|
|
23035
23128
|
|
|
23036
|
-
var
|
|
23037
|
-
|
|
23038
|
-
|
|
23039
|
-
var
|
|
23040
|
-
|
|
23041
|
-
|
|
23042
|
-
|
|
23043
|
-
|
|
23044
|
-
return Blockchains[blockchainName];
|
|
23129
|
+
function ownKeys$4(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; }
|
|
23130
|
+
function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$4(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$4(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
23131
|
+
var prepareAcceptedPayments = function prepareAcceptedPayments(accept) {
|
|
23132
|
+
var toAddress = _typeof(accept.receiver) == 'object' ? accept.receiver.address : accept.receiver;
|
|
23133
|
+
var toContract = _typeof(accept.receiver) == 'object' ? accept.receiver : undefined;
|
|
23134
|
+
return _objectSpread$4(_objectSpread$4({}, accept), {}, {
|
|
23135
|
+
toAddress: toAddress,
|
|
23136
|
+
toContract: toContract
|
|
23045
23137
|
});
|
|
23046
|
-
|
|
23047
|
-
|
|
23048
|
-
|
|
23049
|
-
|
|
23050
|
-
|
|
23051
|
-
className: "LineHeightL FontSizeL"
|
|
23052
|
-
}, "Available blockchains"))),
|
|
23053
|
-
body: /*#__PURE__*/React.createElement("div", {
|
|
23054
|
-
className: "MaxHeight PaddingTopM PaddingBottomM"
|
|
23055
|
-
}, blockchains.map(function (blockchain, index) {
|
|
23056
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
23057
|
-
key: index,
|
|
23058
|
-
className: "Card Row"
|
|
23059
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
23060
|
-
className: "CardImage"
|
|
23061
|
-
}, /*#__PURE__*/React.createElement("img", {
|
|
23062
|
-
className: "transparent",
|
|
23063
|
-
src: blockchain.logo
|
|
23064
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
23065
|
-
className: "CardBody"
|
|
23066
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
23067
|
-
className: "CardText"
|
|
23068
|
-
}, blockchain.label)));
|
|
23069
|
-
})),
|
|
23070
|
-
footer: /*#__PURE__*/React.createElement("div", {
|
|
23071
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
23072
|
-
}, /*#__PURE__*/React.createElement("button", {
|
|
23073
|
-
type: "button",
|
|
23074
|
-
className: "ButtonPrimary",
|
|
23075
|
-
onClick: function onClick() {
|
|
23076
|
-
return navigate('back');
|
|
23077
|
-
}
|
|
23078
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
23079
|
-
className: "FontSizeM"
|
|
23080
|
-
}, "\u276E"), " Go back"))
|
|
23138
|
+
};
|
|
23139
|
+
var mergeFromAccounts = function mergeFromAccounts(accept, account) {
|
|
23140
|
+
var from = {};
|
|
23141
|
+
accept.forEach(function (accept) {
|
|
23142
|
+
from[accept.blockchain] = account;
|
|
23081
23143
|
});
|
|
23082
|
-
|
|
23083
|
-
|
|
23084
|
-
var
|
|
23085
|
-
|
|
23086
|
-
|
|
23087
|
-
|
|
23088
|
-
|
|
23089
|
-
|
|
23090
|
-
|
|
23091
|
-
|
|
23092
|
-
|
|
23093
|
-
|
|
23094
|
-
|
|
23095
|
-
|
|
23096
|
-
|
|
23097
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
23098
|
-
className: "GraphicWrapper"
|
|
23099
|
-
}, /*#__PURE__*/React.createElement("img", {
|
|
23100
|
-
className: "Graphic",
|
|
23101
|
-
src: QuestionsGraphic
|
|
23102
|
-
})), /*#__PURE__*/React.createElement("h1", {
|
|
23103
|
-
className: "LineHeightL Text FontSizeL PaddingTopS FontWeightBold"
|
|
23104
|
-
}, "Wallet Misses Blockchain Support"), /*#__PURE__*/React.createElement("div", {
|
|
23105
|
-
className: "Text PaddingTopS PaddingBottomS PaddingLeftM PaddingRightM"
|
|
23106
|
-
}, /*#__PURE__*/React.createElement("strong", {
|
|
23107
|
-
className: "FontSizeM"
|
|
23108
|
-
}, "The connected wallet does not support the blockchains required by this payment. Try to connect another wallet that does support one of the available blockchains.")), /*#__PURE__*/React.createElement("div", {
|
|
23109
|
-
className: "PaddingBottomM"
|
|
23110
|
-
}, /*#__PURE__*/React.createElement("button", {
|
|
23111
|
-
onClick: function onClick() {
|
|
23112
|
-
return navigate('PaymentBlockchains');
|
|
23113
|
-
},
|
|
23114
|
-
className: "Link FontSizeM",
|
|
23115
|
-
title: "Check which blockchains are available"
|
|
23116
|
-
}, "Check available blockchains"))),
|
|
23117
|
-
footer: /*#__PURE__*/React.createElement("div", {
|
|
23118
|
-
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
23119
|
-
}, /*#__PURE__*/React.createElement("button", {
|
|
23120
|
-
className: "ButtonPrimary",
|
|
23121
|
-
onClick: function onClick() {
|
|
23122
|
-
return disconnect();
|
|
23123
|
-
}
|
|
23124
|
-
}, "Connect another wallet"))
|
|
23144
|
+
return from;
|
|
23145
|
+
};
|
|
23146
|
+
var routePayments = (function (_ref) {
|
|
23147
|
+
var accept = _ref.accept,
|
|
23148
|
+
account = _ref.account,
|
|
23149
|
+
whitelist = _ref.whitelist,
|
|
23150
|
+
blacklist = _ref.blacklist,
|
|
23151
|
+
fee = _ref.fee;
|
|
23152
|
+
return route$1({
|
|
23153
|
+
accept: accept.map(prepareAcceptedPayments),
|
|
23154
|
+
from: mergeFromAccounts(accept, account),
|
|
23155
|
+
whitelist: whitelist,
|
|
23156
|
+
blacklist: blacklist,
|
|
23157
|
+
event: 'ifRoutedAndNative',
|
|
23158
|
+
fee: fee
|
|
23125
23159
|
});
|
|
23126
23160
|
});
|
|
23127
23161
|
|
|
@@ -23148,20 +23182,12 @@ var PaymentRoutingProvider = (function (props) {
|
|
|
23148
23182
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
23149
23183
|
reloadCount = _useState10[0],
|
|
23150
23184
|
setReloadCount = _useState10[1];
|
|
23151
|
-
var _useState11 = useState(false),
|
|
23152
|
-
_useState12 = _slicedToArray(_useState11, 2),
|
|
23153
|
-
walletMissesBlockchainSupport = _useState12[0],
|
|
23154
|
-
setWalletMissesBlockchainSupport = _useState12[1];
|
|
23155
23185
|
var _useContext = useContext(WalletContext),
|
|
23156
|
-
wallet = _useContext.wallet,
|
|
23157
23186
|
account = _useContext.account;
|
|
23158
23187
|
var _useContext2 = useContext(UpdatableContext),
|
|
23159
23188
|
updatable = _useContext2.updatable;
|
|
23160
23189
|
var _useContext3 = useContext(ConfigurationContext),
|
|
23161
23190
|
recover = _useContext3.recover;
|
|
23162
|
-
var _useContext4 = useContext(ClosableContext),
|
|
23163
|
-
open = _useContext4.open,
|
|
23164
|
-
close = _useContext4.close;
|
|
23165
23191
|
var onRoutesUpdate = /*#__PURE__*/function () {
|
|
23166
23192
|
var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(routes) {
|
|
23167
23193
|
return regenerator.wrap(function _callee2$(_context2) {
|
|
@@ -23236,27 +23262,19 @@ var PaymentRoutingProvider = (function (props) {
|
|
|
23236
23262
|
}
|
|
23237
23263
|
return _context3.abrupt("return");
|
|
23238
23264
|
case 3:
|
|
23239
|
-
if (props.accept.some(function (configuration) {
|
|
23240
|
-
return wallet.blockchains.includes(configuration.blockchain);
|
|
23241
|
-
})) {
|
|
23242
|
-
_context3.next = 5;
|
|
23243
|
-
break;
|
|
23244
|
-
}
|
|
23245
|
-
return _context3.abrupt("return", setWalletMissesBlockchainSupport(true));
|
|
23246
|
-
case 5:
|
|
23247
23265
|
slowRoutingTimeout = setTimeout(function () {
|
|
23248
23266
|
setSlowRouting(true);
|
|
23249
23267
|
}, 4000);
|
|
23250
|
-
_context3.next =
|
|
23268
|
+
_context3.next = 6;
|
|
23251
23269
|
return routePayments(Object.assign({}, props, {
|
|
23252
23270
|
account: account
|
|
23253
23271
|
})).then(function (routes) {
|
|
23254
23272
|
clearInterval(slowRoutingTimeout);
|
|
23255
23273
|
onRoutesUpdate(routes);
|
|
23256
23274
|
});
|
|
23257
|
-
case
|
|
23275
|
+
case 6:
|
|
23258
23276
|
return _context3.abrupt("return", _context3.sent);
|
|
23259
|
-
case
|
|
23277
|
+
case 7:
|
|
23260
23278
|
case "end":
|
|
23261
23279
|
return _context3.stop();
|
|
23262
23280
|
}
|
|
@@ -23361,32 +23379,18 @@ var PaymentRoutingProvider = (function (props) {
|
|
|
23361
23379
|
refreshPaymentRoutes();
|
|
23362
23380
|
}
|
|
23363
23381
|
}, [account, props.accept]);
|
|
23364
|
-
|
|
23365
|
-
|
|
23366
|
-
|
|
23367
|
-
|
|
23368
|
-
|
|
23369
|
-
|
|
23370
|
-
|
|
23371
|
-
|
|
23372
|
-
|
|
23373
|
-
|
|
23374
|
-
|
|
23375
|
-
|
|
23376
|
-
} else {
|
|
23377
|
-
return /*#__PURE__*/React.createElement(PaymentRoutingContext.Provider, {
|
|
23378
|
-
value: {
|
|
23379
|
-
selectedRoute: selectedRoute,
|
|
23380
|
-
setSelectedRoute: setSelectedRoute,
|
|
23381
|
-
refreshPaymentRoutes: refreshPaymentRoutes,
|
|
23382
|
-
allRoutes: allRoutes,
|
|
23383
|
-
setAllRoutes: setAllRoutes,
|
|
23384
|
-
slowRouting: slowRouting,
|
|
23385
|
-
updatedRouteWithNewPrice: updatedRouteWithNewPrice,
|
|
23386
|
-
updateRouteWithNewPrice: updateRouteWithNewPrice
|
|
23387
|
-
}
|
|
23388
|
-
}, props.children);
|
|
23389
|
-
}
|
|
23382
|
+
return /*#__PURE__*/React.createElement(PaymentRoutingContext.Provider, {
|
|
23383
|
+
value: {
|
|
23384
|
+
selectedRoute: selectedRoute,
|
|
23385
|
+
setSelectedRoute: setSelectedRoute,
|
|
23386
|
+
refreshPaymentRoutes: refreshPaymentRoutes,
|
|
23387
|
+
allRoutes: allRoutes,
|
|
23388
|
+
setAllRoutes: setAllRoutes,
|
|
23389
|
+
slowRouting: slowRouting,
|
|
23390
|
+
updatedRouteWithNewPrice: updatedRouteWithNewPrice,
|
|
23391
|
+
updateRouteWithNewPrice: updateRouteWithNewPrice
|
|
23392
|
+
}
|
|
23393
|
+
}, props.children);
|
|
23390
23394
|
});
|
|
23391
23395
|
|
|
23392
23396
|
var PaymentAmountRoutingProvider = (function (props) {
|
|
@@ -25518,7 +25522,7 @@ var PaymentValueProvider = (function (props) {
|
|
|
25518
25522
|
setPaymentValue(null);
|
|
25519
25523
|
setPaymentValueLoss(null);
|
|
25520
25524
|
Promise.all([Promise.all(Blockchains[payment.route.blockchain].stables.usd.map(function (stable) {
|
|
25521
|
-
return route
|
|
25525
|
+
return route({
|
|
25522
25526
|
blockchain: payment.route.blockchain,
|
|
25523
25527
|
tokenIn: payment.route.fromToken.address,
|
|
25524
25528
|
tokenOut: stable,
|
|
@@ -25526,7 +25530,7 @@ var PaymentValueProvider = (function (props) {
|
|
|
25526
25530
|
fromAddress: account,
|
|
25527
25531
|
toAddress: account
|
|
25528
25532
|
});
|
|
25529
|
-
})), !payment.route.directTransfer ? route
|
|
25533
|
+
})), !payment.route.directTransfer ? route({
|
|
25530
25534
|
blockchain: payment.route.blockchain,
|
|
25531
25535
|
tokenIn: payment.route.toToken.address,
|
|
25532
25536
|
tokenOut: payment.route.fromToken.address,
|
|
@@ -25882,11 +25886,11 @@ var preflight$1 = /*#__PURE__*/function () {
|
|
|
25882
25886
|
}();
|
|
25883
25887
|
var Payment = /*#__PURE__*/function () {
|
|
25884
25888
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(_ref3) {
|
|
25885
|
-
var accept, amount, sent, succeeded, validated, failed, error, critical, style, whitelist, blacklist, providers, currency, connected, closed, track,
|
|
25889
|
+
var accept, amount, sent, succeeded, validated, failed, error, critical, style, whitelist, blacklist, providers, currency, connected, closed, track, recover, closable, integration, link, container, before, wallet, title, action, document, unmount;
|
|
25886
25890
|
return regenerator.wrap(function _callee2$(_context2) {
|
|
25887
25891
|
while (1) switch (_context2.prev = _context2.next) {
|
|
25888
25892
|
case 0:
|
|
25889
|
-
accept = _ref3.accept, amount = _ref3.amount, sent = _ref3.sent, succeeded = _ref3.succeeded, validated = _ref3.validated, 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,
|
|
25893
|
+
accept = _ref3.accept, amount = _ref3.amount, sent = _ref3.sent, succeeded = _ref3.succeeded, validated = _ref3.validated, 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, recover = _ref3.recover, closable = _ref3.closable, integration = _ref3.integration, link = _ref3.link, container = _ref3.container, before = _ref3.before, wallet = _ref3.wallet, title = _ref3.title, action = _ref3.action, document = _ref3.document;
|
|
25890
25894
|
requireReactVersion();
|
|
25891
25895
|
if (currency && !SUPPORTED_CURRENCIES.includes(currency.toLowerCase())) {
|
|
25892
25896
|
currency = false;
|
|
@@ -25928,7 +25932,6 @@ var Payment = /*#__PURE__*/function () {
|
|
|
25928
25932
|
blacklist: blacklist,
|
|
25929
25933
|
providers: providers,
|
|
25930
25934
|
track: track,
|
|
25931
|
-
fee: fee,
|
|
25932
25935
|
recover: recover,
|
|
25933
25936
|
integration: integration,
|
|
25934
25937
|
link: link,
|
|
@@ -25951,7 +25954,6 @@ var Payment = /*#__PURE__*/function () {
|
|
|
25951
25954
|
whitelist: whitelist,
|
|
25952
25955
|
blacklist: blacklist,
|
|
25953
25956
|
event: event,
|
|
25954
|
-
fee: fee,
|
|
25955
25957
|
container: container,
|
|
25956
25958
|
document: document
|
|
25957
25959
|
}, /*#__PURE__*/React.createElement(TransactionTrackingProvider, null, /*#__PURE__*/React.createElement(PaymentTrackingProvider, {
|
|
@@ -25991,13 +25993,11 @@ Payment.preload = function (_ref5) {
|
|
|
25991
25993
|
whitelist = _ref5.whitelist,
|
|
25992
25994
|
blacklist = _ref5.blacklist;
|
|
25993
25995
|
_ref5.event;
|
|
25994
|
-
var fee = _ref5.fee;
|
|
25995
25996
|
routePayments({
|
|
25996
25997
|
account: account,
|
|
25997
25998
|
accept: accept,
|
|
25998
25999
|
whitelist: whitelist,
|
|
25999
|
-
blacklist: blacklist
|
|
26000
|
-
fee: fee
|
|
26000
|
+
blacklist: blacklist
|
|
26001
26001
|
});
|
|
26002
26002
|
};
|
|
26003
26003
|
|
|
@@ -27232,7 +27232,6 @@ var SelectNFTStack = (function (props) {
|
|
|
27232
27232
|
}),
|
|
27233
27233
|
SelectBlockchain: /*#__PURE__*/React.createElement(SelectBlockchainDialog, {
|
|
27234
27234
|
selection: selection,
|
|
27235
|
-
stacked: true,
|
|
27236
27235
|
resolve: props.resolve,
|
|
27237
27236
|
unmount: props.unmount
|
|
27238
27237
|
}),
|
|
@@ -27658,7 +27657,8 @@ var SelectTokenStack = (function (props) {
|
|
|
27658
27657
|
}),
|
|
27659
27658
|
SelectBlockchain: /*#__PURE__*/React.createElement(SelectBlockchainDialog, {
|
|
27660
27659
|
selection: selection,
|
|
27661
|
-
resolve: props.resolve
|
|
27660
|
+
resolve: props.resolve,
|
|
27661
|
+
unmount: props.unmount
|
|
27662
27662
|
}),
|
|
27663
27663
|
ConfirmTokenSelection: /*#__PURE__*/React.createElement(ConfirmTokenSelectionDialog, {
|
|
27664
27664
|
selection: selection,
|