feat(rpc): auto-sync RPCs every 24h & Alchemy Bitcoin endpoints#308
Conversation
- Replace rpcsSynced boolean flag with timestamp-based check (openScan_lastRpcSyncTime in localStorage) - On app start, re-sync if 24+ hours have passed or no timestamp exists - Remove rpcsSynced from UserSettings type (no longer needed) - Clear cache now removes the sync timestamp instead of setting a flag - Add Alchemy Bitcoin mainnet and testnet4 RPC auto-add when Alchemy key is saved, matching existing EVM auto-add behavior Closes openscan-explorer#295, Closes openscan-explorer#293
|
🚀 Preview: https://pr-308--openscan.netlify.app |
josealoha666
left a comment
There was a problem hiding this comment.
Looks good to me. The 24h timestamp-based auto-sync is cleaner than persisting a boolean in settings, and the Alchemy Bitcoin endpoint handling mirrors the existing EVM key-update flow cleanly. I checked the diff and npm run typecheck, npm run test:run, and npm run build all passed locally for me.
josealoha666
left a comment
There was a problem hiding this comment.
Quick review: I skimmed the diff and did not find a clear blocker. Leaving a comment-only review for now.
josealoha666
left a comment
There was a problem hiding this comment.
I checked the current head and I do not see an obvious blocking issue from the diff/API view. If CI is green, this looks fine from my side.
Description
Two RPC improvements:
Related Issue
Closes #295, Closes #293
Type of Change
Changes Made
Auto-sync RPCs every 24h (#295)
rpcsSyncedboolean flag withopenScan_lastRpcSyncTimetimestamp in localStorageisSyncNeeded()checks if 24+ hours elapsed or no timestamp exists (first-time user)rpcsSyncedfromUserSettingstype — no longer neededuseSettingsdependency from the hook (simpler, no settings writes)Alchemy Bitcoin endpoints (#293)
ALCHEMY_BTC_NETWORKSmapping for Bitcoin mainnet (bip122:000000000019d6689c085ae165831e93) and testnet4 (bip122:00000000da84f2bafbbc53dee25a72ae)getAlchemyBtcUrl()helperChecklist
npm run format:fixandnpm run lint:fixnpm run typecheckwith no errorsnpm run test:run