binance-connector-ruby 1.5.2 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/CHANGELOG.md +128 -0
 - data/lib/binance/session.rb +2 -1
 - data/lib/binance/spot/c2c.rb +2 -2
 - data/lib/binance/spot/convert.rb +134 -2
 - data/lib/binance/spot/fiat.rb +3 -3
 - data/lib/binance/spot/loan.rb +221 -7
 - data/lib/binance/spot/margin.rb +104 -231
 - data/lib/binance/spot/market.rb +73 -14
 - data/lib/binance/spot/mining.rb +13 -13
 - data/lib/binance/spot/simple_earn.rb +44 -24
 - data/lib/binance/spot/stream.rb +1 -1
 - data/lib/binance/spot/subaccount.rb +205 -52
 - data/lib/binance/spot/trade.rb +94 -30
 - data/lib/binance/spot/wallet.rb +140 -22
 - data/lib/binance/spot/websocket.rb +23 -11
 - data/lib/binance/spot.rb +1 -5
 - data/lib/binance/version.rb +1 -1
 - metadata +2 -4
 - data/lib/binance/spot/blvt.rb +0 -104
 - data/lib/binance/spot/futures.rb +0 -357
 
| 
         @@ -3,7 +3,7 @@ 
     | 
|
| 
       3 
3 
     | 
    
         
             
            module Binance
         
     | 
| 
       4 
4 
     | 
    
         
             
              class Spot
         
     | 
| 
       5 
5 
     | 
    
         
             
                # all sub-account endpoints
         
     | 
| 
       6 
     | 
    
         
            -
                # @see https://binance 
     | 
| 
      
 6 
     | 
    
         
            +
                # @see https://developers.binance.com/docs/sub_account/Introduction
         
     | 
| 
       7 
7 
     | 
    
         
             
                module Subaccount
         
     | 
| 
       8 
8 
     | 
    
         
             
                  # Create a Virtual Sub-account(For Master Account)
         
     | 
| 
       9 
9 
     | 
    
         
             
                  #
         
     | 
| 
         @@ -15,7 +15,7 @@ module Binance 
     | 
|
| 
       15 
15 
     | 
    
         
             
                  # @param subAccountString [String]
         
     | 
| 
       16 
16 
     | 
    
         
             
                  # @param kwargs [Hash]
         
     | 
| 
       17 
17 
     | 
    
         
             
                  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
         
     | 
| 
       18 
     | 
    
         
            -
                  # @see https://binance 
     | 
| 
      
 18 
     | 
    
         
            +
                  # @see https://developers.binance.com/docs/sub_account/account-management/Create-a-Virtual-Sub-account
         
     | 
| 
       19 
19 
     | 
    
         
             
                  def create_virtual_sub_account(subAccountString:, **kwargs)
         
     | 
| 
       20 
20 
     | 
    
         
             
                    Binance::Utils::Validation.require_param('subAccountString', subAccountString)
         
     | 
| 
       21 
21 
     | 
    
         | 
| 
         @@ -34,7 +34,7 @@ module Binance 
     | 
|
| 
       34 
34 
     | 
    
         
             
                  # @option kwargs [Integer] :page
         
     | 
| 
       35 
35 
     | 
    
         
             
                  # @option kwargs [Integer] :limit
         
     | 
| 
       36 
36 
     | 
    
         
             
                  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
         
     | 
| 
       37 
     | 
    
         
            -
                  # @see https://binance 
     | 
| 
      
 37 
     | 
    
         
            +
                  # @see https://developers.binance.com/docs/sub_account/account-management/Query-Sub-account-List
         
     | 
| 
       38 
38 
     | 
    
         
             
                  def get_sub_account_list(**kwargs)
         
     | 
| 
       39 
39 
     | 
    
         
             
                    @session.sign_request(:get, '/sapi/v1/sub-account/list', params: kwargs)
         
     | 
| 
       40 
40 
     | 
    
         
             
                  end
         
     | 
| 
         @@ -54,7 +54,7 @@ module Binance 
     | 
|
| 
       54 
54 
     | 
    
         
             
                  # @option kwargs [Integer] :page Default value: 1
         
     | 
| 
       55 
55 
     | 
    
         
             
                  # @option kwargs [Integer] :limit Default value: 500
         
     | 
| 
       56 
56 
     | 
    
         
             
                  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
         
     | 
| 
       57 
     | 
    
         
            -
                  # @see https://binance 
     | 
| 
      
 57 
     | 
    
         
            +
                  # @see https://developers.binance.com/docs/sub_account/asset-management/Query-Sub-account-Spot-Asset-Transfer-History
         
     | 
| 
       58 
58 
     | 
    
         
             
                  def get_sub_account_spot_transfer_history(**kwargs)
         
     | 
| 
       59 
59 
     | 
    
         
             
                    @session.sign_request(:get, '/sapi/v1/sub-account/sub/transfer/history', params: kwargs)
         
     | 
| 
       60 
60 
     | 
    
         
             
                  end
         
     | 
| 
         @@ -71,7 +71,7 @@ module Binance 
     | 
|
| 
       71 
71 
     | 
    
         
             
                  # @option kwargs [Integer] :page Default value: 1
         
     | 
| 
       72 
72 
     | 
    
         
             
                  # @option kwargs [Integer] :limit Default value: 50, Max value: 500
         
     | 
| 
       73 
73 
     | 
    
         
             
                  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
         
     | 
| 
       74 
     | 
    
         
            -
                  # @see https://binance 
     | 
| 
      
 74 
     | 
    
         
            +
                  # @see https://developers.binance.com/docs/sub_account/asset-management/Query-Sub-account-Futures-Asset-Transfer-History
         
     | 
| 
       75 
75 
     | 
    
         
             
                  def get_sub_account_futures_transfer_history(email:, futuresType:, **kwargs)
         
     | 
| 
       76 
76 
     | 
    
         
             
                    Binance::Utils::Validation.require_param('email', email)
         
     | 
| 
       77 
77 
     | 
    
         
             
                    Binance::Utils::Validation.require_param('futuresType', futuresType)
         
     | 
| 
         @@ -93,7 +93,7 @@ module Binance 
     | 
|
| 
       93 
93 
     | 
    
         
             
                  # @param amount [Float]
         
     | 
| 
       94 
94 
     | 
    
         
             
                  # @param kwargs [Hash]
         
     | 
| 
       95 
95 
     | 
    
         
             
                  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
         
     | 
| 
       96 
     | 
    
         
            -
                  # @see https://binance 
     | 
| 
      
 96 
     | 
    
         
            +
                  # @see https://developers.binance.com/docs/sub_account/asset-management/Sub-account-Futures-Asset-Transfer
         
     | 
| 
       97 
97 
     | 
    
         
             
                  def sub_account_futures_internal_transfer(fromEmail:, toEmail:, futuresType:, asset:, amount:, **kwargs)
         
     | 
| 
       98 
98 
     | 
    
         
             
                    Binance::Utils::Validation.require_param('fromEmail', fromEmail)
         
     | 
| 
       99 
99 
     | 
    
         
             
                    Binance::Utils::Validation.require_param('toEmail', toEmail)
         
     | 
| 
         @@ -117,13 +117,27 @@ module Binance 
     | 
|
| 
       117 
117 
     | 
    
         
             
                  # @param email [String]
         
     | 
| 
       118 
118 
     | 
    
         
             
                  # @param kwargs [Hash]
         
     | 
