Skip to content

Conversation

@TarikGul
Copy link
Member

@TarikGul TarikGul commented Dec 15, 2025

Adds optional vesting calculation fields to /accounts/{accountId}/vesting-info and
/rc/accounts/{address}/vesting-info endpoints.

Usage

GET /accounts/{address}/vesting-info?includeClaimable=true

New response fields (when includeClaimable=true)

  • vested (per schedule) - Amount vested based on time elapsed
  • vestedBalance - Total vested across all schedules
  • vestingTotal - Total locked across all schedules
  • vestedClaimable - Actual claimable amount (accounts for already claimed tokens)
  • blockNumberForCalculation - Block number used for calculation
  • blockNumberSource - 'relay' or 'self'

Example response

{
  "at": { "hash": "0x...", "height": "12345" },
  "vesting": [
    {
      "locked": "1000000000000",
      "perBlock": "1000000",
      "startingBlock": "1000",
      "vested": "500000000000"
    }
  ],
  "vestedBalance": "500000000000",
  "vestingTotal": "1000000000000",
  "vestedClaimable": "500000000000",
  "blockNumberForCalculation": "501000",
  "blockNumberSource": "relay"
}

Migration behavior

Vesting migrated from relay chains to Asset Hub. The calculation logic varies based on chain type and migration
state:

Vesting migrated from relay chains to Asset Hub. The calculation logic varies based on chain type and migration
state:

Chain Migration State Behavior
Relay Chain Pre-migration Uses relay chain's own block number (blockNumberSource: 'self')
Relay Chain During migration Returns vestedClaimable: '0' (claims paused)
Relay Chain Post-migration Returns vestedClaimable: '0' (vesting moved to Asset Hub)
Asset Hub Pre-migration Returns raw vesting data only (no calculations)
Asset Hub During migration Returns vestedClaimable: '0' (claims paused)
Asset Hub Post-migration Uses relay chain inclusion block number (blockNumberSource: 'relay'). Requires
relay chain connection via SAS_SUBSTRATE_MULTI_CHAIN_URL.

Note

This PR also abstracts the relay chain block search logic to make it more modular and reusable across different
services.

@TarikGul TarikGul requested a review from a team as a code owner December 15, 2025 21:58
@bee344
Copy link
Contributor

bee344 commented Dec 15, 2025

@TarikGul Shouldn't the openapi docs be updated as well?

@TarikGul
Copy link
Member Author

@TarikGul Shouldn't the openapi docs be updated as well?

Yup perfect timing, just pushed them up :)

Copy link
Contributor

@bee344 bee344 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of unnecesary descriptions in the docs, other than that it looks solid.

@TarikGul TarikGul merged commit afb3ba6 into master Dec 16, 2025
14 checks passed
@TarikGul TarikGul deleted the tg-vesting-unlockable branch December 16, 2025 04:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants