refactor: make authorizationCache, chainSelector and onWalletNotFound in registerMwa optional#1271
Open
beeman wants to merge 1 commit intosolana-mobile:mainfrom
Open
refactor: make authorizationCache, chainSelector and onWalletNotFound in registerMwa optional#1271beeman wants to merge 1 commit intosolana-mobile:mainfrom
beeman wants to merge 1 commit intosolana-mobile:mainfrom
Conversation
… in registerMwa optional
Funkatronics
requested changes
Sep 12, 2025
| get cachedAuthorizationResult(): Promise<Authorization | undefined>; | ||
| } | ||
|
|
||
| export interface LocalSolanaMobileWalletAdapterWalletOptions { |
Collaborator
There was a problem hiding this comment.
Use a base interface called SolanaMobileWalletAdapterWalletConfig and extend LocalSolanaMobileWalletAdapterWalletConfig and RemoteSolanaMobileWalletAdapterWalletConfig from there
| @@ -10,14 +10,7 @@ import { AppIdentity } from "@solana-mobile/mobile-wallet-adapter-protocol"; | |||
| import { IdentifierArray } from "@wallet-standard/base"; | |||
Collaborator
There was a problem hiding this comment.
I think some of the imports here are not unused with this change?
| this.#chains = config.chains; | ||
| this.#chainSelector = config.chainSelector; | ||
| this.#onWalletNotFound = config.onWalletNotFound; | ||
| this.#chainSelector = config.chainSelector ?? createDefaultChainSelector(); |
Collaborator
There was a problem hiding this comment.
I'd prefer for these to be default parameters rather than fallbacks on nullable parameters.
Collaborator
|
CI build is failing on these changes @beeman |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit makes the
authorizationCache,chainSelectorandonWalletNotFoundproperties ofregisterMwaoptional.It does so by extracting the
LocalSolanaMobileWalletAdapterWalletOptionsinto an object, marking the properties as optional and haveRemoteSolanaMobileWalletAdapterWalletOptionsextend it.After that, we provide a default value in the constructor so that this function remains working the same, it just needs a few less parameters to set up.