@secondlayer/sdk 6.21.2 → 6.22.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.
@@ -273,6 +273,7 @@ declare class Contracts extends BaseClient {
273
273
  includeAbi?: boolean
274
274
  }): Promise<ContractSummary | null>;
275
275
  }
276
+ import { InferredTopicSchema } from "@secondlayer/subgraphs";
276
277
  import { RewardSet } from "@secondlayer/shared/node/consensus";
277
278
  import { MerkleProofStep } from "@secondlayer/shared/node/nakamoto";
278
279
  /**
@@ -810,6 +811,25 @@ type MempoolWalkParams = Omit<MempoolListParams, "limit"> & {
810
811
  signal?: AbortSignal
811
812
  };
812
813
  /**
814
+ * Empirical per-topic print payload schema for a contract, inferred from
815
+ * sampled on-chain events. `topics` is sorted by count desc; `sampled` is true
816
+ * when the contract has more print events than the windows examined.
817
+ */
818
+ type PrintSchemaResponse = {
819
+ contract_id: string
820
+ topics: InferredTopicSchema[]
821
+ sampled: boolean
822
+ total_events: number
823
+ /** True when the count hit the server-side cap (total_events is the cap). */
824
+ total_events_capped: boolean
825
+ sample: {
826
+ size: number
827
+ newest_height: number | null
828
+ oldest_height: number | null
829
+ }
830
+ tip: IndexTip
831
+ };
832
+ /**
813
833
  * `index.ftTransfers` — callable shorthand for `.list()`, with `.list`/`.walk`
814
834
  * still available: `await sl.index.ftTransfers({ contractId })`.
815
835
  *
@@ -857,6 +877,12 @@ declare class Index extends BaseClient {
857
877
  * learn what's queryable (and which types accept `trait`) instead of hardcoding.
858
878
  */
859
879
  discover(): Promise<IndexDiscovery>;
880
+ /**
881
+ * Empirical per-topic print payload schema for a contract — what topics it
882
+ * emits and each field's observed Clarity/TS/column types. Anonymous read;
883
+ * 404 → null.
884
+ */
885
+ printSchema(contractId: string): Promise<PrintSchemaResponse | null>;
860
886
  /** Callable: `index.ftTransfers(params)` ≡ `index.ftTransfers.list(params)`. */
861
887
  readonly ftTransfers: FtTransfersResource;
862
888
  /** Callable: `index.nftTransfers(params)` ≡ `index.nftTransfers.list(params)`. */
