SolanaBaseProcessor
Class in @sentio/sdk/solana
Defined in @sentio/sdk/solana
Extended by
Constructors
Constructor
new SolanaBaseProcessor(options: SolanaBindOptions): SolanaBaseProcessor;Parameters
| Parameter | Type |
|---|---|
options | SolanaBindOptions |
Returns
SolanaBaseProcessor
Properties
| Property | Modifier | Type | Default value |
|---|---|---|---|
address | public | string | undefined |
baseLabels? | public | Labels | undefined |
blockHandlers | public | SolanaBlockHandlerEntry<any>[] | [] |
config | public | IndexConfigure | undefined |
contractName | public | string | undefined |
endpoint | public | string | undefined |
fromParsedInstruction | public | (instruction: object) => Instruction | null | undefined |
instructionCoder | public | InstructionCoder | undefined |
instructionHandlerMap | public | Map<string, InstructionHandlerEntry> | undefined |
network | public | SolanaChainId | undefined |
processInnerInstruction | public | boolean | undefined |
Methods
decodeInstruction()
decodeInstruction(rawInstruction: string): Instruction | null;Parameters
| Parameter | Type |
|---|---|
rawInstruction | string |
Returns
Instruction | null
endBlock()
endBlock(endBlock: number | bigint): SolanaBaseProcessor;Parameters
| Parameter | Type |
|---|---|
endBlock | number | bigint |
Returns
SolanaBaseProcessor
getInstructionHandler()
getInstructionHandler(parsedInstruction: Instruction):
| InstructionHandlerEntry
| undefined;Parameters
| Parameter | Type |
|---|---|
parsedInstruction | Instruction |
Returns
| InstructionHandlerEntry
| undefined
getParsedInstruction()
getParsedInstruction(ins:
| string
| {
info: any;
type: string;
}): Instruction | null;Parameters
| Parameter | Type |
|---|---|
ins | | string | { info: any; type: string; } |
Returns
Instruction | null
getPartitionKey()
getPartitionKey(parsedInstruction: Instruction, handlerEntry: InstructionHandlerEntry): Promise<string | undefined>;Parameters
| Parameter | Type |
|---|---|
parsedInstruction | Instruction |
handlerEntry | InstructionHandlerEntry |
Returns
Promise<string | undefined>
handleBlock()
handleBlock(rawBlock: Data_SolBlock, handlerEntry: SolanaBlockHandlerEntry<BlockResponse>): Promise<ProcessResult>;Parameters
| Parameter | Type |
|---|---|
rawBlock | Data_SolBlock |
handlerEntry | SolanaBlockHandlerEntry<BlockResponse> |
Returns
Promise<ProcessResult>
handleInstruction()
handleInstruction(
parsedInstruction: Instruction,
accounts: string[],
handlerEntry: InstructionHandlerEntry,
data: Data_SolInstruction
): Promise<ProcessResult>;Parameters
| Parameter | Type |
|---|---|
parsedInstruction | Instruction |
accounts | string[] |
handlerEntry | InstructionHandlerEntry |
data | Data_SolInstruction |
Returns
Promise<ProcessResult>
onBlockInterval()
onBlockInterval(
handler: SolanaBlockHandler<BlockResponse>,
blockInterval?: number,
backfillBlockInterval?: number
): this;Parameters
| Parameter | Type | Default value |
|---|---|---|
handler | SolanaBlockHandler<BlockResponse> | undefined |
blockInterval | number | 1000 |
backfillBlockInterval | number | 4000 |
Returns
this
onInstruction()
onInstruction<T extends Instruction = Instruction>(
instructionName: string,
handler: SolanaInstructionHandler<T>,
handlerOptions?: HandlerOptions<SolanaFetchConfig, T>
): SolanaBaseProcessor;Type Parameters
| Type Parameter | Default type |
|---|---|
T extends Instruction | Instruction |
Parameters
| Parameter | Type |
|---|---|
instructionName | string |
handler | SolanaInstructionHandler<T> |
handlerOptions? | HandlerOptions<SolanaFetchConfig, T> |
Returns
SolanaBaseProcessor
onInterval()
onInterval<T>(
handler: SolanaBlockHandler<T>,
timeInterval:
| HandleInterval
| undefined,
slotInterval:
| HandleInterval
| undefined
): this;Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
handler | SolanaBlockHandler<T> |
timeInterval | | HandleInterval | undefined |
slotInterval | | HandleInterval | undefined |
Returns
this
onTimeInterval()
onTimeInterval(
handler: SolanaBlockHandler<BlockResponse>,
timeIntervalInMinutes?: number,
backfillTimeIntervalInMinutes?: number
): this;Parameters
| Parameter | Type | Default value |
|---|---|---|
handler | SolanaBlockHandler<BlockResponse> | undefined |
timeIntervalInMinutes | number | 60 |
backfillTimeIntervalInMinutes | number | 240 |
Returns
this
startSlot()
startSlot(startSlot: number | bigint): SolanaBaseProcessor;Parameters
| Parameter | Type |
|---|---|
startSlot | number | bigint |
Returns
SolanaBaseProcessor