@secondlayer/stacks 6.2.0 → 6.2.1

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.
@@ -1454,6 +1454,7 @@ type WebSocketTransport = Transport & {
1454
1454
  * HTTP requests use the resolved RPC URL; subscriptions use the WS endpoint.
1455
1455
  */
1456
1456
  declare function webSocket(url?: string, config?: WebSocketTransportConfig): TransportFactory;
1457
+ /** The decoded event types. Index and Streams expose the same set. */
1457
1458
  declare const DECODED_EVENT_TYPES: readonly ["stx_transfer", "stx_mint", "stx_burn", "stx_lock", "ft_transfer", "ft_mint", "ft_burn", "nft_transfer", "nft_mint", "nft_burn", "print"];
1458
1459
  type DecodedEventType = (typeof DECODED_EVENT_TYPES)[number];
1459
1460
  /** Opt-in node vm_events, stored names. Parallel to DECODED_EVENT_TYPES — not
@@ -1873,18 +1874,74 @@ type Fields<T extends ChainEventFilterType> = Omit<SpecFor<T>, "type">;
1873
1874
  * annotation on exported values (an inferred object of generic factories
1874
1875
  * collapses to `{}` in the emitted declarations). */
1875
1876
  interface OnNamespace {
1877
+ /**
1878
+ * Matches STX transfers.
1879
+ *
1880
+ * @param fields The members of {@link StxTransferSpec}, without `type`.
1881
+ */
1876
1882
  stxTransfer(fields?: Fields<"stx_transfer">): ChainEventFilter<"stx_transfer">;
1883
+ /**
1884
+ * Matches STX mints.
1885
+ *
1886
+ * @param fields The members of {@link StxMintSpec}, without `type`.
1887
+ */
1877
1888
  stxMint(fields?: Fields<"stx_mint">): ChainEventFilter<"stx_mint">;
1889
+ /**
1890
+ * Matches STX burns.
1891
+ *
1892
+ * @param fields The members of {@link StxBurnSpec}, without `type`.
1893
+ */
1878
1894
  stxBurn(fields?: Fields<"stx_burn">): ChainEventFilter<"stx_burn">;
1895
+ /**
1896
+ * Matches STX lock events.
1897
+ *
1898
+ * @param fields The members of {@link StxLockSpec}, without `type`.
1899
+ */
1879
1900
  stxLock(fields?: Fields<"stx_lock">): ChainEventFilter<"stx_lock">;
1901
+ /**
1902
+ * Matches fungible token transfers.
1903
+ *
1904
+ * @param fields The members of {@link FtTransferSpec}, without `type`.
1905
+ */
1880
1906
  ftTransfer(fields?: Fields<"ft_transfer">): ChainEventFilter<"ft_transfer">;
1907
+ /**
1908
+ * Matches fungible token mints.
1909
+ *
1910
+ * @param fields The members of {@link FtMintSpec}, without `type`.
1911
+ */
1881
1912
  ftMint(fields?: Fields<"ft_mint">): ChainEventFilter<"ft_mint">;
1913
+ /**
1914
+ * Matches fungible token burns.
1915
+ *
1916
+ * @param fields The members of {@link FtBurnSpec}, without `type`.
1917
+ */
1882
1918
  ftBurn(fields?: Fields<"ft_burn">): ChainEventFilter<"ft_burn">;
1919
+ /**
1920
+ * Matches NFT transfers.
1921
+ *
1922
+ * @param fields The members of {@link NftTransferSpec}, without `type`.
1923
+ */
1883
1924
  nftTransfer(fields?: Fields<"nft_transfer">): ChainEventFilter<"nft_transfer">;
1925
+ /**
1926
+ * Matches NFT mints.
1927
+ *
1928
+ * @param fields The members of {@link NftMintSpec}, without `type`.
1929
+ */
1884
1930
  nftMint(fields?: Fields<"nft_mint">): ChainEventFilter<"nft_mint">;
1931
+ /**
1932
+ * Matches NFT burns.
1933
+ *
1934
+ * @param fields The members of {@link NftBurnSpec}, without `type`.
1935
+ */
1885
1936
  nftBurn(fields?: Fields<"nft_burn">): ChainEventFilter<"nft_burn">;
1886
- /** `abi` literals are preserved (`const A`) so `toSubgraphSource()` keeps
1887
- * typing `event.input` inside `defineSubgraph`. */
1937
+ /**
1938
+ * Matches contract calls.
1939
+ *
1940
+ * `abi` literals are preserved (`const A`), so `toSubgraphSource()` keeps
1941
+ * typing `event.input` inside `defineSubgraph`.
1942
+ *
1943
+ * @param fields The members of {@link ContractCallSpec}, without `type`.
1944
+ */
1888
1945
  contractCall<const A extends AbiContract | undefined = undefined>(fields?: Omit<SpecFor<"contract_call">, "type" | "abi"> & {
1889
1946
  abi?: A
1890
1947
  }): ChainEventFilter<"contract_call", {
@@ -1892,10 +1949,21 @@ interface OnNamespace {
1892
1949
  } & Omit<SpecFor<"contract_call">, "type" | "abi"> & {
1893
1950
  abi?: A
1894
1951
  }>;
1952
+ /**
1953
+ * Matches contract deployments.
1954
+ *
1955
+ * @param fields The members of {@link ContractDeploySpec}, without `type`.
1956
+ */
1895
1957
  contractDeploy(fields?: Fields<"contract_deploy">): ChainEventFilter<"contract_deploy">;
1896
- /** Canonical member is `print_event` (as Subgraphs and Webhooks spell
1897
- * it); `toIndexParams`/`toStreamsParams` project to `print`. `prints`
1898
- * literals are preserved (`const P`) for per-topic `event.data` narrowing. */
1958
+ /**
1959
+ * Matches `print` events.
1960
+ *
1961
+ * The canonical member is `print_event`, as Subgraphs and Webhooks spell it;
1962
+ * `toIndexParams` and `toStreamsParams` project to `print`. `prints` literals
1963
+ * are preserved (`const P`), so `event.data` narrows per topic.
1964
+ *
1965
+ * @param fields The members of {@link PrintEventSpec}, without `type`.
1966
+ */
1899
1967
  print<const P extends Record<string, Record<string, PrintFieldType>> | undefined = undefined>(fields?: Omit<SpecFor<"print_event">, "type" | "prints"> & {
1900
1968
  prints?: P
1901
1969
  }): ChainEventFilter<"print_event", {
@@ -1903,15 +1971,75 @@ interface OnNamespace {
1903
1971
  } & Omit<SpecFor<"print_event">, "type" | "prints"> & {
1904
1972
  prints?: P
1905
1973
  }>;
1974
+ /**
1975
+ * Matches contract calls made from inside another contract.
1976
+ *
1977
+ * @param fields The members of {@link NestedContractCallSpec}, without `type`.
1978
+ */
1906
1979
  nestedCall(fields?: Fields<"nested_contract_call">): ChainEventFilter<"nested_contract_call">;
1980
+ /**
1981
+ * Matches data variable writes.
1982
+ *
1983
+ * @param fields The members of {@link VarSetSpec}, without `type`.
1984
+ */
1907
1985
  varSet(fields?: Fields<"var_set">): ChainEventFilter<"var_set">;
1986
+ /**
1987
+ * Matches `map-set` writes.
1988
+ *
1989
+ * @param fields The members of {@link MapSetSpec}, without `type`.
1990
+ */
1908
1991
  mapSet(fields?: Fields<"map_set">): ChainEventFilter<"map_set">;
1992
+ /**
1993
+ * Matches `map-insert` writes.
1994
+ *
1995
+ * @param fields The members of {@link MapInsertSpec}, without `type`.
1996
+ */
1909
1997
  mapInsert(fields?: Fields<"map_insert">): ChainEventFilter<"map_insert">;
1998
+ /**
1999
+ * Matches `map-delete` writes.
2000
+ *
2001
+ * @param fields The members of {@link MapDeleteSpec}, without `type`.
2002
+ */
1910
2003
  mapDelete(fields?: Fields<"map_delete">): ChainEventFilter<"map_delete">;
2004
+ /**
2005
+ * Matches sBTC deposits.
2006
+ *
2007
+ * Webhooks only: it has no Index, Streams or subgraph projection.
2008
+ *
2009
+ * @param fields The members of {@link SbtcDepositSpec}, without `type`.
2010
+ */
1911
2011
  sbtcDeposit(fields?: Fields<"sbtc_deposit">): ChainEventFilter<"sbtc_deposit">;
2012
+ /**
2013
+ * Matches sBTC withdrawal requests.
2014
+ *
2015
+ * Webhooks only: it has no Index, Streams or subgraph projection.
2016
+ *
2017
+ * @param fields The members of {@link SbtcWithdrawalCreateSpec}, without `type`.
2018
+ */
1912
2019
  sbtcWithdrawalCreate(fields?: Fields<"sbtc_withdrawal_create">): ChainEventFilter<"sbtc_withdrawal_create">;
2020
+ /**
2021
+ * Matches accepted sBTC withdrawals.
2022
+ *
2023
+ * Webhooks only: it has no Index, Streams or subgraph projection.
2024
+ *
2025
+ * @param fields The members of {@link SbtcWithdrawalAcceptSpec}, without `type`.
2026
+ */
1913
2027
  sbtcWithdrawalAccept(fields?: Fields<"sbtc_withdrawal_accept">): ChainEventFilter<"sbtc_withdrawal_accept">;
2028
+ /**
2029
+ * Matches rejected sBTC withdrawals.
2030
+ *
2031
+ * Webhooks only: it has no Index, Streams or subgraph projection.
2032
+ *
2033
+ * @param fields The members of {@link SbtcWithdrawalRejectSpec}, without `type`.
2034
+ */
1914
2035
  sbtcWithdrawalReject(fields?: Fields<"sbtc_withdrawal_reject">): ChainEventFilter<"sbtc_withdrawal_reject">;
2036
+ /**
2037
+ * Matches sBTC withdrawals whose sweep has confirmed.
2038
+ *
2039
+ * Webhooks only: it has no Index, Streams or subgraph projection.
2040
+ *
2041
+ * @param fields The members of {@link SbtcWithdrawalSweptConfirmedSpec}, without `type`.
2042
+ */
1915
2043
  sbtcWithdrawalSweptConfirmed(fields?: Fields<"sbtc_withdrawal_swept_confirmed">): ChainEventFilter<"sbtc_withdrawal_swept_confirmed">;
1916
2044
  }
1917
2045
  /**
@@ -1454,6 +1454,7 @@ type WebSocketTransport = Transport & {
1454
1454
  * HTTP requests use the resolved RPC URL; subscriptions use the WS endpoint.
1455
1455
  */
1456
1456
  declare function webSocket(url?: string, config?: WebSocketTransportConfig): TransportFactory;
1457
+ /** The decoded event types. Index and Streams expose the same set. */
1457
1458
  declare const DECODED_EVENT_TYPES: readonly ["stx_transfer", "stx_mint", "stx_burn", "stx_lock", "ft_transfer", "ft_mint", "ft_burn", "nft_transfer", "nft_mint", "nft_burn", "print"];
1458
1459
  type DecodedEventType = (typeof DECODED_EVENT_TYPES)[number];
1459
1460
  /** Opt-in node vm_events, stored names. Parallel to DECODED_EVENT_TYPES — not
@@ -1873,18 +1874,74 @@ type Fields<T extends ChainEventFilterType> = Omit<SpecFor<T>, "type">;
1873
1874
  * annotation on exported values (an inferred object of generic factories
1874
1875
  * collapses to `{}` in the emitted declarations). */
1875
1876
  interface OnNamespace {
1877
+ /**
1878
+ * Matches STX transfers.
1879
+ *
1880
+ * @param fields The members of {@link StxTransferSpec}, without `type`.
1881
+ */
1876
1882
  stxTransfer(fields?: Fields<"stx_transfer">): ChainEventFilter<"stx_transfer">;
1883
+ /**
1884
+ * Matches STX mints.
1885
+ *
1886
+ * @param fields The members of {@link StxMintSpec}, without `type`.
1887
+ */
1877
1888
  stxMint(fields?: Fields<"stx_mint">): ChainEventFilter<"stx_mint">;
1889
+ /**
1890
+ * Matches STX burns.
1891
+ *
1892
+ * @param fields The members of {@link StxBurnSpec}, without `type`.
1893
+ */
1878
1894
  stxBurn(fields?: Fields<"stx_burn">): ChainEventFilter<"stx_burn">;
1895
+ /**
1896
+ * Matches STX lock events.
1897
+ *
1898
+ * @param fields The members of {@link StxLockSpec}, without `type`.
1899
+ */
1879
1900
  stxLock(fields?: Fields<"stx_lock">): ChainEventFilter<"stx_lock">;
1901
+ /**
1902
+ * Matches fungible token transfers.
1903
+ *
1904
+ * @param fields The members of {@link FtTransferSpec}, without `type`.
1905
+ */
1880
1906
  ftTransfer(fields?: Fields<"ft_transfer">): ChainEventFilter<"ft_transfer">;
1907
+ /**
1908
+ * Matches fungible token mints.
1909
+ *
1910
+ * @param fields The members of {@link FtMintSpec}, without `type`.
1911
+ */
1881
1912
  ftMint(fields?: Fields<"ft_mint">): ChainEventFilter<"ft_mint">;
1913
+ /**
1914
+ * Matches fungible token burns.
1915
+ *
1916
+ * @param fields The members of {@link FtBurnSpec}, without `type`.
1917
+ */
1882
1918
  ftBurn(fields?: Fields<"ft_burn">): ChainEventFilter<"ft_burn">;
1919
+ /**
1920
+ * Matches NFT transfers.
1921
+ *
1922
+ * @param fields The members of {@link NftTransferSpec}, without `type`.
1923
+ */
1883
1924
  nftTransfer(fields?: Fields<"nft_transfer">): ChainEventFilter<"nft_transfer">;
1925
+ /**
1926
+ * Matches NFT mints.
1927
+ *
1928
+ * @param fields The members of {@link NftMintSpec}, without `type`.
1929
+ */
1884
1930
  nftMint(fields?: Fields<"nft_mint">): ChainEventFilter<"nft_mint">;
1931
+ /**
1932
+ * Matches NFT burns.
1933
+ *
1934
+ * @param fields The members of {@link NftBurnSpec}, without `type`.
1935
+ */
1885
1936
  nftBurn(fields?: Fields<"nft_burn">): ChainEventFilter<"nft_burn">;
1886
- /** `abi` literals are preserved (`const A`) so `toSubgraphSource()` keeps
1887
- * typing `event.input` inside `defineSubgraph`. */
1937
+ /**
1938
+ * Matches contract calls.
1939
+ *
1940
+ * `abi` literals are preserved (`const A`), so `toSubgraphSource()` keeps
1941
+ * typing `event.input` inside `defineSubgraph`.
1942
+ *
1943
+ * @param fields The members of {@link ContractCallSpec}, without `type`.
1944
+ */
1888
1945
  contractCall<const A extends AbiContract | undefined = undefined>(fields?: Omit<SpecFor<"contract_call">, "type" | "abi"> & {
1889
1946
  abi?: A
1890
1947
  }): ChainEventFilter<"contract_call", {
@@ -1892,10 +1949,21 @@ interface OnNamespace {
1892
1949
  } & Omit<SpecFor<"contract_call">, "type" | "abi"> & {
1893
1950
  abi?: A
1894
1951
  }>;
1952
+ /**
1953
+ * Matches contract deployments.
1954
+ *
1955
+ * @param fields The members of {@link ContractDeploySpec}, without `type`.
1956
+ */
1895
1957
  contractDeploy(fields?: Fields<"contract_deploy">): ChainEventFilter<"contract_deploy">;
1896
- /** Canonical member is `print_event` (as Subgraphs and Webhooks spell
1897
- * it); `toIndexParams`/`toStreamsParams` project to `print`. `prints`
1898
- * literals are preserved (`const P`) for per-topic `event.data` narrowing. */
1958
+ /**
1959
+ * Matches `print` events.
1960
+ *
1961
+ * The canonical member is `print_event`, as Subgraphs and Webhooks spell it;
1962
+ * `toIndexParams` and `toStreamsParams` project to `print`. `prints` literals
1963
+ * are preserved (`const P`), so `event.data` narrows per topic.
1964
+ *
1965
+ * @param fields The members of {@link PrintEventSpec}, without `type`.
1966
+ */
1899
1967
  print<const P extends Record<string, Record<string, PrintFieldType>> | undefined = undefined>(fields?: Omit<SpecFor<"print_event">, "type" | "prints"> & {
1900
1968
  prints?: P
1901
1969
  }): ChainEventFilter<"print_event", {
@@ -1903,15 +1971,75 @@ interface OnNamespace {
1903
1971
  } & Omit<SpecFor<"print_event">, "type" | "prints"> & {
1904
1972
  prints?: P
1905
1973
  }>;
1974
+ /**
1975
+ * Matches contract calls made from inside another contract.
1976
+ *
1977
+ * @param fields The members of {@link NestedContractCallSpec}, without `type`.
1978
+ */
1906
1979
  nestedCall(fields?: Fields<"nested_contract_call">): ChainEventFilter<"nested_contract_call">;
1980
+ /**
1981
+ * Matches data variable writes.
1982
+ *
1983
+ * @param fields The members of {@link VarSetSpec}, without `type`.
1984
+ */
1907
1985
  varSet(fields?: Fields<"var_set">): ChainEventFilter<"var_set">;
1986
+ /**
1987
+ * Matches `map-set` writes.
1988
+ *
1989
+ * @param fields The members of {@link MapSetSpec}, without `type`.
1990
+ */
1908
1991
  mapSet(fields?: Fields<"map_set">): ChainEventFilter<"map_set">;
1992
+ /**
1993
+ * Matches `map-insert` writes.
1994
+ *
1995
+ * @param fields The members of {@link MapInsertSpec}, without `type`.
1996
+ */
1909
1997
  mapInsert(fields?: Fields<"map_insert">): ChainEventFilter<"map_insert">;
1998
+ /**
1999
+ * Matches `map-delete` writes.
2000
+ *
2001
+ * @param fields The members of {@link MapDeleteSpec}, without `type`.
2002
+ */
1910
2003
  mapDelete(fields?: Fields<"map_delete">): ChainEventFilter<"map_delete">;
2004
+ /**
2005
+ * Matches sBTC deposits.
2006
+ *
2007
+ * Webhooks only: it has no Index, Streams or subgraph projection.
2008
+ *
2009
+ * @param fields The members of {@link SbtcDepositSpec}, without `type`.
2010
+ */
1911
2011
  sbtcDeposit(fields?: Fields<"sbtc_deposit">): ChainEventFilter<"sbtc_deposit">;
2012
+ /**
2013
+ * Matches sBTC withdrawal requests.
2014
+ *
2015
+ * Webhooks only: it has no Index, Streams or subgraph projection.
2016
+ *
2017
+ * @param fields The members of {@link SbtcWithdrawalCreateSpec}, without `type`.
2018
+ */
1912
2019
  sbtcWithdrawalCreate(fields?: Fields<"sbtc_withdrawal_create">): ChainEventFilter<"sbtc_withdrawal_create">;
2020
+ /**
2021
+ * Matches accepted sBTC withdrawals.
2022
+ *
2023
+ * Webhooks only: it has no Index, Streams or subgraph projection.
2024
+ *
2025
+ * @param fields The members of {@link SbtcWithdrawalAcceptSpec}, without `type`.
2026
+ */
1913
2027
  sbtcWithdrawalAccept(fields?: Fields<"sbtc_withdrawal_accept">): ChainEventFilter<"sbtc_withdrawal_accept">;
2028
+ /**
2029
+ * Matches rejected sBTC withdrawals.
2030
+ *
2031
+ * Webhooks only: it has no Index, Streams or subgraph projection.
2032
+ *
2033
+ * @param fields The members of {@link SbtcWithdrawalRejectSpec}, without `type`.
2034
+ */
1914
2035
  sbtcWithdrawalReject(fields?: Fields<"sbtc_withdrawal_reject">): ChainEventFilter<"sbtc_withdrawal_reject">;
2036
+ /**
2037
+ * Matches sBTC withdrawals whose sweep has confirmed.
2038
+ *
2039
+ * Webhooks only: it has no Index, Streams or subgraph projection.
2040
+ *
2041
+ * @param fields The members of {@link SbtcWithdrawalSweptConfirmedSpec}, without `type`.
2042
+ */
1915
2043
  sbtcWithdrawalSweptConfirmed(fields?: Fields<"sbtc_withdrawal_swept_confirmed">): ChainEventFilter<"sbtc_withdrawal_swept_confirmed">;
1916
2044
  }
1917
2045
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@secondlayer/stacks",
3
- "version": "6.2.0",
3
+ "version": "6.2.1",
4
4
  "description": "Typed Stacks client for TypeScript: read contracts, decode Clarity, build and send transactions.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -115,6 +115,7 @@
115
115
  "build": "rm -rf dist && bunup",
116
116
  "test": "bun test",
117
117
  "typecheck": "tsc --noEmit",
118
+ "openpkg": "bun scripts/sync-openpkg.ts",
118
119
  "prepublishOnly": "bun run build"
119
120
  },
120
121
  "publishConfig": {