fix: match tutorial code to actual evo-sdk@3.1.0-dev.1 API#2
Merged
Conversation
- 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
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.
Fixes all compilation errors from the React Integration tutorial code to match the actual
@dashevo/evo-sdk@3.1.0-dev.1API.Changes
DocumentsQueryfield namescontractId,documentTypedataContractId,documentTypeNameIdentityaccessorsgetId(),getBalance(),getPublicKeys().id,.balance,.publicKeys(property getters)Documentdata accessdoc.getData()doc.propertiesdocuments.create()signature{ contractId, document: {...}, privateKeyWif }{ document: Document, identityKey: IdentityPublicKey, signer: IdentitySigner }balances.get(tokenId)with string key.toString()Identifierdirectly as React key.toString()Result
npm run buildsucceeds — TypeScript compiles clean, Vite bundles without errors.Resolves #1