Skip to main content

ResQ.Blockchain

NeoClientOptions Class

Configuration options for the Neo N3 blockchain client.
public class NeoClientOptions
Inheritance System.Object → NeoClientOptions

Example

// Configuration in appsettings.json
{
  "NeoClientOptions": {
    "RpcUrl": "https://testnet1.neo.coz.io:443",
    "NetworkMagic": 894710606,
    "ContractHash": "0x8d35a57f8c01156527c92ebbb4d772fa9574cbf4",
    "MockMode": false,
    "ConfirmationTimeoutSeconds": 30,
    "MaxRetryAttempts": 3
  }
}

// Registration with dependency injection
services.Configure<NeoClientOptions>(configuration.GetSection("NeoClientOptions"));

// Usage in a service
public class MyService
{
    private readonly NeoClientOptions _options;
    
    public MyService(IOptions<NeoClientOptions> options)
    {
        _options = options.Value;
    }
}

Remarks

This class provides configuration settings for connecting to the Neo N3 blockchain, including RPC endpoint, network identification, contract addresses, and operational parameters such as timeouts and retry logic. For development and testing, set MockMode to true to use the mock client implementation. For production, configure the RpcUrl to point to a reliable Neo N3 RPC endpoint and provide the wallet path for transaction signing.
Properties
ConfirmationTimeoutSecondsGets or sets the timeout for waiting for transaction confirmation.
ContractHashGets or sets the smart contract script hash for ResQ event recording.
MaxRetryAttemptsGets or sets the maximum number of retry attempts for failed transactions.
MockModeGets or sets a value indicating whether to use mock mode for testing.
NetworkMagicGets or sets the network magic number for identifying the Neo network.
RpcUrlGets or sets the Neo N3 RPC endpoint URL.
WalletPathGets or sets the file path to the wallet for transaction signing.