Skip to content

Commit

Permalink
MAIN, README: Improve optional params documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jonatack committed Aug 30, 2019
1 parent 670d20a commit 9ebfb7d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ CFFI.

## Getting started

To use, git clone the repo into your `~/quicklisp/local-projects` directory, then:
To use, git clone the repo into your `~/quicklisp/local-projects` directory,
then:

```lisp
(ql:quickload :cl-kraken)
Expand All @@ -46,11 +47,11 @@ To use, git clone the repo into your `~/quicklisp/local-projects` directory, the

All API calls accept the following optional boolean keyword parameters:

- RAW (T or default NIL) for the JSON response be returned as a raw string
rather than parsed and converted to a list data structure
- RAW (T or default NIL) to return the JSON response as a raw string instead of
parsed and converted to a list data structure.

- VERBOSE (T or default NIL) to output the HTTP request headers for verifying
and debugging
and debugging.

### Public market data API calls

Expand Down
18 changes: 12 additions & 6 deletions src/main.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,17 @@
(declaim (optimize (speed 0) (safety 3) (debug 3)))

;;; API

;;; All API calls accept a VERBOSE boolean keyword parameter (T or default NIL)
;;; to output the HTTP request headers for verifying and debugging.

;;;
;;; All API calls accept the following optional boolean keyword parameters:
;;;
;;; - RAW (T or default NIL) to return the JSON response as a raw string
;;; instead of parsed to a list data structure.
;;;
;;; - VERBOSE (T or default NIL) to output the HTTP request headers for
;;; verifying and debugging.
;;;
;;; Kraken Public API

;;;
(defun asset-pairs (&key pair raw verbose)
"Get tradeable asset pairs.
URL: https://api.kraken.com/0/public/AssetPairs
Expand Down Expand Up @@ -201,8 +206,9 @@
(when (integerp since) (push `("since" . ,since) (cdr params)))
(request "Trades" :params params :raw raw :verbose verbose)))

;;;
;;; Kraken Private API requiring authentication

;;;
(defun balance (&key raw verbose)
(declare (type boolean raw verbose))
(request "Balance" :post t :raw raw :verbose verbose))
Expand Down

0 comments on commit 9ebfb7d

Please sign in to comment.