bitkubconnector

package
v1.0.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SERVERTIME_MIN  = 60
	SERVERTIME_HOUR = SERVERTIME_MIN * 60
	SERVERTIME_DAY  = SERVERTIME_HOUR * 24
)

A constants for bitkub server timestamp

View Source
const (
	BASE_URL = "https://api.bitkub.com"
)

Variables

View Source
var ErrorDescr = map[int]string{
	0:  "No error",
	1:  "Invalid JSON payload",
	2:  "Missing X-BTK-APIKEY",
	3:  "Invalid API key",
	4:  "API pending for activation",
	5:  "IP not allowed",
	6:  "Missing / invalid signature",
	7:  "Missing timestamp",
	8:  "Invalid timestamp",
	9:  "Invalid user",
	10: "Invalid parameter",
	11: "Invalid symbol",
	12: "Invalid amount",
	13: "Invalid rate",
	14: "Improper rate",
	15: "Amount too low",
	16: "Failed to get balance",
	17: "Wallet is empty",
	18: "Insufficient balance",
	19: "Failed to insert order into db",
	20: "Failed to deduct balance",
	21: "Invalid order for cancellation",
	22: "Invalid side",
	23: "Failed to update order status",
	24: "Invalid order for lookup",
	25: "KYC level 1 is required to proceed",
	30: "Limit exceeds",
	40: "Pending withdrawal exists",
	41: "Invalid currency for withdrawal",
	42: "Address is not in whitelist",
	43: "Failed to deduct crypto",
	44: "Failed to create withdrawal record",
	45: "Nonce has to be numeric",
	46: "Invalid nonce",
	47: "Withdrawal limit exceeds",
	48: "Invalid bank account",
	49: "Bank limit exceeds",
	50: "Pending withdrawal exists",
	51: "Withdrawal is under maintenance",
	52: "Invalid permission",
	53: "Invalid internal address",
	54: "Address has been deprecated",
	90: "Server error (please contact support)",
}

Functions

func IsResponseError

func IsResponseError(br bitkubResponse) (bool, error)

Check a response body from bitkub is error

Types

type Config

type Config struct {
	// Required
	ApiKey    string
	ApiSecret string

	// Optional
	UserAgent string
}

Config data structure

func New

func New(config Config) (Config, error)

New instance function

func (Config) CryptoAddresses

func (c Config) CryptoAddresses(p, lmt int) (bitkubResponse, error)

List all crypto addresses. Use resp.Body success with CryptoAddresses type, error with CryptoError type - p int Page (optional) - lmt int Limit (optional)

func (Config) CryptoDepositHistory

func (c Config) CryptoDepositHistory(p, lmt int) (bitkubResponse, error)

List crypto deposit history. Use resp.Body success with CryptoDepositHistory type, error with CryptoError type - p int Page (optional) - lmt int Limit (optional)

func (Config) CryptoGenerateAddress

func (c Config) CryptoGenerateAddress(sym string) (bitkubResponse, error)

Generate a new crypto address (will replace existing address; previous address can still be used to received funds) Use resp.Body success with CryptoGenerateAddress type, error with CryptoError type - sym string Symbol (e.g. THB_BTC, THB_ETH, etc.)

func (Config) CryptoInternalWithdraw

func (c Config) CryptoInternalWithdraw(cur string, amt float64, adr, mem string) (bitkubResponse, error)

Make a withdraw to an internal address. The destination address is not required to be a trusted address. This API is not enabled by default, Only KYB users can request this feature by contacting us via support@bitkub.com Use resp.Body success with CryptoInternalWithdraw type, error with CryptoError type - cur string Currency for withdrawal (e.g. BTC, ETH) - amt float Amount you want to withdraw - adr string Address to which you want to withdraw - mem string (Optional) Memo or destination tag to which you want to withdraw

func (Config) CryptoWithdraw

func (c Config) CryptoWithdraw(cur string, amt float64, adr, mem string) (bitkubResponse, error)

