@secondlayer/sdk 13.2.0 → 14.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2357,38 +2357,74 @@ interface SbtcResource {
2357
2357
  /** The peg scoreboard — a single all-time aggregate (no pagination). */
2358
2358
  summary(): Promise<SbtcSummaryEnvelope>;
2359
2359
  }
2360
- /** Per-function action count within a reward cycle. */
2361
- type IndexPoxFunctionCount = {
2362
- function_name: string;
2363
- count: number;
2364
- };
2365
- /** Aggregate stats for one PoX reward cycle — distinct from `index.stacking`
2366
- * (decoded per-call PoX-4 actions); this is the reward-cycle rollup. */
2360
+ /** One pox-5 reward cycle, exact to the node. */
2367
2361
  type IndexPoxCycle = {
2368
2362
  reward_cycle: number;
2369
- /** Total ustx locked across all stack-* calls in this cycle (bigint-safe string). */
2363
+ /** Bitcoin block at which this cycle starts. */
2364
+ start_burn_height: number;
2365
+ /** Bitcoin block at which this cycle's totals froze (the prior cycle's prepare phase). */
2366
+ prepare_start_burn_height: number;
2367
+ /** Bitcoin block at which this cycle ends. */
2368
+ end_burn_height: number;
2369
+ /** STX + bond ustx delegated to signers this cycle (bigint-safe string). */
2370
2370
  total_stacked_ustx: string;
2371
- unique_stackers: number;
2372
- unique_delegators: number;
2373
- action_count: number;
2374
- start_block_height: number;
2375
- end_block_height: number;
2376
- /** True when this is the latest reward cycle (still accumulating new actions). */
2371
+ /** STX actually counted toward rewards — signers below the 50k STX threshold don't count. */
2372
+ reward_eligible_ustx: string;
2373
+ /** Distinct stakers (STX and bond) with a position this cycle. */
2374
+ stakers: number;
2375
+ /** Signers that met the 50,000 STX delegation threshold this cycle. */
2376
+ signers_in_set: number;
2377
+ /** Bond index (as a string key) -> sats staked for this cycle. */
2378
+ bond_sats: Record<string, string>;
2379
+ bond_total_sats: string;
2380
+ /** sBTC currently custodied by pox-5 (non-L1 bonds only) — a running total,
2381
+ * not scoped to this cycle. Not in this endpoint: unclaimed/pending rewards. */
2382
+ sbtc_custodied_sats: string;
2383
+ rewards_allocated_stx: string;
2384
+ rewards_allocated_bond: string;
2385
+ reserve_deposit: string;
2386
+ /** Cumulative STX rewards per micro-STX for this cycle; `null` before the first distribution. */
2387
+ rewards_per_token_stx: string | null;
2388
+ /** Bond index (as a string key) -> cumulative rewards-per-sat for this cycle. */
2389
+ rewards_per_token_bond: Record<string, string>;
2390
+ /** Distributions run for this cycle so far (0, 1, or 2). */
2391
+ distributions: number;
2392
+ rewards_claimed: string;
2393
+ /** Stacks block height this rollup was last computed through. */
2394
+ computed_through_height: number;
2395
+ /** True for the cycle containing the tip's burn height. */
2377
2396
  is_current: boolean;
2378
- function_breakdown: IndexPoxFunctionCount[];
2397
+ /** True once totals can no longer change (the tip has reached
2398
+ * `prepare_start_burn_height`). Closed and current cycles are always
2399
+ * frozen; only a not-yet-started future cycle is open. */
2400
+ is_frozen: boolean;
2401
+ };
2402
+ /** One signer's share of a pox-5 reward cycle. */
2403
+ type IndexPoxCycleSigner = {
2404
+ signer: string;
2405
+ /** Total ustx delegated to this signer this cycle (STX + bond). */
2406
+ delegated_ustx: string;
2407
+ /** STX-only (non-bond) ustx delegated to this signer this cycle. */
2408
+ stx_only_ustx: string;
2409
+ /** STX shares counted toward rewards — 0 unless the signer met the 50k threshold. */
2410
+ reward_shares_ustx: string;
2411
+ in_set: boolean;
2412
+ rewards_claimed: string;
2379
2413
  };
2380
2414
  type PoxCyclesEnvelope = {
2415
+ /** The PoX version this response reports. Currently 5. */
2416
+ pox_version: 5;
2381
2417
  cycles: IndexPoxCycle[];
2382
2418
  /** The next `reward_cycle` to page from (cycles descend), or null at the end. */
2383
2419
  next_cursor: number | null;
2384
2420
  tip: IndexTip;
2385
- /** Present only when the PoX-4 decoder is disabled, explaining an empty feed. */
2386
- notes?: string;
2387
2421
  };
2388
2422
  type PoxCycleEnvelope = {
2389
- cycle: IndexPoxCycle;
2423
+ pox_version: 5;
2424
+ cycle: IndexPoxCycle & {
2425
+ signers: IndexPoxCycleSigner[];
2426
+ };
2390
2427
  tip: IndexTip;
2391
- notes?: string;
2392
2428
  };
2393
2429
  type PoxCyclesListParams = {
2394
2430
  /** A `reward_cycle` to page from; the page returns cycles below it (descending). */
@@ -2396,12 +2432,13 @@ type PoxCyclesListParams = {
2396
2432
  limit?: number;
2397
2433
  };
2398
2434
  type PoxCyclesWalkParams = Omit<PoxCyclesListParams, "limit"> & WalkOptions;
2399
- /** `index.pox` — PoX reward-cycle aggregates. */
2435
+ /** `index.pox` — reward cycles of the current PoX (PoX-5). */
2400
2436
  interface PoxResource {
2401
2437
  cycles: {
2402
2438
  list(params?: PoxCyclesListParams): Promise<PoxCyclesEnvelope>;
2403
2439
  walk(params?: PoxCyclesWalkParams): AsyncIterable<IndexPoxCycle>;
2404
- /** Fetch one reward cycle's aggregate by number; 404 → null. */
2440
+ /** Fetch one reward cycle by number; 404 (unknown cycle, or below pox-5's
2441
+ * first reward cycle 141 — final PoX-4 history, not served here) → null. */
2405
2442
  get(rewardCycle: number): Promise<PoxCycleEnvelope | null>;
2406
2443
  };
2407
2444
  }