module Binance::Spot::Subaccount

def create_virtual_sub_account(subAccountString:, **kwargs)

Other tags:
    See: https://developers.binance.com/docs/sub_account/account-management/Create-a-Virtual-Sub-account -

Options Hash: (**kwargs)
  • :recvWindow (Integer) -- The value cannot be greater than 60000

Parameters:
  • kwargs (Hash) --
  • subAccountString (String) --
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

def deposit_to_sub_account(toEmail:, asset:, amount:, **kwargs)

Other tags:
    See: https://developers.binance.com/docs/sub_account/managed-sub-account/Deposit-Assets-Into-The-Managed-Sub-account -

Options Hash: (**kwargs)
  • :recvWindow (Integer) -- The value cannot be greater than 60000

Parameters:
  • kwargs (Hash) --
  • amount (Float) --
  • asset (String) --
  • toEmail (String) --
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

def get_sub_account_assets(email:, **kwargs)

Other tags:
    See: https://developers.binance.com/docs/sub_account/asset-management/Query-Sub-account-Assets-V3 -

Options Hash: (**kwargs)
  • :recvWindow (Integer) -- The value cannot be greater than 60000

Parameters:
  • kwargs (Hash) --
  • email (String) --
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

def get_sub_account_futures_transfer_history(email:, futuresType:, **kwargs)

Other tags:
    See: https://developers.binance.com/docs/sub_account/asset-management/Query-Sub-account-Futures-Asset-Transfer-History -

Options Hash: (**kwargs)
  • :recvWindow (Integer) -- The value cannot be greater than 60000
  • :limit (Integer) -- Default value: 50, Max value: 500
  • :page (Integer) -- Default value: 1
  • :endTime (Integer) -- Default return the history with in 100 days
  • :startTime (Integer) -- Default return the history with in 100 days

Parameters:
  • kwargs (Hash) --
  • futuresType (Integer) -- 1:USDT-margined Futures, 2: Coin-margined Futures
  • email (String) --
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

def get_sub_account_list(**kwargs)

Other tags:
    See: https://developers.binance.com/docs/sub_account/account-management/Query-Sub-account-List -

Options Hash: (**kwargs)
  • :recvWindow (Integer) -- The value cannot be greater than 60000
  • :limit (Integer) --
  • :page (Integer) --
  • :isFreeze (String) -- true or false
  • :email (String) -- Sub-account email

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

def get_sub_account_spot_summary(**kwargs)

Other tags:
    See: https://developers.binance.com/docs/sub_account/asset-management/Query-Sub-account-Spot-Assets-Summary -

Options Hash: (**kwargs)
  • :recvWindow (Integer) -- The value cannot be greater than 60000
  • :size (Integer) -- default 10, max 20
  • :page (Integer) -- Default value: 1
  • :email (String) --

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

def get_sub_account_spot_transfer_history(**kwargs)

Other tags:
    See: https://developers.binance.com/docs/sub_account/asset-management/Query-Sub-account-Spot-Asset-Transfer-History -

Options Hash: (**kwargs)
  • :recvWindow (Integer) -- The value cannot be greater than 60000
  • :limit (Integer) -- Default value: 500
  • :page (Integer) -- Default value: 1
  • :endTime (Integer) --
  • :startTime (Integer) --
  • :toEmail (String) -- Sub-account email
  • :fromEmail (String) -- Sub-account email

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

def sub_account_asset_details(email:, **kwargs)

Other tags:
    See: https://developers.binance.com/docs/sub_account/managed-sub-account/Query-Managed-Sub-account-Asset-Details -

Options Hash: (**kwargs)
  • :recvWindow (Integer) -- The value cannot be greater than 60000

Parameters:
  • kwargs (Hash) --
  • email (String) --
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

def sub_account_delete_ip_list(email:, subAccountApiKey:, ipAddress:, **kwargs)

Other tags:
    See: https://developers.binance.com/docs/sub_account/api-management/Get-IP-Restriction-for-a-Sub-account-API-Key -

Options Hash: (**kwargs)
  • :recvWindow (Integer) -- The value cannot be greater than 60000

Parameters:
  • ipAddress (String) --
  • subAccountApiKey (String) --
  • email (String) --
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

def sub_account_deposit_address(email:, coin:, **kwargs)

Other tags:
    See: https://developers.binance.com/docs/sub_account/asset-management/Get-Sub-account-Deposit-Address -

Options Hash: (**kwargs)
  • :recvWindow (Integer) -- The value cannot be greater than 60000
  • :network (String) --

Parameters:
  • kwargs (Hash) --
  • coin (String) --
  • email (String) --
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

def sub_account_deposit_history(email:, **kwargs)

Other tags:
    See: https://developers.binance.com/docs/sub_account/asset-management/Get-Sub-account-Deposit-History -