Make a withdrawal to a trusted address. Use resp.Body success with CryptoWithdraw type, error with CryptoError type - cur string Currency for withdrawal (e.g. BTC, ETH) - amt float Amount you want to withdraw - adr string Address to which you want to withdraw - mem string (Optional) Memo or destination tag to which you want to withdraw

func (Config) CryptoWithdrawHistory

func (c Config) CryptoWithdrawHistory(p, lmt int) (bitkubResponse, error)

List crypto withdrawal history. Use resp.Body success with CryptoWithdrawHistory type, error with CryptoError type - p int Page (optional) - lmt int Limit (optional)

func (Config) FiatAccounts

func (c Config) FiatAccounts(p, lmt int) (bitkubResponse, error)

List all approved bank accounts. Use resp.Body success with FiatAccounts type, error with FiatError type - p int Page (optional) - lmt int Limit (optional)

func (Config) FiatDepositHistory

func (c Config) FiatDepositHistory(id string, amt int) (bitkubResponse, error)

List fiat deposit history. Use resp.Body success with FiatDepositHistory type, error with FiatError type - p int Page (optional) - lmt int Limit (optional)

func (Config) FiatWithdraw

func (c Config) FiatWithdraw(p, lmt int) (bitkubResponse, error)

Make a withdrawal to an approved bank account. Use resp.Body success with FiatWithdraw type, error with FiatError type - id string Bank account id - amt float Amount you want to withdraw

func (Config) FiatWithdrawHistory

func (c Config) FiatWithdrawHistory(id string, amt int) (bitkubResponse, error)

List fiat withdrawal history. Use resp.Body success with FiatWithdrawHistory type, error with FiatError type - p int Page (optional) - lmt int Limit (optional)

func (Config) History

func (c Config) History(symbol, resolution string, from, to int) (bitkubResponse, error)

Get historical data for TradingView chart. - symbol string The symbol (e.g. BTC_THB) - resolution string Chart resolution (1, 5, 15, 60, 240, 1D) - from int Timestamp of the starting time (e.g. 1633424427) - to int Timestamp of the ending time (e.g. 1633427427)

func (Config) MarketAsks

func (c Config) MarketAsks(sym string, lmt int) (bitkubResponse, error)

List open sell orders. Use resp.Body success with MarketBidsAsks type, error with MarketError type - sym string The symbol - lmt int No. of limit to query open buy orders

func (Config) MarketBalances

func (c Config) MarketBalances() (bitkubResponse, error)

Get balances info: this includes both available and reserved balances. Use resp.Body success with MarketBalances type, error with MarketError type.

func (Config) MarketBids

func (c Config) MarketBids(sym string, lmt int) (bitkubResponse, error)

List open buy orders. Use resp.Body success with MarketBidsAsks type, error with MarketError type - sym string The symbol - lmt int No. of limit to query open buy orders

func (Config) MarketBooks

func (c Config) MarketBooks(sym string, lmt int) (bitkubResponse, error)

List all open orders. Use resp.Body success with MarketBooks type, error with MarketError type - sym string The symbol - lmt int No. of limit to query open buy orders

func (Config) MarketCancelOrder

func (c Config) MarketCancelOrder(sym string, id int, sd, hash string) (bitkubResponse, error)

Cancel an open order. - sym string The symbol - id int Order id you wish to cancel - sd string Order side: buy or sell - hash string Cancel an order with order hash (optional). You don't need to specify sym, id, and sd when you specify order hash.

func (Config) MarketDepth

func (c Config) MarketDepth(sym string, lmt int) (bitkubResponse, error)

Get depth information. Use resp.Body success with MarketDepth type, error with MarketError type - sym string The symbol - lmt int No. of limit to query open buy orders

func (Config) MarketMyOpenOrders

func (c Config) MarketMyOpenOrders(sym string) (bitkubResponse, error)

List all open orders of the given symbol. Use resp.Body success with MarketMyOpenOrders type, error with MarketError type. - sym string The symbol

func (Config) MarketMyOrderHistory

func (c Config) MarketMyOrderHistory(sym string, p, lmt, start, end int) (bitkubResponse, error)

