ocr3cap

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2024 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataFeedsConsensus

type DataFeedsConsensus struct {
	// Config corresponds to the JSON schema field "config".
	Config DataFeedsConsensusConfig `json:"config" yaml:"config" mapstructure:"config"`

	// Inputs corresponds to the JSON schema field "inputs".
	Inputs DataFeedsConsensusInputs `json:"inputs" yaml:"inputs" mapstructure:"inputs"`

	// Outputs corresponds to the JSON schema field "outputs".
	Outputs SignedReport `json:"outputs" yaml:"outputs" mapstructure:"outputs"`
}

OCR3 consensus exposed as a capability.

func (*DataFeedsConsensus) UnmarshalJSON

func (j *DataFeedsConsensus) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type DataFeedsConsensusConfig

type DataFeedsConsensusConfig struct {
	// AggregationConfig corresponds to the JSON schema field "aggregation_config".
	AggregationConfig DataFeedsConsensusConfigAggregationConfig `json:"aggregation_config" yaml:"aggregation_config" mapstructure:"aggregation_config"`

	// AggregationMethod corresponds to the JSON schema field "aggregation_method".
	AggregationMethod DataFeedsConsensusConfigAggregationMethod `json:"aggregation_method" yaml:"aggregation_method" mapstructure:"aggregation_method"`

	// Encoder corresponds to the JSON schema field "encoder".
	Encoder Encoder `json:"encoder" yaml:"encoder" mapstructure:"encoder"`

	// EncoderConfig corresponds to the JSON schema field "encoder_config".
	EncoderConfig EncoderConfig `json:"encoder_config" yaml:"encoder_config" mapstructure:"encoder_config"`

	// KeyId corresponds to the JSON schema field "key_id".
	KeyId KeyId `json:"key_id" yaml:"key_id" mapstructure:"key_id"`

	// ReportId corresponds to the JSON schema field "report_id".
	ReportId ReportId `json:"report_id" yaml:"report_id" mapstructure:"report_id"`
}

func (DataFeedsConsensusConfig) New

func (*DataFeedsConsensusConfig) UnmarshalJSON

func (j *DataFeedsConsensusConfig) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type DataFeedsConsensusConfigAggregationConfig

type DataFeedsConsensusConfigAggregationConfig struct {
	// Allowed partial staleness as a number between 0 and 1.
	AllowedPartialStaleness string `json:"allowedPartialStaleness" yaml:"allowedPartialStaleness" mapstructure:"allowedPartialStaleness"`

	// Feeds corresponds to the JSON schema field "feeds".
	Feeds DataFeedsConsensusConfigAggregationConfigFeeds `json:"feeds" yaml:"feeds" mapstructure:"feeds"`
}

func (*DataFeedsConsensusConfigAggregationConfig) UnmarshalJSON

UnmarshalJSON implements json.Unmarshaler.

type DataFeedsConsensusConfigAggregationConfigFeeds

type DataFeedsConsensusConfigAggregationConfigFeeds map[string]FeedValue

type DataFeedsConsensusConfigAggregationMethod

type DataFeedsConsensusConfigAggregationMethod string
const DataFeedsConsensusConfigAggregationMethodDataFeeds DataFeedsConsensusConfigAggregationMethod = "data_feeds"

func (*DataFeedsConsensusConfigAggregationMethod) UnmarshalJSON

UnmarshalJSON implements json.Unmarshaler.

type DataFeedsConsensusInput

type DataFeedsConsensusInput struct {
	Observations sdk.CapDefinition[[]streams.Feed]
}

func (DataFeedsConsensusInput) ToSteps

func (input DataFeedsConsensusInput) ToSteps() sdk.StepInputs

type DataFeedsConsensusInputs

type DataFeedsConsensusInputs struct {
	// Observations corresponds to the JSON schema field "observations".
	Observations []streams.Feed `json:"observations" yaml:"observations" mapstructure:"observations"`
}

func (*DataFeedsConsensusInputs) UnmarshalJSON

func (j *DataFeedsConsensusInputs) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Encoder

type Encoder string
const EncoderEVM Encoder = "EVM"
const EncoderValueMap Encoder = "ValueMap"

func Encoders added in v0.4.0

func Encoders() []Encoder

func (*Encoder) UnmarshalJSON

func (j *Encoder) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type EncoderCap

type EncoderCap sdk.CapDefinition[Encoder]

func EncoderWrapper added in v0.4.0

func EncoderWrapper(raw sdk.CapDefinition[Encoder]) EncoderCap

EncoderWrapper allows access to field from an sdk.CapDefinition[Encoder]

type EncoderConfig

type EncoderConfig map[string]interface{}

type EncoderConfigCap

type EncoderConfigCap sdk.CapDefinition[EncoderConfig]

func EncoderConfigWrapper added in v0.4.0

func EncoderConfigWrapper(raw sdk.CapDefinition[EncoderConfig]) EncoderConfigCap

EncoderConfigWrapper allows access to field from an sdk.CapDefinition[EncoderConfig]

type FeedValue

