pctestupgrade2 1.1.8

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