@silentswap/react 0.1.53 → 0.1.54

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.
@@ -209,8 +209,21 @@ export function useWallet({ client, address, auth, walletClient, connector, allD
209
209
  return;
210
210
  }
211
211
  console.log('[useWallet:generateWallet] no cache, querying deposit count ...');
212
- // Query the actual deposit count from the blockchain
213
- const depositCount = await queryDepositCount(normalizedAddress, client.s0xGatewayAddress);
212
+ // Query the actual deposit count from the blockchain.
213
+ // If every public RPC fallback fails (e.g. in-app browser blocks all of
214
+ // them), don't bail out of wallet generation — treat the user as a
215
+ // new user (depositCount = 0). Worst case they won't see historical
216
+ // facilitator accounts, but they can still sign up and swap. The
217
+ // alternative is a hard failure before any signature prompt, which
218
+ // strands the user with zero explanation.
219
+ let depositCount;
220
+ try {
221
+ depositCount = await queryDepositCount(normalizedAddress, client.s0xGatewayAddress);
222
+ }
223
+ catch (rpcErr) {
224
+ console.warn('[useWallet:generateWallet] queryDepositCount failed, falling back to 0:', rpcErr instanceof Error ? rpcErr.message : rpcErr);
225
+ depositCount = 0n;
226
+ }
214
227
  console.log('[useWallet:generateWallet] depositCount', depositCount);
215
228
  // Generate new entropy
216
229
  console.log('[useWallet:generateWallet] generating entropy ...');
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@silentswap/react",
3
3
  "type": "module",
4
- "version": "0.1.53",
4
+ "version": "0.1.54",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -24,8 +24,8 @@
24
24
  "dependencies": {
25
25
  "@bigmi/core": "^0.6.5",
26
26
  "@ensdomains/ensjs": "^4.2.0",
27
- "@silentswap/sdk": "0.1.53",
28
- "@silentswap/ui-kit": "0.1.53",
27
+ "@silentswap/sdk": "0.1.54",
28
+ "@silentswap/ui-kit": "0.1.54",
29
29
  "@solana/codecs-strings": "^5.1.0",
30
30
  "@solana/kit": "^5.1.0",
31
31
  "@solana/rpc": "^5.1.0",