@permissionless-technologies/upp-sdk 0.4.11 → 0.4.13

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 (33) hide show
  1. package/dist/{chunk-L3PVYAH2.js → chunk-3I6ERQO3.js} +14 -14
  2. package/dist/{chunk-L3PVYAH2.js.map → chunk-3I6ERQO3.js.map} +1 -1
  3. package/dist/{chunk-43GNVMVL.cjs → chunk-4MWEJDTR.cjs} +14 -14
  4. package/dist/{chunk-43GNVMVL.cjs.map → chunk-4MWEJDTR.cjs.map} +1 -1
  5. package/dist/{chunk-R75NKNDC.js → chunk-DUBWGEB5.js} +2 -2
  6. package/dist/{chunk-R75NKNDC.js.map → chunk-DUBWGEB5.js.map} +1 -1
  7. package/dist/{chunk-IWNEKLAA.cjs → chunk-KZ7PY2PR.cjs} +2 -2
  8. package/dist/{chunk-IWNEKLAA.cjs.map → chunk-KZ7PY2PR.cjs.map} +1 -1
  9. package/dist/core/index.cjs +7 -7
  10. package/dist/core/index.js +1 -1
  11. package/dist/{index-Mm_cz6Ie.d.cts → index-CKCDqv2e.d.cts} +40 -0
  12. package/dist/{index-Cxm5E-J5.d.ts → index-DLczKlnM.d.ts} +40 -0
  13. package/dist/index.cjs +63 -15
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.d.cts +1 -1
  16. package/dist/index.d.ts +1 -1
  17. package/dist/index.js +50 -2
  18. package/dist/index.js.map +1 -1
  19. package/dist/indexer/index.cjs +6 -6
  20. package/dist/indexer/index.d.cts +2 -2
  21. package/dist/indexer/index.d.ts +2 -2
  22. package/dist/indexer/index.js +1 -1
  23. package/dist/react/index.cjs +111 -5
  24. package/dist/react/index.cjs.map +1 -1
  25. package/dist/react/index.js +111 -5
  26. package/dist/react/index.js.map +1 -1
  27. package/dist/{transfer-WYG6422Y.js → transfer-LGR44CER.js} +3 -3
  28. package/dist/{transfer-WYG6422Y.js.map → transfer-LGR44CER.js.map} +1 -1
  29. package/dist/{transfer-ZDJPVUL2.cjs → transfer-UZBU47HC.cjs} +9 -9
  30. package/dist/{transfer-ZDJPVUL2.cjs.map → transfer-UZBU47HC.cjs.map} +1 -1
  31. package/package.json +1 -1
  32. package/src/contracts/interfaces/IUniversalPrivatePool.sol +11 -3
  33. package/src/deployments/11155111.json +12 -12
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkIWNEKLAA_cjs = require('../chunk-IWNEKLAA.cjs');
3
+ var chunkKZ7PY2PR_cjs = require('../chunk-KZ7PY2PR.cjs');
4
4
  var chunkERQE57IA_cjs = require('../chunk-ERQE57IA.cjs');
5
5
  require('../chunk-G7VZBCD6.cjs');
6
6
 
@@ -8,23 +8,23 @@ require('../chunk-G7VZBCD6.cjs');
8
8
 
9
9
  Object.defineProperty(exports, "computeSearchTag", {
10
10
  enumerable: true,
11
- get: function () { return chunkIWNEKLAA_cjs.computeSearchTag; }
11
+ get: function () { return chunkKZ7PY2PR_cjs.computeSearchTag; }
12
12
  });
13
13
  Object.defineProperty(exports, "makeRpcIndexer", {
14
14
  enumerable: true,
15
- get: function () { return chunkIWNEKLAA_cjs.makeRpcIndexer; }
15
+ get: function () { return chunkKZ7PY2PR_cjs.makeRpcIndexer; }
16
16
  });
