Module: Binance::Spot::Subaccount

Included in:
Binance::Spot
Defined in:
lib/binance/spot/subaccount.rb

Overview

all sub-account endpoints

Instance Method Summary collapse

Instance Method Details

#create_virtual_sub_account(subAccountString:, **kwargs) ⇒ Object

Create a Virtual Sub-account(For Master Account)

POST /sapi/v1/sub-account/virtualSubAccount

This request will generate a virtual sub account under your master account.
You need to enable “trade” option for the api key which requests this endpoint.

Parameters:

  • subAccountString (String)
  • kwargs (Hash)

Options Hash (**kwargs):

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



19
20
21
22
23
24
25
# File 'lib/binance/spot/subaccount.rb', line 19

def (subAccountString:, **kwargs)
  Binance::Utils::Validation.require_param('subAccountString', subAccountString)

  @session.sign_request(:post, '/sapi/v1/sub-account/virtualSubAccount', params: kwargs.merge(
    subAccountString: subAccountString
  ))
end

#deposit_to_sub_account(toEmail:, asset:, amount:, **kwargs) ⇒ Object

Deposit assets into the managed sub-account (For Investor Master Account)

POST /sapi/v1/managed-subaccount/deposit

Parameters:

  • toEmail (String)
  • asset (String)
  • amount (Float)
  • kwargs (Hash)

Options Hash (**kwargs):

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



549
550
551
552
553
554
555
556
557
558
559
# File 'lib/binance/spot/subaccount.rb', line 549

def (toEmail:, asset:, amount:, **kwargs)
  Binance::Utils::Validation.require_param('toEmail', toEmail)
  Binance::Utils::Validation.require_param('asset', asset)
  Binance::Utils::Validation.require_param('amount', amount)

  @session.sign_request(:post, '/sapi/v1/managed-subaccount/deposit', params: kwargs.merge(
    toEmail: toEmail,
    asset: asset,
    amount: amount
  ))
end

#get_sub_account_assets(email:, **kwargs) ⇒ Object

Query Sub-account Assets (For Master Account)

GET /sapi/v3/sub-account/assets

Parameters:

  • email (String)
  • kwargs (Hash)

Options Hash (**kwargs):

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



121
122
123
124
125
# File 'lib/binance/spot/subaccount.rb', line 121

def (email:, **kwargs)
  Binance::Utils::Validation.require_param('email', email)

  @session.sign_request(:get, '/sapi/v3/sub-account/assets', params: kwargs.merge(email: email))
end

#get_sub_account_assets_v4(email:, **kwargs) ⇒ Object

Query Sub-account Assets (For Master Account)(USER_DATA)

GET /sapi/v4/sub-account/assets

Parameters:

  • email (String)
  • kwargs (Hash)

Options Hash (**kwargs):

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



135
136
137
138
139
# File 'lib/binance/spot/subaccount.rb', line 135

def (email:, **kwargs)
  Binance::Utils::Validation.require_param('email', email)

  @session.sign_request(:get, '/sapi/v4/sub-account/assets', params: kwargs.merge(email: email))
end

#get_sub_account_futures_transfer_history(email:, futuresType:, **kwargs) ⇒ Object

Query Sub-account Futures Asset Transfer History (For Master Account)

GET /sapi/v1/sub-account/futures/internalTransfer

Parameters:

  • email (String)
  • futuresType (Integer)

    1:USDT-margined Futures, 2: Coin-margined Futures

  • kwargs (Hash)

Options Hash (**kwargs):

  • :startTime (Integer)

    Default return the history with in 100 days

  • :endTime (Integer)

    Default return the history with in 100 days

  • :page (Integer)

    Default value: 1

  • :limit (Integer)

    Default value: 50, Max value: 500

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



75
76
77
78
79
80
81
82
83
# File 'lib/binance/spot/subaccount.rb', line 75

def (email:, futuresType:, **kwargs)
  Binance::Utils::Validation.require_param('email', email)
  Binance::Utils::Validation.require_param('futuresType', futuresType)

  @session.sign_request(:get, '/sapi/v1/sub-account/futures/internalTransfer', params: kwargs.merge(
    email: email,
    futuresType: futuresType
  ))
end

#get_sub_account_list(**kwargs) ⇒ Object

Query Sub-account List (For Master Account)

GET /sapi/v1/sub-account/list

