Class: Bybit::RestApi::AssetService

Inherits:
BaseService show all
Defined in:
lib/bybit/rest_api/asset_service.rb

Instance Method Summary collapse

Methods inherited from BaseService

#initialize

Constructor Details

This class inherits a constructor from Bybit::RestApi::BaseService

Instance Method Details

#account_coin_balance_query(account_type:, coin:, **kwargs) ⇒ Hash

Get Single Coin Balance

GET /v5/asset/transfer/query-account-coin-balance

Parameters:

  • account_type (String)

    Account type

  • coin (String)

    Coin name, uppercase (e.g. USDT, BTC). Required.

  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :member_id (Integer)

    UID. Required when querying sub UID balance with master API key

  • :to_member_id (Integer)

    Target UID. Required for cross-UID transferable balance query

  • :to_account_type (String)

    Destination account type. Required when withLtvTransferSafeAmount=1

  • :with_bonus (Integer)

    0 (default): exclude bonus; 1: include bonus

  • :with_transfer_safe_amount (Integer)

    0 (default): not query; 1: query delay-withdraw safe amount

  • :with_ltv_transfer_safe_amount (Integer)

    0 (default): not query; 1: query OTC loan transferable amount. Requires toAccountType

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



274
275
276
277
278
# File 'lib/bybit/rest_api/asset_service.rb', line 274

def (account_type:, coin:, **kwargs)
  params = kwargs.merge(account_type: , coin: coin)
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :get, path: '/v5/asset/transfer/query-account-coin-balance', params: params)
end

#asset_info_query(**kwargs) ⇒ Hash

Get Spot Asset Info

GET /v5/asset/transfer/query-asset-info

Parameters:

  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :account_type (String)

    Account type. Currently only SPOT. Defaults to SPOT if empty.

  • :coin (String)

    Coin name, uppercase. Optional; returns all coins if empty.

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



288
289
290
291
292
# File 'lib/bybit/rest_api/asset_service.rb', line 288

def asset_info_query(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :get, path: '/v5/asset/transfer/query-asset-info', params: params)
end

#cancel_withdraw(**kwargs) ⇒ Hash

Cancel Withdrawal

POST /v5/asset/withdraw/cancel

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



332
333
334
335
336
# File 'lib/bybit/rest_api/asset_service.rb', line 332

def cancel_withdraw(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :post, path: '/v5/asset/withdraw/cancel', body: params)
end

#coin_convert_limit_query(from_coin:, to_coin:, account_type:, **kwargs) ⇒ Hash

Query coin conversion limit

GET /v5/asset/exchange/query-convert-limit

Parameters:

  • from_coin (String)

    From coin

  • to_coin (String)

    To coin

  • account_type (String)

    Account type (scene code), pass "funding" for funding account flash conversion

  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :from_coin_type (Integer)

    From coin type: 0=crypto, 1=fiat

  • :to_coin_type (Integer)

    To coin type: 0=crypto, 1=fiat

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



511
512
513
514
515
# File 'lib/bybit/rest_api/asset_service.rb', line 511

def coin_convert_limit_query(from_coin:, to_coin:, account_type:, **kwargs)
  params = kwargs.merge(from_coin: from_coin, to_coin: to_coin, account_type: )
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :get, path: '/v5/asset/exchange/query-convert-limit', params: params)
end

#coin_list_query(account_type:, **kwargs) ⇒ Hash

Coin list query

GET /v5/asset/exchange/query-coin-list

Parameters:

  • account_type (String)

    Wallet type. Supported values: eb_convert_funding, eb_convert_uta, eb_convert_spot, eb_convert_contr

  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :side (Integer)

    0: fromCoin list (coins to sell); 1: toCoin list (coins to buy)

  • :coin (String)

    Coin name, uppercase only. Used as fromCoin filter when side=0

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



467
468
469
470
471
# File 'lib/bybit/rest_api/asset_service.rb', line 467

def coin_list_query(account_type:, **kwargs)
  params = kwargs.merge(account_type: )
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :get, path: '/v5/asset/exchange/query-coin-list', params: params)
end

#convert_execute(**kwargs) ⇒ Hash

Execute conversion

POST /v5/asset/exchange/convert-execute

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



479
480
481
482
483
# File 'lib/bybit/rest_api/asset_service.rb', line 479

def convert_execute(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :post, path: '/v5/asset/exchange/convert-execute', body: params)
end

#convert_history_query(**kwargs) ⇒ Hash

Conversion history query

