-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement signatures and performance methods (#64)
* Implements signature methods and performance samples.
- Loading branch information
1 parent
3db161a
commit a81d695
Showing
19 changed files
with
561 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
namespace Solnet.Rpc.Models | ||
{ | ||
/// <summary> | ||
/// Represents a performance sample. | ||
/// </summary> | ||
public class PerformanceSample | ||
{ | ||
/// <summary> | ||
/// Slot in which sample was taken at. | ||
/// </summary> | ||
public ulong Slot { get; set; } | ||
|
||
/// <summary> | ||
/// Number of transactions in sample. | ||
/// </summary> | ||
public ulong NumTransactions { get; set; } | ||
|
||
/// <summary> | ||
/// Number of slots in sample | ||
/// </summary> | ||
public ulong NumSlots { get; set; } | ||
|
||
/// <summary> | ||
/// Number of seconds in a sample window. | ||
/// </summary> | ||
public int SamplePeriodSecs { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Solnet.Rpc.Models | ||
{ | ||
/// <summary> | ||
/// Represents the signature status information. | ||
/// </summary> | ||
public class SignatureStatusInfo | ||
{ | ||
/// <summary> | ||
/// The slot the transaction was processed in. | ||
/// </summary> | ||
public ulong Slot { get; set; } | ||
|
||
/// <summary> | ||
/// The number of blocks since signature confirmation. | ||
/// </summary> | ||
public ulong? Confirmations { get; set; } | ||
|
||
/// <summary> | ||
/// The error if the transaction failed, null if it succeeded. | ||
/// </summary> | ||
[JsonPropertyName("err")] | ||
public TransactionError Error { get; set; } | ||
|
||
/// <summary> | ||
/// The transaction's cluster confirmation status, either "processed", "confirmed" or "finalized". | ||
/// </summary> | ||
public string ConfirmationStatus { get; set; } | ||
|
||
/// <summary> | ||
/// Memo associated with the transaction, null if no memo is present. | ||
/// </summary> | ||
public string Memo { get; set; } | ||
|
||
/// <summary> | ||
/// The transaction signature as base-58 encoded string. | ||
/// </summary> | ||
public string Signature { get; set; } | ||
|
||
/// <summary> | ||
/// Estimated production time as Unix timestamp, null if not available. | ||
/// </summary> | ||
public ulong? BlockTime { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
test/Solnet.Rpc.Test/Resources/Http/GetRecentPerformanceSamplesRequest.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"method":"getRecentPerformanceSamples","params":[4],"jsonrpc":"2.0","id":0} |
30 changes: 30 additions & 0 deletions
30
test/Solnet.Rpc.Test/Resources/Http/GetRecentPerformanceSamplesResponse.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"jsonrpc": "2.0", | ||
"result": [ | ||
{ | ||
"numSlots": 126, | ||
"numTransactions": 126, | ||
"samplePeriodSecs": 60, | ||
"slot": 348125 | ||
}, | ||
{ | ||
"numSlots": 126, | ||
"numTransactions": 126, | ||
"samplePeriodSecs": 60, | ||
"slot": 347999 | ||
}, | ||
{ | ||
"numSlots": 125, | ||
"numTransactions": 125, | ||
"samplePeriodSecs": 60, | ||
"slot": 347873 | ||
}, | ||
{ | ||
"numSlots": 125, | ||
"numTransactions": 125, | ||
"samplePeriodSecs": 60, | ||
"slot": 347748 | ||
} | ||
], | ||
"id": 1 | ||
} |
1 change: 1 addition & 0 deletions
1
test/Solnet.Rpc.Test/Resources/Http/Signatures/GetSignatureStatusesRequest.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"method":"getSignatureStatuses","params":[["5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW","5j7s6NiJS3JAkvgkoc18WVAsiSaci2pxB2A6ueCJP4tprA2TFg9wSyTLeYouxPBJEMzJinENTkpA52YStRW5Dia7"]],"jsonrpc":"2.0","id":0} |
21 changes: 21 additions & 0 deletions
21
test/Solnet.Rpc.Test/Resources/Http/Signatures/GetSignatureStatusesResponse.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"jsonrpc": "2.0", | ||
"result": { | ||
"context": { | ||
"slot": 82 | ||
}, | ||
"value": [ | ||
{ | ||
"slot": 72, | ||
"confirmations": 10, | ||
"err": null, | ||
"status": { | ||
"Ok": null | ||
}, | ||
"confirmationStatus": "confirmed" | ||
}, | ||
null | ||
] | ||
}, | ||
"id": 0 | ||
} |
1 change: 1 addition & 0 deletions
1
test/Solnet.Rpc.Test/Resources/Http/Signatures/GetSignatureStatusesWithHistoryRequest.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"method":"getSignatureStatuses","params":[["5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW","5j7s6NiJS3JAkvgkoc18WVAsiSaci2pxB2A6ueCJP4tprA2TFg9wSyTLeYouxPBJEMzJinENTkpA52YStRW5Dia7"],{"searchTransactionHistory":true}],"jsonrpc":"2.0","id":0} |
21 changes: 21 additions & 0 deletions
21
test/Solnet.Rpc.Test/Resources/Http/Signatures/GetSignatureStatusesWithHistoryResponse.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"jsonrpc": "2.0", | ||
"result": { | ||
"context": { | ||
"slot": 82 | ||
}, | ||
"value": [ | ||
{ | ||
"slot": 48, | ||
"confirmations": null, | ||
"err": null, | ||
"status": { | ||
"Ok": null | ||
}, | ||
"confirmationStatus": "finalized" | ||
}, | ||
null | ||
] | ||
}, | ||
"id": 0 | ||
} |
1 change: 1 addition & 0 deletions
1
test/Solnet.Rpc.Test/Resources/Http/Signatures/GetSignaturesForAddressBeforeRequest.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"method":"getSignaturesForAddress","params":["Vote111111111111111111111111111111111111111",{"limit":1,"before":"Vote111111111111111111111111111111111111111"}],"jsonrpc":"2.0","id":0} |
13 changes: 13 additions & 0 deletions
13
test/Solnet.Rpc.Test/Resources/Http/Signatures/GetSignaturesForAddressBeforeResponse.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"jsonrpc": "2.0", | ||
"result": [ | ||
{ | ||
"err": null, | ||
"memo": null, | ||
"signature": "5h6xBEauJ3PK6SWCZ1PGjBvj8vDdWG3KpwATGy1ARAXFSDwt8GFXM7W5Ncn16wmqokgpiKRLuS83KUxyZyv2sUYv", | ||
"slot": 114, | ||
"blockTime": null | ||
} | ||
], | ||
"id": 1 | ||
} |
1 change: 1 addition & 0 deletions
1
test/Solnet.Rpc.Test/Resources/Http/Signatures/GetSignaturesForAddressRequest.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"method":"getSignaturesForAddress","params":["4Rf9mGD7FeYknun5JczX5nGLTfQuS1GRjNVfkEMKE92b",{"limit":3}],"jsonrpc":"2.0","id":0} |
30 changes: 30 additions & 0 deletions
30
test/Solnet.Rpc.Test/Resources/Http/Signatures/GetSignaturesForAddressResponse.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"jsonrpc": "2.0", | ||
"result": [ | ||
{ | ||
"blockTime": 1616245823, | ||
"confirmationStatus": "finalized", | ||
"err": null, | ||
"memo": null, | ||
"signature": "5Jofwx5JcPT1dMsgo6DkyT6x61X5chS9K7hM7huGKAnUq8xxHwGKuDnnZmPGoapWVZcN4cPvQtGNCicnWZfPHowr", | ||
"slot": 68710495 | ||
}, | ||
{ | ||
"blockTime": 1615234539, | ||
"confirmationStatus": "finalized", | ||
"err": null, | ||
"memo": null, | ||
"signature": "2Y8fUdkvA9WG7eBBjtPdTxhUhrGAGAPVZMgze4mrjWobJsM5varX1z42VrfvQDoMXhYstVyABfPSaWrPxPWMsMmA", | ||
"slot": 66979017 | ||
}, | ||
{ | ||
"blockTime": 1612818924, | ||
"confirmationStatus": "finalized", | ||
"err": null, | ||
"memo": null, | ||
"signature": "3TVD8hze8GrGZRNEcqnh5WR45F2Wu2Xmxf2HAPwXaL5H5yrRhxAsbdKbUBSXHpPnXeGPq6HBwoa7ZUCegiM4hb3U", | ||
"slot": 62482980 | ||
} | ||
], | ||
"id": 1 | ||
} |
1 change: 1 addition & 0 deletions
1
test/Solnet.Rpc.Test/Resources/Http/Signatures/GetSignaturesForAddressUntilRequest.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"method":"getSignaturesForAddress","params":["Vote111111111111111111111111111111111111111",{"limit":1,"until":"Vote111111111111111111111111111111111111111"}],"jsonrpc":"2.0","id":0} |
13 changes: 13 additions & 0 deletions
13
test/Solnet.Rpc.Test/Resources/Http/Signatures/GetSignaturesForAddressUntilResponse.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"jsonrpc": "2.0", | ||
"result": [ | ||
{ | ||
"err": null, | ||
"memo": null, | ||
"signature": "5h6xBEauJ3PK6SWCZ1PGjBvj8vDdWG3KpwATGy1ARAXFSDwt8GFXM7W5Ncn16wmqokgpiKRLuS83KUxyZyv2sUYv", | ||
"slot": 114, | ||
"blockTime": null | ||
} | ||
], | ||
"id": 1 | ||
} |
Oops, something went wrong.