VeChain Kit Docs
ResourcesPrivyVeChainChangelog
  • VeChain Kit
    • Intro
    • Quickstart
    • Migrations
      • Migrate from DAppKit
      • Migrate Social Login Users
      • Smart Accounts v1 to v3
    • Troubleshooting
    • Connection Types
    • Send Transactions
    • Sign Messages
    • Text Records (avatar & co.)
    • Hooks
      • Wallet
      • Smart Account
      • Blockchain Hooks
      • Oracle
      • VeBetterDAO
      • veDelegate
      • vetDomains
      • Utils
      • Indexer
      • Ipfs
      • NFTs
      • Transactions
      • Signing
      • Login
    • Components
      • WalletButton
      • Open targeted modals
      • Profile Card
      • Transaction Modal
      • Transaction Toast
  • Configs
  • Utils
  • Social Login
    • Embedded Wallets
    • Smart Accounts
    • Fee Delegation
Powered by GitBook
On this page
  • VeDelegate Hooks
  • Token Hooks
  • Usage Example

Was this helpful?

Edit on GitHub
Export as PDF
  1. VeChain Kit
  2. Hooks

veDelegate

VeDelegate Hooks

The hooks provide tools for interacting with VeDelegate token and functionality:

Token Hooks

  • useGetVeDelegateBalance: Retrieves the VeDelegate token balance for a given address

Usage Example

// Example usage of VeDelegate hooks
import { useGetVeDelegateBalance } from '@vechain/vechain-kit';

const ExampleComponent = () => {
    const userAddress = "0x..."; // User's wallet address

    // Get VeDelegate token balance
    const { data: veDelegateBalance, isLoading } = useGetVeDelegateBalance(userAddress);

    console.log(
        'VeDelegate Balance:',
        veDelegateBalance,
        'Loading:',
        isLoading
    );

    return (
        // Your component JSX here
    );
};

export default ExampleComponent;

/*
Note: The VeDelegate balance query will only be enabled when:
- A valid thor connection is available
- A valid address is provided
- A valid network type is configured

The balance is returned as a string representing the token amount.
*/
PreviousVeBetterDAONextvetDomains

Last updated 2 months ago

Was this helpful?