Files
gocryptotrader/docs/EXCHANGE_API.md
Adrian Gallagher 63191ce3ec Engine QA (#381)
* 1) Update Dockerfile/docker-compose.yml
2) Remove inline strings for buy/sell/test pairs
3) Remove dangerous order submission values
4) Fix consistency with audit_events (all other spec files use
CamelCase)
5) Update web websocket endpoint
6) Fix main param set (and induce dryrun mode on specific command line
params)

* Engine QA

Link up exchange syncer to cmd params, disarm market selling bombs and fix OKEX endpoints

* Fix linter issue after merge

* Engine QA changes

Template updates
Wrapper code cleanup
Disarmed order bombs
Documentation updates

* Daily engine QA

Bitstamp improvements
Spelling mistakes
Add Coinbene exchange to support list
Protect API authenticated calls for Coinbene/LBank

* Engine QA changes

Fix exchange_wrapper_coverage tool
Add SupportsAsset to exchange interface
Fix inline string usage and add BCH withdrawal support

* Engine QA

Fix Bitstamp types
Inform user of errors when parsing time accross the codebase
Change time parsing warnings to errors (as they are)
Update markdown docs [with linter fixes]

* Engine QA changes

1) Add test for dryrunParamInteraction
2) Disarm OKCoin/OKEX bombs if someone accidently sets canManipulateRealOrders to true and runs all package tests
3) Actually check exchange setup errors for BTSE and Coinbene, plus address this in the wrapper template
4) Hardcode missing/non-retrievable contributors and bump the contributors
5) Convert numbers/strings to meaningful types in Bitstamp and OKEX
6) If WS is supported for the exchange wrapper template, preset authWebsocketSupport var

* Fix the shadow people

* Link the SyncContinuously paramerino

* Also show SyncContinuously in engine.PrintSettings

* Address nitterinos and use correct filepath for logs

* Bitstamp: Extract ALL THE APM

* Fix additional nitterinos

* Fix time parsing error for Bittrex
2019-11-22 16:07:30 +11:00

3.3 KiB

GoCryptoTrader Unified API

Build Status Software License GoDoc Coverage Status Go Report Card

A cryptocurrency trading bot supporting multiple exchanges written in Golang.

Please note that this bot is under development and is not ready for production!

Community

Join our slack to discuss all things related to GoCryptoTrader! GoCryptoTrader Slack

Unified API

GoCryptoTrader supports a unified API for dealing with exchanges. Each exchange has its own wrapper file which maps the exchanges own RESTful endpoints into a standardised way for bot and standalone application usage.

A full breakdown of all the supported wrapper funcs can be found here. Please note that these change on a regular basis as GoCryptoTrader is undergoing rapid development.

Each exchange supports public API endpoints which don't require any authentication (fetching ticker, orderbook, trade data) and also private API endpoints (which require authentication). Some examples include submitting, cancelling and fetching open orders). To use the authenticated API endpoints, you'll need to set your API credentials in either the config.json file or when you initialise an exchange in your application, and also have the appropriate key permissions set for the exchange. Each exchange has a credentials validator which ensures that the API credentials supplied meet the requirements to make an authenticated request.

Public API Ticker Example

    var b bitstamp.Bitstamp
    b.SetDefaults()
    ticker, err := b.FetchTicker(currency.NewPair(currency.BTC, currency.USD), asset.Spot)
    if err != nil {
        // Handle error
    }
    fmt.Println(ticker.Last)

Private API Submit Order Example

    var b bitstamp.Bitstamp
    b.SetDefaults()

    b.API.Credentials.Key = "your_key"
    b.API.Credentials.Secret = "your_secret"
    b.API.Credentials.ClientID = "your_clientid"

    o := &order.Submit{
        Pair:      currency.NewPair(currency.BTC, currency.USD),
        OrderSide: order.Sell,
        OrderType: order.Limit,
        Price:     1000000,
        Amount:    0.1,
    }
    resp, err := b.SubmitOrder(o)
    if err != nil {
        // Handle error
    }
    fmt.Println(resp.OrderID)