@unifold/ui-react 0.1.9 → 0.1.11
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 -344
- package/dist/index.d.ts +11 -344
- package/dist/index.js +769 -871
- package/dist/index.mjs +714 -783
- 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.destination_token_metadata?.icon_url || getIconUrl("/icons/tokens/svg/usdc.svg"),
|
|
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,29 @@ 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
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
execution
|
|
681
|
-
|
|
682
|
-
}) {
|
|
683
|
-
if (!execution) return null;
|
|
684
|
-
const isPending = execution.status === "pending" /* PENDING */ || execution.status === "waiting" /* WAITING */ || execution.status === "delayed" /* DELAYED */;
|
|
479
|
+
function formatCurrency(currency) {
|
|
480
|
+
if (!currency) return "";
|
|
481
|
+
const dotIndex = currency.indexOf(".");
|
|
482
|
+
if (dotIndex === -1) {
|
|
483
|
+
return currency.toUpperCase();
|
|
484
|
+
}
|
|
485
|
+
return currency.slice(0, dotIndex).toUpperCase() + currency.slice(dotIndex);
|
|
486
|
+
}
|
|
487
|
+
function DepositDetailContent({ execution }) {
|
|
488
|
+
const [chains, setChains] = (0, import_react2.useState)([]);
|
|
489
|
+
const [showNetworkDetails, setShowNetworkDetails] = (0, import_react2.useState)(false);
|
|
490
|
+
(0, import_react2.useEffect)(() => {
|
|
491
|
+
(0, import_core2.getTokenChains)().then((response) => setChains(response.data)).catch((err) => console.error("Failed to fetch chains:", err));
|
|
492
|
+
}, []);
|
|
493
|
+
(0, import_react2.useEffect)(() => {
|
|
494
|
+
setShowNetworkDetails(false);
|
|
495
|
+
}, [execution?.id]);
|
|
496
|
+
const isPending = execution.status === import_core2.ExecutionStatus.PENDING || execution.status === import_core2.ExecutionStatus.WAITING || execution.status === import_core2.ExecutionStatus.DELAYED;
|
|
685
497
|
const formatDateTime = (timestamp) => {
|
|
686
498
|
try {
|
|
687
499
|
const date = new Date(timestamp);
|
|
@@ -736,177 +548,169 @@ function DepositDetailModal({
|
|
|
736
548
|
return "$0.00";
|
|
737
549
|
};
|
|
738
550
|
const getNetworkName = (chainType, chainId) => {
|
|
739
|
-
return
|
|
740
|
-
};
|
|
741
|
-
const getSourceTokenSymbol = () => {
|
|
742
|
-
return "USDC";
|
|
551
|
+
return (0, import_core2.getChainName)(chains, chainType, chainId);
|
|
743
552
|
};
|
|
744
|
-
const
|
|
745
|
-
return
|
|
553
|
+
const formatTransactionHash = (hash) => {
|
|
554
|
+
if (!hash || hash.length < 12) return hash;
|
|
555
|
+
return `${hash.slice(0, 12)}...${hash.slice(-4)}`;
|
|
746
556
|
};
|
|
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",
|
|
557
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "uf-px-2", children: [
|
|
558
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "uf-flex uf-flex-col uf-items-center uf-py-6", children: [
|
|
559
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "uf-relative uf-mb-3", children: [
|
|
560
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
561
|
+
"img",
|
|
562
|
+
{
|
|
563
|
+
src: execution.destination_token_metadata?.icon_url || (0, import_core2.getIconUrl)("/icons/tokens/svg/usdc.svg"),
|
|
564
|
+
alt: "Token",
|
|
565
|
+
width: 64,
|
|
566
|
+
height: 64,
|
|
567
|
+
className: "uf-rounded-full"
|
|
568
|
+
}
|
|
569
|
+
),
|
|
570
|
+
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)(
|
|
571
|
+
"svg",
|
|
572
|
+
{
|
|
573
|
+
width: "16",
|
|
574
|
+
height: "16",
|
|
575
|
+
viewBox: "0 0 24 24",
|
|
576
|
+
fill: "none",
|
|
577
|
+
className: "uf-animate-spin uf-block",
|
|
578
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
579
|
+
"path",
|
|
854
580
|
{
|
|
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
|
-
]
|
|
581
|
+
d: "M21 12a9 9 0 1 1-6.22-8.56",
|
|
582
|
+
stroke: "white",
|
|
583
|
+
strokeWidth: "3",
|
|
584
|
+
strokeLinecap: "round"
|
|
866
585
|
}
|
|
867
|
-
)
|
|
868
|
-
|
|
869
|
-
|
|
586
|
+
)
|
|
587
|
+
}
|
|
588
|
+
) }) : /* @__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)(
|
|
589
|
+
"svg",
|
|
590
|
+
{
|
|
591
|
+
width: "16",
|
|
592
|
+
height: "16",
|
|
593
|
+
viewBox: "0 0 12 12",
|
|
594
|
+
fill: "none",
|
|
595
|
+
className: "uf-block",
|
|
596
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
597
|
+
"path",
|
|
870
598
|
{
|
|
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
|
-
]
|
|
599
|
+
d: "M10 3L4.5 8.5L2 6",
|
|
600
|
+
stroke: "white",
|
|
601
|
+
strokeWidth: "2",
|
|
602
|
+
strokeLinecap: "round",
|
|
603
|
+
strokeLinejoin: "round"
|
|
882
604
|
}
|
|
883
605
|
)
|
|
884
|
-
|
|
885
|
-
|
|
606
|
+
}
|
|
607
|
+
) })
|
|
608
|
+
] }),
|
|
609
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-1.5 uf-mb-1", children: [
|
|
610
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
611
|
+
"div",
|
|
612
|
+
{
|
|
613
|
+
className: `uf-w-2 uf-h-2 uf-rounded-full ${isPending ? "uf-bg-yellow-500" : "uf-bg-green-500"}`
|
|
614
|
+
}
|
|
615
|
+
),
|
|
616
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "uf-text-foreground uf-font-medium", children: isPending ? "Processing" : "Completed" })
|
|
617
|
+
] }),
|
|
618
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: formatDateTime(execution.created_at || (/* @__PURE__ */ new Date()).toISOString()) })
|
|
619
|
+
] }),
|
|
620
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "uf-bg-secondary uf-rounded-xl uf-overflow-hidden uf-mb-3", children: [
|
|
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 Sent" }),
|
|
623
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "uf-text-foreground uf-font-medium", children: [
|
|
624
|
+
formatAmount(execution.source_amount_base_unit),
|
|
625
|
+
" ",
|
|
626
|
+
formatCurrency(execution.source_currency)
|
|
886
627
|
] })
|
|
887
|
-
]
|
|
888
|
-
|
|
889
|
-
|
|
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: "Amount Received" }),
|
|
631
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "uf-text-foreground uf-font-medium", children: [
|
|
632
|
+
formatAmount(execution.destination_amount_base_unit),
|
|
633
|
+
" ",
|
|
634
|
+
formatCurrency(execution.destination_currency)
|
|
635
|
+
] })
|
|
636
|
+
] }),
|
|
637
|
+
/* @__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: [
|
|
638
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "USD Value" }),
|
|
639
|
+
/* @__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) })
|
|
640
|
+
] }),
|
|
641
|
+
/* @__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: [
|
|
642
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Source Network" }),
|
|
643
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "uf-text-foreground uf-font-medium", children: getNetworkName(execution.source_chain_type, execution.source_chain_id) })
|
|
644
|
+
] }),
|
|
645
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3", children: [
|
|
646
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Destination Network" }),
|
|
647
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "uf-text-foreground uf-font-medium", children: getNetworkName(execution.destination_chain_type, execution.destination_chain_id) })
|
|
648
|
+
] })
|
|
649
|
+
] }),
|
|
650
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
651
|
+
"button",
|
|
652
|
+
{
|
|
653
|
+
type: "button",
|
|
654
|
+
onClick: () => setShowNetworkDetails(!showNetworkDetails),
|
|
655
|
+
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",
|
|
656
|
+
children: [
|
|
657
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: showNetworkDetails ? "See less" : "See more details" }),
|
|
658
|
+
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" })
|
|
659
|
+
]
|
|
660
|
+
}
|
|
661
|
+
),
|
|
662
|
+
showNetworkDetails && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "uf-bg-secondary uf-rounded-xl uf-overflow-hidden uf-mb-4", children: [
|
|
663
|
+
execution.transaction_hash && execution.explorer_url && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
664
|
+
"a",
|
|
665
|
+
{
|
|
666
|
+
href: execution.explorer_url,
|
|
667
|
+
target: "_blank",
|
|
668
|
+
rel: "noopener noreferrer",
|
|
669
|
+
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",
|
|
670
|
+
children: [
|
|
671
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "uf-text-muted-foreground uf-text-sm", children: "Deposit Tx" }),
|
|
672
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "uf-text-sm uf-text-foreground uf-text-right", children: formatTransactionHash(execution.transaction_hash) }),
|
|
673
|
+
/* @__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" })
|
|
674
|
+
]
|
|
675
|
+
}
|
|
676
|
+
),
|
|
677
|
+
!isPending && execution.destination_transaction_hashes?.length > 0 && execution.destination_explorer_url && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
678
|
+
"a",
|
|
679
|
+
{
|
|
680
|
+
href: execution.destination_explorer_url,
|
|
681
|
+
target: "_blank",
|
|
682
|
+
rel: "noopener noreferrer",
|
|
683
|
+
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",
|
|
684
|
+
children: [
|
|
685
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "uf-text-muted-foreground uf-text-sm", children: "Completion Tx" }),
|
|
686
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "uf-text-sm uf-text-foreground uf-text-right", children: formatTransactionHash(execution.destination_transaction_hashes[0]) }),
|
|
687
|
+
/* @__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" })
|
|
688
|
+
]
|
|
689
|
+
}
|
|
690
|
+
)
|
|
691
|
+
] })
|
|
692
|
+
] });
|
|
890
693
|
}
|
|
891
694
|
|
|
892
695
|
// src/components/deposits/DepositsModal.tsx
|
|
696
|
+
var import_core3 = require("@unifold/core");
|
|
893
697
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
894
698
|
function DepositsModal({
|
|
895
699
|
open,
|
|
896
700
|
onOpenChange,
|
|
701
|
+
onCloseAll,
|
|
897
702
|
executions: sessionExecutions,
|
|
898
703
|
userId,
|
|
899
704
|
publishableKey,
|
|
900
705
|
themeClass = ""
|
|
901
706
|
}) {
|
|
902
|
-
const [allExecutions, setAllExecutions] = (0,
|
|
903
|
-
const [selectedExecution, setSelectedExecution] = (0,
|
|
904
|
-
|
|
905
|
-
(0, import_react2.useEffect)(() => {
|
|
707
|
+
const [allExecutions, setAllExecutions] = (0, import_react3.useState)(sessionExecutions);
|
|
708
|
+
const [selectedExecution, setSelectedExecution] = (0, import_react3.useState)(null);
|
|
709
|
+
(0, import_react3.useEffect)(() => {
|
|
906
710
|
if (!open || !userId) return;
|
|
907
711
|
const fetchExecutions = async () => {
|
|
908
712
|
try {
|
|
909
|
-
const response = await queryExecutions(userId, publishableKey);
|
|
713
|
+
const response = await (0, import_core3.queryExecutions)(userId, publishableKey);
|
|
910
714
|
const sorted = [...response.data].sort((a, b) => {
|
|
911
715
|
const timeA = a.created_at ? new Date(a.created_at).getTime() : 0;
|
|
912
716
|
const timeB = b.created_at ? new Date(b.created_at).getTime() : 0;
|
|
@@ -924,39 +728,61 @@ function DepositsModal({
|
|
|
924
728
|
clearInterval(pollInterval);
|
|
925
729
|
};
|
|
926
730
|
}, [open, userId, publishableKey, sessionExecutions]);
|
|
731
|
+
(0, import_react3.useEffect)(() => {
|
|
732
|
+
if (!open) {
|
|
733
|
+
setSelectedExecution(null);
|
|
734
|
+
}
|
|
735
|
+
}, [open]);
|
|
736
|
+
const handleBack = () => {
|
|
737
|
+
if (selectedExecution) {
|
|
738
|
+
setSelectedExecution(null);
|
|
739
|
+
} else {
|
|
740
|
+
onOpenChange(false);
|
|
741
|
+
}
|
|
742
|
+
};
|
|
927
743
|
const handleClose = () => {
|
|
928
744
|
onOpenChange(false);
|
|
745
|
+
onCloseAll?.();
|
|
929
746
|
};
|
|
930
747
|
const handleExecutionClick = (execution) => {
|
|
931
748
|
setSelectedExecution(execution);
|
|
932
|
-
setDetailModalOpen(true);
|
|
933
749
|
};
|
|
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
|
-
] }) }),
|
|
750
|
+
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
751
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
947
|
-
|
|
752
|
+
DepositHeader,
|
|
948
753
|
{
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
754
|
+
title: "Deposit Details",
|
|
755
|
+
showBack: true,
|
|
756
|
+
onBack: () => setSelectedExecution(null),
|
|
757
|
+
onClose: handleClose
|
|
953
758
|
}
|
|
954
|
-
)
|
|
955
|
-
|
|
759
|
+
),
|
|
760
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DepositDetailContent, { execution: selectedExecution })
|
|
761
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
762
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
763
|
+
DepositHeader,
|
|
764
|
+
{
|
|
765
|
+
title: "Deposit Tracker",
|
|
766
|
+
showBack: true,
|
|
767
|
+
onBack: handleBack,
|
|
768
|
+
onClose: handleClose
|
|
769
|
+
}
|
|
770
|
+
),
|
|
771
|
+
/* @__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)(
|
|
772
|
+
DepositExecutionItem,
|
|
773
|
+
{
|
|
774
|
+
execution,
|
|
775
|
+
onClick: () => handleExecutionClick(execution)
|
|
776
|
+
},
|
|
777
|
+
execution.id
|
|
778
|
+
)) }) }) })
|
|
779
|
+
] }) }) });
|
|
956
780
|
}
|
|
957
781
|
|
|
958
782
|
// src/components/deposits/DepositSuccessToast.tsx
|
|
783
|
+
var import_react4 = require("react");
|
|
959
784
|
var import_lucide_react5 = require("lucide-react");
|
|
785
|
+
var import_core4 = require("@unifold/core");
|
|
960
786
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
961
787
|
function DepositSuccessToast({
|
|
962
788
|
depositTx,
|
|
@@ -964,9 +790,12 @@ function DepositSuccessToast({
|
|
|
964
790
|
status,
|
|
965
791
|
tokenIconUrl,
|
|
966
792
|
sourceAmountBaseUnit = "0",
|
|
967
|
-
onClose
|
|
793
|
+
onClose,
|
|
794
|
+
execution
|
|
968
795
|
}) {
|
|
969
|
-
const
|
|
796
|
+
const [detailModalOpen, setDetailModalOpen] = (0, import_react4.useState)(false);
|
|
797
|
+
const { themeClass } = useTheme();
|
|
798
|
+
const isPending = status === import_core4.ExecutionStatus.PENDING || status === import_core4.ExecutionStatus.WAITING || status === import_core4.ExecutionStatus.DELAYED;
|
|
970
799
|
const formatDateTime = (timestamp) => {
|
|
971
800
|
try {
|
|
972
801
|
const date = new Date(timestamp);
|
|
@@ -998,61 +827,124 @@ function DepositSuccessToast({
|
|
|
998
827
|
return "$0.00";
|
|
999
828
|
}
|
|
1000
829
|
};
|
|
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)(
|
|
830
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
831
|
+
isPending && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("style", { children: `
|
|
832
|
+
@keyframes border-travel {
|
|
833
|
+
from { stroke-dashoffset: 0; }
|
|
834
|
+
to { stroke-dashoffset: -1000; }
|
|
835
|
+
}
|
|
836
|
+
` }),
|
|
837
|
+
/* @__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: [
|
|
838
|
+
isPending && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1014
839
|
"svg",
|
|
1015
840
|
{
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
viewBox: "0 0 12 12",
|
|
1019
|
-
fill: "none",
|
|
1020
|
-
className: "uf-animate-spin",
|
|
841
|
+
className: "uf-absolute uf-inset-0 uf-w-full uf-h-full uf-pointer-events-none uf-z-[1]",
|
|
842
|
+
style: { overflow: "visible" },
|
|
1021
843
|
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1022
|
-
"
|
|
844
|
+
"rect",
|
|
1023
845
|
{
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
846
|
+
x: "5",
|
|
847
|
+
y: "2",
|
|
848
|
+
rx: "10",
|
|
849
|
+
ry: "10",
|
|
850
|
+
fill: "none",
|
|
851
|
+
stroke: "#ecc94b",
|
|
852
|
+
strokeWidth: "3",
|
|
853
|
+
strokeDasharray: "120 880",
|
|
854
|
+
strokeLinecap: "round",
|
|
855
|
+
pathLength: "1000",
|
|
856
|
+
style: {
|
|
857
|
+
width: "calc(100% - 10px)",
|
|
858
|
+
height: "calc(100% - 4px)",
|
|
859
|
+
animation: "border-travel 2.5s linear infinite"
|
|
860
|
+
}
|
|
1028
861
|
}
|
|
1029
862
|
)
|
|
1030
863
|
}
|
|
1031
|
-
)
|
|
1032
|
-
|
|
864
|
+
),
|
|
865
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
866
|
+
"div",
|
|
1033
867
|
{
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
868
|
+
onClick: () => execution && setDetailModalOpen(true),
|
|
869
|
+
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"}`,
|
|
870
|
+
children: [
|
|
871
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "uf-relative uf-flex-shrink-0", children: [
|
|
872
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
873
|
+
"img",
|
|
874
|
+
{
|
|
875
|
+
src: tokenIconUrl || (0, import_core4.getIconUrl)("/icons/tokens/svg/usdc.svg"),
|
|
876
|
+
alt: "Token",
|
|
877
|
+
width: 36,
|
|
878
|
+
height: 36,
|
|
879
|
+
className: "uf-rounded-full"
|
|
880
|
+
}
|
|
881
|
+
),
|
|
882
|
+
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)(
|
|
883
|
+
"svg",
|
|
884
|
+
{
|
|
885
|
+
width: "10",
|
|
886
|
+
height: "10",
|
|
887
|
+
viewBox: "0 0 24 24",
|
|
888
|
+
fill: "none",
|
|
889
|
+
className: "uf-animate-spin",
|
|
890
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
891
|
+
"path",
|
|
892
|
+
{
|
|
893
|
+
d: "M21 12a9 9 0 1 1-6.22-8.56",
|
|
894
|
+
stroke: "white",
|
|
895
|
+
strokeWidth: "3",
|
|
896
|
+
strokeLinecap: "round"
|
|
897
|
+
}
|
|
898
|
+
)
|
|
899
|
+
}
|
|
900
|
+
) }) : /* @__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)(
|
|
901
|
+
"path",
|
|
902
|
+
{
|
|
903
|
+
d: "M10 3L4.5 8.5L2 6",
|
|
904
|
+
stroke: "white",
|
|
905
|
+
strokeWidth: "2",
|
|
906
|
+
strokeLinecap: "round",
|
|
907
|
+
strokeLinejoin: "round"
|
|
908
|
+
}
|
|
909
|
+
) }) })
|
|
910
|
+
] }),
|
|
911
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "uf-flex-1 uf-min-w-0", children: [
|
|
912
|
+
/* @__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" }),
|
|
913
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "uf-text-zinc-600 dark:uf-text-zinc-400 uf-text-xs", children: formatDateTime(orderSubmittedAt) })
|
|
914
|
+
] }),
|
|
915
|
+
/* @__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) }),
|
|
916
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
917
|
+
"button",
|
|
918
|
+
{
|
|
919
|
+
onClick: (e) => {
|
|
920
|
+
e.stopPropagation();
|
|
921
|
+
onClose();
|
|
922
|
+
},
|
|
923
|
+
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",
|
|
924
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react5.X, { className: "uf-w-4 uf-h-4" })
|
|
925
|
+
}
|
|
926
|
+
)
|
|
927
|
+
]
|
|
1039
928
|
}
|
|
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
|
-
|
|
929
|
+
)
|
|
930
|
+
] }) }),
|
|
931
|
+
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: [
|
|
932
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "uf-flex uf-items-center uf-justify-between uf-px-4", children: [
|
|
933
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "uf-w-8" }),
|
|
934
|
+
" ",
|
|
935
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("h2", { className: "uf-text-lg uf-font-semibold uf-text-foreground", children: "Deposit Details" }),
|
|
936
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
937
|
+
"button",
|
|
938
|
+
{
|
|
939
|
+
onClick: () => setDetailModalOpen(false),
|
|
940
|
+
className: "uf-text-muted-foreground hover:uf-text-foreground uf-transition-colors uf-w-8 uf-flex uf-justify-end",
|
|
941
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react5.X, { className: "uf-w-5 uf-h-5" })
|
|
942
|
+
}
|
|
943
|
+
)
|
|
944
|
+
] }),
|
|
945
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DepositDetailContent, { execution })
|
|
946
|
+
] }) })
|
|
947
|
+
] });
|
|
1056
948
|
}
|
|
1057
949
|
|
|
1058
950
|
// src/components/shared/select.tsx
|
|
@@ -1172,61 +1064,16 @@ var SelectSeparator = React3.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
1172
1064
|
));
|
|
1173
1065
|
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
1174
1066
|
|
|
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
1067
|
// src/components/shared/tooltip.tsx
|
|
1221
|
-
var
|
|
1068
|
+
var React4 = __toESM(require("react"));
|
|
1222
1069
|
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"));
|
|
1223
|
-
var
|
|
1070
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1224
1071
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
1225
1072
|
var Tooltip = TooltipPrimitive.Root;
|
|
1226
1073
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
1227
|
-
var TooltipContent =
|
|
1074
|
+
var TooltipContent = React4.forwardRef(({ className, sideOffset = 4, ...props }, ref) => {
|
|
1228
1075
|
const { themeClass } = useTheme();
|
|
1229
|
-
return /* @__PURE__ */ (0,
|
|
1076
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TooltipPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1230
1077
|
TooltipPrimitive.Content,
|
|
1231
1078
|
{
|
|
1232
1079
|
ref,
|
|
@@ -1242,6 +1089,9 @@ var TooltipContent = React5.forwardRef(({ className, sideOffset = 4, ...props },
|
|
|
1242
1089
|
});
|
|
1243
1090
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
1244
1091
|
|
|
1092
|
+
// src/components/deposits/TransferCryptoBase.tsx
|
|
1093
|
+
var import_core5 = require("@unifold/core");
|
|
1094
|
+
|
|
1245
1095
|
// src/lib/i18n/en.json
|
|
1246
1096
|
var en_default = {
|
|
1247
1097
|
transferCrypto: {
|
|
@@ -1312,7 +1162,7 @@ var en_default = {
|
|
|
1312
1162
|
var i18n = en_default;
|
|
1313
1163
|
|
|
1314
1164
|
// src/components/deposits/TransferCryptoBase.tsx
|
|
1315
|
-
var
|
|
1165
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1316
1166
|
var t = i18n.transferCrypto;
|
|
1317
1167
|
var getChainKey = (chainId, chainType) => {
|
|
1318
1168
|
return `${chainType}:${chainId}`;
|
|
@@ -1328,7 +1178,6 @@ function TransferCryptoBase({
|
|
|
1328
1178
|
destinationChainType,
|
|
1329
1179
|
destinationChainId,
|
|
1330
1180
|
destinationTokenAddress,
|
|
1331
|
-
copyButtonMode = "compact",
|
|
1332
1181
|
layoutVariant = "horizontal",
|
|
1333
1182
|
showDetailedDropdowns = false,
|
|
1334
1183
|
onExecutionsChange,
|
|
@@ -1338,20 +1187,20 @@ function TransferCryptoBase({
|
|
|
1338
1187
|
}) {
|
|
1339
1188
|
const { themeClass } = useTheme();
|
|
1340
1189
|
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,
|
|
1190
|
+
const [token, setToken] = (0, import_react5.useState)("USDC");
|
|
1191
|
+
const [chain, setChain] = (0, import_react5.useState)("solana:mainnet");
|
|
1192
|
+
const [copied, setCopied] = (0, import_react5.useState)(false);
|
|
1193
|
+
const [internalWallets, setInternalWallets] = (0, import_react5.useState)([]);
|
|
1194
|
+
const [loading, setLoading] = (0, import_react5.useState)(!externalWallets?.length);
|
|
1346
1195
|
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,
|
|
1196
|
+
const [error, setError] = (0, import_react5.useState)(null);
|
|
1197
|
+
const [depositExecutions, setDepositExecutions] = (0, import_react5.useState)([]);
|
|
1198
|
+
const [trackedExecutions, setTrackedExecutions] = (0, import_react5.useState)(/* @__PURE__ */ new Map());
|
|
1199
|
+
const [modalOpenedAt, setModalOpenedAt] = (0, import_react5.useState)(null);
|
|
1200
|
+
const [supportedTokens, setSupportedTokens] = (0, import_react5.useState)([]);
|
|
1201
|
+
const [tokensLoading, setTokensLoading] = (0, import_react5.useState)(true);
|
|
1202
|
+
const [detailsExpanded, setDetailsExpanded] = (0, import_react5.useState)(false);
|
|
1203
|
+
const [depositsModalOpen, setDepositsModalOpen] = (0, import_react5.useState)(false);
|
|
1355
1204
|
const allChainsMap = /* @__PURE__ */ new Map();
|
|
1356
1205
|
supportedTokens.forEach((t4) => {
|
|
1357
1206
|
t4.chains.forEach((c) => {
|
|
@@ -1367,16 +1216,16 @@ function TransferCryptoBase({
|
|
|
1367
1216
|
(c) => c.chain_type === currentChainCombo.chainType && c.chain_id === currentChainCombo.chainId
|
|
1368
1217
|
);
|
|
1369
1218
|
const currentChainType = currentChainData?.chain_type || "ethereum";
|
|
1370
|
-
const currentWallet = getWalletByChainType(wallets, currentChainType);
|
|
1219
|
+
const currentWallet = (0, import_core5.getWalletByChainType)(wallets, currentChainType);
|
|
1371
1220
|
const depositAddress = currentWallet?.address || "";
|
|
1372
|
-
(0,
|
|
1221
|
+
(0, import_react5.useEffect)(() => {
|
|
1373
1222
|
setModalOpenedAt(/* @__PURE__ */ new Date());
|
|
1374
1223
|
}, []);
|
|
1375
|
-
(0,
|
|
1224
|
+
(0, import_react5.useEffect)(() => {
|
|
1376
1225
|
async function fetchSupportedTokens() {
|
|
1377
1226
|
try {
|
|
1378
1227
|
setTokensLoading(true);
|
|
1379
|
-
const response = await getSupportedDepositTokens(publishableKey);
|
|
1228
|
+
const response = await (0, import_core5.getSupportedDepositTokens)(publishableKey);
|
|
1380
1229
|
setSupportedTokens(response.data);
|
|
1381
1230
|
if (response.data.length > 0) {
|
|
1382
1231
|
const allChains = /* @__PURE__ */ new Set();
|
|
@@ -1401,25 +1250,29 @@ function TransferCryptoBase({
|
|
|
1401
1250
|
}
|
|
1402
1251
|
fetchSupportedTokens();
|
|
1403
1252
|
}, [publishableKey, chain]);
|
|
1404
|
-
(0,
|
|
1253
|
+
(0, import_react5.useEffect)(() => {
|
|
1405
1254
|
if (onExecutionsChange) {
|
|
1406
1255
|
onExecutionsChange(depositExecutions);
|
|
1407
1256
|
}
|
|
1408
1257
|
}, [depositExecutions, onExecutionsChange]);
|
|
1409
|
-
(0,
|
|
1258
|
+
(0, import_react5.useEffect)(() => {
|
|
1410
1259
|
if (externalWallets?.length) {
|
|
1411
1260
|
setLoading(false);
|
|
1412
1261
|
return;
|
|
1413
1262
|
}
|
|
1263
|
+
if (internalWallets.length > 0) {
|
|
1264
|
+
setLoading(false);
|
|
1265
|
+
return;
|
|
1266
|
+
}
|
|
1414
1267
|
let retryTimeout = null;
|
|
1415
1268
|
let isCancelled = false;
|
|
1416
1269
|
const fetchWallets = async () => {
|
|
1417
1270
|
if (isCancelled) return;
|
|
1418
1271
|
setLoading(true);
|
|
1419
1272
|
try {
|
|
1420
|
-
const response = await
|
|
1273
|
+
const response = await (0, import_core5.createDepositAddress)(
|
|
1421
1274
|
{
|
|
1422
|
-
|
|
1275
|
+
external_user_id: userId,
|
|
1423
1276
|
recipient_address: recipientAddress,
|
|
1424
1277
|
destination_chain_type: destinationChainType,
|
|
1425
1278
|
destination_chain_id: destinationChainId,
|
|
@@ -1457,7 +1310,7 @@ function TransferCryptoBase({
|
|
|
1457
1310
|
publishableKey,
|
|
1458
1311
|
externalWallets
|
|
1459
1312
|
]);
|
|
1460
|
-
(0,
|
|
1313
|
+
(0, import_react5.useEffect)(() => {
|
|
1461
1314
|
if (!supportedTokens.length) return;
|
|
1462
1315
|
const currentToken = supportedTokens.find((t4) => t4.symbol === token);
|
|
1463
1316
|
if (!currentToken || currentToken.chains.length === 0) return;
|
|
@@ -1471,11 +1324,11 @@ function TransferCryptoBase({
|
|
|
1471
1324
|
setChain(newChain);
|
|
1472
1325
|
}
|
|
1473
1326
|
}, [token, supportedTokens, chain]);
|
|
1474
|
-
(0,
|
|
1327
|
+
(0, import_react5.useEffect)(() => {
|
|
1475
1328
|
if (!userId || !modalOpenedAt) return;
|
|
1476
1329
|
const pollInterval = setInterval(async () => {
|
|
1477
1330
|
try {
|
|
1478
|
-
const response = await queryExecutions(userId, publishableKey);
|
|
1331
|
+
const response = await (0, import_core5.queryExecutions)(userId, publishableKey);
|
|
1479
1332
|
let executionToShow = null;
|
|
1480
1333
|
for (const execution of response.data) {
|
|
1481
1334
|
const executionTime = execution.created_at ? new Date(execution.created_at) : null;
|
|
@@ -1488,11 +1341,11 @@ function TransferCryptoBase({
|
|
|
1488
1341
|
break;
|
|
1489
1342
|
}
|
|
1490
1343
|
const inProgressStatuses = [
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1344
|
+
import_core5.ExecutionStatus.PENDING,
|
|
1345
|
+
import_core5.ExecutionStatus.WAITING,
|
|
1346
|
+
import_core5.ExecutionStatus.DELAYED
|
|
1494
1347
|
];
|
|
1495
|
-
if (inProgressStatuses.includes(trackedStatus) && execution.status ===
|
|
1348
|
+
if (inProgressStatuses.includes(trackedStatus) && execution.status === import_core5.ExecutionStatus.SUCCEEDED) {
|
|
1496
1349
|
executionToShow = execution;
|
|
1497
1350
|
break;
|
|
1498
1351
|
}
|
|
@@ -1515,7 +1368,7 @@ function TransferCryptoBase({
|
|
|
1515
1368
|
return updated;
|
|
1516
1369
|
});
|
|
1517
1370
|
if (onDepositSuccess) {
|
|
1518
|
-
const isCompleted = execution.status ===
|
|
1371
|
+
const isCompleted = execution.status === import_core5.ExecutionStatus.SUCCEEDED;
|
|
1519
1372
|
if (isCompleted) {
|
|
1520
1373
|
onDepositSuccess({
|
|
1521
1374
|
message: "Deposit completed successfully",
|
|
@@ -1578,8 +1431,8 @@ function TransferCryptoBase({
|
|
|
1578
1431
|
const processingTime = currentChainFromBackend?.estimated_processing_time ?? null;
|
|
1579
1432
|
const minDepositUsd = currentChainFromBackend?.minimum_deposit_amount_usd ?? 3;
|
|
1580
1433
|
const renderTokenItem = (tokenData) => {
|
|
1581
|
-
return /* @__PURE__ */ (0,
|
|
1582
|
-
/* @__PURE__ */ (0,
|
|
1434
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
1435
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1583
1436
|
"img",
|
|
1584
1437
|
{
|
|
1585
1438
|
src: tokenData.icon_url,
|
|
@@ -1589,13 +1442,13 @@ function TransferCryptoBase({
|
|
|
1589
1442
|
className: "uf-rounded-full uf-flex-shrink-0"
|
|
1590
1443
|
}
|
|
1591
1444
|
),
|
|
1592
|
-
/* @__PURE__ */ (0,
|
|
1593
|
-
showDetailedDropdowns && /* @__PURE__ */ (0,
|
|
1445
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "uf-text-xs uf-font-normal", children: tokenData.symbol }),
|
|
1446
|
+
showDetailedDropdowns && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "uf-text-xs uf-text-muted-foreground", children: tokenData.name })
|
|
1594
1447
|
] });
|
|
1595
1448
|
};
|
|
1596
1449
|
const renderChainItem = (chainData) => {
|
|
1597
|
-
return /* @__PURE__ */ (0,
|
|
1598
|
-
/* @__PURE__ */ (0,
|
|
1450
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
1451
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1599
1452
|
"img",
|
|
1600
1453
|
{
|
|
1601
1454
|
src: chainData.icon_url,
|
|
@@ -1605,24 +1458,24 @@ function TransferCryptoBase({
|
|
|
1605
1458
|
className: "uf-rounded-full uf-flex-shrink-0"
|
|
1606
1459
|
}
|
|
1607
1460
|
),
|
|
1608
|
-
/* @__PURE__ */ (0,
|
|
1609
|
-
showDetailedDropdowns && /* @__PURE__ */ (0,
|
|
1461
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "uf-text-xs uf-font-normal", children: chainData.chain_name }),
|
|
1462
|
+
showDetailedDropdowns && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "uf-text-xs uf-text-muted-foreground uf-capitalize", children: chainData.chain_type })
|
|
1610
1463
|
] });
|
|
1611
1464
|
};
|
|
1612
1465
|
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,
|
|
1466
|
+
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: [
|
|
1467
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: selectContainerClass, children: [
|
|
1468
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { children: [
|
|
1469
|
+
/* @__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 }),
|
|
1470
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1618
1471
|
Select,
|
|
1619
1472
|
{
|
|
1620
1473
|
value: token,
|
|
1621
1474
|
onValueChange: setToken,
|
|
1622
1475
|
disabled: tokensLoading || supportedTokens.length === 0,
|
|
1623
1476
|
children: [
|
|
1624
|
-
/* @__PURE__ */ (0,
|
|
1625
|
-
/* @__PURE__ */ (0,
|
|
1477
|
+
/* @__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 }) }) }) }),
|
|
1478
|
+
/* @__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
1479
|
SelectItem,
|
|
1627
1480
|
{
|
|
1628
1481
|
value: tokenData.symbol,
|
|
@@ -1635,51 +1488,51 @@ function TransferCryptoBase({
|
|
|
1635
1488
|
}
|
|
1636
1489
|
)
|
|
1637
1490
|
] }),
|
|
1638
|
-
/* @__PURE__ */ (0,
|
|
1639
|
-
/* @__PURE__ */ (0,
|
|
1491
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { children: [
|
|
1492
|
+
/* @__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
1493
|
t.supportedChain,
|
|
1641
|
-
/* @__PURE__ */ (0,
|
|
1494
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "uf-text-[10px]", children: [
|
|
1642
1495
|
"$",
|
|
1643
1496
|
minDepositUsd,
|
|
1644
1497
|
" ",
|
|
1645
1498
|
t.minDeposit.label
|
|
1646
1499
|
] }),
|
|
1647
|
-
/* @__PURE__ */ (0,
|
|
1648
|
-
/* @__PURE__ */ (0,
|
|
1500
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Tooltip, { children: [
|
|
1501
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1649
1502
|
"span",
|
|
1650
1503
|
{
|
|
1651
1504
|
className: "uf-inline-flex uf-cursor-pointer uf-transition-colors hover:uf-text-foreground",
|
|
1652
1505
|
tabIndex: 0,
|
|
1653
1506
|
role: "button",
|
|
1654
1507
|
"aria-label": "Minimum deposit information",
|
|
1655
|
-
children: /* @__PURE__ */ (0,
|
|
1508
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react7.Info, { className: "uf-w-3 uf-h-3" })
|
|
1656
1509
|
}
|
|
1657
1510
|
) }),
|
|
1658
|
-
/* @__PURE__ */ (0,
|
|
1511
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1659
1512
|
TooltipContent,
|
|
1660
1513
|
{
|
|
1661
1514
|
side: "left",
|
|
1662
1515
|
align: "center",
|
|
1663
1516
|
className: "uf-max-w-[200px]",
|
|
1664
|
-
children: /* @__PURE__ */ (0,
|
|
1517
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { children: t.minDeposit.tooltip })
|
|
1665
1518
|
}
|
|
1666
1519
|
)
|
|
1667
1520
|
] })
|
|
1668
1521
|
] }),
|
|
1669
|
-
/* @__PURE__ */ (0,
|
|
1522
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1670
1523
|
Select,
|
|
1671
1524
|
{
|
|
1672
1525
|
value: chain,
|
|
1673
1526
|
onValueChange: setChain,
|
|
1674
1527
|
disabled: tokensLoading || availableChainsForToken.length === 0,
|
|
1675
1528
|
children: [
|
|
1676
|
-
/* @__PURE__ */ (0,
|
|
1677
|
-
/* @__PURE__ */ (0,
|
|
1529
|
+
/* @__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 }) }) }) }),
|
|
1530
|
+
/* @__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
1531
|
const chainKey = getChainKey(
|
|
1679
1532
|
chainData.chain_id,
|
|
1680
1533
|
chainData.chain_type
|
|
1681
1534
|
);
|
|
1682
|
-
return /* @__PURE__ */ (0,
|
|
1535
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1683
1536
|
SelectItem,
|
|
1684
1537
|
{
|
|
1685
1538
|
value: chainKey,
|
|
@@ -1694,14 +1547,14 @@ function TransferCryptoBase({
|
|
|
1694
1547
|
)
|
|
1695
1548
|
] })
|
|
1696
1549
|
] }),
|
|
1697
|
-
/* @__PURE__ */ (0,
|
|
1550
|
+
/* @__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
1551
|
"div",
|
|
1699
1552
|
{
|
|
1700
1553
|
className: "uf-flex uf-items-center uf-justify-center",
|
|
1701
1554
|
style: { width: 180, height: 180 },
|
|
1702
|
-
children: /* @__PURE__ */ (0,
|
|
1555
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "uf-text-foreground uf-text-sm", children: t.loadingQRCode })
|
|
1703
1556
|
}
|
|
1704
|
-
) : depositAddress ? /* @__PURE__ */ (0,
|
|
1557
|
+
) : depositAddress ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1705
1558
|
StyledQRCode,
|
|
1706
1559
|
{
|
|
1707
1560
|
value: depositAddress,
|
|
@@ -1711,93 +1564,75 @@ function TransferCryptoBase({
|
|
|
1711
1564
|
darkMode: isDarkMode
|
|
1712
1565
|
},
|
|
1713
1566
|
`qr-${depositAddress}-${chain}`
|
|
1714
|
-
) : /* @__PURE__ */ (0,
|
|
1567
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1715
1568
|
"div",
|
|
1716
1569
|
{
|
|
1717
1570
|
className: "uf-flex uf-items-center uf-justify-center",
|
|
1718
1571
|
style: { width: 180, height: 180 },
|
|
1719
|
-
children: /* @__PURE__ */ (0,
|
|
1572
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "uf-text-red-400 uf-text-sm", children: t.noAddressAvailable })
|
|
1720
1573
|
}
|
|
1721
1574
|
) }) }),
|
|
1722
|
-
/* @__PURE__ */ (0,
|
|
1723
|
-
/* @__PURE__ */ (0,
|
|
1724
|
-
/* @__PURE__ */ (0,
|
|
1575
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { children: [
|
|
1576
|
+
/* @__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: [
|
|
1577
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-1", children: [
|
|
1725
1578
|
t.depositAddress.label,
|
|
1726
|
-
/* @__PURE__ */ (0,
|
|
1727
|
-
/* @__PURE__ */ (0,
|
|
1579
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Tooltip, { children: [
|
|
1580
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1728
1581
|
"span",
|
|
1729
1582
|
{
|
|
1730
1583
|
className: "uf-inline-flex uf-cursor-pointer uf-transition-colors hover:uf-text-foreground",
|
|
1731
1584
|
tabIndex: 0,
|
|
1732
1585
|
role: "button",
|
|
1733
1586
|
"aria-label": "Deposit address information",
|
|
1734
|
-
children: /* @__PURE__ */ (0,
|
|
1587
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react7.Info, { className: "uf-w-3 uf-h-3" })
|
|
1735
1588
|
}
|
|
1736
1589
|
) }),
|
|
1737
|
-
/* @__PURE__ */ (0,
|
|
1590
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1738
1591
|
TooltipContent,
|
|
1739
1592
|
{
|
|
1740
1593
|
side: "top",
|
|
1741
1594
|
align: "center",
|
|
1742
1595
|
className: "uf-max-w-[240px]",
|
|
1743
|
-
children: /* @__PURE__ */ (0,
|
|
1596
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { children: t.depositAddress.tooltip.replace("{{token}}", token) })
|
|
1744
1597
|
}
|
|
1745
1598
|
)
|
|
1746
1599
|
] })
|
|
1747
1600
|
] }),
|
|
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" }),
|
|
1601
|
+
/* @__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: [
|
|
1602
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react7.Check, { className: "uf-w-3 uf-h-3" }),
|
|
1774
1603
|
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
1604
|
] })
|
|
1779
|
-
}
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1605
|
+
] }),
|
|
1606
|
+
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)(
|
|
1607
|
+
"button",
|
|
1608
|
+
{
|
|
1609
|
+
onClick: handleCopyAddress,
|
|
1610
|
+
disabled: !depositAddress,
|
|
1611
|
+
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",
|
|
1612
|
+
children: depositAddress || t.noAddressAvailable
|
|
1613
|
+
}
|
|
1614
|
+
)
|
|
1615
|
+
] }),
|
|
1616
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "uf-bg-secondary uf-rounded-xl uf-px-3", children: [
|
|
1617
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1783
1618
|
"button",
|
|
1784
1619
|
{
|
|
1785
1620
|
onClick: () => setDetailsExpanded(!detailsExpanded),
|
|
1786
1621
|
className: "uf-w-full uf-flex uf-items-center uf-justify-between uf-py-2.5",
|
|
1787
1622
|
children: [
|
|
1788
|
-
/* @__PURE__ */ (0,
|
|
1789
|
-
/* @__PURE__ */ (0,
|
|
1790
|
-
/* @__PURE__ */ (0,
|
|
1623
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
1624
|
+
/* @__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" }) }),
|
|
1625
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "uf-text-xs", children: [
|
|
1791
1626
|
t.priceImpact.label,
|
|
1792
1627
|
":",
|
|
1793
1628
|
" ",
|
|
1794
|
-
/* @__PURE__ */ (0,
|
|
1629
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "uf-text-foreground", children: [
|
|
1795
1630
|
priceImpact.toFixed(2),
|
|
1796
1631
|
"%"
|
|
1797
1632
|
] })
|
|
1798
1633
|
] }),
|
|
1799
|
-
/* @__PURE__ */ (0,
|
|
1800
|
-
/* @__PURE__ */ (0,
|
|
1634
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Tooltip, { children: [
|
|
1635
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1801
1636
|
"span",
|
|
1802
1637
|
{
|
|
1803
1638
|
className: "uf-inline-flex uf-cursor-pointer uf-text-muted-foreground uf-transition-colors hover:uf-text-foreground",
|
|
@@ -1810,75 +1645,75 @@ function TransferCryptoBase({
|
|
|
1810
1645
|
tabIndex: 0,
|
|
1811
1646
|
role: "button",
|
|
1812
1647
|
"aria-label": "Price impact information",
|
|
1813
|
-
children: /* @__PURE__ */ (0,
|
|
1648
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react7.Info, { className: "uf-w-3 uf-h-3" })
|
|
1814
1649
|
}
|
|
1815
1650
|
) }),
|
|
1816
|
-
/* @__PURE__ */ (0,
|
|
1651
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1817
1652
|
TooltipContent,
|
|
1818
1653
|
{
|
|
1819
1654
|
side: "top",
|
|
1820
1655
|
align: "center",
|
|
1821
1656
|
className: "uf-max-w-[240px]",
|
|
1822
|
-
children: /* @__PURE__ */ (0,
|
|
1657
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { children: t.priceImpact.tooltip })
|
|
1823
1658
|
}
|
|
1824
1659
|
)
|
|
1825
1660
|
] })
|
|
1826
1661
|
] }),
|
|
1827
|
-
detailsExpanded ? /* @__PURE__ */ (0,
|
|
1662
|
+
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
1663
|
]
|
|
1829
1664
|
}
|
|
1830
1665
|
),
|
|
1831
|
-
detailsExpanded && /* @__PURE__ */ (0,
|
|
1832
|
-
/* @__PURE__ */ (0,
|
|
1833
|
-
/* @__PURE__ */ (0,
|
|
1834
|
-
/* @__PURE__ */ (0,
|
|
1666
|
+
detailsExpanded && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "uf-pb-3 uf-space-y-2.5", children: [
|
|
1667
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
1668
|
+
/* @__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" }) }),
|
|
1669
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "uf-text-xs", children: [
|
|
1835
1670
|
t.slippage.label,
|
|
1836
1671
|
":",
|
|
1837
1672
|
" ",
|
|
1838
|
-
/* @__PURE__ */ (0,
|
|
1673
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "uf-text-foreground", children: [
|
|
1839
1674
|
t.slippage.auto,
|
|
1840
1675
|
" \u2022 ",
|
|
1841
1676
|
maxSlippage.toFixed(2),
|
|
1842
1677
|
"%"
|
|
1843
1678
|
] })
|
|
1844
1679
|
] }),
|
|
1845
|
-
/* @__PURE__ */ (0,
|
|
1846
|
-
/* @__PURE__ */ (0,
|
|
1680
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Tooltip, { children: [
|
|
1681
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1847
1682
|
"span",
|
|
1848
1683
|
{
|
|
1849
1684
|
className: "uf-inline-flex uf-cursor-pointer uf-text-muted-foreground uf-transition-colors hover:uf-text-foreground",
|
|
1850
1685
|
tabIndex: 0,
|
|
1851
1686
|
role: "button",
|
|
1852
1687
|
"aria-label": "Slippage information",
|
|
1853
|
-
children: /* @__PURE__ */ (0,
|
|
1688
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react7.Info, { className: "uf-w-3 uf-h-3" })
|
|
1854
1689
|
}
|
|
1855
1690
|
) }),
|
|
1856
|
-
/* @__PURE__ */ (0,
|
|
1691
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1857
1692
|
TooltipContent,
|
|
1858
1693
|
{
|
|
1859
1694
|
side: "top",
|
|
1860
1695
|
align: "center",
|
|
1861
1696
|
className: "uf-max-w-[240px]",
|
|
1862
|
-
children: /* @__PURE__ */ (0,
|
|
1697
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { children: t.slippage.tooltip })
|
|
1863
1698
|
}
|
|
1864
1699
|
)
|
|
1865
1700
|
] })
|
|
1866
1701
|
] }),
|
|
1867
|
-
/* @__PURE__ */ (0,
|
|
1868
|
-
/* @__PURE__ */ (0,
|
|
1869
|
-
/* @__PURE__ */ (0,
|
|
1702
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
1703
|
+
/* @__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" }) }),
|
|
1704
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "uf-text-xs", children: [
|
|
1870
1705
|
t.processingTime.label,
|
|
1871
1706
|
":",
|
|
1872
1707
|
" ",
|
|
1873
|
-
/* @__PURE__ */ (0,
|
|
1708
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "uf-text-foreground", children: formatProcessingTime(processingTime) })
|
|
1874
1709
|
] })
|
|
1875
1710
|
] }),
|
|
1876
|
-
/* @__PURE__ */ (0,
|
|
1877
|
-
/* @__PURE__ */ (0,
|
|
1878
|
-
/* @__PURE__ */ (0,
|
|
1711
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
1712
|
+
/* @__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" }) }),
|
|
1713
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "uf-text-xs", children: [
|
|
1879
1714
|
t.help.needHelp,
|
|
1880
1715
|
" ",
|
|
1881
|
-
/* @__PURE__ */ (0,
|
|
1716
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1882
1717
|
"a",
|
|
1883
1718
|
{
|
|
1884
1719
|
href: "#",
|
|
@@ -1890,8 +1725,8 @@ function TransferCryptoBase({
|
|
|
1890
1725
|
] })
|
|
1891
1726
|
] })
|
|
1892
1727
|
] }),
|
|
1893
|
-
/* @__PURE__ */ (0,
|
|
1894
|
-
/* @__PURE__ */ (0,
|
|
1728
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "uf-flex uf-items-center uf-justify-between uf-text-xs uf-pt-2", children: [
|
|
1729
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1895
1730
|
"a",
|
|
1896
1731
|
{
|
|
1897
1732
|
href: "https://unifold.io/terms",
|
|
@@ -1900,22 +1735,22 @@ function TransferCryptoBase({
|
|
|
1900
1735
|
children: t.terms.termsApply
|
|
1901
1736
|
}
|
|
1902
1737
|
),
|
|
1903
|
-
depositExecutions.length > 1 && /* @__PURE__ */ (0,
|
|
1738
|
+
depositExecutions.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1904
1739
|
"button",
|
|
1905
1740
|
{
|
|
1906
1741
|
onClick: () => setDepositsModalOpen(true),
|
|
1907
1742
|
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",
|
|
1908
1743
|
children: [
|
|
1909
|
-
/* @__PURE__ */ (0,
|
|
1744
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react7.Clock, { className: "uf-w-3.5 uf-h-3.5" }),
|
|
1910
1745
|
"Track deposits (",
|
|
1911
1746
|
depositExecutions.length,
|
|
1912
1747
|
")",
|
|
1913
|
-
/* @__PURE__ */ (0,
|
|
1748
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react7.ChevronRight, { className: "uf-w-3 uf-h-3" })
|
|
1914
1749
|
]
|
|
1915
1750
|
}
|
|
1916
1751
|
)
|
|
1917
1752
|
] }),
|
|
1918
|
-
depositExecutions.length === 1 && /* @__PURE__ */ (0,
|
|
1753
|
+
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
1754
|
DepositSuccessToast,
|
|
1920
1755
|
{
|
|
1921
1756
|
depositTx: depositExecutions[0].transaction_hash,
|
|
@@ -1925,11 +1760,12 @@ function TransferCryptoBase({
|
|
|
1925
1760
|
status: depositExecutions[0].status,
|
|
1926
1761
|
tokenIconUrl: depositExecutions[0].destination_token_metadata?.icon_url,
|
|
1927
1762
|
sourceAmountBaseUnit: depositExecutions[0].source_amount_base_unit,
|
|
1928
|
-
onClose: () => setDepositExecutions([])
|
|
1763
|
+
onClose: () => setDepositExecutions([]),
|
|
1764
|
+
execution: depositExecutions[0]
|
|
1929
1765
|
},
|
|
1930
1766
|
depositExecutions[0].id
|
|
1931
1767
|
) }),
|
|
1932
|
-
/* @__PURE__ */ (0,
|
|
1768
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1933
1769
|
DepositsModal,
|
|
1934
1770
|
{
|
|
1935
1771
|
open: depositsModalOpen,
|
|
@@ -1944,9 +1780,9 @@ function TransferCryptoBase({
|
|
|
1944
1780
|
}
|
|
1945
1781
|
|
|
1946
1782
|
// src/components/deposits/TransferCrypto.tsx
|
|
1947
|
-
var
|
|
1783
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1948
1784
|
function TransferCrypto(props) {
|
|
1949
|
-
return /* @__PURE__ */ (0,
|
|
1785
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1950
1786
|
TransferCryptoBase,
|
|
1951
1787
|
{
|
|
1952
1788
|
...props,
|
|
@@ -1957,30 +1793,32 @@ function TransferCrypto(props) {
|
|
|
1957
1793
|
}
|
|
1958
1794
|
|
|
1959
1795
|
// src/components/deposits/BuyWithCard.tsx
|
|
1960
|
-
var
|
|
1796
|
+
var import_react7 = require("react");
|
|
1961
1797
|
var import_lucide_react10 = require("lucide-react");
|
|
1798
|
+
var import_core7 = require("@unifold/core");
|
|
1962
1799
|
|
|
1963
1800
|
// src/components/deposits/CurrencyModal.tsx
|
|
1964
|
-
var
|
|
1801
|
+
var import_react6 = require("react");
|
|
1965
1802
|
var import_lucide_react9 = require("lucide-react");
|
|
1966
1803
|
|
|
1967
1804
|
// src/components/currency/CurrencyListItem.tsx
|
|
1968
1805
|
var import_lucide_react8 = require("lucide-react");
|
|
1969
|
-
var
|
|
1806
|
+
var import_core6 = require("@unifold/core");
|
|
1807
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1970
1808
|
function CurrencyListItem({
|
|
1971
1809
|
currency,
|
|
1972
1810
|
isSelected,
|
|
1973
1811
|
onSelect
|
|
1974
1812
|
}) {
|
|
1975
|
-
const iconUrl = getPreferredIconUrl(currency.icon_urls, "png") || currency.icon_url;
|
|
1976
|
-
return /* @__PURE__ */ (0,
|
|
1813
|
+
const iconUrl = (0, import_core6.getPreferredIconUrl)(currency.icon_urls, "png") || currency.icon_url;
|
|
1814
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1977
1815
|
"button",
|
|
1978
1816
|
{
|
|
1979
1817
|
onClick: () => onSelect(currency.currency_code),
|
|
1980
1818
|
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
1819
|
children: [
|
|
1982
|
-
/* @__PURE__ */ (0,
|
|
1983
|
-
/* @__PURE__ */ (0,
|
|
1820
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
1821
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1984
1822
|
"img",
|
|
1985
1823
|
{
|
|
1986
1824
|
src: iconUrl,
|
|
@@ -1988,19 +1826,19 @@ function CurrencyListItem({
|
|
|
1988
1826
|
className: "uf-w-10 uf-h-10 uf-flex-shrink-0"
|
|
1989
1827
|
}
|
|
1990
1828
|
),
|
|
1991
|
-
/* @__PURE__ */ (0,
|
|
1992
|
-
/* @__PURE__ */ (0,
|
|
1993
|
-
/* @__PURE__ */ (0,
|
|
1829
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "uf-text-left", children: [
|
|
1830
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "uf-text-sm uf-font-normal uf-text-foreground", children: currency.name }),
|
|
1831
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "uf-text-xs uf-text-muted-foreground uf-font-light", children: currency.currency_code.toUpperCase() })
|
|
1994
1832
|
] })
|
|
1995
1833
|
] }),
|
|
1996
|
-
isSelected && /* @__PURE__ */ (0,
|
|
1834
|
+
isSelected && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react8.Check, { className: "uf-w-4 uf-h-4 uf-text-foreground" })
|
|
1997
1835
|
]
|
|
1998
1836
|
}
|
|
1999
1837
|
);
|
|
2000
1838
|
}
|
|
2001
1839
|
|
|
2002
1840
|
// src/components/currency/CurrencyListSection.tsx
|
|
2003
|
-
var
|
|
1841
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
2004
1842
|
function CurrencyListSection({
|
|
2005
1843
|
title,
|
|
2006
1844
|
currencies,
|
|
@@ -2008,9 +1846,9 @@ function CurrencyListSection({
|
|
|
2008
1846
|
onSelect
|
|
2009
1847
|
}) {
|
|
2010
1848
|
if (currencies.length === 0) return null;
|
|
2011
|
-
return /* @__PURE__ */ (0,
|
|
2012
|
-
/* @__PURE__ */ (0,
|
|
2013
|
-
currencies.map((currency) => /* @__PURE__ */ (0,
|
|
1849
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
1850
|
+
/* @__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 }) }),
|
|
1851
|
+
currencies.map((currency) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2014
1852
|
CurrencyListItem,
|
|
2015
1853
|
{
|
|
2016
1854
|
currency,
|
|
@@ -2023,7 +1861,7 @@ function CurrencyListSection({
|
|
|
2023
1861
|
}
|
|
2024
1862
|
|
|
2025
1863
|
// src/components/deposits/CurrencyModal.tsx
|
|
2026
|
-
var
|
|
1864
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
2027
1865
|
function CurrencyModal({
|
|
2028
1866
|
open,
|
|
2029
1867
|
onOpenChange,
|
|
@@ -2033,7 +1871,7 @@ function CurrencyModal({
|
|
|
2033
1871
|
onSelectCurrency,
|
|
2034
1872
|
themeClass = ""
|
|
2035
1873
|
}) {
|
|
2036
|
-
const [searchQuery, setSearchQuery] = (0,
|
|
1874
|
+
const [searchQuery, setSearchQuery] = (0, import_react6.useState)("");
|
|
2037
1875
|
const preferredCurrencies = preferredCurrencyCodes.map(
|
|
2038
1876
|
(code) => currencies.find(
|
|
2039
1877
|
(currency) => currency.currency_code.toLowerCase() === code.toLowerCase()
|
|
@@ -2060,8 +1898,8 @@ function CurrencyModal({
|
|
|
2060
1898
|
onOpenChange(false);
|
|
2061
1899
|
setSearchQuery("");
|
|
2062
1900
|
};
|
|
2063
|
-
return /* @__PURE__ */ (0,
|
|
2064
|
-
/* @__PURE__ */ (0,
|
|
1901
|
+
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: [
|
|
1902
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2065
1903
|
DepositHeader,
|
|
2066
1904
|
{
|
|
2067
1905
|
title: "Currency",
|
|
@@ -2070,9 +1908,9 @@ function CurrencyModal({
|
|
|
2070
1908
|
onClose: handleClose
|
|
2071
1909
|
}
|
|
2072
1910
|
),
|
|
2073
|
-
/* @__PURE__ */ (0,
|
|
2074
|
-
/* @__PURE__ */ (0,
|
|
2075
|
-
/* @__PURE__ */ (0,
|
|
1911
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "uf-relative", children: [
|
|
1912
|
+
/* @__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" }),
|
|
1913
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2076
1914
|
"input",
|
|
2077
1915
|
{
|
|
2078
1916
|
type: "text",
|
|
@@ -2083,8 +1921,8 @@ function CurrencyModal({
|
|
|
2083
1921
|
}
|
|
2084
1922
|
)
|
|
2085
1923
|
] }) }),
|
|
2086
|
-
/* @__PURE__ */ (0,
|
|
2087
|
-
/* @__PURE__ */ (0,
|
|
1924
|
+
/* @__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: [
|
|
1925
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2088
1926
|
CurrencyListSection,
|
|
2089
1927
|
{
|
|
2090
1928
|
title: "Popular currencies",
|
|
@@ -2093,8 +1931,8 @@ function CurrencyModal({
|
|
|
2093
1931
|
onSelect: handleSelect
|
|
2094
1932
|
}
|
|
2095
1933
|
),
|
|
2096
|
-
filteredPreferred.length > 0 && filteredOther.length > 0 && /* @__PURE__ */ (0,
|
|
2097
|
-
/* @__PURE__ */ (0,
|
|
1934
|
+
filteredPreferred.length > 0 && filteredOther.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "uf-h-2" }),
|
|
1935
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2098
1936
|
CurrencyListSection,
|
|
2099
1937
|
{
|
|
2100
1938
|
title: "All currencies",
|
|
@@ -2103,7 +1941,7 @@ function CurrencyModal({
|
|
|
2103
1941
|
onSelect: handleSelect
|
|
2104
1942
|
}
|
|
2105
1943
|
),
|
|
2106
|
-
filteredPreferred.length === 0 && filteredOther.length === 0 && /* @__PURE__ */ (0,
|
|
1944
|
+
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
1945
|
] }) })
|
|
2108
1946
|
] }) });
|
|
2109
1947
|
}
|
|
@@ -2157,7 +1995,7 @@ function useUserIp() {
|
|
|
2157
1995
|
}
|
|
2158
1996
|
|
|
2159
1997
|
// src/components/deposits/BuyWithCard.tsx
|
|
2160
|
-
var
|
|
1998
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
2161
1999
|
var t2 = i18n.buyWithCard;
|
|
2162
2000
|
var QUICK_AMOUNTS = [100, 500, 1e3];
|
|
2163
2001
|
function getCurrencySymbol(currencyCode) {
|
|
@@ -2188,21 +2026,21 @@ function BuyWithCard({
|
|
|
2188
2026
|
wallets: externalWallets,
|
|
2189
2027
|
assetCdnUrl
|
|
2190
2028
|
}) {
|
|
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,
|
|
2029
|
+
const [amount, setAmount] = (0, import_react7.useState)("500.00");
|
|
2030
|
+
const [currency, setCurrency] = (0, import_react7.useState)("usd");
|
|
2031
|
+
const [showCurrencyModal, setShowCurrencyModal] = (0, import_react7.useState)(false);
|
|
2032
|
+
const [quotes, setQuotes] = (0, import_react7.useState)([]);
|
|
2033
|
+
const [quotesLoading, setQuotesLoading] = (0, import_react7.useState)(false);
|
|
2034
|
+
const [quotesError, setQuotesError] = (0, import_react7.useState)(null);
|
|
2035
|
+
const [internalView, setInternalView] = (0, import_react7.useState)("amount");
|
|
2198
2036
|
const { userIpInfo, isLoading: isLoadingIp } = useUserIp();
|
|
2199
|
-
const [onrampSession, setOnrampSession] = (0,
|
|
2037
|
+
const [onrampSession, setOnrampSession] = (0, import_react7.useState)(
|
|
2200
2038
|
null
|
|
2201
2039
|
);
|
|
2202
2040
|
const currentView = externalView ?? internalView;
|
|
2203
2041
|
const showQuotesView = currentView === "quotes";
|
|
2204
2042
|
const showOnrampView = currentView === "onramp";
|
|
2205
|
-
(0,
|
|
2043
|
+
(0, import_react7.useEffect)(() => {
|
|
2206
2044
|
if (externalView) {
|
|
2207
2045
|
setInternalView(externalView);
|
|
2208
2046
|
}
|
|
@@ -2215,21 +2053,21 @@ function BuyWithCard({
|
|
|
2215
2053
|
onViewChange?.(newView);
|
|
2216
2054
|
}
|
|
2217
2055
|
};
|
|
2218
|
-
const [selectedProvider, setSelectedProvider] = (0,
|
|
2056
|
+
const [selectedProvider, setSelectedProvider] = (0, import_react7.useState)(
|
|
2219
2057
|
null
|
|
2220
2058
|
);
|
|
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,
|
|
2059
|
+
const [isAutoSelected, setIsAutoSelected] = (0, import_react7.useState)(true);
|
|
2060
|
+
const [autoSelectedProvider, setAutoSelectedProvider] = (0, import_react7.useState)(null);
|
|
2061
|
+
const [hasManualSelection, setHasManualSelection] = (0, import_react7.useState)(false);
|
|
2062
|
+
const [internalWallets, setInternalWallets] = (0, import_react7.useState)([]);
|
|
2063
|
+
const [walletsLoading, setWalletsLoading] = (0, import_react7.useState)(!externalWallets?.length);
|
|
2226
2064
|
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");
|
|
2065
|
+
const [countdown, setCountdown] = (0, import_react7.useState)(60);
|
|
2066
|
+
const [fiatCurrencies, setFiatCurrencies] = (0, import_react7.useState)([]);
|
|
2067
|
+
const [preferredCurrencyCodes, setPreferredCurrencyCodes] = (0, import_react7.useState)([]);
|
|
2068
|
+
const [currenciesLoading, setCurrenciesLoading] = (0, import_react7.useState)(true);
|
|
2069
|
+
const [supportedTokens, setSupportedTokens] = (0, import_react7.useState)([]);
|
|
2070
|
+
const destinationWallet = (0, import_core7.getWalletByChainType)(wallets, "ethereum");
|
|
2233
2071
|
const walletDestinationChainId = destinationWallet?.destination_chain_id;
|
|
2234
2072
|
const resolvedDestinationChainId = destinationChainId || walletDestinationChainId;
|
|
2235
2073
|
const displayTokenSymbol = destinationTokenSymbol || supportedTokens[0]?.symbol || "USDC";
|
|
@@ -2237,10 +2075,10 @@ function BuyWithCard({
|
|
|
2237
2075
|
const destinationChain = destinationToken?.chains.find(
|
|
2238
2076
|
(c) => c.chain_id === resolvedDestinationChainId
|
|
2239
2077
|
);
|
|
2240
|
-
(0,
|
|
2078
|
+
(0, import_react7.useEffect)(() => {
|
|
2241
2079
|
async function fetchFiatCurrencies() {
|
|
2242
2080
|
try {
|
|
2243
|
-
const response = await getFiatCurrencies(publishableKey);
|
|
2081
|
+
const response = await (0, import_core7.getFiatCurrencies)(publishableKey);
|
|
2244
2082
|
setFiatCurrencies(response.data);
|
|
2245
2083
|
setPreferredCurrencyCodes(response.preferred || []);
|
|
2246
2084
|
} catch (err) {
|
|
@@ -2251,20 +2089,24 @@ function BuyWithCard({
|
|
|
2251
2089
|
}
|
|
2252
2090
|
fetchFiatCurrencies();
|
|
2253
2091
|
}, [publishableKey]);
|
|
2254
|
-
(0,
|
|
2092
|
+
(0, import_react7.useEffect)(() => {
|
|
2255
2093
|
if (externalWallets?.length) {
|
|
2256
2094
|
setWalletsLoading(false);
|
|
2257
2095
|
return;
|
|
2258
2096
|
}
|
|
2097
|
+
if (internalWallets.length > 0) {
|
|
2098
|
+
setWalletsLoading(false);
|
|
2099
|
+
return;
|
|
2100
|
+
}
|
|
2259
2101
|
let retryTimeout = null;
|
|
2260
2102
|
let isCancelled = false;
|
|
2261
2103
|
const fetchWallets = async () => {
|
|
2262
2104
|
if (isCancelled) return;
|
|
2263
2105
|
setWalletsLoading(true);
|
|
2264
2106
|
try {
|
|
2265
|
-
const response = await
|
|
2107
|
+
const response = await (0, import_core7.createDepositAddress)(
|
|
2266
2108
|
{
|
|
2267
|
-
|
|
2109
|
+
external_user_id: userId,
|
|
2268
2110
|
recipient_address: recipientAddress,
|
|
2269
2111
|
destination_chain_type: destinationChainType,
|
|
2270
2112
|
destination_chain_id: destinationChainId,
|
|
@@ -2292,10 +2134,10 @@ function BuyWithCard({
|
|
|
2292
2134
|
}
|
|
2293
2135
|
};
|
|
2294
2136
|
}, [userId, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, publishableKey, externalWallets]);
|
|
2295
|
-
(0,
|
|
2137
|
+
(0, import_react7.useEffect)(() => {
|
|
2296
2138
|
async function fetchSupportedTokens() {
|
|
2297
2139
|
try {
|
|
2298
|
-
const response = await getSupportedDepositTokens(publishableKey);
|
|
2140
|
+
const response = await (0, import_core7.getSupportedDepositTokens)(publishableKey);
|
|
2299
2141
|
setSupportedTokens(response.data);
|
|
2300
2142
|
} catch (err) {
|
|
2301
2143
|
console.error("Error fetching supported tokens:", err);
|
|
@@ -2303,7 +2145,7 @@ function BuyWithCard({
|
|
|
2303
2145
|
}
|
|
2304
2146
|
fetchSupportedTokens();
|
|
2305
2147
|
}, [publishableKey]);
|
|
2306
|
-
(0,
|
|
2148
|
+
(0, import_react7.useEffect)(() => {
|
|
2307
2149
|
const amountNum = parseFloat(amount);
|
|
2308
2150
|
if (isNaN(amountNum) || amountNum <= 0) {
|
|
2309
2151
|
setQuotes([]);
|
|
@@ -2338,7 +2180,7 @@ function BuyWithCard({
|
|
|
2338
2180
|
source_amount: sourceAmount.toString(),
|
|
2339
2181
|
source_currency_code: currency.toLowerCase()
|
|
2340
2182
|
};
|
|
2341
|
-
const response = await getMeldQuotes(request, publishableKey);
|
|
2183
|
+
const response = await (0, import_core7.getMeldQuotes)(request, publishableKey);
|
|
2342
2184
|
setQuotes(response.data);
|
|
2343
2185
|
if (hasManualSelection && selectedProvider) {
|
|
2344
2186
|
const manualProviderStillExists = response.data.find(
|
|
@@ -2383,7 +2225,7 @@ function BuyWithCard({
|
|
|
2383
2225
|
setQuotesLoading(false);
|
|
2384
2226
|
}
|
|
2385
2227
|
};
|
|
2386
|
-
(0,
|
|
2228
|
+
(0, import_react7.useEffect)(() => {
|
|
2387
2229
|
if (quotes.length === 0) return;
|
|
2388
2230
|
const timer = setInterval(() => {
|
|
2389
2231
|
setCountdown((prev) => {
|
|
@@ -2418,7 +2260,7 @@ function BuyWithCard({
|
|
|
2418
2260
|
const handleContinue = async () => {
|
|
2419
2261
|
if (!selectedProvider) return;
|
|
2420
2262
|
try {
|
|
2421
|
-
const wallet = getWalletByChainType(wallets, "ethereum");
|
|
2263
|
+
const wallet = (0, import_core7.getWalletByChainType)(wallets, "ethereum");
|
|
2422
2264
|
if (!wallet?.address) {
|
|
2423
2265
|
setQuotesError("Wallet address not available");
|
|
2424
2266
|
return;
|
|
@@ -2431,7 +2273,7 @@ function BuyWithCard({
|
|
|
2431
2273
|
wallet_address: wallet.address,
|
|
2432
2274
|
source_amount: amount
|
|
2433
2275
|
};
|
|
2434
|
-
const session = await createMeldSession(sessionRequest, publishableKey);
|
|
2276
|
+
const session = await (0, import_core7.createMeldSession)(sessionRequest, publishableKey);
|
|
2435
2277
|
setOnrampSession({
|
|
2436
2278
|
provider: selectedProvider,
|
|
2437
2279
|
sourceCurrency: currency,
|
|
@@ -2458,36 +2300,36 @@ function BuyWithCard({
|
|
|
2458
2300
|
(a, b) => b.destination_amount - a.destination_amount
|
|
2459
2301
|
);
|
|
2460
2302
|
const currencySymbol = getCurrencySymbol(currency);
|
|
2461
|
-
return /* @__PURE__ */ (0,
|
|
2462
|
-
/* @__PURE__ */ (0,
|
|
2303
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-pb-1 uf-relative uf-overflow-hidden", children: [
|
|
2304
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2463
2305
|
"div",
|
|
2464
2306
|
{
|
|
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"}`,
|
|
2307
|
+
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
2308
|
children: [
|
|
2467
|
-
/* @__PURE__ */ (0,
|
|
2468
|
-
/* @__PURE__ */ (0,
|
|
2309
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-mb-6 uf-pt-4", children: [
|
|
2310
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "uf-flex uf-justify-center uf-mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2469
2311
|
"button",
|
|
2470
2312
|
{
|
|
2471
2313
|
onClick: () => setShowCurrencyModal(true),
|
|
2472
2314
|
disabled: currenciesLoading,
|
|
2473
2315
|
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
2316
|
children: [
|
|
2475
|
-
selectedCurrencyData && /* @__PURE__ */ (0,
|
|
2317
|
+
selectedCurrencyData && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2476
2318
|
"img",
|
|
2477
2319
|
{
|
|
2478
|
-
src: getPreferredIconUrl(selectedCurrencyData.icon_urls, "png") || selectedCurrencyData.icon_url,
|
|
2320
|
+
src: (0, import_core7.getPreferredIconUrl)(selectedCurrencyData.icon_urls, "png") || selectedCurrencyData.icon_url,
|
|
2479
2321
|
alt: selectedCurrencyData.name,
|
|
2480
2322
|
className: "uf-w-4 uf-h-4"
|
|
2481
2323
|
}
|
|
2482
2324
|
),
|
|
2483
|
-
/* @__PURE__ */ (0,
|
|
2484
|
-
/* @__PURE__ */ (0,
|
|
2325
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "uf-text-sm uf-text-foreground uf-font-medium", children: currency.toUpperCase() }),
|
|
2326
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react10.ChevronDown, { className: "uf-w-3.5 uf-h-3.5 uf-text-muted-foreground" })
|
|
2485
2327
|
]
|
|
2486
2328
|
}
|
|
2487
2329
|
) }),
|
|
2488
|
-
/* @__PURE__ */ (0,
|
|
2489
|
-
/* @__PURE__ */ (0,
|
|
2490
|
-
/* @__PURE__ */ (0,
|
|
2330
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-text-center uf-mb-4", children: [
|
|
2331
|
+
/* @__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: [
|
|
2332
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2491
2333
|
"span",
|
|
2492
2334
|
{
|
|
2493
2335
|
className: "uf-font-normal uf-text-foreground uf-flex-shrink-0 uf-mr-1",
|
|
@@ -2497,7 +2339,7 @@ function BuyWithCard({
|
|
|
2497
2339
|
children: currencySymbol
|
|
2498
2340
|
}
|
|
2499
2341
|
),
|
|
2500
|
-
/* @__PURE__ */ (0,
|
|
2342
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2501
2343
|
"input",
|
|
2502
2344
|
{
|
|
2503
2345
|
type: "text",
|
|
@@ -2513,12 +2355,12 @@ function BuyWithCard({
|
|
|
2513
2355
|
}
|
|
2514
2356
|
)
|
|
2515
2357
|
] }) }),
|
|
2516
|
-
quotesLoading ? /* @__PURE__ */ (0,
|
|
2358
|
+
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
2359
|
calculateUSDC(),
|
|
2518
2360
|
" USDC (Perps)"
|
|
2519
2361
|
] })
|
|
2520
2362
|
] }),
|
|
2521
|
-
/* @__PURE__ */ (0,
|
|
2363
|
+
/* @__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
2364
|
"button",
|
|
2523
2365
|
{
|
|
2524
2366
|
onClick: () => handleQuickAmount(quickAmount),
|
|
@@ -2531,31 +2373,31 @@ function BuyWithCard({
|
|
|
2531
2373
|
quickAmount
|
|
2532
2374
|
)) })
|
|
2533
2375
|
] }),
|
|
2534
|
-
/* @__PURE__ */ (0,
|
|
2535
|
-
/* @__PURE__ */ (0,
|
|
2536
|
-
/* @__PURE__ */ (0,
|
|
2537
|
-
quotes.length > 0 && !quotesLoading && /* @__PURE__ */ (0,
|
|
2376
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-mb-6", children: [
|
|
2377
|
+
/* @__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: [
|
|
2378
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "uf-text-foreground", children: "Provider" }),
|
|
2379
|
+
quotes.length > 0 && !quotesLoading && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: "uf-text-[10px] uf-text-foreground uf-font-normal", children: [
|
|
2538
2380
|
"Refreshing in ",
|
|
2539
2381
|
countdown,
|
|
2540
2382
|
"s"
|
|
2541
2383
|
] })
|
|
2542
2384
|
] }),
|
|
2543
|
-
/* @__PURE__ */ (0,
|
|
2385
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2544
2386
|
"button",
|
|
2545
2387
|
{
|
|
2546
2388
|
onClick: () => handleViewChange("quotes"),
|
|
2547
2389
|
disabled: quotesLoading || quotes.length === 0,
|
|
2548
2390
|
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,
|
|
2391
|
+
children: quotesLoading ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-text-left uf-w-full uf-animate-pulse", children: [
|
|
2392
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "uf-h-3 uf-bg-muted uf-rounded uf-w-28 uf-mb-3" }),
|
|
2393
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
2394
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "uf-w-8 uf-h-8 uf-bg-muted uf-rounded-full" }),
|
|
2395
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "uf-h-4 uf-bg-muted uf-rounded uf-w-32" })
|
|
2554
2396
|
] })
|
|
2555
|
-
] }) : /* @__PURE__ */ (0,
|
|
2556
|
-
isAutoSelected && /* @__PURE__ */ (0,
|
|
2557
|
-
selectedProvider && /* @__PURE__ */ (0,
|
|
2558
|
-
/* @__PURE__ */ (0,
|
|
2397
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-w-full uf-text-left", children: [
|
|
2398
|
+
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" }),
|
|
2399
|
+
selectedProvider && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
2400
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2559
2401
|
"img",
|
|
2560
2402
|
{
|
|
2561
2403
|
src: selectedProvider.icon_url,
|
|
@@ -2565,22 +2407,22 @@ function BuyWithCard({
|
|
|
2565
2407
|
className: "uf-rounded-full uf-flex-shrink-0"
|
|
2566
2408
|
}
|
|
2567
2409
|
),
|
|
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,
|
|
2410
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-flex-1 uf-min-w-0", children: [
|
|
2411
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "uf-text-sm uf-text-foreground uf-font-medium", children: selectedProvider.service_provider_display_name }),
|
|
2412
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-1.5 uf-mt-0.5", children: [
|
|
2413
|
+
isAutoSelected && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "uf-text-[10px] uf-text-green-400 uf-font-normal", children: "Best price" }),
|
|
2414
|
+
isAutoSelected && selectedProvider.low_kyc === false && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "uf-text-[10px] uf-text-muted-foreground", children: "\u2022" }),
|
|
2415
|
+
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
2416
|
] })
|
|
2575
2417
|
] }),
|
|
2576
|
-
quotes.length > 0 && /* @__PURE__ */ (0,
|
|
2418
|
+
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
2419
|
] })
|
|
2578
2420
|
] })
|
|
2579
2421
|
}
|
|
2580
2422
|
),
|
|
2581
|
-
quotesError && /* @__PURE__ */ (0,
|
|
2423
|
+
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
2424
|
] }),
|
|
2583
|
-
/* @__PURE__ */ (0,
|
|
2425
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2584
2426
|
"button",
|
|
2585
2427
|
{
|
|
2586
2428
|
onClick: handleContinue,
|
|
@@ -2595,15 +2437,15 @@ function BuyWithCard({
|
|
|
2595
2437
|
]
|
|
2596
2438
|
}
|
|
2597
2439
|
),
|
|
2598
|
-
/* @__PURE__ */ (0,
|
|
2440
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2599
2441
|
"div",
|
|
2600
2442
|
{
|
|
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,
|
|
2443
|
+
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"}`,
|
|
2444
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "uf-space-y-2 uf-pt-2", children: sortedQuotes.map((quote, index) => {
|
|
2603
2445
|
const badges = getProviderBadges(quote, sortedQuotes);
|
|
2604
2446
|
const displayName = quote.service_provider_display_name;
|
|
2605
2447
|
const isSelected = selectedProvider?.service_provider === quote.service_provider;
|
|
2606
|
-
return /* @__PURE__ */ (0,
|
|
2448
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2607
2449
|
"button",
|
|
2608
2450
|
{
|
|
2609
2451
|
onClick: () => {
|
|
@@ -2616,8 +2458,8 @@ function BuyWithCard({
|
|
|
2616
2458
|
},
|
|
2617
2459
|
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
2460
|
children: [
|
|
2619
|
-
/* @__PURE__ */ (0,
|
|
2620
|
-
/* @__PURE__ */ (0,
|
|
2461
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
2462
|
+
/* @__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
2463
|
"img",
|
|
2622
2464
|
{
|
|
2623
2465
|
src: quote.icon_url,
|
|
@@ -2627,10 +2469,10 @@ function BuyWithCard({
|
|
|
2627
2469
|
className: "uf-rounded-full"
|
|
2628
2470
|
}
|
|
2629
2471
|
) }),
|
|
2630
|
-
/* @__PURE__ */ (0,
|
|
2631
|
-
/* @__PURE__ */ (0,
|
|
2632
|
-
/* @__PURE__ */ (0,
|
|
2633
|
-
badges.map((badge, i) => /* @__PURE__ */ (0,
|
|
2472
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-text-left", children: [
|
|
2473
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "uf-text-sm uf-font-medium uf-text-foreground", children: displayName }),
|
|
2474
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-1.5 uf-mt-0.5", children: [
|
|
2475
|
+
badges.map((badge, i) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2634
2476
|
"span",
|
|
2635
2477
|
{
|
|
2636
2478
|
className: "uf-text-[10px] uf-text-green-400 uf-font-normal",
|
|
@@ -2641,17 +2483,17 @@ function BuyWithCard({
|
|
|
2641
2483
|
},
|
|
2642
2484
|
i
|
|
2643
2485
|
)),
|
|
2644
|
-
quote.low_kyc === false && badges.length > 0 && /* @__PURE__ */ (0,
|
|
2645
|
-
quote.low_kyc === false && /* @__PURE__ */ (0,
|
|
2486
|
+
quote.low_kyc === false && badges.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "uf-text-[10px] uf-text-muted-foreground", children: "\u2022" }),
|
|
2487
|
+
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
2488
|
] })
|
|
2647
2489
|
] })
|
|
2648
2490
|
] }),
|
|
2649
|
-
/* @__PURE__ */ (0,
|
|
2650
|
-
/* @__PURE__ */ (0,
|
|
2491
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-text-right", children: [
|
|
2492
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-text-sm uf-font-medium uf-text-foreground", children: [
|
|
2651
2493
|
quote.destination_amount.toFixed(2),
|
|
2652
2494
|
" USDC"
|
|
2653
2495
|
] }),
|
|
2654
|
-
/* @__PURE__ */ (0,
|
|
2496
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-text-xs uf-text-muted-foreground uf-font-normal", children: [
|
|
2655
2497
|
currencySymbol,
|
|
2656
2498
|
" ",
|
|
2657
2499
|
amount
|
|
@@ -2664,12 +2506,12 @@ function BuyWithCard({
|
|
|
2664
2506
|
}) })
|
|
2665
2507
|
}
|
|
2666
2508
|
),
|
|
2667
|
-
/* @__PURE__ */ (0,
|
|
2509
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2668
2510
|
"div",
|
|
2669
2511
|
{
|
|
2670
2512
|
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,
|
|
2513
|
+
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: [
|
|
2514
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "uf-mb-6", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2673
2515
|
"img",
|
|
2674
2516
|
{
|
|
2675
2517
|
src: onrampSession.provider.icon_url,
|
|
@@ -2679,17 +2521,17 @@ function BuyWithCard({
|
|
|
2679
2521
|
className: "uf-rounded-2xl"
|
|
2680
2522
|
}
|
|
2681
2523
|
) }),
|
|
2682
|
-
/* @__PURE__ */ (0,
|
|
2524
|
+
/* @__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
2525
|
"{{provider}}",
|
|
2684
2526
|
onrampSession.provider.service_provider_display_name
|
|
2685
2527
|
) }),
|
|
2686
|
-
/* @__PURE__ */ (0,
|
|
2687
|
-
/* @__PURE__ */ (0,
|
|
2688
|
-
/* @__PURE__ */ (0,
|
|
2689
|
-
/* @__PURE__ */ (0,
|
|
2528
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "uf-text-sm uf-text-muted-foreground uf-mb-8", children: t2.onramp.canCloseModal }),
|
|
2529
|
+
/* @__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: [
|
|
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.jsx)(
|
|
2690
2532
|
"img",
|
|
2691
2533
|
{
|
|
2692
|
-
src: getIconUrlWithCdn(
|
|
2534
|
+
src: (0, import_core7.getIconUrlWithCdn)(
|
|
2693
2535
|
`/icons/currencies/png/${onrampSession.sourceCurrency.toLowerCase()}.png`,
|
|
2694
2536
|
assetCdnUrl
|
|
2695
2537
|
),
|
|
@@ -2697,44 +2539,44 @@ function BuyWithCard({
|
|
|
2697
2539
|
className: "uf-w-7 uf-h-7 uf-rounded-full"
|
|
2698
2540
|
}
|
|
2699
2541
|
) }),
|
|
2700
|
-
/* @__PURE__ */ (0,
|
|
2701
|
-
/* @__PURE__ */ (0,
|
|
2542
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "uf-text-[10px] uf-text-muted-foreground uf-text-center", children: t2.onramp.youUse }),
|
|
2543
|
+
/* @__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
2544
|
] }),
|
|
2703
|
-
/* @__PURE__ */ (0,
|
|
2704
|
-
/* @__PURE__ */ (0,
|
|
2705
|
-
/* @__PURE__ */ (0,
|
|
2706
|
-
/* @__PURE__ */ (0,
|
|
2545
|
+
/* @__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" }) }),
|
|
2546
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-flex uf-flex-col uf-items-center uf-min-w-[72px]", children: [
|
|
2547
|
+
/* @__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: [
|
|
2548
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2707
2549
|
"img",
|
|
2708
2550
|
{
|
|
2709
|
-
src: getIconUrlWithCdn("/icons/tokens/png/usdc.png", assetCdnUrl),
|
|
2551
|
+
src: (0, import_core7.getIconUrlWithCdn)("/icons/tokens/png/usdc.png", assetCdnUrl),
|
|
2710
2552
|
alt: "USDC",
|
|
2711
2553
|
className: "uf-w-7 uf-h-7 uf-rounded-full"
|
|
2712
2554
|
}
|
|
2713
2555
|
),
|
|
2714
|
-
/* @__PURE__ */ (0,
|
|
2556
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2715
2557
|
"img",
|
|
2716
2558
|
{
|
|
2717
|
-
src: getIconUrlWithCdn("/icons/networks/png/polygon.png", assetCdnUrl),
|
|
2559
|
+
src: (0, import_core7.getIconUrlWithCdn)("/icons/networks/png/polygon.png", assetCdnUrl),
|
|
2718
2560
|
alt: "Polygon",
|
|
2719
2561
|
className: "uf-w-3.5 uf-h-3.5 uf-absolute -uf-bottom-0.5 -uf-right-0.5 uf-rounded-full"
|
|
2720
2562
|
}
|
|
2721
2563
|
)
|
|
2722
2564
|
] }) }),
|
|
2723
|
-
/* @__PURE__ */ (0,
|
|
2724
|
-
/* @__PURE__ */ (0,
|
|
2565
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "uf-text-[10px] uf-text-muted-foreground uf-text-center", children: t2.onramp.youBuy }),
|
|
2566
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "uf-text-sm uf-font-medium uf-text-foreground uf-text-center", children: "USDC" })
|
|
2725
2567
|
] }),
|
|
2726
|
-
/* @__PURE__ */ (0,
|
|
2727
|
-
/* @__PURE__ */ (0,
|
|
2728
|
-
/* @__PURE__ */ (0,
|
|
2729
|
-
/* @__PURE__ */ (0,
|
|
2568
|
+
/* @__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" }) }),
|
|
2569
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "uf-flex uf-flex-col uf-items-center uf-min-w-[72px]", children: [
|
|
2570
|
+
/* @__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: [
|
|
2571
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2730
2572
|
"img",
|
|
2731
2573
|
{
|
|
2732
|
-
src: destinationToken?.icon_url || getIconUrlWithCdn("/icons/tokens/png/usdc.png", assetCdnUrl),
|
|
2574
|
+
src: destinationToken?.icon_url || (0, import_core7.getIconUrlWithCdn)("/icons/tokens/png/usdc.png", assetCdnUrl),
|
|
2733
2575
|
alt: displayTokenSymbol,
|
|
2734
2576
|
className: "uf-w-7 uf-h-7 uf-rounded-full"
|
|
2735
2577
|
}
|
|
2736
2578
|
),
|
|
2737
|
-
destinationChain?.icon_url && /* @__PURE__ */ (0,
|
|
2579
|
+
destinationChain?.icon_url && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2738
2580
|
"img",
|
|
2739
2581
|
{
|
|
2740
2582
|
src: destinationChain.icon_url,
|
|
@@ -2743,15 +2585,15 @@ function BuyWithCard({
|
|
|
2743
2585
|
}
|
|
2744
2586
|
)
|
|
2745
2587
|
] }) }),
|
|
2746
|
-
/* @__PURE__ */ (0,
|
|
2747
|
-
/* @__PURE__ */ (0,
|
|
2588
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "uf-text-[10px] uf-text-muted-foreground uf-text-center", children: t2.onramp.youReceive }),
|
|
2589
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "uf-text-sm uf-font-medium uf-text-foreground uf-text-center", children: displayTokenSymbol })
|
|
2748
2590
|
] })
|
|
2749
2591
|
] }) }),
|
|
2750
|
-
/* @__PURE__ */ (0,
|
|
2592
|
+
/* @__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
2593
|
] })
|
|
2752
2594
|
}
|
|
2753
2595
|
),
|
|
2754
|
-
/* @__PURE__ */ (0,
|
|
2596
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2755
2597
|
CurrencyModal,
|
|
2756
2598
|
{
|
|
2757
2599
|
open: showCurrencyModal,
|
|
@@ -2770,7 +2612,7 @@ function BuyWithCard({
|
|
|
2770
2612
|
|
|
2771
2613
|
// src/components/deposits/buttons/TransferCryptoButton.tsx
|
|
2772
2614
|
var import_lucide_react11 = require("lucide-react");
|
|
2773
|
-
var
|
|
2615
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
2774
2616
|
function TransferCryptoButton({
|
|
2775
2617
|
onClick,
|
|
2776
2618
|
title,
|
|
@@ -2778,23 +2620,23 @@ function TransferCryptoButton({
|
|
|
2778
2620
|
featuredTokens
|
|
2779
2621
|
}) {
|
|
2780
2622
|
const sortedTokens = featuredTokens ? [...featuredTokens].sort((a, b) => a.position - b.position) : [];
|
|
2781
|
-
return /* @__PURE__ */ (0,
|
|
2623
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
2782
2624
|
"button",
|
|
2783
2625
|
{
|
|
2784
2626
|
onClick,
|
|
2785
2627
|
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
2628
|
children: [
|
|
2787
|
-
/* @__PURE__ */ (0,
|
|
2788
|
-
/* @__PURE__ */ (0,
|
|
2789
|
-
/* @__PURE__ */ (0,
|
|
2790
|
-
/* @__PURE__ */ (0,
|
|
2791
|
-
/* @__PURE__ */ (0,
|
|
2629
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
2630
|
+
/* @__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" }) }),
|
|
2631
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "uf-text-left", children: [
|
|
2632
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "uf-text-sm uf-font-light uf-mb-0.5 uf-text-foreground", children: title }),
|
|
2633
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "uf-text-muted-foreground uf-text-xs uf-font-light", children: subtitle })
|
|
2792
2634
|
] })
|
|
2793
2635
|
] }),
|
|
2794
|
-
/* @__PURE__ */ (0,
|
|
2795
|
-
/* @__PURE__ */ (0,
|
|
2636
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
2637
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "uf-flex uf--space-x-2", children: sortedTokens.map((token) => {
|
|
2796
2638
|
const iconUrl = token.icon_urls.find((u) => u.format === "svg")?.url || token.icon_urls.find((u) => u.format === "png")?.url;
|
|
2797
|
-
return /* @__PURE__ */ (0,
|
|
2639
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2798
2640
|
"img",
|
|
2799
2641
|
{
|
|
2800
2642
|
src: iconUrl,
|
|
@@ -2806,7 +2648,7 @@ function TransferCryptoButton({
|
|
|
2806
2648
|
token.name
|
|
2807
2649
|
);
|
|
2808
2650
|
}) }),
|
|
2809
|
-
/* @__PURE__ */ (0,
|
|
2651
|
+
/* @__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
2652
|
] })
|
|
2811
2653
|
]
|
|
2812
2654
|
}
|
|
@@ -2815,30 +2657,30 @@ function TransferCryptoButton({
|
|
|
2815
2657
|
|
|
2816
2658
|
// src/components/deposits/buttons/DepositWithCardButton.tsx
|
|
2817
2659
|
var import_lucide_react12 = require("lucide-react");
|
|
2818
|
-
var
|
|
2660
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
2819
2661
|
function DepositWithCardButton({
|
|
2820
2662
|
onClick,
|
|
2821
2663
|
title,
|
|
2822
2664
|
subtitle,
|
|
2823
2665
|
paymentNetworks
|
|
2824
2666
|
}) {
|
|
2825
|
-
return /* @__PURE__ */ (0,
|
|
2667
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2826
2668
|
"button",
|
|
2827
2669
|
{
|
|
2828
2670
|
onClick,
|
|
2829
2671
|
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
2672
|
children: [
|
|
2831
|
-
/* @__PURE__ */ (0,
|
|
2832
|
-
/* @__PURE__ */ (0,
|
|
2833
|
-
/* @__PURE__ */ (0,
|
|
2834
|
-
/* @__PURE__ */ (0,
|
|
2835
|
-
/* @__PURE__ */ (0,
|
|
2673
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
2674
|
+
/* @__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" }) }),
|
|
2675
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "uf-text-left", children: [
|
|
2676
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "uf-text-sm uf-font-light uf-mb-0.5 uf-text-foreground", children: title }),
|
|
2677
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "uf-text-muted-foreground uf-text-xs uf-font-light", children: subtitle })
|
|
2836
2678
|
] })
|
|
2837
2679
|
] }),
|
|
2838
|
-
/* @__PURE__ */ (0,
|
|
2839
|
-
/* @__PURE__ */ (0,
|
|
2680
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
2681
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "uf-flex uf-items-center uf-gap-1.5", children: paymentNetworks?.map((network) => {
|
|
2840
2682
|
const iconUrl = network.icon_urls.find((u) => u.format === "svg")?.url || network.icon_urls.find((u) => u.format === "png")?.url;
|
|
2841
|
-
return /* @__PURE__ */ (0,
|
|
2683
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2842
2684
|
"img",
|
|
2843
2685
|
{
|
|
2844
2686
|
src: iconUrl,
|
|
@@ -2850,7 +2692,7 @@ function DepositWithCardButton({
|
|
|
2850
2692
|
network.name
|
|
2851
2693
|
);
|
|
2852
2694
|
}) }),
|
|
2853
|
-
/* @__PURE__ */ (0,
|
|
2695
|
+
/* @__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
2696
|
] })
|
|
2855
2697
|
]
|
|
2856
2698
|
}
|
|
@@ -2859,49 +2701,50 @@ function DepositWithCardButton({
|
|
|
2859
2701
|
|
|
2860
2702
|
// src/components/deposits/buttons/DepositTrackerButton.tsx
|
|
2861
2703
|
var import_lucide_react13 = require("lucide-react");
|
|
2862
|
-
var
|
|
2704
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
2863
2705
|
function DepositTrackerButton({
|
|
2864
2706
|
onClick,
|
|
2865
2707
|
title,
|
|
2866
2708
|
subtitle,
|
|
2867
2709
|
badge
|
|
2868
2710
|
}) {
|
|
2869
|
-
return /* @__PURE__ */ (0,
|
|
2711
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
2870
2712
|
"button",
|
|
2871
2713
|
{
|
|
2872
2714
|
onClick,
|
|
2873
2715
|
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
2716
|
children: [
|
|
2875
|
-
/* @__PURE__ */ (0,
|
|
2876
|
-
/* @__PURE__ */ (0,
|
|
2877
|
-
/* @__PURE__ */ (0,
|
|
2878
|
-
badge !== void 0 && badge > 0 && /* @__PURE__ */ (0,
|
|
2717
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
2718
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "uf-bg-muted uf-rounded-lg uf-p-2 uf-relative", children: [
|
|
2719
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react13.Clock, { className: "uf-w-5 uf-h-5" }),
|
|
2720
|
+
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
2721
|
] }),
|
|
2880
|
-
/* @__PURE__ */ (0,
|
|
2881
|
-
/* @__PURE__ */ (0,
|
|
2882
|
-
/* @__PURE__ */ (0,
|
|
2722
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "uf-text-left", children: [
|
|
2723
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "uf-text-sm uf-font-light uf-mb-0.5 uf-text-foreground", children: title }),
|
|
2724
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "uf-text-muted-foreground uf-text-xs uf-font-light", children: subtitle })
|
|
2883
2725
|
] })
|
|
2884
2726
|
] }),
|
|
2885
|
-
/* @__PURE__ */ (0,
|
|
2727
|
+
/* @__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
2728
|
]
|
|
2887
2729
|
}
|
|
2888
2730
|
);
|
|
2889
2731
|
}
|
|
2890
2732
|
|
|
2891
2733
|
// src/components/deposits/DepositModal.tsx
|
|
2892
|
-
var
|
|
2734
|
+
var import_core8 = require("@unifold/core");
|
|
2735
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2893
2736
|
function SkeletonButton({ variant = "default" }) {
|
|
2894
|
-
return /* @__PURE__ */ (0,
|
|
2895
|
-
/* @__PURE__ */ (0,
|
|
2896
|
-
/* @__PURE__ */ (0,
|
|
2897
|
-
/* @__PURE__ */ (0,
|
|
2898
|
-
/* @__PURE__ */ (0,
|
|
2899
|
-
/* @__PURE__ */ (0,
|
|
2737
|
+
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: [
|
|
2738
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
2739
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "uf-bg-muted uf-rounded-lg uf-w-9 uf-h-9" }),
|
|
2740
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "uf-space-y-1.5", children: [
|
|
2741
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "uf-h-3.5 uf-w-24 uf-bg-muted uf-rounded" }),
|
|
2742
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "uf-h-3 uf-w-32 uf-bg-muted uf-rounded" })
|
|
2900
2743
|
] })
|
|
2901
2744
|
] }),
|
|
2902
|
-
/* @__PURE__ */ (0,
|
|
2903
|
-
variant === "with-icons" && /* @__PURE__ */ (0,
|
|
2904
|
-
/* @__PURE__ */ (0,
|
|
2745
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
2746
|
+
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)) }),
|
|
2747
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react14.ChevronRight, { className: "uf-w-4 uf-h-4 uf-text-muted" })
|
|
2905
2748
|
] })
|
|
2906
2749
|
] });
|
|
2907
2750
|
}
|
|
@@ -2922,24 +2765,24 @@ function DepositModal({
|
|
|
2922
2765
|
onDepositError,
|
|
2923
2766
|
theme = "dark"
|
|
2924
2767
|
}) {
|
|
2925
|
-
const [view, setView] = (0,
|
|
2926
|
-
const [cardView, setCardView] = (0,
|
|
2768
|
+
const [view, setView] = (0, import_react8.useState)("main");
|
|
2769
|
+
const [cardView, setCardView] = (0, import_react8.useState)(
|
|
2927
2770
|
"amount"
|
|
2928
2771
|
);
|
|
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,
|
|
2772
|
+
const [quotesCount, setQuotesCount] = (0, import_react8.useState)(0);
|
|
2773
|
+
const [depositsModalOpen, setDepositsModalOpen] = (0, import_react8.useState)(false);
|
|
2774
|
+
const [depositExecutions, setDepositExecutions] = (0, import_react8.useState)([]);
|
|
2775
|
+
const [projectConfig, setProjectConfig] = (0, import_react8.useState)(null);
|
|
2776
|
+
const [wallets, setWallets] = (0, import_react8.useState)([]);
|
|
2777
|
+
const [walletsLoading, setWalletsLoading] = (0, import_react8.useState)(false);
|
|
2778
|
+
(0, import_react8.useEffect)(() => {
|
|
2936
2779
|
setProjectConfig(null);
|
|
2937
2780
|
}, [publishableKey]);
|
|
2938
|
-
(0,
|
|
2781
|
+
(0, import_react8.useEffect)(() => {
|
|
2939
2782
|
setWallets([]);
|
|
2940
2783
|
}, [userId, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, publishableKey]);
|
|
2941
|
-
const [resolvedTheme, setResolvedTheme] = (0,
|
|
2942
|
-
(0,
|
|
2784
|
+
const [resolvedTheme, setResolvedTheme] = (0, import_react8.useState)(theme === "auto" ? "dark" : theme);
|
|
2785
|
+
(0, import_react8.useEffect)(() => {
|
|
2943
2786
|
if (theme === "auto") {
|
|
2944
2787
|
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
2945
2788
|
setResolvedTheme(mediaQuery.matches ? "dark" : "light");
|
|
@@ -2952,12 +2795,12 @@ function DepositModal({
|
|
|
2952
2795
|
setResolvedTheme(theme);
|
|
2953
2796
|
}
|
|
2954
2797
|
}, [theme]);
|
|
2955
|
-
(0,
|
|
2798
|
+
(0, import_react8.useEffect)(() => {
|
|
2956
2799
|
if (open && !projectConfig) {
|
|
2957
|
-
getProjectConfig(publishableKey).then(setProjectConfig).catch(console.error);
|
|
2800
|
+
(0, import_core8.getProjectConfig)(publishableKey).then(setProjectConfig).catch(console.error);
|
|
2958
2801
|
}
|
|
2959
2802
|
}, [open, publishableKey, projectConfig]);
|
|
2960
|
-
(0,
|
|
2803
|
+
(0, import_react8.useEffect)(() => {
|
|
2961
2804
|
if (!open || wallets.length > 0) return;
|
|
2962
2805
|
let retryTimeout = null;
|
|
2963
2806
|
let isCancelled = false;
|
|
@@ -2965,9 +2808,9 @@ function DepositModal({
|
|
|
2965
2808
|
if (isCancelled) return;
|
|
2966
2809
|
setWalletsLoading(true);
|
|
2967
2810
|
try {
|
|
2968
|
-
const response = await
|
|
2811
|
+
const response = await (0, import_core8.createDepositAddress)(
|
|
2969
2812
|
{
|
|
2970
|
-
|
|
2813
|
+
external_user_id: userId,
|
|
2971
2814
|
recipient_address: recipientAddress,
|
|
2972
2815
|
destination_chain_type: destinationChainType,
|
|
2973
2816
|
destination_chain_id: destinationChainId,
|
|
@@ -3019,27 +2862,27 @@ function DepositModal({
|
|
|
3019
2862
|
setQuotesCount(count);
|
|
3020
2863
|
}
|
|
3021
2864
|
};
|
|
3022
|
-
return /* @__PURE__ */ (0,
|
|
3023
|
-
/* @__PURE__ */ (0,
|
|
2865
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ThemeProvider, { themeClass, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Dialog, { open, onOpenChange: handleClose, children: [
|
|
2866
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3024
2867
|
DialogContent,
|
|
3025
2868
|
{
|
|
3026
2869
|
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
2870
|
onPointerDownOutside: (e) => e.preventDefault(),
|
|
3028
2871
|
onInteractOutside: (e) => e.preventDefault(),
|
|
3029
|
-
children: view === "main" ? /* @__PURE__ */ (0,
|
|
3030
|
-
/* @__PURE__ */ (0,
|
|
2872
|
+
children: view === "main" ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
2873
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3031
2874
|
DepositHeader,
|
|
3032
2875
|
{
|
|
3033
2876
|
title: modalTitle || "Deposit",
|
|
3034
2877
|
onClose: handleClose
|
|
3035
2878
|
}
|
|
3036
2879
|
),
|
|
3037
|
-
/* @__PURE__ */ (0,
|
|
3038
|
-
/* @__PURE__ */ (0,
|
|
3039
|
-
/* @__PURE__ */ (0,
|
|
3040
|
-
!hideDepositTracker && /* @__PURE__ */ (0,
|
|
3041
|
-
] }) : /* @__PURE__ */ (0,
|
|
3042
|
-
/* @__PURE__ */ (0,
|
|
2880
|
+
/* @__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: [
|
|
2881
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SkeletonButton, { variant: "with-icons" }),
|
|
2882
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SkeletonButton, { variant: "with-icons" }),
|
|
2883
|
+
!hideDepositTracker && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SkeletonButton, {})
|
|
2884
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
2885
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3043
2886
|
TransferCryptoButton,
|
|
3044
2887
|
{
|
|
3045
2888
|
onClick: () => setView("transfer"),
|
|
@@ -3048,7 +2891,7 @@ function DepositModal({
|
|
|
3048
2891
|
featuredTokens: projectConfig.transfer_crypto.networks
|
|
3049
2892
|
}
|
|
3050
2893
|
),
|
|
3051
|
-
/* @__PURE__ */ (0,
|
|
2894
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3052
2895
|
DepositWithCardButton,
|
|
3053
2896
|
{
|
|
3054
2897
|
onClick: () => setView("card"),
|
|
@@ -3057,7 +2900,7 @@ function DepositModal({
|
|
|
3057
2900
|
paymentNetworks: projectConfig.payment_networks.networks
|
|
3058
2901
|
}
|
|
3059
2902
|
),
|
|
3060
|
-
!hideDepositTracker && /* @__PURE__ */ (0,
|
|
2903
|
+
!hideDepositTracker && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3061
2904
|
DepositTrackerButton,
|
|
3062
2905
|
{
|
|
3063
2906
|
onClick: () => setDepositsModalOpen(true),
|
|
@@ -3067,8 +2910,8 @@ function DepositModal({
|
|
|
3067
2910
|
}
|
|
3068
2911
|
)
|
|
3069
2912
|
] }) })
|
|
3070
|
-
] }) : view === "transfer" ? /* @__PURE__ */ (0,
|
|
3071
|
-
/* @__PURE__ */ (0,
|
|
2913
|
+
] }) : view === "transfer" ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
2914
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3072
2915
|
DepositHeader,
|
|
3073
2916
|
{
|
|
3074
2917
|
title: t3.transferCrypto.title,
|
|
@@ -3077,7 +2920,7 @@ function DepositModal({
|
|
|
3077
2920
|
onClose: handleClose
|
|
3078
2921
|
}
|
|
3079
2922
|
),
|
|
3080
|
-
/* @__PURE__ */ (0,
|
|
2923
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3081
2924
|
TransferCrypto,
|
|
3082
2925
|
{
|
|
3083
2926
|
userId,
|
|
@@ -3092,18 +2935,18 @@ function DepositModal({
|
|
|
3092
2935
|
wallets
|
|
3093
2936
|
}
|
|
3094
2937
|
)
|
|
3095
|
-
] }) : /* @__PURE__ */ (0,
|
|
3096
|
-
/* @__PURE__ */ (0,
|
|
2938
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
2939
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3097
2940
|
DepositHeader,
|
|
3098
2941
|
{
|
|
3099
|
-
title: cardView === "quotes" ? t3.quotes :
|
|
2942
|
+
title: cardView === "quotes" ? t3.quotes : t3.depositWithCard.title,
|
|
3100
2943
|
showBack: true,
|
|
3101
2944
|
onBack: handleBack,
|
|
3102
2945
|
onClose: handleClose,
|
|
3103
2946
|
badge: cardView === "quotes" ? { count: quotesCount } : void 0
|
|
3104
2947
|
}
|
|
3105
2948
|
),
|
|
3106
|
-
/* @__PURE__ */ (0,
|
|
2949
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3107
2950
|
BuyWithCard,
|
|
3108
2951
|
{
|
|
3109
2952
|
userId,
|
|
@@ -3125,11 +2968,12 @@ function DepositModal({
|
|
|
3125
2968
|
] })
|
|
3126
2969
|
}
|
|
3127
2970
|
),
|
|
3128
|
-
/* @__PURE__ */ (0,
|
|
2971
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3129
2972
|
DepositsModal,
|
|
3130
2973
|
{
|
|
3131
2974
|
open: depositsModalOpen,
|
|
3132
2975
|
onOpenChange: setDepositsModalOpen,
|
|
2976
|
+
onCloseAll: handleClose,
|
|
3133
2977
|
executions: depositExecutions,
|
|
3134
2978
|
userId,
|
|
3135
2979
|
publishableKey,
|
|
@@ -3140,9 +2984,9 @@ function DepositModal({
|
|
|
3140
2984
|
}
|
|
3141
2985
|
|
|
3142
2986
|
// src/components/deposits/TransferCrypto2.tsx
|
|
3143
|
-
var
|
|
2987
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
3144
2988
|
function TransferCrypto2(props) {
|
|
3145
|
-
return /* @__PURE__ */ (0,
|
|
2989
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3146
2990
|
TransferCryptoBase,
|
|
3147
2991
|
{
|
|
3148
2992
|
...props,
|
|
@@ -3151,6 +2995,56 @@ function TransferCrypto2(props) {
|
|
|
3151
2995
|
}
|
|
3152
2996
|
);
|
|
3153
2997
|
}
|
|
2998
|
+
|
|
2999
|
+
// src/components/shared/button.tsx
|
|
3000
|
+
var React5 = __toESM(require("react"));
|
|
3001
|
+
var import_react_slot = require("@radix-ui/react-slot");
|
|
3002
|
+
var import_class_variance_authority = require("class-variance-authority");
|
|
3003
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
3004
|
+
var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
3005
|
+
"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",
|
|
3006
|
+
{
|
|
3007
|
+
variants: {
|
|
3008
|
+
variant: {
|
|
3009
|
+
default: "uf-bg-primary uf-text-primary-foreground hover:uf-bg-primary/90",
|
|
3010
|
+
destructive: "uf-bg-destructive uf-text-destructive-foreground hover:uf-bg-destructive/90",
|
|
3011
|
+
outline: "uf-border uf-border-input uf-bg-background hover:uf-bg-accent hover:uf-text-accent-foreground",
|
|
3012
|
+
secondary: "uf-bg-secondary uf-text-secondary-foreground hover:uf-bg-secondary/80",
|
|
3013
|
+
ghost: "hover:uf-bg-accent hover:uf-text-accent-foreground",
|
|
3014
|
+
link: "uf-text-primary uf-underline-offset-4 hover:uf-underline"
|
|
3015
|
+
},
|
|
3016
|
+
size: {
|
|
3017
|
+
default: "uf-h-10 uf-px-4 uf-py-2",
|
|
3018
|
+
sm: "uf-h-9 uf-rounded-md uf-px-3",
|
|
3019
|
+
lg: "uf-h-11 uf-rounded-md uf-px-8",
|
|
3020
|
+
icon: "uf-h-10 uf-w-10"
|
|
3021
|
+
}
|
|
3022
|
+
},
|
|
3023
|
+
defaultVariants: {
|
|
3024
|
+
variant: "default",
|
|
3025
|
+
size: "default"
|
|
3026
|
+
}
|
|
3027
|
+
}
|
|
3028
|
+
);
|
|
3029
|
+
var Button = React5.forwardRef(
|
|
3030
|
+
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
3031
|
+
const Comp = asChild ? import_react_slot.Slot : "button";
|
|
3032
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3033
|
+
Comp,
|
|
3034
|
+
{
|
|
3035
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
3036
|
+
ref,
|
|
3037
|
+
...props
|
|
3038
|
+
}
|
|
3039
|
+
);
|
|
3040
|
+
}
|
|
3041
|
+
);
|
|
3042
|
+
Button.displayName = "Button";
|
|
3043
|
+
|
|
3044
|
+
// src/index.ts
|
|
3045
|
+
var import_core9 = require("@unifold/core");
|
|
3046
|
+
var import_core10 = require("@unifold/core");
|
|
3047
|
+
var import_core11 = require("@unifold/core");
|
|
3154
3048
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3155
3049
|
0 && (module.exports = {
|
|
3156
3050
|
Button,
|
|
@@ -3158,7 +3052,7 @@ function TransferCrypto2(props) {
|
|
|
3158
3052
|
CurrencyListItem,
|
|
3159
3053
|
CurrencyListSection,
|
|
3160
3054
|
CurrencyModal,
|
|
3161
|
-
|
|
3055
|
+
DepositDetailContent,
|
|
3162
3056
|
DepositExecutionItem,
|
|
3163
3057
|
DepositHeader,
|
|
3164
3058
|
DepositModal,
|
|
@@ -3200,14 +3094,18 @@ function TransferCrypto2(props) {
|
|
|
3200
3094
|
TransferCryptoButton,
|
|
3201
3095
|
buttonVariants,
|
|
3202
3096
|
cn,
|
|
3203
|
-
|
|
3097
|
+
createDepositAddress,
|
|
3204
3098
|
createMeldSession,
|
|
3205
3099
|
getApiBaseUrl,
|
|
3100
|
+
getChainName,
|
|
3206
3101
|
getFiatCurrencies,
|
|
3207
3102
|
getIconUrl,
|
|
3208
3103
|
getIconUrlWithCdn,
|
|
3209
3104
|
getMeldQuotes,
|
|
3105
|
+
getPreferredIconUrl,
|
|
3106
|
+
getProjectConfig,
|
|
3210
3107
|
getSupportedDepositTokens,
|
|
3108
|
+
getTokenChains,
|
|
3211
3109
|
getWalletByChainType,
|
|
3212
3110
|
i18n,
|
|
3213
3111
|
queryExecutions,
|