Type helper for extracting decoded instruction data type from an ABI instruction.
import type { AbiDecodeInstruction } from "@subsquid/pipes/solana";import { jupiterAbi } from "./abi/jupiter";// Extract the decoded instruction typetype SwapInstruction = AbiDecodeInstruction<typeof jupiterAbi.instructions.swap>;// Use in your codeconst decoder = solanaInstructionDecoder({ range: { from: 250000000 }, programId: jupiterAbi.programId, instructions: { swap: jupiterAbi.instructions.swap, },});// TypeScript will infer the correct typefor await (const { data } of source.pipe(decoder)) { data.swap; // AbiDecodeInstruction<typeof jupiterAbi.instructions.swap>[]}
AbiDecodeInstruction is a type helper that extracts the decoded instruction data type from an ABI instruction definition. This provides type safety when working with decoded Solana instructions.
The logger interface is Pino-compatible, allowing integration with any Pino transport for sending logs to external services like GCP Cloud Logging, Sentry, or other monitoring platforms.
import type { Source, Transformer, Target, Context, BlockCursor,} from "@subsquid/pipes";import type { SolanaPortalData, SolanaQueryBuilder, SolanaTransformer, DecodedInstruction, AbiDecodeInstruction, EventResponse, Instructions,} from "@subsquid/pipes/solana";import type { ClickhouseTargetConfig, Store,} from "@subsquid/pipes/targets/clickhouse";