@sentio/sdk 4.0.0-rc.1 → 4.0.0-rc.3
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-plugin.d.ts +1 -1
- package/lib/aptos/aptos-plugin.d.ts.map +1 -1
- package/lib/aptos/aptos-plugin.js +43 -42
- package/lib/aptos/aptos-plugin.js.map +1 -1
- package/lib/aptos/aptos-processor.d.ts +1 -1
- package/lib/aptos/aptos-processor.d.ts.map +1 -1
- package/lib/aptos/aptos-processor.js +25 -25
- package/lib/aptos/aptos-processor.js.map +1 -1
- package/lib/aptos/aptos-resource-processor-template.d.ts +1 -1
- package/lib/aptos/aptos-resource-processor-template.d.ts.map +1 -1
- package/lib/aptos/aptos-resource-processor-template.js +10 -5
- package/lib/aptos/aptos-resource-processor-template.js.map +1 -1
- package/lib/aptos/context.d.ts +1 -1
- package/lib/aptos/context.d.ts.map +1 -1
- package/lib/aptos/context.js +8 -6
- package/lib/aptos/context.js.map +1 -1
- package/lib/aptos/data.d.ts +4 -4
- package/lib/aptos/data.d.ts.map +1 -1
- package/lib/core/base-context.d.ts +3 -2
- package/lib/core/base-context.d.ts.map +1 -1
- package/lib/core/base-context.js +12 -11
- package/lib/core/base-context.js.map +1 -1
- package/lib/core/core-plugin.d.ts.map +1 -1
- package/lib/core/core-plugin.js +6 -4
- package/lib/core/core-plugin.js.map +1 -1
- package/lib/core/event-logger.d.ts +10 -2
- package/lib/core/event-logger.d.ts.map +1 -1
- package/lib/core/event-logger.js +42 -26
- package/lib/core/event-logger.js.map +1 -1
- package/lib/core/exporter.d.ts.map +1 -1
- package/lib/core/exporter.js +5 -3
- package/lib/core/exporter.js.map +1 -1
- package/lib/core/handler-options.d.ts +1 -1
- package/lib/core/handler-options.d.ts.map +1 -1
- package/lib/core/handler-register.d.ts +1 -1
- package/lib/core/handler-register.d.ts.map +1 -1
- package/lib/core/handler-register.js +2 -2
- package/lib/core/handler-register.js.map +1 -1
- package/lib/core/meter.d.ts +4 -3
- package/lib/core/meter.d.ts.map +1 -1
- package/lib/core/meter.js +5 -4
- package/lib/core/meter.js.map +1 -1
- package/lib/core/normalization.d.ts +1 -1
- package/lib/core/normalization.d.ts.map +1 -1
- package/lib/core/normalization.js +41 -31
- package/lib/core/normalization.js.map +1 -1
- package/lib/core/numberish.d.ts +1 -1
- package/lib/core/numberish.d.ts.map +1 -1
- package/lib/core/numberish.js +35 -30
- package/lib/core/numberish.js.map +1 -1
- package/lib/core/partition-handler-manager.d.ts +1 -1
- package/lib/core/partition-handler-manager.d.ts.map +1 -1
- package/lib/core/partition-handler-manager.js +10 -9
- package/lib/core/partition-handler-manager.js.map +1 -1
- package/lib/cosmos/context.d.ts.map +1 -1
- package/lib/cosmos/context.js +4 -2
- package/lib/cosmos/context.js.map +1 -1
- package/lib/cosmos/cosmos-plugin.d.ts.map +1 -1
- package/lib/cosmos/cosmos-plugin.js +11 -10
- package/lib/cosmos/cosmos-plugin.js.map +1 -1
- package/lib/cosmos/cosmos-processor.js.map +1 -1
- package/lib/eth/abi-decoder/decode-worker.js +2 -2
- package/lib/eth/abi-decoder/decode-worker.js.map +1 -1
- package/lib/eth/account-processor.d.ts +2 -2
- package/lib/eth/account-processor.d.ts.map +1 -1
- package/lib/eth/account-processor.js +10 -9
- package/lib/eth/account-processor.js.map +1 -1
- package/lib/eth/base-processor-template.d.ts +3 -3
- package/lib/eth/base-processor-template.d.ts.map +1 -1
- package/lib/eth/base-processor-template.js +12 -8
- package/lib/eth/base-processor-template.js.map +1 -1
- package/lib/eth/base-processor.d.ts +1 -1
- package/lib/eth/base-processor.d.ts.map +1 -1
- package/lib/eth/base-processor.js +53 -46
- package/lib/eth/base-processor.js.map +1 -1
- package/lib/eth/builtin/internal/eacaggregatorproxy-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/eacaggregatorproxy-processor.js +48 -46
- package/lib/eth/builtin/internal/eacaggregatorproxy-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc1155-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/erc1155-processor.js +18 -16
- package/lib/eth/builtin/internal/erc1155-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc20-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/erc20-processor.js +38 -36
- package/lib/eth/builtin/internal/erc20-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc20bytes-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/erc20bytes-processor.js +20 -18
- package/lib/eth/builtin/internal/erc20bytes-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc721-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/erc721-processor.js +30 -28
- package/lib/eth/builtin/internal/erc721-processor.js.map +1 -1
- package/lib/eth/builtin/internal/weth9-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/weth9-processor.js +24 -22
- package/lib/eth/builtin/internal/weth9-processor.js.map +1 -1
- package/lib/eth/codegen/file.d.ts.map +1 -1
- package/lib/eth/codegen/file.js +2 -1
- package/lib/eth/codegen/file.js.map +1 -1
- package/lib/eth/codegen/function-calls.js +1 -1
- package/lib/eth/context.d.ts +1 -1
- package/lib/eth/context.d.ts.map +1 -1
- package/lib/eth/context.js +17 -11
- package/lib/eth/context.js.map +1 -1
- package/lib/eth/eth-plugin.d.ts.map +1 -1
- package/lib/eth/eth-plugin.js +83 -75
- package/lib/eth/eth-plugin.js.map +1 -1
- package/lib/eth/eth.d.ts +6 -6
- package/lib/eth/eth.d.ts.map +1 -1
- package/lib/eth/eth.js +39 -26
- package/lib/eth/eth.js.map +1 -1
- package/lib/eth/index.d.ts +1 -1
- package/lib/eth/index.d.ts.map +1 -1
- package/lib/eth/index.js +0 -1
- package/lib/eth/index.js.map +1 -1
- package/lib/fuel/asset-processor.d.ts +2 -2
- package/lib/fuel/asset-processor.d.ts.map +1 -1
- package/lib/fuel/asset-processor.js +5 -3
- package/lib/fuel/asset-processor.js.map +1 -1
- package/lib/fuel/context.d.ts.map +1 -1
- package/lib/fuel/context.js +4 -2
- package/lib/fuel/context.js.map +1 -1
- package/lib/fuel/fuel-plugin.d.ts.map +1 -1
- package/lib/fuel/fuel-plugin.js +41 -53
- package/lib/fuel/fuel-plugin.js.map +1 -1
- package/lib/fuel/fuel-processor-template.d.ts.map +1 -1
- package/lib/fuel/fuel-processor-template.js +7 -5
- package/lib/fuel/fuel-processor-template.js.map +1 -1
- package/lib/fuel/fuel-processor.d.ts.map +1 -1
- package/lib/fuel/fuel-processor.js +30 -20
- package/lib/fuel/fuel-processor.js.map +1 -1
- package/lib/fuel/global-processor.d.ts.map +1 -1
- package/lib/fuel/global-processor.js +2 -1
- package/lib/fuel/global-processor.js.map +1 -1
- package/lib/fuel/types.d.ts +10 -4
- package/lib/fuel/types.d.ts.map +1 -1
- package/lib/fuel/types.js.map +1 -1
- package/lib/iota/context.d.ts +1 -1
- package/lib/iota/context.d.ts.map +1 -1
- package/lib/iota/context.js +8 -6
- package/lib/iota/context.js.map +1 -1
- package/lib/iota/iota-object-processor-template.d.ts +1 -1
- package/lib/iota/iota-object-processor-template.d.ts.map +1 -1
- package/lib/iota/iota-object-processor-template.js +17 -12
- package/lib/iota/iota-object-processor-template.js.map +1 -1
- package/lib/iota/iota-object-processor.d.ts +1 -1
- package/lib/iota/iota-object-processor.d.ts.map +1 -1
- package/lib/iota/iota-object-processor.js +23 -16
- package/lib/iota/iota-object-processor.js.map +1 -1
- package/lib/iota/iota-plugin-part.d.ts +1 -1
- package/lib/iota/iota-plugin-part.d.ts.map +1 -1
- package/lib/iota/iota-plugin-part.js +16 -15
- package/lib/iota/iota-plugin-part.js.map +1 -1
- package/lib/iota/iota-processor.d.ts +1 -1
- package/lib/iota/iota-processor.d.ts.map +1 -1
- package/lib/iota/iota-processor.js +18 -17
- package/lib/iota/iota-processor.js.map +1 -1
- package/lib/iota/network.js +2 -2
- package/lib/iota/network.js.map +1 -1
- package/lib/move/filter.d.ts +1 -1
- package/lib/move/filter.d.ts.map +1 -1
- package/lib/move/index.d.ts +1 -1
- package/lib/move/index.d.ts.map +1 -1
- package/lib/move/index.js +0 -1
- package/lib/move/index.js.map +1 -1
- package/lib/solana/builtin/types.d.ts +4 -4
- package/lib/solana/solana-context.d.ts.map +1 -1
- package/lib/solana/solana-context.js +4 -3
- package/lib/solana/solana-context.js.map +1 -1
- package/lib/solana/solana-plugin.d.ts.map +1 -1
- package/lib/solana/solana-plugin.js +19 -18
- package/lib/solana/solana-plugin.js.map +1 -1
- package/lib/solana/solana-processor.d.ts.map +1 -1
- package/lib/solana/solana-processor.js +8 -3
- package/lib/solana/solana-processor.js.map +1 -1
- package/lib/store/cache.d.ts.map +1 -1
- package/lib/store/cache.js +22 -17
- package/lib/store/cache.js.map +1 -1
- package/lib/store/convert.d.ts +1 -1
- package/lib/store/convert.d.ts.map +1 -1
- package/lib/store/convert.js +67 -104
- package/lib/store/convert.js.map +1 -1
- package/lib/store/decorators.d.ts +1 -1
- package/lib/store/decorators.d.ts.map +1 -1
- package/lib/store/decorators.js +3 -1
- package/lib/store/decorators.js.map +1 -1
- package/lib/store/store.d.ts.map +1 -1
- package/lib/store/store.js +24 -16
- package/lib/store/store.js.map +1 -1
- package/lib/store/types.js +24 -32
- package/lib/store/types.js.map +1 -1
- package/lib/store/util.d.ts +1 -1
- package/lib/store/util.d.ts.map +1 -1
- package/lib/store/util.js +13 -17
- package/lib/store/util.js.map +1 -1
- package/lib/sui/context.d.ts +1 -1
- package/lib/sui/context.d.ts.map +1 -1
- package/lib/sui/context.js +8 -6
- package/lib/sui/context.js.map +1 -1
- package/lib/sui/sui-object-processor-template.d.ts +1 -1
- package/lib/sui/sui-object-processor-template.d.ts.map +1 -1
- package/lib/sui/sui-object-processor-template.js +17 -12
- package/lib/sui/sui-object-processor-template.js.map +1 -1
- package/lib/sui/sui-object-processor.d.ts +1 -1
- package/lib/sui/sui-object-processor.d.ts.map +1 -1
- package/lib/sui/sui-object-processor.js +23 -16
- package/lib/sui/sui-object-processor.js.map +1 -1
- package/lib/sui/sui-plugin-part.d.ts +1 -1
- package/lib/sui/sui-plugin-part.d.ts.map +1 -1
- package/lib/sui/sui-plugin-part.js +16 -15
- package/lib/sui/sui-plugin-part.js.map +1 -1
- package/lib/sui/sui-plugin.d.ts +1 -1
- package/lib/sui/sui-plugin.d.ts.map +1 -1
- package/lib/sui/sui-plugin.js +35 -34
- package/lib/sui/sui-plugin.js.map +1 -1
- package/lib/sui/sui-processor.d.ts +1 -1
- package/lib/sui/sui-processor.d.ts.map +1 -1
- package/lib/sui/sui-processor.js +18 -17
- package/lib/sui/sui-processor.js.map +1 -1
- package/lib/testing/aptos-facet.d.ts.map +1 -1
- package/lib/testing/aptos-facet.js +18 -11
- package/lib/testing/aptos-facet.js.map +1 -1
- package/lib/testing/cosmos-facet.d.ts.map +1 -1
- package/lib/testing/cosmos-facet.js +10 -6
- package/lib/testing/cosmos-facet.js.map +1 -1
- package/lib/testing/eth-facet.d.ts +1 -1
- package/lib/testing/eth-facet.d.ts.map +1 -1
- package/lib/testing/eth-facet.js +34 -18
- package/lib/testing/eth-facet.js.map +1 -1
- package/lib/testing/fuel-facet.d.ts.map +1 -1
- package/lib/testing/fuel-facet.js +28 -18
- package/lib/testing/fuel-facet.js.map +1 -1
- package/lib/testing/iota-facet.d.ts.map +1 -1
- package/lib/testing/iota-facet.js +32 -20
- package/lib/testing/iota-facet.js.map +1 -1
- package/lib/testing/memory-database.d.ts +11 -3
- package/lib/testing/memory-database.d.ts.map +1 -1
- package/lib/testing/memory-database.js +84 -71
- package/lib/testing/memory-database.js.map +1 -1
- package/lib/testing/metric-utils.d.ts +2 -2
- package/lib/testing/metric-utils.d.ts.map +1 -1
- package/lib/testing/metric-utils.js +13 -12
- package/lib/testing/metric-utils.js.map +1 -1
- package/lib/testing/solana-facet.d.ts +3 -2
- package/lib/testing/solana-facet.d.ts.map +1 -1
- package/lib/testing/solana-facet.js +8 -5
- package/lib/testing/solana-facet.js.map +1 -1
- package/lib/testing/sui-facet.d.ts.map +1 -1
- package/lib/testing/sui-facet.js +30 -20
- package/lib/testing/sui-facet.js.map +1 -1
- package/lib/testing/test-processor-server.d.ts +1453 -16
- package/lib/testing/test-processor-server.d.ts.map +1 -1
- package/lib/testing/test-processor-server.js +108 -45
- package/lib/testing/test-processor-server.js.map +1 -1
- package/lib/utils/price.d.ts +1 -1
- package/lib/utils/price.d.ts.map +1 -1
- package/lib/utils/price.js +19 -12
- package/lib/utils/price.js.map +1 -1
- package/package.json +5 -7
- package/src/aptos/aptos-plugin.ts +105 -91
- package/src/aptos/aptos-processor.ts +33 -25
- package/src/aptos/aptos-resource-processor-template.ts +15 -6
- package/src/aptos/context.ts +8 -7
- package/src/aptos/data.ts +4 -4
- package/src/core/base-context.ts +19 -12
- package/src/core/core-plugin.ts +10 -7
- package/src/core/event-logger.ts +63 -34
- package/src/core/exporter.ts +5 -4
- package/src/core/handler-options.ts +1 -1
- package/src/core/handler-register.ts +3 -3
- package/src/core/meter.ts +9 -7
- package/src/core/normalization.ts +53 -31
- package/src/core/numberish.ts +46 -30
- package/src/core/partition-handler-manager.ts +13 -11
- package/src/cosmos/context.ts +4 -3
- package/src/cosmos/cosmos-plugin.ts +19 -15
- package/src/cosmos/cosmos-processor.ts +2 -2
- package/src/eth/abi-decoder/decode-worker.ts +2 -2
- package/src/eth/account-processor.ts +21 -12
- package/src/eth/base-processor-template.ts +22 -10
- package/src/eth/base-processor.ts +66 -54
- package/src/eth/builtin/internal/eacaggregatorproxy-processor.ts +177 -116
- package/src/eth/builtin/internal/erc1155-processor.ts +73 -38
- package/src/eth/builtin/internal/erc20-processor.ts +152 -91
- package/src/eth/builtin/internal/erc20bytes-processor.ts +80 -46
- package/src/eth/builtin/internal/erc721-processor.ts +109 -65
- package/src/eth/builtin/internal/weth9-processor.ts +95 -56
- package/src/eth/codegen/file.ts +2 -1
- package/src/eth/codegen/function-calls.ts +1 -1
- package/src/eth/context.ts +29 -13
- package/src/eth/eth-plugin.ts +135 -118
- package/src/eth/eth.ts +46 -32
- package/src/eth/index.ts +1 -1
- package/src/fuel/asset-processor.ts +16 -8
- package/src/fuel/context.ts +4 -3
- package/src/fuel/fuel-plugin.ts +71 -73
- package/src/fuel/fuel-processor-template.ts +7 -6
- package/src/fuel/fuel-processor.ts +35 -23
- package/src/fuel/global-processor.ts +3 -3
- package/src/fuel/types.ts +10 -4
- package/src/iota/context.ts +8 -7
- package/src/iota/iota-object-processor-template.ts +25 -15
- package/src/iota/iota-object-processor.ts +33 -22
- package/src/iota/iota-plugin-part.ts +41 -34
- package/src/iota/iota-processor.ts +25 -17
- package/src/iota/network.ts +2 -2
- package/src/move/filter.ts +1 -1
- package/src/move/index.ts +1 -1
- package/src/solana/solana-context.ts +4 -3
- package/src/solana/solana-plugin.ts +27 -24
- package/src/solana/solana-processor.ts +14 -6
- package/src/store/cache.ts +22 -18
- package/src/store/convert.ts +68 -104
- package/src/store/decorators.ts +3 -2
- package/src/store/store.ts +30 -22
- package/src/store/types.ts +24 -33
- package/src/store/util.ts +13 -18
- package/src/sui/context.ts +8 -7
- package/src/sui/sui-object-processor-template.ts +25 -15
- package/src/sui/sui-object-processor.ts +33 -22
- package/src/sui/sui-plugin-part.ts +41 -34
- package/src/sui/sui-plugin.ts +49 -47
- package/src/sui/sui-processor.ts +25 -17
- package/src/testing/aptos-facet.ts +18 -11
- package/src/testing/cosmos-facet.ts +10 -6
- package/src/testing/eth-facet.ts +40 -18
- package/src/testing/fuel-facet.ts +28 -18
- package/src/testing/iota-facet.ts +32 -20
- package/src/testing/memory-database.ts +126 -88
- package/src/testing/metric-utils.ts +15 -14
- package/src/testing/solana-facet.ts +11 -6
- package/src/testing/sui-facet.ts +30 -20
- package/src/testing/test-processor-server.ts +169 -79
- package/src/utils/price.ts +20 -13
|
@@ -2,10 +2,12 @@ import {
|
|
|
2
2
|
Data_FuelBlock,
|
|
3
3
|
Data_FuelTransaction,
|
|
4
4
|
Data_FuelReceipt,
|
|
5
|
-
FuelCallFilter,
|
|
6
5
|
HandleInterval,
|
|
7
|
-
|
|
6
|
+
HandleIntervalSchema,
|
|
7
|
+
ProcessResultSchema,
|
|
8
|
+
timestampDate
|
|
8
9
|
} from '@sentio/protos'
|
|
10
|
+
import { create } from '@bufbuild/protobuf'
|
|
9
11
|
import { FuelCall, FuelContext, FuelContractContext } from './context.js'
|
|
10
12
|
import { bn, Contract, InputType, Interface, JsonAbi, Provider, ReceiptTransfer, ReceiptTransferOut } from 'fuels'
|
|
11
13
|
import { FuelNetwork, getProvider } from './network.js'
|
|
@@ -22,13 +24,14 @@ import {
|
|
|
22
24
|
ContractTransferFilter,
|
|
23
25
|
FuelBaseProcessor,
|
|
24
26
|
FuelBlock,
|
|
27
|
+
FuelCallFilter,
|
|
25
28
|
FuelLog,
|
|
26
29
|
FuelProcessorState,
|
|
27
30
|
FuelTransaction,
|
|
28
31
|
ReceiptHandler
|
|
29
32
|
} from './types.js'
|
|
30
33
|
import { PromiseOrVoid, HandlerOptions } from '../core/index.js'
|
|
31
|
-
import {
|
|
34
|
+
import { ConnectError, Code } from '@connectrpc/connect'
|
|
32
35
|
import { getHandlerName, proxyProcessor } from '../utils/metrics.js'
|
|
33
36
|
|
|
34
37
|
export class FuelProcessor<TContract extends Contract> implements FuelBaseProcessor<FuelProcessorConfig> {
|
|
@@ -106,7 +109,7 @@ export class FuelProcessor<TContract extends Contract> implements FuelBaseProces
|
|
|
106
109
|
this.getContract(tx),
|
|
107
110
|
this.config.address,
|
|
108
111
|
this.config.name ?? this.config.address,
|
|
109
|
-
call.timestamp
|
|
112
|
+
call.timestamp ? timestampDate(call.timestamp) : new Date(0),
|
|
110
113
|
tx,
|
|
111
114
|
null
|
|
112
115
|
)
|
|
@@ -176,7 +179,7 @@ export class FuelProcessor<TContract extends Contract> implements FuelBaseProces
|
|
|
176
179
|
this.config.chainId,
|
|
177
180
|
this.config.address,
|
|
178
181
|
this.config.name ?? this.config.address,
|
|
179
|
-
call.timestamp
|
|
182
|
+
call.timestamp ? timestampDate(call.timestamp) : new Date(0),
|
|
180
183
|
tx,
|
|
181
184
|
null
|
|
182
185
|
)
|
|
@@ -198,7 +201,7 @@ export class FuelProcessor<TContract extends Contract> implements FuelBaseProces
|
|
|
198
201
|
return ctx.stopAndGetResult()
|
|
199
202
|
} catch (e) {
|
|
200
203
|
console.error(e)
|
|
201
|
-
return
|
|
204
|
+
return create(ProcessResultSchema)
|
|
202
205
|
}
|
|
203
206
|
},
|
|
204
207
|
fetchConfig: {
|
|
@@ -231,7 +234,7 @@ export class FuelProcessor<TContract extends Contract> implements FuelBaseProces
|
|
|
231
234
|
this.getContract(tx),
|
|
232
235
|
this.config.address,
|
|
233
236
|
this.config.name ?? this.config.address,
|
|
234
|
-
timestamp
|
|
237
|
+
timestamp ? timestampDate(timestamp) : new Date(0),
|
|
235
238
|
tx,
|
|
236
239
|
null
|
|
237
240
|
)
|
|
@@ -245,11 +248,14 @@ export class FuelProcessor<TContract extends Contract> implements FuelBaseProces
|
|
|
245
248
|
console.error(e)
|
|
246
249
|
}
|
|
247
250
|
|
|
248
|
-
return
|
|
251
|
+
return create(ProcessResultSchema)
|
|
249
252
|
},
|
|
250
253
|
receiptConfig: {
|
|
251
|
-
|
|
252
|
-
|
|
254
|
+
receiptFilter: {
|
|
255
|
+
case: 'log',
|
|
256
|
+
value: {
|
|
257
|
+
logIds: Array.from(logIds)
|
|
258
|
+
}
|
|
253
259
|
}
|
|
254
260
|
},
|
|
255
261
|
partitionHandler: async (data: Data_FuelReceipt): Promise<string | undefined> => {
|
|
@@ -297,7 +303,7 @@ export class FuelProcessor<TContract extends Contract> implements FuelBaseProces
|
|
|
297
303
|
this.getContract(tx),
|
|
298
304
|
this.config.address,
|
|
299
305
|
this.config.name ?? this.config.address,
|
|
300
|
-
timestamp
|
|
306
|
+
timestamp ? timestampDate(timestamp) : new Date(0),
|
|
301
307
|
tx,
|
|
302
308
|
null
|
|
303
309
|
)
|
|
@@ -307,13 +313,16 @@ export class FuelProcessor<TContract extends Contract> implements FuelBaseProces
|
|
|
307
313
|
console.error(e)
|
|
308
314
|
}
|
|
309
315
|
|
|
310
|
-
return
|
|
316
|
+
return create(ProcessResultSchema)
|
|
311
317
|
},
|
|
312
318
|
receiptConfig: {
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
319
|
+
receiptFilter: {
|
|
320
|
+
case: 'transfer',
|
|
321
|
+
value: {
|
|
322
|
+
from,
|
|
323
|
+
to,
|
|
324
|
+
assetId
|
|
325
|
+
}
|
|
317
326
|
}
|
|
318
327
|
},
|
|
319
328
|
partitionHandler: async (data: Data_FuelReceipt): Promise<string | undefined> => {
|
|
@@ -357,9 +366,9 @@ export class FuelProcessor<TContract extends Contract> implements FuelBaseProces
|
|
|
357
366
|
timeIntervalInMinutes: timeInterval,
|
|
358
367
|
handlerName,
|
|
359
368
|
handler: async function (data: Data_FuelBlock) {
|
|
360
|
-
const header = data.block
|
|
369
|
+
const header = data.block as any
|
|
361
370
|
if (!header) {
|
|
362
|
-
throw new
|
|
371
|
+
throw new ConnectError('Block is empty', Code.InvalidArgument)
|
|
363
372
|
}
|
|
364
373
|
|
|
365
374
|
const block: FuelBlock = {
|
|
@@ -383,7 +392,7 @@ export class FuelProcessor<TContract extends Contract> implements FuelBaseProces
|
|
|
383
392
|
contract,
|
|
384
393
|
processor.config.address,
|
|
385
394
|
processor.config.name ?? processor.config.address,
|
|
386
|
-
data.timestamp
|
|
395
|
+
data.timestamp ? timestampDate(data.timestamp) : new Date(0),
|
|
387
396
|
null,
|
|
388
397
|
block
|
|
389
398
|
)
|
|
@@ -394,7 +403,7 @@ export class FuelProcessor<TContract extends Contract> implements FuelBaseProces
|
|
|
394
403
|
const p = handlerOptions?.partitionKey
|
|
395
404
|
if (!p) return undefined
|
|
396
405
|
if (typeof p === 'function') {
|
|
397
|
-
const header = data.block
|
|
406
|
+
const header = data.block as any
|
|
398
407
|
if (!header) return undefined
|
|
399
408
|
const block: FuelBlock = {
|
|
400
409
|
id: header.id,
|
|
@@ -428,10 +437,10 @@ export class FuelProcessor<TContract extends Contract> implements FuelBaseProces
|
|
|
428
437
|
return this.onInterval(
|
|
429
438
|
handler,
|
|
430
439
|
undefined,
|
|
431
|
-
{
|
|
440
|
+
create(HandleIntervalSchema, {
|
|
432
441
|
recentInterval: blockInterval,
|
|
433
442
|
backfillInterval: backfillBlockInterval
|
|
434
|
-
},
|
|
443
|
+
}),
|
|
435
444
|
handlerOptions
|
|
436
445
|
)
|
|
437
446
|
}
|
|
@@ -444,7 +453,10 @@ export class FuelProcessor<TContract extends Contract> implements FuelBaseProces
|
|
|
444
453
|
): this {
|
|
445
454
|
return this.onInterval(
|
|
446
455
|
handler,
|
|
447
|
-
|
|
456
|
+
create(HandleIntervalSchema, {
|
|
457
|
+
recentInterval: timeIntervalInMinutes,
|
|
458
|
+
backfillInterval: backfillTimeIntervalInMinutes
|
|
459
|
+
}),
|
|
448
460
|
undefined,
|
|
449
461
|
handlerOptions
|
|
450
462
|
)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CallHandler, FuelBaseProcessor, FuelBlock, FuelProcessorState, FuelTransaction } from './types.js'
|
|
2
|
-
import { Data_FuelTransaction } from '@sentio/protos'
|
|
2
|
+
import { Data_FuelTransaction, timestampDate } from '@sentio/protos'
|
|
3
3
|
import { Provider, bn } from 'fuels'
|
|
4
4
|
import { getProvider } from './network.js'
|
|
5
5
|
import { decodeFuelTransaction, DEFAULT_FUEL_FETCH_CONFIG, FuelFetchConfig } from './transaction.js'
|
|
@@ -51,12 +51,12 @@ export class FuelGlobalProcessor implements FuelBaseProcessor<GlobalFuelProcesso
|
|
|
51
51
|
console.error('error decoding transaction', e)
|
|
52
52
|
return mergeProcessResults([])
|
|
53
53
|
}
|
|
54
|
-
const header = call.transaction?.status.block.header
|
|
54
|
+
const header = (call.transaction as any)?.status.block.header
|
|
55
55
|
const ctx = new FuelContext(
|
|
56
56
|
this.config.chainId,
|
|
57
57
|
ALL_ADDRESS,
|
|
58
58
|
this.config.name ?? '*',
|
|
59
|
-
call.timestamp
|
|
59
|
+
call.timestamp ? timestampDate(call.timestamp) : new Date(0),
|
|
60
60
|
tx,
|
|
61
61
|
header
|
|
62
62
|
? ({
|
package/src/fuel/types.ts
CHANGED
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
Data_FuelReceipt,
|
|
5
5
|
Data_FuelTransaction,
|
|
6
6
|
FuelAssetHandlerConfig,
|
|
7
|
-
FuelCallHandlerConfig,
|
|
8
7
|
FuelReceiptHandlerConfig,
|
|
9
8
|
HandleInterval,
|
|
10
9
|
OnIntervalConfig,
|
|
@@ -12,6 +11,13 @@ import {
|
|
|
12
11
|
} from '@sentio/protos'
|
|
13
12
|
import { Block, TransactionSummary } from 'fuels'
|
|
14
13
|
|
|
14
|
+
// Client-side only filter for `onCall`. Fuel calls are delivered as FUEL_TRANSACTION
|
|
15
|
+
// data and filtered in-handler, so this never reaches the backend.
|
|
16
|
+
export interface FuelCallFilter {
|
|
17
|
+
function: string
|
|
18
|
+
includeFailed: boolean
|
|
19
|
+
}
|
|
20
|
+
|
|
15
21
|
export interface FuelBaseProcessor<T> {
|
|
16
22
|
configure(): Promise<void>
|
|
17
23
|
config: T
|
|
@@ -27,15 +33,15 @@ export class FuelProcessorState extends MapStateStorage<FuelBaseProcessor<any>>
|
|
|
27
33
|
export type CallHandler<T> = {
|
|
28
34
|
handlerName: string
|
|
29
35
|
handler: (call: T) => Promise<ProcessResult>
|
|
30
|
-
fetchConfig?:
|
|
31
|
-
assetConfig?: Partial<FuelAssetHandlerConfig>
|
|
36
|
+
fetchConfig?: { filters: FuelCallFilter[] }
|
|
37
|
+
assetConfig?: Omit<Partial<FuelAssetHandlerConfig>, '$typeName' | '$unknown'>
|
|
32
38
|
partitionHandler?: (call: T) => Promise<string | undefined>
|
|
33
39
|
}
|
|
34
40
|
|
|
35
41
|
export type ReceiptHandler = {
|
|
36
42
|
handlerName: string
|
|
37
43
|
handler: (receipt: Data_FuelReceipt) => Promise<ProcessResult>
|
|
38
|
-
receiptConfig?: Partial<FuelReceiptHandlerConfig>
|
|
44
|
+
receiptConfig?: Omit<Partial<FuelReceiptHandlerConfig>, '$typeName' | '$unknown'>
|
|
39
45
|
partitionHandler?: (receipt: Data_FuelReceipt) => Promise<string | undefined>
|
|
40
46
|
}
|
|
41
47
|
|
package/src/iota/context.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { RecordMetaData } from '@sentio/protos'
|
|
1
|
+
import { type RecordMetaData, RecordMetaDataSchema } from '@sentio/protos'
|
|
2
|
+
import { create } from '@bufbuild/protobuf'
|
|
2
3
|
import { type Labels, normalizeLabels } from '../index.js'
|
|
3
4
|
import { getClient, IotaNetwork } from './network.js'
|
|
4
5
|
import {
|
|
@@ -52,7 +53,7 @@ export class IotaContext extends MoveContext<IotaNetwork, IotaMoveNormalizedModu
|
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
getMetaDataInternal(name: string, labels: Labels): RecordMetaData {
|
|
55
|
-
return {
|
|
56
|
+
return create(RecordMetaDataSchema, {
|
|
56
57
|
address: this.address,
|
|
57
58
|
contractName: this.moduleName,
|
|
58
59
|
blockNumber: this.checkpoint,
|
|
@@ -62,7 +63,7 @@ export class IotaContext extends MoveContext<IotaNetwork, IotaMoveNormalizedModu
|
|
|
62
63
|
chainId: this.getChainId(),
|
|
63
64
|
name: name,
|
|
64
65
|
labels: normalizeLabels(labels)
|
|
65
|
-
}
|
|
66
|
+
})
|
|
66
67
|
}
|
|
67
68
|
|
|
68
69
|
get client(): IotaClient {
|
|
@@ -106,7 +107,7 @@ export class IotaObjectChangeContext extends MoveContext<
|
|
|
106
107
|
}
|
|
107
108
|
|
|
108
109
|
getMetaDataInternal(name: string, labels: Labels): RecordMetaData {
|
|
109
|
-
return {
|
|
110
|
+
return create(RecordMetaDataSchema, {
|
|
110
111
|
address: this.address,
|
|
111
112
|
contractName: '*',
|
|
112
113
|
blockNumber: this.checkpoint,
|
|
@@ -116,7 +117,7 @@ export class IotaObjectChangeContext extends MoveContext<
|
|
|
116
117
|
chainId: this.getChainId(),
|
|
117
118
|
name: name,
|
|
118
119
|
labels: normalizeLabels(labels)
|
|
119
|
-
}
|
|
120
|
+
})
|
|
120
121
|
}
|
|
121
122
|
|
|
122
123
|
get client(): IotaClient {
|
|
@@ -158,7 +159,7 @@ export class IotaAddressContext extends MoveAccountContext<
|
|
|
158
159
|
}
|
|
159
160
|
|
|
160
161
|
getMetaDataInternal(name: string, labels: Labels): RecordMetaData {
|
|
161
|
-
return {
|
|
162
|
+
return create(RecordMetaDataSchema, {
|
|
162
163
|
address: this.address,
|
|
163
164
|
contractName: this.contractName,
|
|
164
165
|
blockNumber: this.checkpoint,
|
|
@@ -168,7 +169,7 @@ export class IotaAddressContext extends MoveAccountContext<
|
|
|
168
169
|
chainId: this.getChainId(),
|
|
169
170
|
name: name,
|
|
170
171
|
labels: normalizeLabels(labels)
|
|
171
|
-
}
|
|
172
|
+
})
|
|
172
173
|
}
|
|
173
174
|
|
|
174
175
|
get client(): IotaClient {
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
type HandleInterval,
|
|
3
|
+
HandleIntervalSchema,
|
|
4
|
+
type MoveAccountFetchConfig,
|
|
5
|
+
type MoveFetchConfig,
|
|
6
|
+
TemplateInstanceSchema
|
|
7
|
+
} from '@sentio/protos'
|
|
8
|
+
import { create } from '@bufbuild/protobuf'
|
|
2
9
|
import { ListStateStorage, processMetrics } from '@sentio/runtime'
|
|
3
10
|
import { IotaAddressContext, IotaContext, IotaObjectContext } from './context.js'
|
|
4
11
|
import { IotaMoveObject, IotaTransactionBlockResponse } from '@iota/iota-sdk/client'
|
|
@@ -14,7 +21,7 @@ import {
|
|
|
14
21
|
} from './iota-object-processor.js'
|
|
15
22
|
import { IotaBindOptions } from './iota-processor.js'
|
|
16
23
|
import { TransactionFilter, accountAddressString } from '../move/index.js'
|
|
17
|
-
import {
|
|
24
|
+
import { ConnectError, Code } from '@connectrpc/connect'
|
|
18
25
|
import { getHandlerName, proxyProcessor } from '../utils/metrics.js'
|
|
19
26
|
|
|
20
27
|
class ObjectHandler<HandlerType> {
|
|
@@ -55,11 +62,11 @@ export abstract class IotaObjectOrAddressProcessorTemplate<
|
|
|
55
62
|
let id = (options as IotaObjectBindOptions).objectId || (options as IotaBindOptions).address
|
|
56
63
|
|
|
57
64
|
if (id === '*') {
|
|
58
|
-
throw new
|
|
65
|
+
throw new ConnectError("can't bind template instance with *", Code.InvalidArgument)
|
|
59
66
|
}
|
|
60
67
|
id = accountAddressString(id)
|
|
61
68
|
|
|
62
|
-
const instance
|
|
69
|
+
const instance = create(TemplateInstanceSchema, {
|
|
63
70
|
templateId: this.id,
|
|
64
71
|
contract: {
|
|
65
72
|
name: '',
|
|
@@ -70,7 +77,7 @@ export abstract class IotaObjectOrAddressProcessorTemplate<
|
|
|
70
77
|
startBlock: options.startCheckpoint || 0n,
|
|
71
78
|
endBlock: options.endCheckpoint || 0n,
|
|
72
79
|
baseLabels: options.baseLabels
|
|
73
|
-
}
|
|
80
|
+
})
|
|
74
81
|
|
|
75
82
|
ctx.sendTemplateInstance(instance)
|
|
76
83
|
|
|
@@ -92,7 +99,7 @@ export abstract class IotaObjectOrAddressProcessorTemplate<
|
|
|
92
99
|
let id = (options as IotaObjectBindOptions).objectId || (options as IotaBindOptions).address
|
|
93
100
|
|
|
94
101
|
if (id === '*') {
|
|
95
|
-
throw new
|
|
102
|
+
throw new ConnectError("can't bind template instance with *", Code.InvalidArgument)
|
|
96
103
|
}
|
|
97
104
|
id = accountAddressString(id)
|
|
98
105
|
|
|
@@ -123,7 +130,7 @@ export abstract class IotaObjectOrAddressProcessorTemplate<
|
|
|
123
130
|
let id = (options as IotaObjectBindOptions).objectId || (options as IotaBindOptions).address
|
|
124
131
|
|
|
125
132
|
if (id === '*') {
|
|
126
|
-
throw new
|
|
133
|
+
throw new ConnectError("can't delete template instance bind with *", Code.InvalidArgument)
|
|
127
134
|
}
|
|
128
135
|
id = accountAddressString(id)
|
|
129
136
|
|
|
@@ -147,9 +154,9 @@ export abstract class IotaObjectOrAddressProcessorTemplate<
|
|
|
147
154
|
}
|
|
148
155
|
|
|
149
156
|
if (deleted !== 1) {
|
|
150
|
-
throw new
|
|
151
|
-
|
|
152
|
-
|
|
157
|
+
throw new ConnectError(
|
|
158
|
+
`Failed to delete processor for template ${this.id}, ${sig}. deleted ${deleted} times`,
|
|
159
|
+
Code.InvalidArgument
|
|
153
160
|
)
|
|
154
161
|
}
|
|
155
162
|
|
|
@@ -161,7 +168,7 @@ export abstract class IotaObjectOrAddressProcessorTemplate<
|
|
|
161
168
|
}
|
|
162
169
|
})
|
|
163
170
|
ctx.sendTemplateInstance(
|
|
164
|
-
{
|
|
171
|
+
create(TemplateInstanceSchema, {
|
|
165
172
|
templateId: this.id,
|
|
166
173
|
contract: {
|
|
167
174
|
name: '',
|
|
@@ -172,7 +179,7 @@ export abstract class IotaObjectOrAddressProcessorTemplate<
|
|
|
172
179
|
startBlock: options.startCheckpoint || 0n,
|
|
173
180
|
endBlock: options.endCheckpoint || 0n,
|
|
174
181
|
baseLabels: options.baseLabels
|
|
175
|
-
},
|
|
182
|
+
}),
|
|
176
183
|
true
|
|
177
184
|
)
|
|
178
185
|
}
|
|
@@ -204,10 +211,10 @@ export abstract class IotaObjectOrAddressProcessorTemplate<
|
|
|
204
211
|
): this {
|
|
205
212
|
return this.onInterval(
|
|
206
213
|
handler,
|
|
207
|
-
{
|
|
214
|
+
create(HandleIntervalSchema, {
|
|
208
215
|
recentInterval: timeIntervalInMinutes,
|
|
209
216
|
backfillInterval: backfillTimeIntervalInMinutes
|
|
210
|
-
},
|
|
217
|
+
}),
|
|
211
218
|
undefined,
|
|
212
219
|
type,
|
|
213
220
|
fetchConfig
|
|
@@ -224,7 +231,10 @@ export abstract class IotaObjectOrAddressProcessorTemplate<
|
|
|
224
231
|
return this.onInterval(
|
|
225
232
|
handler,
|
|
226
233
|
undefined,
|
|
227
|
-
|
|
234
|
+
create(HandleIntervalSchema, {
|
|
235
|
+
recentInterval: checkpointInterval,
|
|
236
|
+
backfillInterval: backfillCheckpointInterval
|
|
237
|
+
}),
|
|
228
238
|
type,
|
|
229
239
|
fetchConfig
|
|
230
240
|
)
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
|
-
Data_SuiCall,
|
|
3
|
-
Data_SuiObject,
|
|
4
|
-
Data_SuiObjectChange,
|
|
5
|
-
HandleInterval,
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
type Data_SuiCall,
|
|
3
|
+
type Data_SuiObject,
|
|
4
|
+
type Data_SuiObjectChange,
|
|
5
|
+
type HandleInterval,
|
|
6
|
+
HandleIntervalSchema,
|
|
7
|
+
type MoveAccountFetchConfig,
|
|
8
|
+
MoveAccountFetchConfigSchema,
|
|
9
|
+
type MoveFetchConfig,
|
|
10
|
+
MoveFetchConfigSchema,
|
|
8
11
|
MoveOwnerType,
|
|
9
|
-
ProcessResult
|
|
12
|
+
type ProcessResult,
|
|
13
|
+
timestampDate
|
|
10
14
|
} from '@sentio/protos'
|
|
15
|
+
import { create } from '@bufbuild/protobuf'
|
|
11
16
|
import { ListStateStorage } from '@sentio/runtime'
|
|
12
17
|
import { IotaNetwork } from './network.js'
|
|
13
18
|
import { IotaAddressContext, IotaContext, IotaObjectChangeContext, IotaObjectContext } from './context.js'
|
|
@@ -15,7 +20,7 @@ import { IotaMoveObject, IotaObjectChange, IotaTransactionBlockResponse } from '
|
|
|
15
20
|
import { ALL_ADDRESS, PromiseOrVoid } from '../core/index.js'
|
|
16
21
|
import { configure, DEFAULT_FETCH_CONFIG, IndexConfigure, IotaBindOptions } from './iota-processor.js'
|
|
17
22
|
import { CallHandler, TransactionFilter, accountTypeString, ObjectChangeHandler } from '../move/index.js'
|
|
18
|
-
import {
|
|
23
|
+
import { ConnectError, Code } from '@connectrpc/connect'
|
|
19
24
|
import { TypeDescriptor } from '@typemove/move'
|
|
20
25
|
import { TypedIotaMoveObject } from './models.js'
|
|
21
26
|
import { getHandlerName, proxyProcessor } from '../utils/metrics.js'
|
|
@@ -45,9 +50,9 @@ interface ObjectHandler {
|
|
|
45
50
|
handlerName: string
|
|
46
51
|
}
|
|
47
52
|
|
|
48
|
-
export const DEFAULT_ACCOUNT_FETCH_CONFIG: MoveAccountFetchConfig = {
|
|
53
|
+
export const DEFAULT_ACCOUNT_FETCH_CONFIG: MoveAccountFetchConfig = create(MoveAccountFetchConfigSchema, {
|
|
49
54
|
owned: false
|
|
50
|
-
}
|
|
55
|
+
})
|
|
51
56
|
|
|
52
57
|
export class IotaAccountProcessorState extends ListStateStorage<IotaBaseObjectOrAddressProcessor<any>> {
|
|
53
58
|
static INSTANCE = new IotaAccountProcessorState()
|
|
@@ -112,7 +117,7 @@ export abstract class IotaBaseObjectOrAddressProcessor<HandlerType> {
|
|
|
112
117
|
data.objectId,
|
|
113
118
|
data.objectVersion,
|
|
114
119
|
data.slot,
|
|
115
|
-
data.timestamp
|
|
120
|
+
data.timestamp ? timestampDate(data.timestamp) : new Date(0),
|
|
116
121
|
processor.config.baseLabels
|
|
117
122
|
)
|
|
118
123
|
await processor.doHandle(handler, data, ctx)
|
|
@@ -139,10 +144,10 @@ abstract class IotaBaseObjectOrAddressProcessorInternal<
|
|
|
139
144
|
): this {
|
|
140
145
|
return this.onInterval(
|
|
141
146
|
handler,
|
|
142
|
-
{
|
|
147
|
+
create(HandleIntervalSchema, {
|
|
143
148
|
recentInterval: timeIntervalInMinutes,
|
|
144
149
|
backfillInterval: backfillTimeIntervalInMinutes
|
|
145
|
-
},
|
|
150
|
+
}),
|
|
146
151
|
undefined,
|
|
147
152
|
type,
|
|
148
153
|
fetchConfig
|
|
@@ -159,7 +164,10 @@ abstract class IotaBaseObjectOrAddressProcessorInternal<
|
|
|
159
164
|
return this.onInterval(
|
|
160
165
|
handler,
|
|
161
166
|
undefined,
|
|
162
|
-
|
|
167
|
+
create(HandleIntervalSchema, {
|
|
168
|
+
recentInterval: checkpointInterval,
|
|
169
|
+
backfillInterval: backfillCheckpointInterval
|
|
170
|
+
}),
|
|
163
171
|
type,
|
|
164
172
|
fetchConfig
|
|
165
173
|
)
|
|
@@ -188,7 +196,7 @@ export class IotaAddressProcessor extends IotaBaseObjectOrAddressProcessorIntern
|
|
|
188
196
|
filter?: TransactionFilter,
|
|
189
197
|
fetchConfig?: Partial<MoveFetchConfig>
|
|
190
198
|
) {
|
|
191
|
-
const _fetchConfig =
|
|
199
|
+
const _fetchConfig = create(MoveFetchConfigSchema, { ...DEFAULT_FETCH_CONFIG, ...fetchConfig })
|
|
192
200
|
const _filter: TransactionFilter = {
|
|
193
201
|
fromAndToAddress: {
|
|
194
202
|
from: '',
|
|
@@ -203,7 +211,7 @@ export class IotaAddressProcessor extends IotaBaseObjectOrAddressProcessorIntern
|
|
|
203
211
|
handlerName: getHandlerName(),
|
|
204
212
|
handler: async function (data) {
|
|
205
213
|
if (!data.rawTransaction) {
|
|
206
|
-
throw new
|
|
214
|
+
throw new ConnectError('transaction is null', Code.InvalidArgument)
|
|
207
215
|
}
|
|
208
216
|
const tx = JSON.parse(data.rawTransaction) as IotaTransactionBlockResponse
|
|
209
217
|
|
|
@@ -211,7 +219,7 @@ export class IotaAddressProcessor extends IotaBaseObjectOrAddressProcessorIntern
|
|
|
211
219
|
'object',
|
|
212
220
|
processor.config.network,
|
|
213
221
|
processor.config.address,
|
|
214
|
-
data.timestamp
|
|
222
|
+
data.timestamp ? timestampDate(data.timestamp) : new Date(0),
|
|
215
223
|
data.slot,
|
|
216
224
|
tx,
|
|
217
225
|
0,
|
|
@@ -297,7 +305,7 @@ export class IotaObjectTypeProcessor<T> extends IotaBaseObjectOrAddressProcessor
|
|
|
297
305
|
|
|
298
306
|
public onObjectChange(handler: (changes: IotaObjectChange[], ctx: IotaObjectChangeContext) => PromiseOrVoid): this {
|
|
299
307
|
if (this.config.network === IotaNetwork.TEST_NET) {
|
|
300
|
-
throw new
|
|
308
|
+
throw new ConnectError('object change not supported in testnet', Code.InvalidArgument)
|
|
301
309
|
}
|
|
302
310
|
const processor = this
|
|
303
311
|
this.objectChangeHandlers.push({
|
|
@@ -306,7 +314,7 @@ export class IotaObjectTypeProcessor<T> extends IotaBaseObjectOrAddressProcessor
|
|
|
306
314
|
const ctx = new IotaObjectChangeContext(
|
|
307
315
|
processor.config.network,
|
|
308
316
|
processor.config.address,
|
|
309
|
-
data.timestamp
|
|
317
|
+
data.timestamp ? timestampDate(data.timestamp) : new Date(0),
|
|
310
318
|
data.slot,
|
|
311
319
|
data.txDigest,
|
|
312
320
|
processor.config.baseLabels
|
|
@@ -332,10 +340,10 @@ export class IotaObjectTypeProcessor<T> extends IotaBaseObjectOrAddressProcessor
|
|
|
332
340
|
): this {
|
|
333
341
|
return this.onInterval(
|
|
334
342
|
handler,
|
|
335
|
-
{
|
|
343
|
+
create(HandleIntervalSchema, {
|
|
336
344
|
recentInterval: timeIntervalInMinutes,
|
|
337
345
|
backfillInterval: backfillTimeIntervalInMinutes
|
|
338
|
-
},
|
|
346
|
+
}),
|
|
339
347
|
undefined,
|
|
340
348
|
this.objectType.getSignature(),
|
|
341
349
|
fetchConfig
|
|
@@ -355,7 +363,10 @@ export class IotaObjectTypeProcessor<T> extends IotaBaseObjectOrAddressProcessor
|
|
|
355
363
|
return this.onInterval(
|
|
356
364
|
handler,
|
|
357
365
|
undefined,
|
|
358
|
-
|
|
366
|
+
create(HandleIntervalSchema, {
|
|
367
|
+
recentInterval: checkpointInterval,
|
|
368
|
+
backfillInterval: backfillCheckpointInterval
|
|
369
|
+
}),
|
|
359
370
|
this.objectType.qname,
|
|
360
371
|
fetchConfig
|
|
361
372
|
)
|