@secondlayer/sdk 6.29.1 → 6.31.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.
@@ -1615,6 +1615,73 @@ interface PoxResource {
1615
1615
  get(rewardCycle: number): Promise<PoxCycleEnvelope | null>
1616
1616
  };
1617
1617
  }
1618
+ /** The decoded `pox-5` boot-contract print topics (SIP-045 Bitcoin Staking).
1619
+ * Declared locally rather than imported from the server packages — the SDK is
1620
+ * published and owns its own dependency surface (same as {@link SbtcEventTopic}). */
1621
+ type IndexPox5EventTopic = "set-bond-admin" | "set-pause-admin" | "pause-rewards" | "setup-bond" | "add-to-allowlist" | "register-for-bond" | "update-bond-registration" | "register-signer" | "stake" | "stake-update" | "announce-l1-early-exit" | "unstake-sbtc" | "unstake" | "calculate-rewards" | "bond-distribution" | "claim-rewards" | "claim-staker-rewards-for-signer" | "grant-signer-key" | "revoke-signer-grant";
1622
+ /** A raw decoded PoX-5 print event. Promoted fields cover the hot query paths;
1623
+ * `data` always carries the full decoded tuple, including nested shapes
1624
+ * (`btc-lockup`, `bond-rewards`, `bond-periods`) that have no flat column. */
1625
+ type IndexPox5Event = {
1626
+ cursor: string
1627
+ block_height: number
1628
+ block_time: string | null
1629
+ tx_id: string
1630
+ tx_index: number
1631
+ event_index: number
1632
+ topic: IndexPox5EventTopic
1633
+ staker: string | null
1634
+ signer: string | null
1635
+ signer_manager: string | null
1636
+ bond_index: number | null
1637
+ /** ustx, bigint-safe string. */
1638
+ amount_ustx: string | null
1639
+ /** sats, bigint-safe string. */
1640
+ amount_sats: string | null
1641
+ reward_cycle: number | null
1642
+ first_reward_cycle: number | null
1643
+ unlock_cycle: number | null
1644
+ unlock_burn_height: number | null
1645
+ is_l1_lock: boolean | null
1646
+ signer_key: string | null
1647
+ /** The full decoded print tuple as JSON. */
1648
+ data: unknown
1649
+ };
1650
+ type Pox5EventsEnvelope = {
1651
+ events: IndexPox5Event[]
1652
+ next_cursor: string | null
1653
+ tip: IndexTip
1654
+ reorgs: IndexReorg[]
1655
+ /** Present only when the PoX-5 decoder is disabled, explaining an empty feed. */
1656
+ notes?: string
1657
+ };
1658
+ type Pox5EventsListParams = {
1659
+ cursor?: string | null
1660
+ fromCursor?: string | null
1661
+ limit?: number
1662
+ /** Clamp to the finality boundary — only rows past the reorg margin. */
1663
+ confirmed?: boolean
1664
+ topic?: IndexPox5EventTopic
1665
+ staker?: string
1666
+ signer?: string
1667
+ signerManager?: string
1668
+ bondIndex?: number
1669
+ rewardCycle?: number
1670
+ fromHeight?: number
1671
+ toHeight?: number
1672
+ };
1673
+ type Pox5EventsWalkParams = Omit<Pox5EventsListParams, "limit"> & {
1674
+ batchSize?: number
1675
+ signal?: AbortSignal
1676
+ };
1677
+ /** `index.pox5` — decoded PoX-5 print events, the staking primitive from the
1678
+ * epoch 4.0 hard fork onward (PoX-4's `index.stacking` stream ends there). */
1679
+ interface Pox5Resource {
1680
+ events: {
1681
+ list(params?: Pox5EventsListParams): Promise<Pox5EventsEnvelope>
1682
+ walk(params?: Pox5EventsWalkParams): AsyncIterable<IndexPox5Event>
1683
+ };
1684
+ }
1618
1685
  /**
1619
1686
  * `index.ftTransfers` — callable shorthand for `.list()`, with `.list`/`.walk`
1620
1687
  * still available: `await sl.index.ftTransfers({ contractId })`.
@@ -1729,6 +1796,9 @@ declare class Index extends BaseClient {
1729
1796
  /** PoX reward-cycle aggregates. Distinct from `stacking` (per-call PoX-4
1730
1797
  * actions); `cycles` is the reward-cycle rollup. */
1731
1798
  readonly pox: PoxResource;
1799
+ /** Decoded PoX-5 print events (SIP-045 Bitcoin Staking) — the raw pox-5
1800
+ * boot-contract log, all 19 topics. Distinct from `stacking` (PoX-4 era). */
1801
+ readonly pox5: Pox5Resource;
1732
1802
  private listFtTransfers;
1733
1803
  private listNftTransfers;
1734
1804
  /** Shared keyset-pagination loop for every `walk*` feed: seed the cursor from
@@ -1770,6 +1840,8 @@ declare class Index extends BaseClient {
1770
1840
  private listSbtcEvents;
1771
1841
  private walkSbtcEvents;
1772
1842
  private getSbtcSummary;
1843
+ private listPox5Events;
1844
+ private walkPox5Events;
1773
1845
  private listPoxCycles;
1774
1846
  private walkPoxCycles;
1775
1847
  private getPoxCycle;
@@ -810,6 +810,12 @@ class Index extends BaseClient {
810
810
  get: (rewardCycle) => this.getPoxCycle(rewardCycle)
811
811
  }
812
812
  };
813
+ pox5 = {
814
+ events: {
815
+ list: (params = {}) => this.listPox5Events(params),
816
+ walk: (params = {}) => this.walkPox5Events(params)
817
+ }
818
+ };
813
819
  async listFtTransfers(params = {}) {
814
820
  return this.request("GET", `/v1/index/ft-transfers${buildQuery({
815
821
  cursor: params.cursor,
@@ -1038,6 +1044,25 @@ class Index extends BaseClient {
1038
1044
  async getSbtcSummary() {
1039
1045
  return this.request("GET", "/v1/index/sbtc/summary");
1040
1046
  }
1047
+ async listPox5Events(params = {}) {
1048
+ return this.request("GET", `/v1/index/pox5/events${buildQuery({
1049
+ cursor: params.cursor,
1050
+ from_cursor: params.fromCursor,
1051
+ limit: params.limit,
1052
+ confirmed: params.confirmed,
1053
+ topic: params.topic,
1054
+ staker: params.staker,
1055
+ signer: params.signer,
1056
+ signer_manager: params.signerManager,
1057
+ bond_index: params.bondIndex,
1058
+ reward_cycle: params.rewardCycle,
1059
+ from_height: params.fromHeight,
1060
+ to_height: params.toHeight
1061
+ })}`);
1062
+ }
1063
+ walkPox5Events(params = {}) {
1064
+ return this.keysetWalk(params, (page) => this.listPox5Events({ ...params, ...page }), (e) => e.events);
1065
+ }
1041
1066
  async listPoxCycles(params = {}) {
1042
1067
  return this.request("GET", `/v1/index/pox/cycles${buildQuery({
1043
1068
  cursor: params.cursor,
@@ -1720,5 +1745,5 @@ export {
1720
1745
  Subgraphs
1721
1746
  };
1722
1747
 
1723
- //# debugId=D9521B9F6768A30F64756E2164756E21
1748
+ //# debugId=815357866F80FC1964756E2164756E21
1724
1749
  //# sourceMappingURL=index.js.map