Skip to content

refactor: earn flow + remove xstate/store - #551

Open
petar-omni wants to merge 113 commits into
mainfrom
feat/earn-effect-atom-poc
Open

refactor: earn flow + remove xstate/store#551
petar-omni wants to merge 113 commits into
mainfrom
feat/earn-effect-atom-poc

Conversation

@petar-omni

@petar-omni petar-omni commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Note

High Risk
Large new DeFi borrow path with wallet signing, transaction submission, and LTV validation touches money-moving flows; earn routing/state refactor could regress staking if mis-wired.

Overview
Adds a feature-flagged borrow experience in the dashboard (form → review → steps → complete, plus borrow position management), backed by a new borrow module: Effect Schema domain models, OpenAPI-generated BorrowApi client, and @effect/atom-react atoms for markets/positions, form state, action execution (sign/submit/confirm), and post-tx cache refresh.

Earn flow cleanup: drops EarnPageStateUsageBoundaryProvider / @xstate/store, removes common/get-token-balances.ts and getInitialToken from stake types, and tightens validator handling via a composite Validator.key (address + optional subnet) used in select-validator and position balance keys.

Tooling/config: OpenAPI generator gains BorrowApi (full httpclient + spec prep), optional CLI spec selection, VITE_BORROW_API_URL / VITE_FORCE_BORROW, and root pnpm.patchedDependencies removed; adds skeleton line/circle loaders for borrow UI loading states.

Reviewed by Cursor Bugbot for commit 6cf3187. Configure here.

@changeset-bot

changeset-bot Bot commented Jun 26, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 3eecab6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f2d2a83c-e736-49e8-b48f-3041b4042c82

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/earn-effect-atom-poc

Comment @coderabbitai help to get the list of available commands.

@aws-amplify-eu-central-1

Copy link
Copy Markdown

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-551.d2ribjy8evqo6h.amplifyapp.com

@aws-amplify-eu-central-1

Copy link
Copy Markdown

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-551.df4xyoi0xyeak.amplifyapp.com

Key validators by address and subnet so selection keeps distinct validator options.

Scope balance and init token options to the selected dashboard category.
@petar-omni
petar-omni marked this pull request as ready for review July 7, 2026 12:22
Philippoes
Philippoes previously approved these changes Jul 7, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale comment

Philippoes
Philippoes previously approved these changes Jul 7, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale comment

Risk: high. Not approving: this large earn/borrow refactor exceeds the low-risk approval threshold, Cursor Security Agent left an unresolved medium-severity finding, and required checks did not finish on the latest commit (Bugbot cancelled; Security Agent still running). Assigned jdomingos and dnehl for human review.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@cursor
cursor Bot requested a review from jdomingos July 7, 2026 12:31

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale comment

Risk: high. Not approving: this large earn/borrow refactor exceeds the low-risk approval threshold, and Cursor Security Agent has an unresolved medium-severity tabnabbing finding on complete.tsx. jdomingos and dnehl are already assigned for human review.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

dnehl
dnehl previously approved these changes Jul 7, 2026

@dnehl dnehl left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Played around with the flow - looks good.

  • no console errors
  • no "strange" multiple backend calls
  • duration looks good

@dnehl
dnehl self-requested a review July 7, 2026 14:11
Split earn intent and view atoms so route and wallet state changes update the resolved view.

Keep dispatch separate from view reads and add wallet resolution handling.

Cover dashboard tab selection and patch Effect parent tracking.
Use the native TypeScript 7 compiler across the widget and examples.
Keep TypeScript 6 API compatibility for Next.js tooling.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale comment

Risk: high. Not approving: this large earn/borrow refactor exceeds the low-risk approval threshold, and Cursor Security Agent has an unresolved medium-severity tabnabbing finding on complete.tsx. jdomingos and dnehl are already assigned for human review.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

Replace legacy context, query, and state-machine integrations with Effect services and
atom-backed wallet, API, and workflow state.

Split Vitest projects and add AST rules to validate the new architecture.
@petar-omni
petar-omni force-pushed the feat/earn-effect-atom-poc branch from 16d2bb4 to 67eb76f Compare July 15, 2026 08:42

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale comment

