-
Notifications
You must be signed in to change notification settings - Fork 204
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
4e7a380
commit b38525f
Showing
30 changed files
with
2,659 additions
and
14 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,13 @@ | ||
import type { Config } from '@jest/types' | ||
|
||
import base from '../../jest.config.base' | ||
|
||
import packageJson from './package.json' | ||
|
||
const config: Config.InitialOptions = { | ||
...base, | ||
displayName: packageJson.name, | ||
setupFilesAfterEnv: ['./tests/setup.ts'], | ||
} | ||
|
||
export default config |
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,45 @@ | ||
{ | ||
"name": "@aries-framework/cheqd", | ||
"main": "build/index", | ||
"types": "build/index", | ||
"version": "0.3.3", | ||
"files": [ | ||
"build" | ||
], | ||
"license": "Apache-2.0", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"homepage": "https://github.com/hyperledger/aries-framework-javascript/tree/main/packages/cheqd", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/hyperledger/aries-framework-javascript", | ||
"directory": "packages/cheqd" | ||
}, | ||
"scripts": { | ||
"build": "yarn run clean && yarn run compile", | ||
"clean": "rimraf ./build", | ||
"compile": "tsc -p tsconfig.build.json", | ||
"prepublishOnly": "yarn run build", | ||
"test": "jest" | ||
}, | ||
"dependencies": { | ||
"@aries-framework/anoncreds": "0.3.3", | ||
"@aries-framework/core": "0.3.3", | ||
"@cheqd/sdk": "cjs", | ||
"@cheqd/ts-proto": "cjs", | ||
"class-transformer": "^0.5.1", | ||
"class-validator": "^0.14.0", | ||
"rxjs": "^7.2.0", | ||
"tsyringe": "^4.7.0", | ||
"@cosmjs/proto-signing": "^0.29.5", | ||
"@cosmjs/crypto": "^0.29.5", | ||
"@stablelib/ed25519": "^1.0.3" | ||
}, | ||
"devDependencies": { | ||
"rimraf": "^4.0.7", | ||
"typescript": "~4.9.4", | ||
"@aries-framework/indy-sdk": "*", | ||
"@types/indy-sdk": "*" | ||
} | ||
} |
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,26 @@ | ||
import type { CheqdModuleConfigOptions } from './CheqdModuleConfig' | ||
import type { AgentContext, DependencyManager, Module } from '@aries-framework/core' | ||
|
||
import { CheqdModuleConfig } from './CheqdModuleConfig' | ||
import { CheqdLedgerService } from './ledger' | ||
|
||
export class CheqdModule implements Module { | ||
public readonly config: CheqdModuleConfig | ||
|
||
public constructor(config: CheqdModuleConfigOptions) { | ||
this.config = new CheqdModuleConfig(config) | ||
} | ||
|
||
public register(dependencyManager: DependencyManager) { | ||
// Register config | ||
dependencyManager.registerInstance(CheqdModuleConfig, this.config) | ||
|
||
dependencyManager.registerSingleton(CheqdLedgerService) | ||
} | ||
|
||
public async initialize(agentContext: AgentContext): Promise<void> { | ||
// not required | ||
const cheqdLedgerService = agentContext.dependencyManager.resolve(CheqdLedgerService) | ||
await cheqdLedgerService.connect() | ||
} | ||
} |
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,25 @@ | ||
/** | ||
* CheqdModuleConfigOptions defines the interface for the options of the CheqdModuleConfig class. | ||
*/ | ||
export interface CheqdModuleConfigOptions { | ||
networks: NetworkConfig[] | ||
} | ||
|
||
export interface NetworkConfig { | ||
rpcUrl?: string | ||
cosmosPayerSeed: string | ||
network: string | ||
} | ||
|
||
export class CheqdModuleConfig { | ||
private options: CheqdModuleConfigOptions | ||
|
||
public constructor(options: CheqdModuleConfigOptions) { | ||
this.options = options | ||
} | ||
|
||
/** See {@link CheqdModuleConfigOptions.networks} */ | ||
public get networks() { | ||
return this.options.networks | ||
} | ||
} |
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 @@ | ||
export { CheqdAnonCredsRegistry } from './services/CheqdAnonCredsRegistry' |
Oops, something went wrong.