Skip to content

fix(AccountScreen, SorokitProvider): resolve issues #117 and #128#160

Open
Dominion116 wants to merge 1 commit into
Sorokit:mainfrom
Dominion116:fix/issues-117-128-account-screen-provider
Open

fix(AccountScreen, SorokitProvider): resolve issues #117 and #128#160
Dominion116 wants to merge 1 commit into
Sorokit:mainfrom
Dominion116:fix/issues-117-128-account-screen-provider

Conversation

@Dominion116

Copy link
Copy Markdown

Closes #117
Closes #128

Issue #117 — AccountScreen: duplicate states, no refresh, missing ClaimableBalanceCard

  • Remove @hugeicons/react / @hugeicons/core-free-icons imports (not in package.json) from AccountScreen; replace with an inline RefreshIcon SVG
  • AccountScreen no longer renders its own disconnected state — delegates to AccountCard (returns null) and BalanceList (single prompt)
  • ClaimableBalanceCard returns null when disconnected instead of showing a second "connect your wallet" prompt, satisfying the at-most-one acceptance criterion; test updated accordingly
  • ClaimableBalanceCard is rendered below BalanceList in AccountScreen

Issue #128 — SorokitProvider: refreshAccount missing, switchNetwork keeps error, useSorokit unsafe outside provider

  • refreshAccount reimplemented as async () => Promise that calls Promise.all([getAccount, getBalances]) directly and returns when settled; removes the indirect refreshTick/useEffect pattern
  • SorokitState type updated: refreshAccount: () => Promise
  • switchNetwork now calls setError(null) on a successful network switch so the TopBar error banner clears automatically
  • useSorokit returns a typed safe-defaults object instead of throwing when called outside a provider; emits console.warn in all environments
  • useSorokit test updated to assert safe-defaults shape instead of thrown error
  • README Hooks section documents refreshAccount signature, Promise return, isLoadingAccount behaviour, and the safe-defaults fallback

Build fixes (pre-existing, unblocked npm run build)

  • components/index.ts: fix SorokitProvider/useSorokit paths, remove reference to non-existent ../lib/types
  • tsconfig.lib.json: fix include (types.ts → client.ts), add @/* alias, switch build script from bare tsc --emitDeclarationOnly to tsc -p tsconfig.lib.json
  • vite.lib.config.ts: replace missing terser with built-in esbuild
  • ContractEventFeed: import ContractEvent type; export ContractEventFeedProps
  • ErrorBoundary / FeeEstimator: export prop interfaces

Description

Brief description of the changes in this PR.

Related Issues

Closes #(issue number)

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Testing

Describe how you tested your changes:

  • Component renders correctly
  • Tests added or updated for this change
  • No console errors or warnings
  • Lint passes (npm run lint)
  • Build succeeds (npm run build)
  • Manual testing completed

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

…orokit#128

Closes Sorokit#117
Closes Sorokit#128

### Issue Sorokit#117 — AccountScreen: duplicate states, no refresh, missing ClaimableBalanceCard

- Remove @hugeicons/react / @hugeicons/core-free-icons imports (not in
  package.json) from AccountScreen; replace with an inline RefreshIcon SVG
- AccountScreen no longer renders its own disconnected state — delegates
  to AccountCard (returns null) and BalanceList (single prompt)
- ClaimableBalanceCard returns null when disconnected instead of showing
  a second "connect your wallet" prompt, satisfying the at-most-one
  acceptance criterion; test updated accordingly
- ClaimableBalanceCard is rendered below BalanceList in AccountScreen

### Issue Sorokit#128 — SorokitProvider: refreshAccount missing, switchNetwork keeps error, useSorokit unsafe outside provider

- refreshAccount reimplemented as async () => Promise<void> that calls
  Promise.all([getAccount, getBalances]) directly and returns when
  settled; removes the indirect refreshTick/useEffect pattern
- SorokitState type updated: refreshAccount: () => Promise<void>
- switchNetwork now calls setError(null) on a successful network switch
  so the TopBar error banner clears automatically
- useSorokit returns a typed safe-defaults object instead of throwing
  when called outside a provider; emits console.warn in all environments
- useSorokit test updated to assert safe-defaults shape instead of thrown error
- README Hooks section documents refreshAccount signature, Promise return,
  isLoadingAccount behaviour, and the safe-defaults fallback

### Build fixes (pre-existing, unblocked npm run build)

- components/index.ts: fix SorokitProvider/useSorokit paths, remove
  reference to non-existent ../lib/types
- tsconfig.lib.json: fix include (types.ts → client.ts), add @/* alias,
  switch build script from bare tsc --emitDeclarationOnly to tsc -p tsconfig.lib.json
- vite.lib.config.ts: replace missing terser with built-in esbuild
- ContractEventFeed: import ContractEvent type; export ContractEventFeedProps
- ErrorBoundary / FeeEstimator: export prop interfaces

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@drips-wave

drips-wave Bot commented Jun 28, 2026

Copy link
Copy Markdown

@Dominion116 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant