@rhinestone/deposit-modal 0.1.12 → 0.1.14

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.cjs CHANGED
@@ -240,7 +240,89 @@ var init_Button = __esm({
240
240
  }
241
241
  });
242
242
 
243
+ // src/components/ui/Icons.tsx
244
+ function WalletIcon() {
245
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
246
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
247
+ "rect",
248
+ {
249
+ x: "3",
250
+ y: "6",
251
+ width: "18",
252
+ height: "13",
253
+ rx: "2",
254
+ strokeLinecap: "round",
255
+ strokeLinejoin: "round"
256
+ }
257
+ ),
258
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
259
+ "path",
260
+ {
261
+ d: "M16 12.5a1 1 0 100-2 1 1 0 000 2z",
262
+ fill: "currentColor",
263
+ stroke: "none"
264
+ }
265
+ ),
266
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M3 10h18", strokeLinecap: "round" })
267
+ ] });
268
+ }
269
+ function ExternalLinkIcon() {
270
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
271
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
272
+ "path",
273
+ {
274
+ d: "M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5",
275
+ strokeLinecap: "round",
276
+ strokeLinejoin: "round"
277
+ }
278
+ ),
279
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M15 3h6v6", strokeLinecap: "round", strokeLinejoin: "round" }),
280
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M10 14L21 3", strokeLinecap: "round", strokeLinejoin: "round" })
281
+ ] });
282
+ }
283
+ function TransferIcon() {
284
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
285
+ "path",
286
+ {
287
+ d: "M7.5 21L3 16.5m0 0L7.5 12M3 16.5h13.5m0-9L21 12m0 0l-4.5 4.5M21 12H7.5",
288
+ strokeLinecap: "round",
289
+ strokeLinejoin: "round"
290
+ }
291
+ ) });
292
+ }
293
+ function CheckIcon() {
294
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
295
+ "path",
296
+ {
297
+ d: "M5 13l4 4L19 7",
298
+ strokeLinecap: "round",
299
+ strokeLinejoin: "round"
300
+ }
301
+ ) });
302
+ }
303
+ function ChevronRightIcon() {
304
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
305
+ "path",
306
+ {
307
+ d: "M9 5l7 7-7 7",
308
+ strokeLinecap: "round",
309
+ strokeLinejoin: "round"
310
+ }
311
+ ) });
312
+ }
313
+ var import_jsx_runtime4;
314
+ var init_Icons = __esm({
315
+ "src/components/ui/Icons.tsx"() {
316
+ "use strict";
317
+ import_jsx_runtime4 = require("react/jsx-runtime");
318
+ }
319
+ });
320
+
243
321
  // src/components/steps/ConnectStep.tsx
322
+ function rowIcon(kind) {
323
+ if (kind === "connected") return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(WalletIcon, {});
324
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ExternalLinkIcon, {});
325
+ }
244
326
  function ConnectStep({
245
327
  walletOptions,
246
328
  selectedAddress,
@@ -256,62 +338,80 @@ function ConnectStep({
256
338
  if (hasWalletOptions) {
257
339
  const hasExternalWallet = walletOptions?.some((option) => option.kind === "external") ?? false;
258
340
  const showConnectDifferentWalletOption = Boolean(onConnect) && !hasExternalWallet;
259
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "rs-step", children: [
260
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "rs-connect-centered rs-connect-centered--wallets", children: [
261
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "rs-connect-wallet-list", children: [
341
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "rs-step", children: [
342
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "rs-connect-centered rs-connect-centered--wallets", children: [
343
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "rs-connect-wallet-list", children: [
262
344
  walletOptions?.map((option) => {
263
345
  const isSelected = option.address.toLowerCase() === (selectedAddress ?? "").toLowerCase();
264
346
  const shortAddress = `${option.address.slice(0, 6)}...${option.address.slice(-4)}`;
265
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
347
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
266
348
  "button",
267
349
  {
268
350
  type: "button",
269
351
  className: `rs-connect-wallet-row ${isSelected ? "rs-connect-wallet-row--selected" : ""}`,
270
352
  onClick: () => onSelectAddress?.(option.address),
271
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "rs-connect-wallet-meta", children: [
272
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "rs-connect-wallet-label", children: option.label }),
273
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "rs-connect-wallet-address", children: shortAddress })
274
- ] })
353
+ children: [
354
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
355
+ "div",
356
+ {
357
+ className: `rs-connect-wallet-icon ${isSelected ? "rs-connect-wallet-icon--selected" : ""}`,
358
+ children: rowIcon(option.kind)
359
+ }
360
+ ),
361
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "rs-connect-wallet-meta", children: [
362
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "rs-connect-wallet-label", children: option.label }),
363
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "rs-connect-wallet-address", children: shortAddress })
364
+ ] }),
365
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "rs-connect-wallet-indicator", children: isSelected ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CheckIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ChevronRightIcon, {}) })
366
+ ]
275
367
  },
276
368
  `${option.label}-${option.address}`
277
369
  );
278
370
  }),
279
- showConnectDifferentWalletOption && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
371
+ showConnectDifferentWalletOption && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
280
372
  "button",
281
373
  {
282
374
  type: "button",
283
375
  className: "rs-connect-wallet-row rs-connect-wallet-row--action",
284
376
  onClick: onConnect,
285
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "rs-connect-wallet-meta", children: [
286
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "rs-connect-wallet-label", children: "External Wallet" }),
287
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "rs-connect-wallet-address", children: "Connect different wallet" })
288
- ] })
377
+ children: [
378
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "rs-connect-wallet-icon rs-connect-wallet-icon--action", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ExternalLinkIcon, {}) }),
379
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "rs-connect-wallet-meta", children: [
380
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "rs-connect-wallet-label", children: "External Wallet" }),
381
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "rs-connect-wallet-address", children: "Connect different wallet" })
382
+ ] }),
383
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "rs-connect-wallet-indicator", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ChevronRightIcon, {}) })
384
+ ]
289
385
  }
290
386
  ),
291
- onSelectTransferCrypto && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
387
+ onSelectTransferCrypto && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
292
388
  "button",
293
389
  {
294
390
  type: "button",
295
391
  className: "rs-connect-wallet-row rs-connect-wallet-row--action",
296
392
  onClick: onSelectTransferCrypto,
297
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "rs-connect-wallet-meta", children: [
298
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "rs-connect-wallet-label", children: "Transfer Crypto" }),
299
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "rs-connect-wallet-address", children: "Deposit via QR code" })
300
- ] })
393
+ children: [
394
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "rs-connect-wallet-icon rs-connect-wallet-icon--action", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(TransferIcon, {}) }),
395
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "rs-connect-wallet-meta", children: [
396
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "rs-connect-wallet-label", children: "Transfer Crypto" }),
397
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "rs-connect-wallet-address", children: "Deposit via QR code" })
398
+ ] }),
399
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "rs-connect-wallet-indicator", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ChevronRightIcon, {}) })
400
+ ]
301
401
  }
302
402
  )
303
403
  ] }),
304
- onConnect && walletOptions?.some((option) => option.kind === "external") && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
404
+ onConnect && walletOptions?.some((option) => option.kind === "external") && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
305
405
  "button",
306
406
  {
307
407
  type: "button",
308
408
  className: "rs-connect-wallet-manage",
309
409
  onClick: onConnect,
310
- children: "Manage external wallet"
410
+ children: "Disconnect Wallet"
311
411
  }
312
412
  )
313
413
  ] }),
314
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "rs-step-footer", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
414
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "rs-step-footer rs-step-footer--connect-empty", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
315
415
  Button,
316
416
  {
317
417
  onClick: onContinue,
@@ -324,39 +424,57 @@ function ConnectStep({
324
424
  ] });
325
425
  }
326
426
  const handleConnect = onConnect ?? onRequestConnect;
327
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "rs-step", children: [
328
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "rs-connect-centered rs-connect-centered--minimal", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "rs-connect-empty", children: [
329
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "rs-connect-empty-graphic", "aria-hidden": "true", children: [
330
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "rs-connect-empty-orbit rs-connect-empty-orbit--outer" }),
331
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "rs-connect-empty-orbit rs-connect-empty-orbit--inner" }),
332
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "rs-connect-empty-core", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.6", children: [
333
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
334
- "path",
335
- {
336
- strokeLinecap: "round",
337
- strokeLinejoin: "round",
338
- d: "M4 8.25A2.25 2.25 0 016.25 6h11.5A2.25 2.25 0 0120 8.25v7.5A2.25 2.25 0 0117.75 18H6.25A2.25 2.25 0 014 15.75v-7.5z"
339
- }
340
- ),
341
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
342
- "path",
343
- {
344
- strokeLinecap: "round",
345
- strokeLinejoin: "round",
346
- d: "M20 10.5h-3.75a2.25 2.25 0 100 4.5H20"
347
- }
348
- ),
349
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("circle", { cx: "16.25", cy: "12.75", r: "0.85", fill: "currentColor" })
350
- ] }) }),
351
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "rs-connect-empty-dot rs-connect-empty-dot--left" }),
352
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "rs-connect-empty-dot rs-connect-empty-dot--right" })
427
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "rs-step", children: [
428
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "rs-connect-centered rs-connect-centered--minimal", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "rs-connect-empty", children: [
429
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "rs-connect-empty-graphic", "aria-hidden": "true", children: [
430
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "rs-connect-empty-orbit rs-connect-empty-orbit--outer" }),
431
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "rs-connect-empty-orbit rs-connect-empty-orbit--inner" }),
432
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "rs-connect-empty-core", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
433
+ "svg",
434
+ {
435
+ viewBox: "0 0 24 24",
436
+ fill: "none",
437
+ stroke: "currentColor",
438
+ strokeWidth: "1.6",
439
+ children: [
440
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
441
+ "path",
442
+ {
443
+ strokeLinecap: "round",
444
+ strokeLinejoin: "round",
445
+ d: "M4 8.25A2.25 2.25 0 016.25 6h11.5A2.25 2.25 0 0120 8.25v7.5A2.25 2.25 0 0117.75 18H6.25A2.25 2.25 0 014 15.75v-7.5z"
446
+ }
447
+ ),
448
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
449
+ "path",
450
+ {
451
+ strokeLinecap: "round",
452
+ strokeLinejoin: "round",
453
+ d: "M20 10.5h-3.75a2.25 2.25 0 100 4.5H20"
454
+ }
455
+ ),
456
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("circle", { cx: "16.25", cy: "12.75", r: "0.85", fill: "currentColor" })
457
+ ]
458
+ }
459
+ ) }),
460
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "rs-connect-empty-dot rs-connect-empty-dot--left" }),
461
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "rs-connect-empty-dot rs-connect-empty-dot--right" })
353
462
  ] }),
354
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "rs-connect-empty-title", children: "No wallet connected" }),
355
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "rs-connect-empty-subtitle", children: "Connect an external wallet to continue." })
463
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "rs-connect-empty-title", children: "No wallet connected" }),
464
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "rs-connect-empty-subtitle", children: "Connect an external wallet to continue." })
356
465
  ] }) }),
357
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "rs-step-footer rs-step-footer--connect-empty", children: [
358
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Button, { onClick: handleConnect, variant: "accent", fullWidth: true, disabled: !handleConnect, children: connectButtonLabel }),
359
- onSelectTransferCrypto && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
466
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "rs-step-footer rs-step-footer--connect-empty", children: [
467
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
468
+ Button,
469
+ {
470
+ onClick: handleConnect,
471
+ variant: "accent",
472
+ fullWidth: true,
473
+ disabled: !handleConnect,
474
+ children: connectButtonLabel
475
+ }
476
+ ),
477
+ onSelectTransferCrypto && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
360
478
  "button",
361
479
  {
362
480
  type: "button",
@@ -368,12 +486,13 @@ function ConnectStep({
368
486
  ] })
369
487
  ] });
370
488
  }
371
- var import_jsx_runtime4;
489
+ var import_jsx_runtime5;
372
490
  var init_ConnectStep = __esm({
373
491
  "src/components/steps/ConnectStep.tsx"() {
374
492
  "use strict";
375
493
  init_Button();
376
- import_jsx_runtime4 = require("react/jsx-runtime");
494
+ init_Icons();
495
+ import_jsx_runtime5 = require("react/jsx-runtime");
377
496
  ConnectStep.displayName = "ConnectStep";
378
497
  }
379
498
  });
@@ -1003,24 +1122,24 @@ function SetupStep({
1003
1122
  };
1004
1123
  const isLoading = state.type === "idle" || state.type === "checking" || state.type === "creating-account" || state.type === "signing-session" || state.type === "registering";
1005
1124
  const isError = state.type === "error";
1006
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "rs-step", children: [
1007
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "rs-loading-state", children: [
1008
- isLoading && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
1009
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Spinner, { className: "rs-spinner--lg rs-text-accent" }),
1010
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "rs-loading-text", children: [
1011
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "rs-loading-title", children: renderStateMessage() }),
1012
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "rs-loading-subtitle", children: "This may take a moment" })
1125
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "rs-step", children: [
1126
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "rs-loading-state", children: [
1127
+ isLoading && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
1128
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Spinner, { className: "rs-spinner--lg rs-text-accent" }),
1129
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "rs-loading-text", children: [
1130
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "rs-loading-title", children: renderStateMessage() }),
1131
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "rs-loading-subtitle", children: "This may take a moment" })
1013
1132
  ] })
1014
1133
  ] }),
1015
- isError && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
1016
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "rs-step-icon rs-step-icon--error", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1134
+ isError && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
1135
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "rs-step-icon rs-step-icon--error", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1017
1136
  "svg",
1018
1137
  {
1019
1138
  viewBox: "0 0 24 24",
1020
1139
  fill: "none",
1021
1140
  stroke: "currentColor",
1022
1141
  strokeWidth: "2",
1023
- children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1142
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1024
1143
  "path",
1025
1144
  {
1026
1145
  strokeLinecap: "round",
@@ -1030,9 +1149,9 @@ function SetupStep({
1030
1149
  )
1031
1150
  }
1032
1151
  ) }),
1033
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "rs-loading-text", children: [
1034
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "rs-loading-title rs-text-error", children: "Setup failed" }),
1035
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1152
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "rs-loading-text", children: [
1153
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "rs-loading-title rs-text-error", children: "Setup failed" }),
1154
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1036
1155
  "div",
1037
1156
  {
1038
1157
  className: "rs-loading-subtitle",
@@ -1043,10 +1162,10 @@ function SetupStep({
1043
1162
  ] })
1044
1163
  ] })
1045
1164
  ] }),
1046
- isError && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "rs-step-footer", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Button, { onClick: handleRetry, variant: "default", fullWidth: true, children: "Try Again" }) })
1165
+ isError && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "rs-step-footer", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Button, { onClick: handleRetry, variant: "default", fullWidth: true, children: "Try Again" }) })
1047
1166
  ] });
1048
1167
  }
