@secondlayer/stacks 6.2.0 → 6.2.2
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.
- package/dist/shared/stacks-esm-b54n1jdx.js.map +4 -4
- package/dist/src/filters/index.cjs.map +4 -4
- package/dist/src/filters/index.d.cts +175 -32
- package/dist/src/filters/index.d.ts +175 -32
- package/dist/src/index.cjs.map +4 -4
- package/dist/src/index.d.cts +147 -15
- package/dist/src/index.d.ts +147 -15
- package/package.json +2 -1
package/dist/src/index.d.cts
CHANGED
|
@@ -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
|
|
@@ -1590,21 +1591,22 @@ interface AbiContract {
|
|
|
1590
1591
|
defined_traits?: ReadonlyArray<AbiTraitDefinition>;
|
|
1591
1592
|
}
|
|
1592
1593
|
/**
|
|
1593
|
-
*
|
|
1594
|
-
*
|
|
1594
|
+
* A fungible or non-fungible asset identifier: `<contract>::<asset-name>`.
|
|
1595
|
+
*
|
|
1596
|
+
* This is the shape an asset filter takes, expressed so the compiler can check it.
|
|
1595
1597
|
*
|
|
1596
1598
|
* The most common mistake in this API is passing a CONTRACT ID
|
|
1597
1599
|
* (`SP….sbtc-token`) where an asset identifier (`SP….sbtc-token::sbtc-token`)
|
|
1598
1600
|
* belongs, and the failure mode is a query that quietly returns zero rows. The
|
|
1599
1601
|
* two differ structurally by `::`, so a template-literal type catches it at the
|
|
1600
|
-
* call site
|
|
1602
|
+
* call site. No brand, no cast, literals just work.
|
|
1601
1603
|
*
|
|
1602
1604
|
* A value that is only known at runtime (config, env) is not narrow enough on
|
|
1603
1605
|
* purpose; run it through {@link assetId} once, which validates and narrows.
|
|
1604
1606
|
*
|
|
1605
|
-
* Wildcard patterns (Webhooks/Subgraphs-only) are admitted by the second arm
|
|
1606
|
-
* are legitimately not full identifiers (`SPB.*`), and the runtime
|
|
1607
|
-
* short-circuits on them for the same reason.
|
|
1607
|
+
* Wildcard patterns (Webhooks/Subgraphs-only) are admitted by the second arm.
|
|
1608
|
+
* They are legitimately not full identifiers (`SPB.*`), and the runtime
|
|
1609
|
+
* validator short-circuits on them for the same reason.
|
|
1608
1610
|
*/
|
|
1609
1611
|
type AssetIdentifier = `${string}::${string}` | `${string}*${string}`;
|
|
1610
1612
|
/** Scalar print field types (structural mirror of the subgraphs `ColumnType`). */
|
|
@@ -1782,6 +1784,7 @@ interface SbtcWithdrawalSweptConfirmedSpec {
|
|
|
1782
1784
|
sweepTxid?: string;
|
|
1783
1785
|
}
|
|
1784
1786
|
type ChainEventFilterSpec = StxTransferSpec | StxMintSpec | StxBurnSpec | StxLockSpec | FtTransferSpec | FtMintSpec | FtBurnSpec | NftTransferSpec | NftMintSpec | NftBurnSpec | ContractCallSpec | ContractDeploySpec | NestedContractCallSpec | VarSetSpec | MapSetSpec | MapInsertSpec | MapDeleteSpec | PrintEventSpec | SbtcDepositSpec | SbtcWithdrawalCreateSpec | SbtcWithdrawalAcceptSpec | SbtcWithdrawalRejectSpec | SbtcWithdrawalSweptConfirmedSpec;
|
|
1787
|
+
/** The filter spec for one chain event type. */
|
|
1785
1788
|
type SpecFor<T extends ChainEventFilterType> = Extract<ChainEventFilterSpec, {
|
|
1786
1789
|
type: T
|
|
1787
1790
|
}>;
|
|
@@ -1857,10 +1860,11 @@ type ProjectionsFor<
|
|
|
1857
1860
|
toSubgraphSource(): S
|
|
1858
1861
|
} : {});
|
|
1859
1862
|
/**
|
|
1860
|
-
* A
|
|
1861
|
-
*
|
|
1862
|
-
*
|
|
1863
|
-
* (`
|
|
1863
|
+
* A chain-event filter: the spec fields plus its member's projections.
|
|
1864
|
+
*
|
|
1865
|
+
* Write the filter once; project it to a query (`toIndexParams`), a stream
|
|
1866
|
+
* (`toStreamsParams`), a webhook trigger (`toChainTrigger`), or a subgraph
|
|
1867
|
+
* source (`toSubgraphSource`).
|
|
1864
1868
|
*/
|
|
1865
1869
|
type ChainEventFilter<
|
|
1866
1870
|
T extends ChainEventFilterType = ChainEventFilterType,
|
|
@@ -1868,23 +1872,80 @@ type ChainEventFilter<
|
|
|
1868
1872
|
type: T
|
|
1869
1873
|
} = SpecFor<T>
|
|
1870
1874
|
> = S & ProjectionsFor<T, S>;
|
|
1875
|
+
/** The fields a filter factory takes for one event type, without `type`. */
|
|
1871
1876
|
type Fields<T extends ChainEventFilterType> = Omit<SpecFor<T>, "type">;
|
|
1872
1877
|
/** The `on.*` namespace, annotated explicitly — bunup's dts emitter needs an
|
|
1873
1878
|
* annotation on exported values (an inferred object of generic factories
|
|
1874
1879
|
* collapses to `{}` in the emitted declarations). */
|
|
1875
1880
|
interface OnNamespace {
|
|
1881
|
+
/**
|
|
1882
|
+
* Matches STX transfers.
|
|
1883
|
+
*
|
|
1884
|
+
* @param fields The members of {@link StxTransferSpec}, without `type`.
|
|
1885
|
+
*/
|
|
1876
1886
|
stxTransfer(fields?: Fields<"stx_transfer">): ChainEventFilter<"stx_transfer">;
|
|
1887
|
+
/**
|
|
1888
|
+
* Matches STX mints.
|
|
1889
|
+
*
|
|
1890
|
+
* @param fields The members of {@link StxMintSpec}, without `type`.
|
|
1891
|
+
*/
|
|
1877
1892
|
stxMint(fields?: Fields<"stx_mint">): ChainEventFilter<"stx_mint">;
|
|
1893
|
+
/**
|
|
1894
|
+
* Matches STX burns.
|
|
1895
|
+
*
|
|
1896
|
+
* @param fields The members of {@link StxBurnSpec}, without `type`.
|
|
1897
|
+
*/
|
|
1878
1898
|
stxBurn(fields?: Fields<"stx_burn">): ChainEventFilter<"stx_burn">;
|
|
1899
|
+
/**
|
|
1900
|
+
* Matches STX lock events.
|
|
1901
|
+
*
|
|
1902
|
+
* @param fields The members of {@link StxLockSpec}, without `type`.
|
|
1903
|
+
*/
|
|
1879
1904
|
stxLock(fields?: Fields<"stx_lock">): ChainEventFilter<"stx_lock">;
|
|
1905
|
+
/**
|
|
1906
|
+
* Matches fungible token transfers.
|
|
1907
|
+
*
|
|
1908
|
+
* @param fields The members of {@link FtTransferSpec}, without `type`.
|
|
1909
|
+
*/
|
|
1880
1910
|
ftTransfer(fields?: Fields<"ft_transfer">): ChainEventFilter<"ft_transfer">;
|
|
1911
|
+
/**
|
|
1912
|
+
* Matches fungible token mints.
|
|
1913
|
+
*
|
|
1914
|
+
* @param fields The members of {@link FtMintSpec}, without `type`.
|
|
1915
|
+
*/
|
|
1881
1916
|
ftMint(fields?: Fields<"ft_mint">): ChainEventFilter<"ft_mint">;
|
|
1917
|
+
/**
|
|
1918
|
+
* Matches fungible token burns.
|
|
1919
|
+
*
|
|
1920
|
+
* @param fields The members of {@link FtBurnSpec}, without `type`.
|
|
1921
|
+
*/
|
|
1882
1922
|
ftBurn(fields?: Fields<"ft_burn">): ChainEventFilter<"ft_burn">;
|
|
1923
|
+
/**
|
|
1924
|
+
* Matches NFT transfers.
|
|
1925
|
+
*
|
|
1926
|
+
* @param fields The members of {@link NftTransferSpec}, without `type`.
|
|
1927
|
+
*/
|
|
1883
1928
|
nftTransfer(fields?: Fields<"nft_transfer">): ChainEventFilter<"nft_transfer">;
|
|
1929
|
+
/**
|
|
1930
|
+
* Matches NFT mints.
|
|
1931
|
+
*
|
|
1932
|
+
* @param fields The members of {@link NftMintSpec}, without `type`.
|
|
1933
|
+
*/
|
|
1884
1934
|
nftMint(fields?: Fields<"nft_mint">): ChainEventFilter<"nft_mint">;
|
|
1935
|
+
/**
|
|
1936
|
+
* Matches NFT burns.
|
|
1937
|
+
*
|
|
1938
|
+
* @param fields The members of {@link NftBurnSpec}, without `type`.
|
|
1939
|
+
*/
|
|
1885
1940
|
nftBurn(fields?: Fields<"nft_burn">): ChainEventFilter<"nft_burn">;
|
|
1886
|
-
/**
|
|
1887
|
-
*
|
|
1941
|
+
/**
|
|
1942
|
+
* Matches contract calls.
|
|
1943
|
+
*
|
|
1944
|
+
* `abi` literals are preserved (`const A`), so `toSubgraphSource()` keeps
|
|
1945
|
+
* typing `event.input` inside `defineSubgraph`.
|
|
1946
|
+
*
|
|
1947
|
+
* @param fields The members of {@link ContractCallSpec}, without `type`.
|
|
1948
|
+
*/
|
|
1888
1949
|
contractCall<const A extends AbiContract | undefined = undefined>(fields?: Omit<SpecFor<"contract_call">, "type" | "abi"> & {
|
|
1889
1950
|
abi?: A
|
|
1890
1951
|
}): ChainEventFilter<"contract_call", {
|
|
@@ -1892,10 +1953,21 @@ interface OnNamespace {
|
|
|
1892
1953
|
} & Omit<SpecFor<"contract_call">, "type" | "abi"> & {
|
|
1893
1954
|
abi?: A
|
|
1894
1955
|
}>;
|
|
1956
|
+
/**
|
|
1957
|
+
* Matches contract deployments.
|
|
1958
|
+
*
|
|
1959
|
+
* @param fields The members of {@link ContractDeploySpec}, without `type`.
|
|
1960
|
+
*/
|
|
1895
1961
|
contractDeploy(fields?: Fields<"contract_deploy">): ChainEventFilter<"contract_deploy">;
|
|
1896
|
-
/**
|
|
1897
|
-
*
|
|
1898
|
-
*
|
|
1962
|
+
/**
|
|
1963
|
+
* Matches `print` events.
|
|
1964
|
+
*
|
|
1965
|
+
* The canonical member is `print_event`, as Subgraphs and Webhooks spell it;
|
|
1966
|
+
* `toIndexParams` and `toStreamsParams` project to `print`. `prints` literals
|
|
1967
|
+
* are preserved (`const P`), so `event.data` narrows per topic.
|
|
1968
|
+
*
|
|
1969
|
+
* @param fields The members of {@link PrintEventSpec}, without `type`.
|
|
1970
|
+
*/
|
|
1899
1971
|
print<const P extends Record<string, Record<string, PrintFieldType>> | undefined = undefined>(fields?: Omit<SpecFor<"print_event">, "type" | "prints"> & {
|
|
1900
1972
|
prints?: P
|
|
1901
1973
|
}): ChainEventFilter<"print_event", {
|
|
@@ -1903,15 +1975,75 @@ interface OnNamespace {
|
|
|
1903
1975
|
} & Omit<SpecFor<"print_event">, "type" | "prints"> & {
|
|
1904
1976
|
prints?: P
|
|
1905
1977
|
}>;
|
|
1978
|
+
/**
|
|
1979
|
+
* Matches contract calls made from inside another contract.
|
|
1980
|
+
*
|
|
1981
|
+
* @param fields The members of {@link NestedContractCallSpec}, without `type`.
|
|
1982
|
+
*/
|
|
1906
1983
|
nestedCall(fields?: Fields<"nested_contract_call">): ChainEventFilter<"nested_contract_call">;
|
|
1984
|
+
/**
|
|
1985
|
+
* Matches data variable writes.
|
|
1986
|
+
*
|
|
1987
|
+
* @param fields The members of {@link VarSetSpec}, without `type`.
|
|
1988
|
+
*/
|
|
1907
1989
|
varSet(fields?: Fields<"var_set">): ChainEventFilter<"var_set">;
|
|
1990
|
+
/**
|
|
1991
|
+
* Matches `map-set` writes.
|
|
1992
|
+
*
|
|
1993
|
+
* @param fields The members of {@link MapSetSpec}, without `type`.
|
|
1994
|
+
*/
|
|
1908
1995
|
mapSet(fields?: Fields<"map_set">): ChainEventFilter<"map_set">;
|
|
1996
|
+
/**
|
|
1997
|
+
* Matches `map-insert` writes.
|
|
1998
|
+
*
|
|
1999
|
+
* @param fields The members of {@link MapInsertSpec}, without `type`.
|
|
2000
|
+
*/
|
|
1909
2001
|
mapInsert(fields?: Fields<"map_insert">): ChainEventFilter<"map_insert">;
|
|
2002
|
+
/**
|
|
2003
|
+
* Matches `map-delete` writes.
|
|
2004
|
+
*
|
|
2005
|
+
* @param fields The members of {@link MapDeleteSpec}, without `type`.
|
|
2006
|
+
*/
|
|
1910
2007
|
mapDelete(fields?: Fields<"map_delete">): ChainEventFilter<"map_delete">;
|
|
2008
|
+
/**
|
|
2009
|
+
* Matches sBTC deposits.
|
|
2010
|
+
*
|
|
2011
|
+
* Webhooks only: it has no Index, Streams or subgraph projection.
|
|
2012
|
+
*
|
|
2013
|
+
* @param fields The members of {@link SbtcDepositSpec}, without `type`.
|
|
2014
|
+
*/
|
|
1911
2015
|
sbtcDeposit(fields?: Fields<"sbtc_deposit">): ChainEventFilter<"sbtc_deposit">;
|
|
2016
|
+
/**
|
|
2017
|
+
* Matches sBTC withdrawal requests.
|
|
2018
|
+
*
|
|
2019
|
+
* Webhooks only: it has no Index, Streams or subgraph projection.
|
|
2020
|
+
*
|
|
2021
|
+
* @param fields The members of {@link SbtcWithdrawalCreateSpec}, without `type`.
|
|
2022
|
+
*/
|
|
1912
2023
|
sbtcWithdrawalCreate(fields?: Fields<"sbtc_withdrawal_create">): ChainEventFilter<"sbtc_withdrawal_create">;
|
|
2024
|
+
/**
|
|
2025
|
+
* Matches accepted sBTC withdrawals.
|
|
2026
|
+
*
|
|
2027
|
+
* Webhooks only: it has no Index, Streams or subgraph projection.
|
|
2028
|
+
*
|
|
2029
|
+
* @param fields The members of {@link SbtcWithdrawalAcceptSpec}, without `type`.
|
|
2030
|
+
*/
|
|
1913
2031
|
sbtcWithdrawalAccept(fields?: Fields<"sbtc_withdrawal_accept">): ChainEventFilter<"sbtc_withdrawal_accept">;
|
|
2032
|
+
/**
|
|
2033
|
+
* Matches rejected sBTC withdrawals.
|
|
2034
|
+
*
|
|
2035
|
+
* Webhooks only: it has no Index, Streams or subgraph projection.
|
|
2036
|
+
*
|
|
2037
|
+
* @param fields The members of {@link SbtcWithdrawalRejectSpec}, without `type`.
|
|
2038
|
+
*/
|
|
1914
2039
|
sbtcWithdrawalReject(fields?: Fields<"sbtc_withdrawal_reject">): ChainEventFilter<"sbtc_withdrawal_reject">;
|
|
2040
|
+
/**
|
|
2041
|
+
* Matches sBTC withdrawals whose sweep has confirmed.
|
|
2042
|
+
*
|
|
2043
|
+
* Webhooks only: it has no Index, Streams or subgraph projection.
|
|
2044
|
+
*
|
|
2045
|
+
* @param fields The members of {@link SbtcWithdrawalSweptConfirmedSpec}, without `type`.
|
|
2046
|
+
*/
|
|
1915
2047
|
sbtcWithdrawalSweptConfirmed(fields?: Fields<"sbtc_withdrawal_swept_confirmed">): ChainEventFilter<"sbtc_withdrawal_swept_confirmed">;
|
|
1916
2048
|
}
|
|
1917
2049
|
/**
|
package/dist/src/index.d.ts
CHANGED
|
@@ -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
|
|
@@ -1590,21 +1591,22 @@ interface AbiContract {
|
|
|
1590
1591
|
defined_traits?: ReadonlyArray<AbiTraitDefinition>;
|
|
1591
1592
|
}
|
|
1592
1593
|
/**
|
|
1593
|
-
*
|
|
1594
|
-
*
|
|
1594
|
+
* A fungible or non-fungible asset identifier: `<contract>::<asset-name>`.
|
|
1595
|
+
*
|
|
1596
|
+
* This is the shape an asset filter takes, expressed so the compiler can check it.
|
|
1595
1597
|
*
|
|
1596
1598
|
* The most common mistake in this API is passing a CONTRACT ID
|
|
1597
1599
|
* (`SP….sbtc-token`) where an asset identifier (`SP….sbtc-token::sbtc-token`)
|
|
1598
1600
|
* belongs, and the failure mode is a query that quietly returns zero rows. The
|
|
1599
1601
|
* two differ structurally by `::`, so a template-literal type catches it at the
|
|
1600
|
-
* call site
|
|
1602
|
+
* call site. No brand, no cast, literals just work.
|
|
1601
1603
|
*
|
|
1602
1604
|
* A value that is only known at runtime (config, env) is not narrow enough on
|
|
1603
1605
|
* purpose; run it through {@link assetId} once, which validates and narrows.
|
|
1604
1606
|
*
|
|
1605
|
-
* Wildcard patterns (Webhooks/Subgraphs-only) are admitted by the second arm
|
|
1606
|
-
* are legitimately not full identifiers (`SPB.*`), and the runtime
|
|
1607
|
-
* short-circuits on them for the same reason.
|
|
1607
|
+
* Wildcard patterns (Webhooks/Subgraphs-only) are admitted by the second arm.
|
|
1608
|
+
* They are legitimately not full identifiers (`SPB.*`), and the runtime
|
|
1609
|
+
* validator short-circuits on them for the same reason.
|
|
1608
1610
|
*/
|
|
1609
1611
|
type AssetIdentifier = `${string}::${string}` | `${string}*${string}`;
|
|
1610
1612
|
/** Scalar print field types (structural mirror of the subgraphs `ColumnType`). */
|
|
@@ -1782,6 +1784,7 @@ interface SbtcWithdrawalSweptConfirmedSpec {
|
|
|
1782
1784
|
sweepTxid?: string;
|
|
1783
1785
|
}
|
|
1784
1786
|
type ChainEventFilterSpec = StxTransferSpec | StxMintSpec | StxBurnSpec | StxLockSpec | FtTransferSpec | FtMintSpec | FtBurnSpec | NftTransferSpec | NftMintSpec | NftBurnSpec | ContractCallSpec | ContractDeploySpec | NestedContractCallSpec | VarSetSpec | MapSetSpec | MapInsertSpec | MapDeleteSpec | PrintEventSpec | SbtcDepositSpec | SbtcWithdrawalCreateSpec | SbtcWithdrawalAcceptSpec | SbtcWithdrawalRejectSpec | SbtcWithdrawalSweptConfirmedSpec;
|
|
1787
|
+
/** The filter spec for one chain event type. */
|
|
1785
1788
|
type SpecFor<T extends ChainEventFilterType> = Extract<ChainEventFilterSpec, {
|
|
1786
1789
|
type: T
|
|
1787
1790
|
}>;
|
|
@@ -1857,10 +1860,11 @@ type ProjectionsFor<
|
|
|
1857
1860
|
toSubgraphSource(): S
|
|
1858
1861
|
} : {});
|
|
1859
1862
|
/**
|
|
1860
|
-
* A
|
|
1861
|
-
*
|
|
1862
|
-
*
|
|
1863
|
-
* (`
|
|
1863
|
+
* A chain-event filter: the spec fields plus its member's projections.
|
|
1864
|
+
*
|
|
1865
|
+
* Write the filter once; project it to a query (`toIndexParams`), a stream
|
|
1866
|
+
* (`toStreamsParams`), a webhook trigger (`toChainTrigger`), or a subgraph
|
|
1867
|
+
* source (`toSubgraphSource`).
|
|
1864
1868
|
*/
|
|
1865
1869
|
type ChainEventFilter<
|
|
1866
1870
|
T extends ChainEventFilterType = ChainEventFilterType,
|
|
@@ -1868,23 +1872,80 @@ type ChainEventFilter<
|
|
|
1868
1872
|
type: T
|
|
1869
1873
|
} = SpecFor<T>
|
|
1870
1874
|
> = S & ProjectionsFor<T, S>;
|
|
1875
|
+
/** The fields a filter factory takes for one event type, without `type`. */
|
|
1871
1876
|
type Fields<T extends ChainEventFilterType> = Omit<SpecFor<T>, "type">;
|
|
1872
1877
|
/** The `on.*` namespace, annotated explicitly — bunup's dts emitter needs an
|
|
1873
1878
|
* annotation on exported values (an inferred object of generic factories
|
|
1874
1879
|
* collapses to `{}` in the emitted declarations). */
|
|
1875
1880
|
interface OnNamespace {
|
|
1881
|
+
/**
|
|
1882
|
+
* Matches STX transfers.
|
|
1883
|
+
*
|
|
1884
|
+
* @param fields The members of {@link StxTransferSpec}, without `type`.
|
|
1885
|
+
*/
|
|
1876
1886
|
stxTransfer(fields?: Fields<"stx_transfer">): ChainEventFilter<"stx_transfer">;
|
|
1887
|
+
/**
|
|
1888
|
+
* Matches STX mints.
|
|
1889
|
+
*
|
|
1890
|
+
* @param fields The members of {@link StxMintSpec}, without `type`.
|
|
1891
|
+
*/
|
|
1877
1892
|
stxMint(fields?: Fields<"stx_mint">): ChainEventFilter<"stx_mint">;
|
|
1893
|
+
/**
|
|
1894
|
+
* Matches STX burns.
|
|
1895
|
+
*
|
|
1896
|
+
* @param fields The members of {@link StxBurnSpec}, without `type`.
|
|
1897
|
+
*/
|
|
1878
1898
|
stxBurn(fields?: Fields<"stx_burn">): ChainEventFilter<"stx_burn">;
|
|
1899
|
+
/**
|
|
1900
|
+
* Matches STX lock events.
|
|
1901
|
+
*
|
|
1902
|
+
* @param fields The members of {@link StxLockSpec}, without `type`.
|
|
1903
|
+
*/
|
|
1879
1904
|
stxLock(fields?: Fields<"stx_lock">): ChainEventFilter<"stx_lock">;
|
|
1905
|
+
/**
|
|
1906
|
+
* Matches fungible token transfers.
|
|
1907
|
+
*
|
|
1908
|
+
* @param fields The members of {@link FtTransferSpec}, without `type`.
|
|
1909
|
+
*/
|
|
1880
1910
|
ftTransfer(fields?: Fields<"ft_transfer">): ChainEventFilter<"ft_transfer">;
|
|
1911
|
+
/**
|
|
1912
|
+
* Matches fungible token mints.
|
|
1913
|
+
*
|
|
1914
|
+
* @param fields The members of {@link FtMintSpec}, without `type`.
|
|
1915
|
+
*/
|
|
1881
1916
|
ftMint(fields?: Fields<"ft_mint">): ChainEventFilter<"ft_mint">;
|
|
1917
|
+
/**
|
|
1918
|
+
* Matches fungible token burns.
|
|
1919
|
+
*
|
|
1920
|
+
* @param fields The members of {@link FtBurnSpec}, without `type`.
|
|
1921
|
+
*/
|
|
1882
1922
|
ftBurn(fields?: Fields<"ft_burn">): ChainEventFilter<"ft_burn">;
|
|
1923
|
+
/**
|
|
1924
|
+
* Matches NFT transfers.
|
|
1925
|
+
*
|
|
1926
|
+
* @param fields The members of {@link NftTransferSpec}, without `type`.
|
|
1927
|
+
*/
|
|
1883
1928
|
nftTransfer(fields?: Fields<"nft_transfer">): ChainEventFilter<"nft_transfer">;
|
|
1929
|
+
/**
|
|
1930
|
+
* Matches NFT mints.
|
|
1931
|
+
*
|
|
1932
|
+
* @param fields The members of {@link NftMintSpec}, without `type`.
|
|
1933
|
+
*/
|
|
1884
1934
|
nftMint(fields?: Fields<"nft_mint">): ChainEventFilter<"nft_mint">;
|
|
1935
|
+
/**
|
|
1936
|
+
* Matches NFT burns.
|
|
1937
|
+
*
|
|
1938
|
+
* @param fields The members of {@link NftBurnSpec}, without `type`.
|
|
1939
|
+
*/
|
|
1885
1940
|
nftBurn(fields?: Fields<"nft_burn">): ChainEventFilter<"nft_burn">;
|
|
1886
|
-
/**
|
|
1887
|
-
*
|
|
1941
|
+
/**
|
|
1942
|
+
* Matches contract calls.
|
|
1943
|
+
*
|
|
1944
|
+
* `abi` literals are preserved (`const A`), so `toSubgraphSource()` keeps
|
|
1945
|
+
* typing `event.input` inside `defineSubgraph`.
|
|
1946
|
+
*
|
|
1947
|
+
* @param fields The members of {@link ContractCallSpec}, without `type`.
|
|
1948
|
+
*/
|
|
1888
1949
|
contractCall<const A extends AbiContract | undefined = undefined>(fields?: Omit<SpecFor<"contract_call">, "type" | "abi"> & {
|
|
1889
1950
|
abi?: A
|
|
1890
1951
|
}): ChainEventFilter<"contract_call", {
|
|
@@ -1892,10 +1953,21 @@ interface OnNamespace {
|
|
|
1892
1953
|
} & Omit<SpecFor<"contract_call">, "type" | "abi"> & {
|
|
1893
1954
|
abi?: A
|
|
1894
1955
|
}>;
|
|
1956
|
+
/**
|
|
1957
|
+
* Matches contract deployments.
|
|
1958
|
+
*
|
|
1959
|
+
* @param fields The members of {@link ContractDeploySpec}, without `type`.
|
|
1960
|
+
*/
|
|
1895
1961
|
contractDeploy(fields?: Fields<"contract_deploy">): ChainEventFilter<"contract_deploy">;
|
|
1896
|
-
/**
|
|
1897
|
-
*
|
|
1898
|
-
*
|
|
1962
|
+
/**
|
|
1963
|
+
* Matches `print` events.
|
|
1964
|
+
*
|
|
1965
|
+
* The canonical member is `print_event`, as Subgraphs and Webhooks spell it;
|
|
1966
|
+
* `toIndexParams` and `toStreamsParams` project to `print`. `prints` literals
|
|
1967
|
+
* are preserved (`const P`), so `event.data` narrows per topic.
|
|
1968
|
+
*
|
|
1969
|
+
* @param fields The members of {@link PrintEventSpec}, without `type`.
|
|
1970
|
+
*/
|
|
1899
1971
|
print<const P extends Record<string, Record<string, PrintFieldType>> | undefined = undefined>(fields?: Omit<SpecFor<"print_event">, "type" | "prints"> & {
|
|
1900
1972
|
prints?: P
|
|
1901
1973
|
}): ChainEventFilter<"print_event", {
|
|
@@ -1903,15 +1975,75 @@ interface OnNamespace {
|
|
|
1903
1975
|
} & Omit<SpecFor<"print_event">, "type" | "prints"> & {
|
|
1904
1976
|
prints?: P
|
|
1905
1977
|
}>;
|
|
1978
|
+
/**
|
|
1979
|
+
* Matches contract calls made from inside another contract.
|
|
1980
|
+
*
|
|
1981
|
+
* @param fields The members of {@link NestedContractCallSpec}, without `type`.
|
|
1982
|
+
*/
|
|
1906
1983
|
nestedCall(fields?: Fields<"nested_contract_call">): ChainEventFilter<"nested_contract_call">;
|
|
1984
|
+
/**
|
|
1985
|
+
* Matches data variable writes.
|
|
1986
|
+
*
|
|
1987
|
+
* @param fields The members of {@link VarSetSpec}, without `type`.
|
|
1988
|
+
*/
|
|
1907
1989
|
varSet(fields?: Fields<"var_set">): ChainEventFilter<"var_set">;
|
|
1990
|
+
/**
|
|
1991
|
+
* Matches `map-set` writes.
|
|
1992
|
+
*
|
|
1993
|
+
* @param fields The members of {@link MapSetSpec}, without `type`.
|
|
1994
|
+
*/
|
|
1908
1995
|
mapSet(fields?: Fields<"map_set">): ChainEventFilter<"map_set">;
|
|
1996
|
+
/**
|
|
1997
|
+
* Matches `map-insert` writes.
|
|
1998
|
+
*
|
|
1999
|
+
* @param fields The members of {@link MapInsertSpec}, without `type`.
|
|
2000
|
+
*/
|
|
1909
2001
|
mapInsert(fields?: Fields<"map_insert">): ChainEventFilter<"map_insert">;
|
|
2002
|
+
/**
|
|
2003
|
+
* Matches `map-delete` writes.
|
|
2004
|
+
*
|
|
2005
|
+
* @param fields The members of {@link MapDeleteSpec}, without `type`.
|
|
2006
|
+
*/
|
|
1910
2007
|
mapDelete(fields?: Fields<"map_delete">): ChainEventFilter<"map_delete">;
|
|
2008
|
+
/**
|
|
2009
|
+
* Matches sBTC deposits.
|
|
2010
|
+
*
|
|
2011
|
+
* Webhooks only: it has no Index, Streams or subgraph projection.
|
|
2012
|
+
*
|
|
2013
|
+
* @param fields The members of {@link SbtcDepositSpec}, without `type`.
|
|
2014
|
+
*/
|
|
1911
2015
|
sbtcDeposit(fields?: Fields<"sbtc_deposit">): ChainEventFilter<"sbtc_deposit">;
|
|
2016
|
+
/**
|
|
2017
|
+
* Matches sBTC withdrawal requests.
|
|
2018
|
+
*
|
|
2019
|
+
* Webhooks only: it has no Index, Streams or subgraph projection.
|
|
2020
|
+
*
|
|
2021
|
+
* @param fields The members of {@link SbtcWithdrawalCreateSpec}, without `type`.
|
|
2022
|
+
*/
|
|
1912
2023
|
sbtcWithdrawalCreate(fields?: Fields<"sbtc_withdrawal_create">): ChainEventFilter<"sbtc_withdrawal_create">;
|
|
2024
|
+
/**
|
|
2025
|
+
* Matches accepted sBTC withdrawals.
|
|
2026
|
+
*
|
|
2027
|
+
* Webhooks only: it has no Index, Streams or subgraph projection.
|
|
2028
|
+
*
|
|
2029
|
+
* @param fields The members of {@link SbtcWithdrawalAcceptSpec}, without `type`.
|
|
2030
|
+
*/
|
|
1913
2031
|
sbtcWithdrawalAccept(fields?: Fields<"sbtc_withdrawal_accept">): ChainEventFilter<"sbtc_withdrawal_accept">;
|
|
2032
|
+
/**
|
|
2033
|
+
* Matches rejected sBTC withdrawals.
|
|
2034
|
+
*
|
|
2035
|
+
* Webhooks only: it has no Index, Streams or subgraph projection.
|
|
2036
|
+
*
|
|
2037
|
+
* @param fields The members of {@link SbtcWithdrawalRejectSpec}, without `type`.
|
|
2038
|
+
*/
|
|
1914
2039
|
sbtcWithdrawalReject(fields?: Fields<"sbtc_withdrawal_reject">): ChainEventFilter<"sbtc_withdrawal_reject">;
|
|
2040
|
+
/**
|
|
2041
|
+
* Matches sBTC withdrawals whose sweep has confirmed.
|
|
2042
|
+
*
|
|
2043
|
+
* Webhooks only: it has no Index, Streams or subgraph projection.
|
|
2044
|
+
*
|
|
2045
|
+
* @param fields The members of {@link SbtcWithdrawalSweptConfirmedSpec}, without `type`.
|
|
2046
|
+
*/
|
|
1915
2047
|
sbtcWithdrawalSweptConfirmed(fields?: Fields<"sbtc_withdrawal_swept_confirmed">): ChainEventFilter<"sbtc_withdrawal_swept_confirmed">;
|
|
1916
2048
|
}
|
|
1917
2049
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@secondlayer/stacks",
|
|
3
|
-
"version": "6.2.
|
|
3
|
+
"version": "6.2.2",
|
|
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": {
|