| 
       119 
119 
     | 
    
         
             
                  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
         
     | 
| 
       120 
     | 
    
         
            -
                  # @see https://binance 
     | 
| 
      
 120 
     | 
    
         
            +
                  # @see https://developers.binance.com/docs/sub_account/asset-management/Query-Sub-account-Assets-V3
         
     | 
| 
       121 
121 
     | 
    
         
             
                  def get_sub_account_assets(email:, **kwargs)
         
     | 
| 
       122 
122 
     | 
    
         
             
                    Binance::Utils::Validation.require_param('email', email)
         
     | 
| 
       123 
123 
     | 
    
         | 
| 
       124 
124 
     | 
    
         
             
                    @session.sign_request(:get, '/sapi/v3/sub-account/assets', params: kwargs.merge(email: email))
         
     | 
| 
       125 
125 
     | 
    
         
             
                  end
         
     | 
| 
       126 
126 
     | 
    
         | 
| 
      
 127 
     | 
    
         
            +
                  # Query Sub-account Assets (For Master Account)(USER_DATA)
         
     | 
| 
      
 128 
     | 
    
         
            +
                  #
         
     | 
| 
      
 129 
     | 
    
         
            +
                  # GET /sapi/v4/sub-account/assets
         
     | 
| 
      
 130 
     | 
    
         
            +
                  #
         
     | 
| 
      
 131 
     | 
    
         
            +
                  # @param email [String]
         
     | 
| 
      
 132 
     | 
    
         
            +
                  # @param kwargs [Hash]
         
     | 
| 
      
 133 
     | 
    
         
            +
                  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
         
     | 
| 
      
 134 
     | 
    
         
            +
                  # @see https://developers.binance.com/docs/sub_account/asset-management/Query-Sub-account-Assets-V4
         
     | 
| 
      
 135 
     | 
    
         
            +
                  def get_sub_account_assets_v4(email:, **kwargs)
         
     | 
| 
      
 136 
     | 
    
         
            +
                    Binance::Utils::Validation.require_param('email', email)
         
     | 
| 
      
 137 
     | 
    
         
            +
             
     | 
| 
      
 138 
     | 
    
         
            +
                    @session.sign_request(:get, '/sapi/v4/sub-account/assets', params: kwargs.merge(email: email))
         
     | 
| 
      
 139 
     | 
    
         
            +
                  end
         
     | 
| 
      
 140 
     | 
    
         
            +
             
     | 
| 
       127 
141 
     | 
    
         
             
                  # Query Sub-account Spot Assets Summary (For Master Account)
         
     | 
| 
       128 
142 
     | 
    
         
             
                  #
         
     | 
| 
       129 
143 
     | 
    
         
             
                  # GET /sapi/v1/sub-account/spotSummary
         
     | 
| 
         @@ -135,7 +149,7 @@ module Binance 
     | 
|
| 
       135 
149 
     | 
    
         
             
                  # @option kwargs [Integer] :page Default value: 1
         
     | 
| 
       136 
150 
     | 
    
         
             
                  # @option kwargs [Integer] :size default 10, max 20
         
     | 
| 
       137 
151 
     | 
    
         
             
                  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
         
     | 
| 
       138 
     | 
    
         
            -
                  # @see https://binance 
     | 
| 
      
 152 
     | 
    
         
            +
                  # @see https://developers.binance.com/docs/sub_account/asset-management/Query-Sub-account-Spot-Assets-Summary
         
     | 
| 
       139 
153 
     | 
    
         
             
                  def get_sub_account_spot_summary(**kwargs)
         
     | 
| 
       140 
154 
     | 
    
         
             
                    @session.sign_request(:get, '/sapi/v1/sub-account/spotSummary', params: kwargs)
         
     | 
| 
       141 
155 
     | 
    
         
             
                  end
         
     | 
| 
         @@ -151,7 +165,7 @@ module Binance 
     | 
|
| 
       151 
165 
     | 
    
         
             
                  # @param kwargs [Hash]
         
     | 
| 
       152 
166 
     | 
    
         
             
                  # @option kwargs [String] :network
         
     | 
| 
       153 
167 
     | 
    
         
             
                  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
         
     | 
| 
       154 
     | 
    
         
            -
                  # @see https://binance 
     | 
| 
      
 168 
     | 
    
         
            +
                  # @see https://developers.binance.com/docs/sub_account/asset-management/Get-Sub-account-Deposit-Address
         
     | 
| 
       155 
169 
     | 
    
         
             
                  def sub_account_deposit_address(email:, coin:, **kwargs)
         
     | 
| 
       156 
170 
     | 
    
         
             
                    Binance::Utils::Validation.require_param('email', email)
         
     | 
| 
       157 
171 
     | 
    
         
             
                    Binance::Utils::Validation.require_param('coin', coin)
         
     | 
| 
         @@ -177,7 +191,7 @@ module Binance 
     | 
|
| 
       177 
191 
     | 
    
         
             
                  # @option kwargs [String] :limit
         
     | 
| 
       178 
192 
     | 
    
         
             
                  # @option kwargs [String] :offset
         
     | 
| 
       179 
193 
     | 
    
         
             
                  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
         
     | 
| 
       180 
     | 
    
         
            -
                  # @see https://binance 
     | 
| 
      
 194 
     | 
    
         
            +
                  # @see https://developers.binance.com/docs/sub_account/asset-management/Get-Sub-account-Deposit-History
         
     | 
| 
       181 
195 
     | 
    
         
             
                  def sub_account_deposit_history(email:, **kwargs)
         
     | 
| 
       182 
196 
     | 
    
         
             
                    Binance::Utils::Validation.require_param('email', email)
         
     | 
| 
       183 
197 
     | 
    
         | 
| 
         @@ -193,7 +207,7 @@ module Binance 
     | 
|
| 
       193 
207 
     | 
    
         
             
                  # @param kwargs [Hash]
         
     | 
| 
       194 
208 
     | 
    
         
             
                  # @option kwargs [String] :email
         
     | 
| 
       195 
209 
     | 
    
         
             
                  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
         
     | 
| 
       196 
     | 
    
         
            -
                  # @see https://binance 
     | 
| 
      
 210 
     | 
    
         
            +
                  # @see https://developers.binance.com/docs/sub_account/account-management/Get-Sub-accounts-Status-on-Margin-Or-Futures
         
     | 
| 
       197 
211 
     | 
    
         
             
                  def sub_account_status(**kwargs)
         
     | 
| 
       198 
212 
     | 
    
         
             
                    @session.sign_request(:get, '/sapi/v1/sub-account/status', params: kwargs)
         
     | 
| 
       199 
213 
     | 
    
         
             
                  end
         
     | 
| 
         @@ -205,7 +219,7 @@ module Binance 
     | 
|
| 
       205 
219 
     | 
    
         
             
                  # @param kwargs [Hash]
         
     | 
| 
       206 
220 
     | 
    
         
             
                  # @option kwargs [String] :email
         
     | 
| 
       207 
221 
     | 
    
         
             
                  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
         
     | 
| 
       208 
     | 
    
         
            -
                  # @see https://binance 
     | 
| 
      
 222 
     | 
    
         
            +
                  # @see https://developers.binance.com/docs/sub_account/account-management/Enable-Margin-for-Sub-account
         
     | 
| 
       209 
223 
     | 
    
         
             
                  def sub_account_enable_margin(email:, **kwargs)
         
     | 
| 
       210 
224 
     | 
    
         
             
                    Binance::Utils::Validation.require_param('email', email)
         
     | 
| 
       211 
225 
     | 
    
         | 
| 
         @@ -214,6 +228,22 @@ module Binance 
     | 
|
| 
       214 
228 
     | 
    
         
             
                    ))
         
     | 
| 
       215 
229 
     | 
    
         
             
                  end
         
     | 
| 
       216 
230 
     | 
    
         | 
| 
      
 231 
     | 
    
         
            +
                  # Enable Options for Sub-account(For Master Account)(USER_DATA)
         
     | 
| 
      
 232 
     | 
    
         
            +
                  #
         
     | 
| 
      
 233 
     | 
    
         
            +
                  # POST /sapi/v1/sub-account/eoptions/enable
         
     | 
| 
      
 234 
     | 
    
         
            +
                  #
         
     | 
| 
      
 235 
     | 
    
         
            +
                  # @param email [String] Sub user email
         
     | 
| 
      
 236 
     | 
    
         
            +
                  # @param kwargs [Hash]
         
     | 
| 
      
 237 
     | 
    
         
            +
                  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
         
     | 
| 
      
 238 
     | 
    
         
            +
                  # @see https://developers.binance.com/docs/sub_account/account-management/Enable-Options-for-Sub-account
         
     | 
| 
      
 239 
     | 
    
         
            +
                  def sub_account_enable_options(email:, **kwargs)
         
     | 
| 
      
 240 
     | 
    
         
            +
                    Binance::Utils::Validation.require_param('email', email)
         
     | 
| 
      
 241 
     | 
    
         
            +
             
     | 
| 
      
 242 
     | 
    
         
            +
                    @session.sign_request(:post, '/sapi/v1/sub-account/eoptions/enable', params: kwargs.merge(
         
     | 
| 
      
 243 
     | 
    
         
            +
                      email: email
         
     | 
| 
      
 244 
     | 
    
         
            +
                    ))
         
     | 
| 
      
 245 
     | 
    
         
            +
                  end
         
     | 
| 
      
 246 
     | 
    
         
            +
             
     | 
| 
       217 
247 
     | 
    
         
             
                  # Get Detail on Sub-account's Margin Account (For Master Account)
         
     | 
| 
       218 
248 
     | 
    
         
             
                  #
         
     | 
| 
       219 
249 
     | 
    
         
             
                  # GET /sapi/v1/sub-account/margin/account
         
     | 
| 
         @@ -221,7 +251,7 @@ module Binance 
     | 
|
| 
       221 
251 
     | 
    
         
             
                  # @param email [String]
         
     | 
| 
       222 
252 
     | 
    
         
             
                  # @param kwargs [Hash]
         
     | 
| 
       223 
253 
     | 
    
         
             
                  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
         
     | 
| 
       224 
     | 
    
         
            -
                  # @see https://binance 
     | 
| 
      
 254 
     | 
    
         
            +
                  # @see https://developers.binance.com/docs/sub_account/asset-management/Get-Detail-on-Sub-accounts-Margin-Account
         
     | 
| 
       225 
255 
     | 
    
         
             
                  def sub_account_margin_account(email:, **kwargs)
         
     | 
| 
       226 
256 
     | 
    
         
             
                    Binance::Utils::Validation.require_param('email', email)
         
     | 
| 
       227 
257 
     | 
    
         | 
| 
         @@ -236,7 +266,7 @@ module Binance 
     | 
|
| 
       236 
266 
     | 
    
         
             
                  #
         
     | 
| 
       237 
267 
     | 
    
         
             
                  # @param kwargs [Hash]
         
     | 
| 
       238 
268 
     | 
    
         
             
                  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
         
     | 
| 
       239 
     | 
    
         
            -
                  # @see https://binance 
     | 
| 
      
 269 
     | 
    
         
            +
                  # @see https://developers.binance.com/docs/sub_account/asset-management/Get-Summary-of-Sub-accounts-Margin-Account
         
     | 
| 
       240 
270 
     | 
    
         
             
                  def sub_account_margin_account_summary(**kwargs)
         
     | 
| 
       241 
271 
     | 
    
         
             
                    @session.sign_request(:get, '/sapi/v1/sub-account/margin/accountSummary', params: kwargs)
         
     | 
| 
       242 
272 
     | 
    
         
             
                  end
         
     | 
| 
         @@ -248,7 +278,7 @@ module Binance 
     | 
|
| 
       248 
278 
     | 
    
         
             
                  # @param email [String]
         
     | 
| 
       249 
279 
     | 
    
         
             
                  # @param kwargs [Hash]
         
     | 
| 
       250 
280 
     | 
    
         
             
                  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
         
     | 
| 
       251 
     | 
    
         
            -
                  # @see https://binance 
     | 
| 
      
 281 
     | 
    
         
            +
                  # @see https://developers.binance.com/docs/sub_account/account-management/Enable-Futures-for-Sub-account
         
     | 
| 
       252 
282 
     | 
    
         
             
                  def sub_account_enable_futures(email:, **kwargs)
         
     | 
| 
       253 
283 
     | 
    
         
             
                    Binance::Utils::Validation.require_param('email', email)
         
     | 
| 
       254 
284 
     | 
    
         | 
| 
         @@ -265,7 +295,7 @@ module Binance 
     | 
|
| 
       265 
295 
     | 
    
         
             
                  # @param futuresType [Integer] 1:USDT Margined Futures, 2:COIN Margined Futures
         
     | 
| 
       266 
296 
     | 
    
         
             
                  # @param kwargs [Hash]
         
     | 
| 
       267 
297 
     | 
    
         
             
                  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
         
     | 
| 
       268 
     | 
    
         
            -
                  # @see https://binance 
     | 
| 
      
 298 
     | 
    
         
            +
                  # @see https://developers.binance.com/docs/sub_account/asset-management/Get-Detail-on-Sub-accounts-Futures-Account-V2
         
     | 
| 
       269 
299 
     | 
    
         
             
                  def sub_account_futures_account(email:, futuresType:, **kwargs)
         
     | 
| 
       270 
300 
     | 
    
         
             
                    Binance::Utils::Validation.require_param('email', email)
         
     | 
| 
       271 
301 
     | 
    
         
             
                    Binance::Utils::Validation.require_param('futuresType', futuresType)
         
     | 
| 
         @@ -285,7 +315,7 @@ module Binance 
     | 
|
| 
       285 
315 
     | 
    
         
             
                  # @option kwargs [Integer] :page  default:1
         
     | 
| 
       286 
316 
     | 
    
         
             
                  # @option kwargs [Integer] :limit default:10, max:20
         
     | 
| 
       287 
317 
     | 
    
         
             
                  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
         
     | 
| 
       288 
     | 
    
         
            -
                  # @see https://binance 
     | 
| 
      
 318 
     | 
    
         
            +
                  # @see https://developers.binance.com/docs/sub_account/asset-management/Get-Summary-of-Sub-accounts-Futures-Account-V2
         
     | 
| 
       289 
319 
     | 
    
         
             
                  def sub_account_futures_account_summary(futuresType:, **kwargs)
         
     | 
| 
       290 
320 
     | 
    
         
             
                    Binance::Utils::Validation.require_param('futuresType', futuresType)
         
     | 
| 
       291 
321 
     | 
    
         | 
