Observed since 20 Oct, 22:43 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.

A complete, fast and slim SDK to interact with the Pocket Network.
Add the packages for each part to your project:
yarn add @pokt-foundation/pocketjs-provider @pokt-foundation/pocketjs-signer @pokt-foundation/pocketjs-transaction-builder @pokt-foundation/pocketjs-relayer @pokt-foundation/pocketjs-utils
And use each piece as you see fit:
import { JsonRpcProvider } from "@0xbigboss/pocketjs-provider";
import { KeyManager } from "@0xbigboss/pocketjs-signer";
import { TransactionBuilder } from "@0xbigboss/pocketjs-transaction-builder";
import { Relayer } from "@0xbigboss/pocketjs-relayer";
import {
MAINNET_RPC_URL,
DISPATCHERS,
RELAY_DATA,
POCKET_AAT,
} from "./config.js";
// Instantiate a provider for querying information on the chain!
export const provider = new JsonRpcProvider({
rpcUrl: MAINNET_RPC_URL,
// If you'll Instantiate a relayer, you need to add dispatchers as well
dispatchers: DISPATCHERS,
});
const balance = await provider.getBalance(
"07a6fca4dea9f01e4c19f301df0d0afac128561b"
);
// Instantiate a signer for importing an account and signing messages!
export const signer = await KeyManager.fromPrivateKey(process.env.PRIVATE_KEY);
const address = signer.getAddress();
const publicKey = signer.getPublicKey();
const signedMessage = signer.sign("deadbeef");
// Instantiate a new TransactionBuilder for creating transaction messages and
// and sending them over the network!
export const transactionBuilder = new TransactionBuilder({
provider,
signer,
});
// Create a new `Send` Message which is used to send funds over the network.
const sendMsg = transactionBuilder.send(
signer.getAddress(),
"07a6fca4dea9f01e4c19f301df0d0afac128561b",
// Amount in uPOKT (1 POKT = 1*10^6 uPOKT)
"1000000"
);
// Send it over the network!
const txresponse = await transactionBuilder.submit({
memo: "POKT Payment",
txMsg: sendMsg,
});
// Create a new relayer to send relays over the network!
export const relayer = new Relayer({
keyManager: signer,
provider,
dispatchers: DISPATCHERS,
});
const session = await relayer.getNewSession({
chain: process.env.APP_CHAIN,
applicationPubKey: process.env.APP_PUBLIC_KEY,
});
const relay = await relayer.relay({
data: process.env.RELAY_DATA,
blockchain: process.env.APP_CHAIN,
pocketAAT: POCKET_AAT,
session: session,
});
Download the repo from Github, and just run pnpm i at the root folder. This will install all of the individual packages in the necessary order. If you'd like to build all packages manually, you'll need follow the order in which they're referenced:
packages/utilspackages/typespackages/abstract-providerpackages/providerpackages/signerpackages/relayerpackages/transaction-builderThe best way to develop locally is to link the local packages from your clone to the project you're working on; this will let you either run the dev server or build the packages to see the changes in real time.
We use Turborepo to manage build caches and our general build/test pipeline. This means that only the packages that have changed will get built again, saving you time. At the root package.json we've also defined a collection of scripts you can use to run individual packages on their dev server.
For running tests, either run pnpm jest on the corresponding repo or run pnpm turbo run test on the root folder to run all tests.
Don't be shy to contribute even the smallest tweak. 🐲 There are still some dragons to be aware of, but we'll be here to help you get started!
If you ever come across an issue with PocketJS, do a search in the issues tab of this repo and make sure it hasn't been reported before. Follow these steps to help us prevent unnecessary notifications to the many people following this repo.
Download counts and popularity will appear here as the collector receives them.
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 22:43 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:b279bbdd770f7c194faf0c8967c2240b8c4b8d145c188f475040a96d4c987318