ccyutils

package module
v0.0.0-...-6d55769 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2020 License: MIT Imports: 2 Imported by: 0

README

About

いろんな仮想通貨取引所のAPIを叩きます。 現在対応しているのは、

  • bitFlyer
  • bitbank.cc
  • Binance

CLI

ccyutilsを利用したCLIツールも開発中 https://github.com/kecbigmt/ccycli

Getting Started

go get github.com/kecbigmt/ccyutils

Example

Tickerを取得する

  1. ccyutils/{取引所の名前}でパッケージ読み込み
  2. Ticker({通貨ペア})関数で取得
package main

import (
  "fmt"
  bf "github.com/kecbigmt/ccyutils/bitflyer"
  )

func main(){
  ticker, _ := bf.Ticker("BTC_JPY")
  fmt.Println(ticker)
}

Documentation

Overview

common

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Round

func Round(f float64, places int) float64

for calculate

Types

type AvailablePairs

type AvailablePairs []string

AvailablePairs

func (AvailablePairs) Have

func (ms AvailablePairs) Have(currency_pair string, service string) bool

type Balance

type Balance struct {
	ServiceName  string
	CurrencyCode string
	Amount       float64
	Available    float64
}

Balance

type BalanceArray

type BalanceArray []Balance

func (BalanceArray) DropZero

func (barr1 BalanceArray) DropZero() (barr2 BalanceArray)

func (BalanceArray) Extract

func (barr BalanceArray) Extract(currency_code string) (b Balance)

type OrderInfo

type OrderInfo struct {
	OrderId      string
	CurrencyPair string
	Side         string
	Type         string
	Status       string
	TotalSize    float64
	ExecutedSize float64
	Price        float64
	AveragePrice float64
}

Order info

type Tick

type Tick struct {
	ServiceName           string
	CurrencyPair          string
	UnixTimestamp         int64
	TickId                int
	BestBid               float64
	BestAsk               float64
	BestBidSize           float64
	BestAskSize           float64
	TotalBidDepth         float64
	TotalAskDepth         float64
	LastPrice             float64
	HighPrice             float64
	LowPrice              float64
	PriceChangePercent1h  float64
	PriceChangePercent24h float64
	PriceChangePercent7d  float64
	Volume                float64
	Spread                float64
}

Ticker

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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