bitso

package module
v0.0.0-...-37532db Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2020 License: MIT Imports: 12 Imported by: 0

README

Bitso v3 GO

[! Go Report Card](https://goreportcard.com/report/github.com/webability-go/bitso) [! GoDoc](https://godoc.org/github.com/webability-go/bitso) [! GolangCI](https://golangci.com)

The Bitso package is a complete Bitso V3 API ready to use package in Golang

Manuals are available on godoc.org GoDoc

TO DO:

Done:

  • public API REST

Working:

  • Private API REST

Missing:

  • REMITTANCE API
  • TRANSFER API
  • WEBHOOK API
  • WEBSOCKET service

Version Changes Control

v0.1.0 - 2020-01-04

  • Remastered the full code under a unique API structure
  • public access services are finished
  • private access is implemented
  • private access services working:
    • AccountStatus
    • AccoutBalance
    • Fees

v0.0.2 - 2020-01-03

  • public::AvailableBooks() implemented
  • public::Tickers() implemented
  • public::Ticker(book) implemented

v0.0.1 - 2020-01-01

  • First release
  • Package skeletton and basic functions

Documentation

Index

Constants

View Source
const (
	BASEURL = "https://api.bitso.com/v3/"
)
View Source
const VERSION = "0.1.0"

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Key            string
	Secret         string
	Devel          bool
	HaveTransfer   bool
	HaveRemittance bool
}

func NewAPI

func NewAPI(key string, secret string) *API

func (*API) AccountStatus

func (api *API) AccountStatus() (*AccountData, error)

func (*API) AvailableBooks

func (api *API) AvailableBooks() (Books, error)

func (*API) Balance

func (api *API) Balance() (Balances, error)

func (*API) Fees

func (api *API) Fees() (*Fees, error)

func (*API) OrderBook

func (api *API) OrderBook(book string, aggregate bool) (*OrderBook, error)

func (*API) Ticker

func (api *API) Ticker(book string) (*Ticker, error)

func (*API) Tickers

func (api *API) Tickers() (Tickers, error)

func (*API) Trades

func (api *API) Trades(book string, marker string, sort string, limit int) (*Trades, error)

type AccountData

type AccountData struct {
	ClientID              string  `json:"client_id"`
	FirstName             string  `json:"first_name"`
	LastName              string  `json:"last_name"`
	Status                string  `json:"status"`
	DailyLimit            float64 `json:"daily_limit,string"`
	MonthlyLimit          float64 `json:"monthly_limit,string"`
	DailyRemaining        float64 `json:"daily_remaining,string"`
	MonthlyRemaining      float64 `json:"monthly_remaining,string"`
	CashDepositAllowance  float64 `json:"cash_deposit_allowance,string"`
	CellphoneNumber       string  `json:"cellphone_number"`
	CellphoneNumberStored string  `json:"cellphone_number_stored"`
	EmailStored           string  `json:"email_stored"`
	OfficialID            string  `json:"official_id"`
	ProofOfResidency      string  `json:"proof_of_residency"`
	SignedContract        string  `json:"signed_contract"`
	OriginOfFunds         string  `json:"origin_of_funds"`
}

type AccountStatusResponse

type AccountStatusResponse struct {
	Success     bool        `json:"success"`
	Error       Error       `json:"error,omitempty"`
	AccountData AccountData `json:"payload,omitempty"`
}

type AvailableBookResponse

type AvailableBookResponse struct {
	Success bool  `json:"success"`
	Error   Error `json:"error,omitempty"`
	Books   Books `json:"payload,omitempty"`
}

type Balance

type Balance struct {
	Currency  string  `json:"currency"`
	Total     float64 `json:"total,string"`
	Locked    float64 `json:"locked,string"`
	Available float64 `json:"available,string"`
}

type BalanceResponse

type BalanceResponse struct {
	Success bool  `json:"success"`
	Error   Error `json:"error,omitempty"`
	Payload struct {
		Balances Balances `json:"balances,omitempty"`
	} `json:"payload,omitempty"`
}

type Balances

type Balances []Balance

type Book

type Book struct {
	Book          string  `json:"book"`
	MinimumAmount float64 `json:"minimum_amount,string"`
	MaximumAmount float64 `json:"maximum_amount,string"`
	MinimumPrice  float64 `json:"minimum_price,string"`
	MaximumPrice  float64 `json:"maximum_price,string"`
	MinimumValue  float64 `json:"minimum_value,string"`
	MaximumValue  float64 `json:"maximum_value,string"`
}

type Books

type Books []Book

type Error

type Error struct {
	Message string `json:"message"`
	Code    int    `json:"code,string"`
}

type Fee

type Fee struct {
	Book            string  `json:"book"`
	TakerFeeDecimal float64 `json:"taker_fee_decimal,string"`
	TakerFeePercent float64 `json:"taker_fee_percent,string"`
	MakerFeeDecimal float64 `json:"maker_fee_decimal,string"`
	MakerFeePercent float64 `json:"maker_fee_percent,string"`
}

type Fees

type Fees struct {
	Fees           []Fee       `json:"fees"`
	WithdrawalFees interface{} `json:"withdrawal_fees"`
}

type FeesResponse

type FeesResponse struct {
	Success bool   `json:"success"`
	Error   *Error `json:"error,omitempty"`
	Fees    Fees   `json:"payload,omitempty"`
}

type Order

type Order struct {
	Book   string  `json:"book"`
	Price  float64 `json:"price,string"`
	Amount float64 `json:"amount,string"`
	OID    string  `json:"oid,omitempty"`
}

type OrderBook

type OrderBook struct {
	Asks      []Order   `json:"asks"`
	Bids      []Order   `json:"bids"`
	UpdatedAt time.Time `json:"updated_at"`
	Sequence  int       `json:"sequence,string"`
}

type OrderBookResponse

type OrderBookResponse struct {
	Success   bool      `json:"success"`
	Error     Error     `json:"error,omitempty"`
	OrderBook OrderBook `json:"payload,omitempty"`
}

type Ticker

type Ticker struct {
	Book      string    `json:"book"`
	Volume    float64   `json:"volume,string"`
	High      float64   `json:"high,string"`
	Last      float64   `json:"last,string"`
	Low       float64   `json:"low,string"`
	Vwap      float64   `json:"vwap,string"`
	Ask       float64   `json:"ask,string"`
	Bid       float64   `json:"bid,string"`
	CreatedAt time.Time `json:"created_at"`
}

type TickerResponse

type TickerResponse struct {
	Success bool   `json:"success"`
	Error   Error  `json:"error,omitempty"`
	Ticker  Ticker `json:"payload,omitempty"`
}

type Tickers

type Tickers []Ticker

type TickersResponse

type TickersResponse struct {
	Success bool    `json:"success"`
	Error   Error   `json:"error,omitempty"`
	Tickers Tickers `json:"payload,omitempty"`
}

type Trade

type Trade struct {
	Book       string    `json:"book"`
	CreatedAt  time.Time `json:"created_at"`
	Amount     float64   `json:"amount,string"`
	MarkerSite string    `json:"marker_side"`
	Price      float64   `json:"price,string"`
	TID        int       `json:"tid"`
}

type Trades

type Trades []Trade

type TradesResponse

type TradesResponse struct {
	Success bool   `json:"success"`
	Error   Error  `json:"error,omitempty"`
	Trades  Trades `json:"payload,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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