Parameters:

  • kwargs (Hash)

Options Hash (**kwargs):

  • :email (String)

    Sub-account email

  • :isFreeze (String)

    true or false

  • :page (Integer)
  • :limit (Integer)
  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



38
39
40
# File 'lib/binance/spot/subaccount.rb', line 38

def (**kwargs)
  @session.sign_request(:get, '/sapi/v1/sub-account/list', params: kwargs)
end

#get_sub_account_spot_summary(**kwargs) ⇒ Object

Query Sub-account Spot Assets Summary (For Master Account)

GET /sapi/v1/sub-account/spotSummary

Get BTC valued asset summary of subaccounts.

Parameters:

  • kwargs (Hash)

Options Hash (**kwargs):

  • :email (String)
  • :page (Integer)

    Default value: 1

  • :size (Integer)

    default 10, max 20

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



153
154
155
# File 'lib/binance/spot/subaccount.rb', line 153

def (**kwargs)
  @session.sign_request(:get, '/sapi/v1/sub-account/spotSummary', params: kwargs)
end

#get_sub_account_spot_transfer_history(**kwargs) ⇒ Object

Query Sub-account Spot Asset Transfer History (For Master Account)

GET /sapi/v1/sub-account/sub/transfer/history

fromEmail and toEmail cannot be sent at the same time.
Return fromEmail equal master account email by default.

Parameters:

  • kwargs (Hash)

Options Hash (**kwargs):

  • :fromEmail (String)

    Sub-account email

  • :toEmail (String)

    Sub-account email

  • :startTime (Integer)
  • :endTime (Integer)
  • :page (Integer)

    Default value: 1

  • :limit (Integer)

    Default value: 500

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



58
59
60
# File 'lib/binance/spot/subaccount.rb', line 58

def (**kwargs)
  @session.sign_request(:get, '/sapi/v1/sub-account/sub/transfer/history', params: kwargs)
end

#sub_account_asset_details(email:, **kwargs) ⇒ Object

Query managed sub-account asset details (For Investor Master Account)

GET /sapi/v1/managed-subaccount/asset

Parameters:

  • email (String)
  • kwargs (Hash)

Options Hash (**kwargs):

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



569
570
571
572
573
# File 'lib/binance/spot/subaccount.rb', line 569

def (email:, **kwargs)
  Binance::Utils::Validation.require_param('email', email)

  @session.sign_request(:get, '/sapi/v1/managed-subaccount/asset', params: kwargs.merge(email: email))
end

#sub_account_delete_ip_list(email:, subAccountApiKey:, ipAddress:, **kwargs) ⇒ Object

Delete IP List For a Sub-account API Key (For Master Account)

DELETE /sapi/v1/sub-account/subAccountApi/ipRestriction/ipList

Parameters:

  • email (String)
  • subAccountApiKey (String)
  • ipAddress (String)
  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



774
775
776
777
778
779
780
781
782
783
784
# File 'lib/binance/spot/subaccount.rb', line 774

def (email:, subAccountApiKey:, ipAddress:, **kwargs)
  Binance::Utils::Validation.require_param('email', email)
  Binance::Utils::Validation.require_param('subAccountApiKey', subAccountApiKey)
  Binance::Utils::Validation.require_param('ipAddress', ipAddress)

  @session.sign_request(:delete, '/sapi/v1/sub-account/subAccountApi/ipRestriction/ipList', params: kwargs.merge(
    email: email,
    subAccountApiKey: subAccountApiKey,
    ipAddress: ipAddress
  ))
end

#sub_account_deposit_address(email:, coin:, **kwargs) ⇒ Object

Get Sub-account Deposit Address (For Master Account)

GET /sapi/v1/capital/deposit/subAddress

Fetch sub-account deposit address

Parameters:

  • email (String)
  • coin (String)
  • kwargs (Hash)

Options Hash (**kwargs):

  • :network (String)
  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



169
170
171
172
173
174
175
176
177
# File 'lib/binance/spot/subaccount.rb', line 169

def (email:, coin:, **kwargs)
  Binance::Utils::Validation.require_param('email', email)
  Binance::Utils::Validation.require_param('coin', coin)

  @session.sign_request(:get, '/sapi/v1/capital/deposit/subAddress', params: kwargs.merge(
    email: email,
    coin: coin
  ))
end

