Skip to content

Conversation

@tomiiide
Copy link

What does this PR do?

This PR does a couple of things:

  1. Exports SolanaClientContext for external use cases
  2. Returns the WalletSession object after a connector connects.
  3. Breaks the circular dependeciess in the repo

Why was it implemented this way?

Exporting SolanaClientContext

We needed this in a widget use case. The widget has it's internal wallet management. However, we want our partners to be able bring their own wallet management solution and the widget to use the external wallet management when available.
We do this by checking if there is an existing SolanaClientContext in the tree, and reusing it if there is, else, we create a new context.

Returning the WalletSession after connection

Although there is a useSession hook to fetch when the session. In our use case, we have a synchronous flow where onConnect, we show the user he a connecting modal and after connection, our internal state is updated, and the we close the modal. Doing this with the hook would work but would not be a linear flow.

Break circular dependencies in the repo.

After making the above updates, I discovered there were circular dependencies in the repo.

  1. I broke out the src/types.ts files into smaller types.ts files for each module / folder.
  2. I added madge to the devDependencies to help check for circular dependencies.

@tomiiide tomiiide marked this pull request as ready for review November 13, 2025 15:40
@GuiBibeau
Copy link
Collaborator

@tomiiide I've updated a lot of things and will cut the first minor release. Do you want to review anything in this PR before i review or good to go?

@tomiiide
Copy link
Author

@GuiBibeau Since there are no merge conflicts, I think it's good to go.
However, I would do another to look at your new changes, and see how it affects this PR.

@GuiBibeau
Copy link
Collaborator

@tomiiide perfect. I'm not planning any changes until monday on the react codebase after a bit of testing round by others. Hit me up once you want me to review/merge.

the only changes i will work on until then will be repo management stuff:

  • issue templates
  • PR templates
  • security audit and automation

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.

3 participants