-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: DaevMithran <[email protected]>
- Loading branch information
1 parent
0bcb623
commit 4485dc9
Showing
5 changed files
with
6,147 additions
and
8,651 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@credo-ts/cheqd": patch | ||
--- | ||
|
||
add cheqd api to allow creation of DID-Linked resources |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { AgentContext } from '@credo-ts/core' | ||
import { injectable } from 'tsyringe' | ||
|
||
import { CheqdCreateResourceOptions, CheqdDidRegistrar, CheqdDidResolver } from './dids' | ||
|
||
@injectable() | ||
export class CheqdApi { | ||
private agentContext: AgentContext | ||
|
||
public constructor(agentContext: AgentContext) { | ||
this.agentContext = agentContext | ||
} | ||
|
||
public async createResource(did: string, options: CheqdCreateResourceOptions) { | ||
const cheqdDidRegistrar = this.agentContext.dependencyManager.resolve(CheqdDidRegistrar) | ||
return await cheqdDidRegistrar.createResource(this.agentContext, did, options) | ||
} | ||
|
||
public async resolveResource(resourceUrl: string) { | ||
const cheqdDidResolver = this.agentContext.dependencyManager.resolve(CheqdDidResolver) | ||
return await cheqdDidResolver.resolveResource(this.agentContext, resourceUrl) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.