@rhinestone/deposit-modal 0.1.64 → 0.1.66

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.
@@ -21,7 +21,7 @@
21
21
 
22
22
 
23
23
 
24
- var _chunk5SR5N75Icjs = require('./chunk-5SR5N75I.cjs');
24
+ var _chunkJZWCK7C3cjs = require('./chunk-JZWCK7C3.cjs');
25
25
 
26
26
 
27
27
 
@@ -127,7 +127,7 @@ function WithdrawFormStep({
127
127
  setIsSwitching(true);
128
128
  switchChain(asset.chainId).catch((err) => {
129
129
  const raw = err instanceof Error ? err.message : "Failed to switch chain";
130
- setError(_chunk5SR5N75Icjs.formatUserError.call(void 0, raw));
130
+ setError(_chunkJZWCK7C3cjs.formatUserError.call(void 0, raw));
131
131
  }).finally(() => {
132
132
  setIsSwitching(false);
133
133
  });
@@ -147,7 +147,7 @@ function WithdrawFormStep({
147
147
  return;
148
148
  }
149
149
  try {
150
- const bal = _chunk5SR5N75Icjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: safeAddress }) : await publicClient.readContract({
150
+ const bal = _chunkJZWCK7C3cjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: safeAddress }) : await publicClient.readContract({
151
151
  address: asset.token,
152
152
  abi: _viem.erc20Abi,
153
153
  functionName: "balanceOf",
@@ -250,7 +250,7 @@ function WithdrawFormStep({
250
250
  await onSubmit(recipient, amount);
251
251
  } catch (err) {
252
252
  const raw = err instanceof Error ? err.message : "Withdrawal failed";
253
- setError(_chunk5SR5N75Icjs.formatUserError.call(void 0, raw));
253
+ setError(_chunkJZWCK7C3cjs.formatUserError.call(void 0, raw));
254
254
  } finally {
255
255
  setIsSubmitting(false);
256
256
  }
@@ -258,11 +258,11 @@ function WithdrawFormStep({
258
258
  if (isBalanceLoading) {
259
259
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
260
260
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step-body rs-withdraw-loading", children: [
261
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5SR5N75Icjs.Spinner, { className: "rs-spinner--lg" }),
261
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJZWCK7C3cjs.Spinner, { className: "rs-spinner--lg" }),
262
262
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-title", children: "Loading on-chain balance" }),
263
263
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-subtitle", children: chainMismatch ? `Switch to ${_chunkR6U6BHCVcjs.getChainName.call(void 0, asset.chainId)} to continue.` : "Please wait before withdrawing." })
264
264
  ] }),
265
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5SR5N75Icjs.PoweredBy, {})
265
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJZWCK7C3cjs.PoweredBy, {})
266
266
  ] });
267
267
  }
268
268
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
@@ -361,7 +361,7 @@ function WithdrawFormStep({
361
361
  ] })
362
362
  ] }),
363
363
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-amount-info", children: [
364
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ? _chunk5SR5N75Icjs.currencyFormatter.format(amountUsd) : "$0.00" }),
364
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ? _chunkJZWCK7C3cjs.currencyFormatter.format(amountUsd) : "$0.00" }),
365
365
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-withdraw-balance", children: [
366
366
  "Balance: ",
367
367
  formattedBalance,
@@ -555,7 +555,7 @@ function WithdrawFormStep({
555
555
  ] })
556
556
  ] }),
557
557
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
558
- _chunk5SR5N75Icjs.Button,
558
+ _chunkJZWCK7C3cjs.Button,
559
559
  {
560
560
  onClick: handleWithdraw,
561
561
  fullWidth: true,
@@ -564,7 +564,7 @@ function WithdrawFormStep({
564
564
  children: isBusy ? "Preparing..." : !recipient ? "Enter Recipient Address" : !amount ? "Enter Withdraw Amount" : "Withdraw"
565
565
  }
566
566
  ) }),
567
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5SR5N75Icjs.PoweredBy, {})
567
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJZWCK7C3cjs.PoweredBy, {})
568
568
  ] });
569
569
  }
570
570
  WithdrawFormStep.displayName = "WithdrawFormStep";
