An extensive client implementation of the Bitstamp API using Go.
Please check the examples_test.go file for some basic usage examples.
go get github.com/georlav/bitstamp@latest
- 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
- 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.
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.
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
Distributed under the MIT License. See LICENSE
for more information.
George Lavdanis - georlav@gmail.com
Project Link: https://github.com/georlav/bitstamp