/** * pop user join — join an org via QuickJoin, registering a username first * when needed. * * P0 fix (verified contracts origin/main src/QuickJoin.sol): quickJoinWithUser() * reads `accountRegistry.getUsername(msg.sender)` and reverts NoUsername when * it is empty — the old command advertised --username but never registered it, * so fresh accounts always reverted. New flow: * * 1. Read the username from the SAME registry QuickJoin consults * (quickJoin.accountRegistry() — the authoritative source for this org). * 2. Username exists → one tx: quickJoinWithUser(). * 3. No username + --username → two txs: UAR.registerAccount(username), * then quickJoinWithUser(). * 4. No username, no flag, TTY → prompt for a username, then flow 3. * 5. No username, no flag, non-TTY → actionable CliError (exit 1). * * Pre-flight (skippable with --no-preflight): gas balance always; when * registering, checkUsernameFree fails fast (exit 4) if the name is taken * (UAR.registerAccount would revert UsernameTaken). * * Steps 1 and 2 used to be two STRICTLY SEQUENTIAL eth_calls — getUsername * could not start until accountRegistry() returned the address to call. Both * now come from a single subgraph round-trip * (QuickJoinContract.accountRegistry + Account.username), with the eth_calls * kept as the fallback. The indexed username is only believed when the * indexed account lives on the SAME registry this QuickJoin consults and is * not tombstoned; anything else falls through to the live read, so the * indexer can never talk this command into the 1-tx path for an account that * has no username on-chain. */ import type { Argv, ArgumentsCamelCase } from 'yargs'; interface JoinArgs { org: string; username?: string; chain?: number; rpc?: string; 'private-key'?: string; 'dry-run'?: boolean; yes?: boolean; preflight?: boolean; 'idempotency-key'?: string; 'no-idempotency'?: boolean; } export declare const joinHandler: { builder: (yargs: Argv) => Argv<{ username: string | undefined; } & { "idempotency-key": string | undefined; } & { "no-idempotency": boolean; }>; handler: (argv: ArgumentsCamelCase) => Promise; }; export {};