Reference

CLI

The once command: read a scope, its ledger, and whether a nullifier has claimed.

The once command opens and closes scopes and reads them and their ledgers through the API. It prints JSON, so its output pipes into jq or a script.

VariableWhat it sets
ONCE_API_URLThe API. http://127.0.0.1:27310 when unset.
SOLANA_RPC_URLWhere signed transactions are sent. http://127.0.0.1:27320 when unset; --rpc overrides it.
ONCE_KEY_PATHThe keypair file that signs, when --key isn't given.

once scope show

bash
$ once scope show <id>

Prints one scope: its terms, how many claimed of its cap, what is left in its pool or relay budget, and for a poll each option with its tally. The fields are those of getScope.

once scope create

bash
$ once scope create --kind poll --title "Which grants open next" --option Tooling --option Research --option Education --cap 500 --duration 604800 --key creator.json
$ once scope create --kind drop --title "Builders round" --asset USDC --amount 25000000 --cap 500 --duration 604800 --key creator.json

Builds the scope with the API, signs each transaction with the keypair and sends it, then follows it until it confirms. Prints scopeId and, for each transaction, its signature and slot.

FlagWhat it sets
--kinddrop or poll. Required.
--titleThe title. Required.
--capThe most claims. Required.
--keyThe keypair file of the creator, a 64-byte Solana keypair as a JSON array. Required, or ONCE_KEY_PATH.
--assetFor a drop, SOL or USDC. SOL when unset.
--amountFor a drop, the amount per person in base units, relay fee included. Required for a drop.
--optionFor a poll, one option; repeat it for each. --options a,b,c gives them at once. Two to eight.
--opens-atWhen claims open, ISO time. Now when unset.
--closes-atWhen claims close, ISO time.
--durationInstead of --closes-at, seconds from --opens-at.
--rpcWhere to send the transactions.

once scope close

bash
$ once scope close <id> --wallet <address>
$ once scope close <id> --key creator.json

Closes a scope after its window. A drop with funds left is closed by the API's relayer, so --wallet is enough: the command follows the relay job and prints it with the transaction's signature. A poll or an empty drop is closed by a transaction the given --key signs. Either way it prints the creator and what went back to it as returnAmount, in the scope's asset.

once claims

bash
$ once claims <scope>

Prints the scope's whole ledger, every page, as an array: each scope nullifier with its time, its transaction signature and, for a poll, its option index.

once nullifier check

bash
$ once nullifier check 1 036b4a2960740da25020d41c7d8ce211cb8ddf11267e53cf9e1a088225ebe700
{
  "scopeId": "1",
  "claimed": true
}

Whether a scope nullifier, 64 hex characters, has claimed in a scope. The CLI reads the ledger and looks for the nullifier itself, so the API never learns which one was asked about.

Errors

A failed command prints the error's message on stderr and exits with status 1; a wrong command prints the usage line. A transaction that fails names its status and the program error, such as InvalidScope.