Summary
The code provided in the React Integration tutorial does not compile when followed as written. Multiple issues span the scaffold command, TypeScript types, and API surface mismatches with @dashevo/evo-sdk@3.0.1.
Steps to Reproduce
Followed the tutorial exactly:
npx create-vite@latest my-dash-app -- --template react-ts
cd my-dash-app && npm install
npm install @dashevo/evo-sdk
- Created all files as shown in the tutorial
npm run build
Issues Found
1. Scaffold command does not apply the React template
The tutorial says:
npx create-vite@latest my-dash-app -- --template react-ts
The extra -- before --template causes create-vite (v9.x) to ignore the template flag entirely. The resulting project has no React dependencies — no react, react-dom, @types/react, @vitejs/plugin-react, no JSX config.
Fix: Remove the extra --:
npx create-vite@latest my-dash-app --template react-ts
2. DocumentsQuery uses wrong property names
Tutorial uses:
{ contractId: ..., documentType: "listing", ... }
Actual SDK interface (DocumentsQuery):
{ dataContractId: ..., documentTypeName: "listing", ... }
Affected files: ListingsList.tsx, useDocuments.ts
3. Identity method names are wrong
Tutorial uses:
identity.getId().toString()
identity.getBalance().toString()
Actual SDK Identity class:
getId() → should be identity.id (getter property, returns Identifier)
getBalance() → should be identity.balance (property, bigint)
Affected file: IdentityViewer.tsx
4. Document.getData() does not exist
Tutorial uses:
The Document class has no getData() method. Document data is accessed via the properties field:
const d = doc.properties;
Affected file: ListingsList.tsx
5. documents.create() API signature is completely different
Tutorial uses:
sdk.documents.create({
contractId, documentType, document: { ... },
identityId, privateKeyWif, signingKeyIndex, nonce
})
Actual DocumentsFacade.create() expects:
{ document: Document, identityKey: IdentityPublicKey, signer: IdentitySigner, settings?: PutSettings }
The tutorial shows a simplified "pass fields and a WIF key" interface that does not exist. The real API requires constructing a Document object, an IdentityPublicKey, and an IdentitySigner.
Affected file: CreateListing.tsx
6. useTokenBalance passes string where Identifier is required
Tutorial uses:
sdk.tokens.identityBalances(identityId, [tokenId])
The identityBalances method expects IdentifierLike parameters, but the Map key is Identifier, not string. The .get(tokenId) call with a plain string won't match an Identifier key.
Affected file: useTokenBalance.ts
7. identities.contractNonce is async but called synchronously
Tutorial uses:
nonce: sdk.identities.contractNonce(IDENTITY_ID, CONTRACT_ID)
contractNonce() returns Promise<bigint | null>, not bigint. It needs to be awaited.
Affected file: CreateListing.tsx
Build Output (with scaffold fix applied)
src/components/CreateListing.tsx(21,13): error TS2353: Object literal may only specify known properties, and 'make' does not exist in type 'Document'.
src/components/IdentityViewer.tsx(25,45): error TS2339: Property 'getId' does not exist on type 'Identity'.
src/components/IdentityViewer.tsx(26,50): error TS2551: Property 'getBalance' does not exist on type 'Identity'. Did you mean 'balance'?
src/components/ListingsList.tsx(7,5): error TS2353: Object literal may only specify known properties, and 'contractId' does not exist in type 'DocumentsQuery'.
src/components/ListingsList.tsx(25,25): error TS2339: Property 'getData' does not exist on type 'Document'.
src/components/ListingsList.tsx(27,17): error TS2322: Type 'Identifier' is not assignable to type 'Key | null | undefined'.
src/hooks/useTokenBalance.ts(7,27): error TS2345: Argument of type 'string' is not assignable to parameter of type 'Identifier'.
Environment
- Node.js: v25.8.1
- create-vite: 9.0.3
- @dashevo/evo-sdk: 3.0.1
- @dashevo/wasm-sdk: 3.0.1
- TypeScript: 5.9.3
- macOS arm64
Summary
The code provided in the React Integration tutorial does not compile when followed as written. Multiple issues span the scaffold command, TypeScript types, and API surface mismatches with
@dashevo/evo-sdk@3.0.1.Steps to Reproduce
Followed the tutorial exactly:
npx create-vite@latest my-dash-app -- --template react-tscd my-dash-app && npm installnpm install @dashevo/evo-sdknpm run buildIssues Found
1. Scaffold command does not apply the React template
The tutorial says:
The extra
--before--templatecauses create-vite (v9.x) to ignore the template flag entirely. The resulting project has no React dependencies — noreact,react-dom,@types/react,@vitejs/plugin-react, no JSX config.Fix: Remove the extra
--:2.
DocumentsQueryuses wrong property namesTutorial uses:
Actual SDK interface (
DocumentsQuery):Affected files:
ListingsList.tsx,useDocuments.ts3.
Identitymethod names are wrongTutorial uses:
Actual SDK
Identityclass:getId()→ should beidentity.id(getter property, returnsIdentifier)getBalance()→ should beidentity.balance(property,bigint)Affected file:
IdentityViewer.tsx4.
Document.getData()does not existTutorial uses:
The
Documentclass has nogetData()method. Document data is accessed via thepropertiesfield:Affected file:
ListingsList.tsx5.
documents.create()API signature is completely differentTutorial uses:
Actual
DocumentsFacade.create()expects:The tutorial shows a simplified "pass fields and a WIF key" interface that does not exist. The real API requires constructing a
Documentobject, anIdentityPublicKey, and anIdentitySigner.Affected file:
CreateListing.tsx6.
useTokenBalancepassesstringwhereIdentifieris requiredTutorial uses:
The
identityBalancesmethod expectsIdentifierLikeparameters, but the Map key isIdentifier, notstring. The.get(tokenId)call with a plainstringwon't match anIdentifierkey.Affected file:
useTokenBalance.ts7.
identities.contractNonceis async but called synchronouslyTutorial uses:
contractNonce()returnsPromise<bigint | null>, notbigint. It needs to be awaited.Affected file:
CreateListing.tsxBuild Output (with scaffold fix applied)
Environment