import type { AccountMeta } from '@solana/instructions'; import type { TransactionForFullMetaInnerInstructionsUnparsed } from '@solana/rpc-types'; import type { TracedInstruction } from './types'; /** * The shape of an inner-instructions group as returned by any JSON-RPC method * that includes transaction `meta` when not using `jsonParsed` encoding (e.g. * `getTransaction`, `getTransactionsForAddress`, `getBlock`). Derived from the * shared leaf type in `@solana/rpc-types` via indexed access so the two stay in * sync, without coupling to a specific method's response envelope. */ type RpcInnerInstructionsGroup = TransactionForFullMetaInnerInstructionsUnparsed['innerInstructions'][number]; /** * The minimum shape of `getTransaction`'s `meta` field that this helper * needs. Accepting a structural type keeps callers free to pass the full * RPC response without coupling to a specific overload. * * @example * ```ts * const inner = getInnerInstructionsFromMeta(rpcResponse.meta, accountMetas); * ``` */ export type MetaWithInnerInstructions = Readonly<{ innerInstructions?: readonly RpcInnerInstructionsGroup[] | null; }>; /** * Returns the inner instructions in a `getTransaction` response as * {@link TracedInstruction}s. * * The RPC returns inner instructions in a different shape from the wire * format: indices reference the same flat account list as the outer * instructions, but `data` is a base58-encoded string. This helper decodes * the data, resolves the indices against the supplied {@link AccountMeta} * list, and tags each instruction with an `inner` trace. * * Throws if any `programIdIndex` or account index falls outside the * supplied `accountMetas` list. * * @example * ```ts * const accountMetas = getAccountMetasFromCompiledTransactionMessage(compiledMessage, loadedAddresses); * const inner = getInnerInstructionsFromMeta(rpcResponse.meta, accountMetas); * ``` */ export declare function getInnerInstructionsFromMeta(meta: MetaWithInnerInstructions, accountMetas: readonly AccountMeta[]): TracedInstruction[]; export {}; //# sourceMappingURL=get-inner-instructions.d.ts.map