Getting started

Start integrating Fletch wallet into your Dapp to offer users a friendly experience and gateway to interact with the Aptos Blockchain.

Installation

To get started with Fletch Wallet, you have to first install the fletch wallet extension here.

Once Fletch wallet is installed, ensure to back up your Secret Recovery Phrase.

Connection

To access Fletch Wallet, clients must connect (Sign-in) to Fletch Wallet first. The connection request can be initiated by calling window.fletch.connect().

See code below for connection to Fletch Wallet:

if (window.fletch) { // Check if Fletch Wallet is installed.
    try {
        let account = await window.fletch.connect();
        console.log(account) // { address: "0x123456789abcdef...", publicKey: "0x123456789abcdef..." }
    } catch (error) {
        console.log(error) // user rejected request.
    }
} else {
    window.open("http://fletchwallet.io", "_blank");
}

Get connected state

let connected = await window.fletch.isConnected();
console.log(connected() // true | false

Disconnection

Clients can disconnect from Fletch Wallet by calling window.fletch.disconnect().

N/B: After wallet disconnection, the user must re-connect to access Fletch Wallet.

See the code below to disconnect Fletch wallet:

await window.fletch.disconnect()

Last updated