GET /v5/asset/exchange/query-convert-history

Parameters:

  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :account_type (String)

    Wallet type filter. Supported: eb_convert_funding, eb_convert_uta, funding, funding_fiat, funding_fb

  • :index (Integer)

    Page number, starts at 1, defaults to 1

  • :limit (Integer)

    Page size, default 20, max 100

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



494
495
496
497
498
# File 'lib/bybit/rest_api/asset_service.rb', line 494

def convert_history_query(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :get, path: '/v5/asset/exchange/query-convert-history', params: params)
end

#get_asset_overview(**kwargs) ⇒ Hash

Get Asset Overview

GET /v5/asset/asset-overview

Parameters:

  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :account_type (String)

    Account type filter. Multiple values separated by commas. If not passed, returns all account types.

  • :member_id (String)

    Sub-account member ID. Used to query a specific sub-account's assets. - If API key belongs to a sub-

  • :valuation_currency (String)

    Valuation currency. Defaults to USD if not provided.

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



389
390
391
392
393
# File 'lib/bybit/rest_api/asset_service.rb', line 389

def get_asset_overview(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :get, path: '/v5/asset/asset-overview', params: params)
end

#get_coin_balance(account_type:, **kwargs) ⇒ Hash

Get Coin Balance

GET /v5/asset/transfer/query-account-coins-balance

Parameters:

  • account_type (String)

    Account type

  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :member_id (String)

    User ID. Required when querying sub UID balance with master API key

  • :coin (String)

    Coin name(s). Multiple coins separated by comma. If not passed, returns all coins

  • :with_bonus (Integer)

    0(default): not include bonus; 1: include bonus

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).



15
16
17
18
19
# File 'lib/bybit/rest_api/asset_service.rb', line 15

def get_coin_balance(account_type:, **kwargs)
  params = kwargs.merge(account_type: )
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :get, path: '/v5/asset/transfer/query-account-coins-balance', params: params)
end

#get_coin_greeks(**kwargs) ⇒ Hash

Get Coin Greeks

GET /v5/asset/coin-greeks

Parameters:

  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :base_coin (String)

    Base coin. Default: return all your coins greek data

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).



27
28
29
30
31
# File 'lib/bybit/rest_api/asset_service.rb', line 27

def get_coin_greeks(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :get, path: '/v5/asset/coin-greeks', params: params)
end

#get_coin_info(**kwargs) ⇒ Hash

Get Coin Info

GET /v5/asset/coin/query-info

Parameters:

  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :coin (String)

    Coin name, uppercase only. e.g. BTC, ETH. If not passed, return all coin info.

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



55
56
57
58
59
# File 'lib/bybit/rest_api/asset_service.rb', line 55

def get_coin_info(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :get, path: '/v5/asset/coin/query-info', params: params)
end

#get_convert_result(quote_tx_id:, account_type:, **kwargs) ⇒ Hash

Query conversion result

GET /v5/asset/exchange/convert-result-query

Parameters:

  • quote_tx_id (String)

    Quote transaction ID

  • account_type (String)

    Wallet type (scene code)

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



525
526
527
528
529
# File 'lib/bybit/rest_api/asset_service.rb', line 525

def get_convert_result(quote_tx_id:, account_type:, **kwargs)
  params = kwargs.merge(quote_tx_id: quote_tx_id, account_type: )
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :get, path: '/v5/asset/exchange/convert-result-query', params: params)
end

#get_delivery_record(category:, **kwargs) ⇒ Hash

Get Delivery Record

GET /v5/asset/delivery-record

Parameters:

  • category (String)

    Product type: - linear: USDT / USDC futures - inverse: Inverse futures - option: Options

  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :symbol (String)

    Symbol name, e.g. BTCUSDT, BTC-29DEC22-16000-P

  • :start_time (Integer)

    Start timestamp in milliseconds. Default: 30 days before current time

  • :end_time (Integer)

    End timestamp in milliseconds. Default: current time

  • :exp_date (String)

    Expiry date. Format: 25DEC22. Default: returns all expiry dates

  • :limit (Integer)

    Number of items per page. Default: 20, Range: [1, 50]

  • :cursor (String)

    Pagination cursor. Use nextPageCursor from the response to retrieve the next page

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



408
409
410
411
412
# File 'lib/bybit/rest_api/asset_service.rb', line 408

def get_delivery_record(category:, **kwargs)
  params = kwargs.merge(category: category)
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :get, path: '/v5/asset/delivery-record', params: params)
end