| 
         @@ -302,7 +332,7 @@ module Binance 
     | 
|
| 
       302 
332 
     | 
    
         
             
                  # @param futuresType [Integer] 1:USDT Margined Futures, 2:COIN Margined Futures
         
     | 
| 
       303 
333 
     | 
    
         
             
                  # @param kwargs [Hash]
         
     | 
| 
       304 
334 
     | 
    
         
             
                  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
         
     | 
| 
       305 
     | 
    
         
            -
                  # @see https://binance 
     | 
| 
      
 335 
     | 
    
         
            +
                  # @see https://developers.binance.com/docs/sub_account/account-management/Get-Futures-Position-Risk-of-Sub-account-V2
         
     | 
| 
       306 
336 
     | 
    
         
             
                  def sub_account_futures_position_risk(email:, futuresType:, **kwargs)
         
     | 
| 
       307 
337 
     | 
    
         
             
                    Binance::Utils::Validation.require_param('email', email)
         
     | 
| 
       308 
338 
     | 
    
         
             
                    Binance::Utils::Validation.require_param('futuresType', futuresType)
         
     | 
| 
         @@ -313,6 +343,22 @@ module Binance 
     | 
|
| 
       313 
343 
     | 
    
         
             
                    ))
         
     | 
| 
       314 
344 
     | 
    
         
             
                  end
         
     | 
| 
       315 
345 
     | 
    
         | 
| 
      
 346 
     | 
    
         
            +
                  # Query Sub-account Transaction Statistics(For Master Account)(USER_DATA)
         
     | 
| 
      
 347 
     | 
    
         
            +
                  #
         
     | 
| 
      
 348 
     | 
    
         
            +
                  # GET /sapi/v1/sub-account/transaction-statistics
         
     | 
| 
      
 349 
     | 
    
         
            +
                  #
         
     | 
| 
      
 350 
     | 
    
         
            +
                  # @param email [String] Sub user email
         
     | 
| 
      
 351 
     | 
    
         
            +
                  # @param kwargs [Hash]
         
     | 
| 
      
 352 
     | 
    
         
            +
                  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
         
     | 
| 
      
 353 
     | 
    
         
            +
                  # @see https://developers.binance.com/docs/sub_account/account-management/Query-Sub-account-Transaction-Statistics
         
     | 
| 
      
 354 
     | 
    
         
            +
                  def sub_account_transaction_statistics(email:, **kwargs)
         
     | 
| 
      
 355 
     | 
    
         
            +
                    Binance::Utils::Validation.require_param('email', email)
         
     | 
| 
      
 356 
     | 
    
         
            +
             
     | 
| 
      
 357 
     | 
    
         
            +
                    @session.sign_request(:get, '/sapi/v1/sub-account/transaction-statistics', params: kwargs.merge(
         
     | 
| 
      
 358 
     | 
    
         
            +
                      email: email
         
     | 
| 
      
 359 
     | 
    
         
            +
                    ))
         
     | 
| 
      
 360 
     | 
    
         
            +
                  end
         
     | 
| 
      
 361 
     | 
    
         
            +
             
     | 
| 
       316 
362 
     | 
    
         
             
                  # Futures Transfer for Sub-account(For Master Account)
         
     | 
| 
       317 
363 
     | 
    
         
             
                  #
         
     | 
| 
       318 
364 
     | 
    
         
             
                  # POST /sapi/v1/sub-account/futures/transfer
         
     | 
| 
         @@ -326,7 +372,7 @@ module Binance 
     | 
|
| 
       326 
372 
     | 
    
         
             
                  #    4:transfer from subaccount's COIN-margined futures account to its spot account
         
     | 
| 
       327 
373 
     | 
    
         
             
                  # @param kwargs [Hash]
         
     | 
| 
       328 
374 
     | 
    
         
             
                  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
         
     | 
| 
       329 
     | 
    
         
            -
                  # @see https://binance 
     | 
| 
      
 375 
     | 
    
         
            +
                  # @see https://developers.binance.com/docs/sub_account/asset-management/Futures-Transfer-for-Sub-account
         
     | 
| 
       330 
376 
     | 
    
         
             
                  def sub_account_futures_transfer(email:, asset:, amount:, type:, **kwargs)
         
     | 
| 
       331 
377 
     | 
    
         
             
                    Binance::Utils::Validation.require_param('email', email)
         
     | 
| 
       332 
378 
     | 
    
         
             
                    Binance::Utils::Validation.require_param('asset', asset)
         
     | 
| 
         @@ -352,7 +398,7 @@ module Binance 
     | 
|
| 
       352 
398 
     | 
    
         
             
                  #    2: transfer from subaccount's margin account to its spot account
         
     | 
| 
       353 
399 
     | 
    
         
             
                  # @param kwargs [Hash]
         
     | 
| 
       354 
400 
     | 
    
         
             
                  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
         
     | 
| 
       355 
     | 
    
         
            -
                  # @see https://binance 
     | 
| 
      
 401 
     | 
    
         
            +
                  # @see https://developers.binance.com/docs/sub_account/asset-management/Margin-Transfer-for-Sub-account
         
     | 
| 
       356 
402 
     | 
    
         
             
                  def sub_account_margin_transfer(email:, asset:, amount:, type:, **kwargs)
         
     | 
| 
       357 
403 
     | 
    
         
             
                    Binance::Utils::Validation.require_param('email', email)
         
     | 
| 
       358 
404 
     | 
    
         
             
                    Binance::Utils::Validation.require_param('asset', asset)
         
     | 
| 
         @@ -376,7 +422,7 @@ module Binance 
     | 
|
| 
       376 
422 
     | 
    
         
             
                  # @param amount [String]
         
     | 
| 
       377 
423 
     | 
    
         
             
                  # @param kwargs [Hash]
         
     | 
| 
       378 
424 
     | 
    
         
             
                  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
         
     | 
| 
       379 
     | 
    
         
            -
                  # @see https://binance 
     | 
| 
      
 425 
     | 
    
         
            +
                  # @see https://developers.binance.com/docs/sub_account/asset-management/Transfer-to-Sub-account-of-Same-Master
         
     | 
| 
       380 
426 
     | 
    
         
             
                  def sub_account_transfer_to_sub(toEmail:, asset:, amount:, **kwargs)
         
     | 
| 
       381 
427 
     | 
    
         
             
                    Binance::Utils::Validation.require_param('toEmail', toEmail)
         
     | 
| 
       382 
428 
     | 
    
         
             
                    Binance::Utils::Validation.require_param('asset', asset)
         
     | 
| 
         @@ -397,7 +443,7 @@ module Binance 
     | 
|
| 
       397 
443 
     | 
    
         
             
                  # @param amount [Float]
         
     | 
| 
       398 
444 
     | 
    
         
             
                  # @param kwargs [Hash]
         
     | 
| 
       399 
445 
     | 
    
         
             
                  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
         
     | 
| 
       400 
     | 
    
         
            -
                  # @see https://binance 
     | 
| 
      
 446 
     | 
    
         
            +
                  # @see https://developers.binance.com/docs/sub_account/asset-management/Transfer-to-Master
         
     | 
| 
       401 
447 
     | 
    
         
             
                  def sub_account_transfer_to_master(asset:, amount:, **kwargs)
         
     | 
| 
       402 
448 
     | 
    
         
             
                    Binance::Utils::Validation.require_param('asset', asset)
         
     | 
