UpBitGo

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2021 License: MIT Imports: 12 Imported by: 0

README

UpBitGo

Go언어 UpBit (업비트) 라이브러리

Install

go get github.com/Beta5051/UpBitGo

Progress

  • Client
  • Exchange
  • Quotation
  • WebSocket

Example

Exchange
package main

import (
	"fmt"
	"github.com/Beta5051/UpBitGo"
)

func main() {
	client := UpBitGo.NewClient("", "")

	accounts, err := client.GetAccounts()
	if err != nil {
		panic(err)
	}

	for _, account := range accounts {
		fmt.Println(account)
	}
}
Quotation
package main

import (
	"fmt"
	"github.com/Beta5051/UpBitGo"
)

func main() {
	client := UpBitGo.NewClient("", "")

	markets, err := client.GetMarkets(true)
	if err != nil {
		panic(err)
	}

	for _, market := range markets {
		fmt.Println(market)
	}
}
WebSocket
package main

import (
	"fmt"
	"github.com/Beta5051/UpBitGo"
)

func main() {
	ws, err := UpBitGo.NewWebSocket()
	if err != nil {
		panic(err)
	}

	ws.SendField([]UpBitGo.TypeField{
		{
			Type: "ticker",
			Codes: []string{UpBitGo.KRW_BTC},
		},
	})

	channel := make(chan interface{})
	go ws.Recv(channel)
	for {
		if data, ok := <- channel; ok {
			switch data.(type) {
			case UpBitGo.TickerWebSocket:
				fmt.Println(data.(UpBitGo.TickerWebSocket))
			case UpBitGo.TradeWebSocket:
				fmt.Println(data.(UpBitGo.TradeWebSocket))
			case UpBitGo.OrderbookWebSocket:
				fmt.Println(data.(UpBitGo.OrderbookWebSocket))
			}
		} else {
			break
		}
	}
}

Documentation

Index

Constants

