bigone

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	V2          = "https://big.one/api/v2"
	V3          = "https://big.one/api/v3"
	TICKER_URI  = "%s/markets/%s/ticker"
	DEPTH_URI   = "%s/markets/%s/depth"
	ACCOUNT_URI = "%s/viewer/accounts"
	ORDERS_URI  = "%s/viewer/orders"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountResp

type AccountResp struct {
	Errors []struct {
		Code      int `json:"code"`
		Locations []struct {
			Column int `json:"column"`
			Line   int `json:"line"`
		} `json:"locations"`
		Message string   `json:"message"`
		Path    []string `json:"path"`
	} `json:"errors"`

	Data []struct {
		AssetID       string `json:"asset_id"`
		AssetSymbol   string `json:"asset_symbol"`
		AssetUUID     string `json:"asset_uuid,omitempty"`
		Balance       string `json:"balance"`
		LockedBalance string `json:"locked_balance"`
	} `json:"data"`
}

type Bigone

type Bigone struct {
	// contains filtered or unexported fields
}

func New

func New(client *http.Client, api_key, secret_key string) *Bigone

func (*Bigone) CancelOrder

func (bo *Bigone) CancelOrder(orderId string, currency goex.CurrencyPair) (bool, error)

func (*Bigone) GetAccount

func (bo *Bigone) GetAccount() (*goex.Account, error)

func (*Bigone) GetDepth

func (bo *Bigone) GetDepth(size int, currencyPair goex.CurrencyPair) (*goex.Depth, error)

func (*Bigone) GetExchangeName

func (bo *Bigone) GetExchangeName() string

func (*Bigone) GetKlineRecords

func (bo *Bigone) GetKlineRecords(currency goex.CurrencyPair, period, size, since int) ([]goex.Kline, error)

func (*Bigone) GetOneOrder

func (bo *Bigone) GetOneOrder(orderId string, currencyPair goex.CurrencyPair) (*goex.Order, error)

func (*Bigone) GetOrderHistorys

func (bo *Bigone) GetOrderHistorys(currencyPair goex.CurrencyPair, currentPage, pageSize int) ([]goex.Order, error)

func (*Bigone) GetTicker

func (bo *Bigone) GetTicker(currency goex.CurrencyPair) (*goex.Ticker, error)

func (*Bigone) GetTrades

func (bo *Bigone) GetTrades(currencyPair goex.CurrencyPair, since int64) ([]goex.Trade, error)

非个人,整个交易所的交易记录

func (*Bigone) GetUnfinishOrders

func (bo *Bigone) GetUnfinishOrders(currencyPair goex.CurrencyPair) ([]goex.Order, error)

func (*Bigone) LimitBuy

func (bo *Bigone) LimitBuy(amount, price string, currency goex.CurrencyPair) (*goex.Order, error)

func (*Bigone) LimitSell

func (bo *Bigone) LimitSell(amount, price string, currency goex.CurrencyPair) (*goex.Order, error)

func (*Bigone) MarketBuy

func (bo *Bigone) MarketBuy(amount, price string, currency goex.CurrencyPair) (*goex.Order, error)

func (*Bigone) MarketSell

func (bo *Bigone) MarketSell(amount, price string, currency goex.CurrencyPair) (*goex.Order, error)

type BigoneV3

type BigoneV3 struct {
	Bigone
}

func NewV3

func NewV3(client *http.Client, api_key, secret_key string) *BigoneV3

func (*BigoneV3) CancelOrder

func (bo *BigoneV3) CancelOrder(orderId string, currency goex.CurrencyPair) (bool, error)

func (*BigoneV3) GetAccount

func (bo *BigoneV3) GetAccount() (*goex.Account, error)

func (*BigoneV3) GetDepth

func (bo *BigoneV3) GetDepth(size int, currencyPair goex.CurrencyPair) (*goex.Depth, error)

func (*BigoneV3) GetExchangeName

func (bo *BigoneV3) GetExchangeName() string

func (*BigoneV3) GetKlineRecords

func (bo *BigoneV3) GetKlineRecords(currency goex.CurrencyPair, period, size, since int) ([]goex.Kline, error)

func (*BigoneV3) GetOneOrder

func (bo *BigoneV3) GetOneOrder(orderId string, currencyPair goex.CurrencyPair) (*goex.Order, error)

func (*BigoneV3) GetOrderHistorys

func (bo *BigoneV3) GetOrderHistorys(currencyPair goex.CurrencyPair, currentPage, pageSize int) ([]goex.Order, error)

