diff --git a/consts.go b/consts.go index 8588971..bc7be67 100644 --- a/consts.go +++ b/consts.go @@ -4,6 +4,13 @@ import "github.com/gagliardetto/solana-go" var platformFeeAddresses = map[solana.PublicKey]string{ solana.MustPublicKeyFromBase58("BB5dnY55FXS1e1NXqZDwCzgdYJdMCj3B92PU6Q5Fb6DT"): PlatformGMGN, + solana.MustPublicKeyFromBase58("7sHXjs1j7sDJGVSMSPjD1b4v3FD6uRSvRWfhRdfv5BiA"): PlatformGMGN, + solana.MustPublicKeyFromBase58("ByRRgnZenY6W2sddo1VJzX9o4sMU4gPDUkcmgrpGBxRy"): PlatformGMGN, + solana.MustPublicKeyFromBase58("DXfkEGoo6WFsdL7x6gLZ7r6Hw2S6HrtrAQVPWYx2A1s9"): PlatformGMGN, + solana.MustPublicKeyFromBase58("3t9EKmRiAUcQUYzTZpNojzeGP1KBAVEEbDNmy6wECQpK"): PlatformGMGN, + solana.MustPublicKeyFromBase58("DymeoWc5WLNiQBaoLuxrxDnDRvLgGZ1QGsEoCAM7Jsrx"): PlatformGMGN, + solana.MustPublicKeyFromBase58("dBhdrmwBkRa66XxBuAK4WZeZnsZ6bHeHCCLXa3a8bTJ"): PlatformGMGN, + solana.MustPublicKeyFromBase58("6TxjC5wJzuuZgTtnTMipwwULEbMPx5JPW3QwWkdTGnrn"): PlatformGMGN, solana.MustPublicKeyFromBase58("AVUCZyuT35YSuj4RH7fwiyPu82Djn2Hfg7y2ND2XcnZH"): PlatformPhoton, solana.MustPublicKeyFromBase58("7LCZckF6XXGQ1hDY6HFXBKWAtiUgL9QY5vj1C4Bn1Qjj"): PlatformAxiom, solana.MustPublicKeyFromBase58("4V65jvcDG9DSQioUVqVPiUcUY9v6sb6HKtMnsxSKEz5S"): PlatformAxiom, @@ -40,6 +47,7 @@ var platformFeeAddresses = map[solana.PublicKey]string{ solana.MustPublicKeyFromBase58("5wkyL2FLEcyUUgc3UeGntHTAfWfzDrVuxMnaMm7792Gk"): PlatformMoonshotMoney, solana.MustPublicKeyFromBase58("MaestroUL88UBnZr3wfoN7hqmNWFi3ZYCGqZoJJHE36"): PlatformMaestro, solana.MustPublicKeyFromBase58("ZG98FUCjb8mJ824Gbs6RsgVmr1FhXb2oNiJHa2dwmPd"): PlatformBonkBot, + solana.MustPublicKeyFromBase58("J5XGHmzrRmnYWbmw45DbYkdZAU2bwERFZ11qCDXPvFB5"): PlatformPadre, } var mevAgentFeeAddresses = map[solana.PublicKey]string{ @@ -72,6 +80,15 @@ var mevAgentFeeAddresses = map[solana.PublicKey]string{ solana.MustPublicKeyFromBase58("ENxTEjSQ1YabmUpXAdCgevnHQ9MHdLv8tzFiuiYJqa13"): MevAgent0slot, solana.MustPublicKeyFromBase58("6rYLG55Q9RpsPGvqdPNJs4z5WTxJVatMB8zV3WJhs5EK"): MevAgent0slot, solana.MustPublicKeyFromBase58("Cix2bHfqPcKcM233mzxbLk14kSggUUiz2A87fJtGivXr"): MevAgent0slot, + solana.MustPublicKeyFromBase58("axm2JQY1FKEktAwgXWqjGYkkWsWPfwKzgbnGVt5kiP4"): MevAgent0slot, + solana.MustPublicKeyFromBase58("axm3PjbgwVrF6rnY2xLRMmWmLdDQGKfUYTEDtZ1haz7"): MevAgent0slot, + solana.MustPublicKeyFromBase58("axmD4LFJopAcbRKCKsrrmovCZZzmKQCMEfs5qEXj8dG"): MevAgent0slot, + solana.MustPublicKeyFromBase58("axmFmfqQwZGEUZeF3i3MqbRCDiGPfshtbdoBjk41k88"): MevAgent0slot, + solana.MustPublicKeyFromBase58("axmMdWvgEnN3NFrxMfTqUURzj9NLhZL2DkHkWCdgiFV"): MevAgent0slot, + solana.MustPublicKeyFromBase58("axmQTWU68qZ4fuG7zzkCXCBmxxeHVZrNrLkgxEFCbRv"): MevAgent0slot, + solana.MustPublicKeyFromBase58("axmWxBPqgRmcBN2cV12quqaQzsk16SazVXq8397KFKu"): MevAgent0slot, + solana.MustPublicKeyFromBase58("axmYVq9b1ABYqtyizMtyfJppPTPxZGXPLctB3hV6W5b"): MevAgent0slot, + solana.MustPublicKeyFromBase58("axmhpocX3hU7nT7KtsLBzNBR1Ur3HtU22Q5P313FREY"): MevAgent0slot, solana.MustPublicKeyFromBase58("HWEoBxYs7ssKuudEjzjmpfJVX7Dvi7wescFsVx2L5yoY"): MevAgentBlocxRoute, solana.MustPublicKeyFromBase58("7ks326H4LbMVaUC8nW5FpC5EoAf5eK5pf4Dsx4HDQLpq"): MevAgentBlocxRoute, solana.MustPublicKeyFromBase58("95cfoy472fcQHaw4tPGBTKpn6ZQnfEPfBgDQx6gcRmRg"): MevAgentBlocxRoute, @@ -177,4 +194,8 @@ var entryContractAddresses = map[solana.PublicKey]string{ solana.MustPublicKeyFromBase58("NoVA1TmDUqksaj2hB1nayFkPysjJbFiU76dT4qPw2wm"): EntryContractNovaBotsProgram, solana.MustPublicKeyFromBase58("E6YoRP3adE5XYneSseLee15wJshDxCsmyD2WtLvAmfLi"): EntryContractTaggedSearcher, solana.MustPublicKeyFromBase58("MAyhSmzXzV1pTf7LsNkrNwkWKTo4ougAJ1PPg47MD4e"): EntryContractMayhem, + solana.MustPublicKeyFromBase58("proVF4pMXVaYqmy4NjniPh4pqKNfMmsihgd4wdkCX3u"): EntryContractOKXDexRouterV2, } + +var okxDexRoutersV2 = solana.MustPublicKeyFromBase58("proVF4pMXVaYqmy4NjniPh4pqKNfMmsihgd4wdkCX3u") +var okxAggregatorV2 = solana.MustPublicKeyFromBase58("6m2CDdhRgxpH4WjvdzxAYbGxwdGUz5MziiL5jek2kBma") diff --git a/enum.go b/enum.go index 552c95b..4a4c883 100644 --- a/enum.go +++ b/enum.go @@ -38,6 +38,7 @@ const ( EntryContractNumeraire = "numeraire" EntryContractBloomRouter = "bloomRouter" EntryContractOKXAggregatorV2 = "oKXAggregatorV2" + EntryContractOKXDexRouterV2 = "oKXDExRouterV2" EntryContractFluxbeamDEX = "fluxbeamDEX" EntryContractNovaBotsProgram = "novaBotsProgram" EntryContractTaggedSearcher = "taggedSearcher" @@ -61,6 +62,7 @@ const ( PlatformMoonshotMoney = "moonshot.money" PlatformMaestro = "maestro" PlatformBonkBot = "bonkbot" + PlatformPadre = "padre" // used to flag transactions impersonating platform users PlatformFake = "fake" diff --git a/internal/example/geyser/error.go b/error.go similarity index 99% rename from internal/example/geyser/error.go rename to error.go index d441fae..97d5498 100644 --- a/internal/example/geyser/error.go +++ b/error.go @@ -1,4 +1,4 @@ -package geyser +package pump_parser import ( "encoding/binary" diff --git a/go.mod b/go.mod index b75ceed..f5d95d2 100644 --- a/go.mod +++ b/go.mod @@ -10,6 +10,7 @@ require ( github.com/shopspring/decimal v1.4.0 google.golang.org/grpc v1.77.0 google.golang.org/protobuf v1.36.10 + go.onsig.ai/onsig/yellowstone-proto v1.0.0 ) require ( diff --git a/go.sum b/go.sum index 2808d3f..2d19275 100644 --- a/go.sum +++ b/go.sum @@ -185,6 +185,7 @@ github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5t github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= 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.onsig.ai/onsig/yellowstone-proto v1.0.0/go.mod h1:e5dlYkNpgNHtiXFwPmPDZRf4PrCsgNaSoA8iG4rfiKA= 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= diff --git a/internal/example/geyser/Makefile b/internal/example/geyser/Makefile deleted file mode 100644 index 572190d..0000000 --- a/internal/example/geyser/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -protoc: - protoc \ - --go_out=./proto \ - --go_opt=paths=source_relative \ - --go-grpc_out=./proto \ - --go-grpc_opt=paths=source_relative \ - --proto_path ./proto/ ./proto/*.proto diff --git a/internal/example/geyser/cmd/main.go b/internal/example/geyser/cmd/main.go index d1a36fa..7a39a1c 100644 --- a/internal/example/geyser/cmd/main.go +++ b/internal/example/geyser/cmd/main.go @@ -5,10 +5,8 @@ import ( "fmt" "time" - "github.com/shopspring/decimal" parser "github.com/thloyi/pump-parser" - example "github.com/thloyi/pump-parser/example" - "github.com/thloyi/pump-parser/example/geyser" + example "github.com/thloyi/pump-parser/internal/example" ) func main() { @@ -19,8 +17,8 @@ func main() { //xt := tracker.NewTwitterTracker(nil) // Initialize Twitter tracker if needed // laserstream-mainnet-slc.helius-rpc.com:80 - ch := make(chan geyser.SubscriptionMessage, 1) - go geyser.RunLoopWithReConnect(context.Background(), "127.0.0.1:10001", parser.SolProgramPump, ch) + ch := make(chan example.SubscriptionMessage, 1) + go example.RunLoopWithReConnect(context.Background(), "127.0.0.1:10001", parser.SolProgramPump, ch) // var tokenTxs = make(map[string]*types.Tx) // currentBlock := uint64(0) for msg := range ch { @@ -48,7 +46,7 @@ func main() { //} // 处理交易 - txErr, ok := ptx.Err.(*geyser.TransactionError) + txErr, ok := ptx.Err.(*parser.TransactionError) var customerErrCode uint32 var instructorErrIndex uint8 if ok { @@ -62,16 +60,16 @@ func main() { } printed := false for _, tx := range txs { - if tx.Program != parser.SolProgramPump { - continue - } - if tx.Token1Amount.GreaterThanOrEqual(decimal.NewFromFloat(0.1)) || tx.Event != "buy" { - continue - } + //if tx.Program != parser.SolProgramPump { + // continue + //} + //if tx.Token1Amount.GreaterThanOrEqual(decimal.NewFromFloat(0.1)) || tx.Event != "buy" { + // continue + //} printed = true - fmt.Printf("t: %s, block: %d, hash: %s, signer: %s, program: %s, event: %s, token1: %s, cuPrice: %s, mevAgent: %s, mevFee: %s, platform: %s, platformFee: %s, entryContract: %s, mayhem: %t\n", + fmt.Printf("t: %s, block: %d, hash: %s, maker: %s, program: %s, event: %s, token0: %s, entryContract: %s, token balance: %s, \n", time.Now().Format(time.RFC3339Nano), - tx.Block, tx.GetTxHash(), tx.Maker, tx.Program, tx.Event, tx.Token1Amount, tx.CUPrice, tx.MevAgent, tx.MevAgentFee, tx.Platform, tx.PlatformFee, tx.EntryContract, tx.Mayhem) + tx.Block, tx.GetTxHash(), tx.Maker, tx.Program, tx.Event, tx.Token0Amount, tx.EntryContract, tx.AfterSignerToken0Balance) //break } if !printed { diff --git a/internal/example/geyser/proto/geyser.pb.go b/internal/example/geyser/proto/geyser.pb.go deleted file mode 100644 index 1344050..0000000 --- a/internal/example/geyser/proto/geyser.pb.go +++ /dev/null @@ -1,3114 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.6 -// protoc v5.29.3 -// source: geyser.proto - -package proto - -import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type CommitmentLevel int32 - -const ( - CommitmentLevel_PROCESSED CommitmentLevel = 0 - CommitmentLevel_CONFIRMED CommitmentLevel = 1 - CommitmentLevel_FINALIZED CommitmentLevel = 2 -) - -// Enum value maps for CommitmentLevel. -var ( - CommitmentLevel_name = map[int32]string{ - 0: "PROCESSED", - 1: "CONFIRMED", - 2: "FINALIZED", - } - CommitmentLevel_value = map[string]int32{ - "PROCESSED": 0, - "CONFIRMED": 1, - "FINALIZED": 2, - } -) - -func (x CommitmentLevel) Enum() *CommitmentLevel { - p := new(CommitmentLevel) - *p = x - return p -} - -func (x CommitmentLevel) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (CommitmentLevel) Descriptor() protoreflect.EnumDescriptor { - return file_geyser_proto_enumTypes[0].Descriptor() -} - -func (CommitmentLevel) Type() protoreflect.EnumType { - return &file_geyser_proto_enumTypes[0] -} - -func (x CommitmentLevel) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use CommitmentLevel.Descriptor instead. -func (CommitmentLevel) EnumDescriptor() ([]byte, []int) { - return file_geyser_proto_rawDescGZIP(), []int{0} -} - -type SlotStatus int32 - -const ( - SlotStatus_SLOT_PROCESSED SlotStatus = 0 - SlotStatus_SLOT_CONFIRMED SlotStatus = 1 - SlotStatus_SLOT_FINALIZED SlotStatus = 2 - SlotStatus_SLOT_FIRST_SHRED_RECEIVED SlotStatus = 3 - SlotStatus_SLOT_COMPLETED SlotStatus = 4 - SlotStatus_SLOT_CREATED_BANK SlotStatus = 5 - SlotStatus_SLOT_DEAD SlotStatus = 6 -) - -// Enum value maps for SlotStatus. -var ( - SlotStatus_name = map[int32]string{ - 0: "SLOT_PROCESSED", - 1: "SLOT_CONFIRMED", - 2: "SLOT_FINALIZED", - 3: "SLOT_FIRST_SHRED_RECEIVED", - 4: "SLOT_COMPLETED", - 5: "SLOT_CREATED_BANK", - 6: "SLOT_DEAD", - } - SlotStatus_value = map[string]int32{ - "SLOT_PROCESSED": 0, - "SLOT_CONFIRMED": 1, - "SLOT_FINALIZED": 2, - "SLOT_FIRST_SHRED_RECEIVED": 3, - "SLOT_COMPLETED": 4, - "SLOT_CREATED_BANK": 5, - "SLOT_DEAD": 6, - } -) - -func (x SlotStatus) Enum() *SlotStatus { - p := new(SlotStatus) - *p = x - return p -} - -func (x SlotStatus) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SlotStatus) Descriptor() protoreflect.EnumDescriptor { - return file_geyser_proto_enumTypes[1].Descriptor() -} - -func (SlotStatus) Type() protoreflect.EnumType { - return &file_geyser_proto_enumTypes[1] -} - -func (x SlotStatus) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use SlotStatus.Descriptor instead. -func (SlotStatus) EnumDescriptor() ([]byte, []int) { - return file_geyser_proto_rawDescGZIP(), []int{1} -} - -type SubscribeRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Accounts map[string]*SubscribeRequestFilterAccounts `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - Slots map[string]*SubscribeRequestFilterSlots `protobuf:"bytes,2,rep,name=slots,proto3" json:"slots,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - Transactions map[string]*SubscribeRequestFilterTransactions `protobuf:"bytes,3,rep,name=transactions,proto3" json:"transactions,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - TransactionsStatus map[string]*SubscribeRequestFilterTransactions `protobuf:"bytes,10,rep,name=transactions_status,json=transactionsStatus,proto3" json:"transactions_status,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - Blocks map[string]*SubscribeRequestFilterBlocks `protobuf:"bytes,4,rep,name=blocks,proto3" json:"blocks,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - BlocksMeta map[string]*SubscribeRequestFilterBlocksMeta `protobuf:"bytes,5,rep,name=blocks_meta,json=blocksMeta,proto3" json:"blocks_meta,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - Entry map[string]*SubscribeRequestFilterEntry `protobuf:"bytes,8,rep,name=entry,proto3" json:"entry,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - Commitment *CommitmentLevel `protobuf:"varint,6,opt,name=commitment,proto3,enum=geyser.CommitmentLevel,oneof" json:"commitment,omitempty"` - AccountsDataSlice []*SubscribeRequestAccountsDataSlice `protobuf:"bytes,7,rep,name=accounts_data_slice,json=accountsDataSlice,proto3" json:"accounts_data_slice,omitempty"` - Ping *SubscribeRequestPing `protobuf:"bytes,9,opt,name=ping,proto3,oneof" json:"ping,omitempty"` - FromSlot *uint64 `protobuf:"varint,11,opt,name=from_slot,json=fromSlot,proto3,oneof" json:"from_slot,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SubscribeRequest) Reset() { - *x = SubscribeRequest{} - mi := &file_geyser_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SubscribeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SubscribeRequest) ProtoMessage() {} - -func (x *SubscribeRequest) ProtoReflect() protoreflect.Message { - mi := &file_geyser_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SubscribeRequest.ProtoReflect.Descriptor instead. -func (*SubscribeRequest) Descriptor() ([]byte, []int) { - return file_geyser_proto_rawDescGZIP(), []int{0} -} - -func (x *SubscribeRequest) GetAccounts() map[string]*SubscribeRequestFilterAccounts { - if x != nil { - return x.Accounts - } - return nil -} - -func (x *SubscribeRequest) GetSlots() map[string]*SubscribeRequestFilterSlots { - if x != nil { - return x.Slots - } - return nil -} - -func (x *SubscribeRequest) GetTransactions() map[string]*SubscribeRequestFilterTransactions { - if x != nil { - return x.Transactions - } - return nil -} - -func (x *SubscribeRequest) GetTransactionsStatus() map[string]*SubscribeRequestFilterTransactions { - if x != nil { - return x.TransactionsStatus - } - return nil -} - -func (x *SubscribeRequest) GetBlocks() map[string]*SubscribeRequestFilterBlocks { - if x != nil { - return x.Blocks - } - return nil -} - -func (x *SubscribeRequest) GetBlocksMeta() map[string]*SubscribeRequestFilterBlocksMeta { - if x != nil { - return x.BlocksMeta - } - return nil -} - -func (x *SubscribeRequest) GetEntry() map[string]*SubscribeRequestFilterEntry { - if x != nil { - return x.Entry - } - return nil -} - -func (x *SubscribeRequest) GetCommitment() CommitmentLevel { - if x != nil && x.Commitment != nil { - return *x.Commitment - } - return CommitmentLevel_PROCESSED -} - -func (x *SubscribeRequest) GetAccountsDataSlice() []*SubscribeRequestAccountsDataSlice { - if x != nil { - return x.AccountsDataSlice - } - return nil -} - -func (x *SubscribeRequest) GetPing() *SubscribeRequestPing { - if x != nil { - return x.Ping - } - return nil -} - -func (x *SubscribeRequest) GetFromSlot() uint64 { - if x != nil && x.FromSlot != nil { - return *x.FromSlot - } - return 0 -} - -type SubscribeRequestFilterAccounts struct { - state protoimpl.MessageState `protogen:"open.v1"` - Account []string `protobuf:"bytes,2,rep,name=account,proto3" json:"account,omitempty"` - Owner []string `protobuf:"bytes,3,rep,name=owner,proto3" json:"owner,omitempty"` - Filters []*SubscribeRequestFilterAccountsFilter `protobuf:"bytes,4,rep,name=filters,proto3" json:"filters,omitempty"` - NonemptyTxnSignature *bool `protobuf:"varint,5,opt,name=nonempty_txn_signature,json=nonemptyTxnSignature,proto3,oneof" json:"nonempty_txn_signature,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SubscribeRequestFilterAccounts) Reset() { - *x = SubscribeRequestFilterAccounts{} - mi := &file_geyser_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SubscribeRequestFilterAccounts) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SubscribeRequestFilterAccounts) ProtoMessage() {} - -func (x *SubscribeRequestFilterAccounts) ProtoReflect() protoreflect.Message { - mi := &file_geyser_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SubscribeRequestFilterAccounts.ProtoReflect.Descriptor instead. -func (*SubscribeRequestFilterAccounts) Descriptor() ([]byte, []int) { - return file_geyser_proto_rawDescGZIP(), []int{1} -} - -func (x *SubscribeRequestFilterAccounts) GetAccount() []string { - if x != nil { - return x.Account - } - return nil -} - -func (x *SubscribeRequestFilterAccounts) GetOwner() []string { - if x != nil { - return x.Owner - } - return nil -} - -func (x *SubscribeRequestFilterAccounts) GetFilters() []*SubscribeRequestFilterAccountsFilter { - if x != nil { - return x.Filters - } - return nil -} - -func (x *SubscribeRequestFilterAccounts) GetNonemptyTxnSignature() bool { - if x != nil && x.NonemptyTxnSignature != nil { - return *x.NonemptyTxnSignature - } - return false -} - -type SubscribeRequestFilterAccountsFilter struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Filter: - // - // *SubscribeRequestFilterAccountsFilter_Memcmp - // *SubscribeRequestFilterAccountsFilter_Datasize - // *SubscribeRequestFilterAccountsFilter_TokenAccountState - // *SubscribeRequestFilterAccountsFilter_Lamports - Filter isSubscribeRequestFilterAccountsFilter_Filter `protobuf_oneof:"filter"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SubscribeRequestFilterAccountsFilter) Reset() { - *x = SubscribeRequestFilterAccountsFilter{} - mi := &file_geyser_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SubscribeRequestFilterAccountsFilter) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SubscribeRequestFilterAccountsFilter) ProtoMessage() {} - -func (x *SubscribeRequestFilterAccountsFilter) ProtoReflect() protoreflect.Message { - mi := &file_geyser_proto_msgTypes[2] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SubscribeRequestFilterAccountsFilter.ProtoReflect.Descriptor instead. -func (*SubscribeRequestFilterAccountsFilter) Descriptor() ([]byte, []int) { - return file_geyser_proto_rawDescGZIP(), []int{2} -} - -func (x *SubscribeRequestFilterAccountsFilter) GetFilter() isSubscribeRequestFilterAccountsFilter_Filter { - if x != nil { - return x.Filter - } - return nil -} - -func (x *SubscribeRequestFilterAccountsFilter) GetMemcmp() *SubscribeRequestFilterAccountsFilterMemcmp { - if x != nil { - if x, ok := x.Filter.(*SubscribeRequestFilterAccountsFilter_Memcmp); ok { - return x.Memcmp - } - } - return nil -} - -func (x *SubscribeRequestFilterAccountsFilter) GetDatasize() uint64 { - if x != nil { - if x, ok := x.Filter.(*SubscribeRequestFilterAccountsFilter_Datasize); ok { - return x.Datasize - } - } - return 0 -} - -func (x *SubscribeRequestFilterAccountsFilter) GetTokenAccountState() bool { - if x != nil { - if x, ok := x.Filter.(*SubscribeRequestFilterAccountsFilter_TokenAccountState); ok { - return x.TokenAccountState - } - } - return false -} - -func (x *SubscribeRequestFilterAccountsFilter) GetLamports() *SubscribeRequestFilterAccountsFilterLamports { - if x != nil { - if x, ok := x.Filter.(*SubscribeRequestFilterAccountsFilter_Lamports); ok { - return x.Lamports - } - } - return nil -} - -type isSubscribeRequestFilterAccountsFilter_Filter interface { - isSubscribeRequestFilterAccountsFilter_Filter() -} - -type SubscribeRequestFilterAccountsFilter_Memcmp struct { - Memcmp *SubscribeRequestFilterAccountsFilterMemcmp `protobuf:"bytes,1,opt,name=memcmp,proto3,oneof"` -} - -type SubscribeRequestFilterAccountsFilter_Datasize struct { - Datasize uint64 `protobuf:"varint,2,opt,name=datasize,proto3,oneof"` -} - -type SubscribeRequestFilterAccountsFilter_TokenAccountState struct { - TokenAccountState bool `protobuf:"varint,3,opt,name=token_account_state,json=tokenAccountState,proto3,oneof"` -} - -type SubscribeRequestFilterAccountsFilter_Lamports struct { - Lamports *SubscribeRequestFilterAccountsFilterLamports `protobuf:"bytes,4,opt,name=lamports,proto3,oneof"` -} - -func (*SubscribeRequestFilterAccountsFilter_Memcmp) isSubscribeRequestFilterAccountsFilter_Filter() {} - -func (*SubscribeRequestFilterAccountsFilter_Datasize) isSubscribeRequestFilterAccountsFilter_Filter() { -} - -func (*SubscribeRequestFilterAccountsFilter_TokenAccountState) isSubscribeRequestFilterAccountsFilter_Filter() { -} - -func (*SubscribeRequestFilterAccountsFilter_Lamports) isSubscribeRequestFilterAccountsFilter_Filter() { -} - -type SubscribeRequestFilterAccountsFilterMemcmp struct { - state protoimpl.MessageState `protogen:"open.v1"` - Offset uint64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"` - // Types that are valid to be assigned to Data: - // - // *SubscribeRequestFilterAccountsFilterMemcmp_Bytes - // *SubscribeRequestFilterAccountsFilterMemcmp_Base58 - // *SubscribeRequestFilterAccountsFilterMemcmp_Base64 - Data isSubscribeRequestFilterAccountsFilterMemcmp_Data `protobuf_oneof:"data"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SubscribeRequestFilterAccountsFilterMemcmp) Reset() { - *x = SubscribeRequestFilterAccountsFilterMemcmp{} - mi := &file_geyser_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SubscribeRequestFilterAccountsFilterMemcmp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SubscribeRequestFilterAccountsFilterMemcmp) ProtoMessage() {} - -func (x *SubscribeRequestFilterAccountsFilterMemcmp) ProtoReflect() protoreflect.Message { - mi := &file_geyser_proto_msgTypes[3] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SubscribeRequestFilterAccountsFilterMemcmp.ProtoReflect.Descriptor instead. -func (*SubscribeRequestFilterAccountsFilterMemcmp) Descriptor() ([]byte, []int) { - return file_geyser_proto_rawDescGZIP(), []int{3} -} - -func (x *SubscribeRequestFilterAccountsFilterMemcmp) GetOffset() uint64 { - if x != nil { - return x.Offset - } - return 0 -} - -func (x *SubscribeRequestFilterAccountsFilterMemcmp) GetData() isSubscribeRequestFilterAccountsFilterMemcmp_Data { - if x != nil { - return x.Data - } - return nil -} - -func (x *SubscribeRequestFilterAccountsFilterMemcmp) GetBytes() []byte { - if x != nil { - if x, ok := x.Data.(*SubscribeRequestFilterAccountsFilterMemcmp_Bytes); ok { - return x.Bytes - } - } - return nil -} - -func (x *SubscribeRequestFilterAccountsFilterMemcmp) GetBase58() string { - if x != nil { - if x, ok := x.Data.(*SubscribeRequestFilterAccountsFilterMemcmp_Base58); ok { - return x.Base58 - } - } - return "" -} - -func (x *SubscribeRequestFilterAccountsFilterMemcmp) GetBase64() string { - if x != nil { - if x, ok := x.Data.(*SubscribeRequestFilterAccountsFilterMemcmp_Base64); ok { - return x.Base64 - } - } - return "" -} - -type isSubscribeRequestFilterAccountsFilterMemcmp_Data interface { - isSubscribeRequestFilterAccountsFilterMemcmp_Data() -} - -type SubscribeRequestFilterAccountsFilterMemcmp_Bytes struct { - Bytes []byte `protobuf:"bytes,2,opt,name=bytes,proto3,oneof"` -} - -type SubscribeRequestFilterAccountsFilterMemcmp_Base58 struct { - Base58 string `protobuf:"bytes,3,opt,name=base58,proto3,oneof"` -} - -type SubscribeRequestFilterAccountsFilterMemcmp_Base64 struct { - Base64 string `protobuf:"bytes,4,opt,name=base64,proto3,oneof"` -} - -func (*SubscribeRequestFilterAccountsFilterMemcmp_Bytes) isSubscribeRequestFilterAccountsFilterMemcmp_Data() { -} - -func (*SubscribeRequestFilterAccountsFilterMemcmp_Base58) isSubscribeRequestFilterAccountsFilterMemcmp_Data() { -} - -func (*SubscribeRequestFilterAccountsFilterMemcmp_Base64) isSubscribeRequestFilterAccountsFilterMemcmp_Data() { -} - -type SubscribeRequestFilterAccountsFilterLamports struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Cmp: - // - // *SubscribeRequestFilterAccountsFilterLamports_Eq - // *SubscribeRequestFilterAccountsFilterLamports_Ne - // *SubscribeRequestFilterAccountsFilterLamports_Lt - // *SubscribeRequestFilterAccountsFilterLamports_Gt - Cmp isSubscribeRequestFilterAccountsFilterLamports_Cmp `protobuf_oneof:"cmp"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SubscribeRequestFilterAccountsFilterLamports) Reset() { - *x = SubscribeRequestFilterAccountsFilterLamports{} - mi := &file_geyser_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SubscribeRequestFilterAccountsFilterLamports) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SubscribeRequestFilterAccountsFilterLamports) ProtoMessage() {} - -func (x *SubscribeRequestFilterAccountsFilterLamports) ProtoReflect() protoreflect.Message { - mi := &file_geyser_proto_msgTypes[4] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SubscribeRequestFilterAccountsFilterLamports.ProtoReflect.Descriptor instead. -func (*SubscribeRequestFilterAccountsFilterLamports) Descriptor() ([]byte, []int) { - return file_geyser_proto_rawDescGZIP(), []int{4} -} - -func (x *SubscribeRequestFilterAccountsFilterLamports) GetCmp() isSubscribeRequestFilterAccountsFilterLamports_Cmp { - if x != nil { - return x.Cmp - } - return nil -} - -func (x *SubscribeRequestFilterAccountsFilterLamports) GetEq() uint64 { - if x != nil { - if x, ok := x.Cmp.(*SubscribeRequestFilterAccountsFilterLamports_Eq); ok { - return x.Eq - } - } - return 0 -} - -func (x *SubscribeRequestFilterAccountsFilterLamports) GetNe() uint64 { - if x != nil { - if x, ok := x.Cmp.(*SubscribeRequestFilterAccountsFilterLamports_Ne); ok { - return x.Ne - } - } - return 0 -} - -func (x *SubscribeRequestFilterAccountsFilterLamports) GetLt() uint64 { - if x != nil { - if x, ok := x.Cmp.(*SubscribeRequestFilterAccountsFilterLamports_Lt); ok { - return x.Lt - } - } - return 0 -} - -func (x *SubscribeRequestFilterAccountsFilterLamports) GetGt() uint64 { - if x != nil { - if x, ok := x.Cmp.(*SubscribeRequestFilterAccountsFilterLamports_Gt); ok { - return x.Gt - } - } - return 0 -} - -type isSubscribeRequestFilterAccountsFilterLamports_Cmp interface { - isSubscribeRequestFilterAccountsFilterLamports_Cmp() -} - -type SubscribeRequestFilterAccountsFilterLamports_Eq struct { - Eq uint64 `protobuf:"varint,1,opt,name=eq,proto3,oneof"` -} - -type SubscribeRequestFilterAccountsFilterLamports_Ne struct { - Ne uint64 `protobuf:"varint,2,opt,name=ne,proto3,oneof"` -} - -type SubscribeRequestFilterAccountsFilterLamports_Lt struct { - Lt uint64 `protobuf:"varint,3,opt,name=lt,proto3,oneof"` -} - -type SubscribeRequestFilterAccountsFilterLamports_Gt struct { - Gt uint64 `protobuf:"varint,4,opt,name=gt,proto3,oneof"` -} - -func (*SubscribeRequestFilterAccountsFilterLamports_Eq) isSubscribeRequestFilterAccountsFilterLamports_Cmp() { -} - -func (*SubscribeRequestFilterAccountsFilterLamports_Ne) isSubscribeRequestFilterAccountsFilterLamports_Cmp() { -} - -func (*SubscribeRequestFilterAccountsFilterLamports_Lt) isSubscribeRequestFilterAccountsFilterLamports_Cmp() { -} - -func (*SubscribeRequestFilterAccountsFilterLamports_Gt) isSubscribeRequestFilterAccountsFilterLamports_Cmp() { -} - -type SubscribeRequestFilterSlots struct { - state protoimpl.MessageState `protogen:"open.v1"` - FilterByCommitment *bool `protobuf:"varint,1,opt,name=filter_by_commitment,json=filterByCommitment,proto3,oneof" json:"filter_by_commitment,omitempty"` - InterslotUpdates *bool `protobuf:"varint,2,opt,name=interslot_updates,json=interslotUpdates,proto3,oneof" json:"interslot_updates,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SubscribeRequestFilterSlots) Reset() { - *x = SubscribeRequestFilterSlots{} - mi := &file_geyser_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SubscribeRequestFilterSlots) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SubscribeRequestFilterSlots) ProtoMessage() {} - -func (x *SubscribeRequestFilterSlots) ProtoReflect() protoreflect.Message { - mi := &file_geyser_proto_msgTypes[5] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SubscribeRequestFilterSlots.ProtoReflect.Descriptor instead. -func (*SubscribeRequestFilterSlots) Descriptor() ([]byte, []int) { - return file_geyser_proto_rawDescGZIP(), []int{5} -} - -func (x *SubscribeRequestFilterSlots) GetFilterByCommitment() bool { - if x != nil && x.FilterByCommitment != nil { - return *x.FilterByCommitment - } - return false -} - -func (x *SubscribeRequestFilterSlots) GetInterslotUpdates() bool { - if x != nil && x.InterslotUpdates != nil { - return *x.InterslotUpdates - } - return false -} - -type SubscribeRequestFilterTransactions struct { - state protoimpl.MessageState `protogen:"open.v1"` - Vote *bool `protobuf:"varint,1,opt,name=vote,proto3,oneof" json:"vote,omitempty"` - Failed *bool `protobuf:"varint,2,opt,name=failed,proto3,oneof" json:"failed,omitempty"` - Signature *string `protobuf:"bytes,5,opt,name=signature,proto3,oneof" json:"signature,omitempty"` - AccountInclude []string `protobuf:"bytes,3,rep,name=account_include,json=accountInclude,proto3" json:"account_include,omitempty"` - AccountExclude []string `protobuf:"bytes,4,rep,name=account_exclude,json=accountExclude,proto3" json:"account_exclude,omitempty"` - AccountRequired []string `protobuf:"bytes,6,rep,name=account_required,json=accountRequired,proto3" json:"account_required,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SubscribeRequestFilterTransactions) Reset() { - *x = SubscribeRequestFilterTransactions{} - mi := &file_geyser_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SubscribeRequestFilterTransactions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SubscribeRequestFilterTransactions) ProtoMessage() {} - -func (x *SubscribeRequestFilterTransactions) ProtoReflect() protoreflect.Message { - mi := &file_geyser_proto_msgTypes[6] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SubscribeRequestFilterTransactions.ProtoReflect.Descriptor instead. -func (*SubscribeRequestFilterTransactions) Descriptor() ([]byte, []int) { - return file_geyser_proto_rawDescGZIP(), []int{6} -} - -func (x *SubscribeRequestFilterTransactions) GetVote() bool { - if x != nil && x.Vote != nil { - return *x.Vote - } - return false -} - -func (x *SubscribeRequestFilterTransactions) GetFailed() bool { - if x != nil && x.Failed != nil { - return *x.Failed - } - return false -} - -func (x *SubscribeRequestFilterTransactions) GetSignature() string { - if x != nil && x.Signature != nil { - return *x.Signature - } - return "" -} - -func (x *SubscribeRequestFilterTransactions) GetAccountInclude() []string { - if x != nil { - return x.AccountInclude - } - return nil -} - -func (x *SubscribeRequestFilterTransactions) GetAccountExclude() []string { - if x != nil { - return x.AccountExclude - } - return nil -} - -func (x *SubscribeRequestFilterTransactions) GetAccountRequired() []string { - if x != nil { - return x.AccountRequired - } - return nil -} - -type SubscribeRequestFilterBlocks struct { - state protoimpl.MessageState `protogen:"open.v1"` - AccountInclude []string `protobuf:"bytes,1,rep,name=account_include,json=accountInclude,proto3" json:"account_include,omitempty"` - IncludeTransactions *bool `protobuf:"varint,2,opt,name=include_transactions,json=includeTransactions,proto3,oneof" json:"include_transactions,omitempty"` - IncludeAccounts *bool `protobuf:"varint,3,opt,name=include_accounts,json=includeAccounts,proto3,oneof" json:"include_accounts,omitempty"` - IncludeEntries *bool `protobuf:"varint,4,opt,name=include_entries,json=includeEntries,proto3,oneof" json:"include_entries,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SubscribeRequestFilterBlocks) Reset() { - *x = SubscribeRequestFilterBlocks{} - mi := &file_geyser_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SubscribeRequestFilterBlocks) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SubscribeRequestFilterBlocks) ProtoMessage() {} - -func (x *SubscribeRequestFilterBlocks) ProtoReflect() protoreflect.Message { - mi := &file_geyser_proto_msgTypes[7] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SubscribeRequestFilterBlocks.ProtoReflect.Descriptor instead. -func (*SubscribeRequestFilterBlocks) Descriptor() ([]byte, []int) { - return file_geyser_proto_rawDescGZIP(), []int{7} -} - -func (x *SubscribeRequestFilterBlocks) GetAccountInclude() []string { - if x != nil { - return x.AccountInclude - } - return nil -} - -func (x *SubscribeRequestFilterBlocks) GetIncludeTransactions() bool { - if x != nil && x.IncludeTransactions != nil { - return *x.IncludeTransactions - } - return false -} - -func (x *SubscribeRequestFilterBlocks) GetIncludeAccounts() bool { - if x != nil && x.IncludeAccounts != nil { - return *x.IncludeAccounts - } - return false -} - -func (x *SubscribeRequestFilterBlocks) GetIncludeEntries() bool { - if x != nil && x.IncludeEntries != nil { - return *x.IncludeEntries - } - return false -} - -type SubscribeRequestFilterBlocksMeta struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SubscribeRequestFilterBlocksMeta) Reset() { - *x = SubscribeRequestFilterBlocksMeta{} - mi := &file_geyser_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SubscribeRequestFilterBlocksMeta) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SubscribeRequestFilterBlocksMeta) ProtoMessage() {} - -func (x *SubscribeRequestFilterBlocksMeta) ProtoReflect() protoreflect.Message { - mi := &file_geyser_proto_msgTypes[8] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SubscribeRequestFilterBlocksMeta.ProtoReflect.Descriptor instead. -func (*SubscribeRequestFilterBlocksMeta) Descriptor() ([]byte, []int) { - return file_geyser_proto_rawDescGZIP(), []int{8} -} - -type SubscribeRequestFilterEntry struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SubscribeRequestFilterEntry) Reset() { - *x = SubscribeRequestFilterEntry{} - mi := &file_geyser_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SubscribeRequestFilterEntry) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SubscribeRequestFilterEntry) ProtoMessage() {} - -func (x *SubscribeRequestFilterEntry) ProtoReflect() protoreflect.Message { - mi := &file_geyser_proto_msgTypes[9] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SubscribeRequestFilterEntry.ProtoReflect.Descriptor instead. -func (*SubscribeRequestFilterEntry) Descriptor() ([]byte, []int) { - return file_geyser_proto_rawDescGZIP(), []int{9} -} - -type SubscribeRequestAccountsDataSlice struct { - state protoimpl.MessageState `protogen:"open.v1"` - Offset uint64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"` - Length uint64 `protobuf:"varint,2,opt,name=length,proto3" json:"length,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SubscribeRequestAccountsDataSlice) Reset() { - *x = SubscribeRequestAccountsDataSlice{} - mi := &file_geyser_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SubscribeRequestAccountsDataSlice) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SubscribeRequestAccountsDataSlice) ProtoMessage() {} - -func (x *SubscribeRequestAccountsDataSlice) ProtoReflect() protoreflect.Message { - mi := &file_geyser_proto_msgTypes[10] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SubscribeRequestAccountsDataSlice.ProtoReflect.Descriptor instead. -func (*SubscribeRequestAccountsDataSlice) Descriptor() ([]byte, []int) { - return file_geyser_proto_rawDescGZIP(), []int{10} -} - -func (x *SubscribeRequestAccountsDataSlice) GetOffset() uint64 { - if x != nil { - return x.Offset - } - return 0 -} - -func (x *SubscribeRequestAccountsDataSlice) GetLength() uint64 { - if x != nil { - return x.Length - } - return 0 -} - -type SubscribeRequestPing struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SubscribeRequestPing) Reset() { - *x = SubscribeRequestPing{} - mi := &file_geyser_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SubscribeRequestPing) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SubscribeRequestPing) ProtoMessage() {} - -func (x *SubscribeRequestPing) ProtoReflect() protoreflect.Message { - mi := &file_geyser_proto_msgTypes[11] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SubscribeRequestPing.ProtoReflect.Descriptor instead. -func (*SubscribeRequestPing) Descriptor() ([]byte, []int) { - return file_geyser_proto_rawDescGZIP(), []int{11} -} - -func (x *SubscribeRequestPing) GetId() int32 { - if x != nil { - return x.Id - } - return 0 -} - -type SubscribeUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - Filters []string `protobuf:"bytes,1,rep,name=filters,proto3" json:"filters,omitempty"` - // Types that are valid to be assigned to UpdateOneof: - // - // *SubscribeUpdate_Account - // *SubscribeUpdate_Slot - // *SubscribeUpdate_Transaction - // *SubscribeUpdate_TransactionStatus - // *SubscribeUpdate_Block - // *SubscribeUpdate_Ping - // *SubscribeUpdate_Pong - // *SubscribeUpdate_BlockMeta - // *SubscribeUpdate_Entry - UpdateOneof isSubscribeUpdate_UpdateOneof `protobuf_oneof:"update_oneof"` - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SubscribeUpdate) Reset() { - *x = SubscribeUpdate{} - mi := &file_geyser_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SubscribeUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SubscribeUpdate) ProtoMessage() {} - -func (x *SubscribeUpdate) ProtoReflect() protoreflect.Message { - mi := &file_geyser_proto_msgTypes[12] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SubscribeUpdate.ProtoReflect.Descriptor instead. -func (*SubscribeUpdate) Descriptor() ([]byte, []int) { - return file_geyser_proto_rawDescGZIP(), []int{12} -} - -func (x *SubscribeUpdate) GetFilters() []string { - if x != nil { - return x.Filters - } - return nil -} - -func (x *SubscribeUpdate) GetUpdateOneof() isSubscribeUpdate_UpdateOneof { - if x != nil { - return x.UpdateOneof - } - return nil -} - -func (x *SubscribeUpdate) GetAccount() *SubscribeUpdateAccount { - if x != nil { - if x, ok := x.UpdateOneof.(*SubscribeUpdate_Account); ok { - return x.Account - } - } - return nil -} - -func (x *SubscribeUpdate) GetSlot() *SubscribeUpdateSlot { - if x != nil { - if x, ok := x.UpdateOneof.(*SubscribeUpdate_Slot); ok { - return x.Slot - } - } - return nil -} - -func (x *SubscribeUpdate) GetTransaction() *SubscribeUpdateTransaction { - if x != nil { - if x, ok := x.UpdateOneof.(*SubscribeUpdate_Transaction); ok { - return x.Transaction - } - } - return nil -} - -func (x *SubscribeUpdate) GetTransactionStatus() *SubscribeUpdateTransactionStatus { - if x != nil { - if x, ok := x.UpdateOneof.(*SubscribeUpdate_TransactionStatus); ok { - return x.TransactionStatus - } - } - return nil -} - -func (x *SubscribeUpdate) GetBlock() *SubscribeUpdateBlock { - if x != nil { - if x, ok := x.UpdateOneof.(*SubscribeUpdate_Block); ok { - return x.Block - } - } - return nil -} - -func (x *SubscribeUpdate) GetPing() *SubscribeUpdatePing { - if x != nil { - if x, ok := x.UpdateOneof.(*SubscribeUpdate_Ping); ok { - return x.Ping - } - } - return nil -} - -func (x *SubscribeUpdate) GetPong() *SubscribeUpdatePong { - if x != nil { - if x, ok := x.UpdateOneof.(*SubscribeUpdate_Pong); ok { - return x.Pong - } - } - return nil -} - -func (x *SubscribeUpdate) GetBlockMeta() *SubscribeUpdateBlockMeta { - if x != nil { - if x, ok := x.UpdateOneof.(*SubscribeUpdate_BlockMeta); ok { - return x.BlockMeta - } - } - return nil -} - -func (x *SubscribeUpdate) GetEntry() *SubscribeUpdateEntry { - if x != nil { - if x, ok := x.UpdateOneof.(*SubscribeUpdate_Entry); ok { - return x.Entry - } - } - return nil -} - -func (x *SubscribeUpdate) GetCreatedAt() *timestamppb.Timestamp { - if x != nil { - return x.CreatedAt - } - return nil -} - -type isSubscribeUpdate_UpdateOneof interface { - isSubscribeUpdate_UpdateOneof() -} - -type SubscribeUpdate_Account struct { - Account *SubscribeUpdateAccount `protobuf:"bytes,2,opt,name=account,proto3,oneof"` -} - -type SubscribeUpdate_Slot struct { - Slot *SubscribeUpdateSlot `protobuf:"bytes,3,opt,name=slot,proto3,oneof"` -} - -type SubscribeUpdate_Transaction struct { - Transaction *SubscribeUpdateTransaction `protobuf:"bytes,4,opt,name=transaction,proto3,oneof"` -} - -type SubscribeUpdate_TransactionStatus struct { - TransactionStatus *SubscribeUpdateTransactionStatus `protobuf:"bytes,10,opt,name=transaction_status,json=transactionStatus,proto3,oneof"` -} - -type SubscribeUpdate_Block struct { - Block *SubscribeUpdateBlock `protobuf:"bytes,5,opt,name=block,proto3,oneof"` -} - -type SubscribeUpdate_Ping struct { - Ping *SubscribeUpdatePing `protobuf:"bytes,6,opt,name=ping,proto3,oneof"` -} - -type SubscribeUpdate_Pong struct { - Pong *SubscribeUpdatePong `protobuf:"bytes,9,opt,name=pong,proto3,oneof"` -} - -type SubscribeUpdate_BlockMeta struct { - BlockMeta *SubscribeUpdateBlockMeta `protobuf:"bytes,7,opt,name=block_meta,json=blockMeta,proto3,oneof"` -} - -type SubscribeUpdate_Entry struct { - Entry *SubscribeUpdateEntry `protobuf:"bytes,8,opt,name=entry,proto3,oneof"` -} - -func (*SubscribeUpdate_Account) isSubscribeUpdate_UpdateOneof() {} - -func (*SubscribeUpdate_Slot) isSubscribeUpdate_UpdateOneof() {} - -func (*SubscribeUpdate_Transaction) isSubscribeUpdate_UpdateOneof() {} - -func (*SubscribeUpdate_TransactionStatus) isSubscribeUpdate_UpdateOneof() {} - -func (*SubscribeUpdate_Block) isSubscribeUpdate_UpdateOneof() {} - -func (*SubscribeUpdate_Ping) isSubscribeUpdate_UpdateOneof() {} - -func (*SubscribeUpdate_Pong) isSubscribeUpdate_UpdateOneof() {} - -func (*SubscribeUpdate_BlockMeta) isSubscribeUpdate_UpdateOneof() {} - -func (*SubscribeUpdate_Entry) isSubscribeUpdate_UpdateOneof() {} - -type SubscribeUpdateAccount struct { - state protoimpl.MessageState `protogen:"open.v1"` - Account *SubscribeUpdateAccountInfo `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` - Slot uint64 `protobuf:"varint,2,opt,name=slot,proto3" json:"slot,omitempty"` - IsStartup bool `protobuf:"varint,3,opt,name=is_startup,json=isStartup,proto3" json:"is_startup,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SubscribeUpdateAccount) Reset() { - *x = SubscribeUpdateAccount{} - mi := &file_geyser_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SubscribeUpdateAccount) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SubscribeUpdateAccount) ProtoMessage() {} - -func (x *SubscribeUpdateAccount) ProtoReflect() protoreflect.Message { - mi := &file_geyser_proto_msgTypes[13] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SubscribeUpdateAccount.ProtoReflect.Descriptor instead. -func (*SubscribeUpdateAccount) Descriptor() ([]byte, []int) { - return file_geyser_proto_rawDescGZIP(), []int{13} -} - -func (x *SubscribeUpdateAccount) GetAccount() *SubscribeUpdateAccountInfo { - if x != nil { - return x.Account - } - return nil -} - -func (x *SubscribeUpdateAccount) GetSlot() uint64 { - if x != nil { - return x.Slot - } - return 0 -} - -func (x *SubscribeUpdateAccount) GetIsStartup() bool { - if x != nil { - return x.IsStartup - } - return false -} - -type SubscribeUpdateAccountInfo struct { - state protoimpl.MessageState `protogen:"open.v1"` - Pubkey []byte `protobuf:"bytes,1,opt,name=pubkey,proto3" json:"pubkey,omitempty"` - Lamports uint64 `protobuf:"varint,2,opt,name=lamports,proto3" json:"lamports,omitempty"` - Owner []byte `protobuf:"bytes,3,opt,name=owner,proto3" json:"owner,omitempty"` - Executable bool `protobuf:"varint,4,opt,name=executable,proto3" json:"executable,omitempty"` - RentEpoch uint64 `protobuf:"varint,5,opt,name=rent_epoch,json=rentEpoch,proto3" json:"rent_epoch,omitempty"` - Data []byte `protobuf:"bytes,6,opt,name=data,proto3" json:"data,omitempty"` - WriteVersion uint64 `protobuf:"varint,7,opt,name=write_version,json=writeVersion,proto3" json:"write_version,omitempty"` - TxnSignature []byte `protobuf:"bytes,8,opt,name=txn_signature,json=txnSignature,proto3,oneof" json:"txn_signature,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SubscribeUpdateAccountInfo) Reset() { - *x = SubscribeUpdateAccountInfo{} - mi := &file_geyser_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SubscribeUpdateAccountInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SubscribeUpdateAccountInfo) ProtoMessage() {} - -func (x *SubscribeUpdateAccountInfo) ProtoReflect() protoreflect.Message { - mi := &file_geyser_proto_msgTypes[14] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SubscribeUpdateAccountInfo.ProtoReflect.Descriptor instead. -func (*SubscribeUpdateAccountInfo) Descriptor() ([]byte, []int) { - return file_geyser_proto_rawDescGZIP(), []int{14} -} - -func (x *SubscribeUpdateAccountInfo) GetPubkey() []byte { - if x != nil { - return x.Pubkey - } - return nil -} - -func (x *SubscribeUpdateAccountInfo) GetLamports() uint64 { - if x != nil { - return x.Lamports - } - return 0 -} - -func (x *SubscribeUpdateAccountInfo) GetOwner() []byte { - if x != nil { - return x.Owner - } - return nil -} - -func (x *SubscribeUpdateAccountInfo) GetExecutable() bool { - if x != nil { - return x.Executable - } - return false -} - -func (x *SubscribeUpdateAccountInfo) GetRentEpoch() uint64 { - if x != nil { - return x.RentEpoch - } - return 0 -} - -func (x *SubscribeUpdateAccountInfo) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -func (x *SubscribeUpdateAccountInfo) GetWriteVersion() uint64 { - if x != nil { - return x.WriteVersion - } - return 0 -} - -func (x *SubscribeUpdateAccountInfo) GetTxnSignature() []byte { - if x != nil { - return x.TxnSignature - } - return nil -} - -type SubscribeUpdateSlot struct { - state protoimpl.MessageState `protogen:"open.v1"` - Slot uint64 `protobuf:"varint,1,opt,name=slot,proto3" json:"slot,omitempty"` - Parent *uint64 `protobuf:"varint,2,opt,name=parent,proto3,oneof" json:"parent,omitempty"` - Status SlotStatus `protobuf:"varint,3,opt,name=status,proto3,enum=geyser.SlotStatus" json:"status,omitempty"` - DeadError *string `protobuf:"bytes,4,opt,name=dead_error,json=deadError,proto3,oneof" json:"dead_error,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SubscribeUpdateSlot) Reset() { - *x = SubscribeUpdateSlot{} - mi := &file_geyser_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SubscribeUpdateSlot) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SubscribeUpdateSlot) ProtoMessage() {} - -func (x *SubscribeUpdateSlot) ProtoReflect() protoreflect.Message { - mi := &file_geyser_proto_msgTypes[15] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SubscribeUpdateSlot.ProtoReflect.Descriptor instead. -func (*SubscribeUpdateSlot) Descriptor() ([]byte, []int) { - return file_geyser_proto_rawDescGZIP(), []int{15} -} - -func (x *SubscribeUpdateSlot) GetSlot() uint64 { - if x != nil { - return x.Slot - } - return 0 -} - -func (x *SubscribeUpdateSlot) GetParent() uint64 { - if x != nil && x.Parent != nil { - return *x.Parent - } - return 0 -} - -func (x *SubscribeUpdateSlot) GetStatus() SlotStatus { - if x != nil { - return x.Status - } - return SlotStatus_SLOT_PROCESSED -} - -func (x *SubscribeUpdateSlot) GetDeadError() string { - if x != nil && x.DeadError != nil { - return *x.DeadError - } - return "" -} - -type SubscribeUpdateTransaction struct { - state protoimpl.MessageState `protogen:"open.v1"` - Transaction *SubscribeUpdateTransactionInfo `protobuf:"bytes,1,opt,name=transaction,proto3" json:"transaction,omitempty"` - Slot uint64 `protobuf:"varint,2,opt,name=slot,proto3" json:"slot,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SubscribeUpdateTransaction) Reset() { - *x = SubscribeUpdateTransaction{} - mi := &file_geyser_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SubscribeUpdateTransaction) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SubscribeUpdateTransaction) ProtoMessage() {} - -func (x *SubscribeUpdateTransaction) ProtoReflect() protoreflect.Message { - mi := &file_geyser_proto_msgTypes[16] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SubscribeUpdateTransaction.ProtoReflect.Descriptor instead. -func (*SubscribeUpdateTransaction) Descriptor() ([]byte, []int) { - return file_geyser_proto_rawDescGZIP(), []int{16} -} - -func (x *SubscribeUpdateTransaction) GetTransaction() *SubscribeUpdateTransactionInfo { - if x != nil { - return x.Transaction - } - return nil -} - -func (x *SubscribeUpdateTransaction) GetSlot() uint64 { - if x != nil { - return x.Slot - } - return 0 -} - -type SubscribeUpdateTransactionInfo struct { - state protoimpl.MessageState `protogen:"open.v1"` - Signature []byte `protobuf:"bytes,1,opt,name=signature,proto3" json:"signature,omitempty"` - IsVote bool `protobuf:"varint,2,opt,name=is_vote,json=isVote,proto3" json:"is_vote,omitempty"` - Transaction *Transaction `protobuf:"bytes,3,opt,name=transaction,proto3" json:"transaction,omitempty"` - Meta *TransactionStatusMeta `protobuf:"bytes,4,opt,name=meta,proto3" json:"meta,omitempty"` - Index uint64 `protobuf:"varint,5,opt,name=index,proto3" json:"index,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SubscribeUpdateTransactionInfo) Reset() { - *x = SubscribeUpdateTransactionInfo{} - mi := &file_geyser_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SubscribeUpdateTransactionInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SubscribeUpdateTransactionInfo) ProtoMessage() {} - -func (x *SubscribeUpdateTransactionInfo) ProtoReflect() protoreflect.Message { - mi := &file_geyser_proto_msgTypes[17] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SubscribeUpdateTransactionInfo.ProtoReflect.Descriptor instead. -func (*SubscribeUpdateTransactionInfo) Descriptor() ([]byte, []int) { - return file_geyser_proto_rawDescGZIP(), []int{17} -} - -func (x *SubscribeUpdateTransactionInfo) GetSignature() []byte { - if x != nil { - return x.Signature - } - return nil -} - -func (x *SubscribeUpdateTransactionInfo) GetIsVote() bool { - if x != nil { - return x.IsVote - } - return false -} - -func (x *SubscribeUpdateTransactionInfo) GetTransaction() *Transaction { - if x != nil { - return x.Transaction - } - return nil -} - -func (x *SubscribeUpdateTransactionInfo) GetMeta() *TransactionStatusMeta { - if x != nil { - return x.Meta - } - return nil -} - -func (x *SubscribeUpdateTransactionInfo) GetIndex() uint64 { - if x != nil { - return x.Index - } - return 0 -} - -type SubscribeUpdateTransactionStatus struct { - state protoimpl.MessageState `protogen:"open.v1"` - Slot uint64 `protobuf:"varint,1,opt,name=slot,proto3" json:"slot,omitempty"` - Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` - IsVote bool `protobuf:"varint,3,opt,name=is_vote,json=isVote,proto3" json:"is_vote,omitempty"` - Index uint64 `protobuf:"varint,4,opt,name=index,proto3" json:"index,omitempty"` - Err *TransactionError `protobuf:"bytes,5,opt,name=err,proto3" json:"err,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SubscribeUpdateTransactionStatus) Reset() { - *x = SubscribeUpdateTransactionStatus{} - mi := &file_geyser_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SubscribeUpdateTransactionStatus) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SubscribeUpdateTransactionStatus) ProtoMessage() {} - -func (x *SubscribeUpdateTransactionStatus) ProtoReflect() protoreflect.Message { - mi := &file_geyser_proto_msgTypes[18] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SubscribeUpdateTransactionStatus.ProtoReflect.Descriptor instead. -func (*SubscribeUpdateTransactionStatus) Descriptor() ([]byte, []int) { - return file_geyser_proto_rawDescGZIP(), []int{18} -} - -func (x *SubscribeUpdateTransactionStatus) GetSlot() uint64 { - if x != nil { - return x.Slot - } - return 0 -} - -func (x *SubscribeUpdateTransactionStatus) GetSignature() []byte { - if x != nil { - return x.Signature - } - return nil -} - -func (x *SubscribeUpdateTransactionStatus) GetIsVote() bool { - if x != nil { - return x.IsVote - } - return false -} - -func (x *SubscribeUpdateTransactionStatus) GetIndex() uint64 { - if x != nil { - return x.Index - } - return 0 -} - -func (x *SubscribeUpdateTransactionStatus) GetErr() *TransactionError { - if x != nil { - return x.Err - } - return nil -} - -type SubscribeUpdateBlock struct { - state protoimpl.MessageState `protogen:"open.v1"` - Slot uint64 `protobuf:"varint,1,opt,name=slot,proto3" json:"slot,omitempty"` - Blockhash string `protobuf:"bytes,2,opt,name=blockhash,proto3" json:"blockhash,omitempty"` - Rewards *Rewards `protobuf:"bytes,3,opt,name=rewards,proto3" json:"rewards,omitempty"` - BlockTime *UnixTimestamp `protobuf:"bytes,4,opt,name=block_time,json=blockTime,proto3" json:"block_time,omitempty"` - BlockHeight *BlockHeight `protobuf:"bytes,5,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` - ParentSlot uint64 `protobuf:"varint,7,opt,name=parent_slot,json=parentSlot,proto3" json:"parent_slot,omitempty"` - ParentBlockhash string `protobuf:"bytes,8,opt,name=parent_blockhash,json=parentBlockhash,proto3" json:"parent_blockhash,omitempty"` - ExecutedTransactionCount uint64 `protobuf:"varint,9,opt,name=executed_transaction_count,json=executedTransactionCount,proto3" json:"executed_transaction_count,omitempty"` - Transactions []*SubscribeUpdateTransactionInfo `protobuf:"bytes,6,rep,name=transactions,proto3" json:"transactions,omitempty"` - UpdatedAccountCount uint64 `protobuf:"varint,10,opt,name=updated_account_count,json=updatedAccountCount,proto3" json:"updated_account_count,omitempty"` - Accounts []*SubscribeUpdateAccountInfo `protobuf:"bytes,11,rep,name=accounts,proto3" json:"accounts,omitempty"` - EntriesCount uint64 `protobuf:"varint,12,opt,name=entries_count,json=entriesCount,proto3" json:"entries_count,omitempty"` - Entries []*SubscribeUpdateEntry `protobuf:"bytes,13,rep,name=entries,proto3" json:"entries,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SubscribeUpdateBlock) Reset() { - *x = SubscribeUpdateBlock{} - mi := &file_geyser_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SubscribeUpdateBlock) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SubscribeUpdateBlock) ProtoMessage() {} - -func (x *SubscribeUpdateBlock) ProtoReflect() protoreflect.Message { - mi := &file_geyser_proto_msgTypes[19] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SubscribeUpdateBlock.ProtoReflect.Descriptor instead. -func (*SubscribeUpdateBlock) Descriptor() ([]byte, []int) { - return file_geyser_proto_rawDescGZIP(), []int{19} -} - -func (x *SubscribeUpdateBlock) GetSlot() uint64 { - if x != nil { - return x.Slot - } - return 0 -} - -func (x *SubscribeUpdateBlock) GetBlockhash() string { - if x != nil { - return x.Blockhash - } - return "" -} - -func (x *SubscribeUpdateBlock) GetRewards() *Rewards { - if x != nil { - return x.Rewards - } - return nil -} - -func (x *SubscribeUpdateBlock) GetBlockTime() *UnixTimestamp { - if x != nil { - return x.BlockTime - } - return nil -} - -func (x *SubscribeUpdateBlock) GetBlockHeight() *BlockHeight { - if x != nil { - return x.BlockHeight - } - return nil -} - -func (x *SubscribeUpdateBlock) GetParentSlot() uint64 { - if x != nil { - return x.ParentSlot - } - return 0 -} - -func (x *SubscribeUpdateBlock) GetParentBlockhash() string { - if x != nil { - return x.ParentBlockhash - } - return "" -} - -func (x *SubscribeUpdateBlock) GetExecutedTransactionCount() uint64 { - if x != nil { - return x.ExecutedTransactionCount - } - return 0 -} - -func (x *SubscribeUpdateBlock) GetTransactions() []*SubscribeUpdateTransactionInfo { - if x != nil { - return x.Transactions - } - return nil -} - -func (x *SubscribeUpdateBlock) GetUpdatedAccountCount() uint64 { - if x != nil { - return x.UpdatedAccountCount - } - return 0 -} - -func (x *SubscribeUpdateBlock) GetAccounts() []*SubscribeUpdateAccountInfo { - if x != nil { - return x.Accounts - } - return nil -} - -func (x *SubscribeUpdateBlock) GetEntriesCount() uint64 { - if x != nil { - return x.EntriesCount - } - return 0 -} - -func (x *SubscribeUpdateBlock) GetEntries() []*SubscribeUpdateEntry { - if x != nil { - return x.Entries - } - return nil -} - -type SubscribeUpdateBlockMeta struct { - state protoimpl.MessageState `protogen:"open.v1"` - Slot uint64 `protobuf:"varint,1,opt,name=slot,proto3" json:"slot,omitempty"` - Blockhash string `protobuf:"bytes,2,opt,name=blockhash,proto3" json:"blockhash,omitempty"` - Rewards *Rewards `protobuf:"bytes,3,opt,name=rewards,proto3" json:"rewards,omitempty"` - BlockTime *UnixTimestamp `protobuf:"bytes,4,opt,name=block_time,json=blockTime,proto3" json:"block_time,omitempty"` - BlockHeight *BlockHeight `protobuf:"bytes,5,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` - ParentSlot uint64 `protobuf:"varint,6,opt,name=parent_slot,json=parentSlot,proto3" json:"parent_slot,omitempty"` - ParentBlockhash string `protobuf:"bytes,7,opt,name=parent_blockhash,json=parentBlockhash,proto3" json:"parent_blockhash,omitempty"` - ExecutedTransactionCount uint64 `protobuf:"varint,8,opt,name=executed_transaction_count,json=executedTransactionCount,proto3" json:"executed_transaction_count,omitempty"` - EntriesCount uint64 `protobuf:"varint,9,opt,name=entries_count,json=entriesCount,proto3" json:"entries_count,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SubscribeUpdateBlockMeta) Reset() { - *x = SubscribeUpdateBlockMeta{} - mi := &file_geyser_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SubscribeUpdateBlockMeta) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SubscribeUpdateBlockMeta) ProtoMessage() {} - -func (x *SubscribeUpdateBlockMeta) ProtoReflect() protoreflect.Message { - mi := &file_geyser_proto_msgTypes[20] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SubscribeUpdateBlockMeta.ProtoReflect.Descriptor instead. -func (*SubscribeUpdateBlockMeta) Descriptor() ([]byte, []int) { - return file_geyser_proto_rawDescGZIP(), []int{20} -} - -func (x *SubscribeUpdateBlockMeta) GetSlot() uint64 { - if x != nil { - return x.Slot - } - return 0 -} - -func (x *SubscribeUpdateBlockMeta) GetBlockhash() string { - if x != nil { - return x.Blockhash - } - return "" -} - -func (x *SubscribeUpdateBlockMeta) GetRewards() *Rewards { - if x != nil { - return x.Rewards - } - return nil -} - -func (x *SubscribeUpdateBlockMeta) GetBlockTime() *UnixTimestamp { - if x != nil { - return x.BlockTime - } - return nil -} - -func (x *SubscribeUpdateBlockMeta) GetBlockHeight() *BlockHeight { - if x != nil { - return x.BlockHeight - } - return nil -} - -func (x *SubscribeUpdateBlockMeta) GetParentSlot() uint64 { - if x != nil { - return x.ParentSlot - } - return 0 -} - -func (x *SubscribeUpdateBlockMeta) GetParentBlockhash() string { - if x != nil { - return x.ParentBlockhash - } - return "" -} - -func (x *SubscribeUpdateBlockMeta) GetExecutedTransactionCount() uint64 { - if x != nil { - return x.ExecutedTransactionCount - } - return 0 -} - -func (x *SubscribeUpdateBlockMeta) GetEntriesCount() uint64 { - if x != nil { - return x.EntriesCount - } - return 0 -} - -type SubscribeUpdateEntry struct { - state protoimpl.MessageState `protogen:"open.v1"` - Slot uint64 `protobuf:"varint,1,opt,name=slot,proto3" json:"slot,omitempty"` - Index uint64 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` - NumHashes uint64 `protobuf:"varint,3,opt,name=num_hashes,json=numHashes,proto3" json:"num_hashes,omitempty"` - Hash []byte `protobuf:"bytes,4,opt,name=hash,proto3" json:"hash,omitempty"` - ExecutedTransactionCount uint64 `protobuf:"varint,5,opt,name=executed_transaction_count,json=executedTransactionCount,proto3" json:"executed_transaction_count,omitempty"` - StartingTransactionIndex uint64 `protobuf:"varint,6,opt,name=starting_transaction_index,json=startingTransactionIndex,proto3" json:"starting_transaction_index,omitempty"` // added in v1.18, for solana 1.17 value is always 0 - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SubscribeUpdateEntry) Reset() { - *x = SubscribeUpdateEntry{} - mi := &file_geyser_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SubscribeUpdateEntry) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SubscribeUpdateEntry) ProtoMessage() {} - -func (x *SubscribeUpdateEntry) ProtoReflect() protoreflect.Message { - mi := &file_geyser_proto_msgTypes[21] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SubscribeUpdateEntry.ProtoReflect.Descriptor instead. -func (*SubscribeUpdateEntry) Descriptor() ([]byte, []int) { - return file_geyser_proto_rawDescGZIP(), []int{21} -} - -func (x *SubscribeUpdateEntry) GetSlot() uint64 { - if x != nil { - return x.Slot - } - return 0 -} - -func (x *SubscribeUpdateEntry) GetIndex() uint64 { - if x != nil { - return x.Index - } - return 0 -} - -func (x *SubscribeUpdateEntry) GetNumHashes() uint64 { - if x != nil { - return x.NumHashes - } - return 0 -} - -func (x *SubscribeUpdateEntry) GetHash() []byte { - if x != nil { - return x.Hash - } - return nil -} - -func (x *SubscribeUpdateEntry) GetExecutedTransactionCount() uint64 { - if x != nil { - return x.ExecutedTransactionCount - } - return 0 -} - -func (x *SubscribeUpdateEntry) GetStartingTransactionIndex() uint64 { - if x != nil { - return x.StartingTransactionIndex - } - return 0 -} - -type SubscribeUpdatePing struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SubscribeUpdatePing) Reset() { - *x = SubscribeUpdatePing{} - mi := &file_geyser_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SubscribeUpdatePing) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SubscribeUpdatePing) ProtoMessage() {} - -func (x *SubscribeUpdatePing) ProtoReflect() protoreflect.Message { - mi := &file_geyser_proto_msgTypes[22] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SubscribeUpdatePing.ProtoReflect.Descriptor instead. -func (*SubscribeUpdatePing) Descriptor() ([]byte, []int) { - return file_geyser_proto_rawDescGZIP(), []int{22} -} - -type SubscribeUpdatePong struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SubscribeUpdatePong) Reset() { - *x = SubscribeUpdatePong{} - mi := &file_geyser_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SubscribeUpdatePong) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SubscribeUpdatePong) ProtoMessage() {} - -func (x *SubscribeUpdatePong) ProtoReflect() protoreflect.Message { - mi := &file_geyser_proto_msgTypes[23] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SubscribeUpdatePong.ProtoReflect.Descriptor instead. -func (*SubscribeUpdatePong) Descriptor() ([]byte, []int) { - return file_geyser_proto_rawDescGZIP(), []int{23} -} - -func (x *SubscribeUpdatePong) GetId() int32 { - if x != nil { - return x.Id - } - return 0 -} - -type PingRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Count int32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *PingRequest) Reset() { - *x = PingRequest{} - mi := &file_geyser_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *PingRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PingRequest) ProtoMessage() {} - -func (x *PingRequest) ProtoReflect() protoreflect.Message { - mi := &file_geyser_proto_msgTypes[24] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PingRequest.ProtoReflect.Descriptor instead. -func (*PingRequest) Descriptor() ([]byte, []int) { - return file_geyser_proto_rawDescGZIP(), []int{24} -} - -func (x *PingRequest) GetCount() int32 { - if x != nil { - return x.Count - } - return 0 -} - -type PongResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Count int32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *PongResponse) Reset() { - *x = PongResponse{} - mi := &file_geyser_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *PongResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PongResponse) ProtoMessage() {} - -func (x *PongResponse) ProtoReflect() protoreflect.Message { - mi := &file_geyser_proto_msgTypes[25] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PongResponse.ProtoReflect.Descriptor instead. -func (*PongResponse) Descriptor() ([]byte, []int) { - return file_geyser_proto_rawDescGZIP(), []int{25} -} - -func (x *PongResponse) GetCount() int32 { - if x != nil { - return x.Count - } - return 0 -} - -type GetLatestBlockhashRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Commitment *CommitmentLevel `protobuf:"varint,1,opt,name=commitment,proto3,enum=geyser.CommitmentLevel,oneof" json:"commitment,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetLatestBlockhashRequest) Reset() { - *x = GetLatestBlockhashRequest{} - mi := &file_geyser_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetLatestBlockhashRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetLatestBlockhashRequest) ProtoMessage() {} - -func (x *GetLatestBlockhashRequest) ProtoReflect() protoreflect.Message { - mi := &file_geyser_proto_msgTypes[26] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetLatestBlockhashRequest.ProtoReflect.Descriptor instead. -func (*GetLatestBlockhashRequest) Descriptor() ([]byte, []int) { - return file_geyser_proto_rawDescGZIP(), []int{26} -} - -func (x *GetLatestBlockhashRequest) GetCommitment() CommitmentLevel { - if x != nil && x.Commitment != nil { - return *x.Commitment - } - return CommitmentLevel_PROCESSED -} - -type GetLatestBlockhashResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Slot uint64 `protobuf:"varint,1,opt,name=slot,proto3" json:"slot,omitempty"` - Blockhash string `protobuf:"bytes,2,opt,name=blockhash,proto3" json:"blockhash,omitempty"` - LastValidBlockHeight uint64 `protobuf:"varint,3,opt,name=last_valid_block_height,json=lastValidBlockHeight,proto3" json:"last_valid_block_height,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetLatestBlockhashResponse) Reset() { - *x = GetLatestBlockhashResponse{} - mi := &file_geyser_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetLatestBlockhashResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetLatestBlockhashResponse) ProtoMessage() {} - -func (x *GetLatestBlockhashResponse) ProtoReflect() protoreflect.Message { - mi := &file_geyser_proto_msgTypes[27] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetLatestBlockhashResponse.ProtoReflect.Descriptor instead. -func (*GetLatestBlockhashResponse) Descriptor() ([]byte, []int) { - return file_geyser_proto_rawDescGZIP(), []int{27} -} - -func (x *GetLatestBlockhashResponse) GetSlot() uint64 { - if x != nil { - return x.Slot - } - return 0 -} - -func (x *GetLatestBlockhashResponse) GetBlockhash() string { - if x != nil { - return x.Blockhash - } - return "" -} - -func (x *GetLatestBlockhashResponse) GetLastValidBlockHeight() uint64 { - if x != nil { - return x.LastValidBlockHeight - } - return 0 -} - -type GetBlockHeightRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Commitment *CommitmentLevel `protobuf:"varint,1,opt,name=commitment,proto3,enum=geyser.CommitmentLevel,oneof" json:"commitment,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetBlockHeightRequest) Reset() { - *x = GetBlockHeightRequest{} - mi := &file_geyser_proto_msgTypes[28] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetBlockHeightRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetBlockHeightRequest) ProtoMessage() {} - -func (x *GetBlockHeightRequest) ProtoReflect() protoreflect.Message { - mi := &file_geyser_proto_msgTypes[28] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetBlockHeightRequest.ProtoReflect.Descriptor instead. -func (*GetBlockHeightRequest) Descriptor() ([]byte, []int) { - return file_geyser_proto_rawDescGZIP(), []int{28} -} - -func (x *GetBlockHeightRequest) GetCommitment() CommitmentLevel { - if x != nil && x.Commitment != nil { - return *x.Commitment - } - return CommitmentLevel_PROCESSED -} - -type GetBlockHeightResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - BlockHeight uint64 `protobuf:"varint,1,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetBlockHeightResponse) Reset() { - *x = GetBlockHeightResponse{} - mi := &file_geyser_proto_msgTypes[29] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetBlockHeightResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetBlockHeightResponse) ProtoMessage() {} - -func (x *GetBlockHeightResponse) ProtoReflect() protoreflect.Message { - mi := &file_geyser_proto_msgTypes[29] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetBlockHeightResponse.ProtoReflect.Descriptor instead. -func (*GetBlockHeightResponse) Descriptor() ([]byte, []int) { - return file_geyser_proto_rawDescGZIP(), []int{29} -} - -func (x *GetBlockHeightResponse) GetBlockHeight() uint64 { - if x != nil { - return x.BlockHeight - } - return 0 -} - -type GetSlotRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Commitment *CommitmentLevel `protobuf:"varint,1,opt,name=commitment,proto3,enum=geyser.CommitmentLevel,oneof" json:"commitment,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetSlotRequest) Reset() { - *x = GetSlotRequest{} - mi := &file_geyser_proto_msgTypes[30] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetSlotRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetSlotRequest) ProtoMessage() {} - -func (x *GetSlotRequest) ProtoReflect() protoreflect.Message { - mi := &file_geyser_proto_msgTypes[30] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetSlotRequest.ProtoReflect.Descriptor instead. -func (*GetSlotRequest) Descriptor() ([]byte, []int) { - return file_geyser_proto_rawDescGZIP(), []int{30} -} - -func (x *GetSlotRequest) GetCommitment() CommitmentLevel { - if x != nil && x.Commitment != nil { - return *x.Commitment - } - return CommitmentLevel_PROCESSED -} - -type GetSlotResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Slot uint64 `protobuf:"varint,1,opt,name=slot,proto3" json:"slot,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetSlotResponse) Reset() { - *x = GetSlotResponse{} - mi := &file_geyser_proto_msgTypes[31] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetSlotResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetSlotResponse) ProtoMessage() {} - -func (x *GetSlotResponse) ProtoReflect() protoreflect.Message { - mi := &file_geyser_proto_msgTypes[31] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetSlotResponse.ProtoReflect.Descriptor instead. -func (*GetSlotResponse) Descriptor() ([]byte, []int) { - return file_geyser_proto_rawDescGZIP(), []int{31} -} - -func (x *GetSlotResponse) GetSlot() uint64 { - if x != nil { - return x.Slot - } - return 0 -} - -type GetVersionRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetVersionRequest) Reset() { - *x = GetVersionRequest{} - mi := &file_geyser_proto_msgTypes[32] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetVersionRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetVersionRequest) ProtoMessage() {} - -func (x *GetVersionRequest) ProtoReflect() protoreflect.Message { - mi := &file_geyser_proto_msgTypes[32] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetVersionRequest.ProtoReflect.Descriptor instead. -func (*GetVersionRequest) Descriptor() ([]byte, []int) { - return file_geyser_proto_rawDescGZIP(), []int{32} -} - -type GetVersionResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetVersionResponse) Reset() { - *x = GetVersionResponse{} - mi := &file_geyser_proto_msgTypes[33] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetVersionResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetVersionResponse) ProtoMessage() {} - -func (x *GetVersionResponse) ProtoReflect() protoreflect.Message { - mi := &file_geyser_proto_msgTypes[33] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetVersionResponse.ProtoReflect.Descriptor instead. -func (*GetVersionResponse) Descriptor() ([]byte, []int) { - return file_geyser_proto_rawDescGZIP(), []int{33} -} - -func (x *GetVersionResponse) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -type IsBlockhashValidRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Blockhash string `protobuf:"bytes,1,opt,name=blockhash,proto3" json:"blockhash,omitempty"` - Commitment *CommitmentLevel `protobuf:"varint,2,opt,name=commitment,proto3,enum=geyser.CommitmentLevel,oneof" json:"commitment,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *IsBlockhashValidRequest) Reset() { - *x = IsBlockhashValidRequest{} - mi := &file_geyser_proto_msgTypes[34] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *IsBlockhashValidRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*IsBlockhashValidRequest) ProtoMessage() {} - -func (x *IsBlockhashValidRequest) ProtoReflect() protoreflect.Message { - mi := &file_geyser_proto_msgTypes[34] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use IsBlockhashValidRequest.ProtoReflect.Descriptor instead. -func (*IsBlockhashValidRequest) Descriptor() ([]byte, []int) { - return file_geyser_proto_rawDescGZIP(), []int{34} -} - -func (x *IsBlockhashValidRequest) GetBlockhash() string { - if x != nil { - return x.Blockhash - } - return "" -} - -func (x *IsBlockhashValidRequest) GetCommitment() CommitmentLevel { - if x != nil && x.Commitment != nil { - return *x.Commitment - } - return CommitmentLevel_PROCESSED -} - -type IsBlockhashValidResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Slot uint64 `protobuf:"varint,1,opt,name=slot,proto3" json:"slot,omitempty"` - Valid bool `protobuf:"varint,2,opt,name=valid,proto3" json:"valid,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *IsBlockhashValidResponse) Reset() { - *x = IsBlockhashValidResponse{} - mi := &file_geyser_proto_msgTypes[35] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *IsBlockhashValidResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*IsBlockhashValidResponse) ProtoMessage() {} - -func (x *IsBlockhashValidResponse) ProtoReflect() protoreflect.Message { - mi := &file_geyser_proto_msgTypes[35] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use IsBlockhashValidResponse.ProtoReflect.Descriptor instead. -func (*IsBlockhashValidResponse) Descriptor() ([]byte, []int) { - return file_geyser_proto_rawDescGZIP(), []int{35} -} - -func (x *IsBlockhashValidResponse) GetSlot() uint64 { - if x != nil { - return x.Slot - } - return 0 -} - -func (x *IsBlockhashValidResponse) GetValid() bool { - if x != nil { - return x.Valid - } - return false -} - -var File_geyser_proto protoreflect.FileDescriptor - -const file_geyser_proto_rawDesc = "" + - "\n" + - "\fgeyser.proto\x12\x06geyser\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x14solana-storage.proto\"\xed\v\n" + - "\x10SubscribeRequest\x12B\n" + - "\baccounts\x18\x01 \x03(\v2&.geyser.SubscribeRequest.AccountsEntryR\baccounts\x129\n" + - "\x05slots\x18\x02 \x03(\v2#.geyser.SubscribeRequest.SlotsEntryR\x05slots\x12N\n" + - "\ftransactions\x18\x03 \x03(\v2*.geyser.SubscribeRequest.TransactionsEntryR\ftransactions\x12a\n" + - "\x13transactions_status\x18\n" + - " \x03(\v20.geyser.SubscribeRequest.TransactionsStatusEntryR\x12transactionsStatus\x12<\n" + - "\x06blocks\x18\x04 \x03(\v2$.geyser.SubscribeRequest.BlocksEntryR\x06blocks\x12I\n" + - "\vblocks_meta\x18\x05 \x03(\v2(.geyser.SubscribeRequest.BlocksMetaEntryR\n" + - "blocksMeta\x129\n" + - "\x05entry\x18\b \x03(\v2#.geyser.SubscribeRequest.EntryEntryR\x05entry\x12<\n" + - "\n" + - "commitment\x18\x06 \x01(\x0e2\x17.geyser.CommitmentLevelH\x00R\n" + - "commitment\x88\x01\x01\x12Y\n" + - "\x13accounts_data_slice\x18\a \x03(\v2).geyser.SubscribeRequestAccountsDataSliceR\x11accountsDataSlice\x125\n" + - "\x04ping\x18\t \x01(\v2\x1c.geyser.SubscribeRequestPingH\x01R\x04ping\x88\x01\x01\x12 \n" + - "\tfrom_slot\x18\v \x01(\x04H\x02R\bfromSlot\x88\x01\x01\x1ac\n" + - "\rAccountsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12<\n" + - "\x05value\x18\x02 \x01(\v2&.geyser.SubscribeRequestFilterAccountsR\x05value:\x028\x01\x1a]\n" + - "\n" + - "SlotsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x129\n" + - "\x05value\x18\x02 \x01(\v2#.geyser.SubscribeRequestFilterSlotsR\x05value:\x028\x01\x1ak\n" + - "\x11TransactionsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12@\n" + - "\x05value\x18\x02 \x01(\v2*.geyser.SubscribeRequestFilterTransactionsR\x05value:\x028\x01\x1aq\n" + - "\x17TransactionsStatusEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12@\n" + - "\x05value\x18\x02 \x01(\v2*.geyser.SubscribeRequestFilterTransactionsR\x05value:\x028\x01\x1a_\n" + - "\vBlocksEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12:\n" + - "\x05value\x18\x02 \x01(\v2$.geyser.SubscribeRequestFilterBlocksR\x05value:\x028\x01\x1ag\n" + - "\x0fBlocksMetaEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12>\n" + - "\x05value\x18\x02 \x01(\v2(.geyser.SubscribeRequestFilterBlocksMetaR\x05value:\x028\x01\x1a]\n" + - "\n" + - "EntryEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x129\n" + - "\x05value\x18\x02 \x01(\v2#.geyser.SubscribeRequestFilterEntryR\x05value:\x028\x01B\r\n" + - "\v_commitmentB\a\n" + - "\x05_pingB\f\n" + - "\n" + - "_from_slot\"\xee\x01\n" + - "\x1eSubscribeRequestFilterAccounts\x12\x18\n" + - "\aaccount\x18\x02 \x03(\tR\aaccount\x12\x14\n" + - "\x05owner\x18\x03 \x03(\tR\x05owner\x12F\n" + - "\afilters\x18\x04 \x03(\v2,.geyser.SubscribeRequestFilterAccountsFilterR\afilters\x129\n" + - "\x16nonempty_txn_signature\x18\x05 \x01(\bH\x00R\x14nonemptyTxnSignature\x88\x01\x01B\x19\n" + - "\x17_nonempty_txn_signature\"\xa2\x02\n" + - "$SubscribeRequestFilterAccountsFilter\x12L\n" + - "\x06memcmp\x18\x01 \x01(\v22.geyser.SubscribeRequestFilterAccountsFilterMemcmpH\x00R\x06memcmp\x12\x1c\n" + - "\bdatasize\x18\x02 \x01(\x04H\x00R\bdatasize\x120\n" + - "\x13token_account_state\x18\x03 \x01(\bH\x00R\x11tokenAccountState\x12R\n" + - "\blamports\x18\x04 \x01(\v24.geyser.SubscribeRequestFilterAccountsFilterLamportsH\x00R\blamportsB\b\n" + - "\x06filter\"\x98\x01\n" + - "*SubscribeRequestFilterAccountsFilterMemcmp\x12\x16\n" + - "\x06offset\x18\x01 \x01(\x04R\x06offset\x12\x16\n" + - "\x05bytes\x18\x02 \x01(\fH\x00R\x05bytes\x12\x18\n" + - "\x06base58\x18\x03 \x01(\tH\x00R\x06base58\x12\x18\n" + - "\x06base64\x18\x04 \x01(\tH\x00R\x06base64B\x06\n" + - "\x04data\"}\n" + - ",SubscribeRequestFilterAccountsFilterLamports\x12\x10\n" + - "\x02eq\x18\x01 \x01(\x04H\x00R\x02eq\x12\x10\n" + - "\x02ne\x18\x02 \x01(\x04H\x00R\x02ne\x12\x10\n" + - "\x02lt\x18\x03 \x01(\x04H\x00R\x02lt\x12\x10\n" + - "\x02gt\x18\x04 \x01(\x04H\x00R\x02gtB\x05\n" + - "\x03cmp\"\xb5\x01\n" + - "\x1bSubscribeRequestFilterSlots\x125\n" + - "\x14filter_by_commitment\x18\x01 \x01(\bH\x00R\x12filterByCommitment\x88\x01\x01\x120\n" + - "\x11interslot_updates\x18\x02 \x01(\bH\x01R\x10interslotUpdates\x88\x01\x01B\x17\n" + - "\x15_filter_by_commitmentB\x14\n" + - "\x12_interslot_updates\"\x9c\x02\n" + - "\"SubscribeRequestFilterTransactions\x12\x17\n" + - "\x04vote\x18\x01 \x01(\bH\x00R\x04vote\x88\x01\x01\x12\x1b\n" + - "\x06failed\x18\x02 \x01(\bH\x01R\x06failed\x88\x01\x01\x12!\n" + - "\tsignature\x18\x05 \x01(\tH\x02R\tsignature\x88\x01\x01\x12'\n" + - "\x0faccount_include\x18\x03 \x03(\tR\x0eaccountInclude\x12'\n" + - "\x0faccount_exclude\x18\x04 \x03(\tR\x0eaccountExclude\x12)\n" + - "\x10account_required\x18\x06 \x03(\tR\x0faccountRequiredB\a\n" + - "\x05_voteB\t\n" + - "\a_failedB\f\n" + - "\n" + - "_signature\"\x9f\x02\n" + - "\x1cSubscribeRequestFilterBlocks\x12'\n" + - "\x0faccount_include\x18\x01 \x03(\tR\x0eaccountInclude\x126\n" + - "\x14include_transactions\x18\x02 \x01(\bH\x00R\x13includeTransactions\x88\x01\x01\x12.\n" + - "\x10include_accounts\x18\x03 \x01(\bH\x01R\x0fincludeAccounts\x88\x01\x01\x12,\n" + - "\x0finclude_entries\x18\x04 \x01(\bH\x02R\x0eincludeEntries\x88\x01\x01B\x17\n" + - "\x15_include_transactionsB\x13\n" + - "\x11_include_accountsB\x12\n" + - "\x10_include_entries\"\"\n" + - " SubscribeRequestFilterBlocksMeta\"\x1d\n" + - "\x1bSubscribeRequestFilterEntry\"S\n" + - "!SubscribeRequestAccountsDataSlice\x12\x16\n" + - "\x06offset\x18\x01 \x01(\x04R\x06offset\x12\x16\n" + - "\x06length\x18\x02 \x01(\x04R\x06length\"&\n" + - "\x14SubscribeRequestPing\x12\x0e\n" + - "\x02id\x18\x01 \x01(\x05R\x02id\"\x9d\x05\n" + - "\x0fSubscribeUpdate\x12\x18\n" + - "\afilters\x18\x01 \x03(\tR\afilters\x12:\n" + - "\aaccount\x18\x02 \x01(\v2\x1e.geyser.SubscribeUpdateAccountH\x00R\aaccount\x121\n" + - "\x04slot\x18\x03 \x01(\v2\x1b.geyser.SubscribeUpdateSlotH\x00R\x04slot\x12F\n" + - "\vtransaction\x18\x04 \x01(\v2\".geyser.SubscribeUpdateTransactionH\x00R\vtransaction\x12Y\n" + - "\x12transaction_status\x18\n" + - " \x01(\v2(.geyser.SubscribeUpdateTransactionStatusH\x00R\x11transactionStatus\x124\n" + - "\x05block\x18\x05 \x01(\v2\x1c.geyser.SubscribeUpdateBlockH\x00R\x05block\x121\n" + - "\x04ping\x18\x06 \x01(\v2\x1b.geyser.SubscribeUpdatePingH\x00R\x04ping\x121\n" + - "\x04pong\x18\t \x01(\v2\x1b.geyser.SubscribeUpdatePongH\x00R\x04pong\x12A\n" + - "\n" + - "block_meta\x18\a \x01(\v2 .geyser.SubscribeUpdateBlockMetaH\x00R\tblockMeta\x124\n" + - "\x05entry\x18\b \x01(\v2\x1c.geyser.SubscribeUpdateEntryH\x00R\x05entry\x129\n" + - "\n" + - "created_at\x18\v \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAtB\x0e\n" + - "\fupdate_oneof\"\x89\x01\n" + - "\x16SubscribeUpdateAccount\x12<\n" + - "\aaccount\x18\x01 \x01(\v2\".geyser.SubscribeUpdateAccountInfoR\aaccount\x12\x12\n" + - "\x04slot\x18\x02 \x01(\x04R\x04slot\x12\x1d\n" + - "\n" + - "is_startup\x18\x03 \x01(\bR\tisStartup\"\x9a\x02\n" + - "\x1aSubscribeUpdateAccountInfo\x12\x16\n" + - "\x06pubkey\x18\x01 \x01(\fR\x06pubkey\x12\x1a\n" + - "\blamports\x18\x02 \x01(\x04R\blamports\x12\x14\n" + - "\x05owner\x18\x03 \x01(\fR\x05owner\x12\x1e\n" + - "\n" + - "executable\x18\x04 \x01(\bR\n" + - "executable\x12\x1d\n" + - "\n" + - "rent_epoch\x18\x05 \x01(\x04R\trentEpoch\x12\x12\n" + - "\x04data\x18\x06 \x01(\fR\x04data\x12#\n" + - "\rwrite_version\x18\a \x01(\x04R\fwriteVersion\x12(\n" + - "\rtxn_signature\x18\b \x01(\fH\x00R\ftxnSignature\x88\x01\x01B\x10\n" + - "\x0e_txn_signature\"\xb0\x01\n" + - "\x13SubscribeUpdateSlot\x12\x12\n" + - "\x04slot\x18\x01 \x01(\x04R\x04slot\x12\x1b\n" + - "\x06parent\x18\x02 \x01(\x04H\x00R\x06parent\x88\x01\x01\x12*\n" + - "\x06status\x18\x03 \x01(\x0e2\x12.geyser.SlotStatusR\x06status\x12\"\n" + - "\n" + - "dead_error\x18\x04 \x01(\tH\x01R\tdeadError\x88\x01\x01B\t\n" + - "\a_parentB\r\n" + - "\v_dead_error\"z\n" + - "\x1aSubscribeUpdateTransaction\x12H\n" + - "\vtransaction\x18\x01 \x01(\v2&.geyser.SubscribeUpdateTransactionInfoR\vtransaction\x12\x12\n" + - "\x04slot\x18\x02 \x01(\x04R\x04slot\"\x85\x02\n" + - "\x1eSubscribeUpdateTransactionInfo\x12\x1c\n" + - "\tsignature\x18\x01 \x01(\fR\tsignature\x12\x17\n" + - "\ais_vote\x18\x02 \x01(\bR\x06isVote\x12L\n" + - "\vtransaction\x18\x03 \x01(\v2*.solana.storage.ConfirmedBlock.TransactionR\vtransaction\x12H\n" + - "\x04meta\x18\x04 \x01(\v24.solana.storage.ConfirmedBlock.TransactionStatusMetaR\x04meta\x12\x14\n" + - "\x05index\x18\x05 \x01(\x04R\x05index\"\xc6\x01\n" + - " SubscribeUpdateTransactionStatus\x12\x12\n" + - "\x04slot\x18\x01 \x01(\x04R\x04slot\x12\x1c\n" + - "\tsignature\x18\x02 \x01(\fR\tsignature\x12\x17\n" + - "\ais_vote\x18\x03 \x01(\bR\x06isVote\x12\x14\n" + - "\x05index\x18\x04 \x01(\x04R\x05index\x12A\n" + - "\x03err\x18\x05 \x01(\v2/.solana.storage.ConfirmedBlock.TransactionErrorR\x03err\"\xcd\x05\n" + - "\x14SubscribeUpdateBlock\x12\x12\n" + - "\x04slot\x18\x01 \x01(\x04R\x04slot\x12\x1c\n" + - "\tblockhash\x18\x02 \x01(\tR\tblockhash\x12@\n" + - "\arewards\x18\x03 \x01(\v2&.solana.storage.ConfirmedBlock.RewardsR\arewards\x12K\n" + - "\n" + - "block_time\x18\x04 \x01(\v2,.solana.storage.ConfirmedBlock.UnixTimestampR\tblockTime\x12M\n" + - "\fblock_height\x18\x05 \x01(\v2*.solana.storage.ConfirmedBlock.BlockHeightR\vblockHeight\x12\x1f\n" + - "\vparent_slot\x18\a \x01(\x04R\n" + - "parentSlot\x12)\n" + - "\x10parent_blockhash\x18\b \x01(\tR\x0fparentBlockhash\x12<\n" + - "\x1aexecuted_transaction_count\x18\t \x01(\x04R\x18executedTransactionCount\x12J\n" + - "\ftransactions\x18\x06 \x03(\v2&.geyser.SubscribeUpdateTransactionInfoR\ftransactions\x122\n" + - "\x15updated_account_count\x18\n" + - " \x01(\x04R\x13updatedAccountCount\x12>\n" + - "\baccounts\x18\v \x03(\v2\".geyser.SubscribeUpdateAccountInfoR\baccounts\x12#\n" + - "\rentries_count\x18\f \x01(\x04R\fentriesCount\x126\n" + - "\aentries\x18\r \x03(\v2\x1c.geyser.SubscribeUpdateEntryR\aentries\"\xd9\x03\n" + - "\x18SubscribeUpdateBlockMeta\x12\x12\n" + - "\x04slot\x18\x01 \x01(\x04R\x04slot\x12\x1c\n" + - "\tblockhash\x18\x02 \x01(\tR\tblockhash\x12@\n" + - "\arewards\x18\x03 \x01(\v2&.solana.storage.ConfirmedBlock.RewardsR\arewards\x12K\n" + - "\n" + - "block_time\x18\x04 \x01(\v2,.solana.storage.ConfirmedBlock.UnixTimestampR\tblockTime\x12M\n" + - "\fblock_height\x18\x05 \x01(\v2*.solana.storage.ConfirmedBlock.BlockHeightR\vblockHeight\x12\x1f\n" + - "\vparent_slot\x18\x06 \x01(\x04R\n" + - "parentSlot\x12)\n" + - "\x10parent_blockhash\x18\a \x01(\tR\x0fparentBlockhash\x12<\n" + - "\x1aexecuted_transaction_count\x18\b \x01(\x04R\x18executedTransactionCount\x12#\n" + - "\rentries_count\x18\t \x01(\x04R\fentriesCount\"\xef\x01\n" + - "\x14SubscribeUpdateEntry\x12\x12\n" + - "\x04slot\x18\x01 \x01(\x04R\x04slot\x12\x14\n" + - "\x05index\x18\x02 \x01(\x04R\x05index\x12\x1d\n" + - "\n" + - "num_hashes\x18\x03 \x01(\x04R\tnumHashes\x12\x12\n" + - "\x04hash\x18\x04 \x01(\fR\x04hash\x12<\n" + - "\x1aexecuted_transaction_count\x18\x05 \x01(\x04R\x18executedTransactionCount\x12<\n" + - "\x1astarting_transaction_index\x18\x06 \x01(\x04R\x18startingTransactionIndex\"\x15\n" + - "\x13SubscribeUpdatePing\"%\n" + - "\x13SubscribeUpdatePong\x12\x0e\n" + - "\x02id\x18\x01 \x01(\x05R\x02id\"#\n" + - "\vPingRequest\x12\x14\n" + - "\x05count\x18\x01 \x01(\x05R\x05count\"$\n" + - "\fPongResponse\x12\x14\n" + - "\x05count\x18\x01 \x01(\x05R\x05count\"h\n" + - "\x19GetLatestBlockhashRequest\x12<\n" + - "\n" + - "commitment\x18\x01 \x01(\x0e2\x17.geyser.CommitmentLevelH\x00R\n" + - "commitment\x88\x01\x01B\r\n" + - "\v_commitment\"\x85\x01\n" + - "\x1aGetLatestBlockhashResponse\x12\x12\n" + - "\x04slot\x18\x01 \x01(\x04R\x04slot\x12\x1c\n" + - "\tblockhash\x18\x02 \x01(\tR\tblockhash\x125\n" + - "\x17last_valid_block_height\x18\x03 \x01(\x04R\x14lastValidBlockHeight\"d\n" + - "\x15GetBlockHeightRequest\x12<\n" + - "\n" + - "commitment\x18\x01 \x01(\x0e2\x17.geyser.CommitmentLevelH\x00R\n" + - "commitment\x88\x01\x01B\r\n" + - "\v_commitment\";\n" + - "\x16GetBlockHeightResponse\x12!\n" + - "\fblock_height\x18\x01 \x01(\x04R\vblockHeight\"]\n" + - "\x0eGetSlotRequest\x12<\n" + - "\n" + - "commitment\x18\x01 \x01(\x0e2\x17.geyser.CommitmentLevelH\x00R\n" + - "commitment\x88\x01\x01B\r\n" + - "\v_commitment\"%\n" + - "\x0fGetSlotResponse\x12\x12\n" + - "\x04slot\x18\x01 \x01(\x04R\x04slot\"\x13\n" + - "\x11GetVersionRequest\".\n" + - "\x12GetVersionResponse\x12\x18\n" + - "\aversion\x18\x01 \x01(\tR\aversion\"\x84\x01\n" + - "\x17IsBlockhashValidRequest\x12\x1c\n" + - "\tblockhash\x18\x01 \x01(\tR\tblockhash\x12<\n" + - "\n" + - "commitment\x18\x02 \x01(\x0e2\x17.geyser.CommitmentLevelH\x00R\n" + - "commitment\x88\x01\x01B\r\n" + - "\v_commitment\"D\n" + - "\x18IsBlockhashValidResponse\x12\x12\n" + - "\x04slot\x18\x01 \x01(\x04R\x04slot\x12\x14\n" + - "\x05valid\x18\x02 \x01(\bR\x05valid*>\n" + - "\x0fCommitmentLevel\x12\r\n" + - "\tPROCESSED\x10\x00\x12\r\n" + - "\tCONFIRMED\x10\x01\x12\r\n" + - "\tFINALIZED\x10\x02*\xa1\x01\n" + - "\n" + - "SlotStatus\x12\x12\n" + - "\x0eSLOT_PROCESSED\x10\x00\x12\x12\n" + - "\x0eSLOT_CONFIRMED\x10\x01\x12\x12\n" + - "\x0eSLOT_FINALIZED\x10\x02\x12\x1d\n" + - "\x19SLOT_FIRST_SHRED_RECEIVED\x10\x03\x12\x12\n" + - "\x0eSLOT_COMPLETED\x10\x04\x12\x15\n" + - "\x11SLOT_CREATED_BANK\x10\x05\x12\r\n" + - "\tSLOT_DEAD\x10\x062\x93\x04\n" + - "\x06Geyser\x12D\n" + - "\tSubscribe\x12\x18.geyser.SubscribeRequest\x1a\x17.geyser.SubscribeUpdate\"\x00(\x010\x01\x123\n" + - "\x04Ping\x12\x13.geyser.PingRequest\x1a\x14.geyser.PongResponse\"\x00\x12]\n" + - "\x12GetLatestBlockhash\x12!.geyser.GetLatestBlockhashRequest\x1a\".geyser.GetLatestBlockhashResponse\"\x00\x12Q\n" + - "\x0eGetBlockHeight\x12\x1d.geyser.GetBlockHeightRequest\x1a\x1e.geyser.GetBlockHeightResponse\"\x00\x12<\n" + - "\aGetSlot\x12\x16.geyser.GetSlotRequest\x1a\x17.geyser.GetSlotResponse\"\x00\x12W\n" + - "\x10IsBlockhashValid\x12\x1f.geyser.IsBlockhashValidRequest\x1a .geyser.IsBlockhashValidResponse\"\x00\x12E\n" + - "\n" + - "GetVersion\x12\x19.geyser.GetVersionRequest\x1a\x1a.geyser.GetVersionResponse\"\x00B;Z9github.com/rpcpool/yellowstone-grpc/examples/golang/protoP\x01b\x06proto3" - -var ( - file_geyser_proto_rawDescOnce sync.Once - file_geyser_proto_rawDescData []byte -) - -func file_geyser_proto_rawDescGZIP() []byte { - file_geyser_proto_rawDescOnce.Do(func() { - file_geyser_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_geyser_proto_rawDesc), len(file_geyser_proto_rawDesc))) - }) - return file_geyser_proto_rawDescData -} - -var file_geyser_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_geyser_proto_msgTypes = make([]protoimpl.MessageInfo, 43) -var file_geyser_proto_goTypes = []any{ - (CommitmentLevel)(0), // 0: geyser.CommitmentLevel - (SlotStatus)(0), // 1: geyser.SlotStatus - (*SubscribeRequest)(nil), // 2: geyser.SubscribeRequest - (*SubscribeRequestFilterAccounts)(nil), // 3: geyser.SubscribeRequestFilterAccounts - (*SubscribeRequestFilterAccountsFilter)(nil), // 4: geyser.SubscribeRequestFilterAccountsFilter - (*SubscribeRequestFilterAccountsFilterMemcmp)(nil), // 5: geyser.SubscribeRequestFilterAccountsFilterMemcmp - (*SubscribeRequestFilterAccountsFilterLamports)(nil), // 6: geyser.SubscribeRequestFilterAccountsFilterLamports - (*SubscribeRequestFilterSlots)(nil), // 7: geyser.SubscribeRequestFilterSlots - (*SubscribeRequestFilterTransactions)(nil), // 8: geyser.SubscribeRequestFilterTransactions - (*SubscribeRequestFilterBlocks)(nil), // 9: geyser.SubscribeRequestFilterBlocks - (*SubscribeRequestFilterBlocksMeta)(nil), // 10: geyser.SubscribeRequestFilterBlocksMeta - (*SubscribeRequestFilterEntry)(nil), // 11: geyser.SubscribeRequestFilterEntry - (*SubscribeRequestAccountsDataSlice)(nil), // 12: geyser.SubscribeRequestAccountsDataSlice - (*SubscribeRequestPing)(nil), // 13: geyser.SubscribeRequestPing - (*SubscribeUpdate)(nil), // 14: geyser.SubscribeUpdate - (*SubscribeUpdateAccount)(nil), // 15: geyser.SubscribeUpdateAccount - (*SubscribeUpdateAccountInfo)(nil), // 16: geyser.SubscribeUpdateAccountInfo - (*SubscribeUpdateSlot)(nil), // 17: geyser.SubscribeUpdateSlot - (*SubscribeUpdateTransaction)(nil), // 18: geyser.SubscribeUpdateTransaction - (*SubscribeUpdateTransactionInfo)(nil), // 19: geyser.SubscribeUpdateTransactionInfo - (*SubscribeUpdateTransactionStatus)(nil), // 20: geyser.SubscribeUpdateTransactionStatus - (*SubscribeUpdateBlock)(nil), // 21: geyser.SubscribeUpdateBlock - (*SubscribeUpdateBlockMeta)(nil), // 22: geyser.SubscribeUpdateBlockMeta - (*SubscribeUpdateEntry)(nil), // 23: geyser.SubscribeUpdateEntry - (*SubscribeUpdatePing)(nil), // 24: geyser.SubscribeUpdatePing - (*SubscribeUpdatePong)(nil), // 25: geyser.SubscribeUpdatePong - (*PingRequest)(nil), // 26: geyser.PingRequest - (*PongResponse)(nil), // 27: geyser.PongResponse - (*GetLatestBlockhashRequest)(nil), // 28: geyser.GetLatestBlockhashRequest - (*GetLatestBlockhashResponse)(nil), // 29: geyser.GetLatestBlockhashResponse - (*GetBlockHeightRequest)(nil), // 30: geyser.GetBlockHeightRequest - (*GetBlockHeightResponse)(nil), // 31: geyser.GetBlockHeightResponse - (*GetSlotRequest)(nil), // 32: geyser.GetSlotRequest - (*GetSlotResponse)(nil), // 33: geyser.GetSlotResponse - (*GetVersionRequest)(nil), // 34: geyser.GetVersionRequest - (*GetVersionResponse)(nil), // 35: geyser.GetVersionResponse - (*IsBlockhashValidRequest)(nil), // 36: geyser.IsBlockhashValidRequest - (*IsBlockhashValidResponse)(nil), // 37: geyser.IsBlockhashValidResponse - nil, // 38: geyser.SubscribeRequest.AccountsEntry - nil, // 39: geyser.SubscribeRequest.SlotsEntry - nil, // 40: geyser.SubscribeRequest.TransactionsEntry - nil, // 41: geyser.SubscribeRequest.TransactionsStatusEntry - nil, // 42: geyser.SubscribeRequest.BlocksEntry - nil, // 43: geyser.SubscribeRequest.BlocksMetaEntry - nil, // 44: geyser.SubscribeRequest.EntryEntry - (*timestamppb.Timestamp)(nil), // 45: google.protobuf.Timestamp - (*Transaction)(nil), // 46: solana.storage.ConfirmedBlock.Transaction - (*TransactionStatusMeta)(nil), // 47: solana.storage.ConfirmedBlock.TransactionStatusMeta - (*TransactionError)(nil), // 48: solana.storage.ConfirmedBlock.TransactionError - (*Rewards)(nil), // 49: solana.storage.ConfirmedBlock.Rewards - (*UnixTimestamp)(nil), // 50: solana.storage.ConfirmedBlock.UnixTimestamp - (*BlockHeight)(nil), // 51: solana.storage.ConfirmedBlock.BlockHeight -} -var file_geyser_proto_depIdxs = []int32{ - 38, // 0: geyser.SubscribeRequest.accounts:type_name -> geyser.SubscribeRequest.AccountsEntry - 39, // 1: geyser.SubscribeRequest.slots:type_name -> geyser.SubscribeRequest.SlotsEntry - 40, // 2: geyser.SubscribeRequest.transactions:type_name -> geyser.SubscribeRequest.TransactionsEntry - 41, // 3: geyser.SubscribeRequest.transactions_status:type_name -> geyser.SubscribeRequest.TransactionsStatusEntry - 42, // 4: geyser.SubscribeRequest.blocks:type_name -> geyser.SubscribeRequest.BlocksEntry - 43, // 5: geyser.SubscribeRequest.blocks_meta:type_name -> geyser.SubscribeRequest.BlocksMetaEntry - 44, // 6: geyser.SubscribeRequest.entry:type_name -> geyser.SubscribeRequest.EntryEntry - 0, // 7: geyser.SubscribeRequest.commitment:type_name -> geyser.CommitmentLevel - 12, // 8: geyser.SubscribeRequest.accounts_data_slice:type_name -> geyser.SubscribeRequestAccountsDataSlice - 13, // 9: geyser.SubscribeRequest.ping:type_name -> geyser.SubscribeRequestPing - 4, // 10: geyser.SubscribeRequestFilterAccounts.filters:type_name -> geyser.SubscribeRequestFilterAccountsFilter - 5, // 11: geyser.SubscribeRequestFilterAccountsFilter.memcmp:type_name -> geyser.SubscribeRequestFilterAccountsFilterMemcmp - 6, // 12: geyser.SubscribeRequestFilterAccountsFilter.lamports:type_name -> geyser.SubscribeRequestFilterAccountsFilterLamports - 15, // 13: geyser.SubscribeUpdate.account:type_name -> geyser.SubscribeUpdateAccount - 17, // 14: geyser.SubscribeUpdate.slot:type_name -> geyser.SubscribeUpdateSlot - 18, // 15: geyser.SubscribeUpdate.transaction:type_name -> geyser.SubscribeUpdateTransaction - 20, // 16: geyser.SubscribeUpdate.transaction_status:type_name -> geyser.SubscribeUpdateTransactionStatus - 21, // 17: geyser.SubscribeUpdate.block:type_name -> geyser.SubscribeUpdateBlock - 24, // 18: geyser.SubscribeUpdate.ping:type_name -> geyser.SubscribeUpdatePing - 25, // 19: geyser.SubscribeUpdate.pong:type_name -> geyser.SubscribeUpdatePong - 22, // 20: geyser.SubscribeUpdate.block_meta:type_name -> geyser.SubscribeUpdateBlockMeta - 23, // 21: geyser.SubscribeUpdate.entry:type_name -> geyser.SubscribeUpdateEntry - 45, // 22: geyser.SubscribeUpdate.created_at:type_name -> google.protobuf.Timestamp - 16, // 23: geyser.SubscribeUpdateAccount.account:type_name -> geyser.SubscribeUpdateAccountInfo - 1, // 24: geyser.SubscribeUpdateSlot.status:type_name -> geyser.SlotStatus - 19, // 25: geyser.SubscribeUpdateTransaction.transaction:type_name -> geyser.SubscribeUpdateTransactionInfo - 46, // 26: geyser.SubscribeUpdateTransactionInfo.transaction:type_name -> solana.storage.ConfirmedBlock.Transaction - 47, // 27: geyser.SubscribeUpdateTransactionInfo.meta:type_name -> solana.storage.ConfirmedBlock.TransactionStatusMeta - 48, // 28: geyser.SubscribeUpdateTransactionStatus.err:type_name -> solana.storage.ConfirmedBlock.TransactionError - 49, // 29: geyser.SubscribeUpdateBlock.rewards:type_name -> solana.storage.ConfirmedBlock.Rewards - 50, // 30: geyser.SubscribeUpdateBlock.block_time:type_name -> solana.storage.ConfirmedBlock.UnixTimestamp - 51, // 31: geyser.SubscribeUpdateBlock.block_height:type_name -> solana.storage.ConfirmedBlock.BlockHeight - 19, // 32: geyser.SubscribeUpdateBlock.transactions:type_name -> geyser.SubscribeUpdateTransactionInfo - 16, // 33: geyser.SubscribeUpdateBlock.accounts:type_name -> geyser.SubscribeUpdateAccountInfo - 23, // 34: geyser.SubscribeUpdateBlock.entries:type_name -> geyser.SubscribeUpdateEntry - 49, // 35: geyser.SubscribeUpdateBlockMeta.rewards:type_name -> solana.storage.ConfirmedBlock.Rewards - 50, // 36: geyser.SubscribeUpdateBlockMeta.block_time:type_name -> solana.storage.ConfirmedBlock.UnixTimestamp - 51, // 37: geyser.SubscribeUpdateBlockMeta.block_height:type_name -> solana.storage.ConfirmedBlock.BlockHeight - 0, // 38: geyser.GetLatestBlockhashRequest.commitment:type_name -> geyser.CommitmentLevel - 0, // 39: geyser.GetBlockHeightRequest.commitment:type_name -> geyser.CommitmentLevel - 0, // 40: geyser.GetSlotRequest.commitment:type_name -> geyser.CommitmentLevel - 0, // 41: geyser.IsBlockhashValidRequest.commitment:type_name -> geyser.CommitmentLevel - 3, // 42: geyser.SubscribeRequest.AccountsEntry.value:type_name -> geyser.SubscribeRequestFilterAccounts - 7, // 43: geyser.SubscribeRequest.SlotsEntry.value:type_name -> geyser.SubscribeRequestFilterSlots - 8, // 44: geyser.SubscribeRequest.TransactionsEntry.value:type_name -> geyser.SubscribeRequestFilterTransactions - 8, // 45: geyser.SubscribeRequest.TransactionsStatusEntry.value:type_name -> geyser.SubscribeRequestFilterTransactions - 9, // 46: geyser.SubscribeRequest.BlocksEntry.value:type_name -> geyser.SubscribeRequestFilterBlocks - 10, // 47: geyser.SubscribeRequest.BlocksMetaEntry.value:type_name -> geyser.SubscribeRequestFilterBlocksMeta - 11, // 48: geyser.SubscribeRequest.EntryEntry.value:type_name -> geyser.SubscribeRequestFilterEntry - 2, // 49: geyser.Geyser.Subscribe:input_type -> geyser.SubscribeRequest - 26, // 50: geyser.Geyser.Ping:input_type -> geyser.PingRequest - 28, // 51: geyser.Geyser.GetLatestBlockhash:input_type -> geyser.GetLatestBlockhashRequest - 30, // 52: geyser.Geyser.GetBlockHeight:input_type -> geyser.GetBlockHeightRequest - 32, // 53: geyser.Geyser.GetSlot:input_type -> geyser.GetSlotRequest - 36, // 54: geyser.Geyser.IsBlockhashValid:input_type -> geyser.IsBlockhashValidRequest - 34, // 55: geyser.Geyser.GetVersion:input_type -> geyser.GetVersionRequest - 14, // 56: geyser.Geyser.Subscribe:output_type -> geyser.SubscribeUpdate - 27, // 57: geyser.Geyser.Ping:output_type -> geyser.PongResponse - 29, // 58: geyser.Geyser.GetLatestBlockhash:output_type -> geyser.GetLatestBlockhashResponse - 31, // 59: geyser.Geyser.GetBlockHeight:output_type -> geyser.GetBlockHeightResponse - 33, // 60: geyser.Geyser.GetSlot:output_type -> geyser.GetSlotResponse - 37, // 61: geyser.Geyser.IsBlockhashValid:output_type -> geyser.IsBlockhashValidResponse - 35, // 62: geyser.Geyser.GetVersion:output_type -> geyser.GetVersionResponse - 56, // [56:63] is the sub-list for method output_type - 49, // [49:56] is the sub-list for method input_type - 49, // [49:49] is the sub-list for extension type_name - 49, // [49:49] is the sub-list for extension extendee - 0, // [0:49] is the sub-list for field type_name -} - -func init() { file_geyser_proto_init() } -func file_geyser_proto_init() { - if File_geyser_proto != nil { - return - } - file_solana_storage_proto_init() - file_geyser_proto_msgTypes[0].OneofWrappers = []any{} - file_geyser_proto_msgTypes[1].OneofWrappers = []any{} - file_geyser_proto_msgTypes[2].OneofWrappers = []any{ - (*SubscribeRequestFilterAccountsFilter_Memcmp)(nil), - (*SubscribeRequestFilterAccountsFilter_Datasize)(nil), - (*SubscribeRequestFilterAccountsFilter_TokenAccountState)(nil), - (*SubscribeRequestFilterAccountsFilter_Lamports)(nil), - } - file_geyser_proto_msgTypes[3].OneofWrappers = []any{ - (*SubscribeRequestFilterAccountsFilterMemcmp_Bytes)(nil), - (*SubscribeRequestFilterAccountsFilterMemcmp_Base58)(nil), - (*SubscribeRequestFilterAccountsFilterMemcmp_Base64)(nil), - } - file_geyser_proto_msgTypes[4].OneofWrappers = []any{ - (*SubscribeRequestFilterAccountsFilterLamports_Eq)(nil), - (*SubscribeRequestFilterAccountsFilterLamports_Ne)(nil), - (*SubscribeRequestFilterAccountsFilterLamports_Lt)(nil), - (*SubscribeRequestFilterAccountsFilterLamports_Gt)(nil), - } - file_geyser_proto_msgTypes[5].OneofWrappers = []any{} - file_geyser_proto_msgTypes[6].OneofWrappers = []any{} - file_geyser_proto_msgTypes[7].OneofWrappers = []any{} - file_geyser_proto_msgTypes[12].OneofWrappers = []any{ - (*SubscribeUpdate_Account)(nil), - (*SubscribeUpdate_Slot)(nil), - (*SubscribeUpdate_Transaction)(nil), - (*SubscribeUpdate_TransactionStatus)(nil), - (*SubscribeUpdate_Block)(nil), - (*SubscribeUpdate_Ping)(nil), - (*SubscribeUpdate_Pong)(nil), - (*SubscribeUpdate_BlockMeta)(nil), - (*SubscribeUpdate_Entry)(nil), - } - file_geyser_proto_msgTypes[14].OneofWrappers = []any{} - file_geyser_proto_msgTypes[15].OneofWrappers = []any{} - file_geyser_proto_msgTypes[26].OneofWrappers = []any{} - file_geyser_proto_msgTypes[28].OneofWrappers = []any{} - file_geyser_proto_msgTypes[30].OneofWrappers = []any{} - file_geyser_proto_msgTypes[34].OneofWrappers = []any{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_geyser_proto_rawDesc), len(file_geyser_proto_rawDesc)), - NumEnums: 2, - NumMessages: 43, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_geyser_proto_goTypes, - DependencyIndexes: file_geyser_proto_depIdxs, - EnumInfos: file_geyser_proto_enumTypes, - MessageInfos: file_geyser_proto_msgTypes, - }.Build() - File_geyser_proto = out.File - file_geyser_proto_goTypes = nil - file_geyser_proto_depIdxs = nil -} diff --git a/internal/example/geyser/proto/geyser.proto b/internal/example/geyser/proto/geyser.proto deleted file mode 100644 index 88d193b..0000000 --- a/internal/example/geyser/proto/geyser.proto +++ /dev/null @@ -1,272 +0,0 @@ -syntax = "proto3"; - -import "google/protobuf/timestamp.proto"; -import public "solana-storage.proto"; - -option go_package = "github.com/rpcpool/yellowstone-grpc/examples/golang/proto"; - -package geyser; - -service Geyser { - rpc Subscribe(stream SubscribeRequest) returns (stream SubscribeUpdate) {} - rpc Ping(PingRequest) returns (PongResponse) {} - rpc GetLatestBlockhash(GetLatestBlockhashRequest) returns (GetLatestBlockhashResponse) {} - rpc GetBlockHeight(GetBlockHeightRequest) returns (GetBlockHeightResponse) {} - rpc GetSlot(GetSlotRequest) returns (GetSlotResponse) {} - rpc IsBlockhashValid(IsBlockhashValidRequest) returns (IsBlockhashValidResponse) {} - rpc GetVersion(GetVersionRequest) returns (GetVersionResponse) {} -} - -enum CommitmentLevel { - PROCESSED = 0; - CONFIRMED = 1; - FINALIZED = 2; -} - -enum SlotStatus { - SLOT_PROCESSED = 0; - SLOT_CONFIRMED = 1; - SLOT_FINALIZED = 2; - SLOT_FIRST_SHRED_RECEIVED = 3; - SLOT_COMPLETED = 4; - SLOT_CREATED_BANK = 5; - SLOT_DEAD = 6; -} - -message SubscribeRequest { - map accounts = 1; - map slots = 2; - map transactions = 3; - map transactions_status = 10; - map blocks = 4; - map blocks_meta = 5; - map entry = 8; - optional CommitmentLevel commitment = 6; - repeated SubscribeRequestAccountsDataSlice accounts_data_slice = 7; - optional SubscribeRequestPing ping = 9; - optional uint64 from_slot = 11; -} - -message SubscribeRequestFilterAccounts { - repeated string account = 2; - repeated string owner = 3; - repeated SubscribeRequestFilterAccountsFilter filters = 4; - optional bool nonempty_txn_signature = 5; -} - -message SubscribeRequestFilterAccountsFilter { - oneof filter { - SubscribeRequestFilterAccountsFilterMemcmp memcmp = 1; - uint64 datasize = 2; - bool token_account_state = 3; - SubscribeRequestFilterAccountsFilterLamports lamports = 4; - } -} - -message SubscribeRequestFilterAccountsFilterMemcmp { - uint64 offset = 1; - oneof data { - bytes bytes = 2; - string base58 = 3; - string base64 = 4; - } -} - -message SubscribeRequestFilterAccountsFilterLamports { - oneof cmp { - uint64 eq = 1; - uint64 ne = 2; - uint64 lt = 3; - uint64 gt = 4; - } -} - -message SubscribeRequestFilterSlots { - optional bool filter_by_commitment = 1; - optional bool interslot_updates = 2; -} - -message SubscribeRequestFilterTransactions { - optional bool vote = 1; - optional bool failed = 2; - optional string signature = 5; - repeated string account_include = 3; - repeated string account_exclude = 4; - repeated string account_required = 6; -} - -message SubscribeRequestFilterBlocks { - repeated string account_include = 1; - optional bool include_transactions = 2; - optional bool include_accounts = 3; - optional bool include_entries = 4; -} - -message SubscribeRequestFilterBlocksMeta {} - -message SubscribeRequestFilterEntry {} - -message SubscribeRequestAccountsDataSlice { - uint64 offset = 1; - uint64 length = 2; -} - -message SubscribeRequestPing { - int32 id = 1; -} - -message SubscribeUpdate { - repeated string filters = 1; - oneof update_oneof { - SubscribeUpdateAccount account = 2; - SubscribeUpdateSlot slot = 3; - SubscribeUpdateTransaction transaction = 4; - SubscribeUpdateTransactionStatus transaction_status = 10; - SubscribeUpdateBlock block = 5; - SubscribeUpdatePing ping = 6; - SubscribeUpdatePong pong = 9; - SubscribeUpdateBlockMeta block_meta = 7; - SubscribeUpdateEntry entry = 8; - } - google.protobuf.Timestamp created_at = 11; -} - -message SubscribeUpdateAccount { - SubscribeUpdateAccountInfo account = 1; - uint64 slot = 2; - bool is_startup = 3; -} - -message SubscribeUpdateAccountInfo { - bytes pubkey = 1; - uint64 lamports = 2; - bytes owner = 3; - bool executable = 4; - uint64 rent_epoch = 5; - bytes data = 6; - uint64 write_version = 7; - optional bytes txn_signature = 8; -} - -message SubscribeUpdateSlot { - uint64 slot = 1; - optional uint64 parent = 2; - SlotStatus status = 3; - optional string dead_error = 4; -} - -message SubscribeUpdateTransaction { - SubscribeUpdateTransactionInfo transaction = 1; - uint64 slot = 2; -} - -message SubscribeUpdateTransactionInfo { - bytes signature = 1; - bool is_vote = 2; - solana.storage.ConfirmedBlock.Transaction transaction = 3; - solana.storage.ConfirmedBlock.TransactionStatusMeta meta = 4; - uint64 index = 5; -} - -message SubscribeUpdateTransactionStatus { - uint64 slot = 1; - bytes signature = 2; - bool is_vote = 3; - uint64 index = 4; - solana.storage.ConfirmedBlock.TransactionError err = 5; -} - -message SubscribeUpdateBlock { - uint64 slot = 1; - string blockhash = 2; - solana.storage.ConfirmedBlock.Rewards rewards = 3; - solana.storage.ConfirmedBlock.UnixTimestamp block_time = 4; - solana.storage.ConfirmedBlock.BlockHeight block_height = 5; - uint64 parent_slot = 7; - string parent_blockhash = 8; - uint64 executed_transaction_count = 9; - repeated SubscribeUpdateTransactionInfo transactions = 6; - uint64 updated_account_count = 10; - repeated SubscribeUpdateAccountInfo accounts = 11; - uint64 entries_count = 12; - repeated SubscribeUpdateEntry entries = 13; -} - -message SubscribeUpdateBlockMeta { - uint64 slot = 1; - string blockhash = 2; - solana.storage.ConfirmedBlock.Rewards rewards = 3; - solana.storage.ConfirmedBlock.UnixTimestamp block_time = 4; - solana.storage.ConfirmedBlock.BlockHeight block_height = 5; - uint64 parent_slot = 6; - string parent_blockhash = 7; - uint64 executed_transaction_count = 8; - uint64 entries_count = 9; -} - -message SubscribeUpdateEntry { - uint64 slot = 1; - uint64 index = 2; - uint64 num_hashes = 3; - bytes hash = 4; - uint64 executed_transaction_count = 5; - uint64 starting_transaction_index = 6; // added in v1.18, for solana 1.17 value is always 0 -} - -message SubscribeUpdatePing {} - -message SubscribeUpdatePong { - int32 id = 1; -} - -// non-streaming methods - -message PingRequest { - int32 count = 1; -} - -message PongResponse { - int32 count = 1; -} - -message GetLatestBlockhashRequest { - optional CommitmentLevel commitment = 1; -} - -message GetLatestBlockhashResponse { - uint64 slot = 1; - string blockhash = 2; - uint64 last_valid_block_height = 3; -} - -message GetBlockHeightRequest { - optional CommitmentLevel commitment = 1; -} - -message GetBlockHeightResponse { - uint64 block_height = 1; -} - -message GetSlotRequest { - optional CommitmentLevel commitment = 1; -} - -message GetSlotResponse { - uint64 slot = 1; -} - -message GetVersionRequest {} - -message GetVersionResponse { - string version = 1; -} - -message IsBlockhashValidRequest { - string blockhash = 1; - optional CommitmentLevel commitment = 2; -} - -message IsBlockhashValidResponse { - uint64 slot = 1; - bool valid = 2; -} \ No newline at end of file diff --git a/internal/example/geyser/proto/geyser_grpc.pb.go b/internal/example/geyser/proto/geyser_grpc.pb.go deleted file mode 100644 index 817af88..0000000 --- a/internal/example/geyser/proto/geyser_grpc.pb.go +++ /dev/null @@ -1,345 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.5.1 -// - protoc v5.29.3 -// source: geyser.proto - -package proto - -import ( - context "context" - - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - Geyser_Subscribe_FullMethodName = "/geyser.Geyser/Subscribe" - Geyser_Ping_FullMethodName = "/geyser.Geyser/Ping" - Geyser_GetLatestBlockhash_FullMethodName = "/geyser.Geyser/GetLatestBlockhash" - Geyser_GetBlockHeight_FullMethodName = "/geyser.Geyser/GetBlockHeight" - Geyser_GetSlot_FullMethodName = "/geyser.Geyser/GetSlot" - Geyser_IsBlockhashValid_FullMethodName = "/geyser.Geyser/IsBlockhashValid" - Geyser_GetVersion_FullMethodName = "/geyser.Geyser/GetVersion" -) - -// GeyserClient is the client API for Geyser service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type GeyserClient interface { - Subscribe(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[SubscribeRequest, SubscribeUpdate], error) - Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PongResponse, error) - GetLatestBlockhash(ctx context.Context, in *GetLatestBlockhashRequest, opts ...grpc.CallOption) (*GetLatestBlockhashResponse, error) - GetBlockHeight(ctx context.Context, in *GetBlockHeightRequest, opts ...grpc.CallOption) (*GetBlockHeightResponse, error) - GetSlot(ctx context.Context, in *GetSlotRequest, opts ...grpc.CallOption) (*GetSlotResponse, error) - IsBlockhashValid(ctx context.Context, in *IsBlockhashValidRequest, opts ...grpc.CallOption) (*IsBlockhashValidResponse, error) - GetVersion(ctx context.Context, in *GetVersionRequest, opts ...grpc.CallOption) (*GetVersionResponse, error) -} - -type geyserClient struct { - cc grpc.ClientConnInterface -} - -func NewGeyserClient(cc grpc.ClientConnInterface) GeyserClient { - return &geyserClient{cc} -} - -func (c *geyserClient) Subscribe(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[SubscribeRequest, SubscribeUpdate], error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - stream, err := c.cc.NewStream(ctx, &Geyser_ServiceDesc.Streams[0], Geyser_Subscribe_FullMethodName, cOpts...) - if err != nil { - return nil, err - } - x := &grpc.GenericClientStream[SubscribeRequest, SubscribeUpdate]{ClientStream: stream} - return x, nil -} - -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type Geyser_SubscribeClient = grpc.BidiStreamingClient[SubscribeRequest, SubscribeUpdate] - -func (c *geyserClient) Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PongResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(PongResponse) - err := c.cc.Invoke(ctx, Geyser_Ping_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *geyserClient) GetLatestBlockhash(ctx context.Context, in *GetLatestBlockhashRequest, opts ...grpc.CallOption) (*GetLatestBlockhashResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetLatestBlockhashResponse) - err := c.cc.Invoke(ctx, Geyser_GetLatestBlockhash_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *geyserClient) GetBlockHeight(ctx context.Context, in *GetBlockHeightRequest, opts ...grpc.CallOption) (*GetBlockHeightResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetBlockHeightResponse) - err := c.cc.Invoke(ctx, Geyser_GetBlockHeight_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *geyserClient) GetSlot(ctx context.Context, in *GetSlotRequest, opts ...grpc.CallOption) (*GetSlotResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetSlotResponse) - err := c.cc.Invoke(ctx, Geyser_GetSlot_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *geyserClient) IsBlockhashValid(ctx context.Context, in *IsBlockhashValidRequest, opts ...grpc.CallOption) (*IsBlockhashValidResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(IsBlockhashValidResponse) - err := c.cc.Invoke(ctx, Geyser_IsBlockhashValid_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *geyserClient) GetVersion(ctx context.Context, in *GetVersionRequest, opts ...grpc.CallOption) (*GetVersionResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetVersionResponse) - err := c.cc.Invoke(ctx, Geyser_GetVersion_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// GeyserServer is the server API for Geyser service. -// All implementations must embed UnimplementedGeyserServer -// for forward compatibility. -type GeyserServer interface { - Subscribe(grpc.BidiStreamingServer[SubscribeRequest, SubscribeUpdate]) error - Ping(context.Context, *PingRequest) (*PongResponse, error) - GetLatestBlockhash(context.Context, *GetLatestBlockhashRequest) (*GetLatestBlockhashResponse, error) - GetBlockHeight(context.Context, *GetBlockHeightRequest) (*GetBlockHeightResponse, error) - GetSlot(context.Context, *GetSlotRequest) (*GetSlotResponse, error) - IsBlockhashValid(context.Context, *IsBlockhashValidRequest) (*IsBlockhashValidResponse, error) - GetVersion(context.Context, *GetVersionRequest) (*GetVersionResponse, error) - mustEmbedUnimplementedGeyserServer() -} - -// UnimplementedGeyserServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedGeyserServer struct{} - -func (UnimplementedGeyserServer) Subscribe(grpc.BidiStreamingServer[SubscribeRequest, SubscribeUpdate]) error { - return status.Errorf(codes.Unimplemented, "method Subscribe not implemented") -} -func (UnimplementedGeyserServer) Ping(context.Context, *PingRequest) (*PongResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented") -} -func (UnimplementedGeyserServer) GetLatestBlockhash(context.Context, *GetLatestBlockhashRequest) (*GetLatestBlockhashResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetLatestBlockhash not implemented") -} -func (UnimplementedGeyserServer) GetBlockHeight(context.Context, *GetBlockHeightRequest) (*GetBlockHeightResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetBlockHeight not implemented") -} -func (UnimplementedGeyserServer) GetSlot(context.Context, *GetSlotRequest) (*GetSlotResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetSlot not implemented") -} -func (UnimplementedGeyserServer) IsBlockhashValid(context.Context, *IsBlockhashValidRequest) (*IsBlockhashValidResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method IsBlockhashValid not implemented") -} -func (UnimplementedGeyserServer) GetVersion(context.Context, *GetVersionRequest) (*GetVersionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetVersion not implemented") -} -func (UnimplementedGeyserServer) mustEmbedUnimplementedGeyserServer() {} -func (UnimplementedGeyserServer) testEmbeddedByValue() {} - -// UnsafeGeyserServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to GeyserServer will -// result in compilation errors. -type UnsafeGeyserServer interface { - mustEmbedUnimplementedGeyserServer() -} - -func RegisterGeyserServer(s grpc.ServiceRegistrar, srv GeyserServer) { - // If the following call pancis, it indicates UnimplementedGeyserServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&Geyser_ServiceDesc, srv) -} - -func _Geyser_Subscribe_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(GeyserServer).Subscribe(&grpc.GenericServerStream[SubscribeRequest, SubscribeUpdate]{ServerStream: stream}) -} - -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type Geyser_SubscribeServer = grpc.BidiStreamingServer[SubscribeRequest, SubscribeUpdate] - -func _Geyser_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PingRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(GeyserServer).Ping(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Geyser_Ping_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GeyserServer).Ping(ctx, req.(*PingRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Geyser_GetLatestBlockhash_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetLatestBlockhashRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(GeyserServer).GetLatestBlockhash(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Geyser_GetLatestBlockhash_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GeyserServer).GetLatestBlockhash(ctx, req.(*GetLatestBlockhashRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Geyser_GetBlockHeight_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetBlockHeightRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(GeyserServer).GetBlockHeight(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Geyser_GetBlockHeight_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GeyserServer).GetBlockHeight(ctx, req.(*GetBlockHeightRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Geyser_GetSlot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetSlotRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(GeyserServer).GetSlot(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Geyser_GetSlot_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GeyserServer).GetSlot(ctx, req.(*GetSlotRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Geyser_IsBlockhashValid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(IsBlockhashValidRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(GeyserServer).IsBlockhashValid(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Geyser_IsBlockhashValid_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GeyserServer).IsBlockhashValid(ctx, req.(*IsBlockhashValidRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Geyser_GetVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetVersionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(GeyserServer).GetVersion(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Geyser_GetVersion_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GeyserServer).GetVersion(ctx, req.(*GetVersionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Geyser_ServiceDesc is the grpc.ServiceDesc for Geyser service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Geyser_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "geyser.Geyser", - HandlerType: (*GeyserServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Ping", - Handler: _Geyser_Ping_Handler, - }, - { - MethodName: "GetLatestBlockhash", - Handler: _Geyser_GetLatestBlockhash_Handler, - }, - { - MethodName: "GetBlockHeight", - Handler: _Geyser_GetBlockHeight_Handler, - }, - { - MethodName: "GetSlot", - Handler: _Geyser_GetSlot_Handler, - }, - { - MethodName: "IsBlockhashValid", - Handler: _Geyser_IsBlockhashValid_Handler, - }, - { - MethodName: "GetVersion", - Handler: _Geyser_GetVersion_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "Subscribe", - Handler: _Geyser_Subscribe_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "geyser.proto", -} diff --git a/internal/example/geyser/proto/solana-storage.pb.go b/internal/example/geyser/proto/solana-storage.pb.go deleted file mode 100644 index b2d7e36..0000000 --- a/internal/example/geyser/proto/solana-storage.pb.go +++ /dev/null @@ -1,1548 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.6 -// protoc v5.29.3 -// source: solana-storage.proto - -package proto - -import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type RewardType int32 - -const ( - RewardType_Unspecified RewardType = 0 - RewardType_Fee RewardType = 1 - RewardType_Rent RewardType = 2 - RewardType_Staking RewardType = 3 - RewardType_Voting RewardType = 4 -) - -// Enum value maps for RewardType. -var ( - RewardType_name = map[int32]string{ - 0: "Unspecified", - 1: "Fee", - 2: "Rent", - 3: "Staking", - 4: "Voting", - } - RewardType_value = map[string]int32{ - "Unspecified": 0, - "Fee": 1, - "Rent": 2, - "Staking": 3, - "Voting": 4, - } -) - -func (x RewardType) Enum() *RewardType { - p := new(RewardType) - *p = x - return p -} - -func (x RewardType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (RewardType) Descriptor() protoreflect.EnumDescriptor { - return file_solana_storage_proto_enumTypes[0].Descriptor() -} - -func (RewardType) Type() protoreflect.EnumType { - return &file_solana_storage_proto_enumTypes[0] -} - -func (x RewardType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use RewardType.Descriptor instead. -func (RewardType) EnumDescriptor() ([]byte, []int) { - return file_solana_storage_proto_rawDescGZIP(), []int{0} -} - -type ConfirmedBlock struct { - state protoimpl.MessageState `protogen:"open.v1"` - PreviousBlockhash string `protobuf:"bytes,1,opt,name=previous_blockhash,json=previousBlockhash,proto3" json:"previous_blockhash,omitempty"` - Blockhash string `protobuf:"bytes,2,opt,name=blockhash,proto3" json:"blockhash,omitempty"` - ParentSlot uint64 `protobuf:"varint,3,opt,name=parent_slot,json=parentSlot,proto3" json:"parent_slot,omitempty"` - Transactions []*ConfirmedTransaction `protobuf:"bytes,4,rep,name=transactions,proto3" json:"transactions,omitempty"` - Rewards []*Reward `protobuf:"bytes,5,rep,name=rewards,proto3" json:"rewards,omitempty"` - BlockTime *UnixTimestamp `protobuf:"bytes,6,opt,name=block_time,json=blockTime,proto3" json:"block_time,omitempty"` - BlockHeight *BlockHeight `protobuf:"bytes,7,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` - NumPartitions *NumPartitions `protobuf:"bytes,8,opt,name=num_partitions,json=numPartitions,proto3" json:"num_partitions,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ConfirmedBlock) Reset() { - *x = ConfirmedBlock{} - mi := &file_solana_storage_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ConfirmedBlock) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ConfirmedBlock) ProtoMessage() {} - -func (x *ConfirmedBlock) ProtoReflect() protoreflect.Message { - mi := &file_solana_storage_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ConfirmedBlock.ProtoReflect.Descriptor instead. -func (*ConfirmedBlock) Descriptor() ([]byte, []int) { - return file_solana_storage_proto_rawDescGZIP(), []int{0} -} - -func (x *ConfirmedBlock) GetPreviousBlockhash() string { - if x != nil { - return x.PreviousBlockhash - } - return "" -} - -func (x *ConfirmedBlock) GetBlockhash() string { - if x != nil { - return x.Blockhash - } - return "" -} - -func (x *ConfirmedBlock) GetParentSlot() uint64 { - if x != nil { - return x.ParentSlot - } - return 0 -} - -func (x *ConfirmedBlock) GetTransactions() []*ConfirmedTransaction { - if x != nil { - return x.Transactions - } - return nil -} - -func (x *ConfirmedBlock) GetRewards() []*Reward { - if x != nil { - return x.Rewards - } - return nil -} - -func (x *ConfirmedBlock) GetBlockTime() *UnixTimestamp { - if x != nil { - return x.BlockTime - } - return nil -} - -func (x *ConfirmedBlock) GetBlockHeight() *BlockHeight { - if x != nil { - return x.BlockHeight - } - return nil -} - -func (x *ConfirmedBlock) GetNumPartitions() *NumPartitions { - if x != nil { - return x.NumPartitions - } - return nil -} - -type ConfirmedTransaction struct { - state protoimpl.MessageState `protogen:"open.v1"` - Transaction *Transaction `protobuf:"bytes,1,opt,name=transaction,proto3" json:"transaction,omitempty"` - Meta *TransactionStatusMeta `protobuf:"bytes,2,opt,name=meta,proto3" json:"meta,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ConfirmedTransaction) Reset() { - *x = ConfirmedTransaction{} - mi := &file_solana_storage_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ConfirmedTransaction) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ConfirmedTransaction) ProtoMessage() {} - -func (x *ConfirmedTransaction) ProtoReflect() protoreflect.Message { - mi := &file_solana_storage_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ConfirmedTransaction.ProtoReflect.Descriptor instead. -func (*ConfirmedTransaction) Descriptor() ([]byte, []int) { - return file_solana_storage_proto_rawDescGZIP(), []int{1} -} - -func (x *ConfirmedTransaction) GetTransaction() *Transaction { - if x != nil { - return x.Transaction - } - return nil -} - -func (x *ConfirmedTransaction) GetMeta() *TransactionStatusMeta { - if x != nil { - return x.Meta - } - return nil -} - -type Transaction struct { - state protoimpl.MessageState `protogen:"open.v1"` - Signatures [][]byte `protobuf:"bytes,1,rep,name=signatures,proto3" json:"signatures,omitempty"` - Message *Message `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Transaction) Reset() { - *x = Transaction{} - mi := &file_solana_storage_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Transaction) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Transaction) ProtoMessage() {} - -func (x *Transaction) ProtoReflect() protoreflect.Message { - mi := &file_solana_storage_proto_msgTypes[2] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Transaction.ProtoReflect.Descriptor instead. -func (*Transaction) Descriptor() ([]byte, []int) { - return file_solana_storage_proto_rawDescGZIP(), []int{2} -} - -func (x *Transaction) GetSignatures() [][]byte { - if x != nil { - return x.Signatures - } - return nil -} - -func (x *Transaction) GetMessage() *Message { - if x != nil { - return x.Message - } - return nil -} - -type Message struct { - state protoimpl.MessageState `protogen:"open.v1"` - Header *MessageHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - AccountKeys [][]byte `protobuf:"bytes,2,rep,name=account_keys,json=accountKeys,proto3" json:"account_keys,omitempty"` - RecentBlockhash []byte `protobuf:"bytes,3,opt,name=recent_blockhash,json=recentBlockhash,proto3" json:"recent_blockhash,omitempty"` - Instructions []*CompiledInstruction `protobuf:"bytes,4,rep,name=instructions,proto3" json:"instructions,omitempty"` - Versioned bool `protobuf:"varint,5,opt,name=versioned,proto3" json:"versioned,omitempty"` - AddressTableLookups []*MessageAddressTableLookup `protobuf:"bytes,6,rep,name=address_table_lookups,json=addressTableLookups,proto3" json:"address_table_lookups,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Message) Reset() { - *x = Message{} - mi := &file_solana_storage_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Message) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Message) ProtoMessage() {} - -func (x *Message) ProtoReflect() protoreflect.Message { - mi := &file_solana_storage_proto_msgTypes[3] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Message.ProtoReflect.Descriptor instead. -func (*Message) Descriptor() ([]byte, []int) { - return file_solana_storage_proto_rawDescGZIP(), []int{3} -} - -func (x *Message) GetHeader() *MessageHeader { - if x != nil { - return x.Header - } - return nil -} - -func (x *Message) GetAccountKeys() [][]byte { - if x != nil { - return x.AccountKeys - } - return nil -} - -func (x *Message) GetRecentBlockhash() []byte { - if x != nil { - return x.RecentBlockhash - } - return nil -} - -func (x *Message) GetInstructions() []*CompiledInstruction { - if x != nil { - return x.Instructions - } - return nil -} - -func (x *Message) GetVersioned() bool { - if x != nil { - return x.Versioned - } - return false -} - -func (x *Message) GetAddressTableLookups() []*MessageAddressTableLookup { - if x != nil { - return x.AddressTableLookups - } - return nil -} - -type MessageHeader struct { - state protoimpl.MessageState `protogen:"open.v1"` - NumRequiredSignatures uint32 `protobuf:"varint,1,opt,name=num_required_signatures,json=numRequiredSignatures,proto3" json:"num_required_signatures,omitempty"` - NumReadonlySignedAccounts uint32 `protobuf:"varint,2,opt,name=num_readonly_signed_accounts,json=numReadonlySignedAccounts,proto3" json:"num_readonly_signed_accounts,omitempty"` - NumReadonlyUnsignedAccounts uint32 `protobuf:"varint,3,opt,name=num_readonly_unsigned_accounts,json=numReadonlyUnsignedAccounts,proto3" json:"num_readonly_unsigned_accounts,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *MessageHeader) Reset() { - *x = MessageHeader{} - mi := &file_solana_storage_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *MessageHeader) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MessageHeader) ProtoMessage() {} - -func (x *MessageHeader) ProtoReflect() protoreflect.Message { - mi := &file_solana_storage_proto_msgTypes[4] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MessageHeader.ProtoReflect.Descriptor instead. -func (*MessageHeader) Descriptor() ([]byte, []int) { - return file_solana_storage_proto_rawDescGZIP(), []int{4} -} - -func (x *MessageHeader) GetNumRequiredSignatures() uint32 { - if x != nil { - return x.NumRequiredSignatures - } - return 0 -} - -func (x *MessageHeader) GetNumReadonlySignedAccounts() uint32 { - if x != nil { - return x.NumReadonlySignedAccounts - } - return 0 -} - -func (x *MessageHeader) GetNumReadonlyUnsignedAccounts() uint32 { - if x != nil { - return x.NumReadonlyUnsignedAccounts - } - return 0 -} - -type MessageAddressTableLookup struct { - state protoimpl.MessageState `protogen:"open.v1"` - AccountKey []byte `protobuf:"bytes,1,opt,name=account_key,json=accountKey,proto3" json:"account_key,omitempty"` - WritableIndexes []byte `protobuf:"bytes,2,opt,name=writable_indexes,json=writableIndexes,proto3" json:"writable_indexes,omitempty"` - ReadonlyIndexes []byte `protobuf:"bytes,3,opt,name=readonly_indexes,json=readonlyIndexes,proto3" json:"readonly_indexes,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *MessageAddressTableLookup) Reset() { - *x = MessageAddressTableLookup{} - mi := &file_solana_storage_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *MessageAddressTableLookup) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MessageAddressTableLookup) ProtoMessage() {} - -func (x *MessageAddressTableLookup) ProtoReflect() protoreflect.Message { - mi := &file_solana_storage_proto_msgTypes[5] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MessageAddressTableLookup.ProtoReflect.Descriptor instead. -func (*MessageAddressTableLookup) Descriptor() ([]byte, []int) { - return file_solana_storage_proto_rawDescGZIP(), []int{5} -} - -func (x *MessageAddressTableLookup) GetAccountKey() []byte { - if x != nil { - return x.AccountKey - } - return nil -} - -func (x *MessageAddressTableLookup) GetWritableIndexes() []byte { - if x != nil { - return x.WritableIndexes - } - return nil -} - -func (x *MessageAddressTableLookup) GetReadonlyIndexes() []byte { - if x != nil { - return x.ReadonlyIndexes - } - return nil -} - -type TransactionStatusMeta struct { - state protoimpl.MessageState `protogen:"open.v1"` - Err *TransactionError `protobuf:"bytes,1,opt,name=err,proto3" json:"err,omitempty"` - Fee uint64 `protobuf:"varint,2,opt,name=fee,proto3" json:"fee,omitempty"` - PreBalances []uint64 `protobuf:"varint,3,rep,packed,name=pre_balances,json=preBalances,proto3" json:"pre_balances,omitempty"` - PostBalances []uint64 `protobuf:"varint,4,rep,packed,name=post_balances,json=postBalances,proto3" json:"post_balances,omitempty"` - InnerInstructions []*InnerInstructions `protobuf:"bytes,5,rep,name=inner_instructions,json=innerInstructions,proto3" json:"inner_instructions,omitempty"` - InnerInstructionsNone bool `protobuf:"varint,10,opt,name=inner_instructions_none,json=innerInstructionsNone,proto3" json:"inner_instructions_none,omitempty"` - LogMessages []string `protobuf:"bytes,6,rep,name=log_messages,json=logMessages,proto3" json:"log_messages,omitempty"` - LogMessagesNone bool `protobuf:"varint,11,opt,name=log_messages_none,json=logMessagesNone,proto3" json:"log_messages_none,omitempty"` - PreTokenBalances []*TokenBalance `protobuf:"bytes,7,rep,name=pre_token_balances,json=preTokenBalances,proto3" json:"pre_token_balances,omitempty"` - PostTokenBalances []*TokenBalance `protobuf:"bytes,8,rep,name=post_token_balances,json=postTokenBalances,proto3" json:"post_token_balances,omitempty"` - Rewards []*Reward `protobuf:"bytes,9,rep,name=rewards,proto3" json:"rewards,omitempty"` - LoadedWritableAddresses [][]byte `protobuf:"bytes,12,rep,name=loaded_writable_addresses,json=loadedWritableAddresses,proto3" json:"loaded_writable_addresses,omitempty"` - LoadedReadonlyAddresses [][]byte `protobuf:"bytes,13,rep,name=loaded_readonly_addresses,json=loadedReadonlyAddresses,proto3" json:"loaded_readonly_addresses,omitempty"` - ReturnData *ReturnData `protobuf:"bytes,14,opt,name=return_data,json=returnData,proto3" json:"return_data,omitempty"` - ReturnDataNone bool `protobuf:"varint,15,opt,name=return_data_none,json=returnDataNone,proto3" json:"return_data_none,omitempty"` - // Sum of compute units consumed by all instructions. - // Available since Solana v1.10.35 / v1.11.6. - // Set to `None` for txs executed on earlier versions. - ComputeUnitsConsumed *uint64 `protobuf:"varint,16,opt,name=compute_units_consumed,json=computeUnitsConsumed,proto3,oneof" json:"compute_units_consumed,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *TransactionStatusMeta) Reset() { - *x = TransactionStatusMeta{} - mi := &file_solana_storage_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *TransactionStatusMeta) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TransactionStatusMeta) ProtoMessage() {} - -func (x *TransactionStatusMeta) ProtoReflect() protoreflect.Message { - mi := &file_solana_storage_proto_msgTypes[6] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use TransactionStatusMeta.ProtoReflect.Descriptor instead. -func (*TransactionStatusMeta) Descriptor() ([]byte, []int) { - return file_solana_storage_proto_rawDescGZIP(), []int{6} -} - -func (x *TransactionStatusMeta) GetErr() *TransactionError { - if x != nil { - return x.Err - } - return nil -} - -func (x *TransactionStatusMeta) GetFee() uint64 { - if x != nil { - return x.Fee - } - return 0 -} - -func (x *TransactionStatusMeta) GetPreBalances() []uint64 { - if x != nil { - return x.PreBalances - } - return nil -} - -func (x *TransactionStatusMeta) GetPostBalances() []uint64 { - if x != nil { - return x.PostBalances - } - return nil -} - -func (x *TransactionStatusMeta) GetInnerInstructions() []*InnerInstructions { - if x != nil { - return x.InnerInstructions - } - return nil -} - -func (x *TransactionStatusMeta) GetInnerInstructionsNone() bool { - if x != nil { - return x.InnerInstructionsNone - } - return false -} - -func (x *TransactionStatusMeta) GetLogMessages() []string { - if x != nil { - return x.LogMessages - } - return nil -} - -func (x *TransactionStatusMeta) GetLogMessagesNone() bool { - if x != nil { - return x.LogMessagesNone - } - return false -} - -func (x *TransactionStatusMeta) GetPreTokenBalances() []*TokenBalance { - if x != nil { - return x.PreTokenBalances - } - return nil -} - -func (x *TransactionStatusMeta) GetPostTokenBalances() []*TokenBalance { - if x != nil { - return x.PostTokenBalances - } - return nil -} - -func (x *TransactionStatusMeta) GetRewards() []*Reward { - if x != nil { - return x.Rewards - } - return nil -} - -func (x *TransactionStatusMeta) GetLoadedWritableAddresses() [][]byte { - if x != nil { - return x.LoadedWritableAddresses - } - return nil -} - -func (x *TransactionStatusMeta) GetLoadedReadonlyAddresses() [][]byte { - if x != nil { - return x.LoadedReadonlyAddresses - } - return nil -} - -func (x *TransactionStatusMeta) GetReturnData() *ReturnData { - if x != nil { - return x.ReturnData - } - return nil -} - -func (x *TransactionStatusMeta) GetReturnDataNone() bool { - if x != nil { - return x.ReturnDataNone - } - return false -} - -func (x *TransactionStatusMeta) GetComputeUnitsConsumed() uint64 { - if x != nil && x.ComputeUnitsConsumed != nil { - return *x.ComputeUnitsConsumed - } - return 0 -} - -type TransactionError struct { - state protoimpl.MessageState `protogen:"open.v1"` - Err []byte `protobuf:"bytes,1,opt,name=err,proto3" json:"err,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *TransactionError) Reset() { - *x = TransactionError{} - mi := &file_solana_storage_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *TransactionError) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TransactionError) ProtoMessage() {} - -func (x *TransactionError) ProtoReflect() protoreflect.Message { - mi := &file_solana_storage_proto_msgTypes[7] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use TransactionError.ProtoReflect.Descriptor instead. -func (*TransactionError) Descriptor() ([]byte, []int) { - return file_solana_storage_proto_rawDescGZIP(), []int{7} -} - -func (x *TransactionError) GetErr() []byte { - if x != nil { - return x.Err - } - return nil -} - -type InnerInstructions struct { - state protoimpl.MessageState `protogen:"open.v1"` - Index uint32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` - Instructions []*InnerInstruction `protobuf:"bytes,2,rep,name=instructions,proto3" json:"instructions,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *InnerInstructions) Reset() { - *x = InnerInstructions{} - mi := &file_solana_storage_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *InnerInstructions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InnerInstructions) ProtoMessage() {} - -func (x *InnerInstructions) ProtoReflect() protoreflect.Message { - mi := &file_solana_storage_proto_msgTypes[8] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use InnerInstructions.ProtoReflect.Descriptor instead. -func (*InnerInstructions) Descriptor() ([]byte, []int) { - return file_solana_storage_proto_rawDescGZIP(), []int{8} -} - -func (x *InnerInstructions) GetIndex() uint32 { - if x != nil { - return x.Index - } - return 0 -} - -func (x *InnerInstructions) GetInstructions() []*InnerInstruction { - if x != nil { - return x.Instructions - } - return nil -} - -type InnerInstruction struct { - state protoimpl.MessageState `protogen:"open.v1"` - ProgramIdIndex uint32 `protobuf:"varint,1,opt,name=program_id_index,json=programIdIndex,proto3" json:"program_id_index,omitempty"` - Accounts []byte `protobuf:"bytes,2,opt,name=accounts,proto3" json:"accounts,omitempty"` - Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` - // Invocation stack height of an inner instruction. - // Available since Solana v1.14.6 - // Set to `None` for txs executed on earlier versions. - StackHeight *uint32 `protobuf:"varint,4,opt,name=stack_height,json=stackHeight,proto3,oneof" json:"stack_height,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *InnerInstruction) Reset() { - *x = InnerInstruction{} - mi := &file_solana_storage_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *InnerInstruction) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InnerInstruction) ProtoMessage() {} - -func (x *InnerInstruction) ProtoReflect() protoreflect.Message { - mi := &file_solana_storage_proto_msgTypes[9] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use InnerInstruction.ProtoReflect.Descriptor instead. -func (*InnerInstruction) Descriptor() ([]byte, []int) { - return file_solana_storage_proto_rawDescGZIP(), []int{9} -} - -func (x *InnerInstruction) GetProgramIdIndex() uint32 { - if x != nil { - return x.ProgramIdIndex - } - return 0 -} - -func (x *InnerInstruction) GetAccounts() []byte { - if x != nil { - return x.Accounts - } - return nil -} - -func (x *InnerInstruction) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -func (x *InnerInstruction) GetStackHeight() uint32 { - if x != nil && x.StackHeight != nil { - return *x.StackHeight - } - return 0 -} - -type CompiledInstruction struct { - state protoimpl.MessageState `protogen:"open.v1"` - ProgramIdIndex uint32 `protobuf:"varint,1,opt,name=program_id_index,json=programIdIndex,proto3" json:"program_id_index,omitempty"` - Accounts []byte `protobuf:"bytes,2,opt,name=accounts,proto3" json:"accounts,omitempty"` - Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CompiledInstruction) Reset() { - *x = CompiledInstruction{} - mi := &file_solana_storage_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CompiledInstruction) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CompiledInstruction) ProtoMessage() {} - -func (x *CompiledInstruction) ProtoReflect() protoreflect.Message { - mi := &file_solana_storage_proto_msgTypes[10] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CompiledInstruction.ProtoReflect.Descriptor instead. -func (*CompiledInstruction) Descriptor() ([]byte, []int) { - return file_solana_storage_proto_rawDescGZIP(), []int{10} -} - -func (x *CompiledInstruction) GetProgramIdIndex() uint32 { - if x != nil { - return x.ProgramIdIndex - } - return 0 -} - -func (x *CompiledInstruction) GetAccounts() []byte { - if x != nil { - return x.Accounts - } - return nil -} - -func (x *CompiledInstruction) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -type TokenBalance struct { - state protoimpl.MessageState `protogen:"open.v1"` - AccountIndex uint32 `protobuf:"varint,1,opt,name=account_index,json=accountIndex,proto3" json:"account_index,omitempty"` - Mint string `protobuf:"bytes,2,opt,name=mint,proto3" json:"mint,omitempty"` - UiTokenAmount *UiTokenAmount `protobuf:"bytes,3,opt,name=ui_token_amount,json=uiTokenAmount,proto3" json:"ui_token_amount,omitempty"` - Owner string `protobuf:"bytes,4,opt,name=owner,proto3" json:"owner,omitempty"` - ProgramId string `protobuf:"bytes,5,opt,name=program_id,json=programId,proto3" json:"program_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *TokenBalance) Reset() { - *x = TokenBalance{} - mi := &file_solana_storage_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *TokenBalance) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TokenBalance) ProtoMessage() {} - -func (x *TokenBalance) ProtoReflect() protoreflect.Message { - mi := &file_solana_storage_proto_msgTypes[11] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use TokenBalance.ProtoReflect.Descriptor instead. -func (*TokenBalance) Descriptor() ([]byte, []int) { - return file_solana_storage_proto_rawDescGZIP(), []int{11} -} - -func (x *TokenBalance) GetAccountIndex() uint32 { - if x != nil { - return x.AccountIndex - } - return 0 -} - -func (x *TokenBalance) GetMint() string { - if x != nil { - return x.Mint - } - return "" -} - -func (x *TokenBalance) GetUiTokenAmount() *UiTokenAmount { - if x != nil { - return x.UiTokenAmount - } - return nil -} - -func (x *TokenBalance) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *TokenBalance) GetProgramId() string { - if x != nil { - return x.ProgramId - } - return "" -} - -type UiTokenAmount struct { - state protoimpl.MessageState `protogen:"open.v1"` - UiAmount float64 `protobuf:"fixed64,1,opt,name=ui_amount,json=uiAmount,proto3" json:"ui_amount,omitempty"` - Decimals uint32 `protobuf:"varint,2,opt,name=decimals,proto3" json:"decimals,omitempty"` - Amount string `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount,omitempty"` - UiAmountString string `protobuf:"bytes,4,opt,name=ui_amount_string,json=uiAmountString,proto3" json:"ui_amount_string,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UiTokenAmount) Reset() { - *x = UiTokenAmount{} - mi := &file_solana_storage_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UiTokenAmount) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UiTokenAmount) ProtoMessage() {} - -func (x *UiTokenAmount) ProtoReflect() protoreflect.Message { - mi := &file_solana_storage_proto_msgTypes[12] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UiTokenAmount.ProtoReflect.Descriptor instead. -func (*UiTokenAmount) Descriptor() ([]byte, []int) { - return file_solana_storage_proto_rawDescGZIP(), []int{12} -} - -func (x *UiTokenAmount) GetUiAmount() float64 { - if x != nil { - return x.UiAmount - } - return 0 -} - -func (x *UiTokenAmount) GetDecimals() uint32 { - if x != nil { - return x.Decimals - } - return 0 -} - -func (x *UiTokenAmount) GetAmount() string { - if x != nil { - return x.Amount - } - return "" -} - -func (x *UiTokenAmount) GetUiAmountString() string { - if x != nil { - return x.UiAmountString - } - return "" -} - -type ReturnData struct { - state protoimpl.MessageState `protogen:"open.v1"` - ProgramId []byte `protobuf:"bytes,1,opt,name=program_id,json=programId,proto3" json:"program_id,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ReturnData) Reset() { - *x = ReturnData{} - mi := &file_solana_storage_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ReturnData) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ReturnData) ProtoMessage() {} - -func (x *ReturnData) ProtoReflect() protoreflect.Message { - mi := &file_solana_storage_proto_msgTypes[13] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ReturnData.ProtoReflect.Descriptor instead. -func (*ReturnData) Descriptor() ([]byte, []int) { - return file_solana_storage_proto_rawDescGZIP(), []int{13} -} - -func (x *ReturnData) GetProgramId() []byte { - if x != nil { - return x.ProgramId - } - return nil -} - -func (x *ReturnData) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -type Reward struct { - state protoimpl.MessageState `protogen:"open.v1"` - Pubkey string `protobuf:"bytes,1,opt,name=pubkey,proto3" json:"pubkey,omitempty"` - Lamports int64 `protobuf:"varint,2,opt,name=lamports,proto3" json:"lamports,omitempty"` - PostBalance uint64 `protobuf:"varint,3,opt,name=post_balance,json=postBalance,proto3" json:"post_balance,omitempty"` - RewardType RewardType `protobuf:"varint,4,opt,name=reward_type,json=rewardType,proto3,enum=solana.storage.ConfirmedBlock.RewardType" json:"reward_type,omitempty"` - Commission string `protobuf:"bytes,5,opt,name=commission,proto3" json:"commission,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Reward) Reset() { - *x = Reward{} - mi := &file_solana_storage_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Reward) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Reward) ProtoMessage() {} - -func (x *Reward) ProtoReflect() protoreflect.Message { - mi := &file_solana_storage_proto_msgTypes[14] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Reward.ProtoReflect.Descriptor instead. -func (*Reward) Descriptor() ([]byte, []int) { - return file_solana_storage_proto_rawDescGZIP(), []int{14} -} - -func (x *Reward) GetPubkey() string { - if x != nil { - return x.Pubkey - } - return "" -} - -func (x *Reward) GetLamports() int64 { - if x != nil { - return x.Lamports - } - return 0 -} - -func (x *Reward) GetPostBalance() uint64 { - if x != nil { - return x.PostBalance - } - return 0 -} - -func (x *Reward) GetRewardType() RewardType { - if x != nil { - return x.RewardType - } - return RewardType_Unspecified -} - -func (x *Reward) GetCommission() string { - if x != nil { - return x.Commission - } - return "" -} - -type Rewards struct { - state protoimpl.MessageState `protogen:"open.v1"` - Rewards []*Reward `protobuf:"bytes,1,rep,name=rewards,proto3" json:"rewards,omitempty"` - NumPartitions *NumPartitions `protobuf:"bytes,2,opt,name=num_partitions,json=numPartitions,proto3" json:"num_partitions,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Rewards) Reset() { - *x = Rewards{} - mi := &file_solana_storage_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Rewards) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Rewards) ProtoMessage() {} - -func (x *Rewards) ProtoReflect() protoreflect.Message { - mi := &file_solana_storage_proto_msgTypes[15] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Rewards.ProtoReflect.Descriptor instead. -func (*Rewards) Descriptor() ([]byte, []int) { - return file_solana_storage_proto_rawDescGZIP(), []int{15} -} - -func (x *Rewards) GetRewards() []*Reward { - if x != nil { - return x.Rewards - } - return nil -} - -func (x *Rewards) GetNumPartitions() *NumPartitions { - if x != nil { - return x.NumPartitions - } - return nil -} - -type UnixTimestamp struct { - state protoimpl.MessageState `protogen:"open.v1"` - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UnixTimestamp) Reset() { - *x = UnixTimestamp{} - mi := &file_solana_storage_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UnixTimestamp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UnixTimestamp) ProtoMessage() {} - -func (x *UnixTimestamp) ProtoReflect() protoreflect.Message { - mi := &file_solana_storage_proto_msgTypes[16] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UnixTimestamp.ProtoReflect.Descriptor instead. -func (*UnixTimestamp) Descriptor() ([]byte, []int) { - return file_solana_storage_proto_rawDescGZIP(), []int{16} -} - -func (x *UnixTimestamp) GetTimestamp() int64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -type BlockHeight struct { - state protoimpl.MessageState `protogen:"open.v1"` - BlockHeight uint64 `protobuf:"varint,1,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *BlockHeight) Reset() { - *x = BlockHeight{} - mi := &file_solana_storage_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *BlockHeight) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BlockHeight) ProtoMessage() {} - -func (x *BlockHeight) ProtoReflect() protoreflect.Message { - mi := &file_solana_storage_proto_msgTypes[17] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BlockHeight.ProtoReflect.Descriptor instead. -func (*BlockHeight) Descriptor() ([]byte, []int) { - return file_solana_storage_proto_rawDescGZIP(), []int{17} -} - -func (x *BlockHeight) GetBlockHeight() uint64 { - if x != nil { - return x.BlockHeight - } - return 0 -} - -type NumPartitions struct { - state protoimpl.MessageState `protogen:"open.v1"` - NumPartitions uint64 `protobuf:"varint,1,opt,name=num_partitions,json=numPartitions,proto3" json:"num_partitions,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *NumPartitions) Reset() { - *x = NumPartitions{} - mi := &file_solana_storage_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *NumPartitions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NumPartitions) ProtoMessage() {} - -func (x *NumPartitions) ProtoReflect() protoreflect.Message { - mi := &file_solana_storage_proto_msgTypes[18] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NumPartitions.ProtoReflect.Descriptor instead. -func (*NumPartitions) Descriptor() ([]byte, []int) { - return file_solana_storage_proto_rawDescGZIP(), []int{18} -} - -func (x *NumPartitions) GetNumPartitions() uint64 { - if x != nil { - return x.NumPartitions - } - return 0 -} - -var File_solana_storage_proto protoreflect.FileDescriptor - -const file_solana_storage_proto_rawDesc = "" + - "\n" + - "\x14solana-storage.proto\x12\x1dsolana.storage.ConfirmedBlock\"\x89\x04\n" + - "\x0eConfirmedBlock\x12-\n" + - "\x12previous_blockhash\x18\x01 \x01(\tR\x11previousBlockhash\x12\x1c\n" + - "\tblockhash\x18\x02 \x01(\tR\tblockhash\x12\x1f\n" + - "\vparent_slot\x18\x03 \x01(\x04R\n" + - "parentSlot\x12W\n" + - "\ftransactions\x18\x04 \x03(\v23.solana.storage.ConfirmedBlock.ConfirmedTransactionR\ftransactions\x12?\n" + - "\arewards\x18\x05 \x03(\v2%.solana.storage.ConfirmedBlock.RewardR\arewards\x12K\n" + - "\n" + - "block_time\x18\x06 \x01(\v2,.solana.storage.ConfirmedBlock.UnixTimestampR\tblockTime\x12M\n" + - "\fblock_height\x18\a \x01(\v2*.solana.storage.ConfirmedBlock.BlockHeightR\vblockHeight\x12S\n" + - "\x0enum_partitions\x18\b \x01(\v2,.solana.storage.ConfirmedBlock.NumPartitionsR\rnumPartitions\"\xae\x01\n" + - "\x14ConfirmedTransaction\x12L\n" + - "\vtransaction\x18\x01 \x01(\v2*.solana.storage.ConfirmedBlock.TransactionR\vtransaction\x12H\n" + - "\x04meta\x18\x02 \x01(\v24.solana.storage.ConfirmedBlock.TransactionStatusMetaR\x04meta\"o\n" + - "\vTransaction\x12\x1e\n" + - "\n" + - "signatures\x18\x01 \x03(\fR\n" + - "signatures\x12@\n" + - "\amessage\x18\x02 \x01(\v2&.solana.storage.ConfirmedBlock.MessageR\amessage\"\x81\x03\n" + - "\aMessage\x12D\n" + - "\x06header\x18\x01 \x01(\v2,.solana.storage.ConfirmedBlock.MessageHeaderR\x06header\x12!\n" + - "\faccount_keys\x18\x02 \x03(\fR\vaccountKeys\x12)\n" + - "\x10recent_blockhash\x18\x03 \x01(\fR\x0frecentBlockhash\x12V\n" + - "\finstructions\x18\x04 \x03(\v22.solana.storage.ConfirmedBlock.CompiledInstructionR\finstructions\x12\x1c\n" + - "\tversioned\x18\x05 \x01(\bR\tversioned\x12l\n" + - "\x15address_table_lookups\x18\x06 \x03(\v28.solana.storage.ConfirmedBlock.MessageAddressTableLookupR\x13addressTableLookups\"\xcd\x01\n" + - "\rMessageHeader\x126\n" + - "\x17num_required_signatures\x18\x01 \x01(\rR\x15numRequiredSignatures\x12?\n" + - "\x1cnum_readonly_signed_accounts\x18\x02 \x01(\rR\x19numReadonlySignedAccounts\x12C\n" + - "\x1enum_readonly_unsigned_accounts\x18\x03 \x01(\rR\x1bnumReadonlyUnsignedAccounts\"\x92\x01\n" + - "\x19MessageAddressTableLookup\x12\x1f\n" + - "\vaccount_key\x18\x01 \x01(\fR\n" + - "accountKey\x12)\n" + - "\x10writable_indexes\x18\x02 \x01(\fR\x0fwritableIndexes\x12)\n" + - "\x10readonly_indexes\x18\x03 \x01(\fR\x0freadonlyIndexes\"\xd9\a\n" + - "\x15TransactionStatusMeta\x12A\n" + - "\x03err\x18\x01 \x01(\v2/.solana.storage.ConfirmedBlock.TransactionErrorR\x03err\x12\x10\n" + - "\x03fee\x18\x02 \x01(\x04R\x03fee\x12!\n" + - "\fpre_balances\x18\x03 \x03(\x04R\vpreBalances\x12#\n" + - "\rpost_balances\x18\x04 \x03(\x04R\fpostBalances\x12_\n" + - "\x12inner_instructions\x18\x05 \x03(\v20.solana.storage.ConfirmedBlock.InnerInstructionsR\x11innerInstructions\x126\n" + - "\x17inner_instructions_none\x18\n" + - " \x01(\bR\x15innerInstructionsNone\x12!\n" + - "\flog_messages\x18\x06 \x03(\tR\vlogMessages\x12*\n" + - "\x11log_messages_none\x18\v \x01(\bR\x0flogMessagesNone\x12Y\n" + - "\x12pre_token_balances\x18\a \x03(\v2+.solana.storage.ConfirmedBlock.TokenBalanceR\x10preTokenBalances\x12[\n" + - "\x13post_token_balances\x18\b \x03(\v2+.solana.storage.ConfirmedBlock.TokenBalanceR\x11postTokenBalances\x12?\n" + - "\arewards\x18\t \x03(\v2%.solana.storage.ConfirmedBlock.RewardR\arewards\x12:\n" + - "\x19loaded_writable_addresses\x18\f \x03(\fR\x17loadedWritableAddresses\x12:\n" + - "\x19loaded_readonly_addresses\x18\r \x03(\fR\x17loadedReadonlyAddresses\x12J\n" + - "\vreturn_data\x18\x0e \x01(\v2).solana.storage.ConfirmedBlock.ReturnDataR\n" + - "returnData\x12(\n" + - "\x10return_data_none\x18\x0f \x01(\bR\x0ereturnDataNone\x129\n" + - "\x16compute_units_consumed\x18\x10 \x01(\x04H\x00R\x14computeUnitsConsumed\x88\x01\x01B\x19\n" + - "\x17_compute_units_consumed\"$\n" + - "\x10TransactionError\x12\x10\n" + - "\x03err\x18\x01 \x01(\fR\x03err\"~\n" + - "\x11InnerInstructions\x12\x14\n" + - "\x05index\x18\x01 \x01(\rR\x05index\x12S\n" + - "\finstructions\x18\x02 \x03(\v2/.solana.storage.ConfirmedBlock.InnerInstructionR\finstructions\"\xa5\x01\n" + - "\x10InnerInstruction\x12(\n" + - "\x10program_id_index\x18\x01 \x01(\rR\x0eprogramIdIndex\x12\x1a\n" + - "\baccounts\x18\x02 \x01(\fR\baccounts\x12\x12\n" + - "\x04data\x18\x03 \x01(\fR\x04data\x12&\n" + - "\fstack_height\x18\x04 \x01(\rH\x00R\vstackHeight\x88\x01\x01B\x0f\n" + - "\r_stack_height\"o\n" + - "\x13CompiledInstruction\x12(\n" + - "\x10program_id_index\x18\x01 \x01(\rR\x0eprogramIdIndex\x12\x1a\n" + - "\baccounts\x18\x02 \x01(\fR\baccounts\x12\x12\n" + - "\x04data\x18\x03 \x01(\fR\x04data\"\xd2\x01\n" + - "\fTokenBalance\x12#\n" + - "\raccount_index\x18\x01 \x01(\rR\faccountIndex\x12\x12\n" + - "\x04mint\x18\x02 \x01(\tR\x04mint\x12T\n" + - "\x0fui_token_amount\x18\x03 \x01(\v2,.solana.storage.ConfirmedBlock.UiTokenAmountR\ruiTokenAmount\x12\x14\n" + - "\x05owner\x18\x04 \x01(\tR\x05owner\x12\x1d\n" + - "\n" + - "program_id\x18\x05 \x01(\tR\tprogramId\"\x8a\x01\n" + - "\rUiTokenAmount\x12\x1b\n" + - "\tui_amount\x18\x01 \x01(\x01R\buiAmount\x12\x1a\n" + - "\bdecimals\x18\x02 \x01(\rR\bdecimals\x12\x16\n" + - "\x06amount\x18\x03 \x01(\tR\x06amount\x12(\n" + - "\x10ui_amount_string\x18\x04 \x01(\tR\x0euiAmountString\"?\n" + - "\n" + - "ReturnData\x12\x1d\n" + - "\n" + - "program_id\x18\x01 \x01(\fR\tprogramId\x12\x12\n" + - "\x04data\x18\x02 \x01(\fR\x04data\"\xcb\x01\n" + - "\x06Reward\x12\x16\n" + - "\x06pubkey\x18\x01 \x01(\tR\x06pubkey\x12\x1a\n" + - "\blamports\x18\x02 \x01(\x03R\blamports\x12!\n" + - "\fpost_balance\x18\x03 \x01(\x04R\vpostBalance\x12J\n" + - "\vreward_type\x18\x04 \x01(\x0e2).solana.storage.ConfirmedBlock.RewardTypeR\n" + - "rewardType\x12\x1e\n" + - "\n" + - "commission\x18\x05 \x01(\tR\n" + - "commission\"\x9f\x01\n" + - "\aRewards\x12?\n" + - "\arewards\x18\x01 \x03(\v2%.solana.storage.ConfirmedBlock.RewardR\arewards\x12S\n" + - "\x0enum_partitions\x18\x02 \x01(\v2,.solana.storage.ConfirmedBlock.NumPartitionsR\rnumPartitions\"-\n" + - "\rUnixTimestamp\x12\x1c\n" + - "\ttimestamp\x18\x01 \x01(\x03R\ttimestamp\"0\n" + - "\vBlockHeight\x12!\n" + - "\fblock_height\x18\x01 \x01(\x04R\vblockHeight\"6\n" + - "\rNumPartitions\x12%\n" + - "\x0enum_partitions\x18\x01 \x01(\x04R\rnumPartitions*I\n" + - "\n" + - "RewardType\x12\x0f\n" + - "\vUnspecified\x10\x00\x12\a\n" + - "\x03Fee\x10\x01\x12\b\n" + - "\x04Rent\x10\x02\x12\v\n" + - "\aStaking\x10\x03\x12\n" + - "\n" + - "\x06Voting\x10\x04B;Z9github.com/rpcpool/yellowstone-grpc/examples/golang/protob\x06proto3" - -var ( - file_solana_storage_proto_rawDescOnce sync.Once - file_solana_storage_proto_rawDescData []byte -) - -func file_solana_storage_proto_rawDescGZIP() []byte { - file_solana_storage_proto_rawDescOnce.Do(func() { - file_solana_storage_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_solana_storage_proto_rawDesc), len(file_solana_storage_proto_rawDesc))) - }) - return file_solana_storage_proto_rawDescData -} - -var file_solana_storage_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_solana_storage_proto_msgTypes = make([]protoimpl.MessageInfo, 19) -var file_solana_storage_proto_goTypes = []any{ - (RewardType)(0), // 0: solana.storage.ConfirmedBlock.RewardType - (*ConfirmedBlock)(nil), // 1: solana.storage.ConfirmedBlock.ConfirmedBlock - (*ConfirmedTransaction)(nil), // 2: solana.storage.ConfirmedBlock.ConfirmedTransaction - (*Transaction)(nil), // 3: solana.storage.ConfirmedBlock.Transaction - (*Message)(nil), // 4: solana.storage.ConfirmedBlock.Message - (*MessageHeader)(nil), // 5: solana.storage.ConfirmedBlock.MessageHeader - (*MessageAddressTableLookup)(nil), // 6: solana.storage.ConfirmedBlock.MessageAddressTableLookup - (*TransactionStatusMeta)(nil), // 7: solana.storage.ConfirmedBlock.TransactionStatusMeta - (*TransactionError)(nil), // 8: solana.storage.ConfirmedBlock.TransactionError - (*InnerInstructions)(nil), // 9: solana.storage.ConfirmedBlock.InnerInstructions - (*InnerInstruction)(nil), // 10: solana.storage.ConfirmedBlock.InnerInstruction - (*CompiledInstruction)(nil), // 11: solana.storage.ConfirmedBlock.CompiledInstruction - (*TokenBalance)(nil), // 12: solana.storage.ConfirmedBlock.TokenBalance - (*UiTokenAmount)(nil), // 13: solana.storage.ConfirmedBlock.UiTokenAmount - (*ReturnData)(nil), // 14: solana.storage.ConfirmedBlock.ReturnData - (*Reward)(nil), // 15: solana.storage.ConfirmedBlock.Reward - (*Rewards)(nil), // 16: solana.storage.ConfirmedBlock.Rewards - (*UnixTimestamp)(nil), // 17: solana.storage.ConfirmedBlock.UnixTimestamp - (*BlockHeight)(nil), // 18: solana.storage.ConfirmedBlock.BlockHeight - (*NumPartitions)(nil), // 19: solana.storage.ConfirmedBlock.NumPartitions -} -var file_solana_storage_proto_depIdxs = []int32{ - 2, // 0: solana.storage.ConfirmedBlock.ConfirmedBlock.transactions:type_name -> solana.storage.ConfirmedBlock.ConfirmedTransaction - 15, // 1: solana.storage.ConfirmedBlock.ConfirmedBlock.rewards:type_name -> solana.storage.ConfirmedBlock.Reward - 17, // 2: solana.storage.ConfirmedBlock.ConfirmedBlock.block_time:type_name -> solana.storage.ConfirmedBlock.UnixTimestamp - 18, // 3: solana.storage.ConfirmedBlock.ConfirmedBlock.block_height:type_name -> solana.storage.ConfirmedBlock.BlockHeight - 19, // 4: solana.storage.ConfirmedBlock.ConfirmedBlock.num_partitions:type_name -> solana.storage.ConfirmedBlock.NumPartitions - 3, // 5: solana.storage.ConfirmedBlock.ConfirmedTransaction.transaction:type_name -> solana.storage.ConfirmedBlock.Transaction - 7, // 6: solana.storage.ConfirmedBlock.ConfirmedTransaction.meta:type_name -> solana.storage.ConfirmedBlock.TransactionStatusMeta - 4, // 7: solana.storage.ConfirmedBlock.Transaction.message:type_name -> solana.storage.ConfirmedBlock.Message - 5, // 8: solana.storage.ConfirmedBlock.Message.header:type_name -> solana.storage.ConfirmedBlock.MessageHeader - 11, // 9: solana.storage.ConfirmedBlock.Message.instructions:type_name -> solana.storage.ConfirmedBlock.CompiledInstruction - 6, // 10: solana.storage.ConfirmedBlock.Message.address_table_lookups:type_name -> solana.storage.ConfirmedBlock.MessageAddressTableLookup - 8, // 11: solana.storage.ConfirmedBlock.TransactionStatusMeta.err:type_name -> solana.storage.ConfirmedBlock.TransactionError - 9, // 12: solana.storage.ConfirmedBlock.TransactionStatusMeta.inner_instructions:type_name -> solana.storage.ConfirmedBlock.InnerInstructions - 12, // 13: solana.storage.ConfirmedBlock.TransactionStatusMeta.pre_token_balances:type_name -> solana.storage.ConfirmedBlock.TokenBalance - 12, // 14: solana.storage.ConfirmedBlock.TransactionStatusMeta.post_token_balances:type_name -> solana.storage.ConfirmedBlock.TokenBalance - 15, // 15: solana.storage.ConfirmedBlock.TransactionStatusMeta.rewards:type_name -> solana.storage.ConfirmedBlock.Reward - 14, // 16: solana.storage.ConfirmedBlock.TransactionStatusMeta.return_data:type_name -> solana.storage.ConfirmedBlock.ReturnData - 10, // 17: solana.storage.ConfirmedBlock.InnerInstructions.instructions:type_name -> solana.storage.ConfirmedBlock.InnerInstruction - 13, // 18: solana.storage.ConfirmedBlock.TokenBalance.ui_token_amount:type_name -> solana.storage.ConfirmedBlock.UiTokenAmount - 0, // 19: solana.storage.ConfirmedBlock.Reward.reward_type:type_name -> solana.storage.ConfirmedBlock.RewardType - 15, // 20: solana.storage.ConfirmedBlock.Rewards.rewards:type_name -> solana.storage.ConfirmedBlock.Reward - 19, // 21: solana.storage.ConfirmedBlock.Rewards.num_partitions:type_name -> solana.storage.ConfirmedBlock.NumPartitions - 22, // [22:22] is the sub-list for method output_type - 22, // [22:22] is the sub-list for method input_type - 22, // [22:22] is the sub-list for extension type_name - 22, // [22:22] is the sub-list for extension extendee - 0, // [0:22] is the sub-list for field type_name -} - -func init() { file_solana_storage_proto_init() } -func file_solana_storage_proto_init() { - if File_solana_storage_proto != nil { - return - } - file_solana_storage_proto_msgTypes[6].OneofWrappers = []any{} - file_solana_storage_proto_msgTypes[9].OneofWrappers = []any{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_solana_storage_proto_rawDesc), len(file_solana_storage_proto_rawDesc)), - NumEnums: 1, - NumMessages: 19, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_solana_storage_proto_goTypes, - DependencyIndexes: file_solana_storage_proto_depIdxs, - EnumInfos: file_solana_storage_proto_enumTypes, - MessageInfos: file_solana_storage_proto_msgTypes, - }.Build() - File_solana_storage_proto = out.File - file_solana_storage_proto_goTypes = nil - file_solana_storage_proto_depIdxs = nil -} diff --git a/internal/example/geyser/proto/solana-storage.proto b/internal/example/geyser/proto/solana-storage.proto deleted file mode 100644 index 5cf4bde..0000000 --- a/internal/example/geyser/proto/solana-storage.proto +++ /dev/null @@ -1,149 +0,0 @@ -syntax = "proto3"; - -package solana.storage.ConfirmedBlock; - -option go_package = "github.com/rpcpool/yellowstone-grpc/examples/golang/proto"; - -message ConfirmedBlock { - string previous_blockhash = 1; - string blockhash = 2; - uint64 parent_slot = 3; - repeated ConfirmedTransaction transactions = 4; - repeated Reward rewards = 5; - UnixTimestamp block_time = 6; - BlockHeight block_height = 7; - NumPartitions num_partitions = 8; -} - -message ConfirmedTransaction { - Transaction transaction = 1; - TransactionStatusMeta meta = 2; -} - -message Transaction { - repeated bytes signatures = 1; - Message message = 2; -} - -message Message { - MessageHeader header = 1; - repeated bytes account_keys = 2; - bytes recent_blockhash = 3; - repeated CompiledInstruction instructions = 4; - bool versioned = 5; - repeated MessageAddressTableLookup address_table_lookups = 6; -} - -message MessageHeader { - uint32 num_required_signatures = 1; - uint32 num_readonly_signed_accounts = 2; - uint32 num_readonly_unsigned_accounts = 3; -} - -message MessageAddressTableLookup { - bytes account_key = 1; - bytes writable_indexes = 2; - bytes readonly_indexes = 3; -} - -message TransactionStatusMeta { - TransactionError err = 1; - uint64 fee = 2; - repeated uint64 pre_balances = 3; - repeated uint64 post_balances = 4; - repeated InnerInstructions inner_instructions = 5; - bool inner_instructions_none = 10; - repeated string log_messages = 6; - bool log_messages_none = 11; - repeated TokenBalance pre_token_balances = 7; - repeated TokenBalance post_token_balances = 8; - repeated Reward rewards = 9; - repeated bytes loaded_writable_addresses = 12; - repeated bytes loaded_readonly_addresses = 13; - ReturnData return_data = 14; - bool return_data_none = 15; - - // Sum of compute units consumed by all instructions. - // Available since Solana v1.10.35 / v1.11.6. - // Set to `None` for txs executed on earlier versions. - optional uint64 compute_units_consumed = 16; -} - -message TransactionError { - bytes err = 1; -} - -message InnerInstructions { - uint32 index = 1; - repeated InnerInstruction instructions = 2; -} - -message InnerInstruction { - uint32 program_id_index = 1; - bytes accounts = 2; - bytes data = 3; - - // Invocation stack height of an inner instruction. - // Available since Solana v1.14.6 - // Set to `None` for txs executed on earlier versions. - optional uint32 stack_height = 4; -} - -message CompiledInstruction { - uint32 program_id_index = 1; - bytes accounts = 2; - bytes data = 3; -} - -message TokenBalance { - uint32 account_index = 1; - string mint = 2; - UiTokenAmount ui_token_amount = 3; - string owner = 4; - string program_id = 5; -} - -message UiTokenAmount { - double ui_amount = 1; - uint32 decimals = 2; - string amount = 3; - string ui_amount_string = 4; -} - -message ReturnData { - bytes program_id = 1; - bytes data = 2; -} - -enum RewardType { - Unspecified = 0; - Fee = 1; - Rent = 2; - Staking = 3; - Voting = 4; -} - -message Reward { - string pubkey = 1; - int64 lamports = 2; - uint64 post_balance = 3; - RewardType reward_type = 4; - string commission = 5; -} - -message Rewards { - repeated Reward rewards = 1; - NumPartitions num_partitions = 2; -} - -message UnixTimestamp { - int64 timestamp = 1; -} - -message BlockHeight { - uint64 block_height = 1; -} - -message NumPartitions { - uint64 num_partitions = 1; -} \ No newline at end of file diff --git a/internal/example/geyser/message.go b/internal/example/message.go similarity index 94% rename from internal/example/geyser/message.go rename to internal/example/message.go index 23adbdb..7582d84 100644 --- a/internal/example/geyser/message.go +++ b/internal/example/message.go @@ -1,4 +1,4 @@ -package geyser +package parser import ( "github.com/thloyi/pump-parser" diff --git a/internal/example/geyser/pump.go b/internal/example/pump.go similarity index 99% rename from internal/example/geyser/pump.go rename to internal/example/pump.go index f8c84a6..6e2fcd5 100644 --- a/internal/example/geyser/pump.go +++ b/internal/example/pump.go @@ -1,4 +1,4 @@ -package geyser +package parser import ( "fmt" diff --git a/internal/example/tx.go b/internal/example/tx.go index d0157af..d8262a2 100644 --- a/internal/example/tx.go +++ b/internal/example/tx.go @@ -70,9 +70,9 @@ func FromTx(tx *parser.Tx) []*Tx { for i, s := range tx.Swaps { var newTx *Tx platform, platformFee := tx.CheckPlatform(s) - token0Program := s.BaseTokenProgram - token0Address := s.BaseMint - token0Decimals := s.BaseMintDecimals + //token0Program := s.BaseTokenProgram + //token0Address := s.BaseMint + //token0Decimals := s.BaseMintDecimals if s.Program == "Pump" { quoteMint := s.QuoteMint // 有些数据里 quote 会给 SystemProgram,统一转成 WSOL @@ -130,9 +130,9 @@ func FromTx(tx *parser.Tx) []*Tx { } else if s.Event == "sell" { eventName = "buy" } - token0Program = s.QuoteTokenProgram - token0Address = s.QuoteMint - token0Decimals = s.QuoteMintDecimals + //token0Program = s.QuoteTokenProgram + //token0Address = s.QuoteMint + //token0Decimals = s.QuoteMintDecimals newTx = &Tx{ Err: nil, //BondingCurve: s.Pool.String(), @@ -225,10 +225,11 @@ func FromTx(tx *parser.Tx) []*Tx { if newTx == nil { continue } - if newTx.Maker == "HV1KXxWFaSeriyFvXyx48FqG9BoFbfinB8njCJonqP7K" && newTx.EntryContract == "oKXAggregatorV2" { - newTx.Maker = tx.Signer.String() - newTx.AfterSignerToken0Balance = tx.GetSignerTokenBalanceAfterTx(token0Program, token0Address).Div(decimal.New(1, int32(token0Decimals))) - } + + //if (newTx.Maker == "HV1KXxWFaSeriyFvXyx48FqG9BoFbfinB8njCJonqP7K" && newTx.EntryContract == "oKXAggregatorV2") || (newTx.Maker == "ARu4n5mFdZogZAravu7CcizaojWnS6oqka37gdLT5SZn" && newTx.EntryContract == "oKXDExRouterV2") { + // newTx.Maker = tx.Signer.String() + // newTx.AfterSignerToken0Balance = tx.GetSignerTokenBalanceAfterTx(token0Program, token0Address).Div(decimal.New(1, int32(token0Decimals))) + //} txs = append(txs, newTx) } diff --git a/internal/example/geyser/yellowstone.go b/internal/example/yellowstone.go similarity index 50% rename from internal/example/geyser/yellowstone.go rename to internal/example/yellowstone.go index 7978f2d..2f07f9b 100644 --- a/internal/example/geyser/yellowstone.go +++ b/internal/example/yellowstone.go @@ -1,4 +1,4 @@ -package geyser +package parser import ( "context" @@ -9,7 +9,6 @@ import ( "log" "time" - solana2 "github.com/gagliardetto/solana-go" "google.golang.org/grpc" "google.golang.org/grpc/credentials" "google.golang.org/grpc/credentials/insecure" @@ -17,7 +16,7 @@ import ( "google.golang.org/grpc/metadata" types "github.com/thloyi/pump-parser" - pb "github.com/thloyi/pump-parser/example/geyser/proto" + pb "go.onsig.ai/onsig/yellowstone-proto" ) type Handler interface { @@ -63,6 +62,9 @@ func NewClientWithPumpSwap(endpoint string, ch chan SubscriptionMessage) *Client "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA", //Pump AMM "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P", //Pump } + subscription.Transactions["transactions_sub"].AccountRequired = []string{ + "ARu4n5mFdZogZAravu7CcizaojWnS6oqka37gdLT5SZn", + } subscription.BlocksMeta = make(map[string]*pb.SubscribeRequestFilterBlocksMeta) subscription.BlocksMeta["block_meta"] = &pb.SubscribeRequestFilterBlocksMeta{} @@ -242,7 +244,7 @@ func (c *Client) grpcSubscribe(ctx context.Context, conn *grpc.ClientConn) error } continue } - rawTx, err := ConvertYellowstoneGrpcTransactionToSolanaTransaction(txn, resp.GetCreatedAt().Seconds) + rawTx, err := types.ConvertYellowstoneGrpcTransactionToSolanaTransaction(txn, resp.GetCreatedAt().Seconds) if err != nil { log.Printf("Failed to convert transaction: %v", err) continue @@ -290,236 +292,3 @@ func (c *Client) sendBlock(blockMeta *pb.SubscribeUpdateBlockMeta) { } c.firstMessage = false } - -func ConvertYellowstoneGrpcTransactionToSolanaTransaction(y *pb.SubscribeUpdateTransaction, created int64) (*types.RawTx, error) { - sTx := &types.RawTx{ - BlockTime: created, - Slot: y.Slot, - IndexWithinBlock: int64(y.Transaction.Index), - Meta: types.Meta{ - Err: nil, - Fee: 0, - InnerInstructions: nil, - LoadedAddresses: types.LoadedAddresses{}, - LogMessages: nil, - PostBalances: nil, - PostTokenBalances: nil, - PreBalances: nil, - PreTokenBalances: nil, - Rewards: nil, - }, - //Transaction: types.Transaction{ - // Message: types.Message{ - // AccountKeys: nil, - // AddressTableLookups: nil, - // Header: types.Header{}, - // Instructions: nil, - // RecentBlockHash: "", - // }, - // Signatures: nil, - //}, - //Version: nil, - } - meta := y.Transaction.GetMeta() - yTx := y.Transaction.Transaction - - if meta.Err != nil && len(meta.Err.GetErr()) > 0 { - // If the transaction has an error, we set the error in the Meta - transError, err := DecodeTransactionError(meta.Err.GetErr()) - if err != nil { - sTx.Meta.Err = err - } else { - sTx.Meta.Err = transError - } - // sTx.Meta.Err = meta.Err.GetErr() - } - sTx.Meta.Fee = meta.Fee - //sTx.Meta.InnerInstructions = meta.InnerInstructions - - for _, innerInstr := range meta.InnerInstructions { - var instrs []types.Instruction - for _, instr := range innerInstr.Instructions { - instrs = append(instrs, types.Instruction{ - ProgramIDIndex: int(instr.ProgramIdIndex), - Accounts: func() []int { - var out []int - for i := range instr.Accounts { - out = append(out, int(instr.Accounts[i])) - } - return out - }(), - Data: instr.Data, - }) - } - sTx.Meta.InnerInstructions = append(sTx.Meta.InnerInstructions, types.InnerInstructions{ - Index: int(innerInstr.Index), - Instructions: instrs, - }) - } - sTx.Meta.LogMessages = meta.LogMessages - sTx.Meta.PostBalances = meta.PostBalances - sTx.Meta.PostTokenBalances = grpcTokenBalance(meta.PostTokenBalances) - sTx.Meta.PreBalances = meta.PreBalances - sTx.Meta.PreTokenBalances = grpcTokenBalance(meta.PreTokenBalances) - sTx.Meta.Rewards = nil - sTx.Meta.LoadedAddresses.Readonly = byteSlicesToKeySlices(meta.LoadedReadonlyAddresses) - sTx.Meta.LoadedAddresses.Writable = byteSlicesToKeySlices(meta.LoadedWritableAddresses) - - // copy signatures - for i := range yTx.Signatures { - sTx.Transaction.Signatures = append(sTx.Transaction.Signatures, solana2.SignatureFromBytes(yTx.Signatures[i])) - } - // copy message - sTx.Transaction.Message = types.Message{ - RecentBlockHash: solana2.HashFromBytes(yTx.Message.RecentBlockhash).String(), - } - // copy message.AccountKeys - //stopAt := len(yTx.Message.AccountKeys) - sTx.Message.NumLookups() - stopAt := len(yTx.Message.AccountKeys) - for accIndex, acc := range yTx.Message.AccountKeys { - sTx.Transaction.Message.AccountKeys = append(sTx.Transaction.Message.AccountKeys, solana2.PublicKeyFromBytes(acc)) - if accIndex == stopAt-1 { - break - } - } - // copy message.Header - sTx.Transaction.Message.Header = types.Header{ - NumRequiredSignatures: int(yTx.Message.Header.NumRequiredSignatures), - NumReadonlySignedAccounts: int(yTx.Message.Header.NumReadonlySignedAccounts), - NumReadonlyUnsignedAccounts: int(yTx.Message.Header.NumReadonlyUnsignedAccounts), - } - - // copy message.versioned - if yTx.Message.Versioned { - sTx.Version = solana2.MessageVersionV0 - } else { - sTx.Version = solana2.MessageVersionLegacy - } - - // copy address table lookups - { - tables := map[solana2.PublicKey]solana2.PublicKeySlice{} - writable := byteSlicesToKeySlices(meta.LoadedWritableAddresses) - readonly := byteSlicesToKeySlices(meta.LoadedReadonlyAddresses) - for _, addr := range yTx.Message.AddressTableLookups { - sTx.Transaction.Message.AddressTableLookups = append(sTx.Transaction.Message.AddressTableLookups, solana2.MessageAddressTableLookup{ - AccountKey: solana2.PublicKeyFromBytes(addr.AccountKey), - WritableIndexes: addr.WritableIndexes, - ReadonlyIndexes: addr.ReadonlyIndexes, - }) - numTakeWritable := len(addr.WritableIndexes) - numTakeReadonly := len(addr.ReadonlyIndexes) - tableKey := solana2.PublicKeyFromBytes(addr.AccountKey) - { - // now need to rebuild the address table taking into account the indexes, and put the keys into the tables - maxIndex := 0 - for _, indexB := range addr.WritableIndexes { - index := int(indexB) - if index > maxIndex { - maxIndex = index - } - } - for _, indexB := range addr.ReadonlyIndexes { - index := int(indexB) - if index > maxIndex { - maxIndex = index - } - } - tables[tableKey] = make([]solana2.PublicKey, maxIndex+1) - } - if numTakeWritable > 0 { - writableForTable := writable[:numTakeWritable] - for i, indexB := range addr.WritableIndexes { - index := int(indexB) - tables[tableKey][index] = writableForTable[i] - } - writable = writable[numTakeWritable:] - } - if numTakeReadonly > 0 { - readableForTable := readonly[:numTakeReadonly] - for i, indexB := range addr.ReadonlyIndexes { - index := int(indexB) - tables[tableKey][index] = readableForTable[i] - } - readonly = readonly[numTakeReadonly:] - } - - } - } - - // copy instructions - for _, instr := range yTx.Message.Instructions { - sTx.Transaction.Message.Instructions = append(sTx.Transaction.Message.Instructions, types.Instruction{ - ProgramIDIndex: int(instr.ProgramIdIndex), - Accounts: func() []int { - var out []int - for i := range instr.Accounts { - out = append(out, int(instr.Accounts[i])) - } - return out - }(), - Data: instr.Data, - }) - } - - // resolve the lookups - //{ - // if sTx.Transaction.Message.IsVersioned() { - // // only versioned transactions have address table lookups - // err := sTx.Transaction.Message.ResolveLookups() - // if err != nil { - // return sTx, fmt.Errorf("failed to resolve lookups: %w", err) - // } - // } - //} - - return sTx, nil -} - -func byteSlicesToKeySlices(keys [][]byte) []solana2.PublicKey { - var out []solana2.PublicKey - for _, key := range keys { - var k solana2.PublicKey - copy(k[:], key) - out = append(out, k) - } - return out -} - -func grpcTokenBalance(src []*pb.TokenBalance) []types.TokenBalance { - out := make([]types.TokenBalance, len(src)) - for i, tb := range src { - var ( - mintAccount solana2.PublicKey - ownerAccount solana2.PublicKey - programIDAccount solana2.PublicKey - ) - - if tb.Mint != "" { - mintAccount, _ = solana2.PublicKeyFromBase58(tb.Mint) - } - if tb.Owner != "" { - ownerAccount, _ = solana2.PublicKeyFromBase58(tb.Owner) - } - if tb.ProgramId != "" { - programIDAccount, _ = solana2.PublicKeyFromBase58(tb.ProgramId) - } - - out[i] = types.TokenBalance{ - AccountIndex: int(tb.AccountIndex), - MintAccount: mintAccount, - OwnerAccount: &ownerAccount, - ProgramIDAccount: programIDAccount, - Mint: tb.Mint, - Owner: tb.Owner, - ProgramID: tb.ProgramId, - UITokenAmount: types.UITokenAmount{ - Amount: tb.UiTokenAmount.Amount, - Decimals: uint64(tb.UiTokenAmount.Decimals), - UIAmount: tb.UiTokenAmount.UiAmount, - UIAmountString: tb.UiTokenAmount.UiAmountString, - }, - } - } - return out -} diff --git a/pump.go b/pump.go index 1a600a0..b0083ef 100644 --- a/pump.go +++ b/pump.go @@ -218,6 +218,13 @@ func BuyOrSellParser(tx *Tx, instruction Instruction, innerInstructions InnerIns if err != nil { return nil, increaseOffset(offset), fmt.Errorf("pump create get inner instructions error: %v,offset, %d, %d", err, offset[0], offset[1]) } + if instruction.StackHeight != nil && *instruction.StackHeight > 2 { + for _, innerInstr := range inners { + if innerInstr.StackHeight != nil && *innerInstr.StackHeight == *instruction.StackHeight-1 { + entryContract = result.accountList[innerInstr.ProgramIDIndex] + } + } + } for innerIndex, innerInstr := range inners { if innerInstr.ProgramIDIndex == feeEventProgramIndex && bytes.Equal(innerInstr.Data[:8], pumpGetFeesDiscriminator[:]) { @@ -262,11 +269,6 @@ func BuyOrSellParser(tx *Tx, instruction Instruction, innerInstructions InnerIns } offset = [2]uint{newoffset[0], newoffset[1]} - ataUserIdx := instruction.Accounts[5] - userIndex := instruction.Accounts[6] - - userBase := getAccountBalanceAfterTx(result, ataUserIdx) - userQuote, _ := GetSolAfterTx(result, userIndex) event := "" baseTokenProgram := solana.TokenProgramID @@ -284,6 +286,24 @@ func BuyOrSellParser(tx *Tx, instruction Instruction, innerInstructions InnerIns Decimals: 6, } } + + var user = tradeEvent.User + + ataUserIdx := instruction.Accounts[5] + userIndex := instruction.Accounts[6] + if !tradeEvent.User.IsOnCurve() && (entryContract.Equals(okxDexRoutersV2) || entryContract.Equals(okxAggregatorV2)) { + userBaseAmount, ataIndex := tokenBalanceChange(result, 0, baseTokenProgram, tradeEvent.Mint) + //&& userBaseAmount.BigInt().Uint64() == tradeEvent.TokenAmount + if !userBaseAmount.IsZero() { + user = result.accountList[0] + userIndex = 0 + ataUserIdx = ataIndex + } + } + + userBase := getAccountBalanceAfterTx(result, ataUserIdx) + userQuote, _ := GetSolAfterTx(result, userIndex) + solAmount := tradeEvent.SolAmount if tradeEvent.IsBuy && bytes.Equal(instruction.Data[:8], pumpBuyV2Discriminator[:]) { fee := tradeEvent.Fee + tradeEvent.CreatorFee @@ -304,7 +324,7 @@ func BuyOrSellParser(tx *Tx, instruction Instruction, innerInstructions InnerIns Creator: tradeEvent.Creator, BaseMintDecimals: 6, QuoteMintDecimals: 9, - User: tradeEvent.User, + User: user, BaseAmount: decimal.NewFromUint64(tradeEvent.TokenAmount), QuoteAmount: decimal.NewFromUint64(solAmount), BaseReserve: decimal.NewFromUint64(tradeEvent.RealTokenReserves), @@ -327,13 +347,14 @@ func BuyOrSellParser(tx *Tx, instruction Instruction, innerInstructions InnerIns Creator: tradeEvent.Creator, BaseMintDecimals: 6, QuoteMintDecimals: 9, - User: tradeEvent.User, + User: user, Mayhem: isMayhemPump(result.accountList[instruction.Accounts[1]]), UserBaseBalance: userBase, UserQuoteBalance: decimal.NewFromUint64(userQuote), EntryContract: entryContract, }) } + return swaps, offset, nil } diff --git a/pumpamm.go b/pumpamm.go index 9eb53c7..fe505f0 100644 --- a/pumpamm.go +++ b/pumpamm.go @@ -245,6 +245,14 @@ func ammBuyParser(tx *Tx, instruction Instruction, innerInstructions InnerInstru if err != nil { return nil, increaseOffset(offset), fmt.Errorf("pumpamm create get inner instructions error: %v, offset: %d, %d", err, offset[0], prefixLen) } + if instruction.StackHeight != nil && *instruction.StackHeight > 2 { + for _, innerInstr := range inners { + if innerInstr.StackHeight != nil && *innerInstr.StackHeight == *instruction.StackHeight-1 { + entryContract = result.accountList[innerInstr.ProgramIDIndex] + } + } + } + var event ammBuyEvent for innerIndex, innerInstr := range inners { if innerInstr.ProgramIDIndex == instruction.ProgramIDIndex && @@ -298,6 +306,28 @@ func ammBuyParser(tx *Tx, instruction Instruction, innerInstructions InnerInstru TokenProgram: quoteTokenProgram, } } + + var eventUser = event.User + + baseMintAtaUserIdx := instruction.Accounts[5] + userIndex := instruction.Accounts[1] + if !event.User.IsOnCurve() && (entryContract.Equals(okxDexRoutersV2) || entryContract.Equals(okxAggregatorV2)) { + userBaseAmount, ataIndex := tokenBalanceChange(result, 0, baseTokenProgram, baseMint) + // && userBaseAmount.BigInt().Uint64() == event.BaseAmountOut + if !userBaseAmount.IsZero() { + eventUser = result.accountList[0] + userIndex = 0 + baseMintAtaUserIdx = ataIndex + } + } + + userBase := getAccountBalanceAfterTx(result, baseMintAtaUserIdx) + userQuote := GetTokenBalanceAfterTx(result, userIndex, quoteTokenProgram, quoteMint) + + if quoteMint.Equals(wSolMint) { + userBalance, _ := GetSolAfterTx(result, userIndex) + userQuote = userQuote.Add(decimal.NewFromUint64(userBalance)) + } return []Swap{ { Program: SolProgramPumpAMM, @@ -310,14 +340,14 @@ func ammBuyParser(tx *Tx, instruction Instruction, innerInstructions InnerInstru Creator: event.CoinCreator, BaseMintDecimals: baseMintDecimals, QuoteMintDecimals: quoteMintDecimals, - User: event.User, + User: eventUser, BaseAmount: decimal.NewFromUint64(event.BaseAmountOut), QuoteAmount: decimal.NewFromUint64(event.UserQuoteAmountIn), BaseReserve: decimal.NewFromUint64(event.PoolBaseTokenReserve - event.BaseAmountOut), QuoteReserve: decimal.NewFromUint64(event.PoolQuoteTokenReserve + event.QuoteAmountIn), Mayhem: isMayhemPump(result.accountList[instruction.Accounts[9]]), - UserBaseBalance: decimal.NewFromUint64(event.UserBaseTokenReserve + event.BaseAmountOut), - UserQuoteBalance: decimal.NewFromUint64(event.UserQuoteTokenReserve - event.UserQuoteAmountIn), + UserBaseBalance: userBase, + UserQuoteBalance: userQuote, EntryContract: entryContract, }, }, offset, nil @@ -332,6 +362,15 @@ func ammSellParser(tx *Tx, instruction Instruction, innerInstructions InnerInstr if err != nil { return nil, increaseOffset(offset), fmt.Errorf("pumpamm sell get inner instructions error: %v, offset: %d, %d", err, offset[0], prefixLen) } + + if instruction.StackHeight != nil && *instruction.StackHeight > 2 { + for _, innerInstr := range inners { + if innerInstr.StackHeight != nil && *innerInstr.StackHeight == *instruction.StackHeight-1 { + entryContract = result.accountList[innerInstr.ProgramIDIndex] + } + } + } + var event ammSellEvent for innerIndex, innerInstr := range inners { if innerInstr.ProgramIDIndex == instruction.ProgramIDIndex && @@ -385,6 +424,28 @@ func ammSellParser(tx *Tx, instruction Instruction, innerInstructions InnerInstr TokenProgram: quoteTokenProgram, } } + + var eventUser = event.User + + baseMintAtaUserIdx := instruction.Accounts[5] + userIndex := instruction.Accounts[1] + if !event.User.IsOnCurve() && (entryContract.Equals(okxDexRoutersV2) || entryContract.Equals(okxAggregatorV2)) { + userBaseAmount, ataIndex := tokenBalanceChange(result, 0, baseTokenProgram, baseMint) + // && userBaseAmount.BigInt().Uint64() == event.BaseAmountIn + if !userBaseAmount.IsZero() { + eventUser = result.accountList[0] + userIndex = 0 + baseMintAtaUserIdx = ataIndex + } + } + + userBase := getAccountBalanceAfterTx(result, baseMintAtaUserIdx) + userQuote := GetTokenBalanceAfterTx(result, userIndex, quoteTokenProgram, quoteMint) + + if quoteMint.Equals(wSolMint) { + userBalance, _ := GetSolAfterTx(result, userIndex) + userQuote = userQuote.Add(decimal.NewFromUint64(userBalance)) + } return []Swap{ { Program: SolProgramPumpAMM, @@ -397,14 +458,14 @@ func ammSellParser(tx *Tx, instruction Instruction, innerInstructions InnerInstr Creator: event.CoinCreator, BaseMintDecimals: baseMintDecimals, QuoteMintDecimals: quoteMintDecimals, - User: event.User, + User: eventUser, BaseAmount: decimal.NewFromUint64(event.BaseAmountIn), QuoteAmount: decimal.NewFromUint64(event.UserQuoteAmountOut), BaseReserve: decimal.NewFromUint64(event.PoolBaseTokenReserves + event.BaseAmountIn), QuoteReserve: decimal.NewFromUint64(event.PoolQuoteTokenReserves - event.QuoteAmountOut), Mayhem: isMayhemPump(result.accountList[instruction.Accounts[9]]), - UserBaseBalance: decimal.NewFromUint64(event.UserBaseTokenReserves - event.BaseAmountIn), - UserQuoteBalance: decimal.NewFromUint64(event.UserQuoteTokenReserves + event.UserQuoteAmountOut), + UserBaseBalance: userBase, + UserQuoteBalance: userQuote, EntryContract: entryContract, }, }, offset, nil diff --git a/rawtx.go b/rawtx.go index 456dbf2..f73ff3c 100644 --- a/rawtx.go +++ b/rawtx.go @@ -10,6 +10,7 @@ import ( "github.com/gagliardetto/solana-go/rpc" "github.com/jackc/pgtype" "github.com/shopspring/decimal" + pb "go.onsig.ai/onsig/yellowstone-proto" ) func (tx *RawTx) getAccountList() []solana.PublicKey { @@ -292,6 +293,198 @@ func InstructionsFromRpc(instructions []solana.CompiledInstruction) []Instructio return instrs } +func FromRpcTransactionWithMeta(tx rpc.TransactionWithMeta, blockTime *uint64, slot uint64, index int64) (*RawTx, error) { + created := int64(0) + if blockTime != nil { + created = int64(*blockTime) + } + sTx := &RawTx{ + BlockTime: created, + Slot: slot, + IndexWithinBlock: index, + Meta: Meta{ + Err: nil, + Fee: 0, + InnerInstructions: nil, + LoadedAddresses: LoadedAddresses{}, + LogMessages: nil, + PostBalances: nil, + PostTokenBalances: nil, + PreBalances: nil, + PreTokenBalances: nil, + Rewards: nil, + }, + } + + meta := tx.Meta + yTx, _ := tx.GetTransaction() + + if meta.Err != nil { + e, _ := json.Marshal(meta.Err) + sTx.Meta.Err = string(e) + } + sTx.Meta.Fee = meta.Fee + //sTx.Meta.InnerInstructions = meta.InnerInstructions + + for _, innerInstr := range meta.InnerInstructions { + var instrs []Instruction + for _, instr := range innerInstr.Instructions { + instrs = append(instrs, Instruction{ + ProgramIDIndex: int(instr.ProgramIDIndex), + Accounts: func() []int { + var out []int + for i := range instr.Accounts { + out = append(out, int(instr.Accounts[i])) + } + return out + }(), + Data: instr.Data, + StackHeight: newInt16(instr.StackHeight), + }) + } + sTx.Meta.InnerInstructions = append(sTx.Meta.InnerInstructions, InnerInstructions{ + Index: int(innerInstr.Index), + Instructions: instrs, + }) + } + sTx.Meta.LogMessages = meta.LogMessages + sTx.Meta.PostBalances = meta.PostBalances + sTx.Meta.PreBalances = meta.PreBalances + sTx.Meta.PostTokenBalances = convertTokenBalanceFromRpc(meta.PostTokenBalances) + sTx.Meta.PreTokenBalances = convertTokenBalanceFromRpc(meta.PreTokenBalances) + sTx.Meta.Rewards = nil + sTx.Meta.LoadedAddresses.Readonly = meta.LoadedAddresses.ReadOnly + sTx.Meta.LoadedAddresses.Writable = meta.LoadedAddresses.Writable + + // copy signatures + for i := range yTx.Signatures { + sTx.Transaction.Signatures = append(sTx.Transaction.Signatures, yTx.Signatures[i]) + } + // copy message + sTx.Transaction.Message = Message{ + RecentBlockHash: yTx.Message.RecentBlockhash.String(), + } + // copy message.AccountKeys + //stopAt := len(yTx.Message.AccountKeys) - sTx.Message.NumLookups() + stopAt := len(yTx.Message.AccountKeys) + for accIndex, acc := range yTx.Message.AccountKeys { + sTx.Transaction.Message.AccountKeys = append(sTx.Transaction.Message.AccountKeys, acc) + if accIndex == stopAt-1 { + break + } + } + // copy message.Header + sTx.Transaction.Message.Header = Header{ + NumRequiredSignatures: int(yTx.Message.Header.NumRequiredSignatures), + NumReadonlySignedAccounts: int(yTx.Message.Header.NumReadonlySignedAccounts), + NumReadonlyUnsignedAccounts: int(yTx.Message.Header.NumReadonlyUnsignedAccounts), + } + + // copy message.versioned + if yTx.Message.IsVersioned() { + sTx.Version = solana.MessageVersionV0 + } else { + sTx.Version = solana.MessageVersionLegacy + } + + // copy address table lookups + { + tables := map[solana.PublicKey]solana.PublicKeySlice{} + writable := meta.LoadedAddresses.Writable + readonly := meta.LoadedAddresses.ReadOnly + for _, addr := range yTx.Message.AddressTableLookups { + sTx.Transaction.Message.AddressTableLookups = append(sTx.Transaction.Message.AddressTableLookups, solana.MessageAddressTableLookup{ + AccountKey: addr.AccountKey, + WritableIndexes: addr.WritableIndexes, + ReadonlyIndexes: addr.ReadonlyIndexes, + }) + numTakeWritable := len(addr.WritableIndexes) + numTakeReadonly := len(addr.ReadonlyIndexes) + tableKey := addr.AccountKey + { + // now need to rebuild the address table taking into account the indexes, and put the keys into the tables + maxIndex := 0 + for _, indexB := range addr.WritableIndexes { + index := int(indexB) + if index > maxIndex { + maxIndex = index + } + } + for _, indexB := range addr.ReadonlyIndexes { + index := int(indexB) + if index > maxIndex { + maxIndex = index + } + } + tables[tableKey] = make([]solana.PublicKey, maxIndex+1) + } + if numTakeWritable > 0 { + writableForTable := writable[:numTakeWritable] + for i, indexB := range addr.WritableIndexes { + index := int(indexB) + tables[tableKey][index] = writableForTable[i] + } + writable = writable[numTakeWritable:] + } + if numTakeReadonly > 0 { + readableForTable := readonly[:numTakeReadonly] + for i, indexB := range addr.ReadonlyIndexes { + index := int(indexB) + tables[tableKey][index] = readableForTable[i] + } + readonly = readonly[numTakeReadonly:] + } + } + } + + // copy instructions + for _, instr := range yTx.Message.Instructions { + sTx.Transaction.Message.Instructions = append(sTx.Transaction.Message.Instructions, Instruction{ + ProgramIDIndex: int(instr.ProgramIDIndex), + Accounts: func() []int { + var out []int + for i := range instr.Accounts { + out = append(out, int(instr.Accounts[i])) + } + return out + }(), + Data: instr.Data, + }) + } + + return sTx, nil +} + +func convertTokenBalanceFromRpc(tb []rpc.TokenBalance) []TokenBalance { + var tokenBalances []TokenBalance = make([]TokenBalance, len(tb)) + for i, balance := range tb { + var uiAmount = float64(0) + if balance.UiTokenAmount.UiAmount != nil { + uiAmount = *balance.UiTokenAmount.UiAmount + } + tokenBalances[i] = TokenBalance{ + AccountIndex: int(balance.AccountIndex), + MintAccount: balance.Mint, + OwnerAccount: balance.Owner, + ProgramIDAccount: func() solana.PublicKey { + if balance.ProgramId != nil { + return *balance.ProgramId + } + return solana.PublicKey{} + }(), + UITokenAmount: UITokenAmount{ + Amount: balance.UiTokenAmount.Amount, + Decimals: uint64(balance.UiTokenAmount.Decimals), + UIAmount: uiAmount, + UIAmountString: balance.UiTokenAmount.UiAmountString, + }, + } + } + + return tokenBalances + +} + func InnerInstructionsFromRpc(instructions []rpc.InnerInstruction) []InnerInstructions { var innerInstructions []InnerInstructions = make([]InnerInstructions, len(instructions)) for i, instruction := range instructions { @@ -374,6 +567,49 @@ func getAccountBalanceAfterTx(result *RawTx, accountIndex int) decimal.Decimal { return amount } +func tokenBalanceChange(result *RawTx, accountIndex int, tokenProgram, mint solana.PublicKey) (change decimal.Decimal, ataIndex int) { + ataAccount, _, _ := solana.FindProgramAddress([][]byte{ + result.accountList[accountIndex][:], + tokenProgram[:], + mint[:], + }, + solana.SPLAssociatedTokenAccountProgramID) + + for i, account := range result.accountList { + if account.Equals(ataAccount) { + ataIndex = i + break + } + } + if ataIndex == 0 { + return decimal.Zero, ataIndex + } + before := decimal.Zero + after := decimal.Zero + + for _, pre := range result.Meta.PreTokenBalances { + if pre.AccountIndex == ataIndex { + amount, err := decimal.NewFromString(pre.UITokenAmount.Amount) + if err != nil { + return decimal.Zero, ataIndex + } + before = amount + break + } + } + for _, post := range result.Meta.PostTokenBalances { + if post.AccountIndex == ataIndex { + amount, err := decimal.NewFromString(post.UITokenAmount.Amount) + if err != nil { + return decimal.Zero, ataIndex + } + after = amount + break + } + } + return after.Sub(before).Abs(), ataIndex +} + func GetTokenBalanceAfterTx(result *RawTx, accountIndex int, tokenProgram, mint solana.PublicKey) decimal.Decimal { ataAccount, _, _ := solana.FindProgramAddress([][]byte{ result.accountList[accountIndex][:], @@ -445,3 +681,250 @@ func isAccountOwner(account, owner, mint solana.PublicKey) (bool, error) { } return account == ata, nil } + +func ConvertYellowstoneGrpcTransactionToSolanaTransaction(y *pb.SubscribeUpdateTransaction, created int64) (*RawTx, error) { + sTx := &RawTx{ + BlockTime: created, + Slot: y.Slot, + IndexWithinBlock: int64(y.Transaction.Index), + Meta: Meta{ + Err: nil, + Fee: 0, + InnerInstructions: nil, + LoadedAddresses: LoadedAddresses{}, + LogMessages: nil, + PostBalances: nil, + PostTokenBalances: nil, + PreBalances: nil, + PreTokenBalances: nil, + Rewards: nil, + }, + //Transaction: types.Transaction{ + // Message: types.Message{ + // AccountKeys: nil, + // AddressTableLookups: nil, + // Header: types.Header{}, + // Instructions: nil, + // RecentBlockHash: "", + // }, + // Signatures: nil, + //}, + //Version: nil, + } + meta := y.Transaction.GetMeta() + yTx := y.Transaction.Transaction + + if meta.Err != nil && len(meta.Err.GetErr()) > 0 { + // If the transaction has an error, we set the error in the Meta + transError, err := DecodeTransactionError(meta.Err.GetErr()) + if err != nil { + sTx.Meta.Err = err + } else { + sTx.Meta.Err = transError + } + // sTx.Meta.Err = meta.Err.GetErr() + } + sTx.Meta.Fee = meta.Fee + //sTx.Meta.InnerInstructions = meta.InnerInstructions + + for _, innerInstr := range meta.InnerInstructions { + var instrs []Instruction + for _, instr := range innerInstr.Instructions { + instrs = append(instrs, Instruction{ + ProgramIDIndex: int(instr.ProgramIdIndex), + Accounts: func() []int { + var out []int + for i := range instr.Accounts { + out = append(out, int(instr.Accounts[i])) + } + return out + }(), + Data: instr.Data, + StackHeight: newInt(instr.StackHeight), + }) + } + sTx.Meta.InnerInstructions = append(sTx.Meta.InnerInstructions, InnerInstructions{ + Index: int(innerInstr.Index), + Instructions: instrs, + }) + } + sTx.Meta.LogMessages = meta.LogMessages + sTx.Meta.PostBalances = meta.PostBalances + sTx.Meta.PostTokenBalances = grpcTokenBalance(meta.PostTokenBalances) + sTx.Meta.PreBalances = meta.PreBalances + sTx.Meta.PreTokenBalances = grpcTokenBalance(meta.PreTokenBalances) + sTx.Meta.Rewards = nil + sTx.Meta.LoadedAddresses.Readonly = byteSlicesToKeySlices(meta.LoadedReadonlyAddresses) + sTx.Meta.LoadedAddresses.Writable = byteSlicesToKeySlices(meta.LoadedWritableAddresses) + + // copy signatures + for i := range yTx.Signatures { + sTx.Transaction.Signatures = append(sTx.Transaction.Signatures, solana.SignatureFromBytes(yTx.Signatures[i])) + } + // copy message + sTx.Transaction.Message = Message{ + RecentBlockHash: solana.HashFromBytes(yTx.Message.RecentBlockhash).String(), + } + // copy message.AccountKeys + //stopAt := len(yTx.Message.AccountKeys) - sTx.Message.NumLookups() + stopAt := len(yTx.Message.AccountKeys) + for accIndex, acc := range yTx.Message.AccountKeys { + sTx.Transaction.Message.AccountKeys = append(sTx.Transaction.Message.AccountKeys, solana.PublicKeyFromBytes(acc)) + if accIndex == stopAt-1 { + break + } + } + // copy message.Header + sTx.Transaction.Message.Header = Header{ + NumRequiredSignatures: int(yTx.Message.Header.NumRequiredSignatures), + NumReadonlySignedAccounts: int(yTx.Message.Header.NumReadonlySignedAccounts), + NumReadonlyUnsignedAccounts: int(yTx.Message.Header.NumReadonlyUnsignedAccounts), + } + + // copy message.versioned + if yTx.Message.Versioned { + sTx.Version = solana.MessageVersionV0 + } else { + sTx.Version = solana.MessageVersionLegacy + } + + // copy address table lookups + { + tables := map[solana.PublicKey]solana.PublicKeySlice{} + writable := byteSlicesToKeySlices(meta.LoadedWritableAddresses) + readonly := byteSlicesToKeySlices(meta.LoadedReadonlyAddresses) + for _, addr := range yTx.Message.AddressTableLookups { + sTx.Transaction.Message.AddressTableLookups = append(sTx.Transaction.Message.AddressTableLookups, solana.MessageAddressTableLookup{ + AccountKey: solana.PublicKeyFromBytes(addr.AccountKey), + WritableIndexes: addr.WritableIndexes, + ReadonlyIndexes: addr.ReadonlyIndexes, + }) + numTakeWritable := len(addr.WritableIndexes) + numTakeReadonly := len(addr.ReadonlyIndexes) + tableKey := solana.PublicKeyFromBytes(addr.AccountKey) + { + // now need to rebuild the address table taking into account the indexes, and put the keys into the tables + maxIndex := 0 + for _, indexB := range addr.WritableIndexes { + index := int(indexB) + if index > maxIndex { + maxIndex = index + } + } + for _, indexB := range addr.ReadonlyIndexes { + index := int(indexB) + if index > maxIndex { + maxIndex = index + } + } + tables[tableKey] = make([]solana.PublicKey, maxIndex+1) + } + if numTakeWritable > 0 { + writableForTable := writable[:numTakeWritable] + for i, indexB := range addr.WritableIndexes { + index := int(indexB) + tables[tableKey][index] = writableForTable[i] + } + writable = writable[numTakeWritable:] + } + if numTakeReadonly > 0 { + readableForTable := readonly[:numTakeReadonly] + for i, indexB := range addr.ReadonlyIndexes { + index := int(indexB) + tables[tableKey][index] = readableForTable[i] + } + readonly = readonly[numTakeReadonly:] + } + + } + } + + // copy instructions + for _, instr := range yTx.Message.Instructions { + sTx.Transaction.Message.Instructions = append(sTx.Transaction.Message.Instructions, Instruction{ + ProgramIDIndex: int(instr.ProgramIdIndex), + Accounts: func() []int { + var out []int + for i := range instr.Accounts { + out = append(out, int(instr.Accounts[i])) + } + return out + }(), + Data: instr.Data, + }) + } + + // resolve the lookups + //{ + // if sTx.Transaction.Message.IsVersioned() { + // // only versioned transactions have address table lookups + // err := sTx.Transaction.Message.ResolveLookups() + // if err != nil { + // return sTx, fmt.Errorf("failed to resolve lookups: %w", err) + // } + // } + //} + + return sTx, nil +} + +func newInt16(x uint16) *int { + y := int(x) + return &y +} + +func newInt(x *uint32) *int { + if x == nil { + return nil + } + y := int(*x) + return &y +} + +func byteSlicesToKeySlices(keys [][]byte) []solana.PublicKey { + var out []solana.PublicKey + for _, key := range keys { + var k solana.PublicKey + copy(k[:], key) + out = append(out, k) + } + return out +} + +func grpcTokenBalance(src []*pb.TokenBalance) []TokenBalance { + out := make([]TokenBalance, len(src)) + for i, tb := range src { + var ( + mintAccount solana.PublicKey + ownerAccount solana.PublicKey + programIDAccount solana.PublicKey + ) + + if tb.Mint != "" { + mintAccount, _ = solana.PublicKeyFromBase58(tb.Mint) + } + if tb.Owner != "" { + ownerAccount, _ = solana.PublicKeyFromBase58(tb.Owner) + } + if tb.ProgramId != "" { + programIDAccount, _ = solana.PublicKeyFromBase58(tb.ProgramId) + } + + out[i] = TokenBalance{ + AccountIndex: int(tb.AccountIndex), + MintAccount: mintAccount, + OwnerAccount: &ownerAccount, + ProgramIDAccount: programIDAccount, + Mint: tb.Mint, + Owner: tb.Owner, + ProgramID: tb.ProgramId, + UITokenAmount: UITokenAmount{ + Amount: tb.UiTokenAmount.Amount, + Decimals: uint64(tb.UiTokenAmount.Decimals), + UIAmount: tb.UiTokenAmount.UiAmount, + UIAmountString: tb.UiTokenAmount.UiAmountString, + }, + } + } + return out +}