Documentation
¶
Index ¶
- Constants
- func ConstructMedianPokeMessage(wat string, val *bn.DecFloatPointNumber, age time.Time) []byte
- func ConstructScribeOpPokeMessage(wat string, pokeData PokeData, schnorrData SchnorrData, signersBlob []byte) []byte
- func ConstructScribePokeMessage(wat string, pokeData PokeData) []byte
- func SignersBlob(signers []types.Address, feeds []types.Address, indices []uint8) ([]byte, error)
- type Chainlog
- type ECDSADataStruct
- type FeedsResult
- type Median
- func (m *Median) Address() types.Address
- func (m *Median) Age() contract.TypedSelfCaller[time.Time]
- func (m *Median) Bar() contract.TypedSelfCaller[int]
- func (m *Median) Client() rpc.RPC
- func (m *Median) Poke(vals []MedianVal) contract.SelfTransactableCaller
- func (m *Median) Val(ctx context.Context) (*bn.DecFixedPointNumber, error)
- func (m *Median) Wat() contract.TypedSelfCaller[string]
- type MedianVal
- type OpScribe
- func (s *OpScribe) OpChallengePeriod() contract.TypedSelfCaller[time.Duration]
- func (s *OpScribe) OpPoke(pokeData PokeData, schnorrData SchnorrData, ecdsaData types.Signature) contract.SelfTransactableCaller
- func (s *OpScribe) Read(ctx context.Context) (PokeData, error)
- func (s *OpScribe) ReadAt(ctx context.Context, readTime time.Time) (PokeData, bool, error)
- func (s *OpScribe) ReadNext(ctx context.Context) (PokeData, bool, error)
- func (s *OpScribe) ReadNextAt(ctx context.Context, readTime time.Time) (PokeData, bool, error)
- func (s *OpScribe) ReadOpPokeData(ctx context.Context) (PokeData, error)
- func (s *OpScribe) ReadPokeData(ctx context.Context) (PokeData, error)
- type PokeData
- type PokeDataStruct
- type SchnorrData
- type SchnorrDataStruct
- type Scribe
- func (s *Scribe) Address() types.Address
- func (s *Scribe) Bar() contract.TypedSelfCaller[int]
- func (s *Scribe) Client() rpc.RPC
- func (s *Scribe) Feeds() contract.TypedSelfCaller[FeedsResult]
- func (s *Scribe) Poke(pokeData PokeData, schnorrData SchnorrData) contract.SelfTransactableCaller
- func (s *Scribe) Read(ctx context.Context) (PokeData, error)
- func (s *Scribe) Wat() contract.TypedSelfCaller[string]
- type TryGetResult
- type WatRegistry
Constants ¶
const MedianPricePrecision = 18
const ScribePricePrecision = 18
Variables ¶
This section is empty.
Functions ¶
func ConstructMedianPokeMessage ¶
ConstructMedianPokeMessage returns the message expected to be signed via ECDSA for calling Median.poke method.
The message structure is defined as: H(val ‖ age ‖ wat)
Where: - val: a price value - age: a time when the price was observed - wat: an asset name
func ConstructScribeOpPokeMessage ¶
func ConstructScribeOpPokeMessage(wat string, pokeData PokeData, schnorrData SchnorrData, signersBlob []byte) []byte
ConstructScribeOpPokeMessage returns the message expected to be signed via ECDSA for calling OpScribe.opPoke method.
The message structure is defined as: H(wat ‖ val ‖ age ‖ signature ‖ commitment ‖ signersBlob)
Where: - wat: an asset name - val: a price value - age: a time when the price was observed - signature: a Schnorr signature - commitment: a Schnorr commitment - signersBlob: a byte slice with signers indexes obtained from a contract
func ConstructScribePokeMessage ¶
ConstructScribePokeMessage returns the message expected to be signed via ECDSA for calling Scribe.poke method.
The message is defined as: H(wat ‖ val ‖ age)
Where: - wat: an asset name - val: a price value - age: a time when the price was observed
Types ¶
type Chainlog ¶
type Chainlog struct {
// contains filtered or unexported fields
}
func (*Chainlog) TryGet ¶
func (w *Chainlog) TryGet(wat string) contract.TypedSelfCaller[TryGetResult]
type ECDSADataStruct ¶
ECDSADataStruct represents the ECDSAData struct in the IScribe interface.
type FeedsResult ¶
type OpScribe ¶
type OpScribe struct {
Scribe
}
func (*OpScribe) OpChallengePeriod ¶
func (s *OpScribe) OpChallengePeriod() contract.TypedSelfCaller[time.Duration]
func (*OpScribe) OpPoke ¶
func (s *OpScribe) OpPoke(pokeData PokeData, schnorrData SchnorrData, ecdsaData types.Signature) contract.SelfTransactableCaller
func (*OpScribe) ReadAt ¶
ReadAt reads the PokeData from the contract using the given readTime as the reference time for determining if the latest optimistic poke is finalized.
If the latest optimistic poke is finalized, the returned PokeData will be the latest optimistic poke. Otherwise, the returned PokeData will be the latest poke.
The returned boolean indicates if the latest optimistic poke is finalized.
func (*OpScribe) ReadNextAt ¶
ReadNextAt reads the next poke data from the contract without checking if the latest optimistic poke is already finalized.
The returned boolean indicates if the latest optimistic poke is finalized.
func (*OpScribe) ReadOpPokeData ¶
type PokeDataStruct ¶
PokeDataStruct represents the PokeData struct in the IScribe interface.
type SchnorrData ¶
type SchnorrDataStruct ¶
type SchnorrDataStruct struct { Signature *big.Int `abi:"signature"` Commitment types.Address `abi:"commitment"` SignersBlob []byte `abi:"signersBlob"` }
SchnorrDataStruct represents the SchnorrData struct in the IScribe interface.
type Scribe ¶
type Scribe struct {
// contains filtered or unexported fields
}
func (*Scribe) Feeds ¶
func (s *Scribe) Feeds() contract.TypedSelfCaller[FeedsResult]
func (*Scribe) Poke ¶
func (s *Scribe) Poke(pokeData PokeData, schnorrData SchnorrData) contract.SelfTransactableCaller
type TryGetResult ¶
type WatRegistry ¶
type WatRegistry struct {
// contains filtered or unexported fields
}
func NewWatRegistry ¶
func NewWatRegistry(client rpc.RPC, address types.Address) *WatRegistry
func (*WatRegistry) Address ¶
func (w *WatRegistry) Address() types.Address
func (*WatRegistry) Bar ¶
func (w *WatRegistry) Bar(wat string) contract.TypedSelfCaller[int]
func (*WatRegistry) Feeds ¶
func (w *WatRegistry) Feeds(wat string) contract.TypedSelfCaller[[]types.Address]