@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.
- package/dist/src/index.d.ts +151 -111
- package/dist/src/index.js +45 -3
- package/dist/src/index.js.map +3 -3
- package/dist/src/runtime/block-processor.d.ts +16 -2
- package/dist/src/runtime/block-processor.js +45 -3
- package/dist/src/runtime/block-processor.js.map +3 -3
- package/dist/src/runtime/catchup.d.ts +16 -2
- package/dist/src/runtime/catchup.js +45 -3
- package/dist/src/runtime/catchup.js.map +3 -3
- package/dist/src/runtime/processor.js +45 -3
- package/dist/src/runtime/processor.js.map +3 -3
- package/dist/src/runtime/reindex.d.ts +16 -2
- package/dist/src/runtime/reindex.js +45 -3
- package/dist/src/runtime/reindex.js.map +3 -3
- package/dist/src/runtime/reorg.d.ts +16 -2
- package/dist/src/runtime/reorg.js +45 -3
- package/dist/src/runtime/reorg.js.map +3 -3
- package/dist/src/runtime/runner.d.ts +25 -3
- package/dist/src/runtime/runner.js +47 -4
- package/dist/src/runtime/runner.js.map +3 -3
- package/dist/src/runtime/source-matcher.d.ts +18 -2
- package/dist/src/schema/index.d.ts +16 -2
- package/dist/src/service.js +45 -3
- package/dist/src/service.js.map +3 -3
- package/dist/src/triggers/index.d.ts +18 -2
- package/dist/src/types.d.ts +16 -2
- package/dist/src/validate.d.ts +16 -2
- package/package.json +1 -1
package/dist/src/types.d.ts
CHANGED
|
@@ -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
|
-
/**
|
|
129
|
-
|
|
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;
|
package/dist/src/validate.d.ts
CHANGED
|
@@ -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
|
-
/**
|
|
88
|
-
|
|
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;
|