1049
- var import_react2, import_sdk2, import_jsx_runtime5;
1168
+ var import_react2, import_sdk2, import_jsx_runtime6;
1050
1169
  var init_SetupStep = __esm({
1051
1170
  "src/components/steps/SetupStep.tsx"() {
1052
1171
  "use strict";
@@ -1056,21 +1175,21 @@ var init_SetupStep = __esm({
1056
1175
  init_Spinner();
1057
1176
  init_account();
1058
1177
  init_session_owner();
1059
- import_jsx_runtime5 = require("react/jsx-runtime");
1178
+ import_jsx_runtime6 = require("react/jsx-runtime");
1060
1179
  }
1061
1180
  });
1062
1181
 
1063
1182
  // src/components/ui/PoweredBy.tsx
1064
1183
  function PoweredBy() {
1065
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "rs-powered-by", children: [
1066
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1184
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "rs-powered-by", children: [
1185
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1067
1186
  "svg",
1068
1187
  {
1069
1188
  viewBox: "0 0 24 24",
1070
1189
  fill: "none",
1071
1190
  stroke: "currentColor",
1072
1191
  strokeWidth: "2",
1073
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1192
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1074
1193
  "path",
1075
1194
  {
1076
1195
  strokeLinecap: "round",
@@ -1080,10 +1199,10 @@ function PoweredBy() {
1080
1199
  )
1081
1200
  }
1082
1201
  ),
1083
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { children: [
1202
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { children: [
1084
1203
  "Powered by",
1085
1204
  " ",
1086
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1205
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1087
1206
  "a",
1088
1207
  {
1089
1208
  href: "https://www.rhinestone.dev",
@@ -1095,11 +1214,11 @@ function PoweredBy() {
1095
1214
  ] })
1096
1215
  ] });
1097
1216
  }
1098
- var import_jsx_runtime6;
1217
+ var import_jsx_runtime7;
1099
1218
  var init_PoweredBy = __esm({
1100
1219
  "src/components/ui/PoweredBy.tsx"() {
1101
1220
  "use strict";
1102
- import_jsx_runtime6 = require("react/jsx-runtime");
1221
+ import_jsx_runtime7 = require("react/jsx-runtime");
1103
1222
  }
1104
1223
  });
1105
1224
 
@@ -1368,8 +1487,6 @@ var init_formatters = __esm({
1368
1487
  function AssetSelectStep({
1369
1488
  address,
1370
1489
  publicClient,
1371
- smartAccount,
1372
- recipient,
1373
1490
  defaultSourceChain,
1374
1491
  defaultSourceToken,
1375
1492
  service,
@@ -1472,21 +1589,21 @@ function AssetSelectStep({
1472
1589
  return asset.balance;
1473
1590
  }
1474
1591
  };
1475
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "rs-step", children: [
1476
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { style: { padding: "12px 12px 4px" }, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "rs-step-title", children: "Select source asset" }) }),
1477
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
1592
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "rs-step", children: [
1593
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: { padding: "12px 12px 4px" }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "rs-step-title", children: "Select source asset" }) }),
1594
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1478
1595
  "div",
1479
1596
  {
1480
1597
  className: "rs-step-body",
1481
1598
  style: { paddingTop: 4, overflow: "auto", maxHeight: 340 },
1482
1599
  children: [
1483
- loading && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
1484
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Spinner, { className: "rs-text-tertiary" }),
1485
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
1600
+ loading && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
1601
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Spinner, { className: "rs-text-tertiary" }),
1602
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
1486
1603
  ] }),
1487
- error && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "rs-alert rs-alert--error", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "rs-alert-text", children: error }) }),
1488
- !loading && !error && rows.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "rs-empty-state", children: [
1489
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1604
+ error && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "rs-alert rs-alert--error", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "rs-alert-text", children: error }) }),
1605
+ !loading && !error && rows.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "rs-empty-state", children: [
1606
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1490
1607
  "svg",
1491
1608
  {
1492
1609
  className: "rs-empty-icon",
@@ -1494,7 +1611,7 @@ function AssetSelectStep({
1494
1611
  fill: "none",
1495
1612
  stroke: "currentColor",
1496
1613
  strokeWidth: "1.5",
1497
- children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1614
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1498
1615
  "path",
1499
1616
  {
1500
1617
  strokeLinecap: "round",
@@ -1504,20 +1621,20 @@ function AssetSelectStep({
1504
1621
  )
1505
1622
  }
1506
1623
  ),
1507
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
1508
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "rs-empty-address", children: [
1624
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
1625
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "rs-empty-address", children: [
1509
1626
  address.slice(0, 6),
1510
1627
  "...",
1511
1628
  address.slice(-4)
1512
1629
  ] })
1513
1630
  ] }),
1514
- !loading && !error && rows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "rs-asset-list", children: rows.map((asset) => {
1631
+ !loading && !error && rows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "rs-asset-list", children: rows.map((asset) => {
1515
1632
  const isSelected = selectedAssetId === asset.id;
1516
1633
  const tokenAmount = formatBalance(asset);
1517
1634
  const badge = getChainBadge(asset.chainId);
1518
1635
  const tokenIcon = getTokenIcon(asset.symbol);
1519
1636
  const chainIcon = getChainIcon(asset.chainId);
1520
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
1637
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1521
1638
  "button",
1522
1639
  {
1523
1640
  type: "button",
@@ -1525,9 +1642,9 @@ function AssetSelectStep({
1525
1642
  className: `rs-asset-row ${isSelected ? "rs-asset-row--selected" : ""}`,
1526
1643
  style: { textAlign: "left" },
1527
1644
  children: [
1528
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "rs-asset-info", children: [
1529
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "rs-asset-icon-wrapper", children: [
1530
- tokenIcon ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1645
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "rs-asset-info", children: [
1646
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "rs-asset-icon-wrapper", children: [
1647
+ tokenIcon ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1531
1648
  "img",
1532
1649
  {
1533
1650
  src: tokenIcon,
@@ -1535,15 +1652,15 @@ function AssetSelectStep({
1535
1652
  className: "rs-asset-icon",
1536
1653
  style: { background: "transparent" }
1537
1654
  }
1538
- ) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "rs-asset-icon", children: asset.symbol.slice(0, 4) }),
1539
- chainIcon ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1655
+ ) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "rs-asset-icon", children: asset.symbol.slice(0, 4) }),
1656
+ chainIcon ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1540
1657
  "img",
1541
1658
  {
1542
1659
  src: chainIcon,
1543
1660
  alt: getChainName(asset.chainId),
1544
1661
  className: "rs-asset-chain-badge"
1545
1662
  }
1546
- ) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1663
+ ) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1547
1664
  "div",
1548
1665
  {
1549
1666
  className: "rs-asset-chain-badge",
@@ -1555,23 +1672,23 @@ function AssetSelectStep({
1555
1672
  }
1556
1673
  )
1557
1674
  ] }),
1558
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { children: [
1559
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "rs-asset-name", children: [
1675
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { children: [
1676
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "rs-asset-name", children: [
1560
1677
  asset.symbol,
1561
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "rs-asset-chain", children: [
1678
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "rs-asset-chain", children: [
1562
1679
  " ",
1563
1680
  "on ",
1564
1681
  getChainName(asset.chainId)
1565
1682
  ] })
1566
1683
  ] }),
1567
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "rs-asset-balance-small", children: [
1684
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "rs-asset-balance-small", children: [
1568
1685
  tokenAmount,
1569
1686
  " ",
1570
1687
  asset.symbol
1571
1688
  ] })
1572
1689
  ] })
1573
1690
  ] }),
1574
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 ? currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
1691
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 ? currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
1575
1692
  ]
1576
1693
  },
1577
1694
  asset.id
@@ -1580,7 +1697,7 @@ function AssetSelectStep({
1580
1697
  ]
1581
1698
  }
1582
1699
  ),
1583
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "rs-step-footer", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1700
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "rs-step-footer", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1584
1701
  Button,
1585
1702
  {
1586
1703
  onClick: () => selectedAsset && onContinue(selectedAsset),
@@ -1589,7 +1706,7 @@ function AssetSelectStep({
1589
1706
  children: "Continue"
1590
1707
  }
1591
1708
  ) }),
1592
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PoweredBy, {})
1709
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(PoweredBy, {})
1593
1710
  ] });
1594
1711
  }
1595
1712
  async function fetchNativeAssets(address, publicClient, existing) {
@@ -1630,7 +1747,7 @@ function mergeAssets(existing, incoming) {
1630
1747
  }
1631
1748
  return merged;
1632
1749
  }
1633
- var import_react3, import_viem3, import_jsx_runtime7;
1750
+ var import_react3, import_viem3, import_jsx_runtime8;
1634
1751
  var init_AssetSelectStep = __esm({
1635
1752
  "src/components/steps/AssetSelectStep.tsx"() {
1636
1753
  "use strict";
@@ -1642,7 +1759,7 @@ var init_AssetSelectStep = __esm({
1642
1759
  init_deposit_service();
1643
1760
  init_constants();
1644
1761
  init_formatters();
1645
- import_jsx_runtime7 = require("react/jsx-runtime");
1762
+ import_jsx_runtime8 = require("react/jsx-runtime");
1646
1763
  }
1647
1764
  });
1648
1765
 
@@ -1652,8 +1769,6 @@ function AmountStep({
1652
1769
  publicClient,
1653
1770
  address,
1654
1771
  balanceAddress,
1655
- smartAccount,
1656
- recipient,
1657
1772
  asset,
1658
1773
  defaultAmount,
1659
1774
  switchChain,
@@ -1819,10 +1934,10 @@ function AmountStep({
1819
1934
  setIsSwitching(false);
1820
1935
  }
1821
1936
  };
1822
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "rs-step", children: [
1823
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "rs-step-body", style: { paddingTop: 0 }, children: [
1824
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "rs-amount-display", children: [
1825
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "rs-amount-input-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1937
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "rs-step", children: [
1938
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "rs-step-body", style: { paddingTop: 0 }, children: [
1939
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "rs-amount-display", children: [
1940
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "rs-amount-input-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1826
1941
  "input",
1827
1942
  {
1828
1943
  type: "text",
@@ -1840,17 +1955,17 @@ function AmountStep({
1840
1955
  autoFocus: true
1841
1956
  }
1842
1957
  ) }),
1843
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "rs-amount-token-value", children: [
1958
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "rs-amount-token-value", children: [
1844
1959
  formattedTokenAmount,
1845
1960
  " ",
1846
1961
  asset.symbol
1847
1962
  ] }),
1848
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "rs-amount-available", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "rs-amount-available-value", children: [
1963
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "rs-amount-available", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "rs-amount-available-value", children: [
1849
1964
  formattedBalance,
1850
1965
  " ",
1851
1966
  asset.symbol,
1852
1967
  " available",
1853
- balanceUsd !== null && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { style: { color: "var(--rs-muted-foreground)" }, children: [
1968
+ balanceUsd !== null && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { style: { color: "var(--rs-muted-foreground)" }, children: [
1854
1969
  " ",
1855
1970
  "(",
1856
1971
  currencyFormatter.format(balanceUsd),
@@ -1858,26 +1973,59 @@ function AmountStep({
1858
1973
  ] })
1859
1974
  ] }) })
1860
1975
  ] }),
1861
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1976
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1862
1977
  "div",
1863
1978
  {
1864
1979
  style: { display: "flex", justifyContent: "center", marginTop: 16 },
1865
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "rs-flow-pill", children: [
1866
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "rs-flow-pill-side", children: [
1867
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "rs-flow-pill-label", children: "You send" }),
1868
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "rs-flow-pill-token", children: [
1869
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "rs-flow-pill-token-icon", children: getTokenIcon(asset.symbol) ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("img", { src: getTokenIcon(asset.symbol), alt: asset.symbol }) : asset.symbol.slice(0, 2) }),
1870
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "rs-flow-pill-token-symbol", children: asset.symbol })
1980
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "rs-flow-pill", children: [
1981
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "rs-flow-pill-side", children: [
1982
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "rs-flow-pill-label", children: "You send" }),
1983
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "rs-flow-pill-token", children: [
1984
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "rs-flow-pill-token-icon-wrapper", children: [
1985
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "rs-flow-pill-token-icon", children: getTokenIcon(asset.symbol) ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1986
+ "img",
1987
+ {
1988
+ src: getTokenIcon(asset.symbol),
1989
+ alt: asset.symbol
1990
+ }
1991
+ ) : asset.symbol.slice(0, 2) }),
1992
+ (() => {
1993
+ const chainIcon = getChainIcon(asset.chainId);
1994
+ if (chainIcon) {
1995
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1996
+ "img",
1997
+ {
1998
+ src: chainIcon,
1999
+ alt: getChainName(asset.chainId),
2000
+ className: "rs-flow-pill-chain-badge"
2001
+ }
2002
+ );
2003
+ }
2004
+ const badge = getChainBadge(asset.chainId);
2005
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2006
+ "div",
2007
+ {
2008
+ className: "rs-flow-pill-chain-badge",
2009
+ style: {
2010
+ backgroundColor: badge.bg,
2011
+ color: badge.color
2012
+ },
2013
+ children: badge.shortLabel.charAt(0)
2014
+ }
2015
+ );
2016
+ })()
2017
+ ] }),
2018
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "rs-flow-pill-token-symbol", children: asset.symbol })
1871
2019
  ] })
1872
2020
  ] }),
1873
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "rs-flow-pill-arrow", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2021
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "rs-flow-pill-arrow", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1874
2022
  "svg",
1875
2023
  {
1876
2024
  viewBox: "0 0 24 24",
1877
2025
  fill: "none",
1878
2026
  stroke: "currentColor",
1879
2027
  strokeWidth: "2",
1880
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2028
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1881
2029
  "path",
1882
2030
  {
1883
2031
  strokeLinecap: "round",
@@ -1887,18 +2035,51 @@ function AmountStep({
1887
2035
  )
1888
2036
  }
1889
2037
  ) }),
1890
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "rs-flow-pill-side", children: [
1891
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "rs-flow-pill-label", children: "You receive" }),
1892
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "rs-flow-pill-token", children: [
1893
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "rs-flow-pill-token-icon", children: getTokenIcon(targetSymbol) ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("img", { src: getTokenIcon(targetSymbol), alt: targetSymbol }) : targetSymbol.slice(0, 2) }),
1894
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "rs-flow-pill-token-symbol", children: targetSymbol })
2038
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "rs-flow-pill-side", children: [
2039
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "rs-flow-pill-label", children: "You receive" }),
2040
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "rs-flow-pill-token", children: [
2041
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "rs-flow-pill-token-icon-wrapper", children: [
2042
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "rs-flow-pill-token-icon", children: getTokenIcon(targetSymbol) ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2043
+ "img",
2044
+ {
2045
+ src: getTokenIcon(targetSymbol),
2046
+ alt: targetSymbol
2047
+ }
2048
+ ) : targetSymbol.slice(0, 2) }),
2049
+ (() => {
2050
+ const chainIcon = getChainIcon(targetChain);
2051
+ if (chainIcon) {
2052
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2053
+ "img",
2054
+ {
2055
+ src: chainIcon,
2056
+ alt: getChainName(targetChain),
2057
+ className: "rs-flow-pill-chain-badge"
2058
+ }
2059
+ );
2060
+ }
2061
+ const badge = getChainBadge(targetChain);
2062
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2063
+ "div",
2064
+ {
2065
+ className: "rs-flow-pill-chain-badge",
2066
+ style: {
2067
+ backgroundColor: badge.bg,
2068
+ color: badge.color
2069
+ },
2070
+ children: badge.shortLabel.charAt(0)
2071
+ }
2072
+ );
2073
+ })()
2074
+ ] }),
2075
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "rs-flow-pill-token-symbol", children: targetSymbol })
1895
2076
  ] })
