@kodiak-finance/orderly-ui-transfer 2.9.2 → 2.9.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/dist/index.js +244 -173
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +245 -174
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +11 -11
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i18n, useTranslation, Trans } from '@kodiak-finance/orderly-i18n';
|
|
2
|
-
import { registerSimpleDialog, registerSimpleSheet, Tabs, TabPanel, ArrowDownSquareFillIcon, ArrowUpSquareFillIcon, ExtensionSlot, ExtensionPositionEnum, Box, textVariants, Flex, toast, Text, cn, Button, Spinner, Select, Input, inputFormatter, useScreen, modal, Tooltip, Tips, AlertDialog, EditIcon, ArrowLeftRightIcon, WalletIcon, DropdownMenuRoot, DropdownMenuTrigger, DropdownMenuPortal, DropdownMenuContent, ScrollArea, ExclamationFillIcon, ChainIcon, Badge, CaretUpIcon, CaretDownIcon, SimpleDialog, CloseRoundFillIcon, TokenIcon, WarningIcon, SelectItem, ChevronRightIcon, Checkbox, CloseIcon } from '@kodiak-finance/orderly-ui';
|
|
2
|
+
import { registerSimpleDialog, registerSimpleSheet, Tabs, TabPanel, ArrowDownSquareFillIcon, ArrowUpSquareFillIcon, ExtensionSlot, ExtensionPositionEnum, Box, textVariants, Flex, toast, Text, cn, Button, useDocumentDirection, Spinner, Select, Input, inputFormatter, useScreen, modal, Tooltip, Tips, AlertDialog, EditIcon, ArrowLeftRightIcon, WalletIcon, DropdownMenuRoot, DropdownMenuTrigger, DropdownMenuPortal, DropdownMenuContent, ScrollArea, ExclamationFillIcon, ChainIcon, Badge, CaretUpIcon, CaretDownIcon, SimpleDialog, CloseRoundFillIcon, TokenIcon, WarningIcon, SelectItem, ChevronRightIcon, Checkbox, CloseIcon } from '@kodiak-finance/orderly-ui';
|
|
3
3
|
import { forwardRef, useState, isValidElement, useMemo, useEffect, useCallback, useRef } from 'react';
|
|
4
4
|
import { useConfig, useWalletConnector, useLocalStorage, useConvert, useOdosQuote, useComputedLTV, useAccount, useAppStore, useTransfer, useSubAccountDataObserver, useSubAccountMaxWithdrawal, useTokensInfo, useEventEmitter, usePositionStream, useIndexPricesStream, useOrderlyContext, useDeposit, useAssetsHistory, useChains, useMemoizedFn, useWithdraw, useWalletTopic, useQuery, useSWR, useTokenInfo, useHoldingStream, useInternalTransfer, useDebouncedCallback, usePrivateQuery, useTransferHistory, useBalanceTopic } from '@kodiak-finance/orderly-hooks';
|
|
5
5
|
import { Decimal, zero, praseChainIdToNumber, int2hex, toNonExponential, formatWithPrecision, isSolana } from '@kodiak-finance/orderly-utils';
|
|
@@ -102,7 +102,7 @@ var LtvUI = (props) => {
|
|
|
102
102
|
ltv_threshold
|
|
103
103
|
}
|
|
104
104
|
),
|
|
105
|
-
children: /* @__PURE__ */ jsx(TooltipIcon, { className: "oui-
|
|
105
|
+
children: /* @__PURE__ */ jsx(TooltipIcon, { className: "oui-ms-[2px] oui-cursor-pointer oui-text-base-contrast-36" })
|
|
106
106
|
}
|
|
107
107
|
)
|
|
108
108
|
] }),
|
|
@@ -243,6 +243,8 @@ var AvailableQuantity = (props) => {
|
|
|
243
243
|
const { quantity, maxQuantity, token, loading } = props;
|
|
244
244
|
const { t } = useTranslation();
|
|
245
245
|
const { isMobile } = useScreen();
|
|
246
|
+
const dir = useDocumentDirection();
|
|
247
|
+
const isRTL = dir === "rtl";
|
|
246
248
|
const { getIndexPrice } = useIndexPricesStream();
|
|
247
249
|
const name = token?.display_name || token?.symbol || "";
|
|
248
250
|
const dp = token?.precision ?? token?.decimals ?? 2;
|
|
@@ -260,84 +262,100 @@ var AvailableQuantity = (props) => {
|
|
|
260
262
|
"$",
|
|
261
263
|
/* @__PURE__ */ jsx(Text.numeral, { dp: 2, padding: false, rm: Decimal.ROUND_DOWN, children: notional })
|
|
262
264
|
] }),
|
|
263
|
-
/* @__PURE__ */ jsxs(
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
265
|
+
/* @__PURE__ */ jsxs(
|
|
266
|
+
Flex,
|
|
267
|
+
{
|
|
268
|
+
gapX: 2,
|
|
269
|
+
itemAlign: "center",
|
|
270
|
+
className: cn("oui-ms-auto", isRTL && "oui-flex-row-reverse"),
|
|
271
|
+
children: [
|
|
272
|
+
/* @__PURE__ */ jsxs(
|
|
273
|
+
Flex,
|
|
274
|
+
{
|
|
275
|
+
gapX: 1,
|
|
276
|
+
itemAlign: "center",
|
|
277
|
+
className: cn(isRTL && "oui-flex-row-reverse"),
|
|
278
|
+
children: [
|
|
279
|
+
props.tooltipContent ? isMobile ? /* @__PURE__ */ jsx(
|
|
280
|
+
"button",
|
|
281
|
+
{
|
|
282
|
+
type: "button",
|
|
283
|
+
className: "oui-p-0",
|
|
284
|
+
onClick: () => {
|
|
285
|
+
if (token?.symbol) {
|
|
286
|
+
const anyToken = token;
|
|
287
|
+
modal.alert({
|
|
288
|
+
title: t("common.tips"),
|
|
289
|
+
message: /* @__PURE__ */ jsx(
|
|
290
|
+
AvailableTooltipMessage,
|
|
291
|
+
{
|
|
292
|
+
tokenSymbol: token.symbol,
|
|
293
|
+
decimals: anyToken?.token_decimal ?? token.decimals ?? token.precision
|
|
294
|
+
}
|
|
295
|
+
)
|
|
296
|
+
});
|
|
297
|
+
} else {
|
|
298
|
+
modal.alert({
|
|
299
|
+
title: t("common.tips"),
|
|
300
|
+
message: props.tooltipContent
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
children: /* @__PURE__ */ jsx(
|
|
305
|
+
Text,
|
|
306
|
+
{
|
|
307
|
+
size: "2xs",
|
|
308
|
+
intensity: 36,
|
|
309
|
+
className: "oui-cursor-pointer oui-border-b oui-border-dashed oui-border-line-12",
|
|
310
|
+
children: `${t("common.available")}: `
|
|
311
|
+
}
|
|
312
|
+
)
|
|
313
|
+
}
|
|
314
|
+
) : /* @__PURE__ */ jsx(
|
|
315
|
+
Tooltip,
|
|
316
|
+
{
|
|
317
|
+
content: props.tooltipContent,
|
|
318
|
+
className: "oui-max-w-[274px]",
|
|
319
|
+
children: /* @__PURE__ */ jsx(
|
|
320
|
+
Text,
|
|
321
|
+
{
|
|
322
|
+
size: "2xs",
|
|
323
|
+
intensity: 36,
|
|
324
|
+
className: "oui-cursor-pointer oui-border-b oui-border-dashed oui-border-line-12",
|
|
325
|
+
children: `${t("common.available")}: `
|
|
326
|
+
}
|
|
327
|
+
)
|
|
328
|
+
}
|
|
329
|
+
) : /* @__PURE__ */ jsx(Text, { size: "2xs", intensity: 36, children: `${t("common.available")}: ` }),
|
|
330
|
+
loading ? /* @__PURE__ */ jsx(Spinner, { size: "sm" }) : /* @__PURE__ */ jsx(
|
|
331
|
+
Text.numeral,
|
|
332
|
+
{
|
|
333
|
+
size: "2xs",
|
|
334
|
+
intensity: 36,
|
|
335
|
+
rm: Decimal.ROUND_DOWN,
|
|
336
|
+
dp,
|
|
337
|
+
padding: false,
|
|
338
|
+
"data-testid": "oui-testid-withdraw_deposit-dialog-available-value",
|
|
339
|
+
children: maxQuantity
|
|
340
|
+
}
|
|
341
|
+
),
|
|
342
|
+
/* @__PURE__ */ jsx(Text, { size: "2xs", intensity: 36, children: ` ${name}` })
|
|
343
|
+
]
|
|
344
|
+
}
|
|
345
|
+
),
|
|
346
|
+
/* @__PURE__ */ jsx(
|
|
347
|
+
Text,
|
|
348
|
+
{
|
|
349
|
+
size: "2xs",
|
|
350
|
+
color: "primary",
|
|
351
|
+
className: cn("oui-cursor-pointer oui-select-none"),
|
|
352
|
+
onClick: props.onClick,
|
|
353
|
+
children: t("common.max")
|
|
354
|
+
}
|
|
355
|
+
)
|
|
356
|
+
]
|
|
357
|
+
}
|
|
358
|
+
)
|
|
341
359
|
] });
|
|
342
360
|
};
|
|
343
361
|
var BrokerWallet = () => {
|
|
@@ -411,6 +429,8 @@ var ChainSelect = (props) => {
|
|
|
411
429
|
const { chains, value, wrongNetwork, loading, disabled } = props;
|
|
412
430
|
const [open, setOpen] = useState(false);
|
|
413
431
|
const { t } = useTranslation();
|
|
432
|
+
const dir = useDocumentDirection();
|
|
433
|
+
const isRTL = dir === "rtl";
|
|
414
434
|
const selectable = wrongNetwork || chains?.length > 1;
|
|
415
435
|
const chainIcon = wrongNetwork ? /* @__PURE__ */ jsx(
|
|
416
436
|
Flex,
|
|
@@ -451,11 +471,19 @@ var ChainSelect = (props) => {
|
|
|
451
471
|
children: [
|
|
452
472
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
453
473
|
/* @__PURE__ */ jsx(Flex, { children: /* @__PURE__ */ jsx(Text, { size: "2xs", intensity: 54, children: t("transfer.network") }) }),
|
|
454
|
-
/* @__PURE__ */ jsxs(
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
474
|
+
/* @__PURE__ */ jsxs(
|
|
475
|
+
Flex,
|
|
476
|
+
{
|
|
477
|
+
direction: isRTL ? "rowReverse" : "row",
|
|
478
|
+
gapX: 1,
|
|
479
|
+
itemAlign: "center",
|
|
480
|
+
children: [
|
|
481
|
+
chainIcon,
|
|
482
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", intensity: 80, children: chainName }),
|
|
483
|
+
!isCurrentChainSupported && /* @__PURE__ */ jsx(Badge, { color: "danger", size: "xs", children: t("common.notSupported") })
|
|
484
|
+
]
|
|
485
|
+
}
|
|
486
|
+
)
|
|
459
487
|
] }),
|
|
460
488
|
renderRightIcon()
|
|
461
489
|
]
|
|
@@ -470,6 +498,7 @@ var ChainSelect = (props) => {
|
|
|
470
498
|
{
|
|
471
499
|
px: 2,
|
|
472
500
|
r: "base",
|
|
501
|
+
direction: isRTL ? "rowReverse" : "row",
|
|
473
502
|
justify: "between",
|
|
474
503
|
itemAlign: "center",
|
|
475
504
|
className: cn(
|
|
@@ -485,17 +514,25 @@ var ChainSelect = (props) => {
|
|
|
485
514
|
await props.onValueChange(chain);
|
|
486
515
|
},
|
|
487
516
|
children: [
|
|
488
|
-
/* @__PURE__ */ jsxs(
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
517
|
+
/* @__PURE__ */ jsxs(
|
|
518
|
+
Flex,
|
|
519
|
+
{
|
|
520
|
+
direction: isRTL ? "rowReverse" : "row",
|
|
521
|
+
gapX: 1,
|
|
522
|
+
itemAlign: "center",
|
|
523
|
+
children: [
|
|
524
|
+
/* @__PURE__ */ jsx(
|
|
525
|
+
ChainIcon,
|
|
526
|
+
{
|
|
527
|
+
className: cn("oui-size-[18px]", !isSupported && "oui-opacity-50"),
|
|
528
|
+
chainId: chain.chain_id
|
|
529
|
+
}
|
|
530
|
+
),
|
|
531
|
+
/* @__PURE__ */ jsx(Text, { size: "2xs", intensity: isSupported ? 54 : 36, children: chain.name }),
|
|
532
|
+
!isSupported && /* @__PURE__ */ jsx(Badge, { color: "danger", size: "xs", children: t("common.notSupported") })
|
|
533
|
+
]
|
|
534
|
+
}
|
|
535
|
+
),
|
|
499
536
|
isActive && /* @__PURE__ */ jsx(
|
|
500
537
|
Box,
|
|
501
538
|
{
|
|
@@ -516,7 +553,7 @@ var ChainSelect = (props) => {
|
|
|
516
553
|
DropdownMenuContent,
|
|
517
554
|
{
|
|
518
555
|
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
519
|
-
align: "start",
|
|
556
|
+
align: isRTL ? "end" : "start",
|
|
520
557
|
sideOffset: 2,
|
|
521
558
|
className: cn(
|
|
522
559
|
"oui-deposit-token-select-dropdown-menu-content",
|
|
@@ -573,7 +610,7 @@ var CollateralRatioUI = (props) => {
|
|
|
573
610
|
return /* @__PURE__ */ jsxs(Flex, { width: "100%", itemAlign: "center", justify: "between", children: [
|
|
574
611
|
/* @__PURE__ */ jsxs(Flex, { justify: "start", itemAlign: "center", children: [
|
|
575
612
|
/* @__PURE__ */ jsx(Text, { size: "2xs", intensity: 36, children: t("portfolio.overview.column.collateralRatio") }),
|
|
576
|
-
/* @__PURE__ */ jsx(Tooltip, { className: "oui-p-2", content: /* @__PURE__ */ jsx(TooltipContent2, {}), children: /* @__PURE__ */ jsx(TooltipIcon, { className: "oui-
|
|
613
|
+
/* @__PURE__ */ jsx(Tooltip, { className: "oui-p-2", content: /* @__PURE__ */ jsx(TooltipContent2, {}), children: /* @__PURE__ */ jsx(TooltipIcon, { className: "oui-ms-[2px] oui-cursor-pointer oui-text-base-contrast-36" }) })
|
|
577
614
|
] }),
|
|
578
615
|
/* @__PURE__ */ jsx(
|
|
579
616
|
Text.numeral,
|
|
@@ -715,7 +752,7 @@ var NetworkTokenSelect = ({
|
|
|
715
752
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
716
753
|
/* @__PURE__ */ jsxs(Flex, { className: "oui-w-full", justify: "between", itemAlign: "center", children: [
|
|
717
754
|
/* @__PURE__ */ jsx(Text, { size: "xs", intensity: 36, children: t("common.network") }),
|
|
718
|
-
/* @__PURE__ */ jsx(Box, { className: "oui-
|
|
755
|
+
/* @__PURE__ */ jsx(Box, { className: "oui-ms-auto", children: /* @__PURE__ */ jsx(
|
|
719
756
|
Select,
|
|
720
757
|
{
|
|
721
758
|
size: "xs",
|
|
@@ -723,7 +760,7 @@ var NetworkTokenSelect = ({
|
|
|
723
760
|
onValueChange: onNetworkChange,
|
|
724
761
|
placeholder: t("transfer.exclusiveDeposit.selectNetwork"),
|
|
725
762
|
variant: "text",
|
|
726
|
-
classNames: { trigger: "oui-
|
|
763
|
+
classNames: { trigger: "oui-pe-0" },
|
|
727
764
|
maxHeight: 128,
|
|
728
765
|
contentProps: selectContentProps,
|
|
729
766
|
children: networkOptions.map((opt) => /* @__PURE__ */ jsx(SelectItem, { value: opt.value, children: /* @__PURE__ */ jsxs(Flex, { gap: 1, itemAlign: "center", children: [
|
|
@@ -735,7 +772,7 @@ var NetworkTokenSelect = ({
|
|
|
735
772
|
] }),
|
|
736
773
|
/* @__PURE__ */ jsxs(Flex, { className: "oui-w-full", justify: "between", itemAlign: "center", children: [
|
|
737
774
|
/* @__PURE__ */ jsx(Text, { size: "xs", intensity: 36, children: t("common.token") }),
|
|
738
|
-
/* @__PURE__ */ jsx(Box, { className: "oui-
|
|
775
|
+
/* @__PURE__ */ jsx(Box, { className: "oui-ms-auto", children: /* @__PURE__ */ jsx(
|
|
739
776
|
Select,
|
|
740
777
|
{
|
|
741
778
|
size: "xs",
|
|
@@ -743,7 +780,7 @@ var NetworkTokenSelect = ({
|
|
|
743
780
|
onValueChange: onTokenChange,
|
|
744
781
|
placeholder: t("transfer.exclusiveDeposit.selectToken"),
|
|
745
782
|
variant: "text",
|
|
746
|
-
classNames: { trigger: "oui-
|
|
783
|
+
classNames: { trigger: "oui-pe-0" },
|
|
747
784
|
maxHeight: 128,
|
|
748
785
|
contentProps: selectContentProps,
|
|
749
786
|
children: tokenOptions.map((opt) => /* @__PURE__ */ jsx(SelectItem, { value: opt.value, children: /* @__PURE__ */ jsxs(Flex, { gap: 1, itemAlign: "center", children: [
|
|
@@ -1184,12 +1221,15 @@ var TokenOption = (props) => {
|
|
|
1184
1221
|
} = props;
|
|
1185
1222
|
const { symbol, precision, insufficientBalance } = token;
|
|
1186
1223
|
const { apy } = useYieldAPY(symbol);
|
|
1224
|
+
const dir = useDocumentDirection();
|
|
1225
|
+
const isRTL = dir === "rtl";
|
|
1187
1226
|
const showAPY = isYieldBearingAsset(symbol) && apy !== null;
|
|
1188
1227
|
const { t } = useTranslation();
|
|
1189
1228
|
if (displayType === "vaultBalance" && insufficientBalance) {
|
|
1190
1229
|
return /* @__PURE__ */ jsx(
|
|
1191
1230
|
Flex,
|
|
1192
1231
|
{
|
|
1232
|
+
direction: isRTL ? "rowReverse" : "row",
|
|
1193
1233
|
itemAlign: "center",
|
|
1194
1234
|
justify: "between",
|
|
1195
1235
|
px: 2,
|
|
@@ -1202,18 +1242,26 @@ var TokenOption = (props) => {
|
|
|
1202
1242
|
props.index !== 0 && "oui-mt-[2px]",
|
|
1203
1243
|
"oui-cursor-not-allowed"
|
|
1204
1244
|
),
|
|
1205
|
-
children: /* @__PURE__ */ jsxs(
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1245
|
+
children: /* @__PURE__ */ jsxs(
|
|
1246
|
+
Flex,
|
|
1247
|
+
{
|
|
1248
|
+
direction: isRTL ? "rowReverse" : "row",
|
|
1249
|
+
itemAlign: "center",
|
|
1250
|
+
gapX: 1,
|
|
1251
|
+
children: [
|
|
1252
|
+
/* @__PURE__ */ jsx(
|
|
1253
|
+
TokenIcon,
|
|
1254
|
+
{
|
|
1255
|
+
url: token.logo_uri,
|
|
1256
|
+
name: symbol,
|
|
1257
|
+
className: "oui-size-[16px] oui-opacity-50"
|
|
1258
|
+
}
|
|
1259
|
+
),
|
|
1260
|
+
/* @__PURE__ */ jsx(Text, { intensity: 36, className: "oui-max-w-[200px] oui-truncate", children: token.label }),
|
|
1261
|
+
/* @__PURE__ */ jsx(Badge, { color: "neutral", size: "xs", children: t("transfer.withdraw.InsufficientVaultBalance") })
|
|
1262
|
+
]
|
|
1263
|
+
}
|
|
1264
|
+
)
|
|
1217
1265
|
},
|
|
1218
1266
|
symbol
|
|
1219
1267
|
);
|
|
@@ -1243,6 +1291,7 @@ var TokenOption = (props) => {
|
|
|
1243
1291
|
return /* @__PURE__ */ jsxs(
|
|
1244
1292
|
Flex,
|
|
1245
1293
|
{
|
|
1294
|
+
direction: isRTL ? "rowReverse" : "row",
|
|
1246
1295
|
justify: "between",
|
|
1247
1296
|
px: 2,
|
|
1248
1297
|
r: "base",
|
|
@@ -1258,40 +1307,48 @@ var TokenOption = (props) => {
|
|
|
1258
1307
|
onTokenChange?.(token);
|
|
1259
1308
|
},
|
|
1260
1309
|
children: [
|
|
1261
|
-
/* @__PURE__ */ jsxs(
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
isActive && "oui-text-base-contrast-80",
|
|
1276
|
-
"oui-max-w-[200px] oui-truncate"
|
|
1310
|
+
/* @__PURE__ */ jsxs(
|
|
1311
|
+
Flex,
|
|
1312
|
+
{
|
|
1313
|
+
direction: isRTL ? "rowReverse" : "row",
|
|
1314
|
+
gapX: 1,
|
|
1315
|
+
itemAlign: "center",
|
|
1316
|
+
children: [
|
|
1317
|
+
/* @__PURE__ */ jsx(
|
|
1318
|
+
TokenIcon,
|
|
1319
|
+
{
|
|
1320
|
+
name: symbol,
|
|
1321
|
+
url: token.logo_uri,
|
|
1322
|
+
className: "oui-size-[16px]"
|
|
1323
|
+
}
|
|
1277
1324
|
),
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1325
|
+
/* @__PURE__ */ jsx(
|
|
1326
|
+
Text,
|
|
1327
|
+
{
|
|
1328
|
+
className: cn(
|
|
1329
|
+
"oui-text-base-contrast-54 group-hover:oui-text-base-contrast-80",
|
|
1330
|
+
isActive && "oui-text-base-contrast-80",
|
|
1331
|
+
"oui-max-w-[200px] oui-truncate"
|
|
1332
|
+
),
|
|
1333
|
+
children: token.label
|
|
1334
|
+
}
|
|
1335
|
+
),
|
|
1336
|
+
showAPY && /* @__PURE__ */ jsx(
|
|
1337
|
+
Box,
|
|
1338
|
+
{
|
|
1339
|
+
height: 18,
|
|
1340
|
+
px: 2,
|
|
1341
|
+
r: "sm",
|
|
1342
|
+
className: "oui-rounded-[4px] oui-bg-success/[0.15]",
|
|
1343
|
+
children: /* @__PURE__ */ jsxs(Text, { size: "2xs", className: "oui-text-success", children: [
|
|
1344
|
+
apy.toFixed(1),
|
|
1345
|
+
"% APY"
|
|
1346
|
+
] })
|
|
1347
|
+
}
|
|
1348
|
+
)
|
|
1349
|
+
]
|
|
1350
|
+
}
|
|
1351
|
+
),
|
|
1295
1352
|
renderValue()
|
|
1296
1353
|
]
|
|
1297
1354
|
},
|
|
@@ -1322,6 +1379,7 @@ var QuantityInput = (props) => {
|
|
|
1322
1379
|
...rest
|
|
1323
1380
|
} = props;
|
|
1324
1381
|
const { t } = useTranslation();
|
|
1382
|
+
const dir = useDocumentDirection();
|
|
1325
1383
|
const inputRef = useRef(null);
|
|
1326
1384
|
const [open, setOpen] = useState(false);
|
|
1327
1385
|
const [width, setWidth] = useState(0);
|
|
@@ -1372,7 +1430,7 @@ var QuantityInput = (props) => {
|
|
|
1372
1430
|
/* @__PURE__ */ jsx(Box, { className: "oui-absolute oui-top-0", children: /* @__PURE__ */ jsx(Text, { size: "2xs", intensity: 36, children: label || t("common.quantity") }) }),
|
|
1373
1431
|
loading && /* @__PURE__ */ jsx(Box, { className: "oui-absolute oui-bottom-1", children: /* @__PURE__ */ jsx(Spinner, { size: "sm" }) })
|
|
1374
1432
|
] });
|
|
1375
|
-
const suffix = /* @__PURE__ */ jsx("div", { className: "oui-absolute oui-
|
|
1433
|
+
const suffix = /* @__PURE__ */ jsx("div", { className: "oui-absolute oui-end-0", children: /* @__PURE__ */ jsx(
|
|
1376
1434
|
Select.tokens,
|
|
1377
1435
|
{
|
|
1378
1436
|
open: selectOpen,
|
|
@@ -1397,7 +1455,7 @@ var QuantityInput = (props) => {
|
|
|
1397
1455
|
inputRef.current?.focus();
|
|
1398
1456
|
},
|
|
1399
1457
|
style: { width },
|
|
1400
|
-
align: "end",
|
|
1458
|
+
align: dir === "rtl" ? "start" : "end",
|
|
1401
1459
|
sideOffset: 5,
|
|
1402
1460
|
className: "oui-border oui-border-line-6"
|
|
1403
1461
|
}
|
|
@@ -1567,7 +1625,7 @@ var Slippage = (props) => {
|
|
|
1567
1625
|
"oui-h-[40px] oui-w-[74px]"
|
|
1568
1626
|
),
|
|
1569
1627
|
input: "oui-text-base-contrast",
|
|
1570
|
-
additional: "oui-
|
|
1628
|
+
additional: "oui-ps-1",
|
|
1571
1629
|
suffix: "oui-text-base-contrast-36"
|
|
1572
1630
|
}
|
|
1573
1631
|
}
|
|
@@ -2187,7 +2245,7 @@ function useChainSelect() {
|
|
|
2187
2245
|
}
|
|
2188
2246
|
});
|
|
2189
2247
|
},
|
|
2190
|
-
[currentChain, setChain,
|
|
2248
|
+
[connectedChain, currentChain, findByChainId, setChain, t]
|
|
2191
2249
|
);
|
|
2192
2250
|
return {
|
|
2193
2251
|
chains,
|
|
@@ -4126,7 +4184,7 @@ var useSwapDeposit = (options2) => {
|
|
|
4126
4184
|
toast.error(err.message || t("common.somethingWentWrong"));
|
|
4127
4185
|
throw err;
|
|
4128
4186
|
}
|
|
4129
|
-
}, [account2, brokerId,
|
|
4187
|
+
}, [account2, brokerId, depositFee, sourceToken, swapData, t, targetToken]);
|
|
4130
4188
|
return {
|
|
4131
4189
|
swapPrice,
|
|
4132
4190
|
swapQuantity,
|
|
@@ -4415,7 +4473,7 @@ var TextAreaInput = (props) => {
|
|
|
4415
4473
|
textarea.style.height = `${textarea.scrollHeight}px`;
|
|
4416
4474
|
}
|
|
4417
4475
|
}, [value, selectedAccount?.address]);
|
|
4418
|
-
const prefix = /* @__PURE__ */ jsx("div", { className: "oui-absolute oui-
|
|
4476
|
+
const prefix = /* @__PURE__ */ jsx("div", { className: "oui-absolute oui-start-3 oui-top-0.5 oui-z-[1]", children: /* @__PURE__ */ jsx(Text, { size: "2xs", intensity: 36, children: label }) });
|
|
4419
4477
|
const message = /* @__PURE__ */ jsxs(Flex, { mb: 1, gapX: 1, px: 1, children: [
|
|
4420
4478
|
/* @__PURE__ */ jsx(
|
|
4421
4479
|
Box,
|
|
@@ -4498,7 +4556,7 @@ var TextAreaInput = (props) => {
|
|
|
4498
4556
|
]
|
|
4499
4557
|
}
|
|
4500
4558
|
) }),
|
|
4501
|
-
enableAccountLookup && /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "oui-absolute oui-
|
|
4559
|
+
enableAccountLookup && /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "oui-absolute oui-start-0 oui-bottom-0 oui-w-0 oui-h-0" }) })
|
|
4502
4560
|
]
|
|
4503
4561
|
}
|
|
4504
4562
|
)
|
|
@@ -4986,7 +5044,8 @@ var useVaultBalance = (inputs) => {
|
|
|
4986
5044
|
crossChainWithdraw,
|
|
4987
5045
|
chainName,
|
|
4988
5046
|
sourceToken,
|
|
4989
|
-
chainVaultBalance
|
|
5047
|
+
chainVaultBalance,
|
|
5048
|
+
t
|
|
4990
5049
|
]);
|
|
4991
5050
|
const vaultBalanceListFilterCCTP = useMemo(() => {
|
|
4992
5051
|
if (cctpSupportedChains.includes(currentChain?.id)) {
|
|
@@ -5209,7 +5268,7 @@ var useWithdrawLTV = (params) => {
|
|
|
5209
5268
|
}
|
|
5210
5269
|
}
|
|
5211
5270
|
return "";
|
|
5212
|
-
}, [nextLTV,
|
|
5271
|
+
}, [ltv_threshold, nextLTV, t]);
|
|
5213
5272
|
return {
|
|
5214
5273
|
currentLTV,
|
|
5215
5274
|
nextLTV,
|
|
@@ -5936,9 +5995,9 @@ var AddWalletDialog = ({
|
|
|
5936
5995
|
onValueChange: onAddressChange,
|
|
5937
5996
|
autoFocus: true,
|
|
5938
5997
|
color: showBorderDanger ? "danger" : void 0,
|
|
5939
|
-
className:
|
|
5998
|
+
className: "oui-bg-base-6",
|
|
5940
5999
|
classNames: { input: "oui-text-base-contrast" },
|
|
5941
|
-
suffix: address && /* @__PURE__ */ jsx(Box, { className: "oui-
|
|
6000
|
+
suffix: address && /* @__PURE__ */ jsx(Box, { className: "oui-ms-2.5 oui-me-2 oui-cursor-pointer", children: /* @__PURE__ */ jsx(
|
|
5942
6001
|
CloseRoundFillIcon,
|
|
5943
6002
|
{
|
|
5944
6003
|
size: 16,
|
|
@@ -6019,6 +6078,8 @@ var WalletSelector = ({
|
|
|
6019
6078
|
}) => {
|
|
6020
6079
|
const { t } = useTranslation();
|
|
6021
6080
|
const [isOpen, setIsOpen] = useState(false);
|
|
6081
|
+
const dir = useDocumentDirection();
|
|
6082
|
+
const isRTL = dir === "rtl";
|
|
6022
6083
|
const currentNetwork = useMemo(() => {
|
|
6023
6084
|
if (!connectedWallet?.namespace) return void 0;
|
|
6024
6085
|
const ns = connectedWallet.namespace.toLowerCase();
|
|
@@ -6066,7 +6127,7 @@ var WalletSelector = ({
|
|
|
6066
6127
|
const dropdownContent = /* @__PURE__ */ jsx(DropdownMenuPortal, { children: /* @__PURE__ */ jsxs(
|
|
6067
6128
|
DropdownMenuContent,
|
|
6068
6129
|
{
|
|
6069
|
-
align: "end",
|
|
6130
|
+
align: isRTL ? "start" : "end",
|
|
6070
6131
|
className: "oui-max-h-[240px] oui-overflow-y-auto oui-custom-scrollbar",
|
|
6071
6132
|
children: [
|
|
6072
6133
|
showConnectedItem && connectedWallet && /* @__PURE__ */ jsx(
|
|
@@ -6120,6 +6181,7 @@ var WalletSelector = ({
|
|
|
6120
6181
|
children: /* @__PURE__ */ jsxs(
|
|
6121
6182
|
Flex,
|
|
6122
6183
|
{
|
|
6184
|
+
direction: isRTL ? "rowReverse" : "row",
|
|
6123
6185
|
itemAlign: "center",
|
|
6124
6186
|
gapX: 1,
|
|
6125
6187
|
className: "oui-text-primary oui-font-semibold oui-tracking-[0.03em]",
|
|
@@ -6137,20 +6199,29 @@ var WalletSelector = ({
|
|
|
6137
6199
|
return /* @__PURE__ */ jsxs(Flex, { justify: "between", className: "oui-w-full oui-mb-3", children: [
|
|
6138
6200
|
/* @__PURE__ */ jsx(Text, { size: "2xs", intensity: 36, children: t("common.wallet") }),
|
|
6139
6201
|
/* @__PURE__ */ jsxs(DropdownMenuRoot, { open: isOpen, onOpenChange: setIsOpen, children: [
|
|
6140
|
-
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
6141
|
-
|
|
6142
|
-
|
|
6143
|
-
|
|
6144
|
-
|
|
6145
|
-
|
|
6146
|
-
|
|
6147
|
-
|
|
6148
|
-
|
|
6149
|
-
|
|
6150
|
-
|
|
6151
|
-
|
|
6152
|
-
|
|
6153
|
-
|
|
6202
|
+
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
6203
|
+
"div",
|
|
6204
|
+
{
|
|
6205
|
+
className: cn(
|
|
6206
|
+
"oui-flex oui-items-center oui-gap-1 oui-cursor-pointer oui-text-base-contrast-54 hover:oui-text-base-contrast-80",
|
|
6207
|
+
isRTL && "oui-flex-row-reverse"
|
|
6208
|
+
),
|
|
6209
|
+
children: [
|
|
6210
|
+
selectedWalletOpt?.name && /* @__PURE__ */ jsx(WalletIcon, { name: selectedWalletOpt.name, size: "3xs" }),
|
|
6211
|
+
/* @__PURE__ */ jsx(Text.formatted, { size: "2xs", intensity: 54, rule: "address", children: selectedWalletOpt?.address || "" }),
|
|
6212
|
+
/* @__PURE__ */ jsx(
|
|
6213
|
+
Text,
|
|
6214
|
+
{
|
|
6215
|
+
size: "2xs",
|
|
6216
|
+
intensity: 54,
|
|
6217
|
+
className: "oui-text-base-contrast-36",
|
|
6218
|
+
children: ` (${getChainLabel(selectedWalletOpt?.network)})`
|
|
6219
|
+
}
|
|
6220
|
+
),
|
|
6221
|
+
isOpen ? /* @__PURE__ */ jsx(CaretUpIcon, { size: 12, className: "oui-text-inherit" }) : /* @__PURE__ */ jsx(CaretDownIcon, { size: 12, className: "oui-text-inherit" })
|
|
6222
|
+
]
|
|
6223
|
+
}
|
|
6224
|
+
) }),
|
|
6154
6225
|
dropdownContent
|
|
6155
6226
|
] })
|
|
6156
6227
|
] });
|
|
@@ -7012,7 +7083,7 @@ function useInputStatus(options2) {
|
|
|
7012
7083
|
setHintMessage("");
|
|
7013
7084
|
}
|
|
7014
7085
|
}
|
|
7015
|
-
}, [quantity,
|
|
7086
|
+
}, [maxQuantity, quantity, t, unsettledPnL]);
|
|
7016
7087
|
return { inputStatus, hintMessage };
|
|
7017
7088
|
}
|
|
7018
7089
|
var TransferDialogId = "TransferDialogId";
|