Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cd1d681621 | ||
|
|
920c5ba25b | ||
|
|
3d447ef2e8 |
@@ -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) {
|
||||
|
||||
2
pump.go
2
pump.go
@@ -225,7 +225,7 @@ func failedTxBuyOrSellParser(tx *Tx, instruction Instruction, innerInstructions
|
||||
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])
|
||||
}
|
||||
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])
|
||||
}
|
||||
if tx.Err.Enum == Custom {
|
||||
|
||||
@@ -268,7 +268,7 @@ func failedTxAmmBuyParser(tx *Tx, instruction Instruction, innerInstructions Inn
|
||||
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])
|
||||
}
|
||||
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])
|
||||
}
|
||||
if tx.Err.Enum == Custom {
|
||||
@@ -392,7 +392,7 @@ func failedTxAmmSellParser(tx *Tx, instruction Instruction, innerInstructions In
|
||||
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])
|
||||
}
|
||||
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])
|
||||
}
|
||||
if tx.Err.Enum == Custom {
|
||||
|
||||
2
rawtx.go
2
rawtx.go
@@ -354,7 +354,7 @@ func FromRpcTransactionWithMeta(tx rpc.TransactionWithMeta, blockTime *uint64, s
|
||||
}
|
||||
errDetail, ok := oErr[1].(string)
|
||||
if ok {
|
||||
if errDetail == "ComputationalBudgetExceeded" {
|
||||
if errDetail == "ComputationalBudgetExceeded" || errDetail == "ProgramFailedToComplete" {
|
||||
sTx.Meta.Err.Enum = ComputationalBudgetExceeded
|
||||
} else {
|
||||
sTx.Meta.Err.UnKnown = errDetail
|
||||
|
||||
14
system.go
14
system.go
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user