Skip to content

Commit

Permalink
feat: add etransfer api
Browse files Browse the repository at this point in the history
  • Loading branch information
chaoxkang committed Feb 8, 2025
1 parent c3cc99b commit 9f39688
Showing 1 changed file with 54 additions and 1 deletion.
55 changes: 54 additions & 1 deletion src/EoaServer.HttpApi/Controllers/TransferController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using EoaServer.Transfer.Dtos;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp;
using Volo.Abp.Application.Dtos;

namespace EoaServer.Controllers;

Expand All @@ -15,10 +16,38 @@ namespace EoaServer.Controllers;
public class TransferController : EoaServerBaseController
{
private readonly IShiftChainService _shiftChainService;
private readonly ITransferAppService _transferAppService;

public TransferController(IShiftChainService shiftChainService)
public TransferController(IShiftChainService shiftChainService,
ITransferAppService transferAppService)
{
_shiftChainService = shiftChainService;
_transferAppService = transferAppService;
}

[HttpPost("connect/token")]
public async Task<AuthTokenDto> GetConnectTokenAsync([FromForm] AuthTokenRequestDto request)
{
return await _transferAppService.GetConnectTokenAsync(request);
}


[HttpGet("token/list")]
public async Task<WithdrawTokenListDto> GetTokenListAsync(WithdrawTokenListRequestDto request)
{
return (await _transferAppService.GetTokenListAsync(request)).Data;
}

[HttpGet("token/option")]
public async Task<GetTokenOptionListDto> GetTokenOptionListAsync(GetTokenOptionListRequestDto request)
{
return (await _transferAppService.GetTokenOptionListAsync(request)).Data;
}

[HttpGet("network/list")]
public async Task<GetNetworkListDto> GetNetworkListAsync(GetNetworkListRequestDto request)
{
return (await _transferAppService.GetNetworkListAsync(request)).Data;
}

[HttpGet("getReceiveNetworkList")]
Expand All @@ -33,4 +62,28 @@ public async Task<SendNetworkDto> GetDestinationList(GetSendNetworkListRequestDt
{
return (await _shiftChainService.GetSendNetworkList(request)).Data;
}

[HttpGet("deposit/calculator")]
public async Task<CalculateDepositRateDto> CalculateDepositRateAsync(GetCalculateDepositRateRequestDto request)
{
return (await _transferAppService.CalculateDepositRateAsync(request)).Data;
}

[HttpGet("deposit/info")]
public async Task<GetDepositInfoDto> GetDepositInfoAsync(GetDepositRequestDto request)
{
return (await _transferAppService.GetDepositInfoAsync(request)).Data;
}

[HttpGet("network/tokens")]
public async Task<GetNetworkTokensDto> GetNetworkTokensAsync(GetNetworkTokensRequestDto request)
{
return (await _transferAppService.GetNetworkTokensAsync(request)).Data;
}

[HttpGet("record/list")]
public async Task<PagedResultDto<OrderIndexDto>> GetRecordListAsync(GetOrderRecordRequestDto request)
{
return (await _transferAppService.GetRecordListAsync(request)).Data;
}
}

0 comments on commit 9f39688

Please sign in to comment.