chore: add bloom router selector
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package shreder
|
package shreder
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
@@ -10,6 +11,8 @@ import (
|
|||||||
var bloomRouterProgramID = solana.MustPublicKeyFromBase58("b1oomGGqPKGD6errbyfbVMBuzSC8WtAAYo8MwNafWW1")
|
var bloomRouterProgramID = solana.MustPublicKeyFromBase58("b1oomGGqPKGD6errbyfbVMBuzSC8WtAAYo8MwNafWW1")
|
||||||
var pumpFunAccount = solana.MustPublicKeyFromBase58("4wTV1YmiEkRvAtNtsSGPtUrqRYQMe5SKy2uB4Jjaxnjf")
|
var pumpFunAccount = solana.MustPublicKeyFromBase58("4wTV1YmiEkRvAtNtsSGPtUrqRYQMe5SKy2uB4Jjaxnjf")
|
||||||
|
|
||||||
|
var bloomRouterSwapDiscriminator = []byte{0xf1, 0x57, 0x27, 0x38, 0x01, 0x4d, 0x0e, 0x63}
|
||||||
|
|
||||||
type bloomRouterArgs struct {
|
type bloomRouterArgs struct {
|
||||||
Side uint16
|
Side uint16
|
||||||
SolAmount uint64
|
SolAmount uint64
|
||||||
@@ -26,6 +29,10 @@ func parseBloomRouterInstruction(tx VersionedTransaction, instructionIndex int)
|
|||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !bytes.Equal(instruction.Data[:8], bloomRouterSwapDiscriminator) {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
|
||||||
findPumpFun := func() (solana.PublicKey, solana.PublicKey, error) {
|
findPumpFun := func() (solana.PublicKey, solana.PublicKey, error) {
|
||||||
var mint solana.PublicKey
|
var mint solana.PublicKey
|
||||||
foundPumpFun := false
|
foundPumpFun := false
|
||||||
|
|||||||
Reference in New Issue
Block a user