Skip to content
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

Merged
merged 27 commits into from
Jul 9, 2024
Merged

Conversation

glitch-txs
Copy link
Member

@glitch-txs glitch-txs commented Jun 30, 2024

Breaking Changes

N/A

Changes

  • feat: Add Wallet Standard support
  • fix:
  • chore:

Associated Issues

closes #2469

Copy link

vercel bot commented Jun 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
web3modal-gallery ✅ Ready (Inspect) Visit Preview Jul 9, 2024 1:40pm
web3modal-laboratory ✅ Ready (Inspect) Visit Preview Jul 9, 2024 1:40pm

@@ -330,9 +318,13 @@ export class Web3Modal extends Web3ModalScaffold {
return SolStoreUtil.state.connection
}

public async checkActiveProviders() {
public async checkActiveProviders(standardAdapter?: StandardWalletAdapter[]) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe a plural name?

Suggested change
public async checkActiveProviders(standardAdapter?: StandardWalletAdapter[]) {
public async checkActiveProviders(standardAdapters?: StandardWalletAdapter[]) {

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('_') ?? ''
Copy link
Contributor

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 []

Copy link
Member Author

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]

packages/solana/src/utils/wallet-standard/watchStandard.ts Outdated Show resolved Hide resolved
adapter => adapter.name.toLocaleLowerCase() === providerType.toLocaleLowerCase()
)
?.publicKey?.toString()
if (chain) {
Copy link
Collaborator

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"?

@phoenixVS phoenixVS merged commit 5eb3889 into main Jul 9, 2024
9 checks passed
@phoenixVS phoenixVS deleted the feat/wallet-standard-adapter branch July 9, 2024 14:02
This was referenced Jul 17, 2024
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.

[bug] Connect Phantom but get Not Detected
3 participants