Add JupiterAggregatorV6 pumpfun parse
This commit is contained in:
@@ -13,22 +13,25 @@ import (
|
||||
"github.com/samlior/libsam/pkg/shreder"
|
||||
)
|
||||
|
||||
// OKX tx
|
||||
// const dlmmSignature = "4W8gD2iEYyvzpPiW9BhdH5hUrfXhqH46ziLzPkaaxmaA8XXK53erUvrPdZ5cY2XrgWwix1hmRajUnGAiNp4cSGpN"
|
||||
|
||||
const dlmmSignature = "3Kcm9rqG9mJ6PCM5DuUoZ6jk3kzbH7J5GP488E5MKMwodf2NXgddygEcWBmzRBrV2YZFmXtG22gvcJixqdsCjRPn"
|
||||
|
||||
const (
|
||||
rpcURL = "https://staked.helius-rpc.com?api-key=5adcf1f9-5719-43d1-bf3f-c2d4e1e5f94d"
|
||||
txSignature = "4rkbkLCUQxc89Aq1BZxU1w4LDQtnCtoUJ6VNHmVec8Kqngr5T89xAXahubLFg8DF6iFGzJ39N8V8n6LFtARDUJT9"
|
||||
labelFilter = ""
|
||||
enableStats = true
|
||||
)
|
||||
|
||||
func main() {
|
||||
const rpcURL = "https://staked.helius-rpc.com?api-key=5adcf1f9-5719-43d1-bf3f-c2d4e1e5f94d"
|
||||
if rpcURL == "" {
|
||||
log.Fatal("SOL_RPC_URL is not set")
|
||||
if rpcURL == "" || rpcURL == "REPLACE_WITH_RPC_URL" {
|
||||
log.Fatal("rpcURL is not set in cmd/dlmmparse/main.go")
|
||||
}
|
||||
if txSignature == "" || txSignature == "REPLACE_WITH_TX_SIGNATURE" {
|
||||
log.Fatal("txSignature is not set in cmd/dlmmparse/main.go")
|
||||
}
|
||||
|
||||
client := rpc.New(rpcURL)
|
||||
sig, err := solana.SignatureFromBase58(dlmmSignature)
|
||||
sig, err := solana.SignatureFromBase58(txSignature)
|
||||
if err != nil {
|
||||
log.Fatalf("invalid dlmmSignature: %v", err)
|
||||
log.Fatalf("invalid txSignature: %v", err)
|
||||
}
|
||||
version := uint64(0)
|
||||
tx, err := client.GetTransaction(
|
||||
@@ -72,7 +75,7 @@ func main() {
|
||||
}
|
||||
|
||||
update := toSubscribeUpdate(tx.Slot, rawTx)
|
||||
signals := shreder.ParseTransaction(update, nil, true)
|
||||
signals := shreder.ParseTransaction(update, nil, enableStats)
|
||||
if len(signals) == 0 {
|
||||
fmt.Println("no signals parsed")
|
||||
return
|
||||
@@ -80,7 +83,10 @@ func main() {
|
||||
|
||||
printed := false
|
||||
for _, signal := range signals {
|
||||
if signal == nil || signal.Label != "dlmm" {
|
||||
if signal == nil {
|
||||
continue
|
||||
}
|
||||
if labelFilter != "" && signal.Label != labelFilter {
|
||||
continue
|
||||
}
|
||||
printed = true
|
||||
@@ -95,7 +101,11 @@ func main() {
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println("no dlmm signal parsed, dump all signals:")
|
||||
if labelFilter != "" {
|
||||
fmt.Printf("no %s signal parsed, dump all signals:\n", labelFilter)
|
||||
} else {
|
||||
fmt.Println("no matching signal parsed, dump all signals:")
|
||||
}
|
||||
for _, signal := range signals {
|
||||
if signal == nil {
|
||||
continue
|
||||
Reference in New Issue
Block a user