View Source
const (
	KRW_BTC     = "KRW-BTC"
	KRW_ETH     = "KRW-ETH"
	BTC_ETH     = "BTC-ETH"
	BTC_LTC     = "BTC-LTC"
	BTC_XRP     = "BTC-XRP"
	BTC_ETC     = "BTC-ETC"
	BTC_OMG     = "BTC-OMG"
	BTC_CVC     = "BTC-CVC"
	BTC_DGB     = "BTC-DGB"
	BTC_SC      = "BTC-SC"
	BTC_SNT     = "BTC-SNT"
	BTC_WAVES   = "BTC-WAVES"
	BTC_NMR     = "BTC-NMR"
	BTC_XEM     = "BTC-XEM"
	BTC_LBC     = "BTC-LBC"
	BTC_QTUM    = "BTC-QTUM"
	BTC_NXT     = "BTC-NXT"
	BTC_BAT     = "BTC-BAT"
	BTC_LSK     = "BTC-LSK"
	BTC_RDD     = "BTC-RDD"
	BTC_STEEM   = "BTC-STEEM"
	BTC_DOGE    = "BTC-DOGE"
	BTC_BNT     = "BTC-BNT"
	BTC_XLM     = "BTC-XLM"
	BTC_ARDR    = "BTC-ARDR"
	BTC_KMD     = "BTC-KMD"
	BTC_ARK     = "BTC-ARK"
	BTC_ADX     = "BTC-ADX"
	BTC_SYS     = "BTC-SYS"
	BTC_ANT     = "BTC-ANT"
	BTC_STORJ   = "BTC-STORJ"
	BTC_GRS     = "BTC-GRS"
	BTC_REP     = "BTC-REP"
	BTC_RLC     = "BTC-RLC"
	BTC_EMC2    = "BTC-EMC2"
	USDT_BTC    = "USDT-BTC"
	USDT_ETH    = "USDT-ETH"
	USDT_LTC    = "USDT-LTC"
	USDT_XRP    = "USDT-XRP"
	USDT_ETC    = "USDT-ETC"
	KRW_NEO     = "KRW-NEO"
	KRW_MTL     = "KRW-MTL"
	KRW_LTC     = "KRW-LTC"
	KRW_XRP     = "KRW-XRP"
	KRW_ETC     = "KRW-ETC"
	KRW_OMG     = "KRW-OMG"
	KRW_SNT     = "KRW-SNT"
	KRW_WAVES   = "KRW-WAVES"
	KRW_XEM     = "KRW-XEM"
	KRW_QTUM    = "KRW-QTUM"
	KRW_LSK     = "KRW-LSK"
	KRW_STEEM   = "KRW-STEEM"
	KRW_XLM     = "KRW-XLM"
	KRW_ARDR    = "KRW-ARDR"
	KRW_KMD     = "KRW-KMD"
	KRW_ARK     = "KRW-ARK"
	KRW_STORJ   = "KRW-STORJ"
	KRW_GRS     = "KRW-GRS"
	KRW_REP     = "KRW-REP"
	KRW_EMC2    = "KRW-EMC2"
	KRW_ADA     = "KRW-ADA"
	BTC_ADA     = "BTC-ADA"
	BTC_MANA    = "BTC-MANA"
	USDT_OMG    = "USDT-OMG"
	KRW_SBD     = "KRW-SBD"
	BTC_SBD     = "BTC-SBD"
	BTC_RCN     = "BTC-RCN"
	KRW_POWR    = "KRW-POWR"
	BTC_POWR    = "BTC-POWR"
	KRW_BTG     = "KRW-BTG"
	USDT_ADA    = "USDT-ADA"
	BTC_DNT     = "BTC-DNT"
	BTC_IGNIS   = "BTC-IGNIS"
	BTC_ZRX     = "BTC-ZRX"
	BTC_TRX     = "BTC-TRX"
	BTC_TUSD    = "BTC-TUSD"
	BTC_LRC     = "BTC-LRC"
	KRW_ICX     = "KRW-ICX"
	KRW_EOS     = "KRW-EOS"
	BTC_DMT     = "BTC-DMT"
	USDT_TUSD   = "USDT-TUSD"
	KRW_TRX     = "KRW-TRX"
	BTC_POLY    = "BTC-POLY"
	BTC_PRO     = "BTC-PRO"
	USDT_SC     = "USDT-SC"
	USDT_TRX    = "USDT-TRX"
	KRW_SC      = "KRW-SC"
	KRW_IGNIS   = "KRW-IGNIS"
	KRW_ONT     = "KRW-ONT"
	KRW_ZIL     = "KRW-ZIL"
	KRW_POLY    = "KRW-POLY"
	KRW_ZRX     = "KRW-ZRX"
	KRW_LOOM    = "KRW-LOOM"
	BTC_BCH     = "BTC-BCH"
	USDT_BCH    = "USDT-BCH"
	KRW_BCH     = "KRW-BCH"
	BTC_MFT     = "BTC-MFT"
	BTC_LOOM    = "BTC-LOOM"
	KRW_ADX     = "KRW-ADX"
	KRW_BAT     = "KRW-BAT"
	KRW_IOST    = "KRW-IOST"
	BTC_RFR     = "BTC-RFR"
	KRW_DMT     = "KRW-DMT"
	KRW_RFR     = "KRW-RFR"
	USDT_DGB    = "USDT-DGB"
	KRW_CVC     = "KRW-CVC"
	KRW_IQ      = "KRW-IQ"
	KRW_IOTA    = "KRW-IOTA"
	BTC_RVN     = "BTC-RVN"
	BTC_BFT     = "BTC-BFT"
	BTC_GO      = "BTC-GO"
	BTC_UPP     = "BTC-UPP"
	BTC_ENJ     = "BTC-ENJ"
	KRW_MFT     = "KRW-MFT"
	BTC_EDR     = "BTC-EDR"
	KRW_ONG     = "KRW-ONG"
	KRW_GAS     = "KRW-GAS"
	BTC_MTL     = "BTC-MTL"
	KRW_UPP     = "KRW-UPP"
	KRW_ELF     = "KRW-ELF"
	USDT_DOGE   = "USDT-DOGE"
	USDT_ZRX    = "USDT-ZRX"
	USDT_RVN    = "USDT-RVN"
	USDT_BAT    = "USDT-BAT"
	KRW_KNC     = "KRW-KNC"
	BTC_PAX     = "BTC-PAX"
	BTC_MOC     = "BTC-MOC"
	BTC_ZIL     = "BTC-ZIL"
	KRW_BSV     = "KRW-BSV"
	BTC_BSV     = "BTC-BSV"
	BTC_IOST    = "BTC-IOST"
	KRW_THETA   = "KRW-THETA"
	BTC_NCASH   = "BTC-NCASH"
	KRW_EDR     = "KRW-EDR"
	BTC_DENT    = "BTC-DENT"
	KRW_QKC     = "KRW-QKC"
	BTC_ELF     = "BTC-ELF"
	KRW_BTT     = "KRW-BTT"
	BTC_BTT     = "BTC-BTT"
	BTC_VITE    = "BTC-VITE"
	BTC_IOTX    = "BTC-IOTX"
	BTC_SOLVE   = "BTC-SOLVE"
	BTC_NKN     = "BTC-NKN"
	BTC_META    = "BTC-META"
	KRW_MOC     = "KRW-MOC"
	BTC_ANKR    = "BTC-ANKR"
	BTC_CRO     = "BTC-CRO"
	KRW_ENJ     = "KRW-ENJ"
	KRW_TFUEL   = "KRW-TFUEL"
	BTC_FSN     = "BTC-FSN"
	KRW_MANA    = "KRW-MANA"
	KRW_ANKR    = "KRW-ANKR"
	BTC_ORBS    = "BTC-ORBS"
	BTC_AERGO   = "BTC-AERGO"
	BTC_PI      = "BTC-PI"
	KRW_AERGO   = "KRW-AERGO"
	KRW_ATOM    = "KRW-ATOM"
	KRW_TT      = "KRW-TT"
	KRW_CRE     = "KRW-CRE"
	KRW_SOLVE   = "KRW-SOLVE"
	BTC_ATOM    = "BTC-ATOM"
	BTC_STPT    = "BTC-STPT"
	KRW_MBL     = "KRW-MBL"
	BTC_LAMB    = "BTC-LAMB"
	BTC_EOS     = "BTC-EOS"
	BTC_LUNA    = "BTC-LUNA"
	BTC_DAI     = "BTC-DAI"
	BTC_MKR     = "BTC-MKR"
	BTC_BORA    = "BTC-BORA"
	KRW_TSHP    = "KRW-TSHP"
	BTC_TSHP    = "BTC-TSHP"
	KRW_WAXP    = "KRW-WAXP"
	BTC_WAXP    = "BTC-WAXP"
	KRW_HBAR    = "KRW-HBAR"
	KRW_MED     = "KRW-MED"
	BTC_MED     = "BTC-MED"
	BTC_MLK     = "BTC-MLK"
	KRW_MLK     = "KRW-MLK"
	BTC_PXL     = "BTC-PXL"
	KRW_STPT    = "KRW-STPT"
	BTC_VET     = "BTC-VET"
	KRW_ORBS    = "KRW-ORBS"
	BTC_CHZ     = "BTC-CHZ"
	KRW_VET     = "KRW-VET"
	BTC_FX      = "BTC-FX"
	BTC_OGN     = "BTC-OGN"
	KRW_CHZ     = "KRW-CHZ"
	KRW_PXL     = "KRW-PXL"
	BTC_ITAM    = "BTC-ITAM"
	BTC_XTZ     = "BTC-XTZ"
	BTC_HIVE    = "BTC-HIVE"
	BTC_HBD     = "BTC-HBD"
	BTC_OBSR    = "BTC-OBSR"
	BTC_DKA     = "BTC-DKA"
	KRW_STMX    = "KRW-STMX"
	BTC_STMX    = "BTC-STMX"
	BTC_AHT     = "BTC-AHT"
	BTC_PCI     = "BTC-PCI"
	BTC_RINGX   = "BTC-RINGX"
	KRW_DKA     = "KRW-DKA"
	BTC_LINK    = "BTC-LINK"
	KRW_HIVE    = "KRW-HIVE"
	KRW_KAVA    = "KRW-KAVA"
	BTC_KAVA    = "BTC-KAVA"
	KRW_AHT     = "KRW-AHT"
	KRW_LINK    = "KRW-LINK"
	KRW_XTZ     = "KRW-XTZ"
	KRW_BORA    = "KRW-BORA"
	BTC_JST     = "BTC-JST"
	BTC_CHR     = "BTC-CHR"
	BTC_DAD     = "BTC-DAD"
	BTC_TON     = "BTC-TON"
	KRW_JST     = "KRW-JST"
	BTC_CTSI    = "BTC-CTSI"
	BTC_DOT     = "BTC-DOT"
	KRW_CRO     = "KRW-CRO"
	BTC_COMP    = "BTC-COMP"
	BTC_SXP     = "BTC-SXP"
	BTC_HUNT    = "BTC-HUNT"
	KRW_TON     = "KRW-TON"
	BTC_ONIT    = "BTC-ONIT"
	BTC_CRV     = "BTC-CRV"
	BTC_ALGO    = "BTC-ALGO"
	BTC_RSR     = "BTC-RSR"
	KRW_SXP     = "KRW-SXP"
	BTC_OXT     = "BTC-OXT"
	BTC_PLA     = "BTC-PLA"
	KRW_LAMB    = "KRW-LAMB"
	KRW_HUNT    = "KRW-HUNT"
	BTC_MARO    = "BTC-MARO"
	KRW_MARO    = "KRW-MARO"
	BTC_SAND    = "BTC-SAND"
	BTC_SUN     = "BTC-SUN"
	KRW_PLA     = "KRW-PLA"
	KRW_DOT     = "KRW-DOT"
	BTC_SRM     = "BTC-SRM"
	BTC_QTCON   = "BTC-QTCON"
	BTC_MVL     = "BTC-MVL"
	KRW_SRM     = "KRW-SRM"
	KRW_MVL     = "KRW-MVL"
	BTC_GXC     = "BTC-GXC"
	KRW_PCI     = "KRW-PCI"
	BTC_AQT     = "BTC-AQT"
	BTC_AXS     = "BTC-AXS"
	BTC_STRAX   = "BTC-STRAX"
	KRW_STRAX   = "KRW-STRAX"
	KRW_AQT     = "KRW-AQT"
	BTC_BCHA    = "BTC-BCHA"
	KRW_BCHA    = "KRW-BCHA"
	BTC_GLM     = "BTC-GLM"
	KRW_GLM     = "KRW-GLM"
	KRW_QTCON   = "KRW-QTCON"
	BTC_FCT2    = "BTC-FCT2"
	BTC_SSX     = "BTC-SSX"
	KRW_SSX     = "KRW-SSX"
	KRW_META    = "KRW-META"
	KRW_OBSR    = "KRW-OBSR"
	KRW_FCT2    = "KRW-FCT2"
	BTC_FIL     = "BTC-FIL"
	KRW_LBC     = "KRW-LBC"
	BTC_UNI     = "BTC-UNI"
	BTC_BASIC   = "BTC-BASIC"
	BTC_INJ     = "BTC-INJ"
	BTC_PROM    = "BTC-PROM"
	BTC_VAL     = "BTC-VAL"
	BTC_PSG     = "BTC-PSG"
	BTC_JUV     = "BTC-JUV"
	BTC_CBK     = "BTC-CBK"
	BTC_FOR     = "BTC-FOR"
	KRW_CBK     = "KRW-CBK"
	BTC_BFC     = "BTC-BFC"
	BTC_LINA    = "BTC-LINA"
	BTC_HUM     = "BTC-HUM"
	BTC_PICA    = "BTC-PICA"
	BTC_CELO    = "BTC-CELO"
	KRW_SAND    = "KRW-SAND"
	KRW_HUM     = "KRW-HUM"
	BTC_IQ      = "BTC-IQ"
	BTC_STX     = "BTC-STX"
	KRW_DOGE    = "KRW-DOGE"
	BTC_NEAR    = "BTC-NEAR"
	BTC_AUCTION = "BTC-AUCTION"
	BTC_DAWN    = "BTC-DAWN"
	BTC_FLOW    = "BTC-FLOW"
	BTC_STRK    = "BTC-STRK"
	KRW_STRK    = "KRW-STRK"
	BTC_PUNDIX  = "BTC-PUNDIX"
	KRW_PUNDIX  = "KRW-PUNDIX"
	KRW_FLOW    = "KRW-FLOW"
	KRW_DAWN    = "KRW-DAWN"
	KRW_AXS     = "KRW-AXS"
	KRW_STX     = "KRW-STX"
	BTC_GRT     = "BTC-GRT"
	BTC_SNX     = "BTC-SNX"
)
View Source
const API_ENDPOINT = "https://api.upbit.com/v1"
View Source
const WEBSOCKET_ENDPOINT = "wss://api.upbit.com/websocket/v1"

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError added in v0.2.0