| 
       403 
449 
     | 
    
         
             
                    Binance::Utils::Validation.require_param('amount', amount)
         
     | 
| 
         @@ -419,7 +465,7 @@ module Binance 
     | 
|
| 
       419 
465 
     | 
    
         
             
                  # @option kwargs [Integer] :endTime
         
     | 
| 
       420 
466 
     | 
    
         
             
                  # @option kwargs [Integer] :limit
         
     | 
| 
       421 
467 
     | 
    
         
             
                  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
         
     | 
| 
       422 
     | 
    
         
            -
                  # @see https://binance 
     | 
| 
      
 468 
     | 
    
         
            +
                  # @see https://developers.binance.com/docs/sub_account/asset-management/Sub-account-Transfer-History
         
     | 
| 
       423 
469 
     | 
    
         
             
                  def sub_account_transfer_sub_account_history(**kwargs)
         
     | 
| 
       424 
470 
     | 
    
         
             
                    @session.sign_request(:get, '/sapi/v1/sub-account/transfer/subUserHistory', params: kwargs)
         
     | 
| 
       425 
471 
     | 
    
         
             
                  end
         
     | 
| 
         @@ -439,7 +485,7 @@ module Binance 
     | 
|
| 
       439 
485 
     | 
    
         
             
                  # @option kwargs [String] :fromEmail Transfer from master account by default if fromEmail is not sent.
         
     | 
| 
       440 
486 
     | 
    
         
             
                  # @option kwargs [String] :toEmail Transfer to master account by default if toEmail is not sent.
         
     | 
| 
       441 
487 
     | 
    
         
             
                  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
         
     | 
| 
       442 
     | 
    
         
            -
                  # @see https://binance 
     | 
| 
      
 488 
     | 
    
         
            +
                  # @see https://developers.binance.com/docs/sub_account/asset-management/Universal-Transfer
         
     | 
| 
       443 
489 
     | 
    
         
             
                  def universal_transfer(fromAccountType:, toAccountType:, asset:, amount:, **kwargs)
         
     | 
| 
       444 
490 
     | 
    
         
             
                    Binance::Utils::Validation.require_param('fromAccountType', fromAccountType)
         
     | 
| 
       445 
491 
     | 
    
         
             
                    Binance::Utils::Validation.require_param('toAccountType', toAccountType)
         
     | 
| 
         @@ -466,7 +512,7 @@ module Binance 
     | 
|
| 
       466 
512 
     | 
    
         
             
                  # @option kwargs [Integer] :page
         
     | 
| 
       467 
513 
     | 
    
         
             
                  # @option kwargs [Integer] :limit Default 500, Max 500
         
     | 
| 
       468 
514 
     | 
    
         
             
                  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
         
     | 
| 
       469 
     | 
    
         
            -
                  # @see https://binance 
     | 
| 
      
 515 
     | 
    
         
            +
                  # @see https://developers.binance.com/docs/sub_account/asset-management/Query-Universal-Transfer-History
         
     | 
| 
       470 
516 
     | 
    
         
             
                  def universal_transfer_history(**kwargs)
         
     | 
| 
       471 
517 
     | 
    
         
             
                    @session.sign_request(:get, '/sapi/v1/sub-account/universalTransfer', params: kwargs)
         
     | 
| 
       472 
518 
     | 
    
         
             
                  end
         
     | 
| 
         @@ -479,7 +525,7 @@ module Binance 
     | 
|
| 
       479 
525 
     | 
    
         
             
                  # @param enableBlvt [Boolean] Only true for now
         
     | 
| 
       480 
526 
     | 
    
         
             
                  # @param kwargs [Hash]
         
     | 
| 
       481 
527 
     | 
    
         
             
                  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
         
     | 
| 
       482 
     | 
    
         
            -
                  # @see https://binance 
     | 
| 
      
 528 
     | 
    
         
            +
                  # @see https://developers.binance.com/docs/sub_account/account-management/Enable-Leverage-Token-for-Sub-account
         
     | 
| 
       483 
529 
     | 
    
         
             
                  def sub_account_enable_blvt(email:, enableBlvt:, **kwargs)
         
     | 
| 
       484 
530 
     | 
    
         
             
                    Binance::Utils::Validation.require_param('email', email)
         
     | 
| 
       485 
531 
     | 
    
         
             
                    Binance::Utils::Validation.require_param('enableBlvt', enableBlvt)
         
     | 
| 
         @@ -499,7 +545,7 @@ module Binance 
     | 
|
| 
       499 
545 
     | 
    
         
             
                  # @param amount [Float]
         
     | 
| 
       500 
546 
     | 
    
         
             
                  # @param kwargs [Hash]
         
     | 
| 
       501 
547 
     | 
    
         
             
                  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
         
     | 
| 
       502 
     | 
    
         
            -
                  # @see https://binance 
     | 
| 
      
 548 
     | 
    
         
            +
                  # @see https://developers.binance.com/docs/sub_account/managed-sub-account/Deposit-Assets-Into-The-Managed-Sub-account
         
     | 
| 
       503 
549 
     | 
    
         
             
                  def deposit_to_sub_account(toEmail:, asset:, amount:, **kwargs)
         
     | 
| 
       504 
550 
     | 
    
         
             
                    Binance::Utils::Validation.require_param('toEmail', toEmail)
         
     | 
| 
       505 
551 
     | 
    
         
             
                    Binance::Utils::Validation.require_param('asset', asset)
         
     | 
| 
         @@ -519,13 +565,41 @@ module Binance 
     | 
|
| 
       519 
565 
     | 
    
         
             
                  # @param email [String]
         
     | 
| 
       520 
566 
     | 
    
         
             
                  # @param kwargs [Hash]
         
     | 
| 
       521 
567 
     | 
    
         
             
                  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
         
     | 
| 
       522 
     | 
    
         
            -
                  # @see https://binance 
     | 
| 
      
 568 
     | 
    
         
            +
                  # @see https://developers.binance.com/docs/sub_account/managed-sub-account/Query-Managed-Sub-account-Asset-Details
         
     | 
| 
       523 
569 
     | 
    
         
             
                  def sub_account_asset_details(email:, **kwargs)
         
     | 
| 
       524 
570 
     | 
    
         
             
                    Binance::Utils::Validation.require_param('email', email)
         
     | 
| 
       525 
571 
     | 
    
         | 
| 
       526 
572 
     | 
    
         
             
                    @session.sign_request(:get, '/sapi/v1/managed-subaccount/asset', params: kwargs.merge(email: email))
         
     | 
| 
       527 
573 
     | 
    
         
             
                  end
         
     | 
| 
       528 
574 
     | 
    
         | 
| 
      
 575 
     | 
    
         
            +
                  # Query Managed Sub-account Margin Asset Details(For Investor Master Account)(USER_DATA)
         
     | 
| 
      
 576 
     | 
    
         
            +
                  #
         
     | 
| 
      
 577 
     | 
    
         
            +
                  # GET /sapi/v1/managed-subaccount/marginAsset
         
     | 
| 
      
 578 
     | 
    
         
            +
                  #
         
     | 
| 
      
 579 
     | 
    
         
            +
                  # @param email [String]
         
     | 
| 
      
 580 
     | 
    
         
            +
                  # @param kwargs [Hash]
         
     | 
