Skip to content

feat: add codex wallet#1206

Open
w84april wants to merge 52 commits into
mainfrom
feat/impersonate
Open

feat: add codex wallet#1206
w84april wants to merge 52 commits into
mainfrom
feat/impersonate

Conversation

@w84april

@w84april w84april commented May 4, 2026

Copy link
Copy Markdown
Collaborator

Add wallet impersonation for codex

rossgalloway and others added 5 commits April 26, 2026 22:50
)

* feat: init portfolio history

* fix: build

* fix: getEnv

* fix: env

* fix: localhost connection attempt

* chore: debug

* chore: attempt

* feat: add v2 support

* fix: transfers calculation

* chore: rm clearCache

* feat: calculate gauge

* fix: loading state

* fix: optimize pps fetch

* chore: rename

* feat: add breakdown

* feat: store aggregated data

* chore: upd docs

* feat: add seenTokens

* feat: always recalculate today

* fix: use only 12:00:00 AM timestamps

* feat: add 1y option

* feat: cache prices

* feat: doc

* feat: add batching for queries

* feat: doc

* feat: sequential + batching

* upd: doc

* fix: db spam

* feat: rate limit & clear stale cache

* debug: add logs

* fix: query

* chore: do not expose internals

* chore: remove logging

* chore: misc

* chore: cleanup

* chore: rm dead code

* feat: invalidate cache

* chore: address comments

* chore: remove refresh for safety

* chore: return clear cache for local

* chore: lint

