feat: migrate send-funds tutorial to new evo-sdk#65
Conversation
Replace old CommonJS wallet-account pattern with ESM sdk.addresses.transfer() using platform addresses (bech32m). Add RECIPIENT_PLATFORM_ADDRESS to .env.example and test case. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe pull request replaces an older JavaScript send-funds script with a modern module-based version, adds configuration support for specifying transaction recipients via an environment variable, and introduces test coverage for the updated implementation. Changes
Poem
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
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
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.env.example:
- Around line 14-15: The RECIPIENT_PLATFORM_ADDRESS dotenv entry uses quoted
empty string which triggers dotenv-linter QuoteCharacter; edit the
RECIPIENT_PLATFORM_ADDRESS line (the variable name RECIPIENT_PLATFORM_ADDRESS)
to use an unquoted empty assignment (remove the single quotes) so it reads as an
empty value without quotes.
In `@send-funds.mjs`:
- Around line 4-6: Guard against addressKeyManager being undefined and ensure
failures exit with non-zero code: move the signer initialization
(addressKeyManager.getSigner()) into the try block after calling
setupDashClient(), check that addressKeyManager is not null/undefined before
calling getSigner (e.g., if (!addressKeyManager) { processLogger.error(...);
process.exit(1); }), and on any caught errors in the setup/send flow call
process.exit(1) instead of exiting with code 0; update all related blocks that
reference addressKeyManager, signer, or setupDashClient() to follow this
pattern.
- Around line 7-10: The code hardcodes a testnet recipient and assumes testnet
formatting; change recipient resolution and output formatting to respect
process.env.NETWORK: instead of defaulting to a testnet literal in the recipient
constant, derive the default or validate the provided RECIPIENT_PLATFORM_ADDRESS
against process.env.NETWORK (e.g., throw or normalize if prefix/network
mismatches), and update any address formatting/serialization logic that
currently assumes testnet to use the NETWORK value (process.env.NETWORK) so
addresses are formatted for mainnet when NETWORK='mainnet' (referencing the
recipient constant and the address formatting/serialization code where output is
produced).
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 38769d08-039d-4555-8874-4df36971de1a
📒 Files selected for processing (4)
.env.examplesend-funds.jssend-funds.mjstest/read-write.test.mjs
💤 Files with no reviewable changes (1)
- send-funds.js
Summary
send-funds.js→send-funds.mjsusing the new@dashevo/evo-sdkplatform address transfer API (sdk.addresses.transfer())AddressKeyManagersignerRECIPIENT_PLATFORM_ADDRESSenv var to.env.examplesend-fundstest case to read-write test suite🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Chores
RECIPIENT_PLATFORM_ADDRESSenvironment variable configuration for the send-funds tutorial.Tests