Send tokens

This commit is contained in:
2025-07-06 14:39:01 +07:00
parent c7dec76809
commit f973be2e08
13 changed files with 693 additions and 12 deletions

View File

@@ -114,6 +114,28 @@ namespace Managing.Api.Controllers
return Ok(result);
}
/// <summary>
/// Sends tokens from a specific account to a recipient address.
/// </summary>
/// <param name="name">The name of the account to send tokens from.</param>
/// <param name="request">The token sending request containing recipient address, ticker, and amount.</param>
/// <returns>The transaction response with details.</returns>
[HttpPost]
[Route("{name}/send-token")]
public async Task<ActionResult<SwapInfos>> SendToken(string name, [FromBody] SendTokenRequest request)
{
var user = await GetUser();
var result = await _AccountService.SendTokenAsync(
user,
name,
request.RecipientAddress,
request.Ticker,
request.Amount,
request.ChainId
);
return Ok(result);
}
/// <summary>
/// Deletes a specific account by name for the authenticated user.
/// </summary>