🥜
Peanut Docs
  • Learn
    • 🥜What is Peanut?
    • 🏦Cashout
      • Supported geographies
    • 📩How to use Peanut Links?
      • ⚙️How do Peanut Links Work?
      • 🔒Trust assumptions
    • 📌Use cases
    • 📚Case Studies
      • 🎁Welcome Packs
      • 📘Raffles to Boost UWAs and Transactions
      • 📗Sending Testnet Tokens at Hackathons
      • 📙IRL Events Marketing
    • ⛓️Supported Chains and Tokens
    • 💰Pricing
    • 🆘Support
  • Integrate
    • Using the SDK
      • Create ClaimLinks
        • Create Link
        • Batch Create Links
        • Create Raffle Links
        • Create Multi-Token Link
        • Create NFT Link
        • Create Gasless Links
        • Create Branded Links
      • Claim
        • Claim Link
        • Claim Gasless Link
        • Claim Cross-Chain Link
        • Claim Raffle Link
        • Claim Link as Sender (Reclaiming)
      • Create Request Link
      • Pay a Request Link
      • Pay a Request Link X-Chain
      • Utils
        • Get Link Details
        • Cross-chain
          • Get Supported Destination Chains
          • Get Supported Destination Tokens
          • Get Cross-Chain Options
          • Get Cross-Chain Route
        • Raffle (Legacy)
          • Get Raffle Info
          • Get User Raffle Status
          • Get Raffle Leaderboard
        • Get Default Provider
        • Get Supported Peanut Chains
        • Toggle Verbosity
        • EthersV5 <> Peanut Transaction Types
        • Estimate Fee Options
        • Get Random String
        • Get all deposits for an Address
        • Get Token Balance
      • API Keys
      • White-Labelling
      • Troubleshooting
      • SDK FAQ
    • Embedding an IFrame
    • Integrate Directly in Smart Contracts
    • Wallet Integrations
      • 🎬UI Examples
  • Other
    • 👾Bug bounties
    • 🔓Security Audit
    • 📜Peanut Protocol Contracts
  • BLOGS
    • Transfer Abstraction
    • Can We Sidestep Onchain Identity?
  • Additional Links
    • 🐦Twitter
    • 😊Telegram
    • 🤙Discord
    • 🥜Work with Us
    • 🎨Press Kit
    • 👨‍⚖️Contact and Legal
Powered by GitBook
On this page
  1. Integrate
  2. Using the SDK
  3. Utils

Get Token Balance

Need to check if the user has enough funds to execute a transaction? Have a look here how you can!

This function will return the wallet balance of a certain token.

const balance = await getTokenBalance({
                chainId: '137',
                tokenAddress: '0x0000000000000000000000000000000000000000',
                walletAddress: '0x...',
                tokenDecimals: 18, //optional
                tokenType: 0, //optional, use interfaces.EPeanutLinkType
            })
PreviousGet all deposits for an AddressNextAPI Keys

Last updated 1 year ago