Installation

Install the Poll SDK and its dependencies to start building.

Package installation

Install the SDK and its peer dependencies using npm:

$ npm install @solworks/poll-sdk @coral-xyz/anchor @solana/web3.js @solana/spl-token

Or using yarn:

$ yarn add @solworks/poll-sdk @coral-xyz/anchor @solana/web3.js @solana/spl-token

Requirements

DependencyMinimum versionNotes
Node.js18.0+LTS recommended
TypeScript5.0+Optional but recommended
@coral-xyz/anchor0.30+Peer dep
@solana/web3.js1.87+Peer dep
@solana/spl-token0.4+Peer dep

Quick verification

Verify the installation by importing the SDK:

verify.ts
import { SDK } from "@solworks/poll-sdk";

console.log("Poll SDK imported successfully!");

TypeScript configuration

For the best development experience, ensure your tsconfig.json includes:

tsconfig.json
{
  "compilerOptions": {
    "target": "ES2020",
    "module": "ESNext",
    "moduleResolution": "bundler",
    "esModuleInterop": true,
    "strict": true
  }
}