starknet

package
v0.0.0-...-0cd4e98 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfigSet = ConfigSet{
	OCR2CachePollPeriod: 5 * time.Second,
	OCR2CacheTTL:        time.Minute,
}

Functions

func NewConfig

func NewConfig(dbCfg db.ChainCfg, lggr logger.Logger) *config

Types

type CallOps

type CallOps struct {
	ContractAddress string
	Selector        string
	Calldata        []string
}

type Chain

type Chain interface {
	types.Service

	Config() Config
	UpdateConfig(*db.ChainCfg)
}

type ChainSet

type ChainSet interface {
	types.Service

	Chain(ctx context.Context, id string) (Chain, error)
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(chainID string, lggr logger.Logger) (*Client, error)

func (*Client) BlockByNumber

func (c *Client) BlockByNumber(ctx context.Context, blockNum uint64) (block *caigogw.Block, err error)

func (*Client) CallContract

func (c *Client) CallContract(ctx context.Context, ops CallOps) (res []string, err error)

func (*Client) ChainID

func (c *Client) ChainID(ctx context.Context) (id string, err error)

func (*Client) LatestBlockHeight

func (c *Client) LatestBlockHeight(ctx context.Context) (height uint64, err error)

type Config

type Config interface {
	OCR2CachePollPeriod() time.Duration
	OCR2CacheTTL() time.Duration

	Update(db.ChainCfg)
}

type ConfigSet

type ConfigSet struct {
	OCR2CachePollPeriod time.Duration
	OCR2CacheTTL        time.Duration
}

type Reader

type Reader interface {
	ChainID(context.Context) (string, error)
	LatestBlockHeight(context.Context) (uint64, error)
	BlockByNumber(context.Context, uint64) (*caigogw.Block, error)

	CallContract(context.Context, CallOps) ([]string, error)
}

type ReaderWriter

type ReaderWriter interface {
	Reader
	Writer
}

type Writer

type Writer interface {
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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