Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
047b549d0f | ||
|
|
9327eab010 |
@@ -410,10 +410,13 @@ func metaoradlmmPositionCreateParser(tx *Tx, instruction Instruction, innerInstr
|
|||||||
return nil, increaseOffset(offset), fmt.Errorf("meteora dlmm create position accounts parse error: %v, offset, %d, %d", err, offset[0], offset[1])
|
return nil, increaseOffset(offset), fmt.Errorf("meteora dlmm create position accounts parse error: %v, offset, %d, %d", err, offset[0], offset[1])
|
||||||
}
|
}
|
||||||
|
|
||||||
createEvent, nextOffset, err := dlmmPositionCreateEventFromInnerInstructions(innerInstructions, instruction, offset)
|
createEvent, nextOffset, found, err := dlmmPositionCreateEventFromInnerInstructions(innerInstructions, instruction, offset)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nextOffset, err
|
return nil, nextOffset, err
|
||||||
}
|
}
|
||||||
|
if !found {
|
||||||
|
return nil, nextOffset, InstructionIgnoredError
|
||||||
|
}
|
||||||
offset = nextOffset
|
offset = nextOffset
|
||||||
|
|
||||||
if !createEvent.LbPair.IsZero() {
|
if !createEvent.LbPair.IsZero() {
|
||||||
@@ -1478,11 +1481,11 @@ func dlmmRebalancingEventFromInnerInstructions(innerInstructions InnerInstructio
|
|||||||
return dlmmRebalancingEvent{}, increaseOffset(offset), fmt.Errorf("meteora dlmm rebalance liquidity event not found, offset, %d, %d", offset[0], prefixLen)
|
return dlmmRebalancingEvent{}, increaseOffset(offset), fmt.Errorf("meteora dlmm rebalance liquidity event not found, offset, %d, %d", offset[0], prefixLen)
|
||||||
}
|
}
|
||||||
|
|
||||||
func dlmmPositionCreateEventFromInnerInstructions(innerInstructions InnerInstructions, instruction Instruction, offset [2]uint) (dlmmPositionCreateEvent, [2]uint, error) {
|
func dlmmPositionCreateEventFromInnerInstructions(innerInstructions InnerInstructions, instruction Instruction, offset [2]uint) (dlmmPositionCreateEvent, [2]uint, bool, error) {
|
||||||
var prefixLen = offset[1]
|
var prefixLen = offset[1]
|
||||||
inners, err := getInnerInstructions(innerInstructions, prefixLen)
|
inners, err := getInnerInstructions(innerInstructions, prefixLen)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return dlmmPositionCreateEvent{}, increaseOffset(offset), fmt.Errorf("meteora dlmm create position get inner instructions error: %v, offset, %d, %d", err, offset[0], prefixLen)
|
return dlmmPositionCreateEvent{}, increaseOffset(offset), false, fmt.Errorf("meteora dlmm create position get inner instructions error: %v, offset, %d, %d", err, offset[0], prefixLen)
|
||||||
}
|
}
|
||||||
for innerIndex, innerInstr := range inners {
|
for innerIndex, innerInstr := range inners {
|
||||||
if innerInstr.ProgramIDIndex != instruction.ProgramIDIndex {
|
if innerInstr.ProgramIDIndex != instruction.ProgramIDIndex {
|
||||||
@@ -1497,9 +1500,9 @@ func dlmmPositionCreateEventFromInnerInstructions(innerInstructions InnerInstruc
|
|||||||
} else {
|
} else {
|
||||||
offset[1] = uint(innerIndex) + 1 + prefixLen
|
offset[1] = uint(innerIndex) + 1 + prefixLen
|
||||||
}
|
}
|
||||||
return event, offset, nil
|
return event, offset, true, nil
|
||||||
}
|
}
|
||||||
return dlmmPositionCreateEvent{}, increaseOffset(offset), fmt.Errorf("meteora dlmm create position event not found, offset, %d, %d", offset[0], prefixLen)
|
return dlmmPositionCreateEvent{}, increaseOffset(offset), false, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func dlmmPositionCloseEventFromInnerInstructions(innerInstructions InnerInstructions, instruction Instruction, offset [2]uint) (dlmmPositionCloseEvent, [2]uint, bool, error) {
|
func dlmmPositionCloseEventFromInnerInstructions(innerInstructions InnerInstructions, instruction Instruction, offset [2]uint) (dlmmPositionCloseEvent, [2]uint, bool, error) {
|
||||||
|
|||||||
2
rawtx.go
2
rawtx.go
@@ -872,7 +872,9 @@ func ConvertYellowstoneGrpcTransactionToSolanaTransaction(y *pb.SubscribeUpdateT
|
|||||||
}
|
}
|
||||||
sTx.Meta.Fee = meta.Fee
|
sTx.Meta.Fee = meta.Fee
|
||||||
//sTx.Meta.InnerInstructions = meta.InnerInstructions
|
//sTx.Meta.InnerInstructions = meta.InnerInstructions
|
||||||
|
if meta.ComputeUnitsConsumed != nil {
|
||||||
sTx.Meta.ComputeUnitsConsumed = *meta.ComputeUnitsConsumed
|
sTx.Meta.ComputeUnitsConsumed = *meta.ComputeUnitsConsumed
|
||||||
|
}
|
||||||
for _, innerInstr := range meta.InnerInstructions {
|
for _, innerInstr := range meta.InnerInstructions {
|
||||||
var instrs []Instruction
|
var instrs []Instruction
|
||||||
for _, instr := range innerInstr.Instructions {
|
for _, instr := range innerInstr.Instructions {
|
||||||
|
|||||||
Reference in New Issue
Block a user