feat: add document transfer, set-price, and purchase tutorials - #114
Open
thephez wants to merge 2 commits into
Open
feat: add document transfer, set-price, and purchase tutorials#114thephez wants to merge 2 commits into
thephez wants to merge 2 commits into
Conversation
Add three marketplace tutorials covering the general document trading APIs, demonstrated against the DPNS `domain` document selected by `NAME_LABEL`. The same calls work with any document type whose contract enables `transferable` or `tradeMode`.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe PR adds DPNS document pricing, purchase, and transfer tutorials. It adds marketplace configuration, README guidance, and sequential tests for cross-identity document operations. ChangesDocument marketplace workflows
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Tutorial
participant DashClient
participant DPNS
participant DocumentAPI
Tutorial->>DashClient: initialize authenticated client
DashClient->>DPNS: query domain document
DPNS-->>DashClient: return document and ownership
Tutorial->>DocumentAPI: submit price, purchase, or transfer
DocumentAPI-->>Tutorial: return operation result
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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 @.env.example:
- Line 39: Update the DOCUMENT_RECIPIENT_ID entry in the environment example to
use an unquoted empty value, preserving it as empty while removing the
dotenv-linter warning.
In `@2-Contracts-and-Documents/document-set-price.mjs`:
- Around line 3-12: Wrap all startup operations in the tutorials’ existing
try-catch handlers so failures are logged through console.error: in
2-Contracts-and-Documents/document-set-price.mjs lines 3-12, move
setupDashClient(), keyManager.getAuth(), and DOCUMENT_PRICE parsing into the try
block; in 2-Contracts-and-Documents/document-purchase.mjs lines 3-4 and
2-Contracts-and-Documents/document-transfer.mjs lines 3-4, move client setup and
authentication into their try blocks. Preserve the ESM top-level-await pattern
and existing sdk/keyManager usage.
In `@test/read-write.test.mjs`:
- Around line 167-188: Update the runTutorial invocation for document-set-price
to pass a fixed positive DOCUMENT_PRICE in its env alongside NAME_LABEL. Keep
the existing success assertions and extracted-price flow unchanged so the
listing remains available for dependent purchase and transfer tests.
🪄 Autofix
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: f71a30f5-d204-4e53-80eb-f1ca8330ab73
📒 Files selected for processing (6)
.env.example2-Contracts-and-Documents/document-purchase.mjs2-Contracts-and-Documents/document-set-price.mjs2-Contracts-and-Documents/document-transfer.mjsREADME.mdtest/read-write.test.mjs
Pin the price in the subprocess env so the suite no longer depends on local `.env` contents. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add three marketplace tutorials covering the general document trading APIs, demonstrated against the DPNS
domaindocument selected byNAME_LABEL. The same calls work with any document type whose contract enablestransferableortradeMode.Summary by CodeRabbit
New Features
Documentation