コード例 #1
0
        public override Task <SwiftCashoutFeeResponse> GetSwiftCashoutFee(SwiftCashoutFeeRequest request, ServerCallContext context)
        {
            var resp = new SwiftCashoutFeeResponse();

            resp.Result = new SwiftCashoutFeeResponse.Types.SwiftCashoutFee()
            {
                AssetId = "ETH",
                Country = "AnyCountry",
                Size    = "0.005"
            };

            return(Task.FromResult(resp));
        }
コード例 #2
0
        public override async Task <SwiftCashoutFeeResponse> GetSwiftCashoutFee(SwiftCashoutFeeRequest request, ServerCallContext context)
        {
            var result = new SwiftCashoutFeeResponse();

            var token    = context.GetBearerToken();
            var response = await _walletApiV1Client.OffchainCashoutSwiftFeeAsync(request.AssetId, request.CountryCode, token);

            if (response.Result != null)
            {
                result.Body = _mapper.Map <SwiftCashoutFeeResponse.Types.Body>(response.Result);
            }

            if (response.Error != null)
            {
                result.Error = response.Error.ToApiError();
            }

            return(result);
        }