@sentio/sdk 2.57.2-rc.3 → 2.57.2-rc.4

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.
Files changed (45) hide show
  1. package/lib/aptos/aptos-processor.d.ts +1 -1
  2. package/lib/aptos/aptos-processor.d.ts.map +1 -1
  3. package/lib/aptos/aptos-processor.js +2 -2
  4. package/lib/aptos/aptos-processor.js.map +1 -1
  5. package/lib/aptos/aptos-resource-processor-template.d.ts +1 -0
  6. package/lib/aptos/aptos-resource-processor-template.d.ts.map +1 -1
  7. package/lib/aptos/aptos-resource-processor-template.js +4 -2
  8. package/lib/aptos/aptos-resource-processor-template.js.map +1 -1
  9. package/lib/eth/base-processor-template.d.ts +3 -0
  10. package/lib/eth/base-processor-template.d.ts.map +1 -1
  11. package/lib/eth/base-processor-template.js +7 -4
  12. package/lib/eth/base-processor-template.js.map +1 -1
  13. package/lib/eth/base-processor.d.ts +3 -3
  14. package/lib/eth/base-processor.d.ts.map +1 -1
  15. package/lib/eth/base-processor.js +6 -6
  16. package/lib/eth/base-processor.js.map +1 -1
  17. package/lib/fuel/fuel-processor-template.d.ts +3 -0
  18. package/lib/fuel/fuel-processor-template.d.ts.map +1 -1
  19. package/lib/fuel/fuel-processor-template.js +7 -4
  20. package/lib/fuel/fuel-processor-template.js.map +1 -1
  21. package/lib/fuel/fuel-processor.d.ts +3 -3
  22. package/lib/fuel/fuel-processor.d.ts.map +1 -1
  23. package/lib/fuel/fuel-processor.js +6 -6
  24. package/lib/fuel/fuel-processor.js.map +1 -1
  25. package/lib/sui/sui-object-processor-template.d.ts +1 -0
  26. package/lib/sui/sui-object-processor-template.d.ts.map +1 -1
  27. package/lib/sui/sui-object-processor-template.js +4 -2
  28. package/lib/sui/sui-object-processor-template.js.map +1 -1
  29. package/lib/sui/sui-object-processor.d.ts +1 -1
  30. package/lib/sui/sui-object-processor.d.ts.map +1 -1
  31. package/lib/sui/sui-object-processor.js +2 -2
  32. package/lib/sui/sui-object-processor.js.map +1 -1
  33. package/lib/utils/metrics.d.ts.map +1 -1
  34. package/lib/utils/metrics.js +0 -3
  35. package/lib/utils/metrics.js.map +1 -1
  36. package/package.json +3 -3
  37. package/src/aptos/aptos-processor.ts +3 -2
  38. package/src/aptos/aptos-resource-processor-template.ts +11 -2
  39. package/src/eth/base-processor-template.ts +17 -4
  40. package/src/eth/base-processor.ts +9 -6
  41. package/src/fuel/fuel-processor-template.ts +10 -4
  42. package/src/fuel/fuel-processor.ts +9 -6
  43. package/src/sui/sui-object-processor-template.ts +11 -2
  44. package/src/sui/sui-object-processor.ts +3 -2
  45. package/src/utils/metrics.ts +0 -3
@@ -68,10 +68,11 @@ export class FuelProcessor<TContract extends Contract> implements FuelBaseProces
68
68
 
