@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.js
CHANGED
|
@@ -35,7 +35,7 @@ __export(index_exports, {
|
|
|
35
35
|
CurrencyListItem: () => CurrencyListItem,
|
|
36
36
|
CurrencyListSection: () => CurrencyListSection,
|
|
37
37
|
CurrencyModal: () => CurrencyModal,
|
|
38
|
-
|
|
38
|
+
DepositDetailContent: () => DepositDetailContent,
|
|
39
39
|
DepositExecutionItem: () => DepositExecutionItem,
|
|
40
40
|
DepositHeader: () => DepositHeader,
|
|
41
41
|
DepositModal: () => DepositModal,
|
|
@@ -53,8 +53,8 @@ __export(index_exports, {
|
|
|
53
53
|
DialogPortal: () => DialogPortal,
|
|
54
54
|
DialogTitle: () => DialogTitle,
|
|
55
55
|
DialogTrigger: () => DialogTrigger,
|
|
56
|
-
ExecutionStatus: () => ExecutionStatus,
|
|
57
|
-
SOLANA_USDC_ADDRESS: () => SOLANA_USDC_ADDRESS,
|
|
56
|
+
ExecutionStatus: () => import_core9.ExecutionStatus,
|
|
57
|
+
SOLANA_USDC_ADDRESS: () => import_core9.SOLANA_USDC_ADDRESS,
|
|
58
58
|
Select: () => Select,
|
|
59
59
|
SelectContent: () => SelectContent,
|
|
60
60
|
SelectGroup: () => SelectGroup,
|
|
@@ -77,25 +77,29 @@ __export(index_exports, {
|
|
|
77
77
|
TransferCryptoButton: () => TransferCryptoButton,
|
|
78
78
|
buttonVariants: () => buttonVariants,
|
|
79
79
|
cn: () => cn,
|
|
80
|
-
|
|
81
|
-
createMeldSession: () => createMeldSession,
|
|
82
|
-
getApiBaseUrl: () => getApiBaseUrl,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
80
|
+
createDepositAddress: () => import_core9.createDepositAddress,
|
|
81
|
+
createMeldSession: () => import_core9.createMeldSession,
|
|
82
|
+
getApiBaseUrl: () => import_core9.getApiBaseUrl,
|
|
83
|
+
getChainName: () => import_core9.getChainName,
|
|
84
|
+
getFiatCurrencies: () => import_core9.getFiatCurrencies,
|
|
85
|
+
getIconUrl: () => import_core9.getIconUrl,
|
|
86
|
+
getIconUrlWithCdn: () => import_core9.getIconUrlWithCdn,
|
|
87
|
+
getMeldQuotes: () => import_core9.getMeldQuotes,
|
|
88
|
+
getPreferredIconUrl: () => import_core9.getPreferredIconUrl,
|
|
89
|
+
getProjectConfig: () => import_core9.getProjectConfig,
|
|
90
|
+
getSupportedDepositTokens: () => import_core9.getSupportedDepositTokens,
|
|
91
|
+
getTokenChains: () => import_core9.getTokenChains,
|
|
92
|
+
getWalletByChainType: () => import_core9.getWalletByChainType,
|
|
93
|
+
i18n: () => import_core11.i18n,
|
|
94
|
+
queryExecutions: () => import_core9.queryExecutions,
|
|
95
|
+
setApiConfig: () => import_core9.setApiConfig,
|
|
92
96
|
useTheme: () => useTheme,
|
|
93
|
-
useUserIp: () => useUserIp
|
|
97
|
+
useUserIp: () => import_core10.useUserIp
|
|
94
98
|
});
|
|
95
99
|
module.exports = __toCommonJS(index_exports);
|
|
96
100
|
|
|
97
101
|
// src/components/deposits/DepositModal.tsx
|
|
98
|
-
var
|
|
102
|
+
var import_react8 = require("react");
|
|
99
103
|
var import_lucide_react14 = require("lucide-react");
|
|
100
104
|
|
|
101
105
|
// src/components/shared/dialog.tsx
|
|
@@ -236,7 +240,7 @@ var DialogDescription = React2.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
236
240
|
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
237
241
|
|
|
238
242
|
// src/components/deposits/TransferCryptoBase.tsx
|
|
239
|
-
var
|
|
243
|
+
var import_react5 = require("react");
|
|
240
244
|
var import_lucide_react7 = require("lucide-react");
|
|
241
245
|
|
|
242
246
|
// src/components/deposits/StyledQRCode.tsx
|
|
@@ -333,7 +337,7 @@ function StyledQRCode({
|
|
|
333
337
|
}
|
|
334
338
|
|
|
335
339
|
// src/components/deposits/DepositsModal.tsx
|
|
336
|
-
var
|
|
340
|
+
var import_react3 = require("react");
|
|
337
341
|
|
|
338
342
|
// src/components/deposits/DepositHeader.tsx
|
|
339
343
|
var import_lucide_react2 = require("lucide-react");
|
|
@@ -372,204 +376,13 @@ function DepositHeader({
|
|
|
372
376
|
|
|
373
377
|
// src/components/deposits/DepositExecutionItem.tsx
|
|
374
378
|
var import_lucide_react3 = require("lucide-react");
|
|
375
|
-
|
|
376
|
-
// src/lib/api.ts
|
|
377
|
-
var API_BASE_URL = process.env.NEXT_PUBLIC_API_BASE_URL || "https://api.unifold.io";
|
|
378
|
-
var DEFAULT_PUBLISHABLE_KEY = "pk_test_123";
|
|
379
|
-
var DEFAULT_CONFIG = {};
|
|
380
|
-
function setApiConfig(config) {
|
|
381
|
-
if (config.baseUrl) {
|
|
382
|
-
API_BASE_URL = config.baseUrl;
|
|
383
|
-
}
|
|
384
|
-
if (config.publishableKey) {
|
|
385
|
-
DEFAULT_PUBLISHABLE_KEY = config.publishableKey;
|
|
386
|
-
}
|
|
387
|
-
if (config.defaultConfig) {
|
|
388
|
-
DEFAULT_CONFIG = config.defaultConfig;
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
function getApiBaseUrl() {
|
|
392
|
-
return API_BASE_URL;
|
|
393
|
-
}
|
|
394
|
-
function getIconUrl(iconPath) {
|
|
395
|
-
const normalizedPath = iconPath.startsWith("/") ? iconPath : `/${iconPath}`;
|
|
396
|
-
return `${API_BASE_URL}/api/public${normalizedPath}`;
|
|
397
|
-
}
|
|
398
|
-
function getIconUrlWithCdn(iconPath, assetCdnUrl) {
|
|
399
|
-
if (!assetCdnUrl) {
|
|
400
|
-
return getIconUrl(iconPath);
|
|
401
|
-
}
|
|
402
|
-
const normalizedPath = iconPath.startsWith("/") ? iconPath : `/${iconPath}`;
|
|
403
|
-
const baseUrl = assetCdnUrl.endsWith("/") ? assetCdnUrl.slice(0, -1) : assetCdnUrl;
|
|
404
|
-
return `${baseUrl}/api/public${normalizedPath}`;
|
|
405
|
-
}
|
|
406
|
-
async function createEOA(overrides, publishableKey) {
|
|
407
|
-
if (!overrides?.user_id) {
|
|
408
|
-
throw new Error("user_id is required");
|
|
409
|
-
}
|
|
410
|
-
const payload = {
|
|
411
|
-
user_id: overrides.user_id,
|
|
412
|
-
destination_chain_type: overrides?.destination_chain_type || "ethereum",
|
|
413
|
-
destination_chain_id: overrides?.destination_chain_id || DEFAULT_CONFIG.destinationChainId || "8453",
|
|
414
|
-
destination_token_address: overrides?.destination_token_address || DEFAULT_CONFIG.destinationTokenAddress || "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
|
|
415
|
-
recipient_address: overrides?.recipient_address || DEFAULT_CONFIG.recipientAddress || "0x309a4154a2CD4153Da886E780890C9cb5161553C",
|
|
416
|
-
client_metadata: overrides?.client_metadata || {}
|
|
417
|
-
};
|
|
418
|
-
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
419
|
-
const response = await fetch(`${API_BASE_URL}/v1/public/deposit_addresses`, {
|
|
420
|
-
method: "POST",
|
|
421
|
-
headers: {
|
|
422
|
-
accept: "application/json",
|
|
423
|
-
"x-publishable-key": pk,
|
|
424
|
-
"Content-Type": "application/json"
|
|
425
|
-
},
|
|
426
|
-
body: JSON.stringify(payload)
|
|
427
|
-
});
|
|
428
|
-
if (!response.ok) {
|
|
429
|
-
throw new Error(`Failed to create EOA: ${response.statusText}`);
|
|
430
|
-
}
|
|
431
|
-
return response.json();
|
|
432
|
-
}
|
|
433
|
-
function getWalletByChainType(wallets, chainType) {
|
|
434
|
-
return wallets.find((wallet) => wallet.chain_type === chainType);
|
|
435
|
-
}
|
|
436
|
-
var ExecutionStatus = /* @__PURE__ */ ((ExecutionStatus2) => {
|
|
437
|
-
ExecutionStatus2["DELAYED"] = "delayed";
|
|
438
|
-
ExecutionStatus2["FAILED"] = "failed";
|
|
439
|
-
ExecutionStatus2["PENDING"] = "pending";
|
|
440
|
-
ExecutionStatus2["REFUNDED"] = "refunded";
|
|
441
|
-
ExecutionStatus2["SUCCEEDED"] = "succeeded";
|
|
442
|
-
ExecutionStatus2["WAITING"] = "waiting";
|
|
443
|
-
return ExecutionStatus2;
|
|
444
|
-
})(ExecutionStatus || {});
|
|
445
|
-
var SOLANA_USDC_ADDRESS = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";
|
|
446
|
-
async function queryExecutions(externalUserId, publishableKey) {
|
|
447
|
-
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
448
|
-
const response = await fetch(
|
|
449
|
-
`${API_BASE_URL}/v1/public/direct_executions/query`,
|
|
450
|
-
{
|
|
451
|
-
method: "POST",
|
|
452
|
-
headers: {
|
|
453
|
-
accept: "application/json",
|
|
454
|
-
"x-publishable-key": pk,
|
|
455
|
-
"Content-Type": "application/json"
|
|
456
|
-
},
|
|
457
|
-
body: JSON.stringify({
|
|
458
|
-
external_user_id: externalUserId
|
|
459
|
-
})
|
|
460
|
-
}
|
|
461
|
-
);
|
|
462
|
-
if (!response.ok) {
|
|
463
|
-
throw new Error(`Failed to query executions: ${response.statusText}`);
|
|
464
|
-
}
|
|
465
|
-
return response.json();
|
|
466
|
-
}
|
|
467
|
-
async function getSupportedDepositTokens(publishableKey) {
|
|
468
|
-
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
469
|
-
const response = await fetch(
|
|
470
|
-
`${API_BASE_URL}/v1/public/tokens/supported_deposit_tokens`,
|
|
471
|
-
{
|
|
472
|
-
method: "GET",
|
|
473
|
-
headers: {
|
|
474
|
-
accept: "application/json",
|
|
475
|
-
"x-publishable-key": pk
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
);
|
|
479
|
-
if (!response.ok) {
|
|
480
|
-
throw new Error(
|
|
481
|
-
`Failed to fetch supported deposit tokens: ${response.statusText}`
|
|
482
|
-
);
|
|
483
|
-
}
|
|
484
|
-
return response.json();
|
|
485
|
-
}
|
|
486
|
-
async function getMeldQuotes(request, publishableKey) {
|
|
487
|
-
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
488
|
-
const response = await fetch(
|
|
489
|
-
`${API_BASE_URL}/v1/public/onramps/meld/quotes`,
|
|
490
|
-
{
|
|
491
|
-
method: "POST",
|
|
492
|
-
headers: {
|
|
493
|
-
accept: "application/json",
|
|
494
|
-
"x-publishable-key": pk,
|
|
495
|
-
"Content-Type": "application/json"
|
|
496
|
-
},
|
|
497
|
-
body: JSON.stringify(request)
|
|
498
|
-
}
|
|
499
|
-
);
|
|
500
|
-
if (!response.ok) {
|
|
501
|
-
throw new Error(`Failed to fetch Meld quotes: ${response.statusText}`);
|
|
502
|
-
}
|
|
503
|
-
return response.json();
|
|
504
|
-
}
|
|
505
|
-
async function createMeldSession(request, publishableKey) {
|
|
506
|
-
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
507
|
-
const response = await fetch(
|
|
508
|
-
`${API_BASE_URL}/v1/public/onramps/meld/sessions`,
|
|
509
|
-
{
|
|
510
|
-
method: "POST",
|
|
511
|
-
headers: {
|
|
512
|
-
accept: "application/json",
|
|
513
|
-
"x-publishable-key": pk,
|
|
514
|
-
"Content-Type": "application/json"
|
|
515
|
-
},
|
|
516
|
-
body: JSON.stringify(request)
|
|
517
|
-
}
|
|
518
|
-
);
|
|
519
|
-
if (!response.ok) {
|
|
520
|
-
throw new Error(`Failed to create Meld session: ${response.statusText}`);
|
|
521
|
-
}
|
|
522
|
-
return response.json();
|
|
523
|
-
}
|
|
524
|
-
function getPreferredIconUrl(iconUrls, preferredFormat = "svg") {
|
|
525
|
-
if (!iconUrls || iconUrls.length === 0) {
|
|
526
|
-
return void 0;
|
|
527
|
-
}
|
|
528
|
-
const preferred = iconUrls.find((icon) => icon.format === preferredFormat);
|
|
529
|
-
if (preferred) {
|
|
530
|
-
return preferred.url;
|
|
531
|
-
}
|
|
532
|
-
return iconUrls[0]?.url;
|
|
533
|
-
}
|
|
534
|
-
async function getFiatCurrencies(publishableKey) {
|
|
535
|
-
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
536
|
-
const response = await fetch(
|
|
537
|
-
`${API_BASE_URL}/v1/public/onramps/fiat_currencies`,
|
|
538
|
-
{
|
|
539
|
-
method: "GET",
|
|
540
|
-
headers: {
|
|
541
|
-
accept: "application/json",
|
|
542
|
-
"x-publishable-key": pk
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
);
|
|
546
|
-
if (!response.ok) {
|
|
547
|
-
throw new Error(`Failed to fetch fiat currencies: ${response.statusText}`);
|
|
548
|
-
}
|
|
549
|
-
return response.json();
|
|
550
|
-
}
|
|
551
|
-
async function getProjectConfig(publishableKey) {
|
|
552
|
-
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
553
|
-
const response = await fetch(`${API_BASE_URL}/v1/public/projects/config`, {
|
|
554
|
-
method: "GET",
|
|
555
|
-
headers: {
|
|
556
|
-
accept: "application/json",
|
|
557
|
-
"x-publishable-key": pk
|
|
558
|
-
}
|
|
559
|
-
});
|
|
560
|
-
if (!response.ok) {
|
|
561
|
-
throw new Error(`Failed to fetch project config: ${response.statusText}`);
|
|
562
|
-
}
|
|
563
|
-
return response.json();
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
// src/components/deposits/DepositExecutionItem.tsx
|
|
379
|
+
var import_core = require("@unifold/core");
|
|
567
380
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
568
381
|
function DepositExecutionItem({
|
|
569
382
|
execution,
|
|
570
383
|
onClick
|
|
571
384
|
}) {
|
|
572
|
-
const isPending = execution.status ===
|
|
385
|
+
const isPending = execution.status === import_core.ExecutionStatus.PENDING || execution.status === import_core.ExecutionStatus.WAITING || execution.status === import_core.ExecutionStatus.DELAYED;
|
|
573
386
|
const formatDateTime = (timestamp) => {
|
|
574
387
|
try {
|
|
575
388
|
const date = new Date(timestamp);
|
|
@@ -611,7 +424,7 @@ function DepositExecutionItem({
|
|
|
611
424
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
612
425
|
"img",
|
|
613
426
|
{
|
|
614
|
-
src: execution.
|
|
427
|
+
src: execution.destination_token_metadata?.icon_url || (0, import_core.getIconUrl)("/icons/tokens/svg/usdc.svg"),
|
|
615
428
|
alt: "Token",
|
|
616
429
|
width: 36,
|
|
617
430
|
height: 36,
|
|
@@ -636,7 +449,7 @@ function DepositExecutionItem({
|
|
|
636
449
|
}
|
|
637
450
|
)
|
|
638
451
|
}
|
|
639
|
-
) }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "uf-absolute -uf-bottom-0.5 -uf-right-0.5 uf-bg-
|
|
452
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("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__ */ (0, import_jsx_runtime5.jsx)("svg", { width: "10", height: "10", viewBox: "0 0 12 12", fill: "none", className: "uf-block", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
640
453
|
"path",
|
|
641
454
|
{
|
|
642
455
|
d: "M10 3L4.5 8.5L2 6",
|
|
@@ -648,7 +461,7 @@ function DepositExecutionItem({
|
|
|
648
461
|
) }) })
|
|
649
462
|
] }),
|
|
650
463
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "uf-flex-1 uf-min-w-0", children: [
|
|
651
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("h3", { className: "uf-text-foreground uf-font-medium uf-text-sm uf-leading-tight", children: isPending ? "Deposit
|
|
464
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("h3", { className: "uf-text-foreground uf-font-medium uf-text-sm uf-leading-tight", children: isPending ? "Deposit processing" : "Deposit completed" }),
|
|
652
465
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "uf-text-muted-foreground uf-text-xs uf-leading-tight", children: formatDateTime(execution.created_at || (/* @__PURE__ */ new Date()).toISOString()) })
|
|
653
466
|
] }),
|
|
654
467
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "uf-text-foreground uf-font-medium uf-text-sm uf-flex-shrink-0", children: formatUsdAmount(execution.source_amount_base_unit) }),
|
|
@@ -658,30 +471,21 @@ function DepositExecutionItem({
|
|
|
658
471
|
);
|
|
659
472
|
}
|
|
660
473
|
|
|
661
|
-
// src/components/deposits/
|
|
474
|
+
// src/components/deposits/DepositDetailContent.tsx
|
|
475
|
+
var import_react2 = require("react");
|
|
662
476
|
var import_lucide_react4 = require("lucide-react");
|
|
477
|
+
var import_core2 = require("@unifold/core");
|
|
663
478
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
bitcoin: "Bitcoin",
|
|
675
|
-
mainnet: "Mainnet"
|
|
676
|
-
};
|
|
677
|
-
function DepositDetailModal({
|
|
678
|
-
open,
|
|
679
|
-
onOpenChange,
|
|
680
|
-
execution,
|
|
681
|
-
themeClass = ""
|
|
682
|
-
}) {
|
|
683
|
-
if (!execution) return null;
|
|
684
|
-
const isPending = execution.status === "pending" /* PENDING */ || execution.status === "waiting" /* WAITING */ || execution.status === "delayed" /* DELAYED */;
|
|
479
|
+
function DepositDetailContent({ execution }) {
|
|
480
|
+
const [chains, setChains] = (0, import_react2.useState)([]);
|
|
481
|
+
const [showNetworkDetails, setShowNetworkDetails] = (0, import_react2.useState)(false);
|
|
482
|
+
(0, import_react2.useEffect)(() => {
|
|
483
|
+
(0, import_core2.getTokenChains)().then((response) => setChains(response.data)).catch((err) => console.error("Failed to fetch chains:", err));
|
|
484
|
+
}, []);
|
|
485
|
+
(0, import_react2.useEffect)(() => {
|
|
486
|
+
setShowNetworkDetails(false);
|
|
487
|
+
}, [execution?.id]);
|
|
488
|
+
const isPending = execution.status === import_core2.ExecutionStatus.PENDING || execution.status === import_core2.ExecutionStatus.WAITING || execution.status === import_core2.ExecutionStatus.DELAYED;
|
|
685
489
|
const formatDateTime = (timestamp) => {
|
|
686
490
|
try {
|
|
687
491
|
const date = new Date(timestamp);
|
|
@@ -736,177 +540,169 @@ function DepositDetailModal({
|
|
|
736
540
|
return "$0.00";
|
|
737
541
|
};
|
|
738
542
|
const getNetworkName = (chainType, chainId) => {
|
|
739
|
-
return
|
|
740
|
-
};
|
|
741
|
-
const getSourceTokenSymbol = () => {
|
|
742
|
-
return "USDC";
|
|
543
|
+
return (0, import_core2.getChainName)(chains, chainType, chainId);
|
|
743
544
|
};
|
|
744
|
-
const
|
|
745
|
-
return
|
|
545
|
+
const formatTransactionHash = (hash) => {
|
|
546
|
+
if (!hash || hash.length < 12) return hash;
|
|
547
|
+
return `${hash.slice(0, 12)}...${hash.slice(-4)}`;
|
|
746
548
|
};
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
"svg",
|
|
771
|
-
{
|
|
772
|
-
width: "16",
|
|
773
|
-
height: "16",
|
|
774
|
-
viewBox: "0 0 12 12",
|
|
775
|
-
fill: "none",
|
|
776
|
-
className: "uf-animate-spin uf-block",
|
|
777
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
778
|
-
"path",
|
|
779
|
-
{
|
|
780
|
-
d: "M6 1V3M6 9V11M1 6H3M9 6H11M2.5 2.5L4 4M8 8L9.5 9.5M2.5 9.5L4 8M8 4L9.5 2.5",
|
|
781
|
-
stroke: "white",
|
|
782
|
-
strokeWidth: "2",
|
|
783
|
-
strokeLinecap: "round"
|
|
784
|
-
}
|
|
785
|
-
)
|
|
786
|
-
}
|
|
787
|
-
) }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "uf-absolute -uf-bottom-1 -uf-right-1 uf-bg-blue-500 uf-rounded-full uf-p-1", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
788
|
-
"svg",
|
|
789
|
-
{
|
|
790
|
-
width: "16",
|
|
791
|
-
height: "16",
|
|
792
|
-
viewBox: "0 0 12 12",
|
|
793
|
-
fill: "none",
|
|
794
|
-
className: "uf-block",
|
|
795
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
796
|
-
"path",
|
|
797
|
-
{
|
|
798
|
-
d: "M10 3L4.5 8.5L2 6",
|
|
799
|
-
stroke: "white",
|
|
800
|
-
strokeWidth: "2",
|
|
801
|
-
strokeLinecap: "round",
|
|
802
|
-
strokeLinejoin: "round"
|
|
803
|
-
}
|
|
804
|
-
)
|
|
805
|
-
}
|
|
806
|
-
) })
|
|
807
|
-
] }),
|
|
808
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-1.5 uf-mb-1", children: [
|
|
809
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
810
|
-
"div",
|
|
811
|
-
{
|
|
812
|
-
className: `uf-w-2 uf-h-2 uf-rounded-full ${isPending ? "uf-bg-yellow-500" : "uf-bg-green-500"}`
|
|
813
|
-
}
|
|
814
|
-
),
|
|
815
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "uf-text-foreground uf-font-medium", children: isPending ? "Pending" : "Completed" })
|
|
816
|
-
] }),
|
|
817
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: formatDateTime(execution.created_at || (/* @__PURE__ */ new Date()).toISOString()) })
|
|
818
|
-
] }),
|
|
819
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "uf-bg-secondary uf-rounded-xl uf-overflow-hidden uf-mb-3", children: [
|
|
820
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
|
|
821
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Amount Sent" }),
|
|
822
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "uf-text-foreground uf-font-medium", children: [
|
|
823
|
-
formatAmount(execution.source_amount_base_unit),
|
|
824
|
-
" ",
|
|
825
|
-
getSourceTokenSymbol()
|
|
826
|
-
] })
|
|
827
|
-
] }),
|
|
828
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
|
|
829
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Amount Received" }),
|
|
830
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "uf-text-foreground uf-font-medium", children: [
|
|
831
|
-
formatAmount(execution.destination_amount_base_unit),
|
|
832
|
-
" ",
|
|
833
|
-
getDestinationTokenSymbol()
|
|
834
|
-
] })
|
|
835
|
-
] }),
|
|
836
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3", children: [
|
|
837
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "USD Value" }),
|
|
838
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "uf-text-foreground uf-font-medium", children: formatUsdAmount(execution.source_amount_usd, execution.source_amount_base_unit) })
|
|
839
|
-
] })
|
|
840
|
-
] }),
|
|
841
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "uf-bg-secondary uf-rounded-xl uf-overflow-hidden uf-mb-4", children: [
|
|
842
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
|
|
843
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Source Network" }),
|
|
844
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "uf-text-foreground uf-font-medium", children: getNetworkName(execution.source_chain_type, execution.source_chain_id) })
|
|
845
|
-
] }),
|
|
846
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3", children: [
|
|
847
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Destination Network" }),
|
|
848
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "uf-text-foreground uf-font-medium", children: getNetworkName(execution.destination_chain_type, execution.destination_chain_id) })
|
|
849
|
-
] })
|
|
850
|
-
] }),
|
|
851
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "uf-space-y-2", children: [
|
|
852
|
-
execution.explorer_url && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
853
|
-
"a",
|
|
549
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "uf-px-2", children: [
|
|
550
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "uf-flex uf-flex-col uf-items-center uf-py-6", children: [
|
|
551
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "uf-relative uf-mb-3", children: [
|
|
552
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
553
|
+
"img",
|
|
554
|
+
{
|
|
555
|
+
src: execution.destination_token_metadata?.icon_url || (0, import_core2.getIconUrl)("/icons/tokens/svg/usdc.svg"),
|
|
556
|
+
alt: "Token",
|
|
557
|
+
width: 64,
|
|
558
|
+
height: 64,
|
|
559
|
+
className: "uf-rounded-full"
|
|
560
|
+
}
|
|
561
|
+
),
|
|
562
|
+
isPending ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "uf-absolute -uf-bottom-1 -uf-right-1 uf-bg-yellow-500 uf-rounded-full uf-p-1", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
563
|
+
"svg",
|
|
564
|
+
{
|
|
565
|
+
width: "16",
|
|
566
|
+
height: "16",
|
|
567
|
+
viewBox: "0 0 24 24",
|
|
568
|
+
fill: "none",
|
|
569
|
+
className: "uf-animate-spin uf-block",
|
|
570
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
571
|
+
"path",
|
|
854
572
|
{
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
children: [
|
|
860
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
861
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react4.ArrowDownCircle, { className: "uf-w-5 uf-h-5" }),
|
|
862
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "uf-font-medium", children: "View Deposit Transaction" })
|
|
863
|
-
] }),
|
|
864
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react4.ExternalLink, { className: "uf-w-4 uf-h-4" })
|
|
865
|
-
]
|
|
573
|
+
d: "M21 12a9 9 0 1 1-6.22-8.56",
|
|
574
|
+
stroke: "white",
|
|
575
|
+
strokeWidth: "3",
|
|
576
|
+
strokeLinecap: "round"
|
|
866
577
|
}
|
|
867
|
-
)
|
|
868
|
-
|
|
869
|
-
|
|
578
|
+
)
|
|
579
|
+
}
|
|
580
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "uf-absolute -uf-bottom-1 -uf-right-1 uf-bg-green-500 uf-rounded-full uf-p-1", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
581
|
+
"svg",
|
|
582
|
+
{
|
|
583
|
+
width: "16",
|
|
584
|
+
height: "16",
|
|
585
|
+
viewBox: "0 0 12 12",
|
|
586
|
+
fill: "none",
|
|
587
|
+
className: "uf-block",
|
|
588
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
589
|
+
"path",
|
|
870
590
|
{
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
877
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react4.CheckCircle, { className: "uf-w-5 uf-h-5" }),
|
|
878
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "uf-font-medium", children: "View Completion Transaction" })
|
|
879
|
-
] }),
|
|
880
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react4.ExternalLink, { className: "uf-w-4 uf-h-4" })
|
|
881
|
-
]
|
|
591
|
+
d: "M10 3L4.5 8.5L2 6",
|
|
592
|
+
stroke: "white",
|
|
593
|
+
strokeWidth: "2",
|
|
594
|
+
strokeLinecap: "round",
|
|
595
|
+
strokeLinejoin: "round"
|
|
882
596
|
}
|
|
883
597
|
)
|
|
884
|
-
|
|
885
|
-
|
|
598
|
+
}
|
|
599
|
+
) })
|
|
600
|
+
] }),
|
|
601
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-1.5 uf-mb-1", children: [
|
|
602
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
603
|
+
"div",
|
|
604
|
+
{
|
|
605
|
+
className: `uf-w-2 uf-h-2 uf-rounded-full ${isPending ? "uf-bg-yellow-500" : "uf-bg-green-500"}`
|
|
606
|
+
}
|
|
607
|
+
),
|
|
608
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "uf-text-foreground uf-font-medium", children: isPending ? "Processing" : "Completed" })
|
|
609
|
+
] }),
|
|
610
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: formatDateTime(execution.created_at || (/* @__PURE__ */ new Date()).toISOString()) })
|
|
611
|
+
] }),
|
|
612
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "uf-bg-secondary uf-rounded-xl uf-overflow-hidden uf-mb-3", children: [
|
|
613
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
|
|
614
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Amount Sent" }),
|
|
615
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "uf-text-foreground uf-font-medium", children: [
|
|
616
|
+
formatAmount(execution.source_amount_base_unit),
|
|
617
|
+
" ",
|
|
618
|
+
execution.source_currency?.toUpperCase()
|
|
886
619
|
] })
|
|
887
|
-
]
|
|
888
|
-
|
|
889
|
-
|
|
620
|
+
] }),
|
|
621
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
|
|
622
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Amount Received" }),
|
|
623
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "uf-text-foreground uf-font-medium", children: [
|
|
624
|
+
formatAmount(execution.destination_amount_base_unit),
|
|
625
|
+
" ",
|
|
626
|
+
execution.destination_currency?.toUpperCase()
|
|
627
|
+
] })
|
|
628
|
+
] }),
|
|
629
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
|
|
630
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "USD Value" }),
|
|
631
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "uf-text-foreground uf-font-medium", children: formatUsdAmount(execution.source_amount_usd, execution.source_amount_base_unit) })
|
|
632
|
+
] }),
|
|
633
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
|
|
634
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Source Network" }),
|
|
635
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "uf-text-foreground uf-font-medium", children: getNetworkName(execution.source_chain_type, execution.source_chain_id) })
|
|
636
|
+
] }),
|
|
637
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3", children: [
|
|
638
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Destination Network" }),
|
|
639
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "uf-text-foreground uf-font-medium", children: getNetworkName(execution.destination_chain_type, execution.destination_chain_id) })
|
|
640
|
+
] })
|
|
641
|
+
] }),
|
|
642
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
643
|
+
"button",
|
|
644
|
+
{
|
|
645
|
+
type: "button",
|
|
646
|
+
onClick: () => setShowNetworkDetails(!showNetworkDetails),
|
|
647
|
+
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",
|
|
648
|
+
children: [
|
|
649
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: showNetworkDetails ? "See less" : "See more details" }),
|
|
650
|
+
showNetworkDetails ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react4.ChevronUp, { className: "uf-w-4 uf-h-4" }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react4.ChevronDown, { className: "uf-w-4 uf-h-4" })
|
|
651
|
+
]
|
|
652
|
+
}
|
|
653
|
+
),
|
|
654
|
+
showNetworkDetails && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "uf-bg-secondary uf-rounded-xl uf-overflow-hidden uf-mb-4", children: [
|
|
655
|
+
execution.transaction_hash && execution.explorer_url && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
656
|
+
"a",
|
|
657
|
+
{
|
|
658
|
+
href: execution.explorer_url,
|
|
659
|
+
target: "_blank",
|
|
660
|
+
rel: "noopener noreferrer",
|
|
661
|
+
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",
|
|
662
|
+
children: [
|
|
663
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "uf-text-muted-foreground uf-text-sm", children: "Deposit Tx" }),
|
|
664
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "uf-text-sm uf-text-foreground uf-text-right", children: formatTransactionHash(execution.transaction_hash) }),
|
|
665
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react4.ExternalLink, { className: "uf-w-3.5 uf-h-3.5 uf-text-muted-foreground uf-block" })
|
|
666
|
+
]
|
|
667
|
+
}
|
|
668
|
+
),
|
|
669
|
+
!isPending && execution.destination_transaction_hashes?.length > 0 && execution.destination_explorer_url && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
670
|
+
"a",
|
|
671
|
+
{
|
|
672
|
+
href: execution.destination_explorer_url,
|
|
673
|
+
target: "_blank",
|
|
674
|
+
rel: "noopener noreferrer",
|
|
675
|
+
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",
|
|
676
|
+
children: [
|
|
677
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "uf-text-muted-foreground uf-text-sm", children: "Completion Tx" }),
|
|
678
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "uf-text-sm uf-text-foreground uf-text-right", children: formatTransactionHash(execution.destination_transaction_hashes[0]) }),
|
|
679
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react4.ExternalLink, { className: "uf-w-3.5 uf-h-3.5 uf-text-muted-foreground uf-block" })
|
|
680
|
+
]
|
|
681
|
+
}
|
|
682
|
+
)
|
|
683
|
+
] })
|
|
684
|
+
] });
|
|
890
685
|
}
|
|
891
686
|
|
|
892
687
|
// src/components/deposits/DepositsModal.tsx
|
|
688
|
+
var import_core3 = require("@unifold/core");
|
|
893
689
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
894
690
|
function DepositsModal({
|
|
895
691
|
open,
|
|
896
692
|
onOpenChange,
|
|
693
|
+
onCloseAll,
|
|
897
694
|
executions: sessionExecutions,
|
|
898
695
|
userId,
|
|
899
696
|
publishableKey,
|
|
900
697
|
themeClass = ""
|
|
901
698
|
}) {
|
|
902
|
-
const [allExecutions, setAllExecutions] = (0,
|
|
903
|
-
const [selectedExecution, setSelectedExecution] = (0,
|
|
904
|
-
|
|
905
|
-
(0, import_react2.useEffect)(() => {
|
|
699
|
+
const [allExecutions, setAllExecutions] = (0, import_react3.useState)(sessionExecutions);
|
|
700
|
+
const [selectedExecution, setSelectedExecution] = (0, import_react3.useState)(null);
|
|
701
|
+
(0, import_react3.useEffect)(() => {
|
|
906
702
|
if (!open || !userId) return;
|
|
907
703
|
const fetchExecutions = async () => {
|
|
908
704
|
try {
|
|
909
|
-
const response = await queryExecutions(userId, publishableKey);
|
|
705
|
+
const response = await (0, import_core3.queryExecutions)(userId, publishableKey);
|
|
910
706
|
const sorted = [...response.data].sort((a, b) => {
|
|
911
707
|
const timeA = a.created_at ? new Date(a.created_at).getTime() : 0;
|
|
912
708
|
const timeB = b.created_at ? new Date(b.created_at).getTime() : 0;
|
|
@@ -924,39 +720,61 @@ function DepositsModal({
|
|
|
924
720
|
clearInterval(pollInterval);
|
|
925
721
|
};
|
|
926
722
|
}, [open, userId, publishableKey, sessionExecutions]);
|
|
723
|
+
(0, import_react3.useEffect)(() => {
|
|
724
|
+
if (!open) {
|
|
725
|
+
setSelectedExecution(null);
|
|
726
|
+
}
|
|
727
|
+
}, [open]);
|
|
728
|
+
const handleBack = () => {
|
|
729
|
+
if (selectedExecution) {
|
|
730
|
+
setSelectedExecution(null);
|
|
731
|
+
} else {
|
|
732
|
+
onOpenChange(false);
|
|
733
|
+
}
|
|
734
|
+
};
|
|
927
735
|
const handleClose = () => {
|
|
928
736
|
onOpenChange(false);
|
|
737
|
+
onCloseAll?.();
|
|
929
738
|
};
|
|
930
739
|
const handleExecutionClick = (execution) => {
|
|
931
740
|
setSelectedExecution(execution);
|
|
932
|
-
setDetailModalOpen(true);
|
|
933
741
|
};
|
|
934
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
935
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Dialog, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(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: [
|
|
936
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DepositHeader, { title: "Deposit Tracker", onClose: handleClose }),
|
|
937
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "uf-max-h-[500px] uf-overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:uf-hidden uf-pb-4", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "uf-space-y-2", children: allExecutions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "uf-py-8 uf-px-4 uf-text-center", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "uf-text-muted-foreground uf-text-sm", children: "No deposits yet" }) }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, { children: allExecutions.map((execution) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
938
|
-
DepositExecutionItem,
|
|
939
|
-
{
|
|
940
|
-
execution,
|
|
941
|
-
onClick: () => handleExecutionClick(execution)
|
|
942
|
-
},
|
|
943
|
-
execution.id
|
|
944
|
-
)) }) }) })
|
|
945
|
-
] }) }),
|
|
742
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Dialog, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(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__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
946
743
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
947
|
-
|
|
744
|
+
DepositHeader,
|
|
948
745
|
{
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
746
|
+
title: "Deposit Details",
|
|
747
|
+
showBack: true,
|
|
748
|
+
onBack: () => setSelectedExecution(null),
|
|
749
|
+
onClose: handleClose
|
|
953
750
|
}
|
|
954
|
-
)
|
|
955
|
-
|
|
751
|
+
),
|
|
752
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DepositDetailContent, { execution: selectedExecution })
|
|
753
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
754
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
755
|
+
DepositHeader,
|
|
756
|
+
{
|
|
757
|
+
title: "Deposit Tracker",
|
|
758
|
+
showBack: true,
|
|
759
|
+
onBack: handleBack,
|
|
760
|
+
onClose: handleClose
|
|
761
|
+
}
|
|
762
|
+
),
|
|
763
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "uf-max-h-[400px] uf-overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:uf-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "uf-space-y-2", children: allExecutions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "uf-py-8 uf-px-4 uf-text-center", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "uf-text-muted-foreground uf-text-sm", children: "No deposits yet" }) }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, { children: allExecutions.map((execution) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
764
|
+
DepositExecutionItem,
|
|
765
|
+
{
|
|
766
|
+
execution,
|
|
767
|
+
onClick: () => handleExecutionClick(execution)
|
|
768
|
+
},
|
|
769
|
+
execution.id
|
|
770
|
+
)) }) }) })
|
|
771
|
+
] }) }) });
|
|
956
772
|
}
|
|
957
773
|
|
|
958
774
|
// src/components/deposits/DepositSuccessToast.tsx
|
|
775
|
+
var import_react4 = require("react");
|
|
959
776
|
var import_lucide_react5 = require("lucide-react");
|
|
777
|
+
var import_core4 = require("@unifold/core");
|
|
960
778
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
961
779
|
function DepositSuccessToast({
|
|
962
780
|
depositTx,
|
|
@@ -964,9 +782,12 @@ function DepositSuccessToast({
|
|
|
964
782
|
status,
|
|
965
783
|
tokenIconUrl,
|
|
966
784
|
sourceAmountBaseUnit = "0",
|
|
967
|
-
onClose
|
|
785
|
+
onClose,
|
|
786
|
+
execution
|
|
968
787
|
}) {
|
|
969
|
-
const
|
|
788
|
+
const [detailModalOpen, setDetailModalOpen] = (0, import_react4.useState)(false);
|
|
789
|
+
const { themeClass } = useTheme();
|
|
790
|
+
const isPending = status === import_core4.ExecutionStatus.PENDING || status === import_core4.ExecutionStatus.WAITING || status === import_core4.ExecutionStatus.DELAYED;
|
|
970
791
|
const formatDateTime = (timestamp) => {
|
|
971
792
|
try {
|
|
972
793
|
const date = new Date(timestamp);
|
|
@@ -998,61 +819,124 @@ function DepositSuccessToast({
|
|
|
998
819
|
return "$0.00";
|
|
999
820
|
}
|
|
1000
821
|
};
|
|
1001
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.
|
|
1002
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
className: "uf-rounded-full"
|
|
1011
|
-
}
|
|
1012
|
-
),
|
|
1013
|
-
isPending ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("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__ */ (0, import_jsx_runtime8.jsx)(
|
|
822
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
823
|
+
isPending && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("style", { children: `
|
|
824
|
+
@keyframes border-travel {
|
|
825
|
+
from { stroke-dashoffset: 0; }
|
|
826
|
+
to { stroke-dashoffset: -1000; }
|
|
827
|
+
}
|
|
828
|
+
` }),
|
|
829
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "uf-w-full uf-animate-in uf-slide-in-from-bottom-2 uf-duration-300", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "uf-relative uf-rounded-xl", children: [
|
|
830
|
+
isPending && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1014
831
|
"svg",
|
|
1015
832
|
{
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
viewBox: "0 0 12 12",
|
|
1019
|
-
fill: "none",
|
|
1020
|
-
className: "uf-animate-spin",
|
|
833
|
+
className: "uf-absolute uf-inset-0 uf-w-full uf-h-full uf-pointer-events-none uf-z-[1]",
|
|
834
|
+
style: { overflow: "visible" },
|
|
1021
835
|
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1022
|
-
"
|
|
836
|
+
"rect",
|
|
1023
837
|
{
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
838
|
+
x: "5",
|
|
839
|
+
y: "2",
|
|
840
|
+
rx: "10",
|
|
841
|
+
ry: "10",
|
|
842
|
+
fill: "none",
|
|
843
|
+
stroke: "#ecc94b",
|
|
844
|
+
strokeWidth: "3",
|
|
845
|
+
strokeDasharray: "120 880",
|
|
846
|
+
strokeLinecap: "round",
|
|
847
|
+
pathLength: "1000",
|
|
848
|
+
style: {
|
|
849
|
+
width: "calc(100% - 10px)",
|
|
850
|
+
height: "calc(100% - 4px)",
|
|
851
|
+
animation: "border-travel 2.5s linear infinite"
|
|
852
|
+
}
|
|
1028
853
|
}
|
|
1029
854
|
)
|
|
1030
855
|
}
|
|
1031
|
-
)
|
|
1032
|
-
|
|
856
|
+
),
|
|
857
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
858
|
+
"div",
|
|
1033
859
|
{
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
860
|
+
onClick: () => execution && setDetailModalOpen(true),
|
|
861
|
+
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"}`,
|
|
862
|
+
children: [
|
|
863
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "uf-relative uf-flex-shrink-0", children: [
|
|
864
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
865
|
+
"img",
|
|
866
|
+
{
|
|
867
|
+
src: tokenIconUrl || (0, import_core4.getIconUrl)("/icons/tokens/svg/usdc.svg"),
|
|
868
|
+
alt: "Token",
|
|
869
|
+
width: 36,
|
|
870
|
+
height: 36,
|
|
871
|
+
className: "uf-rounded-full"
|
|
872
|
+
}
|
|
873
|
+
),
|
|
874
|
+
isPending ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("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__ */ (0, import_jsx_runtime8.jsx)(
|
|
875
|
+
"svg",
|
|
876
|
+
{
|
|
877
|
+
width: "10",
|
|
878
|
+
height: "10",
|
|
879
|
+
viewBox: "0 0 24 24",
|
|
880
|
+
fill: "none",
|
|
881
|
+
className: "uf-animate-spin",
|
|
882
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
883
|
+
"path",
|
|
884
|
+
{
|
|
885
|
+
d: "M21 12a9 9 0 1 1-6.22-8.56",
|
|
886
|
+
stroke: "white",
|
|
887
|
+
strokeWidth: "3",
|
|
888
|
+
strokeLinecap: "round"
|
|
889
|
+
}
|
|
890
|
+
)
|
|
891
|
+
}
|
|
892
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("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__ */ (0, import_jsx_runtime8.jsx)("svg", { width: "10", height: "10", viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
893
|
+
"path",
|
|
894
|
+
{
|
|
895
|
+
d: "M10 3L4.5 8.5L2 6",
|
|
896
|
+
stroke: "white",
|
|
897
|
+
strokeWidth: "2",
|
|
898
|
+
strokeLinecap: "round",
|
|
899
|
+
strokeLinejoin: "round"
|
|
900
|
+
}
|
|
901
|
+
) }) })
|
|
902
|
+
] }),
|
|
903
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "uf-flex-1 uf-min-w-0", children: [
|
|
904
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("h3", { className: "uf-text-black dark:uf-text-white uf-font-medium uf-text-sm", children: isPending ? "Deposit processing" : "Deposit completed" }),
|
|
905
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "uf-text-zinc-600 dark:uf-text-zinc-400 uf-text-xs", children: formatDateTime(orderSubmittedAt) })
|
|
906
|
+
] }),
|
|
907
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "uf-text-black dark:uf-text-white uf-font-medium uf-text-sm uf-flex-shrink-0", children: formatUsdAmount(sourceAmountBaseUnit) }),
|
|
908
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
909
|
+
"button",
|
|
910
|
+
{
|
|
911
|
+
onClick: (e) => {
|
|
912
|
+
e.stopPropagation();
|
|
913
|
+
onClose();
|
|
914
|
+
},
|
|
915
|
+
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",
|
|
916
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react5.X, { className: "uf-w-4 uf-h-4" })
|
|
917
|
+
}
|
|
918
|
+
)
|
|
919
|
+
]
|
|
1039
920
|
}
|
|
1040
|
-
)
|
|
1041
|
-
] }),
|
|
1042
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1043
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
921
|
+
)
|
|
922
|
+
] }) }),
|
|
923
|
+
execution && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Dialog, { open: detailModalOpen, onOpenChange: setDetailModalOpen, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(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: [
|
|
924
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "uf-flex uf-items-center uf-justify-between uf-px-4", children: [
|
|
925
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "uf-w-8" }),
|
|
926
|
+
" ",
|
|
927
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("h2", { className: "uf-text-lg uf-font-semibold uf-text-foreground", children: "Deposit Details" }),
|
|
928
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
929
|
+
"button",
|
|
930
|
+
{
|
|
931
|
+
onClick: () => setDetailModalOpen(false),
|
|
932
|
+
className: "uf-text-muted-foreground hover:uf-text-foreground uf-transition-colors uf-w-8 uf-flex uf-justify-end",
|
|
933
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react5.X, { className: "uf-w-5 uf-h-5" })
|
|
934
|
+
}
|
|
935
|
+
)
|
|
936
|
+
] }),
|
|
937
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DepositDetailContent, { execution })
|
|
938
|
+
] }) })
|
|
939
|
+
] });
|
|
1056
940
|
}
|
|
1057
941
|
|
|
1058
942
|
// src/components/shared/select.tsx
|
|
@@ -1172,61 +1056,16 @@ var SelectSeparator = React3.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
1172
1056
|
));
|
|
1173
1057
|
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
1174
1058
|
|
|
1175
|
-
// src/components/shared/button.tsx
|
|
1176
|
-
var React4 = __toESM(require("react"));
|
|
1177
|
-
var import_react_slot = require("@radix-ui/react-slot");
|
|
1178
|
-
var import_class_variance_authority = require("class-variance-authority");
|
|
1179
|
-
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1180
|
-
var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
1181
|
-
"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",
|
|
1182
|
-
{
|
|
1183
|
-
variants: {
|
|
1184
|
-
variant: {
|
|
1185
|
-
default: "uf-bg-primary uf-text-primary-foreground hover:uf-bg-primary/90",
|
|
1186
|
-
destructive: "uf-bg-destructive uf-text-destructive-foreground hover:uf-bg-destructive/90",
|
|
1187
|
-
outline: "uf-border uf-border-input uf-bg-background hover:uf-bg-accent hover:uf-text-accent-foreground",
|
|
1188
|
-
secondary: "uf-bg-secondary uf-text-secondary-foreground hover:uf-bg-secondary/80",
|
|
1189
|
-
ghost: "hover:uf-bg-accent hover:uf-text-accent-foreground",
|
|
1190
|
-
link: "uf-text-primary uf-underline-offset-4 hover:uf-underline"
|
|
1191
|
-
},
|
|
1192
|
-
size: {
|
|
1193
|
-
default: "uf-h-10 uf-px-4 uf-py-2",
|
|
1194
|
-
sm: "uf-h-9 uf-rounded-md uf-px-3",
|
|
1195
|
-
lg: "uf-h-11 uf-rounded-md uf-px-8",
|
|
1196
|
-
icon: "uf-h-10 uf-w-10"
|
|
1197
|
-
}
|
|
1198
|
-
},
|
|
1199
|
-
defaultVariants: {
|
|
1200
|
-
variant: "default",
|
|
1201
|
-
size: "default"
|
|
1202
|
-
}
|
|
1203
|
-
}
|
|
1204
|
-
);
|
|
1205
|
-
var Button = React4.forwardRef(
|
|
1206
|
-
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
1207
|
-
const Comp = asChild ? import_react_slot.Slot : "button";
|
|
1208
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1209
|
-
Comp,
|
|
1210
|
-
{
|
|
1211
|
-
className: cn(buttonVariants({ variant, size, className })),
|
|
1212
|
-
ref,
|
|
1213
|
-
...props
|
|
1214
|
-
}
|
|
1215
|
-
);
|
|
1216
|
-
}
|
|
1217
|
-
);
|
|
1218
|
-
Button.displayName = "Button";
|
|
1219
|
-
|
|
1220
1059
|
// src/components/shared/tooltip.tsx
|
|
1221
|
-
var
|
|
1060
|
+
var React4 = __toESM(require("react"));
|
|
1222
1061
|
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"));
|
|
1223
|
-
var
|
|
1062
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1224
1063
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
1225
1064
|
var Tooltip = TooltipPrimitive.Root;
|
|
1226
1065
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
1227
|
-
var TooltipContent =
|
|
1066
|
+
var TooltipContent = React4.forwardRef(({ className, sideOffset = 4, ...props }, ref) => {
|
|
1228
1067
|
const { themeClass } = useTheme();
|
|
1229
|
-
return /* @__PURE__ */ (0,
|
|
1068
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TooltipPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1230
1069
|
TooltipPrimitive.Content,
|
|
1231
1070
|
{
|
|
1232
1071
|
ref,
|
|
@@ -1242,6 +1081,9 @@ var TooltipContent = React5.forwardRef(({ className, sideOffset = 4, ...props },
|
|
|
1242
1081
|
});
|
|
1243
1082
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
1244
1083
|
|
|
1084
|
+
// src/components/deposits/TransferCryptoBase.tsx
|
|
1085
|
+
var import_core5 = require("@unifold/core");
|
|
1086
|
+
|
|
1245
1087
|
// src/lib/i18n/en.json
|
|
1246
1088
|
var en_default = {
|
|
1247
1089
|
transferCrypto: {
|
|
@@ -1312,7 +1154,7 @@ var en_default = {
|
|
|
1312
1154
|
var i18n = en_default;
|
|
1313
1155
|
|
|
1314
1156
|
// src/components/deposits/TransferCryptoBase.tsx
|
|
1315
|
-
var
|
|
1157
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1316
1158
|
var t = i18n.transferCrypto;
|
|
1317
1159
|
var getChainKey = (chainId, chainType) => {
|
|
1318
1160
|
return `${chainType}:${chainId}`;
|
|
@@ -1328,7 +1170,6 @@ function TransferCryptoBase({
|
|
|
1328
1170
|
destinationChainType,
|
|
1329
1171
|
destinationChainId,
|
|
1330
1172
|
destinationTokenAddress,
|
|
1331
|
-
copyButtonMode = "compact",
|
|
1332
1173
|
layoutVariant = "horizontal",
|
|
1333
1174
|
showDetailedDropdowns = false,
|
|
1334
1175
|
onExecutionsChange,
|
|
@@ -1338,20 +1179,20 @@ function TransferCryptoBase({
|
|
|
1338
1179
|
}) {
|
|
1339
1180
|
const { themeClass } = useTheme();
|
|
1340
1181
|
const isDarkMode = themeClass.includes("uf-dark");
|
|
1341
|
-
const [token, setToken] = (0,
|
|
1342
|
-
const [chain, setChain] = (0,
|
|
1343
|
-
const [copied, setCopied] = (0,
|
|
1344
|
-
const [internalWallets, setInternalWallets] = (0,
|
|
1345
|
-
const [loading, setLoading] = (0,
|
|
1182
|
+
const [token, setToken] = (0, import_react5.useState)("USDC");
|
|
1183
|
+
const [chain, setChain] = (0, import_react5.useState)("solana:mainnet");
|
|
1184
|
+
const [copied, setCopied] = (0, import_react5.useState)(false);
|
|
1185
|
+
const [internalWallets, setInternalWallets] = (0, import_react5.useState)([]);
|
|
1186
|
+
const [loading, setLoading] = (0, import_react5.useState)(!externalWallets?.length);
|
|
1346
1187
|
const wallets = externalWallets?.length ? externalWallets : internalWallets;
|
|
1347
|
-
const [error, setError] = (0,
|
|
1348
|
-
const [depositExecutions, setDepositExecutions] = (0,
|
|
1349
|
-
const [trackedExecutions, setTrackedExecutions] = (0,
|
|
1350
|
-
const [modalOpenedAt, setModalOpenedAt] = (0,
|
|
1351
|
-
const [supportedTokens, setSupportedTokens] = (0,
|
|
1352
|
-
const [tokensLoading, setTokensLoading] = (0,
|
|
1353
|
-
const [detailsExpanded, setDetailsExpanded] = (0,
|
|
1354
|
-
const [depositsModalOpen, setDepositsModalOpen] = (0,
|
|
1188
|
+
const [error, setError] = (0, import_react5.useState)(null);
|
|
1189
|
+
const [depositExecutions, setDepositExecutions] = (0, import_react5.useState)([]);
|
|
1190
|
+
const [trackedExecutions, setTrackedExecutions] = (0, import_react5.useState)(/* @__PURE__ */ new Map());
|
|
1191
|
+
const [modalOpenedAt, setModalOpenedAt] = (0, import_react5.useState)(null);
|
|
1192
|
+
const [supportedTokens, setSupportedTokens] = (0, import_react5.useState)([]);
|
|
1193
|
+
const [tokensLoading, setTokensLoading] = (0, import_react5.useState)(true);
|
|
1194
|
+
const [detailsExpanded, setDetailsExpanded] = (0, import_react5.useState)(false);
|
|
1195
|
+
const [depositsModalOpen, setDepositsModalOpen] = (0, import_react5.useState)(false);
|
|
1355
1196
|
const allChainsMap = /* @__PURE__ */ new Map();
|
|
1356
1197
|
supportedTokens.forEach((t4) => {
|
|
1357
1198
|
t4.chains.forEach((c) => {
|
|
@@ -1367,16 +1208,16 @@ function TransferCryptoBase({
|
|
|
1367
1208
|
(c) => c.chain_type === currentChainCombo.chainType && c.chain_id === currentChainCombo.chainId
|
|
1368
1209
|
);
|
|
1369
1210
|
const currentChainType = currentChainData?.chain_type || "ethereum";
|
|
1370
|
-
const currentWallet = getWalletByChainType(wallets, currentChainType);
|
|
1211
|
+
const currentWallet = (0, import_core5.getWalletByChainType)(wallets, currentChainType);
|
|
1371
1212
|
const depositAddress = currentWallet?.address || "";
|
|
1372
|
-
(0,
|
|
1213
|
+
(0, import_react5.useEffect)(() => {
|
|
1373
1214
|
setModalOpenedAt(/* @__PURE__ */ new Date());
|
|
1374
1215
|
}, []);
|
|
1375
|
-
(0,
|
|
1216
|
+
(0, import_react5.useEffect)(() => {
|
|
1376
1217
|
async function fetchSupportedTokens() {
|
|
1377
1218
|
try {
|
|
1378
1219
|
setTokensLoading(true);
|
|
1379
|
-
const response = await getSupportedDepositTokens(publishableKey);
|
|
1220
|
+
const response = await (0, import_core5.getSupportedDepositTokens)(publishableKey);
|
|
1380
1221
|
setSupportedTokens(response.data);
|
|
1381
1222
|
if (response.data.length > 0) {
|
|
1382
1223
|
const allChains = /* @__PURE__ */ new Set();
|
|
@@ -1401,12 +1242,12 @@ function TransferCryptoBase({
|
|
|
1401
1242
|
}
|
|
1402
1243
|
fetchSupportedTokens();
|
|
1403
1244
|
}, [publishableKey, chain]);
|
|
1404
|
-
(0,
|
|
1245
|
+
(0, import_react5.useEffect)(() => {
|
|
1405
1246
|
if (onExecutionsChange) {
|
|
1406
1247
|
onExecutionsChange(depositExecutions);
|
|
1407
1248
|
}
|
|
1408
1249
|
}, [depositExecutions, onExecutionsChange]);
|
|
1409
|
-
(0,
|
|
1250
|
+
(0, import_react5.useEffect)(() => {
|
|
1410
1251
|
if (externalWallets?.length) {
|
|
1411
1252
|
setLoading(false);
|
|
1412
1253
|
return;
|
|
@@ -1417,9 +1258,9 @@ function TransferCryptoBase({
|
|
|
1417
1258
|
if (isCancelled) return;
|
|
1418
1259
|
setLoading(true);
|
|
1419
1260
|
try {
|
|
1420
|
-
const response = await
|
|
1261
|
+
const response = await (0, import_core5.createDepositAddress)(
|
|
1421
1262
|
{
|
|
1422
|
-
|
|
1263
|
+
external_user_id: userId,
|
|
1423
1264
|
recipient_address: recipientAddress,
|
|
1424
1265
|
destination_chain_type: destinationChainType,
|
|
1425
1266
|
destination_chain_id: destinationChainId,
|
|
@@ -1457,7 +1298,7 @@ function TransferCryptoBase({
|
|
|
1457
1298
|
publishableKey,
|
|
1458
1299
|
externalWallets
|
|
1459
1300
|
]);
|
|
1460
|
-
(0,
|
|
1301
|
+
(0, import_react5.useEffect)(() => {
|
|
1461
1302
|
if (!supportedTokens.length) return;
|
|
1462
1303
|
const currentToken = supportedTokens.find((t4) => t4.symbol === token);
|
|
1463
1304
|
if (!currentToken || currentToken.chains.length === 0) return;
|
|
@@ -1471,11 +1312,11 @@ function TransferCryptoBase({
|
|
|
1471
1312
|
setChain(newChain);
|
|
1472
1313
|
}
|
|
1473
1314
|
}, [token, supportedTokens, chain]);
|
|
1474
|
-
(0,
|
|
1315
|
+
(0, import_react5.useEffect)(() => {
|
|
1475
1316
|
if (!userId || !modalOpenedAt) return;
|
|
1476
1317
|
const pollInterval = setInterval(async () => {
|
|
1477
1318
|
try {
|
|
1478
|
-
const response = await queryExecutions(userId, publishableKey);
|
|
1319
|
+
const response = await (0, import_core5.queryExecutions)(userId, publishableKey);
|
|
1479
1320
|
let executionToShow = null;
|
|
1480
1321
|
for (const execution of response.data) {
|
|
1481
1322
|
const executionTime = execution.created_at ? new Date(execution.created_at) : null;
|
|
@@ -1488,11 +1329,11 @@ function TransferCryptoBase({
|
|
|
1488
1329
|
break;
|
|
1489
1330
|
}
|
|
1490
1331
|
const inProgressStatuses = [
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1332
|
+
import_core5.ExecutionStatus.PENDING,
|
|
1333
|
+
import_core5.ExecutionStatus.WAITING,
|
|
1334
|
+
import_core5.ExecutionStatus.DELAYED
|
|
1494
1335
|
];
|
|
1495
|
-
if (inProgressStatuses.includes(trackedStatus) && execution.status ===
|
|
1336
|
+
if (inProgressStatuses.includes(trackedStatus) && execution.status === import_core5.ExecutionStatus.SUCCEEDED) {
|
|
1496
1337
|
executionToShow = execution;
|
|
1497
1338
|
break;
|
|
1498
1339
|
}
|
|
@@ -1515,7 +1356,7 @@ function TransferCryptoBase({
|
|
|
1515
1356
|
return updated;
|
|
1516
1357
|
});
|
|
1517
1358
|
if (onDepositSuccess) {
|
|
1518
|
-
const isCompleted = execution.status ===
|
|
1359
|
+
const isCompleted = execution.status === import_core5.ExecutionStatus.SUCCEEDED;
|
|
1519
1360
|
if (isCompleted) {
|
|
1520
1361
|
onDepositSuccess({
|
|
1521
1362
|
message: "Deposit completed successfully",
|
|
@@ -1578,8 +1419,8 @@ function TransferCryptoBase({
|
|
|
1578
1419
|
const processingTime = currentChainFromBackend?.estimated_processing_time ?? null;
|
|
1579
1420
|
const minDepositUsd = currentChainFromBackend?.minimum_deposit_amount_usd ?? 3;
|
|
1580
1421
|
const renderTokenItem = (tokenData) => {
|
|
1581
|
-
return /* @__PURE__ */ (0,
|
|
1582
|
-
/* @__PURE__ */ (0,
|
|
1422
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
1423
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1583
1424
|
"img",
|
|
1584
1425
|
{
|
|
1585
1426
|
src: tokenData.icon_url,
|
|
@@ -1589,13 +1430,13 @@ function TransferCryptoBase({
|
|
|
1589
1430
|
className: "uf-rounded-full uf-flex-shrink-0"
|
|
1590
1431
|
}
|
|
1591
1432
|
),
|
|
1592
|
-
/* @__PURE__ */ (0,
|
|
1593
|
-
showDetailedDropdowns && /* @__PURE__ */ (0,
|
|
1433
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "uf-text-xs uf-font-normal", children: tokenData.symbol }),
|
|
1434
|
+
showDetailedDropdowns && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "uf-text-xs uf-text-muted-foreground", children: tokenData.name })
|
|
1594
1435
|
] });
|
|
1595
1436
|
};
|
|
1596
1437
|
const renderChainItem = (chainData) => {
|
|
1597
|
-
return /* @__PURE__ */ (0,
|
|
1598
|
-
/* @__PURE__ */ (0,
|
|
1438
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
1439
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1599
1440
|
"img",
|
|
1600
1441
|
{
|
|
1601
1442
|
src: chainData.icon_url,
|
|
@@ -1605,24 +1446,24 @@ function TransferCryptoBase({
|
|
|
1605
1446
|
className: "uf-rounded-full uf-flex-shrink-0"
|
|
1606
1447
|
}
|
|
1607
1448
|
),
|
|
1608
|
-
/* @__PURE__ */ (0,
|
|
1609
|
-
showDetailedDropdowns && /* @__PURE__ */ (0,
|
|
1449
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "uf-text-xs uf-font-normal", children: chainData.chain_name }),
|
|
1450
|
+
showDetailedDropdowns && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "uf-text-xs uf-text-muted-foreground uf-capitalize", children: chainData.chain_type })
|
|
1610
1451
|
] });
|
|
1611
1452
|
};
|
|
1612
1453
|
const selectContainerClass = layoutVariant === "horizontal" ? "uf-grid uf-grid-cols-2 uf-gap-2.5" : "uf-space-y-3";
|
|
1613
|
-
return /* @__PURE__ */ (0,
|
|
1614
|
-
/* @__PURE__ */ (0,
|
|
1615
|
-
/* @__PURE__ */ (0,
|
|
1616
|
-
/* @__PURE__ */ (0,
|
|
1617
|
-
/* @__PURE__ */ (0,
|
|
1454
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TooltipProvider, { delayDuration: 0, skipDelayDuration: 0, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "uf-space-y-3", children: [
|
|
1455
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: selectContainerClass, children: [
|
|
1456
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { children: [
|
|
1457
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "uf-text-xs uf-text-muted-foreground uf-mb-2 uf-flex uf-items-center uf-gap-1", children: t.supportedToken }),
|
|
1458
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1618
1459
|
Select,
|
|
1619
1460
|
{
|
|
1620
1461
|
value: token,
|
|
1621
1462
|
onValueChange: setToken,
|
|
1622
1463
|
disabled: tokensLoading || supportedTokens.length === 0,
|
|
1623
1464
|
children: [
|
|
1624
|
-
/* @__PURE__ */ (0,
|
|
1625
|
-
/* @__PURE__ */ (0,
|
|
1465
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SelectTrigger, { className: "uf-bg-secondary uf-border-none uf-rounded-lg uf-h-10 hover:uf-bg-accent uf-text-foreground focus:uf-ring-1 focus:uf-ring-ring disabled:uf-opacity-50", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SelectValue, { children: tokensLoading ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "uf-text-xs uf-font-light uf-text-muted-foreground", children: t.loading }) }) : selectedToken ? renderTokenItem(selectedToken) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "uf-text-xs uf-font-normal", children: token }) }) }) }),
|
|
1466
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SelectContent, { className: "uf-bg-secondary uf-border uf-text-foreground uf-max-h-[300px]", children: supportedTokens.map((tokenData) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1626
1467
|
SelectItem,
|
|
1627
1468
|
{
|
|
1628
1469
|
value: tokenData.symbol,
|
|
@@ -1635,51 +1476,51 @@ function TransferCryptoBase({
|
|
|
1635
1476
|
}
|
|
1636
1477
|
)
|
|
1637
1478
|
] }),
|
|
1638
|
-
/* @__PURE__ */ (0,
|
|
1639
|
-
/* @__PURE__ */ (0,
|
|
1479
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { children: [
|
|
1480
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "uf-text-xs uf-text-muted-foreground uf-mb-2 uf-flex uf-items-center uf-gap-1", children: [
|
|
1640
1481
|
t.supportedChain,
|
|
1641
|
-
/* @__PURE__ */ (0,
|
|
1482
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "uf-text-[10px]", children: [
|
|
1642
1483
|
"$",
|
|
1643
1484
|
minDepositUsd,
|
|
1644
1485
|
" ",
|
|
1645
1486
|
t.minDeposit.label
|
|
1646
1487
|
] }),
|
|
1647
|
-
/* @__PURE__ */ (0,
|
|
1648
|
-
/* @__PURE__ */ (0,
|
|
1488
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Tooltip, { children: [
|
|
1489
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1649
1490
|
"span",
|
|
1650
1491
|
{
|
|
1651
1492
|
className: "uf-inline-flex uf-cursor-pointer uf-transition-colors hover:uf-text-foreground",
|
|
1652
1493
|
tabIndex: 0,
|
|
1653
1494
|
role: "button",
|
|
1654
1495
|
"aria-label": "Minimum deposit information",
|
|
1655
|
-
children: /* @__PURE__ */ (0,
|
|
1496
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react7.Info, { className: "uf-w-3 uf-h-3" })
|
|
1656
1497
|
}
|
|
1657
1498
|
) }),
|
|
1658
|
-
/* @__PURE__ */ (0,
|
|
1499
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1659
1500
|
TooltipContent,
|
|
1660
1501
|
{
|
|
1661
1502
|
side: "left",
|
|
1662
1503
|
align: "center",
|
|
1663
1504
|
className: "uf-max-w-[200px]",
|
|
1664
|
-
children: /* @__PURE__ */ (0,
|
|
1505
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { children: t.minDeposit.tooltip })
|
|
1665
1506
|
}
|
|
1666
1507
|
)
|
|
1667
1508
|
] })
|
|
1668
1509
|
] }),
|
|
1669
|
-
/* @__PURE__ */ (0,
|
|
1510
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1670
1511
|
Select,
|
|
1671
1512
|
{
|
|
1672
1513
|
value: chain,
|
|
1673
1514
|
onValueChange: setChain,
|
|
1674
1515
|
disabled: tokensLoading || availableChainsForToken.length === 0,
|
|
1675
1516
|
children: [
|
|
1676
|
-
/* @__PURE__ */ (0,
|
|
1677
|
-
/* @__PURE__ */ (0,
|
|
1517
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SelectTrigger, { className: "uf-bg-secondary uf-border-none uf-rounded-lg uf-h-10 hover:uf-bg-accent uf-text-foreground focus:uf-ring-1 focus:uf-ring-ring disabled:uf-opacity-50", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SelectValue, { children: tokensLoading ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "uf-text-xs uf-font-light uf-text-muted-foreground", children: t.loading }) }) : currentChainFromBackend ? renderChainItem(currentChainFromBackend) : currentChainData ? renderChainItem(currentChainData) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "uf-text-xs uf-font-normal", children: chain }) }) }) }),
|
|
1518
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SelectContent, { className: "uf-bg-secondary uf-border uf-text-foreground uf-max-h-[300px]", children: availableChainsForToken.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "uf-px-2 uf-py-3 uf-text-xs uf-text-muted-foreground uf-text-center", children: t.noChainsAvailable }) : availableChainsForToken.map((chainData) => {
|
|
1678
1519
|
const chainKey = getChainKey(
|
|
1679
1520
|
chainData.chain_id,
|
|
1680
1521
|
chainData.chain_type
|
|
1681
1522
|
);
|
|
1682
|
-
return /* @__PURE__ */ (0,
|
|
1523
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1683
1524
|
SelectItem,
|
|
1684
1525
|
{
|
|
1685
1526
|
value: chainKey,
|
|
@@ -1694,14 +1535,14 @@ function TransferCryptoBase({
|
|
|
1694
1535
|
)
|
|
1695
1536
|
] })
|
|
1696
1537
|
] }),
|
|
1697
|
-
/* @__PURE__ */ (0,
|
|
1538
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "uf-flex uf-justify-center uf-py-2", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "uf-bg-card uf-p-4 uf-rounded-2xl uf-shadow-lg uf-border uf-border-border", children: loading ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1698
1539
|
"div",
|
|
1699
1540
|
{
|
|
1700
1541
|
className: "uf-flex uf-items-center uf-justify-center",
|
|
1701
1542
|
style: { width: 180, height: 180 },
|
|
1702
|
-
children: /* @__PURE__ */ (0,
|
|
1543
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "uf-text-foreground uf-text-sm", children: t.loadingQRCode })
|
|
1703
1544
|
}
|
|
1704
|
-
) : depositAddress ? /* @__PURE__ */ (0,
|
|
1545
|
+
) : depositAddress ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1705
1546
|
StyledQRCode,
|
|
1706
1547
|
{
|
|
1707
1548
|
value: depositAddress,
|
|
@@ -1711,93 +1552,75 @@ function TransferCryptoBase({
|
|
|
1711
1552
|
darkMode: isDarkMode
|
|
1712
1553
|
},
|
|
1713
1554
|
`qr-${depositAddress}-${chain}`
|
|
1714
|
-
) : /* @__PURE__ */ (0,
|
|
1555
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1715
1556
|
"div",
|
|
1716
1557
|
{
|
|
1717
1558
|
className: "uf-flex uf-items-center uf-justify-center",
|
|
1718
1559
|
style: { width: 180, height: 180 },
|
|
1719
|
-
children: /* @__PURE__ */ (0,
|
|
1560
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "uf-text-red-400 uf-text-sm", children: t.noAddressAvailable })
|
|
1720
1561
|
}
|
|
1721
1562
|
) }) }),
|
|
1722
|
-
/* @__PURE__ */ (0,
|
|
1723
|
-
/* @__PURE__ */ (0,
|
|
1724
|
-
/* @__PURE__ */ (0,
|
|
1563
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { children: [
|
|
1564
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "uf-text-xs uf-text-muted-foreground uf-mb-2 uf-flex uf-items-center uf-justify-between", children: [
|
|
1565
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-1", children: [
|
|
1725
1566
|
t.depositAddress.label,
|
|
1726
|
-
/* @__PURE__ */ (0,
|
|
1727
|
-
/* @__PURE__ */ (0,
|
|
1567
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Tooltip, { children: [
|
|
1568
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1728
1569
|
"span",
|
|
1729
1570
|
{
|
|
1730
1571
|
className: "uf-inline-flex uf-cursor-pointer uf-transition-colors hover:uf-text-foreground",
|
|
1731
1572
|
tabIndex: 0,
|
|
1732
1573
|
role: "button",
|
|
1733
1574
|
"aria-label": "Deposit address information",
|
|
1734
|
-
children: /* @__PURE__ */ (0,
|
|
1575
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react7.Info, { className: "uf-w-3 uf-h-3" })
|
|
1735
1576
|
}
|
|
1736
1577
|
) }),
|
|
1737
|
-
/* @__PURE__ */ (0,
|
|
1578
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1738
1579
|
TooltipContent,
|
|
1739
1580
|
{
|
|
1740
1581
|
side: "top",
|
|
1741
1582
|
align: "center",
|
|
1742
1583
|
className: "uf-max-w-[240px]",
|
|
1743
|
-
children: /* @__PURE__ */ (0,
|
|
1584
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { children: t.depositAddress.tooltip.replace("{{token}}", token) })
|
|
1744
1585
|
}
|
|
1745
1586
|
)
|
|
1746
1587
|
] })
|
|
1747
1588
|
] }),
|
|
1748
|
-
|
|
1749
|
-
"
|
|
1750
|
-
{
|
|
1751
|
-
onClick: handleCopyAddress,
|
|
1752
|
-
disabled: loading || !depositAddress,
|
|
1753
|
-
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",
|
|
1754
|
-
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
1755
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react7.Check, { className: "uf-w-3 uf-h-3" }),
|
|
1756
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: t.copied })
|
|
1757
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
1758
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react7.Copy, { className: "uf-w-3 uf-h-3" }),
|
|
1759
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: t.copyAddress })
|
|
1760
|
-
] })
|
|
1761
|
-
}
|
|
1762
|
-
)
|
|
1763
|
-
] }),
|
|
1764
|
-
loading ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("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__ */ (0, import_jsx_runtime12.jsx)("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__ */ (0, import_jsx_runtime12.jsx)("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 })
|
|
1765
|
-
] }),
|
|
1766
|
-
copyButtonMode === "fullWidth" && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1767
|
-
Button,
|
|
1768
|
-
{
|
|
1769
|
-
onClick: handleCopyAddress,
|
|
1770
|
-
disabled: loading || !depositAddress,
|
|
1771
|
-
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",
|
|
1772
|
-
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
1773
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react7.Check, { className: "uf-w-4 uf-h-4 uf-mr-2" }),
|
|
1589
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("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: [
|
|
1590
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react7.Check, { className: "uf-w-3 uf-h-3" }),
|
|
1774
1591
|
t.copied
|
|
1775
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
1776
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react7.Copy, { className: "uf-w-4 uf-h-4 uf-mr-2" }),
|
|
1777
|
-
t.copyAddress
|
|
1778
1592
|
] })
|
|
1779
|
-
}
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1593
|
+
] }),
|
|
1594
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("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__ */ (0, import_jsx_runtime11.jsx)("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__ */ (0, import_jsx_runtime11.jsx)(
|
|
1595
|
+
"button",
|
|
1596
|
+
{
|
|
1597
|
+
onClick: handleCopyAddress,
|
|
1598
|
+
disabled: !depositAddress,
|
|
1599
|
+
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",
|
|
1600
|
+
children: depositAddress || t.noAddressAvailable
|
|
1601
|
+
}
|
|
1602
|
+
)
|
|
1603
|
+
] }),
|
|
1604
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "uf-bg-secondary uf-rounded-xl uf-px-3", children: [
|
|
1605
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1783
1606
|
"button",
|
|
1784
1607
|
{
|
|
1785
1608
|
onClick: () => setDetailsExpanded(!detailsExpanded),
|
|
1786
1609
|
className: "uf-w-full uf-flex uf-items-center uf-justify-between uf-py-2.5",
|
|
1787
1610
|
children: [
|
|
1788
|
-
/* @__PURE__ */ (0,
|
|
1789
|
-
/* @__PURE__ */ (0,
|
|
1790
|
-
/* @__PURE__ */ (0,
|
|
1611
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
1612
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "uf-bg-card uf-rounded-full uf-p-1", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react7.DollarSign, { className: "uf-w-3 uf-h-3" }) }),
|
|
1613
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "uf-text-xs", children: [
|
|
1791
1614
|
t.priceImpact.label,
|
|
1792
1615
|
":",
|
|
1793
1616
|
" ",
|
|
1794
|
-
/* @__PURE__ */ (0,
|
|
1617
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "uf-text-foreground", children: [
|
|
1795
1618
|
priceImpact.toFixed(2),
|
|
1796
1619
|
"%"
|
|
1797
1620
|
] })
|
|
1798
1621
|
] }),
|
|
1799
|
-
/* @__PURE__ */ (0,
|
|
1800
|
-
/* @__PURE__ */ (0,
|
|
1622
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Tooltip, { children: [
|
|
1623
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1801
1624
|
"span",
|
|
1802
1625
|
{
|
|
1803
1626
|
className: "uf-inline-flex uf-cursor-pointer uf-text-muted-foreground uf-transition-colors hover:uf-text-foreground",
|
|
@@ -1810,75 +1633,75 @@ function TransferCryptoBase({
|
|
|
1810
1633
|
tabIndex: 0,
|
|
1811
1634
|
role: "button",
|
|
1812
1635
|
"aria-label": "Price impact information",
|
|
1813
|
-
children: /* @__PURE__ */ (0,
|
|
1636
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react7.Info, { className: "uf-w-3 uf-h-3" })
|
|
1814
1637
|
}
|
|
1815
1638
|
) }),
|
|
1816
|
-
/* @__PURE__ */ (0,
|
|
1639
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1817
1640
|
TooltipContent,
|
|
1818
1641
|
{
|
|
1819
1642
|
side: "top",
|
|
1820
1643
|
align: "center",
|
|
1821
1644
|
className: "uf-max-w-[240px]",
|
|
1822
|
-
children: /* @__PURE__ */ (0,
|
|
1645
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { children: t.priceImpact.tooltip })
|
|
1823
1646
|
}
|
|
1824
1647
|
)
|
|
1825
1648
|
] })
|
|
1826
1649
|
] }),
|
|
1827
|
-
detailsExpanded ? /* @__PURE__ */ (0,
|
|
1650
|
+
detailsExpanded ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react7.ChevronUp, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground" }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react7.ChevronDown, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground" })
|
|
1828
1651
|
]
|
|
1829
1652
|
}
|
|
1830
1653
|
),
|
|
1831
|
-
detailsExpanded && /* @__PURE__ */ (0,
|
|
1832
|
-
/* @__PURE__ */ (0,
|
|
1833
|
-
/* @__PURE__ */ (0,
|
|
1834
|
-
/* @__PURE__ */ (0,
|
|
1654
|
+
detailsExpanded && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "uf-pb-3 uf-space-y-2.5", children: [
|
|
1655
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
1656
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "uf-bg-card uf-rounded-full uf-p-1", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react7.ShieldCheck, { className: "uf-w-3 uf-h-3" }) }),
|
|
1657
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "uf-text-xs", children: [
|
|
1835
1658
|
t.slippage.label,
|
|
1836
1659
|
":",
|
|
1837
1660
|
" ",
|
|
1838
|
-
/* @__PURE__ */ (0,
|
|
1661
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "uf-text-foreground", children: [
|
|
1839
1662
|
t.slippage.auto,
|
|
1840
1663
|
" \u2022 ",
|
|
1841
1664
|
maxSlippage.toFixed(2),
|
|
1842
1665
|
"%"
|
|
1843
1666
|
] })
|
|
1844
1667
|
] }),
|
|
1845
|
-
/* @__PURE__ */ (0,
|
|
1846
|
-
/* @__PURE__ */ (0,
|
|
1668
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Tooltip, { children: [
|
|
1669
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1847
1670
|
"span",
|
|
1848
1671
|
{
|
|
1849
1672
|
className: "uf-inline-flex uf-cursor-pointer uf-text-muted-foreground uf-transition-colors hover:uf-text-foreground",
|
|
1850
1673
|
tabIndex: 0,
|
|
1851
1674
|
role: "button",
|
|
1852
1675
|
"aria-label": "Slippage information",
|
|
1853
|
-
children: /* @__PURE__ */ (0,
|
|
1676
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react7.Info, { className: "uf-w-3 uf-h-3" })
|
|
1854
1677
|
}
|
|
1855
1678
|
) }),
|
|
1856
|
-
/* @__PURE__ */ (0,
|
|
1679
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1857
1680
|
TooltipContent,
|
|
1858
1681
|
{
|
|
1859
1682
|
side: "top",
|
|
1860
1683
|
align: "center",
|
|
1861
1684
|
className: "uf-max-w-[240px]",
|
|
1862
|
-
children: /* @__PURE__ */ (0,
|
|
1685
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { children: t.slippage.tooltip })
|
|
1863
1686
|
}
|
|
1864
1687
|
)
|
|
1865
1688
|
] })
|
|
1866
1689
|
] }),
|
|
1867
|
-
/* @__PURE__ */ (0,
|
|
1868
|
-
/* @__PURE__ */ (0,
|
|
1869
|
-
/* @__PURE__ */ (0,
|
|
1690
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
1691
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "uf-bg-card uf-rounded-full uf-p-1", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react7.Clock, { className: "uf-w-3 uf-h-3" }) }),
|
|
1692
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "uf-text-xs", children: [
|
|
1870
1693
|
t.processingTime.label,
|
|
1871
1694
|
":",
|
|
1872
1695
|
" ",
|
|
1873
|
-
/* @__PURE__ */ (0,
|
|
1696
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "uf-text-foreground", children: formatProcessingTime(processingTime) })
|
|
1874
1697
|
] })
|
|
1875
1698
|
] }),
|
|
1876
|
-
/* @__PURE__ */ (0,
|
|
1877
|
-
/* @__PURE__ */ (0,
|
|
1878
|
-
/* @__PURE__ */ (0,
|
|
1699
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
1700
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "uf-bg-card uf-rounded-full uf-p-1", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react7.FileText, { className: "uf-w-3 uf-h-3" }) }),
|
|
1701
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "uf-text-xs", children: [
|
|
1879
1702
|
t.help.needHelp,
|
|
1880
1703
|
" ",
|
|
1881
|
-
/* @__PURE__ */ (0,
|
|
1704
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1882
1705
|
"a",
|
|
1883
1706
|
{
|
|
1884
1707
|
href: "#",
|
|
@@ -1888,34 +1711,34 @@ function TransferCryptoBase({
|
|
|
1888
1711
|
)
|
|
1889
1712
|
] })
|
|
1890
1713
|
] })
|
|
1891
|
-
] }),
|
|
1892
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "uf-flex uf-items-center uf-justify-between uf-text-xs uf-pt-2", children: [
|
|
1893
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1894
|
-
"a",
|
|
1895
|
-
{
|
|
1896
|
-
href: "https://unifold.io/terms",
|
|
1897
|
-
className: "uf-text-muted-foreground uf-underline hover:uf-text-foreground uf-transition-colors",
|
|
1898
|
-
target: "_blank",
|
|
1899
|
-
children: t.terms.termsApply
|
|
1900
|
-
}
|
|
1901
|
-
),
|
|
1902
|
-
depositExecutions.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1903
|
-
"button",
|
|
1904
|
-
{
|
|
1905
|
-
onClick: () => setDepositsModalOpen(true),
|
|
1906
|
-
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",
|
|
1907
|
-
children: [
|
|
1908
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react7.Clock, { className: "uf-w-3.5 uf-h-3.5" }),
|
|
1909
|
-
"Track deposits (",
|
|
1910
|
-
depositExecutions.length,
|
|
1911
|
-
")",
|
|
1912
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react7.ChevronRight, { className: "uf-w-3 uf-h-3" })
|
|
1913
|
-
]
|
|
1914
|
-
}
|
|
1915
|
-
)
|
|
1916
1714
|
] })
|
|
1917
1715
|
] }),
|
|
1918
|
-
|
|
1716
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "uf-flex uf-items-center uf-justify-between uf-text-xs uf-pt-2", children: [
|
|
1717
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1718
|
+
"a",
|
|
1719
|
+
{
|
|
1720
|
+
href: "https://unifold.io/terms",
|
|
1721
|
+
className: "uf-text-muted-foreground uf-underline hover:uf-text-foreground uf-transition-colors",
|
|
1722
|
+
target: "_blank",
|
|
1723
|
+
children: t.terms.termsApply
|
|
1724
|
+
}
|
|
1725
|
+
),
|
|
1726
|
+
depositExecutions.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1727
|
+
"button",
|
|
1728
|
+
{
|
|
1729
|
+
onClick: () => setDepositsModalOpen(true),
|
|
1730
|
+
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",
|
|
1731
|
+
children: [
|
|
1732
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react7.Clock, { className: "uf-w-3.5 uf-h-3.5" }),
|
|
1733
|
+
"Track deposits (",
|
|
1734
|
+
depositExecutions.length,
|
|
1735
|
+
")",
|
|
1736
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react7.ChevronRight, { className: "uf-w-3 uf-h-3" })
|
|
1737
|
+
]
|
|
1738
|
+
}
|
|
1739
|
+
)
|
|
1740
|
+
] }),
|
|
1741
|
+
depositExecutions.length === 1 && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("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__ */ (0, import_jsx_runtime11.jsx)(
|
|
1919
1742
|
DepositSuccessToast,
|
|
1920
1743
|
{
|
|
1921
1744
|
depositTx: depositExecutions[0].transaction_hash,
|
|
@@ -1923,13 +1746,14 @@ function TransferCryptoBase({
|
|
|
1923
1746
|
orderFilledAt: depositExecutions[0].updated_at || (/* @__PURE__ */ new Date()).toISOString(),
|
|
1924
1747
|
explorerUrl: depositExecutions[0].explorer_url,
|
|
1925
1748
|
status: depositExecutions[0].status,
|
|
1926
|
-
tokenIconUrl: depositExecutions[0].
|
|
1749
|
+
tokenIconUrl: depositExecutions[0].destination_token_metadata?.icon_url,
|
|
1927
1750
|
sourceAmountBaseUnit: depositExecutions[0].source_amount_base_unit,
|
|
1928
|
-
onClose: () => setDepositExecutions([])
|
|
1751
|
+
onClose: () => setDepositExecutions([]),
|
|
1752
|
+
execution: depositExecutions[0]
|
|
1929
1753
|
},
|
|
1930
1754
|
depositExecutions[0].id
|
|
1931
1755
|
) }),
|
|
1932
|
-
/* @__PURE__ */ (0,
|
|
1756
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1933
1757
|
DepositsModal,
|
|
1934
1758
|
{
|
|
1935
1759
|
open: depositsModalOpen,
|
|
@@ -1944,9 +1768,9 @@ function TransferCryptoBase({
|
|
|
1944
1768
|
}
|
|
1945
1769
|
|
|
1946
1770
|
// src/components/deposits/TransferCrypto.tsx
|
|
1947
|
-
var
|
|
1771
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1948
1772
|
function TransferCrypto(props) {
|
|
1949
|
-
return /* @__PURE__ */ (0,
|
|
1773
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1950
1774
|
TransferCryptoBase,
|
|
1951
1775
|
{
|
|
1952
1776
|
...props,
|
|
@@ -1957,30 +1781,32 @@ function TransferCrypto(props) {
|
|
|
1957
1781
|
}
|
|
1958
1782
|
|
|
1959
1783
|
// src/components/deposits/BuyWithCard.tsx
|
|
1960
|
-
var
|
|
1784
|
+
var import_react7 = require("react");
|
|
1961
1785
|
var import_lucide_react10 = require("lucide-react");
|
|
1786
|
+
var import_core7 = require("@unifold/core");
|
|
1962
1787
|
|
|
1963
1788
|
// src/components/deposits/CurrencyModal.tsx
|
|
1964
|
-
var
|
|
1789
|
+
var import_react6 = require("react");
|
|
1965
1790
|
var import_lucide_react9 = require("lucide-react");
|
|
1966
1791
|
|
|
1967
1792
|
// src/components/currency/CurrencyListItem.tsx
|
|
1968
1793
|
var import_lucide_react8 = require("lucide-react");
|
|
1969
|
-
var
|
|
1794
|
+
var import_core6 = require("@unifold/core");
|
|
1795
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1970
1796
|
function CurrencyListItem({
|
|
1971
1797
|
currency,
|
|
1972
1798
|
isSelected,
|
|
1973
1799
|
onSelect
|
|
1974
1800
|
}) {
|
|
1975
|
-
const iconUrl = getPreferredIconUrl(currency.icon_urls, "png") || currency.icon_url;
|
|
1976
|
-
return /* @__PURE__ */ (0,
|
|
1801
|
+
const iconUrl = (0, import_core6.getPreferredIconUrl)(currency.icon_urls, "png") || currency.icon_url;
|
|
1802
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1977
1803
|
"button",
|
|
1978
1804
|
{
|
|
1979
1805
|
onClick: () => onSelect(currency.currency_code),
|
|
1980
1806
|
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",
|
|
1981
1807
|
children: [
|
|
1982
|
-
/* @__PURE__ */ (0,
|
|
1983
|
-
/* @__PURE__ */ (0,
|
|
1808
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
1809
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1984
1810
|
"img",
|
|
1985
1811
|
{
|
|
1986
1812
|
src: iconUrl,
|
|
@@ -1988,19 +1814,19 @@ function CurrencyListItem({
|
|
|
1988
1814
|
className: "uf-w-10 uf-h-10 uf-flex-shrink-0"
|
|
1989
1815
|
}
|
|
1990
1816
|
),
|
|
1991
|
-
/* @__PURE__ */ (0,
|
|
1992
|
-
/* @__PURE__ */ (0,
|
|
1993
|
-
/* @__PURE__ */ (0,
|
|
1817
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "uf-text-left", children: [
|
|
1818
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "uf-text-sm uf-font-normal uf-text-foreground", children: currency.name }),
|
|
1819
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "uf-text-xs uf-text-muted-foreground uf-font-light", children: currency.currency_code.toUpperCase() })
|
|
1994
1820
|
] })
|
|
1995
1821
|
] }),
|
|
1996
|
-
isSelected && /* @__PURE__ */ (0,
|
|
1822
|
+
isSelected && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react8.Check, { className: "uf-w-4 uf-h-4 uf-text-foreground" })
|
|
1997
1823
|
]
|
|
1998
1824
|
}
|
|
1999
1825
|
);
|
|
2000
1826
|
}
|
|
2001
1827
|
|
|
2002
1828
|
// src/components/currency/CurrencyListSection.tsx
|
|
2003
|
-
var
|
|
1829
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
2004
1830
|
function CurrencyListSection({
|
|
2005
1831
|
title,
|
|
2006
1832
|
currencies,
|
|
@@ -2008,9 +1834,9 @@ function CurrencyListSection({
|
|
|
2008
1834
|
onSelect
|
|
2009
1835
|
}) {
|
|
2010
1836
|
if (currencies.length === 0) return null;
|
|
2011
|
-
return /* @__PURE__ */ (0,
|
|
2012
|
-
/* @__PURE__ */ (0,
|
|
2013
|
-
currencies.map((currency) => /* @__PURE__ */ (0,
|
|
1837
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
1838
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "uf-px-1 uf-pb-2", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h3", { className: "uf-text-xs uf-font-light uf-text-muted-foreground", children: title }) }),
|
|
1839
|
+
currencies.map((currency) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2014
1840
|
CurrencyListItem,
|
|
2015
1841
|
{
|
|
2016
1842
|
currency,
|
|
@@ -2023,7 +1849,7 @@ function CurrencyListSection({
|
|
|
2023
1849
|
}
|
|
2024
1850
|
|
|
2025
1851
|
// src/components/deposits/CurrencyModal.tsx
|
|
2026
|
-
var
|
|
1852
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
2027
1853
|
function CurrencyModal({
|
|
2028
1854
|
open,
|
|
2029
1855
|
onOpenChange,
|
|
@@ -2033,7 +1859,7 @@ function CurrencyModal({
|
|
|
2033
1859
|
onSelectCurrency,
|
|
2034
1860
|
themeClass = ""
|
|
2035
1861
|
}) {
|
|
2036
|
-
const [searchQuery, setSearchQuery] = (0,
|
|
1862
|
+
const [searchQuery, setSearchQuery] = (0, import_react6.useState)("");
|
|
2037
1863
|
const preferredCurrencies = preferredCurrencyCodes.map(
|
|
2038
1864
|
(code) => currencies.find(
|
|
2039
1865
|
(currency) => currency.currency_code.toLowerCase() === code.toLowerCase()
|
|
@@ -2060,8 +1886,8 @@ function CurrencyModal({
|
|
|
2060
1886
|
onOpenChange(false);
|
|
2061
1887
|
setSearchQuery("");
|
|
2062
1888
|
};
|
|
2063
|
-
return /* @__PURE__ */ (0,
|
|
2064
|
-
/* @__PURE__ */ (0,
|
|
1889
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Dialog, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(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: [
|
|
1890
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2065
1891
|
DepositHeader,
|
|
2066
1892
|
{
|
|
2067
1893
|
title: "Currency",
|
|
@@ -2070,9 +1896,9 @@ function CurrencyModal({
|
|
|
2070
1896
|
onClose: handleClose
|
|
2071
1897
|
}
|
|
2072
1898
|
),
|
|
2073
|
-
/* @__PURE__ */ (0,
|
|
2074
|
-
/* @__PURE__ */ (0,
|
|
2075
|
-
/* @__PURE__ */ (0,
|
|
1899
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "uf-relative", children: [
|
|
1900
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react9.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" }),
|
|
1901
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2076
1902
|
"input",
|
|
2077
1903
|
{
|
|
2078
1904
|
type: "text",
|
|
@@ -2083,8 +1909,8 @@ function CurrencyModal({
|
|
|
2083
1909
|
}
|
|
2084
1910
|
)
|
|
2085
1911
|
] }) }),
|
|
2086
|
-
/* @__PURE__ */ (0,
|
|
2087
|
-
/* @__PURE__ */ (0,
|
|
1912
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "uf-max-h-[500px] uf-overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:uf-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "uf-space-y-2", children: [
|
|
1913
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2088
1914
|
CurrencyListSection,
|
|
2089
1915
|
{
|
|
2090
1916
|
title: "Popular currencies",
|
|
@@ -2093,8 +1919,8 @@ function CurrencyModal({
|
|
|
2093
1919
|
onSelect: handleSelect
|
|
2094
1920
|
}
|
|
2095
1921
|
),
|
|
2096
|
-
filteredPreferred.length > 0 && filteredOther.length > 0 && /* @__PURE__ */ (0,
|
|
2097
|
-
/* @__PURE__ */ (0,
|
|
1922
|
+
filteredPreferred.length > 0 && filteredOther.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "uf-h-2" }),
|
|
1923
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2098
1924
|
CurrencyListSection,
|
|
2099
1925
|
{
|
|
2100
1926
|
title: "All currencies",
|
|
@@ -2103,7 +1929,7 @@ function CurrencyModal({
|
|
|
2103
1929
|
onSelect: handleSelect
|
|
2104
1930
|
}
|
|
2105
1931
|
),
|
|
2106
|
-
filteredPreferred.length === 0 && filteredOther.length === 0 && /* @__PURE__ */ (0,
|
|
1932
|
+
filteredPreferred.length === 0 && filteredOther.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "uf-text-center uf-py-8 uf-text-muted-foreground uf-text-sm", children: "No currencies found" })
|
|
2107
1933
|
] }) })
|
|
2108
1934
|
] }) });
|
|
2109
1935
|
}
|
|
@@ -2157,7 +1983,7 @@ function useUserIp() {
|
|
|
2157
1983
|
}
|
|
2158
1984
|
|
|
2159
1985
|
// src/components/deposits/BuyWithCard.tsx
|
|
2160
|
-
var
|
|
1986
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
2161
1987
|
var t2 = i18n.buyWithCard;
|
|
2162
1988
|
var QUICK_AMOUNTS = [100, 500, 1e3];
|
|
2163
1989
|
function getCurrencySymbol(currencyCode) {
|
|
@@ -2188,21 +2014,21 @@ function BuyWithCard({
|
|
|
2188
2014
|
wallets: externalWallets,
|
|
2189
2015
|
assetCdnUrl
|
|
2190
2016
|
}) {
|
|
2191
|
-
const [amount, setAmount] = (0,
|
|
2192
|
-
const [currency, setCurrency] = (0,
|
|
2193
|
-
const [showCurrencyModal, setShowCurrencyModal] = (0,
|
|
2194
|
-
const [quotes, setQuotes] = (0,
|
|
2195
|
-
const [quotesLoading, setQuotesLoading] = (0,
|
|
2196
|
-
const [quotesError, setQuotesError] = (0,
|
|
2197
|
-
const [internalView, setInternalView] = (0,
|
|
2017
|
+
const [amount, setAmount] = (0, import_react7.useState)("500.00");
|
|
2018
|
+
const [currency, setCurrency] = (0, import_react7.useState)("usd");
|
|
2019
|
+
const [showCurrencyModal, setShowCurrencyModal] = (0, import_react7.useState)(false);
|
|
2020
|
+
const [quotes, setQuotes] = (0, import_react7.useState)([]);
|
|
2021
|
+
const [quotesLoading, setQuotesLoading] = (0, import_react7.useState)(false);
|
|
2022
|
+
const [quotesError, setQuotesError] = (0, import_react7.useState)(null);
|
|
2023
|
+
const [internalView, setInternalView] = (0, import_react7.useState)("amount");
|
|
2198
2024
|
const { userIpInfo, isLoading: isLoadingIp } = useUserIp();
|
|
2199
|
-
const [onrampSession, setOnrampSession] = (0,
|
|
2025
|
+
const [onrampSession, setOnrampSession] = (0, import_react7.useState)(
|
|
2200
2026
|
null
|
|
2201
2027
|
);
|
|
2202
2028
|
const currentView = externalView ?? internalView;
|
|
2203
2029
|
const showQuotesView = currentView === "quotes";
|
|
2204
2030
|
const showOnrampView = currentView === "onramp";
|
|
2205
|
-
(0,
|
|
2031
|
+
(0, import_react7.useEffect)(() => {
|
|
2206
2032
|
if (externalView) {
|
|
2207
2033
|
setInternalView(externalView);
|
|
2208
2034
|
}
|
|
@@ -2215,21 +2041,21 @@ function BuyWithCard({
|
|
|
2215
2041
|
onViewChange?.(newView);
|
|
2216
2042
|
}
|
|
2217
2043
|
};
|
|
2218
|
-
const [selectedProvider, setSelectedProvider] = (0,
|
|
2044
|
+
const [selectedProvider, setSelectedProvider] = (0, import_react7.useState)(
|
|
2219
2045
|
null
|
|
2220
2046
|
);
|
|
2221
|
-
const [isAutoSelected, setIsAutoSelected] = (0,
|
|
2222
|
-
const [autoSelectedProvider, setAutoSelectedProvider] = (0,
|
|
2223
|
-
const [hasManualSelection, setHasManualSelection] = (0,
|
|
2224
|
-
const [internalWallets, setInternalWallets] = (0,
|
|
2225
|
-
const [walletsLoading, setWalletsLoading] = (0,
|
|
2047
|
+
const [isAutoSelected, setIsAutoSelected] = (0, import_react7.useState)(true);
|
|
2048
|
+
const [autoSelectedProvider, setAutoSelectedProvider] = (0, import_react7.useState)(null);
|
|
2049
|
+
const [hasManualSelection, setHasManualSelection] = (0, import_react7.useState)(false);
|
|
2050
|
+
const [internalWallets, setInternalWallets] = (0, import_react7.useState)([]);
|
|
2051
|
+
const [walletsLoading, setWalletsLoading] = (0, import_react7.useState)(!externalWallets?.length);
|
|
2226
2052
|
const wallets = externalWallets?.length ? externalWallets : internalWallets;
|
|
2227
|
-
const [countdown, setCountdown] = (0,
|
|
2228
|
-
const [fiatCurrencies, setFiatCurrencies] = (0,
|
|
2229
|
-
const [preferredCurrencyCodes, setPreferredCurrencyCodes] = (0,
|
|
2230
|
-
const [currenciesLoading, setCurrenciesLoading] = (0,
|
|
2231
|
-
const [supportedTokens, setSupportedTokens] = (0,
|
|
2232
|
-
const destinationWallet = getWalletByChainType(wallets, "ethereum");
|
|
2053
|
+
const [countdown, setCountdown] = (0, import_react7.useState)(60);
|
|
2054
|
+
const [fiatCurrencies, setFiatCurrencies] = (0, import_react7.useState)([]);
|
|
2055
|
+
const [preferredCurrencyCodes, setPreferredCurrencyCodes] = (0, import_react7.useState)([]);
|
|
2056
|
+
const [currenciesLoading, setCurrenciesLoading] = (0, import_react7.useState)(true);
|
|
2057
|
+
const [supportedTokens, setSupportedTokens] = (0, import_react7.useState)([]);
|
|
2058
|
+
const destinationWallet = (0, import_core7.getWalletByChainType)(wallets, "ethereum");
|
|
2233
2059
|
const walletDestinationChainId = destinationWallet?.destination_chain_id;
|
|
2234
2060
|
const resolvedDestinationChainId = destinationChainId || walletDestinationChainId;
|
|
2235
2061
|
const displayTokenSymbol = destinationTokenSymbol || supportedTokens[0]?.symbol || "USDC";
|
|
@@ -2237,10 +2063,10 @@ function BuyWithCard({
|
|
|
2237
2063
|
const destinationChain = destinationToken?.chains.find(
|
|
2238
2064
|
(c) => c.chain_id === resolvedDestinationChainId
|
|
2239
2065
|
);
|
|
2240
|
-
(0,
|
|
2066
|
+
(0, import_react7.useEffect)(() => {
|
|
2241
2067
|
async function fetchFiatCurrencies() {
|
|
2242
2068
|
try {
|
|
2243
|
-
const response = await getFiatCurrencies(publishableKey);
|
|
2069
|
+
const response = await (0, import_core7.getFiatCurrencies)(publishableKey);
|
|
2244
2070
|
setFiatCurrencies(response.data);
|
|
2245
2071
|
setPreferredCurrencyCodes(response.preferred || []);
|
|
2246
2072
|
} catch (err) {
|
|
@@ -2251,7 +2077,7 @@ function BuyWithCard({
|
|
|
2251
2077
|
}
|
|
2252
2078
|
fetchFiatCurrencies();
|
|
2253
2079
|
}, [publishableKey]);
|
|
2254
|
-
(0,
|
|
2080
|
+
(0, import_react7.useEffect)(() => {
|
|
2255
2081
|
if (externalWallets?.length) {
|
|
2256
2082
|
setWalletsLoading(false);
|
|
2257
2083
|
return;
|
|
@@ -2262,9 +2088,9 @@ function BuyWithCard({
|
|
|
2262
2088
|
if (isCancelled) return;
|
|
2263
2089
|
setWalletsLoading(true);
|
|
2264
2090
|
try {
|
|
2265
|
-
const response = await
|
|
2091
|
+
const response = await (0, import_core7.createDepositAddress)(
|
|
2266
2092
|
{
|
|
2267
|
-
|
|
2093
|
+
external_user_id: userId,
|
|
2268
2094
|
recipient_address: recipientAddress,
|
|
2269
2095
|
destination_chain_type: destinationChainType,
|
|
2270
2096
|
destination_chain_id: destinationChainId,
|
|
@@ -2292,10 +2118,10 @@ function BuyWithCard({
|
|
|
2292
2118
|
}
|
|
2293
2119
|
};
|
|
2294
2120
|
}, [userId, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, publishableKey, externalWallets]);
|
|
2295
|
-
(0,
|
|
2121
|
+
(0, import_react7.useEffect)(() => {
|
|
2296
2122
|
async function fetchSupportedTokens() {
|
|
2297
2123
|
try {
|
|
2298
|
-
const response = await getSupportedDepositTokens(publishableKey);
|
|
2124
|
+
const response = await (0, import_core7.getSupportedDepositTokens)(publishableKey);
|
|
2299
2125
|
setSupportedTokens(response.data);
|
|
2300
2126
|
} catch (err) {
|
|
2301
2127
|
console.error("Error fetching supported tokens:", err);
|
|
@@ -2303,7 +2129,7 @@ function BuyWithCard({
|
|
|
2303
2129
|
}
|
|
2304
2130
|
fetchSupportedTokens();
|
|
2305
2131
|
}, [publishableKey]);
|
|
2306
|
-
(0,
|
|
2132
|
+
(0, import_react7.useEffect)(() => {
|
|
2307
2133
|
const amountNum = parseFloat(amount);
|
|
2308
2134
|
if (isNaN(amountNum) || amountNum <= 0) {
|
|
2309
2135
|
setQuotes([]);
|
|
@@ -2338,7 +2164,7 @@ function BuyWithCard({
|
|
|
2338
2164
|
source_amount: sourceAmount.toString(),
|
|
2339
2165
|
source_currency_code: currency.toLowerCase()
|
|
2340
2166
|
};
|
|
2341
|
-
const response = await getMeldQuotes(request, publishableKey);
|
|
2167
|
+
const response = await (0, import_core7.getMeldQuotes)(request, publishableKey);
|
|
2342
2168
|
setQuotes(response.data);
|
|
2343
2169
|
if (hasManualSelection && selectedProvider) {
|
|
2344
2170
|
const manualProviderStillExists = response.data.find(
|
|
@@ -2383,7 +2209,7 @@ function BuyWithCard({
|
|
|
2383
2209
|
setQuotesLoading(false);
|
|
2384
2210
|
}
|
|
2385
2211
|
};
|
|
2386
|
-
(0,
|
|
2212
|
+
(0, import_react7.useEffect)(() => {
|
|
2387
2213
|
if (quotes.length === 0) return;
|
|
2388
2214
|
const timer = setInterval(() => {
|
|
2389
2215
|
setCountdown((prev) => {
|
|
@@ -2418,7 +2244,7 @@ function BuyWithCard({
|
|
|
2418
2244
|
const handleContinue = async () => {
|
|
2419
2245
|
if (!selectedProvider) return;
|
|
2420
2246
|
try {
|
|
2421
|
-
const wallet = getWalletByChainType(wallets, "ethereum");
|
|
2247
|
+
const wallet = (0, import_core7.getWalletByChainType)(wallets, "ethereum");
|
|
2422
2248
|
if (!wallet?.address) {
|
|
2423
2249
|
setQuotesError("Wallet address not available");
|
|
2424
2250
|
return;
|
|
@@ -2431,7 +2257,7 @@ function BuyWithCard({
|
|
|
2431
2257
|
wallet_address: wallet.address,
|
|
2432
2258
|
source_amount: amount
|
|
2433
2259
|
};
|
|
2434
|
-
const session = await createMeldSession(sessionRequest, publishableKey);
|
|
2260
|
+
const session = await (0, import_core7.createMeldSession)(sessionRequest, publishableKey);
|
|
2435
2261
|
setOnrampSession({
|
|
2436
2262
|
provider: selectedProvider,
|
|
2437
2263
|
sourceCurrency: currency,
|
|
@@ -2458,36 +2284,36 @@ function BuyWithCard({
|
|
|
2458
2284
|
(a, b) => b.destination_amount - a.destination_amount
|
|
2459
2285
|
);
|
|
2460
2286
|
const currencySymbol = getCurrencySymbol(currency);
|
|
2461
|
-
return /* @__PURE__ */ (0,
|
|
2462
|
-
/* @__PURE__ */ (0,
|
|
2287
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-pb-1 uf-relative uf-overflow-hidden", children: [
|
|
2288
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2463
2289
|
"div",
|
|
2464
2290
|
{
|
|
2465
|
-
className: `uf-transition-all uf-duration-300 ${showQuotesView || showOnrampView ? "uf-opacity-0 uf-pointer-events-none uf-absolute uf-inset-0" : "uf-opacity-100"}`,
|
|
2291
|
+
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"}`,
|
|
2466
2292
|
children: [
|
|
2467
|
-
/* @__PURE__ */ (0,
|
|
2468
|
-
/* @__PURE__ */ (0,
|
|
2293
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-mb-6 uf-pt-4", children: [
|
|
2294
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "uf-flex uf-justify-center uf-mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2469
2295
|
"button",
|
|
2470
2296
|
{
|
|
2471
2297
|
onClick: () => setShowCurrencyModal(true),
|
|
2472
2298
|
disabled: currenciesLoading,
|
|
2473
2299
|
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",
|
|
2474
2300
|
children: [
|
|
2475
|
-
selectedCurrencyData && /* @__PURE__ */ (0,
|
|
2301
|
+
selectedCurrencyData && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2476
2302
|
"img",
|
|
2477
2303
|
{
|
|
2478
|
-
src: getPreferredIconUrl(selectedCurrencyData.icon_urls, "png") || selectedCurrencyData.icon_url,
|
|
2304
|
+
src: (0, import_core7.getPreferredIconUrl)(selectedCurrencyData.icon_urls, "png") || selectedCurrencyData.icon_url,
|
|
2479
2305
|
alt: selectedCurrencyData.name,
|
|
2480
2306
|
className: "uf-w-4 uf-h-4"
|
|
2481
2307
|
}
|
|
2482
2308
|
),
|
|
2483
|
-
/* @__PURE__ */ (0,
|
|
2484
|
-
/* @__PURE__ */ (0,
|
|
2309
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "uf-text-sm uf-text-foreground uf-font-medium", children: currency.toUpperCase() }),
|
|
2310
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react10.ChevronDown, { className: "uf-w-3.5 uf-h-3.5 uf-text-muted-foreground" })
|
|
2485
2311
|
]
|
|
2486
2312
|
}
|
|
2487
2313
|
) }),
|
|
2488
|
-
/* @__PURE__ */ (0,
|
|
2489
|
-
/* @__PURE__ */ (0,
|
|
2490
|
-
/* @__PURE__ */ (0,
|
|
2314
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-text-center uf-mb-4", children: [
|
|
2315
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "uf-flex uf-items-center uf-justify-center uf-mb-2 uf-px-8", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-flex uf-items-center uf-max-w-full", children: [
|
|
2316
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2491
2317
|
"span",
|
|
2492
2318
|
{
|
|
2493
2319
|
className: "uf-font-normal uf-text-foreground uf-flex-shrink-0 uf-mr-1",
|
|
@@ -2497,7 +2323,7 @@ function BuyWithCard({
|
|
|
2497
2323
|
children: currencySymbol
|
|
2498
2324
|
}
|
|
2499
2325
|
),
|
|
2500
|
-
/* @__PURE__ */ (0,
|
|
2326
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2501
2327
|
"input",
|
|
2502
2328
|
{
|
|
2503
2329
|
type: "text",
|
|
@@ -2513,12 +2339,12 @@ function BuyWithCard({
|
|
|
2513
2339
|
}
|
|
2514
2340
|
)
|
|
2515
2341
|
] }) }),
|
|
2516
|
-
quotesLoading ? /* @__PURE__ */ (0,
|
|
2342
|
+
quotesLoading ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "uf-flex uf-justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "uf-h-4 uf-bg-muted uf-rounded uf-w-40 uf-animate-pulse" }) }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-text-sm uf-text-muted-foreground uf-font-normal", children: [
|
|
2517
2343
|
calculateUSDC(),
|
|
2518
2344
|
" USDC (Perps)"
|
|
2519
2345
|
] })
|
|
2520
2346
|
] }),
|
|
2521
|
-
/* @__PURE__ */ (0,
|
|
2347
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "uf-flex uf-gap-3 uf-justify-center", children: QUICK_AMOUNTS.map((quickAmount) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2522
2348
|
"button",
|
|
2523
2349
|
{
|
|
2524
2350
|
onClick: () => handleQuickAmount(quickAmount),
|
|
@@ -2531,31 +2357,31 @@ function BuyWithCard({
|
|
|
2531
2357
|
quickAmount
|
|
2532
2358
|
)) })
|
|
2533
2359
|
] }),
|
|
2534
|
-
/* @__PURE__ */ (0,
|
|
2535
|
-
/* @__PURE__ */ (0,
|
|
2536
|
-
/* @__PURE__ */ (0,
|
|
2537
|
-
quotes.length > 0 && !quotesLoading && /* @__PURE__ */ (0,
|
|
2360
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-mb-6", children: [
|
|
2361
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-flex uf-items-center uf-justify-between uf-text-xs uf-font-medium uf-mb-2 uf-px-1", children: [
|
|
2362
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "uf-text-foreground", children: "Provider" }),
|
|
2363
|
+
quotes.length > 0 && !quotesLoading && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: "uf-text-[10px] uf-text-foreground uf-font-normal", children: [
|
|
2538
2364
|
"Refreshing in ",
|
|
2539
2365
|
countdown,
|
|
2540
2366
|
"s"
|
|
2541
2367
|
] })
|
|
2542
2368
|
] }),
|
|
2543
|
-
/* @__PURE__ */ (0,
|
|
2369
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2544
2370
|
"button",
|
|
2545
2371
|
{
|
|
2546
2372
|
onClick: () => handleViewChange("quotes"),
|
|
2547
2373
|
disabled: quotesLoading || quotes.length === 0,
|
|
2548
2374
|
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",
|
|
2549
|
-
children: quotesLoading ? /* @__PURE__ */ (0,
|
|
2550
|
-
/* @__PURE__ */ (0,
|
|
2551
|
-
/* @__PURE__ */ (0,
|
|
2552
|
-
/* @__PURE__ */ (0,
|
|
2553
|
-
/* @__PURE__ */ (0,
|
|
2375
|
+
children: quotesLoading ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-text-left uf-w-full uf-animate-pulse", children: [
|
|
2376
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "uf-h-3 uf-bg-muted uf-rounded uf-w-28 uf-mb-3" }),
|
|
2377
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
2378
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "uf-w-8 uf-h-8 uf-bg-muted uf-rounded-full" }),
|
|
2379
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "uf-h-4 uf-bg-muted uf-rounded uf-w-32" })
|
|
2554
2380
|
] })
|
|
2555
|
-
] }) : /* @__PURE__ */ (0,
|
|
2556
|
-
isAutoSelected && /* @__PURE__ */ (0,
|
|
2557
|
-
selectedProvider && /* @__PURE__ */ (0,
|
|
2558
|
-
/* @__PURE__ */ (0,
|
|
2381
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-w-full uf-text-left", children: [
|
|
2382
|
+
isAutoSelected && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "uf-text-xs uf-text-muted-foreground uf-font-normal uf-mb-2", children: "Auto-picked for you" }),
|
|
2383
|
+
selectedProvider && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
2384
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2559
2385
|
"img",
|
|
2560
2386
|
{
|
|
2561
2387
|
src: selectedProvider.icon_url,
|
|
@@ -2565,22 +2391,22 @@ function BuyWithCard({
|
|
|
2565
2391
|
className: "uf-rounded-full uf-flex-shrink-0"
|
|
2566
2392
|
}
|
|
2567
2393
|
),
|
|
2568
|
-
/* @__PURE__ */ (0,
|
|
2569
|
-
/* @__PURE__ */ (0,
|
|
2570
|
-
/* @__PURE__ */ (0,
|
|
2571
|
-
isAutoSelected && /* @__PURE__ */ (0,
|
|
2572
|
-
isAutoSelected && selectedProvider.low_kyc === false && /* @__PURE__ */ (0,
|
|
2573
|
-
selectedProvider.low_kyc === false && /* @__PURE__ */ (0,
|
|
2394
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-flex-1 uf-min-w-0", children: [
|
|
2395
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "uf-text-sm uf-text-foreground uf-font-medium", children: selectedProvider.service_provider_display_name }),
|
|
2396
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-1.5 uf-mt-0.5", children: [
|
|
2397
|
+
isAutoSelected && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "uf-text-[10px] uf-text-green-400 uf-font-normal", children: "Best price" }),
|
|
2398
|
+
isAutoSelected && selectedProvider.low_kyc === false && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "uf-text-[10px] uf-text-muted-foreground", children: "\u2022" }),
|
|
2399
|
+
selectedProvider.low_kyc === false && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "uf-text-[10px] uf-text-muted-foreground uf-font-normal", children: "No document upload" })
|
|
2574
2400
|
] })
|
|
2575
2401
|
] }),
|
|
2576
|
-
quotes.length > 0 && /* @__PURE__ */ (0,
|
|
2402
|
+
quotes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react10.ChevronRight, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground group-hover:uf-text-foreground uf-transition-colors uf-flex-shrink-0" })
|
|
2577
2403
|
] })
|
|
2578
2404
|
] })
|
|
2579
2405
|
}
|
|
2580
2406
|
),
|
|
2581
|
-
quotesError && /* @__PURE__ */ (0,
|
|
2407
|
+
quotesError && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "uf-text-xs uf-text-red-400 uf-mt-2 uf-px-1", children: quotesError })
|
|
2582
2408
|
] }),
|
|
2583
|
-
/* @__PURE__ */ (0,
|
|
2409
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2584
2410
|
"button",
|
|
2585
2411
|
{
|
|
2586
2412
|
onClick: handleContinue,
|
|
@@ -2595,15 +2421,15 @@ function BuyWithCard({
|
|
|
2595
2421
|
]
|
|
2596
2422
|
}
|
|
2597
2423
|
),
|
|
2598
|
-
/* @__PURE__ */ (0,
|
|
2424
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2599
2425
|
"div",
|
|
2600
2426
|
{
|
|
2601
|
-
className: `uf-transition-all uf-duration-300 ${showQuotesView && !showOnrampView ? "uf-opacity-100" : "uf-opacity-0 uf-pointer-events-none uf-absolute uf-inset-0"}`,
|
|
2602
|
-
children: /* @__PURE__ */ (0,
|
|
2427
|
+
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"}`,
|
|
2428
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "uf-space-y-2 uf-pt-2", children: sortedQuotes.map((quote, index) => {
|
|
2603
2429
|
const badges = getProviderBadges(quote, sortedQuotes);
|
|
2604
2430
|
const displayName = quote.service_provider_display_name;
|
|
2605
2431
|
const isSelected = selectedProvider?.service_provider === quote.service_provider;
|
|
2606
|
-
return /* @__PURE__ */ (0,
|
|
2432
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2607
2433
|
"button",
|
|
2608
2434
|
{
|
|
2609
2435
|
onClick: () => {
|
|
@@ -2616,8 +2442,8 @@ function BuyWithCard({
|
|
|
2616
2442
|
},
|
|
2617
2443
|
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" : ""}`,
|
|
2618
2444
|
children: [
|
|
2619
|
-
/* @__PURE__ */ (0,
|
|
2620
|
-
/* @__PURE__ */ (0,
|
|
2445
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
2446
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "uf-w-10 uf-h-10 uf-flex uf-items-center uf-justify-center uf-flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2621
2447
|
"img",
|
|
2622
2448
|
{
|
|
2623
2449
|
src: quote.icon_url,
|
|
@@ -2627,10 +2453,10 @@ function BuyWithCard({
|
|
|
2627
2453
|
className: "uf-rounded-full"
|
|
2628
2454
|
}
|
|
2629
2455
|
) }),
|
|
2630
|
-
/* @__PURE__ */ (0,
|
|
2631
|
-
/* @__PURE__ */ (0,
|
|
2632
|
-
/* @__PURE__ */ (0,
|
|
2633
|
-
badges.map((badge, i) => /* @__PURE__ */ (0,
|
|
2456
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-text-left", children: [
|
|
2457
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "uf-text-sm uf-font-medium uf-text-foreground", children: displayName }),
|
|
2458
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-1.5 uf-mt-0.5", children: [
|
|
2459
|
+
badges.map((badge, i) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2634
2460
|
"span",
|
|
2635
2461
|
{
|
|
2636
2462
|
className: "uf-text-[10px] uf-text-green-400 uf-font-normal",
|
|
@@ -2641,17 +2467,17 @@ function BuyWithCard({
|
|
|
2641
2467
|
},
|
|
2642
2468
|
i
|
|
2643
2469
|
)),
|
|
2644
|
-
quote.low_kyc === false && badges.length > 0 && /* @__PURE__ */ (0,
|
|
2645
|
-
quote.low_kyc === false && /* @__PURE__ */ (0,
|
|
2470
|
+
quote.low_kyc === false && badges.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "uf-text-[10px] uf-text-muted-foreground", children: "\u2022" }),
|
|
2471
|
+
quote.low_kyc === false && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "uf-text-[10px] uf-text-muted-foreground uf-font-normal", children: "No document upload" })
|
|
2646
2472
|
] })
|
|
2647
2473
|
] })
|
|
2648
2474
|
] }),
|
|
2649
|
-
/* @__PURE__ */ (0,
|
|
2650
|
-
/* @__PURE__ */ (0,
|
|
2475
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-text-right", children: [
|
|
2476
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-text-sm uf-font-medium uf-text-foreground", children: [
|
|
2651
2477
|
quote.destination_amount.toFixed(2),
|
|
2652
2478
|
" USDC"
|
|
2653
2479
|
] }),
|
|
2654
|
-
/* @__PURE__ */ (0,
|
|
2480
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-text-xs uf-text-muted-foreground uf-font-normal", children: [
|
|
2655
2481
|
currencySymbol,
|
|
2656
2482
|
" ",
|
|
2657
2483
|
amount
|
|
@@ -2664,12 +2490,12 @@ function BuyWithCard({
|
|
|
2664
2490
|
}) })
|
|
2665
2491
|
}
|
|
2666
2492
|
),
|
|
2667
|
-
/* @__PURE__ */ (0,
|
|
2493
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2668
2494
|
"div",
|
|
2669
2495
|
{
|
|
2670
2496
|
className: `uf-transition-all uf-duration-300 ${showOnrampView ? "uf-opacity-100" : "uf-opacity-0 uf-pointer-events-none uf-absolute uf-inset-0"}`,
|
|
2671
|
-
children: onrampSession && /* @__PURE__ */ (0,
|
|
2672
|
-
/* @__PURE__ */ (0,
|
|
2497
|
+
children: onrampSession && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-flex uf-flex-col uf-items-center uf-pt-6 uf-pb-4 uf-px-2", children: [
|
|
2498
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "uf-mb-6", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2673
2499
|
"img",
|
|
2674
2500
|
{
|
|
2675
2501
|
src: onrampSession.provider.icon_url,
|
|
@@ -2679,62 +2505,62 @@ function BuyWithCard({
|
|
|
2679
2505
|
className: "uf-rounded-2xl"
|
|
2680
2506
|
}
|
|
2681
2507
|
) }),
|
|
2682
|
-
/* @__PURE__ */ (0,
|
|
2508
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("h2", { className: "uf-text-xl uf-font-medium uf-text-foreground uf-mb-2", children: t2.onramp.completeTransaction.replace(
|
|
2683
2509
|
"{{provider}}",
|
|
2684
2510
|
onrampSession.provider.service_provider_display_name
|
|
2685
2511
|
) }),
|
|
2686
|
-
/* @__PURE__ */ (0,
|
|
2687
|
-
/* @__PURE__ */ (0,
|
|
2688
|
-
/* @__PURE__ */ (0,
|
|
2689
|
-
/* @__PURE__ */ (0,
|
|
2512
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "uf-text-sm uf-text-muted-foreground uf-mb-8", children: t2.onramp.canCloseModal }),
|
|
2513
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "uf-w-full uf-bg-secondary uf-rounded-xl uf-p-4 uf-mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-flex uf-items-center uf-justify-center", children: [
|
|
2514
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-flex uf-flex-col uf-items-center uf-min-w-[72px]", children: [
|
|
2515
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "uf-h-8 uf-flex uf-items-center uf-justify-center uf-mb-1.5", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2690
2516
|
"img",
|
|
2691
2517
|
{
|
|
2692
|
-
src: getIconUrlWithCdn(
|
|
2693
|
-
`/icons/currencies/
|
|
2518
|
+
src: (0, import_core7.getIconUrlWithCdn)(
|
|
2519
|
+
`/icons/currencies/png/${onrampSession.sourceCurrency.toLowerCase()}.png`,
|
|
2694
2520
|
assetCdnUrl
|
|
2695
2521
|
),
|
|
2696
2522
|
alt: onrampSession.sourceCurrency.toUpperCase(),
|
|
2697
2523
|
className: "uf-w-7 uf-h-7 uf-rounded-full"
|
|
2698
2524
|
}
|
|
2699
2525
|
) }),
|
|
2700
|
-
/* @__PURE__ */ (0,
|
|
2701
|
-
/* @__PURE__ */ (0,
|
|
2526
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "uf-text-[10px] uf-text-muted-foreground uf-text-center", children: t2.onramp.youUse }),
|
|
2527
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "uf-text-sm uf-font-medium uf-text-foreground uf-text-center", children: onrampSession.sourceCurrency.toUpperCase() })
|
|
2702
2528
|
] }),
|
|
2703
|
-
/* @__PURE__ */ (0,
|
|
2704
|
-
/* @__PURE__ */ (0,
|
|
2705
|
-
/* @__PURE__ */ (0,
|
|
2706
|
-
/* @__PURE__ */ (0,
|
|
2529
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "uf-text-muted-foreground uf-px-1 uf-self-start uf-pt-2", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react10.ChevronRight, { className: "uf-w-4 uf-h-4" }) }),
|
|
2530
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-flex uf-flex-col uf-items-center uf-min-w-[72px]", children: [
|
|
2531
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "uf-h-8 uf-flex uf-items-center uf-justify-center uf-mb-1.5", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-relative", children: [
|
|
2532
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2707
2533
|
"img",
|
|
2708
2534
|
{
|
|
2709
|
-
src: getIconUrlWithCdn("/icons/tokens/
|
|
2535
|
+
src: (0, import_core7.getIconUrlWithCdn)("/icons/tokens/png/usdc.png", assetCdnUrl),
|
|
2710
2536
|
alt: "USDC",
|
|
2711
2537
|
className: "uf-w-7 uf-h-7 uf-rounded-full"
|
|
2712
2538
|
}
|
|
2713
2539
|
),
|
|
2714
|
-
/* @__PURE__ */ (0,
|
|
2540
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2715
2541
|
"img",
|
|
2716
2542
|
{
|
|
2717
|
-
src: getIconUrlWithCdn("/icons/networks/
|
|
2543
|
+
src: (0, import_core7.getIconUrlWithCdn)("/icons/networks/png/polygon.png", assetCdnUrl),
|
|
2718
2544
|
alt: "Polygon",
|
|
2719
2545
|
className: "uf-w-3.5 uf-h-3.5 uf-absolute -uf-bottom-0.5 -uf-right-0.5 uf-rounded-full"
|
|
2720
2546
|
}
|
|
2721
2547
|
)
|
|
2722
2548
|
] }) }),
|
|
2723
|
-
/* @__PURE__ */ (0,
|
|
2724
|
-
/* @__PURE__ */ (0,
|
|
2549
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "uf-text-[10px] uf-text-muted-foreground uf-text-center", children: t2.onramp.youBuy }),
|
|
2550
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "uf-text-sm uf-font-medium uf-text-foreground uf-text-center", children: "USDC" })
|
|
2725
2551
|
] }),
|
|
2726
|
-
/* @__PURE__ */ (0,
|
|
2727
|
-
/* @__PURE__ */ (0,
|
|
2728
|
-
/* @__PURE__ */ (0,
|
|
2729
|
-
/* @__PURE__ */ (0,
|
|
2552
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "uf-text-muted-foreground uf-px-1 uf-self-start uf-pt-2", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react10.ChevronRight, { className: "uf-w-4 uf-h-4" }) }),
|
|
2553
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-flex uf-flex-col uf-items-center uf-min-w-[72px]", children: [
|
|
2554
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "uf-h-8 uf-flex uf-items-center uf-justify-center uf-mb-1.5", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-relative", children: [
|
|
2555
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2730
2556
|
"img",
|
|
2731
2557
|
{
|
|
2732
|
-
src: destinationToken?.icon_url || getIconUrlWithCdn("/icons/tokens/
|
|
2558
|
+
src: destinationToken?.icon_url || (0, import_core7.getIconUrlWithCdn)("/icons/tokens/png/usdc.png", assetCdnUrl),
|
|
2733
2559
|
alt: displayTokenSymbol,
|
|
2734
2560
|
className: "uf-w-7 uf-h-7 uf-rounded-full"
|
|
2735
2561
|
}
|
|
2736
2562
|
),
|
|
2737
|
-
destinationChain?.icon_url && /* @__PURE__ */ (0,
|
|
2563
|
+
destinationChain?.icon_url && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2738
2564
|
"img",
|
|
2739
2565
|
{
|
|
2740
2566
|
src: destinationChain.icon_url,
|
|
@@ -2743,15 +2569,15 @@ function BuyWithCard({
|
|
|
2743
2569
|
}
|
|
2744
2570
|
)
|
|
2745
2571
|
] }) }),
|
|
2746
|
-
/* @__PURE__ */ (0,
|
|
2747
|
-
/* @__PURE__ */ (0,
|
|
2572
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "uf-text-[10px] uf-text-muted-foreground uf-text-center", children: t2.onramp.youReceive }),
|
|
2573
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "uf-text-sm uf-font-medium uf-text-foreground uf-text-center", children: displayTokenSymbol })
|
|
2748
2574
|
] })
|
|
2749
2575
|
] }) }),
|
|
2750
|
-
/* @__PURE__ */ (0,
|
|
2576
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "uf-w-full uf-bg-secondary uf-rounded-xl uf-p-4", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "uf-text-xs uf-text-muted-foreground uf-leading-relaxed", children: t2.onramp.intentAddressNote }) })
|
|
2751
2577
|
] })
|
|
2752
2578
|
}
|
|
2753
2579
|
),
|
|
2754
|
-
/* @__PURE__ */ (0,
|
|
2580
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2755
2581
|
CurrencyModal,
|
|
2756
2582
|
{
|
|
2757
2583
|
open: showCurrencyModal,
|
|
@@ -2770,7 +2596,7 @@ function BuyWithCard({
|
|
|
2770
2596
|
|
|
2771
2597
|
// src/components/deposits/buttons/TransferCryptoButton.tsx
|
|
2772
2598
|
var import_lucide_react11 = require("lucide-react");
|
|
2773
|
-
var
|
|
2599
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
2774
2600
|
function TransferCryptoButton({
|
|
2775
2601
|
onClick,
|
|
2776
2602
|
title,
|
|
@@ -2778,23 +2604,23 @@ function TransferCryptoButton({
|
|
|
2778
2604
|
featuredTokens
|
|
2779
2605
|
}) {
|
|
2780
2606
|
const sortedTokens = featuredTokens ? [...featuredTokens].sort((a, b) => a.position - b.position) : [];
|
|
2781
|
-
return /* @__PURE__ */ (0,
|
|
2607
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
2782
2608
|
"button",
|
|
2783
2609
|
{
|
|
2784
2610
|
onClick,
|
|
2785
2611
|
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",
|
|
2786
2612
|
children: [
|
|
2787
|
-
/* @__PURE__ */ (0,
|
|
2788
|
-
/* @__PURE__ */ (0,
|
|
2789
|
-
/* @__PURE__ */ (0,
|
|
2790
|
-
/* @__PURE__ */ (0,
|
|
2791
|
-
/* @__PURE__ */ (0,
|
|
2613
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
2614
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "uf-bg-muted uf-rounded-lg uf-p-2", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react11.Zap, { className: "uf-w-5 uf-h-5" }) }),
|
|
2615
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "uf-text-left", children: [
|
|
2616
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "uf-text-sm uf-font-light uf-mb-0.5 uf-text-foreground", children: title }),
|
|
2617
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "uf-text-muted-foreground uf-text-xs uf-font-light", children: subtitle })
|
|
2792
2618
|
] })
|
|
2793
2619
|
] }),
|
|
2794
|
-
/* @__PURE__ */ (0,
|
|
2795
|
-
/* @__PURE__ */ (0,
|
|
2620
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
2621
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "uf-flex uf--space-x-2", children: sortedTokens.map((token) => {
|
|
2796
2622
|
const iconUrl = token.icon_urls.find((u) => u.format === "svg")?.url || token.icon_urls.find((u) => u.format === "png")?.url;
|
|
2797
|
-
return /* @__PURE__ */ (0,
|
|
2623
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2798
2624
|
"img",
|
|
2799
2625
|
{
|
|
2800
2626
|
src: iconUrl,
|
|
@@ -2806,7 +2632,7 @@ function TransferCryptoButton({
|
|
|
2806
2632
|
token.name
|
|
2807
2633
|
);
|
|
2808
2634
|
}) }),
|
|
2809
|
-
/* @__PURE__ */ (0,
|
|
2635
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react11.ChevronRight, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground group-hover:uf-text-foreground uf-transition-colors" })
|
|
2810
2636
|
] })
|
|
2811
2637
|
]
|
|
2812
2638
|
}
|
|
@@ -2815,30 +2641,30 @@ function TransferCryptoButton({
|
|
|
2815
2641
|
|
|
2816
2642
|
// src/components/deposits/buttons/DepositWithCardButton.tsx
|
|
2817
2643
|
var import_lucide_react12 = require("lucide-react");
|
|
2818
|
-
var
|
|
2644
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
2819
2645
|
function DepositWithCardButton({
|
|
2820
2646
|
onClick,
|
|
2821
2647
|
title,
|
|
2822
2648
|
subtitle,
|
|
2823
2649
|
paymentNetworks
|
|
2824
2650
|
}) {
|
|
2825
|
-
return /* @__PURE__ */ (0,
|
|
2651
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2826
2652
|
"button",
|
|
2827
2653
|
{
|
|
2828
2654
|
onClick,
|
|
2829
2655
|
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",
|
|
2830
2656
|
children: [
|
|
2831
|
-
/* @__PURE__ */ (0,
|
|
2832
|
-
/* @__PURE__ */ (0,
|
|
2833
|
-
/* @__PURE__ */ (0,
|
|
2834
|
-
/* @__PURE__ */ (0,
|
|
2835
|
-
/* @__PURE__ */ (0,
|
|
2657
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
2658
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "uf-bg-muted uf-rounded-lg uf-p-2", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react12.CreditCard, { className: "uf-w-5 uf-h-5" }) }),
|
|
2659
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "uf-text-left", children: [
|
|
2660
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "uf-text-sm uf-font-light uf-mb-0.5 uf-text-foreground", children: title }),
|
|
2661
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "uf-text-muted-foreground uf-text-xs uf-font-light", children: subtitle })
|
|
2836
2662
|
] })
|
|
2837
2663
|
] }),
|
|
2838
|
-
/* @__PURE__ */ (0,
|
|
2839
|
-
/* @__PURE__ */ (0,
|
|
2664
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
2665
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "uf-flex uf-items-center uf-gap-1.5", children: paymentNetworks?.map((network) => {
|
|
2840
2666
|
const iconUrl = network.icon_urls.find((u) => u.format === "svg")?.url || network.icon_urls.find((u) => u.format === "png")?.url;
|
|
2841
|
-
return /* @__PURE__ */ (0,
|
|
2667
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2842
2668
|
"img",
|
|
2843
2669
|
{
|
|
2844
2670
|
src: iconUrl,
|
|
@@ -2850,7 +2676,7 @@ function DepositWithCardButton({
|
|
|
2850
2676
|
network.name
|
|
2851
2677
|
);
|
|
2852
2678
|
}) }),
|
|
2853
|
-
/* @__PURE__ */ (0,
|
|
2679
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react12.ChevronRight, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground group-hover:uf-text-foreground uf-transition-colors" })
|
|
2854
2680
|
] })
|
|
2855
2681
|
]
|
|
2856
2682
|
}
|
|
@@ -2859,49 +2685,50 @@ function DepositWithCardButton({
|
|
|
2859
2685
|
|
|
2860
2686
|
// src/components/deposits/buttons/DepositTrackerButton.tsx
|
|
2861
2687
|
var import_lucide_react13 = require("lucide-react");
|
|
2862
|
-
var
|
|
2688
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
2863
2689
|
function DepositTrackerButton({
|
|
2864
2690
|
onClick,
|
|
2865
2691
|
title,
|
|
2866
2692
|
subtitle,
|
|
2867
2693
|
badge
|
|
2868
2694
|
}) {
|
|
2869
|
-
return /* @__PURE__ */ (0,
|
|
2695
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
2870
2696
|
"button",
|
|
2871
2697
|
{
|
|
2872
2698
|
onClick,
|
|
2873
2699
|
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",
|
|
2874
2700
|
children: [
|
|
2875
|
-
/* @__PURE__ */ (0,
|
|
2876
|
-
/* @__PURE__ */ (0,
|
|
2877
|
-
/* @__PURE__ */ (0,
|
|
2878
|
-
badge !== void 0 && badge > 0 && /* @__PURE__ */ (0,
|
|
2701
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
2702
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "uf-bg-muted uf-rounded-lg uf-p-2 uf-relative", children: [
|
|
2703
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react13.Clock, { className: "uf-w-5 uf-h-5" }),
|
|
2704
|
+
badge !== void 0 && badge > 0 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("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 })
|
|
2879
2705
|
] }),
|
|
2880
|
-
/* @__PURE__ */ (0,
|
|
2881
|
-
/* @__PURE__ */ (0,
|
|
2882
|
-
/* @__PURE__ */ (0,
|
|
2706
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "uf-text-left", children: [
|
|
2707
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "uf-text-sm uf-font-light uf-mb-0.5 uf-text-foreground", children: title }),
|
|
2708
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "uf-text-muted-foreground uf-text-xs uf-font-light", children: subtitle })
|
|
2883
2709
|
] })
|
|
2884
2710
|
] }),
|
|
2885
|
-
/* @__PURE__ */ (0,
|
|
2711
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react13.ChevronRight, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground group-hover:uf-text-foreground uf-transition-colors" })
|
|
2886
2712
|
]
|
|
2887
2713
|
}
|
|
2888
2714
|
);
|
|
2889
2715
|
}
|
|
2890
2716
|
|
|
2891
2717
|
// src/components/deposits/DepositModal.tsx
|
|
2892
|
-
var
|
|
2718
|
+
var import_core8 = require("@unifold/core");
|
|
2719
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2893
2720
|
function SkeletonButton({ variant = "default" }) {
|
|
2894
|
-
return /* @__PURE__ */ (0,
|
|
2895
|
-
/* @__PURE__ */ (0,
|
|
2896
|
-
/* @__PURE__ */ (0,
|
|
2897
|
-
/* @__PURE__ */ (0,
|
|
2898
|
-
/* @__PURE__ */ (0,
|
|
2899
|
-
/* @__PURE__ */ (0,
|
|
2721
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "uf-w-full uf-bg-secondary uf-rounded-xl uf-p-3 uf-flex uf-items-center uf-justify-between uf-animate-pulse", children: [
|
|
2722
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
2723
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "uf-bg-muted uf-rounded-lg uf-w-9 uf-h-9" }),
|
|
2724
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "uf-space-y-1.5", children: [
|
|
2725
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "uf-h-3.5 uf-w-24 uf-bg-muted uf-rounded" }),
|
|
2726
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "uf-h-3 uf-w-32 uf-bg-muted uf-rounded" })
|
|
2900
2727
|
] })
|
|
2901
2728
|
] }),
|
|
2902
|
-
/* @__PURE__ */ (0,
|
|
2903
|
-
variant === "with-icons" && /* @__PURE__ */ (0,
|
|
2904
|
-
/* @__PURE__ */ (0,
|
|
2729
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
2730
|
+
variant === "with-icons" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "uf-flex uf--space-x-1", children: [1, 2, 3].map((i) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "uf-w-5 uf-h-5 uf-rounded-full uf-bg-muted uf-border-2 uf-border-secondary" }, i)) }),
|
|
2731
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react14.ChevronRight, { className: "uf-w-4 uf-h-4 uf-text-muted" })
|
|
2905
2732
|
] })
|
|
2906
2733
|
] });
|
|
2907
2734
|
}
|
|
@@ -2922,24 +2749,24 @@ function DepositModal({
|
|
|
2922
2749
|
onDepositError,
|
|
2923
2750
|
theme = "dark"
|
|
2924
2751
|
}) {
|
|
2925
|
-
const [view, setView] = (0,
|
|
2926
|
-
const [cardView, setCardView] = (0,
|
|
2752
|
+
const [view, setView] = (0, import_react8.useState)("main");
|
|
2753
|
+
const [cardView, setCardView] = (0, import_react8.useState)(
|
|
2927
2754
|
"amount"
|
|
2928
2755
|
);
|
|
2929
|
-
const [quotesCount, setQuotesCount] = (0,
|
|
2930
|
-
const [depositsModalOpen, setDepositsModalOpen] = (0,
|
|
2931
|
-
const [depositExecutions, setDepositExecutions] = (0,
|
|
2932
|
-
const [projectConfig, setProjectConfig] = (0,
|
|
2933
|
-
const [wallets, setWallets] = (0,
|
|
2934
|
-
const [walletsLoading, setWalletsLoading] = (0,
|
|
2935
|
-
(0,
|
|
2756
|
+
const [quotesCount, setQuotesCount] = (0, import_react8.useState)(0);
|
|
2757
|
+
const [depositsModalOpen, setDepositsModalOpen] = (0, import_react8.useState)(false);
|
|
2758
|
+
const [depositExecutions, setDepositExecutions] = (0, import_react8.useState)([]);
|
|
2759
|
+
const [projectConfig, setProjectConfig] = (0, import_react8.useState)(null);
|
|
2760
|
+
const [wallets, setWallets] = (0, import_react8.useState)([]);
|
|
2761
|
+
const [walletsLoading, setWalletsLoading] = (0, import_react8.useState)(false);
|
|
2762
|
+
(0, import_react8.useEffect)(() => {
|
|
2936
2763
|
setProjectConfig(null);
|
|
2937
2764
|
}, [publishableKey]);
|
|
2938
|
-
(0,
|
|
2765
|
+
(0, import_react8.useEffect)(() => {
|
|
2939
2766
|
setWallets([]);
|
|
2940
2767
|
}, [userId, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, publishableKey]);
|
|
2941
|
-
const [resolvedTheme, setResolvedTheme] = (0,
|
|
2942
|
-
(0,
|
|
2768
|
+
const [resolvedTheme, setResolvedTheme] = (0, import_react8.useState)(theme === "auto" ? "dark" : theme);
|
|
2769
|
+
(0, import_react8.useEffect)(() => {
|
|
2943
2770
|
if (theme === "auto") {
|
|
2944
2771
|
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
2945
2772
|
setResolvedTheme(mediaQuery.matches ? "dark" : "light");
|
|
@@ -2952,12 +2779,12 @@ function DepositModal({
|
|
|
2952
2779
|
setResolvedTheme(theme);
|
|
2953
2780
|
}
|
|
2954
2781
|
}, [theme]);
|
|
2955
|
-
(0,
|
|
2782
|
+
(0, import_react8.useEffect)(() => {
|
|
2956
2783
|
if (open && !projectConfig) {
|
|
2957
|
-
getProjectConfig(publishableKey).then(setProjectConfig).catch(console.error);
|
|
2784
|
+
(0, import_core8.getProjectConfig)(publishableKey).then(setProjectConfig).catch(console.error);
|
|
2958
2785
|
}
|
|
2959
2786
|
}, [open, publishableKey, projectConfig]);
|
|
2960
|
-
(0,
|
|
2787
|
+
(0, import_react8.useEffect)(() => {
|
|
2961
2788
|
if (!open || wallets.length > 0) return;
|
|
2962
2789
|
let retryTimeout = null;
|
|
2963
2790
|
let isCancelled = false;
|
|
@@ -2965,9 +2792,9 @@ function DepositModal({
|
|
|
2965
2792
|
if (isCancelled) return;
|
|
2966
2793
|
setWalletsLoading(true);
|
|
2967
2794
|
try {
|
|
2968
|
-
const response = await
|
|
2795
|
+
const response = await (0, import_core8.createDepositAddress)(
|
|
2969
2796
|
{
|
|
2970
|
-
|
|
2797
|
+
external_user_id: userId,
|
|
2971
2798
|
recipient_address: recipientAddress,
|
|
2972
2799
|
destination_chain_type: destinationChainType,
|
|
2973
2800
|
destination_chain_id: destinationChainId,
|
|
@@ -3019,27 +2846,27 @@ function DepositModal({
|
|
|
3019
2846
|
setQuotesCount(count);
|
|
3020
2847
|
}
|
|
3021
2848
|
};
|
|
3022
|
-
return /* @__PURE__ */ (0,
|
|
3023
|
-
/* @__PURE__ */ (0,
|
|
2849
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ThemeProvider, { themeClass, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Dialog, { open, onOpenChange: handleClose, children: [
|
|
2850
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3024
2851
|
DialogContent,
|
|
3025
2852
|
{
|
|
3026
2853
|
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}`,
|
|
3027
2854
|
onPointerDownOutside: (e) => e.preventDefault(),
|
|
3028
2855
|
onInteractOutside: (e) => e.preventDefault(),
|
|
3029
|
-
children: view === "main" ? /* @__PURE__ */ (0,
|
|
3030
|
-
/* @__PURE__ */ (0,
|
|
2856
|
+
children: view === "main" ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
2857
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3031
2858
|
DepositHeader,
|
|
3032
2859
|
{
|
|
3033
2860
|
title: modalTitle || "Deposit",
|
|
3034
2861
|
onClose: handleClose
|
|
3035
2862
|
}
|
|
3036
2863
|
),
|
|
3037
|
-
/* @__PURE__ */ (0,
|
|
3038
|
-
/* @__PURE__ */ (0,
|
|
3039
|
-
/* @__PURE__ */ (0,
|
|
3040
|
-
!hideDepositTracker && /* @__PURE__ */ (0,
|
|
3041
|
-
] }) : /* @__PURE__ */ (0,
|
|
3042
|
-
/* @__PURE__ */ (0,
|
|
2864
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "uf-pb-4 uf-space-y-3", children: !projectConfig ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
2865
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SkeletonButton, { variant: "with-icons" }),
|
|
2866
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SkeletonButton, { variant: "with-icons" }),
|
|
2867
|
+
!hideDepositTracker && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SkeletonButton, {})
|
|
2868
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
2869
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3043
2870
|
TransferCryptoButton,
|
|
3044
2871
|
{
|
|
3045
2872
|
onClick: () => setView("transfer"),
|
|
@@ -3048,7 +2875,7 @@ function DepositModal({
|
|
|
3048
2875
|
featuredTokens: projectConfig.transfer_crypto.networks
|
|
3049
2876
|
}
|
|
3050
2877
|
),
|
|
3051
|
-
/* @__PURE__ */ (0,
|
|
2878
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3052
2879
|
DepositWithCardButton,
|
|
3053
2880
|
{
|
|
3054
2881
|
onClick: () => setView("card"),
|
|
@@ -3057,7 +2884,7 @@ function DepositModal({
|
|
|
3057
2884
|
paymentNetworks: projectConfig.payment_networks.networks
|
|
3058
2885
|
}
|
|
3059
2886
|
),
|
|
3060
|
-
!hideDepositTracker && /* @__PURE__ */ (0,
|
|
2887
|
+
!hideDepositTracker && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3061
2888
|
DepositTrackerButton,
|
|
3062
2889
|
{
|
|
3063
2890
|
onClick: () => setDepositsModalOpen(true),
|
|
@@ -3067,8 +2894,8 @@ function DepositModal({
|
|
|
3067
2894
|
}
|
|
3068
2895
|
)
|
|
3069
2896
|
] }) })
|
|
3070
|
-
] }) : view === "transfer" ? /* @__PURE__ */ (0,
|
|
3071
|
-
/* @__PURE__ */ (0,
|
|
2897
|
+
] }) : view === "transfer" ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
2898
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3072
2899
|
DepositHeader,
|
|
3073
2900
|
{
|
|
3074
2901
|
title: t3.transferCrypto.title,
|
|
@@ -3077,7 +2904,7 @@ function DepositModal({
|
|
|
3077
2904
|
onClose: handleClose
|
|
3078
2905
|
}
|
|
3079
2906
|
),
|
|
3080
|
-
/* @__PURE__ */ (0,
|
|
2907
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3081
2908
|
TransferCrypto,
|
|
3082
2909
|
{
|
|
3083
2910
|
userId,
|
|
@@ -3092,18 +2919,18 @@ function DepositModal({
|
|
|
3092
2919
|
wallets
|
|
3093
2920
|
}
|
|
3094
2921
|
)
|
|
3095
|
-
] }) : /* @__PURE__ */ (0,
|
|
3096
|
-
/* @__PURE__ */ (0,
|
|
2922
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
2923
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3097
2924
|
DepositHeader,
|
|
3098
2925
|
{
|
|
3099
|
-
title: cardView === "quotes" ? t3.quotes :
|
|
2926
|
+
title: cardView === "quotes" ? t3.quotes : t3.depositWithCard.title,
|
|
3100
2927
|
showBack: true,
|
|
3101
2928
|
onBack: handleBack,
|
|
3102
2929
|
onClose: handleClose,
|
|
3103
2930
|
badge: cardView === "quotes" ? { count: quotesCount } : void 0
|
|
3104
2931
|
}
|
|
3105
2932
|
),
|
|
3106
|
-
/* @__PURE__ */ (0,
|
|
2933
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3107
2934
|
BuyWithCard,
|
|
3108
2935
|
{
|
|
3109
2936
|
userId,
|
|
@@ -3125,11 +2952,12 @@ function DepositModal({
|
|
|
3125
2952
|
] })
|
|
3126
2953
|
}
|
|
3127
2954
|
),
|
|
3128
|
-
/* @__PURE__ */ (0,
|
|
2955
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3129
2956
|
DepositsModal,
|
|
3130
2957
|
{
|
|
3131
2958
|
open: depositsModalOpen,
|
|
3132
2959
|
onOpenChange: setDepositsModalOpen,
|
|
2960
|
+
onCloseAll: handleClose,
|
|
3133
2961
|
executions: depositExecutions,
|
|
3134
2962
|
userId,
|
|
3135
2963
|
publishableKey,
|
|
@@ -3140,9 +2968,9 @@ function DepositModal({
|
|
|
3140
2968
|
}
|
|
3141
2969
|
|
|
3142
2970
|
// src/components/deposits/TransferCrypto2.tsx
|
|
3143
|
-
var
|
|
2971
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
3144
2972
|
function TransferCrypto2(props) {
|
|
3145
|
-
return /* @__PURE__ */ (0,
|
|
2973
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3146
2974
|
TransferCryptoBase,
|
|
3147
2975
|
{
|
|
3148
2976
|
...props,
|
|
@@ -3151,6 +2979,56 @@ function TransferCrypto2(props) {
|
|
|
3151
2979
|
}
|
|
3152
2980
|
);
|
|
3153
2981
|
}
|
|
2982
|
+
|
|
2983
|
+
// src/components/shared/button.tsx
|
|
2984
|
+
var React5 = __toESM(require("react"));
|
|
2985
|
+
var import_react_slot = require("@radix-ui/react-slot");
|
|
2986
|
+
var import_class_variance_authority = require("class-variance-authority");
|
|
2987
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2988
|
+
var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
2989
|
+
"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",
|
|
2990
|
+
{
|
|
2991
|
+
variants: {
|
|
2992
|
+
variant: {
|
|
2993
|
+
default: "uf-bg-primary uf-text-primary-foreground hover:uf-bg-primary/90",
|
|
2994
|
+
destructive: "uf-bg-destructive uf-text-destructive-foreground hover:uf-bg-destructive/90",
|
|
2995
|
+
outline: "uf-border uf-border-input uf-bg-background hover:uf-bg-accent hover:uf-text-accent-foreground",
|
|
2996
|
+
secondary: "uf-bg-secondary uf-text-secondary-foreground hover:uf-bg-secondary/80",
|
|
2997
|
+
ghost: "hover:uf-bg-accent hover:uf-text-accent-foreground",
|
|
2998
|
+
link: "uf-text-primary uf-underline-offset-4 hover:uf-underline"
|
|
2999
|
+
},
|
|
3000
|
+
size: {
|
|
3001
|
+
default: "uf-h-10 uf-px-4 uf-py-2",
|
|
3002
|
+
sm: "uf-h-9 uf-rounded-md uf-px-3",
|
|
3003
|
+
lg: "uf-h-11 uf-rounded-md uf-px-8",
|
|
3004
|
+
icon: "uf-h-10 uf-w-10"
|
|
3005
|
+
}
|
|
3006
|
+
},
|
|
3007
|
+
defaultVariants: {
|
|
3008
|
+
variant: "default",
|
|
3009
|
+
size: "default"
|
|
3010
|
+
}
|
|
3011
|
+
}
|
|
3012
|
+
);
|
|
3013
|
+
var Button = React5.forwardRef(
|
|
3014
|
+
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
3015
|
+
const Comp = asChild ? import_react_slot.Slot : "button";
|
|
3016
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3017
|
+
Comp,
|
|
3018
|
+
{
|
|
3019
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
3020
|
+
ref,
|
|
3021
|
+
...props
|
|
3022
|
+
}
|
|
3023
|
+
);
|
|
3024
|
+
}
|
|
3025
|
+
);
|
|
3026
|
+
Button.displayName = "Button";
|
|
3027
|
+
|
|
3028
|
+
// src/index.ts
|
|
3029
|
+
var import_core9 = require("@unifold/core");
|
|
3030
|
+
var import_core10 = require("@unifold/core");
|
|
3031
|
+
var import_core11 = require("@unifold/core");
|
|
3154
3032
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3155
3033
|
0 && (module.exports = {
|
|
3156
3034
|
Button,
|
|
@@ -3158,7 +3036,7 @@ function TransferCrypto2(props) {
|
|
|
3158
3036
|
CurrencyListItem,
|
|
3159
3037
|
CurrencyListSection,
|
|
3160
3038
|
CurrencyModal,
|
|
3161
|
-
|
|
3039
|
+
DepositDetailContent,
|
|
3162
3040
|
DepositExecutionItem,
|
|
3163
3041
|
DepositHeader,
|
|
3164
3042
|
DepositModal,
|
|
@@ -3200,14 +3078,18 @@ function TransferCrypto2(props) {
|
|
|
3200
3078
|
TransferCryptoButton,
|
|
3201
3079
|
buttonVariants,
|
|
3202
3080
|
cn,
|
|
3203
|
-
|
|
3081
|
+
createDepositAddress,
|
|
3204
3082
|
createMeldSession,
|
|
3205
3083
|
getApiBaseUrl,
|
|
3084
|
+
getChainName,
|
|
3206
3085
|
getFiatCurrencies,
|
|
3207
3086
|
getIconUrl,
|
|
3208
3087
|
getIconUrlWithCdn,
|
|
3209
3088
|
getMeldQuotes,
|
|
3089
|
+
getPreferredIconUrl,
|
|
3090
|
+
getProjectConfig,
|
|
3210
3091
|
getSupportedDepositTokens,
|
|
3092
|
+
getTokenChains,
|
|
3211
3093
|
getWalletByChainType,
|
|
3212
3094
|
i18n,
|
|
3213
3095
|
queryExecutions,
|