Skip to content

Commit

Permalink
docs(cheqd): Add Cheqd create resource tutorial
Browse files Browse the repository at this point in the history
Signed-off-by: DaevMithran <daevmithran1999@gmail.com>
  • Loading branch information
DaevMithran committed Aug 23, 2024
1 parent 71899a3 commit 64b0920
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
18 changes: 18 additions & 0 deletions guides/tutorials/cheqd/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,24 @@ A DID can be deactivated, it can still be resolved

```

### Create Resource

A Resource is linked to a DID

#### Parameters

1. `did`\*
2. `name`\*
3. `resourceType`\*
4. `id`\*
5. `data`\*
6. `alsoKnownAs`
7. `version`

```typescript showLineNumbers set-up-cheqd.ts section-6

```

### Types

---
Expand Down
13 changes: 13 additions & 0 deletions snippets/current/src/set-up-cheqd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,16 @@ await agent.dids.deactivate({
},
})
// end-section-5

// start-section-6
await agent.modules.cheqd.createResource('did:cheqd:testnet:92874297-d824-40ea-8ae5-364a1ec9237d', {

Check failure on line 165 in snippets/current/src/set-up-cheqd.ts

View workflow job for this annotation

GitHub Actions / Check format, types and build

Property 'cheqd' does not exist on type 'AgentApi<WithoutDefaultModules<{ dids: DidsModule; anoncreds: AnonCredsModule; cheqd: CheqdModule; askar: AskarModule; }>>'.
name: 'resourceName',
resourceType: 'resourceType',
id: '6de33634-6439-4e46-aa3f-bfe03606b000',
version: '1.0',
data: {
name: 'name',
age: 18,
},
})
// end-section-6

0 comments on commit 64b0920

Please sign in to comment.