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-tokenOr using yarn:
$ yarn add @solworks/poll-sdk @coral-xyz/anchor @solana/web3.js @solana/spl-tokenRequirements
| Dependency | Minimum version | Notes |
|---|---|---|
| Node.js | 18.0+ | LTS recommended |
| TypeScript | 5.0+ | Optional but recommended |
| @coral-xyz/anchor | 0.30+ | Peer dep |
| @solana/web3.js | 1.87+ | Peer dep |
| @solana/spl-token | 0.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
}
}