예제 #1
0
        public async Task <GetBotPositionsResponse> GetBotPositions(GetBotPositionsRequest request)
        {
            var queryParameters = new Dictionary <string, string>();

            queryParameters.AddValueIfNotNullOrEmpty("signalProvider", _options.SignalProvider);
            queryParameters.AddValueIfNotNullOrEmpty("signalProviderKey", _options.SignalProviderKey);
            queryParameters.AddValueIfNotNullOrEmpty("exchange", request.Exchange.ToString().ToLower());
            queryParameters.AddValueIfNotNullOrEmpty("baseAsset", request.BaseAsset);
            var queryString = queryParameters.ToQueryString();

            return(await this.GetAsync <GetBotPositionsResponse>($"v2/getBotAssetsPct{queryString}"));
        }
예제 #2
0
     public async Task PlaceOrder_DefaultBehaviour_ResponseIsParsed()
     {
         // Arrange
         var options = CreateOptions();
         var request = new GetBotPositionsRequest {
             Exchange  = Exchange.Binance,
             BaseAsset = "USDT"
         };
         string expectedUrl = $"{options.Value.BaseEndpoint}v2/getBotAssetsPct?signalProvider={options.Value.SignalProvider}" +
                              $"&signalProviderKey={options.Value.SignalProviderKey}" +
                              $"&exchange={request.Exchange.ToString().ToLower()}" +
                              $"&baseAsset={request.BaseAsset}";
         var response = @$ "{{
 " "amounts" ": [{{
예제 #3
0
        public async Task PlaceOrder_CanPlaceOrder()
        {
            // Arrange
            var options    = CreateOptions();
            var httpClient = new HttpClient();
            var client     = new BotsPositionApi(options, httpClient);
            var request    = new GetBotPositionsRequest {
                Exchange  = Exchange.Binance,
                BaseAsset = "USDT"
            };

            // Act
            var positions = await client.GetBotPositions(request);

            // Assert
            positions.Should().NotBeNull();
        }