Feat/js sdk#9
Conversation
- Run `dart format .` over lib/, test/, and example/ (publish-ready style). - Trim the pubspec description to 164 chars (within pub.dev's 60–180 range). No behavior change; `dart analyze` clean and all 28 tests pass.
Bump the Dart SDK to a stable 0.1.0 for its first pub.dev publish (was 0.2.1-beta). Update the README install snippet and CHANGELOG heading to match.
📝 WalkthroughWalkthroughUpdates the Dart SDK's pinned SafHandle mainnet contract address and network preset (RPC/REST endpoints, gas price), bumps package version to 0.1.1-beta with updated description and changelog, updates README install snippet, and reformats multiple line-wrapping style changes across library, test, and example files without altering logic. ChangesDart SDK mainnet pinning and reformatting
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ 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: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/dart/README.md`:
- Line 26: The README install snippet is out of sync with the published Dart
release line, so update the dependency version shown under the install example
to match the current package version used in pubspec.yaml. Adjust the dependency
entry in the README so users are directed to the same release line as the
published package, keeping the docs aligned with the package’s actual version.
🪄 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 Plus
Run ID: 1ccef3c1-d0f2-41fa-8aed-93eb9c18707f
📒 Files selected for processing (12)
packages/dart/CHANGELOG.mdpackages/dart/README.mdpackages/dart/example/resolve.dartpackages/dart/lib/src/client.dartpackages/dart/lib/src/constants.dartpackages/dart/lib/src/signing_client.dartpackages/dart/lib/src/types.dartpackages/dart/lib/src/validation.dartpackages/dart/pubspec.yamlpackages/dart/test/client_test.dartpackages/dart/test/signing_client_test.dartpackages/dart/test/validation_test.dart
| # pubspec.yaml | ||
| dependencies: | ||
| safhandle: ^0.2.1-beta | ||
| safhandle: ^0.1.0 |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Sync the install snippet with the release version.
pubspec.yaml now publishes 0.1.1-beta, but the README still tells users to install ^0.1.0. That leaves the published docs pointing at the wrong release line.
Suggested fix
- safhandle: ^0.1.0
+ safhandle: ^0.1.1-beta📝 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.
| safhandle: ^0.1.0 | |
| safhandle: ^0.1.1-beta |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/dart/README.md` at line 26, The README install snippet is out of
sync with the published Dart release line, so update the dependency version
shown under the install example to match the current package version used in
pubspec.yaml. Adjust the dependency entry in the README so users are directed to
the same release line as the published package, keeping the docs aligned with
the package’s actual version.
Summary
packages/js→@safrochaindev/safhandle): read client (SafHandleClient) and signing client (SafHandleSigningClient) forregisterName/transferName/releaseName, client-side validation that mirrors the contract, pinned network presets, dual ESM + CommonJS build with type declarations, examples and unit tests.packages/dart→safhandle): a feature-parity port with the same public surface (SafHandleClient,SafHandleSigningClient+ pluggableSafHandleSigner), validation mirroring the contract'svalidation.rs, dependency-free bech32 checksum verification, examples and unit tests.safrochain-1in both SDKs (replacing theaddr_saf_MAIN_NETplaceholder); point the Dart mainnet preset atrpc/api.safrochain.networkwith gas price0.15usaf. Cut0.1.1-betato npm and pub.dev.Why
.safnames and register handles through a published SDK instead of hand-rolling CosmWasm query/execute payloads — with the same validation as the on-chain contract, so bad input is rejected before it costs gas.Type of change
Test plan
npm run verifypasses locallysafro-testnet-1(if on-chain behavior changed)Steps:
cd packages/js && npm ci && npm test && npm run build(Vitest green, ESM+CJS+types emitted).cd packages/dart && dart pub get && dart analyze && dart test(analyzer clean, all tests pass).safro-testnet-1contract (JS:SAFHANDLE_INTEGRATION=1 npm run test:integration; Dart:example/resolve.dart+example/register.dart).Security checklist
No API keys, secrets, or private keys in code or commits
Phone numbers are not logged in production code paths
Contract address changes documented in config JSON
Documentation
README.mdordocs/updated (if user-facing)CHANGELOG.mdupdated under[Unreleased].env.exampleupdated (if new env vars) — N/A, no new env vars.Impact on safhandle-contract noted (if API changed) — N/A, the contract's query/execute API is unchanged; the SDKs consume it as-is.
Summary by CodeRabbit
New Features
0.1.1-betaand documented the initial SDK release history.Documentation
Tests