Add initAddress api

This commit is contained in:
2025-05-10 14:41:17 +07:00
parent b7d5a0b6a7
commit 549c4ae746
10 changed files with 170 additions and 46 deletions

View File

@@ -444,7 +444,7 @@ public class EvmManager : IEvmManager
return cachedCandle;
}
public async Task<bool> InitAddress(string publicAddress)
public async Task<PrivyInitAddressResponse> InitAddress(string publicAddress)
{
try
{
@@ -452,13 +452,17 @@ public class EvmManager : IEvmManager
"/init-address",
new { address = publicAddress });
return response.Success;
return response;
}
catch (Exception ex)
{
// Log the error
Console.Error.WriteLine($"Error initializing address: {ex.Message}");
return false;
return new PrivyInitAddressResponse
{
Success = false,
Error = ex.Message
};
}
}

View File

@@ -1,11 +0,0 @@
namespace Managing.Infrastructure.Evm.Models.Privy;
public class PrivyInitAddressResponse
{
public bool Success { get; set; }
public string? UsdcHash { get; set; }
public string? OrderVaultHash { get; set; }
public string? ExchangeRouterHash { get; set; }
public string? Error { get; set; }
}