@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
@@ -474,6 +474,112 @@ function UPPAccountProvider({
474
474
  } catch (e) {
475
475
  console.warn("[syncNotes] Failed to scan Transferred events:", e);
476
476
  }
477
+ try {
478
+ const filledLogs = await client.getLogs({
479
+ address: contractAddress,
480
+ event: {
481
+ type: "event",
482
+ name: "SwapOrderFilled",
483
+ inputs: [
484
+ { name: "orderId", type: "bytes32", indexed: true },
485
+ { name: "fillerNullifier", type: "bytes32", indexed: true },
486
+ { name: "fillerOutputCommitment", type: "bytes32", indexed: true },
487
+ { name: "takeAmount", type: "uint256", indexed: false },
488
+ { name: "giveAmount", type: "uint256", indexed: false },
489
+ { name: "fillerAspId", type: "uint256", indexed: false },
490
+ { name: "encryptedFillerNote", type: "bytes", indexed: false }
491
+ ]
492
+ },
493
+ fromBlock: 0n,
494
+ toBlock: "latest"
495
+ });
496
+ for (const log of filledLogs) {
497
+ const c = log.args.fillerOutputCommitment;
498
+ if (!existingCommitments.has(c.toLowerCase())) {
499
+ candidates.push({
500
+ commitment: c,
501
+ leafIndex: commitmentLeafMap.get(c.toLowerCase()) ?? -1,
502
+ packedData: log.args.encryptedFillerNote,
503
+ txHash: log.transactionHash
504
+ });
505
+ }
506
+ }
507
+ } catch (e) {
508
+ console.warn("[syncNotes] Failed to scan SwapOrderFilled events:", e);
509
+ }
510
+ try {
511
+ const claimedLogs = await client.getLogs({
512
+ address: contractAddress,
513
+ event: {
514
+ type: "event",
515
+ name: "SwapOrderClaimed",
516
+ inputs: [
517
+ { name: "orderId", type: "bytes32", indexed: true },
518
+ { name: "accumulatedBuyAmount", type: "uint256", indexed: false },
519
+ { name: "refundedSellAmount", type: "uint256", indexed: false },
520
+ { name: "buyOutputCommitment", type: "bytes32", indexed: false },
521
+ { name: "encryptedBuyNote", type: "bytes", indexed: false },
522
+ { name: "refundCommitment", type: "bytes32", indexed: false },
523
+ { name: "encryptedRefundNote", type: "bytes", indexed: false }
524
+ ]
525
+ },
526
+ fromBlock: 0n,
527
+ toBlock: "latest"
528
+ });
529
+ for (const log of claimedLogs) {
530
+ const buyC = log.args.buyOutputCommitment;
531
+ const refundC = log.args.refundCommitment;
532
+ const txHash = log.transactionHash;
533
+ if (buyC && !existingCommitments.has(buyC.toLowerCase())) {
534
+ candidates.push({
535
+ commitment: buyC,
536
+ leafIndex: commitmentLeafMap.get(buyC.toLowerCase()) ?? -1,
537
+ packedData: log.args.encryptedBuyNote,
538
+ txHash
539
+ });
540
+ }
541
+ if (refundC && !existingCommitments.has(refundC.toLowerCase())) {
542
+ candidates.push({
543
+ commitment: refundC,
544
+ leafIndex: commitmentLeafMap.get(refundC.toLowerCase()) ?? -1,
545
+ packedData: log.args.encryptedRefundNote,
546
+ txHash
547
+ });
548
+ }
549
+ }
550
+ } catch (e) {
551
+ console.warn("[syncNotes] Failed to scan SwapOrderClaimed events:", e);
552
+ }
553
+ try {
554
+ const cancelledLogs = await client.getLogs({
555
+ address: contractAddress,
556
+ event: {
557
+ type: "event",
558
+ name: "SwapOrderCancelled",
559
+ inputs: [
560
+ { name: "orderId", type: "bytes32", indexed: true },
561
+ { name: "refundedSellAmount", type: "uint256", indexed: false },
562
+ { name: "refundCommitment", type: "bytes32", indexed: false },
563
+ { name: "encryptedRefundNote", type: "bytes", indexed: false }
564
+ ]
565
+ },
566
+ fromBlock: 0n,
567
+ toBlock: "latest"
568
+ });
569
+ for (const log of cancelledLogs) {
570
+ const c = log.args.refundCommitment;
571
+ if (c && !existingCommitments.has(c.toLowerCase())) {
572
+ candidates.push({
573
+ commitment: c,
574
+ leafIndex: commitmentLeafMap.get(c.toLowerCase()) ?? -1,
575
+ packedData: log.args.encryptedRefundNote,
576
+ txHash: log.transactionHash
577
+ });
578
+ }
579
+ }
580
+ } catch (e) {
581
+ console.warn("[syncNotes] Failed to scan SwapOrderCancelled events:", e);
582
+ }
477
583
  let discovered = 0;
478
584
  let skippedEmpty = 0, skippedOwner = 0;
479
585
  for (const candidate of candidates) {
@@ -1598,7 +1704,7 @@ function usePoolTransfer(config) {
1598
1704
  const recipientNote = await createNoteForSelf(amount, origin, token);
1599
1705
  const changeNote = await createNoteForSelf(changeAmount, origin, token);
1600
1706
  const [transferModule, proofModule, aspModule] = await Promise.all([
1601
- import('../transfer-WYG6422Y.js'),
1707
+ import('../transfer-LGR44CER.js'),
1602
1708
  import('../proof-XQG5DN5N.js'),
1603
1709
  import('../asp-72WUGTQE.js')
1604
1710
  ]);
@@ -1747,7 +1853,7 @@ function useWithdraw(config) {
1747
1853
  const token = BigInt(selectedNote.token);
1748
1854
  setStage("creating_outputs");
1749
1855
  const [transferModule, proofModule, sdk] = await Promise.all([
1750
- import('../transfer-WYG6422Y.js'),
1856
+ import('../transfer-LGR44CER.js'),
1751
1857
  import('../proof-XQG5DN5N.js'),
1752
1858
  import('../index.js')
1753
1859
  ]);
@@ -2116,7 +2222,7 @@ function useSwap(config) {
2116
2222
  }
2117
2223
  setStage("creating_outputs");
2118
2224
  const [transferModule, proofModule, sdk, aspModule] = await Promise.all([
2119
- import('../transfer-WYG6422Y.js'),
2225
+ import('../transfer-LGR44CER.js'),
2120
2226
  import('../proof-XQG5DN5N.js'),
2121
2227
  import('../index.js'),
2122
2228
  import('../asp-72WUGTQE.js')
@@ -2257,7 +2363,7 @@ function useSwap(config) {
2257
2363
  }
2258
2364
  setStage("creating_outputs");
2259
2365
  const [transferModule, proofModule, sdk, aspModule] = await Promise.all([
2260
- import('../transfer-WYG6422Y.js'),
2366
+ import('../transfer-LGR44CER.js'),
2261
2367
  import('../proof-XQG5DN5N.js'),
2262
2368
  import('../index.js'),
2263
2369
  import('../asp-72WUGTQE.js')
@@ -2476,7 +2582,7 @@ function useSwap(config) {
2476
2582
  createNoteForSelf(changeAmount, origin, token)
2477
2583
  ]);
2478
2584
  const [transferModule, proofModule, aspModule] = await Promise.all([
2479
- import('../transfer-WYG6422Y.js'),
2585
+ import('../transfer-LGR44CER.js'),
2480
2586
  import('../proof-XQG5DN5N.js'),
2481
2587
  import('../asp-72WUGTQE.js')
2482
2588
  ]);