type APIError struct {
	ErrorInfo struct {
		Message string      `json:"message"`
		Name    interface{} `json:"name"`
	} `json:"error"`
}

func (*APIError) Error added in v0.2.0

func (e *APIError) Error() string

type APIKey

type APIKey struct {
	AccessKey string `json:"access_key"`
	ExpireAt  string `json:"expire_at"`
}

type Account

type Account struct {
	Currency            string `json:"currency"`
	Balance             string `json:"balance"`
	Locked              string `json:"locked"`
	AvgBuyPrice         string `json:"avg_buy_price"`
	AvgBuyPriceModified bool   `json:"avg_buy_price_modified"`
	UnitCurrency        string `json:"unit_currency"`
}

type Candle

type Candle struct {
	Market               string  `json:"market"`
	CandleDateTimeUTC    string  `json:"candle_date_time_utc"`
	CandleDateTimeKST    string  `json:"candle_date_time_kst"`
	OpeningPrice         float64 `json:"opening_price"`
	HighPrice            float64 `json:"high_price"`
	LowPrice             float64 `json:"low_price"`
	TradePrice           float64 `json:"trade_price"`
	Timestamp            uint64  `json:"timestamp"`
	CandleAccTradePrice  float64 `json:"candle_acc_trade_price"`
	CandleAccTradeVolume float64 `json:"candle_acc_trade_volume"`
}

