@sentio/sdk 1.33.1 → 1.33.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/core/meter.d.ts +2 -8
- package/lib/core/meter.js +15 -18
- package/lib/core/meter.js.map +1 -1
- package/lib/core/numberish.js +10 -2
- package/lib/core/numberish.js.map +1 -1
- package/lib/gen/chainquery/protos/chainquery.d.ts +25 -2
- package/lib/gen/chainquery/protos/chainquery.js +49 -9
- package/lib/gen/chainquery/protos/chainquery.js.map +1 -1
- package/lib/gen/processor/protos/processor.d.ts +10 -0
- package/lib/gen/processor/protos/processor.js +57 -2
- package/lib/gen/processor/protos/processor.js.map +1 -1
- package/lib/service.js +1 -1
- package/lib/service.js.map +1 -1
- package/lib/utils/chain.js +1 -0
- package/lib/utils/chain.js.map +1 -1
- package/package.json +1 -1
- package/src/core/meter.ts +16 -18
- package/src/core/numberish.ts +11 -2
- package/src/gen/chainquery/protos/chainquery.ts +60 -11
- package/src/gen/processor/protos/processor.ts +56 -0
- package/src/service.ts +1 -2
- package/src/utils/chain.ts +1 -0
package/lib/service.js
CHANGED
|
@@ -75,7 +75,7 @@ class ProcessorServiceImpl {
|
|
|
75
75
|
// part 0, prepare metrics and event tracking configs
|
|
76
76
|
for (const metric of meter_1.MetricState.INSTANCE.getValues()) {
|
|
77
77
|
this.metricConfigs.push({
|
|
78
|
-
...metric.
|
|
78
|
+
...metric.config,
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
81
|
for (const eventTracker of event_tracker_1.EventTrackerState.INSTANCE.getValues()) {
|
package/lib/service.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":";;;;;;AACA,yCAA4D;AAC5D,yCAA6D;AAE7D,+BAyBc;AAGd,gDAAuB;AACvB,+BAAkC;AAGlC,wCAA0C;AAC1C,8CAA+C;AAC/C,wDAAwD;AACxD,6DAIg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IACnD,MAAM,GAAG,GAAG,mBAAa,CAAC,WAAW,CAAC,EAAE,CAAC,CAAA;IAEzC,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE;QACvB,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;QAC9C,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;QACxC,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;QAClC,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;QACxC,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;KAC5C;IACD,OAAO,GAAG,CAAA;AACZ,CAAC;AAED,SAAS,iBAAiB,CAAC,OAAsB,EAAE,WAAwB;IACzE,KAAK,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE;QACpG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;YACjB,CAAC,CAAC,WAAW,GAAG;gBACd,IAAI,EAAE,WAAW;aAClB,CAAA;QACH,CAAC,CAAC,CAAA;KACH;AACH,CAAC;AAED,SAAS,WAAW,CAAC,CAAQ;IAC3B,OAAO,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,OAAO,CAAA;AAC7B,CAAC","sourcesContent":["import { Block, Log } from '@ethersproject/abstract-provider'\nimport { CallContext, ServerError, Status } from 'nice-grpc'\nimport { SOL_MAINMET_ID, SUI_DEVNET_ID } from './utils/chain'\n\nimport {\n AccountConfig,\n AptosCallHandlerConfig,\n AptosEventHandlerConfig,\n BlockBinding,\n ContractConfig,\n DataBinding,\n EventTrackingConfig,\n ExportConfig,\n HandlerType,\n Instruction,\n LogFilter,\n LogHandlerConfig,\n MetricConfig,\n ProcessBindingResponse,\n ProcessBindingsRequest,\n ProcessBlocksRequest,\n ProcessConfigRequest,\n ProcessConfigResponse,\n ProcessInstructionsRequest,\n ProcessorServiceImplementation,\n ProcessResult,\n ProcessTransactionsRequest,\n StartRequest,\n TemplateInstance,\n} from './gen'\n\nimport { Empty } from './gen/google/protobuf/empty'\nimport Long from 'long'\nimport { TextDecoder } from 'util'\nimport { Trace } from './core'\nimport { Instruction as SolInstruction } from '@project-serum/anchor'\nimport { MetricState } from './core/meter'\nimport { ExporterState } from './core/exporter'\nimport { EventTrackerState } from './core/event-tracker'\nimport {\n AptosAccountProcessorState,\n AptosProcessorState,\n MoveResourcesWithVersionPayload,\n} from './aptos/aptos-processor'\nimport { AccountProcessorState } from './core/account-processor'\nimport { SuiProcessorState } from './core/sui-processor'\nimport { SolanaProcessorState } from './core/solana-processor'\nimport { ProcessorState } from './binds'\n\n;(BigInt.prototype as any).toJSON = function () {\n return this.toString()\n}\n\nconst DEFAULT_MAX_BLOCK = Long.ZERO\n\nconst USER_PROCESSOR = 'user_processor'\n\nexport class ProcessorServiceImpl implements ProcessorServiceImplementation {\n // eth handlers\n private eventHandlers: ((event: Log) => Promise<ProcessResult>)[] = []\n private traceHandlers: ((trace: Trace) => Promise<ProcessResult>)[] = []\n private blockHandlers: ((block: Block) => Promise<ProcessResult>)[] = []\n\n // aptos handlers\n private aptosEventHandlers: ((event: any) => Promise<ProcessResult>)[] = []\n private aptosCallHandlers: ((func: any) => Promise<ProcessResult>)[] = []\n private aptosResourceHandlers: ((resourceWithVersion: MoveResourcesWithVersionPayload) => Promise<ProcessResult>)[] =\n []\n\n // map from chain id to list of processors\n // private blockHandlers = new Map<string, ((block: Block) => Promise<ProcessResult>)[]>()\n // private processorsByChainId = new Map<string, BaseProcessor<BaseContract, BoundContractView<BaseContract, any>>>()\n\n private started = false\n private contractConfigs: ContractConfig[]\n private accountConfigs: AccountConfig[]\n private templateInstances: TemplateInstance[]\n private metricConfigs: MetricConfig[]\n private eventTrackingConfigs: EventTrackingConfig[]\n private exportConfigs: ExportConfig[]\n private readonly loader: () => void\n\n private readonly shutdownHandler?: () => void\n\n constructor(loader: () => void, shutdownHandler?: () => void) {\n this.loader = loader\n this.shutdownHandler = shutdownHandler\n }\n\n async getConfig(request: ProcessConfigRequest, context: CallContext): Promise<ProcessConfigResponse> {\n if (!this.started) {\n throw new ServerError(Status.UNAVAILABLE, 'Service Not started.')\n }\n return {\n // TODO project setting\n config: undefined,\n contractConfigs: this.contractConfigs,\n accountConfigs: this.accountConfigs,\n templateInstances: this.templateInstances,\n eventTrackingConfigs: this.eventTrackingConfigs,\n metricConfigs: this.metricConfigs,\n exportConfigs: this.exportConfigs,\n }\n }\n\n async configure() {\n this.eventHandlers = []\n this.templateInstances = []\n // this.processorsByChainId.clear()\n this.contractConfigs = []\n this.accountConfigs = []\n\n this.templateInstances = [...global.PROCESSOR_STATE.templatesInstances]\n this.eventTrackingConfigs = []\n this.metricConfigs = []\n this.exportConfigs = []\n\n // part 0, prepare metrics and event tracking configs\n for (const metric of MetricState.INSTANCE.getValues()) {\n this.metricConfigs.push({\n ...metric.descriptor,\n })\n }\n\n for (const eventTracker of EventTrackerState.INSTANCE.getValues()) {\n this.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 this.exportConfigs.push({\n name: exporter.name,\n channel: exporter.channel,\n })\n }\n\n // Part 1.a, prepare EVM processors\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 = {\n processorType: USER_PROCESSOR,\n contract: {\n name: processor.config.name,\n chainId: chainId.toString(),\n address: processor.config.address,\n abi: '',\n },\n blockConfigs: [],\n intervalConfigs: [],\n logConfigs: [],\n traceConfigs: [],\n startBlock: processor.config.startBlock,\n endBlock: DEFAULT_MAX_BLOCK,\n instructionConfig: undefined,\n aptosEventConfigs: [],\n aptosCallConfigs: [],\n }\n if (processor.config.endBlock) {\n contractConfig.endBlock = processor.config.endBlock\n }\n\n // Step 1. Prepare all the block handlers\n for (const blockHandler of processor.blockHandlers) {\n const handlerId = this.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 })\n }\n\n // Step 2. Prepare all trace handlers\n for (const traceHandler of processor.traceHandlers) {\n const handlerId = this.traceHandlers.push(traceHandler.handler) - 1\n contractConfig.traceConfigs.push({\n signature: traceHandler.signature,\n handlerId: handlerId,\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 = this.eventHandlers.push(eventsHandler.handler) - 1\n const logConfig: LogHandlerConfig = {\n handlerId: handlerId,\n filters: [],\n }\n\n for (const filter of eventsHandler.filters) {\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,\n topics: [],\n }\n\n for (const ts of filter.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 this.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 = {\n address: processor.config.address,\n chainId: processor.getChainId().toString(),\n startBlock: processor.config.startBlock ? Long.fromValue(processor.config.startBlock) : Long.ZERO,\n aptosIntervalConfigs: [],\n intervalConfigs: [],\n logConfigs: [],\n }\n // TODO add interval\n for (const eventsHandler of processor.eventHandlers) {\n // associate id with filter\n const handlerId = this.eventHandlers.push(eventsHandler.handler) - 1\n const logConfig: LogHandlerConfig = {\n handlerId: handlerId,\n filters: [],\n }\n\n for (const filter of eventsHandler.filters) {\n if (!filter.topics) {\n throw new ServerError(Status.INVALID_ARGUMENT, 'Topic should not be null')\n }\n const logFilter: LogFilter = {\n addressType: filter.addressType,\n address: filter.address,\n topics: [],\n }\n\n for (const ts of filter.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 this.accountConfigs.push(accountConfig)\n }\n\n // Part 2, prepare solana constractors\n for (const solanaProcessor of SolanaProcessorState.INSTANCE.getValues()) {\n const contractConfig: ContractConfig = {\n processorType: USER_PROCESSOR,\n contract: {\n name: solanaProcessor.contractName,\n chainId: SOL_MAINMET_ID,\n address: solanaProcessor.address,\n abi: '',\n },\n blockConfigs: [],\n logConfigs: [],\n traceConfigs: [],\n intervalConfigs: [],\n startBlock: solanaProcessor.config.startSlot,\n endBlock: DEFAULT_MAX_BLOCK,\n instructionConfig: {\n innerInstruction: solanaProcessor.processInnerInstruction,\n parsedInstruction: solanaProcessor.fromParsedInstruction !== null,\n rawDataInstruction: solanaProcessor.decodeInstruction !== null,\n },\n aptosEventConfigs: [],\n aptosCallConfigs: [],\n }\n this.contractConfigs.push(contractConfig)\n }\n\n // Part 3, prepare sui constractors\n for (const suiProcessor of SuiProcessorState.INSTANCE.getValues()) {\n const contractConfig: ContractConfig = {\n processorType: USER_PROCESSOR,\n contract: {\n name: 'sui contract',\n chainId: SUI_DEVNET_ID,\n address: suiProcessor.address,\n abi: '',\n },\n blockConfigs: [],\n logConfigs: [],\n intervalConfigs: [],\n traceConfigs: [],\n startBlock: suiProcessor.config.startSeqNumber,\n endBlock: DEFAULT_MAX_BLOCK,\n instructionConfig: undefined,\n aptosEventConfigs: [],\n aptosCallConfigs: [],\n }\n this.contractConfigs.push(contractConfig)\n }\n\n // Part 4, prepare aptos constractors\n for (const aptosProcessor of AptosProcessorState.INSTANCE.getValues()) {\n const contractConfig: ContractConfig = {\n processorType: USER_PROCESSOR,\n contract: {\n name: aptosProcessor.moduleName,\n chainId: aptosProcessor.getChainId(),\n address: aptosProcessor.config.address,\n abi: '',\n },\n blockConfigs: [],\n intervalConfigs: [],\n logConfigs: [],\n traceConfigs: [],\n startBlock: Long.fromString(aptosProcessor.config.startVersion.toString()),\n endBlock: DEFAULT_MAX_BLOCK,\n instructionConfig: undefined,\n aptosEventConfigs: [],\n aptosCallConfigs: [],\n }\n // 1. Prepare event handlers\n for (const handler of aptosProcessor.eventHandlers) {\n const handlerId = this.aptosEventHandlers.push(handler.handler) - 1\n const eventHandlerConfig: AptosEventHandlerConfig = {\n filters: handler.filters.map((f) => {\n return {\n type: f.type,\n account: f.account || '',\n }\n }),\n handlerId,\n }\n contractConfig.aptosEventConfigs.push(eventHandlerConfig)\n }\n\n // 2. Prepare function handlers\n for (const handler of aptosProcessor.callHandlers) {\n const handlerId = this.aptosCallHandlers.push(handler.handler) - 1\n const functionHandlerConfig: AptosCallHandlerConfig = {\n filters: handler.filters.map((filter) => {\n return {\n function: filter.function,\n typeArguments: filter.typeArguments || [],\n withTypeArguments: filter.typeArguments ? true : false,\n includeFailed: filter.includeFailed || false,\n }\n }),\n handlerId,\n }\n contractConfig.aptosCallConfigs.push(functionHandlerConfig)\n }\n this.contractConfigs.push(contractConfig)\n }\n\n for (const aptosProcessor of AptosAccountProcessorState.INSTANCE.getValues()) {\n const accountConfig: AccountConfig = {\n address: aptosProcessor.config.address,\n chainId: aptosProcessor.getChainId(),\n startBlock: Long.fromValue(aptosProcessor.config.startVersion.toString()),\n aptosIntervalConfigs: [],\n intervalConfigs: [],\n logConfigs: [],\n }\n for (const handler of aptosProcessor.resourcesHandlers) {\n const handlerId = this.aptosResourceHandlers.push(handler.handler) - 1\n accountConfig.aptosIntervalConfigs.push({\n intervalConfig: {\n handlerId: handlerId,\n minutes: 0,\n minutesInterval: handler.timeIntervalInMinutes,\n slot: 0,\n slotInterval: handler.versionInterval,\n },\n type: handler.type || '',\n })\n }\n this.accountConfigs.push(accountConfig)\n }\n }\n\n async start(request: StartRequest, context: CallContext): Promise<Empty> {\n if (this.started) {\n return {}\n }\n\n try {\n this.loader()\n } catch (e) {\n throw new ServerError(Status.INVALID_ARGUMENT, 'Failed to load processor: ' + errorString(e))\n }\n\n for (const instance of request.templateInstances) {\n const template = global.PROCESSOR_STATE.templates[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 name: instance.contract.name,\n address: instance.contract.address,\n network: Number(instance.contract.chainId),\n startBlock: instance.startBlock,\n endBlock: instance.endBlock,\n })\n }\n try {\n await this.configure()\n } catch (e) {\n throw new ServerError(Status.INTERNAL, 'Failed to start processor : ' + errorString(e))\n }\n this.started = true\n return {}\n }\n\n async stop(request: Empty, context: CallContext): Promise<Empty> {\n console.log('Server Shutting down in 5 seconds')\n if (this.shutdownHandler) {\n setTimeout(this.shutdownHandler, 5000)\n }\n return {}\n }\n\n async processBindings(request: ProcessBindingsRequest, options?: CallContext): Promise<ProcessBindingResponse> {\n if (!this.started) {\n throw new ServerError(Status.UNAVAILABLE, 'Service Not started.')\n }\n\n const promises = request.bindings.map((binding) => this.processBinding(binding))\n const result = mergeProcessResults(await Promise.all(promises))\n\n let updated = false\n if (\n global.PROCESSOR_STATE.templatesInstances &&\n this.templateInstances.length != global.PROCESSOR_STATE.templatesInstances.length\n ) {\n await this.configure()\n updated = true\n }\n\n return {\n result,\n configUpdated: updated,\n }\n }\n\n async processBinding(request: DataBinding, options?: CallContext): Promise<ProcessResult> {\n if (request.handlerIds.length == 0) {\n request.handlerIds = [request.handlerId]\n }\n\n const processBindingInternal = (request: DataBinding) => {\n switch (request.handlerType) {\n case HandlerType.APT_CALL:\n return this.processAptosFunctionCall(request)\n case HandlerType.APT_EVENT:\n return this.processAptosEvent(request)\n case HandlerType.APT_RESOURCE:\n return this.processAptosResource(request)\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.processBlockNew(request)\n case HandlerType.SOL_INSTRUCTIONS:\n return this.processInstructionsNew(request)\n // TODO migrate SOLANA SUI cases\n // case HandlerType.INSTRUCTION:\n // return this.processInstruction(request)\n default:\n throw new ServerError(Status.INVALID_ARGUMENT, 'No handle type registered ' + request.handlerType)\n }\n }\n\n const result = await processBindingInternal(request)\n recordRuntimeInfo(result, request.handlerType)\n return result\n }\n\n async processLogs(request: ProcessBindingsRequest, context: CallContext): Promise<ProcessBindingResponse> {\n if (!this.started) {\n throw new ServerError(Status.UNAVAILABLE, 'Service Not started.')\n }\n\n const promises: Promise<ProcessResult>[] = []\n for (const l of request.bindings) {\n promises.push(this.processLog(l))\n }\n\n const result = mergeProcessResults(await Promise.all(promises))\n\n let updated = false\n if (\n global.PROCESSOR_STATE.templatesInstances &&\n this.templateInstances.length != global.PROCESSOR_STATE.templatesInstances.length\n ) {\n await this.configure()\n updated = true\n }\n\n recordRuntimeInfo(result, HandlerType.ETH_LOG)\n return {\n result,\n configUpdated: updated,\n }\n }\n\n async processLog(l: DataBinding): Promise<ProcessResult> {\n if (!l.data) {\n throw new ServerError(Status.INVALID_ARGUMENT, \"Log can't be null\")\n }\n if (l.handlerIds.length == 0) {\n l.handlerIds = [l.handlerId]\n }\n\n const promises: Promise<ProcessResult>[] = []\n const jsonString = Utf8ArrayToStr(l.data.raw)\n const log: Log = JSON.parse(jsonString)\n\n for (const handlerId of l.handlerIds) {\n const handler = this.eventHandlers[handlerId]\n promises.push(\n handler(log).catch((e) => {\n throw new ServerError(Status.INTERNAL, 'error processing log: ' + jsonString + '\\n' + errorString(e))\n })\n )\n }\n return mergeProcessResults(await Promise.all(promises))\n }\n\n async processTransactions(\n request: ProcessTransactionsRequest,\n context: CallContext\n ): Promise<ProcessBindingResponse> {\n if (!this.started) {\n throw new ServerError(Status.UNAVAILABLE, 'Service not started.')\n }\n\n const result = ProcessResult.fromPartial({})\n\n if (request.chainId.toLowerCase().startsWith('sui') && SuiProcessorState.INSTANCE.getValues()) {\n const processorPromises: Promise<void>[] = []\n for (const txn of request.transactions) {\n processorPromises.push(\n new Promise((resolve, _) => {\n for (const processor of SuiProcessorState.INSTANCE.getValues()) {\n const res = processor.handleTransaction(\n JSON.parse(new TextDecoder().decode(txn.raw)),\n txn.slot ?? Long.fromNumber(0)\n )\n if (res) {\n res.gauges.forEach((g) => result.gauges.push(g))\n res.counters.forEach((c) => result.counters.push(c))\n res.logs.forEach((l) => result.logs.push(l))\n }\n }\n resolve()\n })\n )\n }\n await Promise.all(processorPromises)\n }\n\n recordRuntimeInfo(result, HandlerType.SUI_TRANSACTION)\n return {\n result,\n configUpdated: false,\n }\n }\n\n async processInstructions(\n request: ProcessInstructionsRequest,\n context: CallContext\n ): Promise<ProcessBindingResponse> {\n if (!this.started) {\n throw new ServerError(Status.UNAVAILABLE, 'Service not started.')\n }\n\n const result = ProcessResult.fromPartial({})\n\n // Only have instruction handlers for solana processors\n if (SolanaProcessorState.INSTANCE.getValues()) {\n const processorPromises: Promise<void>[] = []\n for (const instruction of request.instructions) {\n if (!instruction) {\n throw new ServerError(Status.INVALID_ARGUMENT, 'instruction cannot be null')\n }\n\n processorPromises.push(\n new Promise((resolve, _) => {\n for (const processor of SolanaProcessorState.INSTANCE.getValues()) {\n if (processor.address === instruction.programAccountId) {\n let parsedInstruction: SolInstruction | null = null\n if (instruction.parsed) {\n parsedInstruction = processor.getParsedInstruction(\n JSON.parse(new TextDecoder().decode(instruction.parsed))\n )\n } else if (instruction.instructionData) {\n parsedInstruction = processor.getParsedInstruction(instruction.instructionData)\n }\n if (parsedInstruction == null) {\n continue\n }\n const insHandler = processor.getInstructionHandler(parsedInstruction)\n if (insHandler == null) {\n continue\n }\n const res = processor.handleInstruction(\n parsedInstruction,\n instruction.accounts,\n insHandler,\n instruction.slot\n )\n res.gauges.forEach((g) => result.gauges.push(g))\n res.counters.forEach((c) => result.counters.push(c))\n res.logs.forEach((l) => result.logs.push(l))\n }\n }\n resolve()\n })\n )\n }\n\n await Promise.all(processorPromises)\n }\n\n recordRuntimeInfo(result, HandlerType.SOL_INSTRUCTIONS)\n return {\n result,\n configUpdated: false,\n }\n }\n\n async processInstructionsNew(request: DataBinding): Promise<ProcessResult> {\n if (!this.started) {\n throw new ServerError(Status.UNAVAILABLE, 'Service not started.')\n }\n if (!request.data) {\n throw new ServerError(Status.INVALID_ARGUMENT, 'instruction data cannot be empty')\n }\n\n const jsonString = Utf8ArrayToStr(request.data.raw)\n const instructions: Instruction[] = JSON.parse(jsonString)\n const promises: Promise<ProcessResult>[] = []\n\n // Only have instruction handlers for solana processors\n if (SolanaProcessorState.INSTANCE.getValues()) {\n for (const instruction of instructions) {\n if (!instruction) {\n throw new ServerError(Status.INVALID_ARGUMENT, 'instruction cannot be null')\n }\n\n for (const processor of SolanaProcessorState.INSTANCE.getValues()) {\n if (processor.address === instruction.programAccountId) {\n let parsedInstruction: SolInstruction | null = null\n if (instruction.parsed) {\n parsedInstruction = processor.getParsedInstruction(\n JSON.parse(new TextDecoder().decode(instruction.parsed))\n )\n } else if (instruction.instructionData) {\n parsedInstruction = processor.getParsedInstruction(instruction.instructionData)\n }\n if (parsedInstruction == null) {\n continue\n }\n const insHandler = processor.getInstructionHandler(parsedInstruction)\n if (insHandler == null) {\n continue\n }\n const res = await processor.handleInstruction(\n parsedInstruction,\n instruction.accounts,\n insHandler,\n instruction.slot\n )\n\n promises.push(Promise.resolve(res))\n }\n }\n }\n }\n return mergeProcessResults(await Promise.all(promises))\n }\n\n async processBlocks(request: ProcessBlocksRequest, context: CallContext): Promise<ProcessBindingResponse> {\n if (!this.started) {\n throw new ServerError(Status.UNAVAILABLE, 'Service Not started.')\n }\n\n const promises = request.blockBindings.map((binding) => this.processBlock(binding))\n const result = mergeProcessResults(await Promise.all(promises))\n\n recordRuntimeInfo(result, HandlerType.ETH_BLOCK)\n return {\n result,\n configUpdated: false,\n }\n }\n\n async processBlock(binding: BlockBinding): Promise<ProcessResult> {\n if (!binding.block) {\n throw new ServerError(Status.INVALID_ARGUMENT, \"Block can't be empty\")\n }\n const jsonString = Utf8ArrayToStr(binding.block.raw)\n\n const block: Block = JSON.parse(jsonString)\n\n const promises: Promise<ProcessResult>[] = []\n for (const handlerId of binding.handlerIds) {\n const promise = this.blockHandlers[handlerId](block).catch((e) => {\n throw new ServerError(Status.INTERNAL, 'error processing block: ' + block.number + '\\n' + errorString(e))\n })\n promises.push(promise)\n }\n return mergeProcessResults(await Promise.all(promises))\n }\n\n // TODO remove above old processBlock logic\n async processBlockNew(binding: DataBinding): Promise<ProcessResult> {\n if (!binding.data) {\n throw new ServerError(Status.INVALID_ARGUMENT, \"Block can't be empty\")\n }\n if (binding.handlerIds.length == 0) {\n binding.handlerIds = [binding.handlerId]\n }\n\n const jsonString = Utf8ArrayToStr(binding.data.raw)\n\n const block: Block = JSON.parse(jsonString)\n\n const promises: Promise<ProcessResult>[] = []\n for (const handlerId of binding.handlerIds) {\n promises.push(\n this.blockHandlers[handlerId](block).catch((e) => {\n throw new ServerError(Status.INTERNAL, 'error processing block: ' + block.number + '\\n' + errorString(e))\n })\n )\n }\n return mergeProcessResults(await Promise.all(promises))\n }\n\n async processTraces(request: ProcessBindingsRequest, context: CallContext): Promise<ProcessBindingResponse> {\n if (!this.started) {\n throw new ServerError(Status.UNAVAILABLE, 'Service Not started.')\n }\n\n const promises = request.bindings.map((binding) => this.processTrace(binding))\n const result = mergeProcessResults(await Promise.all(promises))\n\n recordRuntimeInfo(result, HandlerType.ETH_TRACE)\n return {\n result,\n configUpdated: false,\n }\n }\n\n async processTrace(binding: DataBinding): Promise<ProcessResult> {\n if (!binding.data) {\n throw new ServerError(Status.INVALID_ARGUMENT, \"Trace can't be empty\")\n }\n if (binding.handlerIds.length == 0) {\n binding.handlerIds = [binding.handlerId]\n }\n const jsonString = Utf8ArrayToStr(binding.data.raw)\n const trace: Trace = JSON.parse(jsonString)\n\n const promises: Promise<ProcessResult>[] = []\n\n for (const handlerId of binding.handlerIds) {\n promises.push(\n this.traceHandlers[handlerId](trace).catch((e) => {\n throw new ServerError(Status.INTERNAL, 'error processing trace: ' + jsonString + '\\n' + errorString(e))\n })\n )\n }\n return mergeProcessResults(await Promise.all(promises))\n }\n\n async processAptosEvent(binding: DataBinding): Promise<ProcessResult> {\n if (!binding.data) {\n throw new ServerError(Status.INVALID_ARGUMENT, \"Event can't be empty\")\n }\n const promises: Promise<ProcessResult>[] = []\n const jsonString = Utf8ArrayToStr(binding.data.raw)\n const event = JSON.parse(jsonString)\n\n for (const handlerId of binding.handlerIds) {\n // only support aptos event for now\n promises.push(\n this.aptosEventHandlers[handlerId](event).catch((e) => {\n throw new ServerError(Status.INTERNAL, 'error processing event: ' + jsonString + '\\n' + errorString(e))\n })\n )\n }\n return mergeProcessResults(await Promise.all(promises))\n }\n\n async processAptosResource(binding: DataBinding): Promise<ProcessResult> {\n if (!binding.data) {\n throw new ServerError(Status.INVALID_ARGUMENT, \"Event can't be empty\")\n }\n const jsonString = Utf8ArrayToStr(binding.data.raw)\n const json = JSON.parse(jsonString) as MoveResourcesWithVersionPayload\n const promises: Promise<ProcessResult>[] = []\n for (const handlerId of binding.handlerIds) {\n promises.push(\n this.aptosResourceHandlers[handlerId](json).catch((e) => {\n throw new ServerError(Status.INTERNAL, 'error processing event: ' + jsonString + '\\n' + errorString(e))\n })\n )\n }\n return mergeProcessResults(await Promise.all(promises))\n }\n\n async processAptosFunctionCall(binding: DataBinding): Promise<ProcessResult> {\n if (!binding.data) {\n throw new ServerError(Status.INVALID_ARGUMENT, \"Event can't be empty\")\n }\n const jsonString = Utf8ArrayToStr(binding.data.raw)\n const call = JSON.parse(jsonString)\n\n const promises: Promise<ProcessResult>[] = []\n for (const handlerId of binding.handlerIds) {\n // only support aptos call for now\n const promise = this.aptosCallHandlers[handlerId](call).catch((e) => {\n throw new ServerError(Status.INTERNAL, 'error processing call: ' + jsonString + '\\n' + errorString(e))\n })\n promises.push(promise)\n }\n return mergeProcessResults(await Promise.all(promises))\n }\n}\n\n// https://ourcodeworld.com/articles/read/164/how-to-convert-an-uint8array-to-string-in-javascript\n/* eslint-disable */\nfunction Utf8ArrayToStr(array: Uint8Array) {\n let out, i, len, c\n let char2, char3\n\n out = ''\n len = array.length\n i = 0\n while (i < len) {\n c = array[i++]\n switch (c >> 4) {\n case 0:\n case 1:\n case 2:\n case 3:\n case 4:\n case 5:\n case 6:\n case 7:\n // 0xxxxxxx\n out += String.fromCharCode(c)\n break\n case 12:\n case 13:\n // 110x xxxx 10xx xxxx\n char2 = array[i++]\n out += String.fromCharCode(((c & 0x1f) << 6) | (char2 & 0x3f))\n break\n case 14:\n // 1110 xxxx 10xx xxxx 10xx xxxx\n char2 = array[i++]\n char3 = array[i++]\n out += String.fromCharCode(((c & 0x0f) << 12) | ((char2 & 0x3f) << 6) | ((char3 & 0x3f) << 0))\n break\n }\n }\n\n return out\n}\n\nfunction mergeProcessResults(results: ProcessResult[]): ProcessResult {\n const res = ProcessResult.fromPartial({})\n\n for (const r of results) {\n res.counters = res.counters.concat(r.counters)\n res.gauges = res.gauges.concat(r.gauges)\n res.logs = res.logs.concat(r.logs)\n res.events = res.events.concat(r.events)\n res.exports = res.exports.concat(r.exports)\n }\n return res\n}\n\nfunction recordRuntimeInfo(results: ProcessResult, handlerType: HandlerType) {\n for (const list of [results.gauges, results.counters, results.logs, results.events, results.exports]) {\n list.forEach((e) => {\n e.runtimeInfo = {\n from: handlerType,\n }\n })\n }\n}\n\nfunction errorString(e: Error): string {\n return e.stack || e.message\n}\n"]}
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":";;;;;;AACA,yCAA4D;AAC5D,yCAA6D;AAE7D,+BAyBc;AAGd,gDAAuB;AACvB,+BAAkC;AAGlC,wCAA0C;AAC1C,8CAA+C;AAC/C,wDAAwD;AACxD,6DAIgC;AAChC,gEAAgE;AAChE,wDAAwD;AACxD,8DAA8D;AAC9D,mCACC;AAAC,MAAM,CAAC,SAAiB,CAAC,MAAM,GAAG;IAClC,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAA;AACxB,CAAC,CAAA;AAED,MAAM,iBAAiB,GAAG,cAAI,CAAC,IAAI,CAAA;AAEnC,MAAM,cAAc,GAAG,gBAAgB,CAAA;AAEvC,MAAa,oBAAoB;IAC/B,eAAe;IACP,aAAa,GAA+C,EAAE,CAAA;IAC9D,aAAa,GAAiD,EAAE,CAAA;IAChE,aAAa,GAAiD,EAAE,CAAA;IAExE,iBAAiB;IACT,kBAAkB,GAA+C,EAAE,CAAA;IACnE,iBAAiB,GAA8C,EAAE,CAAA;IACjE,qBAAqB,GAC3B,EAAE,CAAA;IAEJ,0CAA0C;IAC1C,0FAA0F;IAC1F,qHAAqH;IAE7G,OAAO,GAAG,KAAK,CAAA;IACf,eAAe,CAAkB;IACjC,cAAc,CAAiB;IAC/B,iBAAiB,CAAoB;IACrC,aAAa,CAAgB;IAC7B,oBAAoB,CAAuB;IAC3C,aAAa,CAAgB;IACpB,MAAM,CAAY;IAElB,eAAe,CAAa;IAE7C,YAAY,MAAkB,EAAE,eAA4B;QAC1D,IAA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AC,IAAI,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE;QACpG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;YACjB,CAAC,CAAC,WAAW,GAAG;gBACd,IAAI,EAAE,WAAW;aAClB,CAAA;QACH,CAAC,CAAC,CAAA;KACH;AACH,CAAC;AAED,SAAS,WAAW,CAAC,CAAQ;IAC3B,OAAO,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,OAAO,CAAA;AAC7B,CAAC","sourcesContent":["import { Block, Log } from '@ethersproject/abstract-provider'\nimport { CallContext, ServerError, Status } from 'nice-grpc'\nimport { SOL_MAINMET_ID, SUI_DEVNET_ID } from './utils/chain'\n\nimport {\n AccountConfig,\n AptosCallHandlerConfig,\n AptosEventHandlerConfig,\n BlockBinding,\n ContractConfig,\n DataBinding,\n EventTrackingConfig,\n ExportConfig,\n HandlerType,\n Instruction,\n LogFilter,\n LogHandlerConfig,\n MetricConfig,\n ProcessBindingResponse,\n ProcessBindingsRequest,\n ProcessBlocksRequest,\n ProcessConfigRequest,\n ProcessConfigResponse,\n ProcessInstructionsRequest,\n ProcessorServiceImplementation,\n ProcessResult,\n ProcessTransactionsRequest,\n StartRequest,\n TemplateInstance,\n} from './gen'\n\nimport { Empty } from './gen/google/protobuf/empty'\nimport Long from 'long'\nimport { TextDecoder } from 'util'\nimport { Trace } from './core'\nimport { Instruction as SolInstruction } from '@project-serum/anchor'\nimport { MetricState } from './core/meter'\nimport { ExporterState } from './core/exporter'\nimport { EventTrackerState } from './core/event-tracker'\nimport {\n AptosAccountProcessorState,\n AptosProcessorState,\n MoveResourcesWithVersionPayload,\n} from './aptos/aptos-processor'\nimport { AccountProcessorState } from './core/account-processor'\nimport { SuiProcessorState } from './core/sui-processor'\nimport { SolanaProcessorState } from './core/solana-processor'\nimport { ProcessorState } from './binds'\n;(BigInt.prototype as any).toJSON = function () {\n return this.toString()\n}\n\nconst DEFAULT_MAX_BLOCK = Long.ZERO\n\nconst USER_PROCESSOR = 'user_processor'\n\nexport class ProcessorServiceImpl implements ProcessorServiceImplementation {\n // eth handlers\n private eventHandlers: ((event: Log) => Promise<ProcessResult>)[] = []\n private traceHandlers: ((trace: Trace) => Promise<ProcessResult>)[] = []\n private blockHandlers: ((block: Block) => Promise<ProcessResult>)[] = []\n\n // aptos handlers\n private aptosEventHandlers: ((event: any) => Promise<ProcessResult>)[] = []\n private aptosCallHandlers: ((func: any) => Promise<ProcessResult>)[] = []\n private aptosResourceHandlers: ((resourceWithVersion: MoveResourcesWithVersionPayload) => Promise<ProcessResult>)[] =\n []\n\n // map from chain id to list of processors\n // private blockHandlers = new Map<string, ((block: Block) => Promise<ProcessResult>)[]>()\n // private processorsByChainId = new Map<string, BaseProcessor<BaseContract, BoundContractView<BaseContract, any>>>()\n\n private started = false\n private contractConfigs: ContractConfig[]\n private accountConfigs: AccountConfig[]\n private templateInstances: TemplateInstance[]\n private metricConfigs: MetricConfig[]\n private eventTrackingConfigs: EventTrackingConfig[]\n private exportConfigs: ExportConfig[]\n private readonly loader: () => void\n\n private readonly shutdownHandler?: () => void\n\n constructor(loader: () => void, shutdownHandler?: () => void) {\n this.loader = loader\n this.shutdownHandler = shutdownHandler\n }\n\n async getConfig(request: ProcessConfigRequest, context: CallContext): Promise<ProcessConfigResponse> {\n if (!this.started) {\n throw new ServerError(Status.UNAVAILABLE, 'Service Not started.')\n }\n return {\n // TODO project setting\n config: undefined,\n contractConfigs: this.contractConfigs,\n accountConfigs: this.accountConfigs,\n templateInstances: this.templateInstances,\n eventTrackingConfigs: this.eventTrackingConfigs,\n metricConfigs: this.metricConfigs,\n exportConfigs: this.exportConfigs,\n }\n }\n\n async configure() {\n this.eventHandlers = []\n this.templateInstances = []\n // this.processorsByChainId.clear()\n this.contractConfigs = []\n this.accountConfigs = []\n\n this.templateInstances = [...global.PROCESSOR_STATE.templatesInstances]\n this.eventTrackingConfigs = []\n this.metricConfigs = []\n this.exportConfigs = []\n\n // part 0, prepare metrics and event tracking configs\n for (const metric of MetricState.INSTANCE.getValues()) {\n this.metricConfigs.push({\n ...metric.config,\n })\n }\n\n for (const eventTracker of EventTrackerState.INSTANCE.getValues()) {\n this.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 this.exportConfigs.push({\n name: exporter.name,\n channel: exporter.channel,\n })\n }\n\n // Part 1.a, prepare EVM processors\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 = {\n processorType: USER_PROCESSOR,\n contract: {\n name: processor.config.name,\n chainId: chainId.toString(),\n address: processor.config.address,\n abi: '',\n },\n blockConfigs: [],\n intervalConfigs: [],\n logConfigs: [],\n traceConfigs: [],\n startBlock: processor.config.startBlock,\n endBlock: DEFAULT_MAX_BLOCK,\n instructionConfig: undefined,\n aptosEventConfigs: [],\n aptosCallConfigs: [],\n }\n if (processor.config.endBlock) {\n contractConfig.endBlock = processor.config.endBlock\n }\n\n // Step 1. Prepare all the block handlers\n for (const blockHandler of processor.blockHandlers) {\n const handlerId = this.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 })\n }\n\n // Step 2. Prepare all trace handlers\n for (const traceHandler of processor.traceHandlers) {\n const handlerId = this.traceHandlers.push(traceHandler.handler) - 1\n contractConfig.traceConfigs.push({\n signature: traceHandler.signature,\n handlerId: handlerId,\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 = this.eventHandlers.push(eventsHandler.handler) - 1\n const logConfig: LogHandlerConfig = {\n handlerId: handlerId,\n filters: [],\n }\n\n for (const filter of eventsHandler.filters) {\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,\n topics: [],\n }\n\n for (const ts of filter.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 this.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 = {\n address: processor.config.address,\n chainId: processor.getChainId().toString(),\n startBlock: processor.config.startBlock ? Long.fromValue(processor.config.startBlock) : Long.ZERO,\n aptosIntervalConfigs: [],\n intervalConfigs: [],\n logConfigs: [],\n }\n // TODO add interval\n for (const eventsHandler of processor.eventHandlers) {\n // associate id with filter\n const handlerId = this.eventHandlers.push(eventsHandler.handler) - 1\n const logConfig: LogHandlerConfig = {\n handlerId: handlerId,\n filters: [],\n }\n\n for (const filter of eventsHandler.filters) {\n if (!filter.topics) {\n throw new ServerError(Status.INVALID_ARGUMENT, 'Topic should not be null')\n }\n const logFilter: LogFilter = {\n addressType: filter.addressType,\n address: filter.address,\n topics: [],\n }\n\n for (const ts of filter.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 this.accountConfigs.push(accountConfig)\n }\n\n // Part 2, prepare solana constractors\n for (const solanaProcessor of SolanaProcessorState.INSTANCE.getValues()) {\n const contractConfig: ContractConfig = {\n processorType: USER_PROCESSOR,\n contract: {\n name: solanaProcessor.contractName,\n chainId: SOL_MAINMET_ID,\n address: solanaProcessor.address,\n abi: '',\n },\n blockConfigs: [],\n logConfigs: [],\n traceConfigs: [],\n intervalConfigs: [],\n startBlock: solanaProcessor.config.startSlot,\n endBlock: DEFAULT_MAX_BLOCK,\n instructionConfig: {\n innerInstruction: solanaProcessor.processInnerInstruction,\n parsedInstruction: solanaProcessor.fromParsedInstruction !== null,\n rawDataInstruction: solanaProcessor.decodeInstruction !== null,\n },\n aptosEventConfigs: [],\n aptosCallConfigs: [],\n }\n this.contractConfigs.push(contractConfig)\n }\n\n // Part 3, prepare sui constractors\n for (const suiProcessor of SuiProcessorState.INSTANCE.getValues()) {\n const contractConfig: ContractConfig = {\n processorType: USER_PROCESSOR,\n contract: {\n name: 'sui contract',\n chainId: SUI_DEVNET_ID,\n address: suiProcessor.address,\n abi: '',\n },\n blockConfigs: [],\n logConfigs: [],\n intervalConfigs: [],\n traceConfigs: [],\n startBlock: suiProcessor.config.startSeqNumber,\n endBlock: DEFAULT_MAX_BLOCK,\n instructionConfig: undefined,\n aptosEventConfigs: [],\n aptosCallConfigs: [],\n }\n this.contractConfigs.push(contractConfig)\n }\n\n // Part 4, prepare aptos constractors\n for (const aptosProcessor of AptosProcessorState.INSTANCE.getValues()) {\n const contractConfig: ContractConfig = {\n processorType: USER_PROCESSOR,\n contract: {\n name: aptosProcessor.moduleName,\n chainId: aptosProcessor.getChainId(),\n address: aptosProcessor.config.address,\n abi: '',\n },\n blockConfigs: [],\n intervalConfigs: [],\n logConfigs: [],\n traceConfigs: [],\n startBlock: Long.fromString(aptosProcessor.config.startVersion.toString()),\n endBlock: DEFAULT_MAX_BLOCK,\n instructionConfig: undefined,\n aptosEventConfigs: [],\n aptosCallConfigs: [],\n }\n // 1. Prepare event handlers\n for (const handler of aptosProcessor.eventHandlers) {\n const handlerId = this.aptosEventHandlers.push(handler.handler) - 1\n const eventHandlerConfig: AptosEventHandlerConfig = {\n filters: handler.filters.map((f) => {\n return {\n type: f.type,\n account: f.account || '',\n }\n }),\n handlerId,\n }\n contractConfig.aptosEventConfigs.push(eventHandlerConfig)\n }\n\n // 2. Prepare function handlers\n for (const handler of aptosProcessor.callHandlers) {\n const handlerId = this.aptosCallHandlers.push(handler.handler) - 1\n const functionHandlerConfig: AptosCallHandlerConfig = {\n filters: handler.filters.map((filter) => {\n return {\n function: filter.function,\n typeArguments: filter.typeArguments || [],\n withTypeArguments: filter.typeArguments ? true : false,\n includeFailed: filter.includeFailed || false,\n }\n }),\n handlerId,\n }\n contractConfig.aptosCallConfigs.push(functionHandlerConfig)\n }\n this.contractConfigs.push(contractConfig)\n }\n\n for (const aptosProcessor of AptosAccountProcessorState.INSTANCE.getValues()) {\n const accountConfig: AccountConfig = {\n address: aptosProcessor.config.address,\n chainId: aptosProcessor.getChainId(),\n startBlock: Long.fromValue(aptosProcessor.config.startVersion.toString()),\n aptosIntervalConfigs: [],\n intervalConfigs: [],\n logConfigs: [],\n }\n for (const handler of aptosProcessor.resourcesHandlers) {\n const handlerId = this.aptosResourceHandlers.push(handler.handler) - 1\n accountConfig.aptosIntervalConfigs.push({\n intervalConfig: {\n handlerId: handlerId,\n minutes: 0,\n minutesInterval: handler.timeIntervalInMinutes,\n slot: 0,\n slotInterval: handler.versionInterval,\n },\n type: handler.type || '',\n })\n }\n this.accountConfigs.push(accountConfig)\n }\n }\n\n async start(request: StartRequest, context: CallContext): Promise<Empty> {\n if (this.started) {\n return {}\n }\n\n try {\n this.loader()\n } catch (e) {\n throw new ServerError(Status.INVALID_ARGUMENT, 'Failed to load processor: ' + errorString(e))\n }\n\n for (const instance of request.templateInstances) {\n const template = global.PROCESSOR_STATE.templates[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 name: instance.contract.name,\n address: instance.contract.address,\n network: Number(instance.contract.chainId),\n startBlock: instance.startBlock,\n endBlock: instance.endBlock,\n })\n }\n try {\n await this.configure()\n } catch (e) {\n throw new ServerError(Status.INTERNAL, 'Failed to start processor : ' + errorString(e))\n }\n this.started = true\n return {}\n }\n\n async stop(request: Empty, context: CallContext): Promise<Empty> {\n console.log('Server Shutting down in 5 seconds')\n if (this.shutdownHandler) {\n setTimeout(this.shutdownHandler, 5000)\n }\n return {}\n }\n\n async processBindings(request: ProcessBindingsRequest, options?: CallContext): Promise<ProcessBindingResponse> {\n if (!this.started) {\n throw new ServerError(Status.UNAVAILABLE, 'Service Not started.')\n }\n\n const promises = request.bindings.map((binding) => this.processBinding(binding))\n const result = mergeProcessResults(await Promise.all(promises))\n\n let updated = false\n if (\n global.PROCESSOR_STATE.templatesInstances &&\n this.templateInstances.length != global.PROCESSOR_STATE.templatesInstances.length\n ) {\n await this.configure()\n updated = true\n }\n\n return {\n result,\n configUpdated: updated,\n }\n }\n\n async processBinding(request: DataBinding, options?: CallContext): Promise<ProcessResult> {\n if (request.handlerIds.length == 0) {\n request.handlerIds = [request.handlerId]\n }\n\n const processBindingInternal = (request: DataBinding) => {\n switch (request.handlerType) {\n case HandlerType.APT_CALL:\n return this.processAptosFunctionCall(request)\n case HandlerType.APT_EVENT:\n return this.processAptosEvent(request)\n case HandlerType.APT_RESOURCE:\n return this.processAptosResource(request)\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.processBlockNew(request)\n case HandlerType.SOL_INSTRUCTIONS:\n return this.processInstructionsNew(request)\n // TODO migrate SOLANA SUI cases\n // case HandlerType.INSTRUCTION:\n // return this.processInstruction(request)\n default:\n throw new ServerError(Status.INVALID_ARGUMENT, 'No handle type registered ' + request.handlerType)\n }\n }\n\n const result = await processBindingInternal(request)\n recordRuntimeInfo(result, request.handlerType)\n return result\n }\n\n async processLogs(request: ProcessBindingsRequest, context: CallContext): Promise<ProcessBindingResponse> {\n if (!this.started) {\n throw new ServerError(Status.UNAVAILABLE, 'Service Not started.')\n }\n\n const promises: Promise<ProcessResult>[] = []\n for (const l of request.bindings) {\n promises.push(this.processLog(l))\n }\n\n const result = mergeProcessResults(await Promise.all(promises))\n\n let updated = false\n if (\n global.PROCESSOR_STATE.templatesInstances &&\n this.templateInstances.length != global.PROCESSOR_STATE.templatesInstances.length\n ) {\n await this.configure()\n updated = true\n }\n\n recordRuntimeInfo(result, HandlerType.ETH_LOG)\n return {\n result,\n configUpdated: updated,\n }\n }\n\n async processLog(l: DataBinding): Promise<ProcessResult> {\n if (!l.data) {\n throw new ServerError(Status.INVALID_ARGUMENT, \"Log can't be null\")\n }\n if (l.handlerIds.length == 0) {\n l.handlerIds = [l.handlerId]\n }\n\n const promises: Promise<ProcessResult>[] = []\n const jsonString = Utf8ArrayToStr(l.data.raw)\n const log: Log = JSON.parse(jsonString)\n\n for (const handlerId of l.handlerIds) {\n const handler = this.eventHandlers[handlerId]\n promises.push(\n handler(log).catch((e) => {\n throw new ServerError(Status.INTERNAL, 'error processing log: ' + jsonString + '\\n' + errorString(e))\n })\n )\n }\n return mergeProcessResults(await Promise.all(promises))\n }\n\n async processTransactions(\n request: ProcessTransactionsRequest,\n context: CallContext\n ): Promise<ProcessBindingResponse> {\n if (!this.started) {\n throw new ServerError(Status.UNAVAILABLE, 'Service not started.')\n }\n\n const result = ProcessResult.fromPartial({})\n\n if (request.chainId.toLowerCase().startsWith('sui') && SuiProcessorState.INSTANCE.getValues()) {\n const processorPromises: Promise<void>[] = []\n for (const txn of request.transactions) {\n processorPromises.push(\n new Promise((resolve, _) => {\n for (const processor of SuiProcessorState.INSTANCE.getValues()) {\n const res = processor.handleTransaction(\n JSON.parse(new TextDecoder().decode(txn.raw)),\n txn.slot ?? Long.fromNumber(0)\n )\n if (res) {\n res.gauges.forEach((g) => result.gauges.push(g))\n res.counters.forEach((c) => result.counters.push(c))\n res.logs.forEach((l) => result.logs.push(l))\n }\n }\n resolve()\n })\n )\n }\n await Promise.all(processorPromises)\n }\n\n recordRuntimeInfo(result, HandlerType.SUI_TRANSACTION)\n return {\n result,\n configUpdated: false,\n }\n }\n\n async processInstructions(\n request: ProcessInstructionsRequest,\n context: CallContext\n ): Promise<ProcessBindingResponse> {\n if (!this.started) {\n throw new ServerError(Status.UNAVAILABLE, 'Service not started.')\n }\n\n const result = ProcessResult.fromPartial({})\n\n // Only have instruction handlers for solana processors\n if (SolanaProcessorState.INSTANCE.getValues()) {\n const processorPromises: Promise<void>[] = []\n for (const instruction of request.instructions) {\n if (!instruction) {\n throw new ServerError(Status.INVALID_ARGUMENT, 'instruction cannot be null')\n }\n\n processorPromises.push(\n new Promise((resolve, _) => {\n for (const processor of SolanaProcessorState.INSTANCE.getValues()) {\n if (processor.address === instruction.programAccountId) {\n let parsedInstruction: SolInstruction | null = null\n if (instruction.parsed) {\n parsedInstruction = processor.getParsedInstruction(\n JSON.parse(new TextDecoder().decode(instruction.parsed))\n )\n } else if (instruction.instructionData) {\n parsedInstruction = processor.getParsedInstruction(instruction.instructionData)\n }\n if (parsedInstruction == null) {\n continue\n }\n const insHandler = processor.getInstructionHandler(parsedInstruction)\n if (insHandler == null) {\n continue\n }\n const res = processor.handleInstruction(\n parsedInstruction,\n instruction.accounts,\n insHandler,\n instruction.slot\n )\n res.gauges.forEach((g) => result.gauges.push(g))\n res.counters.forEach((c) => result.counters.push(c))\n res.logs.forEach((l) => result.logs.push(l))\n }\n }\n resolve()\n })\n )\n }\n\n await Promise.all(processorPromises)\n }\n\n recordRuntimeInfo(result, HandlerType.SOL_INSTRUCTIONS)\n return {\n result,\n configUpdated: false,\n }\n }\n\n async processInstructionsNew(request: DataBinding): Promise<ProcessResult> {\n if (!this.started) {\n throw new ServerError(Status.UNAVAILABLE, 'Service not started.')\n }\n if (!request.data) {\n throw new ServerError(Status.INVALID_ARGUMENT, 'instruction data cannot be empty')\n }\n\n const jsonString = Utf8ArrayToStr(request.data.raw)\n const instructions: Instruction[] = JSON.parse(jsonString)\n const promises: Promise<ProcessResult>[] = []\n\n // Only have instruction handlers for solana processors\n if (SolanaProcessorState.INSTANCE.getValues()) {\n for (const instruction of instructions) {\n if (!instruction) {\n throw new ServerError(Status.INVALID_ARGUMENT, 'instruction cannot be null')\n }\n\n for (const processor of SolanaProcessorState.INSTANCE.getValues()) {\n if (processor.address === instruction.programAccountId) {\n let parsedInstruction: SolInstruction | null = null\n if (instruction.parsed) {\n parsedInstruction = processor.getParsedInstruction(\n JSON.parse(new TextDecoder().decode(instruction.parsed))\n )\n } else if (instruction.instructionData) {\n parsedInstruction = processor.getParsedInstruction(instruction.instructionData)\n }\n if (parsedInstruction == null) {\n continue\n }\n const insHandler = processor.getInstructionHandler(parsedInstruction)\n if (insHandler == null) {\n continue\n }\n const res = await processor.handleInstruction(\n parsedInstruction,\n instruction.accounts,\n insHandler,\n instruction.slot\n )\n\n promises.push(Promise.resolve(res))\n }\n }\n }\n }\n return mergeProcessResults(await Promise.all(promises))\n }\n\n async processBlocks(request: ProcessBlocksRequest, context: CallContext): Promise<ProcessBindingResponse> {\n if (!this.started) {\n throw new ServerError(Status.UNAVAILABLE, 'Service Not started.')\n }\n\n const promises = request.blockBindings.map((binding) => this.processBlock(binding))\n const result = mergeProcessResults(await Promise.all(promises))\n\n recordRuntimeInfo(result, HandlerType.ETH_BLOCK)\n return {\n result,\n configUpdated: false,\n }\n }\n\n async processBlock(binding: BlockBinding): Promise<ProcessResult> {\n if (!binding.block) {\n throw new ServerError(Status.INVALID_ARGUMENT, \"Block can't be empty\")\n }\n const jsonString = Utf8ArrayToStr(binding.block.raw)\n\n const block: Block = JSON.parse(jsonString)\n\n const promises: Promise<ProcessResult>[] = []\n for (const handlerId of binding.handlerIds) {\n const promise = this.blockHandlers[handlerId](block).catch((e) => {\n throw new ServerError(Status.INTERNAL, 'error processing block: ' + block.number + '\\n' + errorString(e))\n })\n promises.push(promise)\n }\n return mergeProcessResults(await Promise.all(promises))\n }\n\n // TODO remove above old processBlock logic\n async processBlockNew(binding: DataBinding): Promise<ProcessResult> {\n if (!binding.data) {\n throw new ServerError(Status.INVALID_ARGUMENT, \"Block can't be empty\")\n }\n if (binding.handlerIds.length == 0) {\n binding.handlerIds = [binding.handlerId]\n }\n\n const jsonString = Utf8ArrayToStr(binding.data.raw)\n\n const block: Block = JSON.parse(jsonString)\n\n const promises: Promise<ProcessResult>[] = []\n for (const handlerId of binding.handlerIds) {\n promises.push(\n this.blockHandlers[handlerId](block).catch((e) => {\n throw new ServerError(Status.INTERNAL, 'error processing block: ' + block.number + '\\n' + errorString(e))\n })\n )\n }\n return mergeProcessResults(await Promise.all(promises))\n }\n\n async processTraces(request: ProcessBindingsRequest, context: CallContext): Promise<ProcessBindingResponse> {\n if (!this.started) {\n throw new ServerError(Status.UNAVAILABLE, 'Service Not started.')\n }\n\n const promises = request.bindings.map((binding) => this.processTrace(binding))\n const result = mergeProcessResults(await Promise.all(promises))\n\n recordRuntimeInfo(result, HandlerType.ETH_TRACE)\n return {\n result,\n configUpdated: false,\n }\n }\n\n async processTrace(binding: DataBinding): Promise<ProcessResult> {\n if (!binding.data) {\n throw new ServerError(Status.INVALID_ARGUMENT, \"Trace can't be empty\")\n }\n if (binding.handlerIds.length == 0) {\n binding.handlerIds = [binding.handlerId]\n }\n const jsonString = Utf8ArrayToStr(binding.data.raw)\n const trace: Trace = JSON.parse(jsonString)\n\n const promises: Promise<ProcessResult>[] = []\n\n for (const handlerId of binding.handlerIds) {\n promises.push(\n this.traceHandlers[handlerId](trace).catch((e) => {\n throw new ServerError(Status.INTERNAL, 'error processing trace: ' + jsonString + '\\n' + errorString(e))\n })\n )\n }\n return mergeProcessResults(await Promise.all(promises))\n }\n\n async processAptosEvent(binding: DataBinding): Promise<ProcessResult> {\n if (!binding.data) {\n throw new ServerError(Status.INVALID_ARGUMENT, \"Event can't be empty\")\n }\n const promises: Promise<ProcessResult>[] = []\n const jsonString = Utf8ArrayToStr(binding.data.raw)\n const event = JSON.parse(jsonString)\n\n for (const handlerId of binding.handlerIds) {\n // only support aptos event for now\n promises.push(\n this.aptosEventHandlers[handlerId](event).catch((e) => {\n throw new ServerError(Status.INTERNAL, 'error processing event: ' + jsonString + '\\n' + errorString(e))\n })\n )\n }\n return mergeProcessResults(await Promise.all(promises))\n }\n\n async processAptosResource(binding: DataBinding): Promise<ProcessResult> {\n if (!binding.data) {\n throw new ServerError(Status.INVALID_ARGUMENT, \"Event can't be empty\")\n }\n const jsonString = Utf8ArrayToStr(binding.data.raw)\n const json = JSON.parse(jsonString) as MoveResourcesWithVersionPayload\n const promises: Promise<ProcessResult>[] = []\n for (const handlerId of binding.handlerIds) {\n promises.push(\n this.aptosResourceHandlers[handlerId](json).catch((e) => {\n throw new ServerError(Status.INTERNAL, 'error processing event: ' + jsonString + '\\n' + errorString(e))\n })\n )\n }\n return mergeProcessResults(await Promise.all(promises))\n }\n\n async processAptosFunctionCall(binding: DataBinding): Promise<ProcessResult> {\n if (!binding.data) {\n throw new ServerError(Status.INVALID_ARGUMENT, \"Event can't be empty\")\n }\n const jsonString = Utf8ArrayToStr(binding.data.raw)\n const call = JSON.parse(jsonString)\n\n const promises: Promise<ProcessResult>[] = []\n for (const handlerId of binding.handlerIds) {\n // only support aptos call for now\n const promise = this.aptosCallHandlers[handlerId](call).catch((e) => {\n throw new ServerError(Status.INTERNAL, 'error processing call: ' + jsonString + '\\n' + errorString(e))\n })\n promises.push(promise)\n }\n return mergeProcessResults(await Promise.all(promises))\n }\n}\n\n// https://ourcodeworld.com/articles/read/164/how-to-convert-an-uint8array-to-string-in-javascript\n/* eslint-disable */\nfunction Utf8ArrayToStr(array: Uint8Array) {\n let out, i, len, c\n let char2, char3\n\n out = ''\n len = array.length\n i = 0\n while (i < len) {\n c = array[i++]\n switch (c >> 4) {\n case 0:\n case 1:\n case 2:\n case 3:\n case 4:\n case 5:\n case 6:\n case 7:\n // 0xxxxxxx\n out += String.fromCharCode(c)\n break\n case 12:\n case 13:\n // 110x xxxx 10xx xxxx\n char2 = array[i++]\n out += String.fromCharCode(((c & 0x1f) << 6) | (char2 & 0x3f))\n break\n case 14:\n // 1110 xxxx 10xx xxxx 10xx xxxx\n char2 = array[i++]\n char3 = array[i++]\n out += String.fromCharCode(((c & 0x0f) << 12) | ((char2 & 0x3f) << 6) | ((char3 & 0x3f) << 0))\n break\n }\n }\n\n return out\n}\n\nfunction mergeProcessResults(results: ProcessResult[]): ProcessResult {\n const res = ProcessResult.fromPartial({})\n\n for (const r of results) {\n res.counters = res.counters.concat(r.counters)\n res.gauges = res.gauges.concat(r.gauges)\n res.logs = res.logs.concat(r.logs)\n res.events = res.events.concat(r.events)\n res.exports = res.exports.concat(r.exports)\n }\n return res\n}\n\nfunction recordRuntimeInfo(results: ProcessResult, handlerType: HandlerType) {\n for (const list of [results.gauges, results.counters, results.logs, results.events, results.exports]) {\n list.forEach((e) => {\n e.runtimeInfo = {\n from: handlerType,\n }\n })\n }\n}\n\nfunction errorString(e: Error): string {\n return e.stack || e.message\n}\n"]}
|
package/lib/utils/chain.js
CHANGED
package/lib/utils/chain.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chain.js","sourceRoot":"","sources":["../../src/utils/chain.ts"],"names":[],"mappings":";AAAA,mFAAmF;AACnF,6EAA6E;;;AAEhE,QAAA,SAAS,GAA2B;IAC/C,CAAC,EAAE,QAAQ;IACX,CAAC,EAAE,UAAU;IACb,CAAC,EAAE,SAAS;IACZ,CAAC,EAAE,SAAS;IACZ,CAAC,EAAE,SAAS;IACZ,CAAC,EAAE,QAAQ;IACX,CAAC,EAAE,OAAO;IACV,CAAC,EAAE,MAAM;IACT,EAAE,EAAE,UAAU;IACd,EAAE,EAAE,UAAU;IACd,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,KAAK;IACT,EAAE,EAAE,OAAO;IAC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AU,CAAC,KAAK,CAAC,EAAE;QACxB,OAAO,QAAQ,CAAA;KAChB;IACD,IAAI,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;QACxB,OAAO,KAAK,CAAA;KACb;IACD,IAAI,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;QACxB,OAAO,OAAO,CAAA;KACf;IACD,OAAO,KAAK,CAAA;AACd,CAAC;AAZD,oCAYC","sourcesContent":["// copy from https://github.com/DefiLlama/chainlist/blob/main/constants/chainIds.js\n// and https://besu.hyperledger.org/en/stable/Concepts/NetworkID-And-ChainID/\n\nexport const CHAIN_MAP: Record<string, string> = {\n 0: 'kardia',\n 1: 'ethereum',\n 2: 'expanse',\n 3: 'ropsten',\n 4: 'rinkeby',\n 5: 'goerli',\n 6: 'kotti',\n 8: 'ubiq',\n 10: 'optimism',\n 19: 'songbird',\n 20: 'elastos',\n 25: 'cronos',\n 30: 'rsk',\n 40: 'telos',\n 50: 'xdc',\n 52: 'csc',\n 55: 'zyx',\n 56: 'binance',\n 57: 'syscoin',\n 60: 'gochain',\n 61: 'ethclassic',\n 63: 'mordor',\n 66: 'okexchain',\n 70: 'hoo',\n 82: 'meter',\n 88: 'tomochain',\n 100: 'xdai',\n 106: 'velas',\n 108: 'thundercore',\n 122: 'fuse',\n 128: 'heco',\n 137: 'polygon',\n 200: 'xdaiarb',\n 212: 'astor',\n 246: 'energyweb',\n 250: 'fantom',\n 269: 'hpb',\n 288: 'boba',\n 321: 'kucoin',\n 336: 'shiden',\n 361: 'theta',\n 416: 'sx',\n 534: 'candle',\n 592: 'astar',\n 820: 'callisto',\n 888: 'wanchain',\n 1088: 'metis',\n 1246: 'omchain',\n 1284: 'moonbeam',\n 1285: 'moonriver',\n 2018: 'dev',\n 2020: 'ronin',\n 2222: 'kava',\n 2612: 'ezchain',\n 4181: 'phi',\n 4689: 'iotex',\n 5050: 'xlc',\n 5551: 'nahmii',\n 7777: 'nmactest',\n 8217: 'klaytn',\n 9001: 'evmos',\n 10000: 'smartbch',\n 103090: 'crystaleum',\n 32659: 'fusion',\n 42161: 'arbitrum',\n 42220: 'celo',\n 42262: 'oasis',\n 43114: 'avalanche',\n 71402: 'godwoken',\n 200625: 'akroma',\n 333999: 'polis',\n 11155111: 'sepolia',\n 1313161554: 'aurora',\n 1666600000: 'harmony',\n 11297108109: 'palm',\n 836542336838601: 'curio',\n}\n\nexport const SOL_MAINMET_ID = 'sol_mainnet'\nexport const SOL_DEVNET_ID = 'sol_devnet'\nexport const SOL_TESTNENT_ID = 'sol_testnet'\nCHAIN_MAP[SOL_MAINMET_ID] = 'solana'\nCHAIN_MAP[SOL_DEVNET_ID] = 'solana-dev'\nCHAIN_MAP[SOL_TESTNENT_ID] = 'solana-test'\n\nexport const SUI_DEVNET_ID = 'sui_devnet'\nCHAIN_MAP[SUI_DEVNET_ID] = 'sui-dev'\n\nexport const APTOS_TESTNET_ID = 'aptos_testnet'\nexport const APTOS_MAINNET_ID = 'aptos_mainnet'\nCHAIN_MAP[APTOS_TESTNET_ID] = 'aptos-test'\nCHAIN_MAP[APTOS_MAINNET_ID] = 'aptos-mainnet'\n\nexport function getChainName(chainId: string | number | null | undefined): string {\n if (typeof chainId === 'number') {\n chainId = chainId.toString()\n }\n if (chainId) {\n const name = CHAIN_MAP[chainId]\n if (name) {\n return name\n }\n }\n return chainId || ''\n}\n\nexport function getChainType(chainId?: string | number): string {\n const id = String(chainId).toLowerCase()\n if (id.startsWith('sol')) {\n return 'solana'\n }\n if (id.startsWith('sui')) {\n return 'sui'\n }\n if (id.startsWith('apt')) {\n return 'aptos'\n }\n return 'EVM'\n}\n"]}
|
|
1
|
+
{"version":3,"file":"chain.js","sourceRoot":"","sources":["../../src/utils/chain.ts"],"names":[],"mappings":";AAAA,mFAAmF;AACnF,6EAA6E;;;AAEhE,QAAA,SAAS,GAA2B;IAC/C,CAAC,EAAE,QAAQ;IACX,CAAC,EAAE,UAAU;IACb,CAAC,EAAE,SAAS;IACZ,CAAC,EAA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C,OAAO,CAAC,CAAA;QAC/B,IAAI,IAAI,EAAE;YACR,OAAO,IAAI,CAAA;SACZ;KACF;IACD,OAAO,OAAO,IAAI,EAAE,CAAA;AACtB,CAAC;AAXD,oCAWC;AAED,SAAgB,YAAY,CAAC,OAAyB;IACpD,MAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAA;IACxC,IAAI,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;QACxB,OAAO,QAAQ,CAAA;KAChB;IACD,IAAI,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;QACxB,OAAO,KAAK,CAAA;KACb;IACD,IAAI,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;QACxB,OAAO,OAAO,CAAA;KACf;IACD,OAAO,KAAK,CAAA;AACd,CAAC;AAZD,oCAYC","sourcesContent":["// copy from https://github.com/DefiLlama/chainlist/blob/main/constants/chainIds.js\n// and https://besu.hyperledger.org/en/stable/Concepts/NetworkID-And-ChainID/\n\nexport const CHAIN_MAP: Record<string, string> = {\n 0: 'kardia',\n 1: 'ethereum',\n 2: 'expanse',\n 3: 'ropsten',\n 4: 'rinkeby',\n 5: 'goerli',\n 6: 'kotti',\n 8: 'ubiq',\n 10: 'optimism',\n 19: 'songbird',\n 20: 'elastos',\n 25: 'cronos',\n 30: 'rsk',\n 40: 'telos',\n 50: 'xdc',\n 52: 'csc',\n 55: 'zyx',\n 56: 'binance',\n 57: 'syscoin',\n 60: 'gochain',\n 61: 'ethclassic',\n 63: 'mordor',\n 66: 'okexchain',\n 70: 'hoo',\n 82: 'meter',\n 88: 'tomochain',\n 100: 'xdai',\n 106: 'velas',\n 108: 'thundercore',\n 122: 'fuse',\n 128: 'heco',\n 137: 'polygon',\n 200: 'xdaiarb',\n 212: 'astor',\n 246: 'energyweb',\n 250: 'fantom',\n 269: 'hpb',\n 288: 'boba',\n 321: 'kucoin',\n 336: 'shiden',\n 361: 'theta',\n 416: 'sx',\n 534: 'candle',\n 592: 'astar',\n 820: 'callisto',\n 888: 'wanchain',\n 1088: 'metis',\n 1246: 'omchain',\n 1284: 'moonbeam',\n 1285: 'moonriver',\n 2018: 'dev',\n 2020: 'ronin',\n 2222: 'kava',\n 2612: 'ezchain',\n 4181: 'phi',\n 4689: 'iotex',\n 5050: 'xlc',\n 5551: 'nahmii',\n 7777: 'nmactest',\n 8217: 'klaytn',\n 9001: 'evmos',\n 10000: 'smartbch',\n 103090: 'crystaleum',\n 32659: 'fusion',\n 42161: 'arbitrum',\n 42220: 'celo',\n 42262: 'oasis',\n 43114: 'avalanche',\n 71402: 'godwoken',\n 200625: 'akroma',\n 333999: 'polis',\n 421613: 'arbitrum test',\n 11155111: 'sepolia',\n 1313161554: 'aurora',\n 1666600000: 'harmony',\n 11297108109: 'palm',\n 836542336838601: 'curio',\n}\n\nexport const SOL_MAINMET_ID = 'sol_mainnet'\nexport const SOL_DEVNET_ID = 'sol_devnet'\nexport const SOL_TESTNENT_ID = 'sol_testnet'\nCHAIN_MAP[SOL_MAINMET_ID] = 'solana'\nCHAIN_MAP[SOL_DEVNET_ID] = 'solana-dev'\nCHAIN_MAP[SOL_TESTNENT_ID] = 'solana-test'\n\nexport const SUI_DEVNET_ID = 'sui_devnet'\nCHAIN_MAP[SUI_DEVNET_ID] = 'sui-dev'\n\nexport const APTOS_TESTNET_ID = 'aptos_testnet'\nexport const APTOS_MAINNET_ID = 'aptos_mainnet'\nCHAIN_MAP[APTOS_TESTNET_ID] = 'aptos-test'\nCHAIN_MAP[APTOS_MAINNET_ID] = 'aptos-mainnet'\n\nexport function getChainName(chainId: string | number | null | undefined): string {\n if (typeof chainId === 'number') {\n chainId = chainId.toString()\n }\n if (chainId) {\n const name = CHAIN_MAP[chainId]\n if (name) {\n return name\n }\n }\n return chainId || ''\n}\n\nexport function getChainType(chainId?: string | number): string {\n const id = String(chainId).toLowerCase()\n if (id.startsWith('sol')) {\n return 'solana'\n }\n if (id.startsWith('sui')) {\n return 'sui'\n }\n if (id.startsWith('apt')) {\n return 'aptos'\n }\n return 'EVM'\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentio/sdk",
|
|
3
3
|
"license": "Apache-2.0",
|
|
4
|
-
"version": "1.33.
|
|
4
|
+
"version": "1.33.2",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"compile_target": "yarn tsc -b src/target-ethers-sentio/tsconfig.json",
|
|
7
7
|
"compile": "tsc -p . && cp src/cli/webpack.config.js lib/cli && cp src/utils/*.csv lib/utils",
|
package/src/core/meter.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseContext } from './base-context'
|
|
2
2
|
import { Numberish, toMetricValue } from './numberish'
|
|
3
3
|
import { Labels, NamedResultDescriptor } from './metadata'
|
|
4
|
-
import { AggregationConfig, AggregationType, MetricConfig } from '../gen'
|
|
4
|
+
import { AggregationConfig, AggregationType, MetricConfig, MetricType } from '../gen'
|
|
5
5
|
import { MapStateStorage } from '../state/state-storage'
|
|
6
6
|
|
|
7
7
|
export function normalizeName(name: string): string {
|
|
@@ -41,19 +41,17 @@ export class CounterOptions {
|
|
|
41
41
|
sparse?: boolean
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
enum MetricType {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
44
|
+
// enum MetricType {
|
|
45
|
+
// Counter = 0,
|
|
46
|
+
// Gauge = 1,
|
|
47
|
+
// }
|
|
48
48
|
|
|
49
49
|
export class Metric extends NamedResultDescriptor {
|
|
50
|
-
|
|
51
|
-
descriptor: MetricConfig
|
|
50
|
+
config: MetricConfig
|
|
52
51
|
constructor(type: MetricType, name: string, option?: MetricOptions) {
|
|
53
52
|
super(name)
|
|
54
|
-
this.
|
|
55
|
-
|
|
56
|
-
const aggregationConfig = this.descriptor.aggregationConfig
|
|
53
|
+
this.config = MetricConfig.fromPartial({ name: this.name, type: type, ...option })
|
|
54
|
+
const aggregationConfig = this.config.aggregationConfig
|
|
57
55
|
if (aggregationConfig && aggregationConfig.intervalInMinutes.length) {
|
|
58
56
|
if (aggregationConfig.intervalInMinutes.length > 1) {
|
|
59
57
|
console.error('current only support one intervalInMinutes, only first interval will be used for', name)
|
|
@@ -71,12 +69,12 @@ export class MetricState extends MapStateStorage<Metric> {
|
|
|
71
69
|
getOrRegisterMetric(type: MetricType, name: string, option?: CounterOptions | MetricOptions): Metric {
|
|
72
70
|
const metricMap = this.getOrRegister()
|
|
73
71
|
let metric = metricMap.get(name)
|
|
74
|
-
if (metric && metric.type !== type) {
|
|
75
|
-
throw Error(`redefine ${name} of metric type ${type} that is previously ${metric.type}`)
|
|
72
|
+
if (metric && metric.config.type !== type) {
|
|
73
|
+
throw Error(`redefine ${name} of metric type ${type} that is previously ${metric.config.type}`)
|
|
76
74
|
}
|
|
77
75
|
|
|
78
76
|
if (!metric) {
|
|
79
|
-
if (type === MetricType.
|
|
77
|
+
if (type === MetricType.COUNTER) {
|
|
80
78
|
metric = new Counter(name, option)
|
|
81
79
|
} else {
|
|
82
80
|
metric = new Gauge(name, option)
|
|
@@ -89,11 +87,11 @@ export class MetricState extends MapStateStorage<Metric> {
|
|
|
89
87
|
|
|
90
88
|
export class Counter extends Metric {
|
|
91
89
|
static register(name: string, option?: CounterOptions): Counter {
|
|
92
|
-
return MetricState.INSTANCE.getOrRegisterMetric(MetricType.
|
|
90
|
+
return MetricState.INSTANCE.getOrRegisterMetric(MetricType.COUNTER, name, option) as Counter
|
|
93
91
|
}
|
|
94
92
|
|
|
95
93
|
constructor(name: string, option?: MetricOptions) {
|
|
96
|
-
super(MetricType.
|
|
94
|
+
super(MetricType.COUNTER, name, option)
|
|
97
95
|
}
|
|
98
96
|
|
|
99
97
|
add(ctx: BaseContext, value: Numberish, labels: Labels = {}) {
|
|
@@ -134,16 +132,16 @@ export class CounterBinding {
|
|
|
134
132
|
|
|
135
133
|
export class Gauge extends Metric {
|
|
136
134
|
static register(name: string, option?: MetricOptions): Gauge {
|
|
137
|
-
return MetricState.INSTANCE.getOrRegisterMetric(MetricType.
|
|
135
|
+
return MetricState.INSTANCE.getOrRegisterMetric(MetricType.GAUGE, name, option) as Gauge
|
|
138
136
|
}
|
|
139
137
|
|
|
140
138
|
constructor(name: string, option?: MetricOptions) {
|
|
141
|
-
super(MetricType.
|
|
139
|
+
super(MetricType.GAUGE, name, option)
|
|
142
140
|
}
|
|
143
141
|
|
|
144
142
|
record(ctx: BaseContext, value: Numberish, labels: Labels = {}) {
|
|
145
143
|
ctx.res.gauges.push({
|
|
146
|
-
metadata: ctx.getMetaData(this.
|
|
144
|
+
metadata: ctx.getMetaData(this.config.name, labels),
|
|
147
145
|
metricValue: toMetricValue(value),
|
|
148
146
|
runtimeInfo: undefined,
|
|
149
147
|
})
|
package/src/core/numberish.ts
CHANGED
|
@@ -19,11 +19,11 @@ export function toMetricValue(value: Numberish): MetricValue {
|
|
|
19
19
|
})
|
|
20
20
|
} else {
|
|
21
21
|
if (value.isNaN()) {
|
|
22
|
-
throw new Error('
|
|
22
|
+
throw new Error('Cannot record NaN value')
|
|
23
23
|
}
|
|
24
24
|
if (!value.isFinite()) {
|
|
25
25
|
// NaN also not finite
|
|
26
|
-
throw new Error('
|
|
26
|
+
throw new Error('Cannot record infinite value')
|
|
27
27
|
}
|
|
28
28
|
return MetricValue.fromPartial({
|
|
29
29
|
bigDecimal: value.toString(), // e.g. -7.350918e-428
|
|
@@ -41,6 +41,15 @@ export function toMetricValue(value: Numberish): MetricValue {
|
|
|
41
41
|
})
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
if (typeof value === 'number') {
|
|
45
|
+
if (Number.isNaN(value)) {
|
|
46
|
+
throw new Error('Cannot record NaN value')
|
|
47
|
+
}
|
|
48
|
+
if (!Number.isFinite(value)) {
|
|
49
|
+
throw new Error('Cannot record infinite value')
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
44
53
|
return MetricValue.fromPartial({
|
|
45
54
|
doubleValue: Number(value),
|
|
46
55
|
})
|
|
@@ -66,8 +66,9 @@ export interface EvmSQLQueryRequest {
|
|
|
66
66
|
|
|
67
67
|
export interface EvmGetHeaderRequest {
|
|
68
68
|
network: string;
|
|
69
|
-
fromBlock
|
|
70
|
-
toBlock
|
|
69
|
+
fromBlock?: Long | undefined;
|
|
70
|
+
toBlock?: Long | undefined;
|
|
71
|
+
blockNumbers: Long[];
|
|
71
72
|
}
|
|
72
73
|
|
|
73
74
|
export interface EvmQueryResponse {
|
|
@@ -1002,7 +1003,12 @@ export const EvmSQLQueryRequest = {
|
|
|
1002
1003
|
};
|
|
1003
1004
|
|
|
1004
1005
|
function createBaseEvmGetHeaderRequest(): EvmGetHeaderRequest {
|
|
1005
|
-
return {
|
|
1006
|
+
return {
|
|
1007
|
+
network: "",
|
|
1008
|
+
fromBlock: undefined,
|
|
1009
|
+
toBlock: undefined,
|
|
1010
|
+
blockNumbers: [],
|
|
1011
|
+
};
|
|
1006
1012
|
}
|
|
1007
1013
|
|
|
1008
1014
|
export const EvmGetHeaderRequest = {
|
|
@@ -1013,12 +1019,17 @@ export const EvmGetHeaderRequest = {
|
|
|
1013
1019
|
if (message.network !== "") {
|
|
1014
1020
|
writer.uint32(10).string(message.network);
|
|
1015
1021
|
}
|
|
1016
|
-
if (
|
|
1022
|
+
if (message.fromBlock !== undefined) {
|
|
1017
1023
|
writer.uint32(16).uint64(message.fromBlock);
|
|
1018
1024
|
}
|
|
1019
|
-
if (
|
|
1025
|
+
if (message.toBlock !== undefined) {
|
|
1020
1026
|
writer.uint32(24).uint64(message.toBlock);
|
|
1021
1027
|
}
|
|
1028
|
+
writer.uint32(34).fork();
|
|
1029
|
+
for (const v of message.blockNumbers) {
|
|
1030
|
+
writer.uint64(v);
|
|
1031
|
+
}
|
|
1032
|
+
writer.ldelim();
|
|
1022
1033
|
return writer;
|
|
1023
1034
|
},
|
|
1024
1035
|
|
|
@@ -1038,6 +1049,16 @@ export const EvmGetHeaderRequest = {
|
|
|
1038
1049
|
case 3:
|
|
1039
1050
|
message.toBlock = reader.uint64() as Long;
|
|
1040
1051
|
break;
|
|
1052
|
+
case 4:
|
|
1053
|
+
if ((tag & 7) === 2) {
|
|
1054
|
+
const end2 = reader.uint32() + reader.pos;
|
|
1055
|
+
while (reader.pos < end2) {
|
|
1056
|
+
message.blockNumbers.push(reader.uint64() as Long);
|
|
1057
|
+
}
|
|
1058
|
+
} else {
|
|
1059
|
+
message.blockNumbers.push(reader.uint64() as Long);
|
|
1060
|
+
}
|
|
1061
|
+
break;
|
|
1041
1062
|
default:
|
|
1042
1063
|
reader.skipType(tag & 7);
|
|
1043
1064
|
break;
|
|
@@ -1051,10 +1072,13 @@ export const EvmGetHeaderRequest = {
|
|
|
1051
1072
|
network: isSet(object.network) ? String(object.network) : "",
|
|
1052
1073
|
fromBlock: isSet(object.fromBlock)
|
|
1053
1074
|
? Long.fromValue(object.fromBlock)
|
|
1054
|
-
:
|
|
1075
|
+
: undefined,
|
|
1055
1076
|
toBlock: isSet(object.toBlock)
|
|
1056
1077
|
? Long.fromValue(object.toBlock)
|
|
1057
|
-
:
|
|
1078
|
+
: undefined,
|
|
1079
|
+
blockNumbers: Array.isArray(object?.blockNumbers)
|
|
1080
|
+
? object.blockNumbers.map((e: any) => Long.fromValue(e))
|
|
1081
|
+
: [],
|
|
1058
1082
|
};
|
|
1059
1083
|
},
|
|
1060
1084
|
|
|
@@ -1062,9 +1086,16 @@ export const EvmGetHeaderRequest = {
|
|
|
1062
1086
|
const obj: any = {};
|
|
1063
1087
|
message.network !== undefined && (obj.network = message.network);
|
|
1064
1088
|
message.fromBlock !== undefined &&
|
|
1065
|
-
(obj.fromBlock = (message.fromBlock ||
|
|
1089
|
+
(obj.fromBlock = (message.fromBlock || undefined).toString());
|
|
1066
1090
|
message.toBlock !== undefined &&
|
|
1067
|
-
(obj.toBlock = (message.toBlock ||
|
|
1091
|
+
(obj.toBlock = (message.toBlock || undefined).toString());
|
|
1092
|
+
if (message.blockNumbers) {
|
|
1093
|
+
obj.blockNumbers = message.blockNumbers.map((e) =>
|
|
1094
|
+
(e || Long.UZERO).toString()
|
|
1095
|
+
);
|
|
1096
|
+
} else {
|
|
1097
|
+
obj.blockNumbers = [];
|
|
1098
|
+
}
|
|
1068
1099
|
return obj;
|
|
1069
1100
|
},
|
|
1070
1101
|
|
|
@@ -1074,11 +1105,13 @@ export const EvmGetHeaderRequest = {
|
|
|
1074
1105
|
message.fromBlock =
|
|
1075
1106
|
object.fromBlock !== undefined && object.fromBlock !== null
|
|
1076
1107
|
? Long.fromValue(object.fromBlock)
|
|
1077
|
-
:
|
|
1108
|
+
: undefined;
|
|
1078
1109
|
message.toBlock =
|
|
1079
1110
|
object.toBlock !== undefined && object.toBlock !== null
|
|
1080
1111
|
? Long.fromValue(object.toBlock)
|
|
1081
|
-
:
|
|
1112
|
+
: undefined;
|
|
1113
|
+
message.blockNumbers =
|
|
1114
|
+
object.blockNumbers?.map((e) => Long.fromValue(e)) || [];
|
|
1082
1115
|
return message;
|
|
1083
1116
|
},
|
|
1084
1117
|
};
|
|
@@ -1311,6 +1344,14 @@ export const EvmQueryDefinition = {
|
|
|
1311
1344
|
responseStream: false,
|
|
1312
1345
|
options: {},
|
|
1313
1346
|
},
|
|
1347
|
+
evmHintHeaderCache: {
|
|
1348
|
+
name: "EvmHintHeaderCache",
|
|
1349
|
+
requestType: EvmGetHeaderRequest,
|
|
1350
|
+
requestStream: false,
|
|
1351
|
+
responseType: VoidResponse,
|
|
1352
|
+
responseStream: false,
|
|
1353
|
+
options: {},
|
|
1354
|
+
},
|
|
1314
1355
|
},
|
|
1315
1356
|
} as const;
|
|
1316
1357
|
|
|
@@ -1323,6 +1364,10 @@ export interface EvmQueryServiceImplementation<CallContextExt = {}> {
|
|
|
1323
1364
|
request: EvmGetHeaderRequest,
|
|
1324
1365
|
context: CallContext & CallContextExt
|
|
1325
1366
|
): Promise<DeepPartial<EvmQueryResponse>>;
|
|
1367
|
+
evmHintHeaderCache(
|
|
1368
|
+
request: EvmGetHeaderRequest,
|
|
1369
|
+
context: CallContext & CallContextExt
|
|
1370
|
+
): Promise<DeepPartial<VoidResponse>>;
|
|
1326
1371
|
}
|
|
1327
1372
|
|
|
1328
1373
|
export interface EvmQueryClient<CallOptionsExt = {}> {
|
|
@@ -1334,6 +1379,10 @@ export interface EvmQueryClient<CallOptionsExt = {}> {
|
|
|
1334
1379
|
request: DeepPartial<EvmGetHeaderRequest>,
|
|
1335
1380
|
options?: CallOptions & CallOptionsExt
|
|
1336
1381
|
): Promise<EvmQueryResponse>;
|
|
1382
|
+
evmHintHeaderCache(
|
|
1383
|
+
request: DeepPartial<EvmGetHeaderRequest>,
|
|
1384
|
+
options?: CallOptions & CallOptionsExt
|
|
1385
|
+
): Promise<VoidResponse>;
|
|
1337
1386
|
}
|
|
1338
1387
|
|
|
1339
1388
|
type Builtin =
|