@@ -891,22 +891,22 @@ function WithdrawFlow({
891
891
  onError,
892
892
  debug
893
893
  }) {
894
- const onStepChangeRef = _chunk5SR5N75Icjs.useLatestRef.call(void 0, onStepChange);
895
- const onTotalBalanceChangeRef = _chunk5SR5N75Icjs.useLatestRef.call(void 0, onTotalBalanceChange);
896
- const onEventRef = _chunk5SR5N75Icjs.useLatestRef.call(void 0, onEvent);
894
+ const onStepChangeRef = _chunkJZWCK7C3cjs.useLatestRef.call(void 0, onStepChange);
895
+ const onTotalBalanceChangeRef = _chunkJZWCK7C3cjs.useLatestRef.call(void 0, onTotalBalanceChange);
896
+ const onEventRef = _chunkJZWCK7C3cjs.useLatestRef.call(void 0, onEvent);
897
897
  const [step, setStep] = _react.useState.call(void 0, { type: "form" });
898
898
  const [isSubmitting, setIsSubmitting] = _react.useState.call(void 0, false);
899
899
  const [totalBalanceUsd, setTotalBalanceUsd] = _react.useState.call(void 0, 0);
900
900
  const [isConnectSelectionConfirmed, setIsConnectSelectionConfirmed] = _react.useState.call(void 0, false);
901
901
  const logFlow = _react.useCallback.call(void 0,
902
902
  (message, data) => {
903
- _chunk5SR5N75Icjs.debugLog.call(void 0, debug, "withdraw-flow", message, data);
903
+ _chunkJZWCK7C3cjs.debugLog.call(void 0, debug, "withdraw-flow", message, data);
904
904
  },
905
905
  [debug]
906
906
  );
907
907
  const logFlowError = _react.useCallback.call(void 0,
908
908
  (message, error, data) => {
909
- _chunk5SR5N75Icjs.debugError.call(void 0, debug, "withdraw-flow", message, error, data);
909
+ _chunkJZWCK7C3cjs.debugError.call(void 0, debug, "withdraw-flow", message, error, data);
910
910
  },
911
911
  [debug]
912
912
  );
@@ -965,14 +965,14 @@ function WithdrawFlow({
965
965
  return {
966
966
  ownerAddress: dappAddress,
967
967
  walletClient: _nullishCoalesce(dappWalletClient, () => ( void 0)),
968
- publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunk5SR5N75Icjs.getPublicClient.call(void 0, sourceChain))),
968
+ publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkJZWCK7C3cjs.getPublicClient.call(void 0, sourceChain))),
969
969
  switchChain: dappSwitchChain
970
970
  };
971
971
  }
972
972
  return {
973
973
  ownerAddress: dappWalletClient.account.address,
974
974
  walletClient: dappWalletClient,
975
- publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunk5SR5N75Icjs.getPublicClient.call(void 0, sourceChain))),
975
+ publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkJZWCK7C3cjs.getPublicClient.call(void 0, sourceChain))),
976
976
  switchChain: dappSwitchChain
977
977
  };
978
978
  }
@@ -983,7 +983,7 @@ function WithdrawFlow({
983
983
  return {
984
984
  ownerAddress: dappWalletClient.account.address,
985
985
  walletClient: dappWalletClient,
986
- publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunk5SR5N75Icjs.getPublicClient.call(void 0, sourceChain))),
986
+ publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkJZWCK7C3cjs.getPublicClient.call(void 0, sourceChain))),
987
987
  switchChain: dappSwitchChain
988
988
  };
989
989
  }
