Documentation
      ¶
    
    
  
    
  
    Index ¶
- Variables
 - func GetConsensusMarketStatus(paos []PAOMarketStatus, f int) (uint32, error)
 - type DataSource
 - type Factory
 - type MercuryObservationProto
 - func (*MercuryObservationProto) Descriptor() ([]byte, []int)deprecated
 - func (x *MercuryObservationProto) GetBenchmarkPrice() []byte
 - func (x *MercuryObservationProto) GetLinkFee() []byte
 - func (x *MercuryObservationProto) GetLinkFeeValid() bool
 - func (x *MercuryObservationProto) GetMarketStatus() uint32
 - func (x *MercuryObservationProto) GetMarketStatusValid() bool
 - func (x *MercuryObservationProto) GetMaxFinalizedTimestamp() int64
 - func (x *MercuryObservationProto) GetMaxFinalizedTimestampValid() bool
 - func (x *MercuryObservationProto) GetNativeFee() []byte
 - func (x *MercuryObservationProto) GetNativeFeeValid() bool
 - func (x *MercuryObservationProto) GetPricesValid() bool
 - func (x *MercuryObservationProto) GetTimestamp() uint32
 - func (*MercuryObservationProto) ProtoMessage()
 - func (x *MercuryObservationProto) ProtoReflect() protoreflect.Message
 - func (x *MercuryObservationProto) Reset()
 - func (x *MercuryObservationProto) String() string
 
- type PAO
 - type PAOMarketStatus
 
Constants ¶
This section is empty.
Variables ¶
      View Source
      
  
    var File_mercury_observation_v4_proto protoreflect.FileDescriptor
    
      View Source
      
  
var MissingPrice = big.NewInt(-1)
    Functions ¶
func GetConsensusMarketStatus ¶
func GetConsensusMarketStatus(paos []PAOMarketStatus, f int) (uint32, error)
GetConsensusMarketStatus gets the most common status, provided that it is at least F+1.
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) (v4.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 NewFactory ¶
func NewFactory(ds DataSource, lggr logger.Logger, occ mercurytypes.OnchainConfigCodec, rc v4.ReportCodec) Factory
func (Factory) NewMercuryPlugin ¶
func (fac Factory) NewMercuryPlugin(ctx context.Context, configuration ocr3types.MercuryPluginConfig) (ocr3types.MercuryPlugin, ocr3types.MercuryPluginInfo, error)
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"`
	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"`
	MarketStatus               uint32 `protobuf:"varint,12,opt,name=marketStatus,proto3" json:"marketStatus,omitempty"`
	MarketStatusValid          bool   `protobuf:"varint,13,opt,name=marketStatusValid,proto3" json:"marketStatusValid,omitempty"`
	// contains filtered or unexported fields
}
    
        
          
            func (*MercuryObservationProto) Descriptor
            deprecated
            
          
  
    
  
      
      func (*MercuryObservationProto) Descriptor() ([]byte, []int)
Deprecated: Use MercuryObservationProto.ProtoReflect.Descriptor instead.
func (*MercuryObservationProto) GetBenchmarkPrice ¶
func (x *MercuryObservationProto) GetBenchmarkPrice() []byte
func (*MercuryObservationProto) GetLinkFee ¶
func (x *MercuryObservationProto) GetLinkFee() []byte
func (*MercuryObservationProto) GetLinkFeeValid ¶
func (x *MercuryObservationProto) GetLinkFeeValid() bool
func (*MercuryObservationProto) GetMarketStatus ¶
func (x *MercuryObservationProto) GetMarketStatus() uint32
func (*MercuryObservationProto) GetMarketStatusValid ¶
func (x *MercuryObservationProto) GetMarketStatusValid() 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
	GetMaxFinalizedTimestamp() (int64, bool)
	GetLinkFee() (*big.Int, bool)
	GetNativeFee() (*big.Int, bool)
	GetMarketStatus() (uint32, bool)
}
    type PAOMarketStatus ¶
 Click to show internal directories. 
   Click to hide internal directories.