Options Hash: (**kwargs)
  • :recvWindow (Integer) -- The value cannot be greater than 60000
  • :offset (String) --
  • :limit (String) --
  • :endTime (String) --
  • :startTime (String) --
  • :status (String) --
  • :coin (String) --

Parameters:
  • kwargs (Hash) --
  • email (String) --
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

def sub_account_enable_blvt(email:, enableBlvt:, **kwargs)

Other tags:
    See: https://developers.binance.com/docs/sub_account/account-management/Enable-Leverage-Token-for-Sub-account -

Options Hash: (**kwargs)
  • :recvWindow (Integer) -- The value cannot be greater than 60000

Parameters:
  • kwargs (Hash) --
  • enableBlvt (Boolean) -- Only true for now
  • email (String) --
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

def sub_account_enable_futures(email:, **kwargs)

Other tags:
    See: https://developers.binance.com/docs/sub_account/account-management/Enable-Futures-for-Sub-account -

Options Hash: (**kwargs)
  • :recvWindow (Integer) -- The value cannot be greater than 60000

Parameters:
  • kwargs (Hash) --
  • email (String) --
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

def sub_account_enable_margin(email:, **kwargs)

Other tags:
    See: https://developers.binance.com/docs/sub_account/account-management/Enable-Margin-for-Sub-account -

Options Hash: (**kwargs)
  • :recvWindow (Integer) -- The value cannot be greater than 60000
  • :email (String) --

Parameters:
  • kwargs (Hash) --
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

def sub_account_futures_account(email:, futuresType:, **kwargs)

Other tags:
    See: https://developers.binance.com/docs/sub_account/asset-management/Get-Detail-on-Sub-accounts-Futures-Account-V2 -

Options Hash: (**kwargs)
  • :recvWindow (Integer) -- The value cannot be greater than 60000

Parameters:
  • kwargs (Hash) --
  • futuresType (Integer) -- 1:USDT Margined Futures, 2:COIN Margined Futures
  • email (String) --
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

def sub_account_futures_account_summary(futuresType:, **kwargs)

Other tags:
    See: https://developers.binance.com/docs/sub_account/asset-management/Get-Summary-of-Sub-accounts-Futures-Account-V2 -

Options Hash: (**kwargs)
  • :recvWindow (Integer) -- The value cannot be greater than 60000
  • :limit (Integer) -- default:10, max:20
  • :page (Integer) -- default:1

Parameters:
  • kwargs (Hash) --
  • futuresType (Integer) -- 1:USDT Margined Futures, 2:COIN Margined Futures
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

def sub_account_futures_internal_transfer(fromEmail:, toEmail:, futuresType:, asset:, amount:, **kwargs)

Other tags:
    See: https://developers.binance.com/docs/sub_account/asset-management/Sub-account-Futures-Asset-Transfer -

Options Hash: (**kwargs)
  • :recvWindow (Integer) -- The value cannot be greater than 60000

Parameters:
  • kwargs (Hash) --
  • amount (Float) --
  • asset (String) --
  • futuresType (Integer) -- 1:USDT-margined Futures, 2: Coin-margined Futures
  • toEmail (String) --
  • fromEmail (String) --
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

def sub_account_futures_position_risk(email:, futuresType:, **kwargs)

Other tags:
    See: https://developers.binance.com/docs/sub_account/account-management/Get-Futures-Position-Risk-of-Sub-account-V2 -

Options Hash: (**kwargs)
  • :recvWindow (Integer) -- The value cannot be greater than 60000

Parameters:
  • kwargs (Hash) --
  • futuresType (Integer) -- 1:USDT Margined Futures, 2:COIN Margined Futures
  • email (String) --
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

def sub_account_futures_transfer(email:, asset:, amount:, type:, **kwargs)

Other tags:
    See: https://developers.binance.com/docs/sub_account/asset-management/Futures-Transfer-for-Sub-account -

Options Hash: (**kwargs)
  • :recvWindow (Integer) -- The value cannot be greater than 60000

Parameters:
  • kwargs (Hash) --
  • type (Integer) -- 1: transfer from subaccount's spot account to its USDT-margined futures account
  • amount (Float) --
  • asset (String) --
  • email (String) --
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

def sub_account_ip_list(email:, subAccountApiKey:, **kwargs)

Other tags:
    See: https://developers.binance.com/docs/sub_account/api-management/Get-IP-Restriction-for-a-Sub-account-API-Key -

Options Hash: (**kwargs)
  • :recvWindow (Integer) -- The value cannot be greater than 60000

Parameters:
  • subAccountApiKey (String) --
  • email (String) --
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

def sub_account_margin_account(email:, **kwargs)

Other tags:
    See: https://developers.binance.com/docs/sub_account/asset-management/Get-Detail-on-Sub-accounts-Margin-Account -

Options Hash: (**kwargs)
  • :recvWindow (Integer) -- The value cannot be greater than 60000

