@inco/js 0.1.9 → 0.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,20 @@
1
+ import { Account, Address, Chain, Transport, WalletClient } from 'viem';
2
+ import { CiphertextOf, EncryptionScheme, PlaintextOf, SupportedFheType } from '../encryption/encryption';
3
+ import { HandleOf } from '../handle';
4
+ import { FheEnvQuerier, ReencryptEndpoint, SupportedEphemeralKeypairs } from './types';
5
+ export type ReencryptArgs<S extends EncryptionScheme, T extends SupportedFheType> = {
6
+ handle: HandleOf<T>;
7
+ ciphertext?: CiphertextOf<S, T>;
8
+ };
9
+ export type Reencryptor<S extends EncryptionScheme> = <T extends SupportedFheType>(args: ReencryptArgs<S, T>) => Promise<PlaintextOf<S, T>>;
10
+ export interface ReencryptorArgs<EKP extends SupportedEphemeralKeypairs> {
11
+ kmsSigners?: Address[];
12
+ chainId: bigint;
13
+ contractAddress: Address;
14
+ fheEnvQuerier: FheEnvQuerier;
15
+ walletClient: WalletClient<Transport, Chain, Account>;
16
+ skipQueryACLBeforeReencrypt?: boolean;
17
+ unsafeSkipVerifyKMSSignatures?: boolean;
18
+ reencryptEndpoint: ReencryptEndpoint<EKP>;
19
+ }
20
+ export declare function getReencryptor<EKP extends SupportedEphemeralKeypairs>({ chainId, contractAddress, walletClient, kmsSigners: _kmsSigners, skipQueryACLBeforeReencrypt, unsafeSkipVerifyKMSSignatures, reencryptEndpoint, fheEnvQuerier, }: ReencryptorArgs<EKP>): Promise<Reencryptor<EKP['scheme']>>;
package/dist/viem.d.ts CHANGED
@@ -378,6 +378,49 @@ export declare const chains: {
378
378
  formatters?: undefined;
379
379
  serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
380
380
  };
381
+ anvil: {
382
+ blockExplorers?: {
383
+ [key: string]: {
384
+ name: string;
385
+ url: string;
386
+ apiUrl?: string | undefined;
387
+ };
388
+ default: {
389
+ name: string;
390
+ url: string;
391
+ apiUrl?: string | undefined;
392
+ };
393
+ } | undefined;
394
+ contracts?: import("viem/chains").Prettify<{
395
+ [key: string]: import("viem").ChainContract | {
396
+ [sourceId: number]: import("viem").ChainContract | undefined;
397
+ } | undefined;
398
+ } & {
399
+ ensRegistry?: import("viem").ChainContract | undefined;
400
+ ensUniversalResolver?: import("viem").ChainContract | undefined;
401
+ multicall3?: import("viem").ChainContract | undefined;
402
+ universalSignatureVerifier?: import("viem").ChainContract | undefined;
403
+ }> | undefined;
404
+ id: 31337;
405
+ name: "Anvil";
406
+ nativeCurrency: {
407
+ readonly decimals: 18;
408
+ readonly name: "Ether";
409
+ readonly symbol: "ETH";
410
+ };
411
+ rpcUrls: {
412
+ readonly default: {
413
+ readonly http: readonly ["http://127.0.0.1:8545"];
414
+ readonly webSocket: readonly ["ws://127.0.0.1:8545"];
415
+ };
416
+ };
417
+ sourceId?: number | undefined;
418
+ testnet?: boolean | undefined;
419
+ custom?: Record<string, unknown> | undefined;
420
+ fees?: import("viem").ChainFees<undefined> | undefined;
421
+ formatters?: undefined;
422
+ serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
423
+ };
381
424
  };
382
425
  type ChainName = keyof typeof chains;
383
426
  export type ViemChain = (typeof chains)[ChainName];
package/package.json CHANGED
@@ -1,37 +1,8 @@
1
1
  {
2
2
  "name": "@inco/js",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "repository": "https://github.com/Inco-fhevm/inco-monorepo",
5
- "scripts": {
6
- "test": "bun run lint && bun run test:tsc && bun run test:unit",
7
- "test:tsc": "tsc --noEmit",
8
- "test:unit": "bun vitest run --project unit",
9
- "test:e2e": "bun vitest run --project e2e",
10
- "lint": "bun prettier --check .",
11
- "lint:fix": "bun prettier --write .",
12
- "build:declarations": "tsc --emitDeclarationOnly --project tsconfig.dist.json",
13
- "build:bundle": "bun run build.ts",
14
- "build": "bun run build:generate && bun run build:bundle && bun run build:declarations",
15
- "build:generate": "bun run generate && bun run build.ts",
16
- "generate:protos": "buf generate && buf generate --template buf.gen.ts-proto.yaml",
17
- "generate:abis": "wagmi generate",
18
- "generate:local": "bun generate.ts",
19
- "generate": "bun generate:protos && bun generate:abis && bun generate:local",
20
- "publish:npm": "bun run build && bun publish"
21
- },
22
- "publishConfig": {
23
- "access": "public",
24
- "registry": "https://registry.npmjs.org/"
25
- },
26
5
  "license": "Apache-2.0",
27
- "files": [
28
- "dist/**",
29
- "LICENSE",
30
- "README.md"
31
- ],
32
- "main": "dist/index.cjs",
33
- "module": "dist/index.mjs",
34
- "types": "dist/index.d.ts",
35
6
  "exports": {
36
7
  "./package.json": "./package.json",
37
8
  ".": {
@@ -60,6 +31,31 @@
60
31
  "default": "./dist/reencryption/index.cjs"
61
32
  }
62
33
  },
34
+ "main": "dist/index.cjs",
35
+ "module": "dist/index.mjs",
36
+ "types": "dist/index.d.ts",
37
+ "files": [
38
+ "dist/**",
39
+ "LICENSE",
40
+ "README.md"
41
+ ],
42
+ "scripts": {
43
+ "build": "bun run build:generate && bun run build:bundle && bun run build:declarations",
44
+ "build:bundle": "bun run build.ts",
45
+ "build:declarations": "tsc --emitDeclarationOnly --project tsconfig.dist.json",
46
+ "build:generate": "bun run generate && bun run build.ts",
47
+ "generate": "bun generate:protos && bun generate:abis && bun generate:local",
48
+ "generate:abis": "wagmi generate",
49
+ "generate:local": "bun generate.ts",
50
+ "generate:protos": "buf generate && buf generate --template buf.gen.ts-proto.yaml",
51
+ "lint": "bun prettier --check .",
52
+ "lint:fix": "bun prettier --write .",
53
+ "publish:npm": "bun run build && bun publish",
54
+ "test": "bun run lint && bun run test:tsc && bun run test:unit",
55
+ "test:e2e": "bun vitest run --project e2e",
56
+ "test:tsc": "tsc --noEmit",
57
+ "test:unit": "bun vitest run --project unit"
58
+ },
63
59
  "dependencies": {
64
60
  "@bufbuild/protobuf": "^2.2.3",
65
61
  "@connectrpc/connect": "^2.0.0",
@@ -88,5 +84,9 @@
88
84
  "ts-proto": "^2.6.1",
89
85
  "typescript": "^5.7.3",
90
86
  "vitest": "^3.0.4"
87
+ },
88
+ "publishConfig": {
89
+ "access": "public",
90
+ "registry": "https://registry.npmjs.org/"
91
91
  }
92
92
  }