@unifold/connect-react 0.1.5 → 0.1.7

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 CHANGED
@@ -1226,6 +1226,145 @@ 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-left.js
1273
+ var ArrowLeft = createLucideIcon("ArrowLeft", [
1274
+ ["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
1275
+ ["path", { d: "M19 12H5", key: "x3x0zl" }]
1276
+ ]);
1277
+
1278
+ // ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/check.js
1279
+ var Check = createLucideIcon("Check", [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]]);
1280
+
1281
+ // ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/chevron-down.js
1282
+ var ChevronDown = createLucideIcon("ChevronDown", [
1283
+ ["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]
1284
+ ]);
1285
+
1286
+ // ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/chevron-right.js
1287
+ var ChevronRight = createLucideIcon("ChevronRight", [
1288
+ ["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]
1289
+ ]);
1290
+
1291
+ // ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/chevron-up.js
1292
+ var ChevronUp = createLucideIcon("ChevronUp", [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]]);
1293
+
1294
+ // ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/clock.js
1295
+ var Clock = createLucideIcon("Clock", [
1296
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
1297
+ ["polyline", { points: "12 6 12 12 16 14", key: "68esgv" }]
1298
+ ]);
1299
+
1300
+ // ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/copy.js
1301
+ var Copy = createLucideIcon("Copy", [
1302
+ ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
1303
+ ["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" }]
1304
+ ]);
1305
+
1306
+ // ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/credit-card.js
1307
+ var CreditCard = createLucideIcon("CreditCard", [
1308
+ ["rect", { width: "20", height: "14", x: "2", y: "5", rx: "2", key: "ynyp8z" }],
1309
+ ["line", { x1: "2", x2: "22", y1: "10", y2: "10", key: "1b3vmo" }]
1310
+ ]);
1311
+
1312
+ // ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/dollar-sign.js
1313
+ var DollarSign = createLucideIcon("DollarSign", [
1314
+ ["line", { x1: "12", x2: "12", y1: "2", y2: "22", key: "7eqyqh" }],
1315
+ ["path", { d: "M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6", key: "1b0p4s" }]
1316
+ ]);
1317
+
1318
+ // ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/external-link.js
1319
+ var ExternalLink = createLucideIcon("ExternalLink", [
1320
+ ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }],
1321
+ ["polyline", { points: "15 3 21 3 21 9", key: "mznyad" }],
1322
+ ["line", { x1: "10", x2: "21", y1: "14", y2: "3", key: "18c3s4" }]
1323
+ ]);
1324
+
1325
+ // ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/file-text.js
1326
+ var FileText = createLucideIcon("FileText", [
1327
+ [
1328
+ "path",
1329
+ { 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" }
1330
+ ],
1331
+ ["polyline", { points: "14 2 14 8 20 8", key: "1ew0cm" }],
1332
+ ["line", { x1: "16", x2: "8", y1: "13", y2: "13", key: "14keom" }],
1333
+ ["line", { x1: "16", x2: "8", y1: "17", y2: "17", key: "17nazh" }],
1334
+ ["line", { x1: "10", x2: "8", y1: "9", y2: "9", key: "1a5vjj" }]
1335
+ ]);
1336
+
1337
+ // ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/info.js
1338
+ var Info = createLucideIcon("Info", [
1339
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
1340
+ ["path", { d: "M12 16v-4", key: "1dtifu" }],
1341
+ ["path", { d: "M12 8h.01", key: "e9boi3" }]
1342
+ ]);
1343
+
1344
+ // ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/search.js
1345
+ var Search = createLucideIcon("Search", [
1346
+ ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
1347
+ ["path", { d: "m21 21-4.3-4.3", key: "1qie3q" }]
1348
+ ]);
1349
+
1350
+ // ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/shield-check.js
1351
+ var ShieldCheck = createLucideIcon("ShieldCheck", [
1352
+ ["path", { d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10", key: "1irkt0" }],
1353
+ ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
1354
+ ]);
1355
+
1356
+ // ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/x.js
1357
+ var X = createLucideIcon("X", [
1358
+ ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
1359
+ ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
1360
+ ]);
1361
+
1362
+ // ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/zap.js
1363
+ var Zap = createLucideIcon("Zap", [
1364
+ ["polygon", { points: "13 2 3 14 12 14 11 22 21 10 12 10 13 2", key: "45s27k" }]
1365
+ ]);
1366
+
1367
+ // ../ui-react/dist/index.mjs
1229
1368
  var React210 = __toESM(require("react"), 1);
1230
1369
 
1231
1370
  // ../../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 +2379,9 @@ function assignRef(ref, value) {
2240
2379
  }
2241
2380
 
2242
2381
  // ../../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 import_react2 = require("react");
2382
+ var import_react3 = require("react");
2244
2383
  function useCallbackRef2(initialValue, callback) {
2245
- var ref = (0, import_react2.useState)(function() {
2384
+ var ref = (0, import_react3.useState)(function() {
2246
2385
  return {
2247
2386
  // value
2248
2387
  value: initialValue,
@@ -3330,143 +3469,6 @@ var Title = DialogTitle;
3330
3469
  var Description = DialogDescription;
3331
3470
  var Close = DialogClose;
3332
3471
 
3333
- // ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
3334
- var import_react3 = require("react");
3335
-
3336
- // ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/defaultAttributes.js
3337
- var defaultAttributes = {
3338
- xmlns: "http://www.w3.org/2000/svg",
3339
- width: 24,
3340
- height: 24,
3341
- viewBox: "0 0 24 24",
3342
- fill: "none",
3343
- stroke: "currentColor",
3344
- strokeWidth: 2,
3345
- strokeLinecap: "round",
3346
- strokeLinejoin: "round"
3347
- };
3348
-
3349
- // ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
3350
- var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase().trim();
3351
- var createLucideIcon = (iconName, iconNode) => {
3352
- const Component = (0, import_react3.forwardRef)(
3353
- ({ color = "currentColor", size: size4 = 24, strokeWidth = 2, absoluteStrokeWidth, className = "", children, ...rest }, ref) => (0, import_react3.createElement)(
3354
- "svg",
3355
- {
3356
- ref,
3357
- ...defaultAttributes,
3358
- width: size4,
3359
- height: size4,
3360
- stroke: color,
3361
- strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size4) : strokeWidth,
3362
- className: ["lucide", `lucide-${toKebabCase(iconName)}`, className].join(" "),
3363
- ...rest
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
3472
  // ../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
3471
3473
  function r(e) {
3472
3474
  var t4, f, n = "";
@@ -10316,7 +10318,7 @@ function DepositHeader({
10316
10318
  badge ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
10317
10319
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DialogTitle2, { className: "uf-text-center uf-text-base uf-text-foreground", children: title }),
10318
10320
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "uf-bg-secondary uf-px-2 uf-py-0.5 uf-rounded-full uf-text-[10px] uf-text-muted-foreground", children: badge.count })
10319
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DialogTitle2, { className: "uf-text-center uf-text-base x uf-text-foreground", children: title }),
10321
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DialogTitle2, { className: "uf-text-center uf-text-base uf-text-foreground", children: title }),
10320
10322
  showClose ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
10321
10323
  "button",
10322
10324
  {
@@ -10459,6 +10461,20 @@ async function getFiatCurrencies(publishableKey) {
10459
10461
  }
10460
10462
  return response.json();
10461
10463
  }
10464
+ async function getProjectConfig(publishableKey) {
10465
+ const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
10466
+ const response = await fetch(`${API_BASE_URL}/v1/public/projects/config`, {
10467
+ method: "GET",
10468
+ headers: {
10469
+ accept: "application/json",
10470
+ "x-publishable-key": pk
10471
+ }
10472
+ });
10473
+ if (!response.ok) {
10474
+ throw new Error(`Failed to fetch project config: ${response.statusText}`);
10475
+ }
10476
+ return response.json();
10477
+ }
10462
10478
  function DepositExecutionItem({
10463
10479
  execution,
10464
10480
  showCloseButton = false,
@@ -10558,7 +10574,7 @@ function DepositExecutionItem({
10558
10574
  }
10559
10575
  )
10560
10576
  ] }),
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: [
10577
+ !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
10578
  /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "uf-text-muted-foreground", children: "Completion tx:" }),
10563
10579
  /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
10564
10580
  "a",
@@ -10899,15 +10915,17 @@ function TransferCryptoBase({
10899
10915
  showDetailedDropdowns = false,
10900
10916
  onExecutionsChange,
10901
10917
  onDepositSuccess,
10902
- onDepositError
10918
+ onDepositError,
10919
+ wallets: externalWallets
10903
10920
  }) {
10904
10921
  const { themeClass } = useTheme();
10905
10922
  const isDarkMode = themeClass.includes("uf-dark");
10906
10923
  const [token, setToken] = (0, import_react8.useState)("USDC");
10907
10924
  const [chain, setChain] = (0, import_react8.useState)("solana:mainnet");
10908
10925
  const [copied, setCopied] = (0, import_react8.useState)(false);
10909
- const [wallets, setWallets] = (0, import_react8.useState)([]);
10910
- const [loading, setLoading] = (0, import_react8.useState)(true);
10926
+ const [internalWallets, setInternalWallets] = (0, import_react8.useState)([]);
10927
+ const [loading, setLoading] = (0, import_react8.useState)(!externalWallets?.length);
10928
+ const wallets = externalWallets?.length ? externalWallets : internalWallets;
10911
10929
  const [error, setError] = (0, import_react8.useState)(null);
10912
10930
  const [depositExecutions, setDepositExecutions] = (0, import_react8.useState)([]);
10913
10931
  const [trackedExecutions, setTrackedExecutions] = (0, import_react8.useState)(/* @__PURE__ */ new Map());
@@ -10971,9 +10989,16 @@ function TransferCryptoBase({
10971
10989
  }
10972
10990
  }, [depositExecutions, onExecutionsChange]);
10973
10991
  (0, import_react8.useEffect)(() => {
10974
- async function fetchWallets() {
10992
+ if (externalWallets?.length) {
10993
+ setLoading(false);
10994
+ return;
10995
+ }
10996
+ let retryTimeout = null;
10997
+ let isCancelled = false;
10998
+ const fetchWallets = async () => {
10999
+ if (isCancelled) return;
11000
+ setLoading(true);
10975
11001
  try {
10976
- setLoading(true);
10977
11002
  const response = await createEOA(
10978
11003
  {
10979
11004
  user_id: userId,
@@ -10984,23 +11009,35 @@ function TransferCryptoBase({
10984
11009
  },
10985
11010
  publishableKey
10986
11011
  );
10987
- setWallets(response.data);
10988
- setError(null);
11012
+ if (!isCancelled) {
11013
+ setInternalWallets(response.data);
11014
+ setError(null);
11015
+ setLoading(false);
11016
+ }
10989
11017
  } catch (err) {
10990
- setError(err instanceof Error ? err.message : "Failed to load wallets");
10991
- console.error("Error fetching wallets:", err);
10992
- } finally {
10993
- setLoading(false);
11018
+ console.error("Error fetching wallets, retrying in 5s:", err);
11019
+ if (!isCancelled) {
11020
+ setError(err instanceof Error ? err.message : "Failed to load wallets");
11021
+ setLoading(false);
11022
+ retryTimeout = setTimeout(fetchWallets, 5e3);
11023
+ }
10994
11024
  }
10995
- }
11025
+ };
10996
11026
  fetchWallets();
11027
+ return () => {
11028
+ isCancelled = true;
11029
+ if (retryTimeout) {
11030
+ clearTimeout(retryTimeout);
11031
+ }
11032
+ };
10997
11033
  }, [
10998
11034
  userId,
10999
11035
  recipientAddress,
11000
11036
  destinationChainType,
11001
11037
  destinationChainId,
11002
11038
  destinationTokenAddress,
11003
- publishableKey
11039
+ publishableKey,
11040
+ externalWallets
11004
11041
  ]);
11005
11042
  (0, import_react8.useEffect)(() => {
11006
11043
  if (!supportedTokens.length) return;
@@ -11252,7 +11289,7 @@ function TransferCryptoBase({
11252
11289
  {
11253
11290
  value: depositAddress,
11254
11291
  size: 180,
11255
- imageUrl: currentChainData?.icon_url || currentChainFromBackend?.icon_url || getIconUrl("/icons/networks/ethereum.svg"),
11292
+ imageUrl: currentChainData?.icon_url || currentChainFromBackend?.icon_url,
11256
11293
  imageSize: 45,
11257
11294
  darkMode: isDarkMode
11258
11295
  },
@@ -11469,7 +11506,7 @@ function TransferCryptoBase({
11469
11506
  orderSubmittedAt: depositExecutions[0].created_at || (/* @__PURE__ */ new Date()).toISOString(),
11470
11507
  orderFilledAt: depositExecutions[0].updated_at || (/* @__PURE__ */ new Date()).toISOString(),
11471
11508
  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,
11509
+ completionExplorerUrl: depositExecutions[0].destination_explorer_url ?? void 0,
11473
11510
  status: depositExecutions[0].status,
11474
11511
  tokenIconUrl: depositExecutions[0].source_token_metadata?.icon_url,
11475
11512
  onClose: () => setDepositExecutions([])
@@ -11504,6 +11541,7 @@ function CurrencyListItem({
11504
11541
  isSelected,
11505
11542
  onSelect
11506
11543
  }) {
11544
+ const iconUrl = currency.icon_url;
11507
11545
  return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
11508
11546
  "button",
11509
11547
  {
@@ -11511,14 +11549,14 @@ function CurrencyListItem({
11511
11549
  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
11550
  children: [
11513
11551
  /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
11514
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "uf-w-10 uf-h-10 uf-flex uf-items-center uf-justify-center uf-flex-shrink-0 uf-rounded-full uf-overflow-hidden uf-bg-card", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
11552
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "uf-w-10 uf-h-10 uf-flex-shrink-0 uf-rounded-full uf-overflow-hidden uf-bg-card", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
11515
11553
  "img",
11516
11554
  {
11517
- src: currency.icon_url,
11555
+ src: iconUrl,
11518
11556
  alt: currency.name,
11519
11557
  width: 40,
11520
11558
  height: 40,
11521
- className: "uf-w-full uf-h-full uf-object-cover uf-rounded-full"
11559
+ className: "uf-w-full uf-h-full uf-object-cover"
11522
11560
  }
11523
11561
  ) }),
11524
11562
  /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "uf-text-left", children: [
@@ -11634,18 +11672,6 @@ function CurrencyModal({
11634
11672
  ] }) })
11635
11673
  ] }) });
11636
11674
  }
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
11675
  async function getIpViaIpApi() {
11650
11676
  const url = "https://ipapi.co/json";
11651
11677
  const response = await fetch(url);
@@ -11658,7 +11684,7 @@ async function getIpViaIpApi() {
11658
11684
  state: data.region_code?.toLowerCase()
11659
11685
  };
11660
11686
  }
11661
- function useUserIp(moonpayApiKey) {
11687
+ function useUserIp() {
11662
11688
  const {
11663
11689
  data: userIpInfo,
11664
11690
  isLoading,
@@ -11666,21 +11692,12 @@ function useUserIp(moonpayApiKey) {
11666
11692
  } = (0, import_react_query2.useQuery)({
11667
11693
  queryKey: ["getUserIpInfo"],
11668
11694
  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
11695
  try {
11679
11696
  const ipApiData = await getIpViaIpApi();
11680
11697
  console.log("IP detected via ipapi.co:", ipApiData);
11681
11698
  return ipApiData;
11682
11699
  } catch (ipApiError) {
11683
- console.error("All IP detection methods failed:", ipApiError);
11700
+ console.error("IP detection failed:", ipApiError);
11684
11701
  throw ipApiError;
11685
11702
  }
11686
11703
  },
@@ -11726,7 +11743,8 @@ function BuyWithCard({
11726
11743
  destinationChainType,
11727
11744
  destinationChainId,
11728
11745
  destinationTokenAddress,
11729
- themeClass = ""
11746
+ themeClass = "",
11747
+ wallets: externalWallets
11730
11748
  }) {
11731
11749
  const [amount, setAmount] = (0, import_react11.useState)("500.00");
11732
11750
  const [currency, setCurrency] = (0, import_react11.useState)("usd");
@@ -11761,8 +11779,9 @@ function BuyWithCard({
11761
11779
  const [isAutoSelected, setIsAutoSelected] = (0, import_react11.useState)(true);
11762
11780
  const [autoSelectedProvider, setAutoSelectedProvider] = (0, import_react11.useState)(null);
11763
11781
  const [hasManualSelection, setHasManualSelection] = (0, import_react11.useState)(false);
11764
- const [wallets, setWallets] = (0, import_react11.useState)([]);
11765
- const [walletsLoading, setWalletsLoading] = (0, import_react11.useState)(true);
11782
+ const [internalWallets, setInternalWallets] = (0, import_react11.useState)([]);
11783
+ const [walletsLoading, setWalletsLoading] = (0, import_react11.useState)(!externalWallets?.length);
11784
+ const wallets = externalWallets?.length ? externalWallets : internalWallets;
11766
11785
  const [countdown, setCountdown] = (0, import_react11.useState)(60);
11767
11786
  const [fiatCurrencies, setFiatCurrencies] = (0, import_react11.useState)([]);
11768
11787
  const [preferredCurrencyCodes, setPreferredCurrencyCodes] = (0, import_react11.useState)([]);
@@ -11791,7 +11810,15 @@ function BuyWithCard({
11791
11810
  fetchFiatCurrencies();
11792
11811
  }, [publishableKey]);
11793
11812
  (0, import_react11.useEffect)(() => {
11794
- async function fetchWallets() {
11813
+ if (externalWallets?.length) {
11814
+ setWalletsLoading(false);
11815
+ return;
11816
+ }
11817
+ let retryTimeout = null;
11818
+ let isCancelled = false;
11819
+ const fetchWallets = async () => {
11820
+ if (isCancelled) return;
11821
+ setWalletsLoading(true);
11795
11822
  try {
11796
11823
  const response = await createEOA(
11797
11824
  {
@@ -11803,16 +11830,26 @@ function BuyWithCard({
11803
11830
  },
11804
11831
  publishableKey
11805
11832
  );
11806
- setWallets(response.data);
11833
+ if (!isCancelled) {
11834
+ setInternalWallets(response.data);
11835
+ setWalletsLoading(false);
11836
+ }
11807
11837
  } catch (err) {
11808
- console.error("Error fetching wallets:", err);
11809
- setQuotesError("Failed to load wallet addresses");
11810
- } finally {
11811
- setWalletsLoading(false);
11838
+ console.error("Error fetching wallets, retrying in 5s:", err);
11839
+ if (!isCancelled) {
11840
+ setWalletsLoading(false);
11841
+ retryTimeout = setTimeout(fetchWallets, 5e3);
11842
+ }
11812
11843
  }
11813
- }
11844
+ };
11814
11845
  fetchWallets();
11815
- }, [userId, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, publishableKey]);
11846
+ return () => {
11847
+ isCancelled = true;
11848
+ if (retryTimeout) {
11849
+ clearTimeout(retryTimeout);
11850
+ }
11851
+ };
11852
+ }, [userId, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, publishableKey, externalWallets]);
11816
11853
  (0, import_react11.useEffect)(() => {
11817
11854
  async function fetchSupportedTokens() {
11818
11855
  try {
@@ -12302,8 +12339,10 @@ function BuyWithCard({
12302
12339
  function TransferCryptoButton({
12303
12340
  onClick,
12304
12341
  title,
12305
- subtitle
12342
+ subtitle,
12343
+ featuredTokens
12306
12344
  }) {
12345
+ const sortedTokens = featuredTokens ? [...featuredTokens].sort((a, b) => a.position - b.position) : [];
12307
12346
  return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
12308
12347
  "button",
12309
12348
  {
@@ -12318,88 +12357,20 @@ function TransferCryptoButton({
12318
12357
  ] })
12319
12358
  ] }),
12320
12359
  /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
12321
- /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "uf-flex uf--space-x-1", children: [
12322
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
12323
- "img",
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)(
12360
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "uf-flex uf--space-x-2", children: sortedTokens.map((token) => {
12361
+ const iconUrl = token.icon_urls.find((u) => u.format === "svg")?.url || token.icon_urls.find((u) => u.format === "png")?.url;
12362
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
12373
12363
  "img",
12374
12364
  {
12375
- src: getIconUrl("/icons/networks/solana.svg"),
12376
- alt: "SOL",
12365
+ src: iconUrl,
12366
+ alt: token.name,
12377
12367
  width: 20,
12378
12368
  height: 20,
12379
12369
  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)(
12393
- "img",
12394
- {
12395
- src: getIconUrl("/icons/networks/bitcoin.svg"),
12396
- alt: "BTC",
12397
- width: 20,
12398
- height: 20,
12399
- className: "uf-rounded-full uf-border-2 uf-border-secondary"
12400
- }
12401
- )
12402
- ] }),
12370
+ },
12371
+ token.name
12372
+ );
12373
+ }) }),
12403
12374
  /* @__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" })
12404
12375
  ] })
12405
12376
  ]
@@ -12409,7 +12380,8 @@ function TransferCryptoButton({
12409
12380
  function DepositWithCardButton({
12410
12381
  onClick,
12411
12382
  title,
12412
- subtitle
12383
+ subtitle,
12384
+ paymentNetworks
12413
12385
  }) {
12414
12386
  return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
12415
12387
  "button",
@@ -12425,28 +12397,20 @@ function DepositWithCardButton({
12425
12397
  ] })
12426
12398
  ] }),
12427
12399
  /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
12428
- /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-1.5", children: [
12429
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
12430
- "img",
12431
- {
12432
- src: getIconUrl("/icons/networks/mastercard.svg"),
12433
- alt: "Mastercard",
12434
- width: 32,
12435
- height: 32,
12436
- className: "uf-rounded"
12437
- }
12438
- ),
12439
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
12400
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "uf-flex uf-items-center uf-gap-1.5", children: paymentNetworks?.map((network) => {
12401
+ const iconUrl = network.icon_urls.find((u) => u.format === "svg")?.url || network.icon_urls.find((u) => u.format === "png")?.url;
12402
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
12440
12403
  "img",
12441
12404
  {
12442
- src: getIconUrl("/icons/networks/visa.svg"),
12443
- alt: "Visa",
12405
+ src: iconUrl,
12406
+ alt: network.name,
12444
12407
  width: 32,
12445
12408
  height: 32,
12446
12409
  className: "uf-rounded"
12447
- }
12448
- )
12449
- ] }),
12410
+ },
12411
+ network.name
12412
+ );
12413
+ }) }),
12450
12414
  /* @__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" })
12451
12415
  ] })
12452
12416
  ]
@@ -12480,6 +12444,21 @@ function DepositTrackerButton({
12480
12444
  }
12481
12445
  );
12482
12446
  }
12447
+ function SkeletonButton({ variant = "default" }) {
12448
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "uf-w-full uf-bg-secondary uf-rounded-xl uf-p-3 uf-flex uf-items-center uf-justify-between uf-animate-pulse", children: [
12449
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
12450
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "uf-bg-muted uf-rounded-lg uf-w-9 uf-h-9" }),
12451
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "uf-space-y-1.5", children: [
12452
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "uf-h-3.5 uf-w-24 uf-bg-muted uf-rounded" }),
12453
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "uf-h-3 uf-w-32 uf-bg-muted uf-rounded" })
12454
+ ] })
12455
+ ] }),
12456
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
12457
+ variant === "with-icons" && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "uf-flex uf--space-x-1", children: [1, 2, 3].map((i) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "uf-w-5 uf-h-5 uf-rounded-full uf-bg-muted uf-border-2 uf-border-secondary" }, i)) }),
12458
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ChevronRight, { className: "uf-w-4 uf-h-4 uf-text-muted" })
12459
+ ] })
12460
+ ] });
12461
+ }
12483
12462
  var t3 = i18n.depositModal;
12484
12463
  function DepositModal({
12485
12464
  open,
@@ -12504,6 +12483,15 @@ function DepositModal({
12504
12483
  const [quotesCount, setQuotesCount] = (0, import_react7.useState)(0);
12505
12484
  const [depositsModalOpen, setDepositsModalOpen] = (0, import_react7.useState)(false);
12506
12485
  const [depositExecutions, setDepositExecutions] = (0, import_react7.useState)([]);
12486
+ const [projectConfig, setProjectConfig] = (0, import_react7.useState)(null);
12487
+ const [wallets, setWallets] = (0, import_react7.useState)([]);
12488
+ const [walletsLoading, setWalletsLoading] = (0, import_react7.useState)(false);
12489
+ (0, import_react7.useEffect)(() => {
12490
+ setProjectConfig(null);
12491
+ }, [publishableKey]);
12492
+ (0, import_react7.useEffect)(() => {
12493
+ setWallets([]);
12494
+ }, [userId, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, publishableKey]);
12507
12495
  const [resolvedTheme, setResolvedTheme] = (0, import_react7.useState)(theme === "auto" ? "dark" : theme);
12508
12496
  (0, import_react7.useEffect)(() => {
12509
12497
  if (theme === "auto") {
@@ -12518,6 +12506,49 @@ function DepositModal({
12518
12506
  setResolvedTheme(theme);
12519
12507
  }
12520
12508
  }, [theme]);
12509
+ (0, import_react7.useEffect)(() => {
12510
+ if (open && !projectConfig) {
12511
+ getProjectConfig(publishableKey).then(setProjectConfig).catch(console.error);
12512
+ }
12513
+ }, [open, publishableKey, projectConfig]);
12514
+ (0, import_react7.useEffect)(() => {
12515
+ if (!open || wallets.length > 0) return;
12516
+ let retryTimeout = null;
12517
+ let isCancelled = false;
12518
+ const fetchWallets = async () => {
12519
+ if (isCancelled) return;
12520
+ setWalletsLoading(true);
12521
+ try {
12522
+ const response = await createEOA(
12523
+ {
12524
+ user_id: userId,
12525
+ recipient_address: recipientAddress,
12526
+ destination_chain_type: destinationChainType,
12527
+ destination_chain_id: destinationChainId,
12528
+ destination_token_address: destinationTokenAddress
12529
+ },
12530
+ publishableKey
12531
+ );
12532
+ if (!isCancelled) {
12533
+ setWallets(response.data);
12534
+ setWalletsLoading(false);
12535
+ }
12536
+ } catch (error) {
12537
+ console.error("Error fetching wallets, retrying in 5s:", error);
12538
+ if (!isCancelled) {
12539
+ setWalletsLoading(false);
12540
+ retryTimeout = setTimeout(fetchWallets, 5e3);
12541
+ }
12542
+ }
12543
+ };
12544
+ fetchWallets();
12545
+ return () => {
12546
+ isCancelled = true;
12547
+ if (retryTimeout) {
12548
+ clearTimeout(retryTimeout);
12549
+ }
12550
+ };
12551
+ }, [open, userId, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, publishableKey, wallets.length]);
12521
12552
  const themeClass = resolvedTheme === "dark" ? "uf-dark" : "";
12522
12553
  const handleClose = () => {
12523
12554
  onOpenChange(false);
@@ -12557,13 +12588,18 @@ function DepositModal({
12557
12588
  onClose: handleClose
12558
12589
  }
12559
12590
  ),
12560
- /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "uf-pb-4 uf-space-y-3", children: [
12591
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "uf-pb-4 uf-space-y-3", children: !projectConfig ? /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
12592
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(SkeletonButton, { variant: "with-icons" }),
12593
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(SkeletonButton, { variant: "with-icons" }),
12594
+ !hideDepositTracker && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(SkeletonButton, {})
12595
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
12561
12596
  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
12562
12597
  TransferCryptoButton,
12563
12598
  {
12564
12599
  onClick: () => setView("transfer"),
12565
12600
  title: t3.transferCrypto.title,
12566
- subtitle: t3.transferCrypto.subtitle
12601
+ subtitle: t3.transferCrypto.subtitle,
12602
+ featuredTokens: projectConfig.transfer_crypto.networks
12567
12603
  }
12568
12604
  ),
12569
12605
  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
@@ -12571,7 +12607,8 @@ function DepositModal({
12571
12607
  {
12572
12608
  onClick: () => setView("card"),
12573
12609
  title: t3.depositWithCard.title,
12574
- subtitle: t3.depositWithCard.subtitle
12610
+ subtitle: t3.depositWithCard.subtitle,
12611
+ paymentNetworks: projectConfig.payment_networks.networks
12575
12612
  }
12576
12613
  ),
12577
12614
  !hideDepositTracker && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
@@ -12583,7 +12620,7 @@ function DepositModal({
12583
12620
  badge: depositExecutions.length > 0 ? depositExecutions.length : void 0
12584
12621
  }
12585
12622
  )
12586
- ] })
12623
+ ] }) })
12587
12624
  ] }) : view === "transfer" ? /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
12588
12625
  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
12589
12626
  DepositHeader,
@@ -12605,7 +12642,8 @@ function DepositModal({
12605
12642
  destinationTokenAddress,
12606
12643
  onExecutionsChange: setDepositExecutions,
12607
12644
  onDepositSuccess,
12608
- onDepositError
12645
+ onDepositError,
12646
+ wallets
12609
12647
  }
12610
12648
  )
12611
12649
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
@@ -12633,7 +12671,8 @@ function DepositModal({
12633
12671
  destinationTokenAddress,
12634
12672
  onDepositSuccess,
12635
12673
  onDepositError,
12636
- themeClass
12674
+ themeClass,
12675
+ wallets
12637
12676
  }
12638
12677
  )
12639
12678
  ] })