fix pump parser

This commit is contained in:
thloyi
2026-04-20 16:26:55 +08:00
parent 738e417167
commit a765fafddd
4 changed files with 73 additions and 783 deletions

View File

@@ -12,6 +12,7 @@ import (
"strconv"
"github.com/gagliardetto/solana-go"
"github.com/mr-tron/base58"
"github.com/shopspring/decimal"
)
@@ -186,7 +187,7 @@ func NewTxsBinary(txs []Tx) (*TxsBinary, error) {
for i, tx := range txPtrs {
binaryTx, err := newTxBinaryWithAddressTable(tx, addressTable, addressIndex)
if err != nil {
return nil, fmt.Errorf("tx[%d]: %w", i, err)
return nil, fmt.Errorf("tx[%d], %s: %w", i, base58.Encode(tx.TxHash[:]), err)
}
out.Txs = append(out.Txs, *binaryTx)
}
@@ -478,7 +479,7 @@ func (txs *TxsBinary) MarshalBinary() ([]byte, error) {
enc.writeUint32(uint32(len(txs.Txs)))
for i := range txs.Txs {
if err := enc.writeTxBinaryBody(&txs.Txs[i], enumTable); err != nil {
return nil, fmt.Errorf("tx[%d]: %w", i, err)
return nil, fmt.Errorf("tx[%d], %s: %w", i, base58.Encode(txs.Txs[i].TxHash[:]), err)
}
}
return enc.bytes(), nil