goincheck

package module
v0.0.0-...-a0aaf25 Latest Latest
Warning

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

Go to latest
Published: May 9, 2020 License: MIT Imports: 11 Imported by: 1

README

goincheck

goincheck is coincheck API library for Go Lang.

Installation

go get github.com/Rayleigh865/goincheck

Sample Code

package main

import (
	"fmt"
	"github.com/Rayleigh865/goincheck"
)

func main() {
	client := new(goincheck.Goincheck).NewClient("ACCESS_KEY", "API_SECRET")
	/** Public API */
	client.Ticker.All()
	client.Trade.All()
	client.OrderBook.All()

	/** Private API */
	// New order(If trading pair value is not "btc_jpy" or "fct_jpy", return error.)
	body, _ := client.Order.Create(`{"rate":"28500","amount":"0.00508771", "order_type":"buy", "pair":"btc_jpy"}`)
	fmt.Println(body)

	// List of pending orders
	client.Order.Opens()

	// Order Cancellation
	client.Order.Cancel("12345")

	//Transaction History
	client.Order.Transactions()

	// Position List
	client.Leverage.Positions()

	// Balance
	client.Account.Balance()

	// Balance of the leveraged count
	client.Account.LeverageBalance()

	// account information
	client.Account.Info()

	// Transfer Bitcoin
	client.Send.Create(`{"address":"1Gp9MCp7FWqNgaUWdiUiRPjGqNVdqug2hY","amount":"0.0002"`)

	// Bitcoin Transfer History
	client.Send.All("currency=BTC")

	// Bitcoin receipt history
	client.Deposit.All("currency=BTC")

	// Bitcoin Fast Deposit
	client.Deposit.Fast("12345")

	// List of bank accounts
	client.BankAccount.All()

	// Register your bank account
	client.BankAccount.Create(`{"bank_name":"MUFG","branch_name":"tokyo", "bank_account_type":"toza", "number":"1234567", "name":"Danny"}`)

	// Deleting a bank account
	client.BankAccount.Delete("25621")

	// Withdrawal history
	client.Withdraw.All()

	// Preparing a withdrawal request
	client.Withdraw.Create(`{"bank_account_id":"2222","amount":"50000", "currency":"JPY", "is_fast":"false"}`)

	// Cancellation of withdrawal request
	client.Withdraw.Cancel("12345")

	// Application for a loan
	client.Borrow.Create(`{"amount":"100","currency":"JPY"}`)

	// Current Loan List
	client.Borrow.Matches()

	// Repayment
	client.Borrow.Repay("1135")

	// Transfer to Leverage Count
	client.Transfer.ToLeverage(`{"amount":"100","currency":"JPY"}`)

	// Transfer from a leveraged account
	client.Transfer.FromLeverage(`{"amount":"100","currency":"JPY"}`)
}

License

  • MIT

ToDO

  • Test(気が向いたら)

Documentation

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 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 Goincheck

type Goincheck 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 (Goincheck) NewClient

func (g Goincheck) NewClient(accessKey string, secretKey string) Goincheck

func (Goincheck) Request

func (g Goincheck) Request(method string, path string, param string) string

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, error)

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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