#get_deposit_address(coin:, **kwargs) ⇒ Hash

Get Master Deposit Address

GET /v5/asset/deposit/query-address

Parameters:

  • coin (String)

    Coin symbol (uppercase only), e.g. USDT.

  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :chain_type (String)

    Chain type. Use chain value from the coin-info endpoint. If not provided, returns all chains.

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



88
89
90
91
92
# File 'lib/bybit/rest_api/asset_service.rb', line 88

def get_deposit_address(coin:, **kwargs)
  params = kwargs.merge(coin: coin)
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :get, path: '/v5/asset/deposit/query-address', params: params)
end

#get_portfolio_margin(**kwargs) ⇒ Hash

Get Portfolio Margin Info

GET /v5/asset/portfolio-margin

Parameters:

  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :base_coin (String)

    Base coin, e.g. BTC, ETH. If not passed, returns all.

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



421
422
423
424
425
# File 'lib/bybit/rest_api/asset_service.rb', line 421

def get_portfolio_margin(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :get, path: '/v5/asset/portfolio-margin', params: params)
end

#get_settlement_record(category:, **kwargs) ⇒ Hash

Get USDC Session Settlement

GET /v5/asset/settlement-record

Parameters:

  • category (String)

    Product type: - linear: USDC contract

  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :symbol (String)

    Symbol name, e.g. BTCPERP

  • :start_time (Integer)

    Start timestamp in milliseconds. Default: 30 days before current time

  • :end_time (Integer)

    End timestamp in milliseconds. Default: current time

  • :limit (Integer)

    Number of items per page. Default: 20, Range: [1, 50]

  • :cursor (String)

    Pagination cursor. Use nextPageCursor from the response to retrieve the next page

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



439
440
441
442
443
# File 'lib/bybit/rest_api/asset_service.rb', line 439

def get_settlement_record(category:, **kwargs)
  params = kwargs.merge(category: category)
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :get, path: '/v5/asset/settlement-record', params: params)
end

#get_sub_member_deposit_address(coin:, chain_type:, sub_member_id:, **kwargs) ⇒ Hash

Get Sub Deposit Address

GET /v5/asset/deposit/query-sub-member-address

Parameters:

  • coin (String)

    Coin symbol (uppercase only).

  • chain_type (String)

    Chain type. Use chain value from the coin-info endpoint.

  • sub_member_id (String)

    Sub-account user ID.

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



103
104
105
106
107
# File 'lib/bybit/rest_api/asset_service.rb', line 103

def get_sub_member_deposit_address(coin:, chain_type:, sub_member_id:, **kwargs)
  params = kwargs.merge(coin: coin, chain_type: chain_type, sub_member_id: sub_member_id)
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :get, path: '/v5/asset/deposit/query-sub-member-address', params: params)
end

#get_total_members_assets(**kwargs) ⇒ Hash

Get Total Members Assets

GET /v5/asset/total-members-assets

Parameters:

  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :coin (String)

    Coin name, e.g. BTC, USDT. If specified, total assets are denominated in this coin.

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



452
453
454
455
456
# File 'lib/bybit/rest_api/asset_service.rb', line 452

def get_total_members_assets(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :get, path: '/v5/asset/total-members-assets', params: params)
end

#get_vasp_list(**kwargs) ⇒ Hash

Get Available VASPs

GET /v5/asset/withdraw/vasp/list

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



357
358
359
360
361
# File 'lib/bybit/rest_api/asset_service.rb', line 357

def get_vasp_list(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :get, path: '/v5/asset/withdraw/vasp/list', params: params)
end

#get_withdrawable_amount_by_coin(coin:, **kwargs) ⇒ Hash

Get Withdrawable Amount

GET /v5/asset/withdraw/withdrawable-amount

Parameters:

  • coin (String)

    Coin name, uppercase, e.g. USDT

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



345
346
347
348
349
# File 'lib/bybit/rest_api/asset_service.rb', line 345

def get_withdrawable_amount_by_coin(coin:, **kwargs)
  params = kwargs.merge(coin: coin)
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :get, path: '/v5/asset/withdraw/withdrawable-amount', params: params)
end

#inter_transfer(**kwargs) ⇒ Hash

Create Internal Transfer

POST /v5/asset/transfer/inter-transfer

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



166
167
168
169
170
# File 'lib/bybit/rest_api/asset_service.rb', line 166

def inter_transfer(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :post, path: '/v5/asset/transfer/inter-transfer', body: params)
end

#inter_transfer_list_query(**kwargs) ⇒ Hash

