Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrUnknownOracleSource = errors.New("unknown oracle source")
ErrUnknownOracleSource is used when the input data is originated from an unknown, unsupported or unspecified oracle source.
Functions ¶
This section is empty.
Types ¶
type Adaptor ¶
Adaptor represents an oracle adaptor that consumes and normalises data from a specific type of oracle.
type Adaptors ¶
type Adaptors struct { // Adaptors holds all the supported Adaptors sorted by source. Adaptors map[commandspb.OracleDataSubmission_OracleSource]Adaptor }
Adaptors normalises the input data into an oracles.OracleData according to its source.
func (*Adaptors) Normalise ¶
func (a *Adaptors) Normalise(txPubKey crypto.PublicKey, data commandspb.OracleDataSubmission) (*oracles.OracleData, error)
Normalise normalises the input data into an oracles.OracleData based on its source.
type JSONAdaptor ¶
type JSONAdaptor struct{}
JSONAdaptor is an oracle Adaptor for simple oracle data broadcasting. Link: https://compound.finance/docs/prices
func (*JSONAdaptor) Normalise ¶
func (a *JSONAdaptor) Normalise(txPubKey crypto.PublicKey, data []byte) (*oracles.OracleData, error)
Normalise normalises a JSON payload into an oracles.OracleData.
type OpenOracleAdaptor ¶
type OpenOracleAdaptor struct{}
OpenOracleAdaptor is a specific oracle Adaptor for Open Oracle / Open Price Feed standard. Link: https://compound.finance/docs/prices
func NewOpenOracleAdaptor ¶
func NewOpenOracleAdaptor() *OpenOracleAdaptor
NewOpenOracleAdaptor creates a new OpenOracleAdaptor.
func (*OpenOracleAdaptor) Normalise ¶
func (a *OpenOracleAdaptor) Normalise(_ crypto.PublicKey, data []byte) (*oracles.OracleData, error)
Normalise normalises an Open Oracle / Open Price Feed payload into an oracles.OracleData. The public key from the transaction is not used, only those from the Open Oracle data.