nova-privacy-sdk 1.0.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 (69) hide show
  1. package/.github/workflows/npm-publish.yml +55 -0
  2. package/PUBLISH.md +122 -0
  3. package/README.md +177 -0
  4. package/__tests__/e2e.test.ts +56 -0
  5. package/__tests__/e2espl.test.ts +73 -0
  6. package/__tests__/encryption.test.ts +1635 -0
  7. package/circuit2/transaction2.wasm +0 -0
  8. package/circuit2/transaction2.zkey +0 -0
  9. package/dist/config.d.ts +9 -0
  10. package/dist/config.js +12 -0
  11. package/dist/deposit.d.ts +18 -0
  12. package/dist/deposit.js +392 -0
  13. package/dist/depositSPL.d.ts +20 -0
  14. package/dist/depositSPL.js +448 -0
  15. package/dist/exportUtils.d.ts +11 -0
  16. package/dist/exportUtils.js +11 -0
  17. package/dist/getUtxos.d.ts +29 -0
  18. package/dist/getUtxos.js +294 -0
  19. package/dist/getUtxosSPL.d.ts +33 -0
  20. package/dist/getUtxosSPL.js +395 -0
  21. package/dist/index.d.ts +125 -0
  22. package/dist/index.js +302 -0
  23. package/dist/models/keypair.d.ts +26 -0
  24. package/dist/models/keypair.js +43 -0
  25. package/dist/models/utxo.d.ts +49 -0
  26. package/dist/models/utxo.js +85 -0
  27. package/dist/utils/address_lookup_table.d.ts +9 -0
  28. package/dist/utils/address_lookup_table.js +45 -0
  29. package/dist/utils/constants.d.ts +31 -0
  30. package/dist/utils/constants.js +62 -0
  31. package/dist/utils/encryption.d.ts +107 -0
  32. package/dist/utils/encryption.js +376 -0
  33. package/dist/utils/logger.d.ts +9 -0
  34. package/dist/utils/logger.js +35 -0
  35. package/dist/utils/merkle_tree.d.ts +92 -0
  36. package/dist/utils/merkle_tree.js +186 -0
  37. package/dist/utils/node-shim.d.ts +5 -0
  38. package/dist/utils/node-shim.js +5 -0
  39. package/dist/utils/prover.d.ts +36 -0
  40. package/dist/utils/prover.js +147 -0
  41. package/dist/utils/utils.d.ts +69 -0
  42. package/dist/utils/utils.js +182 -0
  43. package/dist/withdraw.d.ts +21 -0
  44. package/dist/withdraw.js +270 -0
  45. package/dist/withdrawSPL.d.ts +23 -0
  46. package/dist/withdrawSPL.js +306 -0
  47. package/package.json +77 -0
  48. package/setup-git.sh +51 -0
  49. package/setup-github.sh +36 -0
  50. package/src/config.ts +22 -0
  51. package/src/deposit.ts +487 -0
  52. package/src/depositSPL.ts +567 -0
  53. package/src/exportUtils.ts +13 -0
  54. package/src/getUtxos.ts +396 -0
  55. package/src/getUtxosSPL.ts +528 -0
  56. package/src/index.ts +350 -0
  57. package/src/models/keypair.ts +52 -0
  58. package/src/models/utxo.ts +106 -0
  59. package/src/utils/address_lookup_table.ts +78 -0
  60. package/src/utils/constants.ts +84 -0
  61. package/src/utils/encryption.ts +464 -0
  62. package/src/utils/logger.ts +42 -0
  63. package/src/utils/merkle_tree.ts +207 -0
  64. package/src/utils/node-shim.ts +6 -0
  65. package/src/utils/prover.ts +222 -0
  66. package/src/utils/utils.ts +242 -0
  67. package/src/withdraw.ts +332 -0
  68. package/src/withdrawSPL.ts +394 -0
  69. package/tsconfig.json +28 -0