17
17
  Object.defineProperty(exports, "matchesSearchTag", {
18
18
  enumerable: true,
19
- get: function () { return chunkIWNEKLAA_cjs.matchesSearchTag; }
19
+ get: function () { return chunkKZ7PY2PR_cjs.matchesSearchTag; }
20
20
  });
21
21
  Object.defineProperty(exports, "tryDecryptNote", {
22
22
  enumerable: true,
23
- get: function () { return chunkIWNEKLAA_cjs.tryDecryptNote; }
23
+ get: function () { return chunkKZ7PY2PR_cjs.tryDecryptNote; }
24
24
  });
25
25
  Object.defineProperty(exports, "unpackNoteData", {
26
26
  enumerable: true,
27
- get: function () { return chunkIWNEKLAA_cjs.unpackNoteData; }
27
+ get: function () { return chunkKZ7PY2PR_cjs.unpackNoteData; }
28
28
  });
29
29
  Object.defineProperty(exports, "createAutoAdapter", {
30
30
  enumerable: true,
@@ -1,7 +1,7 @@
1
1
  import { S as StorageAdapter } from '../index-CRaFsQD3.cjs';
2
2
  export { C as CommitmentInsertedArgs, a as IndexedNote, I as Indexer, f as IndexerState, L as LiveSyncConfig, b as NoteFilters, N as NoteStatus, j as NullifiedArgs, R as RpcIndexerConfig, h as SerializedNote, i as StealthTransactArgs, e as SyncConfig, d as SyncProgress, c as SyncResult, g as SyncState } from '../index-CRaFsQD3.cjs';
3
- import { _ as ___index_js } from '../index-Mm_cz6Ie.cjs';
4
- export { m as makeRpcIndexer } from '../index-Mm_cz6Ie.cjs';
3
+ import { _ as ___index_js } from '../index-CKCDqv2e.cjs';
4
+ export { m as makeRpcIndexer } from '../index-CKCDqv2e.cjs';
5
5
  import { Hex } from 'viem';
6
6
  import { P as Point } from '../merkle-mteVOlDf.cjs';
7
7
  import '../transfer-CwwsNdGL.cjs';
@@ -1,7 +1,7 @@
1
1
  import { S as StorageAdapter } from '../index--eNkOLiP.js';
2
2
  export { C as CommitmentInsertedArgs, a as IndexedNote, I as Indexer, f as IndexerState, L as LiveSyncConfig, b as NoteFilters, N as NoteStatus, j as NullifiedArgs, R as RpcIndexerConfig, h as SerializedNote, i as StealthTransactArgs, e as SyncConfig, d as SyncProgress, c as SyncResult, g as SyncState } from '../index--eNkOLiP.js';
3
- import { _ as ___index_js } from '../index-Cxm5E-J5.js';
4
- export { m as makeRpcIndexer } from '../index-Cxm5E-J5.js';
3
+ import { _ as ___index_js } from '../index-DLczKlnM.js';
4
+ export { m as makeRpcIndexer } from '../index-DLczKlnM.js';
5
5
  import { Hex } from 'viem';
6
6
  import { P as Point } from '../merkle-mteVOlDf.js';
7
7
  import '../transfer-Crvdq4VN.js';
@@ -1,4 +1,4 @@
1
- export { computeSearchTag, makeRpcIndexer, matchesSearchTag, tryDecryptNote, unpackNoteData } from '../chunk-R75NKNDC.js';
1
+ export { computeSearchTag, makeRpcIndexer, matchesSearchTag, tryDecryptNote, unpackNoteData } from '../chunk-DUBWGEB5.js';
2
2
  export { createAutoAdapter, createIndexedDBAdapter, createLocalStorageAdapter, createMemoryAdapter, indexedDBAdapter, localStorageAdapter, memoryAdapter } from '../chunk-XV72HNHN.js';
3
3
  import '../chunk-Z6ZWNWWR.js';
4
4
  //# sourceMappingURL=index.js.map
@@ -475,6 +475,112 @@ function UPPAccountProvider({
475
475
  } catch (e) {
476
476
  console.warn("[syncNotes] Failed to scan Transferred events:", e);
477
477
  }
478
+ try {
479
+ const filledLogs = await client.getLogs({
480
+ address: contractAddress,
481
+ event: {
482
+ type: "event",
483
+ name: "SwapOrderFilled",
484
+ inputs: [
485
+ { name: "orderId", type: "bytes32", indexed: true },
486
+ { name: "fillerNullifier", type: "bytes32", indexed: true },
487
+ { name: "fillerOutputCommitment", type: "bytes32", indexed: true },
488
+ { name: "takeAmount", type: "uint256", indexed: false },
489
+ { name: "giveAmount", type: "uint256", indexed: false },
490
+ { name: "fillerAspId", type: "uint256", indexed: false },
491
+ { name: "encryptedFillerNote", type: "bytes", indexed: false }
492
+ ]
493
+ },
494
+ fromBlock: 0n,
495
+ toBlock: "latest"
496
+ });
497
+ for (const log of filledLogs) {
498
+ const c = log.args.fillerOutputCommitment;
499
+ if (!existingCommitments.has(c.toLowerCase())) {
500
+ candidates.push({
501
+ commitment: c,
502
+ leafIndex: commitmentLeafMap.get(c.toLowerCase()) ?? -1,
503
+ packedData: log.args.encryptedFillerNote,
504
+ txHash: log.transactionHash
505
+ });
506
+ }
507
+ }
508
+ } catch (e) {
509
+ console.warn("[syncNotes] Failed to scan SwapOrderFilled events:", e);
510
+ }
511
+ try {
512
+ const claimedLogs = await client.getLogs({
513
+ address: contractAddress,
514
+ event: {
515
+ type: "event",
516
+ name: "SwapOrderClaimed",
517
+ inputs: [
518
+ { name: "orderId", type: "bytes32", indexed: true },
519
+ { name: "accumulatedBuyAmount", type: "uint256", indexed: false },
520
+ { name: "refundedSellAmount", type: "uint256", indexed: false },
521
+ { name: "buyOutputCommitment", type: "bytes32", indexed: false },
522
+ { name: "encryptedBuyNote", type: "bytes", indexed: false },
523
+ { name: "refundCommitment", type: "bytes32", indexed: false },
524
+ { name: "encryptedRefundNote", type: "bytes", indexed: false }
525
+ ]
526
+ },
527
+ fromBlock: 0n,
528
+ toBlock: "latest"
529
+ });
530
+ for (const log of claimedLogs) {
531
+ const buyC = log.args.buyOutputCommitment;
532
+ const refundC = log.args.refundCommitment;
533
+ const txHash = log.transactionHash;
534
+ if (buyC && !existingCommitments.has(buyC.toLowerCase())) {
535
+ candidates.push({
536
+ commitment: buyC,
537
+ leafIndex: commitmentLeafMap.get(buyC.toLowerCase()) ?? -1,
538
+ packedData: log.args.encryptedBuyNote,
539
+ txHash
540
+ });
541
+ }
542
+ if (refundC && !existingCommitments.has(refundC.toLowerCase())) {
543
+ candidates.push({
544
+ commitment: refundC,
545
+ leafIndex: commitmentLeafMap.get(refundC.toLowerCase()) ?? -1,
546
+ packedData: log.args.encryptedRefundNote,
547
+ txHash
548
+ });
549
+ }
550
+ }
551
+ } catch (e) {
552
+ console.warn("[syncNotes] Failed to scan SwapOrderClaimed events:", e);
553
+ }
554
+ try {
555
+ const cancelledLogs = await client.getLogs({
556
+ address: contractAddress,
557
+ event: {
558
+ type: "event",
559
+ name: "SwapOrderCancelled",
560
+ inputs: [
561
+ { name: "orderId", type: "bytes32", indexed: true },
562
+ { name: "refundedSellAmount", type: "uint256", indexed: false },
563
+ { name: "refundCommitment", type: "bytes32", indexed: false },
564
+ { name: "encryptedRefundNote", type: "bytes", indexed: false }
565
+ ]
566
+ },
567
+ fromBlock: 0n,
568
+ toBlock: "latest"
569
+ });
570
+ for (const log of cancelledLogs) {
571
+ const c = log.args.refundCommitment;
572
+ if (c && !existingCommitments.has(c.toLowerCase())) {
573
+ candidates.push({
574
+ commitment: c,
575
+ leafIndex: commitmentLeafMap.get(c.toLowerCase()) ?? -1,
576
+ packedData: log.args.encryptedRefundNote,
577
+ txHash: log.transactionHash
578
+ });
579
+ }
580
+ }
581
+ } catch (e) {
582
+ console.warn("[syncNotes] Failed to scan SwapOrderCancelled events:", e);
583
+ }
478
584
  let discovered = 0;
479
585
  let skippedEmpty = 0, skippedOwner = 0;
480
586
  for (const candidate of candidates) {
@@ -1599,7 +1705,7 @@ function usePoolTransfer(config) {
1599
1705
  const recipientNote = await createNoteForSelf(amount, origin, token);
1600
1706
  const changeNote = await createNoteForSelf(changeAmount, origin, token);
1601
1707
  const [transferModule, proofModule, aspModule] = await Promise.all([
1602
- import('../transfer-ZDJPVUL2.cjs'),
1708
+ import('../transfer-UZBU47HC.cjs'),
1603
1709
  import('../proof-VINVGL4F.cjs'),
1604
1710
  import('../asp-CUE3NMBN.cjs')
1605
1711
  ]);
@@ -1748,7 +1854,7 @@ function useWithdraw(config) {
1748
1854
  const token = BigInt(selectedNote.token);
1749
1855
  setStage("creating_outputs");
1750
1856
  const [transferModule, proofModule, sdk] = await Promise.all([
1751
- import('../transfer-ZDJPVUL2.cjs'),
1857
+ import('../transfer-UZBU47HC.cjs'),
1752
1858
  import('../proof-VINVGL4F.cjs'),
1753
1859
  import('../index.cjs')
1754
1860
  ]);
@@ -2117,7 +2223,7 @@ function useSwap(config) {
2117
2223
  }
2118
2224
  setStage("creating_outputs");
2119
2225
  const [transferModule, proofModule, sdk, aspModule] = await Promise.all([
2120
- import('../transfer-ZDJPVUL2.cjs'),
2226
+ import('../transfer-UZBU47HC.cjs'),
2121
2227
  import('../proof-VINVGL4F.cjs'),
2122
2228
  import('../index.cjs'),
2123
2229
  import('../asp-CUE3NMBN.cjs')
@@ -2258,7 +2364,7 @@ function useSwap(config) {
2258
2364
  }
2259
2365
  setStage("creating_outputs");
2260
2366
  const [transferModule, proofModule, sdk, aspModule] = await Promise.all([
2261
- import('../transfer-ZDJPVUL2.cjs'),
2367
+ import('../transfer-UZBU47HC.cjs'),
2262
2368
  import('../proof-VINVGL4F.cjs'),
2263
2369
  import('../index.cjs'),
2264
2370
  import('../asp-CUE3NMBN.cjs')
@@ -2477,7 +2583,7 @@ function useSwap(config) {
2477
2583
  createNoteForSelf(changeAmount, origin, token)
2478
2584
  ]);
2479
2585
  const [transferModule, proofModule, aspModule] = await Promise.all([
2480
- import('../transfer-ZDJPVUL2.cjs'),
2586
+ import('../transfer-UZBU47HC.cjs'),
2481
2587
  import('../proof-VINVGL4F.cjs'),
2482
2588
  import('../asp-CUE3NMBN.cjs')
2483
2589
  ]);