bbwrapper

package module
v0.0.0-...-4e7b89c Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2021 License: MIT Imports: 2 Imported by: 0

README

bbwrapper

bybit Currency Exchange Wrapper for Go.

Usage

import (
	"fmt"
	"time"

	"github.com/TTRSQ/bbwrapper"
)

func main() {
	bfClient, _ := bbwrapper.New(bbwrapper.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 New

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

ByBit .. no SpecificParam.

Types

type ExchangeKey

type ExchangeKey = exchange.Key

ExchangeKey ..

Directories

Path Synopsis
domains
interface
src

Jump to

Keyboard shortcuts

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