From 546922b612fadfff4df0c9bca99b6f2a20503629 Mon Sep 17 00:00:00 2001 From: Guillem Date: Thu, 28 Nov 2024 02:57:04 +0100 Subject: [PATCH 1/2] add withdraw endpoints --- lib/kraken_ruby_client/client.rb | 57 ++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/lib/kraken_ruby_client/client.rb b/lib/kraken_ruby_client/client.rb index fa6bb16..ad0354a 100755 --- a/lib/kraken_ruby_client/client.rb +++ b/lib/kraken_ruby_client/client.rb @@ -489,6 +489,63 @@ def deposit_status(opts = {}) post_private 'DepositStatus', opts end + # Get withdrawal methods (POST) + # Input: + # aclass = asset class (optional): + # currency (default) + # asset = asset being withdrawn (optional) + # network = withdrawal network name (optional) + # + # Result: + # { + # "error": [], + # "result": [ + # { + # "asset": "XXBT", + # "method": "Bitcoin", + # "network": "Bitcoin", + # "minimum": "0.0004" + # }, + # { + # "asset": "XXBT", + # "method": "Bitcoin Lightning", + # "network": "Lightning", + # "minimum": "0.00001" + # } + # ] + # } + # + # Examples: + # + # client.withdrawal_methods(asset: :xxbt) + # + def withdrawal_methods(opts = {}) + post_private 'WithdrawMethods', opts + end + + # Get withdrawal addresses (POST) + # Input: + # aclass = asset class (optional): + # currency (default) + # asset = asset being withdrawn + # method = name of the withdrawal method + # key = Find address for by withdrawal key name, as set up on your account + # verified = Filter by verification status of the withdrawal address. + # Withdrawal addresses successfully completing email confirmation will have a verification status of true. + # + # Result: associative array of withdrawal addresses: + # address = withdrawal address + # expiretm = expiration time in unix timestamp, or 0 if not expiring + # new = whether or not address has ever been used + # + # Examples: + # + # client.withdrawal_addresses(asset: 'xxbt', method: 'Bitcoin', new: true) + # + def withdrawal_addresses(opts = {}) + post_private 'WithdrawAddresses', opts + end + # Withdraw info (POST) # # Example: From b9127591dca64ae677add72122bbc384fce1ac86 Mon Sep 17 00:00:00 2001 From: Guillem Date: Thu, 28 Nov 2024 03:01:06 +0100 Subject: [PATCH 2/2] Update client.rb --- lib/kraken_ruby_client/client.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/kraken_ruby_client/client.rb b/lib/kraken_ruby_client/client.rb index ad0354a..cdf9fc4 100755 --- a/lib/kraken_ruby_client/client.rb +++ b/lib/kraken_ruby_client/client.rb @@ -519,7 +519,7 @@ def deposit_status(opts = {}) # # client.withdrawal_methods(asset: :xxbt) # - def withdrawal_methods(opts = {}) + def withdraw_methods(opts = {}) post_private 'WithdrawMethods', opts end @@ -542,7 +542,7 @@ def withdrawal_methods(opts = {}) # # client.withdrawal_addresses(asset: 'xxbt', method: 'Bitcoin', new: true) # - def withdrawal_addresses(opts = {}) + def withdraw_addresses(opts = {}) post_private 'WithdrawAddresses', opts end