v3

package
v0.0.0-...-a5a1065 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 19 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_mercury_observation_v3_proto protoreflect.FileDescriptor
View Source
var MissingPrice = big.NewInt(-1)

Functions

This section is empty.

Types

type DataSource

type DataSource interface {
	// Observe queries the data source. Returns a value or an error. Once the
	// context is expires, Observe may still do cheap computations and return a
	// result, but should return as quickly as possible.
	//
	// More details: In the current implementation, the context passed to
	// Observe will time out after MaxDurationObservation. However, Observe
	// should *not* make any assumptions about context timeout behavior. Once
	// the context times out, Observe should prioritize returning as quickly as
	// possible, but may still perform fast computations to return a result
	// rather than error. For example, if Observe medianizes a number of data
	// sources, some of which already returned a result to Observe prior to the
	// context's expiry, Observe might still compute their median, and return it
	// instead of an error.
	//
	// Important: Observe should not perform any potentially time-consuming
	// actions like database access, once the context passed has expired.
	Observe(ctx context.Context, repts types.ReportTimestamp, fetchMaxFinalizedTimestamp bool) (v3.Observation, error)
}

DataSource implementations must be thread-safe. Observe may be called by many different threads concurrently.

type Factory

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

func (Factory) NewMercuryPlugin

type MercuryObservationProto

type MercuryObservationProto struct {
	Timestamp                  uint32 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	BenchmarkPrice             []byte `protobuf:"bytes,2,opt,name=benchmarkPrice,proto3" json:"benchmarkPrice,omitempty"`
	Bid                        []byte `protobuf:"bytes,3,opt,name=bid,proto3" json:"bid,omitempty"`
	Ask                        []byte `protobuf:"bytes,4,opt,name=ask,proto3" json:"ask,omitempty"`
	PricesValid                bool   `protobuf:"varint,5,opt,name=pricesValid,proto3" json:"pricesValid,omitempty"`
	MaxFinalizedTimestamp      int64  `protobuf:"varint,6,opt,name=maxFinalizedTimestamp,proto3" json:"maxFinalizedTimestamp,omitempty"`
	MaxFinalizedTimestampValid bool   `protobuf:"varint,7,opt,name=maxFinalizedTimestampValid,proto3" json:"maxFinalizedTimestampValid,omitempty"`
	LinkFee                    []byte `protobuf:"bytes,8,opt,name=linkFee,proto3" json:"linkFee,omitempty"`
	LinkFeeValid               bool   `protobuf:"varint,9,opt,name=linkFeeValid,proto3" json:"linkFeeValid,omitempty"`
	NativeFee                  []byte `protobuf:"bytes,10,opt,name=nativeFee,proto3" json:"nativeFee,omitempty"`
	NativeFeeValid             bool   `protobuf:"varint,11,opt,name=nativeFeeValid,proto3" json:"nativeFeeValid,omitempty"`
	// contains filtered or unexported fields
}

func (*MercuryObservationProto) Descriptor deprecated

func (*MercuryObservationProto) Descriptor() ([]byte, []int)

Deprecated: Use MercuryObservationProto.ProtoReflect.Descriptor instead.

func (*MercuryObservationProto) GetAsk

func (x *MercuryObservationProto) GetAsk() []byte

func (*MercuryObservationProto) GetBenchmarkPrice

func (x *MercuryObservationProto) GetBenchmarkPrice() []byte

func (*MercuryObservationProto) GetBid

func (x *MercuryObservationProto) GetBid() []byte

func (*MercuryObservationProto) GetLinkFee

func (x *MercuryObservationProto) GetLinkFee() []byte

func (*MercuryObservationProto) GetLinkFeeValid

func (x *MercuryObservationProto) GetLinkFeeValid() bool

func (*MercuryObservationProto) GetMaxFinalizedTimestamp

func (x *MercuryObservationProto) GetMaxFinalizedTimestamp() int64

func (*MercuryObservationProto) GetMaxFinalizedTimestampValid

func (x *MercuryObservationProto) GetMaxFinalizedTimestampValid() bool

func (*MercuryObservationProto) GetNativeFee

func (x *MercuryObservationProto) GetNativeFee() []byte

func (*MercuryObservationProto) GetNativeFeeValid

func (x *MercuryObservationProto) GetNativeFeeValid() bool

func (*MercuryObservationProto) GetPricesValid

func (x *MercuryObservationProto) GetPricesValid() bool

func (*MercuryObservationProto) GetTimestamp

func (x *MercuryObservationProto) GetTimestamp() uint32

func (*MercuryObservationProto) ProtoMessage

func (*MercuryObservationProto) ProtoMessage()

func (*MercuryObservationProto) ProtoReflect

func (x *MercuryObservationProto) ProtoReflect() protoreflect.Message

func (*MercuryObservationProto) Reset

func (x *MercuryObservationProto) Reset()

func (*MercuryObservationProto) String

func (x *MercuryObservationProto) String() string

type PAO

type PAO interface {
	mercury.PAO
	GetBid() (*big.Int, bool)
	GetAsk() (*big.Int, bool)
	GetMaxFinalizedTimestamp() (int64, bool)
	GetLinkFee() (*big.Int, bool)
	GetNativeFee() (*big.Int, bool)
}

func NewParsedAttributedObservation

func NewParsedAttributedObservation(ts uint32, observer commontypes.OracleID,
	bp *big.Int, bid *big.Int, ask *big.Int, pricesValid bool, mfts int64,
	mftsValid bool, linkFee *big.Int, linkFeeValid bool, nativeFee *big.Int, nativeFeeValid bool) PAO

Jump to

Keyboard shortcuts

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