From 64b0920400c66ef178f0e351c81fa25bd1d18bae Mon Sep 17 00:00:00 2001 From: DaevMithran Date: Fri, 23 Aug 2024 12:25:49 +0530 Subject: [PATCH] docs(cheqd): Add Cheqd create resource tutorial Signed-off-by: DaevMithran --- guides/tutorials/cheqd/index.md | 18 ++++++++++++++++++ snippets/current/src/set-up-cheqd.ts | 13 +++++++++++++ 2 files changed, 31 insertions(+) diff --git a/guides/tutorials/cheqd/index.md b/guides/tutorials/cheqd/index.md index 2014f223..6185d1c1 100644 --- a/guides/tutorials/cheqd/index.md +++ b/guides/tutorials/cheqd/index.md @@ -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 --- diff --git a/snippets/current/src/set-up-cheqd.ts b/snippets/current/src/set-up-cheqd.ts index 92fb81c7..f9b00d78 100644 --- a/snippets/current/src/set-up-cheqd.ts +++ b/snippets/current/src/set-up-cheqd.ts @@ -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', { + name: 'resourceName', + resourceType: 'resourceType', + id: '6de33634-6439-4e46-aa3f-bfe03606b000', + version: '1.0', + data: { + name: 'name', + age: 18, + }, +}) +// end-section-6