API Reference

Complete API reference for the Gorbag wallet adapter

GorbagProvider

Props

  • autoConnect?: boolean - Automatically connect if wallet is already connected
  • onError?: (error: Error) => void - Callback for handling errors
  • wallets: WalletAdapter[] - Array of available wallets

useWallet Hook

Returns

  • publicKey: PublicKey | null - The public key of the connected wallet
  • wallets: WalletAdapter[] - List of available wallets
  • connected: boolean - Connection status
  • connecting: boolean - Connecting status
  • disconnecting: boolean - Disconnecting status
  • select(walletName: string): void - Select a wallet
  • connect(): Promise<void> - Connect to the selected wallet
  • disconnect(): Promise<void> - Disconnect from the wallet
  • sendTransaction(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 send
  • connection: Connection - The network connection
  • options?: 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