List all orders that have already matched. Use resp.Body success with MarketMyOrderHistory type, error with MarketError type. - sym string The symbol - p int Page (optional) - lmt int Limit (optional) - start int Start timestamp (optional) - end int End timestamp (optional)

func (Config) MarketOrderInfo

func (c Config) MarketOrderInfo(sym string, id int, sd, hash string) (bitkubResponse, error)

Get information regarding the specified order. Use resp.Body success with MarketOrderInfo type, error with MarketError type. - sym string The symbol - id int Order id - sd string Order side: buy or sell - hash string Lookup an order with order hash (optional). You don't need to specify sym, id, and sd when you specify order hash.

func (Config) MarketPlaceAsk

func (c Config) MarketPlaceAsk(sym string, amt, rat float64, typ, client_id string) (bitkubResponse, error)

Create a sell order. Use resp.Body success with MarketPlaceAsk type, error with MarketError type. - sym string The symbol - amt float Amount you want to sell with no trailing zero (e.g 0.10000000 is invalid, 0.1 is ok) - rat float Rate you want for the order with no trailing zero (e.g 1000.00 is invalid, 1000 is ok) - typ string Order type: limit or market (for market order, please specify rat as 0) - client_id string your id for reference (no required)

func (Config) MarketPlaceAskByFiat

func (c Config) MarketPlaceAskByFiat(sym string, amt, rat float64, typ string) (bitkubResponse, error)

Create a sell order by specifying the fiat amount you want to receive (selling amount of cryptocurrency is automatically calculated). If order type is market, currrent highest bid will be used as rate. Use resp.Body success with MarketPlaceAskByFiat type, error with MarketError type. - sym string The symbol - amt float Fiat amount you want to receive with no trailing zero (e.g 1000.00 is invalid, 1000 is ok) - rat float Rate you want for the order with no trailing zero (e.g 1000.00 is invalid, 1000 is ok) - typ string Order type: limit or market

func (Config) MarketPlaceAskTest

func (c Config) MarketPlaceAskTest(sym string, amt, rat float64, typ, client_id string) (bitkubResponse, error)

Create a test sell order. Use resp.Body success with MarketPlaceAsk type, error with MarketError type. - sym string The symbol - amt float Amount you want to sell with no trailing zero (e.g 0.10000000 is invalid, 0.1 is ok) - rat float Rate you want for the order with no trailing zero (e.g 1000.00 is invalid, 1000 is ok) - typ string Order type: limit or market (for market order, please specify rat as 0) - client_id string your id for reference (no required)

func (Config) MarketPlaceBid

func (c Config) MarketPlaceBid(sym string, amt, rat float64, typ, client_id string) (bitkubResponse, error)

Create a buy order. Use resp.Body success with MarketPlaceBid type, error with MarketError type. - sym string The symbol - amt float Amount you want to spend with no trailing zero (e.g 1000.00 is invalid, 1000 is ok) - rat float Rate you want for the order with no trailing zero (e.g 1000.00 is invalid, 1000 is ok) - typ string Order type: limit or market - client_id string your id for reference (no required)

func (Config) MarketPlaceBidTest

func (c Config) MarketPlaceBidTest(sym string, amt, rat float64, typ, client_id string) (bitkubResponse, error)

Create a test buy order. Use resp.Body success with MarketPlaceBid type, error with MarketError type. - sym string The symbol - amt float Amount you want to spend with no trailing zero (e.g 1000.00 is invalid, 1000 is ok) - rat float Rate you want for the order with no trailing zero (e.g 1000.00 is invalid, 1000 is ok) - typ string Order type: limit or market - client_id string your id for reference (no required)

func (Config) MarketSymbols

func (c Config) MarketSymbols() (bitkubResponse, error)

List all available symbols. Use resp.Body success with MarketSymbols type, error with MarketError type

func (Config) MarketTicker

func (c Config) MarketTicker(sym string) (bitkubResponse, error)

Get ticker information. Use resp.Body success with MarketTicker type, error with MarketError type - sym string The symbol (optional)

func (Config) MarketTrades

func (c Config) MarketTrades(sym string, lmt int) (bitkubResponse, error)

