@sentio/sdk 2.16.0-rc.1 → 2.16.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.
@@ -2,9 +2,12 @@ import { Plugin, PluginManager } from '@sentio/runtime';
2
2
  import { MetricState } from './meter.js';
3
3
  import { ExporterState } from './exporter.js';
4
4
  import { EventTrackerState } from './event-tracker.js';
5
+ import { TemplateInstanceState } from './template.js';
5
6
  export class CorePlugin extends Plugin {
6
7
  name = 'CorePlugin';
7
8
  async configure(config) {
9
+ // This syntax is to copy values instead of using references
10
+ config.templateInstances = [...TemplateInstanceState.INSTANCE.getValues()];
8
11
  for (const metric of MetricState.INSTANCE.getValues()) {
9
12
  config.metricConfigs.push({
10
13
  ...metric.config,
@@ -1 +1 @@
1
- {"version":3,"file":"core-plugin.js","sourceRoot":"","sources":["../../src/core/core-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAGvD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAEtD,MAAM,OAAO,UAAW,SAAQ,MAAM;IACpC,IAAI,GAAW,YAAY,CAAA;IAE3B,KAAK,CAAC,SAAS,CAAC,MAA6B;QAC3C,KAAK,MAAM,MAAM,IAAI,WAAW,CAAC,QAAQ,CAAC,SAAS,EAAE,EAAE;YACrD,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC;gBACxB,GAAG,MAAM,CAAC,MAAM;aACjB,CAAC,CAAA;SACH;QAED,mDAAmD;QACnD,KAAK,MAAM,YAAY,IAAI,iBAAiB,CAAC,QAAQ,CAAC,SAAS,EAAE,EAAE;YACjE,MAAM,CAAC,oBAAoB,CAAC,IAAI,CAAC;gBAC/B,yBAAyB,EAAE,YAAY,CAAC,OAAO,CAAC,cAAc,IAAI,EAAE;gBACpE,SAAS,EAAE,YAAY,CAAC,IAAI;gBAC5B,eAAe,EAAE,SAAS;gBAC1B,UAAU,EAAE,YAAY,CAAC,OAAO,CAAC,UAAU,IAAI,KAAK;gBACpD,cAAc,EAAE,SAAS;gBACzB,MAAM,EAAE,YAAY,CAAC,OAAO,CAAC,MAAM,IAAI,KAAK;aAC7C,CAAC,CAAA;SACH;QAED,KAAK,MAAM,QAAQ,IAAI,aAAa,CAAC,QAAQ,CAAC,SAAS,EAAE,EAAE;YACzD,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC;gBACxB,IAAI,EAAE,QAAQ,CAAC,IAAI;gBACnB,OAAO,EAAE,QAAQ,CAAC,OAAO;aAC1B,CAAC,CAAA;SACH;IACH,CAAC;CACF;AAED,aAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,UAAU,EAAE,CAAC,CAAA","sourcesContent":["import { Plugin, PluginManager } from '@sentio/runtime'\nimport { ProcessConfigResponse } from '@sentio/protos'\n\nimport { MetricState } from './meter.js'\nimport { ExporterState } from './exporter.js'\nimport { EventTrackerState } from './event-tracker.js'\n\nexport class CorePlugin extends Plugin {\n name: string = 'CorePlugin'\n\n async configure(config: ProcessConfigResponse): Promise<void> {\n for (const metric of MetricState.INSTANCE.getValues()) {\n config.metricConfigs.push({\n ...metric.config,\n })\n }\n\n // eslint-disable-next-line deprecation/deprecation\n for (const eventTracker of EventTrackerState.INSTANCE.getValues()) {\n config.eventTrackingConfigs.push({\n distinctAggregationByDays: eventTracker.options.distinctByDays || [],\n eventName: eventTracker.name,\n retentionConfig: undefined,\n totalByDay: eventTracker.options.totalByDay || false,\n totalPerEntity: undefined,\n unique: eventTracker.options.unique || false,\n })\n }\n\n for (const exporter of ExporterState.INSTANCE.getValues()) {\n config.exportConfigs.push({\n name: exporter.name,\n channel: exporter.channel,\n })\n }\n }\n}\n\nPluginManager.INSTANCE.register(new CorePlugin())\n"]}
1
+ {"version":3,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MAAM,CAAC,aAAa,CAAC,IAAI,CAAC;gBACxB,IAAI,EAAE,QAAQ,CAAC,IAAI;gBACnB,OAAO,EAAE,QAAQ,CAAC,OAAO;aAC1B,CAAC,CAAA;SACH;IACH,CAAC;CACF;AAED,aAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,UAAU,EAAE,CAAC,CAAA","sourcesContent":["import { Plugin, PluginManager } from '@sentio/runtime'\nimport { ProcessConfigResponse } from '@sentio/protos'\n\nimport { MetricState } from './meter.js'\nimport { ExporterState } from './exporter.js'\nimport { EventTrackerState } from './event-tracker.js'\nimport { TemplateInstanceState } from './template.js'\n\nexport class CorePlugin extends Plugin {\n name: string = 'CorePlugin'\n\n async configure(config: ProcessConfigResponse): Promise<void> {\n // This syntax is to copy values instead of using references\n config.templateInstances = [...TemplateInstanceState.INSTANCE.getValues()]\n\n for (const metric of MetricState.INSTANCE.getValues()) {\n config.metricConfigs.push({\n ...metric.config,\n })\n }\n\n // eslint-disable-next-line deprecation/deprecation\n for (const eventTracker of EventTrackerState.INSTANCE.getValues()) {\n config.eventTrackingConfigs.push({\n distinctAggregationByDays: eventTracker.options.distinctByDays || [],\n eventName: eventTracker.name,\n retentionConfig: undefined,\n totalByDay: eventTracker.options.totalByDay || false,\n totalPerEntity: undefined,\n unique: eventTracker.options.unique || false,\n })\n }\n\n for (const exporter of ExporterState.INSTANCE.getValues()) {\n config.exportConfigs.push({\n name: exporter.name,\n channel: exporter.channel,\n })\n }\n }\n}\n\nPluginManager.INSTANCE.register(new CorePlugin())\n"]}
@@ -24,8 +24,6 @@ export class EthPlugin extends Plugin {
24
24
  traceHandlers: [],
25
25
  transactionHandlers: [],
26
26
  };
27
- // This syntax is to copy values instead of using references
28
- config.templateInstances = [...TemplateInstanceState.INSTANCE.getValues()];
29
27
  for (const processor of ProcessorState.INSTANCE.getValues()) {
30
28
  // If server favor incremental update this need to change
31
29
  // Start basic config for contract
@@ -1 +1 @@
1
- {"version":3,"file":"eth-plugin.js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cessResults, Plugin, PluginManager, USER_PROCESSOR } from '@sentio/runtime'\nimport {\n AccountConfig,\n ContractConfig,\n Data_EthBlock,\n Data_EthLog,\n Data_EthTrace,\n Data_EthTransaction,\n DataBinding,\n HandlerType,\n LogFilter,\n LogHandlerConfig,\n ProcessConfigResponse,\n ProcessResult,\n StartRequest,\n} from '@sentio/protos'\n\nimport { ServerError, Status } from 'nice-grpc'\nimport { ProcessorState } from './binds.js'\nimport { AccountProcessorState } from './account-processor-state.js'\nimport { ProcessorTemplateProcessorState } from './base-processor-template.js'\nimport { GlobalProcessorState } from './base-processor.js'\nimport { validateAndNormalizeAddress } from './eth.js'\nimport { EthChainId } from '../core/chain.js'\nimport { EthContext } from './context.js'\nimport { TemplateInstanceState } from '../core/template.js'\n\ninterface Handlers {\n eventHandlers: ((event: Data_EthLog) => Promise<ProcessResult>)[]\n traceHandlers: ((trace: Data_EthTrace) => Promise<ProcessResult>)[]\n blockHandlers: ((block: Data_EthBlock) => Promise<ProcessResult>)[]\n transactionHandlers: ((trace: Data_EthTransaction) => Promise<ProcessResult>)[]\n}\n\nexport class EthPlugin extends Plugin {\n name: string = 'EthPlugin'\n handlers: Handlers = {\n blockHandlers: [],\n eventHandlers: [],\n traceHandlers: [],\n transactionHandlers: [],\n }\n\n async configure(config: ProcessConfigResponse) {\n const handlers: Handlers = {\n blockHandlers: [],\n eventHandlers: [],\n traceHandlers: [],\n transactionHandlers: [],\n }\n // This syntax is to copy values instead of using references\n config.templateInstances = [...TemplateInstanceState.INSTANCE.getValues()]\n\n for (const processor of ProcessorState.INSTANCE.getValues()) {\n // If server favor incremental update this need to change\n // Start basic config for contract\n const chainId = processor.getChainId()\n // this.processorsByChainId.set(chainId, processor)\n\n const contractConfig = ContractConfig.fromPartial({\n processorType: USER_PROCESSOR,\n contract: {\n name: processor.config.name,\n chainId: chainId.toString(),\n address: validateAndNormalizeAddress(processor.config.address),\n abi: '',\n },\n startBlock: processor.config.startBlock,\n endBlock: processor.config.endBlock,\n })\n\n // Step 1. Prepare all the block handlers\n for (const blockHandler of processor.blockHandlers) {\n const handlerId = handlers.blockHandlers.push(blockHandler.handler) - 1\n // TODO wrap the block handler into one\n\n contractConfig.intervalConfigs.push({\n slot: 0,\n slotInterval: blockHandler.blockInterval,\n minutes: 0,\n minutesInterval: blockHandler.timeIntervalInMinutes,\n handlerId: handlerId,\n fetchConfig: blockHandler.fetchConfig,\n })\n }\n\n // Step 2. Prepare all trace handlers\n for (const traceHandler of processor.traceHandlers) {\n const handlerId = handlers.traceHandlers.push(traceHandler.handler) - 1\n for (const signature of traceHandler.signatures) {\n contractConfig.traceConfigs.push({\n signature: signature,\n handlerId: handlerId,\n fetchConfig: traceHandler.fetchConfig,\n })\n }\n }\n\n // Step 3. Prepare all the event handlers\n for (const eventsHandler of processor.eventHandlers) {\n // associate id with filter\n const handlerId = handlers.eventHandlers.push(eventsHandler.handler) - 1\n const logConfig: LogHandlerConfig = {\n handlerId: handlerId,\n filters: [],\n fetchConfig: eventsHandler.fetchConfig,\n }\n\n for (const filter of eventsHandler.filters) {\n const topics = await filter.getTopicFilter()\n\n // if (!filter.topics) {\n // throw new ServerError(Status.INVALID_ARGUMENT, 'Topic should not be null')\n // }\n const logFilter: LogFilter = {\n addressType: undefined,\n address: contractConfig.contract?.address && validateAndNormalizeAddress(contractConfig.contract.address),\n topics: [],\n }\n\n for (const ts of topics) {\n let hashes: string[] = []\n if (Array.isArray(ts)) {\n hashes = hashes.concat(ts)\n } else if (ts) {\n hashes.push(ts)\n }\n logFilter.topics.push({ hashes: hashes })\n }\n logConfig.filters.push(logFilter)\n }\n contractConfig.logConfigs.push(logConfig)\n }\n\n // Finish up a contract\n config.contractConfigs.push(contractConfig)\n }\n\n for (const processor of GlobalProcessorState.INSTANCE.getValues()) {\n const chainId = processor.getChainId()\n\n const contractConfig = ContractConfig.fromPartial({\n processorType: USER_PROCESSOR,\n contract: {\n name: processor.config.name,\n chainId: chainId.toString(),\n address: processor.config.address, // can only be *\n abi: '',\n },\n startBlock: processor.config.startBlock,\n endBlock: processor.config.endBlock,\n })\n\n for (const blockHandler of processor.blockHandlers) {\n const handlerId = handlers.blockHandlers.push(blockHandler.handler) - 1\n contractConfig.intervalConfigs.push({\n slot: 0,\n slotInterval: blockHandler.blockInterval,\n minutes: 0,\n minutesInterval: blockHandler.timeIntervalInMinutes,\n handlerId: handlerId,\n fetchConfig: blockHandler.fetchConfig,\n })\n }\n\n for (const transactionHandler of processor.transactionHandler) {\n const handlerId = handlers.transactionHandlers.push(transactionHandler.handler) - 1\n contractConfig.transactionConfig.push({\n handlerId: handlerId,\n fetchConfig: transactionHandler.fetchConfig,\n })\n }\n config.contractConfigs.push(contractConfig)\n }\n\n // part 1.b prepare EVM account processors\n for (const processor of AccountProcessorState.INSTANCE.getValues()) {\n const accountConfig = AccountConfig.fromPartial({\n address: validateAndNormalizeAddress(processor.config.address),\n chainId: processor.getChainId().toString(),\n startBlock: processor.config.startBlock ? BigInt(processor.config.startBlock) : 0n,\n })\n // TODO add interval\n for (const eventsHandler of processor.eventHandlers) {\n // associate id with filter\n const handlerId = handlers.eventHandlers.push(eventsHandler.handler) - 1\n const logConfig: LogHandlerConfig = {\n handlerId: handlerId,\n filters: [],\n fetchConfig: eventsHandler.fetchConfig,\n }\n\n for (const filter of eventsHandler.filters) {\n const topics = await filter.getTopicFilter()\n // if (!filter.topics) {\n // throw new ServerError(Status.INVALID_ARGUMENT, 'Topic should not be null')\n // }\n let address = undefined\n if (filter.address) {\n address = filter.address.toString()\n }\n const logFilter: LogFilter = {\n addressType: filter.addressType,\n address: address && validateAndNormalizeAddress(address),\n topics: [],\n }\n\n for (const ts of topics) {\n let hashes: string[] = []\n if (Array.isArray(ts)) {\n hashes = hashes.concat(ts)\n } else if (ts) {\n hashes.push(ts)\n }\n logFilter.topics.push({ hashes: hashes })\n }\n logConfig.filters.push(logFilter)\n }\n accountConfig.logConfigs.push(logConfig)\n }\n\n config.accountConfigs.push(accountConfig)\n }\n\n this.handlers = handlers\n }\n\n supportedHandlers = [HandlerType.ETH_LOG, HandlerType.ETH_BLOCK, HandlerType.ETH_TRACE, HandlerType.ETH_TRANSACTION]\n\n processBinding(request: DataBinding): Promise<ProcessResult> {\n // return Promise.resolve(undefined);\n switch (request.handlerType) {\n case HandlerType.ETH_LOG:\n return this.processLog(request)\n case HandlerType.ETH_TRACE:\n return this.processTrace(request)\n case HandlerType.ETH_BLOCK:\n return this.processBlock(request)\n case HandlerType.ETH_TRANSACTION:\n return this.processTransaction(request)\n default:\n throw new ServerError(Status.INVALID_ARGUMENT, 'No handle type registered ' + request.handlerType)\n }\n }\n\n async start(request: StartRequest) {\n const ctx = new NoopContext()\n const allowedChainIds = new Set<string>(Object.values(EthChainId))\n\n for (const instance of request.templateInstances) {\n if (!allowedChainIds.has(instance.contract?.chainId || '')) {\n continue\n }\n\n const template = ProcessorTemplateProcessorState.INSTANCE.getValues()[instance.templateId]\n if (!template) {\n throw new ServerError(Status.INVALID_ARGUMENT, 'Invalid template contract:' + instance)\n }\n if (!instance.contract) {\n throw new ServerError(Status.INVALID_ARGUMENT, 'Contract Empty from:' + instance)\n }\n template.bind(\n {\n name: instance.contract.name,\n address: validateAndNormalizeAddress(instance.contract.address),\n network: instance.contract.chainId as EthChainId,\n startBlock: instance.startBlock,\n endBlock: instance.endBlock,\n },\n ctx\n )\n }\n }\n\n stateDiff(config: ProcessConfigResponse): boolean {\n return TemplateInstanceState.INSTANCE.getValues().length !== config.templateInstances.length\n }\n\n async processLog(request: DataBinding): Promise<ProcessResult> {\n if (!request.data?.ethLog?.log) {\n throw new ServerError(Status.INVALID_ARGUMENT, \"Log can't be null\")\n }\n const ethLog = request.data.ethLog\n\n const promises: Promise<ProcessResult>[] = []\n for (const handlerId of request.handlerIds) {\n const handler = this.handlers.eventHandlers[handlerId]\n promises.push(\n handler(ethLog).catch((e) => {\n throw new ServerError(\n Status.INTERNAL,\n 'error processing log: ' + JSON.stringify(ethLog.log) + '\\n' + errorString(e)\n )\n })\n )\n }\n return mergeProcessResults(await Promise.all(promises))\n }\n\n async processTrace(binding: DataBinding): Promise<ProcessResult> {\n if (!binding.data?.ethTrace?.trace) {\n throw new ServerError(Status.INVALID_ARGUMENT, \"Trace can't be null\")\n }\n const ethTrace = binding.data.ethTrace\n\n const promises: Promise<ProcessResult>[] = []\n\n for (const handlerId of binding.handlerIds) {\n promises.push(\n this.handlers.traceHandlers[handlerId](ethTrace).catch((e) => {\n throw new ServerError(\n Status.INTERNAL,\n 'error processing trace: ' + JSON.stringify(ethTrace.trace) + '\\n' + errorString(e)\n )\n })\n )\n }\n return mergeProcessResults(await Promise.all(promises))\n }\n\n async processBlock(binding: DataBinding): Promise<ProcessResult> {\n if (!binding.data?.ethBlock?.block) {\n throw new ServerError(Status.INVALID_ARGUMENT, \"Block can't be empty\")\n }\n const ethBlock = binding.data.ethBlock\n\n const promises: Promise<ProcessResult>[] = []\n for (const handlerId of binding.handlerIds) {\n promises.push(\n this.handlers.blockHandlers[handlerId](ethBlock).catch((e) => {\n throw new ServerError(\n Status.INTERNAL,\n 'error processing block: ' + ethBlock.block?.number + '\\n' + errorString(e)\n )\n })\n )\n }\n return mergeProcessResults(await Promise.all(promises))\n }\n\n async processTransaction(binding: DataBinding): Promise<ProcessResult> {\n if (!binding.data?.ethTransaction?.transaction) {\n throw new ServerError(Status.INVALID_ARGUMENT, \"transaction can't be null\")\n }\n const ethTransaction = binding.data.ethTransaction\n\n const promises: Promise<ProcessResult>[] = []\n\n for (const handlerId of binding.handlerIds) {\n promises.push(\n this.handlers.transactionHandlers[handlerId](ethTransaction).catch((e) => {\n throw new ServerError(\n Status.INTERNAL,\n 'error processing transaction: ' + JSON.stringify(ethTransaction.transaction) + '\\n' + errorString(e)\n )\n })\n )\n }\n return mergeProcessResults(await Promise.all(promises))\n }\n}\n\nPluginManager.INSTANCE.register(new EthPlugin())\n\nclass NoopContext extends EthContext {\n public constructor() {\n super(EthChainId.ETHEREUM, '')\n }\n\n protected getContractName(): string {\n return ''\n }\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,CACH,CAAA;SACF;QACD,OAAO,mBAAmB,CAAC,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAA;IACzD,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,OAAoB;QAC3C,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,cAAc,EAAE,WAAW,EAAE;YAC9C,MAAM,IAAI,WAAW,CAAC,MAAM,CAAC,gBAAgB,EAAE,2BAA2B,CAAC,CAAA;SAC5E;QACD,MAAM,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,cAAc,CAAA;QAElD,MAAM,QAAQ,GAA6B,EAAE,CAAA;QAE7C,KAAK,MAAM,SAAS,IAAI,OAAO,CAAC,UAAU,EAAE;YAC1C,QAAQ,CAAC,IAAI,CACX,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC,cAAc,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;gBACvE,MAAM,IAAI,WAAW,CACnB,MAAM,CAAC,QAAQ,EACf,gCAAgC,GAAG,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,WAAW,CAAC,GAAG,IAAI,GAAG,WAAW,CAAC,CAAC,CAAC,CACtG,CAAA;YACH,CAAC,CAAC,CACH,CAAA;SACF;QACD,OAAO,mBAAmB,CAAC,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAA;IACzD,CAAC;CACF;AAED,aAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,SAAS,EAAE,CAAC,CAAA;AAEhD,MAAM,WAAY,SAAQ,UAAU;IAClC;QACE,KAAK,CAAC,UAAU,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;IAChC,CAAC;IAES,eAAe;QACvB,OAAO,EAAE,CAAA;IACX,CAAC;CACF","sourcesContent":["import { errorString, mergeProcessResults, Plugin, PluginManager, USER_PROCESSOR } from '@sentio/runtime'\nimport {\n AccountConfig,\n ContractConfig,\n Data_EthBlock,\n Data_EthLog,\n Data_EthTrace,\n Data_EthTransaction,\n DataBinding,\n HandlerType,\n LogFilter,\n LogHandlerConfig,\n ProcessConfigResponse,\n ProcessResult,\n StartRequest,\n} from '@sentio/protos'\n\nimport { ServerError, Status } from 'nice-grpc'\nimport { ProcessorState } from './binds.js'\nimport { AccountProcessorState } from './account-processor-state.js'\nimport { ProcessorTemplateProcessorState } from './base-processor-template.js'\nimport { GlobalProcessorState } from './base-processor.js'\nimport { validateAndNormalizeAddress } from './eth.js'\nimport { EthChainId } from '../core/chain.js'\nimport { EthContext } from './context.js'\nimport { TemplateInstanceState } from '../core/template.js'\n\ninterface Handlers {\n eventHandlers: ((event: Data_EthLog) => Promise<ProcessResult>)[]\n traceHandlers: ((trace: Data_EthTrace) => Promise<ProcessResult>)[]\n blockHandlers: ((block: Data_EthBlock) => Promise<ProcessResult>)[]\n transactionHandlers: ((trace: Data_EthTransaction) => Promise<ProcessResult>)[]\n}\n\nexport class EthPlugin extends Plugin {\n name: string = 'EthPlugin'\n handlers: Handlers = {\n blockHandlers: [],\n eventHandlers: [],\n traceHandlers: [],\n transactionHandlers: [],\n }\n\n async configure(config: ProcessConfigResponse) {\n const handlers: Handlers = {\n blockHandlers: [],\n eventHandlers: [],\n traceHandlers: [],\n transactionHandlers: [],\n }\n\n for (const processor of ProcessorState.INSTANCE.getValues()) {\n // If server favor incremental update this need to change\n // Start basic config for contract\n const chainId = processor.getChainId()\n // this.processorsByChainId.set(chainId, processor)\n\n const contractConfig = ContractConfig.fromPartial({\n processorType: USER_PROCESSOR,\n contract: {\n name: processor.config.name,\n chainId: chainId.toString(),\n address: validateAndNormalizeAddress(processor.config.address),\n abi: '',\n },\n startBlock: processor.config.startBlock,\n endBlock: processor.config.endBlock,\n })\n\n // Step 1. Prepare all the block handlers\n for (const blockHandler of processor.blockHandlers) {\n const handlerId = handlers.blockHandlers.push(blockHandler.handler) - 1\n // TODO wrap the block handler into one\n\n contractConfig.intervalConfigs.push({\n slot: 0,\n slotInterval: blockHandler.blockInterval,\n minutes: 0,\n minutesInterval: blockHandler.timeIntervalInMinutes,\n handlerId: handlerId,\n fetchConfig: blockHandler.fetchConfig,\n })\n }\n\n // Step 2. Prepare all trace handlers\n for (const traceHandler of processor.traceHandlers) {\n const handlerId = handlers.traceHandlers.push(traceHandler.handler) - 1\n for (const signature of traceHandler.signatures) {\n contractConfig.traceConfigs.push({\n signature: signature,\n handlerId: handlerId,\n fetchConfig: traceHandler.fetchConfig,\n })\n }\n }\n\n // Step 3. Prepare all the event handlers\n for (const eventsHandler of processor.eventHandlers) {\n // associate id with filter\n const handlerId = handlers.eventHandlers.push(eventsHandler.handler) - 1\n const logConfig: LogHandlerConfig = {\n handlerId: handlerId,\n filters: [],\n fetchConfig: eventsHandler.fetchConfig,\n }\n\n for (const filter of eventsHandler.filters) {\n const topics = await filter.getTopicFilter()\n\n // if (!filter.topics) {\n // throw new ServerError(Status.INVALID_ARGUMENT, 'Topic should not be null')\n // }\n const logFilter: LogFilter = {\n addressType: undefined,\n address: contractConfig.contract?.address && validateAndNormalizeAddress(contractConfig.contract.address),\n topics: [],\n }\n\n for (const ts of topics) {\n let hashes: string[] = []\n if (Array.isArray(ts)) {\n hashes = hashes.concat(ts)\n } else if (ts) {\n hashes.push(ts)\n }\n logFilter.topics.push({ hashes: hashes })\n }\n logConfig.filters.push(logFilter)\n }\n contractConfig.logConfigs.push(logConfig)\n }\n\n // Finish up a contract\n config.contractConfigs.push(contractConfig)\n }\n\n for (const processor of GlobalProcessorState.INSTANCE.getValues()) {\n const chainId = processor.getChainId()\n\n const contractConfig = ContractConfig.fromPartial({\n processorType: USER_PROCESSOR,\n contract: {\n name: processor.config.name,\n chainId: chainId.toString(),\n address: processor.config.address, // can only be *\n abi: '',\n },\n startBlock: processor.config.startBlock,\n endBlock: processor.config.endBlock,\n })\n\n for (const blockHandler of processor.blockHandlers) {\n const handlerId = handlers.blockHandlers.push(blockHandler.handler) - 1\n contractConfig.intervalConfigs.push({\n slot: 0,\n slotInterval: blockHandler.blockInterval,\n minutes: 0,\n minutesInterval: blockHandler.timeIntervalInMinutes,\n handlerId: handlerId,\n fetchConfig: blockHandler.fetchConfig,\n })\n }\n\n for (const transactionHandler of processor.transactionHandler) {\n const handlerId = handlers.transactionHandlers.push(transactionHandler.handler) - 1\n contractConfig.transactionConfig.push({\n handlerId: handlerId,\n fetchConfig: transactionHandler.fetchConfig,\n })\n }\n config.contractConfigs.push(contractConfig)\n }\n\n // part 1.b prepare EVM account processors\n for (const processor of AccountProcessorState.INSTANCE.getValues()) {\n const accountConfig = AccountConfig.fromPartial({\n address: validateAndNormalizeAddress(processor.config.address),\n chainId: processor.getChainId().toString(),\n startBlock: processor.config.startBlock ? BigInt(processor.config.startBlock) : 0n,\n })\n // TODO add interval\n for (const eventsHandler of processor.eventHandlers) {\n // associate id with filter\n const handlerId = handlers.eventHandlers.push(eventsHandler.handler) - 1\n const logConfig: LogHandlerConfig = {\n handlerId: handlerId,\n filters: [],\n fetchConfig: eventsHandler.fetchConfig,\n }\n\n for (const filter of eventsHandler.filters) {\n const topics = await filter.getTopicFilter()\n // if (!filter.topics) {\n // throw new ServerError(Status.INVALID_ARGUMENT, 'Topic should not be null')\n // }\n let address = undefined\n if (filter.address) {\n address = filter.address.toString()\n }\n const logFilter: LogFilter = {\n addressType: filter.addressType,\n address: address && validateAndNormalizeAddress(address),\n topics: [],\n }\n\n for (const ts of topics) {\n let hashes: string[] = []\n if (Array.isArray(ts)) {\n hashes = hashes.concat(ts)\n } else if (ts) {\n hashes.push(ts)\n }\n logFilter.topics.push({ hashes: hashes })\n }\n logConfig.filters.push(logFilter)\n }\n accountConfig.logConfigs.push(logConfig)\n }\n\n config.accountConfigs.push(accountConfig)\n }\n\n this.handlers = handlers\n }\n\n supportedHandlers = [HandlerType.ETH_LOG, HandlerType.ETH_BLOCK, HandlerType.ETH_TRACE, HandlerType.ETH_TRANSACTION]\n\n processBinding(request: DataBinding): Promise<ProcessResult> {\n // return Promise.resolve(undefined);\n switch (request.handlerType) {\n case HandlerType.ETH_LOG:\n return this.processLog(request)\n case HandlerType.ETH_TRACE:\n return this.processTrace(request)\n case HandlerType.ETH_BLOCK:\n return this.processBlock(request)\n case HandlerType.ETH_TRANSACTION:\n return this.processTransaction(request)\n default:\n throw new ServerError(Status.INVALID_ARGUMENT, 'No handle type registered ' + request.handlerType)\n }\n }\n\n async start(request: StartRequest) {\n const ctx = new NoopContext()\n const allowedChainIds = new Set<string>(Object.values(EthChainId))\n\n for (const instance of request.templateInstances) {\n if (!allowedChainIds.has(instance.contract?.chainId || '')) {\n continue\n }\n\n const template = ProcessorTemplateProcessorState.INSTANCE.getValues()[instance.templateId]\n if (!template) {\n throw new ServerError(Status.INVALID_ARGUMENT, 'Invalid template contract:' + instance)\n }\n if (!instance.contract) {\n throw new ServerError(Status.INVALID_ARGUMENT, 'Contract Empty from:' + instance)\n }\n template.bind(\n {\n name: instance.contract.name,\n address: validateAndNormalizeAddress(instance.contract.address),\n network: instance.contract.chainId as EthChainId,\n startBlock: instance.startBlock,\n endBlock: instance.endBlock,\n },\n ctx\n )\n }\n }\n\n stateDiff(config: ProcessConfigResponse): boolean {\n return TemplateInstanceState.INSTANCE.getValues().length !== config.templateInstances.length\n }\n\n async processLog(request: DataBinding): Promise<ProcessResult> {\n if (!request.data?.ethLog?.log) {\n throw new ServerError(Status.INVALID_ARGUMENT, \"Log can't be null\")\n }\n const ethLog = request.data.ethLog\n\n const promises: Promise<ProcessResult>[] = []\n for (const handlerId of request.handlerIds) {\n const handler = this.handlers.eventHandlers[handlerId]\n promises.push(\n handler(ethLog).catch((e) => {\n throw new ServerError(\n Status.INTERNAL,\n 'error processing log: ' + JSON.stringify(ethLog.log) + '\\n' + errorString(e)\n )\n })\n )\n }\n return mergeProcessResults(await Promise.all(promises))\n }\n\n async processTrace(binding: DataBinding): Promise<ProcessResult> {\n if (!binding.data?.ethTrace?.trace) {\n throw new ServerError(Status.INVALID_ARGUMENT, \"Trace can't be null\")\n }\n const ethTrace = binding.data.ethTrace\n\n const promises: Promise<ProcessResult>[] = []\n\n for (const handlerId of binding.handlerIds) {\n promises.push(\n this.handlers.traceHandlers[handlerId](ethTrace).catch((e) => {\n throw new ServerError(\n Status.INTERNAL,\n 'error processing trace: ' + JSON.stringify(ethTrace.trace) + '\\n' + errorString(e)\n )\n })\n )\n }\n return mergeProcessResults(await Promise.all(promises))\n }\n\n async processBlock(binding: DataBinding): Promise<ProcessResult> {\n if (!binding.data?.ethBlock?.block) {\n throw new ServerError(Status.INVALID_ARGUMENT, \"Block can't be empty\")\n }\n const ethBlock = binding.data.ethBlock\n\n const promises: Promise<ProcessResult>[] = []\n for (const handlerId of binding.handlerIds) {\n promises.push(\n this.handlers.blockHandlers[handlerId](ethBlock).catch((e) => {\n throw new ServerError(\n Status.INTERNAL,\n 'error processing block: ' + ethBlock.block?.number + '\\n' + errorString(e)\n )\n })\n )\n }\n return mergeProcessResults(await Promise.all(promises))\n }\n\n async processTransaction(binding: DataBinding): Promise<ProcessResult> {\n if (!binding.data?.ethTransaction?.transaction) {\n throw new ServerError(Status.INVALID_ARGUMENT, \"transaction can't be null\")\n }\n const ethTransaction = binding.data.ethTransaction\n\n const promises: Promise<ProcessResult>[] = []\n\n for (const handlerId of binding.handlerIds) {\n promises.push(\n this.handlers.transactionHandlers[handlerId](ethTransaction).catch((e) => {\n throw new ServerError(\n Status.INTERNAL,\n 'error processing transaction: ' + JSON.stringify(ethTransaction.transaction) + '\\n' + errorString(e)\n )\n })\n )\n }\n return mergeProcessResults(await Promise.all(promises))\n }\n}\n\nPluginManager.INSTANCE.register(new EthPlugin())\n\nclass NoopContext extends EthContext {\n public constructor() {\n super(EthChainId.ETHEREUM, '')\n }\n\n protected getContractName(): string {\n return ''\n }\n}\n"]}
@@ -7,25 +7,31 @@ import { MoveAccountContext, MoveContext } from '../move/index.js';
7
7
  export declare class SuiContext extends MoveContext<SuiNetwork, SuiMoveNormalizedModule, SuiEvent | SuiMoveObject> {
8
8
  moduleName: string;
9
9
  timestamp: Date;
10
- slot: bigint;
10
+ checkpoint: bigint;
11
11
  transaction: SuiTransactionBlockResponse;
12
12
  eventIndex: number;
13
13
  coder: MoveCoder;
14
- constructor(moduleName: string, network: SuiNetwork, address: string, timestamp: Date, slot: bigint, transaction: SuiTransactionBlockResponse, eventIndex: number, baseLabels: Labels | undefined);
14
+ constructor(moduleName: string, network: SuiNetwork, address: string, timestamp: Date, checkpoint: bigint, transaction: SuiTransactionBlockResponse, eventIndex: number, baseLabels: Labels | undefined);
15
15
  getChainId(): import("../index.js").SuiChainId;
16
16
  getTimestamp(): number;
17
17
  getMetaDataInternal(name: string, labels: Labels): RecordMetaData;
18
18
  get client(): JsonRpcProvider;
19
19
  }
20
- export declare class SuiObjectsContext extends MoveAccountContext<SuiNetwork, SuiMoveNormalizedModule, SuiEvent | SuiMoveObject> {
20
+ export declare class SuiAddressContext extends MoveAccountContext<SuiNetwork, SuiMoveNormalizedModule, SuiEvent | SuiMoveObject> {
21
21
  address: string;
22
22
  network: SuiNetwork;
23
- slot: bigint;
23
+ checkpoint: bigint;
24
24
  timestamp: Date;
25
25
  coder: MoveCoder;
26
- constructor(network: SuiNetwork, address: string, slot: bigint, timestamp: Date, baseLabels: Labels | undefined);
26
+ protected contractName: string;
27
+ constructor(network: SuiNetwork, address: string, checkpoint: bigint, timestamp: Date, baseLabels: Labels | undefined);
27
28
  getChainId(): import("../index.js").SuiChainId;
28
29
  getMetaDataInternal(name: string, labels: Labels): RecordMetaData;
29
30
  get client(): JsonRpcProvider;
30
31
  getTimestamp(): number;
31
32
  }
33
+ export declare class SuiObjectContext extends SuiAddressContext {
34
+ contractName: string;
35
+ objectId: string;
36
+ constructor(network: SuiNetwork, objectId: string, checkpoint: bigint, timestamp: Date, baseLabels: Labels | undefined);
37
+ }
@@ -5,17 +5,17 @@ import { MoveAccountContext, MoveContext } from '../move/index.js';
5
5
  export class SuiContext extends MoveContext {
6
6
  moduleName;
7
7
  timestamp;
8
- slot;
8
+ checkpoint;
9
9
  transaction;
10
10
  eventIndex;
11
11
  coder;
12
- constructor(moduleName, network, address, timestamp, slot, transaction, eventIndex, baseLabels) {
12
+ constructor(moduleName, network, address, timestamp, checkpoint, transaction, eventIndex, baseLabels) {
13
13
  super(baseLabels);
14
14
  this.address = address.toLowerCase();
15
15
  this.network = network;
16
16
  this.moduleName = moduleName;
17
17
  this.timestamp = timestamp;
18
- this.slot = slot;
18
+ this.checkpoint = checkpoint;
19
19
  this.eventIndex = eventIndex;
20
20
  this.coder = defaultMoveCoder(network);
21
21
  if (transaction) {
@@ -32,7 +32,7 @@ export class SuiContext extends MoveContext {
32
32
  return {
33
33
  address: this.address,
34
34
  contractName: this.moduleName,
35
- blockNumber: this.slot,
35
+ blockNumber: this.checkpoint,
36
36
  transactionIndex: 0,
37
37
  transactionHash: this.transaction?.digest || '',
38
38
  logIndex: 0,
@@ -45,17 +45,19 @@ export class SuiContext extends MoveContext {
45
45
  return getClient(this.network);
46
46
  }
47
47
  }
48
- export class SuiObjectsContext extends MoveAccountContext {
48
+ // TODO address handler should use this context
49
+ export class SuiAddressContext extends MoveAccountContext {
49
50
  address;
50
51
  network;
51
- slot;
52
+ checkpoint;
52
53
  timestamp;
53
54
  coder;
54
- constructor(network, address, slot, timestamp, baseLabels) {
55
+ contractName = 'address';
56
+ constructor(network, address, checkpoint, timestamp, baseLabels) {
55
57
  super(baseLabels);
56
58
  this.address = address;
57
59
  this.network = network;
58
- this.slot = slot;
60
+ this.checkpoint = checkpoint;
59
61
  this.timestamp = timestamp;
60
62
  this.coder = defaultMoveCoder(network);
61
63
  }
@@ -65,8 +67,8 @@ export class SuiObjectsContext extends MoveAccountContext {
65
67
  getMetaDataInternal(name, labels) {
66
68
  return {
67
69
  address: this.address,
68
- contractName: 'objects',
69
- blockNumber: this.slot,
70
+ contractName: this.contractName,
71
+ blockNumber: this.checkpoint,
70
72
  transactionIndex: 0,
71
73
  transactionHash: '',
72
74
  logIndex: 0,
@@ -82,4 +84,12 @@ export class SuiObjectsContext extends MoveAccountContext {
82
84
  return this.timestamp.getDate();
83
85
  }
84
86
  }
87
+ export class SuiObjectContext extends SuiAddressContext {
88
+ contractName = 'object';
89
+ objectId;
90
+ constructor(network, objectId, checkpoint, timestamp, baseLabels) {
91
+ super(network, objectId, checkpoint, timestamp, baseLabels);
92
+ this.objectId = objectId;
93
+ }
94
+ }
85
95
  //# sourceMappingURL=context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/sui/context.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,eAAe,EAAE,MAAM,aAAa,CAAA;AAC1D,OAAO,EAAE,SAAS,EAAc,MAAM,cAAc,CAAA;AAQpD,OAAO,EAAa,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAC7D,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAElE,MAAM,OAAO,UAAW,SAAQ,WAA0E;IACxG,UAAU,CAAQ;IAClB,SAAS,CAAM;IACf,IAAI,CAAQ;IACZ,WAAW,CAA6B;IACxC,UAAU,CAAQ;IAClB,KAAK,CAAW;IAEhB,YACE,UAAkB,EAClB,OAAmB,EACnB,OAAe,EACf,SAAe,EACf,IAAY,EACZ,WAAwC,EACxC,UAAkB,EAClB,UAA8B;QAE9B,KAAK,CAAC,UAAU,CAAC,CAAA;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,WAAW,EAAE,CAAA;QACpC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,KAAK,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAA;QACtC,IAAI,WAAW,EAAE;YACf,IAAI,CAA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AE,MAAc;QAC9C,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,YAAY,EAAE,SAAS;YACvB,WAAW,EAAE,IAAI,CAAC,IAAI;YACtB,gBAAgB,EAAE,CAAC;YACnB,eAAe,EAAE,EAAE;YACnB,QAAQ,EAAE,CAAC;YACX,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE;YAC1B,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,eAAe,CAAC,MAAM,CAAC;SAChC,CAAA;IACH,CAAC;IAED,IAAI,MAAM;QACR,OAAO,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAChC,CAAC;IAED,YAAY;QACV,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAA;IACjC,CAAC;CACF","sourcesContent":["import { RecordMetaData } from '@sentio/protos'\nimport { type Labels, normalizeLabels } from '../index.js'\nimport { getClient, SuiNetwork } from './network.js'\nimport {\n SuiTransactionBlockResponse,\n JsonRpcProvider,\n SuiEvent,\n SuiMoveNormalizedModule,\n SuiMoveObject,\n} from '@mysten/sui.js'\nimport { MoveCoder, defaultMoveCoder } from './move-coder.js'\nimport { MoveAccountContext, MoveContext } from '../move/index.js'\n\nexport class SuiContext extends MoveContext<SuiNetwork, SuiMoveNormalizedModule, SuiEvent | SuiMoveObject> {\n moduleName: string\n timestamp: Date\n slot: bigint\n transaction: SuiTransactionBlockResponse\n eventIndex: number\n coder: MoveCoder\n\n constructor(\n moduleName: string,\n network: SuiNetwork,\n address: string,\n timestamp: Date,\n slot: bigint,\n transaction: SuiTransactionBlockResponse,\n eventIndex: number,\n baseLabels: Labels | undefined\n ) {\n super(baseLabels)\n this.address = address.toLowerCase()\n this.network = network\n this.moduleName = moduleName\n this.timestamp = timestamp\n this.slot = slot\n this.eventIndex = eventIndex\n this.coder = defaultMoveCoder(network)\n if (transaction) {\n this.transaction = transaction\n }\n }\n\n getChainId() {\n return this.network\n }\n\n getTimestamp(): number {\n return this.timestamp.getDate()\n }\n\n getMetaDataInternal(name: string, labels: Labels): RecordMetaData {\n return {\n address: this.address,\n contractName: this.moduleName,\n blockNumber: this.slot,\n transactionIndex: 0,\n transactionHash: this.transaction?.digest || '', // TODO\n logIndex: 0,\n chainId: this.getChainId(),\n name: name,\n labels: normalizeLabels(labels),\n }\n }\n\n get client(): JsonRpcProvider {\n return getClient(this.network)\n }\n}\n\nexport class SuiObjectsContext extends MoveAccountContext<\n SuiNetwork,\n SuiMoveNormalizedModule,\n SuiEvent | SuiMoveObject\n> {\n address: string\n network: SuiNetwork\n slot: bigint\n timestamp: Date\n coder: MoveCoder\n\n constructor(network: SuiNetwork, address: string, slot: bigint, timestamp: Date, baseLabels: Labels | undefined) {\n super(baseLabels)\n this.address = address\n this.network = network\n this.slot = slot\n this.timestamp = timestamp\n this.coder = defaultMoveCoder(network)\n }\n\n getChainId() {\n return this.network\n }\n\n getMetaDataInternal(name: string, labels: Labels): RecordMetaData {\n return {\n address: this.address,\n contractName: 'objects',\n blockNumber: this.slot,\n transactionIndex: 0,\n transactionHash: '',\n logIndex: 0,\n chainId: this.getChainId(),\n name: name,\n labels: normalizeLabels(labels),\n }\n }\n\n get client(): JsonRpcProvider {\n return getClient(this.network)\n }\n\n getTimestamp(): number {\n return this.timestamp.getDate()\n }\n}\n"]}
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/sui/context.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,eAAe,EAAE,MAAM,aAAa,CAAA;AAC1D,OAAO,EAAE,SAAS,EAAc,MAAM,cAAc,CAAA;AAQpD,OAAO,EAAa,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAC7D,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAElE,MAAM,OAAO,UAAW,SAAQ,WAA0E;IACxG,UAAU,CAAQ;IAClB,SAAS,CAAM;IACf,UAAU,CAAQ;IAClB,WAAW,CAA6B;IACxC,UAAU,CAAQ;IAClB,KAAK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8B;QAE9B,KAAK,CAAC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,CAAC,CAAA;QAC3D,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAC1B,CAAC;CACF","sourcesContent":["import { RecordMetaData } from '@sentio/protos'\nimport { type Labels, normalizeLabels } from '../index.js'\nimport { getClient, SuiNetwork } from './network.js'\nimport {\n SuiTransactionBlockResponse,\n JsonRpcProvider,\n SuiEvent,\n SuiMoveNormalizedModule,\n SuiMoveObject,\n} from '@mysten/sui.js'\nimport { MoveCoder, defaultMoveCoder } from './move-coder.js'\nimport { MoveAccountContext, MoveContext } from '../move/index.js'\n\nexport class SuiContext extends MoveContext<SuiNetwork, SuiMoveNormalizedModule, SuiEvent | SuiMoveObject> {\n moduleName: string\n timestamp: Date\n checkpoint: bigint\n transaction: SuiTransactionBlockResponse\n eventIndex: number\n coder: MoveCoder\n\n constructor(\n moduleName: string,\n network: SuiNetwork,\n address: string,\n timestamp: Date,\n checkpoint: bigint,\n transaction: SuiTransactionBlockResponse,\n eventIndex: number,\n baseLabels: Labels | undefined\n ) {\n super(baseLabels)\n this.address = address.toLowerCase()\n this.network = network\n this.moduleName = moduleName\n this.timestamp = timestamp\n this.checkpoint = checkpoint\n this.eventIndex = eventIndex\n this.coder = defaultMoveCoder(network)\n if (transaction) {\n this.transaction = transaction\n }\n }\n\n getChainId() {\n return this.network\n }\n\n getTimestamp(): number {\n return this.timestamp.getDate()\n }\n\n getMetaDataInternal(name: string, labels: Labels): RecordMetaData {\n return {\n address: this.address,\n contractName: this.moduleName,\n blockNumber: this.checkpoint,\n transactionIndex: 0,\n transactionHash: this.transaction?.digest || '', // TODO\n logIndex: 0,\n chainId: this.getChainId(),\n name: name,\n labels: normalizeLabels(labels),\n }\n }\n\n get client(): JsonRpcProvider {\n return getClient(this.network)\n }\n}\n\n// TODO address handler should use this context\nexport class SuiAddressContext extends MoveAccountContext<\n SuiNetwork,\n SuiMoveNormalizedModule,\n SuiEvent | SuiMoveObject\n> {\n address: string\n network: SuiNetwork\n checkpoint: bigint\n timestamp: Date\n coder: MoveCoder\n\n protected contractName = 'address'\n\n constructor(\n network: SuiNetwork,\n address: string,\n checkpoint: bigint,\n timestamp: Date,\n baseLabels: Labels | undefined\n ) {\n super(baseLabels)\n this.address = address\n this.network = network\n this.checkpoint = checkpoint\n this.timestamp = timestamp\n this.coder = defaultMoveCoder(network)\n }\n\n getChainId() {\n return this.network\n }\n\n getMetaDataInternal(name: string, labels: Labels): RecordMetaData {\n return {\n address: this.address,\n contractName: this.contractName,\n blockNumber: this.checkpoint,\n transactionIndex: 0,\n transactionHash: '',\n logIndex: 0,\n chainId: this.getChainId(),\n name: name,\n labels: normalizeLabels(labels),\n }\n }\n\n get client(): JsonRpcProvider {\n return getClient(this.network)\n }\n\n getTimestamp(): number {\n return this.timestamp.getDate()\n }\n}\n\nexport class SuiObjectContext extends SuiAddressContext {\n contractName = 'object'\n objectId: string\n\n constructor(\n network: SuiNetwork,\n objectId: string,\n checkpoint: bigint,\n timestamp: Date,\n baseLabels: Labels | undefined\n ) {\n super(network, objectId, checkpoint, timestamp, baseLabels)\n this.objectId = objectId\n }\n}\n"]}
@@ -3,7 +3,7 @@ import { BigDecimal } from '@sentio/bigdecimal';
3
3
  import { MoveCoinList, MoveDex, MovePoolAdaptor, SimpleCoinInfo } from '../../move/ext/index.js';
4
4
  import { SuiMoveObject, SuiMovePackage } from '@mysten/sui.js';
5
5
  import { SuiNetwork } from '../network.js';
6
- import { SuiContext, SuiObjectsContext } from '../context.js';
6
+ import { SuiContext, SuiObjectContext } from '../context.js';
7
7
  export type PoolAdaptor<T> = MovePoolAdaptor<SuiMoveObject, T>;
8
8
  export declare class CoinList implements MoveCoinList {
9
9
  calculateValueInUsd(amount: bigint, coinInfo: SimpleCoinInfo, timestamp: number): Promise<BigDecimal>;
@@ -12,7 +12,7 @@ export declare class CoinList implements MoveCoinList {
12
12
  whitelistCoins(): Map<string, SimpleCoinInfo>;
13
13
  }
14
14
  export declare const SuiCoinList: CoinList;
15
- export declare class SuiDex<T> extends MoveDex<SuiNetwork, SuiMovePackage, SuiMoveObject, Event, SuiContext, SuiObjectsContext, T> {
15
+ export declare class SuiDex<T> extends MoveDex<SuiNetwork, SuiMovePackage, SuiMoveObject, Event, SuiContext, SuiObjectContext, T> {
16
16
  coinList: CoinList;
17
17
  poolAdaptor: PoolAdaptor<T>;
18
18
  }
@@ -1 +1 @@
1
- {"version":3,"file":"move-dex.js","sourceRoot":"","sources":["../../../src/sui/ext/move-dex.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AACzF,OAAO,EAAgB,OAAO,EAAE,gBAAgB,EAAmC,MAAM,yBAAyB,CAAA;AAOlH,MAAM,OAAO,QAAQ;IACnB,mBAAmB,CAAC,MAAc,EAAE,QAAwB,EAAE,SAAiB;QAC7E,OAAO,mBAAmB,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAA;IACzD,CAAC;IAED,WAAW,CAAC,IAAY;QACtB,OAAO,WAAW,CAAC,IAAI,CAAC,CAAA;IAC1B,CAAC;IAED,WAAW,CAAC,IAAY;QACtB,OAAO,WAAW,CAAC,IAAI,CAAC,CAAA;IAC1B,CAAC;IAED,cAAc;QACZ,OAAO,cAAc,EAAE,CAAA;IACzB,CAAC;CACF;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,QAAQ,EAAE,CAAA;AAEzC,MAAM,OAAO,MAAU,SAAQ,OAQ9B;IACC,QAAQ,GAAG,WAAW,CAAA;CAEvB;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,GAAe,EACf,KAAa,EACb,KAAa,EACb,WAAmB,EACnB,WAAmB;IAEnB,OAAO,gBAAgB,CAAC,WAAW,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,CAAC,CAAA;AACnF,CAAC","sourcesContent":["import { BigDecimal } from '@sentio/bigdecimal'\nimport { calculateValueInUsd, getCoinInfo, whitelistCoins, whiteListed } from './coin.js'\nimport { MoveCoinList, MoveDex, moveGetPairValue, MovePoolAdaptor, SimpleCoinInfo } from '../../move/ext/index.js'\nimport { SuiMoveObject, SuiMovePackage } from '@mysten/sui.js'\nimport { SuiNetwork } from '../network.js'\nimport { SuiContext, SuiObjectsContext } from '../context.js'\n\nexport type PoolAdaptor<T> = MovePoolAdaptor<SuiMoveObject, T>\n\nexport class CoinList implements MoveCoinList {\n calculateValueInUsd(amount: bigint, coinInfo: SimpleCoinInfo, timestamp: number): Promise<BigDecimal> {\n return calculateValueInUsd(amount, coinInfo, timestamp)\n }\n\n getCoinInfo(type: string): SimpleCoinInfo {\n return getCoinInfo(type)\n }\n\n whiteListed(type: string): boolean {\n return whiteListed(type)\n }\n\n whitelistCoins(): Map<string, SimpleCoinInfo> {\n return whitelistCoins()\n }\n}\n\nexport const SuiCoinList = new CoinList()\n\nexport class SuiDex<T> extends MoveDex<\n SuiNetwork,\n SuiMovePackage,\n SuiMoveObject,\n Event,\n SuiContext,\n SuiObjectsContext,\n T\n> {\n coinList = SuiCoinList\n declare poolAdaptor: PoolAdaptor<T>\n}\n\nexport async function getPairValue(\n ctx: SuiContext,\n coinx: string,\n coiny: string,\n coinXAmount: bigint,\n coinYAmount: bigint\n): Promise<BigDecimal> {\n return moveGetPairValue(SuiCoinList, ctx, coinx, coiny, coinXAmount, coinYAmount)\n}\n"]}
1
+ {"version":3,"file":"move-dex.js","sourceRoot":"","sources":["../../../src/sui/ext/move-dex.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AACzF,OAAO,EAAgB,OAAO,EAAE,gBAAgB,EAAmC,MAAM,yBAAyB,CAAA;AAOlH,MAAM,OAAO,QAAQ;IACnB,mBAAmB,CAAC,MAAc,EAAE,QAAwB,EAAE,SAAiB;QAC7E,OAAO,mBAAmB,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAA;IACzD,CAAC;IAED,WAAW,CAAC,IAAY;QACtB,OAAO,WAAW,CAAC,IAAI,CAAC,CAAA;IAC1B,CAAC;IAED,WAAW,CAAC,IAAY;QACtB,OAAO,WAAW,CAAC,IAAI,CAAC,CAAA;IAC1B,CAAC;IAED,cAAc;QACZ,OAAO,cAAc,EAAE,CAAA;IACzB,CAAC;CACF;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,QAAQ,EAAE,CAAA;AAEzC,MAAM,OAAO,MAAU,SAAQ,OAQ9B;IACC,QAAQ,GAAG,WAAW,CAAA;CAEvB;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,GAAe,EACf,KAAa,EACb,KAAa,EACb,WAAmB,EACnB,WAAmB;IAEnB,OAAO,gBAAgB,CAAC,WAAW,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,CAAC,CAAA;AACnF,CAAC","sourcesContent":["import { BigDecimal } from '@sentio/bigdecimal'\nimport { calculateValueInUsd, getCoinInfo, whitelistCoins, whiteListed } from './coin.js'\nimport { MoveCoinList, MoveDex, moveGetPairValue, MovePoolAdaptor, SimpleCoinInfo } from '../../move/ext/index.js'\nimport { SuiMoveObject, SuiMovePackage } from '@mysten/sui.js'\nimport { SuiNetwork } from '../network.js'\nimport { SuiContext, SuiObjectContext } from '../context.js'\n\nexport type PoolAdaptor<T> = MovePoolAdaptor<SuiMoveObject, T>\n\nexport class CoinList implements MoveCoinList {\n calculateValueInUsd(amount: bigint, coinInfo: SimpleCoinInfo, timestamp: number): Promise<BigDecimal> {\n return calculateValueInUsd(amount, coinInfo, timestamp)\n }\n\n getCoinInfo(type: string): SimpleCoinInfo {\n return getCoinInfo(type)\n }\n\n whiteListed(type: string): boolean {\n return whiteListed(type)\n }\n\n whitelistCoins(): Map<string, SimpleCoinInfo> {\n return whitelistCoins()\n }\n}\n\nexport const SuiCoinList = new CoinList()\n\nexport class SuiDex<T> extends MoveDex<\n SuiNetwork,\n SuiMovePackage,\n SuiMoveObject,\n Event,\n SuiContext,\n SuiObjectContext,\n T\n> {\n coinList = SuiCoinList\n declare poolAdaptor: PoolAdaptor<T>\n}\n\nexport async function getPairValue(\n ctx: SuiContext,\n coinx: string,\n coiny: string,\n coinXAmount: bigint,\n coinYAmount: bigint\n): Promise<BigDecimal> {\n return moveGetPairValue(SuiCoinList, ctx, coinx, coiny, coinXAmount, coinYAmount)\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  export { SuiBaseProcessor, type SuiBindOptions } from './sui-processor.js';
2
2
  export { SuiAddressProcessor, SuiObjectProcessor, SuiWrappedObjectProcessor, type SuiObjectBindOptions, } from './sui-object-processor.js';
3
- export { SuiObjectsProcessorTemplate, SuiWrappedObjectProcessorTemplate, } from './sui-objects-processor-template.js';
3
+ export { SuiObjectProcessorTemplate, SuiWrappedObjectProcessorTemplate, } from './sui-object-processor-template.js';
4
4
  export * from './network.js';
5
5
  export * from './context.js';
6
6
  export * from './models.js';
package/lib/sui/index.js CHANGED
@@ -2,7 +2,7 @@ export { SuiBaseProcessor } from './sui-processor.js';
2
2
  export { SuiAddressProcessor, SuiObjectProcessor, SuiWrappedObjectProcessor, } from './sui-object-processor.js';
3
3
  export {
4
4
  // SuiAddressProcessorTemplate,
5
- SuiObjectsProcessorTemplate, SuiWrappedObjectProcessorTemplate, } from './sui-objects-processor-template.js';
5
+ SuiObjectProcessorTemplate, SuiWrappedObjectProcessorTemplate, } from './sui-object-processor-template.js';
6
6
  export * from './network.js';
7
7
  export * from './context.js';
8
8
  export * from './models.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sui/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAuB,MAAM,oBAAoB,CAAA;AAC1E,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,yBAAyB,GAE1B,MAAM,2BAA2B,CAAA;AAElC,OAAO;AACL,+BAA+B;AAC/B,2BAA2B,EAC3B,iCAAiC,GAClC,MAAM,qCAAqC,CAAA;AAE5C,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAG3B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEhD,cAAc,iBAAiB,CAAA;AAE/B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEjD,OAAO,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA","sourcesContent":["export { SuiBaseProcessor, type SuiBindOptions } from './sui-processor.js'\nexport {\n SuiAddressProcessor,\n SuiObjectProcessor,\n SuiWrappedObjectProcessor,\n type SuiObjectBindOptions,\n} from './sui-object-processor.js'\n\nexport {\n // SuiAddressProcessorTemplate,\n SuiObjectsProcessorTemplate,\n SuiWrappedObjectProcessorTemplate,\n} from './sui-objects-processor-template.js'\n\nexport * from './network.js'\nexport * from './context.js'\nexport * from './models.js'\n\nexport type { SuiAddress } from './move-types.js'\nexport { BUILTIN_TYPES } from '../move/types.js'\n\nexport * from './move-coder.js'\n\nexport { SuiPlugin } from './sui-plugin.js'\n\nexport { ModuleClient } from './module-client.js'\n\nexport { validateAndNormalizeAddress, isValidSuiAddress } from './utils.js'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sui/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAuB,MAAM,oBAAoB,CAAA;AAC1E,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,yBAAyB,GAE1B,MAAM,2BAA2B,CAAA;AAElC,OAAO;AACL,+BAA+B;AAC/B,0BAA0B,EAC1B,iCAAiC,GAClC,MAAM,oCAAoC,CAAA;AAE3C,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAG3B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEhD,cAAc,iBAAiB,CAAA;AAE/B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEjD,OAAO,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA","sourcesContent":["export { SuiBaseProcessor, type SuiBindOptions } from './sui-processor.js'\nexport {\n SuiAddressProcessor,\n SuiObjectProcessor,\n SuiWrappedObjectProcessor,\n type SuiObjectBindOptions,\n} from './sui-object-processor.js'\n\nexport {\n // SuiAddressProcessorTemplate,\n SuiObjectProcessorTemplate,\n SuiWrappedObjectProcessorTemplate,\n} from './sui-object-processor-template.js'\n\nexport * from './network.js'\nexport * from './context.js'\nexport * from './models.js'\n\nexport type { SuiAddress } from './move-types.js'\nexport { BUILTIN_TYPES } from '../move/types.js'\n\nexport * from './move-coder.js'\n\nexport { SuiPlugin } from './sui-plugin.js'\n\nexport { ModuleClient } from './module-client.js'\n\nexport { validateAndNormalizeAddress, isValidSuiAddress } from './utils.js'\n"]}
@@ -0,0 +1,34 @@
1
+ import { HandleInterval, MoveAccountFetchConfig } from '@sentio/protos';
2
+ import { ListStateStorage } from '@sentio/runtime';
3
+ import { SuiContext, SuiObjectContext } from './context.js';
4
+ import { SuiMoveObject } from '@mysten/sui.js';
5
+ import { PromiseOrVoid } from '../core/index.js';
6
+ import { SuiBaseObjectOrAddressProcessor, SuiObjectBindOptions, SuiObjectProcessor, SuiWrappedObjectProcessor } from './sui-object-processor.js';
7
+ declare class ObjectHandler<HandlerType> {
8
+ type?: string;
9
+ checkpointInterval?: HandleInterval;
10
+ timeIntervalInMinutes?: HandleInterval;
11
+ handler: HandlerType;
12
+ fetchConfig: MoveAccountFetchConfig;
13
+ }
14
+ export declare class SuiAccountProcessorTemplateState extends ListStateStorage<SuiObjectOrAddressProcessorTemplate<any, any>> {
15
+ static INSTANCE: SuiAccountProcessorTemplateState;
16
+ }
17
+ export declare abstract class SuiObjectOrAddressProcessorTemplate<HandlerType, ProcessorType extends SuiBaseObjectOrAddressProcessor<HandlerType>> {
18
+ id: number;
19
+ objectHandlers: ObjectHandler<HandlerType>[];
20
+ binds: Set<string>;
21
+ constructor();
22
+ protected abstract createProcessor(options: SuiObjectBindOptions): ProcessorType;
23
+ bind(options: SuiObjectBindOptions, ctx: SuiContext): void;
24
+ protected onInterval(handler: HandlerType, timeInterval: HandleInterval | undefined, checkpointInterval: HandleInterval | undefined, type: string | undefined, fetchConfig: Partial<MoveAccountFetchConfig> | undefined): this;
25
+ onTimeInterval(handler: HandlerType, timeIntervalInMinutes?: number, backfillTimeIntervalInMinutes?: number, type?: string, fetchConfig?: Partial<MoveAccountFetchConfig>): this;
26
+ onCheckpointInterval(handler: HandlerType, checkpointInterval?: number, backfillCheckpointInterval?: number, type?: string, fetchConfig?: Partial<MoveAccountFetchConfig>): this;
27
+ }
28
+ export declare class SuiObjectProcessorTemplate extends SuiObjectOrAddressProcessorTemplate<(self: SuiMoveObject, dynamicFieldObjects: SuiMoveObject[], ctx: SuiObjectContext) => PromiseOrVoid, SuiObjectProcessor> {
29
+ createProcessor(options: SuiObjectBindOptions): SuiObjectProcessor;
30
+ }
31
+ export declare class SuiWrappedObjectProcessorTemplate extends SuiObjectOrAddressProcessorTemplate<(dynamicFieldObjects: SuiMoveObject[], ctx: SuiObjectContext) => PromiseOrVoid, SuiWrappedObjectProcessor> {
32
+ createProcessor(options: SuiObjectBindOptions): SuiWrappedObjectProcessor;
33
+ }
34
+ export {};
@@ -3,7 +3,7 @@ import { DEFAULT_FETCH_CONFIG, SuiObjectProcessor, SuiWrappedObjectProcessor, }
3
3
  import { TemplateInstanceState } from '../core/template.js';
4
4
  class ObjectHandler {
5
5
  type;
6
- versionInterval;
6
+ checkpointInterval;
7
7
  timeIntervalInMinutes;
8
8
  handler;
9
9
  fetchConfig;
@@ -12,7 +12,7 @@ class SuiAccountProcessorTemplateState extends ListStateStorage {
12
12
  static INSTANCE = new SuiAccountProcessorTemplateState();
13
13
  }
14
14
  export { SuiAccountProcessorTemplateState };
15
- export class SuiBaseObjectsProcessorTemplate {
15
+ export class SuiObjectOrAddressProcessorTemplate {
16
16
  id;
17
17
  objectHandlers = [];
18
18
  binds = new Set();
@@ -22,6 +22,7 @@ export class SuiBaseObjectsProcessorTemplate {
22
22
  }
23
23
  bind(options, ctx) {
24
24
  options.network = options.network || ctx.network;
25
+ options.startCheckpoint = options.startCheckpoint || ctx.checkpoint;
25
26
  const sig = [options.network, options.objectId].join('_');
26
27
  if (this.binds.has(sig)) {
27
28
  console.log(`Same object id can be bind to one template only once, ignore duplicate bind: ${sig}`);
@@ -30,7 +31,7 @@ export class SuiBaseObjectsProcessorTemplate {
30
31
  this.binds.add(sig);
31
32
  const processor = this.createProcessor(options);
32
33
  for (const h of this.objectHandlers) {
33
- processor.onInterval(h.handler, h.timeIntervalInMinutes, h.versionInterval, h.type, h.fetchConfig);
34
+ processor.onInterval(h.handler, h.timeIntervalInMinutes, h.checkpointInterval, h.type, h.fetchConfig);
34
35
  }
35
36
  const config = processor.config;
36
37
  ctx._res.states.configUpdated = true;
@@ -46,11 +47,11 @@ export class SuiBaseObjectsProcessorTemplate {
46
47
  endBlock: 0n,
47
48
  });
48
49
  }
49
- onInterval(handler, timeInterval, versionInterval, type, fetchConfig) {
50
+ onInterval(handler, timeInterval, checkpointInterval, type, fetchConfig) {
50
51
  this.objectHandlers.push({
51
52
  handler: handler,
52
53
  timeIntervalInMinutes: timeInterval,
53
- versionInterval: versionInterval,
54
+ checkpointInterval: checkpointInterval,
54
55
  type,
55
56
  fetchConfig: { ...DEFAULT_FETCH_CONFIG, ...fetchConfig },
56
57
  });
@@ -62,8 +63,8 @@ export class SuiBaseObjectsProcessorTemplate {
62
63
  backfillInterval: backfillTimeIntervalInMinutes,
63
64
  }, undefined, type, fetchConfig);
64
65
  }
65
- onSlotInterval(handler, slotInterval = 100000, backfillSlotInterval = 400000, type, fetchConfig) {
66
- return this.onInterval(handler, undefined, { recentInterval: slotInterval, backfillInterval: backfillSlotInterval }, type, fetchConfig);
66
+ onCheckpointInterval(handler, checkpointInterval = 100000, backfillCheckpointInterval = 400000, type, fetchConfig) {
67
+ return this.onInterval(handler, undefined, { recentInterval: checkpointInterval, backfillInterval: backfillCheckpointInterval }, type, fetchConfig);
67
68
  }
68
69
  }
69
70
  // export class SuiAddressProcessorTemplate extends SuiBaseObjectsProcessorTemplate<
@@ -75,14 +76,14 @@ export class SuiBaseObjectsProcessorTemplate {
75
76
  // return this.bindInternal(SuiAddressProcessorTemplate.bind(options), ctx)
76
77
  // }
77
78
  // }
78
- export class SuiObjectsProcessorTemplate extends SuiBaseObjectsProcessorTemplate {
79
+ export class SuiObjectProcessorTemplate extends SuiObjectOrAddressProcessorTemplate {
79
80
  createProcessor(options) {
80
81
  return SuiObjectProcessor.bind(options);
81
82
  }
82
83
  }
83
- export class SuiWrappedObjectProcessorTemplate extends SuiBaseObjectsProcessorTemplate {
84
+ export class SuiWrappedObjectProcessorTemplate extends SuiObjectOrAddressProcessorTemplate {
84
85
  createProcessor(options) {
85
86
  return SuiWrappedObjectProcessor.bind(options);
86
87
  }
87
88
  }
88
- //# sourceMappingURL=sui-objects-processor-template.js.map
89
+ //# sourceMappingURL=sui-object-processor-template.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sui-object-processor-template.js","sourceRoot":"","sources":["../../src/sui/sui-object-processor-template.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAIlD,OAAO,EACL,oBAAoB,EAGpB,kBAAkB,EAClB,yBAAyB,GAC1B,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAE3D,MAAM,aAAa;IACjB,IAAI,CAAS;IACb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,EACP,SAAS,EACT,EAAE,cAAc,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,EACpF,IAAI,EACJ,WAAW,CACZ,CAAA;IACH,CAAC;CACF;AAED,oFAAoF;AACpF,yEAAyE;AACzE,oBAAoB;AACpB,wBAAwB;AACxB,MAAM;AACN,0EAA0E;AAC1E,+EAA+E;AAC/E,MAAM;AACN,IAAI;AAEJ,MAAM,OAAO,0BAA2B,SAAQ,mCAI/C;IACC,eAAe,CAAC,OAA6B;QAC3C,OAAO,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IACzC,CAAC;CACF;AAED,MAAM,OAAO,iCAAkC,SAAQ,mCAItD;IACC,eAAe,CAAC,OAA6B;QAC3C,OAAO,yBAAyB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAChD,CAAC;CACF","sourcesContent":["import { HandleInterval, MoveAccountFetchConfig } from '@sentio/protos'\nimport { ListStateStorage } from '@sentio/runtime'\nimport { SuiContext, SuiObjectContext } from './context.js'\nimport { SuiMoveObject } from '@mysten/sui.js'\nimport { PromiseOrVoid } from '../core/index.js'\nimport {\n DEFAULT_FETCH_CONFIG,\n SuiBaseObjectOrAddressProcessor,\n SuiObjectBindOptions,\n SuiObjectProcessor,\n SuiWrappedObjectProcessor,\n} from './sui-object-processor.js'\nimport { TemplateInstanceState } from '../core/template.js'\n\nclass ObjectHandler<HandlerType> {\n type?: string\n checkpointInterval?: HandleInterval\n timeIntervalInMinutes?: HandleInterval\n handler: HandlerType\n fetchConfig: MoveAccountFetchConfig\n}\n\nexport class SuiAccountProcessorTemplateState extends ListStateStorage<SuiObjectOrAddressProcessorTemplate<any, any>> {\n static INSTANCE = new SuiAccountProcessorTemplateState()\n}\n\nexport abstract class SuiObjectOrAddressProcessorTemplate<\n HandlerType,\n // OptionType,\n ProcessorType extends SuiBaseObjectOrAddressProcessor<HandlerType>\n> {\n id: number\n objectHandlers: ObjectHandler<HandlerType>[] = []\n binds = new Set<string>()\n\n constructor() {\n this.id = SuiAccountProcessorTemplateState.INSTANCE.getValues().length\n SuiAccountProcessorTemplateState.INSTANCE.addValue(this)\n }\n\n protected abstract createProcessor(options: SuiObjectBindOptions): ProcessorType\n\n bind(options: SuiObjectBindOptions, ctx: SuiContext): void {\n options.network = options.network || ctx.network\n options.startCheckpoint = options.startCheckpoint || ctx.checkpoint\n const sig = [options.network, options.objectId].join('_')\n if (this.binds.has(sig)) {\n console.log(`Same object id can be bind to one template only once, ignore duplicate bind: ${sig}`)\n return\n }\n this.binds.add(sig)\n\n const processor = this.createProcessor(options)\n for (const h of this.objectHandlers) {\n processor.onInterval(h.handler, h.timeIntervalInMinutes, h.checkpointInterval, h.type, h.fetchConfig)\n }\n const config = processor.config\n\n ctx._res.states.configUpdated = true\n TemplateInstanceState.INSTANCE.addValue({\n templateId: this.id,\n contract: {\n name: '',\n chainId: config.network,\n address: config.address,\n abi: '',\n },\n startBlock: config.startCheckpoint,\n endBlock: 0n,\n })\n }\n\n protected onInterval(\n handler: HandlerType,\n timeInterval: HandleInterval | undefined,\n checkpointInterval: HandleInterval | undefined,\n type: string | undefined,\n fetchConfig: Partial<MoveAccountFetchConfig> | undefined\n ): this {\n this.objectHandlers.push({\n handler: handler,\n timeIntervalInMinutes: timeInterval,\n checkpointInterval: checkpointInterval,\n type,\n fetchConfig: { ...DEFAULT_FETCH_CONFIG, ...fetchConfig },\n })\n return this\n }\n\n public onTimeInterval(\n handler: HandlerType,\n timeIntervalInMinutes = 60,\n backfillTimeIntervalInMinutes = 240,\n type?: string,\n fetchConfig?: Partial<MoveAccountFetchConfig>\n ): this {\n return this.onInterval(\n handler,\n {\n recentInterval: timeIntervalInMinutes,\n backfillInterval: backfillTimeIntervalInMinutes,\n },\n undefined,\n type,\n fetchConfig\n )\n }\n\n public onCheckpointInterval(\n handler: HandlerType,\n checkpointInterval = 100000,\n backfillCheckpointInterval = 400000,\n type?: string,\n fetchConfig?: Partial<MoveAccountFetchConfig>\n ): this {\n return this.onInterval(\n handler,\n undefined,\n { recentInterval: checkpointInterval, backfillInterval: backfillCheckpointInterval },\n type,\n fetchConfig\n )\n }\n}\n\n// export class SuiAddressProcessorTemplate extends SuiBaseObjectsProcessorTemplate<\n// (objects: SuiMoveObject[], ctx: SuiObjectsContext) => PromiseOrVoid,\n// SuiBindOptions,\n// SuiAddressProcessor\n// > {\n// bind(options: SuiBindOptions, ctx: SuiContext): SuiAddressProcessor {\n// return this.bindInternal(SuiAddressProcessorTemplate.bind(options), ctx)\n// }\n// }\n\nexport class SuiObjectProcessorTemplate extends SuiObjectOrAddressProcessorTemplate<\n (self: SuiMoveObject, dynamicFieldObjects: SuiMoveObject[], ctx: SuiObjectContext) => PromiseOrVoid,\n // SuiObjectBindOptions,\n SuiObjectProcessor\n> {\n createProcessor(options: SuiObjectBindOptions): SuiObjectProcessor {\n return SuiObjectProcessor.bind(options)\n }\n}\n\nexport class SuiWrappedObjectProcessorTemplate extends SuiObjectOrAddressProcessorTemplate<\n (dynamicFieldObjects: SuiMoveObject[], ctx: SuiObjectContext) => PromiseOrVoid,\n // SuiObjectBindOptions,\n SuiWrappedObjectProcessor\n> {\n createProcessor(options: SuiObjectBindOptions): SuiWrappedObjectProcessor {\n return SuiWrappedObjectProcessor.bind(options)\n }\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  import { Data_SuiObject, HandleInterval, MoveAccountFetchConfig, MoveOwnerType, ProcessResult } from '@sentio/protos';
2
2
  import { ListStateStorage } from '@sentio/runtime';
3
3
  import { SuiNetwork } from './network.js';
4
- import { SuiObjectsContext } from './context.js';
4
+ import { SuiObjectContext } from './context.js';
5
5
  import { SuiMoveObject } from '@mysten/sui.js';
6
6
  import { PromiseOrVoid } from '../core/index.js';
7
7
  import { IndexConfigure, SuiBindOptions } from './sui-processor.js';
@@ -15,40 +15,40 @@ export interface SuiObjectBindOptions {
15
15
  }
16
16
  interface ObjectHandler {
17
17
  type?: string;
18
- versionInterval?: HandleInterval;
18
+ checkPointInterval?: HandleInterval;
19
19
  timeIntervalInMinutes?: HandleInterval;
20
20
  fetchConfig: MoveAccountFetchConfig;
21
21
  handler: (resource: Data_SuiObject) => Promise<ProcessResult>;
22
22
  }
23
23
  export declare const DEFAULT_FETCH_CONFIG: MoveAccountFetchConfig;
24
- export declare class SuiAccountProcessorState extends ListStateStorage<SuiBaseObjectsProcessor<any>> {
24
+ export declare class SuiAccountProcessorState extends ListStateStorage<SuiBaseObjectOrAddressProcessor<any>> {
25
25
  static INSTANCE: SuiAccountProcessorState;
26
26
  }
27
27
  export interface SuiInternalObjectsBindOptions extends SuiBindOptions {
28
28
  ownerType: MoveOwnerType;
29
29
  }
30
- export declare abstract class SuiBaseObjectsProcessor<HandlerType> {
30
+ export declare abstract class SuiBaseObjectOrAddressProcessor<HandlerType> {
31
31
  config: IndexConfigure;
32
32
  ownerType: MoveOwnerType;
33
33
  objectHandlers: ObjectHandler[];
34
34
  protected constructor(options: SuiInternalObjectsBindOptions);
35
35
  getChainId(): string;
36
- protected abstract doHandle(handler: HandlerType, data: Data_SuiObject, ctx: SuiObjectsContext): PromiseOrVoid;
36
+ protected abstract doHandle(handler: HandlerType, data: Data_SuiObject, ctx: SuiObjectContext): PromiseOrVoid;
37
37
  onInterval(handler: HandlerType, //(resources: SuiMoveObject[], ctx: SuiObjectsContext) => PromiseOrVoid,
38
- timeInterval: HandleInterval | undefined, versionInterval: HandleInterval | undefined, type: string | undefined, fetchConfig: Partial<MoveAccountFetchConfig> | undefined): this;
38
+ timeInterval: HandleInterval | undefined, checkpointInterval: HandleInterval | undefined, type: string | undefined, fetchConfig: Partial<MoveAccountFetchConfig> | undefined): this;
39
39
  onTimeInterval(handler: HandlerType, timeIntervalInMinutes?: number, backfillTimeIntervalInMinutes?: number, type?: string, fetchConfig?: Partial<MoveAccountFetchConfig>): this;
40
- onSlotInterval(handler: HandlerType, slotInterval?: number, backfillSlotInterval?: number, type?: string, fetchConfig?: Partial<MoveAccountFetchConfig>): this;
40
+ onCheckpointInterval(handler: HandlerType, checkpointInterval?: number, backfillCheckpointInterval?: number, type?: string, fetchConfig?: Partial<MoveAccountFetchConfig>): this;
41
41
  }
42
- export declare class SuiAddressProcessor extends SuiBaseObjectsProcessor<(objects: SuiMoveObject[], ctx: SuiObjectsContext) => PromiseOrVoid> {
42
+ export declare class SuiAddressProcessor extends SuiBaseObjectOrAddressProcessor<(objects: SuiMoveObject[], ctx: SuiObjectContext) => PromiseOrVoid> {
43
43
  static bind(options: SuiBindOptions): SuiAddressProcessor;
44
- protected doHandle(handler: (objects: SuiMoveObject[], ctx: SuiObjectsContext) => PromiseOrVoid, data: Data_SuiObject, ctx: SuiObjectsContext): PromiseOrVoid;
44
+ protected doHandle(handler: (objects: SuiMoveObject[], ctx: SuiObjectContext) => PromiseOrVoid, data: Data_SuiObject, ctx: SuiObjectContext): PromiseOrVoid;
45
45
  }
46
- export declare class SuiObjectProcessor extends SuiBaseObjectsProcessor<(self: SuiMoveObject, dynamicFieldObjects: SuiMoveObject[], ctx: SuiObjectsContext) => PromiseOrVoid> {
46
+ export declare class SuiObjectProcessor extends SuiBaseObjectOrAddressProcessor<(self: SuiMoveObject, dynamicFieldObjects: SuiMoveObject[], ctx: SuiObjectContext) => PromiseOrVoid> {
47
47
  static bind(options: SuiObjectBindOptions): SuiObjectProcessor;
48
- protected doHandle(handler: (self: SuiMoveObject, dynamicFieldObjects: SuiMoveObject[], ctx: SuiObjectsContext) => PromiseOrVoid, data: Data_SuiObject, ctx: SuiObjectsContext): PromiseOrVoid;
48
+ protected doHandle(handler: (self: SuiMoveObject, dynamicFieldObjects: SuiMoveObject[], ctx: SuiObjectContext) => PromiseOrVoid, data: Data_SuiObject, ctx: SuiObjectContext): PromiseOrVoid;
49
49
  }
50
- export declare class SuiWrappedObjectProcessor extends SuiBaseObjectsProcessor<(dynamicFieldObjects: SuiMoveObject[], ctx: SuiObjectsContext) => PromiseOrVoid> {
50
+ export declare class SuiWrappedObjectProcessor extends SuiBaseObjectOrAddressProcessor<(dynamicFieldObjects: SuiMoveObject[], ctx: SuiObjectContext) => PromiseOrVoid> {
51
51
  static bind(options: SuiObjectBindOptions): SuiWrappedObjectProcessor;
52
- protected doHandle(handler: (dynamicFieldObjects: SuiMoveObject[], ctx: SuiObjectsContext) => PromiseOrVoid, data: Data_SuiObject, ctx: SuiObjectsContext): PromiseOrVoid;
52
+ protected doHandle(handler: (dynamicFieldObjects: SuiMoveObject[], ctx: SuiObjectContext) => PromiseOrVoid, data: Data_SuiObject, ctx: SuiObjectContext): PromiseOrVoid;
53
53
  }
54
54
  export {};