@@ -461,6 +461,15 @@ class Index extends BaseClient {
461
461
  discover() {
462
462
  return this.request("GET", "/v1/index");
463
463
  }
464
+ async printSchema(contractId) {
465
+ try {
466
+ return await this.request("GET", `/v1/index/contracts/${encodeURIComponent(contractId)}/print-schema`);
467
+ } catch (err) {
468
+ if (err instanceof ApiError && err.status === 404)
469
+ return null;
470
+ throw err;
471
+ }
472
+ }
464
473
  ftTransfers = Object.assign((params = {}) => this.listFtTransfers(params), {
465
474
  list: (params = {}) => this.listFtTransfers(params),
466
475
  walk: (params = {}) => this.walkFtTransfers(params)
@@ -1718,5 +1727,5 @@ export {
1718
1727
  Subgraphs
1719
1728
  };
1720
1729
 
1721
- //# debugId=0E36F58DBAA5692064756E2164756E21
1730
+ //# debugId=D03F305F30B012C964756E2164756E21
1722
1731
  //# sourceMappingURL=index.js.map
@@ -8,7 +8,7 @@
8
8
  "import type {\n\tReindexResponse,\n\tSubgraphAggregateParams,\n\tSubgraphAggregateResponse,\n\tSubgraphDetail,\n\tSubgraphGapsResponse,\n\tSubgraphQueryParams,\n\tSubgraphSummary,\n} from \"@secondlayer/shared/schemas\";\nimport type {\n\tDeploySubgraphRequest,\n\tDeploySubgraphResponse,\n} from \"@secondlayer/shared/schemas/subgraphs\";\nimport type {\n\tSubgraphAgentSchema,\n\tSubgraphSpecOptions,\n} from \"@secondlayer/shared/subgraphs/spec\";\nimport type {\n\tAggregateResult,\n\tAggregateSpec,\n\tFindManyOptions,\n\tInferSubgraphClient,\n\tSubscribeOptions,\n\tWhereInput,\n} from \"@secondlayer/subgraphs\";\nimport { BaseClient } from \"../base.ts\";\nimport { resolveOrderByColumn, serializeWhere } from \"./serialize.ts\";\n\nexport interface SubgraphSource {\n\tname: string;\n\tversion: string;\n\tsourceCode: string | null;\n\treadOnly: boolean;\n\treason?: string;\n\tupdatedAt: string;\n}\n\n/** Status of a tracked reindex/backfill operation (poll until terminal). */\nexport interface SubgraphOperationStatus {\n\tid: string;\n\tsubgraphName: string;\n\tkind: \"reindex\" | \"backfill\";\n\tstatus: \"queued\" | \"running\" | \"completed\" | \"failed\" | \"cancelled\";\n\tfromBlock: number | null;\n\ttoBlock: number | null;\n\tprocessedBlocks: number | null;\n\t/** 0–1 fraction; null when no denominator is known yet. 1 when completed. */\n\tprogress: number | null;\n\terror: string | null;\n\tstartedAt: string | null;\n\tfinishedAt: string | null;\n\tcreatedAt: string;\n\tupdatedAt: string;\n}\n\n/** /v1 cursor envelope for subgraph table reads. */\nexport interface SubgraphRowsEnvelope<T = unknown> {\n\trows: T[];\n\tnext_cursor: string | null;\n\ttip: {\n\t\tblock_height: number;\n\t\tsubgraph_height: number;\n\t\tblocks_behind: number;\n\t};\n}\n\nexport interface BundleSubgraphResponse {\n\tok: true;\n\tname: string;\n\tversion: string | null;\n\tdescription: string | null;\n\tsources: Record<string, Record<string, unknown>>;\n\tschema: Record<string, unknown>;\n\thandlerCode: string;\n\tsourceCode: string;\n\tbundleSize: number;\n}\n\nfunction buildSubgraphQueryString(params: SubgraphQueryParams): string {\n\tconst qs = new URLSearchParams();\n\tif (params.sort) qs.set(\"_sort\", params.sort);\n\tif (params.order) qs.set(\"_order\", params.order);\n\tif (params.limit !== undefined) qs.set(\"_limit\", String(params.limit));\n\tif (params.offset !== undefined) qs.set(\"_offset\", String(params.offset));\n\tif (params.fields) qs.set(\"_fields\", params.fields);\n\tif (params.filters) {\n\t\tfor (const [key, value] of Object.entries(params.filters)) {\n\t\t\tqs.set(key, String(value));\n\t\t}\n\t}\n\tconst str = qs.toString();\n\treturn str ? `?${str}` : \"\";\n}\n\nfunction buildAggregateQueryString(params: SubgraphAggregateParams): string {\n\tconst qs = new URLSearchParams();\n\tif (params.filters) {\n\t\tfor (const [key, value] of Object.entries(params.filters)) {\n\t\t\tqs.set(key, String(value));\n\t\t}\n\t}\n\tif (params.count) qs.set(\"_count\", \"true\");\n\tif (params.countDistinct?.length)\n\t\tqs.set(\"_countDistinct\", params.countDistinct.join(\",\"));\n\tif (params.sum?.length) qs.set(\"_sum\", params.sum.join(\",\"));\n\tif (params.min?.length) qs.set(\"_min\", params.min.join(\",\"));\n\tif (params.max?.length) qs.set(\"_max\", params.max.join(\",\"));\n\tconst str = qs.toString();\n\treturn str ? `?${str}` : \"\";\n}\n\nfunction buildSpecQueryString(options?: SubgraphSpecOptions): string {\n\tconst qs = new URLSearchParams();\n\tif (options?.serverUrl) qs.set(\"server\", options.serverUrl);\n\tconst str = qs.toString();\n\treturn str ? `?${str}` : \"\";\n}\n\nexport class Subgraphs extends BaseClient {\n\tasync list(): Promise<{ data: SubgraphSummary[] }> {\n\t\treturn this.request<{ data: SubgraphSummary[] }>(\"GET\", \"/api/subgraphs\");\n\t}\n\n\tasync get(name: string): Promise<SubgraphDetail> {\n\t\treturn this.request<SubgraphDetail>(\"GET\", `/api/subgraphs/${name}`);\n\t}\n\n\tasync openapi(\n\t\tname: string,\n\t\toptions?: SubgraphSpecOptions,\n\t): Promise<Record<string, unknown>> {\n\t\treturn this.request<Record<string, unknown>>(\n\t\t\t\"GET\",\n\t\t\t`/api/subgraphs/${name}/openapi.json${buildSpecQueryString(options)}`,\n\t\t);\n\t}\n\n\tasync schema(\n\t\tname: string,\n\t\toptions?: SubgraphSpecOptions,\n\t): Promise<SubgraphAgentSchema> {\n\t\treturn this.request<SubgraphAgentSchema>(\n\t\t\t\"GET\",\n\t\t\t`/api/subgraphs/${name}/schema.json${buildSpecQueryString(options)}`,\n\t\t);\n\t}\n\n\tasync markdown(name: string, options?: SubgraphSpecOptions): Promise<string> {\n\t\treturn this.requestText(\n\t\t\t\"GET\",\n\t\t\t`/api/subgraphs/${name}/docs.md${buildSpecQueryString(options)}`,\n\t\t);\n\t}\n\n\tasync reindex(\n\t\tname: string,\n\t\toptions?: { fromBlock?: number; toBlock?: number },\n\t): Promise<ReindexResponse> {\n\t\treturn this.request<ReindexResponse>(\n\t\t\t\"POST\",\n\t\t\t`/api/subgraphs/${name}/reindex`,\n\t\t\toptions,\n\t\t);\n\t}\n\n\tasync stop(\n\t\tname: string,\n\t): Promise<{ message: string; operationId?: string; status?: string }> {\n\t\treturn this.request<{\n\t\t\tmessage: string;\n\t\t\toperationId?: string;\n\t\t\tstatus?: string;\n\t\t}>(\"POST\", `/api/subgraphs/${name}/stop`);\n\t}\n\n\tasync backfill(\n\t\tname: string,\n\t\toptions: { fromBlock: number; toBlock: number },\n\t): Promise<ReindexResponse> {\n\t\treturn this.request<ReindexResponse>(\n\t\t\t\"POST\",\n\t\t\t`/api/subgraphs/${name}/backfill`,\n\t\t\toptions,\n\t\t);\n\t}\n\n\tasync gaps(\n\t\tname: string,\n\t\topts?: { limit?: number; offset?: number; resolved?: boolean },\n\t): Promise<SubgraphGapsResponse> {\n\t\tconst qs = new URLSearchParams();\n\t\tif (opts?.limit !== undefined) qs.set(\"_limit\", String(opts.limit));\n\t\tif (opts?.offset !== undefined) qs.set(\"_offset\", String(opts.offset));\n\t\tif (opts?.resolved !== undefined) qs.set(\"resolved\", String(opts.resolved));\n\t\tconst query = qs.toString();\n\t\treturn this.request<SubgraphGapsResponse>(\n\t\t\t\"GET\",\n\t\t\t`/api/subgraphs/${name}/gaps${query ? `?${query}` : \"\"}`,\n\t\t);\n\t}\n\n\tasync delete(\n\t\tname: string,\n\t\toptions?: { force?: boolean },\n\t): Promise<{ message: string }> {\n\t\tconst qs = options?.force ? \"?force=true\" : \"\";\n\t\treturn this.request<{ message: string }>(\n\t\t\t\"DELETE\",\n\t\t\t`/api/subgraphs/${name}${qs}`,\n\t\t);\n\t}\n\n\t/**\n\t * Publish: claim the name in the global public namespace and open anon\n\t * reads on /v1/subgraphs/:name. 409 PUBLIC_NAME_TAKEN if another account\n\t * holds the public name.\n\t */\n\tasync publish(\n\t\tname: string,\n\t): Promise<{ name: string; visibility: \"public\"; url: string }> {\n\t\treturn this.request<{ name: string; visibility: \"public\"; url: string }>(\n\t\t\t\"POST\",\n\t\t\t`/api/subgraphs/${name}/publish`,\n\t\t);\n\t}\n\n\t/** Make reads private again (owning account's bearer key required). */\n\tasync unpublish(\n\t\tname: string,\n\t): Promise<{ name: string; visibility: \"private\" }> {\n\t\treturn this.request<{ name: string; visibility: \"private\" }>(\n\t\t\t\"POST\",\n\t\t\t`/api/subgraphs/${name}/unpublish`,\n\t\t);\n\t}\n\n\t/**\n\t * Open /v1 read: cursor-paginated rows. Anon works for public subgraphs;\n\t * pass an apiKey on the client for private ones. Resume with the returned\n\t * `next_cursor`.\n\t */\n\tasync rows<T = unknown>(\n\t\tname: string,\n\t\ttable: string,\n\t\tparams: Omit<SubgraphQueryParams, \"offset\" | \"sort\"> & {\n\t\t\tcursor?: string;\n\t\t} = {},\n\t): Promise<SubgraphRowsEnvelope<T>> {\n\t\tconst { cursor, ...rest } = params;\n\t\tconst qs = buildSubgraphQueryString(rest);\n\t\tconst sep = qs ? \"&\" : \"?\";\n\t\tconst cursorQs = cursor ? `${sep}cursor=${encodeURIComponent(cursor)}` : \"\";\n\t\treturn this.request<SubgraphRowsEnvelope<T>>(\n\t\t\t\"GET\",\n\t\t\t`/v1/subgraphs/${name}/${table}${qs}${cursorQs}`,\n\t\t);\n\t}\n\n\t/** Recent reindex/backfill operations for a subgraph, newest first. */\n\tasync operations(\n\t\tname: string,\n\t): Promise<{ operations: SubgraphOperationStatus[] }> {\n\t\treturn this.request<{ operations: SubgraphOperationStatus[] }>(\n\t\t\t\"GET\",\n\t\t\t`/api/subgraphs/${name}/operations`,\n\t\t);\n\t}\n\n\t/** Status of a single operation (poll the `operationId` returned by\n\t * reindex/backfill/stop until `status` is terminal). */\n\tasync getOperation(\n\t\tname: string,\n\t\toperationId: string,\n\t): Promise<SubgraphOperationStatus> {\n\t\treturn this.request<SubgraphOperationStatus>(\n\t\t\t\"GET\",\n\t\t\t`/api/subgraphs/${name}/operations/${operationId}`,\n\t\t);\n\t}\n\n\tasync deploy(data: DeploySubgraphRequest): Promise<DeploySubgraphResponse> {\n\t\treturn this.request<DeploySubgraphResponse>(\"POST\", \"/api/subgraphs\", data);\n\t}\n\n\tasync getSource(name: string): Promise<SubgraphSource> {\n\t\treturn this.request<SubgraphSource>(\"GET\", `/api/subgraphs/${name}/source`);\n\t}\n\n\t/**\n\t * Bundle a TypeScript subgraph source on the server. Used by the web chat\n\t * authoring loop so Vercel's serverless runtime doesn't have to run esbuild.\n\t */\n\tasync bundle(data: { code: string }): Promise<BundleSubgraphResponse> {\n\t\treturn this.request<BundleSubgraphResponse>(\n\t\t\t\"POST\",\n\t\t\t\"/api/subgraphs/bundle\",\n\t\t\tdata,\n\t\t);\n\t}\n\n\tasync queryTable(\n\t\tname: string,\n\t\ttable: string,\n\t\tparams: SubgraphQueryParams = {},\n\t): Promise<unknown[]> {\n\t\tconst result = await this.request<{ data: unknown[] } | unknown[]>(\n\t\t\t\"GET\",\n\t\t\t`/api/subgraphs/${name}/${table}${buildSubgraphQueryString(params)}`,\n\t\t);\n\t\treturn Array.isArray(result) ? result : result.data;\n\t}\n\n\tasync queryTableCount(\n\t\tname: string,\n\t\ttable: string,\n\t\tparams: SubgraphQueryParams = {},\n\t): Promise<{ count: number }> {\n\t\treturn this.request<{ count: number }>(\n\t\t\t\"GET\",\n\t\t\t`/api/subgraphs/${name}/${table}/count${buildSubgraphQueryString(params)}`,\n\t\t);\n\t}\n\n\tasync queryTableAggregate(\n\t\tname: string,\n\t\ttable: string,\n\t\tparams: SubgraphAggregateParams = {},\n\t): Promise<SubgraphAggregateResponse> {\n\t\treturn this.request<SubgraphAggregateResponse>(\n\t\t\t\"GET\",\n\t\t\t`/api/subgraphs/${name}/${table}/aggregate${buildAggregateQueryString(params)}`,\n\t\t);\n\t}\n\n\t/**\n\t * Returns a typed client for a subgraph defined with `defineSubgraph()`.\n\t * Row types are inferred from the subgraph's schema literal types.\n\t *\n\t * @example\n\t * ```ts\n\t * import mySubgraph from './subgraphs/my-token-subgraph'\n\t * const client = sl.subgraphs.typed(mySubgraph)\n\t * const rows = await client.transfers.findMany({ where: { sender: 'SP...' } })\n\t * // rows: InferTableRow<typeof mySubgraph.schema.transfers>[]\n\t * ```\n\t */\n\ttyped<T extends { name: string; schema: Record<string, unknown> }>(\n\t\tdef: T,\n\t): InferSubgraphClient<T> {\n\t\tconst result: Record<string, unknown> = {};\n\n\t\tfor (const tableName of Object.keys(def.schema)) {\n\t\t\tresult[tableName] = this.createTableClient(def.name, tableName);\n\t\t}\n\n\t\treturn result as InferSubgraphClient<T>;\n\t}\n\n\tprivate createTableClient(subgraphName: string, tableName: string) {\n\t\tconst self = this;\n\n\t\treturn {\n\t\t\tasync findMany<TRow>(\n\t\t\t\toptions: FindManyOptions<TRow> = {},\n\t\t\t): Promise<TRow[]> {\n\t\t\t\tconst filters = options.where\n\t\t\t\t\t? serializeWhere(options.where as Record<string, unknown>)\n\t\t\t\t\t: undefined;\n\n\t\t\t\tlet sort: string | undefined;\n\t\t\t\tlet order: string | undefined;\n\t\t\t\tif (options.orderBy) {\n\t\t\t\t\t// Accept the object form `{ col: \"asc\" }` or the ordered array\n\t\t\t\t\t// form `[[col, \"asc\"], …]` for deterministic multi-column sort.\n\t\t\t\t\tconst entries: [string, \"asc\" | \"desc\"][] = Array.isArray(\n\t\t\t\t\t\toptions.orderBy,\n\t\t\t\t\t)\n\t\t\t\t\t\t? (options.orderBy as [string, \"asc\" | \"desc\"][])\n\t\t\t\t\t\t: (Object.entries(options.orderBy) as [string, \"asc\" | \"desc\"][]);\n\t\t\t\t\tif (entries.length > 0) {\n\t\t\t\t\t\t// Comma-joined parallel lists → `_sort=a,b&_order=asc,desc`.\n\t\t\t\t\t\tsort = entries.map(([col]) => resolveOrderByColumn(col)).join(\",\");\n\t\t\t\t\t\torder = entries.map(([, dir]) => dir ?? \"asc\").join(\",\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst params: SubgraphQueryParams = {\n\t\t\t\t\tsort,\n\t\t\t\t\torder,\n\t\t\t\t\tlimit: options.limit,\n\t\t\t\t\toffset: options.offset,\n\t\t\t\t\tfields: options.fields?.join(\",\"),\n\t\t\t\t\tfilters,\n\t\t\t\t};\n\n\t\t\t\treturn self.queryTable(subgraphName, tableName, params) as Promise<\n\t\t\t\t\tTRow[]\n\t\t\t\t>;\n\t\t\t},\n\n\t\t\tasync count<TRow>(where?: WhereInput<TRow>): Promise<number> {\n\t\t\t\tconst filters = where\n\t\t\t\t\t? serializeWhere(where as Record<string, unknown>)\n\t\t\t\t\t: undefined;\n\n\t\t\t\tconst result = await self.queryTableCount(subgraphName, tableName, {\n\t\t\t\t\tfilters,\n\t\t\t\t});\n\t\t\t\treturn result.count;\n\t\t\t},\n\n\t\t\tasync aggregate<TRow, const A extends AggregateSpec<TRow>>(\n\t\t\t\tspec: A,\n\t\t\t): Promise<AggregateResult<TRow, A>> {\n\t\t\t\tconst filters = spec.where\n\t\t\t\t\t? serializeWhere(spec.where as Record<string, unknown>)\n\t\t\t\t\t: undefined;\n\n\t\t\t\tconst result = await self.queryTableAggregate(subgraphName, tableName, {\n\t\t\t\t\tfilters,\n\t\t\t\t\tcount: spec.count,\n\t\t\t\t\tcountDistinct: spec.countDistinct,\n\t\t\t\t\tsum: spec.sum,\n\t\t\t\t\tmin: spec.min,\n\t\t\t\t\tmax: spec.max,\n\t\t\t\t});\n\t\t\t\treturn result as AggregateResult<TRow, A>;\n\t\t\t},\n\n\t\t\tsubscribe<TRow>(\n\t\t\t\tonRow: (row: TRow) => void,\n\t\t\t\toptions: SubscribeOptions<TRow> = {},\n\t\t\t): () => void {\n\t\t\t\tconst filters = options.where\n\t\t\t\t\t? serializeWhere(options.where as Record<string, unknown>)\n\t\t\t\t\t: {};\n\t\t\t\tconst qs = new URLSearchParams();\n\t\t\t\tfor (const [k, v] of Object.entries(filters)) qs.set(k, String(v));\n\t\t\t\tif (options.since != null) qs.set(\"since\", String(options.since));\n\t\t\t\tconst query = qs.toString();\n\t\t\t\tconst url = `${self.baseUrl}/api/subgraphs/${subgraphName}/${tableName}/stream${query ? `?${query}` : \"\"}`;\n\n\t\t\t\ttype EventSourceLike = {\n\t\t\t\t\tonmessage: ((ev: { data: string }) => void) | null;\n\t\t\t\t\tonerror: ((ev: unknown) => void) | null;\n\t\t\t\t\tclose(): void;\n\t\t\t\t};\n\t\t\t\tconst ES = (\n\t\t\t\t\tglobalThis as unknown as {\n\t\t\t\t\t\tEventSource?: new (url: string) => EventSourceLike;\n\t\t\t\t\t}\n\t\t\t\t).EventSource;\n\t\t\t\tif (!ES) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\"subscribe() needs a global EventSource (available in browsers and Node >= 22).\",\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tconst es = new ES(url);\n\t\t\t\tes.onmessage = (ev) => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tonRow(JSON.parse(ev.data) as TRow);\n\t\t\t\t\t} catch {\n\t\t\t\t\t\t// ignore non-JSON frames (e.g. heartbeats)\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tif (options.onError) {\n\t\t\t\t\tconst handler = options.onError;\n\t\t\t\t\tes.onerror = (ev) => handler(ev);\n\t\t\t\t}\n\t\t\t\treturn () => es.close();\n\t\t\t},\n\t\t};\n\t}\n}\n",
9
9
  "import { BaseClient, type SecondLayerOptions } from \"../base.ts\";\n\n/**\n * Typed client for the agent-reachable key mint (`POST /v1/api-keys`).\n *\n * Lets a headless agent self-provision a SCOPED `streams`/`index` read key\n * without the dashboard. Requires an owner credential — an account-level API\n * key (or a dashboard session). The minted key is always scoped (never an\n * account/superkey) and inherits the account plan's tier.\n */\n\n/** Scope of a minted read key. */\nexport type ScopedKeyProduct = \"streams\" | \"index\";\n\nexport interface CreateApiKeyParams {\n\t/** Scope of the minted key. Defaults to \"streams\". */\n\tproduct?: ScopedKeyProduct;\n\t/** Optional human-readable label for the key. */\n\tname?: string;\n}\n\nexport interface CreateApiKeyResponse {\n\t/** Plaintext key — returned ONCE. Store it now; only its hash is persisted. */\n\tkey: string;\n\tprefix: string;\n\tid: string;\n\tproduct: string;\n\ttier: string | null;\n\tcreatedAt: string;\n}\n\n/** A key as seen by {@link ApiKeys.list} — metadata only, never the plaintext. */\nexport interface ApiKeySummary {\n\tid: string;\n\tprefix: string;\n\tname: string | null;\n\tstatus: \"active\" | \"revoked\";\n\tproduct: string;\n\ttier: string | null;\n\tcreatedAt: string;\n\tlastUsedAt: string | null;\n}\n\nexport class ApiKeys extends BaseClient {\n\tconstructor(options: Partial<SecondLayerOptions> = {}) {\n\t\tsuper(options);\n\t}\n\n\t/**\n\t * Mint a new scoped read key. The configured `apiKey` must be an\n\t * account-level (owner) key; the plaintext `key` in the response is shown\n\t * only once.\n\t */\n\tcreate(params: CreateApiKeyParams = {}): Promise<CreateApiKeyResponse> {\n\t\treturn this.request<CreateApiKeyResponse>(\"POST\", \"/v1/api-keys\", {\n\t\t\tproduct: params.product,\n\t\t\tname: params.name,\n\t\t});\n\t}\n\n\t/**\n\t * List the account's keys (metadata only — no plaintext). Requires an\n\t * account-level (owner) key or a dashboard session.\n\t */\n\tlist(): Promise<{ keys: ApiKeySummary[] }> {\n\t\treturn this.request<{ keys: ApiKeySummary[] }>(\"GET\", \"/api/keys\");\n\t}\n\n\t/** Revoke a key by id. Existing requests with that key stop working. */\n\trevoke(id: string): Promise<{ revoked: true; id: string }> {\n\t\treturn this.request<{ revoked: true; id: string }>(\n\t\t\t\"DELETE\",\n\t\t\t`/api/keys/${id}`,\n\t\t);\n\t}\n}\n",
10
10
  "import { BaseClient, type SecondLayerOptions, buildQuery } from \"../base.ts\";\nimport { ApiError } from \"../errors.ts\";\n\n/**\n * Typed client for the contract-discovery API (`GET /v1/contracts`).\n *\n * \"Find all contracts conforming to a trait\" — backed by the contract registry:\n * `declared` traits parsed from Clarity source, `inferred` standards from static\n * ABI shape-matching. Anonymous public read. `trait` is required; the ABI blob is\n * omitted unless `include: \"abi\"` is passed.\n */\n\n/** Whether a trait match must be declared in source, inferred from ABI, or either. */\nexport type ContractConformance = \"declared\" | \"inferred\" | \"any\";\n\nexport interface ContractsListParams {\n\t/** Required. Trait identifier to match (e.g. \"sip-010\", or a fully-qualified trait). */\n\ttrait: string;\n\t/** Match source. Defaults to \"any\" server-side. */\n\tconformance?: ContractConformance;\n\t/** Set to \"abi\" to include the full ABI blob in each row. */\n\tinclude?: \"abi\";\n\t/** Page size, 1–500 (default 100 server-side). */\n\tlimit?: number;\n\t/** Opaque cursor from a prior response's `next_cursor`. */\n\tcursor?: string;\n}\n\nexport interface ContractSummary {\n\tcontract_id: string;\n\tdeployer: string;\n\tblock_height: number;\n\tdeclared_traits: string[] | null;\n\tinferred_standards: string[] | null;\n\tabi_status: string;\n\t/** Present only when `include: \"abi\"` was requested. */\n\tabi?: unknown;\n}\n\nexport interface ContractsEnvelope {\n\tcontracts: ContractSummary[];\n\tnext_cursor: string | null;\n}\n\nexport class Contracts extends BaseClient {\n\tconstructor(options: Partial<SecondLayerOptions> = {}) {\n\t\tsuper(options);\n\t}\n\n\t/** Find contracts conforming to `trait`. `trait` is required (server 400s without it). */\n\tlist(params: ContractsListParams): Promise<ContractsEnvelope> {\n\t\treturn this.request<ContractsEnvelope>(\n\t\t\t\"GET\",\n\t\t\t`/v1/contracts${buildQuery({\n\t\t\t\ttrait: params.trait,\n\t\t\t\tconformance: params.conformance,\n\t\t\t\tinclude: params.include,\n\t\t\t\tlimit: params.limit,\n\t\t\t\tcursor: params.cursor,\n\t\t\t})}`,\n\t\t);\n\t}\n\n\t/**\n\t * Fetch a single contract from the registry by id (the prod-safe ABI source).\n\t * Pass `{ includeAbi: true }` for the full ABI blob. Resolves null on 404.\n\t */\n\tasync get(\n\t\tcontractId: string,\n\t\topts: { includeAbi?: boolean } = {},\n\t): Promise<ContractSummary | null> {\n\t\ttry {\n\t\t\tconst { contract } = await this.request<{ contract: ContractSummary }>(\n\t\t\t\t\"GET\",\n\t\t\t\t`/v1/contracts/${encodeURIComponent(contractId)}${\n\t\t\t\t\topts.includeAbi ? \"?include=abi\" : \"\"\n\t\t\t\t}`,\n\t\t\t);\n\t\t\treturn contract;\n\t\t} catch (err) {\n\t\t\tif (err instanceof ApiError && err.status === 404) return null;\n\t\t\tthrow err;\n\t\t}\n\t}\n}\n",
11
- "import { BaseClient, buildQuery } from \"../base.ts\";\nimport type { SecondLayerOptions } from \"../base.ts\";\nimport { ApiError } from \"../errors.ts\";\nimport type { TransactionProof } from \"../proofs.ts\";\n\nexport type IndexTip = {\n\tblock_height: number;\n\tlag_seconds: number;\n};\n\n/**\n * A chain reorg overlapping a returned page's height range. Height-keyed feeds\n * (`/transactions`, `/contract-calls`, `/stacking`) populate this so a consumer\n * can reconcile: roll back the rows whose `block_height:tx_index` cursor falls in\n * `orphaned_range`, then re-fetch from `new_canonical_tip`. Empty when the page\n * spans no reorg.\n */\nexport type IndexReorg = {\n\tid: string;\n\tdetected_at: string;\n\tfork_point_height: number;\n\told_index_block_hash: string | null;\n\tnew_index_block_hash: string | null;\n\t/** Orphaned cursor span `<block_height>:<tx_index>`, inclusive. */\n\torphaned_range: { from: string; to: string };\n\t/** New canonical tip cursor to resume from. */\n\tnew_canonical_tip: string;\n};\n\nexport type IndexUsage = {\n\tproduct: \"index\";\n\ttier: string;\n\tlimits: { rate_limit_per_second: number | null };\n\tusage: { decoded_events_today: number; decoded_events_this_month: number };\n};\n\nexport type FtTransfer = {\n\tcursor: string;\n\tblock_height: number;\n\ttx_id: string;\n\ttx_index: number;\n\tevent_index: number;\n\tevent_type: \"ft_transfer\";\n\tcontract_id: string;\n\tasset_identifier: string;\n\tsender: string;\n\trecipient: string;\n\tamount: string;\n};\n\nexport type FtTransfersEnvelope = {\n\tevents: FtTransfer[];\n\tnext_cursor: string | null;\n\ttip: IndexTip;\n\t// Chain reorgs overlapping this page's height range; empty when none.\n\treorgs: IndexReorg[];\n};\n\nexport type FtTransfersListParams = {\n\tcursor?: string | null;\n\tfromCursor?: string | null;\n\tlimit?: number;\n\tcontractId?: string;\n\tsender?: string;\n\trecipient?: string;\n\tfromHeight?: number;\n\ttoHeight?: number;\n};\n\nexport type FtTransfersWalkParams = Omit<FtTransfersListParams, \"limit\"> & {\n\tbatchSize?: number;\n\tsignal?: AbortSignal;\n};\n\nexport type NftTransfer = {\n\tcursor: string;\n\tblock_height: number;\n\ttx_id: string;\n\ttx_index: number;\n\tevent_index: number;\n\tevent_type: \"nft_transfer\";\n\tcontract_id: string;\n\tasset_identifier: string;\n\tsender: string;\n\trecipient: string;\n\tvalue: string;\n};\n\nexport type NftTransfersEnvelope = {\n\tevents: NftTransfer[];\n\tnext_cursor: string | null;\n\ttip: IndexTip;\n\t// Chain reorgs overlapping this page's height range; empty when none.\n\treorgs: IndexReorg[];\n};\n\nexport type NftTransfersListParams = {\n\tcursor?: string | null;\n\tfromCursor?: string | null;\n\tlimit?: number;\n\tcontractId?: string;\n\tassetIdentifier?: string;\n\tsender?: string;\n\trecipient?: string;\n\tfromHeight?: number;\n\ttoHeight?: number;\n};\n\nexport type NftTransfersWalkParams = Omit<NftTransfersListParams, \"limit\"> & {\n\tbatchSize?: number;\n\tsignal?: AbortSignal;\n};\n\n// ── Generic decoded events (/v1/index/events) ──────────────────────\n\ntype IndexEventBase = {\n\tcursor: string;\n\tblock_height: number;\n\tblock_time?: string | null;\n\ttx_id: string;\n\ttx_index: number;\n\tevent_index: number;\n\tcontract_id: string | null;\n};\n\nexport type IndexFtTransfer = IndexEventBase & {\n\tevent_type: \"ft_transfer\";\n\tasset_identifier: string;\n\tsender: string;\n\trecipient: string;\n\tamount: string;\n};\nexport type IndexNftTransfer = IndexEventBase & {\n\tevent_type: \"nft_transfer\";\n\tasset_identifier: string;\n\tsender: string;\n\trecipient: string;\n\tvalue: string;\n};\nexport type IndexStxTransfer = IndexEventBase & {\n\tevent_type: \"stx_transfer\";\n\tsender: string;\n\trecipient: string;\n\tamount: string;\n\tmemo: string | null;\n};\nexport type IndexStxMint = IndexEventBase & {\n\tevent_type: \"stx_mint\";\n\trecipient: string;\n\tamount: string;\n};\nexport type IndexStxBurn = IndexEventBase & {\n\tevent_type: \"stx_burn\";\n\tsender: string;\n\tamount: string;\n};\nexport type IndexStxLock = IndexEventBase & {\n\tevent_type: \"stx_lock\";\n\tsender: string;\n\tamount: string;\n\tpayload: { unlock_height: string | null };\n};\nexport type IndexFtMint = IndexEventBase & {\n\tevent_type: \"ft_mint\";\n\tasset_identifier: string;\n\trecipient: string;\n\tamount: string;\n};\nexport type IndexFtBurn = IndexEventBase & {\n\tevent_type: \"ft_burn\";\n\tasset_identifier: string;\n\tsender: string;\n\tamount: string;\n};\nexport type IndexNftMint = IndexEventBase & {\n\tevent_type: \"nft_mint\";\n\tasset_identifier: string;\n\trecipient: string;\n\tvalue: string;\n};\nexport type IndexNftBurn = IndexEventBase & {\n\tevent_type: \"nft_burn\";\n\tasset_identifier: string;\n\tsender: string;\n\tvalue: string;\n};\nexport type IndexPrint = IndexEventBase & {\n\tevent_type: \"print\";\n\tpayload: { topic: string | null; value: unknown; raw_value: string | null };\n};\n\n/** Decoded chain event, discriminated by `event_type`. */\nexport type IndexEvent =\n\t| IndexFtTransfer\n\t| IndexNftTransfer\n\t| IndexStxTransfer\n\t| IndexStxMint\n\t| IndexStxBurn\n\t| IndexStxLock\n\t| IndexFtMint\n\t| IndexFtBurn\n\t| IndexNftMint\n\t| IndexNftBurn\n\t| IndexPrint;\n\nexport type IndexEventType = IndexEvent[\"event_type\"];\n\nexport type EventsEnvelope = {\n\tevents: IndexEvent[];\n\tnext_cursor: string | null;\n\ttip: IndexTip;\n\t// Chain reorgs overlapping this page's height range; empty when none.\n\treorgs: IndexReorg[];\n};\n\nexport type EventsListParams = {\n\t/** Required. One of the decoded event types. */\n\teventType: IndexEventType;\n\tcursor?: string | null;\n\tfromCursor?: string | null;\n\tlimit?: number;\n\tcontractId?: string;\n\tassetIdentifier?: string;\n\tsender?: string;\n\trecipient?: string;\n\tfromHeight?: number;\n\ttoHeight?: number;\n\t/** Restrict to contracts conforming to a trait/standard (e.g. \"sip-010\").\n\t * Mutually exclusive with contractId; contract-keyed event types only. */\n\ttrait?: string;\n};\n\nexport type EventsWalkParams = Omit<EventsListParams, \"limit\"> & {\n\tbatchSize?: number;\n\tsignal?: AbortSignal;\n};\n\n// ── Contract calls (/v1/index/contract-calls) ──────────────────────\n\nexport type IndexContractCall = {\n\tcursor: string;\n\tblock_height: number;\n\tblock_time?: string | null;\n\ttx_id: string;\n\ttx_index: number;\n\tcontract_id: string;\n\tfunction_name: string;\n\tsender: string;\n\tstatus: string;\n\targs: unknown[];\n\tresult: unknown;\n\tresult_hex: string | null;\n};\n\nexport type ContractCallsEnvelope = {\n\tcontract_calls: IndexContractCall[];\n\tnext_cursor: string | null;\n\ttip: IndexTip;\n\t// Chain reorgs overlapping this page's height range; empty when none.\n\treorgs: IndexReorg[];\n};\n\nexport type ContractCallsListParams = {\n\tcursor?: string | null;\n\tfromCursor?: string | null;\n\tlimit?: number;\n\tcontractId?: string;\n\tfunctionName?: string;\n\tsender?: string;\n\tfromHeight?: number;\n\ttoHeight?: number;\n\t/** Restrict to contracts conforming to a trait/standard (e.g. \"sip-010\").\n\t * Mutually exclusive with contractId. */\n\ttrait?: string;\n};\n\nexport type ContractCallsWalkParams = Omit<ContractCallsListParams, \"limit\"> & {\n\tbatchSize?: number;\n\tsignal?: AbortSignal;\n};\n\n// ── Canonical block-hash map (/v1/index/canonical) ─────────────────\n\n/** One canonical block in the sync map. Lean by design — block + parent hash\n * for chain linkage, burn anchor for Bitcoin confirmations. Use `blocks` for\n * the full block resource. */\nexport type IndexCanonicalBlock = {\n\tcursor: string;\n\tblock_height: number;\n\tblock_hash: string;\n\tparent_hash: string;\n\tburn_block_height: number;\n\tburn_block_hash: string | null;\n};\n\nexport type CanonicalEnvelope = {\n\tcanonical: IndexCanonicalBlock[];\n\tnext_cursor: string | null;\n\ttip: IndexTip;\n};\n\nexport type CanonicalListParams = {\n\tcursor?: string | null;\n\tfromCursor?: string | null;\n\tlimit?: number;\n\tfromHeight?: number;\n\ttoHeight?: number;\n};\n\nexport type CanonicalWalkParams = Omit<CanonicalListParams, \"limit\"> & {\n\tbatchSize?: number;\n\tsignal?: AbortSignal;\n};\n\n// ── Blocks (/v1/index/blocks) ──────────────────────────────────────\n\n/** A block resource. Metadata is intentionally thin — only chain-linkage and\n * burn-anchor fields are persisted (no miner / tx_count / signer). */\nexport type IndexBlock = {\n\tcursor: string;\n\tblock_height: number;\n\tblock_hash: string;\n\tparent_hash: string;\n\tburn_block_height: number;\n\tburn_block_hash: string | null;\n\tblock_time: string | null;\n\tcanonical: boolean;\n};\n\nexport type BlocksEnvelope = {\n\tblocks: IndexBlock[];\n\tnext_cursor: string | null;\n\ttip: IndexTip;\n};\n\nexport type BlockEnvelope = {\n\tblock: IndexBlock;\n\ttip: IndexTip;\n};\n\nexport type BlocksListParams = {\n\tcursor?: string | null;\n\tfromCursor?: string | null;\n\tlimit?: number;\n\tfromHeight?: number;\n\ttoHeight?: number;\n};\n\nexport type BlocksWalkParams = Omit<BlocksListParams, \"limit\"> & {\n\tbatchSize?: number;\n\tsignal?: AbortSignal;\n};\n\n// ── Transactions (/v1/index/transactions) ──────────────────────────\n\nexport type IndexPostCondition =\n\t| {\n\t\t\ttype: \"stx\";\n\t\t\tprincipal: string;\n\t\t\tcondition_code: number;\n\t\t\tcondition_code_name: string | null;\n\t\t\tamount: string;\n\t }\n\t| {\n\t\t\ttype: \"ft\";\n\t\t\tprincipal: string;\n\t\t\tasset_identifier: string;\n\t\t\tcondition_code: number;\n\t\t\tcondition_code_name: string | null;\n\t\t\tamount: string;\n\t }\n\t| {\n\t\t\ttype: \"nft\";\n\t\t\tprincipal: string;\n\t\t\tasset_identifier: string;\n\t\t\tasset_value: unknown;\n\t\t\tcondition_code: number;\n\t\t\tcondition_code_name: string | null;\n\t };\n\n/** Full transaction document: columnar fields plus `raw_tx`-decoded enrichment.\n * Payload sub-objects are present only for the matching `tx_type`; enrichment\n * fields are null when `raw_tx` isn't decodable (e.g. burnchain ops). */\nexport type IndexTransaction = {\n\tcursor: string;\n\ttx_id: string;\n\tblock_height: number;\n\tblock_time?: string | null;\n\ttx_index: number;\n\ttx_type: string;\n\tsender: string;\n\tstatus: string;\n\tfee: string | null;\n\tnonce: string | null;\n\tsponsored: boolean | null;\n\tanchor_mode: string | null;\n\tpost_condition_mode: string | null;\n\tpost_conditions: IndexPostCondition[];\n\tcontract_call?: {\n\t\tcontract_id: string;\n\t\tfunction_name: string;\n\t\tfunction_args: unknown[];\n\t\t/** Raw hex-encoded ClarityValues; decode(function_args_hex[i]) === function_args[i]. */\n\t\tfunction_args_hex: string[];\n\t\tresult: unknown;\n\t\tresult_hex: string | null;\n\t};\n\ttoken_transfer?: { recipient: string; amount: string; memo: string };\n\tsmart_contract?: {\n\t\tcontract_id: string | null;\n\t\tclarity_version: number | null;\n\t};\n\tcoinbase?: { alt_recipient: string | null };\n\ttenure_change?: { cause: number };\n};\n\nexport type TransactionsEnvelope = {\n\ttransactions: IndexTransaction[];\n\tnext_cursor: string | null;\n\ttip: IndexTip;\n\t// Chain reorgs overlapping this page's height range; empty when none.\n\treorgs: IndexReorg[];\n};\n\nexport type TransactionEnvelope = {\n\ttransaction: IndexTransaction;\n\ttip: IndexTip;\n};\n\nexport type TransactionsListParams = {\n\tcursor?: string | null;\n\tfromCursor?: string | null;\n\tlimit?: number;\n\ttype?: string;\n\tsender?: string;\n\tcontractId?: string;\n\tfromHeight?: number;\n\ttoHeight?: number;\n};\n\nexport type TransactionsWalkParams = Omit<TransactionsListParams, \"limit\"> & {\n\tbatchSize?: number;\n\tsignal?: AbortSignal;\n};\n\n// ── Stacking (/v1/index/stacking) ──────────────────────────────────\n\n/** A decoded PoX-4 stacking action (one per stacking contract call). */\nexport type IndexStackingAction = {\n\tcursor: string;\n\tblock_height: number;\n\tblock_time?: string | null;\n\tburn_block_height: number;\n\ttx_id: string;\n\ttx_index: number;\n\tfunction_name: string;\n\tcaller: string;\n\tstacker: string | null;\n\tdelegate_to: string | null;\n\tamount_ustx: string | null;\n\tlock_period: number | null;\n\tpox_addr: {\n\t\tversion: number | null;\n\t\thashbytes: string | null;\n\t\tbtc: string | null;\n\t};\n\tstart_cycle: number | null;\n\tend_cycle: number | null;\n\treward_cycle: number | null;\n\tsigner_key: string | null;\n\tresult_ok: boolean;\n};\n\nexport type StackingEnvelope = {\n\tstacking: IndexStackingAction[];\n\tnext_cursor: string | null;\n\ttip: IndexTip;\n\t// Chain reorgs overlapping this page's height range; empty when none.\n\treorgs: IndexReorg[];\n\t/** Present only when the PoX-4 decoder is disabled, explaining an empty feed. */\n\tnotes?: string;\n};\n\nexport type StackingListParams = {\n\tcursor?: string | null;\n\tfromCursor?: string | null;\n\tlimit?: number;\n\tfunctionName?: string;\n\tstacker?: string;\n\tcaller?: string;\n\tfromHeight?: number;\n\ttoHeight?: number;\n};\n\nexport type StackingWalkParams = Omit<StackingListParams, \"limit\"> & {\n\tbatchSize?: number;\n\tsignal?: AbortSignal;\n};\n\n// ── Mempool (/v1/index/mempool) ────────────────────────────────────\n\n/** A pending (unconfirmed) transaction. Like a transaction document but\n * pre-chain — no block_height/tx_index/result/events — with `received_at` and\n * a sequence cursor instead of a block position. */\nexport type IndexMempoolTransaction = {\n\tcursor: string;\n\ttx_id: string;\n\ttx_type: string;\n\tsender: string;\n\treceived_at?: string | null;\n\tfee: string | null;\n\tnonce: string | null;\n\tsponsored: boolean | null;\n\tanchor_mode: string | null;\n\tpost_condition_mode: string | null;\n\tpost_conditions: IndexPostCondition[];\n\tcontract_call?: {\n\t\tcontract_id: string;\n\t\tfunction_name: string;\n\t\tfunction_args: unknown[];\n\t};\n\ttoken_transfer?: { recipient: string; amount: string; memo: string };\n\tsmart_contract?: { clarity_version: number | null };\n\tcoinbase?: { alt_recipient: string | null };\n\ttenure_change?: { cause: number };\n};\n\nexport type MempoolEnvelope = {\n\tmempool: IndexMempoolTransaction[];\n\tnext_cursor: string | null;\n\ttip: IndexTip;\n};\n\nexport type MempoolTransactionEnvelope = {\n\ttransaction: IndexMempoolTransaction;\n\ttip: IndexTip;\n};\n\nexport type MempoolListParams = {\n\tcursor?: string | null;\n\tfromCursor?: string | null;\n\tlimit?: number;\n\tsender?: string;\n\ttype?: string;\n\t/** Filter to pending calls to a single contract (e.g. `SP….contract`). */\n\tcontractId?: string;\n};\n\nexport type MempoolWalkParams = Omit<MempoolListParams, \"limit\"> & {\n\tbatchSize?: number;\n\tsignal?: AbortSignal;\n};\n\nfunction firstWalkFromHeight(params: {\n\tcursor?: string | null;\n\tfromCursor?: string | null;\n\tfromHeight?: number;\n}): number | undefined {\n\tif (params.fromHeight !== undefined) return params.fromHeight;\n\tif (params.cursor || params.fromCursor) return undefined;\n\treturn 0;\n}\n\n/**\n * `index.ftTransfers` — callable shorthand for `.list()`, with `.list`/`.walk`\n * still available: `await sl.index.ftTransfers({ contractId })`.\n *\n * The API accepts `contract_id`/`sender`/`recipient` equality filters only —\n * no amount filtering and no asset-slug resolution on /v1/index/ft-transfers.\n */\nexport interface FtTransfersResource {\n\t(params?: FtTransfersListParams): Promise<FtTransfersEnvelope>;\n\tlist(params?: FtTransfersListParams): Promise<FtTransfersEnvelope>;\n\twalk(params?: FtTransfersWalkParams): AsyncIterable<FtTransfer>;\n}\n\n/** `index.nftTransfers` — callable shorthand for `.list()` (see {@link FtTransfersResource}). */\nexport interface NftTransfersResource {\n\t(params?: NftTransfersListParams): Promise<NftTransfersEnvelope>;\n\tlist(params?: NftTransfersListParams): Promise<NftTransfersEnvelope>;\n\twalk(params?: NftTransfersWalkParams): AsyncIterable<NftTransfer>;\n}\n\n/** `index.events` — callable shorthand for `.list()`; `eventType` is required. */\nexport interface IndexEventsResource {\n\t(params: EventsListParams): Promise<EventsEnvelope>;\n\tlist(params: EventsListParams): Promise<EventsEnvelope>;\n\twalk(params: EventsWalkParams): AsyncIterable<IndexEvent>;\n}\n\n/** Per-event-type filter vocabulary in the {@link IndexDiscovery} doc. */\nexport type IndexEventTypeFilters = {\n\tcolumns?: string[];\n\tallowed_filters?: string[];\n\tequality_filters?: string[];\n\trequired_non_null?: string[];\n};\n\n/** The `GET /v1/index` discovery doc — live endpoint + filter vocabulary.\n * Shape is intentionally open (the server may add fields); the agent-relevant\n * parts are the per-type filter rules. */\nexport type IndexDiscovery = {\n\tevent_type_filters?: Record<string, IndexEventTypeFilters>;\n\t[key: string]: unknown;\n};\n\nexport class Index extends BaseClient {\n\tconstructor(options: Partial<SecondLayerOptions> = {}) {\n\t\tsuper(options);\n\t}\n\n\t/** Your own Index consumption (decoded events today + this month) and tier limits. */\n\tusage(): Promise<IndexUsage> {\n\t\treturn this.request<IndexUsage>(\"GET\", \"/v1/index/usage\");\n\t}\n\n\t/**\n\t * Index discovery doc — the live vocabulary: every endpoint, each event type's\n\t * columns, allowed/equality filters, and required-non-null fields. Read this to\n\t * learn what's queryable (and which types accept `trait`) instead of hardcoding.\n\t */\n\tdiscover(): Promise<IndexDiscovery> {\n\t\treturn this.request<IndexDiscovery>(\"GET\", \"/v1/index\");\n\t}\n\n\t/** Callable: `index.ftTransfers(params)` ≡ `index.ftTransfers.list(params)`. */\n\treadonly ftTransfers: FtTransfersResource = Object.assign(\n\t\t(params: FtTransfersListParams = {}): Promise<FtTransfersEnvelope> =>\n\t\t\tthis.listFtTransfers(params),\n\t\t{\n\t\t\tlist: (\n\t\t\t\tparams: FtTransfersListParams = {},\n\t\t\t): Promise<FtTransfersEnvelope> => this.listFtTransfers(params),\n\t\t\twalk: (params: FtTransfersWalkParams = {}): AsyncIterable<FtTransfer> =>\n\t\t\t\tthis.walkFtTransfers(params),\n\t\t},\n\t);\n\n\t/** Callable: `index.nftTransfers(params)` ≡ `index.nftTransfers.list(params)`. */\n\treadonly nftTransfers: NftTransfersResource = Object.assign(\n\t\t(params: NftTransfersListParams = {}): Promise<NftTransfersEnvelope> =>\n\t\t\tthis.listNftTransfers(params),\n\t\t{\n\t\t\tlist: (\n\t\t\t\tparams: NftTransfersListParams = {},\n\t\t\t): Promise<NftTransfersEnvelope> => this.listNftTransfers(params),\n\t\t\twalk: (params: NftTransfersWalkParams = {}): AsyncIterable<NftTransfer> =>\n\t\t\t\tthis.walkNftTransfers(params),\n\t\t},\n\t);\n\n\t/** Generic decoded events by `event_type` (the full /v1/index/events surface).\n\t * Callable: `index.events(params)` ≡ `index.events.list(params)`. */\n\treadonly events: IndexEventsResource = Object.assign(\n\t\t(params: EventsListParams): Promise<EventsEnvelope> =>\n\t\t\tthis.listEvents(params),\n\t\t{\n\t\t\tlist: (params: EventsListParams): Promise<EventsEnvelope> =>\n\t\t\t\tthis.listEvents(params),\n\t\t\twalk: (params: EventsWalkParams): AsyncIterable<IndexEvent> =>\n\t\t\t\tthis.walkEvents(params),\n\t\t},\n\t);\n\n\treadonly contractCalls: {\n\t\tlist: (params?: ContractCallsListParams) => Promise<ContractCallsEnvelope>;\n\t\twalk: (\n\t\t\tparams?: ContractCallsWalkParams,\n\t\t) => AsyncIterable<IndexContractCall>;\n\t} = {\n\t\tlist: (\n\t\t\tparams: ContractCallsListParams = {},\n\t\t): Promise<ContractCallsEnvelope> => this.listContractCalls(params),\n\t\twalk: (\n\t\t\tparams: ContractCallsWalkParams = {},\n\t\t): AsyncIterable<IndexContractCall> => this.walkContractCalls(params),\n\t};\n\n\t/** Canonical block-hash map — sync only the current canonical chain. */\n\treadonly canonical: {\n\t\tlist: (params?: CanonicalListParams) => Promise<CanonicalEnvelope>;\n\t\twalk: (params?: CanonicalWalkParams) => AsyncIterable<IndexCanonicalBlock>;\n\t} = {\n\t\tlist: (params: CanonicalListParams = {}): Promise<CanonicalEnvelope> =>\n\t\t\tthis.listCanonical(params),\n\t\twalk: (\n\t\t\tparams: CanonicalWalkParams = {},\n\t\t): AsyncIterable<IndexCanonicalBlock> => this.walkCanonical(params),\n\t};\n\n\t/** Canonical blocks: paginated `list`/`walk`, plus `get` by height or hash\n\t * (resolves to null on 404). */\n\treadonly blocks: {\n\t\tlist: (params?: BlocksListParams) => Promise<BlocksEnvelope>;\n\t\twalk: (params?: BlocksWalkParams) => AsyncIterable<IndexBlock>;\n\t\tget: (ref: string | number) => Promise<BlockEnvelope | null>;\n\t} = {\n\t\tlist: (params: BlocksListParams = {}): Promise<BlocksEnvelope> =>\n\t\t\tthis.listBlocks(params),\n\t\twalk: (params: BlocksWalkParams = {}): AsyncIterable<IndexBlock> =>\n\t\t\tthis.walkBlocks(params),\n\t\tget: (ref: string | number): Promise<BlockEnvelope | null> =>\n\t\t\tthis.getBlock(ref),\n\t};\n\n\t/** Full transaction documents: paginated `list`/`walk`, plus `get` by tx_id\n\t * (resolves to null on 404). */\n\treadonly transactions: {\n\t\tlist: (params?: TransactionsListParams) => Promise<TransactionsEnvelope>;\n\t\twalk: (params?: TransactionsWalkParams) => AsyncIterable<IndexTransaction>;\n\t\tget: (txId: string) => Promise<TransactionEnvelope | null>;\n\t\tgetProof: (txId: string) => Promise<TransactionProof | null>;\n\t} = {\n\t\tlist: (\n\t\t\tparams: TransactionsListParams = {},\n\t\t): Promise<TransactionsEnvelope> => this.listTransactions(params),\n\t\twalk: (\n\t\t\tparams: TransactionsWalkParams = {},\n\t\t): AsyncIterable<IndexTransaction> => this.walkTransactions(params),\n\t\tget: (txId: string): Promise<TransactionEnvelope | null> =>\n\t\t\tthis.getTransaction(txId),\n\t\tgetProof: (txId: string): Promise<TransactionProof | null> =>\n\t\t\tthis.getTransactionProof(txId),\n\t};\n\n\t/** Decoded PoX-4 stacking actions. Empty (with a `notes` hint) when the\n\t * platform's PoX-4 decoder is disabled. */\n\treadonly stacking: {\n\t\tlist: (params?: StackingListParams) => Promise<StackingEnvelope>;\n\t\twalk: (params?: StackingWalkParams) => AsyncIterable<IndexStackingAction>;\n\t} = {\n\t\tlist: (params: StackingListParams = {}): Promise<StackingEnvelope> =>\n\t\t\tthis.listStacking(params),\n\t\twalk: (\n\t\t\tparams: StackingWalkParams = {},\n\t\t): AsyncIterable<IndexStackingAction> => this.walkStacking(params),\n\t};\n\n\t/** Pending (unconfirmed) transactions: paginated `list`/`walk`, plus `get` by\n\t * tx_id (resolves to null when the tx has confirmed or dropped). */\n\treadonly mempool: {\n\t\tlist: (params?: MempoolListParams) => Promise<MempoolEnvelope>;\n\t\twalk: (\n\t\t\tparams?: MempoolWalkParams,\n\t\t) => AsyncIterable<IndexMempoolTransaction>;\n\t\tget: (txId: string) => Promise<MempoolTransactionEnvelope | null>;\n\t} = {\n\t\tlist: (params: MempoolListParams = {}): Promise<MempoolEnvelope> =>\n\t\t\tthis.listMempool(params),\n\t\twalk: (\n\t\t\tparams: MempoolWalkParams = {},\n\t\t): AsyncIterable<IndexMempoolTransaction> => this.walkMempool(params),\n\t\tget: (txId: string): Promise<MempoolTransactionEnvelope | null> =>\n\t\t\tthis.getMempoolTx(txId),\n\t};\n\n\tprivate async listFtTransfers(\n\t\tparams: FtTransfersListParams = {},\n\t): Promise<FtTransfersEnvelope> {\n\t\treturn this.request<FtTransfersEnvelope>(\n\t\t\t\"GET\",\n\t\t\t`/v1/index/ft-transfers${buildQuery({\n\t\t\t\tcursor: params.cursor,\n\t\t\t\tfrom_cursor: params.fromCursor,\n\t\t\t\tlimit: params.limit,\n\t\t\t\tcontract_id: params.contractId,\n\t\t\t\tsender: params.sender,\n\t\t\t\trecipient: params.recipient,\n\t\t\t\tfrom_height: params.fromHeight,\n\t\t\t\tto_height: params.toHeight,\n\t\t\t})}`,\n\t\t);\n\t}\n\n\tprivate async listNftTransfers(\n\t\tparams: NftTransfersListParams = {},\n\t): Promise<NftTransfersEnvelope> {\n\t\treturn this.request<NftTransfersEnvelope>(\n\t\t\t\"GET\",\n\t\t\t`/v1/index/nft-transfers${buildQuery({\n\t\t\t\tcursor: params.cursor,\n\t\t\t\tfrom_cursor: params.fromCursor,\n\t\t\t\tlimit: params.limit,\n\t\t\t\tcontract_id: params.contractId,\n\t\t\t\tasset_identifier: params.assetIdentifier,\n\t\t\t\tsender: params.sender,\n\t\t\t\trecipient: params.recipient,\n\t\t\t\tfrom_height: params.fromHeight,\n\t\t\t\tto_height: params.toHeight,\n\t\t\t})}`,\n\t\t);\n\t}\n\n\tprivate async *walkFtTransfers(\n\t\tparams: FtTransfersWalkParams = {},\n\t): AsyncGenerator<FtTransfer> {\n\t\tconst batchSize = params.batchSize ?? 200;\n\t\tlet cursor = params.cursor ?? params.fromCursor ?? null;\n\t\tlet firstPage = true;\n\n\t\twhile (!params.signal?.aborted) {\n\t\t\tconst envelope = await this.listFtTransfers({\n\t\t\t\t...params,\n\t\t\t\tlimit: batchSize,\n\t\t\t\tcursor: firstPage ? params.cursor : cursor,\n\t\t\t\tfromCursor: firstPage ? params.fromCursor : undefined,\n\t\t\t\tfromHeight: firstPage ? firstWalkFromHeight(params) : undefined,\n\t\t\t});\n\n\t\t\tfor (const event of envelope.events) {\n\t\t\t\tif (params.signal?.aborted) return;\n\t\t\t\tyield event;\n\t\t\t}\n\n\t\t\tconst nextCursor = envelope.next_cursor;\n\t\t\tif (\n\t\t\t\t!nextCursor ||\n\t\t\t\tnextCursor === cursor ||\n\t\t\t\tenvelope.events.length < batchSize\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcursor = nextCursor;\n\t\t\tfirstPage = false;\n\t\t}\n\t}\n\n\tprivate async *walkNftTransfers(\n\t\tparams: NftTransfersWalkParams = {},\n\t): AsyncGenerator<NftTransfer> {\n\t\tconst batchSize = params.batchSize ?? 200;\n\t\tlet cursor = params.cursor ?? params.fromCursor ?? null;\n\t\tlet firstPage = true;\n\n\t\twhile (!params.signal?.aborted) {\n\t\t\tconst envelope = await this.listNftTransfers({\n\t\t\t\t...params,\n\t\t\t\tlimit: batchSize,\n\t\t\t\tcursor: firstPage ? params.cursor : cursor,\n\t\t\t\tfromCursor: firstPage ? params.fromCursor : undefined,\n\t\t\t\tfromHeight: firstPage ? firstWalkFromHeight(params) : undefined,\n\t\t\t});\n\n\t\t\tfor (const event of envelope.events) {\n\t\t\t\tif (params.signal?.aborted) return;\n\t\t\t\tyield event;\n\t\t\t}\n\n\t\t\tconst nextCursor = envelope.next_cursor;\n\t\t\tif (\n\t\t\t\t!nextCursor ||\n\t\t\t\tnextCursor === cursor ||\n\t\t\t\tenvelope.events.length < batchSize\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcursor = nextCursor;\n\t\t\tfirstPage = false;\n\t\t}\n\t}\n\n\tprivate async listEvents(params: EventsListParams): Promise<EventsEnvelope> {\n\t\treturn this.request<EventsEnvelope>(\n\t\t\t\"GET\",\n\t\t\t`/v1/index/events${buildQuery({\n\t\t\t\tevent_type: params.eventType,\n\t\t\t\tcursor: params.cursor,\n\t\t\t\tfrom_cursor: params.fromCursor,\n\t\t\t\tlimit: params.limit,\n\t\t\t\tcontract_id: params.contractId,\n\t\t\t\tasset_identifier: params.assetIdentifier,\n\t\t\t\tsender: params.sender,\n\t\t\t\trecipient: params.recipient,\n\t\t\t\tfrom_height: params.fromHeight,\n\t\t\t\tto_height: params.toHeight,\n\t\t\t\ttrait: params.trait,\n\t\t\t})}`,\n\t\t);\n\t}\n\n\tprivate async *walkEvents(\n\t\tparams: EventsWalkParams,\n\t): AsyncGenerator<IndexEvent> {\n\t\tconst batchSize = params.batchSize ?? 200;\n\t\tlet cursor = params.cursor ?? params.fromCursor ?? null;\n\t\tlet firstPage = true;\n\n\t\twhile (!params.signal?.aborted) {\n\t\t\tconst envelope = await this.listEvents({\n\t\t\t\t...params,\n\t\t\t\tlimit: batchSize,\n\t\t\t\tcursor: firstPage ? params.cursor : cursor,\n\t\t\t\tfromCursor: firstPage ? params.fromCursor : undefined,\n\t\t\t\tfromHeight: firstPage ? firstWalkFromHeight(params) : undefined,\n\t\t\t});\n\n\t\t\tfor (const event of envelope.events) {\n\t\t\t\tif (params.signal?.aborted) return;\n\t\t\t\tyield event;\n\t\t\t}\n\n\t\t\tconst nextCursor = envelope.next_cursor;\n\t\t\tif (\n\t\t\t\t!nextCursor ||\n\t\t\t\tnextCursor === cursor ||\n\t\t\t\tenvelope.events.length < batchSize\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcursor = nextCursor;\n\t\t\tfirstPage = false;\n\t\t}\n\t}\n\n\tprivate async listContractCalls(\n\t\tparams: ContractCallsListParams = {},\n\t): Promise<ContractCallsEnvelope> {\n\t\treturn this.request<ContractCallsEnvelope>(\n\t\t\t\"GET\",\n\t\t\t`/v1/index/contract-calls${buildQuery({\n\t\t\t\tcursor: params.cursor,\n\t\t\t\tfrom_cursor: params.fromCursor,\n\t\t\t\tlimit: params.limit,\n\t\t\t\tcontract_id: params.contractId,\n\t\t\t\tfunction_name: params.functionName,\n\t\t\t\tsender: params.sender,\n\t\t\t\tfrom_height: params.fromHeight,\n\t\t\t\tto_height: params.toHeight,\n\t\t\t\ttrait: params.trait,\n\t\t\t})}`,\n\t\t);\n\t}\n\n\tprivate async *walkContractCalls(\n\t\tparams: ContractCallsWalkParams = {},\n\t): AsyncGenerator<IndexContractCall> {\n\t\tconst batchSize = params.batchSize ?? 200;\n\t\tlet cursor = params.cursor ?? params.fromCursor ?? null;\n\t\tlet firstPage = true;\n\n\t\twhile (!params.signal?.aborted) {\n\t\t\tconst envelope = await this.listContractCalls({\n\t\t\t\t...params,\n\t\t\t\tlimit: batchSize,\n\t\t\t\tcursor: firstPage ? params.cursor : cursor,\n\t\t\t\tfromCursor: firstPage ? params.fromCursor : undefined,\n\t\t\t\tfromHeight: firstPage ? firstWalkFromHeight(params) : undefined,\n\t\t\t});\n\n\t\t\tfor (const call of envelope.contract_calls) {\n\t\t\t\tif (params.signal?.aborted) return;\n\t\t\t\tyield call;\n\t\t\t}\n\n\t\t\tconst nextCursor = envelope.next_cursor;\n\t\t\tif (\n\t\t\t\t!nextCursor ||\n\t\t\t\tnextCursor === cursor ||\n\t\t\t\tenvelope.contract_calls.length < batchSize\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcursor = nextCursor;\n\t\t\tfirstPage = false;\n\t\t}\n\t}\n\n\tprivate async listCanonical(\n\t\tparams: CanonicalListParams = {},\n\t): Promise<CanonicalEnvelope> {\n\t\treturn this.request<CanonicalEnvelope>(\n\t\t\t\"GET\",\n\t\t\t`/v1/index/canonical${buildQuery({\n\t\t\t\tcursor: params.cursor,\n\t\t\t\tfrom_cursor: params.fromCursor,\n\t\t\t\tlimit: params.limit,\n\t\t\t\tfrom_height: params.fromHeight,\n\t\t\t\tto_height: params.toHeight,\n\t\t\t})}`,\n\t\t);\n\t}\n\n\tprivate async *walkCanonical(\n\t\tparams: CanonicalWalkParams = {},\n\t): AsyncGenerator<IndexCanonicalBlock> {\n\t\tconst batchSize = params.batchSize ?? 200;\n\t\tlet cursor = params.cursor ?? params.fromCursor ?? null;\n\t\tlet firstPage = true;\n\n\t\twhile (!params.signal?.aborted) {\n\t\t\tconst envelope = await this.listCanonical({\n\t\t\t\t...params,\n\t\t\t\tlimit: batchSize,\n\t\t\t\tcursor: firstPage ? params.cursor : cursor,\n\t\t\t\tfromCursor: firstPage ? params.fromCursor : undefined,\n\t\t\t\tfromHeight: firstPage ? firstWalkFromHeight(params) : undefined,\n\t\t\t});\n\n\t\t\tfor (const block of envelope.canonical) {\n\t\t\t\tif (params.signal?.aborted) return;\n\t\t\t\tyield block;\n\t\t\t}\n\n\t\t\tconst nextCursor = envelope.next_cursor;\n\t\t\tif (\n\t\t\t\t!nextCursor ||\n\t\t\t\tnextCursor === cursor ||\n\t\t\t\tenvelope.canonical.length < batchSize\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcursor = nextCursor;\n\t\t\tfirstPage = false;\n\t\t}\n\t}\n\n\tprivate async listBlocks(\n\t\tparams: BlocksListParams = {},\n\t): Promise<BlocksEnvelope> {\n\t\treturn this.request<BlocksEnvelope>(\n\t\t\t\"GET\",\n\t\t\t`/v1/index/blocks${buildQuery({\n\t\t\t\tcursor: params.cursor,\n\t\t\t\tfrom_cursor: params.fromCursor,\n\t\t\t\tlimit: params.limit,\n\t\t\t\tfrom_height: params.fromHeight,\n\t\t\t\tto_height: params.toHeight,\n\t\t\t})}`,\n\t\t);\n\t}\n\n\tprivate async getBlock(ref: string | number): Promise<BlockEnvelope | null> {\n\t\ttry {\n\t\t\treturn await this.request<BlockEnvelope>(\n\t\t\t\t\"GET\",\n\t\t\t\t`/v1/index/blocks/${encodeURIComponent(String(ref))}`,\n\t\t\t);\n\t\t} catch (err) {\n\t\t\tif (err instanceof ApiError && err.status === 404) return null;\n\t\t\tthrow err;\n\t\t}\n\t}\n\n\tprivate async *walkBlocks(\n\t\tparams: BlocksWalkParams = {},\n\t): AsyncGenerator<IndexBlock> {\n\t\tconst batchSize = params.batchSize ?? 200;\n\t\tlet cursor = params.cursor ?? params.fromCursor ?? null;\n\t\tlet firstPage = true;\n\n\t\twhile (!params.signal?.aborted) {\n\t\t\tconst envelope = await this.listBlocks({\n\t\t\t\t...params,\n\t\t\t\tlimit: batchSize,\n\t\t\t\tcursor: firstPage ? params.cursor : cursor,\n\t\t\t\tfromCursor: firstPage ? params.fromCursor : undefined,\n\t\t\t\tfromHeight: firstPage ? firstWalkFromHeight(params) : undefined,\n\t\t\t});\n\n\t\t\tfor (const block of envelope.blocks) {\n\t\t\t\tif (params.signal?.aborted) return;\n\t\t\t\tyield block;\n\t\t\t}\n\n\t\t\tconst nextCursor = envelope.next_cursor;\n\t\t\tif (\n\t\t\t\t!nextCursor ||\n\t\t\t\tnextCursor === cursor ||\n\t\t\t\tenvelope.blocks.length < batchSize\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcursor = nextCursor;\n\t\t\tfirstPage = false;\n\t\t}\n\t}\n\n\tprivate async listTransactions(\n\t\tparams: TransactionsListParams = {},\n\t): Promise<TransactionsEnvelope> {\n\t\treturn this.request<TransactionsEnvelope>(\n\t\t\t\"GET\",\n\t\t\t`/v1/index/transactions${buildQuery({\n\t\t\t\tcursor: params.cursor,\n\t\t\t\tfrom_cursor: params.fromCursor,\n\t\t\t\tlimit: params.limit,\n\t\t\t\ttype: params.type,\n\t\t\t\tsender: params.sender,\n\t\t\t\tcontract_id: params.contractId,\n\t\t\t\tfrom_height: params.fromHeight,\n\t\t\t\tto_height: params.toHeight,\n\t\t\t})}`,\n\t\t);\n\t}\n\n\tprivate async getTransaction(\n\t\ttxId: string,\n\t): Promise<TransactionEnvelope | null> {\n\t\ttry {\n\t\t\treturn await this.request<TransactionEnvelope>(\n\t\t\t\t\"GET\",\n\t\t\t\t`/v1/index/transactions/${encodeURIComponent(txId)}`,\n\t\t\t);\n\t\t} catch (err) {\n\t\t\tif (err instanceof ApiError && err.status === 404) return null;\n\t\t\tthrow err;\n\t\t}\n\t}\n\n\t/** Fetch the inclusion proof for a tx (raw tx + Nakamoto header + merkle path)\n\t * to verify client-side with `verifyTransactionProof`. 404 → null. A 503\n\t * (`PROOF_TX_SET_INCOMPLETE` / `PROOF_NODE_UNAVAILABLE`) surfaces as an\n\t * ApiError — the proof can't be assembled on this deployment right now. */\n\tprivate async getTransactionProof(\n\t\ttxId: string,\n\t): Promise<TransactionProof | null> {\n\t\ttry {\n\t\t\treturn await this.request<TransactionProof>(\n\t\t\t\t\"GET\",\n\t\t\t\t`/v1/index/transactions/${encodeURIComponent(txId)}/proof`,\n\t\t\t);\n\t\t} catch (err) {\n\t\t\tif (err instanceof ApiError && err.status === 404) return null;\n\t\t\tthrow err;\n\t\t}\n\t}\n\n\tprivate async *walkTransactions(\n\t\tparams: TransactionsWalkParams = {},\n\t): AsyncGenerator<IndexTransaction> {\n\t\tconst batchSize = params.batchSize ?? 200;\n\t\tlet cursor = params.cursor ?? params.fromCursor ?? null;\n\t\tlet firstPage = true;\n\n\t\twhile (!params.signal?.aborted) {\n\t\t\tconst envelope = await this.listTransactions({\n\t\t\t\t...params,\n\t\t\t\tlimit: batchSize,\n\t\t\t\tcursor: firstPage ? params.cursor : cursor,\n\t\t\t\tfromCursor: firstPage ? params.fromCursor : undefined,\n\t\t\t\tfromHeight: firstPage ? firstWalkFromHeight(params) : undefined,\n\t\t\t});\n\n\t\t\tfor (const tx of envelope.transactions) {\n\t\t\t\tif (params.signal?.aborted) return;\n\t\t\t\tyield tx;\n\t\t\t}\n\n\t\t\tconst nextCursor = envelope.next_cursor;\n\t\t\tif (\n\t\t\t\t!nextCursor ||\n\t\t\t\tnextCursor === cursor ||\n\t\t\t\tenvelope.transactions.length < batchSize\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcursor = nextCursor;\n\t\t\tfirstPage = false;\n\t\t}\n\t}\n\n\tprivate async listStacking(\n\t\tparams: StackingListParams = {},\n\t): Promise<StackingEnvelope> {\n\t\treturn this.request<StackingEnvelope>(\n\t\t\t\"GET\",\n\t\t\t`/v1/index/stacking${buildQuery({\n\t\t\t\tcursor: params.cursor,\n\t\t\t\tfrom_cursor: params.fromCursor,\n\t\t\t\tlimit: params.limit,\n\t\t\t\tfunction_name: params.functionName,\n\t\t\t\tstacker: params.stacker,\n\t\t\t\tcaller: params.caller,\n\t\t\t\tfrom_height: params.fromHeight,\n\t\t\t\tto_height: params.toHeight,\n\t\t\t})}`,\n\t\t);\n\t}\n\n\tprivate async *walkStacking(\n\t\tparams: StackingWalkParams = {},\n\t): AsyncGenerator<IndexStackingAction> {\n\t\tconst batchSize = params.batchSize ?? 200;\n\t\tlet cursor = params.cursor ?? params.fromCursor ?? null;\n\t\tlet firstPage = true;\n\n\t\twhile (!params.signal?.aborted) {\n\t\t\tconst envelope = await this.listStacking({\n\t\t\t\t...params,\n\t\t\t\tlimit: batchSize,\n\t\t\t\tcursor: firstPage ? params.cursor : cursor,\n\t\t\t\tfromCursor: firstPage ? params.fromCursor : undefined,\n\t\t\t\tfromHeight: firstPage ? firstWalkFromHeight(params) : undefined,\n\t\t\t});\n\n\t\t\tfor (const action of envelope.stacking) {\n\t\t\t\tif (params.signal?.aborted) return;\n\t\t\t\tyield action;\n\t\t\t}\n\n\t\t\tconst nextCursor = envelope.next_cursor;\n\t\t\tif (\n\t\t\t\t!nextCursor ||\n\t\t\t\tnextCursor === cursor ||\n\t\t\t\tenvelope.stacking.length < batchSize\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcursor = nextCursor;\n\t\t\tfirstPage = false;\n\t\t}\n\t}\n\n\tprivate async listMempool(\n\t\tparams: MempoolListParams = {},\n\t): Promise<MempoolEnvelope> {\n\t\treturn this.request<MempoolEnvelope>(\n\t\t\t\"GET\",\n\t\t\t`/v1/index/mempool${buildQuery({\n\t\t\t\tcursor: params.cursor,\n\t\t\t\tfrom_cursor: params.fromCursor,\n\t\t\t\tlimit: params.limit,\n\t\t\t\tsender: params.sender,\n\t\t\t\ttype: params.type,\n\t\t\t\tcontract_id: params.contractId,\n\t\t\t})}`,\n\t\t);\n\t}\n\n\tprivate async getMempoolTx(\n\t\ttxId: string,\n\t): Promise<MempoolTransactionEnvelope | null> {\n\t\ttry {\n\t\t\treturn await this.request<MempoolTransactionEnvelope>(\n\t\t\t\t\"GET\",\n\t\t\t\t`/v1/index/mempool/${encodeURIComponent(txId)}`,\n\t\t\t);\n\t\t} catch (err) {\n\t\t\tif (err instanceof ApiError && err.status === 404) return null;\n\t\t\tthrow err;\n\t\t}\n\t}\n\n\tprivate async *walkMempool(\n\t\tparams: MempoolWalkParams = {},\n\t): AsyncGenerator<IndexMempoolTransaction> {\n\t\tconst batchSize = params.batchSize ?? 200;\n\t\tlet cursor = params.cursor ?? params.fromCursor ?? null;\n\t\tlet firstPage = true;\n\n\t\twhile (!params.signal?.aborted) {\n\t\t\tconst envelope = await this.listMempool({\n\t\t\t\t...params,\n\t\t\t\tlimit: batchSize,\n\t\t\t\tcursor: firstPage ? params.cursor : cursor,\n\t\t\t\tfromCursor: firstPage ? params.fromCursor : undefined,\n\t\t\t});\n\n\t\t\tfor (const tx of envelope.mempool) {\n\t\t\t\tif (params.signal?.aborted) return;\n\t\t\t\tyield tx;\n\t\t\t}\n\n\t\t\tconst nextCursor = envelope.next_cursor;\n\t\t\tif (\n\t\t\t\t!nextCursor ||\n\t\t\t\tnextCursor === cursor ||\n\t\t\t\tenvelope.mempool.length < batchSize\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcursor = nextCursor;\n\t\t\tfirstPage = false;\n\t\t}\n\t}\n}\n",
11
+ "import type { InferredTopicSchema } from \"@secondlayer/subgraphs\";\nimport { BaseClient, buildQuery } from \"../base.ts\";\nimport type { SecondLayerOptions } from \"../base.ts\";\nimport { ApiError } from \"../errors.ts\";\nimport type { TransactionProof } from \"../proofs.ts\";\n\nexport type IndexTip = {\n\tblock_height: number;\n\tlag_seconds: number;\n};\n\n/**\n * A chain reorg overlapping a returned page's height range. Height-keyed feeds\n * (`/transactions`, `/contract-calls`, `/stacking`) populate this so a consumer\n * can reconcile: roll back the rows whose `block_height:tx_index` cursor falls in\n * `orphaned_range`, then re-fetch from `new_canonical_tip`. Empty when the page\n * spans no reorg.\n */\nexport type IndexReorg = {\n\tid: string;\n\tdetected_at: string;\n\tfork_point_height: number;\n\told_index_block_hash: string | null;\n\tnew_index_block_hash: string | null;\n\t/** Orphaned cursor span `<block_height>:<tx_index>`, inclusive. */\n\torphaned_range: { from: string; to: string };\n\t/** New canonical tip cursor to resume from. */\n\tnew_canonical_tip: string;\n};\n\nexport type IndexUsage = {\n\tproduct: \"index\";\n\ttier: string;\n\tlimits: { rate_limit_per_second: number | null };\n\tusage: { decoded_events_today: number; decoded_events_this_month: number };\n};\n\nexport type FtTransfer = {\n\tcursor: string;\n\tblock_height: number;\n\ttx_id: string;\n\ttx_index: number;\n\tevent_index: number;\n\tevent_type: \"ft_transfer\";\n\tcontract_id: string;\n\tasset_identifier: string;\n\tsender: string;\n\trecipient: string;\n\tamount: string;\n};\n\nexport type FtTransfersEnvelope = {\n\tevents: FtTransfer[];\n\tnext_cursor: string | null;\n\ttip: IndexTip;\n\t// Chain reorgs overlapping this page's height range; empty when none.\n\treorgs: IndexReorg[];\n};\n\nexport type FtTransfersListParams = {\n\tcursor?: string | null;\n\tfromCursor?: string | null;\n\tlimit?: number;\n\tcontractId?: string;\n\tsender?: string;\n\trecipient?: string;\n\tfromHeight?: number;\n\ttoHeight?: number;\n};\n\nexport type FtTransfersWalkParams = Omit<FtTransfersListParams, \"limit\"> & {\n\tbatchSize?: number;\n\tsignal?: AbortSignal;\n};\n\nexport type NftTransfer = {\n\tcursor: string;\n\tblock_height: number;\n\ttx_id: string;\n\ttx_index: number;\n\tevent_index: number;\n\tevent_type: \"nft_transfer\";\n\tcontract_id: string;\n\tasset_identifier: string;\n\tsender: string;\n\trecipient: string;\n\tvalue: string;\n};\n\nexport type NftTransfersEnvelope = {\n\tevents: NftTransfer[];\n\tnext_cursor: string | null;\n\ttip: IndexTip;\n\t// Chain reorgs overlapping this page's height range; empty when none.\n\treorgs: IndexReorg[];\n};\n\nexport type NftTransfersListParams = {\n\tcursor?: string | null;\n\tfromCursor?: string | null;\n\tlimit?: number;\n\tcontractId?: string;\n\tassetIdentifier?: string;\n\tsender?: string;\n\trecipient?: string;\n\tfromHeight?: number;\n\ttoHeight?: number;\n};\n\nexport type NftTransfersWalkParams = Omit<NftTransfersListParams, \"limit\"> & {\n\tbatchSize?: number;\n\tsignal?: AbortSignal;\n};\n\n// ── Generic decoded events (/v1/index/events) ──────────────────────\n\ntype IndexEventBase = {\n\tcursor: string;\n\tblock_height: number;\n\tblock_time?: string | null;\n\ttx_id: string;\n\ttx_index: number;\n\tevent_index: number;\n\tcontract_id: string | null;\n};\n\nexport type IndexFtTransfer = IndexEventBase & {\n\tevent_type: \"ft_transfer\";\n\tasset_identifier: string;\n\tsender: string;\n\trecipient: string;\n\tamount: string;\n};\nexport type IndexNftTransfer = IndexEventBase & {\n\tevent_type: \"nft_transfer\";\n\tasset_identifier: string;\n\tsender: string;\n\trecipient: string;\n\tvalue: string;\n};\nexport type IndexStxTransfer = IndexEventBase & {\n\tevent_type: \"stx_transfer\";\n\tsender: string;\n\trecipient: string;\n\tamount: string;\n\tmemo: string | null;\n};\nexport type IndexStxMint = IndexEventBase & {\n\tevent_type: \"stx_mint\";\n\trecipient: string;\n\tamount: string;\n};\nexport type IndexStxBurn = IndexEventBase & {\n\tevent_type: \"stx_burn\";\n\tsender: string;\n\tamount: string;\n};\nexport type IndexStxLock = IndexEventBase & {\n\tevent_type: \"stx_lock\";\n\tsender: string;\n\tamount: string;\n\tpayload: { unlock_height: string | null };\n};\nexport type IndexFtMint = IndexEventBase & {\n\tevent_type: \"ft_mint\";\n\tasset_identifier: string;\n\trecipient: string;\n\tamount: string;\n};\nexport type IndexFtBurn = IndexEventBase & {\n\tevent_type: \"ft_burn\";\n\tasset_identifier: string;\n\tsender: string;\n\tamount: string;\n};\nexport type IndexNftMint = IndexEventBase & {\n\tevent_type: \"nft_mint\";\n\tasset_identifier: string;\n\trecipient: string;\n\tvalue: string;\n};\nexport type IndexNftBurn = IndexEventBase & {\n\tevent_type: \"nft_burn\";\n\tasset_identifier: string;\n\tsender: string;\n\tvalue: string;\n};\nexport type IndexPrint = IndexEventBase & {\n\tevent_type: \"print\";\n\tpayload: { topic: string | null; value: unknown; raw_value: string | null };\n};\n\n/** Decoded chain event, discriminated by `event_type`. */\nexport type IndexEvent =\n\t| IndexFtTransfer\n\t| IndexNftTransfer\n\t| IndexStxTransfer\n\t| IndexStxMint\n\t| IndexStxBurn\n\t| IndexStxLock\n\t| IndexFtMint\n\t| IndexFtBurn\n\t| IndexNftMint\n\t| IndexNftBurn\n\t| IndexPrint;\n\nexport type IndexEventType = IndexEvent[\"event_type\"];\n\nexport type EventsEnvelope = {\n\tevents: IndexEvent[];\n\tnext_cursor: string | null;\n\ttip: IndexTip;\n\t// Chain reorgs overlapping this page's height range; empty when none.\n\treorgs: IndexReorg[];\n};\n\nexport type EventsListParams = {\n\t/** Required. One of the decoded event types. */\n\teventType: IndexEventType;\n\tcursor?: string | null;\n\tfromCursor?: string | null;\n\tlimit?: number;\n\tcontractId?: string;\n\tassetIdentifier?: string;\n\tsender?: string;\n\trecipient?: string;\n\tfromHeight?: number;\n\ttoHeight?: number;\n\t/** Restrict to contracts conforming to a trait/standard (e.g. \"sip-010\").\n\t * Mutually exclusive with contractId; contract-keyed event types only. */\n\ttrait?: string;\n};\n\nexport type EventsWalkParams = Omit<EventsListParams, \"limit\"> & {\n\tbatchSize?: number;\n\tsignal?: AbortSignal;\n};\n\n// ── Contract calls (/v1/index/contract-calls) ──────────────────────\n\nexport type IndexContractCall = {\n\tcursor: string;\n\tblock_height: number;\n\tblock_time?: string | null;\n\ttx_id: string;\n\ttx_index: number;\n\tcontract_id: string;\n\tfunction_name: string;\n\tsender: string;\n\tstatus: string;\n\targs: unknown[];\n\tresult: unknown;\n\tresult_hex: string | null;\n};\n\nexport type ContractCallsEnvelope = {\n\tcontract_calls: IndexContractCall[];\n\tnext_cursor: string | null;\n\ttip: IndexTip;\n\t// Chain reorgs overlapping this page's height range; empty when none.\n\treorgs: IndexReorg[];\n};\n\nexport type ContractCallsListParams = {\n\tcursor?: string | null;\n\tfromCursor?: string | null;\n\tlimit?: number;\n\tcontractId?: string;\n\tfunctionName?: string;\n\tsender?: string;\n\tfromHeight?: number;\n\ttoHeight?: number;\n\t/** Restrict to contracts conforming to a trait/standard (e.g. \"sip-010\").\n\t * Mutually exclusive with contractId. */\n\ttrait?: string;\n};\n\nexport type ContractCallsWalkParams = Omit<ContractCallsListParams, \"limit\"> & {\n\tbatchSize?: number;\n\tsignal?: AbortSignal;\n};\n\n// ── Canonical block-hash map (/v1/index/canonical) ─────────────────\n\n/** One canonical block in the sync map. Lean by design — block + parent hash\n * for chain linkage, burn anchor for Bitcoin confirmations. Use `blocks` for\n * the full block resource. */\nexport type IndexCanonicalBlock = {\n\tcursor: string;\n\tblock_height: number;\n\tblock_hash: string;\n\tparent_hash: string;\n\tburn_block_height: number;\n\tburn_block_hash: string | null;\n};\n\nexport type CanonicalEnvelope = {\n\tcanonical: IndexCanonicalBlock[];\n\tnext_cursor: string | null;\n\ttip: IndexTip;\n};\n\nexport type CanonicalListParams = {\n\tcursor?: string | null;\n\tfromCursor?: string | null;\n\tlimit?: number;\n\tfromHeight?: number;\n\ttoHeight?: number;\n};\n\nexport type CanonicalWalkParams = Omit<CanonicalListParams, \"limit\"> & {\n\tbatchSize?: number;\n\tsignal?: AbortSignal;\n};\n\n// ── Blocks (/v1/index/blocks) ──────────────────────────────────────\n\n/** A block resource. Metadata is intentionally thin — only chain-linkage and\n * burn-anchor fields are persisted (no miner / tx_count / signer). */\nexport type IndexBlock = {\n\tcursor: string;\n\tblock_height: number;\n\tblock_hash: string;\n\tparent_hash: string;\n\tburn_block_height: number;\n\tburn_block_hash: string | null;\n\tblock_time: string | null;\n\tcanonical: boolean;\n};\n\nexport type BlocksEnvelope = {\n\tblocks: IndexBlock[];\n\tnext_cursor: string | null;\n\ttip: IndexTip;\n};\n\nexport type BlockEnvelope = {\n\tblock: IndexBlock;\n\ttip: IndexTip;\n};\n\nexport type BlocksListParams = {\n\tcursor?: string | null;\n\tfromCursor?: string | null;\n\tlimit?: number;\n\tfromHeight?: number;\n\ttoHeight?: number;\n};\n\nexport type BlocksWalkParams = Omit<BlocksListParams, \"limit\"> & {\n\tbatchSize?: number;\n\tsignal?: AbortSignal;\n};\n\n// ── Transactions (/v1/index/transactions) ──────────────────────────\n\nexport type IndexPostCondition =\n\t| {\n\t\t\ttype: \"stx\";\n\t\t\tprincipal: string;\n\t\t\tcondition_code: number;\n\t\t\tcondition_code_name: string | null;\n\t\t\tamount: string;\n\t }\n\t| {\n\t\t\ttype: \"ft\";\n\t\t\tprincipal: string;\n\t\t\tasset_identifier: string;\n\t\t\tcondition_code: number;\n\t\t\tcondition_code_name: string | null;\n\t\t\tamount: string;\n\t }\n\t| {\n\t\t\ttype: \"nft\";\n\t\t\tprincipal: string;\n\t\t\tasset_identifier: string;\n\t\t\tasset_value: unknown;\n\t\t\tcondition_code: number;\n\t\t\tcondition_code_name: string | null;\n\t };\n\n/** Full transaction document: columnar fields plus `raw_tx`-decoded enrichment.\n * Payload sub-objects are present only for the matching `tx_type`; enrichment\n * fields are null when `raw_tx` isn't decodable (e.g. burnchain ops). */\nexport type IndexTransaction = {\n\tcursor: string;\n\ttx_id: string;\n\tblock_height: number;\n\tblock_time?: string | null;\n\ttx_index: number;\n\ttx_type: string;\n\tsender: string;\n\tstatus: string;\n\tfee: string | null;\n\tnonce: string | null;\n\tsponsored: boolean | null;\n\tanchor_mode: string | null;\n\tpost_condition_mode: string | null;\n\tpost_conditions: IndexPostCondition[];\n\tcontract_call?: {\n\t\tcontract_id: string;\n\t\tfunction_name: string;\n\t\tfunction_args: unknown[];\n\t\t/** Raw hex-encoded ClarityValues; decode(function_args_hex[i]) === function_args[i]. */\n\t\tfunction_args_hex: string[];\n\t\tresult: unknown;\n\t\tresult_hex: string | null;\n\t};\n\ttoken_transfer?: { recipient: string; amount: string; memo: string };\n\tsmart_contract?: {\n\t\tcontract_id: string | null;\n\t\tclarity_version: number | null;\n\t};\n\tcoinbase?: { alt_recipient: string | null };\n\ttenure_change?: { cause: number };\n};\n\nexport type TransactionsEnvelope = {\n\ttransactions: IndexTransaction[];\n\tnext_cursor: string | null;\n\ttip: IndexTip;\n\t// Chain reorgs overlapping this page's height range; empty when none.\n\treorgs: IndexReorg[];\n};\n\nexport type TransactionEnvelope = {\n\ttransaction: IndexTransaction;\n\ttip: IndexTip;\n};\n\nexport type TransactionsListParams = {\n\tcursor?: string | null;\n\tfromCursor?: string | null;\n\tlimit?: number;\n\ttype?: string;\n\tsender?: string;\n\tcontractId?: string;\n\tfromHeight?: number;\n\ttoHeight?: number;\n};\n\nexport type TransactionsWalkParams = Omit<TransactionsListParams, \"limit\"> & {\n\tbatchSize?: number;\n\tsignal?: AbortSignal;\n};\n\n// ── Stacking (/v1/index/stacking) ──────────────────────────────────\n\n/** A decoded PoX-4 stacking action (one per stacking contract call). */\nexport type IndexStackingAction = {\n\tcursor: string;\n\tblock_height: number;\n\tblock_time?: string | null;\n\tburn_block_height: number;\n\ttx_id: string;\n\ttx_index: number;\n\tfunction_name: string;\n\tcaller: string;\n\tstacker: string | null;\n\tdelegate_to: string | null;\n\tamount_ustx: string | null;\n\tlock_period: number | null;\n\tpox_addr: {\n\t\tversion: number | null;\n\t\thashbytes: string | null;\n\t\tbtc: string | null;\n\t};\n\tstart_cycle: number | null;\n\tend_cycle: number | null;\n\treward_cycle: number | null;\n\tsigner_key: string | null;\n\tresult_ok: boolean;\n};\n\nexport type StackingEnvelope = {\n\tstacking: IndexStackingAction[];\n\tnext_cursor: string | null;\n\ttip: IndexTip;\n\t// Chain reorgs overlapping this page's height range; empty when none.\n\treorgs: IndexReorg[];\n\t/** Present only when the PoX-4 decoder is disabled, explaining an empty feed. */\n\tnotes?: string;\n};\n\nexport type StackingListParams = {\n\tcursor?: string | null;\n\tfromCursor?: string | null;\n\tlimit?: number;\n\tfunctionName?: string;\n\tstacker?: string;\n\tcaller?: string;\n\tfromHeight?: number;\n\ttoHeight?: number;\n};\n\nexport type StackingWalkParams = Omit<StackingListParams, \"limit\"> & {\n\tbatchSize?: number;\n\tsignal?: AbortSignal;\n};\n\n// ── Mempool (/v1/index/mempool) ────────────────────────────────────\n\n/** A pending (unconfirmed) transaction. Like a transaction document but\n * pre-chain — no block_height/tx_index/result/events — with `received_at` and\n * a sequence cursor instead of a block position. */\nexport type IndexMempoolTransaction = {\n\tcursor: string;\n\ttx_id: string;\n\ttx_type: string;\n\tsender: string;\n\treceived_at?: string | null;\n\tfee: string | null;\n\tnonce: string | null;\n\tsponsored: boolean | null;\n\tanchor_mode: string | null;\n\tpost_condition_mode: string | null;\n\tpost_conditions: IndexPostCondition[];\n\tcontract_call?: {\n\t\tcontract_id: string;\n\t\tfunction_name: string;\n\t\tfunction_args: unknown[];\n\t};\n\ttoken_transfer?: { recipient: string; amount: string; memo: string };\n\tsmart_contract?: { clarity_version: number | null };\n\tcoinbase?: { alt_recipient: string | null };\n\ttenure_change?: { cause: number };\n};\n\nexport type MempoolEnvelope = {\n\tmempool: IndexMempoolTransaction[];\n\tnext_cursor: string | null;\n\ttip: IndexTip;\n};\n\nexport type MempoolTransactionEnvelope = {\n\ttransaction: IndexMempoolTransaction;\n\ttip: IndexTip;\n};\n\nexport type MempoolListParams = {\n\tcursor?: string | null;\n\tfromCursor?: string | null;\n\tlimit?: number;\n\tsender?: string;\n\ttype?: string;\n\t/** Filter to pending calls to a single contract (e.g. `SP….contract`). */\n\tcontractId?: string;\n};\n\nexport type MempoolWalkParams = Omit<MempoolListParams, \"limit\"> & {\n\tbatchSize?: number;\n\tsignal?: AbortSignal;\n};\n\n// ── Print schema (/v1/index/contracts/:contract_id/print-schema) ───\n\n/**\n * Empirical per-topic print payload schema for a contract, inferred from\n * sampled on-chain events. `topics` is sorted by count desc; `sampled` is true\n * when the contract has more print events than the windows examined.\n */\nexport type PrintSchemaResponse = {\n\tcontract_id: string;\n\ttopics: InferredTopicSchema[];\n\tsampled: boolean;\n\ttotal_events: number;\n\t/** True when the count hit the server-side cap (total_events is the cap). */\n\ttotal_events_capped: boolean;\n\tsample: {\n\t\tsize: number;\n\t\tnewest_height: number | null;\n\t\toldest_height: number | null;\n\t};\n\ttip: IndexTip;\n};\n\nfunction firstWalkFromHeight(params: {\n\tcursor?: string | null;\n\tfromCursor?: string | null;\n\tfromHeight?: number;\n}): number | undefined {\n\tif (params.fromHeight !== undefined) return params.fromHeight;\n\tif (params.cursor || params.fromCursor) return undefined;\n\treturn 0;\n}\n\n/**\n * `index.ftTransfers` — callable shorthand for `.list()`, with `.list`/`.walk`\n * still available: `await sl.index.ftTransfers({ contractId })`.\n *\n * The API accepts `contract_id`/`sender`/`recipient` equality filters only —\n * no amount filtering and no asset-slug resolution on /v1/index/ft-transfers.\n */\nexport interface FtTransfersResource {\n\t(params?: FtTransfersListParams): Promise<FtTransfersEnvelope>;\n\tlist(params?: FtTransfersListParams): Promise<FtTransfersEnvelope>;\n\twalk(params?: FtTransfersWalkParams): AsyncIterable<FtTransfer>;\n}\n\n/** `index.nftTransfers` — callable shorthand for `.list()` (see {@link FtTransfersResource}). */\nexport interface NftTransfersResource {\n\t(params?: NftTransfersListParams): Promise<NftTransfersEnvelope>;\n\tlist(params?: NftTransfersListParams): Promise<NftTransfersEnvelope>;\n\twalk(params?: NftTransfersWalkParams): AsyncIterable<NftTransfer>;\n}\n\n/** `index.events` — callable shorthand for `.list()`; `eventType` is required. */\nexport interface IndexEventsResource {\n\t(params: EventsListParams): Promise<EventsEnvelope>;\n\tlist(params: EventsListParams): Promise<EventsEnvelope>;\n\twalk(params: EventsWalkParams): AsyncIterable<IndexEvent>;\n}\n\n/** Per-event-type filter vocabulary in the {@link IndexDiscovery} doc. */\nexport type IndexEventTypeFilters = {\n\tcolumns?: string[];\n\tallowed_filters?: string[];\n\tequality_filters?: string[];\n\trequired_non_null?: string[];\n};\n\n/** The `GET /v1/index` discovery doc — live endpoint + filter vocabulary.\n * Shape is intentionally open (the server may add fields); the agent-relevant\n * parts are the per-type filter rules. */\nexport type IndexDiscovery = {\n\tevent_type_filters?: Record<string, IndexEventTypeFilters>;\n\t[key: string]: unknown;\n};\n\nexport class Index extends BaseClient {\n\tconstructor(options: Partial<SecondLayerOptions> = {}) {\n\t\tsuper(options);\n\t}\n\n\t/** Your own Index consumption (decoded events today + this month) and tier limits. */\n\tusage(): Promise<IndexUsage> {\n\t\treturn this.request<IndexUsage>(\"GET\", \"/v1/index/usage\");\n\t}\n\n\t/**\n\t * Index discovery doc — the live vocabulary: every endpoint, each event type's\n\t * columns, allowed/equality filters, and required-non-null fields. Read this to\n\t * learn what's queryable (and which types accept `trait`) instead of hardcoding.\n\t */\n\tdiscover(): Promise<IndexDiscovery> {\n\t\treturn this.request<IndexDiscovery>(\"GET\", \"/v1/index\");\n\t}\n\n\t/**\n\t * Empirical per-topic print payload schema for a contract — what topics it\n\t * emits and each field's observed Clarity/TS/column types. Anonymous read;\n\t * 404 → null.\n\t */\n\tasync printSchema(contractId: string): Promise<PrintSchemaResponse | null> {\n\t\ttry {\n\t\t\treturn await this.request<PrintSchemaResponse>(\n\t\t\t\t\"GET\",\n\t\t\t\t`/v1/index/contracts/${encodeURIComponent(contractId)}/print-schema`,\n\t\t\t);\n\t\t} catch (err) {\n\t\t\tif (err instanceof ApiError && err.status === 404) return null;\n\t\t\tthrow err;\n\t\t}\n\t}\n\n\t/** Callable: `index.ftTransfers(params)` ≡ `index.ftTransfers.list(params)`. */\n\treadonly ftTransfers: FtTransfersResource = Object.assign(\n\t\t(params: FtTransfersListParams = {}): Promise<FtTransfersEnvelope> =>\n\t\t\tthis.listFtTransfers(params),\n\t\t{\n\t\t\tlist: (\n\t\t\t\tparams: FtTransfersListParams = {},\n\t\t\t): Promise<FtTransfersEnvelope> => this.listFtTransfers(params),\n\t\t\twalk: (params: FtTransfersWalkParams = {}): AsyncIterable<FtTransfer> =>\n\t\t\t\tthis.walkFtTransfers(params),\n\t\t},\n\t);\n\n\t/** Callable: `index.nftTransfers(params)` ≡ `index.nftTransfers.list(params)`. */\n\treadonly nftTransfers: NftTransfersResource = Object.assign(\n\t\t(params: NftTransfersListParams = {}): Promise<NftTransfersEnvelope> =>\n\t\t\tthis.listNftTransfers(params),\n\t\t{\n\t\t\tlist: (\n\t\t\t\tparams: NftTransfersListParams = {},\n\t\t\t): Promise<NftTransfersEnvelope> => this.listNftTransfers(params),\n\t\t\twalk: (params: NftTransfersWalkParams = {}): AsyncIterable<NftTransfer> =>\n\t\t\t\tthis.walkNftTransfers(params),\n\t\t},\n\t);\n\n\t/** Generic decoded events by `event_type` (the full /v1/index/events surface).\n\t * Callable: `index.events(params)` ≡ `index.events.list(params)`. */\n\treadonly events: IndexEventsResource = Object.assign(\n\t\t(params: EventsListParams): Promise<EventsEnvelope> =>\n\t\t\tthis.listEvents(params),\n\t\t{\n\t\t\tlist: (params: EventsListParams): Promise<EventsEnvelope> =>\n\t\t\t\tthis.listEvents(params),\n\t\t\twalk: (params: EventsWalkParams): AsyncIterable<IndexEvent> =>\n\t\t\t\tthis.walkEvents(params),\n\t\t},\n\t);\n\n\treadonly contractCalls: {\n\t\tlist: (params?: ContractCallsListParams) => Promise<ContractCallsEnvelope>;\n\t\twalk: (\n\t\t\tparams?: ContractCallsWalkParams,\n\t\t) => AsyncIterable<IndexContractCall>;\n\t} = {\n\t\tlist: (\n\t\t\tparams: ContractCallsListParams = {},\n\t\t): Promise<ContractCallsEnvelope> => this.listContractCalls(params),\n\t\twalk: (\n\t\t\tparams: ContractCallsWalkParams = {},\n\t\t): AsyncIterable<IndexContractCall> => this.walkContractCalls(params),\n\t};\n\n\t/** Canonical block-hash map — sync only the current canonical chain. */\n\treadonly canonical: {\n\t\tlist: (params?: CanonicalListParams) => Promise<CanonicalEnvelope>;\n\t\twalk: (params?: CanonicalWalkParams) => AsyncIterable<IndexCanonicalBlock>;\n\t} = {\n\t\tlist: (params: CanonicalListParams = {}): Promise<CanonicalEnvelope> =>\n\t\t\tthis.listCanonical(params),\n\t\twalk: (\n\t\t\tparams: CanonicalWalkParams = {},\n\t\t): AsyncIterable<IndexCanonicalBlock> => this.walkCanonical(params),\n\t};\n\n\t/** Canonical blocks: paginated `list`/`walk`, plus `get` by height or hash\n\t * (resolves to null on 404). */\n\treadonly blocks: {\n\t\tlist: (params?: BlocksListParams) => Promise<BlocksEnvelope>;\n\t\twalk: (params?: BlocksWalkParams) => AsyncIterable<IndexBlock>;\n\t\tget: (ref: string | number) => Promise<BlockEnvelope | null>;\n\t} = {\n\t\tlist: (params: BlocksListParams = {}): Promise<BlocksEnvelope> =>\n\t\t\tthis.listBlocks(params),\n\t\twalk: (params: BlocksWalkParams = {}): AsyncIterable<IndexBlock> =>\n\t\t\tthis.walkBlocks(params),\n\t\tget: (ref: string | number): Promise<BlockEnvelope | null> =>\n\t\t\tthis.getBlock(ref),\n\t};\n\n\t/** Full transaction documents: paginated `list`/`walk`, plus `get` by tx_id\n\t * (resolves to null on 404). */\n\treadonly transactions: {\n\t\tlist: (params?: TransactionsListParams) => Promise<TransactionsEnvelope>;\n\t\twalk: (params?: TransactionsWalkParams) => AsyncIterable<IndexTransaction>;\n\t\tget: (txId: string) => Promise<TransactionEnvelope | null>;\n\t\tgetProof: (txId: string) => Promise<TransactionProof | null>;\n\t} = {\n\t\tlist: (\n\t\t\tparams: TransactionsListParams = {},\n\t\t): Promise<TransactionsEnvelope> => this.listTransactions(params),\n\t\twalk: (\n\t\t\tparams: TransactionsWalkParams = {},\n\t\t): AsyncIterable<IndexTransaction> => this.walkTransactions(params),\n\t\tget: (txId: string): Promise<TransactionEnvelope | null> =>\n\t\t\tthis.getTransaction(txId),\n\t\tgetProof: (txId: string): Promise<TransactionProof | null> =>\n\t\t\tthis.getTransactionProof(txId),\n\t};\n\n\t/** Decoded PoX-4 stacking actions. Empty (with a `notes` hint) when the\n\t * platform's PoX-4 decoder is disabled. */\n\treadonly stacking: {\n\t\tlist: (params?: StackingListParams) => Promise<StackingEnvelope>;\n\t\twalk: (params?: StackingWalkParams) => AsyncIterable<IndexStackingAction>;\n\t} = {\n\t\tlist: (params: StackingListParams = {}): Promise<StackingEnvelope> =>\n\t\t\tthis.listStacking(params),\n\t\twalk: (\n\t\t\tparams: StackingWalkParams = {},\n\t\t): AsyncIterable<IndexStackingAction> => this.walkStacking(params),\n\t};\n\n\t/** Pending (unconfirmed) transactions: paginated `list`/`walk`, plus `get` by\n\t * tx_id (resolves to null when the tx has confirmed or dropped). */\n\treadonly mempool: {\n\t\tlist: (params?: MempoolListParams) => Promise<MempoolEnvelope>;\n\t\twalk: (\n\t\t\tparams?: MempoolWalkParams,\n\t\t) => AsyncIterable<IndexMempoolTransaction>;\n\t\tget: (txId: string) => Promise<MempoolTransactionEnvelope | null>;\n\t} = {\n\t\tlist: (params: MempoolListParams = {}): Promise<MempoolEnvelope> =>\n\t\t\tthis.listMempool(params),\n\t\twalk: (\n\t\t\tparams: MempoolWalkParams = {},\n\t\t): AsyncIterable<IndexMempoolTransaction> => this.walkMempool(params),\n\t\tget: (txId: string): Promise<MempoolTransactionEnvelope | null> =>\n\t\t\tthis.getMempoolTx(txId),\n\t};\n\n\tprivate async listFtTransfers(\n\t\tparams: FtTransfersListParams = {},\n\t): Promise<FtTransfersEnvelope> {\n\t\treturn this.request<FtTransfersEnvelope>(\n\t\t\t\"GET\",\n\t\t\t`/v1/index/ft-transfers${buildQuery({\n\t\t\t\tcursor: params.cursor,\n\t\t\t\tfrom_cursor: params.fromCursor,\n\t\t\t\tlimit: params.limit,\n\t\t\t\tcontract_id: params.contractId,\n\t\t\t\tsender: params.sender,\n\t\t\t\trecipient: params.recipient,\n\t\t\t\tfrom_height: params.fromHeight,\n\t\t\t\tto_height: params.toHeight,\n\t\t\t})}`,\n\t\t);\n\t}\n\n\tprivate async listNftTransfers(\n\t\tparams: NftTransfersListParams = {},\n\t): Promise<NftTransfersEnvelope> {\n\t\treturn this.request<NftTransfersEnvelope>(\n\t\t\t\"GET\",\n\t\t\t`/v1/index/nft-transfers${buildQuery({\n\t\t\t\tcursor: params.cursor,\n\t\t\t\tfrom_cursor: params.fromCursor,\n\t\t\t\tlimit: params.limit,\n\t\t\t\tcontract_id: params.contractId,\n\t\t\t\tasset_identifier: params.assetIdentifier,\n\t\t\t\tsender: params.sender,\n\t\t\t\trecipient: params.recipient,\n\t\t\t\tfrom_height: params.fromHeight,\n\t\t\t\tto_height: params.toHeight,\n\t\t\t})}`,\n\t\t);\n\t}\n\n\tprivate async *walkFtTransfers(\n\t\tparams: FtTransfersWalkParams = {},\n\t): AsyncGenerator<FtTransfer> {\n\t\tconst batchSize = params.batchSize ?? 200;\n\t\tlet cursor = params.cursor ?? params.fromCursor ?? null;\n\t\tlet firstPage = true;\n\n\t\twhile (!params.signal?.aborted) {\n\t\t\tconst envelope = await this.listFtTransfers({\n\t\t\t\t...params,\n\t\t\t\tlimit: batchSize,\n\t\t\t\tcursor: firstPage ? params.cursor : cursor,\n\t\t\t\tfromCursor: firstPage ? params.fromCursor : undefined,\n\t\t\t\tfromHeight: firstPage ? firstWalkFromHeight(params) : undefined,\n\t\t\t});\n\n\t\t\tfor (const event of envelope.events) {\n\t\t\t\tif (params.signal?.aborted) return;\n\t\t\t\tyield event;\n\t\t\t}\n\n\t\t\tconst nextCursor = envelope.next_cursor;\n\t\t\tif (\n\t\t\t\t!nextCursor ||\n\t\t\t\tnextCursor === cursor ||\n\t\t\t\tenvelope.events.length < batchSize\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcursor = nextCursor;\n\t\t\tfirstPage = false;\n\t\t}\n\t}\n\n\tprivate async *walkNftTransfers(\n\t\tparams: NftTransfersWalkParams = {},\n\t): AsyncGenerator<NftTransfer> {\n\t\tconst batchSize = params.batchSize ?? 200;\n\t\tlet cursor = params.cursor ?? params.fromCursor ?? null;\n\t\tlet firstPage = true;\n\n\t\twhile (!params.signal?.aborted) {\n\t\t\tconst envelope = await this.listNftTransfers({\n\t\t\t\t...params,\n\t\t\t\tlimit: batchSize,\n\t\t\t\tcursor: firstPage ? params.cursor : cursor,\n\t\t\t\tfromCursor: firstPage ? params.fromCursor : undefined,\n\t\t\t\tfromHeight: firstPage ? firstWalkFromHeight(params) : undefined,\n\t\t\t});\n\n\t\t\tfor (const event of envelope.events) {\n\t\t\t\tif (params.signal?.aborted) return;\n\t\t\t\tyield event;\n\t\t\t}\n\n\t\t\tconst nextCursor = envelope.next_cursor;\n\t\t\tif (\n\t\t\t\t!nextCursor ||\n\t\t\t\tnextCursor === cursor ||\n\t\t\t\tenvelope.events.length < batchSize\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcursor = nextCursor;\n\t\t\tfirstPage = false;\n\t\t}\n\t}\n\n\tprivate async listEvents(params: EventsListParams): Promise<EventsEnvelope> {\n\t\treturn this.request<EventsEnvelope>(\n\t\t\t\"GET\",\n\t\t\t`/v1/index/events${buildQuery({\n\t\t\t\tevent_type: params.eventType,\n\t\t\t\tcursor: params.cursor,\n\t\t\t\tfrom_cursor: params.fromCursor,\n\t\t\t\tlimit: params.limit,\n\t\t\t\tcontract_id: params.contractId,\n\t\t\t\tasset_identifier: params.assetIdentifier,\n\t\t\t\tsender: params.sender,\n\t\t\t\trecipient: params.recipient,\n\t\t\t\tfrom_height: params.fromHeight,\n\t\t\t\tto_height: params.toHeight,\n\t\t\t\ttrait: params.trait,\n\t\t\t})}`,\n\t\t);\n\t}\n\n\tprivate async *walkEvents(\n\t\tparams: EventsWalkParams,\n\t): AsyncGenerator<IndexEvent> {\n\t\tconst batchSize = params.batchSize ?? 200;\n\t\tlet cursor = params.cursor ?? params.fromCursor ?? null;\n\t\tlet firstPage = true;\n\n\t\twhile (!params.signal?.aborted) {\n\t\t\tconst envelope = await this.listEvents({\n\t\t\t\t...params,\n\t\t\t\tlimit: batchSize,\n\t\t\t\tcursor: firstPage ? params.cursor : cursor,\n\t\t\t\tfromCursor: firstPage ? params.fromCursor : undefined,\n\t\t\t\tfromHeight: firstPage ? firstWalkFromHeight(params) : undefined,\n\t\t\t});\n\n\t\t\tfor (const event of envelope.events) {\n\t\t\t\tif (params.signal?.aborted) return;\n\t\t\t\tyield event;\n\t\t\t}\n\n\t\t\tconst nextCursor = envelope.next_cursor;\n\t\t\tif (\n\t\t\t\t!nextCursor ||\n\t\t\t\tnextCursor === cursor ||\n\t\t\t\tenvelope.events.length < batchSize\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcursor = nextCursor;\n\t\t\tfirstPage = false;\n\t\t}\n\t}\n\n\tprivate async listContractCalls(\n\t\tparams: ContractCallsListParams = {},\n\t): Promise<ContractCallsEnvelope> {\n\t\treturn this.request<ContractCallsEnvelope>(\n\t\t\t\"GET\",\n\t\t\t`/v1/index/contract-calls${buildQuery({\n\t\t\t\tcursor: params.cursor,\n\t\t\t\tfrom_cursor: params.fromCursor,\n\t\t\t\tlimit: params.limit,\n\t\t\t\tcontract_id: params.contractId,\n\t\t\t\tfunction_name: params.functionName,\n\t\t\t\tsender: params.sender,\n\t\t\t\tfrom_height: params.fromHeight,\n\t\t\t\tto_height: params.toHeight,\n\t\t\t\ttrait: params.trait,\n\t\t\t})}`,\n\t\t);\n\t}\n\n\tprivate async *walkContractCalls(\n\t\tparams: ContractCallsWalkParams = {},\n\t): AsyncGenerator<IndexContractCall> {\n\t\tconst batchSize = params.batchSize ?? 200;\n\t\tlet cursor = params.cursor ?? params.fromCursor ?? null;\n\t\tlet firstPage = true;\n\n\t\twhile (!params.signal?.aborted) {\n\t\t\tconst envelope = await this.listContractCalls({\n\t\t\t\t...params,\n\t\t\t\tlimit: batchSize,\n\t\t\t\tcursor: firstPage ? params.cursor : cursor,\n\t\t\t\tfromCursor: firstPage ? params.fromCursor : undefined,\n\t\t\t\tfromHeight: firstPage ? firstWalkFromHeight(params) : undefined,\n\t\t\t});\n\n\t\t\tfor (const call of envelope.contract_calls) {\n\t\t\t\tif (params.signal?.aborted) return;\n\t\t\t\tyield call;\n\t\t\t}\n\n\t\t\tconst nextCursor = envelope.next_cursor;\n\t\t\tif (\n\t\t\t\t!nextCursor ||\n\t\t\t\tnextCursor === cursor ||\n\t\t\t\tenvelope.contract_calls.length < batchSize\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcursor = nextCursor;\n\t\t\tfirstPage = false;\n\t\t}\n\t}\n\n\tprivate async listCanonical(\n\t\tparams: CanonicalListParams = {},\n\t): Promise<CanonicalEnvelope> {\n\t\treturn this.request<CanonicalEnvelope>(\n\t\t\t\"GET\",\n\t\t\t`/v1/index/canonical${buildQuery({\n\t\t\t\tcursor: params.cursor,\n\t\t\t\tfrom_cursor: params.fromCursor,\n\t\t\t\tlimit: params.limit,\n\t\t\t\tfrom_height: params.fromHeight,\n\t\t\t\tto_height: params.toHeight,\n\t\t\t})}`,\n\t\t);\n\t}\n\n\tprivate async *walkCanonical(\n\t\tparams: CanonicalWalkParams = {},\n\t): AsyncGenerator<IndexCanonicalBlock> {\n\t\tconst batchSize = params.batchSize ?? 200;\n\t\tlet cursor = params.cursor ?? params.fromCursor ?? null;\n\t\tlet firstPage = true;\n\n\t\twhile (!params.signal?.aborted) {\n\t\t\tconst envelope = await this.listCanonical({\n\t\t\t\t...params,\n\t\t\t\tlimit: batchSize,\n\t\t\t\tcursor: firstPage ? params.cursor : cursor,\n\t\t\t\tfromCursor: firstPage ? params.fromCursor : undefined,\n\t\t\t\tfromHeight: firstPage ? firstWalkFromHeight(params) : undefined,\n\t\t\t});\n\n\t\t\tfor (const block of envelope.canonical) {\n\t\t\t\tif (params.signal?.aborted) return;\n\t\t\t\tyield block;\n\t\t\t}\n\n\t\t\tconst nextCursor = envelope.next_cursor;\n\t\t\tif (\n\t\t\t\t!nextCursor ||\n\t\t\t\tnextCursor === cursor ||\n\t\t\t\tenvelope.canonical.length < batchSize\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcursor = nextCursor;\n\t\t\tfirstPage = false;\n\t\t}\n\t}\n\n\tprivate async listBlocks(\n\t\tparams: BlocksListParams = {},\n\t): Promise<BlocksEnvelope> {\n\t\treturn this.request<BlocksEnvelope>(\n\t\t\t\"GET\",\n\t\t\t`/v1/index/blocks${buildQuery({\n\t\t\t\tcursor: params.cursor,\n\t\t\t\tfrom_cursor: params.fromCursor,\n\t\t\t\tlimit: params.limit,\n\t\t\t\tfrom_height: params.fromHeight,\n\t\t\t\tto_height: params.toHeight,\n\t\t\t})}`,\n\t\t);\n\t}\n\n\tprivate async getBlock(ref: string | number): Promise<BlockEnvelope | null> {\n\t\ttry {\n\t\t\treturn await this.request<BlockEnvelope>(\n\t\t\t\t\"GET\",\n\t\t\t\t`/v1/index/blocks/${encodeURIComponent(String(ref))}`,\n\t\t\t);\n\t\t} catch (err) {\n\t\t\tif (err instanceof ApiError && err.status === 404) return null;\n\t\t\tthrow err;\n\t\t}\n\t}\n\n\tprivate async *walkBlocks(\n\t\tparams: BlocksWalkParams = {},\n\t): AsyncGenerator<IndexBlock> {\n\t\tconst batchSize = params.batchSize ?? 200;\n\t\tlet cursor = params.cursor ?? params.fromCursor ?? null;\n\t\tlet firstPage = true;\n\n\t\twhile (!params.signal?.aborted) {\n\t\t\tconst envelope = await this.listBlocks({\n\t\t\t\t...params,\n\t\t\t\tlimit: batchSize,\n\t\t\t\tcursor: firstPage ? params.cursor : cursor,\n\t\t\t\tfromCursor: firstPage ? params.fromCursor : undefined,\n\t\t\t\tfromHeight: firstPage ? firstWalkFromHeight(params) : undefined,\n\t\t\t});\n\n\t\t\tfor (const block of envelope.blocks) {\n\t\t\t\tif (params.signal?.aborted) return;\n\t\t\t\tyield block;\n\t\t\t}\n\n\t\t\tconst nextCursor = envelope.next_cursor;\n\t\t\tif (\n\t\t\t\t!nextCursor ||\n\t\t\t\tnextCursor === cursor ||\n\t\t\t\tenvelope.blocks.length < batchSize\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcursor = nextCursor;\n\t\t\tfirstPage = false;\n\t\t}\n\t}\n\n\tprivate async listTransactions(\n\t\tparams: TransactionsListParams = {},\n\t): Promise<TransactionsEnvelope> {\n\t\treturn this.request<TransactionsEnvelope>(\n\t\t\t\"GET\",\n\t\t\t`/v1/index/transactions${buildQuery({\n\t\t\t\tcursor: params.cursor,\n\t\t\t\tfrom_cursor: params.fromCursor,\n\t\t\t\tlimit: params.limit,\n\t\t\t\ttype: params.type,\n\t\t\t\tsender: params.sender,\n\t\t\t\tcontract_id: params.contractId,\n\t\t\t\tfrom_height: params.fromHeight,\n\t\t\t\tto_height: params.toHeight,\n\t\t\t})}`,\n\t\t);\n\t}\n\n\tprivate async getTransaction(\n\t\ttxId: string,\n\t): Promise<TransactionEnvelope | null> {\n\t\ttry {\n\t\t\treturn await this.request<TransactionEnvelope>(\n\t\t\t\t\"GET\",\n\t\t\t\t`/v1/index/transactions/${encodeURIComponent(txId)}`,\n\t\t\t);\n\t\t} catch (err) {\n\t\t\tif (err instanceof ApiError && err.status === 404) return null;\n\t\t\tthrow err;\n\t\t}\n\t}\n\n\t/** Fetch the inclusion proof for a tx (raw tx + Nakamoto header + merkle path)\n\t * to verify client-side with `verifyTransactionProof`. 404 → null. A 503\n\t * (`PROOF_TX_SET_INCOMPLETE` / `PROOF_NODE_UNAVAILABLE`) surfaces as an\n\t * ApiError — the proof can't be assembled on this deployment right now. */\n\tprivate async getTransactionProof(\n\t\ttxId: string,\n\t): Promise<TransactionProof | null> {\n\t\ttry {\n\t\t\treturn await this.request<TransactionProof>(\n\t\t\t\t\"GET\",\n\t\t\t\t`/v1/index/transactions/${encodeURIComponent(txId)}/proof`,\n\t\t\t);\n\t\t} catch (err) {\n\t\t\tif (err instanceof ApiError && err.status === 404) return null;\n\t\t\tthrow err;\n\t\t}\n\t}\n\n\tprivate async *walkTransactions(\n\t\tparams: TransactionsWalkParams = {},\n\t): AsyncGenerator<IndexTransaction> {\n\t\tconst batchSize = params.batchSize ?? 200;\n\t\tlet cursor = params.cursor ?? params.fromCursor ?? null;\n\t\tlet firstPage = true;\n\n\t\twhile (!params.signal?.aborted) {\n\t\t\tconst envelope = await this.listTransactions({\n\t\t\t\t...params,\n\t\t\t\tlimit: batchSize,\n\t\t\t\tcursor: firstPage ? params.cursor : cursor,\n\t\t\t\tfromCursor: firstPage ? params.fromCursor : undefined,\n\t\t\t\tfromHeight: firstPage ? firstWalkFromHeight(params) : undefined,\n\t\t\t});\n\n\t\t\tfor (const tx of envelope.transactions) {\n\t\t\t\tif (params.signal?.aborted) return;\n\t\t\t\tyield tx;\n\t\t\t}\n\n\t\t\tconst nextCursor = envelope.next_cursor;\n\t\t\tif (\n\t\t\t\t!nextCursor ||\n\t\t\t\tnextCursor === cursor ||\n\t\t\t\tenvelope.transactions.length < batchSize\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcursor = nextCursor;\n\t\t\tfirstPage = false;\n\t\t}\n\t}\n\n\tprivate async listStacking(\n\t\tparams: StackingListParams = {},\n\t): Promise<StackingEnvelope> {\n\t\treturn this.request<StackingEnvelope>(\n\t\t\t\"GET\",\n\t\t\t`/v1/index/stacking${buildQuery({\n\t\t\t\tcursor: params.cursor,\n\t\t\t\tfrom_cursor: params.fromCursor,\n\t\t\t\tlimit: params.limit,\n\t\t\t\tfunction_name: params.functionName,\n\t\t\t\tstacker: params.stacker,\n\t\t\t\tcaller: params.caller,\n\t\t\t\tfrom_height: params.fromHeight,\n\t\t\t\tto_height: params.toHeight,\n\t\t\t})}`,\n\t\t);\n\t}\n\n\tprivate async *walkStacking(\n\t\tparams: StackingWalkParams = {},\n\t): AsyncGenerator<IndexStackingAction> {\n\t\tconst batchSize = params.batchSize ?? 200;\n\t\tlet cursor = params.cursor ?? params.fromCursor ?? null;\n\t\tlet firstPage = true;\n\n\t\twhile (!params.signal?.aborted) {\n\t\t\tconst envelope = await this.listStacking({\n\t\t\t\t...params,\n\t\t\t\tlimit: batchSize,\n\t\t\t\tcursor: firstPage ? params.cursor : cursor,\n\t\t\t\tfromCursor: firstPage ? params.fromCursor : undefined,\n\t\t\t\tfromHeight: firstPage ? firstWalkFromHeight(params) : undefined,\n\t\t\t});\n\n\t\t\tfor (const action of envelope.stacking) {\n\t\t\t\tif (params.signal?.aborted) return;\n\t\t\t\tyield action;\n\t\t\t}\n\n\t\t\tconst nextCursor = envelope.next_cursor;\n\t\t\tif (\n\t\t\t\t!nextCursor ||\n\t\t\t\tnextCursor === cursor ||\n\t\t\t\tenvelope.stacking.length < batchSize\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcursor = nextCursor;\n\t\t\tfirstPage = false;\n\t\t}\n\t}\n\n\tprivate async listMempool(\n\t\tparams: MempoolListParams = {},\n\t): Promise<MempoolEnvelope> {\n\t\treturn this.request<MempoolEnvelope>(\n\t\t\t\"GET\",\n\t\t\t`/v1/index/mempool${buildQuery({\n\t\t\t\tcursor: params.cursor,\n\t\t\t\tfrom_cursor: params.fromCursor,\n\t\t\t\tlimit: params.limit,\n\t\t\t\tsender: params.sender,\n\t\t\t\ttype: params.type,\n\t\t\t\tcontract_id: params.contractId,\n\t\t\t})}`,\n\t\t);\n\t}\n\n\tprivate async getMempoolTx(\n\t\ttxId: string,\n\t): Promise<MempoolTransactionEnvelope | null> {\n\t\ttry {\n\t\t\treturn await this.request<MempoolTransactionEnvelope>(\n\t\t\t\t\"GET\",\n\t\t\t\t`/v1/index/mempool/${encodeURIComponent(txId)}`,\n\t\t\t);\n\t\t} catch (err) {\n\t\t\tif (err instanceof ApiError && err.status === 404) return null;\n\t\t\tthrow err;\n\t\t}\n\t}\n\n\tprivate async *walkMempool(\n\t\tparams: MempoolWalkParams = {},\n\t): AsyncGenerator<IndexMempoolTransaction> {\n\t\tconst batchSize = params.batchSize ?? 200;\n\t\tlet cursor = params.cursor ?? params.fromCursor ?? null;\n\t\tlet firstPage = true;\n\n\t\twhile (!params.signal?.aborted) {\n\t\t\tconst envelope = await this.listMempool({\n\t\t\t\t...params,\n\t\t\t\tlimit: batchSize,\n\t\t\t\tcursor: firstPage ? params.cursor : cursor,\n\t\t\t\tfromCursor: firstPage ? params.fromCursor : undefined,\n\t\t\t});\n\n\t\t\tfor (const tx of envelope.mempool) {\n\t\t\t\tif (params.signal?.aborted) return;\n\t\t\t\tyield tx;\n\t\t\t}\n\n\t\t\tconst nextCursor = envelope.next_cursor;\n\t\t\tif (\n\t\t\t\t!nextCursor ||\n\t\t\t\tnextCursor === cursor ||\n\t\t\t\tenvelope.mempool.length < batchSize\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcursor = nextCursor;\n\t\t\tfirstPage = false;\n\t\t}\n\t}\n}\n",
12
12
  "import { BaseClient, type SecondLayerOptions } from \"../base.ts\";\n\n/**\n * Typed client for project management (`/api/projects/*`).\n *\n * Projects are the account-scoped containers for work. Every method requires an\n * account-level (owner) API key or a dashboard session — scoped read keys are\n * rejected. Team mutations (invite/remove/role) are intentionally not exposed\n * here; only the read view ({@link Projects.team}) is.\n */\n\nexport interface Project {\n\tid: string;\n\tname: string;\n\tslug: string;\n\tnetwork: string;\n\tnodeRpc: string | null;\n\tsettings: Record<string, unknown> | null;\n\tcreatedAt: string;\n\tupdatedAt: string;\n}\n\nexport interface ProjectTeamMember {\n\tid: string;\n\trole: string;\n\temail: string;\n\tdisplayName: string | null;\n\tavatarUrl: string | null;\n\tcreatedAt: string;\n}\n\nexport interface ProjectInvitation {\n\tid: string;\n\temail: string;\n\trole: string;\n\texpiresAt: string;\n\tcreatedAt: string;\n}\n\nexport interface ProjectTeam {\n\tmembers: ProjectTeamMember[];\n\tinvitations: ProjectInvitation[];\n}\n\nexport interface CreateProjectParams {\n\tname: string;\n\tslug?: string;\n\tnetwork?: string;\n\tnodeRpc?: string;\n}\n\nexport interface UpdateProjectParams {\n\tname?: string;\n\t/** Rename the project's URL slug. */\n\tslug?: string;\n\tnetwork?: string;\n\tnodeRpc?: string;\n\tsettings?: Record<string, unknown>;\n}\n\nexport class Projects extends BaseClient {\n\tconstructor(options: Partial<SecondLayerOptions> = {}) {\n\t\tsuper(options);\n\t}\n\n\t/** All projects owned by the account, newest-relevant first. */\n\tlist(): Promise<{ projects: Project[] }> {\n\t\treturn this.request<{ projects: Project[] }>(\"GET\", \"/api/projects\");\n\t}\n\n\t/** A single project by slug. */\n\tget(slug: string): Promise<Project> {\n\t\treturn this.request<Project>(\"GET\", `/api/projects/${slug}`);\n\t}\n\n\t/** Create a project. The creator is added as the project owner. */\n\tcreate(params: CreateProjectParams): Promise<Project> {\n\t\treturn this.request<Project>(\"POST\", \"/api/projects\", params);\n\t}\n\n\t/** Update a project's name, slug (rename), network, RPC, or settings. */\n\tupdate(slug: string, patch: UpdateProjectParams): Promise<Project> {\n\t\treturn this.request<Project>(\"PATCH\", `/api/projects/${slug}`, patch);\n\t}\n\n\t/** Delete a project. The account's last remaining project cannot be deleted. */\n\tdelete(slug: string): Promise<{ ok: true }> {\n\t\treturn this.request<{ ok: true }>(\"DELETE\", `/api/projects/${slug}`);\n\t}\n\n\t/** Team members and pending invitations for a project. */\n\tteam(slug: string): Promise<ProjectTeam> {\n\t\treturn this.request<ProjectTeam>(\"GET\", `/api/projects/${slug}/team`);\n\t}\n}\n",
13
13
  "import { ed25519 } from \"@secondlayer/shared\";\nimport { buildQuery } from \"../base.ts\";\nimport {\n\ttype StreamsEventsFetcher,\n\tconsumeStreamsEvents,\n\titerateStreamsBatches,\n\tstreamStreamsEvents,\n} from \"./consumer.ts\";\nimport { createStreamsDumps } from \"./dumps.ts\";\nimport {\n\tAuthError,\n\tRateLimitError,\n\tStreamsServerError,\n\tStreamsSignatureError,\n\tValidationError,\n} from \"./errors.ts\";\nimport { subscribeStreamsEvents } from \"./subscribe.ts\";\nimport type {\n\tFetchLike,\n\tStreamsCanonicalBlock,\n\tStreamsClient,\n\tStreamsConsumeParams,\n\tStreamsEventsConsumeParams,\n\tStreamsEventsEnvelope,\n\tStreamsEventsListEnvelope,\n\tStreamsEventsListParams,\n\tStreamsEventsReplayParams,\n\tStreamsEventsStreamParams,\n\tStreamsEventsSubscribeParams,\n\tStreamsReorgsListEnvelope,\n\tStreamsReorgsListParams,\n\tStreamsTip,\n\tStreamsUsage,\n} from \"./types.ts\";\n\n/** Parse a `<block>:<index>` cursor; null sorts before genesis. */\nfunction cursorTuple(cursor: string | null): [number, number] {\n\tif (!cursor) return [-1, -1];\n\tconst parts = cursor.split(\":\");\n\tconst [block, index] = parts.map(Number);\n\tif (\n\t\tparts.length !== 2 ||\n\t\t!Number.isInteger(block) ||\n\t\t!Number.isInteger(index)\n\t) {\n\t\tthrow new ValidationError(\n\t\t\t`Invalid stream cursor \"${cursor}\"; expected \"<block>:<index>\" (e.g. \"951475:3\").`,\n\t\t\t400,\n\t\t);\n\t}\n\treturn [block, index];\n}\n\n/** The greater of two cursors (later in the stream). */\nfunction maxCursor(a: string | null, b: string | null): string | null {\n\tconst [ah, ai] = cursorTuple(a);\n\tconst [bh, bi] = cursorTuple(b);\n\treturn ah > bh || (ah === bh && ai >= bi) ? a : b;\n}\n\nconst DEFAULT_STREAMS_BASE_URL = \"https://api.secondlayer.tools\";\n\nexport type CreateStreamsClientOptions = {\n\tapiKey: string;\n\tbaseUrl?: string;\n\tfetchImpl?: FetchLike;\n\t/**\n\t * Public base URL for bulk parquet dumps (the R2/CDN bucket root). Required\n\t * to use `client.dumps`. See `GET /public/streams/dumps/manifest`.\n\t */\n\tdumpsBaseUrl?: string;\n\t/**\n\t * Verify the ed25519 `X-Signature` on every response (default off). Pass\n\t * `true` to fetch the server's public key from\n\t * `/public/streams/signing-key`, or `{ publicKey }` to pin a known PEM. A\n\t * failed or missing signature throws `StreamsSignatureError`.\n\t */\n\tverify?: boolean | { publicKey: string };\n\t/**\n\t * Verify the bulk dumps manifest's ed25519 signature in `client.dumps.list()`\n\t * before trusting any file sha256 (default ON). Uses the same key source as\n\t * `verify` (fetches `/public/streams/signing-key`, or a pinned PEM). Pass\n\t * `false` to opt out. A missing or invalid signature throws\n\t * `StreamsSignatureError`.\n\t */\n\tverifyDumpsManifest?: boolean;\n};\n\nfunction normalizeBaseUrl(baseUrl: string): string {\n\treturn baseUrl.replace(/\\/+$/, \"\");\n}\n\nasync function responseBody(response: Response): Promise<unknown> {\n\tconst text = await response.text();\n\tif (text.length === 0) return undefined;\n\ttry {\n\t\treturn JSON.parse(text);\n\t} catch {\n\t\treturn text;\n\t}\n}\n\nfunction errorMessage(body: unknown, fallback: string): string {\n\tif (body && typeof body === \"object\") {\n\t\tconst record = body as Record<string, unknown>;\n\t\tconst message = record.error ?? record.message;\n\t\tif (typeof message === \"string\" && message.length > 0) return message;\n\t}\n\tif (typeof body === \"string\" && body.length > 0) return body;\n\treturn fallback;\n}\n\nasync function mapStreamsError(response: Response): Promise<never> {\n\tconst body = await responseBody(response);\n\n\tif (response.status === 401) {\n\t\tthrow new AuthError(errorMessage(body, \"API key invalid or expired.\"));\n\t}\n\n\tif (response.status === 429) {\n\t\tconst retryAfter = response.headers.get(\"Retry-After\") ?? undefined;\n\t\tthrow new RateLimitError(\n\t\t\terrorMessage(body, \"Rate limited. Try again later.\"),\n\t\t\tretryAfter,\n\t\t);\n\t}\n\n\tif (response.status >= 500) {\n\t\tthrow new StreamsServerError(\n\t\t\terrorMessage(body, `Streams server returned ${response.status}.`),\n\t\t\tresponse.status,\n\t\t\tbody,\n\t\t);\n\t}\n\n\tthrow new ValidationError(\n\t\terrorMessage(body, `Streams request returned ${response.status}.`),\n\t\tresponse.status,\n\t\tbody,\n\t);\n}\n\nexport function createStreamsClient(\n\toptions: CreateStreamsClientOptions,\n): StreamsClient {\n\tconst baseUrl = normalizeBaseUrl(options.baseUrl ?? DEFAULT_STREAMS_BASE_URL);\n\tconst fetchImpl = options.fetchImpl ?? ((input, init) => fetch(input, init));\n\tconst verify = options.verify ?? false;\n\n\t// Lazily resolve and cache the verification key alongside its id, so a\n\t// rotation (signalled by a changed `X-Signature-KeyId`) can be detected.\n\ttype VerificationKey = {\n\t\tkeyId: string;\n\t\tpublicKeyPem: string;\n\t\tpublicKey: ReturnType<typeof ed25519.loadEd25519PublicKey>;\n\t};\n\tlet keyPromise: Promise<VerificationKey> | null = null;\n\tfunction loadKey(): Promise<VerificationKey> {\n\t\tif (keyPromise) return keyPromise;\n\t\tkeyPromise = (async () => {\n\t\t\tif (typeof verify === \"object\") {\n\t\t\t\treturn {\n\t\t\t\t\tkeyId: ed25519.ed25519KeyId(verify.publicKey),\n\t\t\t\t\tpublicKeyPem: verify.publicKey,\n\t\t\t\t\tpublicKey: ed25519.loadEd25519PublicKey(verify.publicKey),\n\t\t\t\t};\n\t\t\t}\n\t\t\tconst res = await fetchImpl(`${baseUrl}/public/streams/signing-key`);\n\t\t\tif (!res.ok) {\n\t\t\t\tthrow new StreamsSignatureError(\n\t\t\t\t\t`Could not fetch signing key (${res.status}).`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst body = (await res.json()) as {\n\t\t\t\tpublic_key_pem?: string;\n\t\t\t\tkey_id?: string;\n\t\t\t};\n\t\t\tif (!body.public_key_pem) {\n\t\t\t\tthrow new StreamsSignatureError(\"Signing key response missing key.\");\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tkeyId: body.key_id ?? ed25519.ed25519KeyId(body.public_key_pem),\n\t\t\t\tpublicKeyPem: body.public_key_pem,\n\t\t\t\tpublicKey: ed25519.loadEd25519PublicKey(body.public_key_pem),\n\t\t\t};\n\t\t})();\n\t\treturn keyPromise;\n\t}\n\n\tconst dumps = createStreamsDumps({\n\t\tbaseUrl: options.dumpsBaseUrl,\n\t\tfetchImpl,\n\t\tverifyManifest: options.verifyDumpsManifest ?? true,\n\t\tloadPublicKeyPem: async () => (await loadKey()).publicKeyPem,\n\t});\n\n\tasync function request<T>(path: string): Promise<T> {\n\t\tconst response = await fetchImpl(`${baseUrl}${path}`, {\n\t\t\theaders: { Authorization: `Bearer ${options.apiKey}` },\n\t\t});\n\t\tif (!response.ok) await mapStreamsError(response);\n\t\tconst text = await response.text();\n\t\tif (verify) {\n\t\t\tconst signature = response.headers.get(\"X-Signature\");\n\t\t\tif (!signature) {\n\t\t\t\tthrow new StreamsSignatureError(\"Response is missing X-Signature.\");\n\t\t\t}\n\t\t\tconst responseKeyId = response.headers.get(\"X-Signature-KeyId\");\n\t\t\tlet key = await loadKey();\n\t\t\t// The server rotated to a key we haven't seen.\n\t\t\tif (responseKeyId && responseKeyId !== key.keyId) {\n\t\t\t\tif (typeof verify === \"object\") {\n\t\t\t\t\t// Pinned key: a different id is never the pinned key — fail closed.\n\t\t\t\t\tthrow new StreamsSignatureError(\n\t\t\t\t\t\t`Response signed with key '${responseKeyId}', expected pinned key '${key.keyId}'.`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t// Fetched key: refresh once. A still-mismatched id (no re-loop)\n\t\t\t\t// means the endpoint doesn't serve the signing key — fail closed.\n\t\t\t\tkeyPromise = null;\n\t\t\t\tkey = await loadKey();\n\t\t\t\tif (responseKeyId !== key.keyId) {\n\t\t\t\t\tthrow new StreamsSignatureError(\n\t\t\t\t\t\t`Response signed with key '${responseKeyId}' not served by the signing-key endpoint.`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!ed25519.verifyEd25519(text, signature, key.publicKey)) {\n\t\t\t\tthrow new StreamsSignatureError();\n\t\t\t}\n\t\t}\n\t\treturn JSON.parse(text) as T;\n\t}\n\n\tconst fetchEvents: StreamsEventsFetcher = async ({\n\t\tcursor,\n\t\tlimit,\n\t\ttypes,\n\t\tnotTypes,\n\t\tcontractId,\n\t\tsender,\n\t\trecipient,\n\t\tassetIdentifier,\n\t}) => {\n\t\treturn listEvents({\n\t\t\tcursor,\n\t\t\tlimit,\n\t\t\ttypes,\n\t\t\tnotTypes,\n\t\t\tcontractId,\n\t\t\tsender,\n\t\t\trecipient,\n\t\t\tassetIdentifier,\n\t\t});\n\t};\n\n\tasync function listEvents(\n\t\tparams: StreamsEventsListParams = {},\n\t): Promise<StreamsEventsEnvelope> {\n\t\treturn request<StreamsEventsEnvelope>(\n\t\t\t`/v1/streams/events${buildQuery({\n\t\t\t\tcursor: params.cursor,\n\t\t\t\tfrom_height: params.fromHeight,\n\t\t\t\tto_height: params.toHeight,\n\t\t\t\tlimit: params.limit,\n\t\t\t\tcontract_id: params.contractId,\n\t\t\t\tsender: params.sender,\n\t\t\t\trecipient: params.recipient,\n\t\t\t\tasset_identifier: params.assetIdentifier,\n\t\t\t\ttypes: params.types,\n\t\t\t\tnot_types: params.notTypes,\n\t\t\t})}`,\n\t\t);\n\t}\n\n\treturn {\n\t\tconsume(params: StreamsConsumeParams = {}) {\n\t\t\treturn iterateStreamsBatches({\n\t\t\t\tfromCursor: params.cursor,\n\t\t\t\tbatchSize: params.batchSize ?? 100,\n\t\t\t\tintervalMs: params.intervalMs ?? 2000,\n\t\t\t\ttypes: params.types,\n\t\t\t\tnotTypes: params.notTypes,\n\t\t\t\tcontractId: params.contractId,\n\t\t\t\tsender: params.sender,\n\t\t\t\trecipient: params.recipient,\n\t\t\t\tassetIdentifier: params.assetIdentifier,\n\t\t\t\tsignal: params.signal,\n\t\t\t\tfetchEvents,\n\t\t\t});\n\t\t},\n\t\tevents: {\n\t\t\tlist: listEvents,\n\t\t\tbyTxId(txId: string) {\n\t\t\t\treturn request<StreamsEventsListEnvelope>(\n\t\t\t\t\t`/v1/streams/events/${encodeURIComponent(txId)}`,\n\t\t\t\t);\n\t\t\t},\n\t\t\tconsume(params: StreamsEventsConsumeParams) {\n\t\t\t\treturn consumeStreamsEvents({\n\t\t\t\t\tfromCursor: params.fromCursor,\n\t\t\t\t\tmode: params.mode,\n\t\t\t\t\tfinalizedOnly: params.finalizedOnly,\n\t\t\t\t\ttypes: params.types,\n\t\t\t\t\tnotTypes: params.notTypes,\n\t\t\t\t\tcontractId: params.contractId,\n\t\t\t\t\tsender: params.sender,\n\t\t\t\t\trecipient: params.recipient,\n\t\t\t\t\tassetIdentifier: params.assetIdentifier,\n\t\t\t\t\tbatchSize: params.batchSize ?? 100,\n\t\t\t\t\tfetchEvents,\n\t\t\t\t\tonBatch: params.onBatch,\n\t\t\t\t\tonReorg: params.onReorg,\n\t\t\t\t\temptyBackoffMs: params.emptyBackoffMs,\n\t\t\t\t\tmaxPages: params.maxPages,\n\t\t\t\t\tmaxEmptyPolls: params.maxEmptyPolls,\n\t\t\t\t\tsignal: params.signal,\n\t\t\t\t});\n\t\t\t},\n\t\t\tstream(params: StreamsEventsStreamParams = {}) {\n\t\t\t\treturn streamStreamsEvents({\n\t\t\t\t\tfromCursor: params.fromCursor,\n\t\t\t\t\ttypes: params.types,\n\t\t\t\t\tnotTypes: params.notTypes,\n\t\t\t\t\tcontractId: params.contractId,\n\t\t\t\t\tsender: params.sender,\n\t\t\t\t\trecipient: params.recipient,\n\t\t\t\t\tassetIdentifier: params.assetIdentifier,\n\t\t\t\t\tbatchSize: params.batchSize ?? 100,\n\t\t\t\t\temptyBackoffMs: params.emptyBackoffMs,\n\t\t\t\t\tmaxPages: params.maxPages,\n\t\t\t\t\tmaxEmptyPolls: params.maxEmptyPolls,\n\t\t\t\t\tsignal: params.signal,\n\t\t\t\t\tfetchEvents,\n\t\t\t\t});\n\t\t\t},\n\t\t\tsubscribe(params: StreamsEventsSubscribeParams) {\n\t\t\t\treturn subscribeStreamsEvents({\n\t\t\t\t\tbaseUrl,\n\t\t\t\t\tapiKey: options.apiKey,\n\t\t\t\t\tfetchImpl,\n\t\t\t\t\tverify: Boolean(verify),\n\t\t\t\t\tloadKey,\n\t\t\t\t\tparams,\n\t\t\t\t});\n\t\t\t},\n\t\t\tasync replay(params: StreamsEventsReplayParams) {\n\t\t\t\tconst fromCursor =\n\t\t\t\t\tparams.from === \"genesis\" ? null : (params.from ?? null);\n\t\t\t\tconst fromBlock = fromCursor ? cursorTuple(fromCursor)[0] : 0;\n\t\t\t\tconst manifest = await dumps.list();\n\n\t\t\t\t// Hydrate finalized history from dumps, in block order.\n\t\t\t\tconst files = manifest.files\n\t\t\t\t\t.filter((file) => file.to_block >= fromBlock)\n\t\t\t\t\t.sort(\n\t\t\t\t\t\t(a, b) => a.from_block - b.from_block || a.to_block - b.to_block,\n\t\t\t\t\t);\n\t\t\t\tfor (const file of files) {\n\t\t\t\t\tif (params.signal?.aborted) break;\n\t\t\t\t\tawait params.onDumpFile(file);\n\t\t\t\t}\n\n\t\t\t\t// Seam: tail live from just past the dumped coverage. Cursor input is\n\t\t\t\t// exclusive, so the first live event is strictly after the last dump.\n\t\t\t\tconst seam = maxCursor(fromCursor, manifest.latest_finalized_cursor);\n\t\t\t\treturn consumeStreamsEvents({\n\t\t\t\t\tfromCursor: seam,\n\t\t\t\t\tmode: params.mode ?? \"tail\",\n\t\t\t\t\tbatchSize: params.batchSize ?? 100,\n\t\t\t\t\tfetchEvents,\n\t\t\t\t\tonBatch: params.onBatch,\n\t\t\t\t\temptyBackoffMs: params.emptyBackoffMs,\n\t\t\t\t\tmaxPages: params.maxPages,\n\t\t\t\t\tmaxEmptyPolls: params.maxEmptyPolls,\n\t\t\t\t\tsignal: params.signal,\n\t\t\t\t});\n\t\t\t},\n\t\t},\n\t\tblocks: {\n\t\t\tevents(heightOrHash: number | string) {\n\t\t\t\treturn request<StreamsEventsListEnvelope>(\n\t\t\t\t\t`/v1/streams/blocks/${encodeURIComponent(String(heightOrHash))}/events`,\n\t\t\t\t);\n\t\t\t},\n\t\t},\n\t\treorgs: {\n\t\t\tlist(params: StreamsReorgsListParams) {\n\t\t\t\treturn request<StreamsReorgsListEnvelope>(\n\t\t\t\t\t`/v1/streams/reorgs${buildQuery({\n\t\t\t\t\t\tsince: params.since,\n\t\t\t\t\t\tlimit: params.limit,\n\t\t\t\t\t})}`,\n\t\t\t\t);\n\t\t\t},\n\t\t},\n\t\tdumps,\n\t\tcanonical(height: number) {\n\t\t\treturn request<StreamsCanonicalBlock>(`/v1/streams/canonical/${height}`);\n\t\t},\n\t\ttip() {\n\t\t\treturn request<StreamsTip>(\"/v1/streams/tip\");\n\t\t},\n\t\tusage() {\n\t\t\treturn request<StreamsUsage>(\"/v1/streams/usage\");\n\t\t},\n\t};\n}\n",
14
14
  "export class AuthError extends Error {\n\treadonly status = 401;\n\n\tconstructor(message = \"API key invalid or expired.\") {\n\t\tsuper(message);\n\t\tthis.name = \"AuthError\";\n\t}\n}\n\nexport class RateLimitError extends Error {\n\treadonly status = 429;\n\n\tconstructor(\n\t\tmessage = \"Rate limited. Try again later.\",\n\t\treadonly retryAfter?: string,\n\t) {\n\t\tsuper(message);\n\t\tthis.name = \"RateLimitError\";\n\t}\n}\n\nexport class ValidationError extends Error {\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly status: number,\n\t\treadonly body?: unknown,\n\t) {\n\t\tsuper(message);\n\t\tthis.name = \"ValidationError\";\n\t}\n}\n\nexport class StreamsServerError extends Error {\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly status: number,\n\t\treadonly body?: unknown,\n\t) {\n\t\tsuper(message);\n\t\tthis.name = \"StreamsServerError\";\n\t}\n}\n\n/** Thrown when response signature verification is enabled and fails. */\nexport class StreamsSignatureError extends Error {\n\tconstructor(message = \"Streams response signature verification failed.\") {\n\t\tsuper(message);\n\t\tthis.name = \"StreamsSignatureError\";\n\t}\n}\n",
@@ -20,7 +20,7 @@
20
20
  "import type { SubgraphSummary } from \"@secondlayer/shared/schemas\";\nimport { ApiKeys } from \"./api-keys/client.ts\";\nimport { BaseClient } from \"./base.ts\";\nimport type { SecondLayerOptions } from \"./base.ts\";\nimport { Contracts } from \"./contracts/client.ts\";\nimport { Index } from \"./index-api/client.ts\";\nimport type { IndexTip } from \"./index-api/client.ts\";\nimport { Projects } from \"./projects/client.ts\";\nimport { createStreamsClient } from \"./streams/client.ts\";\nimport type { StreamsClient, StreamsTip } from \"./streams/types.ts\";\nimport { Subgraphs } from \"./subgraphs/client.ts\";\nimport type { SubgraphOperationStatus } from \"./subgraphs/client.ts\";\nimport { Subscriptions } from \"./subscriptions/client.ts\";\n\nexport interface ContextAccount {\n\temail: string;\n\tplan: string;\n}\n\n/** Compact project view for {@link ContextSnapshot}. */\nexport interface ContextProject {\n\tname: string;\n\tslug: string;\n\tnetwork: string;\n}\n\n/** Compact API-key view for {@link ContextSnapshot} — never the plaintext. */\nexport interface ContextApiKey {\n\tprefix: string;\n\tname: string | null;\n\tstatus: string;\n\tproduct: string;\n}\n\nexport interface ActiveSubgraphOperation {\n\tsubgraph: string;\n\toperationId: string;\n\tkind: SubgraphOperationStatus[\"kind\"];\n\tstatus: SubgraphOperationStatus[\"status\"];\n\tprogress: number | null;\n}\n\n/**\n * A point-in-time orientation snapshot for an agent: who you are, the live tips,\n * and what you own. Each field is `null` when it couldn't be read (e.g. no key,\n * or a free-tier key for a Build+ surface) so the snapshot never throws.\n */\nexport interface ContextSnapshot {\n\taccount: ContextAccount | null;\n\tstreamsTip: StreamsTip | null;\n\tindexTip: IndexTip | null;\n\tsubgraphs: SubgraphSummary[] | null;\n\tsubscriptions: { count: number; byStatus: Record<string, number> } | null;\n\t/** The account's projects (null when unreadable — e.g. a scoped key). */\n\tprojects: ContextProject[] | null;\n\t/** The account's API keys, metadata only (null when unreadable). */\n\tapiKeys: ContextApiKey[] | null;\n\t/** In-flight reindex operations (bounded to subgraphs reporting `reindexing`). */\n\tactiveOperations: ActiveSubgraphOperation[] | null;\n}\n\nexport class SecondLayer extends BaseClient {\n\treadonly streams: StreamsClient;\n\treadonly index: Index;\n\treadonly contracts: Contracts;\n\treadonly subgraphs: Subgraphs;\n\treadonly subscriptions: Subscriptions;\n\treadonly apiKeys: ApiKeys;\n\treadonly projects: Projects;\n\n\tconstructor(options: Partial<SecondLayerOptions> = {}) {\n\t\tsuper(options);\n\t\tthis.streams = createStreamsClient({\n\t\t\tapiKey: options.apiKey ?? \"\",\n\t\t\tbaseUrl: options.baseUrl,\n\t\t\tfetchImpl: options.fetchImpl,\n\t\t\tdumpsBaseUrl: options.dumpsBaseUrl,\n\t\t});\n\t\tthis.index = new Index(options);\n\t\tthis.contracts = new Contracts(options);\n\t\tthis.subgraphs = new Subgraphs(options);\n\t\tthis.subscriptions = new Subscriptions(options);\n\t\tthis.apiKeys = new ApiKeys(options);\n\t\tthis.projects = new Projects(options);\n\t}\n\n\t/**\n\t * Assemble a {@link ContextSnapshot} — the same orientation an MCP agent reads\n\t * from `secondlayer://context`, but available to any SDK/CLI consumer. Reads\n\t * run concurrently and degrade to `null` per field on failure.\n\t */\n\t/**\n\t * Up to 10 public reads in one round trip (`POST /v1/batch`). Each item\n\t * keeps its own auth/quota/x402 semantics; forwarded credentials (API key,\n\t * PAYMENT-BALANCE/SESSION) apply to every item.\n\t */\n\tasync batch(\n\t\trequests: Array<{\n\t\t\tpath: string;\n\t\t\tparams?: Record<string, string | number | boolean>;\n\t\t}>,\n\t): Promise<{\n\t\tresults: Array<{ path: string | null; status: number; body: unknown }>;\n\t}> {\n\t\treturn this.request(\"POST\", \"/v1/batch\", { requests });\n\t}\n\n\tasync context(): Promise<ContextSnapshot> {\n\t\tconst safe = <T>(p: Promise<T>): Promise<T | null> =>\n\t\t\tp.then((v) => v).catch(() => null);\n\n\t\tconst [\n\t\t\taccount,\n\t\t\tstreamsTip,\n\t\t\tindexEnv,\n\t\t\tsubgraphsRes,\n\t\t\tsubscriptionsRes,\n\t\t\tprojectsRes,\n\t\t\tapiKeysRes,\n\t\t] = await Promise.all([\n\t\t\tsafe(this.request<ContextAccount>(\"GET\", \"/api/accounts/me\")),\n\t\t\tsafe(this.streams.tip()),\n\t\t\tsafe(this.index.canonical.list({ limit: 1 })),\n\t\t\tsafe(this.subgraphs.list()),\n\t\t\tsafe(this.subscriptions.list()),\n\t\t\tsafe(this.projects.list()),\n\t\t\tsafe(this.apiKeys.list()),\n\t\t]);\n\n\t\tconst subgraphs = subgraphsRes?.data ?? null;\n\n\t\tlet subscriptions: ContextSnapshot[\"subscriptions\"] = null;\n\t\tif (subscriptionsRes) {\n\t\t\tconst byStatus: Record<string, number> = {};\n\t\t\tfor (const s of subscriptionsRes.data) {\n\t\t\t\tbyStatus[s.status] = (byStatus[s.status] ?? 0) + 1;\n\t\t\t}\n\t\t\tsubscriptions = { count: subscriptionsRes.data.length, byStatus };\n\t\t}\n\n\t\t// In-flight ops: only probe subgraphs that report `reindexing`, so this\n\t\t// stays cheap (usually zero extra calls) instead of N+1 over every subgraph.\n\t\tlet activeOperations: ActiveSubgraphOperation[] | null = null;\n\t\tif (subgraphs) {\n\t\t\tconst probed = await Promise.all(\n\t\t\t\tsubgraphs\n\t\t\t\t\t.filter((s) => s.status === \"reindexing\")\n\t\t\t\t\t.map(async (s) => {\n\t\t\t\t\t\tconst res = await safe(this.subgraphs.operations(s.name));\n\t\t\t\t\t\tconst op = res?.operations.find(\n\t\t\t\t\t\t\t(o) => o.status === \"queued\" || o.status === \"running\",\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn op\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\tsubgraph: s.name,\n\t\t\t\t\t\t\t\t\toperationId: op.id,\n\t\t\t\t\t\t\t\t\tkind: op.kind,\n\t\t\t\t\t\t\t\t\tstatus: op.status,\n\t\t\t\t\t\t\t\t\tprogress: op.progress,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t: null;\n\t\t\t\t\t}),\n\t\t\t);\n\t\t\tactiveOperations = probed.filter(\n\t\t\t\t(o): o is ActiveSubgraphOperation => o !== null,\n\t\t\t);\n\t\t}\n\n\t\tconst projects: ContextProject[] | null = projectsRes\n\t\t\t? projectsRes.projects.map((p) => ({\n\t\t\t\t\tname: p.name,\n\t\t\t\t\tslug: p.slug,\n\t\t\t\t\tnetwork: p.network,\n\t\t\t\t}))\n\t\t\t: null;\n\n\t\tconst apiKeys: ContextApiKey[] | null = apiKeysRes\n\t\t\t? apiKeysRes.keys.map((k) => ({\n\t\t\t\t\tprefix: k.prefix,\n\t\t\t\t\tname: k.name,\n\t\t\t\t\tstatus: k.status,\n\t\t\t\t\tproduct: k.product,\n\t\t\t\t}))\n\t\t\t: null;\n\n\t\treturn {\n\t\t\taccount,\n\t\t\tstreamsTip,\n\t\t\tindexTip: indexEnv?.tip ?? null,\n\t\t\tsubgraphs,\n\t\t\tsubscriptions,\n\t\t\tprojects,\n\t\t\tapiKeys,\n\t\t\tactiveOperations,\n\t\t};\n\t}\n}\n",
21
21
  "import type { InferSubgraphClient } from \"@secondlayer/subgraphs\";\nimport type { SecondLayerOptions } from \"../base.ts\";\nimport { SecondLayer } from \"../client.ts\";\nimport { Subgraphs } from \"./client.ts\";\n\n/**\n * Returns a typed client for a subgraph defined with `defineSubgraph()`.\n *\n * Accepts a plain options object, a `SecondLayer` instance, or a `Subgraphs` instance.\n *\n * @example\n * ```ts\n * import mySubgraph from './subgraphs/my-subgraph'\n * import { getSubgraph } from '@secondlayer/sdk'\n *\n * const client = getSubgraph(mySubgraph, { apiKey: 'sl_...' })\n * const rows = await client.transfers.findMany({ where: { sender: 'SP...' } })\n * ```\n */\nexport function getSubgraph<\n\tT extends { name: string; schema: Record<string, unknown> },\n>(\n\tdef: T,\n\toptions: Partial<SecondLayerOptions> | SecondLayer | Subgraphs = {},\n): InferSubgraphClient<T> {\n\tif (options instanceof Subgraphs) {\n\t\treturn options.typed(def);\n\t}\n\tif (options instanceof SecondLayer) {\n\t\treturn options.subgraphs.typed(def);\n\t}\n\treturn new Subgraphs(options).typed(def);\n}\n"
22
22
  ],
23
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"debugId": "D03F305F30B012C964756E2164756E21",
25
25
  "names": []
26
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@secondlayer/sdk",
3
- "version": "6.21.2",
3
+ "version": "6.22.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -40,9 +40,9 @@
40
40
  "prepublishOnly": "bun run build"
41
41
  },
42
42
  "dependencies": {
43
- "@secondlayer/shared": "^6.31.0",
43
+ "@secondlayer/shared": "^6.32.0",
44
44
  "@secondlayer/stacks": "^2.5.1",
45
- "@secondlayer/subgraphs": "^3.12.0"
45
+ "@secondlayer/subgraphs": "^3.14.0"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/bun": "latest",