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 <[email protected]>
  • Loading branch information
DaevMithran committed Aug 23, 2024
1 parent 71899a3 commit d5701fe
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
23 changes: 23 additions & 0 deletions guides/tutorials/cheqd/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,29 @@ A DID can be deactivated, it can still be resolved

```

### Create Resource

Using the createResource cheqd api agents are able to create custom DID-Linked Resources, including:

- Trust Registries
- Status Lists
- Logos associated with DIDs
- Governance files

#### Parameters

1. `did`\*
2. `name`\*
3. `resourceType`\*
4. `id`\*
5. `data`\* : Text, Base64 string or an object
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 d5701fe

Please sign in to comment.