diff --git a/tee-worker/identity/client-api/parachain-api/CHANGELOG.md b/tee-worker/identity/client-api/parachain-api/CHANGELOG.md index 9beeb06def..2facabe252 100644 --- a/tee-worker/identity/client-api/parachain-api/CHANGELOG.md +++ b/tee-worker/identity/client-api/parachain-api/CHANGELOG.md @@ -7,7 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -## [0.9.21-next.0] - 2024-12-17 +## [0.9.21-next.3] - 2024-12-31 + +### Added + +- Add `request_auth_token` trusted call. +- Add `AuthToken` variant to `TrustedCallOk` and `TCAuthentication`. +- Add `AuthOptions` type definition. - Update for version [parachain-release v0.9.21-01](https://github.com/litentry/litentry-parachain/releases/tag/v0.9.21-01) diff --git a/tee-worker/identity/client-api/parachain-api/package.json b/tee-worker/identity/client-api/parachain-api/package.json index 67bd28380f..a5131801a0 100644 --- a/tee-worker/identity/client-api/parachain-api/package.json +++ b/tee-worker/identity/client-api/parachain-api/package.json @@ -5,7 +5,7 @@ "main": "dist/src/index.js", "module": "dist/src/index.js", "sideEffects": false, - "version": "0.9.21-next.0", + "version": "0.9.21-next.3", "scripts": { "clean": "rm -rf dist build node_modules", "update-metadata": "curl -s -H \"Content-Type: application/json\" -d '{\"id\":\"1\", \"jsonrpc\":\"2.0\", \"method\": \"state_getMetadata\", \"params\":[]}' http://localhost:9944 > prepare-build/litentry-parachain-metadata.json", diff --git a/tee-worker/identity/client-api/parachain-api/prepare-build/interfaces/omniAccount/definitions.ts b/tee-worker/identity/client-api/parachain-api/prepare-build/interfaces/omniAccount/definitions.ts index 31a433be2e..9988d28ed0 100644 --- a/tee-worker/identity/client-api/parachain-api/prepare-build/interfaces/omniAccount/definitions.ts +++ b/tee-worker/identity/client-api/parachain-api/prepare-build/interfaces/omniAccount/definitions.ts @@ -36,5 +36,9 @@ export default { Private: "(Bytes,H256)", }, }, + + AuthOptions: { + expires_at: "u32", + }, }, }; diff --git a/tee-worker/identity/client-api/parachain-api/prepare-build/interfaces/trusted_operations/definitions.ts b/tee-worker/identity/client-api/parachain-api/prepare-build/interfaces/trusted_operations/definitions.ts index 260a989129..6b433e6c74 100644 --- a/tee-worker/identity/client-api/parachain-api/prepare-build/interfaces/trusted_operations/definitions.ts +++ b/tee-worker/identity/client-api/parachain-api/prepare-build/interfaces/trusted_operations/definitions.ts @@ -28,6 +28,7 @@ export default { _enum: { Web3: "LitentryMultiSignature", Email: "Text", + AuthToken: "Text", }, }, TrustedCallAuthenticated: { @@ -89,6 +90,7 @@ export default { add_account: "(LitentryIdentity, LitentryIdentity, LitentryValidationData, bool)", remove_accounts: "(LitentryIdentity, Vec)", publicize_account: "(LitentryIdentity, LitentryIdentity)", + request_auth_token: "(LitentryIdentity, AuthOptions)", }, }, TrustedOperationStatus: { @@ -117,6 +119,7 @@ export default { _enum: { ExtrinsicReport: "ExtrinsicReport", RequestVcResult: "RequestVcResultOrError", + AuthToken: "Text", }, }, ExtrinsicReport: { diff --git a/tee-worker/identity/client-sdk/package.json b/tee-worker/identity/client-sdk/package.json index be08aac434..45534dbd35 100644 --- a/tee-worker/identity/client-sdk/package.json +++ b/tee-worker/identity/client-sdk/package.json @@ -1,58 +1,58 @@ { - "name": "@litentry-client-sdk/source", - "version": "0.0.0", - "license": "MIT", - "scripts": { - "test": "nx affected --base=dev --target=test --plain", - "lint": "nx affected --base=dev --target=lint --plain", - "clean": "pnpm clean:dist; pnpm clean:packages", - "clean:dist": "rm -rf dist", - "clean:packages": "rm -rf node_modules && pnpm -r exec rm -rf node_modules && pnpm i" - }, - "private": true, - "dependencies": { - "@polkadot/api": "^15.0.1", - "@polkadot/types": "^15.0.1", - "@polkadot/types-codec": "^15.0.1", - "@polkadot/util": "^13.2.3", - "@polkadot/util-crypto": "^13.2.3", - "ts-node": "10.9.1", - "tslib": "^2.5.3", - "ws": "^8.17.1" - }, - "devDependencies": { - "@altack/nx-bundlefy": "0.16.0", - "@nx/devkit": "16.10.0", - "@nx/eslint-plugin": "16.10.0", - "@nx/jest": "16.10.0", - "@nx/js": "16.10.0", - "@nx/linter": "16.10.0", - "@nx/workspace": "16.10.0", - "@polkadot/api-base": "^10.9.1", - "@polkadot/rpc-core": "^10.9.1", - "@polkadot/rpc-provider": "^10.9.1", - "@swc-node/register": "^1.8.0", - "@swc/core": "^1.4.17", - "@types/jest": "^29.4.0", - "@types/node": "18.7.1", - "@types/ws": "^8.5.9", - "@typescript-eslint/eslint-plugin": "5.x", - "@typescript-eslint/parser": "5.x", - "eslint": "~8.46.0", - "eslint-config-prettier": "^8.1.0", - "jest": "^29.4.1", - "jest-environment-node": "^29.4.1", - "nx": "^17.3.2", - "prettier": "^2.8.3", - "ts-jest": "^29.1.0", - "typedoc": "^0.25.3", - "typedoc-plugin-markdown": "^3.17.1", - "typescript": "5.4.5", - "validate-npm-package-name": "^5.0.0", - "verdaccio": "^5.0.4" - }, - "nx": { - "includedScripts": [] - }, - "packageManager": "pnpm@8.7.6" + "name": "@litentry-client-sdk/source", + "version": "0.0.0", + "license": "MIT", + "scripts": { + "test": "nx affected --base=dev --target=test --plain", + "lint": "nx affected --base=dev --target=lint --plain", + "clean": "pnpm clean:dist; pnpm clean:packages", + "clean:dist": "rm -rf dist", + "clean:packages": "rm -rf node_modules && pnpm -r exec rm -rf node_modules && pnpm i" + }, + "private": true, + "dependencies": { + "@polkadot/api": "^15.0.1", + "@polkadot/types": "^15.0.1", + "@polkadot/types-codec": "^15.0.1", + "@polkadot/util": "^13.2.3", + "@polkadot/util-crypto": "^13.2.3", + "ts-node": "10.9.1", + "tslib": "^2.5.3", + "ws": "^8.17.1" + }, + "devDependencies": { + "@altack/nx-bundlefy": "0.16.0", + "@nx/devkit": "^17.3.2", + "@nx/eslint-plugin": "^17.3.2", + "@nx/jest": "^17.3.2", + "@nx/js": "^17.3.2", + "@nx/linter": "^17.3.2", + "@nx/workspace": "^17.3.2", + "@polkadot/api-base": "^10.9.1", + "@polkadot/rpc-core": "^10.9.1", + "@polkadot/rpc-provider": "^10.9.1", + "@swc-node/register": "^1.8.0", + "@swc/core": "^1.4.17", + "@types/jest": "^29.4.0", + "@types/node": "18.7.1", + "@types/ws": "^8.5.9", + "@typescript-eslint/eslint-plugin": "5.x", + "@typescript-eslint/parser": "5.x", + "eslint": "~8.46.0", + "eslint-config-prettier": "^8.1.0", + "jest": "^29.4.1", + "jest-environment-node": "^29.4.1", + "nx": "^17.3.2", + "prettier": "^2.8.3", + "ts-jest": "^29.1.0", + "typedoc": "^0.25.3", + "typedoc-plugin-markdown": "^3.17.1", + "typescript": "5.4.5", + "validate-npm-package-name": "^5.0.0", + "verdaccio": "^5.0.4" + }, + "nx": { + "includedScripts": [] + }, + "packageManager": "pnpm@8.7.6" } diff --git a/tee-worker/identity/client-sdk/packages/client-sdk/CHANGELOG.md b/tee-worker/identity/client-sdk/packages/client-sdk/CHANGELOG.md index f03653f56f..5a7f224832 100644 --- a/tee-worker/identity/client-sdk/packages/client-sdk/CHANGELOG.md +++ b/tee-worker/identity/client-sdk/packages/client-sdk/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add OmniAccount requestors for `createAccountStore`, `remark`, `transferNative`, `transferEthereum`, and `callEthereum`. - Add `requestVerificationCode` requestor. +- Add `requestAuthToken` requestor. ## 2024-10-14 diff --git a/tee-worker/identity/client-sdk/packages/client-sdk/docs/README.md b/tee-worker/identity/client-sdk/packages/client-sdk/docs/README.md index f147bdf3f3..aa7dca03bc 100644 --- a/tee-worker/identity/client-sdk/packages/client-sdk/docs/README.md +++ b/tee-worker/identity/client-sdk/packages/client-sdk/docs/README.md @@ -18,6 +18,7 @@ ### Type Aliases +- [AuthenticationData](README.md#authenticationdata) - [DiscordOAuth2Proof](README.md#discordoauth2proof) - [DiscordProof](README.md#discordproof) - [EmailProof](README.md#emailproof) @@ -54,6 +55,16 @@ Re-exports [getIdGraphHash](modules/request.md#getidgraphhash) ## Type Aliases +### AuthenticationData + +Ƭ **AuthenticationData**: \{ `type`: ``"Email"`` ; `verificationCode`: `string` } \| \{ `signature`: `string` ; `signer`: `LitentryIdentity` ; `type`: ``"Web3"`` } \| \{ `token`: `string` ; `type`: ``"AuthToken"`` } + +#### Defined in + +[lib/type-creators/tc-authentication.ts:5](https://github.com/litentry/client-sdk/blob/develop/lib/type-creators/tc-authentication.ts#L5) + +___ + ### DiscordOAuth2Proof Ƭ **DiscordOAuth2Proof**: `Object` @@ -335,7 +346,7 @@ Heads-up: ensure data.ciphertext is in hex format. Using Uint may cause a bytes | Name | Type | | :------ | :------ | | `registry` | `Registry` | -| `data` | \`0x$\{string}\` \| \{ `aad`: \`0x$\{string}\` \| `Uint8Array`\<`ArrayBufferLike`\> ; `ciphertext`: \`0x$\{string}\` ; `nonce`: \`0x$\{string}\` \| `Uint8Array`\<`ArrayBufferLike`\> } | +| `data` | \`0x$\{string}\` \| \{ `aad`: \`0x$\{string}\` \| `Uint8Array` ; `ciphertext`: \`0x$\{string}\` ; `nonce`: \`0x$\{string}\` \| `Uint8Array` } | #### Returns @@ -382,7 +393,7 @@ For Substrate, the address is expected to be a SS58-encoded or hex-encoded addre | Name | Type | | :------ | :------ | | `registry` | `Registry` | -| `data` | \`0x$\{string}\` \| `Uint8Array`\<`ArrayBufferLike`\> \| \{ `addressOrHandle`: `string` ; `type`: ``"Solana"`` \| ``"Twitter"`` \| ``"Discord"`` \| ``"Github"`` \| ``"Substrate"`` \| ``"Evm"`` \| ``"Bitcoin"`` \| ``"Email"`` } | +| `data` | \`0x$\{string}\` \| `Uint8Array` \| \{ `addressOrHandle`: `string` ; `type`: ``"Solana"`` \| ``"Twitter"`` \| ``"Discord"`` \| ``"Github"`` \| ``"Substrate"`` \| ``"Evm"`` \| ``"Bitcoin"`` \| ``"Email"`` } | #### Returns @@ -504,15 +515,14 @@ The shielding key is encrypted using the Enclave's shielding key and attached in #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `api` | `ApiPromise` | - | -| `data` | `Object` | - | -| `data.authentication` | `string` | signature or verification code based on the identity type | -| `data.call` | `TrustedCall` | - | -| `data.nonce` | `Index` | - | -| `data.sender` | `LitentryIdentity` | - | -| `data.shard` | `Uint8Array`\<`ArrayBufferLike`\> | - | +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `data` | `Object` | +| `data.authentication` | [`AuthenticationData`](README.md#authenticationdata) | +| `data.call` | `TrustedCall` | +| `data.nonce` | `Index` | +| `data.shard` | `Uint8Array` | #### Returns @@ -520,7 +530,7 @@ The shielding key is encrypted using the Enclave's shielding key and attached in #### Defined in -[lib/type-creators/request.ts:32](https://github.com/litentry/client-sdk/blob/develop/lib/type-creators/request.ts#L32) +[lib/type-creators/request.ts:33](https://github.com/litentry/client-sdk/blob/develop/lib/type-creators/request.ts#L33) ___ @@ -533,7 +543,7 @@ ___ | Name | Type | | :------ | :------ | | `registry` | `Registry` | -| `data` | `AuthenticationData` | +| `data` | [`AuthenticationData`](README.md#authenticationdata) | #### Returns @@ -541,7 +551,7 @@ ___ #### Defined in -[lib/type-creators/tc-authentication.ts:16](https://github.com/litentry/client-sdk/blob/develop/lib/type-creators/tc-authentication.ts#L16) +[lib/type-creators/tc-authentication.ts:20](https://github.com/litentry/client-sdk/blob/develop/lib/type-creators/tc-authentication.ts#L20) ___ @@ -576,7 +586,7 @@ Similarly, our types definitions must match also. #### Defined in -[lib/type-creators/trusted-call.ts:110](https://github.com/litentry/client-sdk/blob/develop/lib/type-creators/trusted-call.ts#L110) +[lib/type-creators/trusted-call.ts:117](https://github.com/litentry/client-sdk/blob/develop/lib/type-creators/trusted-call.ts#L117) ▸ **createTrustedCallType**(`registry`, `data`): `Promise`\<\{ `call`: `TrustedCall` ; `key`: `CryptoKey` }\> @@ -595,7 +605,7 @@ Similarly, our types definitions must match also. #### Defined in -[lib/type-creators/trusted-call.ts:117](https://github.com/litentry/client-sdk/blob/develop/lib/type-creators/trusted-call.ts#L117) +[lib/type-creators/trusted-call.ts:124](https://github.com/litentry/client-sdk/blob/develop/lib/type-creators/trusted-call.ts#L124) ▸ **createTrustedCallType**(`registry`, `data`): `Promise`\<\{ `call`: `TrustedCall` ; `key`: `CryptoKey` }\> @@ -614,7 +624,7 @@ Similarly, our types definitions must match also. #### Defined in -[lib/type-creators/trusted-call.ts:124](https://github.com/litentry/client-sdk/blob/develop/lib/type-creators/trusted-call.ts#L124) +[lib/type-creators/trusted-call.ts:131](https://github.com/litentry/client-sdk/blob/develop/lib/type-creators/trusted-call.ts#L131) ▸ **createTrustedCallType**(`registry`, `data`): `Promise`\<\{ `call`: `TrustedCall` ; `key`: `CryptoKey` }\> @@ -633,7 +643,7 @@ Similarly, our types definitions must match also. #### Defined in -[lib/type-creators/trusted-call.ts:131](https://github.com/litentry/client-sdk/blob/develop/lib/type-creators/trusted-call.ts#L131) +[lib/type-creators/trusted-call.ts:138](https://github.com/litentry/client-sdk/blob/develop/lib/type-creators/trusted-call.ts#L138) ▸ **createTrustedCallType**(`registry`, `data`): `Promise`\<\{ `call`: `TrustedCall` ; `key`: `CryptoKey` }\> @@ -652,7 +662,7 @@ Similarly, our types definitions must match also. #### Defined in -[lib/type-creators/trusted-call.ts:138](https://github.com/litentry/client-sdk/blob/develop/lib/type-creators/trusted-call.ts#L138) +[lib/type-creators/trusted-call.ts:145](https://github.com/litentry/client-sdk/blob/develop/lib/type-creators/trusted-call.ts#L145) ▸ **createTrustedCallType**(`registry`, `data`): `Promise`\<\{ `call`: `TrustedCall` ; `key`: `CryptoKey` }\> @@ -671,7 +681,7 @@ Similarly, our types definitions must match also. #### Defined in -[lib/type-creators/trusted-call.ts:145](https://github.com/litentry/client-sdk/blob/develop/lib/type-creators/trusted-call.ts#L145) +[lib/type-creators/trusted-call.ts:152](https://github.com/litentry/client-sdk/blob/develop/lib/type-creators/trusted-call.ts#L152) ▸ **createTrustedCallType**(`registry`, `data`): `Promise`\<\{ `call`: `TrustedCall` ; `key`: `CryptoKey` }\> @@ -690,7 +700,7 @@ Similarly, our types definitions must match also. #### Defined in -[lib/type-creators/trusted-call.ts:152](https://github.com/litentry/client-sdk/blob/develop/lib/type-creators/trusted-call.ts#L152) +[lib/type-creators/trusted-call.ts:159](https://github.com/litentry/client-sdk/blob/develop/lib/type-creators/trusted-call.ts#L159) ▸ **createTrustedCallType**(`registry`, `data`): `Promise`\<\{ `call`: `TrustedCall` ; `key`: `CryptoKey` }\> @@ -709,7 +719,7 @@ Similarly, our types definitions must match also. #### Defined in -[lib/type-creators/trusted-call.ts:159](https://github.com/litentry/client-sdk/blob/develop/lib/type-creators/trusted-call.ts#L159) +[lib/type-creators/trusted-call.ts:166](https://github.com/litentry/client-sdk/blob/develop/lib/type-creators/trusted-call.ts#L166) ▸ **createTrustedCallType**(`registry`, `data`): `Promise`\<\{ `call`: `TrustedCall` ; `key`: `CryptoKey` }\> @@ -728,7 +738,26 @@ Similarly, our types definitions must match also. #### Defined in -[lib/type-creators/trusted-call.ts:166](https://github.com/litentry/client-sdk/blob/develop/lib/type-creators/trusted-call.ts#L166) +[lib/type-creators/trusted-call.ts:173](https://github.com/litentry/client-sdk/blob/develop/lib/type-creators/trusted-call.ts#L173) + +▸ **createTrustedCallType**(`registry`, `data`): `Promise`\<\{ `call`: `TrustedCall` ; `key`: `CryptoKey` }\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `registry` | `Registry` | +| `data` | `Object` | +| `data.method` | ``"request_auth_token"`` | +| `data.params` | `RequestAuthTokenParams` | + +#### Returns + +`Promise`\<\{ `call`: `TrustedCall` ; `key`: `CryptoKey` }\> + +#### Defined in + +[lib/type-creators/trusted-call.ts:180](https://github.com/litentry/client-sdk/blob/develop/lib/type-creators/trusted-call.ts#L180) ▸ **createTrustedCallType**(`registry`, `data`): `Promise`\<\{ `call`: `TrustedCall` ; `key`: `CryptoKey` }\> @@ -747,7 +776,7 @@ Similarly, our types definitions must match also. #### Defined in -[lib/type-creators/trusted-call.ts:173](https://github.com/litentry/client-sdk/blob/develop/lib/type-creators/trusted-call.ts#L173) +[lib/type-creators/trusted-call.ts:187](https://github.com/litentry/client-sdk/blob/develop/lib/type-creators/trusted-call.ts#L187) ___ diff --git a/tee-worker/identity/client-sdk/packages/client-sdk/docs/classes/Enclave.md b/tee-worker/identity/client-sdk/packages/client-sdk/docs/classes/Enclave.md index 49aa9abbe6..cc7dca4e74 100644 --- a/tee-worker/identity/client-sdk/packages/client-sdk/docs/classes/Enclave.md +++ b/tee-worker/identity/client-sdk/packages/client-sdk/docs/classes/Enclave.md @@ -102,7 +102,7 @@ ___ ### encrypt -▸ **encrypt**(`api`, `args`): `Promise`\<\{ `ciphertext`: `Uint8Array`\<`ArrayBufferLike`\> }\> +▸ **encrypt**(`api`, `args`): `Promise`\<\{ `ciphertext`: `Uint8Array` }\> #### Parameters @@ -110,11 +110,11 @@ ___ | :------ | :------ | | `api` | `ApiPromise` | | `args` | `Object` | -| `args.cleartext` | `Uint8Array`\<`ArrayBufferLike`\> | +| `args.cleartext` | `Uint8Array` | #### Returns -`Promise`\<\{ `ciphertext`: `Uint8Array`\<`ArrayBufferLike`\> }\> +`Promise`\<\{ `ciphertext`: `Uint8Array` }\> #### Defined in diff --git a/tee-worker/identity/client-sdk/packages/client-sdk/docs/modules/request.md b/tee-worker/identity/client-sdk/packages/client-sdk/docs/modules/request.md index ccb49ea0e0..f4474f0f7d 100644 --- a/tee-worker/identity/client-sdk/packages/client-sdk/docs/modules/request.md +++ b/tee-worker/identity/client-sdk/packages/client-sdk/docs/modules/request.md @@ -20,6 +20,7 @@ requests - [publicizeAccount](request.md#publicizeaccount) - [remark](request.md#remark) - [removeAccounts](request.md#removeaccounts) +- [requestAuthToken](request.md#requestauthtoken) - [requestBatchVC](request.md#requestbatchvc) - [requestVerificationCode](request.md#requestverificationcode) - [setIdentityNetworks](request.md#setidentitynetworks) @@ -31,7 +32,7 @@ requests ### addAccount -▸ **addAccount**(`api`, `data`): `Promise`\<\{ `payloadToSign?`: `string` ; `send`: (`args`: \{ `authentication`: `string` }) => `Promise`\<\{ `blockHash`: `string` ; `extrinsicHash`: `string` ; `response`: `WorkerRpcReturnValue` }\> }\> +▸ **addAccount**(`api`, `data`, `isWeb3Auth`): `Promise`\<\{ `payloadToSign?`: `string` ; `send`: (`args`: \{ `authentication`: [`AuthenticationData`](../README.md#authenticationdata) }) => `Promise`\<\{ `blockHash`: `string` ; `extrinsicHash`: `string` ; `response`: `WorkerRpcReturnValue` }\> }\> Adds an account to the Litentry Parachain. @@ -45,10 +46,11 @@ Adds an account to the Litentry Parachain. | `data.isPublic` | `boolean` | Whether the account is public | | `data.validation` | `LitentryValidationData` | The ownership proof. Use `createLitentryValidationDataType` helper to create this struct | | `data.who` | `LitentryIdentity` | The user's account. Use `createLitentryIdentityType` helper to create this struct | +| `isWeb3Auth` | `boolean` | Whether the user is using Web3 authentication | #### Returns -`Promise`\<\{ `payloadToSign?`: `string` ; `send`: (`args`: \{ `authentication`: `string` }) => `Promise`\<\{ `blockHash`: `string` ; `extrinsicHash`: `string` ; `response`: `WorkerRpcReturnValue` }\> }\> +`Promise`\<\{ `payloadToSign?`: `string` ; `send`: (`args`: \{ `authentication`: [`AuthenticationData`](../README.md#authenticationdata) }) => `Promise`\<\{ `blockHash`: `string` ; `extrinsicHash`: `string` ; `response`: `WorkerRpcReturnValue` }\> }\> - A promise that resolves to an object containing the payload to sign (if applicable) and a send function. @@ -64,13 +66,13 @@ signed payload. #### Defined in -[lib/requests/add-account.request.ts:31](https://github.com/litentry/client-sdk/blob/develop/lib/requests/add-account.request.ts#L31) +[lib/requests/add-account.request.ts:32](https://github.com/litentry/client-sdk/blob/develop/lib/requests/add-account.request.ts#L32) ___ ### callEthereum -▸ **callEthereum**(`api`, `data`): `Promise`\<\{ `payloadToSign?`: `string` ; `send`: (`args`: \{ `authentication`: `string` }) => `Promise`\<\{ `blockHash`: `string` ; `extrinsicHash`: `string` ; `response`: `WorkerRpcReturnValue` }\> }\> +▸ **callEthereum**(`api`, `data`, `isWeb3Auth`): `Promise`\<\{ `payloadToSign?`: `string` ; `send`: (`args`: \{ `authentication`: [`AuthenticationData`](../README.md#authenticationdata) }) => `Promise`\<\{ `blockHash`: `string` ; `extrinsicHash`: `string` ; `response`: `WorkerRpcReturnValue` }\> }\> OmniAccount: Call an Ethereum contract. @@ -84,10 +86,11 @@ OmniAccount: Call an Ethereum contract. | `data.input` | `U8aLike` | Contract input data | | `data.omniAccount` | `LitentryIdentity` | The user's omniAccount. Use `createLitentryIdentityType` helper to create this struct | | `data.who` | `LitentryIdentity` | The user's account. Use `createLitentryIdentityType` helper to create this struct | +| `isWeb3Auth` | `boolean` | Whether the user is using Web3 authentication | #### Returns -`Promise`\<\{ `payloadToSign?`: `string` ; `send`: (`args`: \{ `authentication`: `string` }) => `Promise`\<\{ `blockHash`: `string` ; `extrinsicHash`: `string` ; `response`: `WorkerRpcReturnValue` }\> }\> +`Promise`\<\{ `payloadToSign?`: `string` ; `send`: (`args`: \{ `authentication`: [`AuthenticationData`](../README.md#authenticationdata) }) => `Promise`\<\{ `blockHash`: `string` ; `extrinsicHash`: `string` ; `response`: `WorkerRpcReturnValue` }\> }\> - A promise that resolves to an object containing the payload to signature (if applicable) and a send function. @@ -104,13 +107,13 @@ is the signed payload. #### Defined in -[lib/requests/call-ethereum.request.ts:31](https://github.com/litentry/client-sdk/blob/develop/lib/requests/call-ethereum.request.ts#L31) +[lib/requests/call-ethereum.request.ts:32](https://github.com/litentry/client-sdk/blob/develop/lib/requests/call-ethereum.request.ts#L32) ___ ### createAccountStore -▸ **createAccountStore**(`api`, `data`): `Promise`\<\{ `payloadToSign?`: `string` ; `send`: (`args`: \{ `authentication`: `string` }) => `Promise`\<\{ `blockHash`: `string` ; `extrinsicHash`: `string` ; `response`: `WorkerRpcReturnValue` }\> }\> +▸ **createAccountStore**(`api`, `data`, `isWeb3Auth`): `Promise`\<\{ `payloadToSign?`: `string` ; `send`: (`args`: \{ `authentication`: [`AuthenticationData`](../README.md#authenticationdata) }) => `Promise`\<\{ `blockHash`: `string` ; `extrinsicHash`: `string` ; `response`: `WorkerRpcReturnValue` }\> }\> Creates an account store on the Litentry Parachain. @@ -122,10 +125,11 @@ Creates an account store on the Litentry Parachain. | `data` | `Object` | - | | `data.omniAccount` | `LitentryIdentity` | The user's OmniAccount. Use `createLitentryIdentityType` helper to create this struct | | `data.who` | `LitentryIdentity` | The user's account. Use `createLitentryIdentityType` helper to create this struct | +| `isWeb3Auth` | `boolean` | Whether the user is using Web3 authentication | #### Returns -`Promise`\<\{ `payloadToSign?`: `string` ; `send`: (`args`: \{ `authentication`: `string` }) => `Promise`\<\{ `blockHash`: `string` ; `extrinsicHash`: `string` ; `response`: `WorkerRpcReturnValue` }\> }\> +`Promise`\<\{ `payloadToSign?`: `string` ; `send`: (`args`: \{ `authentication`: [`AuthenticationData`](../README.md#authenticationdata) }) => `Promise`\<\{ `blockHash`: `string` ; `extrinsicHash`: `string` ; `response`: `WorkerRpcReturnValue` }\> }\> - A promise that resolves to an object containing the payload to sign (if applicable) and a send function. @@ -141,7 +145,7 @@ signed payload. #### Defined in -[lib/requests/create-account-store.request.ts:29](https://github.com/litentry/client-sdk/blob/develop/lib/requests/create-account-store.request.ts#L29) +[lib/requests/create-account-store.request.ts:30](https://github.com/litentry/client-sdk/blob/develop/lib/requests/create-account-store.request.ts#L30) ___ @@ -241,7 +245,7 @@ Return the Enclave registry information of the latest registered TEE worker. | Name | Type | Default value | | :------ | :------ | :------ | | `api` | `ApiPromise` | `undefined` | -| `workerType` | ``"Identity"`` \| ``"BitAcross"`` \| ``"OmniExecutor"`` | `'Identity'` | +| `workerType` | ``"Identity"`` \| ``"OmniExecutor"`` | `'Identity'` | #### Returns @@ -312,7 +316,7 @@ ___ ### publicizeAccount -▸ **publicizeAccount**(`api`, `data`): `Promise`\<\{ `payloadToSign?`: `string` ; `send`: (`args`: \{ `authentication`: `string` }) => `Promise`\<\{ `blockHash`: `string` ; `extrinsicHash`: `string` ; `response`: `WorkerRpcReturnValue` }\> }\> +▸ **publicizeAccount**(`api`, `data`, `isWeb3Auth`): `Promise`\<\{ `payloadToSign?`: `string` ; `send`: (`args`: \{ `authentication`: [`AuthenticationData`](../README.md#authenticationdata) }) => `Promise`\<\{ `blockHash`: `string` ; `extrinsicHash`: `string` ; `response`: `WorkerRpcReturnValue` }\> }\> Publicizes a member account in the AccountStore on the Litentry Parachain. @@ -324,10 +328,11 @@ Publicizes a member account in the AccountStore on the Litentry Parachain. | `data` | `Object` | - | | `data.identity` | `LitentryIdentity` | The member account for publicizing. Use `createLitentryIdentityType` helper to create this struct | | `data.who` | `LitentryIdentity` | The user's account. Use `createLitentryIdentityType` helper to create this struct | +| `isWeb3Auth` | `boolean` | Whether the user is using Web3 authentication | #### Returns -`Promise`\<\{ `payloadToSign?`: `string` ; `send`: (`args`: \{ `authentication`: `string` }) => `Promise`\<\{ `blockHash`: `string` ; `extrinsicHash`: `string` ; `response`: `WorkerRpcReturnValue` }\> }\> +`Promise`\<\{ `payloadToSign?`: `string` ; `send`: (`args`: \{ `authentication`: [`AuthenticationData`](../README.md#authenticationdata) }) => `Promise`\<\{ `blockHash`: `string` ; `extrinsicHash`: `string` ; `response`: `WorkerRpcReturnValue` }\> }\> A promise that resolves to an object containing the payload to sign (if applicable) and a send function. @@ -341,13 +346,13 @@ send.args.authentication The authentication string. For email identities, this i #### Defined in -[lib/requests/publicize-account.request.ts:28](https://github.com/litentry/client-sdk/blob/develop/lib/requests/publicize-account.request.ts#L28) +[lib/requests/publicize-account.request.ts:29](https://github.com/litentry/client-sdk/blob/develop/lib/requests/publicize-account.request.ts#L29) ___ ### remark -▸ **remark**(`api`, `data`): `Promise`\<\{ `payloadToSign?`: `string` ; `send`: (`args`: \{ `authentication`: `string` }) => `Promise`\<\{ `blockHash`: `string` ; `extrinsicHash`: `string` ; `response`: `WorkerRpcReturnValue` }\> }\> +▸ **remark**(`api`, `data`, `isWeb3Auth`): `Promise`\<\{ `payloadToSign?`: `string` ; `send`: (`args`: \{ `authentication`: [`AuthenticationData`](../README.md#authenticationdata) }) => `Promise`\<\{ `blockHash`: `string` ; `extrinsicHash`: `string` ; `response`: `WorkerRpcReturnValue` }\> }\> Sends a remark to the Litentry Parachain. @@ -360,10 +365,11 @@ Sends a remark to the Litentry Parachain. | `data.message` | `string` | the message to be sent | | `data.omniAccount` | `LitentryIdentity` | The user's omniAccount. Use `createLitentryIdentityType` helper to create this struct | | `data.who` | `LitentryIdentity` | The user's account. Use `createLitentryIdentityType` helper to create this struct | +| `isWeb3Auth` | `boolean` | Whether the user is using Web3 authentication | #### Returns -`Promise`\<\{ `payloadToSign?`: `string` ; `send`: (`args`: \{ `authentication`: `string` }) => `Promise`\<\{ `blockHash`: `string` ; `extrinsicHash`: `string` ; `response`: `WorkerRpcReturnValue` }\> }\> +`Promise`\<\{ `payloadToSign?`: `string` ; `send`: (`args`: \{ `authentication`: [`AuthenticationData`](../README.md#authenticationdata) }) => `Promise`\<\{ `blockHash`: `string` ; `extrinsicHash`: `string` ; `response`: `WorkerRpcReturnValue` }\> }\> - A promise that resolves to an object containing the payload to sign (if applicable) and a send function. @@ -380,13 +386,13 @@ this is the signed payload. #### Defined in -[lib/requests/remark.request.ts:30](https://github.com/litentry/client-sdk/blob/develop/lib/requests/remark.request.ts#L30) +[lib/requests/remark.request.ts:31](https://github.com/litentry/client-sdk/blob/develop/lib/requests/remark.request.ts#L31) ___ ### removeAccounts -▸ **removeAccounts**(`api`, `data`): `Promise`\<\{ `payloadToSign?`: `string` ; `send`: (`args`: \{ `authentication`: `string` }) => `Promise`\<\{ `blockHash`: `string` ; `extrinsicHash`: `string` ; `response`: `WorkerRpcReturnValue` }\> }\> +▸ **removeAccounts**(`api`, `data`, `isWeb3Auth`): `Promise`\<\{ `payloadToSign?`: `string` ; `send`: (`args`: \{ `authentication`: [`AuthenticationData`](../README.md#authenticationdata) }) => `Promise`\<\{ `blockHash`: `string` ; `extrinsicHash`: `string` ; `response`: `WorkerRpcReturnValue` }\> }\> Removes accounts from the Litentry Parachain. @@ -398,10 +404,11 @@ Removes accounts from the Litentry Parachain. | `data` | `Object` | - | | `data.identities` | `LitentryIdentity`[] | Accounts for removing | | `data.who` | `LitentryIdentity` | The user's account. Use `createLitentryIdentityType` helper to create this struct | +| `isWeb3Auth` | `boolean` | Whether the user is using Web3 authentication | #### Returns -`Promise`\<\{ `payloadToSign?`: `string` ; `send`: (`args`: \{ `authentication`: `string` }) => `Promise`\<\{ `blockHash`: `string` ; `extrinsicHash`: `string` ; `response`: `WorkerRpcReturnValue` }\> }\> +`Promise`\<\{ `payloadToSign?`: `string` ; `send`: (`args`: \{ `authentication`: [`AuthenticationData`](../README.md#authenticationdata) }) => `Promise`\<\{ `blockHash`: `string` ; `extrinsicHash`: `string` ; `response`: `WorkerRpcReturnValue` }\> }\> - A promise that resolves to an object containing the payload to sign (if applicable) and a send function. @@ -417,7 +424,44 @@ signed payload. #### Defined in -[lib/requests/remove-accounts.request.ts:30](https://github.com/litentry/client-sdk/blob/develop/lib/requests/remove-accounts.request.ts#L30) +[lib/requests/remove-accounts.request.ts:31](https://github.com/litentry/client-sdk/blob/develop/lib/requests/remove-accounts.request.ts#L31) + +___ + +### requestAuthToken + +▸ **requestAuthToken**(`api`, `data`, `isWeb3Auth`): `Promise`\<\{ `payloadToSign?`: `string` ; `send`: (`args`: \{ `authentication`: [`AuthenticationData`](../README.md#authenticationdata) }) => `Promise`\<\{ `token`: `string` }\> }\> + +Requests an authentication token from the Enclave. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `api` | `ApiPromise` | Litentry Parachain API instance from Polkadot.js | +| `data` | `Object` | - | +| `data.expiresAt` | `number` | The block number at which the token expires | +| `data.omniAccount` | `LitentryIdentity` | The user's omniAccount. Use `createLitentryIdentityType` helper to create this struct | +| `data.who` | `LitentryIdentity` | The user's account. Use `createLitentryIdentityType` helper to create this struct | +| `isWeb3Auth` | `boolean` | Whether the user is using Web3 authentication | + +#### Returns + +`Promise`\<\{ `payloadToSign?`: `string` ; `send`: (`args`: \{ `authentication`: [`AuthenticationData`](../README.md#authenticationdata) }) => `Promise`\<\{ `token`: `string` }\> }\> + +A promise that resolves to an object containing the payload to sign (if applicable) and a send function. + +[payloadToSign] The payload to sign if the identity is not an email. + +send A function to send the request to the Enclave. + +send.args The arguments required to send the request. + +send.args.authentication The authentication string. For email identities, this is the verification code. For non-email identities, this is the signed payload. + +#### Defined in + +[lib/requests/request_auth_token.request.ts:25](https://github.com/litentry/client-sdk/blob/develop/lib/requests/request_auth_token.request.ts#L25) ___ @@ -511,7 +555,7 @@ ___ ### transferEthereum -▸ **transferEthereum**(`api`, `data`): `Promise`\<\{ `payloadToSign?`: `string` ; `send`: (`args`: \{ `authentication`: `string` }) => `Promise`\<\{ `blockHash`: `string` ; `extrinsicHash`: `string` ; `response`: `WorkerRpcReturnValue` }\> }\> +▸ **transferEthereum**(`api`, `data`, `isWeb3Auth`): `Promise`\<\{ `payloadToSign?`: `string` ; `send`: (`args`: \{ `authentication`: [`AuthenticationData`](../README.md#authenticationdata) }) => `Promise`\<\{ `blockHash`: `string` ; `extrinsicHash`: `string` ; `response`: `WorkerRpcReturnValue` }\> }\> Transfers ETH to another account on Ethereum. @@ -525,10 +569,11 @@ Transfers ETH to another account on Ethereum. | `data.omniAccount` | `LitentryIdentity` | The user's omniAccount. Use `createLitentryIdentityType` helper to create this struct | | `data.to` | `string` | Ethereum address destination | | `data.who` | `LitentryIdentity` | The user's account. Use `createLitentryIdentityType` helper to create this struct | +| `isWeb3Auth` | `boolean` | Whether the user is using Web3 authentication | #### Returns -`Promise`\<\{ `payloadToSign?`: `string` ; `send`: (`args`: \{ `authentication`: `string` }) => `Promise`\<\{ `blockHash`: `string` ; `extrinsicHash`: `string` ; `response`: `WorkerRpcReturnValue` }\> }\> +`Promise`\<\{ `payloadToSign?`: `string` ; `send`: (`args`: \{ `authentication`: [`AuthenticationData`](../README.md#authenticationdata) }) => `Promise`\<\{ `blockHash`: `string` ; `extrinsicHash`: `string` ; `response`: `WorkerRpcReturnValue` }\> }\> - A promise that resolves to an object containing the payload to signature (if applicable) and a send function. @@ -545,13 +590,13 @@ this is the signed payload. #### Defined in -[lib/requests/transfer-ethereum.request.ts:30](https://github.com/litentry/client-sdk/blob/develop/lib/requests/transfer-ethereum.request.ts#L30) +[lib/requests/transfer-ethereum.request.ts:31](https://github.com/litentry/client-sdk/blob/develop/lib/requests/transfer-ethereum.request.ts#L31) ___ ### transferNative -▸ **transferNative**(`api`, `data`): `Promise`\<\{ `payloadToSign?`: `string` ; `send`: (`args`: \{ `authentication`: `string` }) => `Promise`\<\{ `blockHash`: `string` ; `extrinsicHash`: `string` ; `response`: `WorkerRpcReturnValue` }\> }\> +▸ **transferNative**(`api`, `data`, `isWeb3Auth`): `Promise`\<\{ `payloadToSign?`: `string` ; `send`: (`args`: \{ `authentication`: [`AuthenticationData`](../README.md#authenticationdata) }) => `Promise`\<\{ `blockHash`: `string` ; `extrinsicHash`: `string` ; `response`: `WorkerRpcReturnValue` }\> }\> Transfers native tokens to another account on the Litentry Parachain. @@ -565,10 +610,11 @@ Transfers native tokens to another account on the Litentry Parachain. | `data.omniAccount` | `LitentryIdentity` | The user's omniAccount. Use `createLitentryIdentityType` helper to create this struct | | `data.to` | `string` | Account destination in hex or ss58 formatted address | | `data.who` | `LitentryIdentity` | The user's account. Use `createLitentryIdentityType` helper to create this struct | +| `isWeb3Auth` | `boolean` | Whether the user is using Web3 authentication | #### Returns -`Promise`\<\{ `payloadToSign?`: `string` ; `send`: (`args`: \{ `authentication`: `string` }) => `Promise`\<\{ `blockHash`: `string` ; `extrinsicHash`: `string` ; `response`: `WorkerRpcReturnValue` }\> }\> +`Promise`\<\{ `payloadToSign?`: `string` ; `send`: (`args`: \{ `authentication`: [`AuthenticationData`](../README.md#authenticationdata) }) => `Promise`\<\{ `blockHash`: `string` ; `extrinsicHash`: `string` ; `response`: `WorkerRpcReturnValue` }\> }\> - A promise that resolves to an object containing the payload to sign (if applicable) and a send function. @@ -585,13 +631,13 @@ this is the signed payload. #### Defined in -[lib/requests/transfer-native.request.ts:30](https://github.com/litentry/client-sdk/blob/develop/lib/requests/transfer-native.request.ts#L30) +[lib/requests/transfer-native.request.ts:31](https://github.com/litentry/client-sdk/blob/develop/lib/requests/transfer-native.request.ts#L31) ___ ### transferSolana -▸ **transferSolana**(`api`, `data`): `Promise`\<\{ `payloadToSign?`: `string` ; `send`: (`args`: \{ `authentication`: `string` }) => `Promise`\<\{ `blockHash`: `string` ; `extrinsicHash`: `string` ; `response`: `WorkerRpcReturnValue` }\> }\> +▸ **transferSolana**(`api`, `data`, `isWeb3Auth`): `Promise`\<\{ `payloadToSign?`: `string` ; `send`: (`args`: \{ `authentication`: [`AuthenticationData`](../README.md#authenticationdata) }) => `Promise`\<\{ `blockHash`: `string` ; `extrinsicHash`: `string` ; `response`: `WorkerRpcReturnValue` }\> }\> Transfers SOL to another account on Solana. @@ -605,10 +651,11 @@ Transfers SOL to another account on Solana. | `data.omniAccount` | `LitentryIdentity` | The user's omniAccount. Use `createLitentryIdentityType` helper to create this struct | | `data.to` | `string` | Solana address destination | | `data.who` | `LitentryIdentity` | The user's account. Use `createLitentryIdentityType` helper to create this struct | +| `isWeb3Auth` | `boolean` | Whether the user is using Web3 authentication | #### Returns -`Promise`\<\{ `payloadToSign?`: `string` ; `send`: (`args`: \{ `authentication`: `string` }) => `Promise`\<\{ `blockHash`: `string` ; `extrinsicHash`: `string` ; `response`: `WorkerRpcReturnValue` }\> }\> +`Promise`\<\{ `payloadToSign?`: `string` ; `send`: (`args`: \{ `authentication`: [`AuthenticationData`](../README.md#authenticationdata) }) => `Promise`\<\{ `blockHash`: `string` ; `extrinsicHash`: `string` ; `response`: `WorkerRpcReturnValue` }\> }\> - A promise that resolves to an object containing the payload to signature (if applicable) and a send function. @@ -625,4 +672,4 @@ this is the signed payload. #### Defined in -[lib/requests/transfer-solana.request.ts:30](https://github.com/litentry/client-sdk/blob/develop/lib/requests/transfer-solana.request.ts#L30) +[lib/requests/transfer-solana.request.ts:31](https://github.com/litentry/client-sdk/blob/develop/lib/requests/transfer-solana.request.ts#L31) diff --git a/tee-worker/identity/client-sdk/packages/client-sdk/package.json b/tee-worker/identity/client-sdk/packages/client-sdk/package.json index 7d62917eda..dc34573370 100644 --- a/tee-worker/identity/client-sdk/packages/client-sdk/package.json +++ b/tee-worker/identity/client-sdk/packages/client-sdk/package.json @@ -1,14 +1,14 @@ { "name": "@litentry/client-sdk", "description": "This package provides helpers for dApps to interact with the Litentry Protocol.", - "version": "1.0.0-next.7", + "version": "1.0.0-next.12", "license": "GPL-3.0-or-later", "dependencies": {}, "devDependencies": { "@polkadot/rpc-provider": "^15.0.1" }, "peerDependencies": { - "@litentry/parachain-api": "0.9.20-next.10", + "@litentry/parachain-api": "0.9.21-next.3", "@litentry/sidechain-api": "0.9.20-next.8", "@litentry/chaindata": "*", "@polkadot/api": "^15.0.1", diff --git a/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/add-account.request.ts b/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/add-account.request.ts index ebc1b167f8..e5bae0058e 100644 --- a/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/add-account.request.ts +++ b/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/add-account.request.ts @@ -16,6 +16,7 @@ import { createRequestType } from '../type-creators/request'; import type { JsonRpcRequest } from '../util/types'; import { getEnclaveNonce } from './get-enclave-nonce'; +import { AuthenticationData } from '../type-creators/tc-authentication'; /** * Adds an account to the Litentry Parachain. @@ -40,10 +41,12 @@ export async function addAccount( validation: LitentryValidationData; /** Whether the account is public */ isPublic: boolean; - } + }, + /** Whether the user is using Web3 authentication */ + isWeb3Auth: boolean ): Promise<{ payloadToSign?: string; - send: (args: { authentication: string }) => Promise<{ + send: (args: { authentication: AuthenticationData }) => Promise<{ response: WorkerRpcReturnValue; blockHash: string; extrinsicHash: string; @@ -66,7 +69,7 @@ export async function addAccount( }); const send = async (args: { - authentication: string; + authentication: AuthenticationData; }): Promise<{ response: WorkerRpcReturnValue; blockHash: string; @@ -74,7 +77,6 @@ export async function addAccount( }> => { // prepare and encrypt request const request = await createRequestType(api, { - sender: who, authentication: args.authentication, call, nonce, @@ -112,7 +114,7 @@ export async function addAccount( }; }; - if (who.isEmail) { + if (!isWeb3Auth) { return { send }; } diff --git a/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/call-ethereum.request.ts b/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/call-ethereum.request.ts index b84ac0f1ce..4915ee4b18 100644 --- a/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/call-ethereum.request.ts +++ b/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/call-ethereum.request.ts @@ -15,6 +15,7 @@ import { createRequestType } from '../type-creators/request'; import type { JsonRpcRequest } from '../util/types'; import type { U8aLike } from '@polkadot/util/types'; +import { AuthenticationData } from '../type-creators/tc-authentication'; /** * OmniAccount: Call an Ethereum contract. @@ -40,10 +41,12 @@ export async function callEthereum( address: string; /** Contract input data */ input: U8aLike; - } + }, + /** Whether the user is using Web3 authentication */ + isWeb3Auth: boolean ): Promise<{ payloadToSign?: string; - send: (args: { authentication: string }) => Promise<{ + send: (args: { authentication: AuthenticationData }) => Promise<{ response: WorkerRpcReturnValue; blockHash: string; extrinsicHash: string; @@ -72,7 +75,7 @@ export async function callEthereum( const nonce = await api.rpc.system.accountNextIndex(omniAccount.asSubstrate); const send = async (args: { - authentication: string; + authentication: AuthenticationData; }): Promise<{ response: WorkerRpcReturnValue; blockHash: string; @@ -81,7 +84,6 @@ export async function callEthereum( // prepare and encrypt request const request = await createRequestType(api, { - sender: who, authentication: args.authentication, call, nonce, @@ -119,7 +121,7 @@ export async function callEthereum( }; }; - if (who.isEmail) { + if (!isWeb3Auth) { return { send, }; diff --git a/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/create-account-store.request.ts b/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/create-account-store.request.ts index 639145678a..d7eb9df214 100644 --- a/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/create-account-store.request.ts +++ b/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/create-account-store.request.ts @@ -14,6 +14,7 @@ import { createTrustedCallType } from '../type-creators/trusted-call'; import { createRequestType } from '../type-creators/request'; import type { JsonRpcRequest } from '../util/types'; +import { AuthenticationData } from '../type-creators/tc-authentication'; /** * Creates an account store on the Litentry Parachain. @@ -34,10 +35,12 @@ export async function createAccountStore( omniAccount: LitentryIdentity; /** The user's account. Use `createLitentryIdentityType` helper to create this struct */ who: LitentryIdentity; - } + }, + /** Whether the user is using Web3 authentication */ + isWeb3Auth: boolean ): Promise<{ payloadToSign?: string; - send: (args: { authentication: string }) => Promise<{ + send: (args: { authentication: AuthenticationData }) => Promise<{ response: WorkerRpcReturnValue; blockHash: string; extrinsicHash: string; @@ -60,7 +63,7 @@ export async function createAccountStore( ); const send = async (args: { - authentication: string; + authentication: AuthenticationData; }): Promise<{ response: WorkerRpcReturnValue; blockHash: string; @@ -69,7 +72,6 @@ export async function createAccountStore( // prepare and encrypt request const request = await createRequestType(api, { - sender: who, authentication: args.authentication, call, nonce, @@ -107,7 +109,7 @@ export async function createAccountStore( }; }; - if (who.isEmail) { + if (!isWeb3Auth) { return { send }; } diff --git a/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/index.ts b/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/index.ts index 201f4e422a..96b03c08ab 100644 --- a/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/index.ts +++ b/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/index.ts @@ -16,3 +16,4 @@ export { getIdGraph } from './get-id-graph.request'; export { getIdGraphHash } from './get-id-graph-hash'; export { getLastRegisteredEnclave } from './get-last-registered-enclave'; export { requestVerificationCode } from './request-verification-code.request'; +export { requestAuthToken } from './request_auth_token.request'; diff --git a/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/link-identity-callback.request.ts b/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/link-identity-callback.request.ts index 9d2783580a..1a86639b4d 100644 --- a/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/link-identity-callback.request.ts +++ b/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/link-identity-callback.request.ts @@ -67,8 +67,6 @@ export async function linkIdentityCallback( }, }); - console.log('call', call.toHuman()); - const payloadToSign = createPayloadToSign({ who, call, @@ -86,8 +84,11 @@ export async function linkIdentityCallback( }> => { // prepare and encrypt request const request = await createRequestType(api, { - sender: signer, - authentication: args.signedPayload, + authentication: { + type: 'Web3', + signer, + signature: args.signedPayload, + }, call, nonce, shard: shardU8, diff --git a/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/link-identity.request.ts b/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/link-identity.request.ts index f342438263..dac05d7edc 100644 --- a/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/link-identity.request.ts +++ b/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/link-identity.request.ts @@ -131,8 +131,11 @@ export async function linkIdentity( }> => { // prepare and encrypt request const request = await createRequestType(api, { - sender: who, - authentication: args.signedPayload, + authentication: { + type: 'Web3', + signer: who, + signature: args.signedPayload, + }, call, nonce, shard: shardU8, diff --git a/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/publicize-account.request.ts b/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/publicize-account.request.ts index 6c7c826a32..d0444ea6b0 100644 --- a/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/publicize-account.request.ts +++ b/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/publicize-account.request.ts @@ -15,6 +15,7 @@ import { createRequestType } from '../type-creators/request'; import type { JsonRpcRequest } from '../util/types'; import { getEnclaveNonce } from './get-enclave-nonce'; +import { AuthenticationData } from '../type-creators/tc-authentication'; /** * Publicizes a member account in the AccountStore on the Litentry Parachain. @@ -33,10 +34,12 @@ export async function publicizeAccount( who: LitentryIdentity; /** The member account for publicizing. Use `createLitentryIdentityType` helper to create this struct */ identity: LitentryIdentity; - } + }, + /** Whether the user is using Web3 authentication */ + isWeb3Auth: boolean ): Promise<{ payloadToSign?: string; - send: (args: { authentication: string }) => Promise<{ + send: (args: { authentication: AuthenticationData }) => Promise<{ response: WorkerRpcReturnValue; blockHash: string; extrinsicHash: string; @@ -57,7 +60,7 @@ export async function publicizeAccount( }); const send = async (args: { - authentication: string; + authentication: AuthenticationData; }): Promise<{ response: WorkerRpcReturnValue; blockHash: string; @@ -65,7 +68,6 @@ export async function publicizeAccount( }> => { // prepare and encrypt request const request = await createRequestType(api, { - sender: who, authentication: args.authentication, call, nonce, @@ -103,7 +105,7 @@ export async function publicizeAccount( }; }; - if (who.isEmail) { + if (!isWeb3Auth) { return { send }; } diff --git a/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/remark.request.ts b/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/remark.request.ts index 993f51a945..19e7d3cb0c 100644 --- a/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/remark.request.ts +++ b/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/remark.request.ts @@ -14,6 +14,7 @@ import { createTrustedCallType } from '../type-creators/trusted-call'; import { createRequestType } from '../type-creators/request'; import type { JsonRpcRequest } from '../util/types'; +import { AuthenticationData } from '../type-creators/tc-authentication'; /** * Sends a remark to the Litentry Parachain. @@ -37,10 +38,12 @@ export async function remark( who: LitentryIdentity; /** the message to be sent */ message: string; - } + }, + /** Whether the user is using Web3 authentication */ + isWeb3Auth: boolean ): Promise<{ payloadToSign?: string; - send: (args: { authentication: string }) => Promise<{ + send: (args: { authentication: AuthenticationData }) => Promise<{ response: WorkerRpcReturnValue; blockHash: string; extrinsicHash: string; @@ -68,7 +71,7 @@ export async function remark( ); const send = async (args: { - authentication: string; + authentication: AuthenticationData; }): Promise<{ response: WorkerRpcReturnValue; blockHash: string; @@ -77,7 +80,6 @@ export async function remark( // prepare and encrypt request const request = await createRequestType(api, { - sender: who, authentication: args.authentication, call, nonce, @@ -115,7 +117,7 @@ export async function remark( }; }; - if (who.isEmail) { + if (!isWeb3Auth) { return { send }; } diff --git a/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/remove-accounts.request.ts b/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/remove-accounts.request.ts index 9eb783287a..9544fcaae1 100644 --- a/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/remove-accounts.request.ts +++ b/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/remove-accounts.request.ts @@ -15,6 +15,7 @@ import { createRequestType } from '../type-creators/request'; import type { JsonRpcRequest } from '../util/types'; import { getEnclaveNonce } from './get-enclave-nonce'; +import { AuthenticationData } from '../type-creators/tc-authentication'; /** * Removes accounts from the Litentry Parachain. @@ -35,10 +36,12 @@ export async function removeAccounts( who: LitentryIdentity; /** Accounts for removing */ identities: Array; - } + }, + /** Whether the user is using Web3 authentication */ + isWeb3Auth: boolean ): Promise<{ payloadToSign?: string; - send: (args: { authentication: string }) => Promise<{ + send: (args: { authentication: AuthenticationData }) => Promise<{ response: WorkerRpcReturnValue; blockHash: string; extrinsicHash: string; @@ -59,7 +62,7 @@ export async function removeAccounts( }); const send = async (args: { - authentication: string; + authentication: AuthenticationData; }): Promise<{ response: WorkerRpcReturnValue; blockHash: string; @@ -67,7 +70,6 @@ export async function removeAccounts( }> => { // prepare and encrypt request const request = await createRequestType(api, { - sender: who, authentication: args.authentication, call, nonce, @@ -105,7 +107,7 @@ export async function removeAccounts( }; }; - if (who.isEmail) { + if (!isWeb3Auth) { return { send }; } diff --git a/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/request-batch-vc.request.ts b/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/request-batch-vc.request.ts index 58c8b073c2..40caf80bed 100644 --- a/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/request-batch-vc.request.ts +++ b/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/request-batch-vc.request.ts @@ -112,8 +112,11 @@ export async function requestBatchVC( }> => { // prepare and encrypt request const requestPayload = await createRequestType(api, { - sender: signer, - authentication: args.signedPayload, + authentication: { + type: 'Web3', + signer, + signature: args.signedPayload, + }, call, nonce, shard: shardU8, diff --git a/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/request_auth_token.request.ts b/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/request_auth_token.request.ts new file mode 100644 index 0000000000..cf44cf90f7 --- /dev/null +++ b/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/request_auth_token.request.ts @@ -0,0 +1,121 @@ +import type { ApiPromise } from '@polkadot/api'; +import type { + LitentryIdentity, + TrustedCallResult, +} from '@litentry/parachain-api'; +import type { JsonRpcRequest } from '../util/types'; + +import { codecToString } from '../util/codec-to-string'; +import { hexToU8a, assert } from '@polkadot/util'; +import { enclave } from '../enclave'; +import { createPayloadToSign } from '../util/create-payload-to-sign'; +import { createTrustedCallType } from '../type-creators/trusted-call'; +import { createRequestType } from '../type-creators/request'; +import { AuthenticationData } from '../type-creators/tc-authentication'; + +/** + * Requests an authentication token from the Enclave. + * + * @returns {Promise} A promise that resolves to an object containing the payload to sign (if applicable) and a send function. + * @returns {string} [payloadToSign] The payload to sign if the identity is not an email. + * @returns {Function} send A function to send the request to the Enclave. + * @returns {Promise} send.args The arguments required to send the request. + * @returns {string} send.args.authentication The authentication string. For email identities, this is the verification code. For non-email identities, this is the signed payload. + */ +export async function requestAuthToken( + /** Litentry Parachain API instance from Polkadot.js */ + api: ApiPromise, + data: { + /** The user's omniAccount. Use `createLitentryIdentityType` helper to create this struct */ + omniAccount: LitentryIdentity; + /** The user's account. Use `createLitentryIdentityType` helper to create this struct */ + who: LitentryIdentity; + /** The block number at which the token expires */ + expiresAt: number; + }, + /** Whether the user is using Web3 authentication */ + isWeb3Auth: boolean +): Promise<{ + payloadToSign?: string; + send: (args: { authentication: AuthenticationData }) => Promise<{ + token: string; + }>; +}> { + const { who, expiresAt, omniAccount } = data; + + assert(omniAccount.isSubstrate, 'OmniAccount must be a Substrate identity'); + + const nonce = await api.rpc.system.accountNextIndex( + omniAccount.asSubstrate.toHex() + ); + + const shard = await enclave.getShard(api); + const shardU8 = hexToU8a(shard); + const authOptions = api.createType('AuthOptions', { expires_at: expiresAt }); + + const { call } = await createTrustedCallType(api.registry, { + method: 'request_auth_token', + params: { + who, + options: authOptions, + }, + }); + + const send = async (args: { + authentication: AuthenticationData; + }): Promise<{ + token: string; + }> => { + // prepare and encrypt request + const request = await createRequestType(api, { + authentication: args.authentication, + call, + nonce, + shard: shardU8, + }); + + // send the request to the Enclave + const rpcRequest: JsonRpcRequest = { + jsonrpc: '2.0', + method: 'author_submitNativeRequest', + params: [request.toHex()], + }; + + const [response] = await enclave.send(api, rpcRequest); // we expect 1 response only + + const result: TrustedCallResult = api.createType( + 'TrustedCallResult', + response.value + ); + + if (result.isErr) { + throw new Error(codecToString(result.asErr)); + } + + if (!result.asOk.isAuthToken) { + throw new Error('Unexpected response type'); + } + + const token = result.asOk.asAuthToken.toHuman(); + + return { + token, + }; + }; + + if (!isWeb3Auth) { + return { send }; + } + + const payloadToSign = createPayloadToSign({ + who, + call, + nonce, + shard: shardU8, + }); + + return { + payloadToSign, + send, + }; +} diff --git a/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/set-identity-networks.request.ts b/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/set-identity-networks.request.ts index 1fb00eb986..5ad0957933 100644 --- a/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/set-identity-networks.request.ts +++ b/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/set-identity-networks.request.ts @@ -79,8 +79,11 @@ export async function setIdentityNetworks( }> => { // prepare and encrypt request const requestPayload = await createRequestType(api, { - sender: who, - authentication: args.signedPayload, + authentication: { + type: 'Web3', + signer: who, + signature: args.signedPayload, + }, call, nonce, shard: shardU8, diff --git a/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/transfer-ethereum.request.ts b/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/transfer-ethereum.request.ts index 0b20c9bbf2..8c3638ca64 100644 --- a/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/transfer-ethereum.request.ts +++ b/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/transfer-ethereum.request.ts @@ -14,6 +14,7 @@ import { createTrustedCallType } from '../type-creators/trusted-call'; import { createRequestType } from '../type-creators/request'; import type { JsonRpcRequest } from '../util/types'; +import { AuthenticationData } from '../type-creators/tc-authentication'; /** * Transfers ETH to another account on Ethereum. @@ -39,10 +40,12 @@ export async function transferEthereum( to: string; /** Amount to send */ amount: bigint; - } + }, + /** Whether the user is using Web3 authentication */ + isWeb3Auth: boolean ): Promise<{ payloadToSign?: string; - send: (args: { authentication: string }) => Promise<{ + send: (args: { authentication: AuthenticationData }) => Promise<{ response: WorkerRpcReturnValue; blockHash: string; extrinsicHash: string; @@ -71,7 +74,7 @@ export async function transferEthereum( const nonce = await api.rpc.system.accountNextIndex(omniAccount.asSubstrate); const send = async (args: { - authentication: string; + authentication: AuthenticationData; }): Promise<{ response: WorkerRpcReturnValue; blockHash: string; @@ -80,7 +83,6 @@ export async function transferEthereum( // prepare and encrypt request const request = await createRequestType(api, { - sender: who, authentication: args.authentication, call, nonce, @@ -118,7 +120,7 @@ export async function transferEthereum( }; }; - if (who.isEmail) { + if (!isWeb3Auth) { return { send }; } diff --git a/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/transfer-native.request.ts b/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/transfer-native.request.ts index 619a19691f..589cfdc553 100644 --- a/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/transfer-native.request.ts +++ b/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/transfer-native.request.ts @@ -14,6 +14,7 @@ import { createTrustedCallType } from '../type-creators/trusted-call'; import { createRequestType } from '../type-creators/request'; import type { JsonRpcRequest } from '../util/types'; +import { AuthenticationData } from '../type-creators/tc-authentication'; /** * Transfers native tokens to another account on the Litentry Parachain. @@ -39,10 +40,12 @@ export async function transferNative( to: string; /** Amount to send */ amount: bigint; - } + }, + /** Whether the user is using Web3 authentication */ + isWeb3Auth: boolean ): Promise<{ payloadToSign?: string; - send: (args: { authentication: string }) => Promise<{ + send: (args: { authentication: AuthenticationData }) => Promise<{ response: WorkerRpcReturnValue; blockHash: string; extrinsicHash: string; @@ -71,7 +74,7 @@ export async function transferNative( const nonce = await api.rpc.system.accountNextIndex(omniAccount.asSubstrate); const send = async (args: { - authentication: string; + authentication: AuthenticationData; }): Promise<{ response: WorkerRpcReturnValue; blockHash: string; @@ -80,7 +83,6 @@ export async function transferNative( // prepare and encrypt request const request = await createRequestType(api, { - sender: who, authentication: args.authentication, call, nonce, @@ -118,7 +120,7 @@ export async function transferNative( }; }; - if (who.isEmail) { + if (isWeb3Auth) { return { send }; } diff --git a/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/transfer-solana.request.ts b/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/transfer-solana.request.ts index 042b7bbdd7..09710933a4 100644 --- a/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/transfer-solana.request.ts +++ b/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/requests/transfer-solana.request.ts @@ -14,6 +14,7 @@ import { createTrustedCallType } from '../type-creators/trusted-call'; import { createRequestType } from '../type-creators/request'; import type { JsonRpcRequest } from '../util/types'; +import { AuthenticationData } from '../type-creators/tc-authentication'; /** * Transfers SOL to another account on Solana. @@ -39,10 +40,12 @@ export async function transferSolana( to: string; /** Amount to send in lamports */ amount: bigint; - } + }, + /** Whether the user is using Web3 authentication */ + isWeb3Auth: boolean ): Promise<{ payloadToSign?: string; - send: (args: { authentication: string }) => Promise<{ + send: (args: { authentication: AuthenticationData }) => Promise<{ response: WorkerRpcReturnValue; blockHash: string; extrinsicHash: string; @@ -71,7 +74,7 @@ export async function transferSolana( const nonce = await api.rpc.system.accountNextIndex(omniAccount.asSubstrate); const send = async (args: { - authentication: string; + authentication: AuthenticationData; }): Promise<{ response: WorkerRpcReturnValue; blockHash: string; @@ -80,7 +83,6 @@ export async function transferSolana( // prepare and encrypt request const request = await createRequestType(api, { - sender: who, authentication: args.authentication, call, nonce, @@ -118,7 +120,7 @@ export async function transferSolana( }; }; - if (who.isEmail) { + if (!isWeb3Auth) { return { send }; } diff --git a/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/type-creators/request.ts b/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/type-creators/request.ts index 1b7a1db2f9..1d0515da8e 100644 --- a/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/type-creators/request.ts +++ b/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/type-creators/request.ts @@ -6,10 +6,8 @@ import { enclave } from '../enclave'; import type { TrustedCall, - LitentryIdentity, AesRequest, AesOutput, - TCAuthentication, } from '@litentry/parachain-api'; import { encrypt, @@ -19,7 +17,10 @@ import { } from '../util/shielding-key'; import { createKeyAesOutputType } from './key-aes-output'; import { createLitentryMultiSignature } from './litentry-multi-signature'; -import { createTCAuthenticationType } from './tc-authentication'; +import { + createTCAuthenticationType, + AuthenticationData, +} from './tc-authentication'; /** * Creates a Request struct type for the `TrustedCall` operation. @@ -32,15 +33,13 @@ import { createTCAuthenticationType } from './tc-authentication'; export async function createRequestType( api: ApiPromise, data: { - sender: LitentryIdentity; - /** signature or verification code based on the identity type */ - authentication: string; + authentication: AuthenticationData; call: TrustedCall; nonce: Index; shard: Uint8Array; } ): Promise { - const { sender, shard, authentication, nonce, call } = data; + const { shard, authentication, nonce, call } = data; // generate ephemeral shielding key to encrypt the operation const encryptionKey = await generate(); @@ -49,14 +48,14 @@ export async function createRequestType( let operationU8a = new Uint8Array(); if (isNativeRequest(call)) { + const tcAuthentication = createTCAuthenticationType( + api.registry, + authentication + ); const callAuthenticated = api.createType('TrustedCallAuthenticated', { call, nonce, - authentication: createAuthenticationForSender( - api, - sender, - authentication - ), + authentication: tcAuthentication, }); const operation = api.createType('TrustedOperationAuthenticated', { @@ -65,12 +64,17 @@ export async function createRequestType( operationU8a = operation.toU8a(); } else { + if (authentication.type !== 'Web3') { + throw new Error( + 'Only Web3 authentication is supported for non-native requests' + ); + } const signedCall = api.createType('TrustedCallSigned', { call, index: nonce, signature: createLitentryMultiSignature(api.registry, { - who: sender, - signature: authentication, + who: authentication.signer, + signature: authentication.signature, }), }); @@ -111,23 +115,12 @@ export async function createRequestType( } function isNativeRequest(call: TrustedCall): boolean { - return call.isRequestIntent || call.isCreateAccountStore; -} - -function createAuthenticationForSender( - api: ApiPromise, - signer: LitentryIdentity, - authentication: string -): TCAuthentication { - if (signer.isEmail) { - return createTCAuthenticationType(api.registry, { - type: 'Email', - verificationCode: authentication, - }); - } - return createTCAuthenticationType(api.registry, { - type: 'Web3', - signer, - signature: authentication, - }); + return ( + call.isRequestIntent || + call.isCreateAccountStore || + call.isAddAccount || + call.isRemoveAccounts || + call.isPublicizeAccount || + call.isRequestAuthToken + ); } diff --git a/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/type-creators/tc-authentication.test.ts b/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/type-creators/tc-authentication.test.ts index f21c460cfa..137d3f55d6 100644 --- a/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/type-creators/tc-authentication.test.ts +++ b/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/type-creators/tc-authentication.test.ts @@ -48,4 +48,17 @@ describe('createTCAuthenticationType', () => { Sr25519: signature, }); }); + + it('creates AuthToken authentication', () => { + const authTokenTCAuthentication = createTCAuthenticationType(registry, { + type: 'AuthToken', + token: 'test-token', + }); + + expect(authTokenTCAuthentication).toBeDefined(); + expect(authTokenTCAuthentication.isAuthToken).toEqual(true); + expect(authTokenTCAuthentication.asAuthToken.toHuman()).toEqual( + 'test-token' + ); + }); }); diff --git a/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/type-creators/tc-authentication.ts b/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/type-creators/tc-authentication.ts index ac47c98406..0095b4c8c4 100644 --- a/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/type-creators/tc-authentication.ts +++ b/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/type-creators/tc-authentication.ts @@ -2,7 +2,7 @@ import { LitentryIdentity, TCAuthentication } from '@litentry/parachain-api'; import { Registry } from '@polkadot/types-codec/types'; import { createLitentryMultiSignature } from './litentry-multi-signature'; -type AuthenticationData = +export type AuthenticationData = | { type: 'Email'; verificationCode: string; @@ -11,19 +11,38 @@ type AuthenticationData = type: 'Web3'; signer: LitentryIdentity; signature: string; + } + | { + type: 'AuthToken'; + token: string; }; export function createTCAuthenticationType( registry: Registry, data: AuthenticationData ): TCAuthentication { - return registry.createType('TCAuthentication', { - [data.type]: - data.type === 'Email' - ? data.verificationCode - : createLitentryMultiSignature(registry, { - who: data.signer, - signature: data.signature, - }), - }); + let authentication; + switch (data.type) { + case 'Email': + authentication = { + Email: data.verificationCode, + }; + break; + case 'Web3': + authentication = { + Web3: createLitentryMultiSignature(registry, { + who: data.signer, + signature: data.signature, + }), + }; + break; + case 'AuthToken': + authentication = { + AuthToken: data.token, + }; + break; + default: + throw new Error('Unsupported authentication type'); + } + return registry.createType('TCAuthentication', authentication); } diff --git a/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/type-creators/trusted-call.ts b/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/type-creators/trusted-call.ts index 510b1e1fa1..2f58315c0b 100644 --- a/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/type-creators/trusted-call.ts +++ b/tee-worker/identity/client-sdk/packages/client-sdk/src/lib/type-creators/trusted-call.ts @@ -7,6 +7,7 @@ import type { TrustedCall, LitentryIdentity, LitentryValidationData, + AuthOptions, Web3Network, Assertion, } from '@litentry/parachain-api'; @@ -97,6 +98,12 @@ type RequestPublicizeAccountParams = { identity: LitentryIdentity; }; +// LitentryIdentity, AuthOptions +type RequestAuthTokenParams = { + who: LitentryIdentity; + options: AuthOptions; +}; + /** * Creates the TrustedCall for the given method and provide the `param's` types expected for them. * @@ -170,6 +177,13 @@ export async function createTrustedCallType( params: RequestPublicizeAccountParams; } ): Promise<{ call: TrustedCall; key: CryptoKey }>; +export async function createTrustedCallType( + registry: Registry, + data: { + method: 'request_auth_token'; + params: RequestAuthTokenParams; + } +): Promise<{ call: TrustedCall; key: CryptoKey }>; export async function createTrustedCallType( registry: Registry, data: { @@ -314,7 +328,6 @@ export async function createTrustedCallType( if (isRequestAddAccountParams(method, params)) { const { who, identity, validation, isPublic } = params; - const call = registry.createType('TrustedCall', { [trustedCallMethodsMap.add_account]: registry.createType( trusted_operations.types.TrustedCall._enum.add_account, @@ -328,7 +341,10 @@ export async function createTrustedCallType( if (isRequestRemoveAccountsParams(method, params)) { const { who, identities } = params; - const identitiesVec = registry.createType('Vec', identities); + const identitiesVec = registry.createType( + 'Vec', + identities + ); const call = registry.createType('TrustedCall', { [trustedCallMethodsMap.remove_accounts]: registry.createType( trusted_operations.types.TrustedCall._enum.remove_accounts, @@ -352,6 +368,19 @@ export async function createTrustedCallType( return { call, key }; } + if (isRequestAuthTokenParams(method, params)) { + const { who, options } = params; + + const call = registry.createType('TrustedCall', { + [trustedCallMethodsMap.request_auth_token]: registry.createType( + trusted_operations.types.TrustedCall._enum.request_auth_token, + [who, options] + ), + }) as TrustedCall; + + return { call, key }; + } + throw new Error(`trusted call method: ${data.method} is not supported`); } @@ -418,3 +447,10 @@ function isRequestPublicizeAccountParams( ): params is RequestPublicizeAccountParams { return method === 'publicize_account'; } + +function isRequestAuthTokenParams( + method: TrustedCallMethod, + params: Record +): params is RequestAuthTokenParams { + return method === 'request_auth_token'; +} diff --git a/tee-worker/identity/client-sdk/pnpm-lock.yaml b/tee-worker/identity/client-sdk/pnpm-lock.yaml index bf1bb03c98..c585813c27 100644 --- a/tee-worker/identity/client-sdk/pnpm-lock.yaml +++ b/tee-worker/identity/client-sdk/pnpm-lock.yaml @@ -37,23 +37,23 @@ importers: specifier: 0.16.0 version: 0.16.0(@nrwl/devkit@19.8.4)(@nrwl/js@19.8.4)(@nrwl/workspace@19.8.4)(validate-npm-package-name@5.0.1) '@nx/devkit': - specifier: 16.10.0 - version: 16.10.0(nx@17.3.2) + specifier: ^17.3.2 + version: 17.3.2(nx@17.3.2) '@nx/eslint-plugin': - specifier: 16.10.0 - version: 16.10.0(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(@typescript-eslint/parser@5.62.0)(eslint-config-prettier@8.10.0)(eslint@8.46.0)(nx@17.3.2)(typescript@5.4.5)(verdaccio@5.33.0) + specifier: ^17.3.2 + version: 17.3.2(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(@typescript-eslint/parser@5.62.0)(eslint-config-prettier@8.10.0)(eslint@8.46.0)(nx@17.3.2)(typescript@5.4.5)(verdaccio@5.33.0) '@nx/jest': - specifier: 16.10.0 - version: 16.10.0(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(nx@17.3.2)(ts-node@10.9.1)(typescript@5.4.5)(verdaccio@5.33.0) + specifier: ^17.3.2 + version: 17.3.2(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(nx@17.3.2)(ts-node@10.9.1)(typescript@5.4.5)(verdaccio@5.33.0) '@nx/js': - specifier: 16.10.0 - version: 16.10.0(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(nx@17.3.2)(typescript@5.4.5)(verdaccio@5.33.0) + specifier: ^17.3.2 + version: 17.3.2(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(nx@17.3.2)(typescript@5.4.5)(verdaccio@5.33.0) '@nx/linter': - specifier: 16.10.0 - version: 16.10.0(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(eslint@8.46.0)(nx@17.3.2)(verdaccio@5.33.0) + specifier: ^17.3.2 + version: 17.3.2(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(nx@17.3.2)(verdaccio@5.33.0) '@nx/workspace': - specifier: 16.10.0 - version: 16.10.0(@swc-node/register@1.10.9)(@swc/core@1.10.1) + specifier: ^17.3.2 + version: 17.3.2(@swc-node/register@1.10.9)(@swc/core@1.10.1) '@polkadot/api-base': specifier: ^10.9.1 version: 10.13.1 @@ -133,8 +133,8 @@ importers: specifier: '*' version: link:../chaindata '@litentry/parachain-api': - specifier: 0.9.20-next.10 - version: 0.9.20-next.10 + specifier: 0.9.21-next.3 + version: 0.9.21-next.3 '@litentry/sidechain-api': specifier: 0.9.20-next.8 version: 0.9.20-next.8 @@ -483,20 +483,6 @@ packages: - supports-color dev: true - /@babel/plugin-proposal-class-properties@7.18.6(@babel/core@7.26.0): - resolution: {integrity: sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ==} - engines: {node: '>=6.9.0'} - deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead. - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.26.0 - '@babel/helper-create-class-features-plugin': 7.25.9(@babel/core@7.26.0) - '@babel/helper-plugin-utils': 7.25.9 - transitivePeerDependencies: - - supports-color - dev: true - /@babel/plugin-proposal-decorators@7.25.9(@babel/core@7.26.0): resolution: {integrity: sha512-smkNLL/O1ezy9Nhy4CNosc4Va+1wo5w4gzSZeLe6y6dM4mmHfYOCPolXQPHQxonZCF+ZyebxN9vqOolkYrSn5g==} engines: {node: '>=6.9.0'} @@ -1835,14 +1821,14 @@ packages: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.0 - /@litentry/parachain-api@0.9.20-next.10: - resolution: {integrity: sha512-kf5a3V4AOyUerZNOM67Js3zNx4lPfqYGvNNQoPIknDKmJ2/QKEyo/DvS+5KYkZp3PV1Q3AJyeobkJm5g7gjwTg==} + /@litentry/parachain-api@0.9.21-next.3: + resolution: {integrity: sha512-6WY2k5wMI2Qp7XhtGuOJTlAqw3wrmVJCd/UAT8rGjk6eX/nJ41+UZ1yj5CQRa2n+TPo9DklxQ9z25HeSqqsu1Q==} dependencies: '@polkadot/api': 15.0.2 '@polkadot/api-augment': 15.0.2 '@polkadot/api-base': 15.0.2 '@polkadot/api-derive': 15.0.2 - '@polkadot/keyring': 12.6.2(@polkadot/util-crypto@12.6.2)(@polkadot/util@12.6.2) + '@polkadot/keyring': 13.2.3(@polkadot/util-crypto@13.2.3)(@polkadot/util@13.2.3) '@polkadot/rpc-core': 15.0.2 '@polkadot/types': 15.0.2 '@polkadot/types-augment': 15.0.2 @@ -1850,8 +1836,8 @@ packages: '@polkadot/types-create': 15.0.2 '@polkadot/types-known': 15.0.2 '@polkadot/types-support': 15.0.2 - '@polkadot/util': 12.6.2 - '@polkadot/util-crypto': 12.6.2(@polkadot/util@12.6.2) + '@polkadot/util': 13.2.3 + '@polkadot/util-crypto': 13.2.3(@polkadot/util@13.2.3) transitivePeerDependencies: - bufferutil - supports-color @@ -1934,10 +1920,10 @@ packages: fastq: 1.17.1 dev: true - /@nrwl/devkit@16.10.0(nx@17.3.2): - resolution: {integrity: sha512-fRloARtsDQoQgQ7HKEy0RJiusg/HSygnmg4gX/0n/Z+SUS+4KoZzvHjXc6T5ZdEiSjvLypJ+HBM8dQzIcVACPQ==} + /@nrwl/devkit@17.3.2(nx@17.3.2): + resolution: {integrity: sha512-31wh7dDZPM1YUCfhhk/ioHnUeoPIlKYLFLW0fGdw76Ow2nmTqrmxha2m0CSIR1/9En9GpYut2IdUdNh9CctNlA==} dependencies: - '@nx/devkit': 16.10.0(nx@17.3.2) + '@nx/devkit': 17.3.2(nx@17.3.2) transitivePeerDependencies: - nx dev: true @@ -1958,10 +1944,10 @@ packages: - nx dev: true - /@nrwl/eslint-plugin-nx@16.10.0(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(@typescript-eslint/parser@5.62.0)(eslint-config-prettier@8.10.0)(eslint@8.46.0)(nx@17.3.2)(typescript@5.4.5)(verdaccio@5.33.0): - resolution: {integrity: sha512-w8fHXEatdPHQeP/Yompsdrgz4BJ2BSVaaaulcovzTNJ9KrCCtDyTGY7sihU7qLVcbZtUVq9xoAsSeuTQuOCTDw==} + /@nrwl/eslint-plugin-nx@17.3.2(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(@typescript-eslint/parser@5.62.0)(eslint-config-prettier@8.10.0)(eslint@8.46.0)(nx@17.3.2)(typescript@5.4.5)(verdaccio@5.33.0): + resolution: {integrity: sha512-KfZtT+breRD7D8dy+YLIdKD7S9t4aqtEQLpRQCnJrCALYdqIRuql9rC2J69RUosozgrk55C0LERF0/kJVPe6Gg==} dependencies: - '@nx/eslint-plugin': 16.10.0(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(@typescript-eslint/parser@5.62.0)(eslint-config-prettier@8.10.0)(eslint@8.46.0)(nx@17.3.2)(typescript@5.4.5)(verdaccio@5.33.0) + '@nx/eslint-plugin': 17.3.2(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(@typescript-eslint/parser@5.62.0)(eslint-config-prettier@8.10.0)(eslint@8.46.0)(nx@17.3.2)(typescript@5.4.5)(verdaccio@5.33.0) transitivePeerDependencies: - '@babel/traverse' - '@swc-node/register' @@ -1978,10 +1964,10 @@ packages: - verdaccio dev: true - /@nrwl/jest@16.10.0(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(nx@17.3.2)(ts-node@10.9.1)(typescript@5.4.5)(verdaccio@5.33.0): - resolution: {integrity: sha512-hZuIK3xXh4HaE6/Ny8hGidjkJ4aLZjnQtPDxKD/423gznQe2FdHx3avoSlbOEOx5Oc6sJ9QGGZLcvckKQ5uWww==} + /@nrwl/jest@17.3.2(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(nx@17.3.2)(ts-node@10.9.1)(typescript@5.4.5)(verdaccio@5.33.0): + resolution: {integrity: sha512-sL7POaqrzHUBqKMOigmGsDin9hFtzL6orzSev0qOoTPCegRvMfyPpTbYdUsyN186jj0/ReD0b9lAiSOpfq3Q1g==} dependencies: - '@nx/jest': 16.10.0(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(nx@17.3.2)(ts-node@10.9.1)(typescript@5.4.5)(verdaccio@5.33.0) + '@nx/jest': 17.3.2(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(nx@17.3.2)(ts-node@10.9.1)(typescript@5.4.5)(verdaccio@5.33.0) transitivePeerDependencies: - '@babel/traverse' - '@swc-node/register' @@ -1998,10 +1984,10 @@ packages: - verdaccio dev: true - /@nrwl/js@16.10.0(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(nx@17.3.2)(typescript@5.1.6)(verdaccio@5.33.0): - resolution: {integrity: sha512-asybPpyPrxLLDWWdYzFqbgubLmDKLEhoMz8x9MPOm3CH8v2vlIE6hD0JT19GdJArBPxRB33nhjtu8wmJGz5czw==} + /@nrwl/js@17.3.2(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(nx@17.3.2)(typescript@5.3.3)(verdaccio@5.33.0): + resolution: {integrity: sha512-WuIeSErulJuMeSpeK41RfiWI3jLjDD0S+tLnYdOLaWdjaIPqjknClM2BAJKlq472NnkkNWvtwtOS8jm518OjOQ==} dependencies: - '@nx/js': 16.10.0(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(nx@17.3.2)(typescript@5.1.6)(verdaccio@5.33.0) + '@nx/js': 17.3.2(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(nx@17.3.2)(typescript@5.3.3)(verdaccio@5.33.0) transitivePeerDependencies: - '@babel/traverse' - '@swc-node/register' @@ -2015,10 +2001,10 @@ packages: - verdaccio dev: true - /@nrwl/js@16.10.0(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(nx@17.3.2)(typescript@5.4.5)(verdaccio@5.33.0): - resolution: {integrity: sha512-asybPpyPrxLLDWWdYzFqbgubLmDKLEhoMz8x9MPOm3CH8v2vlIE6hD0JT19GdJArBPxRB33nhjtu8wmJGz5czw==} + /@nrwl/js@17.3.2(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(nx@17.3.2)(typescript@5.4.5)(verdaccio@5.33.0): + resolution: {integrity: sha512-WuIeSErulJuMeSpeK41RfiWI3jLjDD0S+tLnYdOLaWdjaIPqjknClM2BAJKlq472NnkkNWvtwtOS8jm518OjOQ==} dependencies: - '@nx/js': 16.10.0(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(nx@17.3.2)(typescript@5.4.5)(verdaccio@5.33.0) + '@nx/js': 17.3.2(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(nx@17.3.2)(typescript@5.4.5)(verdaccio@5.33.0) transitivePeerDependencies: - '@babel/traverse' - '@swc-node/register' @@ -2049,35 +2035,6 @@ packages: - verdaccio dev: true - /@nrwl/linter@16.10.0(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(eslint@8.46.0)(nx@17.3.2)(verdaccio@5.33.0): - resolution: {integrity: sha512-XvMuTeIc2I3630iaqhlV4w3qgABQIo+kv8mT0DbT1HfjjZDm4ST8hrvkdWSf9mCl24vShNL8GDVQVNOX0bZY5A==} - dependencies: - '@nx/linter': 16.10.0(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(eslint@8.46.0)(nx@17.3.2)(verdaccio@5.33.0) - transitivePeerDependencies: - - '@babel/traverse' - - '@swc-node/register' - - '@swc/core' - - '@swc/wasm' - - '@types/node' - - debug - - eslint - - nx - - supports-color - - verdaccio - dev: true - - /@nrwl/tao@16.10.0(@swc-node/register@1.10.9)(@swc/core@1.10.1): - resolution: {integrity: sha512-QNAanpINbr+Pod6e1xNgFbzK1x5wmZl+jMocgiEFXZ67KHvmbD6MAQQr0MMz+GPhIu7EE4QCTLTyCEMlAG+K5Q==} - hasBin: true - dependencies: - nx: 16.10.0(@swc-node/register@1.10.9)(@swc/core@1.10.1) - tslib: 2.8.1 - transitivePeerDependencies: - - '@swc-node/register' - - '@swc/core' - - debug - dev: true - /@nrwl/tao@17.3.2(@swc-node/register@1.10.9)(@swc/core@1.10.1): resolution: {integrity: sha512-5uvpSmij0J9tteFV/0M/024K+H/o3XAlqtSdU8j03Auj1IleclSLF2yCTuIo7pYXhG3cgx1+nR+3nMs1QVAdUA==} hasBin: true @@ -2102,10 +2059,10 @@ packages: - debug dev: true - /@nrwl/workspace@16.10.0(@swc-node/register@1.10.9)(@swc/core@1.10.1): - resolution: {integrity: sha512-fZeNxhFs/2cm326NebfJIgSI3W4KZN94WGS46wlIBrUUGP5/vwHYsi09Kx6sG1kRkAuZVtgJ33uU2F6xcAWzUA==} + /@nrwl/workspace@17.3.2(@swc-node/register@1.10.9)(@swc/core@1.10.1): + resolution: {integrity: sha512-7xE/dujPjOIxsCV6TB0C4768voQaQSxmEUAbVz0mywBGrVpjpvAIx1GvdB6wwgWqtpZTz34hKFkUSJFPweUvbg==} dependencies: - '@nx/workspace': 16.10.0(@swc-node/register@1.10.9)(@swc/core@1.10.1) + '@nx/workspace': 17.3.2(@swc-node/register@1.10.9)(@swc/core@1.10.1) transitivePeerDependencies: - '@swc-node/register' - '@swc/core' @@ -2122,34 +2079,20 @@ packages: - debug dev: true - /@nx/devkit@16.10.0(nx@16.10.0): - resolution: {integrity: sha512-IvKQqRJFDDiaj33SPfGd3ckNHhHi6ceEoqCbAP4UuMXOPPVOX6H0KVk+9tknkPb48B7jWIw6/AgOeWkBxPRO5w==} - peerDependencies: - nx: '>= 15 <= 17' - dependencies: - '@nrwl/devkit': 16.10.0(nx@17.3.2) - ejs: 3.1.10 - enquirer: 2.3.6 - ignore: 5.3.2 - nx: 16.10.0(@swc-node/register@1.10.9)(@swc/core@1.10.1) - semver: 7.5.3 - tmp: 0.2.3 - tslib: 2.8.1 - dev: true - - /@nx/devkit@16.10.0(nx@17.3.2): - resolution: {integrity: sha512-IvKQqRJFDDiaj33SPfGd3ckNHhHi6ceEoqCbAP4UuMXOPPVOX6H0KVk+9tknkPb48B7jWIw6/AgOeWkBxPRO5w==} + /@nx/devkit@17.3.2(nx@17.3.2): + resolution: {integrity: sha512-gbOIhwrZKCSSFFbh6nE6LLCvAU7mhSdBSnRiS14YBwJJMu4CRJ0IcaFz58iXqGWZefMivKtkNFtx+zqwUC4ziw==} peerDependencies: - nx: '>= 15 <= 17' + nx: '>= 16 <= 18' dependencies: - '@nrwl/devkit': 16.10.0(nx@17.3.2) + '@nrwl/devkit': 17.3.2(nx@17.3.2) ejs: 3.1.10 enquirer: 2.3.6 ignore: 5.3.2 nx: 17.3.2(@swc-node/register@1.10.9)(@swc/core@1.10.1) - semver: 7.5.3 + semver: 7.6.3 tmp: 0.2.3 tslib: 2.8.1 + yargs-parser: 21.1.1 dev: true /@nx/devkit@19.8.4(nx@17.3.2): @@ -2186,26 +2129,26 @@ packages: yargs-parser: 21.1.1 dev: true - /@nx/eslint-plugin@16.10.0(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(@typescript-eslint/parser@5.62.0)(eslint-config-prettier@8.10.0)(eslint@8.46.0)(nx@17.3.2)(typescript@5.4.5)(verdaccio@5.33.0): - resolution: {integrity: sha512-fdOlCrSJK6HfCs+FVXUxzS5gobnGymTU85B3vXPYkVpJwKmq9voX7HBhx9euScRGgXdO9335DIixc/QV6zGpKA==} + /@nx/eslint-plugin@17.3.2(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(@typescript-eslint/parser@5.62.0)(eslint-config-prettier@8.10.0)(eslint@8.46.0)(nx@17.3.2)(typescript@5.4.5)(verdaccio@5.33.0): + resolution: {integrity: sha512-szNXnMr54SH3uQjsTgSb/ySomhbqF0nJnca1yoC7XJG8+jlQLTs8EiyqjdQ9CVo+KTxsb9ilDtAZXRNCHEyGlw==} peerDependencies: - '@typescript-eslint/parser': ^5.60.1 - eslint-config-prettier: ^8.1.0 + '@typescript-eslint/parser': ^6.13.2 + eslint-config-prettier: ^9.0.0 peerDependenciesMeta: eslint-config-prettier: optional: true dependencies: - '@nrwl/eslint-plugin-nx': 16.10.0(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(@typescript-eslint/parser@5.62.0)(eslint-config-prettier@8.10.0)(eslint@8.46.0)(nx@17.3.2)(typescript@5.4.5)(verdaccio@5.33.0) - '@nx/devkit': 16.10.0(nx@17.3.2) - '@nx/js': 16.10.0(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(nx@17.3.2)(typescript@5.4.5)(verdaccio@5.33.0) + '@nrwl/eslint-plugin-nx': 17.3.2(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(@typescript-eslint/parser@5.62.0)(eslint-config-prettier@8.10.0)(eslint@8.46.0)(nx@17.3.2)(typescript@5.4.5)(verdaccio@5.33.0) + '@nx/devkit': 17.3.2(nx@17.3.2) + '@nx/js': 17.3.2(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(nx@17.3.2)(typescript@5.4.5)(verdaccio@5.33.0) '@typescript-eslint/parser': 5.62.0(eslint@8.46.0)(typescript@5.4.5) - '@typescript-eslint/type-utils': 5.62.0(eslint@8.46.0)(typescript@5.4.5) - '@typescript-eslint/utils': 5.62.0(eslint@8.46.0)(typescript@5.4.5) + '@typescript-eslint/type-utils': 6.21.0(eslint@8.46.0)(typescript@5.4.5) + '@typescript-eslint/utils': 6.21.0(eslint@8.46.0)(typescript@5.4.5) chalk: 4.1.2 confusing-browser-globals: 1.0.11 eslint-config-prettier: 8.10.0(eslint@8.46.0) jsonc-eslint-parser: 2.4.0 - semver: 7.5.3 + semver: 7.6.3 tslib: 2.8.1 transitivePeerDependencies: - '@babel/traverse' @@ -2221,20 +2164,47 @@ packages: - verdaccio dev: true - /@nx/jest@16.10.0(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(nx@17.3.2)(ts-node@10.9.1)(typescript@5.4.5)(verdaccio@5.33.0): - resolution: {integrity: sha512-QseeLjDrl4c9q9Dd/057SXYqd47JVLhD2VQlQDraYwjsHz3lWkzlGaaHy0ZrVu8LSzY7lUUhJMPyYO3qo8wT6A==} + /@nx/eslint@17.3.2(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(nx@17.3.2)(verdaccio@5.33.0): + resolution: {integrity: sha512-KArvmi9Y4Qcf0bIRXGC1/FZsjL6XtT7wzhJ5uGsJIvXAJUiMMlw/KqIR31pY4nu2cBbphCa0/P1Jp2C/IFXG8w==} + peerDependencies: + js-yaml: 4.1.0 + peerDependenciesMeta: + js-yaml: + optional: true + dependencies: + '@nx/devkit': 17.3.2(nx@17.3.2) + '@nx/js': 17.3.2(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(nx@17.3.2)(typescript@5.3.3)(verdaccio@5.33.0) + '@nx/linter': 17.3.2(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(nx@17.3.2)(verdaccio@5.33.0) + eslint: 8.46.0 + tslib: 2.8.1 + typescript: 5.3.3 + transitivePeerDependencies: + - '@babel/traverse' + - '@swc-node/register' + - '@swc/core' + - '@swc/wasm' + - '@types/node' + - debug + - nx + - supports-color + - verdaccio + dev: true + + /@nx/jest@17.3.2(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(nx@17.3.2)(ts-node@10.9.1)(typescript@5.4.5)(verdaccio@5.33.0): + resolution: {integrity: sha512-koX4tsRe7eP6ZC/DsVz+WPlWrywAHG97HzwKuWd812BNAl4HC8NboYPz2EXLJyvoLafO7uznin4jR1EBBaUKBA==} dependencies: '@jest/reporters': 29.7.0 '@jest/test-result': 29.7.0 - '@nrwl/jest': 16.10.0(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(nx@17.3.2)(ts-node@10.9.1)(typescript@5.4.5)(verdaccio@5.33.0) - '@nx/devkit': 16.10.0(nx@17.3.2) - '@nx/js': 16.10.0(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(nx@17.3.2)(typescript@5.4.5)(verdaccio@5.33.0) + '@nrwl/jest': 17.3.2(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(nx@17.3.2)(ts-node@10.9.1)(typescript@5.4.5)(verdaccio@5.33.0) + '@nx/devkit': 17.3.2(nx@17.3.2) + '@nx/js': 17.3.2(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(nx@17.3.2)(typescript@5.4.5)(verdaccio@5.33.0) '@phenomnomnominal/tsquery': 5.0.1(typescript@5.4.5) chalk: 4.1.2 identity-obj-proxy: 3.0.0 jest-config: 29.7.0(@types/node@18.7.1)(ts-node@10.9.1) jest-resolve: 29.7.0 jest-util: 29.7.0 + minimatch: 9.0.3 resolve.exports: 1.1.0 tslib: 2.8.1 transitivePeerDependencies: @@ -2253,8 +2223,8 @@ packages: - verdaccio dev: true - /@nx/js@16.10.0(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(nx@17.3.2)(typescript@5.1.6)(verdaccio@5.33.0): - resolution: {integrity: sha512-27AH0/+XTMzOxVS6oV8Zl7/Rr1UDMYsnCVqoCU9CXp087uxcD4VnBOEjsEUlJKh1RdwGE3K0hBkk7NC1LP+vYQ==} + /@nx/js@17.3.2(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(nx@17.3.2)(typescript@5.3.3)(verdaccio@5.33.0): + resolution: {integrity: sha512-37E3OILyu/7rCj6Z7tvC6PktHYa51UQBU+wWPdVWSZ64xu1SUsg9B9dfiyD1LXR9/rhjg4+0+g4cou0aqDK1Wg==} peerDependencies: verdaccio: ^5.0.4 peerDependenciesMeta: @@ -2262,16 +2232,16 @@ packages: optional: true dependencies: '@babel/core': 7.26.0 - '@babel/plugin-proposal-class-properties': 7.18.6(@babel/core@7.26.0) '@babel/plugin-proposal-decorators': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-class-properties': 7.25.9(@babel/core@7.26.0) '@babel/plugin-transform-runtime': 7.25.9(@babel/core@7.26.0) '@babel/preset-env': 7.26.0(@babel/core@7.26.0) '@babel/preset-typescript': 7.26.0(@babel/core@7.26.0) '@babel/runtime': 7.26.0 - '@nrwl/js': 16.10.0(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(nx@17.3.2)(typescript@5.1.6)(verdaccio@5.33.0) - '@nx/devkit': 16.10.0(nx@17.3.2) - '@nx/workspace': 16.10.0(@swc-node/register@1.10.9)(@swc/core@1.10.1) - '@phenomnomnominal/tsquery': 5.0.1(typescript@5.1.6) + '@nrwl/js': 17.3.2(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(nx@17.3.2)(typescript@5.3.3)(verdaccio@5.33.0) + '@nx/devkit': 17.3.2(nx@17.3.2) + '@nx/workspace': 17.3.2(@swc-node/register@1.10.9)(@swc/core@1.10.1) + '@phenomnomnominal/tsquery': 5.0.1(typescript@5.3.3) babel-plugin-const-enum: 1.2.0(@babel/core@7.26.0) babel-plugin-macros: 2.8.0 babel-plugin-transform-typescript-metadata: 0.3.2(@babel/core@7.26.0) @@ -2282,13 +2252,13 @@ packages: fs-extra: 11.2.0 ignore: 5.3.2 js-tokens: 4.0.0 - minimatch: 3.0.5 + minimatch: 9.0.3 npm-package-arg: 11.0.1 npm-run-path: 4.0.1 ora: 5.3.0 - semver: 7.5.3 + semver: 7.6.3 source-map-support: 0.5.19 - ts-node: 10.9.1(@swc/core@1.10.1)(@types/node@18.7.1)(typescript@5.1.6) + ts-node: 10.9.1(@swc/core@1.10.1)(@types/node@18.7.1)(typescript@5.3.3) tsconfig-paths: 4.2.0 tslib: 2.8.1 verdaccio: 5.33.0(typanion@3.14.0) @@ -2304,8 +2274,8 @@ packages: - typescript dev: true - /@nx/js@16.10.0(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(nx@17.3.2)(typescript@5.4.5)(verdaccio@5.33.0): - resolution: {integrity: sha512-27AH0/+XTMzOxVS6oV8Zl7/Rr1UDMYsnCVqoCU9CXp087uxcD4VnBOEjsEUlJKh1RdwGE3K0hBkk7NC1LP+vYQ==} + /@nx/js@17.3.2(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(nx@17.3.2)(typescript@5.4.5)(verdaccio@5.33.0): + resolution: {integrity: sha512-37E3OILyu/7rCj6Z7tvC6PktHYa51UQBU+wWPdVWSZ64xu1SUsg9B9dfiyD1LXR9/rhjg4+0+g4cou0aqDK1Wg==} peerDependencies: verdaccio: ^5.0.4 peerDependenciesMeta: @@ -2313,15 +2283,15 @@ packages: optional: true dependencies: '@babel/core': 7.26.0 - '@babel/plugin-proposal-class-properties': 7.18.6(@babel/core@7.26.0) '@babel/plugin-proposal-decorators': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-class-properties': 7.25.9(@babel/core@7.26.0) '@babel/plugin-transform-runtime': 7.25.9(@babel/core@7.26.0) '@babel/preset-env': 7.26.0(@babel/core@7.26.0) '@babel/preset-typescript': 7.26.0(@babel/core@7.26.0) '@babel/runtime': 7.26.0 - '@nrwl/js': 16.10.0(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(nx@17.3.2)(typescript@5.4.5)(verdaccio@5.33.0) - '@nx/devkit': 16.10.0(nx@17.3.2) - '@nx/workspace': 16.10.0(@swc-node/register@1.10.9)(@swc/core@1.10.1) + '@nrwl/js': 17.3.2(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(nx@17.3.2)(typescript@5.4.5)(verdaccio@5.33.0) + '@nx/devkit': 17.3.2(nx@17.3.2) + '@nx/workspace': 17.3.2(@swc-node/register@1.10.9)(@swc/core@1.10.1) '@phenomnomnominal/tsquery': 5.0.1(typescript@5.4.5) babel-plugin-const-enum: 1.2.0(@babel/core@7.26.0) babel-plugin-macros: 2.8.0 @@ -2333,11 +2303,11 @@ packages: fs-extra: 11.2.0 ignore: 5.3.2 js-tokens: 4.0.0 - minimatch: 3.0.5 + minimatch: 9.0.3 npm-package-arg: 11.0.1 npm-run-path: 4.0.1 ora: 5.3.0 - semver: 7.5.3 + semver: 7.6.3 source-map-support: 0.5.19 ts-node: 10.9.1(@swc/core@1.10.1)(@types/node@18.7.1)(typescript@5.4.5) tsconfig-paths: 4.2.0 @@ -2406,22 +2376,10 @@ packages: - typescript dev: true - /@nx/linter@16.10.0(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(eslint@8.46.0)(nx@17.3.2)(verdaccio@5.33.0): - resolution: {integrity: sha512-G6XBfuMHNHoJDc4n2Gip4fsa9KssT91V5PF2Rd4hILkg4YU8B8mlmHN71stpzwbEyUJtyhyJc5SGgVLrSpRQew==} - peerDependencies: - eslint: ^8.0.0 - peerDependenciesMeta: - eslint: - optional: true + /@nx/linter@17.3.2(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(nx@17.3.2)(verdaccio@5.33.0): + resolution: {integrity: sha512-ruB72ODekAlqGI65IeO37vqgJIY+ROcx2Gyf12H3tZGUYeC1IwpPltbU63vD5Qkgj2znrD6aNkpYPV7C0b0scQ==} dependencies: - '@nrwl/linter': 16.10.0(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(eslint@8.46.0)(nx@17.3.2)(verdaccio@5.33.0) - '@nx/devkit': 16.10.0(nx@17.3.2) - '@nx/js': 16.10.0(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(nx@17.3.2)(typescript@5.1.6)(verdaccio@5.33.0) - '@phenomnomnominal/tsquery': 5.0.1(typescript@5.1.6) - eslint: 8.46.0 - tmp: 0.2.3 - tslib: 2.8.1 - typescript: 5.1.6 + '@nx/eslint': 17.3.2(@swc-node/register@1.10.9)(@swc/core@1.10.1)(@types/node@18.7.1)(nx@17.3.2)(verdaccio@5.33.0) transitivePeerDependencies: - '@babel/traverse' - '@swc-node/register' @@ -2429,20 +2387,12 @@ packages: - '@swc/wasm' - '@types/node' - debug + - js-yaml - nx - supports-color - verdaccio dev: true - /@nx/nx-darwin-arm64@16.10.0: - resolution: {integrity: sha512-YF+MIpeuwFkyvM5OwgY/rTNRpgVAI/YiR0yTYCZR+X3AAvP775IVlusNgQ3oedTBRUzyRnI4Tknj1WniENFsvQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - /@nx/nx-darwin-arm64@17.3.2: resolution: {integrity: sha512-hn12o/tt26Pf4wG+8rIBgNIEZq5BFlHLv3scNrgKbd5SancHlTbY4RveRGct737UQ/78GCMCgMDRgNdagbCr6w==} engines: {node: '>= 10'} @@ -2461,15 +2411,6 @@ packages: dev: true optional: true - /@nx/nx-darwin-x64@16.10.0: - resolution: {integrity: sha512-ypi6YxwXgb0kg2ixKXE3pwf5myVNUgWf1CsV5OzVccCM8NzheMO51KDXTDmEpXdzUsfT0AkO1sk5GZeCjhVONg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - /@nx/nx-darwin-x64@17.3.2: resolution: {integrity: sha512-5F28wrfE7yU60MzEXGjndy1sPJmNMIaV2W/g82kTXzxAbGHgSjwrGFmrJsrexzLp9oDlWkbc6YmInKV8gmmIaQ==} engines: {node: '>= 10'} @@ -2488,15 +2429,6 @@ packages: dev: true optional: true - /@nx/nx-freebsd-x64@16.10.0: - resolution: {integrity: sha512-UeEYFDmdbbDkTQamqvtU8ibgu5jQLgFF1ruNb/U4Ywvwutw2d4ruOMl2e0u9hiNja9NFFAnDbvzrDcMo7jYqYw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - requiresBuild: true - dev: true - optional: true - /@nx/nx-freebsd-x64@17.3.2: resolution: {integrity: sha512-07MMTfsJooONqL1Vrm5L6qk/gzmSrYLazjkiTmJz+9mrAM61RdfSYfO3mSyAoyfgWuQ5yEvfI56P036mK8aoPg==} engines: {node: '>= 10'} @@ -2515,15 +2447,6 @@ packages: dev: true optional: true - /@nx/nx-linux-arm-gnueabihf@16.10.0: - resolution: {integrity: sha512-WV3XUC2DB6/+bz1sx+d1Ai9q2Cdr+kTZRN50SOkfmZUQyEBaF6DRYpx/a4ahhxH3ktpNfyY8Maa9OEYxGCBkQA==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@nx/nx-linux-arm-gnueabihf@17.3.2: resolution: {integrity: sha512-gQxMF6U/h18Rz+FZu50DZCtfOdk27hHghNh3d3YTeVsrJTd1SmUQbYublmwU/ia1HhFS8RVI8GvkaKt5ph0HoA==} engines: {node: '>= 10'} @@ -2542,15 +2465,6 @@ packages: dev: true optional: true - /@nx/nx-linux-arm64-gnu@16.10.0: - resolution: {integrity: sha512-aWIkOUw995V3ItfpAi5FuxQ+1e9EWLS1cjWM1jmeuo+5WtaKToJn5itgQOkvSlPz+HSLgM3VfXMvOFALNk125g==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@nx/nx-linux-arm64-gnu@17.3.2: resolution: {integrity: sha512-X20wiXtXmKlC01bpVEREsRls1uVOM22xDTpqILvVty6+P+ytEYFR3Vs5EjDtzBKF51wjrwf03rEoToZbmgM8MA==} engines: {node: '>= 10'} @@ -2569,15 +2483,6 @@ packages: dev: true optional: true - /@nx/nx-linux-arm64-musl@16.10.0: - resolution: {integrity: sha512-uO6Gg+irqpVcCKMcEPIQcTFZ+tDI02AZkqkP7koQAjniLEappd8DnUBSQdcn53T086pHpdc264X/ZEpXFfrKWQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@nx/nx-linux-arm64-musl@17.3.2: resolution: {integrity: sha512-yko3Xsezkn4tjeudZYLjxFl07X/YB84K+DLK7EFyh9elRWV/8VjFcQmBAKUS2r9LfaEMNXq8/vhWMOWYyWBrIA==} engines: {node: '>= 10'} @@ -2596,15 +2501,6 @@ packages: dev: true optional: true - /@nx/nx-linux-x64-gnu@16.10.0: - resolution: {integrity: sha512-134PW/u/arNFAQKpqMJniC7irbChMPz+W+qtyKPAUXE0XFKPa7c1GtlI/wK2dvP9qJDZ6bKf0KtA0U/m2HMUOA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@nx/nx-linux-x64-gnu@17.3.2: resolution: {integrity: sha512-RiPvvQMmlZmDu9HdT6n6sV0+fEkyAqR5VocrD5ZAzEzFIlh4dyVLripFR3+MD+QhIhXyPt/hpri1kq9sgs4wnw==} engines: {node: '>= 10'} @@ -2623,15 +2519,6 @@ packages: dev: true optional: true - /@nx/nx-linux-x64-musl@16.10.0: - resolution: {integrity: sha512-q8sINYLdIJxK/iUx9vRk5jWAWb/2O0PAbOJFwv4qkxBv4rLoN7y+otgCZ5v0xfx/zztFgk/oNY4lg5xYjIso2Q==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@nx/nx-linux-x64-musl@17.3.2: resolution: {integrity: sha512-PWfVGmFsFJi+N1Nljg/jTKLHdufpGuHlxyfHqhDso/o4Qc0exZKSeZ1C63WkD7eTcT5kInifTQ/PffLiIDE3MA==} engines: {node: '>= 10'} @@ -2650,15 +2537,6 @@ packages: dev: true optional: true - /@nx/nx-win32-arm64-msvc@16.10.0: - resolution: {integrity: sha512-moJkL9kcqxUdJSRpG7dET3UeLIciwrfP08mzBQ12ewo8K8FzxU8ZUsTIVVdNrwt01CXOdXoweGfdQLjJ4qTURA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - requiresBuild: true - dev: true - optional: true - /@nx/nx-win32-arm64-msvc@17.3.2: resolution: {integrity: sha512-O+4FFPbQz1mqaIj+SVE02ppe7T9ELj7Z5soQct5TbRRhwjGaw5n5xaPPBW7jUuQe2L5htid1E82LJyq3JpVc8A==} engines: {node: '>= 10'} @@ -2677,15 +2555,6 @@ packages: dev: true optional: true - /@nx/nx-win32-x64-msvc@16.10.0: - resolution: {integrity: sha512-5iV2NKZnzxJwZZ4DM5JVbRG/nkhAbzEskKaLBB82PmYGKzaDHuMHP1lcPoD/rtYMlowZgNA/RQndfKvPBPwmXA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - requiresBuild: true - dev: true - optional: true - /@nx/nx-win32-x64-msvc@17.3.2: resolution: {integrity: sha512-4hQm+7coy+hBqGY9J709hz/tUPijhf/WS7eML2r2xBmqBew3PMHfeZuaAAYWN690nIsu0WX3wyDsNjulR8HGPQ==} engines: {node: '>= 10'} @@ -2704,16 +2573,14 @@ packages: dev: true optional: true - /@nx/workspace@16.10.0(@swc-node/register@1.10.9)(@swc/core@1.10.1): - resolution: {integrity: sha512-95Eq36bzq2hb095Zvg+Ru8o9oIeOE62tNGGpohBkZPKoK2CUTYEq0AZtdj1suXS82ukCFCyyZ/c/fwxL62HRZA==} + /@nx/workspace@17.3.2(@swc-node/register@1.10.9)(@swc/core@1.10.1): + resolution: {integrity: sha512-2y952OmJx+0Rj+LQIxat8SLADjIkgB6NvjtgYZt8uRQ94jRS/JsRvGTw0V8DsY9mvsNbYoIRdJP25T3pGnI3gQ==} dependencies: - '@nrwl/workspace': 16.10.0(@swc-node/register@1.10.9)(@swc/core@1.10.1) - '@nx/devkit': 16.10.0(nx@16.10.0) + '@nrwl/workspace': 17.3.2(@swc-node/register@1.10.9)(@swc/core@1.10.1) + '@nx/devkit': 17.3.2(nx@17.3.2) chalk: 4.1.2 enquirer: 2.3.6 - ignore: 5.3.2 - nx: 16.10.0(@swc-node/register@1.10.9)(@swc/core@1.10.1) - rxjs: 7.8.1 + nx: 17.3.2(@swc-node/register@1.10.9)(@swc/core@1.10.1) tslib: 2.8.1 yargs-parser: 21.1.1 transitivePeerDependencies: @@ -2828,22 +2695,13 @@ packages: dev: true optional: true - /@parcel/watcher@2.0.4: - resolution: {integrity: sha512-cTDi+FUDBIUOBKEtj+nhiJ71AZVlkAsQFuGQTun5tV9mwQBQgZvhCzG+URPQc8myeN32yRVZEfVAPCs1RW+Jvg==} - engines: {node: '>= 10.0.0'} - requiresBuild: true - dependencies: - node-addon-api: 3.2.1 - node-gyp-build: 4.8.4 - dev: true - - /@phenomnomnominal/tsquery@5.0.1(typescript@5.1.6): + /@phenomnomnominal/tsquery@5.0.1(typescript@5.3.3): resolution: {integrity: sha512-3nVv+e2FQwsW8Aw6qTU6f+1rfcJ3hrcnvH/mu9i8YhxO+9sqbOfpL8m6PbET5+xKOlz/VSbp0RoYWYCtIsnmuA==} peerDependencies: typescript: ^3 || ^4 || ^5 dependencies: esquery: 1.6.0 - typescript: 5.1.6 + typescript: 5.3.3 dev: true /@phenomnomnominal/tsquery@5.0.1(typescript@5.4.5): @@ -4106,6 +3964,14 @@ packages: '@typescript-eslint/visitor-keys': 5.62.0 dev: true + /@typescript-eslint/scope-manager@6.21.0: + resolution: {integrity: sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==} + engines: {node: ^16.0.0 || >=18.0.0} + dependencies: + '@typescript-eslint/types': 6.21.0 + '@typescript-eslint/visitor-keys': 6.21.0 + dev: true + /@typescript-eslint/type-utils@5.62.0(eslint@8.46.0)(typescript@5.4.5): resolution: {integrity: sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -4126,11 +3992,36 @@ packages: - supports-color dev: true + /@typescript-eslint/type-utils@6.21.0(eslint@8.46.0)(typescript@5.4.5): + resolution: {integrity: sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.4.5) + '@typescript-eslint/utils': 6.21.0(eslint@8.46.0)(typescript@5.4.5) + debug: 4.4.0 + eslint: 8.46.0 + ts-api-utils: 1.4.3(typescript@5.4.5) + typescript: 5.4.5 + transitivePeerDependencies: + - supports-color + dev: true + /@typescript-eslint/types@5.62.0: resolution: {integrity: sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true + /@typescript-eslint/types@6.21.0: + resolution: {integrity: sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==} + engines: {node: ^16.0.0 || >=18.0.0} + dev: true + /@typescript-eslint/typescript-estree@5.62.0(typescript@5.4.5): resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -4152,6 +4043,28 @@ packages: - supports-color dev: true + /@typescript-eslint/typescript-estree@6.21.0(typescript@5.4.5): + resolution: {integrity: sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/types': 6.21.0 + '@typescript-eslint/visitor-keys': 6.21.0 + debug: 4.4.0 + globby: 11.1.0 + is-glob: 4.0.3 + minimatch: 9.0.3 + semver: 7.6.3 + ts-api-utils: 1.4.3(typescript@5.4.5) + typescript: 5.4.5 + transitivePeerDependencies: + - supports-color + dev: true + /@typescript-eslint/utils@5.62.0(eslint@8.46.0)(typescript@5.4.5): resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -4172,6 +4085,25 @@ packages: - typescript dev: true + /@typescript-eslint/utils@6.21.0(eslint@8.46.0)(typescript@5.4.5): + resolution: {integrity: sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 + dependencies: + '@eslint-community/eslint-utils': 4.4.1(eslint@8.46.0) + '@types/json-schema': 7.0.15 + '@types/semver': 7.5.8 + '@typescript-eslint/scope-manager': 6.21.0 + '@typescript-eslint/types': 6.21.0 + '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.4.5) + eslint: 8.46.0 + semver: 7.6.3 + transitivePeerDependencies: + - supports-color + - typescript + dev: true + /@typescript-eslint/visitor-keys@5.62.0: resolution: {integrity: sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -4180,6 +4112,14 @@ packages: eslint-visitor-keys: 3.4.3 dev: true + /@typescript-eslint/visitor-keys@6.21.0: + resolution: {integrity: sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==} + engines: {node: ^16.0.0 || >=18.0.0} + dependencies: + '@typescript-eslint/types': 6.21.0 + eslint-visitor-keys: 3.4.3 + dev: true + /@verdaccio/auth@8.0.0-next-8.1: resolution: {integrity: sha512-sPmHdnYuRSMgABCsTJEfz8tb/smONsWVg0g4KK2QycyYZ/A+RwZLV1JLiQb4wzu9zvS0HSloqWqkWlyNHW3mtw==} engines: {node: '>=18'} @@ -6016,18 +5956,6 @@ packages: path-is-absolute: 1.0.1 dev: true - /glob@7.1.4: - resolution: {integrity: sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==} - deprecated: Glob versions prior to v9 are no longer supported - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.0.5 - once: 1.4.0 - path-is-absolute: 1.0.1 - dev: true - /glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} deprecated: Glob versions prior to v9 are no longer supported @@ -6895,7 +6823,7 @@ packages: acorn: 8.14.0 eslint-visitor-keys: 3.4.3 espree: 9.6.1 - semver: 7.5.3 + semver: 7.6.3 dev: true /jsonc-parser@3.2.0: @@ -7096,13 +7024,6 @@ packages: yallist: 3.1.1 dev: true - /lru-cache@6.0.0: - resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} - engines: {node: '>=10'} - dependencies: - yallist: 4.0.0 - dev: true - /lru-cache@7.18.3: resolution: {integrity: sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==} engines: {node: '>=12'} @@ -7210,12 +7131,6 @@ packages: engines: {node: '>=6'} dev: true - /minimatch@3.0.5: - resolution: {integrity: sha512-tUpxzX0VAzJHjLu0xUfFv1gwVp9ba3IOuRAVH2EGuRW8a5emA2FlACLqiT/lDVtS1W+TGNwqz3sWaNyLgDJWuw==} - dependencies: - brace-expansion: 1.1.11 - dev: true - /minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} dependencies: @@ -7328,10 +7243,6 @@ packages: transitivePeerDependencies: - supports-color - /node-addon-api@3.2.1: - resolution: {integrity: sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==} - dev: true - /node-domexception@1.0.0: resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==} engines: {node: '>=10.5.0'} @@ -7356,11 +7267,6 @@ packages: fetch-blob: 3.2.0 formdata-polyfill: 4.0.10 - /node-gyp-build@4.8.4: - resolution: {integrity: sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==} - hasBin: true - dev: true - /node-int64@0.4.0: resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==} dev: true @@ -7384,7 +7290,7 @@ packages: dependencies: hosted-git-info: 7.0.2 proc-log: 3.0.0 - semver: 7.5.3 + semver: 7.6.3 validate-npm-package-name: 5.0.1 dev: true @@ -7395,72 +7301,6 @@ packages: path-key: 3.1.1 dev: true - /nx@16.10.0(@swc-node/register@1.10.9)(@swc/core@1.10.1): - resolution: {integrity: sha512-gZl4iCC0Hx0Qe1VWmO4Bkeul2nttuXdPpfnlcDKSACGu3ZIo+uySqwOF8yBAxSTIf8xe2JRhgzJN1aFkuezEBg==} - hasBin: true - requiresBuild: true - peerDependencies: - '@swc-node/register': ^1.6.7 - '@swc/core': ^1.3.85 - peerDependenciesMeta: - '@swc-node/register': - optional: true - '@swc/core': - optional: true - dependencies: - '@nrwl/tao': 16.10.0(@swc-node/register@1.10.9)(@swc/core@1.10.1) - '@parcel/watcher': 2.0.4 - '@swc-node/register': 1.10.9(@swc/core@1.10.1)(@swc/types@0.1.17)(typescript@5.4.5) - '@swc/core': 1.10.1 - '@yarnpkg/lockfile': 1.1.0 - '@yarnpkg/parsers': 3.0.0-rc.46 - '@zkochan/js-yaml': 0.0.6 - axios: 1.7.9 - chalk: 4.1.2 - cli-cursor: 3.1.0 - cli-spinners: 2.6.1 - cliui: 8.0.1 - dotenv: 16.3.2 - dotenv-expand: 10.0.0 - enquirer: 2.3.6 - figures: 3.2.0 - flat: 5.0.2 - fs-extra: 11.2.0 - glob: 7.1.4 - ignore: 5.3.2 - jest-diff: 29.7.0 - js-yaml: 4.1.0 - jsonc-parser: 3.2.0 - lines-and-columns: 2.0.4 - minimatch: 3.0.5 - node-machine-id: 1.1.12 - npm-run-path: 4.0.1 - open: 8.4.2 - semver: 7.5.3 - string-width: 4.2.3 - strong-log-transformer: 2.1.0 - tar-stream: 2.2.0 - tmp: 0.2.3 - tsconfig-paths: 4.2.0 - tslib: 2.8.1 - v8-compile-cache: 2.3.0 - yargs: 17.7.2 - yargs-parser: 21.1.1 - optionalDependencies: - '@nx/nx-darwin-arm64': 16.10.0 - '@nx/nx-darwin-x64': 16.10.0 - '@nx/nx-freebsd-x64': 16.10.0 - '@nx/nx-linux-arm-gnueabihf': 16.10.0 - '@nx/nx-linux-arm64-gnu': 16.10.0 - '@nx/nx-linux-arm64-musl': 16.10.0 - '@nx/nx-linux-x64-gnu': 16.10.0 - '@nx/nx-linux-x64-musl': 16.10.0 - '@nx/nx-win32-arm64-msvc': 16.10.0 - '@nx/nx-win32-x64-msvc': 16.10.0 - transitivePeerDependencies: - - debug - dev: true - /nx@17.3.2(@swc-node/register@1.10.9)(@swc/core@1.10.1): resolution: {integrity: sha512-QjF1gnwKebQISvATrSbW7dsmIcLbA0fcyDyxLo5wVHx/MIlcaIb/lLYaPTld73ZZ6svHEZ6n2gOkhMitmkIPQA==} hasBin: true @@ -8197,14 +8037,6 @@ packages: hasBin: true dev: true - /semver@7.5.3: - resolution: {integrity: sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==} - engines: {node: '>=10'} - hasBin: true - dependencies: - lru-cache: 6.0.0 - dev: true - /semver@7.6.3: resolution: {integrity: sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==} engines: {node: '>=10'} @@ -8632,6 +8464,15 @@ packages: resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} dev: true + /ts-api-utils@1.4.3(typescript@5.4.5): + resolution: {integrity: sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==} + engines: {node: '>=16'} + peerDependencies: + typescript: '>=4.2.0' + dependencies: + typescript: 5.4.5 + dev: true + /ts-jest@29.2.5(@babel/core@7.26.0)(jest@29.7.0)(typescript@5.4.5): resolution: {integrity: sha512-KD8zB2aAZrcKIdGk4OwpJggeLcH1FgrICqDSROWqlnJXGCXK4Mn6FcdK2B6670Xr73lHMG1kHw8R87A0ecZ+vA==} engines: {node: ^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0} @@ -8670,7 +8511,7 @@ packages: yargs-parser: 21.1.1 dev: true - /ts-node@10.9.1(@swc/core@1.10.1)(@types/node@18.7.1)(typescript@5.1.6): + /ts-node@10.9.1(@swc/core@1.10.1)(@types/node@18.7.1)(typescript@5.3.3): resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -8697,7 +8538,7 @@ packages: create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 5.1.6 + typescript: 5.3.3 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 dev: true @@ -8826,8 +8667,8 @@ packages: typescript: 5.4.5 dev: true - /typescript@5.1.6: - resolution: {integrity: sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==} + /typescript@5.3.3: + resolution: {integrity: sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==} engines: {node: '>=14.17'} hasBin: true dev: true @@ -8916,10 +8757,6 @@ packages: /v8-compile-cache-lib@3.0.1: resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} - /v8-compile-cache@2.3.0: - resolution: {integrity: sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==} - dev: true - /v8-to-istanbul@9.3.0: resolution: {integrity: sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==} engines: {node: '>=10.12.0'} @@ -9131,10 +8968,6 @@ packages: resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} dev: true - /yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - dev: true - /yaml@1.10.2: resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==} engines: {node: '>= 6'} diff --git a/tee-worker/identity/litentry/core/native-task/receiver/src/trusted_call_authenticated.rs b/tee-worker/identity/litentry/core/native-task/receiver/src/trusted_call_authenticated.rs index fed9633388..07b1bdd5d8 100644 --- a/tee-worker/identity/litentry/core/native-task/receiver/src/trusted_call_authenticated.rs +++ b/tee-worker/identity/litentry/core/native-task/receiver/src/trusted_call_authenticated.rs @@ -32,8 +32,8 @@ pub type VerificationCode = String; pub enum TCAuthentication { Web3(LitentryMultiSignature), Email(VerificationCode), - OAuth2(OAuth2Data), AuthToken(String), + OAuth2(OAuth2Data), } impl From for OmniAccountAuthType {