Skip to content

Commit

Permalink
Creating client-api type definitions for the omni executor (#3251)
Browse files Browse the repository at this point in the history
  • Loading branch information
silva-fj authored Feb 7, 2025
1 parent 4d8ee7a commit 84b66fb
Show file tree
Hide file tree
Showing 44 changed files with 150 additions and 51 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions tee-worker/client-api/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"type": "module",
"license": "ISC",
"scripts": {
"update": "pnpm --filter parachain-api run update-metadata && pnpm --filter sidechain-api run update-metadata",
"build": "pnpm --filter parachain-api run build && pnpm --filter sidechain-api run build",
"update-build": "pnpm run update && pnpm run build",
"format": "pnpm run --recursive format",
"check-format": "pnpm run --recursive check-format",
"clean": "pnpm --filter parachain-api run clean && pnpm --filter sidechain-api run clean"
},
"packageManager": "[email protected]"
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ export { default as vc } from "./vc/definitions";
export { default as omniAccount } from "./omniAccount/definitions";
export { default as trusted_operations } from "./trusted_operations/definitions";
export { default as sidechain } from "./sidechain/definitions";
export { default as omniExecutor } from "./omniExecutor/definitions";
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ export default {
Private: "(Bytes,H256)",
},
},

OmniAccountPermission: {
_enum: ["All", "AccountManagement", "RequestNativeIntent", "RequestEthereumIntent", "RequestSolanaIntent"],
},
AuthOptions: {
expires_at: "u32",
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
export default {
types: {
OmniAesRequest: {
mrenclave: "MrEnclave",
key: "Vec<u8>",
payload: "AesOutput",
},
PlainRequest: {
mrenclave: "MrEnclave",
payload: "Vec<u8>",
},
MrEnclave: "H256",
NativeCall: {
_enum: {
request_intent: "(LitentryIdentity, Intent)",
create_account_store: "(LitentryIdentity)",
add_account: "(LitentryIdentity, LitentryIdentity, LitentryValidationData, bool, Option<Vec<OmniAccountPermission>>)",
remove_accounts: "(LitentryIdentity, Vec<LitentryIdentity>)",
publicize_account: "(LitentryIdentity, LitentryIdentity)",
set_permissions: "(LitentryIdentity, LitentryIdentity, Vec<OmniAccountPermission>)",
},
},
NativeCallAuthenticated: {
call: "NativeCall",
nonce: "Index",
authentication: "Authentication",
},
Authentication: {
_enum: {
Web3: "(LitentryMultiSignature)",
Email: "(Text)",
AuthToken: "(Text)",
OAuth2: "(OAuth2Data)",
},
},
OAuth2Data: {
provider: "OAuth2Provider",
code: "Text",
state: "Text",
redirect_uri: "Text",
},
OAuth2Provider: {
_enum: ["Google"],
},
NativeCallResponse: "Result<NativeCallOk, NativeCallError>",
NativeCallOk: {
_enum: {
AuthToken: "(Text)",
ExtrinsicReport: "(XtReport)",
},
},
XtReport: {
// Hash of the extrinsic.
extrinsic_hash: "H256",
// Block hash of the block the extrinsic was included in.
// Only available if watched until at least `InBlock`.
block_hash: "Option<H256>",
// Last known Transaction Status.
status: "TxStatus",
},
TxStatus: {
// Transaction is part of the future queue.
Future: "Null",
// Transaction is part of the ready queue.
Ready: "Null",
// The transaction has been broadcast to the given peers.
Broadcast: "Vec<Text>",
// Transaction has been included in block with given hash.
InBlock: "H256",
// The block this transaction was included in has been retracted.
Retracted: "H256",
// Maximum number of finality watchers has been reached,
// old watchers are being removed.
FinalityTimeout: "H256",
// Transaction has been finalized by a finality-gadget, e.g GRANDPA
Finalized: "H256",
// Transaction has been replaced in the pool, by another transaction
// that provides the same tags. (e.g. same (sender, nonce)).
Usurped: "H256",
// Transaction has been dropped from the pool because of the limit.
Dropped: "Null",
// Transaction is no longer valid in the current state.
Invalid: "Null",
},
NativeCallError: {
_enum: {
UnexpectedCall: "(Text)",
UnauthorizedSender: "Null",
AuthTokenCreationFailed: "Null",
InternalError: "Null",
IInvalidMemberIdentity: "Null",
ValidationDataVerificationFailed: "Null",
},
},
},
};
File renamed without changes.
1 change: 1 addition & 0 deletions tee-worker/client-api/pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
packages: ["parachain-api", "sidechain-api"]
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"version": "0.9.21-next.0",
"scripts": {
"clean": "rm -rf dist build node_modules",
"update-metadata": "../../bin/litentry-cli print-sgx-metadata-raw > prepare-build/litentry-sidechain-metadata.json",
"update-metadata": "../../identity/bin/litentry-cli print-sgx-metadata-raw > prepare-build/litentry-sidechain-metadata.json",
"prepare-dir": "mkdir -p build && cp -rf prepare-build/* build",
"generate-from-defs": "pnpm exec node --experimental-specifier-resolution=node --loader ts-node/esm node_modules/@polkadot/typegen/scripts/polkadot-types-from-defs.mjs --package sidechain-api/interfaces --input build/interfaces --endpoint build/litentry-sidechain-metadata.json",
"generate-from-chain": "pnpm exec node --experimental-specifier-resolution=node --loader ts-node/esm node_modules/@polkadot/typegen/scripts/polkadot-types-from-chain.mjs --package sidechain-api/interfaces --output build/interfaces --endpoint build/litentry-sidechain-metadata.json --strict",
Expand Down
13 changes: 0 additions & 13 deletions tee-worker/identity/client-api/package.json

This file was deleted.

1 change: 0 additions & 1 deletion tee-worker/identity/client-api/pnpm-workspace.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ services:
container_name: litentry-di-identity-test
volumes:
- ../ts-tests:/ts-tests
- ../client-api:/client-api
- ../../client-api:/client-api
- ../cli:/usr/local/worker-cli
build:
context: ..
context: ../..
dockerfile: build.Dockerfile
target: deployed-client
depends_on:
Expand Down
4 changes: 2 additions & 2 deletions tee-worker/identity/docker/lit-di-identity-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ services:
container_name: litentry-di-identity-test
volumes:
- ../ts-tests:/ts-tests
- ../client-api:/client-api
- ../../client-api:/client-api
- ../cli:/usr/local/worker-cli
build:
context: ..
context: ../../
dockerfile: build.Dockerfile
target: deployed-client
depends_on:
Expand Down
4 changes: 2 additions & 2 deletions tee-worker/identity/docker/lit-dr-vc-multiworker-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ services:
container_name: litentry-dr-vc-test
volumes:
- ../ts-tests:/ts-tests
- ../client-api:/client-api
- ../../client-api:/client-api
- ../cli:/usr/local/worker-cli
build:
context: ..
context: ../..
dockerfile: build.Dockerfile
target: deployed-client
depends_on:
Expand Down
4 changes: 2 additions & 2 deletions tee-worker/identity/docker/lit-dr-vc-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ services:
container_name: litentry-dr-vc-test
volumes:
- ../ts-tests:/ts-tests
- ../client-api:/client-api
- ../../client-api:/client-api
- ../cli:/usr/local/worker-cli
build:
context: ..
context: ../..
dockerfile: build.Dockerfile
target: deployed-client
depends_on:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ services:
container_name: lit-native-request-vc-multiworker-test
volumes:
- ../ts-tests:/ts-tests
- ../client-api:/client-api
- ../../client-api:/client-api
- ../cli:/usr/local/worker-cli
build:
context: ..
context: ../..
dockerfile: build.Dockerfile
target: deployed-client
depends_on:
Expand Down
4 changes: 2 additions & 2 deletions tee-worker/identity/docker/lit-native-request-vc-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ services:
container_name: litentry-native-request-vc-test
volumes:
- ../ts-tests:/ts-tests
- ../client-api:/client-api
- ../../client-api:/client-api
- ../cli:/usr/local/worker-cli
build:
context: ..
context: ../..
dockerfile: build.Dockerfile
target: deployed-client
depends_on:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ services:
container_name: lit-omni-account-multiworker-test
volumes:
- ../ts-tests:/ts-tests
- ../client-api:/client-api
- ../../client-api:/client-api
- ../cli:/usr/local/worker-cli
build:
context: ..
context: ../..
dockerfile: build.Dockerfile
target: deployed-client
depends_on:
Expand Down
4 changes: 2 additions & 2 deletions tee-worker/identity/docker/lit-omni-account-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ services:
container_name: litentry-omni-account-test
volumes:
- ../ts-tests:/ts-tests
- ../client-api:/client-api
- ../../client-api:/client-api
- ../cli:/usr/local/worker-cli
build:
context: ..
context: ../..
dockerfile: build.Dockerfile
target: deployed-client
depends_on:
Expand Down
4 changes: 2 additions & 2 deletions tee-worker/identity/docker/lit-resume-worker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ services:
container_name: litentry-worker
volumes:
- ../ts-tests:/ts-tests
- ../client-api:/client-api
- ../../client-api:/client-api
- ../cli:/usr/local/worker-cli
build:
context: ..
context: ../..
dockerfile: build.Dockerfile
target: deployed-worker
depends_on:
Expand Down
4 changes: 2 additions & 2 deletions tee-worker/identity/docker/lit-test-stress-script.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ services:
container_name: litentry-test-stress-script
volumes:
- ../ts-tests:/ts-tests
- ../client-api:/client-api
- ../../client-api:/client-api
- ../cli:/usr/local/worker-cli
build:
context: ..
context: ../..
dockerfile: build.Dockerfile
target: deployed-client
depends_on:
Expand Down
6 changes: 3 additions & 3 deletions tee-worker/identity/docker/lit-ts-api-package-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ services:
image: litentry/identity-cli:latest
container_name: litentry-lit-ts-api-package-build
volumes:
- ../client-api:/client-api
- ../../client-api:/client-api
- ../cli:/usr/local/worker-cli
build:
context: ..
context: ../..
dockerfile: build.Dockerfile
target: deployed-client
depends_on:
Expand All @@ -17,7 +17,7 @@ services:
condition: service_started
networks:
- litentry-test-network
entrypoint:
entrypoint:
"/usr/local/worker-cli/lit_ts_api_package_build.sh -p 9944 -u ws://litentry-node -W http://litentry-node -V ws://litentry-worker-1 -A 2011 -C /usr/local/bin/litentry-cli 2>&1"
restart: "no"
networks:
Expand Down
4 changes: 2 additions & 2 deletions tee-worker/identity/docker/lit-vc-correctness-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ services:
container_name: litentry-vc-correctness-test
volumes:
- ../ts-tests:/ts-tests
- ../client-api:/client-api
- ../../client-api:/client-api
- ../cli:/usr/local/worker-cli
build:
context: ..
context: ../..
dockerfile: build.Dockerfile
target: deployed-client
depends_on:
Expand Down
4 changes: 2 additions & 2 deletions tee-worker/identity/ts-tests/integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
"micro-base58": "^0.5.1",
"mocha": "^10.6.0",
"mocha-steps": "^1.3.0",
"parachain-api": "file:../../client-api/parachain-api",
"parachain-api": "file:../../../client-api/parachain-api",
"scale-ts": "^0.2.11",
"sidechain-api": "file:../../client-api/sidechain-api",
"sidechain-api": "file:../../../client-api/sidechain-api",
"tiny-secp256k1": "^2.2.3",
"tweetnacl": "^1.0.3",
"websocket-as-promised": "^2.0.1",
Expand Down
16 changes: 8 additions & 8 deletions tee-worker/identity/ts-tests/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 84b66fb

Please sign in to comment.