Skip to content

Dp502/dash integration#970

Merged
depressedPlumber502 merged 3 commits intomainfrom
dp502/dash-integration
Mar 4, 2026
Merged

Dp502/dash integration#970
depressedPlumber502 merged 3 commits intomainfrom
dp502/dash-integration

Conversation

@depressedPlumber502
Copy link
Collaborator

No description provided.

@vercel
Copy link

vercel bot commented Mar 4, 2026

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

Project Deployment Actions Updated (UTC)
defuse-widget Ready Ready Preview, Comment Mar 4, 2026 8:13am

Request Review

@supabase
Copy link

supabase bot commented Mar 4, 2026

Updates to Preview Branch (dp502/dash-integration) ↗︎

Deployments Status Updated
Database Wed, 04 Mar 2026 08:12:28 UTC
Services Wed, 04 Mar 2026 08:12:28 UTC
APIs Wed, 04 Mar 2026 08:12:28 UTC

Tasks are run on every commit but only new migration files are pushed.
Close and reopen this PR if you want to apply changes from existing seed or migration files.

Tasks Status Updated
Configurations Wed, 04 Mar 2026 08:12:29 UTC
Migrations Wed, 04 Mar 2026 08:12:30 UTC
Seeding Wed, 04 Mar 2026 08:12:30 UTC
Edge Functions Wed, 04 Mar 2026 08:12:30 UTC

View logs for this Workflow Run ↗︎.
Learn more about Supabase for Git ↗︎.

@coderabbitai
Copy link

coderabbitai bot commented Mar 4, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0987997b-e4c5-4f62-a49d-bf648b40b0a5

📥 Commits

Reviewing files that changed from the base of the PR and between fc993a6 and 43a37f5.

📒 Files selected for processing (1)
  • src/tokens/production.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/tokens/production.json

Walkthrough

Adds Dash blockchain support across the Defuse frontend: dependency bumps, new chain icon and options, CHAIN_IDS and RPC placeholder, adapter/CAIP2 mappings, deposit routing/balance handling, address/tx explorer support, type/schema updates, and a Dash token entry. All changes are additive mappings and switch cases.

Changes

Cohort / File(s) Summary
Dependencies
package.json
Bumped @defuse-protocol/intents-sdk ^0.55.0 → ^0.56.0 and @defuse-protocol/internal-utils ^0.28.3 → ^0.29.0.
UI & Chain Registry
src/components/DefuseSDK/constants/blockchains.tsx
Added Dash icon mapping and public blockchain option for Dash.
Chain IDs & Settings
src/components/DefuseSDK/constants/evm.ts, src/components/DefuseSDK/constants/settings.ts
Added dash key to CHAIN_IDS (undefined) and rpcUrls.dash placeholder.
Deposit / Balance Logic
src/components/DefuseSDK/features/machines/depositEstimationActor.ts, src/components/DefuseSDK/features/machines/depositTokenBalanceMachine.ts, src/components/DefuseSDK/services/depositService.ts
Handled BlockchainEnum.DASH across deposit estimation (returns 0n), balance actor (treated unsupported), and deposit route logic (activeDeposit: false, passiveDeposit: true); added wallet RPC resolution for Dash.
Types & Adapters
src/components/DefuseSDK/types/base.ts, src/components/DefuseSDK/utils/adapters.ts, src/components/DefuseSDK/utils/caip2.ts
Added "dash" to SupportedChainName, added mapping in assetNetworkAdapter/reverse mapping, and CAIP2 mapping for Dash.
Utilities
src/components/DefuseSDK/utils/chainTxExplorer.ts, src/components/DefuseSDK/utils/validateAddress.ts
Added dash case to transaction explorer (Blockchair URL) and address validator (uses Chains.Dash).
Tokens & Schema
src/tokens/production.json, src/tokens/schema/tokenlist.schema.json
Inserted Dash asset entry (unifiedAssetId: "dash") with grouped token metadata and added "dash" to SupportedChainName enum in tokenlist schema.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • jobotics
  • cawabunga-bytes

Poem

🐰 I nibbled code in twilight's hush,
A dashed-in chain—swift, soft, and plush.
Icons, maps, and tokens in a row,
Hop! Dash is ready — off we go! 🚀

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive No pull request description was provided by the author, making it impossible to assess content relevance. Add a description explaining the Dash integration changes, including what was added and why.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Dp502/dash integration' clearly describes the main change: adding Dash blockchain integration to the frontend.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dp502/dash-integration

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.

❤️ Share

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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/components/DefuseSDK/constants/settings.ts (1)

