From 15d34adc60ff7b141082690de5cfa8ad73cd46b6 Mon Sep 17 00:00:00 2001 From: Megumi Nakamura Date: Sat, 16 Dec 2017 22:49:11 +0900 Subject: [PATCH] Add currency_pairs api --- lib/zaif.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/zaif.rb b/lib/zaif.rb index 8bbe5ed..4f8bdef 100644 --- a/lib/zaif.rb +++ b/lib/zaif.rb @@ -62,6 +62,18 @@ def get_depth(currency_code, counter_currency_code = "jpy") return json end + # Get currency pairs of *currency_code* / *counter_currency_code*. + # @param [String] currency_code Base currency code + # @param [String] counter_currency_code Counter currency code + def get_currency_pairs(currency_code, counter_currency_code = "jpy") + currency_pair = currency_code + unless currency_code=='all' + currency_pair += "_" + counter_currency_code + end + json = get_ssl(@zaif_public_url + "currency_pairs/" + currency_pair) + return json + end + # # Trade API #