@@ -39,36 +39,24 @@ def delete(endpoint, params = nil)
3939 @http_manager . make_request ( method : 'delete' , endpoint : endpoint , params : params )
4040 end
4141
42- ###########
43- # aliases #
44- ###########
42+ # Changes the user credentials used for authentication in calls
43+ #
44+ # ==== Params
45+ # +String+ +api_key+:: The user public key used in new calls
46+ # +String+ +api_secret+:: The user secret key used in new calls
4547
46- # market data
48+ def change_credentials ( api_key :, api_secret :)
49+ @http_manager . change_credentials ( api_key : api_key , api_secret : api_secret )
50+ end
4751
48- # alias of get ticker
49- alias get_ticker_by_symbol get_ticker
50- alias get_ticker_of_symbol get_ticker
51- alias get_ticker_price_by_symbol get_ticker_price
52- alias get_ticker_price_of_symbol get_ticker_price
53- alias get_trades_of_symbol get_trades_by_symbol
54- alias get_orderbook_by_symbol get_orderbook
55- alias get_orderbook_of_symbol get_orderbook
56- alias get_orderbook_volume_by_symbol get_orderbook_volume
57- alias get_orderbook_volume_of_symbol get_orderbook_volume
58- alias get_candles_of_symbol get_candles_by_symbol
59- alias get_converted_candles_of_symbol get_converted_candles_by_symbol
60- # spot trading
61- alias get_spot_trading_balance_of_currency get_spot_trading_balance
62- alias get_spot_trading_balance_by_currency get_spot_trading_balance
63- alias get_all_trading_commissions get_all_trading_commission
64- alias get_trading_commission get_all_trading_commission
65- alias get_trading_commission_of_symbol get_trading_commission
66- alias get_trading_commission_by_symbol get_trading_commission
67- # wallet management
68- alias get_wallet_balance_of_currency get_wallet_balance
69- alias get_wallet_balance_by_currency get_wallet_balance
70- alias get_deposit_crypto_address_of_cyrrency get_deposit_crypto_address
71- alias get_deposit_crypto_address_by_cyrrency get_deposit_crypto_address
52+ # Changes the window used in authenticated calls
53+ #
54+ # ==== Params
55+ # +Integer+ +window+:: Acceptable time between request and server execution in millis
56+
57+ def change_window ( window :)
58+ @http_manager . change_window ( window : window )
59+ end
7260
7361 ################
7462 # public calls #
@@ -863,11 +851,25 @@ def withdraw_crypto_rollback(id:)
863851 # ==== Params
864852 # +Array[]+ +fee_requests+:: the list of fee requests, each request is a Hash in the form {currency:"string", amount:"string", network_code:"optional string"}
865853
866- def get_estimate_withdrawal_fees ( fee_requests )
854+ def get_estimate_withdrawal_fees ( fee_requests : )
867855 params = fee_requests
868856 post ( 'wallet/crypto/fees/estimate' , params )
869857 end
870858
859+ # Get an estimates for withdrawal fees of currencies
860+ #
861+ # Requires the "Payment information" API key Access Right
862+ #
863+ # https://api.exchange.cryptomkt.com/#bulk-estimate-withdrawal-fee
864+ #
865+ # ==== Params
866+ # +Array[]+ +fee_requests+:: the list of fee requests, each request is a Hash in the form {currency:"string", amount:"string", network_code:"optional string"}
867+
868+ def get_bulk_estimate_withdrawal_fees ( fee_requests :)
869+ params = fee_requests
870+ post ( 'wallet/crypto/fee/estimate/bulk' , params )
871+ end
872+
871873 # Get an estimate of the withdrawal fee
872874 #
873875 # Requires the "Payment information" API key Access Right
@@ -883,6 +885,34 @@ def get_estimate_withdrawal_fee(currency:, amount:, network_code: nil)
883885 get ( 'wallet/crypto/fee/estimate' , params ) [ 'fee' ]
884886 end
885887
888+ # # Get an estimates for deposit fees of currencies
889+ # #
890+ # # Requires the "Payment information" API key Access Right
891+ # #
892+ # # https://api.exchange.cryptomkt.com/#bulk-estimate-deposit-fee
893+ # #
894+ # # ==== Params
895+ # # +Array[]+ +fee_requests+:: the list of fee requests, each request is a Hash in the form {currency:"string", amount:"string", network_code:"optional string"}
896+ # def get_bulk_estimate_deposit_fees(fee_requests:)
897+ # params = fee_requests
898+ # post('wallet/crypto/fee/deposit/estimate/bulk', params)
899+ # end
900+
901+ # # Get an estimate of the deposit fee
902+ # #
903+ # # Requires the "Payment information" API key Access Right
904+ # #
905+ # # https://api.exchange.cryptomkt.com/#estimate-deposit-fee
906+ # #
907+ # # ==== Params
908+ # # +String+ +currency+:: the currency code for deposit
909+ # # +float+ +amount+:: the expected deposit amount
910+
911+ # def get_estimate_deposit_fee(currency:, amount:, network_code: nil)
912+ # params = { amount: amount, currency: currency, network_code: network_code }
913+ # get('wallet/crypto/fee/deposit/estimate', params)['fee']
914+ # end
915+
886916 # Converts between currencies
887917 # Successful response to the request does not necessarily mean the resulting transaction got executed immediately. It has to be processed first and may eventually be rolled back
888918 # To see whether a transaction has been finalized, call #get_transaction
@@ -986,9 +1016,9 @@ def transfer_money_to_another_user(currency:, amount:, by:, identifier:)
9861016 # +Array[String]+ +statuses+:: Optional. List of statuses to query. valid subtypes are: 'CREATED', 'PENDING', 'FAILED', 'SUCCESS' and 'ROLLED_BACK'
9871017 # +Array[String]+ +currencies+:: Optional. Currency codes of the transactions to fetch
9881018 # +Array[String]+ +networks+:: Optional. Network codes of the transactions to fetch
989- # +String+ +order_by+:: Optional. sorting parameter.'created_at' or 'id'. Default is 'created_at'
990- # +String+ +from+:: Optional. Interval initial value when ordering by 'created_at'. As Datetime
991- # +String+ +till+:: Optional. Interval end value when ordering by 'created_at'. As Datetime
1019+ # +String+ +order_by+:: Optional. sorting parameter.'created_at', 'updated_at', 'last_activity_at' 'or 'id'.
1020+ # +String+ +from+:: Optional. Optional. Interval initial value (inclusive). The value type depends on order_by
1021+ # +String+ +till+:: Optional. Interval end value (inclusive). The value type depends on order_BY
9921022 # +String+ +id_from+:: Optional. Interval initial value when ordering by id. Min is 0
9931023 # +String+ +id_till+:: Optional. Interval end value when ordering by id. Min is 0
9941024 # +String+ +sort+:: Optional. Sort direction. 'ASC' or 'DESC'. Default is 'DESC'
@@ -1238,5 +1268,38 @@ def get_sub_account_crypto_address(
12381268 "sub-account/crypto/address/#{ sub_account_id } /#{ currency } "
12391269 ) [ 'result' ] [ 'address' ]
12401270 end
1271+
1272+ ###########
1273+ # aliases #
1274+ ###########
1275+
1276+ # market data
1277+ alias get_ticker_by_symbol get_ticker
1278+ alias get_ticker_of_symbol get_ticker
1279+ alias get_ticker_price_by_symbol get_ticker_price
1280+ alias get_ticker_price_of_symbol get_ticker_price
1281+ alias get_trades_of_symbol get_trades_by_symbol
1282+ alias get_orderbook_by_symbol get_orderbook
1283+ alias get_orderbook_of_symbol get_orderbook
1284+ alias get_orderbook_volume_by_symbol get_orderbook_volume
1285+ alias get_orderbook_volume_of_symbol get_orderbook_volume
1286+ alias get_candles_of_symbol get_candles_by_symbol
1287+ alias get_converted_candles_of_symbol get_converted_candles_by_symbol
1288+
1289+ # spot trading
1290+ alias get_spot_trading_balance_of_currency get_spot_trading_balance
1291+ alias get_spot_trading_balance_by_currency get_spot_trading_balance
1292+ alias get_all_trading_commissions get_all_trading_commission
1293+ alias get_trading_commissions get_all_trading_commission
1294+ alias get_trading_commission_of_symbol get_trading_commission
1295+ alias get_trading_commission_by_symbol get_trading_commission
1296+
1297+ # wallet management
1298+ alias get_wallet_balance_of_currency get_wallet_balance
1299+ alias get_wallet_balance_by_currency get_wallet_balance
1300+ alias get_deposit_crypto_address_of_cyrrency get_deposit_crypto_address
1301+ alias get_deposit_crypto_address_by_cyrrency get_deposit_crypto_address
12411302 end
12421303end
1304+
1305+ # rubocop:enable Layout/LineLength
0 commit comments