@@ -1013,7 +1013,7 @@ function WithdrawFlow({
1013
1013
  const symbol = _chunkR6U6BHCVcjs.getTokenSymbol.call(void 0, sourceToken, sourceChain);
1014
1014
  const decimals = _chunkR6U6BHCVcjs.getTokenDecimalsByAddress.call(void 0, sourceToken, sourceChain);
1015
1015
  return {
1016
- id: _chunk5SR5N75Icjs.getAssetId.call(void 0, { chainId: sourceChain, token: sourceToken }),
1016
+ id: _chunkJZWCK7C3cjs.getAssetId.call(void 0, { chainId: sourceChain, token: sourceToken }),
1017
1017
  chainId: sourceChain,
1018
1018
  token: sourceToken,
1019
1019
  symbol,
@@ -1084,15 +1084,15 @@ function WithdrawFlow({
1084
1084
  [logFlowError, onError]
1085
1085
  );
1086
1086
  const resolveSessionOwner = _react.useCallback.call(void 0, async (eoaAddress) => {
1087
- const localOwner = _chunk5SR5N75Icjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
1087
+ const localOwner = _chunkJZWCK7C3cjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
1088
1088
  if (localOwner) {
1089
1089
  return {
1090
- account: _chunk5SR5N75Icjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
1090
+ account: _chunkJZWCK7C3cjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
1091
1091
  address: localOwner.address
1092
1092
  };
1093
1093
  }
1094
- const created = _chunk5SR5N75Icjs.createSessionOwnerKey.call(void 0, );
1095
- _chunk5SR5N75Icjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
1094
+ const created = _chunkJZWCK7C3cjs.createSessionOwnerKey.call(void 0, );
1095
+ _chunkJZWCK7C3cjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
1096
1096
  return {
1097
1097
  account: created.account,
1098
1098
  address: created.address
@@ -1132,8 +1132,9 @@ function WithdrawFlow({
1132
1132
  const setup = await service.setupAccount({
1133
1133
  ownerAddress: ownerAddress2,
1134
1134
  sessionOwnerAddress: sessionOwner.address,
1135
- targetChain: _chunk5SR5N75Icjs.toEvmCaip2.call(void 0, targetChain),
1135
+ targetChain: _chunkJZWCK7C3cjs.toEvmCaip2.call(void 0, targetChain),
1136
1136
  targetToken,
1137
+ recipient,
1137
1138
  signerAddress,
1138
1139
  sessionChainIds,
1139
1140
  forceRegister
@@ -1159,7 +1160,7 @@ function WithdrawFlow({
1159
1160
  primaryType: typedData.primaryType,
1160
1161
  message: typedData.message
1161
1162
  });
1162
- const sessionDetails = _chunk5SR5N75Icjs.buildSessionDetails.call(void 0,
1163
+ const sessionDetails = _chunkJZWCK7C3cjs.buildSessionDetails.call(void 0,
1163
1164
  setup.sessionDetailsUnsigned,
1164
1165
  signature
1165
1166
  );
@@ -1173,7 +1174,7 @@ function WithdrawFlow({
1173
1174
  eoaAddress: ownerAddress2,
1174
1175
  sessionOwner: sessionOwner.address,
1175
1176
  target: {
1176
- chain: _chunk5SR5N75Icjs.toEvmCaip2.call(void 0, targetChain),
1177
+ chain: _chunkJZWCK7C3cjs.toEvmCaip2.call(void 0, targetChain),
1177
1178
  token: targetToken,
1178
1179
  recipient
1179
1180
  }
@@ -1182,7 +1183,7 @@ function WithdrawFlow({
1182
1183
  }
1183
1184
  handleConnected(ownerAddress2, smartAccount);
1184
1185
  const amountUnits = _viem.parseUnits.call(void 0, amountValue, asset.decimals);
1185
- const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _31 => _31.publicClient]), () => ( _chunk5SR5N75Icjs.getPublicClient.call(void 0, sourceChain)));
1186
+ const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _31 => _31.publicClient]), () => ( _chunkJZWCK7C3cjs.getPublicClient.call(void 0, sourceChain)));
1186
1187
  let result;
1187
1188
  if (onSignTransaction) {
1188
1189
  const transferData = isSourceNative ? { to: smartAccount, value: amountUnits, data: "0x" } : {
@@ -1205,7 +1206,7 @@ function WithdrawFlow({
1205
1206
  const { signature } = await onSignTransaction(request);
1206
1207
  const relayResult = await service.relayWithdraw({
1207
1208
  smartAccount,
1208
- chainId: _chunk5SR5N75Icjs.toEvmCaip2.call(void 0, sourceChain),
1209
+ chainId: _chunkJZWCK7C3cjs.toEvmCaip2.call(void 0, sourceChain),
1209
1210
  safeAddress,
1210
1211
  safeTransaction: request.typedData.message,
1211
1212
  signature
@@ -1263,7 +1264,7 @@ function WithdrawFlow({
1263
1264
  targetChain,
1264
1265
  targetToken
1265
1266
  });
1266
- handleError(_chunk5SR5N75Icjs.formatUserError.call(void 0, raw), "WITHDRAW_FLOW_ERROR");
1267
+ handleError(_chunkJZWCK7C3cjs.formatUserError.call(void 0, raw), "WITHDRAW_FLOW_ERROR");
1267
1268
  throw err;
1268
1269
  } finally {
1269
1270
  setIsSubmitting(false);
@@ -1401,7 +1402,7 @@ function WithdrawFlow({
1401
1402
  }, [walletOptions, ownerAddress, _optionalChain([reownWallet, 'optionalAccess', _45 => _45.icon])]);
1402
1403
  if (showConnectStep) {
1403
1404
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1404
- _chunk5SR5N75Icjs.ConnectStep,
1405
+ _chunkJZWCK7C3cjs.ConnectStep,
1405
1406
  {
1406
1407
  walletOptions,
1407
1408
  selectedWalletId: selectedWalletIdEffective,
@@ -1422,7 +1423,7 @@ function WithdrawFlow({
1422
1423
  if (!signerContext) return null;
1423
1424
  if (!onSignTransaction && !signerContext.walletClient) return null;
1424
1425
  const resolvedConnectedRecipient = _optionalChain([selectedWalletOption, 'optionalAccess', _46 => _46.kind]) === "external" ? selectedWalletOption.address : void 0;
1425
- const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => ( _chunk5SR5N75Icjs.getPublicClient.call(void 0, sourceChain)));
1426
+ const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => ( _chunkJZWCK7C3cjs.getPublicClient.call(void 0, sourceChain)));
1426
1427
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
1427
1428
  step.type === "form" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1428
1429
  WithdrawFormStep,
@@ -1448,7 +1449,7 @@ function WithdrawFlow({
1448
1449
  }
1449
1450
  ),
1450
1451
  step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1451
- _chunk5SR5N75Icjs.ProcessingStep,
1452
+ _chunkJZWCK7C3cjs.ProcessingStep,
1452
1453
  {
1453
1454
  smartAccount: step.smartAccount,
1454
1455
  txHash: step.txHash,
@@ -1474,7 +1475,7 @@ function WithdrawFlow({
1474
1475
  // src/WithdrawModal.tsx
1475
1476
 
1476
1477
  var ReownWithdrawInner = _react.lazy.call(void 0,
1477
- () => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-YBEUOYSV.cjs"))).then((m) => ({
1478
+ () => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-PXS44GZO.cjs"))).then((m) => ({
1478
1479
  default: m.WithdrawModalReown
1479
1480
  }))
1480
1481
  );
@@ -1527,19 +1528,19 @@ function WithdrawModalInner({
1527
1528
  debug
1528
1529
  }) {
1529
1530
  const modalRef = _react.useRef.call(void 0, null);
1530
- const onReadyRef = _chunk5SR5N75Icjs.useLatestRef.call(void 0, onReady);
1531
+ const onReadyRef = _chunkJZWCK7C3cjs.useLatestRef.call(void 0, onReady);
1531
1532
  const [currentStepIndex, setCurrentStepIndex] = _react.useState.call(void 0, 0);
1532
1533
  const [totalBalanceUsd, setTotalBalanceUsd] = _react.useState.call(void 0, null);
1533
1534
  const backHandlerRef = _react.useRef.call(void 0, void 0);
1534
1535
  const targetChain = _chunkR6U6BHCVcjs.getChainId.call(void 0, targetChainProp);
1535
1536
  const sourceChain = _chunkR6U6BHCVcjs.getChainId.call(void 0, sourceChainProp);
1536
1537
  const service = _react.useMemo.call(void 0,
1537
- () => _chunk5SR5N75Icjs.createDepositService.call(void 0, backendUrl, { debug, debugScope: "service:withdraw" }),
1538
+ () => _chunkJZWCK7C3cjs.createDepositService.call(void 0, backendUrl, { debug, debugScope: "service:withdraw" }),
1538
1539
  [backendUrl, debug]
1539
1540
  );
1540
1541
  _react.useEffect.call(void 0, () => {
1541
1542
  if (isOpen && modalRef.current) {
1542
- _chunk5SR5N75Icjs.applyTheme.call(void 0, modalRef.current, theme);
1543
+ _chunkJZWCK7C3cjs.applyTheme.call(void 0, modalRef.current, theme);
1543
1544
  }
1544
1545
  }, [isOpen, theme]);
1545
1546
  const hasCalledReady = _react.useRef.call(void 0, false);
@@ -1575,7 +1576,7 @@ function WithdrawModalInner({
1575
1576
  const title = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _56 => _56.title]), () => ( "Withdraw"));
1576
1577
  const canGoBack = currentStepIndex > 0 && currentStepIndex < 3 && backHandlerRef.current;
1577
1578
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1578
- _chunk5SR5N75Icjs.Modal,
1579
+ _chunkJZWCK7C3cjs.Modal,
1579
1580
  {
1580
1581
  isOpen,
1581
1582
  onClose,
@@ -1634,7 +1635,7 @@ function WithdrawModalInner({
1634
1635
  ] }),
1635
1636
  balance && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-balance", children: [
1636
1637
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-label", children: balance.title }),
1637
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _nullishCoalesce(balance.amount, () => ( (totalBalanceUsd !== null ? _chunk5SR5N75Icjs.currencyFormatter.format(totalBalanceUsd) : null))) })
1638
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _nullishCoalesce(balance.amount, () => ( (totalBalanceUsd !== null ? _chunkJZWCK7C3cjs.currencyFormatter.format(totalBalanceUsd) : null))) })
1638
1639
  ] })
1639
1640
  ] }),
1640
1641
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -21,7 +21,7 @@ import {
21
21
  saveSessionOwnerToStorage,
22
22
  toEvmCaip2,
23
23
  useLatestRef
24
- } from "./chunk-TDTBAZNO.mjs";
24
+ } from "./chunk-FWGLRTWF.mjs";
25
25
  import {
26
26
  DEFAULT_BACKEND_URL,
27
27
  DEFAULT_SIGNER_ADDRESS,
@@ -1134,6 +1134,7 @@ function WithdrawFlow({
1134
1134
  sessionOwnerAddress: sessionOwner.address,
1135
1135
  targetChain: toEvmCaip2(targetChain),
1136
1136
  targetToken,
1137
+ recipient,
1137
1138
  signerAddress,
1138
1139
  sessionChainIds,
1139
1140
  forceRegister
@@ -1474,7 +1475,7 @@ function WithdrawFlow({
1474
1475
  // src/WithdrawModal.tsx
1475
1476
  import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
1476
1477
  var ReownWithdrawInner = lazy(
1477
- () => import("./WithdrawModalReown-TD2NYW5M.mjs").then((m) => ({
1478
+ () => import("./WithdrawModalReown-MME7VSKX.mjs").then((m) => ({
1478
1479
  default: m.WithdrawModalReown
1479
1480
  }))
1480
1481
  );
@@ -304,6 +304,8 @@ function createDepositService(baseUrl, options) {
304
304
  ownerAddress: params.ownerAddress,
305
305
  targetChain: params.targetChain,
306
306
  targetToken: params.targetToken,
307
+ recipient: params.recipient ? shortRef(params.recipient) : void 0,
308
+ postBridgeActionCount: params.postBridgeActions?.length ?? 0,
307
309
  forceRegister: params.forceRegister
308
310
  });
309
311
  const response = await fetch(url, {
@@ -593,6 +595,46 @@ function createDepositService(baseUrl, options) {
593
595
  txHash: result?.txHash ? shortRef(result.txHash) : void 0
594
596
  });
595
597
  return result;
598
+ },
599
+ async fetchDepositHistory(params) {
600
+ const searchParams = new URLSearchParams({ account: params.account });
601
+ searchParams.set("limit", String(params.limit ?? 20));
602
+ if (params.cursor) {
603
+ searchParams.set("cursor", params.cursor);
604
+ }
605
+ const url = apiUrl(`/deposits?${searchParams.toString()}`);
606
+ debugLog(debug, scope, "fetchDepositHistory:request", {
607
+ url,
608
+ account: shortRef(params.account),
609
+ cursor: params.cursor
610
+ });
611
+ const response = await fetch(url, {
612
+ method: "GET",
613
+ headers: { "Content-Type": "application/json" },
614
+ cache: "no-store"
615
+ });
616
+ if (!response.ok) {
617
+ const error = await response.json().catch(() => ({ error: "Unknown error" }));
618
+ debugError(
619
+ debug,
620
+ scope,
621
+ "fetchDepositHistory:failed",
622
+ error,
623
+ { status: response.status, account: shortRef(params.account) }
624
+ );
625
+ throw new Error(
626
+ error.error || `Deposit history fetch failed: ${response.status}`
627
+ );
628
+ }
629
+ const data = await response.json();
630
+ const deposits = Array.isArray(data?.deposits) ? data.deposits : [];
631
+ const nextCursor = data?.nextCursor ?? data?.next_cursor ?? null;
632
+ debugLog(debug, scope, "fetchDepositHistory:success", {
633
+ account: shortRef(params.account),
634
+ count: deposits.length,
635
+ hasMore: Boolean(nextCursor)
636
+ });
637
+ return { deposits, nextCursor };
596
638
  }
597
639
  };
598
640
  }
@@ -2146,6 +2188,8 @@ export {
2146
2188
  debugLog,
2147
2189
  debugError,
2148
2190
  toEvmCaip2,
2191
+ parseEvmChainId,
2192
+ isSolanaCaip2,
2149
2193
  buildSessionDetails,
2150
2194
  createDepositService,
2151
2195
  getAssetId,