Ejemplo n.º 1
0
        /// <summary>
        /// Get the valuation of the total assets of the account in btc or fiat currency.
        /// Limit: 1 requests per 20 seconds
        /// </summary>
        /// <param name="accountType">Line of Business Type。0.Total account assets 1.spot 3.futures 4.C2C 5.margin 6.Funding Account 8. PiggyBank 9.swap 12:option 14.mining account Query total assets by default</param>
        /// <param name="valuationCurrency">The valuation according to a certain fiat currency can only be one of the following "BTC USD CNY JPY KRW RUB" The default unit is BTC</param>
        /// <param name="ct">Cancellation Token</param>
        public async Task <WebCallResult <OkexFundingAssetValuation> > Funding_GetAssetValuation_Async(OkexFundingAccountType accountType = OkexFundingAccountType.TotalAccountAssets, string valuationCurrency = "BTC", CancellationToken ct = default)
        {
            valuationCurrency = valuationCurrency.ValidateCurrency();

            if (string.IsNullOrEmpty(valuationCurrency) || valuationCurrency.IsNotOneOf("BTC", "USD", "CNY", "JPY", "KRW", "RUB"))
            {
                throw new ArgumentException("The valuation according to a certain fiat currency can only be one of the following BTC, USD, CNY, JPY, KRW, RUB");
            }

            var parameters = new Dictionary <string, object>
            {
                { "account_type", JsonConvert.SerializeObject(accountType, new FundingAccountTypeConverter(false)) },
                { "valuation_currency", valuationCurrency },
            };

            return(await SendRequest <OkexFundingAssetValuation>(GetUrl(Endpoints_Funding_GetAssetValuation), HttpMethod.Get, ct, parameters, signed : true).ConfigureAwait(false));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Get the valuation of the total assets of the account in btc or fiat currency.
 /// Limit: 1 requests per 20 seconds
 /// </summary>
 /// <param name="accountType">Line of Business Type。0.Total account assets 1.spot 3.futures 4.C2C 5.margin 6.Funding Account 8. PiggyBank 9.swap 12:option 14.mining account Query total assets by default</param>
 /// <param name="valuationCurrency">The valuation according to a certain fiat currency can only be one of the following "BTC USD CNY JPY KRW RUB" The default unit is BTC</param>
 /// <param name="ct">Cancellation Token</param>
 /// <returns></returns>
 public WebCallResult <OkexFundingAssetValuation> Funding_GetAssetValuation(OkexFundingAccountType accountType = OkexFundingAccountType.TotalAccountAssets, string valuationCurrency = "BTC", CancellationToken ct = default) => Funding_GetAssetValuation_Async(accountType, valuationCurrency, ct).Result;