sdk

package
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 29, 2024 License: Apache-2.0 Imports: 15 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithApi added in v0.0.4

func WithApi(a string) error

func WithApiKey added in v0.0.4

func WithApiKey(k string) error

func WithToken added in v0.0.4

func WithToken(t string) error

func WithUrl added in v0.0.4

func WithUrl(u string) error

Types

type Config added in v0.0.3

type Config struct {
	AppName    string     `json:"app_name"`
	Contracts  []Contract `json:"contracts"`
	StartBlock uint64     `json:"start_block"`
}

Indexer configuration

func (Config) FilterByName added in v0.0.3

func (c Config) FilterByName(name string) Config

type ConsumerHandleFunc

type ConsumerHandleFunc func(string, uint64, RawEvent) error

type Contract added in v0.0.3

type Contract struct {
	Events  map[string]string `json:"events"`
	Name    string            `json:"name"`
	Address string            `json:"address"`
}

func (Contract) Call added in v0.0.3

func (c Contract) Call(ctx context.Context, client rpc.RpcProvider, fn string, calldata ...*felt.Felt) ([]*felt.Felt, error)

type HandlerCancelFunc

type HandlerCancelFunc func()

func RegisterHandler

func RegisterHandler(n string, s string, cb ConsumerHandleFunc) (HandlerCancelFunc, error)

type MiddlewareHandleFunc

type MiddlewareHandleFunc func(ConsumerHandleFunc) ConsumerHandleFunc

type RawEvent

type RawEvent struct {
	RecordedAt  time.Time `json:"recorded_at"`
	EventId     string    `json:"event_id"`
	FromAddress string    `json:"from_address"`
	Keys        []string  `json:"keys"`
	Data        []string  `json:"data"`
}

Event directly pulled onchain

type RegisterResponse added in v0.0.3

type RegisterResponse struct {
	AppName string `json:"app_name"`
	Hash    string `json:"hash"`
}

RegisterResponse

func Configure added in v0.0.4

func Configure(c Config) (*RegisterResponse, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL