You are currently viewing Why You Should Use Wallet Adapter
Why You Should Use Wallet Adapter

Why You Should Use Wallet Adapter

Assuming you followed Part 1 of the Scaffold Series, or at any point asked why we suggest utilizing the Wallet Adapter Library, this article is for you.

We should expect the client as of now to have a wallet application/expansion introduced, for example, Phantom introduced.

Suppose we believe should do that association a la mano, this is the manner by which to code would seem to be:

Solana: expecting it is a ghost wallet, a Solana article will be infused into the window.
Solana. connect(): this permits our app to get to the client’s wallet.
publicKey: when we have the public key we can begin doing some web3 stuff.

Very clear isn’t it? Indeed, this works for a toy DApp however we should ponder genuine use cases since we are professionals, right?

  • In the first place, what will occur in the event that the client has not introduced Phantom? Could you at any point show a UI to request that the client introduce a wallet expansion first?
  • Furthermore, might you at any point execute a distinction interface, perhaps Solana. disconnect()?
  • Then we additionally need to monitor the association state.

In spite of the fact that it appears to be quite easy, imagine a scenario where I let you know that no wallets are fabricated something similar, associate() and disengage() could work for ghost, yet what might be said about the other Solana wallets (counting the ones that don’t as yet exist).

Wallet Adapter – The Pitch

Out of the container, Wallet Adapter will give you the UI I have shown you before all else! It’s aaa almost a simplified part.

Leave a Reply