List recent trades. Use resp.Body success with MarketTrades type, error with MarketError type - sym string The symbol - lmt string No. of limit to query recent trades

func (Config) MarketWallet

func (c Config) MarketWallet() (bitkubResponse, error)

Get user available balances (for both available and reserved balances please use POST /api/market/balances) Use resp.Body success with MarketWallet type, error with MarketError type.

func (Config) MarketWsToken

func (c Config) MarketWsToken() (bitkubResponse, error)

Get the token for websocket authentication. Use resp.Body success with MarketWsToken type, error with MarketError type.

func (Config) ServerTime

func (c Config) ServerTime() (bitkubResponse, error)

Get server timestamp.

func (Config) Sign

func (c Config) Sign(body map[string]interface{}) (map[string]interface{}, error)

Generate the signature from the JSON payload using HMAC SHA-256. Use the API SECRET as the secret key for generating the HMAC variant of JSON payload. Signature is in hex format.

func (Config) Status

func (c Config) Status() (bitkubResponse, error)

Get endpoint status. When status is not ok, it is highly recommended to wait until the status changes back to ok.

func (Config) UserLimits

func (c Config) UserLimits() (bitkubResponse, error)

Check deposit/withdraw limitations and usage. Use resp.Body success with UserLimits type, error with UserError type

func (Config) UserTradingCredits

func (c Config) UserTradingCredits() (bitkubResponse, error)

Check trading credit balance. Use resp.Body success with UserTradingCredits type, error with UserError type

type CryptoAddresses

type CryptoAddresses struct {
	Error      int                     `json:"error"`
	Result     []CryptoAddressesResult `json:"result"`
	Pagination Pagination              `json:"pagination"`
}

CryptoAddresses data structure

type CryptoAddressesResult

type CryptoAddressesResult struct {
	Currency string `json:"currency"`
	Address  string `json:"address"`
	Tag      int    `json:"tag"`
	Time     int    `json:"time"`
}

CryptoAddressesResult data structure

type CryptoDepositHistory

type CryptoDepositHistory struct {
	Error      bitkubError                  `json:"error"`
	Result     []CryptoDepositHistoryResult `json:"result"`
	Pagination Pagination                   `json:"pagination"`
}

CryptoDepositHistory data structure

type CryptoDepositHistoryResult

type CryptoDepositHistoryResult struct {
	Hash          string  `json:"hash"`
	Currency      string  `json:"currency"`
	Amount        float64 `json:"amount"`
	FromAddress   string  `json:"from_address"`
	ToAddress     string  `json:"to_address"`
	Confirmations int     `json:"confirmations"`
	Status        string  `json:"status"`
	Time          int     `json:"time"`
}

CryptoDepositHistoryResult data structure

type CryptoError

type CryptoError struct {
	Error  bitkubError       `json:"error"`
	Result CryptoErrorResult `json:"result"`
}

CryptoError data structure

type CryptoErrorResult

type CryptoErrorResult struct {
	Lmt []string `json:"lmt"`
	Sym []string `json:"sym"`
}

CryptoErrorResult data structure

type CryptoGenerateAddress

type CryptoGenerateAddress struct {
	Error  bitkubError                   `json:"error"`
	Result []CryptoGenerateAddressResult `json:"result"`
}

CryptoGenerateAddress data structure

type CryptoGenerateAddressResult

type CryptoGenerateAddressResult struct {
	Currency string `json:"currency"`
	Address  string `json:"address"`
	Memo     string `json:"memo"`
}

CryptoGenerateAddressResult data structure

type CryptoInternalWithdraw

type CryptoInternalWithdraw struct {
	Error  bitkubError                  `json:"error"`
	Result CryptoInternalWithdrawResult `json:"result"`
}

CryptoInternalWithdraw data structure

type CryptoInternalWithdrawResult

type CryptoInternalWithdrawResult struct {
	Txn string  `json:"txn"`
	Adr string  `json:"adr"`
	Mem string  `json:"mem"`
	Cur string  `json:"cur"`
	Amt float64 `json:"amt"`
	Fee float64 `json:"fee"`
	Ts  int     `json:"ts"`
}

CryptoInternalWithdrawResult data structure

