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.
| Variable | What it sets |
|---|---|
ONCE_API_URL | The API. http://127.0.0.1:27310 when unset. |
SOLANA_RPC_URL | Where signed transactions are sent. http://127.0.0.1:27320 when unset; --rpc overrides it. |
ONCE_KEY_PATH | The keypair file that signs, when --key isn't given. |
once scope show
$ 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
$ 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.jsonBuilds 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.
| Flag | What it sets |
|---|---|
--kind | drop or poll. Required. |
--title | The title. Required. |
--cap | The most claims. Required. |
--key | The keypair file of the creator, a 64-byte Solana keypair as a JSON array. Required, or ONCE_KEY_PATH. |
--asset | For a drop, SOL or USDC. SOL when unset. |
--amount | For a drop, the amount per person in base units, relay fee included. Required for a drop. |
--option | For a poll, one option; repeat it for each. --options a,b,c gives them at once. Two to eight. |
--opens-at | When claims open, ISO time. Now when unset. |
--closes-at | When claims close, ISO time. |
--duration | Instead of --closes-at, seconds from --opens-at. |
--rpc | Where to send the transactions. |
once scope close
$ once scope close <id> --wallet <address>
$ once scope close <id> --key creator.jsonCloses 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
$ 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
$ 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.