@rhinestone/deposit-modal 0.2.0 → 0.2.1

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  DepositModalInner
3
- } from "./chunk-7NEVAAPY.mjs";
3
+ } from "./chunk-HTYUCLJP.mjs";
4
4
  import {
5
5
  ReownWalletProvider,
6
6
  useReownWallet
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
- var _chunkUHQSFV5Vcjs = require('./chunk-UHQSFV5V.cjs');
3
+ var _chunkPZ3GVS3Dcjs = require('./chunk-PZ3GVS3D.cjs');
4
4
 
5
5
 
6
6
 
@@ -32,7 +32,7 @@ function DepositModalWithReown(props) {
32
32
  reown.disconnect();
33
33
  }, [reown.disconnect]);
34
34
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
35
- _chunkUHQSFV5Vcjs.DepositModalInner,
35
+ _chunkPZ3GVS3Dcjs.DepositModalInner,
36
36
  {
37
37
  ...props,
38
38
  reownWallet: reownWithSolana,
@@ -2116,8 +2116,23 @@ function DepositAddressStep({
2116
2116
  return;
2117
2117
  }
2118
2118
  try {
2119
- const status = await service.fetchLatestStatus(smartAccount);
2119
+ const accounts = [smartAccount];
2120
+ if (solanaDepositAddress) accounts.push(solanaDepositAddress);
2121
+ const results = await Promise.all(
2122
+ accounts.map(
2123
+ (addr) => service.fetchLatestStatus(addr).catch(() => ({ lastEvent: void 0 }))
2124
+ )
2125
+ );
2120
2126
  if (cancelled) return;
2127
+ const events = results.map((r) => r.lastEvent).filter((e) => Boolean(e));
2128
+ const status = {
2129
+ lastEvent: events.reduce((latest, ev) => {
2130
+ if (!latest) return ev;
2131
+ const a = ev.time ? Date.parse(ev.time) : 0;
2132
+ const b = latest.time ? Date.parse(latest.time) : 0;
2133
+ return a > b ? ev : latest;
2134
+ }, void 0)
2135
+ };
2121
2136
  if (isTrackingRef.current) {
2122
2137
  if (!cancelled) {
2123
2138
  timeoutId = setTimeout(poll, POLL_INTERVAL_MS);
@@ -2183,7 +2198,7 @@ function DepositAddressStep({
2183
2198
  cancelled = true;
2184
2199
  clearTimeout(timeoutId);
2185
2200
  };
2186
- }, [smartAccount, service]);
2201
+ }, [smartAccount, solanaDepositAddress, service]);
2187
2202
  const handleNotificationComplete = useCallback4(
2188
2203
  (txHash, destinationTxHash, context) => {
2189
2204
  isTrackingRef.current = false;
@@ -4478,10 +4493,12 @@ function getTxExplorerUrl(txHash, chainId) {
4478
4493
  if (!base) return null;
4479
4494
  return `${base}/tx/${txHash}`;
4480
4495
  }
4481
- function normalizeStatus(raw) {
4496
+ function normalizeStatus(raw, isSpam) {
4482
4497
  const lower = raw.toLowerCase();
4483
4498
  if (lower === "completed" || lower === "complete" || lower === "bridge-complete" || lower === "processed") return "completed";
4484
- if (lower === "failed" || lower === "error" || lower === "bridge-failed") return "failed";
4499
+ if (lower === "failed" || lower === "error" || lower === "bridge-failed") {
4500
+ return isSpam ? "spam" : "failed";
4501
+ }
4485
4502
  if (lower === "processing" || lower === "submitted" || lower === "bridging") return "processing";
4486
4503
  return "pending";
4487
4504
  }
@@ -4489,7 +4506,8 @@ var STATUS_LABEL = {
4489
4506
  pending: "Pending",
4490
4507
  processing: "Processing",
4491
4508
  completed: "Completed",
4492
- failed: "Failed"
4509
+ failed: "Failed",
4510
+ spam: "Spam token"
4493
4511
  };
4494
4512
  function ExternalLinkIcon() {
4495
4513
  return /* @__PURE__ */ jsx13("svg", { className: "rs-history-ext-icon", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ jsx13("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 1.5H2.25A.75.75 0 0 0 1.5 2.25v7.5c0 .414.336.75.75.75h7.5a.75.75 0 0 0 .75-.75V7.5m-3-6h3m0 0v3m0-3L6 6" }) });
@@ -4570,7 +4588,7 @@ function DepositHistoryPanel({
4570
4588
  );
4571
4589
  }
4572
4590
  function HistoryRow({ deposit }) {
4573
- const status = normalizeStatus(deposit.status);
4591
+ const status = normalizeStatus(deposit.status, deposit.isSpam);
4574
4592
  const sourceChainId = resolveChainId(deposit.chain);
4575
4593
  const targetChainId = resolveChainId(deposit.targetChain);
4576
4594
  const sourceChainName = sourceChainId ? getChainName(sourceChainId) : null;
@@ -4651,7 +4669,7 @@ DepositHistoryPanel.displayName = "DepositHistoryPanel";
4651
4669
  // src/DepositModal.tsx
4652
4670
  import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
4653
4671
  var ReownDepositInner = lazy(
4654
- () => import("./DepositModalReown-PROPLCBI.mjs").then((m) => ({ default: m.DepositModalReown }))
4672
+ () => import("./DepositModalReown-IIEXOTKU.mjs").then((m) => ({ default: m.DepositModalReown }))
4655
4673
  );
4656
4674
  function DepositModal(props) {
4657
4675
  const needsReown = !!props.reownAppId;
@@ -2116,8 +2116,23 @@ function DepositAddressStep({
2116
2116
  return;
2117
2117
  }
2118
2118
  try {
2119
- const status = await service.fetchLatestStatus(smartAccount);
2119
+ const accounts = [smartAccount];
2120
+ if (solanaDepositAddress) accounts.push(solanaDepositAddress);
2121
+ const results = await Promise.all(
2122
+ accounts.map(
2123
+ (addr) => service.fetchLatestStatus(addr).catch(() => ({ lastEvent: void 0 }))
2124
+ )
2125
+ );
2120
2126
  if (cancelled) return;
2127
+ const events = results.map((r) => r.lastEvent).filter((e) => Boolean(e));
2128
+ const status = {
2129
+ lastEvent: events.reduce((latest, ev) => {
2130
+ if (!latest) return ev;
2131
+ const a = ev.time ? Date.parse(ev.time) : 0;
2132
+ const b = latest.time ? Date.parse(latest.time) : 0;
2133
+ return a > b ? ev : latest;
2134
+ }, void 0)
2135
+ };
2121
2136
  if (isTrackingRef.current) {
2122
2137
  if (!cancelled) {
2123
2138
  timeoutId = setTimeout(poll, POLL_INTERVAL_MS);
@@ -2183,7 +2198,7 @@ function DepositAddressStep({
2183
2198
  cancelled = true;
2184
2199
  clearTimeout(timeoutId);
2185
2200
  };
2186
- }, [smartAccount, service]);
2201
+ }, [smartAccount, solanaDepositAddress, service]);
2187
2202
  const handleNotificationComplete = _react.useCallback.call(void 0,
2188
2203
  (txHash, destinationTxHash, context) => {
2189
2204
  isTrackingRef.current = false;
@@ -4478,10 +4493,12 @@ function getTxExplorerUrl(txHash, chainId) {
4478
4493
  if (!base) return null;
4479
4494
  return `${base}/tx/${txHash}`;
4480
4495
  }
4481
- function normalizeStatus(raw) {
4496
+ function normalizeStatus(raw, isSpam) {
4482
4497
  const lower = raw.toLowerCase();
4483
4498
  if (lower === "completed" || lower === "complete" || lower === "bridge-complete" || lower === "processed") return "completed";
4484
- if (lower === "failed" || lower === "error" || lower === "bridge-failed") return "failed";
4499
+ if (lower === "failed" || lower === "error" || lower === "bridge-failed") {
4500
+ return isSpam ? "spam" : "failed";
4501
+ }
4485
4502
  if (lower === "processing" || lower === "submitted" || lower === "bridging") return "processing";
4486
4503
  return "pending";
4487
4504
  }
@@ -4489,7 +4506,8 @@ var STATUS_LABEL = {
4489
4506
  pending: "Pending",
4490
4507
  processing: "Processing",
4491
4508
  completed: "Completed",
4492
- failed: "Failed"
4509
+ failed: "Failed",
4510
+ spam: "Spam token"
4493
4511
  };
4494
4512
  function ExternalLinkIcon() {
4495
4513
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className: "rs-history-ext-icon", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 1.5H2.25A.75.75 0 0 0 1.5 2.25v7.5c0 .414.336.75.75.75h7.5a.75.75 0 0 0 .75-.75V7.5m-3-6h3m0 0v3m0-3L6 6" }) });
@@ -4570,7 +4588,7 @@ function DepositHistoryPanel({
4570
4588
  );
4571
4589
  }
4572
4590
  function HistoryRow({ deposit }) {
4573
- const status = normalizeStatus(deposit.status);
4591
+ const status = normalizeStatus(deposit.status, deposit.isSpam);
4574
4592
  const sourceChainId = resolveChainId(deposit.chain);
4575
4593
  const targetChainId = resolveChainId(deposit.targetChain);
4576
4594
  const sourceChainName = sourceChainId ? _chunkMUWVDVY4cjs.getChainName.call(void 0, sourceChainId) : null;
@@ -4651,7 +4669,7 @@ DepositHistoryPanel.displayName = "DepositHistoryPanel";
4651
4669
  // src/DepositModal.tsx
4652
4670
 
4653
4671
  var ReownDepositInner = _react.lazy.call(void 0,
4654
- () => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-66DE7NAY.cjs"))).then((m) => ({ default: m.DepositModalReown }))
4672
+ () => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-MMDTCHQL.cjs"))).then((m) => ({ default: m.DepositModalReown }))
4655
4673
  );
4656
4674
  function DepositModal(props) {
4657
4675
  const needsReown = !!props.reownAppId;
package/dist/deposit.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkUHQSFV5Vcjs = require('./chunk-UHQSFV5V.cjs');
3
+ var _chunkPZ3GVS3Dcjs = require('./chunk-PZ3GVS3D.cjs');
4
4
  require('./chunk-XW4M7WDI.cjs');
5
5
  require('./chunk-MUWVDVY4.cjs');
6
6
 
7
7
 
8
- exports.DepositModal = _chunkUHQSFV5Vcjs.DepositModal;
8
+ exports.DepositModal = _chunkPZ3GVS3Dcjs.DepositModal;
package/dist/deposit.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  DepositModal
3
- } from "./chunk-7NEVAAPY.mjs";
3
+ } from "./chunk-HTYUCLJP.mjs";
4
4
  import "./chunk-3CRG5NPG.mjs";
5
5
  import "./chunk-SDZKKUCJ.mjs";
6
6
  export {
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkUHQSFV5Vcjs = require('./chunk-UHQSFV5V.cjs');
3
+ var _chunkPZ3GVS3Dcjs = require('./chunk-PZ3GVS3D.cjs');
4
4
 
5
5
 
6
6
  var _chunk7TEGUTU4cjs = require('./chunk-7TEGUTU4.cjs');
@@ -70,4 +70,4 @@ var _chunkMUWVDVY4cjs = require('./chunk-MUWVDVY4.cjs');
70
70
 
71
71
 
72
72
 
73
- exports.CHAIN_BY_ID = _chunkMUWVDVY4cjs.CHAIN_BY_ID; exports.DEFAULT_BACKEND_URL = _chunkMUWVDVY4cjs.DEFAULT_BACKEND_URL; exports.DEFAULT_SIGNER_ADDRESS = _chunkMUWVDVY4cjs.DEFAULT_SIGNER_ADDRESS; exports.DepositModal = _chunkUHQSFV5Vcjs.DepositModal; exports.NATIVE_TOKEN_ADDRESS = _chunkMUWVDVY4cjs.NATIVE_TOKEN_ADDRESS; exports.SOURCE_CHAINS = _chunkMUWVDVY4cjs.SOURCE_CHAINS; exports.SUPPORTED_CHAINS = _chunkMUWVDVY4cjs.SUPPORTED_CHAINS; exports.WithdrawModal = _chunk7TEGUTU4cjs.WithdrawModal; exports.chainRegistry = _chunkMUWVDVY4cjs.chainRegistry; exports.disconnectWallet = _chunkYQFH2WSWcjs.disconnectWallet; exports.findChainIdForToken = _chunkMUWVDVY4cjs.findChainIdForToken; exports.getChainBadge = _chunkMUWVDVY4cjs.getChainBadge; exports.getChainIcon = _chunkMUWVDVY4cjs.getChainIcon; exports.getChainId = _chunkMUWVDVY4cjs.getChainId; exports.getChainName = _chunkMUWVDVY4cjs.getChainName; exports.getChainObject = _chunkMUWVDVY4cjs.getChainObject; exports.getExplorerName = _chunkMUWVDVY4cjs.getExplorerName; exports.getExplorerTxUrl = _chunkMUWVDVY4cjs.getExplorerTxUrl; exports.getExplorerUrl = _chunkMUWVDVY4cjs.getExplorerUrl; exports.getSupportedChainIds = _chunkMUWVDVY4cjs.getSupportedChainIds; exports.getSupportedTargetTokens = _chunkMUWVDVY4cjs.getSupportedTargetTokens; exports.getSupportedTokenSymbolsForChain = _chunkMUWVDVY4cjs.getSupportedTokenSymbolsForChain; exports.getTargetTokenSymbolsForChain = _chunkMUWVDVY4cjs.getTargetTokenSymbolsForChain; exports.getTokenAddress = _chunkMUWVDVY4cjs.getTokenAddress; exports.getTokenDecimals = _chunkMUWVDVY4cjs.getTokenDecimals; exports.getTokenDecimalsByAddress = _chunkMUWVDVY4cjs.getTokenDecimalsByAddress; exports.getTokenIcon = _chunkMUWVDVY4cjs.getTokenIcon; exports.getTokenSymbol = _chunkMUWVDVY4cjs.getTokenSymbol; exports.getUsdcAddress = _chunkMUWVDVY4cjs.getUsdcAddress; exports.getUsdcDecimals = _chunkMUWVDVY4cjs.getUsdcDecimals; exports.isSupportedTokenAddressForChain = _chunkMUWVDVY4cjs.isSupportedTokenAddressForChain;
73
+ exports.CHAIN_BY_ID = _chunkMUWVDVY4cjs.CHAIN_BY_ID; exports.DEFAULT_BACKEND_URL = _chunkMUWVDVY4cjs.DEFAULT_BACKEND_URL; exports.DEFAULT_SIGNER_ADDRESS = _chunkMUWVDVY4cjs.DEFAULT_SIGNER_ADDRESS; exports.DepositModal = _chunkPZ3GVS3Dcjs.DepositModal; exports.NATIVE_TOKEN_ADDRESS = _chunkMUWVDVY4cjs.NATIVE_TOKEN_ADDRESS; exports.SOURCE_CHAINS = _chunkMUWVDVY4cjs.SOURCE_CHAINS; exports.SUPPORTED_CHAINS = _chunkMUWVDVY4cjs.SUPPORTED_CHAINS; exports.WithdrawModal = _chunk7TEGUTU4cjs.WithdrawModal; exports.chainRegistry = _chunkMUWVDVY4cjs.chainRegistry; exports.disconnectWallet = _chunkYQFH2WSWcjs.disconnectWallet; exports.findChainIdForToken = _chunkMUWVDVY4cjs.findChainIdForToken; exports.getChainBadge = _chunkMUWVDVY4cjs.getChainBadge; exports.getChainIcon = _chunkMUWVDVY4cjs.getChainIcon; exports.getChainId = _chunkMUWVDVY4cjs.getChainId; exports.getChainName = _chunkMUWVDVY4cjs.getChainName; exports.getChainObject = _chunkMUWVDVY4cjs.getChainObject; exports.getExplorerName = _chunkMUWVDVY4cjs.getExplorerName; exports.getExplorerTxUrl = _chunkMUWVDVY4cjs.getExplorerTxUrl; exports.getExplorerUrl = _chunkMUWVDVY4cjs.getExplorerUrl; exports.getSupportedChainIds = _chunkMUWVDVY4cjs.getSupportedChainIds; exports.getSupportedTargetTokens = _chunkMUWVDVY4cjs.getSupportedTargetTokens; exports.getSupportedTokenSymbolsForChain = _chunkMUWVDVY4cjs.getSupportedTokenSymbolsForChain; exports.getTargetTokenSymbolsForChain = _chunkMUWVDVY4cjs.getTargetTokenSymbolsForChain; exports.getTokenAddress = _chunkMUWVDVY4cjs.getTokenAddress; exports.getTokenDecimals = _chunkMUWVDVY4cjs.getTokenDecimals; exports.getTokenDecimalsByAddress = _chunkMUWVDVY4cjs.getTokenDecimalsByAddress; exports.getTokenIcon = _chunkMUWVDVY4cjs.getTokenIcon; exports.getTokenSymbol = _chunkMUWVDVY4cjs.getTokenSymbol; exports.getUsdcAddress = _chunkMUWVDVY4cjs.getUsdcAddress; exports.getUsdcDecimals = _chunkMUWVDVY4cjs.getUsdcDecimals; exports.isSupportedTokenAddressForChain = _chunkMUWVDVY4cjs.isSupportedTokenAddressForChain;
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  DepositModal
3
- } from "./chunk-7NEVAAPY.mjs";
3
+ } from "./chunk-HTYUCLJP.mjs";
4
4
  import {
5
5
  WithdrawModal
6
6
  } from "./chunk-TKTOPC2W.mjs";
package/dist/reown.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkUHQSFV5Vcjs = require('./chunk-UHQSFV5V.cjs');
3
+ var _chunkPZ3GVS3Dcjs = require('./chunk-PZ3GVS3D.cjs');
4
4
 
5
5
 
6
6
  var _chunk7TEGUTU4cjs = require('./chunk-7TEGUTU4.cjs');
@@ -13,4 +13,4 @@ require('./chunk-MUWVDVY4.cjs');
13
13
 
14
14
 
15
15
 
16
- exports.DepositModal = _chunkUHQSFV5Vcjs.DepositModal; exports.WithdrawModal = _chunk7TEGUTU4cjs.WithdrawModal; exports.disconnectWallet = _chunkYQFH2WSWcjs.disconnectWallet;
16
+ exports.DepositModal = _chunkPZ3GVS3Dcjs.DepositModal; exports.WithdrawModal = _chunk7TEGUTU4cjs.WithdrawModal; exports.disconnectWallet = _chunkYQFH2WSWcjs.disconnectWallet;
package/dist/reown.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  DepositModal
3
- } from "./chunk-7NEVAAPY.mjs";
3
+ } from "./chunk-HTYUCLJP.mjs";
4
4
  import {
5
5
  WithdrawModal
6
6
  } from "./chunk-TKTOPC2W.mjs";
package/dist/styles.css CHANGED
@@ -3686,6 +3686,10 @@
3686
3686
  background: var(--color-red9);
3687
3687
  }
3688
3688
 
3689
+ .rs-history-dot--spam {
3690
+ background: var(--rs-muted-foreground);
3691
+ }
3692
+
3689
3693
  @keyframes rs-history-dot-pulse {
3690
3694
  0%, 100% { opacity: 1; }
3691
3695
  50% { opacity: 0.4; }
@@ -3707,6 +3711,10 @@
3707
3711
  color: var(--color-amber8);
3708
3712
  }
3709
3713
 
3714
+ .rs-history-status--spam {
3715
+ color: var(--rs-muted-foreground);
3716
+ }
3717
+
3710
3718
  /* Row secondary: amount + time */
3711
3719
 
3712
3720
  .rs-history-row-secondary {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rhinestone/deposit-modal",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "React modal component for Rhinestone cross-chain deposits",
5
5
  "author": "Rhinestone <dev@rhinestone.wtf>",
6
6
  "bugs": {