@sentio/sdk 2.31.0-rc.9 → 2.31.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,7 +6,6 @@ import { SuiContext, SuiObjectChangeContext } from './context.js'
6
6
  import { MoveCallSuiTransaction, SuiEvent, SuiTransactionBlockResponse, SuiObjectChange } from '@mysten/sui.js/client'
7
7
  import {
8
8
  accountAddressString,
9
- accountTypeString,
10
9
  CallHandler,
11
10
  EventFilter,
12
11
  EventHandler,
@@ -87,7 +86,7 @@ export class SuiBaseProcessor {
87
86
  // const moduleName = this.moduleName
88
87
 
89
88
  const processor = this
90
- const allEventType = new Set(_filters.map((f) => accountTypeString(processor.config.address) + '::' + f.type))
89
+ const allEventType = new Set(_filters.map((f) => f.type))
91
90
 
92
91
  this.eventHandlers.push({
93
92
  handler: async function (data) {
@@ -101,8 +100,8 @@ export class SuiBaseProcessor {
101
100
 
102
101
  const processResults = []
103
102
  for (const [idx, evt] of (txn.events as SuiEvent[]).entries()) {
104
- const typeQname = parseMoveType(evt.type).qname
105
- if (!allEventType.has(typeQname)) {
103
+ const [_, module, type] = parseMoveType(evt.type).qname.split(SPLITTER)
104
+ if (!allEventType.has([module, type].join(SPLITTER))) {
106
105
  continue
107
106
  }
108
107
 
@@ -117,10 +116,10 @@ export class SuiBaseProcessor {
117
116
  processor.config.baseLabels
118
117
  )
119
118
 
120
- const parts = typeQname.split(SPLITTER)
121
- if (evt.packageId && parts[0] != evt.packageId) {
122
- evt.type = evt.type.replace(parts[0], evt.packageId)
123
- }
119
+ // const parts = typeQname.split(SPLITTER)
120
+ // if (evt.packageId && parts[0] != evt.packageId) {
121
+ // evt.type = evt.type.replace(parts[0], evt.packageId)
122
+ // }
124
123
  const decoded = await processor.coder.decodeEvent<any>(evt)
125
124
  await handler(decoded || evt, ctx)
126
125
  processResults.push(ctx.stopAndGetResult())
@@ -149,9 +148,7 @@ export class SuiBaseProcessor {
149
148
  }
150
149
 
151
150
  const processor = this
152
- const allFunctionType = new Set(
153
- _filters.map((f) => accountTypeString(processor.config.address) + '::' + f.function)
154
- )
151
+ const allFunctionType = new Set(_filters.map((f) => f.function))
155
152
 
156
153
  this.callHandlers.push({
157
154
  handler: async function (data) {
@@ -182,7 +179,7 @@ export class SuiBaseProcessor {
182
179
 
183
180
  // TODO potential pass index
184
181
  for (const call of calls) {
185
- const functionType = [call.package, call.module, call.function].join(SPLITTER)
182
+ const functionType = [call.module, call.function].join(SPLITTER)
186
183
  if (!allFunctionType.has(functionType)) {
187
184
  continue
188
185
  }