efoxapi

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Endpoint = "https://efox.fox.one"
)

Variables

This section is empty.

Functions

func GenerateJWTToken

func GenerateJWTToken(uid string, key *ecdsa.PrivateKey, exp time.Duration) (string, error)

func UseEndpoint

func UseEndpoint(endpoint string)

Types

type Asset

type Asset struct {
	AssetID   string                     `json:"asset_id,omitempty"`
	Symbol    string                     `json:"symbol,omitempty"`
	Min       decimal.Decimal            `json:"min,omitempty"`
	Minimums  map[string]decimal.Decimal `json:"minimums,omitempty"`
	Max       decimal.Decimal            `json:"max,omitempty"`
	Precision int                        `json:"precision,omitempty"`
}

type Depth

type Depth struct {
	Version string       `json:"version,omitempty"`
	Asks    []DepthOrder `json:"asks,omitempty"`
	Bids    []DepthOrder `json:"bids,omitempty"`
}

type DepthOrder

type DepthOrder [2]decimal.Decimal

type Market

type Market struct {
	Depth  *Depth   `json:"depth,omitempty"`
	Trades []*Trade `json:"trades,omitempty"`
	Ticker *Ticker  `json:"ticker,omitempty"`
	Pair   *Pair    `json:"pair,omitempty"`
}

func ReadMarket

func ReadMarket(ctx context.Context, symbol string) (*Market, error)

type OrderReport

type OrderReport struct {
	ID             string          `json:"id,omitempty"`
	CreatedAt      int64           `json:"created_at,omitempty"`
	Date           string          `json:"date,omitempty"`
	UserID         string          `json:"user_id,omitempty"`
	MerchantID     string          `json:"merchant_id,omitempty"`
	BrokerID       string          `json:"broker_id,omitempty"`
	Symbol         string          `json:"symbol,omitempty"` // BTCUSDT
	Side           string          `json:"side,omitempty"`   // BID or ASK
	FilledAmount   decimal.Decimal `json:"filled_amount,omitempty"`
	ObtainedAmount decimal.Decimal `json:"obtained_amount,omitempty"`
	FeeAmount      decimal.Decimal `json:"fee_amount,omitempty"`
	FeeAsset       string          `json:"fee_asset,omitempty"`
	Count          int64           `json:"count,omitempty"`
}

func ListAllOrderReports

func ListAllOrderReports(ctx context.Context, token string, date string) ([]*OrderReport, error)

func ListOrderReports

func ListOrderReports(ctx context.Context, token, date, cursor string, limit int) ([]*OrderReport, *pagination.Pagination, error)

type Pair

type Pair struct {
	Base           *Asset          `json:"base,omitempty"`
	Quote          *Asset          `json:"quote,omitempty"`
	CanBuy         bool            `json:"can_buy,omitempty"`
	CanSell        bool            `json:"can_sell,omitempty"`
	Symbol         string          `json:"symbol,omitempty"`
	DisplaySymbol  string          `json:"display_symbol,omitempty"`
	BasePrecision  int32           `json:"base_precision,omitempty"`
	QuotePrecision int32           `json:"quote_precision,omitempty"`
	PricePrecision int32           `json:"price_precision,omitempty"`
	State          string          `json:"state,omitempty"`
	Score          int64           `json:"score,omitempty"`
	Change         decimal.Decimal `json:"change,omitempty"`
	Price          decimal.Decimal `json:"price,omitempty"`
	Exchange       string          `json:"exchange,omitempty"`
	Strategies     []string        `json:"strategies,omitempty"`
}

func ReadPairs

func ReadPairs(ctx context.Context) ([]*Pair, error)

type Ticker

type Ticker struct {
	Last   decimal.Decimal `json:"last,omitempty"`
	Change decimal.Decimal `json:"change,omitempty"`
	Buy    decimal.Decimal `json:"buy,omitempty"`
	Sell   decimal.Decimal `json:"sell,omitempty"`
}

type Trade

type Trade struct {
	ID        string          `json:"id,omitempty"`
	Timestamp int64           `json:"time,omitempty"`
	Price     decimal.Decimal `json:"price,omitempty"`
	Amount    decimal.Decimal `json:"amount,omitempty"`
	Side      string          `json:"side,omitempty"`
}

Directories

Path Synopsis
Package proto is a generated twirp stub package.
Package proto is a generated twirp stub package.

Jump to

Keyboard shortcuts

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