@unifold/ui-react 0.1.8 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.d.mts +11 -330
- package/dist/index.d.ts +11 -330
- package/dist/index.js +775 -893
- package/dist/index.mjs +727 -812
- package/dist/styles.css +1 -1
- package/package.json +3 -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 useState7, useEffect as useEffect6 } from "react";
|
|
3
3
|
import { ChevronRight as ChevronRight7 } from "lucide-react";
|
|
4
4
|
|
|
5
5
|
// src/components/shared/dialog.tsx
|
|
@@ -140,12 +140,11 @@ var DialogDescription = React2.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
140
140
|
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
141
141
|
|
|
142
142
|
// src/components/deposits/TransferCryptoBase.tsx
|
|
143
|
-
import { useState as
|
|
143
|
+
import { useState as useState4, useEffect as useEffect4 } from "react";
|
|
144
144
|
import {
|
|
145
|
-
ChevronDown as
|
|
146
|
-
ChevronUp as
|
|
145
|
+
ChevronDown as ChevronDown3,
|
|
146
|
+
ChevronUp as ChevronUp3,
|
|
147
147
|
Info,
|
|
148
|
-
Copy,
|
|
149
148
|
Check as Check2,
|
|
150
149
|
DollarSign,
|
|
151
150
|
ShieldCheck,
|
|
@@ -248,7 +247,7 @@ function StyledQRCode({
|
|
|
248
247
|
}
|
|
249
248
|
|
|
250
249
|
// src/components/deposits/DepositsModal.tsx
|
|
251
|
-
import { useEffect as
|
|
250
|
+
import { useEffect as useEffect3, useState as useState2 } from "react";
|
|
252
251
|
|
|
253
252
|
// src/components/deposits/DepositHeader.tsx
|
|
254
253
|
import { ArrowLeft, X as X2 } from "lucide-react";
|
|
@@ -287,204 +286,13 @@ function DepositHeader({
|
|
|
287
286
|
|
|
288
287
|
// src/components/deposits/DepositExecutionItem.tsx
|
|
289
288
|
import { ChevronRight } from "lucide-react";
|
|
290
|
-
|
|
291
|
-
// src/lib/api.ts
|
|
292
|
-
var API_BASE_URL = process.env.NEXT_PUBLIC_API_BASE_URL || "https://api.unifold.io";
|
|
293
|
-
var DEFAULT_PUBLISHABLE_KEY = "pk_test_123";
|
|
294
|
-
var DEFAULT_CONFIG = {};
|
|
295
|
-
function setApiConfig(config) {
|
|
296
|
-
if (config.baseUrl) {
|
|
297
|
-
API_BASE_URL = config.baseUrl;
|
|
298
|
-
}
|
|
299
|
-
if (config.publishableKey) {
|
|
300
|
-
DEFAULT_PUBLISHABLE_KEY = config.publishableKey;
|
|
301
|
-
}
|
|
302
|
-
if (config.defaultConfig) {
|
|
303
|
-
DEFAULT_CONFIG = config.defaultConfig;
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
function getApiBaseUrl() {
|
|
307
|
-
return API_BASE_URL;
|
|
308
|
-
}
|
|
309
|
-
function getIconUrl(iconPath) {
|
|
310
|
-
const normalizedPath = iconPath.startsWith("/") ? iconPath : `/${iconPath}`;
|
|
311
|
-
return `${API_BASE_URL}/api/public${normalizedPath}`;
|
|
312
|
-
}
|
|
313
|
-
function getIconUrlWithCdn(iconPath, assetCdnUrl) {
|
|
314
|
-
if (!assetCdnUrl) {
|
|
315
|
-
return getIconUrl(iconPath);
|
|
316
|
-
}
|
|
317
|
-
const normalizedPath = iconPath.startsWith("/") ? iconPath : `/${iconPath}`;
|
|
318
|
-
const baseUrl = assetCdnUrl.endsWith("/") ? assetCdnUrl.slice(0, -1) : assetCdnUrl;
|
|
319
|
-
return `${baseUrl}/api/public${normalizedPath}`;
|
|
320
|
-
}
|
|
321
|
-
async function createEOA(overrides, publishableKey) {
|
|
322
|
-
if (!overrides?.user_id) {
|
|
323
|
-
throw new Error("user_id is required");
|
|
324
|
-
}
|
|
325
|
-
const payload = {
|
|
326
|
-
user_id: overrides.user_id,
|
|
327
|
-
destination_chain_type: overrides?.destination_chain_type || "ethereum",
|
|
328
|
-
destination_chain_id: overrides?.destination_chain_id || DEFAULT_CONFIG.destinationChainId || "8453",
|
|
329
|
-
destination_token_address: overrides?.destination_token_address || DEFAULT_CONFIG.destinationTokenAddress || "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
|
|
330
|
-
recipient_address: overrides?.recipient_address || DEFAULT_CONFIG.recipientAddress || "0x309a4154a2CD4153Da886E780890C9cb5161553C",
|
|
331
|
-
client_metadata: overrides?.client_metadata || {}
|
|
332
|
-
};
|
|
333
|
-
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
334
|
-
const response = await fetch(`${API_BASE_URL}/v1/public/deposit_addresses`, {
|
|
335
|
-
method: "POST",
|
|
336
|
-
headers: {
|
|
337
|
-
accept: "application/json",
|
|
338
|
-
"x-publishable-key": pk,
|
|
339
|
-
"Content-Type": "application/json"
|
|
340
|
-
},
|
|
341
|
-
body: JSON.stringify(payload)
|
|
342
|
-
});
|
|
343
|
-
if (!response.ok) {
|
|
344
|
-
throw new Error(`Failed to create EOA: ${response.statusText}`);
|
|
345
|
-
}
|
|
346
|
-
return response.json();
|
|
347
|
-
}
|
|
348
|
-
function getWalletByChainType(wallets, chainType) {
|
|
349
|
-
return wallets.find((wallet) => wallet.chain_type === chainType);
|
|
350
|
-
}
|
|
351
|
-
var ExecutionStatus = /* @__PURE__ */ ((ExecutionStatus2) => {
|
|
352
|
-
ExecutionStatus2["DELAYED"] = "delayed";
|
|
353
|
-
ExecutionStatus2["FAILED"] = "failed";
|
|
354
|
-
ExecutionStatus2["PENDING"] = "pending";
|
|
355
|
-
ExecutionStatus2["REFUNDED"] = "refunded";
|
|
356
|
-
ExecutionStatus2["SUCCEEDED"] = "succeeded";
|
|
357
|
-
ExecutionStatus2["WAITING"] = "waiting";
|
|
358
|
-
return ExecutionStatus2;
|
|
359
|
-
})(ExecutionStatus || {});
|
|
360
|
-
var SOLANA_USDC_ADDRESS = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";
|
|
361
|
-
async function queryExecutions(externalUserId, publishableKey) {
|
|
362
|
-
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
363
|
-
const response = await fetch(
|
|
364
|
-
`${API_BASE_URL}/v1/public/direct_executions/query`,
|
|
365
|
-
{
|
|
366
|
-
method: "POST",
|
|
367
|
-
headers: {
|
|
368
|
-
accept: "application/json",
|
|
369
|
-
"x-publishable-key": pk,
|
|
370
|
-
"Content-Type": "application/json"
|
|
371
|
-
},
|
|
372
|
-
body: JSON.stringify({
|
|
373
|
-
external_user_id: externalUserId
|
|
374
|
-
})
|
|
375
|
-
}
|
|
376
|
-
);
|
|
377
|
-
if (!response.ok) {
|
|
378
|
-
throw new Error(`Failed to query executions: ${response.statusText}`);
|
|
379
|
-
}
|
|
380
|
-
return response.json();
|
|
381
|
-
}
|
|
382
|
-
async function getSupportedDepositTokens(publishableKey) {
|
|
383
|
-
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
384
|
-
const response = await fetch(
|
|
385
|
-
`${API_BASE_URL}/v1/public/tokens/supported_deposit_tokens`,
|
|
386
|
-
{
|
|
387
|
-
method: "GET",
|
|
388
|
-
headers: {
|
|
389
|
-
accept: "application/json",
|
|
390
|
-
"x-publishable-key": pk
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
);
|
|
394
|
-
if (!response.ok) {
|
|
395
|
-
throw new Error(
|
|
396
|
-
`Failed to fetch supported deposit tokens: ${response.statusText}`
|
|
397
|
-
);
|
|
398
|
-
}
|
|
399
|
-
return response.json();
|
|
400
|
-
}
|
|
401
|
-
async function getMeldQuotes(request, publishableKey) {
|
|
402
|
-
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
403
|
-
const response = await fetch(
|
|
404
|
-
`${API_BASE_URL}/v1/public/onramps/meld/quotes`,
|
|
405
|
-
{
|
|
406
|
-
method: "POST",
|
|
407
|
-
headers: {
|
|
408
|
-
accept: "application/json",
|
|
409
|
-
"x-publishable-key": pk,
|
|
410
|
-
"Content-Type": "application/json"
|
|
411
|
-
},
|
|
412
|
-
body: JSON.stringify(request)
|
|
413
|
-
}
|
|
414
|
-
);
|
|
415
|
-
if (!response.ok) {
|
|
416
|
-
throw new Error(`Failed to fetch Meld quotes: ${response.statusText}`);
|
|
417
|
-
}
|
|
418
|
-
return response.json();
|
|
419
|
-
}
|
|
420
|
-
async function createMeldSession(request, publishableKey) {
|
|
421
|
-
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
422
|
-
const response = await fetch(
|
|
423
|
-
`${API_BASE_URL}/v1/public/onramps/meld/sessions`,
|
|
424
|
-
{
|
|
425
|
-
method: "POST",
|
|
426
|
-
headers: {
|
|
427
|
-
accept: "application/json",
|
|
428
|
-
"x-publishable-key": pk,
|
|
429
|
-
"Content-Type": "application/json"
|
|
430
|
-
},
|
|
431
|
-
body: JSON.stringify(request)
|
|
432
|
-
}
|
|
433
|
-
);
|
|
434
|
-
if (!response.ok) {
|
|
435
|
-
throw new Error(`Failed to create Meld session: ${response.statusText}`);
|
|
436
|
-
}
|
|
437
|
-
return response.json();
|
|
438
|
-
}
|
|
439
|
-
function getPreferredIconUrl(iconUrls, preferredFormat = "svg") {
|
|
440
|
-
if (!iconUrls || iconUrls.length === 0) {
|
|
441
|
-
return void 0;
|
|
442
|
-
}
|
|
443
|
-
const preferred = iconUrls.find((icon) => icon.format === preferredFormat);
|
|
444
|
-
if (preferred) {
|
|
445
|
-
return preferred.url;
|
|
446
|
-
}
|
|
447
|
-
return iconUrls[0]?.url;
|
|
448
|
-
}
|
|
449
|
-
async function getFiatCurrencies(publishableKey) {
|
|
450
|
-
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
451
|
-
const response = await fetch(
|
|
452
|
-
`${API_BASE_URL}/v1/public/onramps/fiat_currencies`,
|
|
453
|
-
{
|
|
454
|
-
method: "GET",
|
|
455
|
-
headers: {
|
|
456
|
-
accept: "application/json",
|
|
457
|
-
"x-publishable-key": pk
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
);
|
|
461
|
-
if (!response.ok) {
|
|
462
|
-
throw new Error(`Failed to fetch fiat currencies: ${response.statusText}`);
|
|
463
|
-
}
|
|
464
|
-
return response.json();
|
|
465
|
-
}
|
|
466
|
-
async function getProjectConfig(publishableKey) {
|
|
467
|
-
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
468
|
-
const response = await fetch(`${API_BASE_URL}/v1/public/projects/config`, {
|
|
469
|
-
method: "GET",
|
|
470
|
-
headers: {
|
|
471
|
-
accept: "application/json",
|
|
472
|
-
"x-publishable-key": pk
|
|
473
|
-
}
|
|
474
|
-
});
|
|
475
|
-
if (!response.ok) {
|
|
476
|
-
throw new Error(`Failed to fetch project config: ${response.statusText}`);
|
|
477
|
-
}
|
|
478
|
-
return response.json();
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
// src/components/deposits/DepositExecutionItem.tsx
|
|
289
|
+
import { ExecutionStatus, getIconUrl } from "@unifold/core";
|
|
482
290
|
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
483
291
|
function DepositExecutionItem({
|
|
484
292
|
execution,
|
|
485
293
|
onClick
|
|
486
294
|
}) {
|
|
487
|
-
const isPending = execution.status ===
|
|
295
|
+
const isPending = execution.status === ExecutionStatus.PENDING || execution.status === ExecutionStatus.WAITING || execution.status === ExecutionStatus.DELAYED;
|
|
488
296
|
const formatDateTime = (timestamp) => {
|
|
489
297
|
try {
|
|
490
298
|
const date = new Date(timestamp);
|
|
@@ -526,7 +334,7 @@ function DepositExecutionItem({
|
|
|
526
334
|
/* @__PURE__ */ jsx5(
|
|
527
335
|
"img",
|
|
528
336
|
{
|
|
529
|
-
src: execution.
|
|
337
|
+
src: execution.destination_token_metadata?.icon_url || getIconUrl("/icons/tokens/svg/usdc.svg"),
|
|
530
338
|
alt: "Token",
|
|
531
339
|
width: 36,
|
|
532
340
|
height: 36,
|
|
@@ -551,7 +359,7 @@ function DepositExecutionItem({
|
|
|
551
359
|
}
|
|
552
360
|
)
|
|
553
361
|
}
|
|
554
|
-
) }) : /* @__PURE__ */ jsx5("div", { className: "uf-absolute -uf-bottom-0.5 -uf-right-0.5 uf-bg-
|
|
362
|
+
) }) : /* @__PURE__ */ jsx5("div", { className: "uf-absolute -uf-bottom-0.5 -uf-right-0.5 uf-bg-green-500 uf-rounded-full uf-p-0.5", children: /* @__PURE__ */ jsx5("svg", { width: "10", height: "10", viewBox: "0 0 12 12", fill: "none", className: "uf-block", children: /* @__PURE__ */ jsx5(
|
|
555
363
|
"path",
|
|
556
364
|
{
|
|
557
365
|
d: "M10 3L4.5 8.5L2 6",
|
|
@@ -563,7 +371,7 @@ function DepositExecutionItem({
|
|
|
563
371
|
) }) })
|
|
564
372
|
] }),
|
|
565
373
|
/* @__PURE__ */ jsxs3("div", { className: "uf-flex-1 uf-min-w-0", children: [
|
|
566
|
-
/* @__PURE__ */ jsx5("h3", { className: "uf-text-foreground uf-font-medium uf-text-sm uf-leading-tight", children: isPending ? "Deposit
|
|
374
|
+
/* @__PURE__ */ jsx5("h3", { className: "uf-text-foreground uf-font-medium uf-text-sm uf-leading-tight", children: isPending ? "Deposit processing" : "Deposit completed" }),
|
|
567
375
|
/* @__PURE__ */ jsx5("p", { className: "uf-text-muted-foreground uf-text-xs uf-leading-tight", children: formatDateTime(execution.created_at || (/* @__PURE__ */ new Date()).toISOString()) })
|
|
568
376
|
] }),
|
|
569
377
|
/* @__PURE__ */ jsx5("span", { className: "uf-text-foreground uf-font-medium uf-text-sm uf-flex-shrink-0", children: formatUsdAmount(execution.source_amount_base_unit) }),
|
|
@@ -573,30 +381,26 @@ function DepositExecutionItem({
|
|
|
573
381
|
);
|
|
574
382
|
}
|
|
575
383
|
|
|
576
|
-
// src/components/deposits/
|
|
577
|
-
import {
|
|
384
|
+
// src/components/deposits/DepositDetailContent.tsx
|
|
385
|
+
import { useEffect as useEffect2, useState } from "react";
|
|
386
|
+
import { ExternalLink, ChevronDown, ChevronUp } from "lucide-react";
|
|
387
|
+
import {
|
|
388
|
+
ExecutionStatus as ExecutionStatus2,
|
|
389
|
+
getIconUrl as getIconUrl2,
|
|
390
|
+
getTokenChains,
|
|
391
|
+
getChainName
|
|
392
|
+
} from "@unifold/core";
|
|
578
393
|
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
bitcoin: "Bitcoin",
|
|
590
|
-
mainnet: "Mainnet"
|
|
591
|
-
};
|
|
592
|
-
function DepositDetailModal({
|
|
593
|
-
open,
|
|
594
|
-
onOpenChange,
|
|
595
|
-
execution,
|
|
596
|
-
themeClass = ""
|
|
597
|
-
}) {
|
|
598
|
-
if (!execution) return null;
|
|
599
|
-
const isPending = execution.status === "pending" /* PENDING */ || execution.status === "waiting" /* WAITING */ || execution.status === "delayed" /* DELAYED */;
|
|
394
|
+
function DepositDetailContent({ execution }) {
|
|
395
|
+
const [chains, setChains] = useState([]);
|
|
396
|
+
const [showNetworkDetails, setShowNetworkDetails] = useState(false);
|
|
397
|
+
useEffect2(() => {
|
|
398
|
+
getTokenChains().then((response) => setChains(response.data)).catch((err) => console.error("Failed to fetch chains:", err));
|
|
399
|
+
}, []);
|
|
400
|
+
useEffect2(() => {
|
|
401
|
+
setShowNetworkDetails(false);
|
|
402
|
+
}, [execution?.id]);
|
|
403
|
+
const isPending = execution.status === ExecutionStatus2.PENDING || execution.status === ExecutionStatus2.WAITING || execution.status === ExecutionStatus2.DELAYED;
|
|
600
404
|
const formatDateTime = (timestamp) => {
|
|
601
405
|
try {
|
|
602
406
|
const date = new Date(timestamp);
|
|
@@ -651,173 +455,165 @@ function DepositDetailModal({
|
|
|
651
455
|
return "$0.00";
|
|
652
456
|
};
|
|
653
457
|
const getNetworkName = (chainType, chainId) => {
|
|
654
|
-
return
|
|
655
|
-
};
|
|
656
|
-
const getSourceTokenSymbol = () => {
|
|
657
|
-
return "USDC";
|
|
458
|
+
return getChainName(chains, chainType, chainId);
|
|
658
459
|
};
|
|
659
|
-
const
|
|
660
|
-
return
|
|
661
|
-
|
|
662
|
-
const handleClose = () => {
|
|
663
|
-
onOpenChange(false);
|
|
460
|
+
const formatTransactionHash = (hash) => {
|
|
461
|
+
if (!hash || hash.length < 12) return hash;
|
|
462
|
+
return `${hash.slice(0, 12)}...${hash.slice(-4)}`;
|
|
664
463
|
};
|
|
665
|
-
return /* @__PURE__ */
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
height: "16",
|
|
689
|
-
viewBox: "0 0 12 12",
|
|
690
|
-
fill: "none",
|
|
691
|
-
className: "uf-animate-spin uf-block",
|
|
692
|
-
children: /* @__PURE__ */ jsx6(
|
|
693
|
-
"path",
|
|
694
|
-
{
|
|
695
|
-
d: "M6 1V3M6 9V11M1 6H3M9 6H11M2.5 2.5L4 4M8 8L9.5 9.5M2.5 9.5L4 8M8 4L9.5 2.5",
|
|
696
|
-
stroke: "white",
|
|
697
|
-
strokeWidth: "2",
|
|
698
|
-
strokeLinecap: "round"
|
|
699
|
-
}
|
|
700
|
-
)
|
|
701
|
-
}
|
|
702
|
-
) }) : /* @__PURE__ */ jsx6("div", { className: "uf-absolute -uf-bottom-1 -uf-right-1 uf-bg-blue-500 uf-rounded-full uf-p-1", children: /* @__PURE__ */ jsx6(
|
|
703
|
-
"svg",
|
|
704
|
-
{
|
|
705
|
-
width: "16",
|
|
706
|
-
height: "16",
|
|
707
|
-
viewBox: "0 0 12 12",
|
|
708
|
-
fill: "none",
|
|
709
|
-
className: "uf-block",
|
|
710
|
-
children: /* @__PURE__ */ jsx6(
|
|
711
|
-
"path",
|
|
712
|
-
{
|
|
713
|
-
d: "M10 3L4.5 8.5L2 6",
|
|
714
|
-
stroke: "white",
|
|
715
|
-
strokeWidth: "2",
|
|
716
|
-
strokeLinecap: "round",
|
|
717
|
-
strokeLinejoin: "round"
|
|
718
|
-
}
|
|
719
|
-
)
|
|
720
|
-
}
|
|
721
|
-
) })
|
|
722
|
-
] }),
|
|
723
|
-
/* @__PURE__ */ jsxs4("div", { className: "uf-flex uf-items-center uf-gap-1.5 uf-mb-1", children: [
|
|
724
|
-
/* @__PURE__ */ jsx6(
|
|
725
|
-
"div",
|
|
726
|
-
{
|
|
727
|
-
className: `uf-w-2 uf-h-2 uf-rounded-full ${isPending ? "uf-bg-yellow-500" : "uf-bg-green-500"}`
|
|
728
|
-
}
|
|
729
|
-
),
|
|
730
|
-
/* @__PURE__ */ jsx6("span", { className: "uf-text-foreground uf-font-medium", children: isPending ? "Pending" : "Completed" })
|
|
731
|
-
] }),
|
|
732
|
-
/* @__PURE__ */ jsx6("span", { className: "uf-text-muted-foreground uf-text-sm", children: formatDateTime(execution.created_at || (/* @__PURE__ */ new Date()).toISOString()) })
|
|
733
|
-
] }),
|
|
734
|
-
/* @__PURE__ */ jsxs4("div", { className: "uf-bg-secondary uf-rounded-xl uf-overflow-hidden uf-mb-3", children: [
|
|
735
|
-
/* @__PURE__ */ jsxs4("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
|
|
736
|
-
/* @__PURE__ */ jsx6("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Amount Sent" }),
|
|
737
|
-
/* @__PURE__ */ jsxs4("span", { className: "uf-text-foreground uf-font-medium", children: [
|
|
738
|
-
formatAmount(execution.source_amount_base_unit),
|
|
739
|
-
" ",
|
|
740
|
-
getSourceTokenSymbol()
|
|
741
|
-
] })
|
|
742
|
-
] }),
|
|
743
|
-
/* @__PURE__ */ jsxs4("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
|
|
744
|
-
/* @__PURE__ */ jsx6("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Amount Received" }),
|
|
745
|
-
/* @__PURE__ */ jsxs4("span", { className: "uf-text-foreground uf-font-medium", children: [
|
|
746
|
-
formatAmount(execution.destination_amount_base_unit),
|
|
747
|
-
" ",
|
|
748
|
-
getDestinationTokenSymbol()
|
|
749
|
-
] })
|
|
750
|
-
] }),
|
|
751
|
-
/* @__PURE__ */ jsxs4("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3", children: [
|
|
752
|
-
/* @__PURE__ */ jsx6("span", { className: "uf-text-muted-foreground uf-text-sm", children: "USD Value" }),
|
|
753
|
-
/* @__PURE__ */ jsx6("span", { className: "uf-text-foreground uf-font-medium", children: formatUsdAmount(execution.source_amount_usd, execution.source_amount_base_unit) })
|
|
754
|
-
] })
|
|
755
|
-
] }),
|
|
756
|
-
/* @__PURE__ */ jsxs4("div", { className: "uf-bg-secondary uf-rounded-xl uf-overflow-hidden uf-mb-4", children: [
|
|
757
|
-
/* @__PURE__ */ jsxs4("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
|
|
758
|
-
/* @__PURE__ */ jsx6("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Source Network" }),
|
|
759
|
-
/* @__PURE__ */ jsx6("span", { className: "uf-text-foreground uf-font-medium", children: getNetworkName(execution.source_chain_type, execution.source_chain_id) })
|
|
760
|
-
] }),
|
|
761
|
-
/* @__PURE__ */ jsxs4("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3", children: [
|
|
762
|
-
/* @__PURE__ */ jsx6("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Destination Network" }),
|
|
763
|
-
/* @__PURE__ */ jsx6("span", { className: "uf-text-foreground uf-font-medium", children: getNetworkName(execution.destination_chain_type, execution.destination_chain_id) })
|
|
764
|
-
] })
|
|
765
|
-
] }),
|
|
766
|
-
/* @__PURE__ */ jsxs4("div", { className: "uf-space-y-2", children: [
|
|
767
|
-
execution.explorer_url && /* @__PURE__ */ jsxs4(
|
|
768
|
-
"a",
|
|
464
|
+
return /* @__PURE__ */ jsxs4("div", { className: "uf-px-2", children: [
|
|
465
|
+
/* @__PURE__ */ jsxs4("div", { className: "uf-flex uf-flex-col uf-items-center uf-py-6", children: [
|
|
466
|
+
/* @__PURE__ */ jsxs4("div", { className: "uf-relative uf-mb-3", children: [
|
|
467
|
+
/* @__PURE__ */ jsx6(
|
|
468
|
+
"img",
|
|
469
|
+
{
|
|
470
|
+
src: execution.destination_token_metadata?.icon_url || getIconUrl2("/icons/tokens/svg/usdc.svg"),
|
|
471
|
+
alt: "Token",
|
|
472
|
+
width: 64,
|
|
473
|
+
height: 64,
|
|
474
|
+
className: "uf-rounded-full"
|
|
475
|
+
}
|
|
476
|
+
),
|
|
477
|
+
isPending ? /* @__PURE__ */ jsx6("div", { className: "uf-absolute -uf-bottom-1 -uf-right-1 uf-bg-yellow-500 uf-rounded-full uf-p-1", children: /* @__PURE__ */ jsx6(
|
|
478
|
+
"svg",
|
|
479
|
+
{
|
|
480
|
+
width: "16",
|
|
481
|
+
height: "16",
|
|
482
|
+
viewBox: "0 0 24 24",
|
|
483
|
+
fill: "none",
|
|
484
|
+
className: "uf-animate-spin uf-block",
|
|
485
|
+
children: /* @__PURE__ */ jsx6(
|
|
486
|
+
"path",
|
|
769
487
|
{
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
children: [
|
|
775
|
-
/* @__PURE__ */ jsxs4("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
776
|
-
/* @__PURE__ */ jsx6(ArrowDownCircle, { className: "uf-w-5 uf-h-5" }),
|
|
777
|
-
/* @__PURE__ */ jsx6("span", { className: "uf-font-medium", children: "View Deposit Transaction" })
|
|
778
|
-
] }),
|
|
779
|
-
/* @__PURE__ */ jsx6(ExternalLink, { className: "uf-w-4 uf-h-4" })
|
|
780
|
-
]
|
|
488
|
+
d: "M21 12a9 9 0 1 1-6.22-8.56",
|
|
489
|
+
stroke: "white",
|
|
490
|
+
strokeWidth: "3",
|
|
491
|
+
strokeLinecap: "round"
|
|
781
492
|
}
|
|
782
|
-
)
|
|
783
|
-
|
|
784
|
-
|
|
493
|
+
)
|
|
494
|
+
}
|
|
495
|
+
) }) : /* @__PURE__ */ jsx6("div", { className: "uf-absolute -uf-bottom-1 -uf-right-1 uf-bg-green-500 uf-rounded-full uf-p-1", children: /* @__PURE__ */ jsx6(
|
|
496
|
+
"svg",
|
|
497
|
+
{
|
|
498
|
+
width: "16",
|
|
499
|
+
height: "16",
|
|
500
|
+
viewBox: "0 0 12 12",
|
|
501
|
+
fill: "none",
|
|
502
|
+
className: "uf-block",
|
|
503
|
+
children: /* @__PURE__ */ jsx6(
|
|
504
|
+
"path",
|
|
785
505
|
{
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
/* @__PURE__ */ jsxs4("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
792
|
-
/* @__PURE__ */ jsx6(CheckCircle, { className: "uf-w-5 uf-h-5" }),
|
|
793
|
-
/* @__PURE__ */ jsx6("span", { className: "uf-font-medium", children: "View Completion Transaction" })
|
|
794
|
-
] }),
|
|
795
|
-
/* @__PURE__ */ jsx6(ExternalLink, { className: "uf-w-4 uf-h-4" })
|
|
796
|
-
]
|
|
506
|
+
d: "M10 3L4.5 8.5L2 6",
|
|
507
|
+
stroke: "white",
|
|
508
|
+
strokeWidth: "2",
|
|
509
|
+
strokeLinecap: "round",
|
|
510
|
+
strokeLinejoin: "round"
|
|
797
511
|
}
|
|
798
512
|
)
|
|
799
|
-
|
|
800
|
-
|
|
513
|
+
}
|
|
514
|
+
) })
|
|
515
|
+
] }),
|
|
516
|
+
/* @__PURE__ */ jsxs4("div", { className: "uf-flex uf-items-center uf-gap-1.5 uf-mb-1", children: [
|
|
517
|
+
/* @__PURE__ */ jsx6(
|
|
518
|
+
"div",
|
|
519
|
+
{
|
|
520
|
+
className: `uf-w-2 uf-h-2 uf-rounded-full ${isPending ? "uf-bg-yellow-500" : "uf-bg-green-500"}`
|
|
521
|
+
}
|
|
522
|
+
),
|
|
523
|
+
/* @__PURE__ */ jsx6("span", { className: "uf-text-foreground uf-font-medium", children: isPending ? "Processing" : "Completed" })
|
|
524
|
+
] }),
|
|
525
|
+
/* @__PURE__ */ jsx6("span", { className: "uf-text-muted-foreground uf-text-sm", children: formatDateTime(execution.created_at || (/* @__PURE__ */ new Date()).toISOString()) })
|
|
526
|
+
] }),
|
|
527
|
+
/* @__PURE__ */ jsxs4("div", { className: "uf-bg-secondary uf-rounded-xl uf-overflow-hidden uf-mb-3", children: [
|
|
528
|
+
/* @__PURE__ */ jsxs4("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
|
|
529
|
+
/* @__PURE__ */ jsx6("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Amount Sent" }),
|
|
530
|
+
/* @__PURE__ */ jsxs4("span", { className: "uf-text-foreground uf-font-medium", children: [
|
|
531
|
+
formatAmount(execution.source_amount_base_unit),
|
|
532
|
+
" ",
|
|
533
|
+
execution.source_currency?.toUpperCase()
|
|
801
534
|
] })
|
|
802
|
-
]
|
|
803
|
-
|
|
804
|
-
|
|
535
|
+
] }),
|
|
536
|
+
/* @__PURE__ */ jsxs4("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
|
|
537
|
+
/* @__PURE__ */ jsx6("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Amount Received" }),
|
|
538
|
+
/* @__PURE__ */ jsxs4("span", { className: "uf-text-foreground uf-font-medium", children: [
|
|
539
|
+
formatAmount(execution.destination_amount_base_unit),
|
|
540
|
+
" ",
|
|
541
|
+
execution.destination_currency?.toUpperCase()
|
|
542
|
+
] })
|
|
543
|
+
] }),
|
|
544
|
+
/* @__PURE__ */ jsxs4("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
|
|
545
|
+
/* @__PURE__ */ jsx6("span", { className: "uf-text-muted-foreground uf-text-sm", children: "USD Value" }),
|
|
546
|
+
/* @__PURE__ */ jsx6("span", { className: "uf-text-foreground uf-font-medium", children: formatUsdAmount(execution.source_amount_usd, execution.source_amount_base_unit) })
|
|
547
|
+
] }),
|
|
548
|
+
/* @__PURE__ */ jsxs4("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
|
|
549
|
+
/* @__PURE__ */ jsx6("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Source Network" }),
|
|
550
|
+
/* @__PURE__ */ jsx6("span", { className: "uf-text-foreground uf-font-medium", children: getNetworkName(execution.source_chain_type, execution.source_chain_id) })
|
|
551
|
+
] }),
|
|
552
|
+
/* @__PURE__ */ jsxs4("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3", children: [
|
|
553
|
+
/* @__PURE__ */ jsx6("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Destination Network" }),
|
|
554
|
+
/* @__PURE__ */ jsx6("span", { className: "uf-text-foreground uf-font-medium", children: getNetworkName(execution.destination_chain_type, execution.destination_chain_id) })
|
|
555
|
+
] })
|
|
556
|
+
] }),
|
|
557
|
+
/* @__PURE__ */ jsxs4(
|
|
558
|
+
"button",
|
|
559
|
+
{
|
|
560
|
+
type: "button",
|
|
561
|
+
onClick: () => setShowNetworkDetails(!showNetworkDetails),
|
|
562
|
+
className: "uf-flex uf-justify-between uf-items-center uf-w-full uf-px-3 uf-pb-3 uf-text-muted-foreground uf-text-sm hover:uf-text-foreground uf-transition-colors",
|
|
563
|
+
children: [
|
|
564
|
+
/* @__PURE__ */ jsx6("span", { children: showNetworkDetails ? "See less" : "See more details" }),
|
|
565
|
+
showNetworkDetails ? /* @__PURE__ */ jsx6(ChevronUp, { className: "uf-w-4 uf-h-4" }) : /* @__PURE__ */ jsx6(ChevronDown, { className: "uf-w-4 uf-h-4" })
|
|
566
|
+
]
|
|
567
|
+
}
|
|
568
|
+
),
|
|
569
|
+
showNetworkDetails && /* @__PURE__ */ jsxs4("div", { className: "uf-bg-secondary uf-rounded-xl uf-overflow-hidden uf-mb-4", children: [
|
|
570
|
+
execution.transaction_hash && execution.explorer_url && /* @__PURE__ */ jsxs4(
|
|
571
|
+
"a",
|
|
572
|
+
{
|
|
573
|
+
href: execution.explorer_url,
|
|
574
|
+
target: "_blank",
|
|
575
|
+
rel: "noopener noreferrer",
|
|
576
|
+
className: "uf-grid uf-grid-cols-[auto_1fr_auto] uf-items-center uf-gap-2 uf-px-4 uf-py-3 uf-border-b uf-border-border/50 hover:uf-bg-card/50 uf-transition-colors",
|
|
577
|
+
children: [
|
|
578
|
+
/* @__PURE__ */ jsx6("div", { className: "uf-text-muted-foreground uf-text-sm", children: "Deposit Tx" }),
|
|
579
|
+
/* @__PURE__ */ jsx6("div", { className: "uf-text-sm uf-text-foreground uf-text-right", children: formatTransactionHash(execution.transaction_hash) }),
|
|
580
|
+
/* @__PURE__ */ jsx6(ExternalLink, { className: "uf-w-3.5 uf-h-3.5 uf-text-muted-foreground uf-block" })
|
|
581
|
+
]
|
|
582
|
+
}
|
|
583
|
+
),
|
|
584
|
+
!isPending && execution.destination_transaction_hashes?.length > 0 && execution.destination_explorer_url && /* @__PURE__ */ jsxs4(
|
|
585
|
+
"a",
|
|
586
|
+
{
|
|
587
|
+
href: execution.destination_explorer_url,
|
|
588
|
+
target: "_blank",
|
|
589
|
+
rel: "noopener noreferrer",
|
|
590
|
+
className: "uf-grid uf-grid-cols-[auto_1fr_auto] uf-items-center uf-gap-2 uf-px-4 uf-py-3 hover:uf-bg-card/50 uf-transition-colors",
|
|
591
|
+
children: [
|
|
592
|
+
/* @__PURE__ */ jsx6("div", { className: "uf-text-muted-foreground uf-text-sm", children: "Completion Tx" }),
|
|
593
|
+
/* @__PURE__ */ jsx6("div", { className: "uf-text-sm uf-text-foreground uf-text-right", children: formatTransactionHash(execution.destination_transaction_hashes[0]) }),
|
|
594
|
+
/* @__PURE__ */ jsx6(ExternalLink, { className: "uf-w-3.5 uf-h-3.5 uf-text-muted-foreground uf-block" })
|
|
595
|
+
]
|
|
596
|
+
}
|
|
597
|
+
)
|
|
598
|
+
] })
|
|
599
|
+
] });
|
|
805
600
|
}
|
|
806
601
|
|
|
807
602
|
// src/components/deposits/DepositsModal.tsx
|
|
603
|
+
import { queryExecutions } from "@unifold/core";
|
|
808
604
|
import { Fragment, jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
809
605
|
function DepositsModal({
|
|
810
606
|
open,
|
|
811
607
|
onOpenChange,
|
|
608
|
+
onCloseAll,
|
|
812
609
|
executions: sessionExecutions,
|
|
813
610
|
userId,
|
|
814
611
|
publishableKey,
|
|
815
612
|
themeClass = ""
|
|
816
613
|
}) {
|
|
817
|
-
const [allExecutions, setAllExecutions] =
|
|
818
|
-
const [selectedExecution, setSelectedExecution] =
|
|
819
|
-
|
|
820
|
-
useEffect2(() => {
|
|
614
|
+
const [allExecutions, setAllExecutions] = useState2(sessionExecutions);
|
|
615
|
+
const [selectedExecution, setSelectedExecution] = useState2(null);
|
|
616
|
+
useEffect3(() => {
|
|
821
617
|
if (!open || !userId) return;
|
|
822
618
|
const fetchExecutions = async () => {
|
|
823
619
|
try {
|
|
@@ -839,49 +635,74 @@ function DepositsModal({
|
|
|
839
635
|
clearInterval(pollInterval);
|
|
840
636
|
};
|
|
841
637
|
}, [open, userId, publishableKey, sessionExecutions]);
|
|
638
|
+
useEffect3(() => {
|
|
639
|
+
if (!open) {
|
|
640
|
+
setSelectedExecution(null);
|
|
641
|
+
}
|
|
642
|
+
}, [open]);
|
|
643
|
+
const handleBack = () => {
|
|
644
|
+
if (selectedExecution) {
|
|
645
|
+
setSelectedExecution(null);
|
|
646
|
+
} else {
|
|
647
|
+
onOpenChange(false);
|
|
648
|
+
}
|
|
649
|
+
};
|
|
842
650
|
const handleClose = () => {
|
|
843
651
|
onOpenChange(false);
|
|
652
|
+
onCloseAll?.();
|
|
844
653
|
};
|
|
845
654
|
const handleExecutionClick = (execution) => {
|
|
846
655
|
setSelectedExecution(execution);
|
|
847
|
-
setDetailModalOpen(true);
|
|
848
656
|
};
|
|
849
|
-
return /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
850
|
-
/* @__PURE__ */ jsx7(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs5(DialogContent, { className: `sm:uf-max-w-[400px] !uf-bg-card uf-border-secondary uf-text-foreground uf-p-0 uf-gap-0 [&>button]:uf-hidden ${themeClass}`, children: [
|
|
851
|
-
/* @__PURE__ */ jsx7(DepositHeader, { title: "Deposit Tracker", onClose: handleClose }),
|
|
852
|
-
/* @__PURE__ */ jsx7("div", { className: "uf-max-h-[500px] uf-overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:uf-hidden uf-pb-4", children: /* @__PURE__ */ jsx7("div", { className: "uf-space-y-2", children: allExecutions.length === 0 ? /* @__PURE__ */ jsx7("div", { className: "uf-py-8 uf-px-4 uf-text-center", children: /* @__PURE__ */ jsx7("div", { className: "uf-text-muted-foreground uf-text-sm", children: "No deposits yet" }) }) : /* @__PURE__ */ jsx7(Fragment, { children: allExecutions.map((execution) => /* @__PURE__ */ jsx7(
|
|
853
|
-
DepositExecutionItem,
|
|
854
|
-
{
|
|
855
|
-
execution,
|
|
856
|
-
onClick: () => handleExecutionClick(execution)
|
|
857
|
-
},
|
|
858
|
-
execution.id
|
|
859
|
-
)) }) }) })
|
|
860
|
-
] }) }),
|
|
657
|
+
return /* @__PURE__ */ jsx7(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsx7(DialogContent, { className: `sm:uf-max-w-[400px] !uf-bg-card uf-border-secondary uf-text-foreground uf-p-0 uf-gap-0 [&>button]:uf-hidden ${themeClass}`, children: selectedExecution ? /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
861
658
|
/* @__PURE__ */ jsx7(
|
|
862
|
-
|
|
659
|
+
DepositHeader,
|
|
863
660
|
{
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
661
|
+
title: "Deposit Details",
|
|
662
|
+
showBack: true,
|
|
663
|
+
onBack: () => setSelectedExecution(null),
|
|
664
|
+
onClose: handleClose
|
|
868
665
|
}
|
|
869
|
-
)
|
|
870
|
-
|
|
666
|
+
),
|
|
667
|
+
/* @__PURE__ */ jsx7(DepositDetailContent, { execution: selectedExecution })
|
|
668
|
+
] }) : /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
669
|
+
/* @__PURE__ */ jsx7(
|
|
670
|
+
DepositHeader,
|
|
671
|
+
{
|
|
672
|
+
title: "Deposit Tracker",
|
|
673
|
+
showBack: true,
|
|
674
|
+
onBack: handleBack,
|
|
675
|
+
onClose: handleClose
|
|
676
|
+
}
|
|
677
|
+
),
|
|
678
|
+
/* @__PURE__ */ jsx7("div", { className: "uf-max-h-[400px] uf-overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:uf-hidden", children: /* @__PURE__ */ jsx7("div", { className: "uf-space-y-2", children: allExecutions.length === 0 ? /* @__PURE__ */ jsx7("div", { className: "uf-py-8 uf-px-4 uf-text-center", children: /* @__PURE__ */ jsx7("div", { className: "uf-text-muted-foreground uf-text-sm", children: "No deposits yet" }) }) : /* @__PURE__ */ jsx7(Fragment, { children: allExecutions.map((execution) => /* @__PURE__ */ jsx7(
|
|
679
|
+
DepositExecutionItem,
|
|
680
|
+
{
|
|
681
|
+
execution,
|
|
682
|
+
onClick: () => handleExecutionClick(execution)
|
|
683
|
+
},
|
|
684
|
+
execution.id
|
|
685
|
+
)) }) }) })
|
|
686
|
+
] }) }) });
|
|
871
687
|
}
|
|
872
688
|
|
|
873
689
|
// src/components/deposits/DepositSuccessToast.tsx
|
|
690
|
+
import { useState as useState3 } from "react";
|
|
874
691
|
import { X as X3 } from "lucide-react";
|
|
875
|
-
import {
|
|
692
|
+
import { ExecutionStatus as ExecutionStatus3, getIconUrl as getIconUrl3 } from "@unifold/core";
|
|
693
|
+
import { Fragment as Fragment2, jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
876
694
|
function DepositSuccessToast({
|
|
877
695
|
depositTx,
|
|
878
696
|
orderSubmittedAt,
|
|
879
697
|
status,
|
|
880
698
|
tokenIconUrl,
|
|
881
699
|
sourceAmountBaseUnit = "0",
|
|
882
|
-
onClose
|
|
700
|
+
onClose,
|
|
701
|
+
execution
|
|
883
702
|
}) {
|
|
884
|
-
const
|
|
703
|
+
const [detailModalOpen, setDetailModalOpen] = useState3(false);
|
|
704
|
+
const { themeClass } = useTheme();
|
|
705
|
+
const isPending = status === ExecutionStatus3.PENDING || status === ExecutionStatus3.WAITING || status === ExecutionStatus3.DELAYED;
|
|
885
706
|
const formatDateTime = (timestamp) => {
|
|
886
707
|
try {
|
|
887
708
|
const date = new Date(timestamp);
|
|
@@ -913,67 +734,130 @@ function DepositSuccessToast({
|
|
|
913
734
|
return "$0.00";
|
|
914
735
|
}
|
|
915
736
|
};
|
|
916
|
-
return /* @__PURE__ */
|
|
917
|
-
/* @__PURE__ */
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
className: "uf-rounded-full"
|
|
926
|
-
}
|
|
927
|
-
),
|
|
928
|
-
isPending ? /* @__PURE__ */ jsx8("div", { className: "uf-absolute uf--bottom-0.5 uf--right-0.5 uf-bg-yellow-500 uf-rounded-full uf-p-0.5", children: /* @__PURE__ */ jsx8(
|
|
737
|
+
return /* @__PURE__ */ jsxs6(Fragment2, { children: [
|
|
738
|
+
isPending && /* @__PURE__ */ jsx8("style", { children: `
|
|
739
|
+
@keyframes border-travel {
|
|
740
|
+
from { stroke-dashoffset: 0; }
|
|
741
|
+
to { stroke-dashoffset: -1000; }
|
|
742
|
+
}
|
|
743
|
+
` }),
|
|
744
|
+
/* @__PURE__ */ jsx8("div", { className: "uf-w-full uf-animate-in uf-slide-in-from-bottom-2 uf-duration-300", children: /* @__PURE__ */ jsxs6("div", { className: "uf-relative uf-rounded-xl", children: [
|
|
745
|
+
isPending && /* @__PURE__ */ jsx8(
|
|
929
746
|
"svg",
|
|
930
747
|
{
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
viewBox: "0 0 12 12",
|
|
934
|
-
fill: "none",
|
|
935
|
-
className: "uf-animate-spin",
|
|
748
|
+
className: "uf-absolute uf-inset-0 uf-w-full uf-h-full uf-pointer-events-none uf-z-[1]",
|
|
749
|
+
style: { overflow: "visible" },
|
|
936
750
|
children: /* @__PURE__ */ jsx8(
|
|
937
|
-
"
|
|
751
|
+
"rect",
|
|
938
752
|
{
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
753
|
+
x: "5",
|
|
754
|
+
y: "2",
|
|
755
|
+
rx: "10",
|
|
756
|
+
ry: "10",
|
|
757
|
+
fill: "none",
|
|
758
|
+
stroke: "#ecc94b",
|
|
759
|
+
strokeWidth: "3",
|
|
760
|
+
strokeDasharray: "120 880",
|
|
761
|
+
strokeLinecap: "round",
|
|
762
|
+
pathLength: "1000",
|
|
763
|
+
style: {
|
|
764
|
+
width: "calc(100% - 10px)",
|
|
765
|
+
height: "calc(100% - 4px)",
|
|
766
|
+
animation: "border-travel 2.5s linear infinite"
|
|
767
|
+
}
|
|
943
768
|
}
|
|
944
769
|
)
|
|
945
770
|
}
|
|
946
|
-
)
|
|
947
|
-
|
|
771
|
+
),
|
|
772
|
+
/* @__PURE__ */ jsxs6(
|
|
773
|
+
"div",
|
|
948
774
|
{
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
775
|
+
onClick: () => execution && setDetailModalOpen(true),
|
|
776
|
+
className: `uf-relative uf-bg-white dark:uf-bg-black hover:uf-opacity-90 uf-rounded-xl uf-p-3 uf-mx-1 uf-flex uf-items-center uf-gap-3 uf-transition-all uf-cursor-pointer ${isPending ? "" : "uf-border uf-border-zinc-300 dark:uf-border-zinc-700"}`,
|
|
777
|
+
children: [
|
|
778
|
+
/* @__PURE__ */ jsxs6("div", { className: "uf-relative uf-flex-shrink-0", children: [
|
|
779
|
+
/* @__PURE__ */ jsx8(
|
|
780
|
+
"img",
|
|
781
|
+
{
|
|
782
|
+
src: tokenIconUrl || getIconUrl3("/icons/tokens/svg/usdc.svg"),
|
|
783
|
+
alt: "Token",
|
|
784
|
+
width: 36,
|
|
785
|
+
height: 36,
|
|
786
|
+
className: "uf-rounded-full"
|
|
787
|
+
}
|
|
788
|
+
),
|
|
789
|
+
isPending ? /* @__PURE__ */ jsx8("div", { className: "uf-absolute uf--bottom-0.5 uf--right-0.5 uf-bg-yellow-500 uf-rounded-full uf-p-0.5", children: /* @__PURE__ */ jsx8(
|
|
790
|
+
"svg",
|
|
791
|
+
{
|
|
792
|
+
width: "10",
|
|
793
|
+
height: "10",
|
|
794
|
+
viewBox: "0 0 24 24",
|
|
795
|
+
fill: "none",
|
|
796
|
+
className: "uf-animate-spin",
|
|
797
|
+
children: /* @__PURE__ */ jsx8(
|
|
798
|
+
"path",
|
|
799
|
+
{
|
|
800
|
+
d: "M21 12a9 9 0 1 1-6.22-8.56",
|
|
801
|
+
stroke: "white",
|
|
802
|
+
strokeWidth: "3",
|
|
803
|
+
strokeLinecap: "round"
|
|
804
|
+
}
|
|
805
|
+
)
|
|
806
|
+
}
|
|
807
|
+
) }) : /* @__PURE__ */ jsx8("div", { className: "uf-absolute uf--bottom-0.5 uf--right-0.5 uf-bg-green-500 uf-rounded-full uf-p-0.5", children: /* @__PURE__ */ jsx8("svg", { width: "10", height: "10", viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ jsx8(
|
|
808
|
+
"path",
|
|
809
|
+
{
|
|
810
|
+
d: "M10 3L4.5 8.5L2 6",
|
|
811
|
+
stroke: "white",
|
|
812
|
+
strokeWidth: "2",
|
|
813
|
+
strokeLinecap: "round",
|
|
814
|
+
strokeLinejoin: "round"
|
|
815
|
+
}
|
|
816
|
+
) }) })
|
|
817
|
+
] }),
|
|
818
|
+
/* @__PURE__ */ jsxs6("div", { className: "uf-flex-1 uf-min-w-0", children: [
|
|
819
|
+
/* @__PURE__ */ jsx8("h3", { className: "uf-text-black dark:uf-text-white uf-font-medium uf-text-sm", children: isPending ? "Deposit processing" : "Deposit completed" }),
|
|
820
|
+
/* @__PURE__ */ jsx8("p", { className: "uf-text-zinc-600 dark:uf-text-zinc-400 uf-text-xs", children: formatDateTime(orderSubmittedAt) })
|
|
821
|
+
] }),
|
|
822
|
+
/* @__PURE__ */ jsx8("div", { className: "uf-text-black dark:uf-text-white uf-font-medium uf-text-sm uf-flex-shrink-0", children: formatUsdAmount(sourceAmountBaseUnit) }),
|
|
823
|
+
/* @__PURE__ */ jsx8(
|
|
824
|
+
"button",
|
|
825
|
+
{
|
|
826
|
+
onClick: (e) => {
|
|
827
|
+
e.stopPropagation();
|
|
828
|
+
onClose();
|
|
829
|
+
},
|
|
830
|
+
className: "uf-text-zinc-600 dark:uf-text-zinc-400 hover:uf-text-black dark:hover:uf-text-white uf-transition-colors uf-p-0.5 uf-flex-shrink-0",
|
|
831
|
+
children: /* @__PURE__ */ jsx8(X3, { className: "uf-w-4 uf-h-4" })
|
|
832
|
+
}
|
|
833
|
+
)
|
|
834
|
+
]
|
|
954
835
|
}
|
|
955
|
-
)
|
|
956
|
-
] }),
|
|
957
|
-
/* @__PURE__ */ jsxs6(
|
|
958
|
-
/* @__PURE__ */
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
836
|
+
)
|
|
837
|
+
] }) }),
|
|
838
|
+
execution && /* @__PURE__ */ jsx8(Dialog, { open: detailModalOpen, onOpenChange: setDetailModalOpen, children: /* @__PURE__ */ jsxs6(DialogContent, { className: `sm:uf-max-w-[400px] !uf-bg-card uf-border-secondary uf-text-foreground uf-p-0 uf-mt-8 uf-gap-0 [&>button]:uf-hidden ${themeClass}`, children: [
|
|
839
|
+
/* @__PURE__ */ jsxs6("div", { className: "uf-flex uf-items-center uf-justify-between uf-px-4", children: [
|
|
840
|
+
/* @__PURE__ */ jsx8("div", { className: "uf-w-8" }),
|
|
841
|
+
" ",
|
|
842
|
+
/* @__PURE__ */ jsx8("h2", { className: "uf-text-lg uf-font-semibold uf-text-foreground", children: "Deposit Details" }),
|
|
843
|
+
/* @__PURE__ */ jsx8(
|
|
844
|
+
"button",
|
|
845
|
+
{
|
|
846
|
+
onClick: () => setDetailModalOpen(false),
|
|
847
|
+
className: "uf-text-muted-foreground hover:uf-text-foreground uf-transition-colors uf-w-8 uf-flex uf-justify-end",
|
|
848
|
+
children: /* @__PURE__ */ jsx8(X3, { className: "uf-w-5 uf-h-5" })
|
|
849
|
+
}
|
|
850
|
+
)
|
|
851
|
+
] }),
|
|
852
|
+
/* @__PURE__ */ jsx8(DepositDetailContent, { execution })
|
|
853
|
+
] }) })
|
|
854
|
+
] });
|
|
971
855
|
}
|
|
972
856
|
|
|
973
857
|
// src/components/shared/select.tsx
|
|
974
858
|
import * as React3 from "react";
|
|
975
859
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
976
|
-
import { Check, ChevronDown, ChevronUp } from "lucide-react";
|
|
860
|
+
import { Check, ChevronDown as ChevronDown2, ChevronUp as ChevronUp2 } from "lucide-react";
|
|
977
861
|
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
978
862
|
var Select = SelectPrimitive.Root;
|
|
979
863
|
var SelectGroup = SelectPrimitive.Group;
|
|
@@ -989,7 +873,7 @@ var SelectTrigger = React3.forwardRef(({ className, children, ...props }, ref) =
|
|
|
989
873
|
...props,
|
|
990
874
|
children: [
|
|
991
875
|
children,
|
|
992
|
-
/* @__PURE__ */ jsx9(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx9(
|
|
876
|
+
/* @__PURE__ */ jsx9(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx9(ChevronDown2, { className: "uf-h-4 uf-w-4 uf-opacity-50" }) })
|
|
993
877
|
]
|
|
994
878
|
}
|
|
995
879
|
));
|
|
@@ -1003,7 +887,7 @@ var SelectScrollUpButton = React3.forwardRef(({ className, ...props }, ref) => /
|
|
|
1003
887
|
className
|
|
1004
888
|
),
|
|
1005
889
|
...props,
|
|
1006
|
-
children: /* @__PURE__ */ jsx9(
|
|
890
|
+
children: /* @__PURE__ */ jsx9(ChevronUp2, { className: "uf-h-4 uf-w-4" })
|
|
1007
891
|
}
|
|
1008
892
|
));
|
|
1009
893
|
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
@@ -1016,7 +900,7 @@ var SelectScrollDownButton = React3.forwardRef(({ className, ...props }, ref) =>
|
|
|
1016
900
|
className
|
|
1017
901
|
),
|
|
1018
902
|
...props,
|
|
1019
|
-
children: /* @__PURE__ */ jsx9(
|
|
903
|
+
children: /* @__PURE__ */ jsx9(ChevronDown2, { className: "uf-h-4 uf-w-4" })
|
|
1020
904
|
}
|
|
1021
905
|
));
|
|
1022
906
|
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
@@ -1087,61 +971,16 @@ var SelectSeparator = React3.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
1087
971
|
));
|
|
1088
972
|
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
1089
973
|
|
|
1090
|
-
// src/components/shared/button.tsx
|
|
1091
|
-
import * as React4 from "react";
|
|
1092
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
1093
|
-
import { cva } from "class-variance-authority";
|
|
1094
|
-
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
1095
|
-
var buttonVariants = cva(
|
|
1096
|
-
"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",
|
|
1097
|
-
{
|
|
1098
|
-
variants: {
|
|
1099
|
-
variant: {
|
|
1100
|
-
default: "uf-bg-primary uf-text-primary-foreground hover:uf-bg-primary/90",
|
|
1101
|
-
destructive: "uf-bg-destructive uf-text-destructive-foreground hover:uf-bg-destructive/90",
|
|
1102
|
-
outline: "uf-border uf-border-input uf-bg-background hover:uf-bg-accent hover:uf-text-accent-foreground",
|
|
1103
|
-
secondary: "uf-bg-secondary uf-text-secondary-foreground hover:uf-bg-secondary/80",
|
|
1104
|
-
ghost: "hover:uf-bg-accent hover:uf-text-accent-foreground",
|
|
1105
|
-
link: "uf-text-primary uf-underline-offset-4 hover:uf-underline"
|
|
1106
|
-
},
|
|
1107
|
-
size: {
|
|
1108
|
-
default: "uf-h-10 uf-px-4 uf-py-2",
|
|
1109
|
-
sm: "uf-h-9 uf-rounded-md uf-px-3",
|
|
1110
|
-
lg: "uf-h-11 uf-rounded-md uf-px-8",
|
|
1111
|
-
icon: "uf-h-10 uf-w-10"
|
|
1112
|
-
}
|
|
1113
|
-
},
|
|
1114
|
-
defaultVariants: {
|
|
1115
|
-
variant: "default",
|
|
1116
|
-
size: "default"
|
|
1117
|
-
}
|
|
1118
|
-
}
|
|
1119
|
-
);
|
|
1120
|
-
var Button = React4.forwardRef(
|
|
1121
|
-
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
1122
|
-
const Comp = asChild ? Slot : "button";
|
|
1123
|
-
return /* @__PURE__ */ jsx10(
|
|
1124
|
-
Comp,
|
|
1125
|
-
{
|
|
1126
|
-
className: cn(buttonVariants({ variant, size, className })),
|
|
1127
|
-
ref,
|
|
1128
|
-
...props
|
|
1129
|
-
}
|
|
1130
|
-
);
|
|
1131
|
-
}
|
|
1132
|
-
);
|
|
1133
|
-
Button.displayName = "Button";
|
|
1134
|
-
|
|
1135
974
|
// src/components/shared/tooltip.tsx
|
|
1136
|
-
import * as
|
|
975
|
+
import * as React4 from "react";
|
|
1137
976
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
1138
|
-
import { jsx as
|
|
977
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
1139
978
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
1140
979
|
var Tooltip = TooltipPrimitive.Root;
|
|
1141
980
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
1142
|
-
var TooltipContent =
|
|
981
|
+
var TooltipContent = React4.forwardRef(({ className, sideOffset = 4, ...props }, ref) => {
|
|
1143
982
|
const { themeClass } = useTheme();
|
|
1144
|
-
return /* @__PURE__ */
|
|
983
|
+
return /* @__PURE__ */ jsx10(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx10(
|
|
1145
984
|
TooltipPrimitive.Content,
|
|
1146
985
|
{
|
|
1147
986
|
ref,
|
|
@@ -1157,6 +996,15 @@ var TooltipContent = React5.forwardRef(({ className, sideOffset = 4, ...props },
|
|
|
1157
996
|
});
|
|
1158
997
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
1159
998
|
|
|
999
|
+
// src/components/deposits/TransferCryptoBase.tsx
|
|
1000
|
+
import {
|
|
1001
|
+
createDepositAddress,
|
|
1002
|
+
getWalletByChainType,
|
|
1003
|
+
queryExecutions as queryExecutions2,
|
|
1004
|
+
getSupportedDepositTokens,
|
|
1005
|
+
ExecutionStatus as ExecutionStatus4
|
|
1006
|
+
} from "@unifold/core";
|
|
1007
|
+
|
|
1160
1008
|
// src/lib/i18n/en.json
|
|
1161
1009
|
var en_default = {
|
|
1162
1010
|
transferCrypto: {
|
|
@@ -1227,7 +1075,7 @@ var en_default = {
|
|
|
1227
1075
|
var i18n = en_default;
|
|
1228
1076
|
|
|
1229
1077
|
// src/components/deposits/TransferCryptoBase.tsx
|
|
1230
|
-
import {
|
|
1078
|
+
import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1231
1079
|
var t = i18n.transferCrypto;
|
|
1232
1080
|
var getChainKey = (chainId, chainType) => {
|
|
1233
1081
|
return `${chainType}:${chainId}`;
|
|
@@ -1243,7 +1091,6 @@ function TransferCryptoBase({
|
|
|
1243
1091
|
destinationChainType,
|
|
1244
1092
|
destinationChainId,
|
|
1245
1093
|
destinationTokenAddress,
|
|
1246
|
-
copyButtonMode = "compact",
|
|
1247
1094
|
layoutVariant = "horizontal",
|
|
1248
1095
|
showDetailedDropdowns = false,
|
|
1249
1096
|
onExecutionsChange,
|
|
@@ -1253,20 +1100,20 @@ function TransferCryptoBase({
|
|
|
1253
1100
|
}) {
|
|
1254
1101
|
const { themeClass } = useTheme();
|
|
1255
1102
|
const isDarkMode = themeClass.includes("uf-dark");
|
|
1256
|
-
const [token, setToken] =
|
|
1257
|
-
const [chain, setChain] =
|
|
1258
|
-
const [copied, setCopied] =
|
|
1259
|
-
const [internalWallets, setInternalWallets] =
|
|
1260
|
-
const [loading, setLoading] =
|
|
1103
|
+
const [token, setToken] = useState4("USDC");
|
|
1104
|
+
const [chain, setChain] = useState4("solana:mainnet");
|
|
1105
|
+
const [copied, setCopied] = useState4(false);
|
|
1106
|
+
const [internalWallets, setInternalWallets] = useState4([]);
|
|
1107
|
+
const [loading, setLoading] = useState4(!externalWallets?.length);
|
|
1261
1108
|
const wallets = externalWallets?.length ? externalWallets : internalWallets;
|
|
1262
|
-
const [error, setError] =
|
|
1263
|
-
const [depositExecutions, setDepositExecutions] =
|
|
1264
|
-
const [trackedExecutions, setTrackedExecutions] =
|
|
1265
|
-
const [modalOpenedAt, setModalOpenedAt] =
|
|
1266
|
-
const [supportedTokens, setSupportedTokens] =
|
|
1267
|
-
const [tokensLoading, setTokensLoading] =
|
|
1268
|
-
const [detailsExpanded, setDetailsExpanded] =
|
|
1269
|
-
const [depositsModalOpen, setDepositsModalOpen] =
|
|
1109
|
+
const [error, setError] = useState4(null);
|
|
1110
|
+
const [depositExecutions, setDepositExecutions] = useState4([]);
|
|
1111
|
+
const [trackedExecutions, setTrackedExecutions] = useState4(/* @__PURE__ */ new Map());
|
|
1112
|
+
const [modalOpenedAt, setModalOpenedAt] = useState4(null);
|
|
1113
|
+
const [supportedTokens, setSupportedTokens] = useState4([]);
|
|
1114
|
+
const [tokensLoading, setTokensLoading] = useState4(true);
|
|
1115
|
+
const [detailsExpanded, setDetailsExpanded] = useState4(false);
|
|
1116
|
+
const [depositsModalOpen, setDepositsModalOpen] = useState4(false);
|
|
1270
1117
|
const allChainsMap = /* @__PURE__ */ new Map();
|
|
1271
1118
|
supportedTokens.forEach((t4) => {
|
|
1272
1119
|
t4.chains.forEach((c) => {
|
|
@@ -1284,10 +1131,10 @@ function TransferCryptoBase({
|
|
|
1284
1131
|
const currentChainType = currentChainData?.chain_type || "ethereum";
|
|
1285
1132
|
const currentWallet = getWalletByChainType(wallets, currentChainType);
|
|
1286
1133
|
const depositAddress = currentWallet?.address || "";
|
|
1287
|
-
|
|
1134
|
+
useEffect4(() => {
|
|
1288
1135
|
setModalOpenedAt(/* @__PURE__ */ new Date());
|
|
1289
1136
|
}, []);
|
|
1290
|
-
|
|
1137
|
+
useEffect4(() => {
|
|
1291
1138
|
async function fetchSupportedTokens() {
|
|
1292
1139
|
try {
|
|
1293
1140
|
setTokensLoading(true);
|
|
@@ -1316,12 +1163,12 @@ function TransferCryptoBase({
|
|
|
1316
1163
|
}
|
|
1317
1164
|
fetchSupportedTokens();
|
|
1318
1165
|
}, [publishableKey, chain]);
|
|
1319
|
-
|
|
1166
|
+
useEffect4(() => {
|
|
1320
1167
|
if (onExecutionsChange) {
|
|
1321
1168
|
onExecutionsChange(depositExecutions);
|
|
1322
1169
|
}
|
|
1323
1170
|
}, [depositExecutions, onExecutionsChange]);
|
|
1324
|
-
|
|
1171
|
+
useEffect4(() => {
|
|
1325
1172
|
if (externalWallets?.length) {
|
|
1326
1173
|
setLoading(false);
|
|
1327
1174
|
return;
|
|
@@ -1332,9 +1179,9 @@ function TransferCryptoBase({
|
|
|
1332
1179
|
if (isCancelled) return;
|
|
1333
1180
|
setLoading(true);
|
|
1334
1181
|
try {
|
|
1335
|
-
const response = await
|
|
1182
|
+
const response = await createDepositAddress(
|
|
1336
1183
|
{
|
|
1337
|
-
|
|
1184
|
+
external_user_id: userId,
|
|
1338
1185
|
recipient_address: recipientAddress,
|
|
1339
1186
|
destination_chain_type: destinationChainType,
|
|
1340
1187
|
destination_chain_id: destinationChainId,
|
|
@@ -1372,7 +1219,7 @@ function TransferCryptoBase({
|
|
|
1372
1219
|
publishableKey,
|
|
1373
1220
|
externalWallets
|
|
1374
1221
|
]);
|
|
1375
|
-
|
|
1222
|
+
useEffect4(() => {
|
|
1376
1223
|
if (!supportedTokens.length) return;
|
|
1377
1224
|
const currentToken = supportedTokens.find((t4) => t4.symbol === token);
|
|
1378
1225
|
if (!currentToken || currentToken.chains.length === 0) return;
|
|
@@ -1386,11 +1233,11 @@ function TransferCryptoBase({
|
|
|
1386
1233
|
setChain(newChain);
|
|
1387
1234
|
}
|
|
1388
1235
|
}, [token, supportedTokens, chain]);
|
|
1389
|
-
|
|
1236
|
+
useEffect4(() => {
|
|
1390
1237
|
if (!userId || !modalOpenedAt) return;
|
|
1391
1238
|
const pollInterval = setInterval(async () => {
|
|
1392
1239
|
try {
|
|
1393
|
-
const response = await
|
|
1240
|
+
const response = await queryExecutions2(userId, publishableKey);
|
|
1394
1241
|
let executionToShow = null;
|
|
1395
1242
|
for (const execution of response.data) {
|
|
1396
1243
|
const executionTime = execution.created_at ? new Date(execution.created_at) : null;
|
|
@@ -1403,11 +1250,11 @@ function TransferCryptoBase({
|
|
|
1403
1250
|
break;
|
|
1404
1251
|
}
|
|
1405
1252
|
const inProgressStatuses = [
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1253
|
+
ExecutionStatus4.PENDING,
|
|
1254
|
+
ExecutionStatus4.WAITING,
|
|
1255
|
+
ExecutionStatus4.DELAYED
|
|
1409
1256
|
];
|
|
1410
|
-
if (inProgressStatuses.includes(trackedStatus) && execution.status ===
|
|
1257
|
+
if (inProgressStatuses.includes(trackedStatus) && execution.status === ExecutionStatus4.SUCCEEDED) {
|
|
1411
1258
|
executionToShow = execution;
|
|
1412
1259
|
break;
|
|
1413
1260
|
}
|
|
@@ -1430,7 +1277,7 @@ function TransferCryptoBase({
|
|
|
1430
1277
|
return updated;
|
|
1431
1278
|
});
|
|
1432
1279
|
if (onDepositSuccess) {
|
|
1433
|
-
const isCompleted = execution.status ===
|
|
1280
|
+
const isCompleted = execution.status === ExecutionStatus4.SUCCEEDED;
|
|
1434
1281
|
if (isCompleted) {
|
|
1435
1282
|
onDepositSuccess({
|
|
1436
1283
|
message: "Deposit completed successfully",
|
|
@@ -1494,7 +1341,7 @@ function TransferCryptoBase({
|
|
|
1494
1341
|
const minDepositUsd = currentChainFromBackend?.minimum_deposit_amount_usd ?? 3;
|
|
1495
1342
|
const renderTokenItem = (tokenData) => {
|
|
1496
1343
|
return /* @__PURE__ */ jsxs8("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
1497
|
-
/* @__PURE__ */
|
|
1344
|
+
/* @__PURE__ */ jsx11(
|
|
1498
1345
|
"img",
|
|
1499
1346
|
{
|
|
1500
1347
|
src: tokenData.icon_url,
|
|
@@ -1504,13 +1351,13 @@ function TransferCryptoBase({
|
|
|
1504
1351
|
className: "uf-rounded-full uf-flex-shrink-0"
|
|
1505
1352
|
}
|
|
1506
1353
|
),
|
|
1507
|
-
/* @__PURE__ */
|
|
1508
|
-
showDetailedDropdowns && /* @__PURE__ */
|
|
1354
|
+
/* @__PURE__ */ jsx11("span", { className: "uf-text-xs uf-font-normal", children: tokenData.symbol }),
|
|
1355
|
+
showDetailedDropdowns && /* @__PURE__ */ jsx11("span", { className: "uf-text-xs uf-text-muted-foreground", children: tokenData.name })
|
|
1509
1356
|
] });
|
|
1510
1357
|
};
|
|
1511
1358
|
const renderChainItem = (chainData) => {
|
|
1512
1359
|
return /* @__PURE__ */ jsxs8("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
1513
|
-
/* @__PURE__ */
|
|
1360
|
+
/* @__PURE__ */ jsx11(
|
|
1514
1361
|
"img",
|
|
1515
1362
|
{
|
|
1516
1363
|
src: chainData.icon_url,
|
|
@@ -1520,15 +1367,15 @@ function TransferCryptoBase({
|
|
|
1520
1367
|
className: "uf-rounded-full uf-flex-shrink-0"
|
|
1521
1368
|
}
|
|
1522
1369
|
),
|
|
1523
|
-
/* @__PURE__ */
|
|
1524
|
-
showDetailedDropdowns && /* @__PURE__ */
|
|
1370
|
+
/* @__PURE__ */ jsx11("span", { className: "uf-text-xs uf-font-normal", children: chainData.chain_name }),
|
|
1371
|
+
showDetailedDropdowns && /* @__PURE__ */ jsx11("span", { className: "uf-text-xs uf-text-muted-foreground uf-capitalize", children: chainData.chain_type })
|
|
1525
1372
|
] });
|
|
1526
1373
|
};
|
|
1527
1374
|
const selectContainerClass = layoutVariant === "horizontal" ? "uf-grid uf-grid-cols-2 uf-gap-2.5" : "uf-space-y-3";
|
|
1528
|
-
return /* @__PURE__ */
|
|
1375
|
+
return /* @__PURE__ */ jsx11(TooltipProvider, { delayDuration: 0, skipDelayDuration: 0, children: /* @__PURE__ */ jsxs8("div", { className: "uf-space-y-3", children: [
|
|
1529
1376
|
/* @__PURE__ */ jsxs8("div", { className: selectContainerClass, children: [
|
|
1530
1377
|
/* @__PURE__ */ jsxs8("div", { children: [
|
|
1531
|
-
/* @__PURE__ */
|
|
1378
|
+
/* @__PURE__ */ jsx11("div", { className: "uf-text-xs uf-text-muted-foreground uf-mb-2 uf-flex uf-items-center uf-gap-1", children: t.supportedToken }),
|
|
1532
1379
|
/* @__PURE__ */ jsxs8(
|
|
1533
1380
|
Select,
|
|
1534
1381
|
{
|
|
@@ -1536,8 +1383,8 @@ function TransferCryptoBase({
|
|
|
1536
1383
|
onValueChange: setToken,
|
|
1537
1384
|
disabled: tokensLoading || supportedTokens.length === 0,
|
|
1538
1385
|
children: [
|
|
1539
|
-
/* @__PURE__ */
|
|
1540
|
-
/* @__PURE__ */
|
|
1386
|
+
/* @__PURE__ */ jsx11(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__ */ jsx11(SelectValue, { children: tokensLoading ? /* @__PURE__ */ jsx11("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ jsx11("span", { className: "uf-text-xs uf-font-light uf-text-muted-foreground", children: t.loading }) }) : selectedToken ? renderTokenItem(selectedToken) : /* @__PURE__ */ jsx11("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ jsx11("span", { className: "uf-text-xs uf-font-normal", children: token }) }) }) }),
|
|
1387
|
+
/* @__PURE__ */ jsx11(SelectContent, { className: "uf-bg-secondary uf-border uf-text-foreground uf-max-h-[300px]", children: supportedTokens.map((tokenData) => /* @__PURE__ */ jsx11(
|
|
1541
1388
|
SelectItem,
|
|
1542
1389
|
{
|
|
1543
1390
|
value: tokenData.symbol,
|
|
@@ -1560,23 +1407,23 @@ function TransferCryptoBase({
|
|
|
1560
1407
|
t.minDeposit.label
|
|
1561
1408
|
] }),
|
|
1562
1409
|
/* @__PURE__ */ jsxs8(Tooltip, { children: [
|
|
1563
|
-
/* @__PURE__ */
|
|
1410
|
+
/* @__PURE__ */ jsx11(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx11(
|
|
1564
1411
|
"span",
|
|
1565
1412
|
{
|
|
1566
1413
|
className: "uf-inline-flex uf-cursor-pointer uf-transition-colors hover:uf-text-foreground",
|
|
1567
1414
|
tabIndex: 0,
|
|
1568
1415
|
role: "button",
|
|
1569
1416
|
"aria-label": "Minimum deposit information",
|
|
1570
|
-
children: /* @__PURE__ */
|
|
1417
|
+
children: /* @__PURE__ */ jsx11(Info, { className: "uf-w-3 uf-h-3" })
|
|
1571
1418
|
}
|
|
1572
1419
|
) }),
|
|
1573
|
-
/* @__PURE__ */
|
|
1420
|
+
/* @__PURE__ */ jsx11(
|
|
1574
1421
|
TooltipContent,
|
|
1575
1422
|
{
|
|
1576
1423
|
side: "left",
|
|
1577
1424
|
align: "center",
|
|
1578
1425
|
className: "uf-max-w-[200px]",
|
|
1579
|
-
children: /* @__PURE__ */
|
|
1426
|
+
children: /* @__PURE__ */ jsx11("p", { children: t.minDeposit.tooltip })
|
|
1580
1427
|
}
|
|
1581
1428
|
)
|
|
1582
1429
|
] })
|
|
@@ -1588,13 +1435,13 @@ function TransferCryptoBase({
|
|
|
1588
1435
|
onValueChange: setChain,
|
|
1589
1436
|
disabled: tokensLoading || availableChainsForToken.length === 0,
|
|
1590
1437
|
children: [
|
|
1591
|
-
/* @__PURE__ */
|
|
1592
|
-
/* @__PURE__ */
|
|
1438
|
+
/* @__PURE__ */ jsx11(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__ */ jsx11(SelectValue, { children: tokensLoading ? /* @__PURE__ */ jsx11("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ jsx11("span", { className: "uf-text-xs uf-font-light uf-text-muted-foreground", children: t.loading }) }) : currentChainFromBackend ? renderChainItem(currentChainFromBackend) : currentChainData ? renderChainItem(currentChainData) : /* @__PURE__ */ jsx11("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ jsx11("span", { className: "uf-text-xs uf-font-normal", children: chain }) }) }) }),
|
|
1439
|
+
/* @__PURE__ */ jsx11(SelectContent, { className: "uf-bg-secondary uf-border uf-text-foreground uf-max-h-[300px]", children: availableChainsForToken.length === 0 ? /* @__PURE__ */ jsx11("div", { className: "uf-px-2 uf-py-3 uf-text-xs uf-text-muted-foreground uf-text-center", children: t.noChainsAvailable }) : availableChainsForToken.map((chainData) => {
|
|
1593
1440
|
const chainKey = getChainKey(
|
|
1594
1441
|
chainData.chain_id,
|
|
1595
1442
|
chainData.chain_type
|
|
1596
1443
|
);
|
|
1597
|
-
return /* @__PURE__ */
|
|
1444
|
+
return /* @__PURE__ */ jsx11(
|
|
1598
1445
|
SelectItem,
|
|
1599
1446
|
{
|
|
1600
1447
|
value: chainKey,
|
|
@@ -1609,14 +1456,14 @@ function TransferCryptoBase({
|
|
|
1609
1456
|
)
|
|
1610
1457
|
] })
|
|
1611
1458
|
] }),
|
|
1612
|
-
/* @__PURE__ */
|
|
1459
|
+
/* @__PURE__ */ jsx11("div", { className: "uf-flex uf-justify-center uf-py-2", children: /* @__PURE__ */ jsx11("div", { className: "uf-bg-card uf-p-4 uf-rounded-2xl uf-shadow-lg uf-border uf-border-border", children: loading ? /* @__PURE__ */ jsx11(
|
|
1613
1460
|
"div",
|
|
1614
1461
|
{
|
|
1615
1462
|
className: "uf-flex uf-items-center uf-justify-center",
|
|
1616
1463
|
style: { width: 180, height: 180 },
|
|
1617
|
-
children: /* @__PURE__ */
|
|
1464
|
+
children: /* @__PURE__ */ jsx11("div", { className: "uf-text-foreground uf-text-sm", children: t.loadingQRCode })
|
|
1618
1465
|
}
|
|
1619
|
-
) : depositAddress ? /* @__PURE__ */
|
|
1466
|
+
) : depositAddress ? /* @__PURE__ */ jsx11(
|
|
1620
1467
|
StyledQRCode,
|
|
1621
1468
|
{
|
|
1622
1469
|
value: depositAddress,
|
|
@@ -1626,12 +1473,12 @@ function TransferCryptoBase({
|
|
|
1626
1473
|
darkMode: isDarkMode
|
|
1627
1474
|
},
|
|
1628
1475
|
`qr-${depositAddress}-${chain}`
|
|
1629
|
-
) : /* @__PURE__ */
|
|
1476
|
+
) : /* @__PURE__ */ jsx11(
|
|
1630
1477
|
"div",
|
|
1631
1478
|
{
|
|
1632
1479
|
className: "uf-flex uf-items-center uf-justify-center",
|
|
1633
1480
|
style: { width: 180, height: 180 },
|
|
1634
|
-
children: /* @__PURE__ */
|
|
1481
|
+
children: /* @__PURE__ */ jsx11("div", { className: "uf-text-red-400 uf-text-sm", children: t.noAddressAvailable })
|
|
1635
1482
|
}
|
|
1636
1483
|
) }) }),
|
|
1637
1484
|
/* @__PURE__ */ jsxs8("div", { children: [
|
|
@@ -1639,61 +1486,43 @@ function TransferCryptoBase({
|
|
|
1639
1486
|
/* @__PURE__ */ jsxs8("div", { className: "uf-flex uf-items-center uf-gap-1", children: [
|
|
1640
1487
|
t.depositAddress.label,
|
|
1641
1488
|
/* @__PURE__ */ jsxs8(Tooltip, { children: [
|
|
1642
|
-
/* @__PURE__ */
|
|
1489
|
+
/* @__PURE__ */ jsx11(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx11(
|
|
1643
1490
|
"span",
|
|
1644
1491
|
{
|
|
1645
1492
|
className: "uf-inline-flex uf-cursor-pointer uf-transition-colors hover:uf-text-foreground",
|
|
1646
1493
|
tabIndex: 0,
|
|
1647
1494
|
role: "button",
|
|
1648
1495
|
"aria-label": "Deposit address information",
|
|
1649
|
-
children: /* @__PURE__ */
|
|
1496
|
+
children: /* @__PURE__ */ jsx11(Info, { className: "uf-w-3 uf-h-3" })
|
|
1650
1497
|
}
|
|
1651
1498
|
) }),
|
|
1652
|
-
/* @__PURE__ */
|
|
1499
|
+
/* @__PURE__ */ jsx11(
|
|
1653
1500
|
TooltipContent,
|
|
1654
1501
|
{
|
|
1655
1502
|
side: "top",
|
|
1656
1503
|
align: "center",
|
|
1657
1504
|
className: "uf-max-w-[240px]",
|
|
1658
|
-
children: /* @__PURE__ */
|
|
1505
|
+
children: /* @__PURE__ */ jsx11("p", { children: t.depositAddress.tooltip.replace("{{token}}", token) })
|
|
1659
1506
|
}
|
|
1660
1507
|
)
|
|
1661
1508
|
] })
|
|
1662
1509
|
] }),
|
|
1663
|
-
|
|
1664
|
-
"
|
|
1665
|
-
{
|
|
1666
|
-
onClick: handleCopyAddress,
|
|
1667
|
-
disabled: loading || !depositAddress,
|
|
1668
|
-
className: "uf-flex uf-items-center uf-gap-1 uf-text-xs uf-text-muted-foreground hover:uf-text-foreground uf-transition-colors disabled:uf-opacity-50 disabled:uf-cursor-not-allowed",
|
|
1669
|
-
children: copied ? /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
1670
|
-
/* @__PURE__ */ jsx12(Check2, { className: "uf-w-3 uf-h-3" }),
|
|
1671
|
-
/* @__PURE__ */ jsx12("span", { children: t.copied })
|
|
1672
|
-
] }) : /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
1673
|
-
/* @__PURE__ */ jsx12(Copy, { className: "uf-w-3 uf-h-3" }),
|
|
1674
|
-
/* @__PURE__ */ jsx12("span", { children: t.copyAddress })
|
|
1675
|
-
] })
|
|
1676
|
-
}
|
|
1677
|
-
)
|
|
1678
|
-
] }),
|
|
1679
|
-
loading ? /* @__PURE__ */ jsx12("div", { className: "uf-bg-secondary uf-rounded-lg uf-px-3 uf-py-2.5 uf-text-xs uf-text-muted-foreground uf-animate-pulse", children: t.loading }) : error ? /* @__PURE__ */ jsx12("div", { className: "uf-bg-secondary uf-rounded-lg uf-px-3 uf-py-2.5 uf-text-xs uf-text-red-400", children: error }) : /* @__PURE__ */ jsx12("div", { className: "uf-bg-secondary uf-rounded-lg uf-px-3 uf-py-2.5 uf-text-xs uf-font-mono uf-break-all", children: depositAddress || t.noAddressAvailable })
|
|
1680
|
-
] }),
|
|
1681
|
-
copyButtonMode === "fullWidth" && /* @__PURE__ */ jsx12(
|
|
1682
|
-
Button,
|
|
1683
|
-
{
|
|
1684
|
-
onClick: handleCopyAddress,
|
|
1685
|
-
disabled: loading || !depositAddress,
|
|
1686
|
-
className: "uf-w-full uf-bg-secondary hover:uf-bg-accent uf-text-foreground uf-rounded-lg uf-h-9 uf-text-sm uf-font-medium disabled:uf-opacity-50 disabled:uf-cursor-not-allowed",
|
|
1687
|
-
children: copied ? /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
1688
|
-
/* @__PURE__ */ jsx12(Check2, { className: "uf-w-4 uf-h-4 uf-mr-2" }),
|
|
1510
|
+
/* @__PURE__ */ jsxs8("span", { className: `uf-flex uf-items-center uf-gap-1 uf-text-green-500 uf-transition-opacity uf-duration-200 ${copied ? "uf-opacity-100" : "uf-opacity-0"}`, children: [
|
|
1511
|
+
/* @__PURE__ */ jsx11(Check2, { className: "uf-w-3 uf-h-3" }),
|
|
1689
1512
|
t.copied
|
|
1690
|
-
] }) : /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
1691
|
-
/* @__PURE__ */ jsx12(Copy, { className: "uf-w-4 uf-h-4 uf-mr-2" }),
|
|
1692
|
-
t.copyAddress
|
|
1693
1513
|
] })
|
|
1694
|
-
}
|
|
1695
|
-
|
|
1696
|
-
|
|
1514
|
+
] }),
|
|
1515
|
+
loading ? /* @__PURE__ */ jsx11("div", { className: "uf-bg-secondary uf-rounded-lg uf-px-3 uf-py-2.5 uf-text-xs uf-text-muted-foreground uf-animate-pulse", children: t.loading }) : error ? /* @__PURE__ */ jsx11("div", { className: "uf-bg-secondary uf-rounded-lg uf-px-3 uf-py-2.5 uf-text-xs uf-text-red-400", children: error }) : /* @__PURE__ */ jsx11(
|
|
1516
|
+
"button",
|
|
1517
|
+
{
|
|
1518
|
+
onClick: handleCopyAddress,
|
|
1519
|
+
disabled: !depositAddress,
|
|
1520
|
+
className: "uf-w-full uf-bg-secondary hover:uf-bg-accent uf-rounded-lg uf-px-3 uf-py-2.5 uf-text-xs uf-font-mono uf-break-all uf-text-left uf-transition-colors uf-cursor-pointer disabled:uf-opacity-50 disabled:uf-cursor-not-allowed",
|
|
1521
|
+
children: depositAddress || t.noAddressAvailable
|
|
1522
|
+
}
|
|
1523
|
+
)
|
|
1524
|
+
] }),
|
|
1525
|
+
/* @__PURE__ */ jsxs8("div", { className: "uf-bg-secondary uf-rounded-xl uf-px-3", children: [
|
|
1697
1526
|
/* @__PURE__ */ jsxs8(
|
|
1698
1527
|
"button",
|
|
1699
1528
|
{
|
|
@@ -1701,7 +1530,7 @@ function TransferCryptoBase({
|
|
|
1701
1530
|
className: "uf-w-full uf-flex uf-items-center uf-justify-between uf-py-2.5",
|
|
1702
1531
|
children: [
|
|
1703
1532
|
/* @__PURE__ */ jsxs8("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
1704
|
-
/* @__PURE__ */
|
|
1533
|
+
/* @__PURE__ */ jsx11("div", { className: "uf-bg-card uf-rounded-full uf-p-1", children: /* @__PURE__ */ jsx11(DollarSign, { className: "uf-w-3 uf-h-3" }) }),
|
|
1705
1534
|
/* @__PURE__ */ jsxs8("span", { className: "uf-text-xs", children: [
|
|
1706
1535
|
t.priceImpact.label,
|
|
1707
1536
|
":",
|
|
@@ -1712,7 +1541,7 @@ function TransferCryptoBase({
|
|
|
1712
1541
|
] })
|
|
1713
1542
|
] }),
|
|
1714
1543
|
/* @__PURE__ */ jsxs8(Tooltip, { children: [
|
|
1715
|
-
/* @__PURE__ */
|
|
1544
|
+
/* @__PURE__ */ jsx11(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx11(
|
|
1716
1545
|
"span",
|
|
1717
1546
|
{
|
|
1718
1547
|
className: "uf-inline-flex uf-cursor-pointer uf-text-muted-foreground uf-transition-colors hover:uf-text-foreground",
|
|
@@ -1725,27 +1554,27 @@ function TransferCryptoBase({
|
|
|
1725
1554
|
tabIndex: 0,
|
|
1726
1555
|
role: "button",
|
|
1727
1556
|
"aria-label": "Price impact information",
|
|
1728
|
-
children: /* @__PURE__ */
|
|
1557
|
+
children: /* @__PURE__ */ jsx11(Info, { className: "uf-w-3 uf-h-3" })
|
|
1729
1558
|
}
|
|
1730
1559
|
) }),
|
|
1731
|
-
/* @__PURE__ */
|
|
1560
|
+
/* @__PURE__ */ jsx11(
|
|
1732
1561
|
TooltipContent,
|
|
1733
1562
|
{
|
|
1734
1563
|
side: "top",
|
|
1735
1564
|
align: "center",
|
|
1736
1565
|
className: "uf-max-w-[240px]",
|
|
1737
|
-
children: /* @__PURE__ */
|
|
1566
|
+
children: /* @__PURE__ */ jsx11("p", { children: t.priceImpact.tooltip })
|
|
1738
1567
|
}
|
|
1739
1568
|
)
|
|
1740
1569
|
] })
|
|
1741
1570
|
] }),
|
|
1742
|
-
detailsExpanded ? /* @__PURE__ */
|
|
1571
|
+
detailsExpanded ? /* @__PURE__ */ jsx11(ChevronUp3, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground" }) : /* @__PURE__ */ jsx11(ChevronDown3, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground" })
|
|
1743
1572
|
]
|
|
1744
1573
|
}
|
|
1745
1574
|
),
|
|
1746
1575
|
detailsExpanded && /* @__PURE__ */ jsxs8("div", { className: "uf-pb-3 uf-space-y-2.5", children: [
|
|
1747
1576
|
/* @__PURE__ */ jsxs8("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
1748
|
-
/* @__PURE__ */
|
|
1577
|
+
/* @__PURE__ */ jsx11("div", { className: "uf-bg-card uf-rounded-full uf-p-1", children: /* @__PURE__ */ jsx11(ShieldCheck, { className: "uf-w-3 uf-h-3" }) }),
|
|
1749
1578
|
/* @__PURE__ */ jsxs8("span", { className: "uf-text-xs", children: [
|
|
1750
1579
|
t.slippage.label,
|
|
1751
1580
|
":",
|
|
@@ -1758,42 +1587,42 @@ function TransferCryptoBase({
|
|
|
1758
1587
|
] })
|
|
1759
1588
|
] }),
|
|
1760
1589
|
/* @__PURE__ */ jsxs8(Tooltip, { children: [
|
|
1761
|
-
/* @__PURE__ */
|
|
1590
|
+
/* @__PURE__ */ jsx11(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx11(
|
|
1762
1591
|
"span",
|
|
1763
1592
|
{
|
|
1764
1593
|
className: "uf-inline-flex uf-cursor-pointer uf-text-muted-foreground uf-transition-colors hover:uf-text-foreground",
|
|
1765
1594
|
tabIndex: 0,
|
|
1766
1595
|
role: "button",
|
|
1767
1596
|
"aria-label": "Slippage information",
|
|
1768
|
-
children: /* @__PURE__ */
|
|
1597
|
+
children: /* @__PURE__ */ jsx11(Info, { className: "uf-w-3 uf-h-3" })
|
|
1769
1598
|
}
|
|
1770
1599
|
) }),
|
|
1771
|
-
/* @__PURE__ */
|
|
1600
|
+
/* @__PURE__ */ jsx11(
|
|
1772
1601
|
TooltipContent,
|
|
1773
1602
|
{
|
|
1774
1603
|
side: "top",
|
|
1775
1604
|
align: "center",
|
|
1776
1605
|
className: "uf-max-w-[240px]",
|
|
1777
|
-
children: /* @__PURE__ */
|
|
1606
|
+
children: /* @__PURE__ */ jsx11("p", { children: t.slippage.tooltip })
|
|
1778
1607
|
}
|
|
1779
1608
|
)
|
|
1780
1609
|
] })
|
|
1781
1610
|
] }),
|
|
1782
1611
|
/* @__PURE__ */ jsxs8("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
1783
|
-
/* @__PURE__ */
|
|
1612
|
+
/* @__PURE__ */ jsx11("div", { className: "uf-bg-card uf-rounded-full uf-p-1", children: /* @__PURE__ */ jsx11(Clock, { className: "uf-w-3 uf-h-3" }) }),
|
|
1784
1613
|
/* @__PURE__ */ jsxs8("span", { className: "uf-text-xs", children: [
|
|
1785
1614
|
t.processingTime.label,
|
|
1786
1615
|
":",
|
|
1787
1616
|
" ",
|
|
1788
|
-
/* @__PURE__ */
|
|
1617
|
+
/* @__PURE__ */ jsx11("span", { className: "uf-text-foreground", children: formatProcessingTime(processingTime) })
|
|
1789
1618
|
] })
|
|
1790
1619
|
] }),
|
|
1791
1620
|
/* @__PURE__ */ jsxs8("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
1792
|
-
/* @__PURE__ */
|
|
1621
|
+
/* @__PURE__ */ jsx11("div", { className: "uf-bg-card uf-rounded-full uf-p-1", children: /* @__PURE__ */ jsx11(FileText, { className: "uf-w-3 uf-h-3" }) }),
|
|
1793
1622
|
/* @__PURE__ */ jsxs8("span", { className: "uf-text-xs", children: [
|
|
1794
1623
|
t.help.needHelp,
|
|
1795
1624
|
" ",
|
|
1796
|
-
/* @__PURE__ */
|
|
1625
|
+
/* @__PURE__ */ jsx11(
|
|
1797
1626
|
"a",
|
|
1798
1627
|
{
|
|
1799
1628
|
href: "#",
|
|
@@ -1803,34 +1632,34 @@ function TransferCryptoBase({
|
|
|
1803
1632
|
)
|
|
1804
1633
|
] })
|
|
1805
1634
|
] })
|
|
1806
|
-
] }),
|
|
1807
|
-
/* @__PURE__ */ jsxs8("div", { className: "uf-flex uf-items-center uf-justify-between uf-text-xs uf-pt-2", children: [
|
|
1808
|
-
/* @__PURE__ */ jsx12(
|
|
1809
|
-
"a",
|
|
1810
|
-
{
|
|
1811
|
-
href: "https://unifold.io/terms",
|
|
1812
|
-
className: "uf-text-muted-foreground uf-underline hover:uf-text-foreground uf-transition-colors",
|
|
1813
|
-
target: "_blank",
|
|
1814
|
-
children: t.terms.termsApply
|
|
1815
|
-
}
|
|
1816
|
-
),
|
|
1817
|
-
depositExecutions.length > 1 && /* @__PURE__ */ jsxs8(
|
|
1818
|
-
"button",
|
|
1819
|
-
{
|
|
1820
|
-
onClick: () => setDepositsModalOpen(true),
|
|
1821
|
-
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",
|
|
1822
|
-
children: [
|
|
1823
|
-
/* @__PURE__ */ jsx12(Clock, { className: "uf-w-3.5 uf-h-3.5" }),
|
|
1824
|
-
"Track deposits (",
|
|
1825
|
-
depositExecutions.length,
|
|
1826
|
-
")",
|
|
1827
|
-
/* @__PURE__ */ jsx12(ChevronRight2, { className: "uf-w-3 uf-h-3" })
|
|
1828
|
-
]
|
|
1829
|
-
}
|
|
1830
|
-
)
|
|
1831
1635
|
] })
|
|
1832
1636
|
] }),
|
|
1833
|
-
|
|
1637
|
+
/* @__PURE__ */ jsxs8("div", { className: "uf-flex uf-items-center uf-justify-between uf-text-xs uf-pt-2", children: [
|
|
1638
|
+
/* @__PURE__ */ jsx11(
|
|
1639
|
+
"a",
|
|
1640
|
+
{
|
|
1641
|
+
href: "https://unifold.io/terms",
|
|
1642
|
+
className: "uf-text-muted-foreground uf-underline hover:uf-text-foreground uf-transition-colors",
|
|
1643
|
+
target: "_blank",
|
|
1644
|
+
children: t.terms.termsApply
|
|
1645
|
+
}
|
|
1646
|
+
),
|
|
1647
|
+
depositExecutions.length > 1 && /* @__PURE__ */ jsxs8(
|
|
1648
|
+
"button",
|
|
1649
|
+
{
|
|
1650
|
+
onClick: () => setDepositsModalOpen(true),
|
|
1651
|
+
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",
|
|
1652
|
+
children: [
|
|
1653
|
+
/* @__PURE__ */ jsx11(Clock, { className: "uf-w-3.5 uf-h-3.5" }),
|
|
1654
|
+
"Track deposits (",
|
|
1655
|
+
depositExecutions.length,
|
|
1656
|
+
")",
|
|
1657
|
+
/* @__PURE__ */ jsx11(ChevronRight2, { className: "uf-w-3 uf-h-3" })
|
|
1658
|
+
]
|
|
1659
|
+
}
|
|
1660
|
+
)
|
|
1661
|
+
] }),
|
|
1662
|
+
depositExecutions.length === 1 && /* @__PURE__ */ jsx11("div", { className: "uf-fixed uf-bottom-4 uf-left-1/2 uf--translate-x-1/2 uf-w-[360px] uf-max-w-[calc(100vw-2rem)] uf-z-[100]", children: /* @__PURE__ */ jsx11(
|
|
1834
1663
|
DepositSuccessToast,
|
|
1835
1664
|
{
|
|
1836
1665
|
depositTx: depositExecutions[0].transaction_hash,
|
|
@@ -1838,13 +1667,14 @@ function TransferCryptoBase({
|
|
|
1838
1667
|
orderFilledAt: depositExecutions[0].updated_at || (/* @__PURE__ */ new Date()).toISOString(),
|
|
1839
1668
|
explorerUrl: depositExecutions[0].explorer_url,
|
|
1840
1669
|
status: depositExecutions[0].status,
|
|
1841
|
-
tokenIconUrl: depositExecutions[0].
|
|
1670
|
+
tokenIconUrl: depositExecutions[0].destination_token_metadata?.icon_url,
|
|
1842
1671
|
sourceAmountBaseUnit: depositExecutions[0].source_amount_base_unit,
|
|
1843
|
-
onClose: () => setDepositExecutions([])
|
|
1672
|
+
onClose: () => setDepositExecutions([]),
|
|
1673
|
+
execution: depositExecutions[0]
|
|
1844
1674
|
},
|
|
1845
1675
|
depositExecutions[0].id
|
|
1846
1676
|
) }),
|
|
1847
|
-
/* @__PURE__ */
|
|
1677
|
+
/* @__PURE__ */ jsx11(
|
|
1848
1678
|
DepositsModal,
|
|
1849
1679
|
{
|
|
1850
1680
|
open: depositsModalOpen,
|
|
@@ -1859,9 +1689,9 @@ function TransferCryptoBase({
|
|
|
1859
1689
|
}
|
|
1860
1690
|
|
|
1861
1691
|
// src/components/deposits/TransferCrypto.tsx
|
|
1862
|
-
import { jsx as
|
|
1692
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
1863
1693
|
function TransferCrypto(props) {
|
|
1864
|
-
return /* @__PURE__ */
|
|
1694
|
+
return /* @__PURE__ */ jsx12(
|
|
1865
1695
|
TransferCryptoBase,
|
|
1866
1696
|
{
|
|
1867
1697
|
...props,
|
|
@@ -1872,16 +1702,27 @@ function TransferCrypto(props) {
|
|
|
1872
1702
|
}
|
|
1873
1703
|
|
|
1874
1704
|
// src/components/deposits/BuyWithCard.tsx
|
|
1875
|
-
import { useState as
|
|
1876
|
-
import { ChevronDown as
|
|
1705
|
+
import { useState as useState6, useEffect as useEffect5 } from "react";
|
|
1706
|
+
import { ChevronDown as ChevronDown4, ChevronRight as ChevronRight3 } from "lucide-react";
|
|
1707
|
+
import {
|
|
1708
|
+
getMeldQuotes,
|
|
1709
|
+
createMeldSession,
|
|
1710
|
+
createDepositAddress as createDepositAddress2,
|
|
1711
|
+
getWalletByChainType as getWalletByChainType2,
|
|
1712
|
+
getFiatCurrencies,
|
|
1713
|
+
getIconUrlWithCdn,
|
|
1714
|
+
getPreferredIconUrl as getPreferredIconUrl2,
|
|
1715
|
+
getSupportedDepositTokens as getSupportedDepositTokens2
|
|
1716
|
+
} from "@unifold/core";
|
|
1877
1717
|
|
|
1878
1718
|
// src/components/deposits/CurrencyModal.tsx
|
|
1879
|
-
import { useState as
|
|
1719
|
+
import { useState as useState5 } from "react";
|
|
1880
1720
|
import { Search } from "lucide-react";
|
|
1881
1721
|
|
|
1882
1722
|
// src/components/currency/CurrencyListItem.tsx
|
|
1883
1723
|
import { Check as Check3 } from "lucide-react";
|
|
1884
|
-
import {
|
|
1724
|
+
import { getPreferredIconUrl } from "@unifold/core";
|
|
1725
|
+
import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1885
1726
|
function CurrencyListItem({
|
|
1886
1727
|
currency,
|
|
1887
1728
|
isSelected,
|
|
@@ -1895,7 +1736,7 @@ function CurrencyListItem({
|
|
|
1895
1736
|
className: "uf-w-full uf-bg-secondary hover:uf-bg-accent uf-transition-colors uf-rounded-xl uf-p-3 uf-flex uf-items-center uf-justify-between uf-group",
|
|
1896
1737
|
children: [
|
|
1897
1738
|
/* @__PURE__ */ jsxs9("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
1898
|
-
/* @__PURE__ */
|
|
1739
|
+
/* @__PURE__ */ jsx13(
|
|
1899
1740
|
"img",
|
|
1900
1741
|
{
|
|
1901
1742
|
src: iconUrl,
|
|
@@ -1904,18 +1745,18 @@ function CurrencyListItem({
|
|
|
1904
1745
|
}
|
|
1905
1746
|
),
|
|
1906
1747
|
/* @__PURE__ */ jsxs9("div", { className: "uf-text-left", children: [
|
|
1907
|
-
/* @__PURE__ */
|
|
1908
|
-
/* @__PURE__ */
|
|
1748
|
+
/* @__PURE__ */ jsx13("div", { className: "uf-text-sm uf-font-normal uf-text-foreground", children: currency.name }),
|
|
1749
|
+
/* @__PURE__ */ jsx13("div", { className: "uf-text-xs uf-text-muted-foreground uf-font-light", children: currency.currency_code.toUpperCase() })
|
|
1909
1750
|
] })
|
|
1910
1751
|
] }),
|
|
1911
|
-
isSelected && /* @__PURE__ */
|
|
1752
|
+
isSelected && /* @__PURE__ */ jsx13(Check3, { className: "uf-w-4 uf-h-4 uf-text-foreground" })
|
|
1912
1753
|
]
|
|
1913
1754
|
}
|
|
1914
1755
|
);
|
|
1915
1756
|
}
|
|
1916
1757
|
|
|
1917
1758
|
// src/components/currency/CurrencyListSection.tsx
|
|
1918
|
-
import { Fragment as Fragment3, jsx as
|
|
1759
|
+
import { Fragment as Fragment3, jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1919
1760
|
function CurrencyListSection({
|
|
1920
1761
|
title,
|
|
1921
1762
|
currencies,
|
|
@@ -1924,8 +1765,8 @@ function CurrencyListSection({
|
|
|
1924
1765
|
}) {
|
|
1925
1766
|
if (currencies.length === 0) return null;
|
|
1926
1767
|
return /* @__PURE__ */ jsxs10(Fragment3, { children: [
|
|
1927
|
-
/* @__PURE__ */
|
|
1928
|
-
currencies.map((currency) => /* @__PURE__ */
|
|
1768
|
+
/* @__PURE__ */ jsx14("div", { className: "uf-px-1 uf-pb-2", children: /* @__PURE__ */ jsx14("h3", { className: "uf-text-xs uf-font-light uf-text-muted-foreground", children: title }) }),
|
|
1769
|
+
currencies.map((currency) => /* @__PURE__ */ jsx14(
|
|
1929
1770
|
CurrencyListItem,
|
|
1930
1771
|
{
|
|
1931
1772
|
currency,
|
|
@@ -1938,7 +1779,7 @@ function CurrencyListSection({
|
|
|
1938
1779
|
}
|
|
1939
1780
|
|
|
1940
1781
|
// src/components/deposits/CurrencyModal.tsx
|
|
1941
|
-
import { jsx as
|
|
1782
|
+
import { jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1942
1783
|
function CurrencyModal({
|
|
1943
1784
|
open,
|
|
1944
1785
|
onOpenChange,
|
|
@@ -1948,7 +1789,7 @@ function CurrencyModal({
|
|
|
1948
1789
|
onSelectCurrency,
|
|
1949
1790
|
themeClass = ""
|
|
1950
1791
|
}) {
|
|
1951
|
-
const [searchQuery, setSearchQuery] =
|
|
1792
|
+
const [searchQuery, setSearchQuery] = useState5("");
|
|
1952
1793
|
const preferredCurrencies = preferredCurrencyCodes.map(
|
|
1953
1794
|
(code) => currencies.find(
|
|
1954
1795
|
(currency) => currency.currency_code.toLowerCase() === code.toLowerCase()
|
|
@@ -1975,8 +1816,8 @@ function CurrencyModal({
|
|
|
1975
1816
|
onOpenChange(false);
|
|
1976
1817
|
setSearchQuery("");
|
|
1977
1818
|
};
|
|
1978
|
-
return /* @__PURE__ */
|
|
1979
|
-
/* @__PURE__ */
|
|
1819
|
+
return /* @__PURE__ */ jsx15(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs11(DialogContent, { className: `sm:uf-max-w-[400px] !uf-bg-card uf-border-secondary uf-text-foreground uf-p-0 uf-gap-0 [&>button]:uf-hidden ${themeClass}`, children: [
|
|
1820
|
+
/* @__PURE__ */ jsx15(
|
|
1980
1821
|
DepositHeader,
|
|
1981
1822
|
{
|
|
1982
1823
|
title: "Currency",
|
|
@@ -1985,9 +1826,9 @@ function CurrencyModal({
|
|
|
1985
1826
|
onClose: handleClose
|
|
1986
1827
|
}
|
|
1987
1828
|
),
|
|
1988
|
-
/* @__PURE__ */
|
|
1989
|
-
/* @__PURE__ */
|
|
1990
|
-
/* @__PURE__ */
|
|
1829
|
+
/* @__PURE__ */ jsx15("div", { children: /* @__PURE__ */ jsxs11("div", { className: "uf-relative", children: [
|
|
1830
|
+
/* @__PURE__ */ jsx15(Search, { className: "uf-absolute uf-left-4 uf-top-1/2 uf--translate-y-1/2 uf-w-4 uf-h-4 uf-text-muted-foreground" }),
|
|
1831
|
+
/* @__PURE__ */ jsx15(
|
|
1991
1832
|
"input",
|
|
1992
1833
|
{
|
|
1993
1834
|
type: "text",
|
|
@@ -1998,8 +1839,8 @@ function CurrencyModal({
|
|
|
1998
1839
|
}
|
|
1999
1840
|
)
|
|
2000
1841
|
] }) }),
|
|
2001
|
-
/* @__PURE__ */
|
|
2002
|
-
/* @__PURE__ */
|
|
1842
|
+
/* @__PURE__ */ jsx15("div", { className: "uf-max-h-[500px] uf-overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:uf-hidden", children: /* @__PURE__ */ jsxs11("div", { className: "uf-space-y-2", children: [
|
|
1843
|
+
/* @__PURE__ */ jsx15(
|
|
2003
1844
|
CurrencyListSection,
|
|
2004
1845
|
{
|
|
2005
1846
|
title: "Popular currencies",
|
|
@@ -2008,8 +1849,8 @@ function CurrencyModal({
|
|
|
2008
1849
|
onSelect: handleSelect
|
|
2009
1850
|
}
|
|
2010
1851
|
),
|
|
2011
|
-
filteredPreferred.length > 0 && filteredOther.length > 0 && /* @__PURE__ */
|
|
2012
|
-
/* @__PURE__ */
|
|
1852
|
+
filteredPreferred.length > 0 && filteredOther.length > 0 && /* @__PURE__ */ jsx15("div", { className: "uf-h-2" }),
|
|
1853
|
+
/* @__PURE__ */ jsx15(
|
|
2013
1854
|
CurrencyListSection,
|
|
2014
1855
|
{
|
|
2015
1856
|
title: "All currencies",
|
|
@@ -2018,7 +1859,7 @@ function CurrencyModal({
|
|
|
2018
1859
|
onSelect: handleSelect
|
|
2019
1860
|
}
|
|
2020
1861
|
),
|
|
2021
|
-
filteredPreferred.length === 0 && filteredOther.length === 0 && /* @__PURE__ */
|
|
1862
|
+
filteredPreferred.length === 0 && filteredOther.length === 0 && /* @__PURE__ */ jsx15("div", { className: "uf-text-center uf-py-8 uf-text-muted-foreground uf-text-sm", children: "No currencies found" })
|
|
2022
1863
|
] }) })
|
|
2023
1864
|
] }) });
|
|
2024
1865
|
}
|
|
@@ -2072,7 +1913,7 @@ function useUserIp() {
|
|
|
2072
1913
|
}
|
|
2073
1914
|
|
|
2074
1915
|
// src/components/deposits/BuyWithCard.tsx
|
|
2075
|
-
import { jsx as
|
|
1916
|
+
import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2076
1917
|
var t2 = i18n.buyWithCard;
|
|
2077
1918
|
var QUICK_AMOUNTS = [100, 500, 1e3];
|
|
2078
1919
|
function getCurrencySymbol(currencyCode) {
|
|
@@ -2103,21 +1944,21 @@ function BuyWithCard({
|
|
|
2103
1944
|
wallets: externalWallets,
|
|
2104
1945
|
assetCdnUrl
|
|
2105
1946
|
}) {
|
|
2106
|
-
const [amount, setAmount] =
|
|
2107
|
-
const [currency, setCurrency] =
|
|
2108
|
-
const [showCurrencyModal, setShowCurrencyModal] =
|
|
2109
|
-
const [quotes, setQuotes] =
|
|
2110
|
-
const [quotesLoading, setQuotesLoading] =
|
|
2111
|
-
const [quotesError, setQuotesError] =
|
|
2112
|
-
const [internalView, setInternalView] =
|
|
1947
|
+
const [amount, setAmount] = useState6("500.00");
|
|
1948
|
+
const [currency, setCurrency] = useState6("usd");
|
|
1949
|
+
const [showCurrencyModal, setShowCurrencyModal] = useState6(false);
|
|
1950
|
+
const [quotes, setQuotes] = useState6([]);
|
|
1951
|
+
const [quotesLoading, setQuotesLoading] = useState6(false);
|
|
1952
|
+
const [quotesError, setQuotesError] = useState6(null);
|
|
1953
|
+
const [internalView, setInternalView] = useState6("amount");
|
|
2113
1954
|
const { userIpInfo, isLoading: isLoadingIp } = useUserIp();
|
|
2114
|
-
const [onrampSession, setOnrampSession] =
|
|
1955
|
+
const [onrampSession, setOnrampSession] = useState6(
|
|
2115
1956
|
null
|
|
2116
1957
|
);
|
|
2117
1958
|
const currentView = externalView ?? internalView;
|
|
2118
1959
|
const showQuotesView = currentView === "quotes";
|
|
2119
1960
|
const showOnrampView = currentView === "onramp";
|
|
2120
|
-
|
|
1961
|
+
useEffect5(() => {
|
|
2121
1962
|
if (externalView) {
|
|
2122
1963
|
setInternalView(externalView);
|
|
2123
1964
|
}
|
|
@@ -2130,21 +1971,21 @@ function BuyWithCard({
|
|
|
2130
1971
|
onViewChange?.(newView);
|
|
2131
1972
|
}
|
|
2132
1973
|
};
|
|
2133
|
-
const [selectedProvider, setSelectedProvider] =
|
|
1974
|
+
const [selectedProvider, setSelectedProvider] = useState6(
|
|
2134
1975
|
null
|
|
2135
1976
|
);
|
|
2136
|
-
const [isAutoSelected, setIsAutoSelected] =
|
|
2137
|
-
const [autoSelectedProvider, setAutoSelectedProvider] =
|
|
2138
|
-
const [hasManualSelection, setHasManualSelection] =
|
|
2139
|
-
const [internalWallets, setInternalWallets] =
|
|
2140
|
-
const [walletsLoading, setWalletsLoading] =
|
|
1977
|
+
const [isAutoSelected, setIsAutoSelected] = useState6(true);
|
|
1978
|
+
const [autoSelectedProvider, setAutoSelectedProvider] = useState6(null);
|
|
1979
|
+
const [hasManualSelection, setHasManualSelection] = useState6(false);
|
|
1980
|
+
const [internalWallets, setInternalWallets] = useState6([]);
|
|
1981
|
+
const [walletsLoading, setWalletsLoading] = useState6(!externalWallets?.length);
|
|
2141
1982
|
const wallets = externalWallets?.length ? externalWallets : internalWallets;
|
|
2142
|
-
const [countdown, setCountdown] =
|
|
2143
|
-
const [fiatCurrencies, setFiatCurrencies] =
|
|
2144
|
-
const [preferredCurrencyCodes, setPreferredCurrencyCodes] =
|
|
2145
|
-
const [currenciesLoading, setCurrenciesLoading] =
|
|
2146
|
-
const [supportedTokens, setSupportedTokens] =
|
|
2147
|
-
const destinationWallet =
|
|
1983
|
+
const [countdown, setCountdown] = useState6(60);
|
|
1984
|
+
const [fiatCurrencies, setFiatCurrencies] = useState6([]);
|
|
1985
|
+
const [preferredCurrencyCodes, setPreferredCurrencyCodes] = useState6([]);
|
|
1986
|
+
const [currenciesLoading, setCurrenciesLoading] = useState6(true);
|
|
1987
|
+
const [supportedTokens, setSupportedTokens] = useState6([]);
|
|
1988
|
+
const destinationWallet = getWalletByChainType2(wallets, "ethereum");
|
|
2148
1989
|
const walletDestinationChainId = destinationWallet?.destination_chain_id;
|
|
2149
1990
|
const resolvedDestinationChainId = destinationChainId || walletDestinationChainId;
|
|
2150
1991
|
const displayTokenSymbol = destinationTokenSymbol || supportedTokens[0]?.symbol || "USDC";
|
|
@@ -2152,7 +1993,7 @@ function BuyWithCard({
|
|
|
2152
1993
|
const destinationChain = destinationToken?.chains.find(
|
|
2153
1994
|
(c) => c.chain_id === resolvedDestinationChainId
|
|
2154
1995
|
);
|
|
2155
|
-
|
|
1996
|
+
useEffect5(() => {
|
|
2156
1997
|
async function fetchFiatCurrencies() {
|
|
2157
1998
|
try {
|
|
2158
1999
|
const response = await getFiatCurrencies(publishableKey);
|
|
@@ -2166,7 +2007,7 @@ function BuyWithCard({
|
|
|
2166
2007
|
}
|
|
2167
2008
|
fetchFiatCurrencies();
|
|
2168
2009
|
}, [publishableKey]);
|
|
2169
|
-
|
|
2010
|
+
useEffect5(() => {
|
|
2170
2011
|
if (externalWallets?.length) {
|
|
2171
2012
|
setWalletsLoading(false);
|
|
2172
2013
|
return;
|
|
@@ -2177,9 +2018,9 @@ function BuyWithCard({
|
|
|
2177
2018
|
if (isCancelled) return;
|
|
2178
2019
|
setWalletsLoading(true);
|
|
2179
2020
|
try {
|
|
2180
|
-
const response = await
|
|
2021
|
+
const response = await createDepositAddress2(
|
|
2181
2022
|
{
|
|
2182
|
-
|
|
2023
|
+
external_user_id: userId,
|
|
2183
2024
|
recipient_address: recipientAddress,
|
|
2184
2025
|
destination_chain_type: destinationChainType,
|
|
2185
2026
|
destination_chain_id: destinationChainId,
|
|
@@ -2207,10 +2048,10 @@ function BuyWithCard({
|
|
|
2207
2048
|
}
|
|
2208
2049
|
};
|
|
2209
2050
|
}, [userId, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, publishableKey, externalWallets]);
|
|
2210
|
-
|
|
2051
|
+
useEffect5(() => {
|
|
2211
2052
|
async function fetchSupportedTokens() {
|
|
2212
2053
|
try {
|
|
2213
|
-
const response = await
|
|
2054
|
+
const response = await getSupportedDepositTokens2(publishableKey);
|
|
2214
2055
|
setSupportedTokens(response.data);
|
|
2215
2056
|
} catch (err) {
|
|
2216
2057
|
console.error("Error fetching supported tokens:", err);
|
|
@@ -2218,7 +2059,7 @@ function BuyWithCard({
|
|
|
2218
2059
|
}
|
|
2219
2060
|
fetchSupportedTokens();
|
|
2220
2061
|
}, [publishableKey]);
|
|
2221
|
-
|
|
2062
|
+
useEffect5(() => {
|
|
2222
2063
|
const amountNum = parseFloat(amount);
|
|
2223
2064
|
if (isNaN(amountNum) || amountNum <= 0) {
|
|
2224
2065
|
setQuotes([]);
|
|
@@ -2298,7 +2139,7 @@ function BuyWithCard({
|
|
|
2298
2139
|
setQuotesLoading(false);
|
|
2299
2140
|
}
|
|
2300
2141
|
};
|
|
2301
|
-
|
|
2142
|
+
useEffect5(() => {
|
|
2302
2143
|
if (quotes.length === 0) return;
|
|
2303
2144
|
const timer = setInterval(() => {
|
|
2304
2145
|
setCountdown((prev) => {
|
|
@@ -2333,7 +2174,7 @@ function BuyWithCard({
|
|
|
2333
2174
|
const handleContinue = async () => {
|
|
2334
2175
|
if (!selectedProvider) return;
|
|
2335
2176
|
try {
|
|
2336
|
-
const wallet =
|
|
2177
|
+
const wallet = getWalletByChainType2(wallets, "ethereum");
|
|
2337
2178
|
if (!wallet?.address) {
|
|
2338
2179
|
setQuotesError("Wallet address not available");
|
|
2339
2180
|
return;
|
|
@@ -2377,32 +2218,32 @@ function BuyWithCard({
|
|
|
2377
2218
|
/* @__PURE__ */ jsxs12(
|
|
2378
2219
|
"div",
|
|
2379
2220
|
{
|
|
2380
|
-
className: `uf-transition-all uf-duration-300 ${showQuotesView || showOnrampView ? "uf-opacity-0 uf-pointer-events-none uf-absolute uf-inset-0" : "uf-opacity-100"}`,
|
|
2221
|
+
className: `uf-transition-all uf-duration-300 uf-min-h-[420px] ${showQuotesView || showOnrampView ? "uf-opacity-0 uf-pointer-events-none uf-absolute uf-inset-0" : "uf-opacity-100"}`,
|
|
2381
2222
|
children: [
|
|
2382
2223
|
/* @__PURE__ */ jsxs12("div", { className: "uf-mb-6 uf-pt-4", children: [
|
|
2383
|
-
/* @__PURE__ */
|
|
2224
|
+
/* @__PURE__ */ jsx16("div", { className: "uf-flex uf-justify-center uf-mb-4", children: /* @__PURE__ */ jsxs12(
|
|
2384
2225
|
"button",
|
|
2385
2226
|
{
|
|
2386
2227
|
onClick: () => setShowCurrencyModal(true),
|
|
2387
2228
|
disabled: currenciesLoading,
|
|
2388
2229
|
className: "uf-flex uf-items-center uf-gap-1.5 uf-px-3 uf-py-1.5 uf-rounded-lg uf-bg-secondary hover:uf-bg-accent uf-transition-colors disabled:uf-opacity-50 disabled:uf-cursor-not-allowed",
|
|
2389
2230
|
children: [
|
|
2390
|
-
selectedCurrencyData && /* @__PURE__ */
|
|
2231
|
+
selectedCurrencyData && /* @__PURE__ */ jsx16(
|
|
2391
2232
|
"img",
|
|
2392
2233
|
{
|
|
2393
|
-
src:
|
|
2234
|
+
src: getPreferredIconUrl2(selectedCurrencyData.icon_urls, "png") || selectedCurrencyData.icon_url,
|
|
2394
2235
|
alt: selectedCurrencyData.name,
|
|
2395
2236
|
className: "uf-w-4 uf-h-4"
|
|
2396
2237
|
}
|
|
2397
2238
|
),
|
|
2398
|
-
/* @__PURE__ */
|
|
2399
|
-
/* @__PURE__ */
|
|
2239
|
+
/* @__PURE__ */ jsx16("span", { className: "uf-text-sm uf-text-foreground uf-font-medium", children: currency.toUpperCase() }),
|
|
2240
|
+
/* @__PURE__ */ jsx16(ChevronDown4, { className: "uf-w-3.5 uf-h-3.5 uf-text-muted-foreground" })
|
|
2400
2241
|
]
|
|
2401
2242
|
}
|
|
2402
2243
|
) }),
|
|
2403
2244
|
/* @__PURE__ */ jsxs12("div", { className: "uf-text-center uf-mb-4", children: [
|
|
2404
|
-
/* @__PURE__ */
|
|
2405
|
-
/* @__PURE__ */
|
|
2245
|
+
/* @__PURE__ */ jsx16("div", { className: "uf-flex uf-items-center uf-justify-center uf-mb-2 uf-px-8", children: /* @__PURE__ */ jsxs12("div", { className: "uf-flex uf-items-center uf-max-w-full", children: [
|
|
2246
|
+
/* @__PURE__ */ jsx16(
|
|
2406
2247
|
"span",
|
|
2407
2248
|
{
|
|
2408
2249
|
className: "uf-font-normal uf-text-foreground uf-flex-shrink-0 uf-mr-1",
|
|
@@ -2412,7 +2253,7 @@ function BuyWithCard({
|
|
|
2412
2253
|
children: currencySymbol
|
|
2413
2254
|
}
|
|
2414
2255
|
),
|
|
2415
|
-
/* @__PURE__ */
|
|
2256
|
+
/* @__PURE__ */ jsx16(
|
|
2416
2257
|
"input",
|
|
2417
2258
|
{
|
|
2418
2259
|
type: "text",
|
|
@@ -2428,12 +2269,12 @@ function BuyWithCard({
|
|
|
2428
2269
|
}
|
|
2429
2270
|
)
|
|
2430
2271
|
] }) }),
|
|
2431
|
-
quotesLoading ? /* @__PURE__ */
|
|
2272
|
+
quotesLoading ? /* @__PURE__ */ jsx16("div", { className: "uf-flex uf-justify-center", children: /* @__PURE__ */ jsx16("div", { className: "uf-h-4 uf-bg-muted uf-rounded uf-w-40 uf-animate-pulse" }) }) : /* @__PURE__ */ jsxs12("div", { className: "uf-text-sm uf-text-muted-foreground uf-font-normal", children: [
|
|
2432
2273
|
calculateUSDC(),
|
|
2433
2274
|
" USDC (Perps)"
|
|
2434
2275
|
] })
|
|
2435
2276
|
] }),
|
|
2436
|
-
/* @__PURE__ */
|
|
2277
|
+
/* @__PURE__ */ jsx16("div", { className: "uf-flex uf-gap-3 uf-justify-center", children: QUICK_AMOUNTS.map((quickAmount) => /* @__PURE__ */ jsxs12(
|
|
2437
2278
|
"button",
|
|
2438
2279
|
{
|
|
2439
2280
|
onClick: () => handleQuickAmount(quickAmount),
|
|
@@ -2448,29 +2289,29 @@ function BuyWithCard({
|
|
|
2448
2289
|
] }),
|
|
2449
2290
|
/* @__PURE__ */ jsxs12("div", { className: "uf-mb-6", children: [
|
|
2450
2291
|
/* @__PURE__ */ jsxs12("div", { className: "uf-flex uf-items-center uf-justify-between uf-text-xs uf-font-medium uf-mb-2 uf-px-1", children: [
|
|
2451
|
-
/* @__PURE__ */
|
|
2292
|
+
/* @__PURE__ */ jsx16("span", { className: "uf-text-foreground", children: "Provider" }),
|
|
2452
2293
|
quotes.length > 0 && !quotesLoading && /* @__PURE__ */ jsxs12("span", { className: "uf-text-[10px] uf-text-foreground uf-font-normal", children: [
|
|
2453
2294
|
"Refreshing in ",
|
|
2454
2295
|
countdown,
|
|
2455
2296
|
"s"
|
|
2456
2297
|
] })
|
|
2457
2298
|
] }),
|
|
2458
|
-
/* @__PURE__ */
|
|
2299
|
+
/* @__PURE__ */ jsx16(
|
|
2459
2300
|
"button",
|
|
2460
2301
|
{
|
|
2461
2302
|
onClick: () => handleViewChange("quotes"),
|
|
2462
2303
|
disabled: quotesLoading || quotes.length === 0,
|
|
2463
2304
|
className: "uf-w-full uf-bg-secondary hover:uf-bg-accent uf-transition-colors uf-rounded-xl uf-p-4 uf-group disabled:uf-opacity-50 disabled:uf-cursor-not-allowed",
|
|
2464
2305
|
children: quotesLoading ? /* @__PURE__ */ jsxs12("div", { className: "uf-text-left uf-w-full uf-animate-pulse", children: [
|
|
2465
|
-
/* @__PURE__ */
|
|
2306
|
+
/* @__PURE__ */ jsx16("div", { className: "uf-h-3 uf-bg-muted uf-rounded uf-w-28 uf-mb-3" }),
|
|
2466
2307
|
/* @__PURE__ */ jsxs12("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
2467
|
-
/* @__PURE__ */
|
|
2468
|
-
/* @__PURE__ */
|
|
2308
|
+
/* @__PURE__ */ jsx16("div", { className: "uf-w-8 uf-h-8 uf-bg-muted uf-rounded-full" }),
|
|
2309
|
+
/* @__PURE__ */ jsx16("div", { className: "uf-h-4 uf-bg-muted uf-rounded uf-w-32" })
|
|
2469
2310
|
] })
|
|
2470
2311
|
] }) : /* @__PURE__ */ jsxs12("div", { className: "uf-w-full uf-text-left", children: [
|
|
2471
|
-
isAutoSelected && /* @__PURE__ */
|
|
2312
|
+
isAutoSelected && /* @__PURE__ */ jsx16("div", { className: "uf-text-xs uf-text-muted-foreground uf-font-normal uf-mb-2", children: "Auto-picked for you" }),
|
|
2472
2313
|
selectedProvider && /* @__PURE__ */ jsxs12("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
2473
|
-
/* @__PURE__ */
|
|
2314
|
+
/* @__PURE__ */ jsx16(
|
|
2474
2315
|
"img",
|
|
2475
2316
|
{
|
|
2476
2317
|
src: selectedProvider.icon_url,
|
|
@@ -2481,21 +2322,21 @@ function BuyWithCard({
|
|
|
2481
2322
|
}
|
|
2482
2323
|
),
|
|
2483
2324
|
/* @__PURE__ */ jsxs12("div", { className: "uf-flex-1 uf-min-w-0", children: [
|
|
2484
|
-
/* @__PURE__ */
|
|
2325
|
+
/* @__PURE__ */ jsx16("div", { className: "uf-text-sm uf-text-foreground uf-font-medium", children: selectedProvider.service_provider_display_name }),
|
|
2485
2326
|
/* @__PURE__ */ jsxs12("div", { className: "uf-flex uf-items-center uf-gap-1.5 uf-mt-0.5", children: [
|
|
2486
|
-
isAutoSelected && /* @__PURE__ */
|
|
2487
|
-
isAutoSelected && selectedProvider.low_kyc === false && /* @__PURE__ */
|
|
2488
|
-
selectedProvider.low_kyc === false && /* @__PURE__ */
|
|
2327
|
+
isAutoSelected && /* @__PURE__ */ jsx16("span", { className: "uf-text-[10px] uf-text-green-400 uf-font-normal", children: "Best price" }),
|
|
2328
|
+
isAutoSelected && selectedProvider.low_kyc === false && /* @__PURE__ */ jsx16("span", { className: "uf-text-[10px] uf-text-muted-foreground", children: "\u2022" }),
|
|
2329
|
+
selectedProvider.low_kyc === false && /* @__PURE__ */ jsx16("span", { className: "uf-text-[10px] uf-text-muted-foreground uf-font-normal", children: "No document upload" })
|
|
2489
2330
|
] })
|
|
2490
2331
|
] }),
|
|
2491
|
-
quotes.length > 0 && /* @__PURE__ */
|
|
2332
|
+
quotes.length > 0 && /* @__PURE__ */ jsx16(ChevronRight3, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground group-hover:uf-text-foreground uf-transition-colors uf-flex-shrink-0" })
|
|
2492
2333
|
] })
|
|
2493
2334
|
] })
|
|
2494
2335
|
}
|
|
2495
2336
|
),
|
|
2496
|
-
quotesError && /* @__PURE__ */
|
|
2337
|
+
quotesError && /* @__PURE__ */ jsx16("div", { className: "uf-text-xs uf-text-red-400 uf-mt-2 uf-px-1", children: quotesError })
|
|
2497
2338
|
] }),
|
|
2498
|
-
/* @__PURE__ */
|
|
2339
|
+
/* @__PURE__ */ jsx16(
|
|
2499
2340
|
"button",
|
|
2500
2341
|
{
|
|
2501
2342
|
onClick: handleContinue,
|
|
@@ -2510,11 +2351,11 @@ function BuyWithCard({
|
|
|
2510
2351
|
]
|
|
2511
2352
|
}
|
|
2512
2353
|
),
|
|
2513
|
-
/* @__PURE__ */
|
|
2354
|
+
/* @__PURE__ */ jsx16(
|
|
2514
2355
|
"div",
|
|
2515
2356
|
{
|
|
2516
|
-
className: `uf-transition-all uf-duration-300 ${showQuotesView && !showOnrampView ? "uf-opacity-100" : "uf-opacity-0 uf-pointer-events-none uf-absolute uf-inset-0"}`,
|
|
2517
|
-
children: /* @__PURE__ */
|
|
2357
|
+
className: `uf-transition-all uf-duration-300 uf-min-h-[420px] ${showQuotesView && !showOnrampView ? "uf-opacity-100" : "uf-opacity-0 uf-pointer-events-none uf-absolute uf-inset-0"}`,
|
|
2358
|
+
children: /* @__PURE__ */ jsx16("div", { className: "uf-space-y-2 uf-pt-2", children: sortedQuotes.map((quote, index) => {
|
|
2518
2359
|
const badges = getProviderBadges(quote, sortedQuotes);
|
|
2519
2360
|
const displayName = quote.service_provider_display_name;
|
|
2520
2361
|
const isSelected = selectedProvider?.service_provider === quote.service_provider;
|
|
@@ -2532,7 +2373,7 @@ function BuyWithCard({
|
|
|
2532
2373
|
className: `uf-w-full uf-bg-secondary hover:uf-bg-accent uf-transition-colors uf-rounded-xl uf-p-3 uf-flex uf-items-center uf-justify-between uf-group ${isSelected ? "uf-ring-2 uf-ring-inset uf-ring-primary" : ""}`,
|
|
2533
2374
|
children: [
|
|
2534
2375
|
/* @__PURE__ */ jsxs12("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
2535
|
-
/* @__PURE__ */
|
|
2376
|
+
/* @__PURE__ */ jsx16("div", { className: "uf-w-10 uf-h-10 uf-flex uf-items-center uf-justify-center uf-flex-shrink-0", children: /* @__PURE__ */ jsx16(
|
|
2536
2377
|
"img",
|
|
2537
2378
|
{
|
|
2538
2379
|
src: quote.icon_url,
|
|
@@ -2543,7 +2384,7 @@ function BuyWithCard({
|
|
|
2543
2384
|
}
|
|
2544
2385
|
) }),
|
|
2545
2386
|
/* @__PURE__ */ jsxs12("div", { className: "uf-text-left", children: [
|
|
2546
|
-
/* @__PURE__ */
|
|
2387
|
+
/* @__PURE__ */ jsx16("div", { className: "uf-text-sm uf-font-medium uf-text-foreground", children: displayName }),
|
|
2547
2388
|
/* @__PURE__ */ jsxs12("div", { className: "uf-flex uf-items-center uf-gap-1.5 uf-mt-0.5", children: [
|
|
2548
2389
|
badges.map((badge, i) => /* @__PURE__ */ jsxs12(
|
|
2549
2390
|
"span",
|
|
@@ -2556,8 +2397,8 @@ function BuyWithCard({
|
|
|
2556
2397
|
},
|
|
2557
2398
|
i
|
|
2558
2399
|
)),
|
|
2559
|
-
quote.low_kyc === false && badges.length > 0 && /* @__PURE__ */
|
|
2560
|
-
quote.low_kyc === false && /* @__PURE__ */
|
|
2400
|
+
quote.low_kyc === false && badges.length > 0 && /* @__PURE__ */ jsx16("span", { className: "uf-text-[10px] uf-text-muted-foreground", children: "\u2022" }),
|
|
2401
|
+
quote.low_kyc === false && /* @__PURE__ */ jsx16("span", { className: "uf-text-[10px] uf-text-muted-foreground uf-font-normal", children: "No document upload" })
|
|
2561
2402
|
] })
|
|
2562
2403
|
] })
|
|
2563
2404
|
] }),
|
|
@@ -2579,12 +2420,12 @@ function BuyWithCard({
|
|
|
2579
2420
|
}) })
|
|
2580
2421
|
}
|
|
2581
2422
|
),
|
|
2582
|
-
/* @__PURE__ */
|
|
2423
|
+
/* @__PURE__ */ jsx16(
|
|
2583
2424
|
"div",
|
|
2584
2425
|
{
|
|
2585
2426
|
className: `uf-transition-all uf-duration-300 ${showOnrampView ? "uf-opacity-100" : "uf-opacity-0 uf-pointer-events-none uf-absolute uf-inset-0"}`,
|
|
2586
2427
|
children: onrampSession && /* @__PURE__ */ jsxs12("div", { className: "uf-flex uf-flex-col uf-items-center uf-pt-6 uf-pb-4 uf-px-2", children: [
|
|
2587
|
-
/* @__PURE__ */
|
|
2428
|
+
/* @__PURE__ */ jsx16("div", { className: "uf-mb-6", children: /* @__PURE__ */ jsx16(
|
|
2588
2429
|
"img",
|
|
2589
2430
|
{
|
|
2590
2431
|
src: onrampSession.provider.icon_url,
|
|
@@ -2594,62 +2435,62 @@ function BuyWithCard({
|
|
|
2594
2435
|
className: "uf-rounded-2xl"
|
|
2595
2436
|
}
|
|
2596
2437
|
) }),
|
|
2597
|
-
/* @__PURE__ */
|
|
2438
|
+
/* @__PURE__ */ jsx16("h2", { className: "uf-text-xl uf-font-medium uf-text-foreground uf-mb-2", children: t2.onramp.completeTransaction.replace(
|
|
2598
2439
|
"{{provider}}",
|
|
2599
2440
|
onrampSession.provider.service_provider_display_name
|
|
2600
2441
|
) }),
|
|
2601
|
-
/* @__PURE__ */
|
|
2602
|
-
/* @__PURE__ */
|
|
2442
|
+
/* @__PURE__ */ jsx16("p", { className: "uf-text-sm uf-text-muted-foreground uf-mb-8", children: t2.onramp.canCloseModal }),
|
|
2443
|
+
/* @__PURE__ */ jsx16("div", { className: "uf-w-full uf-bg-secondary uf-rounded-xl uf-p-4 uf-mb-4", children: /* @__PURE__ */ jsxs12("div", { className: "uf-flex uf-items-center uf-justify-center", children: [
|
|
2603
2444
|
/* @__PURE__ */ jsxs12("div", { className: "uf-flex uf-flex-col uf-items-center uf-min-w-[72px]", children: [
|
|
2604
|
-
/* @__PURE__ */
|
|
2445
|
+
/* @__PURE__ */ jsx16("div", { className: "uf-h-8 uf-flex uf-items-center uf-justify-center uf-mb-1.5", children: /* @__PURE__ */ jsx16(
|
|
2605
2446
|
"img",
|
|
2606
2447
|
{
|
|
2607
2448
|
src: getIconUrlWithCdn(
|
|
2608
|
-
`/icons/currencies/
|
|
2449
|
+
`/icons/currencies/png/${onrampSession.sourceCurrency.toLowerCase()}.png`,
|
|
2609
2450
|
assetCdnUrl
|
|
2610
2451
|
),
|
|
2611
2452
|
alt: onrampSession.sourceCurrency.toUpperCase(),
|
|
2612
2453
|
className: "uf-w-7 uf-h-7 uf-rounded-full"
|
|
2613
2454
|
}
|
|
2614
2455
|
) }),
|
|
2615
|
-
/* @__PURE__ */
|
|
2616
|
-
/* @__PURE__ */
|
|
2456
|
+
/* @__PURE__ */ jsx16("span", { className: "uf-text-[10px] uf-text-muted-foreground uf-text-center", children: t2.onramp.youUse }),
|
|
2457
|
+
/* @__PURE__ */ jsx16("span", { className: "uf-text-sm uf-font-medium uf-text-foreground uf-text-center", children: onrampSession.sourceCurrency.toUpperCase() })
|
|
2617
2458
|
] }),
|
|
2618
|
-
/* @__PURE__ */
|
|
2459
|
+
/* @__PURE__ */ jsx16("div", { className: "uf-text-muted-foreground uf-px-1 uf-self-start uf-pt-2", children: /* @__PURE__ */ jsx16(ChevronRight3, { className: "uf-w-4 uf-h-4" }) }),
|
|
2619
2460
|
/* @__PURE__ */ jsxs12("div", { className: "uf-flex uf-flex-col uf-items-center uf-min-w-[72px]", children: [
|
|
2620
|
-
/* @__PURE__ */
|
|
2621
|
-
/* @__PURE__ */
|
|
2461
|
+
/* @__PURE__ */ jsx16("div", { className: "uf-h-8 uf-flex uf-items-center uf-justify-center uf-mb-1.5", children: /* @__PURE__ */ jsxs12("div", { className: "uf-relative", children: [
|
|
2462
|
+
/* @__PURE__ */ jsx16(
|
|
2622
2463
|
"img",
|
|
2623
2464
|
{
|
|
2624
|
-
src: getIconUrlWithCdn("/icons/tokens/
|
|
2465
|
+
src: getIconUrlWithCdn("/icons/tokens/png/usdc.png", assetCdnUrl),
|
|
2625
2466
|
alt: "USDC",
|
|
2626
2467
|
className: "uf-w-7 uf-h-7 uf-rounded-full"
|
|
2627
2468
|
}
|
|
2628
2469
|
),
|
|
2629
|
-
/* @__PURE__ */
|
|
2470
|
+
/* @__PURE__ */ jsx16(
|
|
2630
2471
|
"img",
|
|
2631
2472
|
{
|
|
2632
|
-
src: getIconUrlWithCdn("/icons/networks/
|
|
2473
|
+
src: getIconUrlWithCdn("/icons/networks/png/polygon.png", assetCdnUrl),
|
|
2633
2474
|
alt: "Polygon",
|
|
2634
2475
|
className: "uf-w-3.5 uf-h-3.5 uf-absolute -uf-bottom-0.5 -uf-right-0.5 uf-rounded-full"
|
|
2635
2476
|
}
|
|
2636
2477
|
)
|
|
2637
2478
|
] }) }),
|
|
2638
|
-
/* @__PURE__ */
|
|
2639
|
-
/* @__PURE__ */
|
|
2479
|
+
/* @__PURE__ */ jsx16("span", { className: "uf-text-[10px] uf-text-muted-foreground uf-text-center", children: t2.onramp.youBuy }),
|
|
2480
|
+
/* @__PURE__ */ jsx16("span", { className: "uf-text-sm uf-font-medium uf-text-foreground uf-text-center", children: "USDC" })
|
|
2640
2481
|
] }),
|
|
2641
|
-
/* @__PURE__ */
|
|
2482
|
+
/* @__PURE__ */ jsx16("div", { className: "uf-text-muted-foreground uf-px-1 uf-self-start uf-pt-2", children: /* @__PURE__ */ jsx16(ChevronRight3, { className: "uf-w-4 uf-h-4" }) }),
|
|
2642
2483
|
/* @__PURE__ */ jsxs12("div", { className: "uf-flex uf-flex-col uf-items-center uf-min-w-[72px]", children: [
|
|
2643
|
-
/* @__PURE__ */
|
|
2644
|
-
/* @__PURE__ */
|
|
2484
|
+
/* @__PURE__ */ jsx16("div", { className: "uf-h-8 uf-flex uf-items-center uf-justify-center uf-mb-1.5", children: /* @__PURE__ */ jsxs12("div", { className: "uf-relative", children: [
|
|
2485
|
+
/* @__PURE__ */ jsx16(
|
|
2645
2486
|
"img",
|
|
2646
2487
|
{
|
|
2647
|
-
src: destinationToken?.icon_url || getIconUrlWithCdn("/icons/tokens/
|
|
2488
|
+
src: destinationToken?.icon_url || getIconUrlWithCdn("/icons/tokens/png/usdc.png", assetCdnUrl),
|
|
2648
2489
|
alt: displayTokenSymbol,
|
|
2649
2490
|
className: "uf-w-7 uf-h-7 uf-rounded-full"
|
|
2650
2491
|
}
|
|
2651
2492
|
),
|
|
2652
|
-
destinationChain?.icon_url && /* @__PURE__ */
|
|
2493
|
+
destinationChain?.icon_url && /* @__PURE__ */ jsx16(
|
|
2653
2494
|
"img",
|
|
2654
2495
|
{
|
|
2655
2496
|
src: destinationChain.icon_url,
|
|
@@ -2658,15 +2499,15 @@ function BuyWithCard({
|
|
|
2658
2499
|
}
|
|
2659
2500
|
)
|
|
2660
2501
|
] }) }),
|
|
2661
|
-
/* @__PURE__ */
|
|
2662
|
-
/* @__PURE__ */
|
|
2502
|
+
/* @__PURE__ */ jsx16("span", { className: "uf-text-[10px] uf-text-muted-foreground uf-text-center", children: t2.onramp.youReceive }),
|
|
2503
|
+
/* @__PURE__ */ jsx16("span", { className: "uf-text-sm uf-font-medium uf-text-foreground uf-text-center", children: displayTokenSymbol })
|
|
2663
2504
|
] })
|
|
2664
2505
|
] }) }),
|
|
2665
|
-
/* @__PURE__ */
|
|
2506
|
+
/* @__PURE__ */ jsx16("div", { className: "uf-w-full uf-bg-secondary uf-rounded-xl uf-p-4", children: /* @__PURE__ */ jsx16("p", { className: "uf-text-xs uf-text-muted-foreground uf-leading-relaxed", children: t2.onramp.intentAddressNote }) })
|
|
2666
2507
|
] })
|
|
2667
2508
|
}
|
|
2668
2509
|
),
|
|
2669
|
-
/* @__PURE__ */
|
|
2510
|
+
/* @__PURE__ */ jsx16(
|
|
2670
2511
|
CurrencyModal,
|
|
2671
2512
|
{
|
|
2672
2513
|
open: showCurrencyModal,
|
|
@@ -2685,7 +2526,7 @@ function BuyWithCard({
|
|
|
2685
2526
|
|
|
2686
2527
|
// src/components/deposits/buttons/TransferCryptoButton.tsx
|
|
2687
2528
|
import { Zap, ChevronRight as ChevronRight4 } from "lucide-react";
|
|
2688
|
-
import { jsx as
|
|
2529
|
+
import { jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2689
2530
|
function TransferCryptoButton({
|
|
2690
2531
|
onClick,
|
|
2691
2532
|
title,
|
|
@@ -2700,16 +2541,16 @@ function TransferCryptoButton({
|
|
|
2700
2541
|
className: "uf-w-full uf-bg-secondary hover:uf-bg-accent uf-transition-colors uf-rounded-xl uf-p-3 uf-flex uf-items-center uf-justify-between uf-group",
|
|
2701
2542
|
children: [
|
|
2702
2543
|
/* @__PURE__ */ jsxs13("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
2703
|
-
/* @__PURE__ */
|
|
2544
|
+
/* @__PURE__ */ jsx17("div", { className: "uf-bg-muted uf-rounded-lg uf-p-2", children: /* @__PURE__ */ jsx17(Zap, { className: "uf-w-5 uf-h-5" }) }),
|
|
2704
2545
|
/* @__PURE__ */ jsxs13("div", { className: "uf-text-left", children: [
|
|
2705
|
-
/* @__PURE__ */
|
|
2706
|
-
/* @__PURE__ */
|
|
2546
|
+
/* @__PURE__ */ jsx17("div", { className: "uf-text-sm uf-font-light uf-mb-0.5 uf-text-foreground", children: title }),
|
|
2547
|
+
/* @__PURE__ */ jsx17("div", { className: "uf-text-muted-foreground uf-text-xs uf-font-light", children: subtitle })
|
|
2707
2548
|
] })
|
|
2708
2549
|
] }),
|
|
2709
2550
|
/* @__PURE__ */ jsxs13("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
2710
|
-
/* @__PURE__ */
|
|
2551
|
+
/* @__PURE__ */ jsx17("div", { className: "uf-flex uf--space-x-2", children: sortedTokens.map((token) => {
|
|
2711
2552
|
const iconUrl = token.icon_urls.find((u) => u.format === "svg")?.url || token.icon_urls.find((u) => u.format === "png")?.url;
|
|
2712
|
-
return /* @__PURE__ */
|
|
2553
|
+
return /* @__PURE__ */ jsx17(
|
|
2713
2554
|
"img",
|
|
2714
2555
|
{
|
|
2715
2556
|
src: iconUrl,
|
|
@@ -2721,7 +2562,7 @@ function TransferCryptoButton({
|
|
|
2721
2562
|
token.name
|
|
2722
2563
|
);
|
|
2723
2564
|
}) }),
|
|
2724
|
-
/* @__PURE__ */
|
|
2565
|
+
/* @__PURE__ */ jsx17(ChevronRight4, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground group-hover:uf-text-foreground uf-transition-colors" })
|
|
2725
2566
|
] })
|
|
2726
2567
|
]
|
|
2727
2568
|
}
|
|
@@ -2730,7 +2571,7 @@ function TransferCryptoButton({
|
|
|
2730
2571
|
|
|
2731
2572
|
// src/components/deposits/buttons/DepositWithCardButton.tsx
|
|
2732
2573
|
import { CreditCard, ChevronRight as ChevronRight5 } from "lucide-react";
|
|
2733
|
-
import { jsx as
|
|
2574
|
+
import { jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2734
2575
|
function DepositWithCardButton({
|
|
2735
2576
|
onClick,
|
|
2736
2577
|
title,
|
|
@@ -2744,16 +2585,16 @@ function DepositWithCardButton({
|
|
|
2744
2585
|
className: "uf-w-full uf-bg-secondary hover:uf-bg-accent uf-transition-colors uf-rounded-xl uf-p-3 uf-flex uf-items-center uf-justify-between uf-group",
|
|
2745
2586
|
children: [
|
|
2746
2587
|
/* @__PURE__ */ jsxs14("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
2747
|
-
/* @__PURE__ */
|
|
2588
|
+
/* @__PURE__ */ jsx18("div", { className: "uf-bg-muted uf-rounded-lg uf-p-2", children: /* @__PURE__ */ jsx18(CreditCard, { className: "uf-w-5 uf-h-5" }) }),
|
|
2748
2589
|
/* @__PURE__ */ jsxs14("div", { className: "uf-text-left", children: [
|
|
2749
|
-
/* @__PURE__ */
|
|
2750
|
-
/* @__PURE__ */
|
|
2590
|
+
/* @__PURE__ */ jsx18("div", { className: "uf-text-sm uf-font-light uf-mb-0.5 uf-text-foreground", children: title }),
|
|
2591
|
+
/* @__PURE__ */ jsx18("div", { className: "uf-text-muted-foreground uf-text-xs uf-font-light", children: subtitle })
|
|
2751
2592
|
] })
|
|
2752
2593
|
] }),
|
|
2753
2594
|
/* @__PURE__ */ jsxs14("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
2754
|
-
/* @__PURE__ */
|
|
2595
|
+
/* @__PURE__ */ jsx18("div", { className: "uf-flex uf-items-center uf-gap-1.5", children: paymentNetworks?.map((network) => {
|
|
2755
2596
|
const iconUrl = network.icon_urls.find((u) => u.format === "svg")?.url || network.icon_urls.find((u) => u.format === "png")?.url;
|
|
2756
|
-
return /* @__PURE__ */
|
|
2597
|
+
return /* @__PURE__ */ jsx18(
|
|
2757
2598
|
"img",
|
|
2758
2599
|
{
|
|
2759
2600
|
src: iconUrl,
|
|
@@ -2765,7 +2606,7 @@ function DepositWithCardButton({
|
|
|
2765
2606
|
network.name
|
|
2766
2607
|
);
|
|
2767
2608
|
}) }),
|
|
2768
|
-
/* @__PURE__ */
|
|
2609
|
+
/* @__PURE__ */ jsx18(ChevronRight5, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground group-hover:uf-text-foreground uf-transition-colors" })
|
|
2769
2610
|
] })
|
|
2770
2611
|
]
|
|
2771
2612
|
}
|
|
@@ -2774,7 +2615,7 @@ function DepositWithCardButton({
|
|
|
2774
2615
|
|
|
2775
2616
|
// src/components/deposits/buttons/DepositTrackerButton.tsx
|
|
2776
2617
|
import { Clock as Clock2, ChevronRight as ChevronRight6 } from "lucide-react";
|
|
2777
|
-
import { jsx as
|
|
2618
|
+
import { jsx as jsx19, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2778
2619
|
function DepositTrackerButton({
|
|
2779
2620
|
onClick,
|
|
2780
2621
|
title,
|
|
@@ -2789,34 +2630,35 @@ function DepositTrackerButton({
|
|
|
2789
2630
|
children: [
|
|
2790
2631
|
/* @__PURE__ */ jsxs15("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
2791
2632
|
/* @__PURE__ */ jsxs15("div", { className: "uf-bg-muted uf-rounded-lg uf-p-2 uf-relative", children: [
|
|
2792
|
-
/* @__PURE__ */
|
|
2793
|
-
badge !== void 0 && badge > 0 && /* @__PURE__ */
|
|
2633
|
+
/* @__PURE__ */ jsx19(Clock2, { className: "uf-w-5 uf-h-5" }),
|
|
2634
|
+
badge !== void 0 && badge > 0 && /* @__PURE__ */ jsx19("div", { className: "uf-absolute -uf-top-1 -uf-right-1 uf-bg-blue-500 uf-text-primary-foreground uf-text-[10px] uf-font-semibold uf-rounded-full uf-min-w-[18px] uf-h-[18px] uf-flex uf-items-center uf-justify-center uf-px-1", children: badge > 99 ? "99+" : badge })
|
|
2794
2635
|
] }),
|
|
2795
2636
|
/* @__PURE__ */ jsxs15("div", { className: "uf-text-left", children: [
|
|
2796
|
-
/* @__PURE__ */
|
|
2797
|
-
/* @__PURE__ */
|
|
2637
|
+
/* @__PURE__ */ jsx19("div", { className: "uf-text-sm uf-font-light uf-mb-0.5 uf-text-foreground", children: title }),
|
|
2638
|
+
/* @__PURE__ */ jsx19("div", { className: "uf-text-muted-foreground uf-text-xs uf-font-light", children: subtitle })
|
|
2798
2639
|
] })
|
|
2799
2640
|
] }),
|
|
2800
|
-
/* @__PURE__ */
|
|
2641
|
+
/* @__PURE__ */ jsx19(ChevronRight6, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground group-hover:uf-text-foreground uf-transition-colors" })
|
|
2801
2642
|
]
|
|
2802
2643
|
}
|
|
2803
2644
|
);
|
|
2804
2645
|
}
|
|
2805
2646
|
|
|
2806
2647
|
// src/components/deposits/DepositModal.tsx
|
|
2807
|
-
import {
|
|
2648
|
+
import { getProjectConfig, createDepositAddress as createDepositAddress3 } from "@unifold/core";
|
|
2649
|
+
import { Fragment as Fragment4, jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2808
2650
|
function SkeletonButton({ variant = "default" }) {
|
|
2809
2651
|
return /* @__PURE__ */ jsxs16("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: [
|
|
2810
2652
|
/* @__PURE__ */ jsxs16("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
2811
|
-
/* @__PURE__ */
|
|
2653
|
+
/* @__PURE__ */ jsx20("div", { className: "uf-bg-muted uf-rounded-lg uf-w-9 uf-h-9" }),
|
|
2812
2654
|
/* @__PURE__ */ jsxs16("div", { className: "uf-space-y-1.5", children: [
|
|
2813
|
-
/* @__PURE__ */
|
|
2814
|
-
/* @__PURE__ */
|
|
2655
|
+
/* @__PURE__ */ jsx20("div", { className: "uf-h-3.5 uf-w-24 uf-bg-muted uf-rounded" }),
|
|
2656
|
+
/* @__PURE__ */ jsx20("div", { className: "uf-h-3 uf-w-32 uf-bg-muted uf-rounded" })
|
|
2815
2657
|
] })
|
|
2816
2658
|
] }),
|
|
2817
2659
|
/* @__PURE__ */ jsxs16("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
2818
|
-
variant === "with-icons" && /* @__PURE__ */
|
|
2819
|
-
/* @__PURE__ */
|
|
2660
|
+
variant === "with-icons" && /* @__PURE__ */ jsx20("div", { className: "uf-flex uf--space-x-1", children: [1, 2, 3].map((i) => /* @__PURE__ */ jsx20("div", { className: "uf-w-5 uf-h-5 uf-rounded-full uf-bg-muted uf-border-2 uf-border-secondary" }, i)) }),
|
|
2661
|
+
/* @__PURE__ */ jsx20(ChevronRight7, { className: "uf-w-4 uf-h-4 uf-text-muted" })
|
|
2820
2662
|
] })
|
|
2821
2663
|
] });
|
|
2822
2664
|
}
|
|
@@ -2837,24 +2679,24 @@ function DepositModal({
|
|
|
2837
2679
|
onDepositError,
|
|
2838
2680
|
theme = "dark"
|
|
2839
2681
|
}) {
|
|
2840
|
-
const [view, setView] =
|
|
2841
|
-
const [cardView, setCardView] =
|
|
2682
|
+
const [view, setView] = useState7("main");
|
|
2683
|
+
const [cardView, setCardView] = useState7(
|
|
2842
2684
|
"amount"
|
|
2843
2685
|
);
|
|
2844
|
-
const [quotesCount, setQuotesCount] =
|
|
2845
|
-
const [depositsModalOpen, setDepositsModalOpen] =
|
|
2846
|
-
const [depositExecutions, setDepositExecutions] =
|
|
2847
|
-
const [projectConfig, setProjectConfig] =
|
|
2848
|
-
const [wallets, setWallets] =
|
|
2849
|
-
const [walletsLoading, setWalletsLoading] =
|
|
2850
|
-
|
|
2686
|
+
const [quotesCount, setQuotesCount] = useState7(0);
|
|
2687
|
+
const [depositsModalOpen, setDepositsModalOpen] = useState7(false);
|
|
2688
|
+
const [depositExecutions, setDepositExecutions] = useState7([]);
|
|
2689
|
+
const [projectConfig, setProjectConfig] = useState7(null);
|
|
2690
|
+
const [wallets, setWallets] = useState7([]);
|
|
2691
|
+
const [walletsLoading, setWalletsLoading] = useState7(false);
|
|
2692
|
+
useEffect6(() => {
|
|
2851
2693
|
setProjectConfig(null);
|
|
2852
2694
|
}, [publishableKey]);
|
|
2853
|
-
|
|
2695
|
+
useEffect6(() => {
|
|
2854
2696
|
setWallets([]);
|
|
2855
2697
|
}, [userId, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, publishableKey]);
|
|
2856
|
-
const [resolvedTheme, setResolvedTheme] =
|
|
2857
|
-
|
|
2698
|
+
const [resolvedTheme, setResolvedTheme] = useState7(theme === "auto" ? "dark" : theme);
|
|
2699
|
+
useEffect6(() => {
|
|
2858
2700
|
if (theme === "auto") {
|
|
2859
2701
|
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
2860
2702
|
setResolvedTheme(mediaQuery.matches ? "dark" : "light");
|
|
@@ -2867,12 +2709,12 @@ function DepositModal({
|
|
|
2867
2709
|
setResolvedTheme(theme);
|
|
2868
2710
|
}
|
|
2869
2711
|
}, [theme]);
|
|
2870
|
-
|
|
2712
|
+
useEffect6(() => {
|
|
2871
2713
|
if (open && !projectConfig) {
|
|
2872
2714
|
getProjectConfig(publishableKey).then(setProjectConfig).catch(console.error);
|
|
2873
2715
|
}
|
|
2874
2716
|
}, [open, publishableKey, projectConfig]);
|
|
2875
|
-
|
|
2717
|
+
useEffect6(() => {
|
|
2876
2718
|
if (!open || wallets.length > 0) return;
|
|
2877
2719
|
let retryTimeout = null;
|
|
2878
2720
|
let isCancelled = false;
|
|
@@ -2880,9 +2722,9 @@ function DepositModal({
|
|
|
2880
2722
|
if (isCancelled) return;
|
|
2881
2723
|
setWalletsLoading(true);
|
|
2882
2724
|
try {
|
|
2883
|
-
const response = await
|
|
2725
|
+
const response = await createDepositAddress3(
|
|
2884
2726
|
{
|
|
2885
|
-
|
|
2727
|
+
external_user_id: userId,
|
|
2886
2728
|
recipient_address: recipientAddress,
|
|
2887
2729
|
destination_chain_type: destinationChainType,
|
|
2888
2730
|
destination_chain_id: destinationChainId,
|
|
@@ -2934,27 +2776,27 @@ function DepositModal({
|
|
|
2934
2776
|
setQuotesCount(count);
|
|
2935
2777
|
}
|
|
2936
2778
|
};
|
|
2937
|
-
return /* @__PURE__ */
|
|
2938
|
-
/* @__PURE__ */
|
|
2779
|
+
return /* @__PURE__ */ jsx20(ThemeProvider, { themeClass, children: /* @__PURE__ */ jsxs16(Dialog, { open, onOpenChange: handleClose, children: [
|
|
2780
|
+
/* @__PURE__ */ jsx20(
|
|
2939
2781
|
DialogContent,
|
|
2940
2782
|
{
|
|
2941
2783
|
className: `sm:uf-max-w-[400px] !uf-bg-card uf-border-secondary uf-text-foreground uf-p-0 uf-gap-0 uf-overflow-visible [&>button]:uf-hidden ${themeClass}`,
|
|
2942
2784
|
onPointerDownOutside: (e) => e.preventDefault(),
|
|
2943
2785
|
onInteractOutside: (e) => e.preventDefault(),
|
|
2944
2786
|
children: view === "main" ? /* @__PURE__ */ jsxs16(Fragment4, { children: [
|
|
2945
|
-
/* @__PURE__ */
|
|
2787
|
+
/* @__PURE__ */ jsx20(
|
|
2946
2788
|
DepositHeader,
|
|
2947
2789
|
{
|
|
2948
2790
|
title: modalTitle || "Deposit",
|
|
2949
2791
|
onClose: handleClose
|
|
2950
2792
|
}
|
|
2951
2793
|
),
|
|
2952
|
-
/* @__PURE__ */
|
|
2953
|
-
/* @__PURE__ */
|
|
2954
|
-
/* @__PURE__ */
|
|
2955
|
-
!hideDepositTracker && /* @__PURE__ */
|
|
2794
|
+
/* @__PURE__ */ jsx20("div", { className: "uf-pb-4 uf-space-y-3", children: !projectConfig ? /* @__PURE__ */ jsxs16(Fragment4, { children: [
|
|
2795
|
+
/* @__PURE__ */ jsx20(SkeletonButton, { variant: "with-icons" }),
|
|
2796
|
+
/* @__PURE__ */ jsx20(SkeletonButton, { variant: "with-icons" }),
|
|
2797
|
+
!hideDepositTracker && /* @__PURE__ */ jsx20(SkeletonButton, {})
|
|
2956
2798
|
] }) : /* @__PURE__ */ jsxs16(Fragment4, { children: [
|
|
2957
|
-
/* @__PURE__ */
|
|
2799
|
+
/* @__PURE__ */ jsx20(
|
|
2958
2800
|
TransferCryptoButton,
|
|
2959
2801
|
{
|
|
2960
2802
|
onClick: () => setView("transfer"),
|
|
@@ -2963,7 +2805,7 @@ function DepositModal({
|
|
|
2963
2805
|
featuredTokens: projectConfig.transfer_crypto.networks
|
|
2964
2806
|
}
|
|
2965
2807
|
),
|
|
2966
|
-
/* @__PURE__ */
|
|
2808
|
+
/* @__PURE__ */ jsx20(
|
|
2967
2809
|
DepositWithCardButton,
|
|
2968
2810
|
{
|
|
2969
2811
|
onClick: () => setView("card"),
|
|
@@ -2972,7 +2814,7 @@ function DepositModal({
|
|
|
2972
2814
|
paymentNetworks: projectConfig.payment_networks.networks
|
|
2973
2815
|
}
|
|
2974
2816
|
),
|
|
2975
|
-
!hideDepositTracker && /* @__PURE__ */
|
|
2817
|
+
!hideDepositTracker && /* @__PURE__ */ jsx20(
|
|
2976
2818
|
DepositTrackerButton,
|
|
2977
2819
|
{
|
|
2978
2820
|
onClick: () => setDepositsModalOpen(true),
|
|
@@ -2983,7 +2825,7 @@ function DepositModal({
|
|
|
2983
2825
|
)
|
|
2984
2826
|
] }) })
|
|
2985
2827
|
] }) : view === "transfer" ? /* @__PURE__ */ jsxs16(Fragment4, { children: [
|
|
2986
|
-
/* @__PURE__ */
|
|
2828
|
+
/* @__PURE__ */ jsx20(
|
|
2987
2829
|
DepositHeader,
|
|
2988
2830
|
{
|
|
2989
2831
|
title: t3.transferCrypto.title,
|
|
@@ -2992,7 +2834,7 @@ function DepositModal({
|
|
|
2992
2834
|
onClose: handleClose
|
|
2993
2835
|
}
|
|
2994
2836
|
),
|
|
2995
|
-
/* @__PURE__ */
|
|
2837
|
+
/* @__PURE__ */ jsx20(
|
|
2996
2838
|
TransferCrypto,
|
|
2997
2839
|
{
|
|
2998
2840
|
userId,
|
|
@@ -3008,17 +2850,17 @@ function DepositModal({
|
|
|
3008
2850
|
}
|
|
3009
2851
|
)
|
|
3010
2852
|
] }) : /* @__PURE__ */ jsxs16(Fragment4, { children: [
|
|
3011
|
-
/* @__PURE__ */
|
|
2853
|
+
/* @__PURE__ */ jsx20(
|
|
3012
2854
|
DepositHeader,
|
|
3013
2855
|
{
|
|
3014
|
-
title: cardView === "quotes" ? t3.quotes :
|
|
2856
|
+
title: cardView === "quotes" ? t3.quotes : t3.depositWithCard.title,
|
|
3015
2857
|
showBack: true,
|
|
3016
2858
|
onBack: handleBack,
|
|
3017
2859
|
onClose: handleClose,
|
|
3018
2860
|
badge: cardView === "quotes" ? { count: quotesCount } : void 0
|
|
3019
2861
|
}
|
|
3020
2862
|
),
|
|
3021
|
-
/* @__PURE__ */
|
|
2863
|
+
/* @__PURE__ */ jsx20(
|
|
3022
2864
|
BuyWithCard,
|
|
3023
2865
|
{
|
|
3024
2866
|
userId,
|
|
@@ -3040,11 +2882,12 @@ function DepositModal({
|
|
|
3040
2882
|
] })
|
|
3041
2883
|
}
|
|
3042
2884
|
),
|
|
3043
|
-
/* @__PURE__ */
|
|
2885
|
+
/* @__PURE__ */ jsx20(
|
|
3044
2886
|
DepositsModal,
|
|
3045
2887
|
{
|
|
3046
2888
|
open: depositsModalOpen,
|
|
3047
2889
|
onOpenChange: setDepositsModalOpen,
|
|
2890
|
+
onCloseAll: handleClose,
|
|
3048
2891
|
executions: depositExecutions,
|
|
3049
2892
|
userId,
|
|
3050
2893
|
publishableKey,
|
|
@@ -3055,9 +2898,9 @@ function DepositModal({
|
|
|
3055
2898
|
}
|
|
3056
2899
|
|
|
3057
2900
|
// src/components/deposits/TransferCrypto2.tsx
|
|
3058
|
-
import { jsx as
|
|
2901
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
3059
2902
|
function TransferCrypto2(props) {
|
|
3060
|
-
return /* @__PURE__ */
|
|
2903
|
+
return /* @__PURE__ */ jsx21(
|
|
3061
2904
|
TransferCryptoBase,
|
|
3062
2905
|
{
|
|
3063
2906
|
...props,
|
|
@@ -3066,13 +2909,81 @@ function TransferCrypto2(props) {
|
|
|
3066
2909
|
}
|
|
3067
2910
|
);
|
|
3068
2911
|
}
|
|
2912
|
+
|
|
2913
|
+
// src/components/shared/button.tsx
|
|
2914
|
+
import * as React5 from "react";
|
|
2915
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
2916
|
+
import { cva } from "class-variance-authority";
|
|
2917
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
2918
|
+
var buttonVariants = cva(
|
|
2919
|
+
"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",
|
|
2920
|
+
{
|
|
2921
|
+
variants: {
|
|
2922
|
+
variant: {
|
|
2923
|
+
default: "uf-bg-primary uf-text-primary-foreground hover:uf-bg-primary/90",
|
|
2924
|
+
destructive: "uf-bg-destructive uf-text-destructive-foreground hover:uf-bg-destructive/90",
|
|
2925
|
+
outline: "uf-border uf-border-input uf-bg-background hover:uf-bg-accent hover:uf-text-accent-foreground",
|
|
2926
|
+
secondary: "uf-bg-secondary uf-text-secondary-foreground hover:uf-bg-secondary/80",
|
|
2927
|
+
ghost: "hover:uf-bg-accent hover:uf-text-accent-foreground",
|
|
2928
|
+
link: "uf-text-primary uf-underline-offset-4 hover:uf-underline"
|
|
2929
|
+
},
|
|
2930
|
+
size: {
|
|
2931
|
+
default: "uf-h-10 uf-px-4 uf-py-2",
|
|
2932
|
+
sm: "uf-h-9 uf-rounded-md uf-px-3",
|
|
2933
|
+
lg: "uf-h-11 uf-rounded-md uf-px-8",
|
|
2934
|
+
icon: "uf-h-10 uf-w-10"
|
|
2935
|
+
}
|
|
2936
|
+
},
|
|
2937
|
+
defaultVariants: {
|
|
2938
|
+
variant: "default",
|
|
2939
|
+
size: "default"
|
|
2940
|
+
}
|
|
2941
|
+
}
|
|
2942
|
+
);
|
|
2943
|
+
var Button = React5.forwardRef(
|
|
2944
|
+
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
2945
|
+
const Comp = asChild ? Slot : "button";
|
|
2946
|
+
return /* @__PURE__ */ jsx22(
|
|
2947
|
+
Comp,
|
|
2948
|
+
{
|
|
2949
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
2950
|
+
ref,
|
|
2951
|
+
...props
|
|
2952
|
+
}
|
|
2953
|
+
);
|
|
2954
|
+
}
|
|
2955
|
+
);
|
|
2956
|
+
Button.displayName = "Button";
|
|
2957
|
+
|
|
2958
|
+
// src/index.ts
|
|
2959
|
+
import {
|
|
2960
|
+
createDepositAddress as createDepositAddress4,
|
|
2961
|
+
getWalletByChainType as getWalletByChainType3,
|
|
2962
|
+
queryExecutions as queryExecutions3,
|
|
2963
|
+
getSupportedDepositTokens as getSupportedDepositTokens3,
|
|
2964
|
+
getMeldQuotes as getMeldQuotes2,
|
|
2965
|
+
createMeldSession as createMeldSession2,
|
|
2966
|
+
getFiatCurrencies as getFiatCurrencies2,
|
|
2967
|
+
getTokenChains as getTokenChains2,
|
|
2968
|
+
getChainName as getChainName2,
|
|
2969
|
+
getIconUrl as getIconUrl4,
|
|
2970
|
+
getIconUrlWithCdn as getIconUrlWithCdn2,
|
|
2971
|
+
getPreferredIconUrl as getPreferredIconUrl3,
|
|
2972
|
+
getProjectConfig as getProjectConfig2,
|
|
2973
|
+
setApiConfig,
|
|
2974
|
+
getApiBaseUrl,
|
|
2975
|
+
ExecutionStatus as ExecutionStatus5,
|
|
2976
|
+
SOLANA_USDC_ADDRESS
|
|
2977
|
+
} from "@unifold/core";
|
|
2978
|
+
import { useUserIp as useUserIp2 } from "@unifold/core";
|
|
2979
|
+
import { i18n as i18n2 } from "@unifold/core";
|
|
3069
2980
|
export {
|
|
3070
2981
|
Button,
|
|
3071
2982
|
BuyWithCard,
|
|
3072
2983
|
CurrencyListItem,
|
|
3073
2984
|
CurrencyListSection,
|
|
3074
2985
|
CurrencyModal,
|
|
3075
|
-
|
|
2986
|
+
DepositDetailContent,
|
|
3076
2987
|
DepositExecutionItem,
|
|
3077
2988
|
DepositHeader,
|
|
3078
2989
|
DepositModal,
|
|
@@ -3090,7 +3001,7 @@ export {
|
|
|
3090
3001
|
DialogPortal,
|
|
3091
3002
|
DialogTitle,
|
|
3092
3003
|
DialogTrigger,
|
|
3093
|
-
ExecutionStatus,
|
|
3004
|
+
ExecutionStatus5 as ExecutionStatus,
|
|
3094
3005
|
SOLANA_USDC_ADDRESS,
|
|
3095
3006
|
Select,
|
|
3096
3007
|
SelectContent,
|
|
@@ -3114,18 +3025,22 @@ export {
|
|
|
3114
3025
|
TransferCryptoButton,
|
|
3115
3026
|
buttonVariants,
|
|
3116
3027
|
cn,
|
|
3117
|
-
|
|
3118
|
-
createMeldSession,
|
|
3028
|
+
createDepositAddress4 as createDepositAddress,
|
|
3029
|
+
createMeldSession2 as createMeldSession,
|
|
3119
3030
|
getApiBaseUrl,
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3031
|
+
getChainName2 as getChainName,
|
|
3032
|
+
getFiatCurrencies2 as getFiatCurrencies,
|
|
3033
|
+
getIconUrl4 as getIconUrl,
|
|
3034
|
+
getIconUrlWithCdn2 as getIconUrlWithCdn,
|
|
3035
|
+
getMeldQuotes2 as getMeldQuotes,
|
|
3036
|
+
getPreferredIconUrl3 as getPreferredIconUrl,
|
|
3037
|
+
getProjectConfig2 as getProjectConfig,
|
|
3038
|
+
getSupportedDepositTokens3 as getSupportedDepositTokens,
|
|
3039
|
+
getTokenChains2 as getTokenChains,
|
|
3040
|
+
getWalletByChainType3 as getWalletByChainType,
|
|
3041
|
+
i18n2 as i18n,
|
|
3042
|
+
queryExecutions3 as queryExecutions,
|
|
3128
3043
|
setApiConfig,
|
|
3129
3044
|
useTheme,
|
|
3130
|
-
useUserIp
|
|
3045
|
+
useUserIp2 as useUserIp
|
|
3131
3046
|
};
|