From 7bbb306c1f9e4eae37881451c5da10f1d72cb189 Mon Sep 17 00:00:00 2001 From: Charles De Groote Date: Wed, 20 Apr 2022 22:50:14 +0200 Subject: [PATCH 1/2] Update client.rb --- lib/kraken_ruby_client/client.rb | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/lib/kraken_ruby_client/client.rb b/lib/kraken_ruby_client/client.rb index fa6bb16..1eb6e43 100755 --- a/lib/kraken_ruby_client/client.rb +++ b/lib/kraken_ruby_client/client.rb @@ -213,7 +213,7 @@ def spread(pair = nil, opts = {}) # def add_order(opts = {}) missing_args = add_order_required_args - opts.keys.map(&:to_s) - raise ArgumentError, add_order_err_msg(missing_args) if missing_args.any? + raise ArgumentError, order_err_msg(missing_args) if missing_args.any? post_private 'AddOrder', opts end @@ -221,8 +221,19 @@ def add_order(opts = {}) def add_order_required_args %w(pair type volume ordertype).freeze end + + def edit_order(opts = {}) + missing_args = edit_order_required_args - opts.keys.map(&:to_s) + raise ArgumentError, order_err_msg(missing_args) if missing_args.any? - def add_order_err_msg(missing_args) + post_private 'EditOrder', opts + end + + def edit_order_required_args + %w(txid pair).freeze + end + + def order_err_msg(missing_args) "the following required arguments are missing: #{missing_args.join(', ')}" end @@ -232,6 +243,10 @@ def cancel_order(txid) post_private 'CancelOrder', txid: txid end + def edit_order_err_msg(missing_args) + "the following required arguments are missing: #{missing_args.join(', ')}" + end + def balance post_private 'Balance' end From abe26f9c1000ea2758ecc8fad6aad667d65de443 Mon Sep 17 00:00:00 2001 From: Charles De Groote Date: Wed, 20 Apr 2022 23:00:47 +0200 Subject: [PATCH 2/2] Remove not used order_err_msg --- lib/kraken_ruby_client/client.rb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/kraken_ruby_client/client.rb b/lib/kraken_ruby_client/client.rb index 1eb6e43..afe7862 100755 --- a/lib/kraken_ruby_client/client.rb +++ b/lib/kraken_ruby_client/client.rb @@ -243,10 +243,6 @@ def cancel_order(txid) post_private 'CancelOrder', txid: txid end - def edit_order_err_msg(missing_args) - "the following required arguments are missing: #{missing_args.join(', ')}" - end - def balance post_private 'Balance' end