@unifold/connect-react 0.1.18 → 0.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +278 -154
- package/dist/index.mjs +278 -154
- package/dist/styles-base.css +1 -1
- package/dist/styles.css +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1343,6 +1343,12 @@ var Clock = createLucideIcon("Clock", [
|
|
|
1343
1343
|
["polyline", { points: "12 6 12 12 16 14", key: "68esgv" }]
|
|
1344
1344
|
]);
|
|
1345
1345
|
|
|
1346
|
+
// ../../node_modules/.pnpm/lucide-react@0.454.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/copy.js
|
|
1347
|
+
var Copy = createLucideIcon("Copy", [
|
|
1348
|
+
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
1349
|
+
["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
|
|
1350
|
+
]);
|
|
1351
|
+
|
|
1346
1352
|
// ../../node_modules/.pnpm/lucide-react@0.454.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/credit-card.js
|
|
1347
1353
|
var CreditCard = createLucideIcon("CreditCard", [
|
|
1348
1354
|
["rect", { width: "20", height: "14", x: "2", y: "5", rx: "2", key: "ynyp8z" }],
|
|
@@ -10628,10 +10634,7 @@ var DialogTitle2 = React210.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
10628
10634
|
Title,
|
|
10629
10635
|
{
|
|
10630
10636
|
ref,
|
|
10631
|
-
className: cn(
|
|
10632
|
-
"uf-leading-none uf-tracking-tight",
|
|
10633
|
-
className
|
|
10634
|
-
),
|
|
10637
|
+
className: cn("uf-leading-none uf-tracking-tight", className),
|
|
10635
10638
|
...props
|
|
10636
10639
|
}
|
|
10637
10640
|
));
|
|
@@ -10835,16 +10838,26 @@ function DepositExecutionItem({
|
|
|
10835
10838
|
}
|
|
10836
10839
|
)
|
|
10837
10840
|
}
|
|
10838
|
-
) }) : /* @__PURE__ */ (0, import_jsx_runtime22.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_runtime22.jsx)(
|
|
10839
|
-
"
|
|
10841
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime22.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_runtime22.jsx)(
|
|
10842
|
+
"svg",
|
|
10840
10843
|
{
|
|
10841
|
-
|
|
10842
|
-
|
|
10843
|
-
|
|
10844
|
-
|
|
10845
|
-
|
|
10844
|
+
width: "10",
|
|
10845
|
+
height: "10",
|
|
10846
|
+
viewBox: "0 0 12 12",
|
|
10847
|
+
fill: "none",
|
|
10848
|
+
className: "uf-block",
|
|
10849
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
10850
|
+
"path",
|
|
10851
|
+
{
|
|
10852
|
+
d: "M10 3L4.5 8.5L2 6",
|
|
10853
|
+
stroke: "white",
|
|
10854
|
+
strokeWidth: "2",
|
|
10855
|
+
strokeLinecap: "round",
|
|
10856
|
+
strokeLinejoin: "round"
|
|
10857
|
+
}
|
|
10858
|
+
)
|
|
10846
10859
|
}
|
|
10847
|
-
) })
|
|
10860
|
+
) })
|
|
10848
10861
|
] }),
|
|
10849
10862
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "uf-flex-1 uf-min-w-0", children: [
|
|
10850
10863
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h3", { className: "uf-text-foreground uf-font-medium uf-text-sm uf-leading-tight", children: isPending ? "Deposit processing" : "Deposit completed" }),
|
|
@@ -11016,7 +11029,10 @@ function DepositDetailContent({ execution }) {
|
|
|
11016
11029
|
/* @__PURE__ */ (0, import_jsx_runtime23.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: [
|
|
11017
11030
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Amount Sent" }),
|
|
11018
11031
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "uf-text-foreground uf-font-medium", children: [
|
|
11019
|
-
formatAmount(
|
|
11032
|
+
formatAmount(
|
|
11033
|
+
execution.source_amount_base_unit,
|
|
11034
|
+
execution.source_token_metadata?.decimals
|
|
11035
|
+
),
|
|
11020
11036
|
" ",
|
|
11021
11037
|
formatCurrency(execution.source_currency)
|
|
11022
11038
|
] })
|
|
@@ -11024,22 +11040,34 @@ function DepositDetailContent({ execution }) {
|
|
|
11024
11040
|
/* @__PURE__ */ (0, import_jsx_runtime23.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: [
|
|
11025
11041
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Amount Received" }),
|
|
11026
11042
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "uf-text-foreground uf-font-medium", children: [
|
|
11027
|
-
formatAmount(
|
|
11043
|
+
formatAmount(
|
|
11044
|
+
execution.destination_amount_base_unit,
|
|
11045
|
+
execution.destination_token_metadata?.decimals
|
|
11046
|
+
),
|
|
11028
11047
|
" ",
|
|
11029
11048
|
formatCurrency(execution.destination_currency)
|
|
11030
11049
|
] })
|
|
11031
11050
|
] }),
|
|
11032
11051
|
/* @__PURE__ */ (0, import_jsx_runtime23.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: [
|
|
11033
11052
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "USD Value" }),
|
|
11034
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-foreground uf-font-medium", children: formatUsdAmount(
|
|
11053
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-foreground uf-font-medium", children: formatUsdAmount(
|
|
11054
|
+
execution.source_amount_usd,
|
|
11055
|
+
execution.source_amount_base_unit
|
|
11056
|
+
) })
|
|
11035
11057
|
] }),
|
|
11036
11058
|
/* @__PURE__ */ (0, import_jsx_runtime23.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: [
|
|
11037
11059
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Source Network" }),
|
|
11038
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-foreground uf-font-medium", children: getNetworkName(
|
|
11060
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-foreground uf-font-medium", children: getNetworkName(
|
|
11061
|
+
execution.source_chain_type,
|
|
11062
|
+
execution.source_chain_id
|
|
11063
|
+
) })
|
|
11039
11064
|
] }),
|
|
11040
11065
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3", children: [
|
|
11041
11066
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Destination Network" }),
|
|
11042
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-foreground uf-font-medium", children: getNetworkName(
|
|
11067
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-foreground uf-font-medium", children: getNetworkName(
|
|
11068
|
+
execution.destination_chain_type,
|
|
11069
|
+
execution.destination_chain_id
|
|
11070
|
+
) })
|
|
11043
11071
|
] })
|
|
11044
11072
|
] }),
|
|
11045
11073
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
@@ -11078,7 +11106,9 @@ function DepositDetailContent({ execution }) {
|
|
|
11078
11106
|
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",
|
|
11079
11107
|
children: [
|
|
11080
11108
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "uf-text-muted-foreground uf-text-sm", children: "Completion Tx" }),
|
|
11081
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "uf-text-sm uf-text-foreground uf-text-right", children: formatTransactionHash(
|
|
11109
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "uf-text-sm uf-text-foreground uf-text-right", children: formatTransactionHash(
|
|
11110
|
+
execution.destination_transaction_hashes[0]
|
|
11111
|
+
) }),
|
|
11082
11112
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ExternalLink, { className: "uf-w-3.5 uf-h-3.5 uf-text-muted-foreground uf-block" })
|
|
11083
11113
|
]
|
|
11084
11114
|
}
|
|
@@ -11138,36 +11168,42 @@ function DepositsModal({
|
|
|
11138
11168
|
const handleExecutionClick = (execution) => {
|
|
11139
11169
|
setSelectedExecution(execution);
|
|
11140
11170
|
};
|
|
11141
|
-
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Dialog2, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
11142
|
-
|
|
11143
|
-
|
|
11144
|
-
{
|
|
11145
|
-
|
|
11146
|
-
|
|
11147
|
-
|
|
11148
|
-
|
|
11149
|
-
|
|
11150
|
-
|
|
11151
|
-
|
|
11152
|
-
|
|
11153
|
-
|
|
11154
|
-
|
|
11155
|
-
|
|
11156
|
-
|
|
11157
|
-
|
|
11158
|
-
|
|
11159
|
-
|
|
11160
|
-
|
|
11161
|
-
|
|
11162
|
-
|
|
11163
|
-
|
|
11164
|
-
|
|
11165
|
-
|
|
11166
|
-
|
|
11167
|
-
|
|
11168
|
-
|
|
11169
|
-
|
|
11170
|
-
|
|
11171
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Dialog2, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
11172
|
+
DialogContent2,
|
|
11173
|
+
{
|
|
11174
|
+
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}`,
|
|
11175
|
+
children: selectedExecution ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
11176
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
11177
|
+
DepositHeader,
|
|
11178
|
+
{
|
|
11179
|
+
title: "Deposit Details",
|
|
11180
|
+
showBack: true,
|
|
11181
|
+
onBack: () => setSelectedExecution(null),
|
|
11182
|
+
onClose: handleClose
|
|
11183
|
+
}
|
|
11184
|
+
),
|
|
11185
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DepositDetailContent, { execution: selectedExecution })
|
|
11186
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
11187
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
11188
|
+
DepositHeader,
|
|
11189
|
+
{
|
|
11190
|
+
title: "Deposit Tracker",
|
|
11191
|
+
showBack: true,
|
|
11192
|
+
onBack: handleBack,
|
|
11193
|
+
onClose: handleClose
|
|
11194
|
+
}
|
|
11195
|
+
),
|
|
11196
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "uf-max-h-[400px] uf-overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:uf-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "uf-space-y-2", children: allExecutions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "uf-py-8 uf-px-4 uf-text-center", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "uf-text-muted-foreground uf-text-sm", children: "No deposits yet" }) }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_jsx_runtime24.Fragment, { children: allExecutions.map((execution) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
11197
|
+
DepositExecutionItem,
|
|
11198
|
+
{
|
|
11199
|
+
execution,
|
|
11200
|
+
onClick: () => handleExecutionClick(execution)
|
|
11201
|
+
},
|
|
11202
|
+
execution.id
|
|
11203
|
+
)) }) }) })
|
|
11204
|
+
] })
|
|
11205
|
+
}
|
|
11206
|
+
) });
|
|
11171
11207
|
}
|
|
11172
11208
|
function DepositSuccessToast({
|
|
11173
11209
|
depositTx,
|
|
@@ -11313,22 +11349,28 @@ function DepositSuccessToast({
|
|
|
11313
11349
|
}
|
|
11314
11350
|
)
|
|
11315
11351
|
] }) }),
|
|
11316
|
-
execution && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Dialog2, { open: detailModalOpen, onOpenChange: setDetailModalOpen, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
11317
|
-
|
|
11318
|
-
|
|
11319
|
-
|
|
11320
|
-
|
|
11321
|
-
|
|
11322
|
-
|
|
11323
|
-
|
|
11324
|
-
|
|
11325
|
-
|
|
11326
|
-
|
|
11327
|
-
|
|
11328
|
-
|
|
11329
|
-
|
|
11330
|
-
|
|
11331
|
-
|
|
11352
|
+
execution && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Dialog2, { open: detailModalOpen, onOpenChange: setDetailModalOpen, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
11353
|
+
DialogContent2,
|
|
11354
|
+
{
|
|
11355
|
+
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}`,
|
|
11356
|
+
children: [
|
|
11357
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "uf-flex uf-items-center uf-justify-between uf-px-4", children: [
|
|
11358
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "uf-w-8" }),
|
|
11359
|
+
" ",
|
|
11360
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("h2", { className: "uf-text-lg uf-font-semibold uf-text-foreground", children: "Deposit Details" }),
|
|
11361
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
11362
|
+
"button",
|
|
11363
|
+
{
|
|
11364
|
+
onClick: () => setDetailModalOpen(false),
|
|
11365
|
+
className: "uf-text-muted-foreground hover:uf-text-foreground uf-transition-colors uf-w-8 uf-flex uf-justify-end",
|
|
11366
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(X, { className: "uf-w-5 uf-h-5" })
|
|
11367
|
+
}
|
|
11368
|
+
)
|
|
11369
|
+
] }),
|
|
11370
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DepositDetailContent, { execution })
|
|
11371
|
+
]
|
|
11372
|
+
}
|
|
11373
|
+
) })
|
|
11332
11374
|
] });
|
|
11333
11375
|
}
|
|
11334
11376
|
var Select2 = Root23;
|
|
@@ -11411,7 +11453,10 @@ var SelectLabel2 = React38.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
11411
11453
|
Label,
|
|
11412
11454
|
{
|
|
11413
11455
|
ref,
|
|
11414
|
-
className: cn(
|
|
11456
|
+
className: cn(
|
|
11457
|
+
"uf-py-1.5 uf-pl-8 uf-pr-2 uf-text-sm uf-font-semibold",
|
|
11458
|
+
className
|
|
11459
|
+
),
|
|
11415
11460
|
...props
|
|
11416
11461
|
}
|
|
11417
11462
|
));
|
|
@@ -11651,7 +11696,9 @@ function TransferCryptoBase({
|
|
|
11651
11696
|
} catch (err) {
|
|
11652
11697
|
console.error("Error fetching wallets, retrying in 5s:", err);
|
|
11653
11698
|
if (!isCancelled) {
|
|
11654
|
-
setError(
|
|
11699
|
+
setError(
|
|
11700
|
+
err instanceof Error ? err.message : "Failed to load wallets"
|
|
11701
|
+
);
|
|
11655
11702
|
setLoading(false);
|
|
11656
11703
|
retryTimeout = setTimeout(fetchWallets, 5e3);
|
|
11657
11704
|
}
|
|
@@ -11896,21 +11943,28 @@ function TransferCryptoBase({
|
|
|
11896
11943
|
disabled: tokensLoading || availableChainsForToken.length === 0,
|
|
11897
11944
|
children: [
|
|
11898
11945
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(SelectTrigger2, { 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_runtime28.jsx)(SelectValue2, { children: tokensLoading ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime28.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_runtime28.jsx)("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "uf-text-xs uf-font-normal", children: chain }) }) }) }),
|
|
11899
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11900
|
-
|
|
11901
|
-
|
|
11902
|
-
|
|
11903
|
-
|
|
11904
|
-
|
|
11905
|
-
|
|
11906
|
-
|
|
11907
|
-
|
|
11908
|
-
|
|
11909
|
-
|
|
11910
|
-
|
|
11911
|
-
|
|
11912
|
-
|
|
11913
|
-
|
|
11946
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11947
|
+
SelectContent2,
|
|
11948
|
+
{
|
|
11949
|
+
align: "end",
|
|
11950
|
+
className: "uf-bg-secondary uf-border uf-text-foreground uf-max-h-[300px] uf-min-w-[200px]",
|
|
11951
|
+
children: availableChainsForToken.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime28.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) => {
|
|
11952
|
+
const chainKey = getChainKey(
|
|
11953
|
+
chainData.chain_id,
|
|
11954
|
+
chainData.chain_type
|
|
11955
|
+
);
|
|
11956
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11957
|
+
SelectItem2,
|
|
11958
|
+
{
|
|
11959
|
+
value: chainKey,
|
|
11960
|
+
className: "focus:uf-bg-accent focus:uf-text-foreground",
|
|
11961
|
+
children: renderChainItem(chainData, true)
|
|
11962
|
+
},
|
|
11963
|
+
`${chainData.chain_id}-${chainData.chain_type}`
|
|
11964
|
+
);
|
|
11965
|
+
})
|
|
11966
|
+
}
|
|
11967
|
+
)
|
|
11914
11968
|
]
|
|
11915
11969
|
}
|
|
11916
11970
|
)
|
|
@@ -11967,22 +12021,31 @@ function TransferCryptoBase({
|
|
|
11967
12021
|
)
|
|
11968
12022
|
] })
|
|
11969
12023
|
] }),
|
|
11970
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
11971
|
-
|
|
11972
|
-
|
|
11973
|
-
|
|
12024
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
12025
|
+
"span",
|
|
12026
|
+
{
|
|
12027
|
+
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"}`,
|
|
12028
|
+
children: [
|
|
12029
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Check, { className: "uf-w-3 uf-h-3" }),
|
|
12030
|
+
t.copied
|
|
12031
|
+
]
|
|
12032
|
+
}
|
|
12033
|
+
)
|
|
11974
12034
|
] }),
|
|
11975
|
-
loading ? /* @__PURE__ */ (0, import_jsx_runtime28.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_runtime28.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_runtime28.
|
|
11976
|
-
|
|
11977
|
-
|
|
11978
|
-
|
|
11979
|
-
|
|
11980
|
-
|
|
11981
|
-
|
|
11982
|
-
|
|
11983
|
-
|
|
12035
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime28.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_runtime28.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_runtime28.jsxs)("div", { className: "uf-relative", children: [
|
|
12036
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
12037
|
+
"button",
|
|
12038
|
+
{
|
|
12039
|
+
onClick: handleCopyAddress,
|
|
12040
|
+
disabled: !depositAddress,
|
|
12041
|
+
className: "uf-w-full uf-bg-secondary hover:uf-bg-accent uf-rounded-lg uf-px-2.5 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",
|
|
12042
|
+
children: depositAddress || t.noAddressAvailable
|
|
12043
|
+
}
|
|
12044
|
+
),
|
|
12045
|
+
depositAddress && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "uf-absolute uf-right-3 uf-top-1/2 uf--translate-y-1/2 uf-text-muted-foreground uf-pointer-events-none", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Copy, { className: "uf-w-3 uf-h-3" }) })
|
|
12046
|
+
] })
|
|
11984
12047
|
] }),
|
|
11985
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "uf-bg-secondary uf-rounded-xl uf-px-
|
|
12048
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "uf-bg-secondary uf-rounded-xl uf-px-2.5", children: [
|
|
11986
12049
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
11987
12050
|
"button",
|
|
11988
12051
|
{
|
|
@@ -12244,52 +12307,58 @@ function CurrencyModal({
|
|
|
12244
12307
|
onOpenChange(false);
|
|
12245
12308
|
setSearchQuery("");
|
|
12246
12309
|
};
|
|
12247
|
-
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Dialog2, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
12248
|
-
|
|
12249
|
-
|
|
12250
|
-
{
|
|
12251
|
-
|
|
12252
|
-
|
|
12253
|
-
|
|
12254
|
-
|
|
12255
|
-
|
|
12256
|
-
|
|
12257
|
-
|
|
12258
|
-
|
|
12259
|
-
|
|
12260
|
-
|
|
12261
|
-
{
|
|
12262
|
-
|
|
12263
|
-
|
|
12264
|
-
|
|
12265
|
-
|
|
12266
|
-
|
|
12267
|
-
|
|
12268
|
-
|
|
12269
|
-
|
|
12270
|
-
|
|
12271
|
-
|
|
12272
|
-
|
|
12273
|
-
|
|
12274
|
-
|
|
12275
|
-
|
|
12276
|
-
|
|
12277
|
-
|
|
12278
|
-
|
|
12279
|
-
|
|
12280
|
-
|
|
12281
|
-
|
|
12282
|
-
|
|
12283
|
-
|
|
12284
|
-
|
|
12285
|
-
|
|
12286
|
-
|
|
12287
|
-
|
|
12288
|
-
|
|
12289
|
-
|
|
12290
|
-
|
|
12291
|
-
|
|
12292
|
-
|
|
12310
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Dialog2, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
12311
|
+
DialogContent2,
|
|
12312
|
+
{
|
|
12313
|
+
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}`,
|
|
12314
|
+
children: [
|
|
12315
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
12316
|
+
DepositHeader,
|
|
12317
|
+
{
|
|
12318
|
+
title: "Currency",
|
|
12319
|
+
showBack: true,
|
|
12320
|
+
onBack: handleClose,
|
|
12321
|
+
onClose: handleClose
|
|
12322
|
+
}
|
|
12323
|
+
),
|
|
12324
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "uf-relative", children: [
|
|
12325
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(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" }),
|
|
12326
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
12327
|
+
"input",
|
|
12328
|
+
{
|
|
12329
|
+
type: "text",
|
|
12330
|
+
value: searchQuery,
|
|
12331
|
+
onChange: (e) => setSearchQuery(e.target.value),
|
|
12332
|
+
placeholder: "Search",
|
|
12333
|
+
className: "uf-w-full uf-bg-secondary uf-rounded-xl uf-pl-11 uf-pr-4 uf-py-2.5 uf-text-sm uf-text-foreground uf-placeholder-muted-foreground uf-outline-none focus:uf-ring-2 focus:uf-ring-ring/30"
|
|
12334
|
+
}
|
|
12335
|
+
)
|
|
12336
|
+
] }) }),
|
|
12337
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "uf-max-h-[500px] uf-overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:uf-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "uf-space-y-2", children: [
|
|
12338
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
12339
|
+
CurrencyListSection,
|
|
12340
|
+
{
|
|
12341
|
+
title: "Popular currencies",
|
|
12342
|
+
currencies: filteredPreferred,
|
|
12343
|
+
selectedCurrency,
|
|
12344
|
+
onSelect: handleSelect
|
|
12345
|
+
}
|
|
12346
|
+
),
|
|
12347
|
+
filteredPreferred.length > 0 && filteredOther.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "uf-h-2" }),
|
|
12348
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
12349
|
+
CurrencyListSection,
|
|
12350
|
+
{
|
|
12351
|
+
title: "All currencies",
|
|
12352
|
+
currencies: filteredOther,
|
|
12353
|
+
selectedCurrency,
|
|
12354
|
+
onSelect: handleSelect
|
|
12355
|
+
}
|
|
12356
|
+
),
|
|
12357
|
+
filteredPreferred.length === 0 && filteredOther.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "uf-text-center uf-py-8 uf-text-muted-foreground uf-text-sm", children: "No currencies found" })
|
|
12358
|
+
] }) })
|
|
12359
|
+
]
|
|
12360
|
+
}
|
|
12361
|
+
) });
|
|
12293
12362
|
}
|
|
12294
12363
|
function useUserIp2() {
|
|
12295
12364
|
const {
|
|
@@ -12387,7 +12456,9 @@ function BuyWithCard({
|
|
|
12387
12456
|
const [autoSelectedProvider, setAutoSelectedProvider] = (0, import_react14.useState)(null);
|
|
12388
12457
|
const [hasManualSelection, setHasManualSelection] = (0, import_react14.useState)(false);
|
|
12389
12458
|
const [internalWallets, setInternalWallets] = (0, import_react14.useState)([]);
|
|
12390
|
-
const [walletsLoading, setWalletsLoading] = (0, import_react14.useState)(
|
|
12459
|
+
const [walletsLoading, setWalletsLoading] = (0, import_react14.useState)(
|
|
12460
|
+
!externalWallets?.length
|
|
12461
|
+
);
|
|
12391
12462
|
const wallets = externalWallets?.length ? externalWallets : internalWallets;
|
|
12392
12463
|
const [countdown, setCountdown] = (0, import_react14.useState)(60);
|
|
12393
12464
|
const [fiatCurrencies, setFiatCurrencies] = (0, import_react14.useState)([]);
|
|
@@ -12460,7 +12531,15 @@ function BuyWithCard({
|
|
|
12460
12531
|
clearTimeout(retryTimeout);
|
|
12461
12532
|
}
|
|
12462
12533
|
};
|
|
12463
|
-
}, [
|
|
12534
|
+
}, [
|
|
12535
|
+
userId,
|
|
12536
|
+
recipientAddress,
|
|
12537
|
+
destinationChainType,
|
|
12538
|
+
destinationChainId,
|
|
12539
|
+
destinationTokenAddress,
|
|
12540
|
+
publishableKey,
|
|
12541
|
+
externalWallets
|
|
12542
|
+
]);
|
|
12464
12543
|
(0, import_react14.useEffect)(() => {
|
|
12465
12544
|
async function fetchSupportedTokens() {
|
|
12466
12545
|
try {
|
|
@@ -12644,7 +12723,10 @@ function BuyWithCard({
|
|
|
12644
12723
|
selectedCurrencyData && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
12645
12724
|
"img",
|
|
12646
12725
|
{
|
|
12647
|
-
src: getPreferredIconUrl(
|
|
12726
|
+
src: getPreferredIconUrl(
|
|
12727
|
+
selectedCurrencyData.icon_urls,
|
|
12728
|
+
"png"
|
|
12729
|
+
) || selectedCurrencyData.icon_url,
|
|
12648
12730
|
alt: selectedCurrencyData.name,
|
|
12649
12731
|
className: "uf-w-4 uf-h-4"
|
|
12650
12732
|
}
|
|
@@ -12877,7 +12959,10 @@ function BuyWithCard({
|
|
|
12877
12959
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
12878
12960
|
"img",
|
|
12879
12961
|
{
|
|
12880
|
-
src: getIconUrlWithCdn(
|
|
12962
|
+
src: getIconUrlWithCdn(
|
|
12963
|
+
"/icons/tokens/png/usdc.png",
|
|
12964
|
+
assetCdnUrl
|
|
12965
|
+
),
|
|
12881
12966
|
alt: "USDC",
|
|
12882
12967
|
className: "uf-w-7 uf-h-7 uf-rounded-full"
|
|
12883
12968
|
}
|
|
@@ -12885,7 +12970,10 @@ function BuyWithCard({
|
|
|
12885
12970
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
12886
12971
|
"img",
|
|
12887
12972
|
{
|
|
12888
|
-
src: getIconUrlWithCdn(
|
|
12973
|
+
src: getIconUrlWithCdn(
|
|
12974
|
+
"/icons/networks/png/polygon.png",
|
|
12975
|
+
assetCdnUrl
|
|
12976
|
+
),
|
|
12889
12977
|
alt: "Polygon",
|
|
12890
12978
|
className: "uf-w-3.5 uf-h-3.5 uf-absolute -uf-bottom-0.5 -uf-right-0.5 uf-rounded-full"
|
|
12891
12979
|
}
|
|
@@ -12900,7 +12988,10 @@ function BuyWithCard({
|
|
|
12900
12988
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
12901
12989
|
"img",
|
|
12902
12990
|
{
|
|
12903
|
-
src: destinationToken?.icon_url || getIconUrlWithCdn(
|
|
12991
|
+
src: destinationToken?.icon_url || getIconUrlWithCdn(
|
|
12992
|
+
"/icons/tokens/png/usdc.png",
|
|
12993
|
+
assetCdnUrl
|
|
12994
|
+
),
|
|
12904
12995
|
alt: displayTokenSymbol,
|
|
12905
12996
|
className: "uf-w-7 uf-h-7 uf-rounded-full"
|
|
12906
12997
|
}
|
|
@@ -13083,7 +13174,9 @@ function useAllowedCountry(publishableKey) {
|
|
|
13083
13174
|
if (ipData && configData) {
|
|
13084
13175
|
const blockedCodes = configData.blocked_country_codes || [];
|
|
13085
13176
|
const userCountryUpper = ipData.alpha2.toUpperCase();
|
|
13086
|
-
isAllowed = !blockedCodes.some(
|
|
13177
|
+
isAllowed = !blockedCodes.some(
|
|
13178
|
+
(code) => code.toUpperCase() === userCountryUpper
|
|
13179
|
+
);
|
|
13087
13180
|
}
|
|
13088
13181
|
return {
|
|
13089
13182
|
isAllowed,
|
|
@@ -13094,7 +13187,9 @@ function useAllowedCountry(publishableKey) {
|
|
|
13094
13187
|
error
|
|
13095
13188
|
};
|
|
13096
13189
|
}
|
|
13097
|
-
function SkeletonButton({
|
|
13190
|
+
function SkeletonButton({
|
|
13191
|
+
variant = "default"
|
|
13192
|
+
}) {
|
|
13098
13193
|
return /* @__PURE__ */ (0, import_jsx_runtime37.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: [
|
|
13099
13194
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
13100
13195
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "uf-bg-muted uf-rounded-lg uf-w-9 uf-h-9" }),
|
|
@@ -13104,7 +13199,13 @@ function SkeletonButton({ variant = "default" }) {
|
|
|
13104
13199
|
] })
|
|
13105
13200
|
] }),
|
|
13106
13201
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
13107
|
-
variant === "with-icons" && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "uf-flex uf--space-x-1", children: [1, 2, 3].map((i) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
13202
|
+
variant === "with-icons" && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "uf-flex uf--space-x-1", children: [1, 2, 3].map((i) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
13203
|
+
"div",
|
|
13204
|
+
{
|
|
13205
|
+
className: "uf-w-5 uf-h-5 uf-rounded-full uf-bg-muted uf-border-2 uf-border-secondary"
|
|
13206
|
+
},
|
|
13207
|
+
i
|
|
13208
|
+
)) }),
|
|
13108
13209
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ChevronRight, { className: "uf-w-4 uf-h-4 uf-text-muted" })
|
|
13109
13210
|
] })
|
|
13110
13211
|
] });
|
|
@@ -13141,8 +13242,17 @@ function DepositModal({
|
|
|
13141
13242
|
}, [publishableKey]);
|
|
13142
13243
|
(0, import_react8.useEffect)(() => {
|
|
13143
13244
|
setWallets([]);
|
|
13144
|
-
}, [
|
|
13145
|
-
|
|
13245
|
+
}, [
|
|
13246
|
+
userId,
|
|
13247
|
+
recipientAddress,
|
|
13248
|
+
destinationChainType,
|
|
13249
|
+
destinationChainId,
|
|
13250
|
+
destinationTokenAddress,
|
|
13251
|
+
publishableKey
|
|
13252
|
+
]);
|
|
13253
|
+
const [resolvedTheme, setResolvedTheme] = (0, import_react8.useState)(
|
|
13254
|
+
theme === "auto" ? "dark" : theme
|
|
13255
|
+
);
|
|
13146
13256
|
(0, import_react8.useEffect)(() => {
|
|
13147
13257
|
if (theme === "auto") {
|
|
13148
13258
|
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
@@ -13161,7 +13271,11 @@ function DepositModal({
|
|
|
13161
13271
|
getProjectConfig(publishableKey).then(setProjectConfig).catch(console.error);
|
|
13162
13272
|
}
|
|
13163
13273
|
}, [open, publishableKey, projectConfig]);
|
|
13164
|
-
const {
|
|
13274
|
+
const {
|
|
13275
|
+
isAllowed,
|
|
13276
|
+
isLoading: isCountryLoading,
|
|
13277
|
+
error: countryError
|
|
13278
|
+
} = useAllowedCountry(publishableKey);
|
|
13165
13279
|
(0, import_react8.useEffect)(() => {
|
|
13166
13280
|
if (!open || wallets.length > 0) return;
|
|
13167
13281
|
let retryTimeout = null;
|
|
@@ -13199,7 +13313,16 @@ function DepositModal({
|
|
|
13199
13313
|
clearTimeout(retryTimeout);
|
|
13200
13314
|
}
|
|
13201
13315
|
};
|
|
13202
|
-
}, [
|
|
13316
|
+
}, [
|
|
13317
|
+
open,
|
|
13318
|
+
userId,
|
|
13319
|
+
recipientAddress,
|
|
13320
|
+
destinationChainType,
|
|
13321
|
+
destinationChainId,
|
|
13322
|
+
destinationTokenAddress,
|
|
13323
|
+
publishableKey,
|
|
13324
|
+
wallets.length
|
|
13325
|
+
]);
|
|
13203
13326
|
const themeClass = resolvedTheme === "dark" ? "uf-dark" : "";
|
|
13204
13327
|
const handleClose = () => {
|
|
13205
13328
|
onOpenChange(false);
|
|
@@ -13575,6 +13698,7 @@ lucide-react/dist/esm/icons/chevron-down.js:
|
|
|
13575
13698
|
lucide-react/dist/esm/icons/chevron-right.js:
|
|
13576
13699
|
lucide-react/dist/esm/icons/chevron-up.js:
|
|
13577
13700
|
lucide-react/dist/esm/icons/clock.js:
|
|
13701
|
+
lucide-react/dist/esm/icons/copy.js:
|
|
13578
13702
|
lucide-react/dist/esm/icons/credit-card.js:
|
|
13579
13703
|
lucide-react/dist/esm/icons/dollar-sign.js:
|
|
13580
13704
|
lucide-react/dist/esm/icons/external-link.js:
|