func (*BigoneV3) GetTicker

func (bo *BigoneV3) GetTicker(currency goex.CurrencyPair) (*goex.Ticker, error)

func (*BigoneV3) GetTrades

func (bo *BigoneV3) GetTrades(currencyPair goex.CurrencyPair, since int64) ([]goex.Trade, error)

非个人,整个交易所的交易记录

func (*BigoneV3) GetUnfinishOrders

func (bo *BigoneV3) GetUnfinishOrders(currencyPair goex.CurrencyPair) ([]goex.Order, error)

func (*BigoneV3) LimitBuy

func (bo *BigoneV3) LimitBuy(amount, price string, currency goex.CurrencyPair) (*goex.Order, error)

func (*BigoneV3) LimitSell

func (bo *BigoneV3) LimitSell(amount, price string, currency goex.CurrencyPair) (*goex.Order, error)

func (*BigoneV3) MarketBuy

func (bo *BigoneV3) MarketBuy(amount, price string, currency goex.CurrencyPair) (*goex.Order, error)

func (*BigoneV3) MarketSell

func (bo *BigoneV3) MarketSell(amount, price string, currency goex.CurrencyPair) (*goex.Order, error)

type CancelOrderResp

type CancelOrderResp struct {
	Errors []struct {
		Code      int `json:"code"`
		Locations []struct {
			Column int `json:"column"`
			Line   int `json:"line"`
		} `json:"locations"`
		Message string   `json:"message"`
		Path    []string `json:"path"`
	} `json:"errors"`

	Data struct {
		ID            string `json:"id"`
		OrderID       string `json:"id"`
		MarketUUID    string `json:"market_uuid"`
		AssetPairName string `json:"asset_pair_name"`
		Price         string `json:"price"`
		Amount        string `json:"amount"`
		FilledAmount  string `json:"filled_amount"`
		AvgDealPrice  string `json:"avg_deal_price"`
		Side          string `json:"side"`
		State         string `json:"state"`
		CreatedAt     string `json:"created_at"`
		UpdatedAt     string `json:"updated_at"`
	}
}

type CandleResp

type CandleResp struct {
	Errors []struct {
		Code      int `json:"code"`
		Locations []struct {
			Column int `json:"column"`
			Line   int `json:"line"`
		} `json:"locations"`
		Message string   `json:"message"`
		Path    []string `json:"path"`
	} `json:"errors"`

	Data []struct {
		Close  string `json:"close"`
		High   string `json:"high"`
		Low    string `json:"low"`
		Open   string `json:"open"`
		Time   string `json:"time"`
		Volume string `json:"volume"`
	} `json:"data"`
}

type DepthResp

type DepthResp struct {
	Errors []struct {
		Code      int `json:"code"`
		Locations []struct {
			Column int `json:"column"`
			Line   int `json:"line"`
		} `json:"locations"`
		Message string   `json:"message"`
		Path    []string `json:"path"`
	} `json:"errors"`

	Data struct {
		MarketID      string `json:"market_id"`
		AssetPairName string `json:"asset_pair_name"`
		Bids          []struct {
			Price      string `json:"price"`
			OrderCount int    `json:"order_count"`
			Amount     string `json:"amount,omitempty"`
			Quantity   string `json:"quantity,omitempty"`
		} `json:"bids"`
		Asks []struct {
			Price      string `json:"price"`
			OrderCount int    `json:"order_count"`
			Amount     string `json:"amount,omitempty"`
			Quantity   string `json:"quantity,omitempty"`
		} `json:"asks"`
	}
}

type GetOneOrderResp

type GetOneOrderResp struct {
	Errors []struct {
		Code      int `json:"code"`
		Locations []struct {
			Column int `json:"column"`
			Line   int `json:"line"`
		} `json:"locations"`
		Message string   `json:"message"`
		Path    []string `json:"path"`
	} `json:"errors"`

	Data struct {
		OrderID       int64  `json:"id"`
		AssetPairName string `json:"asset_pair_name"`
		Price         string `json:"price"`
		Amount        string `json:"amount"`
		FilledAmount  string `json:"filled_amount"`
		AvgDealPrice  string `json:"avg_deal_price"`
		Side          string `json:"side"`
		State         string `json:"state"`
		CreatedAt     string `json:"created_at"`
		UpdatedAt     string `json:"updated_at"`
	}
}

type OrderListResp

