Skip to content

Conversation

@tomiiide
Copy link
Contributor

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
Contributor 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

@GuiBibeau
Copy link
Collaborator

@tomiiide Just checking a last time if you want to get this resolved in conflicts and merged? I can take it on if you don't have the time. Most of the API surface is now solidified and won't change much other than patches and new features

@tomiiide
Copy link
Contributor Author

@GuiBibeau I've resolved the conflicts, you can take a look now. Thanks.

GuiBibeau
GuiBibeau previously approved these changes Dec 16, 2025
@tomiiide tomiiide force-pushed the feat-export-solana-context branch from 7715eb4 to 17e3691 Compare December 30, 2025 13:34
@tomiiide tomiiide requested a review from GuiBibeau December 30, 2025 13:35
@tomiiide
Copy link
Contributor Author

@GuiBibeau I've squashed the commits on this PR, and rebased with main.
I've also fixed all the typecheck and pnpm audit issues.

Can you please re-review?

@GuiBibeau
Copy link
Collaborator

@tomiiide good to go! Just missing a changeset and we are good to go! I think a minor or a patch should do the work here

@GuiBibeau GuiBibeau merged commit 6e0de9f into solana-foundation:main Jan 5, 2026
6 of 7 checks passed
GuiBibeau added a commit that referenced this pull request Jan 5, 2026
GuiBibeau added a commit that referenced this pull request Jan 5, 2026
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.

4 participants