@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.
- package/lib/aptos/aptos-processor.d.ts +6 -5
- package/lib/aptos/aptos-processor.js.map +1 -1
- package/lib/aptos/index.d.ts +1 -1
- package/lib/aptos/index.js.map +1 -1
- package/lib/aptos-codegen/codegen.js +2 -1
- package/lib/aptos-codegen/codegen.js.map +1 -1
- package/lib/builtin/aptos/0x1.d.ts +68 -68
- package/lib/builtin/aptos/0x1.js +136 -68
- package/lib/builtin/aptos/0x1.js.map +1 -1
- package/lib/builtin/aptos/0x3.d.ts +13 -13
- package/lib/builtin/aptos/0x3.js +26 -13
- package/lib/builtin/aptos/0x3.js.map +1 -1
- package/lib/gen/processor/protos/processor.d.ts +1 -0
- package/lib/gen/processor/protos/processor.js +18 -1
- package/lib/gen/processor/protos/processor.js.map +1 -1
- package/lib/service.js +2 -1
- package/lib/service.js.map +1 -1
- package/lib/tests/types/aptos/souffle.d.ts +16 -16
- package/lib/tests/types/aptos/souffle.js +32 -16
- package/lib/tests/types/aptos/souffle.js.map +1 -1
- package/package.json +1 -1
- package/src/aptos/aptos-processor.ts +10 -7
- package/src/aptos/index.ts +1 -1
- package/src/aptos-codegen/codegen.ts +2 -1
- package/src/builtin/aptos/0x1.ts +225 -68
- package/src/builtin/aptos/0x3.ts +39 -13
- package/src/gen/processor/protos/processor.ts +19 -1
- package/src/service.ts +2 -2
- package/src/tests/types/aptos/souffle.ts +48 -16
@@ -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
|
-
|
25
|
+
// TODO extends ArgumentsFilter
|
26
|
+
export interface EventFilter {
|
26
27
|
type: string
|
27
28
|
}
|
28
29
|
|
29
|
-
export interface
|
30
|
+
export interface FunctionNameAndCallFilter extends CallFilter {
|
30
31
|
function: string
|
31
32
|
}
|
32
33
|
|
33
|
-
|
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:
|
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:
|
130
|
+
filter: FunctionNameAndCallFilter | FunctionNameAndCallFilter[]
|
128
131
|
): AptosBaseProcessor {
|
129
|
-
let _filters:
|
132
|
+
let _filters: FunctionNameAndCallFilter[] = []
|
130
133
|
|
131
134
|
if (Array.isArray(filter)) {
|
132
135
|
_filters = filter
|
package/src/aptos/index.ts
CHANGED
@@ -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 {
|
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
|