#sub_account_deposit_history(email:, **kwargs) ⇒ Object

Get Sub-account Deposit History (For Master Account)

GET /sapi/v1/capital/deposit/subHisrec

Fetch sub-account deposit history

Parameters:

  • email (String)
  • kwargs (Hash)

Options Hash (**kwargs):

  • :coin (String)
  • :status (String)
  • :startTime (String)
  • :endTime (String)
  • :limit (String)
  • :offset (String)
  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



195
196
197
198
199
200
201
# File 'lib/binance/spot/subaccount.rb', line 195

def (email:, **kwargs)
  Binance::Utils::Validation.require_param('email', email)

  @session.sign_request(:get, '/sapi/v1/capital/deposit/subHisrec', params: kwargs.merge(
    email: email
  ))
end

#sub_account_enable_blvt(email:, enableBlvt:, **kwargs) ⇒ Object

Enable Leverage Token for Sub-account (For Master Account)

POST /sapi/v1/sub-account/blvt/enable

Parameters:

  • email (String)
  • enableBlvt (Boolean)

    Only true for now

  • kwargs (Hash)

Options Hash (**kwargs):

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



529
530
531
532
533
534
535
536
537
# File 'lib/binance/spot/subaccount.rb', line 529

def (email:, enableBlvt:, **kwargs)
  Binance::Utils::Validation.require_param('email', email)
  Binance::Utils::Validation.require_param('enableBlvt', enableBlvt)

  @session.sign_request(:post, '/sapi/v1/sub-account/blvt/enable', params: kwargs.merge(
    email: email,
    enableBlvt: enableBlvt
  ))
end

#sub_account_enable_futures(email:, **kwargs) ⇒ Object

Enable Futures for Sub-account (For Master Account)

POST /sapi/v1/sub-account/futures/enable

Parameters:

  • email (String)
  • kwargs (Hash)

Options Hash (**kwargs):

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



282
283
284
285
286
287
288
# File 'lib/binance/spot/subaccount.rb', line 282

def (email:, **kwargs)
  Binance::Utils::Validation.require_param('email', email)

  @session.sign_request(:post, '/sapi/v1/sub-account/futures/enable', params: kwargs.merge(
    email: email
  ))
end

#sub_account_enable_margin(email:, **kwargs) ⇒ Object

Enable Margin for Sub-account (For Master Account)

POST /sapi/v1/sub-account/margin/enable

Parameters:

  • kwargs (Hash)

Options Hash (**kwargs):

  • :email (String)
  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



223
224
225
226
227
228
229
# File 'lib/binance/spot/subaccount.rb', line 223

def (email:, **kwargs)
  Binance::Utils::Validation.require_param('email', email)

  @session.sign_request(:post, '/sapi/v1/sub-account/margin/enable', params: kwargs.merge(
    email: email
  ))
end

#sub_account_enable_options(email:, **kwargs) ⇒ Object

Enable Options for Sub-account(For Master Account)(USER_DATA)

POST /sapi/v1/sub-account/eoptions/enable

Parameters:

  • email (String)

    Sub user email

  • kwargs (Hash)

Options Hash (**kwargs):

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



239
240
241
242
243
244
245
# File 'lib/binance/spot/subaccount.rb', line 239

def (email:, **kwargs)
  Binance::Utils::Validation.require_param('email', email)

  @session.sign_request(:post, '/sapi/v1/sub-account/eoptions/enable', params: kwargs.merge(
    email: email
  ))
end

#sub_account_futures_account(email:, futuresType:, **kwargs) ⇒ Object

Get Detail on Sub-account’s Futures Account (For Master Account)

GET /sapi/v2/sub-account/futures/account

Parameters:

  • email (String)
  • futuresType (Integer)

    1:USDT Margined Futures, 2:COIN Margined Futures

  • kwargs (Hash)

Options Hash (**kwargs):

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



299
300
301
302
303
304
305
306
307
# File 'lib/binance/spot/subaccount.rb', line 299

def (email:, futuresType:, **kwargs)
  Binance::Utils::Validation.require_param('email', email)
  Binance::Utils::Validation.require_param('futuresType', futuresType)

  @session.sign_request(:get, '/sapi/v2/sub-account/futures/account', params: kwargs.merge(
    email: email,
    futuresType: futuresType
  ))
end

#sub_account_futures_account_summary(futuresType:, **kwargs) ⇒ Object

