Example usage of @debridge-finance/solana-transaction-parser with and without a custom instruction decoder for the Swift Auction program.
- Parse a real mainnet transaction with the default parser.
- Attach a custom decoder for the Swift Auction program and print decoded instruction args.
- Demonstrate IDL-driven decoding and a manual binary parser for
OrderInfo(Mayan Swift Auction Object).
- src/no-custom-decoder.ts: parse a transaction using only the default parser.
- src/auction-custom-decoder.ts: parse the same transaction with a custom decoder.
- src/custom-parsers/swift-auction-parser.ts: custom decoder for the
bidinstruction. - src/decodeOrderInfo.ts: manual binary decoder for
OrderInfo. - src/idl/swift_auction.json / swift_auction.ts: program IDL + type definitions.
- Node.js 18+ (recommended)
- npm
-
Install dependencies:
npm install
-
Install a TypeScript runner (one-time):
npm install -D typescript ts-node
npx ts-node src/no-custom-decoder.ts
npx ts-node src/auction-custom-decoder.ts
- The examples use a mainnet transaction hash hard-coded in the scripts.
- The custom decoder only handles the
bidinstruction selector and can be extended.