type CandleDay

type CandleDay struct {
	Candle
	PrevClosingPrice    float64 `json:"prev_closing_price"`
	ChangePrice         float64 `json:"change_price"`
	ChangeRate          float64 `json:"change_rate"`
	ConvertedTradePrice float64 `json:"converted_trade_price"`
}

type CandleMinute

type CandleMinute struct {
	Candle
	Unit uint `json:"unit"`
}

type CandleMonth

type CandleMonth struct {
	Candle
	FirstDayOfPeriod string `json:"first_day_of_period"`
}

type CandleWeek

type CandleWeek struct {
	Candle
	FirstDayOfPeriod string `json:"first_day_of_period"`
}

type Client

type Client struct {
	HttpClient *http.Client
	AccessKey  string
	SecretKey  string
}

func NewClient added in v0.2.0

func NewClient(accessKey, secretKey string) *Client

func (*Client) CallAPI added in v0.2.0

func (c *Client) CallAPI(method, path string, data Data, v interface{}, useToken bool) error

func (*Client) DepositKRW

func (c *Client) DepositKRW(amount string) (deposit Deposit, err error)

func (*Client) GenerateCoinAddress

func (c *Client) GenerateCoinAddress(currency string) (address CoinAddress, err error)

func (*Client) GetAPIKeys