* Feat/portfolio pnl 2 (#1125)

* feat: init pnl

* feat: consider staking

* feat: omit migrate

* chore: support migrate

* feat: 3 calc types

* feat: add totalEconomicGainUsd

* chore: docs

* chore: refactor

* feat: actually consider price at deposit time

* chore: optimize price fetch

* fix: cache

* chore: make fetching more aggressive

* feat: test params

* feat: improve totalCurrentValueUsd

* feat: share events & kong

* feat: fe + history fix

* fix: defillama batching

* feat: tooltips

* feat: handle cow

* feat: tune defillama

* chore: tune a bit more

* feat: add missing prices cache

* feat: docs

* fix: timeout

* chore: copy

* feat: stable vs volatile

* Feat/portfolio pnl excessive (#1148)

* feat: init excessive

* chore: naming

* feat: actually add drilldown

* fix: v2/v3 filter

* fix: version

* fix: env

* feat: cover crvusd rewards

* feat: vault to vault migrate via enso

* feat: init katana rewards

* chore: upd receiver address

* feat: fix bold

* feat: add fetchType + paginationMode

* feat: support fetchtype + pagination on vercel

* feat: hash user address

* feat: ensure schema is initialized

* chore: lint

* fix: katana pricing

* feat: dummy chart

* feat: breakdown

* feat: breakdown for timestamp

* feat: merge yvUSD

* fix: nasty scroll

* chore: lint

* chore: hide if isHidden=true

* feat: make it case insensitive

* feat: init simple

* feat: display

* add annualized return and ETH denominated charting

* Styling and add all time duration

* add charts

* fix staked asset withdrawal issue

* fix issues with staked shares

* fix simple return accounting and growth index charts

* add simple return chart explainers

* add growth chart numeraire spec

* Finalize growth display modes

* Split growth index chart modes

* Keep ETH growth history when partial vaults exist

* remove overall cumulative chart

* improve charts and add to portfolio rows

* Feat/chart tweaks (#1193)

* fix: rescale growth

* fix: prevent flickering

* style: flickering & mobile

* feat: sort overlay by index

* feat: add growth position & index

* fix: growth index empty values

* feat: connect the dots

* feat: consistent chart

* Add position charts to vault pages with balance and to portfolio expanded views. other minor tweaks

* fix review comments

* fix review issues and dark mode tooltip

* feat: dedupe transfer and stake

* feat: improve aggregator (#1195)

* feat: improve aggregator

* chore: lint

* Feat/indexed history (#1198)

* feat: init activity

* feat: enrich

* chore: rm address

---------

Co-authored-by: w84april <donyaschefer@gmail.com>
Co-authored-by: w84april <32621609+w84april@users.noreply.github.com>
* Fix pending transaction overlay copy

* commit lock file
* fix: disable enso balance caching

* fix: refetch wallet balances on focus

* fix: refresh balances on portfolio entry
* make tenderly mode a toggle. add API port picker flow to build and preview steps

* fix issues with port selection scripts

* additional review and hardening

* fix review issues

* fix confetti

* fix: autoswitch chain on tenderly disengage
Co-Authored-By: w84april <donyaschefer@gmail.com>
@vercel

vercel Bot commented May 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
yearnfi Ready Ready Preview, Comment Jun 9, 2026 9:22pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
yearnfi-nextjs Ignored Ignored Preview Jun 9, 2026 9:22pm
yearnfi-nextjs-2 Ignored Ignored Preview Jun 9, 2026 9:22pm

Request Review

@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

rossgalloway and others added 13 commits May 8, 2026 16:36
* Fix Merkl rewards filtering and refresh

* lint
Co-Authored-By: w84april <donyaschefer@gmail.com>
* fix: classify yvBTC as a yearn vault

* feat: pin yvBTC at the top of vaults

* fix: surface yvBTC in the default vault list

* update filtering

* init

* adjust spacing

* improve vault list row chips and expanded info

* add etherscan link to compressed header

* add hover effect and more vault info

* better styling

* improved compressed header title

* improve widget clarity

* check for swap in zap and display info differently accordingly

* Improve lock icon in vault page header

* update risk section

* more yvBTC prep

* Show yvUSD cooldown status in deposits header

* fix: show yvUSD cooldown status in mobile header

* add cooldown info to deposits panel

* generalize cooldown changes to yvBTC

* fix issue with neon password

* Hide yvBTC from vault lists before launch

* lint and update docs

* hide dust under $0.01

* fix: clean up more yvBTC stuff

* improve chip and yvUSD widget alert styling
* fix: breakdown pricing

* fix: flicker

* chore: rm hook and use chart data

* test: share data

* fix: utc price

* fix: annual %

* fix: balance calc

Co-Authored-By: w84april <donyaschefer@gmail.com>

* chore: cleanup

Co-Authored-By: w84april <donyaschefer@gmail.com>

* add yvusd portfolio charts (#1209)

* add yvUSD charts

* improve yvUSD charts and other fixes

* fix dependency

* feat: yearn-prices (#1211)

* feat: yearn-prices

* chore: lint

* init

* update chart layout and breakpoints

* update suggested cards

* update placeholder card for chart and chart loading spinners

* improve loading input with progress bar

* fix chart data error and lint

* improve labelling and margins

* add timeframe dropdown to vault page charts

* consolidate loading spinner types

* chore: rm price caching

* fix portfolio holdings history consistency

* fix staking edge cases

* fix misc small review issues

* feat: activity style update

Co-Authored-By: w84april <donyaschefer@gmail.com>

* feat: support router/zap

Co-Authored-By: w84april <donyaschefer@gmail.com>

* fix: symbol

Co-Authored-By: w84april <donyaschefer@gmail.com>

* style: icons

Co-Authored-By: w84april <donyaschefer@gmail.com>

* feat: filters

Co-Authored-By: w84april <donyaschefer@gmail.com>

* fix: mobile

Co-Authored-By: w84april <donyaschefer@gmail.com>

* lint

* update activity row styling

* more styling updates

* update dev server startup message

* fix list styling, update icons, improve date picker

* remove image

* fix review issues

* back off fetches to prevent 429s

* increase rate limit

* surface transfers without other events

* feat: better decode zaps & fix date range

* feat: add mobile

* add locker reward claims, ycrv zaps, and better v2 enrichement

* improve yBOLD transaction resolution

* style: move chain selector

* update icons

* style: mobile

* add zap swaps and old zapper zaps,

* fix duplicate keys

* clean up build warnings and errors

* update mobile styling for activity list

* reward claim styling

* Feat/progress (#1220)

* feat: progress

* feat: kill chores

* feat: rm fake progress

* chore: copy

* feat: hash address

* chore: cache 1h & do not disable db

* Prep for yvBTC (#1185)

* fix: classify yvBTC as a yearn vault

* feat: pin yvBTC at the top of vaults

* fix: surface yvBTC in the default vault list

* update filtering

* init

* adjust spacing

* improve vault list row chips and expanded info

* add etherscan link to compressed header

* add hover effect and more vault info

* better styling

* improved compressed header title

* improve widget clarity

* check for swap in zap and display info differently accordingly

* Improve lock icon in vault page header

* update risk section

* more yvBTC prep

* Show yvUSD cooldown status in deposits header

* fix: show yvUSD cooldown status in mobile header

* add cooldown info to deposits panel

* generalize cooldown changes to yvBTC

* fix issue with neon password

* Hide yvBTC from vault lists before launch

* lint and update docs

* hide dust under $0.01

* fix: clean up more yvBTC stuff

* improve chip and yvUSD widget alert styling

* fix: stale loading

* update gitignore

* make vaults and portfolio eager loaded

* clean up unconnected and no balance pages and add yvUSD card to suggested

* prevent refetch from re-initializing loading

* fix mobile styling

* fix styling that no one will notice

---------

Co-authored-by: rossgalloway <58150151+rossgalloway@users.noreply.github.com>

* feat: render controls even with 0 current balance

* feat: restore position based growth

* fix: hide selector if 1 option

---------

Co-authored-by: rossgalloway <58150151+rossgalloway@users.noreply.github.com>
…rlays and flows (#1186)

* fix: support safe katana approval overlay

* fix: handle safe transaction overlay submission

* fix: handle safe approval overlay submission

* fix: prefer safe target chain for overlays

* fix: poll safe overlay execution

* feat: show pending safe execution in wallet panel

* fix: refresh vault state after safe execution

* fix: track safe tx lifecycle from safe hashes

* fix: refresh safe state before settling success

* fix: keep safe approve flow moving

* fix: pause before safe step auto-continue

* fix: slow safe interstep progression

* feat: safe batching (#1210)

* feat: safe batching

Co-Authored-By: w84april <donyaschefer@gmail.com>

* fix test

---------

Co-authored-by: rossgalloway <58150151+rossgalloway@users.noreply.github.com>

* lint

---------

Co-authored-by: w84april <32621609+w84april@users.noreply.github.com>
Co-Authored-By: w84april <donyaschefer@gmail.com>
w84april and others added 13 commits May 18, 2026 13:26
Allow Tenderly mode toggling on private Tailnet preview hosts and make the header badge recover when the control panel status is stale.\n\n- Treat .ts.net hosts as private preview hosts for Tenderly toggles\n- Let the Tenderly badge open and refetch panel status while active\n- Cover the runtime toggle gate with focused tests
(cherry picked from commit 65f8f81f989fdbfd2e5e83d058440fef9d42969f)
…owser or

(cherry picked from commit 4f6657030d797b3e2e6f077ceb14e871b7f94951)
(cherry picked from commit a12cad66859e42746501ae260019a5a8fcc82d2c)
…n bo

(cherry picked from commit 0850bb75d238ce8289348c18152b3b9bbd642090)
…sion/ori

(cherry picked from commit 0556f7da95470297ae16bac305ffe7af3b82b6b3)
Base automatically changed from release/26-04-17 to main May 29, 2026 13:12
@w84april

w84april commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator Author

cherry picked into #1264

@w84april w84april closed this Jun 9, 2026
@w84april w84april reopened this Jun 9, 2026
# Conflicts:
#	.env.example
#	api/README.md
#	api/holdings/activity-facets.ts
#	api/holdings/activity.test.ts
#	api/holdings/activity.ts
#	api/holdings/breakdown.ts
#	api/holdings/history.test.ts
#	api/holdings/history.ts
#	api/holdings/pnl/simple-history.test.ts
#	api/holdings/progress.ts
#	api/holdings/protocol-return/history.ts
#	api/lib/holdings/README.md
#	api/lib/holdings/config.ts
#	api/lib/holdings/index.ts
#	api/lib/holdings/services/activity.test.ts
#	api/lib/holdings/services/activity.ts
#	api/lib/holdings/services/aggregator.test.ts
#	api/lib/holdings/services/aggregator.ts
#	api/lib/holdings/services/cache.test.ts
#	api/lib/holdings/services/cache.ts
#	api/lib/holdings/services/defillama.ts
#	api/lib/holdings/services/graphql.test.ts
#	api/lib/holdings/services/graphql.ts
#	api/lib/holdings/services/nestedVaultPrices.ts
#	api/lib/holdings/services/pnlSimple.test.ts
#	api/lib/holdings/services/progress.ts
#	api/lib/holdings/services/ratelimit.ts
#	api/server.ts
#	bun.lock
#	package.json
#	src/components/IframeAutoConnect.tsx
#	src/components/pages/portfolio/hooks/usePortfolioActivity.ts
#	src/components/pages/portfolio/hooks/usePortfolioHistory.ts
#	src/components/pages/portfolio/hooks/usePortfolioHistoryProgress.ts
#	src/components/pages/portfolio/hooks/usePortfolioModel.helpers.test.ts
#	src/components/pages/portfolio/hooks/usePortfolioModel.helpers.ts
#	src/components/pages/portfolio/hooks/usePortfolioModel.ts
#	src/components/pages/portfolio/hooks/usePortfolioProtocolReturnHistory.ts
#	src/components/pages/portfolio/index.tsx
#	src/components/pages/portfolio/types/api.test.ts
#	src/components/pages/portfolio/types/api.ts
#	src/components/pages/vaults/[chainID]/[address].tsx
#	src/components/pages/vaults/components/SuggestedVaultCard.test.tsx
#	src/components/pages/vaults/components/SuggestedVaultCard.tsx
#	src/components/pages/vaults/components/list/VaultsListRowExpandedContent.tsx
#	src/components/pages/vaults/components/widget/deposit/ApprovalOverlay.tsx
#	src/components/pages/vaults/components/widget/deposit/index.tsx
#	src/components/pages/vaults/components/widget/deposit/useDepositFlow.ts
#	src/components/pages/vaults/components/widget/shared/TransactionOverlay.tsx
#	src/components/pages/vaults/components/widget/shared/transactionOverlay.helpers.test.ts
#	src/components/pages/vaults/components/widget/shared/transactionOverlay.helpers.ts
#	src/components/pages/vaults/components/widget/withdraw/index.tsx
#	src/components/pages/vaults/components/widget/withdraw/safeWithdrawBatch.ts
#	src/components/pages/vaults/components/widget/withdraw/withdrawStepHelpers.ts
#	src/components/pages/vaults/hooks/useVaultUserData.ts
#	src/components/shared/components/Header.tsx
#	src/config/tenderly.ts
#	vite.config.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a development-focused “Codex Wallet” (impersonation / mock + optional private-key signing) and expands local/preview Tenderly tooling and embed safety checks across the app.

Changes:

  • Introduces a Codex RainbowKit wallet + optional auto-connect behavior gated by env/query/localStorage flags.
  • Tightens Tenderly configuration/runtime validation (including preventing execution chain ID collisions) and broadens where Tenderly mode can be toggled (loopback + Tailscale previews).
  • Adds trusted-embed detection for iframe auto-connect flows and introduces admin/cache invalidation utilities.

Reviewed changes

Copilot reviewed 28 out of 29 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/config/wagmi.ts Adds Codex wallet group to RainbowKit connectors when enabled.
src/config/tenderly.ts Allows Tenderly toggling on .ts.net hosts; prevents Tenderly execution chain IDs from shadowing canonical chain IDs.
src/config/tenderly.test.ts Adds test coverage for toggling rules and chain-id shadowing validation.
src/config/codexWallet.ts Implements Codex wallet (mock connector + optional private-key signing connector).
src/components/shared/utils/helpers.ts Adds isTrustedEmbed() to restrict iframe auto-connect to trusted Safe origins.
src/components/shared/utils/helpers.test.ts Tests isTrustedEmbed() behavior across ancestorOrigins/referrer/SSR cases.
src/components/shared/hooks/useBalancesRouting.test.ts Updates routing expectation for Tenderly-backed chains behavior (Enso vs multicall).
src/components/shared/hooks/useBalancesCombined.ts Stops auto-marking Tenderly-backed chains as Enso-unsupported.
src/components/shared/contexts/useWeb3.tsx Adds Codex wallet auto-connect when Codex is enabled.
src/components/shared/components/Header.tsx Adjusts Tenderly badge click behavior to open panel / refetch status when controls aren’t toggleable.
src/components/pages/vaults/hooks/useTenderlyVaultBalanceOverrides.ts Adds hook to refresh vault/token/staking balances for Tenderly overrides (incl. yvUSD/yvBTC variants).
src/components/pages/vaults/hooks/useTenderlyVaultBalanceOverrides.test.ts Tests override token list generation behavior.
src/components/pages/vaults/hooks/actions/useYvUsdLockedZapDeposit.ts Passes explicit account to approval simulation/write preparation.
src/components/pages/vaults/hooks/actions/useDirectDeposit.ts Passes explicit account to approval simulation/write preparation.
src/components/pages/vaults/components/widget/shared/TransactionOverlay.tsx Improves error message to be Safe-specific only when the wallet is Safe.
src/components/pages/vaults/components/widget/deposit/ApprovalOverlay.tsx Mirrors Safe-specific error messaging change for approvals.
src/components/IframeAutoConnect.tsx Requires trusted embed in addition to iframe detection before auto-connecting.
src/components/IframeAutoConnect.test.tsx Tests trusted-embed gating for iframe auto-connect.
plans/2026-04-06-withdraw-zap-usd-amounts.md Removes plan document.
docs/manual-allocation-reallocation-data-spec.md Removes spec document.
bun.lock Bumps a few transitive dependency versions.
api/tenderlyAccess.ts Adds origin allowlist + admin secret handling + CORS helpers for Tenderly admin routes.
api/tenderlyAccess.test.ts Adds tests for origin allowlist, preflight, secret enforcement, and CORS header behavior.
api/tenderly.helpers.ts Mirrors Tenderly chain-id shadowing protection on server-side parsing.
api/tenderly.helpers.test.ts Adds tests for chain-id shadowing and duplicate execution ids.
api/lib/holdings/services/cache.ts Adds Redis marker-based vault cache invalidation helper.
api/lib/holdings/services/cache.test.ts Adds test for vault invalidation marker writes.
api/admin/invalidate-cache.ts Adds admin endpoint to invalidate vault cache markers.
.env.example Removes HOLDINGS_TEST_WALLET_ADDRESS from example env.

Comment thread api/tenderlyAccess.ts
Comment thread api/admin/invalidate-cache.ts
Comment thread src/config/codexWallet.ts Outdated
Address Copilot review feedback by keeping Tenderly admin routes request-aware, restricting cache invalidation CORS to allowlisted origins, and rejecting unsupported Codex wallet chains instead of falling back to the default chain.
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.

3 participants