Installation

Install the Poll SDK and its dependencies to start building.

Package Installation

Install the SDK and its peer dependencies using npm:

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

Or using yarn:

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

Requirements

  • Node.js 18 or higher
  • TypeScript 5.0 or higher (recommended)

Quick Verification

Verify the installation by importing the SDK:

typescript
import { SDK } from "@solworks/poll-sdk";

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

TypeScript Configuration

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

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

Next Steps

Now that you have the SDK installed, continue to the Quick Start guide to create your first bet.