Compare commits

...

2 Commits

Author SHA1 Message Date
thloyi
920c5ba25b fix errTx do not updte sol transfer 2026-02-27 17:41:58 +08:00
thloyi
3d447ef2e8 fix errTx mev and cu 2026-02-27 17:07:49 +08:00
2 changed files with 9 additions and 7 deletions

View File

@@ -129,7 +129,7 @@ func (tx *Tx) Parser() error {
tx.Swaps = swaps
}
for i, instr := range tx.rawTx.Transaction.Message.Instructions {
if p, exists := actionPrograms[programAccount]; exists {
if p, exists := actionPrograms[accountList[instr.ProgramIDIndex]]; exists {
_, err := p(tx, instr, InnerInstructions{}, [2]uint{uint(i), uint(0)})
if err != nil {
if errors.Is(err, InstructionIgnoredError) {

View File

@@ -34,12 +34,14 @@ func TransferParser(result *RawTx, instruction Instruction, offset [2]uint, tx *
from := result.accountList[result.Transaction.Message.Instructions[offset[0]].Accounts[0]]
to := result.accountList[instruction.Accounts[1]]
if offset[1] == 0 {
tx.SolTransfer = append(tx.SolTransfer, SolTransfer{
From: from,
To: to,
Amount: decimal.NewFromInt(int64(lamports)), // solana decimals
})
if result.Meta.Err == nil {
if offset[1] == 0 {
tx.SolTransfer = append(tx.SolTransfer, SolTransfer{
From: from,
To: to,
Amount: decimal.NewFromInt(int64(lamports)), // solana decimals
})
}
}
// load platform by to address
platform, ok := platformFeeAddresses[to]