From d8e8d7ba89c8660c89b261322cdedfa60e615d52 Mon Sep 17 00:00:00 2001 From: thloyi Date: Thu, 27 Nov 2025 16:39:01 +0800 Subject: [PATCH] 1 --- parser.go | 11 +++++++++++ pump_test.go | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/parser.go b/parser.go index bab757b..b5003de 100644 --- a/parser.go +++ b/parser.go @@ -17,6 +17,17 @@ var actionPrograms = map[solana.PublicKey]actionParser{ budgGetProgram: budgetParser, } +func ParseRawTx(rawTx *RawTx) (*Tx, error) { + tx := &Tx{ + rawTx: rawTx, + } + err := tx.Parser() + if err != nil { + return nil, err + } + return tx, nil +} + func (tx *Tx) Parser() error { if tx.rawTx == nil { return errors.New("rawTx is nil") diff --git a/pump_test.go b/pump_test.go index 92c8186..fb06892 100644 --- a/pump_test.go +++ b/pump_test.go @@ -2,9 +2,11 @@ package pump_parser import ( "encoding/hex" + "fmt" "testing" agbinary "github.com/gagliardetto/binary" + "github.com/mr-tron/base58" ) func TestTradeEvent(t *testing.T) { @@ -23,4 +25,7 @@ func TestTradeEvent(t *testing.T) { t.Logf("Trade Event: %+v", tradeEvent) + xx, err := base58.Decode("3Bxs48EzTZB4tzRd") + fmt.Println(len(xx), err) + }