🌳
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
    • Staking data
    • Latest Bonsai posts
  • ElizaOS
    • plugin-bonsai
Powered by GitBook
On this page
  1. API

Staking data

PreviousLink your token to a Lens Post & AccountNextLatest Bonsai posts

Last updated 5 hours ago

Get staking data for a given address

Returns a list of stakes and staking summary

The full amount staked by the user is formatEther(data.summary.totalStaked)

GET https://app.onbons.ai/api/bonsai/get-staking-data?address={userAddress}

{
    "stakes": [
        {
            "__typename": "Stake",
            "id": "0x3078323866663865343537666566393837306239643135323966653638666262393563333138316636342d30",
            "amount": "1000000000000000000000",
            "lockupPeriod": "0",
            "unlockTime": "1743806203",
            "stakeIndex": "0",
            "isActive": true,
            "createdAt": "1743806203",
            "unstakeTime": null
        },
        {
            "__typename": "Stake",
            "id": "0x3078323866663865343537666566393837306239643135323966653638666262393563333138316636342d31",
            "amount": "10000000000000000000000",
            "lockupPeriod": "15552000",
            "unlockTime": "1759358270",
            "stakeIndex": "1",
            "isActive": true,
            "createdAt": "1743806270",
            "unstakeTime": null
        },
        {
            "__typename": "Stake",
            "id": "0x3078323866663865343537666566393837306239643135323966653638666262393563333138316636342d32",
            "amount": "10000000000000000000000",
            "lockupPeriod": "0",
            "unlockTime": "1744215490",
            "stakeIndex": "2",
            "isActive": true,
            "createdAt": "1744215490",
            "unstakeTime": null
        }
    ],
    "summary": {
        "__typename": "StakingSummary",
        "id": "0x28ff8e457fef9870b9d1529fe68fbb95c3181f64",
        "totalStaked": "21000000000000000000000",
        "activeStakes": "3",
        "noLockupAmount": "11000000000000000000000",
        "oneMonthLockupAmount": "0",
        "threeMonthLockupAmount": "0",
        "sixMonthLockupAmount": "10000000000000000000000",
        "twelveMonthLockupAmount": "0",
        "lastUpdated": "1744215490"
    }
}
ℹ️