Compare commits
1 Commits
v2.0.14
...
5d06d18aa8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5d06d18aa8 |
@@ -45,6 +45,7 @@ type TxSignal struct {
|
||||
IsToken2022 bool `json:"is_token2022"`
|
||||
IsMayhemMode bool `json:"is_mayhem_mode"`
|
||||
CUPrice decimal.Decimal `json:"cu_price"`
|
||||
CULimit decimal.Decimal `json:"cu_limit"`
|
||||
SWQoSAgent string `json:"swqos_agent"`
|
||||
SWQoSTips decimal.Decimal `json:"swqos_tips"`
|
||||
|
||||
|
||||
@@ -203,16 +203,22 @@ func ParseTransactionWithHandler(ctx context.Context, versioned VersionedTransac
|
||||
cuPrice := decimal.Zero
|
||||
swqosAgent := ""
|
||||
swqosTips := decimal.Zero
|
||||
cuLimit := decimal.Zero
|
||||
for _, instruction := range versioned.Instructions {
|
||||
program, err := versioned.GetAccount(int(instruction.ProgramIDIndex))
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
if program.Equals(ComputeBudgetProgram) &&
|
||||
len(instruction.Data) == 9 &&
|
||||
instruction.Data[0] == 0x03 {
|
||||
cuPriceUint64 := binary.LittleEndian.Uint64(instruction.Data[1:9])
|
||||
cuPrice = formatCUPrice(cuPriceUint64)
|
||||
len(instruction.Data) == 9 {
|
||||
if instruction.Data[0] == 0x03 {
|
||||
cuPriceUint64 := binary.LittleEndian.Uint64(instruction.Data[1:9])
|
||||
cuPrice = formatCUPrice(cuPriceUint64)
|
||||
} else if instruction.Data[0] == 0x02 {
|
||||
cuLimitUint32 := binary.LittleEndian.Uint32(instruction.Data[1:4])
|
||||
cuLimit = formatCUPrice(uint64(cuLimitUint32))
|
||||
}
|
||||
|
||||
}
|
||||
if program.Equals(solana.SystemProgramID) &&
|
||||
len(instruction.Data) == 12 &&
|
||||
@@ -260,6 +266,7 @@ func ParseTransactionWithHandler(ctx context.Context, versioned VersionedTransac
|
||||
one.Label = handler.Label
|
||||
one.Block = versioned.Block
|
||||
one.CUPrice = cuPrice
|
||||
one.CULimit = cuLimit
|
||||
one.SWQoSAgent = swqosAgent
|
||||
one.SWQoSTips = swqosTips
|
||||
select {
|
||||
|
||||
Reference in New Issue
Block a user