Documentation ¶
Index ¶
Constants ¶
View Source
const ( // MSatsPerSat is a constant amount of satoshis. MSatsPerSat = 1000 // SatsPerBtc is the number of satoshi's in a bitcoin. SatsPerBtc = btcutil.SatoshiPerBitcoin // MSatsPerBtc is the number of satoshis in a bitcoin. MSatsPerBtc = MSatsPerSat * SatsPerBtc // AllCountries is the constant for all nations (international currency). AllCountries = "All" )
Variables ¶
View Source
var CryptoCurrency = CurrencyMap{
"LTC": {
Code: "LTC",
Name: "Litecoin",
},
"ETH": {
Code: "ETH",
Name: "Ethereum",
},
}
CryptoCurrency is a list of supported currencies.
View Source
var Fiat = CurrencyMap{}/* 169 elements not displayed */
Fiat is a list of fiat currencies.
Functions ¶
This section is empty.
Types ¶
type Currency ¶
type Currency struct { // Code is the currency code (e.g. usd) Code string `json:"code"` // Countries is csv list of countries Countries string `json:"countries"` // Decimals is the number of decimals in currency Decimals int `json:"decimals"` // IsoNum is the iso code of the country. Negative if null IsoNum int `json:"iso_num"` // Name is the name of the Currency Name string `json:"name"` // Symbol is the currency symbol Symbol string `json:"symbol"` }
Currency is a currency type.
type Rate ¶
type Rate struct { // BaseCode is the rate we're converting from BaseCode string // QuoteCode is the rate we're converting to QuoteCode string // RateValue is the conversion rate RateValue float64 // Timestamp is the timestamp of the conversion Timestamp time.Time }
Rate is the conversion rate.
func DeriveRate ¶
DeriveRate does a cross-currency rate conversion.
func (Rate) Includes ¶
Includes determines whether or not the Rate.BaseCode is Rate.BaseCode or the Rate.QuoteCode.
type Wad ¶
type Wad struct { // MSats is the millisatoshi account in the wad MSats float64 `json:"MSats"` // AssetStable is wether or not the asset is a stable coin (usd, etc) AssetStable bool `json:"asset_stable"` // AssetUnit is the conversion rate of the asset AssetUnit float64 `json:"asset_unit"` // contains filtered or unexported fields }
Wad is a unit of currencies.
func CustomWad ¶
func CustomWad(units float64, rate Rate, code string, countries string, decimals int, name string, symbol string) Wad
CustomWad creates a custom wad at a given Rate.
func (*Wad) UpdateCurrency ¶
UpdateCurrency changes the Currency of a wad.
Click to show internal directories.
Click to hide internal directories.