@sentio/sdk 2.16.1 → 2.16.2-rc.2
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 +3 -2
- package/lib/aptos/aptos-processor.js +22 -23
- package/lib/aptos/aptos-processor.js.map +1 -1
- package/lib/eth/base-processor-template.d.ts +1 -1
- package/lib/eth/base-processor-template.js +5 -3
- package/lib/eth/base-processor-template.js.map +1 -1
- package/lib/eth/base-processor.d.ts +4 -4
- package/lib/eth/base-processor.js +17 -17
- package/lib/eth/base-processor.js.map +1 -1
- package/lib/eth/builtin/internal/eacaggregatorproxy-processor.js +31 -31
- package/lib/eth/builtin/internal/eacaggregatorproxy-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc1155-processor.js +16 -16
- package/lib/eth/builtin/internal/erc1155-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc20-processor.js +24 -24
- package/lib/eth/builtin/internal/erc20-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc20bytes-processor.js +13 -13
- package/lib/eth/builtin/internal/erc20bytes-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc721-processor.js +20 -20
- package/lib/eth/builtin/internal/erc721-processor.js.map +1 -1
- package/lib/eth/builtin/internal/weth9-processor.js +19 -19
- package/lib/eth/builtin/internal/weth9-processor.js.map +1 -1
- package/lib/eth/codegen/ethers-sentio.js +11 -11
- package/lib/eth/codegen/ethers-sentio.js.map +1 -1
- package/lib/eth/codegen/event-handler.js +1 -1
- package/lib/eth/codegen/event-handler.js.map +1 -1
- package/lib/eth/codegen/functions-handler.js +1 -1
- package/lib/eth/codegen/functions-handler.js.map +1 -1
- package/lib/eth/generic-processor.test.js.map +1 -1
- package/lib/sui/sui-plugin.js +1 -1
- package/lib/sui/sui-plugin.js.map +1 -1
- package/lib/sui/sui-processor.d.ts +5 -3
- package/lib/sui/sui-processor.js +24 -2
- package/lib/sui/sui-processor.js.map +1 -1
- package/package.json +3 -3
- package/src/aptos/aptos-processor.ts +38 -51
- package/src/eth/base-processor-template.ts +5 -3
- package/src/eth/base-processor.ts +25 -25
- package/src/eth/builtin/internal/eacaggregatorproxy-processor.ts +31 -31
- package/src/eth/builtin/internal/erc1155-processor.ts +16 -16
- package/src/eth/builtin/internal/erc20-processor.ts +24 -24
- package/src/eth/builtin/internal/erc20bytes-processor.ts +13 -13
- package/src/eth/builtin/internal/erc721-processor.ts +20 -20
- package/src/eth/builtin/internal/weth9-processor.ts +19 -19
- package/src/eth/codegen/ethers-sentio.ts +11 -11
- package/src/eth/codegen/event-handler.ts +1 -1
- package/src/eth/codegen/functions-handler.ts +1 -1
- package/src/sui/sui-plugin.ts +1 -1
- package/src/sui/sui-processor.ts +44 -4
@@ -47,7 +47,7 @@ function generateCallHandler(fn: FunctionDeclaration, contractName: string, over
|
|
47
47
|
handler: (call: ${upperFirst(overloadedName ?? fn.name)}CallTrace, ctx: ${contractName}Context) => void,
|
48
48
|
fetchConfig?: Partial<EthFetchConfig>
|
49
49
|
): this {
|
50
|
-
return super.
|
50
|
+
return super.onEthTrace("${sighash}", handler as any, fetchConfig);
|
51
51
|
}
|
52
52
|
`
|
53
53
|
}
|
package/src/sui/sui-plugin.ts
CHANGED
package/src/sui/sui-processor.ts
CHANGED
@@ -69,7 +69,7 @@ export class SuiBaseProcessor {
|
|
69
69
|
return this.config.network
|
70
70
|
}
|
71
71
|
|
72
|
-
|
72
|
+
protected onMoveEvent(
|
73
73
|
handler: (event: SuiEvent, ctx: SuiContext) => void,
|
74
74
|
filter: EventFilter | EventFilter[],
|
75
75
|
fetchConfig?: Partial<MoveFetchConfig>
|
@@ -130,7 +130,7 @@ export class SuiBaseProcessor {
|
|
130
130
|
return this
|
131
131
|
}
|
132
132
|
|
133
|
-
|
133
|
+
protected onEntryFunctionCall(
|
134
134
|
handler: (call: MoveCallSuiTransaction, ctx: SuiContext) => void,
|
135
135
|
filter: FunctionNameAndCallFilter | FunctionNameAndCallFilter[],
|
136
136
|
fetchConfig?: Partial<MoveFetchConfig>
|
@@ -144,8 +144,6 @@ export class SuiBaseProcessor {
|
|
144
144
|
_filters.push(filter)
|
145
145
|
}
|
146
146
|
|
147
|
-
// const address = this.config.address
|
148
|
-
// const moduleName = this.moduleName
|
149
147
|
const processor = this
|
150
148
|
const allFunctionType = new Set(_filters.map((f) => processor.config.address + '::' + f.function))
|
151
149
|
|
@@ -193,4 +191,46 @@ export class SuiBaseProcessor {
|
|
193
191
|
})
|
194
192
|
return this
|
195
193
|
}
|
194
|
+
|
195
|
+
onEvent(handler: (event: SuiEvent, ctx: SuiContext) => void, fetchConfig?: Partial<MoveFetchConfig>): this {
|
196
|
+
this.onMoveEvent(handler, { type: '' }, fetchConfig)
|
197
|
+
return this
|
198
|
+
}
|
199
|
+
|
200
|
+
onTransactionBlock(
|
201
|
+
handler: (call: SuiTransactionBlockResponse, ctx: SuiContext) => void,
|
202
|
+
includeFailed = false,
|
203
|
+
fetchConfig?: Partial<MoveFetchConfig>
|
204
|
+
): this {
|
205
|
+
const _fetchConfig = MoveFetchConfig.fromPartial({ ...DEFAULT_FETCH_CONFIG, ...fetchConfig })
|
206
|
+
|
207
|
+
const processor = this
|
208
|
+
|
209
|
+
this.callHandlers.push({
|
210
|
+
handler: async function (data) {
|
211
|
+
if (!data.transaction) {
|
212
|
+
throw new ServerError(Status.INVALID_ARGUMENT, 'call is null')
|
213
|
+
}
|
214
|
+
const tx = data.transaction as SuiTransactionBlockResponse
|
215
|
+
|
216
|
+
const ctx = new SuiContext(
|
217
|
+
processor.moduleName,
|
218
|
+
processor.config.network,
|
219
|
+
processor.config.address,
|
220
|
+
data.timestamp || new Date(0),
|
221
|
+
data.slot,
|
222
|
+
tx,
|
223
|
+
0,
|
224
|
+
processor.config.baseLabels
|
225
|
+
)
|
226
|
+
if (tx) {
|
227
|
+
await handler(tx, ctx)
|
228
|
+
}
|
229
|
+
return ctx.getProcessResult()
|
230
|
+
},
|
231
|
+
filters: [{ function: '', includeFailed }],
|
232
|
+
fetchConfig: _fetchConfig,
|
233
|
+
})
|
234
|
+
return this
|
235
|
+
}
|
196
236
|
}
|