coincheck

package module
v0.0.0-...-7690f21 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2017 License: MIT Imports: 8 Imported by: 0

README

coincheck-go

Install

  • go get github.com/Akagi201/coincheckgo

API

import (
    "github.com/Akagi201/coincheckgo"
)

client := new(coincheck.CoinCheck).NewClient("ACCESS_KEY", "API_SECRET")

/** Public API */
client.Ticker.All()
client.Trade.All()
client.OrderBook.All()

/** Private API */
// 新規注文
// "buy" 指値注文 現物取引 買い
// "sell" 指値注文 現物取引 売り
// "market_buy" 成行注文 現物取引 買い
// "market_sell" 成行注文 現物取引 売り
// "leverage_buy" 指値注文 レバレッジ取引新規 買い
// "leverage_sell" 指値注文 レバレッジ取引新規 売り
// "close_long" 指値注文 レバレッジ取引決済 売り
// "close_short" 指値注文 レバレッジ取引決済 買い
client.Order.Create(`{"rate":"28500","amount":"0.00508771", "order_type":"buy", "pair":"btc_jpy"}`)

// 未決済の注文一覧
client.Order.Opens()

// 注文のキャンセル
client.Order.Cancel("12345")

// 取引履歴
client.Order.Transactions()

// ポジション一覧
client.Leverage.Positions()

// 残高
client.Account.Balance()

// レバレッジアカウントの残高
client.Account.LeverageBalance()

// アカウント情報
client.Account.Info()

// ビットコインの送金
client.Send.Create(`{"address":"1Gp9MCp7FWqNgaUWdiUiRPjGqNVdqug2hY","amount":"0.0002"`)

// ビットコインの送金履歴
client.Send.All("currency=BTC")

// ビットコインの受け取り履歴
client.Deposit.All("currency=BTC")

// ビットコインの高速入金
client.Deposit.Fast("12345")

// 銀行口座一覧
client.BankAccount.All()

// 銀行口座の登録
client.BankAccount.Create(`{"bank_name":"MUFG","branch_name":"tokyo", "bank_account_type":"toza", "number":"1234567", "name":"Danny"}`)

// 銀行口座の削除
client.BankAccount.Delete("25621")

// 出金履歴
client.Withdraw.All()

// 出金申請の作成
client.Withdraw.Create(`{"bank_account_id":"2222","amount":"50000", "currency":"JPY", "is_fast":"false"}`)

// 出金申請のキャンセル
client.Withdraw.Cancel("12345")

// 借入申請
client.Borrow.Create(`{"amount":"100","currency":"JPY"}`)

// 借入中一覧
client.Borrow.Matches()

// 返済
client.Borrow.Repay("1135")

// レバレッジアカウントへの振替
client.Transfer.ToLeverage(`{"amount":"100","currency":"JPY"}`)

// レバレッジアカウントからの振替
client.Transfer.FromLeverage(`{"amount":"100","currency":"JPY"}`)

Documentation

Overview

Package coincheck coincheck rest api

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeHmac256

func ComputeHmac256(message string, secret string) string

create signature

func CreateNonce

func CreateNonce() int64

create nonce by milliseconds

Types

type Account

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

func (Account) Balance

func (a Account) Balance() string

Make sure a balance.

func (Account) Info

func (a Account) Info() string

Get account information.

func (Account) LeverageBalance

func (a Account) LeverageBalance() string

Make sure a leverage balance.

type BankAccount

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

func (BankAccount) All

func (a BankAccount) All() string

Get account information.

func (BankAccount) Create

func (a BankAccount) Create(param string) string

Create a new BankAccount.

func (BankAccount) Delete

func (a BankAccount) Delete(id string) string

Delete a BankAccount.

type Borrow

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

func (Borrow) Create

func (a Borrow) Create(param string) string

Create a new Borrow.

func (Borrow) Matches

func (a Borrow) Matches() string

Get a borrowing list.

func (Borrow) Repay

func (a Borrow) Repay(id string) string

Based on this id, you can repay.

type CoinCheck

type CoinCheck struct {
	AccessKey   string
	SecretKey   string
	Account     Account
	BankAccount BankAccount
	Borrow      Borrow
	Deposit     Deposit
	Leverage    Leverage
	Order       Order
	OrderBook   OrderBook
	Send        Send
	Ticker      Ticker
	Trade       Trade
	Transfer    Transfer
	Withdraw    Withdraw
}

func (CoinCheck) NewClient

func (c CoinCheck) NewClient(accessKey string, secretKey string) CoinCheck

func (CoinCheck) Request

func (c CoinCheck) Request(method string, path string, param string) string

type Deposit

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

func (Deposit) All

func (a Deposit) All(param string) string

You Get Deposit history

func (Deposit) Fast

func (a Deposit) Fast(id string) string

Deposit Bitcoin Faster

type Leverage

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

func (Leverage) Positions

func (a Leverage) Positions() string

Get a leverage positions list.

type Order

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

func (Order) Cancel

func (a Order) Cancel(id string) string

cancel a created order specified by order id. Optional argument amount is to refund partially.

func (Order) Create

func (a Order) Create(param string) string

Create a order object with given parameters.In live mode, this issues a transaction.

func (Order) Opens

func (a Order) Opens() string

List charges filtered by params

func (Order) Transactions

func (a Order) Transactions() string

Get Order Transactions

type OrderBook

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

func (OrderBook) All

func (a OrderBook) All() string

板情報を取得できます。

type Send

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

func (Send) All

func (a Send) All(param string) string

You Get Send history

func (Send) Create

func (a Send) Create(param string) string

Sending Bitcoin to specified Bitcoin addres.

type Ticker

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

func (Ticker) All

func (a Ticker) All() string

各種最新情報を簡易に取得することができます。

type Trade

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

func (Trade) All

func (a Trade) All() string

最新の取引履歴を取得できます。

type Transfer

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

func (Transfer) FromLeverage

func (a Transfer) FromLeverage(param string) string

Transfer Balance from Leverage.

func (Transfer) ToLeverage

func (a Transfer) ToLeverage(param string) string

Transfer Balance to Leverage.

type Withdraw

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

func (Withdraw) All

func (a Withdraw) All() string

Transfer Balance from Leverage.

func (Withdraw) Cancel

func (a Withdraw) Cancel(id string) string

Transfer Balance from Leverage.

func (Withdraw) Create

func (a Withdraw) Create(param string) string

Transfer Balance to Leverage.

Jump to

Keyboard shortcuts

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