connectWallet
Connects to a Solana Web3 wallet:
Parameters:
adapter (optional, default:
SOLPay.adapters.CURRENT_ADAPTER || SOLPay.adapters.PHANTOM
) - the wallet to use for the connectionCurrent Adapter:
SOLPay.adapters.CURRENT_ADAPTER
(or leave the adapter field blank)Phantom:
SOLPay.adapters.PHANTOM
Solflare:
SOLPay.adapters.SOLFLARE
Slope:
SOLPay.adapters.SLOPE
Glow:
SOLPay.adapters.GLOW
Exodus:
SOLPay.adapters.EXODUS
Brave:
SOLPay.adapters.BRAVE
Adapters:
For more information on adapters, see adapters.
Returns:
object ({"address": "..."}
) - the wallet details for the connected wallet
address: string (
"..."
) - the address of the wallet
Throws:
SOL Pay SDK Fatal Error: Invalid adapter ${adapter}.
- an invalid adapter was usedSOL Pay SDK Fatal Error: No adapter found.
- could not find an adapterSOL Pay SDK Fatal Error: Solana wallet not found!
- could not find the wallet installed in the user's browserSOL Pay SDK Fatal Error: Could not connect to Solana wallet!
- could not connect to the wallet
Side Effects:
SOL Pay will attempt to open the wallet's official website in a new window if it cannot find the wallet installed in the browser (
SOL Pay SDK Fatal Error: Solana wallet not found!
).Phantom: phantom.app
Solflare: solflare.com
Slope: slope.finance
Glow: glow.app
Exodus: www.exodus.com/browser-extension
Brave: brave.com/wallet
Last updated