From 62cc64a90aa671318bde3fa8d38adf9852773479 Mon Sep 17 00:00:00 2001 From: thloyi Date: Thu, 12 Feb 2026 10:43:30 +0800 Subject: [PATCH] fix from rpc ComputeUnitsConsumed --- rawtx.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rawtx.go b/rawtx.go index d4f1a55..49aac83 100644 --- a/rawtx.go +++ b/rawtx.go @@ -326,7 +326,9 @@ func FromRpcTransactionWithMeta(tx rpc.TransactionWithMeta, blockTime *uint64, s } sTx.Meta.Fee = meta.Fee //sTx.Meta.InnerInstructions = meta.InnerInstructions - + if meta.ComputeUnitsConsumed != nil { + sTx.Meta.ComputeUnitsConsumed = *meta.ComputeUnitsConsumed + } for _, innerInstr := range meta.InnerInstructions { var instrs []Instruction for _, instr := range innerInstr.Instructions { @@ -514,6 +516,7 @@ func intSliceFromUint16Slice(in []uint16) []int { } return out } + func getAtaIdxByOwner(result *RawTx, owner solana.PublicKey, mint solana.PublicKey) (int, error) { var preBalance *TokenBalance for _, pre := range result.Meta.PreTokenBalances {