1896
2077
  ] })
1897
2078
  ] })
1898
2079
  }
1899
2080
  ),
1900
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "rs-amount-presets", children: [
1901
- [25, 50, 75].map((pct) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2081
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "rs-amount-presets", children: [
2082
+ [25, 50, 75].map((pct) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1902
2083
  "button",
1903
2084
  {
1904
2085
  type: "button",
@@ -1912,7 +2093,7 @@ function AmountStep({
1912
2093
  },
1913
2094
  pct
1914
2095
  )),
1915
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2096
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1916
2097
  "button",
1917
2098
  {
1918
2099
  type: "button",
@@ -1923,13 +2104,13 @@ function AmountStep({
1923
2104
  }
1924
2105
  )
1925
2106
  ] }),
1926
- chainMismatch && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "rs-chain-switch", style: { marginTop: 16 }, children: [
1927
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "rs-chain-switch-text", children: [
2107
+ chainMismatch && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "rs-chain-switch", style: { marginTop: 16 }, children: [
2108
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "rs-chain-switch-text", children: [
1928
2109
  "Switch your wallet to ",
1929
2110
  getChainName(asset.chainId),
1930
2111
  " to continue."
1931
2112
  ] }),
1932
- switchChain && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2113
+ switchChain && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1933
2114
  Button,
1934
2115
  {
1935
2116
  variant: "outline",
@@ -1940,8 +2121,8 @@ function AmountStep({
1940
2121
  }
1941
2122
  )
1942
2123
  ] }),
1943
- error && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "rs-amount-error", children: [
1944
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2124
+ error && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "rs-amount-error", children: [
2125
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1945
2126
  "svg",
1946
2127
  {
1947
2128
  viewBox: "0 0 24 24",
@@ -1949,7 +2130,7 @@ function AmountStep({
1949
2130
  stroke: "currentColor",
1950
2131
  strokeWidth: "2",
1951
2132
  style: { width: 16, height: 16, flexShrink: 0 },
1952
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2133
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1953
2134
  "path",
1954
2135
  {
1955
2136
  strokeLinecap: "round",
@@ -1959,10 +2140,10 @@ function AmountStep({
1959
2140
  )
1960
2141
  }
1961
2142
  ),
1962
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: error })
2143
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: error })
1963
2144
  ] })
1964
2145
  ] }),
1965
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "rs-step-footer", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2146
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "rs-step-footer", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1966
2147
  Button,
1967
2148
  {
1968
2149
  onClick: handleContinue,
@@ -1971,10 +2152,10 @@ function AmountStep({
1971
2152
  children: "Continue"
1972
2153
  }
1973
2154
  ) }),
1974
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(PoweredBy, {})
2155
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(PoweredBy, {})
1975
2156
  ] });
1976
2157
  }
1977
- var import_react4, import_viem4, import_jsx_runtime8;
2158
+ var import_react4, import_viem4, import_jsx_runtime9;
1978
2159
  var init_AmountStep = __esm({
1979
2160
  "src/components/steps/AmountStep.tsx"() {
1980
2161
  "use strict";
@@ -1985,7 +2166,7 @@ var init_AmountStep = __esm({
1985
2166
  init_deposit_service();
1986
2167
  init_constants();
1987
2168
  init_formatters();
1988
- import_jsx_runtime8 = require("react/jsx-runtime");
2169
+ import_jsx_runtime9 = require("react/jsx-runtime");
1989
2170
  }
1990
2171
  });
1991
2172
 
@@ -1994,7 +2175,6 @@ function ConfirmStep({
1994
2175
  walletClient,
1995
2176
  address,
1996
2177
  smartAccount,
1997
- recipient,
1998
2178
  asset,
1999
2179
  amount,
2000
2180
  balance,
@@ -2125,19 +2305,19 @@ function ConfirmStep({
2125
2305
  setIsSwitching(false);
2126
2306
  }
2127
2307
  };
2128
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "rs-step", children: [
2129
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: { padding: "12px 12px 10px" }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "rs-step-title", children: "Review order" }) }),
2130
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "rs-step-body rs-space-y-3", style: { paddingTop: 0 }, children: [
2131
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "rs-card", children: [
2132
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "rs-card-row", children: [
2133
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "rs-card-label", children: "Source" }),
2134
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2308
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "rs-step", children: [
2309
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { padding: "12px 12px 10px" }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "rs-step-title", children: "Review order" }) }),
2310
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "rs-step-body rs-space-y-3", style: { paddingTop: 0 }, children: [
2311
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "rs-card", children: [
2312
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "rs-card-row", children: [
2313
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "rs-card-label", children: "Source" }),
2314
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
2135
2315
  "span",
2136
2316
  {
2137
2317
  className: "rs-card-value",
2138
2318
  style: { display: "flex", alignItems: "center", gap: 8 },
2139
2319
  children: [
2140
- getChainIcon(asset.chainId) && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2320
+ getChainIcon(asset.chainId) && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2141
2321
  "img",
2142
2322
  {
2143
2323
  src: getChainIcon(asset.chainId),
@@ -2150,15 +2330,15 @@ function ConfirmStep({
2150
2330
  }
2151
2331
  )
2152
2332
  ] }),
2153
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "rs-card-row", children: [
2154
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "rs-card-label", children: "Destination" }),
2155
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2333
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "rs-card-row", children: [
2334
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "rs-card-label", children: "Destination" }),
2335
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
2156
2336
  "span",
2157
2337
  {
2158
2338
  className: "rs-card-value",
2159
2339
  style: { display: "flex", alignItems: "center", gap: 8 },
2160
2340
  children: [
2161
- getChainIcon(targetChain) && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2341
+ getChainIcon(targetChain) && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2162
2342
  "img",
2163
2343
  {
2164
2344
  src: getChainIcon(targetChain),
@@ -2171,21 +2351,21 @@ function ConfirmStep({
2171
2351
  }
2172
2352
  )
2173
2353
  ] }),
2174
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "rs-card-row", children: [
2175
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "rs-card-label", children: "Estimated time" }),
2176
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "rs-card-value", children: "< 1 min" })
2354
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "rs-card-row", children: [
2355
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "rs-card-label", children: "Estimated time" }),
2356
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "rs-card-value", children: "< 1 min" })
2177
2357
  ] })
2178
2358
  ] }),
2179
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "rs-card", children: [
2180
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "rs-card-row", children: [
2181
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "rs-card-label", children: "You send" }),
2182
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2359
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "rs-card", children: [
2360
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "rs-card-row", children: [
2361
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "rs-card-label", children: "You send" }),
2362
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
2183
2363
  "span",
2184
2364
  {
2185
2365
  className: "rs-card-value",
2186
2366
  style: { display: "flex", alignItems: "center", gap: 6 },
2187
2367
  children: [
2188
- getTokenIcon(asset.symbol) && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2368
+ getTokenIcon(asset.symbol) && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2189
2369
  "img",
2190
2370
  {
2191
2371
  src: getTokenIcon(asset.symbol),
@@ -2200,15 +2380,15 @@ function ConfirmStep({
2200
2380
  }
2201
2381
  )
2202
2382
  ] }),
2203
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "rs-card-row", children: [
2204
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "rs-card-label", children: "You receive" }),
2205
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2383
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "rs-card-row", children: [
2384
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "rs-card-label", children: "You receive" }),
2385
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
2206
2386
  "span",
2207
2387
  {
2208
2388
  className: "rs-card-value",
2209
2389
  style: { display: "flex", alignItems: "center", gap: 6 },
2210
2390
  children: [
2211
- getTokenIcon(targetSymbol) && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2391
+ getTokenIcon(targetSymbol) && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2212
2392
  "img",
2213
2393
  {
2214
2394
  src: getTokenIcon(targetSymbol),
@@ -2223,18 +2403,18 @@ function ConfirmStep({
2223
2403
  }
2224
2404
  )
2225
2405
  ] }),
2226
- receiveAmountUsd !== null && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "rs-card-row", children: [
2227
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "rs-card-label", children: "Value" }),
2228
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "rs-card-value", children: currencyFormatter.format(receiveAmountUsd) })
2406
+ receiveAmountUsd !== null && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "rs-card-row", children: [
2407
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "rs-card-label", children: "Value" }),
2408
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "rs-card-value", children: currencyFormatter.format(receiveAmountUsd) })
2229
2409
  ] })
2230
2410
  ] }),
2231
- chainMismatch && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "rs-chain-switch", children: [
2232
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "rs-chain-switch-text", children: [
2411
+ chainMismatch && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "rs-chain-switch", children: [
2412
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "rs-chain-switch-text", children: [
2233
2413
  "Switch your wallet to ",
2234
2414
  getChainName(asset.chainId),
2235
2415
  " to sign."
2236
2416
  ] }),
2237
- switchChain && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2417
+ switchChain && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2238
2418
  Button,
2239
2419
  {
2240
2420
  variant: "outline",
@@ -2245,8 +2425,8 @@ function ConfirmStep({
2245
2425
  }
2246
2426
  )
2247
2427
  ] }),
2248
- error && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "rs-alert rs-alert--error", children: [
2249
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2428
+ error && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "rs-alert rs-alert--error", children: [
2429
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2250
2430
  "svg",
2251
2431
  {
2252
2432
  className: "rs-alert-icon",
@@ -2254,7 +2434,7 @@ function ConfirmStep({
2254
2434
  fill: "none",
2255
2435
  stroke: "currentColor",
2256
2436
  strokeWidth: "2",
2257
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2437
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2258
2438
  "path",
2259
2439
  {
2260
2440
  strokeLinecap: "round",
@@ -2264,7 +2444,7 @@ function ConfirmStep({
2264
2444
  )
2265
2445
  }
2266
2446
  ),
2267
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2447
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2268
2448
  "span",
2269
2449
  {
2270
2450
  className: "rs-alert-text",
@@ -2279,7 +2459,7 @@ function ConfirmStep({
2279
2459
  )
2280
2460
  ] })
2281
2461
  ] }),
2282
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "rs-step-footer", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2462
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "rs-step-footer", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2283
2463
  Button,
2284
2464
  {
2285
2465
  onClick: handleConfirm,
@@ -2289,10 +2469,10 @@ function ConfirmStep({
2289
2469
  children: "Confirm Order"
2290
2470
  }
2291
2471
  ) }),
2292
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(PoweredBy, {})
2472
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PoweredBy, {})
2293
2473
  ] });
2294
2474
  }
2295
- var import_react5, import_viem5, import_jsx_runtime9, STABLECOIN_SYMBOLS;
2475
+ var import_react5, import_viem5, import_jsx_runtime10, STABLECOIN_SYMBOLS;
2296
2476
  var init_ConfirmStep = __esm({
2297
2477
  "src/components/steps/ConfirmStep.tsx"() {
2298
2478
  "use strict";
@@ -2303,35 +2483,43 @@ var init_ConfirmStep = __esm({
2303
2483
  init_deposit_service();
2304
2484
  init_constants();
2305
2485
  init_formatters();
2306
- import_jsx_runtime9 = require("react/jsx-runtime");
2486
+ import_jsx_runtime10 = require("react/jsx-runtime");
2307
2487
  STABLECOIN_SYMBOLS = /* @__PURE__ */ new Set(["USDC", "USDT", "DAI"]);
2308
2488
  }
2309
2489
  });
2310
2490
 
2311
- // src/components/steps/ProcessingStep.tsx
2491
+ // src/core/webhook.ts
2492
+ function isRecord(value) {
2493
+ return typeof value === "object" && value !== null;
2494
+ }
2495
+ function asString(value) {
2496
+ return typeof value === "string" ? value : void 0;
2497
+ }
2312
2498
  function getEventTxHash(event) {
2313
2499
  if (!event?.type) return void 0;
2314
2500
  if (event.type === "deposit-received") {
2315
- const data = event.data;
2316
- return typeof data?.transactionHash === "string" ? data.transactionHash : void 0;
2501
+ return asString(event.data?.transactionHash);
2317
2502
  }
2318
2503
  if (event.type === "bridge-started" || event.type === "bridge-complete") {
2319
- const data = event.data;
2320
- const txHash = data?.source?.transactionHash;
2321
- return typeof txHash === "string" ? txHash : void 0;
2504
+ const source = isRecord(event.data?.source) ? event.data.source : void 0;
2505
+ return asString(source?.transactionHash);
2322
2506
  }
2323
- if (event.type === "bridge-failed") {
2324
- const data = event.data;
2325
- const txHash = data?.deposit?.transactionHash;
2326
- return typeof txHash === "string" ? txHash : void 0;
2327
- }
2328
- if (event.type === "error") {
2329
- const data = event.data;
2330
- const txHash = data?.deposit?.transactionHash;
2331
- return typeof txHash === "string" ? txHash : void 0;
2507
+ if (event.type === "bridge-failed" || event.type === "error") {
2508
+ const deposit = isRecord(event.data?.deposit) ? event.data.deposit : void 0;
2509
+ return asString(deposit?.transactionHash);
2332
2510
  }
2333
2511
  return void 0;
2334
2512
  }
2513
+ function isDepositEvent(event) {
2514
+ return event?.type === "deposit-received" || event?.type === "bridge-started";
2515
+ }
2516
+ var init_webhook = __esm({
2517
+ "src/core/webhook.ts"() {
2518
+ "use strict";
2519
+ }
2520
+ });
2521
+
2522
+ // src/components/steps/ProcessingStep.tsx
2335
2523
  function isEventForTx(event, txHash) {
2336
2524
  const eventTxHash = getEventTxHash(event);
2337
2525
  if (!eventTxHash) return false;
@@ -2513,7 +2701,6 @@ function ProcessingStep({
2513
2701
  const secs = seconds % 60;
2514
2702
  return `${mins}m ${secs}s`;
2515
2703
  };
2516
- const sourceSymbol = getTokenSymbol(sourceToken, sourceChain);
2517
2704
  const targetSymbol = getTokenSymbol(targetToken, targetChain);
2518
2705
  const sourceDecimals = getTokenDecimalsByAddress(sourceToken, sourceChain);
2519
2706
  const formattedReceivedAmount = (() => {
@@ -2529,17 +2716,17 @@ function ProcessingStep({
2529
2716
  }
2530
2717
  })();
2531
2718
  if (isComplete) {
2532
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "rs-step", children: [
2533
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "rs-step-body rs-space-y-3", children: [
2534
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "rs-success-state", children: [
2535
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "rs-success-checkmark", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2719
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "rs-step", children: [
2720
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "rs-step-body rs-space-y-3", children: [
2721
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "rs-success-state", children: [
2722
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "rs-success-checkmark", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2536
2723
  "svg",
2537
2724
  {
2538
2725
  viewBox: "0 0 24 24",
2539
2726
  fill: "none",
2540
2727
  stroke: "currentColor",
2541
2728
  strokeWidth: "2.5",
2542
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2729
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2543
2730
  "path",
2544
2731
  {
2545
2732
  strokeLinecap: "round",
@@ -2549,13 +2736,13 @@ function ProcessingStep({
2549
2736
  )
2550
2737
  }
2551
2738
  ) }),
2552
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "rs-success-title", children: isEarlyComplete ? `${flowCapitalized} confirmed` : `${flowCapitalized} successful` }),
2553
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "rs-success-subtitle", children: isEarlyComplete ? "Your transfer has been confirmed and funds will arrive shortly." : `Your funds have been successfully bridged.` })
2739
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "rs-success-title", children: isEarlyComplete ? `${flowCapitalized} confirmed` : `${flowCapitalized} successful` }),
2740
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "rs-success-subtitle", children: isEarlyComplete ? "Your transfer has been confirmed and funds will arrive shortly." : `Your funds have been successfully bridged.` })
2554
2741
  ] }),
2555
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "rs-card", children: [
2556
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "rs-card-row", children: [
2557
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "rs-card-label", children: "Status" }),
2558
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2742
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "rs-card", children: [
2743
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "rs-card-row", children: [
2744
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "rs-card-label", children: "Status" }),
2745
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2559
2746
  "span",
2560
2747
  {
2561
2748
  className: "rs-card-value",
@@ -2564,29 +2751,29 @@ function ProcessingStep({
2564
2751
  }
2565
2752
  )
2566
2753
  ] }),
