Help us shape the future of Go! Take the 2026 Go Developer Survey

cexio

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

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

Go to latest
Published: Apr 12, 2018 License: MIT Imports: 10 Imported by: 0

README

go-cexio-api

Golang API for Cex.io Bitcoin Commodity Exchange.

Example

package main

import (
    "github.com/jhautefeuille/go-cexio-api"
    "fmt"
)

func main() {
    cexapi := cexio.CexKey{
        Username:"your_username", 
        Api_key:"your_api_key", 
        Api_secret:"your_api_secret"}

    // Public
    fmt.Printf("Ticker => %s\n", cexapi.Ticker("GHS/BTC"))
    //fmt.Printf("Order Book => %s\n", cexapi.OrderBook("GHS/BTC"))
    //fmt.Printf("Trade History => %s\n", cexapi.TradeHistory("GHS/BTC"))

    // Private
    fmt.Printf("Balance => %s\n", cexapi.Balance())
    fmt.Printf("Open Orders => %s\n", cexapi.OpenOrders("GHS/BTC"))

    // Trading orders
    //fmt.Printf("Place Order => %s\n", cexapi.PlaceOrder("buy", "0.001", "0.017", "GHS/BTC"))
    //fmt.Printf("Cancel Order => %s\n", cexapi.CancelOrder("477571539"))

    // Workers 
    fmt.Printf("Hashrate => %s\n", cexapi.Hashrate())
    fmt.Printf("Workers => %s\n", cexapi.Workers())
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CexKey

type CexKey struct {
	Username   string
	Api_key    string
	Api_secret string
}

func (*CexKey) ApiCall

func (cexapi *CexKey) ApiCall(method string, id string, param map[string]string, private bool, opt string) []byte

func (*CexKey) Balance

func (cexapi *CexKey) Balance() []byte

Private functions

func (*CexKey) CancelOrder

func (cexapi *CexKey) CancelOrder(id string) []byte

func (*CexKey) GetMethod

func (cexapi *CexKey) GetMethod(u string) []byte

func (*CexKey) Hashrate

func (cexapi *CexKey) Hashrate() []byte

Workers functions

func (*CexKey) Nonce

func (cexapi *CexKey) Nonce() string

func (*CexKey) OpenOrders

func (cexapi *CexKey) OpenOrders(opt string) []byte

func (*CexKey) OrderBook

func (cexapi *CexKey) OrderBook(opt string) []byte

func (*CexKey) PlaceLimitOrder

func (cexapi *CexKey) PlaceLimitOrder(ordertype string, amount string, price string, opt string) []byte

Orders functions

func (*CexKey) PlaceMarketOrder

func (cexapi *CexKey) PlaceMarketOrder(ordertype string, amount string, opt string) []byte

func (*CexKey) PostMethod

func (cexapi *CexKey) PostMethod(u string, v url.Values) []byte

func (*CexKey) Signature

func (cexapi *CexKey) Signature() (string, string)

func (*CexKey) Ticker

func (cexapi *CexKey) Ticker(opt string) []byte

Public functions

func (*CexKey) ToHmac256

func (cexapi *CexKey) ToHmac256(message string, secret string) string

func (*CexKey) TradeHistory

func (cexapi *CexKey) TradeHistory(opt string) []byte

func (*CexKey) Workers

func (cexapi *CexKey) Workers() []byte

Jump to

Keyboard shortcuts

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