GithubHelp home page GithubHelp logo

georlav / bitstamp Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 86 KB

An extensive client implementation of the Bitstamp API using Go

License: MIT License

Go 100.00%
bitstamp cryptocurrency-exchanges api-client websocket-client go golang golang-package

bitstamp's Introduction

godoc Tests Golang-CI

Bitstamp

An extensive client implementation of the Bitstamp API using Go.

Examples

Please check the examples_test.go file for some basic usage examples.

Install

go get github.com/georlav/bitstamp@latest

API Support

HTTP API

  • Public data functions
    • Ticker
    • Hourly ticker
    • Order book
    • Transactions
    • Trading pairs info
    • OHLC data
    • EUR/USD conversion rate
  • Private functions
    • Account balance
    • User transactions
    • Crypto transactions
    • Orders
      • Open orders
      • Order status
      • Cancel order
      • Cancel all orders
      • Buy limit order
      • Buy market order
      • Buy instant order
      • Sell limit order
      • Sell market order
      • Sell instant order
    • Withdrawal requests
    • Crypto withdrawals
    • Crypto deposits
    • Transfer balance from Sub to Main Account
    • Transfer balance from Main to Sub Account
    • Open bank withdrawal
    • Bank withdrawal status
    • Cancel bank withdrawal
    • New liquidation address
    • Liquidation address info
    • WebSockets token

Websocket API v2

  • Public channels
    • Live ticker
    • Live orders
    • Live order book
    • Live detail order book
    • Live full order book
  • Private Channels
    • Live ticker
    • Live orders

New pairs are constantly added so if you notice that a pair is missing you can run the following command and open pr

go generate ./...

This fetches all supported pairs from bitstamp and generates new pair and channel enums.

Private functions and configuration

To be able to use private functions you need to generate an API key and a secret using your bitstamp account. To do that you need to visit.

Profile settings -> API access -> New API key

You can pass those to the client using the following functional options

c := bitstamp.NewHTTPAPI(
	bitstamp.APIKeyOption("yourkey"),
	bitstamp.APISecretOption("yoursecret"),
)

Or you can set them as environmental variables and client will automatically read them

export BITSTAMP_KEY="yourkey"
export BITSTAMP_SECRET="yoursecret"

IMPORTANT: Environmental variables override functional options.

Running tests

To run the integration tests for public functions use

go test ./... -v -race -short

To run all integration tests and cover also private functions you need to set your secret and key at your env and run test without -short

go test ./... -v -race

License

Distributed under the MIT License. See LICENSE for more information.

Contact

George Lavdanis - [email protected]

Project Link: https://github.com/georlav/bitstamp

bitstamp's People

Contributors

georlav avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

mikemaggire

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.