| 
      
 581 
     | 
    
         
            +
                  # @option kwargs [String] :accountType No input or input "MARGIN" to get Cross Margin account details. Input "ISOLATED_MARGIN" to get Isolated Margin account details.
         
     | 
| 
      
 582 
     | 
    
         
            +
                  # @see https://developers.binance.com/docs/sub_account/managed-sub-account/Query-Managed-Sub-account-Margin-Asset-Details
         
     | 
| 
      
 583 
     | 
    
         
            +
                  def sub_account_margin_asset_details(email:, **kwargs)
         
     | 
| 
      
 584 
     | 
    
         
            +
                    Binance::Utils::Validation.require_param('email', email)
         
     | 
| 
      
 585 
     | 
    
         
            +
             
     | 
| 
      
 586 
     | 
    
         
            +
                    @session.sign_request(:get, '/sapi/v1/managed-subaccount/marginAsset', params: kwargs.merge(email: email))
         
     | 
| 
      
 587 
     | 
    
         
            +
                  end
         
     | 
| 
      
 588 
     | 
    
         
            +
             
     | 
| 
      
 589 
     | 
    
         
            +
                  # Query Managed Sub-account Futures Asset Details(For Investor Master Account)(USER_DATA)
         
     | 
| 
      
 590 
     | 
    
         
            +
                  #
         
     | 
| 
      
 591 
     | 
    
         
            +
                  # GET /sapi/v1/managed-subaccount/fetch-future-asset
         
     | 
| 
      
 592 
     | 
    
         
            +
                  #
         
     | 
| 
      
 593 
     | 
    
         
            +
                  # @param email [String]
         
     | 
| 
      
 594 
     | 
    
         
            +
                  # @param kwargs [Hash]
         
     | 
| 
      
 595 
     | 
    
         
            +
                  # @option kwargs [String] :accountType No input or input "USDT_FUTURE" to get UM Futures account details. Input "COIN_FUTURE" to get CM Futures account details.
         
     | 
| 
      
 596 
     | 
    
         
            +
                  # @see https://developers.binance.com/docs/sub_account/managed-sub-account/Query-Managed-Sub-account-Futures-Asset-Details
         
     | 
| 
      
 597 
     | 
    
         
            +
                  def sub_account_futures_asset_details(email:, **kwargs)
         
     | 
| 
      
 598 
     | 
    
         
            +
                    Binance::Utils::Validation.require_param('email', email)
         
     | 
| 
      
 599 
     | 
    
         
            +
             
     | 
| 
      
 600 
     | 
    
         
            +
                    @session.sign_request(:get, '/sapi/v1/managed-subaccount/fetch-future-asset', params: kwargs.merge(email: email))
         
     | 
| 
      
 601 
     | 
    
         
            +
                  end
         
     | 
| 
      
 602 
     | 
    
         
            +
             
     | 
| 
       529 
603 
     | 
    
         
             
                  # Withdrawl assets from the managed sub-account (For Investor Master Account)
         
     | 
| 
       530 
604 
     | 
    
         
             
                  #
         
     | 
| 
       531 
605 
     | 
    
         
             
                  # POST /sapi/v1/managed-subaccount/withdraw
         
     | 
| 
         @@ -536,7 +610,7 @@ module Binance 
     | 
|
| 
       536 
610 
     | 
    
         
             
                  # @param kwargs [Hash]
         
     | 
| 
       537 
611 
     | 
    
         
             
                  # @option kwargs [Integer] :transferDate
         
     | 
| 
       538 
612 
     | 
    
         
             
                  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
         
     | 
| 
       539 
     | 
    
         
            -
                  # @see https://binance 
     | 
| 
      
 613 
     | 
    
         
            +
                  # @see https://developers.binance.com/docs/sub_account/managed-sub-account/Withdrawl-Assets-From-The-Managed-Sub-account
         
     | 
| 
       540 
614 
     | 
    
         
             
                  def withdraw_from_sub_account(fromEmail:, asset:, amount:, **kwargs)
         
     | 
| 
       541 
615 
     | 
    
         
             
                    Binance::Utils::Validation.require_param('fromEmail', fromEmail)
         
     | 
| 
       542 
616 
     | 
    
         
             
                    Binance::Utils::Validation.require_param('asset', asset)
         
     | 
| 
         @@ -549,45 +623,124 @@ module Binance 
     | 
|
| 
       549 
623 
     | 
    
         
             
                    ))
         
     | 
| 
       550 
624 
     | 
    
         
             
                  end
         
     | 
| 
       551 
625 
     | 
    
         | 
| 
       552 
     | 
    
         
            -
                  #  
     | 
| 
      
 626 
     | 
    
         
            +
                  # Query Managed Sub Account Transfer Log(For Trading Team Master Account)(USER_DATA)
         
     | 
| 
       553 
627 
     | 
    
         
             
                  #
         
     | 
| 
       554 
     | 
    
         
            -
                  #  
     | 
| 
      
 628 
     | 
    
         
            +
                  # GET /sapi/v1/managed-subaccount/queryTransLogForTradeParent
         
     | 
| 
       555 
629 
     | 
    
         
             
                  #
         
     | 
| 
       556 
     | 
    
         
            -
                  # @param email 
     | 
| 
       557 
     | 
    
         
            -
                  # @param  
     | 
| 
       558 
     | 
    
         
            -
                  # @param  
     | 
| 
       559 
     | 
    
         
            -
                  # @ 
     | 
| 
       560 
     | 
    
         
            -
                  # @ 
     | 
| 
       561 
     | 
    
         
            -
                   
     | 
| 
      
 630 
     | 
    
         
            +
                  # @param email [String] Managed Sub Account Email
         
     | 
| 
      
 631 
     | 
    
         
            +
                  # @param startTime [Integer]
         
     | 
| 
      
 632 
     | 
    
         
            +
                  # @param endTime [Integer]
         
     | 
| 
      
 633 
     | 
    
         
            +
                  # @param page [Integer]
         
     | 
| 
      
 634 
     | 
    
         
            +
                  # @param limit [Integer] Limit (Max: 500)
         
     | 
| 
      
 635 
     | 
    
         
            +
                  # @param kwargs [Hash]
         
     | 
| 
      
 636 
     | 
    
         
            +
                  # @option kwargs [String] :transfers Transfer Direction (FROM/TO)
         
     | 
| 
      
 637 
     | 
    
         
            +
                  # @option kwargs [String] :transferFunctionAccountType Transfer function account type (SPOT/MARGIN/ISOLATED_MARGIN/USDT_FUTURE/COIN_FUTURE)
         
     | 
| 
      
 638 
     | 
    
         
            +
                  # @see https://developers.binance.com/docs/sub_account/managed-sub-account/Query-Managed-Sub-Account-Transfer-Log-Trading-Team-Master
         
     | 
| 
      
 639 
     | 
    
         
            +
                  def sub_account_transfer_log(email:, startTime:, endTime:, page:, limit:, **kwargs)
         
     | 
| 
       562 
640 
     | 
    
         
             
                    Binance::Utils::Validation.require_param('email', email)
         
     | 