73-73: Empty RPC URL follows the pattern for passive-deposit-only chains.

The empty string is consistent with cardano (line 63). Per the context snippets, Dash is handled in depositEstimationActor.ts as a chain where "active deposits are not supported, so no network fees" (returns 0n), and getAvailableDepositRoutes returns passiveDeposit: true, activeDeposit: false for Dash.

Consider adding a comment to clarify that this is intentionally empty because Dash only supports passive deposits.

💡 Suggested clarification comment
     aleo: "https://api.explorer.provable.com",
+    // Dash: passive deposits only, no RPC needed
     dash: "",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/DefuseSDK/constants/settings.ts` at line 73, Add a clarifying
comment next to the dash: "" entry in the settings constants to state this empty
RPC URL is intentional because Dash is a passive-deposit-only chain; reference
the relevant handlers (depositEstimationActor.ts which returns 0n for Dash
network fees and getAvailableDepositRoutes which sets passiveDeposit: true,
activeDeposit: false) so future readers understand why the RPC is blank.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/components/DefuseSDK/services/depositService.ts`:
- Around line 1441-1442: The switch case returning settings.rpcUrls.dash must
guard against an empty or missing RPC URL: in the BlockchainEnum.DASH branch of
getWalletRpcUrl (or wherever the switch lives in depositService.ts) check that
settings.rpcUrls.dash is a non-empty string and if not throw a descriptive error
(e.g., "Missing RPC URL for dash") so callers like
waitForTransactionReceipt("dash", ...) fail fast rather than using an invalid
endpoint.

In `@src/tokens/production.json`:
- Around line 2884-2910: The JSON entry for the Dash token (unifiedAssetId
"dash", symbol "DASH") is mis-indented/formatting is inconsistent and causing
the CI to fail; fix the object formatting so its opening brace aligns with other
token objects (remove the extra leading spaces before the "{" that begins the
Dash object) and ensure all inner properties (groupedTokens, deployments, tags)
follow the same indentation and comma placement as surrounding entries,
preserving the existing keys "unifiedAssetId", "symbol", "name",
"groupedTokens", and "tags".

---

Nitpick comments:
In `@src/components/DefuseSDK/constants/settings.ts`:
- Line 73: Add a clarifying comment next to the dash: "" entry in the settings
constants to state this empty RPC URL is intentional because Dash is a
passive-deposit-only chain; reference the relevant handlers
(depositEstimationActor.ts which returns 0n for Dash network fees and
getAvailableDepositRoutes which sets passiveDeposit: true, activeDeposit: false)
so future readers understand why the RPC is blank.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 59f5dd51-0230-41cd-943d-8dbfa3e5f7c3

📥 Commits

Reviewing files that changed from the base of the PR and between 492e701 and fc993a6.

⛔ Files ignored due to path filters (2)
  • bun.lock is excluded by !**/*.lock
  • public/static/icons/network/dash.svg is excluded by !**/*.svg
📒 Files selected for processing (14)
  • package.json
  • src/components/DefuseSDK/constants/blockchains.tsx
  • src/components/DefuseSDK/constants/evm.ts
  • src/components/DefuseSDK/constants/settings.ts
  • src/components/DefuseSDK/features/machines/depositEstimationActor.ts
  • src/components/DefuseSDK/features/machines/depositTokenBalanceMachine.ts
  • src/components/DefuseSDK/services/depositService.ts
  • src/components/DefuseSDK/types/base.ts
  • src/components/DefuseSDK/utils/adapters.ts
  • src/components/DefuseSDK/utils/caip2.ts
  • src/components/DefuseSDK/utils/chainTxExplorer.ts
  • src/components/DefuseSDK/utils/validateAddress.ts
  • src/tokens/production.json
  • src/tokens/schema/tokenlist.schema.json

Comment on lines +1441 to +1442
case BlockchainEnum.DASH:
return settings.rpcUrls.dash
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "1) Confirm Dash RPC value in settings"
rg -n --type=ts 'dash:\s*""' src/components/DefuseSDK/constants/settings.ts -C1 || true

echo "2) Inspect getWalletRpcUrl callsites"
rg -nP --type=ts '\bgetWalletRpcUrl\s*\(' src/components/DefuseSDK -C2

echo "3) Inspect direct dynamic RPC access by chain name"
rg -nP --type=ts 'settings\.rpcUrls\[\s*chainName\s*\]' src/components/DefuseSDK -C2

Repository: defuse-protocol/defuse-frontend

Length of output: 9103


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "1) Get full getWalletRpcUrl function"
sed -n '1361,1430p' src/components/DefuseSDK/services/depositService.ts

echo ""
echo "2) Search for BlockchainEnum.DASH usage"
rg -n --type=ts 'BlockchainEnum\.DASH' src/components/DefuseSDK

echo ""
echo "3) Check if DASH is in any enum mappings or supported chains"
rg -n --type=ts 'DASH' src/components/DefuseSDK/constants -C1

Repository: defuse-protocol/defuse-frontend

Length of output: 4482


🏁 Script executed:

#!/bin/bash
sed -n '1435,1455p' src/components/DefuseSDK/services/depositService.ts | cat -n

Repository: defuse-protocol/defuse-frontend

Length of output: 744


🏁 Script executed:

#!/bin/bash
echo "1) Check line 147 in depositEstimationActor.ts context"
sed -n '140,155p' src/components/DefuseSDK/features/machines/depositEstimationActor.ts | cat -n

echo ""
echo "2) Check line 264 in depositTokenBalanceMachine.ts context"
sed -n '260,275p' src/components/DefuseSDK/features/machines/depositTokenBalanceMachine.ts | cat -n

echo ""
echo "3) Check if Dash blockchain is actually selectable in UI or workflows"
rg -n --type=ts --type=tsx 'BlockchainEnum\.DASH' src/components/DefuseSDK/features/machines -C3

Repository: defuse-protocol/defuse-frontend

Length of output: 1364


🏁 Script executed:

#!/bin/bash
echo "1) Search all callers of getWalletRpcUrl to see if any pass BlockchainEnum.DASH"
rg -B5 'getWalletRpcUrl' src/components/DefuseSDK --type=ts | grep -A5 -B5 'DASH' || echo "No DASH found in getWalletRpcUrl callers"

echo ""
echo "2) Check the direct RPC access at line 892"
sed -n '885,900p' src/components/DefuseSDK/services/depositService.ts | cat -n

echo ""
echo "3) Verify settings structure for rpcUrls"
sed -n '70,80p' src/components/DefuseSDK/constants/settings.ts | cat -n

Repository: defuse-protocol/defuse-frontend

Length of output: 994


🏁 Script executed:

#!/bin/bash
echo "1) Find SupportedChainName type definition"
rg -n 'type\s+SupportedChainName' src/components/DefuseSDK --type=ts -A10

echo ""
echo "2) Check if DASH is in any supported chains list or UI"
rg -n 'SupportedChainName' src/components/DefuseSDK/constants -A5 -B5

Repository: defuse-protocol/defuse-frontend

Length of output: 4114


🏁 Script executed:

#!/bin/bash
echo "1) Get full SupportedChainName type"
cat src/components/DefuseSDK/types/base.ts

echo ""
echo "2) Verify DASH is not in SupportedChainName"
rg 'dash' src/components/DefuseSDK/types/base.ts

Repository: defuse-protocol/defuse-frontend

Length of output: 5709


Add guard clause for unconfigured Dash RPC URL.

Line 1442 returns settings.rpcUrls.dash, which is currently an empty string. Since "dash" is included in the SupportedChainName type, callers could invoke functions like waitForTransactionReceipt(chainName: "dash", ...) or getWalletRpcUrl(BlockchainEnum.DASH), resulting in invalid RPC endpoints at runtime.

Suggested fix (fail fast on missing config)
    case BlockchainEnum.DASH:
-      return settings.rpcUrls.dash
+      if (!settings.rpcUrls.dash) {
+        throw new Error("RPC URL for DASH is not configured")
+      }
+      return settings.rpcUrls.dash
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
case BlockchainEnum.DASH:
return settings.rpcUrls.dash
case BlockchainEnum.DASH:
if (!settings.rpcUrls.dash) {
throw new Error("RPC URL for DASH is not configured")
}
return settings.rpcUrls.dash
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/DefuseSDK/services/depositService.ts` around lines 1441 -
1442, The switch case returning settings.rpcUrls.dash must guard against an
empty or missing RPC URL: in the BlockchainEnum.DASH branch of getWalletRpcUrl
(or wherever the switch lives in depositService.ts) check that
settings.rpcUrls.dash is a non-empty string and if not throw a descriptive error
(e.g., "Missing RPC URL for dash") so callers like
waitForTransactionReceipt("dash", ...) fail fast rather than using an invalid
endpoint.

@depressedPlumber502 depressedPlumber502 merged commit c531f81 into main Mar 4, 2026
8 checks passed
@depressedPlumber502 depressedPlumber502 deleted the dp502/dash-integration branch March 4, 2026 13:01
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.

2 participants