Get Internal Transfer Records

GET /v5/asset/transfer/query-inter-transfer-list

Parameters:

  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :transfer_id (String)

    UUID of the transfer. If provided, queries a single record by transferId.

  • :coin (String)

    Coin name, uppercase (e.g. BTC, USDT)

  • :status (String)

    Filter by transfer status

  • :start_time (Integer)

    Start timestamp in milliseconds (effective at second level)

  • :end_time (Integer)

    End timestamp in milliseconds (effective at second level)

  • :limit (Integer)

    Number of records per page. Default: 20, Range: [1, 50]

  • :cursor (String)

    Pagination cursor from nextPageCursor of previous response

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



209
210
211
212
213
# File 'lib/bybit/rest_api/asset_service.rb', line 209

def inter_transfer_list_query(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :get, path: '/v5/asset/transfer/query-inter-transfer-list', params: params)
end

#list_convert_orders(**kwargs) ⇒ Hash

Query conversion order list

GET /v5/asset/exchange/query-order-list

Parameters:

  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :account_type (Integer)

    Account type: 0=ASSET, 1=OBU

  • :cursor (String)

    Pagination cursor

  • :limit (Integer)

    Items per page

  • :to_coin (String)

    To coin filter

  • :from_coin (String)

    From coin filter

  • :start_time (Integer)

    Start timestamp (seconds)

  • :end_time (Integer)

    End timestamp (seconds)

  • :type (Integer)

    Conversion type: 0=all, 1=auto conversion, 2=active conversion

  • :exchange_status (Integer)

    Order status: 0=all, 1=init, 2=pending, 3=success, 4=failure

  • :direction (String)

    Pagination direction

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



563
564
565
566
567
# File 'lib/bybit/rest_api/asset_service.rb', line 563

def list_convert_orders(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :get, path: '/v5/asset/exchange/query-order-list', params: params)
end

#list_convert_orders_by_page(**kwargs) ⇒ Hash

Paginated conversion order query

GET /v5/asset/exchange/order-record

Parameters:

  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :cursor (String)

    Pagination cursor (omit on first request)

  • :limit (Integer)

    Items per page

  • :to_coin (String)

    To coin filter

  • :from_coin (String)

    From coin filter

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



541
542
543
544
545
# File 'lib/bybit/rest_api/asset_service.rb', line 541

def list_convert_orders_by_page(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :get, path: '/v5/asset/exchange/order-record', params: params)
end

#list_deposit_records(**kwargs) ⇒ Hash

Get Deposit Records (on-chain)

GET /v5/asset/deposit/query-record

Parameters:

  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :id (String)

    Internal ID. Takes highest priority when combined with other params.

  • :tx_id (String)

    Transaction ID. Only works for data from Jan 1, 2024 onward.

  • :coin (String)

    Coin symbol (uppercase only), e.g. BTC, USDT. Empty means query all coins.

  • :start_time (Integer)

    Start timestamp in milliseconds. Defaults to 30 days ago if not provided.

  • :end_time (Integer)

    End timestamp in milliseconds. Defaults to current time if not provided.

  • :limit (Integer)

    Records per page. Range [1, 50], default 50.

  • :cursor (String)

    Pagination cursor from nextPageCursor in prior response.

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



74
75
76
77
78
# File 'lib/bybit/rest_api/asset_service.rb', line 74

def list_deposit_records(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :get, path: '/v5/asset/deposit/query-record', params: params)
end

#list_funding_history(**kwargs) ⇒ Hash

Get Funding History

GET /v5/asset/fundinghistory

Parameters:

  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :create_time_from (String)

    Start timestamp (ms)

  • :create_time_to (String)

    End timestamp (ms)

  • :limit (String)

    Limit for data size per page. [1, 50]. Default: 20

  • :cursor (String)

    Cursor. Used for pagination

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).



42
43
44
45
46
# File 'lib/bybit/rest_api/asset_service.rb', line 42

def list_funding_history(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :get, path: '/v5/asset/fundinghistory', params: params)
end

#list_internal_deposit_records(**kwargs) ⇒ Hash

Get Internal Deposit Records (off-chain)

GET /v5/asset/deposit/query-internal-record

Parameters:

  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :tx_id (String)

    Internal transfer transaction ID.

  • :start_time (Integer)

    Start timestamp in milliseconds. Defaults to 30 days ago.

  • :end_time (Integer)

    End timestamp in milliseconds. Defaults to current time.

  • :coin (String)

    Coin symbol (uppercase only). Empty means query all.

  • :cursor (String)

    Pagination cursor.

  • :limit (Integer)

    Records per page. Range [1, 50], default 50.

  • :status (String)

    Filter by status. 0 = all (default).

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



