Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Updates to Preview Branch (dp502/dash-integration) ↗︎
Tasks are run on every commit but only new migration files are pushed.
View logs for this Workflow Run ↗︎. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughAdds 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
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: 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 indepositEstimationActor.tsas a chain where "active deposits are not supported, so no network fees" (returns0n), andgetAvailableDepositRoutesreturnspassiveDeposit: true, activeDeposit: falsefor 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
⛔ Files ignored due to path filters (2)
bun.lockis excluded by!**/*.lockpublic/static/icons/network/dash.svgis excluded by!**/*.svg
📒 Files selected for processing (14)
package.jsonsrc/components/DefuseSDK/constants/blockchains.tsxsrc/components/DefuseSDK/constants/evm.tssrc/components/DefuseSDK/constants/settings.tssrc/components/DefuseSDK/features/machines/depositEstimationActor.tssrc/components/DefuseSDK/features/machines/depositTokenBalanceMachine.tssrc/components/DefuseSDK/services/depositService.tssrc/components/DefuseSDK/types/base.tssrc/components/DefuseSDK/utils/adapters.tssrc/components/DefuseSDK/utils/caip2.tssrc/components/DefuseSDK/utils/chainTxExplorer.tssrc/components/DefuseSDK/utils/validateAddress.tssrc/tokens/production.jsonsrc/tokens/schema/tokenlist.schema.json
| case BlockchainEnum.DASH: | ||
| return settings.rpcUrls.dash |
There was a problem hiding this comment.
🧩 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 -C2Repository: 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 -C1Repository: defuse-protocol/defuse-frontend
Length of output: 4482
🏁 Script executed:
#!/bin/bash
sed -n '1435,1455p' src/components/DefuseSDK/services/depositService.ts | cat -nRepository: 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 -C3Repository: 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 -nRepository: 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 -B5Repository: 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.tsRepository: 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.
| 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.
No description provided.