Module: Binance::Spot::Wallet

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

Overview

all wallet endpoints

Instance Method Summary collapse

Instance Method Details

#account_snapshot(type:, **kwargs) ⇒ Object

Daily Account Snapshot (USER_DATA)

GET /sapi/v1/accountSnapshot

Parameters:

  • type (String)

    “SPOT”, “MARGIN”, “FUTURES”

  • kwargs (Hash)

Options Hash (**kwargs):

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

    min 5, max 30, default 5

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



43
44
45
46
47
48
49
# File 'lib/binance/spot/wallet.rb', line 43

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

  @session.sign_request(:get, '/sapi/v1/accountSnapshot', params: kwargs.merge(
    type: type
  ))
end

#account_status(**kwargs) ⇒ Object

Account Status (USER_DATA)

GET /sapi/v1/account/status

Fetch account status detail.

Parameters:

  • kwargs (Hash)

Options Hash (**kwargs):

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



161
162
163
# File 'lib/binance/spot/wallet.rb', line 161

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

#api_key_permission(**kwargs) ⇒ Object

Get API Key Permission (USER_DATA)

GET /sapi/v1/account/apiRestrictions

Parameters:

  • kwargs (Hash)

Options Hash (**kwargs):

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



311
312
313
# File 'lib/binance/spot/wallet.rb', line 311

def api_key_permission(**kwargs)
  @session.sign_request(:get, '/sapi/v1/account/apiRestrictions', params: kwargs)
end

#api_trading_status(**kwargs) ⇒ Object

Account API Trading Status (USER_DATA)

GET /sapi/v1/account/apiTradingStatus

Fetch account api trading status detail.

Parameters:

  • kwargs (Hash)

Options Hash (**kwargs):

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



174
175
176
# File 'lib/binance/spot/wallet.rb', line 174

def api_trading_status(**kwargs)
  @session.sign_request(:get, '/sapi/v1/account/apiTradingStatus', params: kwargs)
end

#asset_detail(**kwargs) ⇒ Object

Asset Detail (USER_DATA)

GET /sapi/v1/asset/assetDetail

Parameters:

  • kwargs (Hash)

Options Hash (**kwargs):

  • :asset (String)
  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



232
233
234
# File 'lib/binance/spot/wallet.rb', line 232

def asset_detail(**kwargs)
  @session.sign_request(:get, '/sapi/v1/asset/assetDetail', params: kwargs)
end

#asset_devidend_record(**kwargs) ⇒ Object

Asset Dividend Record (USER_DATA)

GET /sapi/v1/asset/assetDividend

Parameters:

  • kwargs (Hash)

Options Hash (**kwargs):

  • :asset (String)
  • :startTime (Integer)
  • :endTime (Integer)
  • :limit (Integer)

    Default 20, max 500

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



220
221
222
# File 'lib/binance/spot/wallet.rb', line 220

def asset_devidend_record(**kwargs)
  @session.sign_request(:get, '/sapi/v1/asset/assetDividend', params: kwargs)
end

#coin_info(**kwargs) ⇒ Object

All Coins’ Information (USER_DATA)

GET /sapi/v1/capital/config/getall

Get information of coins (available for deposit and withdraw) for user.

Parameters:

  • kwargs (Hash)

Options Hash (**kwargs):

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



28
29
30
# File 'lib/binance/spot/wallet.rb', line 28

def coin_info(**kwargs)
  @session.sign_request(:get, '/sapi/v1/capital/config/getall', params: kwargs)
end

#deposit_address(coin:, **kwargs) ⇒ Object

Deposit Address (supporting network) (USER_DATA)

GET /sapi/v1/capital/deposit/address

Parameters:

  • coin (String)
  • kwargs (Hash)

Options Hash (**kwargs):

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

    The value cannot be greater than 60000

See Also:



144
145
146
147
148
149
150
# File 'lib/binance/spot/wallet.rb', line 144

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

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

#deposit_history(**kwargs) ⇒ Object

Deposit History (supporting network) (USER_DATA)

GET /sapi/v1/capital/deposit/hisrec

Parameters:

  • kwargs (Hash)

Options Hash (**kwargs):

  • :coin (String)
  • :status (Integer)

    0(0:pending,6: credited but cannot withdraw, 1:success)

  • :startTime (Integer)
  • :endTime (Integer)
  • :offest (Integer)

    Default:0

  • :limit (Integer)

    Default:1000, Max:1000

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



113
114
115
# File 'lib/binance/spot/wallet.rb', line 113

def deposit_history(**kwargs)
  @session.sign_request(:get, '/sapi/v1/capital/deposit/hisrec', params: kwargs)
end

#disable_fast_withdraw(**kwargs) ⇒ Object

Disable Fast Withdraw Switch (USER_DATA)

POST /sapi/v1/account/disableFastWithdrawSwitch

Parameters:

  • kwargs (Hash)

Options Hash (**kwargs):

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



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

def disable_fast_withdraw(**kwargs)
  @session.sign_request(:post, '/sapi/v1/account/disableFastWithdrawSwitch', params: kwargs)
end

#dust_log(**kwargs) ⇒ Object

DustLog (USER_DATA)

GET /sapi/v1/asset/dribblet

Parameters:

  • kwargs (Hash)

Options Hash (**kwargs):

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

    The value cannot be greater than 60000

See Also:



187
188
189
# File 'lib/binance/spot/wallet.rb', line 187

def dust_log(**kwargs)
  @session.sign_request(:get, '/sapi/v1/asset/dribblet', params: kwargs)
end

#dust_transfer(asset:, **kwargs) ⇒ Object

Dust Transfer (USER_DATA)

POST /sapi/v1/asset/dust

