bitfinex-api-go

module
v0.0.0-...-2ffb769 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2020 License: MIT

README

Bitfinex Trading API for Golang. Bitcoin, Ether and Litecoin trading

  • Official implementation
  • REST API
  • WebSockets API

Installation

go get github.com/FTIVLTD/bitfinex-api-go

Usage

Basic requests
package main

import (
	"fmt"
	"github.com/FTIVLTD/bitfinex-api-go/v1"
)

func main() {
	client := bitfinex.NewClient().Auth("api-key", "api-secret")
	info, err := client.Account.Info()

	if err != nil {
		fmt.Println(err)
	} else {
		fmt.Println(info)
	}
}
Authentication
func main() {
	client := bitfinex.NewClient().Auth("api-key", "api-secret")
}
Order create
order, err := client.Orders.Create(bitfinex.BTCUSD, -0.01, 260.99, bitfinex.OrderTypeExchangeLimit)

if err != nil {
    return err
} else {
    return order
}

See examples and doc.go for more examples.

Testing

All integration tests are stored in tests/integration directory. Because these tests are running using live data, there is a much higher probability of false positives in test failures due to network issues, test data having been changed, etc.

Run tests using:

export BFX_API_KEY="api-key"
export BFX_API_SECRET="api-secret"
go test -v ./tests/integration

Contributing

  1. Fork it (https://github.com/FTIVLTD/bitfinex-api-go/fork)
  2. Create your feature branch (`git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Directories

Path Synopsis
examples
tests
Package bitfinex is the official client to access to bitfinex.com API
Package bitfinex is the official client to access to bitfinex.com API
v2

Jump to

Keyboard shortcuts

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