firiclient

package
v0.0.0-...-a772295 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(base *url.URL, httpClient Doer) *publicClient

func NewAuthenticatedClient

func NewAuthenticatedClient(base *url.URL, s *signer, publicClient *publicClient, doer Doer) *authClient

func NewSigner

func NewSigner(clientId string, apiKey string, secret []byte) *signer

Types

type ActiveOrder

type ActiveOrder struct {
	Id        int64     `json:"id"`
	Market    string    `json:"market"`
	Type      OrderType `json:"type"`
	Price     float64   `json:"price,string"`
	Amount    float64   `json:"amount,string"`
	Remaining float64   `json:"remaining,string"`
	Matched   float64   `json:"matched,string"`
	Cancelled float64   `json:"cancelled,string"`
	CreatedAt time.Time `json:"created_at"`
}

type ActiveOrders

type ActiveOrders []ActiveOrder

type Asks

type Asks []ordersJsonList

type Balance

type Balance struct {
	MarketID string  `json:"id"`
	Last     float64 `json:"last,string"`
	High     float64 `json:"high,string"`
	Low      float64 `json:"low,string"`
	Change   float64 `json:"change,string"`
	Volume   float64 `json:"volume,string"`
}

type Balances

type Balances []Balance

type Bids

type Bids []ordersJsonList

type CreateOrderRequest

type CreateOrderRequest struct {
	Market string    `json:"market"`
	Type   OrderType `json:"type"`
	Price  float64   `json:"price,string"`
	Amount float64   `json:"amount,string"`
}

type CreateOrderResponse

type CreateOrderResponse struct {
	Id int64 `json:"id"`
}

type CreateWithdrawalRequest

type CreateWithdrawalRequest struct {
	Amount  string `json:"amount"`
	Address string `json:"address"`
}

type CreateWithdrawalResponse

type CreateWithdrawalResponse struct{}

type Doer

type Doer func(*http.Request) (*http.Response, error)

type HistoricOrder

type HistoricOrder struct {
	OrderType OrderType `json:"type"`
	Amount    float64   `json:"amount,string"`
	Price     float64   `json:"price,string"`
	Total     float64   `json:"total,string"`
	CreatedAt time.Time `json:"created_at"`
}

type HistoricTrade

type HistoricTrade struct {
	Id             string    `json:"id"`
	Market         string    `json:"market"`
	Price          float64   `json:"price,string"`
	PriceCurrency  string    `json:"price_currency"`
	Amount         float64   `json:"amount,string"`
	AmountCurrency string    `json:"amount_currency"`
	Cost           float64   `json:"cost,string"`
	CostCurrency   string    `json:"cost_currency"`
	Side           string    `json:"side"`
	IsMaker        bool      `json:"isMaker"`
	Date           time.Time `json:"date"`
}

type HistoricTrades

type HistoricTrades []HistoricTrade

type Market

type Market struct {
	ID     string  `json:"id"`
	Last   float64 `json:"last,string"`
	High   float64 `json:"high,string"`
	Change float64 `json:"change,string"`
	Low    float64 `json:"low,string"`
	Volume float64 `json:"volume,string"`
}

type MarketID

type MarketID string
const (
	BTCNOK MarketID = "BTCNOK"
	ETHNOK MarketID = "ETHNOK"
	DAINOK MarketID = "DAINOK"
	ADANOK MarketID = "ADANOK"
	LTCNOK MarketID = "LTCNOK"
)

type MarketTicker

type MarketTicker struct {
	MarketID string  `json:"market"`
	Bid      float64 `json:"bid,string"`
	Ask      float64 `json:"ask,string"`
	Spread   float64 `json:"spread,string"`
}

type MarketTickers

type MarketTickers []MarketTicker

type Markets

type Markets []Market

type Order

type Order struct {
	Price    float64
	Quantity float64
}

type OrderType

type OrderType string
const (
	Bid OrderType = "bid"
	Ask OrderType = "ask"
)

func (OrderType) MarshalJSON

func (o OrderType) MarshalJSON() ([]byte, error)

func (*OrderType) UnmarshalJSON

func (o *OrderType) UnmarshalJSON(b []byte) error

type Orderbook

type Orderbook struct {
	Bids []Order
	Asks []Order
}

type SignedData

type SignedData struct {
	ClientID       string
	Signature      string
	Timestamp      time.Time
	ValidForMillis int64
}

type TradeHistory

type TradeHistory []HistoricOrder

Jump to

Keyboard shortcuts

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