@proof-of-commitment/sdk
v0.1.0
Published
TypeScript SDK for the Proof-of-Commitment staking and governance protocol
Downloads
8
Readme
Proof-of-Commitment SDK
A lightweight TypeScript wrapper around the Proof-of-Commitment staking and governance contracts. The SDK is designed to be framework-agnostic and works with any viem PublicClient/WalletClient pair.
Installation
npm install @proof-of-commitment/sdk viemQuick Start
import { createPublicClient, createWalletClient, http } from 'viem';
import { lisk } from 'viem/chains';
import { ProofOfCommitmentSDK } from '@proof-of-commitment/sdk';
const publicClient = createPublicClient({ chain: lisk, transport: http() });
const walletClient = createWalletClient({ chain: lisk, transport: http(), account });
const sdk = new ProofOfCommitmentSDK({ publicClient, walletClient });
const stats = await sdk.staking.getProtocolStats();
await sdk.staking.stake({ amount: '100', lockDays: 30 });
const proposals = await sdk.governance.listProposals();Packages
staking– approvals, staking flows, rewards, and protocol statsgovernance– proposal lifecycle helpers and voting power utilitiesanalytics– opinionated aggregations (user overview + protocol overview)nft– helpers for NFT-backed stake data
Building Locally
cd sdk
npm install
npm run buildThis produces ESM + CJS bundles with type declarations inside dist/.