2567
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "rs-card-row", children: [
2568
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "rs-card-label", children: "Total time" }),
2569
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "rs-card-value", children: formatElapsedTime(elapsedSeconds) })
2754
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "rs-card-row", children: [
2755
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "rs-card-label", children: "Total time" }),
2756
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "rs-card-value", children: formatElapsedTime(elapsedSeconds) })
2570
2757
  ] }),
2571
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "rs-card-row", children: [
2572
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "rs-card-label", children: "You received" }),
2573
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "rs-card-value", children: [
2758
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "rs-card-row", children: [
2759
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "rs-card-label", children: "You received" }),
2760
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "rs-card-value", children: [
2574
2761
  formattedReceivedAmount,
2575
2762
  " ",
2576
2763
  targetSymbol
2577
2764
  ] })
2578
2765
  ] })
2579
2766
  ] }),
2580
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "rs-card", children: [
2581
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "rs-card-row", children: [
2582
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "rs-card-label", children: "Source" }),
2583
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
2767
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "rs-card", children: [
2768
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "rs-card-row", children: [
2769
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "rs-card-label", children: "Source" }),
2770
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
2584
2771
  "span",
2585
2772
  {
2586
2773
  className: "rs-card-value",
2587
2774
  style: { display: "flex", alignItems: "center", gap: 6 },
2588
2775
  children: [
2589
- getChainIcon(sourceChain) && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2776
+ getChainIcon(sourceChain) && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2590
2777
  "img",
2591
2778
  {
2592
2779
  src: getChainIcon(sourceChain),
@@ -2599,15 +2786,15 @@ function ProcessingStep({
2599
2786
  }
2600
2787
  )
2601
2788
  ] }),
2602
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "rs-card-row", children: [
2603
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "rs-card-label", children: "Destination" }),
2604
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
2789
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "rs-card-row", children: [
2790
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "rs-card-label", children: "Destination" }),
2791
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
2605
2792
  "span",
2606
2793
  {
2607
2794
  className: "rs-card-value",
2608
2795
  style: { display: "flex", alignItems: "center", gap: 6 },
2609
2796
  children: [
2610
- getChainIcon(targetChain) && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2797
+ getChainIcon(targetChain) && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2611
2798
  "img",
2612
2799
  {
2613
2800
  src: getChainIcon(targetChain),
@@ -2620,9 +2807,9 @@ function ProcessingStep({
2620
2807
  }
2621
2808
  )
2622
2809
  ] }),
2623
- sourceExplorerUrl && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "rs-card-row", children: [
2624
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "rs-card-label", children: "Transaction" }),
2625
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
2810
+ sourceExplorerUrl && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "rs-card-row", children: [
2811
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "rs-card-label", children: "Transaction" }),
2812
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
2626
2813
  "a",
2627
2814
  {
2628
2815
  href: sourceExplorerUrl,
@@ -2631,7 +2818,7 @@ function ProcessingStep({
2631
2818
  className: "rs-link rs-link-external rs-font-mono rs-text-xs",
2632
2819
  children: [
2633
2820
  truncateHash(txHash),
2634
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2821
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2635
2822
  "svg",
2636
2823
  {
2637
2824
  viewBox: "0 0 24 24",
@@ -2639,7 +2826,7 @@ function ProcessingStep({
2639
2826
  stroke: "currentColor",
2640
2827
  strokeWidth: "2.5",
2641
2828
  style: { width: 12, height: 12 },
2642
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2829
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2643
2830
  "path",
2644
2831
  {
2645
2832
  strokeLinecap: "round",
@@ -2653,9 +2840,9 @@ function ProcessingStep({
2653
2840
  }
2654
2841
  )
2655
2842
  ] }),
2656
- destinationTxHash && destExplorerUrl && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "rs-card-row", children: [
2657
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "rs-card-label", children: "Destination tx" }),
2658
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
2843
+ destinationTxHash && destExplorerUrl && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "rs-card-row", children: [
2844
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "rs-card-label", children: "Destination tx" }),
2845
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
2659
2846
  "a",
2660
2847
  {
2661
2848
  href: destExplorerUrl,
@@ -2664,7 +2851,7 @@ function ProcessingStep({
2664
2851
  className: "rs-link rs-link-external rs-font-mono rs-text-xs",
2665
2852
  children: [
2666
2853
  truncateHash(destinationTxHash),
2667
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2854
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2668
2855
  "svg",
2669
2856
  {
2670
2857
  viewBox: "0 0 24 24",
@@ -2672,7 +2859,7 @@ function ProcessingStep({
2672
2859
  stroke: "currentColor",
2673
2860
  strokeWidth: "2.5",
2674
2861
  style: { width: 12, height: 12 },
2675
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2862
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2676
2863
  "path",
2677
2864
  {
2678
2865
  strokeLinecap: "round",
@@ -2688,31 +2875,31 @@ function ProcessingStep({
2688
2875
  ] })
2689
2876
  ] })
2690
2877
  ] }),
2691
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "rs-step-footer", style: { gap: 8, display: "flex" }, children: [
2692
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { variant: "outline", onClick: onClose, fullWidth: true, children: "Close" }),
2693
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Button, { onClick: onNewDeposit, fullWidth: true, children: [
2878
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "rs-step-footer", style: { gap: 8, display: "flex" }, children: [
2879
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Button, { variant: "outline", onClick: onClose, fullWidth: true, children: "Close" }),
2880
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Button, { onClick: onNewDeposit, fullWidth: true, children: [
2694
2881
  "New ",
2695
2882
  flowNoun
2696
2883
  ] })
2697
2884
  ] }),
2698
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PoweredBy, {})
2885
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(PoweredBy, {})
2699
2886
  ] });
2700
2887
  }
2701
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "rs-step", children: [
2702
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "rs-step-header", children: [
2703
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "rs-step-header-row", children: [
2704
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2888
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "rs-step", children: [
2889
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "rs-step-header", children: [
2890
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "rs-step-header-row", children: [
2891
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2705
2892
  "div",
2706
2893
  {
2707
2894
  className: `rs-step-icon ${isError ? "rs-step-icon--error" : "rs-step-icon--accent"}`,
2708
- children: isError ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2895
+ children: isError ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2709
2896
  "svg",
2710
2897
  {
2711
2898
  viewBox: "0 0 24 24",
2712
2899
  fill: "none",
2713
2900
  stroke: "currentColor",
2714
2901
  strokeWidth: "2",
2715
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2902
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2716
2903
  "path",
2717
2904
  {
2718
2905
  strokeLinecap: "round",
@@ -2721,10 +2908,10 @@ function ProcessingStep({
2721
2908
  }
2722
2909
  )
2723
2910
  }
2724
- ) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Spinner, {})
2911
+ ) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Spinner, {})
2725
2912
  }
2726
2913
  ),
2727
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2914
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2728
2915
  "div",
2729
2916
  {
2730
2917
  className: `rs-step-title ${isError ? "rs-step-title--error" : ""}`,
@@ -2732,7 +2919,7 @@ function ProcessingStep({
2732
2919
  }
2733
2920
  )
2734
2921
  ] }),
2735
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
2922
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
2736
2923
  "div",
2737
2924
  {
2738
2925
  className: `rs-step-description ${isError ? "rs-text-error" : "rs-text-secondary"}`,
@@ -2744,11 +2931,11 @@ function ProcessingStep({
2744
2931
  }
2745
2932
  )
2746
2933
  ] }),
2747
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "rs-step-body rs-space-y-3", children: [
2748
- isProcessing && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
2749
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "rs-progress-bar", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "rs-progress-bar-fill rs-progress-bar-fill--indeterminate" }) }),
2750
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "rs-alert rs-alert--info", children: [
2751
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2934
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "rs-step-body rs-space-y-3", children: [
2935
+ isProcessing && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
2936
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "rs-progress-bar", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "rs-progress-bar-fill rs-progress-bar-fill--indeterminate" }) }),
2937
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "rs-alert rs-alert--info", children: [
2938
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2752
2939
  "svg",
2753
2940
  {
2754
2941
  className: "rs-alert-icon",
@@ -2756,7 +2943,7 @@ function ProcessingStep({
2756
2943
  fill: "none",
2757
2944
  stroke: "currentColor",
2758
2945
  strokeWidth: "2",
2759
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2946
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2760
2947
  "path",
2761
2948
  {
2762
2949
  strokeLinecap: "round",
@@ -2766,13 +2953,13 @@ function ProcessingStep({
2766
2953
  )
2767
2954
  }
2768
2955
  ),
2769
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("p", { className: "rs-alert-text", children: [
2956
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { className: "rs-alert-text", children: [
2770
2957
  "You can safely close this window. Your ",
2771
2958
  flowNoun,
2772
2959
  " will complete in the background."
2773
2960
  ] })
2774
2961
  ] }),
2775
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
2962
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
2776
2963
  "div",
2777
2964
  {
2778
2965
  className: "rs-text-sm rs-text-tertiary",
@@ -2784,16 +2971,16 @@ function ProcessingStep({
2784
2971
  }
2785
2972
  )
2786
2973
  ] }),
2787
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "rs-card", children: [
2788
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "rs-card-row", children: [
2789
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "rs-card-label", children: "Source" }),
2790
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
2974
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "rs-card", children: [
2975
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "rs-card-row", children: [
2976
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "rs-card-label", children: "Source" }),
2977
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
2791
2978
  "span",
2792
2979
  {
2793
2980
  className: "rs-card-value",
2794
2981
  style: { display: "flex", alignItems: "center", gap: 8 },
2795
2982
  children: [
2796
- getChainIcon(sourceChain) && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2983
+ getChainIcon(sourceChain) && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2797
2984
  "img",
2798
2985
  {
2799
2986
  src: getChainIcon(sourceChain),
@@ -2806,15 +2993,15 @@ function ProcessingStep({
2806
2993
  }
2807
2994
  )
2808
2995
  ] }),
2809
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "rs-card-row", children: [
2810
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "rs-card-label", children: "Destination" }),
2811
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
2996
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "rs-card-row", children: [
2997
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "rs-card-label", children: "Destination" }),
2998
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
2812
2999
  "span",
2813
3000
  {
2814
3001
  className: "rs-card-value",
2815
3002
  style: { display: "flex", alignItems: "center", gap: 8 },
2816
3003
  children: [
2817
- getChainIcon(targetChain) && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3004
+ getChainIcon(targetChain) && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2818
3005
  "img",
2819
3006
  {
2820
3007
  src: getChainIcon(targetChain),
@@ -2827,9 +3014,9 @@ function ProcessingStep({
2827
3014
  }
2828
3015
  )
2829
3016
  ] }),
2830
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "rs-card-row", children: [
2831
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "rs-card-label", children: "Transaction" }),
2832
- sourceExplorerUrl ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3017
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "rs-card-row", children: [
3018
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "rs-card-label", children: "Transaction" }),
3019
+ sourceExplorerUrl ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
2833
3020
  "a",
2834
3021
  {
2835
3022
  href: sourceExplorerUrl,
@@ -2838,14 +3025,14 @@ function ProcessingStep({
2838
3025
  className: "rs-link rs-link-external rs-font-mono rs-text-xs",
2839
3026
  children: [
2840
3027
  truncateHash(txHash),
2841
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3028
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2842
3029
  "svg",
2843
3030
  {
2844
3031
  viewBox: "0 0 24 24",
2845
3032
  fill: "none",
2846
3033
  stroke: "currentColor",
2847
3034
  strokeWidth: "2.5",
2848
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3035
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2849
3036
  "path",
2850
3037
  {
2851
3038
  strokeLinecap: "round",
@@ -2857,18 +3044,18 @@ function ProcessingStep({
2857
3044
  )
2858
3045
  ]
2859
3046
  }
2860
- ) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "rs-card-value rs-card-value--mono", children: truncateHash(txHash) })
3047
+ ) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "rs-card-value rs-card-value--mono", children: truncateHash(txHash) })
2861
3048
  ] })
2862
3049
  ] })
2863
3050
  ] }),
2864
- isError && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "rs-step-footer", style: { gap: 8, display: "flex" }, children: [
2865
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { variant: "outline", onClick: onClose, fullWidth: true, children: "Close" }),
2866
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { onClick: onNewDeposit, fullWidth: true, children: "Try Again" })
3051
+ isError && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "rs-step-footer", style: { gap: 8, display: "flex" }, children: [
3052
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Button, { variant: "outline", onClick: onClose, fullWidth: true, children: "Close" }),
3053
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Button, { onClick: onNewDeposit, fullWidth: true, children: "Try Again" })
2867
3054
  ] }),
2868
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PoweredBy, {})
3055
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(PoweredBy, {})
2869
3056
  ] });
2870
3057
  }
