diff --git a/Hathor.Tests/Hathor.Tests.csproj b/Hathor.Tests/Hathor.Tests.csproj index 6912296..3d7e293 100644 --- a/Hathor.Tests/Hathor.Tests.csproj +++ b/Hathor.Tests/Hathor.Tests.csproj @@ -7,11 +7,11 @@ - + - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Hathor.Wallet.Tests/Hathor.Wallet.Tests.csproj b/Hathor.Wallet.Tests/Hathor.Wallet.Tests.csproj index 1bf9110..d86ff93 100644 --- a/Hathor.Wallet.Tests/Hathor.Wallet.Tests.csproj +++ b/Hathor.Wallet.Tests/Hathor.Wallet.Tests.csproj @@ -7,11 +7,11 @@ - + - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Hathor/IHathorWalletApi.cs b/Hathor/IHathorWalletApi.cs index 04b11de..6926c08 100644 --- a/Hathor/IHathorWalletApi.cs +++ b/Hathor/IHathorWalletApi.cs @@ -20,6 +20,9 @@ public interface IHathorWalletApi [Post("start")] Task Start([Body]StartRequest startRequest); + [Get("health")] + Task GetHealth([Query]string? wallet_ids = null, [Query] bool? include_fullnode = null, [Query] bool? include_tx_mining = null); + [Post("wallet/stop")] Task Stop(); diff --git a/Hathor/Models/Responses/HealthResponse.cs b/Hathor/Models/Responses/HealthResponse.cs new file mode 100644 index 0000000..06c4c42 --- /dev/null +++ b/Hathor/Models/Responses/HealthResponse.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json.Serialization; +using System.Threading.Tasks; + +namespace Hathor.Models.Responses +{ + public class HealthResponse + { + [JsonPropertyName("status")] + public string? Status { get; set; } + + [JsonPropertyName("description")] + public string? Description { get; set; } + + [JsonPropertyName("checks")] + public Checks? Checks { get; set; } + } + + public class Checks + { + [JsonPropertyName("fullnode")] + public List Fullnode { get; set; } = new(); + + [JsonPropertyName("txMining")] + public List TxMining { get; set; } = new(); + } + + public class FullnodeStatus + { + [JsonPropertyName("status")] + public string? Status { get; set; } + + [JsonPropertyName("componentType")] + public string? ComponentType { get; set; } + + [JsonPropertyName("componentName")] + public string? ComponentName { get; set; } + + [JsonPropertyName("output")] + public string? Output { get; set; } + } + + +} diff --git a/Hathor/Models/Responses/StatusResponse.cs b/Hathor/Models/Responses/StatusResponse.cs index b0e06eb..2987b1f 100644 --- a/Hathor/Models/Responses/StatusResponse.cs +++ b/Hathor/Models/Responses/StatusResponse.cs @@ -22,6 +22,9 @@ public class StatusResponse : DefaultResponse [JsonProperty(PropertyName = "serverUrl")] public string? ServerUrl { get; set; } + [JsonProperty(PropertyName = "statusMessage")] + public string? StatusMessage { get; set; } + [JsonProperty(PropertyName = "state")] public int? State { get; set; } } diff --git a/README.md b/README.md index 44ca1da..70a5494 100644 --- a/README.md +++ b/README.md @@ -105,3 +105,6 @@ var balanceInfo = await nodeClient.GetBalanceForAddress("ANY HATHOR ADDRESS") ## Acknowledgements Development has been made possible with a grant from [Hathor](https://hathor.network). + +## Hathor API Reference +https://docs.hathor.network/references/headless-wallet/http-api/