コード例 #1
0
        public FundsResponse GetFunds([FromBody] BaseRequest request)
        {
            FundsResponse response = new FundsResponse();

            try
            {
                if (!BAplication.ValidateAplicationToken(request.ApplicationToken))
                {
                    response.Code    = "2";
                    response.Message = Messages.ApplicationTokenNoAutorize;
                    return(response);
                }

                List <MFund> funds = BFund.List();

                response.Funds   = funds.ToArray();
                response.Code    = "0";
                response.Message = "Success";
            }
            catch (Exception ex)
            {
                response.Code    = "2";
                response.Message = ex.Message;
            }

            return(response);
        }
コード例 #2
0
        public override async Task <FundsResponse> GetFunds(FundsRequest request, ServerCallContext context)
        {
            var result = new FundsResponse();

            var token   = context.GetBearerToken();
            var wallets = await _clientAccountClient.Wallets.GetClientWalletsFilteredAsync(context.GetClientId(), WalletType.Trading);

            var walletId = wallets.FirstOrDefault()?.Id;

            var response = await _walletApiV2Client.GetFundsByWalletIdAsync(
                walletId, null, request.AssetId, request.Take, request.Skip,
                request.OptionalFromDateCase == FundsRequest.OptionalFromDateOneofCase.None?(DateTimeOffset?)null : request.From.ToDateTimeOffset(),
                request.OptionalToDateCase == FundsRequest.OptionalToDateOneofCase.None?(DateTimeOffset?)null : request.To.ToDateTimeOffset(),
                token);

            if (response != null)
            {
                result.Body = new FundsResponse.Types.Body();
                result.Body.Funds.AddRange(_mapper.Map <List <FundsResponse.Types.FundsModel> >(response));
            }

            return(result);
        }
コード例 #3
0
        public override async Task <FundsResponse> GetFunds(FundsRequest request, ServerCallContext context)
        {
            var resp = new FundsResponse();

            return(resp);
        }