Parameters:
  • kwargs (Hash) --
  • email (String) --
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

def sub_account_margin_account_summary(**kwargs)

Other tags:
    See: https://developers.binance.com/docs/sub_account/asset-management/Get-Summary-of-Sub-accounts-Margin-Account -

Options Hash: (**kwargs)
  • :recvWindow (Integer) -- The value cannot be greater than 60000

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

def sub_account_margin_transfer(email:, asset:, amount:, type:, **kwargs)

Other tags:
    See: https://developers.binance.com/docs/sub_account/asset-management/Margin-Transfer-for-Sub-account -

Options Hash: (**kwargs)
  • :recvWindow (Integer) -- The value cannot be greater than 60000

Parameters:
  • kwargs (Hash) --
  • type (Integer) -- 1: transfer from subaccount's spot account to margin account
  • amount (Float) --
  • asset (String) --
  • email (String) --
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

def sub_account_status(**kwargs)

Other tags:
    See: https://developers.binance.com/docs/sub_account/account-management/Get-Sub-accounts-Status-on-Margin-Or-Futures -

Options Hash: (**kwargs)
  • :recvWindow (Integer) -- The value cannot be greater than 60000
  • :email (String) --

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

def sub_account_toggle_ip_restriction(email:, subAccountApiKey:, status:, **kwargs)

Other tags:
    See: https://developers.binance.com/docs/sub_account/api-management/Add-IP-Restriction-for-Sub-Account-API-key -

Options Hash: (**kwargs)
  • :recvWindow (Integer) -- The value cannot be greater than 60000
  • :ipAddress (String) -- Insert static IP in batch, separated by commas.

Parameters:
  • status (String) --
  • subAccountApiKey (String) --
  • email (String) --
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

def sub_account_transfer_sub_account_history(**kwargs)

Other tags:
    See: https://developers.binance.com/docs/sub_account/asset-management/Sub-account-Transfer-History -

Options Hash: (**kwargs)
  • :recvWindow (Integer) -- The value cannot be greater than 60000
  • :limit (Integer) --
  • :endTime (Integer) --
  • :startTime (Integer) --
  • :type (Integer) -- 1: transfer in, 2: transfer out
  • :asset (String) --

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

def sub_account_transfer_to_master(asset:, amount:, **kwargs)

Other tags:
    See: https://developers.binance.com/docs/sub_account/asset-management/Transfer-to-Master -

Options Hash: (**kwargs)
  • :recvWindow (Integer) -- The value cannot be greater than 60000

Parameters:
  • kwargs (Hash) --
  • amount (Float) --
  • asset (String) --
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

def sub_account_transfer_to_sub(toEmail:, asset:, amount:, **kwargs)

Other tags:
    See: https://developers.binance.com/docs/sub_account/asset-management/Transfer-to-Sub-account-of-Same-Master -

Options Hash: (**kwargs)
  • :recvWindow (Integer) -- The value cannot be greater than 60000

Parameters:
  • kwargs (Hash) --
  • amount (String) --
  • asset (String) --
  • toEmail (String) --
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

def universal_transfer(fromAccountType:, toAccountType:, asset:, amount:, **kwargs)

Other tags:
    See: https://developers.binance.com/docs/sub_account/asset-management/Universal-Transfer -

Options Hash: (**kwargs)
  • :recvWindow (Integer) -- The value cannot be greater than 60000
  • :toEmail (String) -- Transfer to master account by default if toEmail is not sent.
  • :fromEmail (String) -- Transfer from master account by default if fromEmail is not sent.

Parameters:
  • kwargs (Hash) --
  • amount (Float) --
  • asset (String) --
  • toAccountType (String) -- "SPOT","USDT_FUTURE","COIN_FUTURE"
  • fromAccountType (String) -- "SPOT","USDT_FUTURE","COIN_FUTURE"
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

def universal_transfer_history(**kwargs)

Other tags:
    See: https://developers.binance.com/docs/sub_account/asset-management/Query-Universal-Transfer-History -

Options Hash: (**kwargs)
  • :recvWindow (Integer) -- The value cannot be greater than 60000
  • :limit (Integer) -- Default 500, Max 500
  • :page (Integer) --
  • :endTime (Integer) --
  • :startTime (Integer) --
  • :toEmail (String) --
  • :fromEmail (String) --

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

def withdraw_from_sub_account(fromEmail:, asset:, amount:, **kwargs)

Other tags:
    See: https://developers.binance.com/docs/sub_account/managed-sub-account/Withdrawl-Assets-From-The-Managed-Sub-account -

Options Hash: (**kwargs)
  • :recvWindow (Integer) -- The value cannot be greater than 60000
  • :transferDate (Integer) --

Parameters:
  • kwargs (Hash) --
  • amount (Float) --
  • asset (String) --
  • fromEmail (String) --
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