Documentation
¶
Index ¶
- Constants
- func Address(model *storage.Address) *pb.Address
- func Block(block *storage.Block) *pb.Block
- func Class(model *storage.Class) *pb.Class
- func Declare(model *storage.Declare) *pb.Declare
- func Deploy(model *storage.Deploy) *pb.Deploy
- func DeployAccount(model *storage.DeployAccount) *pb.DeployAccount
- func EndOfBlock(model *subscriptions.EndOfBlock) *pb.EndOfBlock
- func Event(model *storage.Event) *pb.Event
- func Fee(model *storage.Fee) *pb.Fee
- func Internal(model *storage.Internal) *pb.Internal
- func Invoke(model *storage.Invoke) *pb.Invoke
- func L1Handler(model *storage.L1Handler) *pb.L1Handler
- func Message(model *storage.Message) *pb.StarknetMessage
- func StorageDiff(model *storage.StorageDiff) *pb.StorageDiff
- func SubscriptionAddress(id uint64, msg *subscriptions.Message) *pb.Subscription
- func SubscriptionBlock(id uint64, msg *subscriptions.Message) *pb.Subscription
- func SubscriptionDeclare(id uint64, msg *subscriptions.Message) *pb.Subscription
- func SubscriptionDeploy(id uint64, msg *subscriptions.Message) *pb.Subscription
- func SubscriptionDeployAccount(id uint64, msg *subscriptions.Message) *pb.Subscription
- func SubscriptionEnd(id uint64, msg *subscriptions.Message) *pb.Subscription
- func SubscriptionEvent(id uint64, msg *subscriptions.Message) *pb.Subscription
- func SubscriptionFee(id uint64, msg *subscriptions.Message) *pb.Subscription
- func SubscriptionInternal(id uint64, msg *subscriptions.Message) *pb.Subscription
- func SubscriptionInvoke(id uint64, msg *subscriptions.Message) *pb.Subscription
- func SubscriptionL1Handler(id uint64, msg *subscriptions.Message) *pb.Subscription
- func SubscriptionMessage(id uint64, msg *subscriptions.Message) *pb.Subscription
- func SubscriptionStorageDiff(id uint64, msg *subscriptions.Message) *pb.Subscription
- func SubscriptionToken(id uint64, msg *subscriptions.Message) *pb.Subscription
- func SubscriptionTokenBalance(id uint64, msg *subscriptions.Message) *pb.Subscription
- func SubscriptionTransfer(id uint64, msg *subscriptions.Message) *pb.Subscription
- func Token(model *storage.Token) *pb.Token
- func TokenBalance(model *storage.TokenBalance) *pb.TokenBalance
- func Transfer(model *storage.Transfer) *pb.Transfer
- type AddressFilter
- type BetweenInteger
- type Bytes
- type BytesFilter
- type Client
- func (client *Client) Close() error
- func (client *Client) Connect(ctx context.Context, opts ...grpcSDK.ConnectOption) error
- func (client *Client) GetProxy(ctx context.Context, hash, selector []byte) (*pb.Proxy, error)
- func (client *Client) JsonSchemaForClass(ctx context.Context, req *pb.Bytes) (*pb.Bytes, error)
- func (client *Client) JsonSchemaForContract(ctx context.Context, req *pb.Bytes) (*pb.Bytes, error)
- func (client *Client) Reconnect() <-chan uint64
- func (client *Client) Start(ctx context.Context)
- func (client *Client) Subscribe(ctx context.Context, req *pb.SubscribeRequest) (uint64, error)
- func (client *Client) Unsubscribe(ctx context.Context, id uint64) error
- type ClientConfig
- type DeclareFilters
- type DeployAccountFilters
- type DeployFilters
- type EnumFilter
- type EnumStringFilter
- type EqualityFilter
- type EventFilter
- type FeeFilters
- type IntegerFilter
- type InternalFilters
- type InvokeFilters
- type L1HandlerFilters
- type MessageFilter
- type Server
- func (module *Server) Close() error
- func (module *Server) GetProxy(ctx context.Context, req *pb.ProxyRequest) (*pb.Proxy, error)
- func (module *Server) JSONSchemaForClass(ctx context.Context, req *pb.Bytes) (*pb.Bytes, error)
- func (module *Server) JSONSchemaForContract(ctx context.Context, req *pb.Bytes) (*pb.Bytes, error)
- func (module *Server) Start(ctx context.Context)
- func (module *Server) Subscribe(req *pb.SubscribeRequest, stream pb.IndexerService_SubscribeServer) error
- func (module *Server) Unsubscribe(ctx context.Context, req *generalPB.UnsubscribeRequest) (*generalPB.UnsubscribeResponse, error)
- type StorageDiffFilter
- type Stream
- type StringFilter
- type Subscription
- type TimeFilter
- type TokenBalanceFilter
- type TokenFilter
- type TransferFilter
Constants ¶
const ( OutputMessages = "messages" ModuleName = "layer1_grpc_client" )
const (
InputBlocks = "blocks"
)
input names
Variables ¶
This section is empty.
Functions ¶
func DeployAccount ¶
func DeployAccount(model *storage.DeployAccount) *pb.DeployAccount
DeployAccount -
func SubscriptionAddress ¶
func SubscriptionAddress(id uint64, msg *subscriptions.Message) *pb.Subscription
SubscriptionAddress -
func SubscriptionBlock ¶
func SubscriptionBlock(id uint64, msg *subscriptions.Message) *pb.Subscription
SubscriptionBlock -
func SubscriptionDeclare ¶
func SubscriptionDeclare(id uint64, msg *subscriptions.Message) *pb.Subscription
SubscriptionDeclare -
func SubscriptionDeploy ¶
func SubscriptionDeploy(id uint64, msg *subscriptions.Message) *pb.Subscription
SubscriptionDeploy -
func SubscriptionDeployAccount ¶
func SubscriptionDeployAccount(id uint64, msg *subscriptions.Message) *pb.Subscription
SubscriptionDeployAccount -
func SubscriptionEnd ¶
func SubscriptionEnd(id uint64, msg *subscriptions.Message) *pb.Subscription
SubscriptionEnd -
func SubscriptionEvent ¶
func SubscriptionEvent(id uint64, msg *subscriptions.Message) *pb.Subscription
SubscriptionEvent -
func SubscriptionFee ¶
func SubscriptionFee(id uint64, msg *subscriptions.Message) *pb.Subscription
SubscriptionFee -
func SubscriptionInternal ¶
func SubscriptionInternal(id uint64, msg *subscriptions.Message) *pb.Subscription
SubscriptionInternal -
func SubscriptionInvoke ¶
func SubscriptionInvoke(id uint64, msg *subscriptions.Message) *pb.Subscription
SubscriptionInvoke -
func SubscriptionL1Handler ¶
func SubscriptionL1Handler(id uint64, msg *subscriptions.Message) *pb.Subscription
SubscriptionL1Handler -
func SubscriptionMessage ¶
func SubscriptionMessage(id uint64, msg *subscriptions.Message) *pb.Subscription
SubscriptionMessage -
func SubscriptionStorageDiff ¶
func SubscriptionStorageDiff(id uint64, msg *subscriptions.Message) *pb.Subscription
SubscriptionStorageDiff -
func SubscriptionToken ¶
func SubscriptionToken(id uint64, msg *subscriptions.Message) *pb.Subscription
SubscriptionToken -
func SubscriptionTokenBalance ¶
func SubscriptionTokenBalance(id uint64, msg *subscriptions.Message) *pb.Subscription
SubscriptionTokenBalance -
func SubscriptionTransfer ¶
func SubscriptionTransfer(id uint64, msg *subscriptions.Message) *pb.Subscription
SubscriptionTransfer -
Types ¶
type AddressFilter ¶
type AddressFilter struct { Id *IntegerFilter `yaml:"id" validate:"omitempty"` Height *IntegerFilter `yaml:"height" validate:"omitempty"` OnlyStarknet bool `yaml:"only_starknet" validate:"omitempty"` }
AddressFilter -
func (AddressFilter) ToGrpcFilter ¶
func (f AddressFilter) ToGrpcFilter() *pb.AddressFilter
ToGrpcFilter -
type BetweenInteger ¶
type BetweenInteger struct { From uint64 `yaml:"from" validate:"required"` To uint64 `yaml:"to" validate:"required"` }
BetweenInteger -
func (BetweenInteger) ToGrpcFilter ¶
func (f BetweenInteger) ToGrpcFilter() *pb.BetweenInteger
ToGrpcFilter -
type BytesFilter ¶
type BytesFilter struct { Eq Bytes `yaml:"eq" validate:"omitempty"` In []Bytes `yaml:"in" validate:"omitempty"` }
BytesFilter -
func (BytesFilter) ToGrpcFilter ¶
func (f BytesFilter) ToGrpcFilter() *pb.BytesFilter
ToGrpcFilter -
type Client ¶
type Client struct { modules.BaseModule // contains filtered or unexported fields }
Client -
func NewClientWithServerAddress ¶
NewClientWithServerAddress -
func (*Client) JsonSchemaForClass ¶
JsonSchemaForClass -
func (*Client) JsonSchemaForContract ¶
JsonSchemaForContract -
type ClientConfig ¶
type ClientConfig struct { ServerAddress string `yaml:"server_address" validate:"required"` Subscriptions map[string]Subscription `yaml:"subscriptions" validate:"omitempty"` }
ClientConfig -
type DeclareFilters ¶
type DeclareFilters struct { Height *IntegerFilter `yaml:"height" validate:"omitempty"` Time *TimeFilter `yaml:"time" validate:"omitempty"` Status *EnumFilter `yaml:"status" validate:"omitempty"` Version *EnumFilter `yaml:"version" validate:"omitempty"` Id *IntegerFilter `yaml:"id" validate:"omitempty"` }
DeclareFilters -
func (DeclareFilters) ToGrpcFilter ¶
func (f DeclareFilters) ToGrpcFilter() *pb.DeclareFilters
ToGrpcFilter -
type DeployAccountFilters ¶
type DeployAccountFilters struct { Height *IntegerFilter `yaml:"height" validate:"omitempty"` Time *TimeFilter `yaml:"time" validate:"omitempty"` Status *EnumFilter `yaml:"status" validate:"omitempty"` Class *BytesFilter `yaml:"class" validate:"omitempty"` ParsedCalldata map[string]string `yaml:"parsed_calldata" validate:"omitempty"` Id *IntegerFilter `yaml:"id" validate:"omitempty"` }
DeployAccountFilters -
func (DeployAccountFilters) ToGrpcFilter ¶
func (f DeployAccountFilters) ToGrpcFilter() *pb.DeployAccountFilters
ToGrpcFilter -
type DeployFilters ¶
type DeployFilters struct { Height *IntegerFilter `yaml:"height" validate:"omitempty"` Time *TimeFilter `yaml:"time" validate:"omitempty"` Status *EnumFilter `yaml:"status" validate:"omitempty"` Class *BytesFilter `yaml:"class" validate:"omitempty"` ParsedCalldata map[string]string `yaml:"parsed_calldata" validate:"omitempty"` Id *IntegerFilter `yaml:"id" validate:"omitempty"` }
DeployFilters -
func (DeployFilters) ToGrpcFilter ¶
func (f DeployFilters) ToGrpcFilter() *pb.DeployFilters
ToGrpcFilter -
type EnumFilter ¶
type EnumFilter struct { Eq uint64 `yaml:"eq" validate:"omitempty"` Neq uint64 `yaml:"neq" validate:"omitempty"` In []uint64 `yaml:"in" validate:"omitempty"` Notin []uint64 `yaml:"notin" validate:"omitempty"` }
EnumFilter -
type EnumStringFilter ¶
type EnumStringFilter struct { Eq string `yaml:"eq" validate:"omitempty"` Neq string `yaml:"neq" validate:"omitempty"` In []string `yaml:"in" validate:"omitempty"` Notin []string `yaml:"notin" validate:"omitempty"` }
EnumStringFilter -
func (EnumStringFilter) ToGrpcFilter ¶
func (f EnumStringFilter) ToGrpcFilter() *pb.EnumStringFilter
ToGrpcFilter -
type EqualityFilter ¶
type EqualityFilter struct { Eq string `yaml:"eq" validate:"omitempty"` Neq string `yaml:"neq" validate:"omitempty"` }
EqualityFilter -
func (EqualityFilter) ToGrpcFilter ¶
func (f EqualityFilter) ToGrpcFilter() *pb.EqualityFilter
ToGrpcFilter -
type EventFilter ¶
type EventFilter struct { Height *IntegerFilter `yaml:"height" validate:"omitempty"` Time *TimeFilter `yaml:"time" validate:"omitempty"` Contract *BytesFilter `yaml:"contract" validate:"omitempty"` From *BytesFilter `yaml:"from" validate:"omitempty"` Name *StringFilter `yaml:"name" validate:"omitempty"` ParsedData map[string]string `yaml:"parsed_data" validate:"omitempty"` Id *IntegerFilter `yaml:"id" validate:"omitempty"` }
EventFilter -
func (EventFilter) ToGrpcFilter ¶
func (f EventFilter) ToGrpcFilter() *pb.EventFilter
ToGrpcFilter -
type FeeFilters ¶
type FeeFilters struct { Height *IntegerFilter `yaml:"height" validate:"omitempty"` Time *TimeFilter `yaml:"time" validate:"omitempty"` Status *EnumFilter `yaml:"status" validate:"omitempty"` Contract *BytesFilter `yaml:"contract" validate:"omitempty"` Caller *BytesFilter `yaml:"caller" validate:"omitempty"` Class *BytesFilter `yaml:"class" validate:"omitempty"` Selector *EqualityFilter `yaml:"selector" validate:"omitempty"` Entrypoint *StringFilter `yaml:"entrypoint" validate:"omitempty"` EntrypointType *EnumFilter `yaml:"entrypoint_type" validate:"omitempty"` CallType *EnumFilter `yaml:"call_type" validate:"omitempty"` ParsedCalldata map[string]string `yaml:"parsed_calldata" validate:"omitempty"` Id *IntegerFilter `yaml:"id" validate:"omitempty"` }
FeeFilters -
type IntegerFilter ¶
type IntegerFilter struct { Gt uint64 `yaml:"gt" validate:"omitempty"` Gte uint64 `yaml:"gte" validate:"omitempty"` Lt uint64 `yaml:"lt" validate:"omitempty"` Lte uint64 `yaml:"lte" validate:"omitempty"` Eq uint64 `yaml:"eq" validate:"omitempty"` Neq uint64 `yaml:"neq" validate:"omitempty"` Between *BetweenInteger `yaml:"between" validate:"omitempty"` }
IntegerFilter -
func (IntegerFilter) ToGrpcFilter ¶
func (f IntegerFilter) ToGrpcFilter() *pb.IntegerFilter
ToGrpcFilter -
type InternalFilters ¶
type InternalFilters struct { Height *IntegerFilter `yaml:"height" validate:"omitempty"` Time *TimeFilter `yaml:"time" validate:"omitempty"` Status *EnumFilter `yaml:"status" validate:"omitempty"` Contract *BytesFilter `yaml:"contract" validate:"omitempty"` Caller *BytesFilter `yaml:"caller" validate:"omitempty"` Class *BytesFilter `yaml:"class" validate:"omitempty"` Selector *EqualityFilter `yaml:"selector" validate:"omitempty"` Entrypoint *StringFilter `yaml:"entrypoint" validate:"omitempty"` EntrypointType *EnumFilter `yaml:"entrypoint_type" validate:"omitempty"` CallType *EnumFilter `yaml:"call_type" validate:"omitempty"` ParsedCalldata map[string]string `yaml:"parsed_calldata" validate:"omitempty"` Id *IntegerFilter `yaml:"id" validate:"omitempty"` }
InternalFilters -
func (InternalFilters) ToGrpcFilter ¶
func (f InternalFilters) ToGrpcFilter() *pb.InternalFilter
ToGrpcFilter -
type InvokeFilters ¶
type InvokeFilters struct { Height *IntegerFilter `yaml:"height" validate:"omitempty"` Time *TimeFilter `yaml:"time" validate:"omitempty"` Status *EnumFilter `yaml:"status" validate:"omitempty"` Version *EnumFilter `yaml:"version" validate:"omitempty"` Contract *BytesFilter `yaml:"contract" validate:"omitempty"` Selector *EqualityFilter `yaml:"selector" validate:"omitempty"` Entrypoint *StringFilter `yaml:"entrypoint" validate:"omitempty"` ParsedCalldata map[string]string `yaml:"parsed_calldata" validate:"omitempty"` Id *IntegerFilter `yaml:"id" validate:"omitempty"` }
InvokeFilters -
func (InvokeFilters) ToGrpcFilter ¶
func (f InvokeFilters) ToGrpcFilter() *pb.InvokeFilters
ToGrpcFilter -
type L1HandlerFilters ¶
type L1HandlerFilters struct { Height *IntegerFilter `yaml:"height" validate:"omitempty"` Time *TimeFilter `yaml:"time" validate:"omitempty"` Status *EnumFilter `yaml:"status" validate:"omitempty"` Contract *BytesFilter `yaml:"contract" validate:"omitempty"` Selector *EqualityFilter `yaml:"selector" validate:"omitempty"` Entrypoint *StringFilter `yaml:"entrypoint" validate:"omitempty"` ParsedCalldata map[string]string `yaml:"parsed_calldata" validate:"omitempty"` Id *IntegerFilter `yaml:"id" validate:"omitempty"` }
L1HandlerFilters -
func (L1HandlerFilters) ToGrpcFilter ¶
func (f L1HandlerFilters) ToGrpcFilter() *pb.L1HandlerFilter
ToGrpcFilter -
type MessageFilter ¶
type MessageFilter struct { Height *IntegerFilter `yaml:"height" validate:"omitempty"` Time *TimeFilter `yaml:"time" validate:"omitempty"` Contract *BytesFilter `yaml:"contract" validate:"omitempty"` From *BytesFilter `yaml:"from" validate:"omitempty"` To *BytesFilter `yaml:"to" validate:"omitempty"` Selector *EqualityFilter `yaml:"selector" validate:"omitempty"` Id *IntegerFilter `yaml:"id" validate:"omitempty"` }
MessageFilter -
func (MessageFilter) ToGrpcFilter ¶
func (f MessageFilter) ToGrpcFilter() *pb.MessageFilter
ToGrpcFilter -
type Server ¶
type Server struct { modules.BaseModule pb.UnimplementedIndexerServiceServer GRPC *grpcSDK.Server // contains filtered or unexported fields }
Server -
func (*Server) JSONSchemaForClass ¶
JSONSchemaForClass -
func (*Server) JSONSchemaForContract ¶
JSONSchemaForContract -
func (*Server) Subscribe ¶
func (module *Server) Subscribe(req *pb.SubscribeRequest, stream pb.IndexerService_SubscribeServer) error
Subscribe -
func (*Server) Unsubscribe ¶
func (module *Server) Unsubscribe(ctx context.Context, req *generalPB.UnsubscribeRequest) (*generalPB.UnsubscribeResponse, error)
Unsubscribe -
type StorageDiffFilter ¶
type StorageDiffFilter struct { Height *IntegerFilter `yaml:"height" validate:"omitempty"` Contract *BytesFilter `yaml:"contract" validate:"omitempty"` Key *EqualityFilter `yaml:"key" validate:"omitempty"` Id *IntegerFilter `yaml:"id" validate:"omitempty"` }
StorageDiffFilter -
func (StorageDiffFilter) ToGrpcFilter ¶
func (f StorageDiffFilter) ToGrpcFilter() *pb.StorageDiffFilter
ToGrpcFilter -
type Stream ¶
type Stream struct {
// contains filtered or unexported fields
}
Stream -
func NewStream ¶
func NewStream(stream *grpcSDK.Stream[pb.Subscription], request *pb.SubscribeRequest, id uint64) *Stream
NewStream -
type StringFilter ¶
type StringFilter struct { Eq string `yaml:"eq" validate:"omitempty"` In []string `yaml:"in" validate:"omitempty"` }
StringFilter -
func (StringFilter) ToGrpcFilter ¶
func (f StringFilter) ToGrpcFilter() *pb.StringFilter
ToGrpcFilter -
type Subscription ¶
type Subscription struct { Head bool `yaml:"head" validate:"omitempty"` InvokeFilters []*InvokeFilters `yaml:"invokes" validate:"omitempty"` DeclareFilters []*DeclareFilters `yaml:"declares" validate:"omitempty"` DeployFilters []*DeployFilters `yaml:"deploys" validate:"omitempty"` DeployAccountFilters []*DeployAccountFilters `yaml:"deploy_accounts" validate:"omitempty"` L1HandlerFilter []*L1HandlerFilters `yaml:"l1_handlers" validate:"omitempty"` InternalFilter []*InternalFilters `yaml:"internals" validate:"omitempty"` FeeFilter []*FeeFilters `yaml:"fees" validate:"omitempty"` EventFilter []*EventFilter `yaml:"events" validate:"omitempty"` MessageFilter []*MessageFilter `yaml:"messages" validate:"omitempty"` TransferFilter []*TransferFilter `yaml:"transfers" validate:"omitempty"` StorageDiffFilter []*StorageDiffFilter `yaml:"storage_diffs" validate:"omitempty"` TokenBalanceFilter []*TokenBalanceFilter `yaml:"token_balances" validate:"omitempty"` AddressFilter []*AddressFilter `yaml:"addresses" validate:"omitempty"` TokenFilter []*TokenFilter `yaml:"tokens" validate:"omitempty"` }
Subscription -
func (Subscription) ToGrpcFilter ¶
func (f Subscription) ToGrpcFilter() *pb.SubscribeRequest
ToGrpcFilter -
type TimeFilter ¶
type TimeFilter struct { Gt uint64 `yaml:"gt" validate:"omitempty"` Gte uint64 `yaml:"gte" validate:"omitempty"` Lt uint64 `yaml:"lt" validate:"omitempty"` Lte uint64 `yaml:"lte" validate:"omitempty"` Between *BetweenInteger `yaml:"between" validate:"omitempty"` }
TimeFilter -
type TokenBalanceFilter ¶
type TokenBalanceFilter struct { Owner *BytesFilter `yaml:"owner" validate:"omitempty"` Contract *BytesFilter `yaml:"contract" validate:"omitempty"` TokenId *StringFilter `yaml:"token_id" validate:"omitempty"` }
TokenBalanceFilter -
func (TokenBalanceFilter) ToGrpcFilter ¶
func (f TokenBalanceFilter) ToGrpcFilter() *pb.TokenBalanceFilter
ToGrpcFilter -
type TokenFilter ¶
type TokenFilter struct { TokenId *StringFilter `yaml:"token_id" validate:"omitempty"` Contract *BytesFilter `yaml:"contract" validate:"omitempty"` Id *IntegerFilter `yaml:"id" validate:"omitempty"` Type *EnumStringFilter `yaml:"type" validate:"omitempty"` }
TokenFilter -
func (TokenFilter) ToGrpcFilter ¶
func (f TokenFilter) ToGrpcFilter() *pb.TokenFilter
ToGrpcFilter -
type TransferFilter ¶
type TransferFilter struct { Height *IntegerFilter `yaml:"height" validate:"omitempty"` Time *TimeFilter `yaml:"time" validate:"omitempty"` Contract *BytesFilter `yaml:"contract" validate:"omitempty"` From *BytesFilter `yaml:"from" validate:"omitempty"` To *BytesFilter `yaml:"to" validate:"omitempty"` TokenId *StringFilter `yaml:"token_id" validate:"omitempty"` Id *IntegerFilter `yaml:"id" validate:"omitempty"` }
TransferFilter -
func (TransferFilter) ToGrpcFilter ¶
func (f TransferFilter) ToGrpcFilter() *pb.TransferFilter
ToGrpcFilter -