gillesguillemin / GDAXSwift

The unofficial Swift wrapper around the GDAX API https://docs.gdax.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GDAXSwift

Version License Platform

Features

  • Lightweight, minimal codebase
  • Sandbox support
  • Automatic request signing when calling any of the private endpoints
  • All networking and JSON parsing handled internally
  • Request/response object models
  • Easy to handle, callback based response handling

While this library does the majority of the heavy lifting for you it is still recommended to read over the official GDAX documentation.

Requirements

  • iOS 8.0+ / macOS 10.10+ / tvOS 9.0+ / watchOS 2.0+
  • Xcode 8.1+
  • Swift 3.0+

Installation

GDAXSwift is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "GDAXSwift"

Usage

Create an instance of GDAXClient using any of the available initializers. You may then use the public and private instance properties to access the public and private endpoints, respectivly.

Note that an error will be thrown if you attempt to access any of the private endpoints without supplying an API key, base64 encoded secret and passphrase.

let gdaxClient = GDAXClient(apiKey: "API key", secret64: "base64 encoded secret", passphrase: "passphrase", isSandbox: false)

// Multiple convenience initializers exist
// For example, if only querying public data on the live exchange, a new client may be constructed as GDAXClient()

// public (no authentication required)
gdaxClient.public.getProducts({ (products, response, error) in
	print("Response: \(products as Any)")
	print("Error: \(error as Any)")
})

// private (authentication required)
gdaxClient.private.getAccounts({ (accounts, response, error) in
	print("Response: \(accounts as Any)")
	print("Error: \(error as Any)")
})

TODO

  • Finish implementing all private endpoints
  • Support for the Websocket Feed
  • Documentation

Changelog

See the CHANGELOG file.

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Author

Anthony Puppo, anthonypuppo123@gmail.com

License

GDAXSwift is available under the MIT license. See the LICENSE file for more info.

Donations

  • Bitcoin: 1HTrooe1AsQUPkPrrCC39BZbX8K6qnUJFV
  • Ethereum: 0x7117A29cb2F425405D0DF1961fc4d7BF3e526b6b

About

The unofficial Swift wrapper around the GDAX API https://docs.gdax.com

License:MIT License


Languages

Language:Swift 93.0%Language:Shell 6.0%Language:Objective-C 0.6%Language:Ruby 0.3%