type FeedValue struct {
	// The deviation that is required to generate a new report. Expressed as a
	// percentage. For example, 0.01 is 1% deviation.
	Deviation string `json:"deviation" yaml:"deviation" mapstructure:"deviation"`

	// The interval in seconds after which a new report is generated, regardless of
	// whether any deviations have occurred. New reports reset the timer.
	Heartbeat uint64 `json:"heartbeat" yaml:"heartbeat" mapstructure:"heartbeat"`

	// An optional remapped ID for the feed.
	RemappedID *string `json:"remappedID,omitempty" yaml:"remappedID,omitempty" mapstructure:"remappedID,omitempty"`
}

func (*FeedValue) UnmarshalJSON

func (j *FeedValue) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type FeedValueCap

type FeedValueCap interface {
	sdk.CapDefinition[FeedValue]
	Deviation() sdk.CapDefinition[string]
	Heartbeat() sdk.CapDefinition[uint64]
	RemappedID() sdk.CapDefinition[string]
	// contains filtered or unexported methods
}

func ConstantFeedValue added in v0.4.0

func ConstantFeedValue(value FeedValue) FeedValueCap

func FeedValueWrapper added in v0.4.0

func FeedValueWrapper(raw sdk.CapDefinition[FeedValue]) FeedValueCap

FeedValueWrapper allows access to field from an sdk.CapDefinition[FeedValue]

func NewFeedValueFromFields

func NewFeedValueFromFields(
	deviation sdk.CapDefinition[string],
	heartbeat sdk.CapDefinition[uint64],
	remappedID sdk.CapDefinition[string]) FeedValueCap

type IdenticalConsensusConfig

type IdenticalConsensusConfig[T any] struct {
	Encoder       Encoder
	EncoderConfig EncoderConfig
	ReportID      ReportId
	KeyID         KeyId
}

func (IdenticalConsensusConfig[T]) New

type IdenticalConsensusInput

type IdenticalConsensusInput[T any] struct {
	Observation   sdk.CapDefinition[T]
	Encoder       Encoder
	EncoderConfig EncoderConfig
}

func (IdenticalConsensusInput[T]) ToSteps

func (input IdenticalConsensusInput[T]) ToSteps() sdk.StepInputs

type KeyId added in v0.4.0

type KeyId string

type KeyIdCap added in v0.4.0

type KeyIdCap sdk.CapDefinition[KeyId]

func KeyIdWrapper added in v0.4.0

func KeyIdWrapper(raw sdk.CapDefinition[KeyId]) KeyIdCap

KeyIdWrapper allows access to field from an sdk.CapDefinition[KeyId]

type ReduceConsensusConfig added in v0.4.0

type ReduceConsensusConfig[T any] struct {
	Encoder           Encoder
	EncoderConfig     EncoderConfig
	ReportID          ReportId
	KeyID             KeyId
	AggregationConfig aggregators.ReduceAggConfig
}

func (ReduceConsensusConfig[T]) New added in v0.4.0

type ReduceConsensusInput added in v0.4.0

type ReduceConsensusInput[T any] struct {
	Observation   sdk.CapDefinition[T]
	Encoder       Encoder
	EncoderConfig EncoderConfig
}

func (ReduceConsensusInput[T]) ToSteps added in v0.4.0

func (input ReduceConsensusInput[T]) ToSteps() sdk.StepInputs

type ReportId

type ReportId string

func (*ReportId) UnmarshalJSON

func (j *ReportId) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ReportIdCap

type ReportIdCap sdk.CapDefinition[ReportId]

func ReportIdWrapper added in v0.4.0

func ReportIdWrapper(raw sdk.CapDefinition[ReportId]) ReportIdCap

ReportIdWrapper allows access to field from an sdk.CapDefinition[ReportId]

type SignedReport

type SignedReport struct {
	// Context corresponds to the JSON schema field "Context".
	Context []uint8 `json:"Context" yaml:"Context" mapstructure:"Context"`

	// ID corresponds to the JSON schema field "ID".
	ID []uint8 `json:"ID" yaml:"ID" mapstructure:"ID"`

	// Report corresponds to the JSON schema field "Report".
	Report []uint8 `json:"Report" yaml:"Report" mapstructure:"Report"`

	// Signatures corresponds to the JSON schema field "Signatures".
	Signatures [][]uint8 `json:"Signatures" yaml:"Signatures" mapstructure:"Signatures"`
}

func (*SignedReport) UnmarshalJSON

func (j *SignedReport) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type SignedReportCap

type SignedReportCap interface {
	sdk.CapDefinition[SignedReport]
	Context() sdk.CapDefinition[[]uint8]
	ID() sdk.CapDefinition[[]uint8]
	Report() sdk.CapDefinition[[]uint8]
	Signatures() sdk.CapDefinition[[][]uint8]
	// contains filtered or unexported methods
}

func ConstantSignedReport added in v0.4.0

func ConstantSignedReport(value SignedReport) SignedReportCap

func NewSignedReportFromFields

func NewSignedReportFromFields(
	context sdk.CapDefinition[[]uint8],
	iD sdk.CapDefinition[[]uint8],
	report sdk.CapDefinition[[]uint8],
	signatures sdk.CapDefinition[[][]uint8]) SignedReportCap

func SignedReportWrapper added in v0.4.0

func SignedReportWrapper(raw sdk.CapDefinition[SignedReport]) SignedReportCap

SignedReportWrapper allows access to field from an sdk.CapDefinition[SignedReport]

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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