Skip to content

feat: add view-wallet script and wallet import documentation#67

Merged
thephez merged 5 commits intomainfrom
feat/small-additions
Apr 13, 2026
Merged

feat: add view-wallet script and wallet import documentation#67
thephez merged 5 commits intomainfrom
feat/small-additions

Conversation

@thephez
Copy link
Copy Markdown
Collaborator

@thephez thephez commented Apr 13, 2026

Adds a view-wallet.mjs utility script for inspecting an existing wallet loaded from PLATFORM_MNEMONIC, complementing the existing create-wallet.mjs. Also adds documentation for importing externally-created identities/mnemonics and the derivation paths the tutorials assume.

  • Add view-wallet.mjs — prints network, mnemonic, first platform address with faucet URL, and resolved identity ID
  • Add ## Importing an existing wallet section to README with derivation path compatibility table (BIP44 / DIP-13, testnet and mainnet)
  • Add CLAUDE.md with project overview, commands, architecture notes, derivation paths, environment variables, and directory layout
  • Update README usage step and CLAUDE.md directory layout to reference view-wallet.mjs

Summary by CodeRabbit

  • New Features

    • Added new wallet inspection utility to view derived platform address and identity information for existing wallets
  • Documentation

    • Updated setup instructions with wallet import workflow, including verification steps and network-specific derivation path compatibility requirements

thephez and others added 3 commits April 13, 2026 12:53
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ence

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 13, 2026

Warning

Rate limit exceeded

@thephez has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 43 minutes and 42 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4631a32d-d582-4de7-8c3a-527fa3b8de0a

📥 Commits

Reviewing files that changed from the base of the PR and between d7b530d and ce81e15.

📒 Files selected for processing (2)
  • README.md
  • view-wallet.mjs
📝 Walkthrough

Walkthrough

Three new additions to support wallet management and project documentation: a CLAUDE.md guide describing the tutorial architecture and setup conventions; a README update with instructions for importing existing wallets; and a view-wallet.mjs script for displaying wallet details derived from environment configuration.

Changes

Cohort / File(s) Summary
Documentation
CLAUDE.md, README.md
Added comprehensive repository guidance for Claude Code covering tutorial scope, npm commands, architecture patterns, and test framework; updated README with wallet import workflow and compatibility constraints.
Wallet Viewer Script
view-wallet.mjs
New executable module that loads mnemonic from config, creates SDK client, derives address and identity details via key managers, and logs wallet information including fund address URL.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A rabbit glimpses wallets, keys in hand,
Through scripts and docs, the paths are grand,
With mnemonics whispered, identities shown,
Setup made simple, in gardens well-known! 🌱

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: adding a new view-wallet script and wallet import documentation to the repository.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/small-additions

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
Copy Markdown

@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: 3

🧹 Nitpick comments (1)
CLAUDE.md (1)

40-50: Wrap setupDashClient() in the example try block.

Right now the sample leaves initialization outside the handler, so a bad mnemonic/network config would bypass the documented console.error path. Since this file is generation guidance, that mismatch will propagate.

♻️ 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);
 }
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().
🤖 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

📥 Commits

Reviewing files that changed from the base of the PR and between 037c02a and d7b530d.

📒 Files selected for processing (3)
  • CLAUDE.md
  • README.md
  • view-wallet.mjs

Comment thread README.md Outdated
Comment thread view-wallet.mjs
Comment thread view-wallet.mjs
thephez and others added 2 commits April 13, 2026 13:20
@thephez thephez merged commit 5e65f19 into main Apr 13, 2026
3 checks passed
@thephez thephez deleted the feat/small-additions branch April 13, 2026 17:26
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.

1 participant