PWR

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


Keywords
PWR, PWRCS
License
MIT
Install
Install-Package PWR -Version 1.1.0

Documentation

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.