@sentio/sdk 1.21.0 → 1.21.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.
@@ -1,4 +1,4 @@
1
- import { ProcessResult } from '../gen'
1
+ import { ProcessResult, RecordMetaData } from '../gen'
2
2
  import {
3
3
  AptosBindOptions,
4
4
  AptosContext,
@@ -22,15 +22,18 @@ type IndexConfigure = {
22
22
  // endSeqNumber?: Long
23
23
  }
24
24
 
25
- export interface EventFilter extends ArgumentsFilter {
25
+ // TODO extends ArgumentsFilter
26
+ export interface EventFilter {
26
27
  type: string
27
28
  }
28
29
 
29
- export interface CallFilter extends CallArgumentsFilter {
30
+ export interface FunctionNameAndCallFilter extends CallFilter {
30
31
  function: string
31
32
  }
32
33
 
33
- export interface CallArgumentsFilter extends ArgumentsFilter {
34
+ // TODO extends ArgumentsFilter
35
+ export interface CallFilter {
36
+ includeFailed?: boolean
34
37
  typeArguments?: string[]
35
38
  }
36
39
 
@@ -44,7 +47,7 @@ class EventHandler {
44
47
  }
45
48
 
46
49
  class CallHandler {
47
- filters: CallFilter[]
50
+ filters: FunctionNameAndCallFilter[]
48
51
  handler: (call: Transaction_UserTransaction) => Promise<ProcessResult>
49
52
  }
50
53
 
@@ -124,9 +127,9 @@ export class AptosBaseProcessor {
124
127
 
125
128
  public onEntryFunctionCall(
126
129
  handler: (call: TransactionPayload_EntryFunctionPayload, ctx: AptosContext) => void,
127
- filter: CallFilter | CallFilter[]
130
+ filter: FunctionNameAndCallFilter | FunctionNameAndCallFilter[]
128
131
  ): AptosBaseProcessor {
129
- let _filters: CallFilter[] = []
132
+ let _filters: FunctionNameAndCallFilter[] = []
130
133
 
131
134
  if (Array.isArray(filter)) {
132
135
  _filters = filter
@@ -1,6 +1,6 @@
1
1
  export type { Transaction_UserTransaction, TransactionPayload_EntryFunctionPayload } from 'aptos/src/generated'
2
2
  export type { EventInstance, TypedEventInstance, TypeRegistry, TypedEntryFunctionPayload } from './types'
3
- export type { CallFilter, EventFilter } from './aptos-processor'
3
+ export type { FunctionNameAndCallFilter, EventFilter, CallFilter, ArgumentsFilter } from './aptos-processor'
4
4
  export { AptosBaseProcessor } from './aptos-processor'
5
5
  export { AptosContext } from './context'
6
6
  export { AptosBindOptions, AptosNetwork } from './bind-options'
@@ -285,8 +285,9 @@ function generateOnEntryFunctions(module: MoveModule, func: MoveFunction) {
285
285
 
286
286
  const camelFuncName = capitalizeFirstChar(camelize(func.name))
287
287
  const source = `
288
- onEntry${camelFuncName}${genericString}(func: (call: ${module.name}.${camelFuncName}Payload${genericString}, ctx: aptos.AptosContext) => void): ${module.name} {
288
+ onEntry${camelFuncName}${genericString}(func: (call: ${module.name}.${camelFuncName}Payload${genericString}, ctx: aptos.AptosContext) => void, filter?: aptos.CallFilter): ${module.name} {
289
289
  this.onEntryFunctionCall(func, {
290
+ ...filter,
290
291
  function: '${module.name}::${func.name}'
291
292
  })
292
293
  return this