models

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

All return values from Bitbank.cc is set in this package models.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	UUID    string `json:"uuid"`
	Label   string `json:"label"`
	Address string `json:"address"`
}

type Asset

type Asset struct {
	Asset           string `json:"asset"`
	AmountPrecision int    `json:"amount_precision"`
	OnhandAmount    string `json:"onhand_amount"`
	LockedAmount    string `json:"locked_amount"`
	FreeAmount      string `json:"free_amount"`
	StopDeposit     bool   `json:"stop_deposit"`
	StopWithdrawal  bool   `json:"stop_withdrawal"`
	// withdrawl_fee is either a string or object
	//      "withdrawal_fee": {
	//        "threshold": "30000.0000",
	//        "under": "540.0000",
	//        "over": "756.0000"
	//      }
	// or
	// "withdrawal_fee": "0.00100000"
	WithdrawalFee *WithdrawalFee `json:"withdrawal_fee"`
}

type Assets

type Assets struct {
	Success int         `json:"success"`
	Data    *AssetsData `json:"data"`
}

type AssetsData

type AssetsData struct {
	Assets []*Asset `json:"assets"`
}

type Candlestick

type Candlestick struct {
	Type  string          `json:"type"`
	Ohlcv [][]json.Number `json:"ohlcv"`
}

type Candlesticks

type Candlesticks struct {
	Success int               `json:"success"`
	Data    *CandlesticksData `json:"data"`
}

type CandlesticksData

type CandlesticksData struct {
	Candlesticks []*Candlestick `json:"candlestick"`
}

type Depth

type Depth struct {
	Success int       `json:"success"`
	Data    DepthData `json:"data"`
}

Main struct of getDepth.

Success
  0:fail
  1:success

func (*Depth) GetAsksFloat64

func (p *Depth) GetAsksFloat64() [][]float64

Return Asks in type of float64

func (*Depth) GetBidsFloat64

func (p *Depth) GetBidsFloat64() [][]float64

Return Bids in type of float64

func (*Depth) SortAsksByPrice

func (p *Depth) SortAsksByPrice(order string) [][]float64

Return Asks in type of float64, Sorted by Price. you can set order with "asc" or "desc".

func (*Depth) SortAsksByQuontity

func (p *Depth) SortAsksByQuontity() [][]float64

Return Sorted(Quontity asc) Asks in type of float64

func (*Depth) SortBidsByPrice

func (p *Depth) SortBidsByPrice(order string) [][]float64

Return Bids in type of float64, Sorted by Price. you can set order with "asc" or "desc".

func (*Depth) SortBidsByQuontity

func (p *Depth) SortBidsByQuontity() [][]float64

Return Sorted(Quontity asc) Bid in type of float64

type DepthData

type DepthData struct {
	Asks [][]json.Number `json:"asks"`
	Bids [][]json.Number `json:"bids"`
}

Array of [price] [quontity]

type Order

type Order struct {
	Success int        `json:"success"`
	Data    *OrderData `json:"data"`
}

type OrderData

type OrderData struct {
	OrderID         int    `json:"order_id"`
	Pair            string `json:"pair"`
	Side            string `json:"side"`
	Type            string `json:"type"`
	StartAmount     string `json:"start_amount"`
	RemainingAmount string `json:"remaining_amount"`
	ExecutedAmount  string `json:"executed_amount"`
	Price           string `json:"price"`
	AveragePrice    string `json:"average_price"`
	OrderedAt       int    `json:"ordered_at"`
	Status          string `json:"status"`
}

type Orders

type Orders struct {
	Success int         `json:"success"`
	Data    *OrdersData `json:"data"`
}

type OrdersData

type OrdersData struct {
	Orders []*OrderData `json:"orders"`
}

type RequestWithdrawal

type RequestWithdrawal struct {
	Success int                    `json:"success"`
	Data    *RequestWithdrawalData `json:"data"`
}

type RequestWithdrawalData

type RequestWithdrawalData struct {
	UUID        string `json:"uuid"`
	Asset       string `json:"asset"`
	Amount      int    `json:"amount"`
	AccountUUID string `json:"account_uuid"`
	Fee         string `json:"fee"`
	Status      string `json:"status"`
	Label       string `json:"label"`
	Txid        string `json:"txid"`
	Address     string `json:"address"`
}

type Ticker

type Ticker struct {
	Success int         `json:"success"`
	Data    *TickerData `json:"data"`
}

type TickerData

type TickerData struct {
	Sell      string `json:"sell"`
	Buy       string `json:"buy"`
	High      string `json:"high"`
	Low       string `json:"low"`
	Last      string `json:"last"`
	Vol       string `json:"vol"`
	Timestamp int    `json:"timestamp"`
}

type Trade

type Trade struct {
	TradeID        int    `json:"trade_id"`
	Pair           string `json:"pair"`
	OrderID        int    `json:"order_id"`
	Side           string `json:"side"`
	Type           string `json:"type"`
	Amount         string `json:"amount"`
	Price          string `json:"price"`
	MakerTaker     string `json:"maker_taker"`
	FeeAmountBase  string `json:"fee_amount_base"`
	FeeAmountQuote string `json:"fee_amount_quote"`
	ExecutedAt     int    `json:"executed_at"`
}

type Trades

type Trades struct {
	Success int         `json:"success"`
	Data    *TradesData `json:"data"`
}

type TradesData

type TradesData struct {
	Trades []*Trade `json:"trades"`
}

type Transaction

type Transaction struct {
	TransactionID int    `json:"transaction_id"`
	Side          string `json:"side"`
	Price         string `json:"price"`
	Amount        string `json:"amount"`
	ExecutedAt    int    `json:"executed_at"`
}

type Transactions

type Transactions struct {
	Success int               `json:"success"`
	Data    *TransactionsData `json:"data"`
}

type TransactionsData

type TransactionsData struct {
	Transactions []*Transaction `json:"transactions"`
}

type WithdrawalAccounts

type WithdrawalAccounts struct {
	Success int                     `json:"success"`
	Data    *WithdrawalAccountsData `json:"data"`
}

type WithdrawalAccountsData

type WithdrawalAccountsData struct {
	Accounts []*Account `json:"accounts"`
}

type WithdrawalFee

type WithdrawalFee struct {
	Fee       string
	Threshold string
	Under     string
	Over      string
}

func (*WithdrawalFee) MarshalJSON

func (w *WithdrawalFee) MarshalJSON() ([]byte, error)

func (*WithdrawalFee) UnmarshalJSON

func (w *WithdrawalFee) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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