Class MavrykRpc
Rpc queries builder
Inheritance
Namespace: Netmavryk.Rpc
Assembly: Netmavryk.dll
Syntax
public class MavrykRpc : IDisposable
Constructors
| Improve this Doc View SourceMavrykRpc(HttpClient, Chain)
Creates the instance of MavrykRpc
Declaration
public MavrykRpc(HttpClient client, Chain chain = Chain.Main)
Parameters
| Type | Name | Description |
|---|---|---|
| HttpClient | client | HttpClient instance that will be used for sending RPC requests. |
| Chain | chain | Chain to work with. Note: this is not a network (mainnet or testnet), but a chain of the network. In 99.99% cases you likely want to use Chain.Main, because Chain.Test is only relevant during the testing phase of the Mavryk voting process. |
MavrykRpc(String, Chain)
Creates the instance of MavrykRpc
Declaration
public MavrykRpc(string uri, Chain chain = Chain.Main)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | uri | Base URI of the node |
| Chain | chain | Chain to work with. Note: this is not a network (mainnet or testnet), but a chain of the particular network. In 99.99% cases you likely want to use Chain.Main, because Chain.Test is only relevant during the testing phase of the Mavryk voting process. |
MavrykRpc(String, Int32, Chain)
Creates the instance of MavrykRpc
Declaration
public MavrykRpc(string uri, int timeout, Chain chain = Chain.Main)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | uri | Base URI of the node |
| System.Int32 | timeout | Timeout in seconds for the requests |
| Chain | chain | Chain to work with. Note: this is not a network (mainnet or testnet), but a chain of the network. In 99.99% cases you likely want to use Chain.Main, because Chain.Test is only relevant during the testing phase of the Mavryk voting process. |
Properties
| Improve this Doc View SourceBlocks
Gets the query to the blocks
Declaration
public BlocksQuery Blocks { get; }
Property Value
| Type | Description |
|---|---|
| BlocksQuery |
Inject
Gets the query to the injection
Declaration
public InjectionQuery Inject { get; }
Property Value
| Type | Description |
|---|---|
| InjectionQuery |
Methods
| Improve this Doc View SourceDispose()
Releases the unmanaged resources and disposes of the managed resources used by the MavrykRpc
Declaration
public void Dispose()
GetAsync(String)
Sends request and returns the dynamic json object
Declaration
public Task<dynamic> GetAsync(string query)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | query | Relative path to the RPC method |
Returns
| Type | Description |
|---|---|
| Task<System.Object> |
GetAsync<T>(String)
Sends request and returns the json object, deserialized to the specified type
Declaration
public Task<T> GetAsync<T>(string query)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | query | Relative path to the RPC method |
Returns
| Type | Description |
|---|---|
| Task<T> |
Type Parameters
| Name | Description |
|---|---|
| T | Type of the object to deserialize to |