@unifold/connect-react 0.1.6 → 0.1.8
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 +1073 -720
- package/dist/index.mjs +1081 -728
- package/dist/styles.css +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1226,6 +1226,158 @@ function useUnifold() {
|
|
|
1226
1226
|
|
|
1227
1227
|
// ../ui-react/dist/index.mjs
|
|
1228
1228
|
var import_react7 = require("react");
|
|
1229
|
+
|
|
1230
|
+
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
|
1231
|
+
var import_react2 = require("react");
|
|
1232
|
+
|
|
1233
|
+
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/defaultAttributes.js
|
|
1234
|
+
var defaultAttributes = {
|
|
1235
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1236
|
+
width: 24,
|
|
1237
|
+
height: 24,
|
|
1238
|
+
viewBox: "0 0 24 24",
|
|
1239
|
+
fill: "none",
|
|
1240
|
+
stroke: "currentColor",
|
|
1241
|
+
strokeWidth: 2,
|
|
1242
|
+
strokeLinecap: "round",
|
|
1243
|
+
strokeLinejoin: "round"
|
|
1244
|
+
};
|
|
1245
|
+
|
|
1246
|
+
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
|
1247
|
+
var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase().trim();
|
|
1248
|
+
var createLucideIcon = (iconName, iconNode) => {
|
|
1249
|
+
const Component = (0, import_react2.forwardRef)(
|
|
1250
|
+
({ color = "currentColor", size: size4 = 24, strokeWidth = 2, absoluteStrokeWidth, className = "", children, ...rest }, ref) => (0, import_react2.createElement)(
|
|
1251
|
+
"svg",
|
|
1252
|
+
{
|
|
1253
|
+
ref,
|
|
1254
|
+
...defaultAttributes,
|
|
1255
|
+
width: size4,
|
|
1256
|
+
height: size4,
|
|
1257
|
+
stroke: color,
|
|
1258
|
+
strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size4) : strokeWidth,
|
|
1259
|
+
className: ["lucide", `lucide-${toKebabCase(iconName)}`, className].join(" "),
|
|
1260
|
+
...rest
|
|
1261
|
+
},
|
|
1262
|
+
[
|
|
1263
|
+
...iconNode.map(([tag, attrs]) => (0, import_react2.createElement)(tag, attrs)),
|
|
1264
|
+
...Array.isArray(children) ? children : [children]
|
|
1265
|
+
]
|
|
1266
|
+
)
|
|
1267
|
+
);
|
|
1268
|
+
Component.displayName = `${iconName}`;
|
|
1269
|
+
return Component;
|
|
1270
|
+
};
|
|
1271
|
+
|
|
1272
|
+
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/arrow-down-circle.js
|
|
1273
|
+
var ArrowDownCircle = createLucideIcon("ArrowDownCircle", [
|
|
1274
|
+
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
1275
|
+
["path", { d: "M12 8v8", key: "napkw2" }],
|
|
1276
|
+
["path", { d: "m8 12 4 4 4-4", key: "k98ssh" }]
|
|
1277
|
+
]);
|
|
1278
|
+
|
|
1279
|
+
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/arrow-left.js
|
|
1280
|
+
var ArrowLeft = createLucideIcon("ArrowLeft", [
|
|
1281
|
+
["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
|
|
1282
|
+
["path", { d: "M19 12H5", key: "x3x0zl" }]
|
|
1283
|
+
]);
|
|
1284
|
+
|
|
1285
|
+
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/check-circle.js
|
|
1286
|
+
var CheckCircle = createLucideIcon("CheckCircle", [
|
|
1287
|
+
["path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14", key: "g774vq" }],
|
|
1288
|
+
["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
|
|
1289
|
+
]);
|
|
1290
|
+
|
|
1291
|
+
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/check.js
|
|
1292
|
+
var Check = createLucideIcon("Check", [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]]);
|
|
1293
|
+
|
|
1294
|
+
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/chevron-down.js
|
|
1295
|
+
var ChevronDown = createLucideIcon("ChevronDown", [
|
|
1296
|
+
["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]
|
|
1297
|
+
]);
|
|
1298
|
+
|
|
1299
|
+
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/chevron-right.js
|
|
1300
|
+
var ChevronRight = createLucideIcon("ChevronRight", [
|
|
1301
|
+
["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]
|
|
1302
|
+
]);
|
|
1303
|
+
|
|
1304
|
+
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/chevron-up.js
|
|
1305
|
+
var ChevronUp = createLucideIcon("ChevronUp", [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]]);
|
|
1306
|
+
|
|
1307
|
+
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/clock.js
|
|
1308
|
+
var Clock = createLucideIcon("Clock", [
|
|
1309
|
+
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
1310
|
+
["polyline", { points: "12 6 12 12 16 14", key: "68esgv" }]
|
|
1311
|
+
]);
|
|
1312
|
+
|
|
1313
|
+
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/copy.js
|
|
1314
|
+
var Copy = createLucideIcon("Copy", [
|
|
1315
|
+
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
1316
|
+
["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" }]
|
|
1317
|
+
]);
|
|
1318
|
+
|
|
1319
|
+
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/credit-card.js
|
|
1320
|
+
var CreditCard = createLucideIcon("CreditCard", [
|
|
1321
|
+
["rect", { width: "20", height: "14", x: "2", y: "5", rx: "2", key: "ynyp8z" }],
|
|
1322
|
+
["line", { x1: "2", x2: "22", y1: "10", y2: "10", key: "1b3vmo" }]
|
|
1323
|
+
]);
|
|
1324
|
+
|
|
1325
|
+
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/dollar-sign.js
|
|
1326
|
+
var DollarSign = createLucideIcon("DollarSign", [
|
|
1327
|
+
["line", { x1: "12", x2: "12", y1: "2", y2: "22", key: "7eqyqh" }],
|
|
1328
|
+
["path", { d: "M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6", key: "1b0p4s" }]
|
|
1329
|
+
]);
|
|
1330
|
+
|
|
1331
|
+
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/external-link.js
|
|
1332
|
+
var ExternalLink = createLucideIcon("ExternalLink", [
|
|
1333
|
+
["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }],
|
|
1334
|
+
["polyline", { points: "15 3 21 3 21 9", key: "mznyad" }],
|
|
1335
|
+
["line", { x1: "10", x2: "21", y1: "14", y2: "3", key: "18c3s4" }]
|
|
1336
|
+
]);
|
|
1337
|
+
|
|
1338
|
+
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/file-text.js
|
|
1339
|
+
var FileText = createLucideIcon("FileText", [
|
|
1340
|
+
[
|
|
1341
|
+
"path",
|
|
1342
|
+
{ d: "M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z", key: "1nnpy2" }
|
|
1343
|
+
],
|
|
1344
|
+
["polyline", { points: "14 2 14 8 20 8", key: "1ew0cm" }],
|
|
1345
|
+
["line", { x1: "16", x2: "8", y1: "13", y2: "13", key: "14keom" }],
|
|
1346
|
+
["line", { x1: "16", x2: "8", y1: "17", y2: "17", key: "17nazh" }],
|
|
1347
|
+
["line", { x1: "10", x2: "8", y1: "9", y2: "9", key: "1a5vjj" }]
|
|
1348
|
+
]);
|
|
1349
|
+
|
|
1350
|
+
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/info.js
|
|
1351
|
+
var Info = createLucideIcon("Info", [
|
|
1352
|
+
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
1353
|
+
["path", { d: "M12 16v-4", key: "1dtifu" }],
|
|
1354
|
+
["path", { d: "M12 8h.01", key: "e9boi3" }]
|
|
1355
|
+
]);
|
|
1356
|
+
|
|
1357
|
+
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/search.js
|
|
1358
|
+
var Search = createLucideIcon("Search", [
|
|
1359
|
+
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
|
|
1360
|
+
["path", { d: "m21 21-4.3-4.3", key: "1qie3q" }]
|
|
1361
|
+
]);
|
|
1362
|
+
|
|
1363
|
+
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/shield-check.js
|
|
1364
|
+
var ShieldCheck = createLucideIcon("ShieldCheck", [
|
|
1365
|
+
["path", { d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10", key: "1irkt0" }],
|
|
1366
|
+
["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
|
|
1367
|
+
]);
|
|
1368
|
+
|
|
1369
|
+
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/x.js
|
|
1370
|
+
var X = createLucideIcon("X", [
|
|
1371
|
+
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
1372
|
+
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
1373
|
+
]);
|
|
1374
|
+
|
|
1375
|
+
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/zap.js
|
|
1376
|
+
var Zap = createLucideIcon("Zap", [
|
|
1377
|
+
["polygon", { points: "13 2 3 14 12 14 11 22 21 10 12 10 13 2", key: "45s27k" }]
|
|
1378
|
+
]);
|
|
1379
|
+
|
|
1380
|
+
// ../ui-react/dist/index.mjs
|
|
1229
1381
|
var React210 = __toESM(require("react"), 1);
|
|
1230
1382
|
|
|
1231
1383
|
// ../../node_modules/.pnpm/@radix-ui+react-dialog@1.1.15_@types+react-dom@18.3.7_@types+react@18.3.27__@types+react@18.3_bwdzsrsjkenptt5ry5km67dkui/node_modules/@radix-ui/react-dialog/dist/index.mjs
|
|
@@ -2240,9 +2392,9 @@ function assignRef(ref, value) {
|
|
|
2240
2392
|
}
|
|
2241
2393
|
|
|
2242
2394
|
// ../../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@18.3.27_react@18.3.1/node_modules/use-callback-ref/dist/es2015/useRef.js
|
|
2243
|
-
var
|
|
2395
|
+
var import_react3 = require("react");
|
|
2244
2396
|
function useCallbackRef2(initialValue, callback) {
|
|
2245
|
-
var ref = (0,
|
|
2397
|
+
var ref = (0, import_react3.useState)(function() {
|
|
2246
2398
|
return {
|
|
2247
2399
|
// value
|
|
2248
2400
|
value: initialValue,
|
|
@@ -3330,202 +3482,65 @@ var Title = DialogTitle;
|
|
|
3330
3482
|
var Description = DialogDescription;
|
|
3331
3483
|
var Close = DialogClose;
|
|
3332
3484
|
|
|
3333
|
-
// ../../node_modules/.pnpm/
|
|
3334
|
-
|
|
3485
|
+
// ../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
3486
|
+
function r(e) {
|
|
3487
|
+
var t4, f, n = "";
|
|
3488
|
+
if ("string" == typeof e || "number" == typeof e) n += e;
|
|
3489
|
+
else if ("object" == typeof e) if (Array.isArray(e)) {
|
|
3490
|
+
var o = e.length;
|
|
3491
|
+
for (t4 = 0; t4 < o; t4++) e[t4] && (f = r(e[t4])) && (n && (n += " "), n += f);
|
|
3492
|
+
} else for (f in e) e[f] && (n && (n += " "), n += f);
|
|
3493
|
+
return n;
|
|
3494
|
+
}
|
|
3495
|
+
function clsx() {
|
|
3496
|
+
for (var e, t4, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t4 = r(e)) && (n && (n += " "), n += t4);
|
|
3497
|
+
return n;
|
|
3498
|
+
}
|
|
3335
3499
|
|
|
3336
|
-
// ../../node_modules/.pnpm/
|
|
3337
|
-
var
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3500
|
+
// ../../node_modules/.pnpm/tailwind-merge@2.6.0/node_modules/tailwind-merge/dist/bundle-mjs.mjs
|
|
3501
|
+
var CLASS_PART_SEPARATOR = "-";
|
|
3502
|
+
var createClassGroupUtils = (config) => {
|
|
3503
|
+
const classMap = createClassMap(config);
|
|
3504
|
+
const {
|
|
3505
|
+
conflictingClassGroups,
|
|
3506
|
+
conflictingClassGroupModifiers
|
|
3507
|
+
} = config;
|
|
3508
|
+
const getClassGroupId = (className) => {
|
|
3509
|
+
const classParts = className.split(CLASS_PART_SEPARATOR);
|
|
3510
|
+
if (classParts[0] === "" && classParts.length !== 1) {
|
|
3511
|
+
classParts.shift();
|
|
3512
|
+
}
|
|
3513
|
+
return getGroupRecursive(classParts, classMap) || getGroupIdForArbitraryProperty(className);
|
|
3514
|
+
};
|
|
3515
|
+
const getConflictingClassGroupIds = (classGroupId, hasPostfixModifier) => {
|
|
3516
|
+
const conflicts = conflictingClassGroups[classGroupId] || [];
|
|
3517
|
+
if (hasPostfixModifier && conflictingClassGroupModifiers[classGroupId]) {
|
|
3518
|
+
return [...conflicts, ...conflictingClassGroupModifiers[classGroupId]];
|
|
3519
|
+
}
|
|
3520
|
+
return conflicts;
|
|
3521
|
+
};
|
|
3522
|
+
return {
|
|
3523
|
+
getClassGroupId,
|
|
3524
|
+
getConflictingClassGroupIds
|
|
3525
|
+
};
|
|
3347
3526
|
};
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
const
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
[
|
|
3366
|
-
...iconNode.map(([tag, attrs]) => (0, import_react3.createElement)(tag, attrs)),
|
|
3367
|
-
...Array.isArray(children) ? children : [children]
|
|
3368
|
-
]
|
|
3369
|
-
)
|
|
3370
|
-
);
|
|
3371
|
-
Component.displayName = `${iconName}`;
|
|
3372
|
-
return Component;
|
|
3373
|
-
};
|
|
3374
|
-
|
|
3375
|
-
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/arrow-left.js
|
|
3376
|
-
var ArrowLeft = createLucideIcon("ArrowLeft", [
|
|
3377
|
-
["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
|
|
3378
|
-
["path", { d: "M19 12H5", key: "x3x0zl" }]
|
|
3379
|
-
]);
|
|
3380
|
-
|
|
3381
|
-
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/check.js
|
|
3382
|
-
var Check = createLucideIcon("Check", [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]]);
|
|
3383
|
-
|
|
3384
|
-
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/chevron-down.js
|
|
3385
|
-
var ChevronDown = createLucideIcon("ChevronDown", [
|
|
3386
|
-
["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]
|
|
3387
|
-
]);
|
|
3388
|
-
|
|
3389
|
-
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/chevron-right.js
|
|
3390
|
-
var ChevronRight = createLucideIcon("ChevronRight", [
|
|
3391
|
-
["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]
|
|
3392
|
-
]);
|
|
3393
|
-
|
|
3394
|
-
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/chevron-up.js
|
|
3395
|
-
var ChevronUp = createLucideIcon("ChevronUp", [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]]);
|
|
3396
|
-
|
|
3397
|
-
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/clock.js
|
|
3398
|
-
var Clock = createLucideIcon("Clock", [
|
|
3399
|
-
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
3400
|
-
["polyline", { points: "12 6 12 12 16 14", key: "68esgv" }]
|
|
3401
|
-
]);
|
|
3402
|
-
|
|
3403
|
-
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/copy.js
|
|
3404
|
-
var Copy = createLucideIcon("Copy", [
|
|
3405
|
-
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
3406
|
-
["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" }]
|
|
3407
|
-
]);
|
|
3408
|
-
|
|
3409
|
-
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/credit-card.js
|
|
3410
|
-
var CreditCard = createLucideIcon("CreditCard", [
|
|
3411
|
-
["rect", { width: "20", height: "14", x: "2", y: "5", rx: "2", key: "ynyp8z" }],
|
|
3412
|
-
["line", { x1: "2", x2: "22", y1: "10", y2: "10", key: "1b3vmo" }]
|
|
3413
|
-
]);
|
|
3414
|
-
|
|
3415
|
-
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/dollar-sign.js
|
|
3416
|
-
var DollarSign = createLucideIcon("DollarSign", [
|
|
3417
|
-
["line", { x1: "12", x2: "12", y1: "2", y2: "22", key: "7eqyqh" }],
|
|
3418
|
-
["path", { d: "M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6", key: "1b0p4s" }]
|
|
3419
|
-
]);
|
|
3420
|
-
|
|
3421
|
-
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/external-link.js
|
|
3422
|
-
var ExternalLink = createLucideIcon("ExternalLink", [
|
|
3423
|
-
["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }],
|
|
3424
|
-
["polyline", { points: "15 3 21 3 21 9", key: "mznyad" }],
|
|
3425
|
-
["line", { x1: "10", x2: "21", y1: "14", y2: "3", key: "18c3s4" }]
|
|
3426
|
-
]);
|
|
3427
|
-
|
|
3428
|
-
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/file-text.js
|
|
3429
|
-
var FileText = createLucideIcon("FileText", [
|
|
3430
|
-
[
|
|
3431
|
-
"path",
|
|
3432
|
-
{ d: "M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z", key: "1nnpy2" }
|
|
3433
|
-
],
|
|
3434
|
-
["polyline", { points: "14 2 14 8 20 8", key: "1ew0cm" }],
|
|
3435
|
-
["line", { x1: "16", x2: "8", y1: "13", y2: "13", key: "14keom" }],
|
|
3436
|
-
["line", { x1: "16", x2: "8", y1: "17", y2: "17", key: "17nazh" }],
|
|
3437
|
-
["line", { x1: "10", x2: "8", y1: "9", y2: "9", key: "1a5vjj" }]
|
|
3438
|
-
]);
|
|
3439
|
-
|
|
3440
|
-
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/info.js
|
|
3441
|
-
var Info = createLucideIcon("Info", [
|
|
3442
|
-
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
3443
|
-
["path", { d: "M12 16v-4", key: "1dtifu" }],
|
|
3444
|
-
["path", { d: "M12 8h.01", key: "e9boi3" }]
|
|
3445
|
-
]);
|
|
3446
|
-
|
|
3447
|
-
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/search.js
|
|
3448
|
-
var Search = createLucideIcon("Search", [
|
|
3449
|
-
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
|
|
3450
|
-
["path", { d: "m21 21-4.3-4.3", key: "1qie3q" }]
|
|
3451
|
-
]);
|
|
3452
|
-
|
|
3453
|
-
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/shield-check.js
|
|
3454
|
-
var ShieldCheck = createLucideIcon("ShieldCheck", [
|
|
3455
|
-
["path", { d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10", key: "1irkt0" }],
|
|
3456
|
-
["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
|
|
3457
|
-
]);
|
|
3458
|
-
|
|
3459
|
-
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/x.js
|
|
3460
|
-
var X = createLucideIcon("X", [
|
|
3461
|
-
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
3462
|
-
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
3463
|
-
]);
|
|
3464
|
-
|
|
3465
|
-
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/zap.js
|
|
3466
|
-
var Zap = createLucideIcon("Zap", [
|
|
3467
|
-
["polygon", { points: "13 2 3 14 12 14 11 22 21 10 12 10 13 2", key: "45s27k" }]
|
|
3468
|
-
]);
|
|
3469
|
-
|
|
3470
|
-
// ../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
3471
|
-
function r(e) {
|
|
3472
|
-
var t4, f, n = "";
|
|
3473
|
-
if ("string" == typeof e || "number" == typeof e) n += e;
|
|
3474
|
-
else if ("object" == typeof e) if (Array.isArray(e)) {
|
|
3475
|
-
var o = e.length;
|
|
3476
|
-
for (t4 = 0; t4 < o; t4++) e[t4] && (f = r(e[t4])) && (n && (n += " "), n += f);
|
|
3477
|
-
} else for (f in e) e[f] && (n && (n += " "), n += f);
|
|
3478
|
-
return n;
|
|
3479
|
-
}
|
|
3480
|
-
function clsx() {
|
|
3481
|
-
for (var e, t4, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t4 = r(e)) && (n && (n += " "), n += t4);
|
|
3482
|
-
return n;
|
|
3483
|
-
}
|
|
3484
|
-
|
|
3485
|
-
// ../../node_modules/.pnpm/tailwind-merge@2.6.0/node_modules/tailwind-merge/dist/bundle-mjs.mjs
|
|
3486
|
-
var CLASS_PART_SEPARATOR = "-";
|
|
3487
|
-
var createClassGroupUtils = (config) => {
|
|
3488
|
-
const classMap = createClassMap(config);
|
|
3489
|
-
const {
|
|
3490
|
-
conflictingClassGroups,
|
|
3491
|
-
conflictingClassGroupModifiers
|
|
3492
|
-
} = config;
|
|
3493
|
-
const getClassGroupId = (className) => {
|
|
3494
|
-
const classParts = className.split(CLASS_PART_SEPARATOR);
|
|
3495
|
-
if (classParts[0] === "" && classParts.length !== 1) {
|
|
3496
|
-
classParts.shift();
|
|
3497
|
-
}
|
|
3498
|
-
return getGroupRecursive(classParts, classMap) || getGroupIdForArbitraryProperty(className);
|
|
3499
|
-
};
|
|
3500
|
-
const getConflictingClassGroupIds = (classGroupId, hasPostfixModifier) => {
|
|
3501
|
-
const conflicts = conflictingClassGroups[classGroupId] || [];
|
|
3502
|
-
if (hasPostfixModifier && conflictingClassGroupModifiers[classGroupId]) {
|
|
3503
|
-
return [...conflicts, ...conflictingClassGroupModifiers[classGroupId]];
|
|
3504
|
-
}
|
|
3505
|
-
return conflicts;
|
|
3506
|
-
};
|
|
3507
|
-
return {
|
|
3508
|
-
getClassGroupId,
|
|
3509
|
-
getConflictingClassGroupIds
|
|
3510
|
-
};
|
|
3511
|
-
};
|
|
3512
|
-
var getGroupRecursive = (classParts, classPartObject) => {
|
|
3513
|
-
if (classParts.length === 0) {
|
|
3514
|
-
return classPartObject.classGroupId;
|
|
3515
|
-
}
|
|
3516
|
-
const currentClassPart = classParts[0];
|
|
3517
|
-
const nextClassPartObject = classPartObject.nextPart.get(currentClassPart);
|
|
3518
|
-
const classGroupFromNextClassPart = nextClassPartObject ? getGroupRecursive(classParts.slice(1), nextClassPartObject) : void 0;
|
|
3519
|
-
if (classGroupFromNextClassPart) {
|
|
3520
|
-
return classGroupFromNextClassPart;
|
|
3521
|
-
}
|
|
3522
|
-
if (classPartObject.validators.length === 0) {
|
|
3523
|
-
return void 0;
|
|
3524
|
-
}
|
|
3525
|
-
const classRest = classParts.join(CLASS_PART_SEPARATOR);
|
|
3526
|
-
return classPartObject.validators.find(({
|
|
3527
|
-
validator
|
|
3528
|
-
}) => validator(classRest))?.classGroupId;
|
|
3527
|
+
var getGroupRecursive = (classParts, classPartObject) => {
|
|
3528
|
+
if (classParts.length === 0) {
|
|
3529
|
+
return classPartObject.classGroupId;
|
|
3530
|
+
}
|
|
3531
|
+
const currentClassPart = classParts[0];
|
|
3532
|
+
const nextClassPartObject = classPartObject.nextPart.get(currentClassPart);
|
|
3533
|
+
const classGroupFromNextClassPart = nextClassPartObject ? getGroupRecursive(classParts.slice(1), nextClassPartObject) : void 0;
|
|
3534
|
+
if (classGroupFromNextClassPart) {
|
|
3535
|
+
return classGroupFromNextClassPart;
|
|
3536
|
+
}
|
|
3537
|
+
if (classPartObject.validators.length === 0) {
|
|
3538
|
+
return void 0;
|
|
3539
|
+
}
|
|
3540
|
+
const classRest = classParts.join(CLASS_PART_SEPARATOR);
|
|
3541
|
+
return classPartObject.validators.find(({
|
|
3542
|
+
validator
|
|
3543
|
+
}) => validator(classRest))?.classGroupId;
|
|
3529
3544
|
};
|
|
3530
3545
|
var arbitraryPropertyRegex = /^\[(.+)\]$/;
|
|
3531
3546
|
var getGroupIdForArbitraryProperty = (className) => {
|
|
@@ -5955,6 +5970,7 @@ var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
|
5955
5970
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
5956
5971
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
5957
5972
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
5973
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
5958
5974
|
var React38 = __toESM(require("react"), 1);
|
|
5959
5975
|
|
|
5960
5976
|
// ../../node_modules/.pnpm/@radix-ui+react-select@2.2.6_@types+react-dom@18.3.7_@types+react@18.3.27__@types+react@18.3._paqmzknjxz7bmndehagaq3tw4m/node_modules/@radix-ui/react-select/dist/index.mjs
|
|
@@ -9446,7 +9462,7 @@ var ScrollDownButton = SelectScrollDownButton;
|
|
|
9446
9462
|
var Separator = SelectSeparator;
|
|
9447
9463
|
|
|
9448
9464
|
// ../ui-react/dist/index.mjs
|
|
9449
|
-
var
|
|
9465
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
9450
9466
|
var React42 = __toESM(require("react"), 1);
|
|
9451
9467
|
|
|
9452
9468
|
// ../../node_modules/.pnpm/@radix-ui+react-slot@1.2.4_@types+react@18.3.27_react@18.3.1/node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
@@ -9593,7 +9609,7 @@ var cva = (base, config) => (props) => {
|
|
|
9593
9609
|
};
|
|
9594
9610
|
|
|
9595
9611
|
// ../ui-react/dist/index.mjs
|
|
9596
|
-
var
|
|
9612
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
9597
9613
|
var React52 = __toESM(require("react"), 1);
|
|
9598
9614
|
|
|
9599
9615
|
// ../../node_modules/.pnpm/@radix-ui+react-tooltip@1.2.8_@types+react-dom@18.3.7_@types+react@18.3.27__@types+react@18.3_hd4qp76o7ebwsrfrhqb6isuuvy/node_modules/@radix-ui/react-tooltip/dist/index.mjs
|
|
@@ -10074,21 +10090,21 @@ var Portal4 = TooltipPortal;
|
|
|
10074
10090
|
var Content23 = TooltipContent;
|
|
10075
10091
|
|
|
10076
10092
|
// ../ui-react/dist/index.mjs
|
|
10077
|
-
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
10078
10093
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
10079
10094
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
10095
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
10080
10096
|
var import_react11 = require("react");
|
|
10081
10097
|
var import_react12 = require("react");
|
|
10082
|
-
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
10083
10098
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
10084
10099
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
10085
|
-
var import_react_query2 = require("@tanstack/react-query");
|
|
10086
10100
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
10101
|
+
var import_react_query2 = require("@tanstack/react-query");
|
|
10087
10102
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
10088
10103
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
10089
10104
|
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
10090
10105
|
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
10091
10106
|
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
10107
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
10092
10108
|
function cn(...inputs) {
|
|
10093
10109
|
return twMerge(clsx(inputs));
|
|
10094
10110
|
}
|
|
@@ -10334,6 +10350,14 @@ function getIconUrl(iconPath) {
|
|
|
10334
10350
|
const normalizedPath = iconPath.startsWith("/") ? iconPath : `/${iconPath}`;
|
|
10335
10351
|
return `${API_BASE_URL}/api/public${normalizedPath}`;
|
|
10336
10352
|
}
|
|
10353
|
+
function getIconUrlWithCdn(iconPath, assetCdnUrl) {
|
|
10354
|
+
if (!assetCdnUrl) {
|
|
10355
|
+
return getIconUrl(iconPath);
|
|
10356
|
+
}
|
|
10357
|
+
const normalizedPath = iconPath.startsWith("/") ? iconPath : `/${iconPath}`;
|
|
10358
|
+
const baseUrl = assetCdnUrl.endsWith("/") ? assetCdnUrl.slice(0, -1) : assetCdnUrl;
|
|
10359
|
+
return `${baseUrl}/api/public${normalizedPath}`;
|
|
10360
|
+
}
|
|
10337
10361
|
async function createEOA(overrides, publishableKey) {
|
|
10338
10362
|
if (!overrides?.user_id) {
|
|
10339
10363
|
throw new Error("user_id is required");
|
|
@@ -10442,6 +10466,16 @@ async function createMeldSession(request, publishableKey) {
|
|
|
10442
10466
|
}
|
|
10443
10467
|
return response.json();
|
|
10444
10468
|
}
|
|
10469
|
+
function getPreferredIconUrl(iconUrls, preferredFormat = "svg") {
|
|
10470
|
+
if (!iconUrls || iconUrls.length === 0) {
|
|
10471
|
+
return void 0;
|
|
10472
|
+
}
|
|
10473
|
+
const preferred = iconUrls.find((icon) => icon.format === preferredFormat);
|
|
10474
|
+
if (preferred) {
|
|
10475
|
+
return preferred.url;
|
|
10476
|
+
}
|
|
10477
|
+
return iconUrls[0]?.url;
|
|
10478
|
+
}
|
|
10445
10479
|
async function getFiatCurrencies(publishableKey) {
|
|
10446
10480
|
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
10447
10481
|
const response = await fetch(
|
|
@@ -10459,51 +10493,81 @@ async function getFiatCurrencies(publishableKey) {
|
|
|
10459
10493
|
}
|
|
10460
10494
|
return response.json();
|
|
10461
10495
|
}
|
|
10496
|
+
async function getProjectConfig(publishableKey) {
|
|
10497
|
+
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
10498
|
+
const response = await fetch(`${API_BASE_URL}/v1/public/projects/config`, {
|
|
10499
|
+
method: "GET",
|
|
10500
|
+
headers: {
|
|
10501
|
+
accept: "application/json",
|
|
10502
|
+
"x-publishable-key": pk
|
|
10503
|
+
}
|
|
10504
|
+
});
|
|
10505
|
+
if (!response.ok) {
|
|
10506
|
+
throw new Error(`Failed to fetch project config: ${response.statusText}`);
|
|
10507
|
+
}
|
|
10508
|
+
return response.json();
|
|
10509
|
+
}
|
|
10462
10510
|
function DepositExecutionItem({
|
|
10463
10511
|
execution,
|
|
10464
|
-
|
|
10465
|
-
onClose
|
|
10512
|
+
onClick
|
|
10466
10513
|
}) {
|
|
10467
10514
|
const isPending = execution.status === "pending" || execution.status === "waiting" || execution.status === "delayed";
|
|
10468
|
-
const formatTxHash = (hash) => {
|
|
10469
|
-
if (hash.length <= 12) return hash;
|
|
10470
|
-
return `${hash.slice(0, 10)}...${hash.slice(-8)}`;
|
|
10471
|
-
};
|
|
10472
10515
|
const formatDateTime = (timestamp) => {
|
|
10473
10516
|
try {
|
|
10474
10517
|
const date = new Date(timestamp);
|
|
10475
|
-
|
|
10518
|
+
const monthDay = date.toLocaleDateString("en-US", {
|
|
10519
|
+
month: "short",
|
|
10520
|
+
day: "numeric",
|
|
10521
|
+
year: "numeric"
|
|
10522
|
+
});
|
|
10523
|
+
const time = date.toLocaleTimeString("en-US", {
|
|
10476
10524
|
hour: "numeric",
|
|
10477
10525
|
minute: "2-digit",
|
|
10478
|
-
|
|
10479
|
-
|
|
10480
|
-
}
|
|
10526
|
+
hour12: true
|
|
10527
|
+
}).toLowerCase();
|
|
10528
|
+
return `${monthDay} at ${time}`;
|
|
10481
10529
|
} catch {
|
|
10482
10530
|
return timestamp;
|
|
10483
10531
|
}
|
|
10484
10532
|
};
|
|
10485
|
-
|
|
10486
|
-
|
|
10487
|
-
|
|
10488
|
-
|
|
10533
|
+
const formatUsdAmount = (baseUnitAmount) => {
|
|
10534
|
+
try {
|
|
10535
|
+
const amount = Number(baseUnitAmount) / 1e6;
|
|
10536
|
+
return new Intl.NumberFormat("en-US", {
|
|
10537
|
+
style: "currency",
|
|
10538
|
+
currency: "USD",
|
|
10539
|
+
minimumFractionDigits: 2,
|
|
10540
|
+
maximumFractionDigits: 2
|
|
10541
|
+
}).format(amount);
|
|
10542
|
+
} catch {
|
|
10543
|
+
return "$0.00";
|
|
10544
|
+
}
|
|
10545
|
+
};
|
|
10546
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
10547
|
+
"button",
|
|
10548
|
+
{
|
|
10549
|
+
onClick,
|
|
10550
|
+
className: "uf-w-full uf-bg-secondary uf-rounded-xl uf-p-3 uf-flex uf-items-center uf-gap-3 hover:uf-bg-secondary/80 uf-transition-colors uf-text-left",
|
|
10551
|
+
children: [
|
|
10552
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "uf-relative uf-flex-shrink-0 uf-w-9 uf-h-9", children: [
|
|
10489
10553
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
10490
10554
|
"img",
|
|
10491
10555
|
{
|
|
10492
10556
|
src: execution.source_token_metadata?.icon_url || getIconUrl("/icons/tokens/usdc.svg"),
|
|
10493
10557
|
alt: "Token",
|
|
10494
|
-
width:
|
|
10495
|
-
height:
|
|
10496
|
-
className: "uf-rounded-full"
|
|
10558
|
+
width: 36,
|
|
10559
|
+
height: 36,
|
|
10560
|
+
className: "uf-rounded-full uf-w-9 uf-h-9"
|
|
10497
10561
|
}
|
|
10498
10562
|
),
|
|
10499
|
-
isPending ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "uf-absolute uf
|
|
10563
|
+
isPending ? /* @__PURE__ */ (0, import_jsx_runtime22.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_runtime22.jsx)(
|
|
10500
10564
|
"svg",
|
|
10501
10565
|
{
|
|
10502
10566
|
width: "10",
|
|
10503
10567
|
height: "10",
|
|
10504
10568
|
viewBox: "0 0 12 12",
|
|
10505
10569
|
fill: "none",
|
|
10506
|
-
className: "uf-animate-spin",
|
|
10570
|
+
className: "uf-animate-spin uf-block",
|
|
10507
10571
|
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
10508
10572
|
"path",
|
|
10509
10573
|
{
|
|
@@ -10514,7 +10578,7 @@ function DepositExecutionItem({
|
|
|
10514
10578
|
}
|
|
10515
10579
|
)
|
|
10516
10580
|
}
|
|
10517
|
-
) }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "uf-absolute uf
|
|
10581
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "uf-absolute -uf-bottom-0.5 -uf-right-0.5 uf-bg-blue-500 uf-rounded-full uf-p-0.5", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("svg", { width: "10", height: "10", viewBox: "0 0 12 12", fill: "none", className: "uf-block", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
10518
10582
|
"path",
|
|
10519
10583
|
{
|
|
10520
10584
|
d: "M10 3L4.5 8.5L2 6",
|
|
@@ -10526,55 +10590,241 @@ function DepositExecutionItem({
|
|
|
10526
10590
|
) }) })
|
|
10527
10591
|
] }),
|
|
10528
10592
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "uf-flex-1 uf-min-w-0", children: [
|
|
10529
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.
|
|
10530
|
-
|
|
10531
|
-
|
|
10593
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h3", { className: "uf-text-foreground uf-font-medium uf-text-sm uf-leading-tight", children: isPending ? "Deposit received" : "Deposit completed" }),
|
|
10594
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "uf-text-muted-foreground uf-text-xs uf-leading-tight", children: formatDateTime(execution.created_at || (/* @__PURE__ */ new Date()).toISOString()) })
|
|
10595
|
+
] }),
|
|
10596
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "uf-text-foreground uf-font-medium uf-text-sm uf-flex-shrink-0", children: formatUsdAmount(execution.source_amount_base_unit) }),
|
|
10597
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ChevronRight, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground uf-flex-shrink-0" })
|
|
10598
|
+
]
|
|
10599
|
+
}
|
|
10600
|
+
);
|
|
10601
|
+
}
|
|
10602
|
+
var CHAIN_NAMES = {
|
|
10603
|
+
solana: "Solana",
|
|
10604
|
+
ethereum: "Ethereum",
|
|
10605
|
+
"1": "Ethereum",
|
|
10606
|
+
"137": "Polygon",
|
|
10607
|
+
"42161": "Arbitrum",
|
|
10608
|
+
"10": "Optimism",
|
|
10609
|
+
"8453": "Base",
|
|
10610
|
+
"43114": "Avalanche",
|
|
10611
|
+
"56": "BSC",
|
|
10612
|
+
bitcoin: "Bitcoin",
|
|
10613
|
+
mainnet: "Mainnet"
|
|
10614
|
+
};
|
|
10615
|
+
function DepositDetailModal({
|
|
10616
|
+
open,
|
|
10617
|
+
onOpenChange,
|
|
10618
|
+
execution,
|
|
10619
|
+
themeClass = ""
|
|
10620
|
+
}) {
|
|
10621
|
+
if (!execution) return null;
|
|
10622
|
+
const isPending = execution.status === "pending" || execution.status === "waiting" || execution.status === "delayed";
|
|
10623
|
+
const formatDateTime = (timestamp) => {
|
|
10624
|
+
try {
|
|
10625
|
+
const date = new Date(timestamp);
|
|
10626
|
+
const monthDay = date.toLocaleDateString("en-US", {
|
|
10627
|
+
month: "short",
|
|
10628
|
+
day: "numeric",
|
|
10629
|
+
year: "numeric"
|
|
10630
|
+
});
|
|
10631
|
+
const time = date.toLocaleTimeString("en-US", {
|
|
10632
|
+
hour: "numeric",
|
|
10633
|
+
minute: "2-digit",
|
|
10634
|
+
hour12: true
|
|
10635
|
+
});
|
|
10636
|
+
return `${monthDay} at ${time}`;
|
|
10637
|
+
} catch {
|
|
10638
|
+
return timestamp;
|
|
10639
|
+
}
|
|
10640
|
+
};
|
|
10641
|
+
const formatAmount = (baseUnitAmount, decimals = 6) => {
|
|
10642
|
+
try {
|
|
10643
|
+
const amount = Number(baseUnitAmount) / Math.pow(10, decimals);
|
|
10644
|
+
return amount.toFixed(2);
|
|
10645
|
+
} catch {
|
|
10646
|
+
return "0.00";
|
|
10647
|
+
}
|
|
10648
|
+
};
|
|
10649
|
+
const formatUsdAmount = (usdAmount, baseUnitAmount) => {
|
|
10650
|
+
if (usdAmount) {
|
|
10651
|
+
try {
|
|
10652
|
+
const amount = Number(usdAmount);
|
|
10653
|
+
return new Intl.NumberFormat("en-US", {
|
|
10654
|
+
style: "currency",
|
|
10655
|
+
currency: "USD",
|
|
10656
|
+
minimumFractionDigits: 2,
|
|
10657
|
+
maximumFractionDigits: 2
|
|
10658
|
+
}).format(amount);
|
|
10659
|
+
} catch {
|
|
10660
|
+
}
|
|
10661
|
+
}
|
|
10662
|
+
if (baseUnitAmount) {
|
|
10663
|
+
try {
|
|
10664
|
+
const amount = Number(baseUnitAmount) / 1e6;
|
|
10665
|
+
return new Intl.NumberFormat("en-US", {
|
|
10666
|
+
style: "currency",
|
|
10667
|
+
currency: "USD",
|
|
10668
|
+
minimumFractionDigits: 2,
|
|
10669
|
+
maximumFractionDigits: 2
|
|
10670
|
+
}).format(amount);
|
|
10671
|
+
} catch {
|
|
10672
|
+
}
|
|
10673
|
+
}
|
|
10674
|
+
return "$0.00";
|
|
10675
|
+
};
|
|
10676
|
+
const getNetworkName = (chainType, chainId) => {
|
|
10677
|
+
return CHAIN_NAMES[chainId] || CHAIN_NAMES[chainType] || chainType;
|
|
10678
|
+
};
|
|
10679
|
+
const getSourceTokenSymbol = () => {
|
|
10680
|
+
return "USDC";
|
|
10681
|
+
};
|
|
10682
|
+
const getDestinationTokenSymbol = () => {
|
|
10683
|
+
return "USDC";
|
|
10684
|
+
};
|
|
10685
|
+
const handleClose = () => {
|
|
10686
|
+
onOpenChange(false);
|
|
10687
|
+
};
|
|
10688
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Dialog2, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
10689
|
+
DialogContent2,
|
|
10690
|
+
{
|
|
10691
|
+
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}`,
|
|
10692
|
+
children: [
|
|
10693
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DepositHeader, { title: "Deposit Details", onClose: handleClose }),
|
|
10694
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-px-4 uf-pb-4", children: [
|
|
10695
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-flex-col uf-items-center uf-py-6", children: [
|
|
10696
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-relative uf-mb-3", children: [
|
|
10697
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
10698
|
+
"img",
|
|
10699
|
+
{
|
|
10700
|
+
src: execution.source_token_metadata?.icon_url || getIconUrl("/icons/tokens/usdc.svg"),
|
|
10701
|
+
alt: "Token",
|
|
10702
|
+
width: 64,
|
|
10703
|
+
height: 64,
|
|
10704
|
+
className: "uf-rounded-full"
|
|
10705
|
+
}
|
|
10706
|
+
),
|
|
10707
|
+
isPending ? /* @__PURE__ */ (0, import_jsx_runtime23.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_runtime23.jsx)(
|
|
10708
|
+
"svg",
|
|
10709
|
+
{
|
|
10710
|
+
width: "16",
|
|
10711
|
+
height: "16",
|
|
10712
|
+
viewBox: "0 0 12 12",
|
|
10713
|
+
fill: "none",
|
|
10714
|
+
className: "uf-animate-spin uf-block",
|
|
10715
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
10716
|
+
"path",
|
|
10717
|
+
{
|
|
10718
|
+
d: "M6 1V3M6 9V11M1 6H3M9 6H11M2.5 2.5L4 4M8 8L9.5 9.5M2.5 9.5L4 8M8 4L9.5 2.5",
|
|
10719
|
+
stroke: "white",
|
|
10720
|
+
strokeWidth: "2",
|
|
10721
|
+
strokeLinecap: "round"
|
|
10722
|
+
}
|
|
10723
|
+
)
|
|
10724
|
+
}
|
|
10725
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime23.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_runtime23.jsx)(
|
|
10726
|
+
"svg",
|
|
10727
|
+
{
|
|
10728
|
+
width: "16",
|
|
10729
|
+
height: "16",
|
|
10730
|
+
viewBox: "0 0 12 12",
|
|
10731
|
+
fill: "none",
|
|
10732
|
+
className: "uf-block",
|
|
10733
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
10734
|
+
"path",
|
|
10735
|
+
{
|
|
10736
|
+
d: "M10 3L4.5 8.5L2 6",
|
|
10737
|
+
stroke: "white",
|
|
10738
|
+
strokeWidth: "2",
|
|
10739
|
+
strokeLinecap: "round",
|
|
10740
|
+
strokeLinejoin: "round"
|
|
10741
|
+
}
|
|
10742
|
+
)
|
|
10743
|
+
}
|
|
10744
|
+
) })
|
|
10745
|
+
] }),
|
|
10746
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-1.5 uf-mb-1", children: [
|
|
10747
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
10748
|
+
"div",
|
|
10749
|
+
{
|
|
10750
|
+
className: `uf-w-2 uf-h-2 uf-rounded-full ${isPending ? "uf-bg-yellow-500" : "uf-bg-green-500"}`
|
|
10751
|
+
}
|
|
10752
|
+
),
|
|
10753
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-foreground uf-font-medium", children: isPending ? "Pending" : "Completed" })
|
|
10754
|
+
] }),
|
|
10755
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: formatDateTime(execution.created_at || (/* @__PURE__ */ new Date()).toISOString()) })
|
|
10532
10756
|
] }),
|
|
10533
|
-
/* @__PURE__ */ (0,
|
|
10757
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-bg-secondary uf-rounded-xl uf-overflow-hidden uf-mb-3", children: [
|
|
10758
|
+
/* @__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: [
|
|
10759
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Amount Sent" }),
|
|
10760
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "uf-text-foreground uf-font-medium", children: [
|
|
10761
|
+
formatAmount(execution.source_amount_base_unit),
|
|
10762
|
+
" ",
|
|
10763
|
+
getSourceTokenSymbol()
|
|
10764
|
+
] })
|
|
10765
|
+
] }),
|
|
10766
|
+
/* @__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: [
|
|
10767
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Amount Received" }),
|
|
10768
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "uf-text-foreground uf-font-medium", children: [
|
|
10769
|
+
formatAmount(execution.destination_amount_base_unit),
|
|
10770
|
+
" ",
|
|
10771
|
+
getDestinationTokenSymbol()
|
|
10772
|
+
] })
|
|
10773
|
+
] }),
|
|
10774
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3", children: [
|
|
10775
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "USD Value" }),
|
|
10776
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-foreground uf-font-medium", children: formatUsdAmount(execution.source_amount_usd, execution.source_amount_base_unit) })
|
|
10777
|
+
] })
|
|
10778
|
+
] }),
|
|
10779
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-bg-secondary uf-rounded-xl uf-overflow-hidden uf-mb-4", children: [
|
|
10780
|
+
/* @__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: [
|
|
10781
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Source Network" }),
|
|
10782
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-foreground uf-font-medium", children: getNetworkName(execution.source_chain_type, execution.source_chain_id) })
|
|
10783
|
+
] }),
|
|
10784
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3", children: [
|
|
10785
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Destination Network" }),
|
|
10786
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-foreground uf-font-medium", children: getNetworkName(execution.destination_chain_type, execution.destination_chain_id) })
|
|
10787
|
+
] })
|
|
10788
|
+
] }),
|
|
10789
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-space-y-2", children: [
|
|
10790
|
+
execution.explorer_url && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
10791
|
+
"a",
|
|
10792
|
+
{
|
|
10793
|
+
href: execution.explorer_url,
|
|
10794
|
+
target: "_blank",
|
|
10795
|
+
rel: "noopener noreferrer",
|
|
10796
|
+
className: "uf-flex uf-items-center uf-justify-between uf-w-full uf-bg-blue-400 hover:uf-bg-blue-500 uf-text-white uf-rounded-xl uf-px-4 uf-py-3 uf-transition-colors",
|
|
10797
|
+
children: [
|
|
10798
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
10799
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ArrowDownCircle, { className: "uf-w-5 uf-h-5" }),
|
|
10800
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-font-medium", children: "View Deposit Transaction" })
|
|
10801
|
+
] }),
|
|
10802
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ExternalLink, { className: "uf-w-4 uf-h-4" })
|
|
10803
|
+
]
|
|
10804
|
+
}
|
|
10805
|
+
),
|
|
10806
|
+
!isPending && execution.destination_transaction_hashes?.length > 0 && execution.destination_explorer_url && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
10807
|
+
"a",
|
|
10808
|
+
{
|
|
10809
|
+
href: execution.destination_explorer_url,
|
|
10810
|
+
target: "_blank",
|
|
10811
|
+
rel: "noopener noreferrer",
|
|
10812
|
+
className: "uf-flex uf-items-center uf-justify-between uf-w-full uf-bg-blue-600 hover:uf-bg-blue-700 uf-text-white uf-rounded-xl uf-px-4 uf-py-3 uf-transition-colors",
|
|
10813
|
+
children: [
|
|
10814
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
10815
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(CheckCircle, { className: "uf-w-5 uf-h-5" }),
|
|
10816
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-font-medium", children: "View Completion Transaction" })
|
|
10817
|
+
] }),
|
|
10818
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ExternalLink, { className: "uf-w-4 uf-h-4" })
|
|
10819
|
+
]
|
|
10820
|
+
}
|
|
10821
|
+
)
|
|
10822
|
+
] }),
|
|
10823
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "uf-text-center uf-text-muted-foreground uf-text-xs uf-mt-4", children: "Links open in external browser" })
|
|
10534
10824
|
] })
|
|
10535
|
-
]
|
|
10536
|
-
|
|
10537
|
-
|
|
10538
|
-
{
|
|
10539
|
-
onClick: onClose,
|
|
10540
|
-
className: "uf-text-muted-foreground hover:uf-text-foreground uf-transition-colors uf-p-0.5 uf-flex-shrink-0 uf-ml-2",
|
|
10541
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(X, { className: "uf-w-4 uf-h-4" })
|
|
10542
|
-
}
|
|
10543
|
-
)
|
|
10544
|
-
] }),
|
|
10545
|
-
!isPending && execution.explorer_url && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "uf-flex uf-justify-between uf-items-center uf-gap-1.5 uf-mt-2 uf-pt-2 uf-border-t uf-border-secondary uf-text-xs uf-ml-[42px]", children: [
|
|
10546
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "uf-text-muted-foreground", children: "Deposit tx:" }),
|
|
10547
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
10548
|
-
"a",
|
|
10549
|
-
{
|
|
10550
|
-
href: execution.explorer_url,
|
|
10551
|
-
target: "_blank",
|
|
10552
|
-
rel: "noopener noreferrer",
|
|
10553
|
-
className: "uf-flex uf-items-center uf-gap-1 uf-text-blue-400 hover:uf-text-blue-300 uf-transition-colors uf-font-mono",
|
|
10554
|
-
children: [
|
|
10555
|
-
formatTxHash(execution.transaction_hash),
|
|
10556
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ExternalLink, { className: "uf-w-3 uf-h-3" })
|
|
10557
|
-
]
|
|
10558
|
-
}
|
|
10559
|
-
)
|
|
10560
|
-
] }),
|
|
10561
|
-
!isPending && execution.destination_transaction_hashes?.length > 0 && execution.destination_explorer_url && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "uf-flex uf-justify-between uf-items-center uf-gap-1.5 uf-mt-1 uf-text-xs uf-ml-[42px]", children: [
|
|
10562
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "uf-text-muted-foreground", children: "Completion tx:" }),
|
|
10563
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
10564
|
-
"a",
|
|
10565
|
-
{
|
|
10566
|
-
href: execution.destination_explorer_url,
|
|
10567
|
-
target: "_blank",
|
|
10568
|
-
rel: "noopener noreferrer",
|
|
10569
|
-
className: "uf-flex uf-items-center uf-gap-1 uf-text-blue-400 hover:uf-text-blue-300 uf-transition-colors uf-font-mono",
|
|
10570
|
-
children: [
|
|
10571
|
-
formatTxHash(execution.destination_transaction_hashes[execution.destination_transaction_hashes.length - 1]),
|
|
10572
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ExternalLink, { className: "uf-w-3 uf-h-3" })
|
|
10573
|
-
]
|
|
10574
|
-
}
|
|
10575
|
-
)
|
|
10576
|
-
] })
|
|
10577
|
-
] });
|
|
10825
|
+
]
|
|
10826
|
+
}
|
|
10827
|
+
) });
|
|
10578
10828
|
}
|
|
10579
10829
|
function DepositsModal({
|
|
10580
10830
|
open,
|
|
@@ -10585,6 +10835,8 @@ function DepositsModal({
|
|
|
10585
10835
|
themeClass = ""
|
|
10586
10836
|
}) {
|
|
10587
10837
|
const [allExecutions, setAllExecutions] = (0, import_react10.useState)(sessionExecutions);
|
|
10838
|
+
const [selectedExecution, setSelectedExecution] = (0, import_react10.useState)(null);
|
|
10839
|
+
const [detailModalOpen, setDetailModalOpen] = (0, import_react10.useState)(false);
|
|
10588
10840
|
(0, import_react10.useEffect)(() => {
|
|
10589
10841
|
if (!open || !userId) return;
|
|
10590
10842
|
const fetchExecutions = async () => {
|
|
@@ -10610,44 +10862,132 @@ function DepositsModal({
|
|
|
10610
10862
|
const handleClose = () => {
|
|
10611
10863
|
onOpenChange(false);
|
|
10612
10864
|
};
|
|
10613
|
-
|
|
10614
|
-
|
|
10615
|
-
|
|
10616
|
-
|
|
10865
|
+
const handleExecutionClick = (execution) => {
|
|
10866
|
+
setSelectedExecution(execution);
|
|
10867
|
+
setDetailModalOpen(true);
|
|
10868
|
+
};
|
|
10869
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
10870
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Dialog2, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DialogContent2, { 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: [
|
|
10871
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DepositHeader, { title: "Deposit Tracker", onClose: handleClose }),
|
|
10872
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.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_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)(
|
|
10873
|
+
DepositExecutionItem,
|
|
10874
|
+
{
|
|
10875
|
+
execution,
|
|
10876
|
+
onClick: () => handleExecutionClick(execution)
|
|
10877
|
+
},
|
|
10878
|
+
execution.id
|
|
10879
|
+
)) }) }) })
|
|
10880
|
+
] }) }),
|
|
10881
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
10882
|
+
DepositDetailModal,
|
|
10883
|
+
{
|
|
10884
|
+
open: detailModalOpen,
|
|
10885
|
+
onOpenChange: setDetailModalOpen,
|
|
10886
|
+
execution: selectedExecution,
|
|
10887
|
+
themeClass
|
|
10888
|
+
}
|
|
10889
|
+
)
|
|
10890
|
+
] });
|
|
10617
10891
|
}
|
|
10618
10892
|
function DepositSuccessToast({
|
|
10619
10893
|
depositTx,
|
|
10620
|
-
completionTx,
|
|
10621
10894
|
orderSubmittedAt,
|
|
10622
|
-
orderFilledAt,
|
|
10623
|
-
explorerUrl,
|
|
10624
|
-
completionExplorerUrl,
|
|
10625
10895
|
status,
|
|
10626
10896
|
tokenIconUrl,
|
|
10897
|
+
sourceAmountBaseUnit = "0",
|
|
10627
10898
|
onClose
|
|
10628
10899
|
}) {
|
|
10629
|
-
const
|
|
10630
|
-
|
|
10631
|
-
|
|
10632
|
-
|
|
10633
|
-
|
|
10634
|
-
|
|
10635
|
-
|
|
10636
|
-
|
|
10637
|
-
|
|
10900
|
+
const isPending = status === "pending" || status === "waiting" || status === "delayed";
|
|
10901
|
+
const formatDateTime = (timestamp) => {
|
|
10902
|
+
try {
|
|
10903
|
+
const date = new Date(timestamp);
|
|
10904
|
+
const monthDay = date.toLocaleDateString("en-US", {
|
|
10905
|
+
month: "short",
|
|
10906
|
+
day: "numeric",
|
|
10907
|
+
year: "numeric"
|
|
10908
|
+
});
|
|
10909
|
+
const time = date.toLocaleTimeString("en-US", {
|
|
10910
|
+
hour: "numeric",
|
|
10911
|
+
minute: "2-digit",
|
|
10912
|
+
hour12: true
|
|
10913
|
+
}).toLowerCase();
|
|
10914
|
+
return `${monthDay} at ${time}`;
|
|
10915
|
+
} catch {
|
|
10916
|
+
return timestamp;
|
|
10917
|
+
}
|
|
10638
10918
|
};
|
|
10639
|
-
|
|
10640
|
-
|
|
10641
|
-
|
|
10642
|
-
|
|
10643
|
-
|
|
10644
|
-
|
|
10919
|
+
const formatUsdAmount = (baseUnitAmount) => {
|
|
10920
|
+
try {
|
|
10921
|
+
const amount = Number(baseUnitAmount) / 1e6;
|
|
10922
|
+
return new Intl.NumberFormat("en-US", {
|
|
10923
|
+
style: "currency",
|
|
10924
|
+
currency: "USD",
|
|
10925
|
+
minimumFractionDigits: 2,
|
|
10926
|
+
maximumFractionDigits: 2
|
|
10927
|
+
}).format(amount);
|
|
10928
|
+
} catch {
|
|
10929
|
+
return "$0.00";
|
|
10645
10930
|
}
|
|
10646
|
-
|
|
10931
|
+
};
|
|
10932
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "uf-w-full uf-animate-in uf-slide-in-from-bottom-2 uf-duration-300", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "uf-bg-card uf-border uf-border-border uf-rounded-xl uf-p-3 uf-flex uf-items-center uf-gap-3", children: [
|
|
10933
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "uf-relative uf-flex-shrink-0", children: [
|
|
10934
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
10935
|
+
"img",
|
|
10936
|
+
{
|
|
10937
|
+
src: tokenIconUrl || getIconUrl("/icons/tokens/usdc.svg"),
|
|
10938
|
+
alt: "Token",
|
|
10939
|
+
width: 36,
|
|
10940
|
+
height: 36,
|
|
10941
|
+
className: "uf-rounded-full"
|
|
10942
|
+
}
|
|
10943
|
+
),
|
|
10944
|
+
isPending ? /* @__PURE__ */ (0, import_jsx_runtime25.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_runtime25.jsx)(
|
|
10945
|
+
"svg",
|
|
10946
|
+
{
|
|
10947
|
+
width: "10",
|
|
10948
|
+
height: "10",
|
|
10949
|
+
viewBox: "0 0 12 12",
|
|
10950
|
+
fill: "none",
|
|
10951
|
+
className: "uf-animate-spin",
|
|
10952
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
10953
|
+
"path",
|
|
10954
|
+
{
|
|
10955
|
+
d: "M6 1V3M6 9V11M1 6H3M9 6H11M2.5 2.5L4 4M8 8L9.5 9.5M2.5 9.5L4 8M8 4L9.5 2.5",
|
|
10956
|
+
stroke: "white",
|
|
10957
|
+
strokeWidth: "2",
|
|
10958
|
+
strokeLinecap: "round"
|
|
10959
|
+
}
|
|
10960
|
+
)
|
|
10961
|
+
}
|
|
10962
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime25.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_runtime25.jsx)("svg", { width: "10", height: "10", viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
10963
|
+
"path",
|
|
10964
|
+
{
|
|
10965
|
+
d: "M10 3L4.5 8.5L2 6",
|
|
10966
|
+
stroke: "white",
|
|
10967
|
+
strokeWidth: "2",
|
|
10968
|
+
strokeLinecap: "round",
|
|
10969
|
+
strokeLinejoin: "round"
|
|
10970
|
+
}
|
|
10971
|
+
) }) })
|
|
10972
|
+
] }),
|
|
10973
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "uf-flex-1 uf-min-w-0", children: [
|
|
10974
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("h3", { className: "uf-text-foreground uf-font-medium uf-text-sm", children: isPending ? "Deposit received" : "Deposit completed" }),
|
|
10975
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "uf-text-muted-foreground uf-text-xs", children: formatDateTime(orderSubmittedAt) })
|
|
10976
|
+
] }),
|
|
10977
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "uf-text-foreground uf-font-medium uf-text-sm uf-flex-shrink-0", children: formatUsdAmount(sourceAmountBaseUnit) }),
|
|
10978
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
10979
|
+
"button",
|
|
10980
|
+
{
|
|
10981
|
+
onClick: onClose,
|
|
10982
|
+
className: "uf-text-muted-foreground hover:uf-text-foreground uf-transition-colors uf-p-0.5 uf-flex-shrink-0",
|
|
10983
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(X, { className: "uf-w-4 uf-h-4" })
|
|
10984
|
+
}
|
|
10985
|
+
)
|
|
10986
|
+
] }) });
|
|
10647
10987
|
}
|
|
10648
10988
|
var Select2 = Root23;
|
|
10649
10989
|
var SelectValue2 = Value;
|
|
10650
|
-
var SelectTrigger2 = React38.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
10990
|
+
var SelectTrigger2 = React38.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
10651
10991
|
Trigger,
|
|
10652
10992
|
{
|
|
10653
10993
|
ref,
|
|
@@ -10658,12 +10998,12 @@ var SelectTrigger2 = React38.forwardRef(({ className, children, ...props }, ref)
|
|
|
10658
10998
|
...props,
|
|
10659
10999
|
children: [
|
|
10660
11000
|
children,
|
|
10661
|
-
/* @__PURE__ */ (0,
|
|
11001
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Icon, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ChevronDown, { className: "uf-h-4 uf-w-4 uf-opacity-50" }) })
|
|
10662
11002
|
]
|
|
10663
11003
|
}
|
|
10664
11004
|
));
|
|
10665
11005
|
SelectTrigger2.displayName = Trigger.displayName;
|
|
10666
|
-
var SelectScrollUpButton2 = React38.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
11006
|
+
var SelectScrollUpButton2 = React38.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
10667
11007
|
ScrollUpButton,
|
|
10668
11008
|
{
|
|
10669
11009
|
ref,
|
|
@@ -10672,11 +11012,11 @@ var SelectScrollUpButton2 = React38.forwardRef(({ className, ...props }, ref) =>
|
|
|
10672
11012
|
className
|
|
10673
11013
|
),
|
|
10674
11014
|
...props,
|
|
10675
|
-
children: /* @__PURE__ */ (0,
|
|
11015
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ChevronUp, { className: "uf-h-4 uf-w-4" })
|
|
10676
11016
|
}
|
|
10677
11017
|
));
|
|
10678
11018
|
SelectScrollUpButton2.displayName = ScrollUpButton.displayName;
|
|
10679
|
-
var SelectScrollDownButton2 = React38.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
11019
|
+
var SelectScrollDownButton2 = React38.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
10680
11020
|
ScrollDownButton,
|
|
10681
11021
|
{
|
|
10682
11022
|
ref,
|
|
@@ -10685,13 +11025,13 @@ var SelectScrollDownButton2 = React38.forwardRef(({ className, ...props }, ref)
|
|
|
10685
11025
|
className
|
|
10686
11026
|
),
|
|
10687
11027
|
...props,
|
|
10688
|
-
children: /* @__PURE__ */ (0,
|
|
11028
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ChevronDown, { className: "uf-h-4 uf-w-4" })
|
|
10689
11029
|
}
|
|
10690
11030
|
));
|
|
10691
11031
|
SelectScrollDownButton2.displayName = ScrollDownButton.displayName;
|
|
10692
11032
|
var SelectContent2 = React38.forwardRef(({ className, children, position = "popper", ...props }, ref) => {
|
|
10693
11033
|
const { themeClass } = useTheme();
|
|
10694
|
-
return /* @__PURE__ */ (0,
|
|
11034
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Portal3, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
10695
11035
|
Content22,
|
|
10696
11036
|
{
|
|
10697
11037
|
ref,
|
|
@@ -10704,8 +11044,8 @@ var SelectContent2 = React38.forwardRef(({ className, children, position = "popp
|
|
|
10704
11044
|
position,
|
|
10705
11045
|
...props,
|
|
10706
11046
|
children: [
|
|
10707
|
-
/* @__PURE__ */ (0,
|
|
10708
|
-
/* @__PURE__ */ (0,
|
|
11047
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SelectScrollUpButton2, {}),
|
|
11048
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
10709
11049
|
Viewport,
|
|
10710
11050
|
{
|
|
10711
11051
|
className: cn(
|
|
@@ -10715,13 +11055,13 @@ var SelectContent2 = React38.forwardRef(({ className, children, position = "popp
|
|
|
10715
11055
|
children
|
|
10716
11056
|
}
|
|
10717
11057
|
),
|
|
10718
|
-
/* @__PURE__ */ (0,
|
|
11058
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SelectScrollDownButton2, {})
|
|
10719
11059
|
]
|
|
10720
11060
|
}
|
|
10721
11061
|
) });
|
|
10722
11062
|
});
|
|
10723
11063
|
SelectContent2.displayName = Content22.displayName;
|
|
10724
|
-
var SelectLabel2 = React38.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
11064
|
+
var SelectLabel2 = React38.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
10725
11065
|
Label,
|
|
10726
11066
|
{
|
|
10727
11067
|
ref,
|
|
@@ -10730,7 +11070,7 @@ var SelectLabel2 = React38.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
10730
11070
|
}
|
|
10731
11071
|
));
|
|
10732
11072
|
SelectLabel2.displayName = Label.displayName;
|
|
10733
|
-
var SelectItem2 = React38.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
11073
|
+
var SelectItem2 = React38.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
10734
11074
|
Item,
|
|
10735
11075
|
{
|
|
10736
11076
|
ref,
|
|
@@ -10740,13 +11080,13 @@ var SelectItem2 = React38.forwardRef(({ className, children, ...props }, ref) =>
|
|
|
10740
11080
|
),
|
|
10741
11081
|
...props,
|
|
10742
11082
|
children: [
|
|
10743
|
-
/* @__PURE__ */ (0,
|
|
10744
|
-
/* @__PURE__ */ (0,
|
|
11083
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "uf-absolute uf-left-2 uf-flex uf-h-3.5 uf-w-3.5 uf-items-center uf-justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Check, { className: "uf-h-4 uf-w-4" }) }) }),
|
|
11084
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ItemText, { children })
|
|
10745
11085
|
]
|
|
10746
11086
|
}
|
|
10747
11087
|
));
|
|
10748
11088
|
SelectItem2.displayName = Item.displayName;
|
|
10749
|
-
var SelectSeparator2 = React38.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
11089
|
+
var SelectSeparator2 = React38.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
10750
11090
|
Separator,
|
|
10751
11091
|
{
|
|
10752
11092
|
ref,
|
|
@@ -10783,7 +11123,7 @@ var buttonVariants = cva(
|
|
|
10783
11123
|
var Button = React42.forwardRef(
|
|
10784
11124
|
({ className, variant, size: size4, asChild = false, ...props }, ref) => {
|
|
10785
11125
|
const Comp = asChild ? Slot3 : "button";
|
|
10786
|
-
return /* @__PURE__ */ (0,
|
|
11126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
10787
11127
|
Comp,
|
|
10788
11128
|
{
|
|
10789
11129
|
className: cn(buttonVariants({ variant, size: size4, className })),
|
|
@@ -10799,7 +11139,7 @@ var Tooltip2 = Root32;
|
|
|
10799
11139
|
var TooltipTrigger2 = Trigger2;
|
|
10800
11140
|
var TooltipContent2 = React52.forwardRef(({ className, sideOffset = 4, ...props }, ref) => {
|
|
10801
11141
|
const { themeClass } = useTheme();
|
|
10802
|
-
return /* @__PURE__ */ (0,
|
|
11142
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Portal4, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
10803
11143
|
Content23,
|
|
10804
11144
|
{
|
|
10805
11145
|
ref,
|
|
@@ -10899,15 +11239,17 @@ function TransferCryptoBase({
|
|
|
10899
11239
|
showDetailedDropdowns = false,
|
|
10900
11240
|
onExecutionsChange,
|
|
10901
11241
|
onDepositSuccess,
|
|
10902
|
-
onDepositError
|
|
11242
|
+
onDepositError,
|
|
11243
|
+
wallets: externalWallets
|
|
10903
11244
|
}) {
|
|
10904
11245
|
const { themeClass } = useTheme();
|
|
10905
11246
|
const isDarkMode = themeClass.includes("uf-dark");
|
|
10906
11247
|
const [token, setToken] = (0, import_react8.useState)("USDC");
|
|
10907
11248
|
const [chain, setChain] = (0, import_react8.useState)("solana:mainnet");
|
|
10908
11249
|
const [copied, setCopied] = (0, import_react8.useState)(false);
|
|
10909
|
-
const [
|
|
10910
|
-
const [loading, setLoading] = (0, import_react8.useState)(
|
|
11250
|
+
const [internalWallets, setInternalWallets] = (0, import_react8.useState)([]);
|
|
11251
|
+
const [loading, setLoading] = (0, import_react8.useState)(!externalWallets?.length);
|
|
11252
|
+
const wallets = externalWallets?.length ? externalWallets : internalWallets;
|
|
10911
11253
|
const [error, setError] = (0, import_react8.useState)(null);
|
|
10912
11254
|
const [depositExecutions, setDepositExecutions] = (0, import_react8.useState)([]);
|
|
10913
11255
|
const [trackedExecutions, setTrackedExecutions] = (0, import_react8.useState)(/* @__PURE__ */ new Map());
|
|
@@ -10971,9 +11313,16 @@ function TransferCryptoBase({
|
|
|
10971
11313
|
}
|
|
10972
11314
|
}, [depositExecutions, onExecutionsChange]);
|
|
10973
11315
|
(0, import_react8.useEffect)(() => {
|
|
10974
|
-
|
|
11316
|
+
if (externalWallets?.length) {
|
|
11317
|
+
setLoading(false);
|
|
11318
|
+
return;
|
|
11319
|
+
}
|
|
11320
|
+
let retryTimeout = null;
|
|
11321
|
+
let isCancelled = false;
|
|
11322
|
+
const fetchWallets = async () => {
|
|
11323
|
+
if (isCancelled) return;
|
|
11324
|
+
setLoading(true);
|
|
10975
11325
|
try {
|
|
10976
|
-
setLoading(true);
|
|
10977
11326
|
const response = await createEOA(
|
|
10978
11327
|
{
|
|
10979
11328
|
user_id: userId,
|
|
@@ -10984,23 +11333,35 @@ function TransferCryptoBase({
|
|
|
10984
11333
|
},
|
|
10985
11334
|
publishableKey
|
|
10986
11335
|
);
|
|
10987
|
-
|
|
10988
|
-
|
|
11336
|
+
if (!isCancelled) {
|
|
11337
|
+
setInternalWallets(response.data);
|
|
11338
|
+
setError(null);
|
|
11339
|
+
setLoading(false);
|
|
11340
|
+
}
|
|
10989
11341
|
} catch (err) {
|
|
10990
|
-
|
|
10991
|
-
|
|
10992
|
-
|
|
10993
|
-
|
|
11342
|
+
console.error("Error fetching wallets, retrying in 5s:", err);
|
|
11343
|
+
if (!isCancelled) {
|
|
11344
|
+
setError(err instanceof Error ? err.message : "Failed to load wallets");
|
|
11345
|
+
setLoading(false);
|
|
11346
|
+
retryTimeout = setTimeout(fetchWallets, 5e3);
|
|
11347
|
+
}
|
|
10994
11348
|
}
|
|
10995
|
-
}
|
|
11349
|
+
};
|
|
10996
11350
|
fetchWallets();
|
|
11351
|
+
return () => {
|
|
11352
|
+
isCancelled = true;
|
|
11353
|
+
if (retryTimeout) {
|
|
11354
|
+
clearTimeout(retryTimeout);
|
|
11355
|
+
}
|
|
11356
|
+
};
|
|
10997
11357
|
}, [
|
|
10998
11358
|
userId,
|
|
10999
11359
|
recipientAddress,
|
|
11000
11360
|
destinationChainType,
|
|
11001
11361
|
destinationChainId,
|
|
11002
11362
|
destinationTokenAddress,
|
|
11003
|
-
publishableKey
|
|
11363
|
+
publishableKey,
|
|
11364
|
+
externalWallets
|
|
11004
11365
|
]);
|
|
11005
11366
|
(0, import_react8.useEffect)(() => {
|
|
11006
11367
|
if (!supportedTokens.length) return;
|
|
@@ -11124,8 +11485,8 @@ function TransferCryptoBase({
|
|
|
11124
11485
|
const processingTime = currentChainFromBackend?.estimated_processing_time ?? null;
|
|
11125
11486
|
const minDepositUsd = currentChainFromBackend?.minimum_deposit_amount_usd ?? 3;
|
|
11126
11487
|
const renderTokenItem = (tokenData) => {
|
|
11127
|
-
return /* @__PURE__ */ (0,
|
|
11128
|
-
/* @__PURE__ */ (0,
|
|
11488
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
11489
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
11129
11490
|
"img",
|
|
11130
11491
|
{
|
|
11131
11492
|
src: tokenData.icon_url,
|
|
@@ -11135,13 +11496,13 @@ function TransferCryptoBase({
|
|
|
11135
11496
|
className: "uf-rounded-full uf-flex-shrink-0"
|
|
11136
11497
|
}
|
|
11137
11498
|
),
|
|
11138
|
-
/* @__PURE__ */ (0,
|
|
11139
|
-
showDetailedDropdowns && /* @__PURE__ */ (0,
|
|
11499
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "uf-text-xs uf-font-normal", children: tokenData.symbol }),
|
|
11500
|
+
showDetailedDropdowns && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "uf-text-xs uf-text-muted-foreground", children: tokenData.name })
|
|
11140
11501
|
] });
|
|
11141
11502
|
};
|
|
11142
11503
|
const renderChainItem = (chainData) => {
|
|
11143
|
-
return /* @__PURE__ */ (0,
|
|
11144
|
-
/* @__PURE__ */ (0,
|
|
11504
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
11505
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
11145
11506
|
"img",
|
|
11146
11507
|
{
|
|
11147
11508
|
src: chainData.icon_url,
|
|
@@ -11151,24 +11512,24 @@ function TransferCryptoBase({
|
|
|
11151
11512
|
className: "uf-rounded-full uf-flex-shrink-0"
|
|
11152
11513
|
}
|
|
11153
11514
|
),
|
|
11154
|
-
/* @__PURE__ */ (0,
|
|
11155
|
-
showDetailedDropdowns && /* @__PURE__ */ (0,
|
|
11515
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "uf-text-xs uf-font-normal", children: chainData.chain_name }),
|
|
11516
|
+
showDetailedDropdowns && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "uf-text-xs uf-text-muted-foreground uf-capitalize", children: chainData.chain_type })
|
|
11156
11517
|
] });
|
|
11157
11518
|
};
|
|
11158
11519
|
const selectContainerClass = layoutVariant === "horizontal" ? "uf-grid uf-grid-cols-2 uf-gap-2.5" : "uf-space-y-3";
|
|
11159
|
-
return /* @__PURE__ */ (0,
|
|
11160
|
-
/* @__PURE__ */ (0,
|
|
11161
|
-
/* @__PURE__ */ (0,
|
|
11162
|
-
/* @__PURE__ */ (0,
|
|
11163
|
-
/* @__PURE__ */ (0,
|
|
11520
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TooltipProvider2, { delayDuration: 0, skipDelayDuration: 0, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "uf-space-y-3", children: [
|
|
11521
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: selectContainerClass, children: [
|
|
11522
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { children: [
|
|
11523
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "uf-text-xs uf-text-muted-foreground uf-mb-2 uf-flex uf-items-center uf-gap-1", children: t.supportedToken }),
|
|
11524
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
11164
11525
|
Select2,
|
|
11165
11526
|
{
|
|
11166
11527
|
value: token,
|
|
11167
11528
|
onValueChange: setToken,
|
|
11168
11529
|
disabled: tokensLoading || supportedTokens.length === 0,
|
|
11169
11530
|
children: [
|
|
11170
|
-
/* @__PURE__ */ (0,
|
|
11171
|
-
/* @__PURE__ */ (0,
|
|
11531
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.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_runtime29.jsx)(SelectValue2, { children: tokensLoading ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "uf-text-xs uf-font-light uf-text-muted-foreground", children: t.loading }) }) : selectedToken ? renderTokenItem(selectedToken) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "uf-text-xs uf-font-normal", children: token }) }) }) }),
|
|
11532
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(SelectContent2, { className: "uf-bg-secondary uf-border uf-text-foreground uf-max-h-[300px]", children: supportedTokens.map((tokenData) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
11172
11533
|
SelectItem2,
|
|
11173
11534
|
{
|
|
11174
11535
|
value: tokenData.symbol,
|
|
@@ -11181,51 +11542,51 @@ function TransferCryptoBase({
|
|
|
11181
11542
|
}
|
|
11182
11543
|
)
|
|
11183
11544
|
] }),
|
|
11184
|
-
/* @__PURE__ */ (0,
|
|
11185
|
-
/* @__PURE__ */ (0,
|
|
11545
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { children: [
|
|
11546
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "uf-text-xs uf-text-muted-foreground uf-mb-2 uf-flex uf-items-center uf-gap-1", children: [
|
|
11186
11547
|
t.supportedChain,
|
|
11187
|
-
/* @__PURE__ */ (0,
|
|
11548
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("span", { className: "uf-text-[10px]", children: [
|
|
11188
11549
|
"$",
|
|
11189
11550
|
minDepositUsd,
|
|
11190
11551
|
" ",
|
|
11191
11552
|
t.minDeposit.label
|
|
11192
11553
|
] }),
|
|
11193
|
-
/* @__PURE__ */ (0,
|
|
11194
|
-
/* @__PURE__ */ (0,
|
|
11554
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Tooltip2, { children: [
|
|
11555
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TooltipTrigger2, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
11195
11556
|
"span",
|
|
11196
11557
|
{
|
|
11197
11558
|
className: "uf-inline-flex uf-cursor-pointer uf-transition-colors hover:uf-text-foreground",
|
|
11198
11559
|
tabIndex: 0,
|
|
11199
11560
|
role: "button",
|
|
11200
11561
|
"aria-label": "Minimum deposit information",
|
|
11201
|
-
children: /* @__PURE__ */ (0,
|
|
11562
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Info, { className: "uf-w-3 uf-h-3" })
|
|
11202
11563
|
}
|
|
11203
11564
|
) }),
|
|
11204
|
-
/* @__PURE__ */ (0,
|
|
11565
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
11205
11566
|
TooltipContent2,
|
|
11206
11567
|
{
|
|
11207
11568
|
side: "left",
|
|
11208
11569
|
align: "center",
|
|
11209
11570
|
className: "uf-max-w-[200px]",
|
|
11210
|
-
children: /* @__PURE__ */ (0,
|
|
11571
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { children: t.minDeposit.tooltip })
|
|
11211
11572
|
}
|
|
11212
11573
|
)
|
|
11213
11574
|
] })
|
|
11214
11575
|
] }),
|
|
11215
|
-
/* @__PURE__ */ (0,
|
|
11576
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
11216
11577
|
Select2,
|
|
11217
11578
|
{
|
|
11218
11579
|
value: chain,
|
|
11219
11580
|
onValueChange: setChain,
|
|
11220
11581
|
disabled: tokensLoading || availableChainsForToken.length === 0,
|
|
11221
11582
|
children: [
|
|
11222
|
-
/* @__PURE__ */ (0,
|
|
11223
|
-
/* @__PURE__ */ (0,
|
|
11583
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.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_runtime29.jsx)(SelectValue2, { children: tokensLoading ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime29.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_runtime29.jsx)("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "uf-text-xs uf-font-normal", children: chain }) }) }) }),
|
|
11584
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(SelectContent2, { className: "uf-bg-secondary uf-border uf-text-foreground uf-max-h-[300px]", children: availableChainsForToken.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime29.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) => {
|
|
11224
11585
|
const chainKey = getChainKey(
|
|
11225
11586
|
chainData.chain_id,
|
|
11226
11587
|
chainData.chain_type
|
|
11227
11588
|
);
|
|
11228
|
-
return /* @__PURE__ */ (0,
|
|
11589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
11229
11590
|
SelectItem2,
|
|
11230
11591
|
{
|
|
11231
11592
|
value: chainKey,
|
|
@@ -11240,110 +11601,110 @@ function TransferCryptoBase({
|
|
|
11240
11601
|
)
|
|
11241
11602
|
] })
|
|
11242
11603
|
] }),
|
|
11243
|
-
/* @__PURE__ */ (0,
|
|
11604
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "uf-flex uf-justify-center uf-py-2", children: /* @__PURE__ */ (0, import_jsx_runtime29.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_runtime29.jsx)(
|
|
11244
11605
|
"div",
|
|
11245
11606
|
{
|
|
11246
11607
|
className: "uf-flex uf-items-center uf-justify-center",
|
|
11247
11608
|
style: { width: 180, height: 180 },
|
|
11248
|
-
children: /* @__PURE__ */ (0,
|
|
11609
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "uf-text-foreground uf-text-sm", children: t.loadingQRCode })
|
|
11249
11610
|
}
|
|
11250
|
-
) : depositAddress ? /* @__PURE__ */ (0,
|
|
11611
|
+
) : depositAddress ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
11251
11612
|
StyledQRCode,
|
|
11252
11613
|
{
|
|
11253
11614
|
value: depositAddress,
|
|
11254
11615
|
size: 180,
|
|
11255
|
-
imageUrl: currentChainData?.icon_url || currentChainFromBackend?.icon_url
|
|
11616
|
+
imageUrl: currentChainData?.icon_url || currentChainFromBackend?.icon_url,
|
|
11256
11617
|
imageSize: 45,
|
|
11257
11618
|
darkMode: isDarkMode
|
|
11258
11619
|
},
|
|
11259
11620
|
`qr-${depositAddress}-${chain}`
|
|
11260
|
-
) : /* @__PURE__ */ (0,
|
|
11621
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
11261
11622
|
"div",
|
|
11262
11623
|
{
|
|
11263
11624
|
className: "uf-flex uf-items-center uf-justify-center",
|
|
11264
11625
|
style: { width: 180, height: 180 },
|
|
11265
|
-
children: /* @__PURE__ */ (0,
|
|
11626
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "uf-text-red-400 uf-text-sm", children: t.noAddressAvailable })
|
|
11266
11627
|
}
|
|
11267
11628
|
) }) }),
|
|
11268
|
-
/* @__PURE__ */ (0,
|
|
11269
|
-
/* @__PURE__ */ (0,
|
|
11270
|
-
/* @__PURE__ */ (0,
|
|
11629
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { children: [
|
|
11630
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "uf-text-xs uf-text-muted-foreground uf-mb-2 uf-flex uf-items-center uf-justify-between", children: [
|
|
11631
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-1", children: [
|
|
11271
11632
|
t.depositAddress.label,
|
|
11272
|
-
/* @__PURE__ */ (0,
|
|
11273
|
-
/* @__PURE__ */ (0,
|
|
11633
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Tooltip2, { children: [
|
|
11634
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TooltipTrigger2, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
11274
11635
|
"span",
|
|
11275
11636
|
{
|
|
11276
11637
|
className: "uf-inline-flex uf-cursor-pointer uf-transition-colors hover:uf-text-foreground",
|
|
11277
11638
|
tabIndex: 0,
|
|
11278
11639
|
role: "button",
|
|
11279
11640
|
"aria-label": "Deposit address information",
|
|
11280
|
-
children: /* @__PURE__ */ (0,
|
|
11641
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Info, { className: "uf-w-3 uf-h-3" })
|
|
11281
11642
|
}
|
|
11282
11643
|
) }),
|
|
11283
|
-
/* @__PURE__ */ (0,
|
|
11644
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
11284
11645
|
TooltipContent2,
|
|
11285
11646
|
{
|
|
11286
11647
|
side: "top",
|
|
11287
11648
|
align: "center",
|
|
11288
11649
|
className: "uf-max-w-[240px]",
|
|
11289
|
-
children: /* @__PURE__ */ (0,
|
|
11650
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { children: t.depositAddress.tooltip.replace("{{token}}", token) })
|
|
11290
11651
|
}
|
|
11291
11652
|
)
|
|
11292
11653
|
] })
|
|
11293
11654
|
] }),
|
|
11294
|
-
copyButtonMode === "compact" && /* @__PURE__ */ (0,
|
|
11655
|
+
copyButtonMode === "compact" && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
11295
11656
|
"button",
|
|
11296
11657
|
{
|
|
11297
11658
|
onClick: handleCopyAddress,
|
|
11298
11659
|
disabled: loading || !depositAddress,
|
|
11299
11660
|
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",
|
|
11300
|
-
children: copied ? /* @__PURE__ */ (0,
|
|
11301
|
-
/* @__PURE__ */ (0,
|
|
11302
|
-
/* @__PURE__ */ (0,
|
|
11303
|
-
] }) : /* @__PURE__ */ (0,
|
|
11304
|
-
/* @__PURE__ */ (0,
|
|
11305
|
-
/* @__PURE__ */ (0,
|
|
11661
|
+
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
|
11662
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Check, { className: "uf-w-3 uf-h-3" }),
|
|
11663
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { children: t.copied })
|
|
11664
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
|
11665
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Copy, { className: "uf-w-3 uf-h-3" }),
|
|
11666
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { children: t.copyAddress })
|
|
11306
11667
|
] })
|
|
11307
11668
|
}
|
|
11308
11669
|
)
|
|
11309
11670
|
] }),
|
|
11310
|
-
loading ? /* @__PURE__ */ (0,
|
|
11671
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime29.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_runtime29.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_runtime29.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 })
|
|
11311
11672
|
] }),
|
|
11312
|
-
copyButtonMode === "fullWidth" && /* @__PURE__ */ (0,
|
|
11673
|
+
copyButtonMode === "fullWidth" && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
11313
11674
|
Button,
|
|
11314
11675
|
{
|
|
11315
11676
|
onClick: handleCopyAddress,
|
|
11316
11677
|
disabled: loading || !depositAddress,
|
|
11317
11678
|
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",
|
|
11318
|
-
children: copied ? /* @__PURE__ */ (0,
|
|
11319
|
-
/* @__PURE__ */ (0,
|
|
11679
|
+
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
|
11680
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Check, { className: "uf-w-4 uf-h-4 uf-mr-2" }),
|
|
11320
11681
|
t.copied
|
|
11321
|
-
] }) : /* @__PURE__ */ (0,
|
|
11322
|
-
/* @__PURE__ */ (0,
|
|
11682
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
|
11683
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Copy, { className: "uf-w-4 uf-h-4 uf-mr-2" }),
|
|
11323
11684
|
t.copyAddress
|
|
11324
11685
|
] })
|
|
11325
11686
|
}
|
|
11326
11687
|
),
|
|
11327
|
-
/* @__PURE__ */ (0,
|
|
11328
|
-
/* @__PURE__ */ (0,
|
|
11688
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "uf-border-t uf-border-border", children: [
|
|
11689
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
11329
11690
|
"button",
|
|
11330
11691
|
{
|
|
11331
11692
|
onClick: () => setDetailsExpanded(!detailsExpanded),
|
|
11332
11693
|
className: "uf-w-full uf-flex uf-items-center uf-justify-between uf-py-2.5",
|
|
11333
11694
|
children: [
|
|
11334
|
-
/* @__PURE__ */ (0,
|
|
11335
|
-
/* @__PURE__ */ (0,
|
|
11336
|
-
/* @__PURE__ */ (0,
|
|
11695
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
11696
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "uf-bg-secondary uf-rounded-full uf-p-1", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DollarSign, { className: "uf-w-3 uf-h-3" }) }),
|
|
11697
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("span", { className: "uf-text-xs", children: [
|
|
11337
11698
|
t.priceImpact.label,
|
|
11338
11699
|
":",
|
|
11339
11700
|
" ",
|
|
11340
|
-
/* @__PURE__ */ (0,
|
|
11701
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("span", { className: "uf-text-foreground", children: [
|
|
11341
11702
|
priceImpact.toFixed(2),
|
|
11342
11703
|
"%"
|
|
11343
11704
|
] })
|
|
11344
11705
|
] }),
|
|
11345
|
-
/* @__PURE__ */ (0,
|
|
11346
|
-
/* @__PURE__ */ (0,
|
|
11706
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Tooltip2, { children: [
|
|
11707
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TooltipTrigger2, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
11347
11708
|
"span",
|
|
11348
11709
|
{
|
|
11349
11710
|
className: "uf-inline-flex uf-cursor-pointer uf-text-muted-foreground uf-transition-colors hover:uf-text-foreground",
|
|
@@ -11356,75 +11717,75 @@ function TransferCryptoBase({
|
|
|
11356
11717
|
tabIndex: 0,
|
|
11357
11718
|
role: "button",
|
|
11358
11719
|
"aria-label": "Price impact information",
|
|
11359
|
-
children: /* @__PURE__ */ (0,
|
|
11720
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Info, { className: "uf-w-3 uf-h-3" })
|
|
11360
11721
|
}
|
|
11361
11722
|
) }),
|
|
11362
|
-
/* @__PURE__ */ (0,
|
|
11723
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
11363
11724
|
TooltipContent2,
|
|
11364
11725
|
{
|
|
11365
11726
|
side: "top",
|
|
11366
11727
|
align: "center",
|
|
11367
11728
|
className: "uf-max-w-[240px]",
|
|
11368
|
-
children: /* @__PURE__ */ (0,
|
|
11729
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { children: t.priceImpact.tooltip })
|
|
11369
11730
|
}
|
|
11370
11731
|
)
|
|
11371
11732
|
] })
|
|
11372
11733
|
] }),
|
|
11373
|
-
detailsExpanded ? /* @__PURE__ */ (0,
|
|
11734
|
+
detailsExpanded ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ChevronUp, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground" }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ChevronDown, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground" })
|
|
11374
11735
|
]
|
|
11375
11736
|
}
|
|
11376
11737
|
),
|
|
11377
|
-
detailsExpanded && /* @__PURE__ */ (0,
|
|
11378
|
-
/* @__PURE__ */ (0,
|
|
11379
|
-
/* @__PURE__ */ (0,
|
|
11380
|
-
/* @__PURE__ */ (0,
|
|
11738
|
+
detailsExpanded && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "uf-pb-3 uf-space-y-2.5", children: [
|
|
11739
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
11740
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "uf-bg-secondary uf-rounded-full uf-p-1", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ShieldCheck, { className: "uf-w-3 uf-h-3" }) }),
|
|
11741
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("span", { className: "uf-text-xs", children: [
|
|
11381
11742
|
t.slippage.label,
|
|
11382
11743
|
":",
|
|
11383
11744
|
" ",
|
|
11384
|
-
/* @__PURE__ */ (0,
|
|
11745
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("span", { className: "uf-text-foreground", children: [
|
|
11385
11746
|
t.slippage.auto,
|
|
11386
11747
|
" \u2022 ",
|
|
11387
11748
|
maxSlippage.toFixed(2),
|
|
11388
11749
|
"%"
|
|
11389
11750
|
] })
|
|
11390
11751
|
] }),
|
|
11391
|
-
/* @__PURE__ */ (0,
|
|
11392
|
-
/* @__PURE__ */ (0,
|
|
11752
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Tooltip2, { children: [
|
|
11753
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TooltipTrigger2, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
11393
11754
|
"span",
|
|
11394
11755
|
{
|
|
11395
11756
|
className: "uf-inline-flex uf-cursor-pointer uf-text-muted-foreground uf-transition-colors hover:uf-text-foreground",
|
|
11396
11757
|
tabIndex: 0,
|
|
11397
11758
|
role: "button",
|
|
11398
11759
|
"aria-label": "Slippage information",
|
|
11399
|
-
children: /* @__PURE__ */ (0,
|
|
11760
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Info, { className: "uf-w-3 uf-h-3" })
|
|
11400
11761
|
}
|
|
11401
11762
|
) }),
|
|
11402
|
-
/* @__PURE__ */ (0,
|
|
11763
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
11403
11764
|
TooltipContent2,
|
|
11404
11765
|
{
|
|
11405
11766
|
side: "top",
|
|
11406
11767
|
align: "center",
|
|
11407
11768
|
className: "uf-max-w-[240px]",
|
|
11408
|
-
children: /* @__PURE__ */ (0,
|
|
11769
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { children: t.slippage.tooltip })
|
|
11409
11770
|
}
|
|
11410
11771
|
)
|
|
11411
11772
|
] })
|
|
11412
11773
|
] }),
|
|
11413
|
-
/* @__PURE__ */ (0,
|
|
11414
|
-
/* @__PURE__ */ (0,
|
|
11415
|
-
/* @__PURE__ */ (0,
|
|
11774
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
11775
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "uf-bg-secondary uf-rounded-full uf-p-1", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Clock, { className: "uf-w-3 uf-h-3" }) }),
|
|
11776
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("span", { className: "uf-text-xs", children: [
|
|
11416
11777
|
t.processingTime.label,
|
|
11417
11778
|
":",
|
|
11418
11779
|
" ",
|
|
11419
|
-
/* @__PURE__ */ (0,
|
|
11780
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "uf-text-foreground", children: formatProcessingTime(processingTime) })
|
|
11420
11781
|
] })
|
|
11421
11782
|
] }),
|
|
11422
|
-
/* @__PURE__ */ (0,
|
|
11423
|
-
/* @__PURE__ */ (0,
|
|
11424
|
-
/* @__PURE__ */ (0,
|
|
11783
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
11784
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "uf-bg-secondary uf-rounded-full uf-p-1", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FileText, { className: "uf-w-3 uf-h-3" }) }),
|
|
11785
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("span", { className: "uf-text-xs", children: [
|
|
11425
11786
|
t.help.needHelp,
|
|
11426
11787
|
" ",
|
|
11427
|
-
/* @__PURE__ */ (0,
|
|
11788
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
11428
11789
|
"a",
|
|
11429
11790
|
{
|
|
11430
11791
|
href: "#",
|
|
@@ -11435,8 +11796,8 @@ function TransferCryptoBase({
|
|
|
11435
11796
|
] })
|
|
11436
11797
|
] })
|
|
11437
11798
|
] }),
|
|
11438
|
-
/* @__PURE__ */ (0,
|
|
11439
|
-
/* @__PURE__ */ (0,
|
|
11799
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "uf-flex uf-items-center uf-justify-between uf-text-xs uf-pt-2", children: [
|
|
11800
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
11440
11801
|
"a",
|
|
11441
11802
|
{
|
|
11442
11803
|
href: "https://unifold.io/terms",
|
|
@@ -11445,38 +11806,37 @@ function TransferCryptoBase({
|
|
|
11445
11806
|
children: t.terms.termsApply
|
|
11446
11807
|
}
|
|
11447
11808
|
),
|
|
11448
|
-
depositExecutions.length > 1 && /* @__PURE__ */ (0,
|
|
11809
|
+
depositExecutions.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
11449
11810
|
"button",
|
|
11450
11811
|
{
|
|
11451
11812
|
onClick: () => setDepositsModalOpen(true),
|
|
11452
11813
|
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",
|
|
11453
11814
|
children: [
|
|
11454
|
-
/* @__PURE__ */ (0,
|
|
11815
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Clock, { className: "uf-w-3.5 uf-h-3.5" }),
|
|
11455
11816
|
"Track deposits (",
|
|
11456
11817
|
depositExecutions.length,
|
|
11457
11818
|
")",
|
|
11458
|
-
/* @__PURE__ */ (0,
|
|
11819
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ChevronRight, { className: "uf-w-3 uf-h-3" })
|
|
11459
11820
|
]
|
|
11460
11821
|
}
|
|
11461
11822
|
)
|
|
11462
11823
|
] })
|
|
11463
11824
|
] }),
|
|
11464
|
-
depositExecutions.length === 1 && /* @__PURE__ */ (0,
|
|
11825
|
+
depositExecutions.length === 1 && /* @__PURE__ */ (0, import_jsx_runtime29.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_runtime29.jsx)(
|
|
11465
11826
|
DepositSuccessToast,
|
|
11466
11827
|
{
|
|
11467
11828
|
depositTx: depositExecutions[0].transaction_hash,
|
|
11468
|
-
completionTx: depositExecutions[0].destination_transaction_hashes?.[0] || (depositExecutions[0].status === "succeeded" ? depositExecutions[0].transaction_hash : void 0),
|
|
11469
11829
|
orderSubmittedAt: depositExecutions[0].created_at || (/* @__PURE__ */ new Date()).toISOString(),
|
|
11470
11830
|
orderFilledAt: depositExecutions[0].updated_at || (/* @__PURE__ */ new Date()).toISOString(),
|
|
11471
11831
|
explorerUrl: depositExecutions[0].explorer_url,
|
|
11472
|
-
completionExplorerUrl: depositExecutions[0].destination_transaction_hashes?.[0] ? `https://polygonscan.com/tx/${depositExecutions[0].destination_transaction_hashes[0]}` : depositExecutions[0].status === "succeeded" ? depositExecutions[0].explorer_url : void 0,
|
|
11473
11832
|
status: depositExecutions[0].status,
|
|
11474
11833
|
tokenIconUrl: depositExecutions[0].source_token_metadata?.icon_url,
|
|
11834
|
+
sourceAmountBaseUnit: depositExecutions[0].source_amount_base_unit,
|
|
11475
11835
|
onClose: () => setDepositExecutions([])
|
|
11476
11836
|
},
|
|
11477
11837
|
depositExecutions[0].id
|
|
11478
11838
|
) }),
|
|
11479
|
-
/* @__PURE__ */ (0,
|
|
11839
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
11480
11840
|
DepositsModal,
|
|
11481
11841
|
{
|
|
11482
11842
|
open: depositsModalOpen,
|
|
@@ -11490,7 +11850,7 @@ function TransferCryptoBase({
|
|
|
11490
11850
|
] }) });
|
|
11491
11851
|
}
|
|
11492
11852
|
function TransferCrypto(props) {
|
|
11493
|
-
return /* @__PURE__ */ (0,
|
|
11853
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
11494
11854
|
TransferCryptoBase,
|
|
11495
11855
|
{
|
|
11496
11856
|
...props,
|
|
@@ -11504,29 +11864,28 @@ function CurrencyListItem({
|
|
|
11504
11864
|
isSelected,
|
|
11505
11865
|
onSelect
|
|
11506
11866
|
}) {
|
|
11507
|
-
|
|
11867
|
+
const iconUrl = getPreferredIconUrl(currency.icon_urls, "png") || currency.icon_url;
|
|
11868
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
11508
11869
|
"button",
|
|
11509
11870
|
{
|
|
11510
11871
|
onClick: () => onSelect(currency.currency_code),
|
|
11511
11872
|
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",
|
|
11512
11873
|
children: [
|
|
11513
|
-
/* @__PURE__ */ (0,
|
|
11514
|
-
/* @__PURE__ */ (0,
|
|
11874
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
11875
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
11515
11876
|
"img",
|
|
11516
11877
|
{
|
|
11517
|
-
src:
|
|
11878
|
+
src: iconUrl,
|
|
11518
11879
|
alt: currency.name,
|
|
11519
|
-
|
|
11520
|
-
height: 40,
|
|
11521
|
-
className: "uf-w-full uf-h-full uf-object-cover uf-rounded-full"
|
|
11880
|
+
className: "uf-w-10 uf-h-10 uf-flex-shrink-0"
|
|
11522
11881
|
}
|
|
11523
|
-
)
|
|
11524
|
-
/* @__PURE__ */ (0,
|
|
11525
|
-
/* @__PURE__ */ (0,
|
|
11526
|
-
/* @__PURE__ */ (0,
|
|
11882
|
+
),
|
|
11883
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "uf-text-left", children: [
|
|
11884
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "uf-text-sm uf-font-normal uf-text-foreground", children: currency.name }),
|
|
11885
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "uf-text-xs uf-text-muted-foreground uf-font-light", children: currency.currency_code.toUpperCase() })
|
|
11527
11886
|
] })
|
|
11528
11887
|
] }),
|
|
11529
|
-
isSelected && /* @__PURE__ */ (0,
|
|
11888
|
+
isSelected && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Check, { className: "uf-w-4 uf-h-4 uf-text-foreground" })
|
|
11530
11889
|
]
|
|
11531
11890
|
}
|
|
11532
11891
|
);
|
|
@@ -11538,9 +11897,9 @@ function CurrencyListSection({
|
|
|
11538
11897
|
onSelect
|
|
11539
11898
|
}) {
|
|
11540
11899
|
if (currencies.length === 0) return null;
|
|
11541
|
-
return /* @__PURE__ */ (0,
|
|
11542
|
-
/* @__PURE__ */ (0,
|
|
11543
|
-
currencies.map((currency) => /* @__PURE__ */ (0,
|
|
11900
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
11901
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "uf-px-1 uf-pb-2", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("h3", { className: "uf-text-xs uf-font-light uf-text-muted-foreground", children: title }) }),
|
|
11902
|
+
currencies.map((currency) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
11544
11903
|
CurrencyListItem,
|
|
11545
11904
|
{
|
|
11546
11905
|
currency,
|
|
@@ -11587,8 +11946,8 @@ function CurrencyModal({
|
|
|
11587
11946
|
onOpenChange(false);
|
|
11588
11947
|
setSearchQuery("");
|
|
11589
11948
|
};
|
|
11590
|
-
return /* @__PURE__ */ (0,
|
|
11591
|
-
/* @__PURE__ */ (0,
|
|
11949
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Dialog2, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(DialogContent2, { 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: [
|
|
11950
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
11592
11951
|
DepositHeader,
|
|
11593
11952
|
{
|
|
11594
11953
|
title: "Currency",
|
|
@@ -11597,9 +11956,9 @@ function CurrencyModal({
|
|
|
11597
11956
|
onClose: handleClose
|
|
11598
11957
|
}
|
|
11599
11958
|
),
|
|
11600
|
-
/* @__PURE__ */ (0,
|
|
11601
|
-
/* @__PURE__ */ (0,
|
|
11602
|
-
/* @__PURE__ */ (0,
|
|
11959
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-relative", children: [
|
|
11960
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.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" }),
|
|
11961
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
11603
11962
|
"input",
|
|
11604
11963
|
{
|
|
11605
11964
|
type: "text",
|
|
@@ -11610,8 +11969,8 @@ function CurrencyModal({
|
|
|
11610
11969
|
}
|
|
11611
11970
|
)
|
|
11612
11971
|
] }) }),
|
|
11613
|
-
/* @__PURE__ */ (0,
|
|
11614
|
-
/* @__PURE__ */ (0,
|
|
11972
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-max-h-[500px] uf-overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:uf-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-space-y-2", children: [
|
|
11973
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
11615
11974
|
CurrencyListSection,
|
|
11616
11975
|
{
|
|
11617
11976
|
title: "Popular currencies",
|
|
@@ -11620,8 +11979,8 @@ function CurrencyModal({
|
|
|
11620
11979
|
onSelect: handleSelect
|
|
11621
11980
|
}
|
|
11622
11981
|
),
|
|
11623
|
-
filteredPreferred.length > 0 && filteredOther.length > 0 && /* @__PURE__ */ (0,
|
|
11624
|
-
/* @__PURE__ */ (0,
|
|
11982
|
+
filteredPreferred.length > 0 && filteredOther.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-h-2" }),
|
|
11983
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
11625
11984
|
CurrencyListSection,
|
|
11626
11985
|
{
|
|
11627
11986
|
title: "All currencies",
|
|
@@ -11630,22 +11989,10 @@ function CurrencyModal({
|
|
|
11630
11989
|
onSelect: handleSelect
|
|
11631
11990
|
}
|
|
11632
11991
|
),
|
|
11633
|
-
filteredPreferred.length === 0 && filteredOther.length === 0 && /* @__PURE__ */ (0,
|
|
11992
|
+
filteredPreferred.length === 0 && filteredOther.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-text-center uf-py-8 uf-text-muted-foreground uf-text-sm", children: "No currencies found" })
|
|
11634
11993
|
] }) })
|
|
11635
11994
|
] }) });
|
|
11636
11995
|
}
|
|
11637
|
-
async function getIpViaMoonpay(moonpayApiKey) {
|
|
11638
|
-
const url = `https://api.moonpay.com/v3/ip_address?apiKey=${moonpayApiKey}`;
|
|
11639
|
-
const response = await fetch(url);
|
|
11640
|
-
if (!response.ok) {
|
|
11641
|
-
throw new Error(`Moonpay IP API failed: ${response.statusText}`);
|
|
11642
|
-
}
|
|
11643
|
-
const data = await response.json();
|
|
11644
|
-
return {
|
|
11645
|
-
alpha2: data.alpha2.toLowerCase(),
|
|
11646
|
-
state: data.state?.toLowerCase()
|
|
11647
|
-
};
|
|
11648
|
-
}
|
|
11649
11996
|
async function getIpViaIpApi() {
|
|
11650
11997
|
const url = "https://ipapi.co/json";
|
|
11651
11998
|
const response = await fetch(url);
|
|
@@ -11658,7 +12005,7 @@ async function getIpViaIpApi() {
|
|
|
11658
12005
|
state: data.region_code?.toLowerCase()
|
|
11659
12006
|
};
|
|
11660
12007
|
}
|
|
11661
|
-
function useUserIp(
|
|
12008
|
+
function useUserIp() {
|
|
11662
12009
|
const {
|
|
11663
12010
|
data: userIpInfo,
|
|
11664
12011
|
isLoading,
|
|
@@ -11666,21 +12013,12 @@ function useUserIp(moonpayApiKey) {
|
|
|
11666
12013
|
} = (0, import_react_query2.useQuery)({
|
|
11667
12014
|
queryKey: ["getUserIpInfo"],
|
|
11668
12015
|
queryFn: async () => {
|
|
11669
|
-
if (moonpayApiKey) {
|
|
11670
|
-
try {
|
|
11671
|
-
const moonpayIpData = await getIpViaMoonpay(moonpayApiKey);
|
|
11672
|
-
console.log("IP detected via Moonpay:", moonpayIpData);
|
|
11673
|
-
return moonpayIpData;
|
|
11674
|
-
} catch (error2) {
|
|
11675
|
-
console.warn("Moonpay IP API failed, trying fallback:", error2);
|
|
11676
|
-
}
|
|
11677
|
-
}
|
|
11678
12016
|
try {
|
|
11679
12017
|
const ipApiData = await getIpViaIpApi();
|
|
11680
12018
|
console.log("IP detected via ipapi.co:", ipApiData);
|
|
11681
12019
|
return ipApiData;
|
|
11682
12020
|
} catch (ipApiError) {
|
|
11683
|
-
console.error("
|
|
12021
|
+
console.error("IP detection failed:", ipApiError);
|
|
11684
12022
|
throw ipApiError;
|
|
11685
12023
|
}
|
|
11686
12024
|
},
|
|
@@ -11726,7 +12064,9 @@ function BuyWithCard({
|
|
|
11726
12064
|
destinationChainType,
|
|
11727
12065
|
destinationChainId,
|
|
11728
12066
|
destinationTokenAddress,
|
|
11729
|
-
themeClass = ""
|
|
12067
|
+
themeClass = "",
|
|
12068
|
+
wallets: externalWallets,
|
|
12069
|
+
assetCdnUrl
|
|
11730
12070
|
}) {
|
|
11731
12071
|
const [amount, setAmount] = (0, import_react11.useState)("500.00");
|
|
11732
12072
|
const [currency, setCurrency] = (0, import_react11.useState)("usd");
|
|
@@ -11761,8 +12101,9 @@ function BuyWithCard({
|
|
|
11761
12101
|
const [isAutoSelected, setIsAutoSelected] = (0, import_react11.useState)(true);
|
|
11762
12102
|
const [autoSelectedProvider, setAutoSelectedProvider] = (0, import_react11.useState)(null);
|
|
11763
12103
|
const [hasManualSelection, setHasManualSelection] = (0, import_react11.useState)(false);
|
|
11764
|
-
const [
|
|
11765
|
-
const [walletsLoading, setWalletsLoading] = (0, import_react11.useState)(
|
|
12104
|
+
const [internalWallets, setInternalWallets] = (0, import_react11.useState)([]);
|
|
12105
|
+
const [walletsLoading, setWalletsLoading] = (0, import_react11.useState)(!externalWallets?.length);
|
|
12106
|
+
const wallets = externalWallets?.length ? externalWallets : internalWallets;
|
|
11766
12107
|
const [countdown, setCountdown] = (0, import_react11.useState)(60);
|
|
11767
12108
|
const [fiatCurrencies, setFiatCurrencies] = (0, import_react11.useState)([]);
|
|
11768
12109
|
const [preferredCurrencyCodes, setPreferredCurrencyCodes] = (0, import_react11.useState)([]);
|
|
@@ -11791,7 +12132,15 @@ function BuyWithCard({
|
|
|
11791
12132
|
fetchFiatCurrencies();
|
|
11792
12133
|
}, [publishableKey]);
|
|
11793
12134
|
(0, import_react11.useEffect)(() => {
|
|
11794
|
-
|
|
12135
|
+
if (externalWallets?.length) {
|
|
12136
|
+
setWalletsLoading(false);
|
|
12137
|
+
return;
|
|
12138
|
+
}
|
|
12139
|
+
let retryTimeout = null;
|
|
12140
|
+
let isCancelled = false;
|
|
12141
|
+
const fetchWallets = async () => {
|
|
12142
|
+
if (isCancelled) return;
|
|
12143
|
+
setWalletsLoading(true);
|
|
11795
12144
|
try {
|
|
11796
12145
|
const response = await createEOA(
|
|
11797
12146
|
{
|
|
@@ -11803,16 +12152,26 @@ function BuyWithCard({
|
|
|
11803
12152
|
},
|
|
11804
12153
|
publishableKey
|
|
11805
12154
|
);
|
|
11806
|
-
|
|
12155
|
+
if (!isCancelled) {
|
|
12156
|
+
setInternalWallets(response.data);
|
|
12157
|
+
setWalletsLoading(false);
|
|
12158
|
+
}
|
|
11807
12159
|
} catch (err) {
|
|
11808
|
-
console.error("Error fetching wallets:", err);
|
|
11809
|
-
|
|
11810
|
-
|
|
11811
|
-
|
|
12160
|
+
console.error("Error fetching wallets, retrying in 5s:", err);
|
|
12161
|
+
if (!isCancelled) {
|
|
12162
|
+
setWalletsLoading(false);
|
|
12163
|
+
retryTimeout = setTimeout(fetchWallets, 5e3);
|
|
12164
|
+
}
|
|
11812
12165
|
}
|
|
11813
|
-
}
|
|
12166
|
+
};
|
|
11814
12167
|
fetchWallets();
|
|
11815
|
-
|
|
12168
|
+
return () => {
|
|
12169
|
+
isCancelled = true;
|
|
12170
|
+
if (retryTimeout) {
|
|
12171
|
+
clearTimeout(retryTimeout);
|
|
12172
|
+
}
|
|
12173
|
+
};
|
|
12174
|
+
}, [userId, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, publishableKey, externalWallets]);
|
|
11816
12175
|
(0, import_react11.useEffect)(() => {
|
|
11817
12176
|
async function fetchSupportedTokens() {
|
|
11818
12177
|
try {
|
|
@@ -11979,38 +12338,36 @@ function BuyWithCard({
|
|
|
11979
12338
|
(a, b) => b.destination_amount - a.destination_amount
|
|
11980
12339
|
);
|
|
11981
12340
|
const currencySymbol = getCurrencySymbol(currency);
|
|
11982
|
-
return /* @__PURE__ */ (0,
|
|
11983
|
-
/* @__PURE__ */ (0,
|
|
12341
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "uf-pb-1 uf-relative uf-overflow-hidden", children: [
|
|
12342
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
11984
12343
|
"div",
|
|
11985
12344
|
{
|
|
11986
12345
|
className: `uf-transition-all uf-duration-300 ${showQuotesView || showOnrampView ? "uf-opacity-0 uf-pointer-events-none uf-absolute uf-inset-0" : "uf-opacity-100"}`,
|
|
11987
12346
|
children: [
|
|
11988
|
-
/* @__PURE__ */ (0,
|
|
11989
|
-
/* @__PURE__ */ (0,
|
|
12347
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "uf-mb-6 uf-pt-4", children: [
|
|
12348
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "uf-flex uf-justify-center uf-mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
11990
12349
|
"button",
|
|
11991
12350
|
{
|
|
11992
12351
|
onClick: () => setShowCurrencyModal(true),
|
|
11993
12352
|
disabled: currenciesLoading,
|
|
11994
12353
|
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",
|
|
11995
12354
|
children: [
|
|
11996
|
-
selectedCurrencyData && /* @__PURE__ */ (0,
|
|
12355
|
+
selectedCurrencyData && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
11997
12356
|
"img",
|
|
11998
12357
|
{
|
|
11999
|
-
src: selectedCurrencyData.icon_url,
|
|
12358
|
+
src: getPreferredIconUrl(selectedCurrencyData.icon_urls, "png") || selectedCurrencyData.icon_url,
|
|
12000
12359
|
alt: selectedCurrencyData.name,
|
|
12001
|
-
|
|
12002
|
-
height: 16,
|
|
12003
|
-
className: "uf-w-full uf-h-full uf-object-cover uf-rounded-full"
|
|
12360
|
+
className: "uf-w-4 uf-h-4"
|
|
12004
12361
|
}
|
|
12005
|
-
)
|
|
12006
|
-
/* @__PURE__ */ (0,
|
|
12007
|
-
/* @__PURE__ */ (0,
|
|
12362
|
+
),
|
|
12363
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "uf-text-sm uf-text-foreground uf-font-medium", children: currency.toUpperCase() }),
|
|
12364
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ChevronDown, { className: "uf-w-3.5 uf-h-3.5 uf-text-muted-foreground" })
|
|
12008
12365
|
]
|
|
12009
12366
|
}
|
|
12010
12367
|
) }),
|
|
12011
|
-
/* @__PURE__ */ (0,
|
|
12012
|
-
/* @__PURE__ */ (0,
|
|
12013
|
-
/* @__PURE__ */ (0,
|
|
12368
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "uf-text-center uf-mb-4", children: [
|
|
12369
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "uf-flex uf-items-center uf-justify-center uf-mb-2 uf-px-8", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "uf-flex uf-items-center uf-max-w-full", children: [
|
|
12370
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
12014
12371
|
"span",
|
|
12015
12372
|
{
|
|
12016
12373
|
className: "uf-font-normal uf-text-foreground uf-flex-shrink-0 uf-mr-1",
|
|
@@ -12020,7 +12377,7 @@ function BuyWithCard({
|
|
|
12020
12377
|
children: currencySymbol
|
|
12021
12378
|
}
|
|
12022
12379
|
),
|
|
12023
|
-
/* @__PURE__ */ (0,
|
|
12380
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
12024
12381
|
"input",
|
|
12025
12382
|
{
|
|
12026
12383
|
type: "text",
|
|
@@ -12036,12 +12393,12 @@ function BuyWithCard({
|
|
|
12036
12393
|
}
|
|
12037
12394
|
)
|
|
12038
12395
|
] }) }),
|
|
12039
|
-
quotesLoading ? /* @__PURE__ */ (0,
|
|
12396
|
+
quotesLoading ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "uf-flex uf-justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "uf-h-4 uf-bg-muted uf-rounded uf-w-40 uf-animate-pulse" }) }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "uf-text-sm uf-text-muted-foreground uf-font-normal", children: [
|
|
12040
12397
|
calculateUSDC(),
|
|
12041
12398
|
" USDC (Perps)"
|
|
12042
12399
|
] })
|
|
12043
12400
|
] }),
|
|
12044
|
-
/* @__PURE__ */ (0,
|
|
12401
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "uf-flex uf-gap-3 uf-justify-center", children: QUICK_AMOUNTS.map((quickAmount) => /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
12045
12402
|
"button",
|
|
12046
12403
|
{
|
|
12047
12404
|
onClick: () => handleQuickAmount(quickAmount),
|
|
@@ -12054,31 +12411,31 @@ function BuyWithCard({
|
|
|
12054
12411
|
quickAmount
|
|
12055
12412
|
)) })
|
|
12056
12413
|
] }),
|
|
12057
|
-
/* @__PURE__ */ (0,
|
|
12058
|
-
/* @__PURE__ */ (0,
|
|
12059
|
-
/* @__PURE__ */ (0,
|
|
12060
|
-
quotes.length > 0 && !quotesLoading && /* @__PURE__ */ (0,
|
|
12414
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "uf-mb-6", children: [
|
|
12415
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "uf-flex uf-items-center uf-justify-between uf-text-xs uf-font-medium uf-mb-2 uf-px-1", children: [
|
|
12416
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "uf-text-foreground", children: "Provider" }),
|
|
12417
|
+
quotes.length > 0 && !quotesLoading && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "uf-text-[10px] uf-text-foreground uf-font-normal", children: [
|
|
12061
12418
|
"Refreshing in ",
|
|
12062
12419
|
countdown,
|
|
12063
12420
|
"s"
|
|
12064
12421
|
] })
|
|
12065
12422
|
] }),
|
|
12066
|
-
/* @__PURE__ */ (0,
|
|
12423
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
12067
12424
|
"button",
|
|
12068
12425
|
{
|
|
12069
12426
|
onClick: () => handleViewChange("quotes"),
|
|
12070
12427
|
disabled: quotesLoading || quotes.length === 0,
|
|
12071
12428
|
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",
|
|
12072
|
-
children: quotesLoading ? /* @__PURE__ */ (0,
|
|
12073
|
-
/* @__PURE__ */ (0,
|
|
12074
|
-
/* @__PURE__ */ (0,
|
|
12075
|
-
/* @__PURE__ */ (0,
|
|
12076
|
-
/* @__PURE__ */ (0,
|
|
12429
|
+
children: quotesLoading ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "uf-text-left uf-w-full uf-animate-pulse", children: [
|
|
12430
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "uf-h-3 uf-bg-muted uf-rounded uf-w-28 uf-mb-3" }),
|
|
12431
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
12432
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "uf-w-8 uf-h-8 uf-bg-muted uf-rounded-full" }),
|
|
12433
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "uf-h-4 uf-bg-muted uf-rounded uf-w-32" })
|
|
12077
12434
|
] })
|
|
12078
|
-
] }) : /* @__PURE__ */ (0,
|
|
12079
|
-
isAutoSelected && /* @__PURE__ */ (0,
|
|
12080
|
-
selectedProvider && /* @__PURE__ */ (0,
|
|
12081
|
-
/* @__PURE__ */ (0,
|
|
12435
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "uf-w-full uf-text-left", children: [
|
|
12436
|
+
isAutoSelected && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "uf-text-xs uf-text-muted-foreground uf-font-normal uf-mb-2", children: "Auto-picked for you" }),
|
|
12437
|
+
selectedProvider && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
12438
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
12082
12439
|
"img",
|
|
12083
12440
|
{
|
|
12084
12441
|
src: selectedProvider.icon_url,
|
|
@@ -12088,22 +12445,22 @@ function BuyWithCard({
|
|
|
12088
12445
|
className: "uf-rounded-full uf-flex-shrink-0"
|
|
12089
12446
|
}
|
|
12090
12447
|
),
|
|
12091
|
-
/* @__PURE__ */ (0,
|
|
12092
|
-
/* @__PURE__ */ (0,
|
|
12093
|
-
/* @__PURE__ */ (0,
|
|
12094
|
-
isAutoSelected && /* @__PURE__ */ (0,
|
|
12095
|
-
isAutoSelected && selectedProvider.low_kyc === false && /* @__PURE__ */ (0,
|
|
12096
|
-
selectedProvider.low_kyc === false && /* @__PURE__ */ (0,
|
|
12448
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "uf-flex-1 uf-min-w-0", children: [
|
|
12449
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "uf-text-sm uf-text-foreground uf-font-medium", children: selectedProvider.service_provider_display_name }),
|
|
12450
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-1.5 uf-mt-0.5", children: [
|
|
12451
|
+
isAutoSelected && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "uf-text-[10px] uf-text-green-400 uf-font-normal", children: "Best price" }),
|
|
12452
|
+
isAutoSelected && selectedProvider.low_kyc === false && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "uf-text-[10px] uf-text-muted-foreground", children: "\u2022" }),
|
|
12453
|
+
selectedProvider.low_kyc === false && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "uf-text-[10px] uf-text-muted-foreground uf-font-normal", children: "No document upload" })
|
|
12097
12454
|
] })
|
|
12098
12455
|
] }),
|
|
12099
|
-
quotes.length > 0 && /* @__PURE__ */ (0,
|
|
12456
|
+
quotes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ChevronRight, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground group-hover:uf-text-foreground uf-transition-colors uf-flex-shrink-0" })
|
|
12100
12457
|
] })
|
|
12101
12458
|
] })
|
|
12102
12459
|
}
|
|
12103
12460
|
),
|
|
12104
|
-
quotesError && /* @__PURE__ */ (0,
|
|
12461
|
+
quotesError && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "uf-text-xs uf-text-red-400 uf-mt-2 uf-px-1", children: quotesError })
|
|
12105
12462
|
] }),
|
|
12106
|
-
/* @__PURE__ */ (0,
|
|
12463
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
12107
12464
|
"button",
|
|
12108
12465
|
{
|
|
12109
12466
|
onClick: handleContinue,
|
|
@@ -12118,15 +12475,15 @@ function BuyWithCard({
|
|
|
12118
12475
|
]
|
|
12119
12476
|
}
|
|
12120
12477
|
),
|
|
12121
|
-
/* @__PURE__ */ (0,
|
|
12478
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
12122
12479
|
"div",
|
|
12123
12480
|
{
|
|
12124
12481
|
className: `uf-transition-all uf-duration-300 ${showQuotesView && !showOnrampView ? "uf-opacity-100" : "uf-opacity-0 uf-pointer-events-none uf-absolute uf-inset-0"}`,
|
|
12125
|
-
children: /* @__PURE__ */ (0,
|
|
12482
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "uf-space-y-2 uf-pt-2", children: sortedQuotes.map((quote, index2) => {
|
|
12126
12483
|
const badges = getProviderBadges(quote, sortedQuotes);
|
|
12127
12484
|
const displayName = quote.service_provider_display_name;
|
|
12128
12485
|
const isSelected = selectedProvider?.service_provider === quote.service_provider;
|
|
12129
|
-
return /* @__PURE__ */ (0,
|
|
12486
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
12130
12487
|
"button",
|
|
12131
12488
|
{
|
|
12132
12489
|
onClick: () => {
|
|
@@ -12139,8 +12496,8 @@ function BuyWithCard({
|
|
|
12139
12496
|
},
|
|
12140
12497
|
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" : ""}`,
|
|
12141
12498
|
children: [
|
|
12142
|
-
/* @__PURE__ */ (0,
|
|
12143
|
-
/* @__PURE__ */ (0,
|
|
12499
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
12500
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.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_runtime34.jsx)(
|
|
12144
12501
|
"img",
|
|
12145
12502
|
{
|
|
12146
12503
|
src: quote.icon_url,
|
|
@@ -12150,10 +12507,10 @@ function BuyWithCard({
|
|
|
12150
12507
|
className: "uf-rounded-full"
|
|
12151
12508
|
}
|
|
12152
12509
|
) }),
|
|
12153
|
-
/* @__PURE__ */ (0,
|
|
12154
|
-
/* @__PURE__ */ (0,
|
|
12155
|
-
/* @__PURE__ */ (0,
|
|
12156
|
-
badges.map((badge, i) => /* @__PURE__ */ (0,
|
|
12510
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "uf-text-left", children: [
|
|
12511
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "uf-text-sm uf-font-medium uf-text-foreground", children: displayName }),
|
|
12512
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-1.5 uf-mt-0.5", children: [
|
|
12513
|
+
badges.map((badge, i) => /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
12157
12514
|
"span",
|
|
12158
12515
|
{
|
|
12159
12516
|
className: "uf-text-[10px] uf-text-green-400 uf-font-normal",
|
|
@@ -12164,17 +12521,17 @@ function BuyWithCard({
|
|
|
12164
12521
|
},
|
|
12165
12522
|
i
|
|
12166
12523
|
)),
|
|
12167
|
-
quote.low_kyc === false && badges.length > 0 && /* @__PURE__ */ (0,
|
|
12168
|
-
quote.low_kyc === false && /* @__PURE__ */ (0,
|
|
12524
|
+
quote.low_kyc === false && badges.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "uf-text-[10px] uf-text-muted-foreground", children: "\u2022" }),
|
|
12525
|
+
quote.low_kyc === false && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "uf-text-[10px] uf-text-muted-foreground uf-font-normal", children: "No document upload" })
|
|
12169
12526
|
] })
|
|
12170
12527
|
] })
|
|
12171
12528
|
] }),
|
|
12172
|
-
/* @__PURE__ */ (0,
|
|
12173
|
-
/* @__PURE__ */ (0,
|
|
12529
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "uf-text-right", children: [
|
|
12530
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "uf-text-sm uf-font-medium uf-text-foreground", children: [
|
|
12174
12531
|
quote.destination_amount.toFixed(2),
|
|
12175
12532
|
" USDC"
|
|
12176
12533
|
] }),
|
|
12177
|
-
/* @__PURE__ */ (0,
|
|
12534
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "uf-text-xs uf-text-muted-foreground uf-font-normal", children: [
|
|
12178
12535
|
currencySymbol,
|
|
12179
12536
|
" ",
|
|
12180
12537
|
amount
|
|
@@ -12187,12 +12544,12 @@ function BuyWithCard({
|
|
|
12187
12544
|
}) })
|
|
12188
12545
|
}
|
|
12189
12546
|
),
|
|
12190
|
-
/* @__PURE__ */ (0,
|
|
12547
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
12191
12548
|
"div",
|
|
12192
12549
|
{
|
|
12193
12550
|
className: `uf-transition-all uf-duration-300 ${showOnrampView ? "uf-opacity-100" : "uf-opacity-0 uf-pointer-events-none uf-absolute uf-inset-0"}`,
|
|
12194
|
-
children: onrampSession && /* @__PURE__ */ (0,
|
|
12195
|
-
/* @__PURE__ */ (0,
|
|
12551
|
+
children: onrampSession && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "uf-flex uf-flex-col uf-items-center uf-pt-6 uf-pb-4 uf-px-2", children: [
|
|
12552
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "uf-mb-6", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
12196
12553
|
"img",
|
|
12197
12554
|
{
|
|
12198
12555
|
src: onrampSession.provider.icon_url,
|
|
@@ -12202,88 +12559,79 @@ function BuyWithCard({
|
|
|
12202
12559
|
className: "uf-rounded-2xl"
|
|
12203
12560
|
}
|
|
12204
12561
|
) }),
|
|
12205
|
-
/* @__PURE__ */ (0,
|
|
12562
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("h2", { className: "uf-text-xl uf-font-medium uf-text-foreground uf-mb-2", children: t2.onramp.completeTransaction.replace(
|
|
12206
12563
|
"{{provider}}",
|
|
12207
12564
|
onrampSession.provider.service_provider_display_name
|
|
12208
12565
|
) }),
|
|
12209
|
-
/* @__PURE__ */ (0,
|
|
12210
|
-
/* @__PURE__ */ (0,
|
|
12211
|
-
/* @__PURE__ */ (0,
|
|
12212
|
-
/* @__PURE__ */ (0,
|
|
12566
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "uf-text-sm uf-text-muted-foreground uf-mb-8", children: t2.onramp.canCloseModal }),
|
|
12567
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "uf-w-full uf-bg-secondary uf-rounded-xl uf-p-4 uf-mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "uf-flex uf-items-center uf-justify-center", children: [
|
|
12568
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "uf-flex uf-flex-col uf-items-center uf-min-w-[72px]", children: [
|
|
12569
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "uf-h-8 uf-flex uf-items-center uf-justify-center uf-mb-1.5", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
12213
12570
|
"img",
|
|
12214
12571
|
{
|
|
12215
|
-
src:
|
|
12216
|
-
`/icons/currencies/${onrampSession.sourceCurrency.toLowerCase()}.svg
|
|
12572
|
+
src: getIconUrlWithCdn(
|
|
12573
|
+
`/icons/currencies/svg/${onrampSession.sourceCurrency.toLowerCase()}.svg`,
|
|
12574
|
+
assetCdnUrl
|
|
12217
12575
|
),
|
|
12218
12576
|
alt: onrampSession.sourceCurrency.toUpperCase(),
|
|
12219
|
-
|
|
12220
|
-
height: 28,
|
|
12221
|
-
className: "uf-rounded-full"
|
|
12577
|
+
className: "uf-w-7 uf-h-7 uf-rounded-full"
|
|
12222
12578
|
}
|
|
12223
12579
|
) }),
|
|
12224
|
-
/* @__PURE__ */ (0,
|
|
12225
|
-
/* @__PURE__ */ (0,
|
|
12580
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "uf-text-[10px] uf-text-muted-foreground uf-text-center", children: t2.onramp.youUse }),
|
|
12581
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "uf-text-sm uf-font-medium uf-text-foreground uf-text-center", children: onrampSession.sourceCurrency.toUpperCase() })
|
|
12226
12582
|
] }),
|
|
12227
|
-
/* @__PURE__ */ (0,
|
|
12228
|
-
/* @__PURE__ */ (0,
|
|
12229
|
-
/* @__PURE__ */ (0,
|
|
12230
|
-
/* @__PURE__ */ (0,
|
|
12583
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "uf-text-muted-foreground uf-px-1 uf-self-start uf-pt-2", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ChevronRight, { className: "uf-w-4 uf-h-4" }) }),
|
|
12584
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "uf-flex uf-flex-col uf-items-center uf-min-w-[72px]", children: [
|
|
12585
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "uf-h-8 uf-flex uf-items-center uf-justify-center uf-mb-1.5", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "uf-relative", children: [
|
|
12586
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
12231
12587
|
"img",
|
|
12232
12588
|
{
|
|
12233
|
-
src:
|
|
12589
|
+
src: getIconUrlWithCdn("/icons/tokens/svg/usdc.svg", assetCdnUrl),
|
|
12234
12590
|
alt: "USDC",
|
|
12235
|
-
|
|
12236
|
-
height: 28,
|
|
12237
|
-
className: "uf-rounded-full"
|
|
12591
|
+
className: "uf-w-7 uf-h-7 uf-rounded-full"
|
|
12238
12592
|
}
|
|
12239
12593
|
),
|
|
12240
|
-
/* @__PURE__ */ (0,
|
|
12594
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
12241
12595
|
"img",
|
|
12242
12596
|
{
|
|
12243
|
-
src:
|
|
12597
|
+
src: getIconUrlWithCdn("/icons/networks/svg/polygon.svg", assetCdnUrl),
|
|
12244
12598
|
alt: "Polygon",
|
|
12245
|
-
|
|
12246
|
-
height: 14,
|
|
12247
|
-
className: "uf-absolute uf--bottom-0.5 uf--right-0.5 uf-rounded-full"
|
|
12599
|
+
className: "uf-w-3.5 uf-h-3.5 uf-absolute -uf-bottom-0.5 -uf-right-0.5 uf-rounded-full"
|
|
12248
12600
|
}
|
|
12249
12601
|
)
|
|
12250
12602
|
] }) }),
|
|
12251
|
-
/* @__PURE__ */ (0,
|
|
12252
|
-
/* @__PURE__ */ (0,
|
|
12603
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "uf-text-[10px] uf-text-muted-foreground uf-text-center", children: t2.onramp.youBuy }),
|
|
12604
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "uf-text-sm uf-font-medium uf-text-foreground uf-text-center", children: "USDC" })
|
|
12253
12605
|
] }),
|
|
12254
|
-
/* @__PURE__ */ (0,
|
|
12255
|
-
/* @__PURE__ */ (0,
|
|
12256
|
-
/* @__PURE__ */ (0,
|
|
12257
|
-
/* @__PURE__ */ (0,
|
|
12606
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "uf-text-muted-foreground uf-px-1 uf-self-start uf-pt-2", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ChevronRight, { className: "uf-w-4 uf-h-4" }) }),
|
|
12607
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "uf-flex uf-flex-col uf-items-center uf-min-w-[72px]", children: [
|
|
12608
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "uf-h-8 uf-flex uf-items-center uf-justify-center uf-mb-1.5", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "uf-relative", children: [
|
|
12609
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
12258
12610
|
"img",
|
|
12259
12611
|
{
|
|
12260
|
-
src: destinationToken?.icon_url ||
|
|
12612
|
+
src: destinationToken?.icon_url || getIconUrlWithCdn("/icons/tokens/svg/usdc.svg", assetCdnUrl),
|
|
12261
12613
|
alt: displayTokenSymbol,
|
|
12262
|
-
|
|
12263
|
-
height: 28,
|
|
12264
|
-
className: "uf-rounded-full"
|
|
12614
|
+
className: "uf-w-7 uf-h-7 uf-rounded-full"
|
|
12265
12615
|
}
|
|
12266
12616
|
),
|
|
12267
|
-
destinationChain?.icon_url && /* @__PURE__ */ (0,
|
|
12617
|
+
destinationChain?.icon_url && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
12268
12618
|
"img",
|
|
12269
12619
|
{
|
|
12270
12620
|
src: destinationChain.icon_url,
|
|
12271
12621
|
alt: destinationChain.chain_name,
|
|
12272
|
-
|
|
12273
|
-
height: 14,
|
|
12274
|
-
className: "uf-absolute uf--bottom-0.5 uf--right-0.5 uf-rounded-full"
|
|
12622
|
+
className: "uf-w-3.5 uf-h-3.5 uf-absolute -uf-bottom-0.5 -uf-right-0.5 uf-rounded-full"
|
|
12275
12623
|
}
|
|
12276
12624
|
)
|
|
12277
12625
|
] }) }),
|
|
12278
|
-
/* @__PURE__ */ (0,
|
|
12279
|
-
/* @__PURE__ */ (0,
|
|
12626
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "uf-text-[10px] uf-text-muted-foreground uf-text-center", children: t2.onramp.youReceive }),
|
|
12627
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "uf-text-sm uf-font-medium uf-text-foreground uf-text-center", children: displayTokenSymbol })
|
|
12280
12628
|
] })
|
|
12281
12629
|
] }) }),
|
|
12282
|
-
/* @__PURE__ */ (0,
|
|
12630
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "uf-w-full uf-bg-secondary uf-rounded-xl uf-p-4", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "uf-text-xs uf-text-muted-foreground uf-leading-relaxed", children: t2.onramp.intentAddressNote }) })
|
|
12283
12631
|
] })
|
|
12284
12632
|
}
|
|
12285
12633
|
),
|
|
12286
|
-
/* @__PURE__ */ (0,
|
|
12634
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
12287
12635
|
CurrencyModal,
|
|
12288
12636
|
{
|
|
12289
12637
|
open: showCurrencyModal,
|
|
@@ -12302,105 +12650,39 @@ function BuyWithCard({
|
|
|
12302
12650
|
function TransferCryptoButton({
|
|
12303
12651
|
onClick,
|
|
12304
12652
|
title,
|
|
12305
|
-
subtitle
|
|
12653
|
+
subtitle,
|
|
12654
|
+
featuredTokens
|
|
12306
12655
|
}) {
|
|
12307
|
-
|
|
12656
|
+
const sortedTokens = featuredTokens ? [...featuredTokens].sort((a, b) => a.position - b.position) : [];
|
|
12657
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
12308
12658
|
"button",
|
|
12309
12659
|
{
|
|
12310
12660
|
onClick,
|
|
12311
12661
|
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",
|
|
12312
12662
|
children: [
|
|
12313
|
-
/* @__PURE__ */ (0,
|
|
12314
|
-
/* @__PURE__ */ (0,
|
|
12315
|
-
/* @__PURE__ */ (0,
|
|
12316
|
-
/* @__PURE__ */ (0,
|
|
12317
|
-
/* @__PURE__ */ (0,
|
|
12663
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
12664
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "uf-bg-muted uf-rounded-lg uf-p-2", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Zap, { className: "uf-w-5 uf-h-5" }) }),
|
|
12665
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "uf-text-left", children: [
|
|
12666
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "uf-text-sm uf-font-light uf-mb-0.5 uf-text-foreground", children: title }),
|
|
12667
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "uf-text-muted-foreground uf-text-xs uf-font-light", children: subtitle })
|
|
12318
12668
|
] })
|
|
12319
12669
|
] }),
|
|
12320
|
-
/* @__PURE__ */ (0,
|
|
12321
|
-
/* @__PURE__ */ (0,
|
|
12322
|
-
|
|
12323
|
-
|
|
12324
|
-
{
|
|
12325
|
-
src: getIconUrl("/icons/networks/ethereum.svg"),
|
|
12326
|
-
alt: "ETH",
|
|
12327
|
-
width: 20,
|
|
12328
|
-
height: 20,
|
|
12329
|
-
className: "uf-rounded-full uf-border-2 uf-border-secondary"
|
|
12330
|
-
}
|
|
12331
|
-
),
|
|
12332
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
12333
|
-
"img",
|
|
12334
|
-
{
|
|
12335
|
-
src: getIconUrl("/icons/networks/optimism.svg"),
|
|
12336
|
-
alt: "OP",
|
|
12337
|
-
width: 20,
|
|
12338
|
-
height: 20,
|
|
12339
|
-
className: "uf-rounded-full uf-border-2 uf-border-secondary"
|
|
12340
|
-
}
|
|
12341
|
-
),
|
|
12342
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
12343
|
-
"img",
|
|
12344
|
-
{
|
|
12345
|
-
src: getIconUrl("/icons/networks/polygon.svg"),
|
|
12346
|
-
alt: "MATIC",
|
|
12347
|
-
width: 20,
|
|
12348
|
-
height: 20,
|
|
12349
|
-
className: "uf-rounded-full uf-border-2 uf-border-secondary"
|
|
12350
|
-
}
|
|
12351
|
-
),
|
|
12352
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
12353
|
-
"img",
|
|
12354
|
-
{
|
|
12355
|
-
src: getIconUrl("/icons/networks/arbitrum.svg"),
|
|
12356
|
-
alt: "ARB",
|
|
12357
|
-
width: 20,
|
|
12358
|
-
height: 20,
|
|
12359
|
-
className: "uf-rounded-full uf-border-2 uf-border-secondary"
|
|
12360
|
-
}
|
|
12361
|
-
),
|
|
12362
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
12363
|
-
"img",
|
|
12364
|
-
{
|
|
12365
|
-
src: getIconUrl("/icons/tokens/usdc.svg"),
|
|
12366
|
-
alt: "USDC",
|
|
12367
|
-
width: 20,
|
|
12368
|
-
height: 20,
|
|
12369
|
-
className: "uf-rounded-full uf-border-2 uf-border-secondary"
|
|
12370
|
-
}
|
|
12371
|
-
),
|
|
12372
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
12373
|
-
"img",
|
|
12374
|
-
{
|
|
12375
|
-
src: getIconUrl("/icons/networks/solana.svg"),
|
|
12376
|
-
alt: "SOL",
|
|
12377
|
-
width: 20,
|
|
12378
|
-
height: 20,
|
|
12379
|
-
className: "uf-rounded-full uf-border-2 uf-border-secondary"
|
|
12380
|
-
}
|
|
12381
|
-
),
|
|
12382
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
12383
|
-
"img",
|
|
12384
|
-
{
|
|
12385
|
-
src: getIconUrl("/icons/tokens/avax.svg"),
|
|
12386
|
-
alt: "AVAX",
|
|
12387
|
-
width: 20,
|
|
12388
|
-
height: 20,
|
|
12389
|
-
className: "uf-rounded-full uf-border-2 uf-border-secondary"
|
|
12390
|
-
}
|
|
12391
|
-
),
|
|
12392
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
12670
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
12671
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "uf-flex uf--space-x-2", children: sortedTokens.map((token) => {
|
|
12672
|
+
const iconUrl = token.icon_urls.find((u) => u.format === "svg")?.url || token.icon_urls.find((u) => u.format === "png")?.url;
|
|
12673
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
12393
12674
|
"img",
|
|
12394
12675
|
{
|
|
12395
|
-
src:
|
|
12396
|
-
alt:
|
|
12676
|
+
src: iconUrl,
|
|
12677
|
+
alt: token.name,
|
|
12397
12678
|
width: 20,
|
|
12398
12679
|
height: 20,
|
|
12399
12680
|
className: "uf-rounded-full uf-border-2 uf-border-secondary"
|
|
12400
|
-
}
|
|
12401
|
-
|
|
12402
|
-
|
|
12403
|
-
|
|
12681
|
+
},
|
|
12682
|
+
token.name
|
|
12683
|
+
);
|
|
12684
|
+
}) }),
|
|
12685
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ChevronRight, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground group-hover:uf-text-foreground uf-transition-colors" })
|
|
12404
12686
|
] })
|
|
12405
12687
|
]
|
|
12406
12688
|
}
|
|
@@ -12409,45 +12691,38 @@ function TransferCryptoButton({
|
|
|
12409
12691
|
function DepositWithCardButton({
|
|
12410
12692
|
onClick,
|
|
12411
12693
|
title,
|
|
12412
|
-
subtitle
|
|
12694
|
+
subtitle,
|
|
12695
|
+
paymentNetworks
|
|
12413
12696
|
}) {
|
|
12414
|
-
return /* @__PURE__ */ (0,
|
|
12697
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
12415
12698
|
"button",
|
|
12416
12699
|
{
|
|
12417
12700
|
onClick,
|
|
12418
12701
|
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",
|
|
12419
12702
|
children: [
|
|
12420
|
-
/* @__PURE__ */ (0,
|
|
12421
|
-
/* @__PURE__ */ (0,
|
|
12422
|
-
/* @__PURE__ */ (0,
|
|
12423
|
-
/* @__PURE__ */ (0,
|
|
12424
|
-
/* @__PURE__ */ (0,
|
|
12703
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
12704
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "uf-bg-muted uf-rounded-lg uf-p-2", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CreditCard, { className: "uf-w-5 uf-h-5" }) }),
|
|
12705
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "uf-text-left", children: [
|
|
12706
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "uf-text-sm uf-font-light uf-mb-0.5 uf-text-foreground", children: title }),
|
|
12707
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "uf-text-muted-foreground uf-text-xs uf-font-light", children: subtitle })
|
|
12425
12708
|
] })
|
|
12426
12709
|
] }),
|
|
12427
|
-
/* @__PURE__ */ (0,
|
|
12428
|
-
/* @__PURE__ */ (0,
|
|
12429
|
-
|
|
12710
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
12711
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "uf-flex uf-items-center uf-gap-1.5", children: paymentNetworks?.map((network) => {
|
|
12712
|
+
const iconUrl = network.icon_urls.find((u) => u.format === "svg")?.url || network.icon_urls.find((u) => u.format === "png")?.url;
|
|
12713
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
12430
12714
|
"img",
|
|
12431
12715
|
{
|
|
12432
|
-
src:
|
|
12433
|
-
alt:
|
|
12716
|
+
src: iconUrl,
|
|
12717
|
+
alt: network.name,
|
|
12434
12718
|
width: 32,
|
|
12435
12719
|
height: 32,
|
|
12436
12720
|
className: "uf-rounded"
|
|
12437
|
-
}
|
|
12438
|
-
|
|
12439
|
-
|
|
12440
|
-
|
|
12441
|
-
|
|
12442
|
-
src: getIconUrl("/icons/networks/visa.svg"),
|
|
12443
|
-
alt: "Visa",
|
|
12444
|
-
width: 32,
|
|
12445
|
-
height: 32,
|
|
12446
|
-
className: "uf-rounded"
|
|
12447
|
-
}
|
|
12448
|
-
)
|
|
12449
|
-
] }),
|
|
12450
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ChevronRight, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground group-hover:uf-text-foreground uf-transition-colors" })
|
|
12721
|
+
},
|
|
12722
|
+
network.name
|
|
12723
|
+
);
|
|
12724
|
+
}) }),
|
|
12725
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ChevronRight, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground group-hover:uf-text-foreground uf-transition-colors" })
|
|
12451
12726
|
] })
|
|
12452
12727
|
]
|
|
12453
12728
|
}
|
|
@@ -12459,27 +12734,42 @@ function DepositTrackerButton({
|
|
|
12459
12734
|
subtitle,
|
|
12460
12735
|
badge
|
|
12461
12736
|
}) {
|
|
12462
|
-
return /* @__PURE__ */ (0,
|
|
12737
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
12463
12738
|
"button",
|
|
12464
12739
|
{
|
|
12465
12740
|
onClick,
|
|
12466
12741
|
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",
|
|
12467
12742
|
children: [
|
|
12468
|
-
/* @__PURE__ */ (0,
|
|
12469
|
-
/* @__PURE__ */ (0,
|
|
12470
|
-
/* @__PURE__ */ (0,
|
|
12471
|
-
badge !== void 0 && badge > 0 && /* @__PURE__ */ (0,
|
|
12743
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
12744
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "uf-bg-muted uf-rounded-lg uf-p-2 uf-relative", children: [
|
|
12745
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Clock, { className: "uf-w-5 uf-h-5" }),
|
|
12746
|
+
badge !== void 0 && badge > 0 && /* @__PURE__ */ (0, import_jsx_runtime37.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 })
|
|
12472
12747
|
] }),
|
|
12473
|
-
/* @__PURE__ */ (0,
|
|
12474
|
-
/* @__PURE__ */ (0,
|
|
12475
|
-
/* @__PURE__ */ (0,
|
|
12748
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "uf-text-left", children: [
|
|
12749
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "uf-text-sm uf-font-light uf-mb-0.5 uf-text-foreground", children: title }),
|
|
12750
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "uf-text-muted-foreground uf-text-xs uf-font-light", children: subtitle })
|
|
12476
12751
|
] })
|
|
12477
12752
|
] }),
|
|
12478
|
-
/* @__PURE__ */ (0,
|
|
12753
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ChevronRight, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground group-hover:uf-text-foreground uf-transition-colors" })
|
|
12479
12754
|
]
|
|
12480
12755
|
}
|
|
12481
12756
|
);
|
|
12482
12757
|
}
|
|
12758
|
+
function SkeletonButton({ variant = "default" }) {
|
|
12759
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.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: [
|
|
12760
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
12761
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "uf-bg-muted uf-rounded-lg uf-w-9 uf-h-9" }),
|
|
12762
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "uf-space-y-1.5", children: [
|
|
12763
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "uf-h-3.5 uf-w-24 uf-bg-muted uf-rounded" }),
|
|
12764
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "uf-h-3 uf-w-32 uf-bg-muted uf-rounded" })
|
|
12765
|
+
] })
|
|
12766
|
+
] }),
|
|
12767
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
12768
|
+
variant === "with-icons" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "uf-flex uf--space-x-1", children: [1, 2, 3].map((i) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "uf-w-5 uf-h-5 uf-rounded-full uf-bg-muted uf-border-2 uf-border-secondary" }, i)) }),
|
|
12769
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ChevronRight, { className: "uf-w-4 uf-h-4 uf-text-muted" })
|
|
12770
|
+
] })
|
|
12771
|
+
] });
|
|
12772
|
+
}
|
|
12483
12773
|
var t3 = i18n.depositModal;
|
|
12484
12774
|
function DepositModal({
|
|
12485
12775
|
open,
|
|
@@ -12504,6 +12794,15 @@ function DepositModal({
|
|
|
12504
12794
|
const [quotesCount, setQuotesCount] = (0, import_react7.useState)(0);
|
|
12505
12795
|
const [depositsModalOpen, setDepositsModalOpen] = (0, import_react7.useState)(false);
|
|
12506
12796
|
const [depositExecutions, setDepositExecutions] = (0, import_react7.useState)([]);
|
|
12797
|
+
const [projectConfig, setProjectConfig] = (0, import_react7.useState)(null);
|
|
12798
|
+
const [wallets, setWallets] = (0, import_react7.useState)([]);
|
|
12799
|
+
const [walletsLoading, setWalletsLoading] = (0, import_react7.useState)(false);
|
|
12800
|
+
(0, import_react7.useEffect)(() => {
|
|
12801
|
+
setProjectConfig(null);
|
|
12802
|
+
}, [publishableKey]);
|
|
12803
|
+
(0, import_react7.useEffect)(() => {
|
|
12804
|
+
setWallets([]);
|
|
12805
|
+
}, [userId, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, publishableKey]);
|
|
12507
12806
|
const [resolvedTheme, setResolvedTheme] = (0, import_react7.useState)(theme === "auto" ? "dark" : theme);
|
|
12508
12807
|
(0, import_react7.useEffect)(() => {
|
|
12509
12808
|
if (theme === "auto") {
|
|
@@ -12518,6 +12817,49 @@ function DepositModal({
|
|
|
12518
12817
|
setResolvedTheme(theme);
|
|
12519
12818
|
}
|
|
12520
12819
|
}, [theme]);
|
|
12820
|
+
(0, import_react7.useEffect)(() => {
|
|
12821
|
+
if (open && !projectConfig) {
|
|
12822
|
+
getProjectConfig(publishableKey).then(setProjectConfig).catch(console.error);
|
|
12823
|
+
}
|
|
12824
|
+
}, [open, publishableKey, projectConfig]);
|
|
12825
|
+
(0, import_react7.useEffect)(() => {
|
|
12826
|
+
if (!open || wallets.length > 0) return;
|
|
12827
|
+
let retryTimeout = null;
|
|
12828
|
+
let isCancelled = false;
|
|
12829
|
+
const fetchWallets = async () => {
|
|
12830
|
+
if (isCancelled) return;
|
|
12831
|
+
setWalletsLoading(true);
|
|
12832
|
+
try {
|
|
12833
|
+
const response = await createEOA(
|
|
12834
|
+
{
|
|
12835
|
+
user_id: userId,
|
|
12836
|
+
recipient_address: recipientAddress,
|
|
12837
|
+
destination_chain_type: destinationChainType,
|
|
12838
|
+
destination_chain_id: destinationChainId,
|
|
12839
|
+
destination_token_address: destinationTokenAddress
|
|
12840
|
+
},
|
|
12841
|
+
publishableKey
|
|
12842
|
+
);
|
|
12843
|
+
if (!isCancelled) {
|
|
12844
|
+
setWallets(response.data);
|
|
12845
|
+
setWalletsLoading(false);
|
|
12846
|
+
}
|
|
12847
|
+
} catch (error) {
|
|
12848
|
+
console.error("Error fetching wallets, retrying in 5s:", error);
|
|
12849
|
+
if (!isCancelled) {
|
|
12850
|
+
setWalletsLoading(false);
|
|
12851
|
+
retryTimeout = setTimeout(fetchWallets, 5e3);
|
|
12852
|
+
}
|
|
12853
|
+
}
|
|
12854
|
+
};
|
|
12855
|
+
fetchWallets();
|
|
12856
|
+
return () => {
|
|
12857
|
+
isCancelled = true;
|
|
12858
|
+
if (retryTimeout) {
|
|
12859
|
+
clearTimeout(retryTimeout);
|
|
12860
|
+
}
|
|
12861
|
+
};
|
|
12862
|
+
}, [open, userId, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, publishableKey, wallets.length]);
|
|
12521
12863
|
const themeClass = resolvedTheme === "dark" ? "uf-dark" : "";
|
|
12522
12864
|
const handleClose = () => {
|
|
12523
12865
|
onOpenChange(false);
|
|
@@ -12542,39 +12884,45 @@ function DepositModal({
|
|
|
12542
12884
|
setQuotesCount(count3);
|
|
12543
12885
|
}
|
|
12544
12886
|
};
|
|
12545
|
-
return /* @__PURE__ */ (0,
|
|
12546
|
-
/* @__PURE__ */ (0,
|
|
12887
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ThemeProvider, { themeClass, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Dialog2, { open, onOpenChange: handleClose, children: [
|
|
12888
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
12547
12889
|
DialogContent2,
|
|
12548
12890
|
{
|
|
12549
12891
|
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}`,
|
|
12550
12892
|
onPointerDownOutside: (e) => e.preventDefault(),
|
|
12551
12893
|
onInteractOutside: (e) => e.preventDefault(),
|
|
12552
|
-
children: view === "main" ? /* @__PURE__ */ (0,
|
|
12553
|
-
/* @__PURE__ */ (0,
|
|
12894
|
+
children: view === "main" ? /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
12895
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
12554
12896
|
DepositHeader,
|
|
12555
12897
|
{
|
|
12556
12898
|
title: modalTitle || "Deposit",
|
|
12557
12899
|
onClose: handleClose
|
|
12558
12900
|
}
|
|
12559
12901
|
),
|
|
12560
|
-
/* @__PURE__ */ (0,
|
|
12561
|
-
/* @__PURE__ */ (0,
|
|
12902
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "uf-pb-4 uf-space-y-3", children: !projectConfig ? /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
12903
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SkeletonButton, { variant: "with-icons" }),
|
|
12904
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SkeletonButton, { variant: "with-icons" }),
|
|
12905
|
+
!hideDepositTracker && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SkeletonButton, {})
|
|
12906
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
12907
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
12562
12908
|
TransferCryptoButton,
|
|
12563
12909
|
{
|
|
12564
12910
|
onClick: () => setView("transfer"),
|
|
12565
12911
|
title: t3.transferCrypto.title,
|
|
12566
|
-
subtitle: t3.transferCrypto.subtitle
|
|
12912
|
+
subtitle: t3.transferCrypto.subtitle,
|
|
12913
|
+
featuredTokens: projectConfig.transfer_crypto.networks
|
|
12567
12914
|
}
|
|
12568
12915
|
),
|
|
12569
|
-
/* @__PURE__ */ (0,
|
|
12916
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
12570
12917
|
DepositWithCardButton,
|
|
12571
12918
|
{
|
|
12572
12919
|
onClick: () => setView("card"),
|
|
12573
12920
|
title: t3.depositWithCard.title,
|
|
12574
|
-
subtitle: t3.depositWithCard.subtitle
|
|
12921
|
+
subtitle: t3.depositWithCard.subtitle,
|
|
12922
|
+
paymentNetworks: projectConfig.payment_networks.networks
|
|
12575
12923
|
}
|
|
12576
12924
|
),
|
|
12577
|
-
!hideDepositTracker && /* @__PURE__ */ (0,
|
|
12925
|
+
!hideDepositTracker && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
12578
12926
|
DepositTrackerButton,
|
|
12579
12927
|
{
|
|
12580
12928
|
onClick: () => setDepositsModalOpen(true),
|
|
@@ -12583,9 +12931,9 @@ function DepositModal({
|
|
|
12583
12931
|
badge: depositExecutions.length > 0 ? depositExecutions.length : void 0
|
|
12584
12932
|
}
|
|
12585
12933
|
)
|
|
12586
|
-
] })
|
|
12587
|
-
] }) : view === "transfer" ? /* @__PURE__ */ (0,
|
|
12588
|
-
/* @__PURE__ */ (0,
|
|
12934
|
+
] }) })
|
|
12935
|
+
] }) : view === "transfer" ? /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
12936
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
12589
12937
|
DepositHeader,
|
|
12590
12938
|
{
|
|
12591
12939
|
title: t3.transferCrypto.title,
|
|
@@ -12594,7 +12942,7 @@ function DepositModal({
|
|
|
12594
12942
|
onClose: handleClose
|
|
12595
12943
|
}
|
|
12596
12944
|
),
|
|
12597
|
-
/* @__PURE__ */ (0,
|
|
12945
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
12598
12946
|
TransferCrypto,
|
|
12599
12947
|
{
|
|
12600
12948
|
userId,
|
|
@@ -12605,11 +12953,12 @@ function DepositModal({
|
|
|
12605
12953
|
destinationTokenAddress,
|
|
12606
12954
|
onExecutionsChange: setDepositExecutions,
|
|
12607
12955
|
onDepositSuccess,
|
|
12608
|
-
onDepositError
|
|
12956
|
+
onDepositError,
|
|
12957
|
+
wallets
|
|
12609
12958
|
}
|
|
12610
12959
|
)
|
|
12611
|
-
] }) : /* @__PURE__ */ (0,
|
|
12612
|
-
/* @__PURE__ */ (0,
|
|
12960
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
12961
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
12613
12962
|
DepositHeader,
|
|
12614
12963
|
{
|
|
12615
12964
|
title: cardView === "quotes" ? t3.quotes : modalTitle || "Deposit",
|
|
@@ -12619,7 +12968,7 @@ function DepositModal({
|
|
|
12619
12968
|
badge: cardView === "quotes" ? { count: quotesCount } : void 0
|
|
12620
12969
|
}
|
|
12621
12970
|
),
|
|
12622
|
-
/* @__PURE__ */ (0,
|
|
12971
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
12623
12972
|
BuyWithCard,
|
|
12624
12973
|
{
|
|
12625
12974
|
userId,
|
|
@@ -12633,13 +12982,15 @@ function DepositModal({
|
|
|
12633
12982
|
destinationTokenAddress,
|
|
12634
12983
|
onDepositSuccess,
|
|
12635
12984
|
onDepositError,
|
|
12636
|
-
themeClass
|
|
12985
|
+
themeClass,
|
|
12986
|
+
wallets,
|
|
12987
|
+
assetCdnUrl: projectConfig?.asset_cdn_url
|
|
12637
12988
|
}
|
|
12638
12989
|
)
|
|
12639
12990
|
] })
|
|
12640
12991
|
}
|
|
12641
12992
|
),
|
|
12642
|
-
/* @__PURE__ */ (0,
|
|
12993
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
12643
12994
|
DepositsModal,
|
|
12644
12995
|
{
|
|
12645
12996
|
open: depositsModalOpen,
|
|
@@ -12654,7 +13005,7 @@ function DepositModal({
|
|
|
12654
13005
|
}
|
|
12655
13006
|
|
|
12656
13007
|
// src/provider.tsx
|
|
12657
|
-
var
|
|
13008
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
12658
13009
|
function UnifoldProvider2({
|
|
12659
13010
|
children,
|
|
12660
13011
|
publishableKey,
|
|
@@ -12746,9 +13097,9 @@ function UnifoldProvider2({
|
|
|
12746
13097
|
}),
|
|
12747
13098
|
[beginDeposit, closeDeposit, handleDepositSuccess, handleDepositError]
|
|
12748
13099
|
);
|
|
12749
|
-
return /* @__PURE__ */ (0,
|
|
13100
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(UnifoldProvider, { publishableKey, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(ConnectContext.Provider, { value: contextValue, children: [
|
|
12750
13101
|
children,
|
|
12751
|
-
depositConfig && /* @__PURE__ */ (0,
|
|
13102
|
+
depositConfig && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
12752
13103
|
DepositModal,
|
|
12753
13104
|
{
|
|
12754
13105
|
open: isOpen,
|
|
@@ -12800,7 +13151,9 @@ function useUnifold2() {
|
|
|
12800
13151
|
|
|
12801
13152
|
lucide-react/dist/esm/defaultAttributes.js:
|
|
12802
13153
|
lucide-react/dist/esm/createLucideIcon.js:
|
|
13154
|
+
lucide-react/dist/esm/icons/arrow-down-circle.js:
|
|
12803
13155
|
lucide-react/dist/esm/icons/arrow-left.js:
|
|
13156
|
+
lucide-react/dist/esm/icons/check-circle.js:
|
|
12804
13157
|
lucide-react/dist/esm/icons/check.js:
|
|
12805
13158
|
lucide-react/dist/esm/icons/chevron-down.js:
|
|
12806
13159
|
lucide-react/dist/esm/icons/chevron-right.js:
|