type CryptoWithdraw

type CryptoWithdraw struct {
	Error  int                  `json:"error"`
	Result CryptoWithdrawResult `json:"result"`
}

CryptoWithdraw data structure

type CryptoWithdrawHistory

type CryptoWithdrawHistory struct {
	Error      bitkubError                   `json:"error"`
	Result     []CryptoWithdrawHistoryResult `json:"result"`
	Pagination Pagination                    `json:"pagination"`
}

CryptoWithdrawHistory data structure

type CryptoWithdrawHistoryResult

type CryptoWithdrawHistoryResult struct {
	TxnID    string  `json:"txn_id"`
	Hash     string  `json:"hash"`
	Currency string  `json:"currency"`
	Amount   string  `json:"amount"`
	Fee      float64 `json:"fee"`
	Address  string  `json:"address"`
	Status   string  `json:"status"`
	Time     int     `json:"time"`
}

CryptoWithdrawHistoryResult data structure

type CryptoWithdrawResult

type CryptoWithdrawResult struct {
	Txn string  `json:"txn"`
	Adr string  `json:"adr"`
	Mem string  `json:"mem"`
	Cur string  `json:"cur"`
	Amt float64 `json:"amt"`
	Fee float64 `json:"fee"`
	Ts  int     `json:"ts"`
}

CryptoWithdrawResult data structure

type FiatAccounts

type FiatAccounts struct {
	Error      bitkubError          `json:"error"`
	Result     []FiatAccountsResult `json:"result"`
	Pagination Pagination           `json:"pagination"`
}

FiatAccounts data structure

type FiatAccountsResult

type FiatAccountsResult struct {
	ID   string `json:"id"`
	Bank string `json:"bank"`
	Name string `json:"name"`
	Time int    `json:"time"`
}

FiatAccountsResult data structure

type FiatDepositHistory

type FiatDepositHistory struct {
	Error  bitkubError `json:"error"`
	Result []struct {
		TxnID    string  `json:"txn_id"`
		Currency string  `json:"currency"`
		Amount   float64 `json:"amount"`
		Status   string  `json:"status"`
		Time     int     `json:"time"`
	} `json:"result"`
	Pagination Pagination `json:"pagination"`
}

FiatDepositHistory data structure

type FiatDepositHistoryResult

type FiatDepositHistoryResult struct {
	TxnID    string  `json:"txn_id"`
	Currency string  `json:"currency"`
	Amount   float64 `json:"amount"`
	Status   string  `json:"status"`
	Time     int     `json:"time"`
}

FiatDepositHistoryResult data structure

type FiatError

type FiatError struct {
	Error  bitkubError     `json:"error"`
	Result FiatErrorResult `json:"result"`
}

FiatError data structure

type FiatErrorResult

type FiatErrorResult struct {
	Lmt []string `json:"lmt"`
	Sym []string `json:"sym"`
}

FiatErrorResult data structure

type FiatWithdraw

type FiatWithdraw struct {
	Error  bitkubError        `json:"error"`
	Result FiatWithdrawResult `json:"result"`
}

FiatWithdraw data structure

type FiatWithdrawHistory

type FiatWithdrawHistory struct {
	Error  bitkubError `json:"error"`
	Result []struct {
		TxnID    string `json:"txn_id"`
		Currency string `json:"currency"`
		Amount   string `json:"amount"`
		Fee      int    `json:"fee"`
		Status   string `json:"status"`
		Time     int    `json:"time"`
	} `json:"result"`
	Pagination Pagination `json:"pagination"`
}

FiatWithdrawHistory data structure

type FiatWithdrawHistoryResult

type FiatWithdrawHistoryResult struct {
	TxnID    string `json:"txn_id"`
	Currency string `json:"currency"`
	Amount   string `json:"amount"`
	Fee      int    `json:"fee"`
	Status   string `json:"status"`
	Time     int    `json:"time"`
}

FiatWithdrawHistoryResult data structure

type FiatWithdrawResult

