@sentio/cli 2.18.1 → 2.18.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentio/cli",
3
- "version": "2.18.1",
3
+ "version": "2.18.2-rc.2",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "exports": {
@@ -19,7 +19,7 @@
19
19
  "@jest/globals": "^29.7.0",
20
20
  "@jest/types": "^29.6.3",
21
21
  "@mysten/sui.js": "~0.54.1",
22
- "@sentio/chain": "^1.0.21",
22
+ "@sentio/chain": "^1.1.3",
23
23
  "@types/jest": "^29.5.11",
24
24
  "@types/node": "^20.11.7",
25
25
  "chalk": "^5.3.0",
@@ -2,57 +2,21 @@ import { LogLevel } from '@sentio/sdk'
2
2
  import { FuelProcessor, FuelNetwork } from '@sentio/sdk/fuel'
3
3
 
4
4
  import abi from '../abis/fuel/counter-contract-abi.json'
5
- import { CounterContractProcessor } from './types/fuel/CounterContractProcessor.js'
6
5
 
7
6
  FuelProcessor.bind({
8
7
  address: '0xa14f85860d6ce99154ecbb13570ba5fba1d8dc16b290de13f036b016fd19a29c',
9
8
  chainId: FuelNetwork.TEST_NET,
10
9
  abi
11
- })
12
- .onTransaction(
13
- async (tx, ctx) => {
14
- ctx.eventLogger.emit('transaction', {
15
- distinctId: tx.id,
16
- message: 'Transaction processed',
17
- properties: {
18
- fee: tx.fee.toNumber()
19
- },
20
- severity: tx.status === 'success' ? LogLevel.INFO : LogLevel.ERROR
21
- })
22
- },
23
- { includeFailed: true }
24
- )
25
- .onCall('increment', async (call, ctx) => {
26
- const args = call.functionScopes[0]?.getCallConfig()?.args as any[]
27
- ctx.eventLogger.emit('increment', {
28
- distinctId: ctx.transaction?.id,
29
- message: 'increment',
10
+ }).onTransaction(
11
+ async (tx, ctx) => {
12
+ ctx.eventLogger.emit('transaction', {
13
+ distinctId: tx.id,
14
+ message: 'Transaction processed',
30
15
  properties: {
31
- arg0: String(args[0]),
32
- arg1: String(args[1]),
33
- arg2: String(args[2]),
34
- ret: String(call.value)
16
+ fee: tx.fee.toNumber()
35
17
  },
36
- severity: ctx.transaction?.status === 'success' ? LogLevel.INFO : LogLevel.ERROR
18
+ severity: tx.status === 'success' ? LogLevel.INFO : LogLevel.ERROR
37
19
  })
38
- })
39
-
40
- CounterContractProcessor.bind({
41
- address: '0xa14f85860d6ce99154ecbb13570ba5fba1d8dc16b290de13f036b016fd19a29c',
42
- chainId: FuelNetwork.TEST_NET
43
- }).onCallComplex(async (call, ctx) => {
44
- const [arg1, arg2] = call.args
45
- const { Ok, Err } = call.returnValue
46
- ctx.eventLogger.emit('increment', {
47
- distinctId: ctx.transaction?.id,
48
- message: 'complex',
49
- properties: {
50
- baz: arg1.baz,
51
- bar: arg1.bar,
52
- arg2: arg2,
53
- ret: String(Ok),
54
- error: Err
55
- },
56
- severity: ctx.transaction?.status === 'success' ? LogLevel.INFO : LogLevel.ERROR
57
- })
58
- }, {})
20
+ },
21
+ { includeFailed: true }
22
+ )