fixedfloat

package module
v0.0.0-...-6f74d13 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2023 License: MIT Imports: 14 Imported by: 0

README

go-fixedfloat-api

FixedFloat Api Library for golang

Documentation

Index

Constants

View Source
const (
	ApiBase = "https://ff.io/api/v2" // FixedFloat API endpoint
)

Variables

This section is empty.

Functions

func NewClient

func NewClient(apiKey, apiSecret string) (c *client)

NewClient return a new FixedFloat HTTP client

func NewClientWithCustomHttpConfig

func NewClientWithCustomHttpConfig(apiKey, apiSecret string, httpClient *http.Client) (c *client)

NewClientWithCustomHttpConfig returns a new FixedFloat HTTP client using the predefined http client

func NewClientWithCustomTimeout

func NewClientWithCustomTimeout(apiKey, apiSecret string, timeout time.Duration) (c *client)

NewClient returns a new FixedFloat HTTP client with custom timeout

Types

type Bool

type Bool bool

func (*Bool) Toint

func (bit *Bool) Toint() int

func (*Bool) UnmarshalJSON

func (bit *Bool) UnmarshalJSON(b []byte) error

type Currency

type Currency struct {
	Code     string `json:"code"`
	Coin     string `json:"coin"`
	Network  string `json:"network"`
	Name     string `json:"name"`
	Recv     Bool   `json:"recv"`
	Send     Bool   `json:"send"`
	Tag      string `json:"tag"`
	Priority uint   `json:"priority"`
}

type FixedFloat

type FixedFloat struct {
	// contains filtered or unexported fields
}

FixedFloat represent a FixedFloat client

func New

func New(apiKey, apiSecret string) *FixedFloat

New returns an instantiated FixedFloat struct

func NewWithCustomHttpClient

func NewWithCustomHttpClient(apiKey, apiSecret string, httpClient *http.Client) *FixedFloat

NewWithCustomHttpClient returns an instantiated FixedFloat struct with custom http client

func NewWithCustomTimeout

func NewWithCustomTimeout(apiKey, apiSecret string, timeout time.Duration) *FixedFloat

NewWithCustomTimeout returns an instantiated FixedFloat struct with custom timeout

func (*FixedFloat) GetCurrencies

func (ff *FixedFloat) GetCurrencies() (currencies []Currency, err error)

GetCurrencies getting a list of currencies supported by the FixedFloat service

func (*FixedFloat) GetRate

func (ff *FixedFloat) GetRate(fromCurrency string, toCurrency string, amount float64) (Rate, Rate, error)

GetRate getting the exchange rate of a pair of currencies in the selected direction and type of rate.

func (*FixedFloat) SetDebug

func (ff *FixedFloat) SetDebug(enable bool)

SetDebug set enable/disable http request/response dump

type Integer

type Integer int

func (*Integer) UnmarshalJSON

func (i *Integer) UnmarshalJSON(b []byte) error

type Rate

type Rate struct {
	Code      string  `json:"code"`
	Coin      string  `json:"coin"`
	Network   string  `json:"network"`
	Amount    float64 `json:"amount,string"`
	Rate      float64 `json:"rate,string"`
	Precision uint8   `json:"precision"`
	Min       float64 `json:"min,string"`
	Max       float64 `json:"max,string"`
	Usd       float64 `json:"usd,string"`
}

Jump to

Keyboard shortcuts

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