From 68109a95ae11f87ce2c625fda5dcaf6533a298da Mon Sep 17 00:00:00 2001 From: Tim Holmes-Mitra Date: Fri, 22 Nov 2024 11:21:17 +0000 Subject: [PATCH 1/8] feat(vms): update proto files to network v0.7.0-rc.55 --- .gitignore | 1 - .../proto/nillion/payments/v1/quote.proto | 3 ++ .../nillion/permissions/v1/permissions.proto | 4 ++- .../nillion/preprocessing/v1/element.proto | 3 +- .../nillion/preprocessing/v1/generate.proto | 16 +++++++++ .../nillion/preprocessing/v1/material.proto | 9 +++++ .../nillion/preprocessing/v1/service.proto | 13 +++++++- .../nillion/preprocessing/v1/stream.proto | 19 +++++++++++ .../nillion/preprocessing/v1/material_pb.ts | 33 +++++++++++++++++++ 9 files changed, 97 insertions(+), 4 deletions(-) create mode 100644 client-vms/proto/nillion/preprocessing/v1/material.proto create mode 100644 client-vms/src/gen-proto/nillion/preprocessing/v1/material_pb.ts diff --git a/.gitignore b/.gitignore index 95b7db42..3a1f9f2b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,6 @@ .vscode .husky -**/gen-proto node_modules dist **/coverage diff --git a/client-vms/proto/nillion/payments/v1/quote.proto b/client-vms/proto/nillion/payments/v1/quote.proto index 66f0b418..401f3e04 100644 --- a/client-vms/proto/nillion/payments/v1/quote.proto +++ b/client-vms/proto/nillion/payments/v1/quote.proto @@ -182,6 +182,9 @@ message StoreValues { // The size of the payload to be stored. uint64 ecdsa_private_key_shares_count = 6; + + // The size of the payload to be stored. + uint64 ecdsa_signature_shares_count = 7; } // An invoke compute operation. diff --git a/client-vms/proto/nillion/permissions/v1/permissions.proto b/client-vms/proto/nillion/permissions/v1/permissions.proto index 4688bff8..5c461c1a 100644 --- a/client-vms/proto/nillion/permissions/v1/permissions.proto +++ b/client-vms/proto/nillion/permissions/v1/permissions.proto @@ -19,7 +19,7 @@ message Permissions { repeated nillion.auth.v1.user.UserId delete = 4; // The list of compute permissions. - repeated ComputePermissions compute = 5; + repeated ComputePermissions compute = 5; } // The permissions to execute a program. @@ -30,3 +30,5 @@ message ComputePermissions { // The program ids this user is allowed to use the stored values in. repeated string program_ids = 2; } + + diff --git a/client-vms/proto/nillion/preprocessing/v1/element.proto b/client-vms/proto/nillion/preprocessing/v1/element.proto index bb316f2b..fa31228d 100644 --- a/client-vms/proto/nillion/preprocessing/v1/element.proto +++ b/client-vms/proto/nillion/preprocessing/v1/element.proto @@ -14,5 +14,6 @@ enum PreprocessingElement { MODULO = 7; TRUNC = 8; TRUNC_PR = 9; + RANDOM_INTEGER = 10; + RANDOM_BOOLEAN = 11; } - diff --git a/client-vms/proto/nillion/preprocessing/v1/generate.proto b/client-vms/proto/nillion/preprocessing/v1/generate.proto index 5869b5f4..427106a7 100644 --- a/client-vms/proto/nillion/preprocessing/v1/generate.proto +++ b/client-vms/proto/nillion/preprocessing/v1/generate.proto @@ -3,6 +3,7 @@ syntax = "proto3"; package nillion.preprocessing.v1.generate; import "nillion/preprocessing/v1/element.proto"; +import "nillion/preprocessing/v1/material.proto"; // A request to generate preprocessing material. message GeneratePreprocessingRequest { @@ -38,3 +39,18 @@ enum PreprocessingProtocolStatus { // The protocol finished with an error. FINISHED_FAILURE = 2; } + +/// A request to generate auxiliary material. +message GenerateAuxiliaryMaterialRequest { + /// An identifier for this generation instance. + bytes generation_id = 1; + + // The material we want to generate. + material.AuxiliaryMaterial material = 2; +} + +/// A response to a request to generate auxiliary material. +message GenerateAuxiliaryMaterialResponse { + // The status of the generation protocol. + PreprocessingProtocolStatus status = 1; +} diff --git a/client-vms/proto/nillion/preprocessing/v1/material.proto b/client-vms/proto/nillion/preprocessing/v1/material.proto new file mode 100644 index 00000000..a605a7e1 --- /dev/null +++ b/client-vms/proto/nillion/preprocessing/v1/material.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + +package nillion.preprocessing.v1.material; + +// Auxiliary cluster material. +enum AuxiliaryMaterial { + // ECDSA key generation auxiliary info as defined in the CGGMP21 paper. + CGGMP21_AUXILIARY_INFO = 0; +} diff --git a/client-vms/proto/nillion/preprocessing/v1/service.proto b/client-vms/proto/nillion/preprocessing/v1/service.proto index dee3c2fa..952071b4 100644 --- a/client-vms/proto/nillion/preprocessing/v1/service.proto +++ b/client-vms/proto/nillion/preprocessing/v1/service.proto @@ -10,13 +10,24 @@ import "nillion/preprocessing/v1/cleanup.proto"; // A service to run preprocessing related actions. service Preprocessing { // Trigger the generation of preprocessing material. + // + // Preprocessing material is used to speed up the online phase for certain operations in MPC programs. rpc GeneratePreprocessing(generate.GeneratePreprocessingRequest) returns (stream generate.GeneratePreprocessingResponse); + // Trigger the generation of auxiliary material. + // + // The distinction between preprocessing and auxiliary material is preprocessing is consumed when certain + // programs are ran while auxiliary material is generated once when the network starts for the first time and + // is never consumed unless there's a reason to regenerate it. + rpc GenerateAuxiliaryMaterial(generate.GenerateAuxiliaryMaterialRequest) returns (stream generate.GenerateAuxiliaryMaterialResponse); + // Open a stream to generate a preprocessing element. rpc StreamPreprocessing(stream stream.PreprocessingStreamMessage) returns (google.protobuf.Empty); + // Open a stream to generate auxiliary material. + rpc StreamAuxiliaryMaterial(stream stream.AuxiliaryMaterialStreamMessage) returns (google.protobuf.Empty); + // Cleanup used preprocessing chunks. rpc CleanupUsedElements(cleanup.CleanupUsedElementsRequest) returns (google.protobuf.Empty); } - diff --git a/client-vms/proto/nillion/preprocessing/v1/stream.proto b/client-vms/proto/nillion/preprocessing/v1/stream.proto index ce570fb7..30d947c7 100644 --- a/client-vms/proto/nillion/preprocessing/v1/stream.proto +++ b/client-vms/proto/nillion/preprocessing/v1/stream.proto @@ -3,6 +3,7 @@ syntax = "proto3"; package nillion.preprocessing.v1.stream; import "nillion/preprocessing/v1/element.proto"; +import "nillion/preprocessing/v1/material.proto"; // A message sent between nodes during the execution of a preprocessing protocol. message PreprocessingStreamMessage { @@ -22,3 +23,21 @@ message PreprocessingStreamMessage { bytes bincode_message = 3; } +// A message sent between nodes during the execution of a material generation protocol. +message AuxiliaryMaterialStreamMessage { + // An identifier for the instance of the generation being ran. + // + // Only the first ever message on the stream requires having this attribute set. Any subsequent message will + // have this field ignored. + bytes generation_id = 1; + + // The auxiliary material being generated. + // + // Only the first ever message on the stream requires having this attribute set. Any subsequent message will + // have this field ignored. + nillion.preprocessing.v1.material.AuxiliaryMaterial material = 2; + + // The message in bincode format. + bytes bincode_message = 3; +} + diff --git a/client-vms/src/gen-proto/nillion/preprocessing/v1/material_pb.ts b/client-vms/src/gen-proto/nillion/preprocessing/v1/material_pb.ts new file mode 100644 index 00000000..92d63313 --- /dev/null +++ b/client-vms/src/gen-proto/nillion/preprocessing/v1/material_pb.ts @@ -0,0 +1,33 @@ +// @generated by protoc-gen-es v2.2.2 with parameter "target=ts" +// @generated from file nillion/preprocessing/v1/material.proto (package nillion.preprocessing.v1.material, syntax proto3) +/* eslint-disable */ + +import type { GenEnum, GenFile } from "@bufbuild/protobuf/codegenv1"; +import { enumDesc, fileDesc } from "@bufbuild/protobuf/codegenv1"; + +/** + * Describes the file nillion/preprocessing/v1/material.proto. + */ +export const file_nillion_preprocessing_v1_material: GenFile = /*@__PURE__*/ + fileDesc("CiduaWxsaW9uL3ByZXByb2Nlc3NpbmcvdjEvbWF0ZXJpYWwucHJvdG8SIW5pbGxpb24ucHJlcHJvY2Vzc2luZy52MS5tYXRlcmlhbCovChFBdXhpbGlhcnlNYXRlcmlhbBIaChZDR0dNUDIxX0FVWElMSUFSWV9JTkZPEABC3gEKJWNvbS5uaWxsaW9uLnByZXByb2Nlc3NpbmcudjEubWF0ZXJpYWxCDU1hdGVyaWFsUHJvdG9QAaICBE5QVk2qAiFOaWxsaW9uLlByZXByb2Nlc3NpbmcuVjEuTWF0ZXJpYWzKAiFOaWxsaW9uXFByZXByb2Nlc3NpbmdcVjFcTWF0ZXJpYWziAi1OaWxsaW9uXFByZXByb2Nlc3NpbmdcVjFcTWF0ZXJpYWxcR1BCTWV0YWRhdGHqAiROaWxsaW9uOjpQcmVwcm9jZXNzaW5nOjpWMTo6TWF0ZXJpYWxiBnByb3RvMw"); + +/** + * Auxiliary cluster material. + * + * @generated from enum nillion.preprocessing.v1.material.AuxiliaryMaterial + */ +export enum AuxiliaryMaterial { + /** + * ECDSA key generation auxiliary info as defined in the CGGMP21 paper. + * + * @generated from enum value: CGGMP21_AUXILIARY_INFO = 0; + */ + CGGMP21_AUXILIARY_INFO = 0, +} + +/** + * Describes the enum nillion.preprocessing.v1.material.AuxiliaryMaterial. + */ +export const AuxiliaryMaterialSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_nillion_preprocessing_v1_material, 0); + From bd009b982ee9a9b88f661bf90d16547235ba332d Mon Sep 17 00:00:00 2001 From: Tim Holmes-Mitra Date: Fri, 22 Nov 2024 11:21:41 +0000 Subject: [PATCH 2/8] fix: correctly include types in published package --- .github/workflows/ci.yaml | 1 + client-react-hooks/README.md | 4 -- client-react-hooks/package.json | 13 +++-- .../src/use-nil-overwrite-permissions.ts | 2 +- client-react-hooks/tsconfig.build.json | 11 ++++ client-react-hooks/tsconfig.json | 22 ++++++-- client-vms/esbuild.config.d.mts | 1 + client-vms/package.json | 15 +++--- client-vms/src/auth.test.ts | 10 ++-- client-vms/src/auth.ts | 14 ++--- .../gen-proto/nillion/payments/v1/quote_pb.ts | 9 +++- .../nillion/preprocessing/v1/element_pb.ts | 12 ++++- .../nillion/preprocessing/v1/generate_pb.ts | 53 +++++++++++++++++- .../nillion/preprocessing/v1/service_pb.ts | 32 +++++++++-- .../nillion/preprocessing/v1/stream_pb.ts | 45 +++++++++++++++- client-vms/src/payment/builder.ts | 7 +-- client-vms/src/payment/client.ts | 16 +++--- client-vms/src/payment/grpc-compat.ts | 2 +- .../src/types/compute-permission-command.ts | 8 +-- client-vms/src/types/permission-command.ts | 4 +- client-vms/src/types/types.ts | 8 +-- client-vms/src/types/user-id.ts | 6 +-- client-vms/src/types/values-permissions.ts | 8 +-- client-vms/src/vm/builder.ts | 25 ++++----- client-vms/src/vm/client.ts | 4 +- client-vms/src/vm/operation/delete-values.ts | 22 ++++---- client-vms/src/vm/operation/invoke-compute.ts | 42 +++++++-------- .../src/vm/operation/overwrite-permissions.ts | 28 +++++----- .../src/vm/operation/query-pool-status.ts | 22 ++++---- .../vm/operation/retrieve-compute-result.ts | 24 ++++----- .../src/vm/operation/retrieve-permissions.ts | 28 +++++----- .../src/vm/operation/retrieve-values.ts | 28 +++++----- client-vms/src/vm/operation/retry-client.ts | 2 +- client-vms/src/vm/operation/store-program.ts | 34 ++++++------ client-vms/src/vm/operation/store-values.ts | 34 ++++++------ .../src/vm/operation/update-permissions.ts | 38 ++++++------- client-vms/tests/client.test.ts | 11 ++-- client-vms/tests/payments.test.ts | 12 ++--- client-vms/tests/retry.test.ts | 2 +- client-vms/tests/wasm.test.ts | 2 +- client-vms/tsconfig.build.json | 11 ++++ client-vms/tsconfig.json | 21 +++++--- examples-nextjs/tsconfig.json | 9 ++-- pnpm-lock.yaml | 54 ++++++++++++++----- 44 files changed, 469 insertions(+), 287 deletions(-) delete mode 100644 client-react-hooks/README.md create mode 100644 client-react-hooks/tsconfig.build.json create mode 100644 client-vms/esbuild.config.d.mts create mode 100644 client-vms/tsconfig.build.json diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 86c3df34..16e44ab4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -22,6 +22,7 @@ jobs: - run: pnpm exec biome format - run: pnpm exec biome lint - run: pnpm exec tsc -p client-vms/tsconfig.json + - run: pnpm exec tsc -p client-react-hooks/tsconfig.json test-client-vms: needs: check diff --git a/client-react-hooks/README.md b/client-react-hooks/README.md deleted file mode 100644 index 252df8d8..00000000 --- a/client-react-hooks/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# @nillion/client-react-hooks - -- [Source code](https://github.com/NillionNetwork/client-ts) -- [Reference Docs](https://nillion.pub/client-ts) diff --git a/client-react-hooks/package.json b/client-react-hooks/package.json index 02743a54..bd7759a3 100644 --- a/client-react-hooks/package.json +++ b/client-react-hooks/package.json @@ -11,14 +11,18 @@ "type": "module", "exports": { ".": { - "types": "./src/index.ts", + "types": "./dist/index.d.ts", "import": "./dist/index.mjs" } }, "scripts": { "typecheck": "tsc", - "build": "node esbuild.config.mjs", - "build:watch": "node esbuild.config.mjs --watch" + "test": "echo \"@nillion/client-react-hooks has no tests\"", + "clean": "rm -rf dist", + "build": "pnpm clean && node esbuild.config.mjs && tsc -p tsconfig.build.json", + "watch:esbuild": "node esbuild.config.mjs --watch", + "watch:types": "tsc -p tsconfig.build.json --watch", + "build:watch": "pnpm clean && pnpm watch:esbuild & pnpm watch:types" }, "dependencies": { "@nillion/client-vms": "workspace:^", @@ -29,12 +33,11 @@ "zod": "^3.23.8" }, "devDependencies": { - "@tsconfig/vite-react": "^3.0.2", "@types/debug": "^4.1.12", "@types/react": "^18.3.12", "@types/react-dom": "^18.3.1", "browserslist": "^4.24.2", "esbuild-plugin-browserslist": "^0.15.0" }, - "files": ["dist", "src"] + "files": ["dist"] } diff --git a/client-react-hooks/src/use-nil-overwrite-permissions.ts b/client-react-hooks/src/use-nil-overwrite-permissions.ts index c9d81304..59dc368d 100644 --- a/client-react-hooks/src/use-nil-overwrite-permissions.ts +++ b/client-react-hooks/src/use-nil-overwrite-permissions.ts @@ -1,4 +1,4 @@ -import type { Uuid, ValuesPermissions } from "@nillion/client-vms/types"; +import type { Uuid, ValuesPermissions } from "@nillion/client-vms"; import { useMutation } from "@tanstack/react-query"; import { nilHookBaseResult } from "./nil-hook-base"; import type { UseNilHook } from "./nil-hook-base"; diff --git a/client-react-hooks/tsconfig.build.json b/client-react-hooks/tsconfig.build.json new file mode 100644 index 00000000..b114781b --- /dev/null +++ b/client-react-hooks/tsconfig.build.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": false, + "emitDeclarationOnly": true, + "declaration": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": ["src/**/*"] +} diff --git a/client-react-hooks/tsconfig.json b/client-react-hooks/tsconfig.json index 326c602f..73e5c546 100644 --- a/client-react-hooks/tsconfig.json +++ b/client-react-hooks/tsconfig.json @@ -1,11 +1,23 @@ { - "extends": "@tsconfig/vite-react/tsconfig.json", "compilerOptions": { - "lib": ["ES2022", "DOM", "DOM.Iterable"], - "noUnusedLocals": false, - "baseUrl": ".", + "target": "es2022", + "lib": ["es2022", "dom", "DOM.Iterable"], + "module": "esnext", + + "noEmit": true, + "moduleResolution": "bundler", + "resolveJsonModule": true, + "isolatedModules": true, + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, + "jsx": "react-jsx", + + "skipLibCheck": true, + "strict": true, + + "baseUrl": "./src", "paths": { - "@nillion/client-vms/*": ["../client-vms/src/*"] + "#/*": ["/*"] } } } diff --git a/client-vms/esbuild.config.d.mts b/client-vms/esbuild.config.d.mts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/client-vms/esbuild.config.d.mts @@ -0,0 +1 @@ +export {}; diff --git a/client-vms/package.json b/client-vms/package.json index 60d85c5f..d2bb071b 100644 --- a/client-vms/package.json +++ b/client-vms/package.json @@ -7,16 +7,19 @@ "type": "module", "exports": { ".": { - "types": "./src/index.ts", + "types": "./dist/index.d.ts", "import": "./dist/index.mjs" } }, "scripts": { "typecheck": "tsc", - "build": "node esbuild.config.mjs", - "build:watch": "node esbuild.config.mjs --watch", - "build:proto": "npx buf generate", - "test": "vitest test" + "test": "vitest test", + "clean": "rm -rf dist", + "watch:esbuild": "node esbuild.config.mjs --watch", + "watch:types": "tsc -p tsconfig.build.json --watch", + "build": "pnpm clean && node esbuild.config.mjs && tsc -p tsconfig.build.json", + "build:watch": "pnpm clean && pnpm watch:esbuild & pnpm watch:types", + "build:proto": "npx buf generate" }, "dependencies": { "@bufbuild/protobuf": "^2.2.2", @@ -50,5 +53,5 @@ "vite-tsconfig-paths": "^5.1.2", "vitest": "^2.1.4" }, - "files": ["dist", "src"] + "files": ["dist"] } diff --git a/client-vms/src/auth.test.ts b/client-vms/src/auth.test.ts index 3132dddc..aac61ca9 100644 --- a/client-vms/src/auth.test.ts +++ b/client-vms/src/auth.test.ts @@ -1,13 +1,13 @@ import { create, fromBinary, toBinary } from "@bufbuild/protobuf"; import { timestampFromDate } from "@bufbuild/protobuf/wkt"; -import { TokenAuthManager } from "@nillion/client-vms/auth"; +import { describe, expect, it } from "vitest"; +import { TokenAuthManager } from "#/auth"; import { type SignedToken, TokenSchema, -} from "@nillion/client-vms/gen-proto/nillion/auth/v1/token_pb"; -import { NodeIdSchema } from "@nillion/client-vms/gen-proto/nillion/membership/v1/cluster_pb"; -import { PartyId } from "@nillion/client-vms/types/types"; -import { describe, expect, it } from "vitest"; +} from "#/gen-proto/nillion/auth/v1/token_pb"; +import { NodeIdSchema } from "#/gen-proto/nillion/membership/v1/cluster_pb"; +import { PartyId } from "#/types/types"; describe("TokenManager", () => { const manager = TokenAuthManager.fromSeed("test"); diff --git a/client-vms/src/auth.ts b/client-vms/src/auth.ts index 37499058..b3d7d782 100644 --- a/client-vms/src/auth.ts +++ b/client-vms/src/auth.ts @@ -1,22 +1,22 @@ import { create, fromBinary, toBinary } from "@bufbuild/protobuf"; import { timestampDate, timestampFromDate } from "@bufbuild/protobuf/wkt"; import type { Interceptor } from "@connectrpc/connect"; +import { secp256k1 } from "@noble/curves/secp256k1"; +import { sha256 } from "@noble/hashes/sha2"; +import { randomBytes } from "@noble/hashes/utils"; import { type PublicKey, PublicKeySchema, PublicKeyType, -} from "@nillion/client-vms/gen-proto/nillion/auth/v1/public_key_pb"; +} from "#/gen-proto/nillion/auth/v1/public_key_pb"; import { type SignedToken, SignedTokenSchema, type Token, TokenSchema, -} from "@nillion/client-vms/gen-proto/nillion/auth/v1/token_pb"; -import { NodeIdSchema } from "@nillion/client-vms/gen-proto/nillion/membership/v1/cluster_pb"; -import type { PartyId } from "@nillion/client-vms/types/types"; -import { secp256k1 } from "@noble/curves/secp256k1"; -import { sha256 } from "@noble/hashes/sha2"; -import { randomBytes } from "@noble/hashes/utils"; +} from "#/gen-proto/nillion/auth/v1/token_pb"; +import { NodeIdSchema } from "#/gen-proto/nillion/membership/v1/cluster_pb"; +import type { PartyId } from "#/types/types"; const HEADER_NAME_BASE64_AUTH = "x-nillion-token"; const NONCE_LENGTH = 32; diff --git a/client-vms/src/gen-proto/nillion/payments/v1/quote_pb.ts b/client-vms/src/gen-proto/nillion/payments/v1/quote_pb.ts index 4d232dcd..6e25ccbf 100644 --- a/client-vms/src/gen-proto/nillion/payments/v1/quote_pb.ts +++ b/client-vms/src/gen-proto/nillion/payments/v1/quote_pb.ts @@ -14,7 +14,7 @@ import type { Message } from "@bufbuild/protobuf"; * Describes the file nillion/payments/v1/quote.proto. */ export const file_nillion_payments_v1_quote: GenFile = /*@__PURE__*/ - fileDesc("Ch9uaWxsaW9uL3BheW1lbnRzL3YxL3F1b3RlLnByb3RvEhluaWxsaW9uLnBheW1lbnRzLnYxLnF1b3RlIskEChFQcmljZVF1b3RlUmVxdWVzdBItCgtwb29sX3N0YXR1cxgBIAEoCzIWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eUgAEkAKDXN0b3JlX3Byb2dyYW0YAiABKAsyJy5uaWxsaW9uLnBheW1lbnRzLnYxLnF1b3RlLlN0b3JlUHJvZ3JhbUgAEkQKD3JldHJpZXZlX3ZhbHVlcxgDIAEoCzIpLm5pbGxpb24ucGF5bWVudHMudjEucXVvdGUuUmV0cmlldmVWYWx1ZXNIABJOChRyZXRyaWV2ZV9wZXJtaXNzaW9ucxgEIAEoCzIuLm5pbGxpb24ucGF5bWVudHMudjEucXVvdGUuUmV0cmlldmVQZXJtaXNzaW9uc0gAEj4KDHN0b3JlX3ZhbHVlcxgFIAEoCzImLm5pbGxpb24ucGF5bWVudHMudjEucXVvdGUuU3RvcmVWYWx1ZXNIABJCCg5pbnZva2VfY29tcHV0ZRgGIAEoCzIoLm5pbGxpb24ucGF5bWVudHMudjEucXVvdGUuSW52b2tlQ29tcHV0ZUgAElAKFW92ZXJ3cml0ZV9wZXJtaXNzaW9ucxgHIAEoCzIvLm5pbGxpb24ucGF5bWVudHMudjEucXVvdGUuT3ZlcndyaXRlUGVybWlzc2lvbnNIABJKChJ1cGRhdGVfcGVybWlzc2lvbnMYCCABKAsyLC5uaWxsaW9uLnBheW1lbnRzLnYxLnF1b3RlLlVwZGF0ZVBlcm1pc3Npb25zSABCCwoJb3BlcmF0aW9uIi8KC1NpZ25lZFF1b3RlEg0KBXF1b3RlGAEgASgMEhEKCXNpZ25hdHVyZRgCIAEoDCKXAgoKUHJpY2VRdW90ZRINCgVub25jZRgBIAEoDBIyCgRmZWVzGAIgASgLMiQubmlsbGlvbi5wYXltZW50cy52MS5xdW90ZS5RdW90ZUZlZXMSPQoHcmVxdWVzdBgDIAEoCzIsLm5pbGxpb24ucGF5bWVudHMudjEucXVvdGUuUHJpY2VRdW90ZVJlcXVlc3QSLgoKZXhwaXJlc19hdBgEIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXASVwoacHJlcHJvY2Vzc2luZ19yZXF1aXJlbWVudHMYBSADKAsyMy5uaWxsaW9uLnBheW1lbnRzLnYxLnF1b3RlLlByZXByb2Nlc3NpbmdSZXF1aXJlbWVudCJ1CglRdW90ZUZlZXMSDQoFdG90YWwYASABKAQSDAoEYmFzZRgCIAEoBBISCgpjb25nZXN0aW9uGAMgASgEEg8KB3N0b3JhZ2UYBCABKAQSFQoNcHJlcHJvY2Vzc2luZxgFIAEoBBIPCgdjb21wdXRlGAYgASgEInMKDFN0b3JlUHJvZ3JhbRI8CghtZXRhZGF0YRgBIAEoCzIqLm5pbGxpb24ucGF5bWVudHMudjEucXVvdGUuUHJvZ3JhbU1ldGFkYXRhEhcKD2NvbnRlbnRzX3NoYTI1NhgCIAEoDBIMCgRuYW1lGAMgASgJIrkCCg9Qcm9ncmFtTWV0YWRhdGESFAoMcHJvZ3JhbV9zaXplGAEgASgEEhMKC21lbW9yeV9zaXplGAIgASgEEhkKEWluc3RydWN0aW9uX2NvdW50GAMgASgEElIKDGluc3RydWN0aW9ucxgEIAMoCzI8Lm5pbGxpb24ucGF5bWVudHMudjEucXVvdGUuUHJvZ3JhbU1ldGFkYXRhLkluc3RydWN0aW9uc0VudHJ5ElcKGnByZXByb2Nlc3NpbmdfcmVxdWlyZW1lbnRzGAUgAygLMjMubmlsbGlvbi5wYXltZW50cy52MS5xdW90ZS5QcmVwcm9jZXNzaW5nUmVxdWlyZW1lbnQaMwoRSW5zdHJ1Y3Rpb25zRW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgEOgI4ASJyChhQcmVwcm9jZXNzaW5nUmVxdWlyZW1lbnQSRwoHZWxlbWVudBgBIAEoDjI2Lm5pbGxpb24ucHJlcHJvY2Vzc2luZy52MS5lbGVtZW50LlByZXByb2Nlc3NpbmdFbGVtZW50Eg0KBWNvdW50GAIgASgEIiMKDlJldHJpZXZlVmFsdWVzEhEKCXZhbHVlc19pZBgBIAEoDCIoChNSZXRyaWV2ZVBlcm1pc3Npb25zEhEKCXZhbHVlc19pZBgBIAEoDCIpChRPdmVyd3JpdGVQZXJtaXNzaW9ucxIRCgl2YWx1ZXNfaWQYASABKAwiJgoRVXBkYXRlUGVybWlzc2lvbnMSEQoJdmFsdWVzX2lkGAEgASgMIrABCgtTdG9yZVZhbHVlcxIXCg9wYXJ0aWNsZXNfY291bnQYASABKAQSGwoTc2VjcmV0X3NoYXJlZF9jb3VudBgCIAEoBBIbChNwdWJsaWNfdmFsdWVzX2NvdW50GAMgASgEEhAKCHR0bF9kYXlzGAQgASgNEhQKDHBheWxvYWRfc2l6ZRgFIAEoBBImCh5lY2RzYV9wcml2YXRlX2tleV9zaGFyZXNfY291bnQYBiABKAQiQAoNSW52b2tlQ29tcHV0ZRISCgpwcm9ncmFtX2lkGAEgASgJEhsKE3ZhbHVlc19wYXlsb2FkX3NpemUYAiABKARCswEKHWNvbS5uaWxsaW9uLnBheW1lbnRzLnYxLnF1b3RlQgpRdW90ZVByb3RvUAGiAgROUFZRqgIZTmlsbGlvbi5QYXltZW50cy5WMS5RdW90ZcoCGU5pbGxpb25cUGF5bWVudHNcVjFcUXVvdGXiAiVOaWxsaW9uXFBheW1lbnRzXFYxXFF1b3RlXEdQQk1ldGFkYXRh6gIcTmlsbGlvbjo6UGF5bWVudHM6OlYxOjpRdW90ZWIGcHJvdG8z", [file_google_protobuf_empty, file_google_protobuf_timestamp, file_nillion_preprocessing_v1_element]); + fileDesc("Ch9uaWxsaW9uL3BheW1lbnRzL3YxL3F1b3RlLnByb3RvEhluaWxsaW9uLnBheW1lbnRzLnYxLnF1b3RlIskEChFQcmljZVF1b3RlUmVxdWVzdBItCgtwb29sX3N0YXR1cxgBIAEoCzIWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eUgAEkAKDXN0b3JlX3Byb2dyYW0YAiABKAsyJy5uaWxsaW9uLnBheW1lbnRzLnYxLnF1b3RlLlN0b3JlUHJvZ3JhbUgAEkQKD3JldHJpZXZlX3ZhbHVlcxgDIAEoCzIpLm5pbGxpb24ucGF5bWVudHMudjEucXVvdGUuUmV0cmlldmVWYWx1ZXNIABJOChRyZXRyaWV2ZV9wZXJtaXNzaW9ucxgEIAEoCzIuLm5pbGxpb24ucGF5bWVudHMudjEucXVvdGUuUmV0cmlldmVQZXJtaXNzaW9uc0gAEj4KDHN0b3JlX3ZhbHVlcxgFIAEoCzImLm5pbGxpb24ucGF5bWVudHMudjEucXVvdGUuU3RvcmVWYWx1ZXNIABJCCg5pbnZva2VfY29tcHV0ZRgGIAEoCzIoLm5pbGxpb24ucGF5bWVudHMudjEucXVvdGUuSW52b2tlQ29tcHV0ZUgAElAKFW92ZXJ3cml0ZV9wZXJtaXNzaW9ucxgHIAEoCzIvLm5pbGxpb24ucGF5bWVudHMudjEucXVvdGUuT3ZlcndyaXRlUGVybWlzc2lvbnNIABJKChJ1cGRhdGVfcGVybWlzc2lvbnMYCCABKAsyLC5uaWxsaW9uLnBheW1lbnRzLnYxLnF1b3RlLlVwZGF0ZVBlcm1pc3Npb25zSABCCwoJb3BlcmF0aW9uIi8KC1NpZ25lZFF1b3RlEg0KBXF1b3RlGAEgASgMEhEKCXNpZ25hdHVyZRgCIAEoDCKXAgoKUHJpY2VRdW90ZRINCgVub25jZRgBIAEoDBIyCgRmZWVzGAIgASgLMiQubmlsbGlvbi5wYXltZW50cy52MS5xdW90ZS5RdW90ZUZlZXMSPQoHcmVxdWVzdBgDIAEoCzIsLm5pbGxpb24ucGF5bWVudHMudjEucXVvdGUuUHJpY2VRdW90ZVJlcXVlc3QSLgoKZXhwaXJlc19hdBgEIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXASVwoacHJlcHJvY2Vzc2luZ19yZXF1aXJlbWVudHMYBSADKAsyMy5uaWxsaW9uLnBheW1lbnRzLnYxLnF1b3RlLlByZXByb2Nlc3NpbmdSZXF1aXJlbWVudCJ1CglRdW90ZUZlZXMSDQoFdG90YWwYASABKAQSDAoEYmFzZRgCIAEoBBISCgpjb25nZXN0aW9uGAMgASgEEg8KB3N0b3JhZ2UYBCABKAQSFQoNcHJlcHJvY2Vzc2luZxgFIAEoBBIPCgdjb21wdXRlGAYgASgEInMKDFN0b3JlUHJvZ3JhbRI8CghtZXRhZGF0YRgBIAEoCzIqLm5pbGxpb24ucGF5bWVudHMudjEucXVvdGUuUHJvZ3JhbU1ldGFkYXRhEhcKD2NvbnRlbnRzX3NoYTI1NhgCIAEoDBIMCgRuYW1lGAMgASgJIrkCCg9Qcm9ncmFtTWV0YWRhdGESFAoMcHJvZ3JhbV9zaXplGAEgASgEEhMKC21lbW9yeV9zaXplGAIgASgEEhkKEWluc3RydWN0aW9uX2NvdW50GAMgASgEElIKDGluc3RydWN0aW9ucxgEIAMoCzI8Lm5pbGxpb24ucGF5bWVudHMudjEucXVvdGUuUHJvZ3JhbU1ldGFkYXRhLkluc3RydWN0aW9uc0VudHJ5ElcKGnByZXByb2Nlc3NpbmdfcmVxdWlyZW1lbnRzGAUgAygLMjMubmlsbGlvbi5wYXltZW50cy52MS5xdW90ZS5QcmVwcm9jZXNzaW5nUmVxdWlyZW1lbnQaMwoRSW5zdHJ1Y3Rpb25zRW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgEOgI4ASJyChhQcmVwcm9jZXNzaW5nUmVxdWlyZW1lbnQSRwoHZWxlbWVudBgBIAEoDjI2Lm5pbGxpb24ucHJlcHJvY2Vzc2luZy52MS5lbGVtZW50LlByZXByb2Nlc3NpbmdFbGVtZW50Eg0KBWNvdW50GAIgASgEIiMKDlJldHJpZXZlVmFsdWVzEhEKCXZhbHVlc19pZBgBIAEoDCIoChNSZXRyaWV2ZVBlcm1pc3Npb25zEhEKCXZhbHVlc19pZBgBIAEoDCIpChRPdmVyd3JpdGVQZXJtaXNzaW9ucxIRCgl2YWx1ZXNfaWQYASABKAwiJgoRVXBkYXRlUGVybWlzc2lvbnMSEQoJdmFsdWVzX2lkGAEgASgMItYBCgtTdG9yZVZhbHVlcxIXCg9wYXJ0aWNsZXNfY291bnQYASABKAQSGwoTc2VjcmV0X3NoYXJlZF9jb3VudBgCIAEoBBIbChNwdWJsaWNfdmFsdWVzX2NvdW50GAMgASgEEhAKCHR0bF9kYXlzGAQgASgNEhQKDHBheWxvYWRfc2l6ZRgFIAEoBBImCh5lY2RzYV9wcml2YXRlX2tleV9zaGFyZXNfY291bnQYBiABKAQSJAocZWNkc2Ffc2lnbmF0dXJlX3NoYXJlc19jb3VudBgHIAEoBCJACg1JbnZva2VDb21wdXRlEhIKCnByb2dyYW1faWQYASABKAkSGwoTdmFsdWVzX3BheWxvYWRfc2l6ZRgCIAEoBEKzAQodY29tLm5pbGxpb24ucGF5bWVudHMudjEucXVvdGVCClF1b3RlUHJvdG9QAaICBE5QVlGqAhlOaWxsaW9uLlBheW1lbnRzLlYxLlF1b3RlygIZTmlsbGlvblxQYXltZW50c1xWMVxRdW90ZeICJU5pbGxpb25cUGF5bWVudHNcVjFcUXVvdGVcR1BCTWV0YWRhdGHqAhxOaWxsaW9uOjpQYXltZW50czo6VjE6OlF1b3RlYgZwcm90bzM", [file_google_protobuf_empty, file_google_protobuf_timestamp, file_nillion_preprocessing_v1_element]); /** * A price quote request. @@ -492,6 +492,13 @@ export type StoreValues = Message<"nillion.payments.v1.quote.StoreValues"> & { * @generated from field: uint64 ecdsa_private_key_shares_count = 6; */ ecdsaPrivateKeySharesCount: bigint; + + /** + * The size of the payload to be stored. + * + * @generated from field: uint64 ecdsa_signature_shares_count = 7; + */ + ecdsaSignatureSharesCount: bigint; }; /** diff --git a/client-vms/src/gen-proto/nillion/preprocessing/v1/element_pb.ts b/client-vms/src/gen-proto/nillion/preprocessing/v1/element_pb.ts index c0d0be4b..0d8e0b8f 100644 --- a/client-vms/src/gen-proto/nillion/preprocessing/v1/element_pb.ts +++ b/client-vms/src/gen-proto/nillion/preprocessing/v1/element_pb.ts @@ -9,7 +9,7 @@ import { enumDesc, fileDesc } from "@bufbuild/protobuf/codegenv1"; * Describes the file nillion/preprocessing/v1/element.proto. */ export const file_nillion_preprocessing_v1_element: GenFile = /*@__PURE__*/ - fileDesc("CiZuaWxsaW9uL3ByZXByb2Nlc3NpbmcvdjEvZWxlbWVudC5wcm90bxIgbmlsbGlvbi5wcmVwcm9jZXNzaW5nLnYxLmVsZW1lbnQqywEKFFByZXByb2Nlc3NpbmdFbGVtZW50EgkKBUFMUEhBEAASCgoGTEFNQkRBEAESCwoHQ09NUEFSRRACEhsKF0RJVklTSU9OX1NFQ1JFVF9ESVZJU09SEAMSGgoWRVFVQUxJVFlfU0VDUkVUX09VVFBVVBAEEhoKFkVRVUFMSVRZX1BVQkxJQ19PVVRQVVQQBRIVChFTSEFSRV9UT19QQVJUSUNMRRAGEgoKBk1PRFVMTxAHEgkKBVRSVU5DEAgSDAoIVFJVTkNfUFIQCULYAQokY29tLm5pbGxpb24ucHJlcHJvY2Vzc2luZy52MS5lbGVtZW50QgxFbGVtZW50UHJvdG9QAaICBE5QVkWqAiBOaWxsaW9uLlByZXByb2Nlc3NpbmcuVjEuRWxlbWVudMoCIE5pbGxpb25cUHJlcHJvY2Vzc2luZ1xWMVxFbGVtZW504gIsTmlsbGlvblxQcmVwcm9jZXNzaW5nXFYxXEVsZW1lbnRcR1BCTWV0YWRhdGHqAiNOaWxsaW9uOjpQcmVwcm9jZXNzaW5nOjpWMTo6RWxlbWVudGIGcHJvdG8z"); + fileDesc("CiZuaWxsaW9uL3ByZXByb2Nlc3NpbmcvdjEvZWxlbWVudC5wcm90bxIgbmlsbGlvbi5wcmVwcm9jZXNzaW5nLnYxLmVsZW1lbnQq8wEKFFByZXByb2Nlc3NpbmdFbGVtZW50EgkKBUFMUEhBEAASCgoGTEFNQkRBEAESCwoHQ09NUEFSRRACEhsKF0RJVklTSU9OX1NFQ1JFVF9ESVZJU09SEAMSGgoWRVFVQUxJVFlfU0VDUkVUX09VVFBVVBAEEhoKFkVRVUFMSVRZX1BVQkxJQ19PVVRQVVQQBRIVChFTSEFSRV9UT19QQVJUSUNMRRAGEgoKBk1PRFVMTxAHEgkKBVRSVU5DEAgSDAoIVFJVTkNfUFIQCRISCg5SQU5ET01fSU5URUdFUhAKEhIKDlJBTkRPTV9CT09MRUFOEAtC2AEKJGNvbS5uaWxsaW9uLnByZXByb2Nlc3NpbmcudjEuZWxlbWVudEIMRWxlbWVudFByb3RvUAGiAgROUFZFqgIgTmlsbGlvbi5QcmVwcm9jZXNzaW5nLlYxLkVsZW1lbnTKAiBOaWxsaW9uXFByZXByb2Nlc3NpbmdcVjFcRWxlbWVudOICLE5pbGxpb25cUHJlcHJvY2Vzc2luZ1xWMVxFbGVtZW50XEdQQk1ldGFkYXRh6gIjTmlsbGlvbjo6UHJlcHJvY2Vzc2luZzo6VjE6OkVsZW1lbnRiBnByb3RvMw"); /** * A preprocessing element. @@ -66,6 +66,16 @@ export enum PreprocessingElement { * @generated from enum value: TRUNC_PR = 9; */ TRUNC_PR = 9, + + /** + * @generated from enum value: RANDOM_INTEGER = 10; + */ + RANDOM_INTEGER = 10, + + /** + * @generated from enum value: RANDOM_BOOLEAN = 11; + */ + RANDOM_BOOLEAN = 11, } /** diff --git a/client-vms/src/gen-proto/nillion/preprocessing/v1/generate_pb.ts b/client-vms/src/gen-proto/nillion/preprocessing/v1/generate_pb.ts index 15811213..3fc62a6d 100644 --- a/client-vms/src/gen-proto/nillion/preprocessing/v1/generate_pb.ts +++ b/client-vms/src/gen-proto/nillion/preprocessing/v1/generate_pb.ts @@ -6,13 +6,15 @@ import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1" import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv1"; import type { PreprocessingElement } from "./element_pb"; import { file_nillion_preprocessing_v1_element } from "./element_pb"; +import type { AuxiliaryMaterial } from "./material_pb"; +import { file_nillion_preprocessing_v1_material } from "./material_pb"; import type { Message } from "@bufbuild/protobuf"; /** * Describes the file nillion/preprocessing/v1/generate.proto. */ export const file_nillion_preprocessing_v1_generate: GenFile = /*@__PURE__*/ - fileDesc("CiduaWxsaW9uL3ByZXByb2Nlc3NpbmcvdjEvZ2VuZXJhdGUucHJvdG8SIW5pbGxpb24ucHJlcHJvY2Vzc2luZy52MS5nZW5lcmF0ZSKkAQocR2VuZXJhdGVQcmVwcm9jZXNzaW5nUmVxdWVzdBIVCg1nZW5lcmF0aW9uX2lkGAEgASgMEhAKCGJhdGNoX2lkGAIgASgEEhIKCmJhdGNoX3NpemUYAyABKA0SRwoHZWxlbWVudBgEIAEoDjI2Lm5pbGxpb24ucHJlcHJvY2Vzc2luZy52MS5lbGVtZW50LlByZXByb2Nlc3NpbmdFbGVtZW50Im8KHUdlbmVyYXRlUHJlcHJvY2Vzc2luZ1Jlc3BvbnNlEk4KBnN0YXR1cxgBIAEoDjI+Lm5pbGxpb24ucHJlcHJvY2Vzc2luZy52MS5nZW5lcmF0ZS5QcmVwcm9jZXNzaW5nUHJvdG9jb2xTdGF0dXMqXAobUHJlcHJvY2Vzc2luZ1Byb3RvY29sU3RhdHVzEhEKDVdBSVRJTkdfUEVFUlMQABIUChBGSU5JU0hFRF9TVUNDRVNTEAESFAoQRklOSVNIRURfRkFJTFVSRRACQt4BCiVjb20ubmlsbGlvbi5wcmVwcm9jZXNzaW5nLnYxLmdlbmVyYXRlQg1HZW5lcmF0ZVByb3RvUAGiAgROUFZHqgIhTmlsbGlvbi5QcmVwcm9jZXNzaW5nLlYxLkdlbmVyYXRlygIhTmlsbGlvblxQcmVwcm9jZXNzaW5nXFYxXEdlbmVyYXRl4gItTmlsbGlvblxQcmVwcm9jZXNzaW5nXFYxXEdlbmVyYXRlXEdQQk1ldGFkYXRh6gIkTmlsbGlvbjo6UHJlcHJvY2Vzc2luZzo6VjE6OkdlbmVyYXRlYgZwcm90bzM", [file_nillion_preprocessing_v1_element]); + fileDesc("CiduaWxsaW9uL3ByZXByb2Nlc3NpbmcvdjEvZ2VuZXJhdGUucHJvdG8SIW5pbGxpb24ucHJlcHJvY2Vzc2luZy52MS5nZW5lcmF0ZSKkAQocR2VuZXJhdGVQcmVwcm9jZXNzaW5nUmVxdWVzdBIVCg1nZW5lcmF0aW9uX2lkGAEgASgMEhAKCGJhdGNoX2lkGAIgASgEEhIKCmJhdGNoX3NpemUYAyABKA0SRwoHZWxlbWVudBgEIAEoDjI2Lm5pbGxpb24ucHJlcHJvY2Vzc2luZy52MS5lbGVtZW50LlByZXByb2Nlc3NpbmdFbGVtZW50Im8KHUdlbmVyYXRlUHJlcHJvY2Vzc2luZ1Jlc3BvbnNlEk4KBnN0YXR1cxgBIAEoDjI+Lm5pbGxpb24ucHJlcHJvY2Vzc2luZy52MS5nZW5lcmF0ZS5QcmVwcm9jZXNzaW5nUHJvdG9jb2xTdGF0dXMigQEKIEdlbmVyYXRlQXV4aWxpYXJ5TWF0ZXJpYWxSZXF1ZXN0EhUKDWdlbmVyYXRpb25faWQYASABKAwSRgoIbWF0ZXJpYWwYAiABKA4yNC5uaWxsaW9uLnByZXByb2Nlc3NpbmcudjEubWF0ZXJpYWwuQXV4aWxpYXJ5TWF0ZXJpYWwicwohR2VuZXJhdGVBdXhpbGlhcnlNYXRlcmlhbFJlc3BvbnNlEk4KBnN0YXR1cxgBIAEoDjI+Lm5pbGxpb24ucHJlcHJvY2Vzc2luZy52MS5nZW5lcmF0ZS5QcmVwcm9jZXNzaW5nUHJvdG9jb2xTdGF0dXMqXAobUHJlcHJvY2Vzc2luZ1Byb3RvY29sU3RhdHVzEhEKDVdBSVRJTkdfUEVFUlMQABIUChBGSU5JU0hFRF9TVUNDRVNTEAESFAoQRklOSVNIRURfRkFJTFVSRRACQt4BCiVjb20ubmlsbGlvbi5wcmVwcm9jZXNzaW5nLnYxLmdlbmVyYXRlQg1HZW5lcmF0ZVByb3RvUAGiAgROUFZHqgIhTmlsbGlvbi5QcmVwcm9jZXNzaW5nLlYxLkdlbmVyYXRlygIhTmlsbGlvblxQcmVwcm9jZXNzaW5nXFYxXEdlbmVyYXRl4gItTmlsbGlvblxQcmVwcm9jZXNzaW5nXFYxXEdlbmVyYXRlXEdQQk1ldGFkYXRh6gIkTmlsbGlvbjo6UHJlcHJvY2Vzc2luZzo6VjE6OkdlbmVyYXRlYgZwcm90bzM", [file_nillion_preprocessing_v1_element, file_nillion_preprocessing_v1_material]); /** * A request to generate preprocessing material. @@ -79,6 +81,55 @@ export type GeneratePreprocessingResponse = Message<"nillion.preprocessing.v1.ge export const GeneratePreprocessingResponseSchema: GenMessage = /*@__PURE__*/ messageDesc(file_nillion_preprocessing_v1_generate, 1); +/** + * / A request to generate auxiliary material. + * + * @generated from message nillion.preprocessing.v1.generate.GenerateAuxiliaryMaterialRequest + */ +export type GenerateAuxiliaryMaterialRequest = Message<"nillion.preprocessing.v1.generate.GenerateAuxiliaryMaterialRequest"> & { + /** + * / An identifier for this generation instance. + * + * @generated from field: bytes generation_id = 1; + */ + generationId: Uint8Array; + + /** + * The material we want to generate. + * + * @generated from field: nillion.preprocessing.v1.material.AuxiliaryMaterial material = 2; + */ + material: AuxiliaryMaterial; +}; + +/** + * Describes the message nillion.preprocessing.v1.generate.GenerateAuxiliaryMaterialRequest. + * Use `create(GenerateAuxiliaryMaterialRequestSchema)` to create a new message. + */ +export const GenerateAuxiliaryMaterialRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_nillion_preprocessing_v1_generate, 2); + +/** + * / A response to a request to generate auxiliary material. + * + * @generated from message nillion.preprocessing.v1.generate.GenerateAuxiliaryMaterialResponse + */ +export type GenerateAuxiliaryMaterialResponse = Message<"nillion.preprocessing.v1.generate.GenerateAuxiliaryMaterialResponse"> & { + /** + * The status of the generation protocol. + * + * @generated from field: nillion.preprocessing.v1.generate.PreprocessingProtocolStatus status = 1; + */ + status: PreprocessingProtocolStatus; +}; + +/** + * Describes the message nillion.preprocessing.v1.generate.GenerateAuxiliaryMaterialResponse. + * Use `create(GenerateAuxiliaryMaterialResponseSchema)` to create a new message. + */ +export const GenerateAuxiliaryMaterialResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_nillion_preprocessing_v1_generate, 3); + /** * The status of a preprocessing protocol execution. * diff --git a/client-vms/src/gen-proto/nillion/preprocessing/v1/service_pb.ts b/client-vms/src/gen-proto/nillion/preprocessing/v1/service_pb.ts index fc631869..cd391070 100644 --- a/client-vms/src/gen-proto/nillion/preprocessing/v1/service_pb.ts +++ b/client-vms/src/gen-proto/nillion/preprocessing/v1/service_pb.ts @@ -6,9 +6,9 @@ import type { GenFile, GenService } from "@bufbuild/protobuf/codegenv1"; import { fileDesc, serviceDesc } from "@bufbuild/protobuf/codegenv1"; import type { EmptySchema } from "@bufbuild/protobuf/wkt"; import { file_google_protobuf_empty } from "@bufbuild/protobuf/wkt"; -import type { GeneratePreprocessingRequestSchema, GeneratePreprocessingResponseSchema } from "./generate_pb"; +import type { GenerateAuxiliaryMaterialRequestSchema, GenerateAuxiliaryMaterialResponseSchema, GeneratePreprocessingRequestSchema, GeneratePreprocessingResponseSchema } from "./generate_pb"; import { file_nillion_preprocessing_v1_generate } from "./generate_pb"; -import type { PreprocessingStreamMessageSchema } from "./stream_pb"; +import type { AuxiliaryMaterialStreamMessageSchema, PreprocessingStreamMessageSchema } from "./stream_pb"; import { file_nillion_preprocessing_v1_stream } from "./stream_pb"; import type { CleanupUsedElementsRequestSchema } from "./cleanup_pb"; import { file_nillion_preprocessing_v1_cleanup } from "./cleanup_pb"; @@ -17,7 +17,7 @@ import { file_nillion_preprocessing_v1_cleanup } from "./cleanup_pb"; * Describes the file nillion/preprocessing/v1/service.proto. */ export const file_nillion_preprocessing_v1_service: GenFile = /*@__PURE__*/ - fileDesc("CiZuaWxsaW9uL3ByZXByb2Nlc3NpbmcvdjEvc2VydmljZS5wcm90bxIYbmlsbGlvbi5wcmVwcm9jZXNzaW5nLnYxMokDCg1QcmVwcm9jZXNzaW5nEpwBChVHZW5lcmF0ZVByZXByb2Nlc3NpbmcSPy5uaWxsaW9uLnByZXByb2Nlc3NpbmcudjEuZ2VuZXJhdGUuR2VuZXJhdGVQcmVwcm9jZXNzaW5nUmVxdWVzdBpALm5pbGxpb24ucHJlcHJvY2Vzc2luZy52MS5nZW5lcmF0ZS5HZW5lcmF0ZVByZXByb2Nlc3NpbmdSZXNwb25zZTABEmwKE1N0cmVhbVByZXByb2Nlc3NpbmcSOy5uaWxsaW9uLnByZXByb2Nlc3NpbmcudjEuc3RyZWFtLlByZXByb2Nlc3NpbmdTdHJlYW1NZXNzYWdlGhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5KAESawoTQ2xlYW51cFVzZWRFbGVtZW50cxI8Lm5pbGxpb24ucHJlcHJvY2Vzc2luZy52MS5jbGVhbnVwLkNsZWFudXBVc2VkRWxlbWVudHNSZXF1ZXN0GhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5Qq4BChxjb20ubmlsbGlvbi5wcmVwcm9jZXNzaW5nLnYxQgxTZXJ2aWNlUHJvdG9QAaICA05QWKoCGE5pbGxpb24uUHJlcHJvY2Vzc2luZy5WMcoCGE5pbGxpb25cUHJlcHJvY2Vzc2luZ1xWMeICJE5pbGxpb25cUHJlcHJvY2Vzc2luZ1xWMVxHUEJNZXRhZGF0YeoCGk5pbGxpb246OlByZXByb2Nlc3Npbmc6OlYxYgZwcm90bzM", [file_google_protobuf_empty, file_nillion_preprocessing_v1_generate, file_nillion_preprocessing_v1_stream, file_nillion_preprocessing_v1_cleanup]); + fileDesc("CiZuaWxsaW9uL3ByZXByb2Nlc3NpbmcvdjEvc2VydmljZS5wcm90bxIYbmlsbGlvbi5wcmVwcm9jZXNzaW5nLnYxMqoFCg1QcmVwcm9jZXNzaW5nEpwBChVHZW5lcmF0ZVByZXByb2Nlc3NpbmcSPy5uaWxsaW9uLnByZXByb2Nlc3NpbmcudjEuZ2VuZXJhdGUuR2VuZXJhdGVQcmVwcm9jZXNzaW5nUmVxdWVzdBpALm5pbGxpb24ucHJlcHJvY2Vzc2luZy52MS5nZW5lcmF0ZS5HZW5lcmF0ZVByZXByb2Nlc3NpbmdSZXNwb25zZTABEqgBChlHZW5lcmF0ZUF1eGlsaWFyeU1hdGVyaWFsEkMubmlsbGlvbi5wcmVwcm9jZXNzaW5nLnYxLmdlbmVyYXRlLkdlbmVyYXRlQXV4aWxpYXJ5TWF0ZXJpYWxSZXF1ZXN0GkQubmlsbGlvbi5wcmVwcm9jZXNzaW5nLnYxLmdlbmVyYXRlLkdlbmVyYXRlQXV4aWxpYXJ5TWF0ZXJpYWxSZXNwb25zZTABEmwKE1N0cmVhbVByZXByb2Nlc3NpbmcSOy5uaWxsaW9uLnByZXByb2Nlc3NpbmcudjEuc3RyZWFtLlByZXByb2Nlc3NpbmdTdHJlYW1NZXNzYWdlGhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5KAESdAoXU3RyZWFtQXV4aWxpYXJ5TWF0ZXJpYWwSPy5uaWxsaW9uLnByZXByb2Nlc3NpbmcudjEuc3RyZWFtLkF1eGlsaWFyeU1hdGVyaWFsU3RyZWFtTWVzc2FnZRoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eSgBEmsKE0NsZWFudXBVc2VkRWxlbWVudHMSPC5uaWxsaW9uLnByZXByb2Nlc3NpbmcudjEuY2xlYW51cC5DbGVhbnVwVXNlZEVsZW1lbnRzUmVxdWVzdBoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eUKuAQocY29tLm5pbGxpb24ucHJlcHJvY2Vzc2luZy52MUIMU2VydmljZVByb3RvUAGiAgNOUFiqAhhOaWxsaW9uLlByZXByb2Nlc3NpbmcuVjHKAhhOaWxsaW9uXFByZXByb2Nlc3NpbmdcVjHiAiROaWxsaW9uXFByZXByb2Nlc3NpbmdcVjFcR1BCTWV0YWRhdGHqAhpOaWxsaW9uOjpQcmVwcm9jZXNzaW5nOjpWMWIGcHJvdG8z", [file_google_protobuf_empty, file_nillion_preprocessing_v1_generate, file_nillion_preprocessing_v1_stream, file_nillion_preprocessing_v1_cleanup]); /** * A service to run preprocessing related actions. @@ -28,6 +28,8 @@ export const Preprocessing: GenService<{ /** * Trigger the generation of preprocessing material. * + * Preprocessing material is used to speed up the online phase for certain operations in MPC programs. + * * @generated from rpc nillion.preprocessing.v1.Preprocessing.GeneratePreprocessing */ generatePreprocessing: { @@ -35,6 +37,20 @@ export const Preprocessing: GenService<{ input: typeof GeneratePreprocessingRequestSchema; output: typeof GeneratePreprocessingResponseSchema; }, + /** + * Trigger the generation of auxiliary material. + * + * The distinction between preprocessing and auxiliary material is preprocessing is consumed when certain + * programs are ran while auxiliary material is generated once when the network starts for the first time and + * is never consumed unless there's a reason to regenerate it. + * + * @generated from rpc nillion.preprocessing.v1.Preprocessing.GenerateAuxiliaryMaterial + */ + generateAuxiliaryMaterial: { + methodKind: "server_streaming"; + input: typeof GenerateAuxiliaryMaterialRequestSchema; + output: typeof GenerateAuxiliaryMaterialResponseSchema; + }, /** * Open a stream to generate a preprocessing element. * @@ -45,6 +61,16 @@ export const Preprocessing: GenService<{ input: typeof PreprocessingStreamMessageSchema; output: typeof EmptySchema; }, + /** + * Open a stream to generate auxiliary material. + * + * @generated from rpc nillion.preprocessing.v1.Preprocessing.StreamAuxiliaryMaterial + */ + streamAuxiliaryMaterial: { + methodKind: "client_streaming"; + input: typeof AuxiliaryMaterialStreamMessageSchema; + output: typeof EmptySchema; + }, /** * Cleanup used preprocessing chunks. * diff --git a/client-vms/src/gen-proto/nillion/preprocessing/v1/stream_pb.ts b/client-vms/src/gen-proto/nillion/preprocessing/v1/stream_pb.ts index 9a0ef071..f92071bf 100644 --- a/client-vms/src/gen-proto/nillion/preprocessing/v1/stream_pb.ts +++ b/client-vms/src/gen-proto/nillion/preprocessing/v1/stream_pb.ts @@ -6,13 +6,15 @@ import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1"; import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv1"; import type { PreprocessingElement } from "./element_pb"; import { file_nillion_preprocessing_v1_element } from "./element_pb"; +import type { AuxiliaryMaterial } from "./material_pb"; +import { file_nillion_preprocessing_v1_material } from "./material_pb"; import type { Message } from "@bufbuild/protobuf"; /** * Describes the file nillion/preprocessing/v1/stream.proto. */ export const file_nillion_preprocessing_v1_stream: GenFile = /*@__PURE__*/ - fileDesc("CiVuaWxsaW9uL3ByZXByb2Nlc3NpbmcvdjEvc3RyZWFtLnByb3RvEh9uaWxsaW9uLnByZXByb2Nlc3NpbmcudjEuc3RyZWFtIpUBChpQcmVwcm9jZXNzaW5nU3RyZWFtTWVzc2FnZRIVCg1nZW5lcmF0aW9uX2lkGAEgASgMEkcKB2VsZW1lbnQYAiABKA4yNi5uaWxsaW9uLnByZXByb2Nlc3NpbmcudjEuZWxlbWVudC5QcmVwcm9jZXNzaW5nRWxlbWVudBIXCg9iaW5jb2RlX21lc3NhZ2UYAyABKAxC0gEKI2NvbS5uaWxsaW9uLnByZXByb2Nlc3NpbmcudjEuc3RyZWFtQgtTdHJlYW1Qcm90b1ABogIETlBWU6oCH05pbGxpb24uUHJlcHJvY2Vzc2luZy5WMS5TdHJlYW3KAh9OaWxsaW9uXFByZXByb2Nlc3NpbmdcVjFcU3RyZWFt4gIrTmlsbGlvblxQcmVwcm9jZXNzaW5nXFYxXFN0cmVhbVxHUEJNZXRhZGF0YeoCIk5pbGxpb246OlByZXByb2Nlc3Npbmc6OlYxOjpTdHJlYW1iBnByb3RvMw", [file_nillion_preprocessing_v1_element]); + fileDesc("CiVuaWxsaW9uL3ByZXByb2Nlc3NpbmcvdjEvc3RyZWFtLnByb3RvEh9uaWxsaW9uLnByZXByb2Nlc3NpbmcudjEuc3RyZWFtIpUBChpQcmVwcm9jZXNzaW5nU3RyZWFtTWVzc2FnZRIVCg1nZW5lcmF0aW9uX2lkGAEgASgMEkcKB2VsZW1lbnQYAiABKA4yNi5uaWxsaW9uLnByZXByb2Nlc3NpbmcudjEuZWxlbWVudC5QcmVwcm9jZXNzaW5nRWxlbWVudBIXCg9iaW5jb2RlX21lc3NhZ2UYAyABKAwimAEKHkF1eGlsaWFyeU1hdGVyaWFsU3RyZWFtTWVzc2FnZRIVCg1nZW5lcmF0aW9uX2lkGAEgASgMEkYKCG1hdGVyaWFsGAIgASgOMjQubmlsbGlvbi5wcmVwcm9jZXNzaW5nLnYxLm1hdGVyaWFsLkF1eGlsaWFyeU1hdGVyaWFsEhcKD2JpbmNvZGVfbWVzc2FnZRgDIAEoDELSAQojY29tLm5pbGxpb24ucHJlcHJvY2Vzc2luZy52MS5zdHJlYW1CC1N0cmVhbVByb3RvUAGiAgROUFZTqgIfTmlsbGlvbi5QcmVwcm9jZXNzaW5nLlYxLlN0cmVhbcoCH05pbGxpb25cUHJlcHJvY2Vzc2luZ1xWMVxTdHJlYW3iAitOaWxsaW9uXFByZXByb2Nlc3NpbmdcVjFcU3RyZWFtXEdQQk1ldGFkYXRh6gIiTmlsbGlvbjo6UHJlcHJvY2Vzc2luZzo6VjE6OlN0cmVhbWIGcHJvdG8z", [file_nillion_preprocessing_v1_element, file_nillion_preprocessing_v1_material]); /** * A message sent between nodes during the execution of a preprocessing protocol. @@ -55,3 +57,44 @@ export type PreprocessingStreamMessage = Message<"nillion.preprocessing.v1.strea export const PreprocessingStreamMessageSchema: GenMessage = /*@__PURE__*/ messageDesc(file_nillion_preprocessing_v1_stream, 0); +/** + * A message sent between nodes during the execution of a material generation protocol. + * + * @generated from message nillion.preprocessing.v1.stream.AuxiliaryMaterialStreamMessage + */ +export type AuxiliaryMaterialStreamMessage = Message<"nillion.preprocessing.v1.stream.AuxiliaryMaterialStreamMessage"> & { + /** + * An identifier for the instance of the generation being ran. + * + * Only the first ever message on the stream requires having this attribute set. Any subsequent message will + * have this field ignored. + * + * @generated from field: bytes generation_id = 1; + */ + generationId: Uint8Array; + + /** + * The auxiliary material being generated. + * + * Only the first ever message on the stream requires having this attribute set. Any subsequent message will + * have this field ignored. + * + * @generated from field: nillion.preprocessing.v1.material.AuxiliaryMaterial material = 2; + */ + material: AuxiliaryMaterial; + + /** + * The message in bincode format. + * + * @generated from field: bytes bincode_message = 3; + */ + bincodeMessage: Uint8Array; +}; + +/** + * Describes the message nillion.preprocessing.v1.stream.AuxiliaryMaterialStreamMessage. + * Use `create(AuxiliaryMaterialStreamMessageSchema)` to create a new message. + */ +export const AuxiliaryMaterialStreamMessageSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_nillion_preprocessing_v1_stream, 1); + diff --git a/client-vms/src/payment/builder.ts b/client-vms/src/payment/builder.ts index 3cbd2456..c53b7d02 100644 --- a/client-vms/src/payment/builder.ts +++ b/client-vms/src/payment/builder.ts @@ -1,12 +1,9 @@ import { createClient } from "@connectrpc/connect"; import { type OfflineSigner, Registry } from "@cosmjs/proto-signing"; import { GasPrice, SigningStargateClient } from "@cosmjs/stargate"; -import { Payments } from "@nillion/client-vms/gen-proto/nillion/payments/v1/service_pb"; -import { - GrpcTransport, - OfflineSignerSchema, -} from "@nillion/client-vms/types/grpc"; import { z } from "zod"; +import { Payments } from "#/gen-proto/nillion/payments/v1/service_pb"; +import { GrpcTransport, OfflineSignerSchema } from "#/types/grpc"; import { PaymentClient, PaymentClientConfig } from "./client"; import { MsgPayForCompatWrapper } from "./grpc-compat"; import { NilChainProtobufTypeUrl, NilToken } from "./types"; diff --git a/client-vms/src/payment/client.ts b/client-vms/src/payment/client.ts index fc4e91dc..dc599208 100644 --- a/client-vms/src/payment/client.ts +++ b/client-vms/src/payment/client.ts @@ -1,21 +1,21 @@ import { create, fromBinary } from "@bufbuild/protobuf"; import type { Client } from "@connectrpc/connect"; import { SigningStargateClient } from "@cosmjs/stargate"; -import { MsgPayForSchema } from "@nillion/client-vms/gen-proto/nillion/meta/v1/tx_pb"; +import { z } from "zod"; +import { MsgPayForSchema } from "#/gen-proto/nillion/meta/v1/tx_pb"; import { type PriceQuoteRequest, PriceQuoteSchema, -} from "@nillion/client-vms/gen-proto/nillion/payments/v1/quote_pb"; +} from "#/gen-proto/nillion/payments/v1/quote_pb"; import { PaymentReceiptRequestSchema, type SignedReceipt, -} from "@nillion/client-vms/gen-proto/nillion/payments/v1/receipt_pb"; -import type { Payments } from "@nillion/client-vms/gen-proto/nillion/payments/v1/service_pb"; -import { Log } from "@nillion/client-vms/logger"; -import { GrpcClient } from "@nillion/client-vms/types/grpc"; -import { z } from "zod"; +} from "#/gen-proto/nillion/payments/v1/receipt_pb"; +import type { Payments } from "#/gen-proto/nillion/payments/v1/service_pb"; +import { Log } from "#/logger"; +import { GrpcClient } from "#/types/grpc"; -import { Quote } from "@nillion/client-vms/types/types"; +import { Quote } from "#/types/types"; import { NilChainAddress, NilChainProtobufTypeUrl, diff --git a/client-vms/src/payment/grpc-compat.ts b/client-vms/src/payment/grpc-compat.ts index ef1443d9..0d506e5e 100644 --- a/client-vms/src/payment/grpc-compat.ts +++ b/client-vms/src/payment/grpc-compat.ts @@ -4,7 +4,7 @@ import type { TsProtoGeneratedType } from "@cosmjs/proto-signing/build/registry" import { type MsgPayFor, MsgPayForSchema, -} from "@nillion/client-vms/gen-proto/nillion/meta/v1/tx_pb"; +} from "#/gen-proto/nillion/meta/v1/tx_pb"; /** * This wrapper maintains API compatibility with the cosmjs library while using `@bufbuild/protobuf`. diff --git a/client-vms/src/types/compute-permission-command.ts b/client-vms/src/types/compute-permission-command.ts index 2bbe5c56..ef3c3c50 100644 --- a/client-vms/src/types/compute-permission-command.ts +++ b/client-vms/src/types/compute-permission-command.ts @@ -1,11 +1,11 @@ import { create } from "@bufbuild/protobuf"; -import { ComputePermissionsSchema } from "@nillion/client-vms/gen-proto/nillion/permissions/v1/permissions_pb"; +import { ComputePermissionsSchema } from "#/gen-proto/nillion/permissions/v1/permissions_pb"; import { type ComputePermissionCommand as ComputePermissionCommandProtobuf, ComputePermissionCommandSchema, -} from "@nillion/client-vms/gen-proto/nillion/permissions/v1/update_pb"; -import type { ProgramId } from "@nillion/client-vms/types/types"; -import type { UserId } from "@nillion/client-vms/types/user-id"; +} from "#/gen-proto/nillion/permissions/v1/update_pb"; +import type { ProgramId } from "#/types/types"; +import type { UserId } from "#/types/user-id"; export class ComputePermissionCommand { constructor( diff --git a/client-vms/src/types/permission-command.ts b/client-vms/src/types/permission-command.ts index 18c61d76..926bc654 100644 --- a/client-vms/src/types/permission-command.ts +++ b/client-vms/src/types/permission-command.ts @@ -2,8 +2,8 @@ import { create } from "@bufbuild/protobuf"; import { type PermissionCommand as PermissionCommandProtobuf, PermissionCommandSchema, -} from "@nillion/client-vms/gen-proto/nillion/permissions/v1/update_pb"; -import { UserId } from "@nillion/client-vms/types/user-id"; +} from "#/gen-proto/nillion/permissions/v1/update_pb"; +import { UserId } from "#/types/user-id"; export class PermissionCommand { constructor( diff --git a/client-vms/src/types/types.ts b/client-vms/src/types/types.ts index 354cd9ad..5088ecf6 100644 --- a/client-vms/src/types/types.ts +++ b/client-vms/src/types/types.ts @@ -1,12 +1,12 @@ import { type Timestamp, timestampDate } from "@bufbuild/protobuf/wkt"; +import { PartyId as WasmPartyId } from "@nillion/client-wasm"; +import { z } from "zod"; import type { PriceQuoteRequest, QuoteFees, SignedQuote, -} from "@nillion/client-vms/gen-proto/nillion/payments/v1/quote_pb"; -import { UserId } from "@nillion/client-vms/types/user-id"; -import { PartyId as WasmPartyId } from "@nillion/client-wasm"; -import { z } from "zod"; +} from "#/gen-proto/nillion/payments/v1/quote_pb"; +import { UserId } from "#/types/user-id"; export const TimestampToDateSchema = z .custom( diff --git a/client-vms/src/types/user-id.ts b/client-vms/src/types/user-id.ts index dc0396ed..42e04e06 100644 --- a/client-vms/src/types/user-id.ts +++ b/client-vms/src/types/user-id.ts @@ -1,10 +1,10 @@ import { create } from "@bufbuild/protobuf"; -import type { PublicKey } from "@nillion/client-vms/gen-proto/nillion/auth/v1/public_key_pb"; +import { sha256 } from "@noble/hashes/sha2"; +import type { PublicKey } from "#/gen-proto/nillion/auth/v1/public_key_pb"; import { type UserId as UserIdProto, UserIdSchema, -} from "@nillion/client-vms/gen-proto/nillion/auth/v1/user_pb"; -import { sha256 } from "@noble/hashes/sha2"; +} from "#/gen-proto/nillion/auth/v1/user_pb"; export class UserId { constructor(private inner: Uint8Array) { diff --git a/client-vms/src/types/values-permissions.ts b/client-vms/src/types/values-permissions.ts index 7de007e1..7bf7eb64 100644 --- a/client-vms/src/types/values-permissions.ts +++ b/client-vms/src/types/values-permissions.ts @@ -2,10 +2,10 @@ import { create } from "@bufbuild/protobuf"; import { type Permissions as PermissionsProtobuf, PermissionsSchema, -} from "@nillion/client-vms/gen-proto/nillion/permissions/v1/permissions_pb"; -import type { ProgramId } from "@nillion/client-vms/types/types"; -import { UserId } from "@nillion/client-vms/types/user-id"; -import { assertIsDefined } from "@nillion/client-vms/util"; +} from "#/gen-proto/nillion/permissions/v1/permissions_pb"; +import type { ProgramId } from "#/types/types"; +import { UserId } from "#/types/user-id"; +import { assertIsDefined } from "#/util"; type ValuesPermissionsAsObject = { owner: string; diff --git a/client-vms/src/vm/builder.ts b/client-vms/src/vm/builder.ts index 315c141d..b4f97a5f 100644 --- a/client-vms/src/vm/builder.ts +++ b/client-vms/src/vm/builder.ts @@ -1,23 +1,20 @@ import { createClient } from "@connectrpc/connect"; import { createGrpcWebTransport } from "@connectrpc/connect-web"; import type { OfflineSigner } from "@cosmjs/proto-signing"; -import { - TokenAuthManager, - createAuthInterceptor, -} from "@nillion/client-vms/auth"; +import { SecretMasker } from "@nillion/client-wasm"; +import { z } from "zod"; +import { TokenAuthManager, createAuthInterceptor } from "#/auth"; import { type Cluster, Prime, -} from "@nillion/client-vms/gen-proto/nillion/membership/v1/cluster_pb"; -import { Membership } from "@nillion/client-vms/gen-proto/nillion/membership/v1/service_pb"; -import { Log } from "@nillion/client-vms/logger"; -import { PaymentClientBuilder } from "@nillion/client-vms/payment"; -import { PartyId, UserId } from "@nillion/client-vms/types"; -import { OfflineSignerSchema } from "@nillion/client-vms/types/grpc"; -import { assertIsDefined } from "@nillion/client-vms/util"; -import { VmClient, VmClientConfig } from "@nillion/client-vms/vm/client"; -import { SecretMasker } from "@nillion/client-wasm"; -import { z } from "zod"; +} from "#/gen-proto/nillion/membership/v1/cluster_pb"; +import { Membership } from "#/gen-proto/nillion/membership/v1/service_pb"; +import { Log } from "#/logger"; +import { PaymentClientBuilder } from "#/payment"; +import { PartyId, UserId } from "#/types"; +import { OfflineSignerSchema } from "#/types/grpc"; +import { assertIsDefined } from "#/util"; +import { VmClient, VmClientConfig } from "#/vm/client"; export const VmClientBuilderConfig = z.object({ bootnodeUrl: z.string().url("Invalid bootnode url"), diff --git a/client-vms/src/vm/client.ts b/client-vms/src/vm/client.ts index ebde7d4d..d535350b 100644 --- a/client-vms/src/vm/client.ts +++ b/client-vms/src/vm/client.ts @@ -1,7 +1,7 @@ -import { PaymentClient } from "@nillion/client-vms/payment"; -import { GrpcTransport, PartyId, UserId } from "@nillion/client-vms/types"; import { SecretMasker } from "@nillion/client-wasm"; import { z } from "zod"; +import { PaymentClient } from "#/payment"; +import { GrpcTransport, PartyId, UserId } from "#/types"; import { DeleteValuesBuilder, InvokeComputeBuilder, diff --git a/client-vms/src/vm/operation/delete-values.ts b/client-vms/src/vm/operation/delete-values.ts index 671e1989..b9595a4a 100644 --- a/client-vms/src/vm/operation/delete-values.ts +++ b/client-vms/src/vm/operation/delete-values.ts @@ -1,20 +1,20 @@ import { create } from "@bufbuild/protobuf"; import { type Client, createClient } from "@connectrpc/connect"; -import { - type DeleteValuesRequest, - DeleteValuesRequestSchema, -} from "@nillion/client-vms/gen-proto/nillion/values/v1/delete_pb"; -import { Values } from "@nillion/client-vms/gen-proto/nillion/values/v1/service_pb"; -import { Log } from "@nillion/client-vms/logger"; -import { type PartyId, Uuid } from "@nillion/client-vms/types/types"; -import { collapse } from "@nillion/client-vms/util"; -import type { VmClient } from "@nillion/client-vms/vm/client"; -import type { Operation } from "@nillion/client-vms/vm/operation/operation"; -import { retryGrpcRequestIfRecoverable } from "@nillion/client-vms/vm/operation/retry-client"; import { Effect as E, pipe } from "effect"; import type { UnknownException } from "effect/Cause"; import { parse } from "uuid"; import { z } from "zod"; +import { + type DeleteValuesRequest, + DeleteValuesRequestSchema, +} from "#/gen-proto/nillion/values/v1/delete_pb"; +import { Values } from "#/gen-proto/nillion/values/v1/service_pb"; +import { Log } from "#/logger"; +import { type PartyId, Uuid } from "#/types/types"; +import { collapse } from "#/util"; +import type { VmClient } from "#/vm/client"; +import type { Operation } from "#/vm/operation/operation"; +import { retryGrpcRequestIfRecoverable } from "#/vm/operation/retry-client"; export const DeleteValuesConfig = z.object({ // due to import resolution order we cannot use instanceof because VmClient isn't defined first diff --git a/client-vms/src/vm/operation/invoke-compute.ts b/client-vms/src/vm/operation/invoke-compute.ts index 97973cd2..f60e5c23 100644 --- a/client-vms/src/vm/operation/invoke-compute.ts +++ b/client-vms/src/vm/operation/invoke-compute.ts @@ -1,37 +1,37 @@ import { create } from "@bufbuild/protobuf"; import { type Client, createClient } from "@connectrpc/connect"; +import { + type NadaValue, + NadaValues, + compute_values_size, + encode_values, +} from "@nillion/client-wasm"; +import { Effect as E, pipe } from "effect"; +import { UnknownException } from "effect/Cause"; +import { parse, stringify } from "uuid"; +import { z } from "zod"; import { InputPartyBindingSchema, type InvokeComputeRequest, InvokeComputeRequestSchema, OutputPartyBindingSchema, -} from "@nillion/client-vms/gen-proto/nillion/compute/v1/invoke_pb"; -import { Compute } from "@nillion/client-vms/gen-proto/nillion/compute/v1/service_pb"; -import { PriceQuoteRequestSchema } from "@nillion/client-vms/gen-proto/nillion/payments/v1/quote_pb"; -import type { SignedReceipt } from "@nillion/client-vms/gen-proto/nillion/payments/v1/receipt_pb"; -import { Log } from "@nillion/client-vms/logger"; +} from "#/gen-proto/nillion/compute/v1/invoke_pb"; +import { Compute } from "#/gen-proto/nillion/compute/v1/service_pb"; +import { PriceQuoteRequestSchema } from "#/gen-proto/nillion/payments/v1/quote_pb"; +import type { SignedReceipt } from "#/gen-proto/nillion/payments/v1/receipt_pb"; +import { Log } from "#/logger"; import { InputBindings, OutputBindings, PartyId, ProgramId, Uuid, -} from "@nillion/client-vms/types/types"; -import type { UserId } from "@nillion/client-vms/types/user-id"; -import { collapse } from "@nillion/client-vms/util"; -import type { VmClient } from "@nillion/client-vms/vm/client"; -import type { Operation } from "@nillion/client-vms/vm/operation/operation"; -import { retryGrpcRequestIfRecoverable } from "@nillion/client-vms/vm/operation/retry-client"; -import { - type NadaValue, - NadaValues, - compute_values_size, - encode_values, -} from "@nillion/client-wasm"; -import { Effect as E, pipe } from "effect"; -import { UnknownException } from "effect/Cause"; -import { parse, stringify } from "uuid"; -import { z } from "zod"; +} from "#/types/types"; +import type { UserId } from "#/types/user-id"; +import { collapse } from "#/util"; +import type { VmClient } from "#/vm/client"; +import type { Operation } from "#/vm/operation/operation"; +import { retryGrpcRequestIfRecoverable } from "#/vm/operation/retry-client"; export const InvokeComputeConfig = z.object({ // due to import resolution order we cannot use instanceof because VmClient isn't defined first diff --git a/client-vms/src/vm/operation/overwrite-permissions.ts b/client-vms/src/vm/operation/overwrite-permissions.ts index 884650fc..2680f5f1 100644 --- a/client-vms/src/vm/operation/overwrite-permissions.ts +++ b/client-vms/src/vm/operation/overwrite-permissions.ts @@ -1,23 +1,23 @@ import { create } from "@bufbuild/protobuf"; import { type Client, createClient } from "@connectrpc/connect"; -import { PriceQuoteRequestSchema } from "@nillion/client-vms/gen-proto/nillion/payments/v1/quote_pb"; -import type { SignedReceipt } from "@nillion/client-vms/gen-proto/nillion/payments/v1/receipt_pb"; -import { - type OverwritePermissionsRequest, - OverwritePermissionsRequestSchema, -} from "@nillion/client-vms/gen-proto/nillion/permissions/v1/overwrite_pb"; -import { Permissions as PermissionsService } from "@nillion/client-vms/gen-proto/nillion/permissions/v1/service_pb"; -import { Log } from "@nillion/client-vms/logger"; -import { type PartyId, Uuid } from "@nillion/client-vms/types/types"; -import type { ValuesPermissions } from "@nillion/client-vms/types/values-permissions"; -import { collapse } from "@nillion/client-vms/util"; -import type { VmClient } from "@nillion/client-vms/vm/client"; -import type { Operation } from "@nillion/client-vms/vm/operation/operation"; -import { retryGrpcRequestIfRecoverable } from "@nillion/client-vms/vm/operation/retry-client"; import { Effect as E, pipe } from "effect"; import type { UnknownException } from "effect/Cause"; import { parse as parseUuid } from "uuid"; import { z } from "zod"; +import { PriceQuoteRequestSchema } from "#/gen-proto/nillion/payments/v1/quote_pb"; +import type { SignedReceipt } from "#/gen-proto/nillion/payments/v1/receipt_pb"; +import { + type OverwritePermissionsRequest, + OverwritePermissionsRequestSchema, +} from "#/gen-proto/nillion/permissions/v1/overwrite_pb"; +import { Permissions as PermissionsService } from "#/gen-proto/nillion/permissions/v1/service_pb"; +import { Log } from "#/logger"; +import { type PartyId, Uuid } from "#/types/types"; +import type { ValuesPermissions } from "#/types/values-permissions"; +import { collapse } from "#/util"; +import type { VmClient } from "#/vm/client"; +import type { Operation } from "#/vm/operation/operation"; +import { retryGrpcRequestIfRecoverable } from "#/vm/operation/retry-client"; export const OverwritePermissionsConfig = z.object({ // due to import resolution order we cannot use instanceof because VmClient isn't defined first diff --git a/client-vms/src/vm/operation/query-pool-status.ts b/client-vms/src/vm/operation/query-pool-status.ts index 75007191..fc926e42 100644 --- a/client-vms/src/vm/operation/query-pool-status.ts +++ b/client-vms/src/vm/operation/query-pool-status.ts @@ -1,20 +1,20 @@ import { create } from "@bufbuild/protobuf"; import { type Client, createClient } from "@connectrpc/connect"; +import { Effect as E, pipe } from "effect"; +import type { UnknownException } from "effect/Cause"; +import { z } from "zod"; import { type PoolStatusRequest, PoolStatusRequestSchema, type PoolStatusResponse, -} from "@nillion/client-vms/gen-proto/nillion/leader_queries/v1/pool_status_pb"; -import { LeaderQueries } from "@nillion/client-vms/gen-proto/nillion/leader_queries/v1/service_pb"; -import { PriceQuoteRequestSchema } from "@nillion/client-vms/gen-proto/nillion/payments/v1/quote_pb"; -import type { SignedReceipt } from "@nillion/client-vms/gen-proto/nillion/payments/v1/receipt_pb"; -import { Log } from "@nillion/client-vms/logger"; -import type { VmClient } from "@nillion/client-vms/vm/client"; -import type { Operation } from "@nillion/client-vms/vm/operation/operation"; -import { retryGrpcRequestIfRecoverable } from "@nillion/client-vms/vm/operation/retry-client"; -import { Effect as E, pipe } from "effect"; -import type { UnknownException } from "effect/Cause"; -import { z } from "zod"; +} from "#/gen-proto/nillion/leader_queries/v1/pool_status_pb"; +import { LeaderQueries } from "#/gen-proto/nillion/leader_queries/v1/service_pb"; +import { PriceQuoteRequestSchema } from "#/gen-proto/nillion/payments/v1/quote_pb"; +import type { SignedReceipt } from "#/gen-proto/nillion/payments/v1/receipt_pb"; +import { Log } from "#/logger"; +import type { VmClient } from "#/vm/client"; +import type { Operation } from "#/vm/operation/operation"; +import { retryGrpcRequestIfRecoverable } from "#/vm/operation/retry-client"; export const QueryPoolStatusConfig = z.object({ vm: z.custom(), diff --git a/client-vms/src/vm/operation/retrieve-compute-result.ts b/client-vms/src/vm/operation/retrieve-compute-result.ts index f8f9f7c9..8e0e79c5 100644 --- a/client-vms/src/vm/operation/retrieve-compute-result.ts +++ b/client-vms/src/vm/operation/retrieve-compute-result.ts @@ -1,24 +1,20 @@ import { create } from "@bufbuild/protobuf"; import { type Client, createClient } from "@connectrpc/connect"; -import { - type RetrieveResultsRequest, - RetrieveResultsRequestSchema, -} from "@nillion/client-vms/gen-proto/nillion/compute/v1/retrieve_pb"; -import { Compute } from "@nillion/client-vms/gen-proto/nillion/compute/v1/service_pb"; -import { Log } from "@nillion/client-vms/logger"; -import { - NadaValuesRecord, - type PartyId, - Uuid, -} from "@nillion/client-vms/types/types"; -import type { VmClient } from "@nillion/client-vms/vm/client"; -import type { Operation } from "@nillion/client-vms/vm/operation/operation"; -import { retryGrpcRequestIfRecoverable } from "@nillion/client-vms/vm/operation/retry-client"; import { PartyShares, decode_values } from "@nillion/client-wasm"; import { Effect as E, pipe } from "effect"; import type { UnknownException } from "effect/Cause"; import { parse } from "uuid"; import { z } from "zod"; +import { + type RetrieveResultsRequest, + RetrieveResultsRequestSchema, +} from "#/gen-proto/nillion/compute/v1/retrieve_pb"; +import { Compute } from "#/gen-proto/nillion/compute/v1/service_pb"; +import { Log } from "#/logger"; +import { NadaValuesRecord, type PartyId, Uuid } from "#/types/types"; +import type { VmClient } from "#/vm/client"; +import type { Operation } from "#/vm/operation/operation"; +import { retryGrpcRequestIfRecoverable } from "#/vm/operation/retry-client"; export const RetrieveComputeResultConfig = z.object({ // due to import resolution order we cannot use instanceof because VmClient isn't defined first diff --git a/client-vms/src/vm/operation/retrieve-permissions.ts b/client-vms/src/vm/operation/retrieve-permissions.ts index c2b95be4..eb14aab9 100644 --- a/client-vms/src/vm/operation/retrieve-permissions.ts +++ b/client-vms/src/vm/operation/retrieve-permissions.ts @@ -1,23 +1,23 @@ import { create } from "@bufbuild/protobuf"; import { type Client, createClient } from "@connectrpc/connect"; -import { PriceQuoteRequestSchema } from "@nillion/client-vms/gen-proto/nillion/payments/v1/quote_pb"; -import type { SignedReceipt } from "@nillion/client-vms/gen-proto/nillion/payments/v1/receipt_pb"; -import { - type RetrievePermissionsRequest, - RetrievePermissionsRequestSchema, -} from "@nillion/client-vms/gen-proto/nillion/permissions/v1/retrieve_pb"; -import { Permissions as PermissionsService } from "@nillion/client-vms/gen-proto/nillion/permissions/v1/service_pb"; -import { Log } from "@nillion/client-vms/logger"; -import { type PartyId, Uuid } from "@nillion/client-vms/types/types"; -import { ValuesPermissions } from "@nillion/client-vms/types/values-permissions"; -import { collapse } from "@nillion/client-vms/util"; -import type { VmClient } from "@nillion/client-vms/vm/client"; -import type { Operation } from "@nillion/client-vms/vm/operation/operation"; -import { retryGrpcRequestIfRecoverable } from "@nillion/client-vms/vm/operation/retry-client"; import { Effect as E, pipe } from "effect"; import type { UnknownException } from "effect/Cause"; import { parse as parseUuid } from "uuid"; import { z } from "zod"; +import { PriceQuoteRequestSchema } from "#/gen-proto/nillion/payments/v1/quote_pb"; +import type { SignedReceipt } from "#/gen-proto/nillion/payments/v1/receipt_pb"; +import { + type RetrievePermissionsRequest, + RetrievePermissionsRequestSchema, +} from "#/gen-proto/nillion/permissions/v1/retrieve_pb"; +import { Permissions as PermissionsService } from "#/gen-proto/nillion/permissions/v1/service_pb"; +import { Log } from "#/logger"; +import { type PartyId, Uuid } from "#/types/types"; +import { ValuesPermissions } from "#/types/values-permissions"; +import { collapse } from "#/util"; +import type { VmClient } from "#/vm/client"; +import type { Operation } from "#/vm/operation/operation"; +import { retryGrpcRequestIfRecoverable } from "#/vm/operation/retry-client"; export const RetrievePermissionsConfig = z.object({ // due to import resolution order we cannot use instanceof because VmClient isn't defined first diff --git a/client-vms/src/vm/operation/retrieve-values.ts b/client-vms/src/vm/operation/retrieve-values.ts index dbc6807e..eac03683 100644 --- a/client-vms/src/vm/operation/retrieve-values.ts +++ b/client-vms/src/vm/operation/retrieve-values.ts @@ -1,26 +1,22 @@ import { create } from "@bufbuild/protobuf"; import { type Client, createClient } from "@connectrpc/connect"; -import { PriceQuoteRequestSchema } from "@nillion/client-vms/gen-proto/nillion/payments/v1/quote_pb"; -import type { SignedReceipt } from "@nillion/client-vms/gen-proto/nillion/payments/v1/receipt_pb"; -import { - type RetrieveValuesRequest, - RetrieveValuesRequestSchema, -} from "@nillion/client-vms/gen-proto/nillion/values/v1/retrieve_pb"; -import { Values } from "@nillion/client-vms/gen-proto/nillion/values/v1/service_pb"; -import { Log } from "@nillion/client-vms/logger"; -import { - NadaValuesRecord, - type PartyId, - Uuid, -} from "@nillion/client-vms/types/types"; -import type { VmClient } from "@nillion/client-vms/vm/client"; -import type { Operation } from "@nillion/client-vms/vm/operation/operation"; -import { retryGrpcRequestIfRecoverable } from "@nillion/client-vms/vm/operation/retry-client"; import { PartyShares, decode_values } from "@nillion/client-wasm"; import { Effect as E, pipe } from "effect"; import type { UnknownException } from "effect/Cause"; import { parse as parseUuid } from "uuid"; import { z } from "zod"; +import { PriceQuoteRequestSchema } from "#/gen-proto/nillion/payments/v1/quote_pb"; +import type { SignedReceipt } from "#/gen-proto/nillion/payments/v1/receipt_pb"; +import { + type RetrieveValuesRequest, + RetrieveValuesRequestSchema, +} from "#/gen-proto/nillion/values/v1/retrieve_pb"; +import { Values } from "#/gen-proto/nillion/values/v1/service_pb"; +import { Log } from "#/logger"; +import { NadaValuesRecord, type PartyId, Uuid } from "#/types/types"; +import type { VmClient } from "#/vm/client"; +import type { Operation } from "#/vm/operation/operation"; +import { retryGrpcRequestIfRecoverable } from "#/vm/operation/retry-client"; export const RetrieveValuesConfig = z.object({ // due to import resolution order we cannot use instanceof because VmClient isn't defined first diff --git a/client-vms/src/vm/operation/retry-client.ts b/client-vms/src/vm/operation/retry-client.ts index 3cc5fe40..1867b4ad 100644 --- a/client-vms/src/vm/operation/retry-client.ts +++ b/client-vms/src/vm/operation/retry-client.ts @@ -1,7 +1,7 @@ import { Code, ConnectError } from "@connectrpc/connect"; -import { Log } from "@nillion/client-vms/logger"; import { Duration, Effect as E, Schedule, pipe } from "effect"; import { UnknownException } from "effect/Cause"; +import { Log } from "#/logger"; function isRetryableError(error: unknown): boolean { let cause = error; diff --git a/client-vms/src/vm/operation/store-program.ts b/client-vms/src/vm/operation/store-program.ts index 9e71a066..43cdb6ce 100644 --- a/client-vms/src/vm/operation/store-program.ts +++ b/client-vms/src/vm/operation/store-program.ts @@ -1,31 +1,27 @@ import { create } from "@bufbuild/protobuf"; import { type Client, createClient } from "@connectrpc/connect"; +import { ProgramMetadata } from "@nillion/client-wasm"; +import { sha256 } from "@noble/hashes/sha2"; +import { Effect as E, pipe } from "effect"; +import type { UnknownException } from "effect/Cause"; +import { z } from "zod"; import { type PreprocessingRequirement, PriceQuoteRequestSchema, ProgramMetadataSchema, -} from "@nillion/client-vms/gen-proto/nillion/payments/v1/quote_pb"; -import type { SignedReceipt } from "@nillion/client-vms/gen-proto/nillion/payments/v1/receipt_pb"; -import { Programs } from "@nillion/client-vms/gen-proto/nillion/programs/v1/service_pb"; +} from "#/gen-proto/nillion/payments/v1/quote_pb"; +import type { SignedReceipt } from "#/gen-proto/nillion/payments/v1/receipt_pb"; +import { Programs } from "#/gen-proto/nillion/programs/v1/service_pb"; import { type StoreProgramRequest, StoreProgramRequestSchema, -} from "@nillion/client-vms/gen-proto/nillion/programs/v1/store_pb"; -import { Log } from "@nillion/client-vms/logger"; -import type { PaymentClient } from "@nillion/client-vms/payment/client"; -import { - type PartyId, - ProgramId, - ProgramName, -} from "@nillion/client-vms/types/types"; -import { collapse } from "@nillion/client-vms/util"; -import type { VmClient } from "@nillion/client-vms/vm/client"; -import { retryGrpcRequestIfRecoverable } from "@nillion/client-vms/vm/operation/retry-client"; -import { ProgramMetadata } from "@nillion/client-wasm"; -import { sha256 } from "@noble/hashes/sha2"; -import { Effect as E, pipe } from "effect"; -import type { UnknownException } from "effect/Cause"; -import { z } from "zod"; +} from "#/gen-proto/nillion/programs/v1/store_pb"; +import { Log } from "#/logger"; +import type { PaymentClient } from "#/payment/client"; +import { type PartyId, ProgramId, ProgramName } from "#/types/types"; +import { collapse } from "#/util"; +import type { VmClient } from "#/vm/client"; +import { retryGrpcRequestIfRecoverable } from "#/vm/operation/retry-client"; import type { Operation } from "./operation"; export const StoreProgramConfig = z.object({ diff --git a/client-vms/src/vm/operation/store-values.ts b/client-vms/src/vm/operation/store-values.ts index 6a65dc7a..f2965ced 100644 --- a/client-vms/src/vm/operation/store-values.ts +++ b/client-vms/src/vm/operation/store-values.ts @@ -1,22 +1,5 @@ import { create } from "@bufbuild/protobuf"; import { type Client, createClient } from "@connectrpc/connect"; -import { PriceQuoteRequestSchema } from "@nillion/client-vms/gen-proto/nillion/payments/v1/quote_pb"; -import type { SignedReceipt } from "@nillion/client-vms/gen-proto/nillion/payments/v1/receipt_pb"; -import { Values } from "@nillion/client-vms/gen-proto/nillion/values/v1/service_pb"; -import { - type StoreValuesRequest, - StoreValuesRequestSchema, -} from "@nillion/client-vms/gen-proto/nillion/values/v1/store_pb"; -import { Log } from "@nillion/client-vms/logger"; -import { PartyId, TtlDays, Uuid } from "@nillion/client-vms/types/types"; -import { - type ValuesPermissions, - ValuesPermissionsBuilder, -} from "@nillion/client-vms/types/values-permissions"; -import { collapse } from "@nillion/client-vms/util"; -import type { VmClient } from "@nillion/client-vms/vm/client"; -import type { Operation } from "@nillion/client-vms/vm/operation/operation"; -import { retryGrpcRequestIfRecoverable } from "@nillion/client-vms/vm/operation/retry-client"; import { type NadaValue, NadaValues, @@ -27,6 +10,23 @@ import { Effect as E, pipe } from "effect"; import { UnknownException } from "effect/Cause"; import { parse, stringify } from "uuid"; import { z } from "zod"; +import { PriceQuoteRequestSchema } from "#/gen-proto/nillion/payments/v1/quote_pb"; +import type { SignedReceipt } from "#/gen-proto/nillion/payments/v1/receipt_pb"; +import { Values } from "#/gen-proto/nillion/values/v1/service_pb"; +import { + type StoreValuesRequest, + StoreValuesRequestSchema, +} from "#/gen-proto/nillion/values/v1/store_pb"; +import { Log } from "#/logger"; +import { PartyId, TtlDays, Uuid } from "#/types/types"; +import { + type ValuesPermissions, + ValuesPermissionsBuilder, +} from "#/types/values-permissions"; +import { collapse } from "#/util"; +import type { VmClient } from "#/vm/client"; +import type { Operation } from "#/vm/operation/operation"; +import { retryGrpcRequestIfRecoverable } from "#/vm/operation/retry-client"; export const StoreValuesConfig = z.object({ // due to import resolution order we cannot use instanceof because VmClient isn't defined first diff --git a/client-vms/src/vm/operation/update-permissions.ts b/client-vms/src/vm/operation/update-permissions.ts index 69c0145e..9877e89b 100644 --- a/client-vms/src/vm/operation/update-permissions.ts +++ b/client-vms/src/vm/operation/update-permissions.ts @@ -1,35 +1,31 @@ import { create } from "@bufbuild/protobuf"; import { type Client, createClient } from "@connectrpc/connect"; -import { PriceQuoteRequestSchema } from "@nillion/client-vms/gen-proto/nillion/payments/v1/quote_pb"; -import type { SignedReceipt } from "@nillion/client-vms/gen-proto/nillion/payments/v1/receipt_pb"; -import { Permissions as PermissionsService } from "@nillion/client-vms/gen-proto/nillion/permissions/v1/service_pb"; +import { Effect as E, pipe } from "effect"; +import type { UnknownException } from "effect/Cause"; +import { parse as parseUuid } from "uuid"; +import { z } from "zod"; +import { PriceQuoteRequestSchema } from "#/gen-proto/nillion/payments/v1/quote_pb"; +import type { SignedReceipt } from "#/gen-proto/nillion/payments/v1/receipt_pb"; +import { Permissions as PermissionsService } from "#/gen-proto/nillion/permissions/v1/service_pb"; import { type UpdatePermissionsRequest, UpdatePermissionsRequestSchema, -} from "@nillion/client-vms/gen-proto/nillion/permissions/v1/update_pb"; -import { Log } from "@nillion/client-vms/logger"; +} from "#/gen-proto/nillion/permissions/v1/update_pb"; +import { Log } from "#/logger"; import { ComputePermissionCommand, ComputePermissionCommandBuilder, -} from "@nillion/client-vms/types/compute-permission-command"; +} from "#/types/compute-permission-command"; import { PermissionCommand, PermissionCommandBuilder, -} from "@nillion/client-vms/types/permission-command"; -import { - type PartyId, - type ProgramId, - Uuid, -} from "@nillion/client-vms/types/types"; -import type { UserId } from "@nillion/client-vms/types/user-id"; -import { collapse } from "@nillion/client-vms/util"; -import type { VmClient } from "@nillion/client-vms/vm/client"; -import type { Operation } from "@nillion/client-vms/vm/operation/operation"; -import { retryGrpcRequestIfRecoverable } from "@nillion/client-vms/vm/operation/retry-client"; -import { Effect as E, pipe } from "effect"; -import type { UnknownException } from "effect/Cause"; -import { parse as parseUuid } from "uuid"; -import { z } from "zod"; +} from "#/types/permission-command"; +import { type PartyId, type ProgramId, Uuid } from "#/types/types"; +import type { UserId } from "#/types/user-id"; +import { collapse } from "#/util"; +import type { VmClient } from "#/vm/client"; +import type { Operation } from "#/vm/operation/operation"; +import { retryGrpcRequestIfRecoverable } from "#/vm/operation/retry-client"; export const UpdatePermissionsConfig = z.object({ // due to import resolution order we cannot use instanceof because VmClient isn't defined first diff --git a/client-vms/tests/client.test.ts b/client-vms/tests/client.test.ts index 5539ac82..9e464c08 100644 --- a/client-vms/tests/client.test.ts +++ b/client-vms/tests/client.test.ts @@ -1,13 +1,10 @@ -import { createSignerFromKey } from "@nillion/client-vms/payment"; -import type { ProgramId, Uuid } from "@nillion/client-vms/types"; -import { - type ValuesPermissions, - ValuesPermissionsBuilder, -} from "@nillion/client-vms/types"; -import { type VmClient, VmClientBuilder } from "@nillion/client-vms/vm"; import { NadaValue } from "@nillion/client-wasm"; import { beforeAll, describe, expect, it } from "vitest"; import { ZodError } from "zod"; +import { createSignerFromKey } from "#/payment"; +import type { ProgramId, Uuid } from "#/types"; +import { type ValuesPermissions, ValuesPermissionsBuilder } from "#/types"; +import { type VmClient, VmClientBuilder } from "#/vm"; import { Env, PrivateKeyPerSuite, loadProgram } from "./helpers"; describe("Client", () => { diff --git a/client-vms/tests/payments.test.ts b/client-vms/tests/payments.test.ts index cedd85ab..c9431539 100644 --- a/client-vms/tests/payments.test.ts +++ b/client-vms/tests/payments.test.ts @@ -1,15 +1,15 @@ import { create, fromBinary } from "@bufbuild/protobuf"; import { createGrpcWebTransport } from "@connectrpc/connect-web"; -import { PriceQuoteRequestSchema } from "@nillion/client-vms/gen-proto/nillion/payments/v1/quote_pb"; -import { ReceiptSchema } from "@nillion/client-vms/gen-proto/nillion/payments/v1/receipt_pb"; +import { describe, expect, it } from "vitest"; +import { ZodError } from "zod"; +import { PriceQuoteRequestSchema } from "#/gen-proto/nillion/payments/v1/quote_pb"; +import { ReceiptSchema } from "#/gen-proto/nillion/payments/v1/receipt_pb"; import { type PaymentClient, PaymentClientBuilder, createSignerFromKey, -} from "@nillion/client-vms/payment"; -import { fetchClusterDetails } from "@nillion/client-vms/vm"; -import { describe, expect, it } from "vitest"; -import { ZodError } from "zod"; +} from "#/payment"; +import { fetchClusterDetails } from "#/vm"; import { Env, PrivateKeyPerSuite } from "./helpers"; describe("PaymentClient", () => { diff --git a/client-vms/tests/retry.test.ts b/client-vms/tests/retry.test.ts index 4e063f9e..c2c7eff0 100644 --- a/client-vms/tests/retry.test.ts +++ b/client-vms/tests/retry.test.ts @@ -1,7 +1,7 @@ import { Code, ConnectError } from "@connectrpc/connect"; -import { retryGrpcRequestIfRecoverable } from "@nillion/client-vms/vm/operation/retry-client"; import { Effect as E, pipe } from "effect"; import { describe, expect, it } from "vitest"; +import { retryGrpcRequestIfRecoverable } from "#/vm/operation/retry-client"; describe("Client retry", () => { it("should retry recoverable errors", async () => { diff --git a/client-vms/tests/wasm.test.ts b/client-vms/tests/wasm.test.ts index 2e1caf5b..958813b6 100644 --- a/client-vms/tests/wasm.test.ts +++ b/client-vms/tests/wasm.test.ts @@ -1,6 +1,6 @@ -import { type NadaValuesRecord, PartyId } from "@nillion/client-vms/types"; import { NadaValue, NadaValues } from "@nillion/client-wasm"; import { describe, expect, it } from "vitest"; +import { type NadaValuesRecord, PartyId } from "#/types"; const data = [ { diff --git a/client-vms/tsconfig.build.json b/client-vms/tsconfig.build.json new file mode 100644 index 00000000..b114781b --- /dev/null +++ b/client-vms/tsconfig.build.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": false, + "emitDeclarationOnly": true, + "declaration": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": ["src/**/*"] +} diff --git a/client-vms/tsconfig.json b/client-vms/tsconfig.json index 70aba785..9b9eda11 100644 --- a/client-vms/tsconfig.json +++ b/client-vms/tsconfig.json @@ -1,17 +1,22 @@ { "compilerOptions": { - "allowSyntheticDefaultImports": true, - "esModuleInterop": true, + "target": "es2022", + "lib": ["es2022", "dom"], "module": "esnext", - "moduleResolution": "bundler", + "noEmit": true, - "strict": true, - "target": "esnext", - "allowJs": true, + "moduleResolution": "bundler", + "resolveJsonModule": true, + "isolatedModules": true, + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, + "skipLibCheck": true, - "baseUrl": ".", + "strict": true, + + "baseUrl": "src", "paths": { - "@nillion/client-vms/*": ["src/*"] + "#/*": ["./*"] } } } diff --git a/examples-nextjs/tsconfig.json b/examples-nextjs/tsconfig.json index 0837b218..ed3b6e94 100644 --- a/examples-nextjs/tsconfig.json +++ b/examples-nextjs/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "ES2017", + "target": "es2022", "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, @@ -18,12 +18,9 @@ "name": "next" } ], + "baseUrl": "./app", "paths": { - "#/*": ["./app/*"], - "@nillion/client-vms/*": ["../client-vms/src/*"], - "@nillion/client-vms": ["../client-vms"], - "@nillion/client-react-hooks/*": ["../client-react-hooks/src/*"], - "@nillion/client-react-hooks": ["../client-react-hooks"] + "#/*": ["./*"] } }, "include": [ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3dbd1145..cc1a52f3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -60,9 +60,6 @@ importers: specifier: ^3.23.8 version: 3.23.8 devDependencies: - '@tsconfig/vite-react': - specifier: ^3.0.2 - version: 3.0.2 '@types/debug': specifier: ^4.1.12 version: 4.1.12 @@ -172,11 +169,11 @@ importers: examples-nextjs: dependencies: '@nillion/client-react-hooks': - specifier: workspace:* - version: link:../client-react-hooks + specifier: file:../client-react-hooks + version: file:client-react-hooks '@nillion/client-vms': - specifier: workspace:* - version: link:../client-vms + specifier: file:../client-vms + version: file:client-vms next: specifier: ^15.0.3 version: 15.0.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -934,6 +931,12 @@ packages: cpu: [x64] os: [win32] + '@nillion/client-react-hooks@file:client-react-hooks': + resolution: {directory: client-react-hooks, type: directory} + + '@nillion/client-vms@file:client-vms': + resolution: {directory: client-vms, type: directory} + '@noble/curves@1.3.0': resolution: {integrity: sha512-t01iSXPuN+Eqzb4eBX0S5oubSqXbK/xXa1Ne18Hj8f9pStxztHCE2gfboSp/dZRLSqfuLpRK2nDXDK+W9puocA==} @@ -1106,9 +1109,6 @@ packages: peerDependencies: react: ^18 || ^19 - '@tsconfig/vite-react@3.0.2': - resolution: {integrity: sha512-AFynAtE1Un3Rko20Ghe2mVC/QWD4rStJ2PnyIZU2kzC4UyWpf1YhAEY87GojH/XPZCY8Mdt27gsYyy+6l6HV+w==} - '@types/conventional-commits-parser@5.0.0': resolution: {integrity: sha512-loB369iXNmAZglwWATL+WRe+CRMmmBPtpolYzIebFaX4YA3x+BEfLqhUAV9WanycKI3TG1IMr5bMJDajDKLlUQ==} @@ -3066,6 +3066,38 @@ snapshots: '@next/swc-win32-x64-msvc@15.0.3': optional: true + '@nillion/client-react-hooks@file:client-react-hooks': + dependencies: + '@nillion/client-vms': link:client-vms + '@tanstack/react-query': 5.61.0(react@18.3.1) + debug: 4.3.7 + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + zod: 3.23.8 + transitivePeerDependencies: + - supports-color + + '@nillion/client-vms@file:client-vms': + dependencies: + '@bufbuild/protobuf': 2.2.2 + '@connectrpc/connect': 2.0.0(@bufbuild/protobuf@2.2.2) + '@connectrpc/connect-web': 2.0.0(@bufbuild/protobuf@2.2.2)(@connectrpc/connect@2.0.0(@bufbuild/protobuf@2.2.2)) + '@cosmjs/proto-signing': 0.32.4 + '@cosmjs/stargate': 0.32.4(debug@4.3.7) + '@nillion/client-wasm': link:client-wasm + '@noble/curves': 1.6.0 + '@noble/hashes': 1.5.0 + '@noble/secp256k1': 2.1.0 + bs58: 6.0.0 + debug: 4.3.7 + effect: 3.10.15 + uuid: 11.0.3 + zod: 3.23.8 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + '@noble/curves@1.3.0': dependencies: '@noble/hashes': 1.3.3 @@ -3188,8 +3220,6 @@ snapshots: '@tanstack/query-core': 5.60.6 react: 18.3.1 - '@tsconfig/vite-react@3.0.2': {} - '@types/conventional-commits-parser@5.0.0': dependencies: '@types/node': 22.9.1 From 5cb827cf86b748f325b30af0016f607be097c6ab Mon Sep 17 00:00:00 2001 From: Tim Holmes-Mitra Date: Fri, 22 Nov 2024 12:22:35 +0000 Subject: [PATCH 3/8] feat(vm): remove keplr related code --- client-vms/package.json | 1 - client-vms/src/configs.ts | 8 -------- client-vms/src/payment/wallet.ts | 29 ----------------------------- 3 files changed, 38 deletions(-) delete mode 100644 client-vms/src/configs.ts diff --git a/client-vms/package.json b/client-vms/package.json index d2bb071b..794e955c 100644 --- a/client-vms/package.json +++ b/client-vms/package.json @@ -40,7 +40,6 @@ "devDependencies": { "@bufbuild/buf": "^1.46.0", "@bufbuild/protoc-gen-es": "^2.2.2", - "@keplr-wallet/types": "^0.12.154", "@types/debug": "^4.1.12", "@types/node": "^22.9.0", "@types/uuid": "^10.0.0", diff --git a/client-vms/src/configs.ts b/client-vms/src/configs.ts deleted file mode 100644 index f0214ff1..00000000 --- a/client-vms/src/configs.ts +++ /dev/null @@ -1,8 +0,0 @@ -export const Configs = { - Devnet: { - // assumes default seed "nillion-devnet" - bootnodeUrl: "http://localhost:37939", - nilChainId: "nillion-chain-devnet", - nilChainUrl: "http://localhost:48102", - }, -}; diff --git a/client-vms/src/payment/wallet.ts b/client-vms/src/payment/wallet.ts index 369cd316..90465539 100644 --- a/client-vms/src/payment/wallet.ts +++ b/client-vms/src/payment/wallet.ts @@ -2,38 +2,9 @@ import { DirectSecp256k1Wallet, type OfflineSigner, } from "@cosmjs/proto-signing"; -import type { Keplr, Window as KeplrWindow } from "@keplr-wallet/types"; import { NilChainAddressPrefix, type PrivateKeyBase16 } from "./types"; -declare global { - interface Window extends KeplrWindow {} -} - -export const getKeplr = async (): Promise => { - if (window.keplr) { - return window.keplr; - } - - if (document.readyState === "complete") { - return window.keplr; - } - - return new Promise((resolve) => { - const documentStateChange = (event: Event) => { - if ( - event.target && - (event.target as Document).readyState === "complete" - ) { - resolve(window.keplr); - document.removeEventListener("readystatechange", documentStateChange); - } - }; - - document.addEventListener("readystatechange", documentStateChange); - }); -}; - export const createSignerFromKey = async ( key: PrivateKeyBase16 | string, ): Promise => { From dad5571e6b168fce9faec8c80cbeab16ba12a497 Mon Sep 17 00:00:00 2001 From: Tim Holmes-Mitra Date: Fri, 22 Nov 2024 12:22:59 +0000 Subject: [PATCH 4/8] feat(hooks): improve `createClient` to support v0.7.0 testnet, devnet and keplr --- client-react-hooks/package.json | 5 +- client-react-hooks/src/create-client.ts | 108 +++++++++++++----------- client-react-hooks/src/index.ts | 1 + client-react-hooks/src/keplr.ts | 34 ++++++++ 4 files changed, 99 insertions(+), 49 deletions(-) create mode 100644 client-react-hooks/src/keplr.ts diff --git a/client-react-hooks/package.json b/client-react-hooks/package.json index bd7759a3..1c8c7562 100644 --- a/client-react-hooks/package.json +++ b/client-react-hooks/package.json @@ -29,10 +29,11 @@ "@tanstack/react-query": "^5.59.20", "debug": "^4.3.7", "react": "^18.3.1", - "react-dom": "^18.3.1", - "zod": "^3.23.8" + "react-dom": "^18.3.1" }, "devDependencies": { + "@cosmjs/proto-signing": "^0.32.4", + "@keplr-wallet/types": "^0.12.154", "@types/debug": "^4.1.12", "@types/react": "^18.3.12", "@types/react-dom": "^18.3.1", diff --git a/client-react-hooks/src/create-client.ts b/client-react-hooks/src/create-client.ts index facb7d7a..378948d2 100644 --- a/client-react-hooks/src/create-client.ts +++ b/client-react-hooks/src/create-client.ts @@ -1,65 +1,79 @@ -import { - PrivateKeyBase16, - VmClientBuilder, - createSignerFromKey, -} from "@nillion/client-vms"; -import { z } from "zod"; +import type { OfflineSigner } from "@cosmjs/proto-signing"; +import type { Keplr } from "@keplr-wallet/types"; +import { VmClientBuilder } from "@nillion/client-vms"; +import { createSignerFromKey } from "@nillion/client-vms"; -export type Network = "testnet" | "devnet" | "custom"; +export type TestnetOptions = { + network: "testnet"; + seed: string; + keplr: Keplr; +}; + +export type DevnetOptions = { + network: "devnet"; + seed?: string; + signer?: Keplr | OfflineSigner; +}; -export const ClientConfig = z.object({ - bootnodeUrl: z.string().url(), - chainUrl: z.string().url(), - seed: z.string().min(1), - nilchainPrivateKey0: PrivateKeyBase16, -}); -export type ClientConfig = z.infer; +type Options = DevnetOptions | TestnetOptions; + +const DevnetConfig = { + bootnodeUrl: "http://127.0.0.1:37939", + chainUrl: "http://127.0.0.1:48102", + chainId: "nillion-chain-devnet", + seed: "user-devnet-seed", + nilchainPrivateKey0: + "9a975f567428d054f2bf3092812e6c42f901ce07d9711bc77ee2cd81101f42c5", +}; -const NamedConfig = { - // use with `$ nillion-devnet` default seed - devnet: { - bootnodeUrl: "http://127.0.0.1:37939", - chainUrl: "http://127.0.0.1:48102", - seed: "user-devnet-seed", - nilchainPrivateKey0: - "9a975f567428d054f2bf3092812e6c42f901ce07d9711bc77ee2cd81101f42c5", - }, +const TestnetConfig = { + bootnodeUrl: "https://node-1.photon2.nillion-network.nilogy.xyz:14311/", + chainUrl: "http://rpc.testnet.nilchain-rpc-proxy.nilogy.xyz", + chainId: "nillion-chain-testnet-1", }; -export async function createClient( - network: Network, - overrides?: Partial, -) { +export async function createClient(options: Options) { const builder = new VmClientBuilder(); - switch (network.toLowerCase()) { + switch (options.network.toLowerCase()) { case "devnet": { - const config = { ...NamedConfig.devnet }; - const singer = await createSignerFromKey(config.nilchainPrivateKey0); - builder - .seed(config.seed) - .bootnodeUrl(config.bootnodeUrl) - .chainUrl(config.chainUrl) - .signer(singer); - break; - } - case "custom": { - const { nilchainPrivateKey0, seed, bootnodeUrl, chainUrl } = - ClientConfig.parse(overrides); + const config = options as DevnetOptions; - if (!nilchainPrivateKey0 || !seed || !bootnodeUrl || !chainUrl) { - throw new Error("Missing required config"); + let signer: OfflineSigner; + + if (config.signer) { + if ("getOfflineSigner" in config.signer) { + signer = config.signer.getOfflineSigner(DevnetConfig.chainId); + } else { + signer = config.signer; + } + } else { + signer = await createSignerFromKey(DevnetConfig.nilchainPrivateKey0); } - const singer = await createSignerFromKey(nilchainPrivateKey0); + const seed = config.seed ? config.seed : DevnetConfig.seed; + builder .seed(seed) - .bootnodeUrl(bootnodeUrl) - .chainUrl(chainUrl) - .signer(singer); + .bootnodeUrl(DevnetConfig.bootnodeUrl) + .chainUrl(DevnetConfig.chainUrl) + .signer(signer); + + break; + } + case "testnet": { + const config = options as TestnetOptions; + const signer = config.keplr.getOfflineSigner(TestnetConfig.chainId); + + builder + .seed(config.seed) + .bootnodeUrl(TestnetConfig.bootnodeUrl) + .chainUrl(TestnetConfig.chainUrl) + .signer(signer); + break; } default: { - throw new Error(`Unsupported network: ${network}`); + throw new Error(`Unknown network: ${options.network}`); } } diff --git a/client-react-hooks/src/index.ts b/client-react-hooks/src/index.ts index d42cd316..c5757296 100644 --- a/client-react-hooks/src/index.ts +++ b/client-react-hooks/src/index.ts @@ -1,5 +1,6 @@ export { NillionProvider } from "./nillion-provider"; export { createClient } from "./create-client"; +export { getKeplr } from "./keplr"; export { useNilDeleteValues } from "./use-nil-delete-values"; export { useNilInvokeCompute } from "./use-nil-invoke-compute"; export { useNilOverwritePermissions } from "./use-nil-overwrite-permissions"; diff --git a/client-react-hooks/src/keplr.ts b/client-react-hooks/src/keplr.ts new file mode 100644 index 00000000..e2584d09 --- /dev/null +++ b/client-react-hooks/src/keplr.ts @@ -0,0 +1,34 @@ +import type { Keplr } from "@keplr-wallet/types"; +import type { Window as KeplrWindow } from "@keplr-wallet/types/build/window"; + +declare global { + interface Window extends KeplrWindow {} +} + +export const getKeplr = async (): Promise => { + if (window.keplr) { + return window.keplr; + } + + if (document.readyState === "complete" && window.keplr) { + return window.keplr; + } + + return new Promise((resolve) => { + const documentStateChange = (event: Event) => { + if ( + event.target && + (event.target as Document).readyState === "complete" + ) { + if (window.keplr) { + resolve(window.keplr); + document.removeEventListener("readystatechange", documentStateChange); + } else { + throw new Error("Failed to find keplr"); + } + } + }; + + document.addEventListener("readystatechange", documentStateChange); + }); +}; From fb3ee250a1c805171ec35f5aeb3c953ecec353b5 Mon Sep 17 00:00:00 2001 From: Tim Holmes-Mitra Date: Fri, 22 Nov 2024 12:23:24 +0000 Subject: [PATCH 5/8] feat(nextjs): update example to use testnet + keplr --- .gitignore | 1 + examples-nextjs/app/page.tsx | 12 ++++++-- pnpm-lock.yaml | 58 +++++++----------------------------- 3 files changed, 21 insertions(+), 50 deletions(-) diff --git a/.gitignore b/.gitignore index 3a1f9f2b..34a53bcb 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ dist **/coverage .next !client-wasm/dist +tsconfig.tsbuildinfo __pycache__ venv diff --git a/examples-nextjs/app/page.tsx b/examples-nextjs/app/page.tsx index 9df0ccff..ceb8fb32 100644 --- a/examples-nextjs/app/page.tsx +++ b/examples-nextjs/app/page.tsx @@ -1,6 +1,10 @@ "use client"; -import { NillionProvider, createClient } from "@nillion/client-react-hooks"; +import { + NillionProvider, + createClient, + getKeplr, +} from "@nillion/client-react-hooks"; import type { VmClient } from "@nillion/client-vms"; import { useEffect, useState } from "react"; import { DeleteValues } from "#/components/delete-values"; @@ -20,7 +24,11 @@ export default function Home() { useEffect(() => { const init = async () => { - const client = await createClient("devnet"); + const client = await createClient({ + network: "testnet", + seed: "foobarbaz", + keplr: await getKeplr(), + }); setClient(client); }; void init(); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cc1a52f3..f61de83b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -56,10 +56,13 @@ importers: react-dom: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) - zod: - specifier: ^3.23.8 - version: 3.23.8 devDependencies: + '@cosmjs/proto-signing': + specifier: ^0.32.4 + version: 0.32.4 + '@keplr-wallet/types': + specifier: ^0.12.154 + version: 0.12.156(starknet@6.11.0) '@types/debug': specifier: ^4.1.12 version: 4.1.12 @@ -127,9 +130,6 @@ importers: '@bufbuild/protoc-gen-es': specifier: ^2.2.2 version: 2.2.2(@bufbuild/protobuf@2.2.2) - '@keplr-wallet/types': - specifier: ^0.12.154 - version: 0.12.156(starknet@6.11.0) '@types/debug': specifier: ^4.1.12 version: 4.1.12 @@ -169,11 +169,11 @@ importers: examples-nextjs: dependencies: '@nillion/client-react-hooks': - specifier: file:../client-react-hooks - version: file:client-react-hooks + specifier: workspace:* + version: link:../client-react-hooks '@nillion/client-vms': - specifier: file:../client-vms - version: file:client-vms + specifier: workspace:* + version: link:../client-vms next: specifier: ^15.0.3 version: 15.0.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -931,12 +931,6 @@ packages: cpu: [x64] os: [win32] - '@nillion/client-react-hooks@file:client-react-hooks': - resolution: {directory: client-react-hooks, type: directory} - - '@nillion/client-vms@file:client-vms': - resolution: {directory: client-vms, type: directory} - '@noble/curves@1.3.0': resolution: {integrity: sha512-t01iSXPuN+Eqzb4eBX0S5oubSqXbK/xXa1Ne18Hj8f9pStxztHCE2gfboSp/dZRLSqfuLpRK2nDXDK+W9puocA==} @@ -3066,38 +3060,6 @@ snapshots: '@next/swc-win32-x64-msvc@15.0.3': optional: true - '@nillion/client-react-hooks@file:client-react-hooks': - dependencies: - '@nillion/client-vms': link:client-vms - '@tanstack/react-query': 5.61.0(react@18.3.1) - debug: 4.3.7 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - zod: 3.23.8 - transitivePeerDependencies: - - supports-color - - '@nillion/client-vms@file:client-vms': - dependencies: - '@bufbuild/protobuf': 2.2.2 - '@connectrpc/connect': 2.0.0(@bufbuild/protobuf@2.2.2) - '@connectrpc/connect-web': 2.0.0(@bufbuild/protobuf@2.2.2)(@connectrpc/connect@2.0.0(@bufbuild/protobuf@2.2.2)) - '@cosmjs/proto-signing': 0.32.4 - '@cosmjs/stargate': 0.32.4(debug@4.3.7) - '@nillion/client-wasm': link:client-wasm - '@noble/curves': 1.6.0 - '@noble/hashes': 1.5.0 - '@noble/secp256k1': 2.1.0 - bs58: 6.0.0 - debug: 4.3.7 - effect: 3.10.15 - uuid: 11.0.3 - zod: 3.23.8 - transitivePeerDependencies: - - bufferutil - - supports-color - - utf-8-validate - '@noble/curves@1.3.0': dependencies: '@noble/hashes': 1.3.3 From f58e5fea921b79c7a489dd58fd7accd15ddf9681 Mon Sep 17 00:00:00 2001 From: Tim Holmes-Mitra Date: Fri, 22 Nov 2024 13:05:35 +0000 Subject: [PATCH 6/8] ci: rebuild protobuf ts bindings in scripts --- .github/workflows/cd.yaml | 1 + .github/workflows/ci.yaml | 3 +++ client-wasm/package.json | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index 3b52360b..8385ba2c 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -55,6 +55,7 @@ jobs: registry-url: "https://registry.npmjs.org" - uses: pnpm/action-setup@v4 - run: pnpm install + - run: pnpm --filter "@nillion/client-vms" build:proto - run: pnpm --filter "@nillion/client-vms" build - env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 16e44ab4..e8868c7c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,6 +19,9 @@ jobs: node-version: "23" - uses: pnpm/action-setup@v4 - run: pnpm install + - run: pnpm --filter "@nillion/client-vms" build:proto + - run: pnpm --filter "@nillion/client-vms" build + - run: pnpm --filter "@nillion/client-react-hooks" build - run: pnpm exec biome format - run: pnpm exec biome lint - run: pnpm exec tsc -p client-vms/tsconfig.json diff --git a/client-wasm/package.json b/client-wasm/package.json index c1766b9d..001f6f25 100644 --- a/client-wasm/package.json +++ b/client-wasm/package.json @@ -11,7 +11,7 @@ "scripts": { "typecheck": "echo 'no op'; exit 0", "build:watch": "echo 'no op'; exit 0", - "build": "echo 'no op'; exit 0" + "build": "cp src/index.js dist/index.js" }, "files": ["dist", "commit-sha.txt", "package.json"] } From 9a753e5e3764e1b97f378c3581c38c22818764d5 Mon Sep 17 00:00:00 2001 From: Tim Holmes-Mitra Date: Fri, 22 Nov 2024 13:08:26 +0000 Subject: [PATCH 7/8] ci: set nilup version to `v0.7.0` --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e8868c7c..fad35c63 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -40,7 +40,7 @@ jobs: aws-region: "eu-west-1" - uses: NillionNetwork/nillion-setup-action@main with: - version: "v0.7.0-rc.55" + version: "v0.7.0" - uses: actions/setup-python@v5 with: python-version: "3.12" From 3565b15a1604afbcf555232fd4e79403f7d3136a Mon Sep 17 00:00:00 2001 From: Tim Holmes-Mitra Date: Fri, 22 Nov 2024 12:23:34 +0000 Subject: [PATCH 8/8] chore(release): 0.2.1 --- client-react-hooks/package.json | 2 +- client-vms/package.json | 2 +- examples-nextjs/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client-react-hooks/package.json b/client-react-hooks/package.json index 1c8c7562..79199f53 100644 --- a/client-react-hooks/package.json +++ b/client-react-hooks/package.json @@ -2,7 +2,7 @@ "name": "@nillion/client-react-hooks", "license": "MIT", "author": "devsupport@nillion.com", - "version": "0.2.0", + "version": "0.2.1", "homepage": "https://nillion.pub/client-ts", "repository": { "type": "git", diff --git a/client-vms/package.json b/client-vms/package.json index 794e955c..29b2a613 100644 --- a/client-vms/package.json +++ b/client-vms/package.json @@ -2,7 +2,7 @@ "name": "@nillion/client-vms", "license": "MIT", "author": "devsupport@nillion.com", - "version": "0.2.0", + "version": "0.2.1", "repository": "https://github.com/NillionNetwork/client-ts", "type": "module", "exports": { diff --git a/examples-nextjs/package.json b/examples-nextjs/package.json index 7d6f1644..24e61d5f 100644 --- a/examples-nextjs/package.json +++ b/examples-nextjs/package.json @@ -1,6 +1,6 @@ { "name": "@nillion/examples-nextjs", - "version": "0.2.0", + "version": "0.2.1", "private": true, "scripts": { "dev": "next dev",