func (c *Client) GetAPIKeys() (keys []APIKey, err error)

func (*Client) GetAccounts added in v0.2.0

func (c *Client) GetAccounts() (accounts []Account, err error)

func (*Client) GetCandleDays added in v0.2.0

func (c *Client) GetCandleDays(market, to string, count uint, convertingPriceUnit string) (candles []CandleDay, err error)

func (*Client) GetCandleMinutes added in v0.2.0

func (c *Client) GetCandleMinutes(unit uint, market string, to string, count uint) (candles []CandleMinute, err error)

func (*Client) GetCandleMonths added in v0.2.0

func (c *Client) GetCandleMonths(market, to string, count uint) (candles []CandleMonth, err error)

func (*Client) GetCandleWeeks added in v0.2.0

func (c *Client) GetCandleWeeks(market, to string, count uint) (candles []CandleWeek, err error)

func (*Client) GetCoinAddress

func (c *Client) GetCoinAddress(currency string) (address CoinAddress, err error)

func (*Client) GetCoinAddresses

func (c *Client) GetCoinAddresses() (addresses []CoinAddress, err error)

func (*Client) GetDeposit

func (c *Client) GetDeposit(uuid, txid, currency string) (deposit Deposit, err error)

func (*Client) GetDeposits

func (c *Client) GetDeposits(currency, state string, uuids, txids []string, limit, page uint, orderBy string) (deposits []Deposit, err error)

func (*Client) GetMarkets added in v0.2.0

func (c *Client) GetMarkets(isDetails bool) (markets []Market, err error)

func (*Client) GetOrder

func (c *Client) GetOrder(uuid, identifier string) (order Order, err error)

func (*Client) GetOrderbook

func (c *Client) GetOrderbook(markets []string) (orderbooks []Orderbook, err error)

func (*Client) GetOrders

func (c *Client) GetOrders(market, state string, states, uuids, identifiers []string, page, limit uint, orderBy string) (orders []Orders, err error)

func (*Client) GetOrdersChance added in v0.2.0

func (c *Client) GetOrdersChance(market string) (chance OrdersChance, err error)

func (*Client) GetStatus

func (c *Client) GetStatus() (status []Status, err error)

func (*Client) GetTickers added in v0.2.0

func (c *Client) GetTickers(markets []string) (tickers []Ticker, err error)

func (*Client) GetTrades added in v0.2.0

func (c *Client) GetTrades(market, to string, count uint, cursor string, daysAge uint) (trades []Trade, err error)

func (*Client) GetWithdraw

func (c *Client) GetWithdraw(uuid, txid, currency string) (withdraw Withdraw, err error)

func (*Client) GetWithdraws

func (c *Client) GetWithdraws(currency, state string, uuids, txids []string, limit, page uint, orderBy string) (withdraws []Withdraw, err error)

func (*Client) GetWithdrawsChance added in v0.2.0

func (c *Client) GetWithdrawsChance(currency string) (chance WithdrawsChance, err error)

func (*Client) Order added in v0.2.0

