Exemplo n.º 1
0
        public async Task <BitfinexApiResult <BitfinexErrorResult[]> > BasketManageAsync(double amount, SplitMerge splitMerge, string tokenName)
        {
            if (string.IsNullOrEmpty(apiKey) || encryptor == null)
            {
                return(ThrowErrorMessage <BitfinexErrorResult[]>(BitfinexErrors.GetError(BitfinexErrorKey.NoApiCredentialsProvided)));
            }

            var parameters = new Dictionary <string, object>()
            {
                { "amount", amount.ToString(CultureInfo.InvariantCulture) },
                { "dir", int.Parse(JsonConvert.SerializeObject(splitMerge, new SplitMergeConverter(false))) },
                { "name", tokenName },
            };

            return(await ExecuteAuthenticatedRequestV1 <BitfinexErrorResult[]>(GetUrl(BasketManageEndpoint, OldApiVersion), PostMethod, parameters));
        }
Exemplo n.º 2
0
 public BitfinexApiResult <BitfinexErrorResult[]> BasketManage(double amount, SplitMerge splitMerge, string tokenName) => BasketManageAsync(amount, splitMerge, tokenName).Result;