@secondlayer/subgraphs 4.1.3 → 4.1.5
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 +18 -4
- package/dist/src/index.js +3070 -3066
- package/dist/src/index.js.map +8 -8
- package/dist/src/runtime/block-processor.js +706 -372
- package/dist/src/runtime/block-processor.js.map +8 -7
- package/dist/src/runtime/catchup.js +706 -372
- package/dist/src/runtime/catchup.js.map +8 -7
- package/dist/src/runtime/context.d.ts +13 -1
- package/dist/src/runtime/context.js.map +2 -2
- package/dist/src/runtime/processor.js +706 -372
- package/dist/src/runtime/processor.js.map +8 -7
- package/dist/src/runtime/reindex.js +706 -372
- package/dist/src/runtime/reindex.js.map +8 -7
- package/dist/src/runtime/reorg.js +706 -372
- package/dist/src/runtime/reorg.js.map +8 -7
- package/dist/src/runtime/replay.js +12 -6
- package/dist/src/runtime/replay.js.map +4 -4
- package/dist/src/runtime/runner.d.ts +13 -1
- package/dist/src/runtime/runner.js +604 -8
- package/dist/src/runtime/runner.js.map +6 -4
- package/dist/src/runtime/source-matcher.d.ts +8 -1
- package/dist/src/runtime/source-matcher.js +12 -5
- package/dist/src/runtime/source-matcher.js.map +3 -3
- package/dist/src/service.js +706 -372
- package/dist/src/service.js.map +8 -7
- package/dist/src/testing/index.js +604 -8
- package/dist/src/testing/index.js.map +7 -5
- package/package.json +2 -2
package/dist/src/index.d.ts
CHANGED
|
@@ -53,12 +53,24 @@ interface ChainReadClient {
|
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
55
|
/**
|
|
56
|
+
* True for a structural empty mapped type (`{}`) and for codegen's
|
|
57
|
+
* `Record<string, never>`. `keyof Record<string, never>` is `string`, so the
|
|
58
|
+
* first check alone is not enough. Local copy of the `getContract` helper —
|
|
59
|
+
* importing `ContractInstance<C>["read"]` would re-enter the codegen-brand
|
|
60
|
+
* conditional this type exists to avoid.
|
|
61
|
+
*/
|
|
62
|
+
type IsEmptyArgs<A> = [keyof A & string] extends [never] ? true : Record<string, never> extends A ? true : false;
|
|
63
|
+
type ChainReadMethod<
|
|
64
|
+
A,
|
|
65
|
+
R
|
|
66
|
+
> = IsEmptyArgs<A> extends true ? (args?: A) => R : (args: A) => R;
|
|
67
|
+
/**
|
|
56
68
|
* The camelCased read methods of an ABI. Spelled out rather than reused from
|
|
57
69
|
* `ContractInstance<C>["read"]`: that type is a conditional over the codegen
|
|
58
70
|
* brand, and evaluating it wherever a subgraph definition is structurally
|
|
59
71
|
* compared pushes TS past its instantiation depth.
|
|
60
72
|
*/
|
|
61
|
-
type ChainReadMethods<C extends AbiContract> = { [N in ExtractReadOnlyFunctions<C> as ToCamelCase<N>] :
|
|
73
|
+
type ChainReadMethods<C extends AbiContract> = { [N in ExtractReadOnlyFunctions<C> as ToCamelCase<N>] : ChainReadMethod<ExtractFunctionArgs<C, N>, Promise<UnwrapResponse<ExtractFunctionOutput<C, N>>>> };
|
|
62
74
|
/**
|
|
63
75
|
* `ChainReadClient` with the ABI generic erased. Structurally cheap, so the
|
|
64
76
|
* base `SubgraphContext` can carry it; `TypedSubgraphContext` uses the real
|
|
@@ -76,7 +88,7 @@ interface ErasedChainReadClient {
|
|
|
76
88
|
* const token = readContractAt(ctx, contractId, SIP010_ABI, {
|
|
77
89
|
* cache: "contract-constant",
|
|
78
90
|
* });
|
|
79
|
-
* const decimals = await token.read.getDecimals(
|
|
91
|
+
* const decimals = await token.read.getDecimals(); // bigint
|
|
80
92
|
* ```
|
|
81
93
|
*/
|
|
82
94
|
declare function readContractAt<const C extends AbiContract>(ctx: {
|
|
@@ -1034,8 +1046,10 @@ interface InferredTopicSchema {
|
|
|
1034
1046
|
fields: InferredPrintField[];
|
|
1035
1047
|
}
|
|
1036
1048
|
/**
|
|
1037
|
-
* Kebab-case → camelCase
|
|
1038
|
-
*
|
|
1049
|
+
* Kebab-case → camelCase for print tuple keys. Canonical: the runner uses
|
|
1050
|
+
* this on `event.data`, and `camel_name` in inferred print schema is the
|
|
1051
|
+
* same function. Distinct from ABI `toCamelCase` (`transfer-STX` stays
|
|
1052
|
+
* `transfer-STX` here, becomes `transferSTX` there).
|
|
1039
1053
|
*/
|
|
1040
1054
|
declare function camelizeDataKey(str: string): string;
|
|
1041
1055
|
/**
|