The examples below are compliant with Walutomat API v2 Documentation
-
Install the required gems with:
bundle install
-
Follow the instruction in Walutomat API v2 Documentation to generate keys.
-
To generate an RSA key pair execute the following commands:
$ openssl genrsa -out ./private.key 4096 $ openssl rsa -in ./private.key -pubout -out ./public.key
-
Once the RSA Key pair is generated, the API KEY can be obtained in your Walutomat account. Make sure to use the public.key.
-
-
Put your API key (the one from Walutomat not one of the public/private pair) in
api_key
file in this directory -
Put your private RSA key in
private.key
file in this directory -
Run any of the files with
ruby <filename>
e.g.ruby GET-account-balances.rb
- You can pipe the output directly to JSON processor e.g.
jq
- example commandruby GET-account-balances.rb | jq
- Responses look exactly like the one specified in the documentation. Example:
{ "success": true, "result": [ { "currency": "PLN", "balanceTotal": "9734.44", "balanceAvailable": "4293.30", "balanceReserved": "5441.14" }, { "currency": "CHF", "balanceTotal": "211.15", "balanceAvailable": "211.15", "balanceReserved": "0.00" }, { "currency": "EUR", "balanceTotal": "9863.41", "balanceAvailable": "9863.41", "balanceReserved": "0.00" } ] }
- You can pipe the output directly to JSON processor e.g.