Installing & Importing PWR SDK
Use PWR SDK to easily read, send transactions, and easily interact with the PWR Chain
First step of building on PWR Chain is installing and importing the PWR SDK. This SDK is available in many coding languages, and helps developers read data, send transactions, and easily interact with PWR Chain.
Installing SDK
You will install the PWR Chain SDK library the same way you do for each language:
- JavaScript
- Python
- Rust
- Go
- Java Maven
- Java Gradle
npm install @pwrjs/core
// or
yarn add @pwrjs/core
// or
pnpm add @pwrjs/core
pip install pwrpy
// or
pip3 install pwrpy
cargo add pwr-rs
go get github.com/pwrlabs/pwrgo
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.github.pwrlabs</groupId>
<artifactId>pwrj</artifactId>
<version>7.1.0</version>
</dependency>
</dependencies>
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.pwrlabs:pwrj:7.1.0'
}
Importing SDKs
After you have installed sdks, you can import them in your project:
- JavaScript
- Python
- Rust
- Go
- Java
import { PWRJS, PWRWallet } from '@pwrjs/core';
// or
const { PWRJS, PWRWallet } = require('@pwrjs/core');
from pwrpy.pwrapisdk import PWRPY
from pwrpy.pwrwallet import PWRWallet
use pwr_rs::{ Wallet, RPC };
import (
"github.com/pwrlabs/pwrgo/wallet"
"github.com/pwrlabs/pwrgo/rpc"
)
import com.github.pwrlabs.pwrj.protocol.PWRJ;
import com.github.pwrlabs.pwrj.protocol.TransactionBuilder;
import com.github.pwrlabs.pwrj.record.validator.Validator;
import com.github.pwrlabs.pwrj.wallet.PWRWallet;
Once you have installed and imported the PWR SDK into your application you can start to the next sections to learn about everything you need to build your project.
You can jump to PWR Chain examples on github for more examples.