Get Summary of Sub-account’s Futures Account (For Master Account)

GET /sapi/v2/sub-account/futures/accountSummary

Parameters:

  • futuresType (Integer)

    1:USDT Margined Futures, 2:COIN Margined Futures

  • kwargs (Hash)

Options Hash (**kwargs):

  • :page (Integer)

    default:1

  • :limit (Integer)

    default:10, max:20

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



319
320
321
322
323
324
325
# File 'lib/binance/spot/subaccount.rb', line 319

def (futuresType:, **kwargs)
  Binance::Utils::Validation.require_param('futuresType', futuresType)

  @session.sign_request(:get, '/sapi/v2/sub-account/futures/accountSummary', params: kwargs.merge(
    futuresType: futuresType
  ))
end

#sub_account_futures_asset_details(email:, **kwargs) ⇒ Object

Query Managed Sub-account Futures Asset Details(For Investor Master Account)(USER_DATA)

GET /sapi/v1/managed-subaccount/fetch-future-asset

Parameters:

  • email (String)
  • kwargs (Hash)

Options Hash (**kwargs):

  • :accountType (String)

    No input or input “USDT_FUTURE” to get UM Futures account details. Input “COIN_FUTURE” to get CM Futures account details.

See Also:



597
598
599
600
601
# File 'lib/binance/spot/subaccount.rb', line 597

def (email:, **kwargs)
  Binance::Utils::Validation.require_param('email', email)

  @session.sign_request(:get, '/sapi/v1/managed-subaccount/fetch-future-asset', params: kwargs.merge(email: email))
end

#sub_account_futures_internal_transfer(fromEmail:, toEmail:, futuresType:, asset:, amount:, **kwargs) ⇒ Object

Sub-account Futures Asset Transfer (For Master Account)

POST /sapi/v1/sub-account/futures/internalTransfer

Parameters:

  • fromEmail (String)
  • toEmail (String)
  • futuresType (Integer)

    1:USDT-margined Futures, 2: Coin-margined Futures

  • asset (String)
  • amount (Float)
  • kwargs (Hash)

Options Hash (**kwargs):

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/binance/spot/subaccount.rb', line 97

def (fromEmail:, toEmail:, futuresType:, asset:, amount:, **kwargs)
  Binance::Utils::Validation.require_param('fromEmail', fromEmail)
  Binance::Utils::Validation.require_param('toEmail', toEmail)
  Binance::Utils::Validation.require_param('futuresType', futuresType)
  Binance::Utils::Validation.require_param('asset', asset)
  Binance::Utils::Validation.require_param('amount', amount)

  @session.sign_request(:post, '/sapi/v1/sub-account/futures/internalTransfer', params: kwargs.merge(
    fromEmail: fromEmail,
    toEmail: toEmail,
    futuresType: futuresType,
    asset: asset,
    amount: amount
  ))
end

#sub_account_futures_position_risk(email:, futuresType:, **kwargs) ⇒ Object

Get Futures Position-Risk of Sub-account (For Master Account)

GET /sapi/v2/sub-account/futures/positionRisk

Parameters:

  • email (String)
  • futuresType (Integer)

    1:USDT Margined Futures, 2:COIN Margined Futures

  • kwargs (Hash)

Options Hash (**kwargs):

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



336
337
338
339
340
341
342
343
344
# File 'lib/binance/spot/subaccount.rb', line 336

def (email:, futuresType:, **kwargs)
  Binance::Utils::Validation.require_param('email', email)
  Binance::Utils::Validation.require_param('futuresType', futuresType)

  @session.sign_request(:get, '/sapi/v2/sub-account/futures/positionRisk', params: kwargs.merge(
    email: email,
    futuresType: futuresType
  ))
end

#sub_account_futures_transfer(email:, asset:, amount:, type:, **kwargs) ⇒ Object

Futures Transfer for Sub-account(For Master Account)

POST /sapi/v1/sub-account/futures/transfer

Parameters:

  • email (String)
  • asset (String)
  • amount (Float)
  • type (Integer)

    1: transfer from subaccount’s spot account to its USDT-margined futures account
    2: transfer from subaccount’s USDT-margined futures account to its spot account
    3: transfer from subaccount’s spot account to its COIN-margined futures account
    4:transfer from subaccount’s COIN-margined futures account to its spot account

  • kwargs (Hash)

