Merge branch 'master' of https://github.com/samlior/libsam
This commit is contained in:
@@ -15,7 +15,7 @@ import (
|
||||
|
||||
const (
|
||||
rpcURL = "https://staked.helius-rpc.com?api-key=5adcf1f9-5719-43d1-bf3f-c2d4e1e5f94d"
|
||||
txSignature = "4xkfvs5HrABpZcmbHwvqS6SRY9gYatc9DfqEZ78RCp4bgrMnmfRw4Tv8RSyT7rfDwNzmNAysezAn5TDsVBrbYXy6"
|
||||
txSignature = "4gzWkLRWNLbkBdvyCqg2M4unWA7yg4DdMg8dGTnapw2USsefd9TjXVArhv22qJE9gtex46NwXC4xp1FtNZ1TmjAM"
|
||||
labelFilter = ""
|
||||
)
|
||||
|
||||
|
||||
@@ -3,12 +3,12 @@ package shreder
|
||||
import (
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/gagliardetto/solana-go"
|
||||
)
|
||||
|
||||
var bloomRouterProgramID = solana.MustPublicKeyFromBase58("b1oomGGqPKGD6errbyfbVMBuzSC8WtAAYo8MwNafWW1")
|
||||
var pumpFunAccount = solana.MustPublicKeyFromBase58("4wTV1YmiEkRvAtNtsSGPtUrqRYQMe5SKy2uB4Jjaxnjf")
|
||||
|
||||
type bloomRouterArgs struct {
|
||||
Side uint16
|
||||
@@ -61,22 +61,27 @@ func parseBloomRouterInstruction(tx VersionedTransaction, instructionIndex int)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var (
|
||||
mint solana.PublicKey
|
||||
ok bool
|
||||
)
|
||||
for _, acctIdx := range instruction.Accounts {
|
||||
var mint solana.PublicKey
|
||||
foundPumpFun := false
|
||||
for i, acctIdx := range instruction.Accounts {
|
||||
key, err := tx.GetAccount(int(acctIdx))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if strings.HasSuffix(key.String(), "pump") {
|
||||
mint = key
|
||||
ok = true
|
||||
if key.Equals(pumpFunAccount) {
|
||||
if i+2 >= len(instruction.Accounts) {
|
||||
return nil, fmt.Errorf("accounts too short for pumpfun mint, idx=%d len=%d", i, len(instruction.Accounts))
|
||||
}
|
||||
mintKey, err := tx.GetAccount(int(instruction.Accounts[i+2]))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
mint = mintKey
|
||||
foundPumpFun = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !ok {
|
||||
if !foundPumpFun {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user