NEXT_PUBLIC_API_BASE, NEXT_PUBLIC_API_URL | The API base the pages call |
NEXT_PUBLIC_TW_HOSTS | Comma list of hosts that serve the wallet at the site root. Default toriiwallet.com,www.toriiwallet.com. On these hosts /x is rewritten to /tw/x, www. redirects to the apex (308), canonical URLs drop /tw. Build-time (baked into the middleware and pages), so a change needs a redeploy |
NEXT_PUBLIC_TW_NETWORK | base-sepolia (default) | base; the 2026-11-05 mainnet switch. Build-time |
NEXT_PUBLIC_CDP_NETWORK | Removed 2026-10-30. No longer read. The embedded wallet default send chain and label come from NEXT_PUBLIC_TW_NETWORK when it is set; when it is unset they stay Base 8453 / "Base" as before (defaultSendChainId in walletSignerPure.js) (walletSigner, walletSignerPure, cdpWallet, WalletLoginClient) |
NEXT_PUBLIC_TW_CHECKOUT | Checkout sheet. Default on: a ?draft= entry to /tw/agents/new ends on one receipt-style sheet (what you pay for, amount, pay with, fee in Cherry, terms, one button). 0 restores the previous confirm screen (limits form, consent card). Build-time, so a change needs a redeploy |
NEXT_PUBLIC_TW_INTUITION | Checkout sheet market read. Default off: one sentence about the market a listing trades with two linked facts, above the Terms row. Needs NW_CHECKOUT_INTUITION on the API and the nw-checkout-intuition worker. Build-time. Runbook: CHECKOUT_INTUITION in the NightWatch ops notes (internal) |
NEXT_PUBLIC_TW_WALLET2_TRANSFER_PERPS | New wallet popup (wallet2), build-time. Default off; only 1 turns it on. On, and only in live mode with a signed-in session and a wallet address, the Transfer screen really moves the person's own USDC between Crypto perps and Stock perps (both ways, free, one wallet signature, then checked against the balances). Every other pair, Deposit, Withdraw and Claim stay inert. wallet2 has no production mount: its only live mode is the preview page with no query (or ?live=1), so the move also needs the preview owner gate below to have allowed the page (the live runner checks the gate again itself and refuses otherwise). NEXT_PUBLIC_TW_WALLET2_PREVIEW=1 alone never enables this |
NEXT_PUBLIC_TW_WALLET2_TRANSFER_OUT | New wallet popup (wallet2), build-time. Default off; only 1 turns it on. Independent of NEXT_PUBLIC_TW_WALLET2_TRANSFER_PERPS. On, and only in live mode with a signed-in session, a wallet address, the preview owner gate allowing the page and trading switched on for the wallet, the Transfer screen really moves the person's own USDC out of the exchange (the DEX) to Wallet (the place once called Funding: the dollar coins at the wallet's own address): Crypto perps to Wallet (one wallet signature) and Stock perps to Wallet (two signatures: first the move to Crypto perps, then the withdrawal, run as one action). The withdrawal is the exchange's own withdrawal (the same code as the Withdraw sheet in the older wallet) and goes only to the signed-in wallet's own address, as USDC on Arbitrum One; the exchange keeps a fixed 1 USDC fee out of the amount, the smallest amount is 2 USDC, Torii charges nothing; the screen says so in one line (it leaves the DEX, the exchange charges its 1 USDC per withdrawal, Torii charges nothing) and the button reads "Withdraw $X to Wallet". A move between Crypto perps and Stock perps stays inside the DEX and is free. Money and the From / To lists group the places alike: Wallet alone, then DEX (Stock perps, Crypto perps, Spot & ETFs, all held at the exchange), then Invested (With agents, In vaults). Torii never sends a signed step twice: an unclear answer is only read again (every 5 seconds for 2 minutes while the popup is open, then once per popup open or per Check again). A move that stopped after its first step says so (the money is in Crypto perps). Money's Wallet row shows the withdrawal on its way ("Arriving · $X", with Check again) until it arrived. Fixture scenes (transfer-out, transfer-out-two, transfer-out-transit, transfer-out-halfway) never sign. NEXT_PUBLIC_TW_WALLET2_PREVIEW=1 alone never enables this |
NEXT_PUBLIC_TW_WALLET2_TRANSFER_OUT_CCTP | New wallet popup (wallet2), build-time. Default off; only 1 turns it on. It changes only the route of NEXT_PUBLIC_TW_WALLET2_TRANSFER_OUT and does nothing without it; off, the move out of the DEX to Wallet is exactly the older route above. On (together with _TRANSFER_OUT), Crypto perps / Stock perps to Wallet uses Circle CCTP from the exchange straight to the signed-in wallet's own address, with Circle's automatic forwarding (no gas needed on the destination): the exchange action sendToEvmWithData from the main perp balance, one owner signature (Stock perps first moves the money to Crypto perps, free, so two signatures). Destinations, in one table in app/(torii-wallet)/_wallet2/transfer/cctpPure.mjs (CCTP domain, chain, USDC contract from Circle's own docs): Base (domain 6, the default), Arbitrum (3), Polygon (7), Optimism (2), Ethereum (0); nothing else. The screen has no chain field: the Arrives line shows the coin chip "USDC · Base", and pressing it opens the five, each with its own live fee. The fee is read live from Circle's CoreDepositWallet on HyperEVM (calculateCrossChainWithdrawalFee(true, domain), through the HyperEVM RPC the repo already uses) when To is Wallet, when the list opens, and again immediately before signing; it is never typed in. A read that fails or is above 5 USDC (0 is allowed) means the move is not offered ("We could not read the Circle CCTP fee just now." with Try again); a fee that changed between the screen and the signature stops the run before anything is signed and the screen shows the new figure. The fee is taken out of the amount sent (You send, "Circle CCTP fee" with a tip saying it is Circle's CCTP fee taken out of the amount sent and that Torii receives none of it, Arrives = amount minus fee); the smallest amount is 1 USDC and it must be more than the fee; Torii charges nothing; the helper line names the live fee per withdrawal ("This leaves the DEX. Circle CCTP charges $X per withdrawal; Torii charges nothing."); the older route keeps "Exchange fee". A destination whose live fee is at least 3x the lowest live fee in the list carries a second line "Higher fee" in the list, and when it is the chosen one a notice under Arrives says so from the live values ("<chain> costs <fee> per withdrawal. <cheapest chain> costs <fee>."; a tie for cheapest names the default); nothing is shown while any fee is still being read, nothing is blocked and there is no extra step. The destination is part of the plan and of the stored run: a resumed run checks arrival on the chain it was sent to. The run is the same state machine as the older route (per-leg state kept before signing, an unclear step is only read again, never re-sent; "Arriving" on Money until the USDC on that chain rose by the expected amount, less one cent). Fixture scenes (transfer-out-cctp, -cctp-nofee, -cctp-menu, -cctp-signing, -cctp-two, -cctp-two-half, money-arriving-cctp, money-arrived) never sign. The Wallet place also counts USDC on Optimism and Ethereum (and Deposit lists them), so money sent there shows |
NEXT_PUBLIC_TW_WALLET2_WITHDRAW | New wallet popup (wallet2), build-time. Default off; only 1 turns it on. Off, the Withdraw screen and Money's Withdraw button are exactly as before ("Opens soon"). On, in live mode behind the preview owner gate, Withdraw sends USDC on Base only from the Wallet address to an outside address the person types, through the existing house gas relay (POST /tw/money/send/prepare {to, amount, chain_id: 8453, from_address}, POST /tw/money/send/submit {send_id, signature, fee_signature?}, GET /tw/money/send/{id}; no backend change). The person signs one EIP-3009 TransferWithAuthorization with the built-in wallet (and a second one for the fee when the server quotes a USDC fee); the relay pays the gas. The cost shown is exactly the server's quote: "Cost · N Cherry" when it charges Cherry, "Fee · X USDC" when it charges USDC, "Free" when none; the amount typed arrives whole. The quote is asked for once the address and amount are complete (after a short pause in typing); each quote holds its Cherry on the server until it is used, replaced by the next quote, or lapses (15 minutes). A quote that cannot be read disables the button with "We could not get the cost just now." and Try again; every refusal code of the relay maps to one plain English line. The address must be 0x and 40 hex characters (mixed case must carry a valid checksum), never the zero address or the person's own; it is read back in full in the confirm dialog. More than the Wallet's Base USDC is refused on screen ("$X is on Base. Other chains open soon."). The run (transfer/wdRunPure.mjs, stored under tw2_xferwd:<address> without any signature) is planned -> signing -> submitted -> sending -> done / failed / unclear: kept before signing and again before the one submit; the only repeat is the relay's own relay_busy answer (same signature, at most twice); a submit that may have gone out is only read again through GET status (every 3 s for up to 2 minutes, then Check again), never posted again; a reload reads a stored run once. Confirmed: back to Money, a toast, the balances read again. Failed: "The money did not move.", and "Your N Cherry were returned." only when the server's status says failed for a Cherry-paid send. One run at a time across the perps move, the move out of the DEX and Withdraw (transfer/exclusivePure.mjs). Fixture scenes (withdraw-base, -usdc, -noquote, -badaddr, -short, -confirm, -sending, -failed, -unclear, withdraw-soon, money-withdrawn) never sign. The relay itself must be on for Base mainnet (NW_GAS_RELAY_ENABLED, NW_GAS_RELAY_NETWORK=base); its minimum (NW_GAS_RELAY_MIN_USDC, default 0.5), per-send maximum and daily counts are the server's. |
NEXT_PUBLIC_TW_WALLET2_TRANSFER_IN | New wallet popup (wallet2), build-time. Default off; only 1 turns it on. Off, the Transfer screen is exactly as before (moving money out of Wallet "opens soon"). On, in live mode behind the preview owner gate, Transfer from Wallet to Crypto perps deposits USDC from the Wallet address on a source chain into the person's own perps account through the house deposit relay (POST /tw/money/deposit/prepare {chain_id, amount, from_address}, POST /tw/money/deposit/submit {deposit_id, signature, fee_signature?}, GET /tw/money/deposit/{id}; every field name of these lives in one adapter, app/(torii-wallet)/_wallet2/transfer/depApiPure.mjs). Source chains: a static list in transfer/depPlanPure.mjs (DEPOSIT_CHAINS, Arbitrum only for now; Base is one more line), less any chain the server answers chain_not_supported for (remembered for the session); the From line shows the coin chip "USDC · Arbitrum" and opens the list of chains with their balances, the others (and USDT on BNB Chain) "Opens soon". The default chain is the one holding enough USDC, the lowest Circle CCTP fee first. The person signs one EIP-3009 ReceiveWithAuthorization with the built-in wallet (a second authorization only when the quote's cost is USDC); before signing the client checks the message is from the session address, for exactly the amount typed, on that chain's USDC (the CCTP table's own contract), and that Arrives = amount minus the Circle CCTP fee, that fee at most 5 USDC and less than the amount; anything else is refused without signing. Lines: You send, Circle CCTP fee (Circle's, taken from the amount sent; Torii receives none of it), Arrives (in Crypto perps), Cost (Torii) exactly as quoted (Cherry or USDC on top, or Free); button "Deposit $X to Crypto perps". The smallest amount is 5 USDC (or the larger detail.min of amount_below_min). Quotes are asked for after a pause in typing, never on a timer (each holds its Cherry on the server); a quote that cannot be read disables the button with "We could not get the cost just now." and Try again; every refusal code maps to one plain English line. The run (transfer/depRunPure.mjs, stored under tw2_xferin:<address> without any signature): kept before signing and before the one submit (relay_busy is the only repeat), GET status every 5 s for up to 2 minutes, then only on popup open or Check again; an unclear submit is never re-sent; burned means on its way (back to Money, "Arriving · $X" on Crypto perps), and arrival is read from the exchange's own ledger or the Crypto perps balance for the session address (Arrives within one cent). With NEXT_PUBLIC_TW_WALLET2_TRANSFER_PERPS=1 too, Wallet to Stock perps is the same deposit then the existing free move Crypto perps to Stock perps ("1 of 2 / 2 of 2"); a second step that did not go (or an arrival seen only after a reload or Check again) stops half-way with the money in Crypto perps and a Continue button. One run at a time across all runners (transfer/exclusivePure.mjs). Fixture scenes (transfer-in, -in-usdc, -in-chains, -in-min, -in-noquote, -in-signing, -in-two, -in-failed, -in-unclear, -in-halfway, -in-soon, money-arriving-in, money-arrived-in) never sign. The relay itself must be on for the chain on the server. |
NEXT_PUBLIC_TW_WALLET2_SECURITY | New wallet popup (wallet2), build-time. Default off; only 1 turns it on. Off, the Security tab and its screens are exactly as before (every action "Opens soon"). On, in live mode behind the preview owner gate, three Security actions open their own screens (app/(torii-wallet)/_wallet2/security/), with the same helpers and routes as the older screens and no backend change; nothing moves money. Signed-in devices: the list from GET /auth/sessions (lib/useDevices), "Sign out" per row (POST /auth/sessions/{id}/end; this device asks first and signs out here too) and "Sign out other devices" (POST /auth/sessions/end-others, asks first). My order limits: per order, per day and leverage from GET /tw/trade/me, saved with PUT /tw/trade/limits (all three sent; blank = the default); the bounds are the server's (order and day up to the house limit, leverage 1x up to the exchange maximum) and a refusal is shown as one plain line; an answer that never came is read again, never sent again. Export wallet key: the same warning, then the wallet provider's own secure copy frame (createEvmKeyExportIframe, as the NightWatch account page); the key goes from that frame to the clipboard and never enters the page, so it is never read, logged or stored. Offered only for the built-in wallet open in this browser; a server-kept or linked wallet says so. The 2-step check and changing the sign-in email stay "Opens soon" (no enrolment or email-change flow exists yet). Fixture scenes (sec-devices, -confirm, -error, -failed, sec-limits, -refused, sec-export, -key, -waiting, -server) read and send nothing |
NEXT_PUBLIC_TW_WALLET2_PREVIEW | New wallet popup preview page, build-time. Default off: /wallet-preview (and /tw/wallet-preview, which is what toriiwallet.com/wallet-preview maps to) answer 404. Only 1 turns the page on, and then it opens only through the owner gate: on a local dev host (localhost, 127.0.0.1, [::1]), or for a signed-in account of that origin whose email, as the API answers GET /auth/me with that session, hashes to an entry of NEXT_PUBLIC_TW_WALLET2_PREVIEW_ALLOW. Everyone else gets a plain "Not found" page (no title naming a preview, no further request; the fixture scenes, the popup and the transfer runner are never loaded). The page is noindex, nofollow. With no query (or ?live=1) the page is the real popup on the visitor's own signed-in account; signed out it shows a Sign in screen whose button opens the existing Torii sign-in on the Money page (/money on the Torii host), after which the person comes back to the page. Fixture scenes need an explicit ?scene=. Both are gated alike. Code: app/(torii-wallet)/_wallet2/gate/ |
NEXT_PUBLIC_TW_WALLET2_PREVIEW_OPEN | The preview owner gate's open switch, build-time. Default off; only 1 turns it on, and only together with NEXT_PUBLIC_TW_WALLET2_PREVIEW=1. On, the account check is skipped: anyone who knows the URL can open the fixture scenes and ?live=1, which shows only that visitor's own data when signed in (signed out: a sentence, no call) and, with NEXT_PUBLIC_TW_WALLET2_TRANSFER_PERPS=1, lets a signed-in visitor move their own USDC between Crypto perps and Stock perps. The page stays noindex, nofollow. Remove the variable (and redeploy) to restore the owner-only lock; no code change |
NEXT_PUBLIC_TW_WALLET2_PREVIEW_ALLOW | The preview owner gate's allow list, build-time. Comma list of lowercase hex SHA-256 hashes of lowercase(trim(email)); no email or user id is ever put in the bundle. Empty or missing: nobody passes by this path (local dev hosts still do). Entries that are not 64 hex digits are ignored. Make one entry with node scripts/wallet2_allow_hash.mjs in frontend/: it reads ONE email from stdin (type it and press Enter, or redirect a file; never pass it as an argument) and prints only the hash. The check runs in the browser, so it hides the preview; it does not protect data: every read and move still uses the visitor's own session and is authorised by the API |
NEXT_PUBLIC_TW_WALLET2_FRONT | The new wallet's front-door switch, build-time. Default off; only 1 turns it on. Off, nothing changes anywhere: no rewrite or redirect is added, /money is the old Money page and the internal route /tw/wallet2 answers the branded 404. On: /money (/tw/money on a host that is not a Torii host) is served by the new wallet as a full page inside the Torii header, menu and footer (a rewrite: the address stays /money); ?sheet=send opens it on Withdraw, ?sheet=receive and ?sheet=fund on Deposit, ?w=<screen> on that screen (money, earnings, approve, allowed, security, withdraw, deposit, transfer, activity, account). The old sub-paths answer a 307 (temporary, so switching back leaves nothing cached): /deposit to /money?w=deposit (with ?mandate= unchanged: that agent's Fund sheet), /wallet to /money, /?panel=send to /money?w=withdraw, /?panel=receive to /money?w=deposit, /?panel=approve to /money?w=approve. The home / stays the home. The internal route /wallet2 is never linked and never redirected by the server; opened directly, the page moves itself to /money. On that page the preview's allow list does not apply: any signed-in Torii user passes the wallet's gate (flag on, the official address, a sign-in on this origin); each live section still needs its own NEXT_PUBLIC_TW_WALLET2_* flag, and the API checks the session on every call. Signed out, the page shows the wallet's Sign in, which opens the Torii sign-in sheet on the same page (/money#signin opens it at once). /wallet-preview keeps its own owner gate. Table and tests: frontend/app/(torii-wallet)/_wallet2/front/routesPure.mjs, tests/wallet2_front.test.mjs |
NEXT_PUBLIC_TW_WALLET2_ACTIONS | New wallet popup (wallet2), build-time. Default off; only 1 turns it on. Off, Sign out (Account), Approve and Decline (an Approve detail) and Stop (Allowed) are exactly as before ("Opens soon" for a real person). On, in live mode behind the preview owner gate, three account actions are real, each the same client call as the older screens and none of them moves money or asks for a signature. Sign out: the Torii shell's own sign-out steps, in its order (clear the sign-in token, the agent key and the gas-drip and wallet-bind marks; end this origin's server session once with POST /auth/logout; tell every hook; drop the built-in wallet session), then the popup closes; no confirm, as in the shell. The stored wallet2 runs (tw2_xfer:, tw2_xferout:, tw2_xferwd: + address) are kept: each loads only for its own wallet address, so another account on the browser never sees it and the same account finds its unfinished move again. Decline (any waiting request) and Approve (a held order only): POST /torii/mandates/{id}/approvals/{approval_id} {decision} with the owner session. Approve lets the agent place that one order, once, for a limited time; the detail says so ("It allows" / "It cannot"). Decline asks once ("Decline this request?") and records the refusal; nothing is built. Approving a money move stays "Opens soon" (it lets the agent move money); its Decline is real. Stop an agent: only for a mandate with no vault, POST /torii/mandates/{id}/stop, after one confirm: the agent can place no new orders, it can still close open positions, the positions and the money stay in the person's own account, and it cannot be undone. A mandate with a vault is stopped from the owner's wallet (a signature), so its Stop stays "Opens soon" with one line saying so. Every answer is sent at most once (a second press waits for the first; an item answered once is never sent again); a refusal shows one plain line (no codes) and the list is read again after every answer. Code: app/(torii-wallet)/_wallet2/actions/. Fixture scenes (approve-order-decline, approve-order-error, approve-done, allowed-stop, allowed-stop-error) never send. NEXT_PUBLIC_TW_WALLET2_PREVIEW=1 alone never enables this |
NEXT_PUBLIC_TW_WALLET2_CLAIM | New wallet popup (wallet2), build-time. Default off; only 1 turns it on. Off, the Earnings and Claim screens are exactly as before (Claim, Claim all and Ways to earn Open are "Opens soon"). On, in live mode behind the preview owner gate, Earnings shows each kind with how it is paid (_wallet2/earnings/claimPure.mjs PAYOUT): a promo pool row (one per pool, from GET /promo/my_accruals) is claimed with the person's own sign-in, POST /promo/claim {pool_id, wallet_address} (the address is the person's own built-in wallet address, only for a pool on an EVM chain the server checks; any other pool is "Opens soon" with the reason). The server locks every unclaimed accrual of that pool into one claim (requested); NightWatch then pays the pool's own token from a custody wallet and records the hash (paid). Nothing is signed and nothing is charged. Cherry Credit earnings (tasks, answers, tips, signal readers, referrals) and a vault operator's fees (paid by the vault settler's claimFees()) say "Paid automatically" and have no Claim button. After a claim the accruals are read again, the row moves to "Earned · claimed" and the toast names the amount in the pool's token (coins, never Cherry Credit). The claim run (_wallet2/earnings/claimRun.mjs, stored under tw2.claim.v1:<address>: pool, token, amount, state, time) is one claim at a time per wallet; a claim with no answer is "Not confirmed yet" and is never sent again, only checked against GET /promo/my_accruals (Check again). Ways to earn open the NightWatch pages the old screens link to: /hive?seat=work, /hive, /account?tab=earn (absolute on a Torii host). Fixture scenes earnings-v2, -sending, -unclear, -failed, -done, -noclaim, -empty, -soon never send. |
NEXT_PUBLIC_TW_WALLET2_ACTIVITY | New wallet popup (wallet2), build-time. Default off; only 1 turns it on. Off, Earnings' "See all activity" link is exactly as before (drawn in the fixture preview only, it opens nothing) and no Activity code is loaded. On, the link opens Activity: a read-only list of what happened to this wallet's money, newest first, grouped by day, with the filters All / Moves / Sends / Cherry and "Show more" (20 rows at a time; no automatic loading, no polling). Three sources, each read once when the screen opens (again only on Refresh, or Try again for the one that failed), each failing on its own as "Could not load just now": the exchange's own ledger of the wallet address (userNonFundingLedgerUpdates through (site)/torii/hl.js fetchLedgerUpdates, the last 90 days, at most 200 newest lines: deposits, withdrawals with the exchange fee, moves between the places at the exchange, sends to and from other accounts, vault moves; trades are not listed), the Cherry Credit ledger (GET /cherries/ledger?limit=200), and what this browser kept (the older Send panel's recent sends and the Withdraw run in flight; there is no server list of relay sends). A row opens its detail: status, time, from / to, the whole address, the transaction hash with a link to the chain's public explorer, and each fee in its own unit (the Torii cost of a relay send from the Cherry ledger lines of that send). Amounts of different units are never added; a figure that could not be read shows a dash. Fixture scenes (activity, activity-loading, -failed, -empty, -cherry, -detail, -detail-fee) read nothing. Code: app/(torii-wallet)/_wallet2/activity/ |
NEXT_PUBLIC_TW_WALLET2_CHERRY | New wallet popup (wallet2), build-time. Default off; only 1 turns it on. Off, the Cherry Credit and Obsidian Cherry screens are exactly as before (Buy Cherry and Buy Obsidian Cherry drawn "Opens soon"). On, in live mode behind the preview owner gate, three actions run on the existing gas-free paths of the NightWatch Cherry screen (no backend change), each only when GET /obsidian/config read at that moment says it is open on the Base mainnet pool (chain_id 8453, testnet false); otherwise its door is drawn "Opens soon": Buy Cherry Credit with USDC (POST /cherries/topup/usdc/prepare {payer, usdc} then POST /cherries/topup/usdc {request_id, signature}; one EIP-3009 ReceiveWithAuthorization on Base USDC; minimum 5 USDC; server switch NW_CHERRY_TOPUP_USDC_ENABLED, topups.usdc), Buy Obsidian Cherry (GET /obsidian/quote?usd=, POST /obsidian/buy/sponsored/prepare for the server's network fee in USDC, two authorizations, POST /obsidian/buy/sponsored, GET /obsidian/buy/sponsored/{id}; the server's net minimum rules.sponsored.min_net_usdc_units; server switch NW_OBSIDIAN_SPONSOR_ENABLED), and Convert Obsidian Cherry into Cherry Credit (POST /obsidian/topup/prepare {owner, amount} then POST /obsidian/topup; one ReceiveWithAuthorization on the pool's Obsidian Cherry token; minimum 100; server switch NW_OBSIDIAN_TOPUP_SPONSORED, topups.obsidian). Torii's relayer pays the gas; the person needs no ETH. The price is asked for only when the person presses Get price (each prepare writes a server request row) and shown as the server answered it, with its expiry ("Good until HH:MM") or the time it was read; the server's typed data is checked against the config (pool, network, coin contract, signer, amount) before it is shown and again before it is signed. Redeem (Obsidian Cherry to USDC at the redemption price) stays "Opens soon": PrimaryPool.redeem is a transaction from the person's own wallet with their own gas. The Obsidian Cherry page shows the buy price, the redemption price and their difference from GET /obsidian/state as facts of that read (only for the Base mainnet pool). The run (cherry/cherryRunPure.mjs, stored under tw2_cherry:<address> without any signature) is planned -> signing -> submitted -> verifying -> done / failed / unclear: kept before signing and before the one post; never posted again (Check again and a reload only read); done only when the person's own figures show it (a new obsidian_convert credit on GET /cherries/ledger for the Cherry Credit actions, a higher Obsidian Cherry balance for the buy after the server's succeeded). It refuses while a transfer or Withdraw run of the same wallet is stored unfinished (it reads those stores and changes nothing of theirs). Fixture scenes (cherry-credit*, obsidian-buy*, obsidian-convert*, place-cherry-live, place-obsidian-live) never sign |
NEXT_PUBLIC_TW_WALLET2_INVESTED | New wallet popup (wallet2), build-time. Default off; only 1 turns it on. Off, the In vaults and With agents places are exactly as before (read-only rows). On, each Torii Vault row of In vaults opens the vault, and each agent row of With agents opens the agent (fixture scenes invest-vault* and invest-agent* never sign or send). In live mode, behind the preview owner gate, with the signed-in account's wallet checked to be this wallet on mainnet (GET /tw/trade/me), the vault screen reads the vault's terms (GET /torii/vaults/{id}/terms) and the vault itself on its chain (the same read as the older vault page), and runs the older vault page's four calls from the built-in wallet only, with the same helpers and inputs (no backend change): Deposit (approve exactly the amount only when the allowance is short, then deposit(amount, self): "Step 1 of 2", "Step 2 of 2"), Request withdrawal (requestWithdrawTo(shares, lots, self): shares worth at least 5 USDC at today's price, or all free shares; a holding under 5 USDC only whole), Cancel (cancelWithdraw(id), only the wallet's own request before it is priced) and Claim (claim(self), only when money is booked for the wallet). Each call is checked first as the account (eth_call), then signed and sent by lib/toriiVaultClient.sendBuiltIn (the one send lock, the nonce check and the kept signed transaction of lib/vaultEmbeddedTx.mjs); when the account holds too little HYPE that helper asks the existing gas top-up POST /torii/gas/drip/hyperevm first (server switch TW_GAS_DRIP_HYPEREVM_999_ENABLED, Cherry price NW_GAS_FEE_MULTIPLIER_HYPEREVM, shown as "Cost · N Cherry" from GET /prices; unread with no HYPE disables the button with Try again). A deposit from an account with no HYPE is refused before the send by the shared deposit rule (lib/toriiVaultPure.depositBlockText), as on the older page. The rules are shown before the button: smallest deposit, what you get, smallest request, when it arrives (priced within about 20 minutes, then paid to Wallet by itself), the performance fee, Torii fee none, the cost. The run (invested/vaultRunPure.mjs, stored under tw2_invest:<address> without any signature) is planned -> signing -> sent -> verifying -> done / failed / halfway / unclear; it is planned again from a fresh read before the first signature, kept before each signature, and a step is done only when the vault's own state shows it; a step that may have gone out is only read again (Check again), never sent again; a deposit that stopped after its first step says so (the vault may take the USDC; the USDC is still in Wallet). The agent screen stops an agent with no vault through the older Stop sheet's call (POST /torii/mandates/{id}/stop, owner only, once per press, then GET /torii/mandates/{id} until it reads stopped). An agent with its own vault, and Add money, stay "Opens soon" with a link to the agent page. Code: app/(torii-wallet)/_wallet2/invested/ |
NEXT_PUBLIC_TW_WALLET2_AUTOLOCK | New wallet popup (wallet2), build-time. Default off; only 1 turns it on. Off, the Security tab and the signed-out screen are exactly as before and the lock clock (autolock/AutoLock.js, autolock/lockLive.js) is never loaded. On, the Security tab gains "Lock when away" (Off / 15 min / 1 hour, default Off, kept in this browser only) and the signed-out screen gains "This is a shared computer" (sets 15 min). Locking closes the built-in wallet's session on this device (the shared resetEmbeddedWalletConnection helper); the Torii sign-in stays, so balances and activity stay visible, and the next send asks for the emailed code. Nothing is locked while a money run of the wallet is unfinished. Live behind the preview owner gate. |
NEXT_PUBLIC_TW_WALLET2_ARBITRUM | New wallet popup (wallet2), build-time. Default off; only 1 turns it on. Off, nothing changes (no entry, the live chunk arbitrum/ArbGate.js / arbitrum/arbLive.js is never loaded). On, in live mode behind the preview owner gate with the account's wallet checked to be this wallet on mainnet, the Wallet screen shows "USDC on Arbitrum": Send to another address (the house relay POST /tw/money/send/prepare, /submit, GET /tw/money/send/{id} with the Arbitrum chain id) and Move to Base at the same address (POST /tw/money/arbitrum/move/prepare, /submit, GET /tw/money/arbitrum/move/{id}), the old money screen's backend unchanged and still governed by its own server switches (GET /tw/money/arbitrum: send_enabled, move_enabled). At least 5 USDC per move (the server's own move minimum when higher); the cost is the server's quote; a typed address that is a known contract or holds contract code on Arbitrum is refused; nothing is signed before the confirm dialog (amount, address, network, cost, arrives). Moving to Crypto perps is the existing Transfer (NEXT_PUBLIC_TW_WALLET2_TRANSFER_IN). Fixture scenes arbitrum* never sign. Code: app/(torii-wallet)/_wallet2/arbitrum/ |
NEXT_PUBLIC_TW_WALLET2_NETWORKS | New wallet popup (wallet2), build-time. Default off; only 1 turns it on. On, the Wallet screen shows "Every network": a read-only list of what the same address holds on Base, Arbitrum, Polygon, Optimism and Ethereum (USDC and the network's own coin, the old money screen's reads). A read that fails is shown as unknown with Try again, never 0. Nothing is signed. Code: app/(torii-wallet)/_wallet2/networks/ |
NEXT_PUBLIC_TW_WALLET2_SEND_COINS | New wallet popup (wallet2), build-time. Default off; only 1 turns it on. On, in live mode behind the preview owner gate with the account's wallet checked, the Wallet screen shows "Send ETH": the wallet's ETH on Base to an address the person types, one transaction from the built-in wallet (cdpBridge.sendTransaction, as the old money screen's Send), the network fee estimated and paid in ETH. The 5-dollar minimum is checked at the exchange's ETH mid price (one public read); without a price, a fee or the address check nothing can be sent. A known contract or an address with contract code on Base is refused. Fixture scenes coin-send* never send. Code: app/(torii-wallet)/_wallet2/coins/ |