Options Hash (**kwargs):

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



376
377
378
379
380
381
382
383
384
385
386
387
388
# File 'lib/binance/spot/subaccount.rb', line 376

def (email:, asset:, amount:, type:, **kwargs)
  Binance::Utils::Validation.require_param('email', email)
  Binance::Utils::Validation.require_param('asset', asset)
  Binance::Utils::Validation.require_param('amount', amount)
  Binance::Utils::Validation.require_param('type', type)

  @session.sign_request(:post, '/sapi/v1/sub-account/futures/transfer', params: kwargs.merge(
    email: email,
    asset: asset,
    amount: amount,
    type: type
  ))
end

#sub_account_ip_list(email:, subAccountApiKey:, **kwargs) ⇒ Object

Get IP Restriction for a Sub-account API Key (For Master Account)

GET /sapi/v1/sub-account/subAccountApi/ipRestriction

Parameters:

  • email (String)
  • subAccountApiKey (String)
  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



755
756
757
758
759
760
761
762
763
# File 'lib/binance/spot/subaccount.rb', line 755

def (email:, subAccountApiKey:, **kwargs)
  Binance::Utils::Validation.require_param('email', email)
  Binance::Utils::Validation.require_param('subAccountApiKey', subAccountApiKey)

  @session.sign_request(:get, '/sapi/v1/sub-account/subAccountApi/ipRestriction', params: kwargs.merge(
    email: email,
    subAccountApiKey: subAccountApiKey
  ))
end

#sub_account_list(**kwargs) ⇒ Object

Query Managed Sub-account List (For Investor)(USER_DATA)

GET /sapi/v1/managed-subaccount/info

Parameters:

  • kwargs (Hash)

Options Hash (**kwargs):

  • :email (String)

    Status Managed sub-account email

  • :page (Integer)

    Default: 1

  • :limit (Integer)

    Default: 10, Max: 20

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



721
722
723
# File 'lib/binance/spot/subaccount.rb', line 721

def (**kwargs)
  @session.sign_request(:get, '/sapi/v1/managed-subaccount/info', params: kwargs)
end

#sub_account_margin_account(email:, **kwargs) ⇒ Object

Get Detail on Sub-account’s Margin Account (For Master Account)

GET /sapi/v1/sub-account/margin/account

Parameters:

  • email (String)
  • kwargs (Hash)

Options Hash (**kwargs):

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



255
256
257
258
259
260
261
# File 'lib/binance/spot/subaccount.rb', line 255

def (email:, **kwargs)
  Binance::Utils::Validation.require_param('email', email)

  @session.sign_request(:get, '/sapi/v1/sub-account/margin/account', params: kwargs.merge(
    email: email
  ))
end

#sub_account_margin_account_summary(**kwargs) ⇒ Object

Get Summary of Sub-account’s Margin Account (For Master Account)

GET /sapi/v1/sub-account/margin/accountSummary

Parameters:

  • kwargs (Hash)

Options Hash (**kwargs):

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



270
271
272
# File 'lib/binance/spot/subaccount.rb', line 270

def (**kwargs)
  @session.sign_request(:get, '/sapi/v1/sub-account/margin/accountSummary', params: kwargs)
end

#sub_account_margin_asset_details(email:, **kwargs) ⇒ Object

Query Managed Sub-account Margin Asset Details(For Investor Master Account)(USER_DATA)

GET /sapi/v1/managed-subaccount/marginAsset

Parameters:

  • email (String)
  • kwargs (Hash)

Options Hash (**kwargs):

  • :accountType (String)

    No input or input “MARGIN” to get Cross Margin account details. Input “ISOLATED_MARGIN” to get Isolated Margin account details.

See Also:



583
584
585
586
587
# File 'lib/binance/spot/subaccount.rb', line 583

def (email:, **kwargs)
  Binance::Utils::Validation.require_param('email', email)

  @session.sign_request(:get, '/sapi/v1/managed-subaccount/marginAsset', params: kwargs.merge(email: email))
end

#sub_account_margin_transfer(email:, asset:, amount:, type:, **kwargs) ⇒ Object

Margin Transfer for Sub-account(For Master Account)

POST /sapi/v1/sub-account/margin/transfer