type FiatWithdrawResult struct {
	Txn string `json:"txn"`
	Acc string `json:"acc"`
	Cur string `json:"cur"`
	Amt int    `json:"amt"`
	Fee int    `json:"fee"`
	Rec int    `json:"rec"`
	Ts  int    `json:"ts"`
}

FiatWithdrawResult data structure

type History

type History struct {
	C []float64 `json:"c"`
	H []float64 `json:"h"`
	L []float64 `json:"l"`
	O []float64 `json:"o"`
	S string    `json:"s"`
	T []int     `json:"t"`
	V []float64 `json:"v"`
}

History data structure

type MarketBalances

type MarketBalances struct {
	Error  bitkubError                     `json:"error"`
	Result map[string]MarketBalancesResult `json:"result"`
}

MarketBalances data structure

type MarketBalancesResult

type MarketBalancesResult struct {
	Available float64 `json:"available"`
	Reserved  int     `json:"reserved"`
}

MarketBalancesResult data structure

type MarketBidsAsks

type MarketBidsAsks struct {
	Error  bitkubError `json:"error"`
	Result [][]float64 `json:"result"`
}

MarketBidsAsks data structure

type MarketBooks

type MarketBooks struct {
	Error  bitkubError       `json:"error"`
	Result MarketBooksResult `json:"result"`
}

MarketBooks data structure

type MarketBooksResult

type MarketBooksResult struct {
	Asks [][]float64 `json:"asks"`
	Bids [][]float64 `json:"bids"`
}

MarketBooksResult data structure

type MarketDepth

type MarketDepth struct {
	Asks [][]float64 `json:"asks"`
	Bids [][]float64 `json:"bids"`
}

MarketDepth data structure

type MarketError

type MarketError struct {
	Error  bitkubError       `json:"error"`
	Result MarketErrorResult `json:"result"`
}

MarketError data structure

type MarketErrorResult

type MarketErrorResult struct {
	Lmt []string `json:"lmt"`
	Sym []string `json:"sym"`
}

MarketErrorResult data structure

type MarketMyOpenOrders

type MarketMyOpenOrders struct {
	Error  bitkubError                `json:"error"`
	Result []MarketMyOpenOrdersResult `json:"result"`
}

MarketMyOpenOrders data structure

type MarketMyOpenOrdersResult

type MarketMyOpenOrdersResult struct {
	ID       int     `json:"id"`
	Hash     string  `json:"hash"`
	Side     string  `json:"side"`
	Type     string  `json:"type"`
	Rate     float64 `json:"rate"`
	Fee      float64 `json:"fee"`
	Credit   float64 `json:"credit"`
	Amount   float64 `json:"amount"`
	Receive  float64 `json:"receive"`
	ParentID int     `json:"parent_id"`
	SuperID  int     `json:"super_id"`
	Ts       int     `json:"ts"`
}

MarketMyOpenOrdersResult data structure

type MarketMyOrderHistory

type MarketMyOrderHistory struct {
	Error      bitkubError                  `json:"error"`
	Result     []MarketMyOrderHistoryResult `json:"result"`
	Pagination Pagination                   `json:"pagination"`
}

MarketMyOrderHistory data structure

type MarketMyOrderHistoryResult

type MarketMyOrderHistoryResult struct {
	TxnID           string  `json:"txn_id"`
	OrderID         int     `json:"order_id"`
	Hash            string  `json:"hash"`
	ParentOrderID   int     `json:"parent_order_id"`
	ParentOrderHash string  `json:"parent_order_hash"`
	SuperOrderID    int     `json:"super_order_id"`
	SuperOrderHash  string  `json:"super_order_hash"`
	TakenByMe       bool    `json:"taken_by_me"`
	IsMaker         bool    `json:"is_maker"`
	Side            string  `json:"side"`
	Type            string  `json:"type"`
	Rate            float64 `json:"rate"`
	Fee             float64 `json:"fee"`
	Credit          float64 `json:"credit"`
	Amount          float64 `json:"amount"`
	Ts              int     `json:"ts"`
	Date            string  `json:"date"`
}

MarketMyOrderHistoryResult data structure

type MarketOrderInfo