Risk: high. Not approving: this large earn/borrow refactor exceeds the low-risk approval threshold, and Cursor Security Agent still has unresolved findings (medium tabnabbing and high canary-publish/supply-chain issues in release.yml). jdomingos and dnehl are already assigned for human review.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

Actions with empty, address-like, or missing token symbols no longer
fall back to "Unknown token". Filter them from the activity list so
users only see items with a usable token label.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale comment


return (url: string) => {
trackEvent("viewTxClicked");
window.open(url, "_blank");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Agentic Security Review
Severity: MEDIUM

window.open(url, "_blank") is called on a transaction URL without opener isolation or URL validation. If this URL is attacker-controlled (directly or via compromised upstream metadata), the opened page can retain window.opener access and redirect the original trusted tab.

Impact: This enables reverse-tabnabbing/phishing flow hijack during a wallet-sensitive user journey.

Fix in Cursor Fix in Web

Reviewed by Cursor Security Reviewer for commit 73852cc. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale comment

Risk: high. Not approving: this large earn/borrow refactor exceeds the low-risk approval threshold, and Cursor Security Agent still has unresolved findings (medium tabnabbing and high canary-publish/supply-chain issues in release.yml). jdomingos and dnehl are already assigned for human review.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

Unstake USD previously reflected the full position balance. Scale it
from the entered exit amount so partial exits show the correct value.
Tighten the form pane gap and increase spacing within amount and
details sections for clearer visual hierarchy.
Proxy to the widget package so `pnpm dev` works from the monorepo root.
Raise pinned toolchain versions to Node 24.19.0, npm 11.19.0, and
pnpm 11.19.0 so local and CI tooling stay on current releases.
The legacy price API serializes native tokens with an undefined address
key, while local token identity uses an empty one. Fall back to the
legacy key so USD amounts format correctly for native tokens.
Introduce a tabbed position-details hub and extract AmountTokenSection
so stake and unstake share one amount card instead of drifting apart.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale comment

Risk: high. Not approving: this large earn/borrow refactor exceeds the low-risk approval threshold, and Cursor Security Agent still has unresolved findings (medium tabnabbing and high canary-publish/supply-chain issues in release.yml). jdomingos and dnehl are already assigned for human review.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale comment

Risk: high. Not approving: this large earn/borrow refactor exceeds the low-risk approval threshold, and Cursor Security Agent still has unresolved findings (medium tabnabbing and high canary-publish/supply-chain issues in release.yml). jdomingos and dnehl are already assigned for human review.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

Hide the CTA for empty yield lists only when connected, so disconnected
users can still connect instead of seeing no primary action.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale comment

Risk: high. Not approving: this large earn/borrow refactor exceeds the low-risk approval threshold, and Cursor Security Agent still has unresolved findings (medium tabnabbing and high canary-publish/supply-chain issues in release.yml). No new reviewers assigned; two reviewers are already requested for human review.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

Align classic and dashboard unstake on one shared section with a footer
CTA, and select the receive token from the amount accessory like
enter/stake instead of a separate dropdown.
Pending actions can require validator selection while the position has
nothing to unstake, so rendering the modal inside the unstake section
hid it. Render it alongside the whole surface on both classic and
dashboard instead.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale comment

Risk: high. Not approving: Cursor Security Agent did not reach a terminal state within the polling window, and this large earn/borrow refactor exceeds the low-risk approval threshold. No new reviewers assigned; two reviewers are already requested for human review.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

Replace technical-kind domain/schema and domain/types folders with
concept-owned modules so schemas and rules live with the concept they
describe. Record the decision in ADR 0020.
WidgetConfigService exclusively owns one normalization pass and the
current value stream so valid Host Configuration updates apply without
remounting. Record the decision in ADR 0021 and supersede mount-time
Application Runtime Identity for API identity and borrowEnabled.
Keep the wallet runtime alive when comparable wallet fields change after
bootstrap; log and ignore those updates so host config can keep syncing.
Also remove the unused disableGasCheck host setting.
Match allow, block, and preferred rules with network-sensitive address
identity, and commit Earn Selection when Host Configuration updates
invalidate the current validators.
Replace the staged Earn state machine with Entry Intent, pure
reconciliation, and a non-paginated Earn Catalog per ADR-0022. Drop
token pagination, stage-specific retry, and selection facades.
Move validator policy normalization into WidgetConfig so all Earn consumers
share the same Map/Set representation. Remove the feature-local adapter while
preserving network-specific wildcard identity handling in filterValidators.
Keep window and Vite environment augmentations in one package-owned declaration file.
Update the test-only export configuration to track the consolidated entry.
Keep Borrow wallet interpretation with the feature as a pure view projection.

Derive it from the shared wallet selector.

Remove the unused bridge payload and domain wallet schema.

Remove the redundant guard hook and obsolete chain exports.
Move architecture enforcement into the widget package and keep the root hygiene command as a thin
Turbo entrypoint. Replace manual interface and export checks with dependency-cruiser, Knip, and
ast-grep while removing obsolete fixtures and configs.
@socket-security

Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: npm @coinbase/cdp-sdk is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: pnpm-lock.yamlnpm/@tronweb3/tronwallet-adapter-walletconnect@3.0.5npm/@coinbase/cdp-sdk@1.52.0

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@coinbase/cdp-sdk@1.52.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Obfuscated code: npm @mixpanel/rrweb-snapshot is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: pnpm-lock.yamlnpm/mixpanel-browser@2.81.0npm/@mixpanel/rrweb-snapshot@2.0.0-alpha.18.5

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@mixpanel/rrweb-snapshot@2.0.0-alpha.18.5. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Obfuscated code: npm @solana-program/system is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: pnpm-lock.yamlnpm/@tronweb3/tronwallet-adapter-walletconnect@3.0.5npm/@solana-program/system@0.10.0

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@solana-program/system@0.10.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Obfuscated code: npm @walletconnect/sign-client is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: pnpm-lock.yamlnpm/@tronweb3/tronwallet-adapter-walletconnect@3.0.5npm/@walletconnect/sign-client@2.23.7

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@walletconnect/sign-client@2.23.7. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
High CVE: npm brace-expansion: DoS via unbounded expansion length causing an out-of-memory process crash

CVE: GHSA-mh99-v99m-4gvg brace-expansion: DoS via unbounded expansion length causing an out-of-memory process crash (HIGH)

Affected versions: >= 4.0.0 < 5.0.8; >= 3.0.0 < 3.0.3; >= 2.0.0 < 2.1.3; < 1.1.17

Patched version: 1.1.17

From: pnpm-lock.yamlnpm/@cosmos-kit/keplr@2.17.1npm/@cosmos-kit/core@2.18.1npm/@cosmos-kit/walletconnect@2.15.1npm/@luno-kit/core@0.0.13npm/serve@14.2.6npm/@solana/wallet-adapter-wallets@0.19.38npm/@solana-mobile/wallet-adapter-mobile@2.2.9npm/@tronweb3/tronwallet-adapter-walletconnect@3.0.5npm/react-i18next@17.0.11npm/wagmi@3.7.5npm/brace-expansion@1.1.15

ℹ Read more on: This package | This alert | What is a CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/brace-expansion@1.1.15. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
High CVE: npm brace-expansion: DoS via exponential-time expansion of consecutive non-expanding {} groups

CVE: GHSA-3jxr-9vmj-r5cp brace-expansion: DoS via exponential-time expansion of consecutive non-expanding {} groups (HIGH)

Affected versions: >= 3.0.0 < 5.0.7; < 1.1.16; >= 2.0.0 < 2.1.2

Patched version: 1.1.16

From: pnpm-lock.yamlnpm/@cosmos-kit/keplr@2.17.1npm/@cosmos-kit/core@2.18.1npm/@cosmos-kit/walletconnect@2.15.1npm/@luno-kit/core@0.0.13npm/serve@14.2.6npm/@solana/wallet-adapter-wallets@0.19.38npm/@solana-mobile/wallet-adapter-mobile@2.2.9npm/@tronweb3/tronwallet-adapter-walletconnect@3.0.5npm/react-i18next@17.0.11npm/wagmi@3.7.5npm/brace-expansion@1.1.15

ℹ Read more on: This package | This alert | What is a CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/brace-expansion@1.1.15. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
High CVE: npm brace-expansion: DoS via unbounded intermediate arrays, bypassing the CVE-2026-14257 mitigation

CVE: GHSA-rgw5-rvv9-x895 brace-expansion: DoS via unbounded intermediate arrays, bypassing the CVE-2026-14257 mitigation (HIGH)

Affected versions: < 1.1.18; >= 2.0.0 < 2.1.4; >= 3.0.0 < 3.0.6; >= 4.0.0 < 5.0.9

Patched version: 1.1.18

From: pnpm-lock.yamlnpm/@cosmos-kit/keplr@2.17.1npm/@cosmos-kit/core@2.18.1npm/@cosmos-kit/walletconnect@2.15.1npm/@luno-kit/core@0.0.13npm/serve@14.2.6npm/@solana/wallet-adapter-wallets@0.19.38npm/@solana-mobile/wallet-adapter-mobile@2.2.9npm/@tronweb3/tronwallet-adapter-walletconnect@3.0.5npm/react-i18next@17.0.11npm/wagmi@3.7.5npm/brace-expansion@1.1.15

ℹ Read more on: This package | This alert | What is a CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/brace-expansion@1.1.15. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Obfuscated code: npm data-urls is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: pnpm-lock.yamlnpm/jsdom@30.0.1npm/data-urls@7.0.0

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/data-urls@7.0.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Obfuscated code: npm formatly is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: pnpm-lock.yamlnpm/knip@6.31.0npm/formatly@0.3.0

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/formatly@0.3.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Obfuscated code: npm jsdom is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: packages/widget/package.jsonnpm/jsdom@30.0.1

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/jsdom@30.0.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Obfuscated code: npm libsodium-sumo is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: pnpm-lock.yamlnpm/@meshsdk/wallet@1.9.1npm/libsodium-sumo@0.8.4

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/libsodium-sumo@0.8.4. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Obfuscated code: npm libsodium-sumo is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: pnpm-lock.yamlnpm/@meshsdk/wallet@1.9.1npm/libsodium-sumo@0.8.4

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/libsodium-sumo@0.8.4. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Telemetry collection: npm mixpanel-browser

Note: The package dist/mixpanel.module.js is a DOM/session recording and analytics library that captures user interactions, DOM state, inputs, and other events, and transmits data to external endpoints using token-based authorization. It may monkey-patch browser APIs and process data via a base64-encoded Web Worker, with persistence of recording queues/flags. This creates a high privacy risk and requires masking, user consent, endpoint allow-listing, auditing, and strict privacy/configuration controls.

From: packages/widget/package.jsonnpm/mixpanel-browser@2.81.0

ℹ Read more on: This package | This alert | What is telemetry?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Most telemetry comes with settings to disable it. Consider disabling telemetry if you do not want to be tracked.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/mixpanel-browser@2.81.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Telemetry collection: npm mixpanel-browser

Note: The package dist/mixpanel.module.js is a DOM/session recording and analytics library that captures user interactions, DOM state, inputs, and other events, and transmits data to external endpoints using token-based authorization. It may monkey-patch browser APIs and process data via a base64-encoded Web Worker, with persistence of recording queues/flags. This creates a high privacy risk and requires masking, user consent, endpoint allow-listing, auditing, and strict privacy/configuration controls.

From: packages/widget/package.jsonnpm/mixpanel-browser@2.81.0

ℹ Read more on: This package | This alert | What is telemetry?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Most telemetry comes with settings to disable it. Consider disabling telemetry if you do not want to be tracked.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/mixpanel-browser@2.81.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Telemetry collection: npm mixpanel-browser

Note: The file package/dist/mixpanel-recorder.min.js is a telemetry library that instruments user interactions (mouse, touch, scroll, input, canvas, DOM events) for session-replay analytics, batching and persisting data in IndexedDB/localStorage/cookies, and sending compressed payloads to a remote analytics endpoint (e.g., Mixpanel). It also intercepts XMLHttpRequest and fetch calls, captures request/response headers and optionally bodies, and transmits data to a remote analytics service, raising privacy and data-exfiltration concerns if misconfigured or misused.

From: packages/widget/package.jsonnpm/mixpanel-browser@2.81.0

ℹ Read more on: This package | This alert | What is telemetry?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Most telemetry comes with settings to disable it. Consider disabling telemetry if you do not want to be tracked.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/mixpanel-browser@2.81.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Telemetry collection: npm mixpanel-browser

Note: The file package/dist/mixpanel-recorder.min.js is a telemetry library that instruments user interactions (mouse, touch, scroll, input, canvas, DOM events) for session-replay analytics, batching and persisting data in IndexedDB/localStorage/cookies, and sending compressed payloads to a remote analytics endpoint (e.g., Mixpanel). It also intercepts XMLHttpRequest and fetch calls, captures request/response headers and optionally bodies, and transmits data to a remote analytics service, raising privacy and data-exfiltration concerns if misconfigured or misused.

From: packages/widget/package.jsonnpm/mixpanel-browser@2.81.0

ℹ Read more on: This package | This alert | What is telemetry?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Most telemetry comes with settings to disable it. Consider disabling telemetry if you do not want to be tracked.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/mixpanel-browser@2.81.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Obfuscated code: npm mixpanel-browser is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: packages/widget/package.jsonnpm/mixpanel-browser@2.81.0

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/mixpanel-browser@2.81.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Obfuscated code: npm mixpanel-browser is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: packages/widget/package.jsonnpm/mixpanel-browser@2.81.0

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/mixpanel-browser@2.81.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
High CVE: npm nanoid: custom generators can loop indefinitely when size is zero

CVE: GHSA-2v37-7h3g-55p8 nanoid: custom generators can loop indefinitely when size is zero (HIGH)

Affected versions: < 3.3.18; >= 4.0.0 < 5.1.6

Patched version: 3.3.18

From: pnpm-lock.yamlnpm/@meshsdk/wallet@1.9.1npm/nanoid@3.3.15

ℹ Read more on: This package | This alert | What is a CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/nanoid@3.3.15. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
High CVE: npm nanoid: non-secure generators can loop indefinitely with negative size

CVE: GHSA-28wg-ghj8-5hjv nanoid: non-secure generators can loop indefinitely with negative size (HIGH)

Affected versions: < 3.3.16; >= 4.0.0 < 5.1.16

Patched version: 3.3.16

From: pnpm-lock.yamlnpm/@meshsdk/wallet@1.9.1npm/nanoid@3.3.15

ℹ Read more on: This package | This alert | What is a CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/nanoid@3.3.15. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Low adoption: npm @dedot/cli

Location: Package overview

From: pnpm-lock.yamlnpm/@luno-kit/core@0.0.13npm/@dedot/cli@0.16.0

ℹ Read more on: This package | This alert | What are unpopular packages?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Unpopular packages may have less maintenance and contain other problems.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@dedot/cli@0.16.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Low adoption: npm @dedot/codegen

Location: Package overview

From: pnpm-lock.yamlnpm/@luno-kit/core@0.0.13npm/@dedot/codegen@0.16.0

ℹ Read more on: This package | This alert | What are unpopular packages?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Unpopular packages may have less maintenance and contain other problems.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@dedot/codegen@0.16.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Low adoption: npm @dedot/merkleized-metadata

Location: Package overview

From: pnpm-lock.yamlnpm/@luno-kit/core@0.0.13npm/@dedot/merkleized-metadata@0.16.0

ℹ Read more on: This package | This alert | What are unpopular packages?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Unpopular packages may have less maintenance and contain other problems.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@dedot/merkleized-metadata@0.16.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Low adoption: npm @dedot/smoldot

Location: Package overview

From: pnpm-lock.yamlnpm/@luno-kit/core@0.0.13npm/@dedot/smoldot@0.16.0

ℹ Read more on: This package | This alert | What are unpopular packages?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Unpopular packages may have less maintenance and contain other problems.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@dedot/smoldot@0.16.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Low adoption: npm dedot

Location: Package overview

From: pnpm-lock.yamlnpm/@luno-kit/core@0.0.13npm/dedot@0.16.0

ℹ Read more on: This package | This alert | What are unpopular packages?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Unpopular packages may have less maintenance and contain other problems.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/dedot@0.16.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Risk: high. Not approving: this large earn/borrow refactor exceeds the low-risk approval threshold, and Cursor Security Agent still has unresolved high and medium findings that need human review. No new reviewers assigned; two reviewers are already requested.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

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