You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
from huobi . connection . restapi_sync_client import RestApiSyncClient
from huobi . constant . system import HttpMethod
from huobi . model . account . account_asset_valuation import AccountAssetValuationResult
from huobi . utils import *
'''
获取账户资产估值
API Key 权限:读取
限频值( NEW) : 100次/2s
按照BTC或法币计价单位, 获取指定账户的总资产估值。
请求参数:
accountType 账户类型 spot: 现货账户, margin: 逐仓杠杆账户, otc: OTC 账户, super-margin: 全仓杠杆账户
valuationCurrency 资产估值法币,即资产按哪个法币为单位进行估值。 可选法币有: BTC、CNY、USD、JPY、KRW、GBP、TRY、EUR、RUB、VND、HKD、TWD、MYR、SGD、AED、SAR (大小写敏感)
subUid 子用户的 UID, 若不填, 则返回API key所属用户的账户资产估值
{
" code " : 200,
" data " : {
" balance " : " 34.75 " , 按照某一个法币为单位的总资产估值
" timestamp " : 1594901254363 数据返回时间, 为unix time in millisecond
},
" ok " : true
}
'''
class GetAccountAssetValuationService :
def __init__ ( self , params ) :
self . params = params
def request ( self , * * kwargs ) :
channel = " /v2/account/asset-valuation "
def parse ( dict_data ) :
data = dict_data . get ( " data " , { } )
return default_parse ( data , AccountAssetValuationResult , [ ] )
return RestApiSyncClient ( * * kwargs ) . request_process ( HttpMethod . GET_SIGN , channel , self . params , parse )