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/sdkbash
yarn add @cave/sdkbash
pnpm add @cave/sdkBasic 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
| Guide | Description |
|---|---|
| Connect to dApp | Wallet connection flow |
| Sign Transactions | Transaction signing |
| API Reference | Complete 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
- Always check wallet installation before attempting to connect
- Handle rejections gracefully - users may decline connection
- Display clear transaction info before requesting signatures
- Listen for account changes to update UI accordingly
- Test on testnet before mainnet deployment
Support
Need help integrating?
