PWR 1.0.0
See the version list below for details.
dotnet add package PWR --version 1.0.0
NuGet\Install-Package PWR -Version 1.0.0
<PackageReference Include="PWR" Version="1.0.0" />
paket add PWR --version 1.0.0
#r "nuget: PWR, 1.0.0"
// 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
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 | Versions 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. |
-
net8.0
- Microsoft.Extensions.Logging (>= 9.0.3)
- Microsoft.Extensions.Logging.Console (>= 9.0.3)
- Nethereum.Signer (>= 4.18.0)
-
net9.0
- Microsoft.Extensions.Logging (>= 9.0.3)
- Microsoft.Extensions.Logging.Console (>= 9.0.3)
- Nethereum.Signer (>= 4.18.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.