Start

Quickstart

Read a scope’s claims, open a scope of your own, and watch its ledger fill.

A scope's claims are public: each one is a scope nullifier with a time and a transaction. Commands and code reach the API at $ONCE_API (ONCE_API_URL for the CLI); on the localnet that is http://127.0.0.1:27310. The output shown here comes from the API's fixture mode, which serves the same routes over sample scopes.

Read the scopes

ts
import { createSdk } from '@once/sdk'

const once = createSdk(process.env.ONCE_API!)

// Open scopes
const { items } = await once.scopes({ status: 'open' })
for (const s of items) console.log(s.id, s.kind, s.title, `${s.claimed}/${s.cap}`)
text
1 drop Builder grant round 3 37/128
2 drop Community translation stipend 18/64
3 poll Which RPC feature next? 87/200
6 drop First ten protocol reviewers 10/10
bash
$ once scope show 3
{
  "id": "3",
  "kind": "poll",
  "title": "Which RPC feature next?",
  "creator": "4a6ep15phfFhSctuLwrxYmdAFQWCmdj9Bdx6WmBRrXjc",
  "asset": null,
  "amountPerPerson": null,
  "cap": 200,
  "claimed": 87,
  "opensAt": "2026-11-22T08:22:26.236Z",
  "closesAt": "2026-11-28T08:22:26.236Z",
  "status": "open",
  "options": [
    {
      "index": 0,
      "label": "Slot history",
      "tally": 51
    },
    {
      "index": 1,
      "label": "Account diffs",
      "tally": 24
    },
    {
      "index": 2,
      "label": "Faster subscriptions",
      "tally": 12
    }
  ],
  "poolRemaining": null,
  "relayFee": "5000",
  "relayBudgetLeft": "565000",
  "createdSignature": "4yPwhfQQsmNPtUYRoh7ya7sXX3NDNQe7fwMJEcE5vmT3R8hFTYFZT9atmNdhasEb1YKpsmwb75Rqi2tUXrwEsC2s",
  "settled": false
}
bash
$ curl "$ONCE_API/v1/scopes?status=open"

A scope comes with its kind, title, how many claimed of its cap and its window; read alone, it adds what is left in its pool or relay budget and, for a poll, each option's tally.

Read a scope's claims

ts
// One scope's ledger, every page
for await (const claim of once.claims('6')) console.log(claim.nullifier, claim.time)
text
067ebef36a263fe3cb6c138f7f467db34b13e8df2c0e4aa908d2b064d584740f 2026-11-24T12:44:15.326Z
170752bd078cb1373126080216d0af802d7c5fdd1a016dd00743c436a01e9b9a 2026-11-24T17:06:04.417Z
2aec51f7e2874bcd69905c08aaebe773aae42ce8b64983b5686519e9d4608f6f 2026-11-24T21:27:53.508Z
bash
$ once claims 6

Prints the whole ledger as one JSON array: each scope nullifier with its time, its transaction signature and, for a poll, its option.

bash
$ curl "$ONCE_API/v1/scopes/6/claims?limit=100"

The ledger holds one scope nullifier per claim. Nothing in it names a person or a wallet, and the same person's nullifier in another scope is a different, unrelated value.

Open a scope of your own

The quickest is a poll: it needs only a little SOL for its relay budget. With a funded keypair file:

bash
$ once scope create --kind poll --title "Which grants open next" --option Tooling --option Research --cap 100 --duration 86400 --key creator.json

The command prints the new scopeId. In the app, open /app/create, connect a wallet, choose Poll, give it a title and two options, then Review and Sign and open.

From code, the API quotes and builds the transaction and your wallet signs it: Open a drop has the whole program, and Open a poll the poll's terms.

Watch it fill

Anyone enrolled can now vote once in your poll from its page in the app. Read the tally and the ledger as they come in:

bash
$ once scope show <id>
$ once claims <id>

A second vote from the same person, from any wallet, is refused with AlreadyClaimed, and the ledger keeps one nullifier for them.

Next