chore: use @solana-program/token parseBatchInstruction for batch feature#947
chore: use @solana-program/token parseBatchInstruction for batch feature#947askov wants to merge 6 commits intosolana-foundation:masterfrom
Conversation
|
@askov is attempting to deploy a commit to the Solana Foundation Team on Vercel. A member of the Team first needs to authorize it. |
Greptile SummaryThis PR replaces the hand-rolled SPL Token batch wire-format parser ( The refactor is a clear correctness win — it eliminates ~200 lines of manual wire-format parsing and the separate per-instruction decoder in favour of SDK-provided typed
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant TC as TokenBatchCard
participant BP as batch-parser
participant WC as web3js-compat
participant SDK as @solana-program/token<br/>parseBatchInstruction
participant FR as format-sub-instruction
participant MI as use-sub-instruction-mint-info
participant RPC as AccountsProvider (RPC)
TC->>BP: parseBatchInstruction(ix: TransactionInstruction)
BP->>BP: hasBatchDiscriminator(ix.data)?
BP->>WC: toKitInstruction(ix)
WC-->>BP: KitInstruction (accounts mapped to AccountRole)
BP->>SDK: sdkParseBatch(kitIx)
SDK-->>BP: "{ instructions: ParsedTokenInstruction[] }"
BP-->>TC: ParsedBatchResult
loop for each ParsedTokenInstruction
TC->>MI: useSubInstructionMintInfo(parsed)
MI->>RPC: useAccountQuery(tokenAccount) — Hop 1
RPC-->>MI: mintAddress
MI->>RPC: useAccountQuery(mint) — Hop 2
RPC-->>MI: decimals
MI-->>TC: "MintInfo { mint, decimals }"
TC->>FR: formatParsedInstruction(parsed, mintInfo)
FR-->>TC: "DecodedParams { fields, accounts }"
end
Reviews (1): Last reviewed commit: "chore: use @solana-program/token parseBa..." | Re-trigger Greptile |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
c7b9d36 to
3b251a8
Compare
Description
@solana/kit2.3→6.5 and all@solana-program/*packages to kit@6-compatible versions, enabling use of@solana-program/token@0.13.0parseBatchInstruction, which returns fully typed inner instructionsapp/shared/lib/web3js-compat.tsas a shared bridge from web3.js v1TransactionInstructionto@solana/kitInstructiontypesType of change
Testing
Manual testing checklist — packages upgrade
Related Issues
Closes HOO-403
Checklist
build:infoscript to update build information