142
143
144
145
146
# File 'lib/bybit/rest_api/asset_service.rb', line 142

def list_internal_deposit_records(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :get, path: '/v5/asset/deposit/query-internal-record', params: params)
end

#list_small_balance_coins(account_type:, **kwargs) ⇒ Hash

Small asset conversion list query

GET /v5/asset/covert/small-balance-list

Parameters:

  • account_type (String)

    Wallet type. Only supports eb_convert_uta (Unified wallet)

  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :from_coin (String)

    Source currency filter (optional). Multiple coins separated by comma, e.g. "BTC,ETH"

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



619
620
621
622
623
# File 'lib/bybit/rest_api/asset_service.rb', line 619

def list_small_balance_coins(account_type:, **kwargs)
  params = kwargs.merge(account_type: )
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :get, path: '/v5/asset/covert/small-balance-list', params: params)
end

#list_small_balance_history(**kwargs) ⇒ Hash

Small asset conversion history query

GET /v5/asset/covert/small-balance-history

Parameters:

  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :account_type (String)

    Wallet type: eb_convert_uta or eb_convert_funding

  • :quote_id (String)

    Quote ID. Highest priority filter when provided

  • :cursor (String)

    Page number for pagination

  • :size (String)

    Page size, default 50, max 100

  • :start_time (String)

    Start timestamp in milliseconds

  • :end_time (String)

    End timestamp in milliseconds

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



605
606
607
608
609
# File 'lib/bybit/rest_api/asset_service.rb', line 605

def list_small_balance_history(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :get, path: '/v5/asset/covert/small-balance-history', params: params)
end

#list_sub_member_deposit_records(sub_member_id:, **kwargs) ⇒ Hash

Get Sub Deposit Records (on-chain)

GET /v5/asset/deposit/query-sub-member-record

Parameters:

  • sub_member_id (String)

    Sub-account UID.

  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :id (String)

    Internal ID. Takes highest priority when combined with other params.

  • :tx_id (String)

    Transaction ID (data before Jan 1, 2024 not queryable via txID).

  • :coin (String)

    Coin symbol (uppercase only). Empty means query all.

  • :start_time (Integer)

    Start timestamp in milliseconds. Defaults to 30 days ago.

  • :end_time (Integer)

    End timestamp in milliseconds. Defaults to current time.

  • :limit (Integer)

    Records per page. Range [1, 50], default 50.

  • :cursor (String)

    Pagination cursor from nextPageCursor.

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



123
124
125
126
127
# File 'lib/bybit/rest_api/asset_service.rb', line 123

def list_sub_member_deposit_records(sub_member_id:, **kwargs)
  params = kwargs.merge(sub_member_id: sub_member_id)
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :get, path: '/v5/asset/deposit/query-sub-member-record', params: params)
end

#list_withdraw_addresses(**kwargs) ⇒ Hash

Get Withdrawal Address List

GET /v5/asset/withdraw/query-address

