crypto

package
v0.0.0-...-6202569 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2021 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	BasePath string
	// contains filtered or unexported fields
}

API Crypto.com Api

func NewAPI

func NewAPI(apiKey string, apiSecret string) *API

NewAPI create new API

func (*API) CreateOrder

func (api *API) CreateOrder(order Order) (string, error)

CreateOrder create order

func (*API) GetBalance

func (api *API) GetBalance(coin string) ([]Balance, error)

GetBalance account balance

func (*API) GetPrice

func (api *API) GetPrice(ticket string) (*Price, error)

GetPrice get current ticket price

type Balance

type Balance struct {
	Balance   float64 `json:"balance"`
	Available float64 `json:"available"`
	Order     float64 `json:"order"`
	Stake     float64 `json:"stake"`
	Currency  string  `json:"currency"`
}

Balance account balance

type Order

type Order struct {
	Price    float64 `json:"price"`
	Side     string  `json:"side"`
	Symbol   string  `json:"symbol"`
	Type     string  `json:"type"`
	Quantity float64 `json:"quantity"`
}

Order order parameters

type Price

type Price struct {
	High   float64 `json:"h"`
	Vol    float64 `json:"v"`
	Last   float64 `json:"a"`
	Low    float64 `json:"l"`
	Buy    float64 `json:"b"`
	Sell   float64 `json:"k"`
	Change float64 `json:"c"`
	Time   int64   `json:"t"`
}

Price price of crypto.com ticket

Jump to

Keyboard shortcuts

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