diff --git a/README.md b/README.md index da73631a..6388fc03 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@

+ # Identity and Access Management (IAM) Client Library TypeScript library to be used within decentralized applications for authentication and authorization using DIDs (Decentralized Identifiers) and VCs (Verifiable Credentials) @@ -44,103 +45,59 @@ Prerelease version npm i iam-client-lib@canary ``` -### Sample Config for browsers (TypeScript) - -```js -import { - IAM, - WalletProvider, - setCacheClientOptions, - setChainConfig, - setMessagingOptions, - MessagingMethod, -} from 'iam-client-lib' - -export class App { - private _iam: IAM; - - constructor() { - // IAM has builtin default settings for VOLTA CHAIN - - // If you want to change default cache server config or add config for your network - setCacheClientOptions(1111, { - url: 'https://some-cache-server.com/', - cacheServerSupportsAuth: true, - }) - - // If you want to change default chain config or add config for your network - setChainConfig(1111, { - didContractAddress: '0x3e2fb24edc3536d655720280b427c91bcb55f3d6', - ensRegistryAddress: '0xa372d665f83197a63bbe633ebe19c7bfd4943003', - ensResolverAddress: '0xe878bdcf5148307378043bfd2b584909aa48a227', - rpcUrl: 'http://some-rpc.com', - }) - - // If you want to change default messaging config or add config for your network - setMessagingOptions(1111, { - messagingMethod: MessagingMethod.Nats, - natsServerUrl: 'https://some-exchange-server.com', - }) - - // create IAM instance - this._iam = new IAM(); - } - - async initializeIAM() { - // this will show connection modal and authenticate - const { did, connected } = await this._iam.initializeConnection({ - walletProvider: WalletProvider.MetaMask, - }); - - // after successfully authentication you can retrieve the signer - const signer = this._iam.getSigner(); - } +### Initialization -``` +Because of dependencies between modules they should be initialized in right order. +This is achieved by accessing module initializer from initialization function of required module. -### Sample Config for Node.js (TypeScript) +1. Initializing signer service. It will initialize staking and messaging services and allow to connect to cache server ```js -import { IAM } from 'iam-client-lib' - -export class App { - private _iam: IAM; - - constructor() { - // IAM has builtin default settings for VOLTA CHAIN - - // If you want to change default cache server config or add config for your network - setCacheClientOptions(1111, { - url: 'https://some-cache-server.com/', - cacheServerSupportsAuth: true, - }) - - // If you want to change default chain config or add config for your network - setChainConfig(1111, { - didContractAddress: '0x3e2fb24edc3536d655720280b427c91bcb55f3d6', - ensRegistryAddress: '0xa372d665f83197a63bbe633ebe19c7bfd4943003', - ensResolverAddress: '0xe878bdcf5148307378043bfd2b584909aa48a227', - rpcUrl: 'http://some-rpc.com', - }) - - // create IAM instance - this._iam = new IAM({ - // only for Node.js env you need to pass rpcUrl in the constructor - rpcUrl: 'http://some-rpc.com', - privateKey: '9945c05be0b1b7b35b7cec937e78c6552ecedca764b53a772547d94a687db929' - }); - } - + const { + signerService, + stakingService, + messagingService, + connectToCacheServer, + isSessionActive, + storeSession + } = await initWithPrivateKeySigner(privateKey, rpcUrl) +``` +2. Connecting to cache server. Depending on signer type signature might be requested - async initializeIAM() { - // this will authenticate - const { did, connected } = await this._iam.initializeConnection(); +```js +// IAM has builtin default settings for VOLTA CHAIN, which can overriden +setChainConfig(1111, { + didContractAddress: '0x3e2fb24edc3536d655720280b427c91bcb55f3d6', + ensRegistryAddress: '0xa372d665f83197a63bbe633ebe19c7bfd4943003', + ensResolverAddress: '0xe878bdcf5148307378043bfd2b584909aa48a227', + rpcUrl: 'http://some-rpc.com', +}) + +setMessagingOptions(1111, { + messagingMethod: MessagingMethod.Nats, + natsServerUrl: 'https://some-exchange-server.com' +}) + +setCacheClientOptions(1111, { + url: 'https://some-cache-server.com/', + cacheServerSupportsAuth: true, +}) + +const { + cacheClient, + domainsService, + connectToDidRegistry +} = await connectToCacheServer() +``` - // after successfully authentication you can retrieve the signer - const signer = this._iam.getSigner(); - } +3. Connecting to DID registry. If the document does not exist yet, a transaction will have to be sent +```js +const { + didRegistry, + claimsService +} = await connectToDidRegistry() ``` ## Development @@ -173,9 +130,9 @@ npm run build ## Active Maintainers -- [Ahmed Ibrahim](https://github.com/ahmedolaibrahim) -- [John Henderson](https://github.com/jrhender) -- [Dmitry Fesenko](https://github.com/JGiter) +* [Ahmed Ibrahim](https://github.com/ahmedolaibrahim) +* [John Henderson](https://github.com/jrhender) +* [Dmitry Fesenko](https://github.com/JGiter) ## Contributing diff --git a/bili.config.ts b/bili.config.ts index d61a8769..2ab146c4 100644 --- a/bili.config.ts +++ b/bili.config.ts @@ -10,7 +10,7 @@ const config: Config = { }, // include tslib for clients using older version of tslib bundleNodeModules: ["tslib"], - input: "src/iam-client-lib.ts", + input: "src/index.ts", output: { format: ["cjs", "esm"], minify: false, diff --git a/docs/api/README.md b/docs/api/README.md index c800f837..6388fc03 100644 --- a/docs/api/README.md +++ b/docs/api/README.md @@ -1,6 +1,7 @@

+ # Identity and Access Management (IAM) Client Library TypeScript library to be used within decentralized applications for authentication and authorization using DIDs (Decentralized Identifiers) and VCs (Verifiable Credentials) @@ -44,101 +45,59 @@ Prerelease version npm i iam-client-lib@canary ``` -### Sample Config for browsers (TypeScript) +### Initialization -```js -import { - IAM, - WalletProvider, - setCacheClientOptions, - setChainConfig, - setMessagingOptions, - MessagingMethod, -} from 'iam-client-lib' - -export class App { - private _iam: IAM; - - constructor() { - // IAM has builtin default settings for VOLTA CHAIN - - // If you want to change default cache server config or add config for your network - setCacheClientOptions(1111, { - url: 'https://some-cache-server.com/', - cacheServerSupportsAuth: true, - }) - - // If you want to change default chain config or add config for your network - setChainConfig(1111, { - didContractAddress: '0x3e2fb24edc3536d655720280b427c91bcb55f3d6', - ensRegistryAddress: '0xa372d665f83197a63bbe633ebe19c7bfd4943003', - ensResolverAddress: '0xe878bdcf5148307378043bfd2b584909aa48a227', - rpcUrl: 'http://some-rpc.com', - }) - - // If you want to change default messaging config or add config for your network - setMessagingOptions(1111, { - messagingMethod: MessagingMethod.Nats, - natsServerUrl: 'https://some-exchange-server.com', - }) - - // create IAM instance - this._iam = new IAM(); - } - - async initializeIAM() { - // this will show connection modal and authenticate - const { did, connected } = await this._iam.initializeConnection({ - walletProvider: WalletProvider.MetaMask, - }); - - // after successfully authentication you can retrieve the signer - const signer = this._iam.getSigner(); - } +Because of dependencies between modules they should be initialized in right order. +This is achieved by accessing module initializer from initialization function of required module. +1. Initializing signer service. It will initialize staking and messaging services and allow to connect to cache server + +```js + const { + signerService, + stakingService, + messagingService, + connectToCacheServer, + isSessionActive, + storeSession + } = await initWithPrivateKeySigner(privateKey, rpcUrl) ``` -### Sample Config for Node.js (TypeScript) +2. Connecting to cache server. Depending on signer type signature might be requested ```js -import { IAM } from 'iam-client-lib' - -export class App { - private _iam: IAM; - - constructor() { - // IAM has builtin default settings for VOLTA CHAIN - - // If you want to change default cache server config or add config for your network - setCacheClientOptions(1111, { - url: 'https://some-cache-server.com/', - cacheServerSupportsAuth: true, - }) - - // If you want to change default chain config or add config for your network - setChainConfig(1111, { - didContractAddress: '0x3e2fb24edc3536d655720280b427c91bcb55f3d6', - ensRegistryAddress: '0xa372d665f83197a63bbe633ebe19c7bfd4943003', - ensResolverAddress: '0xe878bdcf5148307378043bfd2b584909aa48a227', - rpcUrl: 'http://some-rpc.com', - }) - - // create IAM instance - this._iam = new IAM({ - // only for Node.js env you need to pass rpcUrl in the constructor - rpcUrl: 'http://some-rpc.com', - privateKey: '9945c05be0b1b7b35b7cec937e78c6552ecedca764b53a772547d94a687db929' - }); - } - - async initializeIAM() { - // this will authenticate - const { did, connected } = await this._iam.initializeConnection(); - - // after successfully authentication you can retrieve the signer - const signer = this._iam.getSigner(); - } +// IAM has builtin default settings for VOLTA CHAIN, which can overriden +setChainConfig(1111, { + didContractAddress: '0x3e2fb24edc3536d655720280b427c91bcb55f3d6', + ensRegistryAddress: '0xa372d665f83197a63bbe633ebe19c7bfd4943003', + ensResolverAddress: '0xe878bdcf5148307378043bfd2b584909aa48a227', + rpcUrl: 'http://some-rpc.com', +}) + +setMessagingOptions(1111, { + messagingMethod: MessagingMethod.Nats, + natsServerUrl: 'https://some-exchange-server.com' +}) + +setCacheClientOptions(1111, { + url: 'https://some-cache-server.com/', + cacheServerSupportsAuth: true, +}) + +const { + cacheClient, + domainsService, + connectToDidRegistry +} = await connectToCacheServer() +``` + +3. Connecting to DID registry. If the document does not exist yet, a transaction will have to be sent +```js +const { + didRegistry, + claimsService +} = await connectToDidRegistry() ``` ## Development @@ -171,9 +130,9 @@ npm run build ## Active Maintainers -- [Ahmed Ibrahim](https://github.com/ahmedolaibrahim) -- [John Henderson](https://github.com/jrhender) -- [Dmitry Fesenko](https://github.com/JGiter) +* [Ahmed Ibrahim](https://github.com/ahmedolaibrahim) +* [John Henderson](https://github.com/jrhender) +* [Dmitry Fesenko](https://github.com/JGiter) ## Contributing diff --git a/docs/api/classes/GnosisIam.GnosisIam-1.md b/docs/api/classes/GnosisIam.GnosisIam-1.md deleted file mode 100644 index 42f0a595..00000000 --- a/docs/api/classes/GnosisIam.GnosisIam-1.md +++ /dev/null @@ -1,1714 +0,0 @@ -# Class: GnosisIam - -[GnosisIam](../modules/GnosisIam.md).GnosisIam - -**`description`** Intended for use in Volta Gnosis web interface(https://volta.gnosis-safe.io/). -Dapp should provide this class with SafeAppSdk injected by Gnosis interface. This class intoduces -notion of controlled domain as that which is owned by gnosis wallet controlled by Iam signer. -The domain ownership functionality has been redefined accordingly. - -## Hierarchy - -- [`IAM`](iam.IAM.md) - - ↳ **`GnosisIam`** - -## Table of contents - -### Constructors - -- [constructor](GnosisIam.GnosisIam-1.md#constructor) - -### Accessors - -- [address](GnosisIam.GnosisIam-1.md#address) -- [safeAddress](GnosisIam.GnosisIam-1.md#safeaddress) - -### Methods - -- [acceptAssetOffer](GnosisIam.GnosisIam-1.md#acceptassetoffer) -- [cancelAssetOffer](GnosisIam.GnosisIam-1.md#cancelassetoffer) -- [changeAppOwnership](GnosisIam.GnosisIam-1.md#changeappownership) -- [changeOrgOwnership](GnosisIam.GnosisIam-1.md#changeorgownership) -- [changeRoleOwnership](GnosisIam.GnosisIam-1.md#changeroleownership) -- [checkExistenceOfDomain](GnosisIam.GnosisIam-1.md#checkexistenceofdomain) -- [closeConnection](GnosisIam.GnosisIam-1.md#closeconnection) -- [connectToCacheServer](GnosisIam.GnosisIam-1.md#connecttocacheserver) -- [connectToDIDRegistry](GnosisIam.GnosisIam-1.md#connecttodidregistry) -- [createApplication](GnosisIam.GnosisIam-1.md#createapplication) -- [createClaimRequest](GnosisIam.GnosisIam-1.md#createclaimrequest) -- [createIdentityProof](GnosisIam.GnosisIam-1.md#createidentityproof) -- [createOrganization](GnosisIam.GnosisIam-1.md#createorganization) -- [createProofClaim](GnosisIam.GnosisIam-1.md#createproofclaim) -- [createPublicClaim](GnosisIam.GnosisIam-1.md#createpublicclaim) -- [createRole](GnosisIam.GnosisIam-1.md#createrole) -- [createSelfSignedClaim](GnosisIam.GnosisIam-1.md#createselfsignedclaim) -- [decodeJWTToken](GnosisIam.GnosisIam-1.md#decodejwttoken) -- [deleteApplication](GnosisIam.GnosisIam-1.md#deleteapplication) -- [deleteClaim](GnosisIam.GnosisIam-1.md#deleteclaim) -- [deleteOrganization](GnosisIam.GnosisIam-1.md#deleteorganization) -- [deleteRole](GnosisIam.GnosisIam-1.md#deleterole) -- [getAppsByOrgNamespace](GnosisIam.GnosisIam-1.md#getappsbyorgnamespace) -- [getAssetById](GnosisIam.GnosisIam-1.md#getassetbyid) -- [getAssetHistory](GnosisIam.GnosisIam-1.md#getassethistory) -- [getClaimsByIssuer](GnosisIam.GnosisIam-1.md#getclaimsbyissuer) -- [getClaimsByRequester](GnosisIam.GnosisIam-1.md#getclaimsbyrequester) -- [getClaimsBySubject](GnosisIam.GnosisIam-1.md#getclaimsbysubject) -- [getClaimsBySubjects](GnosisIam.GnosisIam-1.md#getclaimsbysubjects) -- [getDefinition](GnosisIam.GnosisIam-1.md#getdefinition) -- [getDid](GnosisIam.GnosisIam-1.md#getdid) -- [getDidDocument](GnosisIam.GnosisIam-1.md#getdiddocument) -- [getENSTypesByOwner](GnosisIam.GnosisIam-1.md#getenstypesbyowner) -- [getENSTypesBySearchPhrase](GnosisIam.GnosisIam-1.md#getenstypesbysearchphrase) -- [getOfferedAssets](GnosisIam.GnosisIam-1.md#getofferedassets) -- [getOrgHierarchy](GnosisIam.GnosisIam-1.md#getorghierarchy) -- [getOwnedAssets](GnosisIam.GnosisIam-1.md#getownedassets) -- [getPreviouslyOwnedAssets](GnosisIam.GnosisIam-1.md#getpreviouslyownedassets) -- [getProviderType](GnosisIam.GnosisIam-1.md#getprovidertype) -- [getRoleDIDs](GnosisIam.GnosisIam-1.md#getroledids) -- [getRolesByNamespace](GnosisIam.GnosisIam-1.md#getrolesbynamespace) -- [getSigner](GnosisIam.GnosisIam-1.md#getsigner) -- [getSubOrgsByOrgNamespace](GnosisIam.GnosisIam-1.md#getsuborgsbyorgnamespace) -- [getSubdomains](GnosisIam.GnosisIam-1.md#getsubdomains) -- [getUserClaims](GnosisIam.GnosisIam-1.md#getuserclaims) -- [initializeConnection](GnosisIam.GnosisIam-1.md#initializeconnection) -- [isConnected](GnosisIam.GnosisIam-1.md#isconnected) -- [isOwner](GnosisIam.GnosisIam-1.md#isowner) -- [isSessionActive](GnosisIam.GnosisIam-1.md#issessionactive) -- [issueClaimRequest](GnosisIam.GnosisIam-1.md#issueclaimrequest) -- [issuePublicClaim](GnosisIam.GnosisIam-1.md#issuepublicclaim) -- [namespacesWithRelations](GnosisIam.GnosisIam-1.md#namespaceswithrelations) -- [offerAsset](GnosisIam.GnosisIam-1.md#offerasset) -- [on](GnosisIam.GnosisIam-1.md#on) -- [publishPublicClaim](GnosisIam.GnosisIam-1.md#publishpublicclaim) -- [registerAsset](GnosisIam.GnosisIam-1.md#registerasset) -- [registrationTypesOfRoles](GnosisIam.GnosisIam-1.md#registrationtypesofroles) -- [rejectAssetOffer](GnosisIam.GnosisIam-1.md#rejectassetoffer) -- [rejectClaimRequest](GnosisIam.GnosisIam-1.md#rejectclaimrequest) -- [revokeDidDocument](GnosisIam.GnosisIam-1.md#revokediddocument) -- [setRoleDefinition](GnosisIam.GnosisIam-1.md#setroledefinition) -- [subscribeTo](GnosisIam.GnosisIam-1.md#subscribeto) -- [unsubscribeFrom](GnosisIam.GnosisIam-1.md#unsubscribefrom) -- [updateDidDocument](GnosisIam.GnosisIam-1.md#updatediddocument) -- [validateOwnership](GnosisIam.GnosisIam-1.md#validateownership) -- [verifyPublicClaim](GnosisIam.GnosisIam-1.md#verifypublicclaim) -- [isMetamaskExtensionPresent](GnosisIam.GnosisIam-1.md#ismetamaskextensionpresent) - -## Constructors - -### constructor - -• **new GnosisIam**(`safeAppSdk`, `iamOpts`) - -IAM Constructor - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `safeAppSdk` | `SafeAppsSDK` | -| `iamOpts` | [`ConnectionOptions`](../modules/iam_iam_base.md#connectionoptions) | - -#### Overrides - -[IAM](iam.IAM.md).[constructor](iam.IAM.md#constructor) - -## Accessors - -### address - -• `get` **address**(): `undefined` \| `string` - -#### Returns - -`undefined` \| `string` - -___ - -### safeAddress - -• `get` **safeAddress**(): `string` - -#### Returns - -`string` - -## Methods - -### acceptAssetOffer - -▸ **acceptAssetOffer**(`__namedParameters`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.assetDID` | `string` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[IAM](iam.IAM.md).[acceptAssetOffer](iam.IAM.md#acceptassetoffer) - -___ - -### cancelAssetOffer - -▸ **cancelAssetOffer**(`__namedParameters`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.assetDID` | `string` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[IAM](iam.IAM.md).[cancelAssetOffer](iam.IAM.md#cancelassetoffer) - -___ - -### changeAppOwnership - -▸ **changeAppOwnership**(`__namedParameters`): `Promise`<{ `info`: `string` ; `next`: (`__namedParameters`: { `retryCheck?`: `boolean` }) => `Promise`<`void`\> ; `tx`: [`EncodedCall`](../modules/iam_iam_base.md#encodedcall) }[]\> - -changeAppOwnership - -**`description`** change owner ship of app subdomain and all app owned subdomains - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.namespace` | `string` | -| `__namedParameters.newOwner` | `string` | -| `__namedParameters.returnSteps?` | `boolean` | - -#### Returns - -`Promise`<{ `info`: `string` ; `next`: (`__namedParameters`: { `retryCheck?`: `boolean` }) => `Promise`<`void`\> ; `tx`: [`EncodedCall`](../modules/iam_iam_base.md#encodedcall) }[]\> - -return array of steps needed to change ownership - -#### Inherited from - -[IAM](iam.IAM.md).[changeAppOwnership](iam.IAM.md#changeappownership) - -___ - -### changeOrgOwnership - -▸ **changeOrgOwnership**(`__namedParameters`): `Promise`<{ `info`: `string` ; `next`: (`__namedParameters`: { `retryCheck?`: `boolean` }) => `Promise`<`void`\> ; `tx`: [`EncodedCall`](../modules/iam_iam_base.md#encodedcall) }[]\> - -changeOrgOwnership - -**`description`** change owner ship of org subdomain and all org owned roles subdomains - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.namespace` | `string` | -| `__namedParameters.newOwner` | `string` | -| `__namedParameters.returnSteps?` | `boolean` | - -#### Returns - -`Promise`<{ `info`: `string` ; `next`: (`__namedParameters`: { `retryCheck?`: `boolean` }) => `Promise`<`void`\> ; `tx`: [`EncodedCall`](../modules/iam_iam_base.md#encodedcall) }[]\> - -return array of steps needed to change ownership - -#### Inherited from - -[IAM](iam.IAM.md).[changeOrgOwnership](iam.IAM.md#changeorgownership) - -___ - -### changeRoleOwnership - -▸ **changeRoleOwnership**(`__namedParameters`): `Promise`<`void`\> - -changeRoleOwnership - -**`description`** change ownership of role subdomain - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.namespace` | `string` | -| `__namedParameters.newOwner` | `string` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[IAM](iam.IAM.md).[changeRoleOwnership](iam.IAM.md#changeroleownership) - -___ - -### checkExistenceOfDomain - -▸ **checkExistenceOfDomain**(`__namedParameters`): `Promise`<`boolean`\> - -checkExistenceOfDomain - -**`description`** check existence of domain in ENS registry - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.domain` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true or false whatever the domain is present - -#### Inherited from - -[IAM](iam.IAM.md).[checkExistenceOfDomain](iam.IAM.md#checkexistenceofdomain) - -___ - -### closeConnection - -▸ **closeConnection**(): `Promise`<`void`\> - -**`description`** Closes the connection between application and the signer's wallet - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[IAM](iam.IAM.md).[closeConnection](iam.IAM.md#closeconnection) - -___ - -### connectToCacheServer - -▸ **connectToCacheServer**(): `Promise`<`void`\> - -**`description`** Establishes connection to the cache serverand sets public key and identity token - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[IAM](iam.IAM.md).[connectToCacheServer](iam.IAM.md#connecttocacheserver) - -___ - -### connectToDIDRegistry - -▸ **connectToDIDRegistry**(): `Promise`<`void`\> - -**`description`** Creates the signer's DID document if it does not exist - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[IAM](iam.IAM.md).[connectToDIDRegistry](iam.IAM.md#connecttodidregistry) - -___ - -### createApplication - -▸ **createApplication**(`__namedParameters`): `Promise`<{ `info`: `string` = "Set subdomain for application"; `next`: () => `Promise`<`void`\> ; `tx`: [`EncodedCall`](../modules/iam_iam_base.md#encodedcall) }[]\> - -createApp - -**`description`** creates role (create subdomain, sets the domain name and sets the role definition to metadata record in ENS Domain) - -**`description`** creates roles subdomain for the app namespace - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.appName` | `string` | -| `__namedParameters.data` | `IAppDefinition` | -| `__namedParameters.namespace` | `string` | -| `__namedParameters.returnSteps?` | `boolean` | - -#### Returns - -`Promise`<{ `info`: `string` = "Set subdomain for application"; `next`: () => `Promise`<`void`\> ; `tx`: [`EncodedCall`](../modules/iam_iam_base.md#encodedcall) }[]\> - -#### Inherited from - -[IAM](iam.IAM.md).[createApplication](iam.IAM.md#createapplication) - -___ - -### createClaimRequest - -▸ **createClaimRequest**(`__namedParameters`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.claim` | `Object` | -| `__namedParameters.claim.claimType` | `string` | -| `__namedParameters.claim.claimTypeVersion` | `number` | -| `__namedParameters.claim.fields` | { `key`: `string` ; `value`: `string` \| `number` }[] | -| `__namedParameters.registrationTypes?` | [`RegistrationTypes`](../enums/cacheServerClient_cacheServerClient_types.RegistrationTypes.md)[] | -| `__namedParameters.subject?` | `string` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[IAM](iam.IAM.md).[createClaimRequest](iam.IAM.md#createclaimrequest) - -___ - -### createIdentityProof - -▸ **createIdentityProof**(): `Promise`<`string`\> - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[IAM](iam.IAM.md).[createIdentityProof](iam.IAM.md#createidentityproof) - -___ - -### createOrganization - -▸ **createOrganization**(`__namedParameters`): `Promise`<{ `info`: `string` = "Create organization subdomain"; `next`: () => `Promise`<`void`\> ; `tx`: [`EncodedCall`](../modules/iam_iam_base.md#encodedcall) }[]\> - -createOrganization - -**`description`** creates organization (create subdomain, sets the domain name and sets the role definition to metadata record in ENS Domain) - -**`description`** and sets subdomain for roles and app for org namespace - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.data` | `IOrganizationDefinition` | -| `__namedParameters.namespace` | `string` | -| `__namedParameters.orgName` | `string` | -| `__namedParameters.returnSteps?` | `boolean` | - -#### Returns - -`Promise`<{ `info`: `string` = "Create organization subdomain"; `next`: () => `Promise`<`void`\> ; `tx`: [`EncodedCall`](../modules/iam_iam_base.md#encodedcall) }[]\> - -#### Inherited from - -[IAM](iam.IAM.md).[createOrganization](iam.IAM.md#createorganization) - -___ - -### createProofClaim - -▸ **createProofClaim**(`__namedParameters`): `Promise`<`string`\> - -createProofClaim - -**`description`** creates a proof of a claim - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.claimUrl` | `string` | -| `__namedParameters.saltedFields` | `ISaltedFields` | - -#### Returns - -`Promise`<`string`\> - -proof token - -#### Inherited from - -[IAM](iam.IAM.md).[createProofClaim](iam.IAM.md#createproofclaim) - -___ - -### createPublicClaim - -▸ **createPublicClaim**(`__namedParameters`): `Promise`<`string`\> - -createPublicClaim - -**`description`** create a public claim based on data provided - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.data` | [`ClaimData`](../interfaces/cacheServerClient_cacheServerClient_types.ClaimData.md) | -| `__namedParameters.subject?` | `string` | - -#### Returns - -`Promise`<`string`\> - -JWT token of created claim - -#### Inherited from - -[IAM](iam.IAM.md).[createPublicClaim](iam.IAM.md#createpublicclaim) - -___ - -### createRole - -▸ **createRole**(`__namedParameters`): `Promise`<{ `info`: `string` = "Create subdomain for role"; `next`: () => `Promise`<`void`\> ; `tx`: [`EncodedCall`](../modules/iam_iam_base.md#encodedcall) }[]\> - -createRole - -**`description`** creates role (create subdomain, sets the domain name and sets the role definition to metadata record in ENS Domain) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.data` | `IRoleDefinition` | -| `__namedParameters.namespace` | `string` | -| `__namedParameters.returnSteps?` | `boolean` | -| `__namedParameters.roleName` | `string` | - -#### Returns - -`Promise`<{ `info`: `string` = "Create subdomain for role"; `next`: () => `Promise`<`void`\> ; `tx`: [`EncodedCall`](../modules/iam_iam_base.md#encodedcall) }[]\> - -information (true/false) if the role was created - -#### Inherited from - -[IAM](iam.IAM.md).[createRole](iam.IAM.md#createrole) - -___ - -### createSelfSignedClaim - -▸ **createSelfSignedClaim**(`__namedParameters`): `Promise`<`string`\> - -createSelfSignedClaim - -**`description`** creates self signed claim and upload the data to ipfs - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.data` | [`ClaimData`](../interfaces/cacheServerClient_cacheServerClient_types.ClaimData.md) | -| `__namedParameters.subject?` | `string` | - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[IAM](iam.IAM.md).[createSelfSignedClaim](iam.IAM.md#createselfsignedclaim) - -___ - -### decodeJWTToken - -▸ **decodeJWTToken**(`__namedParameters`): `Promise`<`string` \| { [key: string]: `string` \| `object`; }\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.token` | `string` | - -#### Returns - -`Promise`<`string` \| { [key: string]: `string` \| `object`; }\> - -#### Inherited from - -[IAM](iam.IAM.md).[decodeJWTToken](iam.IAM.md#decodejwttoken) - -___ - -### deleteApplication - -▸ **deleteApplication**(`__namedParameters`): `Promise`<{ `info`: `string` ; `next`: (`__namedParameters`: { `retryCheck?`: `boolean` }) => `Promise`<`void`\> ; `tx`: [`EncodedCall`](../modules/iam_iam_base.md#encodedcall) }[]\> - -deleteApplication - -**`description`** delete application and roles - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.namespace` | `string` | -| `__namedParameters.returnSteps?` | `boolean` | - -#### Returns - -`Promise`<{ `info`: `string` ; `next`: (`__namedParameters`: { `retryCheck?`: `boolean` }) => `Promise`<`void`\> ; `tx`: [`EncodedCall`](../modules/iam_iam_base.md#encodedcall) }[]\> - -#### Inherited from - -[IAM](iam.IAM.md).[deleteApplication](iam.IAM.md#deleteapplication) - -___ - -### deleteClaim - -▸ **deleteClaim**(`__namedParameters`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.id` | `string` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[IAM](iam.IAM.md).[deleteClaim](iam.IAM.md#deleteclaim) - -___ - -### deleteOrganization - -▸ **deleteOrganization**(`__namedParameters`): `Promise`<{ `info`: `string` ; `next`: (`__namedParameters`: { `retryCheck?`: `boolean` }) => `Promise`<`void`\> ; `tx`: [`EncodedCall`](../modules/iam_iam_base.md#encodedcall) }[]\> - -deleteOrganization - -**`description`** delete organization and roles - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.namespace` | `string` | -| `__namedParameters.returnSteps?` | `boolean` | - -#### Returns - -`Promise`<{ `info`: `string` ; `next`: (`__namedParameters`: { `retryCheck?`: `boolean` }) => `Promise`<`void`\> ; `tx`: [`EncodedCall`](../modules/iam_iam_base.md#encodedcall) }[]\> - -#### Inherited from - -[IAM](iam.IAM.md).[deleteOrganization](iam.IAM.md#deleteorganization) - -___ - -### deleteRole - -▸ **deleteRole**(`__namedParameters`): `Promise`<`void`\> - -deleteRole - -**`description`** delete role - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.namespace` | `string` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[IAM](iam.IAM.md).[deleteRole](iam.IAM.md#deleterole) - -___ - -### getAppsByOrgNamespace - -▸ **getAppsByOrgNamespace**(`__namedParameters`): `Promise`<[`IApp`](../interfaces/cacheServerClient_cacheServerClient_types.IApp.md)[]\> - -getENSTypesByOwner - -**`description`** get all applications for organization namespace - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.namespace` | `string` | - -#### Returns - -`Promise`<[`IApp`](../interfaces/cacheServerClient_cacheServerClient_types.IApp.md)[]\> - -array of subdomains or empty array when there is no subdomains - -#### Inherited from - -[IAM](iam.IAM.md).[getAppsByOrgNamespace](iam.IAM.md#getappsbyorgnamespace) - -___ - -### getAssetById - -▸ **getAssetById**(`__namedParameters`): `Promise`<[`Asset`](../interfaces/cacheServerClient_cacheServerClient_types.Asset.md)\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.id` | `string` | - -#### Returns - -`Promise`<[`Asset`](../interfaces/cacheServerClient_cacheServerClient_types.Asset.md)\> - -#### Inherited from - -[IAM](iam.IAM.md).[getAssetById](iam.IAM.md#getassetbyid) - -___ - -### getAssetHistory - -▸ **getAssetHistory**(`__namedParameters`): `Promise`<[`AssetHistory`](../interfaces/cacheServerClient_cacheServerClient_types.AssetHistory.md)[]\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.id` | `string` | -| `__namedParameters.order?` | [`Order`](../enums/cacheServerClient_cacheServerClient_types.Order.md) | -| `__namedParameters.skip?` | `number` | -| `__namedParameters.take?` | `number` | -| `__namedParameters.type?` | [`AssetHistoryEventType`](../enums/cacheServerClient_cacheServerClient_types.AssetHistoryEventType.md) | - -#### Returns - -`Promise`<[`AssetHistory`](../interfaces/cacheServerClient_cacheServerClient_types.AssetHistory.md)[]\> - -#### Inherited from - -[IAM](iam.IAM.md).[getAssetHistory](iam.IAM.md#getassethistory) - -___ - -### getClaimsByIssuer - -▸ **getClaimsByIssuer**(`__namedParameters`): `Promise`<[`Claim`](../interfaces/cacheServerClient_cacheServerClient_types.Claim.md)[]\> - -**`description`** - Returns claims for given issuer. Allows filtering by status and parent namespace - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.did` | `string` | -| `__namedParameters.isAccepted?` | `boolean` | -| `__namedParameters.parentNamespace?` | `string` | - -#### Returns - -`Promise`<[`Claim`](../interfaces/cacheServerClient_cacheServerClient_types.Claim.md)[]\> - -#### Inherited from - -[IAM](iam.IAM.md).[getClaimsByIssuer](iam.IAM.md#getclaimsbyissuer) - -___ - -### getClaimsByRequester - -▸ **getClaimsByRequester**(`__namedParameters`): `Promise`<[`Claim`](../interfaces/cacheServerClient_cacheServerClient_types.Claim.md)[]\> - -**`description`** - Returns claims for given requester. Allows filtering by status and parent namespace - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.did` | `string` | -| `__namedParameters.isAccepted?` | `boolean` | -| `__namedParameters.parentNamespace?` | `string` | - -#### Returns - -`Promise`<[`Claim`](../interfaces/cacheServerClient_cacheServerClient_types.Claim.md)[]\> - -#### Inherited from - -[IAM](iam.IAM.md).[getClaimsByRequester](iam.IAM.md#getclaimsbyrequester) - -___ - -### getClaimsBySubject - -▸ **getClaimsBySubject**(`__namedParameters`): `Promise`<[`Claim`](../interfaces/cacheServerClient_cacheServerClient_types.Claim.md)[]\> - -**`description`** - Returns claims for given subject. Allows filtering by status and parent namespace - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.did` | `string` | -| `__namedParameters.isAccepted?` | `boolean` | -| `__namedParameters.parentNamespace?` | `string` | - -#### Returns - -`Promise`<[`Claim`](../interfaces/cacheServerClient_cacheServerClient_types.Claim.md)[]\> - -#### Inherited from - -[IAM](iam.IAM.md).[getClaimsBySubject](iam.IAM.md#getclaimsbysubject) - -___ - -### getClaimsBySubjects - -▸ **getClaimsBySubjects**(`subjects`): `Promise`<[`Claim`](../interfaces/cacheServerClient_cacheServerClient_types.Claim.md)[]\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `subjects` | `string`[] | - -#### Returns - -`Promise`<[`Claim`](../interfaces/cacheServerClient_cacheServerClient_types.Claim.md)[]\> - -#### Inherited from - -[IAM](iam.IAM.md).[getClaimsBySubjects](iam.IAM.md#getclaimsbysubjects) - -___ - -### getDefinition - -▸ **getDefinition**(`__namedParameters`): `Promise`<`IRoleDefinition` \| `IAppDefinition` \| `IOrganizationDefinition`\> - -getRoleDefinition - -**`description`** get role definition form ens domain metadata record - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.namespace` | `string` | -| `__namedParameters.type` | [`ENSNamespaceTypes`](../enums/iam.ENSNamespaceTypes.md) | - -#### Returns - -`Promise`<`IRoleDefinition` \| `IAppDefinition` \| `IOrganizationDefinition`\> - -metadata string or empty string when there is no metadata - -#### Inherited from - -[IAM](iam.IAM.md).[getDefinition](iam.IAM.md#getdefinition) - -___ - -### getDid - -▸ **getDid**(): `undefined` \| `string` - -Get DID - -#### Returns - -`undefined` \| `string` - -did string if connected to wallet, if not returns undefined - -#### Inherited from - -[IAM](iam.IAM.md).[getDid](iam.IAM.md#getdid) - -___ - -### getDidDocument - -▸ **getDidDocument**(`__namedParameters?`): `Promise`<`Object`\> - -getDidDocument - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `undefined` \| { `did?`: `string` ; `includeClaims?`: `boolean` } | - -#### Returns - -`Promise`<`Object`\> - -whole did document if connected, if not returns null - -#### Inherited from - -[IAM](iam.IAM.md).[getDidDocument](iam.IAM.md#getdiddocument) - -___ - -### getENSTypesByOwner - -▸ **getENSTypesByOwner**(`__namedParameters`): `Promise`<[`IOrganization`](../interfaces/cacheServerClient_cacheServerClient_types.IOrganization.md)[]\> \| `Promise`<[`IApp`](../interfaces/cacheServerClient_cacheServerClient_types.IApp.md)[]\> \| `Promise`<[`IRole`](../interfaces/cacheServerClient_cacheServerClient_types.IRole.md)[]\> - -getENSTypesByOwner - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.owner` | `string` | -| `__namedParameters.type` | [`ENSNamespaceTypes`](../enums/iam.ENSNamespaceTypes.md) | - -#### Returns - -`Promise`<[`IOrganization`](../interfaces/cacheServerClient_cacheServerClient_types.IOrganization.md)[]\> \| `Promise`<[`IApp`](../interfaces/cacheServerClient_cacheServerClient_types.IApp.md)[]\> \| `Promise`<[`IRole`](../interfaces/cacheServerClient_cacheServerClient_types.IRole.md)[]\> - -#### Overrides - -[IAM](iam.IAM.md).[getENSTypesByOwner](iam.IAM.md#getenstypesbyowner) - -___ - -### getENSTypesBySearchPhrase - -▸ **getENSTypesBySearchPhrase**(`__namedParameters`): `Promise`<([`IOrganization`](../interfaces/cacheServerClient_cacheServerClient_types.IOrganization.md) \| [`IApp`](../interfaces/cacheServerClient_cacheServerClient_types.IApp.md) \| [`IRole`](../interfaces/cacheServerClient_cacheServerClient_types.IRole.md))[]\> - -getENSTypesBySearchPhrase - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.search` | `string` | -| `__namedParameters.types?` | (``"App"`` \| ``"Org"`` \| ``"Role"``)[] | - -#### Returns - -`Promise`<([`IOrganization`](../interfaces/cacheServerClient_cacheServerClient_types.IOrganization.md) \| [`IApp`](../interfaces/cacheServerClient_cacheServerClient_types.IApp.md) \| [`IRole`](../interfaces/cacheServerClient_cacheServerClient_types.IRole.md))[]\> - -#### Inherited from - -[IAM](iam.IAM.md).[getENSTypesBySearchPhrase](iam.IAM.md#getenstypesbysearchphrase) - -___ - -### getOfferedAssets - -▸ **getOfferedAssets**(`__namedParameters?`): `Promise`<[`Asset`](../interfaces/cacheServerClient_cacheServerClient_types.Asset.md)[]\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.did?` | `string` | - -#### Returns - -`Promise`<[`Asset`](../interfaces/cacheServerClient_cacheServerClient_types.Asset.md)[]\> - -#### Inherited from - -[IAM](iam.IAM.md).[getOfferedAssets](iam.IAM.md#getofferedassets) - -___ - -### getOrgHierarchy - -▸ **getOrgHierarchy**(`__namedParameters`): `Promise`<[`IOrganization`](../interfaces/cacheServerClient_cacheServerClient_types.IOrganization.md)\> - -getOrgHierarchy - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.namespace` | `string` | - -#### Returns - -`Promise`<[`IOrganization`](../interfaces/cacheServerClient_cacheServerClient_types.IOrganization.md)\> - -#### Overrides - -[IAM](iam.IAM.md).[getOrgHierarchy](iam.IAM.md#getorghierarchy) - -___ - -### getOwnedAssets - -▸ **getOwnedAssets**(`__namedParameters?`): `Promise`<[`Asset`](../interfaces/cacheServerClient_cacheServerClient_types.Asset.md)[]\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.did?` | `string` | - -#### Returns - -`Promise`<[`Asset`](../interfaces/cacheServerClient_cacheServerClient_types.Asset.md)[]\> - -#### Inherited from - -[IAM](iam.IAM.md).[getOwnedAssets](iam.IAM.md#getownedassets) - -___ - -### getPreviouslyOwnedAssets - -▸ **getPreviouslyOwnedAssets**(`__namedParameters`): `Promise`<[`Asset`](../interfaces/cacheServerClient_cacheServerClient_types.Asset.md)[]\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.owner` | `string` | - -#### Returns - -`Promise`<[`Asset`](../interfaces/cacheServerClient_cacheServerClient_types.Asset.md)[]\> - -#### Inherited from - -[IAM](iam.IAM.md).[getPreviouslyOwnedAssets](iam.IAM.md#getpreviouslyownedassets) - -___ - -### getProviderType - -▸ **getProviderType**(): `undefined` \| [`WalletProvider`](../enums/types_WalletProvider.WalletProvider.md) - -Get the current initialized provider type - -#### Returns - -`undefined` \| [`WalletProvider`](../enums/types_WalletProvider.WalletProvider.md) - -provider type if the session is active if not undefined - -#### Inherited from - -[IAM](iam.IAM.md).[getProviderType](iam.IAM.md#getprovidertype) - -___ - -### getRoleDIDs - -▸ **getRoleDIDs**(`__namedParameters`): `Promise`<`string`[]\> - -getRoleDIDs - -**`description`** get all users did which have certain role - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.namespace` | `string` | - -#### Returns - -`Promise`<`string`[]\> - -array of did's - -#### Inherited from - -[IAM](iam.IAM.md).[getRoleDIDs](iam.IAM.md#getroledids) - -___ - -### getRolesByNamespace - -▸ **getRolesByNamespace**(`__namedParameters`): `Promise`<[`IRole`](../interfaces/cacheServerClient_cacheServerClient_types.IRole.md)[]\> - -getRolesByNamespace - -**`description`** get all subdomains for certain domain - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.namespace` | `string` | -| `__namedParameters.parentType` | [`Application`](../enums/iam.ENSNamespaceTypes.md#application) \| [`Organization`](../enums/iam.ENSNamespaceTypes.md#organization) | - -#### Returns - -`Promise`<[`IRole`](../interfaces/cacheServerClient_cacheServerClient_types.IRole.md)[]\> - -array of subdomains or empty array when there is no subdomains - -#### Inherited from - -[IAM](iam.IAM.md).[getRolesByNamespace](iam.IAM.md#getrolesbynamespace) - -___ - -### getSigner - -▸ **getSigner**(): `undefined` \| `JsonRpcSigner` \| `Signer` - -Get signer - -#### Returns - -`undefined` \| `JsonRpcSigner` \| `Signer` - -JsonRpcSigner if connected to wallet, if not returns undefined - -#### Inherited from - -[IAM](iam.IAM.md).[getSigner](iam.IAM.md#getsigner) - -___ - -### getSubOrgsByOrgNamespace - -▸ **getSubOrgsByOrgNamespace**(`__namedParameters`): `Promise`<[`IOrganization`](../interfaces/cacheServerClient_cacheServerClient_types.IOrganization.md)[]\> - -getSubOrgsByOrgNamespace - -**`description`** get all sub organizations for organization namespace - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.namespace` | `string` | - -#### Returns - -`Promise`<[`IOrganization`](../interfaces/cacheServerClient_cacheServerClient_types.IOrganization.md)[]\> - -array of subdomains or empty array when there is no subdomains - -#### Inherited from - -[IAM](iam.IAM.md).[getSubOrgsByOrgNamespace](iam.IAM.md#getsuborgsbyorgnamespace) - -___ - -### getSubdomains - -▸ **getSubdomains**(`__namedParameters`): `Promise`<`string`[]\> - -getSubdomains - -**`description`** get all subdomains for certain domain - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.domain` | `string` | -| `__namedParameters.mode?` | ``"ALL"`` \| ``"FIRSTLEVEL"`` | - -#### Returns - -`Promise`<`string`[]\> - -array of subdomains or empty array when there is no subdomains - -#### Inherited from - -[IAM](iam.IAM.md).[getSubdomains](iam.IAM.md#getsubdomains) - -___ - -### getUserClaims - -▸ **getUserClaims**(`__namedParameters?`): `Promise`<`IServiceEndpoint` & [`ClaimData`](../interfaces/cacheServerClient_cacheServerClient_types.ClaimData.md)[]\> - -getUserClaims - -**`description`** get user claims - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `undefined` \| { `did?`: `string` } | - -#### Returns - -`Promise`<`IServiceEndpoint` & [`ClaimData`](../interfaces/cacheServerClient_cacheServerClient_types.ClaimData.md)[]\> - -#### Inherited from - -[IAM](iam.IAM.md).[getUserClaims](iam.IAM.md#getuserclaims) - -___ - -### initializeConnection - -▸ **initializeConnection**(`__namedParameters?`): `Promise`<[`InitializeData`](../modules/iam.md#initializedata)\> - -Initialize connection to wallet - -**`description`** creates web3 provider and establishes secure connection to selected wallet - -**`summary`** if not connected to wallet will show connection modal, but if already connected (data stored in localStorage) will only return initial data without showing modal - -**`requires`** needs to be called before any of other methods - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.createDocument?` | `boolean` | -| `__namedParameters.initCacheServer?` | `boolean` | -| `__namedParameters.reinitializeMetamask?` | `boolean` | -| `__namedParameters.walletProvider?` | [`WalletProvider`](../enums/types_WalletProvider.WalletProvider.md) | - -#### Returns - -`Promise`<[`InitializeData`](../modules/iam.md#initializedata)\> - -did string, status of connection and info if the user closed the wallet selection modal - -#### Inherited from - -[IAM](iam.IAM.md).[initializeConnection](iam.IAM.md#initializeconnection) - -___ - -### isConnected - -▸ **isConnected**(): `boolean` - -isConnected - -#### Returns - -`boolean` - -info if the connection to wallet/signer is already established - -#### Inherited from - -[IAM](iam.IAM.md).[isConnected](iam.IAM.md#isconnected) - -___ - -### isOwner - -▸ **isOwner**(`__namedParameters`): `Promise`<`boolean`\> - -**`description`** Checks whether the `domain` is owned by `user` or by -gnosis wallet controlled by `user` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.domain` | `string` | -| `__namedParameters.user?` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -#### Overrides - -[IAM](iam.IAM.md).[isOwner](iam.IAM.md#isowner) - -___ - -### isSessionActive - -▸ **isSessionActive**(): `boolean` - -**`description`** Checks if the session is active - -#### Returns - -`boolean` - -boolean that indicates the session state - -#### Inherited from - -[IAM](iam.IAM.md).[isSessionActive](iam.IAM.md#issessionactive) - -___ - -### issueClaimRequest - -▸ **issueClaimRequest**(`__namedParameters`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.id` | `string` | -| `__namedParameters.registrationTypes` | [`RegistrationTypes`](../enums/cacheServerClient_cacheServerClient_types.RegistrationTypes.md)[] | -| `__namedParameters.requester` | `string` | -| `__namedParameters.subjectAgreement` | `string` | -| `__namedParameters.token` | `string` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[IAM](iam.IAM.md).[issueClaimRequest](iam.IAM.md#issueclaimrequest) - -___ - -### issuePublicClaim - -▸ **issuePublicClaim**(`__namedParameters`): `Promise`<`string`\> - -issuePublicClaim - -**`description`** issue a public claim - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.publicClaim?` | `IPublicClaim` | -| `__namedParameters.token?` | `string` | - -#### Returns - -`Promise`<`string`\> - -return issued token - -#### Inherited from - -[IAM](iam.IAM.md).[issuePublicClaim](iam.IAM.md#issuepublicclaim) - -___ - -### namespacesWithRelations - -▸ **namespacesWithRelations**(`namespaces`): `Promise`<{ `namespace`: `string` ; `owner`: `string` }[]\> - -**`description`** Collects all namespaces related data. Currently its includes only owner - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `namespaces` | `string`[] | - -#### Returns - -`Promise`<{ `namespace`: `string` ; `owner`: `string` }[]\> - -#### Inherited from - -[IAM](iam.IAM.md).[namespacesWithRelations](iam.IAM.md#namespaceswithrelations) - -___ - -### offerAsset - -▸ **offerAsset**(`__namedParameters`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.assetDID` | `string` | -| `__namedParameters.offerTo` | `string` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[IAM](iam.IAM.md).[offerAsset](iam.IAM.md#offerasset) - -___ - -### on - -▸ **on**(`event`, `eventHandler`): `void` - -**`description`** Defines event handlers for change of account, change of network, disconnection - -**`requires`** to be called after the connection to wallet was initialized - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `event` | ``"accountChanged"`` \| ``"networkChanged"`` \| ``"disconnected"`` | -| `eventHandler` | () => `void` | - -#### Returns - -`void` - -#### Inherited from - -[IAM](iam.IAM.md).[on](iam.IAM.md#on) - -___ - -### publishPublicClaim - -▸ **publishPublicClaim**(`__namedParameters`): `Promise`<`string`\> - -publishPublicClaim - -**`description`** store claim data in ipfs and save url to DID document services - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.token` | `string` | - -#### Returns - -`Promise`<`string`\> - -ulr to ipfs - -#### Inherited from - -[IAM](iam.IAM.md).[publishPublicClaim](iam.IAM.md#publishpublicclaim) - -___ - -### registerAsset - -▸ **registerAsset**(): `Promise`<`string`\> - -#### Returns - -`Promise`<`string`\> - -#### Inherited from - -[IAM](iam.IAM.md).[registerAsset](iam.IAM.md#registerasset) - -___ - -### registrationTypesOfRoles - -▸ **registrationTypesOfRoles**(`roles`): `Promise`<`Record`<`string`, `Set`<[`RegistrationTypes`](../enums/cacheServerClient_cacheServerClient_types.RegistrationTypes.md)\>\>\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `roles` | `string`[] | - -#### Returns - -`Promise`<`Record`<`string`, `Set`<[`RegistrationTypes`](../enums/cacheServerClient_cacheServerClient_types.RegistrationTypes.md)\>\>\> - -#### Inherited from - -[IAM](iam.IAM.md).[registrationTypesOfRoles](iam.IAM.md#registrationtypesofroles) - -___ - -### rejectAssetOffer - -▸ **rejectAssetOffer**(`__namedParameters`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.assetDID` | `string` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[IAM](iam.IAM.md).[rejectAssetOffer](iam.IAM.md#rejectassetoffer) - -___ - -### rejectClaimRequest - -▸ **rejectClaimRequest**(`__namedParameters`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.id` | `string` | -| `__namedParameters.requesterDID` | `string` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[IAM](iam.IAM.md).[rejectClaimRequest](iam.IAM.md#rejectclaimrequest) - -___ - -### revokeDidDocument - -▸ **revokeDidDocument**(): `Promise`<`boolean`\> - -revokeDidDocument - -**`description`** revokes did document - -#### Returns - -`Promise`<`boolean`\> - -information (true/false) if the DID document was revoked - -#### Inherited from - -[IAM](iam.IAM.md).[revokeDidDocument](iam.IAM.md#revokediddocument) - -___ - -### setRoleDefinition - -▸ **setRoleDefinition**(`__namedParameters`): `Promise`<`void`\> - -setRoleDefinition - -**`description`** sets role definition in ENS domain - -**`description`** please use it only when you want to update role definitions for already created role (domain) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.data` | `IRoleDefinition` \| `IAppDefinition` \| `IOrganizationDefinition` | -| `__namedParameters.domain` | `string` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[IAM](iam.IAM.md).[setRoleDefinition](iam.IAM.md#setroledefinition) - -___ - -### subscribeTo - -▸ **subscribeTo**(`__namedParameters`): `Promise`<`undefined` \| `number`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.subject?` | `string` | -| `__namedParameters.messageHandler` | (`data`: [`IMessage`](../interfaces/iam.IMessage.md)) => `void` | - -#### Returns - -`Promise`<`undefined` \| `number`\> - -#### Inherited from - -[IAM](iam.IAM.md).[subscribeTo](iam.IAM.md#subscribeto) - -___ - -### unsubscribeFrom - -▸ **unsubscribeFrom**(`subscriptionId`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `subscriptionId` | `number` | - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[IAM](iam.IAM.md).[unsubscribeFrom](iam.IAM.md#unsubscribefrom) - -___ - -### updateDidDocument - -▸ **updateDidDocument**(`options`): `Promise`<`boolean`\> - -**`description`** updates did document based on data provided - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `options` | `Object` | Options to connect with blockchain | -| `options.data` | `IUpdateData` | New attribute value | -| `options.did?` | `string` | Asset did to be updated | -| `options.didAttribute` | `DIDAttribute` | Type of document to be updated | -| `options.validity?` | `number` | Time (s) for the attribute to expire | - -#### Returns - -`Promise`<`boolean`\> - -true if document is updated successfuly - -#### Inherited from - -[IAM](iam.IAM.md).[updateDidDocument](iam.IAM.md#updatediddocument) - -___ - -### validateOwnership - -▸ **validateOwnership**(`__namedParameters`): `Promise`<`string`[]\> - -validateOwnership - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.namespace` | `string` | -| `__namedParameters.type` | [`ENSNamespaceTypes`](../enums/iam.ENSNamespaceTypes.md) | - -#### Returns - -`Promise`<`string`[]\> - -#### Overrides - -[IAM](iam.IAM.md).[validateOwnership](iam.IAM.md#validateownership) - -___ - -### verifyPublicClaim - -▸ **verifyPublicClaim**(`__namedParameters`): `Promise`<`IPublicClaim`\> - -verifyPublicClaim - -**`description`** verifies issued token of claim - -**`throws`** if the proof failed - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.claimUrl` | `string` | - -#### Returns - -`Promise`<`IPublicClaim`\> - -public claim data - -#### Inherited from - -[IAM](iam.IAM.md).[verifyPublicClaim](iam.IAM.md#verifypublicclaim) - -___ - -### isMetamaskExtensionPresent - -▸ `Static` **isMetamaskExtensionPresent**(): `Promise`<`Object`\> - -#### Returns - -`Promise`<`Object`\> - -#### Inherited from - -[IAM](iam.IAM.md).[isMetamaskExtensionPresent](iam.IAM.md#ismetamaskextensionpresent) diff --git a/docs/api/classes/cacheServerClient_cacheServerClient.CacheServerClient.md b/docs/api/classes/cacheServerClient_cacheServerClient.CacheServerClient.md deleted file mode 100644 index ad71eb9e..00000000 --- a/docs/api/classes/cacheServerClient_cacheServerClient.CacheServerClient.md +++ /dev/null @@ -1,764 +0,0 @@ -# Class: CacheServerClient - -[cacheServerClient/cacheServerClient](../modules/cacheServerClient_cacheServerClient.md).CacheServerClient - -## Implements - -- [`ICacheServerClient`](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md) - -## Table of contents - -### Constructors - -- [constructor](cacheServerClient_cacheServerClient.CacheServerClient.md#constructor) - -### Properties - -- [pubKeyAndIdentityToken](cacheServerClient_cacheServerClient.CacheServerClient.md#pubkeyandidentitytoken) - -### Methods - -- [addDIDToWatchList](cacheServerClient_cacheServerClient.CacheServerClient.md#adddidtowatchlist) -- [addFailedRequest](cacheServerClient_cacheServerClient.CacheServerClient.md#addfailedrequest) -- [deleteClaim](cacheServerClient_cacheServerClient.CacheServerClient.md#deleteclaim) -- [getAppDefinition](cacheServerClient_cacheServerClient.CacheServerClient.md#getappdefinition) -- [getApplicationRoles](cacheServerClient_cacheServerClient.CacheServerClient.md#getapplicationroles) -- [getApplicationsByOrganization](cacheServerClient_cacheServerClient.CacheServerClient.md#getapplicationsbyorganization) -- [getApplicationsByOwner](cacheServerClient_cacheServerClient.CacheServerClient.md#getapplicationsbyowner) -- [getAssetById](cacheServerClient_cacheServerClient.CacheServerClient.md#getassetbyid) -- [getAssetHistory](cacheServerClient_cacheServerClient.CacheServerClient.md#getassethistory) -- [getClaimsByIssuer](cacheServerClient_cacheServerClient.CacheServerClient.md#getclaimsbyissuer) -- [getClaimsByRequester](cacheServerClient_cacheServerClient.CacheServerClient.md#getclaimsbyrequester) -- [getClaimsBySubject](cacheServerClient_cacheServerClient.CacheServerClient.md#getclaimsbysubject) -- [getClaimsBySubjects](cacheServerClient_cacheServerClient.CacheServerClient.md#getclaimsbysubjects) -- [getDIDsForRole](cacheServerClient_cacheServerClient.CacheServerClient.md#getdidsforrole) -- [getDidDocument](cacheServerClient_cacheServerClient.CacheServerClient.md#getdiddocument) -- [getNamespaceBySearchPhrase](cacheServerClient_cacheServerClient.CacheServerClient.md#getnamespacebysearchphrase) -- [getOfferedAssets](cacheServerClient_cacheServerClient.CacheServerClient.md#getofferedassets) -- [getOrgDefinition](cacheServerClient_cacheServerClient.CacheServerClient.md#getorgdefinition) -- [getOrgHierarchy](cacheServerClient_cacheServerClient.CacheServerClient.md#getorghierarchy) -- [getOrganizationRoles](cacheServerClient_cacheServerClient.CacheServerClient.md#getorganizationroles) -- [getOrganizationsByOwner](cacheServerClient_cacheServerClient.CacheServerClient.md#getorganizationsbyowner) -- [getOwnedAssets](cacheServerClient_cacheServerClient.CacheServerClient.md#getownedassets) -- [getPreviouslyOwnedAssets](cacheServerClient_cacheServerClient.CacheServerClient.md#getpreviouslyownedassets) -- [getRoleDefinition](cacheServerClient_cacheServerClient.CacheServerClient.md#getroledefinition) -- [getRolesByOwner](cacheServerClient_cacheServerClient.CacheServerClient.md#getrolesbyowner) -- [getSubOrganizationsByOrganization](cacheServerClient_cacheServerClient.CacheServerClient.md#getsuborganizationsbyorganization) -- [handleRefreshToken](cacheServerClient_cacheServerClient.CacheServerClient.md#handlerefreshtoken) -- [handleUnauthorized](cacheServerClient_cacheServerClient.CacheServerClient.md#handleunauthorized) -- [isAuthEnabled](cacheServerClient_cacheServerClient.CacheServerClient.md#isauthenabled) -- [issueClaim](cacheServerClient_cacheServerClient.CacheServerClient.md#issueclaim) -- [login](cacheServerClient_cacheServerClient.CacheServerClient.md#login) -- [rejectClaim](cacheServerClient_cacheServerClient.CacheServerClient.md#rejectclaim) -- [requestClaim](cacheServerClient_cacheServerClient.CacheServerClient.md#requestclaim) -- [testLogin](cacheServerClient_cacheServerClient.CacheServerClient.md#testlogin) - -## Constructors - -### constructor - -• **new CacheServerClient**(`__namedParameters`, `signer`) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`CacheServerClientOptions`](../interfaces/cacheServerClient_cacheServerClient.CacheServerClientOptions.md) | -| `signer` | `Signer` | - -## Properties - -### pubKeyAndIdentityToken - -• **pubKeyAndIdentityToken**: `undefined` \| [`IPubKeyAndIdentityToken`](../interfaces/utils_getPublicKeyAndIdentityToken.IPubKeyAndIdentityToken.md) - -#### Implementation of - -[ICacheServerClient](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md).[pubKeyAndIdentityToken](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md#pubkeyandidentitytoken) - -## Methods - -### addDIDToWatchList - -▸ **addDIDToWatchList**(`__namedParameters`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.did` | `string` | - -#### Returns - -`Promise`<`void`\> - -#### Implementation of - -[ICacheServerClient](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md).[addDIDToWatchList](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md#adddidtowatchlist) - -___ - -### addFailedRequest - -▸ **addFailedRequest**(`callback`): `void` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `callback` | (`token?`: `string`) => `void` | - -#### Returns - -`void` - -___ - -### deleteClaim - -▸ **deleteClaim**(`__namedParameters`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.claimId` | `string` | - -#### Returns - -`Promise`<`void`\> - -#### Implementation of - -[ICacheServerClient](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md).[deleteClaim](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md#deleteclaim) - -___ - -### getAppDefinition - -▸ **getAppDefinition**(`__namedParameters`): `Promise`<`IAppDefinition`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.namespace` | `string` | - -#### Returns - -`Promise`<`IAppDefinition`\> - -#### Implementation of - -[ICacheServerClient](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md).[getAppDefinition](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md#getappdefinition) - -___ - -### getApplicationRoles - -▸ **getApplicationRoles**(`__namedParameters`): `Promise`<[`IRole`](../interfaces/cacheServerClient_cacheServerClient_types.IRole.md)[]\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.namespace` | `string` | - -#### Returns - -`Promise`<[`IRole`](../interfaces/cacheServerClient_cacheServerClient_types.IRole.md)[]\> - -#### Implementation of - -[ICacheServerClient](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md).[getApplicationRoles](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md#getapplicationroles) - -___ - -### getApplicationsByOrganization - -▸ **getApplicationsByOrganization**(`__namedParameters`): `Promise`<[`IApp`](../interfaces/cacheServerClient_cacheServerClient_types.IApp.md)[]\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.namespace` | `string` | - -#### Returns - -`Promise`<[`IApp`](../interfaces/cacheServerClient_cacheServerClient_types.IApp.md)[]\> - -#### Implementation of - -[ICacheServerClient](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md).[getApplicationsByOrganization](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md#getapplicationsbyorganization) - -___ - -### getApplicationsByOwner - -▸ **getApplicationsByOwner**(`__namedParameters`): `Promise`<[`IApp`](../interfaces/cacheServerClient_cacheServerClient_types.IApp.md)[]\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.owner` | `string` | - -#### Returns - -`Promise`<[`IApp`](../interfaces/cacheServerClient_cacheServerClient_types.IApp.md)[]\> - -#### Implementation of - -[ICacheServerClient](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md).[getApplicationsByOwner](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md#getapplicationsbyowner) - -___ - -### getAssetById - -▸ **getAssetById**(`__namedParameters`): `Promise`<[`Asset`](../interfaces/cacheServerClient_cacheServerClient_types.Asset.md)\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.id` | `string` | - -#### Returns - -`Promise`<[`Asset`](../interfaces/cacheServerClient_cacheServerClient_types.Asset.md)\> - -#### Implementation of - -[ICacheServerClient](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md).[getAssetById](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md#getassetbyid) - -___ - -### getAssetHistory - -▸ **getAssetHistory**(`__namedParameters`): `Promise`<[`AssetHistory`](../interfaces/cacheServerClient_cacheServerClient_types.AssetHistory.md)[]\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.id` | `string` | -| `__namedParameters.order?` | [`Order`](../enums/cacheServerClient_cacheServerClient_types.Order.md) | -| `__namedParameters.skip?` | `number` | -| `__namedParameters.take?` | `number` | -| `__namedParameters.type?` | [`AssetHistoryEventType`](../enums/cacheServerClient_cacheServerClient_types.AssetHistoryEventType.md) | - -#### Returns - -`Promise`<[`AssetHistory`](../interfaces/cacheServerClient_cacheServerClient_types.AssetHistory.md)[]\> - -#### Implementation of - -[ICacheServerClient](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md).[getAssetHistory](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md#getassethistory) - -___ - -### getClaimsByIssuer - -▸ **getClaimsByIssuer**(`__namedParameters`): `Promise`<[`Claim`](../interfaces/cacheServerClient_cacheServerClient_types.Claim.md)[]\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.did` | `string` | -| `__namedParameters.isAccepted?` | `boolean` | -| `__namedParameters.namespace?` | `string` | - -#### Returns - -`Promise`<[`Claim`](../interfaces/cacheServerClient_cacheServerClient_types.Claim.md)[]\> - -#### Implementation of - -[ICacheServerClient](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md).[getClaimsByIssuer](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md#getclaimsbyissuer) - -___ - -### getClaimsByRequester - -▸ **getClaimsByRequester**(`__namedParameters`): `Promise`<[`Claim`](../interfaces/cacheServerClient_cacheServerClient_types.Claim.md)[]\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.did` | `string` | -| `__namedParameters.isAccepted?` | `boolean` | -| `__namedParameters.namespace?` | `string` | - -#### Returns - -`Promise`<[`Claim`](../interfaces/cacheServerClient_cacheServerClient_types.Claim.md)[]\> - -#### Implementation of - -[ICacheServerClient](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md).[getClaimsByRequester](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md#getclaimsbyrequester) - -___ - -### getClaimsBySubject - -▸ **getClaimsBySubject**(`__namedParameters`): `Promise`<[`Claim`](../interfaces/cacheServerClient_cacheServerClient_types.Claim.md)[]\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.did` | `string` | -| `__namedParameters.isAccepted?` | `boolean` | -| `__namedParameters.namespace?` | `string` | - -#### Returns - -`Promise`<[`Claim`](../interfaces/cacheServerClient_cacheServerClient_types.Claim.md)[]\> - -#### Implementation of - -[ICacheServerClient](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md).[getClaimsBySubject](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md#getclaimsbysubject) - -___ - -### getClaimsBySubjects - -▸ **getClaimsBySubjects**(`subjects`): `Promise`<[`Claim`](../interfaces/cacheServerClient_cacheServerClient_types.Claim.md)[]\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `subjects` | `string`[] | - -#### Returns - -`Promise`<[`Claim`](../interfaces/cacheServerClient_cacheServerClient_types.Claim.md)[]\> - -#### Implementation of - -[ICacheServerClient](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md).[getClaimsBySubjects](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md#getclaimsbysubjects) - -___ - -### getDIDsForRole - -▸ **getDIDsForRole**(`__namedParameters`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.namespace` | `string` | - -#### Returns - -`Promise`<`string`[]\> - -#### Implementation of - -[ICacheServerClient](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md).[getDIDsForRole](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md#getdidsforrole) - -___ - -### getDidDocument - -▸ **getDidDocument**(`__namedParameters`): `Promise`<`IDIDDocument`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.did` | `string` | -| `__namedParameters.includeClaims?` | `boolean` | - -#### Returns - -`Promise`<`IDIDDocument`\> - -#### Implementation of - -[ICacheServerClient](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md).[getDidDocument](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md#getdiddocument) - -___ - -### getNamespaceBySearchPhrase - -▸ **getNamespaceBySearchPhrase**(`__namedParameters`): `Promise`<([`IOrganization`](../interfaces/cacheServerClient_cacheServerClient_types.IOrganization.md) \| [`IApp`](../interfaces/cacheServerClient_cacheServerClient_types.IApp.md) \| [`IRole`](../interfaces/cacheServerClient_cacheServerClient_types.IRole.md))[]\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.search` | `string` | -| `__namedParameters.types?` | (``"App"`` \| ``"Org"`` \| ``"Role"``)[] | - -#### Returns - -`Promise`<([`IOrganization`](../interfaces/cacheServerClient_cacheServerClient_types.IOrganization.md) \| [`IApp`](../interfaces/cacheServerClient_cacheServerClient_types.IApp.md) \| [`IRole`](../interfaces/cacheServerClient_cacheServerClient_types.IRole.md))[]\> - -#### Implementation of - -[ICacheServerClient](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md).[getNamespaceBySearchPhrase](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md#getnamespacebysearchphrase) - -___ - -### getOfferedAssets - -▸ **getOfferedAssets**(`__namedParameters`): `Promise`<[`Asset`](../interfaces/cacheServerClient_cacheServerClient_types.Asset.md)[]\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.did` | `string` | - -#### Returns - -`Promise`<[`Asset`](../interfaces/cacheServerClient_cacheServerClient_types.Asset.md)[]\> - -#### Implementation of - -[ICacheServerClient](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md).[getOfferedAssets](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md#getofferedassets) - -___ - -### getOrgDefinition - -▸ **getOrgDefinition**(`__namedParameters`): `Promise`<`IOrganizationDefinition`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.namespace` | `string` | - -#### Returns - -`Promise`<`IOrganizationDefinition`\> - -#### Implementation of - -[ICacheServerClient](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md).[getOrgDefinition](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md#getorgdefinition) - -___ - -### getOrgHierarchy - -▸ **getOrgHierarchy**(`__namedParameters`): `Promise`<[`IOrganization`](../interfaces/cacheServerClient_cacheServerClient_types.IOrganization.md)\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.namespace` | `string` | - -#### Returns - -`Promise`<[`IOrganization`](../interfaces/cacheServerClient_cacheServerClient_types.IOrganization.md)\> - -#### Implementation of - -[ICacheServerClient](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md).[getOrgHierarchy](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md#getorghierarchy) - -___ - -### getOrganizationRoles - -▸ **getOrganizationRoles**(`__namedParameters`): `Promise`<[`IRole`](../interfaces/cacheServerClient_cacheServerClient_types.IRole.md)[]\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.namespace` | `string` | - -#### Returns - -`Promise`<[`IRole`](../interfaces/cacheServerClient_cacheServerClient_types.IRole.md)[]\> - -#### Implementation of - -[ICacheServerClient](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md).[getOrganizationRoles](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md#getorganizationroles) - -___ - -### getOrganizationsByOwner - -▸ **getOrganizationsByOwner**(`__namedParameters`): `Promise`<[`IOrganization`](../interfaces/cacheServerClient_cacheServerClient_types.IOrganization.md)[]\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.excludeSubOrgs` | `boolean` | -| `__namedParameters.owner` | `string` | - -#### Returns - -`Promise`<[`IOrganization`](../interfaces/cacheServerClient_cacheServerClient_types.IOrganization.md)[]\> - -#### Implementation of - -[ICacheServerClient](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md).[getOrganizationsByOwner](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md#getorganizationsbyowner) - -___ - -### getOwnedAssets - -▸ **getOwnedAssets**(`__namedParameters`): `Promise`<[`Asset`](../interfaces/cacheServerClient_cacheServerClient_types.Asset.md)[]\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.did` | `string` | - -#### Returns - -`Promise`<[`Asset`](../interfaces/cacheServerClient_cacheServerClient_types.Asset.md)[]\> - -#### Implementation of - -[ICacheServerClient](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md).[getOwnedAssets](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md#getownedassets) - -___ - -### getPreviouslyOwnedAssets - -▸ **getPreviouslyOwnedAssets**(`__namedParameters`): `Promise`<[`Asset`](../interfaces/cacheServerClient_cacheServerClient_types.Asset.md)[]\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.owner` | `string` | - -#### Returns - -`Promise`<[`Asset`](../interfaces/cacheServerClient_cacheServerClient_types.Asset.md)[]\> - -#### Implementation of - -[ICacheServerClient](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md).[getPreviouslyOwnedAssets](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md#getpreviouslyownedassets) - -___ - -### getRoleDefinition - -▸ **getRoleDefinition**(`__namedParameters`): `Promise`<`IRoleDefinition`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.namespace` | `string` | - -#### Returns - -`Promise`<`IRoleDefinition`\> - -#### Implementation of - -[ICacheServerClient](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md).[getRoleDefinition](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md#getroledefinition) - -___ - -### getRolesByOwner - -▸ **getRolesByOwner**(`__namedParameters`): `Promise`<[`IRole`](../interfaces/cacheServerClient_cacheServerClient_types.IRole.md)[]\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.owner` | `string` | - -#### Returns - -`Promise`<[`IRole`](../interfaces/cacheServerClient_cacheServerClient_types.IRole.md)[]\> - -#### Implementation of - -[ICacheServerClient](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md).[getRolesByOwner](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md#getrolesbyowner) - -___ - -### getSubOrganizationsByOrganization - -▸ **getSubOrganizationsByOrganization**(`__namedParameters`): `Promise`<[`IOrganization`](../interfaces/cacheServerClient_cacheServerClient_types.IOrganization.md)[]\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.namespace` | `string` | - -#### Returns - -`Promise`<[`IOrganization`](../interfaces/cacheServerClient_cacheServerClient_types.IOrganization.md)[]\> - -#### Implementation of - -[ICacheServerClient](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md).[getSubOrganizationsByOrganization](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md#getsuborganizationsbyorganization) - -___ - -### handleRefreshToken - -▸ **handleRefreshToken**(): `Promise`<`void`\> - -#### Returns - -`Promise`<`void`\> - -___ - -### handleUnauthorized - -▸ **handleUnauthorized**(`error`): `Promise`<`unknown`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `error` | `AxiosError`<`any`\> | - -#### Returns - -`Promise`<`unknown`\> - -___ - -### isAuthEnabled - -▸ **isAuthEnabled**(): `boolean` - -#### Returns - -`boolean` - -#### Implementation of - -[ICacheServerClient](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md).[isAuthEnabled](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md#isauthenabled) - -___ - -### issueClaim - -▸ **issueClaim**(`__namedParameters`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.did` | `string` | -| `__namedParameters.message` | [`IClaimIssuance`](../interfaces/iam.IClaimIssuance.md) | - -#### Returns - -`Promise`<`void`\> - -#### Implementation of - -[ICacheServerClient](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md).[issueClaim](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md#issueclaim) - -___ - -### login - -▸ **login**(): `Promise`<`Object`\> - -#### Returns - -`Promise`<`Object`\> - -#### Implementation of - -[ICacheServerClient](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md).[login](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md#login) - -___ - -### rejectClaim - -▸ **rejectClaim**(`__namedParameters`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.did` | `string` | -| `__namedParameters.message` | [`IClaimRejection`](../interfaces/iam.IClaimRejection.md) | - -#### Returns - -`Promise`<`void`\> - -#### Implementation of - -[ICacheServerClient](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md).[rejectClaim](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md#rejectclaim) - -___ - -### requestClaim - -▸ **requestClaim**(`__namedParameters`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.did` | `string` | -| `__namedParameters.message` | [`IClaimRequest`](../interfaces/iam.IClaimRequest.md) | - -#### Returns - -`Promise`<`void`\> - -#### Implementation of - -[ICacheServerClient](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md).[requestClaim](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md#requestclaim) - -___ - -### testLogin - -▸ **testLogin**(): `Promise`<`void`\> - -#### Returns - -`Promise`<`void`\> - -#### Implementation of - -[ICacheServerClient](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md).[testLogin](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md#testlogin) diff --git a/docs/api/classes/errors_CacheClientNotProvided.CacheClientNotProvidedError.md b/docs/api/classes/errors_CacheClientNotProvided.CacheClientNotProvidedError.md deleted file mode 100644 index 2a9de051..00000000 --- a/docs/api/classes/errors_CacheClientNotProvided.CacheClientNotProvidedError.md +++ /dev/null @@ -1,25 +0,0 @@ -# Class: CacheClientNotProvidedError - -[errors/CacheClientNotProvided](../modules/errors_CacheClientNotProvided.md).CacheClientNotProvidedError - -## Hierarchy - -- `Error` - - ↳ **`CacheClientNotProvidedError`** - -## Table of contents - -### Constructors - -- [constructor](errors_CacheClientNotProvided.CacheClientNotProvidedError.md#constructor) - -## Constructors - -### constructor - -• **new CacheClientNotProvidedError**() - -#### Overrides - -Error.constructor diff --git a/docs/api/classes/errors_ENSRegistryNotInitializedError.ENSRegistryNotInitializedError.md b/docs/api/classes/errors_ENSRegistryNotInitializedError.ENSRegistryNotInitializedError.md deleted file mode 100644 index 67b07471..00000000 --- a/docs/api/classes/errors_ENSRegistryNotInitializedError.ENSRegistryNotInitializedError.md +++ /dev/null @@ -1,25 +0,0 @@ -# Class: ENSRegistryNotInitializedError - -[errors/ENSRegistryNotInitializedError](../modules/errors_ENSRegistryNotInitializedError.md).ENSRegistryNotInitializedError - -## Hierarchy - -- `Error` - - ↳ **`ENSRegistryNotInitializedError`** - -## Table of contents - -### Constructors - -- [constructor](errors_ENSRegistryNotInitializedError.ENSRegistryNotInitializedError.md#constructor) - -## Constructors - -### constructor - -• **new ENSRegistryNotInitializedError**() - -#### Overrides - -Error.constructor diff --git a/docs/api/classes/errors_ENSResolverNotInitializedError.ENSResolverNotInitializedError.md b/docs/api/classes/errors_ENSResolverNotInitializedError.ENSResolverNotInitializedError.md deleted file mode 100644 index ee3d266a..00000000 --- a/docs/api/classes/errors_ENSResolverNotInitializedError.ENSResolverNotInitializedError.md +++ /dev/null @@ -1,25 +0,0 @@ -# Class: ENSResolverNotInitializedError - -[errors/ENSResolverNotInitializedError](../modules/errors_ENSResolverNotInitializedError.md).ENSResolverNotInitializedError - -## Hierarchy - -- `Error` - - ↳ **`ENSResolverNotInitializedError`** - -## Table of contents - -### Constructors - -- [constructor](errors_ENSResolverNotInitializedError.ENSResolverNotInitializedError.md#constructor) - -## Constructors - -### constructor - -• **new ENSResolverNotInitializedError**() - -#### Overrides - -Error.constructor diff --git a/docs/api/classes/errors_ENSTypeNOtSupportedError.ENSTypeNotSupportedError.md b/docs/api/classes/errors_ENSTypeNotSupportedError.ENSTypeNotSupportedError.md similarity index 71% rename from docs/api/classes/errors_ENSTypeNOtSupportedError.ENSTypeNotSupportedError.md rename to docs/api/classes/errors_ENSTypeNotSupportedError.ENSTypeNotSupportedError.md index 523861d2..7ab3dea8 100644 --- a/docs/api/classes/errors_ENSTypeNOtSupportedError.ENSTypeNotSupportedError.md +++ b/docs/api/classes/errors_ENSTypeNotSupportedError.ENSTypeNotSupportedError.md @@ -1,6 +1,6 @@ # Class: ENSTypeNotSupportedError -[errors/ENSTypeNOtSupportedError](../modules/errors_ENSTypeNOtSupportedError.md).ENSTypeNotSupportedError +[errors/ENSTypeNotSupportedError](../modules/errors_ENSTypeNotSupportedError.md).ENSTypeNotSupportedError ## Hierarchy @@ -12,7 +12,7 @@ ### Constructors -- [constructor](errors_ENSTypeNOtSupportedError.ENSTypeNotSupportedError.md#constructor) +- [constructor](errors_ENSTypeNotSupportedError.ENSTypeNotSupportedError.md#constructor) ## Constructors diff --git a/docs/api/classes/errors_NatsConnectionNotEstablishedError.NATSConnectionNotEstablishedError.md b/docs/api/classes/errors_NatsConnectionNotEstablishedError.NATSConnectionNotEstablishedError.md deleted file mode 100644 index 61ecabcb..00000000 --- a/docs/api/classes/errors_NatsConnectionNotEstablishedError.NATSConnectionNotEstablishedError.md +++ /dev/null @@ -1,25 +0,0 @@ -# Class: NATSConnectionNotEstablishedError - -[errors/NatsConnectionNotEstablishedError](../modules/errors_NatsConnectionNotEstablishedError.md).NATSConnectionNotEstablishedError - -## Hierarchy - -- `Error` - - ↳ **`NATSConnectionNotEstablishedError`** - -## Table of contents - -### Constructors - -- [constructor](errors_NatsConnectionNotEstablishedError.NATSConnectionNotEstablishedError.md#constructor) - -## Constructors - -### constructor - -• **new NATSConnectionNotEstablishedError**() - -#### Overrides - -Error.constructor diff --git a/docs/api/classes/iam.IAM.md b/docs/api/classes/iam.IAM.md deleted file mode 100644 index 495d71f6..00000000 --- a/docs/api/classes/iam.IAM.md +++ /dev/null @@ -1,1467 +0,0 @@ -# Class: IAM - -[iam](../modules/iam.md).IAM - -Decentralized Identity and Access Management (IAM) Type - -## Hierarchy - -- [`IAMBase`](iam_iam_base.IAMBase.md) - - ↳ **`IAM`** - - ↳↳ [`GnosisIam`](GnosisIam.GnosisIam-1.md) - -## Table of contents - -### Constructors - -- [constructor](iam.IAM.md#constructor) - -### Accessors - -- [address](iam.IAM.md#address) - -### Methods - -- [acceptAssetOffer](iam.IAM.md#acceptassetoffer) -- [cancelAssetOffer](iam.IAM.md#cancelassetoffer) -- [changeAppOwnership](iam.IAM.md#changeappownership) -- [changeOrgOwnership](iam.IAM.md#changeorgownership) -- [changeRoleOwnership](iam.IAM.md#changeroleownership) -- [checkExistenceOfDomain](iam.IAM.md#checkexistenceofdomain) -- [closeConnection](iam.IAM.md#closeconnection) -- [connectToCacheServer](iam.IAM.md#connecttocacheserver) -- [connectToDIDRegistry](iam.IAM.md#connecttodidregistry) -- [createApplication](iam.IAM.md#createapplication) -- [createClaimRequest](iam.IAM.md#createclaimrequest) -- [createIdentityProof](iam.IAM.md#createidentityproof) -- [createOrganization](iam.IAM.md#createorganization) -- [createProofClaim](iam.IAM.md#createproofclaim) -- [createPublicClaim](iam.IAM.md#createpublicclaim) -- [createRole](iam.IAM.md#createrole) -- [createSelfSignedClaim](iam.IAM.md#createselfsignedclaim) -- [decodeJWTToken](iam.IAM.md#decodejwttoken) -- [deleteApplication](iam.IAM.md#deleteapplication) -- [deleteClaim](iam.IAM.md#deleteclaim) -- [deleteOrganization](iam.IAM.md#deleteorganization) -- [deleteRole](iam.IAM.md#deleterole) -- [getAppsByOrgNamespace](iam.IAM.md#getappsbyorgnamespace) -- [getAssetById](iam.IAM.md#getassetbyid) -- [getAssetHistory](iam.IAM.md#getassethistory) -- [getClaimsByIssuer](iam.IAM.md#getclaimsbyissuer) -- [getClaimsByRequester](iam.IAM.md#getclaimsbyrequester) -- [getClaimsBySubject](iam.IAM.md#getclaimsbysubject) -- [getClaimsBySubjects](iam.IAM.md#getclaimsbysubjects) -- [getDefinition](iam.IAM.md#getdefinition) -- [getDid](iam.IAM.md#getdid) -- [getDidDocument](iam.IAM.md#getdiddocument) -- [getENSTypesByOwner](iam.IAM.md#getenstypesbyowner) -- [getENSTypesBySearchPhrase](iam.IAM.md#getenstypesbysearchphrase) -- [getOfferedAssets](iam.IAM.md#getofferedassets) -- [getOrgHierarchy](iam.IAM.md#getorghierarchy) -- [getOwnedAssets](iam.IAM.md#getownedassets) -- [getPreviouslyOwnedAssets](iam.IAM.md#getpreviouslyownedassets) -- [getProviderType](iam.IAM.md#getprovidertype) -- [getRoleDIDs](iam.IAM.md#getroledids) -- [getRolesByNamespace](iam.IAM.md#getrolesbynamespace) -- [getSigner](iam.IAM.md#getsigner) -- [getSubOrgsByOrgNamespace](iam.IAM.md#getsuborgsbyorgnamespace) -- [getSubdomains](iam.IAM.md#getsubdomains) -- [getUserClaims](iam.IAM.md#getuserclaims) -- [initializeConnection](iam.IAM.md#initializeconnection) -- [isConnected](iam.IAM.md#isconnected) -- [isOwner](iam.IAM.md#isowner) -- [isSessionActive](iam.IAM.md#issessionactive) -- [issueClaimRequest](iam.IAM.md#issueclaimrequest) -- [issuePublicClaim](iam.IAM.md#issuepublicclaim) -- [namespacesWithRelations](iam.IAM.md#namespaceswithrelations) -- [offerAsset](iam.IAM.md#offerasset) -- [on](iam.IAM.md#on) -- [publishPublicClaim](iam.IAM.md#publishpublicclaim) -- [registerAsset](iam.IAM.md#registerasset) -- [registrationTypesOfRoles](iam.IAM.md#registrationtypesofroles) -- [rejectAssetOffer](iam.IAM.md#rejectassetoffer) -- [rejectClaimRequest](iam.IAM.md#rejectclaimrequest) -- [revokeDidDocument](iam.IAM.md#revokediddocument) -- [setRoleDefinition](iam.IAM.md#setroledefinition) -- [subscribeTo](iam.IAM.md#subscribeto) -- [unsubscribeFrom](iam.IAM.md#unsubscribefrom) -- [updateDidDocument](iam.IAM.md#updatediddocument) -- [validateOwnership](iam.IAM.md#validateownership) -- [verifyPublicClaim](iam.IAM.md#verifypublicclaim) -- [isMetamaskExtensionPresent](iam.IAM.md#ismetamaskextensionpresent) - -## Constructors - -### constructor - -• **new IAM**(`__namedParameters?`) - -IAM Constructor - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`ConnectionOptions`](../modules/iam_iam_base.md#connectionoptions) | - -#### Inherited from - -[IAMBase](iam_iam_base.IAMBase.md).[constructor](iam_iam_base.IAMBase.md#constructor) - -## Accessors - -### address - -• `get` **address**(): `undefined` \| `string` - -#### Returns - -`undefined` \| `string` - -## Methods - -### acceptAssetOffer - -▸ **acceptAssetOffer**(`__namedParameters`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.assetDID` | `string` | - -#### Returns - -`Promise`<`void`\> - -___ - -### cancelAssetOffer - -▸ **cancelAssetOffer**(`__namedParameters`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.assetDID` | `string` | - -#### Returns - -`Promise`<`void`\> - -___ - -### changeAppOwnership - -▸ **changeAppOwnership**(`__namedParameters`): `Promise`<{ `info`: `string` ; `next`: (`__namedParameters`: { `retryCheck?`: `boolean` }) => `Promise`<`void`\> ; `tx`: [`EncodedCall`](../modules/iam_iam_base.md#encodedcall) }[]\> - -changeAppOwnership - -**`description`** change owner ship of app subdomain and all app owned subdomains - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.namespace` | `string` | -| `__namedParameters.newOwner` | `string` | -| `__namedParameters.returnSteps?` | `boolean` | - -#### Returns - -`Promise`<{ `info`: `string` ; `next`: (`__namedParameters`: { `retryCheck?`: `boolean` }) => `Promise`<`void`\> ; `tx`: [`EncodedCall`](../modules/iam_iam_base.md#encodedcall) }[]\> - -return array of steps needed to change ownership - -___ - -### changeOrgOwnership - -▸ **changeOrgOwnership**(`__namedParameters`): `Promise`<{ `info`: `string` ; `next`: (`__namedParameters`: { `retryCheck?`: `boolean` }) => `Promise`<`void`\> ; `tx`: [`EncodedCall`](../modules/iam_iam_base.md#encodedcall) }[]\> - -changeOrgOwnership - -**`description`** change owner ship of org subdomain and all org owned roles subdomains - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.namespace` | `string` | -| `__namedParameters.newOwner` | `string` | -| `__namedParameters.returnSteps?` | `boolean` | - -#### Returns - -`Promise`<{ `info`: `string` ; `next`: (`__namedParameters`: { `retryCheck?`: `boolean` }) => `Promise`<`void`\> ; `tx`: [`EncodedCall`](../modules/iam_iam_base.md#encodedcall) }[]\> - -return array of steps needed to change ownership - -___ - -### changeRoleOwnership - -▸ **changeRoleOwnership**(`__namedParameters`): `Promise`<`void`\> - -changeRoleOwnership - -**`description`** change ownership of role subdomain - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.namespace` | `string` | -| `__namedParameters.newOwner` | `string` | - -#### Returns - -`Promise`<`void`\> - -___ - -### checkExistenceOfDomain - -▸ **checkExistenceOfDomain**(`__namedParameters`): `Promise`<`boolean`\> - -checkExistenceOfDomain - -**`description`** check existence of domain in ENS registry - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.domain` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true or false whatever the domain is present - -___ - -### closeConnection - -▸ **closeConnection**(): `Promise`<`void`\> - -**`description`** Closes the connection between application and the signer's wallet - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[IAMBase](iam_iam_base.IAMBase.md).[closeConnection](iam_iam_base.IAMBase.md#closeconnection) - -___ - -### connectToCacheServer - -▸ **connectToCacheServer**(): `Promise`<`void`\> - -**`description`** Establishes connection to the cache serverand sets public key and identity token - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[IAMBase](iam_iam_base.IAMBase.md).[connectToCacheServer](iam_iam_base.IAMBase.md#connecttocacheserver) - -___ - -### connectToDIDRegistry - -▸ **connectToDIDRegistry**(): `Promise`<`void`\> - -**`description`** Creates the signer's DID document if it does not exist - -#### Returns - -`Promise`<`void`\> - -#### Inherited from - -[IAMBase](iam_iam_base.IAMBase.md).[connectToDIDRegistry](iam_iam_base.IAMBase.md#connecttodidregistry) - -___ - -### createApplication - -▸ **createApplication**(`__namedParameters`): `Promise`<{ `info`: `string` = "Set subdomain for application"; `next`: () => `Promise`<`void`\> ; `tx`: [`EncodedCall`](../modules/iam_iam_base.md#encodedcall) }[]\> - -createApp - -**`description`** creates role (create subdomain, sets the domain name and sets the role definition to metadata record in ENS Domain) - -**`description`** creates roles subdomain for the app namespace - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.appName` | `string` | -| `__namedParameters.data` | `IAppDefinition` | -| `__namedParameters.namespace` | `string` | -| `__namedParameters.returnSteps?` | `boolean` | - -#### Returns - -`Promise`<{ `info`: `string` = "Set subdomain for application"; `next`: () => `Promise`<`void`\> ; `tx`: [`EncodedCall`](../modules/iam_iam_base.md#encodedcall) }[]\> - -___ - -### createClaimRequest - -▸ **createClaimRequest**(`__namedParameters`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.claim` | `Object` | -| `__namedParameters.claim.claimType` | `string` | -| `__namedParameters.claim.claimTypeVersion` | `number` | -| `__namedParameters.claim.fields` | { `key`: `string` ; `value`: `string` \| `number` }[] | -| `__namedParameters.registrationTypes?` | [`RegistrationTypes`](../enums/cacheServerClient_cacheServerClient_types.RegistrationTypes.md)[] | -| `__namedParameters.subject?` | `string` | - -#### Returns - -`Promise`<`void`\> - -___ - -### createIdentityProof - -▸ **createIdentityProof**(): `Promise`<`string`\> - -#### Returns - -`Promise`<`string`\> - -___ - -### createOrganization - -▸ **createOrganization**(`__namedParameters`): `Promise`<{ `info`: `string` = "Create organization subdomain"; `next`: () => `Promise`<`void`\> ; `tx`: [`EncodedCall`](../modules/iam_iam_base.md#encodedcall) }[]\> - -createOrganization - -**`description`** creates organization (create subdomain, sets the domain name and sets the role definition to metadata record in ENS Domain) - -**`description`** and sets subdomain for roles and app for org namespace - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.data` | `IOrganizationDefinition` | -| `__namedParameters.namespace` | `string` | -| `__namedParameters.orgName` | `string` | -| `__namedParameters.returnSteps?` | `boolean` | - -#### Returns - -`Promise`<{ `info`: `string` = "Create organization subdomain"; `next`: () => `Promise`<`void`\> ; `tx`: [`EncodedCall`](../modules/iam_iam_base.md#encodedcall) }[]\> - -___ - -### createProofClaim - -▸ **createProofClaim**(`__namedParameters`): `Promise`<`string`\> - -createProofClaim - -**`description`** creates a proof of a claim - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.claimUrl` | `string` | -| `__namedParameters.saltedFields` | `ISaltedFields` | - -#### Returns - -`Promise`<`string`\> - -proof token - -___ - -### createPublicClaim - -▸ **createPublicClaim**(`__namedParameters`): `Promise`<`string`\> - -createPublicClaim - -**`description`** create a public claim based on data provided - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.data` | [`ClaimData`](../interfaces/cacheServerClient_cacheServerClient_types.ClaimData.md) | -| `__namedParameters.subject?` | `string` | - -#### Returns - -`Promise`<`string`\> - -JWT token of created claim - -___ - -### createRole - -▸ **createRole**(`__namedParameters`): `Promise`<{ `info`: `string` = "Create subdomain for role"; `next`: () => `Promise`<`void`\> ; `tx`: [`EncodedCall`](../modules/iam_iam_base.md#encodedcall) }[]\> - -createRole - -**`description`** creates role (create subdomain, sets the domain name and sets the role definition to metadata record in ENS Domain) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.data` | `IRoleDefinition` | -| `__namedParameters.namespace` | `string` | -| `__namedParameters.returnSteps?` | `boolean` | -| `__namedParameters.roleName` | `string` | - -#### Returns - -`Promise`<{ `info`: `string` = "Create subdomain for role"; `next`: () => `Promise`<`void`\> ; `tx`: [`EncodedCall`](../modules/iam_iam_base.md#encodedcall) }[]\> - -information (true/false) if the role was created - -___ - -### createSelfSignedClaim - -▸ **createSelfSignedClaim**(`__namedParameters`): `Promise`<`string`\> - -createSelfSignedClaim - -**`description`** creates self signed claim and upload the data to ipfs - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.data` | [`ClaimData`](../interfaces/cacheServerClient_cacheServerClient_types.ClaimData.md) | -| `__namedParameters.subject?` | `string` | - -#### Returns - -`Promise`<`string`\> - -___ - -### decodeJWTToken - -▸ **decodeJWTToken**(`__namedParameters`): `Promise`<`string` \| { [key: string]: `string` \| `object`; }\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.token` | `string` | - -#### Returns - -`Promise`<`string` \| { [key: string]: `string` \| `object`; }\> - -___ - -### deleteApplication - -▸ **deleteApplication**(`__namedParameters`): `Promise`<{ `info`: `string` ; `next`: (`__namedParameters`: { `retryCheck?`: `boolean` }) => `Promise`<`void`\> ; `tx`: [`EncodedCall`](../modules/iam_iam_base.md#encodedcall) }[]\> - -deleteApplication - -**`description`** delete application and roles - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.namespace` | `string` | -| `__namedParameters.returnSteps?` | `boolean` | - -#### Returns - -`Promise`<{ `info`: `string` ; `next`: (`__namedParameters`: { `retryCheck?`: `boolean` }) => `Promise`<`void`\> ; `tx`: [`EncodedCall`](../modules/iam_iam_base.md#encodedcall) }[]\> - -___ - -### deleteClaim - -▸ **deleteClaim**(`__namedParameters`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.id` | `string` | - -#### Returns - -`Promise`<`void`\> - -___ - -### deleteOrganization - -▸ **deleteOrganization**(`__namedParameters`): `Promise`<{ `info`: `string` ; `next`: (`__namedParameters`: { `retryCheck?`: `boolean` }) => `Promise`<`void`\> ; `tx`: [`EncodedCall`](../modules/iam_iam_base.md#encodedcall) }[]\> - -deleteOrganization - -**`description`** delete organization and roles - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.namespace` | `string` | -| `__namedParameters.returnSteps?` | `boolean` | - -#### Returns - -`Promise`<{ `info`: `string` ; `next`: (`__namedParameters`: { `retryCheck?`: `boolean` }) => `Promise`<`void`\> ; `tx`: [`EncodedCall`](../modules/iam_iam_base.md#encodedcall) }[]\> - -___ - -### deleteRole - -▸ **deleteRole**(`__namedParameters`): `Promise`<`void`\> - -deleteRole - -**`description`** delete role - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.namespace` | `string` | - -#### Returns - -`Promise`<`void`\> - -___ - -### getAppsByOrgNamespace - -▸ **getAppsByOrgNamespace**(`__namedParameters`): `Promise`<[`IApp`](../interfaces/cacheServerClient_cacheServerClient_types.IApp.md)[]\> - -getENSTypesByOwner - -**`description`** get all applications for organization namespace - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.namespace` | `string` | - -#### Returns - -`Promise`<[`IApp`](../interfaces/cacheServerClient_cacheServerClient_types.IApp.md)[]\> - -array of subdomains or empty array when there is no subdomains - -___ - -### getAssetById - -▸ **getAssetById**(`__namedParameters`): `Promise`<[`Asset`](../interfaces/cacheServerClient_cacheServerClient_types.Asset.md)\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.id` | `string` | - -#### Returns - -`Promise`<[`Asset`](../interfaces/cacheServerClient_cacheServerClient_types.Asset.md)\> - -___ - -### getAssetHistory - -▸ **getAssetHistory**(`__namedParameters`): `Promise`<[`AssetHistory`](../interfaces/cacheServerClient_cacheServerClient_types.AssetHistory.md)[]\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.id` | `string` | -| `__namedParameters.order?` | [`Order`](../enums/cacheServerClient_cacheServerClient_types.Order.md) | -| `__namedParameters.skip?` | `number` | -| `__namedParameters.take?` | `number` | -| `__namedParameters.type?` | [`AssetHistoryEventType`](../enums/cacheServerClient_cacheServerClient_types.AssetHistoryEventType.md) | - -#### Returns - -`Promise`<[`AssetHistory`](../interfaces/cacheServerClient_cacheServerClient_types.AssetHistory.md)[]\> - -___ - -### getClaimsByIssuer - -▸ **getClaimsByIssuer**(`__namedParameters`): `Promise`<[`Claim`](../interfaces/cacheServerClient_cacheServerClient_types.Claim.md)[]\> - -**`description`** - Returns claims for given issuer. Allows filtering by status and parent namespace - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.did` | `string` | -| `__namedParameters.isAccepted?` | `boolean` | -| `__namedParameters.parentNamespace?` | `string` | - -#### Returns - -`Promise`<[`Claim`](../interfaces/cacheServerClient_cacheServerClient_types.Claim.md)[]\> - -___ - -### getClaimsByRequester - -▸ **getClaimsByRequester**(`__namedParameters`): `Promise`<[`Claim`](../interfaces/cacheServerClient_cacheServerClient_types.Claim.md)[]\> - -**`description`** - Returns claims for given requester. Allows filtering by status and parent namespace - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.did` | `string` | -| `__namedParameters.isAccepted?` | `boolean` | -| `__namedParameters.parentNamespace?` | `string` | - -#### Returns - -`Promise`<[`Claim`](../interfaces/cacheServerClient_cacheServerClient_types.Claim.md)[]\> - -___ - -### getClaimsBySubject - -▸ **getClaimsBySubject**(`__namedParameters`): `Promise`<[`Claim`](../interfaces/cacheServerClient_cacheServerClient_types.Claim.md)[]\> - -**`description`** - Returns claims for given subject. Allows filtering by status and parent namespace - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.did` | `string` | -| `__namedParameters.isAccepted?` | `boolean` | -| `__namedParameters.parentNamespace?` | `string` | - -#### Returns - -`Promise`<[`Claim`](../interfaces/cacheServerClient_cacheServerClient_types.Claim.md)[]\> - -___ - -### getClaimsBySubjects - -▸ **getClaimsBySubjects**(`subjects`): `Promise`<[`Claim`](../interfaces/cacheServerClient_cacheServerClient_types.Claim.md)[]\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `subjects` | `string`[] | - -#### Returns - -`Promise`<[`Claim`](../interfaces/cacheServerClient_cacheServerClient_types.Claim.md)[]\> - -___ - -### getDefinition - -▸ **getDefinition**(`__namedParameters`): `Promise`<`IRoleDefinition` \| `IAppDefinition` \| `IOrganizationDefinition`\> - -getRoleDefinition - -**`description`** get role definition form ens domain metadata record - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.namespace` | `string` | -| `__namedParameters.type` | [`ENSNamespaceTypes`](../enums/iam.ENSNamespaceTypes.md) | - -#### Returns - -`Promise`<`IRoleDefinition` \| `IAppDefinition` \| `IOrganizationDefinition`\> - -metadata string or empty string when there is no metadata - -___ - -### getDid - -▸ **getDid**(): `undefined` \| `string` - -Get DID - -#### Returns - -`undefined` \| `string` - -did string if connected to wallet, if not returns undefined - -___ - -### getDidDocument - -▸ **getDidDocument**(`__namedParameters?`): `Promise`<`Object`\> - -getDidDocument - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `undefined` \| { `did?`: `string` ; `includeClaims?`: `boolean` } | - -#### Returns - -`Promise`<`Object`\> - -whole did document if connected, if not returns null - -___ - -### getENSTypesByOwner - -▸ **getENSTypesByOwner**(`__namedParameters`): `Promise`<[`IOrganization`](../interfaces/cacheServerClient_cacheServerClient_types.IOrganization.md)[]\> \| `Promise`<[`IApp`](../interfaces/cacheServerClient_cacheServerClient_types.IApp.md)[]\> \| `Promise`<[`IRole`](../interfaces/cacheServerClient_cacheServerClient_types.IRole.md)[]\> - -getENSTypesByOwner - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.excludeSubOrgs?` | `boolean` | -| `__namedParameters.owner` | `string` | -| `__namedParameters.type` | [`ENSNamespaceTypes`](../enums/iam.ENSNamespaceTypes.md) | - -#### Returns - -`Promise`<[`IOrganization`](../interfaces/cacheServerClient_cacheServerClient_types.IOrganization.md)[]\> \| `Promise`<[`IApp`](../interfaces/cacheServerClient_cacheServerClient_types.IApp.md)[]\> \| `Promise`<[`IRole`](../interfaces/cacheServerClient_cacheServerClient_types.IRole.md)[]\> - -___ - -### getENSTypesBySearchPhrase - -▸ **getENSTypesBySearchPhrase**(`__namedParameters`): `Promise`<([`IOrganization`](../interfaces/cacheServerClient_cacheServerClient_types.IOrganization.md) \| [`IApp`](../interfaces/cacheServerClient_cacheServerClient_types.IApp.md) \| [`IRole`](../interfaces/cacheServerClient_cacheServerClient_types.IRole.md))[]\> - -getENSTypesBySearchPhrase - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.search` | `string` | -| `__namedParameters.types?` | (``"App"`` \| ``"Org"`` \| ``"Role"``)[] | - -#### Returns - -`Promise`<([`IOrganization`](../interfaces/cacheServerClient_cacheServerClient_types.IOrganization.md) \| [`IApp`](../interfaces/cacheServerClient_cacheServerClient_types.IApp.md) \| [`IRole`](../interfaces/cacheServerClient_cacheServerClient_types.IRole.md))[]\> - -___ - -### getOfferedAssets - -▸ **getOfferedAssets**(`__namedParameters?`): `Promise`<[`Asset`](../interfaces/cacheServerClient_cacheServerClient_types.Asset.md)[]\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.did?` | `string` | - -#### Returns - -`Promise`<[`Asset`](../interfaces/cacheServerClient_cacheServerClient_types.Asset.md)[]\> - -___ - -### getOrgHierarchy - -▸ **getOrgHierarchy**(`__namedParameters`): `Promise`<[`IOrganization`](../interfaces/cacheServerClient_cacheServerClient_types.IOrganization.md)\> - -getOrgHierarchy - -**`description`** get all hierarchy of an organization (20 levels deep) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.namespace` | `string` | - -#### Returns - -`Promise`<[`IOrganization`](../interfaces/cacheServerClient_cacheServerClient_types.IOrganization.md)\> - -organization with all nested subOrgs - -___ - -### getOwnedAssets - -▸ **getOwnedAssets**(`__namedParameters?`): `Promise`<[`Asset`](../interfaces/cacheServerClient_cacheServerClient_types.Asset.md)[]\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.did?` | `string` | - -#### Returns - -`Promise`<[`Asset`](../interfaces/cacheServerClient_cacheServerClient_types.Asset.md)[]\> - -___ - -### getPreviouslyOwnedAssets - -▸ **getPreviouslyOwnedAssets**(`__namedParameters`): `Promise`<[`Asset`](../interfaces/cacheServerClient_cacheServerClient_types.Asset.md)[]\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.owner` | `string` | - -#### Returns - -`Promise`<[`Asset`](../interfaces/cacheServerClient_cacheServerClient_types.Asset.md)[]\> - -___ - -### getProviderType - -▸ **getProviderType**(): `undefined` \| [`WalletProvider`](../enums/types_WalletProvider.WalletProvider.md) - -Get the current initialized provider type - -#### Returns - -`undefined` \| [`WalletProvider`](../enums/types_WalletProvider.WalletProvider.md) - -provider type if the session is active if not undefined - -___ - -### getRoleDIDs - -▸ **getRoleDIDs**(`__namedParameters`): `Promise`<`string`[]\> - -getRoleDIDs - -**`description`** get all users did which have certain role - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.namespace` | `string` | - -#### Returns - -`Promise`<`string`[]\> - -array of did's - -___ - -### getRolesByNamespace - -▸ **getRolesByNamespace**(`__namedParameters`): `Promise`<[`IRole`](../interfaces/cacheServerClient_cacheServerClient_types.IRole.md)[]\> - -getRolesByNamespace - -**`description`** get all subdomains for certain domain - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.namespace` | `string` | -| `__namedParameters.parentType` | [`Application`](../enums/iam.ENSNamespaceTypes.md#application) \| [`Organization`](../enums/iam.ENSNamespaceTypes.md#organization) | - -#### Returns - -`Promise`<[`IRole`](../interfaces/cacheServerClient_cacheServerClient_types.IRole.md)[]\> - -array of subdomains or empty array when there is no subdomains - -___ - -### getSigner - -▸ **getSigner**(): `undefined` \| `JsonRpcSigner` \| `Signer` - -Get signer - -#### Returns - -`undefined` \| `JsonRpcSigner` \| `Signer` - -JsonRpcSigner if connected to wallet, if not returns undefined - -___ - -### getSubOrgsByOrgNamespace - -▸ **getSubOrgsByOrgNamespace**(`__namedParameters`): `Promise`<[`IOrganization`](../interfaces/cacheServerClient_cacheServerClient_types.IOrganization.md)[]\> - -getSubOrgsByOrgNamespace - -**`description`** get all sub organizations for organization namespace - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.namespace` | `string` | - -#### Returns - -`Promise`<[`IOrganization`](../interfaces/cacheServerClient_cacheServerClient_types.IOrganization.md)[]\> - -array of subdomains or empty array when there is no subdomains - -___ - -### getSubdomains - -▸ **getSubdomains**(`__namedParameters`): `Promise`<`string`[]\> - -getSubdomains - -**`description`** get all subdomains for certain domain - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.domain` | `string` | -| `__namedParameters.mode?` | ``"ALL"`` \| ``"FIRSTLEVEL"`` | - -#### Returns - -`Promise`<`string`[]\> - -array of subdomains or empty array when there is no subdomains - -___ - -### getUserClaims - -▸ **getUserClaims**(`__namedParameters?`): `Promise`<`IServiceEndpoint` & [`ClaimData`](../interfaces/cacheServerClient_cacheServerClient_types.ClaimData.md)[]\> - -getUserClaims - -**`description`** get user claims - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `undefined` \| { `did?`: `string` } | - -#### Returns - -`Promise`<`IServiceEndpoint` & [`ClaimData`](../interfaces/cacheServerClient_cacheServerClient_types.ClaimData.md)[]\> - -___ - -### initializeConnection - -▸ **initializeConnection**(`__namedParameters?`): `Promise`<[`InitializeData`](../modules/iam.md#initializedata)\> - -Initialize connection to wallet - -**`description`** creates web3 provider and establishes secure connection to selected wallet - -**`summary`** if not connected to wallet will show connection modal, but if already connected (data stored in localStorage) will only return initial data without showing modal - -**`requires`** needs to be called before any of other methods - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.createDocument?` | `boolean` | -| `__namedParameters.initCacheServer?` | `boolean` | -| `__namedParameters.reinitializeMetamask?` | `boolean` | -| `__namedParameters.walletProvider?` | [`WalletProvider`](../enums/types_WalletProvider.WalletProvider.md) | - -#### Returns - -`Promise`<[`InitializeData`](../modules/iam.md#initializedata)\> - -did string, status of connection and info if the user closed the wallet selection modal - -___ - -### isConnected - -▸ **isConnected**(): `boolean` - -isConnected - -#### Returns - -`boolean` - -info if the connection to wallet/signer is already established - -___ - -### isOwner - -▸ **isOwner**(`__namedParameters`): `Promise`<`boolean`\> - -isOwner - -**`description`** check ownership of the domain - -**`default`** if user is not specified it will check the current logged user - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.domain` | `string` | -| `__namedParameters.user?` | `string` | - -#### Returns - -`Promise`<`boolean`\> - -true or false whatever the passed is user is a owner of domain - -___ - -### isSessionActive - -▸ **isSessionActive**(): `boolean` - -**`description`** Checks if the session is active - -#### Returns - -`boolean` - -boolean that indicates the session state - -#### Inherited from - -[IAMBase](iam_iam_base.IAMBase.md).[isSessionActive](iam_iam_base.IAMBase.md#issessionactive) - -___ - -### issueClaimRequest - -▸ **issueClaimRequest**(`__namedParameters`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.id` | `string` | -| `__namedParameters.registrationTypes` | [`RegistrationTypes`](../enums/cacheServerClient_cacheServerClient_types.RegistrationTypes.md)[] | -| `__namedParameters.requester` | `string` | -| `__namedParameters.subjectAgreement` | `string` | -| `__namedParameters.token` | `string` | - -#### Returns - -`Promise`<`void`\> - -___ - -### issuePublicClaim - -▸ **issuePublicClaim**(`__namedParameters`): `Promise`<`string`\> - -issuePublicClaim - -**`description`** issue a public claim - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.publicClaim?` | `IPublicClaim` | -| `__namedParameters.token?` | `string` | - -#### Returns - -`Promise`<`string`\> - -return issued token - -___ - -### namespacesWithRelations - -▸ **namespacesWithRelations**(`namespaces`): `Promise`<{ `namespace`: `string` ; `owner`: `string` }[]\> - -**`description`** Collects all namespaces related data. Currently its includes only owner - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `namespaces` | `string`[] | - -#### Returns - -`Promise`<{ `namespace`: `string` ; `owner`: `string` }[]\> - -___ - -### offerAsset - -▸ **offerAsset**(`__namedParameters`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.assetDID` | `string` | -| `__namedParameters.offerTo` | `string` | - -#### Returns - -`Promise`<`void`\> - -___ - -### on - -▸ **on**(`event`, `eventHandler`): `void` - -**`description`** Defines event handlers for change of account, change of network, disconnection - -**`requires`** to be called after the connection to wallet was initialized - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `event` | ``"accountChanged"`` \| ``"networkChanged"`` \| ``"disconnected"`` | -| `eventHandler` | () => `void` | - -#### Returns - -`void` - -#### Inherited from - -[IAMBase](iam_iam_base.IAMBase.md).[on](iam_iam_base.IAMBase.md#on) - -___ - -### publishPublicClaim - -▸ **publishPublicClaim**(`__namedParameters`): `Promise`<`string`\> - -publishPublicClaim - -**`description`** store claim data in ipfs and save url to DID document services - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.token` | `string` | - -#### Returns - -`Promise`<`string`\> - -ulr to ipfs - -___ - -### registerAsset - -▸ **registerAsset**(): `Promise`<`string`\> - -#### Returns - -`Promise`<`string`\> - -___ - -### registrationTypesOfRoles - -▸ **registrationTypesOfRoles**(`roles`): `Promise`<`Record`<`string`, `Set`<[`RegistrationTypes`](../enums/cacheServerClient_cacheServerClient_types.RegistrationTypes.md)\>\>\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `roles` | `string`[] | - -#### Returns - -`Promise`<`Record`<`string`, `Set`<[`RegistrationTypes`](../enums/cacheServerClient_cacheServerClient_types.RegistrationTypes.md)\>\>\> - -___ - -### rejectAssetOffer - -▸ **rejectAssetOffer**(`__namedParameters`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.assetDID` | `string` | - -#### Returns - -`Promise`<`void`\> - -___ - -### rejectClaimRequest - -▸ **rejectClaimRequest**(`__namedParameters`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.id` | `string` | -| `__namedParameters.requesterDID` | `string` | - -#### Returns - -`Promise`<`void`\> - -___ - -### revokeDidDocument - -▸ **revokeDidDocument**(): `Promise`<`boolean`\> - -revokeDidDocument - -**`description`** revokes did document - -#### Returns - -`Promise`<`boolean`\> - -information (true/false) if the DID document was revoked - -___ - -### setRoleDefinition - -▸ **setRoleDefinition**(`__namedParameters`): `Promise`<`void`\> - -setRoleDefinition - -**`description`** sets role definition in ENS domain - -**`description`** please use it only when you want to update role definitions for already created role (domain) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.data` | `IRoleDefinition` \| `IAppDefinition` \| `IOrganizationDefinition` | -| `__namedParameters.domain` | `string` | - -#### Returns - -`Promise`<`void`\> - -___ - -### subscribeTo - -▸ **subscribeTo**(`__namedParameters`): `Promise`<`undefined` \| `number`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.subject?` | `string` | -| `__namedParameters.messageHandler` | (`data`: [`IMessage`](../interfaces/iam.IMessage.md)) => `void` | - -#### Returns - -`Promise`<`undefined` \| `number`\> - -___ - -### unsubscribeFrom - -▸ **unsubscribeFrom**(`subscriptionId`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `subscriptionId` | `number` | - -#### Returns - -`Promise`<`void`\> - -___ - -### updateDidDocument - -▸ **updateDidDocument**(`options`): `Promise`<`boolean`\> - -**`description`** updates did document based on data provided - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `options` | `Object` | Options to connect with blockchain | -| `options.data` | `IUpdateData` | New attribute value | -| `options.did?` | `string` | Asset did to be updated | -| `options.didAttribute` | `DIDAttribute` | Type of document to be updated | -| `options.validity?` | `number` | Time (s) for the attribute to expire | - -#### Returns - -`Promise`<`boolean`\> - -true if document is updated successfuly - -___ - -### validateOwnership - -▸ **validateOwnership**(`__namedParameters`): `Promise`<`string`[]\> - -validateOwnership - -**`description`** check ownership of the domain and subdomains of org, app or role - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.namespace` | `string` | -| `__namedParameters.type` | [`ENSNamespaceTypes`](../enums/iam.ENSNamespaceTypes.md) | - -#### Returns - -`Promise`<`string`[]\> - -true or false whatever the passed is user is a owner of org, app or role - -___ - -### verifyPublicClaim - -▸ **verifyPublicClaim**(`__namedParameters`): `Promise`<`IPublicClaim`\> - -verifyPublicClaim - -**`description`** verifies issued token of claim - -**`throws`** if the proof failed - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.claimUrl` | `string` | - -#### Returns - -`Promise`<`IPublicClaim`\> - -public claim data - -___ - -### isMetamaskExtensionPresent - -▸ `Static` **isMetamaskExtensionPresent**(): `Promise`<`Object`\> - -#### Returns - -`Promise`<`Object`\> diff --git a/docs/api/classes/iam_iam_base.IAMBase.md b/docs/api/classes/iam_iam_base.IAMBase.md deleted file mode 100644 index b9f42c07..00000000 --- a/docs/api/classes/iam_iam_base.IAMBase.md +++ /dev/null @@ -1,122 +0,0 @@ -# Class: IAMBase - -[iam/iam-base](../modules/iam_iam_base.md).IAMBase - -## Hierarchy - -- **`IAMBase`** - - ↳ [`IAM`](iam.IAM.md) - -## Table of contents - -### Constructors - -- [constructor](iam_iam_base.IAMBase.md#constructor) - -### Accessors - -- [address](iam_iam_base.IAMBase.md#address) - -### Methods - -- [closeConnection](iam_iam_base.IAMBase.md#closeconnection) -- [connectToCacheServer](iam_iam_base.IAMBase.md#connecttocacheserver) -- [connectToDIDRegistry](iam_iam_base.IAMBase.md#connecttodidregistry) -- [isSessionActive](iam_iam_base.IAMBase.md#issessionactive) -- [on](iam_iam_base.IAMBase.md#on) - -## Constructors - -### constructor - -• **new IAMBase**(`__namedParameters?`) - -IAM Constructor - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`ConnectionOptions`](../modules/iam_iam_base.md#connectionoptions) | - -## Accessors - -### address - -• `get` **address**(): `undefined` \| `string` - -#### Returns - -`undefined` \| `string` - -## Methods - -### closeConnection - -▸ **closeConnection**(): `Promise`<`void`\> - -**`description`** Closes the connection between application and the signer's wallet - -#### Returns - -`Promise`<`void`\> - -___ - -### connectToCacheServer - -▸ **connectToCacheServer**(): `Promise`<`void`\> - -**`description`** Establishes connection to the cache serverand sets public key and identity token - -#### Returns - -`Promise`<`void`\> - -___ - -### connectToDIDRegistry - -▸ **connectToDIDRegistry**(): `Promise`<`void`\> - -**`description`** Creates the signer's DID document if it does not exist - -#### Returns - -`Promise`<`void`\> - -___ - -### isSessionActive - -▸ **isSessionActive**(): `boolean` - -**`description`** Checks if the session is active - -#### Returns - -`boolean` - -boolean that indicates the session state - -___ - -### on - -▸ **on**(`event`, `eventHandler`): `void` - -**`description`** Defines event handlers for change of account, change of network, disconnection - -**`requires`** to be called after the connection to wallet was initialized - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `event` | ``"accountChanged"`` \| ``"networkChanged"`` \| ``"disconnected"`` | -| `eventHandler` | () => `void` | - -#### Returns - -`void` diff --git a/docs/api/classes/modules_assets_assets_service.AssetsService.md b/docs/api/classes/modules_assets_assets_service.AssetsService.md new file mode 100644 index 00000000..1cf6b9cb --- /dev/null +++ b/docs/api/classes/modules_assets_assets_service.AssetsService.md @@ -0,0 +1,232 @@ +# Class: AssetsService + +[modules/assets/assets.service](../modules/modules_assets_assets_service.md).AssetsService + +## Table of contents + +### Constructors + +- [constructor](modules_assets_assets_service.AssetsService.md#constructor) + +### Methods + +- [acceptAssetOffer](modules_assets_assets_service.AssetsService.md#acceptassetoffer) +- [cancelAssetOffer](modules_assets_assets_service.AssetsService.md#cancelassetoffer) +- [getAssetById](modules_assets_assets_service.AssetsService.md#getassetbyid) +- [getAssetHistory](modules_assets_assets_service.AssetsService.md#getassethistory) +- [getOfferedAssets](modules_assets_assets_service.AssetsService.md#getofferedassets) +- [getOwnedAssets](modules_assets_assets_service.AssetsService.md#getownedassets) +- [getPreviouslyOwnedAssets](modules_assets_assets_service.AssetsService.md#getpreviouslyownedassets) +- [init](modules_assets_assets_service.AssetsService.md#init) +- [offerAsset](modules_assets_assets_service.AssetsService.md#offerasset) +- [registerAsset](modules_assets_assets_service.AssetsService.md#registerasset) +- [rejectAssetOffer](modules_assets_assets_service.AssetsService.md#rejectassetoffer) +- [create](modules_assets_assets_service.AssetsService.md#create) + +## Constructors + +### constructor + +• **new AssetsService**(`_signerService`, `_cacheClient`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `_signerService` | [`SignerService`](modules_signer_signer_service.SignerService.md) | +| `_cacheClient` | [`CacheClient`](modules_cacheClient_cacheClient_service.CacheClient.md) | + +## Methods + +### acceptAssetOffer + +▸ **acceptAssetOffer**(`__namedParameters`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.assetDID` | `string` | + +#### Returns + +`Promise`<`void`\> + +___ + +### cancelAssetOffer + +▸ **cancelAssetOffer**(`__namedParameters`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.assetDID` | `string` | + +#### Returns + +`Promise`<`void`\> + +___ + +### getAssetById + +▸ **getAssetById**(`__namedParameters`): `Promise`<[`Asset`](../interfaces/modules_assets_assets_types.Asset.md)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.id` | `string` | + +#### Returns + +`Promise`<[`Asset`](../interfaces/modules_assets_assets_types.Asset.md)\> + +___ + +### getAssetHistory + +▸ **getAssetHistory**(`__namedParameters`): `Promise`<[`AssetHistory`](../interfaces/modules_assets_assets_types.AssetHistory.md)[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.id` | `string` | +| `__namedParameters.order?` | [`Order`](../enums/modules_cacheClient_cacheClient_types.Order.md) | +| `__namedParameters.skip?` | `number` | +| `__namedParameters.take?` | `number` | +| `__namedParameters.type?` | [`AssetHistoryEventType`](../enums/modules_assets_assets_types.AssetHistoryEventType.md) | + +#### Returns + +`Promise`<[`AssetHistory`](../interfaces/modules_assets_assets_types.AssetHistory.md)[]\> + +___ + +### getOfferedAssets + +▸ **getOfferedAssets**(`__namedParameters?`): `Promise`<[`Asset`](../interfaces/modules_assets_assets_types.Asset.md)[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.did?` | `string` | + +#### Returns + +`Promise`<[`Asset`](../interfaces/modules_assets_assets_types.Asset.md)[]\> + +___ + +### getOwnedAssets + +▸ **getOwnedAssets**(`__namedParameters?`): `Promise`<[`Asset`](../interfaces/modules_assets_assets_types.Asset.md)[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.did?` | `string` | + +#### Returns + +`Promise`<[`Asset`](../interfaces/modules_assets_assets_types.Asset.md)[]\> + +___ + +### getPreviouslyOwnedAssets + +▸ **getPreviouslyOwnedAssets**(`__namedParameters`): `Promise`<[`Asset`](../interfaces/modules_assets_assets_types.Asset.md)[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.owner` | `string` | + +#### Returns + +`Promise`<[`Asset`](../interfaces/modules_assets_assets_types.Asset.md)[]\> + +___ + +### init + +▸ **init**(): `Promise`<`void`\> + +#### Returns + +`Promise`<`void`\> + +___ + +### offerAsset + +▸ **offerAsset**(`__namedParameters`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `__namedParameters` | `Object` | - | +| `__namedParameters.assetDID` | `string` | - | +| `__namedParameters.offerTo` | `string` | recepient address | + +#### Returns + +`Promise`<`void`\> + +___ + +### registerAsset + +▸ **registerAsset**(): `Promise`<`string`\> + +#### Returns + +`Promise`<`string`\> + +___ + +### rejectAssetOffer + +▸ **rejectAssetOffer**(`__namedParameters`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.assetDID` | `string` | + +#### Returns + +`Promise`<`void`\> + +___ + +### create + +▸ `Static` **create**(`signerService`, `cacheClient`): `Promise`<[`AssetsService`](modules_assets_assets_service.AssetsService.md)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `signerService` | [`SignerService`](modules_signer_signer_service.SignerService.md) | +| `cacheClient` | [`CacheClient`](modules_cacheClient_cacheClient_service.CacheClient.md) | + +#### Returns + +`Promise`<[`AssetsService`](modules_assets_assets_service.AssetsService.md)\> diff --git a/docs/api/classes/modules_cacheClient_cacheClient_service.CacheClient.md b/docs/api/classes/modules_cacheClient_cacheClient_service.CacheClient.md new file mode 100644 index 00000000..4dca3858 --- /dev/null +++ b/docs/api/classes/modules_cacheClient_cacheClient_service.CacheClient.md @@ -0,0 +1,774 @@ +# Class: CacheClient + +[modules/cacheClient/cacheClient.service](../modules/modules_cacheClient_cacheClient_service.md).CacheClient + +## Implements + +- [`ICacheClient`](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md) + +## Table of contents + +### Constructors + +- [constructor](modules_cacheClient_cacheClient_service.CacheClient.md#constructor) + +### Properties + +- [pubKeyAndIdentityToken](modules_cacheClient_cacheClient_service.CacheClient.md#pubkeyandidentitytoken) + +### Methods + +- [addDIDToWatchList](modules_cacheClient_cacheClient_service.CacheClient.md#adddidtowatchlist) +- [addFailedRequest](modules_cacheClient_cacheClient_service.CacheClient.md#addfailedrequest) +- [deleteClaim](modules_cacheClient_cacheClient_service.CacheClient.md#deleteclaim) +- [getAppDefinition](modules_cacheClient_cacheClient_service.CacheClient.md#getappdefinition) +- [getApplicationRoles](modules_cacheClient_cacheClient_service.CacheClient.md#getapplicationroles) +- [getApplicationsByOrganization](modules_cacheClient_cacheClient_service.CacheClient.md#getapplicationsbyorganization) +- [getApplicationsByOwner](modules_cacheClient_cacheClient_service.CacheClient.md#getapplicationsbyowner) +- [getAssetById](modules_cacheClient_cacheClient_service.CacheClient.md#getassetbyid) +- [getAssetHistory](modules_cacheClient_cacheClient_service.CacheClient.md#getassethistory) +- [getClaimsByIssuer](modules_cacheClient_cacheClient_service.CacheClient.md#getclaimsbyissuer) +- [getClaimsByRequester](modules_cacheClient_cacheClient_service.CacheClient.md#getclaimsbyrequester) +- [getClaimsBySubject](modules_cacheClient_cacheClient_service.CacheClient.md#getclaimsbysubject) +- [getClaimsBySubjects](modules_cacheClient_cacheClient_service.CacheClient.md#getclaimsbysubjects) +- [getDIDsForRole](modules_cacheClient_cacheClient_service.CacheClient.md#getdidsforrole) +- [getDidDocument](modules_cacheClient_cacheClient_service.CacheClient.md#getdiddocument) +- [getNamespaceBySearchPhrase](modules_cacheClient_cacheClient_service.CacheClient.md#getnamespacebysearchphrase) +- [getOfferedAssets](modules_cacheClient_cacheClient_service.CacheClient.md#getofferedassets) +- [getOrgDefinition](modules_cacheClient_cacheClient_service.CacheClient.md#getorgdefinition) +- [getOrgHierarchy](modules_cacheClient_cacheClient_service.CacheClient.md#getorghierarchy) +- [getOrganizationRoles](modules_cacheClient_cacheClient_service.CacheClient.md#getorganizationroles) +- [getOrganizationsByOwner](modules_cacheClient_cacheClient_service.CacheClient.md#getorganizationsbyowner) +- [getOwnedAssets](modules_cacheClient_cacheClient_service.CacheClient.md#getownedassets) +- [getPreviouslyOwnedAssets](modules_cacheClient_cacheClient_service.CacheClient.md#getpreviouslyownedassets) +- [getRoleDefinition](modules_cacheClient_cacheClient_service.CacheClient.md#getroledefinition) +- [getRolesByOwner](modules_cacheClient_cacheClient_service.CacheClient.md#getrolesbyowner) +- [getSubOrganizationsByOrganization](modules_cacheClient_cacheClient_service.CacheClient.md#getsuborganizationsbyorganization) +- [handleRefreshToken](modules_cacheClient_cacheClient_service.CacheClient.md#handlerefreshtoken) +- [handleUnauthorized](modules_cacheClient_cacheClient_service.CacheClient.md#handleunauthorized) +- [init](modules_cacheClient_cacheClient_service.CacheClient.md#init) +- [isAuthEnabled](modules_cacheClient_cacheClient_service.CacheClient.md#isauthenabled) +- [issueClaim](modules_cacheClient_cacheClient_service.CacheClient.md#issueclaim) +- [login](modules_cacheClient_cacheClient_service.CacheClient.md#login) +- [rejectClaim](modules_cacheClient_cacheClient_service.CacheClient.md#rejectclaim) +- [requestClaim](modules_cacheClient_cacheClient_service.CacheClient.md#requestclaim) +- [testLogin](modules_cacheClient_cacheClient_service.CacheClient.md#testlogin) + +## Constructors + +### constructor + +• **new CacheClient**(`_signerService`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `_signerService` | [`SignerService`](modules_signer_signer_service.SignerService.md) | + +## Properties + +### pubKeyAndIdentityToken + +• **pubKeyAndIdentityToken**: `undefined` \| [`IPubKeyAndIdentityToken`](../interfaces/modules_signer_signer_types.IPubKeyAndIdentityToken.md) + +#### Implementation of + +[ICacheClient](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md).[pubKeyAndIdentityToken](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md#pubkeyandidentitytoken) + +## Methods + +### addDIDToWatchList + +▸ **addDIDToWatchList**(`__namedParameters`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.did` | `string` | + +#### Returns + +`Promise`<`void`\> + +#### Implementation of + +[ICacheClient](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md).[addDIDToWatchList](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md#adddidtowatchlist) + +___ + +### addFailedRequest + +▸ **addFailedRequest**(`callback`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `callback` | (`token?`: `string`) => `void` | + +#### Returns + +`void` + +___ + +### deleteClaim + +▸ **deleteClaim**(`__namedParameters`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.claimId` | `string` | + +#### Returns + +`Promise`<`void`\> + +#### Implementation of + +[ICacheClient](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md).[deleteClaim](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md#deleteclaim) + +___ + +### getAppDefinition + +▸ **getAppDefinition**(`__namedParameters`): `Promise`<`IAppDefinition`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.namespace` | `string` | + +#### Returns + +`Promise`<`IAppDefinition`\> + +#### Implementation of + +[ICacheClient](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md).[getAppDefinition](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md#getappdefinition) + +___ + +### getApplicationRoles + +▸ **getApplicationRoles**(`__namedParameters`): `Promise`<[`IRole`](../interfaces/modules_domains_domains_types.IRole.md)[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.namespace` | `string` | + +#### Returns + +`Promise`<[`IRole`](../interfaces/modules_domains_domains_types.IRole.md)[]\> + +#### Implementation of + +[ICacheClient](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md).[getApplicationRoles](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md#getapplicationroles) + +___ + +### getApplicationsByOrganization + +▸ **getApplicationsByOrganization**(`__namedParameters`): `Promise`<[`IApp`](../interfaces/modules_domains_domains_types.IApp.md)[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.namespace` | `string` | + +#### Returns + +`Promise`<[`IApp`](../interfaces/modules_domains_domains_types.IApp.md)[]\> + +#### Implementation of + +[ICacheClient](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md).[getApplicationsByOrganization](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md#getapplicationsbyorganization) + +___ + +### getApplicationsByOwner + +▸ **getApplicationsByOwner**(`__namedParameters`): `Promise`<[`IApp`](../interfaces/modules_domains_domains_types.IApp.md)[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.owner` | `string` | + +#### Returns + +`Promise`<[`IApp`](../interfaces/modules_domains_domains_types.IApp.md)[]\> + +#### Implementation of + +[ICacheClient](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md).[getApplicationsByOwner](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md#getapplicationsbyowner) + +___ + +### getAssetById + +▸ **getAssetById**(`__namedParameters`): `Promise`<[`Asset`](../interfaces/modules_assets_assets_types.Asset.md)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.id` | `string` | + +#### Returns + +`Promise`<[`Asset`](../interfaces/modules_assets_assets_types.Asset.md)\> + +#### Implementation of + +[ICacheClient](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md).[getAssetById](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md#getassetbyid) + +___ + +### getAssetHistory + +▸ **getAssetHistory**(`__namedParameters`): `Promise`<[`AssetHistory`](../interfaces/modules_assets_assets_types.AssetHistory.md)[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.id` | `string` | +| `__namedParameters.order?` | [`Order`](../enums/modules_cacheClient_cacheClient_types.Order.md) | +| `__namedParameters.skip?` | `number` | +| `__namedParameters.take?` | `number` | +| `__namedParameters.type?` | [`AssetHistoryEventType`](../enums/modules_assets_assets_types.AssetHistoryEventType.md) | + +#### Returns + +`Promise`<[`AssetHistory`](../interfaces/modules_assets_assets_types.AssetHistory.md)[]\> + +#### Implementation of + +[ICacheClient](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md).[getAssetHistory](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md#getassethistory) + +___ + +### getClaimsByIssuer + +▸ **getClaimsByIssuer**(`__namedParameters`): `Promise`<[`Claim`](../interfaces/modules_claims_claims_types.Claim.md)[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.did` | `string` | +| `__namedParameters.isAccepted?` | `boolean` | +| `__namedParameters.namespace?` | `string` | + +#### Returns + +`Promise`<[`Claim`](../interfaces/modules_claims_claims_types.Claim.md)[]\> + +#### Implementation of + +[ICacheClient](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md).[getClaimsByIssuer](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md#getclaimsbyissuer) + +___ + +### getClaimsByRequester + +▸ **getClaimsByRequester**(`__namedParameters`): `Promise`<[`Claim`](../interfaces/modules_claims_claims_types.Claim.md)[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.did` | `string` | +| `__namedParameters.isAccepted?` | `boolean` | +| `__namedParameters.namespace?` | `string` | + +#### Returns + +`Promise`<[`Claim`](../interfaces/modules_claims_claims_types.Claim.md)[]\> + +#### Implementation of + +[ICacheClient](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md).[getClaimsByRequester](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md#getclaimsbyrequester) + +___ + +### getClaimsBySubject + +▸ **getClaimsBySubject**(`__namedParameters`): `Promise`<[`Claim`](../interfaces/modules_claims_claims_types.Claim.md)[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.did` | `string` | +| `__namedParameters.isAccepted?` | `boolean` | +| `__namedParameters.namespace?` | `string` | + +#### Returns + +`Promise`<[`Claim`](../interfaces/modules_claims_claims_types.Claim.md)[]\> + +#### Implementation of + +[ICacheClient](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md).[getClaimsBySubject](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md#getclaimsbysubject) + +___ + +### getClaimsBySubjects + +▸ **getClaimsBySubjects**(`subjects`): `Promise`<[`Claim`](../interfaces/modules_claims_claims_types.Claim.md)[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `subjects` | `string`[] | + +#### Returns + +`Promise`<[`Claim`](../interfaces/modules_claims_claims_types.Claim.md)[]\> + +#### Implementation of + +[ICacheClient](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md).[getClaimsBySubjects](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md#getclaimsbysubjects) + +___ + +### getDIDsForRole + +▸ **getDIDsForRole**(`__namedParameters`): `Promise`<`string`[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.namespace` | `string` | + +#### Returns + +`Promise`<`string`[]\> + +#### Implementation of + +[ICacheClient](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md).[getDIDsForRole](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md#getdidsforrole) + +___ + +### getDidDocument + +▸ **getDidDocument**(`__namedParameters`): `Promise`<`IDIDDocument`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.did` | `string` | +| `__namedParameters.includeClaims?` | `boolean` | + +#### Returns + +`Promise`<`IDIDDocument`\> + +#### Implementation of + +[ICacheClient](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md).[getDidDocument](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md#getdiddocument) + +___ + +### getNamespaceBySearchPhrase + +▸ **getNamespaceBySearchPhrase**(`__namedParameters`): `Promise`<([`IRole`](../interfaces/modules_domains_domains_types.IRole.md) \| [`IOrganization`](../interfaces/modules_domains_domains_types.IOrganization.md) \| [`IApp`](../interfaces/modules_domains_domains_types.IApp.md))[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.search` | `string` | +| `__namedParameters.types?` | (``"App"`` \| ``"Org"`` \| ``"Role"``)[] | + +#### Returns + +`Promise`<([`IRole`](../interfaces/modules_domains_domains_types.IRole.md) \| [`IOrganization`](../interfaces/modules_domains_domains_types.IOrganization.md) \| [`IApp`](../interfaces/modules_domains_domains_types.IApp.md))[]\> + +#### Implementation of + +[ICacheClient](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md).[getNamespaceBySearchPhrase](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md#getnamespacebysearchphrase) + +___ + +### getOfferedAssets + +▸ **getOfferedAssets**(`__namedParameters`): `Promise`<[`Asset`](../interfaces/modules_assets_assets_types.Asset.md)[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.did` | `string` | + +#### Returns + +`Promise`<[`Asset`](../interfaces/modules_assets_assets_types.Asset.md)[]\> + +#### Implementation of + +[ICacheClient](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md).[getOfferedAssets](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md#getofferedassets) + +___ + +### getOrgDefinition + +▸ **getOrgDefinition**(`__namedParameters`): `Promise`<`IOrganizationDefinition`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.namespace` | `string` | + +#### Returns + +`Promise`<`IOrganizationDefinition`\> + +#### Implementation of + +[ICacheClient](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md).[getOrgDefinition](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md#getorgdefinition) + +___ + +### getOrgHierarchy + +▸ **getOrgHierarchy**(`__namedParameters`): `Promise`<[`IOrganization`](../interfaces/modules_domains_domains_types.IOrganization.md)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.namespace` | `string` | + +#### Returns + +`Promise`<[`IOrganization`](../interfaces/modules_domains_domains_types.IOrganization.md)\> + +#### Implementation of + +[ICacheClient](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md).[getOrgHierarchy](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md#getorghierarchy) + +___ + +### getOrganizationRoles + +▸ **getOrganizationRoles**(`__namedParameters`): `Promise`<[`IRole`](../interfaces/modules_domains_domains_types.IRole.md)[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.namespace` | `string` | + +#### Returns + +`Promise`<[`IRole`](../interfaces/modules_domains_domains_types.IRole.md)[]\> + +#### Implementation of + +[ICacheClient](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md).[getOrganizationRoles](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md#getorganizationroles) + +___ + +### getOrganizationsByOwner + +▸ **getOrganizationsByOwner**(`__namedParameters`): `Promise`<[`IOrganization`](../interfaces/modules_domains_domains_types.IOrganization.md)[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.excludeSubOrgs` | `boolean` | +| `__namedParameters.owner` | `string` | + +#### Returns + +`Promise`<[`IOrganization`](../interfaces/modules_domains_domains_types.IOrganization.md)[]\> + +#### Implementation of + +[ICacheClient](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md).[getOrganizationsByOwner](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md#getorganizationsbyowner) + +___ + +### getOwnedAssets + +▸ **getOwnedAssets**(`__namedParameters`): `Promise`<[`Asset`](../interfaces/modules_assets_assets_types.Asset.md)[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.did` | `string` | + +#### Returns + +`Promise`<[`Asset`](../interfaces/modules_assets_assets_types.Asset.md)[]\> + +#### Implementation of + +[ICacheClient](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md).[getOwnedAssets](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md#getownedassets) + +___ + +### getPreviouslyOwnedAssets + +▸ **getPreviouslyOwnedAssets**(`__namedParameters`): `Promise`<[`Asset`](../interfaces/modules_assets_assets_types.Asset.md)[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.owner` | `string` | + +#### Returns + +`Promise`<[`Asset`](../interfaces/modules_assets_assets_types.Asset.md)[]\> + +#### Implementation of + +[ICacheClient](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md).[getPreviouslyOwnedAssets](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md#getpreviouslyownedassets) + +___ + +### getRoleDefinition + +▸ **getRoleDefinition**(`__namedParameters`): `Promise`<`IRoleDefinition`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.namespace` | `string` | + +#### Returns + +`Promise`<`IRoleDefinition`\> + +#### Implementation of + +[ICacheClient](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md).[getRoleDefinition](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md#getroledefinition) + +___ + +### getRolesByOwner + +▸ **getRolesByOwner**(`__namedParameters`): `Promise`<[`IRole`](../interfaces/modules_domains_domains_types.IRole.md)[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.owner` | `string` | + +#### Returns + +`Promise`<[`IRole`](../interfaces/modules_domains_domains_types.IRole.md)[]\> + +#### Implementation of + +[ICacheClient](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md).[getRolesByOwner](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md#getrolesbyowner) + +___ + +### getSubOrganizationsByOrganization + +▸ **getSubOrganizationsByOrganization**(`__namedParameters`): `Promise`<[`IOrganization`](../interfaces/modules_domains_domains_types.IOrganization.md)[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.namespace` | `string` | + +#### Returns + +`Promise`<[`IOrganization`](../interfaces/modules_domains_domains_types.IOrganization.md)[]\> + +#### Implementation of + +[ICacheClient](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md).[getSubOrganizationsByOrganization](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md#getsuborganizationsbyorganization) + +___ + +### handleRefreshToken + +▸ **handleRefreshToken**(): `Promise`<`void`\> + +#### Returns + +`Promise`<`void`\> + +___ + +### handleUnauthorized + +▸ **handleUnauthorized**(`error`): `Promise`<`unknown`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `error` | `AxiosError`<`any`\> | + +#### Returns + +`Promise`<`unknown`\> + +___ + +### init + +▸ **init**(): `Promise`<`void`\> + +#### Returns + +`Promise`<`void`\> + +___ + +### isAuthEnabled + +▸ **isAuthEnabled**(): `boolean` + +#### Returns + +`boolean` + +#### Implementation of + +[ICacheClient](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md).[isAuthEnabled](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md#isauthenabled) + +___ + +### issueClaim + +▸ **issueClaim**(`__namedParameters`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.did` | `string` | +| `__namedParameters.message` | [`IClaimIssuance`](../interfaces/modules_claims_claims_types.IClaimIssuance.md) | + +#### Returns + +`Promise`<`void`\> + +#### Implementation of + +[ICacheClient](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md).[issueClaim](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md#issueclaim) + +___ + +### login + +▸ **login**(): `Promise`<`Object`\> + +#### Returns + +`Promise`<`Object`\> + +#### Implementation of + +[ICacheClient](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md).[login](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md#login) + +___ + +### rejectClaim + +▸ **rejectClaim**(`__namedParameters`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.did` | `string` | +| `__namedParameters.message` | [`IClaimRejection`](../interfaces/modules_claims_claims_types.IClaimRejection.md) | + +#### Returns + +`Promise`<`void`\> + +#### Implementation of + +[ICacheClient](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md).[rejectClaim](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md#rejectclaim) + +___ + +### requestClaim + +▸ **requestClaim**(`__namedParameters`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.did` | `string` | +| `__namedParameters.message` | [`IClaimRequest`](../interfaces/modules_claims_claims_types.IClaimRequest.md) | + +#### Returns + +`Promise`<`void`\> + +#### Implementation of + +[ICacheClient](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md).[requestClaim](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md#requestclaim) + +___ + +### testLogin + +▸ **testLogin**(): `Promise`<`void`\> + +#### Returns + +`Promise`<`void`\> + +#### Implementation of + +[ICacheClient](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md).[testLogin](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md#testlogin) diff --git a/docs/api/classes/modules_claims_claims_service.ClaimsService.md b/docs/api/classes/modules_claims_claims_service.ClaimsService.md new file mode 100644 index 00000000..43939474 --- /dev/null +++ b/docs/api/classes/modules_claims_claims_service.ClaimsService.md @@ -0,0 +1,361 @@ +# Class: ClaimsService + +[modules/claims/claims.service](../modules/modules_claims_claims_service.md).ClaimsService + +## Table of contents + +### Constructors + +- [constructor](modules_claims_claims_service.ClaimsService.md#constructor) + +### Methods + +- [createClaimRequest](modules_claims_claims_service.ClaimsService.md#createclaimrequest) +- [createProofClaim](modules_claims_claims_service.ClaimsService.md#createproofclaim) +- [createPublicClaim](modules_claims_claims_service.ClaimsService.md#createpublicclaim) +- [createSelfSignedClaim](modules_claims_claims_service.ClaimsService.md#createselfsignedclaim) +- [deleteClaim](modules_claims_claims_service.ClaimsService.md#deleteclaim) +- [getClaimId](modules_claims_claims_service.ClaimsService.md#getclaimid) +- [getClaimsByIssuer](modules_claims_claims_service.ClaimsService.md#getclaimsbyissuer) +- [getClaimsByRequester](modules_claims_claims_service.ClaimsService.md#getclaimsbyrequester) +- [getClaimsBySubject](modules_claims_claims_service.ClaimsService.md#getclaimsbysubject) +- [getClaimsBySubjects](modules_claims_claims_service.ClaimsService.md#getclaimsbysubjects) +- [getUserClaims](modules_claims_claims_service.ClaimsService.md#getuserclaims) +- [init](modules_claims_claims_service.ClaimsService.md#init) +- [issueClaimRequest](modules_claims_claims_service.ClaimsService.md#issueclaimrequest) +- [publishPublicClaim](modules_claims_claims_service.ClaimsService.md#publishpublicclaim) +- [rejectClaimRequest](modules_claims_claims_service.ClaimsService.md#rejectclaimrequest) +- [create](modules_claims_claims_service.ClaimsService.md#create) + +## Constructors + +### constructor + +• **new ClaimsService**(`_signerService`, `_domainsService`, `_cacheClient`, `_didRegistry`, `_messagingService`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `_signerService` | [`SignerService`](modules_signer_signer_service.SignerService.md) | +| `_domainsService` | [`DomainsService`](modules_domains_domains_service.DomainsService.md) | +| `_cacheClient` | [`CacheClient`](modules_cacheClient_cacheClient_service.CacheClient.md) | +| `_didRegistry` | [`DidRegistry`](modules_didRegistry_didRegistry_service.DidRegistry.md) | +| `_messagingService` | [`MessagingService`](modules_messaging_messaging_service.MessagingService.md) | + +## Methods + +### createClaimRequest + +▸ **createClaimRequest**(`__namedParameters`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.claim` | `Object` | +| `__namedParameters.claim.claimType` | `string` | +| `__namedParameters.claim.claimTypeVersion` | `number` | +| `__namedParameters.claim.fields` | { `key`: `string` ; `value`: `string` \| `number` }[] | +| `__namedParameters.registrationTypes?` | [`RegistrationTypes`](../enums/modules_claims_claims_types.RegistrationTypes.md)[] | +| `__namedParameters.subject?` | `string` | + +#### Returns + +`Promise`<`void`\> + +___ + +### createProofClaim + +▸ **createProofClaim**(`__namedParameters`): `Promise`<`void`\> + +createProofClaim + +**`description`** creates a proof of a claim + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.claimUrl` | `string` | +| `__namedParameters.saltedFields` | `ISaltedFields` | + +#### Returns + +`Promise`<`void`\> + +proof token + +___ + +### createPublicClaim + +▸ **createPublicClaim**(`__namedParameters`): `Promise`<`string`\> + +createPublicClaim + +**`description`** create a public claim based on data provided + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.data` | [`ClaimData`](../interfaces/modules_didRegistry_did_types.ClaimData.md) | +| `__namedParameters.subject?` | `string` | + +#### Returns + +`Promise`<`string`\> + +JWT token of created claim + +___ + +### createSelfSignedClaim + +▸ **createSelfSignedClaim**(`__namedParameters`): `Promise`<`string`\> + +createSelfSignedClaim + +**`description`** creates self signed claim and upload the data to ipfs + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.data` | [`ClaimData`](../interfaces/modules_didRegistry_did_types.ClaimData.md) | +| `__namedParameters.subject?` | `string` | + +#### Returns + +`Promise`<`string`\> + +___ + +### deleteClaim + +▸ **deleteClaim**(`__namedParameters`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.id` | `string` | + +#### Returns + +`Promise`<`void`\> + +___ + +### getClaimId + +▸ **getClaimId**(`__namedParameters`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.claimData` | [`ClaimData`](../interfaces/modules_didRegistry_did_types.ClaimData.md) | + +#### Returns + +`Promise`<`string`\> + +___ + +### getClaimsByIssuer + +▸ **getClaimsByIssuer**(`__namedParameters`): `Promise`<[`Claim`](../interfaces/modules_claims_claims_types.Claim.md)[]\> + +**`description`** - Returns claims for given issuer. Allows filtering by status and parent namespace + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.did` | `string` | +| `__namedParameters.isAccepted?` | `boolean` | +| `__namedParameters.namespace?` | `string` | + +#### Returns + +`Promise`<[`Claim`](../interfaces/modules_claims_claims_types.Claim.md)[]\> + +___ + +### getClaimsByRequester + +▸ **getClaimsByRequester**(`__namedParameters`): `Promise`<[`Claim`](../interfaces/modules_claims_claims_types.Claim.md)[]\> + +**`description`** - Returns claims for given requester. Allows filtering by status and parent namespace + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.did` | `string` | +| `__namedParameters.isAccepted?` | `boolean` | +| `__namedParameters.namespace?` | `string` | + +#### Returns + +`Promise`<[`Claim`](../interfaces/modules_claims_claims_types.Claim.md)[]\> + +___ + +### getClaimsBySubject + +▸ **getClaimsBySubject**(`__namedParameters`): `Promise`<[`Claim`](../interfaces/modules_claims_claims_types.Claim.md)[]\> + +**`description`** - Returns claims for given subject. Allows filtering by status and parent namespace + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.did` | `string` | +| `__namedParameters.isAccepted?` | `boolean` | +| `__namedParameters.namespace?` | `string` | + +#### Returns + +`Promise`<[`Claim`](../interfaces/modules_claims_claims_types.Claim.md)[]\> + +___ + +### getClaimsBySubjects + +▸ **getClaimsBySubjects**(`subjects`): `Promise`<[`Claim`](../interfaces/modules_claims_claims_types.Claim.md)[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `subjects` | `string`[] | + +#### Returns + +`Promise`<[`Claim`](../interfaces/modules_claims_claims_types.Claim.md)[]\> + +___ + +### getUserClaims + +▸ **getUserClaims**(`__namedParameters?`): `Promise`<`IServiceEndpoint` & [`ClaimData`](../interfaces/modules_didRegistry_did_types.ClaimData.md)[]\> + +getUserClaims + +**`description`** get user claims + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `undefined` \| { `did?`: `string` } | + +#### Returns + +`Promise`<`IServiceEndpoint` & [`ClaimData`](../interfaces/modules_didRegistry_did_types.ClaimData.md)[]\> + +___ + +### init + +▸ **init**(): `Promise`<`void`\> + +#### Returns + +`Promise`<`void`\> + +___ + +### issueClaimRequest + +▸ **issueClaimRequest**(`__namedParameters`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.id` | `string` | +| `__namedParameters.registrationTypes` | [`RegistrationTypes`](../enums/modules_claims_claims_types.RegistrationTypes.md)[] | +| `__namedParameters.requester` | `string` | +| `__namedParameters.subjectAgreement` | `string` | +| `__namedParameters.token` | `string` | + +#### Returns + +`Promise`<`void`\> + +___ + +### publishPublicClaim + +▸ **publishPublicClaim**(`__namedParameters`): `Promise`<`string`\> + +publishPublicClaim + +**`description`** store claim data in ipfs and save url to DID document services + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.token` | `string` | + +#### Returns + +`Promise`<`string`\> + +ulr to ipfs + +___ + +### rejectClaimRequest + +▸ **rejectClaimRequest**(`__namedParameters`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.id` | `string` | +| `__namedParameters.requesterDID` | `string` | + +#### Returns + +`Promise`<`void`\> + +___ + +### create + +▸ `Static` **create**(`signerService`, `domainsService`, `cacheClient`, `didRegistry`, `messagingService`): `Promise`<[`ClaimsService`](modules_claims_claims_service.ClaimsService.md)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `signerService` | [`SignerService`](modules_signer_signer_service.SignerService.md) | +| `domainsService` | [`DomainsService`](modules_domains_domains_service.DomainsService.md) | +| `cacheClient` | [`CacheClient`](modules_cacheClient_cacheClient_service.CacheClient.md) | +| `didRegistry` | [`DidRegistry`](modules_didRegistry_didRegistry_service.DidRegistry.md) | +| `messagingService` | [`MessagingService`](modules_messaging_messaging_service.MessagingService.md) | + +#### Returns + +`Promise`<[`ClaimsService`](modules_claims_claims_service.ClaimsService.md)\> diff --git a/docs/api/classes/modules_didRegistry_didRegistry_service.DidRegistry.md b/docs/api/classes/modules_didRegistry_didRegistry_service.DidRegistry.md new file mode 100644 index 00000000..c1ebf6b8 --- /dev/null +++ b/docs/api/classes/modules_didRegistry_didRegistry_service.DidRegistry.md @@ -0,0 +1,264 @@ +# Class: DidRegistry + +[modules/didRegistry/didRegistry.service](../modules/modules_didRegistry_didRegistry_service.md).DidRegistry + +## Table of contents + +### Constructors + +- [constructor](modules_didRegistry_didRegistry_service.DidRegistry.md#constructor) + +### Accessors + +- [did](modules_didRegistry_didRegistry_service.DidRegistry.md#did) +- [ipfsStore](modules_didRegistry_didRegistry_service.DidRegistry.md#ipfsstore) +- [jwt](modules_didRegistry_didRegistry_service.DidRegistry.md#jwt) + +### Methods + +- [createProofClaim](modules_didRegistry_didRegistry_service.DidRegistry.md#createproofclaim) +- [createPublicClaim](modules_didRegistry_didRegistry_service.DidRegistry.md#createpublicclaim) +- [decodeJWTToken](modules_didRegistry_didRegistry_service.DidRegistry.md#decodejwttoken) +- [getDidDocument](modules_didRegistry_didRegistry_service.DidRegistry.md#getdiddocument) +- [init](modules_didRegistry_didRegistry_service.DidRegistry.md#init) +- [issuePublicClaim](modules_didRegistry_didRegistry_service.DidRegistry.md#issuepublicclaim) +- [revokeDidDocument](modules_didRegistry_didRegistry_service.DidRegistry.md#revokediddocument) +- [updateDocument](modules_didRegistry_didRegistry_service.DidRegistry.md#updatedocument) +- [verifyPublicClaim](modules_didRegistry_didRegistry_service.DidRegistry.md#verifypublicclaim) +- [connect](modules_didRegistry_didRegistry_service.DidRegistry.md#connect) + +## Constructors + +### constructor + +• **new DidRegistry**(`_signerService`, `_cacheClient`, `_assetsService`, `_ipfsUrl?`) + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `_signerService` | [`SignerService`](modules_signer_signer_service.SignerService.md) | `undefined` | +| `_cacheClient` | [`CacheClient`](modules_cacheClient_cacheClient_service.CacheClient.md) | `undefined` | +| `_assetsService` | [`AssetsService`](modules_assets_assets_service.AssetsService.md) | `undefined` | +| `_ipfsUrl` | `string` | `"https://ipfs.infura.io:5001/api/v0/"` | + +## Accessors + +### did + +• `get` **did**(): `string` + +#### Returns + +`string` + +___ + +### ipfsStore + +• `get` **ipfsStore**(): `DidStore` + +#### Returns + +`DidStore` + +___ + +### jwt + +• `get` **jwt**(): `JWT` + +#### Returns + +`JWT` + +## Methods + +### createProofClaim + +▸ **createProofClaim**(`__namedParameters`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.claimUrl` | `string` | +| `__namedParameters.encryptedSaltedFields` | `IProofData` | + +#### Returns + +`Promise`<`void`\> + +___ + +### createPublicClaim + +▸ **createPublicClaim**(`__namedParameters`): `Promise`<`string`\> + +createPublicClaim + +**`description`** create a public claim based on data provided + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.data` | [`ClaimData`](../interfaces/modules_didRegistry_did_types.ClaimData.md) | +| `__namedParameters.subject?` | `string` | + +#### Returns + +`Promise`<`string`\> + +JWT token of created claim + +___ + +### decodeJWTToken + +▸ **decodeJWTToken**(`__namedParameters`): `Promise`<`string` \| { [key: string]: `string` \| `object`; }\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.token` | `string` | + +#### Returns + +`Promise`<`string` \| { [key: string]: `string` \| `object`; }\> + +___ + +### getDidDocument + +▸ **getDidDocument**(`__namedParameters?`): `Promise`<`Object`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `undefined` \| { `did?`: `string` ; `includeClaims?`: `boolean` } | + +#### Returns + +`Promise`<`Object`\> + +___ + +### init + +▸ **init**(): `Promise`<`void`\> + +#### Returns + +`Promise`<`void`\> + +___ + +### issuePublicClaim + +▸ **issuePublicClaim**(`__namedParameters`): `Promise`<`string`\> + +issuePublicClaim + +**`description`** issue a public claim + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.publicClaim?` | `IPublicClaim` | +| `__namedParameters.token?` | `string` | + +#### Returns + +`Promise`<`string`\> + +return issued token + +___ + +### revokeDidDocument + +▸ **revokeDidDocument**(): `Promise`<`boolean`\> + +revokeDidDocument + +**`description`** revokes did document + +#### Returns + +`Promise`<`boolean`\> + +information (true/false) if the DID document was revoked + +___ + +### updateDocument + +▸ **updateDocument**(`options`): `Promise`<`boolean`\> + +**`description`** updates did document based on data provided + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `options` | `Object` | Options to connect with blockchain | +| `options.data` | `IUpdateData` | New attribute value | +| `options.did?` | `string` | Asset did to be updated | +| `options.didAttribute` | `DIDAttribute` | Type of document to be updated | +| `options.validity?` | `number` | Time (s) for the attribute to expire | + +#### Returns + +`Promise`<`boolean`\> + +true if document is updated successfuly + +___ + +### verifyPublicClaim + +▸ **verifyPublicClaim**(`token`, `iss`): `Promise`<`boolean`\> + +verifyPublicClaim + +**`description`** verifies issued token of claim + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `token` | `string` | +| `iss` | `string` | + +#### Returns + +`Promise`<`boolean`\> + +public claim data + +___ + +### connect + +▸ `Static` **connect**(`signerService`, `cacheClient`, `assetsService`, `ipfsUrl?`): `Promise`<[`DidRegistry`](modules_didRegistry_didRegistry_service.DidRegistry.md)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `signerService` | [`SignerService`](modules_signer_signer_service.SignerService.md) | +| `cacheClient` | [`CacheClient`](modules_cacheClient_cacheClient_service.CacheClient.md) | +| `assetsService` | [`AssetsService`](modules_assets_assets_service.AssetsService.md) | +| `ipfsUrl?` | `string` | + +#### Returns + +`Promise`<[`DidRegistry`](modules_didRegistry_didRegistry_service.DidRegistry.md)\> diff --git a/docs/api/classes/modules_domains_domains_service.DomainsService.md b/docs/api/classes/modules_domains_domains_service.DomainsService.md new file mode 100644 index 00000000..c172a756 --- /dev/null +++ b/docs/api/classes/modules_domains_domains_service.DomainsService.md @@ -0,0 +1,668 @@ +# Class: DomainsService + +[modules/domains/domains.service](../modules/modules_domains_domains_service.md).DomainsService + +## Table of contents + +### Constructors + +- [constructor](modules_domains_domains_service.DomainsService.md#constructor) + +### Methods + +- [changeAppOwnership](modules_domains_domains_service.DomainsService.md#changeappownership) +- [changeOrgOwnership](modules_domains_domains_service.DomainsService.md#changeorgownership) +- [changeRoleOwnership](modules_domains_domains_service.DomainsService.md#changeroleownership) +- [checkExistenceOfDomain](modules_domains_domains_service.DomainsService.md#checkexistenceofdomain) +- [createApplication](modules_domains_domains_service.DomainsService.md#createapplication) +- [createOrganization](modules_domains_domains_service.DomainsService.md#createorganization) +- [createRole](modules_domains_domains_service.DomainsService.md#createrole) +- [deleteApplication](modules_domains_domains_service.DomainsService.md#deleteapplication) +- [deleteOrganization](modules_domains_domains_service.DomainsService.md#deleteorganization) +- [deleteRole](modules_domains_domains_service.DomainsService.md#deleterole) +- [getAppsByOrgNamespace](modules_domains_domains_service.DomainsService.md#getappsbyorgnamespace) +- [getDefinition](modules_domains_domains_service.DomainsService.md#getdefinition) +- [getENSTypesByOwner](modules_domains_domains_service.DomainsService.md#getenstypesbyowner) +- [getENSTypesBySearchPhrase](modules_domains_domains_service.DomainsService.md#getenstypesbysearchphrase) +- [getOrgHierarchy](modules_domains_domains_service.DomainsService.md#getorghierarchy) +- [getRoleDIDs](modules_domains_domains_service.DomainsService.md#getroledids) +- [getRolesByNamespace](modules_domains_domains_service.DomainsService.md#getrolesbynamespace) +- [getSubOrgsByOrgNamespace](modules_domains_domains_service.DomainsService.md#getsuborgsbyorgnamespace) +- [getSubdomains](modules_domains_domains_service.DomainsService.md#getsubdomains) +- [init](modules_domains_domains_service.DomainsService.md#init) +- [isOwner](modules_domains_domains_service.DomainsService.md#isowner) +- [namespacesWithRelations](modules_domains_domains_service.DomainsService.md#namespaceswithrelations) +- [readName](modules_domains_domains_service.DomainsService.md#readname) +- [registrationTypesOfRoles](modules_domains_domains_service.DomainsService.md#registrationtypesofroles) +- [setRoleDefinition](modules_domains_domains_service.DomainsService.md#setroledefinition) +- [updateLegacyDefinition](modules_domains_domains_service.DomainsService.md#updatelegacydefinition) +- [validateOwnership](modules_domains_domains_service.DomainsService.md#validateownership) +- [create](modules_domains_domains_service.DomainsService.md#create) + +## Constructors + +### constructor + +• **new DomainsService**(`_signerService`, `_cacheClient`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `_signerService` | [`SignerService`](modules_signer_signer_service.SignerService.md) | +| `_cacheClient` | [`CacheClient`](modules_cacheClient_cacheClient_service.CacheClient.md) | + +## Methods + +### changeAppOwnership + +▸ **changeAppOwnership**(`__namedParameters`): `Promise`<`undefined` \| { `info`: `string` ; `next`: (`__namedParameters`: { `retryCheck?`: `boolean` }) => `Promise`<`undefined` \| `TransactionReceipt`\> ; `tx`: `EncodedCall` }[]\> + +changeAppOwnership + +**`description`** change owner ship of app subdomain and all app owned subdomains + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.namespace` | `string` | +| `__namedParameters.newOwner` | `string` | +| `__namedParameters.returnSteps?` | `boolean` | + +#### Returns + +`Promise`<`undefined` \| { `info`: `string` ; `next`: (`__namedParameters`: { `retryCheck?`: `boolean` }) => `Promise`<`undefined` \| `TransactionReceipt`\> ; `tx`: `EncodedCall` }[]\> + +return array of steps needed to change ownership + +___ + +### changeOrgOwnership + +▸ **changeOrgOwnership**(`__namedParameters`): `Promise`<`undefined` \| { `info`: `string` ; `next`: (`__namedParameters`: { `retryCheck?`: `boolean` }) => `Promise`<`undefined` \| `TransactionReceipt`\> ; `tx`: `EncodedCall` }[]\> + +changeOrgOwnership + +**`description`** change owner ship of org subdomain and all org owned roles subdomains + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.namespace` | `string` | +| `__namedParameters.newOwner` | `string` | +| `__namedParameters.returnSteps?` | `boolean` | + +#### Returns + +`Promise`<`undefined` \| { `info`: `string` ; `next`: (`__namedParameters`: { `retryCheck?`: `boolean` }) => `Promise`<`undefined` \| `TransactionReceipt`\> ; `tx`: `EncodedCall` }[]\> + +return array of steps needed to change ownership + +___ + +### changeRoleOwnership + +▸ **changeRoleOwnership**(`__namedParameters`): `Promise`<`void`\> + +changeRoleOwnership + +**`description`** change ownership of role subdomain + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.namespace` | `string` | +| `__namedParameters.newOwner` | `string` | + +#### Returns + +`Promise`<`void`\> + +___ + +### checkExistenceOfDomain + +▸ **checkExistenceOfDomain**(`__namedParameters`): `Promise`<`boolean`\> + +checkExistenceOfDomain + +**`description`** check existence of domain in ENS registry + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.domain` | `string` | + +#### Returns + +`Promise`<`boolean`\> + +true or false whatever the domain is present + +___ + +### createApplication + +▸ **createApplication**(`__namedParameters`): `Promise`<`undefined` \| { `info`: `string` = "Set subdomain for application"; `next`: () => `Promise`<`void`\> ; `tx`: `EncodedCall` }[]\> + +createApp + +**`description`** creates role (create subdomain, sets the domain name and sets the role definition to metadata record in ENS Domain) + +**`description`** creates roles subdomain for the app namespace + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.appName` | `string` | +| `__namedParameters.data` | `IAppDefinition` | +| `__namedParameters.namespace` | `string` | +| `__namedParameters.returnSteps?` | `boolean` | + +#### Returns + +`Promise`<`undefined` \| { `info`: `string` = "Set subdomain for application"; `next`: () => `Promise`<`void`\> ; `tx`: `EncodedCall` }[]\> + +___ + +### createOrganization + +▸ **createOrganization**(`__namedParameters`): `Promise`<`undefined` \| { `info`: `string` = "Create organization subdomain"; `next`: () => `Promise`<`void`\> ; `tx`: `EncodedCall` }[]\> + +createOrganization + +**`description`** creates organization (create subdomain, sets the domain name and sets the role definition to metadata record in ENS Domain) + +**`description`** and sets subdomain for roles and app for org namespace + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.data` | `IOrganizationDefinition` | +| `__namedParameters.namespace` | `string` | +| `__namedParameters.orgName` | `string` | +| `__namedParameters.returnSteps?` | `boolean` | + +#### Returns + +`Promise`<`undefined` \| { `info`: `string` = "Create organization subdomain"; `next`: () => `Promise`<`void`\> ; `tx`: `EncodedCall` }[]\> + +___ + +### createRole + +▸ **createRole**(`__namedParameters`): `Promise`<`undefined` \| { `info`: `string` = "Create subdomain for role"; `next`: () => `Promise`<`void`\> ; `tx`: `EncodedCall` }[]\> + +createRole + +**`description`** creates role (create subdomain, sets the domain name and sets the role definition to metadata record in ENS Domain) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.data` | `IRoleDefinition` | +| `__namedParameters.namespace` | `string` | +| `__namedParameters.returnSteps?` | `boolean` | +| `__namedParameters.roleName` | `string` | + +#### Returns + +`Promise`<`undefined` \| { `info`: `string` = "Create subdomain for role"; `next`: () => `Promise`<`void`\> ; `tx`: `EncodedCall` }[]\> + +information (true/false) if the role was created + +___ + +### deleteApplication + +▸ **deleteApplication**(`__namedParameters`): `Promise`<`undefined` \| { `info`: `string` ; `next`: (`__namedParameters`: { `retryCheck?`: `boolean` }) => `Promise`<`undefined` \| `TransactionReceipt`\> ; `tx`: `EncodedCall` }[]\> + +deleteApplication + +**`description`** delete application and roles + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.namespace` | `string` | +| `__namedParameters.returnSteps?` | `boolean` | + +#### Returns + +`Promise`<`undefined` \| { `info`: `string` ; `next`: (`__namedParameters`: { `retryCheck?`: `boolean` }) => `Promise`<`undefined` \| `TransactionReceipt`\> ; `tx`: `EncodedCall` }[]\> + +___ + +### deleteOrganization + +▸ **deleteOrganization**(`__namedParameters`): `Promise`<`undefined` \| { `info`: `string` ; `next`: (`__namedParameters`: { `retryCheck?`: `boolean` }) => `Promise`<`undefined` \| `TransactionReceipt`\> ; `tx`: `EncodedCall` }[]\> + +deleteOrganization + +**`description`** delete organization and roles + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.namespace` | `string` | +| `__namedParameters.returnSteps?` | `boolean` | + +#### Returns + +`Promise`<`undefined` \| { `info`: `string` ; `next`: (`__namedParameters`: { `retryCheck?`: `boolean` }) => `Promise`<`undefined` \| `TransactionReceipt`\> ; `tx`: `EncodedCall` }[]\> + +___ + +### deleteRole + +▸ **deleteRole**(`__namedParameters`): `Promise`<`void`\> + +deleteRole + +**`description`** delete role + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.namespace` | `string` | + +#### Returns + +`Promise`<`void`\> + +___ + +### getAppsByOrgNamespace + +▸ **getAppsByOrgNamespace**(`__namedParameters`): `Promise`<[`IApp`](../interfaces/modules_domains_domains_types.IApp.md)[]\> + +getENSTypesByOwner + +**`description`** get all applications for organization namespace + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.namespace` | `string` | + +#### Returns + +`Promise`<[`IApp`](../interfaces/modules_domains_domains_types.IApp.md)[]\> + +array of subdomains or empty array when there is no subdomains + +___ + +### getDefinition + +▸ **getDefinition**(`__namedParameters`): `Promise`<`IRoleDefinition` \| `IOrganizationDefinition` \| `IAppDefinition`\> + +getRoleDefinition + +**`description`** get role definition form ens domain metadata record + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.namespace` | `string` | +| `__namedParameters.type` | [`ENSNamespaceTypes`](../enums/modules_domains_domains_types.ENSNamespaceTypes.md) | + +#### Returns + +`Promise`<`IRoleDefinition` \| `IOrganizationDefinition` \| `IAppDefinition`\> + +metadata string or empty string when there is no metadata + +___ + +### getENSTypesByOwner + +▸ **getENSTypesByOwner**(`__namedParameters`): `Promise`<[`IRole`](../interfaces/modules_domains_domains_types.IRole.md)[]\> \| `Promise`<[`IOrganization`](../interfaces/modules_domains_domains_types.IOrganization.md)[]\> \| `Promise`<[`IApp`](../interfaces/modules_domains_domains_types.IApp.md)[]\> + +getENSTypesByOwner + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.excludeSubOrgs?` | `boolean` | +| `__namedParameters.owner` | `string` | +| `__namedParameters.type` | [`ENSNamespaceTypes`](../enums/modules_domains_domains_types.ENSNamespaceTypes.md) | + +#### Returns + +`Promise`<[`IRole`](../interfaces/modules_domains_domains_types.IRole.md)[]\> \| `Promise`<[`IOrganization`](../interfaces/modules_domains_domains_types.IOrganization.md)[]\> \| `Promise`<[`IApp`](../interfaces/modules_domains_domains_types.IApp.md)[]\> + +___ + +### getENSTypesBySearchPhrase + +▸ **getENSTypesBySearchPhrase**(`__namedParameters`): `Promise`<([`IRole`](../interfaces/modules_domains_domains_types.IRole.md) \| [`IOrganization`](../interfaces/modules_domains_domains_types.IOrganization.md) \| [`IApp`](../interfaces/modules_domains_domains_types.IApp.md))[]\> + +getENSTypesBySearchPhrase + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.search` | `string` | +| `__namedParameters.types?` | (``"App"`` \| ``"Org"`` \| ``"Role"``)[] | + +#### Returns + +`Promise`<([`IRole`](../interfaces/modules_domains_domains_types.IRole.md) \| [`IOrganization`](../interfaces/modules_domains_domains_types.IOrganization.md) \| [`IApp`](../interfaces/modules_domains_domains_types.IApp.md))[]\> + +___ + +### getOrgHierarchy + +▸ **getOrgHierarchy**(`__namedParameters`): `Promise`<[`IOrganization`](../interfaces/modules_domains_domains_types.IOrganization.md)\> + +getOrgHierarchy + +**`description`** get all hierarchy of an organization (20 levels deep) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.namespace` | `string` | + +#### Returns + +`Promise`<[`IOrganization`](../interfaces/modules_domains_domains_types.IOrganization.md)\> + +organization with all nested subOrgs + +___ + +### getRoleDIDs + +▸ **getRoleDIDs**(`__namedParameters`): `Promise`<`string`[]\> + +getRoleDIDs + +**`description`** get all users did which have certain role + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.namespace` | `string` | + +#### Returns + +`Promise`<`string`[]\> + +array of did's + +___ + +### getRolesByNamespace + +▸ **getRolesByNamespace**(`__namedParameters`): `Promise`<[`IRole`](../interfaces/modules_domains_domains_types.IRole.md)[]\> + +getRolesByNamespace + +**`description`** get all subdomains for certain domain + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.namespace` | `string` | +| `__namedParameters.parentType` | [`Application`](../enums/modules_domains_domains_types.ENSNamespaceTypes.md#application) \| [`Organization`](../enums/modules_domains_domains_types.ENSNamespaceTypes.md#organization) | + +#### Returns + +`Promise`<[`IRole`](../interfaces/modules_domains_domains_types.IRole.md)[]\> + +array of subdomains or empty array when there is no subdomains + +___ + +### getSubOrgsByOrgNamespace + +▸ **getSubOrgsByOrgNamespace**(`__namedParameters`): `Promise`<[`IOrganization`](../interfaces/modules_domains_domains_types.IOrganization.md)[]\> + +getSubOrgsByOrgNamespace + +**`description`** get all sub organizations for organization namespace + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.namespace` | `string` | + +#### Returns + +`Promise`<[`IOrganization`](../interfaces/modules_domains_domains_types.IOrganization.md)[]\> + +array of subdomains or empty array when there is no subdomains + +___ + +### getSubdomains + +▸ **getSubdomains**(`__namedParameters`): `Promise`<`string`[]\> + +getSubdomains + +**`description`** get all subdomains for certain domain + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.domain` | `string` | +| `__namedParameters.mode?` | ``"ALL"`` \| ``"FIRSTLEVEL"`` | + +#### Returns + +`Promise`<`string`[]\> + +array of subdomains or empty array when there is no subdomains + +___ + +### init + +▸ **init**(): `Promise`<`void`\> + +#### Returns + +`Promise`<`void`\> + +___ + +### isOwner + +▸ **isOwner**(`__namedParameters`): `Promise`<`boolean`\> + +isOwner + +**`description`** check ownership of the domain + +**`default`** if user is not specified it will check the current logged user + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.domain` | `string` | +| `__namedParameters.user?` | `string` | + +#### Returns + +`Promise`<`boolean`\> + +true or false whatever the passed is user is a owner of domain + +___ + +### namespacesWithRelations + +▸ **namespacesWithRelations**(`namespaces`): `Promise`<{ `namespace`: `string` ; `owner`: `string` }[]\> + +**`description`** Collects all namespaces related data. Currently its includes only owner + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `namespaces` | `string`[] | + +#### Returns + +`Promise`<{ `namespace`: `string` ; `owner`: `string` }[]\> + +___ + +### readName + +▸ **readName**(`namehash`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `namehash` | `string` | + +#### Returns + +`Promise`<`string`\> + +___ + +### registrationTypesOfRoles + +▸ **registrationTypesOfRoles**(`roles`): `Promise`<`Record`<`string`, `Set`<[`RegistrationTypes`](../enums/modules_claims_claims_types.RegistrationTypes.md)\>\>\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `roles` | `string`[] | + +#### Returns + +`Promise`<`Record`<`string`, `Set`<[`RegistrationTypes`](../enums/modules_claims_claims_types.RegistrationTypes.md)\>\>\> + +___ + +### setRoleDefinition + +▸ **setRoleDefinition**(`__namedParameters`): `Promise`<`void`\> + +setRoleDefinition + +**`description`** sets role definition in ENS domain + +**`description`** please use it only when you want to update role definitions for already created role (domain) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.data` | `IRoleDefinition` \| `IOrganizationDefinition` \| `IAppDefinition` | +| `__namedParameters.domain` | `string` | + +#### Returns + +`Promise`<`void`\> + +___ + +### updateLegacyDefinition + +▸ **updateLegacyDefinition**(`domain`, `data`): `Promise`<`boolean`\> + +In initial version of Switchboard, role definitions where contained in ENS PublicResolver. +However, in order for key properties of role definitions to be readable on-chain, a new RoleDefinitionResolver is used. +This function sets the resolver in the ENS to the new contract for definitions that are pointing to the old contract + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `domain` | `string` | domain to potentially update | +| `data` | `IRoleDefinition` \| `IOrganizationDefinition` \| `IAppDefinition` | definition to apply to domain | + +#### Returns + +`Promise`<`boolean`\> + +___ + +### validateOwnership + +▸ **validateOwnership**(`__namedParameters`): `Promise`<`string`[]\> + +validateOwnership + +**`description`** check ownership of the domain and subdomains of org, app or role + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.namespace` | `string` | +| `__namedParameters.type` | [`ENSNamespaceTypes`](../enums/modules_domains_domains_types.ENSNamespaceTypes.md) | + +#### Returns + +`Promise`<`string`[]\> + +true or false whatever the passed is user is a owner of org, app or role + +___ + +### create + +▸ `Static` **create**(`signerService`, `cacheClient`): `Promise`<[`DomainsService`](modules_domains_domains_service.DomainsService.md)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `signerService` | [`SignerService`](modules_signer_signer_service.SignerService.md) | +| `cacheClient` | [`CacheClient`](modules_cacheClient_cacheClient_service.CacheClient.md) | + +#### Returns + +`Promise`<[`DomainsService`](modules_domains_domains_service.DomainsService.md)\> diff --git a/docs/api/classes/modules_messaging_messaging_service.MessagingService.md b/docs/api/classes/modules_messaging_messaging_service.MessagingService.md new file mode 100644 index 00000000..ccbe805b --- /dev/null +++ b/docs/api/classes/modules_messaging_messaging_service.MessagingService.md @@ -0,0 +1,106 @@ +# Class: MessagingService + +[modules/messaging/messaging.service](../modules/modules_messaging_messaging_service.md).MessagingService + +## Table of contents + +### Constructors + +- [constructor](modules_messaging_messaging_service.MessagingService.md#constructor) + +### Methods + +- [init](modules_messaging_messaging_service.MessagingService.md#init) +- [publish](modules_messaging_messaging_service.MessagingService.md#publish) +- [subscribeTo](modules_messaging_messaging_service.MessagingService.md#subscribeto) +- [unsubscribeFrom](modules_messaging_messaging_service.MessagingService.md#unsubscribefrom) +- [create](modules_messaging_messaging_service.MessagingService.md#create) + +## Constructors + +### constructor + +• **new MessagingService**(`_signerService`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `_signerService` | [`SignerService`](modules_signer_signer_service.SignerService.md) | + +## Methods + +### init + +▸ **init**(): `Promise`<`void`\> + +#### Returns + +`Promise`<`void`\> + +___ + +### publish + +▸ **publish**(`subject`, `data`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `subject` | `string` | +| `data` | `Uint8Array` | + +#### Returns + +`Promise`<`void`\> + +___ + +### subscribeTo + +▸ **subscribeTo**(`__namedParameters`): `Promise`<`undefined` \| `number`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.subject` | `string` | +| `__namedParameters.messageHandler` | (`data`: [`IMessage`](../interfaces/modules_messaging_messaging_types.IMessage.md)) => `void` | + +#### Returns + +`Promise`<`undefined` \| `number`\> + +___ + +### unsubscribeFrom + +▸ **unsubscribeFrom**(`subscriptionId`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `subscriptionId` | `number` | + +#### Returns + +`Promise`<`void`\> + +___ + +### create + +▸ `Static` **create**(`signerService`): `Promise`<[`MessagingService`](modules_messaging_messaging_service.MessagingService.md)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `signerService` | [`SignerService`](modules_signer_signer_service.SignerService.md) | + +#### Returns + +`Promise`<[`MessagingService`](modules_messaging_messaging_service.MessagingService.md)\> diff --git a/docs/api/classes/modules_signer_signer_service.SignerService.md b/docs/api/classes/modules_signer_signer_service.SignerService.md new file mode 100644 index 00000000..e7799f35 --- /dev/null +++ b/docs/api/classes/modules_signer_signer_service.SignerService.md @@ -0,0 +1,235 @@ +# Class: SignerService + +[modules/signer/signer.service](../modules/modules_signer_signer_service.md).SignerService + +## Table of contents + +### Constructors + +- [constructor](modules_signer_signer_service.SignerService.md#constructor) + +### Accessors + +- [address](modules_signer_signer_service.SignerService.md#address) +- [chainId](modules_signer_signer_service.SignerService.md#chainid) +- [provider](modules_signer_signer_service.SignerService.md#provider) +- [providerType](modules_signer_signer_service.SignerService.md#providertype) +- [signer](modules_signer_signer_service.SignerService.md#signer) + +### Methods + +- [balance](modules_signer_signer_service.SignerService.md#balance) +- [clearSession](modules_signer_signer_service.SignerService.md#clearsession) +- [connect](modules_signer_signer_service.SignerService.md#connect) +- [destroy](modules_signer_signer_service.SignerService.md#destroy) +- [init](modules_signer_signer_service.SignerService.md#init) +- [initEventHandlers](modules_signer_signer_service.SignerService.md#initeventhandlers) +- [onInit](modules_signer_signer_service.SignerService.md#oninit) +- [publicKey](modules_signer_signer_service.SignerService.md#publickey) +- [publicKeyAndIdentityToken](modules_signer_signer_service.SignerService.md#publickeyandidentitytoken) +- [send](modules_signer_signer_service.SignerService.md#send) +- [signMessage](modules_signer_signer_service.SignerService.md#signmessage) + +## Constructors + +### constructor + +• **new SignerService**(`_signer`, `_providerType`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `_signer` | `Required`<`Signer`\> | +| `_providerType` | [`ProviderType`](../enums/modules_signer_signer_types.ProviderType.md) | + +## Accessors + +### address + +• `get` **address**(): `string` + +#### Returns + +`string` + +___ + +### chainId + +• `get` **chainId**(): `number` + +#### Returns + +`number` + +___ + +### provider + +• `get` **provider**(): `Provider` + +#### Returns + +`Provider` + +___ + +### providerType + +• `get` **providerType**(): [`ProviderType`](../enums/modules_signer_signer_types.ProviderType.md) + +#### Returns + +[`ProviderType`](../enums/modules_signer_signer_types.ProviderType.md) + +___ + +### signer + +• `get` **signer**(): `Required`<`Signer`\> + +#### Returns + +`Required`<`Signer`\> + +## Methods + +### balance + +▸ **balance**(): `Promise`<`BigNumber`\> + +#### Returns + +`Promise`<`BigNumber`\> + +___ + +### clearSession + +▸ **clearSession**(): `void` + +#### Returns + +`void` + +___ + +### connect + +▸ **connect**(`signer`, `providerType`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `signer` | `Required`<`Signer`\> | +| `providerType` | [`ProviderType`](../enums/modules_signer_signer_types.ProviderType.md) | + +#### Returns + +`Promise`<`void`\> + +___ + +### destroy + +▸ **destroy**(): `Promise`<`void`\> + +#### Returns + +`Promise`<`void`\> + +___ + +### init + +▸ **init**(): `Promise`<[`AccountInfo`](../modules/modules_signer_signer_types.md#accountinfo)\> + +#### Returns + +`Promise`<[`AccountInfo`](../modules/modules_signer_signer_types.md#accountinfo)\> + +___ + +### initEventHandlers + +▸ **initEventHandlers**(): `void` + +Add event handler for certain events + +**`requires`** to be called after the connection to wallet was initialized + +#### Returns + +`void` + +___ + +### onInit + +▸ **onInit**(`initializer`): `void` + +Registers reinitialization of dependent service on signer reconnection + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `initializer` | [`ServiceInitializer`](../modules/modules_signer_signer_service.md#serviceinitializer) | + +#### Returns + +`void` + +___ + +### publicKey + +▸ **publicKey**(): `Promise`<`string`\> + +#### Returns + +`Promise`<`string`\> + +___ + +### publicKeyAndIdentityToken + +▸ **publicKeyAndIdentityToken**(): `Promise`<[`IPubKeyAndIdentityToken`](../interfaces/modules_signer_signer_types.IPubKeyAndIdentityToken.md)\> + +#### Returns + +`Promise`<[`IPubKeyAndIdentityToken`](../interfaces/modules_signer_signer_types.IPubKeyAndIdentityToken.md)\> + +___ + +### send + +▸ **send**(`__namedParameters`): `Promise`<`TransactionReceipt`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `TransactionRequest` | + +#### Returns + +`Promise`<`TransactionReceipt`\> + +___ + +### signMessage + +▸ **signMessage**(`message`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `message` | `Uint8Array` | + +#### Returns + +`Promise`<`string`\> diff --git a/docs/api/classes/modules_staking_staking_service.StakingPool.md b/docs/api/classes/modules_staking_staking_service.StakingPool.md new file mode 100644 index 00000000..f1406bda --- /dev/null +++ b/docs/api/classes/modules_staking_staking_service.StakingPool.md @@ -0,0 +1,135 @@ +# Class: StakingPool + +[modules/staking/staking.service](../modules/modules_staking_staking_service.md).StakingPool + +Abstraction over staking pool smart contract + +## Table of contents + +### Constructors + +- [constructor](modules_staking_staking_service.StakingPool.md#constructor) + +### Methods + +- [checkReward](modules_staking_staking_service.StakingPool.md#checkreward) +- [getStake](modules_staking_staking_service.StakingPool.md#getstake) +- [putStake](modules_staking_staking_service.StakingPool.md#putstake) +- [requestWithdraw](modules_staking_staking_service.StakingPool.md#requestwithdraw) +- [requestWithdrawDelay](modules_staking_staking_service.StakingPool.md#requestwithdrawdelay) +- [withdraw](modules_staking_staking_service.StakingPool.md#withdraw) +- [withdrawalDelay](modules_staking_staking_service.StakingPool.md#withdrawaldelay) + +## Constructors + +### constructor + +• **new StakingPool**(`signerService`, `address`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `signerService` | [`SignerService`](modules_signer_signer_service.SignerService.md) | +| `address` | `string` | + +## Methods + +### checkReward + +▸ **checkReward**(): `Promise`<`BigNumber`\> + +Accumulated reward + +#### Returns + +`Promise`<`BigNumber`\> + +___ + +### getStake + +▸ **getStake**(`patron?`): `Promise`<[`Stake`](../modules/modules_staking_staking_service.md#stake)\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `patron?` | `string` | staker address | + +#### Returns + +`Promise`<[`Stake`](../modules/modules_staking_staking_service.md#stake)\> + +Stake + +___ + +### putStake + +▸ **putStake**(`stake`): `Promise`<`void`\> + +**`description`** Locks stake and starts accumulating reward + +**`emits`** StakingPool.StakePut + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `stake` | `number` \| `BigNumber` | + +#### Returns + +`Promise`<`void`\> + +___ + +### requestWithdraw + +▸ **requestWithdraw**(): `Promise`<`void`\> + +**`description`** Stops accumulating of the reward and prepars stake to withdraw after withdraw delay. +Withdraw request unavailable until minimum staking period ends + +#### Returns + +`Promise`<`void`\> + +___ + +### requestWithdrawDelay + +▸ **requestWithdrawDelay**(): `Promise`<`number`\> + +**`description`** Returns time left to enable request withdraw + +#### Returns + +`Promise`<`number`\> + +___ + +### withdraw + +▸ **withdraw**(): `Promise`<`void`\> + +**`description`** pays back stake with accumulated reward. Withdrawn unavailable until withdrawn delay ends + +**`emits`** StakingPool.StakeWithdrawn + +#### Returns + +`Promise`<`void`\> + +___ + +### withdrawalDelay + +▸ **withdrawalDelay**(): `Promise`<`number`\> + +**`description`** Returns time left to enable withdraw + +#### Returns + +`Promise`<`number`\> diff --git a/docs/api/classes/modules_staking_staking_service.StakingService.md b/docs/api/classes/modules_staking_staking_service.StakingService.md new file mode 100644 index 00000000..8a72b6c1 --- /dev/null +++ b/docs/api/classes/modules_staking_staking_service.StakingService.md @@ -0,0 +1,116 @@ +# Class: StakingService + +[modules/staking/staking.service](../modules/modules_staking_staking_service.md).StakingService + +Inteneded for staking pools management + +## Table of contents + +### Constructors + +- [constructor](modules_staking_staking_service.StakingService.md#constructor) + +### Methods + +- [allServices](modules_staking_staking_service.StakingService.md#allservices) +- [getPool](modules_staking_staking_service.StakingService.md#getpool) +- [init](modules_staking_staking_service.StakingService.md#init) +- [launchPool](modules_staking_staking_service.StakingService.md#launchpool) +- [create](modules_staking_staking_service.StakingService.md#create) + +## Constructors + +### constructor + +• **new StakingService**(`_signerService`, `_domainsService`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `_signerService` | [`SignerService`](modules_signer_signer_service.SignerService.md) | +| `_domainsService` | [`DomainsService`](modules_domains_domains_service.DomainsService.md) | + +## Methods + +### allServices + +▸ **allServices**(): `Promise`<[`Service`](../modules/modules_staking_staking_service.md#service)[]\> + +**`description`** Returns all services for which pools are launched + +#### Returns + +`Promise`<[`Service`](../modules/modules_staking_staking_service.md#service)[]\> + +___ + +### getPool + +▸ **getPool**(`org`): `Promise`<``null`` \| [`StakingPool`](modules_staking_staking_service.StakingPool.md)\> + +**`description`** Returns pool launched for `org` if any + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `org` | `string` | ENS name of organization | + +#### Returns + +`Promise`<``null`` \| [`StakingPool`](modules_staking_staking_service.StakingPool.md)\> + +___ + +### init + +▸ **init**(): `Promise`<`void`\> + +**`description`** Connects to the same chain as `signer`. The signer must be connected + +#### Returns + +`Promise`<`void`\> + +___ + +### launchPool + +▸ **launchPool**(`__namedParameters`): `Promise`<`void`\> + +**`description`** Deployes organization staking pool + +**`emits`** StakingPoolFactory.StakingPoolLaunched + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `__namedParameters` | `Object` | - | +| `__namedParameters.minStakingPeriod` | `number` \| `BigNumber` | minimum staking period in seconds | +| `__namedParameters.org` | `string` | organization ENS name | +| `__namedParameters.patronRewardPortion` | `number` | patron's part of the reward in fractions of thousandth | +| `__namedParameters.patronRoles` | `string`[] | roles required to stake | +| `__namedParameters.principal` | `BigNumber` | stake put by service provider when pool is launched | + +#### Returns + +`Promise`<`void`\> + +___ + +### create + +▸ `Static` **create**(`signerService`, `domainsService`): `Promise`<[`StakingService`](modules_staking_staking_service.StakingService.md)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `signerService` | [`SignerService`](modules_signer_signer_service.SignerService.md) | +| `domainsService` | [`DomainsService`](modules_domains_domains_service.DomainsService.md) | + +#### Returns + +`Promise`<[`StakingService`](modules_staking_staking_service.StakingService.md)\> diff --git a/docs/api/classes/signer_Owner.Owner.md b/docs/api/classes/signer_Owner.Owner.md deleted file mode 100644 index e07c44a2..00000000 --- a/docs/api/classes/signer_Owner.Owner.md +++ /dev/null @@ -1,211 +0,0 @@ -# Class: Owner - -[signer/Owner](../modules/signer_Owner.md).Owner - -## Hierarchy - -- `Signer` - - ↳ **`Owner`** - -## Implements - -- `EwSigner` - -## Table of contents - -### Constructors - -- [constructor](signer_Owner.Owner.md#constructor) - -### Properties - -- [privateKey](signer_Owner.Owner.md#privatekey) -- [provider](signer_Owner.Owner.md#provider) -- [publicKey](signer_Owner.Owner.md#publickey) -- [signer](signer_Owner.Owner.md#signer) - -### Methods - -- [connect](signer_Owner.Owner.md#connect) -- [getAddress](signer_Owner.Owner.md#getaddress) -- [sendTransaction](signer_Owner.Owner.md#sendtransaction) -- [signMessage](signer_Owner.Owner.md#signmessage) -- [signTransaction](signer_Owner.Owner.md#signtransaction) - -## Constructors - -### constructor - -• **new Owner**(`signer`, `provider`, `publicKey`, `privateKey?`) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `signer` | `Signer` | -| `provider` | `Provider` | -| `publicKey` | `string` | -| `privateKey?` | `string` | - -#### Overrides - -Signer.constructor - -## Properties - -### privateKey - -• `Optional` **privateKey**: `string` - -#### Implementation of - -EwSigner.privateKey - -___ - -### provider - -• **provider**: `Provider` - -#### Implementation of - -EwSigner.provider - -#### Inherited from - -Signer.provider - -___ - -### publicKey - -• **publicKey**: `string` - -#### Implementation of - -EwSigner.publicKey - -___ - -### signer - -• **signer**: `Signer` - -#### Implementation of - -EwSigner.signer - -## Methods - -### connect - -▸ **connect**(`provider`): `Signer` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `provider` | `Provider` | - -#### Returns - -`Signer` - -#### Implementation of - -EwSigner.connect - -#### Overrides - -Signer.connect - -___ - -### getAddress - -▸ **getAddress**(): `Promise`<`string`\> - -#### Returns - -`Promise`<`string`\> - -#### Implementation of - -EwSigner.getAddress - -#### Overrides - -Signer.getAddress - -___ - -### sendTransaction - -▸ **sendTransaction**(`transaction`): `Promise`<`TransactionResponse`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `transaction` | `TransactionRequest` | - -#### Returns - -`Promise`<`TransactionResponse`\> - -#### Implementation of - -EwSigner.sendTransaction - -#### Overrides - -Signer.sendTransaction - -___ - -### signMessage - -▸ **signMessage**(`message`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `message` | `string` \| `Bytes` | - -#### Returns - -`Promise`<`string`\> - -#### Implementation of - -EwSigner.signMessage - -#### Overrides - -Signer.signMessage - -___ - -### signTransaction - -▸ **signTransaction**(`transaction`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `transaction` | `Deferrable`<`TransactionRequest`\> | - -#### Returns - -`Promise`<`string`\> - -#### Implementation of - -EwSigner.signTransaction - -#### Overrides - -Signer.signTransaction diff --git a/docs/api/classes/staking.StakingPool.md b/docs/api/classes/staking.StakingPool.md deleted file mode 100644 index c2728e36..00000000 --- a/docs/api/classes/staking.StakingPool.md +++ /dev/null @@ -1,165 +0,0 @@ -# Class: StakingPool - -[staking](../modules/staking.md).StakingPool - -Abstraction over staking pool smart contract - -## Table of contents - -### Constructors - -- [constructor](staking.StakingPool.md#constructor) - -### Methods - -- [checkReward](staking.StakingPool.md#checkreward) -- [connect](staking.StakingPool.md#connect) -- [getStake](staking.StakingPool.md#getstake) -- [putStake](staking.StakingPool.md#putstake) -- [requestWithdraw](staking.StakingPool.md#requestwithdraw) -- [requestWithdrawDelay](staking.StakingPool.md#requestwithdrawdelay) -- [withdraw](staking.StakingPool.md#withdraw) -- [withdrawalDelay](staking.StakingPool.md#withdrawaldelay) - -## Constructors - -### constructor - -• **new StakingPool**(`patron`, `address`) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `patron` | `Required`<`Signer`\> | -| `address` | `string` | - -## Methods - -### checkReward - -▸ **checkReward**(): `Promise`<`BigNumber`\> - -Accumulated reward - -#### Returns - -`Promise`<`BigNumber`\> - -___ - -### connect - -▸ **connect**(`signer`): [`StakingPool`](staking.StakingPool.md) - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `signer` | `Signer` | Signer connected to provider | - -#### Returns - -[`StakingPool`](staking.StakingPool.md) - -___ - -### getStake - -▸ **getStake**(`patron?`): `Promise`<[`Stake`](../modules/staking.md#stake)\> - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `patron?` | `string` | staker address | - -#### Returns - -`Promise`<[`Stake`](../modules/staking.md#stake)\> - -Stake - -___ - -### putStake - -▸ **putStake**(`stake`, `transactionSpeed?`): `Promise`<`void`\> - -**`description`** Locks stake and starts accumulating reward. If needed stake will be reduced to be able to pay fee - -**`emits`** StakingPool.StakePut - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `stake` | `number` \| `BigNumber` | -| `transactionSpeed` | [`TransactionSpeed`](../enums/staking.TransactionSpeed.md) | - -#### Returns - -`Promise`<`void`\> - -___ - -### requestWithdraw - -▸ **requestWithdraw**(`transactionSpeed?`): `Promise`<`void`\> - -**`description`** Stops accumulating of the reward and prepars stake to withdraw after withdraw delay. -Withdraw request unavailable until minimum staking period ends - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `transactionSpeed` | [`TransactionSpeed`](../enums/staking.TransactionSpeed.md) | - -#### Returns - -`Promise`<`void`\> - -___ - -### requestWithdrawDelay - -▸ **requestWithdrawDelay**(): `Promise`<`number`\> - -**`description`** Returns time left to enable request withdraw - -#### Returns - -`Promise`<`number`\> - -___ - -### withdraw - -▸ **withdraw**(`transactionSpeed?`): `Promise`<`void`\> - -**`description`** pays back stake with accumulated reward. Withdrawn unavailable until withdrawn delay ends - -**`emits`** StakingPool.StakeWithdrawn - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `transactionSpeed` | [`TransactionSpeed`](../enums/staking.TransactionSpeed.md) | - -#### Returns - -`Promise`<`void`\> - -___ - -### withdrawalDelay - -▸ **withdrawalDelay**(): `Promise`<`number`\> - -**`description`** Returns time left to enable withdraw - -#### Returns - -`Promise`<`number`\> diff --git a/docs/api/classes/staking.StakingPoolService.md b/docs/api/classes/staking.StakingPoolService.md deleted file mode 100644 index 1f263513..00000000 --- a/docs/api/classes/staking.StakingPoolService.md +++ /dev/null @@ -1,87 +0,0 @@ -# Class: StakingPoolService - -[staking](../modules/staking.md).StakingPoolService - -Inteneded for staking pools management - -## Table of contents - -### Methods - -- [allServices](staking.StakingPoolService.md#allservices) -- [getPool](staking.StakingPoolService.md#getpool) -- [launchStakingPool](staking.StakingPoolService.md#launchstakingpool) -- [init](staking.StakingPoolService.md#init) - -## Methods - -### allServices - -▸ **allServices**(): `Promise`<[`Service`](../modules/staking.md#service)[]\> - -**`description`** Returns all services for which pools are launched - -#### Returns - -`Promise`<[`Service`](../modules/staking.md#service)[]\> - -___ - -### getPool - -▸ **getPool**(`org`): `Promise`<``null`` \| [`StakingPool`](staking.StakingPool.md)\> - -**`description`** Returns pool launched for `org` if any - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `org` | `string` | ENS name of organization | - -#### Returns - -`Promise`<``null`` \| [`StakingPool`](staking.StakingPool.md)\> - -___ - -### launchStakingPool - -▸ **launchStakingPool**(`__namedParameters`): `Promise`<`void`\> - -**`description`** Deployes organization staking pool - -**`emits`** StakingPoolFactory.StakingPoolLaunched - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `__namedParameters` | `Object` | - | -| `__namedParameters.minStakingPeriod` | `number` \| `BigNumber` | minimum staking period in seconds | -| `__namedParameters.org` | `string` | organization ENS name | -| `__namedParameters.patronRewardPortion` | `number` | patron's part of the reward in fractions of thousandth | -| `__namedParameters.patronRoles` | `string`[] | roles required to stake | -| `__namedParameters.principal` | `BigNumber` | stake put by service provider when pool is launched | - -#### Returns - -`Promise`<`void`\> - -___ - -### init - -▸ `Static` **init**(`signer`): `Promise`<[`StakingPoolService`](staking.StakingPoolService.md)\> - -**`description`** Connects to the same chain as `signer`. The signer must be connected - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `signer` | `Signer` | Signer with connected provider | - -#### Returns - -`Promise`<[`StakingPoolService`](staking.StakingPoolService.md)\> diff --git a/docs/api/classes/walletconnect_ControllableWalletConnect.ControllableWalletConnect.md b/docs/api/classes/walletconnect_ControllableWalletConnect.ControllableWalletConnect.md deleted file mode 100644 index bf6e0302..00000000 --- a/docs/api/classes/walletconnect_ControllableWalletConnect.ControllableWalletConnect.md +++ /dev/null @@ -1,69 +0,0 @@ -# Class: ControllableWalletConnect - -[walletconnect/ControllableWalletConnect](../modules/walletconnect_ControllableWalletConnect.md).ControllableWalletConnect - -Extension of WalletConnect client that allows session creation to be disabled -This is helpful to be sure that session creation won't be attempted after closing -the connection. See [MYEN-625](https://energyweb.atlassian.net/browse/MYEN-625) - -## Hierarchy - -- `WalletConnect` - - ↳ **`ControllableWalletConnect`** - -## Table of contents - -### Constructors - -- [constructor](walletconnect_ControllableWalletConnect.ControllableWalletConnect.md#constructor) - -### Properties - -- [canCreateSession](walletconnect_ControllableWalletConnect.ControllableWalletConnect.md#cancreatesession) - -### Methods - -- [createSession](walletconnect_ControllableWalletConnect.ControllableWalletConnect.md#createsession) - -## Constructors - -### constructor - -• **new ControllableWalletConnect**(`connectorOpts`) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `connectorOpts` | `IWalletConnectOptions` | - -#### Overrides - -WalletConnect.constructor - -## Properties - -### canCreateSession - -• **canCreateSession**: `boolean` = `true` - -## Methods - -### createSession - -▸ **createSession**(`opts?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `opts?` | `ICreateSessionOptions` | - -#### Returns - -`Promise`<`void`\> - -#### Overrides - -WalletConnect.createSession diff --git a/docs/api/classes/walletconnect_WalletConnectService.WalletConnectService.md b/docs/api/classes/walletconnect_WalletConnectService.WalletConnectService.md deleted file mode 100644 index b2b7dbf5..00000000 --- a/docs/api/classes/walletconnect_WalletConnectService.WalletConnectService.md +++ /dev/null @@ -1,82 +0,0 @@ -# Class: WalletConnectService - -[walletconnect/WalletConnectService](../modules/walletconnect_WalletConnectService.md).WalletConnectService - -Encapsulates a WalletConnect connection - -## Table of contents - -### Constructors - -- [constructor](walletconnect_WalletConnectService.WalletConnectService.md#constructor) - -### Methods - -- [closeConnection](walletconnect_WalletConnectService.WalletConnectService.md#closeconnection) -- [getProvider](walletconnect_WalletConnectService.WalletConnectService.md#getprovider) -- [initialize](walletconnect_WalletConnectService.WalletConnectService.md#initialize) -- [isConnected](walletconnect_WalletConnectService.WalletConnectService.md#isconnected) - -## Constructors - -### constructor - -• **new WalletConnectService**(`bridgeUrl`, `infuraId?`, `ewKeyManagerUrl?`) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `bridgeUrl` | `string` | -| `infuraId?` | `string` | -| `ewKeyManagerUrl?` | `string` | - -## Methods - -### closeConnection - -▸ **closeConnection**(): `Promise`<`void`\> - -#### Returns - -`Promise`<`void`\> - -___ - -### getProvider - -▸ **getProvider**(): `WalletConnectProvider` - -**`requires`** intialize be called first - -#### Returns - -`WalletConnectProvider` - -the WalletConnectProvider of this instance - -___ - -### initialize - -▸ **initialize**(`walletProvider`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `walletProvider` | [`WalletProvider`](../enums/types_WalletProvider.WalletProvider.md) | - -#### Returns - -`Promise`<`void`\> - -___ - -### isConnected - -▸ **isConnected**(): `boolean` - -#### Returns - -`boolean` diff --git a/docs/api/enums/cacheServerClient_cacheServerClient_types.AssetHistoryEventType.md b/docs/api/enums/cacheServerClient_cacheServerClient_types.AssetHistoryEventType.md deleted file mode 100644 index 5693c9b8..00000000 --- a/docs/api/enums/cacheServerClient_cacheServerClient_types.AssetHistoryEventType.md +++ /dev/null @@ -1,43 +0,0 @@ -# Enumeration: AssetHistoryEventType - -[cacheServerClient/cacheServerClient.types](../modules/cacheServerClient_cacheServerClient_types.md).AssetHistoryEventType - -## Table of contents - -### Enumeration members - -- [ASSET\_CREATED](cacheServerClient_cacheServerClient_types.AssetHistoryEventType.md#asset_created) -- [ASSET\_OFFERED](cacheServerClient_cacheServerClient_types.AssetHistoryEventType.md#asset_offered) -- [ASSET\_OFFER\_CANCELED](cacheServerClient_cacheServerClient_types.AssetHistoryEventType.md#asset_offer_canceled) -- [ASSET\_OFFER\_REJECTED](cacheServerClient_cacheServerClient_types.AssetHistoryEventType.md#asset_offer_rejected) -- [ASSET\_TRANSFERRED](cacheServerClient_cacheServerClient_types.AssetHistoryEventType.md#asset_transferred) - -## Enumeration members - -### ASSET\_CREATED - -• **ASSET\_CREATED** = `"ASSET_CREATED"` - -___ - -### ASSET\_OFFERED - -• **ASSET\_OFFERED** = `"ASSET_OFFERED"` - -___ - -### ASSET\_OFFER\_CANCELED - -• **ASSET\_OFFER\_CANCELED** = `"ASSET_OFFER_CANCELED"` - -___ - -### ASSET\_OFFER\_REJECTED - -• **ASSET\_OFFER\_REJECTED** = `"ASSET_OFFER_REJECTED"` - -___ - -### ASSET\_TRANSFERRED - -• **ASSET\_TRANSFERRED** = `"ASSET_TRANSFERRED"` diff --git a/docs/api/enums/cacheServerClient_cacheServerClient_types.Order.md b/docs/api/enums/cacheServerClient_cacheServerClient_types.Order.md deleted file mode 100644 index 8720fb9b..00000000 --- a/docs/api/enums/cacheServerClient_cacheServerClient_types.Order.md +++ /dev/null @@ -1,22 +0,0 @@ -# Enumeration: Order - -[cacheServerClient/cacheServerClient.types](../modules/cacheServerClient_cacheServerClient_types.md).Order - -## Table of contents - -### Enumeration members - -- [ASC](cacheServerClient_cacheServerClient_types.Order.md#asc) -- [DESC](cacheServerClient_cacheServerClient_types.Order.md#desc) - -## Enumeration members - -### ASC - -• **ASC** = `"ASC"` - -___ - -### DESC - -• **DESC** = `"DESC"` diff --git a/docs/api/enums/cacheServerClient_cacheServerClient_types.RegistrationTypes.md b/docs/api/enums/cacheServerClient_cacheServerClient_types.RegistrationTypes.md deleted file mode 100644 index ce95f789..00000000 --- a/docs/api/enums/cacheServerClient_cacheServerClient_types.RegistrationTypes.md +++ /dev/null @@ -1,22 +0,0 @@ -# Enumeration: RegistrationTypes - -[cacheServerClient/cacheServerClient.types](../modules/cacheServerClient_cacheServerClient_types.md).RegistrationTypes - -## Table of contents - -### Enumeration members - -- [OffChain](cacheServerClient_cacheServerClient_types.RegistrationTypes.md#offchain) -- [OnChain](cacheServerClient_cacheServerClient_types.RegistrationTypes.md#onchain) - -## Enumeration members - -### OffChain - -• **OffChain** = `"RegistrationTypes::OffChain"` - -___ - -### OnChain - -• **OnChain** = `"RegistrationTypes::OnChain"` diff --git a/docs/api/enums/errors_ErrorMessages.ERROR_MESSAGES.md b/docs/api/enums/errors_ErrorMessages.ERROR_MESSAGES.md index 85047f76..78c8951f 100644 --- a/docs/api/enums/errors_ErrorMessages.ERROR_MESSAGES.md +++ b/docs/api/enums/errors_ErrorMessages.ERROR_MESSAGES.md @@ -7,37 +7,20 @@ ### Enumeration members - [APP\_WITH\_ROLES](errors_ErrorMessages.ERROR_MESSAGES.md#app_with_roles) -- [CACHE\_CLIENT\_NOT\_PROVIDED](errors_ErrorMessages.ERROR_MESSAGES.md#cache_client_not_provided) -- [CACHE\_SERVER\_NOT\_REGISTERED](errors_ErrorMessages.ERROR_MESSAGES.md#cache_server_not_registered) -- [CLAIMS\_NOT\_INITIALIZED](errors_ErrorMessages.ERROR_MESSAGES.md#claims_not_initialized) -- [CLAIM\_PUBLISHER\_NOT\_REQUESTER](errors_ErrorMessages.ERROR_MESSAGES.md#claim_publisher_not_requester) -- [DID\_DOCUMENT\_NOT\_INITIALIZED](errors_ErrorMessages.ERROR_MESSAGES.md#did_document_not_initialized) -- [ENS\_REGISTRY\_CONTRACT\_NOT\_INITIALIZED](errors_ErrorMessages.ERROR_MESSAGES.md#ens_registry_contract_not_initialized) -- [ENS\_REGISTRY\_NOT\_INITIALIZED](errors_ErrorMessages.ERROR_MESSAGES.md#ens_registry_not_initialized) -- [ENS\_RESOLVER\_NOT\_INITIALIZED](errors_ErrorMessages.ERROR_MESSAGES.md#ens_resolver_not_initialized) +- [CAN\_NOT\_UPDATE\_NOT\_CONTROLLED\_DOCUMENT](errors_ErrorMessages.ERROR_MESSAGES.md#can_not_update_not_controlled_document) - [ENS\_TYPE\_NOT\_SUPPORTED](errors_ErrorMessages.ERROR_MESSAGES.md#ens_type_not_supported) - [INSUFFICIENT\_BALANCE](errors_ErrorMessages.ERROR_MESSAGES.md#insufficient_balance) -- [JWT\_NOT\_INITIALIZED](errors_ErrorMessages.ERROR_MESSAGES.md#jwt_not_initialized) -- [METAMASK\_EXTENSION\_NOT\_AVAILABLE](errors_ErrorMessages.ERROR_MESSAGES.md#metamask_extension_not_available) -- [NATS\_NOT\_CONNECTED](errors_ErrorMessages.ERROR_MESSAGES.md#nats_not_connected) -- [NOT\_CONNECTED\_TO\_VOLTA](errors_ErrorMessages.ERROR_MESSAGES.md#not_connected_to_volta) -- [NO\_PROVIDER](errors_ErrorMessages.ERROR_MESSAGES.md#no_provider) -- [NO\_RPC\_URL](errors_ErrorMessages.ERROR_MESSAGES.md#no_rpc_url) +- [METAMASK\_PROVIDER\_NOT\_DETECTED](errors_ErrorMessages.ERROR_MESSAGES.md#metamask_provider_not_detected) +- [NOT\_AUTHORIZED\_TO\_CHANGE\_DOMAIN](errors_ErrorMessages.ERROR_MESSAGES.md#not_authorized_to_change_domain) - [ONCHAIN\_ROLE\_VERSION\_NOT\_SPECIFIED](errors_ErrorMessages.ERROR_MESSAGES.md#onchain_role_version_not_specified) - [ORG\_WITH\_APPS](errors_ErrorMessages.ERROR_MESSAGES.md#org_with_apps) - [ORG\_WITH\_ROLES](errors_ErrorMessages.ERROR_MESSAGES.md#org_with_roles) -- [PRIVATE\_KEY\_NOT\_PROVIDED](errors_ErrorMessages.ERROR_MESSAGES.md#private_key_not_provided) -- [PROVIDER\_NOT\_INITIALIZED](errors_ErrorMessages.ERROR_MESSAGES.md#provider_not_initialized) - [PUBLIC\_KEY\_NOT\_RECOVERED](errors_ErrorMessages.ERROR_MESSAGES.md#public_key_not_recovered) - [ROLE\_NOT\_EXISTS](errors_ErrorMessages.ERROR_MESSAGES.md#role_not_exists) - [ROLE\_PREREQUISITES\_NOT\_MET](errors_ErrorMessages.ERROR_MESSAGES.md#role_prerequisites_not_met) -- [RPC\_URL\_NOT\_PROVIDED](errors_ErrorMessages.ERROR_MESSAGES.md#rpc_url_not_provided) -- [SIGNER\_NOT\_INITIALIZED](errors_ErrorMessages.ERROR_MESSAGES.md#signer_not_initialized) - [STAKE\_WAS\_NOT\_PUT](errors_ErrorMessages.ERROR_MESSAGES.md#stake_was_not_put) -- [UNABLE\_TO\_OBTAIN\_PUBLIC\_KEY](errors_ErrorMessages.ERROR_MESSAGES.md#unable_to_obtain_public_key) -- [USER\_NOT\_LOGGED\_IN](errors_ErrorMessages.ERROR_MESSAGES.md#user_not_logged_in) +- [UNKNOWN\_PROVIDER](errors_ErrorMessages.ERROR_MESSAGES.md#unknown_provider) - [WALLET\_PROVIDER\_NOT\_SUPPORTED](errors_ErrorMessages.ERROR_MESSAGES.md#wallet_provider_not_supported) -- [WALLET\_TYPE\_NOT\_PROVIDED](errors_ErrorMessages.ERROR_MESSAGES.md#wallet_type_not_provided) - [WITHDRAWAL\_WAS\_NOT\_REQUESTED](errors_ErrorMessages.ERROR_MESSAGES.md#withdrawal_was_not_requested) ## Enumeration members @@ -48,51 +31,9 @@ ___ -### CACHE\_CLIENT\_NOT\_PROVIDED +### CAN\_NOT\_UPDATE\_NOT\_CONTROLLED\_DOCUMENT -• **CACHE\_CLIENT\_NOT\_PROVIDED** = `"Cache client not provided"` - -___ - -### CACHE\_SERVER\_NOT\_REGISTERED - -• **CACHE\_SERVER\_NOT\_REGISTERED** = `"Cache server for this chain is not registered"` - -___ - -### CLAIMS\_NOT\_INITIALIZED - -• **CLAIMS\_NOT\_INITIALIZED** = `"User claims not initialized"` - -___ - -### CLAIM\_PUBLISHER\_NOT\_REQUESTER - -• **CLAIM\_PUBLISHER\_NOT\_REQUESTER** = `"Claim subject is not controlled by publisher"` - -___ - -### DID\_DOCUMENT\_NOT\_INITIALIZED - -• **DID\_DOCUMENT\_NOT\_INITIALIZED** = `"DID document not initialized"` - -___ - -### ENS\_REGISTRY\_CONTRACT\_NOT\_INITIALIZED - -• **ENS\_REGISTRY\_CONTRACT\_NOT\_INITIALIZED** = `"ENS Registry contract not initialized"` - -___ - -### ENS\_REGISTRY\_NOT\_INITIALIZED - -• **ENS\_REGISTRY\_NOT\_INITIALIZED** = `"ENS registry not initialized"` - -___ - -### ENS\_RESOLVER\_NOT\_INITIALIZED - -• **ENS\_RESOLVER\_NOT\_INITIALIZED** = `"ENS resolver not initialized"` +• **CAN\_NOT\_UPDATE\_NOT\_CONTROLLED\_DOCUMENT** = `"Can not update not controlled document"` ___ @@ -108,39 +49,15 @@ ___ ___ -### JWT\_NOT\_INITIALIZED - -• **JWT\_NOT\_INITIALIZED** = `"JWT was not initialized"` - -___ - -### METAMASK\_EXTENSION\_NOT\_AVAILABLE - -• **METAMASK\_EXTENSION\_NOT\_AVAILABLE** = `"Selected Metamask provider but Metamask not available"` - -___ - -### NATS\_NOT\_CONNECTED +### METAMASK\_PROVIDER\_NOT\_DETECTED -• **NATS\_NOT\_CONNECTED** = `"NATS connection not established"` +• **METAMASK\_PROVIDER\_NOT\_DETECTED** = `"Metamask provider not detected"` ___ -### NOT\_CONNECTED\_TO\_VOLTA +### NOT\_AUTHORIZED\_TO\_CHANGE\_DOMAIN -• **NOT\_CONNECTED\_TO\_VOLTA** = `"Not connected to volta network"` - -___ - -### NO\_PROVIDER - -• **NO\_PROVIDER** = `"Initialization of singer failed due to no provider"` - -___ - -### NO\_RPC\_URL - -• **NO\_RPC\_URL** = `"Rpc url needed to initialize provider in node js environment"` +• **NOT\_AUTHORIZED\_TO\_CHANGE\_DOMAIN** = `"Not authorized to change domain"` ___ @@ -162,18 +79,6 @@ ___ ___ -### PRIVATE\_KEY\_NOT\_PROVIDED - -• **PRIVATE\_KEY\_NOT\_PROVIDED** = `"IAM can not be initialized in Node.js environment without private key"` - -___ - -### PROVIDER\_NOT\_INITIALIZED - -• **PROVIDER\_NOT\_INITIALIZED** = `"Provider not initialized"` - -___ - ### PUBLIC\_KEY\_NOT\_RECOVERED • **PUBLIC\_KEY\_NOT\_RECOVERED** = `"Public key not recovered"` @@ -192,33 +97,15 @@ ___ ___ -### RPC\_URL\_NOT\_PROVIDED - -• **RPC\_URL\_NOT\_PROVIDED** = `"IAM can not be initialized in Node.js environment without rpc url"` - -___ - -### SIGNER\_NOT\_INITIALIZED - -• **SIGNER\_NOT\_INITIALIZED** = `"Signer not initialized"` - -___ - ### STAKE\_WAS\_NOT\_PUT • **STAKE\_WAS\_NOT\_PUT** = `"Stake was not put"` ___ -### UNABLE\_TO\_OBTAIN\_PUBLIC\_KEY +### UNKNOWN\_PROVIDER -• **UNABLE\_TO\_OBTAIN\_PUBLIC\_KEY** = `"Enable to obtain public key"` - -___ - -### USER\_NOT\_LOGGED\_IN - -• **USER\_NOT\_LOGGED\_IN** = `"User not logged in"` +• **UNKNOWN\_PROVIDER** = `"Unknown provider type"` ___ @@ -228,12 +115,6 @@ ___ ___ -### WALLET\_TYPE\_NOT\_PROVIDED - -• **WALLET\_TYPE\_NOT\_PROVIDED** = `"A wallet provider type or a private key must be provided"` - -___ - ### WITHDRAWAL\_WAS\_NOT\_REQUESTED • **WITHDRAWAL\_WAS\_NOT\_REQUESTED** = `"Stake withdrawal was not requested"` diff --git a/docs/api/enums/iam.ENSNamespaceTypes.md b/docs/api/enums/iam.ENSNamespaceTypes.md deleted file mode 100644 index 6477176c..00000000 --- a/docs/api/enums/iam.ENSNamespaceTypes.md +++ /dev/null @@ -1,29 +0,0 @@ -# Enumeration: ENSNamespaceTypes - -[iam](../modules/iam.md).ENSNamespaceTypes - -## Table of contents - -### Enumeration members - -- [Application](iam.ENSNamespaceTypes.md#application) -- [Organization](iam.ENSNamespaceTypes.md#organization) -- [Roles](iam.ENSNamespaceTypes.md#roles) - -## Enumeration members - -### Application - -• **Application** = `"apps"` - -___ - -### Organization - -• **Organization** = `"org"` - -___ - -### Roles - -• **Roles** = `"roles"` diff --git a/docs/api/enums/modules_assets_assets_types.AssetHistoryEventType.md b/docs/api/enums/modules_assets_assets_types.AssetHistoryEventType.md new file mode 100644 index 00000000..684decc0 --- /dev/null +++ b/docs/api/enums/modules_assets_assets_types.AssetHistoryEventType.md @@ -0,0 +1,43 @@ +# Enumeration: AssetHistoryEventType + +[modules/assets/assets.types](../modules/modules_assets_assets_types.md).AssetHistoryEventType + +## Table of contents + +### Enumeration members + +- [ASSET\_CREATED](modules_assets_assets_types.AssetHistoryEventType.md#asset_created) +- [ASSET\_OFFERED](modules_assets_assets_types.AssetHistoryEventType.md#asset_offered) +- [ASSET\_OFFER\_CANCELED](modules_assets_assets_types.AssetHistoryEventType.md#asset_offer_canceled) +- [ASSET\_OFFER\_REJECTED](modules_assets_assets_types.AssetHistoryEventType.md#asset_offer_rejected) +- [ASSET\_TRANSFERRED](modules_assets_assets_types.AssetHistoryEventType.md#asset_transferred) + +## Enumeration members + +### ASSET\_CREATED + +• **ASSET\_CREATED** = `"ASSET_CREATED"` + +___ + +### ASSET\_OFFERED + +• **ASSET\_OFFERED** = `"ASSET_OFFERED"` + +___ + +### ASSET\_OFFER\_CANCELED + +• **ASSET\_OFFER\_CANCELED** = `"ASSET_OFFER_CANCELED"` + +___ + +### ASSET\_OFFER\_REJECTED + +• **ASSET\_OFFER\_REJECTED** = `"ASSET_OFFER_REJECTED"` + +___ + +### ASSET\_TRANSFERRED + +• **ASSET\_TRANSFERRED** = `"ASSET_TRANSFERRED"` diff --git a/docs/api/enums/modules_cacheClient_cacheClient_types.Order.md b/docs/api/enums/modules_cacheClient_cacheClient_types.Order.md new file mode 100644 index 00000000..8569bbdc --- /dev/null +++ b/docs/api/enums/modules_cacheClient_cacheClient_types.Order.md @@ -0,0 +1,22 @@ +# Enumeration: Order + +[modules/cacheClient/cacheClient.types](../modules/modules_cacheClient_cacheClient_types.md).Order + +## Table of contents + +### Enumeration members + +- [ASC](modules_cacheClient_cacheClient_types.Order.md#asc) +- [DESC](modules_cacheClient_cacheClient_types.Order.md#desc) + +## Enumeration members + +### ASC + +• **ASC** = `"ASC"` + +___ + +### DESC + +• **DESC** = `"DESC"` diff --git a/docs/api/enums/modules_claims_claims_types.RegistrationTypes.md b/docs/api/enums/modules_claims_claims_types.RegistrationTypes.md new file mode 100644 index 00000000..164cb85c --- /dev/null +++ b/docs/api/enums/modules_claims_claims_types.RegistrationTypes.md @@ -0,0 +1,22 @@ +# Enumeration: RegistrationTypes + +[modules/claims/claims.types](../modules/modules_claims_claims_types.md).RegistrationTypes + +## Table of contents + +### Enumeration members + +- [OffChain](modules_claims_claims_types.RegistrationTypes.md#offchain) +- [OnChain](modules_claims_claims_types.RegistrationTypes.md#onchain) + +## Enumeration members + +### OffChain + +• **OffChain** = `"RegistrationTypes::OffChain"` + +___ + +### OnChain + +• **OnChain** = `"RegistrationTypes::OnChain"` diff --git a/docs/api/enums/modules_domains_domains_types.ENSNamespaceTypes.md b/docs/api/enums/modules_domains_domains_types.ENSNamespaceTypes.md new file mode 100644 index 00000000..ce4e7cea --- /dev/null +++ b/docs/api/enums/modules_domains_domains_types.ENSNamespaceTypes.md @@ -0,0 +1,29 @@ +# Enumeration: ENSNamespaceTypes + +[modules/domains/domains.types](../modules/modules_domains_domains_types.md).ENSNamespaceTypes + +## Table of contents + +### Enumeration members + +- [Application](modules_domains_domains_types.ENSNamespaceTypes.md#application) +- [Organization](modules_domains_domains_types.ENSNamespaceTypes.md#organization) +- [Roles](modules_domains_domains_types.ENSNamespaceTypes.md#roles) + +## Enumeration members + +### Application + +• **Application** = `"apps"` + +___ + +### Organization + +• **Organization** = `"org"` + +___ + +### Roles + +• **Roles** = `"roles"` diff --git a/docs/api/enums/modules_messaging_messaging_types.MessagingMethod.md b/docs/api/enums/modules_messaging_messaging_types.MessagingMethod.md new file mode 100644 index 00000000..3c1b3162 --- /dev/null +++ b/docs/api/enums/modules_messaging_messaging_types.MessagingMethod.md @@ -0,0 +1,29 @@ +# Enumeration: MessagingMethod + +[modules/messaging/messaging.types](../modules/modules_messaging_messaging_types.md).MessagingMethod + +## Table of contents + +### Enumeration members + +- [Nats](modules_messaging_messaging_types.MessagingMethod.md#nats) +- [SmartContractStorage](modules_messaging_messaging_types.MessagingMethod.md#smartcontractstorage) +- [WebRTC](modules_messaging_messaging_types.MessagingMethod.md#webrtc) + +## Enumeration members + +### Nats + +• **Nats** = `"nats"` + +___ + +### SmartContractStorage + +• **SmartContractStorage** = `"smartContractStorage"` + +___ + +### WebRTC + +• **WebRTC** = `"webRTC"` diff --git a/docs/api/enums/modules_signer_signer_types.ProviderType.md b/docs/api/enums/modules_signer_signer_types.ProviderType.md new file mode 100644 index 00000000..a4f356cf --- /dev/null +++ b/docs/api/enums/modules_signer_signer_types.ProviderType.md @@ -0,0 +1,43 @@ +# Enumeration: ProviderType + +[modules/signer/signer.types](../modules/modules_signer_signer_types.md).ProviderType + +## Table of contents + +### Enumeration members + +- [EwKeyManager](modules_signer_signer_types.ProviderType.md#ewkeymanager) +- [Gnosis](modules_signer_signer_types.ProviderType.md#gnosis) +- [Metamask](modules_signer_signer_types.ProviderType.md#metamask) +- [PrivateKey](modules_signer_signer_types.ProviderType.md#privatekey) +- [WalletConnect](modules_signer_signer_types.ProviderType.md#walletconnect) + +## Enumeration members + +### EwKeyManager + +• **EwKeyManager** = `"EwKeyManager"` + +___ + +### Gnosis + +• **Gnosis** = `"Gnosis"` + +___ + +### Metamask + +• **Metamask** = `"MetaMask"` + +___ + +### PrivateKey + +• **PrivateKey** = `"PrivateKey"` + +___ + +### WalletConnect + +• **WalletConnect** = `"WalletConnect"` diff --git a/docs/api/enums/modules_staking_staking_service.StakeStatus.md b/docs/api/enums/modules_staking_staking_service.StakeStatus.md new file mode 100644 index 00000000..758f2fb7 --- /dev/null +++ b/docs/api/enums/modules_staking_staking_service.StakeStatus.md @@ -0,0 +1,29 @@ +# Enumeration: StakeStatus + +[modules/staking/staking.service](../modules/modules_staking_staking_service.md).StakeStatus + +## Table of contents + +### Enumeration members + +- [NONSTAKING](modules_staking_staking_service.StakeStatus.md#nonstaking) +- [STAKING](modules_staking_staking_service.StakeStatus.md#staking) +- [WITHDRAWING](modules_staking_staking_service.StakeStatus.md#withdrawing) + +## Enumeration members + +### NONSTAKING + +• **NONSTAKING** = `0` + +___ + +### STAKING + +• **STAKING** = `1` + +___ + +### WITHDRAWING + +• **WITHDRAWING** = `2` diff --git a/docs/api/enums/staking.StakeStatus.md b/docs/api/enums/staking.StakeStatus.md deleted file mode 100644 index 9b34e4c2..00000000 --- a/docs/api/enums/staking.StakeStatus.md +++ /dev/null @@ -1,29 +0,0 @@ -# Enumeration: StakeStatus - -[staking](../modules/staking.md).StakeStatus - -## Table of contents - -### Enumeration members - -- [NONSTAKING](staking.StakeStatus.md#nonstaking) -- [STAKING](staking.StakeStatus.md#staking) -- [WITHDRAWING](staking.StakeStatus.md#withdrawing) - -## Enumeration members - -### NONSTAKING - -• **NONSTAKING** = `0` - -___ - -### STAKING - -• **STAKING** = `1` - -___ - -### WITHDRAWING - -• **WITHDRAWING** = `2` diff --git a/docs/api/enums/staking.TransactionSpeed.md b/docs/api/enums/staking.TransactionSpeed.md deleted file mode 100644 index ec479faf..00000000 --- a/docs/api/enums/staking.TransactionSpeed.md +++ /dev/null @@ -1,22 +0,0 @@ -# Enumeration: TransactionSpeed - -[staking](../modules/staking.md).TransactionSpeed - -## Table of contents - -### Enumeration members - -- [BASE](staking.TransactionSpeed.md#base) -- [FAST](staking.TransactionSpeed.md#fast) - -## Enumeration members - -### BASE - -• **BASE** = `0` - -___ - -### FAST - -• **FAST** = `1` diff --git a/docs/api/enums/types_WalletProvider.WalletProvider.md b/docs/api/enums/types_WalletProvider.WalletProvider.md deleted file mode 100644 index 1a62deaa..00000000 --- a/docs/api/enums/types_WalletProvider.WalletProvider.md +++ /dev/null @@ -1,29 +0,0 @@ -# Enumeration: WalletProvider - -[types/WalletProvider](../modules/types_WalletProvider.md).WalletProvider - -## Table of contents - -### Enumeration members - -- [EwKeyManager](types_WalletProvider.WalletProvider.md#ewkeymanager) -- [MetaMask](types_WalletProvider.WalletProvider.md#metamask) -- [WalletConnect](types_WalletProvider.WalletProvider.md#walletconnect) - -## Enumeration members - -### EwKeyManager - -• **EwKeyManager** = `"EwKeyManager"` - -___ - -### MetaMask - -• **MetaMask** = `"MetaMask"` - -___ - -### WalletConnect - -• **WalletConnect** = `"WalletConnect"` diff --git a/docs/api/enums/utils_constants.MessagingMethod.md b/docs/api/enums/utils_constants.MessagingMethod.md deleted file mode 100644 index 62fae3b9..00000000 --- a/docs/api/enums/utils_constants.MessagingMethod.md +++ /dev/null @@ -1,29 +0,0 @@ -# Enumeration: MessagingMethod - -[utils/constants](../modules/utils_constants.md).MessagingMethod - -## Table of contents - -### Enumeration members - -- [Nats](utils_constants.MessagingMethod.md#nats) -- [SmartContractStorage](utils_constants.MessagingMethod.md#smartcontractstorage) -- [WebRTC](utils_constants.MessagingMethod.md#webrtc) - -## Enumeration members - -### Nats - -• **Nats** = `"nats"` - -___ - -### SmartContractStorage - -• **SmartContractStorage** = `"smartContractStorage"` - -___ - -### WebRTC - -• **WebRTC** = `"webRTC"` diff --git a/docs/api/interfaces/cacheServerClient_cacheServerClient.CacheServerClientOptions.md b/docs/api/interfaces/cacheServerClient_cacheServerClient.CacheServerClientOptions.md deleted file mode 100644 index b01b294b..00000000 --- a/docs/api/interfaces/cacheServerClient_cacheServerClient.CacheServerClientOptions.md +++ /dev/null @@ -1,22 +0,0 @@ -# Interface: CacheServerClientOptions - -[cacheServerClient/cacheServerClient](../modules/cacheServerClient_cacheServerClient.md).CacheServerClientOptions - -## Table of contents - -### Properties - -- [cacheServerSupportsAuth](cacheServerClient_cacheServerClient.CacheServerClientOptions.md#cacheserversupportsauth) -- [url](cacheServerClient_cacheServerClient.CacheServerClientOptions.md#url) - -## Properties - -### cacheServerSupportsAuth - -• `Optional` **cacheServerSupportsAuth**: `boolean` - -___ - -### url - -• **url**: `string` diff --git a/docs/api/interfaces/cacheServerClient_cacheServerClient_types.Asset.md b/docs/api/interfaces/cacheServerClient_cacheServerClient_types.Asset.md deleted file mode 100644 index ee6bb409..00000000 --- a/docs/api/interfaces/cacheServerClient_cacheServerClient_types.Asset.md +++ /dev/null @@ -1,36 +0,0 @@ -# Interface: Asset - -[cacheServerClient/cacheServerClient.types](../modules/cacheServerClient_cacheServerClient_types.md).Asset - -## Table of contents - -### Properties - -- [document](cacheServerClient_cacheServerClient_types.Asset.md#document) -- [id](cacheServerClient_cacheServerClient_types.Asset.md#id) -- [offeredTo](cacheServerClient_cacheServerClient_types.Asset.md#offeredto) -- [owner](cacheServerClient_cacheServerClient_types.Asset.md#owner) - -## Properties - -### document - -• **document**: `IDIDDocument` - -___ - -### id - -• **id**: `string` - -___ - -### offeredTo - -• `Optional` **offeredTo**: `string` - -___ - -### owner - -• **owner**: `string` diff --git a/docs/api/interfaces/cacheServerClient_cacheServerClient_types.AssetHistory.md b/docs/api/interfaces/cacheServerClient_cacheServerClient_types.AssetHistory.md deleted file mode 100644 index fde96636..00000000 --- a/docs/api/interfaces/cacheServerClient_cacheServerClient_types.AssetHistory.md +++ /dev/null @@ -1,50 +0,0 @@ -# Interface: AssetHistory - -[cacheServerClient/cacheServerClient.types](../modules/cacheServerClient_cacheServerClient_types.md).AssetHistory - -## Table of contents - -### Properties - -- [assetId](cacheServerClient_cacheServerClient_types.AssetHistory.md#assetid) -- [at](cacheServerClient_cacheServerClient_types.AssetHistory.md#at) -- [emittedBy](cacheServerClient_cacheServerClient_types.AssetHistory.md#emittedby) -- [id](cacheServerClient_cacheServerClient_types.AssetHistory.md#id) -- [relatedTo](cacheServerClient_cacheServerClient_types.AssetHistory.md#relatedto) -- [timestamp](cacheServerClient_cacheServerClient_types.AssetHistory.md#timestamp) - -## Properties - -### assetId - -• `Optional` **assetId**: `string` - -___ - -### at - -• **at**: `number` - -___ - -### emittedBy - -• **emittedBy**: `string` - -___ - -### id - -• **id**: `number` - -___ - -### relatedTo - -• `Optional` **relatedTo**: `string` - -___ - -### timestamp - -• **timestamp**: `string` diff --git a/docs/api/interfaces/cacheServerClient_cacheServerClient_types.AssetProfile.md b/docs/api/interfaces/cacheServerClient_cacheServerClient_types.AssetProfile.md deleted file mode 100644 index d1add76c..00000000 --- a/docs/api/interfaces/cacheServerClient_cacheServerClient_types.AssetProfile.md +++ /dev/null @@ -1,22 +0,0 @@ -# Interface: AssetProfile - -[cacheServerClient/cacheServerClient.types](../modules/cacheServerClient_cacheServerClient_types.md).AssetProfile - -## Table of contents - -### Properties - -- [icon](cacheServerClient_cacheServerClient_types.AssetProfile.md#icon) -- [name](cacheServerClient_cacheServerClient_types.AssetProfile.md#name) - -## Properties - -### icon - -• `Optional` **icon**: `string` - -___ - -### name - -• `Optional` **name**: `string` diff --git a/docs/api/interfaces/cacheServerClient_cacheServerClient_types.AssetProfiles.md b/docs/api/interfaces/cacheServerClient_cacheServerClient_types.AssetProfiles.md deleted file mode 100644 index fdd9c820..00000000 --- a/docs/api/interfaces/cacheServerClient_cacheServerClient_types.AssetProfiles.md +++ /dev/null @@ -1,7 +0,0 @@ -# Interface: AssetProfiles - -[cacheServerClient/cacheServerClient.types](../modules/cacheServerClient_cacheServerClient_types.md).AssetProfiles - -## Indexable - -▪ [key: `string`]: [`AssetProfile`](cacheServerClient_cacheServerClient_types.AssetProfile.md) diff --git a/docs/api/interfaces/cacheServerClient_cacheServerClient_types.Claim.md b/docs/api/interfaces/cacheServerClient_cacheServerClient_types.Claim.md deleted file mode 100644 index a86acfb7..00000000 --- a/docs/api/interfaces/cacheServerClient_cacheServerClient_types.Claim.md +++ /dev/null @@ -1,113 +0,0 @@ -# Interface: Claim - -[cacheServerClient/cacheServerClient.types](../modules/cacheServerClient_cacheServerClient_types.md).Claim - -## Table of contents - -### Properties - -- [acceptedBy](cacheServerClient_cacheServerClient_types.Claim.md#acceptedby) -- [claimIssuer](cacheServerClient_cacheServerClient_types.Claim.md#claimissuer) -- [claimType](cacheServerClient_cacheServerClient_types.Claim.md#claimtype) -- [claimTypeVersion](cacheServerClient_cacheServerClient_types.Claim.md#claimtypeversion) -- [id](cacheServerClient_cacheServerClient_types.Claim.md#id) -- [isAccepted](cacheServerClient_cacheServerClient_types.Claim.md#isaccepted) -- [isRejected](cacheServerClient_cacheServerClient_types.Claim.md#isrejected) -- [issuedToken](cacheServerClient_cacheServerClient_types.Claim.md#issuedtoken) -- [namespace](cacheServerClient_cacheServerClient_types.Claim.md#namespace) -- [onChainProof](cacheServerClient_cacheServerClient_types.Claim.md#onchainproof) -- [registrationTypes](cacheServerClient_cacheServerClient_types.Claim.md#registrationtypes) -- [requester](cacheServerClient_cacheServerClient_types.Claim.md#requester) -- [subject](cacheServerClient_cacheServerClient_types.Claim.md#subject) -- [subjectAgreement](cacheServerClient_cacheServerClient_types.Claim.md#subjectagreement) -- [token](cacheServerClient_cacheServerClient_types.Claim.md#token) - -## Properties - -### acceptedBy - -• `Optional` **acceptedBy**: `string` - -___ - -### claimIssuer - -• **claimIssuer**: `string`[] - -___ - -### claimType - -• **claimType**: `string` - -___ - -### claimTypeVersion - -• **claimTypeVersion**: `string` - -___ - -### id - -• **id**: `string` - -___ - -### isAccepted - -• **isAccepted**: `boolean` - -___ - -### isRejected - -• `Optional` **isRejected**: `boolean` - -___ - -### issuedToken - -• `Optional` **issuedToken**: `string` - -___ - -### namespace - -• **namespace**: `string` - -___ - -### onChainProof - -• `Optional` **onChainProof**: `string` - -___ - -### registrationTypes - -• **registrationTypes**: [`RegistrationTypes`](../enums/cacheServerClient_cacheServerClient_types.RegistrationTypes.md)[] - -___ - -### requester - -• **requester**: `string` - -___ - -### subject - -• **subject**: `string` - -___ - -### subjectAgreement - -• `Optional` **subjectAgreement**: `string` - -___ - -### token - -• **token**: `string` diff --git a/docs/api/interfaces/cacheServerClient_cacheServerClient_types.ClaimData.md b/docs/api/interfaces/cacheServerClient_cacheServerClient_types.ClaimData.md deleted file mode 100644 index 48e8531d..00000000 --- a/docs/api/interfaces/cacheServerClient_cacheServerClient_types.ClaimData.md +++ /dev/null @@ -1,35 +0,0 @@ -# Interface: ClaimData - -[cacheServerClient/cacheServerClient.types](../modules/cacheServerClient_cacheServerClient_types.md).ClaimData - -## Hierarchy - -- `Record`<`string`, `unknown`\> - - ↳ **`ClaimData`** - -## Table of contents - -### Properties - -- [claimType](cacheServerClient_cacheServerClient_types.ClaimData.md#claimtype) -- [claimTypeVersion](cacheServerClient_cacheServerClient_types.ClaimData.md#claimtypeversion) -- [profile](cacheServerClient_cacheServerClient_types.ClaimData.md#profile) - -## Properties - -### claimType - -• `Optional` **claimType**: `string` - -___ - -### claimTypeVersion - -• `Optional` **claimTypeVersion**: `number` - -___ - -### profile - -• `Optional` **profile**: [`Profile`](cacheServerClient_cacheServerClient_types.Profile.md) diff --git a/docs/api/interfaces/cacheServerClient_cacheServerClient_types.IApp.md b/docs/api/interfaces/cacheServerClient_cacheServerClient_types.IApp.md deleted file mode 100644 index 8015813d..00000000 --- a/docs/api/interfaces/cacheServerClient_cacheServerClient_types.IApp.md +++ /dev/null @@ -1,57 +0,0 @@ -# Interface: IApp - -[cacheServerClient/cacheServerClient.types](../modules/cacheServerClient_cacheServerClient_types.md).IApp - -## Table of contents - -### Properties - -- [definition](cacheServerClient_cacheServerClient_types.IApp.md#definition) -- [isOwnedByCurrentUser](cacheServerClient_cacheServerClient_types.IApp.md#isownedbycurrentuser) -- [name](cacheServerClient_cacheServerClient_types.IApp.md#name) -- [namespace](cacheServerClient_cacheServerClient_types.IApp.md#namespace) -- [owner](cacheServerClient_cacheServerClient_types.IApp.md#owner) -- [roles](cacheServerClient_cacheServerClient_types.IApp.md#roles) -- [uid](cacheServerClient_cacheServerClient_types.IApp.md#uid) - -## Properties - -### definition - -• **definition**: `IAppDefinition` - -___ - -### isOwnedByCurrentUser - -• `Optional` **isOwnedByCurrentUser**: `boolean` - -___ - -### name - -• **name**: `string` - -___ - -### namespace - -• **namespace**: `string` - -___ - -### owner - -• **owner**: `string` - -___ - -### roles - -• `Optional` **roles**: [`IRole`](cacheServerClient_cacheServerClient_types.IRole.md)[] - -___ - -### uid - -• **uid**: `string` diff --git a/docs/api/interfaces/cacheServerClient_cacheServerClient_types.IOrganization.md b/docs/api/interfaces/cacheServerClient_cacheServerClient_types.IOrganization.md deleted file mode 100644 index 190e1120..00000000 --- a/docs/api/interfaces/cacheServerClient_cacheServerClient_types.IOrganization.md +++ /dev/null @@ -1,71 +0,0 @@ -# Interface: IOrganization - -[cacheServerClient/cacheServerClient.types](../modules/cacheServerClient_cacheServerClient_types.md).IOrganization - -## Table of contents - -### Properties - -- [apps](cacheServerClient_cacheServerClient_types.IOrganization.md#apps) -- [definition](cacheServerClient_cacheServerClient_types.IOrganization.md#definition) -- [isOwnedByCurrentUser](cacheServerClient_cacheServerClient_types.IOrganization.md#isownedbycurrentuser) -- [name](cacheServerClient_cacheServerClient_types.IOrganization.md#name) -- [namespace](cacheServerClient_cacheServerClient_types.IOrganization.md#namespace) -- [owner](cacheServerClient_cacheServerClient_types.IOrganization.md#owner) -- [roles](cacheServerClient_cacheServerClient_types.IOrganization.md#roles) -- [subOrgs](cacheServerClient_cacheServerClient_types.IOrganization.md#suborgs) -- [uid](cacheServerClient_cacheServerClient_types.IOrganization.md#uid) - -## Properties - -### apps - -• `Optional` **apps**: [`IApp`](cacheServerClient_cacheServerClient_types.IApp.md)[] - -___ - -### definition - -• **definition**: `IOrganizationDefinition` - -___ - -### isOwnedByCurrentUser - -• `Optional` **isOwnedByCurrentUser**: `boolean` - -___ - -### name - -• **name**: `string` - -___ - -### namespace - -• **namespace**: `string` - -___ - -### owner - -• **owner**: `string` - -___ - -### roles - -• `Optional` **roles**: [`IRole`](cacheServerClient_cacheServerClient_types.IRole.md)[] - -___ - -### subOrgs - -• `Optional` **subOrgs**: [`IOrganization`](cacheServerClient_cacheServerClient_types.IOrganization.md)[] - -___ - -### uid - -• **uid**: `string` diff --git a/docs/api/interfaces/cacheServerClient_cacheServerClient_types.IRole.md b/docs/api/interfaces/cacheServerClient_cacheServerClient_types.IRole.md deleted file mode 100644 index 99c85df6..00000000 --- a/docs/api/interfaces/cacheServerClient_cacheServerClient_types.IRole.md +++ /dev/null @@ -1,50 +0,0 @@ -# Interface: IRole - -[cacheServerClient/cacheServerClient.types](../modules/cacheServerClient_cacheServerClient_types.md).IRole - -## Table of contents - -### Properties - -- [definition](cacheServerClient_cacheServerClient_types.IRole.md#definition) -- [isOwnedByCurrentUser](cacheServerClient_cacheServerClient_types.IRole.md#isownedbycurrentuser) -- [name](cacheServerClient_cacheServerClient_types.IRole.md#name) -- [namespace](cacheServerClient_cacheServerClient_types.IRole.md#namespace) -- [owner](cacheServerClient_cacheServerClient_types.IRole.md#owner) -- [uid](cacheServerClient_cacheServerClient_types.IRole.md#uid) - -## Properties - -### definition - -• **definition**: `IRoleDefinition` - -___ - -### isOwnedByCurrentUser - -• `Optional` **isOwnedByCurrentUser**: `boolean` - -___ - -### name - -• **name**: `string` - -___ - -### namespace - -• **namespace**: `string` - -___ - -### owner - -• **owner**: `string` - -___ - -### uid - -• **uid**: `string` diff --git a/docs/api/interfaces/cacheServerClient_cacheServerClient_types.Profile.md b/docs/api/interfaces/cacheServerClient_cacheServerClient_types.Profile.md deleted file mode 100644 index 679b093b..00000000 --- a/docs/api/interfaces/cacheServerClient_cacheServerClient_types.Profile.md +++ /dev/null @@ -1,36 +0,0 @@ -# Interface: Profile - -[cacheServerClient/cacheServerClient.types](../modules/cacheServerClient_cacheServerClient_types.md).Profile - -## Table of contents - -### Properties - -- [address](cacheServerClient_cacheServerClient_types.Profile.md#address) -- [assetProfiles](cacheServerClient_cacheServerClient_types.Profile.md#assetprofiles) -- [birthdate](cacheServerClient_cacheServerClient_types.Profile.md#birthdate) -- [name](cacheServerClient_cacheServerClient_types.Profile.md#name) - -## Properties - -### address - -• `Optional` **address**: `string` - -___ - -### assetProfiles - -• `Optional` **assetProfiles**: [`AssetProfiles`](cacheServerClient_cacheServerClient_types.AssetProfiles.md) - -___ - -### birthdate - -• `Optional` **birthdate**: `string` - -___ - -### name - -• `Optional` **name**: `string` diff --git a/docs/api/interfaces/config_chain_config.ChainConfig.md b/docs/api/interfaces/config_chain_config.ChainConfig.md new file mode 100644 index 00000000..353635ad --- /dev/null +++ b/docs/api/interfaces/config_chain_config.ChainConfig.md @@ -0,0 +1,78 @@ +# Interface: ChainConfig + +[config/chain.config](../modules/config_chain_config.md).ChainConfig + +## Table of contents + +### Properties + +- [assetManagerAddress](config_chain_config.ChainConfig.md#assetmanageraddress) +- [chainName](config_chain_config.ChainConfig.md#chainname) +- [claimManagerAddress](config_chain_config.ChainConfig.md#claimmanageraddress) +- [didRegistryAddress](config_chain_config.ChainConfig.md#didregistryaddress) +- [domainNotifierAddress](config_chain_config.ChainConfig.md#domainnotifieraddress) +- [ensPublicResolverAddress](config_chain_config.ChainConfig.md#enspublicresolveraddress) +- [ensRegistryAddress](config_chain_config.ChainConfig.md#ensregistryaddress) +- [ensResolverAddress](config_chain_config.ChainConfig.md#ensresolveraddress) +- [rpcUrl](config_chain_config.ChainConfig.md#rpcurl) +- [stakingPoolFactoryAddress](config_chain_config.ChainConfig.md#stakingpoolfactoryaddress) + +## Properties + +### assetManagerAddress + +• **assetManagerAddress**: `string` + +___ + +### chainName + +• **chainName**: `string` + +___ + +### claimManagerAddress + +• **claimManagerAddress**: `string` + +___ + +### didRegistryAddress + +• **didRegistryAddress**: `string` + +___ + +### domainNotifierAddress + +• **domainNotifierAddress**: `string` + +___ + +### ensPublicResolverAddress + +• **ensPublicResolverAddress**: `string` + +___ + +### ensRegistryAddress + +• **ensRegistryAddress**: `string` + +___ + +### ensResolverAddress + +• **ensResolverAddress**: `string` + +___ + +### rpcUrl + +• **rpcUrl**: `string` + +___ + +### stakingPoolFactoryAddress + +• **stakingPoolFactoryAddress**: `string` diff --git a/docs/api/interfaces/config_messaging_config.MessagingConfig.md b/docs/api/interfaces/config_messaging_config.MessagingConfig.md new file mode 100644 index 00000000..6ec7faac --- /dev/null +++ b/docs/api/interfaces/config_messaging_config.MessagingConfig.md @@ -0,0 +1,22 @@ +# Interface: MessagingConfig + +[config/messaging.config](../modules/config_messaging_config.md).MessagingConfig + +## Table of contents + +### Properties + +- [messagingMethod](config_messaging_config.MessagingConfig.md#messagingmethod) +- [natsServerUrl](config_messaging_config.MessagingConfig.md#natsserverurl) + +## Properties + +### messagingMethod + +• **messagingMethod**: [`MessagingMethod`](../enums/modules_messaging_messaging_types.MessagingMethod.md) + +___ + +### natsServerUrl + +• **natsServerUrl**: `string` diff --git a/docs/api/interfaces/iam.IClaimIssuance.md b/docs/api/interfaces/iam.IClaimIssuance.md deleted file mode 100644 index 8adeb70c..00000000 --- a/docs/api/interfaces/iam.IClaimIssuance.md +++ /dev/null @@ -1,68 +0,0 @@ -# Interface: IClaimIssuance - -[iam](../modules/iam.md).IClaimIssuance - -## Hierarchy - -- [`IMessage`](iam.IMessage.md) - - ↳ **`IClaimIssuance`** - -## Table of contents - -### Properties - -- [acceptedBy](iam.IClaimIssuance.md#acceptedby) -- [claimIssuer](iam.IClaimIssuance.md#claimissuer) -- [id](iam.IClaimIssuance.md#id) -- [issuedToken](iam.IClaimIssuance.md#issuedtoken) -- [onChainProof](iam.IClaimIssuance.md#onchainproof) -- [requester](iam.IClaimIssuance.md#requester) - -## Properties - -### acceptedBy - -• **acceptedBy**: `string` - -___ - -### claimIssuer - -• `Optional` **claimIssuer**: `string`[] - -#### Inherited from - -[IMessage](iam.IMessage.md).[claimIssuer](iam.IMessage.md#claimissuer) - -___ - -### id - -• **id**: `string` - -#### Inherited from - -[IMessage](iam.IMessage.md).[id](iam.IMessage.md#id) - -___ - -### issuedToken - -• `Optional` **issuedToken**: `string` - -___ - -### onChainProof - -• `Optional` **onChainProof**: `string` - -___ - -### requester - -• **requester**: `string` - -#### Inherited from - -[IMessage](iam.IMessage.md).[requester](iam.IMessage.md#requester) diff --git a/docs/api/interfaces/iam.IClaimRejection.md b/docs/api/interfaces/iam.IClaimRejection.md deleted file mode 100644 index ba4f3ed8..00000000 --- a/docs/api/interfaces/iam.IClaimRejection.md +++ /dev/null @@ -1,54 +0,0 @@ -# Interface: IClaimRejection - -[iam](../modules/iam.md).IClaimRejection - -## Hierarchy - -- [`IMessage`](iam.IMessage.md) - - ↳ **`IClaimRejection`** - -## Table of contents - -### Properties - -- [claimIssuer](iam.IClaimRejection.md#claimissuer) -- [id](iam.IClaimRejection.md#id) -- [isRejected](iam.IClaimRejection.md#isrejected) -- [requester](iam.IClaimRejection.md#requester) - -## Properties - -### claimIssuer - -• `Optional` **claimIssuer**: `string`[] - -#### Inherited from - -[IMessage](iam.IMessage.md).[claimIssuer](iam.IMessage.md#claimissuer) - -___ - -### id - -• **id**: `string` - -#### Inherited from - -[IMessage](iam.IMessage.md).[id](iam.IMessage.md#id) - -___ - -### isRejected - -• **isRejected**: `boolean` - -___ - -### requester - -• **requester**: `string` - -#### Inherited from - -[IMessage](iam.IMessage.md).[requester](iam.IMessage.md#requester) diff --git a/docs/api/interfaces/iam.IClaimRequest.md b/docs/api/interfaces/iam.IClaimRequest.md deleted file mode 100644 index ed1a6a27..00000000 --- a/docs/api/interfaces/iam.IClaimRequest.md +++ /dev/null @@ -1,68 +0,0 @@ -# Interface: IClaimRequest - -[iam](../modules/iam.md).IClaimRequest - -## Hierarchy - -- [`IMessage`](iam.IMessage.md) - - ↳ **`IClaimRequest`** - -## Table of contents - -### Properties - -- [claimIssuer](iam.IClaimRequest.md#claimissuer) -- [id](iam.IClaimRequest.md#id) -- [registrationTypes](iam.IClaimRequest.md#registrationtypes) -- [requester](iam.IClaimRequest.md#requester) -- [subjectAgreement](iam.IClaimRequest.md#subjectagreement) -- [token](iam.IClaimRequest.md#token) - -## Properties - -### claimIssuer - -• `Optional` **claimIssuer**: `string`[] - -#### Inherited from - -[IMessage](iam.IMessage.md).[claimIssuer](iam.IMessage.md#claimissuer) - -___ - -### id - -• **id**: `string` - -#### Inherited from - -[IMessage](iam.IMessage.md).[id](iam.IMessage.md#id) - -___ - -### registrationTypes - -• **registrationTypes**: [`RegistrationTypes`](../enums/cacheServerClient_cacheServerClient_types.RegistrationTypes.md)[] - -___ - -### requester - -• **requester**: `string` - -#### Inherited from - -[IMessage](iam.IMessage.md).[requester](iam.IMessage.md#requester) - -___ - -### subjectAgreement - -• `Optional` **subjectAgreement**: `string` - -___ - -### token - -• **token**: `string` diff --git a/docs/api/interfaces/iam.IMessage.md b/docs/api/interfaces/iam.IMessage.md deleted file mode 100644 index 6ae21335..00000000 --- a/docs/api/interfaces/iam.IMessage.md +++ /dev/null @@ -1,39 +0,0 @@ -# Interface: IMessage - -[iam](../modules/iam.md).IMessage - -## Hierarchy - -- **`IMessage`** - - ↳ [`IClaimRequest`](iam.IClaimRequest.md) - - ↳ [`IClaimIssuance`](iam.IClaimIssuance.md) - - ↳ [`IClaimRejection`](iam.IClaimRejection.md) - -## Table of contents - -### Properties - -- [claimIssuer](iam.IMessage.md#claimissuer) -- [id](iam.IMessage.md#id) -- [requester](iam.IMessage.md#requester) - -## Properties - -### claimIssuer - -• `Optional` **claimIssuer**: `string`[] - -___ - -### id - -• **id**: `string` - -___ - -### requester - -• **requester**: `string` diff --git a/docs/api/interfaces/iam_chainConfig.ChainConfig.md b/docs/api/interfaces/iam_chainConfig.ChainConfig.md deleted file mode 100644 index 355e5e1a..00000000 --- a/docs/api/interfaces/iam_chainConfig.ChainConfig.md +++ /dev/null @@ -1,78 +0,0 @@ -# Interface: ChainConfig - -[iam/chainConfig](../modules/iam_chainConfig.md).ChainConfig - -## Table of contents - -### Properties - -- [assetManagerAddress](iam_chainConfig.ChainConfig.md#assetmanageraddress) -- [chainName](iam_chainConfig.ChainConfig.md#chainname) -- [claimManagerAddress](iam_chainConfig.ChainConfig.md#claimmanageraddress) -- [didContractAddress](iam_chainConfig.ChainConfig.md#didcontractaddress) -- [domainNotifierAddress](iam_chainConfig.ChainConfig.md#domainnotifieraddress) -- [ensPublicResolverAddress](iam_chainConfig.ChainConfig.md#enspublicresolveraddress) -- [ensRegistryAddress](iam_chainConfig.ChainConfig.md#ensregistryaddress) -- [ensResolverAddress](iam_chainConfig.ChainConfig.md#ensresolveraddress) -- [rpcUrl](iam_chainConfig.ChainConfig.md#rpcurl) -- [stakingPoolFactoryAddress](iam_chainConfig.ChainConfig.md#stakingpoolfactoryaddress) - -## Properties - -### assetManagerAddress - -• **assetManagerAddress**: `string` - -___ - -### chainName - -• **chainName**: `string` - -___ - -### claimManagerAddress - -• **claimManagerAddress**: `string` - -___ - -### didContractAddress - -• **didContractAddress**: `string` - -___ - -### domainNotifierAddress - -• **domainNotifierAddress**: `string` - -___ - -### ensPublicResolverAddress - -• `Optional` **ensPublicResolverAddress**: `string` - -___ - -### ensRegistryAddress - -• **ensRegistryAddress**: `string` - -___ - -### ensResolverAddress - -• **ensResolverAddress**: `string` - -___ - -### rpcUrl - -• **rpcUrl**: `string` - -___ - -### stakingPoolFactoryAddress - -• **stakingPoolFactoryAddress**: `string` diff --git a/docs/api/interfaces/iam_chainConfig.MessagingOptions.md b/docs/api/interfaces/iam_chainConfig.MessagingOptions.md deleted file mode 100644 index a067242b..00000000 --- a/docs/api/interfaces/iam_chainConfig.MessagingOptions.md +++ /dev/null @@ -1,22 +0,0 @@ -# Interface: MessagingOptions - -[iam/chainConfig](../modules/iam_chainConfig.md).MessagingOptions - -## Table of contents - -### Properties - -- [messagingMethod](iam_chainConfig.MessagingOptions.md#messagingmethod) -- [natsServerUrl](iam_chainConfig.MessagingOptions.md#natsserverurl) - -## Properties - -### messagingMethod - -• **messagingMethod**: [`MessagingMethod`](../enums/utils_constants.MessagingMethod.md) - -___ - -### natsServerUrl - -• **natsServerUrl**: `string` diff --git a/docs/api/interfaces/modules_assets_assets_types.Asset.md b/docs/api/interfaces/modules_assets_assets_types.Asset.md new file mode 100644 index 00000000..63d51834 --- /dev/null +++ b/docs/api/interfaces/modules_assets_assets_types.Asset.md @@ -0,0 +1,36 @@ +# Interface: Asset + +[modules/assets/assets.types](../modules/modules_assets_assets_types.md).Asset + +## Table of contents + +### Properties + +- [document](modules_assets_assets_types.Asset.md#document) +- [id](modules_assets_assets_types.Asset.md#id) +- [offeredTo](modules_assets_assets_types.Asset.md#offeredto) +- [owner](modules_assets_assets_types.Asset.md#owner) + +## Properties + +### document + +• **document**: `IDIDDocument` + +___ + +### id + +• **id**: `string` + +___ + +### offeredTo + +• `Optional` **offeredTo**: `string` + +___ + +### owner + +• **owner**: `string` diff --git a/docs/api/interfaces/modules_assets_assets_types.AssetHistory.md b/docs/api/interfaces/modules_assets_assets_types.AssetHistory.md new file mode 100644 index 00000000..78c698fe --- /dev/null +++ b/docs/api/interfaces/modules_assets_assets_types.AssetHistory.md @@ -0,0 +1,50 @@ +# Interface: AssetHistory + +[modules/assets/assets.types](../modules/modules_assets_assets_types.md).AssetHistory + +## Table of contents + +### Properties + +- [assetId](modules_assets_assets_types.AssetHistory.md#assetid) +- [at](modules_assets_assets_types.AssetHistory.md#at) +- [emittedBy](modules_assets_assets_types.AssetHistory.md#emittedby) +- [id](modules_assets_assets_types.AssetHistory.md#id) +- [relatedTo](modules_assets_assets_types.AssetHistory.md#relatedto) +- [timestamp](modules_assets_assets_types.AssetHistory.md#timestamp) + +## Properties + +### assetId + +• `Optional` **assetId**: `string` + +___ + +### at + +• **at**: `number` + +___ + +### emittedBy + +• **emittedBy**: `string` + +___ + +### id + +• **id**: `number` + +___ + +### relatedTo + +• `Optional` **relatedTo**: `string` + +___ + +### timestamp + +• **timestamp**: `string` diff --git a/docs/api/interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md b/docs/api/interfaces/modules_cacheClient_ICacheClient.ICacheClient.md similarity index 53% rename from docs/api/interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md rename to docs/api/interfaces/modules_cacheClient_ICacheClient.ICacheClient.md index 741aac4c..92004576 100644 --- a/docs/api/interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md +++ b/docs/api/interfaces/modules_cacheClient_ICacheClient.ICacheClient.md @@ -1,56 +1,56 @@ -# Interface: ICacheServerClient +# Interface: ICacheClient -[cacheServerClient/ICacheServerClient](../modules/cacheServerClient_ICacheServerClient.md).ICacheServerClient +[modules/cacheClient/ICacheClient](../modules/modules_cacheClient_ICacheClient.md).ICacheClient ## Implemented by -- [`CacheServerClient`](../classes/cacheServerClient_cacheServerClient.CacheServerClient.md) +- [`CacheClient`](../classes/modules_cacheClient_cacheClient_service.CacheClient.md) ## Table of contents ### Properties -- [pubKeyAndIdentityToken](cacheServerClient_ICacheServerClient.ICacheServerClient.md#pubkeyandidentitytoken) +- [pubKeyAndIdentityToken](modules_cacheClient_ICacheClient.ICacheClient.md#pubkeyandidentitytoken) ### Methods -- [addDIDToWatchList](cacheServerClient_ICacheServerClient.ICacheServerClient.md#adddidtowatchlist) -- [deleteClaim](cacheServerClient_ICacheServerClient.ICacheServerClient.md#deleteclaim) -- [getAppDefinition](cacheServerClient_ICacheServerClient.ICacheServerClient.md#getappdefinition) -- [getApplicationRoles](cacheServerClient_ICacheServerClient.ICacheServerClient.md#getapplicationroles) -- [getApplicationsByOrganization](cacheServerClient_ICacheServerClient.ICacheServerClient.md#getapplicationsbyorganization) -- [getApplicationsByOwner](cacheServerClient_ICacheServerClient.ICacheServerClient.md#getapplicationsbyowner) -- [getAssetById](cacheServerClient_ICacheServerClient.ICacheServerClient.md#getassetbyid) -- [getAssetHistory](cacheServerClient_ICacheServerClient.ICacheServerClient.md#getassethistory) -- [getClaimsByIssuer](cacheServerClient_ICacheServerClient.ICacheServerClient.md#getclaimsbyissuer) -- [getClaimsByRequester](cacheServerClient_ICacheServerClient.ICacheServerClient.md#getclaimsbyrequester) -- [getClaimsBySubject](cacheServerClient_ICacheServerClient.ICacheServerClient.md#getclaimsbysubject) -- [getClaimsBySubjects](cacheServerClient_ICacheServerClient.ICacheServerClient.md#getclaimsbysubjects) -- [getDIDsForRole](cacheServerClient_ICacheServerClient.ICacheServerClient.md#getdidsforrole) -- [getDidDocument](cacheServerClient_ICacheServerClient.ICacheServerClient.md#getdiddocument) -- [getNamespaceBySearchPhrase](cacheServerClient_ICacheServerClient.ICacheServerClient.md#getnamespacebysearchphrase) -- [getOfferedAssets](cacheServerClient_ICacheServerClient.ICacheServerClient.md#getofferedassets) -- [getOrgDefinition](cacheServerClient_ICacheServerClient.ICacheServerClient.md#getorgdefinition) -- [getOrgHierarchy](cacheServerClient_ICacheServerClient.ICacheServerClient.md#getorghierarchy) -- [getOrganizationRoles](cacheServerClient_ICacheServerClient.ICacheServerClient.md#getorganizationroles) -- [getOrganizationsByOwner](cacheServerClient_ICacheServerClient.ICacheServerClient.md#getorganizationsbyowner) -- [getOwnedAssets](cacheServerClient_ICacheServerClient.ICacheServerClient.md#getownedassets) -- [getPreviouslyOwnedAssets](cacheServerClient_ICacheServerClient.ICacheServerClient.md#getpreviouslyownedassets) -- [getRoleDefinition](cacheServerClient_ICacheServerClient.ICacheServerClient.md#getroledefinition) -- [getRolesByOwner](cacheServerClient_ICacheServerClient.ICacheServerClient.md#getrolesbyowner) -- [getSubOrganizationsByOrganization](cacheServerClient_ICacheServerClient.ICacheServerClient.md#getsuborganizationsbyorganization) -- [isAuthEnabled](cacheServerClient_ICacheServerClient.ICacheServerClient.md#isauthenabled) -- [issueClaim](cacheServerClient_ICacheServerClient.ICacheServerClient.md#issueclaim) -- [login](cacheServerClient_ICacheServerClient.ICacheServerClient.md#login) -- [rejectClaim](cacheServerClient_ICacheServerClient.ICacheServerClient.md#rejectclaim) -- [requestClaim](cacheServerClient_ICacheServerClient.ICacheServerClient.md#requestclaim) -- [testLogin](cacheServerClient_ICacheServerClient.ICacheServerClient.md#testlogin) +- [addDIDToWatchList](modules_cacheClient_ICacheClient.ICacheClient.md#adddidtowatchlist) +- [deleteClaim](modules_cacheClient_ICacheClient.ICacheClient.md#deleteclaim) +- [getAppDefinition](modules_cacheClient_ICacheClient.ICacheClient.md#getappdefinition) +- [getApplicationRoles](modules_cacheClient_ICacheClient.ICacheClient.md#getapplicationroles) +- [getApplicationsByOrganization](modules_cacheClient_ICacheClient.ICacheClient.md#getapplicationsbyorganization) +- [getApplicationsByOwner](modules_cacheClient_ICacheClient.ICacheClient.md#getapplicationsbyowner) +- [getAssetById](modules_cacheClient_ICacheClient.ICacheClient.md#getassetbyid) +- [getAssetHistory](modules_cacheClient_ICacheClient.ICacheClient.md#getassethistory) +- [getClaimsByIssuer](modules_cacheClient_ICacheClient.ICacheClient.md#getclaimsbyissuer) +- [getClaimsByRequester](modules_cacheClient_ICacheClient.ICacheClient.md#getclaimsbyrequester) +- [getClaimsBySubject](modules_cacheClient_ICacheClient.ICacheClient.md#getclaimsbysubject) +- [getClaimsBySubjects](modules_cacheClient_ICacheClient.ICacheClient.md#getclaimsbysubjects) +- [getDIDsForRole](modules_cacheClient_ICacheClient.ICacheClient.md#getdidsforrole) +- [getDidDocument](modules_cacheClient_ICacheClient.ICacheClient.md#getdiddocument) +- [getNamespaceBySearchPhrase](modules_cacheClient_ICacheClient.ICacheClient.md#getnamespacebysearchphrase) +- [getOfferedAssets](modules_cacheClient_ICacheClient.ICacheClient.md#getofferedassets) +- [getOrgDefinition](modules_cacheClient_ICacheClient.ICacheClient.md#getorgdefinition) +- [getOrgHierarchy](modules_cacheClient_ICacheClient.ICacheClient.md#getorghierarchy) +- [getOrganizationRoles](modules_cacheClient_ICacheClient.ICacheClient.md#getorganizationroles) +- [getOrganizationsByOwner](modules_cacheClient_ICacheClient.ICacheClient.md#getorganizationsbyowner) +- [getOwnedAssets](modules_cacheClient_ICacheClient.ICacheClient.md#getownedassets) +- [getPreviouslyOwnedAssets](modules_cacheClient_ICacheClient.ICacheClient.md#getpreviouslyownedassets) +- [getRoleDefinition](modules_cacheClient_ICacheClient.ICacheClient.md#getroledefinition) +- [getRolesByOwner](modules_cacheClient_ICacheClient.ICacheClient.md#getrolesbyowner) +- [getSubOrganizationsByOrganization](modules_cacheClient_ICacheClient.ICacheClient.md#getsuborganizationsbyorganization) +- [isAuthEnabled](modules_cacheClient_ICacheClient.ICacheClient.md#isauthenabled) +- [issueClaim](modules_cacheClient_ICacheClient.ICacheClient.md#issueclaim) +- [login](modules_cacheClient_ICacheClient.ICacheClient.md#login) +- [rejectClaim](modules_cacheClient_ICacheClient.ICacheClient.md#rejectclaim) +- [requestClaim](modules_cacheClient_ICacheClient.ICacheClient.md#requestclaim) +- [testLogin](modules_cacheClient_ICacheClient.ICacheClient.md#testlogin) ## Properties ### pubKeyAndIdentityToken -• **pubKeyAndIdentityToken**: `undefined` \| [`IPubKeyAndIdentityToken`](utils_getPublicKeyAndIdentityToken.IPubKeyAndIdentityToken.md) +• **pubKeyAndIdentityToken**: `undefined` \| [`IPubKeyAndIdentityToken`](modules_signer_signer_types.IPubKeyAndIdentityToken.md) ## Methods @@ -107,7 +107,7 @@ ___ ### getApplicationRoles -▸ **getApplicationRoles**(`__namedParameters`): `Promise`<[`IRole`](cacheServerClient_cacheServerClient_types.IRole.md)[]\> +▸ **getApplicationRoles**(`__namedParameters`): `Promise`<[`IRole`](modules_domains_domains_types.IRole.md)[]\> #### Parameters @@ -118,13 +118,13 @@ ___ #### Returns -`Promise`<[`IRole`](cacheServerClient_cacheServerClient_types.IRole.md)[]\> +`Promise`<[`IRole`](modules_domains_domains_types.IRole.md)[]\> ___ ### getApplicationsByOrganization -▸ **getApplicationsByOrganization**(`__namedParameters`): `Promise`<[`IApp`](cacheServerClient_cacheServerClient_types.IApp.md)[]\> +▸ **getApplicationsByOrganization**(`__namedParameters`): `Promise`<[`IApp`](modules_domains_domains_types.IApp.md)[]\> #### Parameters @@ -135,13 +135,13 @@ ___ #### Returns -`Promise`<[`IApp`](cacheServerClient_cacheServerClient_types.IApp.md)[]\> +`Promise`<[`IApp`](modules_domains_domains_types.IApp.md)[]\> ___ ### getApplicationsByOwner -▸ **getApplicationsByOwner**(`__namedParameters`): `Promise`<[`IApp`](cacheServerClient_cacheServerClient_types.IApp.md)[]\> +▸ **getApplicationsByOwner**(`__namedParameters`): `Promise`<[`IApp`](modules_domains_domains_types.IApp.md)[]\> #### Parameters @@ -152,13 +152,13 @@ ___ #### Returns -`Promise`<[`IApp`](cacheServerClient_cacheServerClient_types.IApp.md)[]\> +`Promise`<[`IApp`](modules_domains_domains_types.IApp.md)[]\> ___ ### getAssetById -▸ **getAssetById**(`__namedParameters`): `Promise`<[`Asset`](cacheServerClient_cacheServerClient_types.Asset.md)\> +▸ **getAssetById**(`__namedParameters`): `Promise`<[`Asset`](modules_assets_assets_types.Asset.md)\> #### Parameters @@ -169,13 +169,13 @@ ___ #### Returns -`Promise`<[`Asset`](cacheServerClient_cacheServerClient_types.Asset.md)\> +`Promise`<[`Asset`](modules_assets_assets_types.Asset.md)\> ___ ### getAssetHistory -▸ **getAssetHistory**(`__namedParameters`): `Promise`<[`AssetHistory`](cacheServerClient_cacheServerClient_types.AssetHistory.md)[]\> +▸ **getAssetHistory**(`__namedParameters`): `Promise`<[`AssetHistory`](modules_assets_assets_types.AssetHistory.md)[]\> #### Parameters @@ -183,20 +183,20 @@ ___ | :------ | :------ | | `__namedParameters` | `Object` | | `__namedParameters.id` | `string` | -| `__namedParameters.order?` | [`Order`](../enums/cacheServerClient_cacheServerClient_types.Order.md) | +| `__namedParameters.order?` | [`Order`](../enums/modules_cacheClient_cacheClient_types.Order.md) | | `__namedParameters.skip?` | `number` | | `__namedParameters.take?` | `number` | -| `__namedParameters.type?` | [`AssetHistoryEventType`](../enums/cacheServerClient_cacheServerClient_types.AssetHistoryEventType.md) | +| `__namedParameters.type?` | [`AssetHistoryEventType`](../enums/modules_assets_assets_types.AssetHistoryEventType.md) | #### Returns -`Promise`<[`AssetHistory`](cacheServerClient_cacheServerClient_types.AssetHistory.md)[]\> +`Promise`<[`AssetHistory`](modules_assets_assets_types.AssetHistory.md)[]\> ___ ### getClaimsByIssuer -▸ **getClaimsByIssuer**(`__namedParameters`): `Promise`<[`Claim`](cacheServerClient_cacheServerClient_types.Claim.md)[]\> +▸ **getClaimsByIssuer**(`__namedParameters`): `Promise`<[`Claim`](modules_claims_claims_types.Claim.md)[]\> #### Parameters @@ -209,13 +209,13 @@ ___ #### Returns -`Promise`<[`Claim`](cacheServerClient_cacheServerClient_types.Claim.md)[]\> +`Promise`<[`Claim`](modules_claims_claims_types.Claim.md)[]\> ___ ### getClaimsByRequester -▸ **getClaimsByRequester**(`__namedParameters`): `Promise`<[`Claim`](cacheServerClient_cacheServerClient_types.Claim.md)[]\> +▸ **getClaimsByRequester**(`__namedParameters`): `Promise`<[`Claim`](modules_claims_claims_types.Claim.md)[]\> #### Parameters @@ -228,13 +228,13 @@ ___ #### Returns -`Promise`<[`Claim`](cacheServerClient_cacheServerClient_types.Claim.md)[]\> +`Promise`<[`Claim`](modules_claims_claims_types.Claim.md)[]\> ___ ### getClaimsBySubject -▸ **getClaimsBySubject**(`__namedParameters`): `Promise`<[`Claim`](cacheServerClient_cacheServerClient_types.Claim.md)[]\> +▸ **getClaimsBySubject**(`__namedParameters`): `Promise`<[`Claim`](modules_claims_claims_types.Claim.md)[]\> #### Parameters @@ -247,13 +247,13 @@ ___ #### Returns -`Promise`<[`Claim`](cacheServerClient_cacheServerClient_types.Claim.md)[]\> +`Promise`<[`Claim`](modules_claims_claims_types.Claim.md)[]\> ___ ### getClaimsBySubjects -▸ **getClaimsBySubjects**(`subjects`): `Promise`<[`Claim`](cacheServerClient_cacheServerClient_types.Claim.md)[]\> +▸ **getClaimsBySubjects**(`subjects`): `Promise`<[`Claim`](modules_claims_claims_types.Claim.md)[]\> #### Parameters @@ -263,7 +263,7 @@ ___ #### Returns -`Promise`<[`Claim`](cacheServerClient_cacheServerClient_types.Claim.md)[]\> +`Promise`<[`Claim`](modules_claims_claims_types.Claim.md)[]\> ___ @@ -304,7 +304,7 @@ ___ ### getNamespaceBySearchPhrase -▸ **getNamespaceBySearchPhrase**(`__namedParameters`): `Promise`<([`IOrganization`](cacheServerClient_cacheServerClient_types.IOrganization.md) \| [`IApp`](cacheServerClient_cacheServerClient_types.IApp.md) \| [`IRole`](cacheServerClient_cacheServerClient_types.IRole.md))[]\> +▸ **getNamespaceBySearchPhrase**(`__namedParameters`): `Promise`<([`IRole`](modules_domains_domains_types.IRole.md) \| [`IOrganization`](modules_domains_domains_types.IOrganization.md) \| [`IApp`](modules_domains_domains_types.IApp.md))[]\> #### Parameters @@ -316,13 +316,13 @@ ___ #### Returns -`Promise`<([`IOrganization`](cacheServerClient_cacheServerClient_types.IOrganization.md) \| [`IApp`](cacheServerClient_cacheServerClient_types.IApp.md) \| [`IRole`](cacheServerClient_cacheServerClient_types.IRole.md))[]\> +`Promise`<([`IRole`](modules_domains_domains_types.IRole.md) \| [`IOrganization`](modules_domains_domains_types.IOrganization.md) \| [`IApp`](modules_domains_domains_types.IApp.md))[]\> ___ ### getOfferedAssets -▸ **getOfferedAssets**(`__namedParameters`): `Promise`<[`Asset`](cacheServerClient_cacheServerClient_types.Asset.md)[]\> +▸ **getOfferedAssets**(`__namedParameters`): `Promise`<[`Asset`](modules_assets_assets_types.Asset.md)[]\> #### Parameters @@ -333,7 +333,7 @@ ___ #### Returns -`Promise`<[`Asset`](cacheServerClient_cacheServerClient_types.Asset.md)[]\> +`Promise`<[`Asset`](modules_assets_assets_types.Asset.md)[]\> ___ @@ -356,7 +356,7 @@ ___ ### getOrgHierarchy -▸ **getOrgHierarchy**(`__namedParameters`): `Promise`<[`IOrganization`](cacheServerClient_cacheServerClient_types.IOrganization.md)\> +▸ **getOrgHierarchy**(`__namedParameters`): `Promise`<[`IOrganization`](modules_domains_domains_types.IOrganization.md)\> #### Parameters @@ -367,13 +367,13 @@ ___ #### Returns -`Promise`<[`IOrganization`](cacheServerClient_cacheServerClient_types.IOrganization.md)\> +`Promise`<[`IOrganization`](modules_domains_domains_types.IOrganization.md)\> ___ ### getOrganizationRoles -▸ **getOrganizationRoles**(`__namedParameters`): `Promise`<[`IRole`](cacheServerClient_cacheServerClient_types.IRole.md)[]\> +▸ **getOrganizationRoles**(`__namedParameters`): `Promise`<[`IRole`](modules_domains_domains_types.IRole.md)[]\> #### Parameters @@ -384,13 +384,13 @@ ___ #### Returns -`Promise`<[`IRole`](cacheServerClient_cacheServerClient_types.IRole.md)[]\> +`Promise`<[`IRole`](modules_domains_domains_types.IRole.md)[]\> ___ ### getOrganizationsByOwner -▸ **getOrganizationsByOwner**(`__namedParameters`): `Promise`<[`IOrganization`](cacheServerClient_cacheServerClient_types.IOrganization.md)[]\> +▸ **getOrganizationsByOwner**(`__namedParameters`): `Promise`<[`IOrganization`](modules_domains_domains_types.IOrganization.md)[]\> #### Parameters @@ -402,13 +402,13 @@ ___ #### Returns -`Promise`<[`IOrganization`](cacheServerClient_cacheServerClient_types.IOrganization.md)[]\> +`Promise`<[`IOrganization`](modules_domains_domains_types.IOrganization.md)[]\> ___ ### getOwnedAssets -▸ **getOwnedAssets**(`__namedParameters`): `Promise`<[`Asset`](cacheServerClient_cacheServerClient_types.Asset.md)[]\> +▸ **getOwnedAssets**(`__namedParameters`): `Promise`<[`Asset`](modules_assets_assets_types.Asset.md)[]\> #### Parameters @@ -419,13 +419,13 @@ ___ #### Returns -`Promise`<[`Asset`](cacheServerClient_cacheServerClient_types.Asset.md)[]\> +`Promise`<[`Asset`](modules_assets_assets_types.Asset.md)[]\> ___ ### getPreviouslyOwnedAssets -▸ **getPreviouslyOwnedAssets**(`__namedParameters`): `Promise`<[`Asset`](cacheServerClient_cacheServerClient_types.Asset.md)[]\> +▸ **getPreviouslyOwnedAssets**(`__namedParameters`): `Promise`<[`Asset`](modules_assets_assets_types.Asset.md)[]\> #### Parameters @@ -436,7 +436,7 @@ ___ #### Returns -`Promise`<[`Asset`](cacheServerClient_cacheServerClient_types.Asset.md)[]\> +`Promise`<[`Asset`](modules_assets_assets_types.Asset.md)[]\> ___ @@ -459,7 +459,7 @@ ___ ### getRolesByOwner -▸ **getRolesByOwner**(`__namedParameters`): `Promise`<[`IRole`](cacheServerClient_cacheServerClient_types.IRole.md)[]\> +▸ **getRolesByOwner**(`__namedParameters`): `Promise`<[`IRole`](modules_domains_domains_types.IRole.md)[]\> #### Parameters @@ -470,13 +470,13 @@ ___ #### Returns -`Promise`<[`IRole`](cacheServerClient_cacheServerClient_types.IRole.md)[]\> +`Promise`<[`IRole`](modules_domains_domains_types.IRole.md)[]\> ___ ### getSubOrganizationsByOrganization -▸ **getSubOrganizationsByOrganization**(`__namedParameters`): `Promise`<[`IOrganization`](cacheServerClient_cacheServerClient_types.IOrganization.md)[]\> +▸ **getSubOrganizationsByOrganization**(`__namedParameters`): `Promise`<[`IOrganization`](modules_domains_domains_types.IOrganization.md)[]\> #### Parameters @@ -487,7 +487,7 @@ ___ #### Returns -`Promise`<[`IOrganization`](cacheServerClient_cacheServerClient_types.IOrganization.md)[]\> +`Promise`<[`IOrganization`](modules_domains_domains_types.IOrganization.md)[]\> ___ @@ -511,7 +511,7 @@ ___ | :------ | :------ | | `__namedParameters` | `Object` | | `__namedParameters.did` | `string` | -| `__namedParameters.message` | [`IClaimIssuance`](iam.IClaimIssuance.md) | +| `__namedParameters.message` | [`IClaimIssuance`](modules_claims_claims_types.IClaimIssuance.md) | #### Returns @@ -539,7 +539,7 @@ ___ | :------ | :------ | | `__namedParameters` | `Object` | | `__namedParameters.did` | `string` | -| `__namedParameters.message` | [`IClaimRejection`](iam.IClaimRejection.md) | +| `__namedParameters.message` | [`IClaimRejection`](modules_claims_claims_types.IClaimRejection.md) | #### Returns @@ -557,7 +557,7 @@ ___ | :------ | :------ | | `__namedParameters` | `Object` | | `__namedParameters.did` | `string` | -| `__namedParameters.message` | [`IClaimRequest`](iam.IClaimRequest.md) | +| `__namedParameters.message` | [`IClaimRequest`](modules_claims_claims_types.IClaimRequest.md) | #### Returns diff --git a/docs/api/interfaces/modules_cacheClient_cacheClient_types.CacheServerClientOptions.md b/docs/api/interfaces/modules_cacheClient_cacheClient_types.CacheServerClientOptions.md new file mode 100644 index 00000000..cb9b25cd --- /dev/null +++ b/docs/api/interfaces/modules_cacheClient_cacheClient_types.CacheServerClientOptions.md @@ -0,0 +1,22 @@ +# Interface: CacheServerClientOptions + +[modules/cacheClient/cacheClient.types](../modules/modules_cacheClient_cacheClient_types.md).CacheServerClientOptions + +## Table of contents + +### Properties + +- [cacheServerSupportsAuth](modules_cacheClient_cacheClient_types.CacheServerClientOptions.md#cacheserversupportsauth) +- [url](modules_cacheClient_cacheClient_types.CacheServerClientOptions.md#url) + +## Properties + +### cacheServerSupportsAuth + +• `Optional` **cacheServerSupportsAuth**: `boolean` + +___ + +### url + +• **url**: `string` diff --git a/docs/api/interfaces/modules_claims_claims_types.Claim.md b/docs/api/interfaces/modules_claims_claims_types.Claim.md new file mode 100644 index 00000000..c0a95755 --- /dev/null +++ b/docs/api/interfaces/modules_claims_claims_types.Claim.md @@ -0,0 +1,113 @@ +# Interface: Claim + +[modules/claims/claims.types](../modules/modules_claims_claims_types.md).Claim + +## Table of contents + +### Properties + +- [acceptedBy](modules_claims_claims_types.Claim.md#acceptedby) +- [claimIssuer](modules_claims_claims_types.Claim.md#claimissuer) +- [claimType](modules_claims_claims_types.Claim.md#claimtype) +- [claimTypeVersion](modules_claims_claims_types.Claim.md#claimtypeversion) +- [id](modules_claims_claims_types.Claim.md#id) +- [isAccepted](modules_claims_claims_types.Claim.md#isaccepted) +- [isRejected](modules_claims_claims_types.Claim.md#isrejected) +- [issuedToken](modules_claims_claims_types.Claim.md#issuedtoken) +- [namespace](modules_claims_claims_types.Claim.md#namespace) +- [onChainProof](modules_claims_claims_types.Claim.md#onchainproof) +- [registrationTypes](modules_claims_claims_types.Claim.md#registrationtypes) +- [requester](modules_claims_claims_types.Claim.md#requester) +- [subject](modules_claims_claims_types.Claim.md#subject) +- [subjectAgreement](modules_claims_claims_types.Claim.md#subjectagreement) +- [token](modules_claims_claims_types.Claim.md#token) + +## Properties + +### acceptedBy + +• `Optional` **acceptedBy**: `string` + +___ + +### claimIssuer + +• **claimIssuer**: `string`[] + +___ + +### claimType + +• **claimType**: `string` + +___ + +### claimTypeVersion + +• **claimTypeVersion**: `string` + +___ + +### id + +• **id**: `string` + +___ + +### isAccepted + +• **isAccepted**: `boolean` + +___ + +### isRejected + +• `Optional` **isRejected**: `boolean` + +___ + +### issuedToken + +• `Optional` **issuedToken**: `string` + +___ + +### namespace + +• **namespace**: `string` + +___ + +### onChainProof + +• `Optional` **onChainProof**: `string` + +___ + +### registrationTypes + +• **registrationTypes**: [`RegistrationTypes`](../enums/modules_claims_claims_types.RegistrationTypes.md)[] + +___ + +### requester + +• **requester**: `string` + +___ + +### subject + +• **subject**: `string` + +___ + +### subjectAgreement + +• `Optional` **subjectAgreement**: `string` + +___ + +### token + +• **token**: `string` diff --git a/docs/api/interfaces/modules_claims_claims_types.IClaimIssuance.md b/docs/api/interfaces/modules_claims_claims_types.IClaimIssuance.md new file mode 100644 index 00000000..ce81953f --- /dev/null +++ b/docs/api/interfaces/modules_claims_claims_types.IClaimIssuance.md @@ -0,0 +1,68 @@ +# Interface: IClaimIssuance + +[modules/claims/claims.types](../modules/modules_claims_claims_types.md).IClaimIssuance + +## Hierarchy + +- [`IMessage`](modules_messaging_messaging_types.IMessage.md) + + ↳ **`IClaimIssuance`** + +## Table of contents + +### Properties + +- [acceptedBy](modules_claims_claims_types.IClaimIssuance.md#acceptedby) +- [claimIssuer](modules_claims_claims_types.IClaimIssuance.md#claimissuer) +- [id](modules_claims_claims_types.IClaimIssuance.md#id) +- [issuedToken](modules_claims_claims_types.IClaimIssuance.md#issuedtoken) +- [onChainProof](modules_claims_claims_types.IClaimIssuance.md#onchainproof) +- [requester](modules_claims_claims_types.IClaimIssuance.md#requester) + +## Properties + +### acceptedBy + +• **acceptedBy**: `string` + +___ + +### claimIssuer + +• `Optional` **claimIssuer**: `string`[] + +#### Inherited from + +[IMessage](modules_messaging_messaging_types.IMessage.md).[claimIssuer](modules_messaging_messaging_types.IMessage.md#claimissuer) + +___ + +### id + +• **id**: `string` + +#### Inherited from + +[IMessage](modules_messaging_messaging_types.IMessage.md).[id](modules_messaging_messaging_types.IMessage.md#id) + +___ + +### issuedToken + +• `Optional` **issuedToken**: `string` + +___ + +### onChainProof + +• `Optional` **onChainProof**: `string` + +___ + +### requester + +• **requester**: `string` + +#### Inherited from + +[IMessage](modules_messaging_messaging_types.IMessage.md).[requester](modules_messaging_messaging_types.IMessage.md#requester) diff --git a/docs/api/interfaces/modules_claims_claims_types.IClaimRejection.md b/docs/api/interfaces/modules_claims_claims_types.IClaimRejection.md new file mode 100644 index 00000000..8b819ec4 --- /dev/null +++ b/docs/api/interfaces/modules_claims_claims_types.IClaimRejection.md @@ -0,0 +1,54 @@ +# Interface: IClaimRejection + +[modules/claims/claims.types](../modules/modules_claims_claims_types.md).IClaimRejection + +## Hierarchy + +- [`IMessage`](modules_messaging_messaging_types.IMessage.md) + + ↳ **`IClaimRejection`** + +## Table of contents + +### Properties + +- [claimIssuer](modules_claims_claims_types.IClaimRejection.md#claimissuer) +- [id](modules_claims_claims_types.IClaimRejection.md#id) +- [isRejected](modules_claims_claims_types.IClaimRejection.md#isrejected) +- [requester](modules_claims_claims_types.IClaimRejection.md#requester) + +## Properties + +### claimIssuer + +• `Optional` **claimIssuer**: `string`[] + +#### Inherited from + +[IMessage](modules_messaging_messaging_types.IMessage.md).[claimIssuer](modules_messaging_messaging_types.IMessage.md#claimissuer) + +___ + +### id + +• **id**: `string` + +#### Inherited from + +[IMessage](modules_messaging_messaging_types.IMessage.md).[id](modules_messaging_messaging_types.IMessage.md#id) + +___ + +### isRejected + +• **isRejected**: `boolean` + +___ + +### requester + +• **requester**: `string` + +#### Inherited from + +[IMessage](modules_messaging_messaging_types.IMessage.md).[requester](modules_messaging_messaging_types.IMessage.md#requester) diff --git a/docs/api/interfaces/modules_claims_claims_types.IClaimRequest.md b/docs/api/interfaces/modules_claims_claims_types.IClaimRequest.md new file mode 100644 index 00000000..d51f0a6a --- /dev/null +++ b/docs/api/interfaces/modules_claims_claims_types.IClaimRequest.md @@ -0,0 +1,68 @@ +# Interface: IClaimRequest + +[modules/claims/claims.types](../modules/modules_claims_claims_types.md).IClaimRequest + +## Hierarchy + +- [`IMessage`](modules_messaging_messaging_types.IMessage.md) + + ↳ **`IClaimRequest`** + +## Table of contents + +### Properties + +- [claimIssuer](modules_claims_claims_types.IClaimRequest.md#claimissuer) +- [id](modules_claims_claims_types.IClaimRequest.md#id) +- [registrationTypes](modules_claims_claims_types.IClaimRequest.md#registrationtypes) +- [requester](modules_claims_claims_types.IClaimRequest.md#requester) +- [subjectAgreement](modules_claims_claims_types.IClaimRequest.md#subjectagreement) +- [token](modules_claims_claims_types.IClaimRequest.md#token) + +## Properties + +### claimIssuer + +• `Optional` **claimIssuer**: `string`[] + +#### Inherited from + +[IMessage](modules_messaging_messaging_types.IMessage.md).[claimIssuer](modules_messaging_messaging_types.IMessage.md#claimissuer) + +___ + +### id + +• **id**: `string` + +#### Inherited from + +[IMessage](modules_messaging_messaging_types.IMessage.md).[id](modules_messaging_messaging_types.IMessage.md#id) + +___ + +### registrationTypes + +• **registrationTypes**: [`RegistrationTypes`](../enums/modules_claims_claims_types.RegistrationTypes.md)[] + +___ + +### requester + +• **requester**: `string` + +#### Inherited from + +[IMessage](modules_messaging_messaging_types.IMessage.md).[requester](modules_messaging_messaging_types.IMessage.md#requester) + +___ + +### subjectAgreement + +• `Optional` **subjectAgreement**: `string` + +___ + +### token + +• **token**: `string` diff --git a/docs/api/interfaces/modules_didRegistry_did_types.AssetProfile.md b/docs/api/interfaces/modules_didRegistry_did_types.AssetProfile.md new file mode 100644 index 00000000..c2442cba --- /dev/null +++ b/docs/api/interfaces/modules_didRegistry_did_types.AssetProfile.md @@ -0,0 +1,22 @@ +# Interface: AssetProfile + +[modules/didRegistry/did.types](../modules/modules_didRegistry_did_types.md).AssetProfile + +## Table of contents + +### Properties + +- [icon](modules_didRegistry_did_types.AssetProfile.md#icon) +- [name](modules_didRegistry_did_types.AssetProfile.md#name) + +## Properties + +### icon + +• `Optional` **icon**: `string` + +___ + +### name + +• `Optional` **name**: `string` diff --git a/docs/api/interfaces/modules_didRegistry_did_types.AssetProfiles.md b/docs/api/interfaces/modules_didRegistry_did_types.AssetProfiles.md new file mode 100644 index 00000000..8aafbef4 --- /dev/null +++ b/docs/api/interfaces/modules_didRegistry_did_types.AssetProfiles.md @@ -0,0 +1,7 @@ +# Interface: AssetProfiles + +[modules/didRegistry/did.types](../modules/modules_didRegistry_did_types.md).AssetProfiles + +## Indexable + +▪ [key: `string`]: [`AssetProfile`](modules_didRegistry_did_types.AssetProfile.md) diff --git a/docs/api/interfaces/modules_didRegistry_did_types.ClaimData.md b/docs/api/interfaces/modules_didRegistry_did_types.ClaimData.md new file mode 100644 index 00000000..42b291f2 --- /dev/null +++ b/docs/api/interfaces/modules_didRegistry_did_types.ClaimData.md @@ -0,0 +1,35 @@ +# Interface: ClaimData + +[modules/didRegistry/did.types](../modules/modules_didRegistry_did_types.md).ClaimData + +## Hierarchy + +- `Record`<`string`, `unknown`\> + + ↳ **`ClaimData`** + +## Table of contents + +### Properties + +- [claimType](modules_didRegistry_did_types.ClaimData.md#claimtype) +- [claimTypeVersion](modules_didRegistry_did_types.ClaimData.md#claimtypeversion) +- [profile](modules_didRegistry_did_types.ClaimData.md#profile) + +## Properties + +### claimType + +• `Optional` **claimType**: `string` + +___ + +### claimTypeVersion + +• `Optional` **claimTypeVersion**: `number` + +___ + +### profile + +• `Optional` **profile**: [`Profile`](modules_didRegistry_did_types.Profile.md) diff --git a/docs/api/interfaces/modules_didRegistry_did_types.Profile.md b/docs/api/interfaces/modules_didRegistry_did_types.Profile.md new file mode 100644 index 00000000..df250e89 --- /dev/null +++ b/docs/api/interfaces/modules_didRegistry_did_types.Profile.md @@ -0,0 +1,36 @@ +# Interface: Profile + +[modules/didRegistry/did.types](../modules/modules_didRegistry_did_types.md).Profile + +## Table of contents + +### Properties + +- [address](modules_didRegistry_did_types.Profile.md#address) +- [assetProfiles](modules_didRegistry_did_types.Profile.md#assetprofiles) +- [birthdate](modules_didRegistry_did_types.Profile.md#birthdate) +- [name](modules_didRegistry_did_types.Profile.md#name) + +## Properties + +### address + +• `Optional` **address**: `string` + +___ + +### assetProfiles + +• `Optional` **assetProfiles**: [`AssetProfiles`](modules_didRegistry_did_types.AssetProfiles.md) + +___ + +### birthdate + +• `Optional` **birthdate**: `string` + +___ + +### name + +• `Optional` **name**: `string` diff --git a/docs/api/interfaces/modules_domains_domains_types.IApp.md b/docs/api/interfaces/modules_domains_domains_types.IApp.md new file mode 100644 index 00000000..13d02bcf --- /dev/null +++ b/docs/api/interfaces/modules_domains_domains_types.IApp.md @@ -0,0 +1,57 @@ +# Interface: IApp + +[modules/domains/domains.types](../modules/modules_domains_domains_types.md).IApp + +## Table of contents + +### Properties + +- [definition](modules_domains_domains_types.IApp.md#definition) +- [isOwnedByCurrentUser](modules_domains_domains_types.IApp.md#isownedbycurrentuser) +- [name](modules_domains_domains_types.IApp.md#name) +- [namespace](modules_domains_domains_types.IApp.md#namespace) +- [owner](modules_domains_domains_types.IApp.md#owner) +- [roles](modules_domains_domains_types.IApp.md#roles) +- [uid](modules_domains_domains_types.IApp.md#uid) + +## Properties + +### definition + +• **definition**: `IAppDefinition` + +___ + +### isOwnedByCurrentUser + +• `Optional` **isOwnedByCurrentUser**: `boolean` + +___ + +### name + +• **name**: `string` + +___ + +### namespace + +• **namespace**: `string` + +___ + +### owner + +• **owner**: `string` + +___ + +### roles + +• `Optional` **roles**: [`IRole`](modules_domains_domains_types.IRole.md)[] + +___ + +### uid + +• **uid**: `string` diff --git a/docs/api/interfaces/modules_domains_domains_types.IOrganization.md b/docs/api/interfaces/modules_domains_domains_types.IOrganization.md new file mode 100644 index 00000000..ee31bf4f --- /dev/null +++ b/docs/api/interfaces/modules_domains_domains_types.IOrganization.md @@ -0,0 +1,71 @@ +# Interface: IOrganization + +[modules/domains/domains.types](../modules/modules_domains_domains_types.md).IOrganization + +## Table of contents + +### Properties + +- [apps](modules_domains_domains_types.IOrganization.md#apps) +- [definition](modules_domains_domains_types.IOrganization.md#definition) +- [isOwnedByCurrentUser](modules_domains_domains_types.IOrganization.md#isownedbycurrentuser) +- [name](modules_domains_domains_types.IOrganization.md#name) +- [namespace](modules_domains_domains_types.IOrganization.md#namespace) +- [owner](modules_domains_domains_types.IOrganization.md#owner) +- [roles](modules_domains_domains_types.IOrganization.md#roles) +- [subOrgs](modules_domains_domains_types.IOrganization.md#suborgs) +- [uid](modules_domains_domains_types.IOrganization.md#uid) + +## Properties + +### apps + +• `Optional` **apps**: [`IApp`](modules_domains_domains_types.IApp.md)[] + +___ + +### definition + +• **definition**: `IOrganizationDefinition` + +___ + +### isOwnedByCurrentUser + +• `Optional` **isOwnedByCurrentUser**: `boolean` + +___ + +### name + +• **name**: `string` + +___ + +### namespace + +• **namespace**: `string` + +___ + +### owner + +• **owner**: `string` + +___ + +### roles + +• `Optional` **roles**: [`IRole`](modules_domains_domains_types.IRole.md)[] + +___ + +### subOrgs + +• `Optional` **subOrgs**: [`IOrganization`](modules_domains_domains_types.IOrganization.md)[] + +___ + +### uid + +• **uid**: `string` diff --git a/docs/api/interfaces/modules_domains_domains_types.IRole.md b/docs/api/interfaces/modules_domains_domains_types.IRole.md new file mode 100644 index 00000000..2c733dfb --- /dev/null +++ b/docs/api/interfaces/modules_domains_domains_types.IRole.md @@ -0,0 +1,50 @@ +# Interface: IRole + +[modules/domains/domains.types](../modules/modules_domains_domains_types.md).IRole + +## Table of contents + +### Properties + +- [definition](modules_domains_domains_types.IRole.md#definition) +- [isOwnedByCurrentUser](modules_domains_domains_types.IRole.md#isownedbycurrentuser) +- [name](modules_domains_domains_types.IRole.md#name) +- [namespace](modules_domains_domains_types.IRole.md#namespace) +- [owner](modules_domains_domains_types.IRole.md#owner) +- [uid](modules_domains_domains_types.IRole.md#uid) + +## Properties + +### definition + +• **definition**: `IRoleDefinition` + +___ + +### isOwnedByCurrentUser + +• `Optional` **isOwnedByCurrentUser**: `boolean` + +___ + +### name + +• **name**: `string` + +___ + +### namespace + +• **namespace**: `string` + +___ + +### owner + +• **owner**: `string` + +___ + +### uid + +• **uid**: `string` diff --git a/docs/api/interfaces/modules_messaging_messaging_types.IMessage.md b/docs/api/interfaces/modules_messaging_messaging_types.IMessage.md new file mode 100644 index 00000000..d9c38e43 --- /dev/null +++ b/docs/api/interfaces/modules_messaging_messaging_types.IMessage.md @@ -0,0 +1,39 @@ +# Interface: IMessage + +[modules/messaging/messaging.types](../modules/modules_messaging_messaging_types.md).IMessage + +## Hierarchy + +- **`IMessage`** + + ↳ [`IClaimRequest`](modules_claims_claims_types.IClaimRequest.md) + + ↳ [`IClaimIssuance`](modules_claims_claims_types.IClaimIssuance.md) + + ↳ [`IClaimRejection`](modules_claims_claims_types.IClaimRejection.md) + +## Table of contents + +### Properties + +- [claimIssuer](modules_messaging_messaging_types.IMessage.md#claimissuer) +- [id](modules_messaging_messaging_types.IMessage.md#id) +- [requester](modules_messaging_messaging_types.IMessage.md#requester) + +## Properties + +### claimIssuer + +• `Optional` **claimIssuer**: `string`[] + +___ + +### id + +• **id**: `string` + +___ + +### requester + +• **requester**: `string` diff --git a/docs/api/interfaces/modules_signer_signer_types.IPubKeyAndIdentityToken.md b/docs/api/interfaces/modules_signer_signer_types.IPubKeyAndIdentityToken.md new file mode 100644 index 00000000..6e6bd2e2 --- /dev/null +++ b/docs/api/interfaces/modules_signer_signer_types.IPubKeyAndIdentityToken.md @@ -0,0 +1,22 @@ +# Interface: IPubKeyAndIdentityToken + +[modules/signer/signer.types](../modules/modules_signer_signer_types.md).IPubKeyAndIdentityToken + +## Table of contents + +### Properties + +- [identityToken](modules_signer_signer_types.IPubKeyAndIdentityToken.md#identitytoken) +- [publicKey](modules_signer_signer_types.IPubKeyAndIdentityToken.md#publickey) + +## Properties + +### identityToken + +• **identityToken**: `string` + +___ + +### publicKey + +• **publicKey**: `string` diff --git a/docs/api/interfaces/utils_getPublicKeyAndIdentityToken.IPubKeyAndIdentityToken.md b/docs/api/interfaces/utils_getPublicKeyAndIdentityToken.IPubKeyAndIdentityToken.md deleted file mode 100644 index c7e10d7b..00000000 --- a/docs/api/interfaces/utils_getPublicKeyAndIdentityToken.IPubKeyAndIdentityToken.md +++ /dev/null @@ -1,22 +0,0 @@ -# Interface: IPubKeyAndIdentityToken - -[utils/getPublicKeyAndIdentityToken](../modules/utils_getPublicKeyAndIdentityToken.md).IPubKeyAndIdentityToken - -## Table of contents - -### Properties - -- [identityToken](utils_getPublicKeyAndIdentityToken.IPubKeyAndIdentityToken.md#identitytoken) -- [publicKey](utils_getPublicKeyAndIdentityToken.IPubKeyAndIdentityToken.md#publickey) - -## Properties - -### identityToken - -• **identityToken**: `string` - -___ - -### publicKey - -• **publicKey**: `string` diff --git a/docs/api/modules.md b/docs/api/modules.md index a93bda3e..3d83828c 100644 --- a/docs/api/modules.md +++ b/docs/api/modules.md @@ -4,33 +4,50 @@ ### Modules -- [GnosisIam](modules/GnosisIam.md) -- [cacheServerClient/ICacheServerClient](modules/cacheServerClient_ICacheServerClient.md) -- [cacheServerClient/cacheServerClient](modules/cacheServerClient_cacheServerClient.md) -- [cacheServerClient/cacheServerClient.types](modules/cacheServerClient_cacheServerClient_types.md) +- [config](modules/config.md) +- [config/cache.config](modules/config_cache_config.md) +- [config/chain.config](modules/config_chain_config.md) +- [config/messaging.config](modules/config_messaging_config.md) - [errors](modules/errors.md) -- [errors/CacheClientNotProvided](modules/errors_CacheClientNotProvided.md) - [errors/ChangeOwnershipNotPossibleError](modules/errors_ChangeOwnershipNotPossibleError.md) - [errors/DeletingNamespaceNotPossibleError](modules/errors_DeletingNamespaceNotPossibleError.md) -- [errors/ENSRegistryNotInitializedError](modules/errors_ENSRegistryNotInitializedError.md) -- [errors/ENSResolverNotInitializedError](modules/errors_ENSResolverNotInitializedError.md) -- [errors/ENSTypeNOtSupportedError](modules/errors_ENSTypeNOtSupportedError.md) +- [errors/ENSTypeNotSupportedError](modules/errors_ENSTypeNotSupportedError.md) - [errors/ErrorMessages](modules/errors_ErrorMessages.md) - [errors/MethodNotAvailableInNodeError](modules/errors_MethodNotAvailableInNodeError.md) -- [errors/NatsConnectionNotEstablishedError](modules/errors_NatsConnectionNotEstablishedError.md) -- [iam](modules/iam.md) -- [iam-client-lib](modules/iam_client_lib.md) -- [iam/chainConfig](modules/iam_chainConfig.md) -- [iam/iam-base](modules/iam_iam_base.md) -- [signer/Owner](modules/signer_Owner.md) -- [staking](modules/staking.md) -- [types/WalletProvider](modules/types_WalletProvider.md) +- [index](modules/index.md) +- [init](modules/init.md) +- [modules/assets](modules/modules_assets.md) +- [modules/assets/assets.service](modules/modules_assets_assets_service.md) +- [modules/assets/assets.types](modules/modules_assets_assets_types.md) +- [modules/cacheClient](modules/modules_cacheClient.md) +- [modules/cacheClient/ICacheClient](modules/modules_cacheClient_ICacheClient.md) +- [modules/cacheClient/cacheClient.service](modules/modules_cacheClient_cacheClient_service.md) +- [modules/cacheClient/cacheClient.types](modules/modules_cacheClient_cacheClient_types.md) +- [modules/claims](modules/modules_claims.md) +- [modules/claims/claims.service](modules/modules_claims_claims_service.md) +- [modules/claims/claims.types](modules/modules_claims_claims_types.md) +- [modules/didRegistry](modules/modules_didRegistry.md) +- [modules/didRegistry/did.types](modules/modules_didRegistry_did_types.md) +- [modules/didRegistry/didRegistry.service](modules/modules_didRegistry_didRegistry_service.md) +- [modules/domains](modules/modules_domains.md) +- [modules/domains/domains.service](modules/modules_domains_domains_service.md) +- [modules/domains/domains.types](modules/modules_domains_domains_types.md) +- [modules/messaging](modules/modules_messaging.md) +- [modules/messaging/messaging.service](modules/modules_messaging_messaging_service.md) +- [modules/messaging/messaging.types](modules/modules_messaging_messaging_types.md) +- [modules/signer](modules/modules_signer.md) +- [modules/signer/gnosisSigner](modules/modules_signer_gnosisSigner.md) +- [modules/signer/metamaskSigner](modules/modules_signer_metamaskSigner.md) +- [modules/signer/privateKeySigner](modules/modules_signer_privateKeySigner.md) +- [modules/signer/signer.service](modules/modules_signer_signer_service.md) +- [modules/signer/signer.types](modules/modules_signer_signer_types.md) +- [modules/signer/walletConnectKms](modules/modules_signer_walletConnectKms.md) +- [modules/signer/walletConnectMetamask](modules/modules_signer_walletConnectMetamask.md) +- [modules/staking](modules/modules_staking.md) +- [modules/staking/staking.service](modules/modules_staking_staking_service.md) - [utils/ENS\_hash](modules/utils_ENS_hash.md) - [utils/change\_resolver](modules/utils_change_resolver.md) - [utils/constants](modules/utils_constants.md) - [utils/detectEnvironment](modules/utils_detectEnvironment.md) - [utils/did](modules/utils_did.md) - [utils/enrollment](modules/utils_enrollment.md) -- [utils/getPublicKeyAndIdentityToken](modules/utils_getPublicKeyAndIdentityToken.md) -- [walletconnect/ControllableWalletConnect](modules/walletconnect_ControllableWalletConnect.md) -- [walletconnect/WalletConnectService](modules/walletconnect_WalletConnectService.md) diff --git a/docs/api/modules/GnosisIam.md b/docs/api/modules/GnosisIam.md deleted file mode 100644 index ff909c22..00000000 --- a/docs/api/modules/GnosisIam.md +++ /dev/null @@ -1,7 +0,0 @@ -# Module: GnosisIam - -## Table of contents - -### Classes - -- [GnosisIam](../classes/GnosisIam.GnosisIam-1.md) diff --git a/docs/api/modules/cacheServerClient_ICacheServerClient.md b/docs/api/modules/cacheServerClient_ICacheServerClient.md deleted file mode 100644 index 145f09d5..00000000 --- a/docs/api/modules/cacheServerClient_ICacheServerClient.md +++ /dev/null @@ -1,7 +0,0 @@ -# Module: cacheServerClient/ICacheServerClient - -## Table of contents - -### Interfaces - -- [ICacheServerClient](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md) diff --git a/docs/api/modules/cacheServerClient_cacheServerClient.md b/docs/api/modules/cacheServerClient_cacheServerClient.md deleted file mode 100644 index 0b89743c..00000000 --- a/docs/api/modules/cacheServerClient_cacheServerClient.md +++ /dev/null @@ -1,11 +0,0 @@ -# Module: cacheServerClient/cacheServerClient - -## Table of contents - -### Classes - -- [CacheServerClient](../classes/cacheServerClient_cacheServerClient.CacheServerClient.md) - -### Interfaces - -- [CacheServerClientOptions](../interfaces/cacheServerClient_cacheServerClient.CacheServerClientOptions.md) diff --git a/docs/api/modules/cacheServerClient_cacheServerClient_types.md b/docs/api/modules/cacheServerClient_cacheServerClient_types.md deleted file mode 100644 index 2e704d3b..00000000 --- a/docs/api/modules/cacheServerClient_cacheServerClient_types.md +++ /dev/null @@ -1,22 +0,0 @@ -# Module: cacheServerClient/cacheServerClient.types - -## Table of contents - -### Enumerations - -- [AssetHistoryEventType](../enums/cacheServerClient_cacheServerClient_types.AssetHistoryEventType.md) -- [Order](../enums/cacheServerClient_cacheServerClient_types.Order.md) -- [RegistrationTypes](../enums/cacheServerClient_cacheServerClient_types.RegistrationTypes.md) - -### Interfaces - -- [Asset](../interfaces/cacheServerClient_cacheServerClient_types.Asset.md) -- [AssetHistory](../interfaces/cacheServerClient_cacheServerClient_types.AssetHistory.md) -- [AssetProfile](../interfaces/cacheServerClient_cacheServerClient_types.AssetProfile.md) -- [AssetProfiles](../interfaces/cacheServerClient_cacheServerClient_types.AssetProfiles.md) -- [Claim](../interfaces/cacheServerClient_cacheServerClient_types.Claim.md) -- [ClaimData](../interfaces/cacheServerClient_cacheServerClient_types.ClaimData.md) -- [IApp](../interfaces/cacheServerClient_cacheServerClient_types.IApp.md) -- [IOrganization](../interfaces/cacheServerClient_cacheServerClient_types.IOrganization.md) -- [IRole](../interfaces/cacheServerClient_cacheServerClient_types.IRole.md) -- [Profile](../interfaces/cacheServerClient_cacheServerClient_types.Profile.md) diff --git a/docs/api/modules/config.md b/docs/api/modules/config.md new file mode 100644 index 00000000..d97beb5b --- /dev/null +++ b/docs/api/modules/config.md @@ -0,0 +1,69 @@ +# Module: config + +## Table of contents + +### References + +- [ChainConfig](config.md#chainconfig) +- [ChainId](config.md#chainid) +- [MessagingConfig](config.md#messagingconfig) +- [cacheConfigs](config.md#cacheconfigs) +- [chainConfigs](config.md#chainconfigs) +- [messagingConfigs](config.md#messagingconfigs) +- [setCacheConfig](config.md#setcacheconfig) +- [setChainConfig](config.md#setchainconfig) +- [setMessagingConfig](config.md#setmessagingconfig) + +## References + +### ChainConfig + +Re-exports: [ChainConfig](../interfaces/config_chain_config.ChainConfig.md) + +___ + +### ChainId + +Re-exports: [ChainId](config_chain_config.md#chainid) + +___ + +### MessagingConfig + +Re-exports: [MessagingConfig](../interfaces/config_messaging_config.MessagingConfig.md) + +___ + +### cacheConfigs + +Re-exports: [cacheConfigs](config_cache_config.md#cacheconfigs) + +___ + +### chainConfigs + +Re-exports: [chainConfigs](config_chain_config.md#chainconfigs) + +___ + +### messagingConfigs + +Re-exports: [messagingConfigs](config_messaging_config.md#messagingconfigs) + +___ + +### setCacheConfig + +Re-exports: [setCacheConfig](config_cache_config.md#setcacheconfig) + +___ + +### setChainConfig + +Re-exports: [setChainConfig](config_chain_config.md#setchainconfig) + +___ + +### setMessagingConfig + +Re-exports: [setMessagingConfig](config_messaging_config.md#setmessagingconfig) diff --git a/docs/api/modules/config_cache_config.md b/docs/api/modules/config_cache_config.md new file mode 100644 index 00000000..f6299e50 --- /dev/null +++ b/docs/api/modules/config_cache_config.md @@ -0,0 +1,38 @@ +# Module: config/cache.config + +## Table of contents + +### Functions + +- [cacheConfigs](config_cache_config.md#cacheconfigs) +- [setCacheConfig](config_cache_config.md#setcacheconfig) + +## Functions + +### cacheConfigs + +▸ `Const` **cacheConfigs**(): `Object` + +#### Returns + +`Object` + +___ + +### setCacheConfig + +▸ `Const` **setCacheConfig**(`chainId`, `options`): `void` + +Used to override existing cache server configuration or add a missing one +Configuration must be set before constructing `IAM` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `chainId` | `number` | +| `options` | `Partial`<[`CacheServerClientOptions`](../interfaces/modules_cacheClient_cacheClient_types.CacheServerClientOptions.md)\> | + +#### Returns + +`void` diff --git a/docs/api/modules/config_chain_config.md b/docs/api/modules/config_chain_config.md new file mode 100644 index 00000000..69e87282 --- /dev/null +++ b/docs/api/modules/config_chain_config.md @@ -0,0 +1,52 @@ +# Module: config/chain.config + +## Table of contents + +### Interfaces + +- [ChainConfig](../interfaces/config_chain_config.ChainConfig.md) + +### Type aliases + +- [ChainId](config_chain_config.md#chainid) + +### Functions + +- [chainConfigs](config_chain_config.md#chainconfigs) +- [setChainConfig](config_chain_config.md#setchainconfig) + +## Type aliases + +### ChainId + +Ƭ **ChainId**: `number` + +## Functions + +### chainConfigs + +▸ `Const` **chainConfigs**(): `Object` + +#### Returns + +`Object` + +___ + +### setChainConfig + +▸ `Const` **setChainConfig**(`chainId`, `config`): `void` + +Used to override existing chain configuration or add a missing one +Configuration must be set before constructing `IAM` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `chainId` | `number` | +| `config` | `Partial`<[`ChainConfig`](../interfaces/config_chain_config.ChainConfig.md)\> | + +#### Returns + +`void` diff --git a/docs/api/modules/config_messaging_config.md b/docs/api/modules/config_messaging_config.md new file mode 100644 index 00000000..256d0538 --- /dev/null +++ b/docs/api/modules/config_messaging_config.md @@ -0,0 +1,42 @@ +# Module: config/messaging.config + +## Table of contents + +### Interfaces + +- [MessagingConfig](../interfaces/config_messaging_config.MessagingConfig.md) + +### Functions + +- [messagingConfigs](config_messaging_config.md#messagingconfigs) +- [setMessagingConfig](config_messaging_config.md#setmessagingconfig) + +## Functions + +### messagingConfigs + +▸ `Const` **messagingConfigs**(): `Object` + +#### Returns + +`Object` + +___ + +### setMessagingConfig + +▸ `Const` **setMessagingConfig**(`chainId`, `options`): `void` + +Used to override existing messaging configuration or add a missing one +Configuration must be set before constructing `IAM` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `chainId` | `number` | +| `options` | `Partial`<[`MessagingConfig`](../interfaces/config_messaging_config.MessagingConfig.md)\> | + +#### Returns + +`void` diff --git a/docs/api/modules/errors.md b/docs/api/modules/errors.md index acd5c8e9..65560c9a 100644 --- a/docs/api/modules/errors.md +++ b/docs/api/modules/errors.md @@ -4,24 +4,14 @@ ### References -- [CacheClientNotProvidedError](errors.md#cacheclientnotprovidederror) - [ChangeOwnershipNotPossibleError](errors.md#changeownershipnotpossibleerror) - [DeletingNamespaceNotPossibleError](errors.md#deletingnamespacenotpossibleerror) -- [ENSRegistryNotInitializedError](errors.md#ensregistrynotinitializederror) -- [ENSResolverNotInitializedError](errors.md#ensresolvernotinitializederror) - [ENSTypeNotSupportedError](errors.md#enstypenotsupportederror) - [ERROR\_MESSAGES](errors.md#error_messages) - [MethodNotAvailableInNodeEnvError](errors.md#methodnotavailableinnodeenverror) -- [NATSConnectionNotEstablishedError](errors.md#natsconnectionnotestablishederror) ## References -### CacheClientNotProvidedError - -Re-exports: [CacheClientNotProvidedError](../classes/errors_CacheClientNotProvided.CacheClientNotProvidedError.md) - -___ - ### ChangeOwnershipNotPossibleError Re-exports: [ChangeOwnershipNotPossibleError](../classes/errors_ChangeOwnershipNotPossibleError.ChangeOwnershipNotPossibleError.md) @@ -34,21 +24,9 @@ Re-exports: [DeletingNamespaceNotPossibleError](../classes/errors_DeletingNamesp ___ -### ENSRegistryNotInitializedError - -Re-exports: [ENSRegistryNotInitializedError](../classes/errors_ENSRegistryNotInitializedError.ENSRegistryNotInitializedError.md) - -___ - -### ENSResolverNotInitializedError - -Re-exports: [ENSResolverNotInitializedError](../classes/errors_ENSResolverNotInitializedError.ENSResolverNotInitializedError.md) - -___ - ### ENSTypeNotSupportedError -Re-exports: [ENSTypeNotSupportedError](../classes/errors_ENSTypeNOtSupportedError.ENSTypeNotSupportedError.md) +Re-exports: [ENSTypeNotSupportedError](../classes/errors_ENSTypeNotSupportedError.ENSTypeNotSupportedError.md) ___ @@ -61,9 +39,3 @@ ___ ### MethodNotAvailableInNodeEnvError Re-exports: [MethodNotAvailableInNodeEnvError](../classes/errors_MethodNotAvailableInNodeError.MethodNotAvailableInNodeEnvError.md) - -___ - -### NATSConnectionNotEstablishedError - -Re-exports: [NATSConnectionNotEstablishedError](../classes/errors_NatsConnectionNotEstablishedError.NATSConnectionNotEstablishedError.md) diff --git a/docs/api/modules/errors_CacheClientNotProvided.md b/docs/api/modules/errors_CacheClientNotProvided.md deleted file mode 100644 index 2bb7fb93..00000000 --- a/docs/api/modules/errors_CacheClientNotProvided.md +++ /dev/null @@ -1,7 +0,0 @@ -# Module: errors/CacheClientNotProvided - -## Table of contents - -### Classes - -- [CacheClientNotProvidedError](../classes/errors_CacheClientNotProvided.CacheClientNotProvidedError.md) diff --git a/docs/api/modules/errors_ENSRegistryNotInitializedError.md b/docs/api/modules/errors_ENSRegistryNotInitializedError.md deleted file mode 100644 index 8f2ef579..00000000 --- a/docs/api/modules/errors_ENSRegistryNotInitializedError.md +++ /dev/null @@ -1,7 +0,0 @@ -# Module: errors/ENSRegistryNotInitializedError - -## Table of contents - -### Classes - -- [ENSRegistryNotInitializedError](../classes/errors_ENSRegistryNotInitializedError.ENSRegistryNotInitializedError.md) diff --git a/docs/api/modules/errors_ENSResolverNotInitializedError.md b/docs/api/modules/errors_ENSResolverNotInitializedError.md deleted file mode 100644 index b203d222..00000000 --- a/docs/api/modules/errors_ENSResolverNotInitializedError.md +++ /dev/null @@ -1,7 +0,0 @@ -# Module: errors/ENSResolverNotInitializedError - -## Table of contents - -### Classes - -- [ENSResolverNotInitializedError](../classes/errors_ENSResolverNotInitializedError.ENSResolverNotInitializedError.md) diff --git a/docs/api/modules/errors_ENSTypeNOtSupportedError.md b/docs/api/modules/errors_ENSTypeNOtSupportedError.md deleted file mode 100644 index ba20107f..00000000 --- a/docs/api/modules/errors_ENSTypeNOtSupportedError.md +++ /dev/null @@ -1,7 +0,0 @@ -# Module: errors/ENSTypeNOtSupportedError - -## Table of contents - -### Classes - -- [ENSTypeNotSupportedError](../classes/errors_ENSTypeNOtSupportedError.ENSTypeNotSupportedError.md) diff --git a/docs/api/modules/errors_ENSTypeNotSupportedError.md b/docs/api/modules/errors_ENSTypeNotSupportedError.md new file mode 100644 index 00000000..ffc7d49d --- /dev/null +++ b/docs/api/modules/errors_ENSTypeNotSupportedError.md @@ -0,0 +1,7 @@ +# Module: errors/ENSTypeNotSupportedError + +## Table of contents + +### Classes + +- [ENSTypeNotSupportedError](../classes/errors_ENSTypeNotSupportedError.ENSTypeNotSupportedError.md) diff --git a/docs/api/modules/errors_NatsConnectionNotEstablishedError.md b/docs/api/modules/errors_NatsConnectionNotEstablishedError.md deleted file mode 100644 index 037b579a..00000000 --- a/docs/api/modules/errors_NatsConnectionNotEstablishedError.md +++ /dev/null @@ -1,7 +0,0 @@ -# Module: errors/NatsConnectionNotEstablishedError - -## Table of contents - -### Classes - -- [NATSConnectionNotEstablishedError](../classes/errors_NatsConnectionNotEstablishedError.NATSConnectionNotEstablishedError.md) diff --git a/docs/api/modules/iam.md b/docs/api/modules/iam.md deleted file mode 100644 index 81350e37..00000000 --- a/docs/api/modules/iam.md +++ /dev/null @@ -1,55 +0,0 @@ -# Module: iam - -## Table of contents - -### Enumerations - -- [ENSNamespaceTypes](../enums/iam.ENSNamespaceTypes.md) - -### Classes - -- [IAM](../classes/iam.IAM.md) - -### Interfaces - -- [IClaimIssuance](../interfaces/iam.IClaimIssuance.md) -- [IClaimRejection](../interfaces/iam.IClaimRejection.md) -- [IClaimRequest](../interfaces/iam.IClaimRequest.md) -- [IMessage](../interfaces/iam.IMessage.md) - -### Type aliases - -- [AccountInfo](iam.md#accountinfo) -- [InitializeData](iam.md#initializedata) - -## Type aliases - -### AccountInfo - -Ƭ **AccountInfo**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `account` | `string` | -| `chainId` | `number` | -| `chainName` | `string` | - -___ - -### InitializeData - -Ƭ **InitializeData**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `accountInfo` | [`AccountInfo`](iam.md#accountinfo) \| `undefined` | -| `connected` | `boolean` | -| `did` | `string` \| `undefined` | -| `didDocument` | `IDIDDocument` \| ``null`` | -| `identityToken?` | `string` | -| `realtimeExchangeConnected` | `boolean` | -| `userClosedModal` | `boolean` | diff --git a/docs/api/modules/iam_chainConfig.md b/docs/api/modules/iam_chainConfig.md deleted file mode 100644 index 09cdb267..00000000 --- a/docs/api/modules/iam_chainConfig.md +++ /dev/null @@ -1,101 +0,0 @@ -# Module: iam/chainConfig - -## Table of contents - -### Interfaces - -- [ChainConfig](../interfaces/iam_chainConfig.ChainConfig.md) -- [MessagingOptions](../interfaces/iam_chainConfig.MessagingOptions.md) - -### Variables - -- [cacheServerClientOptions](iam_chainConfig.md#cacheserverclientoptions) -- [chainConfigs](iam_chainConfig.md#chainconfigs) -- [messagingOptions](iam_chainConfig.md#messagingoptions) - -### Functions - -- [setCacheClientOptions](iam_chainConfig.md#setcacheclientoptions) -- [setChainConfig](iam_chainConfig.md#setchainconfig) -- [setMessagingOptions](iam_chainConfig.md#setmessagingoptions) - -## Variables - -### cacheServerClientOptions - -• `Const` **cacheServerClientOptions**: `Record`<`number`, [`CacheServerClientOptions`](../interfaces/cacheServerClient_cacheServerClient.CacheServerClientOptions.md)\> - -___ - -### chainConfigs - -• `Const` **chainConfigs**: `Record`<`number`, [`ChainConfig`](../interfaces/iam_chainConfig.ChainConfig.md)\> - -Set of parameters to configure connection to chain with id received from wallet. -If configuration for some chain is missing or should be reconfigured use `setChainConfig` before class instantiation - -___ - -### messagingOptions - -• `Const` **messagingOptions**: `Record`<`number`, [`MessagingOptions`](../interfaces/iam_chainConfig.MessagingOptions.md)\> - -## Functions - -### setCacheClientOptions - -▸ `Const` **setCacheClientOptions**(`chainId`, `options`): `void` - -Used to override existing cache server configuration or add a missing one -Configuration must be set before constructing `IAM` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `chainId` | `number` | -| `options` | `Partial`<[`CacheServerClientOptions`](../interfaces/cacheServerClient_cacheServerClient.CacheServerClientOptions.md)\> | - -#### Returns - -`void` - -___ - -### setChainConfig - -▸ `Const` **setChainConfig**(`chainId`, `config`): `void` - -Used to override existing chain configuration or add a missing one -Configuration must be set before constructing `IAM` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `chainId` | `number` | -| `config` | `Partial`<[`ChainConfig`](../interfaces/iam_chainConfig.ChainConfig.md)\> | - -#### Returns - -`void` - -___ - -### setMessagingOptions - -▸ `Const` **setMessagingOptions**(`chainId`, `options`): `void` - -Used to override existing messaging configuration or add a missing one -Configuration must be set before constructing `IAM` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `chainId` | `number` | -| `options` | `Partial`<[`MessagingOptions`](../interfaces/iam_chainConfig.MessagingOptions.md)\> | - -#### Returns - -`void` diff --git a/docs/api/modules/iam_client_lib.md b/docs/api/modules/iam_client_lib.md deleted file mode 100644 index dd8f2702..00000000 --- a/docs/api/modules/iam_client_lib.md +++ /dev/null @@ -1,244 +0,0 @@ -# Module: iam-client-lib - -## Table of contents - -### References - -- [Asset](iam_client_lib.md#asset) -- [AssetHistory](iam_client_lib.md#assethistory) -- [AssetHistoryEventType](iam_client_lib.md#assethistoryeventtype) -- [AssetProfile](iam_client_lib.md#assetprofile) -- [AssetProfiles](iam_client_lib.md#assetprofiles) -- [ClaimData](iam_client_lib.md#claimdata) -- [ENSNamespaceTypes](iam_client_lib.md#ensnamespacetypes) -- [ERROR\_MESSAGES](iam_client_lib.md#error_messages) -- [IAM](iam_client_lib.md#iam) -- [IApp](iam_client_lib.md#iapp) -- [ICacheServerClient](iam_client_lib.md#icacheserverclient) -- [IOrganization](iam_client_lib.md#iorganization) -- [IRole](iam_client_lib.md#irole) -- [MessagingMethod](iam_client_lib.md#messagingmethod) -- [NATS\_EXCHANGE\_TOPIC](iam_client_lib.md#nats_exchange_topic) -- [Order](iam_client_lib.md#order) -- [Profile](iam_client_lib.md#profile) -- [RegistrationTypes](iam_client_lib.md#registrationtypes) -- [SafeIam](iam_client_lib.md#safeiam) -- [Service](iam_client_lib.md#service) -- [Stake](iam_client_lib.md#stake) -- [StakeStatus](iam_client_lib.md#stakestatus) -- [StakingPool](iam_client_lib.md#stakingpool) -- [StakingPoolService](iam_client_lib.md#stakingpoolservice) -- [TransactionSpeed](iam_client_lib.md#transactionspeed) -- [VOLTA\_CHAIN\_ID](iam_client_lib.md#volta_chain_id) -- [WalletProvider](iam_client_lib.md#walletprovider) -- [addSupportedDID](iam_client_lib.md#addsupporteddid) -- [isValidDID](iam_client_lib.md#isvaliddid) -- [parseDID](iam_client_lib.md#parsedid) -- [setCacheClientOptions](iam_client_lib.md#setcacheclientoptions) -- [setChainConfig](iam_client_lib.md#setchainconfig) -- [setMessagingOptions](iam_client_lib.md#setmessagingoptions) -- [supportedDIDMethods](iam_client_lib.md#supporteddidmethods) - -## References - -### Asset - -Re-exports: [Asset](../interfaces/cacheServerClient_cacheServerClient_types.Asset.md) - -___ - -### AssetHistory - -Re-exports: [AssetHistory](../interfaces/cacheServerClient_cacheServerClient_types.AssetHistory.md) - -___ - -### AssetHistoryEventType - -Re-exports: [AssetHistoryEventType](../enums/cacheServerClient_cacheServerClient_types.AssetHistoryEventType.md) - -___ - -### AssetProfile - -Re-exports: [AssetProfile](../interfaces/cacheServerClient_cacheServerClient_types.AssetProfile.md) - -___ - -### AssetProfiles - -Re-exports: [AssetProfiles](../interfaces/cacheServerClient_cacheServerClient_types.AssetProfiles.md) - -___ - -### ClaimData - -Re-exports: [ClaimData](../interfaces/cacheServerClient_cacheServerClient_types.ClaimData.md) - -___ - -### ENSNamespaceTypes - -Re-exports: [ENSNamespaceTypes](../enums/iam.ENSNamespaceTypes.md) - -___ - -### ERROR\_MESSAGES - -Re-exports: [ERROR\_MESSAGES](../enums/errors_ErrorMessages.ERROR_MESSAGES.md) - -___ - -### IAM - -Re-exports: [IAM](../classes/iam.IAM.md) - -___ - -### IApp - -Re-exports: [IApp](../interfaces/cacheServerClient_cacheServerClient_types.IApp.md) - -___ - -### ICacheServerClient - -Re-exports: [ICacheServerClient](../interfaces/cacheServerClient_ICacheServerClient.ICacheServerClient.md) - -___ - -### IOrganization - -Re-exports: [IOrganization](../interfaces/cacheServerClient_cacheServerClient_types.IOrganization.md) - -___ - -### IRole - -Re-exports: [IRole](../interfaces/cacheServerClient_cacheServerClient_types.IRole.md) - -___ - -### MessagingMethod - -Re-exports: [MessagingMethod](../enums/utils_constants.MessagingMethod.md) - -___ - -### NATS\_EXCHANGE\_TOPIC - -Re-exports: [NATS\_EXCHANGE\_TOPIC](utils_constants.md#nats_exchange_topic) - -___ - -### Order - -Re-exports: [Order](../enums/cacheServerClient_cacheServerClient_types.Order.md) - -___ - -### Profile - -Re-exports: [Profile](../interfaces/cacheServerClient_cacheServerClient_types.Profile.md) - -___ - -### RegistrationTypes - -Re-exports: [RegistrationTypes](../enums/cacheServerClient_cacheServerClient_types.RegistrationTypes.md) - -___ - -### SafeIam - -Renames and exports: [GnosisIam](../classes/GnosisIam.GnosisIam-1.md) - -___ - -### Service - -Re-exports: [Service](staking.md#service) - -___ - -### Stake - -Re-exports: [Stake](staking.md#stake) - -___ - -### StakeStatus - -Re-exports: [StakeStatus](../enums/staking.StakeStatus.md) - -___ - -### StakingPool - -Re-exports: [StakingPool](../classes/staking.StakingPool.md) - -___ - -### StakingPoolService - -Re-exports: [StakingPoolService](../classes/staking.StakingPoolService.md) - -___ - -### TransactionSpeed - -Re-exports: [TransactionSpeed](../enums/staking.TransactionSpeed.md) - -___ - -### VOLTA\_CHAIN\_ID - -Re-exports: [VOLTA\_CHAIN\_ID](utils_constants.md#volta_chain_id) - -___ - -### WalletProvider - -Re-exports: [WalletProvider](../enums/types_WalletProvider.WalletProvider.md) - -___ - -### addSupportedDID - -Re-exports: [addSupportedDID](utils_did.md#addsupporteddid) - -___ - -### isValidDID - -Re-exports: [isValidDID](utils_did.md#isvaliddid) - -___ - -### parseDID - -Re-exports: [parseDID](utils_did.md#parsedid) - -___ - -### setCacheClientOptions - -Re-exports: [setCacheClientOptions](iam_chainConfig.md#setcacheclientoptions) - -___ - -### setChainConfig - -Re-exports: [setChainConfig](iam_chainConfig.md#setchainconfig) - -___ - -### setMessagingOptions - -Re-exports: [setMessagingOptions](iam_chainConfig.md#setmessagingoptions) - -___ - -### supportedDIDMethods - -Re-exports: [supportedDIDMethods](utils_did.md#supporteddidmethods) diff --git a/docs/api/modules/iam_iam_base.md b/docs/api/modules/iam_iam_base.md deleted file mode 100644 index 800ff672..00000000 --- a/docs/api/modules/iam_iam_base.md +++ /dev/null @@ -1,57 +0,0 @@ -# Module: iam/iam-base - -## Table of contents - -### Classes - -- [IAMBase](../classes/iam_iam_base.IAMBase.md) - -### Type aliases - -- [ConnectionOptions](iam_iam_base.md#connectionoptions) -- [EncodedCall](iam_iam_base.md#encodedcall) -- [Transaction](iam_iam_base.md#transaction) - -## Type aliases - -### ConnectionOptions - -Ƭ **ConnectionOptions**: `Object` - -#### Type declaration - -| Name | Type | Description | -| :------ | :------ | :------ | -| `bridgeUrl?` | `string` | - | -| `ewKeyManagerUrl?` | `string` | - | -| `infuraId?` | `string` | - | -| `ipfsUrl?` | `string` | - | -| `privateKey?` | `string` | - | -| `rpcUrl?` | `string` | only required in node env | - -___ - -### EncodedCall - -Ƭ **EncodedCall**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `data` | `string` | -| `to` | `string` | -| `value?` | `string` | - -___ - -### Transaction - -Ƭ **Transaction**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `calls` | [`EncodedCall`](iam_iam_base.md#encodedcall)[] | -| `from` | `string` | diff --git a/docs/api/modules/index.md b/docs/api/modules/index.md new file mode 100644 index 00000000..bd7f7b80 --- /dev/null +++ b/docs/api/modules/index.md @@ -0,0 +1,468 @@ +# Module: index + +## Table of contents + +### References + +- [AccountInfo](index.md#accountinfo) +- [Asset](index.md#asset) +- [AssetHistory](index.md#assethistory) +- [AssetHistoryEventType](index.md#assethistoryeventtype) +- [AssetProfile](index.md#assetprofile) +- [AssetProfiles](index.md#assetprofiles) +- [AssetsService](index.md#assetsservice) +- [CacheClient](index.md#cacheclient) +- [CacheServerClientOptions](index.md#cacheserverclientoptions) +- [ChainConfig](index.md#chainconfig) +- [ChainId](index.md#chainid) +- [ChangeOwnershipNotPossibleError](index.md#changeownershipnotpossibleerror) +- [Claim](index.md#claim) +- [ClaimData](index.md#claimdata) +- [ClaimsService](index.md#claimsservice) +- [DeletingNamespaceNotPossibleError](index.md#deletingnamespacenotpossibleerror) +- [DidRegistry](index.md#didregistry) +- [DomainsService](index.md#domainsservice) +- [ENSNamespaceTypes](index.md#ensnamespacetypes) +- [ENSTypeNotSupportedError](index.md#enstypenotsupportederror) +- [ERROR\_MESSAGES](index.md#error_messages) +- [IApp](index.md#iapp) +- [ICacheClient](index.md#icacheclient) +- [IClaimIssuance](index.md#iclaimissuance) +- [IClaimRejection](index.md#iclaimrejection) +- [IClaimRequest](index.md#iclaimrequest) +- [IMessage](index.md#imessage) +- [IOrganization](index.md#iorganization) +- [IPubKeyAndIdentityToken](index.md#ipubkeyandidentitytoken) +- [IRole](index.md#irole) +- [MessagingConfig](index.md#messagingconfig) +- [MessagingMethod](index.md#messagingmethod) +- [MessagingService](index.md#messagingservice) +- [MethodNotAvailableInNodeEnvError](index.md#methodnotavailableinnodeenverror) +- [NATS\_EXCHANGE\_TOPIC](index.md#nats_exchange_topic) +- [NODE\_FIELDS\_KEY](index.md#node_fields_key) +- [Order](index.md#order) +- [PUBLIC\_KEY](index.md#public_key) +- [Profile](index.md#profile) +- [ProviderType](index.md#providertype) +- [RegistrationTypes](index.md#registrationtypes) +- [Service](index.md#service) +- [ServiceInitializer](index.md#serviceinitializer) +- [SignerService](index.md#signerservice) +- [Stake](index.md#stake) +- [StakeStatus](index.md#stakestatus) +- [StakingPool](index.md#stakingpool) +- [StakingService](index.md#stakingservice) +- [WALLET\_PROVIDER](index.md#wallet_provider) +- [agreement\_type\_hash](index.md#agreement_type_hash) +- [cacheConfigs](index.md#cacheconfigs) +- [chainConfigs](index.md#chainconfigs) +- [connectWithKmsClient](index.md#connectwithkmsclient) +- [defaultClaimExpiry](index.md#defaultclaimexpiry) +- [erc712\_type\_hash](index.md#erc712_type_hash) +- [fromMetaMask](index.md#frommetamask) +- [fromPrivateKey](index.md#fromprivatekey) +- [fromWalletConnectMetamask](index.md#fromwalletconnectmetamask) +- [init](index.md#init) +- [initWithPrivateKeySigner](index.md#initwithprivatekeysigner) +- [messagingConfigs](index.md#messagingconfigs) +- [proof\_type\_hash](index.md#proof_type_hash) +- [setCacheConfig](index.md#setcacheconfig) +- [setChainConfig](index.md#setchainconfig) +- [setMessagingConfig](index.md#setmessagingconfig) +- [typedMsgPrefix](index.md#typedmsgprefix) + +## References + +### AccountInfo + +Re-exports: [AccountInfo](modules_signer_signer_types.md#accountinfo) + +___ + +### Asset + +Re-exports: [Asset](../interfaces/modules_assets_assets_types.Asset.md) + +___ + +### AssetHistory + +Re-exports: [AssetHistory](../interfaces/modules_assets_assets_types.AssetHistory.md) + +___ + +### AssetHistoryEventType + +Re-exports: [AssetHistoryEventType](../enums/modules_assets_assets_types.AssetHistoryEventType.md) + +___ + +### AssetProfile + +Re-exports: [AssetProfile](../interfaces/modules_didRegistry_did_types.AssetProfile.md) + +___ + +### AssetProfiles + +Re-exports: [AssetProfiles](../interfaces/modules_didRegistry_did_types.AssetProfiles.md) + +___ + +### AssetsService + +Re-exports: [AssetsService](../classes/modules_assets_assets_service.AssetsService.md) + +___ + +### CacheClient + +Re-exports: [CacheClient](../classes/modules_cacheClient_cacheClient_service.CacheClient.md) + +___ + +### CacheServerClientOptions + +Re-exports: [CacheServerClientOptions](../interfaces/modules_cacheClient_cacheClient_types.CacheServerClientOptions.md) + +___ + +### ChainConfig + +Re-exports: [ChainConfig](../interfaces/config_chain_config.ChainConfig.md) + +___ + +### ChainId + +Re-exports: [ChainId](config_chain_config.md#chainid) + +___ + +### ChangeOwnershipNotPossibleError + +Re-exports: [ChangeOwnershipNotPossibleError](../classes/errors_ChangeOwnershipNotPossibleError.ChangeOwnershipNotPossibleError.md) + +___ + +### Claim + +Re-exports: [Claim](../interfaces/modules_claims_claims_types.Claim.md) + +___ + +### ClaimData + +Re-exports: [ClaimData](../interfaces/modules_didRegistry_did_types.ClaimData.md) + +___ + +### ClaimsService + +Re-exports: [ClaimsService](../classes/modules_claims_claims_service.ClaimsService.md) + +___ + +### DeletingNamespaceNotPossibleError + +Re-exports: [DeletingNamespaceNotPossibleError](../classes/errors_DeletingNamespaceNotPossibleError.DeletingNamespaceNotPossibleError.md) + +___ + +### DidRegistry + +Re-exports: [DidRegistry](../classes/modules_didRegistry_didRegistry_service.DidRegistry.md) + +___ + +### DomainsService + +Re-exports: [DomainsService](../classes/modules_domains_domains_service.DomainsService.md) + +___ + +### ENSNamespaceTypes + +Re-exports: [ENSNamespaceTypes](../enums/modules_domains_domains_types.ENSNamespaceTypes.md) + +___ + +### ENSTypeNotSupportedError + +Re-exports: [ENSTypeNotSupportedError](../classes/errors_ENSTypeNotSupportedError.ENSTypeNotSupportedError.md) + +___ + +### ERROR\_MESSAGES + +Re-exports: [ERROR\_MESSAGES](../enums/errors_ErrorMessages.ERROR_MESSAGES.md) + +___ + +### IApp + +Re-exports: [IApp](../interfaces/modules_domains_domains_types.IApp.md) + +___ + +### ICacheClient + +Re-exports: [ICacheClient](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md) + +___ + +### IClaimIssuance + +Re-exports: [IClaimIssuance](../interfaces/modules_claims_claims_types.IClaimIssuance.md) + +___ + +### IClaimRejection + +Re-exports: [IClaimRejection](../interfaces/modules_claims_claims_types.IClaimRejection.md) + +___ + +### IClaimRequest + +Re-exports: [IClaimRequest](../interfaces/modules_claims_claims_types.IClaimRequest.md) + +___ + +### IMessage + +Re-exports: [IMessage](../interfaces/modules_messaging_messaging_types.IMessage.md) + +___ + +### IOrganization + +Re-exports: [IOrganization](../interfaces/modules_domains_domains_types.IOrganization.md) + +___ + +### IPubKeyAndIdentityToken + +Re-exports: [IPubKeyAndIdentityToken](../interfaces/modules_signer_signer_types.IPubKeyAndIdentityToken.md) + +___ + +### IRole + +Re-exports: [IRole](../interfaces/modules_domains_domains_types.IRole.md) + +___ + +### MessagingConfig + +Re-exports: [MessagingConfig](../interfaces/config_messaging_config.MessagingConfig.md) + +___ + +### MessagingMethod + +Re-exports: [MessagingMethod](../enums/modules_messaging_messaging_types.MessagingMethod.md) + +___ + +### MessagingService + +Re-exports: [MessagingService](../classes/modules_messaging_messaging_service.MessagingService.md) + +___ + +### MethodNotAvailableInNodeEnvError + +Re-exports: [MethodNotAvailableInNodeEnvError](../classes/errors_MethodNotAvailableInNodeError.MethodNotAvailableInNodeEnvError.md) + +___ + +### NATS\_EXCHANGE\_TOPIC + +Re-exports: [NATS\_EXCHANGE\_TOPIC](modules_messaging_messaging_types.md#nats_exchange_topic) + +___ + +### NODE\_FIELDS\_KEY + +Re-exports: [NODE\_FIELDS\_KEY](modules_domains_domains_types.md#node_fields_key) + +___ + +### Order + +Re-exports: [Order](../enums/modules_cacheClient_cacheClient_types.Order.md) + +___ + +### PUBLIC\_KEY + +Re-exports: [PUBLIC\_KEY](modules_signer_signer_types.md#public_key) + +___ + +### Profile + +Re-exports: [Profile](../interfaces/modules_didRegistry_did_types.Profile.md) + +___ + +### ProviderType + +Re-exports: [ProviderType](../enums/modules_signer_signer_types.ProviderType.md) + +___ + +### RegistrationTypes + +Re-exports: [RegistrationTypes](../enums/modules_claims_claims_types.RegistrationTypes.md) + +___ + +### Service + +Re-exports: [Service](modules_staking_staking_service.md#service) + +___ + +### ServiceInitializer + +Re-exports: [ServiceInitializer](modules_signer_signer_service.md#serviceinitializer) + +___ + +### SignerService + +Re-exports: [SignerService](../classes/modules_signer_signer_service.SignerService.md) + +___ + +### Stake + +Re-exports: [Stake](modules_staking_staking_service.md#stake) + +___ + +### StakeStatus + +Re-exports: [StakeStatus](../enums/modules_staking_staking_service.StakeStatus.md) + +___ + +### StakingPool + +Re-exports: [StakingPool](../classes/modules_staking_staking_service.StakingPool.md) + +___ + +### StakingService + +Re-exports: [StakingService](../classes/modules_staking_staking_service.StakingService.md) + +___ + +### WALLET\_PROVIDER + +Re-exports: [WALLET\_PROVIDER](modules_signer_signer_types.md#wallet_provider) + +___ + +### agreement\_type\_hash + +Re-exports: [agreement\_type\_hash](modules_claims_claims_types.md#agreement_type_hash) + +___ + +### cacheConfigs + +Re-exports: [cacheConfigs](config_cache_config.md#cacheconfigs) + +___ + +### chainConfigs + +Re-exports: [chainConfigs](config_chain_config.md#chainconfigs) + +___ + +### connectWithKmsClient + +Re-exports: [connectWithKmsClient](modules_signer_walletConnectKms.md#connectwithkmsclient) + +___ + +### defaultClaimExpiry + +Re-exports: [defaultClaimExpiry](modules_claims_claims_types.md#defaultclaimexpiry) + +___ + +### erc712\_type\_hash + +Re-exports: [erc712\_type\_hash](modules_claims_claims_types.md#erc712_type_hash) + +___ + +### fromMetaMask + +Re-exports: [fromMetaMask](modules_signer_metamaskSigner.md#frommetamask) + +___ + +### fromPrivateKey + +Re-exports: [fromPrivateKey](modules_signer_privateKeySigner.md#fromprivatekey) + +___ + +### fromWalletConnectMetamask + +Re-exports: [fromWalletConnectMetamask](modules_signer_walletConnectMetamask.md#fromwalletconnectmetamask) + +___ + +### init + +Re-exports: [init](init.md#init) + +___ + +### initWithPrivateKeySigner + +Re-exports: [initWithPrivateKeySigner](init.md#initwithprivatekeysigner) + +___ + +### messagingConfigs + +Re-exports: [messagingConfigs](config_messaging_config.md#messagingconfigs) + +___ + +### proof\_type\_hash + +Re-exports: [proof\_type\_hash](modules_claims_claims_types.md#proof_type_hash) + +___ + +### setCacheConfig + +Re-exports: [setCacheConfig](config_cache_config.md#setcacheconfig) + +___ + +### setChainConfig + +Re-exports: [setChainConfig](config_chain_config.md#setchainconfig) + +___ + +### setMessagingConfig + +Re-exports: [setMessagingConfig](config_messaging_config.md#setmessagingconfig) + +___ + +### typedMsgPrefix + +Re-exports: [typedMsgPrefix](modules_claims_claims_types.md#typedmsgprefix) diff --git a/docs/api/modules/init.md b/docs/api/modules/init.md new file mode 100644 index 00000000..5dc0e7da --- /dev/null +++ b/docs/api/modules/init.md @@ -0,0 +1,41 @@ +# Module: init + +## Table of contents + +### Functions + +- [init](init.md#init) +- [initWithPrivateKeySigner](init.md#initwithprivatekeysigner) + +## Functions + +### init + +▸ **init**(`signerService`): `Promise`<`Object`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `signerService` | [`SignerService`](../classes/modules_signer_signer_service.SignerService.md) | + +#### Returns + +`Promise`<`Object`\> + +___ + +### initWithPrivateKeySigner + +▸ **initWithPrivateKeySigner**(`privateKey`, `rpcUrl`): `Promise`<`Object`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `privateKey` | `string` | +| `rpcUrl` | `string` | + +#### Returns + +`Promise`<`Object`\> diff --git a/docs/api/modules/modules_assets.md b/docs/api/modules/modules_assets.md new file mode 100644 index 00000000..86fc9cdb --- /dev/null +++ b/docs/api/modules/modules_assets.md @@ -0,0 +1,34 @@ +# Module: modules/assets + +## Table of contents + +### References + +- [Asset](modules_assets.md#asset) +- [AssetHistory](modules_assets.md#assethistory) +- [AssetHistoryEventType](modules_assets.md#assethistoryeventtype) +- [AssetsService](modules_assets.md#assetsservice) + +## References + +### Asset + +Re-exports: [Asset](../interfaces/modules_assets_assets_types.Asset.md) + +___ + +### AssetHistory + +Re-exports: [AssetHistory](../interfaces/modules_assets_assets_types.AssetHistory.md) + +___ + +### AssetHistoryEventType + +Re-exports: [AssetHistoryEventType](../enums/modules_assets_assets_types.AssetHistoryEventType.md) + +___ + +### AssetsService + +Re-exports: [AssetsService](../classes/modules_assets_assets_service.AssetsService.md) diff --git a/docs/api/modules/modules_assets_assets_service.md b/docs/api/modules/modules_assets_assets_service.md new file mode 100644 index 00000000..fdfad99c --- /dev/null +++ b/docs/api/modules/modules_assets_assets_service.md @@ -0,0 +1,7 @@ +# Module: modules/assets/assets.service + +## Table of contents + +### Classes + +- [AssetsService](../classes/modules_assets_assets_service.AssetsService.md) diff --git a/docs/api/modules/modules_assets_assets_types.md b/docs/api/modules/modules_assets_assets_types.md new file mode 100644 index 00000000..8fb7e893 --- /dev/null +++ b/docs/api/modules/modules_assets_assets_types.md @@ -0,0 +1,12 @@ +# Module: modules/assets/assets.types + +## Table of contents + +### Enumerations + +- [AssetHistoryEventType](../enums/modules_assets_assets_types.AssetHistoryEventType.md) + +### Interfaces + +- [Asset](../interfaces/modules_assets_assets_types.Asset.md) +- [AssetHistory](../interfaces/modules_assets_assets_types.AssetHistory.md) diff --git a/docs/api/modules/modules_cacheClient.md b/docs/api/modules/modules_cacheClient.md new file mode 100644 index 00000000..d0b34b8d --- /dev/null +++ b/docs/api/modules/modules_cacheClient.md @@ -0,0 +1,34 @@ +# Module: modules/cacheClient + +## Table of contents + +### References + +- [CacheClient](modules_cacheClient.md#cacheclient) +- [CacheServerClientOptions](modules_cacheClient.md#cacheserverclientoptions) +- [ICacheClient](modules_cacheClient.md#icacheclient) +- [Order](modules_cacheClient.md#order) + +## References + +### CacheClient + +Re-exports: [CacheClient](../classes/modules_cacheClient_cacheClient_service.CacheClient.md) + +___ + +### CacheServerClientOptions + +Re-exports: [CacheServerClientOptions](../interfaces/modules_cacheClient_cacheClient_types.CacheServerClientOptions.md) + +___ + +### ICacheClient + +Re-exports: [ICacheClient](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md) + +___ + +### Order + +Re-exports: [Order](../enums/modules_cacheClient_cacheClient_types.Order.md) diff --git a/docs/api/modules/modules_cacheClient_ICacheClient.md b/docs/api/modules/modules_cacheClient_ICacheClient.md new file mode 100644 index 00000000..f47a413c --- /dev/null +++ b/docs/api/modules/modules_cacheClient_ICacheClient.md @@ -0,0 +1,7 @@ +# Module: modules/cacheClient/ICacheClient + +## Table of contents + +### Interfaces + +- [ICacheClient](../interfaces/modules_cacheClient_ICacheClient.ICacheClient.md) diff --git a/docs/api/modules/modules_cacheClient_cacheClient_service.md b/docs/api/modules/modules_cacheClient_cacheClient_service.md new file mode 100644 index 00000000..edc6cbee --- /dev/null +++ b/docs/api/modules/modules_cacheClient_cacheClient_service.md @@ -0,0 +1,7 @@ +# Module: modules/cacheClient/cacheClient.service + +## Table of contents + +### Classes + +- [CacheClient](../classes/modules_cacheClient_cacheClient_service.CacheClient.md) diff --git a/docs/api/modules/modules_cacheClient_cacheClient_types.md b/docs/api/modules/modules_cacheClient_cacheClient_types.md new file mode 100644 index 00000000..ec9eff1e --- /dev/null +++ b/docs/api/modules/modules_cacheClient_cacheClient_types.md @@ -0,0 +1,11 @@ +# Module: modules/cacheClient/cacheClient.types + +## Table of contents + +### Enumerations + +- [Order](../enums/modules_cacheClient_cacheClient_types.Order.md) + +### Interfaces + +- [CacheServerClientOptions](../interfaces/modules_cacheClient_cacheClient_types.CacheServerClientOptions.md) diff --git a/docs/api/modules/modules_claims.md b/docs/api/modules/modules_claims.md new file mode 100644 index 00000000..190baf57 --- /dev/null +++ b/docs/api/modules/modules_claims.md @@ -0,0 +1,83 @@ +# Module: modules/claims + +## Table of contents + +### References + +- [Claim](modules_claims.md#claim) +- [ClaimsService](modules_claims.md#claimsservice) +- [IClaimIssuance](modules_claims.md#iclaimissuance) +- [IClaimRejection](modules_claims.md#iclaimrejection) +- [IClaimRequest](modules_claims.md#iclaimrequest) +- [RegistrationTypes](modules_claims.md#registrationtypes) +- [agreement\_type\_hash](modules_claims.md#agreement_type_hash) +- [defaultClaimExpiry](modules_claims.md#defaultclaimexpiry) +- [erc712\_type\_hash](modules_claims.md#erc712_type_hash) +- [proof\_type\_hash](modules_claims.md#proof_type_hash) +- [typedMsgPrefix](modules_claims.md#typedmsgprefix) + +## References + +### Claim + +Re-exports: [Claim](../interfaces/modules_claims_claims_types.Claim.md) + +___ + +### ClaimsService + +Re-exports: [ClaimsService](../classes/modules_claims_claims_service.ClaimsService.md) + +___ + +### IClaimIssuance + +Re-exports: [IClaimIssuance](../interfaces/modules_claims_claims_types.IClaimIssuance.md) + +___ + +### IClaimRejection + +Re-exports: [IClaimRejection](../interfaces/modules_claims_claims_types.IClaimRejection.md) + +___ + +### IClaimRequest + +Re-exports: [IClaimRequest](../interfaces/modules_claims_claims_types.IClaimRequest.md) + +___ + +### RegistrationTypes + +Re-exports: [RegistrationTypes](../enums/modules_claims_claims_types.RegistrationTypes.md) + +___ + +### agreement\_type\_hash + +Re-exports: [agreement\_type\_hash](modules_claims_claims_types.md#agreement_type_hash) + +___ + +### defaultClaimExpiry + +Re-exports: [defaultClaimExpiry](modules_claims_claims_types.md#defaultclaimexpiry) + +___ + +### erc712\_type\_hash + +Re-exports: [erc712\_type\_hash](modules_claims_claims_types.md#erc712_type_hash) + +___ + +### proof\_type\_hash + +Re-exports: [proof\_type\_hash](modules_claims_claims_types.md#proof_type_hash) + +___ + +### typedMsgPrefix + +Re-exports: [typedMsgPrefix](modules_claims_claims_types.md#typedmsgprefix) diff --git a/docs/api/modules/modules_claims_claims_service.md b/docs/api/modules/modules_claims_claims_service.md new file mode 100644 index 00000000..3d2d8630 --- /dev/null +++ b/docs/api/modules/modules_claims_claims_service.md @@ -0,0 +1,7 @@ +# Module: modules/claims/claims.service + +## Table of contents + +### Classes + +- [ClaimsService](../classes/modules_claims_claims_service.ClaimsService.md) diff --git a/docs/api/modules/modules_claims_claims_types.md b/docs/api/modules/modules_claims_claims_types.md new file mode 100644 index 00000000..74277fd8 --- /dev/null +++ b/docs/api/modules/modules_claims_claims_types.md @@ -0,0 +1,52 @@ +# Module: modules/claims/claims.types + +## Table of contents + +### Enumerations + +- [RegistrationTypes](../enums/modules_claims_claims_types.RegistrationTypes.md) + +### Interfaces + +- [Claim](../interfaces/modules_claims_claims_types.Claim.md) +- [IClaimIssuance](../interfaces/modules_claims_claims_types.IClaimIssuance.md) +- [IClaimRejection](../interfaces/modules_claims_claims_types.IClaimRejection.md) +- [IClaimRequest](../interfaces/modules_claims_claims_types.IClaimRequest.md) + +### Variables + +- [agreement\_type\_hash](modules_claims_claims_types.md#agreement_type_hash) +- [defaultClaimExpiry](modules_claims_claims_types.md#defaultclaimexpiry) +- [erc712\_type\_hash](modules_claims_claims_types.md#erc712_type_hash) +- [proof\_type\_hash](modules_claims_claims_types.md#proof_type_hash) +- [typedMsgPrefix](modules_claims_claims_types.md#typedmsgprefix) + +## Variables + +### agreement\_type\_hash + +• `Const` **agreement\_type\_hash**: `string` + +___ + +### defaultClaimExpiry + +• `Const` **defaultClaimExpiry**: `number` + +___ + +### erc712\_type\_hash + +• `Const` **erc712\_type\_hash**: `string` + +___ + +### proof\_type\_hash + +• `Const` **proof\_type\_hash**: `string` + +___ + +### typedMsgPrefix + +• `Const` **typedMsgPrefix**: ``"1901"`` diff --git a/docs/api/modules/modules_didRegistry.md b/docs/api/modules/modules_didRegistry.md new file mode 100644 index 00000000..b42b31e9 --- /dev/null +++ b/docs/api/modules/modules_didRegistry.md @@ -0,0 +1,41 @@ +# Module: modules/didRegistry + +## Table of contents + +### References + +- [AssetProfile](modules_didRegistry.md#assetprofile) +- [AssetProfiles](modules_didRegistry.md#assetprofiles) +- [ClaimData](modules_didRegistry.md#claimdata) +- [DidRegistry](modules_didRegistry.md#didregistry) +- [Profile](modules_didRegistry.md#profile) + +## References + +### AssetProfile + +Re-exports: [AssetProfile](../interfaces/modules_didRegistry_did_types.AssetProfile.md) + +___ + +### AssetProfiles + +Re-exports: [AssetProfiles](../interfaces/modules_didRegistry_did_types.AssetProfiles.md) + +___ + +### ClaimData + +Re-exports: [ClaimData](../interfaces/modules_didRegistry_did_types.ClaimData.md) + +___ + +### DidRegistry + +Re-exports: [DidRegistry](../classes/modules_didRegistry_didRegistry_service.DidRegistry.md) + +___ + +### Profile + +Re-exports: [Profile](../interfaces/modules_didRegistry_did_types.Profile.md) diff --git a/docs/api/modules/modules_didRegistry_didRegistry_service.md b/docs/api/modules/modules_didRegistry_didRegistry_service.md new file mode 100644 index 00000000..7d1105be --- /dev/null +++ b/docs/api/modules/modules_didRegistry_didRegistry_service.md @@ -0,0 +1,7 @@ +# Module: modules/didRegistry/didRegistry.service + +## Table of contents + +### Classes + +- [DidRegistry](../classes/modules_didRegistry_didRegistry_service.DidRegistry.md) diff --git a/docs/api/modules/modules_didRegistry_did_types.md b/docs/api/modules/modules_didRegistry_did_types.md new file mode 100644 index 00000000..d49eda7a --- /dev/null +++ b/docs/api/modules/modules_didRegistry_did_types.md @@ -0,0 +1,10 @@ +# Module: modules/didRegistry/did.types + +## Table of contents + +### Interfaces + +- [AssetProfile](../interfaces/modules_didRegistry_did_types.AssetProfile.md) +- [AssetProfiles](../interfaces/modules_didRegistry_did_types.AssetProfiles.md) +- [ClaimData](../interfaces/modules_didRegistry_did_types.ClaimData.md) +- [Profile](../interfaces/modules_didRegistry_did_types.Profile.md) diff --git a/docs/api/modules/modules_domains.md b/docs/api/modules/modules_domains.md new file mode 100644 index 00000000..413f5109 --- /dev/null +++ b/docs/api/modules/modules_domains.md @@ -0,0 +1,48 @@ +# Module: modules/domains + +## Table of contents + +### References + +- [DomainsService](modules_domains.md#domainsservice) +- [ENSNamespaceTypes](modules_domains.md#ensnamespacetypes) +- [IApp](modules_domains.md#iapp) +- [IOrganization](modules_domains.md#iorganization) +- [IRole](modules_domains.md#irole) +- [NODE\_FIELDS\_KEY](modules_domains.md#node_fields_key) + +## References + +### DomainsService + +Re-exports: [DomainsService](../classes/modules_domains_domains_service.DomainsService.md) + +___ + +### ENSNamespaceTypes + +Re-exports: [ENSNamespaceTypes](../enums/modules_domains_domains_types.ENSNamespaceTypes.md) + +___ + +### IApp + +Re-exports: [IApp](../interfaces/modules_domains_domains_types.IApp.md) + +___ + +### IOrganization + +Re-exports: [IOrganization](../interfaces/modules_domains_domains_types.IOrganization.md) + +___ + +### IRole + +Re-exports: [IRole](../interfaces/modules_domains_domains_types.IRole.md) + +___ + +### NODE\_FIELDS\_KEY + +Re-exports: [NODE\_FIELDS\_KEY](modules_domains_domains_types.md#node_fields_key) diff --git a/docs/api/modules/modules_domains_domains_service.md b/docs/api/modules/modules_domains_domains_service.md new file mode 100644 index 00000000..9bf9ccae --- /dev/null +++ b/docs/api/modules/modules_domains_domains_service.md @@ -0,0 +1,7 @@ +# Module: modules/domains/domains.service + +## Table of contents + +### Classes + +- [DomainsService](../classes/modules_domains_domains_service.DomainsService.md) diff --git a/docs/api/modules/modules_domains_domains_types.md b/docs/api/modules/modules_domains_domains_types.md new file mode 100644 index 00000000..ea9bcbc5 --- /dev/null +++ b/docs/api/modules/modules_domains_domains_types.md @@ -0,0 +1,23 @@ +# Module: modules/domains/domains.types + +## Table of contents + +### Enumerations + +- [ENSNamespaceTypes](../enums/modules_domains_domains_types.ENSNamespaceTypes.md) + +### Interfaces + +- [IApp](../interfaces/modules_domains_domains_types.IApp.md) +- [IOrganization](../interfaces/modules_domains_domains_types.IOrganization.md) +- [IRole](../interfaces/modules_domains_domains_types.IRole.md) + +### Variables + +- [NODE\_FIELDS\_KEY](modules_domains_domains_types.md#node_fields_key) + +## Variables + +### NODE\_FIELDS\_KEY + +• `Const` **NODE\_FIELDS\_KEY**: ``"metadata"`` diff --git a/docs/api/modules/modules_messaging.md b/docs/api/modules/modules_messaging.md new file mode 100644 index 00000000..bcbb0816 --- /dev/null +++ b/docs/api/modules/modules_messaging.md @@ -0,0 +1,34 @@ +# Module: modules/messaging + +## Table of contents + +### References + +- [IMessage](modules_messaging.md#imessage) +- [MessagingMethod](modules_messaging.md#messagingmethod) +- [MessagingService](modules_messaging.md#messagingservice) +- [NATS\_EXCHANGE\_TOPIC](modules_messaging.md#nats_exchange_topic) + +## References + +### IMessage + +Re-exports: [IMessage](../interfaces/modules_messaging_messaging_types.IMessage.md) + +___ + +### MessagingMethod + +Re-exports: [MessagingMethod](../enums/modules_messaging_messaging_types.MessagingMethod.md) + +___ + +### MessagingService + +Re-exports: [MessagingService](../classes/modules_messaging_messaging_service.MessagingService.md) + +___ + +### NATS\_EXCHANGE\_TOPIC + +Re-exports: [NATS\_EXCHANGE\_TOPIC](modules_messaging_messaging_types.md#nats_exchange_topic) diff --git a/docs/api/modules/modules_messaging_messaging_service.md b/docs/api/modules/modules_messaging_messaging_service.md new file mode 100644 index 00000000..2ef4a830 --- /dev/null +++ b/docs/api/modules/modules_messaging_messaging_service.md @@ -0,0 +1,7 @@ +# Module: modules/messaging/messaging.service + +## Table of contents + +### Classes + +- [MessagingService](../classes/modules_messaging_messaging_service.MessagingService.md) diff --git a/docs/api/modules/modules_messaging_messaging_types.md b/docs/api/modules/modules_messaging_messaging_types.md new file mode 100644 index 00000000..e307510a --- /dev/null +++ b/docs/api/modules/modules_messaging_messaging_types.md @@ -0,0 +1,21 @@ +# Module: modules/messaging/messaging.types + +## Table of contents + +### Enumerations + +- [MessagingMethod](../enums/modules_messaging_messaging_types.MessagingMethod.md) + +### Interfaces + +- [IMessage](../interfaces/modules_messaging_messaging_types.IMessage.md) + +### Variables + +- [NATS\_EXCHANGE\_TOPIC](modules_messaging_messaging_types.md#nats_exchange_topic) + +## Variables + +### NATS\_EXCHANGE\_TOPIC + +• `Const` **NATS\_EXCHANGE\_TOPIC**: ``"claim.exchange"`` diff --git a/docs/api/modules/modules_signer.md b/docs/api/modules/modules_signer.md new file mode 100644 index 00000000..6decbcae --- /dev/null +++ b/docs/api/modules/modules_signer.md @@ -0,0 +1,83 @@ +# Module: modules/signer + +## Table of contents + +### References + +- [AccountInfo](modules_signer.md#accountinfo) +- [IPubKeyAndIdentityToken](modules_signer.md#ipubkeyandidentitytoken) +- [PUBLIC\_KEY](modules_signer.md#public_key) +- [ProviderType](modules_signer.md#providertype) +- [ServiceInitializer](modules_signer.md#serviceinitializer) +- [SignerService](modules_signer.md#signerservice) +- [WALLET\_PROVIDER](modules_signer.md#wallet_provider) +- [connectWithKmsClient](modules_signer.md#connectwithkmsclient) +- [fromMetaMask](modules_signer.md#frommetamask) +- [fromPrivateKey](modules_signer.md#fromprivatekey) +- [fromWalletConnectMetamask](modules_signer.md#fromwalletconnectmetamask) + +## References + +### AccountInfo + +Re-exports: [AccountInfo](modules_signer_signer_types.md#accountinfo) + +___ + +### IPubKeyAndIdentityToken + +Re-exports: [IPubKeyAndIdentityToken](../interfaces/modules_signer_signer_types.IPubKeyAndIdentityToken.md) + +___ + +### PUBLIC\_KEY + +Re-exports: [PUBLIC\_KEY](modules_signer_signer_types.md#public_key) + +___ + +### ProviderType + +Re-exports: [ProviderType](../enums/modules_signer_signer_types.ProviderType.md) + +___ + +### ServiceInitializer + +Re-exports: [ServiceInitializer](modules_signer_signer_service.md#serviceinitializer) + +___ + +### SignerService + +Re-exports: [SignerService](../classes/modules_signer_signer_service.SignerService.md) + +___ + +### WALLET\_PROVIDER + +Re-exports: [WALLET\_PROVIDER](modules_signer_signer_types.md#wallet_provider) + +___ + +### connectWithKmsClient + +Re-exports: [connectWithKmsClient](modules_signer_walletConnectKms.md#connectwithkmsclient) + +___ + +### fromMetaMask + +Re-exports: [fromMetaMask](modules_signer_metamaskSigner.md#frommetamask) + +___ + +### fromPrivateKey + +Re-exports: [fromPrivateKey](modules_signer_privateKeySigner.md#fromprivatekey) + +___ + +### fromWalletConnectMetamask + +Re-exports: [fromWalletConnectMetamask](modules_signer_walletConnectMetamask.md#fromwalletconnectmetamask) diff --git a/docs/api/modules/modules_signer_gnosisSigner.md b/docs/api/modules/modules_signer_gnosisSigner.md new file mode 100644 index 00000000..cfdba50d --- /dev/null +++ b/docs/api/modules/modules_signer_gnosisSigner.md @@ -0,0 +1,26 @@ +# Module: modules/signer/gnosisSigner + +## Table of contents + +### Functions + +- [fromGnosis](modules_signer_gnosisSigner.md#fromgnosis) + +## Functions + +### fromGnosis + +▸ `Const` **fromGnosis**(`safeAppSdk`): `Promise`<[`SignerService`](../classes/modules_signer_signer_service.SignerService.md)\> + +**`description`** Intended for use in Volta Gnosis web interface(https://volta.gnosis-safe.io/). +Dapp should provide SafeAppSdk injected by Gnosis interface + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `safeAppSdk` | `SafeAppsSDK` | + +#### Returns + +`Promise`<[`SignerService`](../classes/modules_signer_signer_service.SignerService.md)\> diff --git a/docs/api/modules/modules_signer_metamaskSigner.md b/docs/api/modules/modules_signer_metamaskSigner.md new file mode 100644 index 00000000..7b771b29 --- /dev/null +++ b/docs/api/modules/modules_signer_metamaskSigner.md @@ -0,0 +1,17 @@ +# Module: modules/signer/metamaskSigner + +## Table of contents + +### Functions + +- [fromMetaMask](modules_signer_metamaskSigner.md#frommetamask) + +## Functions + +### fromMetaMask + +▸ `Const` **fromMetaMask**(): `Promise`<[`SignerService`](../classes/modules_signer_signer_service.SignerService.md)\> + +#### Returns + +`Promise`<[`SignerService`](../classes/modules_signer_signer_service.SignerService.md)\> diff --git a/docs/api/modules/modules_signer_privateKeySigner.md b/docs/api/modules/modules_signer_privateKeySigner.md new file mode 100644 index 00000000..166326b2 --- /dev/null +++ b/docs/api/modules/modules_signer_privateKeySigner.md @@ -0,0 +1,24 @@ +# Module: modules/signer/privateKeySigner + +## Table of contents + +### Functions + +- [fromPrivateKey](modules_signer_privateKeySigner.md#fromprivatekey) + +## Functions + +### fromPrivateKey + +▸ `Const` **fromPrivateKey**(`privateKey`, `rpcUrl`): `Promise`<[`SignerService`](../classes/modules_signer_signer_service.SignerService.md)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `privateKey` | `string` | +| `rpcUrl` | `string` | + +#### Returns + +`Promise`<[`SignerService`](../classes/modules_signer_signer_service.SignerService.md)\> diff --git a/docs/api/modules/modules_signer_signer_service.md b/docs/api/modules/modules_signer_signer_service.md new file mode 100644 index 00000000..2a1f8e75 --- /dev/null +++ b/docs/api/modules/modules_signer_signer_service.md @@ -0,0 +1,25 @@ +# Module: modules/signer/signer.service + +## Table of contents + +### Classes + +- [SignerService](../classes/modules_signer_signer_service.SignerService.md) + +### Type aliases + +- [ServiceInitializer](modules_signer_signer_service.md#serviceinitializer) + +## Type aliases + +### ServiceInitializer + +Ƭ **ServiceInitializer**: () => `Promise`<`void`\> + +#### Type declaration + +▸ (): `Promise`<`void`\> + +##### Returns + +`Promise`<`void`\> diff --git a/docs/api/modules/modules_signer_signer_types.md b/docs/api/modules/modules_signer_signer_types.md new file mode 100644 index 00000000..3dfcae61 --- /dev/null +++ b/docs/api/modules/modules_signer_signer_types.md @@ -0,0 +1,46 @@ +# Module: modules/signer/signer.types + +## Table of contents + +### Enumerations + +- [ProviderType](../enums/modules_signer_signer_types.ProviderType.md) + +### Interfaces + +- [IPubKeyAndIdentityToken](../interfaces/modules_signer_signer_types.IPubKeyAndIdentityToken.md) + +### Type aliases + +- [AccountInfo](modules_signer_signer_types.md#accountinfo) + +### Variables + +- [PUBLIC\_KEY](modules_signer_signer_types.md#public_key) +- [WALLET\_PROVIDER](modules_signer_signer_types.md#wallet_provider) + +## Type aliases + +### AccountInfo + +Ƭ **AccountInfo**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `account` | `string` | +| `chainId` | `number` | +| `chainName` | `string` | + +## Variables + +### PUBLIC\_KEY + +• `Const` **PUBLIC\_KEY**: ``"PublicKey"`` + +___ + +### WALLET\_PROVIDER + +• `Const` **WALLET\_PROVIDER**: ``"WalletProvider"`` diff --git a/docs/api/modules/modules_signer_walletConnectKms.md b/docs/api/modules/modules_signer_walletConnectKms.md new file mode 100644 index 00000000..070e7c20 --- /dev/null +++ b/docs/api/modules/modules_signer_walletConnectKms.md @@ -0,0 +1,24 @@ +# Module: modules/signer/walletConnectKms + +## Table of contents + +### Functions + +- [connectWithKmsClient](modules_signer_walletConnectKms.md#connectwithkmsclient) + +## Functions + +### connectWithKmsClient + +▸ **connectWithKmsClient**(`opts`, `ewKeyManagerUrl`): `Promise`<`WalletConnectProvider`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `opts` | `IWalletConnectProviderOptions` | +| `ewKeyManagerUrl` | `string` | + +#### Returns + +`Promise`<`WalletConnectProvider`\> diff --git a/docs/api/modules/modules_signer_walletConnectMetamask.md b/docs/api/modules/modules_signer_walletConnectMetamask.md new file mode 100644 index 00000000..f40e10a2 --- /dev/null +++ b/docs/api/modules/modules_signer_walletConnectMetamask.md @@ -0,0 +1,23 @@ +# Module: modules/signer/walletConnectMetamask + +## Table of contents + +### Functions + +- [fromWalletConnectMetamask](modules_signer_walletConnectMetamask.md#fromwalletconnectmetamask) + +## Functions + +### fromWalletConnectMetamask + +▸ `Const` **fromWalletConnectMetamask**(`walletConnectOpts?`): `Promise`<[`SignerService`](../classes/modules_signer_signer_service.SignerService.md)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `walletConnectOpts` | `IWalletConnectProviderOptions` | + +#### Returns + +`Promise`<[`SignerService`](../classes/modules_signer_signer_service.SignerService.md)\> diff --git a/docs/api/modules/modules_staking.md b/docs/api/modules/modules_staking.md new file mode 100644 index 00000000..4b427bed --- /dev/null +++ b/docs/api/modules/modules_staking.md @@ -0,0 +1,41 @@ +# Module: modules/staking + +## Table of contents + +### References + +- [Service](modules_staking.md#service) +- [Stake](modules_staking.md#stake) +- [StakeStatus](modules_staking.md#stakestatus) +- [StakingPool](modules_staking.md#stakingpool) +- [StakingService](modules_staking.md#stakingservice) + +## References + +### Service + +Re-exports: [Service](modules_staking_staking_service.md#service) + +___ + +### Stake + +Re-exports: [Stake](modules_staking_staking_service.md#stake) + +___ + +### StakeStatus + +Re-exports: [StakeStatus](../enums/modules_staking_staking_service.StakeStatus.md) + +___ + +### StakingPool + +Re-exports: [StakingPool](../classes/modules_staking_staking_service.StakingPool.md) + +___ + +### StakingService + +Re-exports: [StakingService](../classes/modules_staking_staking_service.StakingService.md) diff --git a/docs/api/modules/staking.md b/docs/api/modules/modules_staking_staking_service.md similarity index 53% rename from docs/api/modules/staking.md rename to docs/api/modules/modules_staking_staking_service.md index b97d5339..2a7ad3ce 100644 --- a/docs/api/modules/staking.md +++ b/docs/api/modules/modules_staking_staking_service.md @@ -1,21 +1,20 @@ -# Module: staking +# Module: modules/staking/staking.service ## Table of contents ### Enumerations -- [StakeStatus](../enums/staking.StakeStatus.md) -- [TransactionSpeed](../enums/staking.TransactionSpeed.md) +- [StakeStatus](../enums/modules_staking_staking_service.StakeStatus.md) ### Classes -- [StakingPool](../classes/staking.StakingPool.md) -- [StakingPoolService](../classes/staking.StakingPoolService.md) +- [StakingPool](../classes/modules_staking_staking_service.StakingPool.md) +- [StakingService](../classes/modules_staking_staking_service.StakingService.md) ### Type aliases -- [Service](staking.md#service) -- [Stake](staking.md#stake) +- [Service](modules_staking_staking_service.md#service) +- [Stake](modules_staking_staking_service.md#stake) ## Type aliases @@ -44,4 +43,4 @@ ___ | `amount` | `BigNumber` | | `depositEnd` | `BigNumber` | | `depositStart` | `BigNumber` | -| `status` | [`StakeStatus`](../enums/staking.StakeStatus.md) | +| `status` | [`StakeStatus`](../enums/modules_staking_staking_service.StakeStatus.md) | diff --git a/docs/api/modules/signer_Owner.md b/docs/api/modules/signer_Owner.md deleted file mode 100644 index f72c8b2e..00000000 --- a/docs/api/modules/signer_Owner.md +++ /dev/null @@ -1,7 +0,0 @@ -# Module: signer/Owner - -## Table of contents - -### Classes - -- [Owner](../classes/signer_Owner.Owner.md) diff --git a/docs/api/modules/types_WalletProvider.md b/docs/api/modules/types_WalletProvider.md deleted file mode 100644 index 217eb6c1..00000000 --- a/docs/api/modules/types_WalletProvider.md +++ /dev/null @@ -1,7 +0,0 @@ -# Module: types/WalletProvider - -## Table of contents - -### Enumerations - -- [WalletProvider](../enums/types_WalletProvider.WalletProvider.md) diff --git a/docs/api/modules/utils_constants.md b/docs/api/modules/utils_constants.md index f92d95dc..692d6c3c 100644 --- a/docs/api/modules/utils_constants.md +++ b/docs/api/modules/utils_constants.md @@ -2,86 +2,19 @@ ## Table of contents -### Enumerations - -- [MessagingMethod](../enums/utils_constants.MessagingMethod.md) - ### Variables -- [NATS\_EXCHANGE\_TOPIC](utils_constants.md#nats_exchange_topic) -- [NODE\_FIELDS\_KEY](utils_constants.md#node_fields_key) -- [PUBLIC\_KEY](utils_constants.md#public_key) - [VOLTA\_CHAIN\_ID](utils_constants.md#volta_chain_id) -- [WALLET\_PROVIDER](utils_constants.md#wallet_provider) -- [agreement\_type\_hash](utils_constants.md#agreement_type_hash) -- [defaultClaimExpiry](utils_constants.md#defaultclaimexpiry) - [emptyAddress](utils_constants.md#emptyaddress) -- [erc712\_type\_hash](utils_constants.md#erc712_type_hash) -- [proof\_type\_hash](utils_constants.md#proof_type_hash) -- [typedMsgPrefix](utils_constants.md#typedmsgprefix) ## Variables -### NATS\_EXCHANGE\_TOPIC - -• `Const` **NATS\_EXCHANGE\_TOPIC**: ``"claim.exchange"`` - -___ - -### NODE\_FIELDS\_KEY - -• `Const` **NODE\_FIELDS\_KEY**: ``"metadata"`` - -___ - -### PUBLIC\_KEY - -• `Const` **PUBLIC\_KEY**: ``"PublicKey"`` - -___ - ### VOLTA\_CHAIN\_ID • `Const` **VOLTA\_CHAIN\_ID**: ``73799`` ___ -### WALLET\_PROVIDER - -• `Const` **WALLET\_PROVIDER**: ``"WalletProvider"`` - -___ - -### agreement\_type\_hash - -• `Const` **agreement\_type\_hash**: `string` - -___ - -### defaultClaimExpiry - -• `Const` **defaultClaimExpiry**: `number` - -___ - ### emptyAddress • `Const` **emptyAddress**: ``"0x0000000000000000000000000000000000000000"`` - -___ - -### erc712\_type\_hash - -• `Const` **erc712\_type\_hash**: `string` - -___ - -### proof\_type\_hash - -• `Const` **proof\_type\_hash**: `string` - -___ - -### typedMsgPrefix - -• `Const` **typedMsgPrefix**: ``"1901"`` diff --git a/docs/api/modules/utils_getPublicKeyAndIdentityToken.md b/docs/api/modules/utils_getPublicKeyAndIdentityToken.md deleted file mode 100644 index f1c9df16..00000000 --- a/docs/api/modules/utils_getPublicKeyAndIdentityToken.md +++ /dev/null @@ -1,27 +0,0 @@ -# Module: utils/getPublicKeyAndIdentityToken - -## Table of contents - -### Interfaces - -- [IPubKeyAndIdentityToken](../interfaces/utils_getPublicKeyAndIdentityToken.IPubKeyAndIdentityToken.md) - -### Functions - -- [getPublicKeyAndIdentityToken](utils_getPublicKeyAndIdentityToken.md#getpublickeyandidentitytoken) - -## Functions - -### getPublicKeyAndIdentityToken - -▸ **getPublicKeyAndIdentityToken**(`signer`): `Promise`<[`IPubKeyAndIdentityToken`](../interfaces/utils_getPublicKeyAndIdentityToken.IPubKeyAndIdentityToken.md)\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `signer` | `Signer` | - -#### Returns - -`Promise`<[`IPubKeyAndIdentityToken`](../interfaces/utils_getPublicKeyAndIdentityToken.IPubKeyAndIdentityToken.md)\> diff --git a/docs/api/modules/walletconnect_ControllableWalletConnect.md b/docs/api/modules/walletconnect_ControllableWalletConnect.md deleted file mode 100644 index d117823a..00000000 --- a/docs/api/modules/walletconnect_ControllableWalletConnect.md +++ /dev/null @@ -1,7 +0,0 @@ -# Module: walletconnect/ControllableWalletConnect - -## Table of contents - -### Classes - -- [ControllableWalletConnect](../classes/walletconnect_ControllableWalletConnect.ControllableWalletConnect.md) diff --git a/docs/api/modules/walletconnect_WalletConnectService.md b/docs/api/modules/walletconnect_WalletConnectService.md deleted file mode 100644 index 351f8ad5..00000000 --- a/docs/api/modules/walletconnect_WalletConnectService.md +++ /dev/null @@ -1,7 +0,0 @@ -# Module: walletconnect/WalletConnectService - -## Table of contents - -### Classes - -- [WalletConnectService](../classes/walletconnect_WalletConnectService.WalletConnectService.md) diff --git a/package-lock.json b/package-lock.json index 967fd4a1..d16aab84 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1102,6 +1102,366 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, + "@changesets/apply-release-plan": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@changesets/apply-release-plan/-/apply-release-plan-5.0.1.tgz", + "integrity": "sha512-ltYLM/PPoL1Un9hnNCbUac25FWonJvIZ/9C3O4UyZ/k4rir9FGvH6KLtMOiPEAJWnXmaHeRDr06MzohuXOnmvw==", + "requires": { + "@babel/runtime": "^7.10.4", + "@changesets/config": "^1.6.1", + "@changesets/get-version-range-type": "^0.3.2", + "@changesets/git": "^1.1.2", + "@changesets/types": "^4.0.1", + "@manypkg/get-packages": "^1.0.1", + "detect-indent": "^6.0.0", + "fs-extra": "^7.0.1", + "lodash.startcase": "^4.4.0", + "outdent": "^0.5.0", + "prettier": "^1.19.1", + "resolve-from": "^5.0.0", + "semver": "^5.4.1" + }, + "dependencies": { + "detect-indent": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-6.1.0.tgz", + "integrity": "sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==" + }, + "prettier": { + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", + "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==" + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + } + } + }, + "@changesets/assemble-release-plan": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@changesets/assemble-release-plan/-/assemble-release-plan-5.0.1.tgz", + "integrity": "sha512-KQqafvScTFQ/4Q2LpLmDYhU47LWvIGcgVS8tzKU8fBvRdKuLGQXe42VYbwVM0cHIkFd/b6YFn+H2QMdKC2MjIQ==", + "requires": { + "@babel/runtime": "^7.10.4", + "@changesets/errors": "^0.1.4", + "@changesets/get-dependents-graph": "^1.2.2", + "@changesets/types": "^4.0.1", + "@manypkg/get-packages": "^1.0.1", + "semver": "^5.4.1" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + } + } + }, + "@changesets/cli": { + "version": "2.17.0", + "resolved": "https://registry.npmjs.org/@changesets/cli/-/cli-2.17.0.tgz", + "integrity": "sha512-UyraYwYst1lTjef+8i80XQ6SqsLaGwi4Sgn9YuDf2xdHA9m+5qQXshHvHVjaTdPTA09rqMBk9yeO7vmAqF4+vQ==", + "requires": { + "@babel/runtime": "^7.10.4", + "@changesets/apply-release-plan": "^5.0.1", + "@changesets/assemble-release-plan": "^5.0.1", + "@changesets/config": "^1.6.1", + "@changesets/errors": "^0.1.4", + "@changesets/get-dependents-graph": "^1.2.2", + "@changesets/get-release-plan": "^3.0.1", + "@changesets/git": "^1.1.2", + "@changesets/logger": "^0.0.5", + "@changesets/pre": "^1.0.7", + "@changesets/read": "^0.5.0", + "@changesets/types": "^4.0.1", + "@changesets/write": "^0.1.5", + "@manypkg/get-packages": "^1.0.1", + "@types/semver": "^6.0.0", + "boxen": "^1.3.0", + "chalk": "^2.1.0", + "enquirer": "^2.3.0", + "external-editor": "^3.1.0", + "fs-extra": "^7.0.1", + "human-id": "^1.0.2", + "is-ci": "^2.0.0", + "meow": "^6.0.0", + "outdent": "^0.5.0", + "p-limit": "^2.2.0", + "preferred-pm": "^3.0.0", + "semver": "^5.4.1", + "spawndamnit": "^2.0.0", + "term-size": "^2.1.0", + "tty-table": "^2.8.10" + }, + "dependencies": { + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "requires": { + "p-locate": "^4.1.0" + } + }, + "meow": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-6.1.1.tgz", + "integrity": "sha512-3YffViIt2QWgTy6Pale5QpopX/IvU3LPL03jOTqp6pGj3VjesdO/U8CuHMKpnQr4shCNCM5fd5XFFvIIl6JBHg==", + "requires": { + "@types/minimist": "^1.2.0", + "camelcase-keys": "^6.2.2", + "decamelize-keys": "^1.1.0", + "hard-rejection": "^2.1.0", + "minimist-options": "^4.0.2", + "normalize-package-data": "^2.5.0", + "read-pkg-up": "^7.0.1", + "redent": "^3.0.0", + "trim-newlines": "^3.0.0", + "type-fest": "^0.13.1", + "yargs-parser": "^18.1.3" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "requires": { + "p-limit": "^2.2.0" + } + }, + "parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "requires": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" + }, + "read-pkg": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", + "requires": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" + }, + "dependencies": { + "type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==" + } + } + }, + "read-pkg-up": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "requires": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + }, + "dependencies": { + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==" + } + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + }, + "type-fest": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", + "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==" + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, + "@changesets/config": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@changesets/config/-/config-1.6.1.tgz", + "integrity": "sha512-aQTo6ODvhsvnSFszMP1YbJyAi1DtE1Pes9rL+G+KYJiAOA6k5RzbiKOarjo+ZkKXpX0G3CBAbOO8jXOX4xG7cQ==", + "requires": { + "@changesets/errors": "^0.1.4", + "@changesets/get-dependents-graph": "^1.2.2", + "@changesets/logger": "^0.0.5", + "@changesets/types": "^4.0.1", + "@manypkg/get-packages": "^1.0.1", + "fs-extra": "^7.0.1", + "micromatch": "^4.0.2" + } + }, + "@changesets/errors": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/@changesets/errors/-/errors-0.1.4.tgz", + "integrity": "sha512-HAcqPF7snsUJ/QzkWoKfRfXushHTu+K5KZLJWPb34s4eCZShIf8BFO3fwq6KU8+G7L5KdtN2BzQAXOSXEyiY9Q==", + "requires": { + "extendable-error": "^0.1.5" + } + }, + "@changesets/get-dependents-graph": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@changesets/get-dependents-graph/-/get-dependents-graph-1.2.2.tgz", + "integrity": "sha512-3zJRw6TcexmOrmIZNOXpIRsZtqtrdmlzbqp4+V0VgnBvTxz16rqCS9VBsBqFYeJDWFj3soOlHUMeTwLghr18DA==", + "requires": { + "@changesets/types": "^4.0.1", + "@manypkg/get-packages": "^1.0.1", + "chalk": "^2.1.0", + "fs-extra": "^7.0.1", + "semver": "^5.4.1" + }, + "dependencies": { + "@openzeppelin/contracts": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.3.1.tgz", + "integrity": "sha512-QjgbPPlmDK2clK1hzjw2ROfY8KA5q+PfhDUUxZFEBCZP9fi6d5FuNoh/Uq0oCTMEKPmue69vhX2jcl0N/tFKGw==" + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + } + } + }, + "@changesets/get-release-plan": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@changesets/get-release-plan/-/get-release-plan-3.0.1.tgz", + "integrity": "sha512-HTZeEPvLlcWMWKxLrzQNLQWKDDN1lUKvaOV+hl/yBhgtyJECljJJzd3IRaKqCSWMrYKNaaEcmunTtZ4oaeoK9w==", + "requires": { + "@babel/runtime": "^7.10.4", + "@changesets/assemble-release-plan": "^5.0.1", + "@changesets/config": "^1.6.1", + "@changesets/pre": "^1.0.7", + "@changesets/read": "^0.5.0", + "@changesets/types": "^4.0.1", + "@manypkg/get-packages": "^1.0.1" + } + }, + "@changesets/get-version-range-type": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@changesets/get-version-range-type/-/get-version-range-type-0.3.2.tgz", + "integrity": "sha512-SVqwYs5pULYjYT4op21F2pVbcrca4qA/bAA3FmFXKMN7Y+HcO8sbZUTx3TAy2VXulP2FACd1aC7f2nTuqSPbqg==" + }, + "@changesets/git": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@changesets/git/-/git-1.1.2.tgz", + "integrity": "sha512-dfza8elsIwcYVa4fFzLaPs4+AkoCFiW3sfzkkC7WR+rG9j+zZh7CelzVpnoiAbEI2QOzeCbZKMoLSvBPgHhB1g==", + "requires": { + "@babel/runtime": "^7.10.4", + "@changesets/errors": "^0.1.4", + "@changesets/types": "^4.0.1", + "@manypkg/get-packages": "^1.0.1", + "is-subdir": "^1.1.1", + "spawndamnit": "^2.0.0" + } + }, + "@changesets/logger": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/@changesets/logger/-/logger-0.0.5.tgz", + "integrity": "sha512-gJyZHomu8nASHpaANzc6bkQMO9gU/ib20lqew1rVx753FOxffnCrJlGIeQVxNWCqM+o6OOleCo/ivL8UAO5iFw==", + "requires": { + "chalk": "^2.1.0" + } + }, + "@changesets/parse": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@changesets/parse/-/parse-0.3.9.tgz", + "integrity": "sha512-XoTEkMpvRRVxSlhvOaK4YSFM+RZhYFTksxRh7ieNkb6pMxkpq8MOYSi/07BuqkODn4dJEMOoSy3RzL99P6FyqA==", + "requires": { + "@changesets/types": "^4.0.1", + "js-yaml": "^3.13.1" + } + }, + "@changesets/pre": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@changesets/pre/-/pre-1.0.7.tgz", + "integrity": "sha512-oUU6EL4z0AIyCv/EscQFxxJsQfc9/AcSpqAGbdZrLXwshUWTXsJHMWlE3/+iSIyQ+I+/xtxbBxnqDUpUU3TOOg==", + "requires": { + "@babel/runtime": "^7.10.4", + "@changesets/errors": "^0.1.4", + "@changesets/types": "^4.0.1", + "@manypkg/get-packages": "^1.0.1", + "fs-extra": "^7.0.1" + } + }, + "@changesets/read": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@changesets/read/-/read-0.5.0.tgz", + "integrity": "sha512-A2OJ+vgfvbUaLx2yKyHH+tapa+DUd2NtpFpVuxjUqv0zirjqju20z1bziqaqpIQSf/rXPuoc09vp5w4VakraHg==", + "requires": { + "@babel/runtime": "^7.10.4", + "@changesets/git": "^1.1.2", + "@changesets/logger": "^0.0.5", + "@changesets/parse": "^0.3.9", + "@changesets/types": "^4.0.1", + "chalk": "^2.1.0", + "fs-extra": "^7.0.1", + "p-filter": "^2.1.0" + } + }, + "@changesets/types": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@changesets/types/-/types-4.0.1.tgz", + "integrity": "sha512-zVfv752D8K2tjyFmxU/vnntQ+dPu+9NupOSguA/2Zuym4tVxRh0ylArgKZ1bOAi2eXfGlZMxJU/kj7uCSI15RQ==" + }, + "@changesets/write": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/@changesets/write/-/write-0.1.5.tgz", + "integrity": "sha512-AYVSCH7on/Cyzo/8lVfqlsXmyKl3JhbNu9yHApdLPhHAzv5wqoHiZlMDkmd+AA67SRqzK2lDs4BcIojK+uWeIA==", + "requires": { + "@babel/runtime": "^7.10.4", + "@changesets/types": "^4.0.1", + "fs-extra": "^7.0.1", + "human-id": "^1.0.2", + "prettier": "^1.19.1" + }, + "dependencies": { + "prettier": { + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", + "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==" + } + } + }, "@cnakazawa/watch": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.4.tgz", @@ -1113,9 +1473,9 @@ } }, "@energyweb/iam-contracts": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@energyweb/iam-contracts/-/iam-contracts-3.0.0.tgz", - "integrity": "sha512-hJIDhplcL0omj9FM9T67KDRZ8RKxMfqSSxVLPiB0YLK1jWJR3ZsVYSUK3rEy7nGtIXdB01ohn5zRPeVMNgYlKw==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@energyweb/iam-contracts/-/iam-contracts-3.0.1.tgz", + "integrity": "sha512-5AyPoBlla25EY7XuCLbtCgpcvhhwi72NMfqVOZtdAXvJopmyN1Ai1EckfN9z/1H5lm0R7X2tveuT0cyMsCvjSg==", "requires": { "@ensdomains/buffer": "0.0.13", "@ensdomains/ens-contracts": "0.0.4", @@ -1250,9 +1610,9 @@ }, "dependencies": { "@openzeppelin/contracts": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.3.1.tgz", - "integrity": "sha512-QjgbPPlmDK2clK1hzjw2ROfY8KA5q+PfhDUUxZFEBCZP9fi6d5FuNoh/Uq0oCTMEKPmue69vhX2jcl0N/tFKGw==" + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.3.2.tgz", + "integrity": "sha512-AybF1cesONZStg5kWf6ao9OlqTZuPqddvprc0ky7lrUVOjXeKpmQ2Y9FK+6ygxasb+4aic4O5pneFBfwVsRRRg==" } } }, @@ -1848,23 +2208,22 @@ "ethers": "^5.4.6" } }, + "@gnosis.pm/safe-apps-provider": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@gnosis.pm/safe-apps-provider/-/safe-apps-provider-0.8.0.tgz", + "integrity": "sha512-4QkGkf0NJ+vr5Slo3VmnKGUjQkwp3vzzMFZwE38pt4kJ46HB/uWll9gEs08iQimZzYLTTEN57O2jDOuAE/odpg==", + "requires": { + "@gnosis.pm/safe-apps-sdk": "4.3.0", + "events": "^3.3.0" + } + }, "@gnosis.pm/safe-apps-sdk": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@gnosis.pm/safe-apps-sdk/-/safe-apps-sdk-1.0.3.tgz", - "integrity": "sha512-77c6lg4SfCbQtMjgB2vVPKQglUCOjSpwweNeoD4m0c5hnd5lFg0Dlcc45LwtcUL8j5XhDf+aBxT8LDD+XGDSNw==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gnosis.pm/safe-apps-sdk/-/safe-apps-sdk-4.3.0.tgz", + "integrity": "sha512-Evr/TdTmUUZXVZF0dcU1gLZj04+8Ea/6R8S3tRzxyOW5cN81NUuPNIiF5x/5Os3Mi+iPNG7qUZ5IHsU6Av3zPw==", "requires": { - "semver": "^7.3.2", - "web3-core": "^1.3.0" - }, - "dependencies": { - "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "requires": { - "lru-cache": "^6.0.0" - } - } + "@changesets/cli": "^2.16.0", + "ethers": "^5.4.5" } }, "@humanwhocodes/config-array": { @@ -2420,6 +2779,83 @@ "resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.3.tgz", "integrity": "sha512-nkalE/f1RvRGChwBnEIoBfSEYOXnCRdleKuv6+lePbMDrMZXeDQnqak5XDOeBgrPPyPfAdcCu/B5z+v3VhplGg==" }, + "@manypkg/find-root": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@manypkg/find-root/-/find-root-1.1.0.tgz", + "integrity": "sha512-mki5uBvhHzO8kYYix/WRy2WX8S3B5wdVSc9D6KcU5lQNglP2yt58/VfLuAK49glRXChosY8ap2oJ1qgma3GUVA==", + "requires": { + "@babel/runtime": "^7.5.5", + "@types/node": "^12.7.1", + "find-up": "^4.1.0", + "fs-extra": "^8.1.0" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "requires": { + "p-limit": "^2.2.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" + } + } + }, + "@manypkg/get-packages": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@manypkg/get-packages/-/get-packages-1.1.1.tgz", + "integrity": "sha512-J6VClfQSVgR6958eIDTGjfdCrELy1eT+SHeoSMomnvRQVktZMnEA5edIr5ovRFNw5y+Bk/jyoevPzGYod96mhw==", + "requires": { + "@babel/runtime": "^7.5.5", + "@manypkg/find-root": "^1.1.0", + "fs-extra": "^8.1.0", + "globby": "^11.0.0", + "read-yaml-file": "^1.1.0" + }, + "dependencies": { + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + } + } + }, "@metamask/detect-provider": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@metamask/detect-provider/-/detect-provider-1.2.0.tgz", @@ -2434,7 +2870,6 @@ "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, "requires": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -2443,14 +2878,12 @@ "@nodelib/fs.stat": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==" }, "@nodelib/fs.walk": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, "requires": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -3599,8 +4032,7 @@ "@types/minimist": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz", - "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==", - "dev": true + "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==" }, "@types/node": { "version": "12.20.24", @@ -3672,6 +4104,11 @@ "@types/node": "*" } }, + "@types/semver": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-6.2.3.tgz", + "integrity": "sha512-KQf+QAMWKMrtBMsB8/24w53tEsxllMj6TuA80TT/5igJalLI/zm0L3oXRbIAl4Ohfc85gyHX/jhMwsVkmhLU4A==" + }, "@types/sjcl": { "version": "1.0.28", "resolved": "https://registry.npmjs.org/@types/sjcl/-/sjcl-1.0.28.tgz", @@ -4165,11 +4602,34 @@ "integrity": "sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=", "dev": true }, + "ansi-align": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-2.0.0.tgz", + "integrity": "sha1-w2rsy6VjuJzrVW82kPCx2eNUf38=", + "requires": { + "string-width": "^2.0.0" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + } + } + }, "ansi-colors": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==" }, "ansi-escapes": { "version": "4.3.2", @@ -4298,7 +4758,6 @@ "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, "requires": { "sprintf-js": "~1.0.2" } @@ -4350,8 +4809,7 @@ "array-union": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==" }, "array-uniq": { "version": "1.0.3", @@ -4379,8 +4837,7 @@ "arrify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", - "dev": true + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=" }, "asn1": { "version": "0.2.4", @@ -4760,6 +5217,14 @@ "integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ==", "dev": true }, + "better-path-resolve": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/better-path-resolve/-/better-path-resolve-1.0.0.tgz", + "integrity": "sha512-pbnl5XzGBdrFU/wT4jqmJVPn2B6UHPBOhzMQkY/SPUPB6QtUXtmBHBIwCbXJol93mOpGMnQyP/+BB19q04xj7g==", + "requires": { + "is-windows": "^1.0.0" + } + }, "big.js": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", @@ -4946,6 +5411,87 @@ "integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==", "dev": true }, + "boxen": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-1.3.0.tgz", + "integrity": "sha512-TNPjfTr432qx7yOjQyaXm3dSR0MH9vXp7eT1BFSl/C51g+EFnOR9hTg1IreahGBmDNCehscshe45f+C1TBZbLw==", + "requires": { + "ansi-align": "^2.0.0", + "camelcase": "^4.0.0", + "chalk": "^2.0.1", + "cli-boxes": "^1.0.0", + "string-width": "^2.0.0", + "term-size": "^1.2.0", + "widest-line": "^2.0.0" + }, + "dependencies": { + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "requires": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "execa": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", + "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", + "requires": { + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" + }, + "lru-cache": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "term-size": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz", + "integrity": "sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=", + "requires": { + "execa": "^0.7.0" + } + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" + } + } + }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -4959,11 +5505,18 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, "requires": { "fill-range": "^7.0.1" } }, + "breakword": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/breakword/-/breakword-1.0.5.tgz", + "integrity": "sha512-ex5W9DoOQ/LUEU3PMdLs9ua/CYZl1678NUkKOdUSi8Aw5F1idieaiRURCBFJCwVcrD1J8Iy3vfWSloaMwO2qFg==", + "requires": { + "wcwidth": "^1.0.1" + } + }, "brorand": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", @@ -5293,7 +5846,6 @@ "version": "6.2.2", "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", - "dev": true, "requires": { "camelcase": "^5.3.1", "map-obj": "^4.0.0", @@ -5303,8 +5855,7 @@ "camelcase": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" } } }, @@ -5378,6 +5929,11 @@ "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", "dev": true }, + "chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==" + }, "check-error": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", @@ -5425,8 +5981,7 @@ "ci-info": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", - "dev": true + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==" }, "cids": { "version": "0.7.5", @@ -5500,6 +6055,11 @@ "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", "dev": true }, + "cli-boxes": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-1.0.0.tgz", + "integrity": "sha1-T6kXw+WclKAEzWH47lCdplFocUM=" + }, "cli-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", @@ -6712,6 +7272,32 @@ } } }, + "csv": { + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/csv/-/csv-5.5.3.tgz", + "integrity": "sha512-QTaY0XjjhTQOdguARF0lGKm5/mEq9PD9/VhZZegHDIBq2tQwgNpHc3dneD4mGo2iJs+fTKv5Bp0fZ+BRuY3Z0g==", + "requires": { + "csv-generate": "^3.4.3", + "csv-parse": "^4.16.3", + "csv-stringify": "^5.6.5", + "stream-transform": "^2.1.3" + } + }, + "csv-generate": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/csv-generate/-/csv-generate-3.4.3.tgz", + "integrity": "sha512-w/T+rqR0vwvHqWs/1ZyMDWtHHSJaN06klRqJXBEpDJaM/+dZkso0OKh1VcuuYvK3XM53KysVNq8Ko/epCK8wOw==" + }, + "csv-parse": { + "version": "4.16.3", + "resolved": "https://registry.npmjs.org/csv-parse/-/csv-parse-4.16.3.tgz", + "integrity": "sha512-cO1I/zmz4w2dcKHVvpCr7JVRu8/FymG5OEpmvsZYlccYolPBLoVGKUHgNoc4ZGkFeFlWGEDmMyBM+TTqRdW/wg==" + }, + "csv-stringify": { + "version": "5.6.5", + "resolved": "https://registry.npmjs.org/csv-stringify/-/csv-stringify-5.6.5.tgz", + "integrity": "sha512-PjiQ659aQ+fUTQqSrd1XEDnOr52jh30RBurfzkscaE2tPaFsDH5wOAHJiw8XAHphRknCwMUE9KRayc4K/NbO8A==" + }, "d": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", @@ -6768,7 +7354,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", - "dev": true, "requires": { "decamelize": "^1.1.0", "map-obj": "^1.0.0" @@ -6777,8 +7362,7 @@ "map-obj": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", - "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", - "dev": true + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=" } } }, @@ -6837,7 +7421,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", - "dev": true, "requires": { "clone": "^1.0.2" }, @@ -6845,8 +7428,7 @@ "clone": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", - "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", - "dev": true + "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=" } } }, @@ -7016,7 +7598,6 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, "requires": { "path-type": "^4.0.0" }, @@ -7024,8 +7605,7 @@ "path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==" } } }, @@ -7265,7 +7845,6 @@ "version": "2.3.6", "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", - "dev": true, "requires": { "ansi-colors": "^4.1.1" } @@ -7856,8 +8435,7 @@ "esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" }, "esquery": { "version": "1.4.0", @@ -8243,7 +8821,7 @@ } }, "ethereumjs-abi": { - "version": "git+https://github.com/ethereumjs/ethereumjs-abi.git#1a27c59c15ab1e95ee8e5c4ed6ad814c49cc439e", + "version": "git+https://github.com/ethereumjs/ethereumjs-abi.git#ee3994657fa7a427238e6ba92a84d0b529bbcde0", "from": "git+https://github.com/ethereumjs/ethereumjs-abi.git", "requires": { "bn.js": "^4.11.8", @@ -8811,6 +9389,21 @@ } } }, + "extendable-error": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/extendable-error/-/extendable-error-0.1.7.tgz", + "integrity": "sha512-UOiS2in6/Q0FK0R0q6UY9vYpQ21mr/Qn1KOnte7vsACuNJf514WvCCUHSRCPcgjPT2bAhNIJdlE6bVap1GKmeg==" + }, + "external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "requires": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + } + }, "extglob": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", @@ -8909,7 +9502,6 @@ "version": "3.2.7", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.7.tgz", "integrity": "sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q==", - "dev": true, "requires": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -8944,7 +9536,6 @@ "version": "1.12.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.12.0.tgz", "integrity": "sha512-VNX0QkHK3RsXVKr9KrlUv/FoTa0NdbYoHHl7uXHv2rzyHSlxjdNAKug2twd9luJxpcyNeAgf5iPPMutJO67Dfg==", - "dev": true, "requires": { "reusify": "^1.0.4" } @@ -8999,7 +9590,6 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, "requires": { "to-regex-range": "^5.0.1" } @@ -9128,6 +9718,55 @@ "semver-regex": "^3.1.2" } }, + "find-yarn-workspace-root2": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/find-yarn-workspace-root2/-/find-yarn-workspace-root2-1.2.16.tgz", + "integrity": "sha512-hr6hb1w8ePMpPVUK39S4RlwJzi+xPLuVuG8XlwXU3KD5Yn3qgBWVfy3AzNlDhWvE1EORCE65/Qm26rFQt3VLVA==", + "requires": { + "micromatch": "^4.0.2", + "pkg-dir": "^4.2.0" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "requires": { + "p-limit": "^2.2.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "requires": { + "find-up": "^4.0.0" + } + } + } + }, "flat-cache": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", @@ -10320,7 +10959,6 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, "requires": { "is-glob": "^4.0.1" } @@ -10343,7 +10981,6 @@ "version": "11.0.4", "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz", "integrity": "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==", - "dev": true, "requires": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", @@ -10376,6 +11013,11 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz", "integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==" }, + "grapheme-splitter": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", + "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==" + }, "growly": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", @@ -10413,8 +11055,7 @@ "hard-rejection": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", - "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", - "dev": true + "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==" }, "has": { "version": "1.0.3", @@ -10699,6 +11340,11 @@ "debug": "4" } }, + "human-id": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/human-id/-/human-id-1.0.2.tgz", + "integrity": "sha512-UNopramDEhHJD+VR+ehk8rOslwSfByxPIZyJRfV739NDhN5LF1fa1MqnzKm2lGTQRjNrjK19Q5fhkgIfjlVUKw==" + }, "human-signals": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", @@ -10858,8 +11504,7 @@ "ignore": { "version": "5.1.8", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", - "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", - "dev": true + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==" }, "ignore-walk": { "version": "3.0.4", @@ -10975,8 +11620,7 @@ "indent-string": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", - "dev": true + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==" }, "indexes-of": { "version": "1.0.1", @@ -11414,7 +12058,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", - "dev": true, "requires": { "ci-info": "^2.0.0" } @@ -11520,8 +12163,7 @@ "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" }, "is-fn": { "version": "1.0.0", @@ -11559,7 +12201,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "dev": true, "requires": { "is-extglob": "^2.1.1" } @@ -11602,8 +12243,7 @@ "is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" }, "is-number-object": { "version": "1.0.6", @@ -11709,6 +12349,14 @@ "has-tostringtag": "^1.0.0" } }, + "is-subdir": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-subdir/-/is-subdir-1.2.0.tgz", + "integrity": "sha512-2AT6j+gXe/1ueqbW6fLZJiIw3F8iXGJtt0yDrZaBhAZEG1raiTxKWU+IPqMCzQAXOUCKdA4UDMgacKH25XG2Cw==", + "requires": { + "better-path-resolve": "1.0.0" + } + }, "is-symbol": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", @@ -11757,8 +12405,7 @@ "is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", - "dev": true + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==" }, "is-wsl": { "version": "2.2.0", @@ -11778,8 +12425,7 @@ "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" }, "iso-constants": { "version": "0.1.2", @@ -13856,7 +14502,6 @@ "version": "3.14.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dev": true, "requires": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -14139,8 +14784,7 @@ "kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==" }, "klaw": { "version": "1.3.1", @@ -14627,6 +15271,29 @@ "strip-bom": "^2.0.0" } }, + "load-yaml-file": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/load-yaml-file/-/load-yaml-file-0.2.0.tgz", + "integrity": "sha512-OfCBkGEw4nN6JLtgRidPX6QxjBQGQf72q3si2uvqyFEMbycSFFHwAZeXx6cJgFM9wmLrf9zBwCP3Ivqa+LLZPw==", + "requires": { + "graceful-fs": "^4.1.5", + "js-yaml": "^3.13.0", + "pify": "^4.0.1", + "strip-bom": "^3.0.0" + }, + "dependencies": { + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==" + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=" + } + } + }, "loader-utils": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", @@ -14764,6 +15431,11 @@ "resolved": "https://registry.npmjs.org/lodash.partition/-/lodash.partition-4.6.0.tgz", "integrity": "sha1-o45GtzRp4EILDaEhLmbUFL42S6Q=" }, + "lodash.startcase": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.startcase/-/lodash.startcase-4.4.0.tgz", + "integrity": "sha1-lDbjTtJgk+1/+uGTYUQ1CRXZrdg=" + }, "lodash.sum": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/lodash.sum/-/lodash.sum-4.0.2.tgz", @@ -14898,6 +15570,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, "requires": { "yallist": "^4.0.0" }, @@ -14905,7 +15578,8 @@ "yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true } } }, @@ -14962,8 +15636,7 @@ "map-obj": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.2.1.tgz", - "integrity": "sha512-+WA2/1sPmDj1dlvvJmB5G6JKfY9dpn7EVBUL06+y6PoljPkh+6V1QihwxNkbcGxCRjt2b0F9K0taiCuo7MbdFQ==", - "dev": true + "integrity": "sha512-+WA2/1sPmDj1dlvvJmB5G6JKfY9dpn7EVBUL06+y6PoljPkh+6V1QihwxNkbcGxCRjt2b0F9K0taiCuo7MbdFQ==" }, "map-visit": { "version": "1.0.0", @@ -15300,8 +15973,7 @@ "merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==" }, "merkle-patricia-tree": { "version": "2.3.2", @@ -15389,7 +16061,6 @@ "version": "4.0.4", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", - "dev": true, "requires": { "braces": "^3.0.1", "picomatch": "^2.2.3" @@ -15473,7 +16144,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", - "dev": true, "requires": { "arrify": "^1.0.1", "is-plain-obj": "^1.1.0", @@ -15518,6 +16188,11 @@ } } }, + "mixme": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/mixme/-/mixme-0.5.4.tgz", + "integrity": "sha512-3KYa4m4Vlqx98GPdOHghxSdNtTvcP8E0kkaJ5Dlh+h2DRzF7zpuVVcA8B0QpKd11YJeP9QQ7ASkKzOeu195Wzw==" + }, "mkdirp": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", @@ -16305,7 +16980,7 @@ }, "abbrev": { "version": "1.1.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "dev": true }, @@ -16368,7 +17043,7 @@ }, "ansicolors": { "version": "0.3.2", - "resolved": false, + "resolved": "https://registry.npmjs.org/ansicolors/-/ansicolors-0.3.2.tgz", "integrity": "sha1-ZlWX3oap/+Oqm/vmyuXG6kJrSXk=", "dev": true }, @@ -18206,7 +18881,7 @@ }, "text-table": { "version": "0.2.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", "dev": true }, @@ -18404,7 +19079,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", - "dev": true, "requires": { "path-key": "^2.0.0" } @@ -18422,9 +19096,9 @@ } }, "nth-check": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.0.0.tgz", - "integrity": "sha512-i4sc/Kj8htBrAiH1viZ0TgU8Y5XqCaV/FziYK6TBczxmeKm3AEFWqqF3195yKudrarqy7Zu80Ra5dobFjn9X/Q==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.0.1.tgz", + "integrity": "sha512-it1vE95zF6dTT9lBsYbxvqh0Soy4SPowchj0UBGj/V6cTPnXXtQOPUbhZ6CmGzAD/rW22LQK6E96pcdJXk4A4w==", "requires": { "boolbase": "^1.0.0" } @@ -18730,8 +19404,7 @@ "os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", - "dev": true + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" }, "osenv": { "version": "0.1.5", @@ -18743,6 +19416,11 @@ "os-tmpdir": "^1.0.0" } }, + "outdent": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/outdent/-/outdent-0.5.0.tgz", + "integrity": "sha512-/jHxFIzoMXdqPzTaCpFzAAWhpkSjZPF4Vsn6jAfNpmbH/ymsmd7Qc6VE9BGn0L6YMj6uwpQLxCECpus4ukKS9Q==" + }, "p-cancelable": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", @@ -18772,7 +19450,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/p-filter/-/p-filter-2.1.0.tgz", "integrity": "sha512-ZBxxZ5sL2HghephhpGAQdoskxplTwr7ICaehZwLIlfL6acuVgZPm8yBNuRAFBGEqtD/hmUeq9eqLg2ys9Xr/yw==", - "dev": true, "requires": { "p-map": "^2.0.0" }, @@ -18780,8 +19457,7 @@ "p-map": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", - "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", - "dev": true + "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==" } } }, @@ -18963,8 +19639,7 @@ "path-key": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" }, "path-parse": { "version": "1.0.7", @@ -19011,8 +19686,7 @@ "picomatch": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", - "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", - "dev": true + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==" }, "pify": { "version": "2.3.0", @@ -19866,6 +20540,57 @@ "resolved": "https://registry.npmjs.org/precond/-/precond-0.2.3.tgz", "integrity": "sha1-qpWRvKokkj8eD0hJ0kD0fvwQdaw=" }, + "preferred-pm": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/preferred-pm/-/preferred-pm-3.0.3.tgz", + "integrity": "sha512-+wZgbxNES/KlJs9q40F/1sfOd/j7f1O9JaHcW5Dsn3aUUOZg3L2bjpVUcKV2jvtElYfoTuQiNeMfQJ4kwUAhCQ==", + "requires": { + "find-up": "^5.0.0", + "find-yarn-workspace-root2": "1.2.16", + "path-exists": "^4.0.0", + "which-pm": "2.0.0" + }, + "dependencies": { + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "requires": { + "p-locate": "^5.0.0" + } + }, + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "requires": { + "p-limit": "^3.0.2" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" + } + } + }, "prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -20020,6 +20745,11 @@ "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=" }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" + }, "psl": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", @@ -20202,14 +20932,12 @@ "queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==" }, "quick-lru": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", - "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", - "dev": true + "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==" }, "randombytes": { "version": "2.1.0", @@ -20281,6 +21009,29 @@ "read-pkg": "^1.0.0" } }, + "read-yaml-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-yaml-file/-/read-yaml-file-1.1.0.tgz", + "integrity": "sha512-VIMnQi/Z4HT2Fxuwg5KrY174U1VdUIASQVWXXyqtNRtxSr9IYkn1rsI6Tb6HsrHCmB7gVpNwX6JxPTHcH6IoTA==", + "requires": { + "graceful-fs": "^4.1.5", + "js-yaml": "^3.6.1", + "pify": "^4.0.1", + "strip-bom": "^3.0.0" + }, + "dependencies": { + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==" + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=" + } + } + }, "readable-stream": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", @@ -20295,7 +21046,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", - "dev": true, "requires": { "indent-string": "^4.0.0", "strip-indent": "^3.0.0" @@ -20305,7 +21055,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", - "dev": true, "requires": { "min-indent": "^1.0.0" } @@ -20505,8 +21254,7 @@ "resolve-from": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==" }, "resolve-url": { "version": "0.2.1", @@ -20547,8 +21295,7 @@ "reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==" }, "rgb-regex": { "version": "1.0.1", @@ -20776,7 +21523,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, "requires": { "queue-microtask": "^1.2.2" } @@ -21592,7 +22338,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "dev": true, "requires": { "shebang-regex": "^1.0.0" } @@ -21600,8 +22345,7 @@ "shebang-regex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "dev": true + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" }, "shellwords": { "version": "0.1.1", @@ -21634,8 +22378,7 @@ "signal-exit": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", - "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", - "dev": true + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==" }, "signale": { "version": "1.4.0", @@ -21713,8 +22456,7 @@ "slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==" }, "slice-ansi": { "version": "4.0.0", @@ -21751,11 +22493,181 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + } + } + }, + "smartwrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/smartwrap/-/smartwrap-1.2.5.tgz", + "integrity": "sha512-bzWRwHwu0RnWjwU7dFy7tF68pDAx/zMSu3g7xr9Nx5J0iSImYInglwEVExyHLxXljy6PWMjkSAbwF7t2mPnRmg==", + "requires": { + "breakword": "^1.0.5", + "grapheme-splitter": "^1.0.4", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1", + "yargs": "^15.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" + }, + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "requires": { + "p-limit": "^2.2.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" + }, + "yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "requires": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + } + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } } } }, @@ -21984,6 +22896,41 @@ "integrity": "sha1-Gv2Uc46ZmwNG17n8NzvlXgdXcCk=", "dev": true }, + "spawndamnit": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/spawndamnit/-/spawndamnit-2.0.0.tgz", + "integrity": "sha512-j4JKEcncSjFlqIwU5L/rp2N5SIPsdxaRsIv678+TZxZ0SRDJTm8JrxJMjE/XuiEZNEir3S8l0Fa3Ke339WI4qA==", + "requires": { + "cross-spawn": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "dependencies": { + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "requires": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "lru-cache": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" + } + } + }, "spdx-correct": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", @@ -22047,8 +22994,7 @@ "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" }, "sshpk": { "version": "1.16.1", @@ -22170,6 +23116,14 @@ "get-iterator": "^1.0.2" } }, + "stream-transform": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/stream-transform/-/stream-transform-2.1.3.tgz", + "integrity": "sha512-9GHUiM5hMiCi6Y03jD2ARC1ettBXkQBoQAe7nJsPknnI0ow10aXjTnew8QtYQmLjzn974BnmWEAJgCY6ZP1DeQ==", + "requires": { + "mixme": "^0.5.1" + } + }, "strict-uri-encode": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", @@ -22303,8 +23257,7 @@ "strip-eof": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", - "dev": true + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" }, "strip-final-newline": { "version": "2.0.0", @@ -22727,6 +23680,11 @@ } } }, + "term-size": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/term-size/-/term-size-2.2.1.tgz", + "integrity": "sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==" + }, "terminal-link": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz", @@ -22868,6 +23826,14 @@ "integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=", "dev": true }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "requires": { + "os-tmpdir": "~1.0.2" + } + }, "tmpl": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", @@ -22920,7 +23886,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, "requires": { "is-number": "^7.0.0" } @@ -22967,8 +23932,7 @@ "trim-newlines": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz", - "integrity": "sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==", - "dev": true + "integrity": "sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==" }, "ts-essentials": { "version": "7.0.3", @@ -23044,6 +24008,199 @@ } } }, + "tty-table": { + "version": "2.8.13", + "resolved": "https://registry.npmjs.org/tty-table/-/tty-table-2.8.13.tgz", + "integrity": "sha512-eVV/+kB6fIIdx+iUImhXrO22gl7f6VmmYh0Zbu6C196fe1elcHXd7U6LcLXu0YoVPc2kNesWiukYcdK8ZmJ6aQ==", + "requires": { + "chalk": "^3.0.0", + "csv": "^5.3.1", + "smartwrap": "^1.2.3", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1", + "yargs": "^15.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" + }, + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "requires": { + "p-limit": "^2.2.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "requires": { + "has-flag": "^4.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" + }, + "yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "requires": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + } + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", @@ -23530,7 +24687,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", - "dev": true, "requires": { "defaults": "^1.0.3" } @@ -24414,7 +25570,6 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, "requires": { "isexe": "^2.0.0" } @@ -24436,6 +25591,22 @@ "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=" }, + "which-pm": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-pm/-/which-pm-2.0.0.tgz", + "integrity": "sha512-Lhs9Pmyph0p5n5Z3mVnN0yWcbQYUAD7rbQUiMsQxOJ3T57k7RFe35SUwWMf7dsbDZks1uOmw4AecB/JMDj3v/w==", + "requires": { + "load-yaml-file": "^0.2.0", + "path-exists": "^4.0.0" + }, + "dependencies": { + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" + } + } + }, "which-pm-runs": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz", @@ -24464,6 +25635,30 @@ "string-width": "^1.0.2 || 2" } }, + "widest-line": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-2.0.1.tgz", + "integrity": "sha512-Ba5m9/Fa4Xt9eb2ELXt77JxVDV8w7qQrH0zS/TWSJdLyAwQjWoOzpzj5lwVftDz6n/EOu3tNACS84v509qwnJA==", + "requires": { + "string-width": "^2.1.1" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + } + } + }, "window-size": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz", @@ -24663,8 +25858,7 @@ "yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==" } } } diff --git a/package.json b/package.json index 5222f811..56ef54cc 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "iam-client-lib", "version": "1.0.6", "description": "Library for Decentralized Identity and Access Management", - "main": "dist/iam-client-lib.js", + "main": "dist/index.js", "module": "dist/iam-client-lib.esm.js", "types": "dist/src/iam-client-lib.d.ts", "files": [ @@ -28,11 +28,11 @@ "build:typechain:rewardpool": "typechain --target ethers-v5 --out-dir ethers \"./node_modules/@energyweb/iam-contracts/dist/contracts/RewardPool.json\"", "build:typechain:stakingpool": "typechain --target ethers-v5 --out-dir ethers \"./node_modules/@energyweb/iam-contracts/dist/contracts/Staking*.json\"", "prepare": "npm run build", - "start-rpc": "run-with-testrpc -m \"candy maple cake sugar pudding cream honey rich smooth crumble sweet treat\" --port 8544 --chainId 1337 --accounts 20 --gasLimit=10000000", - "ganache": "ganache-cli -m \"candy maple cake sugar pudding cream honey rich smooth crumble sweet treat\" --port 8544 --chainId 1337 --accounts 20 --gasLimit=10000000", - "test:watch": "npm run start-rpc -- \"jest --coverage --env=./test/env.js --watchAll\"", - "test:prod": "npm run start-rpc -- \"jest --no-cache --env=./test/env.js\"", - "test:watch:windows": "concurrently \"npm run start-rpc\" \"jest --coverage --env=./test/env.js --watchAll\"" + "start-rpc": "run-with-testrpc -m \"candy maple cake sugar pudding cream honey rich smooth crumble sweet treat\" -p 8544 --chainId 1337 -a 20 -e 1000 -l=10000000", + "ganache": "ganache-cli -m \"candy maple cake sugar pudding cream honey rich smooth crumble sweet treat\" -p 8544 --chainId 1337 -a 20 -e 1000 -l=10000000", + "test:watch": "npm run start-rpc -- \"jest --coverage --env=jest.env.js --watchAll\"", + "test:prod": "npm run start-rpc -- \"jest --no-cache --env=./jest.env.js\"", + "test:watch:windows": "concurrently \"npm run start-rpc\" \"jest --coverage --env=jest.env.js --watchAll\"" }, "keywords": [ "decentralized", @@ -67,7 +67,8 @@ "@ew-did-registry/jwt": "0.5.2-alpha.101.0", "@ew-did-registry/keys": "0.5.2-alpha.101.0", "@ew-did-registry/proxyidentity": "0.5.2-alpha.101.0", - "@gnosis.pm/safe-apps-sdk": "1.0.3", + "@gnosis.pm/safe-apps-provider": "0.8.0", + "@gnosis.pm/safe-apps-sdk": "4.3.0", "@metamask/detect-provider": "^1.2.0", "@walletconnect/web3-provider": "1.0.0-rc.4", "axios": "^0.21.1", @@ -97,6 +98,7 @@ "@types/uuid": "^8.3.0", "@typescript-eslint/eslint-plugin": "^4.0.1", "@typescript-eslint/parser": "^4.0.1", + "@walletconnect/types": "1.6.5", "babel-jest": "26.6.3", "bili": "^5.0.5", "copyfiles": "^2.4.0", diff --git a/src/GnosisIam.ts b/src/GnosisIam.ts deleted file mode 100644 index 9709c5ad..00000000 --- a/src/GnosisIam.ts +++ /dev/null @@ -1,155 +0,0 @@ -import SafeAppSdk from "@gnosis.pm/safe-apps-sdk"; -import { BigNumber } from "ethers"; -import { IApp, IOrganization, IRole } from "./cacheServerClient/cacheServerClient.types"; -import { CacheClientNotProvidedError, ERROR_MESSAGES } from "./errors"; -import { ENSNamespaceTypes, IAM } from "./iam"; -import { ConnectionOptions, Transaction } from "./iam/iam-base"; -import { emptyAddress } from "./utils/constants"; - -/** - * @class GnosisIam - * @description Intended for use in Volta Gnosis web interface(https://volta.gnosis-safe.io/). - * Dapp should provide this class with SafeAppSdk injected by Gnosis interface. This class intoduces - * notion of controlled domain as that which is owned by gnosis wallet controlled by Iam signer. - * The domain ownership functionality has been redefined accordingly. - */ -export class GnosisIam extends IAM { - protected _safeAddress = ""; - - constructor(private safeAppSdk: SafeAppSdk, iamOpts: ConnectionOptions) { - super(iamOpts); - } - - protected async send(tx: Transaction) { - const safeTxGas = BigNumber.from((await this._transactionOverrides.gasLimit) || "").toNumber(); - - if (tx.from === this._safeAddress) { - await this.safeAppSdk.txs.send({ - txs: tx.calls.map((tx) => ({ ...tx, value: tx.value || "0" })), - params: { - safeTxGas, - }, - }); - } else if (tx.from === this._address) { - await super.send(tx); - } - } - - protected async setAddress() { - await super.setAddress(); - this._safeAddress = (await this.safeAppSdk.getSafeInfo()).safeAddress; - } - - get safeAddress() { - return this._safeAddress; - } - - getENSTypesByOwner({ type, owner }: { type: ENSNamespaceTypes; owner: string }) { - if (!this._cacheClient) { - throw new CacheClientNotProvidedError(); - } - switch (type) { - case ENSNamespaceTypes.Organization: - return Promise.all([ - super.getENSTypesByOwner({ type, owner }) as Promise, - super.getENSTypesByOwner({ type, owner: this._safeAddress }) as Promise, - ]).then(([owned, controlled]) => [...owned, ...controlled]); - case ENSNamespaceTypes.Application: - return Promise.all([ - super.getENSTypesByOwner({ type, owner }) as Promise, - super.getENSTypesByOwner({ type, owner: this._safeAddress }) as Promise, - ]).then(([owned, controlled]) => [...owned, ...controlled]); - case ENSNamespaceTypes.Roles: - return Promise.all([ - super.getENSTypesByOwner({ type, owner }) as Promise, - super.getENSTypesByOwner({ type, owner: this._safeAddress }) as Promise, - ]).then(([owned, controlled]) => [...owned, ...controlled]); - } - } - - async validateOwnership({ namespace, type }: { namespace: string; type: ENSNamespaceTypes }) { - if (this._address && this._safeAddress) { - const notOwnedByOwner = await super.nonOwnedNodesOf({ - namespace, - type, - owner: this._address, - }); - const notOwnedBySafe = await super.nonOwnedNodesOf({ - namespace, - type, - owner: this._safeAddress, - }); - if (notOwnedByOwner.length < notOwnedBySafe.length) { - return notOwnedByOwner; - } else { - return notOwnedBySafe; - } - } else { - throw new Error(ERROR_MESSAGES.USER_NOT_LOGGED_IN); - } - } - - /** - * @description Checks whether the `domain` is owned by `user` or by - * gnosis wallet controlled by `user` - */ - async isOwner({ domain, user = this._address }: { domain: string; user?: string }) { - return ( - (await super.isOwner({ domain, user })) || - (user === this._address && (await super.isOwner({ domain, user: this._safeAddress }))) - ); - } - - protected async validateChangeOwnership({ namespaces, newOwner }: { namespaces: string[]; newOwner: string }) { - const namespacesWithRelations = await this.namespacesWithRelations(namespaces); - return namespacesWithRelations.reduce( - (acc, { namespace, owner }) => { - if (owner === newOwner) { - acc.alreadyFinished.push(namespace); - } else if (owner === this._address || owner === this.safeAddress) { - acc.changeOwnerNamespaces.push(namespace); - } else { - acc.notOwnedNamespaces.push(namespace); - } - return acc; - }, - { - notOwnedNamespaces: new Array(), - alreadyFinished: new Array(), - changeOwnerNamespaces: new Array(), - }, - ); - } - - protected async validateDeletePossibility({ namespaces }: { namespaces: string[] }) { - const namespacesWithRelations = await this.namespacesWithRelations(namespaces); - return namespacesWithRelations.reduce( - (acc, { namespace, owner }) => { - if (owner === emptyAddress) { - acc.alreadyFinished.push(namespace); - } else if (owner === this._address || owner === this.safeAddress) { - acc.namespacesToDelete.push(namespace); - } else { - acc.notOwnedNamespaces.push(namespace); - } - return acc; - }, - { - alreadyFinished: new Array(), - namespacesToDelete: new Array(), - notOwnedNamespaces: new Array(), - }, - ); - } - - async getOrgHierarchy({ namespace }: { namespace: string }): Promise { - if (!this._cacheClient) { - throw new CacheClientNotProvidedError(); - } - const org = await this._cacheClient.getOrgHierarchy({ namespace }); - [org, ...(org.subOrgs || []), ...(org.apps || []), ...(org.roles || [])].forEach( - (domain) => (domain.isOwnedByCurrentUser = [this._address, this.safeAddress].includes(domain.owner)), - ); - return org; - } -} diff --git a/src/cacheServerClient/cacheServerClient.types.ts b/src/cacheServerClient/cacheServerClient.types.ts deleted file mode 100644 index be5aa71d..00000000 --- a/src/cacheServerClient/cacheServerClient.types.ts +++ /dev/null @@ -1,107 +0,0 @@ -import { IDIDDocument } from "@ew-did-registry/did-resolver-interface"; -import { IRoleDefinition, IAppDefinition, IOrganizationDefinition } from "@energyweb/iam-contracts"; - -export interface IRole { - uid: string; - name: string; - namespace: string; - owner: string; - definition: IRoleDefinition; - isOwnedByCurrentUser?: boolean; -} - -export interface IOrganization { - uid: string; - name: string; - namespace: string; - owner: string; - definition: IOrganizationDefinition; - apps?: IApp[]; - roles?: IRole[]; - subOrgs?: IOrganization[]; - isOwnedByCurrentUser?: boolean; -} - -export interface IApp { - uid: string; - name: string; - namespace: string; - owner: string; - definition: IAppDefinition; - roles?: IRole[]; - isOwnedByCurrentUser?: boolean; -} - -export enum RegistrationTypes { - OffChain = "RegistrationTypes::OffChain", - OnChain = "RegistrationTypes::OnChain", -} - -export interface Claim { - id: string; - requester: string; - subject: string; - claimIssuer: string[]; - claimType: string; - claimTypeVersion: string; - registrationTypes: RegistrationTypes[]; - token: string; - subjectAgreement?: string; - onChainProof?: string; - issuedToken?: string; - isAccepted: boolean; - acceptedBy?: string; - isRejected?: boolean; - namespace: string; -} - -export interface Asset { - id: string; - owner: string; - offeredTo?: string; - document: IDIDDocument; -} - -export interface AssetHistory { - id: number; - emittedBy: string; - relatedTo?: string; - at: number; - timestamp: string; - assetId?: string; -} - -export interface AssetProfile { - name?: string; - icon?: string; -} - -export interface AssetProfiles { - [key: string]: AssetProfile; -} - -export interface Profile { - name?: string; - birthdate?: string; - address?: string; - assetProfiles?: AssetProfiles; -} - -export interface ClaimData extends Record { - profile?: Profile; - claimType?: string; - claimTypeVersion?: number; -} - -export enum Order { - "ASC" = "ASC", - "DESC" = "DESC", -} - -export enum AssetHistoryEventType { - ASSET_CREATED = "ASSET_CREATED", - ASSET_OFFERED = "ASSET_OFFERED", - ASSET_OFFER_CANCELED = "ASSET_OFFER_CANCELED", - ASSET_TRANSFERRED = "ASSET_TRANSFERRED", - ASSET_OFFER_REJECTED = "ASSET_OFFER_REJECTED", -} diff --git a/src/config/cache.config.ts b/src/config/cache.config.ts new file mode 100644 index 00000000..3209a65e --- /dev/null +++ b/src/config/cache.config.ts @@ -0,0 +1,19 @@ +import { CacheServerClientOptions } from "../modules/cacheClient/cacheClient.types"; +import { VOLTA_CHAIN_ID } from "../utils/constants"; + +const cacheConfig: Record = { + [VOLTA_CHAIN_ID]: { + url: "https://volta-identitycache.energyweb.org/v1", + cacheServerSupportsAuth: true, + }, +}; + +/** + * Used to override existing cache server configuration or add a missing one + * Configuration must be set before constructing `IAM` + */ +export const setCacheConfig = (chainId: number, options: Partial) => { + cacheConfig[chainId] = { ...cacheConfig[chainId], ...options }; +}; + +export const cacheConfigs = () => ({ ...cacheConfig }); diff --git a/src/config/chain.config.ts b/src/config/chain.config.ts new file mode 100644 index 00000000..1531ec18 --- /dev/null +++ b/src/config/chain.config.ts @@ -0,0 +1,55 @@ +import { VoltaAddress1056 } from "@ew-did-registry/did-ethr-resolver"; +import { + VOLTA_DOMAIN_NOTIFER_ADDRESS, + VOLTA_ENS_REGISTRY_ADDRESS, + VOLTA_PUBLIC_RESOLVER_ADDRESS, + VOLTA_RESOLVER_V1_ADDRESS, + VOLTA_IDENTITY_MANAGER_ADDRESS, + VOLTA_CLAIM_MANAGER_ADDRESS, + VOLTA_STAKING_POOL_FACTORY_ADDRESS, +} from "@energyweb/iam-contracts"; +import { VOLTA_CHAIN_ID } from "../utils/constants"; + +export interface ChainConfig { + chainName: string; + rpcUrl: string; + ensRegistryAddress: string; + ensResolverAddress: string; + ensPublicResolverAddress: string; + domainNotifierAddress: string; + assetManagerAddress: string; + didRegistryAddress: string; + claimManagerAddress: string; + stakingPoolFactoryAddress: string; +} + +export type ChainId = number; + +/** + * Set of parameters to configure connection to chain with id received from wallet. + * If configuration for some chain is missing or should be reconfigured use `setChainConfig` before class instantiation + */ +const chainConfig: Record = { + [VOLTA_CHAIN_ID]: { + chainName: "Energy Web Volta Testnet", + rpcUrl: "https://volta-rpc.energyweb.org", + ensRegistryAddress: VOLTA_ENS_REGISTRY_ADDRESS, + ensResolverAddress: VOLTA_RESOLVER_V1_ADDRESS, + ensPublicResolverAddress: VOLTA_PUBLIC_RESOLVER_ADDRESS, + domainNotifierAddress: VOLTA_DOMAIN_NOTIFER_ADDRESS, + assetManagerAddress: VOLTA_IDENTITY_MANAGER_ADDRESS, + didRegistryAddress: VoltaAddress1056, + claimManagerAddress: VOLTA_CLAIM_MANAGER_ADDRESS, + stakingPoolFactoryAddress: VOLTA_STAKING_POOL_FACTORY_ADDRESS, + }, +}; + +export const chainConfigs = () => ({ ...chainConfig }); + +/** + * Used to override existing chain configuration or add a missing one + * Configuration must be set before constructing `IAM` + */ +export const setChainConfig = (chainId: ChainId, config: Partial) => { + chainConfig[chainId] = { ...chainConfig[chainId], ...config }; +}; diff --git a/src/config/index.ts b/src/config/index.ts new file mode 100644 index 00000000..c49c158f --- /dev/null +++ b/src/config/index.ts @@ -0,0 +1,3 @@ +export * from "./cache.config"; +export * from "./chain.config"; +export * from "./messaging.config"; diff --git a/src/config/messaging.config.ts b/src/config/messaging.config.ts new file mode 100644 index 00000000..eade8854 --- /dev/null +++ b/src/config/messaging.config.ts @@ -0,0 +1,25 @@ +import { MessagingMethod } from "../modules/messaging/messaging.types"; +import { VOLTA_CHAIN_ID } from "../utils/constants"; +import { ChainId } from "./chain.config"; + +export interface MessagingConfig { + messagingMethod: MessagingMethod; + natsServerUrl: string; +} + +const messagingConfig: Record = { + [VOLTA_CHAIN_ID]: { + messagingMethod: MessagingMethod.Nats, + natsServerUrl: "https://volta-identityevents.energyweb.org/", + }, +}; + +/** + * Used to override existing messaging configuration or add a missing one + * Configuration must be set before constructing `IAM` + */ +export const setMessagingConfig = (chainId: ChainId, options: Partial) => { + messagingConfig[chainId] = { ...messagingConfig[chainId], ...options }; +}; + +export const messagingConfigs = () => ({ ...messagingConfig }); diff --git a/src/errors/CacheClientNotProvided.ts b/src/errors/CacheClientNotProvided.ts deleted file mode 100644 index 8d6538ec..00000000 --- a/src/errors/CacheClientNotProvided.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { ERROR_MESSAGES } from "./ErrorMessages"; - -export class CacheClientNotProvidedError extends Error { - constructor() { - super(ERROR_MESSAGES.CACHE_CLIENT_NOT_PROVIDED); - } -} diff --git a/src/errors/ENSRegistryNotInitializedError.ts b/src/errors/ENSRegistryNotInitializedError.ts deleted file mode 100644 index 848d5b1e..00000000 --- a/src/errors/ENSRegistryNotInitializedError.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { ERROR_MESSAGES } from "./ErrorMessages"; - -export class ENSRegistryNotInitializedError extends Error { - constructor() { - super(ERROR_MESSAGES.ENS_REGISTRY_NOT_INITIALIZED); - } -} diff --git a/src/errors/ENSResolverNotInitializedError.ts b/src/errors/ENSResolverNotInitializedError.ts deleted file mode 100644 index a9286400..00000000 --- a/src/errors/ENSResolverNotInitializedError.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { ERROR_MESSAGES } from "./ErrorMessages"; - -export class ENSResolverNotInitializedError extends Error { - constructor() { - super(ERROR_MESSAGES.ENS_RESOLVER_NOT_INITIALIZED); - } -} diff --git a/src/errors/ENSTypeNOtSupportedError.ts b/src/errors/ENSTypeNotSupportedError.ts similarity index 100% rename from src/errors/ENSTypeNOtSupportedError.ts rename to src/errors/ENSTypeNotSupportedError.ts diff --git a/src/errors/ErrorMessages.ts b/src/errors/ErrorMessages.ts index 20e0b7a5..b1cf01e6 100644 --- a/src/errors/ErrorMessages.ts +++ b/src/errors/ErrorMessages.ts @@ -1,35 +1,18 @@ export enum ERROR_MESSAGES { - SIGNER_NOT_INITIALIZED = "Signer not initialized", - NOT_CONNECTED_TO_VOLTA = "Not connected to volta network", - CLAIMS_NOT_INITIALIZED = "User claims not initialized", - JWT_NOT_INITIALIZED = "JWT was not initialized", - PROVIDER_NOT_INITIALIZED = "Provider not initialized", - DID_DOCUMENT_NOT_INITIALIZED = "DID document not initialized", + UNKNOWN_PROVIDER = "Unknown provider type", ENS_TYPE_NOT_SUPPORTED = "ENS type not supported", - USER_NOT_LOGGED_IN = "User not logged in", - NO_PROVIDER = "Initialization of singer failed due to no provider", - PRIVATE_KEY_NOT_PROVIDED = "IAM can not be initialized in Node.js environment without private key", - RPC_URL_NOT_PROVIDED = "IAM can not be initialized in Node.js environment without rpc url", - NO_RPC_URL = "Rpc url needed to initialize provider in node js environment", - CACHE_CLIENT_NOT_PROVIDED = "Cache client not provided", - ENS_REGISTRY_NOT_INITIALIZED = "ENS registry not initialized", - ENS_RESOLVER_NOT_INITIALIZED = "ENS resolver not initialized", - NATS_NOT_CONNECTED = "NATS connection not established", WALLET_PROVIDER_NOT_SUPPORTED = "Wallet provider must be a supported value", - WALLET_TYPE_NOT_PROVIDED = "A wallet provider type or a private key must be provided", - ENS_REGISTRY_CONTRACT_NOT_INITIALIZED = "ENS Registry contract not initialized", PUBLIC_KEY_NOT_RECOVERED = "Public key not recovered", - UNABLE_TO_OBTAIN_PUBLIC_KEY = "Enable to obtain public key", ORG_WITH_APPS = "You are not able to remove organization with registered apps", ORG_WITH_ROLES = "You are not able to remove organization with registered roles", APP_WITH_ROLES = "You are not able to remove application with registered roles", - METAMASK_EXTENSION_NOT_AVAILABLE = "Selected Metamask provider but Metamask not available", + METAMASK_PROVIDER_NOT_DETECTED = "Metamask provider not detected", ROLE_PREREQUISITES_NOT_MET = "Enrolment subject doesn't have required roles", ROLE_NOT_EXISTS = "Role you want to enroll to does not exists", - CLAIM_PUBLISHER_NOT_REQUESTER = "Claim subject is not controlled by publisher", + CAN_NOT_UPDATE_NOT_CONTROLLED_DOCUMENT = "Can not update not controlled document", ONCHAIN_ROLE_VERSION_NOT_SPECIFIED = "On-chain role version not specified", - CACHE_SERVER_NOT_REGISTERED = "Cache server for this chain is not registered", WITHDRAWAL_WAS_NOT_REQUESTED = "Stake withdrawal was not requested", STAKE_WAS_NOT_PUT = "Stake was not put", INSUFFICIENT_BALANCE = "Signer has insufficient balance", + NOT_AUTHORIZED_TO_CHANGE_DOMAIN = "Not authorized to change domain", } diff --git a/src/errors/NatsConnectionNotEstablishedError.ts b/src/errors/NatsConnectionNotEstablishedError.ts deleted file mode 100644 index 3f9fb702..00000000 --- a/src/errors/NatsConnectionNotEstablishedError.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { ERROR_MESSAGES } from "./ErrorMessages"; - -export class NATSConnectionNotEstablishedError extends Error { - constructor() { - super(ERROR_MESSAGES.NATS_NOT_CONNECTED); - } -} diff --git a/src/errors/index.ts b/src/errors/index.ts index dd916da1..988596b8 100644 --- a/src/errors/index.ts +++ b/src/errors/index.ts @@ -1,20 +1,12 @@ -import { CacheClientNotProvidedError } from "./CacheClientNotProvided"; -import { ENSTypeNotSupportedError } from "./ENSTypeNOtSupportedError"; +import { ENSTypeNotSupportedError } from "./ENSTypeNotSupportedError"; import { MethodNotAvailableInNodeEnvError } from "./MethodNotAvailableInNodeError"; -import { NATSConnectionNotEstablishedError } from "./NatsConnectionNotEstablishedError"; -import { ENSRegistryNotInitializedError } from "./ENSRegistryNotInitializedError"; -import { ENSResolverNotInitializedError } from "./ENSResolverNotInitializedError"; import { ChangeOwnershipNotPossibleError } from "./ChangeOwnershipNotPossibleError"; import { DeletingNamespaceNotPossibleError } from "./DeletingNamespaceNotPossibleError"; import { ERROR_MESSAGES } from "./ErrorMessages"; export { - CacheClientNotProvidedError, ENSTypeNotSupportedError, MethodNotAvailableInNodeEnvError, - NATSConnectionNotEstablishedError, - ENSRegistryNotInitializedError, - ENSResolverNotInitializedError, ChangeOwnershipNotPossibleError, DeletingNamespaceNotPossibleError, ERROR_MESSAGES, diff --git a/src/iam-client-lib.ts b/src/iam-client-lib.ts deleted file mode 100644 index 4b224471..00000000 --- a/src/iam-client-lib.ts +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2020 Energy Web Foundation -// This file is part of IAM Client Library brought to you by the Energy Web Foundation, -// a global non-profit organization focused on accelerating blockchain technology across the energy sector, -// incorporated in Zug, Switzerland. -// -// The IAM Client Library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// This is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY and without an implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details, at . -// -// @authors: Kim Honoridez - -import { IAM, ENSNamespaceTypes } from "./iam"; -import { ICacheServerClient } from "./cacheServerClient/ICacheServerClient"; -import { ERROR_MESSAGES } from "./errors"; -import { WalletProvider } from "./types/WalletProvider"; -import { MessagingMethod, NATS_EXCHANGE_TOPIC, VOLTA_CHAIN_ID } from "./utils/constants"; -import { - IApp, - IOrganization, - IRole, - Asset, - AssetHistory, - AssetHistoryEventType, - Order, - ClaimData, - Profile, - AssetProfiles, - AssetProfile, - RegistrationTypes, -} from "./cacheServerClient/cacheServerClient.types"; - -import { DIDAttribute, Encoding, Algorithms, PubKeyType } from "@ew-did-registry/did-resolver-interface"; - -import { setCacheClientOptions, setChainConfig, setMessagingOptions } from "./iam/chainConfig"; - -export { - IRoleDefinition, - IAppDefinition, - IOrganizationDefinition, - PreconditionType as PreconditionTypes, - WITHDRAW_DELAY, - PRINCIPAL_THRESHOLD, -} from "@energyweb/iam-contracts"; - -// MAIN -export { IAM }; - -// CONSTANTS - -export { NATS_EXCHANGE_TOPIC, VOLTA_CHAIN_ID }; - -// UTILS - -export { setCacheClientOptions, setChainConfig, setMessagingOptions }; - -// ENUMS -export { - DIDAttribute, - Encoding, - Algorithms, - PubKeyType, - ENSNamespaceTypes, - MessagingMethod, - ERROR_MESSAGES, - WalletProvider, - Order, - AssetHistoryEventType, - RegistrationTypes, -}; - -// TYPES -export { - ICacheServerClient, - IApp, - IOrganization, - IRole, - Asset, - AssetHistory, - ClaimData, - Profile, - AssetProfiles, - AssetProfile, -}; - -export { GnosisIam as SafeIam } from "./GnosisIam"; -export * from "./utils/did"; -export * from "./staking"; diff --git a/src/iam.ts b/src/iam.ts deleted file mode 100644 index 96333b70..00000000 --- a/src/iam.ts +++ /dev/null @@ -1,1906 +0,0 @@ -// Copyright 2020 Energy Web Foundation -// This file is part of IAM Client Library brought to you by the Energy Web Foundation, -// a global non-profit organization focused on accelerating blockchain technology across the energy sector, -// incorporated in Zug, Switzerland. -// -// The IAM Client Library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// This is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY and without an implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details, at . -// -// @authors: Kim Honoridez -// @authors: Daniel Wojno - -import { providers, Signer, utils } from "ethers"; -import { - IRoleDefinition, - IAppDefinition, - IOrganizationDefinition, - PreconditionType, - EncodedCall, - DomainReader, -} from "@energyweb/iam-contracts"; -import { - Algorithms, - DIDAttribute, - Encoding, - IDIDDocument, - IServiceEndpoint, - IUpdateData, -} from "@ew-did-registry/did-resolver-interface"; -import { hashes, IProofData, IPublicClaim, ISaltedFields } from "@ew-did-registry/claims"; -import { ProxyOperator } from "@ew-did-registry/proxyidentity"; -import { v4 as uuid } from "uuid"; -import { IAMBase } from "./iam/iam-base"; -import { - CacheClientNotProvidedError, - ChangeOwnershipNotPossibleError, - DeletingNamespaceNotPossibleError, - ENSRegistryNotInitializedError, - ENSResolverNotInitializedError, - ENSTypeNotSupportedError, - ERROR_MESSAGES, - NATSConnectionNotEstablishedError, -} from "./errors"; -import { - AssetHistoryEventType, - ClaimData, - IOrganization, - Order, - RegistrationTypes, -} from "./cacheServerClient/cacheServerClient.types"; -import detectEthereumProvider from "@metamask/detect-provider"; -import { WalletProvider } from "./types/WalletProvider"; -import { - defaultClaimExpiry, - emptyAddress, - erc712_type_hash, - NATS_EXCHANGE_TOPIC, - proof_type_hash, - typedMsgPrefix, -} from "./utils/constants"; -import { Subscription } from "nats.ws/lib/src/mod.js"; -import { AxiosError } from "axios"; -import { DIDDocumentFull } from "@ew-did-registry/did-document"; -import { Methods } from "@ew-did-registry/did"; -import { addressOf } from "@ew-did-registry/did-ethr-resolver"; -import { isValidDID, parseDID } from "./utils/did"; -import { chainConfigs } from "./iam/chainConfig"; -import { canonizeSig } from "./utils/enrollment"; - -const { id, keccak256, defaultAbiCoder, solidityKeccak256, arrayify, namehash } = utils; - -export type InitializeData = { - did: string | undefined; - connected: boolean; - userClosedModal: boolean; - didDocument: IDIDDocument | null; - identityToken?: string; - realtimeExchangeConnected: boolean; - accountInfo: AccountInfo | undefined; -}; - -export type AccountInfo = { - chainName: string; - chainId: number; - account: string; -}; -export interface IMessage { - id: string; - requester: string; - claimIssuer?: string[]; -} - -export interface IClaimRequest extends IMessage { - token: string; - registrationTypes: RegistrationTypes[]; - subjectAgreement?: string; -} - -export interface IClaimIssuance extends IMessage { - // issuedToken is is only provided in the case of off-chain role - issuedToken?: string; - // onChainProof is only provided in case of on-chain role - onChainProof?: string; - acceptedBy: string; -} - -export interface IClaimRejection extends IMessage { - isRejected: boolean; -} - -export enum ENSNamespaceTypes { - Roles = "roles", - Application = "apps", - Organization = "org", -} - -/** - * Decentralized Identity and Access Management (IAM) Type - */ -export class IAM extends IAMBase { - private _subscriptions: Subscription[] = []; - static async isMetamaskExtensionPresent() { - const provider = (await detectEthereumProvider({ mustBeMetaMask: true })) as - | { - request: any; - } - | undefined; - - const chainId = (await provider?.request({ - method: "eth_chainId", - })) as number | undefined; - - return { isMetamaskPresent: !!provider, chainId }; - } - - // GETTERS - - /** - * Get DID - * - * @returns did string if connected to wallet, if not returns undefined - */ - - getDid(): string | undefined { - return this._did; - } - - /** - * Get signer - * - * @returns JsonRpcSigner if connected to wallet, if not returns undefined - */ - - getSigner(): providers.JsonRpcSigner | Signer | undefined { - return this._signer; - } - - /** - * Get the current initialized provider type - * - * @returns provider type if the session is active if not undefined - */ - getProviderType() { - return this._providerType; - } - - /** - * Initialize connection to wallet - * @description creates web3 provider and establishes secure connection to selected wallet - * @summary if not connected to wallet will show connection modal, but if already connected (data stored in localStorage) will only return initial data without showing modal - * @requires needs to be called before any of other methods - * - * @returns did string, status of connection and info if the user closed the wallet selection modal - */ - async initializeConnection({ - walletProvider = this._providerType, - reinitializeMetamask, - initCacheServer = true, - createDocument = true, - }: { - walletProvider?: WalletProvider; - reinitializeMetamask?: boolean; - initCacheServer?: boolean; - createDocument?: boolean; - } = {}): Promise { - const { privateKey } = this._connectionOptions; - let accountInfo: AccountInfo | undefined = undefined; - - if (!walletProvider && !privateKey) { - throw new Error(ERROR_MESSAGES.WALLET_TYPE_NOT_PROVIDED); - } - if (walletProvider && !Object.values(WalletProvider).includes(walletProvider)) { - throw new Error(ERROR_MESSAGES.WALLET_PROVIDER_NOT_SUPPORTED); - } - try { - accountInfo = await this.init({ - initializeMetamask: reinitializeMetamask, - walletProvider, - }); - - if (initCacheServer) { - await this.connectToCacheServer(); - } - if (createDocument) { - await this.connectToDIDRegistry(); - } - } catch (err) { - if ((err as Error).message === "User closed modal") { - return { - did: undefined, - connected: false, - userClosedModal: true, - didDocument: null, - realtimeExchangeConnected: false, - accountInfo: undefined, - }; - } - throw err as Error; - } - - return { - did: this.getDid(), - connected: this.isConnected() || false, - userClosedModal: false, - didDocument: await this.getDidDocument(), - identityToken: this._identityToken, - realtimeExchangeConnected: Boolean(this._natsConnection), - accountInfo: accountInfo, - }; - } - - /** - * isConnected - * - * @returns info if the connection to wallet/signer is already established - * - */ - isConnected(): boolean { - if ( - this._providerType && - [WalletProvider.EwKeyManager, WalletProvider.WalletConnect].includes(this._providerType) - ) { - return this._walletConnectService.isConnected(); - } - return !!this._address; - } - - // DID DOCUMENT - - /** - * getDidDocument - * - * @returns whole did document if connected, if not returns null - * - */ - async getDidDocument({ - did = this._did, - includeClaims = true, - }: { did?: string; includeClaims?: boolean } | undefined = {}) { - if (this._cacheClient && did) { - try { - const didDoc = await this._cacheClient.getDidDocument({ did, includeClaims }); - return { - ...didDoc, - service: didDoc.service as (IServiceEndpoint & ClaimData)[], - }; - } catch (err) { - if ((err as AxiosError).response?.status === 401) { - throw err; - } - console.log(err); - } - } - - if (did && this._resolver) { - const document = await this._resolver.read(did); - return { - ...document, - service: includeClaims - ? await this.downloadClaims({ - services: document.service && document.service.length > 0 ? document.service : [], - }) - : [], - }; - } - throw new Error(ERROR_MESSAGES.USER_NOT_LOGGED_IN); - } - - /** - * @param options Options to connect with blockchain - * - * @param options.didAttribute Type of document to be updated - * - * @param options.data New attribute value - * @param options.did Asset did to be updated - * @param options.validity Time (s) for the attribute to expire - * - * @description updates did document based on data provided - * @returns true if document is updated successfuly - * - */ - async updateDidDocument(options: { - didAttribute: DIDAttribute; - data: IUpdateData; - did?: string; - validity?: number; - }): Promise { - const { didAttribute, data, validity, did } = options; - - if (!did) { - if (!this._document) { - throw new Error(ERROR_MESSAGES.DID_DOCUMENT_NOT_INITIALIZED); - } - const updated = await this._document.update(didAttribute, data, validity); - return Boolean(updated); - } - - if (!this._didSigner) { - throw new Error(ERROR_MESSAGES.SIGNER_NOT_INITIALIZED); - } - - const updateData: IUpdateData = { - algo: Algorithms.Secp256k1, - encoding: Encoding.HEX, - ...data, - }; - - const operator = new ProxyOperator(this._didSigner, this._registrySetting, addressOf(did)); - const update = await operator.update(did, didAttribute, updateData); - - return Boolean(update); - } - - /** - * revokeDidDocument - * - * @description revokes did document - * @returns information (true/false) if the DID document was revoked - * - */ - async revokeDidDocument(): Promise { - if (this._document) { - await this._document.deactivate(); - return true; - } - throw new Error(ERROR_MESSAGES.DID_DOCUMENT_NOT_INITIALIZED); - } - - /** - * createPublicClaim - * - * @description create a public claim based on data provided - * @returns JWT token of created claim - * - */ - async createPublicClaim({ data, subject }: { data: ClaimData; subject?: string }) { - if (this._userClaims) { - if (subject) { - return this._userClaims.createPublicClaim(data, { subject, issuer: "" }); - } - return this._userClaims.createPublicClaim(data); - } - throw new Error(ERROR_MESSAGES.CLAIMS_NOT_INITIALIZED); - } - - private async getClaimId({ claimData }: { claimData: ClaimData }) { - const { service = [] } = await this.getDidDocument(); - const { id, claimTypeVersion } = - service.find( - ({ profile, claimType, claimTypeVersion }) => - Boolean(profile) || - (claimType === claimData.claimType && claimTypeVersion === claimData.claimTypeVersion), - ) || {}; - - if (claimData.profile && id) { - return id; - } - - if (claimData.claimType && id && claimData.claimTypeVersion === claimTypeVersion) { - return id; - } - return uuid(); - } - - /** - * publishPublicClaim - * - * @description store claim data in ipfs and save url to DID document services - * @returns ulr to ipfs - * - */ - async publishPublicClaim({ token }: { token: string }) { - if (!this._did) { - throw new Error(ERROR_MESSAGES.USER_NOT_LOGGED_IN); - } - if (!this._didSigner) { - throw new Error(ERROR_MESSAGES.SIGNER_NOT_INITIALIZED); - } - if (!this._userClaims) { - throw new Error(ERROR_MESSAGES.CLAIMS_NOT_INITIALIZED); - } - if (!this._document) { - throw new Error(ERROR_MESSAGES.DID_DOCUMENT_NOT_INITIALIZED); - } - - const payload = (await this.decodeJWTToken({ token })) as { - iss: string; - sub: string; - claimData: ClaimData; - }; - const { iss, claimData } = payload; - let sub = payload.sub; - // Initial claim design assumed that role subject is requester because of which - // sub filed was ignored - if (!sub || sub.length === 0 || !isValidDID(sub)) { - sub = this._did; - } - - if (!(await this._userClaims.verifySignature(token, iss))) { - throw new Error("Incorrect signature"); - } - - let document: DIDDocumentFull; - if (sub === this._did) { - document = this._document; - } else if ((await this.getOwnedAssets({})).find((a) => a.document.id === sub)) { - const operator = new ProxyOperator(this._didSigner, this._registrySetting, addressOf(sub)); - document = new DIDDocumentFull(sub, operator); - } else { - throw new Error(ERROR_MESSAGES.CLAIM_PUBLISHER_NOT_REQUESTER); - } - - const url = await this._ipfsStore.save(token); - const claimId = await this.getClaimId({ claimData }); - await document.update(DIDAttribute.ServicePoint, { - type: DIDAttribute.ServicePoint, - value: { - id: claimId, - serviceEndpoint: url, - hash: hashes.SHA256(token), - hashAlg: "SHA256", - }, - }); - - return url; - } - - /** - * createProofClaim - * - * @description creates a proof of a claim - * @returns proof token - * - */ - async createProofClaim({ claimUrl, saltedFields }: { claimUrl: string; saltedFields: ISaltedFields }) { - if (this._userClaims) { - const encryptedSaltedFields: IProofData = {}; - let counter = 0; - Object.entries(saltedFields).forEach(([key, value]) => { - if (counter % 2 === 0) { - encryptedSaltedFields[key] = { - value, - encrypted: true, - }; - } else { - encryptedSaltedFields[key] = { - value, - encrypted: false, - }; - } - counter++; - }); - return this._userClaims?.createProofClaim(claimUrl, encryptedSaltedFields); - } - throw new Error(ERROR_MESSAGES.CLAIMS_NOT_INITIALIZED); - } - - /** - * issuePublicClaim - * - * @description issue a public claim - * @returns return issued token - * - */ - async issuePublicClaim({ token, publicClaim }: { token?: string; publicClaim?: IPublicClaim }) { - if (this._issuerClaims) { - if (publicClaim) { - return this._issuerClaims.issuePublicClaim(publicClaim); - } - if (token) { - return this._issuerClaims.issuePublicClaim(token); - } - throw new Error("unable to issue Public Claim"); - } - throw new Error(ERROR_MESSAGES.CLAIMS_NOT_INITIALIZED); - } - - /** - * verifyPublicClaim - * - * @description verifies issued token of claim - * @returns { Promise } public claim data - * @throws if the proof failed - * - */ - async verifyPublicClaim({ claimUrl }: { claimUrl: string }) { - if (this._verifierClaims) { - return this._verifierClaims.verifyPublicProof(claimUrl); - } - throw new Error(ERROR_MESSAGES.CLAIMS_NOT_INITIALIZED); - } - - /** - * createSelfSignedClaim - * - * @description creates self signed claim and upload the data to ipfs - * - */ - async createSelfSignedClaim({ data, subject }: { data: ClaimData; subject?: string }) { - if (this._userClaims) { - const token = await this.createPublicClaim({ data, subject }); - return this.publishPublicClaim({ token }); - } - throw new Error(ERROR_MESSAGES.CLAIMS_NOT_INITIALIZED); - } - - /** - * getUserClaims - * - * @description get user claims - * - */ - async getUserClaims({ did = this._did }: { did?: string } | undefined = {}) { - const { service } = (await this.getDidDocument({ did })) || {}; - return service; - } - - async decodeJWTToken({ token }: { token: string }) { - if (!this._jwt) { - throw new Error(ERROR_MESSAGES.JWT_NOT_INITIALIZED); - } - return this._jwt.decode(token); - } - - async createIdentityProof() { - if (this._provider) { - const blockNumber = await this._provider.getBlockNumber(); - return this.createPublicClaim({ - data: { - blockNumber, - }, - }); - } - throw new Error(ERROR_MESSAGES.PROVIDER_NOT_INITIALIZED); - } - - /// ROLES - - /** - * setRoleDefinition - * - * @description sets role definition in ENS domain - * @description please use it only when you want to update role definitions for already created role (domain) - * - */ - async setRoleDefinition({ - domain, - data, - }: { - domain: string; - data: IAppDefinition | IOrganizationDefinition | IRoleDefinition; - }) { - // Special case of updating legacy PublicResolver definitions - if (await this.updateLegacyDefinition(domain, data)) { - return; - } - // Standard update - await this.send({ - calls: [this._domainDefinitionTransactionFactory.editDomain({ domain, domainDefinition: data })], - from: await this.getOwner({ namespace: domain }), - }); - } - - /** - * In initial version of Switchboard, role definitions where contained in ENS PublicResolver. - * However, in order for key properties of role definitions to be readable on-chain, a new RoleDefinitionResolver is used. - * This function sets the resolver in the ENS to the new contract for definitions that are pointing to the old contract - * @param domain domain to potentially update - * @param data definition to apply to domain - */ - protected async updateLegacyDefinition( - domain: string, - data: IAppDefinition | IOrganizationDefinition | IRoleDefinition, - ): Promise { - const node = namehash(domain); - const currentResolverAddress = await this._ensRegistry.resolver(node); - const { chainId } = await this._provider.getNetwork(); - const { ensPublicResolverAddress, ensResolverAddress, ensRegistryAddress } = chainConfigs[chainId]; - if (currentResolverAddress === ensPublicResolverAddress) { - const updateResolverTransaction: EncodedCall = { - to: ensRegistryAddress, - data: this._ensRegistry.interface.encodeFunctionData("setResolver", [node, ensResolverAddress]), - }; - // Need to use newRole/newDomain as need to set reverse domain name - const updateDomain = DomainReader.isRoleDefinition(data) - ? this._domainDefinitionTransactionFactory.newRole({ domain, roleDefinition: data }) - : this._domainDefinitionTransactionFactory.newDomain({ domain, domainDefinition: data }); - await this.send({ - calls: [updateResolverTransaction, updateDomain], - from: await this.getOwner({ namespace: domain }), - }); - return true; - } - return false; - } - - /** - * createOrganization - * - * @description creates organization (create subdomain, sets the domain name and sets the role definition to metadata record in ENS Domain) - * @description and sets subdomain for roles and app for org namespace - * - */ - async createOrganization({ - orgName, - namespace, - data, - returnSteps, - }: { - orgName: string; - data: IOrganizationDefinition; - namespace: string; - returnSteps?: boolean; - }) { - const orgDomain = `${orgName}.${namespace}`; - const rolesDomain = `${ENSNamespaceTypes.Roles}.${orgDomain}`; - const appsDomain = `${ENSNamespaceTypes.Application}.${orgDomain}`; - const from = await this.getOwner({ namespace }); - const steps = [ - { - tx: this.createSubdomainTx({ domain: namespace, nodeName: orgName, owner: from }), - info: "Create organization subdomain", - }, - { - tx: this._domainDefinitionTransactionFactory.newDomain({ domain: orgDomain, domainDefinition: data }), - info: "Register reverse name and set definition for organization subdomain", - }, - { - tx: this.createSubdomainTx({ - domain: orgDomain, - nodeName: ENSNamespaceTypes.Roles, - owner: from, - }), - info: "Create roles subdomain for organization", - }, - { - tx: this._domainDefinitionTransactionFactory.setDomainNameTx({ domain: rolesDomain }), - info: "Register reverse name for roles subdomain", - }, - { - tx: this.createSubdomainTx({ - domain: orgDomain, - nodeName: ENSNamespaceTypes.Application, - owner: from, - }), - info: "Create app subdomain for organization", - }, - { - tx: this._domainDefinitionTransactionFactory.setDomainNameTx({ domain: appsDomain }), - info: "Register reverse name for app subdomain", - }, - ].map((step) => ({ - ...step, - next: async () => { - await this.send({ calls: [step.tx], from }); - }, - })); - if (returnSteps) { - return steps; - } - await this.send({ calls: steps.map(({ tx }) => tx), from }); - return []; - } - - /** - * createApp - * - * @description creates role (create subdomain, sets the domain name and sets the role definition to metadata record in ENS Domain) - * @description creates roles subdomain for the app namespace - * - */ - async createApplication({ - appName, - namespace: domain, - data, - returnSteps, - }: { - namespace: string; - appName: string; - data: IAppDefinition; - returnSteps?: boolean; - }) { - const appDomain = `${appName}.${domain}`; - const from = await this.getOwner({ namespace: domain }); - const steps = [ - { - tx: this.createSubdomainTx({ domain, nodeName: appName, owner: from }), - info: "Set subdomain for application", - }, - { - tx: this._domainDefinitionTransactionFactory.newDomain({ domainDefinition: data, domain: appDomain }), - info: "Set name definition for application", - }, - { - tx: this.createSubdomainTx({ - domain: appDomain, - nodeName: ENSNamespaceTypes.Roles, - owner: from, - }), - info: "Create roles subdomain for application", - }, - { - tx: this._domainDefinitionTransactionFactory.setDomainNameTx({ - domain: `${ENSNamespaceTypes.Roles}.${appDomain}`, - }), - info: "Set name for roles subdomain for application", - }, - ].map((step) => ({ - ...step, - next: async () => { - await this.send({ calls: [step.tx], from }); - }, - })); - if (returnSteps) { - return steps; - } - await this.send({ calls: steps.map(({ tx }) => tx), from }); - return []; - } - - /** - * createRole - * - * @description creates role (create subdomain, sets the domain name and sets the role definition to metadata record in ENS Domain) - * @returns information (true/false) if the role was created - * - */ - async createRole({ - roleName, - namespace, - data, - returnSteps, - }: { - roleName: string; - namespace: string; - data: IRoleDefinition; - returnSteps?: boolean; - }) { - const newDomain = `${roleName}.${namespace}`; - const from = await this.getOwner({ namespace }); - const steps = [ - { - tx: this.createSubdomainTx({ domain: namespace, nodeName: roleName, owner: from }), - info: "Create subdomain for role", - }, - { - tx: this._domainDefinitionTransactionFactory.newRole({ domain: newDomain, roleDefinition: data }), - info: "Set name and definition for role", - }, - ].map((step) => ({ - ...step, - next: async () => { - await this.send({ calls: [step.tx], from }); - }, - })); - if (returnSteps) { - return steps; - } - await this.send({ calls: steps.map(({ tx }) => tx), from }); - return []; - } - - /** - * changeOrgOwnership - * - * @description change owner ship of org subdomain and all org owned roles subdomains - * @returns return array of steps needed to change ownership - * - */ - async changeOrgOwnership({ - namespace, - newOwner, - returnSteps = false, - }: { - namespace: string; - newOwner: string; - returnSteps?: boolean; - }) { - newOwner = parseDID(newOwner); - const orgNamespaces = [ - `${ENSNamespaceTypes.Roles}.${namespace}`, - `${ENSNamespaceTypes.Application}.${namespace}`, - namespace, - ]; - const { alreadyFinished, changeOwnerNamespaces, notOwnedNamespaces } = await this.validateChangeOwnership({ - newOwner, - namespaces: orgNamespaces, - }); - - if (notOwnedNamespaces.length > 0) { - throw new ChangeOwnershipNotPossibleError({ namespace, notOwnedNamespaces }); - } - const from = await this.getOwner({ namespace }); - - const apps = this._cacheClient - ? await this.getAppsByOrgNamespace({ namespace }) - : await this.getSubdomains({ - domain: `${ENSNamespaceTypes.Application}.${namespace}`, - }); - if (apps && apps.length > 0) { - throw new Error("You are not able to change ownership of organization with registered apps"); - } - - if (alreadyFinished.length > 0) { - console.log(`Already changed ownership of ${alreadyFinished.join(", ")}`); - } - - const steps = changeOwnerNamespaces.map((namespace) => { - const tx = this.changeDomainOwnerTx({ newOwner, namespace }); - return { - tx, - next: async ({ retryCheck }: { retryCheck?: boolean } = {}) => { - if (retryCheck) { - const owner = await this.getOwner({ namespace }); - if (owner === newOwner) return; - } - return this.send({ calls: [tx], from }); - }, - info: `Changing ownership of ${namespace}`, - }; - }); - - if (returnSteps) { - return steps; - } - await this.send({ calls: steps.map(({ tx }) => tx), from }); - return []; - } - - /** - * changeAppOwnership - * - * @description change owner ship of app subdomain and all app owned subdomains - * @returns return array of steps needed to change ownership - * - */ - async changeAppOwnership({ - namespace, - newOwner, - returnSteps, - }: { - namespace: string; - newOwner: string; - returnSteps?: boolean; - }) { - newOwner = parseDID(newOwner); - const appNamespaces = [`${ENSNamespaceTypes.Roles}.${namespace}`, namespace]; - - const { alreadyFinished, changeOwnerNamespaces, notOwnedNamespaces } = await this.validateChangeOwnership({ - newOwner, - namespaces: appNamespaces, - }); - - if (notOwnedNamespaces.length > 0) { - throw new ChangeOwnershipNotPossibleError({ namespace, notOwnedNamespaces }); - } - const from = await this.getOwner({ namespace }); - - if (alreadyFinished.length > 0) { - console.log(`Already changed ownership of ${alreadyFinished.join(", ")}`); - } - - const steps = changeOwnerNamespaces.map((namespace) => { - const tx = this.changeDomainOwnerTx({ newOwner, namespace }); - return { - tx, - next: async ({ retryCheck }: { retryCheck?: boolean } = {}) => { - if (retryCheck) { - const owner = await this.getOwner({ namespace }); - if (owner === newOwner) return; - } - return this.send({ calls: [tx], from }); - }, - info: `Changing ownership of ${namespace}`, - }; - }); - - if (returnSteps) { - return steps; - } - await this.send({ calls: steps.map(({ tx }) => tx), from }); - return []; - } - - /** - * changeRoleOwnership - * - * @description change ownership of role subdomain - * - */ - async changeRoleOwnership({ namespace, newOwner }: { namespace: string; newOwner: string }) { - newOwner = parseDID(newOwner); - const notOwnedNamespaces = await this.validateOwnership({ - namespace, - type: ENSNamespaceTypes.Roles, - }); - if (notOwnedNamespaces.length > 0) { - throw new ChangeOwnershipNotPossibleError({ namespace, notOwnedNamespaces }); - } - const from = await this.getOwner({ namespace }); - await this.send({ - calls: [this.changeDomainOwnerTx({ namespace, newOwner })], - from, - }); - } - - /** - * deleteOrganization - * - * @description delete organization and roles - * - */ - async deleteOrganization({ namespace, returnSteps }: { namespace: string; returnSteps?: boolean }) { - const apps = this._cacheClient - ? await this.getAppsByOrgNamespace({ namespace }) - : await this.getSubdomains({ - domain: `${ENSNamespaceTypes.Application}.${namespace}`, - }); - if (apps && apps.length > 0) { - throw new Error(ERROR_MESSAGES.ORG_WITH_APPS); - } - const from = await this.getOwner({ namespace }); - - const roles = this._cacheClient - ? await this._cacheClient.getOrganizationRoles({ namespace }) - : await this.getSubdomains({ domain: `${ENSNamespaceTypes.Roles}.${namespace}` }); - - if (roles && roles.length > 0) { - throw new Error(ERROR_MESSAGES.ORG_WITH_ROLES); - } - - const orgNamespaces = [ - `${ENSNamespaceTypes.Roles}.${namespace}`, - `${ENSNamespaceTypes.Application}.${namespace}`, - namespace, - ]; - - const { alreadyFinished, namespacesToDelete, notOwnedNamespaces } = await this.validateDeletePossibility({ - namespaces: orgNamespaces, - }); - - if (notOwnedNamespaces.length > 0) { - throw new DeletingNamespaceNotPossibleError({ namespace, notOwnedNamespaces }); - } - - if (alreadyFinished.length > 0) { - console.log(`Already deleted: ${alreadyFinished.join(", ")}`); - } - - const steps = namespacesToDelete.map((namespace) => { - const tx = this.deleteDomainTx({ namespace }); - return { - tx, - next: async ({ retryCheck }: { retryCheck?: boolean } = {}) => { - if (retryCheck) { - const owner = await this.getOwner({ namespace }); - if (owner === emptyAddress) return; - } - return this.send({ calls: [tx], from }); - }, - info: `Deleting ${namespace}`, - }; - }); - - if (returnSteps) { - return steps; - } - await this.send({ calls: steps.map(({ tx }) => tx), from }); - return []; - } - - /** - * deleteApplication - * - * @description delete application and roles - * - */ - async deleteApplication({ namespace, returnSteps }: { namespace: string; returnSteps?: boolean }) { - const from = await this.getOwner({ namespace }); - - const roles = this._cacheClient - ? await this._cacheClient.getApplicationRoles({ namespace }) - : await this.getSubdomains({ domain: `${ENSNamespaceTypes.Roles}.${namespace}` }); - - if (roles && roles.length > 0) { - throw new Error(ERROR_MESSAGES.APP_WITH_ROLES); - } - - const appNamespaces = [`${ENSNamespaceTypes.Roles}.${namespace}`, namespace]; - - const { alreadyFinished, namespacesToDelete, notOwnedNamespaces } = await this.validateDeletePossibility({ - namespaces: appNamespaces, - }); - - if (notOwnedNamespaces.length > 0) { - throw new DeletingNamespaceNotPossibleError({ namespace, notOwnedNamespaces }); - } - - if (alreadyFinished.length > 0) { - console.log(`Already deleted: ${alreadyFinished.join(", ")}`); - } - - const steps = namespacesToDelete.map((namespace) => { - const tx = this.deleteDomainTx({ namespace }); - return { - tx, - next: async ({ retryCheck }: { retryCheck?: boolean } = {}) => { - if (retryCheck) { - const owner = await this.getOwner({ namespace }); - if (owner === emptyAddress) return; - } - return this.send({ calls: [tx], from }); - }, - info: `Deleting ${namespace}`, - }; - }); - - if (returnSteps) { - return steps; - } - await this.send({ calls: steps.map(({ tx }) => tx), from }); - return []; - } - - /** - * deleteRole - * - * @description delete role - * - */ - async deleteRole({ namespace }: { namespace: string }) { - const notOwnedNamespaces = await this.validateOwnership({ - namespace, - type: ENSNamespaceTypes.Roles, - }); - if (notOwnedNamespaces.length > 0) { - throw new DeletingNamespaceNotPossibleError({ namespace, notOwnedNamespaces }); - } - await this.send({ - calls: [this.deleteDomainTx({ namespace })], - from: await this.getOwner({ namespace }), - }); - } - - /** - * getRoleDefinition - * - * @description get role definition form ens domain metadata record - * @returns metadata string or empty string when there is no metadata - * - */ - async getDefinition({ - type, - namespace, - }: { - type: ENSNamespaceTypes; - namespace: string; - }): Promise { - if (this._cacheClient && type) { - if (type === ENSNamespaceTypes.Roles) { - return this._cacheClient.getRoleDefinition({ namespace }); - } - if (type === ENSNamespaceTypes.Application) { - return this._cacheClient.getAppDefinition({ namespace }); - } - if (type === ENSNamespaceTypes.Organization) { - return this._cacheClient.getOrgDefinition({ namespace }); - } - throw new ENSTypeNotSupportedError(); - } - if (this._domainDefinitionReader) { - const roleHash = namehash(namespace); - return await this._domainDefinitionReader.read({ node: roleHash }); - } - throw new ENSResolverNotInitializedError(); - } - - /** - * getRolesByNamespace - * - * @description get all subdomains for certain domain - * @returns array of subdomains or empty array when there is no subdomains - * - */ - getRolesByNamespace({ - parentType, - namespace, - }: { - parentType: ENSNamespaceTypes.Application | ENSNamespaceTypes.Organization; - namespace: string; - }) { - if (!this._cacheClient) { - throw new CacheClientNotProvidedError(); - } - if (parentType === ENSNamespaceTypes.Organization) { - return this._cacheClient.getOrganizationRoles({ namespace }); - } - if (parentType === ENSNamespaceTypes.Application) { - return this._cacheClient.getApplicationRoles({ namespace }); - } - throw new ENSTypeNotSupportedError(); - } - - /** - * getENSTypesByOwner - */ - getENSTypesByOwner({ - type, - owner, - excludeSubOrgs = false, - }: { - type: ENSNamespaceTypes; - owner: string; - excludeSubOrgs?: boolean; - }) { - owner = parseDID(owner); - if (!this._cacheClient) { - throw new CacheClientNotProvidedError(); - } - if (type === ENSNamespaceTypes.Organization) { - return this._cacheClient.getOrganizationsByOwner({ owner, excludeSubOrgs }); - } - if (type === ENSNamespaceTypes.Application) { - return this._cacheClient.getApplicationsByOwner({ owner }); - } - if (type === ENSNamespaceTypes.Roles) { - return this._cacheClient.getRolesByOwner({ owner }); - } - throw new ENSTypeNotSupportedError(); - } - - /** - * getENSTypesBySearchPhrase - */ - getENSTypesBySearchPhrase({ types, search }: { types?: ("App" | "Org" | "Role")[]; search: string }) { - if (!this._cacheClient) { - throw new CacheClientNotProvidedError(); - } - - return this._cacheClient.getNamespaceBySearchPhrase({ search, types }); - } - - /** - * getENSTypesByOwner - * - * @description get all applications for organization namespace - * @returns array of subdomains or empty array when there is no subdomains - * - */ - getAppsByOrgNamespace({ namespace }: { namespace: string }) { - if (!this._cacheClient) { - throw new CacheClientNotProvidedError(); - } - return this._cacheClient.getApplicationsByOrganization({ namespace }); - } - - /** - * getSubOrgsByOrgNamespace - * - * @description get all sub organizations for organization namespace - * @returns array of subdomains or empty array when there is no subdomains - * - */ - getSubOrgsByOrgNamespace({ namespace }: { namespace: string }) { - if (!this._cacheClient) { - throw new CacheClientNotProvidedError(); - } - return this._cacheClient.getSubOrganizationsByOrganization({ namespace }); - } - - /** - * getOrgHierarchy - * - * @description get all hierarchy of an organization (20 levels deep) - * @returns organization with all nested subOrgs - * - */ - async getOrgHierarchy({ namespace }: { namespace: string }): Promise { - if (!this._cacheClient) { - throw new CacheClientNotProvidedError(); - } - const org = await this._cacheClient.getOrgHierarchy({ namespace }); - [org, ...(org.subOrgs || []), ...(org.apps || []), ...(org.roles || [])].forEach( - (domain) => (domain.isOwnedByCurrentUser = domain.owner === this.address), - ); - return org; - } - - /** - * getRoleDIDs - * - * @description get all users did which have certain role - * @returns array of did's - * - */ - getRoleDIDs({ namespace }: { namespace: string }) { - if (!this._cacheClient) { - throw new CacheClientNotProvidedError(); - } - return this._cacheClient.getDIDsForRole({ namespace }); - } - - /** - * getSubdomains - * - * @description get all subdomains for certain domain - * @returns array of subdomains or empty array when there is no subdomains - * - */ - async getSubdomains({ - domain, - mode = "FIRSTLEVEL", - }: { - domain: string; - mode?: "ALL" | "FIRSTLEVEL"; - }): Promise { - return this._domainHierarchy.getSubdomainsUsingResolver({ - domain, - mode, - }); - } - - /** - * checkExistenceOfDomain - * - * @description check existence of domain in ENS registry - * @returns true or false whatever the domain is present - * - */ - async checkExistenceOfDomain({ domain }: { domain: string }) { - if (this._ensRegistry) { - const domainHash = namehash(domain); - const [exists, isOwned] = await Promise.all([ - this._ensRegistry.recordExists(domainHash), - (async () => { - const owner = await this._ensRegistry?.owner(domainHash); - return owner !== emptyAddress; - })(), - ]); - return exists && isOwned; - } - throw new ENSRegistryNotInitializedError(); - } - - /** - * isOwner - * - * @description check ownership of the domain - * @default if user is not specified it will check the current logged user - * @returns true or false whatever the passed is user is a owner of domain - * - */ - async isOwner({ domain, user = this._address }: { domain: string; user?: string }) { - if (this._ensRegistry) { - const domainHash = namehash(domain); - const owner = await this._ensRegistry.owner(domainHash); - return owner === user; - } - throw new ENSRegistryNotInitializedError(); - } - - /** - * validateOwnership - * - * @description check ownership of the domain and subdomains of org, app or role - * @returns true or false whatever the passed is user is a owner of org, app or role - * - */ - async validateOwnership({ namespace, type }: { namespace: string; type: ENSNamespaceTypes }) { - return this.nonOwnedNodesOf({ namespace, type, owner: this._address as string }); - } - - protected async validateChangeOwnership({ namespaces, newOwner }: { namespaces: string[]; newOwner: string }) { - const namespacesOwners = await this.namespacesWithRelations(namespaces); - return namespacesOwners.reduce( - (acc, { namespace, owner }) => { - if (owner === newOwner) { - acc.alreadyFinished.push(namespace); - return acc; - } - if (owner === emptyAddress || owner === this._address) { - acc.changeOwnerNamespaces.push(namespace); - return acc; - } - acc.notOwnedNamespaces.push(namespace); - return acc; - }, - { - notOwnedNamespaces: [], - alreadyFinished: [], - changeOwnerNamespaces: [], - } as { - notOwnedNamespaces: string[]; - alreadyFinished: string[]; - changeOwnerNamespaces: string[]; - }, - ); - } - - protected async validateDeletePossibility({ namespaces }: { namespaces: string[] }) { - const namespacesOwners = await this.namespacesWithRelations(namespaces); - return namespacesOwners.reduce( - (acc, { namespace, owner }) => { - if (owner === emptyAddress) { - acc.alreadyFinished.push(namespace); - return acc; - } - if (owner === this._address) { - acc.namespacesToDelete.push(namespace); - return acc; - } - acc.notOwnedNamespaces.push(namespace); - return acc; - }, - { - notOwnedNamespaces: [], - alreadyFinished: [], - namespacesToDelete: [], - } as { - notOwnedNamespaces: string[]; - alreadyFinished: string[]; - namespacesToDelete: string[]; - }, - ); - } - - private async verifyEnrolmentPrerequisites({ subject, role }: { subject: string; role: string }) { - const roleDefinition = await this.getDefinition({ - type: ENSNamespaceTypes.Roles, - namespace: role, - }); - - if (!roleDefinition) { - throw new Error(ERROR_MESSAGES.ROLE_NOT_EXISTS); - } - - const { enrolmentPreconditions } = roleDefinition as IRoleDefinition; - - if (!enrolmentPreconditions || enrolmentPreconditions.length === 0) return; - - const enroledRoles = new Set( - (await this.getClaimsBySubject({ did: subject, isAccepted: true })).map(({ claimType }) => claimType), - ); - const requiredRoles = new Set( - enrolmentPreconditions - .filter(({ type }) => type === PreconditionType.Role) - .map(({ conditions }) => conditions) - .reduce((all, cur) => all.concat(cur), []), - ); - for (const role in requiredRoles) { - if (!enroledRoles.has(role)) { - throw new Error(ERROR_MESSAGES.ROLE_PREREQUISITES_NOT_MET); - } - } - } - - private async approveRolePublishing({ - subject, - role, - version, - }: { - subject: string; - role: string; - version: number; - }) { - if (!this._signer) { - throw new Error(ERROR_MESSAGES.SIGNER_NOT_INITIALIZED); - } - - const erc712_type_hash = id( - "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)", - ); - const agreement_type_hash = id("Agreement(address subject,bytes32 role,uint256 version)"); - - const domainSeparator = keccak256( - defaultAbiCoder.encode( - ["bytes32", "bytes32", "bytes32", "uint256", "address"], - [ - erc712_type_hash, - id("Claim Manager"), - id("1.0"), - (await this._provider.getNetwork()).chainId, - this._claimManager.address, - ], - ), - ); - - const messageId = Buffer.from(typedMsgPrefix, "hex"); - - const agreementHash = solidityKeccak256( - ["bytes", "bytes32", "bytes32"], - [ - messageId, - domainSeparator, - keccak256( - defaultAbiCoder.encode( - ["bytes32", "address", "bytes32", "uint256"], - [agreement_type_hash, addressOf(subject), namehash(role), version], - ), - ), - ], - ); - - return canonizeSig(await this._signer.signMessage(arrayify(agreementHash))); - } - - private async createOnChainProof(role: string, version: number, expiry: number, subject: string): Promise { - if (!this._did) { - throw new Error(ERROR_MESSAGES.USER_NOT_LOGGED_IN); - } - if (!this._signer) { - throw new Error(ERROR_MESSAGES.SIGNER_NOT_INITIALIZED); - } - const messageId = Buffer.from(typedMsgPrefix, "hex"); - - const domainSeparator = utils.keccak256( - defaultAbiCoder.encode( - ["bytes32", "bytes32", "bytes32", "uint256", "address"], - [ - erc712_type_hash, - utils.id("Claim Manager"), - utils.id("1.0"), - (await this._provider.getNetwork()).chainId, - this._claimManager.address, - ], - ), - ); - - const proofHash = solidityKeccak256( - ["bytes", "bytes32", "bytes32"], - [ - messageId, - domainSeparator, - utils.keccak256( - defaultAbiCoder.encode( - ["bytes32", "address", "bytes32", "uint", "uint", "address"], - [proof_type_hash, addressOf(subject), namehash(role), version, expiry, addressOf(this._did)], - ), - ), - ], - ); - - return canonizeSig(await this._signer.signMessage(arrayify(proofHash))); - } - - async createClaimRequest({ - claim, - subject, - registrationTypes = [RegistrationTypes.OffChain], - }: { - claim: { claimType: string; claimTypeVersion: number; fields: { key: string; value: string | number }[] }; - subject?: string; - registrationTypes?: RegistrationTypes[]; - }) { - if (!this._did) { - throw new Error(ERROR_MESSAGES.USER_NOT_LOGGED_IN); - } - if (!subject) { - subject = this._did; - } - - const { claimType: role, claimTypeVersion: version } = claim; - const token = await this.createPublicClaim({ data: claim, subject }); - - await this.verifyEnrolmentPrerequisites({ subject, role }); - - // temporarily, until claimIssuer is not removed from Claim entity - const issuer = [`did:${Methods.Erc1056}:${emptyAddress}`]; - - const message: IClaimRequest = { - id: uuid(), - token, - claimIssuer: issuer, - requester: this._did, - registrationTypes, - }; - - if (registrationTypes.includes(RegistrationTypes.OnChain)) { - if (!version) { - throw new Error(ERROR_MESSAGES.ONCHAIN_ROLE_VERSION_NOT_SPECIFIED); - } - message.subjectAgreement = await this.approveRolePublishing({ subject, role, version }); - } - - if (this._natsConnection) { - issuer.map((issuerDID) => - this._natsConnection?.publish(`${issuerDID}.${NATS_EXCHANGE_TOPIC}`, this._jsonCodec?.encode(message)), - ); - } else if (this._cacheClient) { - await this._cacheClient.requestClaim({ did: subject, message }); - } else { - throw new NATSConnectionNotEstablishedError(); - } - } - - async issueClaimRequest({ - requester, - token, - id, - subjectAgreement, - registrationTypes, - }: { - requester: string; - token: string; - id: string; - subjectAgreement: string; - registrationTypes: RegistrationTypes[]; - }) { - if (!this._did) { - throw new Error(ERROR_MESSAGES.USER_NOT_LOGGED_IN); - } - if (!this._jwt) { - throw new Error(ERROR_MESSAGES.JWT_NOT_INITIALIZED); - } - if (!this._signer) { - throw new Error(ERROR_MESSAGES.SIGNER_NOT_INITIALIZED); - } - - const { claimData, sub } = this._jwt.decode(token) as { - claimData: { claimType: string; claimTypeVersion: number; expiry: number }; - sub: string; - }; - - await this.verifyEnrolmentPrerequisites({ subject: sub, role: claimData.claimType }); - - const message: IClaimIssuance = { - id, - requester, - claimIssuer: [this._did], - acceptedBy: this._did, - }; - if (registrationTypes.includes(RegistrationTypes.OffChain)) { - const publicClaim: IPublicClaim = { - did: sub, - signer: this._did, - claimData, - }; - message.issuedToken = await this.issuePublicClaim({ - publicClaim, - }); - } - if (registrationTypes.includes(RegistrationTypes.OnChain)) { - const { claimType: role, claimTypeVersion: version } = claimData; - const expiry = claimData.expiry === undefined ? defaultClaimExpiry : claimData.expiry; - const onChainProof = await this.createOnChainProof(role, version, expiry, sub); - await ( - await this._claimManager.register( - addressOf(sub), - namehash(role), - version, - expiry, - addressOf(this._did), - subjectAgreement, - onChainProof, - ) - ).wait(); - message.onChainProof = onChainProof; - } - - if (this._natsConnection) { - const dataToSend = this._jsonCodec?.encode(message); - this._natsConnection.publish(`${requester}.${NATS_EXCHANGE_TOPIC}`, dataToSend); - } else if (this._cacheClient) { - return this._cacheClient.issueClaim({ did: this._did, message }); - } else { - throw new NATSConnectionNotEstablishedError(); - } - } - - async rejectClaimRequest({ id, requesterDID }: { id: string; requesterDID: string }) { - if (!this._did) { - throw new Error(ERROR_MESSAGES.USER_NOT_LOGGED_IN); - } - - const preparedData: IClaimRejection = { - id, - requester: requesterDID, - claimIssuer: [this._did], - isRejected: true, - }; - - if (!this._natsConnection) { - if (this._cacheClient) { - return this._cacheClient.rejectClaim({ did: this._did, message: preparedData }); - } - throw new NATSConnectionNotEstablishedError(); - } - - const dataToSend = this._jsonCodec?.encode(preparedData); - this._natsConnection.publish(`${requesterDID}.${NATS_EXCHANGE_TOPIC}`, dataToSend); - } - - async deleteClaim({ id }: { id: string }) { - if (this._cacheClient) { - await this._cacheClient.deleteClaim({ claimId: id }); - } else { - throw new CacheClientNotProvidedError(); - } - } - - async registrationTypesOfRoles(roles: string[]): Promise>> { - const types: Record> = roles.reduce( - (acc, role) => ({ ...acc, [role]: new Set() }), - {}, - ); - for await (const role of roles) { - const def = await this.getDefinition({ type: ENSNamespaceTypes.Roles, namespace: role }); - if (!DomainReader.isRoleDefinition(def)) { - continue; - } - const resolver = await this._ensRegistry.resolver(namehash(role)); - const { chainId } = await this._provider.getNetwork(); - const { ensResolverAddress, ensPublicResolverAddress } = chainConfigs[chainId]; - if (resolver === ensResolverAddress) { - types[role].add(RegistrationTypes.OnChain); - types[role].add(RegistrationTypes.OffChain); - } else if (resolver === ensPublicResolverAddress) { - types[role].add(RegistrationTypes.OffChain); - } - } - return types; - } - - async subscribeTo({ - subject = `${this._did}.${NATS_EXCHANGE_TOPIC}`, - messageHandler, - }: { - subject?: string; - messageHandler: (data: IMessage) => void; - }) { - if (!this._natsConnection) { - return; - } - const subscription = this._natsConnection.subscribe(subject, { - callback: (err, msg) => { - if (err) { - console.error(`Nats error:${err.message}`); - return; - } - const decodedMessage = this._jsonCodec?.decode(msg.data) as IMessage; - messageHandler(decodedMessage); - }, - }); - this._subscriptions.push(subscription); - return subscription.getID(); - } - - async unsubscribeFrom(subscriptionId: number) { - const i = this._subscriptions.findIndex((s) => s.getID() === subscriptionId); - if (i !== -1) { - this._subscriptions.splice(i, 1)[0].unsubscribe(); - } - } - - // CLAIMS - - async getClaimsBySubjects(subjects: string[]) { - return this._cacheClient.getClaimsBySubjects(subjects); - } - - /** - * @description - Returns claims for given requester. Allows filtering by status and parent namespace - */ - async getClaimsByRequester({ - did, - isAccepted, - parentNamespace, - }: { - did: string; - isAccepted?: boolean; - parentNamespace?: string; - }) { - if (!this._cacheClient) { - throw new CacheClientNotProvidedError(); - } - return this._cacheClient.getClaimsByRequester({ did, isAccepted, parentNamespace }); - } - - /** - * @description - Returns claims for given issuer. Allows filtering by status and parent namespace - */ - async getClaimsByIssuer({ - did, - isAccepted, - parentNamespace, - }: { - did: string; - isAccepted?: boolean; - parentNamespace?: string; - }) { - if (!this._cacheClient) { - throw new CacheClientNotProvidedError(); - } - return this._cacheClient.getClaimsByIssuer({ did, isAccepted, parentNamespace }); - } - - /** - * @description - Returns claims for given subject. Allows filtering by status and parent namespace - */ - async getClaimsBySubject({ - did, - isAccepted, - parentNamespace, - }: { - did: string; - isAccepted?: boolean; - parentNamespace?: string; - }) { - if (!this._cacheClient) { - throw new CacheClientNotProvidedError(); - } - return this._cacheClient.getClaimsBySubject({ did, isAccepted, parentNamespace }); - } - - protected async nonOwnedNodesOf({ - namespace, - type, - owner, - }: { - namespace: string; - type: ENSNamespaceTypes; - owner: string; - }) { - if (![ENSNamespaceTypes.Roles, ENSNamespaceTypes.Application, ENSNamespaceTypes.Organization].includes(type)) { - throw new Error(ERROR_MESSAGES.ENS_TYPE_NOT_SUPPORTED); - } - if (this._address) { - const namespacesToCheck = - type === ENSNamespaceTypes.Roles - ? [namespace] - : type === ENSNamespaceTypes.Application - ? [namespace, ENSNamespaceTypes.Application] - : [namespace, ENSNamespaceTypes.Application, ENSNamespaceTypes.Organization]; - return Promise.all(namespacesToCheck.map((ns) => this.getOwner({ namespace: ns }))).then((owners) => - owners.filter((o) => ![owner, emptyAddress].includes(o)), - ); - } - throw new Error(ERROR_MESSAGES.USER_NOT_LOGGED_IN); - } - - /** - * @description Collects all namespaces related data. Currently its includes only owner - * @param namespaces - */ - async namespacesWithRelations(namespaces: string[]) { - return Promise.all( - namespaces.map(async (namespace) => { - const owner = await this.getOwner({ namespace }); - return { - namespace, - owner, - }; - }), - ); - } - - // ### ASSETS ### - public async registerAsset(): Promise { - if (!this._address) { - throw new Error(ERROR_MESSAGES.USER_NOT_LOGGED_IN); - } - try { - const waitForIdentityCreated = new Promise((resolve) => - this._assetManager.once( - this._assetManager.filters.IdentityCreated(null, this._address as string, null), - (identity) => resolve(identity), - ), - ); - - await (await this._assetManager.createIdentity(this._address)).wait(); - - const identity = await waitForIdentityCreated; - - if (this._cacheClient) { - let asset = await this.getAssetById({ id: `did:ethr:${identity}` }); - let loops = 0; - /* - * we need to wait until cache server will resolve assets did document - * which is taking some time - */ - while (!asset && loops < 20) { - asset = await this.getAssetById({ id: `did:${Methods.Erc1056}:${identity}` }); - await new Promise((resolve) => setTimeout(resolve, 1000)); - loops++; - } - } - return identity; - } catch (err) { - throw err as Error; - } - } - - public async offerAsset({ assetDID, offerTo }: { assetDID: string; offerTo: string }) { - if (!this._address) { - throw new Error(ERROR_MESSAGES.USER_NOT_LOGGED_IN); - } - const [, , assetContractAddress] = assetDID.split(":"); - const tx = this.offerAssetTx({ assetContractAddress, offerTo }); - await this.send({ - calls: [tx], - from: this._address, - }); - } - - public async acceptAssetOffer({ assetDID }: { assetDID: string }) { - if (!this._address) { - throw new Error(ERROR_MESSAGES.USER_NOT_LOGGED_IN); - } - const [, , assetContractAddress] = assetDID.split(":"); - const tx = this.acceptOfferTx({ assetContractAddress }); - await this.send({ - calls: [tx], - from: this._address, - }); - } - - public async rejectAssetOffer({ assetDID }: { assetDID: string }) { - if (!this._address) { - throw new Error(ERROR_MESSAGES.USER_NOT_LOGGED_IN); - } - const [, , assetContractAddress] = assetDID.split(":"); - const tx = this.rejectOfferTx({ assetContractAddress }); - await this.send({ - calls: [tx], - from: this._address, - }); - } - - public async cancelAssetOffer({ assetDID }: { assetDID: string }) { - if (!this._address) { - throw new Error(ERROR_MESSAGES.USER_NOT_LOGGED_IN); - } - const [, , assetContractAddress] = assetDID.split(":"); - const tx = this.cancelOfferTx({ assetContractAddress }); - await this.send({ calls: [tx], from: this._address }); - } - - public async getOwnedAssets({ did = this._did }: { did?: string } = {}) { - if (!did) { - throw new Error(ERROR_MESSAGES.USER_NOT_LOGGED_IN); - } - return this._cacheClient.getOwnedAssets({ did }); - } - - public async getOfferedAssets({ did = this._did }: { did?: string } = {}) { - if (!did) { - throw new Error(ERROR_MESSAGES.USER_NOT_LOGGED_IN); - } - return this._cacheClient.getOfferedAssets({ did }); - } - - public async getAssetById({ id }: { id: string }) { - if (this._cacheClient) { - return this._cacheClient.getAssetById({ id }); - } - throw new Error(ERROR_MESSAGES.CACHE_CLIENT_NOT_PROVIDED); - } - - public async getPreviouslyOwnedAssets({ owner }: { owner: string }) { - if (this._cacheClient) { - return this._cacheClient.getPreviouslyOwnedAssets({ owner }); - } - throw new Error(ERROR_MESSAGES.CACHE_CLIENT_NOT_PROVIDED); - } - - public async getAssetHistory({ - id, - ...query - }: { - id: string; - order?: Order; - take?: number; - skip?: number; - type?: AssetHistoryEventType; - }) { - if (this._cacheClient) { - return this._cacheClient.getAssetHistory({ id, ...query }); - } - throw new Error(ERROR_MESSAGES.CACHE_CLIENT_NOT_PROVIDED); - } -} diff --git a/src/iam/chainConfig.ts b/src/iam/chainConfig.ts deleted file mode 100644 index 27d50c50..00000000 --- a/src/iam/chainConfig.ts +++ /dev/null @@ -1,89 +0,0 @@ -import { VoltaAddress1056 } from "@ew-did-registry/did-ethr-resolver"; -import { - VOLTA_DOMAIN_NOTIFER_ADDRESS, - VOLTA_ENS_REGISTRY_ADDRESS, - VOLTA_PUBLIC_RESOLVER_ADDRESS, - VOLTA_RESOLVER_V1_ADDRESS, - VOLTA_IDENTITY_MANAGER_ADDRESS, - VOLTA_CLAIM_MANAGER_ADDRESS, - VOLTA_STAKING_POOL_FACTORY_ADDRESS, -} from "@energyweb/iam-contracts"; -import { CacheServerClientOptions } from "../cacheServerClient/cacheServerClient"; -import { MessagingMethod } from "../utils/constants"; - -const VOLTA_CHAIN_ID = 73799; -export interface ChainConfig { - chainName: string; - rpcUrl: string; - ensRegistryAddress: string; - ensResolverAddress: string; - ensPublicResolverAddress?: string; - domainNotifierAddress: string; - assetManagerAddress: string; - didContractAddress: string; - claimManagerAddress: string; - stakingPoolFactoryAddress: string; -} - -export interface MessagingOptions { - messagingMethod: MessagingMethod; - natsServerUrl: string; -} - -/** - * Set of parameters to configure connection to chain with id received from wallet. - * If configuration for some chain is missing or should be reconfigured use `setChainConfig` before class instantiation - */ -export const chainConfigs: Record = { - [VOLTA_CHAIN_ID]: { - chainName: "Energy Web Volta Testnet", - rpcUrl: "https://volta-rpc.energyweb.org", - ensRegistryAddress: VOLTA_ENS_REGISTRY_ADDRESS, - ensResolverAddress: VOLTA_RESOLVER_V1_ADDRESS, - ensPublicResolverAddress: VOLTA_PUBLIC_RESOLVER_ADDRESS, - domainNotifierAddress: VOLTA_DOMAIN_NOTIFER_ADDRESS, - assetManagerAddress: VOLTA_IDENTITY_MANAGER_ADDRESS, - didContractAddress: VoltaAddress1056, - claimManagerAddress: VOLTA_CLAIM_MANAGER_ADDRESS, - stakingPoolFactoryAddress: VOLTA_STAKING_POOL_FACTORY_ADDRESS, - }, -}; - -export const cacheServerClientOptions: Record = { - [VOLTA_CHAIN_ID]: { - url: "https://volta-identitycache.energyweb.org/v1", - cacheServerSupportsAuth: true, - }, -}; - -export const messagingOptions: Record = { - [VOLTA_CHAIN_ID]: { - messagingMethod: MessagingMethod.Nats, - natsServerUrl: "https://volta-identityevents.energyweb.org/", - }, -}; - -/** - * Used to override existing chain configuration or add a missing one - * Configuration must be set before constructing `IAM` - */ -export const setChainConfig = (chainId: number, config: Partial) => { - chainConfigs[chainId] = { ...chainConfigs[chainId], ...config }; -}; - -/** - * Used to override existing cache server configuration or add a missing one - * Configuration must be set before constructing `IAM` - */ -export const setCacheClientOptions = (chainId: number, options: Partial) => { - cacheServerClientOptions[chainId] = { ...cacheServerClientOptions[chainId], ...options }; -}; - -/** - * Used to override existing messaging configuration or add a missing one - * Configuration must be set before constructing `IAM` - */ - -export const setMessagingOptions = (chainId: number, options: Partial) => { - messagingOptions[chainId] = { ...messagingOptions[chainId], ...options }; -}; diff --git a/src/iam/iam-base.ts b/src/iam/iam-base.ts deleted file mode 100644 index a7b0b002..00000000 --- a/src/iam/iam-base.ts +++ /dev/null @@ -1,711 +0,0 @@ -import { providers, Signer, utils, Wallet, BigNumber, ethers } from "ethers"; -import { - DomainReader, - DomainTransactionFactory, - DomainHierarchy, - ResolverContractType, -} from "@energyweb/iam-contracts"; -import { EwSigner, Operator, Resolver } from "@ew-did-registry/did-ethr-resolver"; -import { labelhash, namehash } from "../utils/ENS_hash"; -import { - IServiceEndpoint, - RegistrySettings, - KeyTags, - IPublicKey, - ProviderTypes, -} from "@ew-did-registry/did-resolver-interface"; -import { Methods } from "@ew-did-registry/did"; -import { DIDDocumentFull } from "@ew-did-registry/did-document"; -import { ClaimsIssuer, ClaimsUser, ClaimsVerifier } from "@ew-did-registry/claims"; -import { DidStore } from "@ew-did-registry/did-ipfs-store"; -import { ENSRegistry } from "../../ethers/ENSRegistry"; -import { ENSRegistry__factory } from "../../ethers/factories/ENSRegistry__factory"; -import { ClaimManager__factory } from "../../ethers/factories/ClaimManager__factory"; -import { ClaimManager } from "../../ethers/ClaimManager"; -import { JWT } from "@ew-did-registry/jwt"; -import { ICacheServerClient } from "../cacheServerClient/ICacheServerClient"; -import { detectExecutionEnvironment, ExecutionEnvironment } from "../utils/detectEnvironment"; -import { connect, NatsConnection, Codec, JSONCodec } from "nats.ws/lib/src/mod.js"; -import { ERROR_MESSAGES } from "../errors"; -import { ClaimData } from "../cacheServerClient/cacheServerClient.types"; -import difference from "lodash.difference"; -import detectMetamask from "@metamask/detect-provider"; -import { WalletProvider } from "../types/WalletProvider"; -import { CacheServerClient } from "../cacheServerClient/cacheServerClient"; -import { emptyAddress, MessagingMethod, PUBLIC_KEY, WALLET_PROVIDER } from "../utils/constants"; -import { cacheServerClientOptions, chainConfigs, messagingOptions, MessagingOptions } from "./chainConfig"; -import { WalletConnectService } from "../walletconnect/WalletConnectService"; -import { OfferableIdentity__factory } from "../../ethers/factories/OfferableIdentity__factory"; -import { IdentityManager__factory } from "../../ethers/factories/IdentityManager__factory"; -import { IdentityManager } from "../../ethers/IdentityManager"; -import { getPublicKeyAndIdentityToken, IPubKeyAndIdentityToken } from "../utils/getPublicKeyAndIdentityToken"; -import { AccountInfo } from "../iam"; - -const { parseUnits } = utils; -const { JsonRpcProvider } = providers; - -export type ConnectionOptions = { - /** only required in node env */ - rpcUrl?: string; - infuraId?: string; - ipfsUrl?: string; - bridgeUrl?: string; - privateKey?: string; - ewKeyManagerUrl?: string; -}; - -export type EncodedCall = { - to: string; - data: string; - value?: string; -}; - -export type Transaction = { - calls: EncodedCall[]; - from: string; -}; - -/** - * @class - */ -export class IAMBase { - protected _executionEnvironment: ExecutionEnvironment; - protected _connectionOptions: ConnectionOptions; - - protected _did: string | undefined; - protected _provider: providers.JsonRpcProvider; - protected _metamaskProvider: { on: any; request: any } | undefined; - protected _walletConnectService: WalletConnectService; - protected _address: string | undefined; - protected _signer: Signer | undefined; - protected _safeAddress: string | undefined; - protected _didSigner: EwSigner | undefined; - protected _identityToken: string | undefined; - protected _transactionOverrides: utils.Deferrable = {}; - protected _providerType: WalletProvider | undefined; - protected _publicKey: string | undefined | null; - - protected _registrySetting: RegistrySettings; - protected _resolver: Resolver; - protected _document: DIDDocumentFull | undefined; - protected _userClaims: ClaimsUser | undefined; - protected _issuerClaims: ClaimsIssuer | undefined; - protected _verifierClaims: ClaimsVerifier | undefined; - protected _ipfsStore: DidStore; - protected _jwt: JWT | undefined; - - protected _ensRegistry: ENSRegistry; - protected _domainDefinitionTransactionFactory: DomainTransactionFactory; - protected _domainDefinitionReader: DomainReader; - protected _domainHierarchy: DomainHierarchy; - protected _ensResolverAddress: string; - protected _ensRegistryAddress: string; - - protected _assetManager: IdentityManager; - protected _claimManager: ClaimManager; - - protected _cacheClient: ICacheServerClient; - - protected _messagingOptions: MessagingOptions; - protected _natsConnection: NatsConnection | undefined; - protected _jsonCodec: Codec | undefined; - - private ttl = BigNumber.from(0); - - /** - * IAM Constructor - * - */ - public constructor({ - rpcUrl, - infuraId, - ipfsUrl = "https://ipfs.infura.io:5001/api/v0/", - bridgeUrl = "https://walletconnect.energyweb.org", - privateKey, - ewKeyManagerUrl = "https://km.aws.energyweb.org/connect/new", - }: ConnectionOptions = {}) { - this._executionEnvironment = detectExecutionEnvironment(); - - ethers.utils.Logger.setLogLevel(utils.Logger.levels.ERROR); - - this._connectionOptions = { - privateKey, - rpcUrl, - bridgeUrl, - infuraId, - }; - - this._ipfsStore = new DidStore(ipfsUrl); - - // Need to get providerType and publicKey in constructor because they are used - // to infer if the session is active. - if (this._executionEnvironment === ExecutionEnvironment.BROWSER) { - this._providerType = localStorage.getItem(WALLET_PROVIDER) as WalletProvider; - this._publicKey = localStorage.getItem(PUBLIC_KEY); - } - - this._walletConnectService = new WalletConnectService(bridgeUrl, infuraId, ewKeyManagerUrl); - } - - // INITIAL - - protected async init({ - initializeMetamask, - walletProvider: walletProvider, - }: { - initializeMetamask?: boolean; - walletProvider?: WalletProvider; - }): Promise { - const accountInfo = await this.initSigner({ walletProvider, initializeMetamask }); - await this.setAddress(); - this.setDid(); - await this.initChain(); - this.initEventHandlers(); - - if (this._executionEnvironment === ExecutionEnvironment.BROWSER) { - await this.setupMessaging(); - } - - this.setResolver(); - this.setJWT(); - return accountInfo; - } - - private async initSigner({ - initializeMetamask, - walletProvider, - }: { - useMetamask?: boolean; - initializeMetamask?: boolean; - walletProvider?: WalletProvider; - }): Promise { - const { privateKey, rpcUrl } = this._connectionOptions; - if (this._executionEnvironment === ExecutionEnvironment.NODE) { - if (!privateKey) { - throw new Error(ERROR_MESSAGES.PRIVATE_KEY_NOT_PROVIDED); - } - if (!rpcUrl) { - throw new Error(ERROR_MESSAGES.RPC_URL_NOT_PROVIDED); - } - this._provider = new JsonRpcProvider({ url: rpcUrl }); - this._signer = new Wallet(privateKey, this._provider); - return; - } - - if (walletProvider === WalletProvider.MetaMask) { - const metamaskProvider: any = await detectMetamask({ - mustBeMetaMask: true, - }); - if (!metamaskProvider) { - throw new Error(ERROR_MESSAGES.METAMASK_EXTENSION_NOT_AVAILABLE); - } - this._metamaskProvider = metamaskProvider; - const requestObject = { - method: initializeMetamask ? "wallet_requestPermissions" : "eth_accounts", - params: [ - { - eth_accounts: {}, - }, - ], - }; - const accounts: string[] = await metamaskProvider.request(requestObject); - - if (!initializeMetamask && accounts.length < 1) { - await metamaskProvider.request({ - method: "wallet_requestPermissions", - params: [ - { - eth_accounts: {}, - }, - ], - }); - } - this._providerType = walletProvider; - this._provider = new providers.Web3Provider(metamaskProvider); - this._signer = this._provider.getSigner(); - - const { chainId } = await this._provider.getNetwork(); - console.log("metamask chain id:", chainId); - - return { - account: accounts[0], - chainId: chainId, - chainName: chainConfigs[chainId].chainName, - }; - } - if (walletProvider && [WalletProvider.EwKeyManager, WalletProvider.WalletConnect].includes(walletProvider)) { - this._transactionOverrides = { - gasLimit: BigNumber.from(4900000), - gasPrice: parseUnits("0.01", "gwei"), - }; - await this._walletConnectService.initialize(walletProvider); - const wcProvider = this._walletConnectService.getProvider(); - this._provider = new providers.Web3Provider(wcProvider); - this._signer = this._provider.getSigner(); - this._providerType = walletProvider; - return; - } - throw new Error(ERROR_MESSAGES.WALLET_TYPE_NOT_PROVIDED); - } - - /** - * @description Establishes connection to the cache serverand sets public key and identity token - */ - async connectToCacheServer() { - const { chainId } = await this._provider.getNetwork(); - const cacheOptions = cacheServerClientOptions[chainId]; - if (!this._signer) { - throw new Error(ERROR_MESSAGES.SIGNER_NOT_INITIALIZED); - } - if (!cacheOptions.url) { - throw new Error(ERROR_MESSAGES.CACHE_SERVER_NOT_REGISTERED); - } - this._cacheClient = new CacheServerClient(cacheOptions, this._signer); - const fromCacheLogin = await this.loginToCacheServer(); - this._publicKey = fromCacheLogin?.publicKey ?? this._publicKey; - this._identityToken = fromCacheLogin?.identityToken; - } - - /** - * @description Creates the signer's DID document if it does not exist - */ - async connectToDIDRegistry() { - if (!this._signer) { - throw new Error(ERROR_MESSAGES.SIGNER_NOT_INITIALIZED); - } - if (!this._publicKey) { - const { publicKey, identityToken } = await getPublicKeyAndIdentityToken(this._signer); - this._publicKey = publicKey; - this._identityToken = identityToken; - } - if (this._signer instanceof Wallet) { - this._didSigner = EwSigner.fromPrivateKey(this._signer.privateKey, { - type: ProviderTypes.HTTP, - uriOrInfo: this._provider.connection.url, - }); - } else if (this._signer instanceof providers.JsonRpcSigner) { - this._didSigner = EwSigner.fromEthersSigner(this._signer, this._publicKey); - } else { - throw new Error(ERROR_MESSAGES.PROVIDER_NOT_INITIALIZED); - } - await this.setDocument(); - this.setClaims(); - this.storeSession(); - } - - /** - * @description Checks if the session is active - * @returns boolean that indicates the session state - */ - public isSessionActive() { - return Boolean(this._publicKey) && Boolean(this._providerType); - } - - private storeSession() { - if (this._executionEnvironment === ExecutionEnvironment.BROWSER && this._didSigner) { - this._providerType && localStorage.setItem(WALLET_PROVIDER, this._providerType as string); - this._didSigner.publicKey && localStorage.setItem(PUBLIC_KEY, this._didSigner.publicKey); - } - } - - protected clearSession() { - if (this._executionEnvironment === ExecutionEnvironment.BROWSER) { - localStorage.removeItem(WALLET_PROVIDER); - localStorage.removeItem(PUBLIC_KEY); - } - } - - /** - * @description Defines event handlers for change of account, change of network, disconnection - * @requires to be called after the connection to wallet was initialized - */ - on(event: "accountChanged" | "networkChanged" | "disconnected", eventHandler: () => void) { - if (!this._providerType) return; - const isMetamask = this._providerType === WalletProvider.MetaMask; - switch (event) { - case "accountChanged": { - isMetamask - ? this._metamaskProvider?.on("accountsChanged", eventHandler) - : this._walletConnectService.getProvider().wc.on("session_update", eventHandler); - break; - } - case "disconnected": { - isMetamask === false && this._walletConnectService.getProvider()?.wc.on("disconnect", eventHandler); - break; - } - case "networkChanged": { - isMetamask - ? this._metamaskProvider?.on("networkChanged", eventHandler) - : this._walletConnectService.getProvider().wc.on("session_update", eventHandler); - break; - } - default: - throw new Error("Event not supported"); - } - } - - private initEventHandlers() { - this.on("accountChanged", () => { - this.closeConnection(); - }); - this.on("disconnected", () => { - this.closeConnection(); - }); - this.on("networkChanged", () => { - this.closeConnection(); - }); - } - - /** - * @description Closes the connection between application and the signer's wallet - */ - async closeConnection() { - await this._walletConnectService.closeConnection(); - this.clearSession(); - this._did = undefined; - this._address = undefined; - this._signer = undefined; - } - - private async loginToCacheServer(): Promise { - if (this._signer && this._cacheClient && this._cacheClient.isAuthEnabled()) { - // If session isn't active then assume that user has never signed in or has signed out - if (!this.isSessionActive()) { - const { pubKeyAndIdentityToken } = await this._cacheClient.login(); - return pubKeyAndIdentityToken; - } - // session is active so maybe user has signed in before. - // Test cache-server login to confirm that their tokens are still valid - else { - await this._cacheClient.testLogin(); - // Expect that if login generated pubKey&IdToken, then will be accessible as property of cacheClient - return this._cacheClient.pubKeyAndIdentityToken; - } - } - return undefined; - } - - protected async setAddress() { - if (this._signer) { - this._address = await this._signer.getAddress(); - } - } - - get address() { - return this._address; - } - - private setResolver() { - if (this._registrySetting) { - this._resolver = new Resolver(this._provider as providers.Provider, this._registrySetting); - } - } - - private setDid() { - if (this._address) { - this._did = `did:${Methods.Erc1056}:${this._address}`; - } - } - - private async setDocument() { - if (this._did && this._didSigner) { - this._document = new DIDDocumentFull(this._did, new Operator(this._didSigner, this._registrySetting)); - let pubKey: IPublicKey | undefined; - if (this._cacheClient) { - const cachedDoc = await this._cacheClient.getDidDocument({ did: this._did }); - pubKey = cachedDoc.publicKey.find((pk) => pk.id.endsWith(KeyTags.OWNER)); - } - if (!pubKey) { - await this._document.create(); - } - } - } - - private setClaims() { - if (this._didSigner && this._document) { - this._userClaims = new ClaimsUser(this._didSigner, this._document, this._ipfsStore); - this._issuerClaims = new ClaimsIssuer(this._didSigner, this._document, this._ipfsStore); - this._verifierClaims = new ClaimsVerifier(this._didSigner, this._document, this._ipfsStore); - } - } - - private setJWT() { - if (this._signer) { - this._jwt = new JWT(this._signer); - return; - } - throw new Error(ERROR_MESSAGES.SIGNER_NOT_INITIALIZED); - } - - private async setupMessaging() { - const { messagingMethod, natsServerUrl } = this._messagingOptions || {}; - if (natsServerUrl && messagingMethod === MessagingMethod.Nats) { - this._jsonCodec = JSONCodec(); - try { - let protocol = "ws"; - if (natsServerUrl.indexOf("https://") === 0) { - protocol = "wss"; - } - const timeout = 3000; - // this race condition duplicate timeout is there because unable to catch the error that occurs when NATS.ws timeouts - const connection = await Promise.race([ - connect({ - servers: `${protocol}://${natsServerUrl}`, - timeout, - pingInterval: 50 * 1000, - }), - new Promise((resolve) => setTimeout(resolve, timeout)), - ]); - - if (!connection) return; - this._natsConnection = connection; - } catch (err) { - console.log(err); - } - } - } - - protected async downloadClaims({ services }: { services: IServiceEndpoint[] }) { - return Promise.all( - services.map(async ({ serviceEndpoint, ...rest }) => { - const data = await this._ipfsStore.get(serviceEndpoint); - const { claimData, ...claimRest } = this._jwt?.decode(data) as { - claimData: ClaimData; - }; - return { - serviceEndpoint, - ...rest, - ...claimData, - ...claimRest, - } as IServiceEndpoint & ClaimData; - }), - ); - } - - protected createSubdomainTx({ - domain, - nodeName, - owner = this._address as string, - }: { - domain: string; - nodeName: string; - owner?: string; - }): EncodedCall { - return { - to: this._ensRegistryAddress, - data: this._ensRegistry.interface.encodeFunctionData("setSubnodeRecord", [ - namehash(domain), - labelhash(nodeName), - owner, - this._ensResolverAddress, - this.ttl, - ]), - }; - } - - protected changeSubdomainOwnerTx({ - newOwner, - label, - namespace, - }: { - newOwner: string; - namespace: string; - label: string; - }): EncodedCall { - return { - to: this._ensRegistryAddress, - data: this._ensRegistry.interface.encodeFunctionData("setSubnodeOwner", [ - namehash(namespace), - labelhash(label), - newOwner, - ]), - }; - } - - protected changeDomainOwnerTx({ newOwner, namespace }: { newOwner: string; namespace: string }): EncodedCall { - return { - to: this._ensRegistryAddress, - data: this._ensRegistry.interface.encodeFunctionData("setOwner", [namehash(namespace), newOwner]), - }; - } - - protected async validateIssuers({ issuer, namespace }: { issuer: string[]; namespace: string }) { - const roleHash = namehash(namespace); - const definition = await this._domainDefinitionReader.read({ node: roleHash }); - if (!DomainReader.isRoleDefinition(definition)) { - throw new Error("Domain is not a role definition"); - } - const diff = difference(issuer, definition.issuer.did || []); - if (diff.length > 0) { - throw new Error(`Issuer validation failed for: ${diff.join(", ")}`); - } - } - - protected deleteSubdomainTx({ namespace }: { namespace: string }): EncodedCall { - const namespaceArray = namespace.split("."); - const node = namespaceArray.slice(1).join("."); - const label = namespaceArray[0]; - return { - to: this._ensRegistryAddress, - data: this._ensRegistry.interface.encodeFunctionData("setSubnodeRecord", [ - namehash(node), - labelhash(label), - emptyAddress, - emptyAddress, - this.ttl, - ]), - }; - } - - protected async deleteDomain({ namespace }: { namespace: string }) { - if (!this._signer) { - throw new Error(ERROR_MESSAGES.SIGNER_NOT_INITIALIZED); - } - await this.send({ - calls: [this.deleteDomainTx({ namespace })], - from: await this.getOwner({ namespace }), - }); - } - - protected async getOwner({ namespace }: { namespace: string }) { - const node = namehash(namespace); - return this._ensRegistry.owner(node); - } - - protected async send(tx: Transaction) { - if (!this._signer) { - throw new Error(ERROR_MESSAGES.SIGNER_NOT_INITIALIZED); - } - for await (const call of tx.calls) { - await (await this._signer.sendTransaction({ ...call, ...this._transactionOverrides })).wait(); - } - } - - protected deleteDomainTx({ namespace }: { namespace: string }): EncodedCall { - return { - to: this._ensRegistryAddress, - data: this._ensRegistry.interface.encodeFunctionData("setRecord", [ - namehash(namespace), - emptyAddress, - emptyAddress, - this.ttl, - ]), - }; - } - - protected async deleteSubdomain({ namespace }: { namespace: string }) { - if (!this._signer) { - throw new Error(ERROR_MESSAGES.SIGNER_NOT_INITIALIZED); - } - await this.send({ - calls: [this.deleteSubdomainTx({ namespace })], - from: await this.getOwner({ - namespace: namespace.split(".").slice(1).join(""), - }), - }); - } - - private async initChain() { - const { chainId } = await this._provider.getNetwork(); - const { - ensRegistryAddress, - ensResolverAddress, - ensPublicResolverAddress, - domainNotifierAddress, - didContractAddress, - assetManagerAddress, - claimManagerAddress, - } = chainConfigs[chainId]; - - if (!ensRegistryAddress) - throw new Error(`Chain config for chainId: ${chainId} does not contain ensRegistryAddress`); - if (!ensResolverAddress) - throw new Error(`Chain config for chainId: ${chainId} does not contain ensResolverAddress`); - if (!didContractAddress) - throw new Error(`Chain config for chainId: ${chainId} does not contain didContractAddress`); - if (!assetManagerAddress) - throw new Error(`Chain config for chainId: ${chainId} does not contain assetManagerContractAddress`); - if (!claimManagerAddress) { - throw new Error(`Chain config for chainId: ${chainId} does not contain claimManagerAddress`); - } - if (!this._signer) { - throw new Error(ERROR_MESSAGES.SIGNER_NOT_INITIALIZED); - } - - this._registrySetting = { - address: didContractAddress, - method: Methods.Erc1056, - }; - - this._ensRegistryAddress = ensRegistryAddress; - this._ensResolverAddress = ensResolverAddress; - this._assetManager = IdentityManager__factory.connect(assetManagerAddress, this._signer); - this._ensRegistry = ENSRegistry__factory.connect(ensRegistryAddress, this._provider); - this._domainDefinitionReader = new DomainReader({ ensRegistryAddress, provider: this._provider }); - ensPublicResolverAddress && - this._domainDefinitionReader.addKnownResolver({ - chainId, - address: ensPublicResolverAddress, - type: ResolverContractType.PublicResolver, - }); - ensResolverAddress && - this._domainDefinitionReader.addKnownResolver({ - chainId, - address: ensResolverAddress, - type: ResolverContractType.RoleDefinitionResolver_v1, - }); - this._domainDefinitionTransactionFactory = new DomainTransactionFactory({ - domainResolverAddress: ensResolverAddress, - }); - this._domainHierarchy = new DomainHierarchy({ - domainReader: this._domainDefinitionReader, - ensRegistryAddress: this._ensRegistry.address, - provider: this._provider, - domainNotifierAddress: domainNotifierAddress, - publicResolverAddress: ensPublicResolverAddress, - }); - this._claimManager = ClaimManager__factory.connect(claimManagerAddress, this._signer); - - this._messagingOptions = messagingOptions[chainId]; - } - - // ### ASSETS ### - - protected offerAssetTx({ - offerTo, - assetContractAddress, - }: { - offerTo: string; - assetContractAddress: string; - }): EncodedCall { - const asset = OfferableIdentity__factory.connect(assetContractAddress, this._provider); - return { - data: asset.interface.encodeFunctionData("offer", [offerTo]), - to: assetContractAddress, - }; - } - - protected acceptOfferTx({ assetContractAddress }: { assetContractAddress: string }): EncodedCall { - const asset = OfferableIdentity__factory.connect(assetContractAddress, this._provider); - return { - data: asset.interface.encodeFunctionData("acceptOffer"), - to: assetContractAddress, - }; - } - - protected rejectOfferTx({ assetContractAddress }: { assetContractAddress: string }): EncodedCall { - const asset = OfferableIdentity__factory.connect(assetContractAddress, this._provider); - return { - data: asset.interface.encodeFunctionData("rejectOffer"), - to: assetContractAddress, - }; - } - - protected cancelOfferTx({ assetContractAddress }: { assetContractAddress: string }): EncodedCall { - const asset = OfferableIdentity__factory.connect(assetContractAddress, this._provider); - return { - data: asset.interface.encodeFunctionData("cancelOffer"), - to: assetContractAddress, - }; - } -} diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 00000000..3a21bbbc --- /dev/null +++ b/src/index.ts @@ -0,0 +1,27 @@ +// Copyright 2020 Energy Web Foundation +// This file is part of IAM Client Library brought to you by the Energy Web Foundation, +// a global non-profit organization focused on accelerating blockchain technology across the energy sector, +// incorporated in Zug, Switzerland. +// +// The IAM Client Library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// This is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY and without an implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details, at . +// +// @authors: Kim Honoridez + +export * from "./init"; +export * from "./modules/assets"; +export * from "./modules/cacheClient"; +export * from "./modules/claims"; +export * from "./modules/didRegistry"; +export * from "./modules/domains"; +export * from "./modules/messaging"; +export * from "./modules/signer"; +export * from "./modules/staking"; +export * from "./errors"; +export * from "./config"; diff --git a/src/init.ts b/src/init.ts new file mode 100644 index 00000000..3ca57b42 --- /dev/null +++ b/src/init.ts @@ -0,0 +1,68 @@ +import { SignerService } from "./modules/signer/signer.service"; +import { StakingService } from "./modules/staking/staking.service"; +import { detectExecutionEnvironment, ExecutionEnvironment } from "./utils/detectEnvironment"; +import { PUBLIC_KEY, WALLET_PROVIDER } from "./modules/signer"; +import { fromPrivateKey } from "./modules/signer"; +import { DidRegistry } from "./modules/didRegistry/didRegistry.service"; +import { MessagingService } from "./modules/messaging/messaging.service"; +import { CacheClient } from "./modules/cacheClient/cacheClient.service"; +import { DomainsService } from "./modules/domains/domains.service"; +import { AssetsService } from "./modules/assets/assets.service"; +import { ClaimsService } from "./modules/claims/claims.service"; + +export async function initWithPrivateKeySigner(privateKey: string, rpcUrl: string) { + const signerService = await fromPrivateKey(privateKey, rpcUrl); + return init(signerService); +} + +export async function init(signerService: SignerService) { + const messagingService = await MessagingService.create(signerService); + + async function connectToCacheServer() { + const cacheClient = new CacheClient(signerService); + await cacheClient.init(); + await cacheClient.login(); + const domainsService = await DomainsService.create(signerService, cacheClient); + const stakingService = await StakingService.create(signerService, domainsService); + const assetsService = await AssetsService.create(signerService, cacheClient); + + async function connectToDidRegistry( + ipfsStore?: string, + ): Promise<{ didRegistry: DidRegistry; claimsService: ClaimsService }> { + const didRegistry = await DidRegistry.connect(signerService, cacheClient, assetsService, ipfsStore); + const claimsService = await ClaimsService.create( + signerService, + domainsService, + cacheClient, + didRegistry, + messagingService, + ); + return { didRegistry, claimsService }; + } + return { cacheClient, domainsService, stakingService, assetsService, connectToDidRegistry }; + } + + /** + * Check if session is active + * + * @returns boolean that indicates the session state + */ + async function isSessionActive() { + return Boolean(await signerService.publicKey()) && Boolean(signerService.providerType); + } + + async function storeSession() { + if (detectExecutionEnvironment() === ExecutionEnvironment.BROWSER) { + localStorage.setItem(WALLET_PROVIDER, signerService.providerType); + localStorage.setItem(PUBLIC_KEY, await signerService.publicKey()); + } + } + + return { + signerService, + messagingService, + connectToCacheServer, + isSessionActive, + storeSession, + }; +} diff --git a/src/modules/assets/assets.service.ts b/src/modules/assets/assets.service.ts new file mode 100644 index 00000000..7209faa8 --- /dev/null +++ b/src/modules/assets/assets.service.ts @@ -0,0 +1,154 @@ +import { utils, providers } from "ethers"; +import { Methods } from "@ew-did-registry/did"; +import { IdentityManager__factory } from "../../../ethers/factories/IdentityManager__factory"; +import { IdentityManager } from "../../../ethers/IdentityManager"; +import { OfferableIdentity__factory } from "../../../ethers/factories/OfferableIdentity__factory"; +import { ChainConfig, chainConfigs } from "../../config/chain.config"; +import { CacheClient } from "../cacheClient/cacheClient.service"; +import { Order } from "../cacheClient/cacheClient.types"; +import { SignerService } from "../signer/signer.service"; +import { AssetHistoryEventType } from "./assets.types"; + +export class AssetsService { + private _owner: string; + private _did: string; + private _assetManager: IdentityManager; + + constructor(private _signerService: SignerService, private _cacheClient: CacheClient) { + this._signerService.onInit(async () => await this.init()); + } + + static async create(signerService: SignerService, cacheClient: CacheClient) { + const service = new AssetsService(signerService, cacheClient); + await service.init(); + return service; + } + + async init() { + const signer = this._signerService.signer; + this._owner = await signer.getAddress(); + this._did = `did:${Methods.Erc1056}:${this._owner}`; + const chainId = (await signer.provider.getNetwork()).chainId; + const chainConfig = chainConfigs()[chainId] as ChainConfig; + const { assetManagerAddress } = chainConfig; + this._assetManager = new IdentityManager__factory().attach(assetManagerAddress); + } + + async registerAsset(): Promise { + const data = this._assetManager.interface.encodeFunctionData("createIdentity", [this._owner]); + const receipt = await this._signerService.send({ to: this._assetManager.address, data }); + const event = receipt.logs + .map((l) => this._assetManager.interface.parseLog(l)) + .find( + (log) => + log.name === this._assetManager.interface.events["IdentityCreated(address,address,uint256)"].name, + ) as utils.LogDescription; + const identity = event.args[0] as string; + let asset = await this.getAssetById({ id: `did:ethr:${identity}` }); + let loops = 0; + /* + * we need to wait until cache server will resolve assets did document + * which is taking some time + */ + while (!asset && loops < 20) { + asset = await this.getAssetById({ id: `did:${Methods.Erc1056}:${identity}` }); + await new Promise((resolve) => setTimeout(resolve, 1000)); + loops++; + } + return identity; + } + + /** + * @param offerTo - recepient address + */ + async offerAsset({ assetDID, offerTo }: { assetDID: string; offerTo: string }) { + const [, , assetContractAddress] = assetDID.split(":"); + const tx = this.offerAssetTx({ assetContractAddress, offerTo: offerTo }); + await this._signerService.send(tx); + } + + async acceptAssetOffer({ assetDID }: { assetDID: string }) { + const [, , assetContractAddress] = assetDID.split(":"); + const tx = this.acceptOfferTx({ assetContractAddress }); + await this._signerService.send(tx); + } + + async rejectAssetOffer({ assetDID }: { assetDID: string }) { + const [, , assetContractAddress] = assetDID.split(":"); + const tx = this.rejectOfferTx({ assetContractAddress }); + await this._signerService.send(tx); + } + + async cancelAssetOffer({ assetDID }: { assetDID: string }) { + const [, , assetContractAddress] = assetDID.split(":"); + const tx = this.cancelOfferTx({ assetContractAddress }); + await this._signerService.send(tx); + } + + async getOwnedAssets({ did = this._did }: { did?: string } = {}) { + return this._cacheClient.getOwnedAssets({ did }); + } + + async getOfferedAssets({ did = this._did }: { did?: string } = {}) { + return this._cacheClient.getOfferedAssets({ did }); + } + + async getAssetById({ id }: { id: string }) { + return this._cacheClient.getAssetById({ id }); + } + + async getPreviouslyOwnedAssets({ owner }: { owner: string }) { + return this._cacheClient.getPreviouslyOwnedAssets({ owner }); + } + + async getAssetHistory({ + id, + ...query + }: { + id: string; + order?: Order; + take?: number; + skip?: number; + type?: AssetHistoryEventType; + }) { + return this._cacheClient.getAssetHistory({ id, ...query }); + } + + private offerAssetTx({ + offerTo, + assetContractAddress, + }: { + offerTo: string; + assetContractAddress: string; + }): providers.TransactionRequest { + const asset = new OfferableIdentity__factory().attach(assetContractAddress); + return { + data: asset.interface.encodeFunctionData("offer", [offerTo]), + to: assetContractAddress, + }; + } + + private acceptOfferTx({ assetContractAddress }: { assetContractAddress: string }): providers.TransactionRequest { + const asset = new OfferableIdentity__factory().attach(assetContractAddress); + return { + data: asset.interface.encodeFunctionData("acceptOffer"), + to: assetContractAddress, + }; + } + + private rejectOfferTx({ assetContractAddress }: { assetContractAddress: string }): providers.TransactionRequest { + const asset = new OfferableIdentity__factory().attach(assetContractAddress); + return { + data: asset.interface.encodeFunctionData("rejectOffer"), + to: assetContractAddress, + }; + } + + private cancelOfferTx({ assetContractAddress }: { assetContractAddress: string }): providers.TransactionRequest { + const asset = new OfferableIdentity__factory().attach(assetContractAddress); + return { + data: asset.interface.encodeFunctionData("cancelOffer"), + to: assetContractAddress, + }; + } +} diff --git a/src/modules/assets/assets.types.ts b/src/modules/assets/assets.types.ts new file mode 100644 index 00000000..23c3c2f4 --- /dev/null +++ b/src/modules/assets/assets.types.ts @@ -0,0 +1,25 @@ +import { IDIDDocument } from "@ew-did-registry/did-resolver-interface"; + +export interface Asset { + id: string; + owner: string; + offeredTo?: string; + document: IDIDDocument; +} + +export interface AssetHistory { + id: number; + emittedBy: string; + relatedTo?: string; + at: number; + timestamp: string; + assetId?: string; +} + +export enum AssetHistoryEventType { + ASSET_CREATED = "ASSET_CREATED", + ASSET_OFFERED = "ASSET_OFFERED", + ASSET_OFFER_CANCELED = "ASSET_OFFER_CANCELED", + ASSET_TRANSFERRED = "ASSET_TRANSFERRED", + ASSET_OFFER_REJECTED = "ASSET_OFFER_REJECTED", +} diff --git a/src/modules/assets/index.ts b/src/modules/assets/index.ts new file mode 100644 index 00000000..5371be2a --- /dev/null +++ b/src/modules/assets/index.ts @@ -0,0 +1,2 @@ +export * from "./assets.service"; +export * from "./assets.types"; diff --git a/src/cacheServerClient/ICacheServerClient.ts b/src/modules/cacheClient/ICacheClient.ts similarity index 90% rename from src/cacheServerClient/ICacheServerClient.ts rename to src/modules/cacheClient/ICacheClient.ts index 9dce0ed4..33ebcda2 100644 --- a/src/cacheServerClient/ICacheServerClient.ts +++ b/src/modules/cacheClient/ICacheClient.ts @@ -1,19 +1,13 @@ import { IAppDefinition, IOrganizationDefinition, IRoleDefinition } from "@energyweb/iam-contracts"; import { IDIDDocument } from "@ew-did-registry/did-resolver-interface"; -import { IClaimIssuance, IClaimRejection, IClaimRequest } from "../iam"; -import { IPubKeyAndIdentityToken } from "../utils/getPublicKeyAndIdentityToken"; -import { - Asset, - AssetHistory, - AssetHistoryEventType, - Claim, - IApp, - IOrganization, - IRole, - Order, -} from "./cacheServerClient.types"; +import { IClaimIssuance, IClaimRejection, IClaimRequest } from "../claims/claims.types"; +import { IPubKeyAndIdentityToken } from "../signer/signer.types"; +import { Order } from "./cacheClient.types"; +import { Asset, AssetHistory, AssetHistoryEventType } from "../assets/assets.types"; +import { IApp, IOrganization, IRole } from "../domains/domains.types"; +import { Claim } from "../claims/claims.types"; -export interface ICacheServerClient { +export interface ICacheClient { pubKeyAndIdentityToken: IPubKeyAndIdentityToken | undefined; testLogin: () => Promise; login: () => Promise<{ pubKeyAndIdentityToken: IPubKeyAndIdentityToken; token: string; refreshToken: string }>; diff --git a/src/cacheServerClient/cacheServerClient.ts b/src/modules/cacheClient/cacheClient.service.ts similarity index 86% rename from src/cacheServerClient/cacheServerClient.ts rename to src/modules/cacheClient/cacheClient.service.ts index 66eb5d8a..21272c2e 100644 --- a/src/cacheServerClient/cacheServerClient.ts +++ b/src/modules/cacheClient/cacheClient.service.ts @@ -1,40 +1,33 @@ import axios, { AxiosError, AxiosInstance, AxiosResponse } from "axios"; import { stringify } from "qs"; -import { - IApp, - IOrganization, - IRole, - Claim, - Asset, - Order, - AssetHistoryEventType, - AssetHistory, -} from "./cacheServerClient.types"; - -import { IClaimIssuance, IClaimRejection, IClaimRequest } from "../iam"; import { IDIDDocument } from "@ew-did-registry/did-resolver-interface"; - -import { ICacheServerClient } from "./ICacheServerClient"; -import { detectExecutionEnvironment, ExecutionEnvironment } from "../utils/detectEnvironment"; -import { getPublicKeyAndIdentityToken, IPubKeyAndIdentityToken } from "../utils/getPublicKeyAndIdentityToken"; -import { Signer } from "ethers"; - -export interface CacheServerClientOptions { - url: string; - cacheServerSupportsAuth?: boolean; -} - -export class CacheServerClient implements ICacheServerClient { +import { IApp, IOrganization, IRole } from "../domains/domains.types"; +import { AssetHistoryEventType, AssetHistory } from "../assets/assets.types"; +import { Claim } from "../claims/claims.types"; +import { Asset } from "../assets/assets.types"; +import { Order } from "./cacheClient.types"; +import { IClaimIssuance, IClaimRejection, IClaimRequest } from "../claims/claims.types"; +import { ICacheClient } from "./ICacheClient"; +import { detectExecutionEnvironment, ExecutionEnvironment } from "../../utils/detectEnvironment"; +import { SignerService } from "../signer/signer.service"; +import { cacheConfigs } from "../../config/cache.config"; +import { IPubKeyAndIdentityToken } from "../signer/signer.types"; + +export class CacheClient implements ICacheClient { public pubKeyAndIdentityToken: IPubKeyAndIdentityToken | undefined; private httpClient: AxiosInstance; private isAlreadyFetchingAccessToken = false; private failedRequests: Array<(token?: string) => void> = []; private authEnabled: boolean; - private executionEnvironment: ExecutionEnvironment; + private isBrowser: boolean; private refresh_token: string | undefined; - private readonly signer: Signer; - constructor({ url, cacheServerSupportsAuth = true }: CacheServerClientOptions, signer: Signer) { + constructor(private _signerService: SignerService) { + this._signerService.onInit(async () => await this.init()); + } + + async init() { + const { url, cacheServerSupportsAuth = false } = cacheConfigs()[this._signerService.chainId]; this.httpClient = axios.create({ baseURL: url, withCredentials: true, @@ -43,8 +36,7 @@ export class CacheServerClient implements ICacheServerClient { return response; }, this.handleUnauthorized); this.authEnabled = cacheServerSupportsAuth; - this.executionEnvironment = detectExecutionEnvironment(); - this.signer = signer; + this.isBrowser = detectExecutionEnvironment() === ExecutionEnvironment.BROWSER; } isAuthEnabled() { @@ -54,10 +46,8 @@ export class CacheServerClient implements ICacheServerClient { async handleRefreshToken() { const { refreshToken, token } = await this.refreshToken(); this.refresh_token = refreshToken; - this.failedRequests = this.failedRequests.filter((callback) => - callback(this.executionEnvironment === ExecutionEnvironment.BROWSER ? undefined : token), - ); - if (this.executionEnvironment === ExecutionEnvironment.NODE) { + this.failedRequests = this.failedRequests.filter((callback) => callback(this.isBrowser ? undefined : token)); + if (!this.isBrowser) { this.httpClient.defaults.headers.common["Authorization"] = `Bearer ${token}`; this.refresh_token = refreshToken; } @@ -67,7 +57,7 @@ export class CacheServerClient implements ICacheServerClient { this.failedRequests.push(callback); } - handleUnauthorized = async (error: AxiosError) => { + async handleUnauthorized(error: AxiosError) { const { config, response } = error; const originalRequest = config; if ( @@ -94,50 +84,33 @@ export class CacheServerClient implements ICacheServerClient { return retryOriginalRequest; } return Promise.reject(error); - }; + } - public async testLogin(): Promise { + async testLogin(): Promise { // Simple test to check if logged in or no. TODO: have dedicated endpoint on the cache-server // If receive unauthorized response, expect that refreshToken() will be called await this.getRoleDefinition({ namespace: "testing.if.logged.in" }); } - public async login(): Promise<{ + async login(): Promise<{ pubKeyAndIdentityToken: IPubKeyAndIdentityToken; token: string; refreshToken: string; }> { - const pubKeyAndIdentityToken = await getPublicKeyAndIdentityToken(this.signer); + const pubKeyAndIdentityToken = await this._signerService.publicKeyAndIdentityToken(); const { data: { refreshToken, token }, } = await this.httpClient.post<{ token: string; refreshToken: string }>("/login", { identityToken: pubKeyAndIdentityToken.identityToken, }); - if (this.executionEnvironment === ExecutionEnvironment.NODE) { + if (!this.isBrowser) { this.httpClient.defaults.headers.common["Authorization"] = `Bearer ${token}`; this.refresh_token = refreshToken; } return { pubKeyAndIdentityToken, token, refreshToken }; } - private async refreshToken(): Promise<{ token: string; refreshToken: string }> { - try { - const { data } = await this.httpClient.get<{ token: string; refreshToken: string }>( - `/refresh_token${ - this.executionEnvironment === ExecutionEnvironment.BROWSER - ? "" - : `?refresh_token=${this.refresh_token}` - }`, - ); - return data; - } catch { - const loginResult = await this.login(); - this.pubKeyAndIdentityToken = loginResult.pubKeyAndIdentityToken; - return loginResult; - } - } - async getRoleDefinition({ namespace }: { namespace: string }) { const { data } = await this.httpClient.get(`/role/${namespace}`); return data?.definition; @@ -331,4 +304,17 @@ export class CacheServerClient implements ICacheServerClient { const { data } = await this.httpClient.get(`/assets/history/${id}?${query}`); return data; } + + private async refreshToken(): Promise<{ token: string; refreshToken: string }> { + try { + const { data } = await this.httpClient.get<{ token: string; refreshToken: string }>( + `/refresh_token${this.isBrowser ? "" : `?refresh_token=${this.refresh_token}`}`, + ); + return data; + } catch { + const loginResult = await this.login(); + this.pubKeyAndIdentityToken = loginResult.pubKeyAndIdentityToken; + return loginResult; + } + } } diff --git a/src/modules/cacheClient/cacheClient.types.ts b/src/modules/cacheClient/cacheClient.types.ts new file mode 100644 index 00000000..2a5a1814 --- /dev/null +++ b/src/modules/cacheClient/cacheClient.types.ts @@ -0,0 +1,9 @@ +export enum Order { + "ASC" = "ASC", + "DESC" = "DESC", +} + +export interface CacheServerClientOptions { + url: string; + cacheServerSupportsAuth?: boolean; +} diff --git a/src/modules/cacheClient/index.ts b/src/modules/cacheClient/index.ts new file mode 100644 index 00000000..69c429bc --- /dev/null +++ b/src/modules/cacheClient/index.ts @@ -0,0 +1,3 @@ +export * from "./ICacheClient"; +export * from "./cacheClient.service"; +export * from "./cacheClient.types"; diff --git a/src/modules/claims/claims.service.ts b/src/modules/claims/claims.service.ts new file mode 100644 index 00000000..4b860233 --- /dev/null +++ b/src/modules/claims/claims.service.ts @@ -0,0 +1,444 @@ +import { utils } from "ethers"; +import { v4 } from "uuid"; +import { JSONCodec } from "nats.ws"; +import { IRoleDefinition, PreconditionType } from "@energyweb/iam-contracts"; +import { Methods } from "@ew-did-registry/did"; +import { addressOf } from "@ew-did-registry/did-ethr-resolver"; +import { hashes, IProofData, IPublicClaim, ISaltedFields } from "@ew-did-registry/claims"; +import { DIDAttribute } from "@ew-did-registry/did-resolver-interface"; +import { ClaimManager } from "../../../ethers/ClaimManager"; +import { ClaimManager__factory } from "../../../ethers/factories/ClaimManager__factory"; +import { ERROR_MESSAGES } from "../../errors"; +import { emptyAddress } from "../../utils/constants"; +import { canonizeSig } from "../../utils/enrollment"; +import { CacheClient } from "../cacheClient/cacheClient.service"; +import { DomainsService } from "../domains/domains.service"; +import { ENSNamespaceTypes } from "../domains/domains.types"; +import { SignerService } from "../signer/signer.service"; +import { chainConfigs } from "../../config/chain.config"; +import { + IClaimIssuance, + IClaimRejection, + IClaimRequest, + RegistrationTypes, + defaultClaimExpiry, + erc712_type_hash, + proof_type_hash, + typedMsgPrefix, +} from "./claims.types"; +import { DidRegistry } from "../didRegistry/didRegistry.service"; +import { ClaimData } from "../didRegistry/did.types"; +import { MessagingService } from "../messaging/messaging.service"; +import { NATS_EXCHANGE_TOPIC } from "../messaging/messaging.types"; +import { isValidDID } from "../../utils/did"; + +const { id, keccak256, defaultAbiCoder, solidityKeccak256, namehash, arrayify } = utils; + +export class ClaimsService { + private _claimManager: ClaimManager; + private _jsonCodec = JSONCodec(); + + constructor( + private _signerService: SignerService, + private _domainsService: DomainsService, + private _cacheClient: CacheClient, + private _didRegistry: DidRegistry, + private _messagingService: MessagingService, + ) { + this._signerService.onInit(async () => this.init()); + } + + static async create( + signerService: SignerService, + domainsService: DomainsService, + cacheClient: CacheClient, + didRegistry: DidRegistry, + messagingService: MessagingService, + ) { + const service = new ClaimsService(signerService, domainsService, cacheClient, didRegistry, messagingService); + await service.init(); + return service; + } + + async init() { + const chainId = this._signerService.chainId; + const { claimManagerAddress } = chainConfigs()[chainId]; + this._claimManager = new ClaimManager__factory().attach(claimManagerAddress); + } + + async getClaimsBySubjects(subjects: string[]) { + return this._cacheClient.getClaimsBySubjects(subjects); + } + + /** + * @description - Returns claims for given requester. Allows filtering by status and parent namespace + */ + async getClaimsByRequester({ + did, + isAccepted, + namespace, + }: { + did: string; + isAccepted?: boolean; + namespace?: string; + }) { + return this._cacheClient.getClaimsByRequester({ did, isAccepted, namespace }); + } + + /** + * @description - Returns claims for given issuer. Allows filtering by status and parent namespace + */ + async getClaimsByIssuer({ did, isAccepted, namespace }: { did: string; isAccepted?: boolean; namespace?: string }) { + return this._cacheClient.getClaimsByIssuer({ did, isAccepted, namespace }); + } + + /** + * @description - Returns claims for given subject. Allows filtering by status and parent namespace + */ + async getClaimsBySubject({ + did, + isAccepted, + namespace, + }: { + did: string; + isAccepted?: boolean; + namespace?: string; + }) { + return this._cacheClient.getClaimsBySubject({ did, isAccepted, namespace }); + } + + async createClaimRequest({ + claim, + subject = this._didRegistry.did, + registrationTypes = [RegistrationTypes.OffChain], + }: { + claim: { claimType: string; claimTypeVersion: number; fields: { key: string; value: string | number }[] }; + subject?: string; + registrationTypes?: RegistrationTypes[]; + }) { + const { claimType: role, claimTypeVersion: version } = claim; + const token = await this.createPublicClaim({ data: claim, subject }); + + await this.verifyEnrolmentPrerequisites({ subject, role }); + + // temporarily, until claimIssuer is not removed from Claim entity + const issuer = [`did:${Methods.Erc1056}:${emptyAddress}`]; + + const message: IClaimRequest = { + id: v4(), + token, + claimIssuer: issuer, + requester: this._didRegistry.did, + registrationTypes, + }; + + if (registrationTypes.includes(RegistrationTypes.OnChain)) { + if (!version) { + throw new Error(ERROR_MESSAGES.ONCHAIN_ROLE_VERSION_NOT_SPECIFIED); + } + message.subjectAgreement = await this.approveRolePublishing({ subject, role, version }); + } + + issuer.map((issuerDID) => + this._messagingService.publish(`${issuerDID}.${NATS_EXCHANGE_TOPIC}`, this._jsonCodec.encode(message)), + ); + } + + async issueClaimRequest({ + requester, + token, + id, + subjectAgreement, + registrationTypes, + }: { + requester: string; + token: string; + id: string; + subjectAgreement: string; + registrationTypes: RegistrationTypes[]; + }) { + const { claimData, sub } = this._didRegistry.jwt.decode(token) as { + claimData: { claimType: string; claimTypeVersion: number; expiry: number }; + sub: string; + }; + + await this.verifyEnrolmentPrerequisites({ subject: sub, role: claimData.claimType }); + + const message: IClaimIssuance = { + id, + requester, + claimIssuer: [this._didRegistry.did], + acceptedBy: this._didRegistry.did, + }; + if (registrationTypes.includes(RegistrationTypes.OffChain)) { + const publicClaim: IPublicClaim = { + did: sub, + signer: this._didRegistry.did, + claimData, + }; + message.issuedToken = await this._didRegistry.issuePublicClaim({ + publicClaim, + }); + } + if (registrationTypes.includes(RegistrationTypes.OnChain)) { + const { claimType: role, claimTypeVersion: version } = claimData; + const expiry = claimData.expiry === undefined ? defaultClaimExpiry : claimData.expiry; + const onChainProof = await this.createOnChainProof(role, version, expiry, sub); + const data = this._claimManager.interface.encodeFunctionData("register", [ + addressOf(sub), + namehash(role), + version, + expiry, + addressOf(this._didRegistry.did), + subjectAgreement, + onChainProof, + ]); + await this._signerService.send({ + to: this._claimManager.address, + data, + }); + message.onChainProof = onChainProof; + } + + const dataToSend = this._jsonCodec?.encode(message); + this._messagingService.publish(`${requester}.${NATS_EXCHANGE_TOPIC}`, dataToSend); + } + + async rejectClaimRequest({ id, requesterDID }: { id: string; requesterDID: string }) { + const preparedData: IClaimRejection = { + id, + requester: requesterDID, + claimIssuer: [this._didRegistry.did], + isRejected: true, + }; + + const dataToSend = this._jsonCodec?.encode(preparedData); + this._messagingService.publish(`${requesterDID}.${NATS_EXCHANGE_TOPIC}`, dataToSend); + } + + async deleteClaim({ id }: { id: string }) { + await this._cacheClient.deleteClaim({ claimId: id }); + } + + /** + * createPublicClaim + * + * @description create a public claim based on data provided + * @returns JWT token of created claim + * + */ + async createPublicClaim({ data, subject }: { data: ClaimData; subject?: string }) { + return this._didRegistry.createPublicClaim({ data, subject }); + } + + async getClaimId({ claimData }: { claimData: ClaimData }) { + const { service = [] } = await this._didRegistry.getDidDocument(); + const { id, claimTypeVersion } = + service.find( + ({ profile, claimType, claimTypeVersion }) => + Boolean(profile) || + (claimType === claimData.claimType && claimTypeVersion === claimData.claimTypeVersion), + ) || {}; + + if (claimData.profile && id) { + return id; + } + + if (claimData.claimType && id && claimData.claimTypeVersion === claimTypeVersion) { + return id; + } + return v4(); + } + + /** + * publishPublicClaim + * + * @description store claim data in ipfs and save url to DID document services + * @returns ulr to ipfs + * + */ + async publishPublicClaim({ token }: { token: string }) { + const payload = (await this._didRegistry.decodeJWTToken({ token })) as { + iss: string; + sub: string; + claimData: ClaimData; + }; + const { iss, claimData } = payload; + let sub = payload.sub; + // Initialy subject was ignored because it was requester + if (!sub || sub.length === 0 || !isValidDID(sub)) { + sub = this._didRegistry.did; + } + + if (!(await this._didRegistry.verifyPublicClaim(token, iss))) { + throw new Error("Incorrect signature"); + } + + const url = await this._didRegistry.ipfsStore.save(token); + const data = { + type: DIDAttribute.ServicePoint, + value: { + id: await this.getClaimId({ claimData }), + serviceEndpoint: url, + hash: hashes.SHA256(token), + hashAlg: "SHA256", + }, + }; + await this._didRegistry.updateDocument({ didAttribute: DIDAttribute.ServicePoint, data, did: sub }); + + return url; + } + + /** + * createProofClaim + * + * @description creates a proof of a claim + * @returns proof token + * + */ + async createProofClaim({ claimUrl, saltedFields }: { claimUrl: string; saltedFields: ISaltedFields }) { + const encryptedSaltedFields: IProofData = {}; + let counter = 0; + Object.entries(saltedFields).forEach(([key, value]) => { + if (counter % 2 === 0) { + encryptedSaltedFields[key] = { + value, + encrypted: true, + }; + } else { + encryptedSaltedFields[key] = { + value, + encrypted: false, + }; + } + counter++; + }); + return this._didRegistry.createProofClaim({ claimUrl, encryptedSaltedFields }); + } + + /** + * createSelfSignedClaim + * + * @description creates self signed claim and upload the data to ipfs + * + */ + async createSelfSignedClaim({ data, subject }: { data: ClaimData; subject?: string }) { + const token = await this.createPublicClaim({ data, subject }); + return this.publishPublicClaim({ token }); + } + + /** + * getUserClaims + * + * @description get user claims + * + */ + async getUserClaims({ did = this._didRegistry.did }: { did?: string } | undefined = {}) { + const { service } = (await this._didRegistry.getDidDocument({ did })) || {}; + return service; + } + + private async verifyEnrolmentPrerequisites({ subject, role }: { subject: string; role: string }) { + const roleDefinition = await this._domainsService.getDefinition({ + type: ENSNamespaceTypes.Roles, + namespace: role, + }); + + if (!roleDefinition) { + throw new Error(ERROR_MESSAGES.ROLE_NOT_EXISTS); + } + + const { enrolmentPreconditions } = roleDefinition as IRoleDefinition; + + if (!enrolmentPreconditions || enrolmentPreconditions.length === 0) return; + + const enroledRoles = new Set( + (await this.getClaimsBySubject({ did: subject, isAccepted: true })).map(({ claimType }) => claimType), + ); + const requiredRoles = new Set( + enrolmentPreconditions + .filter(({ type }) => type === PreconditionType.Role) + .map(({ conditions }) => conditions) + .reduce((all, cur) => all.concat(cur), []), + ); + if (Array.from(requiredRoles).some((role) => !enroledRoles.has(role))) { + throw new Error(ERROR_MESSAGES.ROLE_PREREQUISITES_NOT_MET); + } + } + + private async createOnChainProof(role: string, version: number, expiry: number, subject: string): Promise { + const messageId = Buffer.from(typedMsgPrefix, "hex"); + + const chainId = await this._signerService.chainId; + const domainSeparator = utils.keccak256( + defaultAbiCoder.encode( + ["bytes32", "bytes32", "bytes32", "uint256", "address"], + [erc712_type_hash, utils.id("Claim Manager"), utils.id("1.0"), chainId, this._claimManager.address], + ), + ); + + const proofHash = solidityKeccak256( + ["bytes", "bytes32", "bytes32"], + [ + messageId, + domainSeparator, + utils.keccak256( + defaultAbiCoder.encode( + ["bytes32", "address", "bytes32", "uint", "uint", "address"], + [ + proof_type_hash, + addressOf(subject), + namehash(role), + version, + expiry, + this._signerService.address, + ], + ), + ), + ], + ); + + return canonizeSig(await this._signerService.signMessage(arrayify(proofHash))); + } + + private async approveRolePublishing({ + subject, + role, + version, + }: { + subject: string; + role: string; + version: number; + }) { + const erc712_type_hash = id( + "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)", + ); + const agreement_type_hash = id("Agreement(address subject,bytes32 role,uint256 version)"); + + const chainId = await this._signerService.chainId; + const domainSeparator = keccak256( + defaultAbiCoder.encode( + ["bytes32", "bytes32", "bytes32", "uint256", "address"], + [erc712_type_hash, id("Claim Manager"), id("1.0"), chainId, this._claimManager.address], + ), + ); + + const messageId = Buffer.from(typedMsgPrefix, "hex"); + + const agreementHash = solidityKeccak256( + ["bytes", "bytes32", "bytes32"], + [ + messageId, + domainSeparator, + keccak256( + defaultAbiCoder.encode( + ["bytes32", "address", "bytes32", "uint256"], + [agreement_type_hash, addressOf(subject), namehash(role), version], + ), + ), + ], + ); + + return canonizeSig(await this._signerService.signer.signMessage(arrayify(agreementHash))); + } +} diff --git a/src/modules/claims/claims.types.ts b/src/modules/claims/claims.types.ts new file mode 100644 index 00000000..3d303c06 --- /dev/null +++ b/src/modules/claims/claims.types.ts @@ -0,0 +1,53 @@ +import { utils } from "ethers"; +import { IMessage } from "../messaging/messaging.types"; + +export interface IClaimRequest extends IMessage { + token: string; + registrationTypes: RegistrationTypes[]; + subjectAgreement?: string; +} + +export interface IClaimIssuance extends IMessage { + // issuedToken is is only provided in the case of off-chain role + issuedToken?: string; + // onChainProof is only provided in case of on-chain role + onChainProof?: string; + acceptedBy: string; +} + +export interface IClaimRejection extends IMessage { + isRejected: boolean; +} + +export enum RegistrationTypes { + OffChain = "RegistrationTypes::OffChain", + OnChain = "RegistrationTypes::OnChain", +} + +export interface Claim { + id: string; + requester: string; + subject: string; + claimIssuer: string[]; + claimType: string; + claimTypeVersion: string; + registrationTypes: RegistrationTypes[]; + token: string; + subjectAgreement?: string; + onChainProof?: string; + issuedToken?: string; + isAccepted: boolean; + acceptedBy?: string; + isRejected?: boolean; + namespace: string; +} + +export const typedMsgPrefix = "1901"; +export const erc712_type_hash = utils.id( + "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)", +); +export const agreement_type_hash = utils.id("Agreement(address subject,bytes32 role,uint256 version)"); +export const proof_type_hash = utils.id( + "Proof(address subject,bytes32 role,uint256 version,uint256 expiry,address issuer)", +); +export const defaultClaimExpiry = Number.MAX_SAFE_INTEGER - 1; // constraint of ethers.BigNumber diff --git a/src/modules/claims/index.ts b/src/modules/claims/index.ts new file mode 100644 index 00000000..f5a2938a --- /dev/null +++ b/src/modules/claims/index.ts @@ -0,0 +1,2 @@ +export * from "./claims.service"; +export * from "./claims.types"; diff --git a/src/modules/didRegistry/did.types.ts b/src/modules/didRegistry/did.types.ts new file mode 100644 index 00000000..907ec08b --- /dev/null +++ b/src/modules/didRegistry/did.types.ts @@ -0,0 +1,21 @@ +export interface AssetProfile { + name?: string; + icon?: string; +} + +export interface AssetProfiles { + [key: string]: AssetProfile; +} + +export interface Profile { + name?: string; + birthdate?: string; + address?: string; + assetProfiles?: AssetProfiles; +} + +export interface ClaimData extends Record { + profile?: Profile; + claimType?: string; + claimTypeVersion?: number; +} diff --git a/src/modules/didRegistry/didRegistry.service.ts b/src/modules/didRegistry/didRegistry.service.ts new file mode 100644 index 00000000..4eee5bcb --- /dev/null +++ b/src/modules/didRegistry/didRegistry.service.ts @@ -0,0 +1,275 @@ +import { Wallet, providers } from "ethers"; +import { AxiosError } from "axios"; +import { JWT } from "@ew-did-registry/jwt"; +import { ProxyOperator } from "@ew-did-registry/proxyidentity"; +import { addressOf, EwSigner, Operator } from "@ew-did-registry/did-ethr-resolver"; +import { + Algorithms, + DIDAttribute, + Encoding, + IServiceEndpoint, + IUpdateData, + KeyTags, + ProviderTypes, +} from "@ew-did-registry/did-resolver-interface"; +import { DIDDocumentFull, IDIDDocumentFull } from "@ew-did-registry/did-document"; +import { DidStore } from "@ew-did-registry/did-ipfs-store"; +import { Methods } from "@ew-did-registry/did"; +import { ClaimsIssuer, ClaimsUser, IProofData, IPublicClaim } from "@ew-did-registry/claims"; +import { SignerService } from "../signer/signer.service"; +import { ERROR_MESSAGES } from "../../errors"; +import { CacheClient } from "../cacheClient/cacheClient.service"; +import { ClaimData } from "../didRegistry/did.types"; +import { chainConfigs } from "../../config/chain.config"; +import { AssetsService } from "../assets/assets.service"; + +const { JsonRpcProvider } = providers; + +export class DidRegistry { + private _identityOwner: EwSigner; + private _operator: Operator; + private _did: string; + private _document: IDIDDocumentFull; + private _ipfsStore: DidStore; + private _jwt: JWT; + private _userClaims: ClaimsUser; + private _issuerClaims: ClaimsIssuer; + + constructor( + private _signerService: SignerService, + private _cacheClient: CacheClient, + private _assetsService: AssetsService, + private _ipfsUrl = "https://ipfs.infura.io:5001/api/v0/", + ) { + this._signerService.onInit(async () => await this.init()); + } + + static async connect( + signerService: SignerService, + cacheClient: CacheClient, + assetsService: AssetsService, + ipfsUrl?: string, + ) { + const registry = new DidRegistry(signerService, cacheClient, assetsService, ipfsUrl); + await registry.init(); + return registry; + } + + get did() { + return `did:${Methods.Erc1056}:${this._signerService.address}`; + } + + get jwt() { + return this._jwt; + } + + // temporarily, to allow claim service to save claim + get ipfsStore() { + return this._ipfsStore; + } + + async init() { + this._ipfsStore = new DidStore(this._ipfsUrl); + await this._setOperator(); + this.setJWT(); + await this._setDocument(); + this._setClaims(); + } + + async getDidDocument({ + did = this._did, + includeClaims = true, + }: { did?: string; includeClaims?: boolean } | undefined = {}) { + if (this._cacheClient) { + try { + const didDoc = await this._cacheClient.getDidDocument({ did, includeClaims }); + return { + ...didDoc, + service: didDoc.service as (IServiceEndpoint & ClaimData)[], + }; + } catch (err) { + if ((err as AxiosError).response?.status === 401) { + throw err; + } + console.log(err); + } + } + + const document = await this._operator.read(did); + return { + ...document, + service: includeClaims + ? await this.downloadClaims({ + services: document.service && document.service.length > 0 ? document.service : [], + }) + : [], + }; + } + + /** + * createPublicClaim + * + * @description create a public claim based on data provided + * @returns JWT token of created claim + * + */ + async createPublicClaim({ data, subject }: { data: ClaimData; subject?: string }) { + if (subject) { + return this._userClaims.createPublicClaim(data, { subject, issuer: "" }); + } + return this._userClaims.createPublicClaim(data); + } + + async createProofClaim({ + claimUrl, + encryptedSaltedFields, + }: { + claimUrl: string; + encryptedSaltedFields: IProofData; + }) { + await this._userClaims.createProofClaim(claimUrl, encryptedSaltedFields); + } + + /** + * issuePublicClaim + * + * @description issue a public claim + * @returns return issued token + * + */ + async issuePublicClaim({ token, publicClaim }: { token?: string; publicClaim?: IPublicClaim }) { + if (publicClaim) { + return this._issuerClaims.issuePublicClaim(publicClaim); + } + if (token) { + return this._issuerClaims.issuePublicClaim(token); + } + throw new Error("unable to issue Public Claim"); + } + + /** + * verifyPublicClaim + * + * @description verifies issued token of claim + * @returns public claim data + * + */ + async verifyPublicClaim(token: string, iss: string) { + return this._userClaims.verifySignature(token, iss); + } + + /** + * @param options Options to connect with blockchain + * + * @param options.didAttribute Type of document to be updated + * + * @param options.data New attribute value + * @param options.did Asset did to be updated + * @param options.validity Time (s) for the attribute to expire + * + * @description updates did document based on data provided + * @returns true if document is updated successfuly + * + */ + async updateDocument(options: { + didAttribute: DIDAttribute; + data: IUpdateData; + did?: string; + validity?: number; + }): Promise { + const { didAttribute, data, validity, did } = options; + + if (!did) { + const updated = await this._document.update(didAttribute, data, validity); + return Boolean(updated); + } else if (!(await this._assetsService.getOwnedAssets()).find((a) => a.document.id === did)) { + throw new Error(ERROR_MESSAGES.CAN_NOT_UPDATE_NOT_CONTROLLED_DOCUMENT); + } + + const updateData: IUpdateData = { + algo: Algorithms.Secp256k1, + encoding: Encoding.HEX, + ...data, + }; + + const { didRegistryAddress: didContractAddress } = chainConfigs()[this._signerService.chainId]; + const operator = new ProxyOperator(this._identityOwner, { address: didContractAddress }, addressOf(did)); + const update = await operator.update(did, didAttribute, updateData); + + return Boolean(update); + } + + /** + * revokeDidDocument + * + * @description revokes did document + * @returns information (true/false) if the DID document was revoked + * + */ + async revokeDidDocument(): Promise { + await this._document.deactivate(); + return true; + } + + async decodeJWTToken({ token }: { token: string }) { + return this._jwt.decode(token); + } + + private async _setOperator() { + const signer = this._signerService.signer; + const provider = signer.provider; + const publicKey = await this._signerService.publicKey(); + if (signer instanceof Wallet && provider instanceof JsonRpcProvider) { + this._identityOwner = EwSigner.fromPrivateKey(signer.privateKey, { + type: ProviderTypes.HTTP, + uriOrInfo: provider.connection.url, + }); + } else if (provider instanceof JsonRpcProvider) { + this._identityOwner = EwSigner.fromEthersSigner(signer, publicKey); + // TODO from EIP1193Provider + } else { + throw new Error(ERROR_MESSAGES.UNKNOWN_PROVIDER); + } + + this._did = `did:${Methods.Erc1056}:${await signer.getAddress()}`; + const address = chainConfigs()[this._signerService.chainId].didRegistryAddress; + this._operator = new Operator(this._identityOwner, { address }); + } + + private setJWT() { + this._jwt = new JWT(this._identityOwner); + } + + private async _setDocument() { + this._document = new DIDDocumentFull(this._did, this._operator); + if (this._cacheClient) { + const cachedDoc = await this._cacheClient.getDidDocument({ did: this._did }); + const pubKey = cachedDoc.publicKey.find((pk) => pk.id.endsWith(KeyTags.OWNER)); + if (!pubKey) { + await this._document.create(); + } + } + } + + private _setClaims() { + this._userClaims = new ClaimsUser(this._identityOwner, this._document, this._ipfsStore); + this._issuerClaims = new ClaimsIssuer(this._identityOwner, this._document, this._ipfsStore); + } + + private async downloadClaims({ services }: { services: IServiceEndpoint[] }) { + return Promise.all( + services.map(async ({ serviceEndpoint, ...rest }) => { + const data = await this._ipfsStore.get(serviceEndpoint); + const { claimData, ...claimRest } = this._jwt?.decode(data) as { + claimData: ClaimData; + }; + return { + serviceEndpoint, + ...rest, + ...claimData, + ...claimRest, + } as IServiceEndpoint & ClaimData; + }), + ); + } +} diff --git a/src/modules/didRegistry/index.ts b/src/modules/didRegistry/index.ts new file mode 100644 index 00000000..f24f666f --- /dev/null +++ b/src/modules/didRegistry/index.ts @@ -0,0 +1,2 @@ +export * from "./didRegistry.service"; +export * from "./did.types"; diff --git a/src/modules/domains/domains.service.ts b/src/modules/domains/domains.service.ts new file mode 100644 index 00000000..3440b41d --- /dev/null +++ b/src/modules/domains/domains.service.ts @@ -0,0 +1,999 @@ +import { BigNumber, utils } from "ethers"; +import { + IAppDefinition, + IOrganizationDefinition, + IRoleDefinition, + EncodedCall, + DomainReader, + DomainTransactionFactory, + ResolverContractType, + DomainHierarchy, +} from "@energyweb/iam-contracts"; +import { ENSRegistry } from "../../../ethers/ENSRegistry"; +import { ENSRegistry__factory } from "../../../ethers/factories/ENSRegistry__factory"; +import { chainConfigs } from "../../config/chain.config"; +import { + ChangeOwnershipNotPossibleError, + DeletingNamespaceNotPossibleError, + ENSTypeNotSupportedError, + ERROR_MESSAGES, +} from "../../errors"; +import { emptyAddress } from "../../utils/constants"; +import { parseDID } from "../../utils/did"; +import { labelhash } from "../../utils/ENS_hash"; +import { CacheClient } from "../cacheClient/cacheClient.service"; +import { RegistrationTypes } from "../claims/claims.types"; +import { SignerService } from "../signer/signer.service"; +import { ENSNamespaceTypes, IOrganization } from "./domains.types"; + +const { namehash } = utils; + +export class DomainsService { + private chainId: number; + private _ensRegistry: ENSRegistry; + private _domainDefinitionReader: DomainReader; + private _domainDefinitionTransactionFactory: DomainTransactionFactory; + private _domainHierarchy: DomainHierarchy; + private _owner: string; + private _ensRegistryAddress: string; + private _ensResolverAddress: string; + private _ensPublicResolverAddress: string; + private _ttl = BigNumber.from(0); + + constructor(private _signerService: SignerService, private _cacheClient: CacheClient) { + this._signerService.onInit(async () => await this.init()); + } + + static async create(signerService: SignerService, cacheClient: CacheClient) { + const service = new DomainsService(signerService, cacheClient); + await service.init(); + return service; + } + + async init() { + const chainId = this._signerService.chainId; + const provider = this._signerService.signer.provider; + const { ensRegistryAddress, ensResolverAddress, ensPublicResolverAddress, domainNotifierAddress } = + chainConfigs()[chainId]; + this._ensRegistryAddress = ensRegistryAddress; + this._ensResolverAddress = ensResolverAddress; + this._ensPublicResolverAddress = ensPublicResolverAddress; + this._ensRegistry = new ENSRegistry__factory().attach(ensRegistryAddress).connect(provider); + this._domainDefinitionReader = new DomainReader({ + ensRegistryAddress, + provider, + }); + ensPublicResolverAddress && + this._domainDefinitionReader.addKnownResolver({ + chainId, + address: ensPublicResolverAddress, + type: ResolverContractType.PublicResolver, + }); + ensResolverAddress && + this._domainDefinitionReader.addKnownResolver({ + chainId, + address: ensResolverAddress, + type: ResolverContractType.RoleDefinitionResolver_v1, + }); + this._domainDefinitionTransactionFactory = new DomainTransactionFactory({ + domainResolverAddress: ensResolverAddress, + }); + this._domainHierarchy = new DomainHierarchy({ + domainReader: this._domainDefinitionReader, + ensRegistryAddress: this._ensRegistryAddress, + provider, + domainNotifierAddress: domainNotifierAddress, + publicResolverAddress: ensPublicResolverAddress, + }); + this._owner = await this._signerService.signer.getAddress(); + } + + /** + * setRoleDefinition + * + * @description sets role definition in ENS domain + * @description please use it only when you want to update role definitions for already created role (domain) + * + */ + async setRoleDefinition({ + domain, + data, + }: { + domain: string; + data: IAppDefinition | IOrganizationDefinition | IRoleDefinition; + }) { + // Special case of updating legacy PublicResolver definitions + if (await this.updateLegacyDefinition(domain, data)) { + return; + } + // Standard update + await this._signerService.send({ + ...this._domainDefinitionTransactionFactory.editDomain({ domain, domainDefinition: data }), + }); + } + + /** + * createOrganization + * + * @description creates organization (create subdomain, sets the domain name and sets the role definition to metadata record in ENS Domain) + * @description and sets subdomain for roles and app for org namespace + * + */ + async createOrganization({ + orgName, + namespace, + data, + returnSteps, + }: { + orgName: string; + data: IOrganizationDefinition; + namespace: string; + returnSteps?: boolean; + }) { + const orgDomain = `${orgName}.${namespace}`; + const rolesDomain = `${ENSNamespaceTypes.Roles}.${orgDomain}`; + const appsDomain = `${ENSNamespaceTypes.Application}.${orgDomain}`; + if (!(await this.isOwner({ domain: namespace, user: this._owner }))) { + throw new Error(ERROR_MESSAGES.NOT_AUTHORIZED_TO_CHANGE_DOMAIN); + } + const steps = [ + { + tx: this.createSubdomainTx({ domain: namespace, nodeName: orgName, owner: this._owner }), + info: "Create organization subdomain", + }, + { + tx: this._domainDefinitionTransactionFactory.newDomain({ + domain: orgDomain, + domainDefinition: data, + }), + info: "Register reverse name and set definition for organization subdomain", + }, + { + tx: this.createSubdomainTx({ + domain: orgDomain, + nodeName: ENSNamespaceTypes.Roles, + owner: this._owner, + }), + info: "Create roles subdomain for organization", + }, + { + tx: this._domainDefinitionTransactionFactory.setDomainNameTx({ domain: rolesDomain }), + info: "Register reverse name for roles subdomain", + }, + { + tx: this.createSubdomainTx({ + domain: orgDomain, + nodeName: ENSNamespaceTypes.Application, + owner: this._owner, + }), + info: "Create app subdomain for organization", + }, + { + tx: this._domainDefinitionTransactionFactory.setDomainNameTx({ domain: appsDomain }), + info: "Register reverse name for app subdomain", + }, + ].map((step) => ({ + ...step, + next: async () => { + await this._signerService.send({ ...step.tx }); + }, + })); + if (returnSteps) { + return steps; + } else { + for await (const step of steps) { + await step.next(); + } + return; + } + } + + /** + * createApp + * + * @description creates role (create subdomain, sets the domain name and sets the role definition to metadata record in ENS Domain) + * @description creates roles subdomain for the app namespace + * + */ + async createApplication({ + appName, + namespace: domain, + data, + returnSteps, + }: { + namespace: string; + appName: string; + data: IAppDefinition; + returnSteps?: boolean; + }) { + const appDomain = `${appName}.${domain}`; + const from = await this.getOwner({ namespace: domain }); + const steps = [ + { + tx: this.createSubdomainTx({ domain, nodeName: appName, owner: from }), + info: "Set subdomain for application", + }, + { + tx: this._domainDefinitionTransactionFactory.newDomain({ domainDefinition: data, domain: appDomain }), + info: "Set name definition for application", + }, + { + tx: this.createSubdomainTx({ + domain: appDomain, + nodeName: ENSNamespaceTypes.Roles, + owner: from, + }), + info: "Create roles subdomain for application", + }, + { + tx: this._domainDefinitionTransactionFactory.setDomainNameTx({ + domain: `${ENSNamespaceTypes.Roles}.${appDomain}`, + }), + info: "Set name for roles subdomain for application", + }, + ].map((step) => ({ + ...step, + next: async () => { + await this._signerService.send(step.tx); + }, + })); + if (returnSteps) { + return steps; + } + for await (const step of steps) { + await step.next(); + } + return; + } + + /** + * createRole + * + * @description creates role (create subdomain, sets the domain name and sets the role definition to metadata record in ENS Domain) + * @returns information (true/false) if the role was created + * + */ + async createRole({ + roleName, + namespace, + data, + returnSteps, + }: { + roleName: string; + namespace: string; + data: IRoleDefinition; + returnSteps?: boolean; + }) { + const newDomain = `${roleName}.${namespace}`; + const from = await this.getOwner({ namespace }); + const steps = [ + { + tx: this.createSubdomainTx({ domain: namespace, nodeName: roleName, owner: from }), + info: "Create subdomain for role", + }, + { + tx: this._domainDefinitionTransactionFactory.newRole({ domain: newDomain, roleDefinition: data }), + info: "Set name and definition for role", + }, + ].map((step) => ({ + ...step, + next: async () => { + await this._signerService.send(step.tx); + }, + })); + if (returnSteps) { + return steps; + } + for await (const step of steps) { + await step.next(); + } + return; + } + + async readName(namehash: string) { + return this._domainDefinitionReader.readName(namehash); + } + + /** + * changeOrgOwnership + * + * @description change owner ship of org subdomain and all org owned roles subdomains + * @returns return array of steps needed to change ownership + * + */ + async changeOrgOwnership({ + namespace, + newOwner, + returnSteps = false, + }: { + namespace: string; + newOwner: string; + returnSteps?: boolean; + }) { + newOwner = parseDID(newOwner); + const orgNamespaces = [ + `${ENSNamespaceTypes.Roles}.${namespace}`, + `${ENSNamespaceTypes.Application}.${namespace}`, + namespace, + ]; + const { alreadyFinished, changeOwnerNamespaces, notOwnedNamespaces } = await this.validateChangeOwnership({ + newOwner, + namespaces: orgNamespaces, + }); + + if (notOwnedNamespaces.length > 0) { + throw new ChangeOwnershipNotPossibleError({ namespace, notOwnedNamespaces }); + } + + const apps = this._cacheClient + ? await this.getAppsByOrgNamespace({ namespace }) + : await this.getSubdomains({ + domain: `${ENSNamespaceTypes.Application}.${namespace}`, + }); + if (apps && apps.length > 0) { + throw new Error("You are not able to change ownership of organization with registered apps"); + } + + if (alreadyFinished.length > 0) { + console.log(`Already changed ownership of ${alreadyFinished.join(", ")}`); + } + + const steps = changeOwnerNamespaces.map((namespace) => { + const tx = this.changeDomainOwnerTx({ newOwner, namespace }); + return { + tx, + next: async ({ retryCheck }: { retryCheck?: boolean } = {}) => { + if (retryCheck) { + const owner = await this.getOwner({ namespace }); + if (owner === newOwner) return; + } + return this._signerService.send(tx); + }, + info: `Changing ownership of ${namespace}`, + }; + }); + + if (returnSteps) { + return steps; + } + for await (const step of steps) { + await step.next(); + } + return; + } + + /** + * changeAppOwnership + * + * @description change owner ship of app subdomain and all app owned subdomains + * @returns return array of steps needed to change ownership + * + */ + async changeAppOwnership({ + namespace, + newOwner, + returnSteps, + }: { + namespace: string; + newOwner: string; + returnSteps?: boolean; + }) { + newOwner = parseDID(newOwner); + const appNamespaces = [`${ENSNamespaceTypes.Roles}.${namespace}`, namespace]; + + const { alreadyFinished, changeOwnerNamespaces, notOwnedNamespaces } = await this.validateChangeOwnership({ + newOwner, + namespaces: appNamespaces, + }); + + if (notOwnedNamespaces.length > 0) { + throw new ChangeOwnershipNotPossibleError({ namespace, notOwnedNamespaces }); + } + + if (alreadyFinished.length > 0) { + console.log(`Already changed ownership of ${alreadyFinished.join(", ")}`); + } + + const steps = changeOwnerNamespaces.map((namespace) => { + const tx = this.changeDomainOwnerTx({ newOwner, namespace }); + return { + tx, + next: async ({ retryCheck }: { retryCheck?: boolean } = {}) => { + if (retryCheck) { + const owner = await this.getOwner({ namespace }); + if (owner === newOwner) return; + } + return this._signerService.send(tx); + }, + info: `Changing ownership of ${namespace}`, + }; + }); + + if (returnSteps) { + return steps; + } + for await (const step of steps) { + await step.next(); + } + return; + } + + /** + * changeRoleOwnership + * + * @description change ownership of role subdomain + * + */ + async changeRoleOwnership({ namespace, newOwner }: { namespace: string; newOwner: string }) { + newOwner = parseDID(newOwner); + const notOwnedNamespaces = await this.validateOwnership({ + namespace, + type: ENSNamespaceTypes.Roles, + }); + if (notOwnedNamespaces.length > 0) { + throw new ChangeOwnershipNotPossibleError({ namespace, notOwnedNamespaces }); + } + await this._signerService.send(this.changeDomainOwnerTx({ namespace, newOwner })); + } + + /** + * deleteOrganization + * + * @description delete organization and roles + * + */ + async deleteOrganization({ namespace, returnSteps }: { namespace: string; returnSteps?: boolean }) { + const apps = this._cacheClient + ? await this.getAppsByOrgNamespace({ namespace }) + : await this.getSubdomains({ + domain: `${ENSNamespaceTypes.Application}.${namespace}`, + }); + if (apps && apps.length > 0) { + throw new Error(ERROR_MESSAGES.ORG_WITH_APPS); + } + + const roles = this._cacheClient + ? await this._cacheClient.getOrganizationRoles({ namespace }) + : await this.getSubdomains({ domain: `${ENSNamespaceTypes.Roles}.${namespace}` }); + + if (roles && roles.length > 0) { + throw new Error(ERROR_MESSAGES.ORG_WITH_ROLES); + } + + const orgNamespaces = [ + `${ENSNamespaceTypes.Roles}.${namespace}`, + `${ENSNamespaceTypes.Application}.${namespace}`, + namespace, + ]; + + const { alreadyFinished, namespacesToDelete, notOwnedNamespaces } = await this.validateDeletePossibility({ + namespaces: orgNamespaces, + }); + + if (notOwnedNamespaces.length > 0) { + throw new DeletingNamespaceNotPossibleError({ namespace, notOwnedNamespaces }); + } + + if (alreadyFinished.length > 0) { + console.log(`Already deleted: ${alreadyFinished.join(", ")}`); + } + + const steps = namespacesToDelete.map((namespace) => { + const tx = this.deleteDomainTx({ namespace }); + return { + tx, + next: async ({ retryCheck }: { retryCheck?: boolean } = {}) => { + if (retryCheck) { + const owner = await this.getOwner({ namespace }); + if (owner === emptyAddress) return; + } + return this._signerService.send(tx); + }, + info: `Deleting ${namespace}`, + }; + }); + + if (returnSteps) { + return steps; + } + for await (const step of steps) { + await step.next(); + } + return; + } + + /** + * deleteApplication + * + * @description delete application and roles + * + */ + async deleteApplication({ namespace, returnSteps }: { namespace: string; returnSteps?: boolean }) { + const roles = this._cacheClient + ? await this._cacheClient.getApplicationRoles({ namespace }) + : await this.getSubdomains({ domain: `${ENSNamespaceTypes.Roles}.${namespace}` }); + + if (roles && roles.length > 0) { + throw new Error(ERROR_MESSAGES.APP_WITH_ROLES); + } + + const appNamespaces = [`${ENSNamespaceTypes.Roles}.${namespace}`, namespace]; + + const { alreadyFinished, namespacesToDelete, notOwnedNamespaces } = await this.validateDeletePossibility({ + namespaces: appNamespaces, + }); + + if (notOwnedNamespaces.length > 0) { + throw new DeletingNamespaceNotPossibleError({ namespace, notOwnedNamespaces }); + } + + if (alreadyFinished.length > 0) { + console.log(`Already deleted: ${alreadyFinished.join(", ")}`); + } + + const steps = namespacesToDelete.map((namespace) => { + const tx = this.deleteDomainTx({ namespace }); + return { + tx, + next: async ({ retryCheck }: { retryCheck?: boolean } = {}) => { + if (retryCheck) { + const owner = await this.getOwner({ namespace }); + if (owner === emptyAddress) return; + } + return this._signerService.send(tx); + }, + info: `Deleting ${namespace}`, + }; + }); + + if (returnSteps) { + return steps; + } + for await (const step of steps) { + await step.next(); + } + return; + } + + /** + * deleteRole + * + * @description delete role + * + */ + async deleteRole({ namespace }: { namespace: string }) { + const notOwnedNamespaces = await this.validateOwnership({ + namespace, + type: ENSNamespaceTypes.Roles, + }); + if (notOwnedNamespaces.length > 0) { + throw new DeletingNamespaceNotPossibleError({ namespace, notOwnedNamespaces }); + } + await this._signerService.send(this.deleteDomainTx({ namespace })); + } + + /** + * getRoleDefinition + * + * @description get role definition form ens domain metadata record + * @returns metadata string or empty string when there is no metadata + * + */ + async getDefinition({ + type, + namespace, + }: { + type: ENSNamespaceTypes; + namespace: string; + }): Promise { + if (type === ENSNamespaceTypes.Roles) { + return this._cacheClient.getRoleDefinition({ namespace }); + } + if (type === ENSNamespaceTypes.Application) { + return this._cacheClient.getAppDefinition({ namespace }); + } + if (type === ENSNamespaceTypes.Organization) { + return this._cacheClient.getOrgDefinition({ namespace }); + } + throw new ENSTypeNotSupportedError(); + } + + /** + * getRolesByNamespace + * + * @description get all subdomains for certain domain + * @returns array of subdomains or empty array when there is no subdomains + * + */ + getRolesByNamespace({ + parentType, + namespace, + }: { + parentType: ENSNamespaceTypes.Application | ENSNamespaceTypes.Organization; + namespace: string; + }) { + if (parentType === ENSNamespaceTypes.Organization) { + return this._cacheClient.getOrganizationRoles({ namespace }); + } + if (parentType === ENSNamespaceTypes.Application) { + return this._cacheClient.getApplicationRoles({ namespace }); + } + throw new ENSTypeNotSupportedError(); + } + + /** + * getENSTypesByOwner + */ + getENSTypesByOwner({ + type, + owner, + excludeSubOrgs = false, + }: { + type: ENSNamespaceTypes; + owner: string; + excludeSubOrgs?: boolean; + }) { + owner = parseDID(owner); + if (type === ENSNamespaceTypes.Organization) { + return this._cacheClient.getOrganizationsByOwner({ owner, excludeSubOrgs }); + } + if (type === ENSNamespaceTypes.Application) { + return this._cacheClient.getApplicationsByOwner({ owner }); + } + if (type === ENSNamespaceTypes.Roles) { + return this._cacheClient.getRolesByOwner({ owner }); + } + throw new ENSTypeNotSupportedError(); + } + + /** + * getENSTypesBySearchPhrase + */ + getENSTypesBySearchPhrase({ types, search }: { types?: ("App" | "Org" | "Role")[]; search: string }) { + return this._cacheClient.getNamespaceBySearchPhrase({ search, types }); + } + + /** + * getENSTypesByOwner + * + * @description get all applications for organization namespace + * @returns array of subdomains or empty array when there is no subdomains + * + */ + getAppsByOrgNamespace({ namespace }: { namespace: string }) { + return this._cacheClient.getApplicationsByOrganization({ namespace }); + } + + /** + * getSubOrgsByOrgNamespace + * + * @description get all sub organizations for organization namespace + * @returns array of subdomains or empty array when there is no subdomains + * + */ + getSubOrgsByOrgNamespace({ namespace }: { namespace: string }) { + return this._cacheClient.getSubOrganizationsByOrganization({ namespace }); + } + + /** + * getOrgHierarchy + * + * @description get all hierarchy of an organization (20 levels deep) + * @returns organization with all nested subOrgs + * + */ + async getOrgHierarchy({ namespace }: { namespace: string }): Promise { + const org = await this._cacheClient.getOrgHierarchy({ namespace }); + [org, ...(org.subOrgs || []), ...(org.apps || []), ...(org.roles || [])].forEach( + (domain) => (domain.isOwnedByCurrentUser = domain.owner === this._owner), + ); + return org; + } + + /** + * getRoleDIDs + * + * @description get all users did which have certain role + * @returns array of did's + * + */ + getRoleDIDs({ namespace }: { namespace: string }) { + return this._cacheClient.getDIDsForRole({ namespace }); + } + + /** + * getSubdomains + * + * @description get all subdomains for certain domain + * @returns array of subdomains or empty array when there is no subdomains + * + */ + async getSubdomains({ + domain, + mode = "FIRSTLEVEL", + }: { + domain: string; + mode?: "ALL" | "FIRSTLEVEL"; + }): Promise { + return this._domainHierarchy.getSubdomainsUsingResolver({ + domain, + mode, + }); + } + + /** + * checkExistenceOfDomain + * + * @description check existence of domain in ENS registry + * @returns true or false whatever the domain is present + * + */ + async checkExistenceOfDomain({ domain }: { domain: string }) { + const domainHash = namehash(domain); + const [exists, isOwned] = await Promise.all([ + this._ensRegistry.recordExists(domainHash), + (async () => { + const owner = await this._ensRegistry?.owner(domainHash); + return owner !== emptyAddress; + })(), + ]); + return exists && isOwned; + } + + /** + * isOwner + * + * @description check ownership of the domain + * @default if user is not specified it will check the current logged user + * @returns true or false whatever the passed is user is a owner of domain + * + */ + async isOwner({ domain, user = this._owner }: { domain: string; user?: string }) { + const domainHash = namehash(domain); + const owner = await this._ensRegistry.owner(domainHash); + return owner === user; + } + + /** + * validateOwnership + * + * @description check ownership of the domain and subdomains of org, app or role + * @returns true or false whatever the passed is user is a owner of org, app or role + * + */ + async validateOwnership({ namespace, type }: { namespace: string; type: ENSNamespaceTypes }) { + return this.nonOwnedNodesOf({ namespace, type, owner: this._owner }); + } + + protected async validateChangeOwnership({ namespaces, newOwner }: { namespaces: string[]; newOwner: string }) { + const namespacesOwners = await this.namespacesWithRelations(namespaces); + return namespacesOwners.reduce( + (acc, { namespace, owner }) => { + if (owner === newOwner) { + acc.alreadyFinished.push(namespace); + return acc; + } + if (owner === emptyAddress || owner === this._owner) { + acc.changeOwnerNamespaces.push(namespace); + return acc; + } + acc.notOwnedNamespaces.push(namespace); + return acc; + }, + { + notOwnedNamespaces: [], + alreadyFinished: [], + changeOwnerNamespaces: [], + } as { + notOwnedNamespaces: string[]; + alreadyFinished: string[]; + changeOwnerNamespaces: string[]; + }, + ); + } + + protected async validateDeletePossibility({ namespaces }: { namespaces: string[] }) { + const namespacesOwners = await this.namespacesWithRelations(namespaces); + return namespacesOwners.reduce( + (acc, { namespace, owner }) => { + if (owner === emptyAddress) { + acc.alreadyFinished.push(namespace); + return acc; + } + if (owner === this._owner) { + acc.namespacesToDelete.push(namespace); + return acc; + } + acc.notOwnedNamespaces.push(namespace); + return acc; + }, + { + notOwnedNamespaces: [], + alreadyFinished: [], + namespacesToDelete: [], + } as { + notOwnedNamespaces: string[]; + alreadyFinished: string[]; + namespacesToDelete: string[]; + }, + ); + } + + /** + * In initial version of Switchboard, role definitions where contained in ENS PublicResolver. + * However, in order for key properties of role definitions to be readable on-chain, a new RoleDefinitionResolver is used. + * This function sets the resolver in the ENS to the new contract for definitions that are pointing to the old contract + * @param domain domain to potentially update + * @param data definition to apply to domain + */ + async updateLegacyDefinition( + domain: string, + data: IAppDefinition | IOrganizationDefinition | IRoleDefinition, + ): Promise { + const node = namehash(domain); + const currentResolverAddress = await this._ensRegistry.resolver(node); + const { ensPublicResolverAddress, ensResolverAddress, ensRegistryAddress } = chainConfigs()[this.chainId]; + if (currentResolverAddress === ensPublicResolverAddress) { + const updateResolverTransaction: EncodedCall = { + to: ensRegistryAddress, + data: this._ensRegistry.interface.encodeFunctionData("setResolver", [node, ensResolverAddress]), + }; + // Need to use newRole/newDomain as need to set reverse domain name + const updateDomain = DomainReader.isRoleDefinition(data) + ? this._domainDefinitionTransactionFactory.newRole({ domain, roleDefinition: data }) + : this._domainDefinitionTransactionFactory.newDomain({ domain, domainDefinition: data }); + await this._signerService.send(updateResolverTransaction); + await this._signerService.send(updateDomain); + return true; + } + return false; + } + + async registrationTypesOfRoles(roles: string[]): Promise>> { + const types: Record> = roles.reduce( + (acc, role) => ({ ...acc, [role]: new Set() }), + {}, + ); + for await (const role of roles) { + const def = await this.getDefinition({ type: ENSNamespaceTypes.Roles, namespace: role }); + if (!DomainReader.isRoleDefinition(def)) { + continue; + } + const resolver = await this._ensRegistry.resolver(namehash(role)); + if (resolver === this._ensResolverAddress) { + types[role].add(RegistrationTypes.OnChain); + types[role].add(RegistrationTypes.OffChain); + } else if (resolver === this._ensPublicResolverAddress) { + types[role].add(RegistrationTypes.OffChain); + } + } + return types; + } + + protected async getOwner({ namespace }: { namespace: string }) { + const node = namehash(namespace); + return this._ensRegistry.owner(node); + } + + protected createSubdomainTx({ + domain, + nodeName, + owner = this._owner, + }: { + domain: string; + nodeName: string; + owner?: string; + }): EncodedCall { + return { + to: this._ensRegistryAddress, + data: this._ensRegistry.interface.encodeFunctionData("setSubnodeRecord", [ + namehash(domain), + labelhash(nodeName), + owner, + this._ensResolverAddress, + this._ttl, + ]), + }; + } + + protected changeSubdomainOwnerTx({ + newOwner, + label, + namespace, + }: { + newOwner: string; + namespace: string; + label: string; + }): EncodedCall { + return { + to: this._ensRegistryAddress, + data: this._ensRegistry.interface.encodeFunctionData("setSubnodeOwner", [ + namehash(namespace), + labelhash(label), + newOwner, + ]), + }; + } + + protected changeDomainOwnerTx({ newOwner, namespace }: { newOwner: string; namespace: string }): EncodedCall { + return { + to: this._ensRegistryAddress, + data: this._ensRegistry.interface.encodeFunctionData("setOwner", [namehash(namespace), newOwner]), + }; + } + + protected deleteSubdomainTx({ namespace }: { namespace: string }): EncodedCall { + const namespaceArray = namespace.split("."); + const node = namespaceArray.slice(1).join("."); + const label = namespaceArray[0]; + return { + to: this._ensRegistryAddress, + data: this._ensRegistry.interface.encodeFunctionData("setSubnodeRecord", [ + namehash(node), + labelhash(label), + emptyAddress, + emptyAddress, + this._ttl, + ]), + }; + } + + protected async deleteDomain({ namespace }: { namespace: string }) { + await this._signerService.send(this.deleteDomainTx({ namespace })); + } + + protected deleteDomainTx({ namespace }: { namespace: string }): EncodedCall { + return { + to: this._ensRegistryAddress, + data: this._ensRegistry.interface.encodeFunctionData("setRecord", [ + namehash(namespace), + emptyAddress, + emptyAddress, + this._ttl, + ]), + }; + } + + protected async deleteSubdomain({ namespace }: { namespace: string }) { + await this._signerService.send(this.deleteSubdomainTx({ namespace })); + } + + protected async nonOwnedNodesOf({ + namespace, + type, + owner, + }: { + namespace: string; + type: ENSNamespaceTypes; + owner: string; + }) { + if (![ENSNamespaceTypes.Roles, ENSNamespaceTypes.Application, ENSNamespaceTypes.Organization].includes(type)) { + throw new Error(ERROR_MESSAGES.ENS_TYPE_NOT_SUPPORTED); + } + const namespacesToCheck = + type === ENSNamespaceTypes.Roles + ? [namespace] + : type === ENSNamespaceTypes.Application + ? [namespace, ENSNamespaceTypes.Application] + : [namespace, ENSNamespaceTypes.Application, ENSNamespaceTypes.Organization]; + return Promise.all(namespacesToCheck.map((ns) => this.getOwner({ namespace: ns }))).then((owners) => + owners.filter((o) => ![owner, emptyAddress].includes(o)), + ); + } + + /** + * @description Collects all namespaces related data. Currently its includes only owner + * @param namespaces + */ + async namespacesWithRelations(namespaces: string[]) { + return Promise.all( + namespaces.map(async (namespace) => { + const owner = await this.getOwner({ namespace }); + return { + namespace, + owner, + }; + }), + ); + } +} diff --git a/src/modules/domains/domains.types.ts b/src/modules/domains/domains.types.ts new file mode 100644 index 00000000..234ef79e --- /dev/null +++ b/src/modules/domains/domains.types.ts @@ -0,0 +1,40 @@ +import { IAppDefinition, IOrganizationDefinition, IRoleDefinition } from "@energyweb/iam-contracts"; + +export enum ENSNamespaceTypes { + Roles = "roles", + Application = "apps", + Organization = "org", +} + +export interface IRole { + uid: string; + name: string; + namespace: string; + owner: string; + definition: IRoleDefinition; + isOwnedByCurrentUser?: boolean; +} + +export interface IOrganization { + uid: string; + name: string; + namespace: string; + owner: string; + definition: IOrganizationDefinition; + apps?: IApp[]; + roles?: IRole[]; + subOrgs?: IOrganization[]; + isOwnedByCurrentUser?: boolean; +} + +export interface IApp { + uid: string; + name: string; + namespace: string; + owner: string; + definition: IAppDefinition; + roles?: IRole[]; + isOwnedByCurrentUser?: boolean; +} + +export const NODE_FIELDS_KEY = "metadata"; diff --git a/src/modules/domains/index.ts b/src/modules/domains/index.ts new file mode 100644 index 00000000..927cfa4c --- /dev/null +++ b/src/modules/domains/index.ts @@ -0,0 +1,2 @@ +export * from "./domains.service"; +export * from "./domains.types"; diff --git a/src/modules/messaging/index.ts b/src/modules/messaging/index.ts new file mode 100644 index 00000000..fb14f003 --- /dev/null +++ b/src/modules/messaging/index.ts @@ -0,0 +1,2 @@ +export * from "./messaging.service"; +export * from "./messaging.types"; diff --git a/src/modules/messaging/messaging.service.ts b/src/modules/messaging/messaging.service.ts new file mode 100644 index 00000000..f53ea2bc --- /dev/null +++ b/src/modules/messaging/messaging.service.ts @@ -0,0 +1,77 @@ +import { Codec, connect, JSONCodec, NatsConnection, Subscription } from "nats.ws/lib/src/mod.js"; +import { messagingConfigs } from "../../config/messaging.config"; +import { IMessage, MessagingMethod } from "./messaging.types"; +import { SignerService } from "../signer/signer.service"; + +export class MessagingService { + private _jsonCodec: Codec; + private _natsConnection: NatsConnection; + private _subscriptions: Subscription[] = []; + + constructor(private _signerService: SignerService) { + this._signerService.onInit(async () => await this.init()); + } + + static async create(signerService: SignerService) { + const service = new MessagingService(signerService); + await service.init(); + return service; + } + + async init() { + const { messagingMethod, natsServerUrl } = messagingConfigs()[this._signerService.chainId]; + if (natsServerUrl && messagingMethod === MessagingMethod.Nats) { + this._jsonCodec = JSONCodec(); + try { + let protocol = "ws"; + if (natsServerUrl.indexOf("https://") === 0) { + protocol = "wss"; + } + const timeout = 3000; + // this race condition duplicate timeout is there because unable to catch the error that occurs when NATS.ws timeouts + const connection = await Promise.race([ + connect({ + servers: `${protocol}://${natsServerUrl}`, + timeout, + pingInterval: 50 * 1000, + }), + new Promise((resolve) => setTimeout(resolve, timeout)), + ]); + + if (!connection) return; + this._natsConnection = connection; + } catch (err) { + console.log(err); + } + } + } + + async subscribeTo({ subject, messageHandler }: { subject: string; messageHandler: (data: IMessage) => void }) { + if (!this._natsConnection) { + return; + } + const subscription = this._natsConnection.subscribe(subject, { + callback: (err, msg) => { + if (err) { + console.error(`Nats error:${err.message}`); + return; + } + const decodedMessage = this._jsonCodec?.decode(msg.data) as IMessage; + messageHandler(decodedMessage); + }, + }); + this._subscriptions.push(subscription); + return subscription.getID(); + } + + async unsubscribeFrom(subscriptionId: number) { + const i = this._subscriptions.findIndex((s) => s.getID() === subscriptionId); + if (i !== -1) { + this._subscriptions.splice(i, 1)[0].unsubscribe(); + } + } + + async publish(subject: string, data: Uint8Array) { + this._natsConnection.publish(subject, data); + } +} diff --git a/src/modules/messaging/messaging.types.ts b/src/modules/messaging/messaging.types.ts new file mode 100644 index 00000000..ce8e3d1d --- /dev/null +++ b/src/modules/messaging/messaging.types.ts @@ -0,0 +1,13 @@ +export enum MessagingMethod { + Nats = "nats", + WebRTC = "webRTC", + SmartContractStorage = "smartContractStorage", +} + +export interface IMessage { + id: string; + requester: string; + claimIssuer?: string[]; +} + +export const NATS_EXCHANGE_TOPIC = "claim.exchange"; diff --git a/src/modules/signer/gnosisSigner.ts b/src/modules/signer/gnosisSigner.ts new file mode 100644 index 00000000..6ae3c9c5 --- /dev/null +++ b/src/modules/signer/gnosisSigner.ts @@ -0,0 +1,15 @@ +import { providers } from "ethers"; +import SafeAppSdk from "@gnosis.pm/safe-apps-sdk"; +import { SafeAppProvider } from "@gnosis.pm/safe-apps-provider"; +import { ProviderType } from "./signer.types"; +import { SignerService } from "./signer.service"; + +/** + * @description Intended for use in Volta Gnosis web interface(https://volta.gnosis-safe.io/). + * Dapp should provide SafeAppSdk injected by Gnosis interface + */ +export const fromGnosis = async (safeAppSdk: SafeAppSdk) => { + const gnosisProvider = new SafeAppProvider(await safeAppSdk.safe.getInfo(), safeAppSdk); + const provider = new providers.Web3Provider(gnosisProvider); + return new SignerService(provider.getSigner(), ProviderType.Gnosis); +}; diff --git a/src/modules/signer/index.ts b/src/modules/signer/index.ts new file mode 100644 index 00000000..ad443f95 --- /dev/null +++ b/src/modules/signer/index.ts @@ -0,0 +1,6 @@ +export * from "./privateKeySigner"; +export * from "./metamaskSigner"; +export * from "./walletConnectMetamask"; +export * from "./walletConnectKms"; +export * from "./signer.service"; +export * from "./signer.types"; diff --git a/src/modules/signer/metamaskSigner.ts b/src/modules/signer/metamaskSigner.ts new file mode 100644 index 00000000..43c32fe8 --- /dev/null +++ b/src/modules/signer/metamaskSigner.ts @@ -0,0 +1,42 @@ +import { providers } from "ethers"; +import detectMetamask from "@metamask/detect-provider"; +import { ERROR_MESSAGES } from "../../errors"; +import { ProviderType } from "./signer.types"; +import { SignerService } from "./signer.service"; + +export const fromMetaMask = async (): Promise => { + return new SignerService(await createMetamaskSigner({}), ProviderType.Metamask); +}; + +const createMetamaskSigner = async ({ initializeMetamask }: { initializeMetamask?: boolean }) => { + const metamaskProvider: any = await detectMetamask({ + mustBeMetaMask: true, + }); + if (!metamaskProvider) { + throw new Error(ERROR_MESSAGES.METAMASK_PROVIDER_NOT_DETECTED); + } + const requestObject = { + method: initializeMetamask ? "wallet_requestPermissions" : "eth_accounts", + params: [ + { + eth_accounts: {}, + }, + ], + }; + const accounts: string[] = await metamaskProvider.request(requestObject); + + if (!initializeMetamask && accounts.length < 1) { + await metamaskProvider.request({ + method: "wallet_requestPermissions", + params: [ + { + eth_accounts: {}, + }, + ], + }); + } + const signer = new providers.Web3Provider(metamaskProvider).getSigner(); + + console.log("metamask chain id:", (await signer.provider.getNetwork()).chainId); + return signer; +}; diff --git a/src/modules/signer/privateKeySigner.ts b/src/modules/signer/privateKeySigner.ts new file mode 100644 index 00000000..d448ae26 --- /dev/null +++ b/src/modules/signer/privateKeySigner.ts @@ -0,0 +1,12 @@ +import { providers, Wallet } from "ethers"; +import { SignerService } from "./signer.service"; +import { ProviderType } from "./signer.types"; + +const { JsonRpcProvider } = providers; + +export const fromPrivateKey = async (privateKey: string, rpcUrl: string) => { + const provider = new JsonRpcProvider({ url: rpcUrl }); + const signerService = new SignerService(new Wallet(privateKey).connect(provider), ProviderType.PrivateKey); + await signerService.init(); + return signerService; +}; diff --git a/src/modules/signer/signer.service.ts b/src/modules/signer/signer.service.ts new file mode 100644 index 00000000..bc060573 --- /dev/null +++ b/src/modules/signer/signer.service.ts @@ -0,0 +1,169 @@ +import { BigNumber, providers, utils, Wallet, ethers, Signer } from "ethers"; +import base64url from "base64url"; +import { EventEmitter } from "events"; +import WalletConnectProvider from "@walletconnect/web3-provider"; +import { ERROR_MESSAGES } from "../../errors/ErrorMessages"; +import { IPubKeyAndIdentityToken, PUBLIC_KEY, WALLET_PROVIDER, ProviderType, AccountInfo } from "./signer.types"; +import { detectExecutionEnvironment, ExecutionEnvironment } from "../../utils/detectEnvironment"; +import { chainConfigs } from "../../config/chain.config"; + +const { arrayify, keccak256, recoverPublicKey, computeAddress, computePublicKey, getAddress, hashMessage } = utils; +export type ServiceInitializer = () => Promise; +export class SignerService { + private _publicKey: string; + private _address: string; + private _chainId: number; + private _servicesInitializers: ServiceInitializer[] = []; + + constructor(private _signer: Required, private _providerType: ProviderType) {} + + async init(): Promise { + this._address = await this.signer.getAddress(); + this._chainId = (await this._signer.provider.getNetwork()).chainId; + this.initEventHandlers(); + for await (const initializer of this._servicesInitializers) { + await initializer(); + } + let account; + if (this._signer instanceof providers.JsonRpcSigner) { + account = (await this._signer.provider.listAccounts())[0]; + } else if (this._signer instanceof Wallet) { + account = this._address; + } + return { + account, + chainId: this._chainId, + chainName: chainConfigs()[this._chainId].chainName, + }; + } + + /** + * Registers reinitialization of dependent service on signer reconnection + */ + onInit(initializer: ServiceInitializer) { + this._servicesInitializers.push(initializer); + } + + async destroy() { + const provider = this._signer.provider; + if (provider instanceof WalletConnectProvider) { + await provider.close(); + } + } + + /** + * Add event handler for certain events + * @requires to be called after the connection to wallet was initialized + */ + initEventHandlers() { + const accChangedHandler = async () => { + this.clearSession(); + await this.init(); + }; + const provider = this._signer.provider; + if (provider instanceof EventEmitter) { + provider.on("accountsChanged", accChangedHandler); + provider.on("networkChanged", accChangedHandler); + } else if (provider instanceof WalletConnectProvider) { + provider.wc.on("session_update", accChangedHandler); + provider.wc.on("disconnect", this.clearSession); + provider.wc.on("session_update", accChangedHandler); + } + } + + get signer() { + return this._signer; + } + + get provider() { + return this._signer.provider; + } + + get chainId() { + return this._chainId; + } + + async balance() { + return this.signer.getBalance(); + } + + get providerType() { + return this._providerType; + } + + get address() { + return this._address; + } + + async send({ to, data, value }: providers.TransactionRequest): Promise { + const tx = { to, from: this.address, data, ...(value && { value: BigNumber.from(value) }) }; + const receipt = await (await this._signer.sendTransaction(tx)).wait(); + return receipt; + } + + async signMessage(message: Uint8Array) { + return this.signer.signMessage(message); + } + + async connect(signer: Required, providerType: ProviderType) { + this._signer = signer; + this._providerType = providerType; + await this.init(); + } + + async publicKey() { + if (this._publicKey) return this._publicKey; + if (this._signer instanceof Wallet) { + this._publicKey = this._signer.publicKey; + return this._publicKey; + } + this._publicKey = (await this.publicKeyAndIdentityToken()).publicKey; + return this._publicKey; + } + + async publicKeyAndIdentityToken(): Promise { + const header = { + alg: "ES256", + typ: "JWT", + }; + const encodedHeader = base64url(JSON.stringify(header)); + const address = await this._signer.getAddress(); + const payload = { + iss: `did:ethr:${address}`, + claimData: { + blockNumber: await this._signer.provider.getBlockNumber(), + }, + }; + + const encodedPayload = base64url(JSON.stringify(payload)); + const token = `0x${Buffer.from(`${encodedHeader}.${encodedPayload}`).toString("hex")}`; + // arrayification is necessary for WalletConnect signatures to work. eth_sign expects message in bytes: https://docs.walletconnect.org/json-rpc-api-methods/ethereum#eth_sign + // keccak256 hash is applied for Metamask to display a coherent hex value when signing + const message = arrayify(keccak256(token)); + const sig = await this._signer.signMessage(message); + const recoverValidatedPublicKey = (signedMessage: Uint8Array): string | undefined => { + const publicKey = recoverPublicKey(signedMessage, sig); + if (getAddress(address) === getAddress(computeAddress(publicKey))) { + return computePublicKey(publicKey, true).slice(2); + } + return undefined; + }; + + // Computation of the digest in order to recover the public key under the assumption + // that signature was performed as per the eth_sign spec (https://eth.wiki/json-rpc/API#eth_sign) + // In the event that the wallet isn't prefixing & hashing message as per spec, attempt recovery without digest + const digest = arrayify(hashMessage(message)); + const publicKey = recoverValidatedPublicKey(digest) ?? recoverValidatedPublicKey(message); + if (publicKey) { + return { publicKey, identityToken: `${encodedHeader}.${encodedPayload}.${base64url(sig)}` }; + } + throw new Error(ERROR_MESSAGES.PUBLIC_KEY_NOT_RECOVERED); + } + + clearSession() { + if (detectExecutionEnvironment() === ExecutionEnvironment.BROWSER) { + localStorage.removeItem(WALLET_PROVIDER); + localStorage.removeItem(PUBLIC_KEY); + } + } +} diff --git a/src/modules/signer/signer.types.ts b/src/modules/signer/signer.types.ts new file mode 100644 index 00000000..bf0a95ab --- /dev/null +++ b/src/modules/signer/signer.types.ts @@ -0,0 +1,21 @@ +export enum ProviderType { + WalletConnect = "WalletConnect", + EwKeyManager = "EwKeyManager", + Metamask = "MetaMask", + PrivateKey = "PrivateKey", + Gnosis = "Gnosis", +} + +export interface IPubKeyAndIdentityToken { + publicKey: string; + identityToken: string; +} + +export type AccountInfo = { + chainName: string; + chainId: number; + account: string; +}; + +export const WALLET_PROVIDER = "WalletProvider"; +export const PUBLIC_KEY = "PublicKey"; diff --git a/src/modules/signer/walletConnectKms.ts b/src/modules/signer/walletConnectKms.ts new file mode 100644 index 00000000..d44fb3e0 --- /dev/null +++ b/src/modules/signer/walletConnectKms.ts @@ -0,0 +1,17 @@ +import WalletConnectProvider from "@walletconnect/web3-provider"; +import { IWalletConnectProviderOptions } from "@walletconnect/types"; + +export async function connectWithKmsClient(opts: IWalletConnectProviderOptions, ewKeyManagerUrl: string) { + const walletConnectProvider = new WalletConnectProvider(opts); + walletConnectProvider.wc.on("display_uri", (err, payload) => { + // uri is expected to be WalletConnect Standard URI https://eips.ethereum.org/EIPS/eip-1328 + const wcUri = payload.params[0]; + + const encoded = encodeURIComponent(wcUri); + const hasQueryString = ewKeyManagerUrl.includes("?"); + const url = `${ewKeyManagerUrl}${hasQueryString ? "&" : "?"}uri=${encoded}`; + window.open(url, "ew_key_manager"); + }); + await walletConnectProvider.enable(); + return walletConnectProvider; +} diff --git a/src/modules/signer/walletConnectMetamask.ts b/src/modules/signer/walletConnectMetamask.ts new file mode 100644 index 00000000..042f532d --- /dev/null +++ b/src/modules/signer/walletConnectMetamask.ts @@ -0,0 +1,22 @@ +import Web3Provider from "@walletconnect/web3-provider"; +import QRCodeModal from "@walletconnect/qrcode-modal"; +import { IWalletConnectProviderOptions } from "@walletconnect/types"; +import { ProviderType } from "./signer.types"; +import { SignerService } from "./signer.service"; +import { providers } from "ethers"; + +export const fromWalletConnectMetamask = async ( + walletConnectOpts: IWalletConnectProviderOptions = { + bridge: "https://walletconnect.energyweb.org", + }, +): Promise => { + const metamaskProvider = await createProvider(walletConnectOpts); + const provider = new providers.Web3Provider(metamaskProvider); + return new SignerService(provider.getSigner(), ProviderType.Metamask); +}; + +const createProvider = async (opts: IWalletConnectProviderOptions) => { + const walletConnectProvider = new Web3Provider({ ...opts, qrcodeModal: QRCodeModal }); + await walletConnectProvider.enable(); + return walletConnectProvider; +}; diff --git a/src/modules/staking/index.ts b/src/modules/staking/index.ts new file mode 100644 index 00000000..37c0d2a1 --- /dev/null +++ b/src/modules/staking/index.ts @@ -0,0 +1 @@ +export * from "./staking.service"; diff --git a/src/modules/staking/staking.service.ts b/src/modules/staking/staking.service.ts new file mode 100644 index 00000000..b537d899 --- /dev/null +++ b/src/modules/staking/staking.service.ts @@ -0,0 +1,257 @@ +import { utils, BigNumber, providers } from "ethers"; +import { StakingPoolFactory, StakingPool as StakingPoolContract } from "../../../ethers"; +import { StakingPoolFactory__factory } from "../../../ethers/factories/StakingPoolFactory__factory"; +import { StakingPool__factory } from "../../../ethers/factories/StakingPool__factory"; +import { ERROR_MESSAGES } from "../../errors/ErrorMessages"; +import { emptyAddress } from "../../utils/constants"; +import { SignerService } from "../signer/signer.service"; +import { chainConfigs } from "../../config/chain.config"; +import { DomainsService } from "../domains/domains.service"; + +const { namehash, parseUnits } = utils; + +export enum StakeStatus { + NONSTAKING = 0, + STAKING = 1, + WITHDRAWING = 2, +} + +export type Service = { + /** organization ENS name */ + org: string; + /** pool address */ + pool: string; + /** provider address */ + provider: string; +}; + +export type Stake = { + amount: BigNumber; + depositStart: BigNumber; + depositEnd: BigNumber; + status: StakeStatus; +}; + +/** + * Inteneded for staking pools management + */ +export class StakingService { + private _stakingPoolFactory: StakingPoolFactory; + + constructor(private _signerService: SignerService, private _domainsService: DomainsService) { + this._signerService.onInit(async () => await this.init()); + } + + static async create(signerService: SignerService, domainsService: DomainsService) { + const service = new StakingService(signerService, domainsService); + await service.init(); + return service; + } + + /** + * @description Connects to the same chain as `signer`. The signer must be connected + * @param signer Signer with connected provider + */ + async init() { + const chainId = this._signerService.chainId; + const { stakingPoolFactoryAddress } = chainConfigs()[chainId]; + this._stakingPoolFactory = new StakingPoolFactory__factory().attach(stakingPoolFactoryAddress); + } + + /** + * @description Deployes organization staking pool + * @emits StakingPoolFactory.StakingPoolLaunched + */ + async launchPool({ + org, + minStakingPeriod, + patronRewardPortion, + patronRoles, + principal, + }: { + /** organization ENS name */ + org: string; + /** minimum staking period in seconds */ + minStakingPeriod: number | BigNumber; + /** patron's part of the reward in fractions of thousandth */ + patronRewardPortion: number; + /** roles required to stake */ + patronRoles: string[]; + /** stake put by service provider when pool is launched */ + principal: BigNumber; + }): Promise { + const tx: providers.TransactionRequest = { + to: this._stakingPoolFactory.address, + data: this._stakingPoolFactory.interface.encodeFunctionData("launchStakingPool", [ + namehash(org), + minStakingPeriod, + patronRewardPortion, + patronRoles.map((r) => namehash(r)), + ]), + value: principal, + }; + await this._signerService.send(tx); + } + + /** + * @description Returns all services for which pools are launched + */ + async allServices(): Promise { + const stakingPoolFactory = this._stakingPoolFactory.connect(this._signerService.signer); + const orgs = await stakingPoolFactory.orgsList(); + return Promise.all( + orgs.map((org) => + stakingPoolFactory + .services(org) + .then((service) => ({ ...service, org })) + .then((service) => this._domainsService.readName(service.org).then((org) => ({ ...service, org }))), + ), + ); + } + + /** + * @description Returns pool launched for `org` if any + * @param org ENS name of organization + */ + async getPool(org: string): Promise { + const { pool } = await this._stakingPoolFactory.connect(this._signerService.signer).services(namehash(org)); + if (pool === emptyAddress) { + return null; + } + return new StakingPool(this._signerService, pool); + } +} + +/** + * Abstraction over staking pool smart contract + */ +export class StakingPool { + private overrides = { + gasPrice: parseUnits("0.01", "gwei"), + gasLimit: BigNumber.from(490000), + }; + private pool: StakingPoolContract; + + constructor(private signerService: SignerService, address: string) { + this.pool = new StakingPool__factory().attach(address); + } + + /** + * @description Locks stake and starts accumulating reward + * @emits StakingPool.StakePut + */ + async putStake( + /** stake amount */ + stake: BigNumber | number, + ): Promise { + stake = BigNumber.from(stake); + const tx: providers.TransactionRequest = { + to: this.pool.address, + from: this.signerService.address, + data: this.pool.interface.encodeFunctionData("putStake"), + value: stake, + }; + const balance = await this.signerService.balance(); + + const gasPrice = await this.signerService.signer.getGasPrice(); + const gas = await this.signerService.provider.estimateGas(tx); + + // multiplier 2 chosen arbitrarily because it is not known how reasonably to choose it + const fee = gasPrice.mul(gas).mul(2); + + const maxStake = balance.sub(fee); + + if (maxStake.lte(0)) { + throw new Error(ERROR_MESSAGES.INSUFFICIENT_BALANCE); + } + tx.value = stake.lt(maxStake) ? stake : maxStake; + await this.signerService.send(tx); + } + + /** + * @description Returns time left to enable request withdraw + */ + async requestWithdrawDelay(): Promise { + const { depositStart, status } = await this.getStake(); + if (status !== StakeStatus.STAKING) { + throw new Error(ERROR_MESSAGES.STAKE_WAS_NOT_PUT); + } + const requestAvailableFrom = depositStart.add( + await this.pool.connect(this.signerService.signer).minStakingPeriod(), + ); + const now = await this.now(); + if (requestAvailableFrom.lte(now)) { + return 0; + } else { + return requestAvailableFrom.sub(now).toNumber(); + } + } + + /** + * Accumulated reward + */ + async checkReward(): Promise { + return this.pool.connect(this.signerService.signer).checkReward(); + } + + /** + * @param patron staker address + * @returns Stake + */ + async getStake(patron?: string): Promise { + if (!patron) { + patron = this.signerService.address; + } + return this.pool.connect(this.signerService.signer).stakes(patron); + } + + /** + * @description Stops accumulating of the reward and prepars stake to withdraw after withdraw delay. + * Withdraw request unavailable until minimum staking period ends + */ + async requestWithdraw(): Promise { + const tx: providers.TransactionRequest = { + to: this.pool.address, + data: this.pool.interface.encodeFunctionData("requestWithdraw"), + ...this.overrides, + }; + await this.signerService.send(tx); + } + + /** + * @description Returns time left to enable withdraw + */ + async withdrawalDelay(): Promise { + const { depositEnd, status } = await this.getStake(); + if (status !== StakeStatus.WITHDRAWING) { + throw new Error(ERROR_MESSAGES.WITHDRAWAL_WAS_NOT_REQUESTED); + } + const withdrawAvailableFrom = depositEnd.add( + await this.pool.connect(this.signerService.signer).withdrawDelay(), + ); + const now = await this.now(); + if (withdrawAvailableFrom.lte(now)) { + return 0; + } else { + return withdrawAvailableFrom.sub(now).toNumber(); + } + } + + /** + * @description pays back stake with accumulated reward. Withdrawn unavailable until withdrawn delay ends + * @emits StakingPool.StakeWithdrawn + */ + async withdraw(): Promise { + const tx: providers.TransactionRequest = { + to: this.pool.address, + data: this.pool.interface.encodeFunctionData("withdraw"), + ...this.overrides, + }; + await this.signerService.send(tx); + } + + private async now(): Promise { + const lastBlock = await this.signerService.provider.getBlockNumber(); + return BigNumber.from((await this.signerService.provider.getBlock(lastBlock)).timestamp); + } +} diff --git a/src/signer/Owner.ts b/src/signer/Owner.ts deleted file mode 100644 index 19610534..00000000 --- a/src/signer/Owner.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { EwSigner } from "@ew-did-registry/did-ethr-resolver"; -import { Signer, providers, utils } from "ethers"; - -export class Owner extends Signer implements EwSigner { - constructor( - public signer: Signer, - public provider: providers.Provider, - public publicKey: string, - public privateKey?: string, - ) { - super(); - } - - getAddress() { - return this.signer.getAddress(); - } - sendTransaction(transaction: providers.TransactionRequest) { - return this.signer.sendTransaction(transaction); - } - signMessage(message: string | utils.Bytes) { - return this.signer.signMessage(message); - } - - /* eslint-disable @typescript-eslint/no-unused-vars */ - signTransaction(transaction: utils.Deferrable): Promise { - throw new Error("Method not implemented."); - } - connect(provider: providers.Provider): Signer { - throw new Error("Method not implemented."); - } -} diff --git a/src/staking/index.ts b/src/staking/index.ts deleted file mode 100644 index 734db0cd..00000000 --- a/src/staking/index.ts +++ /dev/null @@ -1,281 +0,0 @@ -import { DomainReader, ResolverContractType } from "@energyweb/iam-contracts"; -import { StakingPool as StakingPoolContract } from "../../ethers/StakingPool"; -import { StakingPool__factory } from "../../ethers/factories/StakingPool__factory"; -import { StakingPoolFactory } from "../../ethers/StakingPoolFactory"; -import { StakingPoolFactory__factory } from "../../ethers/factories/StakingPoolFactory__factory"; -import { Signer, utils, BigNumber } from "ethers"; -import { ERROR_MESSAGES } from "../errors"; -import { chainConfigs } from "../iam/chainConfig"; -import { emptyAddress } from "../utils/constants"; - -const { namehash, parseUnits } = utils; - -export enum StakeStatus { - NONSTAKING = 0, - STAKING = 1, - WITHDRAWING = 2, -} -export enum TransactionSpeed { - BASE = 0, - FAST = 1, -} - -export type Service = { - /** organization ENS name */ - org: string; - /** pool address */ - pool: string; - /** provider address */ - provider: string; -}; - -export type Stake = { - amount: BigNumber; - depositStart: BigNumber; - depositEnd: BigNumber; - status: StakeStatus; -}; - -/** - * Inteneded for staking pools management - */ -export class StakingPoolService { - private constructor( - private _stakingPoolFactory: StakingPoolFactory, - private _domainReader: DomainReader, - private _signer: Required, - ) {} - - /** - * @description Connects to the same chain as `signer`. The signer must be connected - * @param signer Signer with connected provider - */ - static async init(signer: Signer) { - if (!signer.provider) { - throw new Error("StakingPoolService.init: Signer is not connected to provider"); - } - const { chainId } = await signer.provider.getNetwork(); - const { stakingPoolFactoryAddress, ensRegistryAddress, ensResolverAddress, ensPublicResolverAddress } = - chainConfigs[chainId]; - const stakingPoolFactory = new StakingPoolFactory__factory(signer).attach(stakingPoolFactoryAddress); - const domainReader = new DomainReader({ ensRegistryAddress, provider: signer.provider }); - ensPublicResolverAddress && - domainReader.addKnownResolver({ - chainId, - address: ensPublicResolverAddress, - type: ResolverContractType.PublicResolver, - }); - ensResolverAddress && - domainReader.addKnownResolver({ - chainId, - address: ensResolverAddress, - type: ResolverContractType.RoleDefinitionResolver_v1, - }); - return new StakingPoolService(stakingPoolFactory, domainReader, signer as Required); - } - - /** - * @description Deployes organization staking pool - * @emits StakingPoolFactory.StakingPoolLaunched - */ - async launchStakingPool({ - org, - minStakingPeriod, - patronRewardPortion, - patronRoles, - principal, - }: { - /** organization ENS name */ - org: string; - /** minimum staking period in seconds */ - minStakingPeriod: number | BigNumber; - /** patron's part of the reward in fractions of thousandth */ - patronRewardPortion: number; - /** roles required to stake */ - patronRoles: string[]; - /** stake put by service provider when pool is launched */ - principal: BigNumber; - }): Promise { - await ( - await this._stakingPoolFactory.launchStakingPool( - namehash(org), - minStakingPeriod, - patronRewardPortion, - patronRoles.map((r) => namehash(r)), - { value: principal.toHexString() }, - ) - ).wait(); - } - - /** - * @description Returns all services for which pools are launched - */ - async allServices(): Promise { - const orgs = await this._stakingPoolFactory.orgsList(); - return Promise.all( - orgs.map((org) => - this._stakingPoolFactory - .services(org) - .then((service) => ({ ...service, org })) - .then((service) => this._domainReader.readName(service.org).then((org) => ({ ...service, org }))), - ), - ); - } - - /** - * @description Returns pool launched for `org` if any - * @param org ENS name of organization - */ - async getPool(org: string): Promise { - const { pool } = await this._stakingPoolFactory.services(namehash(org)); - if (pool === emptyAddress) { - return null; - } - return new StakingPool(this._signer, pool); - } -} - -/** - * Abstraction over staking pool smart contract - */ -export class StakingPool { - private overrides: Record = { - [TransactionSpeed.BASE]: {}, - [TransactionSpeed.FAST]: { - gasPrice: parseUnits("0.01", "gwei"), - gasLimit: BigNumber.from(490000), - }, - }; - private pool: StakingPoolContract; - constructor(private patron: Required, address: string) { - this.pool = new StakingPool__factory(patron).attach(address); - } - - /** - * @description Locks stake and starts accumulating reward. If needed stake will be reduced to be able to pay fee - * @emits StakingPool.StakePut - */ - async putStake( - /** stake amount */ - stake: BigNumber | number, - transactionSpeed = TransactionSpeed.FAST, - ): Promise { - stake = BigNumber.from(stake); - const tx = { - to: this.pool.address, - from: await this.patron.getAddress(), - data: this.pool.interface.encodeFunctionData("putStake"), - value: stake, - ...this.overrides[transactionSpeed], - }; - - const gasPrice = this.overrides[transactionSpeed].gasPrice || (await this.patron.provider.getGasPrice()); - const gas = this.overrides[transactionSpeed].gasLimit || (await this.patron.provider.estimateGas(tx)); - const fee = gasPrice.mul(gas).mul(2); - - const balance = await this.getBalance(); - // multiplier 2 chosen arbitrarily because it is not known how reasonably to choose it - const maxStake = balance.sub(fee); - - if (maxStake.lte(0)) { - throw new Error(ERROR_MESSAGES.INSUFFICIENT_BALANCE); - } - tx.value = stake.lt(maxStake) ? stake : maxStake; - await (await this.patron.sendTransaction(tx)).wait(); - } - - /** - * @description Returns time left to enable request withdraw - */ - async requestWithdrawDelay(): Promise { - const { depositStart, status } = await this.getStake(); - if (status !== StakeStatus.STAKING) { - throw new Error(ERROR_MESSAGES.STAKE_WAS_NOT_PUT); - } - const requestAvailableFrom = depositStart.add(await this.pool.minStakingPeriod()); - const now = await this.now(); - if (requestAvailableFrom.lte(now)) { - return 0; - } else { - return requestAvailableFrom.sub(now).toNumber(); - } - } - - /** - * Accumulated reward - */ - async checkReward(): Promise { - return this.pool.checkReward(); - } - - /** - * @param patron staker address - * @returns Stake - */ - async getStake(patron?: string): Promise { - if (!patron) { - patron = await this.pool.signer.getAddress(); - } - return this.pool.stakes(patron); - } - - /** - * @description Stops accumulating of the reward and prepars stake to withdraw after withdraw delay. - * Withdraw request unavailable until minimum staking period ends - */ - async requestWithdraw(transactionSpeed = TransactionSpeed.FAST): Promise { - await ( - await this.pool.requestWithdraw({ - ...this.overrides[transactionSpeed], - }) - ).wait(); - } - - /** - * @description Returns time left to enable withdraw - */ - async withdrawalDelay(): Promise { - const { depositEnd, status } = await this.getStake(); - if (status !== StakeStatus.WITHDRAWING) { - throw new Error(ERROR_MESSAGES.WITHDRAWAL_WAS_NOT_REQUESTED); - } - const withdrawAvailableFrom = depositEnd.add(await this.pool.withdrawDelay()); - const now = await this.now(); - if (withdrawAvailableFrom.lte(now)) { - return 0; - } else { - return withdrawAvailableFrom.sub(now).toNumber(); - } - } - - /** - * @description pays back stake with accumulated reward. Withdrawn unavailable until withdrawn delay ends - * @emits StakingPool.StakeWithdrawn - */ - async withdraw(transactionSpeed = TransactionSpeed.FAST): Promise { - await ( - await this.pool.withdraw({ - ...this.overrides[transactionSpeed], - }) - ).wait(); - } - - /** - * @param signer Signer connected to provider - */ - connect(signer: Signer): StakingPool { - if (!signer.provider) { - throw new Error("StakingPoolService.init: Signer is not connected to provider"); - } - return new StakingPool(signer as Required, this.pool.address); - } - - private async now(): Promise { - const lastBlock = await this.pool.provider.getBlockNumber(); - return BigNumber.from((await this.pool.provider.getBlock(lastBlock)).timestamp); - } - - private async getBalance(): Promise { - return await this.patron.provider.getBalance(await this.patron.getAddress()); - } -} diff --git a/src/types/WalletProvider.ts b/src/types/WalletProvider.ts deleted file mode 100644 index e23dc491..00000000 --- a/src/types/WalletProvider.ts +++ /dev/null @@ -1,5 +0,0 @@ -export enum WalletProvider { - WalletConnect = "WalletConnect", - MetaMask = "MetaMask", - EwKeyManager = "EwKeyManager", -} diff --git a/src/utils/change_resolver.ts b/src/utils/change_resolver.ts index 0deafd0c..7e05913d 100644 --- a/src/utils/change_resolver.ts +++ b/src/utils/change_resolver.ts @@ -2,7 +2,7 @@ import { Wallet, providers, utils } from "ethers"; import { DomainHierarchy } from "@energyweb/iam-contracts"; import { ENSRegistry__factory } from "../../ethers/factories/ENSRegistry__factory"; import { PublicResolver__factory } from "../../ethers/factories/PublicResolver__factory"; -import { NODE_FIELDS_KEY } from "./constants"; +import { NODE_FIELDS_KEY } from "../modules/domains"; import { labelhash } from "./ENS_hash"; const { JsonRpcProvider } = providers; diff --git a/src/utils/constants.ts b/src/utils/constants.ts index ad2a1f03..98169d16 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -1,23 +1,2 @@ -import { utils } from "ethers"; - export const emptyAddress = "0x0000000000000000000000000000000000000000"; -export const WALLET_PROVIDER = "WalletProvider"; -export const PUBLIC_KEY = "PublicKey"; export const VOLTA_CHAIN_ID = 73799; -export const NATS_EXCHANGE_TOPIC = "claim.exchange"; -export const NODE_FIELDS_KEY = "metadata"; -export enum MessagingMethod { - Nats = "nats", - WebRTC = "webRTC", - SmartContractStorage = "smartContractStorage", -} - -export const typedMsgPrefix = "1901"; -export const erc712_type_hash = utils.id( - "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)", -); -export const agreement_type_hash = utils.id("Agreement(address subject,bytes32 role,uint256 version)"); -export const proof_type_hash = utils.id( - "Proof(address subject,bytes32 role,uint256 version,uint256 expiry,address issuer)", -); -export const defaultClaimExpiry = Number.MAX_SAFE_INTEGER - 1; // Maximum value allowed by BigNumber diff --git a/src/utils/getPublicKeyAndIdentityToken.ts b/src/utils/getPublicKeyAndIdentityToken.ts deleted file mode 100644 index 7fe2d0ee..00000000 --- a/src/utils/getPublicKeyAndIdentityToken.ts +++ /dev/null @@ -1,52 +0,0 @@ -import base64url from "base64url"; -import { Signer, utils } from "ethers"; -import { ERROR_MESSAGES } from "../errors"; - -const { arrayify, computeAddress, computePublicKey, getAddress, hashMessage, keccak256, recoverPublicKey } = utils; - -export interface IPubKeyAndIdentityToken { - publicKey: string; - identityToken: string; -} - -export async function getPublicKeyAndIdentityToken(signer: Signer): Promise { - if (signer) { - const header = { - alg: "ES256", - typ: "JWT", - }; - const encodedHeader = base64url(JSON.stringify(header)); - const address = await signer.getAddress(); - const payload = { - iss: `did:ethr:${address}`, - claimData: { - blockNumber: await signer.provider?.getBlockNumber(), - }, - }; - - const encodedPayload = base64url(JSON.stringify(payload)); - const token = `0x${Buffer.from(`${encodedHeader}.${encodedPayload}`).toString("hex")}`; - // arrayification is necessary for WalletConnect signatures to work. eth_sign expects message in bytes: https://docs.walletconnect.org/json-rpc-api-methods/ethereum#eth_sign - // keccak256 hash is applied for Metamask to display a coherent hex value when signing - const message = arrayify(keccak256(token)); - const sig = await signer.signMessage(message); - const recoverValidatedPublicKey = (signedMessage: Uint8Array): string | undefined => { - const publicKey = recoverPublicKey(signedMessage, sig); - if (getAddress(address) === getAddress(computeAddress(publicKey))) { - return computePublicKey(publicKey, true).slice(2); - } - return undefined; - }; - - // Computation of the digest in order to recover the public key under the assumption - // that signature was performed as per the eth_sign spec (https://eth.wiki/json-rpc/API#eth_sign) - // In the event that the wallet isn't prefixing & hashing message as per spec, attempt recovery without digest - const digest = arrayify(hashMessage(message)); - const publicKey = recoverValidatedPublicKey(digest) ?? recoverValidatedPublicKey(message); - if (publicKey) { - return { publicKey, identityToken: `${encodedHeader}.${encodedPayload}.${base64url(sig)}` }; - } - throw new Error(ERROR_MESSAGES.PUBLIC_KEY_NOT_RECOVERED); - } - throw new Error(ERROR_MESSAGES.SIGNER_NOT_INITIALIZED); -} diff --git a/src/walletconnect/ControllableWalletConnect.ts b/src/walletconnect/ControllableWalletConnect.ts deleted file mode 100644 index 53d36013..00000000 --- a/src/walletconnect/ControllableWalletConnect.ts +++ /dev/null @@ -1,21 +0,0 @@ -import WalletConnect from "@walletconnect/client"; -import { IWalletConnectOptions, ICreateSessionOptions } from "@walletconnect/types"; - -/** - * Extension of WalletConnect client that allows session creation to be disabled - * This is helpful to be sure that session creation won't be attempted after closing - * the connection. See [MYEN-625](https://energyweb.atlassian.net/browse/MYEN-625) - */ -export class ControllableWalletConnect extends WalletConnect { - public canCreateSession = true; - - constructor(connectorOpts: IWalletConnectOptions) { - super(connectorOpts); - } - - public async createSession(opts?: ICreateSessionOptions): Promise { - if (this.canCreateSession) { - super.createSession(opts); - } - } -} diff --git a/src/walletconnect/WalletConnectService.ts b/src/walletconnect/WalletConnectService.ts deleted file mode 100644 index 708cbea1..00000000 --- a/src/walletconnect/WalletConnectService.ts +++ /dev/null @@ -1,83 +0,0 @@ -import WalletConnectProvider from "@walletconnect/web3-provider"; -import QRCodeModal from "@walletconnect/qrcode-modal"; -import { ControllableWalletConnect } from "./ControllableWalletConnect"; -import { WalletProvider } from "../types/WalletProvider"; -import { chainConfigs } from "../iam/chainConfig"; - -/** - * Encapsulates a WalletConnect connection - */ -export class WalletConnectService { - private readonly _ewKeyManagerUrl: string | undefined; - private readonly _infuraId: string | undefined; - private readonly _bridgeUrl: string; - protected _walletConnectProvider: WalletConnectProvider | undefined; - protected _walletConnectClient: ControllableWalletConnect | undefined; - - constructor(bridgeUrl: string, infuraId?: string, ewKeyManagerUrl?: string) { - this._ewKeyManagerUrl = ewKeyManagerUrl; - this._bridgeUrl = bridgeUrl; - this._infuraId = infuraId; - } - - async initialize(walletProvider: WalletProvider) { - const showQRCode = !(walletProvider === WalletProvider.EwKeyManager); - - this._walletConnectClient = new ControllableWalletConnect({ - bridge: this._bridgeUrl, - qrcodeModal: showQRCode ? QRCodeModal : undefined, - }); - - const rpc = Object.entries(chainConfigs).reduce((urls, [id, config]) => ({ ...urls, [id]: config.rpcUrl }), {}); - - this._walletConnectProvider = new WalletConnectProvider({ - rpc, - infuraId: this._infuraId, - connector: this._walletConnectClient, - }); - - if (walletProvider === WalletProvider.EwKeyManager) { - if (!this._ewKeyManagerUrl) { - throw Error("EwKeyManager provider type specified but no url was provided."); - } - const ewKeyManagerUrl = this._ewKeyManagerUrl; - this._walletConnectProvider.wc.on("display_uri", (err, payload) => { - // uri is expected to be WalletConnect Standard URI https://eips.ethereum.org/EIPS/eip-1328 - const wcUri = payload.params[0]; - - const encoded = encodeURIComponent(wcUri); - const hasQueryString = ewKeyManagerUrl.includes("?"); - const url = `${this._ewKeyManagerUrl}${hasQueryString ? "&" : "?"}uri=${encoded}`; - window.open(url, "ew_key_manager"); - }); - } - - await this._walletConnectProvider.enable(); - } - - /** - * @requires intialize be called first - * @returns the WalletConnectProvider of this instance - */ - getProvider(): WalletConnectProvider { - if (!this._walletConnectProvider) { - throw Error("call initalize() to initialize provider first"); - } - return this._walletConnectProvider; - } - - async closeConnection(): Promise { - if (this._walletConnectClient) { - // Setting to false to that WalletConnect library doesn't - // try to recreate session after closing - this._walletConnectClient.canCreateSession = false; - } - if (this._walletConnectProvider) { - await this._walletConnectProvider.close(); - } - } - - isConnected(): boolean { - return this._walletConnectProvider?.connected ?? false; - } -} diff --git a/tsconfig.json b/tsconfig.json index 373982f6..c192944e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -32,5 +32,5 @@ "suppressImplicitAnyIndexErrors": true, "target": "es6" }, - "include": ["src/**/*", "ethers/**/*"] + "include": ["src/**/*", "ethers/**/*", "test/staking.service.e2e.ts", "test/**/*"] }