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:



503
504
505
506
507
508
509
510
511
512
513
# File 'lib/binance/spot/subaccount.rb', line 503

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_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:



139
140
141
# File 'lib/binance/spot/subaccount.rb', line 139

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:



523
524
525
526
527
# File 'lib/binance/spot/subaccount.rb', line 523

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:



601
602
603
604
605
606
607
608
609
610
611
# File 'lib/binance/spot/subaccount.rb', line 601

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:



155
156
157
158
159
160
161
162
163
# File 'lib/binance/spot/subaccount.rb', line 155

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:



181
182
183
184
185
186
187
# File 'lib/binance/spot/subaccount.rb', line 181

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:



483
484
485
486
487
488
489
490
491
# File 'lib/binance/spot/subaccount.rb', line 483

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:



252
253
254
255
256
257
258
# File 'lib/binance/spot/subaccount.rb', line 252

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:



209
210
211
212
213
214
215
# File 'lib/binance/spot/subaccount.rb', line 209

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_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:



269
270
271
272
273
274
275
276
277
# File 'lib/binance/spot/subaccount.rb', line 269

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:



289
290
291
292
293
294
295
# File 'lib/binance/spot/subaccount.rb', line 289

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_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:



306
307
308
309
310
311
312
313
314
# File 'lib/binance/spot/subaccount.rb', line 306

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:



330
331
332
333
334
335
336
337
338
339
340
341
342
# File 'lib/binance/spot/subaccount.rb', line 330

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:



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

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_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:



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

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:



240
241
242
# File 'lib/binance/spot/subaccount.rb', line 240

def (**kwargs)
  @session.sign_request(:get, '/sapi/v1/sub-account/margin/accountSummary', params: kwargs)
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:



356
357
358
359
360
361
362
363
364
365
366
367
368
# File 'lib/binance/spot/subaccount.rb', line 356

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:



197
198
199
# File 'lib/binance/spot/subaccount.rb', line 197

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:



562
563
564
565
566
567
568
569
570
571
572
# File 'lib/binance/spot/subaccount.rb', line 562

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_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:



423
424
425
# File 'lib/binance/spot/subaccount.rb', line 423

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:



401
402
403
404
405
406
407
408
409
# File 'lib/binance/spot/subaccount.rb', line 401

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:



380
381
382
383
384
385
386
387
388
389
390
# File 'lib/binance/spot/subaccount.rb', line 380

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:



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

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:



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

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:



540
541
542
543
544
545
546
547
548
549
550
# File 'lib/binance/spot/subaccount.rb', line 540

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