@sentio/sdk 2.19.0 → 2.20.0-rc.1
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/lib/aptos/aptos-processor.js +4 -4
- package/lib/aptos/aptos-processor.js.map +1 -1
- package/lib/core/base-context.d.ts +5 -5
- package/lib/core/base-context.js +21 -2
- package/lib/core/base-context.js.map +1 -1
- package/lib/core/event-logger.js +1 -1
- package/lib/core/event-logger.js.map +1 -1
- package/lib/core/event-tracker.js +1 -1
- package/lib/core/event-tracker.js.map +1 -1
- package/lib/core/exporter.js +1 -1
- package/lib/core/exporter.js.map +1 -1
- package/lib/core/meter.js +17 -9
- package/lib/core/meter.js.map +1 -1
- package/lib/eth/account-processor.js +1 -1
- package/lib/eth/account-processor.js.map +1 -1
- package/lib/eth/base-processor-template.js +5 -1
- package/lib/eth/base-processor-template.js.map +1 -1
- package/lib/eth/base-processor.js +5 -5
- package/lib/eth/base-processor.js.map +1 -1
- package/lib/move/abstract-move-coder.js +2 -0
- package/lib/move/abstract-move-coder.js.map +1 -1
- package/lib/solana/solana-processor.js +1 -1
- package/lib/solana/solana-processor.js.map +1 -1
- package/lib/sui/sui-object-processor-template.js +5 -1
- package/lib/sui/sui-object-processor-template.js.map +1 -1
- package/lib/sui/sui-object-processor.js +1 -1
- package/lib/sui/sui-object-processor.js.map +1 -1
- package/lib/sui/sui-processor.js +3 -3
- package/lib/sui/sui-processor.js.map +1 -1
- package/package.json +3 -3
- package/src/aptos/aptos-processor.ts +4 -4
- package/src/core/base-context.ts +22 -4
- package/src/core/event-logger.ts +1 -1
- package/src/core/event-tracker.ts +1 -1
- package/src/core/exporter.ts +1 -1
- package/src/core/meter.ts +17 -9
- package/src/eth/account-processor.ts +1 -1
- package/src/eth/base-processor-template.ts +5 -1
- package/src/eth/base-processor.ts +5 -5
- package/src/move/abstract-move-coder.ts +2 -0
- package/src/solana/solana-processor.ts +1 -1
- package/src/sui/sui-object-processor-template.ts +5 -1
- package/src/sui/sui-object-processor.ts +1 -1
- package/src/sui/sui-processor.ts +3 -3
package/src/core/exporter.ts
CHANGED
package/src/core/meter.ts
CHANGED
@@ -89,11 +89,15 @@ export class Counter extends Metric {
|
|
89
89
|
}
|
90
90
|
|
91
91
|
private record(ctx: BaseContext, value: Numberish, labels: Labels, add: boolean) {
|
92
|
-
ctx.
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
92
|
+
ctx.update({
|
93
|
+
counters: [
|
94
|
+
{
|
95
|
+
metadata: ctx.getMetaData(this.name, labels),
|
96
|
+
metricValue: toMetricValue(value),
|
97
|
+
add: add,
|
98
|
+
runtimeInfo: undefined,
|
99
|
+
},
|
100
|
+
],
|
97
101
|
})
|
98
102
|
}
|
99
103
|
}
|
@@ -133,10 +137,14 @@ export class Gauge extends Metric {
|
|
133
137
|
}
|
134
138
|
|
135
139
|
record(ctx: BaseContext, value: Numberish, labels: Labels = {}) {
|
136
|
-
ctx.
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
+
ctx.update({
|
141
|
+
gauges: [
|
142
|
+
{
|
143
|
+
metadata: ctx.getMetaData(this.config.name, labels),
|
144
|
+
metricValue: toMetricValue(value),
|
145
|
+
runtimeInfo: undefined,
|
146
|
+
},
|
147
|
+
],
|
140
148
|
})
|
141
149
|
}
|
142
150
|
}
|
@@ -252,7 +252,7 @@ export class AccountProcessor {
|
|
252
252
|
if (parsed) {
|
253
253
|
const event: TypedEvent = { ...log, name: parsed.name, args: fixEmptyKey(parsed) }
|
254
254
|
await handler(event, ctx)
|
255
|
-
return ctx.
|
255
|
+
return ctx.stopAndGetResult()
|
256
256
|
}
|
257
257
|
return ProcessResult.fromPartial({})
|
258
258
|
},
|
@@ -92,7 +92,11 @@ export abstract class BaseProcessorTemplate<
|
|
92
92
|
instance.endBlock = BigInt(options.endBlock)
|
93
93
|
}
|
94
94
|
TemplateInstanceState.INSTANCE.addValue(instance)
|
95
|
-
ctx.
|
95
|
+
ctx.update({
|
96
|
+
states: {
|
97
|
+
configUpdated: true,
|
98
|
+
},
|
99
|
+
})
|
96
100
|
}
|
97
101
|
|
98
102
|
protected onEthEvent(
|
@@ -145,7 +145,7 @@ export class GlobalProcessor {
|
|
145
145
|
|
146
146
|
const ctx = new GlobalContext(chainId, new Date(block.timestamp * 1000), block, undefined, undefined)
|
147
147
|
await handler(block, ctx)
|
148
|
-
return ctx.
|
148
|
+
return ctx.stopAndGetResult()
|
149
149
|
},
|
150
150
|
timeIntervalInMinutes: timeInterval,
|
151
151
|
blockInterval: blockInterval,
|
@@ -168,7 +168,7 @@ export class GlobalProcessor {
|
|
168
168
|
}
|
169
169
|
const ctx = new GlobalContext(chainId, data.timestamp, block, undefined, trace, transaction, transactionReceipt)
|
170
170
|
await handler(transaction, ctx)
|
171
|
-
return ctx.
|
171
|
+
return ctx.stopAndGetResult()
|
172
172
|
},
|
173
173
|
fetchConfig: EthFetchConfig.fromPartial(fetchConfig || {}),
|
174
174
|
})
|
@@ -274,7 +274,7 @@ export abstract class BaseProcessor<
|
|
274
274
|
if (parsed) {
|
275
275
|
const event: TypedEvent = { ...log, name: parsed.name, args: fixEmptyKey(parsed) }
|
276
276
|
await handler(event, ctx)
|
277
|
-
return ctx.
|
277
|
+
return ctx.stopAndGetResult()
|
278
278
|
}
|
279
279
|
return ProcessResult.fromPartial({})
|
280
280
|
},
|
@@ -343,7 +343,7 @@ export abstract class BaseProcessor<
|
|
343
343
|
undefined
|
344
344
|
)
|
345
345
|
await handler(block, ctx)
|
346
|
-
return ctx.
|
346
|
+
return ctx.stopAndGetResult()
|
347
347
|
},
|
348
348
|
timeIntervalInMinutes: timeInterval,
|
349
349
|
blockInterval: blockInterval,
|
@@ -408,7 +408,7 @@ export abstract class BaseProcessor<
|
|
408
408
|
transactionReceipt
|
409
409
|
)
|
410
410
|
await handler(typedTrace, ctx)
|
411
|
-
return ctx.
|
411
|
+
return ctx.stopAndGetResult()
|
412
412
|
},
|
413
413
|
})
|
414
414
|
return this
|
@@ -90,7 +90,7 @@ export class SolanaBaseProcessor {
|
|
90
90
|
): Promise<ProcessResult> {
|
91
91
|
const ctx = new SolanaContext(this.contractName, this.network, this.address, slot, this.baseLabels)
|
92
92
|
await handler(parsedInstruction, ctx, accounts)
|
93
|
-
return ctx.
|
93
|
+
return ctx.stopAndGetResult()
|
94
94
|
}
|
95
95
|
|
96
96
|
public startSlot(startSlot: bigint | number) {
|
@@ -56,7 +56,11 @@ export abstract class SuiObjectOrAddressProcessorTemplate<
|
|
56
56
|
}
|
57
57
|
const config = processor.config
|
58
58
|
|
59
|
-
ctx.
|
59
|
+
ctx.update({
|
60
|
+
states: {
|
61
|
+
configUpdated: true,
|
62
|
+
},
|
63
|
+
})
|
60
64
|
TemplateInstanceState.INSTANCE.addValue({
|
61
65
|
templateId: this.id,
|
62
66
|
contract: {
|
@@ -75,7 +75,7 @@ export abstract class SuiBaseObjectOrAddressProcessor<HandlerType> {
|
|
75
75
|
processor.config.baseLabels
|
76
76
|
)
|
77
77
|
await processor.doHandle(handler, data, ctx)
|
78
|
-
return ctx.
|
78
|
+
return ctx.stopAndGetResult()
|
79
79
|
},
|
80
80
|
timeIntervalInMinutes: timeInterval,
|
81
81
|
checkPointInterval: checkpointInterval,
|
package/src/sui/sui-processor.ts
CHANGED
@@ -132,7 +132,7 @@ export class SuiBaseProcessor {
|
|
132
132
|
|
133
133
|
const decoded = await processor.coder.decodeEvent<any>(evt)
|
134
134
|
await handler(decoded || evt, ctx)
|
135
|
-
processResults.push(ctx.
|
135
|
+
processResults.push(ctx.stopAndGetResult())
|
136
136
|
}
|
137
137
|
|
138
138
|
return mergeProcessResults(processResults)
|
@@ -197,7 +197,7 @@ export class SuiBaseProcessor {
|
|
197
197
|
await handler(decoded, ctx)
|
198
198
|
}
|
199
199
|
}
|
200
|
-
return ctx.
|
200
|
+
return ctx.stopAndGetResult()
|
201
201
|
},
|
202
202
|
filters: _filters,
|
203
203
|
fetchConfig: _fetchConfig,
|
@@ -239,7 +239,7 @@ export class SuiBaseProcessor {
|
|
239
239
|
if (tx) {
|
240
240
|
await handler(tx, ctx)
|
241
241
|
}
|
242
|
-
return ctx.
|
242
|
+
return ctx.stopAndGetResult()
|
243
243
|
},
|
244
244
|
filters: [{ ...filter, function: '' }],
|
245
245
|
fetchConfig: _fetchConfig,
|