Skip to content

Conversation

@moeodeh3
Copy link
Contributor

@moeodeh3 moeodeh3 commented Nov 11, 2025

Summary & Motivation

our SDK loading times have been noticeably slow - something that’s easy to overlook here in North America, but for users elsewhere it can feel sluggish

this PR is our first step toward optimizing client initialization and session loading times to improve overall responsiveness

What this pr does:

  • fixes issue with our stamp in our httpClient
  • updated to latest version of @walletconnect/sign-client which had some performance benefits (core)
  • parallelize stamper initialization (core)
  • parallelize session storage (core)
  • fetchWallet (core)
    - reduce number of queries. Originally we did a fetchUser for each connected wallet, we now only do one
    - parallelize list_wallets, list_wallet_accounts, list_user queries
    - this added a new optional param authenticatorAddresses to fetchWalletAccounts()
  • separated WalletConnect initialization from client initialization (core)
    - adds isLoading attribute to the WalletConnect WalletProvider
    - when WalletConnect is done initializing (or it fails) we emit events that we listen for in react-wallet-kit which
    refreshes either the wallet or the walletProvider state (or both). We then handle this in our auth component
  • goes through each useCallback() and ensures each direct dependency is included. Indirect dependencies are not included (react-wallet-kit)

below are video comparisons recorded while connected to a VPN in Europe:

Client initialization time:

before:

init-old.mov

after:

init-new.mov

Session loading time:

before:

old.mov

after:

new.mov

Also we see some benefits as well in NA, take a look:

before:

NA-old.mov

after:

NA-new.mov

How I Tested These Changes

Did you add a changeset?

If updating one of our packages, you'll likely need to add a changeset to your PR. To do so, run pnpm changeset. pnpm changeset will generate a file where you should write a human friendly message about the changes. Note how this (example) includes the package name (should be auto added by the command) along with the type of semver change (major.minor.patch) (which you should set).

These changes will be used at release time to determine what packages to publish and how to bump their version. For more context see this comment.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Nov 11, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 558949c:

Sandbox Source
@turnkey/example-react-components Configuration

@moeodeh3 moeodeh3 changed the title optimize optimize core and react-wallet-kit Nov 13, 2025
@shrimpwtf
Copy link

amazing work, this is a giant improvement, hope this can be pr'd in soon!

@amircheikh
Copy link
Contributor

This also makes me think, we need a spinner in our demo app when wallets is loading!

image

@amircheikh
Copy link
Contributor

put the eslint ignore comment back for the QR code. Fixes build

openSheet: (page: ModalPage) => void;
pushPage: (page: ModalPage) => void;
popPage: () => void;
popPages: (count: number) => void;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool beans man

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🫘

@socket-security
Copy link

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​walletconnect/​types@​2.21.8 ⏵ 2.23.0100 +110072 +19880 -19
Updated@​walletconnect/​sign-client@​2.21.8 ⏵ 2.23.0100 +110077 +198 +4880 -19

View full report

@moeodeh3 moeodeh3 merged commit 3f6b07f into main Nov 21, 2025
8 checks passed
@moeodeh3 moeodeh3 deleted the moeO/optimization branch November 21, 2025 18:21
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.

5 participants