@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.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/components/deposits/DepositModal.tsx
|
|
2
|
-
import { useState as
|
|
2
|
+
import { useState as useState19, useEffect as useEffect14 } from "react";
|
|
3
3
|
import { ChevronRight as ChevronRight8, MapPinOff, AlertTriangle } from "lucide-react";
|
|
4
4
|
|
|
5
5
|
// src/components/shared/dialog.tsx
|
|
@@ -3583,7 +3583,7 @@ function useAddressValidation({
|
|
|
3583
3583
|
}
|
|
3584
3584
|
|
|
3585
3585
|
// src/components/deposits/TransferCryptoSingleInput.tsx
|
|
3586
|
-
import { useState as
|
|
3586
|
+
import { useState as useState17, useEffect as useEffect12, useRef as useRef4 } from "react";
|
|
3587
3587
|
import {
|
|
3588
3588
|
ChevronDown as ChevronDown3,
|
|
3589
3589
|
ChevronUp as ChevronUp2,
|
|
@@ -3592,10 +3592,9 @@ import {
|
|
|
3592
3592
|
DollarSign,
|
|
3593
3593
|
ShieldCheck,
|
|
3594
3594
|
Clock as Clock2,
|
|
3595
|
-
FileText,
|
|
3596
3595
|
ChevronRight as ChevronRight6,
|
|
3597
3596
|
Copy,
|
|
3598
|
-
|
|
3597
|
+
Wallet2
|
|
3599
3598
|
} from "lucide-react";
|
|
3600
3599
|
|
|
3601
3600
|
// src/components/deposits/StyledQRCode.tsx
|
|
@@ -3719,7 +3718,7 @@ function saveRecentToken(token) {
|
|
|
3719
3718
|
try {
|
|
3720
3719
|
const recent = getRecentTokens();
|
|
3721
3720
|
const filtered = recent.filter(
|
|
3722
|
-
(
|
|
3721
|
+
(t6) => !(t6.symbol === token.symbol && t6.chainType === token.chainType && t6.chainId === token.chainId)
|
|
3723
3722
|
);
|
|
3724
3723
|
filtered.unshift(token);
|
|
3725
3724
|
const trimmed = filtered.slice(0, MAX_RECENT_TOKENS);
|
|
@@ -3732,7 +3731,7 @@ function removeRecentToken(token) {
|
|
|
3732
3731
|
try {
|
|
3733
3732
|
const recent = getRecentTokens();
|
|
3734
3733
|
const filtered = recent.filter(
|
|
3735
|
-
(
|
|
3734
|
+
(t6) => !(t6.symbol === token.symbol && t6.chainType === token.chainType && t6.chainId === token.chainId)
|
|
3736
3735
|
);
|
|
3737
3736
|
localStorage.setItem(STORAGE_KEY, JSON.stringify(filtered));
|
|
3738
3737
|
return filtered;
|
|
@@ -3771,7 +3770,7 @@ function TokenSelectorSheet({
|
|
|
3771
3770
|
const addOption = (symbol, chainType, chainId, isRecent) => {
|
|
3772
3771
|
const key = `${symbol}-${chainType}:${chainId}`;
|
|
3773
3772
|
if (seen.has(key)) return;
|
|
3774
|
-
const tokenData = tokens.find((
|
|
3773
|
+
const tokenData = tokens.find((t6) => t6.symbol === symbol);
|
|
3775
3774
|
if (!tokenData) return;
|
|
3776
3775
|
const chainData = tokenData.chains.find(
|
|
3777
3776
|
(c) => c.chain_type === chainType && c.chain_id === chainId
|
|
@@ -4140,16 +4139,211 @@ function TokenSelectorSheet({
|
|
|
4140
4139
|
);
|
|
4141
4140
|
}
|
|
4142
4141
|
|
|
4142
|
+
// src/components/deposits/shared/PollCooldownButton.tsx
|
|
4143
|
+
import { pollDirectExecutions } from "@unifold/core";
|
|
4144
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
4145
|
+
function PollCooldownButton({
|
|
4146
|
+
currentWalletId,
|
|
4147
|
+
pollCooldown,
|
|
4148
|
+
publishableKey,
|
|
4149
|
+
onCooldownChange,
|
|
4150
|
+
cooldownRef,
|
|
4151
|
+
buttonText = "Check again"
|
|
4152
|
+
}) {
|
|
4153
|
+
const handleClick = async () => {
|
|
4154
|
+
if (!currentWalletId || pollCooldown > 0) return;
|
|
4155
|
+
try {
|
|
4156
|
+
await pollDirectExecutions(
|
|
4157
|
+
{ deposit_wallet_id: currentWalletId },
|
|
4158
|
+
publishableKey
|
|
4159
|
+
);
|
|
4160
|
+
const cooldownSeconds = 5;
|
|
4161
|
+
onCooldownChange(cooldownSeconds);
|
|
4162
|
+
if (cooldownRef.current) clearInterval(cooldownRef.current);
|
|
4163
|
+
cooldownRef.current = setInterval(() => {
|
|
4164
|
+
onCooldownChange((prev) => {
|
|
4165
|
+
if (prev <= 1) {
|
|
4166
|
+
if (cooldownRef.current) clearInterval(cooldownRef.current);
|
|
4167
|
+
cooldownRef.current = null;
|
|
4168
|
+
return 0;
|
|
4169
|
+
}
|
|
4170
|
+
return prev - 1;
|
|
4171
|
+
});
|
|
4172
|
+
}, 1e3);
|
|
4173
|
+
} catch (error) {
|
|
4174
|
+
console.error("Failed to start poll workflow:", error);
|
|
4175
|
+
}
|
|
4176
|
+
};
|
|
4177
|
+
return /* @__PURE__ */ jsx19("div", { children: /* @__PURE__ */ jsx19(
|
|
4178
|
+
"button",
|
|
4179
|
+
{
|
|
4180
|
+
onClick: handleClick,
|
|
4181
|
+
disabled: !currentWalletId || pollCooldown > 0,
|
|
4182
|
+
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",
|
|
4183
|
+
children: pollCooldown > 0 ? `${buttonText} in ${pollCooldown}s` : "I've made the deposit"
|
|
4184
|
+
}
|
|
4185
|
+
) });
|
|
4186
|
+
}
|
|
4187
|
+
|
|
4188
|
+
// src/components/deposits/shared/DepositFooterLinks.tsx
|
|
4189
|
+
import { jsx as jsx20, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
4190
|
+
function DepositFooterLinks({ onGlossaryClick }) {
|
|
4191
|
+
return /* @__PURE__ */ jsxs15("div", { className: "uf-flex uf-justify-end uf-items-center uf-gap-2 uf-text-xs uf-text-muted-foreground", children: [
|
|
4192
|
+
/* @__PURE__ */ jsx20(
|
|
4193
|
+
"a",
|
|
4194
|
+
{
|
|
4195
|
+
href: "https://unifold.io/terms",
|
|
4196
|
+
target: "_blank",
|
|
4197
|
+
className: "uf-cursor-pointer hover:uf-text-foreground uf-transition-colors",
|
|
4198
|
+
children: "terms"
|
|
4199
|
+
}
|
|
4200
|
+
),
|
|
4201
|
+
/* @__PURE__ */ jsx20("span", { className: "uf-text-xs uf-text-muted-foreground", children: "|" }),
|
|
4202
|
+
/* @__PURE__ */ jsx20(
|
|
4203
|
+
"a",
|
|
4204
|
+
{
|
|
4205
|
+
href: "https://unifold.io/support",
|
|
4206
|
+
target: "_blank",
|
|
4207
|
+
className: "uf-cursor-pointer hover:uf-text-foreground uf-transition-colors",
|
|
4208
|
+
children: "help"
|
|
4209
|
+
}
|
|
4210
|
+
),
|
|
4211
|
+
/* @__PURE__ */ jsx20("span", { className: "uf-text-xs uf-text-muted-foreground", children: "|" }),
|
|
4212
|
+
/* @__PURE__ */ jsx20(
|
|
4213
|
+
"div",
|
|
4214
|
+
{
|
|
4215
|
+
className: "uf-cursor-pointer hover:uf-text-foreground uf-transition-colors",
|
|
4216
|
+
onClick: onGlossaryClick,
|
|
4217
|
+
children: "glossary"
|
|
4218
|
+
}
|
|
4219
|
+
)
|
|
4220
|
+
] });
|
|
4221
|
+
}
|
|
4222
|
+
|
|
4223
|
+
// src/components/deposits/shared/GlossaryModal.tsx
|
|
4224
|
+
import { X as X5 } from "lucide-react";
|
|
4225
|
+
import { jsx as jsx21, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
4226
|
+
var t2 = i18n.transferCrypto;
|
|
4227
|
+
function GlossaryModal({
|
|
4228
|
+
open,
|
|
4229
|
+
onOpenChange,
|
|
4230
|
+
themeClass,
|
|
4231
|
+
colors: colors2
|
|
4232
|
+
}) {
|
|
4233
|
+
return /* @__PURE__ */ jsx21(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs16(
|
|
4234
|
+
DialogContent,
|
|
4235
|
+
{
|
|
4236
|
+
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}`,
|
|
4237
|
+
style: { backgroundColor: colors2.card },
|
|
4238
|
+
children: [
|
|
4239
|
+
/* @__PURE__ */ jsxs16("div", { className: "uf-flex uf-items-center uf-justify-between uf-p-4 uf-pb-2", children: [
|
|
4240
|
+
/* @__PURE__ */ jsx21(DialogTitle, { className: "uf-text-base uf-font-semibold", children: "Glossary" }),
|
|
4241
|
+
/* @__PURE__ */ jsx21(
|
|
4242
|
+
"button",
|
|
4243
|
+
{
|
|
4244
|
+
onClick: () => onOpenChange(false),
|
|
4245
|
+
className: "uf-p-1 uf-rounded-lg hover:uf-bg-secondary uf-transition-colors uf-text-muted-foreground hover:uf-text-foreground",
|
|
4246
|
+
children: /* @__PURE__ */ jsx21(X5, { className: "uf-w-4 uf-h-4" })
|
|
4247
|
+
}
|
|
4248
|
+
)
|
|
4249
|
+
] }),
|
|
4250
|
+
/* @__PURE__ */ jsx21("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__ */ jsxs16("div", { className: "uf-space-y-4", children: [
|
|
4251
|
+
/* @__PURE__ */ jsxs16("div", { children: [
|
|
4252
|
+
/* @__PURE__ */ jsx21("div", { className: "uf-text-sm uf-font-medium uf-mb-1", children: "Your Deposit Token" }),
|
|
4253
|
+
/* @__PURE__ */ jsx21("p", { className: "uf-text-xs uf-text-muted-foreground uf-leading-relaxed", children: t2.selectTokenDepositTooltip })
|
|
4254
|
+
] }),
|
|
4255
|
+
/* @__PURE__ */ jsx21("div", { className: "uf-border-t uf-border-border" }),
|
|
4256
|
+
/* @__PURE__ */ jsxs16("div", { children: [
|
|
4257
|
+
/* @__PURE__ */ jsx21("div", { className: "uf-text-sm uf-font-medium uf-mb-1", children: "Deposit Address" }),
|
|
4258
|
+
/* @__PURE__ */ jsx21("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." })
|
|
4259
|
+
] }),
|
|
4260
|
+
/* @__PURE__ */ jsx21("div", { className: "uf-border-t uf-border-border" }),
|
|
4261
|
+
/* @__PURE__ */ jsxs16("div", { children: [
|
|
4262
|
+
/* @__PURE__ */ jsx21("div", { className: "uf-text-sm uf-font-medium uf-mb-1", children: "Price Impact" }),
|
|
4263
|
+
/* @__PURE__ */ jsx21("p", { className: "uf-text-xs uf-text-muted-foreground uf-leading-relaxed", children: t2.priceImpact.tooltip })
|
|
4264
|
+
] }),
|
|
4265
|
+
/* @__PURE__ */ jsx21("div", { className: "uf-border-t uf-border-border" }),
|
|
4266
|
+
/* @__PURE__ */ jsxs16("div", { children: [
|
|
4267
|
+
/* @__PURE__ */ jsx21("div", { className: "uf-text-sm uf-font-medium uf-mb-1", children: "Slippage" }),
|
|
4268
|
+
/* @__PURE__ */ jsx21("p", { className: "uf-text-xs uf-text-muted-foreground uf-leading-relaxed", children: t2.slippage.tooltip })
|
|
4269
|
+
] }),
|
|
4270
|
+
/* @__PURE__ */ jsx21("div", { className: "uf-border-t uf-border-border" }),
|
|
4271
|
+
/* @__PURE__ */ jsxs16("div", { children: [
|
|
4272
|
+
/* @__PURE__ */ jsx21("div", { className: "uf-text-sm uf-font-medium uf-mb-1", children: "Processing Time" }),
|
|
4273
|
+
/* @__PURE__ */ jsx21("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." })
|
|
4274
|
+
] }),
|
|
4275
|
+
/* @__PURE__ */ jsx21("div", { className: "uf-border-t uf-border-border" }),
|
|
4276
|
+
/* @__PURE__ */ jsxs16("div", { children: [
|
|
4277
|
+
/* @__PURE__ */ jsx21("div", { className: "uf-text-sm uf-font-medium uf-mb-1", children: "Minimum Deposit" }),
|
|
4278
|
+
/* @__PURE__ */ jsx21("p", { className: "uf-text-xs uf-text-muted-foreground uf-leading-relaxed", children: t2.minDeposit.tooltip })
|
|
4279
|
+
] }),
|
|
4280
|
+
/* @__PURE__ */ jsx21("div", { className: "uf-border-t uf-border-border" }),
|
|
4281
|
+
/* @__PURE__ */ jsxs16("div", { children: [
|
|
4282
|
+
/* @__PURE__ */ jsx21("div", { className: "uf-text-sm uf-font-medium uf-mb-1", children: "Recipient Address" }),
|
|
4283
|
+
/* @__PURE__ */ jsx21("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." })
|
|
4284
|
+
] })
|
|
4285
|
+
] }) })
|
|
4286
|
+
]
|
|
4287
|
+
}
|
|
4288
|
+
) });
|
|
4289
|
+
}
|
|
4290
|
+
|
|
4291
|
+
// src/components/deposits/shared/useCopyAddress.ts
|
|
4292
|
+
import { useState as useState15 } from "react";
|
|
4293
|
+
function useCopyAddress() {
|
|
4294
|
+
const [copied, setCopied] = useState15(false);
|
|
4295
|
+
const handleCopy = (address) => {
|
|
4296
|
+
if (!address) return;
|
|
4297
|
+
navigator.clipboard.writeText(address);
|
|
4298
|
+
setCopied(true);
|
|
4299
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
4300
|
+
};
|
|
4301
|
+
return { copied, handleCopy };
|
|
4302
|
+
}
|
|
4303
|
+
|
|
4143
4304
|
// src/components/shared/tooltip.tsx
|
|
4144
4305
|
import * as React8 from "react";
|
|
4145
4306
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
4146
|
-
import { jsx as
|
|
4307
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
4147
4308
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
4148
|
-
|
|
4149
|
-
|
|
4309
|
+
function Tooltip({
|
|
4310
|
+
children,
|
|
4311
|
+
...props
|
|
4312
|
+
}) {
|
|
4313
|
+
const [open, setOpen] = React8.useState(props.defaultOpen ?? false);
|
|
4314
|
+
const isControlled = props.open !== void 0;
|
|
4315
|
+
const isOpen = isControlled ? props.open : open;
|
|
4316
|
+
const onOpenChange = isControlled ? props.onOpenChange : (nextOpen) => setOpen(nextOpen);
|
|
4317
|
+
return /* @__PURE__ */ jsx22(TooltipContext.Provider, { value: { open: isOpen, onOpenChange }, children: /* @__PURE__ */ jsx22(
|
|
4318
|
+
TooltipPrimitive.Root,
|
|
4319
|
+
{
|
|
4320
|
+
...props,
|
|
4321
|
+
open: isOpen,
|
|
4322
|
+
onOpenChange,
|
|
4323
|
+
children
|
|
4324
|
+
}
|
|
4325
|
+
) });
|
|
4326
|
+
}
|
|
4327
|
+
var TooltipContext = React8.createContext({
|
|
4328
|
+
open: false,
|
|
4329
|
+
onOpenChange: () => {
|
|
4330
|
+
}
|
|
4331
|
+
});
|
|
4332
|
+
var TooltipTrigger = React8.forwardRef(({ onClick, ...props }, ref) => {
|
|
4333
|
+
const { open, onOpenChange } = React8.useContext(TooltipContext);
|
|
4334
|
+
const handleClick = React8.useCallback(
|
|
4335
|
+
(e) => {
|
|
4336
|
+
onOpenChange(!open);
|
|
4337
|
+
onClick?.(e);
|
|
4338
|
+
},
|
|
4339
|
+
[open, onOpenChange, onClick]
|
|
4340
|
+
);
|
|
4341
|
+
return /* @__PURE__ */ jsx22(TooltipPrimitive.Trigger, { ref, onClick: handleClick, ...props });
|
|
4342
|
+
});
|
|
4343
|
+
TooltipTrigger.displayName = TooltipPrimitive.Trigger.displayName;
|
|
4150
4344
|
var TooltipContent = React8.forwardRef(({ className, sideOffset = 4, ...props }, ref) => {
|
|
4151
4345
|
const { themeClass, colors: colors2 } = useTheme();
|
|
4152
|
-
return /* @__PURE__ */
|
|
4346
|
+
return /* @__PURE__ */ jsx22(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx22(
|
|
4153
4347
|
TooltipPrimitive.Content,
|
|
4154
4348
|
{
|
|
4155
4349
|
ref,
|
|
@@ -4172,8 +4366,8 @@ import {
|
|
|
4172
4366
|
getWalletByChainType as getWalletByChainType2,
|
|
4173
4367
|
getSupportedDepositTokens
|
|
4174
4368
|
} from "@unifold/core";
|
|
4175
|
-
import { Fragment as Fragment4, jsx as
|
|
4176
|
-
var
|
|
4369
|
+
import { Fragment as Fragment4, jsx as jsx23, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
4370
|
+
var t3 = i18n.transferCrypto;
|
|
4177
4371
|
var getChainKey = (chainId, chainType) => {
|
|
4178
4372
|
return `${chainType}:${chainId}`;
|
|
4179
4373
|
};
|
|
@@ -4195,13 +4389,25 @@ function TransferCryptoSingleInput({
|
|
|
4195
4389
|
}) {
|
|
4196
4390
|
const { themeClass, colors: colors2, fonts, components } = useTheme();
|
|
4197
4391
|
const isDarkMode = themeClass.includes("uf-dark");
|
|
4198
|
-
const [token, setToken] =
|
|
4199
|
-
const [chain, setChain] =
|
|
4200
|
-
const [copied, setCopied] =
|
|
4201
|
-
const
|
|
4202
|
-
const [
|
|
4392
|
+
const [token, setToken] = useState17("USDC");
|
|
4393
|
+
const [chain, setChain] = useState17("solana:mainnet");
|
|
4394
|
+
const [copied, setCopied] = useState17(false);
|
|
4395
|
+
const { copied: copiedRecipient, handleCopy: handleCopyRecipientAddress } = useCopyAddress();
|
|
4396
|
+
const [glossaryOpen, setGlossaryOpen] = useState17(false);
|
|
4397
|
+
const [pollCooldown, setPollCooldown] = useState17(0);
|
|
4398
|
+
const cooldownRef = useRef4(null);
|
|
4399
|
+
const [internalWallets, setInternalWallets] = useState17([]);
|
|
4400
|
+
const [loading, setLoading] = useState17(!externalWallets?.length);
|
|
4401
|
+
useEffect12(() => {
|
|
4402
|
+
return () => {
|
|
4403
|
+
if (cooldownRef.current) {
|
|
4404
|
+
clearInterval(cooldownRef.current);
|
|
4405
|
+
cooldownRef.current = null;
|
|
4406
|
+
}
|
|
4407
|
+
};
|
|
4408
|
+
}, []);
|
|
4203
4409
|
const wallets = externalWallets?.length ? externalWallets : internalWallets;
|
|
4204
|
-
const [error, setError] =
|
|
4410
|
+
const [error, setError] = useState17(null);
|
|
4205
4411
|
const { executions: depositExecutions, isPolling } = useDepositPolling({
|
|
4206
4412
|
userId,
|
|
4207
4413
|
publishableKey,
|
|
@@ -4209,14 +4415,14 @@ function TransferCryptoSingleInput({
|
|
|
4209
4415
|
onDepositSuccess,
|
|
4210
4416
|
onDepositError
|
|
4211
4417
|
});
|
|
4212
|
-
const [supportedTokens, setSupportedTokens] =
|
|
4213
|
-
const [tokensLoading, setTokensLoading] =
|
|
4214
|
-
const [detailsExpanded, setDetailsExpanded] =
|
|
4215
|
-
const [depositsModalOpen, setDepositsModalOpen] =
|
|
4216
|
-
const [tokenSelectorOpen, setTokenSelectorOpen] =
|
|
4418
|
+
const [supportedTokens, setSupportedTokens] = useState17([]);
|
|
4419
|
+
const [tokensLoading, setTokensLoading] = useState17(true);
|
|
4420
|
+
const [detailsExpanded, setDetailsExpanded] = useState17(false);
|
|
4421
|
+
const [depositsModalOpen, setDepositsModalOpen] = useState17(false);
|
|
4422
|
+
const [tokenSelectorOpen, setTokenSelectorOpen] = useState17(false);
|
|
4217
4423
|
const allChainsMap = /* @__PURE__ */ new Map();
|
|
4218
|
-
supportedTokens.forEach((
|
|
4219
|
-
|
|
4424
|
+
supportedTokens.forEach((t6) => {
|
|
4425
|
+
t6.chains.forEach((c) => {
|
|
4220
4426
|
const comboKey = `${c.chain_type}:${c.chain_id}`;
|
|
4221
4427
|
if (!allChainsMap.has(comboKey)) {
|
|
4222
4428
|
allChainsMap.set(comboKey, c);
|
|
@@ -4249,25 +4455,25 @@ function TransferCryptoSingleInput({
|
|
|
4249
4455
|
let selectedTokenData;
|
|
4250
4456
|
let selectedChainData;
|
|
4251
4457
|
if (destinationTokenAddress) {
|
|
4252
|
-
for (const
|
|
4253
|
-
const matchingChain =
|
|
4458
|
+
for (const t6 of response.data) {
|
|
4459
|
+
const matchingChain = t6.chains.find(
|
|
4254
4460
|
(c) => c.token_address.toLowerCase() === destinationTokenAddress.toLowerCase()
|
|
4255
4461
|
);
|
|
4256
4462
|
if (matchingChain) {
|
|
4257
|
-
selectedTokenData =
|
|
4463
|
+
selectedTokenData = t6;
|
|
4258
4464
|
selectedChainData = matchingChain;
|
|
4259
4465
|
break;
|
|
4260
4466
|
}
|
|
4261
4467
|
}
|
|
4262
4468
|
}
|
|
4263
4469
|
if (!selectedTokenData) {
|
|
4264
|
-
selectedTokenData = response.data.find((
|
|
4470
|
+
selectedTokenData = response.data.find((t6) => t6.symbol === "USDC");
|
|
4265
4471
|
if (selectedTokenData && selectedTokenData.chains.length > 0) {
|
|
4266
4472
|
selectedChainData = selectedTokenData.chains[0];
|
|
4267
4473
|
}
|
|
4268
4474
|
}
|
|
4269
4475
|
if (!selectedTokenData) {
|
|
4270
|
-
selectedTokenData = response.data.find((
|
|
4476
|
+
selectedTokenData = response.data.find((t6) => t6.symbol === "USDT");
|
|
4271
4477
|
if (selectedTokenData && selectedTokenData.chains.length > 0) {
|
|
4272
4478
|
selectedChainData = selectedTokenData.chains[0];
|
|
4273
4479
|
}
|
|
@@ -4367,7 +4573,7 @@ function TransferCryptoSingleInput({
|
|
|
4367
4573
|
]);
|
|
4368
4574
|
useEffect12(() => {
|
|
4369
4575
|
if (!supportedTokens.length) return;
|
|
4370
|
-
const currentToken = supportedTokens.find((
|
|
4576
|
+
const currentToken = supportedTokens.find((t6) => t6.symbol === token);
|
|
4371
4577
|
if (!currentToken || currentToken.chains.length === 0) return;
|
|
4372
4578
|
const isChainAvailable = currentToken.chains.some((c) => {
|
|
4373
4579
|
const key = getChainKey(c.chain_id, c.chain_type);
|
|
@@ -4379,7 +4585,7 @@ function TransferCryptoSingleInput({
|
|
|
4379
4585
|
setChain(newChain);
|
|
4380
4586
|
}
|
|
4381
4587
|
}, [token, supportedTokens, chain]);
|
|
4382
|
-
const selectedToken = supportedTokens.find((
|
|
4588
|
+
const selectedToken = supportedTokens.find((t6) => t6.symbol === token);
|
|
4383
4589
|
const availableChainsForToken = selectedToken?.chains || [];
|
|
4384
4590
|
const currentChainFromBackend = availableChainsForToken.find((c) => {
|
|
4385
4591
|
const key = getChainKey(c.chain_id, c.chain_type);
|
|
@@ -4395,67 +4601,44 @@ function TransferCryptoSingleInput({
|
|
|
4395
4601
|
};
|
|
4396
4602
|
const formatProcessingTime = (seconds) => {
|
|
4397
4603
|
if (seconds === null) {
|
|
4398
|
-
return
|
|
4604
|
+
return t3.processingTime.lessThanMinutes.replace("{{minutes}}", "1");
|
|
4399
4605
|
}
|
|
4400
4606
|
const minutes = Math.ceil(seconds / 60);
|
|
4401
4607
|
if (minutes < 60) {
|
|
4402
|
-
return
|
|
4608
|
+
return t3.processingTime.lessThanMinutes.replace(
|
|
4403
4609
|
"{{minutes}}",
|
|
4404
4610
|
String(minutes)
|
|
4405
4611
|
);
|
|
4406
4612
|
}
|
|
4407
4613
|
const hours = Math.ceil(minutes / 60);
|
|
4408
|
-
return
|
|
4614
|
+
return t3.processingTime.lessThanHours.replace("{{hours}}", String(hours));
|
|
4409
4615
|
};
|
|
4410
4616
|
const priceImpact = currentChainFromBackend?.estimated_price_impact_percent ?? 0;
|
|
4411
4617
|
const maxSlippage = currentChainFromBackend?.max_slippage_percent ?? 0.25;
|
|
4412
4618
|
const processingTime = currentChainFromBackend?.estimated_processing_time ?? null;
|
|
4413
4619
|
const minDepositUsd = currentChainFromBackend?.minimum_deposit_amount_usd ?? 3;
|
|
4414
|
-
return /* @__PURE__ */
|
|
4620
|
+
return /* @__PURE__ */ jsx23(TooltipProvider, { delayDuration: 0, skipDelayDuration: 0, children: /* @__PURE__ */ jsxs17(
|
|
4415
4621
|
"div",
|
|
4416
4622
|
{
|
|
4417
4623
|
className: "uf-space-y-3 [scrollbar-width:none] [&::-webkit-scrollbar]:uf-hidden",
|
|
4418
4624
|
style: { backgroundColor: colors2.background },
|
|
4419
4625
|
children: [
|
|
4420
|
-
/* @__PURE__ */
|
|
4421
|
-
|
|
4422
|
-
/* @__PURE__ */ jsxs15(Tooltip, { children: [
|
|
4423
|
-
/* @__PURE__ */ jsx20(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx20(
|
|
4424
|
-
"span",
|
|
4425
|
-
{
|
|
4426
|
-
className: "uf-inline-flex uf-cursor-pointer uf-transition-colors hover:uf-text-foreground",
|
|
4427
|
-
tabIndex: 0,
|
|
4428
|
-
role: "button",
|
|
4429
|
-
"aria-label": "Deposit address information",
|
|
4430
|
-
children: /* @__PURE__ */ jsx20(Info, { className: "uf-w-3 uf-h-3" })
|
|
4431
|
-
}
|
|
4432
|
-
) }),
|
|
4433
|
-
/* @__PURE__ */ jsx20(
|
|
4434
|
-
TooltipContent,
|
|
4435
|
-
{
|
|
4436
|
-
side: "bottom",
|
|
4437
|
-
align: "center",
|
|
4438
|
-
className: "uf-max-w-[240px]",
|
|
4439
|
-
children: /* @__PURE__ */ jsx20("p", { children: t2.selectTokenDepositTooltip })
|
|
4440
|
-
}
|
|
4441
|
-
)
|
|
4442
|
-
] })
|
|
4443
|
-
] }) }),
|
|
4444
|
-
/* @__PURE__ */ jsx20(
|
|
4626
|
+
/* @__PURE__ */ jsx23("div", { className: "uf-text-xs uf-text-muted-foreground uf-mb-1 uf-flex uf-items-center uf-justify-between", children: /* @__PURE__ */ jsx23("div", { className: "uf-flex uf-items-center uf-gap-1", children: t3.selectTokenDeposit }) }),
|
|
4627
|
+
/* @__PURE__ */ jsx23(
|
|
4445
4628
|
"button",
|
|
4446
4629
|
{
|
|
4447
4630
|
onClick: () => setTokenSelectorOpen(true),
|
|
4448
4631
|
disabled: tokensLoading || supportedTokens.length === 0,
|
|
4449
4632
|
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",
|
|
4450
|
-
children: tokensLoading ? /* @__PURE__ */
|
|
4451
|
-
/* @__PURE__ */
|
|
4452
|
-
/* @__PURE__ */
|
|
4453
|
-
/* @__PURE__ */
|
|
4454
|
-
/* @__PURE__ */
|
|
4633
|
+
children: tokensLoading ? /* @__PURE__ */ jsxs17("div", { className: "uf-flex uf-items-center uf-gap-3 uf-animate-pulse", children: [
|
|
4634
|
+
/* @__PURE__ */ jsx23("div", { className: "uf-w-10 uf-h-10 uf-rounded-full uf-bg-muted" }),
|
|
4635
|
+
/* @__PURE__ */ jsxs17("div", { className: "uf-flex-1", children: [
|
|
4636
|
+
/* @__PURE__ */ jsx23("div", { className: "uf-h-4 uf-w-16 uf-bg-muted uf-rounded uf-mb-1" }),
|
|
4637
|
+
/* @__PURE__ */ jsx23("div", { className: "uf-h-3 uf-w-24 uf-bg-muted uf-rounded" })
|
|
4455
4638
|
] })
|
|
4456
|
-
] }) : /* @__PURE__ */
|
|
4457
|
-
/* @__PURE__ */
|
|
4458
|
-
selectedToken && /* @__PURE__ */
|
|
4639
|
+
] }) : /* @__PURE__ */ jsxs17(Fragment4, { children: [
|
|
4640
|
+
/* @__PURE__ */ jsxs17("div", { className: "uf-relative uf-flex-shrink-0", children: [
|
|
4641
|
+
selectedToken && /* @__PURE__ */ jsx23(
|
|
4459
4642
|
"img",
|
|
4460
4643
|
{
|
|
4461
4644
|
src: selectedToken.icon_url,
|
|
@@ -4463,7 +4646,7 @@ function TransferCryptoSingleInput({
|
|
|
4463
4646
|
className: "uf-w-10 uf-h-10 uf-rounded-full"
|
|
4464
4647
|
}
|
|
4465
4648
|
),
|
|
4466
|
-
(currentChainFromBackend || currentChainData) && /* @__PURE__ */
|
|
4649
|
+
(currentChainFromBackend || currentChainData) && /* @__PURE__ */ jsx23(
|
|
4467
4650
|
"img",
|
|
4468
4651
|
{
|
|
4469
4652
|
src: currentChainFromBackend?.icon_url || currentChainData?.icon_url,
|
|
@@ -4472,12 +4655,12 @@ function TransferCryptoSingleInput({
|
|
|
4472
4655
|
}
|
|
4473
4656
|
)
|
|
4474
4657
|
] }),
|
|
4475
|
-
/* @__PURE__ */
|
|
4476
|
-
/* @__PURE__ */
|
|
4477
|
-
/* @__PURE__ */
|
|
4658
|
+
/* @__PURE__ */ jsxs17("div", { className: "uf-flex-1 uf-text-left uf-min-w-0", children: [
|
|
4659
|
+
/* @__PURE__ */ jsx23("div", { className: "uf-text-sm uf-font-medium uf-text-foreground", children: selectedToken?.symbol || token }),
|
|
4660
|
+
/* @__PURE__ */ jsx23("div", { className: "uf-text-xs uf-text-muted-foreground uf-truncate", children: currentChainFromBackend?.chain_name || currentChainData?.chain_name || "Select network" })
|
|
4478
4661
|
] }),
|
|
4479
|
-
/* @__PURE__ */
|
|
4480
|
-
/* @__PURE__ */
|
|
4662
|
+
/* @__PURE__ */ jsxs17("div", { className: "uf-flex uf-items-center uf-gap-2 uf-flex-shrink-0", children: [
|
|
4663
|
+
/* @__PURE__ */ jsx23("div", { className: "uf-text-right", children: /* @__PURE__ */ jsxs17(
|
|
4481
4664
|
"div",
|
|
4482
4665
|
{
|
|
4483
4666
|
className: `uf-text-xs uf-font-medium ${isDarkMode ? "uf-text-amber-400" : "uf-text-amber-600"}`,
|
|
@@ -4488,12 +4671,12 @@ function TransferCryptoSingleInput({
|
|
|
4488
4671
|
]
|
|
4489
4672
|
}
|
|
4490
4673
|
) }),
|
|
4491
|
-
/* @__PURE__ */
|
|
4674
|
+
/* @__PURE__ */ jsx23(ChevronRight6, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground" })
|
|
4492
4675
|
] })
|
|
4493
4676
|
] })
|
|
4494
4677
|
}
|
|
4495
4678
|
),
|
|
4496
|
-
/* @__PURE__ */
|
|
4679
|
+
/* @__PURE__ */ jsx23(
|
|
4497
4680
|
TokenSelectorSheet,
|
|
4498
4681
|
{
|
|
4499
4682
|
open: tokenSelectorOpen,
|
|
@@ -4507,226 +4690,157 @@ function TransferCryptoSingleInput({
|
|
|
4507
4690
|
}
|
|
4508
4691
|
}
|
|
4509
4692
|
),
|
|
4510
|
-
/* @__PURE__ */
|
|
4511
|
-
"div",
|
|
4512
|
-
|
|
4513
|
-
className: "uf-flex uf-
|
|
4514
|
-
|
|
4515
|
-
|
|
4516
|
-
}
|
|
4517
|
-
) : depositAddress ? /* @__PURE__ */ jsx20(
|
|
4518
|
-
StyledQRCode,
|
|
4519
|
-
{
|
|
4520
|
-
value: depositAddress,
|
|
4521
|
-
size: 180,
|
|
4522
|
-
imageUrl: currentChainData?.icon_url || currentChainFromBackend?.icon_url,
|
|
4523
|
-
imageSize: 45,
|
|
4524
|
-
darkMode: isDarkMode
|
|
4525
|
-
},
|
|
4526
|
-
`qr-${depositAddress}-${chain}`
|
|
4527
|
-
) : /* @__PURE__ */ jsx20(
|
|
4528
|
-
"div",
|
|
4529
|
-
{
|
|
4530
|
-
className: "uf-flex uf-items-center uf-justify-center",
|
|
4531
|
-
style: { width: 180, height: 180 },
|
|
4532
|
-
children: /* @__PURE__ */ jsx20("div", { className: "uf-text-red-400 uf-text-sm", children: t2.noAddressAvailable })
|
|
4533
|
-
}
|
|
4534
|
-
) }) }),
|
|
4535
|
-
/* @__PURE__ */ jsxs15("div", { children: [
|
|
4536
|
-
/* @__PURE__ */ jsxs15("div", { className: "uf-text-xs uf-text-muted-foreground uf-mb-2 uf-flex uf-items-center uf-gap-1", children: [
|
|
4537
|
-
t2.depositAddress.label,
|
|
4538
|
-
/* @__PURE__ */ jsxs15(Tooltip, { children: [
|
|
4539
|
-
/* @__PURE__ */ jsx20(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx20(
|
|
4540
|
-
"span",
|
|
4541
|
-
{
|
|
4542
|
-
className: "uf-inline-flex uf-cursor-pointer uf-transition-colors hover:uf-text-foreground",
|
|
4543
|
-
tabIndex: 0,
|
|
4544
|
-
role: "button",
|
|
4545
|
-
"aria-label": "Deposit address information",
|
|
4546
|
-
children: /* @__PURE__ */ jsx20(Info, { className: "uf-w-3 uf-h-3" })
|
|
4547
|
-
}
|
|
4548
|
-
) }),
|
|
4549
|
-
/* @__PURE__ */ jsx20(
|
|
4550
|
-
TooltipContent,
|
|
4551
|
-
{
|
|
4552
|
-
side: "top",
|
|
4553
|
-
align: "center",
|
|
4554
|
-
className: "uf-max-w-[240px]",
|
|
4555
|
-
children: /* @__PURE__ */ jsx20("p", { children: t2.depositAddress.tooltip.replace("{{token}}", token) })
|
|
4556
|
-
}
|
|
4557
|
-
)
|
|
4693
|
+
error && !loading && /* @__PURE__ */ jsxs17("div", { className: "uf-bg-destructive/10 uf-border uf-border-destructive/20 uf-rounded-xl uf-p-3 uf-space-y-2", children: [
|
|
4694
|
+
/* @__PURE__ */ jsxs17("div", { className: "uf-flex uf-items-start uf-gap-2", children: [
|
|
4695
|
+
/* @__PURE__ */ jsx23(Info, { className: "uf-w-4 uf-h-4 uf-text-destructive uf-flex-shrink-0 uf-mt-0.5" }),
|
|
4696
|
+
/* @__PURE__ */ jsxs17("div", { className: "uf-flex-1 uf-min-w-0", children: [
|
|
4697
|
+
/* @__PURE__ */ jsx23("div", { className: "uf-text-xs uf-font-medium uf-text-destructive uf-mb-1", children: "Failed to create deposit address" }),
|
|
4698
|
+
/* @__PURE__ */ jsx23("div", { className: "uf-text-xs uf-text-muted-foreground", children: error })
|
|
4558
4699
|
] })
|
|
4559
4700
|
] }),
|
|
4560
|
-
|
|
4561
|
-
"
|
|
4701
|
+
/* @__PURE__ */ jsxs17("div", { className: "uf-flex uf-items-center uf-gap-1.5 uf-text-xs uf-text-muted-foreground uf-pl-6", children: [
|
|
4702
|
+
/* @__PURE__ */ jsx23(Clock2, { className: "uf-w-3 uf-h-3" }),
|
|
4703
|
+
/* @__PURE__ */ jsx23("span", { children: "Retrying automatically every 5 seconds..." })
|
|
4704
|
+
] })
|
|
4705
|
+
] }),
|
|
4706
|
+
/* @__PURE__ */ jsxs17("div", { className: "uf-flex uf-flex-col uf-items-center uf-pt-2", children: [
|
|
4707
|
+
/* @__PURE__ */ jsx23("div", { className: "uf-text-xs uf-text-muted-foreground uf-mb-2 uf-flex uf-items-center uf-gap-1", children: "Intent address" }),
|
|
4708
|
+
/* @__PURE__ */ jsx23("div", { className: "uf-rounded-2xl uf-shadow-lg uf-border uf-border-border", children: loading ? /* @__PURE__ */ jsx23(
|
|
4709
|
+
"div",
|
|
4710
|
+
{
|
|
4711
|
+
className: "uf-flex uf-items-center uf-justify-center",
|
|
4712
|
+
style: { width: 180, height: 180 },
|
|
4713
|
+
children: /* @__PURE__ */ jsx23("div", { className: "uf-text-foreground uf-text-sm", children: t3.loadingQRCode })
|
|
4714
|
+
}
|
|
4715
|
+
) : depositAddress ? /* @__PURE__ */ jsx23(
|
|
4716
|
+
StyledQRCode,
|
|
4717
|
+
{
|
|
4718
|
+
value: depositAddress,
|
|
4719
|
+
size: 180,
|
|
4720
|
+
imageUrl: currentChainData?.icon_url || currentChainFromBackend?.icon_url,
|
|
4721
|
+
imageSize: 45,
|
|
4722
|
+
darkMode: isDarkMode
|
|
4723
|
+
},
|
|
4724
|
+
`qr-${depositAddress}-${chain}`
|
|
4725
|
+
) : /* @__PURE__ */ jsx23(
|
|
4726
|
+
"div",
|
|
4727
|
+
{
|
|
4728
|
+
className: "uf-flex uf-items-center uf-justify-center",
|
|
4729
|
+
style: { width: 180, height: 180 },
|
|
4730
|
+
children: /* @__PURE__ */ jsx23("div", { className: "uf-text-red-400 uf-text-sm", children: t3.noAddressAvailable })
|
|
4731
|
+
}
|
|
4732
|
+
) })
|
|
4733
|
+
] }),
|
|
4734
|
+
/* @__PURE__ */ jsx23("div", { children: /* @__PURE__ */ jsxs17("div", { className: "uf-text-sm uf-text-muted-foreground uf-mb-2 uf-flex uf-justify-center uf-items-center uf-gap-1", children: [
|
|
4735
|
+
/* @__PURE__ */ jsx23("span", { className: "uf-text-sm uf-truncate uf-min-w-0", children: loading ? t3.loading : depositAddress ? truncateAddress(depositAddress, 8, 6) : t3.noAddressAvailable }),
|
|
4736
|
+
depositAddress && /* @__PURE__ */ jsx23(
|
|
4737
|
+
"span",
|
|
4562
4738
|
{
|
|
4563
4739
|
onClick: handleCopyAddress,
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
children: [
|
|
4567
|
-
/* @__PURE__ */ jsx20("span", { className: "uf-text-xs uf-font-mono uf-truncate uf-min-w-0", children: depositAddress ? truncateAddress(depositAddress, 18, 12) : t2.noAddressAvailable }),
|
|
4568
|
-
depositAddress && /* @__PURE__ */ jsx20(
|
|
4569
|
-
"span",
|
|
4570
|
-
{
|
|
4571
|
-
className: `uf-flex-shrink-0 uf-transition-colors ${copied ? "uf-text-green-500" : "uf-text-muted-foreground"}`,
|
|
4572
|
-
children: copied ? /* @__PURE__ */ jsx20(Check3, { className: "uf-w-3.5 uf-h-3.5" }) : /* @__PURE__ */ jsx20(Copy, { className: "uf-w-3.5 uf-h-3.5" })
|
|
4573
|
-
}
|
|
4574
|
-
)
|
|
4575
|
-
]
|
|
4740
|
+
className: `uf-flex-shrink-0 uf-transition-colors uf-cursor-pointer ${copied ? "uf-text-green-500" : "uf-text-muted-foreground"}`,
|
|
4741
|
+
children: copied ? /* @__PURE__ */ jsx23(Check3, { className: "uf-w-3.5 uf-h-3.5" }) : /* @__PURE__ */ jsx23(Copy, { className: "uf-w-3.5 uf-h-3.5" })
|
|
4576
4742
|
}
|
|
4577
4743
|
)
|
|
4578
|
-
] }),
|
|
4579
|
-
/* @__PURE__ */
|
|
4580
|
-
/* @__PURE__ */
|
|
4744
|
+
] }) }),
|
|
4745
|
+
/* @__PURE__ */ jsxs17("div", { className: "uf-bg-secondary uf-rounded-xl uf-px-2.5", children: [
|
|
4746
|
+
/* @__PURE__ */ jsxs17(
|
|
4581
4747
|
"button",
|
|
4582
4748
|
{
|
|
4583
4749
|
onClick: () => setDetailsExpanded(!detailsExpanded),
|
|
4584
4750
|
className: "uf-w-full uf-flex uf-items-center uf-justify-between uf-py-2.5",
|
|
4585
4751
|
children: [
|
|
4586
|
-
/* @__PURE__ */
|
|
4587
|
-
/* @__PURE__ */
|
|
4588
|
-
/* @__PURE__ */
|
|
4589
|
-
|
|
4752
|
+
/* @__PURE__ */ jsxs17("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
4753
|
+
/* @__PURE__ */ jsx23("div", { className: "uf-bg-card uf-rounded-full uf-p-1", children: /* @__PURE__ */ jsx23(Clock2, { className: "uf-w-3 uf-h-3" }) }),
|
|
4754
|
+
/* @__PURE__ */ jsxs17("span", { className: "uf-text-xs", children: [
|
|
4755
|
+
t3.processingTime.label,
|
|
4590
4756
|
":",
|
|
4591
4757
|
" ",
|
|
4592
|
-
/* @__PURE__ */
|
|
4593
|
-
priceImpact.toFixed(2),
|
|
4594
|
-
"%"
|
|
4595
|
-
] })
|
|
4596
|
-
] }),
|
|
4597
|
-
/* @__PURE__ */ jsxs15(Tooltip, { children: [
|
|
4598
|
-
/* @__PURE__ */ jsx20(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx20(
|
|
4599
|
-
"span",
|
|
4600
|
-
{
|
|
4601
|
-
className: "uf-inline-flex uf-cursor-pointer uf-text-muted-foreground uf-transition-colors hover:uf-text-foreground",
|
|
4602
|
-
onClick: (e) => e.stopPropagation(),
|
|
4603
|
-
onKeyDown: (e) => {
|
|
4604
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
4605
|
-
e.stopPropagation();
|
|
4606
|
-
}
|
|
4607
|
-
},
|
|
4608
|
-
tabIndex: 0,
|
|
4609
|
-
role: "button",
|
|
4610
|
-
"aria-label": "Price impact information",
|
|
4611
|
-
children: /* @__PURE__ */ jsx20(Info, { className: "uf-w-3 uf-h-3" })
|
|
4612
|
-
}
|
|
4613
|
-
) }),
|
|
4614
|
-
/* @__PURE__ */ jsx20(
|
|
4615
|
-
TooltipContent,
|
|
4616
|
-
{
|
|
4617
|
-
side: "top",
|
|
4618
|
-
align: "center",
|
|
4619
|
-
className: "uf-max-w-[240px]",
|
|
4620
|
-
children: /* @__PURE__ */ jsx20("p", { children: t2.priceImpact.tooltip })
|
|
4621
|
-
}
|
|
4622
|
-
)
|
|
4758
|
+
/* @__PURE__ */ jsx23("span", { className: "uf-text-foreground", children: formatProcessingTime(processingTime) })
|
|
4623
4759
|
] })
|
|
4624
4760
|
] }),
|
|
4625
|
-
detailsExpanded ? /* @__PURE__ */
|
|
4761
|
+
detailsExpanded ? /* @__PURE__ */ jsx23(ChevronUp2, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground" }) : /* @__PURE__ */ jsx23(ChevronDown3, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground" })
|
|
4626
4762
|
]
|
|
4627
4763
|
}
|
|
4628
4764
|
),
|
|
4629
|
-
detailsExpanded && /* @__PURE__ */
|
|
4630
|
-
/* @__PURE__ */
|
|
4631
|
-
/* @__PURE__ */
|
|
4632
|
-
/* @__PURE__ */
|
|
4633
|
-
|
|
4765
|
+
detailsExpanded && /* @__PURE__ */ jsxs17("div", { className: "uf-pb-3 uf-space-y-2.5", children: [
|
|
4766
|
+
/* @__PURE__ */ jsxs17("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
4767
|
+
/* @__PURE__ */ jsx23("div", { className: "uf-bg-card uf-rounded-full uf-p-1", children: /* @__PURE__ */ jsx23(ShieldCheck, { className: "uf-w-3 uf-h-3" }) }),
|
|
4768
|
+
/* @__PURE__ */ jsxs17("span", { className: "uf-text-xs", children: [
|
|
4769
|
+
t3.slippage.label,
|
|
4634
4770
|
":",
|
|
4635
4771
|
" ",
|
|
4636
|
-
/* @__PURE__ */
|
|
4637
|
-
|
|
4772
|
+
/* @__PURE__ */ jsxs17("span", { className: "uf-text-foreground", children: [
|
|
4773
|
+
t3.slippage.auto,
|
|
4638
4774
|
" \u2022 ",
|
|
4639
4775
|
maxSlippage.toFixed(2),
|
|
4640
4776
|
"%"
|
|
4641
4777
|
] })
|
|
4642
|
-
] }),
|
|
4643
|
-
/* @__PURE__ */ jsxs15(Tooltip, { children: [
|
|
4644
|
-
/* @__PURE__ */ jsx20(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx20(
|
|
4645
|
-
"span",
|
|
4646
|
-
{
|
|
4647
|
-
className: "uf-inline-flex uf-cursor-pointer uf-text-muted-foreground uf-transition-colors hover:uf-text-foreground",
|
|
4648
|
-
tabIndex: 0,
|
|
4649
|
-
role: "button",
|
|
4650
|
-
"aria-label": "Slippage information",
|
|
4651
|
-
children: /* @__PURE__ */ jsx20(Info, { className: "uf-w-3 uf-h-3" })
|
|
4652
|
-
}
|
|
4653
|
-
) }),
|
|
4654
|
-
/* @__PURE__ */ jsx20(
|
|
4655
|
-
TooltipContent,
|
|
4656
|
-
{
|
|
4657
|
-
side: "top",
|
|
4658
|
-
align: "center",
|
|
4659
|
-
className: "uf-max-w-[240px]",
|
|
4660
|
-
children: /* @__PURE__ */ jsx20("p", { children: t2.slippage.tooltip })
|
|
4661
|
-
}
|
|
4662
|
-
)
|
|
4663
4778
|
] })
|
|
4664
4779
|
] }),
|
|
4665
|
-
/* @__PURE__ */
|
|
4666
|
-
/* @__PURE__ */
|
|
4667
|
-
/* @__PURE__ */
|
|
4668
|
-
|
|
4780
|
+
/* @__PURE__ */ jsxs17("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
4781
|
+
/* @__PURE__ */ jsx23("div", { className: "uf-bg-card uf-rounded-full uf-p-1", children: /* @__PURE__ */ jsx23(DollarSign, { className: "uf-w-3 uf-h-3" }) }),
|
|
4782
|
+
/* @__PURE__ */ jsxs17("span", { className: "uf-text-xs", children: [
|
|
4783
|
+
t3.priceImpact.label,
|
|
4669
4784
|
":",
|
|
4670
4785
|
" ",
|
|
4671
|
-
/* @__PURE__ */
|
|
4672
|
-
|
|
4673
|
-
|
|
4674
|
-
|
|
4675
|
-
/* @__PURE__ */ jsx20("div", { className: "uf-bg-card uf-rounded-full uf-p-1", children: /* @__PURE__ */ jsx20(HelpCircle, { className: "uf-w-3 uf-h-3" }) }),
|
|
4676
|
-
/* @__PURE__ */ jsxs15("span", { className: "uf-text-xs", children: [
|
|
4677
|
-
t2.help.needHelp,
|
|
4678
|
-
" ",
|
|
4679
|
-
/* @__PURE__ */ jsx20(
|
|
4680
|
-
"a",
|
|
4681
|
-
{
|
|
4682
|
-
href: "#",
|
|
4683
|
-
className: "uf-text-foreground uf-underline hover:uf-text-muted-foreground uf-transition-colors",
|
|
4684
|
-
children: t2.help.contactSupport
|
|
4685
|
-
}
|
|
4686
|
-
)
|
|
4786
|
+
/* @__PURE__ */ jsxs17("span", { className: "uf-text-foreground", children: [
|
|
4787
|
+
priceImpact.toFixed(2),
|
|
4788
|
+
"%"
|
|
4789
|
+
] })
|
|
4687
4790
|
] })
|
|
4688
4791
|
] }),
|
|
4689
|
-
/* @__PURE__ */
|
|
4690
|
-
/* @__PURE__ */
|
|
4691
|
-
/* @__PURE__ */
|
|
4692
|
-
|
|
4693
|
-
":",
|
|
4792
|
+
/* @__PURE__ */ jsxs17("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
4793
|
+
/* @__PURE__ */ jsx23("div", { className: "uf-bg-card uf-rounded-full uf-p-1", children: /* @__PURE__ */ jsx23(Wallet2, { className: "uf-w-3 uf-h-3" }) }),
|
|
4794
|
+
/* @__PURE__ */ jsxs17("span", { className: "uf-flex uf-gap-2 uf-text-xs", children: [
|
|
4795
|
+
"Recipient address:",
|
|
4694
4796
|
" ",
|
|
4695
|
-
/* @__PURE__ */
|
|
4696
|
-
|
|
4797
|
+
/* @__PURE__ */ jsx23("span", { className: "uf-text-foreground", children: truncateAddress(recipientAddress || "", 8, 6) }),
|
|
4798
|
+
/* @__PURE__ */ jsx23(
|
|
4799
|
+
"span",
|
|
4697
4800
|
{
|
|
4698
|
-
|
|
4699
|
-
className:
|
|
4700
|
-
|
|
4701
|
-
children: t2.terms.seeTerms
|
|
4801
|
+
onClick: () => handleCopyRecipientAddress(recipientAddress),
|
|
4802
|
+
className: `uf-flex-shrink-0 uf-transition-colors uf-cursor-pointer ${copiedRecipient ? "uf-text-green-500" : "uf-text-muted-foreground"}`,
|
|
4803
|
+
children: copiedRecipient ? /* @__PURE__ */ jsx23(Check3, { className: "uf-w-3.5 uf-h-3.5" }) : /* @__PURE__ */ jsx23(Copy, { className: "uf-w-3.5 uf-h-3.5" })
|
|
4702
4804
|
}
|
|
4703
4805
|
)
|
|
4704
4806
|
] })
|
|
4705
4807
|
] })
|
|
4706
4808
|
] })
|
|
4707
4809
|
] }),
|
|
4708
|
-
|
|
4810
|
+
/* @__PURE__ */ jsx23(
|
|
4811
|
+
PollCooldownButton,
|
|
4812
|
+
{
|
|
4813
|
+
currentWalletId: currentWallet?.id,
|
|
4814
|
+
pollCooldown,
|
|
4815
|
+
publishableKey,
|
|
4816
|
+
onCooldownChange: setPollCooldown,
|
|
4817
|
+
cooldownRef,
|
|
4818
|
+
buttonText: "Try again"
|
|
4819
|
+
}
|
|
4820
|
+
),
|
|
4821
|
+
/* @__PURE__ */ jsx23(DepositFooterLinks, { onGlossaryClick: () => setGlossaryOpen(true) }),
|
|
4822
|
+
depositExecutions.length > 1 && /* @__PURE__ */ jsx23("div", { className: "uf-flex uf-items-center uf-justify-end uf-text-xs uf-pt-2", children: /* @__PURE__ */ jsxs17(
|
|
4709
4823
|
"button",
|
|
4710
4824
|
{
|
|
4711
4825
|
onClick: () => setDepositsModalOpen(true),
|
|
4712
4826
|
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",
|
|
4713
4827
|
children: [
|
|
4714
|
-
/* @__PURE__ */
|
|
4828
|
+
/* @__PURE__ */ jsx23(Clock2, { className: "uf-w-3.5 uf-h-3.5" }),
|
|
4715
4829
|
"Track deposits (",
|
|
4716
4830
|
depositExecutions.length,
|
|
4717
4831
|
")",
|
|
4718
|
-
/* @__PURE__ */
|
|
4832
|
+
/* @__PURE__ */ jsx23(ChevronRight6, { className: "uf-w-3 uf-h-3" })
|
|
4719
4833
|
]
|
|
4720
4834
|
}
|
|
4721
4835
|
) }),
|
|
4722
|
-
/* @__PURE__ */
|
|
4836
|
+
/* @__PURE__ */ jsx23(
|
|
4723
4837
|
DepositPollingToasts,
|
|
4724
4838
|
{
|
|
4725
4839
|
executions: depositExecutions,
|
|
4726
4840
|
isPolling
|
|
4727
4841
|
}
|
|
4728
4842
|
),
|
|
4729
|
-
/* @__PURE__ */
|
|
4843
|
+
/* @__PURE__ */ jsx23(
|
|
4730
4844
|
DepositsModal,
|
|
4731
4845
|
{
|
|
4732
4846
|
open: depositsModalOpen,
|
|
@@ -4736,6 +4850,15 @@ function TransferCryptoSingleInput({
|
|
|
4736
4850
|
publishableKey,
|
|
4737
4851
|
themeClass
|
|
4738
4852
|
}
|
|
4853
|
+
),
|
|
4854
|
+
/* @__PURE__ */ jsx23(
|
|
4855
|
+
GlossaryModal,
|
|
4856
|
+
{
|
|
4857
|
+
open: glossaryOpen,
|
|
4858
|
+
onOpenChange: setGlossaryOpen,
|
|
4859
|
+
themeClass,
|
|
4860
|
+
colors: colors2
|
|
4861
|
+
}
|
|
4739
4862
|
)
|
|
4740
4863
|
]
|
|
4741
4864
|
}
|
|
@@ -4743,7 +4866,7 @@ function TransferCryptoSingleInput({
|
|
|
4743
4866
|
}
|
|
4744
4867
|
|
|
4745
4868
|
// src/components/deposits/TransferCryptoDoubleInput.tsx
|
|
4746
|
-
import { useState as
|
|
4869
|
+
import { useState as useState18, useEffect as useEffect13, useRef as useRef5 } from "react";
|
|
4747
4870
|
import {
|
|
4748
4871
|
ChevronDown as ChevronDown5,
|
|
4749
4872
|
ChevronUp as ChevronUp4,
|
|
@@ -4752,21 +4875,20 @@ import {
|
|
|
4752
4875
|
DollarSign as DollarSign2,
|
|
4753
4876
|
ShieldCheck as ShieldCheck2,
|
|
4754
4877
|
Clock as Clock3,
|
|
4755
|
-
FileText as FileText2,
|
|
4756
4878
|
ChevronRight as ChevronRight7,
|
|
4757
4879
|
Copy as Copy2,
|
|
4758
|
-
|
|
4880
|
+
Wallet2 as Wallet22
|
|
4759
4881
|
} from "lucide-react";
|
|
4760
4882
|
|
|
4761
4883
|
// src/components/shared/select.tsx
|
|
4762
4884
|
import * as React9 from "react";
|
|
4763
4885
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
4764
4886
|
import { Check as Check4, ChevronDown as ChevronDown4, ChevronUp as ChevronUp3 } from "lucide-react";
|
|
4765
|
-
import { jsx as
|
|
4887
|
+
import { jsx as jsx24, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
4766
4888
|
var Select = SelectPrimitive.Root;
|
|
4767
4889
|
var SelectGroup = SelectPrimitive.Group;
|
|
4768
4890
|
var SelectValue = SelectPrimitive.Value;
|
|
4769
|
-
var SelectTrigger = React9.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
4891
|
+
var SelectTrigger = React9.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs18(
|
|
4770
4892
|
SelectPrimitive.Trigger,
|
|
4771
4893
|
{
|
|
4772
4894
|
ref,
|
|
@@ -4777,12 +4899,12 @@ var SelectTrigger = React9.forwardRef(({ className, children, ...props }, ref) =
|
|
|
4777
4899
|
...props,
|
|
4778
4900
|
children: [
|
|
4779
4901
|
children,
|
|
4780
|
-
/* @__PURE__ */
|
|
4902
|
+
/* @__PURE__ */ jsx24(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx24(ChevronDown4, { className: "uf-h-4 uf-w-4 uf-opacity-50" }) })
|
|
4781
4903
|
]
|
|
4782
4904
|
}
|
|
4783
4905
|
));
|
|
4784
4906
|
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
4785
|
-
var SelectScrollUpButton = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
4907
|
+
var SelectScrollUpButton = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
|
|
4786
4908
|
SelectPrimitive.ScrollUpButton,
|
|
4787
4909
|
{
|
|
4788
4910
|
ref,
|
|
@@ -4791,11 +4913,11 @@ var SelectScrollUpButton = React9.forwardRef(({ className, ...props }, ref) => /
|
|
|
4791
4913
|
className
|
|
4792
4914
|
),
|
|
4793
4915
|
...props,
|
|
4794
|
-
children: /* @__PURE__ */
|
|
4916
|
+
children: /* @__PURE__ */ jsx24(ChevronUp3, { className: "uf-h-4 uf-w-4" })
|
|
4795
4917
|
}
|
|
4796
4918
|
));
|
|
4797
4919
|
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
4798
|
-
var SelectScrollDownButton = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
4920
|
+
var SelectScrollDownButton = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
|
|
4799
4921
|
SelectPrimitive.ScrollDownButton,
|
|
4800
4922
|
{
|
|
4801
4923
|
ref,
|
|
@@ -4804,13 +4926,13 @@ var SelectScrollDownButton = React9.forwardRef(({ className, ...props }, ref) =>
|
|
|
4804
4926
|
className
|
|
4805
4927
|
),
|
|
4806
4928
|
...props,
|
|
4807
|
-
children: /* @__PURE__ */
|
|
4929
|
+
children: /* @__PURE__ */ jsx24(ChevronDown4, { className: "uf-h-4 uf-w-4" })
|
|
4808
4930
|
}
|
|
4809
4931
|
));
|
|
4810
4932
|
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
4811
4933
|
var SelectContent = React9.forwardRef(({ className, children, position = "popper", ...props }, ref) => {
|
|
4812
4934
|
const { themeClass, colors: colors2 } = useTheme();
|
|
4813
|
-
return /* @__PURE__ */
|
|
4935
|
+
return /* @__PURE__ */ jsx24(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs18(
|
|
4814
4936
|
SelectPrimitive.Content,
|
|
4815
4937
|
{
|
|
4816
4938
|
ref,
|
|
@@ -4824,8 +4946,8 @@ var SelectContent = React9.forwardRef(({ className, children, position = "popper
|
|
|
4824
4946
|
position,
|
|
4825
4947
|
...props,
|
|
4826
4948
|
children: [
|
|
4827
|
-
/* @__PURE__ */
|
|
4828
|
-
/* @__PURE__ */
|
|
4949
|
+
/* @__PURE__ */ jsx24(SelectScrollUpButton, {}),
|
|
4950
|
+
/* @__PURE__ */ jsx24(
|
|
4829
4951
|
SelectPrimitive.Viewport,
|
|
4830
4952
|
{
|
|
4831
4953
|
className: cn(
|
|
@@ -4835,13 +4957,13 @@ var SelectContent = React9.forwardRef(({ className, children, position = "popper
|
|
|
4835
4957
|
children
|
|
4836
4958
|
}
|
|
4837
4959
|
),
|
|
4838
|
-
/* @__PURE__ */
|
|
4960
|
+
/* @__PURE__ */ jsx24(SelectScrollDownButton, {})
|
|
4839
4961
|
]
|
|
4840
4962
|
}
|
|
4841
4963
|
) });
|
|
4842
4964
|
});
|
|
4843
4965
|
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
4844
|
-
var SelectLabel = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
4966
|
+
var SelectLabel = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
|
|
4845
4967
|
SelectPrimitive.Label,
|
|
4846
4968
|
{
|
|
4847
4969
|
ref,
|
|
@@ -4853,7 +4975,7 @@ var SelectLabel = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
4853
4975
|
}
|
|
4854
4976
|
));
|
|
4855
4977
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
4856
|
-
var SelectItem = React9.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
4978
|
+
var SelectItem = React9.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs18(
|
|
4857
4979
|
SelectPrimitive.Item,
|
|
4858
4980
|
{
|
|
4859
4981
|
ref,
|
|
@@ -4863,13 +4985,13 @@ var SelectItem = React9.forwardRef(({ className, children, ...props }, ref) => /
|
|
|
4863
4985
|
),
|
|
4864
4986
|
...props,
|
|
4865
4987
|
children: [
|
|
4866
|
-
/* @__PURE__ */
|
|
4867
|
-
/* @__PURE__ */
|
|
4988
|
+
/* @__PURE__ */ jsx24("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__ */ jsx24(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx24(Check4, { className: "uf-h-4 uf-w-4" }) }) }),
|
|
4989
|
+
/* @__PURE__ */ jsx24(SelectPrimitive.ItemText, { children })
|
|
4868
4990
|
]
|
|
4869
4991
|
}
|
|
4870
4992
|
));
|
|
4871
4993
|
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
4872
|
-
var SelectSeparator = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
4994
|
+
var SelectSeparator = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
|
|
4873
4995
|
SelectPrimitive.Separator,
|
|
4874
4996
|
{
|
|
4875
4997
|
ref,
|
|
@@ -4885,8 +5007,8 @@ import {
|
|
|
4885
5007
|
getWalletByChainType as getWalletByChainType3,
|
|
4886
5008
|
getSupportedDepositTokens as getSupportedDepositTokens2
|
|
4887
5009
|
} from "@unifold/core";
|
|
4888
|
-
import { jsx as
|
|
4889
|
-
var
|
|
5010
|
+
import { jsx as jsx25, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
5011
|
+
var t4 = i18n.transferCrypto;
|
|
4890
5012
|
var getChainKey2 = (chainId, chainType) => {
|
|
4891
5013
|
return `${chainType}:${chainId}`;
|
|
4892
5014
|
};
|
|
@@ -4908,13 +5030,25 @@ function TransferCryptoDoubleInput({
|
|
|
4908
5030
|
}) {
|
|
4909
5031
|
const { themeClass, colors: colors2, fonts, components } = useTheme();
|
|
4910
5032
|
const isDarkMode = themeClass.includes("uf-dark");
|
|
4911
|
-
const [token, setToken] =
|
|
4912
|
-
const [chain, setChain] =
|
|
4913
|
-
const [copied, setCopied] =
|
|
4914
|
-
const
|
|
4915
|
-
const [
|
|
5033
|
+
const [token, setToken] = useState18("USDC");
|
|
5034
|
+
const [chain, setChain] = useState18("solana:mainnet");
|
|
5035
|
+
const [copied, setCopied] = useState18(false);
|
|
5036
|
+
const { copied: copiedRecipient, handleCopy: handleCopyRecipientAddress } = useCopyAddress();
|
|
5037
|
+
const [glossaryOpen, setGlossaryOpen] = useState18(false);
|
|
5038
|
+
const [pollCooldown, setPollCooldown] = useState18(0);
|
|
5039
|
+
const cooldownRef = useRef5(null);
|
|
5040
|
+
const [internalWallets, setInternalWallets] = useState18([]);
|
|
5041
|
+
const [loading, setLoading] = useState18(!externalWallets?.length);
|
|
5042
|
+
useEffect13(() => {
|
|
5043
|
+
return () => {
|
|
5044
|
+
if (cooldownRef.current) {
|
|
5045
|
+
clearInterval(cooldownRef.current);
|
|
5046
|
+
cooldownRef.current = null;
|
|
5047
|
+
}
|
|
5048
|
+
};
|
|
5049
|
+
}, []);
|
|
4916
5050
|
const wallets = externalWallets?.length ? externalWallets : internalWallets;
|
|
4917
|
-
const [error, setError] =
|
|
5051
|
+
const [error, setError] = useState18(null);
|
|
4918
5052
|
const { executions: depositExecutions, isPolling } = useDepositPolling({
|
|
4919
5053
|
userId,
|
|
4920
5054
|
publishableKey,
|
|
@@ -4922,13 +5056,13 @@ function TransferCryptoDoubleInput({
|
|
|
4922
5056
|
onDepositSuccess,
|
|
4923
5057
|
onDepositError
|
|
4924
5058
|
});
|
|
4925
|
-
const [supportedTokens, setSupportedTokens] =
|
|
4926
|
-
const [tokensLoading, setTokensLoading] =
|
|
4927
|
-
const [detailsExpanded, setDetailsExpanded] =
|
|
4928
|
-
const [depositsModalOpen, setDepositsModalOpen] =
|
|
5059
|
+
const [supportedTokens, setSupportedTokens] = useState18([]);
|
|
5060
|
+
const [tokensLoading, setTokensLoading] = useState18(true);
|
|
5061
|
+
const [detailsExpanded, setDetailsExpanded] = useState18(false);
|
|
5062
|
+
const [depositsModalOpen, setDepositsModalOpen] = useState18(false);
|
|
4929
5063
|
const allChainsMap = /* @__PURE__ */ new Map();
|
|
4930
|
-
supportedTokens.forEach((
|
|
4931
|
-
|
|
5064
|
+
supportedTokens.forEach((t6) => {
|
|
5065
|
+
t6.chains.forEach((c) => {
|
|
4932
5066
|
const comboKey = `${c.chain_type}:${c.chain_id}`;
|
|
4933
5067
|
if (!allChainsMap.has(comboKey)) {
|
|
4934
5068
|
allChainsMap.set(comboKey, c);
|
|
@@ -4959,8 +5093,8 @@ function TransferCryptoDoubleInput({
|
|
|
4959
5093
|
setSupportedTokens(response.data);
|
|
4960
5094
|
if (response.data.length > 0) {
|
|
4961
5095
|
const allChains = /* @__PURE__ */ new Set();
|
|
4962
|
-
response.data.forEach((
|
|
4963
|
-
|
|
5096
|
+
response.data.forEach((t6) => {
|
|
5097
|
+
t6.chains.forEach((c) => {
|
|
4964
5098
|
allChains.add(getChainKey2(c.chain_id, c.chain_type));
|
|
4965
5099
|
});
|
|
4966
5100
|
});
|
|
@@ -5050,7 +5184,7 @@ function TransferCryptoDoubleInput({
|
|
|
5050
5184
|
]);
|
|
5051
5185
|
useEffect13(() => {
|
|
5052
5186
|
if (!supportedTokens.length) return;
|
|
5053
|
-
const currentToken = supportedTokens.find((
|
|
5187
|
+
const currentToken = supportedTokens.find((t6) => t6.symbol === token);
|
|
5054
5188
|
if (!currentToken || currentToken.chains.length === 0) return;
|
|
5055
5189
|
const isChainAvailable = currentToken.chains.some((c) => {
|
|
5056
5190
|
const key = getChainKey2(c.chain_id, c.chain_type);
|
|
@@ -5062,7 +5196,7 @@ function TransferCryptoDoubleInput({
|
|
|
5062
5196
|
setChain(newChain);
|
|
5063
5197
|
}
|
|
5064
5198
|
}, [token, supportedTokens, chain]);
|
|
5065
|
-
const selectedToken = supportedTokens.find((
|
|
5199
|
+
const selectedToken = supportedTokens.find((t6) => t6.symbol === token);
|
|
5066
5200
|
const availableChainsForToken = selectedToken?.chains || [];
|
|
5067
5201
|
const currentChainFromBackend = availableChainsForToken.find((c) => {
|
|
5068
5202
|
const key = getChainKey2(c.chain_id, c.chain_type);
|
|
@@ -5078,25 +5212,25 @@ function TransferCryptoDoubleInput({
|
|
|
5078
5212
|
};
|
|
5079
5213
|
const formatProcessingTime = (seconds) => {
|
|
5080
5214
|
if (seconds === null) {
|
|
5081
|
-
return
|
|
5215
|
+
return t4.processingTime.lessThanMinutes.replace("{{minutes}}", "1");
|
|
5082
5216
|
}
|
|
5083
5217
|
const minutes = Math.ceil(seconds / 60);
|
|
5084
5218
|
if (minutes < 60) {
|
|
5085
|
-
return
|
|
5219
|
+
return t4.processingTime.lessThanMinutes.replace(
|
|
5086
5220
|
"{{minutes}}",
|
|
5087
5221
|
String(minutes)
|
|
5088
5222
|
);
|
|
5089
5223
|
}
|
|
5090
5224
|
const hours = Math.ceil(minutes / 60);
|
|
5091
|
-
return
|
|
5225
|
+
return t4.processingTime.lessThanHours.replace("{{hours}}", String(hours));
|
|
5092
5226
|
};
|
|
5093
5227
|
const priceImpact = currentChainFromBackend?.estimated_price_impact_percent ?? 0;
|
|
5094
5228
|
const maxSlippage = currentChainFromBackend?.max_slippage_percent ?? 0.25;
|
|
5095
5229
|
const processingTime = currentChainFromBackend?.estimated_processing_time ?? null;
|
|
5096
5230
|
const minDepositUsd = currentChainFromBackend?.minimum_deposit_amount_usd ?? 3;
|
|
5097
5231
|
const renderTokenItem = (tokenData) => {
|
|
5098
|
-
return /* @__PURE__ */
|
|
5099
|
-
/* @__PURE__ */
|
|
5232
|
+
return /* @__PURE__ */ jsxs19("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
5233
|
+
/* @__PURE__ */ jsx25(
|
|
5100
5234
|
"img",
|
|
5101
5235
|
{
|
|
5102
5236
|
src: tokenData.icon_url,
|
|
@@ -5106,13 +5240,13 @@ function TransferCryptoDoubleInput({
|
|
|
5106
5240
|
className: "uf-rounded-full uf-flex-shrink-0"
|
|
5107
5241
|
}
|
|
5108
5242
|
),
|
|
5109
|
-
/* @__PURE__ */
|
|
5243
|
+
/* @__PURE__ */ jsx25("span", { className: "uf-text-xs uf-font-normal", children: tokenData.symbol })
|
|
5110
5244
|
] });
|
|
5111
5245
|
};
|
|
5112
5246
|
const renderChainItem = (chainData, showMinDeposit = false) => {
|
|
5113
|
-
return /* @__PURE__ */
|
|
5114
|
-
/* @__PURE__ */
|
|
5115
|
-
/* @__PURE__ */
|
|
5247
|
+
return /* @__PURE__ */ jsxs19("div", { className: "uf-flex uf-items-center uf-justify-between uf-w-full", children: [
|
|
5248
|
+
/* @__PURE__ */ jsxs19("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
5249
|
+
/* @__PURE__ */ jsx25(
|
|
5116
5250
|
"img",
|
|
5117
5251
|
{
|
|
5118
5252
|
src: chainData.icon_url,
|
|
@@ -5122,32 +5256,32 @@ function TransferCryptoDoubleInput({
|
|
|
5122
5256
|
className: "uf-rounded-full uf-flex-shrink-0"
|
|
5123
5257
|
}
|
|
5124
5258
|
),
|
|
5125
|
-
/* @__PURE__ */
|
|
5259
|
+
/* @__PURE__ */ jsx25("span", { className: "uf-text-xs uf-font-normal", children: chainData.chain_name })
|
|
5126
5260
|
] }),
|
|
5127
|
-
showMinDeposit && chainData.minimum_deposit_amount_usd && /* @__PURE__ */
|
|
5261
|
+
showMinDeposit && chainData.minimum_deposit_amount_usd && /* @__PURE__ */ jsxs19("span", { className: "uf-text-xs uf-text-amber-400 uf-font-medium", children: [
|
|
5128
5262
|
"$",
|
|
5129
5263
|
chainData.minimum_deposit_amount_usd
|
|
5130
5264
|
] })
|
|
5131
5265
|
] });
|
|
5132
5266
|
};
|
|
5133
|
-
return /* @__PURE__ */
|
|
5267
|
+
return /* @__PURE__ */ jsx25(TooltipProvider, { delayDuration: 0, skipDelayDuration: 0, children: /* @__PURE__ */ jsxs19(
|
|
5134
5268
|
"div",
|
|
5135
5269
|
{
|
|
5136
5270
|
className: "uf-space-y-3",
|
|
5137
5271
|
style: { backgroundColor: colors2.background },
|
|
5138
5272
|
children: [
|
|
5139
|
-
/* @__PURE__ */
|
|
5140
|
-
/* @__PURE__ */
|
|
5141
|
-
/* @__PURE__ */
|
|
5142
|
-
/* @__PURE__ */
|
|
5273
|
+
/* @__PURE__ */ jsxs19("div", { className: "uf-grid uf-grid-cols-2 uf-gap-2.5", children: [
|
|
5274
|
+
/* @__PURE__ */ jsxs19("div", { children: [
|
|
5275
|
+
/* @__PURE__ */ jsx25("div", { className: "uf-text-xs uf-text-muted-foreground uf-mb-2 uf-flex uf-items-center uf-gap-1", children: t4.selectedToken }),
|
|
5276
|
+
/* @__PURE__ */ jsxs19(
|
|
5143
5277
|
Select,
|
|
5144
5278
|
{
|
|
5145
5279
|
value: token,
|
|
5146
5280
|
onValueChange: setToken,
|
|
5147
5281
|
disabled: tokensLoading || supportedTokens.length === 0,
|
|
5148
5282
|
children: [
|
|
5149
|
-
/* @__PURE__ */
|
|
5150
|
-
/* @__PURE__ */
|
|
5283
|
+
/* @__PURE__ */ jsx25(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__ */ jsx25(SelectValue, { children: tokensLoading ? /* @__PURE__ */ jsx25("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ jsx25("span", { className: "uf-text-xs uf-font-light uf-text-muted-foreground", children: t4.loading }) }) : selectedToken ? renderTokenItem(selectedToken) : /* @__PURE__ */ jsx25("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ jsx25("span", { className: "uf-text-xs uf-font-normal", children: token }) }) }) }),
|
|
5284
|
+
/* @__PURE__ */ jsx25(SelectContent, { className: "uf-bg-secondary uf-border uf-text-foreground uf-max-h-[300px]", children: supportedTokens.map((tokenData) => /* @__PURE__ */ jsx25(
|
|
5151
5285
|
SelectItem,
|
|
5152
5286
|
{
|
|
5153
5287
|
value: tokenData.symbol,
|
|
@@ -5160,56 +5294,35 @@ function TransferCryptoDoubleInput({
|
|
|
5160
5294
|
}
|
|
5161
5295
|
)
|
|
5162
5296
|
] }),
|
|
5163
|
-
/* @__PURE__ */
|
|
5164
|
-
/* @__PURE__ */
|
|
5165
|
-
|
|
5166
|
-
/* @__PURE__ */
|
|
5297
|
+
/* @__PURE__ */ jsxs19("div", { children: [
|
|
5298
|
+
/* @__PURE__ */ jsxs19("div", { className: "uf-text-xs uf-text-muted-foreground uf-mb-2 uf-flex uf-items-center uf-gap-1", children: [
|
|
5299
|
+
t4.selectedChain,
|
|
5300
|
+
/* @__PURE__ */ jsxs19("span", { className: "uf-text-amber-400 uf-font-medium", children: [
|
|
5167
5301
|
"$",
|
|
5168
5302
|
minDepositUsd,
|
|
5169
5303
|
" ",
|
|
5170
|
-
|
|
5171
|
-
] }),
|
|
5172
|
-
/* @__PURE__ */ jsxs17(Tooltip, { children: [
|
|
5173
|
-
/* @__PURE__ */ jsx22(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx22(
|
|
5174
|
-
"span",
|
|
5175
|
-
{
|
|
5176
|
-
className: "uf-inline-flex uf-cursor-pointer uf-transition-colors hover:uf-text-foreground",
|
|
5177
|
-
tabIndex: 0,
|
|
5178
|
-
role: "button",
|
|
5179
|
-
"aria-label": "Minimum deposit information",
|
|
5180
|
-
children: /* @__PURE__ */ jsx22(Info2, { className: "uf-w-4 uf-h-4" })
|
|
5181
|
-
}
|
|
5182
|
-
) }),
|
|
5183
|
-
/* @__PURE__ */ jsx22(
|
|
5184
|
-
TooltipContent,
|
|
5185
|
-
{
|
|
5186
|
-
side: "left",
|
|
5187
|
-
align: "center",
|
|
5188
|
-
className: "uf-max-w-[200px]",
|
|
5189
|
-
children: /* @__PURE__ */ jsx22("p", { children: t3.minDeposit.tooltip })
|
|
5190
|
-
}
|
|
5191
|
-
)
|
|
5304
|
+
t4.minDeposit.label
|
|
5192
5305
|
] })
|
|
5193
5306
|
] }),
|
|
5194
|
-
/* @__PURE__ */
|
|
5307
|
+
/* @__PURE__ */ jsxs19(
|
|
5195
5308
|
Select,
|
|
5196
5309
|
{
|
|
5197
5310
|
value: chain,
|
|
5198
5311
|
onValueChange: setChain,
|
|
5199
5312
|
disabled: tokensLoading || availableChainsForToken.length === 0,
|
|
5200
5313
|
children: [
|
|
5201
|
-
/* @__PURE__ */
|
|
5202
|
-
/* @__PURE__ */
|
|
5314
|
+
/* @__PURE__ */ jsx25(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__ */ jsx25(SelectValue, { children: tokensLoading ? /* @__PURE__ */ jsx25("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ jsx25("span", { className: "uf-text-xs uf-font-light uf-text-muted-foreground", children: t4.loading }) }) : currentChainFromBackend ? renderChainItem(currentChainFromBackend) : currentChainData ? renderChainItem(currentChainData) : /* @__PURE__ */ jsx25("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ jsx25("span", { className: "uf-text-xs uf-font-normal", children: chain }) }) }) }),
|
|
5315
|
+
/* @__PURE__ */ jsx25(
|
|
5203
5316
|
SelectContent,
|
|
5204
5317
|
{
|
|
5205
5318
|
align: "end",
|
|
5206
5319
|
className: "uf-bg-secondary uf-border uf-text-foreground uf-max-h-[300px] uf-min-w-[200px]",
|
|
5207
|
-
children: availableChainsForToken.length === 0 ? /* @__PURE__ */
|
|
5320
|
+
children: availableChainsForToken.length === 0 ? /* @__PURE__ */ jsx25("div", { className: "uf-px-2 uf-py-3 uf-text-xs uf-text-muted-foreground uf-text-center", children: t4.noChainsAvailable }) : availableChainsForToken.map((chainData) => {
|
|
5208
5321
|
const chainKey = getChainKey2(
|
|
5209
5322
|
chainData.chain_id,
|
|
5210
5323
|
chainData.chain_type
|
|
5211
5324
|
);
|
|
5212
|
-
return /* @__PURE__ */
|
|
5325
|
+
return /* @__PURE__ */ jsx25(
|
|
5213
5326
|
SelectItem,
|
|
5214
5327
|
{
|
|
5215
5328
|
value: chainKey,
|
|
@@ -5226,226 +5339,157 @@ function TransferCryptoDoubleInput({
|
|
|
5226
5339
|
)
|
|
5227
5340
|
] })
|
|
5228
5341
|
] }),
|
|
5229
|
-
/* @__PURE__ */
|
|
5230
|
-
"div",
|
|
5231
|
-
|
|
5232
|
-
className: "uf-flex uf-
|
|
5233
|
-
|
|
5234
|
-
|
|
5235
|
-
}
|
|
5236
|
-
) : depositAddress ? /* @__PURE__ */ jsx22(
|
|
5237
|
-
StyledQRCode,
|
|
5238
|
-
{
|
|
5239
|
-
value: depositAddress,
|
|
5240
|
-
size: 180,
|
|
5241
|
-
imageUrl: currentChainData?.icon_url || currentChainFromBackend?.icon_url,
|
|
5242
|
-
imageSize: 45,
|
|
5243
|
-
darkMode: isDarkMode
|
|
5244
|
-
},
|
|
5245
|
-
`qr-${depositAddress}-${chain}`
|
|
5246
|
-
) : /* @__PURE__ */ jsx22(
|
|
5247
|
-
"div",
|
|
5248
|
-
{
|
|
5249
|
-
className: "uf-flex uf-items-center uf-justify-center",
|
|
5250
|
-
style: { width: 180, height: 180 },
|
|
5251
|
-
children: /* @__PURE__ */ jsx22("div", { className: "uf-text-red-400 uf-text-sm", children: t3.noAddressAvailable })
|
|
5252
|
-
}
|
|
5253
|
-
) }) }),
|
|
5254
|
-
/* @__PURE__ */ jsxs17("div", { children: [
|
|
5255
|
-
/* @__PURE__ */ jsxs17("div", { className: "uf-text-xs uf-text-muted-foreground uf-mb-2 uf-flex uf-items-center uf-gap-1", children: [
|
|
5256
|
-
t3.depositAddress.label,
|
|
5257
|
-
/* @__PURE__ */ jsxs17(Tooltip, { children: [
|
|
5258
|
-
/* @__PURE__ */ jsx22(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx22(
|
|
5259
|
-
"span",
|
|
5260
|
-
{
|
|
5261
|
-
className: "uf-inline-flex uf-cursor-pointer uf-transition-colors hover:uf-text-foreground",
|
|
5262
|
-
tabIndex: 0,
|
|
5263
|
-
role: "button",
|
|
5264
|
-
"aria-label": "Deposit address information",
|
|
5265
|
-
children: /* @__PURE__ */ jsx22(Info2, { className: "uf-w-3 uf-h-3" })
|
|
5266
|
-
}
|
|
5267
|
-
) }),
|
|
5268
|
-
/* @__PURE__ */ jsx22(
|
|
5269
|
-
TooltipContent,
|
|
5270
|
-
{
|
|
5271
|
-
side: "top",
|
|
5272
|
-
align: "center",
|
|
5273
|
-
className: "uf-max-w-[240px]",
|
|
5274
|
-
children: /* @__PURE__ */ jsx22("p", { children: t3.depositAddress.tooltip.replace("{{token}}", token) })
|
|
5275
|
-
}
|
|
5276
|
-
)
|
|
5342
|
+
error && !loading && /* @__PURE__ */ jsxs19("div", { className: "uf-bg-destructive/10 uf-border uf-border-destructive/20 uf-rounded-xl uf-p-3 uf-space-y-2", children: [
|
|
5343
|
+
/* @__PURE__ */ jsxs19("div", { className: "uf-flex uf-items-start uf-gap-2", children: [
|
|
5344
|
+
/* @__PURE__ */ jsx25(Info2, { className: "uf-w-4 uf-h-4 uf-text-destructive uf-flex-shrink-0 uf-mt-0.5" }),
|
|
5345
|
+
/* @__PURE__ */ jsxs19("div", { className: "uf-flex-1 uf-min-w-0", children: [
|
|
5346
|
+
/* @__PURE__ */ jsx25("div", { className: "uf-text-xs uf-font-medium uf-text-destructive uf-mb-1", children: "Failed to create deposit address" }),
|
|
5347
|
+
/* @__PURE__ */ jsx25("div", { className: "uf-text-xs uf-text-muted-foreground", children: error })
|
|
5277
5348
|
] })
|
|
5278
5349
|
] }),
|
|
5279
|
-
|
|
5280
|
-
"
|
|
5350
|
+
/* @__PURE__ */ jsxs19("div", { className: "uf-flex uf-items-center uf-gap-1.5 uf-text-xs uf-text-muted-foreground uf-pl-6", children: [
|
|
5351
|
+
/* @__PURE__ */ jsx25(Clock3, { className: "uf-w-3 uf-h-3" }),
|
|
5352
|
+
/* @__PURE__ */ jsx25("span", { children: "Retrying automatically every 5 seconds..." })
|
|
5353
|
+
] })
|
|
5354
|
+
] }),
|
|
5355
|
+
/* @__PURE__ */ jsxs19("div", { className: "uf-flex uf-flex-col uf-items-center uf-pt-2", children: [
|
|
5356
|
+
/* @__PURE__ */ jsx25("div", { className: "uf-text-xs uf-text-muted-foreground uf-mb-2 uf-flex uf-items-center uf-gap-1", children: "Intent address" }),
|
|
5357
|
+
/* @__PURE__ */ jsx25("div", { className: "uf-rounded-2xl uf-shadow-lg uf-border uf-border-border", children: loading ? /* @__PURE__ */ jsx25(
|
|
5358
|
+
"div",
|
|
5359
|
+
{
|
|
5360
|
+
className: "uf-flex uf-items-center uf-justify-center",
|
|
5361
|
+
style: { width: 180, height: 180 },
|
|
5362
|
+
children: /* @__PURE__ */ jsx25("div", { className: "uf-text-foreground uf-text-sm", children: t4.loadingQRCode })
|
|
5363
|
+
}
|
|
5364
|
+
) : depositAddress ? /* @__PURE__ */ jsx25(
|
|
5365
|
+
StyledQRCode,
|
|
5366
|
+
{
|
|
5367
|
+
value: depositAddress,
|
|
5368
|
+
size: 180,
|
|
5369
|
+
imageUrl: currentChainData?.icon_url || currentChainFromBackend?.icon_url,
|
|
5370
|
+
imageSize: 45,
|
|
5371
|
+
darkMode: isDarkMode
|
|
5372
|
+
},
|
|
5373
|
+
`qr-${depositAddress}-${chain}`
|
|
5374
|
+
) : /* @__PURE__ */ jsx25(
|
|
5375
|
+
"div",
|
|
5376
|
+
{
|
|
5377
|
+
className: "uf-flex uf-items-center uf-justify-center",
|
|
5378
|
+
style: { width: 180, height: 180 },
|
|
5379
|
+
children: /* @__PURE__ */ jsx25("div", { className: "uf-text-red-400 uf-text-sm", children: t4.noAddressAvailable })
|
|
5380
|
+
}
|
|
5381
|
+
) })
|
|
5382
|
+
] }),
|
|
5383
|
+
/* @__PURE__ */ jsx25("div", { children: /* @__PURE__ */ jsxs19("div", { className: "uf-text-sm uf-text-muted-foreground uf-mb-2 uf-flex uf-justify-center uf-items-center uf-gap-1", children: [
|
|
5384
|
+
/* @__PURE__ */ jsx25("span", { className: "uf-text-sm uf-truncate uf-min-w-0", children: loading ? t4.loading : depositAddress ? truncateAddress(depositAddress, 8, 6) : t4.noAddressAvailable }),
|
|
5385
|
+
depositAddress && /* @__PURE__ */ jsx25(
|
|
5386
|
+
"span",
|
|
5281
5387
|
{
|
|
5282
5388
|
onClick: handleCopyAddress,
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
children: [
|
|
5286
|
-
/* @__PURE__ */ jsx22("span", { className: "uf-text-xs uf-font-mono uf-truncate uf-min-w-0", children: depositAddress ? truncateAddress(depositAddress, 18, 12) : t3.noAddressAvailable }),
|
|
5287
|
-
depositAddress && /* @__PURE__ */ jsx22(
|
|
5288
|
-
"span",
|
|
5289
|
-
{
|
|
5290
|
-
className: `uf-flex-shrink-0 uf-transition-colors ${copied ? "uf-text-green-500" : "uf-text-muted-foreground"}`,
|
|
5291
|
-
children: copied ? /* @__PURE__ */ jsx22(Check5, { className: "uf-w-3.5 uf-h-3.5" }) : /* @__PURE__ */ jsx22(Copy2, { className: "uf-w-3.5 uf-h-3.5" })
|
|
5292
|
-
}
|
|
5293
|
-
)
|
|
5294
|
-
]
|
|
5389
|
+
className: `uf-flex-shrink-0 uf-transition-colors uf-cursor-pointer ${copied ? "uf-text-green-500" : "uf-text-muted-foreground"}`,
|
|
5390
|
+
children: copied ? /* @__PURE__ */ jsx25(Check5, { className: "uf-w-3.5 uf-h-3.5" }) : /* @__PURE__ */ jsx25(Copy2, { className: "uf-w-3.5 uf-h-3.5" })
|
|
5295
5391
|
}
|
|
5296
5392
|
)
|
|
5297
|
-
] }),
|
|
5298
|
-
/* @__PURE__ */
|
|
5299
|
-
/* @__PURE__ */
|
|
5393
|
+
] }) }),
|
|
5394
|
+
/* @__PURE__ */ jsxs19("div", { className: "uf-bg-secondary uf-rounded-xl uf-px-2.5", children: [
|
|
5395
|
+
/* @__PURE__ */ jsxs19(
|
|
5300
5396
|
"button",
|
|
5301
5397
|
{
|
|
5302
5398
|
onClick: () => setDetailsExpanded(!detailsExpanded),
|
|
5303
5399
|
className: "uf-w-full uf-flex uf-items-center uf-justify-between uf-py-2.5",
|
|
5304
5400
|
children: [
|
|
5305
|
-
/* @__PURE__ */
|
|
5306
|
-
/* @__PURE__ */
|
|
5307
|
-
/* @__PURE__ */
|
|
5308
|
-
|
|
5401
|
+
/* @__PURE__ */ jsxs19("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
5402
|
+
/* @__PURE__ */ jsx25("div", { className: "uf-bg-card uf-rounded-full uf-p-1", children: /* @__PURE__ */ jsx25(Clock3, { className: "uf-w-3 uf-h-3" }) }),
|
|
5403
|
+
/* @__PURE__ */ jsxs19("span", { className: "uf-text-xs", children: [
|
|
5404
|
+
t4.processingTime.label,
|
|
5309
5405
|
":",
|
|
5310
5406
|
" ",
|
|
5311
|
-
/* @__PURE__ */
|
|
5312
|
-
priceImpact.toFixed(2),
|
|
5313
|
-
"%"
|
|
5314
|
-
] })
|
|
5315
|
-
] }),
|
|
5316
|
-
/* @__PURE__ */ jsxs17(Tooltip, { children: [
|
|
5317
|
-
/* @__PURE__ */ jsx22(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx22(
|
|
5318
|
-
"span",
|
|
5319
|
-
{
|
|
5320
|
-
className: "uf-inline-flex uf-cursor-pointer uf-text-muted-foreground uf-transition-colors hover:uf-text-foreground",
|
|
5321
|
-
onClick: (e) => e.stopPropagation(),
|
|
5322
|
-
onKeyDown: (e) => {
|
|
5323
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
5324
|
-
e.stopPropagation();
|
|
5325
|
-
}
|
|
5326
|
-
},
|
|
5327
|
-
tabIndex: 0,
|
|
5328
|
-
role: "button",
|
|
5329
|
-
"aria-label": "Price impact information",
|
|
5330
|
-
children: /* @__PURE__ */ jsx22(Info2, { className: "uf-w-3 uf-h-3" })
|
|
5331
|
-
}
|
|
5332
|
-
) }),
|
|
5333
|
-
/* @__PURE__ */ jsx22(
|
|
5334
|
-
TooltipContent,
|
|
5335
|
-
{
|
|
5336
|
-
side: "top",
|
|
5337
|
-
align: "center",
|
|
5338
|
-
className: "uf-max-w-[240px]",
|
|
5339
|
-
children: /* @__PURE__ */ jsx22("p", { children: t3.priceImpact.tooltip })
|
|
5340
|
-
}
|
|
5341
|
-
)
|
|
5407
|
+
/* @__PURE__ */ jsx25("span", { className: "uf-text-foreground", children: formatProcessingTime(processingTime) })
|
|
5342
5408
|
] })
|
|
5343
5409
|
] }),
|
|
5344
|
-
detailsExpanded ? /* @__PURE__ */
|
|
5410
|
+
detailsExpanded ? /* @__PURE__ */ jsx25(ChevronUp4, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground" }) : /* @__PURE__ */ jsx25(ChevronDown5, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground" })
|
|
5345
5411
|
]
|
|
5346
5412
|
}
|
|
5347
5413
|
),
|
|
5348
|
-
detailsExpanded && /* @__PURE__ */
|
|
5349
|
-
/* @__PURE__ */
|
|
5350
|
-
/* @__PURE__ */
|
|
5351
|
-
/* @__PURE__ */
|
|
5352
|
-
|
|
5414
|
+
detailsExpanded && /* @__PURE__ */ jsxs19("div", { className: "uf-pb-3 uf-space-y-2.5", children: [
|
|
5415
|
+
/* @__PURE__ */ jsxs19("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
5416
|
+
/* @__PURE__ */ jsx25("div", { className: "uf-bg-card uf-rounded-full uf-p-1", children: /* @__PURE__ */ jsx25(ShieldCheck2, { className: "uf-w-3 uf-h-3" }) }),
|
|
5417
|
+
/* @__PURE__ */ jsxs19("span", { className: "uf-text-xs", children: [
|
|
5418
|
+
t4.slippage.label,
|
|
5353
5419
|
":",
|
|
5354
5420
|
" ",
|
|
5355
|
-
/* @__PURE__ */
|
|
5356
|
-
|
|
5421
|
+
/* @__PURE__ */ jsxs19("span", { className: "uf-text-foreground", children: [
|
|
5422
|
+
t4.slippage.auto,
|
|
5357
5423
|
" \u2022 ",
|
|
5358
5424
|
maxSlippage.toFixed(2),
|
|
5359
5425
|
"%"
|
|
5360
5426
|
] })
|
|
5361
|
-
] }),
|
|
5362
|
-
/* @__PURE__ */ jsxs17(Tooltip, { children: [
|
|
5363
|
-
/* @__PURE__ */ jsx22(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx22(
|
|
5364
|
-
"span",
|
|
5365
|
-
{
|
|
5366
|
-
className: "uf-inline-flex uf-cursor-pointer uf-text-muted-foreground uf-transition-colors hover:uf-text-foreground",
|
|
5367
|
-
tabIndex: 0,
|
|
5368
|
-
role: "button",
|
|
5369
|
-
"aria-label": "Slippage information",
|
|
5370
|
-
children: /* @__PURE__ */ jsx22(Info2, { className: "uf-w-3 uf-h-3" })
|
|
5371
|
-
}
|
|
5372
|
-
) }),
|
|
5373
|
-
/* @__PURE__ */ jsx22(
|
|
5374
|
-
TooltipContent,
|
|
5375
|
-
{
|
|
5376
|
-
side: "top",
|
|
5377
|
-
align: "center",
|
|
5378
|
-
className: "uf-max-w-[240px]",
|
|
5379
|
-
children: /* @__PURE__ */ jsx22("p", { children: t3.slippage.tooltip })
|
|
5380
|
-
}
|
|
5381
|
-
)
|
|
5382
5427
|
] })
|
|
5383
5428
|
] }),
|
|
5384
|
-
/* @__PURE__ */
|
|
5385
|
-
/* @__PURE__ */
|
|
5386
|
-
/* @__PURE__ */
|
|
5387
|
-
|
|
5429
|
+
/* @__PURE__ */ jsxs19("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
5430
|
+
/* @__PURE__ */ jsx25("div", { className: "uf-bg-card uf-rounded-full uf-p-1", children: /* @__PURE__ */ jsx25(DollarSign2, { className: "uf-w-3 uf-h-3" }) }),
|
|
5431
|
+
/* @__PURE__ */ jsxs19("span", { className: "uf-text-xs", children: [
|
|
5432
|
+
t4.priceImpact.label,
|
|
5388
5433
|
":",
|
|
5389
5434
|
" ",
|
|
5390
|
-
/* @__PURE__ */
|
|
5391
|
-
|
|
5392
|
-
|
|
5393
|
-
|
|
5394
|
-
/* @__PURE__ */ jsx22("div", { className: "uf-bg-card uf-rounded-full uf-p-1", children: /* @__PURE__ */ jsx22(HelpCircle2, { className: "uf-w-3 uf-h-3" }) }),
|
|
5395
|
-
/* @__PURE__ */ jsxs17("span", { className: "uf-text-xs", children: [
|
|
5396
|
-
t3.help.needHelp,
|
|
5397
|
-
" ",
|
|
5398
|
-
/* @__PURE__ */ jsx22(
|
|
5399
|
-
"a",
|
|
5400
|
-
{
|
|
5401
|
-
href: "https://unifold.io/support",
|
|
5402
|
-
className: "uf-text-foreground uf-underline hover:uf-text-muted-foreground uf-transition-colors",
|
|
5403
|
-
children: t3.help.contactSupport
|
|
5404
|
-
}
|
|
5405
|
-
)
|
|
5435
|
+
/* @__PURE__ */ jsxs19("span", { className: "uf-text-foreground", children: [
|
|
5436
|
+
priceImpact.toFixed(2),
|
|
5437
|
+
"%"
|
|
5438
|
+
] })
|
|
5406
5439
|
] })
|
|
5407
5440
|
] }),
|
|
5408
|
-
/* @__PURE__ */
|
|
5409
|
-
/* @__PURE__ */
|
|
5410
|
-
/* @__PURE__ */
|
|
5411
|
-
|
|
5412
|
-
":",
|
|
5441
|
+
/* @__PURE__ */ jsxs19("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
5442
|
+
/* @__PURE__ */ jsx25("div", { className: "uf-bg-card uf-rounded-full uf-p-1", children: /* @__PURE__ */ jsx25(Wallet22, { className: "uf-w-3 uf-h-3" }) }),
|
|
5443
|
+
/* @__PURE__ */ jsxs19("span", { className: "uf-flex uf-gap-2 uf-text-xs", children: [
|
|
5444
|
+
"Recipient address:",
|
|
5413
5445
|
" ",
|
|
5414
|
-
/* @__PURE__ */
|
|
5415
|
-
|
|
5446
|
+
/* @__PURE__ */ jsx25("span", { className: "uf-text-foreground", children: truncateAddress(recipientAddress || "", 8, 6) }),
|
|
5447
|
+
/* @__PURE__ */ jsx25(
|
|
5448
|
+
"span",
|
|
5416
5449
|
{
|
|
5417
|
-
|
|
5418
|
-
className:
|
|
5419
|
-
|
|
5420
|
-
children: t3.terms.seeTerms
|
|
5450
|
+
onClick: () => handleCopyRecipientAddress(recipientAddress),
|
|
5451
|
+
className: `uf-flex-shrink-0 uf-transition-colors uf-cursor-pointer ${copiedRecipient ? "uf-text-green-500" : "uf-text-muted-foreground"}`,
|
|
5452
|
+
children: copiedRecipient ? /* @__PURE__ */ jsx25(Check5, { className: "uf-w-3.5 uf-h-3.5" }) : /* @__PURE__ */ jsx25(Copy2, { className: "uf-w-3.5 uf-h-3.5" })
|
|
5421
5453
|
}
|
|
5422
5454
|
)
|
|
5423
5455
|
] })
|
|
5424
5456
|
] })
|
|
5425
5457
|
] })
|
|
5426
5458
|
] }),
|
|
5427
|
-
|
|
5459
|
+
/* @__PURE__ */ jsx25(
|
|
5460
|
+
PollCooldownButton,
|
|
5461
|
+
{
|
|
5462
|
+
currentWalletId: currentWallet?.id,
|
|
5463
|
+
pollCooldown,
|
|
5464
|
+
publishableKey,
|
|
5465
|
+
onCooldownChange: setPollCooldown,
|
|
5466
|
+
cooldownRef,
|
|
5467
|
+
buttonText: "Check again"
|
|
5468
|
+
}
|
|
5469
|
+
),
|
|
5470
|
+
/* @__PURE__ */ jsx25(DepositFooterLinks, { onGlossaryClick: () => setGlossaryOpen(true) }),
|
|
5471
|
+
depositExecutions.length > 1 && /* @__PURE__ */ jsx25("div", { className: "uf-flex uf-items-center uf-justify-end uf-text-xs uf-pt-2", children: /* @__PURE__ */ jsxs19(
|
|
5428
5472
|
"button",
|
|
5429
5473
|
{
|
|
5430
5474
|
onClick: () => setDepositsModalOpen(true),
|
|
5431
5475
|
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",
|
|
5432
5476
|
children: [
|
|
5433
|
-
/* @__PURE__ */
|
|
5477
|
+
/* @__PURE__ */ jsx25(Clock3, { className: "uf-w-3.5 uf-h-3.5" }),
|
|
5434
5478
|
"Track deposits (",
|
|
5435
5479
|
depositExecutions.length,
|
|
5436
5480
|
")",
|
|
5437
|
-
/* @__PURE__ */
|
|
5481
|
+
/* @__PURE__ */ jsx25(ChevronRight7, { className: "uf-w-3 uf-h-3" })
|
|
5438
5482
|
]
|
|
5439
5483
|
}
|
|
5440
5484
|
) }),
|
|
5441
|
-
/* @__PURE__ */
|
|
5485
|
+
/* @__PURE__ */ jsx25(
|
|
5442
5486
|
DepositPollingToasts,
|
|
5443
5487
|
{
|
|
5444
5488
|
executions: depositExecutions,
|
|
5445
5489
|
isPolling
|
|
5446
5490
|
}
|
|
5447
5491
|
),
|
|
5448
|
-
/* @__PURE__ */
|
|
5492
|
+
/* @__PURE__ */ jsx25(
|
|
5449
5493
|
DepositsModal,
|
|
5450
5494
|
{
|
|
5451
5495
|
open: depositsModalOpen,
|
|
@@ -5455,6 +5499,15 @@ function TransferCryptoDoubleInput({
|
|
|
5455
5499
|
publishableKey,
|
|
5456
5500
|
themeClass
|
|
5457
5501
|
}
|
|
5502
|
+
),
|
|
5503
|
+
/* @__PURE__ */ jsx25(
|
|
5504
|
+
GlossaryModal,
|
|
5505
|
+
{
|
|
5506
|
+
open: glossaryOpen,
|
|
5507
|
+
onOpenChange: setGlossaryOpen,
|
|
5508
|
+
themeClass,
|
|
5509
|
+
colors: colors2
|
|
5510
|
+
}
|
|
5458
5511
|
)
|
|
5459
5512
|
]
|
|
5460
5513
|
}
|
|
@@ -5462,31 +5515,31 @@ function TransferCryptoDoubleInput({
|
|
|
5462
5515
|
}
|
|
5463
5516
|
|
|
5464
5517
|
// src/components/deposits/DepositModal.tsx
|
|
5465
|
-
import { Fragment as Fragment5, jsx as
|
|
5518
|
+
import { Fragment as Fragment5, jsx as jsx26, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
5466
5519
|
function SkeletonButton({
|
|
5467
5520
|
variant = "default"
|
|
5468
5521
|
}) {
|
|
5469
|
-
return /* @__PURE__ */
|
|
5470
|
-
/* @__PURE__ */
|
|
5471
|
-
/* @__PURE__ */
|
|
5472
|
-
/* @__PURE__ */
|
|
5473
|
-
/* @__PURE__ */
|
|
5474
|
-
/* @__PURE__ */
|
|
5522
|
+
return /* @__PURE__ */ jsxs20("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: [
|
|
5523
|
+
/* @__PURE__ */ jsxs20("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
5524
|
+
/* @__PURE__ */ jsx26("div", { className: "uf-bg-muted uf-rounded-lg uf-w-9 uf-h-9" }),
|
|
5525
|
+
/* @__PURE__ */ jsxs20("div", { className: "uf-space-y-1.5", children: [
|
|
5526
|
+
/* @__PURE__ */ jsx26("div", { className: "uf-h-3.5 uf-w-24 uf-bg-muted uf-rounded" }),
|
|
5527
|
+
/* @__PURE__ */ jsx26("div", { className: "uf-h-3 uf-w-32 uf-bg-muted uf-rounded" })
|
|
5475
5528
|
] })
|
|
5476
5529
|
] }),
|
|
5477
|
-
/* @__PURE__ */
|
|
5478
|
-
variant === "with-icons" && /* @__PURE__ */
|
|
5530
|
+
/* @__PURE__ */ jsxs20("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
5531
|
+
variant === "with-icons" && /* @__PURE__ */ jsx26("div", { className: "uf-flex uf--space-x-1", children: [1, 2, 3].map((i) => /* @__PURE__ */ jsx26(
|
|
5479
5532
|
"div",
|
|
5480
5533
|
{
|
|
5481
5534
|
className: "uf-w-5 uf-h-5 uf-rounded-full uf-bg-muted uf-border-2 uf-border-secondary"
|
|
5482
5535
|
},
|
|
5483
5536
|
i
|
|
5484
5537
|
)) }),
|
|
5485
|
-
/* @__PURE__ */
|
|
5538
|
+
/* @__PURE__ */ jsx26(ChevronRight8, { className: "uf-w-4 uf-h-4 uf-text-muted" })
|
|
5486
5539
|
] })
|
|
5487
5540
|
] });
|
|
5488
5541
|
}
|
|
5489
|
-
var
|
|
5542
|
+
var t5 = i18n.depositModal;
|
|
5490
5543
|
function DepositModal({
|
|
5491
5544
|
open,
|
|
5492
5545
|
onOpenChange,
|
|
@@ -5506,16 +5559,16 @@ function DepositModal({
|
|
|
5506
5559
|
theme = "dark"
|
|
5507
5560
|
}) {
|
|
5508
5561
|
const { colors: colors2, fonts } = useTheme();
|
|
5509
|
-
const [view, setView] =
|
|
5510
|
-
const [cardView, setCardView] =
|
|
5562
|
+
const [view, setView] = useState19("main");
|
|
5563
|
+
const [cardView, setCardView] = useState19(
|
|
5511
5564
|
"amount"
|
|
5512
5565
|
);
|
|
5513
|
-
const [quotesCount, setQuotesCount] =
|
|
5514
|
-
const [depositsModalOpen, setDepositsModalOpen] =
|
|
5515
|
-
const [depositExecutions, setDepositExecutions] =
|
|
5516
|
-
const [projectConfig, setProjectConfig] =
|
|
5517
|
-
const [wallets, setWallets] =
|
|
5518
|
-
const [walletsLoading, setWalletsLoading] =
|
|
5566
|
+
const [quotesCount, setQuotesCount] = useState19(0);
|
|
5567
|
+
const [depositsModalOpen, setDepositsModalOpen] = useState19(false);
|
|
5568
|
+
const [depositExecutions, setDepositExecutions] = useState19([]);
|
|
5569
|
+
const [projectConfig, setProjectConfig] = useState19(null);
|
|
5570
|
+
const [wallets, setWallets] = useState19([]);
|
|
5571
|
+
const [walletsLoading, setWalletsLoading] = useState19(false);
|
|
5519
5572
|
useEffect14(() => {
|
|
5520
5573
|
setProjectConfig(null);
|
|
5521
5574
|
}, [publishableKey]);
|
|
@@ -5529,7 +5582,7 @@ function DepositModal({
|
|
|
5529
5582
|
destinationTokenAddress,
|
|
5530
5583
|
publishableKey
|
|
5531
5584
|
]);
|
|
5532
|
-
const [resolvedTheme, setResolvedTheme] =
|
|
5585
|
+
const [resolvedTheme, setResolvedTheme] = useState19(
|
|
5533
5586
|
theme === "auto" ? "dark" : theme
|
|
5534
5587
|
);
|
|
5535
5588
|
useEffect14(() => {
|
|
@@ -5648,16 +5701,16 @@ function DepositModal({
|
|
|
5648
5701
|
setQuotesCount(count);
|
|
5649
5702
|
}
|
|
5650
5703
|
};
|
|
5651
|
-
return /* @__PURE__ */
|
|
5652
|
-
/* @__PURE__ */
|
|
5704
|
+
return /* @__PURE__ */ jsxs20(Dialog, { open, onOpenChange: handleClose, children: [
|
|
5705
|
+
/* @__PURE__ */ jsx26(
|
|
5653
5706
|
DialogContent,
|
|
5654
5707
|
{
|
|
5655
5708
|
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}`,
|
|
5656
5709
|
style: { backgroundColor: colors2.background },
|
|
5657
5710
|
onPointerDownOutside: (e) => e.preventDefault(),
|
|
5658
5711
|
onInteractOutside: (e) => e.preventDefault(),
|
|
5659
|
-
children: /* @__PURE__ */
|
|
5660
|
-
/* @__PURE__ */
|
|
5712
|
+
children: /* @__PURE__ */ jsx26(ThemeStyleInjector, { children: view === "main" ? /* @__PURE__ */ jsxs20(Fragment5, { children: [
|
|
5713
|
+
/* @__PURE__ */ jsx26(
|
|
5661
5714
|
DepositHeader,
|
|
5662
5715
|
{
|
|
5663
5716
|
title: modalTitle || "Deposit",
|
|
@@ -5670,56 +5723,56 @@ function DepositModal({
|
|
|
5670
5723
|
publishableKey
|
|
5671
5724
|
}
|
|
5672
5725
|
),
|
|
5673
|
-
/* @__PURE__ */
|
|
5674
|
-
/* @__PURE__ */
|
|
5675
|
-
/* @__PURE__ */
|
|
5676
|
-
!hideDepositTracker && /* @__PURE__ */
|
|
5726
|
+
/* @__PURE__ */ jsx26("div", { className: "uf-pb-4 uf-space-y-3", children: isCountryLoading || isAddressValidationLoading || !projectConfig ? /* @__PURE__ */ jsxs20(Fragment5, { children: [
|
|
5727
|
+
/* @__PURE__ */ jsx26(SkeletonButton, { variant: "with-icons" }),
|
|
5728
|
+
/* @__PURE__ */ jsx26(SkeletonButton, { variant: "with-icons" }),
|
|
5729
|
+
!hideDepositTracker && /* @__PURE__ */ jsx26(SkeletonButton, {})
|
|
5677
5730
|
] }) : countryError ? (
|
|
5678
5731
|
/* Error state - couldn't verify location */
|
|
5679
|
-
/* @__PURE__ */
|
|
5680
|
-
/* @__PURE__ */
|
|
5681
|
-
/* @__PURE__ */
|
|
5682
|
-
/* @__PURE__ */
|
|
5732
|
+
/* @__PURE__ */ jsxs20("div", { className: "uf-flex uf-flex-col uf-items-center uf-justify-center uf-py-8 uf-px-4 uf-text-center", children: [
|
|
5733
|
+
/* @__PURE__ */ jsx26("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__ */ jsx26(AlertTriangle, { className: "uf-w-8 uf-h-8 uf-text-muted-foreground" }) }),
|
|
5734
|
+
/* @__PURE__ */ jsx26("h3", { className: "uf-text-lg uf-font-semibold uf-text-foreground uf-mb-2", children: "Unable to Verify Location" }),
|
|
5735
|
+
/* @__PURE__ */ jsx26("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." })
|
|
5683
5736
|
] })
|
|
5684
5737
|
) : !isAllowed ? (
|
|
5685
5738
|
/* Blocked country state (isAllowed is false or null without error) */
|
|
5686
|
-
/* @__PURE__ */
|
|
5687
|
-
/* @__PURE__ */
|
|
5688
|
-
/* @__PURE__ */
|
|
5689
|
-
/* @__PURE__ */
|
|
5739
|
+
/* @__PURE__ */ jsxs20("div", { className: "uf-flex uf-flex-col uf-items-center uf-justify-center uf-py-8 uf-px-4 uf-text-center", children: [
|
|
5740
|
+
/* @__PURE__ */ jsx26("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__ */ jsx26(MapPinOff, { className: "uf-w-8 uf-h-8 uf-text-muted-foreground" }) }),
|
|
5741
|
+
/* @__PURE__ */ jsx26("h3", { className: "uf-text-lg uf-font-semibold uf-text-foreground uf-mb-2", children: "No Tokens Available" }),
|
|
5742
|
+
/* @__PURE__ */ jsx26("p", { className: "uf-text-sm uf-text-muted-foreground uf-max-w-[280px]", children: "There are no supported tokens available from your current location." })
|
|
5690
5743
|
] })
|
|
5691
5744
|
) : isAddressValid === false ? (
|
|
5692
5745
|
/* Invalid recipient address state (e.g., Algorand not opted in) */
|
|
5693
|
-
/* @__PURE__ */
|
|
5694
|
-
/* @__PURE__ */
|
|
5695
|
-
/* @__PURE__ */
|
|
5696
|
-
/* @__PURE__ */
|
|
5746
|
+
/* @__PURE__ */ jsxs20("div", { className: "uf-flex uf-flex-col uf-items-center uf-justify-center uf-py-8 uf-px-4 uf-text-center", children: [
|
|
5747
|
+
/* @__PURE__ */ jsx26("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__ */ jsx26(AlertTriangle, { className: "uf-w-8 uf-h-8 uf-text-muted-foreground" }) }),
|
|
5748
|
+
/* @__PURE__ */ jsx26("h3", { className: "uf-text-lg uf-font-semibold uf-text-foreground uf-mb-2", children: addressValidationMessages.unableToReceiveFunds }),
|
|
5749
|
+
/* @__PURE__ */ jsx26("p", { className: "uf-text-sm uf-text-muted-foreground uf-max-w-[280px]", children: getAddressValidationErrorMessage(
|
|
5697
5750
|
addressFailureCode,
|
|
5698
5751
|
addressFailureMetadata
|
|
5699
5752
|
) })
|
|
5700
5753
|
] })
|
|
5701
5754
|
) : (
|
|
5702
5755
|
/* Normal deposit options */
|
|
5703
|
-
/* @__PURE__ */
|
|
5704
|
-
/* @__PURE__ */
|
|
5756
|
+
/* @__PURE__ */ jsxs20(Fragment5, { children: [
|
|
5757
|
+
/* @__PURE__ */ jsx26(
|
|
5705
5758
|
TransferCryptoButton,
|
|
5706
5759
|
{
|
|
5707
5760
|
onClick: () => setView("transfer"),
|
|
5708
|
-
title:
|
|
5709
|
-
subtitle:
|
|
5761
|
+
title: t5.transferCrypto.title,
|
|
5762
|
+
subtitle: t5.transferCrypto.subtitle,
|
|
5710
5763
|
featuredTokens: projectConfig.transfer_crypto.networks
|
|
5711
5764
|
}
|
|
5712
5765
|
),
|
|
5713
|
-
/* @__PURE__ */
|
|
5766
|
+
/* @__PURE__ */ jsx26(
|
|
5714
5767
|
DepositWithCardButton,
|
|
5715
5768
|
{
|
|
5716
5769
|
onClick: () => setView("card"),
|
|
5717
|
-
title:
|
|
5718
|
-
subtitle:
|
|
5770
|
+
title: t5.depositWithCard.title,
|
|
5771
|
+
subtitle: t5.depositWithCard.subtitle,
|
|
5719
5772
|
paymentNetworks: projectConfig.payment_networks.networks
|
|
5720
5773
|
}
|
|
5721
5774
|
),
|
|
5722
|
-
!hideDepositTracker && /* @__PURE__ */
|
|
5775
|
+
!hideDepositTracker && /* @__PURE__ */ jsx26(
|
|
5723
5776
|
DepositTrackerButton,
|
|
5724
5777
|
{
|
|
5725
5778
|
onClick: () => setDepositsModalOpen(true),
|
|
@@ -5730,17 +5783,17 @@ function DepositModal({
|
|
|
5730
5783
|
)
|
|
5731
5784
|
] })
|
|
5732
5785
|
) })
|
|
5733
|
-
] }) : view === "transfer" ? /* @__PURE__ */
|
|
5734
|
-
/* @__PURE__ */
|
|
5786
|
+
] }) : view === "transfer" ? /* @__PURE__ */ jsxs20(Fragment5, { children: [
|
|
5787
|
+
/* @__PURE__ */ jsx26(
|
|
5735
5788
|
DepositHeader,
|
|
5736
5789
|
{
|
|
5737
|
-
title:
|
|
5790
|
+
title: t5.transferCrypto.title,
|
|
5738
5791
|
showBack: true,
|
|
5739
5792
|
onBack: handleBack,
|
|
5740
5793
|
onClose: handleClose
|
|
5741
5794
|
}
|
|
5742
5795
|
),
|
|
5743
|
-
transferInputVariant === "single_input" ? /* @__PURE__ */
|
|
5796
|
+
transferInputVariant === "single_input" ? /* @__PURE__ */ jsx26(
|
|
5744
5797
|
TransferCryptoSingleInput,
|
|
5745
5798
|
{
|
|
5746
5799
|
userId,
|
|
@@ -5754,7 +5807,7 @@ function DepositModal({
|
|
|
5754
5807
|
onDepositError,
|
|
5755
5808
|
wallets
|
|
5756
5809
|
}
|
|
5757
|
-
) : /* @__PURE__ */
|
|
5810
|
+
) : /* @__PURE__ */ jsx26(
|
|
5758
5811
|
TransferCryptoDoubleInput,
|
|
5759
5812
|
{
|
|
5760
5813
|
userId,
|
|
@@ -5769,18 +5822,18 @@ function DepositModal({
|
|
|
5769
5822
|
wallets
|
|
5770
5823
|
}
|
|
5771
5824
|
)
|
|
5772
|
-
] }) : /* @__PURE__ */
|
|
5773
|
-
/* @__PURE__ */
|
|
5825
|
+
] }) : /* @__PURE__ */ jsxs20(Fragment5, { children: [
|
|
5826
|
+
/* @__PURE__ */ jsx26(
|
|
5774
5827
|
DepositHeader,
|
|
5775
5828
|
{
|
|
5776
|
-
title: cardView === "quotes" ?
|
|
5829
|
+
title: cardView === "quotes" ? t5.quotes : t5.depositWithCard.title,
|
|
5777
5830
|
showBack: true,
|
|
5778
5831
|
onBack: handleBack,
|
|
5779
5832
|
onClose: handleClose,
|
|
5780
5833
|
badge: cardView === "quotes" ? { count: quotesCount } : void 0
|
|
5781
5834
|
}
|
|
5782
5835
|
),
|
|
5783
|
-
/* @__PURE__ */
|
|
5836
|
+
/* @__PURE__ */ jsx26(
|
|
5784
5837
|
BuyWithCard,
|
|
5785
5838
|
{
|
|
5786
5839
|
userId,
|
|
@@ -5802,7 +5855,7 @@ function DepositModal({
|
|
|
5802
5855
|
] }) })
|
|
5803
5856
|
}
|
|
5804
5857
|
),
|
|
5805
|
-
/* @__PURE__ */
|
|
5858
|
+
/* @__PURE__ */ jsx26(
|
|
5806
5859
|
DepositsModal,
|
|
5807
5860
|
{
|
|
5808
5861
|
open: depositsModalOpen,
|
|
@@ -5821,7 +5874,7 @@ function DepositModal({
|
|
|
5821
5874
|
import * as React10 from "react";
|
|
5822
5875
|
import { Slot } from "@radix-ui/react-slot";
|
|
5823
5876
|
import { cva } from "class-variance-authority";
|
|
5824
|
-
import { jsx as
|
|
5877
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
5825
5878
|
var buttonVariants = cva(
|
|
5826
5879
|
"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",
|
|
5827
5880
|
{
|
|
@@ -5865,7 +5918,7 @@ var Button = React10.forwardRef(
|
|
|
5865
5918
|
}
|
|
5866
5919
|
return baseStyle;
|
|
5867
5920
|
}, [variant, components, fonts, style]);
|
|
5868
|
-
return /* @__PURE__ */
|
|
5921
|
+
return /* @__PURE__ */ jsx27(
|
|
5869
5922
|
Comp,
|
|
5870
5923
|
{
|
|
5871
5924
|
className: cn(buttonVariants({ variant, size, className })),
|