Practical overview
When it fits
Use Anchores when a TypeScript application needs code-defined parsers for Solana transaction instructions, events or structs, including the documented Jupiter swap-event case.
Who it is for
- TypeScript developers building tools that inspect Solana transaction data.
- Developers who need to parse program-specific instructions or events.
- Developers working with Jupiter swap events.
Documented uses
- Extract supported instructions or events from a Solana transaction.
- Decode Jupiter swap-event data into structured fields.
- Define custom parsers for program-specific data.
Requirements & limits
The public GitHub repository identifies the project as MIT-licensed.
- Structs are defined in code; the README says the library does not use an IDL.
- The README describes ESM and CommonJS support, TypeScript-friendly usage and minimal dependencies.
- The README reports a tree-shaken gzip size of 4.08 kB for parsing Jupiter swap events.
- The project is described as a work in progress; not all Borsh types are supported and the API may change.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Set up Jupiter swap-event parsing
Add the documented Anchores parser call for extracting Jupiter V6 swap events from a parsed transaction.
Before you start
- A TypeScript project with the Anchores package installed using npm.
- A transaction value obtained with the documented connection.getParsedTransaction call.
Steps
Install the package with the command below.
npm i anchoresImport
parseTransactionfromanchoresandJUPITER_V6_PROGRAM_IDandSwapEventfromanchores/parsers/jupiter.Pass the Jupiter program ID, an events parser list containing
SwapEvent, and the transaction toparseTransaction.
Expected outcome
The documented function call returns parsed events for the supplied transaction.
Guide limitations
- The README warns that support for all Borsh types is incomplete and the API may change.
Define a custom event parser
Create a parser for program-specific event data and make it available to Anchores decoding functions.
Before you start
- A TypeScript project with Anchores installed.
- Event data supplied as a Uint8Array.
Steps
Import the binary utilities from
anchores/binaryand create a reader from the event data.Read the required fields with the documented binary helpers, as in the example using public keys and u64 values.
Use the parser directly or place it in a parser object for
parseTransaction,decodeEvents, ordecodeStructs.
Expected outcome
A custom parser returns a structured value from the event data and can be passed to the documented decoding functions.
Guide limitations
- Support for all Borsh types is incomplete, and the API may change.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 15 October 2026
- Original website title
- ryoid/anchores · Official homepage title · retained in its source language

