Versions in this module Expand all Collapse all v0 v0.1.0 Oct 9, 2024 Changes in this version + const ByteWidthInt192 + const EvmHashLen + var FeeScalingFactor = decimal.NewFromInt(1e18) + var MaxInt192 *big.Int + var MaxInt192Enc []byte + var PriceScalingFactor = decimal.NewFromInt(1e18) + var Zero = big.NewInt(0) + func CalculateFee(tokenPriceInUSD *big.Int, baseUSDFee decimal.Decimal) *big.Int + func DecodeValueInt192(s []byte) (*big.Int, error) + func EncodeValueInt192(i *big.Int) ([]byte, error) + func GetConsensusAsk(paos []PAOAsk, f int) (*big.Int, error) + func GetConsensusBenchmarkPrice(paos []PAO, f int) (*big.Int, error) + func GetConsensusBid(paos []PAOBid, f int) (*big.Int, error) + func GetConsensusLinkFee(paos []PAOLinkFee, f int) (*big.Int, error) + func GetConsensusMaxFinalizedTimestamp(paos []PAOMaxFinalizedTimestamp, f int) (int64, error) + func GetConsensusNativeFee(paos []PAONativeFee, f int) (*big.Int, error) + func GetConsensusTimestamp(paos []PAO) uint32 + func MustEncodeValueInt192(i *big.Int) []byte + func ValidateBetween(name string, answer *big.Int, min, max *big.Int) error + func ValidateExpiresAt(observationTimestamp uint32, expiresAt uint32) error + func ValidateFee(name string, answer *big.Int) error + func ValidateValidFromTimestamp(observationTimestamp uint32, validFromTimestamp uint32) error + type EpochRound struct + Epoch uint32 + Round uint8 + func (x EpochRound) Less(y EpochRound) bool + type OffchainConfig struct + BaseUSDFee decimal.Decimal + ExpirationWindow uint32 + func DecodeOffchainConfig(b []byte) (o OffchainConfig, err error) + func (c OffchainConfig) Encode() ([]byte, error) + type PAO interface + GetBenchmarkPrice func() (*big.Int, bool) + GetObserver func() commontypes.OracleID + GetTimestamp func() uint32 + type PAOAsk interface + GetAsk func() (*big.Int, bool) + type PAOBid interface + GetBid func() (*big.Int, bool) + type PAOLinkFee interface + GetLinkFee func() (*big.Int, bool) + type PAOMaxFinalizedTimestamp interface + GetMaxFinalizedTimestamp func() (int64, bool) + type PAONativeFee interface + GetNativeFee func() (*big.Int, bool) + type StandardOnchainConfigCodec struct + func (StandardOnchainConfigCodec) Decode(ctx context.Context, b []byte) (mercury.OnchainConfig, error) + func (StandardOnchainConfigCodec) Encode(ctx context.Context, c mercury.OnchainConfig) ([]byte, error)