Skip to content

Traadh/bittrex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 

Repository files navigation

A Pharo/Smalltalk interface to the Bittrex API.

The Bittrex API interface is implemented as a Command Pattern, a class per entrypoint.

Installation

  1. From the command line check your credentials are working.
    https://help.github.com/articles/testing-your-ssh-connection/

  2. In Pharo 6.1 or later, clone the repo with Iceberg... (if you are on Windows, enable "Use Custom Keys" setting)
    Remote URL: [email protected]:Traadh/bittrex.git
    Local directory: (default)
    Code subdirectory: src

Iceberg clone repository dialog

  1. From the Packages tab, load the Bittrex package...

    Iceberg load package

  2. Install dependencies

    A Baseline has not yet been defined, so evaluate...

   BittrexAPI installNeoJSON; installWebsockets

5. Install libsodium

On Ubuntu 16.04...

$ sudo apt-get install libsodium18

On Windows...
download https://download.libsodium.org/libsodium/releases/libsodium-1.0.16-mingw.tar.gz
then copy the two files from libsodium-win32\bin into the Pharo directory (although you could leave them anywhere and just reference them in the win32modulename [note: you need to \ the windows slashes inside a string]). The other file needed is libgcc_s_dw2-1.dll.

  1. Confirm all BittrexLibsodiumTest(s) work.

Okay, done! You should be right to go.

Usage - public apis

Try the BittrexPublicAPIs first since they work out of the box without any configuration at Bittrex.com, e.g...

   BittrexGetMarkets new getAll inspect

a BittrexMarket

Usage - private apis

To try the BittrexPrivateAPIs, at the Bittrex.com > Settings > API Keys, create a new paired ApiKey and ApiSecret.
e.g. ApiKey 3af36a54c1ac33ac35910a80fb5a2074
e.g. ApiSecret 5234ca802140d0f8a8485bdd2fe81598

Create a file (e.g. secret.txt) with lines having the first six digits of ApiKey bracketed and appended with ApiSecret.
e.g. (3af36a)5234ca802140d0f8a8485bdd2fe81598

Configure these keys in Pharo by evaluating...

   apiKey := '3af36a54c1ac33ac35910a80fb5a2074'. 
   BittrexAPI configureApiKey: apiKey secretFromFile: 'secret.txt'.

The aim of this approach is to avoid leaking the secret through a saved Image.
The secret is stored only in volatile memory which is nilled when the Image/VM quit.
The address of this volatile memory is passed directly to the FFI signing function without the secret touching the Image heap.

Check your system is correctly configured by evaluating...

   BittrexAPI configureCheckKeys

P.S. I'm new to Iceberg so advice welcome on improving the git workflow.

About

Interface to Bittrex Exchange API for Pharo.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •