@sorandomains/owner is the write-side SDK for namespace owners. Where @sorandomains/lookup reads names trustlessly, this package performs the operations that running a namespace requires — starting with the one that matters most: issuing names to your users the moment they sign up.
Set up
registrar_of) — you never configure it by hand.
In a browser, pass the wallet instead of a raw key — wallet kits already match the signTransaction shape:
Issue one name
await owner.policy("acme")). The issued name’s built-in resolution target starts as the holder, so it resolves through @sorandomains/lookup immediately.
Issue in bulk
Up to 23 names per transaction (a contract limit), with an exact per-label outcome report:- The
issuedflags come from the transaction’s own events. Each successfully issued name emits anissuedevent; the SDK decodes them from the confirmed transaction (outcomeSource: "events"), so which names were issued is exact — no clocks, immune to concurrent activity. Thereasonon non-issued entries is a best-effort classification from informational re-reads. (If an RPC node serves unusable transaction meta, the SDK falls back to state re-reads for everything and says so:outcomeSource: "reread".) - Batches are safe to re-run. The contract skips already-held labels instead of aborting, so re-submitting a batch after a partial failure issues only what’s missing.
Errors are typed
Every contract rejection surfaces as anOwnerError with the contract’s own error code and name:
- Wrong signer fails fast. If the operation requires authorization from an address other than your signer, the SDK refuses before submission — no fee spent, and the error names both parties.
- Failures that reach the network carry
txHash. If an error has atxHash, check that hash before retrying — the transaction may still have been included.