stacks-blockchain-api icon indicating copy to clipboard operation
stacks-blockchain-api copied to clipboard

Stacking page API work

Open BLuEScioN opened this issue 1 year ago • 1 comments

The explorer needs the API team to add certain stacking related data to existing API endpoints and new endpoints in order to make the new stacking page designs possible

Stacking page design: https://www.figma.com/design/gsgfw9WmMbETBEC4FbY2H9/Stacks-Explorer-%5BRedesign%5D?node-id=18-992&node-type=canvas&t=zJcwzoSDx8txT3UW-0

This notion doc describes this work in detail: https://www.notion.so/hiropbc/Stacking-Page-API-Requirements-a90981dbeef6465ba23b96a9297d6128

BLuEScioN avatar Oct 07 '24 22:10 BLuEScioN

So far I think we're looking at the following tasks:

  • Add pool addr to /extended/v2/pox/cycles/<cycle>/signers/<signer_key>/stackers response for stacker_type: pooled entries.
  • Create new endpoint /extended/v2/pox/cycle/<cycle>/pools which lists previously seen delegated_to: <principal> pools (queried from the stacking events table).
  • Add BTC rewards to the new endpoint /extended/v2/pox/cycle/<cycle>/pools (should be queryable from the /new_burn_block event data).
  • Add total STX stacked and total BTC paid to the /extended/v2/pox/cycles/{cycle_number} endpoint (btc amounts also queried from the /new_burn_block event data).
  • Modify stacks-core /new_block event to include something like a pox_cycle: { cycle_id: number; burn_block_start: number; burn_block_end: number; } property. Or modify the stack-core /new_burn_block event to include pox cycle ID. Unless we can already determine this from existing data, I don't think we can currently calculate BTC rewards for a pox cycle.

zone117x avatar Oct 08 '24 15:10 zone117x