Parameters:

  • email (String)
  • asset (String)
  • amount (Float)
  • type (Integer)

    1: transfer from subaccount’s spot account to margin account
    2: transfer from subaccount’s margin account to its spot account

  • kwargs (Hash)

Options Hash (**kwargs):

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



402
403
404
405
406
407
408
409
410
411
412
413
414
# File 'lib/binance/spot/subaccount.rb', line 402

def (email:, asset:, amount:, type:, **kwargs)
  Binance::Utils::Validation.require_param('email', email)
  Binance::Utils::Validation.require_param('asset', asset)
  Binance::Utils::Validation.require_param('amount', amount)
  Binance::Utils::Validation.require_param('type', type)

  @session.sign_request(:post, '/sapi/v1/sub-account/margin/transfer', params: kwargs.merge(
    email: email,
    asset: asset,
    amount: amount,
    type: type
  ))
end

#sub_account_status(**kwargs) ⇒ Object

Get Sub-account’s Status on Margin/Futures(For Master Account)

GET /sapi/v1/sub-account/status

Parameters:

  • kwargs (Hash)

Options Hash (**kwargs):

  • :email (String)
  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



211
212
213
# File 'lib/binance/spot/subaccount.rb', line 211

def (**kwargs)
  @session.sign_request(:get, '/sapi/v1/sub-account/status', params: kwargs)
end

#sub_account_toggle_ip_restriction(email:, subAccountApiKey:, status:, **kwargs) ⇒ Object

Enable or Disable IP Restriction for a Sub-account API Key (For Master Account)

POST /sapi/v2/sub-account/subAccountApi/ipRestriction

Parameters:

  • email (String)
  • subAccountApiKey (String)
  • status (String)
  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :ipAddress (String)

    Insert static IP in batch, separated by commas.

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



735
736
737
738
739
740
741
742
743
744
745
# File 'lib/binance/spot/subaccount.rb', line 735

def (email:, subAccountApiKey:, status:, **kwargs)
  Binance::Utils::Validation.require_param('email', email)
  Binance::Utils::Validation.require_param('subAccountApiKey', subAccountApiKey)
  Binance::Utils::Validation.require_param('status', status)

  @session.sign_request(:post, '/sapi/v2/sub-account/subAccountApi/ipRestriction', params: kwargs.merge(
    email: email,
    subAccountApiKey: subAccountApiKey,
    status: status
  ))
end

#sub_account_transaction_statistics(email:, **kwargs) ⇒ Object

Query Sub-account Transaction Statistics(For Master Account)(USER_DATA)

GET /sapi/v1/sub-account/transaction-statistics

Parameters:

  • email (String)

    Sub user email

  • kwargs (Hash)

Options Hash (**kwargs):

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



354
355
356
357
358
359
360
# File 'lib/binance/spot/subaccount.rb', line 354

def (email:, **kwargs)
  Binance::Utils::Validation.require_param('email', email)

  @session.sign_request(:get, '/sapi/v1/sub-account/transaction-statistics', params: kwargs.merge(
    email: email
  ))
end

#sub_account_transfer_log(email:, startTime:, endTime:, page:, limit:, **kwargs) ⇒ Object

Query Managed Sub Account Transfer Log(For Trading Team Master Account)(USER_DATA)

GET /sapi/v1/managed-subaccount/queryTransLogForTradeParent

Parameters:

  • email (String)

    Managed Sub Account Email

  • startTime (Integer)
  • endTime (Integer)
  • page (Integer)
  • limit (Integer)

    Limit (Max: 500)

  • kwargs (Hash)

Options Hash (**kwargs):

  • :transfers (String)

    Transfer Direction (FROM/TO)

  • :transferFunctionAccountType (String)

    Transfer function account type (SPOT/MARGIN/ISOLATED_MARGIN/USDT_FUTURE/COIN_FUTURE)

See Also:



639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
# File 'lib/binance/spot/subaccount.rb', line 639

def (email:, startTime:, endTime:, page:, limit:, **kwargs)
  Binance::Utils::Validation.require_param('email', email)
  Binance::Utils::Validation.require_param('startTime', startTime)
  Binance::Utils::Validation.require_param('endTime', endTime)
  Binance::Utils::Validation.require_param('page', page)
  Binance::Utils::Validation.require_param('limit', limit)

  @session.sign_request(:get, '/sapi/v1/managed-subaccount/queryTransLogForTradeParent', params: kwargs.merge(
    email: email,
    startTime: startTime,
    endTime: endTime,
    page: page,
    limit: limit
  ))