func (c *Client) Order(market, side, volume, price, ordType, identifier string) (order OrderRequest, err error)

func (*Client) OrderCancel added in v0.2.0

func (c *Client) OrderCancel(uuid, identifier string) (order Orders, err error)

func (*Client) Token

func (c *Client) Token(query string) (string, error)

func (*Client) WithdrawCoin

func (c *Client) WithdrawCoin(currency, amount, address, secondaryAddress, transactionType string) (withdraw WithdrawCoin, err error)

func (*Client) WithdrawKRW

func (c *Client) WithdrawKRW(amount string) (withdraw Withdraw, err error)

type CoinAddress

type CoinAddress struct {
	Currency         string `json:"currency"`
	DepositAddress   string `json:"deposit_address"`
	SecondaryAddress string `json:"secondary_address"`
}

type Data added in v0.2.0

type Data map[string]interface{}

type Deposit

type Deposit struct {
	Type            string `json:"type"`
	UUID            string `json:"uuid"`
	Currency        string `json:"currency"`
	Txid            string `json:"txid"`
	State           string `json:"state"`
	CreatedAt       string `json:"created_at"`
	DoneAt          string `json:"done_at"`
	Amount          string `json:"amount"`
	Fee             string `json:"fee"`
	TransactionType string `json:"transaction_type"`
}

type Market

type Market struct {
	Market        string `json:"market"`
	KoreanName    string `json:"korean_name"`
	EnglishName   string `json:"english_name"`
	MarketWarning string `json:"market_warning"`
}

type Order

type Order struct {
	Orders
	Trades struct {
		Market   string `json:"market"`
		UUID     string `json:"uuid"`
		Price    string `json:"price"`
		Volume   string `json:"volume"`
		Funds    string `json:"funds"`
		Side     string `json:"side"`
		CreateAt string `json:"create_at"`
	} `json:"trades"`
}

type OrderRequest added in v0.2.0

type OrderRequest struct {
	Orders
	AvgPrice string `json:"avg_price"`
}

type Orderbook

type Orderbook struct {
	Market         string  `json:"market"`
	Timestamp      uint64  `json:"timestamp"`
	TotalAskSize   float64 `json:"total_ask_size"`
	TotalBidSize   float64 `json:"total_bid_size"`
	OrderbookUnits []struct {
		AskPrice float64 `json:"ask_price"`
		BidPrice float64 `json:"bid_price"`
		AskSize  float64 `json:"ask_size"`
		BidSize  float64 `json:"bid_size"`
	} `json:"orderbook_units"`
}

type OrderbookWebSocket added in v0.2.0

type OrderbookWebSocket struct {
	Type           string  `json:"type"`
	Code           string  `json:"code"`
	TotalAskSize   float64 `json:"total_ask_size"`
	TotalBidSize   float64 `json:"total_bid_size"`
	OrderbookUnits []struct {
		AskPrice float64 `json:"ask_price"`
		BidPrice float64 `json:"bid_price"`
		AskSize  float64 `json:"ask_size"`
		BidSize  float64 `json:"bid_size"`
	} `json:"orderbook_units"`
	Timestamp  uint64 `json:"timestamp"`
	StreamType string `json:"stream_type"`
}

type Orders

type Orders struct {
	UUID            string `json:"uuid"`
	Side            string `json:"side"`
	OrdType         string `json:"ord_type"`
	Price           string `json:"price"`
	State           string `json:"state"`
	Market          string `json:"market"`
	CreatedAt       string `json:"created_at"`
	Volume          string `json:"volume"`
	RemainingVolume string `json:"remaining_volume"`
	ReservedFee     string `json:"reserved_fee"`
	RemainingFee    string `json:"remaining_fee"`
	PaidFee         string `json:"paid_fee"`
	Locked          string `json:"locked"`
	ExecutedVolume  string `json:"executed_volume"`
	TradeCount      uint   `json:"trade_count"`
}

type OrdersChance added in v0.2.0

type OrdersChance struct {
	BigFee string `json:"big_fee"`
	AskFee string `json:"ask_fee"`
	Market struct {
		ID         string   `json:"id"`
		Name       string   `json:"name"`
		OrderTypes []string `json:"order_types"`
		OrderSides []string `json:"order_sides"`
		Bid        struct {
			Currency  string `json:"currency"`
			PriceUnit string `json:"price_unit"`
			MinTotal  string `json:"min_total"`
		} `json:"bid"`
		Ask struct {
			Currency  string `json:"currency"`
			PriceUnit string `json:"price_unit"`
			MinTotal  string `json:"min_total"`
		} `json:"ask"`
		MaxTotal string `json:"max_total"`
		State    string `json:"state"`
	} `json:"market"`
	BidAccount struct {
		Currency            string `json:"currency"`
		Balance             string `json:"balance"`
		Locked              string `json:"locked"`
		AvgBuyPrice         string `json:"avg_buy_price"`
		AvgBuyPriceModified bool   `json:"avg_buy_price_modified"`
		UnitCurrency        string `json:"unit_currency"`
	} `json:"bid_account"`
	AskAccount struct {
		Currency            string `json:"currency"`
		Balance             string `json:"balance"`
		Locked              string `json:"locked"`
		AvgBuyPrice         string `json:"avg_buy_price"`
		AvgBuyPriceModified bool   `json:"avg_buy_price_modified"`
		UnitCurrency        string `json:"unit_currency"`
	} `json:"ask_account"`
}

type Status

type Status struct {
	Currency       string `json:"currency"`
	WalletStatus   string `json:"wallet_status"`
	BlockState     string `json:"block_state"`
	BlockHeight    uint   `json:"block_height"`
	BlockUpdatedAt string `json:"block_updated_at"`
}

type Ticker

type Ticker struct {
	Market             string  `json:"market"`
	TradeDate          string  `json:"trade_date"`
	TradeTime          string  `json:"trade_time"`
	TradeDateKST       string  `json:"trade_date_kst"`
	TradeTimeKST       string  `json:"trade_time_kst"`
	OpeningPrice       float64 `json:"opening_price"`
	HighPrice          float64 `json:"high_price"`
	LowPrice           float64 `json:"low_price"`
	TradePrice         float64 `json:"trade_price"`
	PrevClosingPrice   float64 `json:"prev_closing_price"`
	Change             string  `json:"change"`
	ChangePrice        float64 `json:"change_price"`
	ChangeRate         float64 `json:"change_rate"`
	SingedChangePrice  float64 `json:"singed_change_price"`
	SingedChangeRate   float64 `json:"singed_change_rate"`
	TradeVolume        float64 `json:"trade_volume"`
	AccTradePrice      float64 `json:"acc_trade_price"`
	AccTradePrice24H   float64 `json:"acc_trade_price_24h"`
	AccTradeVolume     float64 `json:"acc_trade_volume"`
	AccTradeVolume24H  float64 `json:"acc_trade_volume_24h"`
	Highest52WeekPrice float64 `json:"highest_52_week_price"`
	Highest52WeekDate  string  `json:"highest_52_week_date"`
	Lowest52WeekPrice  float64 `json:"lowest_52_week_price"`
	Lowest52WeekDate   string  `json:"lowest_52_week_date"`
	Timestamp          uint64  `json:"timestamp"`
}

type TickerWebSocket added in v0.2.0

type TickerWebSocket struct {
	Type               string  `json:"type"`
	Code               string  `json:"code"`
	OpeningPrice       float64 `json:"opening_price"`
	HighPrice          float64 `json:"high_price"`
	LowPrice           float64 `json:"low_price"`
	TradePrice         float64 `json:"trade_price"`
	PrevClosingPrice   float64 `json:"prev_closing_price"`
	Change             string  `json:"change"`
	ChangePrice        float64 `json:"change_price"`
	SingedChangePrice  float64 `json:"singed_change_price"`
	ChangeRate         float64 `json:"change_rate"`
	SingedChangeRate   float64 `json:"singed_change_rate"`
	TradeVolume        float64 `json:"trade_volume"`
	AccTradePrice      float64 `json:"acc_trade_price"`
	AccTradePrice24H   float64 `json:"acc_trade_price_24h"`
	AccTradeVolume     float64 `json:"acc_trade_volume"`
	AccTradeVolume24H  float64 `json:"acc_trade_volume_24h"`
	Highest52WeekPrice float64 `json:"highest_52_week_price"`
	Highest52WeekDate  string  `json:"highest_52_week_date"`
	Lowest52WeekPrice  float64 `json:"lowest_52_week_price"`
	Lowest52WeekDate   string  `json:"lowest_52_week_date"`
	TradeStatus        string  `json:"trade_status"`
	MarketState        string  `json:"market_status"`
	MarketStateForIos  string  `json:"market_state_for_ios"`
	IsTradingSuspended bool    `json:"is_trading_suspended"`
	DelistingDate      string  `json:"delisting_date"`
	MarketWarning      string  `json:"market_warning"`
	Timestamp          uint64  `json:"timestamp"`
	StreamType         string  `json:"stream_type"`
}

type Trade

type Trade struct {
	TradeDateUTC     string  `json:"trade_date_utc"`
	TradeTimeUTC     string  `json:"trade_time_utc"`
	Timestamp        uint64  `json:"timestamp"`
	TradePrice       float64 `json:"trade_price"`
	TradeVolume      float64 `json:"trade_volume"`
	PrevClosingPrice float64 `json:"prev_closing_price"`
	ChangePrice      float64 `json:"change_price"`
	AskBid           string  `json:"ask_bid"`
	SequentialID     uint64  `json:"sequential_id"`
}

type TradeWebSocket added in v0.2.0

type TradeWebSocket struct {
	Type             string  `json:"type"`
	Code             string  `json:"code"`
	TradePrice       float64 `json:"trade_price"`
	TradeVolume      float64 `json:"trade_volume"`
	AskBid           string  `json:"ask_bid"`
	PrevClosingPrice float64 `json:"prev_closing_price"`
	Change           string  `json:"change"`
	ChangePrice      float64 `json:"change_price"`
	TradeDate        string  `json:"trade_date"`
	TradeTime        string  `json:"trade_time"`
	TradeTimestamp   uint64  `json:"trade_timestamp"`
	Timestamp        uint64  `json:"timestamp"`
	SequentialID     uint64  `json:"sequential_id"`
	StreamType       string  `json:"stream_type"`
}

type TypeField

type TypeField struct {
	Type           string   `json:"type"`
	Codes          []string `json:"codes"`
	IsOnlySnapshot bool     `json:"isOnlySnapshot"`
	IsOnlyRealtime bool     `json:"isOnlyRealtime"`
}

type WebSocket added in v0.2.0

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

func NewWebSocket added in v0.2.0

func NewWebSocket() (*WebSocket, error)

func (*WebSocket) Close added in v0.2.0

func (w *WebSocket) Close() error

func (*WebSocket) Recv added in v0.2.0

func (w *WebSocket) Recv(channel chan interface{})

func (*WebSocket) SendField added in v0.2.0

func (w *WebSocket) SendField(typeFields []TypeField) error

func (*WebSocket) SendPing added in v0.2.0

func (w *WebSocket) SendPing() error

func (*WebSocket) SetCompression added in v0.2.0

func (w *WebSocket) SetCompression(b bool)

type Withdraw

type Withdraw struct {
	Type            string `json:"type"`
	UUID            string `json:"uuid"`
	Currency        string `json:"currency"`
	Txid            string `json:"txid"`
	State           string `json:"state"`
	CreatedAt       string `json:"created_at"`
	DoneAt          string `json:"done_at"`
	Amount          string `json:"amount"`
	Fee             string `json:"fee"`
	TransactionType string `json:"transaction_type"`
}

type WithdrawCoin

type WithdrawCoin struct {
	Withdraw
	KRWAmount string `json:"krw_amount"`
}

type WithdrawsChance added in v0.2.0

type WithdrawsChance struct {
	MemberLevel struct {
		SecurityLevel        uint `json:"security_level"`
		FeeLevel             uint `json:"fee_level"`
		EmailVerified        bool `json:"email_verified"`
		IdentityAuthVerified bool `json:"identity_auth_verified"`
		BankAccountVerified  bool `json:"bank_account_verified"`
		KakaoPayAuthVerified bool `json:"kakao_pay_auth_verified"`
		Locked               bool `json:"locked"`
		WalletLocked         bool `json:"wallet_locked"`
	} `json:"member_level"`
	Currency struct {
		Code          string   `json:"code"`
		WithdrawFee   string   `json:"withdraw_fee"`
		IsCoin        bool     `json:"is_coin"`
		WalletState   string   `json:"wallet_state"`
		WalletSupport []string `json:"wallet_support"`
	} `json:"currency"`
	Account struct {
		Currency            string `json:"currency"`
		Balance             string `json:"balance"`
		Locked              string `json:"locked"`
		AvgBuyPrice         string `json:"avg_buy_price"`
		AvgBuyPriceModified bool   `json:"avg_buy_price_modified"`
		UnitCurrency        string `json:"unit_currency"`
	} `json:"account"`
	WithdrawLimit struct {
		Currency          string `json:"currency"`
		Minimum           string `json:"minimum"`
		Onetime           string `json:"onetime"`
		Daily             string `json:"daily"`
		RemainingDaily    string `json:"remaining_daily"`
		RemainingDailyKRW string `json:"remaining_daily_krw"`
		Fixed             uint   `json:"fixed"`
		CanWithdraw       bool   `json:"can_withdraw"`
	} `json:"withdraw_limit"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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