Skip to content

Conversation

benjaminshafii
Copy link
Member

No description provided.

benjaminshafii and others added 8 commits August 10, 2025 12:21
* feat: Track manual deposits in Recent Activity

- Add recordManualDeposit tRPC mutation to store manual deposits
- Update DepositEarnCard to record deposits after successful transactions
- Display "Manual Deposit" vs "Auto-save" in Recent Activity based on depositPercentage
- Show full amount for manual deposits without "From $X deposit" text
- Use depositPercentage=null to identify manual deposits

This allows users to see both auto-saves and manual deposits in their Recent Activity timeline.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

* fix some things

---------

Co-authored-by: Claude <[email protected]>
* push stuff

* Fix build: remove wallet access from server context, add UI for Smart Account and Virtual Accounts on KYC page

- Fixed user-safes.ts: removed ctx.user.wallet access (not available server-side)
- Added Smart Account creation link to KYC page
- Added Virtual Accounts (USD & EUR) creation button to KYC page
- Added off-ramp coming soon note
- Skip Safe ownership verification on server (TODO: implement with linkedAccounts)

* push stuff

* Fix TypeScript errors: add getPrimarySafeAddress, fix safeType enum, add type annotations

- Added getPrimarySafeAddress method to userSafesRouter
- Fixed safeType enum to match schema (primary, tax, liquidity, yield)
- Added 'as any' to zodResolver calls to fix type depth issues
- Added type annotations for async callbacks
- Skip wallet ownership verification on server (TODO: implement with linkedAccounts)

* fix: remove duplicate getPrimarySafeAddress and consolidate API calls

- Removed duplicate getPrimarySafeAddress definition in settings/user-safes.ts router
- Updated all components to use canonical api.user.getPrimarySafeAddress endpoint
- Fixed type handling for components expecting object vs string response
- Removed unused fetchUserSafes function from use-user-safes.ts hook
- Fixed package.json typecheck script by removing invalid --exclude flag

This eliminates duplicate network calls and fixes TypeScript error TS1117.

🤖 Generated with [opencode](https://opencode.ai)

Co-Authored-By: opencode <[email protected]>

* push stuff

* fix: resolve tRPC build error by importing db at module level

- Moved db import to top level instead of dynamic import in createContext
- This prevents circular dependency issues during build time

🤖 Generated with [opencode](https://opencode.ai)

Co-Authored-By: opencode <[email protected]>

* Fix circular dependency in tRPC setup

- Extract validateCliToken to standalone auth utility (src/server/auth/cli-token.ts)
- Break circular import between create-router.ts and cli-auth-router.ts
- Consolidate tRPC client to single module in src/utils/trpc.ts
- Fix createTRPCReact API usage (remove invalid {} parameter)
- Update all tRPC imports to use consolidated client

This resolves the "ReferenceError: Cannot access 'm' before initialization" build error.

🤖 Generated with [opencode](https://opencode.ai)

Co-Authored-By: opencode <[email protected]>

---------

Co-authored-by: opencode <[email protected]>
- Fixed TRPC version mismatch causing import errors
- Added error handling for corrupted config files
- Created mock auth implementation for testing
- Added comprehensive test suite with automated tests
- Created test-cli-full.js for testing without API dependencies
- Added test-cli.js for running automated test suite
- Fixed config initialization to handle corruption gracefully

The CLI now works properly with:
- Interactive mode for all features
- Mock auth flow for testing
- Company management
- Banking operations
- Payment processing
- All tests passing

🤖 Generated with [opencode](https://opencode.ai)

Co-Authored-By: opencode <[email protected]>
- Created /cli-auth page for generating CLI tokens
- Page integrates with existing cliAuthRouter for token generation
- Provides user-friendly interface for CLI authentication
- Shows token once with copy functionality
- Updated CLI README with complete auth instructions

The auth flow now works as follows:
1. User runs `zero auth login` in CLI
2. Browser opens to /cli-auth page
3. User signs in if needed (redirects back to /cli-auth)
4. User generates token on the page
5. User copies and pastes token into CLI
6. CLI validates token against backend

🤖 Generated with [opencode](https://opencode.ai)

Co-Authored-By: opencode <[email protected]>
- Added environment variable support via dotenv
- Created auth config command to switch between local/production
- Added helper scripts for easy environment switching
- Updated auth command with better error messages for local dev
- Added comprehensive local development guide
- Added useful npm scripts for common operations

Now you can easily switch between local and production:
- npm run use:local - Configure for localhost
- npm run use:production - Configure for production
- npm run config - Check current configuration

The CLI now properly supports local development with:
- ZERO_API_URL and ZERO_WEB_URL environment variables
- .env.local file support
- Configuration commands
- Clear status indicators

🤖 Generated with [opencode](https://opencode.ai)

Co-Authored-By: opencode <[email protected]>
The page was using useSession from next-auth but the app uses Privy for authentication.
This caused the error: useSession must be wrapped in a SessionProvider

Changes:
- Replaced useSession with usePrivy hook
- Use ready/authenticated from Privy instead of status/session
- Show user email from Privy user object
- Properly handle Privy loading states

The page now correctly integrates with the existing Privy authentication
system that the rest of the app uses.
- Added detailed logging to trace authentication flow
- Fixed missing dependencies (superjson, @trpc/client)
- Aligned package versions with web app
- Added debugging to both server and client side
- Fixed Bearer token header handling

This will help identify why CLI tokens are failing validation
Copy link

vercel bot commented Aug 11, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Project Deployment Preview Comments Updated (UTC)
zerofinance Failed Aug 11, 2025 11:59pm

- Modified context.ts to not interfere with Bearer token auth
- Context creation now detects CLI requests and skips cookie auth
- Fixed getCustomerStatus to use context user instead of getUser()
- Added better logging to distinguish web vs CLI requests

The issue was that context creation was trying to get userId from cookies
even for CLI requests, which would fail and cause authentication errors.
…`bank create`, and `bank show <USD|EUR>`\n- Wires command into index.js alongside existing commands\n- Enables users to view and create virtual bank accounts via Align data\n\n🤖 Generated with opencode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant