Picket client SDKs contain a convenience method for connecting to wallets
// default is the Ethereum mainnetpicket.connect();// you can also pass the "ethereum" explicitly// picket.connect({ chain: "ethereum" });
picket.connect({chain:"solana"});
picket.connect() triggers a wallet connection request which involves a pop up and/or redirect that will ask users to connect to any supported wallet of a picket supported blockchain.
It also triggers a picket compatible signature request for you that leverages a secure picket generated nonce.
Once the user connects their wallet and signs the message, you will receive a response with a Picket wallet object that contains the walletAddress, signature and provider which can be used for future on-chain operations with your web3 library of choice.
When to Use
picket.login() handles calling the picket.connect() function for you. So, if you're using picket.login() you don't need to manually call picket.connect() However, if you want to have access to a wallet for future on chain operations then the picket.connect() method is an easy and convenient way to accomplish that. You can use it alongside picket.login() like so:
By using the connect() method here, you not only authenticate the wallet, you can also now use provider for future on chain interactions. For example, in order to get the wallet balance of the connected wallet you can do the following using the ethers.js library.
A ethers.js and web3.js compatible wallet provider object that can be used to facilitate on-chain operations via these open source libraries.
context
The signing context for SIWE messages. This is needed to allow the server to verify the message signature.
Supported Wallets
EVM-Compatible Chains
While you can pass in a walletAddress and signature signed by any wallet. Currently picket.connect() makes over 100 wallets available to users via the convenient ready-built Picket connect UI. These include:
If there is a wallet, or wallet standard you would like supported let us know: [email protected].
You can also build your own UI to let users select a wallet to connect to and/or use an open source 3rd party UI for this like Web3Modal. You can then follow the manual signing auth flow in order to use picket to verify ownership of the wallet and enable token gating.