Skip to content

Latest commit

 

History

History
69 lines (52 loc) · 1.55 KB

README.md

File metadata and controls

69 lines (52 loc) · 1.55 KB

Coinbase Golang API Library

Build Status GoDoc Codecov

The library was tested against coinbase.com APIv2

Installation

go get github.com/Zauberstuhl/go-coinbase

# or use gopkg for specific versions
go get gopkg.in/Zauberstuhl/go-coinbase.v1.0.0

Supported API Calls

  • Wallet Endpoints
  • Users
  • Accounts
  • Addresses
  • Transactions
  • Buys
  • Sells
  • Deposits
  • Withdrawals
  • Payment methods
  • Data Endpoints
  • Currencies
  • Exchange rates
  • Prices
  • Time

Example

import "github.com/Zauberstuhl/go-coinbase"

c := coinbase.APIClient{
  Key: "123",
  Secret: "123456",
}

acc, err := c.Accounts()
if err != nil {
  fmt.Println(err)
  return
}

for _, acc := range acc.Data {
  fmt.Printf("ID: %s\nName: %s\nType: %s\nAmount: %f\nCurrency: %s\n",
    acc.Id, acc.Name, acc.Type,
    acc.Balance.Amount, acc.Balance.Currency)
}

# sample output
ID: 1234-12-1234-1232
Name: Test Wallet
Type: BTC
Amount: 0.0
Currency: EUR
[...]

Unit Tests

Run all available unit tests via:

go test

Most of the tests require a internet connection!