@unifold/ui-react 0.1.24 → 0.1.25
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.d.mts +13 -2
- package/dist/index.d.ts +13 -2
- package/dist/index.js +633 -578
- package/dist/index.mjs +607 -554
- package/dist/styles-base.css +1 -1
- package/dist/styles.css +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -86,8 +86,8 @@ __export(index_exports, {
|
|
|
86
86
|
module.exports = __toCommonJS(index_exports);
|
|
87
87
|
|
|
88
88
|
// src/components/deposits/DepositModal.tsx
|
|
89
|
-
var
|
|
90
|
-
var
|
|
89
|
+
var import_react14 = require("react");
|
|
90
|
+
var import_lucide_react16 = require("lucide-react");
|
|
91
91
|
|
|
92
92
|
// src/components/shared/dialog.tsx
|
|
93
93
|
var React2 = __toESM(require("react"));
|
|
@@ -3523,7 +3523,7 @@ function DepositTrackerButton({
|
|
|
3523
3523
|
}
|
|
3524
3524
|
|
|
3525
3525
|
// src/components/deposits/DepositModal.tsx
|
|
3526
|
-
var
|
|
3526
|
+
var import_core15 = require("@unifold/core");
|
|
3527
3527
|
|
|
3528
3528
|
// src/hooks/use-allowed-country.ts
|
|
3529
3529
|
var import_react_query2 = require("@tanstack/react-query");
|
|
@@ -3638,8 +3638,8 @@ function useAddressValidation({
|
|
|
3638
3638
|
}
|
|
3639
3639
|
|
|
3640
3640
|
// src/components/deposits/TransferCryptoSingleInput.tsx
|
|
3641
|
-
var
|
|
3642
|
-
var
|
|
3641
|
+
var import_react12 = require("react");
|
|
3642
|
+
var import_lucide_react13 = require("lucide-react");
|
|
3643
3643
|
|
|
3644
3644
|
// src/components/deposits/StyledQRCode.tsx
|
|
3645
3645
|
var import_react9 = require("react");
|
|
@@ -3762,7 +3762,7 @@ function saveRecentToken(token) {
|
|
|
3762
3762
|
try {
|
|
3763
3763
|
const recent = getRecentTokens();
|
|
3764
3764
|
const filtered = recent.filter(
|
|
3765
|
-
(
|
|
3765
|
+
(t6) => !(t6.symbol === token.symbol && t6.chainType === token.chainType && t6.chainId === token.chainId)
|
|
3766
3766
|
);
|
|
3767
3767
|
filtered.unshift(token);
|
|
3768
3768
|
const trimmed = filtered.slice(0, MAX_RECENT_TOKENS);
|
|
@@ -3775,7 +3775,7 @@ function removeRecentToken(token) {
|
|
|
3775
3775
|
try {
|
|
3776
3776
|
const recent = getRecentTokens();
|
|
3777
3777
|
const filtered = recent.filter(
|
|
3778
|
-
(
|
|
3778
|
+
(t6) => !(t6.symbol === token.symbol && t6.chainType === token.chainType && t6.chainId === token.chainId)
|
|
3779
3779
|
);
|
|
3780
3780
|
localStorage.setItem(STORAGE_KEY, JSON.stringify(filtered));
|
|
3781
3781
|
return filtered;
|
|
@@ -3814,7 +3814,7 @@ function TokenSelectorSheet({
|
|
|
3814
3814
|
const addOption = (symbol, chainType, chainId, isRecent) => {
|
|
3815
3815
|
const key = `${symbol}-${chainType}:${chainId}`;
|
|
3816
3816
|
if (seen.has(key)) return;
|
|
3817
|
-
const tokenData = tokens.find((
|
|
3817
|
+
const tokenData = tokens.find((t6) => t6.symbol === symbol);
|
|
3818
3818
|
if (!tokenData) return;
|
|
3819
3819
|
const chainData = tokenData.chains.find(
|
|
3820
3820
|
(c) => c.chain_type === chainType && c.chain_id === chainId
|
|
@@ -4183,16 +4183,211 @@ function TokenSelectorSheet({
|
|
|
4183
4183
|
);
|
|
4184
4184
|
}
|
|
4185
4185
|
|
|
4186
|
+
// src/components/deposits/shared/PollCooldownButton.tsx
|
|
4187
|
+
var import_core12 = require("@unifold/core");
|
|
4188
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
4189
|
+
function PollCooldownButton({
|
|
4190
|
+
currentWalletId,
|
|
4191
|
+
pollCooldown,
|
|
4192
|
+
publishableKey,
|
|
4193
|
+
onCooldownChange,
|
|
4194
|
+
cooldownRef,
|
|
4195
|
+
buttonText = "Check again"
|
|
4196
|
+
}) {
|
|
4197
|
+
const handleClick = async () => {
|
|
4198
|
+
if (!currentWalletId || pollCooldown > 0) return;
|
|
4199
|
+
try {
|
|
4200
|
+
await (0, import_core12.pollDirectExecutions)(
|
|
4201
|
+
{ deposit_wallet_id: currentWalletId },
|
|
4202
|
+
publishableKey
|
|
4203
|
+
);
|
|
4204
|
+
const cooldownSeconds = 5;
|
|
4205
|
+
onCooldownChange(cooldownSeconds);
|
|
4206
|
+
if (cooldownRef.current) clearInterval(cooldownRef.current);
|
|
4207
|
+
cooldownRef.current = setInterval(() => {
|
|
4208
|
+
onCooldownChange((prev) => {
|
|
4209
|
+
if (prev <= 1) {
|
|
4210
|
+
if (cooldownRef.current) clearInterval(cooldownRef.current);
|
|
4211
|
+
cooldownRef.current = null;
|
|
4212
|
+
return 0;
|
|
4213
|
+
}
|
|
4214
|
+
return prev - 1;
|
|
4215
|
+
});
|
|
4216
|
+
}, 1e3);
|
|
4217
|
+
} catch (error) {
|
|
4218
|
+
console.error("Failed to start poll workflow:", error);
|
|
4219
|
+
}
|
|
4220
|
+
};
|
|
4221
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
4222
|
+
"button",
|
|
4223
|
+
{
|
|
4224
|
+
onClick: handleClick,
|
|
4225
|
+
disabled: !currentWalletId || pollCooldown > 0,
|
|
4226
|
+
className: "uf-w-full uf-rounded-xl uf-p-2 uf-flex uf-items-center uf-gap-3 uf-justify-center uf-text-center uf-text-sm uf-bg-primary hover:uf-bg-primary/80 uf-transition-colors uf-text-left disabled:uf-opacity-50 disabled:uf-cursor-not-allowed",
|
|
4227
|
+
children: pollCooldown > 0 ? `${buttonText} in ${pollCooldown}s` : "I've made the deposit"
|
|
4228
|
+
}
|
|
4229
|
+
) });
|
|
4230
|
+
}
|
|
4231
|
+
|
|
4232
|
+
// src/components/deposits/shared/DepositFooterLinks.tsx
|
|
4233
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
4234
|
+
function DepositFooterLinks({ onGlossaryClick }) {
|
|
4235
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "uf-flex uf-justify-end uf-items-center uf-gap-2 uf-text-xs uf-text-muted-foreground", children: [
|
|
4236
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4237
|
+
"a",
|
|
4238
|
+
{
|
|
4239
|
+
href: "https://unifold.io/terms",
|
|
4240
|
+
target: "_blank",
|
|
4241
|
+
className: "uf-cursor-pointer hover:uf-text-foreground uf-transition-colors",
|
|
4242
|
+
children: "terms"
|
|
4243
|
+
}
|
|
4244
|
+
),
|
|
4245
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "uf-text-xs uf-text-muted-foreground", children: "|" }),
|
|
4246
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4247
|
+
"a",
|
|
4248
|
+
{
|
|
4249
|
+
href: "https://unifold.io/support",
|
|
4250
|
+
target: "_blank",
|
|
4251
|
+
className: "uf-cursor-pointer hover:uf-text-foreground uf-transition-colors",
|
|
4252
|
+
children: "help"
|
|
4253
|
+
}
|
|
4254
|
+
),
|
|
4255
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "uf-text-xs uf-text-muted-foreground", children: "|" }),
|
|
4256
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4257
|
+
"div",
|
|
4258
|
+
{
|
|
4259
|
+
className: "uf-cursor-pointer hover:uf-text-foreground uf-transition-colors",
|
|
4260
|
+
onClick: onGlossaryClick,
|
|
4261
|
+
children: "glossary"
|
|
4262
|
+
}
|
|
4263
|
+
)
|
|
4264
|
+
] });
|
|
4265
|
+
}
|
|
4266
|
+
|
|
4267
|
+
// src/components/deposits/shared/GlossaryModal.tsx
|
|
4268
|
+
var import_lucide_react12 = require("lucide-react");
|
|
4269
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
4270
|
+
var t2 = i18n.transferCrypto;
|
|
4271
|
+
function GlossaryModal({
|
|
4272
|
+
open,
|
|
4273
|
+
onOpenChange,
|
|
4274
|
+
themeClass,
|
|
4275
|
+
colors: colors2
|
|
4276
|
+
}) {
|
|
4277
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Dialog, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
4278
|
+
DialogContent,
|
|
4279
|
+
{
|
|
4280
|
+
className: `sm:uf-max-w-[400px] !uf-top-auto !uf-h-auto sm:!uf-top-[50%] uf-border-secondary uf-text-foreground uf-p-0 uf-gap-0 [&>button]:uf-hidden ${themeClass}`,
|
|
4281
|
+
style: { backgroundColor: colors2.card },
|
|
4282
|
+
children: [
|
|
4283
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "uf-flex uf-items-center uf-justify-between uf-p-4 uf-pb-2", children: [
|
|
4284
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DialogTitle, { className: "uf-text-base uf-font-semibold", children: "Glossary" }),
|
|
4285
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
4286
|
+
"button",
|
|
4287
|
+
{
|
|
4288
|
+
onClick: () => onOpenChange(false),
|
|
4289
|
+
className: "uf-p-1 uf-rounded-lg hover:uf-bg-secondary uf-transition-colors uf-text-muted-foreground hover:uf-text-foreground",
|
|
4290
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react12.X, { className: "uf-w-4 uf-h-4" })
|
|
4291
|
+
}
|
|
4292
|
+
)
|
|
4293
|
+
] }),
|
|
4294
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "uf-max-h-[60vh] sm:uf-max-h-[400px] uf-overflow-y-auto uf-px-4 uf-pb-4 [scrollbar-width:none] [&::-webkit-scrollbar]:uf-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "uf-space-y-4", children: [
|
|
4295
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { children: [
|
|
4296
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "uf-text-sm uf-font-medium uf-mb-1", children: "Your Deposit Token" }),
|
|
4297
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "uf-text-xs uf-text-muted-foreground uf-leading-relaxed", children: t2.selectTokenDepositTooltip })
|
|
4298
|
+
] }),
|
|
4299
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "uf-border-t uf-border-border" }),
|
|
4300
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { children: [
|
|
4301
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "uf-text-sm uf-font-medium uf-mb-1", children: "Deposit Address" }),
|
|
4302
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "uf-text-xs uf-text-muted-foreground uf-leading-relaxed", children: "A unique wallet address generated for you. Send supported tokens to this address and they will be automatically converted and deposited into your account." })
|
|
4303
|
+
] }),
|
|
4304
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "uf-border-t uf-border-border" }),
|
|
4305
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { children: [
|
|
4306
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "uf-text-sm uf-font-medium uf-mb-1", children: "Price Impact" }),
|
|
4307
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "uf-text-xs uf-text-muted-foreground uf-leading-relaxed", children: t2.priceImpact.tooltip })
|
|
4308
|
+
] }),
|
|
4309
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "uf-border-t uf-border-border" }),
|
|
4310
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { children: [
|
|
4311
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "uf-text-sm uf-font-medium uf-mb-1", children: "Slippage" }),
|
|
4312
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "uf-text-xs uf-text-muted-foreground uf-leading-relaxed", children: t2.slippage.tooltip })
|
|
4313
|
+
] }),
|
|
4314
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "uf-border-t uf-border-border" }),
|
|
4315
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { children: [
|
|
4316
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "uf-text-sm uf-font-medium uf-mb-1", children: "Processing Time" }),
|
|
4317
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "uf-text-xs uf-text-muted-foreground uf-leading-relaxed", children: "The estimated time for your deposit to be confirmed and credited. This depends on the source network's block confirmation time and current congestion." })
|
|
4318
|
+
] }),
|
|
4319
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "uf-border-t uf-border-border" }),
|
|
4320
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { children: [
|
|
4321
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "uf-text-sm uf-font-medium uf-mb-1", children: "Minimum Deposit" }),
|
|
4322
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "uf-text-xs uf-text-muted-foreground uf-leading-relaxed", children: t2.minDeposit.tooltip })
|
|
4323
|
+
] }),
|
|
4324
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "uf-border-t uf-border-border" }),
|
|
4325
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { children: [
|
|
4326
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "uf-text-sm uf-font-medium uf-mb-1", children: "Recipient Address" }),
|
|
4327
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "uf-text-xs uf-text-muted-foreground uf-leading-relaxed", children: "The destination address on the target blockchain where your converted deposit will be sent. This is typically your wallet address on the application's native chain." })
|
|
4328
|
+
] })
|
|
4329
|
+
] }) })
|
|
4330
|
+
]
|
|
4331
|
+
}
|
|
4332
|
+
) });
|
|
4333
|
+
}
|
|
4334
|
+
|
|
4335
|
+
// src/components/deposits/shared/useCopyAddress.ts
|
|
4336
|
+
var import_react11 = require("react");
|
|
4337
|
+
function useCopyAddress() {
|
|
4338
|
+
const [copied, setCopied] = (0, import_react11.useState)(false);
|
|
4339
|
+
const handleCopy = (address) => {
|
|
4340
|
+
if (!address) return;
|
|
4341
|
+
navigator.clipboard.writeText(address);
|
|
4342
|
+
setCopied(true);
|
|
4343
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
4344
|
+
};
|
|
4345
|
+
return { copied, handleCopy };
|
|
4346
|
+
}
|
|
4347
|
+
|
|
4186
4348
|
// src/components/shared/tooltip.tsx
|
|
4187
4349
|
var React8 = __toESM(require("react"));
|
|
4188
4350
|
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"));
|
|
4189
|
-
var
|
|
4351
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
4190
4352
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
4191
|
-
|
|
4192
|
-
|
|
4353
|
+
function Tooltip({
|
|
4354
|
+
children,
|
|
4355
|
+
...props
|
|
4356
|
+
}) {
|
|
4357
|
+
const [open, setOpen] = React8.useState(props.defaultOpen ?? false);
|
|
4358
|
+
const isControlled = props.open !== void 0;
|
|
4359
|
+
const isOpen = isControlled ? props.open : open;
|
|
4360
|
+
const onOpenChange = isControlled ? props.onOpenChange : (nextOpen) => setOpen(nextOpen);
|
|
4361
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TooltipContext.Provider, { value: { open: isOpen, onOpenChange }, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4362
|
+
TooltipPrimitive.Root,
|
|
4363
|
+
{
|
|
4364
|
+
...props,
|
|
4365
|
+
open: isOpen,
|
|
4366
|
+
onOpenChange,
|
|
4367
|
+
children
|
|
4368
|
+
}
|
|
4369
|
+
) });
|
|
4370
|
+
}
|
|
4371
|
+
var TooltipContext = React8.createContext({
|
|
4372
|
+
open: false,
|
|
4373
|
+
onOpenChange: () => {
|
|
4374
|
+
}
|
|
4375
|
+
});
|
|
4376
|
+
var TooltipTrigger = React8.forwardRef(({ onClick, ...props }, ref) => {
|
|
4377
|
+
const { open, onOpenChange } = React8.useContext(TooltipContext);
|
|
4378
|
+
const handleClick = React8.useCallback(
|
|
4379
|
+
(e) => {
|
|
4380
|
+
onOpenChange(!open);
|
|
4381
|
+
onClick?.(e);
|
|
4382
|
+
},
|
|
4383
|
+
[open, onOpenChange, onClick]
|
|
4384
|
+
);
|
|
4385
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TooltipPrimitive.Trigger, { ref, onClick: handleClick, ...props });
|
|
4386
|
+
});
|
|
4387
|
+
TooltipTrigger.displayName = TooltipPrimitive.Trigger.displayName;
|
|
4193
4388
|
var TooltipContent = React8.forwardRef(({ className, sideOffset = 4, ...props }, ref) => {
|
|
4194
4389
|
const { themeClass, colors: colors2 } = useTheme();
|
|
4195
|
-
return /* @__PURE__ */ (0,
|
|
4390
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TooltipPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4196
4391
|
TooltipPrimitive.Content,
|
|
4197
4392
|
{
|
|
4198
4393
|
ref,
|
|
@@ -4210,9 +4405,9 @@ var TooltipContent = React8.forwardRef(({ className, sideOffset = 4, ...props },
|
|
|
4210
4405
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
4211
4406
|
|
|
4212
4407
|
// src/components/deposits/TransferCryptoSingleInput.tsx
|
|
4213
|
-
var
|
|
4214
|
-
var
|
|
4215
|
-
var
|
|
4408
|
+
var import_core13 = require("@unifold/core");
|
|
4409
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
4410
|
+
var t3 = i18n.transferCrypto;
|
|
4216
4411
|
var getChainKey = (chainId, chainType) => {
|
|
4217
4412
|
return `${chainType}:${chainId}`;
|
|
4218
4413
|
};
|
|
@@ -4234,13 +4429,25 @@ function TransferCryptoSingleInput({
|
|
|
4234
4429
|
}) {
|
|
4235
4430
|
const { themeClass, colors: colors2, fonts, components } = useTheme();
|
|
4236
4431
|
const isDarkMode = themeClass.includes("uf-dark");
|
|
4237
|
-
const [token, setToken] = (0,
|
|
4238
|
-
const [chain, setChain] = (0,
|
|
4239
|
-
const [copied, setCopied] = (0,
|
|
4240
|
-
const
|
|
4241
|
-
const [
|
|
4432
|
+
const [token, setToken] = (0, import_react12.useState)("USDC");
|
|
4433
|
+
const [chain, setChain] = (0, import_react12.useState)("solana:mainnet");
|
|
4434
|
+
const [copied, setCopied] = (0, import_react12.useState)(false);
|
|
4435
|
+
const { copied: copiedRecipient, handleCopy: handleCopyRecipientAddress } = useCopyAddress();
|
|
4436
|
+
const [glossaryOpen, setGlossaryOpen] = (0, import_react12.useState)(false);
|
|
4437
|
+
const [pollCooldown, setPollCooldown] = (0, import_react12.useState)(0);
|
|
4438
|
+
const cooldownRef = (0, import_react12.useRef)(null);
|
|
4439
|
+
const [internalWallets, setInternalWallets] = (0, import_react12.useState)([]);
|
|
4440
|
+
const [loading, setLoading] = (0, import_react12.useState)(!externalWallets?.length);
|
|
4441
|
+
(0, import_react12.useEffect)(() => {
|
|
4442
|
+
return () => {
|
|
4443
|
+
if (cooldownRef.current) {
|
|
4444
|
+
clearInterval(cooldownRef.current);
|
|
4445
|
+
cooldownRef.current = null;
|
|
4446
|
+
}
|
|
4447
|
+
};
|
|
4448
|
+
}, []);
|
|
4242
4449
|
const wallets = externalWallets?.length ? externalWallets : internalWallets;
|
|
4243
|
-
const [error, setError] = (0,
|
|
4450
|
+
const [error, setError] = (0, import_react12.useState)(null);
|
|
4244
4451
|
const { executions: depositExecutions, isPolling } = useDepositPolling({
|
|
4245
4452
|
userId,
|
|
4246
4453
|
publishableKey,
|
|
@@ -4248,14 +4455,14 @@ function TransferCryptoSingleInput({
|
|
|
4248
4455
|
onDepositSuccess,
|
|
4249
4456
|
onDepositError
|
|
4250
4457
|
});
|
|
4251
|
-
const [supportedTokens, setSupportedTokens] = (0,
|
|
4252
|
-
const [tokensLoading, setTokensLoading] = (0,
|
|
4253
|
-
const [detailsExpanded, setDetailsExpanded] = (0,
|
|
4254
|
-
const [depositsModalOpen, setDepositsModalOpen] = (0,
|
|
4255
|
-
const [tokenSelectorOpen, setTokenSelectorOpen] = (0,
|
|
4458
|
+
const [supportedTokens, setSupportedTokens] = (0, import_react12.useState)([]);
|
|
4459
|
+
const [tokensLoading, setTokensLoading] = (0, import_react12.useState)(true);
|
|
4460
|
+
const [detailsExpanded, setDetailsExpanded] = (0, import_react12.useState)(false);
|
|
4461
|
+
const [depositsModalOpen, setDepositsModalOpen] = (0, import_react12.useState)(false);
|
|
4462
|
+
const [tokenSelectorOpen, setTokenSelectorOpen] = (0, import_react12.useState)(false);
|
|
4256
4463
|
const allChainsMap = /* @__PURE__ */ new Map();
|
|
4257
|
-
supportedTokens.forEach((
|
|
4258
|
-
|
|
4464
|
+
supportedTokens.forEach((t6) => {
|
|
4465
|
+
t6.chains.forEach((c) => {
|
|
4259
4466
|
const comboKey = `${c.chain_type}:${c.chain_id}`;
|
|
4260
4467
|
if (!allChainsMap.has(comboKey)) {
|
|
4261
4468
|
allChainsMap.set(comboKey, c);
|
|
@@ -4268,9 +4475,9 @@ function TransferCryptoSingleInput({
|
|
|
4268
4475
|
(c) => c.chain_type === currentChainCombo.chainType && c.chain_id === currentChainCombo.chainId
|
|
4269
4476
|
);
|
|
4270
4477
|
const currentChainType = currentChainData?.chain_type || "ethereum";
|
|
4271
|
-
const currentWallet = (0,
|
|
4478
|
+
const currentWallet = (0, import_core13.getWalletByChainType)(wallets, currentChainType);
|
|
4272
4479
|
const depositAddress = currentWallet?.address || "";
|
|
4273
|
-
(0,
|
|
4480
|
+
(0, import_react12.useEffect)(() => {
|
|
4274
4481
|
async function fetchSupportedTokens() {
|
|
4275
4482
|
try {
|
|
4276
4483
|
setTokensLoading(true);
|
|
@@ -4279,7 +4486,7 @@ function TransferCryptoSingleInput({
|
|
|
4279
4486
|
destination_chain_id: destinationChainId,
|
|
4280
4487
|
destination_chain_type: destinationChainType
|
|
4281
4488
|
} : void 0;
|
|
4282
|
-
const response = await (0,
|
|
4489
|
+
const response = await (0, import_core13.getSupportedDepositTokens)(
|
|
4283
4490
|
publishableKey,
|
|
4284
4491
|
options
|
|
4285
4492
|
);
|
|
@@ -4288,25 +4495,25 @@ function TransferCryptoSingleInput({
|
|
|
4288
4495
|
let selectedTokenData;
|
|
4289
4496
|
let selectedChainData;
|
|
4290
4497
|
if (destinationTokenAddress) {
|
|
4291
|
-
for (const
|
|
4292
|
-
const matchingChain =
|
|
4498
|
+
for (const t6 of response.data) {
|
|
4499
|
+
const matchingChain = t6.chains.find(
|
|
4293
4500
|
(c) => c.token_address.toLowerCase() === destinationTokenAddress.toLowerCase()
|
|
4294
4501
|
);
|
|
4295
4502
|
if (matchingChain) {
|
|
4296
|
-
selectedTokenData =
|
|
4503
|
+
selectedTokenData = t6;
|
|
4297
4504
|
selectedChainData = matchingChain;
|
|
4298
4505
|
break;
|
|
4299
4506
|
}
|
|
4300
4507
|
}
|
|
4301
4508
|
}
|
|
4302
4509
|
if (!selectedTokenData) {
|
|
4303
|
-
selectedTokenData = response.data.find((
|
|
4510
|
+
selectedTokenData = response.data.find((t6) => t6.symbol === "USDC");
|
|
4304
4511
|
if (selectedTokenData && selectedTokenData.chains.length > 0) {
|
|
4305
4512
|
selectedChainData = selectedTokenData.chains[0];
|
|
4306
4513
|
}
|
|
4307
4514
|
}
|
|
4308
4515
|
if (!selectedTokenData) {
|
|
4309
|
-
selectedTokenData = response.data.find((
|
|
4516
|
+
selectedTokenData = response.data.find((t6) => t6.symbol === "USDT");
|
|
4310
4517
|
if (selectedTokenData && selectedTokenData.chains.length > 0) {
|
|
4311
4518
|
selectedChainData = selectedTokenData.chains[0];
|
|
4312
4519
|
}
|
|
@@ -4342,12 +4549,12 @@ function TransferCryptoSingleInput({
|
|
|
4342
4549
|
destinationChainId,
|
|
4343
4550
|
destinationChainType
|
|
4344
4551
|
]);
|
|
4345
|
-
(0,
|
|
4552
|
+
(0, import_react12.useEffect)(() => {
|
|
4346
4553
|
if (onExecutionsChange) {
|
|
4347
4554
|
onExecutionsChange(depositExecutions);
|
|
4348
4555
|
}
|
|
4349
4556
|
}, [depositExecutions, onExecutionsChange]);
|
|
4350
|
-
(0,
|
|
4557
|
+
(0, import_react12.useEffect)(() => {
|
|
4351
4558
|
if (externalWallets?.length) {
|
|
4352
4559
|
setLoading(false);
|
|
4353
4560
|
return;
|
|
@@ -4362,7 +4569,7 @@ function TransferCryptoSingleInput({
|
|
|
4362
4569
|
if (isCancelled) return;
|
|
4363
4570
|
setLoading(true);
|
|
4364
4571
|
try {
|
|
4365
|
-
const response = await (0,
|
|
4572
|
+
const response = await (0, import_core13.createDepositAddress)(
|
|
4366
4573
|
{
|
|
4367
4574
|
external_user_id: userId,
|
|
4368
4575
|
recipient_address: recipientAddress,
|
|
@@ -4404,9 +4611,9 @@ function TransferCryptoSingleInput({
|
|
|
4404
4611
|
publishableKey,
|
|
4405
4612
|
externalWallets
|
|
4406
4613
|
]);
|
|
4407
|
-
(0,
|
|
4614
|
+
(0, import_react12.useEffect)(() => {
|
|
4408
4615
|
if (!supportedTokens.length) return;
|
|
4409
|
-
const currentToken = supportedTokens.find((
|
|
4616
|
+
const currentToken = supportedTokens.find((t6) => t6.symbol === token);
|
|
4410
4617
|
if (!currentToken || currentToken.chains.length === 0) return;
|
|
4411
4618
|
const isChainAvailable = currentToken.chains.some((c) => {
|
|
4412
4619
|
const key = getChainKey(c.chain_id, c.chain_type);
|
|
@@ -4418,7 +4625,7 @@ function TransferCryptoSingleInput({
|
|
|
4418
4625
|
setChain(newChain);
|
|
4419
4626
|
}
|
|
4420
4627
|
}, [token, supportedTokens, chain]);
|
|
4421
|
-
const selectedToken = supportedTokens.find((
|
|
4628
|
+
const selectedToken = supportedTokens.find((t6) => t6.symbol === token);
|
|
4422
4629
|
const availableChainsForToken = selectedToken?.chains || [];
|
|
4423
4630
|
const currentChainFromBackend = availableChainsForToken.find((c) => {
|
|
4424
4631
|
const key = getChainKey(c.chain_id, c.chain_type);
|
|
@@ -4434,67 +4641,44 @@ function TransferCryptoSingleInput({
|
|
|
4434
4641
|
};
|
|
4435
4642
|
const formatProcessingTime = (seconds) => {
|
|
4436
4643
|
if (seconds === null) {
|
|
4437
|
-
return
|
|
4644
|
+
return t3.processingTime.lessThanMinutes.replace("{{minutes}}", "1");
|
|
4438
4645
|
}
|
|
4439
4646
|
const minutes = Math.ceil(seconds / 60);
|
|
4440
4647
|
if (minutes < 60) {
|
|
4441
|
-
return
|
|
4648
|
+
return t3.processingTime.lessThanMinutes.replace(
|
|
4442
4649
|
"{{minutes}}",
|
|
4443
4650
|
String(minutes)
|
|
4444
4651
|
);
|
|
4445
4652
|
}
|
|
4446
4653
|
const hours = Math.ceil(minutes / 60);
|
|
4447
|
-
return
|
|
4654
|
+
return t3.processingTime.lessThanHours.replace("{{hours}}", String(hours));
|
|
4448
4655
|
};
|
|
4449
4656
|
const priceImpact = currentChainFromBackend?.estimated_price_impact_percent ?? 0;
|
|
4450
4657
|
const maxSlippage = currentChainFromBackend?.max_slippage_percent ?? 0.25;
|
|
4451
4658
|
const processingTime = currentChainFromBackend?.estimated_processing_time ?? null;
|
|
4452
4659
|
const minDepositUsd = currentChainFromBackend?.minimum_deposit_amount_usd ?? 3;
|
|
4453
|
-
return /* @__PURE__ */ (0,
|
|
4660
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TooltipProvider, { delayDuration: 0, skipDelayDuration: 0, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
4454
4661
|
"div",
|
|
4455
4662
|
{
|
|
4456
4663
|
className: "uf-space-y-3 [scrollbar-width:none] [&::-webkit-scrollbar]:uf-hidden",
|
|
4457
4664
|
style: { backgroundColor: colors2.background },
|
|
4458
4665
|
children: [
|
|
4459
|
-
/* @__PURE__ */ (0,
|
|
4460
|
-
|
|
4461
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Tooltip, { children: [
|
|
4462
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4463
|
-
"span",
|
|
4464
|
-
{
|
|
4465
|
-
className: "uf-inline-flex uf-cursor-pointer uf-transition-colors hover:uf-text-foreground",
|
|
4466
|
-
tabIndex: 0,
|
|
4467
|
-
role: "button",
|
|
4468
|
-
"aria-label": "Deposit address information",
|
|
4469
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react12.Info, { className: "uf-w-3 uf-h-3" })
|
|
4470
|
-
}
|
|
4471
|
-
) }),
|
|
4472
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4473
|
-
TooltipContent,
|
|
4474
|
-
{
|
|
4475
|
-
side: "bottom",
|
|
4476
|
-
align: "center",
|
|
4477
|
-
className: "uf-max-w-[240px]",
|
|
4478
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: t2.selectTokenDepositTooltip })
|
|
4479
|
-
}
|
|
4480
|
-
)
|
|
4481
|
-
] })
|
|
4482
|
-
] }) }),
|
|
4483
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4666
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "uf-text-xs uf-text-muted-foreground uf-mb-1 uf-flex uf-items-center uf-justify-between", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "uf-flex uf-items-center uf-gap-1", children: t3.selectTokenDeposit }) }),
|
|
4667
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4484
4668
|
"button",
|
|
4485
4669
|
{
|
|
4486
4670
|
onClick: () => setTokenSelectorOpen(true),
|
|
4487
4671
|
disabled: tokensLoading || supportedTokens.length === 0,
|
|
4488
4672
|
className: "uf-w-full uf-bg-secondary hover:uf-bg-accent uf-rounded-xl uf-p-3 uf-flex uf-items-center uf-gap-3 uf-transition-colors disabled:uf-opacity-50 disabled:uf-cursor-not-allowed",
|
|
4489
|
-
children: tokensLoading ? /* @__PURE__ */ (0,
|
|
4490
|
-
/* @__PURE__ */ (0,
|
|
4491
|
-
/* @__PURE__ */ (0,
|
|
4492
|
-
/* @__PURE__ */ (0,
|
|
4493
|
-
/* @__PURE__ */ (0,
|
|
4673
|
+
children: tokensLoading ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3 uf-animate-pulse", children: [
|
|
4674
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "uf-w-10 uf-h-10 uf-rounded-full uf-bg-muted" }),
|
|
4675
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex-1", children: [
|
|
4676
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "uf-h-4 uf-w-16 uf-bg-muted uf-rounded uf-mb-1" }),
|
|
4677
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "uf-h-3 uf-w-24 uf-bg-muted uf-rounded" })
|
|
4494
4678
|
] })
|
|
4495
|
-
] }) : /* @__PURE__ */ (0,
|
|
4496
|
-
/* @__PURE__ */ (0,
|
|
4497
|
-
selectedToken && /* @__PURE__ */ (0,
|
|
4679
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
|
|
4680
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-relative uf-flex-shrink-0", children: [
|
|
4681
|
+
selectedToken && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4498
4682
|
"img",
|
|
4499
4683
|
{
|
|
4500
4684
|
src: selectedToken.icon_url,
|
|
@@ -4502,7 +4686,7 @@ function TransferCryptoSingleInput({
|
|
|
4502
4686
|
className: "uf-w-10 uf-h-10 uf-rounded-full"
|
|
4503
4687
|
}
|
|
4504
4688
|
),
|
|
4505
|
-
(currentChainFromBackend || currentChainData) && /* @__PURE__ */ (0,
|
|
4689
|
+
(currentChainFromBackend || currentChainData) && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4506
4690
|
"img",
|
|
4507
4691
|
{
|
|
4508
4692
|
src: currentChainFromBackend?.icon_url || currentChainData?.icon_url,
|
|
@@ -4511,12 +4695,12 @@ function TransferCryptoSingleInput({
|
|
|
4511
4695
|
}
|
|
4512
4696
|
)
|
|
4513
4697
|
] }),
|
|
4514
|
-
/* @__PURE__ */ (0,
|
|
4515
|
-
/* @__PURE__ */ (0,
|
|
4516
|
-
/* @__PURE__ */ (0,
|
|
4698
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex-1 uf-text-left uf-min-w-0", children: [
|
|
4699
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "uf-text-sm uf-font-medium uf-text-foreground", children: selectedToken?.symbol || token }),
|
|
4700
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "uf-text-xs uf-text-muted-foreground uf-truncate", children: currentChainFromBackend?.chain_name || currentChainData?.chain_name || "Select network" })
|
|
4517
4701
|
] }),
|
|
4518
|
-
/* @__PURE__ */ (0,
|
|
4519
|
-
/* @__PURE__ */ (0,
|
|
4702
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2 uf-flex-shrink-0", children: [
|
|
4703
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "uf-text-right", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
4520
4704
|
"div",
|
|
4521
4705
|
{
|
|
4522
4706
|
className: `uf-text-xs uf-font-medium ${isDarkMode ? "uf-text-amber-400" : "uf-text-amber-600"}`,
|
|
@@ -4527,12 +4711,12 @@ function TransferCryptoSingleInput({
|
|
|
4527
4711
|
]
|
|
4528
4712
|
}
|
|
4529
4713
|
) }),
|
|
4530
|
-
/* @__PURE__ */ (0,
|
|
4714
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react13.ChevronRight, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground" })
|
|
4531
4715
|
] })
|
|
4532
4716
|
] })
|
|
4533
4717
|
}
|
|
4534
4718
|
),
|
|
4535
|
-
/* @__PURE__ */ (0,
|
|
4719
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4536
4720
|
TokenSelectorSheet,
|
|
4537
4721
|
{
|
|
4538
4722
|
open: tokenSelectorOpen,
|
|
@@ -4546,226 +4730,157 @@ function TransferCryptoSingleInput({
|
|
|
4546
4730
|
}
|
|
4547
4731
|
}
|
|
4548
4732
|
),
|
|
4549
|
-
/* @__PURE__ */ (0,
|
|
4550
|
-
"div",
|
|
4551
|
-
|
|
4552
|
-
className: "uf-flex uf-
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
}
|
|
4556
|
-
) : depositAddress ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4557
|
-
StyledQRCode,
|
|
4558
|
-
{
|
|
4559
|
-
value: depositAddress,
|
|
4560
|
-
size: 180,
|
|
4561
|
-
imageUrl: currentChainData?.icon_url || currentChainFromBackend?.icon_url,
|
|
4562
|
-
imageSize: 45,
|
|
4563
|
-
darkMode: isDarkMode
|
|
4564
|
-
},
|
|
4565
|
-
`qr-${depositAddress}-${chain}`
|
|
4566
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4567
|
-
"div",
|
|
4568
|
-
{
|
|
4569
|
-
className: "uf-flex uf-items-center uf-justify-center",
|
|
4570
|
-
style: { width: 180, height: 180 },
|
|
4571
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "uf-text-red-400 uf-text-sm", children: t2.noAddressAvailable })
|
|
4572
|
-
}
|
|
4573
|
-
) }) }),
|
|
4574
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { children: [
|
|
4575
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "uf-text-xs uf-text-muted-foreground uf-mb-2 uf-flex uf-items-center uf-gap-1", children: [
|
|
4576
|
-
t2.depositAddress.label,
|
|
4577
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Tooltip, { children: [
|
|
4578
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4579
|
-
"span",
|
|
4580
|
-
{
|
|
4581
|
-
className: "uf-inline-flex uf-cursor-pointer uf-transition-colors hover:uf-text-foreground",
|
|
4582
|
-
tabIndex: 0,
|
|
4583
|
-
role: "button",
|
|
4584
|
-
"aria-label": "Deposit address information",
|
|
4585
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react12.Info, { className: "uf-w-3 uf-h-3" })
|
|
4586
|
-
}
|
|
4587
|
-
) }),
|
|
4588
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4589
|
-
TooltipContent,
|
|
4590
|
-
{
|
|
4591
|
-
side: "top",
|
|
4592
|
-
align: "center",
|
|
4593
|
-
className: "uf-max-w-[240px]",
|
|
4594
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: t2.depositAddress.tooltip.replace("{{token}}", token) })
|
|
4595
|
-
}
|
|
4596
|
-
)
|
|
4733
|
+
error && !loading && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-bg-destructive/10 uf-border uf-border-destructive/20 uf-rounded-xl uf-p-3 uf-space-y-2", children: [
|
|
4734
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-items-start uf-gap-2", children: [
|
|
4735
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react13.Info, { className: "uf-w-4 uf-h-4 uf-text-destructive uf-flex-shrink-0 uf-mt-0.5" }),
|
|
4736
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex-1 uf-min-w-0", children: [
|
|
4737
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "uf-text-xs uf-font-medium uf-text-destructive uf-mb-1", children: "Failed to create deposit address" }),
|
|
4738
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "uf-text-xs uf-text-muted-foreground", children: error })
|
|
4597
4739
|
] })
|
|
4598
4740
|
] }),
|
|
4599
|
-
|
|
4600
|
-
"
|
|
4741
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-1.5 uf-text-xs uf-text-muted-foreground uf-pl-6", children: [
|
|
4742
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react13.Clock, { className: "uf-w-3 uf-h-3" }),
|
|
4743
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { children: "Retrying automatically every 5 seconds..." })
|
|
4744
|
+
] })
|
|
4745
|
+
] }),
|
|
4746
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-flex-col uf-items-center uf-pt-2", children: [
|
|
4747
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "uf-text-xs uf-text-muted-foreground uf-mb-2 uf-flex uf-items-center uf-gap-1", children: "Intent address" }),
|
|
4748
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "uf-rounded-2xl uf-shadow-lg uf-border uf-border-border", children: loading ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4749
|
+
"div",
|
|
4750
|
+
{
|
|
4751
|
+
className: "uf-flex uf-items-center uf-justify-center",
|
|
4752
|
+
style: { width: 180, height: 180 },
|
|
4753
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "uf-text-foreground uf-text-sm", children: t3.loadingQRCode })
|
|
4754
|
+
}
|
|
4755
|
+
) : depositAddress ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4756
|
+
StyledQRCode,
|
|
4757
|
+
{
|
|
4758
|
+
value: depositAddress,
|
|
4759
|
+
size: 180,
|
|
4760
|
+
imageUrl: currentChainData?.icon_url || currentChainFromBackend?.icon_url,
|
|
4761
|
+
imageSize: 45,
|
|
4762
|
+
darkMode: isDarkMode
|
|
4763
|
+
},
|
|
4764
|
+
`qr-${depositAddress}-${chain}`
|
|
4765
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4766
|
+
"div",
|
|
4767
|
+
{
|
|
4768
|
+
className: "uf-flex uf-items-center uf-justify-center",
|
|
4769
|
+
style: { width: 180, height: 180 },
|
|
4770
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "uf-text-red-400 uf-text-sm", children: t3.noAddressAvailable })
|
|
4771
|
+
}
|
|
4772
|
+
) })
|
|
4773
|
+
] }),
|
|
4774
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-text-sm uf-text-muted-foreground uf-mb-2 uf-flex uf-justify-center uf-items-center uf-gap-1", children: [
|
|
4775
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-sm uf-truncate uf-min-w-0", children: loading ? t3.loading : depositAddress ? truncateAddress(depositAddress, 8, 6) : t3.noAddressAvailable }),
|
|
4776
|
+
depositAddress && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4777
|
+
"span",
|
|
4601
4778
|
{
|
|
4602
4779
|
onClick: handleCopyAddress,
|
|
4603
|
-
|
|
4604
|
-
|
|
4605
|
-
children: [
|
|
4606
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "uf-text-xs uf-font-mono uf-truncate uf-min-w-0", children: depositAddress ? truncateAddress(depositAddress, 18, 12) : t2.noAddressAvailable }),
|
|
4607
|
-
depositAddress && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4608
|
-
"span",
|
|
4609
|
-
{
|
|
4610
|
-
className: `uf-flex-shrink-0 uf-transition-colors ${copied ? "uf-text-green-500" : "uf-text-muted-foreground"}`,
|
|
4611
|
-
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react12.Check, { className: "uf-w-3.5 uf-h-3.5" }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react12.Copy, { className: "uf-w-3.5 uf-h-3.5" })
|
|
4612
|
-
}
|
|
4613
|
-
)
|
|
4614
|
-
]
|
|
4780
|
+
className: `uf-flex-shrink-0 uf-transition-colors uf-cursor-pointer ${copied ? "uf-text-green-500" : "uf-text-muted-foreground"}`,
|
|
4781
|
+
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react13.Check, { className: "uf-w-3.5 uf-h-3.5" }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react13.Copy, { className: "uf-w-3.5 uf-h-3.5" })
|
|
4615
4782
|
}
|
|
4616
4783
|
)
|
|
4617
|
-
] }),
|
|
4618
|
-
/* @__PURE__ */ (0,
|
|
4619
|
-
/* @__PURE__ */ (0,
|
|
4784
|
+
] }) }),
|
|
4785
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-bg-secondary uf-rounded-xl uf-px-2.5", children: [
|
|
4786
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
4620
4787
|
"button",
|
|
4621
4788
|
{
|
|
4622
4789
|
onClick: () => setDetailsExpanded(!detailsExpanded),
|
|
4623
4790
|
className: "uf-w-full uf-flex uf-items-center uf-justify-between uf-py-2.5",
|
|
4624
4791
|
children: [
|
|
4625
|
-
/* @__PURE__ */ (0,
|
|
4626
|
-
/* @__PURE__ */ (0,
|
|
4627
|
-
/* @__PURE__ */ (0,
|
|
4628
|
-
|
|
4792
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
4793
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "uf-bg-card uf-rounded-full uf-p-1", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react13.Clock, { className: "uf-w-3 uf-h-3" }) }),
|
|
4794
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "uf-text-xs", children: [
|
|
4795
|
+
t3.processingTime.label,
|
|
4629
4796
|
":",
|
|
4630
4797
|
" ",
|
|
4631
|
-
/* @__PURE__ */ (0,
|
|
4632
|
-
priceImpact.toFixed(2),
|
|
4633
|
-
"%"
|
|
4634
|
-
] })
|
|
4635
|
-
] }),
|
|
4636
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Tooltip, { children: [
|
|
4637
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4638
|
-
"span",
|
|
4639
|
-
{
|
|
4640
|
-
className: "uf-inline-flex uf-cursor-pointer uf-text-muted-foreground uf-transition-colors hover:uf-text-foreground",
|
|
4641
|
-
onClick: (e) => e.stopPropagation(),
|
|
4642
|
-
onKeyDown: (e) => {
|
|
4643
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
4644
|
-
e.stopPropagation();
|
|
4645
|
-
}
|
|
4646
|
-
},
|
|
4647
|
-
tabIndex: 0,
|
|
4648
|
-
role: "button",
|
|
4649
|
-
"aria-label": "Price impact information",
|
|
4650
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react12.Info, { className: "uf-w-3 uf-h-3" })
|
|
4651
|
-
}
|
|
4652
|
-
) }),
|
|
4653
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4654
|
-
TooltipContent,
|
|
4655
|
-
{
|
|
4656
|
-
side: "top",
|
|
4657
|
-
align: "center",
|
|
4658
|
-
className: "uf-max-w-[240px]",
|
|
4659
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: t2.priceImpact.tooltip })
|
|
4660
|
-
}
|
|
4661
|
-
)
|
|
4798
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-foreground", children: formatProcessingTime(processingTime) })
|
|
4662
4799
|
] })
|
|
4663
4800
|
] }),
|
|
4664
|
-
detailsExpanded ? /* @__PURE__ */ (0,
|
|
4801
|
+
detailsExpanded ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react13.ChevronUp, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground" }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react13.ChevronDown, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground" })
|
|
4665
4802
|
]
|
|
4666
4803
|
}
|
|
4667
4804
|
),
|
|
4668
|
-
detailsExpanded && /* @__PURE__ */ (0,
|
|
4669
|
-
/* @__PURE__ */ (0,
|
|
4670
|
-
/* @__PURE__ */ (0,
|
|
4671
|
-
/* @__PURE__ */ (0,
|
|
4672
|
-
|
|
4805
|
+
detailsExpanded && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-pb-3 uf-space-y-2.5", children: [
|
|
4806
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
4807
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "uf-bg-card uf-rounded-full uf-p-1", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react13.ShieldCheck, { className: "uf-w-3 uf-h-3" }) }),
|
|
4808
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "uf-text-xs", children: [
|
|
4809
|
+
t3.slippage.label,
|
|
4673
4810
|
":",
|
|
4674
4811
|
" ",
|
|
4675
|
-
/* @__PURE__ */ (0,
|
|
4676
|
-
|
|
4812
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "uf-text-foreground", children: [
|
|
4813
|
+
t3.slippage.auto,
|
|
4677
4814
|
" \u2022 ",
|
|
4678
4815
|
maxSlippage.toFixed(2),
|
|
4679
4816
|
"%"
|
|
4680
4817
|
] })
|
|
4681
|
-
] }),
|
|
4682
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Tooltip, { children: [
|
|
4683
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4684
|
-
"span",
|
|
4685
|
-
{
|
|
4686
|
-
className: "uf-inline-flex uf-cursor-pointer uf-text-muted-foreground uf-transition-colors hover:uf-text-foreground",
|
|
4687
|
-
tabIndex: 0,
|
|
4688
|
-
role: "button",
|
|
4689
|
-
"aria-label": "Slippage information",
|
|
4690
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react12.Info, { className: "uf-w-3 uf-h-3" })
|
|
4691
|
-
}
|
|
4692
|
-
) }),
|
|
4693
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4694
|
-
TooltipContent,
|
|
4695
|
-
{
|
|
4696
|
-
side: "top",
|
|
4697
|
-
align: "center",
|
|
4698
|
-
className: "uf-max-w-[240px]",
|
|
4699
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: t2.slippage.tooltip })
|
|
4700
|
-
}
|
|
4701
|
-
)
|
|
4702
4818
|
] })
|
|
4703
4819
|
] }),
|
|
4704
|
-
/* @__PURE__ */ (0,
|
|
4705
|
-
/* @__PURE__ */ (0,
|
|
4706
|
-
/* @__PURE__ */ (0,
|
|
4707
|
-
|
|
4820
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
4821
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "uf-bg-card uf-rounded-full uf-p-1", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react13.DollarSign, { className: "uf-w-3 uf-h-3" }) }),
|
|
4822
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "uf-text-xs", children: [
|
|
4823
|
+
t3.priceImpact.label,
|
|
4708
4824
|
":",
|
|
4709
4825
|
" ",
|
|
4710
|
-
/* @__PURE__ */ (0,
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "uf-bg-card uf-rounded-full uf-p-1", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react12.HelpCircle, { className: "uf-w-3 uf-h-3" }) }),
|
|
4715
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: "uf-text-xs", children: [
|
|
4716
|
-
t2.help.needHelp,
|
|
4717
|
-
" ",
|
|
4718
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4719
|
-
"a",
|
|
4720
|
-
{
|
|
4721
|
-
href: "#",
|
|
4722
|
-
className: "uf-text-foreground uf-underline hover:uf-text-muted-foreground uf-transition-colors",
|
|
4723
|
-
children: t2.help.contactSupport
|
|
4724
|
-
}
|
|
4725
|
-
)
|
|
4826
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "uf-text-foreground", children: [
|
|
4827
|
+
priceImpact.toFixed(2),
|
|
4828
|
+
"%"
|
|
4829
|
+
] })
|
|
4726
4830
|
] })
|
|
4727
4831
|
] }),
|
|
4728
|
-
/* @__PURE__ */ (0,
|
|
4729
|
-
/* @__PURE__ */ (0,
|
|
4730
|
-
/* @__PURE__ */ (0,
|
|
4731
|
-
|
|
4732
|
-
":",
|
|
4832
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
4833
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "uf-bg-card uf-rounded-full uf-p-1", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react13.Wallet2, { className: "uf-w-3 uf-h-3" }) }),
|
|
4834
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "uf-flex uf-gap-2 uf-text-xs", children: [
|
|
4835
|
+
"Recipient address:",
|
|
4733
4836
|
" ",
|
|
4734
|
-
/* @__PURE__ */ (0,
|
|
4735
|
-
|
|
4837
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-foreground", children: truncateAddress(recipientAddress || "", 8, 6) }),
|
|
4838
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4839
|
+
"span",
|
|
4736
4840
|
{
|
|
4737
|
-
|
|
4738
|
-
className:
|
|
4739
|
-
|
|
4740
|
-
children: t2.terms.seeTerms
|
|
4841
|
+
onClick: () => handleCopyRecipientAddress(recipientAddress),
|
|
4842
|
+
className: `uf-flex-shrink-0 uf-transition-colors uf-cursor-pointer ${copiedRecipient ? "uf-text-green-500" : "uf-text-muted-foreground"}`,
|
|
4843
|
+
children: copiedRecipient ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react13.Check, { className: "uf-w-3.5 uf-h-3.5" }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react13.Copy, { className: "uf-w-3.5 uf-h-3.5" })
|
|
4741
4844
|
}
|
|
4742
4845
|
)
|
|
4743
4846
|
] })
|
|
4744
4847
|
] })
|
|
4745
4848
|
] })
|
|
4746
4849
|
] }),
|
|
4747
|
-
|
|
4850
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4851
|
+
PollCooldownButton,
|
|
4852
|
+
{
|
|
4853
|
+
currentWalletId: currentWallet?.id,
|
|
4854
|
+
pollCooldown,
|
|
4855
|
+
publishableKey,
|
|
4856
|
+
onCooldownChange: setPollCooldown,
|
|
4857
|
+
cooldownRef,
|
|
4858
|
+
buttonText: "Try again"
|
|
4859
|
+
}
|
|
4860
|
+
),
|
|
4861
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DepositFooterLinks, { onGlossaryClick: () => setGlossaryOpen(true) }),
|
|
4862
|
+
depositExecutions.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "uf-flex uf-items-center uf-justify-end uf-text-xs uf-pt-2", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
4748
4863
|
"button",
|
|
4749
4864
|
{
|
|
4750
4865
|
onClick: () => setDepositsModalOpen(true),
|
|
4751
4866
|
className: "uf-flex uf-items-center uf-gap-1 uf-text-muted-foreground hover:uf-text-foreground uf-transition-colors uf-animate-in uf-fade-in uf-slide-in-from-right-8 uf-duration-1000",
|
|
4752
4867
|
children: [
|
|
4753
|
-
/* @__PURE__ */ (0,
|
|
4868
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react13.Clock, { className: "uf-w-3.5 uf-h-3.5" }),
|
|
4754
4869
|
"Track deposits (",
|
|
4755
4870
|
depositExecutions.length,
|
|
4756
4871
|
")",
|
|
4757
|
-
/* @__PURE__ */ (0,
|
|
4872
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react13.ChevronRight, { className: "uf-w-3 uf-h-3" })
|
|
4758
4873
|
]
|
|
4759
4874
|
}
|
|
4760
4875
|
) }),
|
|
4761
|
-
/* @__PURE__ */ (0,
|
|
4876
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4762
4877
|
DepositPollingToasts,
|
|
4763
4878
|
{
|
|
4764
4879
|
executions: depositExecutions,
|
|
4765
4880
|
isPolling
|
|
4766
4881
|
}
|
|
4767
4882
|
),
|
|
4768
|
-
/* @__PURE__ */ (0,
|
|
4883
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4769
4884
|
DepositsModal,
|
|
4770
4885
|
{
|
|
4771
4886
|
open: depositsModalOpen,
|
|
@@ -4775,6 +4890,15 @@ function TransferCryptoSingleInput({
|
|
|
4775
4890
|
publishableKey,
|
|
4776
4891
|
themeClass
|
|
4777
4892
|
}
|
|
4893
|
+
),
|
|
4894
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4895
|
+
GlossaryModal,
|
|
4896
|
+
{
|
|
4897
|
+
open: glossaryOpen,
|
|
4898
|
+
onOpenChange: setGlossaryOpen,
|
|
4899
|
+
themeClass,
|
|
4900
|
+
colors: colors2
|
|
4901
|
+
}
|
|
4778
4902
|
)
|
|
4779
4903
|
]
|
|
4780
4904
|
}
|
|
@@ -4782,18 +4906,18 @@ function TransferCryptoSingleInput({
|
|
|
4782
4906
|
}
|
|
4783
4907
|
|
|
4784
4908
|
// src/components/deposits/TransferCryptoDoubleInput.tsx
|
|
4785
|
-
var
|
|
4786
|
-
var
|
|
4909
|
+
var import_react13 = require("react");
|
|
4910
|
+
var import_lucide_react15 = require("lucide-react");
|
|
4787
4911
|
|
|
4788
4912
|
// src/components/shared/select.tsx
|
|
4789
4913
|
var React9 = __toESM(require("react"));
|
|
4790
4914
|
var SelectPrimitive = __toESM(require("@radix-ui/react-select"));
|
|
4791
|
-
var
|
|
4792
|
-
var
|
|
4915
|
+
var import_lucide_react14 = require("lucide-react");
|
|
4916
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
4793
4917
|
var Select = SelectPrimitive.Root;
|
|
4794
4918
|
var SelectGroup = SelectPrimitive.Group;
|
|
4795
4919
|
var SelectValue = SelectPrimitive.Value;
|
|
4796
|
-
var SelectTrigger = React9.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
4920
|
+
var SelectTrigger = React9.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
4797
4921
|
SelectPrimitive.Trigger,
|
|
4798
4922
|
{
|
|
4799
4923
|
ref,
|
|
@@ -4804,12 +4928,12 @@ var SelectTrigger = React9.forwardRef(({ className, children, ...props }, ref) =
|
|
|
4804
4928
|
...props,
|
|
4805
4929
|
children: [
|
|
4806
4930
|
children,
|
|
4807
|
-
/* @__PURE__ */ (0,
|
|
4931
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react14.ChevronDown, { className: "uf-h-4 uf-w-4 uf-opacity-50" }) })
|
|
4808
4932
|
]
|
|
4809
4933
|
}
|
|
4810
4934
|
));
|
|
4811
4935
|
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
4812
|
-
var SelectScrollUpButton = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
4936
|
+
var SelectScrollUpButton = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4813
4937
|
SelectPrimitive.ScrollUpButton,
|
|
4814
4938
|
{
|
|
4815
4939
|
ref,
|
|
@@ -4818,11 +4942,11 @@ var SelectScrollUpButton = React9.forwardRef(({ className, ...props }, ref) => /
|
|
|
4818
4942
|
className
|
|
4819
4943
|
),
|
|
4820
4944
|
...props,
|
|
4821
|
-
children: /* @__PURE__ */ (0,
|
|
4945
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react14.ChevronUp, { className: "uf-h-4 uf-w-4" })
|
|
4822
4946
|
}
|
|
4823
4947
|
));
|
|
4824
4948
|
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
4825
|
-
var SelectScrollDownButton = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
4949
|
+
var SelectScrollDownButton = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4826
4950
|
SelectPrimitive.ScrollDownButton,
|
|
4827
4951
|
{
|
|
4828
4952
|
ref,
|
|
@@ -4831,13 +4955,13 @@ var SelectScrollDownButton = React9.forwardRef(({ className, ...props }, ref) =>
|
|
|
4831
4955
|
className
|
|
4832
4956
|
),
|
|
4833
4957
|
...props,
|
|
4834
|
-
children: /* @__PURE__ */ (0,
|
|
4958
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react14.ChevronDown, { className: "uf-h-4 uf-w-4" })
|
|
4835
4959
|
}
|
|
4836
4960
|
));
|
|
4837
4961
|
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
4838
4962
|
var SelectContent = React9.forwardRef(({ className, children, position = "popper", ...props }, ref) => {
|
|
4839
4963
|
const { themeClass, colors: colors2 } = useTheme();
|
|
4840
|
-
return /* @__PURE__ */ (0,
|
|
4964
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
4841
4965
|
SelectPrimitive.Content,
|
|
4842
4966
|
{
|
|
4843
4967
|
ref,
|
|
@@ -4851,8 +4975,8 @@ var SelectContent = React9.forwardRef(({ className, children, position = "popper
|
|
|
4851
4975
|
position,
|
|
4852
4976
|
...props,
|
|
4853
4977
|
children: [
|
|
4854
|
-
/* @__PURE__ */ (0,
|
|
4855
|
-
/* @__PURE__ */ (0,
|
|
4978
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectScrollUpButton, {}),
|
|
4979
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4856
4980
|
SelectPrimitive.Viewport,
|
|
4857
4981
|
{
|
|
4858
4982
|
className: cn(
|
|
@@ -4862,13 +4986,13 @@ var SelectContent = React9.forwardRef(({ className, children, position = "popper
|
|
|
4862
4986
|
children
|
|
4863
4987
|
}
|
|
4864
4988
|
),
|
|
4865
|
-
/* @__PURE__ */ (0,
|
|
4989
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectScrollDownButton, {})
|
|
4866
4990
|
]
|
|
4867
4991
|
}
|
|
4868
4992
|
) });
|
|
4869
4993
|
});
|
|
4870
4994
|
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
4871
|
-
var SelectLabel = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
4995
|
+
var SelectLabel = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4872
4996
|
SelectPrimitive.Label,
|
|
4873
4997
|
{
|
|
4874
4998
|
ref,
|
|
@@ -4880,7 +5004,7 @@ var SelectLabel = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
4880
5004
|
}
|
|
4881
5005
|
));
|
|
4882
5006
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
4883
|
-
var SelectItem = React9.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
5007
|
+
var SelectItem = React9.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
4884
5008
|
SelectPrimitive.Item,
|
|
4885
5009
|
{
|
|
4886
5010
|
ref,
|
|
@@ -4890,13 +5014,13 @@ var SelectItem = React9.forwardRef(({ className, children, ...props }, ref) => /
|
|
|
4890
5014
|
),
|
|
4891
5015
|
...props,
|
|
4892
5016
|
children: [
|
|
4893
|
-
/* @__PURE__ */ (0,
|
|
4894
|
-
/* @__PURE__ */ (0,
|
|
5017
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "uf-absolute uf-left-2 uf-flex uf-h-3.5 uf-w-3.5 uf-items-center uf-justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react14.Check, { className: "uf-h-4 uf-w-4" }) }) }),
|
|
5018
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectPrimitive.ItemText, { children })
|
|
4895
5019
|
]
|
|
4896
5020
|
}
|
|
4897
5021
|
));
|
|
4898
5022
|
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
4899
|
-
var SelectSeparator = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
5023
|
+
var SelectSeparator = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4900
5024
|
SelectPrimitive.Separator,
|
|
4901
5025
|
{
|
|
4902
5026
|
ref,
|
|
@@ -4907,9 +5031,9 @@ var SelectSeparator = React9.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
4907
5031
|
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
4908
5032
|
|
|
4909
5033
|
// src/components/deposits/TransferCryptoDoubleInput.tsx
|
|
4910
|
-
var
|
|
4911
|
-
var
|
|
4912
|
-
var
|
|
5034
|
+
var import_core14 = require("@unifold/core");
|
|
5035
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
5036
|
+
var t4 = i18n.transferCrypto;
|
|
4913
5037
|
var getChainKey2 = (chainId, chainType) => {
|
|
4914
5038
|
return `${chainType}:${chainId}`;
|
|
4915
5039
|
};
|
|
@@ -4931,13 +5055,25 @@ function TransferCryptoDoubleInput({
|
|
|
4931
5055
|
}) {
|
|
4932
5056
|
const { themeClass, colors: colors2, fonts, components } = useTheme();
|
|
4933
5057
|
const isDarkMode = themeClass.includes("uf-dark");
|
|
4934
|
-
const [token, setToken] = (0,
|
|
4935
|
-
const [chain, setChain] = (0,
|
|
4936
|
-
const [copied, setCopied] = (0,
|
|
4937
|
-
const
|
|
4938
|
-
const [
|
|
5058
|
+
const [token, setToken] = (0, import_react13.useState)("USDC");
|
|
5059
|
+
const [chain, setChain] = (0, import_react13.useState)("solana:mainnet");
|
|
5060
|
+
const [copied, setCopied] = (0, import_react13.useState)(false);
|
|
5061
|
+
const { copied: copiedRecipient, handleCopy: handleCopyRecipientAddress } = useCopyAddress();
|
|
5062
|
+
const [glossaryOpen, setGlossaryOpen] = (0, import_react13.useState)(false);
|
|
5063
|
+
const [pollCooldown, setPollCooldown] = (0, import_react13.useState)(0);
|
|
5064
|
+
const cooldownRef = (0, import_react13.useRef)(null);
|
|
5065
|
+
const [internalWallets, setInternalWallets] = (0, import_react13.useState)([]);
|
|
5066
|
+
const [loading, setLoading] = (0, import_react13.useState)(!externalWallets?.length);
|
|
5067
|
+
(0, import_react13.useEffect)(() => {
|
|
5068
|
+
return () => {
|
|
5069
|
+
if (cooldownRef.current) {
|
|
5070
|
+
clearInterval(cooldownRef.current);
|
|
5071
|
+
cooldownRef.current = null;
|
|
5072
|
+
}
|
|
5073
|
+
};
|
|
5074
|
+
}, []);
|
|
4939
5075
|
const wallets = externalWallets?.length ? externalWallets : internalWallets;
|
|
4940
|
-
const [error, setError] = (0,
|
|
5076
|
+
const [error, setError] = (0, import_react13.useState)(null);
|
|
4941
5077
|
const { executions: depositExecutions, isPolling } = useDepositPolling({
|
|
4942
5078
|
userId,
|
|
4943
5079
|
publishableKey,
|
|
@@ -4945,13 +5081,13 @@ function TransferCryptoDoubleInput({
|
|
|
4945
5081
|
onDepositSuccess,
|
|
4946
5082
|
onDepositError
|
|
4947
5083
|
});
|
|
4948
|
-
const [supportedTokens, setSupportedTokens] = (0,
|
|
4949
|
-
const [tokensLoading, setTokensLoading] = (0,
|
|
4950
|
-
const [detailsExpanded, setDetailsExpanded] = (0,
|
|
4951
|
-
const [depositsModalOpen, setDepositsModalOpen] = (0,
|
|
5084
|
+
const [supportedTokens, setSupportedTokens] = (0, import_react13.useState)([]);
|
|
5085
|
+
const [tokensLoading, setTokensLoading] = (0, import_react13.useState)(true);
|
|
5086
|
+
const [detailsExpanded, setDetailsExpanded] = (0, import_react13.useState)(false);
|
|
5087
|
+
const [depositsModalOpen, setDepositsModalOpen] = (0, import_react13.useState)(false);
|
|
4952
5088
|
const allChainsMap = /* @__PURE__ */ new Map();
|
|
4953
|
-
supportedTokens.forEach((
|
|
4954
|
-
|
|
5089
|
+
supportedTokens.forEach((t6) => {
|
|
5090
|
+
t6.chains.forEach((c) => {
|
|
4955
5091
|
const comboKey = `${c.chain_type}:${c.chain_id}`;
|
|
4956
5092
|
if (!allChainsMap.has(comboKey)) {
|
|
4957
5093
|
allChainsMap.set(comboKey, c);
|
|
@@ -4964,9 +5100,9 @@ function TransferCryptoDoubleInput({
|
|
|
4964
5100
|
(c) => c.chain_type === currentChainCombo.chainType && c.chain_id === currentChainCombo.chainId
|
|
4965
5101
|
);
|
|
4966
5102
|
const currentChainType = currentChainData?.chain_type || "ethereum";
|
|
4967
|
-
const currentWallet = (0,
|
|
5103
|
+
const currentWallet = (0, import_core14.getWalletByChainType)(wallets, currentChainType);
|
|
4968
5104
|
const depositAddress = currentWallet?.address || "";
|
|
4969
|
-
(0,
|
|
5105
|
+
(0, import_react13.useEffect)(() => {
|
|
4970
5106
|
async function fetchSupportedTokens() {
|
|
4971
5107
|
try {
|
|
4972
5108
|
setTokensLoading(true);
|
|
@@ -4975,15 +5111,15 @@ function TransferCryptoDoubleInput({
|
|
|
4975
5111
|
destination_chain_id: destinationChainId,
|
|
4976
5112
|
destination_chain_type: destinationChainType
|
|
4977
5113
|
} : void 0;
|
|
4978
|
-
const response = await (0,
|
|
5114
|
+
const response = await (0, import_core14.getSupportedDepositTokens)(
|
|
4979
5115
|
publishableKey,
|
|
4980
5116
|
options
|
|
4981
5117
|
);
|
|
4982
5118
|
setSupportedTokens(response.data);
|
|
4983
5119
|
if (response.data.length > 0) {
|
|
4984
5120
|
const allChains = /* @__PURE__ */ new Set();
|
|
4985
|
-
response.data.forEach((
|
|
4986
|
-
|
|
5121
|
+
response.data.forEach((t6) => {
|
|
5122
|
+
t6.chains.forEach((c) => {
|
|
4987
5123
|
allChains.add(getChainKey2(c.chain_id, c.chain_type));
|
|
4988
5124
|
});
|
|
4989
5125
|
});
|
|
@@ -5009,12 +5145,12 @@ function TransferCryptoDoubleInput({
|
|
|
5009
5145
|
destinationChainId,
|
|
5010
5146
|
destinationChainType
|
|
5011
5147
|
]);
|
|
5012
|
-
(0,
|
|
5148
|
+
(0, import_react13.useEffect)(() => {
|
|
5013
5149
|
if (onExecutionsChange) {
|
|
5014
5150
|
onExecutionsChange(depositExecutions);
|
|
5015
5151
|
}
|
|
5016
5152
|
}, [depositExecutions, onExecutionsChange]);
|
|
5017
|
-
(0,
|
|
5153
|
+
(0, import_react13.useEffect)(() => {
|
|
5018
5154
|
if (externalWallets?.length) {
|
|
5019
5155
|
setLoading(false);
|
|
5020
5156
|
return;
|
|
@@ -5029,7 +5165,7 @@ function TransferCryptoDoubleInput({
|
|
|
5029
5165
|
if (isCancelled) return;
|
|
5030
5166
|
setLoading(true);
|
|
5031
5167
|
try {
|
|
5032
|
-
const response = await (0,
|
|
5168
|
+
const response = await (0, import_core14.createDepositAddress)(
|
|
5033
5169
|
{
|
|
5034
5170
|
external_user_id: userId,
|
|
5035
5171
|
recipient_address: recipientAddress,
|
|
@@ -5071,9 +5207,9 @@ function TransferCryptoDoubleInput({
|
|
|
5071
5207
|
publishableKey,
|
|
5072
5208
|
externalWallets
|
|
5073
5209
|
]);
|
|
5074
|
-
(0,
|
|
5210
|
+
(0, import_react13.useEffect)(() => {
|
|
5075
5211
|
if (!supportedTokens.length) return;
|
|
5076
|
-
const currentToken = supportedTokens.find((
|
|
5212
|
+
const currentToken = supportedTokens.find((t6) => t6.symbol === token);
|
|
5077
5213
|
if (!currentToken || currentToken.chains.length === 0) return;
|
|
5078
5214
|
const isChainAvailable = currentToken.chains.some((c) => {
|
|
5079
5215
|
const key = getChainKey2(c.chain_id, c.chain_type);
|
|
@@ -5085,7 +5221,7 @@ function TransferCryptoDoubleInput({
|
|
|
5085
5221
|
setChain(newChain);
|
|
5086
5222
|
}
|
|
5087
5223
|
}, [token, supportedTokens, chain]);
|
|
5088
|
-
const selectedToken = supportedTokens.find((
|
|
5224
|
+
const selectedToken = supportedTokens.find((t6) => t6.symbol === token);
|
|
5089
5225
|
const availableChainsForToken = selectedToken?.chains || [];
|
|
5090
5226
|
const currentChainFromBackend = availableChainsForToken.find((c) => {
|
|
5091
5227
|
const key = getChainKey2(c.chain_id, c.chain_type);
|
|
@@ -5101,25 +5237,25 @@ function TransferCryptoDoubleInput({
|
|
|
5101
5237
|
};
|
|
5102
5238
|
const formatProcessingTime = (seconds) => {
|
|
5103
5239
|
if (seconds === null) {
|
|
5104
|
-
return
|
|
5240
|
+
return t4.processingTime.lessThanMinutes.replace("{{minutes}}", "1");
|
|
5105
5241
|
}
|
|
5106
5242
|
const minutes = Math.ceil(seconds / 60);
|
|
5107
5243
|
if (minutes < 60) {
|
|
5108
|
-
return
|
|
5244
|
+
return t4.processingTime.lessThanMinutes.replace(
|
|
5109
5245
|
"{{minutes}}",
|
|
5110
5246
|
String(minutes)
|
|
5111
5247
|
);
|
|
5112
5248
|
}
|
|
5113
5249
|
const hours = Math.ceil(minutes / 60);
|
|
5114
|
-
return
|
|
5250
|
+
return t4.processingTime.lessThanHours.replace("{{hours}}", String(hours));
|
|
5115
5251
|
};
|
|
5116
5252
|
const priceImpact = currentChainFromBackend?.estimated_price_impact_percent ?? 0;
|
|
5117
5253
|
const maxSlippage = currentChainFromBackend?.max_slippage_percent ?? 0.25;
|
|
5118
5254
|
const processingTime = currentChainFromBackend?.estimated_processing_time ?? null;
|
|
5119
5255
|
const minDepositUsd = currentChainFromBackend?.minimum_deposit_amount_usd ?? 3;
|
|
5120
5256
|
const renderTokenItem = (tokenData) => {
|
|
5121
|
-
return /* @__PURE__ */ (0,
|
|
5122
|
-
/* @__PURE__ */ (0,
|
|
5257
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
5258
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
5123
5259
|
"img",
|
|
5124
5260
|
{
|
|
5125
5261
|
src: tokenData.icon_url,
|
|
@@ -5129,13 +5265,13 @@ function TransferCryptoDoubleInput({
|
|
|
5129
5265
|
className: "uf-rounded-full uf-flex-shrink-0"
|
|
5130
5266
|
}
|
|
5131
5267
|
),
|
|
5132
|
-
/* @__PURE__ */ (0,
|
|
5268
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "uf-text-xs uf-font-normal", children: tokenData.symbol })
|
|
5133
5269
|
] });
|
|
5134
5270
|
};
|
|
5135
5271
|
const renderChainItem = (chainData, showMinDeposit = false) => {
|
|
5136
|
-
return /* @__PURE__ */ (0,
|
|
5137
|
-
/* @__PURE__ */ (0,
|
|
5138
|
-
/* @__PURE__ */ (0,
|
|
5272
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "uf-flex uf-items-center uf-justify-between uf-w-full", children: [
|
|
5273
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
5274
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
5139
5275
|
"img",
|
|
5140
5276
|
{
|
|
5141
5277
|
src: chainData.icon_url,
|
|
@@ -5145,32 +5281,32 @@ function TransferCryptoDoubleInput({
|
|
|
5145
5281
|
className: "uf-rounded-full uf-flex-shrink-0"
|
|
5146
5282
|
}
|
|
5147
5283
|
),
|
|
5148
|
-
/* @__PURE__ */ (0,
|
|
5284
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "uf-text-xs uf-font-normal", children: chainData.chain_name })
|
|
5149
5285
|
] }),
|
|
5150
|
-
showMinDeposit && chainData.minimum_deposit_amount_usd && /* @__PURE__ */ (0,
|
|
5286
|
+
showMinDeposit && chainData.minimum_deposit_amount_usd && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: "uf-text-xs uf-text-amber-400 uf-font-medium", children: [
|
|
5151
5287
|
"$",
|
|
5152
5288
|
chainData.minimum_deposit_amount_usd
|
|
5153
5289
|
] })
|
|
5154
5290
|
] });
|
|
5155
5291
|
};
|
|
5156
|
-
return /* @__PURE__ */ (0,
|
|
5292
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TooltipProvider, { delayDuration: 0, skipDelayDuration: 0, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
5157
5293
|
"div",
|
|
5158
5294
|
{
|
|
5159
5295
|
className: "uf-space-y-3",
|
|
5160
5296
|
style: { backgroundColor: colors2.background },
|
|
5161
5297
|
children: [
|
|
5162
|
-
/* @__PURE__ */ (0,
|
|
5163
|
-
/* @__PURE__ */ (0,
|
|
5164
|
-
/* @__PURE__ */ (0,
|
|
5165
|
-
/* @__PURE__ */ (0,
|
|
5298
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "uf-grid uf-grid-cols-2 uf-gap-2.5", children: [
|
|
5299
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { children: [
|
|
5300
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "uf-text-xs uf-text-muted-foreground uf-mb-2 uf-flex uf-items-center uf-gap-1", children: t4.selectedToken }),
|
|
5301
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
5166
5302
|
Select,
|
|
5167
5303
|
{
|
|
5168
5304
|
value: token,
|
|
5169
5305
|
onValueChange: setToken,
|
|
5170
5306
|
disabled: tokensLoading || supportedTokens.length === 0,
|
|
5171
5307
|
children: [
|
|
5172
|
-
/* @__PURE__ */ (0,
|
|
5173
|
-
/* @__PURE__ */ (0,
|
|
5308
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(SelectTrigger, { className: "uf-bg-secondary uf-border-none uf-rounded-lg uf-h-10 hover:uf-bg-accent uf-text-foreground focus:uf-ring-1 focus:uf-ring-ring disabled:uf-opacity-50", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(SelectValue, { children: tokensLoading ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "uf-text-xs uf-font-light uf-text-muted-foreground", children: t4.loading }) }) : selectedToken ? renderTokenItem(selectedToken) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "uf-text-xs uf-font-normal", children: token }) }) }) }),
|
|
5309
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(SelectContent, { className: "uf-bg-secondary uf-border uf-text-foreground uf-max-h-[300px]", children: supportedTokens.map((tokenData) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
5174
5310
|
SelectItem,
|
|
5175
5311
|
{
|
|
5176
5312
|
value: tokenData.symbol,
|
|
@@ -5183,56 +5319,35 @@ function TransferCryptoDoubleInput({
|
|
|
5183
5319
|
}
|
|
5184
5320
|
)
|
|
5185
5321
|
] }),
|
|
5186
|
-
/* @__PURE__ */ (0,
|
|
5187
|
-
/* @__PURE__ */ (0,
|
|
5188
|
-
|
|
5189
|
-
/* @__PURE__ */ (0,
|
|
5322
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { children: [
|
|
5323
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "uf-text-xs uf-text-muted-foreground uf-mb-2 uf-flex uf-items-center uf-gap-1", children: [
|
|
5324
|
+
t4.selectedChain,
|
|
5325
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: "uf-text-amber-400 uf-font-medium", children: [
|
|
5190
5326
|
"$",
|
|
5191
5327
|
minDepositUsd,
|
|
5192
5328
|
" ",
|
|
5193
|
-
|
|
5194
|
-
] }),
|
|
5195
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Tooltip, { children: [
|
|
5196
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
5197
|
-
"span",
|
|
5198
|
-
{
|
|
5199
|
-
className: "uf-inline-flex uf-cursor-pointer uf-transition-colors hover:uf-text-foreground",
|
|
5200
|
-
tabIndex: 0,
|
|
5201
|
-
role: "button",
|
|
5202
|
-
"aria-label": "Minimum deposit information",
|
|
5203
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react14.Info, { className: "uf-w-4 uf-h-4" })
|
|
5204
|
-
}
|
|
5205
|
-
) }),
|
|
5206
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
5207
|
-
TooltipContent,
|
|
5208
|
-
{
|
|
5209
|
-
side: "left",
|
|
5210
|
-
align: "center",
|
|
5211
|
-
className: "uf-max-w-[200px]",
|
|
5212
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { children: t3.minDeposit.tooltip })
|
|
5213
|
-
}
|
|
5214
|
-
)
|
|
5329
|
+
t4.minDeposit.label
|
|
5215
5330
|
] })
|
|
5216
5331
|
] }),
|
|
5217
|
-
/* @__PURE__ */ (0,
|
|
5332
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
5218
5333
|
Select,
|
|
5219
5334
|
{
|
|
5220
5335
|
value: chain,
|
|
5221
5336
|
onValueChange: setChain,
|
|
5222
5337
|
disabled: tokensLoading || availableChainsForToken.length === 0,
|
|
5223
5338
|
children: [
|
|
5224
|
-
/* @__PURE__ */ (0,
|
|
5225
|
-
/* @__PURE__ */ (0,
|
|
5339
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(SelectTrigger, { className: "uf-bg-secondary uf-border-none uf-rounded-lg uf-h-10 hover:uf-bg-accent uf-text-foreground focus:uf-ring-1 focus:uf-ring-ring disabled:uf-opacity-50", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(SelectValue, { children: tokensLoading ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "uf-text-xs uf-font-light uf-text-muted-foreground", children: t4.loading }) }) : currentChainFromBackend ? renderChainItem(currentChainFromBackend) : currentChainData ? renderChainItem(currentChainData) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "uf-text-xs uf-font-normal", children: chain }) }) }) }),
|
|
5340
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
5226
5341
|
SelectContent,
|
|
5227
5342
|
{
|
|
5228
5343
|
align: "end",
|
|
5229
5344
|
className: "uf-bg-secondary uf-border uf-text-foreground uf-max-h-[300px] uf-min-w-[200px]",
|
|
5230
|
-
children: availableChainsForToken.length === 0 ? /* @__PURE__ */ (0,
|
|
5345
|
+
children: availableChainsForToken.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "uf-px-2 uf-py-3 uf-text-xs uf-text-muted-foreground uf-text-center", children: t4.noChainsAvailable }) : availableChainsForToken.map((chainData) => {
|
|
5231
5346
|
const chainKey = getChainKey2(
|
|
5232
5347
|
chainData.chain_id,
|
|
5233
5348
|
chainData.chain_type
|
|
5234
5349
|
);
|
|
5235
|
-
return /* @__PURE__ */ (0,
|
|
5350
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
5236
5351
|
SelectItem,
|
|
5237
5352
|
{
|
|
5238
5353
|
value: chainKey,
|
|
@@ -5249,226 +5364,157 @@ function TransferCryptoDoubleInput({
|
|
|
5249
5364
|
)
|
|
5250
5365
|
] })
|
|
5251
5366
|
] }),
|
|
5252
|
-
/* @__PURE__ */ (0,
|
|
5253
|
-
"div",
|
|
5254
|
-
|
|
5255
|
-
className: "uf-flex uf-
|
|
5256
|
-
|
|
5257
|
-
|
|
5258
|
-
}
|
|
5259
|
-
) : depositAddress ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
5260
|
-
StyledQRCode,
|
|
5261
|
-
{
|
|
5262
|
-
value: depositAddress,
|
|
5263
|
-
size: 180,
|
|
5264
|
-
imageUrl: currentChainData?.icon_url || currentChainFromBackend?.icon_url,
|
|
5265
|
-
imageSize: 45,
|
|
5266
|
-
darkMode: isDarkMode
|
|
5267
|
-
},
|
|
5268
|
-
`qr-${depositAddress}-${chain}`
|
|
5269
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
5270
|
-
"div",
|
|
5271
|
-
{
|
|
5272
|
-
className: "uf-flex uf-items-center uf-justify-center",
|
|
5273
|
-
style: { width: 180, height: 180 },
|
|
5274
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "uf-text-red-400 uf-text-sm", children: t3.noAddressAvailable })
|
|
5275
|
-
}
|
|
5276
|
-
) }) }),
|
|
5277
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { children: [
|
|
5278
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "uf-text-xs uf-text-muted-foreground uf-mb-2 uf-flex uf-items-center uf-gap-1", children: [
|
|
5279
|
-
t3.depositAddress.label,
|
|
5280
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Tooltip, { children: [
|
|
5281
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
5282
|
-
"span",
|
|
5283
|
-
{
|
|
5284
|
-
className: "uf-inline-flex uf-cursor-pointer uf-transition-colors hover:uf-text-foreground",
|
|
5285
|
-
tabIndex: 0,
|
|
5286
|
-
role: "button",
|
|
5287
|
-
"aria-label": "Deposit address information",
|
|
5288
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react14.Info, { className: "uf-w-3 uf-h-3" })
|
|
5289
|
-
}
|
|
5290
|
-
) }),
|
|
5291
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
5292
|
-
TooltipContent,
|
|
5293
|
-
{
|
|
5294
|
-
side: "top",
|
|
5295
|
-
align: "center",
|
|
5296
|
-
className: "uf-max-w-[240px]",
|
|
5297
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { children: t3.depositAddress.tooltip.replace("{{token}}", token) })
|
|
5298
|
-
}
|
|
5299
|
-
)
|
|
5367
|
+
error && !loading && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "uf-bg-destructive/10 uf-border uf-border-destructive/20 uf-rounded-xl uf-p-3 uf-space-y-2", children: [
|
|
5368
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "uf-flex uf-items-start uf-gap-2", children: [
|
|
5369
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react15.Info, { className: "uf-w-4 uf-h-4 uf-text-destructive uf-flex-shrink-0 uf-mt-0.5" }),
|
|
5370
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "uf-flex-1 uf-min-w-0", children: [
|
|
5371
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "uf-text-xs uf-font-medium uf-text-destructive uf-mb-1", children: "Failed to create deposit address" }),
|
|
5372
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "uf-text-xs uf-text-muted-foreground", children: error })
|
|
5300
5373
|
] })
|
|
5301
5374
|
] }),
|
|
5302
|
-
|
|
5303
|
-
"
|
|
5375
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-1.5 uf-text-xs uf-text-muted-foreground uf-pl-6", children: [
|
|
5376
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react15.Clock, { className: "uf-w-3 uf-h-3" }),
|
|
5377
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { children: "Retrying automatically every 5 seconds..." })
|
|
5378
|
+
] })
|
|
5379
|
+
] }),
|
|
5380
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "uf-flex uf-flex-col uf-items-center uf-pt-2", children: [
|
|
5381
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "uf-text-xs uf-text-muted-foreground uf-mb-2 uf-flex uf-items-center uf-gap-1", children: "Intent address" }),
|
|
5382
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "uf-rounded-2xl uf-shadow-lg uf-border uf-border-border", children: loading ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
5383
|
+
"div",
|
|
5384
|
+
{
|
|
5385
|
+
className: "uf-flex uf-items-center uf-justify-center",
|
|
5386
|
+
style: { width: 180, height: 180 },
|
|
5387
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "uf-text-foreground uf-text-sm", children: t4.loadingQRCode })
|
|
5388
|
+
}
|
|
5389
|
+
) : depositAddress ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
5390
|
+
StyledQRCode,
|
|
5391
|
+
{
|
|
5392
|
+
value: depositAddress,
|
|
5393
|
+
size: 180,
|
|
5394
|
+
imageUrl: currentChainData?.icon_url || currentChainFromBackend?.icon_url,
|
|
5395
|
+
imageSize: 45,
|
|
5396
|
+
darkMode: isDarkMode
|
|
5397
|
+
},
|
|
5398
|
+
`qr-${depositAddress}-${chain}`
|
|
5399
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
5400
|
+
"div",
|
|
5401
|
+
{
|
|
5402
|
+
className: "uf-flex uf-items-center uf-justify-center",
|
|
5403
|
+
style: { width: 180, height: 180 },
|
|
5404
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "uf-text-red-400 uf-text-sm", children: t4.noAddressAvailable })
|
|
5405
|
+
}
|
|
5406
|
+
) })
|
|
5407
|
+
] }),
|
|
5408
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "uf-text-sm uf-text-muted-foreground uf-mb-2 uf-flex uf-justify-center uf-items-center uf-gap-1", children: [
|
|
5409
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "uf-text-sm uf-truncate uf-min-w-0", children: loading ? t4.loading : depositAddress ? truncateAddress(depositAddress, 8, 6) : t4.noAddressAvailable }),
|
|
5410
|
+
depositAddress && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
5411
|
+
"span",
|
|
5304
5412
|
{
|
|
5305
5413
|
onClick: handleCopyAddress,
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
children: [
|
|
5309
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "uf-text-xs uf-font-mono uf-truncate uf-min-w-0", children: depositAddress ? truncateAddress(depositAddress, 18, 12) : t3.noAddressAvailable }),
|
|
5310
|
-
depositAddress && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
5311
|
-
"span",
|
|
5312
|
-
{
|
|
5313
|
-
className: `uf-flex-shrink-0 uf-transition-colors ${copied ? "uf-text-green-500" : "uf-text-muted-foreground"}`,
|
|
5314
|
-
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react14.Check, { className: "uf-w-3.5 uf-h-3.5" }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react14.Copy, { className: "uf-w-3.5 uf-h-3.5" })
|
|
5315
|
-
}
|
|
5316
|
-
)
|
|
5317
|
-
]
|
|
5414
|
+
className: `uf-flex-shrink-0 uf-transition-colors uf-cursor-pointer ${copied ? "uf-text-green-500" : "uf-text-muted-foreground"}`,
|
|
5415
|
+
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react15.Check, { className: "uf-w-3.5 uf-h-3.5" }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react15.Copy, { className: "uf-w-3.5 uf-h-3.5" })
|
|
5318
5416
|
}
|
|
5319
5417
|
)
|
|
5320
|
-
] }),
|
|
5321
|
-
/* @__PURE__ */ (0,
|
|
5322
|
-
/* @__PURE__ */ (0,
|
|
5418
|
+
] }) }),
|
|
5419
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "uf-bg-secondary uf-rounded-xl uf-px-2.5", children: [
|
|
5420
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
5323
5421
|
"button",
|
|
5324
5422
|
{
|
|
5325
5423
|
onClick: () => setDetailsExpanded(!detailsExpanded),
|
|
5326
5424
|
className: "uf-w-full uf-flex uf-items-center uf-justify-between uf-py-2.5",
|
|
5327
5425
|
children: [
|
|
5328
|
-
/* @__PURE__ */ (0,
|
|
5329
|
-
/* @__PURE__ */ (0,
|
|
5330
|
-
/* @__PURE__ */ (0,
|
|
5331
|
-
|
|
5426
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
5427
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "uf-bg-card uf-rounded-full uf-p-1", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react15.Clock, { className: "uf-w-3 uf-h-3" }) }),
|
|
5428
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: "uf-text-xs", children: [
|
|
5429
|
+
t4.processingTime.label,
|
|
5332
5430
|
":",
|
|
5333
5431
|
" ",
|
|
5334
|
-
/* @__PURE__ */ (0,
|
|
5335
|
-
priceImpact.toFixed(2),
|
|
5336
|
-
"%"
|
|
5337
|
-
] })
|
|
5338
|
-
] }),
|
|
5339
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Tooltip, { children: [
|
|
5340
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
5341
|
-
"span",
|
|
5342
|
-
{
|
|
5343
|
-
className: "uf-inline-flex uf-cursor-pointer uf-text-muted-foreground uf-transition-colors hover:uf-text-foreground",
|
|
5344
|
-
onClick: (e) => e.stopPropagation(),
|
|
5345
|
-
onKeyDown: (e) => {
|
|
5346
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
5347
|
-
e.stopPropagation();
|
|
5348
|
-
}
|
|
5349
|
-
},
|
|
5350
|
-
tabIndex: 0,
|
|
5351
|
-
role: "button",
|
|
5352
|
-
"aria-label": "Price impact information",
|
|
5353
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react14.Info, { className: "uf-w-3 uf-h-3" })
|
|
5354
|
-
}
|
|
5355
|
-
) }),
|
|
5356
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
5357
|
-
TooltipContent,
|
|
5358
|
-
{
|
|
5359
|
-
side: "top",
|
|
5360
|
-
align: "center",
|
|
5361
|
-
className: "uf-max-w-[240px]",
|
|
5362
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { children: t3.priceImpact.tooltip })
|
|
5363
|
-
}
|
|
5364
|
-
)
|
|
5432
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "uf-text-foreground", children: formatProcessingTime(processingTime) })
|
|
5365
5433
|
] })
|
|
5366
5434
|
] }),
|
|
5367
|
-
detailsExpanded ? /* @__PURE__ */ (0,
|
|
5435
|
+
detailsExpanded ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react15.ChevronUp, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground" }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react15.ChevronDown, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground" })
|
|
5368
5436
|
]
|
|
5369
5437
|
}
|
|
5370
5438
|
),
|
|
5371
|
-
detailsExpanded && /* @__PURE__ */ (0,
|
|
5372
|
-
/* @__PURE__ */ (0,
|
|
5373
|
-
/* @__PURE__ */ (0,
|
|
5374
|
-
/* @__PURE__ */ (0,
|
|
5375
|
-
|
|
5439
|
+
detailsExpanded && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "uf-pb-3 uf-space-y-2.5", children: [
|
|
5440
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
5441
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "uf-bg-card uf-rounded-full uf-p-1", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react15.ShieldCheck, { className: "uf-w-3 uf-h-3" }) }),
|
|
5442
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: "uf-text-xs", children: [
|
|
5443
|
+
t4.slippage.label,
|
|
5376
5444
|
":",
|
|
5377
5445
|
" ",
|
|
5378
|
-
/* @__PURE__ */ (0,
|
|
5379
|
-
|
|
5446
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: "uf-text-foreground", children: [
|
|
5447
|
+
t4.slippage.auto,
|
|
5380
5448
|
" \u2022 ",
|
|
5381
5449
|
maxSlippage.toFixed(2),
|
|
5382
5450
|
"%"
|
|
5383
5451
|
] })
|
|
5384
|
-
] }),
|
|
5385
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Tooltip, { children: [
|
|
5386
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
5387
|
-
"span",
|
|
5388
|
-
{
|
|
5389
|
-
className: "uf-inline-flex uf-cursor-pointer uf-text-muted-foreground uf-transition-colors hover:uf-text-foreground",
|
|
5390
|
-
tabIndex: 0,
|
|
5391
|
-
role: "button",
|
|
5392
|
-
"aria-label": "Slippage information",
|
|
5393
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react14.Info, { className: "uf-w-3 uf-h-3" })
|
|
5394
|
-
}
|
|
5395
|
-
) }),
|
|
5396
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
5397
|
-
TooltipContent,
|
|
5398
|
-
{
|
|
5399
|
-
side: "top",
|
|
5400
|
-
align: "center",
|
|
5401
|
-
className: "uf-max-w-[240px]",
|
|
5402
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { children: t3.slippage.tooltip })
|
|
5403
|
-
}
|
|
5404
|
-
)
|
|
5405
5452
|
] })
|
|
5406
5453
|
] }),
|
|
5407
|
-
/* @__PURE__ */ (0,
|
|
5408
|
-
/* @__PURE__ */ (0,
|
|
5409
|
-
/* @__PURE__ */ (0,
|
|
5410
|
-
|
|
5454
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
5455
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "uf-bg-card uf-rounded-full uf-p-1", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react15.DollarSign, { className: "uf-w-3 uf-h-3" }) }),
|
|
5456
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: "uf-text-xs", children: [
|
|
5457
|
+
t4.priceImpact.label,
|
|
5411
5458
|
":",
|
|
5412
5459
|
" ",
|
|
5413
|
-
/* @__PURE__ */ (0,
|
|
5414
|
-
|
|
5415
|
-
|
|
5416
|
-
|
|
5417
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "uf-bg-card uf-rounded-full uf-p-1", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react14.HelpCircle, { className: "uf-w-3 uf-h-3" }) }),
|
|
5418
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { className: "uf-text-xs", children: [
|
|
5419
|
-
t3.help.needHelp,
|
|
5420
|
-
" ",
|
|
5421
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
5422
|
-
"a",
|
|
5423
|
-
{
|
|
5424
|
-
href: "https://unifold.io/support",
|
|
5425
|
-
className: "uf-text-foreground uf-underline hover:uf-text-muted-foreground uf-transition-colors",
|
|
5426
|
-
children: t3.help.contactSupport
|
|
5427
|
-
}
|
|
5428
|
-
)
|
|
5460
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: "uf-text-foreground", children: [
|
|
5461
|
+
priceImpact.toFixed(2),
|
|
5462
|
+
"%"
|
|
5463
|
+
] })
|
|
5429
5464
|
] })
|
|
5430
5465
|
] }),
|
|
5431
|
-
/* @__PURE__ */ (0,
|
|
5432
|
-
/* @__PURE__ */ (0,
|
|
5433
|
-
/* @__PURE__ */ (0,
|
|
5434
|
-
|
|
5435
|
-
":",
|
|
5466
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
5467
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "uf-bg-card uf-rounded-full uf-p-1", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react15.Wallet2, { className: "uf-w-3 uf-h-3" }) }),
|
|
5468
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: "uf-flex uf-gap-2 uf-text-xs", children: [
|
|
5469
|
+
"Recipient address:",
|
|
5436
5470
|
" ",
|
|
5437
|
-
/* @__PURE__ */ (0,
|
|
5438
|
-
|
|
5471
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "uf-text-foreground", children: truncateAddress(recipientAddress || "", 8, 6) }),
|
|
5472
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
5473
|
+
"span",
|
|
5439
5474
|
{
|
|
5440
|
-
|
|
5441
|
-
className:
|
|
5442
|
-
|
|
5443
|
-
children: t3.terms.seeTerms
|
|
5475
|
+
onClick: () => handleCopyRecipientAddress(recipientAddress),
|
|
5476
|
+
className: `uf-flex-shrink-0 uf-transition-colors uf-cursor-pointer ${copiedRecipient ? "uf-text-green-500" : "uf-text-muted-foreground"}`,
|
|
5477
|
+
children: copiedRecipient ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react15.Check, { className: "uf-w-3.5 uf-h-3.5" }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react15.Copy, { className: "uf-w-3.5 uf-h-3.5" })
|
|
5444
5478
|
}
|
|
5445
5479
|
)
|
|
5446
5480
|
] })
|
|
5447
5481
|
] })
|
|
5448
5482
|
] })
|
|
5449
5483
|
] }),
|
|
5450
|
-
|
|
5484
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
5485
|
+
PollCooldownButton,
|
|
5486
|
+
{
|
|
5487
|
+
currentWalletId: currentWallet?.id,
|
|
5488
|
+
pollCooldown,
|
|
5489
|
+
publishableKey,
|
|
5490
|
+
onCooldownChange: setPollCooldown,
|
|
5491
|
+
cooldownRef,
|
|
5492
|
+
buttonText: "Check again"
|
|
5493
|
+
}
|
|
5494
|
+
),
|
|
5495
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DepositFooterLinks, { onGlossaryClick: () => setGlossaryOpen(true) }),
|
|
5496
|
+
depositExecutions.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "uf-flex uf-items-center uf-justify-end uf-text-xs uf-pt-2", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
5451
5497
|
"button",
|
|
5452
5498
|
{
|
|
5453
5499
|
onClick: () => setDepositsModalOpen(true),
|
|
5454
5500
|
className: "uf-flex uf-items-center uf-gap-1 uf-text-muted-foreground hover:uf-text-foreground uf-transition-colors uf-animate-in uf-fade-in uf-slide-in-from-right-8 uf-duration-1000",
|
|
5455
5501
|
children: [
|
|
5456
|
-
/* @__PURE__ */ (0,
|
|
5502
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react15.Clock, { className: "uf-w-3.5 uf-h-3.5" }),
|
|
5457
5503
|
"Track deposits (",
|
|
5458
5504
|
depositExecutions.length,
|
|
5459
5505
|
")",
|
|
5460
|
-
/* @__PURE__ */ (0,
|
|
5506
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react15.ChevronRight, { className: "uf-w-3 uf-h-3" })
|
|
5461
5507
|
]
|
|
5462
5508
|
}
|
|
5463
5509
|
) }),
|
|
5464
|
-
/* @__PURE__ */ (0,
|
|
5510
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
5465
5511
|
DepositPollingToasts,
|
|
5466
5512
|
{
|
|
5467
5513
|
executions: depositExecutions,
|
|
5468
5514
|
isPolling
|
|
5469
5515
|
}
|
|
5470
5516
|
),
|
|
5471
|
-
/* @__PURE__ */ (0,
|
|
5517
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
5472
5518
|
DepositsModal,
|
|
5473
5519
|
{
|
|
5474
5520
|
open: depositsModalOpen,
|
|
@@ -5478,6 +5524,15 @@ function TransferCryptoDoubleInput({
|
|
|
5478
5524
|
publishableKey,
|
|
5479
5525
|
themeClass
|
|
5480
5526
|
}
|
|
5527
|
+
),
|
|
5528
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
5529
|
+
GlossaryModal,
|
|
5530
|
+
{
|
|
5531
|
+
open: glossaryOpen,
|
|
5532
|
+
onOpenChange: setGlossaryOpen,
|
|
5533
|
+
themeClass,
|
|
5534
|
+
colors: colors2
|
|
5535
|
+
}
|
|
5481
5536
|
)
|
|
5482
5537
|
]
|
|
5483
5538
|
}
|
|
@@ -5485,31 +5540,31 @@ function TransferCryptoDoubleInput({
|
|
|
5485
5540
|
}
|
|
5486
5541
|
|
|
5487
5542
|
// src/components/deposits/DepositModal.tsx
|
|
5488
|
-
var
|
|
5543
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
5489
5544
|
function SkeletonButton({
|
|
5490
5545
|
variant = "default"
|
|
5491
5546
|
}) {
|
|
5492
|
-
return /* @__PURE__ */ (0,
|
|
5493
|
-
/* @__PURE__ */ (0,
|
|
5494
|
-
/* @__PURE__ */ (0,
|
|
5495
|
-
/* @__PURE__ */ (0,
|
|
5496
|
-
/* @__PURE__ */ (0,
|
|
5497
|
-
/* @__PURE__ */ (0,
|
|
5547
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "uf-w-full uf-bg-secondary uf-rounded-xl uf-p-3 uf-flex uf-items-center uf-justify-between uf-animate-pulse", children: [
|
|
5548
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
5549
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "uf-bg-muted uf-rounded-lg uf-w-9 uf-h-9" }),
|
|
5550
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "uf-space-y-1.5", children: [
|
|
5551
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "uf-h-3.5 uf-w-24 uf-bg-muted uf-rounded" }),
|
|
5552
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "uf-h-3 uf-w-32 uf-bg-muted uf-rounded" })
|
|
5498
5553
|
] })
|
|
5499
5554
|
] }),
|
|
5500
|
-
/* @__PURE__ */ (0,
|
|
5501
|
-
variant === "with-icons" && /* @__PURE__ */ (0,
|
|
5555
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
5556
|
+
variant === "with-icons" && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "uf-flex uf--space-x-1", children: [1, 2, 3].map((i) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
5502
5557
|
"div",
|
|
5503
5558
|
{
|
|
5504
5559
|
className: "uf-w-5 uf-h-5 uf-rounded-full uf-bg-muted uf-border-2 uf-border-secondary"
|
|
5505
5560
|
},
|
|
5506
5561
|
i
|
|
5507
5562
|
)) }),
|
|
5508
|
-
/* @__PURE__ */ (0,
|
|
5563
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react16.ChevronRight, { className: "uf-w-4 uf-h-4 uf-text-muted" })
|
|
5509
5564
|
] })
|
|
5510
5565
|
] });
|
|
5511
5566
|
}
|
|
5512
|
-
var
|
|
5567
|
+
var t5 = i18n.depositModal;
|
|
5513
5568
|
function DepositModal({
|
|
5514
5569
|
open,
|
|
5515
5570
|
onOpenChange,
|
|
@@ -5529,20 +5584,20 @@ function DepositModal({
|
|
|
5529
5584
|
theme = "dark"
|
|
5530
5585
|
}) {
|
|
5531
5586
|
const { colors: colors2, fonts } = useTheme();
|
|
5532
|
-
const [view, setView] = (0,
|
|
5533
|
-
const [cardView, setCardView] = (0,
|
|
5587
|
+
const [view, setView] = (0, import_react14.useState)("main");
|
|
5588
|
+
const [cardView, setCardView] = (0, import_react14.useState)(
|
|
5534
5589
|
"amount"
|
|
5535
5590
|
);
|
|
5536
|
-
const [quotesCount, setQuotesCount] = (0,
|
|
5537
|
-
const [depositsModalOpen, setDepositsModalOpen] = (0,
|
|
5538
|
-
const [depositExecutions, setDepositExecutions] = (0,
|
|
5539
|
-
const [projectConfig, setProjectConfig] = (0,
|
|
5540
|
-
const [wallets, setWallets] = (0,
|
|
5541
|
-
const [walletsLoading, setWalletsLoading] = (0,
|
|
5542
|
-
(0,
|
|
5591
|
+
const [quotesCount, setQuotesCount] = (0, import_react14.useState)(0);
|
|
5592
|
+
const [depositsModalOpen, setDepositsModalOpen] = (0, import_react14.useState)(false);
|
|
5593
|
+
const [depositExecutions, setDepositExecutions] = (0, import_react14.useState)([]);
|
|
5594
|
+
const [projectConfig, setProjectConfig] = (0, import_react14.useState)(null);
|
|
5595
|
+
const [wallets, setWallets] = (0, import_react14.useState)([]);
|
|
5596
|
+
const [walletsLoading, setWalletsLoading] = (0, import_react14.useState)(false);
|
|
5597
|
+
(0, import_react14.useEffect)(() => {
|
|
5543
5598
|
setProjectConfig(null);
|
|
5544
5599
|
}, [publishableKey]);
|
|
5545
|
-
(0,
|
|
5600
|
+
(0, import_react14.useEffect)(() => {
|
|
5546
5601
|
setWallets([]);
|
|
5547
5602
|
}, [
|
|
5548
5603
|
userId,
|
|
@@ -5552,10 +5607,10 @@ function DepositModal({
|
|
|
5552
5607
|
destinationTokenAddress,
|
|
5553
5608
|
publishableKey
|
|
5554
5609
|
]);
|
|
5555
|
-
const [resolvedTheme, setResolvedTheme] = (0,
|
|
5610
|
+
const [resolvedTheme, setResolvedTheme] = (0, import_react14.useState)(
|
|
5556
5611
|
theme === "auto" ? "dark" : theme
|
|
5557
5612
|
);
|
|
5558
|
-
(0,
|
|
5613
|
+
(0, import_react14.useEffect)(() => {
|
|
5559
5614
|
if (theme === "auto") {
|
|
5560
5615
|
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
5561
5616
|
setResolvedTheme(mediaQuery.matches ? "dark" : "light");
|
|
@@ -5568,9 +5623,9 @@ function DepositModal({
|
|
|
5568
5623
|
setResolvedTheme(theme);
|
|
5569
5624
|
}
|
|
5570
5625
|
}, [theme]);
|
|
5571
|
-
(0,
|
|
5626
|
+
(0, import_react14.useEffect)(() => {
|
|
5572
5627
|
if (open && !projectConfig) {
|
|
5573
|
-
(0,
|
|
5628
|
+
(0, import_core15.getProjectConfig)(publishableKey).then(setProjectConfig).catch(console.error);
|
|
5574
5629
|
}
|
|
5575
5630
|
}, [open, publishableKey, projectConfig]);
|
|
5576
5631
|
const {
|
|
@@ -5600,7 +5655,7 @@ function DepositModal({
|
|
|
5600
5655
|
const template = errors[code] ?? addressValidationMessages.defaultError;
|
|
5601
5656
|
return interpolate(template, metadata);
|
|
5602
5657
|
};
|
|
5603
|
-
(0,
|
|
5658
|
+
(0, import_react14.useEffect)(() => {
|
|
5604
5659
|
if (!open || wallets.length > 0) return;
|
|
5605
5660
|
let retryTimeout = null;
|
|
5606
5661
|
let isCancelled = false;
|
|
@@ -5608,7 +5663,7 @@ function DepositModal({
|
|
|
5608
5663
|
if (isCancelled) return;
|
|
5609
5664
|
setWalletsLoading(true);
|
|
5610
5665
|
try {
|
|
5611
|
-
const response = await (0,
|
|
5666
|
+
const response = await (0, import_core15.createDepositAddress)(
|
|
5612
5667
|
{
|
|
5613
5668
|
external_user_id: userId,
|
|
5614
5669
|
recipient_address: recipientAddress,
|
|
@@ -5671,16 +5726,16 @@ function DepositModal({
|
|
|
5671
5726
|
setQuotesCount(count);
|
|
5672
5727
|
}
|
|
5673
5728
|
};
|
|
5674
|
-
return /* @__PURE__ */ (0,
|
|
5675
|
-
/* @__PURE__ */ (0,
|
|
5729
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Dialog, { open, onOpenChange: handleClose, children: [
|
|
5730
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
5676
5731
|
DialogContent,
|
|
5677
5732
|
{
|
|
5678
5733
|
className: `sm:uf-max-w-[400px] uf-border-secondary uf-text-foreground uf-p-0 uf-gap-0 uf-overflow-visible [&>button]:uf-hidden ${view === "main" ? "!uf-top-auto !uf-h-auto !uf-max-h-[60vh] sm:!uf-max-h-none sm:!uf-top-[50%]" : "!uf-top-0 !uf-h-full sm:!uf-h-auto sm:!uf-top-[50%]"} ${themeClass}`,
|
|
5679
5734
|
style: { backgroundColor: colors2.background },
|
|
5680
5735
|
onPointerDownOutside: (e) => e.preventDefault(),
|
|
5681
5736
|
onInteractOutside: (e) => e.preventDefault(),
|
|
5682
|
-
children: /* @__PURE__ */ (0,
|
|
5683
|
-
/* @__PURE__ */ (0,
|
|
5737
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ThemeStyleInjector, { children: view === "main" ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
5738
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
5684
5739
|
DepositHeader,
|
|
5685
5740
|
{
|
|
5686
5741
|
title: modalTitle || "Deposit",
|
|
@@ -5693,56 +5748,56 @@ function DepositModal({
|
|
|
5693
5748
|
publishableKey
|
|
5694
5749
|
}
|
|
5695
5750
|
),
|
|
5696
|
-
/* @__PURE__ */ (0,
|
|
5697
|
-
/* @__PURE__ */ (0,
|
|
5698
|
-
/* @__PURE__ */ (0,
|
|
5699
|
-
!hideDepositTracker && /* @__PURE__ */ (0,
|
|
5751
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "uf-pb-4 uf-space-y-3", children: isCountryLoading || isAddressValidationLoading || !projectConfig ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
5752
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SkeletonButton, { variant: "with-icons" }),
|
|
5753
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SkeletonButton, { variant: "with-icons" }),
|
|
5754
|
+
!hideDepositTracker && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SkeletonButton, {})
|
|
5700
5755
|
] }) : countryError ? (
|
|
5701
5756
|
/* Error state - couldn't verify location */
|
|
5702
|
-
/* @__PURE__ */ (0,
|
|
5703
|
-
/* @__PURE__ */ (0,
|
|
5704
|
-
/* @__PURE__ */ (0,
|
|
5705
|
-
/* @__PURE__ */ (0,
|
|
5757
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "uf-flex uf-flex-col uf-items-center uf-justify-center uf-py-8 uf-px-4 uf-text-center", children: [
|
|
5758
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "uf-w-16 uf-h-16 uf-rounded-full uf-bg-muted uf-flex uf-items-center uf-justify-center uf-mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react16.AlertTriangle, { className: "uf-w-8 uf-h-8 uf-text-muted-foreground" }) }),
|
|
5759
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("h3", { className: "uf-text-lg uf-font-semibold uf-text-foreground uf-mb-2", children: "Unable to Verify Location" }),
|
|
5760
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "uf-text-sm uf-text-muted-foreground uf-max-w-[280px]", children: "We couldn't verify your location. Please check your connection and try again." })
|
|
5706
5761
|
] })
|
|
5707
5762
|
) : !isAllowed ? (
|
|
5708
5763
|
/* Blocked country state (isAllowed is false or null without error) */
|
|
5709
|
-
/* @__PURE__ */ (0,
|
|
5710
|
-
/* @__PURE__ */ (0,
|
|
5711
|
-
/* @__PURE__ */ (0,
|
|
5712
|
-
/* @__PURE__ */ (0,
|
|
5764
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "uf-flex uf-flex-col uf-items-center uf-justify-center uf-py-8 uf-px-4 uf-text-center", children: [
|
|
5765
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "uf-w-16 uf-h-16 uf-rounded-full uf-bg-muted uf-flex uf-items-center uf-justify-center uf-mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react16.MapPinOff, { className: "uf-w-8 uf-h-8 uf-text-muted-foreground" }) }),
|
|
5766
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("h3", { className: "uf-text-lg uf-font-semibold uf-text-foreground uf-mb-2", children: "No Tokens Available" }),
|
|
5767
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "uf-text-sm uf-text-muted-foreground uf-max-w-[280px]", children: "There are no supported tokens available from your current location." })
|
|
5713
5768
|
] })
|
|
5714
5769
|
) : isAddressValid === false ? (
|
|
5715
5770
|
/* Invalid recipient address state (e.g., Algorand not opted in) */
|
|
5716
|
-
/* @__PURE__ */ (0,
|
|
5717
|
-
/* @__PURE__ */ (0,
|
|
5718
|
-
/* @__PURE__ */ (0,
|
|
5719
|
-
/* @__PURE__ */ (0,
|
|
5771
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "uf-flex uf-flex-col uf-items-center uf-justify-center uf-py-8 uf-px-4 uf-text-center", children: [
|
|
5772
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "uf-w-16 uf-h-16 uf-rounded-full uf-bg-muted uf-flex uf-items-center uf-justify-center uf-mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react16.AlertTriangle, { className: "uf-w-8 uf-h-8 uf-text-muted-foreground" }) }),
|
|
5773
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("h3", { className: "uf-text-lg uf-font-semibold uf-text-foreground uf-mb-2", children: addressValidationMessages.unableToReceiveFunds }),
|
|
5774
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "uf-text-sm uf-text-muted-foreground uf-max-w-[280px]", children: getAddressValidationErrorMessage(
|
|
5720
5775
|
addressFailureCode,
|
|
5721
5776
|
addressFailureMetadata
|
|
5722
5777
|
) })
|
|
5723
5778
|
] })
|
|
5724
5779
|
) : (
|
|
5725
5780
|
/* Normal deposit options */
|
|
5726
|
-
/* @__PURE__ */ (0,
|
|
5727
|
-
/* @__PURE__ */ (0,
|
|
5781
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
5782
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
5728
5783
|
TransferCryptoButton,
|
|
5729
5784
|
{
|
|
5730
5785
|
onClick: () => setView("transfer"),
|
|
5731
|
-
title:
|
|
5732
|
-
subtitle:
|
|
5786
|
+
title: t5.transferCrypto.title,
|
|
5787
|
+
subtitle: t5.transferCrypto.subtitle,
|
|
5733
5788
|
featuredTokens: projectConfig.transfer_crypto.networks
|
|
5734
5789
|
}
|
|
5735
5790
|
),
|
|
5736
|
-
/* @__PURE__ */ (0,
|
|
5791
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
5737
5792
|
DepositWithCardButton,
|
|
5738
5793
|
{
|
|
5739
5794
|
onClick: () => setView("card"),
|
|
5740
|
-
title:
|
|
5741
|
-
subtitle:
|
|
5795
|
+
title: t5.depositWithCard.title,
|
|
5796
|
+
subtitle: t5.depositWithCard.subtitle,
|
|
5742
5797
|
paymentNetworks: projectConfig.payment_networks.networks
|
|
5743
5798
|
}
|
|
5744
5799
|
),
|
|
5745
|
-
!hideDepositTracker && /* @__PURE__ */ (0,
|
|
5800
|
+
!hideDepositTracker && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
5746
5801
|
DepositTrackerButton,
|
|
5747
5802
|
{
|
|
5748
5803
|
onClick: () => setDepositsModalOpen(true),
|
|
@@ -5753,17 +5808,17 @@ function DepositModal({
|
|
|
5753
5808
|
)
|
|
5754
5809
|
] })
|
|
5755
5810
|
) })
|
|
5756
|
-
] }) : view === "transfer" ? /* @__PURE__ */ (0,
|
|
5757
|
-
/* @__PURE__ */ (0,
|
|
5811
|
+
] }) : view === "transfer" ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
5812
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
5758
5813
|
DepositHeader,
|
|
5759
5814
|
{
|
|
5760
|
-
title:
|
|
5815
|
+
title: t5.transferCrypto.title,
|
|
5761
5816
|
showBack: true,
|
|
5762
5817
|
onBack: handleBack,
|
|
5763
5818
|
onClose: handleClose
|
|
5764
5819
|
}
|
|
5765
5820
|
),
|
|
5766
|
-
transferInputVariant === "single_input" ? /* @__PURE__ */ (0,
|
|
5821
|
+
transferInputVariant === "single_input" ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
5767
5822
|
TransferCryptoSingleInput,
|
|
5768
5823
|
{
|
|
5769
5824
|
userId,
|
|
@@ -5777,7 +5832,7 @@ function DepositModal({
|
|
|
5777
5832
|
onDepositError,
|
|
5778
5833
|
wallets
|
|
5779
5834
|
}
|
|
5780
|
-
) : /* @__PURE__ */ (0,
|
|
5835
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
5781
5836
|
TransferCryptoDoubleInput,
|
|
5782
5837
|
{
|
|
5783
5838
|
userId,
|
|
@@ -5792,18 +5847,18 @@ function DepositModal({
|
|
|
5792
5847
|
wallets
|
|
5793
5848
|
}
|
|
5794
5849
|
)
|
|
5795
|
-
] }) : /* @__PURE__ */ (0,
|
|
5796
|
-
/* @__PURE__ */ (0,
|
|
5850
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
5851
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
5797
5852
|
DepositHeader,
|
|
5798
5853
|
{
|
|
5799
|
-
title: cardView === "quotes" ?
|
|
5854
|
+
title: cardView === "quotes" ? t5.quotes : t5.depositWithCard.title,
|
|
5800
5855
|
showBack: true,
|
|
5801
5856
|
onBack: handleBack,
|
|
5802
5857
|
onClose: handleClose,
|
|
5803
5858
|
badge: cardView === "quotes" ? { count: quotesCount } : void 0
|
|
5804
5859
|
}
|
|
5805
5860
|
),
|
|
5806
|
-
/* @__PURE__ */ (0,
|
|
5861
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
5807
5862
|
BuyWithCard,
|
|
5808
5863
|
{
|
|
5809
5864
|
userId,
|
|
@@ -5825,7 +5880,7 @@ function DepositModal({
|
|
|
5825
5880
|
] }) })
|
|
5826
5881
|
}
|
|
5827
5882
|
),
|
|
5828
|
-
/* @__PURE__ */ (0,
|
|
5883
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
5829
5884
|
DepositsModal,
|
|
5830
5885
|
{
|
|
5831
5886
|
open: depositsModalOpen,
|
|
@@ -5844,7 +5899,7 @@ function DepositModal({
|
|
|
5844
5899
|
var React10 = __toESM(require("react"));
|
|
5845
5900
|
var import_react_slot = require("@radix-ui/react-slot");
|
|
5846
5901
|
var import_class_variance_authority = require("class-variance-authority");
|
|
5847
|
-
var
|
|
5902
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
5848
5903
|
var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
5849
5904
|
"uf-inline-flex uf-items-center uf-justify-center uf-whitespace-nowrap uf-rounded-md uf-text-sm uf-font-medium uf-ring-offset-background uf-transition-colors focus-visible:uf-outline-none focus-visible:uf-ring-2 focus-visible:uf-ring-ring focus-visible:uf-ring-offset-2 disabled:uf-pointer-events-none disabled:uf-opacity-50",
|
|
5850
5905
|
{
|
|
@@ -5888,7 +5943,7 @@ var Button = React10.forwardRef(
|
|
|
5888
5943
|
}
|
|
5889
5944
|
return baseStyle;
|
|
5890
5945
|
}, [variant, components, fonts, style]);
|
|
5891
|
-
return /* @__PURE__ */ (0,
|
|
5946
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
5892
5947
|
Comp,
|
|
5893
5948
|
{
|
|
5894
5949
|
className: cn(buttonVariants({ variant, size, className })),
|