@@ -27,8 +27,8 @@ def good_orderbook_level(level)
2727 level . length == 2
2828end
2929
30- module Checks # rubocop:disable Style/Documentation
31- def good_currency ( currency )
30+ module Check # rubocop:disable Style/Documentation
31+ def self . good_currency ( currency )
3232 good = good_params ( currency , %w[
3333 full_name payin_enabled payout_enabled transfer_enabled
3434 precision_transfer networks
@@ -39,51 +39,51 @@ def good_currency(currency)
3939 true
4040 end
4141
42- def good_network ( network )
42+ def self . good_network ( network )
4343 good_params ( network ,
4444 %w[
4545 network default payin_enabled payout_enabled precision_payout
4646 payout_fee payout_is_payment_id payin_payment_id payin_confirmations
4747 ] )
4848 end
4949
50- def good_symbol ( symbol )
50+ def self . good_symbol ( symbol )
5151 good_params ( symbol ,
5252 %w[
5353 type base_currency quote_currency status quantity_increment
5454 tick_size take_rate make_rate fee_currency
5555 ] )
5656 end
5757
58- def good_ticker ( ticker )
58+ def self . good_ticker ( ticker )
5959 good_params ( ticker , %w[ low high volume volume_quote timestamp ] )
6060 end
6161
62- def good_price ( price )
62+ def self . good_price ( price )
6363 good_params ( price , %w[ currency price timestamp ] )
6464 end
6565
66- def good_price_history ( price_history )
66+ def self . good_price_history ( price_history )
6767 good = good_params ( price_history , %w[ currency history ] )
6868 return false unless good
6969
7070 price_history [ 'history' ] . each { |point | return false unless good_history_point ( point ) }
7171 true
7272 end
7373
74- def good_history_point ( point )
74+ def self . good_history_point ( point )
7575 good_params ( point , %w[ open close min max timestamp ] )
7676 end
7777
78- def good_ticker_price ( price )
78+ def self . good_ticker_price ( price )
7979 good_params ( price , %w[ price timestamp ] )
8080 end
8181
82- def self . good_public_trade
83- -> ( trade ) { good_params ( trade , %w[ id price qty side timestamp ] ) }
82+ def self . good_public_trade ( trade )
83+ good_params ( trade , %w[ id price qty side timestamp ] )
8484 end
8585
86- def good_orderbook ( orderbook )
86+ def self . good_orderbook ( orderbook )
8787 good_orderbook = good_params ( orderbook , %w[ timestamp ask bid ] )
8888 return false unless good_orderbook
8989
@@ -92,21 +92,21 @@ def good_orderbook(orderbook)
9292 true
9393 end
9494
95- def good_candle ( candle )
95+ def self . good_candle ( candle )
9696 good_params ( candle , %w[ timestamp open close min max volume volume_quote ] )
9797 end
9898
99- def good_balance ( balance )
99+ def self . good_balance ( balance )
100100 good_params ( balance , %w[ currency available reserved ] )
101101 end
102102
103- def good_order ( order )
103+ def self . good_order ( order )
104104 good_params ( order ,
105105 %w[ id client_order_id symbol side status type time_in_force
106106 quantity price quantity_cumulative created_at updated_at ] )
107107 end
108108
109- def good_trade
109+ def self . good_trade
110110 lambda { |trade |
111111 good_params ( trade , %w[ id orderId clientOrderId symbol side quantity
112112 price fee timestamp ] )
@@ -121,21 +121,21 @@ def self.good_transaction(transaction)
121121 good = good_params ( transaction , %w[ id status type subtype created_at updated_at ] )
122122 return false unless good
123123
124- return false if transaction . key? ( 'native' ) && !Checks . good_native_transaction ( transaction [ 'native' ] )
124+ return false if transaction . key? ( 'native' ) && !Check . good_native_transaction ( transaction [ 'native' ] )
125125
126126 true
127127 end
128128
129- def good_address ( address )
129+ def self . good_address ( address )
130130 good_params ( address , %w[ currency address ] )
131131 end
132132
133- def good_trading_commission ( commission )
133+ def self . good_trading_commission ( commission )
134134 good_params ( commission , %w[ symbol make_rate take_rate ] )
135135 end
136136end
137137
138- module WSChecks # rubocop:disable Style/Documentation
138+ module WSCheck # rubocop:disable Style/Documentation
139139 def self . good_ws_public_trade
140140 -> ( trade ) { good_params ( trade , %w[ t i p q s ] ) }
141141 end
@@ -145,7 +145,7 @@ def self.good_ws_public_candle
145145 end
146146
147147 def self . good_ws_mini_ticker
148- WSChecks . good_ws_public_candle
148+ WSCheck . good_ws_public_candle
149149 end
150150
151151 def self . good_ticker
@@ -187,7 +187,7 @@ def self.good_commission
187187 end
188188
189189 def self . good_transaction
190- -> ( transaction ) { Checks . good_transaction ( transaction ) }
190+ -> ( transaction ) { Check . good_transaction ( transaction ) }
191191 end
192192
193193 def self . print
0 commit comments