@cofhe/sdk 0.2.0 → 0.3.0

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.
Files changed (83) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/chains/defineChain.ts +2 -2
  3. package/chains/types.ts +3 -3
  4. package/core/baseBuilder.ts +18 -18
  5. package/core/client.test.ts +155 -41
  6. package/core/client.ts +72 -32
  7. package/core/clientTypes.ts +28 -18
  8. package/core/config.test.ts +40 -33
  9. package/core/config.ts +56 -51
  10. package/core/consts.ts +22 -0
  11. package/core/decrypt/{MockQueryDecrypterAbi.ts → MockThresholdNetworkAbi.ts} +71 -21
  12. package/core/decrypt/cofheMocksDecryptForTx.ts +142 -0
  13. package/core/decrypt/{cofheMocksSealOutput.ts → cofheMocksDecryptForView.ts} +12 -14
  14. package/core/decrypt/decryptForTxBuilder.ts +340 -0
  15. package/core/decrypt/{decryptHandleBuilder.ts → decryptForViewBuilder.ts} +75 -42
  16. package/core/decrypt/tnDecrypt.ts +232 -0
  17. package/core/decrypt/tnSealOutputV1.ts +5 -5
  18. package/core/decrypt/tnSealOutputV2.ts +27 -27
  19. package/core/encrypt/cofheMocksZkVerifySign.ts +19 -26
  20. package/core/encrypt/encryptInputsBuilder.test.ts +57 -61
  21. package/core/encrypt/encryptInputsBuilder.ts +65 -42
  22. package/core/encrypt/zkPackProveVerify.ts +11 -11
  23. package/core/error.ts +18 -18
  24. package/core/fetchKeys.test.ts +3 -3
  25. package/core/fetchKeys.ts +3 -3
  26. package/core/index.ts +22 -11
  27. package/core/permits.test.ts +5 -6
  28. package/core/permits.ts +5 -4
  29. package/core/utils.ts +10 -10
  30. package/dist/chains.cjs +4 -7
  31. package/dist/chains.d.cts +12 -12
  32. package/dist/chains.d.ts +12 -12
  33. package/dist/chains.js +1 -1
  34. package/dist/{chunk-WGCRJCBR.js → chunk-2TPSCOW3.js} +820 -224
  35. package/dist/{chunk-UGBVZNRT.js → chunk-NWDKXBIP.js} +309 -189
  36. package/dist/{chunk-WEAZ25JO.js → chunk-TBLR7NNE.js} +4 -7
  37. package/dist/{clientTypes-5_1nwtUe.d.cts → clientTypes-6aTZPQ_4.d.ts} +233 -173
  38. package/dist/{clientTypes-Es7fyi65.d.ts → clientTypes-Bhq7pCSA.d.cts} +233 -173
  39. package/dist/core.cjs +1138 -418
  40. package/dist/core.d.cts +37 -24
  41. package/dist/core.d.ts +37 -24
  42. package/dist/core.js +3 -3
  43. package/dist/node.cjs +1082 -370
  44. package/dist/node.d.cts +12 -12
  45. package/dist/node.d.ts +12 -12
  46. package/dist/node.js +8 -8
  47. package/dist/{permit-fUSe6KKq.d.cts → permit-MZ502UBl.d.cts} +30 -33
  48. package/dist/{permit-fUSe6KKq.d.ts → permit-MZ502UBl.d.ts} +30 -33
  49. package/dist/permits.cjs +305 -187
  50. package/dist/permits.d.cts +111 -812
  51. package/dist/permits.d.ts +111 -812
  52. package/dist/permits.js +1 -1
  53. package/dist/types-YiAC4gig.d.cts +33 -0
  54. package/dist/types-YiAC4gig.d.ts +33 -0
  55. package/dist/web.cjs +1085 -373
  56. package/dist/web.d.cts +13 -13
  57. package/dist/web.d.ts +13 -13
  58. package/dist/web.js +10 -10
  59. package/node/client.test.ts +34 -34
  60. package/node/config.test.ts +11 -11
  61. package/node/encryptInputs.test.ts +29 -29
  62. package/node/index.ts +15 -15
  63. package/package.json +3 -3
  64. package/permits/localstorage.test.ts +9 -13
  65. package/permits/onchain-utils.ts +221 -0
  66. package/permits/permit.test.ts +51 -5
  67. package/permits/permit.ts +28 -74
  68. package/permits/store.test.ts +10 -50
  69. package/permits/store.ts +4 -14
  70. package/permits/test-utils.ts +10 -2
  71. package/permits/types.ts +22 -9
  72. package/permits/utils.ts +0 -4
  73. package/permits/validation.test.ts +29 -32
  74. package/permits/validation.ts +112 -194
  75. package/web/client.web.test.ts +34 -34
  76. package/web/config.web.test.ts +11 -11
  77. package/web/encryptInputs.web.test.ts +29 -29
  78. package/web/index.ts +19 -19
  79. package/web/worker.builder.web.test.ts +28 -28
  80. package/web/worker.config.web.test.ts +47 -47
  81. package/web/worker.output.web.test.ts +10 -10
  82. package/dist/types-KImPrEIe.d.cts +0 -48
  83. package/dist/types-KImPrEIe.d.ts +0 -48
