Documentation ¶
Index ¶
- Constants
- Variables
- func NewConfigProvider(chainID string, contractAddress string, basereader starknet.Reader, cfg Config, ...) (*configProvider, error)
- func NewContractCache(cfg Config, reader Reader, lggr logger.Logger) *contractCache
- func NewContractTransmitter(reader *transmissionsCache, contractAddress string, senderAddress string, ...) *contractTransmitter
- func NewMedianProvider(chainID string, contractAddress string, senderAddress string, ...) (*medianProvider, error)
- func NewOffchainConfigDigester(chainID, contract string) offchainConfigDigester
- func NewTransmissionsCache(cfg Config, reader Reader, lggr logger.Logger) *transmissionsCache
- func ParseConfigSetEvent(event starknetrpc.EmittedEvent) (types.ContractConfig, error)
- func XXXMustBytesToConfigDigest(b []byte) types.ConfigDigest
- type BillingDetails
- type Client
- func (c *Client) BaseReader() starknet.Reader
- func (c *Client) BillingDetails(ctx context.Context, address *felt.Felt) (bd BillingDetails, err error)
- func (c *Client) ConfigFromEventAt(ctx context.Context, address *felt.Felt, blockNum uint64) (cc ContractConfig, err error)
- func (c *Client) LatestConfigDetails(ctx context.Context, address *felt.Felt) (ccd ContractConfigDetails, err error)
- func (c *Client) LatestRoundData(ctx context.Context, address *felt.Felt) (round RoundData, err error)
- func (c *Client) LatestTransmissionDetails(ctx context.Context, address *felt.Felt) (td TransmissionDetails, err error)
- func (c *Client) LinkAvailableForPayment(ctx context.Context, address *felt.Felt) (*big.Int, error)
- func (c *Client) NewTransmissionsFromEventsAt(ctx context.Context, address *felt.Felt, blockNum uint64) (events []NewTransmissionEvent, err error)
- type Config
- type ContractConfig
- type ContractConfigDetails
- type NewTransmissionEvent
- type OCR2Reader
- type Reader
- type RoundData
- type Tracker
- type TransmissionDetails
Constants ¶
View Source
const ConfigDigestPrefixStarknet types.ConfigDigestPrefix = 4
TODO: use libocr constant
Variables ¶
View Source
var ( MaxObservers = 31 // Event selectors NewTransmissionEventSelector = "019e22f866f4c5aead2809bf160d2b29e921e335d899979732101c6f3c38ff81" ConfigSetEventSelector = "9a144bf4a6a8fd083c93211e163e59221578efcc86b93f8c97c620e7b9608a" )
Functions ¶
func NewConfigProvider ¶
func NewContractCache ¶
func NewContractTransmitter ¶
func NewMedianProvider ¶
func NewOffchainConfigDigester ¶
func NewOffchainConfigDigester(chainID, contract string) offchainConfigDigester
func NewTransmissionsCache ¶
func ParseConfigSetEvent ¶
func ParseConfigSetEvent(event starknetrpc.EmittedEvent) (types.ContractConfig, error)
ParseConfigSetEvent is decoding binary felt data as the libocr ContractConfig type
func XXXMustBytesToConfigDigest ¶
func XXXMustBytesToConfigDigest(b []byte) types.ConfigDigest
Types ¶
type BillingDetails ¶
func NewBillingDetails ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) BaseReader ¶
func (*Client) BillingDetails ¶
func (*Client) ConfigFromEventAt ¶
func (*Client) LatestConfigDetails ¶
func (*Client) LatestRoundData ¶
func (*Client) LatestTransmissionDetails ¶
func (*Client) LinkAvailableForPayment ¶
func (*Client) NewTransmissionsFromEventsAt ¶
func (c *Client) NewTransmissionsFromEventsAt(ctx context.Context, address *felt.Felt, blockNum uint64) (events []NewTransmissionEvent, err error)
NewTransmissionsFromEventsAt finds events of type new_transmission emitted by the contract address in a given block number.
type ContractConfig ¶
type ContractConfig struct { Config types.ContractConfig ConfigBlock uint64 }
type ContractConfigDetails ¶
type ContractConfigDetails struct { Block uint64 Digest types.ConfigDigest }
func NewContractConfigDetails ¶
func NewContractConfigDetails(blockNum *big.Int, digest [32]byte) (ccd ContractConfigDetails, err error)
type NewTransmissionEvent ¶
type NewTransmissionEvent struct { RoundId uint32 //nolint:revive LatestAnswer *big.Int Transmitter *felt.Felt LatestTimestamp time.Time Observers []uint8 ObservationsLen uint32 Observations []*big.Int JuelsPerFeeCoin *big.Int GasPrice *big.Int ConfigDigest types.ConfigDigest Epoch uint32 Round uint8 Reimbursement *big.Int }
NewTransmissionEvent represents the 'NewTransmission' event
func ParseNewTransmissionEvent ¶
func ParseNewTransmissionEvent(event starknetrpc.EmittedEvent) (NewTransmissionEvent, error)
ParseNewTransmissionEvent is decoding binary felt data as the NewTransmissionEvent type
type OCR2Reader ¶
type OCR2Reader interface { LatestConfigDetails(context.Context, *felt.Felt) (ContractConfigDetails, error) LatestTransmissionDetails(context.Context, *felt.Felt) (TransmissionDetails, error) LatestRoundData(context.Context, *felt.Felt) (RoundData, error) LinkAvailableForPayment(context.Context, *felt.Felt) (*big.Int, error) ConfigFromEventAt(context.Context, *felt.Felt, uint64) (ContractConfig, error) NewTransmissionsFromEventsAt(context.Context, *felt.Felt, uint64) ([]NewTransmissionEvent, error) BillingDetails(context.Context, *felt.Felt) (BillingDetails, error) BaseReader() starknet.Reader }
type Reader ¶
type Reader interface { types.ContractConfigTracker median.MedianContract }
func NewContractReader ¶
func NewContractReader(address string, reader OCR2Reader, lggr logger.Logger) Reader
type RoundData ¶
type TransmissionDetails ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.