Giter Club home page Giter Club logo

bitcokeapi's Introduction

Bitcoke交易所api

bitcoke交易所对开放api的限制频率,目前这一套api利用web端进行行情接收,同时也可以通过web端进行部分功能的下单。


目录结构

PublicPkg模块不需要额外的用户信息,PrivatePkg模块需要额外的用户信息。

BitcokeApi

├── PrivatePkg

│ ├── BitcokeTrade.go

│ ├── HandleFunc.go

│ ├── InterfaceFunc.go

│ └── SignelStruct.go

├── PublicPkg

│ ├── BitcokePrice.go

│ ├── HandleFunc.go

│ ├── InterfaceFunc.go

│ └── SignalStuct.go


行情接收模块支持接口
// 行情订阅
// BcWsP.OrderSymbol("BTC")
func (a *BcWsP) OrderSymbol(symbol string) error

// 行情更新时间
// BcWsP.GetUpdateTime("BTC")
func (a *BcWsP) GetUpdateTime(symbol string) (*time.Time, error) 

// 行情orderbook获取
// BcWsP.GetPriceMap("BTC")
func (a *BcWsP) GetPriceMap(symbol string) (map[string]float64, error)
行情接收模块example
package main

import (
	"BitcokeApi/PublicPkg"
	"fmt"
	"sync"
	"time"
)

func main() {

	obj, _ := PublicPkg.NewPublic(nil)
	w := &sync.WaitGroup{}
	w.Add(1)
	go obj.Start(w)
	w.Wait()
	err := obj.OrderSymbol("BTC")
	if err != nil {
		panic(err)
	}

	fmt.Println("订阅成功")

	go func() {
		for {
			time.Sleep(time.Second)
			fmt.Println(obj.GetUpdateTime("BTC"))
			fmt.Println(obj.GetPriceMap("BTC"))
		}
	}()

	select {}

}

bitcokeapi's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.