model

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func MarshalTime

func MarshalTime(t Time) graphql.Marshaler

Types

type ExchangeRate

type ExchangeRate struct {
	// Effective date/time for which this rate applies.
	AsOf Time `json:"as_of"`
	// Time when this record was fetched/observed by the system.
	FetchedAt Time `json:"fetched_at"`
	// Base currency (ISO 4217 or 4-letter crypto/stablecoin), e.g. "USD".
	Base string `json:"base"`
	// Target currency (ISO 4217 or 4-letter crypto/stablecoin), e.g. "VES".
	Target string `json:"target"`
	// Rate classification (MID/BUY/SELL).
	RateType RateType `json:"rate_type"`
	// Provider/source identifier, e.g. "BCV".
	Source string `json:"source"`
	// Quoted rate from base -> target.
	Rate float64 `json:"rate"`
}

A single observed exchange rate data point.

type ExchangeRatePage

type ExchangeRatePage struct {
	// Current page of results.
	Results []*ExchangeRate `json:"results"`
	// Total number of matching results before pagination.
	Total int32 `json:"total"`
}

A paginated collection of exchange rates.

type Query

type Query struct {
}

type RateType

type RateType string

Classifies the kind of rate being reported.

const (
	// Mid-market rate.
	RateTypeMid RateType = "MID"
	// Buy rate (what the provider/bank buys at).
	RateTypeBuy RateType = "BUY"
	// Sell rate (what the provider/bank sells at).
	RateTypeSell RateType = "SELL"
)

func (RateType) IsValid

func (e RateType) IsValid() bool

func (RateType) MarshalGQL

func (e RateType) MarshalGQL(w io.Writer)

func (RateType) MarshalJSON

func (e RateType) MarshalJSON() ([]byte, error)

func (RateType) String

func (e RateType) String() string

func (*RateType) UnmarshalGQL

func (e *RateType) UnmarshalGQL(v any) error

func (*RateType) UnmarshalJSON

func (e *RateType) UnmarshalJSON(b []byte) error

type Time

type Time time.Time

func UnmarshalTime

func UnmarshalTime(v any) (Time, error)

Jump to

Keyboard shortcuts

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