end

#sub_account_transfer_log_investor(email:, startTime:, endTime:, page:, limit:, **kwargs) ⇒ Object

Query Managed Sub Account Transfer Log (For Investor Master Account)(USER_DATA)

GET /sapi/v1/managed-subaccount/queryTransLogForInvestor

Parameters:

  • email (String)

    Managed Sub Account Email

  • startTime (Integer)
  • endTime (Integer)
  • page (Integer)
  • limit (Integer)

    Limit (Max: 500)

  • kwargs (Hash)

Options Hash (**kwargs):

  • :transfers (String)

    Transfer Direction (FROM/TO)

  • :transferFunctionAccountType (String)

    Transfer function account type (SPOT/MARGIN/ISOLATED_MARGIN/USDT_FUTURE/COIN_FUTURE)

See Also:



695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
# File 'lib/binance/spot/subaccount.rb', line 695

def (email:, startTime:, endTime:, page:, limit:, **kwargs)
  Binance::Utils::Validation.require_param('email', email)
  Binance::Utils::Validation.require_param('startTime', startTime)
  Binance::Utils::Validation.require_param('endTime', endTime)
  Binance::Utils::Validation.require_param('page', page)
  Binance::Utils::Validation.require_param('limit', limit)

  @session.sign_request(:get, '/sapi/v1/managed-subaccount/queryTransLogForInvestor', params: kwargs.merge(
    email: email,
    startTime: startTime,
    endTime: endTime,
    page: page,
    limit: limit
  ))
end

#sub_account_transfer_log_sub_account(startTime:, endTime:, page:, limit:, **kwargs) ⇒ Object

Query Managed Sub Account Transfer Log (For Trading Team Sub Account)(USER_DATA)

GET /sapi/v1/managed-subaccount/query-trans-log

Parameters:

  • startTime (Integer)
  • endTime (Integer)
  • page (Integer)
  • limit (Integer)

    Limit (Max: 500)

  • kwargs (Hash)

Options Hash (**kwargs):

  • :transfers (String)

    Transfer Direction (FROM/TO)

  • :transferFunctionAccountType (String)

    Transfer function account type (SPOT/MARGIN/ISOLATED_MARGIN/USDT_FUTURE/COIN_FUTURE)

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



668
669
670
671
672
673
674
675
676
677
678
679
680
# File 'lib/binance/spot/subaccount.rb', line 668

def (startTime:, endTime:, page:, limit:, **kwargs)
  Binance::Utils::Validation.require_param('startTime', startTime)
  Binance::Utils::Validation.require_param('endTime', endTime)
  Binance::Utils::Validation.require_param('page', page)
  Binance::Utils::Validation.require_param('limit', limit)

  @session.sign_request(:get, '/sapi/v1/managed-subaccount/query-trans-log', params: kwargs.merge(
    startTime: startTime,
    endTime: endTime,
    page: page,
    limit: limit
  ))
end

#sub_account_transfer_sub_account_history(**kwargs) ⇒ Object

Sub-account Transfer History (For Sub-account)

GET /sapi/v1/sub-account/transfer/subUserHistory

Parameters:

  • kwargs (Hash)

Options Hash (**kwargs):

  • :asset (String)
  • :type (Integer)

    1: transfer in, 2: transfer out

  • :startTime (Integer)
  • :endTime (Integer)
  • :limit (Integer)
  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



469
470
471
# File 'lib/binance/spot/subaccount.rb', line 469

def (**kwargs)
  @session.sign_request(:get, '/sapi/v1/sub-account/transfer/subUserHistory', params: kwargs)
end

#sub_account_transfer_to_master(asset:, amount:, **kwargs) ⇒ Object

Transfer to Sub-account of Same Master(For Sub-account)

POST /sapi/v1/sub-account/transfer/subToMaster

Parameters:

  • asset (String)
  • amount (Float)
  • kwargs (Hash)

Options Hash (**kwargs):

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



447
448
449
450
451
452
453
454
455
# File 'lib/binance/spot/subaccount.rb', line 447

def (asset:, amount:, **kwargs)
  Binance::Utils::Validation.require_param('asset', asset)
  Binance::Utils::Validation.require_param('amount', amount)

  @session.sign_request(:post, '/sapi/v1/sub-account/transfer/subToMaster', params: kwargs.merge(
    asset: asset,
    amount: amount
  ))
