PWR 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package PWR --version 1.0.0                
NuGet\Install-Package PWR -Version 1.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PWR" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PWR --version 1.0.0                
#r "nuget: PWR, 1.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install PWR as a Cake Addin
#addin nuget:?package=PWR&version=1.0.0

// Install PWR as a Cake Tool
#tool nuget:?package=PWR&version=1.0.0                

PWR

PWR is a C# library for interacting with the PWR network. It provides an easy interface for wallet management and sending transactions on PWR.

🌐 Documentation

How to Guides 🔜 & API 💻

Play with Code Examples 🎮

Installation

PWR is available on The NuGet Gallery. Add this dependency to your .csproj file:

dotnet add package PWR

💫 Getting Started

Import the library:

using PWR;
using PWR.Models;

Set your RPC node:

var rpc = new PwrApiSdk("https://pwrrpc.pwrlabs.io/");

Import wallet by PK:

string privateKey = "0xac0974bec...f80";
var wallet = new PwrWallet(privateKey); 

Get wallet address:

string address = await wallet.GetAddress();

Get wallet balance:

ulong balance = await wallet.GetBalance();

Transfer PWR tokens:

var response = await wallet.TransferPWR("recipientAddress", amount); 

Sending a transcation to the PWR Chain returns a Response object, which specified if the transaction was a success, and returns relevant data. If the transaction was a success, you can retrieive the transaction hash, if it failed, you can fetch the error.

WalletResponse r = await wallet.TransferPWR("recipientAddress", amount); 

if(r.isSuccess) {
   	Console.WriteLine("Transcation Hash: " + r.Message);
} else {
	Console.WriteLine("Error: " + r.Error);
}

Send data to a VM:

uint vmId = 123;
byte[] data = Encoding.UTF8.GetBytes("Hello, World!");
var r = await wallet.SendVMData(vmId, data);

if(r.isSuccess) {
    Console.WriteLine("Transcation Hash: " + r.Message);
} else {
    Console.WriteLine("Error: " + r.Error);
}

Other Static Calls

Get RPC Node Url:

Returns currently set RPC node URL.

var url = rpc.GetRpcNodeUrl()

Get Fee Per Byte:

Gets the latest fee-per-byte rate.

ulong fee = await rpc.GetFeePerByte();

Get Balance Of Address:

Gets the balance of a specific address.

ulong balance = await rpc.GetBalanceOfAddress("0x...");

Get Nonce Of Address:

Gets the nonce/transaction count of a specific address.

uint nonce = await rpc.GetNonceOfAddress("0x..."); 

✏️ Contributing

If you consider to contribute to this project please read CONTRIBUTING.md first.

You can also join our dedicated channel for developers on the PWR Chain Discord

📜 License

Copyright (c) 2025 PWR Labs

Licensed under the MIT license.

Product Compatible and additional computed target framework versions.
.NET 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.0 114 3/24/2025
1.0.0 119 3/17/2025