Compare commits
4 Commits
5d06d18aa8
...
v0.2.19
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c20e019b43 | ||
|
|
c7be7cf4fd | ||
|
|
62c313d4a1 | ||
|
|
5fa6944a37 |
@@ -160,6 +160,8 @@ const (
|
|||||||
Scorch
|
Scorch
|
||||||
VaultLiquidUnstake
|
VaultLiquidUnstake
|
||||||
XOrca
|
XOrca
|
||||||
|
Quantum
|
||||||
|
WhaleStreetV2
|
||||||
)
|
)
|
||||||
|
|
||||||
var swapKindNames = [122]string{"Saber", "SaberAddDecimalsDeposit", "SaberAddDecimalsWithdraw", "TokenSwap", "Sencha", "Step", "Cropper",
|
var swapKindNames = [122]string{"Saber", "SaberAddDecimalsDeposit", "SaberAddDecimalsWithdraw", "TokenSwap", "Sencha", "Step", "Cropper",
|
||||||
@@ -333,8 +335,20 @@ func decodeSwap(dec *bin.Decoder) (Swap, error) {
|
|||||||
case RaydiumLaunchlabBuy, RaydiumLaunchlabSell:
|
case RaydiumLaunchlabBuy, RaydiumLaunchlabSell:
|
||||||
return out, skipU64()
|
return out, skipU64()
|
||||||
// -------- Side(u8) payload --------
|
// -------- Side(u8) payload --------
|
||||||
case Serum, Aldrin, AldrinV2, Dradex, Openbook, Phoenix, OpenBookV2, TokenMill, Plasma, TesseraV, Futarchy, WhaleStreet, Manifest:
|
case Serum, Aldrin, AldrinV2, Dradex, Openbook, Phoenix, OpenBookV2, TokenMill, Plasma, TesseraV, Futarchy,
|
||||||
|
WhaleStreet, Manifest, Quantum:
|
||||||
return out, skipU8()
|
return out, skipU8()
|
||||||
|
case WhaleStreetV2:
|
||||||
|
if err := skipU8(); err != nil {
|
||||||
|
return Swap{}, err
|
||||||
|
}
|
||||||
|
if err := skipU64(); err != nil {
|
||||||
|
return Swap{}, err
|
||||||
|
}
|
||||||
|
if err := skipU64(); err != nil {
|
||||||
|
return Swap{}, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
// -------- MeteoraDlmmSwapV2: RemainingAccountsInfo --------
|
// -------- MeteoraDlmmSwapV2: RemainingAccountsInfo --------
|
||||||
case MeteoraDlmmSwapV2:
|
case MeteoraDlmmSwapV2:
|
||||||
return out, skipRemaining()
|
return out, skipRemaining()
|
||||||
|
|||||||
@@ -45,9 +45,10 @@ type TxSignal struct {
|
|||||||
IsToken2022 bool `json:"is_token2022"`
|
IsToken2022 bool `json:"is_token2022"`
|
||||||
IsMayhemMode bool `json:"is_mayhem_mode"`
|
IsMayhemMode bool `json:"is_mayhem_mode"`
|
||||||
CUPrice decimal.Decimal `json:"cu_price"`
|
CUPrice decimal.Decimal `json:"cu_price"`
|
||||||
CULimit decimal.Decimal `json:"cu_limit"`
|
CULimit uint32 `json:"cu_limit"`
|
||||||
SWQoSAgent string `json:"swqos_agent"`
|
SWQoSAgent string `json:"swqos_agent"`
|
||||||
SWQoSTips decimal.Decimal `json:"swqos_tips"`
|
SWQoSTips decimal.Decimal `json:"swqos_tips"`
|
||||||
|
TableCnt int `json:"table_cnt"`
|
||||||
|
|
||||||
ExactSOL bool `json:"exact_in"`
|
ExactSOL bool `json:"exact_in"`
|
||||||
|
|
||||||
|
|||||||
@@ -182,7 +182,8 @@ func ParseTransactionForEntries(ctx context.Context, slot uint64, entriesReader
|
|||||||
}
|
}
|
||||||
|
|
||||||
func ParseTransactionWithHandler(ctx context.Context, versioned VersionedTransaction, loader *AddressTables, parsed chan<- TxSignal, handlers map[solana.PublicKey]Handler) {
|
func ParseTransactionWithHandler(ctx context.Context, versioned VersionedTransaction, loader *AddressTables, parsed chan<- TxSignal, handlers map[solana.PublicKey]Handler) {
|
||||||
if loader != nil && len(versioned.AddressTableLookups) > 0 {
|
tableCnt := len(versioned.AddressTableLookups)
|
||||||
|
if loader != nil && tableCnt > 0 {
|
||||||
lookupTableOk := true
|
lookupTableOk := true
|
||||||
for _, lookups := range versioned.AddressTableLookups {
|
for _, lookups := range versioned.AddressTableLookups {
|
||||||
lookupTableOk = loader.FillToTx(&versioned, lookups.AccountKey, lookups.WritableIndexes)
|
lookupTableOk = loader.FillToTx(&versioned, lookups.AccountKey, lookups.WritableIndexes)
|
||||||
@@ -203,22 +204,19 @@ func ParseTransactionWithHandler(ctx context.Context, versioned VersionedTransac
|
|||||||
cuPrice := decimal.Zero
|
cuPrice := decimal.Zero
|
||||||
swqosAgent := ""
|
swqosAgent := ""
|
||||||
swqosTips := decimal.Zero
|
swqosTips := decimal.Zero
|
||||||
cuLimit := decimal.Zero
|
cuLimit := uint32(0)
|
||||||
for _, instruction := range versioned.Instructions {
|
for _, instruction := range versioned.Instructions {
|
||||||
program, err := versioned.GetAccount(int(instruction.ProgramIDIndex))
|
program, err := versioned.GetAccount(int(instruction.ProgramIDIndex))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if program.Equals(ComputeBudgetProgram) &&
|
if program.Equals(ComputeBudgetProgram) {
|
||||||
len(instruction.Data) == 9 {
|
if len(instruction.Data) == 9 && instruction.Data[0] == 0x03 {
|
||||||
if instruction.Data[0] == 0x03 {
|
|
||||||
cuPriceUint64 := binary.LittleEndian.Uint64(instruction.Data[1:9])
|
cuPriceUint64 := binary.LittleEndian.Uint64(instruction.Data[1:9])
|
||||||
cuPrice = formatCUPrice(cuPriceUint64)
|
cuPrice = formatCUPrice(cuPriceUint64)
|
||||||
} else if instruction.Data[0] == 0x02 {
|
} else if len(instruction.Data) == 5 && instruction.Data[0] == 0x02 {
|
||||||
cuLimitUint32 := binary.LittleEndian.Uint32(instruction.Data[1:4])
|
cuLimit = binary.LittleEndian.Uint32(instruction.Data[1:5])
|
||||||
cuLimit = formatCUPrice(uint64(cuLimitUint32))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if program.Equals(solana.SystemProgramID) &&
|
if program.Equals(solana.SystemProgramID) &&
|
||||||
len(instruction.Data) == 12 &&
|
len(instruction.Data) == 12 &&
|
||||||
@@ -269,6 +267,7 @@ func ParseTransactionWithHandler(ctx context.Context, versioned VersionedTransac
|
|||||||
one.CULimit = cuLimit
|
one.CULimit = cuLimit
|
||||||
one.SWQoSAgent = swqosAgent
|
one.SWQoSAgent = swqosAgent
|
||||||
one.SWQoSTips = swqosTips
|
one.SWQoSTips = swqosTips
|
||||||
|
one.TableCnt = tableCnt
|
||||||
select {
|
select {
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user