Skip to content

Developer Guide ​

Integrate Cave Wallet into your dApp with ease.

Overview ​

Cave Wallet provides a seamless way to connect your dApp to the Gno.land blockchain. Users can:

  • Connect their wallet
  • Sign transactions
  • Interact with smart contracts

Quick Start ​

Installation ​

bash
npm install @cave/sdk
bash
yarn add @cave/sdk
bash
pnpm add @cave/sdk

Basic Usage ​

javascript
import { CaveWallet } from '@cave/sdk';

// Check if Cave is installed
const isInstalled = await CaveWallet.isInstalled();

// Connect to wallet
const wallet = await CaveWallet.connect();

// Get account
const account = await wallet.getAccount();
console.log('Address:', account.address);

Integration Guides ​

GuideDescription
Connect to dAppWallet connection flow
Sign TransactionsTransaction signing
API ReferenceComplete API docs

Features ​

Wallet Detection ​

javascript
if (window.cave) {
  console.log('Cave Wallet is installed!');
}

Account Management ​

javascript
// Get current account
const account = await wallet.getAccount();

// Listen for account changes
wallet.on('accountChanged', (newAccount) => {
  console.log('Account changed:', newAccount);
});

Transaction Signing ​

javascript
const tx = {
  to: 'g1recipient...',
  amount: '1000000ugnot',
};

const result = await wallet.signAndBroadcast(tx);

Best Practices ​

  1. Always check wallet installation before attempting to connect
  2. Handle rejections gracefully - users may decline connection
  3. Display clear transaction info before requesting signatures
  4. Listen for account changes to update UI accordingly
  5. Test on testnet before mainnet deployment

Support ​

Need help integrating?

The Gno.land Wallet