Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a0e46ec83e | ||
|
|
3324a71117 | ||
|
|
7557414fff | ||
|
|
eb394c5650 | ||
|
|
1223b34117 | ||
|
|
d866701679 | ||
| fa1875996c | |||
|
|
519b0ebb0b |
2
Makefile
2
Makefile
@@ -19,4 +19,4 @@ shreder:
|
||||
.PHONY: build
|
||||
# build
|
||||
build:
|
||||
mkdir -p bin/ && CGO_ENABLED=0 go build -o ./bin/ ./...
|
||||
mkdir -p bin/ && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ./bin/ ./...
|
||||
@@ -10,9 +10,9 @@ import (
|
||||
"github.com/gagliardetto/solana-go"
|
||||
"github.com/gagliardetto/solana-go/programs/system"
|
||||
"github.com/gagliardetto/solana-go/rpc"
|
||||
"github.com/samlior/libsam/pkg/consts"
|
||||
"github.com/samlior/libsam/pkg/enum"
|
||||
"github.com/samlior/libsam/pkg/swqos"
|
||||
"github.com/samlior/libsam/v2/pkg/consts"
|
||||
"github.com/samlior/libsam/v2/pkg/enum"
|
||||
"github.com/samlior/libsam/v2/pkg/swqos"
|
||||
"github.com/shopspring/decimal"
|
||||
)
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ func main() {
|
||||
}
|
||||
rpcClient := rpc.New(rpcUrl)
|
||||
shreder.SetLogLevel(slog.LevelDebug)
|
||||
//handlers := shreder.GetRegisteredHandlers()
|
||||
shrederClient, cleanup, err := shreder.NewShrederClient(
|
||||
url,
|
||||
rpcClient,
|
||||
@@ -55,13 +56,14 @@ func main() {
|
||||
"proVF4pMXVaYqmy4NjniPh4pqKNfMmsihgd4wdkCX3u",
|
||||
},
|
||||
},
|
||||
"dflow": {
|
||||
AccountRequired: []string{
|
||||
"DF1ow4tspfHX9JwWJsAb9epbkA8hmpSEAtxXy1V27QBH",
|
||||
},
|
||||
},
|
||||
|
||||
// TODO: axiom, gmgn, etc.
|
||||
}, shreder.BlocksStats(false), shreder.LogParsedStats(true), shreder.ShowTableLoaded(false))
|
||||
},
|
||||
//shreder.WithCustomParsers(map[solana.PublicKey]shreder.Handler{
|
||||
// solana.MustPublicKeyFromBase58("JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4"): handlers[solana.MustPublicKeyFromBase58("JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4")],
|
||||
// solana.MustPublicKeyFromBase58("proVF4pMXVaYqmy4NjniPh4pqKNfMmsihgd4wdkCX3u"): handlers[solana.MustPublicKeyFromBase58("proVF4pMXVaYqmy4NjniPh4pqKNfMmsihgd4wdkCX3u")],
|
||||
//}),
|
||||
shreder.BlocksStats(false), shreder.LogParsedStats(true), shreder.ShowTableLoaded(false))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@@ -91,8 +93,8 @@ func main() {
|
||||
case <-ctx.Done():
|
||||
return
|
||||
case tx := <-txCh:
|
||||
if tx.Label == "okxdexroutev2" || tx.Label == "jupiterv6" || tx.Label == "dflow" {
|
||||
fmt.Println("===============", tx.TxHash, tx.Label, tx.Event, tx.Token0Address, "token:", tx.Token0Amount, "parse time:", tx.ParseEnd.Sub(tx.ParseStart))
|
||||
if tx.Label == "dbot" || tx.Label == "okxdexroutev2" {
|
||||
fmt.Println("===============", tx.TxHash, tx.Label,tx.Program ,tx.Event, tx.Token0Address, tx.Token1Address,"token0amount:", tx.Token0Amount, "token1amount:",tx.Token1Amount ,"parse time:", tx.ParseEnd.Sub(tx.ParseStart))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,14 +10,13 @@ import (
|
||||
"github.com/gagliardetto/solana-go/programs/address-lookup-table"
|
||||
"github.com/gagliardetto/solana-go/rpc"
|
||||
|
||||
"github.com/samlior/libsam/pkg/shreder"
|
||||
"github.com/samlior/libsam/v2/pkg/shreder"
|
||||
)
|
||||
|
||||
const (
|
||||
rpcURL = "https://staked.helius-rpc.com?api-key=5adcf1f9-5719-43d1-bf3f-c2d4e1e5f94d"
|
||||
txSignature = "4YUQzsQcHxt5jA6qKPVBWCgw8VRuE6bZqAoXeiwptbdLwta3QnDbWHzjwP3mY8hJPPerSf1yGbpdL2SdyWZTJ9e1"
|
||||
txSignature = "4xkfvs5HrABpZcmbHwvqS6SRY9gYatc9DfqEZ78RCp4bgrMnmfRw4Tv8RSyT7rfDwNzmNAysezAn5TDsVBrbYXy6"
|
||||
labelFilter = ""
|
||||
enableStats = true
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -75,7 +74,7 @@ func main() {
|
||||
}
|
||||
|
||||
update := toSubscribeUpdate(tx.Slot, rawTx)
|
||||
signals := shreder.ParseTransaction(update, nil, enableStats)
|
||||
signals := parseSignals(context.Background(), update)
|
||||
if len(signals) == 0 {
|
||||
fmt.Println("no signals parsed")
|
||||
return
|
||||
@@ -83,9 +82,6 @@ func main() {
|
||||
|
||||
printed := false
|
||||
for _, signal := range signals {
|
||||
if signal == nil {
|
||||
continue
|
||||
}
|
||||
if labelFilter != "" && signal.Label != labelFilter {
|
||||
continue
|
||||
}
|
||||
@@ -107,9 +103,6 @@ func main() {
|
||||
fmt.Println("no matching signal parsed, dump all signals:")
|
||||
}
|
||||
for _, signal := range signals {
|
||||
if signal == nil {
|
||||
continue
|
||||
}
|
||||
output, err := json.MarshalIndent(signal, "", " ")
|
||||
if err != nil {
|
||||
log.Fatalf("marshal signal failed: %v", err)
|
||||
@@ -118,6 +111,24 @@ func main() {
|
||||
}
|
||||
}
|
||||
|
||||
func parseSignals(ctx context.Context, update *shreder.SubscribeUpdateTransaction) []shreder.TxSignal {
|
||||
signalsCh := make(chan shreder.TxSignal, 64)
|
||||
done := make(chan struct{})
|
||||
go func() {
|
||||
shreder.ParseTransactionForSubscribe(ctx, update, nil, signalsCh, done)
|
||||
}()
|
||||
go func() {
|
||||
<-done
|
||||
close(signalsCh)
|
||||
}()
|
||||
|
||||
signals := make([]shreder.TxSignal, 0)
|
||||
for signal := range signalsCh {
|
||||
signals = append(signals, signal)
|
||||
}
|
||||
return signals
|
||||
}
|
||||
|
||||
func toSubscribeUpdate(slot uint64, tx *solana.Transaction) *shreder.SubscribeUpdateTransaction {
|
||||
signatures := make([][]byte, len(tx.Signatures))
|
||||
for i, sig := range tx.Signatures {
|
||||
|
||||
95
go.sum
95
go.sum
@@ -1,32 +1,23 @@
|
||||
filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU=
|
||||
filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns=
|
||||
filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
|
||||
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
|
||||
github.com/AlekSi/pointer v1.1.0 h1:SSDMPcXD9jSl8FPy9cRzoRaMJtm9g9ggGTxecRUbQoI=
|
||||
github.com/AlekSi/pointer v1.1.0/go.mod h1:y7BvfRI3wXPWKXEBhU71nbnIEEZX0QTSB2Bj48UJIZE=
|
||||
github.com/BlockRazorinc/solana-trader-client-go v0.0.0-20250722092120-44561cb37455 h1:MMc4/hemlMtG76VkDZt6zNL0u+OwNYBCNp2KX5jqolQ=
|
||||
github.com/BlockRazorinc/solana-trader-client-go v0.0.0-20250722092120-44561cb37455/go.mod h1:vKj1SKlrekR9fuZgWQNNAWt/PUZIfzpGjDpIcbf1kT0=
|
||||
github.com/BlockRazorinc/solana-trader-client-go v0.0.0-20250908052524-06493dcc1bb4 h1:yvrhmN9vQIrquQP1fYul30khwfoE8oEL0VmwFZ37Mq8=
|
||||
github.com/BlockRazorinc/solana-trader-client-go v0.0.0-20250908052524-06493dcc1bb4/go.mod h1:vKj1SKlrekR9fuZgWQNNAWt/PUZIfzpGjDpIcbf1kT0=
|
||||
github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129 h1:MzBOUgng9orim59UnfUTLRjMpd09C5uEVQ6RPGeCaVI=
|
||||
github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129/go.mod h1:rFgpPQZYZ8vdbc+48xibu8ALc3yeyd64IhHS+PU6Yyg=
|
||||
github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
|
||||
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
|
||||
github.com/blendle/zapdriver v1.3.1 h1:C3dydBOWYRiOk+B8X9IVZ5IOe+7cl+tGOexN4QqHfpE=
|
||||
github.com/blendle/zapdriver v1.3.1/go.mod h1:mdXfREi6u5MArG4j9fewC+FGnXaBR+T4Ox4J2u4eHCc=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s=
|
||||
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
|
||||
github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
|
||||
github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU=
|
||||
github.com/gagliardetto/binary v0.8.0 h1:U9ahc45v9HW0d15LoN++vIXSJyqR/pWw8DDlhd7zvxg=
|
||||
github.com/gagliardetto/binary v0.8.0/go.mod h1:2tfj51g5o9dnvsc+fL3Jxr22MuWzYXwx9wEoN0XQ7/c=
|
||||
github.com/gagliardetto/gofuzz v1.2.2 h1:XL/8qDMzcgvR4+CyRQW9UGdwPRPMHVJfqQ/uMvSUuQw=
|
||||
github.com/gagliardetto/gofuzz v1.2.2/go.mod h1:bkH/3hYLZrMLbfYWA0pWzXmi5TTRZnu4pMGZBkqMKvY=
|
||||
github.com/gagliardetto/solana-go v1.12.0 h1:rzsbilDPj6p+/DOPXBMLhwMZeBgeRuXjm5zQFCoXgsg=
|
||||
github.com/gagliardetto/solana-go v1.12.0/go.mod h1:l/qqqIN6qJJPtxW/G1PF4JtcE3Zg2vD2EliZrr9Gn5k=
|
||||
github.com/gagliardetto/solana-go v1.14.0 h1:3WfAi70jOOjAJ0deFMjdhFYlLXATF4tOQXsDNWJtOLw=
|
||||
github.com/gagliardetto/solana-go v1.14.0/go.mod h1:l/qqqIN6qJJPtxW/G1PF4JtcE3Zg2vD2EliZrr9Gn5k=
|
||||
github.com/gagliardetto/treeout v0.1.4 h1:ozeYerrLCmCubo1TcIjFiOWTTGteOOHND1twdFpgwaw=
|
||||
@@ -37,8 +28,6 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
|
||||
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
|
||||
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
|
||||
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
|
||||
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
@@ -49,8 +38,6 @@ github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyf
|
||||
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
|
||||
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
|
||||
github.com/klauspost/compress v1.11.4/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
|
||||
github.com/klauspost/compress v1.13.6 h1:P76CopJELS0TiO2mebmnzgWaajssP/EszplttgQxcgc=
|
||||
github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
|
||||
github.com/klauspost/compress v1.18.3 h1:9PJRvfbmTabkOX8moIpXPbMMbYN60bWImDDU7L+/6zw=
|
||||
github.com/klauspost/compress v1.18.3/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
@@ -59,13 +46,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/logrusorgru/aurora v2.0.3+incompatible h1:tOpm7WcpBTn4fjmVfgpQq0EfczGlG91VSDkswnjF5A8=
|
||||
github.com/logrusorgru/aurora v2.0.3+incompatible/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4=
|
||||
github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA=
|
||||
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
|
||||
github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE=
|
||||
github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
|
||||
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
|
||||
github.com/mattn/go-isatty v0.0.11 h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM=
|
||||
github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
|
||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||
github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU=
|
||||
@@ -75,7 +57,6 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
|
||||
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
|
||||
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
|
||||
github.com/mostynb/zstdpool-freelist v0.0.0-20201229113212-927304c0c3b1 h1:mPMvm6X6tf4w8y7j9YIt6V9jfWhL6QlbEc7CCmeQlWk=
|
||||
github.com/mostynb/zstdpool-freelist v0.0.0-20201229113212-927304c0c3b1/go.mod h1:ye2e/VUEtE2BHE+G/QcKkcLQVAEJoYRFj5VUOQatCRE=
|
||||
github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o=
|
||||
@@ -87,18 +68,13 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y
|
||||
github.com/panjf2000/ants/v2 v2.11.4 h1:UJQbtN1jIcI5CYNocTj0fuAUYvsLjPoYi0YuhqV/Y48=
|
||||
github.com/panjf2000/ants/v2 v2.11.4/go.mod h1:8u92CYMUc6gyvTIw8Ru7Mt7+/ESnJahz5EVtqfrilek=
|
||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/quic-go/quic-go v0.58.0 h1:ggY2pvZaVdB9EyojxL1p+5mptkuHyX5MOSv4dgWF4Ug=
|
||||
github.com/quic-go/quic-go v0.58.0/go.mod h1:upnsH4Ju1YkqpLXC305eW3yDZ4NfnNbmQRCMWS58IKU=
|
||||
github.com/quic-go/quic-go v0.59.0 h1:OLJkp1Mlm/aS7dpKgTc6cnpynnD2Xg7C1pwL6vy/SAw=
|
||||
github.com/quic-go/quic-go v0.59.0/go.mod h1:upnsH4Ju1YkqpLXC305eW3yDZ4NfnNbmQRCMWS58IKU=
|
||||
github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
|
||||
github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k=
|
||||
github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME=
|
||||
github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091 h1:RN5mrigyirb8anBEtdjtHFIufXdacyTi6i4KBfeNXeo=
|
||||
github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091/go.mod h1:VlduQ80JcGJSargkRU4Sg9Xo63wZD/l8A5NC/Uo1/uU=
|
||||
github.com/streamingfast/logging v0.0.0-20260108192805-38f96de0a641 h1:dI+b2TyFS0rJw1xVGzxBBvn/RrSgBpqM/RjwDInxEfo=
|
||||
github.com/streamingfast/logging v0.0.0-20260108192805-38f96de0a641/go.mod h1:fJ5nP7ZSMB4MQQ6RM7cF+LiSQ43b5cVletcSUNL8z2M=
|
||||
@@ -110,109 +86,74 @@ github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu
|
||||
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
|
||||
github.com/test-go/testify v1.1.4 h1:Tf9lntrKUMHiXQ07qBScBTSA0dhYQlu83hswqelv1iE=
|
||||
github.com/test-go/testify v1.1.4/go.mod h1:rH7cfJo/47vWGdi4GPj16x3/t1xGOj2YxzmNQzk2ghU=
|
||||
github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
|
||||
github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4=
|
||||
github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM=
|
||||
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA=
|
||||
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
go.mongodb.org/mongo-driver v1.12.2 h1:gbWY1bJkkmUB9jjZzcdhOL8O85N9H+Vvsf2yFN0RDws=
|
||||
go.mongodb.org/mongo-driver v1.12.2/go.mod h1:/rGBTebI3XYboVmgz+Wv3Bcbl3aD0QF9zl6kDDw18rQ=
|
||||
go.mongodb.org/mongo-driver v1.17.7 h1:a9w+U3Vt67eYzcfq3k/OAv284/uUUkL0uP75VE5rCOU=
|
||||
go.mongodb.org/mongo-driver v1.17.7/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ=
|
||||
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
|
||||
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
|
||||
go.opentelemetry.io/otel v1.37.0 h1:9zhNfelUvx0KBfu/gb+ZgeAfAgtWrfHJZcAqFC228wQ=
|
||||
go.opentelemetry.io/otel v1.37.0/go.mod h1:ehE/umFRLnuLa/vSccNq9oS1ErUlkkK71gMcN34UG8I=
|
||||
go.opentelemetry.io/otel/metric v1.37.0 h1:mvwbQS5m0tbmqML4NqK+e3aDiO02vsf/WgbsdpcPoZE=
|
||||
go.opentelemetry.io/otel/metric v1.37.0/go.mod h1:04wGrZurHYKOc+RKeye86GwKiTb9FKm1WHtO+4EVr2E=
|
||||
go.opentelemetry.io/otel/sdk v1.37.0 h1:ItB0QUqnjesGRvNcmAcU0LyvkVyGJ2xftD29bWdDvKI=
|
||||
go.opentelemetry.io/otel/sdk v1.37.0/go.mod h1:VredYzxUvuo2q3WRcDnKDjbdvmO0sCzOvVAiY+yUkAg=
|
||||
go.opentelemetry.io/otel/sdk/metric v1.37.0 h1:90lI228XrB9jCMuSdA0673aubgRobVZFhbjxHHspCPc=
|
||||
go.opentelemetry.io/otel/sdk/metric v1.37.0/go.mod h1:cNen4ZWfiD37l5NhS+Keb5RXVWZWpRE+9WyVCpbo5ps=
|
||||
go.opentelemetry.io/otel/trace v1.37.0 h1:HLdcFNbRQBE2imdSEgm/kwqmQj1Or1l/7bW6mxVK7z4=
|
||||
go.opentelemetry.io/otel/trace v1.37.0/go.mod h1:TlgrlQ+PtQO5XFerSPUYG0JSgGyryXewPGyayAWSBS0=
|
||||
go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=
|
||||
go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=
|
||||
go.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8=
|
||||
go.opentelemetry.io/otel v1.38.0/go.mod h1:zcmtmQ1+YmQM9wrNsTGV/q/uyusom3P8RxwExxkZhjM=
|
||||
go.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA=
|
||||
go.opentelemetry.io/otel/metric v1.38.0/go.mod h1:kB5n/QoRM8YwmUahxvI3bO34eVtQf2i4utNVLr9gEmI=
|
||||
go.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E=
|
||||
go.opentelemetry.io/otel/sdk v1.38.0/go.mod h1:ghmNdGlVemJI3+ZB5iDEuk4bWA3GkTpW+DOoZMYBVVg=
|
||||
go.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM=
|
||||
go.opentelemetry.io/otel/sdk/metric v1.38.0/go.mod h1:dg9PBnW9XdQ1Hd6ZnRz689CbtrUp0wMMs9iPcgT9EZA=
|
||||
go.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE=
|
||||
go.opentelemetry.io/otel/trace v1.38.0/go.mod h1:j1P9ivuFsTceSWe1oY+EeW3sc+Pp42sO++GHkg4wwhs=
|
||||
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
|
||||
go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw=
|
||||
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
|
||||
go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=
|
||||
go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
|
||||
go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI=
|
||||
go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
|
||||
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
||||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||
go.uber.org/mock v0.5.2 h1:LbtPTcP8A5k9WPXj54PPPbjcI4Y6lhyOZXn+VS7wNko=
|
||||
go.uber.org/mock v0.5.2/go.mod h1:wLlUxC2vVTPTaE3UD51E0BGOAElKrILxhVSDYQLld5o=
|
||||
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
|
||||
go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4=
|
||||
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
|
||||
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
|
||||
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
|
||||
go.uber.org/ratelimit v0.2.0 h1:UQE2Bgi7p2B85uP5dC2bbRtig0C+OeNRnNEafLjsLPA=
|
||||
go.uber.org/ratelimit v0.2.0/go.mod h1:YYBV4e4naJvhpitQrWJu1vCpgB7CboMe0qhltKt6mUg=
|
||||
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
|
||||
go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8=
|
||||
go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw=
|
||||
go.uber.org/zap v1.27.1 h1:08RqriUEv8+ArZRYSTXy1LeBScaMpVSTBhCeaZYfMYc=
|
||||
go.uber.org/zap v1.27.1/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.44.0 h1:A97SsFvM3AIwEEmTBiaxPPTYpDC47w720rdiiUvgoAU=
|
||||
golang.org/x/crypto v0.44.0/go.mod h1:013i+Nw79BMiQiMsOPcVCB5ZIJbYkerPrGnOa00tvmc=
|
||||
golang.org/x/crypto v0.47.0 h1:V6e3FRj+n4dbpw86FJ8Fv7XVOql7TEwpHapKoMJ/GO8=
|
||||
golang.org/x/crypto v0.47.0/go.mod h1:ff3Y9VzzKbwSSEzWqJsJVBnWmRwRSHt/6Op5n9bQc4A=
|
||||
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
|
||||
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY=
|
||||
golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU=
|
||||
golang.org/x/net v0.49.0 h1:eeHFmOGUTtaaPSGNmjBKpbng9MulQsJURQUAfUwY++o=
|
||||
golang.org/x/net v0.49.0/go.mod h1:/ysNB2EvaqvesRkuLAyjI1ycPZlQHM3q01F02UY/MV8=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.18.0 h1:kr88TuHDroi+UVf+0hZnirlk8o8T+4MrK6mr60WkH/I=
|
||||
golang.org/x/sync v0.18.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
|
||||
golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4=
|
||||
golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc=
|
||||
golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
||||
golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ=
|
||||
golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.37.0 h1:8EGAD0qCmHYZg6J17DvsMy9/wJ7/D/4pV/wfnld5lTU=
|
||||
golang.org/x/term v0.37.0/go.mod h1:5pB4lxRNYYVZuTLmy8oR2BH8dflOR+IbTYFD8fi3254=
|
||||
golang.org/x/term v0.39.0 h1:RclSuaJf32jOqZz74CkPA9qFuVTX7vhLlpfj/IGWlqY=
|
||||
golang.org/x/term v0.39.0/go.mod h1:yxzUCTP/U+FzoxfdKmLaA0RV1WgE0VY7hXBwKtY/4ww=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
|
||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM=
|
||||
golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM=
|
||||
golang.org/x/text v0.33.0 h1:B3njUFyqtHDUI5jMn1YIr5B0IE2U0qck04r6d4KPAxE=
|
||||
golang.org/x/text v0.33.0/go.mod h1:LuMebE6+rBincTi9+xWTY8TztLzKHc/9C1uBCG27+q8=
|
||||
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs=
|
||||
@@ -221,24 +162,16 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm
|
||||
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=
|
||||
gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20251029180050-ab9386a59fda h1:i/Q+bfisr7gq6feoJnS/DlpdwEL4ihp41fvRiM3Ork0=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20251029180050-ab9386a59fda/go.mod h1:7i2o+ce6H/6BluujYR+kqX3GKH+dChPTQU19wjRPiGk=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20260128011058-8636f8732409 h1:H86B94AW+VfJWDqFeEbBPhEtHzJwJfTbgE2lZa54ZAQ=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20260128011058-8636f8732409/go.mod h1:j9x/tPzZkyxcgEFkiKEEGxfvyumM01BEtsW8xzOahRQ=
|
||||
google.golang.org/grpc v1.75.0 h1:+TW+dqTd2Biwe6KKfhE5JpiYIBWq865PhKGSXiivqt4=
|
||||
google.golang.org/grpc v1.75.0/go.mod h1:JtPAzKiq4v1xcAB2hydNlWI2RnF85XXcV0mhKXr2ecQ=
|
||||
google.golang.org/grpc v1.78.0 h1:K1XZG/yGDJnzMdd/uZHAkVqJE+xIDOcmdSFZkBUicNc=
|
||||
google.golang.org/grpc v1.78.0/go.mod h1:I47qjTo4OKbMkjA/aOOwxDIiPSBofUtQUI5EfpWvW7U=
|
||||
google.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=
|
||||
google.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
|
||||
google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=
|
||||
google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package consts
|
||||
|
||||
import "github.com/samlior/libsam/pkg/enum"
|
||||
import "github.com/samlior/libsam/v2/pkg/enum"
|
||||
|
||||
var SWQoSFeeAddresses = map[string]string{
|
||||
"96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5": enum.SWQoSAgentJito,
|
||||
|
||||
@@ -8,6 +8,7 @@ import (
|
||||
"runtime"
|
||||
"time"
|
||||
|
||||
"github.com/gagliardetto/solana-go"
|
||||
"github.com/gagliardetto/solana-go/rpc"
|
||||
"github.com/panjf2000/ants/v2"
|
||||
"google.golang.org/grpc"
|
||||
@@ -23,6 +24,10 @@ type Client struct {
|
||||
tableLoader *AddressTables
|
||||
subscription map[string]*SubscribeRequestFilterTransactions
|
||||
|
||||
entriesFilter map[string]FilterParams
|
||||
|
||||
parser map[solana.PublicKey]Handler
|
||||
|
||||
pool *ants.Pool
|
||||
|
||||
lastSlot uint64
|
||||
@@ -33,6 +38,8 @@ type ClientOpts struct {
|
||||
blockStats bool
|
||||
showTableLoaded bool
|
||||
logParseStats bool
|
||||
|
||||
parser map[solana.PublicKey]Handler
|
||||
}
|
||||
|
||||
type ClientOption func(*ClientOpts)
|
||||
@@ -43,6 +50,12 @@ func ShowTableLoaded(enable bool) ClientOption {
|
||||
}
|
||||
}
|
||||
|
||||
func WithCustomParsers(parsers map[solana.PublicKey]Handler) ClientOption {
|
||||
return func(opts *ClientOpts) {
|
||||
opts.parser = parsers
|
||||
}
|
||||
}
|
||||
|
||||
func BlocksStats(enable bool) ClientOption {
|
||||
return func(opts *ClientOpts) {
|
||||
opts.blockStats = enable
|
||||
@@ -82,14 +95,31 @@ func NewShrederClient(
|
||||
blockStats: false,
|
||||
showTableLoaded: true,
|
||||
logParseStats: false,
|
||||
parser: registered,
|
||||
}
|
||||
for _, option := range options {
|
||||
option(o)
|
||||
}
|
||||
filterParams := make(map[string]FilterParams)
|
||||
for name, params := range subscription {
|
||||
filterParams[name] = FilterParams{
|
||||
Exclude: parseAccountArray(params.AccountExclude),
|
||||
Require: parseAccountArray(params.AccountRequired),
|
||||
Include: parseAccountArray(params.AccountInclude),
|
||||
}
|
||||
}
|
||||
if len(filterParams) == 0 {
|
||||
filterParams["default"] = FilterParams{
|
||||
Include: defaultFilterAccount,
|
||||
}
|
||||
}
|
||||
|
||||
s := &Client{
|
||||
conn: conn,
|
||||
client: NewShrederServiceClient(conn),
|
||||
subscription: subscription,
|
||||
entriesFilter: filterParams,
|
||||
parser: o.parser,
|
||||
tableLoader: NewAddressTables(rpcClient, o.showTableLoaded),
|
||||
pool: pool,
|
||||
|
||||
@@ -142,7 +172,16 @@ func (c *Client) ReadEntriesSync(ctx context.Context, txCh chan<- TxSignal) erro
|
||||
}
|
||||
|
||||
err = c.pool.Submit(func() {
|
||||
ParseTransactionForEntries(ctx, slot, bytes.NewReader(response.Entries), c.tableLoader, txCh)
|
||||
err := entriesToVersionedTransaction(slot, bytes.NewReader(response.Entries), func(versioned VersionedTransaction) {
|
||||
// filter out vote transactions
|
||||
if FilterTransactionForEntriesWithFilter(versioned, c.entriesFilter) {
|
||||
return
|
||||
}
|
||||
go ParseTransactionWithHandler(ctx, versioned, c.tableLoader, txCh, c.parser)
|
||||
})
|
||||
if err != nil {
|
||||
logger.Debug("txparser: failed to parse entries", "error", err)
|
||||
}
|
||||
})
|
||||
if err != nil && errors.Is(err, ants.ErrPoolOverload) {
|
||||
logger.Warn("task pool is full")
|
||||
@@ -187,10 +226,15 @@ func (c *Client) ReadSync(ctx context.Context, txCh chan<- TxSignal) error {
|
||||
}
|
||||
}
|
||||
|
||||
txData := response.Transaction
|
||||
// txData := response.Transaction
|
||||
|
||||
err := c.pool.Submit(func() {
|
||||
ParseTransactionForSubscribe(ctx, txData, c.tableLoader, txCh, nil)
|
||||
versioned, err := toVersionedTransaction(response.Transaction)
|
||||
if err != nil {
|
||||
logger.Debug("txparser: failed to convert to versioned transaction", "error", err)
|
||||
return
|
||||
}
|
||||
ParseTransactionWithHandler(ctx, versioned, c.tableLoader, txCh, c.parser)
|
||||
})
|
||||
if err != nil && errors.Is(err, ants.ErrPoolOverload) {
|
||||
logger.Warn("task pool is full")
|
||||
@@ -202,3 +246,11 @@ func (c *Client) ReadSync(ctx context.Context, txCh chan<- TxSignal) error {
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
func parseAccountArray(accountArray []string) []solana.PublicKey {
|
||||
var result []solana.PublicKey
|
||||
for _, acc := range accountArray {
|
||||
result = append(result, solana.MustPublicKeyFromBase58(acc))
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
118
pkg/shreder/program_binancewallet.go
Normal file
118
pkg/shreder/program_binancewallet.go
Normal file
@@ -0,0 +1,118 @@
|
||||
package shreder
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
|
||||
"github.com/gagliardetto/solana-go"
|
||||
)
|
||||
|
||||
var binanceWalletProgramID = solana.MustPublicKeyFromBase58("B3111yJCeHBcA1bizdJjUFPALfhAfSRnAbJzGUtnt56A")
|
||||
|
||||
const (
|
||||
binanceWalletMinDataLen = 72
|
||||
binanceWalletSolOffset = 23
|
||||
binanceWalletTokenOff = 39
|
||||
binanceWalletSolRepeat = 51
|
||||
binanceWalletSideOff = 71
|
||||
|
||||
binanceWalletPumpBuy = 0x05
|
||||
binanceWalletPumpSell = 0x06
|
||||
)
|
||||
|
||||
var binanceWalletMarker = []byte{0x13, 0x2c, 0x82, 0x94, 0x48, 0x38, 0x2c, 0xee}
|
||||
|
||||
func parseBinanceWalletInstruction(tx VersionedTransaction, instructionIndex int) (TxSignalBatch, error) {
|
||||
if instructionIndex >= len(tx.Instructions) {
|
||||
return nil, fmt.Errorf("instruction index out of bounds")
|
||||
}
|
||||
|
||||
instruction := tx.Instructions[instructionIndex]
|
||||
if len(instruction.Data) < len(binanceWalletMarker) || !bytes.Contains(instruction.Data, binanceWalletMarker) {
|
||||
return nil, nil
|
||||
}
|
||||
if len(instruction.Data) < binanceWalletMinDataLen {
|
||||
return nil, fmt.Errorf("data too short for binance wallet, len=%d", len(instruction.Data))
|
||||
}
|
||||
|
||||
side := instruction.Data[binanceWalletSideOff]
|
||||
if side != binanceWalletPumpBuy && side != binanceWalletPumpSell {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
if len(instruction.Accounts) <= 8 {
|
||||
return nil, fmt.Errorf("accounts too short")
|
||||
}
|
||||
|
||||
wsolIdx := 7
|
||||
tokenIdx := 8
|
||||
if side == binanceWalletPumpSell {
|
||||
wsolIdx = 8
|
||||
tokenIdx = 7
|
||||
}
|
||||
|
||||
wsolKey, err := tx.GetAccount(int(instruction.Accounts[wsolIdx]))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !wsolKey.Equals(solana.WrappedSol) {
|
||||
return nil, nil
|
||||
}
|
||||
mint, err := tx.GetAccount(int(instruction.Accounts[tokenIdx]))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
amountA := binary.LittleEndian.Uint64(instruction.Data[binanceWalletSolOffset : binanceWalletSolOffset+8])
|
||||
if amountA == 0 && len(instruction.Data) >= binanceWalletSolRepeat+8 {
|
||||
repeat := binary.LittleEndian.Uint64(instruction.Data[binanceWalletSolRepeat : binanceWalletSolRepeat+8])
|
||||
if repeat > 0 {
|
||||
amountA = repeat
|
||||
}
|
||||
}
|
||||
amountB := binary.LittleEndian.Uint64(instruction.Data[binanceWalletTokenOff : binanceWalletTokenOff+8])
|
||||
|
||||
solAmount := amountA
|
||||
tokenAmount := amountB
|
||||
if side == binanceWalletPumpSell {
|
||||
solAmount = amountB
|
||||
tokenAmount = amountA
|
||||
}
|
||||
|
||||
maker := ""
|
||||
if len(tx.StaticAccountKeys) > 0 {
|
||||
maker = tx.StaticAccountKeys[0].String()
|
||||
} else if len(instruction.Accounts) > 0 {
|
||||
key, err := tx.GetAccount(int(instruction.Accounts[0]))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
maker = key.String()
|
||||
}
|
||||
|
||||
event := "buy"
|
||||
exactIn := true
|
||||
if side == binanceWalletPumpSell {
|
||||
event = "sell"
|
||||
exactIn = false
|
||||
}
|
||||
|
||||
return TxSignalBatch{&TxSignal{
|
||||
TxHash: tx.Signatures[0].String(),
|
||||
Label: "binancewallet",
|
||||
Maker: maker,
|
||||
Token0Address: mint.String(),
|
||||
Token1Address: wsolMint,
|
||||
Token0Amount: formatTokenAmount(tokenAmount),
|
||||
Token1Amount: formatSolAmount(solAmount),
|
||||
Program: "Pump",
|
||||
Event: event,
|
||||
IsToken2022: false,
|
||||
IsMayhemMode: false,
|
||||
ExactSOL: exactIn,
|
||||
Block: tx.Block,
|
||||
Token0AmountUint64: tokenAmount,
|
||||
Token1AmountUint64: solAmount,
|
||||
}}, nil
|
||||
}
|
||||
134
pkg/shreder/program_dbot.go
Normal file
134
pkg/shreder/program_dbot.go
Normal file
@@ -0,0 +1,134 @@
|
||||
package shreder
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
|
||||
"github.com/gagliardetto/solana-go"
|
||||
"github.com/shopspring/decimal"
|
||||
)
|
||||
|
||||
var dbotProgramID = solana.MustPublicKeyFromBase58("DBotWvSso9oD1ZB3aHx2LiD2ZoFpF8PbKjaT4uHKLLVs")
|
||||
|
||||
var (
|
||||
dbotPumpFunBuyIX = []byte{0x4e, 0x13, 0x6d, 0x72, 0x3d, 0x72, 0xbe, 0x9d}
|
||||
dbotPumpAmmBuyIX = []byte{0x99, 0x76, 0xb6, 0x1e, 0xe4, 0x03, 0xdc, 0xf4}
|
||||
)
|
||||
|
||||
func parseDbotInstruction(tx VersionedTransaction, instructionIndex int) (TxSignalBatch, error) {
|
||||
if instructionIndex >= len(tx.Instructions) {
|
||||
return nil, fmt.Errorf("instruction index out of bounds")
|
||||
}
|
||||
ix := tx.Instructions[instructionIndex]
|
||||
if len(ix.Data) < 8 {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
isPumpFun := false
|
||||
isPumpAmm := false
|
||||
|
||||
if len(ix.Accounts) > 11 {
|
||||
key, err := tx.GetAccount(int(ix.Accounts[11]))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if key.Equals(pumpProgramID) {
|
||||
isPumpFun = true
|
||||
}
|
||||
}
|
||||
|
||||
if len(ix.Accounts) > 16 {
|
||||
key, err := tx.GetAccount(int(ix.Accounts[16]))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if key.Equals(pumpAmmProgramID) {
|
||||
isPumpAmm = true
|
||||
}
|
||||
}
|
||||
|
||||
disc := ix.Data[:8]
|
||||
|
||||
if isPumpFun {
|
||||
if !bytes.Equal(disc, dbotPumpFunBuyIX) {
|
||||
return nil, nil
|
||||
}
|
||||
if len(ix.Data) < 16 {
|
||||
return nil, fmt.Errorf("data too short for dbot pumpfun buy args, len=%d", len(ix.Data))
|
||||
}
|
||||
if len(ix.Accounts) < 3 {
|
||||
return nil, fmt.Errorf("accounts too short")
|
||||
}
|
||||
|
||||
mint, err := tx.GetAccount(int(ix.Accounts[2]))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
solAmount := binary.LittleEndian.Uint64(ix.Data[8:16])
|
||||
|
||||
return TxSignalBatch{&TxSignal{
|
||||
TxHash: tx.Signatures[0].String(),
|
||||
Label: "dbot",
|
||||
Maker: tx.StaticAccountKeys[0].String(),
|
||||
Token0Address: mint.String(),
|
||||
Token1Address: wsolMint,
|
||||
Token0Amount: decimal.Zero,
|
||||
Token1Amount: formatSolAmount(solAmount),
|
||||
Program: "Pump",
|
||||
Event: "buy",
|
||||
ExactSOL: true,
|
||||
IsToken2022: false,
|
||||
IsMayhemMode: false,
|
||||
Block: tx.Block,
|
||||
Token0AmountUint64: 0,
|
||||
Token1AmountUint64: solAmount,
|
||||
}}, nil
|
||||
}
|
||||
|
||||
if isPumpAmm {
|
||||
if !bytes.Equal(disc, dbotPumpAmmBuyIX) {
|
||||
return nil, nil
|
||||
}
|
||||
if len(ix.Data) < 16 {
|
||||
return nil, fmt.Errorf("data too short for dbot pumpamm buy args, len=%d", len(ix.Data))
|
||||
}
|
||||
if len(ix.Accounts) < 5 {
|
||||
return nil, fmt.Errorf("accounts too short")
|
||||
}
|
||||
|
||||
base, err := tx.GetAccount(int(ix.Accounts[3]))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
quote, err := tx.GetAccount(int(ix.Accounts[4]))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !quote.Equals(solana.WrappedSol) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
solAmount := binary.LittleEndian.Uint64(ix.Data[8:16])
|
||||
|
||||
return TxSignalBatch{&TxSignal{
|
||||
TxHash: tx.Signatures[0].String(),
|
||||
Label: "dbot",
|
||||
Maker: tx.StaticAccountKeys[0].String(),
|
||||
Token0Address: base.String(),
|
||||
Token1Address: wsolMint,
|
||||
Token0Amount: decimal.Zero,
|
||||
Token1Amount: formatSolAmount(solAmount),
|
||||
Program: "PumpAMM",
|
||||
Event: "buy",
|
||||
ExactSOL: true,
|
||||
IsToken2022: false,
|
||||
IsMayhemMode: false,
|
||||
Block: tx.Block,
|
||||
Token0AmountUint64: 0,
|
||||
Token1AmountUint64: solAmount,
|
||||
}}, nil
|
||||
}
|
||||
|
||||
return nil, nil
|
||||
}
|
||||
@@ -291,69 +291,189 @@ func parseOkxDexRouteV2Instruction(tx VersionedTransaction, instructionIndex int
|
||||
return nil, fmt.Errorf("invalid account count: %d", len(ix.Accounts))
|
||||
}
|
||||
var (
|
||||
inputAmount uint64
|
||||
routeCount int
|
||||
pumpAmmSellAmount uint64
|
||||
pumpAmmBuyAmount uint64
|
||||
pumpFunSellAmount uint64
|
||||
pumpFunBuyAmount uint64
|
||||
pumpAmmSellCount int
|
||||
pumpAmmBuyCount int
|
||||
pumpFunSellCount int
|
||||
pumpFunBuyCount int
|
||||
)
|
||||
for _, route := range args.Routes {
|
||||
if route.Index == 1 && (route.Dex == OKCV2_PumpfunammSell ||
|
||||
route.Dex == OKCV2_PumpfunSell2) {
|
||||
routeCount++
|
||||
inputAmount = args.AmountIn * uint64(route.Weight) / 10000
|
||||
if route.Index != 1 {
|
||||
continue
|
||||
}
|
||||
switch route.Dex {
|
||||
case OKCV2_PumpfunammSell:
|
||||
pumpAmmSellCount++
|
||||
pumpAmmSellAmount = args.AmountIn * uint64(route.Weight) / 10000
|
||||
case OKCV2_PumpfunammBuy:
|
||||
pumpAmmBuyCount++
|
||||
pumpAmmBuyAmount = args.AmountIn * uint64(route.Weight) / 10000
|
||||
case OKCV2_PumpfunSell2:
|
||||
pumpFunSellCount++
|
||||
pumpFunSellAmount = args.AmountIn * uint64(route.Weight) / 10000
|
||||
case OKCV2_PumpfunBuy2:
|
||||
pumpFunBuyCount++
|
||||
pumpFunBuyAmount = args.AmountIn * uint64(route.Weight) / 10000
|
||||
}
|
||||
}
|
||||
if routeCount > 1 {
|
||||
logger.Warn("pumpSwapSell at inputIdx=0: multiple instances found", "tx", tx.Signatures[0].String(), "routeCount", routeCount)
|
||||
if pumpAmmSellCount > 1 {
|
||||
logger.Warn("pumpAmmSwapSell at inputIdx=0: multiple instances found", "tx", tx.Signatures[0].String(), "routeCount", pumpAmmSellCount)
|
||||
return nil, nil
|
||||
}
|
||||
if inputAmount == 0 {
|
||||
if pumpAmmBuyCount > 1 {
|
||||
logger.Warn("pumpAmmSwapBuy at inputIdx=0: multiple instances found", "tx", tx.Signatures[0].String(), "routeCount", pumpAmmBuyCount)
|
||||
return nil, nil
|
||||
}
|
||||
if pumpFunSellCount > 1 {
|
||||
logger.Warn("pumpFunSwapSell at inputIdx=0: multiple instances found", "tx", tx.Signatures[0].String(), "routeCount", pumpFunSellCount)
|
||||
return nil, nil
|
||||
}
|
||||
if pumpFunBuyCount > 1 {
|
||||
logger.Warn("pumpFunSwapBuy at inputIdx=0: multiple instances found", "tx", tx.Signatures[0].String(), "routeCount", pumpFunBuyCount)
|
||||
return nil, nil
|
||||
}
|
||||
if pumpAmmSellAmount == 0 && pumpAmmBuyAmount == 0 && pumpFunSellAmount == 0 && pumpFunBuyAmount == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
srcMint, err := tx.GetAccount(int(ix.Accounts[3]))
|
||||
out := make(TxSignalBatch, 0, 2)
|
||||
|
||||
var (
|
||||
srcIdx uint8
|
||||
)
|
||||
if pumpFunBuyAmount > 0 || pumpFunSellAmount > 0 {
|
||||
if pumpFunBuyAmount > 0 {
|
||||
if len(ix.Accounts) < 5 {
|
||||
return nil, fmt.Errorf("invalid account count: %d", len(ix.Accounts))
|
||||
}
|
||||
baseMint, err := tx.GetAccount(int(ix.Accounts[4]))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
out = append(out, &TxSignal{
|
||||
TxHash: tx.Signatures[0].String(),
|
||||
Maker: tx.StaticAccountKeys[0].String(),
|
||||
Token0Address: baseMint.String(),
|
||||
Token1Address: wsolMint,
|
||||
Token0Amount: decimal.Zero,
|
||||
Token1Amount: formatSolAmount(pumpFunBuyAmount),
|
||||
Event: "buy",
|
||||
Program: "Pump",
|
||||
IsProcessed: false,
|
||||
IsToken2022: false,
|
||||
IsMayhemMode: false,
|
||||
ExactSOL: true,
|
||||
Token0AmountUint64: 0,
|
||||
Token1AmountUint64: pumpFunBuyAmount,
|
||||
})
|
||||
}
|
||||
if pumpFunSellAmount > 0 {
|
||||
if len(ix.Accounts) < 4 {
|
||||
return nil, fmt.Errorf("invalid account count: %d", len(ix.Accounts))
|
||||
}
|
||||
baseMint, err := tx.GetAccount(int(ix.Accounts[3]))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
out = append(out, &TxSignal{
|
||||
TxHash: tx.Signatures[0].String(),
|
||||
Maker: tx.StaticAccountKeys[0].String(),
|
||||
Token0Address: baseMint.String(),
|
||||
Token1Address: wsolMint,
|
||||
Token0Amount: formatTokenAmount(pumpFunSellAmount),
|
||||
Token1Amount: decimal.Zero,
|
||||
Event: "sell",
|
||||
Program: "Pump",
|
||||
IsProcessed: false,
|
||||
IsToken2022: false,
|
||||
IsMayhemMode: false,
|
||||
ExactSOL: false,
|
||||
Token0AmountUint64: pumpFunSellAmount,
|
||||
Token1AmountUint64: 0,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
if pumpAmmBuyAmount > 0 || pumpAmmSellAmount > 0 {
|
||||
if len(ix.Accounts) <= 15 {
|
||||
if len(out) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
accounts := ix.Accounts[14:]
|
||||
var pumpAmmIdx uint8
|
||||
for i, acctIdx := range accounts {
|
||||
key, err := tx.GetAccount(int(acctIdx))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if key.Equals(pumpAmmProgramID) {
|
||||
srcIdx = uint8(i + 6)
|
||||
pumpAmmIdx = uint8(i + 6)
|
||||
break
|
||||
}
|
||||
}
|
||||
if srcIdx == 0 || int(srcIdx+1) >= len(accounts) {
|
||||
if pumpAmmIdx == 0 || int(pumpAmmIdx+1) >= len(accounts) {
|
||||
if len(out) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
baseMint, err := tx.GetAccount(int(accounts[srcIdx]))
|
||||
return out, nil
|
||||
}
|
||||
baseMint, err := tx.GetAccount(int(accounts[pumpAmmIdx]))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !baseMint.Equals(srcMint) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
quoteMint, err := tx.GetAccount(int(accounts[srcIdx+1]))
|
||||
quoteMint, err := tx.GetAccount(int(accounts[pumpAmmIdx+1]))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !quoteMint.Equals(solana.WrappedSol) {
|
||||
if len(out) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
return TxSignalBatch{&TxSignal{
|
||||
return out, nil
|
||||
}
|
||||
if pumpAmmBuyAmount > 0 {
|
||||
if len(ix.Accounts) < 5 {
|
||||
return nil, fmt.Errorf("invalid account count: %d", len(ix.Accounts))
|
||||
}
|
||||
srcMint, err := tx.GetAccount(int(ix.Accounts[4]))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if baseMint.Equals(srcMint) {
|
||||
out = append(out, &TxSignal{
|
||||
TxHash: tx.Signatures[0].String(),
|
||||
Maker: tx.StaticAccountKeys[0].String(),
|
||||
Token0Address: baseMint.String(),
|
||||
Token1Address: wsolMint,
|
||||
Token0Amount: formatTokenAmount(inputAmount),
|
||||
Token0Amount: decimal.Zero,
|
||||
Token1Amount: formatSolAmount(pumpAmmBuyAmount),
|
||||
Event: "buy",
|
||||
Program: "PumpAMM",
|
||||
IsProcessed: false,
|
||||
IsToken2022: false,
|
||||
IsMayhemMode: false,
|
||||
ExactSOL: true,
|
||||
Token0AmountUint64: 0,
|
||||
Token1AmountUint64: pumpAmmBuyAmount,
|
||||
})
|
||||
}
|
||||
} else if pumpAmmSellAmount > 0 {
|
||||
if len(ix.Accounts) < 4 {
|
||||
return nil, fmt.Errorf("invalid account count: %d", len(ix.Accounts))
|
||||
}
|
||||
srcMint, err := tx.GetAccount(int(ix.Accounts[3]))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if baseMint.Equals(srcMint) {
|
||||
out = append(out, &TxSignal{
|
||||
TxHash: tx.Signatures[0].String(),
|
||||
Maker: tx.StaticAccountKeys[0].String(),
|
||||
Token0Address: baseMint.String(),
|
||||
Token1Address: wsolMint,
|
||||
Token0Amount: formatTokenAmount(pumpAmmSellAmount),
|
||||
Token1Amount: decimal.Zero,
|
||||
Event: "sell",
|
||||
Program: "PumpAMM",
|
||||
@@ -361,7 +481,15 @@ func parseOkxDexRouteV2Instruction(tx VersionedTransaction, instructionIndex int
|
||||
IsToken2022: false,
|
||||
IsMayhemMode: false,
|
||||
ExactSOL: false,
|
||||
Token0AmountUint64: inputAmount,
|
||||
Token0AmountUint64: pumpAmmSellAmount,
|
||||
Token1AmountUint64: 0,
|
||||
}}, nil
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(out) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
50
pkg/shreder/program_tradewiz.go
Normal file
50
pkg/shreder/program_tradewiz.go
Normal file
@@ -0,0 +1,50 @@
|
||||
package shreder
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
|
||||
"github.com/gagliardetto/solana-go"
|
||||
"github.com/shopspring/decimal"
|
||||
)
|
||||
|
||||
var tradewizProgramID = solana.MustPublicKeyFromBase58("B3jytJa6Tzpn4Ly7GNnDm3dMGqUin5aMRm5aPsJGU5G7")
|
||||
|
||||
func parseTradewizInstruction(tx VersionedTransaction, instructionIndex int) (TxSignalBatch, error) {
|
||||
if instructionIndex >= len(tx.Instructions) {
|
||||
return nil, fmt.Errorf("instruction index out of bounds")
|
||||
}
|
||||
ix := tx.Instructions[instructionIndex]
|
||||
if len(ix.Data) < 9 {
|
||||
return nil, fmt.Errorf("data too short for tradewiz buy args, len=%d", len(ix.Data))
|
||||
}
|
||||
if len(ix.Accounts) < 3 {
|
||||
return nil, fmt.Errorf("accounts too short")
|
||||
}
|
||||
|
||||
// data format: 0x00 + u64(wsol amount) + u64(...)
|
||||
wsolAmount := binary.LittleEndian.Uint64(ix.Data[1:9])
|
||||
|
||||
mint, err := tx.GetAccount(int(ix.Accounts[2]))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return TxSignalBatch{&TxSignal{
|
||||
TxHash: tx.Signatures[0].String(),
|
||||
Label: "tradewiz",
|
||||
Maker: tx.StaticAccountKeys[0].String(),
|
||||
Token0Address: mint.String(),
|
||||
Token1Address: wsolMint,
|
||||
Token0Amount: decimal.Zero,
|
||||
Token1Amount: formatSolAmount(wsolAmount),
|
||||
Program: "Pump",
|
||||
Event: "buy",
|
||||
IsToken2022: false,
|
||||
IsMayhemMode: false,
|
||||
ExactSOL: true,
|
||||
Block: tx.Block,
|
||||
Token0AmountUint64: 0,
|
||||
Token1AmountUint64: wsolAmount,
|
||||
}}, nil
|
||||
}
|
||||
@@ -28,32 +28,39 @@ type FillAccount interface {
|
||||
}
|
||||
|
||||
func init() {
|
||||
for account := range parsedMap {
|
||||
parseProgram = append(parseProgram, account)
|
||||
for account := range registered {
|
||||
defaultFilterAccount = append(defaultFilterAccount, account)
|
||||
}
|
||||
//"GS4CU59F31iL7aR2Q8zVS8DRrcRnXX1yjQ66TqNVQnaR", //Event Authority
|
||||
//"5PHirr8joyTMp9JMm6nW7hNDVyEYdkzDqazxPD7RaTjx", // Fee Config
|
||||
//"pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ", // pump fee program
|
||||
parseProgram = append(parseProgram,
|
||||
defaultFilterAccount = append(defaultFilterAccount,
|
||||
solana.MustPublicKeyFromBase58("GS4CU59F31iL7aR2Q8zVS8DRrcRnXX1yjQ66TqNVQnaR"),
|
||||
solana.MustPublicKeyFromBase58("5PHirr8joyTMp9JMm6nW7hNDVyEYdkzDqazxPD7RaTjx"),
|
||||
solana.MustPublicKeyFromBase58("pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ"),
|
||||
)
|
||||
slices.SortFunc(parseProgram, func(a, b solana.PublicKey) int {
|
||||
slices.SortFunc(defaultFilterAccount, func(a, b solana.PublicKey) int {
|
||||
return bytes.Compare(a[:], b[:])
|
||||
})
|
||||
}
|
||||
|
||||
var (
|
||||
parseProgram []solana.PublicKey
|
||||
type FilterParams struct {
|
||||
Require []solana.PublicKey
|
||||
Include []solana.PublicKey
|
||||
Exclude []solana.PublicKey
|
||||
}
|
||||
|
||||
parsedMap = map[solana.PublicKey]Handler{
|
||||
var (
|
||||
defaultFilterAccount []solana.PublicKey
|
||||
|
||||
registered = map[solana.PublicKey]Handler{
|
||||
pumpProgramID: {parsePumpInstruction, "pump"},
|
||||
azczProgramID: {parseAzczInstruction, "azcz"},
|
||||
f5tfProgramID: {parseF5tfInstruction, "f5tf"},
|
||||
flasProgramID: {parseFlasInstruction, "flas"},
|
||||
photonProgramID: {parsePhotonInstruction, "photon"},
|
||||
pumpAmmProgramID: {parsePumpAmmInstruction, "pumpamm"},
|
||||
binanceWalletProgramID: {parseBinanceWalletInstruction, "binancewallet"},
|
||||
boboProgramID: {parseBoboInstruction, "bobo"},
|
||||
qtkvProgramID: {parseQtkvInstruction, "qtkv"},
|
||||
fjszProgramID: {parseFjszInstruction, "fjsz"},
|
||||
@@ -65,6 +72,8 @@ var (
|
||||
bonkProgramID: {parseBonkInstruction, "bonk"},
|
||||
bloomRouterProgramID: {parseBloomRouterInstruction, "bloomrouter"},
|
||||
dlmmProgramID: {parseDlmmInstruction, "dlmm"},
|
||||
dbotProgramID: {parseDbotInstruction, "dbot"},
|
||||
tradewizProgramID: {parseTradewizInstruction, "tradewiz"},
|
||||
}
|
||||
)
|
||||
|
||||
@@ -72,12 +81,16 @@ func ParseTransactionForSubscribe(ctx context.Context, update *SubscribeUpdateTr
|
||||
versioned, err := toVersionedTransaction(update)
|
||||
if err != nil {
|
||||
logger.Debug("txparser: failed to convert to versioned transaction", "error", err)
|
||||
if done != nil {
|
||||
close(done)
|
||||
}
|
||||
return
|
||||
}
|
||||
ParseTransaction(ctx, versioned, loader, parsed)
|
||||
if done != nil {
|
||||
close(done)
|
||||
}
|
||||
}
|
||||
|
||||
var VoteProgram = solana.MustPublicKeyFromBase58("Vote111111111111111111111111111111111111111")
|
||||
|
||||
@@ -92,7 +105,7 @@ func FilterTransactionForEntries(versioned VersionedTransaction) bool {
|
||||
// accounts filter?
|
||||
include := false
|
||||
for _, key := range versioned.StaticAccountKeys {
|
||||
_, include = slices.BinarySearchFunc(parseProgram, key, func(key solana.PublicKey, key2 solana.PublicKey) int {
|
||||
_, include = slices.BinarySearchFunc(defaultFilterAccount, key, func(key solana.PublicKey, key2 solana.PublicKey) int {
|
||||
return bytes.Compare(key[:], key2[:])
|
||||
})
|
||||
if include {
|
||||
@@ -102,6 +115,53 @@ func FilterTransactionForEntries(versioned VersionedTransaction) bool {
|
||||
return !include
|
||||
}
|
||||
|
||||
func GetRegisteredHandlers() map[solana.PublicKey]Handler {
|
||||
return registered
|
||||
}
|
||||
|
||||
func FilterTransactionForEntriesWithFilter(versioned VersionedTransaction, filter map[string]FilterParams) bool {
|
||||
if len(versioned.Instructions) >= 1 {
|
||||
programKey, _ := versioned.GetAccount(int(versioned.Instructions[0].ProgramIDIndex))
|
||||
if programKey.Equals(VoteProgram) && len(versioned.AddressTableLookups) == 0 {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
for _, params := range filter {
|
||||
excludePass := true
|
||||
// exclude first
|
||||
for _, key := range params.Exclude {
|
||||
if slices.Contains(versioned.StaticAccountKeys, key) {
|
||||
excludePass = false
|
||||
break
|
||||
}
|
||||
}
|
||||
requirePass := true
|
||||
if excludePass {
|
||||
for _, key := range params.Require {
|
||||
if !slices.Contains(versioned.StaticAccountKeys, key) {
|
||||
requirePass = false
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
include := len(params.Include) == 0
|
||||
if excludePass && requirePass {
|
||||
for _, key := range params.Include {
|
||||
if slices.Contains(versioned.StaticAccountKeys, key) {
|
||||
include = true
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
if excludePass && requirePass && include {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func ParseTransactionForEntries(ctx context.Context, slot uint64, entriesReader io.Reader, loader *AddressTables, parsed chan<- TxSignal) {
|
||||
err := entriesToVersionedTransaction(slot, entriesReader, func(versioned VersionedTransaction) {
|
||||
// filter out vote transactions
|
||||
@@ -116,8 +176,7 @@ func ParseTransactionForEntries(ctx context.Context, slot uint64, entriesReader
|
||||
}
|
||||
}
|
||||
|
||||
func ParseTransaction(ctx context.Context, versioned VersionedTransaction, loader *AddressTables, parsed chan<- TxSignal) {
|
||||
// staticKeys := versioned.Message.StaticAccountKeys
|
||||
func ParseTransactionWithHandler(ctx context.Context, versioned VersionedTransaction, loader *AddressTables, parsed chan<- TxSignal, handlers map[solana.PublicKey]Handler) {
|
||||
if loader != nil && len(versioned.AddressTableLookups) > 0 {
|
||||
lookupTableOk := true
|
||||
for _, lookups := range versioned.AddressTableLookups {
|
||||
@@ -142,7 +201,7 @@ func ParseTransaction(ctx context.Context, versioned VersionedTransaction, loade
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
handler, ok := parsedMap[program]
|
||||
handler, ok := handlers[program]
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
@@ -173,6 +232,11 @@ func ParseTransaction(ctx context.Context, versioned VersionedTransaction, loade
|
||||
return
|
||||
}
|
||||
|
||||
func ParseTransaction(ctx context.Context, versioned VersionedTransaction, loader *AddressTables, parsed chan<- TxSignal) {
|
||||
// staticKeys := versioned.Message.StaticAccountKeys
|
||||
ParseTransactionWithHandler(ctx, versioned, loader, parsed, registered)
|
||||
}
|
||||
|
||||
func toVersionedTransaction(update *SubscribeUpdateTransaction) (VersionedTransaction, error) {
|
||||
if update == nil || update.Transaction == nil || update.Transaction.Message == nil {
|
||||
return VersionedTransaction{}, fmt.Errorf("transaction is nil")
|
||||
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/samlior/libsam/pkg/enum"
|
||||
"github.com/samlior/libsam/pkg/swqos/clients"
|
||||
"github.com/samlior/libsam/v2/pkg/enum"
|
||||
"github.com/samlior/libsam/v2/pkg/swqos/clients"
|
||||
)
|
||||
|
||||
func NewSWQoSClient(ctx context.Context, config *SWQoSClientConfig) (SWQoSClient, error) {
|
||||
|
||||
Reference in New Issue
Block a user