Compare commits

..

2 Commits

Author SHA1 Message Date
thloyi
cd1d681621 record ProgramFailedToComplete failed tx 2026-03-02 15:47:11 +08:00
thloyi
920c5ba25b fix errTx do not updte sol transfer 2026-02-27 17:41:58 +08:00
4 changed files with 12 additions and 10 deletions

View File

@@ -225,7 +225,7 @@ func failedTxBuyOrSellParser(tx *Tx, instruction Instruction, innerInstructions
if tx.Err.Variant != InstructionError { if tx.Err.Variant != InstructionError {
return nil, increaseOffset(offset), fmt.Errorf("failed tx pump failed but error variant is not instruction error, offset, %d, %d", offset[0], offset[1]) return nil, increaseOffset(offset), fmt.Errorf("failed tx pump failed but error variant is not instruction error, offset, %d, %d", offset[0], offset[1])
} }
if tx.Err.Enum != Custom && tx.Err.Enum != ComputationalBudgetExceeded { if tx.Err.Enum != Custom && tx.Err.Enum != ComputationalBudgetExceeded && tx.Err.Enum != ProgramFailedToComplete {
return nil, increaseOffset(offset), fmt.Errorf("failed tx pump failed but error is not custom or computational budget exceeded, offset, %d, %d", offset[0], offset[1]) return nil, increaseOffset(offset), fmt.Errorf("failed tx pump failed but error is not custom or computational budget exceeded, offset, %d, %d", offset[0], offset[1])
} }
if tx.Err.Enum == Custom { if tx.Err.Enum == Custom {

View File

@@ -268,7 +268,7 @@ func failedTxAmmBuyParser(tx *Tx, instruction Instruction, innerInstructions Inn
if tx.Err.Variant != InstructionError { if tx.Err.Variant != InstructionError {
return nil, increaseOffset(offset), fmt.Errorf("failed tx pump amm sell failed but error variant is not instruction error, offset, %d, %d", offset[0], offset[1]) return nil, increaseOffset(offset), fmt.Errorf("failed tx pump amm sell failed but error variant is not instruction error, offset, %d, %d", offset[0], offset[1])
} }
if tx.Err.Enum != Custom && tx.Err.Enum != ComputationalBudgetExceeded { if tx.Err.Enum != Custom && tx.Err.Enum != ComputationalBudgetExceeded && tx.Err.Enum != ProgramFailedToComplete {
return nil, increaseOffset(offset), fmt.Errorf("failed tx pump amm sell failed but error is not custom or computational budget exceeded, offset, %d, %d", offset[0], offset[1]) return nil, increaseOffset(offset), fmt.Errorf("failed tx pump amm sell failed but error is not custom or computational budget exceeded, offset, %d, %d", offset[0], offset[1])
} }
if tx.Err.Enum == Custom { if tx.Err.Enum == Custom {
@@ -392,7 +392,7 @@ func failedTxAmmSellParser(tx *Tx, instruction Instruction, innerInstructions In
if tx.Err.Variant != InstructionError { if tx.Err.Variant != InstructionError {
return nil, increaseOffset(offset), fmt.Errorf("failed tx pump amm sell failed but error variant is not instruction error, offset, %d, %d", offset[0], offset[1]) return nil, increaseOffset(offset), fmt.Errorf("failed tx pump amm sell failed but error variant is not instruction error, offset, %d, %d", offset[0], offset[1])
} }
if tx.Err.Enum != Custom && tx.Err.Enum != ComputationalBudgetExceeded { if tx.Err.Enum != Custom && tx.Err.Enum != ComputationalBudgetExceeded && tx.Err.Enum != ProgramFailedToComplete {
return nil, increaseOffset(offset), fmt.Errorf("failed tx pump amm sell failed but error is not custom or computational budget exceeded, offset, %d, %d", offset[0], offset[1]) return nil, increaseOffset(offset), fmt.Errorf("failed tx pump amm sell failed but error is not custom or computational budget exceeded, offset, %d, %d", offset[0], offset[1])
} }
if tx.Err.Enum == Custom { if tx.Err.Enum == Custom {

View File

@@ -354,7 +354,7 @@ func FromRpcTransactionWithMeta(tx rpc.TransactionWithMeta, blockTime *uint64, s
} }
errDetail, ok := oErr[1].(string) errDetail, ok := oErr[1].(string)
if ok { if ok {
if errDetail == "ComputationalBudgetExceeded" { if errDetail == "ComputationalBudgetExceeded" || errDetail == "ProgramFailedToComplete" {
sTx.Meta.Err.Enum = ComputationalBudgetExceeded sTx.Meta.Err.Enum = ComputationalBudgetExceeded
} else { } else {
sTx.Meta.Err.UnKnown = errDetail sTx.Meta.Err.UnKnown = errDetail

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]] from := result.accountList[result.Transaction.Message.Instructions[offset[0]].Accounts[0]]
to := result.accountList[instruction.Accounts[1]] to := result.accountList[instruction.Accounts[1]]
if offset[1] == 0 { if result.Meta.Err == nil {
tx.SolTransfer = append(tx.SolTransfer, SolTransfer{ if offset[1] == 0 {
From: from, tx.SolTransfer = append(tx.SolTransfer, SolTransfer{
To: to, From: from,
Amount: decimal.NewFromInt(int64(lamports)), // solana decimals To: to,
}) Amount: decimal.NewFromInt(int64(lamports)), // solana decimals
})
}
} }
// load platform by to address // load platform by to address
platform, ok := platformFeeAddresses[to] platform, ok := platformFeeAddresses[to]