From 58607c08d6f2e0f6ca673dd840eba651730743f3 Mon Sep 17 00:00:00 2001 From: Barnabas Debreczeni Date: Mon, 18 Jul 2016 18:53:01 +0200 Subject: [PATCH 1/3] add DepositMethods API call --- lib/kraken_ruby/client.rb | 5 +++++ spec/client_spec.rb | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/lib/kraken_ruby/client.rb b/lib/kraken_ruby/client.rb index 4f2f37c..acb3fed 100644 --- a/lib/kraken_ruby/client.rb +++ b/lib/kraken_ruby/client.rb @@ -110,6 +110,11 @@ def trade_volume(asset_pairs) post_private 'TradeVolume', opts end + def deposit_methods(asset, opts={}) + opts['asset'] = asset + post_private 'DepositMethods', opts + end + #### Private User Trading #### def add_order(opts={}) diff --git a/spec/client_spec.rb b/spec/client_spec.rb index a189beb..87ce192 100644 --- a/spec/client_spec.rb +++ b/spec/client_spec.rb @@ -62,6 +62,13 @@ nonce = kraken.send :nonce expect(nonce.to_i.size).to eq(8) end + + it "gets deposit methods" do + result = kraken.deposit_methods("XXBT").first + expect(result).to have_key 'method' + expect(result).to have_key 'limit' + expect(result).to have_key 'fee' + end end end From 335b27418105cb97f68252de77e2fba5f330cc50 Mon Sep 17 00:00:00 2001 From: Barnabas Debreczeni Date: Mon, 18 Jul 2016 19:34:25 +0200 Subject: [PATCH 2/3] add DepositStatus API call --- lib/kraken_ruby/client.rb | 4 ++++ spec/client_spec.rb | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/lib/kraken_ruby/client.rb b/lib/kraken_ruby/client.rb index acb3fed..4814904 100644 --- a/lib/kraken_ruby/client.rb +++ b/lib/kraken_ruby/client.rb @@ -115,6 +115,10 @@ def deposit_methods(asset, opts={}) post_private 'DepositMethods', opts end + def deposit_status(opts={}) + post_private 'DepositStatus', opts + end + #### Private User Trading #### def add_order(opts={}) diff --git a/spec/client_spec.rb b/spec/client_spec.rb index 87ce192..64ba63d 100644 --- a/spec/client_spec.rb +++ b/spec/client_spec.rb @@ -69,6 +69,22 @@ expect(result).to have_key 'limit' expect(result).to have_key 'fee' end + + it "gets deposit status" do + results = kraken.deposit_status(asset: "XXBT") + expect(results).to be_instance_of(Array) + if result = results.first + expect(result).to have_key 'method' + expect(result).to have_key 'aclass' + expect(result).to have_key 'refid' + expect(result).to have_key 'txid' + expect(result).to have_key 'info' + expect(result).to have_key 'amount' + expect(result).to have_key 'fee' + expect(result).to have_key 'status' + expect(result).to have_key 'time' + end + end end end From 8269aae5b5467260f4022c8629a811a00996bc16 Mon Sep 17 00:00:00 2001 From: Barnabas Debreczeni Date: Mon, 18 Jul 2016 20:00:36 +0200 Subject: [PATCH 3/3] add WithdrawStatus API call --- lib/kraken_ruby/client.rb | 4 ++++ spec/client_spec.rb | 18 +++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/lib/kraken_ruby/client.rb b/lib/kraken_ruby/client.rb index 4814904..02b7c71 100644 --- a/lib/kraken_ruby/client.rb +++ b/lib/kraken_ruby/client.rb @@ -119,6 +119,10 @@ def deposit_status(opts={}) post_private 'DepositStatus', opts end + def withdraw_status(opts={}) + post_private 'WithdrawStatus', opts + end + #### Private User Trading #### def add_order(opts={}) diff --git a/spec/client_spec.rb b/spec/client_spec.rb index 64ba63d..f21586c 100644 --- a/spec/client_spec.rb +++ b/spec/client_spec.rb @@ -85,6 +85,22 @@ expect(result).to have_key 'time' end end - end + it "gets withdraw status" do + results = kraken.withdraw_status(asset: "XXBT") + pp results + expect(results).to be_instance_of(Array) + if result = results.first + expect(result).to have_key 'method' + expect(result).to have_key 'aclass' + expect(result).to have_key 'refid' + expect(result).to have_key 'txid' + expect(result).to have_key 'info' + expect(result).to have_key 'amount' + expect(result).to have_key 'fee' + expect(result).to have_key 'status' + expect(result).to have_key 'time' + end + end + end end