Skip to content

fix: match tutorial code to actual evo-sdk@3.1.0-dev.1 API#2

Merged
thepastaclaw merged 1 commit into
developfrom
fix/match-actual-sdk-api
Apr 2, 2026
Merged

fix: match tutorial code to actual evo-sdk@3.1.0-dev.1 API#2
thepastaclaw merged 1 commit into
developfrom
fix/match-actual-sdk-api

Conversation

@thepastaclaw
Copy link
Copy Markdown
Owner

Fixes all compilation errors from the React Integration tutorial code to match the actual @dashevo/evo-sdk@3.1.0-dev.1 API.

Changes

Issue Tutorial code Fix
DocumentsQuery field names contractId, documentType dataContractId, documentTypeName
Identity accessors getId(), getBalance(), getPublicKeys() .id, .balance, .publicKeys (property getters)
Document data access doc.getData() doc.properties
documents.create() signature Simplified { contractId, document: {...}, privateKeyWif } Actual API: { document: Document, identityKey: IdentityPublicKey, signer: IdentitySigner }
Token balance Map lookup balances.get(tokenId) with string key Iterate entries, compare .toString()
Map key type in listings Used Identifier directly as React key .toString()

Result

npm run build succeeds — TypeScript compiles clean, Vite bundles without errors.

Resolves #1

- Fix scaffold: use 3.1.0-dev.1 (tutorial book is on v3.1-dev branch)
- DocumentsQuery: contractId → dataContractId, documentType → documentTypeName
- Identity: getId() → .id, getBalance() → .balance, getPublicKeys() → .publicKeys
- Document: getData() → .properties with proper type assertions
- CreateListing: rewrite to use actual DocumentCreateOptions API
  (Document + IdentityPublicKey + IdentitySigner, not simplified interface)
- useTokenBalance: iterate Map<Identifier, bigint> entries by string
  comparison instead of direct .get() with string key
- Map key in ListingsList: use .toString() for Identifier keys

Resolves #1
@thepastaclaw thepastaclaw merged commit 3a04e9a into develop Apr 2, 2026
@thepastaclaw thepastaclaw deleted the fix/match-actual-sdk-api branch April 2, 2026 13:50
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.

Tutorial code from React Integration docs does not compile

1 participant