ccew

package module
v1.0.24 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2021 License: MIT Imports: 9 Imported by: 0

README

ccew

Crypto Currency Exchange Wrapper for Go.

Supporting exchanges

  • bitbank
  • bitflyer
  • bybit
  • coincheck
  • ftx
  • gmo
  • liquid
  • dummy
    • for back test

Usage

import (
	"fmt"
	"time"

	"github.com/TTRSQ/ccew"
)

func main() {
	bfClient, _ := ccew.Bitflyer(ccew.ExchangeKey{
		APIKey:    "your_api_key",
		APISecKey: "your_api_sec_key",
	})

	// create order
	orderID, _ := bfClient.CreateOrder(
		950000, 0.01, true,
		bfClient.Symbols().FxBtcJpy,
		bfClient.OrderTypes().Limit,
	)
	fmt.Printf("%+v\n", orderID)

	// wait for server processing.
	time.Sleep(time.Second * 2)

	// get my order
	orders, _ := bfClient.ActiveOrders(bfClient.Symbols().FxBtcJpy)
	fmt.Printf("%+v\n", orders)

	// cancel order
	_ = bfClient.CancelOrder(
		bfClient.Symbols().FxBtcJpy,
		orderID.LocalID,
	)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BitBank added in v0.7.12

func BitBank(key exchange.Key) (exchange.Exchange, error)

BitBank .. SpecificParam additional_keys : [][]string{ [id, sec],[id, sec].. }

func Bitflyer added in v0.1.0

func Bitflyer(key exchange.Key) (exchange.Exchange, error)

Bitflyer .. no SpecificParam.

func ByBit added in v0.2.1

func ByBit(key exchange.Key) (exchange.Exchange, error)

ByBit .. no SpecificParam.

func CoinCheck added in v0.7.4

func CoinCheck(key exchange.Key) (exchange.Exchange, error)

CoinCheck .. SpecificParam additional_keys : [][]string{ [id, sec],[id, sec].. }

func Dummy added in v0.2.8

func Dummy(key exchange.Key) (exchange.Exchange, error)

Dummy .. no SpecificParam.

func Ftx added in v0.1.0

func Ftx(key exchange.Key) (exchange.Exchange, error)

Ftx .. SpecificParam FTX-SUBACCOUNT : string

func Gmo added in v0.6.0

func Gmo(key exchange.Key) (exchange.Exchange, error)

Gmo .. SpecificParam proxyURL : *url.URL

func Liquid added in v0.2.5

func Liquid(key exchange.Key) (exchange.Exchange, error)

Liquid .. SpecificParam additional_keys : [][]string{ [id, sec],[id, sec].. }

Types

type ExchangeKey

type ExchangeKey = exchange.Key

ExchangeKey ..

Directories

Path Synopsis
domains
interface
src
ftx
gmo

Jump to

Keyboard shortcuts

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