Convert dust assets to BNB.

Parameters:

  • asset (Array)
  • kwargs (Hash)

Options Hash (**kwargs):

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



201
202
203
204
205
206
207
# File 'lib/binance/spot/wallet.rb', line 201

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

  @session.sign_request(:post, '/sapi/v1/asset/dust', params: kwargs.merge(
    asset: asset
  ))
end

#enable_fast_withdraw(**kwargs) ⇒ Object

Enable Fast Withdraw Switch (USER_DATA)

POST /sapi/v1/account/enableFastWithdrawSwitch

Parameters:

  • kwargs (Hash)

Options Hash (**kwargs):

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



69
70
71
# File 'lib/binance/spot/wallet.rb', line 69

def enable_fast_withdraw(**kwargs)
  @session.sign_request(:post, '/sapi/v1/account/enableFastWithdrawSwitch', params: kwargs)
end

#funding_wallet(**kwargs) ⇒ Object

Funding Wallet (USER_DATA)

POST /sapi/v1/asset/get-funding-asset

Parameters:

  • kwargs (Hash)

Options Hash (**kwargs):

  • :asset (String)
  • :needBtcValuation (String)

    true or false

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



300
301
302
# File 'lib/binance/spot/wallet.rb', line 300

def funding_wallet(**kwargs)
  @session.sign_request(:post, '/sapi/v1/asset/get-funding-asset', params: kwargs)
end

#get_user_asset(**kwargs) ⇒ Object

User Asset (USER_DATA)

POST /sapi/v3/asset/getUserAsset

Parameters:

  • kwargs (Hash)

Options Hash (**kwargs):

  • :asset (String)

    If asset is blank, then query all positive assets user have.

  • :needBtcValuation (Boolean)
  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



324
325
326
# File 'lib/binance/spot/wallet.rb', line 324

def get_user_asset(**kwargs)
  @session.sign_request(:post, '/sapi/v3/asset/getUserAsset', params: kwargs)
end

#system_statusObject

System Status (System)

GET /sapi/v1/system/status

Fetch system status.



15
16
17
# File 'lib/binance/spot/wallet.rb', line 15

def system_status
  @session.public_request(path: '/sapi/v1/system/status')
end

#trade_fee(**kwargs) ⇒ Object

Trade Fee (USER_DATA)

GET /sapi/v1/asset/tradeFee

Parameters:

  • kwargs (Hash)

Options Hash (**kwargs):

  • :symbol (String)
  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



244
245
246
# File 'lib/binance/spot/wallet.rb', line 244

def trade_fee(**kwargs)
  @session.sign_request(:get, '/sapi/v1/asset/tradeFee', params: kwargs)
end

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

User Universal Transfer (USER_DATA)

POST /sapi/v1/asset/transfer

Parameters:

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

Options Hash (**kwargs):

  • :fromSymbol (String)

    must be sent when type are ISOLATEDMARGIN_MARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN

  • :toSymbol (String)

    must be sent when type are MARGIN_ISOLATEDMARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



260
261
262
263
264
265
266
267
268
269
270
# File 'lib/binance/spot/wallet.rb', line 260

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

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

#user_universal_transfer_history(type:, **kwargs) ⇒ Object

Query User Universal Transfer History (USER_DATA)

GET /sapi/v1/asset/transfer

Parameters:

  • type (String)
  • kwargs (Hash)

Options Hash (**kwargs):

  • :startTime (Integer)
  • :endTime (Integer)
  • :current (Integer)

    Default 1

  • :size (Integer)

    Default 10, Max 100

  • :fromSymbol (String)

    must be sent when type are ISOLATEDMARGIN_MARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN

  • :toSymbol (String)

    must be sent when type are MARGIN_ISOLATEDMARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



286
287
288
289
# File 'lib/binance/spot/wallet.rb', line 286

def user_universal_transfer_history(type:, **kwargs)
  Binance::Utils::Validation.require_param('type', type)
  @session.sign_request(:get, '/sapi/v1/asset/transfer', params: kwargs.merge(type: type))
end

#withdraw(coin:, address:, amount:, **kwargs) ⇒ Object

Withdraw [SAPI]

POST /sapi/v1/capital/withdraw/apply

Parameters:

  • coin (String)
  • address (String)
  • amount (Float)
  • kwargs (Hash)

Options Hash (**kwargs):

  • :withdrawOrderId (String)
  • :network (String)

    If network not send, return with default network of the coin.

  • :addressTag (String)
  • :transactionFeeFlag (Boolean)
  • :name (String)
  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



88
89
90
91
92
93
94
95
96
97
98
# File 'lib/binance/spot/wallet.rb', line 88

def withdraw(coin:, address:, amount:, **kwargs)
  Binance::Utils::Validation.require_param('coin', coin)
  Binance::Utils::Validation.require_param('address', address)
  Binance::Utils::Validation.require_param('amount', amount)

  @session.sign_request(:post, '/sapi/v1/capital/withdraw/apply', params: kwargs.merge(
    coin: coin,
    address: address,
    amount: amount
  ))
end

#withdraw_history(**kwargs) ⇒ Object

Withdraw History (supporting network) (USER_DATA)

GET /sapi/v1/capital/withdraw/history

Parameters:

  • kwargs (Hash)

Options Hash (**kwargs):

  • :coin (String)
  • :withdrawOrderId (String)
  • :status (Integer)

    0(0:pending,6: credited but cannot withdraw, 1:success)

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

    The value cannot be greater than 60000

See Also:



131
132
133
# File 'lib/binance/spot/wallet.rb', line 131

def withdraw_history(**kwargs)
  @session.sign_request(:get, '/sapi/v1/capital/withdraw/history', params: kwargs)
end