end

#sub_account_transfer_to_sub(toEmail:, asset:, amount:, **kwargs) ⇒ Object

Transfer to Sub-account of Same Master(For Sub-account)

POST /sapi/v1/sub-account/transfer/subToSub

Parameters:

  • toEmail (String)
  • asset (String)
  • amount (String)
  • kwargs (Hash)

Options Hash (**kwargs):

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



426
427
428
429
430
431
432
433
434
435
436
# File 'lib/binance/spot/subaccount.rb', line 426

def (toEmail:, asset:, amount:, **kwargs)
  Binance::Utils::Validation.require_param('toEmail', toEmail)
  Binance::Utils::Validation.require_param('asset', asset)
  Binance::Utils::Validation.require_param('amount', amount)

  @session.sign_request(:post, '/sapi/v1/sub-account/transfer/subToSub', params: kwargs.merge(
    toEmail: toEmail,
    asset: asset,
    amount: amount
  ))
end

#universal_transfer(fromAccountType:, toAccountType:, asset:, amount:, **kwargs) ⇒ Object

Universal Transfer (For Master Account)

POST /sapi/v1/sub-account/universalTransfer

You need to enable “internal transfer” option for the api key which requests this endpoint.
Transfer between futures accounts is not supported.

Parameters:

  • fromAccountType (String)

    “SPOT”,“USDT_FUTURE”,“COIN_FUTURE”

  • toAccountType (String)

    “SPOT”,“USDT_FUTURE”,“COIN_FUTURE”

  • asset (String)
  • amount (Float)
  • kwargs (Hash)

Options Hash (**kwargs):

  • :fromEmail (String)

    Transfer from master account by default if fromEmail is not sent.

  • :toEmail (String)

    Transfer to master account by default if toEmail is not sent.

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



489
490
491
492
493
494
495
496
497
498
499
500
501
# File 'lib/binance/spot/subaccount.rb', line 489

def universal_transfer(fromAccountType:, toAccountType:, asset:, amount:, **kwargs)
  Binance::Utils::Validation.require_param('fromAccountType', fromAccountType)
  Binance::Utils::Validation.require_param('toAccountType', toAccountType)
  Binance::Utils::Validation.require_param('asset', asset)
  Binance::Utils::Validation.require_param('amount', amount)

  @session.sign_request(:post, '/sapi/v1/sub-account/universalTransfer', params: kwargs.merge(
    fromAccountType: fromAccountType,
    toAccountType: toAccountType,
    asset: asset,
    amount: amount
  ))
end

#universal_transfer_history(**kwargs) ⇒ Object

Query Universal Transfer History (For Master Account)

GET /sapi/v1/sub-account/universalTransfer

Parameters:

  • kwargs (Hash)

Options Hash (**kwargs):

  • :fromEmail (String)
  • :toEmail (String)
  • :startTime (Integer)
  • :endTime (Integer)
  • :page (Integer)
  • :limit (Integer)

    Default 500, Max 500

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



516
517
518
# File 'lib/binance/spot/subaccount.rb', line 516

def universal_transfer_history(**kwargs)
  @session.sign_request(:get, '/sapi/v1/sub-account/universalTransfer', params: kwargs)
end

#withdraw_from_sub_account(fromEmail:, asset:, amount:, **kwargs) ⇒ Object

Withdrawl assets from the managed sub-account (For Investor Master Account)

POST /sapi/v1/managed-subaccount/withdraw

Parameters:

  • fromEmail (String)
  • asset (String)
  • amount (Float)
  • kwargs (Hash)

Options Hash (**kwargs):

  • :transferDate (Integer)
  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



614
615
616
617
618
619
620
621
622
623
624
# File 'lib/binance/spot/subaccount.rb', line 614

def (fromEmail:, asset:, amount:, **kwargs)
  Binance::Utils::Validation.require_param('fromEmail', fromEmail)
  Binance::Utils::Validation.require_param('asset', asset)
  Binance::Utils::Validation.require_param('amount', amount)

  @session.sign_request(:post, '/sapi/v1/managed-subaccount/withdraw', params: kwargs.merge(
    fromEmail: fromEmail,
    asset: asset,
    amount: amount
  ))
end