Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: reduce the number of wallet api calls #522

Merged
merged 2 commits into from
Oct 29, 2024

Conversation

fracek
Copy link
Contributor

@fracek fracek commented Oct 29, 2024

Context

In some cases, calls to the wallet API can take a long time (>100ms) so the
library should make as few of them as possible to minimize the time it takes to
connect to a wallet.

Changes in this Pull Request

  • Reduce the calls to wallet_requestAccounts used to check if the wallet is locked.
  • Update the address property in the useAccount hook without waiting for the account object to be fully built.

Test Plan

Use the account demo to test that less calls are made to the wallet. You can
set a breakpoint in the InjectedConnector.request function.

@fracek fracek merged commit 6993533 into apibara:main Oct 29, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant