upbit

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2019 License: MIT Imports: 10 Imported by: 1

README

go-upbit

License Go Report Card GoDoc

Upbit API Client written in Golang

Install

go get -u github.com/hexoul/go-upbit

Getting started

  • As library, start from upbit.GetInstanceWithKey('YOUR_ACCESS_KEY', 'YOUR_SECRET_KEY')
  • As program, start from upbit.GetInstance() after executing go run -upbit:accesskey=[YOUR_ACCESS_KEY] -upbit:secretkey=[YOUR_SECRET_KEY]
package main

import (
    "fmt"

    upbit "github.com/hexoul/go-upbit"
)

func init() {
    upbit.GetInstanceWithKey("YOUR_ACCESS_KEY", "YOUR_SECRET_KEY")
}

func main() {
    if ret, err := upbit.GetInstance().Accounts(); err == nil {
        for _, v := range ret {
            fmt.Println(v.Currency, v.Balance, v.Locked)
        }
    }
}

Features

Type Method Endpoint Done
Asset GET /v1/accounts
Order GET /v1/orders/chance -
Order GET /v1/orders
Order GET /v1/order -
Order POST /v1/order -
Order DELETE /v1/order -

Reference

Upbit API

Documentation

Overview

Package upbit is an API Client for Upbit

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client for CoinMarketCap API

func GetInstance

func GetInstance() *Client

GetInstance returns singleton

func GetInstanceWithKey

func GetInstanceWithKey(accessKey, secretKey string) *Client

GetInstanceWithKey returns singleton

func (*Client) Accounts

func (s *Client) Accounts() (balances []*types.Balance, err error)

Accounts returns asset list

src: https://api.upbit.com/v1/accounts
doc: https://docs.upbit.com/reference#%EC%9E%90%EC%82%B0-%EC%A0%84%EC%B2%B4-%EC%A1%B0%ED%9A%8C

func (*Client) GetOrders

func (s *Client) GetOrders(options *types.Options) (orders []*types.Order, err error)

GetOrders returns order list

arg: market, state, page, order_by
src: https://api.upbit.com/v1/orders
doc: https://docs.upbit.com/reference#%EC%A3%BC%EB%AC%B8-%EB%A6%AC%EC%8A%A4%ED%8A%B8-%EC%A1%B0%ED%9A%8C

type Interface

type Interface interface {
	Accounts() ([]*types.Balance, error)

	GetOrders() ([]*types.Order, error)
}

Interface for APIs

Directories

Path Synopsis
Package types of both request and response for API
Package types of both request and response for API
Package util supports specific parsing
Package util supports specific parsing

Jump to

Keyboard shortcuts

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