diff --git a/lib/cryptomarket/websocket/trading_client.rb b/lib/cryptomarket/websocket/trading_client.rb index 7bd0168..7d4280e 100644 --- a/lib/cryptomarket/websocket/trading_client.rb +++ b/lib/cryptomarket/websocket/trading_client.rb @@ -35,11 +35,6 @@ def build_subscription_hash 'spot_balance' => [balances, Args::NotificationType::SNAPSHOT] } end - alias get_spot_trading_balance_of_currency get_spot_trading_balance - alias get_spot_trading_balance_by_currency get_spot_trading_balance - alias get_spot_commission_of_symbol get_spot_commission - alias get_spot_commission_by_symbol get_spot_commission - # subscribe to a feed of execution reports of the user's orders # # https://api.exchange.cryptomkt.com/#socket-spot-trading @@ -274,6 +269,11 @@ def get_spot_commissions(callback:) def get_spot_commission(symbol:, callback:) request('spot_fee', callback, { symbol: symbol }) end + + alias get_spot_trading_balance_of_currency get_spot_trading_balance + alias get_spot_trading_balance_by_currency get_spot_trading_balance + alias get_spot_commission_of_symbol get_spot_commission + alias get_spot_commission_by_symbol get_spot_commission end end end diff --git a/lib/cryptomarket/websocket/wallet_client.rb b/lib/cryptomarket/websocket/wallet_client.rb index a42e9c1..0129c2e 100644 --- a/lib/cryptomarket/websocket/wallet_client.rb +++ b/lib/cryptomarket/websocket/wallet_client.rb @@ -37,9 +37,6 @@ def build_subscription_hash 'wallet_balance_update' => [balance, Args::NotificationType::UPDATE] } end - alias get_wallet_balance_of_currency get_wallet_balance - alias get_wallet_balance_by_currency get_wallet_balance - # A transaction notification occurs each time a transaction has been changed, such as creating a transaction, updating the pending state (e.g., the hash assigned) or completing a transaction # # https://api.exchange.cryptomkt.com/#subscribe-to-transactions @@ -168,6 +165,9 @@ def get_transactions( # rubocop:disable Metrics/ParameterLists limit: limit, offset: offset, group_transactions: group_transactions }) end + + alias get_wallet_balance_of_currency get_wallet_balance + alias get_wallet_balance_by_currency get_wallet_balance end end end diff --git a/tests/rest/wallet_management.rb b/tests/rest/wallet_management.rb index 93b4e9d..1432ecc 100644 --- a/tests/rest/wallet_management.rb +++ b/tests/rest/wallet_management.rb @@ -103,6 +103,17 @@ def test_get_transaction_history )) end + def test_get_transaction_history_with_params + result = @client.get_transaction_history( + order_by: 'CREATED_AT', sort: 'DESC', limit: 100, offset: 1, from: '1614815872000' + ) + assert(!result.empty?) + assert(good_list( + ->(transaction) do Check.good_transaction(transaction) end, + result + )) + end + def test_get_transaction transaction_list = @client.get_transaction_history first_transaction_id = transaction_list[0]['native']['tx_id'] diff --git a/tests/websocket/wallet_client.rb b/tests/websocket/wallet_client.rb index c1cbf44..c9aec28 100644 --- a/tests/websocket/wallet_client.rb +++ b/tests/websocket/wallet_client.rb @@ -6,6 +6,7 @@ require_relative '../checks' require_relative '../checker_generator' +# test class for wallet client class TestWSWalletClient < Test::Unit::TestCase def setup @wsclient = Cryptomarket::Websocket::WalletClient.new api_key: KeyLoader.api_key, api_secret: KeyLoader.api_secret @@ -43,4 +44,13 @@ def test_get_transactions sleep(2) assert(@veredict_checker.good_veredict?, @veredict_checker.err_msg) end + + def test_get_transactions_with_params + @wsclient.get_transactions( + callback: gen_check_result_list_callback(WSCheck.good_transaction, @veredict_checker), + order_by: 'CREATED_AT', sort: 'DESC', limit: 100, offset: 1, from: '1614815872000' + ) + sleep(2) + assert(@veredict_checker.good_veredict?, @veredict_checker.err_msg) + end end