Documentation
Nock is a browser workspace that writes, tests and ships TypeScript apps on Robinhood's surfaces: contracts on Robinhood Chain through viem, the Crypto Trading API over signed REST, and the hosted Connect on-ramp. This page describes what it actually does, and what the preview refuses to do.
Overview
A workspace is a sandbox with an API key and a funded chain account in it. When you open one, Nock resolves a Node runtime, installs the dependencies, issues a sandbox key with its Ed25519 seed and scaffolds a project. Nothing is installed on your machine and there is no account to make.
The agent works against commands rather than against its own judgement. It writes a file, runs the suite, reads the output, and only reports a step as done once a command has said so. A failing test sends it back to the file it just edited.
Quickstart
Open the workspace, describe what you want, and press ⌘↵. If your description matches a template, the build starts immediately. Otherwise it is queued — see Limits.
# what the workspace runs for you nock up --workspace escrow npm install nock env --sandbox npx tsc --noEmit && npx vitest run nock dev
Every project can be taken with you. Download code in the workspace header gives you the whole tree as a zip, including package.json and the tests, so npm test works the moment you unpack it.
Request signing
Every authenticated call to the Crypto Trading API carries three headers — x-api-key, x-timestamp and x-signature — and the signature is Ed25519 over one exact string:
api_key + timestamp + path + method + body
The order is not negotiable, the path includes its query string, and the body is omitted when there is none. Get any of it wrong and you get a bare 401 with nothing to go on, which is why canonical() is its own function with its own tests in every project, and why template 01 exists at all.
One more trap worth naming: the private key is a 32-byte seed, base64 encoded. Most Ed25519 libraries hand you a 64-byte expanded secret key instead, and it will not work here.
The workspace
Four panes, and they mean what they look like.
- Files
- The whole project tree, not a highlight reel. Click anything to read it, including the shared API client and its tests.
- Code and Preview
- Code is the source as the agent writes it. Preview is the app: mint against the allowlist, age an attestation, run the escrow window down.
- Agent
- The prompt it is working from, the task list it is working through, and a box to ask for a change.
- Terminal
- The commands and their output. Drag its top edge to give it more room.
The build loop
The status control in the header has three states, and they are driven by commands, not by optimism.
- BusyA command is running, or the build is waiting for capacity.
- FailA command reported a failure. The loop stops here — it does not move on and hope.
- LiveThe app is running against the sandbox, and its preview responds.
Shipping is where this gets honest. Each template carries a real failure of its own kind — a collection the paymaster will not sponsor, a recipient nobody attested, an amount in the wrong decimals, a snapshot that was never taken, a config that does not match its order type, a normalised address — so the first Ship fails. The agent names the cause, offers the patch, and the second attempt is the one that publishes. You will see it happen; it is not decoration.
Templates
Six apps, each with its tests and its own ship hazard.
A phased mint with an allowlist, a per-wallet cap and a supply cap, sponsored so the minter pays no gas.
mint(address,uint256) · pm_sponsorUserOperation
A real-world asset token where both sides of a transfer must be verified, attestations expire and supply cannot exceed what is custodied.
canTransfer(address,address,uint256) · transfer(address,uint256)
Hold a payment until the buyer confirms or the window lapses. Neither side can strand the funds.
open(bytes32,address,uint256) · release(bytes32) · refund(bytes32)
Prove a balance at a snapshot block and issue a short-lived pass, so access cannot be flash-loaned for one transaction.
balanceOfAt(address,uint256) · currentSnapshotId()
Place, track and cancel crypto orders, with a state machine that refuses illegal transitions and idempotent submits.
POST /api/v1/crypto/trading/orders/ · GET /api/v1/crypto/trading/orders/{id}/
Fund a self-custody wallet through the hosted on-ramp, and read the redirect back against the state you sent.
GET https://robinhood.com/connect · GET /return (redirect)
CLI reference
Everything the workspace does, it does through these. The terminal shows them as they run.
| Command | Arguments | What it does |
|---|---|---|
| nock up | --workspace <name> | Resolves a Node runtime, installs the dependencies, opens the project. |
| nock env | --sandbox | Issues a sandbox API key and injects its Ed25519 seed. |
| npx vitest | run | Runs the suite. A red test stops the loop where it stands. |
| npx tsc | --noEmit | Type-checks. Its output is the evidence, not a summary of it. |
| nock ship | --sandbox | Publishes the app against your sandbox, on a shareable URL. |
| nock edit | --message "<change>" | Hands the agent a change. It reads the project before touching it. |
| nock edit | --fix ship-error | Patches the cause of the last failed ship, then retries it. |
Limits
Nock is a preview, and the honest list is short enough to print.
- Free-form builds share capacity and are usually queued. The six templates hold their own and start immediately.
- A workspace lease is 15 minutes and is released when you close the tab. Download the code before you go.
- The key is a sandbox key. Balances, orders and prices are real inside the sandbox and meaningless outside it.
- Real money is never one click away. The sandbox is a deliberate button; a funded account is not wired at all.