2871
- var import_react6, import_viem6, import_jsx_runtime10, INITIAL_POLL_INTERVAL, MAX_POLL_INTERVAL, BACKOFF_MULTIPLIER, PROCESS_TIMEOUT_MS;
3058
+ var import_react6, import_viem6, import_jsx_runtime11, INITIAL_POLL_INTERVAL, MAX_POLL_INTERVAL, BACKOFF_MULTIPLIER, PROCESS_TIMEOUT_MS;
2872
3059
  var init_ProcessingStep = __esm({
2873
3060
  "src/components/steps/ProcessingStep.tsx"() {
2874
3061
  "use strict";
@@ -2877,8 +3064,9 @@ var init_ProcessingStep = __esm({
2877
3064
  init_Button();
2878
3065
  init_PoweredBy();
2879
3066
  init_Spinner();
3067
+ init_webhook();
2880
3068
  init_constants();
2881
- import_jsx_runtime10 = require("react/jsx-runtime");
3069
+ import_jsx_runtime11 = require("react/jsx-runtime");
2882
3070
  INITIAL_POLL_INTERVAL = 3e3;
2883
3071
  MAX_POLL_INTERVAL = 3e4;
2884
3072
  BACKOFF_MULTIPLIER = 1.5;
@@ -2920,7 +3108,7 @@ function QRCode({
2920
3108
  }, [value, size, iconSrc]);
2921
3109
  const iconSize = size * 0.22;
2922
3110
  const iconOffset = (size - iconSize) / 2;
2923
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
3111
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
2924
3112
  "svg",
2925
3113
  {
2926
3114
  viewBox: `0 0 ${size} ${size}`,
@@ -2930,10 +3118,10 @@ function QRCode({
2930
3118
  role: "img",
2931
3119
  "aria-label": "QR Code",
2932
3120
  children: [
2933
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("rect", { width: size, height: size, fill: "white", rx: 4 }),
2934
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("path", { d: svgContent.paths, fill: "black" }),
2935
- iconSrc && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
2936
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3121
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("rect", { width: size, height: size, fill: "white", rx: 4 }),
3122
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("path", { d: svgContent.paths, fill: "black" }),
3123
+ iconSrc && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
3124
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2937
3125
  "rect",
2938
3126
  {
2939
3127
  x: iconOffset - 4,
@@ -2944,7 +3132,7 @@ function QRCode({
2944
3132
  rx: 8
2945
3133
  }
2946
3134
  ),
2947
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3135
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2948
3136
  "image",
2949
3137
  {
2950
3138
  href: iconSrc,
@@ -2959,18 +3147,58 @@ function QRCode({
2959
3147
  }
2960
3148
  );
2961
3149
  }
2962
- var import_react7, import_qrcode_generator, import_jsx_runtime11;
3150
+ var import_react7, import_qrcode_generator, import_jsx_runtime12;
2963
3151
  var init_QRCode = __esm({
2964
3152
  "src/components/ui/QRCode.tsx"() {
2965
3153
  "use strict";
2966
3154
  import_react7 = require("react");
2967
3155
  import_qrcode_generator = __toESM(require("qrcode-generator"), 1);
2968
- import_jsx_runtime11 = require("react/jsx-runtime");
3156
+ import_jsx_runtime12 = require("react/jsx-runtime");
2969
3157
  QRCode.displayName = "QRCode";
2970
3158
  }
2971
3159
  });
2972
3160
 
2973
3161
  // src/components/steps/DepositAddressStep.tsx
3162
+ function isRecord2(value) {
3163
+ return typeof value === "object" && value !== null;
3164
+ }
3165
+ function asNumber(value) {
3166
+ if (typeof value === "number" && Number.isFinite(value)) return value;
3167
+ if (typeof value === "string" && value.trim() !== "") {
3168
+ const parsed = Number(value);
3169
+ return Number.isFinite(parsed) ? parsed : void 0;
3170
+ }
3171
+ return void 0;
3172
+ }
3173
+ function asAmount(value) {
3174
+ if (typeof value === "string") return value;
3175
+ if (typeof value === "number" && Number.isFinite(value)) {
3176
+ return value.toString();
3177
+ }
3178
+ return void 0;
3179
+ }
3180
+ function asAddress(value) {
3181
+ if (typeof value !== "string") return void 0;
3182
+ return /^0x[a-fA-F0-9]{40}$/.test(value) ? value : void 0;
3183
+ }
3184
+ function getDepositEventDetails(event) {
3185
+ if (!event?.type || !isRecord2(event.data)) return {};
3186
+ if (event.type === "deposit-received") {
3187
+ return {
3188
+ chainId: asNumber(event.data.chain),
3189
+ amount: asAmount(event.data.amount),
3190
+ token: asAddress(event.data.token)
3191
+ };
3192
+ }
3193
+ if (event.type === "bridge-started") {
3194
+ const source = isRecord2(event.data.source) ? event.data.source : void 0;
3195
+ return {
3196
+ chainId: asNumber(source?.chain),
3197
+ token: asAddress(source?.asset)
3198
+ };
3199
+ }
3200
+ return {};
3201
+ }
2974
3202
  function DepositAddressStep({
2975
3203
  smartAccount,
2976
3204
  service,
@@ -2978,16 +3206,15 @@ function DepositAddressStep({
2978
3206
  onError
2979
3207
  }) {
2980
3208
  const supportedChainIds = (0, import_react8.useMemo)(() => getSupportedChainIds(), []);
2981
- const [sourceChainId, setSourceChainId] = (0, import_react8.useState)(
2982
- supportedChainIds[0]
2983
- );
3209
+ const BASE_CHAIN_ID = 8453;
3210
+ const defaultChainId = supportedChainIds.includes(BASE_CHAIN_ID) ? BASE_CHAIN_ID : supportedChainIds[0];
3211
+ const [sourceChainId, setSourceChainId] = (0, import_react8.useState)(defaultChainId);
2984
3212
  const tokensForChain = (0, import_react8.useMemo)(
2985
3213
  () => getSupportedTokenSymbolsForChain(sourceChainId),
2986
3214
  [sourceChainId]
2987
3215
  );
2988
- const [sourceTokenSymbol, setSourceTokenSymbol] = (0, import_react8.useState)(
2989
- tokensForChain[0] ?? "USDC"
2990
- );
3216
+ const defaultToken = tokensForChain.includes("USDC") ? "USDC" : tokensForChain[0] ?? "USDC";
3217
+ const [sourceTokenSymbol, setSourceTokenSymbol] = (0, import_react8.useState)(defaultToken);
2991
3218
  (0, import_react8.useEffect)(() => {
2992
3219
  if (!tokensForChain.includes(sourceTokenSymbol)) {
2993
3220
  setSourceTokenSymbol(tokensForChain[0] ?? "USDC");
@@ -2998,6 +3225,16 @@ function DepositAddressStep({
2998
3225
  const [chainDropdownOpen, setChainDropdownOpen] = (0, import_react8.useState)(false);
2999
3226
  const [tokenDropdownOpen, setTokenDropdownOpen] = (0, import_react8.useState)(false);
3000
3227
  const depositHandledRef = (0, import_react8.useRef)(false);
3228
+ const sourceSelectionRef = (0, import_react8.useRef)({
3229
+ chainId: defaultChainId,
3230
+ tokenSymbol: defaultToken
3231
+ });
3232
+ (0, import_react8.useEffect)(() => {
3233
+ sourceSelectionRef.current = {
3234
+ chainId: sourceChainId,
3235
+ tokenSymbol: sourceTokenSymbol
3236
+ };
3237
+ }, [sourceChainId, sourceTokenSymbol]);
3001
3238
  const handleCopy = (0, import_react8.useCallback)(async () => {
3002
3239
  try {
3003
3240
  await navigator.clipboard.writeText(smartAccount);
@@ -3022,32 +3259,24 @@ function DepositAddressStep({
3022
3259
  let timeoutId;
3023
3260
  let cancelled = false;
3024
3261
  let baselineTxHash = void 0;
3025
- function extractDepositTxHash(event) {
3026
- if (event?.type !== "deposit-received" || !event.data) return null;
3027
- const hash = event.data.transactionHash;
3028
- return typeof hash === "string" ? hash : null;
3029
- }
3030
3262
  async function poll() {
3031
3263
  if (cancelled || depositHandledRef.current) return;
3032
3264
  try {
3033
3265
  const status = await service.fetchLatestStatus(smartAccount);
3034
3266
  if (cancelled || depositHandledRef.current) return;
3035
3267
  const event = status.lastEvent;
3036
- const eventTxHash = extractDepositTxHash(event);
3268
+ const eventTxHash = isDepositEvent(event) ? getEventTxHash(event)?.toLowerCase() ?? null : null;
3037
3269
  if (baselineTxHash === void 0) {
3038
3270
  baselineTxHash = eventTxHash;
3039
- } else if (eventTxHash && eventTxHash !== baselineTxHash && event?.data) {
3040
- const chainId = event.data.chain;
3041
- const amount = event.data.amount;
3042
- const token = event.data.token;
3043
- if (chainId && amount && token) {
3271
+ } else if (eventTxHash && eventTxHash !== baselineTxHash) {
3272
+ const details = getDepositEventDetails(event);
3273
+ const fallback = sourceSelectionRef.current;
3274
+ const chainId = details.chainId ?? fallback.chainId;
3275
+ const amount = details.amount ?? "0";
3276
+ const token = details.token ?? getTokenAddress(fallback.tokenSymbol, fallback.chainId);
3277
+ if (token) {
3044
3278
  depositHandledRef.current = true;
3045
- onDepositDetected(
3046
- eventTxHash,
3047
- chainId,
3048
- amount,
3049
- token
3050
- );
3279
+ onDepositDetected(eventTxHash, chainId, amount, token);
3051
3280
  return;
3052
3281
  }
3053
3282
  }
@@ -3070,12 +3299,12 @@ function DepositAddressStep({
3070
3299
  };
3071
3300
  }, [smartAccount, service, onDepositDetected, onError]);
3072
3301
  const chainIconSrc = getChainIcon(sourceChainId);
3073
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "rs-step", children: [
3074
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "rs-deposit-address", children: [
3075
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "rs-deposit-address-selectors", children: [
3076
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "rs-deposit-address-dropdown", children: [
3077
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "rs-deposit-address-dropdown-label", children: "Supported token" }),
3078
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
3302
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "rs-step", children: [
3303
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "rs-step-body", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "rs-deposit-address", children: [
3304
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "rs-deposit-address-selectors", children: [
3305
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "rs-deposit-address-dropdown", children: [
3306
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "rs-deposit-address-dropdown-label", children: "Supported token" }),
3307
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
3079
3308
  "button",
3080
3309
  {
3081
3310
  type: "button",
@@ -3085,7 +3314,7 @@ function DepositAddressStep({
3085
3314
  setChainDropdownOpen(false);
3086
3315
  },
3087
3316
  children: [
3088
- getTokenIcon(sourceTokenSymbol) && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3317
+ getTokenIcon(sourceTokenSymbol) && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
3089
3318
  "img",
3090
3319
  {
3091
3320
  src: getTokenIcon(sourceTokenSymbol),
@@ -3093,8 +3322,8 @@ function DepositAddressStep({
3093
3322
  className: "rs-deposit-address-dropdown-icon"
3094
3323
  }
3095
3324
  ),
3096
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: sourceTokenSymbol }),
3097
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3325
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: sourceTokenSymbol }),
3326
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
3098
3327
  "svg",
3099
3328
  {
3100
3329
  className: "rs-deposit-address-dropdown-chevron",
@@ -3102,7 +3331,7 @@ function DepositAddressStep({
3102
3331
  fill: "none",
3103
3332
  stroke: "currentColor",
3104
3333
  strokeWidth: "2",
3105
- children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3334
+ children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
3106
3335
  "path",
3107
3336
  {
3108
3337
  strokeLinecap: "round",
@@ -3115,7 +3344,7 @@ function DepositAddressStep({
3115
3344
  ]
3116
3345
  }
3117
3346
  ),
3118
- tokenDropdownOpen && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "rs-deposit-address-dropdown-menu", children: tokensForChain.map((symbol) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
3347
+ tokenDropdownOpen && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "rs-deposit-address-dropdown-menu", children: tokensForChain.map((symbol) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
3119
3348
  "button",
3120
3349
  {
3121
3350
  type: "button",
@@ -3125,7 +3354,7 @@ function DepositAddressStep({
3125
3354
  setTokenDropdownOpen(false);
3126
3355
  },
3127
3356
  children: [
3128
- getTokenIcon(symbol) && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3357
+ getTokenIcon(symbol) && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
3129
3358
  "img",
3130
3359
  {
3131
3360
  src: getTokenIcon(symbol),
@@ -3133,15 +3362,15 @@ function DepositAddressStep({
3133
3362
  className: "rs-deposit-address-dropdown-icon"
3134
3363
  }
3135
3364
  ),
3136
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: symbol })
3365
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: symbol })
3137
3366
  ]
3138
3367
  },
3139
3368
  symbol
3140
3369
  )) })
3141
3370
  ] }),
3142
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "rs-deposit-address-dropdown", children: [
3143
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
3144
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
3371
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "rs-deposit-address-dropdown", children: [
3372
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
3373
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
3145
3374
  "button",
3146
3375
  {
3147
3376
  type: "button",
@@ -3151,7 +3380,7 @@ function DepositAddressStep({
3151
3380
  setTokenDropdownOpen(false);
3152
3381
  },
3153
3382
  children: [
3154
- getChainIcon(sourceChainId) && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3383
+ getChainIcon(sourceChainId) && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
3155
3384
  "img",
3156
3385
  {
3157
3386
  src: getChainIcon(sourceChainId),
@@ -3159,8 +3388,8 @@ function DepositAddressStep({
3159
3388
  className: "rs-deposit-address-dropdown-icon"
3160
3389
  }
3161
3390
  ),
3162
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: getChainName(sourceChainId) }),
3163
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3391
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: getChainName(sourceChainId) }),
3392
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
3164
3393
  "svg",
3165
3394
  {
3166
3395
  className: "rs-deposit-address-dropdown-chevron",
@@ -3168,7 +3397,7 @@ function DepositAddressStep({
3168
3397
  fill: "none",
3169
3398
  stroke: "currentColor",
3170
3399
  strokeWidth: "2",
3171
- children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3400
+ children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
3172
3401
  "path",
3173
3402
  {
3174
3403
  strokeLinecap: "round",
@@ -3181,7 +3410,7 @@ function DepositAddressStep({
3181
3410
  ]
3182
3411
  }
3183
3412
  ),
3184
- chainDropdownOpen && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "rs-deposit-address-dropdown-menu", children: supportedChainIds.map((chainId) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
3413
+ chainDropdownOpen && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "rs-deposit-address-dropdown-menu", children: supportedChainIds.map((chainId) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
3185
3414
  "button",
3186
3415
  {
3187
3416
  type: "button",
@@ -3191,7 +3420,7 @@ function DepositAddressStep({
3191
3420
  setChainDropdownOpen(false);
3192
3421
  },
3193
3422
  children: [
3194
- getChainIcon(chainId) && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3423
+ getChainIcon(chainId) && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
3195
3424
  "img",
3196
3425
  {
3197
3426
  src: getChainIcon(chainId),
@@ -3199,32 +3428,25 @@ function DepositAddressStep({
3199
3428
  className: "rs-deposit-address-dropdown-icon"
3200
3429
  }
3201
3430
  ),
3202
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: getChainName(chainId) })
3431
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: getChainName(chainId) })
3203
3432
  ]
3204
3433
  },
3205
3434
  chainId
3206
3435
  )) })
3207
3436
  ] })
3208
3437
  ] }),
3209
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "rs-deposit-address-qr", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3210
- QRCode,
3211
- {
3212
- value: smartAccount,
3213
- size: 200,
3214
- iconSrc: chainIconSrc
3215
- }
3216
- ) }),
3217
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "rs-deposit-address-info", children: [
3218
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "rs-deposit-address-label", children: "Your deposit address" }),
3219
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "rs-deposit-address-value", children: smartAccount }),
3220
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
3438
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "rs-deposit-address-qr", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(QRCode, { value: smartAccount, size: 200, iconSrc: chainIconSrc }) }),
3439
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "rs-deposit-address-info", children: [
3440
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "rs-deposit-address-label", children: "Your deposit address" }),
3441
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "rs-deposit-address-value", children: smartAccount }),
3442
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
3221
3443
  "button",
3222
3444
  {
3223
3445
  type: "button",
3224
3446
  className: "rs-deposit-address-copy",
3225
3447
  onClick: handleCopy,
3226
3448
  children: [
3227
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3449
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
3228
3450
  "svg",
3229
3451
  {
3230
3452
  viewBox: "0 0 24 24",
@@ -3232,14 +3454,14 @@ function DepositAddressStep({
3232
3454
  stroke: "currentColor",
3233
3455
  strokeWidth: "2",
3234
3456
  style: { width: 14, height: 14 },
3235
- children: copied ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3457
+ children: copied ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
3236
3458
  "path",
3237
3459
  {
3238
3460
  strokeLinecap: "round",
3239
3461
  strokeLinejoin: "round",
3240
3462
  d: "M5 12l5 5L20 7"
3241
3463
  }
3242
- ) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3464
+ ) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
3243
3465
  "path",
3244
3466
  {
3245
3467
  strokeLinecap: "round",
@@ -3254,12 +3476,12 @@ function DepositAddressStep({
3254
3476
  }
3255
3477
  )
3256
3478
  ] }),
3257
- pollingError && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "rs-deposit-address-error", children: pollingError })
3258
- ] }),
3259
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(PoweredBy, {})
3479
+ pollingError && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "rs-deposit-address-error", children: pollingError })
3480
+ ] }) }),
3481
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(PoweredBy, {})
3260
3482
  ] });
