@secondlayer/sdk 6.52.1 → 6.53.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.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +24 -68
- package/dist/index.js.map +4 -4
- package/dist/streams/index.js +16 -45
- package/dist/streams/index.js.map +3 -3
- package/dist/subgraphs/index.d.ts +1 -1
- package/dist/subgraphs/index.js +24 -68
- package/dist/subgraphs/index.js.map +4 -4
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -2082,7 +2082,7 @@ type SbtcEventsWalkParams = Omit<SbtcEventsListParams, "limit"> & {
|
|
|
2082
2082
|
signal?: AbortSignal;
|
|
2083
2083
|
};
|
|
2084
2084
|
type SbtcEventsConsumeParams<TTx = never> = Omit<SbtcEventsListParams, "cursor" | "fromCursor" | "limit"> & IndexConsumeOptions<IndexSbtcEvent, SbtcEventsEnvelope, TTx>;
|
|
2085
|
-
type SbtcDepositsConsumeParams<TTx = never> = Omit<SbtcDepositsListParams, "cursor" | "fromCursor" | "limit"> & IndexConsumeOptions<IndexSbtcDeposit, SbtcDepositsEnvelope, TTx>;
|
|
2085
|
+
type SbtcDepositsConsumeParams<TTx = never> = Omit<SbtcDepositsListParams, "cursor" | "fromCursor" | "limit" | "fields"> & IndexConsumeOptions<IndexSbtcDeposit, SbtcDepositsEnvelope, TTx>;
|
|
2086
2086
|
/** `index.sbtc` — the decoded sBTC peg surface (deposits, withdrawals, raw
|
|
2087
2087
|
* events, scoreboard). The only productized decoded sBTC peg feed on Stacks. */
|
|
2088
2088
|
interface SbtcResource {
|
package/dist/index.js
CHANGED
|
@@ -938,6 +938,10 @@ async function consumeIndexFeed(opts) {
|
|
|
938
938
|
}
|
|
939
939
|
|
|
940
940
|
// src/index-api/client.ts
|
|
941
|
+
function feedFilters(params) {
|
|
942
|
+
const { fromCursor: _checkpoint, ...filters } = params;
|
|
943
|
+
return filters;
|
|
944
|
+
}
|
|
941
945
|
function firstWalkFromHeight(params) {
|
|
942
946
|
if (params.fromHeight !== undefined)
|
|
943
947
|
return params.fromHeight;
|
|
@@ -983,14 +987,7 @@ class Index extends BaseClient {
|
|
|
983
987
|
consume: (params) => consumeIndexFeed({
|
|
984
988
|
...params,
|
|
985
989
|
fetchPage: ({ cursor, fromHeight, limit }) => this.listEvents({
|
|
986
|
-
|
|
987
|
-
contractId: params.contractId,
|
|
988
|
-
assetIdentifier: params.assetIdentifier,
|
|
989
|
-
sender: params.sender,
|
|
990
|
-
recipient: params.recipient,
|
|
991
|
-
trait: params.trait,
|
|
992
|
-
toHeight: params.toHeight,
|
|
993
|
-
txContext: params.txContext,
|
|
990
|
+
...feedFilters(params),
|
|
994
991
|
cursor,
|
|
995
992
|
fromHeight,
|
|
996
993
|
limit
|
|
@@ -1004,11 +1001,7 @@ class Index extends BaseClient {
|
|
|
1004
1001
|
consume: (params) => consumeIndexFeed({
|
|
1005
1002
|
...params,
|
|
1006
1003
|
fetchPage: ({ cursor, fromHeight, limit }) => this.listContractCalls({
|
|
1007
|
-
|
|
1008
|
-
functionName: params.functionName,
|
|
1009
|
-
sender: params.sender,
|
|
1010
|
-
trait: params.trait,
|
|
1011
|
-
toHeight: params.toHeight,
|
|
1004
|
+
...feedFilters(params),
|
|
1012
1005
|
cursor,
|
|
1013
1006
|
fromHeight,
|
|
1014
1007
|
limit
|
|
@@ -1047,10 +1040,7 @@ class Index extends BaseClient {
|
|
|
1047
1040
|
consume: (params) => consumeIndexFeed({
|
|
1048
1041
|
...params,
|
|
1049
1042
|
fetchPage: ({ cursor, fromHeight, limit }) => this.listSbtcDeposits({
|
|
1050
|
-
|
|
1051
|
-
sender: params.sender,
|
|
1052
|
-
bitcoinTxid: params.bitcoinTxid,
|
|
1053
|
-
toHeight: params.toHeight,
|
|
1043
|
+
...feedFilters(params),
|
|
1054
1044
|
cursor,
|
|
1055
1045
|
fromHeight,
|
|
1056
1046
|
limit
|
|
@@ -1070,12 +1060,7 @@ class Index extends BaseClient {
|
|
|
1070
1060
|
consume: (params) => consumeIndexFeed({
|
|
1071
1061
|
...params,
|
|
1072
1062
|
fetchPage: ({ cursor, fromHeight, limit }) => this.listSbtcEvents({
|
|
1073
|
-
|
|
1074
|
-
topic: params.topic,
|
|
1075
|
-
sender: params.sender,
|
|
1076
|
-
requestId: params.requestId,
|
|
1077
|
-
bitcoinTxid: params.bitcoinTxid,
|
|
1078
|
-
toHeight: params.toHeight,
|
|
1063
|
+
...feedFilters(params),
|
|
1079
1064
|
cursor,
|
|
1080
1065
|
fromHeight,
|
|
1081
1066
|
limit
|
|
@@ -1725,6 +1710,17 @@ function maxCursor(a, b) {
|
|
|
1725
1710
|
const [bh, bi] = cursorTuple(b);
|
|
1726
1711
|
return ah > bh || ah === bh && ai >= bi ? a : b;
|
|
1727
1712
|
}
|
|
1713
|
+
function streamsFilters(params) {
|
|
1714
|
+
return {
|
|
1715
|
+
types: params.types,
|
|
1716
|
+
notTypes: params.notTypes,
|
|
1717
|
+
contractId: params.contractId,
|
|
1718
|
+
sender: params.sender,
|
|
1719
|
+
recipient: params.recipient,
|
|
1720
|
+
assetIdentifier: params.assetIdentifier,
|
|
1721
|
+
filters: params.filters
|
|
1722
|
+
};
|
|
1723
|
+
}
|
|
1728
1724
|
var DEFAULT_STREAMS_BASE_URL = "https://api.secondlayer.tools";
|
|
1729
1725
|
function normalizeBaseUrl(baseUrl) {
|
|
1730
1726
|
return baseUrl.replace(/\/+$/, "");
|
|
@@ -1836,29 +1832,7 @@ function createStreamsClient(options) {
|
|
|
1836
1832
|
}
|
|
1837
1833
|
return JSON.parse(text);
|
|
1838
1834
|
}
|
|
1839
|
-
const fetchEvents =
|
|
1840
|
-
cursor,
|
|
1841
|
-
limit,
|
|
1842
|
-
types,
|
|
1843
|
-
notTypes,
|
|
1844
|
-
contractId,
|
|
1845
|
-
sender,
|
|
1846
|
-
recipient,
|
|
1847
|
-
assetIdentifier,
|
|
1848
|
-
filters
|
|
1849
|
-
}) => {
|
|
1850
|
-
return listEvents({
|
|
1851
|
-
cursor,
|
|
1852
|
-
limit,
|
|
1853
|
-
types,
|
|
1854
|
-
notTypes,
|
|
1855
|
-
contractId,
|
|
1856
|
-
sender,
|
|
1857
|
-
recipient,
|
|
1858
|
-
assetIdentifier,
|
|
1859
|
-
filters
|
|
1860
|
-
});
|
|
1861
|
-
};
|
|
1835
|
+
const fetchEvents = listEvents;
|
|
1862
1836
|
function encodeFilters(filters) {
|
|
1863
1837
|
return filters ? JSON.stringify(filters) : undefined;
|
|
1864
1838
|
}
|
|
@@ -1903,13 +1877,7 @@ function createStreamsClient(options) {
|
|
|
1903
1877
|
onProgress: params.onProgress,
|
|
1904
1878
|
mode: params.mode,
|
|
1905
1879
|
finalizedOnly: params.finalizedOnly,
|
|
1906
|
-
|
|
1907
|
-
notTypes: params.notTypes,
|
|
1908
|
-
contractId: params.contractId,
|
|
1909
|
-
sender: params.sender,
|
|
1910
|
-
recipient: params.recipient,
|
|
1911
|
-
assetIdentifier: params.assetIdentifier,
|
|
1912
|
-
filters: params.filters,
|
|
1880
|
+
...streamsFilters(params),
|
|
1913
1881
|
batchSize: params.batchSize ?? 100,
|
|
1914
1882
|
fetchEvents,
|
|
1915
1883
|
onBatch,
|
|
@@ -1929,13 +1897,7 @@ function createStreamsClient(options) {
|
|
|
1929
1897
|
fromCursor: params.cursor,
|
|
1930
1898
|
batchSize: params.batchSize ?? 100,
|
|
1931
1899
|
intervalMs: params.intervalMs ?? 2000,
|
|
1932
|
-
|
|
1933
|
-
notTypes: params.notTypes,
|
|
1934
|
-
contractId: params.contractId,
|
|
1935
|
-
sender: params.sender,
|
|
1936
|
-
recipient: params.recipient,
|
|
1937
|
-
assetIdentifier: params.assetIdentifier,
|
|
1938
|
-
filters: params.filters,
|
|
1900
|
+
...streamsFilters(params),
|
|
1939
1901
|
signal: params.signal,
|
|
1940
1902
|
fetchEvents
|
|
1941
1903
|
});
|
|
@@ -1949,13 +1911,7 @@ function createStreamsClient(options) {
|
|
|
1949
1911
|
stream(params = {}) {
|
|
1950
1912
|
return streamStreamsEvents({
|
|
1951
1913
|
fromCursor: params.fromCursor,
|
|
1952
|
-
|
|
1953
|
-
notTypes: params.notTypes,
|
|
1954
|
-
contractId: params.contractId,
|
|
1955
|
-
sender: params.sender,
|
|
1956
|
-
recipient: params.recipient,
|
|
1957
|
-
assetIdentifier: params.assetIdentifier,
|
|
1958
|
-
filters: params.filters,
|
|
1914
|
+
...streamsFilters(params),
|
|
1959
1915
|
batchSize: params.batchSize ?? 100,
|
|
1960
1916
|
emptyBackoffMs: params.emptyBackoffMs,
|
|
1961
1917
|
maxPages: params.maxPages,
|
|
@@ -2879,5 +2835,5 @@ export {
|
|
|
2879
2835
|
ApiError
|
|
2880
2836
|
};
|
|
2881
2837
|
|
|
2882
|
-
//# debugId=
|
|
2838
|
+
//# debugId=1C91566B271DD52B64756E2164756E21
|
|
2883
2839
|
//# sourceMappingURL=index.js.map
|