@@ -0,0 +1,394 @@
1
+ import { Connection, Keypair, PublicKey, Transaction, TransactionInstruction, VersionedTransaction } from '@solana/web3.js';
2
+ import BN from 'bn.js';
3
+ import { Buffer } from 'buffer';
4
+ import { Keypair as UtxoKeypair } from './models/keypair.js';
5
+ import * as hasher from '@lightprotocol/hasher.rs';
6
+ import { Utxo } from './models/utxo.js';
7
+ import { parseProofToBytesArray, parseToBytesArray, prove } from './utils/prover.js';
8
+
9
+ import { ALT_ADDRESS, FEE_RECIPIENT, FIELD_SIZE, RELAYER_API_URL, MERKLE_TREE_DEPTH, PROGRAM_ID, SplList, tokens } from './utils/constants.js';
10
+ import { EncryptionService, serializeProofAndExtData } from './utils/encryption.js';
11
+ import { fetchMerkleProof, findNullifierPDAs, getProgramAccounts, queryRemoteTreeState, findCrossCheckNullifierPDAs, getMintAddressField, getExtDataHash, getTreeAccountForToken } from './utils/utils.js';
12
+
13
+ import { getUtxosSPL, isUtxoSpent } from './getUtxosSPL.js';
14
+ import { logger } from './utils/logger.js';
15
+ import { getConfig } from './config.js';
16
+ import { getAssociatedTokenAddressSync, getMint } from '@solana/spl-token';
17
+ // Indexer API endpoint
18
+
19
+
20
+ // Function to submit withdraw request to indexer backend
21
+ async function submitWithdrawToIndexer(params: any): Promise<string> {
22
+ try {
23
+ const response = await fetch(`${RELAYER_API_URL}/withdraw/spl`, {
24
+ method: 'POST',
25
+ headers: {
26
+ 'Content-Type': 'application/json',
27
+ },
28
+ body: JSON.stringify(params)
29
+ });
30
+
31
+ if (!response.ok) {
32
+ const errorData = await response.json() as { error?: string };
33
+ throw new Error(errorData.error)
34
+ }
35
+
36
+ const result = await response.json() as { signature: string, success: boolean };
37
+ logger.debug('Withdraw request submitted successfully!');
38
+ logger.debug('Response:', result);
39
+
40
+ return result.signature;
41
+ } catch (error) {
42
+ logger.debug('Failed to submit withdraw request to indexer:', typeof error, error);
43
+ throw error;
44
+ }
45
+ }
46
+
47
+ type WithdrawParams = {
48
+ publicKey: PublicKey,
49
+ connection: Connection,
50
+ base_units?: number,
51
+ amount?: number,
52
+ keyBasePath: string,
53
+ encryptionService: EncryptionService,
54
+ lightWasm: hasher.LightWasm,
55
+ recipient: PublicKey,
56
+ mintAddress: PublicKey | string,
57
+ storage: Storage,
58
+ }
59
+
60
+ export async function withdrawSPL({ recipient, lightWasm, storage, publicKey, connection, base_units, amount, encryptionService, keyBasePath, mintAddress }: WithdrawParams) {
61
+ if (typeof mintAddress == 'string') {
62
+ mintAddress = new PublicKey(mintAddress)
63
+ }
64
+ let token = tokens.find(t => t.pubkey.toString() == mintAddress.toString())
65
+ if (!token) {
66
+ throw new Error('token not found: ' + mintAddress.toString())
67
+ }
68
+
69
+ if (amount) {
70
+ base_units = amount * token.units_per_token
71
+ }
72
+
73
+ if (!base_units) {
74
+ throw new Error('You must input at leaset one of "base_units" or "amount"')
75
+ }
76
+
77
+
78
+ let mintInfo = await getMint(connection, token.pubkey)
79
+ let units_per_token = 10 ** mintInfo.decimals
80
+
81
+ let withdraw_fee_rate = await getConfig('withdraw_fee_rate')
82
+ let withdraw_rent_fees = await getConfig('rent_fees')
83
+ let token_rent_fee = withdraw_rent_fees[token.name]
84
+ if (!token_rent_fee) {
85
+ throw new Error('can not find token_rent_fee for ' + token.name)
86
+ }
87
+ let fee_base_units = Math.floor(base_units * withdraw_fee_rate + units_per_token * token_rent_fee)
88
+ base_units -= fee_base_units
89
+
90
+ if (base_units <= 0) {
91
+ throw new Error('withdraw amount too low, at least ' + fee_base_units / token_rent_fee)
92
+ }
93
+ let isPartial = false
94
+
95
+ let recipient_ata = getAssociatedTokenAddressSync(
96
+ token.pubkey,
97
+ recipient,
98
+ true
99
+ );
100
+
101
+ let feeRecipientTokenAccount = getAssociatedTokenAddressSync(
102
+ token.pubkey,
103
+ FEE_RECIPIENT,
104
+ true
105
+ );
106
+ let signerTokenAccount = getAssociatedTokenAddressSync(
107
+ token.pubkey,
108
+ publicKey
109
+ );
110
+
111
+
112
+ logger.debug('Encryption key generated from user keypair');
113
+
114
+ // Get tree account (uses specific addresses for NOVA, derives for others)
115
+ const treeAccount = getTreeAccountForToken(token.pubkey);
116
+
117
+ const { globalConfigAccount, treeTokenAccount } = getProgramAccounts()
118
+
119
+ // Get current tree state
120
+ const { root, nextIndex: currentNextIndex } = await queryRemoteTreeState(token.name);
121
+ logger.debug(`Using tree root: ${root}`);
122
+ logger.debug(`New UTXOs will be inserted at indices: ${currentNextIndex} and ${currentNextIndex + 1}`);
123
+
124
+ // Generate a deterministic private key derived from the wallet keypair
125
+ const utxoPrivateKey = encryptionService.deriveUtxoPrivateKey();
126
+
127
+ // Create a UTXO keypair that will be used for all inputs and outputs
128
+ const utxoKeypair = new UtxoKeypair(utxoPrivateKey, lightWasm);
129
+ logger.debug('Using wallet-derived UTXO keypair for withdrawal');
130
+
131
+ // Generate a deterministic private key derived from the wallet keypair (V2)
132
+ const utxoPrivateKeyV2 = encryptionService.getUtxoPrivateKeyV2();
133
+ const utxoKeypairV2 = new UtxoKeypair(utxoPrivateKeyV2, lightWasm);
134
+
135
+ // Fetch existing UTXOs for this user
136
+ logger.debug('\nFetching existing UTXOs...');
137
+ const mintUtxos = await getUtxosSPL({ connection, publicKey, encryptionService, storage, mintAddress });
138
+
139
+ logger.debug(`Found ${mintUtxos.length} total UTXOs for ${token.name}`);
140
+
141
+ // Calculate and log total unspent UTXO balance
142
+ const totalUnspentBalance = mintUtxos.reduce((sum, utxo) => sum.add(utxo.amount), new BN(0));
143
+ logger.debug(`Total unspent UTXO balance before: ${totalUnspentBalance.toString()} lamports (${totalUnspentBalance.toNumber() / 1e9} SOL)`);
144
+
145
+ if (mintUtxos.length < 1) {
146
+ throw new Error('Need at least 1 unspent UTXO to perform a withdrawal');
147
+ }
148
+
149
+ // Sort UTXOs by amount in descending order to use the largest ones first
150
+ mintUtxos.sort((a, b) => b.amount.cmp(a.amount));
151
+
152
+ // Use the largest UTXO as first input, and either second largest UTXO or dummy UTXO as second input
153
+ const firstInput = mintUtxos[0];
154
+ const secondInput = mintUtxos.length > 1 ? mintUtxos[1] : new Utxo({
155
+ lightWasm,
156
+ keypair: utxoKeypair,
157
+ amount: '0',
158
+ mintAddress: token.pubkey.toString()
159
+ });
160
+
161
+ const inputs = [firstInput, secondInput];
162
+ logger.debug(`firstInput index: ${firstInput.index}, commitment: ${firstInput.getCommitment()}`)
163
+ logger.debug(`secondInput index: ${secondInput.index}, commitment: ${secondInput.getCommitment()}`)
164
+ const totalInputAmount = firstInput.amount.add(secondInput.amount);
165
+ logger.debug(`Using UTXO with amount: ${firstInput.amount.toString()} and ${secondInput.amount.gt(new BN(0)) ? 'second UTXO with amount: ' + secondInput.amount.toString() : 'dummy UTXO'}`);
166
+ if (totalInputAmount.toNumber() === 0) {
167
+ throw new Error('no balance')
168
+ }
169
+ if (totalInputAmount.lt(new BN(base_units + fee_base_units))) {
170
+ isPartial = true
171
+ base_units = totalInputAmount.toNumber()
172
+ base_units -= fee_base_units
173
+ }
174
+
175
+ // Calculate the change amount (what's left after withdrawal and fee)
176
+ const changeAmount = totalInputAmount.sub(new BN(base_units)).sub(new BN(fee_base_units));
177
+ logger.debug(`Withdrawing ${base_units} lamports with ${fee_base_units} fee, ${changeAmount.toString()} as change`);
178
+
179
+ // Get Merkle proofs for both input UTXOs
180
+ const inputMerkleProofs = await Promise.all(
181
+ inputs.map(async (utxo, index) => {
182
+ // For dummy UTXO (amount is 0), use a zero-filled proof
183
+ if (utxo.amount.eq(new BN(0))) {
184
+ return {
185
+ pathElements: [...new Array(MERKLE_TREE_DEPTH).fill("0")],
186
+ pathIndices: Array(MERKLE_TREE_DEPTH).fill(0)
187
+ };
188
+ }
189
+ // For real UTXOs, fetch the proof from API
190
+ const commitment = await utxo.getCommitment();
191
+ return fetchMerkleProof(commitment, token.name);
192
+ })
193
+ );
194
+
195
+ // Extract path elements and indices
196
+ const inputMerklePathElements = inputMerkleProofs.map(proof => proof.pathElements);
197
+ const inputMerklePathIndices = inputs.map(utxo => utxo.index || 0);
198
+
199
+ // Create outputs: first output is change, second is dummy (required by protocol)
200
+ const outputs = [
201
+ new Utxo({
202
+ lightWasm,
203
+ amount: changeAmount.toString(),
204
+ keypair: utxoKeypairV2,
205
+ index: currentNextIndex,
206
+ mintAddress: token.pubkey.toString()
207
+ }), // Change output
208
+ new Utxo({
209
+ lightWasm,
210
+ amount: '0',
211
+ keypair: utxoKeypairV2,
212
+ index: currentNextIndex + 1,
213
+ mintAddress: token.pubkey.toString()
214
+ }) // Empty UTXO
215
+ ];
216
+
217
+ // For withdrawals, extAmount is negative (funds leaving the system)
218
+ const extAmount = -base_units;
219
+ const publicAmountForCircuit = new BN(extAmount).sub(new BN(fee_base_units)).add(FIELD_SIZE).mod(FIELD_SIZE);
220
+ logger.debug(`Public amount calculation: (${extAmount} - ${fee_base_units} + FIELD_SIZE) % FIELD_SIZE = ${publicAmountForCircuit.toString()}`);
221
+
222
+ // Verify this matches the circuit balance equation: sumIns + publicAmount = sumOuts
223
+ const sumIns = inputs.reduce((sum, input) => sum.add(input.amount), new BN(0));
224
+ const sumOuts = outputs.reduce((sum, output) => sum.add(output.amount), new BN(0));
225
+ logger.debug(`Circuit balance check: sumIns(${sumIns.toString()}) + publicAmount(${publicAmountForCircuit.toString()}) should equal sumOuts(${sumOuts.toString()})`);
226
+
227
+ // Convert to circuit-compatible format
228
+ const publicAmountCircuitResult = sumIns.add(publicAmountForCircuit).mod(FIELD_SIZE);
229
+ logger.debug(`Balance verification: ${sumIns.toString()} + ${publicAmountForCircuit.toString()} (mod FIELD_SIZE) = ${publicAmountCircuitResult.toString()}`);
230
+ logger.debug(`Expected sum of outputs: ${sumOuts.toString()}`);
231
+ logger.debug(`Balance equation satisfied: ${publicAmountCircuitResult.eq(sumOuts)}`);
232
+
233
+ // Generate nullifiers and commitments
234
+ const inputNullifiers = await Promise.all(inputs.map(x => x.getNullifier()));
235
+ const outputCommitments = await Promise.all(outputs.map(x => x.getCommitment()));
236
+
237
+ // Save original commitment and nullifier values for verification
238
+ logger.debug('\n=== UTXO VALIDATION ===');
239
+ logger.debug('Output 0 Commitment:', outputCommitments[0]);
240
+ logger.debug('Output 1 Commitment:', outputCommitments[1]);
241
+
242
+ // Encrypt the UTXO data using a compact format that includes the keypair
243
+ logger.debug('\nEncrypting UTXOs with keypair data...');
244
+ const encryptedOutput1 = encryptionService.encryptUtxo(outputs[0]);
245
+ const encryptedOutput2 = encryptionService.encryptUtxo(outputs[1]);
246
+
247
+ logger.debug(`\nOutput[0] (change):`);
248
+ await outputs[0].log();
249
+ logger.debug(`\nOutput[1] (empty):`);
250
+ await outputs[1].log();
251
+ logger.debug(`Encrypted output 1: ${encryptedOutput1.toString('hex')}`)
252
+ logger.debug(`Encrypted output 2: ${encryptedOutput2.toString('hex')}`)
253
+ logger.debug(`\nEncrypted output 1 size: ${encryptedOutput1.length} bytes`);
254
+ logger.debug(`Encrypted output 2 size: ${encryptedOutput2.length} bytes`);
255
+ logger.debug(`Total encrypted outputs size: ${encryptedOutput1.length + encryptedOutput2.length} bytes`);
256
+
257
+ // Test decryption to verify commitment values match
258
+ logger.debug('\n=== TESTING DECRYPTION ===');
259
+ logger.debug('Decrypting output 1 to verify commitment matches...');
260
+ const decryptedUtxo1 = await encryptionService.decryptUtxo(encryptedOutput1, lightWasm);
261
+ const decryptedCommitment1 = await decryptedUtxo1.getCommitment();
262
+ logger.debug('Original commitment:', outputCommitments[0]);
263
+ logger.debug('Decrypted commitment:', decryptedCommitment1);
264
+ logger.debug('Commitment matches:', outputCommitments[0] === decryptedCommitment1);
265
+
266
+ // Create the withdrawal ExtData with real encrypted outputs
267
+ const extData = {
268
+ // it can be any address
269
+ recipient: recipient_ata,
270
+ extAmount: new BN(extAmount),
271
+ encryptedOutput1: encryptedOutput1,
272
+ encryptedOutput2: encryptedOutput2,
273
+ fee: new BN(fee_base_units),
274
+ feeRecipient: feeRecipientTokenAccount,
275
+ mintAddress: token.pubkey.toString()
276
+ };
277
+ // Calculate the extDataHash with the encrypted outputs
278
+ const calculatedExtDataHash = getExtDataHash(extData);
279
+
280
+ // Create the input for the proof generation
281
+ const input = {
282
+ // Common transaction data
283
+ root: root,
284
+ mintAddress: getMintAddressField(token.pubkey),// new mint address
285
+ publicAmount: publicAmountForCircuit.toString(), // Use proper field arithmetic result
286
+ extDataHash: calculatedExtDataHash,
287
+
288
+ // Input UTXO data (UTXOs being spent) - ensure all values are in decimal format
289
+ inAmount: inputs.map(x => x.amount.toString(10)),
290
+ inPrivateKey: inputs.map(x => x.keypair.privkey),
291
+ inBlinding: inputs.map(x => x.blinding.toString(10)),
292
+ inPathIndices: inputMerklePathIndices,
293
+ inPathElements: inputMerklePathElements,
294
+ inputNullifier: inputNullifiers, // Use resolved values instead of Promise objects
295
+
296
+ // Output UTXO data (UTXOs being created) - ensure all values are in decimal format
297
+ outAmount: outputs.map(x => x.amount.toString(10)),
298
+ outBlinding: outputs.map(x => x.blinding.toString(10)),
299
+ outPubkey: outputs.map(x => x.keypair.pubkey),
300
+ outputCommitment: outputCommitments,
301
+ };
302
+
303
+ logger.info('generating ZK proof...')
304
+
305
+ // Generate the zero-knowledge proof
306
+ const { proof, publicSignals } = await prove(input, keyBasePath);
307
+
308
+ // Parse the proof and public signals into byte arrays
309
+ const proofInBytes = parseProofToBytesArray(proof);
310
+ const inputsInBytes = parseToBytesArray(publicSignals);
311
+
312
+ // Create the proof object to submit to the program
313
+ const proofToSubmit = {
314
+ proofA: proofInBytes.proofA,
315
+ proofB: proofInBytes.proofB.flat(),
316
+ proofC: proofInBytes.proofC,
317
+ root: inputsInBytes[0],
318
+ publicAmount: inputsInBytes[1],
319
+ extDataHash: inputsInBytes[2],
320
+ inputNullifiers: [
321
+ inputsInBytes[3],
322
+ inputsInBytes[4]
323
+ ],
324
+ outputCommitments: [
325
+ inputsInBytes[5],
326
+ inputsInBytes[6]
327
+ ],
328
+ };
329
+
330
+ // Find PDAs for nullifiers and commitments
331
+ const { nullifier0PDA, nullifier1PDA } = findNullifierPDAs(proofToSubmit);
332
+ const { nullifier2PDA, nullifier3PDA } = findCrossCheckNullifierPDAs(proofToSubmit);
333
+
334
+ // Serialize the proof and extData
335
+ const serializedProof = serializeProofAndExtData(proofToSubmit, extData, true);
336
+ logger.debug(`Total instruction data size: ${serializedProof.length} bytes`);
337
+
338
+ const [globalConfigPda, globalConfigPdaBump] = await PublicKey.findProgramAddressSync(
339
+ [Buffer.from("global_config")],
340
+ PROGRAM_ID
341
+ );
342
+ const treeAta = getAssociatedTokenAddressSync(token.pubkey, globalConfigPda, true);
343
+
344
+ // Prepare withdraw parameters for indexer backend
345
+ const withdrawParams = {
346
+ serializedProof: serializedProof.toString('base64'),
347
+ treeAccount: treeAccount.toString(),
348
+ nullifier0PDA: nullifier0PDA.toString(),
349
+ nullifier1PDA: nullifier1PDA.toString(),
350
+ nullifier2PDA: nullifier2PDA.toString(),
351
+ nullifier3PDA: nullifier3PDA.toString(),
352
+ treeTokenAccount: treeTokenAccount.toString(),
353
+ globalConfigAccount: globalConfigAccount.toString(),
354
+ recipient: recipient.toString(),
355
+ feeRecipientAccount: FEE_RECIPIENT.toString(),
356
+ extAmount: extAmount,
357
+ fee: fee_base_units,
358
+ lookupTableAddress: ALT_ADDRESS.toString(),
359
+ senderAddress: publicKey.toString(),
360
+ treeAta: treeAta.toString(),
361
+ recipientAta: recipient_ata.toString(),
362
+ mintAddress: token.pubkey.toString(),
363
+ feeRecipientTokenAccount: feeRecipientTokenAccount.toString()
364
+ };
365
+
366
+
367
+ logger.debug('Prepared withdraw parameters for indexer backend');
368
+
369
+ // Submit to indexer backend instead of directly to Solana
370
+ logger.info('submitting transaction to relayer...')
371
+ const signature = await submitWithdrawToIndexer(withdrawParams);
372
+ // Wait a moment for the transaction to be confirmed
373
+ logger.info('waiting for transaction confirmation...')
374
+ let retryTimes = 0
375
+ let itv = 2
376
+ const encryptedOutputStr = Buffer.from(encryptedOutput1).toString('hex')
377
+ let start = Date.now()
378
+ while (true) {
379
+ logger.info(`retryTimes: ${retryTimes}`)
380
+ await new Promise(resolve => setTimeout(resolve, itv * 1000));
381
+ logger.info('Fetching updated tree state...');
382
+ let res = await fetch(RELAYER_API_URL + '/utxos/check/' + encryptedOutputStr + '?token=' + token.name)
383
+ let resJson = await res.json()
384
+ logger.debug('resJson:', resJson)
385
+ if (resJson.exists) {
386
+ return { isPartial, tx: signature, recipient: recipient.toString(), base_units, fee_base_units }
387
+ }
388
+ if (retryTimes >= 10) {
389
+ throw new Error('Refresh the page to see latest balance.')
390
+ }
391
+ retryTimes++
392
+ }
393
+
394
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "es2022",
5
+ "strict": true,
6
+ "esModuleInterop": true,
7
+ "resolveJsonModule": true,
8
+ "isolatedModules": true,
9
+ "allowImportingTsExtensions": false,
10
+ "noEmit": false,
11
+ "allowSyntheticDefaultImports": true,
12
+ "forceConsistentCasingInFileNames": true,
13
+ "outDir": "dist",
14
+ "declaration": true,
15
+ "moduleResolution": "node",
16
+ "lib": [
17
+ "ES2022",
18
+ "DOM"
19
+ ],
20
+ },
21
+ "include": [
22
+ "src"
23
+ ],
24
+ "exclude": [
25
+ "node_modules",
26
+ "dist"
27
+ ]
28
+ }