Skip to content

Commit

Permalink
refactor: update README.md based on the new implementation (#26)
Browse files Browse the repository at this point in the history
* refactor: updated resolver package

Signed-off-by: tipusinghaw <[email protected]>

* fix: updated fee calculation logic

Signed-off-by: tipusinghaw <[email protected]>

* refactor: updated README.md based on updated implementation

Signed-off-by: tipusinghaw <[email protected]>

* fix: formatter issue

Signed-off-by: tipusinghaw <[email protected]>

---------

Signed-off-by: tipusinghaw <[email protected]>
Co-authored-by: Sai Ranjit Tummalapalli <[email protected]>
  • Loading branch information
tipusinghaw and sairanjit authored Mar 14, 2024
1 parent 449265d commit 00fe93a
Showing 1 changed file with 40 additions and 5 deletions.
45 changes: 40 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ import { createDID } from 'polygon-did-registrar'
const txHash = await createDID(network)
```

The function returns, address, publicKey (base58 format), privateKey and DID uri.
The function returns, address, publicKey (base58 format), privateKey, and DID uri.

## Register

Expand All @@ -103,11 +103,46 @@ import { updateDidDoc } from "polygon-did-registrar";
const txHash = await updateDidDoc(did, didDoc, privateKey, url?, contractAddress?);
```
## Delete
## Add Resource
To remove the instance of DID from the ledger the above function is used as follows :
Add DID-linked resource for the DID-Doc.
```js
import { deleteDidDoc } from "polygon-did-registrar";
const txHash = await deleteDidDoc(did, privateKey, url?, contractAddress?);
import { addResource } from 'polygon-did-registrar'
const txHash = await addResource(did, resourcePayload)
```
The function returns a txhash, DID, and resourceId on successful execution.
## Update Resource
Update DID-linked resource for the DID-Doc.
```js
import { updateResource } from 'polygon-did-registrar'
const txHash = await updateResource(did, resourceId, resourcePayload)
```
The function returns a txhash, DID, and resourceId on successful execution.
## Fetch Resource
Get a DID-linked resource for a specific DID.
```js
import { getResourceByDidAndResourceId } from 'polygon-did-registrar'
const txHash = await getResourceByDidAndResourceId(did, resourceId)
```
The function returns DID-linked resource and DID uri on successful execution.
## Fetch all Resources
Get all DID-linked resources for a specific DID.
```js
import { getResourcesByDid } from 'polygon-did-registrar'
const txHash = await getResourcesByDid(did)
```
The function returns the list of DID-linked resources and DID on successful execution.

0 comments on commit 00fe93a

Please sign in to comment.