@secondlayer/subgraphs 3.0.0 → 3.2.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.
@@ -1,3 +1,4 @@
1
+ import { AbiContract } from "@secondlayer/stacks/clarity";
1
2
  /** Supported column types for subgraph schemas */
2
3
  type ColumnType = "text" | "uint" | "int" | "principal" | "boolean" | "timestamp" | "jsonb";
3
4
  /** Column definition in a subgraph table */
@@ -125,8 +126,13 @@ interface ContractCallFilter {
125
126
  contractId?: string;
126
127
  functionName?: string;
127
128
  caller?: string;
128
- /** ABI for typed event.args. If omitted, auto-fetched at deploy time. */
129
- abi?: Record<string, unknown>;
129
+ /**
130
+ * Contract ABI (pass it `as const`) used to type `event.input` — the named,
131
+ * decoded function arguments. Dev-provided; serialized into the deployed
132
+ * definition and used at runtime to decode args by name. Omit to keep
133
+ * `event.args` as a positional `unknown[]`.
134
+ */
135
+ abi?: AbiContract;
130
136
  }
131
137
  interface ContractDeployFilter {
132
138
  type: "contract_deploy";
@@ -137,6 +143,14 @@ interface PrintEventFilter {
137
143
  type: "print_event";
138
144
  contractId?: string;
139
145
  topic?: string;
146
+ /**
147
+ * Optional per-topic field schema. When declared, the handler's `event` is
148
+ * a discriminated union keyed by `topic` and `event.data` is typed per topic
149
+ * (e.g. `{ "completed-deposit": { amount: "uint", sender: "principal" } }`).
150
+ * Uses the same `ColumnType` vocab as `schema`; nested fields use `"jsonb"`.
151
+ * Type-level only — not validated at runtime.
152
+ */
153
+ prints?: Record<string, Record<string, ColumnType>>;
140
154
  }
141
155
  /** All subgraph filter types — discriminated on `type` */
142
156
  type SubgraphFilter = StxTransferFilter | StxMintFilter | StxBurnFilter | StxLockFilter | FtTransferFilter | FtMintFilter | FtBurnFilter | NftTransferFilter | NftMintFilter | NftBurnFilter | ContractCallFilter | ContractDeployFilter | PrintEventFilter;
@@ -1,3 +1,4 @@
1
+ import { AbiContract } from "@secondlayer/stacks/clarity";
1
2
  /** Supported column types for subgraph schemas */
2
3
  type ColumnType = "text" | "uint" | "int" | "principal" | "boolean" | "timestamp" | "jsonb";
3
4
  /** Column definition in a subgraph table */
@@ -84,8 +85,13 @@ interface ContractCallFilter {
84
85
  contractId?: string;
85
86
  functionName?: string;
86
87
  caller?: string;
87
- /** ABI for typed event.args. If omitted, auto-fetched at deploy time. */
88
- abi?: Record<string, unknown>;
88
+ /**
89
+ * Contract ABI (pass it `as const`) used to type `event.input` — the named,
90
+ * decoded function arguments. Dev-provided; serialized into the deployed
91
+ * definition and used at runtime to decode args by name. Omit to keep
92
+ * `event.args` as a positional `unknown[]`.
93
+ */
94
+ abi?: AbiContract;
89
95
  }
90
96
  interface ContractDeployFilter {
91
97
  type: "contract_deploy";
@@ -96,6 +102,14 @@ interface PrintEventFilter {
96
102
  type: "print_event";
97
103
  contractId?: string;
98
104
  topic?: string;
105
+ /**
106
+ * Optional per-topic field schema. When declared, the handler's `event` is
107
+ * a discriminated union keyed by `topic` and `event.data` is typed per topic
108
+ * (e.g. `{ "completed-deposit": { amount: "uint", sender: "principal" } }`).
109
+ * Uses the same `ColumnType` vocab as `schema`; nested fields use `"jsonb"`.
110
+ * Type-level only — not validated at runtime.
111
+ */
112
+ prints?: Record<string, Record<string, ColumnType>>;
99
113
  }
100
114
  /** All subgraph filter types — discriminated on `type` */
101
115
  type SubgraphFilter = StxTransferFilter | StxMintFilter | StxBurnFilter | StxLockFilter | FtTransferFilter | FtMintFilter | FtBurnFilter | NftTransferFilter | NftMintFilter | NftBurnFilter | ContractCallFilter | ContractDeployFilter | PrintEventFilter;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@secondlayer/subgraphs",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "type": "module",
5
5
  "main": "./dist/src/index.js",
6
6
  "types": "./dist/src/index.d.ts",