mercury

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: MIT Imports: 7 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainReader

type ChainReader interface {
	// LatestHeads returns an ordered list of the latest specified number of heads
	LatestHeads(context.Context, int) ([]Head, error)
}

type FeedID added in v1.3.0

type FeedID [32]byte

func (FeedID) Hex added in v1.3.0

func (f FeedID) Hex() string

func (FeedID) IsV1 added in v1.3.0

func (f FeedID) IsV1() bool

func (FeedID) IsV2 added in v1.3.0

func (f FeedID) IsV2() bool

func (FeedID) IsV3 added in v1.3.0

func (f FeedID) IsV3() bool

func (FeedID) IsV4 added in v1.3.0

func (f FeedID) IsV4() bool

func (FeedID) String added in v1.3.0

func (f FeedID) String() string

func (*FeedID) UnmarshalText added in v1.3.0

func (f *FeedID) UnmarshalText(input []byte) error

func (FeedID) Version added in v1.3.0

func (f FeedID) Version() FeedVersion

type FeedVersion added in v1.3.0

type FeedVersion uint16
const (
	REPORT_V1 FeedVersion
	REPORT_V2
	REPORT_V3
	REPORT_V4
)
type Head struct {
	Number    uint64
	Hash      []byte
	Timestamp uint64
}

type ObsResult

type ObsResult[T any] struct {
	Val T
	Err error
}

type OnchainConfig

type OnchainConfig struct {
	// applies to all values: price, bid and ask
	Min *big.Int
	Max *big.Int
}

type OnchainConfigCodec

type OnchainConfigCodec interface {
	Encode(context.Context, OnchainConfig) ([]byte, error)
	Decode(context.Context, []byte) (OnchainConfig, error)
}

type ServerFetcher

type ServerFetcher interface {
	// FetchInitialMaxFinalizedBlockNumber should fetch the initial max finalized block number
	FetchInitialMaxFinalizedBlockNumber(context.Context) (*int64, error)
	LatestPrice(ctx context.Context, feedID [32]byte) (*big.Int, error)
	LatestTimestamp(context.Context) (int64, error)
}

type Transmitter

type Transmitter interface {
	ServerFetcher
	// NOTE: Mercury doesn't actually transmit on-chain, so there is no
	// "contract" involved with the transmitter.
	// - Transmit should be implemented and send to Mercury server
	// - LatestConfigDigestAndEpoch is a stub method, does not need to do anything
	// - FromAccount() should return CSA public key
	ocrtypes.ContractTransmitter
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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