@secondlayer/sdk 14.5.1 → 15.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.
- package/README.md +21 -36
- package/dist/index.d.ts +10 -17
- package/dist/index.js +3 -23
- package/dist/index.js.map +5 -5
- package/dist/subgraphs/index.d.ts +7 -3
- package/dist/subgraphs/index.js.map +3 -3
- package/dist/webhooks/doctor.d.ts +1 -12
- package/dist/webhooks/doctor.js +3 -23
- package/dist/webhooks/doctor.js.map +3 -3
- package/package.json +3 -3
|
@@ -125,6 +125,7 @@ interface SubgraphOperationStatus {
|
|
|
125
125
|
/** /v1 cursor envelope for subgraph table reads. */
|
|
126
126
|
interface SubgraphRowsEnvelope<T = unknown> {
|
|
127
127
|
rows: T[];
|
|
128
|
+
/** Set on every page that returned rows; `null` only on an empty page. */
|
|
128
129
|
next_cursor: string | null;
|
|
129
130
|
tip: {
|
|
130
131
|
block_height: number;
|
|
@@ -186,8 +187,10 @@ declare class Subgraphs extends BaseClient {
|
|
|
186
187
|
}>;
|
|
187
188
|
/**
|
|
188
189
|
* Open /v1 read: cursor-paginated rows. Anon works on an open instance;
|
|
189
|
-
* pass an apiKey on the client where reads are closed.
|
|
190
|
-
* returned `
|
|
190
|
+
* pass an apiKey on the client where reads are closed. `next_cursor` is set
|
|
191
|
+
* on every page that returned rows and is `null` only on an empty page, so a
|
|
192
|
+
* poller tails with `cursor = page.next_cursor ?? cursor`. A paging loop
|
|
193
|
+
* ends on an empty page (or one shorter than `limit`).
|
|
191
194
|
*/
|
|
192
195
|
rows<T = unknown>(name: string, table: string, params?: Omit<SubgraphQueryParams, "offset"> & {
|
|
193
196
|
cursor?: string;
|
|
@@ -229,7 +232,8 @@ declare class Subgraphs extends BaseClient {
|
|
|
229
232
|
* const client = sl.subgraphs.typed(mySubgraph)
|
|
230
233
|
* const page = await client.transfers.findMany({ where: { sender: 'SP...' } })
|
|
231
234
|
* // page.rows: InferTableRow<typeof mySubgraph.schema.transfers>[]
|
|
232
|
-
* // page.nextCursor:
|
|
235
|
+
* // page.nextCursor: set whenever rows came back, null on an empty page.
|
|
236
|
+
* // Tail new rows: cursor = page.nextCursor ?? cursor
|
|
233
237
|
* ```
|
|
234
238
|
*/
|
|
235
239
|
typed<T extends {
|