Parameters:

  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :coin (String)

    Coin name; use baseCoin for universal addresses

  • :chain (String)

    Chain name

  • :address_type (Integer)

    Address type: - 0: On-chain address (default) - 1: Internal transfer address (coin/chain ignored

  • :limit (Integer)

    Records per page, range [1, 50], default 50

  • :cursor (String)

    Pagination cursor from nextPageCursor in prior response

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



374
375
376
377
378
# File 'lib/bybit/rest_api/asset_service.rb', line 374

def list_withdraw_addresses(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :get, path: '/v5/asset/withdraw/query-address', params: params)
end

#list_withdraw_records(**kwargs) ⇒ Hash

Get Withdrawal Records

GET /v5/asset/withdraw/query-record

Parameters:

  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :withdraw_id (String)

    Withdrawal ID

  • :tx_id (String)

    Transaction hash ID

  • :coin (String)

    Coin name, uppercase, e.g. USDT

  • :withdraw_type (Integer)

    Withdrawal type: - 0: On-chain withdrawal (default) - 1: Off-chain (internal transfer) - 2: Al

  • :start_time (Integer)

    Start timestamp in milliseconds. Default: 30 days before current time

  • :end_time (Integer)

    End timestamp in milliseconds. Default: current time

  • :limit (Integer)

    Results per page, range [1, 50], default 50

  • :cursor (String)

    Pagination cursor from nextPageCursor in prior response

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



320
321
322
323
324
# File 'lib/bybit/rest_api/asset_service.rb', line 320

def list_withdraw_records(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :get, path: '/v5/asset/withdraw/query-record', params: params)
end

#quote_apply(**kwargs) ⇒ Hash

Apply quote

POST /v5/asset/exchange/quote-apply

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



575
576
577
578
579
# File 'lib/bybit/rest_api/asset_service.rb', line 575

def quote_apply(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :post, path: '/v5/asset/exchange/quote-apply', body: params)
end

#send_withdraw(**kwargs) ⇒ Hash

Withdraw

POST /v5/asset/withdraw/create

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



300
301
302
303
304
# File 'lib/bybit/rest_api/asset_service.rb', line 300

def send_withdraw(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :post, path: '/v5/asset/withdraw/create', body: params)
end

#set_default_deposit_to_account(**kwargs) ⇒ Hash

Set Deposit Account

POST /v5/asset/deposit/deposit-to-account

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



154
155
156
157
158
# File 'lib/bybit/rest_api/asset_service.rb', line 154

def (**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :post, path: '/v5/asset/deposit/deposit-to-account', body: params)
end

#small_asset_convert(**kwargs) ⇒ Hash

Small asset confirm conversion

POST /v5/asset/covert/small-balance-execute

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



587
588
589
590
591
# File 'lib/bybit/rest_api/asset_service.rb', line 587

def small_asset_convert(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :post, path: '/v5/asset/covert/small-balance-execute', body: params)
end

#small_asset_quote(**kwargs) ⇒ Hash

Small asset get quote

POST /v5/asset/covert/get-quote

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



631
632
633
634
635
# File 'lib/bybit/rest_api/asset_service.rb', line 631

def small_asset_quote(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :post, path: '/v5/asset/covert/get-quote', body: params)
end

#sub_member_list_query(**kwargs) ⇒ Hash

Get Sub UID List

GET /v5/asset/transfer/query-sub-member-list

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



254
255
256
257
258
# File 'lib/bybit/rest_api/asset_service.rb', line 254

def sub_member_list_query(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :get, path: '/v5/asset/transfer/query-sub-member-list', params: params)
end

#transfer_coin_list_query(from_account_type:, to_account_type:, **kwargs) ⇒ Hash

Get Transferable Coin List

GET /v5/asset/transfer/query-transfer-coin-list

Parameters:

  • from_account_type (String)

    Source account type

  • to_account_type (String)

    Destination account type

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



242
243
244
245
246
# File 'lib/bybit/rest_api/asset_service.rb', line 242

def transfer_coin_list_query(from_account_type:, to_account_type:, **kwargs)
  params = kwargs.merge(from_account_type: , to_account_type: )
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :get, path: '/v5/asset/transfer/query-transfer-coin-list', params: params)
end

#transfer_sub_member_save(**kwargs) ⇒ Hash

Save Transferable Sub Member List

POST /v5/asset/transfer/save-transfer-sub-member

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



190
191
192
193
194
# File 'lib/bybit/rest_api/asset_service.rb', line 190

def transfer_sub_member_save(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :post, path: '/v5/asset/transfer/save-transfer-sub-member', body: params)
end

#universal_transfer(**kwargs) ⇒ Hash

Create Universal Transfer

POST /v5/asset/transfer/universal-transfer

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



178
179
180
181
182
# File 'lib/bybit/rest_api/asset_service.rb', line 178

def universal_transfer(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :post, path: '/v5/asset/transfer/universal-transfer', body: params)
end

#universal_transfer_list_query(**kwargs) ⇒ Hash

Get Universal Transfer Records

GET /v5/asset/transfer/query-universal-transfer-list

Parameters:

  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :transfer_id (String)

    UUID of the transfer

  • :coin (String)

    Coin name, uppercase

  • :status (String)

    Filter by transfer status: SUCCESS, FAILED, PENDING

  • :start_time (Integer)

    Start timestamp in milliseconds (effective at second level)

  • :end_time (Integer)

    End timestamp in milliseconds (effective at second level)

  • :limit (Integer)

    Number of records per page. Default: 20, Range: [1, 50]

  • :cursor (String)

    Pagination cursor from nextPageCursor

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



228
229
230
231
232
# File 'lib/bybit/rest_api/asset_service.rb', line 228

def universal_transfer_list_query(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :get, path: '/v5/asset/transfer/query-universal-transfer-list', params: params)
end