| 
       563 
     | 
    
         
            -
                    Binance::Utils::Validation.require_param(' 
     | 
| 
       564 
     | 
    
         
            -
                    Binance::Utils::Validation.require_param(' 
     | 
| 
      
 641 
     | 
    
         
            +
                    Binance::Utils::Validation.require_param('startTime', startTime)
         
     | 
| 
      
 642 
     | 
    
         
            +
                    Binance::Utils::Validation.require_param('endTime', endTime)
         
     | 
| 
      
 643 
     | 
    
         
            +
                    Binance::Utils::Validation.require_param('page', page)
         
     | 
| 
      
 644 
     | 
    
         
            +
                    Binance::Utils::Validation.require_param('limit', limit)
         
     | 
| 
       565 
645 
     | 
    
         | 
| 
       566 
     | 
    
         
            -
                    @session.sign_request(: 
     | 
| 
      
 646 
     | 
    
         
            +
                    @session.sign_request(:get, '/sapi/v1/managed-subaccount/queryTransLogForTradeParent', params: kwargs.merge(
         
     | 
| 
       567 
647 
     | 
    
         
             
                      email: email,
         
     | 
| 
       568 
     | 
    
         
            -
                       
     | 
| 
       569 
     | 
    
         
            -
                       
     | 
| 
      
 648 
     | 
    
         
            +
                      startTime: startTime,
         
     | 
| 
      
 649 
     | 
    
         
            +
                      endTime: endTime,
         
     | 
| 
      
 650 
     | 
    
         
            +
                      page: page,
         
     | 
| 
      
 651 
     | 
    
         
            +
                      limit: limit
         
     | 
| 
      
 652 
     | 
    
         
            +
                    ))
         
     | 
| 
      
 653 
     | 
    
         
            +
                  end
         
     | 
| 
      
 654 
     | 
    
         
            +
             
     | 
| 
      
 655 
     | 
    
         
            +
                  # Query Managed Sub Account Transfer Log (For Trading Team Sub Account)(USER_DATA)
         
     | 
| 
      
 656 
     | 
    
         
            +
                  #
         
     | 
| 
      
 657 
     | 
    
         
            +
                  # GET /sapi/v1/managed-subaccount/query-trans-log
         
     | 
| 
      
 658 
     | 
    
         
            +
                  #
         
     | 
| 
      
 659 
     | 
    
         
            +
                  # @param startTime [Integer]
         
     | 
| 
      
 660 
     | 
    
         
            +
                  # @param endTime [Integer]
         
     | 
| 
      
 661 
     | 
    
         
            +
                  # @param page [Integer]
         
     | 
| 
      
 662 
     | 
    
         
            +
                  # @param limit [Integer] Limit (Max: 500)
         
     | 
| 
      
 663 
     | 
    
         
            +
                  # @param kwargs [Hash]
         
     | 
| 
      
 664 
     | 
    
         
            +
                  # @option kwargs [String] :transfers Transfer Direction (FROM/TO)
         
     | 
| 
      
 665 
     | 
    
         
            +
                  # @option kwargs [String] :transferFunctionAccountType Transfer function account type (SPOT/MARGIN/ISOLATED_MARGIN/USDT_FUTURE/COIN_FUTURE)
         
     | 
| 
      
 666 
     | 
    
         
            +
                  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
         
     | 
| 
      
 667 
     | 
    
         
            +
                  # @see https://developers.binance.com/docs/sub_account/managed-sub-account/Query-Managed-Sub-Account-Transfer-Log-Trading-Team-Sub
         
     | 
| 
      
 668 
     | 
    
         
            +
                  def sub_account_transfer_log_sub_account(startTime:, endTime:, page:, limit:, **kwargs)
         
     | 
| 
      
 669 
     | 
    
         
            +
                    Binance::Utils::Validation.require_param('startTime', startTime)
         
     | 
| 
      
 670 
     | 
    
         
            +
                    Binance::Utils::Validation.require_param('endTime', endTime)
         
     | 
| 
      
 671 
     | 
    
         
            +
                    Binance::Utils::Validation.require_param('page', page)
         
     | 
| 
      
 672 
     | 
    
         
            +
                    Binance::Utils::Validation.require_param('limit', limit)
         
     | 
| 
      
 673 
     | 
    
         
            +
             
     | 
| 
      
 674 
     | 
    
         
            +
                    @session.sign_request(:get, '/sapi/v1/managed-subaccount/query-trans-log', params: kwargs.merge(
         
     | 
| 
      
 675 
     | 
    
         
            +
                      startTime: startTime,
         
     | 
| 
      
 676 
     | 
    
         
            +
                      endTime: endTime,
         
     | 
| 
      
 677 
     | 
    
         
            +
                      page: page,
         
     | 
| 
      
 678 
     | 
    
         
            +
                      limit: limit
         
     | 
| 
       570 
679 
     | 
    
         
             
                    ))
         
     | 
| 
       571 
680 
     | 
    
         
             
                  end
         
     | 
| 
       572 
681 
     | 
    
         | 
| 
       573 
     | 
    
         
            -
                  #  
     | 
| 
      
 682 
     | 
    
         
            +
                  # Query Managed Sub Account Transfer Log (For Investor Master Account)(USER_DATA)
         
     | 
| 
       574 
683 
     | 
    
         
             
                  #
         
     | 
| 
       575 
     | 
    
         
            -
                  #  
     | 
| 
      
 684 
     | 
    
         
            +
                  # GET /sapi/v1/managed-subaccount/queryTransLogForInvestor
         
     | 
| 
      
 685 
     | 
    
         
            +
                  #
         
     | 
| 
      
 686 
     | 
    
         
            +
                  # @param email [String] Managed Sub Account Email
         
     | 
| 
      
 687 
     | 
    
         
            +
                  # @param startTime [Integer]
         
     | 
| 
      
 688 
     | 
    
         
            +
                  # @param endTime [Integer]
         
     | 
| 
      
 689 
     | 
    
         
            +
                  # @param page [Integer]
         
     | 
| 
      
 690 
     | 
    
         
            +
                  # @param limit [Integer] Limit (Max: 500)
         
     | 
| 
      
 691 
     | 
    
         
            +
                  # @param kwargs [Hash]
         
     | 
| 
      
 692 
     | 
    
         
            +
                  # @option kwargs [String] :transfers Transfer Direction (FROM/TO)
         
     | 
| 
      
 693 
     | 
    
         
            +
                  # @option kwargs [String] :transferFunctionAccountType Transfer function account type (SPOT/MARGIN/ISOLATED_MARGIN/USDT_FUTURE/COIN_FUTURE)
         
     | 
| 
      
 694 
     | 
    
         
            +
                  # @see https://developers.binance.com/docs/sub_account/managed-sub-account/Query-Managed-Sub-Account-Transfer-Log-Investor
         
     | 
| 
      
 695 
     | 
    
         
            +
                  def sub_account_transfer_log_investor(email:, startTime:, endTime:, page:, limit:, **kwargs)
         
     | 
| 
      
 696 
     | 
    
         
            +
                    Binance::Utils::Validation.require_param('email', email)
         
     | 
| 
      
 697 
     | 
    
         
            +
                    Binance::Utils::Validation.require_param('startTime', startTime)
         
     | 
| 
      
 698 
     | 
    
         
            +
                    Binance::Utils::Validation.require_param('endTime', endTime)
         
     | 
| 
      
 699 
     | 
    
         
            +
                    Binance::Utils::Validation.require_param('page', page)
         
     | 
| 
      
 700 
     | 
    
         
            +
                    Binance::Utils::Validation.require_param('limit', limit)
         
     | 
| 
      
 701 
     | 
    
         
            +
             
     | 
| 
      
 702 
     | 
    
         
            +
                    @session.sign_request(:get, '/sapi/v1/managed-subaccount/queryTransLogForInvestor', params: kwargs.merge(
         
     | 
| 
      
 703 
     | 
    
         
            +
                      email: email,
         
     | 
| 
      
 704 
     | 
    
         
            +
                      startTime: startTime,
         
     | 
| 
      
 705 
     | 
    
         
            +
                      endTime: endTime,
         
     | 
| 
      
 706 
     | 
    
         
            +
                      page: page,
         
     | 
| 
      
 707 
     | 
    
         
            +
                      limit: limit
         
     | 
| 
      
 708 
     | 
    
         
            +
                    ))
         
     | 
| 
      
 709 
     | 
    
         
            +
                  end
         
     | 
| 
      
 710 
     | 
    
         
            +
             
     | 
| 
      
 711 
     | 
    
         
            +
                  # Query Managed Sub-account List (For Investor)(USER_DATA)
         
     | 
| 
      
 712 
     | 
    
         
            +
                  #
         
     | 
| 
      
 713 
     | 
    
         
            +
                  # GET /sapi/v1/managed-subaccount/info
         
     | 
| 
      
 714 
     | 
    
         
            +
                  #
         
     | 
| 
      
 715 
     | 
    
         
            +
                  # @param kwargs [Hash]
         
     | 
| 
      
 716 
     | 
    
         
            +
                  # @option kwargs [String] :email Status Managed sub-account email
         
     | 
| 
      
 717 
     | 
    
         
            +
                  # @option kwargs [Integer] :page Default: 1
         
     | 
| 
      
 718 
     | 
    
         
            +
                  # @option kwargs [Integer] :limit Default: 10, Max: 20
         
     | 
| 
      
 719 
     | 
    
         
            +
                  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
         
     | 
| 
      
 720 
     | 
    
         
            +
                  # @see https://developers.binance.com/docs/sub_account/managed-sub-account/Query-Managed-Sub-account-List
         
     | 
| 
      
 721 
     | 
    
         
            +
                  def sub_account_list(**kwargs)
         
     | 
| 
      
 722 
     | 
    
         
            +
                    @session.sign_request(:get, '/sapi/v1/managed-subaccount/info', params: kwargs)
         
     | 
| 
      
 723 
     | 
    
         
            +
                  end
         
     | 
| 
      
 724 
     | 
    
         
            +
             
     | 
| 
      
 725 
     | 
    
         
            +
                  # Enable or Disable IP Restriction for a Sub-account API Key (For Master Account)
         
     | 
| 
      
 726 
     | 
    
         
            +
                  #
         
     | 
| 
      
 727 
     | 
    
         
            +
                  # POST /sapi/v2/sub-account/subAccountApi/ipRestriction
         
     | 
| 
       576 
728 
     | 
    
         
             
                  #
         
     | 
| 
       577 
729 
     | 
    
         
             
                  # @param email  [String]
         
     | 
| 
       578 
730 
     | 
    
         
             
                  # @param subAccountApiKey [String]
         
     | 
| 
       579 
     | 
    
         
            -
                  # @param  
     | 
| 
      
 731 
     | 
    
         
            +
                  # @param status [String]
         
     | 
| 
      
 732 
     | 
    
         
            +
                  # @option kwargs [String] :ipAddress Insert static IP in batch, separated by commas.
         
     | 
| 
       580 
733 
     | 
    
         
             
                  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
         
     | 
| 
       581 
     | 
    
         
            -
                  # @see https://binance 
     | 
| 
       582 
     | 
    
         
            -
                  def  
     | 
| 
      
 734 
     | 
    
         
            +
                  # @see https://developers.binance.com/docs/sub_account/api-management/Add-IP-Restriction-for-Sub-Account-API-key
         
     | 
| 
      
 735 
     | 
    
         
            +
                  def sub_account_toggle_ip_restriction(email:, subAccountApiKey:, status:, **kwargs)
         
     | 
| 
       583 
736 
     | 
    
         
             
                    Binance::Utils::Validation.require_param('email', email)
         
     | 
| 
       584 
737 
     | 
    
         
             
                    Binance::Utils::Validation.require_param('subAccountApiKey', subAccountApiKey)
         
     | 
| 
       585 
     | 
    
         
            -
                    Binance::Utils::Validation.require_param(' 
     | 
| 
      
 738 
     | 
    
         
            +
                    Binance::Utils::Validation.require_param('status', status)
         
     | 
| 
       586 
739 
     | 
    
         | 
| 
       587 
     | 
    
         
            -
                    @session.sign_request(:post, '/sapi/ 
     | 
| 
      
 740 
     | 
    
         
            +
                    @session.sign_request(:post, '/sapi/v2/sub-account/subAccountApi/ipRestriction', params: kwargs.merge(
         
     | 
| 
       588 
741 
     | 
    
         
             
                      email: email,
         
     | 
| 
       589 
742 
     | 
    
         
             
                      subAccountApiKey: subAccountApiKey,
         
     | 
| 
       590 
     | 
    
         
            -
                       
     | 
| 
      
 743 
     | 
    
         
            +
                      status: status
         
     | 
| 
       591 
744 
     | 
    
         
             
                    ))
         
     | 
| 
       592 
745 
     | 
    
         
             
                  end
         
     | 
| 
       593 
746 
     | 
    
         | 
| 
         @@ -598,7 +751,7 @@ module Binance 
     | 
|
| 
       598 
751 
     | 
    
         
             
                  # @param email  [String]
         
     | 
| 
       599 
752 
     | 
    
         
             
                  # @param subAccountApiKey [String]
         
     | 
| 
       600 
753 
     | 
    
         
             
                  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
         
     | 
| 
       601 
     | 
    
         
            -
                  # @see https://binance 
     | 
| 
      
 754 
     | 
    
         
            +
                  # @see https://developers.binance.com/docs/sub_account/api-management/Get-IP-Restriction-for-a-Sub-account-API-Key
         
     | 
| 
       602 
755 
     | 
    
         
             
                  def sub_account_ip_list(email:, subAccountApiKey:, **kwargs)
         
     | 
| 
       603 
756 
     | 
    
         
             
                    Binance::Utils::Validation.require_param('email', email)
         
     | 
| 
       604 
757 
     | 
    
         
             
                    Binance::Utils::Validation.require_param('subAccountApiKey', subAccountApiKey)
         
     | 
| 
         @@ -617,7 +770,7 @@ module Binance 
     | 
|
| 
       617 
770 
     | 
    
         
             
                  # @param subAccountApiKey [String]
         
     | 
| 
       618 
771 
     | 
    
         
             
                  # @param ipAddress [String]
         
     | 
| 
       619 
772 
     | 
    
         
             
                  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
         
     | 
| 
       620 
     | 
    
         
            -
                  # @see https://binance 
     | 
| 
      
 773 
     | 
    
         
            +
                  # @see https://developers.binance.com/docs/sub_account/api-management/Get-IP-Restriction-for-a-Sub-account-API-Key
         
     | 
| 
       621 
774 
     | 
    
         
             
                  def sub_account_delete_ip_list(email:, subAccountApiKey:, ipAddress:, **kwargs)
         
     | 
| 
       622 
775 
     | 
    
         
             
                    Binance::Utils::Validation.require_param('email', email)
         
     | 
| 
       623 
776 
     | 
    
         
             
                    Binance::Utils::Validation.require_param('subAccountApiKey', subAccountApiKey)
         
     |