feat: add view-wallet script and wallet import documentation#67
feat: add view-wallet script and wallet import documentation#67
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ence Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 43 minutes and 42 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📝 WalkthroughWalkthroughThree new additions to support wallet management and project documentation: a Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 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: 3
🧹 Nitpick comments (1)
CLAUDE.md (1)
40-50: WrapsetupDashClient()in the exampletryblock.Right now the sample leaves initialization outside the handler, so a bad mnemonic/network config would bypass the documented
console.errorpath. Since this file is generation guidance, that mismatch will propagate.As per coding guidelines: All tutorial files should be standalone `.mjs` ESM files with top-level `await`, following the pattern: import setupDashClient, destructure sdk and keyManager, use try-catch for error handling, and log results via console.log(result.toJSON()) or console.error().♻️ Suggested change
import { setupDashClient } from '../setupDashClient.mjs'; -const { sdk, keyManager } = await setupDashClient(); - try { + const { sdk, keyManager } = await setupDashClient(); // Tutorial logic — use sdk and keyManager console.log(result.toJSON()); } catch (e) { console.error('Something went wrong:\n', e.message); }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@CLAUDE.md` around lines 40 - 50, Move the top-level await setupDashClient() call inside the existing try block so initialization errors are caught; specifically call setupDashClient() within the try, destructure { sdk, keyManager } there, run the tutorial logic (produce result and call result.toJSON()) and handle failures in the catch by console.error(e.message) as shown—ensure the file remains a standalone ESM .mjs with top-level await usage but that setupDashClient, sdk, and keyManager are initialized inside the try-catch.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@README.md`:
- Around line 47-48: The README currently lists the alternative
`view-wallet.mjs` before the environment setup that defines PLATFORM_MNEMONIC;
move the `view-wallet.mjs` mention so it appears after the `.env /
PLATFORM_MNEMONIC` step and the instructions to create or load the env, so that
`view-wallet.mjs` will find PLATFORM_MNEMONIC on a fresh checkout; update the
sequence around the existing `Create a wallet: node create-wallet.mjs` line to
place `view-wallet.mjs` immediately after the environment setup and ensure the
README text signals that `view-wallet.mjs` requires PLATFORM_MNEMONIC to be set.
In `@view-wallet.mjs`:
- Around line 20-26: The current bare catch swallows all errors from
IdentityKeyManager.create and masks real failures; update the try/catch around
IdentityKeyManager.create({ sdk, mnemonic, network }) so you only treat the
known "no identity" failure as the case that sets identityId = 'No identity
found for this mnemonic' (e.g., check error.name/error.code or instanceof the
specific NoIdentity/NotFound error exported by the identity library), and
rethrow or log/propagate any other errors (network/RPC/derivation) so they
aren't mistaken for "no identity"; keep references to identityId and
IdentityKeyManager.create when making this change.
- Around line 28-30: Remove the plaintext mnemonic log to avoid leaking secrets:
delete or replace the console.log that prints the variable mnemonic (the Console
call in view-wallet.mjs that emits 'Mnemonic') and either omit it entirely or
print a redacted version (e.g., show only first/last few words or a fixed mask)
so the seed phrase is never written to stdout; keep the Network log as-is if
needed.
---
Nitpick comments:
In `@CLAUDE.md`:
- Around line 40-50: Move the top-level await setupDashClient() call inside the
existing try block so initialization errors are caught; specifically call
setupDashClient() within the try, destructure { sdk, keyManager } there, run the
tutorial logic (produce result and call result.toJSON()) and handle failures in
the catch by console.error(e.message) as shown—ensure the file remains a
standalone ESM .mjs with top-level await usage but that setupDashClient, sdk,
and keyManager are initialized inside the try-catch.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: c339e160-8f41-4e2b-93cf-5fac48be5168
📒 Files selected for processing (3)
CLAUDE.mdREADME.mdview-wallet.mjs
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds a
view-wallet.mjsutility script for inspecting an existing wallet loaded fromPLATFORM_MNEMONIC, complementing the existingcreate-wallet.mjs. Also adds documentation for importing externally-created identities/mnemonics and the derivation paths the tutorials assume.view-wallet.mjs— prints network, mnemonic, first platform address with faucet URL, and resolved identity ID## Importing an existing walletsection to README with derivation path compatibility table (BIP44 / DIP-13, testnet and mainnet)CLAUDE.mdwith project overview, commands, architecture notes, derivation paths, environment variables, and directory layoutview-wallet.mjsSummary by CodeRabbit
New Features
Documentation