/** * Minimal Solana transaction-message parser + native-transfer decoder. * * sigil signs the serialized *message* a caller hands it (ed25519 over the * bytes), but to apply policy it first decodes what it can offline. Solana * hides most semantics behind account indices and on-chain state, so the only * thing reliably decodable without RPC is the **System Program transfer** * (native SOL). Everything else — SPL token transfers, arbitrary programs, * accounts pulled in via address-lookup-tables — is left as "undecoded", and * the policy layer routes those to an out-of-band human confirm. * * Supports both legacy and v0 (versioned) messages. For v0 we parse the * address-table-lookup section to consume the bytes correctly, but any * instruction that references an ALT-loaded account (index >= number of static * keys) is treated as undecoded, since we can't resolve it offline. */ /** The System Program id is the all-zero 32-byte key. */ export declare const SYSTEM_PROGRAM_ID: Uint8Array; export interface SolInstruction { programIdIndex: number; accountIndexes: number[]; data: Uint8Array; } export interface SolMessage { version: 'legacy' | 0; numRequiredSignatures: number; numReadonlySigned: number; numReadonlyUnsigned: number; /** The static account keys carried in the message (32 bytes each). */ staticAccountKeys: Uint8Array[]; recentBlockhash: Uint8Array; instructions: SolInstruction[]; /** Number of address-table lookups (v0 only; 0 for legacy). */ addressTableLookupCount: number; } export interface SolTransfer { /** base58 sender (the funding account). */ from: string; /** base58 recipient. */ to: string; lamports: bigint; } export interface DecodedTx { message: SolMessage; /** Recognized System-Program transfers, in instruction order. */ transfers: SolTransfer[]; /** * True iff EVERY instruction in the message was decoded as a recognized * System transfer over static accounts. When false, the message contains * something we can't see offline and policy must route it to confirm. */ allDecoded: boolean; } export declare function parseMessage(bytes: Uint8Array): SolMessage; export declare function decodeTx(bytes: Uint8Array): DecodedTx; //# sourceMappingURL=transaction.d.ts.map