@ref-finance/ref-sdk 1.4.1 → 1.4.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 +6 -3
- package/dist/constant.d.ts +1 -0
- package/dist/ref-sdk.cjs.development.css +2 -2
- package/dist/ref-sdk.cjs.development.js +161 -163
- package/dist/ref-sdk.cjs.development.js.map +1 -1
- package/dist/ref-sdk.cjs.production.min.js +1 -1
- package/dist/ref-sdk.cjs.production.min.js.map +1 -1
- package/dist/ref-sdk.esm.js +162 -166
- package/dist/ref-sdk.esm.js.map +1 -1
- package/dist/ref-sdk.umd.development.js +162 -164
- package/dist/ref-sdk.umd.development.js.map +1 -1
- package/dist/ref-sdk.umd.production.min.js +1 -1
- package/dist/ref-sdk.umd.production.min.js.map +1 -1
- package/dist/swap-widget/components.d.ts +10 -11
- package/dist/swap-widget/types.d.ts +5 -3
- package/dist/utils.d.ts +2 -1
- package/package.json +1 -1
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
var React__default = 'default' in React ? React['default'] : React;
|
|
12
12
|
|
|
13
13
|
var FEE_DIVISOR = 10000;
|
|
14
|
+
var DEFAULT_SLIPPAGE_TOLERANCE = "0.5";
|
|
14
15
|
var STABLE_LP_TOKEN_DECIMALS = 18;
|
|
15
16
|
var RATED_POOL_LP_TOKEN_DECIMALS = 24;
|
|
16
17
|
var STORAGE_TO_REGISTER_WITH_MFT = '0.1';
|
|
@@ -3628,8 +3629,11 @@
|
|
|
3628
3629
|
notation: 'fixed'
|
|
3629
3630
|
});
|
|
3630
3631
|
}
|
|
3631
|
-
var getMax = function getMax(id, amount) {
|
|
3632
|
-
return id !== exports.WRAP_NEAR_CONTRACT_ID ? amount : Number(amount) <=
|
|
3632
|
+
var getMax = function getMax(id, amount, minNearAmountLeftForGasFees) {
|
|
3633
|
+
return id !== exports.WRAP_NEAR_CONTRACT_ID ? amount : Number(amount) <= minNearAmountLeftForGasFees ? '0' : String(Number(amount) - minNearAmountLeftForGasFees);
|
|
3634
|
+
};
|
|
3635
|
+
var isValidSlippageTolerance = function isValidSlippageTolerance(value) {
|
|
3636
|
+
return value > 0 && value < 100;
|
|
3633
3637
|
};
|
|
3634
3638
|
function getPointByPrice(pointDelta, price, decimalRate, noNeedSlot) {
|
|
3635
3639
|
var point = Math.log(+price * decimalRate) / Math.log(CONSTANT_D);
|
|
@@ -4380,7 +4384,7 @@
|
|
|
4380
4384
|
var instantSwap = /*#__PURE__*/function () {
|
|
4381
4385
|
var _ref2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref) {
|
|
4382
4386
|
var _swapTodos;
|
|
4383
|
-
var tokenIn, tokenOut, amountIn, slippageTolerance, swapTodos, AccountId, referralId, transactions, registerToken,
|
|
4387
|
+
var tokenIn, tokenOut, amountIn, slippageTolerance, swapTodos, AccountId, referralId, transactions, registerToken, actionsList, allSwapsTokens, i, swapTokens;
|
|
4384
4388
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
4385
4389
|
while (1) {
|
|
4386
4390
|
switch (_context2.prev = _context2.next) {
|
|
@@ -4445,24 +4449,9 @@
|
|
|
4445
4449
|
return _ref3.apply(this, arguments);
|
|
4446
4450
|
};
|
|
4447
4451
|
}();
|
|
4448
|
-
|
|
4449
|
-
_context2.next = 12;
|
|
4450
|
-
break;
|
|
4451
|
-
}
|
|
4452
|
-
_context2.next = 8;
|
|
4453
|
-
return ftGetStorageBalance(exports.config.WRAP_NEAR_CONTRACT_ID, AccountId);
|
|
4454
|
-
case 8:
|
|
4455
|
-
registered = _context2.sent;
|
|
4456
|
-
if (!(registered === null)) {
|
|
4457
|
-
_context2.next = 12;
|
|
4458
|
-
break;
|
|
4459
|
-
}
|
|
4460
|
-
_context2.next = 12;
|
|
4461
|
-
return registerToken(tokenIn);
|
|
4462
|
-
case 12:
|
|
4463
|
-
_context2.next = 14;
|
|
4452
|
+
_context2.next = 7;
|
|
4464
4453
|
return registerToken(tokenOut);
|
|
4465
|
-
case
|
|
4454
|
+
case 7:
|
|
4466
4455
|
actionsList = [];
|
|
4467
4456
|
allSwapsTokens = swapTodos.map(function (s) {
|
|
4468
4457
|
return [s.inputToken, s.outputToken];
|
|
@@ -4520,7 +4509,7 @@
|
|
|
4520
4509
|
}]
|
|
4521
4510
|
});
|
|
4522
4511
|
return _context2.abrupt("return", transactions);
|
|
4523
|
-
case
|
|
4512
|
+
case 12:
|
|
4524
4513
|
case "end":
|
|
4525
4514
|
return _context2.stop();
|
|
4526
4515
|
}
|
|
@@ -4736,7 +4725,7 @@
|
|
|
4736
4725
|
});
|
|
4737
4726
|
case 3:
|
|
4738
4727
|
_pools = _context7.sent;
|
|
4739
|
-
if (
|
|
4728
|
+
if (_pools.simplePools) {
|
|
4740
4729
|
_context7.next = 6;
|
|
4741
4730
|
break;
|
|
4742
4731
|
}
|
|
@@ -4998,12 +4987,12 @@
|
|
|
4998
4987
|
var rate = calculateExchangeRate(ONLY_ZEROS.test(params.amountIn) ? '1' : params.amountIn, amountOut || '1');
|
|
4999
4988
|
var makeSwap = /*#__PURE__*/function () {
|
|
5000
4989
|
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
5001
|
-
var transactionsRef, outEstimate, routes, bigEstimate, _minAmountOut;
|
|
4990
|
+
var transactionsRef, tokenRegistered, nearDepositAmount, minStorageBalance, outEstimate, routes, bigEstimate, _minAmountOut;
|
|
5002
4991
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
5003
4992
|
while (1) {
|
|
5004
4993
|
switch (_context3.prev = _context3.next) {
|
|
5005
4994
|
case 0:
|
|
5006
|
-
if (!(!params.tokenIn || !params.tokenOut)) {
|
|
4995
|
+
if (!(!params.tokenIn || !params.tokenOut || !AccountId)) {
|
|
5007
4996
|
_context3.next = 2;
|
|
5008
4997
|
break;
|
|
5009
4998
|
}
|
|
@@ -5016,14 +5005,32 @@
|
|
|
5016
5005
|
amountIn: params.amountIn,
|
|
5017
5006
|
swapTodos: estimates,
|
|
5018
5007
|
slippageTolerance: slippageTolerance,
|
|
5019
|
-
AccountId: AccountId
|
|
5008
|
+
AccountId: AccountId,
|
|
5020
5009
|
referralId: referralId
|
|
5021
5010
|
});
|
|
5022
5011
|
case 4:
|
|
5023
5012
|
transactionsRef = _context3.sent;
|
|
5024
|
-
if (tokenIn && tokenIn.id === exports.WRAP_NEAR_CONTRACT_ID) {
|
|
5025
|
-
|
|
5013
|
+
if (!(tokenIn && tokenIn.id === exports.WRAP_NEAR_CONTRACT_ID)) {
|
|
5014
|
+
_context3.next = 16;
|
|
5015
|
+
break;
|
|
5026
5016
|
}
|
|
5017
|
+
_context3.next = 8;
|
|
5018
|
+
return ftGetStorageBalance(tokenIn.id, AccountId);
|
|
5019
|
+
case 8:
|
|
5020
|
+
tokenRegistered = _context3.sent;
|
|
5021
|
+
nearDepositAmount = amountIn;
|
|
5022
|
+
if (!(tokenRegistered === null)) {
|
|
5023
|
+
_context3.next = 15;
|
|
5024
|
+
break;
|
|
5025
|
+
}
|
|
5026
|
+
_context3.next = 13;
|
|
5027
|
+
return getMinStorageBalance(tokenIn.id);
|
|
5028
|
+
case 13:
|
|
5029
|
+
minStorageBalance = _context3.sent;
|
|
5030
|
+
nearDepositAmount = format.formatNearAmount(String(BigInt(format.parseNearAmount(nearDepositAmount)) + BigInt(minStorageBalance)));
|
|
5031
|
+
case 15:
|
|
5032
|
+
transactionsRef.splice(-1, 0, nearDepositTransaction(nearDepositAmount));
|
|
5033
|
+
case 16:
|
|
5027
5034
|
if (tokenOut && tokenOut.id === exports.WRAP_NEAR_CONTRACT_ID) {
|
|
5028
5035
|
outEstimate = new Big(0);
|
|
5029
5036
|
routes = separateRoutes(estimates, tokenOut.id);
|
|
@@ -5034,16 +5041,16 @@
|
|
|
5034
5041
|
_minAmountOut = percentLess(slippageTolerance, scientificNotationToString(bigEstimate.toString()));
|
|
5035
5042
|
transactionsRef.push(nearWithdrawTransaction(_minAmountOut));
|
|
5036
5043
|
}
|
|
5037
|
-
_context3.next =
|
|
5044
|
+
_context3.next = 19;
|
|
5038
5045
|
return onSwap(transactionsRef);
|
|
5039
|
-
case
|
|
5046
|
+
case 19:
|
|
5040
5047
|
setTimeout(function () {
|
|
5041
5048
|
var tokensToUpdate = [];
|
|
5042
5049
|
if (tokenIn) tokensToUpdate.push(tokenIn.id);
|
|
5043
5050
|
if (tokenOut) tokensToUpdate.push(tokenOut.id);
|
|
5044
5051
|
if (tokensToUpdate.length > 0 && AccountId) updateTokenBalance(tokensToUpdate, AccountId);
|
|
5045
5052
|
}, 3000);
|
|
5046
|
-
case
|
|
5053
|
+
case 20:
|
|
5047
5054
|
case "end":
|
|
5048
5055
|
return _context3.stop();
|
|
5049
5056
|
}
|
|
@@ -5266,7 +5273,7 @@
|
|
|
5266
5273
|
}
|
|
5267
5274
|
}
|
|
5268
5275
|
|
|
5269
|
-
var css_248z = ".__ref-swap-widget-container {\n border-radius: 16px;\n padding: 28px;\n padding-bottom: 16px;\n position: relative;\n max-width: 90%;\n}\n\n.__ref-swap-widget-row-flex-center {\n display: flex;\n align-items: center;\n}\n\n.__ref-swap-widget-col-flex-start {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n}\n\n.__ref-swap-widget-header {\n justify-content: space-between;\n margin-bottom: 25px;\n}\n\n.__ref-swap-widget-header-title {\n font-weight: 700;\n font-size: 20px;\n}\n.__ref-swap-widget-header-button-account {\n font-size: 14px;\n margin-right: 8px;\n padding: 4px 13px;\n border-radius: 25px;\n min-width: 120px;\n justify-content: center;\n}\n\n.__ref-swap-widget-header-button-account:hover {\n background: rgba(255, 104, 158, 0.2) !important;\n}\n\n.__ref-swap-widget_slippage_selector {\n box-shadow: 0px 0px 12px rgba(0, 0, 0, 0.25);\n border-radius: 12px;\n position: absolute;\n top: 30px;\n right: 0px;\n padding: 16px;\n padding-right: 20px;\n padding-left: 20px;\n z-index:
|
|
5276
|
+
var css_248z = ".__ref-swap-widget-container {\n border-radius: 16px;\n padding: 28px;\n padding-bottom: 16px;\n position: relative;\n max-width: 90%;\n}\n\n.__ref-swap-widget-row-flex-center {\n display: flex;\n align-items: center;\n}\n\n.__ref-swap-widget-col-flex-start {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n}\n\n.__ref-swap-widget-header {\n justify-content: space-between;\n margin-bottom: 25px;\n}\n\n.__ref-swap-widget-header-title {\n font-weight: 700;\n font-size: 20px;\n}\n.__ref-swap-widget-header-button-account {\n font-size: 14px;\n margin-right: 8px;\n padding: 4px 13px;\n border-radius: 25px;\n min-width: 120px;\n justify-content: center;\n}\n\n.__ref-swap-widget-header-button-account:hover {\n background: rgba(255, 104, 158, 0.2) !important;\n}\n\n.__ref-swap-widget_slippage_selector {\n box-shadow: 0px 0px 12px rgba(0, 0, 0, 0.25);\n border-radius: 12px;\n position: absolute;\n top: 30px;\n right: 0px;\n padding: 16px;\n padding-right: 20px;\n padding-left: 20px;\n z-index: 5;\n width: 230px;\n font-size: 14px;\n}\n\n.__ref-swap-widget_slippage_selector_input_container {\n width: 100%;\n height: 26px;\n margin-right: 4px;\n padding: 2px 10px;\n}\n.__ref-swap-widget_slippage_selector_button {\n font-size: 14px;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 6px 16px;\n}\n\n.__ref-swap-widget-opacity-hover:hover {\n opacity: 0.5;\n}\n\n.__ref-swap-widget-opacity-active:active {\n opacity: 0.5;\n}\n\n.__ref-swap-widger-token-amount {\n padding: 14px;\n padding-bottom: 8px;\n border-radius: 8px;\n display: flex;\n align-items: flex-start;\n}\n\n.__ref-swap-widger-token-amount_input {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n}\n\n.__ref-swap-widget-token-amount_quick_selector {\n}\n\n.__ref-swap-widger-token-amount_balance {\n margin-top: 7px;\n justify-content: space-between;\n}\n\n.__ref-swap-widget-token-amount_quick_selector_item {\n font-size: 12px;\n padding: 6px;\n padding-top: 3px;\n padding-bottom: 3px;\n cursor: pointer;\n}\n.__ref-swap-widget-select-token_input {\n padding: 14px;\n border-radius: 8px;\n}\n\n.__ref-swap-widget_star_token {\n padding: 8px 10px 8px 8px;\n margin: 0px 6px 10px 0px;\n position: relative;\n cursor: pointer;\n border-radius: 8px;\n}\n\n.__ref-swap-widget_token_icon {\n border-radius: 100%;\n flex-shrink: 0;\n}\n\n.__ref-swap-widget_token_list_table {\n table-layout: auto;\n width: 100%;\n font-size: 14px;\n}\n\n.__ref-swap-widget_token_list_table_header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 6px 12px;\n margin: 0px 6px;\n}\n\n.__ref-swap-widget_token-selector-star-tokens {\n margin-top: 20px;\n flex-wrap: wrap;\n}\n.__ref-swap-widget_token_list_table_content {\n display: flex;\n flex-direction: column;\n max-height: 50vh;\n min-height: 30vh;\n overflow-y: auto;\n}\n\n.__ref-swap-widget_token-selector-token-list-item {\n justify-content: space-between;\n padding: 9px 20px;\n}\n.__ref-swap-widget-token-amount_token-select-button {\n font-size: 16px;\n border-radius: 18px;\n padding: 6px 8px;\n cursor: pointer;\n}\n\n.__ref-swap-widget-exchange-button {\n width: 100%;\n justify-content: center;\n padding: 20px 0;\n}\n\n.__ref-swap-widget-submit-button {\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 18px;\n font-weight: 700;\n border-radius: 8px;\n padding: 14px 0 14px 0;\n margin-top: 14px;\n cursor: pointer;\n}\n\n.__ref-swap-widget-submit-button-loader {\n width: 20px;\n height: 20px;\n border: 2px solid #fff;\n border-bottom-color: rgb(255, 255, 255);\n border-bottom-color: transparent;\n border-radius: 50%;\n display: inline-block;\n box-sizing: border-box;\n animation: rotation 1s linear infinite;\n}\n\n@keyframes rotation {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n\n.__ref-widget-swap-detail-view {\n justify-content: space-between;\n width: 100%;\n font-size: 14px;\n margin-top: 16px;\n}\n\n.__ref-swap-widget-swap-detail-view-item {\n justify-content: space-between;\n margin-bottom: 12px;\n width: 100%;\n}\n\n.__ref-swap-widget-loading {\n animation: spin 2s linear infinite;\n}\n\n.__ref-swap-widget-notification {\n position: absolute;\n top: 50%;\n left: 50%;\n width: 50%;\n transform: translate(-50%, -50%);\n background: rgba(0, 0, 0, 0.5);\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n z-index: 5;\n box-shadow: 0px 0px 12px rgba(0, 0, 0, 0.25);\n border-radius: 12px;\n padding: 32px 20px;\n}\n\n.__ref-swap-widget-notification__button {\n border-radius: 8px;\n padding: 8px 20px;\n margin-top: 14px;\n}\n@keyframes spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n\ninput.__ref-swap-widget-input-class {\n margin: 0;\n background-color: transparent;\n display: block;\n width: 100%;\n padding: 0;\n border-width: 0;\n}\n\ninput.__ref-swap-widget-input-class:focus {\n outline: none;\n border-width: 0;\n}\n\ninput.__ref-swap-widget-input-class::-webkit-outer-spin-button,\ninput.__ref-swap-widget-input-class::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\ninput.__ref-swap-widget-input-class[type='number'] {\n -moz-appearance: textfield; /* Firefox */\n}\n\nbutton.__ref-swap-widget-button {\n border: none;\n}\n\n.__ref-swap-widget-submit-button:hover {\n opacity: 0.5;\n}\n\n.__ref-swap-widget-active:active {\n color: #00c6a2;\n}\n\n.__ref-swap-widget-hover:hover {\n color: #00c6a2;\n}\n\n.__ref-swap-widget_token_list_table_content::-webkit-scrollbar {\n width: 4px;\n height: 4px;\n border-radius: 3px;\n}\n\n.__ref-swap-widget_token_list_table_content::-webkit-scrollbar-track {\n box-shadow: inset 0 0 6px rgba(0, 0, 0, 0);\n}\n.__ref-swap-widget_token_list_table_content::-webkit-scrollbar-thumb {\n background: #00c6a2;\n border-radius: 8px;\n}\n\n.__ref-swap-widget-swap_routes {\n border-radius: 12px;\n padding: 8px 12px 8px 12px;\n width: 100%;\n}\n\n.__ref-swap-widget-valueStyle {\n background-image: -webkit-linear-gradient(left, #00ffd1, #00ffd1, #8c78ff);\n -webkit-background-clip: text;\n -webkit-text-fill-color: transparent;\n}\n\n.__ref-swap-widget-swap_route_row {\n justify-content: space-between;\n margin-bottom: 4px;\n}\n";
|
|
5270
5277
|
styleInject(css_248z);
|
|
5271
5278
|
|
|
5272
5279
|
var _ALLOWED_KEYS;
|
|
@@ -5617,7 +5624,8 @@
|
|
|
5617
5624
|
onChangeAmount = props.onChangeAmount,
|
|
5618
5625
|
price = props.price,
|
|
5619
5626
|
onForceUpdate = props.onForceUpdate,
|
|
5620
|
-
poolFetchingState = props.poolFetchingState
|
|
5627
|
+
poolFetchingState = props.poolFetchingState,
|
|
5628
|
+
minNearAmountLeftForGasFees = props.minNearAmountLeftForGasFees;
|
|
5621
5629
|
var theme = React.useContext(ThemeContext);
|
|
5622
5630
|
var primary = theme.primary,
|
|
5623
5631
|
secondary = theme.secondary,
|
|
@@ -5637,14 +5645,14 @@
|
|
|
5637
5645
|
}
|
|
5638
5646
|
};
|
|
5639
5647
|
React.useEffect(function () {
|
|
5640
|
-
if (ref.current && onChangeAmount && token && balance && token.id === exports.WRAP_NEAR_CONTRACT_ID && Number(balance) - Number(ref.current.value) <
|
|
5641
|
-
ref.current.setCustomValidity(
|
|
5648
|
+
if (ref.current && onChangeAmount && token && balance && token.id === exports.WRAP_NEAR_CONTRACT_ID && Number(balance) - Number(ref.current.value) < minNearAmountLeftForGasFees) {
|
|
5649
|
+
ref.current.setCustomValidity("Must have " + minNearAmountLeftForGasFees + "N or more left in wallet for gas fee.");
|
|
5642
5650
|
} else {
|
|
5643
5651
|
var _ref$current;
|
|
5644
5652
|
(_ref$current = ref.current) == null ? void 0 : _ref$current.setCustomValidity('');
|
|
5645
5653
|
}
|
|
5646
5654
|
}, [ref, balance, ref.current, (_ref$current2 = ref.current) == null ? void 0 : _ref$current2.value, token, amount]);
|
|
5647
|
-
var curMax = token ? getMax(token.id, balance || '0') : '0';
|
|
5655
|
+
var curMax = token ? getMax(token.id, balance || '0', minNearAmountLeftForGasFees) : '0';
|
|
5648
5656
|
return React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
|
|
5649
5657
|
className: "__ref-swap-widger-token-amount ",
|
|
5650
5658
|
style: {
|
|
@@ -5746,7 +5754,7 @@
|
|
|
5746
5754
|
}
|
|
5747
5755
|
}, React__default.createElement("span", null, "Balance:\xA0", toPrecision(balance, 2)), token && React__default.createElement(HalfAndMaxAmount, {
|
|
5748
5756
|
token: token,
|
|
5749
|
-
max: getMax(token.id, balance),
|
|
5757
|
+
max: getMax(token.id, balance, minNearAmountLeftForGasFees),
|
|
5750
5758
|
onChangeAmount: handleChange,
|
|
5751
5759
|
amount: amount
|
|
5752
5760
|
})));
|
|
@@ -5754,7 +5762,6 @@
|
|
|
5754
5762
|
var SlippageSelector = function SlippageSelector(_ref8) {
|
|
5755
5763
|
var slippageTolerance = _ref8.slippageTolerance,
|
|
5756
5764
|
onChangeSlippageTolerance = _ref8.onChangeSlippageTolerance,
|
|
5757
|
-
showSlip = _ref8.showSlip,
|
|
5758
5765
|
setShowSlip = _ref8.setShowSlip;
|
|
5759
5766
|
var _useState6 = React.useState(false),
|
|
5760
5767
|
invalid = _useState6[0],
|
|
@@ -5765,30 +5772,26 @@
|
|
|
5765
5772
|
primary = theme.primary,
|
|
5766
5773
|
borderRadius = theme.borderRadius,
|
|
5767
5774
|
borderColor = theme.borderColor;
|
|
5768
|
-
var ref = React.useRef(null);
|
|
5769
5775
|
var handleChange = function handleChange(amount) {
|
|
5770
|
-
onChangeSlippageTolerance(
|
|
5771
|
-
|
|
5772
|
-
setInValid(false);
|
|
5773
|
-
} else {
|
|
5774
|
-
setInValid(true);
|
|
5775
|
-
}
|
|
5776
|
-
if (ref.current) {
|
|
5777
|
-
ref.current.value = amount;
|
|
5778
|
-
}
|
|
5776
|
+
onChangeSlippageTolerance(amount);
|
|
5777
|
+
setInValid(!isValidSlippageTolerance(Number(amount)));
|
|
5779
5778
|
};
|
|
5780
5779
|
React.useEffect(function () {
|
|
5781
|
-
|
|
5782
|
-
|
|
5783
|
-
|
|
5780
|
+
var onClick = function onClick(event) {
|
|
5781
|
+
if (!event.target) return;
|
|
5782
|
+
if (event.target.closest('#__ref-slippage-container') === null) {
|
|
5783
|
+
setShowSlip(false);
|
|
5784
|
+
if (invalid) onChangeSlippageTolerance(DEFAULT_SLIPPAGE_TOLERANCE);
|
|
5785
|
+
}
|
|
5784
5786
|
};
|
|
5787
|
+
document.addEventListener('click', onClick);
|
|
5785
5788
|
return function () {
|
|
5786
|
-
document.
|
|
5789
|
+
document.removeEventListener('click', onClick);
|
|
5787
5790
|
};
|
|
5788
|
-
}, [
|
|
5789
|
-
if (!showSlip) return null;
|
|
5791
|
+
}, [invalid]);
|
|
5790
5792
|
return React__default.createElement("div", {
|
|
5791
5793
|
className: "__ref-swap-widget_slippage_selector __ref-swap-widget-col-flex-start",
|
|
5794
|
+
id: "__ref-slippage-container",
|
|
5792
5795
|
onClick: function onClick(e) {
|
|
5793
5796
|
return e.stopPropagation();
|
|
5794
5797
|
},
|
|
@@ -5807,33 +5810,21 @@
|
|
|
5807
5810
|
className: "__ref-swap-widget-row-flex-center\n __ref-swap-widget_slippage_selector_input_container",
|
|
5808
5811
|
style: {
|
|
5809
5812
|
border: "1px solid " + (invalid ? '#FF7575' : borderColor),
|
|
5810
|
-
borderRadius: borderRadius
|
|
5813
|
+
borderRadius: borderRadius,
|
|
5814
|
+
color: invalid ? '#FF7575' : primary
|
|
5811
5815
|
}
|
|
5812
5816
|
}, React__default.createElement("input", {
|
|
5813
|
-
ref: ref,
|
|
5814
|
-
max: 99.99999,
|
|
5815
|
-
min: 0.000001,
|
|
5816
|
-
defaultValue: slippageTolerance ? slippageTolerance : 0.5,
|
|
5817
|
-
onWheel: function onWheel() {
|
|
5818
|
-
if (ref.current) {
|
|
5819
|
-
ref.current.blur();
|
|
5820
|
-
}
|
|
5821
|
-
},
|
|
5822
5817
|
value: slippageTolerance,
|
|
5823
|
-
|
|
5824
|
-
type: "number",
|
|
5818
|
+
type: "text",
|
|
5825
5819
|
required: true,
|
|
5826
5820
|
placeholder: "",
|
|
5827
|
-
onChange: function onChange(
|
|
5828
|
-
|
|
5829
|
-
|
|
5830
|
-
|
|
5831
|
-
onKeyDown: function onKeyDown(e) {
|
|
5832
|
-
return symbolsArr.includes(e.key) && e.preventDefault();
|
|
5821
|
+
onChange: function onChange(event) {
|
|
5822
|
+
if (isValidInput(event.target.value)) {
|
|
5823
|
+
handleChange(event.target.value);
|
|
5824
|
+
}
|
|
5833
5825
|
},
|
|
5834
5826
|
style: {
|
|
5835
|
-
width: '100%'
|
|
5836
|
-
color: invalid ? '#FF7575' : primary
|
|
5827
|
+
width: '100%'
|
|
5837
5828
|
},
|
|
5838
5829
|
className: "__ref-swap-widget-input-class"
|
|
5839
5830
|
}), React__default.createElement("span", {
|
|
@@ -5848,7 +5839,7 @@
|
|
|
5848
5839
|
onClick: function onClick(e) {
|
|
5849
5840
|
e.stopPropagation();
|
|
5850
5841
|
e.preventDefault();
|
|
5851
|
-
onChangeSlippageTolerance(
|
|
5842
|
+
onChangeSlippageTolerance(DEFAULT_SLIPPAGE_TOLERANCE);
|
|
5852
5843
|
setInValid(false);
|
|
5853
5844
|
}
|
|
5854
5845
|
}, "Auto")), invalid && React__default.createElement("div", {
|
|
@@ -5856,7 +5847,7 @@
|
|
|
5856
5847
|
style: {
|
|
5857
5848
|
color: '#FF7575',
|
|
5858
5849
|
fontSize: '12px',
|
|
5859
|
-
padding: '10px 0px',
|
|
5850
|
+
padding: '10px 0px 0px 0px',
|
|
5860
5851
|
alignItems: 'start'
|
|
5861
5852
|
}
|
|
5862
5853
|
}, React__default.createElement(IoWarning.IoWarning, {
|
|
@@ -5867,11 +5858,11 @@
|
|
|
5867
5858
|
size: 20
|
|
5868
5859
|
}), React__default.createElement("div", null, 'The slippage tolerance is invalid.')));
|
|
5869
5860
|
};
|
|
5870
|
-
var StarToken = function StarToken(
|
|
5871
|
-
var price =
|
|
5872
|
-
token =
|
|
5873
|
-
onDelete =
|
|
5874
|
-
_onClick =
|
|
5861
|
+
var StarToken = function StarToken(_ref9) {
|
|
5862
|
+
var price = _ref9.price,
|
|
5863
|
+
token = _ref9.token,
|
|
5864
|
+
onDelete = _ref9.onDelete,
|
|
5865
|
+
_onClick = _ref9.onClick;
|
|
5875
5866
|
var theme = React.useContext(ThemeContext);
|
|
5876
5867
|
var primary = theme.primary,
|
|
5877
5868
|
secondary = theme.secondary,
|
|
@@ -5948,16 +5939,16 @@
|
|
|
5948
5939
|
}
|
|
5949
5940
|
}, !price ? '$-' : '$' + toInternationalCurrencySystemLongString(price, 2))));
|
|
5950
5941
|
};
|
|
5951
|
-
var Token = function Token(
|
|
5952
|
-
var token =
|
|
5953
|
-
_onClick2 =
|
|
5954
|
-
price =
|
|
5955
|
-
balance =
|
|
5956
|
-
isSticky =
|
|
5957
|
-
onClickPin =
|
|
5958
|
-
index =
|
|
5959
|
-
setHoverIndex =
|
|
5960
|
-
hoverIndex =
|
|
5942
|
+
var Token = function Token(_ref10) {
|
|
5943
|
+
var token = _ref10.token,
|
|
5944
|
+
_onClick2 = _ref10.onClick,
|
|
5945
|
+
price = _ref10.price,
|
|
5946
|
+
balance = _ref10.balance,
|
|
5947
|
+
isSticky = _ref10.isSticky,
|
|
5948
|
+
onClickPin = _ref10.onClickPin,
|
|
5949
|
+
index = _ref10.index,
|
|
5950
|
+
setHoverIndex = _ref10.setHoverIndex,
|
|
5951
|
+
hoverIndex = _ref10.hoverIndex;
|
|
5961
5952
|
var theme = React.useContext(ThemeContext);
|
|
5962
5953
|
var primary = theme.primary,
|
|
5963
5954
|
secondary = theme.secondary,
|
|
@@ -6073,14 +6064,14 @@
|
|
|
6073
6064
|
}
|
|
6074
6065
|
})));
|
|
6075
6066
|
};
|
|
6076
|
-
var TokenListTable = function TokenListTable(
|
|
6077
|
-
var tokens =
|
|
6078
|
-
onClick =
|
|
6079
|
-
balances =
|
|
6080
|
-
tokenPriceList =
|
|
6081
|
-
starList =
|
|
6082
|
-
setStarList =
|
|
6083
|
-
onDelete =
|
|
6067
|
+
var TokenListTable = function TokenListTable(_ref11) {
|
|
6068
|
+
var tokens = _ref11.tokens,
|
|
6069
|
+
onClick = _ref11.onClick,
|
|
6070
|
+
balances = _ref11.balances,
|
|
6071
|
+
tokenPriceList = _ref11.tokenPriceList,
|
|
6072
|
+
starList = _ref11.starList,
|
|
6073
|
+
setStarList = _ref11.setStarList,
|
|
6074
|
+
onDelete = _ref11.onDelete;
|
|
6084
6075
|
var _useState11 = React.useState('down'),
|
|
6085
6076
|
currentSort = _useState11[0],
|
|
6086
6077
|
setCurrentSort = _useState11[1];
|
|
@@ -6143,13 +6134,13 @@
|
|
|
6143
6134
|
});
|
|
6144
6135
|
})));
|
|
6145
6136
|
};
|
|
6146
|
-
var TokenSelector = function TokenSelector(
|
|
6147
|
-
var onSelect =
|
|
6148
|
-
width =
|
|
6149
|
-
tokens =
|
|
6150
|
-
onClose =
|
|
6151
|
-
balances =
|
|
6152
|
-
className =
|
|
6137
|
+
var TokenSelector = function TokenSelector(_ref12) {
|
|
6138
|
+
var onSelect = _ref12.onSelect,
|
|
6139
|
+
width = _ref12.width,
|
|
6140
|
+
tokens = _ref12.tokens,
|
|
6141
|
+
onClose = _ref12.onClose,
|
|
6142
|
+
balances = _ref12.balances,
|
|
6143
|
+
className = _ref12.className;
|
|
6153
6144
|
var theme = React.useContext(ThemeContext);
|
|
6154
6145
|
var container = theme.container,
|
|
6155
6146
|
buttonBg = theme.buttonBg,
|
|
@@ -6251,9 +6242,9 @@
|
|
|
6251
6242
|
onDelete: onDelete
|
|
6252
6243
|
}));
|
|
6253
6244
|
};
|
|
6254
|
-
var Slider = function Slider(
|
|
6255
|
-
var showSlip =
|
|
6256
|
-
setShowSlip =
|
|
6245
|
+
var Slider = function Slider(_ref13) {
|
|
6246
|
+
var showSlip = _ref13.showSlip,
|
|
6247
|
+
setShowSlip = _ref13.setShowSlip;
|
|
6257
6248
|
var _useState15 = React.useState(false),
|
|
6258
6249
|
hover = _useState15[0],
|
|
6259
6250
|
setHover = _useState15[1];
|
|
@@ -6271,7 +6262,8 @@
|
|
|
6271
6262
|
},
|
|
6272
6263
|
onClick: function onClick() {
|
|
6273
6264
|
return setShowSlip(true);
|
|
6274
|
-
}
|
|
6265
|
+
},
|
|
6266
|
+
className: "cursor-pointer"
|
|
6275
6267
|
}, React__default.createElement("path", {
|
|
6276
6268
|
fillRule: "evenodd",
|
|
6277
6269
|
clipRule: "evenodd",
|
|
@@ -6426,18 +6418,23 @@
|
|
|
6426
6418
|
stopColor: "#8C78FF"
|
|
6427
6419
|
}))));
|
|
6428
6420
|
};
|
|
6429
|
-
var Notification = function Notification(
|
|
6430
|
-
var state =
|
|
6431
|
-
tx =
|
|
6432
|
-
detail =
|
|
6433
|
-
|
|
6434
|
-
setOpen = _ref15.setOpen,
|
|
6435
|
-
setState = _ref15.setState;
|
|
6421
|
+
var Notification = function Notification(_ref14) {
|
|
6422
|
+
var state = _ref14.state,
|
|
6423
|
+
tx = _ref14.tx,
|
|
6424
|
+
detail = _ref14.detail,
|
|
6425
|
+
setSwapState = _ref14.setSwapState;
|
|
6436
6426
|
var theme = React.useContext(ThemeContext);
|
|
6437
6427
|
var container = theme.container,
|
|
6438
6428
|
buttonBg = theme.buttonBg,
|
|
6439
6429
|
primary = theme.primary;
|
|
6440
|
-
|
|
6430
|
+
var notificationStatus = React.useMemo(function () {
|
|
6431
|
+
return {
|
|
6432
|
+
isClosed: false,
|
|
6433
|
+
isWaitingForConfirmation: state === 'waitingForConfirmation',
|
|
6434
|
+
isFailure: state === 'fail',
|
|
6435
|
+
isSuccess: state === 'success'
|
|
6436
|
+
};
|
|
6437
|
+
}, [state]);
|
|
6441
6438
|
return React__default.createElement("div", {
|
|
6442
6439
|
className: "__ref-swap-widget-notification",
|
|
6443
6440
|
style: {
|
|
@@ -6446,18 +6443,18 @@
|
|
|
6446
6443
|
}
|
|
6447
6444
|
}, React__default.createElement("div", {
|
|
6448
6445
|
className: "__ref-swap-widget-notification__icon"
|
|
6449
|
-
},
|
|
6446
|
+
}, notificationStatus.isWaitingForConfirmation && React__default.createElement(Loading, null), notificationStatus.isFailure && React__default.createElement(Warning, null), notificationStatus.isSuccess && React__default.createElement(Success, null)), React__default.createElement("div", {
|
|
6450
6447
|
style: {
|
|
6451
6448
|
fontSize: '16px',
|
|
6452
6449
|
marginTop: '10px',
|
|
6453
6450
|
marginBottom: '6px'
|
|
6454
6451
|
}
|
|
6455
|
-
},
|
|
6456
|
-
className: "
|
|
6452
|
+
}, notificationStatus.isSuccess && React__default.createElement("p", null, "Success!"), notificationStatus.isFailure && React__default.createElement("p", null, "Swap Failed!")), React__default.createElement("div", {
|
|
6453
|
+
className: "text-center",
|
|
6457
6454
|
style: {
|
|
6458
6455
|
color: primary
|
|
6459
6456
|
}
|
|
6460
|
-
},
|
|
6457
|
+
}, notificationStatus.isWaitingForConfirmation && React__default.createElement("p", null, "Waiting for confirmation"), notificationStatus.isSuccess && tx && React__default.createElement("a", {
|
|
6461
6458
|
className: "text-primary font-semibold",
|
|
6462
6459
|
href: exports.config.explorerUrl + "/txns/" + tx,
|
|
6463
6460
|
target: "_blank",
|
|
@@ -6467,7 +6464,7 @@
|
|
|
6467
6464
|
color: primary
|
|
6468
6465
|
},
|
|
6469
6466
|
rel: "noreferrer"
|
|
6470
|
-
}, "Click to view."),
|
|
6467
|
+
}, "Click to view."), notificationStatus.isSuccess && detail), state !== null && React__default.createElement("button", {
|
|
6471
6468
|
className: "__ref-swap-widget-notification__button __ref-swap-widget-button",
|
|
6472
6469
|
style: {
|
|
6473
6470
|
background: buttonBg,
|
|
@@ -6477,8 +6474,7 @@
|
|
|
6477
6474
|
onClick: function onClick(e) {
|
|
6478
6475
|
e.preventDefault();
|
|
6479
6476
|
e.stopPropagation();
|
|
6480
|
-
|
|
6481
|
-
setState && setState(null);
|
|
6477
|
+
setSwapState(null);
|
|
6482
6478
|
}
|
|
6483
6479
|
}, "Close"));
|
|
6484
6480
|
};
|
|
@@ -6496,9 +6492,9 @@
|
|
|
6496
6492
|
fill: "#7E8A93"
|
|
6497
6493
|
})));
|
|
6498
6494
|
};
|
|
6499
|
-
var AccountButton = function AccountButton(
|
|
6500
|
-
var AccountId =
|
|
6501
|
-
onDisConnect =
|
|
6495
|
+
var AccountButton = function AccountButton(_ref15) {
|
|
6496
|
+
var AccountId = _ref15.AccountId,
|
|
6497
|
+
onDisConnect = _ref15.onDisConnect;
|
|
6502
6498
|
var _useState16 = React.useState(false),
|
|
6503
6499
|
hoverAccount = _useState16[0],
|
|
6504
6500
|
setHoverAccount = _useState16[1];
|
|
@@ -6544,7 +6540,9 @@
|
|
|
6544
6540
|
defaultTokenOut = props.defaultTokenOut,
|
|
6545
6541
|
onDisConnect = props.onDisConnect,
|
|
6546
6542
|
darkMode = props.darkMode,
|
|
6547
|
-
referralId = props.referralId
|
|
6543
|
+
referralId = props.referralId,
|
|
6544
|
+
_props$minNearAmountL = props.minNearAmountLeftForGasFees,
|
|
6545
|
+
minNearAmountLeftForGasFees = _props$minNearAmountL === void 0 ? 0.5 : _props$minNearAmountL;
|
|
6548
6546
|
var curTheme = theme || (darkMode ? defaultDarkModeTheme : defaultTheme);
|
|
6549
6547
|
var STORAGED_TOKEN_IN = localStorage.getItem(REF_WIDGET_SWAP_IN_KEY);
|
|
6550
6548
|
var STORAGED_TOKEN_OUT = localStorage.getItem(REF_WIDGET_SWAP_OUT_KEY);
|
|
@@ -6572,28 +6570,27 @@
|
|
|
6572
6570
|
var _useState2 = React.useState(),
|
|
6573
6571
|
tokenOut = _useState2[0],
|
|
6574
6572
|
setTokenOut = _useState2[1];
|
|
6575
|
-
var _useState3 = React.useState(
|
|
6576
|
-
|
|
6577
|
-
|
|
6578
|
-
React.
|
|
6579
|
-
|
|
6580
|
-
|
|
6581
|
-
|
|
6573
|
+
var _useState3 = React.useState('swap'),
|
|
6574
|
+
widgetRoute = _useState3[0],
|
|
6575
|
+
setWidgetRoute = _useState3[1];
|
|
6576
|
+
var _useState4 = React.useState('1'),
|
|
6577
|
+
amountIn = _useState4[0],
|
|
6578
|
+
setAmountIn = _useState4[1];
|
|
6579
|
+
var _useState5 = React.useState(false),
|
|
6580
|
+
showSlip = _useState5[0],
|
|
6581
|
+
setShowSlip = _useState5[1];
|
|
6582
|
+
var _useState6 = React.useState(DEFAULT_SLIPPAGE_TOLERANCE),
|
|
6583
|
+
slippageTolerance = _useState6[0],
|
|
6584
|
+
setSlippageTolerance = _useState6[1];
|
|
6585
|
+
var formattedSlippageTolerance = React.useMemo(function () {
|
|
6586
|
+
try {
|
|
6587
|
+
var formatted = Number(slippageTolerance);
|
|
6588
|
+
if (Number.isNaN(formatted) || !isValidSlippageTolerance(formatted)) return +DEFAULT_SLIPPAGE_TOLERANCE;
|
|
6589
|
+
return formatted;
|
|
6590
|
+
} catch (_unused) {
|
|
6591
|
+
return +DEFAULT_SLIPPAGE_TOLERANCE;
|
|
6582
6592
|
}
|
|
6583
|
-
|
|
6584
|
-
}, [transactionState]);
|
|
6585
|
-
var _useState4 = React.useState('swap'),
|
|
6586
|
-
widgetRoute = _useState4[0],
|
|
6587
|
-
setWidgetRoute = _useState4[1];
|
|
6588
|
-
var _useState5 = React.useState('1'),
|
|
6589
|
-
amountIn = _useState5[0],
|
|
6590
|
-
setAmountIn = _useState5[1];
|
|
6591
|
-
var _useState6 = React.useState(false),
|
|
6592
|
-
showSlip = _useState6[0],
|
|
6593
|
-
setShowSlip = _useState6[1];
|
|
6594
|
-
var _useState7 = React.useState(0.5),
|
|
6595
|
-
slippageTolerance = _useState7[0],
|
|
6596
|
-
setSlippageTolerance = _useState7[1];
|
|
6593
|
+
}, [slippageTolerance]);
|
|
6597
6594
|
var _useTokensIndexer = useTokensIndexer({
|
|
6598
6595
|
defaultTokenList: defaultTokenList,
|
|
6599
6596
|
AccountId: AccountId
|
|
@@ -6604,9 +6601,9 @@
|
|
|
6604
6601
|
useAllTokens({
|
|
6605
6602
|
reload: true
|
|
6606
6603
|
});
|
|
6607
|
-
var
|
|
6608
|
-
refreshTrigger =
|
|
6609
|
-
setRreshTrigger =
|
|
6604
|
+
var _useState7 = React.useState(false),
|
|
6605
|
+
refreshTrigger = _useState7[0],
|
|
6606
|
+
setRreshTrigger = _useState7[1];
|
|
6610
6607
|
var tokenPriceList = useTokenPriceList();
|
|
6611
6608
|
var _useRefPools = useRefPools(refreshTrigger),
|
|
6612
6609
|
allPools = _useRefPools.allPools,
|
|
@@ -6664,7 +6661,7 @@
|
|
|
6664
6661
|
return Number(p.shares_total_supply) > 0;
|
|
6665
6662
|
})
|
|
6666
6663
|
},
|
|
6667
|
-
slippageTolerance:
|
|
6664
|
+
slippageTolerance: formattedSlippageTolerance,
|
|
6668
6665
|
onSwap: onSwap,
|
|
6669
6666
|
AccountId: AccountId,
|
|
6670
6667
|
refreshTrigger: refreshTrigger,
|
|
@@ -6697,10 +6694,10 @@
|
|
|
6697
6694
|
}, [estimates, tokenIn, tokenOut, amountIn, amountOut, allStablePools]);
|
|
6698
6695
|
var handleSubmit = function handleSubmit(e) {
|
|
6699
6696
|
e.preventDefault();
|
|
6700
|
-
|
|
6697
|
+
transactionState.setState('waitingForConfirmation');
|
|
6701
6698
|
makeSwap();
|
|
6702
6699
|
};
|
|
6703
|
-
var canSubmit = tokenIn && tokenOut && canSwap && !swapError && isSignedIn && new Big(tokenInBalance || '0').gte(amountIn || '0') &&
|
|
6700
|
+
var canSubmit = tokenIn && tokenOut && canSwap && !swapError && isSignedIn && new Big(tokenInBalance || '0').gte(amountIn || '0') && isValidSlippageTolerance(formattedSlippageTolerance) && !ONLY_ZEROS.test(tokenInBalance);
|
|
6704
6701
|
var tokensLoaded = React.useMemo(function () {
|
|
6705
6702
|
return tokens.length > 0;
|
|
6706
6703
|
}, [tokens]);
|
|
@@ -6733,10 +6730,9 @@
|
|
|
6733
6730
|
}), React__default.createElement(Slider, {
|
|
6734
6731
|
showSlip: showSlip,
|
|
6735
6732
|
setShowSlip: setShowSlip
|
|
6736
|
-
}), React__default.createElement(SlippageSelector, {
|
|
6733
|
+
}), showSlip && React__default.createElement(SlippageSelector, {
|
|
6737
6734
|
slippageTolerance: slippageTolerance,
|
|
6738
6735
|
onChangeSlippageTolerance: setSlippageTolerance,
|
|
6739
|
-
showSlip: showSlip,
|
|
6740
6736
|
setShowSlip: setShowSlip
|
|
6741
6737
|
}))), React__default.createElement(TokenAmount, {
|
|
6742
6738
|
amount: amountIn,
|
|
@@ -6747,7 +6743,8 @@
|
|
|
6747
6743
|
onSelectToken: function onSelectToken() {
|
|
6748
6744
|
if (!tokensLoaded) return;
|
|
6749
6745
|
setWidgetRoute('token-selector-in');
|
|
6750
|
-
}
|
|
6746
|
+
},
|
|
6747
|
+
minNearAmountLeftForGasFees: minNearAmountLeftForGasFees
|
|
6751
6748
|
}), React__default.createElement("div", {
|
|
6752
6749
|
className: "__ref-swap-widget-exchange-button __ref-swap-widget-row-flex-center ",
|
|
6753
6750
|
style: {
|
|
@@ -6777,7 +6774,8 @@
|
|
|
6777
6774
|
onForceUpdate: function onForceUpdate() {
|
|
6778
6775
|
setRreshTrigger(!refreshTrigger);
|
|
6779
6776
|
},
|
|
6780
|
-
poolFetchingState: poolFetchingState
|
|
6777
|
+
poolFetchingState: poolFetchingState,
|
|
6778
|
+
minNearAmountLeftForGasFees: minNearAmountLeftForGasFees
|
|
6781
6779
|
}), !swapError && amountIn && amountOut && React__default.createElement(DetailView, {
|
|
6782
6780
|
fee: fee,
|
|
6783
6781
|
rate: rate,
|
|
@@ -6840,11 +6838,9 @@
|
|
|
6840
6838
|
style: {
|
|
6841
6839
|
color: refIcon || 'black'
|
|
6842
6840
|
}
|
|
6843
|
-
}), "\xA0 Powered by Ref.finance")), React__default.createElement(Notification, {
|
|
6844
|
-
state: transactionState
|
|
6845
|
-
|
|
6846
|
-
open: notOpen,
|
|
6847
|
-
setOpen: setNotOpen,
|
|
6841
|
+
}), "\xA0 Powered by Ref.finance")), transactionState.state !== null && React__default.createElement(Notification, {
|
|
6842
|
+
state: transactionState.state,
|
|
6843
|
+
setSwapState: transactionState.setState,
|
|
6848
6844
|
tx: transactionState == null ? void 0 : transactionState.tx,
|
|
6849
6845
|
detail: transactionState == null ? void 0 : transactionState.detail
|
|
6850
6846
|
})), widgetRoute === 'token-selector-in' && React__default.createElement(TokenSelector, {
|
|
@@ -8294,6 +8290,7 @@
|
|
|
8294
8290
|
exports.DCLSwapGetStorageBalance = DCLSwapGetStorageBalance;
|
|
8295
8291
|
exports.DCL_POOL_FEE_LIST = DCL_POOL_FEE_LIST;
|
|
8296
8292
|
exports.DCL_POOL_SPLITER = DCL_POOL_SPLITER;
|
|
8293
|
+
exports.DEFAULT_SLIPPAGE_TOLERANCE = DEFAULT_SLIPPAGE_TOLERANCE;
|
|
8297
8294
|
exports.DefaultMainnetTokenList = DefaultMainnetTokenList;
|
|
8298
8295
|
exports.DefaultTestnetTokenList = DefaultTestnetTokenList;
|
|
8299
8296
|
exports.FEE_DIVISOR = FEE_DIVISOR;
|
|
@@ -8395,6 +8392,7 @@
|
|
|
8395
8392
|
exports.isMobile = isMobile;
|
|
8396
8393
|
exports.isStablePool = isStablePool;
|
|
8397
8394
|
exports.isStablePoolToken = isStablePoolToken;
|
|
8395
|
+
exports.isValidSlippageTolerance = isValidSlippageTolerance;
|
|
8398
8396
|
exports.listDCLPools = listDCLPools;
|
|
8399
8397
|
exports.list_active_orders = list_active_orders;
|
|
8400
8398
|
exports.list_history_orders = list_history_orders;
|