@@ -1,18 +1,18 @@
1
- import { arbSepolia as cofhesdkArbSepolia } from '@/chains';
2
- import { Encryptable, FheTypes, type CofhesdkClient, CofhesdkErrorCode, CofhesdkError } from '@/core';
1
+ import { arbSepolia as cofheArbSepolia } from '@/chains';
2
+ import { Encryptable, FheTypes, type CofheClient, CofheErrorCode, CofheError } from '@/core';
3
3
 
4
4
  import { describe, it, expect, beforeAll, beforeEach } from 'vitest';
5
5
  import type { PublicClient, WalletClient } from 'viem';
6
6
  import { createPublicClient, createWalletClient, http } from 'viem';
7
7
  import { privateKeyToAccount } from 'viem/accounts';
8
8
  import { arbitrumSepolia as viemArbitrumSepolia } from 'viem/chains';
9
- import { createCofhesdkClient, createCofhesdkConfig } from './index.js';
9
+ import { createCofheClient, createCofheConfig } from './index.js';
10
10
 
11
11
  // Real test setup - runs in browser with real tfhe
12
12
  const TEST_PRIVATE_KEY = '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80';
13
13
 
14
14
  describe('@cofhe/web - Encrypt Inputs Browser Tests', () => {
15
- let cofhesdkClient: CofhesdkClient;
15
+ let cofheClient: CofheClient;
16
16
  let publicClient: PublicClient;
17
17
  let walletClient: WalletClient;
18
18
 
@@ -32,39 +32,39 @@ describe('@cofhe/web - Encrypt Inputs Browser Tests', () => {
32
32
  });
33
33
 
34
34
  beforeEach(() => {
35
- const config = createCofhesdkConfig({
36
- supportedChains: [cofhesdkArbSepolia],
35
+ const config = createCofheConfig({
36
+ supportedChains: [cofheArbSepolia],
37
37
  });
38
- cofhesdkClient = createCofhesdkClient(config);
38
+ cofheClient = createCofheClient(config);
39
39
  });
40
40
 
41
41
  describe('Browser TFHE Initialization', () => {
42
42
  it('should initialize tfhe on first encryption', async () => {
43
- await cofhesdkClient.connect(publicClient, walletClient);
43
+ await cofheClient.connect(publicClient, walletClient);
44
44
 
45
45
  // This will trigger real TFHE initialization in browser
46
- const result = await cofhesdkClient.encryptInputs([Encryptable.uint128(100n)]).encrypt();
46
+ const result = await cofheClient.encryptInputs([Encryptable.uint128(100n)]).execute();
47
47
 
48
48
  // If we get here, TFHE was initialized successfully
49
49
  expect(result).toBeDefined();
50
50
  }, 60000); // Longer timeout for real operations
51
51
 
52
52
  it('should handle multiple encryptions without re-initializing', async () => {
53
- await cofhesdkClient.connect(publicClient, walletClient);
53
+ await cofheClient.connect(publicClient, walletClient);
54
54
 
55
55
  // First encryption
56
- expect(cofhesdkClient.encryptInputs([Encryptable.uint128(100n)]).encrypt()).resolves.not.toThrow();
56
+ expect(cofheClient.encryptInputs([Encryptable.uint128(100n)]).execute()).resolves.not.toThrow();
57
57
 
58
58
  // Second encryption should reuse initialization
59
- expect(cofhesdkClient.encryptInputs([Encryptable.uint64(50n)]).encrypt()).resolves.not.toThrow();
59
+ expect(cofheClient.encryptInputs([Encryptable.uint64(50n)]).execute()).resolves.not.toThrow();
60
60
  }, 60000);
61
61
  });
62
62
 
63
63
  describe('Browser Encryption', () => {
64
64
  it('should encrypt a bool with real TFHE in browser', async () => {
65
- await cofhesdkClient.connect(publicClient, walletClient);
65
+ await cofheClient.connect(publicClient, walletClient);
66
66
 
67
- const result = await cofhesdkClient.encryptInputs([Encryptable.bool(true)]).encrypt();
67
+ const result = await cofheClient.encryptInputs([Encryptable.bool(true)]).execute();
68
68
 
69
69
  expect(result).toBeDefined();
70
70
  expect(result.length).toBe(1);
@@ -77,7 +77,7 @@ describe('@cofhe/web - Encrypt Inputs Browser Tests', () => {
77
77
  }, 60000);
78
78
 
79
79
  it('should encrypt all supported types together', async () => {
80
- await cofhesdkClient.connect(publicClient, walletClient);
80
+ await cofheClient.connect(publicClient, walletClient);
81
81
 
82
82
  const inputs = [
83
83
  Encryptable.bool(false),
@@ -89,7 +89,7 @@ describe('@cofhe/web - Encrypt Inputs Browser Tests', () => {
89
89
  Encryptable.address('0x742d35Cc6634C0532925a3b844D16faC4c175E99'),
90
90
  ];
91
91
 
92
- const result = await cofhesdkClient.encryptInputs(inputs).encrypt();
92
+ const result = await cofheClient.encryptInputs(inputs).execute();
93
93
  expect(result).toBeDefined();
94
94
 
95
95
  expect(result.length).toBe(7);
@@ -106,15 +106,15 @@ describe('@cofhe/web - Encrypt Inputs Browser Tests', () => {
106
106
 
107
107
  describe('Browser Builder Pattern', () => {
108
108
  it('should support chaining builder methods with real encryption', async () => {
109
- await cofhesdkClient.connect(publicClient, walletClient);
109
+ await cofheClient.connect(publicClient, walletClient);
110
110
 
111
- const snapshot = cofhesdkClient.getSnapshot();
112
- const encrypted = await cofhesdkClient
111
+ const snapshot = cofheClient.getSnapshot();
112
+ const encrypted = await cofheClient
113
113
  .encryptInputs([Encryptable.uint128(100n)])
114
114
  .setChainId(snapshot.chainId!)
115
115
  .setAccount(snapshot.account!)
116
116
  .setSecurityZone(0)
117
- .encrypt();
117
+ .execute();
118
118
 
119
119
  expect(encrypted.length).toBe(1);
120
120
  expect(encrypted[0].utype).toBe(FheTypes.Uint128);
@@ -125,41 +125,41 @@ describe('@cofhe/web - Encrypt Inputs Browser Tests', () => {
125
125
  it('should fail gracefully when not connected', async () => {
126
126
  // Don't connect the client
127
127
  try {
128
- const promise = cofhesdkClient.encryptInputs([Encryptable.uint128(100n)]).encrypt();
128
+ const promise = cofheClient.encryptInputs([Encryptable.uint128(100n)]).execute();
129
129
  } catch (error) {
130
- expect(error).toBeInstanceOf(CofhesdkError);
131
- expect((error as CofhesdkError).code).toBe(CofhesdkErrorCode.NotConnected);
130
+ expect(error).toBeInstanceOf(CofheError);
131
+ expect((error as CofheError).code).toBe(CofheErrorCode.NotConnected);
132
132
  }
133
133
  }, 30000);
134
134
 
135
135
  it('should handle invalid CoFHE URL', async () => {
136
- const badConfig = createCofhesdkConfig({
136
+ const badConfig = createCofheConfig({
137
137
  supportedChains: [
138
138
  {
139
- ...cofhesdkArbSepolia,
139
+ ...cofheArbSepolia,
140
140
  coFheUrl: 'http://invalid-cofhe-url.local',
141
141
  verifierUrl: 'http://invalid-verifier-url.local',
142
142
  },
143
143
  ],
144
144
  });
145
145
 
146
- const badClient = createCofhesdkClient(badConfig);
146
+ const badClient = createCofheClient(badConfig);
147
147
  await badClient.connect(publicClient, walletClient);
148
148
 
149
- const promise = badClient.encryptInputs([Encryptable.uint128(100n)]).encrypt();
149
+ const promise = badClient.encryptInputs([Encryptable.uint128(100n)]).execute();
150
150
  expect(promise).rejects.toThrow();
151
151
  }, 60000);
152
152
  });
153
153
 
154
154
  describe('Browser Performance', () => {
155
155
  it('should handle consecutive encryptions efficiently', async () => {
156
- await cofhesdkClient.connect(publicClient, walletClient);
156
+ await cofheClient.connect(publicClient, walletClient);
157
157
 
158
158
  const start = Date.now();
159
159
 
160
160
  // Perform 5 encryptions
161
161
  for (let i = 0; i < 5; i++) {
162
- await cofhesdkClient.encryptInputs([Encryptable.uint128(BigInt(i))]).encrypt();
162
+ await cofheClient.encryptInputs([Encryptable.uint128(BigInt(i))]).execute();
163
163
  }
164
164
 
165
165
  const duration = Date.now() - start;
package/web/index.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  // Web specific functionality only
2
2
 
3
3
  import {
4
- createCofhesdkClientBase,
5
- createCofhesdkConfigBase,
6
- type CofhesdkClient,
7
- type CofhesdkConfig,
8
- type CofhesdkInputConfig,
4
+ createCofheClientBase,
5
+ createCofheConfigBase,
6
+ type CofheClient,
7
+ type CofheConfig,
8
+ type CofheInputConfig,
9
9
  type ZkBuilderAndCrsGenerator,
10
10
  type FheKeyDeserializer,
11
11
  type EncryptableItem,
@@ -95,12 +95,12 @@ async function zkProveWithWorker(
95
95
  }
96
96
 
97
97
  /**
98
- * Creates a CoFHE SDK configuration for web with IndexedDB storage as default
99
- * @param config - The CoFHE SDK input configuration (fheKeyStorage will default to IndexedDB if not provided)
100
- * @returns The CoFHE SDK configuration with web defaults applied
98
+ * Creates a CoFHE configuration for web with IndexedDB storage as default
99
+ * @param config - The CoFHE input configuration (fheKeyStorage will default to IndexedDB if not provided)
100
+ * @returns The CoFHE configuration with web defaults applied
101
101
  */
102
- export function createCofhesdkConfig(config: CofhesdkInputConfig): CofhesdkConfig {
103
- return createCofhesdkConfigBase({
102
+ export function createCofheConfig(config: CofheInputConfig): CofheConfig {
103
+ return createCofheConfigBase({
104
104
  environment: 'web',
105
105
  ...config,
106
106
  fheKeyStorage: config.fheKeyStorage === null ? null : config.fheKeyStorage ?? createWebStorage(),
@@ -108,14 +108,14 @@ export function createCofhesdkConfig(config: CofhesdkInputConfig): CofhesdkConfi
108
108
  }
109
109
 
110
110
  /**
111
- * Creates a CoFHE SDK client instance for web with TFHE automatically configured
111
+ * Creates a CoFHE client instance for web with TFHE automatically configured
112
112
  * TFHE will be initialized automatically on first encryption - no manual setup required
113
113
  * Workers are automatically enabled if available (can be disabled via config.useWorkers)
114
- * @param config - The CoFHE SDK configuration (use createCofhesdkConfig to create with web defaults)
115
- * @returns The CoFHE SDK client instance
114
+ * @param config - The CoFHE configuration (use createCofheConfig to create with web defaults)
115
+ * @returns The CoFHE client instance
116
116
  */
117
- export function createCofhesdkClient<TConfig extends CofhesdkConfig>(config: TConfig): CofhesdkClient<TConfig> {
118
- return createCofhesdkClientBase({
117
+ export function createCofheClient<TConfig extends CofheConfig>(config: TConfig): CofheClient<TConfig> {
118
+ return createCofheClientBase({
119
119
  config,
120
120
  zkBuilderAndCrsGenerator,
121
121
  tfhePublicKeyDeserializer,
@@ -141,16 +141,16 @@ export { areWorkersAvailable };
141
141
  * Test helper: Create a client with custom worker function (for testing fallback behavior)
142
142
  * @internal - Only for testing purposes
143
143
  */
144
- export function createCofhesdkClientWithCustomWorker(
145
- config: CofhesdkConfig,
144
+ export function createCofheClientWithCustomWorker(
145
+ config: CofheConfig,
146
146
  customZkProveWorkerFn: (
147
147
  fheKeyHex: string,
148
148
  crsHex: string,
149
149
  items: EncryptableItem[],
150
150
  metadata: Uint8Array
151
151
  ) => Promise<Uint8Array>
152
- ): CofhesdkClient {
153
- return createCofhesdkClientBase({
152
+ ): CofheClient {
153
+ return createCofheClientBase({
154
154
  config,
155
155
  zkBuilderAndCrsGenerator,
156
156
  tfhePublicKeyDeserializer,
@@ -1,7 +1,7 @@
1
1
  import { describe, it, expect, beforeAll, beforeEach } from 'vitest';
2
- import { createCofhesdkClient, createCofhesdkConfig } from './index.js';
3
- import { Encryptable, type CofhesdkClient } from '@/core';
4
- import { arbSepolia as cofhesdkArbSepolia } from '@/chains';
2
+ import { createCofheClient, createCofheConfig } from './index.js';
3
+ import { Encryptable, type CofheClient } from '@/core';
4
+ import { arbSepolia as cofheArbSepolia } from '@/chains';
5
5
  import { arbitrumSepolia as viemArbitrumSepolia } from 'viem/chains';
6
6
  import { createPublicClient, createWalletClient, http, type PublicClient, type WalletClient } from 'viem';
7
7
  import { privateKeyToAccount } from 'viem/accounts';
@@ -9,7 +9,7 @@ import { privateKeyToAccount } from 'viem/accounts';
9
9
  const TEST_PRIVATE_KEY = '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80';
10
10
 
11
11
  describe('@cofhe/sdk/web - EncryptInputsBuilder Worker Methods', () => {
12
- let cofhesdkClient: CofhesdkClient;
12
+ let cofheClient: CofheClient;
13
13
  let publicClient: PublicClient;
14
14
  let walletClient: WalletClient;
15
15
 
@@ -28,23 +28,23 @@ describe('@cofhe/sdk/web - EncryptInputsBuilder Worker Methods', () => {
28
28
  });
29
29
 
30
30
  beforeEach(async () => {
31
- const config = createCofhesdkConfig({
32
- supportedChains: [cofhesdkArbSepolia],
31
+ const config = createCofheConfig({
32
+ supportedChains: [cofheArbSepolia],
33
33
  });
34
- cofhesdkClient = createCofhesdkClient(config);
35
- await cofhesdkClient.connect(publicClient, walletClient);
34
+ cofheClient = createCofheClient(config);
35
+ await cofheClient.connect(publicClient, walletClient);
36
36
  });
37
37
 
38
38
  describe('setUseWorker method', () => {
39
39
  it('should have setUseWorker method on EncryptInputsBuilder', () => {
40
- const builder = cofhesdkClient.encryptInputs([Encryptable.uint128(100n)]);
40
+ const builder = cofheClient.encryptInputs([Encryptable.uint128(100n)]);
41
41
 
42
42
  expect(builder).toHaveProperty('setUseWorker');
43
43
  expect(typeof builder.setUseWorker).toBe('function');
44
44
  });
45
45
 
46
46
  it('should return builder for method chaining', () => {
47
- const builder = cofhesdkClient.encryptInputs([Encryptable.uint128(100n)]);
47
+ const builder = cofheClient.encryptInputs([Encryptable.uint128(100n)]);
48
48
  const returnedBuilder = builder.setUseWorker(false);
49
49
 
50
50
  // Should return the same builder instance (or at least same type)
@@ -53,37 +53,37 @@ describe('@cofhe/sdk/web - EncryptInputsBuilder Worker Methods', () => {
53
53
 
54
54
  it('should allow chaining with other builder methods', () => {
55
55
  // Should be able to chain setUseWorker with setStepCallback
56
- const builder = cofhesdkClient
56
+ const builder = cofheClient
57
57
  .encryptInputs([Encryptable.uint128(100n)])
58
58
  .setUseWorker(false)
59
- .setStepCallback(() => {});
59
+ .onStep(() => {});
60
60
 
61
61
  expect(builder).toBeDefined();
62
- expect(builder).toHaveProperty('encrypt');
62
+ expect(builder).toHaveProperty('execute');
63
63
  });
64
64
 
65
65
  it('should accept true parameter', () => {
66
66
  expect(() => {
67
- cofhesdkClient.encryptInputs([Encryptable.uint128(100n)]).setUseWorker(true);
67
+ cofheClient.encryptInputs([Encryptable.uint128(100n)]).setUseWorker(true);
68
68
  }).not.toThrow();
69
69
  });
70
70
 
71
71
  it('should accept false parameter', () => {
72
72
  expect(() => {
73
- cofhesdkClient.encryptInputs([Encryptable.uint128(100n)]).setUseWorker(false);
73
+ cofheClient.encryptInputs([Encryptable.uint128(100n)]).setUseWorker(false);
74
74
  }).not.toThrow();
75
75
  });
76
76
 
77
77
  it('should have getUseWorker method', () => {
78
- const builder = cofhesdkClient.encryptInputs([Encryptable.uint128(100n)]);
78
+ const builder = cofheClient.encryptInputs([Encryptable.uint128(100n)]);
79
79
 
80
80
  expect(builder).toHaveProperty('getUseWorker');
81
81
  expect(typeof builder.getUseWorker).toBe('function');
82
82
  });
83
83
 
84
84
  it('should return current useWorker value', () => {
85
- const builderWithWorkers = cofhesdkClient.encryptInputs([Encryptable.uint128(100n)]).setUseWorker(true);
86
- const builderWithoutWorkers = cofhesdkClient.encryptInputs([Encryptable.uint128(100n)]).setUseWorker(false);
85
+ const builderWithWorkers = cofheClient.encryptInputs([Encryptable.uint128(100n)]).setUseWorker(true);
86
+ const builderWithoutWorkers = cofheClient.encryptInputs([Encryptable.uint128(100n)]).setUseWorker(false);
87
87
 
88
88
  // Should reflect config values
89
89
  expect(builderWithWorkers.getUseWorker()).toBe(true);
@@ -91,7 +91,7 @@ describe('@cofhe/sdk/web - EncryptInputsBuilder Worker Methods', () => {
91
91
  });
92
92
 
93
93
  it('should reflect changes from setUseWorker', () => {
94
- const builder = cofhesdkClient.encryptInputs([Encryptable.uint128(100n)]).setUseWorker(true);
94
+ const builder = cofheClient.encryptInputs([Encryptable.uint128(100n)]).setUseWorker(true);
95
95
  expect(builder.getUseWorker()).toBe(true);
96
96
 
97
97
  builder.setUseWorker(false);
@@ -104,23 +104,23 @@ describe('@cofhe/sdk/web - EncryptInputsBuilder Worker Methods', () => {
104
104
 
105
105
  describe('Worker function availability', () => {
106
106
  it('should initialize client without errors', () => {
107
- const config = createCofhesdkConfig({
108
- supportedChains: [cofhesdkArbSepolia],
107
+ const config = createCofheConfig({
108
+ supportedChains: [cofheArbSepolia],
109
109
  useWorkers: true,
110
110
  });
111
111
 
112
112
  expect(() => {
113
- createCofhesdkClient(config);
113
+ createCofheClient(config);
114
114
  }).not.toThrow();
115
115
  });
116
116
 
117
117
  it('should handle worker function when workers enabled', async () => {
118
- const config = createCofhesdkConfig({
119
- supportedChains: [cofhesdkArbSepolia],
118
+ const config = createCofheConfig({
119
+ supportedChains: [cofheArbSepolia],
120
120
  useWorkers: true,
121
121
  });
122
122
 
123
- const client = createCofhesdkClient(config);
123
+ const client = createCofheClient(config);
124
124
  await client.connect(publicClient, walletClient);
125
125
  const builder = client.encryptInputs([Encryptable.uint128(100n)]);
126
126
 
@@ -131,12 +131,12 @@ describe('@cofhe/sdk/web - EncryptInputsBuilder Worker Methods', () => {
131
131
  });
132
132
 
133
133
  it('should handle when workers disabled', async () => {
134
- const config = createCofhesdkConfig({
135
- supportedChains: [cofhesdkArbSepolia],
134
+ const config = createCofheConfig({
135
+ supportedChains: [cofheArbSepolia],
136
136
  useWorkers: false,
137
137
  });
138
138
 
139
- const client = createCofhesdkClient(config);
139
+ const client = createCofheClient(config);
140
140
  await client.connect(publicClient, walletClient);
141
141
  const builder = client.encryptInputs([Encryptable.uint128(100n)]);
142
142