okxv2 parser
This commit is contained in:
@@ -948,15 +948,17 @@ func parseJupiterV6Instruction(tx *versionedTransaction, instructionIndex int) (
|
||||
break
|
||||
}
|
||||
}
|
||||
if srcIdx == 0 {
|
||||
if srcIdx == 0 || srcIdx+1 >= uint8(len(instruction.Accounts)) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
sourceMint, err = getStaticKey(tx.Message.StaticAccountKeys, int(instruction.Accounts[srcIdx]))
|
||||
baseMint, err := getStaticKey(tx.Message.StaticAccountKeys, int(instruction.Accounts[srcIdx]))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if !sourceMint.Equals(baseMint) {
|
||||
return nil, nil
|
||||
}
|
||||
quoteMint, err := getStaticKey(tx.Message.StaticAccountKeys, int(instruction.Accounts[srcIdx+1]))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -989,14 +991,17 @@ func parseJupiterV6Instruction(tx *versionedTransaction, instructionIndex int) (
|
||||
break
|
||||
}
|
||||
}
|
||||
if srcIdx == 0 {
|
||||
if srcIdx == 0 || srcIdx+1 >= uint8(len(instruction.Accounts)) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
sourceMint, err = getStaticKey(tx.Message.StaticAccountKeys, int(instruction.Accounts[srcIdx]))
|
||||
baseMint, err := getStaticKey(tx.Message.StaticAccountKeys, int(instruction.Accounts[srcIdx]))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !sourceMint.Equals(baseMint) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
quoteMint, err := getStaticKey(tx.Message.StaticAccountKeys, int(instruction.Accounts[srcIdx+1]))
|
||||
if err != nil {
|
||||
@@ -1026,7 +1031,7 @@ func parseJupiterV6Instruction(tx *versionedTransaction, instructionIndex int) (
|
||||
break
|
||||
}
|
||||
}
|
||||
if srcIdx == 0 {
|
||||
if srcIdx == 0 || srcIdx+1 >= uint8(len(instruction.Accounts)) {
|
||||
return nil, nil
|
||||
}
|
||||
sourceMint, err = getStaticKey(tx.Message.StaticAccountKeys, int(instruction.Accounts[srcIdx]))
|
||||
|
||||
Reference in New Issue
Block a user