Connecting Finnie
connect
The connect
method is the only way to obtain the necessary permissions required to use Finnie for signing transactions. This function will return a promise, allowing you to await the result of connect approval. A popup will appear, allowing you to either accept or reject the request. You can also select a specific wallet address to connect to. If the request is approved, the returned promise will be resolved with the PublicKey of the connected wallet; otherwise, the returned promise will be rejected.
window.solana.connect(): Promise<PublicKey>
try {
const connectedPublickey = await window.solana.connect()
} catch (error) {
// request rejected
console.error(error) // { code: 4001, message: 'User rejected the request.' }
}