type OrderListResp struct {
	Errors []struct {
		Code      int `json:"code"`
		Locations []struct {
			Column int `json:"column"`
			Line   int `json:"line"`
		} `json:"locations"`
		Message string   `json:"message"`
		Path    []string `json:"path"`
	} `json:"errors"`

	Data struct {
		Edges []struct {
			Cursor string `json:"cursor"`
			Node   struct {
				Amount       string `json:"amount"`
				AvgDealPrice string `json:"avg_deal_price"`
				FilledAmount string `json:"filled_amount"`
				ID           string `json:"id"`
				InsertedAt   string `json:"inserted_at"`
				MarketID     string `json:"market_id"`
				MarketUUID   string `json:"market_uuid"`
				Price        string `json:"price"`
				Side         string `json:"side"`
				State        string `json:"state"`
				UpdatedAt    string `json:"updated_at"`
			} `json:"node"`
		} `json:"edges"`
		PageInfo struct {
			EndCursor       string `json:"end_cursor"`
			HasNextPage     bool   `json:"has_next_page"`
			HasPreviousPage bool   `json:"has_previous_page"`
			StartCursor     string `json:"start_cursor"`
		} `json:"page_info"`
	} `json:"data"`
}

type OrderListV3Resp

type OrderListV3Resp struct {
	Errors []struct {
		Code      int `json:"code"`
		Locations []struct {
			Column int `json:"column"`
			Line   int `json:"line"`
		} `json:"locations"`
		Message string   `json:"message"`
		Path    []string `json:"path"`
	} `json:"errors"`

	Data []struct {
		ID            int64  `json:"id"`
		AssetPairName string `json:"asset_pair_name"`
		Price         string `json:"price"`
		Amount        string `json:"amount"`
		FilledAmount  string `json:"filled_amount"`
		AvgDealPrice  string `json:"avg_deal_price"`
		Side          string `json:"side"`
		State         string `json:"state"`
		CreatedAt     string `json:"created_at"`
		UpdatedAt     string `json:"updated_at"`
	} `json:"data"`
	PageToken string `json:"page_token"`
}

type PlaceOrderResp

type PlaceOrderResp struct {
	Errors []struct {
		Code      int `json:"code"`
		Locations []struct {
			Column int `json:"column"`
			Line   int `json:"line"`
		} `json:"locations"`
		Message string   `json:"message"`
		Path    []string `json:"path"`
	} `json:"errors"`

	Data struct {
		Amount        string `json:"amount"`
		AvgDealPrice  string `json:"avg_deal_price"`
		FilledAmount  string `json:"filled_amount"`
		ID            string `json:"id"`
		OrderID       int64  `json:"id"`
		InsertedAt    string `json:"inserted_at"`
		CreatedAt     string `json:"created_at"`
		MarketID      string `json:"market_id"`
		AssetPairName string `json:"asset_pair_name"`
		MarketUUID    string `json:"market_uuid"`
		Price         string `json:"price"`
		Side          string `json:"side"`
		State         string `json:"state"`
		UpdatedAt     string `json:"updated_at"`
	} `json:"data"`
}

type ServerTimestampResp

type ServerTimestampResp struct {
	Errors []struct {
		Code      int `json:"code"`
		Locations []struct {
			Column int `json:"column"`
			Line   int `json:"line"`
		} `json:"locations"`
		Message string   `json:"message"`
		Path    []string `json:"path"`
	} `json:"errors"`

	Data struct {
		Timetamp int64 `json:"timestamp"`
	} `json:"data"`
}

type TickerResp

type TickerResp struct {
	Errors []struct {
		Code      int `json:"code"`
		Locations []struct {
			Column int `json:"column"`
			Line   int `json:"line"`
		} `json:"locations"`
		Message string   `json:"message"`
		Path    []string `json:"path"`
	} `json:"errors"`

	Data struct {
		Ask struct {
			Amount string `json:"amount"`
			Price  string `json:"price"`
		} `json:"ask"`
		Bid struct {
			Amount string `json:"amount"`
			Price  string `json:"price"`
		} `json:"bid"`
		Close           string `json:"close"`
		DailyChange     string `json:"daily_change"`
		DailyChangePerc string `json:"daily_change_perc"`
		High            string `json:"high"`
		Low             string `json:"low"`
		MarketID        string `json:"market_id"`
		MarketUUID      string `json:"market_uuid"`
		Open            string `json:"open"`
		Volume          string `json:"volume"`
	} `json:"data"`
}

Jump to

Keyboard shortcuts

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