type MarketOrderInfo struct {
	Error  bitkubError           `json:"error"`
	Result MarketOrderInfoResult `json:"result"`
}

MarketOrderInfo data structure

type MarketOrderInfoResult

type MarketOrderInfoResult struct {
	ID            int                            `json:"id"`
	First         int                            `json:"first"`
	Parent        int                            `json:"parent"`
	Last          int                            `json:"last"`
	Amount        int                            `json:"amount"`
	Rate          int                            `json:"rate"`
	Fee           int                            `json:"fee"`
	Credit        int                            `json:"credit"`
	Filled        float64                        `json:"filled"`
	Total         int                            `json:"total"`
	Status        string                         `json:"status"`
	PartialFilled bool                           `json:"partial_filled"`
	Remaining     int                            `json:"remaining"`
	History       []MarketOrderInfoResultHistory `json:"history"`
}

MarketOrderInfoResult data structure

type MarketOrderInfoResultHistory

type MarketOrderInfoResultHistory struct {
	Amount    float64 `json:"amount"`
	Credit    float64 `json:"credit"`
	Fee       float64 `json:"fee"`
	ID        int     `json:"id"`
	Rate      int     `json:"rate"`
	Timestamp int     `json:"timestamp"`
}

MarketOrderInfoResultHistory data structure

type MarketPlaceAsk

type MarketPlaceAsk struct {
	Error  bitkubError          `json:"error"`
	Result MarketPlaceAskResult `json:"result"`
}

MarketPlaceAsk data structure

type MarketPlaceAskByFiat

type MarketPlaceAskByFiat struct {
	Error  bitkubError                `json:"error"`
	Result MarketPlaceAskByFiatResult `json:"result"`
}

MarketPlaceAskByFiat data structure

type MarketPlaceAskByFiatResult

type MarketPlaceAskByFiatResult struct {
	ID   int     `json:"id"`
	Hash string  `json:"hash"`
	Typ  string  `json:"typ"`
	Amt  float64 `json:"amt"`
	Rat  int     `json:"rat"`
	Fee  float64 `json:"fee"`
	Cre  int     `json:"cre"`
	Rec  float64 `json:"rec"`
	Ts   int     `json:"ts"`
}

MarketPlaceAskByFiatResult data structure

type MarketPlaceAskResult

type MarketPlaceAskResult struct {
	ID   int     `json:"id"`
	Hash string  `json:"hash"`
	Typ  string  `json:"typ"`
	Amt  float64 `json:"amt"`
	Rat  float64 `json:"rat"`
	Fee  float64 `json:"fee"`
	Cre  float64 `json:"cre"`
	Rec  float64 `json:"rec"`
	Ts   int     `json:"ts"`
}

MarketPlaceAskResult data structure

type MarketPlaceBid

type MarketPlaceBid struct {
	Error  bitkubError          `json:"error"`
	Result MarketPlaceBidResult `json:"result"`
}

MarketPlaceBid data structure

type MarketPlaceBidResult

type MarketPlaceBidResult struct {
	ID   int     `json:"id"`
	Hash string  `json:"hash"`
	Typ  string  `json:"typ"`
	Amt  float64 `json:"amt"`
	Rat  float64 `json:"rat"`
	Fee  float64 `json:"fee"`
	Cre  float64 `json:"cre"`
	Rec  float64 `json:"rec"`
	Ts   int     `json:"ts"`
}

MarketPlaceBidResult data structure

type MarketSymbols

type MarketSymbols struct {
	Error  bitkubError           `json:"error"`
	Result []MarketSymbolsResult `json:"result"`
}

MarketSymbols data structure

type MarketSymbolsResult

type MarketSymbolsResult struct {
	ID     int    `json:"id"`
	Symbol string `json:"symbol"`
	Info   string `json:"info"`
}

MarketSymbolsResult data structure

type MarketTicker