69
69
  public onTransaction(
70
70
  handler: (transaction: FuelTransaction, ctx: FuelContractContext<TContract>) => PromiseOrVoid,
71
- config: FuelFetchConfig = DEFAULT_FUEL_FETCH_CONFIG
71
+ config: FuelFetchConfig = DEFAULT_FUEL_FETCH_CONFIG,
72
+ handlerName = getHandlerName()
72
73
  ) {
73
74
  const callHandler = {
74
- handlerName: getHandlerName(),
75
+ handlerName,
75
76
  handler: async (call: Data_FuelTransaction) => {
76
77
  const abiMap = this.config.abi
77
78
  ? {
@@ -181,12 +182,13 @@ export class FuelProcessor<TContract extends Contract> implements FuelBaseProces
181
182
 
182
183
  public onLog<T>(
183
184
  logIdFilter: string | string[],
184
- handler: (logs: FuelLog<T>, ctx: FuelContractContext<TContract>) => PromiseOrVoid
185
+ handler: (logs: FuelLog<T>, ctx: FuelContractContext<TContract>) => PromiseOrVoid,
186
+ handlerName = getHandlerName()
185
187
  ) {
186
188
  const logIds = new Set(Array.isArray(logIdFilter) ? logIdFilter : [logIdFilter])
187
189
 
188
190
  const logHandler = {
189
- handlerName: getHandlerName(),
191
+ handlerName,
190
192
  handler: async ({ transaction, receiptIndex, timestamp }: Data_FuelReceipt) => {
191
193
  try {
192
194
  const tx = decodeFuelTransaction(transaction, this.provider)
@@ -272,7 +274,8 @@ export class FuelProcessor<TContract extends Contract> implements FuelBaseProces
272
274
  public onInterval(
273
275
  handler: (block: FuelBlock, ctx: FuelContractContext<TContract>) => PromiseOrVoid,
274
276
  timeInterval: HandleInterval | undefined,
275
- blockInterval: HandleInterval | undefined
277
+ blockInterval: HandleInterval | undefined,
278
+ handlerName = getHandlerName()
276
279
  // fetchConfig: Partial<FuelFetchConfig> | undefined
277
280
  ): this {
278
281
  if (timeInterval) {
@@ -286,7 +289,7 @@ export class FuelProcessor<TContract extends Contract> implements FuelBaseProces
286
289
  this.blockHandlers.push({
287
290
  blockInterval,
288
291
  timeIntervalInMinutes: timeInterval,
289
- handlerName: getHandlerName(),
292
+ handlerName,
290
293
  handler: async function (data: Data_FuelBlock) {
291
294
  const header = data.block
292
295
  if (!header) {
@@ -16,12 +16,13 @@ import { TemplateInstanceState } from '../core/template.js'
16
16
  import { SuiBindOptions } from './sui-processor.js'
17
17
  import { TransactionFilter, accountAddressString } from '../move/index.js'
18
18
  import { ServerError, Status } from 'nice-grpc'
19
- import { proxyProcessor } from '../utils/metrics.js'
19
+ import { getHandlerName, proxyProcessor } from '../utils/metrics.js'
20
20
 
21
21
  class ObjectHandler<HandlerType> {
22
22
  type?: string
23
23
  checkpointInterval?: HandleInterval
24
24
  timeIntervalInMinutes?: HandleInterval
25
+ handlerName: string
25
26
  handler: HandlerType
26
27
  fetchConfig: MoveAccountFetchConfig
27
28
  }
@@ -68,7 +69,14 @@ export abstract class SuiObjectOrAddressProcessorTemplate<
68
69
 
69
70
  const processor = this.createProcessor(options)
70
71
  for (const h of this.objectHandlers) {
71
- processor.onInterval(h.handler, h.timeIntervalInMinutes, h.checkpointInterval, h.type, h.fetchConfig)
72
+ processor.onInterval(
73
+ h.handler,
74
+ h.timeIntervalInMinutes,
75
+ h.checkpointInterval,
76
+ h.type,
77
+ h.fetchConfig,
78
+ h.handlerName
79
+ )
72
80
  }
73
81
  const config = processor.config
74
82
 
@@ -162,6 +170,7 @@ export abstract class SuiObjectOrAddressProcessorTemplate<
162
170
  fetchConfig: Partial<MoveAccountFetchConfig> | undefined
163
171
  ): this {
164
172
  this.objectHandlers.push({
173
+ handlerName: getHandlerName(),
165
174
  handler: handler,
166
175
  timeIntervalInMinutes: timeInterval,
167
176
  checkpointInterval: checkpointInterval,
@@ -97,11 +97,12 @@ export abstract class SuiBaseObjectOrAddressProcessor<HandlerType> {
97
97
  timeInterval: HandleInterval | undefined,
98
98
  checkpointInterval: HandleInterval | undefined,
99
99
  type: string | undefined,
100
- fetchConfig: Partial<MoveAccountFetchConfig> | undefined
100
+ fetchConfig: Partial<MoveAccountFetchConfig> | undefined,
101
+ handlerName = getHandlerName()
101
102
  ): this {
102
103
  const processor = this
103
104
  this.objectHandlers.push({
104
- handlerName: getHandlerName(),
105
+ handlerName,
105
106
  handler: async function (data) {
106
107
  const ctx = new SuiObjectContext(
107
108
  processor.config.network,
@@ -8,9 +8,6 @@ export function getHandlerName() {
8
8
  export function proxyProcessor(cls: any) {
9
9
  return new Proxy(cls, {
10
10
  get: (target, prop, receiver) => {
11
- if (prop.toString() == 'bind') {
12
- return Reflect.get(target, prop, receiver)
13
- }
14
11
  return metricsStorage.run(metricsStorage.getStore() || `${cls.constructor.name}.${prop.toString()}`, () => {
15
12
  const fn = (target as any)[prop]
16
13
  if (typeof fn == 'function') {