merge
This commit is contained in:
@@ -45,6 +45,7 @@ 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"`
|
||||||
TxFee decimal.Decimal `json:"tx_fee"`
|
TxFee decimal.Decimal `json:"tx_fee"`
|
||||||
|
EntryContract string `json:"entry_contract"`
|
||||||
|
|
||||||
ExactSOL bool `json:"exact_in"`
|
ExactSOL bool `json:"exact_in"`
|
||||||
|
|
||||||
|
|||||||
@@ -171,16 +171,6 @@ type pumpAmmBuyArgs struct {
|
|||||||
MaxSolCost uint64
|
MaxSolCost uint64
|
||||||
}
|
}
|
||||||
|
|
||||||
type _6hb1BuyArgs struct {
|
|
||||||
SolAmount uint64
|
|
||||||
TokenNumber uint64
|
|
||||||
}
|
|
||||||
|
|
||||||
type _8rsrBuyArgs struct {
|
|
||||||
SolIn uint64
|
|
||||||
TokenOut uint64
|
|
||||||
}
|
|
||||||
|
|
||||||
type boboBuyArgs struct {
|
type boboBuyArgs struct {
|
||||||
Placeholder1 uint64
|
Placeholder1 uint64
|
||||||
Placeholder2 uint64
|
Placeholder2 uint64
|
||||||
@@ -254,44 +244,44 @@ func ParseTransaction(update *SubscribeUpdateTransaction, loader *AddressTables)
|
|||||||
switch programID {
|
switch programID {
|
||||||
case pumpProgramID:
|
case pumpProgramID:
|
||||||
txRes, err := parsePumpInstruction(versioned, i)
|
txRes, err := parsePumpInstruction(versioned, i)
|
||||||
parsed = appendParsed(parsed, txRes, err, txHash, "pump")
|
parsed = appendParsed(parsed, txRes, err, txHash, "pump", pumpProgramID.String())
|
||||||
case azczProgramID:
|
case azczProgramID:
|
||||||
txRes, err := parseAzczInstruction(versioned, i)
|
txRes, err := parseAzczInstruction(versioned, i)
|
||||||
parsed = appendParsed(parsed, txRes, err, txHash, "azcz")
|
parsed = appendParsed(parsed, txRes, err, txHash, "azcz", azczProgramID.String())
|
||||||
case f5tfProgramID:
|
case f5tfProgramID:
|
||||||
txRes, err := parseF5tfInstruction(versioned, i)
|
txRes, err := parseF5tfInstruction(versioned, i)
|
||||||
parsed = appendParsed(parsed, txRes, err, txHash, "f5tf")
|
parsed = appendParsed(parsed, txRes, err, txHash, "f5tf", f5tfProgramID.String())
|
||||||
case flasProgramID:
|
case flasProgramID:
|
||||||
txRes, err := parseFlasInstruction(versioned, i)
|
txRes, err := parseFlasInstruction(versioned, i)
|
||||||
parsed = appendParsed(parsed, txRes, err, txHash, "flas")
|
parsed = appendParsed(parsed, txRes, err, txHash, "flas", flasProgramID.String())
|
||||||
case photonProgramID:
|
case photonProgramID:
|
||||||
txRes, err := parsePhotonInstruction(versioned, i)
|
txRes, err := parsePhotonInstruction(versioned, i)
|
||||||
parsed = appendParsed(parsed, txRes, err, txHash, "photon")
|
parsed = appendParsed(parsed, txRes, err, txHash, "photon", photonProgramID.String())
|
||||||
case pumpAmmProgramID:
|
case pumpAmmProgramID:
|
||||||
txRes, err := parsePumpAmmInstruction(versioned, i)
|
txRes, err := parsePumpAmmInstruction(versioned, i)
|
||||||
parsed = appendParsed(parsed, txRes, err, txHash, "pumpamm")
|
parsed = appendParsed(parsed, txRes, err, txHash, "pumpamm", pumpAmmProgramID.String())
|
||||||
case boboProgramID:
|
case boboProgramID:
|
||||||
txRes, err := parseBoboInstruction(versioned, i)
|
txRes, err := parseBoboInstruction(versioned, i)
|
||||||
parsed = appendParsed(parsed, txRes, err, txHash, "bobo")
|
parsed = appendParsed(parsed, txRes, err, txHash, "bobo", boboProgramID.String())
|
||||||
case qtkvProgramID:
|
case qtkvProgramID:
|
||||||
txRes, err := parseQtkvInstruction(versioned, i)
|
txRes, err := parseQtkvInstruction(versioned, i)
|
||||||
parsed = appendParsed(parsed, txRes, err, txHash, "qtkv")
|
parsed = appendParsed(parsed, txRes, err, txHash, "qtkv", qtkvProgramID.String())
|
||||||
case fjszProgramID:
|
case fjszProgramID:
|
||||||
txRes, err := parseFjszInstruction(versioned, i)
|
txRes, err := parseFjszInstruction(versioned, i)
|
||||||
parsed = appendParsed(parsed, txRes, err, txHash, "fjsz")
|
parsed = appendParsed(parsed, txRes, err, txHash, "fjsz", fjszProgramID.String())
|
||||||
case terminalProgramID:
|
case terminalProgramID:
|
||||||
txRes, err := parseTermInstruction(versioned, i)
|
txRes, err := parseTermInstruction(versioned, i)
|
||||||
parsed = appendParsed(parsed, txRes, err, txHash, "terminal")
|
parsed = appendParsed(parsed, txRes, err, txHash, "terminal", terminalProgramID.String())
|
||||||
case jupiterV6ProgramID:
|
case jupiterV6ProgramID:
|
||||||
txRes, err := parseJupiterV6Instruction(versioned, i)
|
txRes, err := parseJupiterV6Instruction(versioned, i)
|
||||||
parsed = appendParsed(parsed, txRes, err, txHash, "jupiterv6")
|
parsed = appendParsed(parsed, txRes, err, txHash, "jupiterv6", jupiterV6ProgramID.String())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return parsed
|
return parsed
|
||||||
}
|
}
|
||||||
|
|
||||||
func appendParsed(list []*TxSignal, parsed *TxSignal, err error, txHash [64]byte, label string) []*TxSignal {
|
func appendParsed(list []*TxSignal, parsed *TxSignal, err error, txHash [64]byte, label string, entryContract string) []*TxSignal {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if !strings.HasPrefix(err.Error(), "account index") {
|
if !strings.HasPrefix(err.Error(), "account index") {
|
||||||
logger.Debug("txparser: failed to parse", "label", label, "instruction", err, "tx_hash", base58.Encode(txHash[:]))
|
logger.Debug("txparser: failed to parse", "label", label, "instruction", err, "tx_hash", base58.Encode(txHash[:]))
|
||||||
@@ -299,6 +289,7 @@ func appendParsed(list []*TxSignal, parsed *TxSignal, err error, txHash [64]byte
|
|||||||
return list
|
return list
|
||||||
}
|
}
|
||||||
if parsed != nil {
|
if parsed != nil {
|
||||||
|
parsed.EntryContract = entryContract
|
||||||
list = append(list, parsed)
|
list = append(list, parsed)
|
||||||
}
|
}
|
||||||
return list
|
return list
|
||||||
@@ -915,7 +906,9 @@ func parseFlasBuy(tx *versionedTransaction, instructionIndex int) (*TxSignal, er
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
if len(instruction.Data) > 20 {
|
||||||
|
instruction.Data = instruction.Data[:20]
|
||||||
|
}
|
||||||
var args flasArgs
|
var args flasArgs
|
||||||
if err := borsh.Deserialize(&args, instruction.Data[1:]); err != nil {
|
if err := borsh.Deserialize(&args, instruction.Data[1:]); err != nil {
|
||||||
return nil, fmt.Errorf("failed to parse buy tokens args: %w", err)
|
return nil, fmt.Errorf("failed to parse buy tokens args: %w", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user