Module: Binance::Spot::Subaccount
- Included in:
- Binance::Spot
- Defined in:
- lib/binance/spot/subaccount.rb
Overview
all sub-account endpoints
Instance Method Summary collapse
-
#create_virtual_sub_account(subAccountString:, **kwargs) ⇒ Object
Create a Virtual Sub-account(For Master Account).
-
#deposit_to_sub_account(toEmail:, asset:, amount:, **kwargs) ⇒ Object
Deposit assets into the managed sub-account (For Investor Master Account).
-
#get_sub_account_assets(email:, **kwargs) ⇒ Object
Query Sub-account Assets (For Master Account).
-
#get_sub_account_futures_transfer_history(email:, futuresType:, **kwargs) ⇒ Object
Query Sub-account Futures Asset Transfer History (For Master Account).
-
#get_sub_account_list(**kwargs) ⇒ Object
Query Sub-account List (For Master Account).
-
#get_sub_account_spot_summary(**kwargs) ⇒ Object
Query Sub-account Spot Assets Summary (For Master Account).
-
#get_sub_account_spot_transfer_history(**kwargs) ⇒ Object
Query Sub-account Spot Asset Transfer History (For Master Account).
-
#sub_account_asset_details(email:, **kwargs) ⇒ Object
Query managed sub-account asset details (For Investor Master Account).
-
#sub_account_delete_ip_list(email:, subAccountApiKey:, ipAddress:, **kwargs) ⇒ Object
Delete IP List For a Sub-account API Key (For Master Account).
-
#sub_account_deposit_address(email:, coin:, **kwargs) ⇒ Object
Get Sub-account Deposit Address (For Master Account).
-
#sub_account_deposit_history(email:, **kwargs) ⇒ Object
Get Sub-account Deposit History (For Master Account).
-
#sub_account_enable_blvt(email:, enableBlvt:, **kwargs) ⇒ Object
Enable Leverage Token for Sub-account (For Master Account).
-
#sub_account_enable_futures(email:, **kwargs) ⇒ Object
Enable Futures for Sub-account (For Master Account).
-
#sub_account_enable_margin(email:, **kwargs) ⇒ Object
Enable Margin for Sub-account (For Master Account).
-
#sub_account_futures_account(email:, futuresType:, **kwargs) ⇒ Object
Get Detail on Sub-account’s Futures Account (For Master Account).
-
#sub_account_futures_account_summary(futuresType:, **kwargs) ⇒ Object
Get Summary of Sub-account’s Futures Account (For Master Account).
-
#sub_account_futures_internal_transfer(fromEmail:, toEmail:, futuresType:, asset:, amount:, **kwargs) ⇒ Object
Sub-account Futures Asset Transfer (For Master Account).
-
#sub_account_futures_position_risk(email:, futuresType:, **kwargs) ⇒ Object
Get Futures Position-Risk of Sub-account (For Master Account).
-
#sub_account_futures_transfer(email:, asset:, amount:, type:, **kwargs) ⇒ Object
Futures Transfer for Sub-account(For Master Account).
-
#sub_account_ip_list(email:, subAccountApiKey:, **kwargs) ⇒ Object
Get IP Restriction for a Sub-account API Key (For Master Account).
-
#sub_account_margin_account(email:, **kwargs) ⇒ Object
Get Detail on Sub-account’s Margin Account (For Master Account).
-
#sub_account_margin_account_summary(**kwargs) ⇒ Object
Get Summary of Sub-account’s Margin Account (For Master Account).
-
#sub_account_margin_transfer(email:, asset:, amount:, type:, **kwargs) ⇒ Object
Margin Transfer for Sub-account(For Master Account).
-
#sub_account_status(**kwargs) ⇒ Object
Get Sub-account’s Status on Margin/Futures(For Master Account).
-
#sub_account_toggle_ip_restriction(email:, subAccountApiKey:, status:, **kwargs) ⇒ Object
Enable or Disable IP Restriction for a Sub-account API Key (For Master Account).
-
#sub_account_transfer_sub_account_history(**kwargs) ⇒ Object
Sub-account Transfer History (For Sub-account).
-
#sub_account_transfer_to_master(asset:, amount:, **kwargs) ⇒ Object
Transfer to Sub-account of Same Master(For Sub-account).
-
#sub_account_transfer_to_sub(toEmail:, asset:, amount:, **kwargs) ⇒ Object
Transfer to Sub-account of Same Master(For Sub-account).
-
#universal_transfer(fromAccountType:, toAccountType:, asset:, amount:, **kwargs) ⇒ Object
Universal Transfer (For Master Account).
-
#universal_transfer_history(**kwargs) ⇒ Object
Query Universal Transfer History (For Master Account).
-
#withdraw_from_sub_account(fromEmail:, asset:, amount:, **kwargs) ⇒ Object
Withdrawl assets from the managed sub-account (For Investor Master Account).
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.
19 20 21 22 23 24 25 |
# File 'lib/binance/spot/subaccount.rb', line 19 def create_virtual_sub_account(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
503 504 505 506 507 508 509 510 511 512 513 |
# File 'lib/binance/spot/subaccount.rb', line 503 def deposit_to_sub_account(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
121 122 123 124 125 |
# File 'lib/binance/spot/subaccount.rb', line 121 def get_sub_account_assets(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
75 76 77 78 79 80 81 82 83 |
# File 'lib/binance/spot/subaccount.rb', line 75 def get_sub_account_futures_transfer_history(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
38 39 40 |
# File 'lib/binance/spot/subaccount.rb', line 38 def get_sub_account_list(**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.
139 140 141 |
# File 'lib/binance/spot/subaccount.rb', line 139 def get_sub_account_spot_summary(**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.
58 59 60 |
# File 'lib/binance/spot/subaccount.rb', line 58 def get_sub_account_spot_transfer_history(**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
523 524 525 526 527 |
# File 'lib/binance/spot/subaccount.rb', line 523 def sub_account_asset_details(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
601 602 603 604 605 606 607 608 609 610 611 |
# File 'lib/binance/spot/subaccount.rb', line 601 def sub_account_delete_ip_list(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
155 156 157 158 159 160 161 162 163 |
# File 'lib/binance/spot/subaccount.rb', line 155 def sub_account_deposit_address(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
181 182 183 184 185 186 187 |
# File 'lib/binance/spot/subaccount.rb', line 181 def sub_account_deposit_history(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
483 484 485 486 487 488 489 490 491 |
# File 'lib/binance/spot/subaccount.rb', line 483 def sub_account_enable_blvt(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
252 253 254 255 256 257 258 |
# File 'lib/binance/spot/subaccount.rb', line 252 def sub_account_enable_futures(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
209 210 211 212 213 214 215 |
# File 'lib/binance/spot/subaccount.rb', line 209 def sub_account_enable_margin(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
269 270 271 272 273 274 275 276 277 |
# File 'lib/binance/spot/subaccount.rb', line 269 def sub_account_futures_account(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
289 290 291 292 293 294 295 |
# File 'lib/binance/spot/subaccount.rb', line 289 def sub_account_futures_account_summary(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
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/binance/spot/subaccount.rb', line 97 def sub_account_futures_internal_transfer(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
306 307 308 309 310 311 312 313 314 |
# File 'lib/binance/spot/subaccount.rb', line 306 def sub_account_futures_position_risk(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
330 331 332 333 334 335 336 337 338 339 340 341 342 |
# File 'lib/binance/spot/subaccount.rb', line 330 def sub_account_futures_transfer(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
582 583 584 585 586 587 588 589 590 |
# File 'lib/binance/spot/subaccount.rb', line 582 def sub_account_ip_list(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
225 226 227 228 229 230 231 |
# File 'lib/binance/spot/subaccount.rb', line 225 def sub_account_margin_account(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
240 241 242 |
# File 'lib/binance/spot/subaccount.rb', line 240 def sub_account_margin_account_summary(**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
356 357 358 359 360 361 362 363 364 365 366 367 368 |
# File 'lib/binance/spot/subaccount.rb', line 356 def sub_account_margin_transfer(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
197 198 199 |
# File 'lib/binance/spot/subaccount.rb', line 197 def sub_account_status(**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
562 563 564 565 566 567 568 569 570 571 572 |
# File 'lib/binance/spot/subaccount.rb', line 562 def sub_account_toggle_ip_restriction(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
423 424 425 |
# File 'lib/binance/spot/subaccount.rb', line 423 def sub_account_transfer_sub_account_history(**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
401 402 403 404 405 406 407 408 409 |
# File 'lib/binance/spot/subaccount.rb', line 401 def sub_account_transfer_to_master(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
380 381 382 383 384 385 386 387 388 389 390 |
# File 'lib/binance/spot/subaccount.rb', line 380 def sub_account_transfer_to_sub(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.
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
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
540 541 542 543 544 545 546 547 548 549 550 |
# File 'lib/binance/spot/subaccount.rb', line 540 def withdraw_from_sub_account(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 |