type MarketTicker struct {
	ID            int     `json:"id"`
	Last          float64 `json:"last"`
	LowestAsk     float64 `json:"lowestAsk"`
	HighestBid    float64 `json:"highestBid"`
	PercentChange float64 `json:"percentChange"`
	BaseVolume    float64 `json:"baseVolume"`
	QuoteVolume   float64 `json:"quoteVolume"`
	IsFrozen      int     `json:"isFrozen"`
	High24Hr      float64 `json:"high24hr"`
	Low24Hr       float64 `json:"low24hr"`
	Change        float64 `json:"change"`
	PrevClose     float64 `json:"prevClose"`
	PrevOpen      float64 `json:"prevOpen"`
}

MarketTicker data structure

type MarketTrades

type MarketTrades struct {
	Error  bitkubError     `json:"error"`
	Result [][]interface{} `json:"result"`
}

MarketTrades type

type MarketWallet

type MarketWallet struct {
	Error  bitkubError        `json:"error"`
	Result map[string]float64 `json:"result"`
}

MarketWallet data structure

type MarketWsToken

type MarketWsToken struct {
	Error  bitkubError `json:"error"`
	Result string      `json:"result"`
}

MarketWsToken data structure

type Pagination

type Pagination struct {
	Page int `json:"page"`
	Last int `json:"last"`
	Next int `json:"next"`
	Prev int `json:"prev"`
}

Pagination data structure

type Status

type Status struct {
	Name    string `json:"name"`
	Status  string `json:"status"`
	Message string `json:"message"`
}

Status data structure

type UserError

type UserError struct {
	Error  bitkubError     `json:"error"`
	Result UserErrorResult `json:"result"`
}

UserError data structure

type UserErrorResult

type UserErrorResult struct {
	Lmt []string `json:"lmt"`
	Sym []string `json:"sym"`
}

UserErrorResult data structure

type UserLimits

type UserLimits struct {
	Error  bitkubError      `json:"error"`
	Result UserLimitsResult `json:"result"`
}

UserLimits data structure

type UserLimitsResult

type UserLimitsResult struct {
	Limits UserLimitsResultLimits `json:"limits"`
	Usage  UserLimitsResultUsage  `json:"usage"`
	Rate   int                    `json:"rate"`
}

UserLimitsResult data structure

type UserLimitsResultLimits

type UserLimitsResultLimits struct {
	Crypto UserLimitsResultLimitsCrypto `json:"crypto"`
	Fiat   UserLimitsResultLimitsFiat   `json:"fiat"`
}

UserLimitsResultLimits data structure

type UserLimitsResultLimitsCrypto

type UserLimitsResultLimitsCrypto struct {
	Deposit  float64 `json:"deposit"`
	Withdraw float64 `json:"withdraw"`
}

UserLimitsResultLimitsCrypto data structure

type UserLimitsResultLimitsFiat

type UserLimitsResultLimitsFiat struct {
	Deposit  int `json:"deposit"`
	Withdraw int `json:"withdraw"`
}

UserLimitsResultLimits data structure

type UserLimitsResultUsage

type UserLimitsResultUsage struct {
	Crypto UserLimitsResultUsageCrypto `json:"crypto"`
	Fiat   UserLimitsResultUsageFiat   `json:"fiat"`
}

UserLimitsResultUsage data structure

type UserLimitsResultUsageCrypto

type UserLimitsResultUsageCrypto struct {
	Deposit               int `json:"deposit"`
	Withdraw              int `json:"withdraw"`
	DepositPercentage     int `json:"deposit_percentage"`
	WithdrawPercentage    int `json:"withdraw_percentage"`
	DepositThbEquivalent  int `json:"deposit_thb_equivalent"`
	WithdrawThbEquivalent int `json:"withdraw_thb_equivalent"`
}

UserLimitsResultUsageCrypto data structure

type UserLimitsResultUsageFiat

type UserLimitsResultUsageFiat struct {
	Deposit            int `json:"deposit"`
	Withdraw           int `json:"withdraw"`
	DepositPercentage  int `json:"deposit_percentage"`
	WithdrawPercentage int `json:"withdraw_percentage"`
}

UserLimitsResultUsageFiat data structure

type UserTradingCredits

type UserTradingCredits struct {
	Error  bitkubError `json:"error"`
	Result int         `json:"result"`
}

UserTradingCredits

Jump to

Keyboard shortcuts

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