API Reference
Complete API reference for the Gorbag wallet adapter
GorbagProvider
Props
autoConnect?: boolean- Automatically connect if wallet is already connectedonError?: (error: Error) => void- Callback for handling errorswallets: WalletAdapter[]- Array of available wallets
useWallet Hook
Returns
publicKey: PublicKey | null- The public key of the connected walletwallets: WalletAdapter[]- List of available walletsconnected: boolean- Connection statusconnecting: boolean- Connecting statusdisconnecting: boolean- Disconnecting statusselect(walletName: string): void- Select a walletconnect(): Promise<void>- Connect to the selected walletdisconnect(): Promise<void>- Disconnect from the walletsendTransaction(transaction, connection): Promise<string>- Send a transaction
useConnection Hook
Returns
connection: Connection- Solana connection object
Transaction Methods
sendTransaction
Sends a transaction to the network
Parameters:
transaction: Transaction | VersionedTransaction- The transaction to sendconnection: Connection- The network connectionoptions?: SendOptions- Transaction options
Returns: Promise<string> - The transaction signature
Error Types
- WalletNotReadyError: Wallet is not ready to be used
- WalletLoadError: Wallet couldn't be loaded
- WalletConfigError: Wallet is misconfigured
- WalletConnectionError: Wallet failed to connect
- WalletDisconnectedError: Wallet is disconnected
- WalletDisconnectionError: Wallet failed to disconnect
- WalletAccountError: Wallet failed to get the account
- WalletPublicKeyError: Wallet failed to get the public key
- WalletSendTransactionError: Wallet failed to send transaction
- WalletSignTransactionError: Wallet failed to sign transaction
- WalletSignAllTransactionsError: Wallet failed to sign all transactions
- WalletSignMessageError: Wallet failed to sign message