Conversation
📝 WalkthroughWalkthroughStronger TypeScript typings added for Vision Portfolio data across three wallet query modules; getTokenOperationsQueryOptions gained an isForOwner parameter and defaulted currency behavior. CI workflow added a "Rebuild affected packages" step. Package versions and changelogs bumped for sdk and wallets. No runtime behavior changes beyond access gating in token operations. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.github/workflows/auto-changeset.yml:
- Around line 148-151: The comment claims we're "checking git diff on
package.json versions" but the grep lines (checking "^packages/sdk/",
"^packages/wallets/", "^packages/render-helper/") match any file in those
directories; update either the comment to reflect we're checking any file under
those packages or narrow the greps to target package.json specifically (e.g.
grep for "^packages/sdk/package.json" etc.) and keep the CHANGED_PACKAGES
assignment logic (CHANGED_PACKAGES="$CHANGED_PACKAGES sdk") unchanged so the
behavior remains consistent with the intent.
🧹 Nitpick comments (3)
packages/wallets/src/modules/wallets/queries/get-tokens-operations-query-options.ts (3)
35-46: Type annotation doesn't match the defensive runtime handling.Line 35 types
rawActionsasArray<{ id: string; ... }>, requiringidto always be present. However, the map callback at line 37 handles strings, and line 42 falls back tocode,name, oractionwhenidis absent. Consider aligning the type with the actual data shape.♻️ Suggested type alignment
- const rawActions: Array<{ id: string; [key: string]: unknown }> = assetEntry.actions ?? []; + const rawActions: Array<{ id?: string; [key: string]: unknown } | string> = assetEntry.actions ?? []; const operations: AssetOperation[] = rawActions - .map((action: { id: string; [key: string]: unknown } | string) => { + .map((action) => {
138-139: Avoidas anycast; prefer type extension.Using
as anybypasses type safety. Ifsavingsis a legitimate property of wallet items, consider extendingVisionPortfolioWalletItemor using a type guard.♻️ Suggested approach
- const rawToken = assetEntry as any; - const hasSavings = Number(rawToken.savings ?? 0) > 0; + const hasSavings = Number((assetEntry as { savings?: number }).savings ?? 0) > 0;Or better, if
savingsis common, extend the type at the source.
151-153: Silent error swallowing may hide issues.The empty
catchblock returns an empty array without logging, which could obscure API failures or configuration issues. Consider adding minimal logging for observability.🔍 Suggested improvement
- } catch { + } catch (error) { + console.warn(`[getTokenOperationsQueryOptions] Failed to fetch operations for ${token}:`, error); return []; }
Summary by CodeRabbit
New Features
Refactor
Chores