import { Data_SolBlock, Data_SolInstruction, HandleInterval, ProcessResult } from '@sentio/protos'; import { SolanaContext } from './solana-context.js'; import { Instruction } from '@anchor-lang/core'; import { SolanaBindOptions, SolanaFetchConfig } from './solana-options.js'; import { ListStateStorage } from '@sentio/runtime'; import { Labels, PromiseOrVoid } from '../core/index.js'; import { SolanaChainId } from '@sentio/chain'; import { HandlerOptions } from '../core/handler-options.js'; import type { BlockResponse } from './solana-rpc-types.js'; type IndexConfigure = { startSlot: bigint; endSlot?: bigint; }; export interface InstructionCoder { decode(ix: Buffer | string, encoding?: 'hex' | 'base58'): Instruction | null; } export type SolanaInstructionHandler = (instruction: T, ctx: SolanaContext, accounts: string[]) => void; export interface InstructionHandlerEntry { handler: SolanaInstructionHandler; handlerOptions?: HandlerOptions; } export type SolanaBlockHandler = (block: T, ctx: SolanaContext) => PromiseOrVoid; export interface SolanaBlockHandlerEntry { handler: SolanaBlockHandler; timeIntervalInMinutes?: HandleInterval; slotInterval?: HandleInterval; handlerName: string; } export declare class SolanaProcessorState extends ListStateStorage { static INSTANCE: SolanaProcessorState; } export declare class SolanaBaseProcessor { instructionHandlerMap: Map; blockHandlers: SolanaBlockHandlerEntry[]; address: string; endpoint: string; contractName: string; baseLabels?: Labels; network: SolanaChainId; processInnerInstruction: boolean; config: IndexConfigure; instructionCoder: InstructionCoder; decodeInstruction(rawInstruction: string): Instruction | null; fromParsedInstruction: (instruction: { type: string; info: any; }) => Instruction | null; constructor(options: SolanaBindOptions); onInstruction(instructionName: string, handler: SolanaInstructionHandler, handlerOptions?: HandlerOptions): this; onTimeInterval(handler: SolanaBlockHandler, timeIntervalInMinutes?: number, backfillTimeIntervalInMinutes?: number): this; onBlockInterval(handler: SolanaBlockHandler, blockInterval?: number, backfillBlockInterval?: number): this; onInterval(handler: SolanaBlockHandler, timeInterval: HandleInterval | undefined, slotInterval: HandleInterval | undefined): this; getParsedInstruction(ins: string | { type: string; info: any; }): Instruction | null; getInstructionHandler(parsedInstruction: Instruction): InstructionHandlerEntry | undefined; handleInstruction(parsedInstruction: Instruction, accounts: string[], handlerEntry: InstructionHandlerEntry, data: Data_SolInstruction): Promise; handleBlock(rawBlock: Data_SolBlock, handlerEntry: SolanaBlockHandlerEntry): Promise; getPartitionKey(parsedInstruction: Instruction, handlerEntry: InstructionHandlerEntry): Promise; startSlot(startSlot: bigint | number): this; endBlock(endBlock: bigint | number): this; } export declare class SolanaGlobalProcessor extends SolanaBaseProcessor { static bind(options: Omit): SolanaGlobalProcessor; constructor(options: SolanaBindOptions); } export {}; //# sourceMappingURL=solana-processor.d.ts.map