Polls
The PollSDK and PollFactorySDK manage on-chain community polls. Unlike DAO proposals (which execute on-chain actions), polls are for community sentiment and signaling.
Initialization
Section titled “Initialization”import { PollSDK, PollFactorySDK } from '@akta/sdk/poll'
const pollFactory = new PollFactorySDK({ algorand })
// Interact with an existing pollconst poll = new PollSDK({ algorand, factoryParams: { appId: pollAppId },})Creating a Poll
Section titled “Creating a Poll”const poll = await pollFactory.new({ type: PollTypeEnum.SingleChoice, question: 'What feature should we build next?', options: ['Staking V2', 'NFT Marketplace', 'Social Platform'], maxSelected: 1n, endTime: BigInt(Math.floor(Date.now() / 1000) + 604800), // 7 days gateId: 0n, // No gate})Key Features
Section titled “Key Features”- Factory pattern — Create polls on demand
- Multiple options — Configure any number of voting options
- Time-limited — Polls have configurable duration
- Gate integration — Polls can be gated (e.g., only stakers can vote)
- Poll Gate — A subgate that checks poll voting status
Poll voting through a wallet uses the PollPlugin. See Wallet Plugins.