-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add Wallet Standard to AppKit + Solana #2482
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…letConnect/web3modal into feat/wallet-standard-adapter
packages/solana/src/client.ts
Outdated
@@ -330,9 +318,13 @@ export class Web3Modal extends Web3ModalScaffold { | |||
return SolStoreUtil.state.connection | |||
} | |||
|
|||
public async checkActiveProviders() { | |||
public async checkActiveProviders(standardAdapter?: StandardWalletAdapter[]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a plural name?
public async checkActiveProviders(standardAdapter?: StandardWalletAdapter[]) { | |
public async checkActiveProviders(standardAdapters?: StandardWalletAdapter[]) { |
packages/solana/src/client.ts
Outdated
const wallet = walletId?.split('_')[1] | ||
const adapter = this.walletAdapters.find(a => a.name.toLocaleLowerCase() === wallet) | ||
if (adapter && wallet && window[wallet as keyof Window]) { | ||
const walletArray = walletId?.split('_') ?? '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Split returns an array of strings while the default value is ''
after nullish operator. Shouldn't it []
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, I was being lazy, but ''[0]
is same as [][0]
adapter => adapter.name.toLocaleLowerCase() === providerType.toLocaleLowerCase() | ||
) | ||
?.publicKey?.toString() | ||
if (chain) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here it is used in SolStoreUtil, which does not rewrite this.chain, and stores data about chainId, explorer, etc.
while, as I understood this.chain tells 'EVM' or 'solana' in use. Probably we should rename it to "mode"?
Breaking Changes
N/A
Changes
Associated Issues
closes #2469