Nethereum.Parity
7.1.0
Prefix Reserved
dotnet add package Nethereum.Parity --version 7.1.0
NuGet\Install-Package Nethereum.Parity -Version 7.1.0
<PackageReference Include="Nethereum.Parity" Version="7.1.0" />
<PackageVersion Include="Nethereum.Parity" Version="7.1.0" />
<PackageReference Include="Nethereum.Parity" />
paket add Nethereum.Parity --version 7.1.0
#r "nuget: Nethereum.Parity, 7.1.0"
#:package Nethereum.Parity@7.1.0
#addin nuget:?package=Nethereum.Parity&version=7.1.0
#tool nuget:?package=Nethereum.Parity&version=7.1.0
Nethereum.Parity
Web3Parity: Nethereum's Web3 extended with the Parity / OpenEthereum parity_* and trace_* JSON-RPC methods
Overview
Nethereum.Parity is a thin client library. It contains one Web3 subclass, Web3Parity, five service groups that expose typed request handlers for the Parity-specific RPC methods, and the request builders used for Parity's parity_subscribe / parity_unsubscribe. There is no node-side logic and no Parity-specific data model: results come back as JObject, JArray, string, int or HexBigInteger.
Use it only if you talk to a node that serves the parity_* or trace_* methods (Parity, OpenEthereum and compatible clients). For everything else keep using Web3; Web3Parity derives from Web3.Web3, so web3.Eth, web3.Net and the rest are unchanged. The source does not mark the package obsolete. The package description says: "Nethereum.Parity is the extended Web3 library for Parity, including the non-generic RPC API client methods."
For reactive parity_subscribe subscriptions see Nethereum.Parity.Reactive.
Installation
dotnet add package Nethereum.Parity
Depends on Nethereum.RPC and Nethereum.Web3.
Web3Parity
public interface IWeb3Parity : IWeb3
{
IAccountsApiService Accounts { get; }
IAdminApiService Admin { get; }
IBlockAuthoringApiService BlockAuthoring { get; }
INetworkApiService Network { get; }
ITraceApiService Trace { get; }
}
public class Web3Parity : Web3.Web3, IWeb3Parity
{
public Web3Parity(IClient client)
public Web3Parity(string url = @"http://localhost:8545/", ILogger log = null, AuthenticationHeaderValue authenticationHeader = null)
public Web3Parity(IAccount account, IClient client)
public Web3Parity(IAccount account, string url = @"http://localhost:8545/", ILogger log = null, AuthenticationHeaderValue authenticationHeader = null)
}
The five properties are created when the Web3 inner services are initialised.
var web3 = new Web3Parity(client);
var versionInfo = await web3.Admin.VersionInfo.SendRequestAsync();
var netPort = await web3.Network.NetPort.SendRequestAsync();
var minGasPrice = await web3.BlockAuthoring.MinGasPrice.SendRequestAsync();
versionInfo is a JObject (hash, track, version), netPort an int, and minGasPrice a HexBigInteger. The three calls send parity_versionInfo, parity_netPort and parity_minGasPrice. Backed by ParityClientRequestTests.ShouldCallParityMethodsThroughTheServiceGroups (DocSection.ClientExtensions, parity-client, Order 1) in tests/Nethereum.Parity.IntegrationTests/ParityClientRequestTests.cs, which runs Web3Parity over a canned-response IClient and therefore needs no node.
Service groups
Every handler exposes SendRequestAsync(...) and, for those with parameters, BuildRequest(...); the parameterless handlers derive from GenericRpcRequestResponseHandlerNoParam<T> (in Nethereum.RPC.Infrastructure), which implements IGenericRpcRequestResponseHandlerNoParam<T>, whose only member is SendRequestAsync(object id = null). GenericRpcRequestResponseHandlerNoParam<T> itself derives from RpcRequestResponseHandlerNoParam<T>, and BuildRequest(object id = null) comes from that class, so it is not reachable through the interface-typed properties of the service groups.
Accounts (IAccountsApiService)
| Property | RPC method | Result |
|---|---|---|
AccountsInfo |
parity_accountsInfo |
JObject |
DefaultAccount |
parity_defaultAccount |
string |
GenerateSecretPhrase |
parity_generateSecretPhrase |
string |
HardwareAccountsInfo |
parity_hardwareAccountsInfo |
JObject |
Admin (IAdminApiService)
| Property | RPC method | Result |
|---|---|---|
ParityListStorageKeys |
parity_listStorageKeys |
string[] |
ConsensusCapability |
parity_consensusCapability |
string |
ListOpenedVaults |
parity_listOpenedVaults |
string[] |
ListVaults |
parity_listVaults |
string[] |
LocalTransactions |
parity_localTransactions |
JObject |
PendingTransactionsStats |
parity_pendingTransactionsStats |
JObject |
ReleasesInfo |
parity_releasesInfo |
JObject |
VersionInfo |
parity_versionInfo |
JObject |
IParityListStorageKeys takes parameters:
public interface IParityListStorageKeys
{
Task<string[]> SendRequestAsync(string address, int quantity, string hash, object id = null);
Task<string[]> SendRequestAsync(string address, int quantity, string hash, BlockParameter blockNumber, object id = null);
RpcRequest BuildRequest(string address, int quantity, string hash, object id = null);
RpcRequest BuildRequest(string address, int quantity, string hash, BlockParameter blockNumber, object id = null);
}
Block authoring (IBlockAuthoringApiService)
| Property | RPC method | Result |
|---|---|---|
DefaultExtraData |
parity_defaultExtraData |
string |
ExtraData |
parity_extraData |
string |
GasCeilTarget |
parity_gasCeilTarget |
HexBigInteger |
GasFloorTarget |
parity_gasFloorTarget |
HexBigInteger |
MinGasPrice |
parity_minGasPrice |
HexBigInteger |
TransactionsLimit |
parity_transactionsLimit |
int |
Network (INetworkApiService)
| Property | RPC method | Result |
|---|---|---|
ChainStatus |
parity_chainStatus |
JObject |
GasPriceHistogram |
parity_gasPriceHistogram |
JObject |
NetPeers |
parity_netPeers |
JObject |
NetPort |
parity_netPort |
int |
PendingTransactions |
parity_pendingTransactions |
JArray |
Trace (ITraceApiService)
public interface ITraceBlock
{
RpcRequest BuildRequest(HexBigInteger blockNumber, object id = null);
Task<JArray> SendRequestAsync(HexBigInteger blockNumber, object id = null);
}
public interface ITraceCall
{
RpcRequest BuildRequest(CallInput callInput, TraceType[] typeOfTrace, BlockParameter block, object id = null);
Task<JObject> SendRequestAsync(CallInput callInput, TraceType[] typeOfTrace, BlockParameter block, object id = null);
}
public interface ITraceFilter
{
RpcRequest BuildRequest(TraceFilterDTO traceFilter, object id = null);
Task<JArray> SendRequestAsync(TraceFilterDTO traceFilter, object id = null);
}
public interface ITraceGet
{
RpcRequest BuildRequest(string transactionHash, HexBigInteger[] index, object id = null);
Task<JObject> SendRequestAsync(string transactionHash, HexBigInteger[] index, object id = null);
}
public interface ITraceRawTransaction
{
RpcRequest BuildRequest(string rawTransaction, TraceType[] traceTypes, object id = null);
Task<JObject> SendRequestAsync(string rawTransaction, TraceType[] traceTypes, object id = null);
}
public interface ITraceTransaction
{
RpcRequest BuildRequest(string transactionHash, object id = null);
Task<JArray> SendRequestAsync(string transactionHash, object id = null);
}
public enum TraceType { vmTrace, trace, stateDiff }
public static class TraceTypeExtensions
{
public static string[] ConvertToStringArray(this TraceType[] value)
}
ITraceApiService exposes them as TraceBlock, TraceCall, TraceFilter, TraceGet, TraceRawTransaction and TraceTransaction (RPC methods trace_block, trace_call, trace_filter, trace_get, trace_rawTransaction, trace_transaction). TraceFilterDTO (Nethereum.Parity.RPC.Trace.TraceDTOs) has FromBlock, ToBlock (BlockParameter), FromAddresses, ToAddress (string[]), Count and After (int), serialised as fromBlock, toBlock, fromAddress, toAddress, count, after.
var traces = await web3.Trace.TraceTransaction.SendRequestAsync(TransactionHash);
var callInput = new CallInput { To = "0x12890d2cce102216644c59daE5baed380d84830c" };
var request = web3.Trace.TraceCall.BuildRequest(
callInput, new[] { TraceType.trace, TraceType.stateDiff }, BlockParameter.CreateLatest());
traces is a JArray of trace entries. BuildRequest creates the trace_call request without sending it; TraceType values are sent as the strings "trace" and "stateDiff", converted by TraceTypeExtensions.ConvertToStringArray (each value's ToString()). Backed by ParityClientRequestTests.ShouldTraceATransactionAndBuildATraceCallRequest (parity-client, Order 2).
Other types
Nethereum.Parity.RPC.ApiMethodsis an enum of Parity method names (parity_*,trace_*,parity_subscribe,parity_unsubscribe). It lists more methods than the package has handlers for; the handlers are the ones in the tables above plusParityDevLogs(parity_devLogs,string[]) andParityDevLogsLevels(parity_devLogsLevels,string), which are classes you construct with anIClientand are not attached toWeb3Parity.ParitySubscribeRequestBuilderandParityUnsubscribeRequestBuilder(Nethereum.Parity.RPC.PubSub):
public class ParitySubscribeRequestBuilder : RpcRequestBuilder
{
public RpcRequest BuildRequest(RpcRequest originalRequestToSubscribe, object id = null)
}
public class ParityUnsubscribeRequestBuilder : RpcRequestBuilder, IUnsubscribeSubscriptionRpcRequestBuilder
{
public RpcRequest BuildRequest(string subscriptionHash, object id = null)
}
ParitySubscribeRequestBuilder wraps any request into a parity_subscribe request whose parameters are the original method name followed by the original parameters; a null id becomes a new GUID string. ParityUnsubscribeRequestBuilder builds parity_unsubscribe with the subscription hash, adding the 0x prefix when missing.
var original = new RpcRequest(1, "eth_getBalance", "0x12890d2cce102216644c59daE5baed380d84830c", "latest");
var subscribe = new ParitySubscribeRequestBuilder().BuildRequest(original, "sub-1");
var unsubscribe = new ParityUnsubscribeRequestBuilder().BuildRequest("abcd", "unsub-1");
Backed by ParityClientRequestTests.ShouldWrapARequestInAParitySubscribeRequest (parity-client, Order 3).
Tests
tests/Nethereum.Parity.IntegrationTests also contains one *Tester class per RPC method (for example TraceTransactionTester), which run against a live Parity node configured in test-settings.json (rpcUrl http://localhost:8545/); they are not part of the examples above.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net451 is compatible. net452 was computed. net46 was computed. net461 is compatible. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.5.1
- Nethereum.RPC (>= 7.1.0)
- Nethereum.Web3 (>= 7.1.0)
- Newtonsoft.Json (>= 13.0.4 && < 14.0.0)
-
.NETFramework 4.6.1
- Nethereum.RPC (>= 7.1.0)
- Nethereum.Web3 (>= 7.1.0)
- Newtonsoft.Json (>= 13.0.4 && < 14.0.0)
-
.NETStandard 2.0
- Nethereum.RPC (>= 7.1.0)
- Nethereum.Web3 (>= 7.1.0)
- NETStandard.Library (>= 2.0.3)
- Newtonsoft.Json (>= 13.0.4 && < 14.0.0)
-
net10.0
- Nethereum.RPC (>= 7.1.0)
- Nethereum.Web3 (>= 7.1.0)
- Newtonsoft.Json (>= 13.0.4 && < 14.0.0)
-
net6.0
- Nethereum.RPC (>= 7.1.0)
- Nethereum.Web3 (>= 7.1.0)
- Newtonsoft.Json (>= 13.0.4 && < 14.0.0)
-
net8.0
- Nethereum.RPC (>= 7.1.0)
- Nethereum.Web3 (>= 7.1.0)
- Newtonsoft.Json (>= 13.0.4 && < 14.0.0)
-
net9.0
- Nethereum.RPC (>= 7.1.0)
- Nethereum.Web3 (>= 7.1.0)
- Newtonsoft.Json (>= 13.0.4 && < 14.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Nethereum.Parity:
| Package | Downloads |
|---|---|
|
Nethereum.Parity.Reactive
Nethereum.Parity.Reactive, Reactive Client Subscriptions pub / sub for Parity |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 7.1.0 | 150 | 11/10/2026 |
| 7.0.0 | 362 | 10/2/2026 |
| 6.1.0 | 1,945 | 3/25/2026 |
| 6.0.4 | 286 | 3/18/2026 |
| 6.0.3 | 205 | 3/18/2026 |
| 6.0.1 | 223 | 3/17/2026 |
| 6.0.0 | 213 | 3/16/2026 |
| 5.8.0 | 1,692 | 1/6/2026 |
| 5.0.0 | 17,250 | 5/28/2025 |
| 4.29.0 | 1,155 | 2/10/2025 |
| 4.28.0 | 655 | 1/7/2025 |
| 4.27.1 | 450 | 12/24/2024 |
| 4.27.0 | 416 | 12/24/2024 |
| 4.26.0 | 861 | 10/1/2024 |
| 4.25.0 | 625 | 9/19/2024 |
| 4.21.4 | 21,770 | 8/9/2024 |
| 4.21.3 | 469 | 7/22/2024 |
| 4.21.2 | 626 | 6/26/2024 |
| 4.21.1 | 1,013 | 6/26/2024 |
| 4.21.0 | 511 | 6/18/2024 |