3261
3483
  }
3262
- var import_react8, import_jsx_runtime12, POLL_INTERVAL_MS;
3484
+ var import_react8, import_jsx_runtime13, POLL_INTERVAL_MS;
3263
3485
  var init_DepositAddressStep = __esm({
3264
3486
  "src/components/steps/DepositAddressStep.tsx"() {
3265
3487
  "use strict";
@@ -3267,7 +3489,8 @@ var init_DepositAddressStep = __esm({
3267
3489
  init_QRCode();
3268
3490
  init_PoweredBy();
3269
3491
  init_constants();
3270
- import_jsx_runtime12 = require("react/jsx-runtime");
3492
+ init_webhook();
3493
+ import_jsx_runtime13 = require("react/jsx-runtime");
3271
3494
  POLL_INTERVAL_MS = 4e3;
3272
3495
  DepositAddressStep.displayName = "DepositAddressStep";
3273
3496
  }
@@ -3334,6 +3557,13 @@ function DepositFlow({
3334
3557
  setIsConnectSelectionConfirmed(false);
3335
3558
  }
3336
3559
  }, [hasConnectWalletOptions]);
3560
+ const handleBackFromDepositAddress = (0, import_react9.useCallback)(() => {
3561
+ setFlowMode(null);
3562
+ setStep({ type: "setup" });
3563
+ if (hasConnectWalletOptions) {
3564
+ setIsConnectSelectionConfirmed(false);
3565
+ }
3566
+ }, [hasConnectWalletOptions]);
3337
3567
  const handleBackFromConfirm = (0, import_react9.useCallback)(() => {
3338
3568
  setStep((prev) => {
3339
3569
  if (prev.type !== "confirm") return prev;
@@ -3346,7 +3576,7 @@ function DepositFlow({
3346
3576
  });
3347
3577
  }, []);
3348
3578
  const stepIndex = step.type === "setup" ? 0 : step.type === "deposit-address" ? 1 : step.type === "select-asset" ? 1 : step.type === "amount" ? 2 : step.type === "confirm" ? 3 : 4;
3349
- const currentBackHandler = step.type === "select-asset" && hasConnectedWallet && hasConnectWalletOptions && isConnectSelectionConfirmed ? handleBackFromSelectAsset : step.type === "amount" ? handleBackFromAmount : step.type === "confirm" ? handleBackFromConfirm : void 0;
3579
+ const currentBackHandler = step.type === "deposit-address" ? handleBackFromDepositAddress : step.type === "select-asset" && hasConnectedWallet && hasConnectWalletOptions && isConnectSelectionConfirmed ? handleBackFromSelectAsset : step.type === "amount" ? handleBackFromAmount : step.type === "confirm" ? handleBackFromConfirm : void 0;
3350
3580
  (0, import_react9.useEffect)(() => {
3351
3581
  onStepChange?.(stepIndex, currentBackHandler);
3352
3582
  }, [stepIndex, currentBackHandler, onStepChange]);
@@ -3485,7 +3715,7 @@ function DepositFlow({
3485
3715
  setIsConnectSelectionConfirmed(false);
3486
3716
  }, [connectWalletOptionsKey, selectedConnectAddressEffective]);
3487
3717
  if (showConnectStep) {
3488
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "rs-modal-body", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
3718
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "rs-modal-body", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
3489
3719
  ConnectStep,
3490
3720
  {
3491
3721
  walletOptions: connectWalletOptions,
@@ -3509,8 +3739,8 @@ function DepositFlow({
3509
3739
  return null;
3510
3740
  }
3511
3741
  if (isDepositAddressMode) {
3512
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "rs-modal-body", children: [
3513
- step.type === "setup" && targetChainObj && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
3742
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "rs-modal-body", children: [
3743
+ step.type === "setup" && targetChainObj && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
3514
3744
  SetupStep,
3515
3745
  {
3516
3746
  walletClient,
@@ -3528,7 +3758,7 @@ function DepositFlow({
3528
3758
  onError: handleError
3529
3759
  }
3530
3760
  ),
3531
- step.type === "deposit-address" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
3761
+ step.type === "deposit-address" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
3532
3762
  DepositAddressStep,
3533
3763
  {
3534
3764
  smartAccount: step.smartAccount,
@@ -3537,7 +3767,7 @@ function DepositFlow({
3537
3767
  onError: handleError
3538
3768
  }
3539
3769
  ),
3540
- step.type === "processing" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
3770
+ step.type === "processing" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
3541
3771
  ProcessingStep,
3542
3772
  {
3543
3773
  smartAccount: step.smartAccount,
@@ -3558,8 +3788,8 @@ function DepositFlow({
3558
3788
  )
3559
3789
  ] });
3560
3790
  }
3561
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "rs-modal-body", children: [
3562
- step.type === "setup" && targetChainObj && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
3791
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "rs-modal-body", children: [
3792
+ step.type === "setup" && targetChainObj && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
3563
3793
  SetupStep,
3564
3794
  {
3565
3795
  walletClient,
@@ -3577,13 +3807,11 @@ function DepositFlow({
3577
3807
  onError: handleError
3578
3808
  }
3579
3809
  ),
3580
- step.type === "select-asset" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
3810
+ step.type === "select-asset" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
3581
3811
  AssetSelectStep,
3582
3812
  {
3583
3813
  address,
3584
3814
  publicClient,
3585
- smartAccount: step.smartAccount,
3586
- recipient,
3587
3815
  defaultSourceChain,
3588
3816
  defaultSourceToken,
3589
3817
  service,
@@ -3591,14 +3819,12 @@ function DepositFlow({
3591
3819
  onTotalBalanceComputed: handleTotalBalanceComputed
3592
3820
  }
3593
3821
  ),
3594
- step.type === "amount" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
3822
+ step.type === "amount" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
3595
3823
  AmountStep,
3596
3824
  {
3597
3825
  walletClient,
3598
3826
  publicClient,
3599
3827
  address,
3600
- smartAccount: step.smartAccount,
3601
- recipient,
3602
3828
  asset: step.asset,
3603
3829
  defaultAmount: step.amount ?? defaultAmount,
3604
3830
  switchChain,
@@ -3608,13 +3834,12 @@ function DepositFlow({
3608
3834
  onContinue: handleAmountContinue
3609
3835
  }
3610
3836
  ),
3611
- step.type === "confirm" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
3837
+ step.type === "confirm" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
3612
3838
  ConfirmStep,
3613
3839
  {
3614
3840
  walletClient,
3615
3841
  address,
3616
3842
  smartAccount: step.smartAccount,
3617
- recipient,
3618
3843
  asset: step.asset,
3619
3844
  amount: step.amount,
3620
3845
  balance: step.balance,
@@ -3626,7 +3851,7 @@ function DepositFlow({
3626
3851
  onError: handleError
3627
3852
  }
3628
3853
  ),
3629
- step.type === "processing" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
3854
+ step.type === "processing" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
3630
3855
  ProcessingStep,
3631
3856
  {
3632
3857
  smartAccount: step.smartAccount,
@@ -3647,7 +3872,7 @@ function DepositFlow({
3647
3872
  )
3648
3873
  ] });
3649
3874
  }
3650
- var import_react9, import_jsx_runtime13;
3875
+ var import_react9, import_jsx_runtime14;
3651
3876
  var init_DepositFlow = __esm({
3652
3877
  "src/DepositFlow.tsx"() {
3653
3878
  "use strict";
@@ -3660,7 +3885,7 @@ var init_DepositFlow = __esm({
3660
3885
  init_ProcessingStep();
3661
3886
  init_DepositAddressStep();
3662
3887
  init_constants();
3663
- import_jsx_runtime13 = require("react/jsx-runtime");
3888
+ import_jsx_runtime14 = require("react/jsx-runtime");
3664
3889
  }
3665
3890
  });
3666
3891
 
@@ -3749,7 +3974,7 @@ function ReownWalletProvider({
3749
3974
  const [queryClient] = (0, import_react10.useState)(() => new import_react_query.QueryClient());
3750
3975
  const adapter = getOrCreateAdapter(projectId, theme);
3751
3976
  const config = adapter.wagmiConfig;
3752
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_wagmi.WagmiProvider, { config, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_query.QueryClientProvider, { client: queryClient, children }) });
3977
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_wagmi.WagmiProvider, { config, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_query.QueryClientProvider, { client: queryClient, children }) });
3753
3978
  }
3754
3979
  function useReownWallet() {
3755
3980
  const { open } = (0, import_react11.useAppKit)();
@@ -3836,7 +4061,7 @@ function useResolvedWallet(host, reown) {
3836
4061
  switchChain: handleSwitchChain
3837
4062
  };
3838
4063
  }
3839
- var import_react10, import_react_query, import_appkit_adapter_wagmi, import_wagmi, import_react11, import_networks, import_wagmi2, import_jsx_runtime14, NETWORKS, cachedAdapter, cachedProjectId;
4064
+ var import_react10, import_react_query, import_appkit_adapter_wagmi, import_wagmi, import_react11, import_networks, import_wagmi2, import_jsx_runtime15, NETWORKS, cachedAdapter, cachedProjectId;
3840
4065
  var init_reown = __esm({
3841
4066
  "src/core/reown.tsx"() {
3842
4067
  "use strict";
@@ -3847,7 +4072,7 @@ var init_reown = __esm({
3847
4072
  import_react11 = require("@reown/appkit/react");
3848
4073
  import_networks = require("@reown/appkit/networks");
3849
4074
  import_wagmi2 = require("wagmi");
3850
- import_jsx_runtime14 = require("react/jsx-runtime");
4075
+ import_jsx_runtime15 = require("react/jsx-runtime");
3851
4076
  NETWORKS = [
3852
4077
  import_networks.mainnet,
3853
4078
  import_networks.base,
@@ -3880,7 +4105,7 @@ function DepositModalWithReown(props) {
3880
4105
  const handleConnect = (0, import_react12.useCallback)(() => {
3881
4106
  reown.openConnect();
3882
4107
  }, [reown.openConnect]);
3883
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
4108
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3884
4109
  DepositModalInner,
3885
4110
  {
3886
4111
  ...props,
@@ -3897,16 +4122,16 @@ function DepositModalWithReown(props) {
3897
4122
  );
3898
4123
  }
3899
4124
  function DepositModalReown(props) {
3900
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ReownWalletProvider, { projectId: props.reownAppId, theme: props.theme, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DepositModalWithReown, { ...props }) });
4125
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ReownWalletProvider, { projectId: props.reownAppId, theme: props.theme, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DepositModalWithReown, { ...props }) });
3901
4126
  }
3902
- var import_react12, import_jsx_runtime15;
4127
+ var import_react12, import_jsx_runtime16;
3903
4128
  var init_DepositModalReown = __esm({
3904
4129
  "src/DepositModalReown.tsx"() {
3905
4130
  "use strict";
3906
4131
  import_react12 = require("react");
3907
4132
  init_reown();
3908
4133
  init_DepositModal();
3909
- import_jsx_runtime15 = require("react/jsx-runtime");
4134
+ import_jsx_runtime16 = require("react/jsx-runtime");
3910
4135
  }
3911
4136
  });
3912
4137
 
@@ -3914,9 +4139,9 @@ var init_DepositModalReown = __esm({
3914
4139
  function DepositModal(props) {
3915
4140
  const needsReown = !!props.reownAppId;
3916
4141
  if (needsReown) {
3917
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react13.Suspense, { fallback: null, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ReownDepositInner, { ...props }) });
4142
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react13.Suspense, { fallback: null, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ReownDepositInner, { ...props }) });
3918
4143
  }
3919
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DepositModalInner, { ...props });
4144
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DepositModalInner, { ...props });
3920
4145
  }
3921
4146
  function DepositModalInner({
3922
4147
  walletClient,
@@ -3998,30 +4223,30 @@ function DepositModalInner({
3998
4223
  const logoUrl = branding?.logoUrl ?? "https://github.com/rhinestonewtf.png";
3999
4224
  const title = branding?.title ?? "Deposit";
4000
4225
  const canGoBack = currentStepIndex > 0 && currentStepIndex < 4 && backHandlerRef.current !== void 0;
4001
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
4226
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4002
4227
  Modal,
4003
4228
  {
4004
4229
  isOpen,
4005
4230
  onClose,
4006
4231
  className,
4007
4232
  inline,
4008
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { ref: modalRef, className: "rs-modal", children: [
4009
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "rs-modal-header--redesigned", children: [
4010
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "rs-modal-header-nav-left", children: showBackButton && canGoBack && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
4233
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { ref: modalRef, className: "rs-modal", children: [
4234
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "rs-modal-header--redesigned", children: [
4235
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "rs-modal-header-nav-left", children: showBackButton && canGoBack && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4011
4236
  "button",
4012
4237
  {
4013
4238
  type: "button",
4014
4239
  className: "rs-modal-header-back",
4015
4240
  "aria-label": "Go back",
4016
4241
  onClick: handleBack,
4017
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
4242
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4018
4243
  "svg",
4019
4244
  {
4020
4245
  viewBox: "0 0 24 24",
4021
4246
  fill: "none",
4022
4247
  stroke: "currentColor",
4023
4248
  strokeWidth: "2",
4024
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
4249
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4025
4250
  "path",
4026
4251
  {
4027
4252
  strokeLinecap: "round",
@@ -4033,9 +4258,9 @@ function DepositModalInner({
4033
4258
  )
4034
4259
  }
4035
4260
  ) }),
4036
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "rs-modal-header-nav-center", children: [
4037
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "rs-modal-header-title-row", children: [
4038
- showLogo && logoUrl && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
4261
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "rs-modal-header-nav-center", children: [
4262
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "rs-modal-header-title-row", children: [
4263
+ showLogo && logoUrl && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4039
4264
  "img",
4040
4265
  {
4041
4266
  src: logoUrl,
@@ -4046,8 +4271,8 @@ function DepositModalInner({
4046
4271
  }
4047
4272
  }
4048
4273
  ),
4049
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "rs-modal-header-title", children: title }),
4050
- showStepper && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "rs-modal-progress", style: { marginLeft: 8 }, children: [0, 1, 2, 3, 4].map((i) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
4274
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "rs-modal-header-title", children: title }),
4275
+ showStepper && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "rs-modal-progress", style: { marginLeft: 8 }, children: [0, 1, 2, 3, 4].map((i) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4051
4276
  "div",
4052
4277
  {
4053
4278
  className: `rs-modal-progress-dot ${i <= currentStepIndex ? "rs-modal-progress-dot--active" : "rs-modal-progress-dot--inactive"}`
@@ -4055,29 +4280,29 @@ function DepositModalInner({
4055
4280
  i
4056
4281
  )) })
4057
4282
  ] }),
4058
- balanceTitle && totalBalanceUsd !== null && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "rs-modal-header-balance", children: [
4059
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { children: [
4283
+ balanceTitle && totalBalanceUsd !== null && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "rs-modal-header-balance", children: [
4284
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { children: [
4060
4285
  balanceTitle,
4061
4286
  ":"
4062
4287
  ] }),
4063
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "rs-modal-header-balance-value", children: currencyFormatter.format(totalBalanceUsd) })
4288
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "rs-modal-header-balance-value", children: currencyFormatter.format(totalBalanceUsd) })
4064
4289
  ] })
4065
4290
  ] }),
4066
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
4291
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4067
4292
  "button",
4068
4293
  {
4069
4294
  type: "button",
4070
4295
  onClick: onClose,
4071
4296
  className: "rs-modal-close",
4072
4297
  "aria-label": "Close",
4073
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
4298
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4074
4299
  "svg",
4075
4300
  {
4076
4301
  viewBox: "0 0 24 24",
4077
4302
  fill: "none",
4078
4303
  stroke: "currentColor",
4079
4304
  strokeWidth: "2",
4080
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
4305
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4081
4306
  "path",
4082
4307
  {
4083
4308
  strokeLinecap: "round",
@@ -4090,7 +4315,7 @@ function DepositModalInner({
4090
4315
  }
4091
4316
  ) })
4092
4317
  ] }),
4093
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
4318
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4094
4319
  DepositFlow,
4095
4320
  {
4096
4321
  walletClient,
@@ -4129,7 +4354,7 @@ function DepositModalInner({
4129
4354
  }
4130
4355
  );
4131
4356
  }
4132
- var import_react13, import_jsx_runtime16, ReownDepositInner;
4357
+ var import_react13, import_jsx_runtime17, ReownDepositInner;
4133
4358
  var init_DepositModal = __esm({
4134
4359
  "src/DepositModal.tsx"() {
4135
4360
  "use strict";
@@ -4140,7 +4365,7 @@ var init_DepositModal = __esm({
4140
4365
  init_constants();
4141
4366
  init_formatters();
4142
4367
  init_theme();
4143
- import_jsx_runtime16 = require("react/jsx-runtime");
4368
+ import_jsx_runtime17 = require("react/jsx-runtime");
4144
4369
  ReownDepositInner = (0, import_react13.lazy)(
4145
4370
  () => Promise.resolve().then(() => (init_DepositModalReown(), DepositModalReown_exports)).then((m) => ({ default: m.DepositModalReown }))
4146
4371
  );
@@ -4346,12 +4571,12 @@ function WithdrawFormStep({
4346
4571
  setIsSwitching(false);
4347
4572
  }
4348
4573
  };
4349
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "rs-step", children: [
4350
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "rs-step-body rs-withdraw-form", children: [
4351
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "rs-withdraw-section", children: [
4352
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("label", { className: "rs-withdraw-label", children: "Recipient" }),
4353
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "rs-withdraw-input-row", children: [
4354
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4574
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "rs-step", children: [
4575
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "rs-step-body rs-withdraw-form", children: [
4576
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "rs-withdraw-section", children: [
4577
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("label", { className: "rs-withdraw-label", children: "Recipient" }),
4578
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "rs-withdraw-input-row", children: [
4579
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
4355
4580
  "input",
4356
4581
  {
4357
4582
  type: "text",
@@ -4364,7 +4589,7 @@ function WithdrawFormStep({
4364
4589
  }
4365
4590
  }
4366
4591
  ),
4367
- address && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
4592
+ address && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
4368
4593
  "button",
4369
4594
  {
4370
4595
  type: "button",
@@ -4372,7 +4597,7 @@ function WithdrawFormStep({
4372
4597
  onClick: handleUseConnected,
4373
4598
  title: isRecipientConnected ? "Using connected wallet" : "Use connected wallet",
4374
4599
  children: [
4375
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4600
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
4376
4601
  "svg",
4377
4602
  {
4378
4603
  viewBox: "0 0 24 24",
@@ -4380,7 +4605,7 @@ function WithdrawFormStep({
4380
4605
  stroke: "currentColor",
4381
4606
  strokeWidth: "2",
4382
4607
  className: "rs-withdraw-use-connected-icon",
4383
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4608
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
4384
4609
  "path",
4385
4610
  {
4386
4611
  strokeLinecap: "round",
@@ -4396,10 +4621,10 @@ function WithdrawFormStep({
4396
4621
  )
4397
4622
  ] })
4398
4623
  ] }),
4399
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "rs-withdraw-section", children: [
4400
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("label", { className: "rs-withdraw-label", children: "Amount" }),
4401
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "rs-withdraw-input-row", children: [
4402
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4624
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "rs-withdraw-section", children: [
4625
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("label", { className: "rs-withdraw-label", children: "Amount" }),
4626
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "rs-withdraw-input-row", children: [
4627
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
4403
4628
  "input",
4404
4629
  {
4405
4630
  type: "text",
@@ -4416,9 +4641,9 @@ function WithdrawFormStep({
4416
4641
  }
4417
4642
  }
4418
4643
  ),
4419
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "rs-withdraw-amount-right", children: [
4420
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "rs-withdraw-token-label", children: asset.symbol }),
4421
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4644
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "rs-withdraw-amount-right", children: [
4645
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "rs-withdraw-token-label", children: asset.symbol }),
4646
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
4422
4647
  "button",
4423
4648
  {
4424
4649
  type: "button",
@@ -4430,25 +4655,25 @@ function WithdrawFormStep({
4430
4655
  )
4431
4656
  ] })
4432
4657
  ] }),
4433
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "rs-withdraw-amount-info", children: [
4434
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "rs-withdraw-usd", children: amountUsd !== null ? currencyFormatter.format(amountUsd) : "$0.00" }),
4435
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "rs-withdraw-balance", children: [
4658
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "rs-withdraw-amount-info", children: [
4659
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "rs-withdraw-usd", children: amountUsd !== null ? currencyFormatter.format(amountUsd) : "$0.00" }),
4660
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "rs-withdraw-balance", children: [
4436
4661
  formattedBalance,
4437
4662
  " ",
4438
4663
  asset.symbol
4439
4664
  ] })
4440
4665
  ] })
4441
4666
  ] }),
4442
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "rs-withdraw-receive-row", children: [
4443
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "rs-withdraw-receive-col", children: [
4444
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("label", { className: "rs-withdraw-label", children: "Receive" }),
4445
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
4667
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "rs-withdraw-receive-row", children: [
4668
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "rs-withdraw-receive-col", children: [
4669
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("label", { className: "rs-withdraw-label", children: "Receive" }),
4670
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
4446
4671
  "div",
4447
4672
  {
4448
4673
  className: "rs-withdraw-dropdown-container",
4449
4674
  ref: tokenDropdownRef,
4450
4675
  children: [
4451
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
4676
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
4452
4677
  "button",
4453
4678
  {
4454
4679
  type: "button",
@@ -4458,8 +4683,8 @@ function WithdrawFormStep({
4458
4683
  setShowChainDropdown(false);
4459
4684
  },
4460
4685
  children: [
4461
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "rs-withdraw-dropdown-value", children: [
4462
- getTokenIcon(targetSymbol) && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4686
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "rs-withdraw-dropdown-value", children: [
4687
+ getTokenIcon(targetSymbol) && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
4463
4688
  "img",
4464
4689
  {
4465
4690
  src: getTokenIcon(targetSymbol),
@@ -4467,9 +4692,9 @@ function WithdrawFormStep({
4467
4692
  className: "rs-withdraw-dropdown-icon"
4468
4693
  }
4469
4694
  ),
4470
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: targetSymbol })
4695
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: targetSymbol })
4471
4696
  ] }),
4472
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4697
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
4473
4698
  "svg",
4474
4699
  {
4475
4700
  viewBox: "0 0 24 24",
@@ -4480,7 +4705,7 @@ function WithdrawFormStep({
4480
4705
  style: {
4481
4706
  transform: showTokenDropdown ? "rotate(180deg)" : void 0
4482
4707
  },
4483
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4708
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
4484
4709
  "path",
4485
4710
  {
4486
4711
  strokeLinecap: "round",
@@ -4493,7 +4718,7 @@ function WithdrawFormStep({
4493
4718
  ]
4494
4719
  }
4495
4720
  ),
4496
- showTokenDropdown && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "rs-withdraw-dropdown-menu", children: targetTokenOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
4721
+ showTokenDropdown && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "rs-withdraw-dropdown-menu", children: targetTokenOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
4497
4722
  "button",
4498
4723
  {
4499
4724
  type: "button",
@@ -4503,7 +4728,7 @@ function WithdrawFormStep({
4503
4728
  setShowTokenDropdown(false);
4504
4729
  },
4505
4730
  children: [
4506
- getTokenIcon(option.symbol) && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4731
+ getTokenIcon(option.symbol) && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
4507
4732
  "img",
4508
4733
  {
4509
4734
  src: getTokenIcon(option.symbol),
@@ -4511,7 +4736,7 @@ function WithdrawFormStep({
4511
4736
  className: "rs-withdraw-dropdown-icon"
4512
4737
  }
4513
4738
  ),
4514
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: option.symbol })
4739
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: option.symbol })
4515
4740
  ]
4516
4741
  },
4517
4742
  option.address
@@ -4520,15 +4745,15 @@ function WithdrawFormStep({
4520
4745
  }
4521
4746
  )
4522
4747
  ] }),
4523
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "rs-withdraw-receive-col", children: [
4524
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("label", { className: "rs-withdraw-label", children: "Chain" }),
4525
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
4748
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "rs-withdraw-receive-col", children: [
4749
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("label", { className: "rs-withdraw-label", children: "Chain" }),
4750
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
4526
4751
  "div",
4527
4752
  {
4528
4753
  className: "rs-withdraw-dropdown-container",
4529
4754
  ref: chainDropdownRef,
4530
4755
  children: [
4531
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
4756
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
4532
4757
  "button",
4533
4758
  {
4534
4759
  type: "button",
@@ -4538,8 +4763,8 @@ function WithdrawFormStep({
4538
4763
  setShowTokenDropdown(false);
4539
4764
  },
4540
4765
  children: [
4541
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "rs-withdraw-dropdown-value", children: [
4542
- getChainIcon(targetChain) && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4766
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "rs-withdraw-dropdown-value", children: [
4767
+ getChainIcon(targetChain) && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
4543
4768
  "img",
4544
4769
  {
4545
4770
  src: getChainIcon(targetChain),
@@ -4547,9 +4772,9 @@ function WithdrawFormStep({
4547
4772
  className: "rs-withdraw-dropdown-icon"
4548
4773
  }
4549
4774
  ),
4550
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: targetChainName })
4775
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: targetChainName })
4551
4776
  ] }),
4552
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4777
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
4553
4778
  "svg",
4554
4779
  {
4555
4780
  viewBox: "0 0 24 24",
@@ -4560,7 +4785,7 @@ function WithdrawFormStep({
4560
4785
  style: {
4561
4786
  transform: showChainDropdown ? "rotate(180deg)" : void 0
4562
4787
  },
4563
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4788
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
4564
4789
  "path",
4565
4790
  {
4566
4791
  strokeLinecap: "round",
@@ -4573,7 +4798,7 @@ function WithdrawFormStep({
4573
4798
  ]
4574
4799
  }
4575
4800
  ),
4576
- showChainDropdown && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "rs-withdraw-dropdown-menu", children: targetChains.map((chain) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
4801
+ showChainDropdown && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "rs-withdraw-dropdown-menu", children: targetChains.map((chain) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
4577
4802
  "button",
4578
4803
  {
4579
4804
  type: "button",
@@ -4583,7 +4808,7 @@ function WithdrawFormStep({
4583
4808
  setShowChainDropdown(false);
4584
4809
  },
4585
4810
  children: [
4586
- getChainIcon(chain.id) && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4811
+ getChainIcon(chain.id) && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
4587
4812
  "img",
4588
4813
  {
4589
4814
  src: getChainIcon(chain.id),
@@ -4591,7 +4816,7 @@ function WithdrawFormStep({
4591
4816
  className: "rs-withdraw-dropdown-icon"
4592
4817
  }
4593
4818
  ),
4594
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: chain.name })
4819
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: chain.name })
4595
4820
  ]
4596
4821
  },
4597
4822
  chain.id
@@ -4601,13 +4826,13 @@ function WithdrawFormStep({
4601
4826
  )
4602
4827
  ] })
4603
4828
  ] }),
4604
- chainMismatch && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "rs-chain-switch", children: [
4605
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "rs-chain-switch-text", children: [
4829
+ chainMismatch && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "rs-chain-switch", children: [
4830
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "rs-chain-switch-text", children: [
4606
4831
  "Switch to ",
4607
4832
  getChainName(asset.chainId),
4608
4833
  " to continue."
4609
4834
  ] }),
4610
- switchChain && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4835
+ switchChain && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
4611
4836
  Button,
4612
4837
  {
4613
4838
  variant: "outline",
@@ -4618,15 +4843,15 @@ function WithdrawFormStep({
4618
4843
  }
4619
4844
  )
4620
4845
  ] }),
4621
- error && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "rs-withdraw-error", children: [
4622
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4846
+ error && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "rs-withdraw-error", children: [
4847
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
4623
4848
  "svg",
4624
4849
  {
4625
4850
  viewBox: "0 0 24 24",
4626
4851
  fill: "none",
4627
4852
  stroke: "currentColor",
4628
4853
  strokeWidth: "2",
4629
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4854
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
4630
4855
  "path",
4631
4856
  {
4632
4857
  strokeLinecap: "round",
@@ -4636,10 +4861,10 @@ function WithdrawFormStep({
4636
4861
  )
4637
4862
  }
4638
4863
  ),
4639
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: error })
4864
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: error })
4640
4865
  ] })
4641
4866
  ] }),
4642
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "rs-step-footer", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4867
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "rs-step-footer", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
4643
4868
  Button,
4644
4869
  {
4645
4870
  onClick: handleWithdraw,
@@ -4649,10 +4874,10 @@ function WithdrawFormStep({
4649
4874
  children: isBusy ? "Preparing..." : "Withdraw"
4650
4875
  }
4651
4876
  ) }),
4652
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(PoweredBy, {})
4877
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(PoweredBy, {})
4653
4878
  ] });
4654
4879
  }
4655
- var import_react14, import_viem7, import_jsx_runtime17;
4880
+ var import_react14, import_viem7, import_jsx_runtime18;
4656
4881
  var init_WithdrawFormStep = __esm({
4657
4882
  "src/components/steps/WithdrawFormStep.tsx"() {
4658
4883
  "use strict";
@@ -4663,7 +4888,7 @@ var init_WithdrawFormStep = __esm({
4663
4888
  init_deposit_service();
4664
4889
  init_constants();
4665
4890
  init_formatters();
4666
- import_jsx_runtime17 = require("react/jsx-runtime");
4891
+ import_jsx_runtime18 = require("react/jsx-runtime");
4667
4892
  WithdrawFormStep.displayName = "WithdrawFormStep";
4668
4893
  }
4669
4894
  });
@@ -4918,7 +5143,6 @@ function WithdrawFlow({
4918
5143
  onWithdrawSign,
4919
5144
  onRequestConnect,
4920
5145
  connectButtonLabel,
4921
- uiConfig,
4922
5146
  onStepChange,
4923
5147
  onTotalBalanceChange,
4924
5148
  onClose,
@@ -4939,6 +5163,12 @@ function WithdrawFlow({
4939
5163
  setTargetToken(targetTokenProp);
4940
5164
  }, [targetChainProp, targetTokenProp]);
4941
5165
  const targetChainObj = (0, import_react15.useMemo)(() => CHAIN_BY_ID[targetChain], [targetChain]);
5166
+ const hasCustomSigner = Boolean(address && onWithdrawSign);
5167
+ const sourceChainObj = (0, import_react15.useMemo)(() => CHAIN_BY_ID[sourceChain], [sourceChain]);
5168
+ const effectivePublicClient = (0, import_react15.useMemo)(
5169
+ () => publicClient ?? (sourceChainObj ? (0, import_viem9.createPublicClient)({ chain: sourceChainObj, transport: (0, import_viem9.http)() }) : null),
5170
+ [publicClient, sourceChainObj]
5171
+ );
4942
5172
  const asset = (0, import_react15.useMemo)(() => {
4943
5173
  const symbol = getTokenSymbol(sourceToken, sourceChain);
4944
5174
  const decimals = getTokenDecimalsByAddress(sourceToken, sourceChain);
@@ -4989,7 +5219,10 @@ function WithdrawFlow({
4989
5219
  }, []);
4990
5220
  const handleFormSubmit = (0, import_react15.useCallback)(
4991
5221
  async (recipient, amountValue) => {
4992
- if (!walletClient || !publicClient || !address) {
5222
+ if (!address) {
5223
+ throw new Error("Wallet not connected");
5224
+ }
5225
+ if (!onWithdrawSign && (!walletClient || !publicClient)) {
4993
5226
  throw new Error("Wallet not connected");
4994
5227
  }
4995
5228
  if (!targetChainObj) {
@@ -4997,7 +5230,7 @@ function WithdrawFlow({
4997
5230
  }
4998
5231
  setIsSubmitting(true);
4999
5232
  try {
5000
- const signerAccount = (0, import_sdk3.walletClientToAccount)(walletClient);
5233
+ const signerAccount = walletClient ? (0, import_sdk3.walletClientToAccount)(walletClient) : createViewOnlyAccount(address);
5001
5234
  const sessionOwner = await resolveSessionOwner2(address);
5002
5235
  const account = await createSmartAccount(
5003
5236
  signerAccount,
@@ -5033,7 +5266,7 @@ function WithdrawFlow({
5033
5266
  });
5034
5267
  }
5035
5268
  handleConnected(address, smartAccount);
5036
- const amountUnits = (0, import_viem9.parseUnits)(amountValue, asset.decimals);
5269
+ const amountUnits = (0, import_viem10.parseUnits)(amountValue, asset.decimals);
5037
5270
  const result = onWithdrawSign ? await onWithdrawSign({
5038
5271
  safeAddress,
5039
5272
  recipient: smartAccount,
@@ -5163,13 +5396,15 @@ function WithdrawFlow({
5163
5396
  () => (connectWalletOptions ?? []).map((option) => option.address.toLowerCase()).join(","),
5164
5397
  [connectWalletOptions]
5165
5398
  );
5166
- const hasConnectedWallet = Boolean(walletClient && publicClient && address);
5167
- const showConnectStep = !hasConnectedWallet || hasConnectWalletOptions && !isConnectSelectionConfirmed;
5399
+ const hasConnectedWallet = Boolean(
5400
+ walletClient && publicClient && address || hasCustomSigner
5401
+ );
5402
+ const showConnectStep = !hasConnectedWallet || !hasCustomSigner && hasConnectWalletOptions && !isConnectSelectionConfirmed;
5168
5403
  (0, import_react15.useEffect)(() => {
5169
5404
  setIsConnectSelectionConfirmed(false);
5170
5405
  }, [connectWalletOptionsKey, selectedConnectAddressEffective]);
5171
5406
  if (showConnectStep) {
5172
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "rs-modal-body", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
5407
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "rs-modal-body", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
5173
5408
  ConnectStep,
5174
5409
  {
5175
5410
  walletOptions: connectWalletOptions,
@@ -5182,15 +5417,15 @@ function WithdrawFlow({
5182
5417
  }
5183
5418
  ) });
5184
5419
  }
5185
- if (!walletClient || !publicClient || !address) {
5420
+ if (!address || !effectivePublicClient) {
5186
5421
  return null;
5187
5422
  }
5188
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "rs-modal-body", children: [
5189
- step.type === "form" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
5423
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "rs-modal-body", children: [
5424
+ step.type === "form" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
5190
5425
  WithdrawFormStep,
5191
5426
  {
5192
5427
  walletClient,
5193
- publicClient,
5428
+ publicClient: effectivePublicClient,
5194
5429
  address,
5195
5430
  safeAddress,
5196
5431
  asset,
@@ -5208,7 +5443,7 @@ function WithdrawFlow({
5208
5443
  onBalanceUsdChange: setTotalBalanceUsd
5209
5444
  }
5210
5445
  ),
5211
- step.type === "processing" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
5446
+ step.type === "processing" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
5212
5447
  ProcessingStep,
5213
5448
  {
5214
5449
  smartAccount: step.smartAccount,
@@ -5230,11 +5465,12 @@ function WithdrawFlow({
5230
5465
  )
5231
5466
  ] });
5232
5467
  }
5233
- var import_react15, import_sdk3, import_viem9, import_jsx_runtime18;
5468
+ var import_react15, import_viem9, import_sdk3, import_viem10, import_jsx_runtime19;
5234
5469
  var init_WithdrawFlow = __esm({
5235
5470
  "src/WithdrawFlow.tsx"() {
5236
5471
  "use strict";
5237
5472
  import_react15 = require("react");
5473
+ import_viem9 = require("viem");
5238
5474
  init_ConnectStep();
5239
5475
  init_WithdrawFormStep();
5240
5476
  init_ProcessingStep();
@@ -5244,8 +5480,8 @@ var init_WithdrawFlow = __esm({
5244
5480
  init_account();
5245
5481
  init_session_owner();
5246
5482
  init_safe();
5247
- import_viem9 = require("viem");
5248
- import_jsx_runtime18 = require("react/jsx-runtime");
5483
+ import_viem10 = require("viem");
5484
+ import_jsx_runtime19 = require("react/jsx-runtime");
5249
5485
  }
5250
5486
  });
5251
5487
 
@@ -5268,7 +5504,7 @@ function WithdrawModalWithReown(props) {
5268
5504
  const handleConnect = (0, import_react16.useCallback)(() => {
5269
5505
  reown.openConnect();
5270
5506
  }, [reown.openConnect]);
5271
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
5507
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
5272
5508
  WithdrawModalInner,
5273
5509
  {
5274
5510
  ...props,
@@ -5285,16 +5521,16 @@ function WithdrawModalWithReown(props) {
5285
5521
  );
5286
5522
  }
5287
5523
  function WithdrawModalReown(props) {
5288
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ReownWalletProvider, { projectId: props.reownAppId, theme: props.theme, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(WithdrawModalWithReown, { ...props }) });
5524
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ReownWalletProvider, { projectId: props.reownAppId, theme: props.theme, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(WithdrawModalWithReown, { ...props }) });
5289
5525
  }
5290
- var import_react16, import_jsx_runtime19;
5526
+ var import_react16, import_jsx_runtime20;
5291
5527
  var init_WithdrawModalReown = __esm({
5292
5528
  "src/WithdrawModalReown.tsx"() {
5293
5529
  "use strict";
5294
5530
  import_react16 = require("react");
5295
5531
  init_reown();
5296
5532
  init_WithdrawModal();
5297
- import_jsx_runtime19 = require("react/jsx-runtime");
5533
+ import_jsx_runtime20 = require("react/jsx-runtime");
5298
5534
  }
5299
5535
  });
5300
5536
 
@@ -5302,9 +5538,9 @@ var init_WithdrawModalReown = __esm({
5302
5538
  function WithdrawModal(props) {
5303
5539
  const needsReown = !!props.reownAppId;
5304
5540
  if (needsReown) {
5305
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react17.Suspense, { fallback: null, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ReownWithdrawInner, { ...props }) });
5541
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react17.Suspense, { fallback: null, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ReownWithdrawInner, { ...props }) });
5306
5542
  }
5307
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(WithdrawModalInner, { ...props });
5543
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(WithdrawModalInner, { ...props });
5308
5544
  }
5309
5545
  function WithdrawModalInner({
5310
5546
  walletClient,
@@ -5388,30 +5624,30 @@ function WithdrawModalInner({
5388
5624
  const logoUrl = branding?.logoUrl ?? "https://github.com/rhinestonewtf.png";
5389
5625
  const title = branding?.title ?? "Withdraw";
5390
5626
  const canGoBack = currentStepIndex > 0 && currentStepIndex < 3 && backHandlerRef.current;
5391
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
5627
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
5392
5628
  Modal,
5393
5629
  {
5394
5630
  isOpen,
5395
5631
  onClose,
5396
5632
  className,
5397
5633
  inline,
5398
- children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { ref: modalRef, className: "rs-modal", children: [
5399
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "rs-modal-header--redesigned", children: [
5400
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "rs-modal-header-nav-left", children: showBackButton && canGoBack && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
5634
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { ref: modalRef, className: "rs-modal", children: [
5635
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "rs-modal-header--redesigned", children: [
5636
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "rs-modal-header-nav-left", children: showBackButton && canGoBack && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
5401
5637
  "button",
5402
5638
  {
5403
5639
  type: "button",
5404
5640
  className: "rs-modal-header-back",
5405
5641
  "aria-label": "Go back",
5406
5642
  onClick: handleBack,
5407
- children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
5643
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
5408
5644
  "svg",
5409
5645
  {
5410
5646
  viewBox: "0 0 24 24",
5411
5647
  fill: "none",
5412
5648
  stroke: "currentColor",
5413
5649
  strokeWidth: "2",
5414
- children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
5650
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
5415
5651
  "path",
5416
5652
  {
5417
5653
  strokeLinecap: "round",
@@ -5423,9 +5659,9 @@ function WithdrawModalInner({
5423
5659
  )
5424
5660
  }
5425
5661
  ) }),
5426
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "rs-modal-header-nav-center", children: [
5427
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "rs-modal-header-title-row", children: [
5428
- showLogo && logoUrl && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
5662
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "rs-modal-header-nav-center", children: [
5663
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "rs-modal-header-title-row", children: [
5664
+ showLogo && logoUrl && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
5429
5665
  "img",
5430
5666
  {
5431
5667
  src: logoUrl,
@@ -5436,8 +5672,8 @@ function WithdrawModalInner({
5436
5672
  }
5437
5673
  }
5438
5674
  ),
5439
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "rs-modal-header-title", children: title }),
5440
- showStepper && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "rs-modal-progress", style: { marginLeft: 8 }, children: [0, 1].map((i) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
5675
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "rs-modal-header-title", children: title }),
5676
+ showStepper && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "rs-modal-progress", style: { marginLeft: 8 }, children: [0, 1].map((i) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
5441
5677
  "div",
5442
5678
  {
5443
5679
  className: `rs-modal-progress-dot ${i <= currentStepIndex ? "rs-modal-progress-dot--active" : "rs-modal-progress-dot--inactive"}`
@@ -5445,26 +5681,26 @@ function WithdrawModalInner({
5445
5681
  i
5446
5682
  )) })
5447
5683
  ] }),
5448
- balanceTitle && totalBalanceUsd !== null && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "rs-modal-header-balance", children: [
5449
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "rs-modal-header-balance-label", children: balanceTitle }),
5450
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "rs-modal-header-balance-value", children: currencyFormatter.format(totalBalanceUsd) })
5684
+ balanceTitle && totalBalanceUsd !== null && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "rs-modal-header-balance", children: [
5685
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "rs-modal-header-balance-label", children: balanceTitle }),
5686
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "rs-modal-header-balance-value", children: currencyFormatter.format(totalBalanceUsd) })
5451
5687
  ] })
5452
5688
  ] }),
5453
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
5689
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
5454
5690
  "button",
5455
5691
  {
5456
5692
  type: "button",
5457
5693
  onClick: onClose,
5458
5694
  className: "rs-modal-close",
5459
5695
  "aria-label": "Close",
5460
- children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
5696
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
5461
5697
  "svg",
5462
5698
  {
5463
5699
  viewBox: "0 0 24 24",
5464
5700
  fill: "none",
5465
5701
  stroke: "currentColor",
5466
5702
  strokeWidth: "2",
5467
- children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
5703
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
5468
5704
  "path",
5469
5705
  {
5470
5706
  strokeLinecap: "round",
@@ -5477,7 +5713,7 @@ function WithdrawModalInner({
5477
5713
  }
5478
5714
  ) })
5479
5715
  ] }),
5480
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
5716
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
5481
5717
  WithdrawFlow,
5482
5718
  {
5483
5719
  walletClient,
@@ -5503,7 +5739,6 @@ function WithdrawModalInner({
5503
5739
  onWithdrawSign,
5504
5740
  onRequestConnect,
5505
5741
  connectButtonLabel,
5506
- uiConfig,
5507
5742
  onStepChange: handleStepChange,
5508
5743
  onTotalBalanceChange: handleTotalBalanceChange,
5509
5744
  onClose,
@@ -5518,7 +5753,7 @@ function WithdrawModalInner({
5518
5753
  }
5519
5754
  );
5520
5755
  }
5521
- var import_react17, import_jsx_runtime20, ReownWithdrawInner;
5756
+ var import_react17, import_jsx_runtime21, ReownWithdrawInner;
5522
5757
  var init_WithdrawModal = __esm({
5523
5758
  "src/WithdrawModal.tsx"() {
5524
5759
  "use strict";
@@ -5529,7 +5764,7 @@ var init_WithdrawModal = __esm({
5529
5764
  init_constants();
5530
5765
  init_theme();
5531
5766
  init_formatters();
5532
- import_jsx_runtime20 = require("react/jsx-runtime");
5767
+ import_jsx_runtime21 = require("react/jsx-runtime");
5533
5768
  ReownWithdrawInner = (0, import_react17.lazy)(
5534
5769
  () => Promise.resolve().then(() => (init_WithdrawModalReown(), WithdrawModalReown_exports)).then((m) => ({
5535
5770
  default: m.WithdrawModalReown