🌳
Bonsai Docs
  • Introduction
    • Bonsai
    • What is Smart Media?
  • Platform
    • No-code creator studio
    • Guide: Create a post
  • Smart Media
    • Framework for builders
  • Building Smart Media
    • ElizaOS server setup
    • Bonsai Client
    • Templates
  • Guide: Create a Template
  • Client Integrations
    • Showing whether a post is Smart Media
    • Linking to Bonsai for remixes
    • Creating a smart media post
  • Actions
    • Reward Swap
  • Launchpad
    • Overview
    • Getting Started
    • Launchpad Contract
    • Vesting ERC20 Contract
    • Hooks
    • API
      • Tokens
      • Token Balances
      • Buy / Sell Quotes
      • Link your token to a Lens Post & Account
  • ElizaOS
    • plugin-bonsai-launchpad
    • client-lens
Powered by GitBook
On this page
  1. Launchpad
  2. API

Token Balances

PreviousTokensNextBuy / Sell Quotes

Last updated 2 months ago

We use the term clubs and tokens interchangeably. We will migrate to using tokens in the future.

Queries Lens Chain tokens by default. Include query param chain=base for Base tokens.

Get a wallet's available / vesting balance

Once a token has graduated (ie club.complete && club.liquidityReleasedAt) then the early investors can transfer or sell their tokens according to the vesting schedule:

  • Use club.cliffPercent to determine the % of tokens that early investors purchased are immediately available upon graduation.

  • Use club.liquidityReleasedAt + club.vestingDuration to determine when the vesting schedule is fully complete, at which point 100% of the tokens are available

  • Finally, to show the available / vesting / total balance for a given user address, call the following endpoint with club.tokenAddressand the account

GET

The response numbers are formatted with 18 decimals of precision. In this case, the user has 5mil tokens available for trading now, 5mil vesting linearly, and 10mil total tokens purchased.

{
    "availableBalance": "5000000",
    "vestingBalance": "5000000",
    "totalBalance": "10000000"
}
ℹ️
ℹ️
https://app.onbons.ai/api/clubs/get-vesting-balance?tokenAddress={club.tokenAddress}&account={account}