Skip to content
This repository has been archived by the owner on May 23, 2021. It is now read-only.

Commit

Permalink
RPC response types
Browse files Browse the repository at this point in the history
  • Loading branch information
h4x3rotab committed Feb 2, 2020
1 parent c2ca160 commit 4b10716
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 1 deletion.
25 changes: 25 additions & 0 deletions CheckerApi/Models/Rpc/GetChainTipsResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using Newtonsoft.Json;

namespace CheckerApi.Models.Rpc
{
public class GetChainTipsResult
{
[JsonProperty("result")]
public ChainTip[] Result { get; set; }
}

public class ChainTip
{
[JsonProperty("height")]
public int Height { get; set; }

[JsonProperty("hash")]
public string Hash { get; set; }

[JsonProperty("branchlen")]
public int BranchLen { get; set; }

[JsonProperty("status")]
public string Status { get; set; }
}
}
20 changes: 19 additions & 1 deletion CheckerApi/Models/Rpc/RpcBlockInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace CheckerApi.Models.Rpc
{
public class RpcBlockInfo
public class RpcBlockInfoBase
{
[JsonProperty("hash")]
public string Hash { get; set; }
Expand All @@ -15,6 +15,24 @@ public class RpcBlockInfo

[JsonProperty("previousblockhash")]
public string PreviousBlockHash { get; set; }

[JsonProperty("chainwork")]
public string ChainWork { get; set; }

[JsonProperty("confirmations")]
public int Confirmations { get; set; }
}

public class RpcBlockInfo : RpcBlockInfoBase
{
[JsonProperty("tx")]
public string[] Tx { get; set; }
}

public class RpcBlockInfoVerbose : RpcBlockInfoBase
{
[JsonProperty("tx")]
public Transaction[] Tx { get; set; }
}

public class RpcBlockResult
Expand Down
10 changes: 10 additions & 0 deletions CheckerApi/Models/Rpc/Transaction.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using Newtonsoft.Json;

namespace CheckerApi.Models.Rpc
{
public class Transaction
{
[JsonProperty("txid")]
public string TxId { get; set; }
}
}

0 comments on commit 4b10716

Please sign in to comment.