@permissionless-technologies/upp-sdk 0.3.6 → 0.4.1

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 (140) hide show
  1. package/dist/{asp-ZA3RGN7G.js → asp-72WUGTQE.js} +3 -3
  2. package/dist/asp-72WUGTQE.js.map +1 -0
  3. package/dist/{asp-TXSAFFD3.cjs → asp-CUE3NMBN.cjs} +14 -14
  4. package/dist/asp-CUE3NMBN.cjs.map +1 -0
  5. package/dist/{chunk-KXPZUBPI.cjs → chunk-23B5XSS4.cjs} +12 -12
  6. package/dist/{chunk-KXPZUBPI.cjs.map → chunk-23B5XSS4.cjs.map} +1 -1
  7. package/dist/{chunk-SQKBT2SH.cjs → chunk-2G22R7AJ.cjs} +18 -7
  8. package/dist/chunk-2G22R7AJ.cjs.map +1 -0
  9. package/dist/chunk-5QSSX3KR.js +64 -0
  10. package/dist/chunk-5QSSX3KR.js.map +1 -0
  11. package/dist/{chunk-P37MRZ73.js → chunk-6IEYWJVS.js} +8 -8
  12. package/dist/chunk-6IEYWJVS.js.map +1 -0
  13. package/dist/{chunk-5V5HSN6Y.js → chunk-6TFDBBAQ.js} +3 -3
  14. package/dist/{chunk-5V5HSN6Y.js.map → chunk-6TFDBBAQ.js.map} +1 -1
  15. package/dist/{chunk-ZKZV6OI3.cjs → chunk-7BNJV2ZS.cjs} +21 -21
  16. package/dist/{chunk-ZKZV6OI3.cjs.map → chunk-7BNJV2ZS.cjs.map} +1 -1
  17. package/dist/{chunk-XBNYAAMU.js → chunk-7T4CUE6E.js} +3 -3
  18. package/dist/{chunk-XBNYAAMU.js.map → chunk-7T4CUE6E.js.map} +1 -1
  19. package/dist/{chunk-NI62M3W3.cjs → chunk-BZD5KJL3.cjs} +2 -2
  20. package/dist/{chunk-NI62M3W3.cjs.map → chunk-BZD5KJL3.cjs.map} +1 -1
  21. package/dist/{chunk-OD2SDC4L.js → chunk-CEJN5ZE5.js} +3 -3
  22. package/dist/{chunk-OD2SDC4L.js.map → chunk-CEJN5ZE5.js.map} +1 -1
  23. package/dist/{chunk-2JQISXBD.js → chunk-DTEAFJG7.js} +8 -8
  24. package/dist/{chunk-2JQISXBD.js.map → chunk-DTEAFJG7.js.map} +1 -1
  25. package/dist/chunk-EHGH6TAW.js +100 -0
  26. package/dist/chunk-EHGH6TAW.js.map +1 -0
  27. package/dist/{chunk-ZU6J7KMY.js → chunk-GPF72JFR.js} +3 -3
  28. package/dist/{chunk-ZU6J7KMY.js.map → chunk-GPF72JFR.js.map} +1 -1
  29. package/dist/chunk-HEHXSV47.cjs +77 -0
  30. package/dist/chunk-HEHXSV47.cjs.map +1 -0
  31. package/dist/chunk-I5EKGD4P.cjs +113 -0
  32. package/dist/chunk-I5EKGD4P.cjs.map +1 -0
  33. package/dist/{chunk-EUP7MBAH.cjs → chunk-IIUKM5VE.cjs} +7 -7
  34. package/dist/{chunk-EUP7MBAH.cjs.map → chunk-IIUKM5VE.cjs.map} +1 -1
  35. package/dist/{chunk-7Q4RSSHM.js → chunk-MDF37354.js} +2 -2
  36. package/dist/{chunk-7Q4RSSHM.js.map → chunk-MDF37354.js.map} +1 -1
  37. package/dist/{chunk-CWSUBAV3.js → chunk-OBBSIPEK.js} +30 -35
  38. package/dist/chunk-OBBSIPEK.js.map +1 -0
  39. package/dist/{chunk-FVT2XRRL.cjs → chunk-Q2E432UK.cjs} +41 -46
  40. package/dist/chunk-Q2E432UK.cjs.map +1 -0
  41. package/dist/{chunk-QKI4QWLT.js → chunk-RNUG3EFC.js} +6 -6
  42. package/dist/{chunk-QKI4QWLT.js.map → chunk-RNUG3EFC.js.map} +1 -1
  43. package/dist/{chunk-3YZSIYJC.cjs → chunk-SWTNJPK5.cjs} +11 -11
  44. package/dist/{chunk-3YZSIYJC.cjs.map → chunk-SWTNJPK5.cjs.map} +1 -1
  45. package/dist/{chunk-BH24DZ5S.cjs → chunk-U3YFYMWF.cjs} +5 -5
  46. package/dist/{chunk-BH24DZ5S.cjs.map → chunk-U3YFYMWF.cjs.map} +1 -1
  47. package/dist/{chunk-3HQ7A6ZM.cjs → chunk-UFEDJJSH.cjs} +5 -5
  48. package/dist/{chunk-3HQ7A6ZM.cjs.map → chunk-UFEDJJSH.cjs.map} +1 -1
  49. package/dist/{chunk-W77GRBO4.js → chunk-UQIM2KT3.js} +3 -3
  50. package/dist/{chunk-W77GRBO4.js.map → chunk-UQIM2KT3.js.map} +1 -1
  51. package/dist/{chunk-SJDPDHSD.cjs → chunk-UTAJSERA.cjs} +4 -4
  52. package/dist/{chunk-SJDPDHSD.cjs.map → chunk-UTAJSERA.cjs.map} +1 -1
  53. package/dist/{chunk-S4B7GYLN.js → chunk-W3HLIKC2.js} +18 -8
  54. package/dist/chunk-W3HLIKC2.js.map +1 -0
  55. package/dist/{chunk-NDM5EJEV.cjs → chunk-XVIICZKW.cjs} +7 -7
  56. package/dist/chunk-XVIICZKW.cjs.map +1 -0
  57. package/dist/core/index.cjs +85 -85
  58. package/dist/core/index.d.cts +2 -2
  59. package/dist/core/index.d.ts +2 -2
  60. package/dist/core/index.js +10 -10
  61. package/dist/{index-B45-okum.d.cts → index-BgPdYxFS.d.cts} +18 -18
  62. package/dist/{index-o-Ds3YAq.d.cts → index-CL4vb3ej.d.cts} +1 -1
  63. package/dist/{index-BIcvNMPt.d.ts → index-CtcXgof_.d.ts} +18 -18
  64. package/dist/{index-DwAJBoU7.d.ts → index-D6nvfm59.d.ts} +1 -1
  65. package/dist/index.cjs +279 -280
  66. package/dist/index.cjs.map +1 -1
  67. package/dist/index.d.cts +3 -3
  68. package/dist/index.d.ts +3 -3
  69. package/dist/index.js +29 -30
  70. package/dist/index.js.map +1 -1
  71. package/dist/indexer/index.cjs +6 -6
  72. package/dist/indexer/index.d.cts +5 -5
  73. package/dist/indexer/index.d.ts +5 -5
  74. package/dist/indexer/index.js +1 -1
  75. package/dist/keys/index.cjs +18 -18
  76. package/dist/keys/index.js +4 -4
  77. package/dist/merkle-DZHEOPH3.cjs +30 -0
  78. package/dist/{merkle-HGDC6OB4.cjs.map → merkle-DZHEOPH3.cjs.map} +1 -1
  79. package/dist/merkle-IF2RMWCF.js +5 -0
  80. package/dist/{merkle-7KS2EHRF.js.map → merkle-IF2RMWCF.js.map} +1 -1
  81. package/dist/poseidon-ACM7E2OH.js +7 -0
  82. package/dist/{poseidon-UHTJLWQM.js.map → poseidon-ACM7E2OH.js.map} +1 -1
  83. package/dist/poseidon-PUSGUIVZ.cjs +61 -0
  84. package/dist/{poseidon-WHJSZSNP.cjs.map → poseidon-PUSGUIVZ.cjs.map} +1 -1
  85. package/dist/proof-JME3IZTX.js +4 -0
  86. package/dist/{proof-C4YBP6RY.js.map → proof-JME3IZTX.js.map} +1 -1
  87. package/dist/proof-XR6XE5PJ.cjs +49 -0
  88. package/dist/{proof-5OECB3RQ.cjs.map → proof-XR6XE5PJ.cjs.map} +1 -1
  89. package/dist/react/index.cjs +62 -116
  90. package/dist/react/index.cjs.map +1 -1
  91. package/dist/react/index.d.cts +27 -12
  92. package/dist/react/index.d.ts +27 -12
  93. package/dist/react/index.js +35 -89
  94. package/dist/react/index.js.map +1 -1
  95. package/dist/{transfer-BzyernBd.d.cts → transfer-D111ihqN.d.cts} +108 -56
  96. package/dist/{transfer-sqS6mJko.d.ts → transfer-DvIXqHCr.d.ts} +108 -56
  97. package/dist/transfer-MQMGSXTH.js +8 -0
  98. package/dist/{transfer-F6YOQTUL.js.map → transfer-MQMGSXTH.js.map} +1 -1
  99. package/dist/transfer-PB6D5VCW.cjs +37 -0
  100. package/dist/{transfer-42C4DXYA.cjs.map → transfer-PB6D5VCW.cjs.map} +1 -1
  101. package/dist/utils/index.cjs +60 -61
  102. package/dist/utils/index.d.cts +37 -14
  103. package/dist/utils/index.d.ts +37 -14
  104. package/dist/utils/index.js +6 -7
  105. package/package.json +4 -2
  106. package/src/contracts/interfaces/IUniversalPrivatePool.sol +10 -8
  107. package/src/contracts/interfaces/IVerifiers.sol +16 -52
  108. package/src/deployments/11155111.json +15 -12
  109. package/dist/asp-TXSAFFD3.cjs.map +0 -1
  110. package/dist/asp-ZA3RGN7G.js.map +0 -1
  111. package/dist/babyjubjub-2MGQVCKB.js +0 -5
  112. package/dist/babyjubjub-2MGQVCKB.js.map +0 -1
  113. package/dist/babyjubjub-MWZLJOVZ.cjs +0 -66
  114. package/dist/babyjubjub-MWZLJOVZ.cjs.map +0 -1
  115. package/dist/chunk-CWSUBAV3.js.map +0 -1
  116. package/dist/chunk-FVT2XRRL.cjs.map +0 -1
  117. package/dist/chunk-JWNXBALH.cjs +0 -57
  118. package/dist/chunk-JWNXBALH.cjs.map +0 -1
  119. package/dist/chunk-NDM5EJEV.cjs.map +0 -1
  120. package/dist/chunk-P37MRZ73.js.map +0 -1
  121. package/dist/chunk-PTDVGWHU.cjs +0 -10
  122. package/dist/chunk-PTDVGWHU.cjs.map +0 -1
  123. package/dist/chunk-S4B7GYLN.js.map +0 -1
  124. package/dist/chunk-SQKBT2SH.cjs.map +0 -1
  125. package/dist/chunk-TSF6HEVS.cjs +0 -201
  126. package/dist/chunk-TSF6HEVS.cjs.map +0 -1
  127. package/dist/chunk-UAVWYXDN.js +0 -8
  128. package/dist/chunk-UAVWYXDN.js.map +0 -1
  129. package/dist/chunk-V23OSL25.js +0 -48
  130. package/dist/chunk-V23OSL25.js.map +0 -1
  131. package/dist/chunk-YOWDERVC.js +0 -186
  132. package/dist/chunk-YOWDERVC.js.map +0 -1
  133. package/dist/merkle-7KS2EHRF.js +0 -5
  134. package/dist/merkle-HGDC6OB4.cjs +0 -30
  135. package/dist/poseidon-UHTJLWQM.js +0 -7
  136. package/dist/poseidon-WHJSZSNP.cjs +0 -45
  137. package/dist/proof-5OECB3RQ.cjs +0 -45
  138. package/dist/proof-C4YBP6RY.js +0 -4
  139. package/dist/transfer-42C4DXYA.cjs +0 -37
  140. package/dist/transfer-F6YOQTUL.js +0 -8
@@ -1,5 +1,5 @@
1
- import { ax as NoteCreationResult, ay as ShieldedNote, O as TransferStage, I as SwapOrderEvent } from '../transfer-BzyernBd.cjs';
2
- export { A as ASPProof, aF as ASP_TREE_DEPTH, aD as IndexerConfig, aC as ProofSystemType, aE as SignTypedDataFn, aB as UPPAccountContextType, aA as UPPAccountProvider, Y as buildASPTree, a2 as computeMultiOriginASPRoot, a5 as computeSingleOriginASPRoot, ae as generateASPProof, ag as generateMultiOriginASPProof, ai as generateSingleOriginASPProof, az as useUPPAccount } from '../transfer-BzyernBd.cjs';
1
+ import { ax as NoteCreationResult, ay as ShieldedNote, O as TransferStage, I as SwapOrderEvent } from '../transfer-D111ihqN.cjs';
2
+ export { A as ASPProof, aF as ASP_TREE_DEPTH, aD as IndexerConfig, aC as ProofSystemType, aE as SignTypedDataFn, aB as UPPAccountContextType, aA as UPPAccountProvider, Y as buildASPTree, a2 as computeMultiOriginASPRoot, a5 as computeSingleOriginASPRoot, ae as generateASPProof, ag as generateMultiOriginASPProof, ai as generateSingleOriginASPProof, az as useUPPAccount } from '../transfer-D111ihqN.cjs';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
5
  import { CSSProperties } from 'react';
@@ -253,8 +253,11 @@ interface PoolTransferParams {
253
253
  interface PoolTransferBuildData {
254
254
  /** Circuit used: 'transfer' for UPP 1-in-2-out */
255
255
  circuit: 'transfer';
256
- /** Formatted proof as uint256[8] */
257
- proof: bigint[];
256
+ /** PLONK proof bytes for contract call */
257
+ proof: {
258
+ proofBytes: `0x${string}`;
259
+ publicSignals: bigint[];
260
+ };
258
261
  /** Nullifier */
259
262
  nullifier: Hex;
260
263
  /** Merkle state root */
@@ -333,8 +336,11 @@ interface WithdrawParams {
333
336
  * Withdraw build data - everything needed to call the contract
334
337
  */
335
338
  interface WithdrawBuildData {
336
- /** Formatted proof as uint256[8] */
337
- proof: bigint[];
339
+ /** PLONK proof bytes for contract call */
340
+ proof: {
341
+ proofBytes: `0x${string}`;
342
+ publicSignals: bigint[];
343
+ };
338
344
  /** Nullifier of the note being spent */
339
345
  nullifier: Hex;
340
346
  /** Merkle state root */
@@ -539,8 +545,11 @@ interface SwapConfig {
539
545
  * Build data returned by buildPlaceOrder — everything needed for the contract call
540
546
  */
541
547
  interface PlaceOrderBuildData {
542
- /** Formatted proof as uint256[8] */
543
- proof: bigint[];
548
+ /** PLONK proof bytes for contract call */
549
+ proof: {
550
+ proofBytes: `0x${string}`;
551
+ publicSignals: bigint[];
552
+ };
544
553
  /** Nullifier (= orderId) */
545
554
  nullifier: Hex;
546
555
  /** Merkle state root */
@@ -572,8 +581,11 @@ interface PlaceOrderBuildData {
572
581
  * Build data returned by buildFillOrder
573
582
  */
574
583
  interface FillOrderBuildData {
575
- /** Formatted proof as uint256[8] */
576
- proof: bigint[];
584
+ /** PLONK proof bytes for contract call */
585
+ proof: {
586
+ proofBytes: `0x${string}`;
587
+ publicSignals: bigint[];
588
+ };
577
589
  /** Filler's nullifier */
578
590
  nullifier: Hex;
579
591
  /** Merkle state root */
@@ -642,8 +654,11 @@ interface SplitNoteParams {
642
654
  aspProof?: ASPProofParam;
643
655
  }
644
656
  interface SplitNoteBuildData {
645
- /** Transfer proof for contract call */
646
- proof: bigint[];
657
+ /** PLONK proof bytes for contract call */
658
+ proof: {
659
+ proofBytes: `0x${string}`;
660
+ publicSignals: bigint[];
661
+ };
647
662
  /** Nullifier */
648
663
  nullifier: Hex;
649
664
  /** Merkle state root */
@@ -1,5 +1,5 @@
1
- import { ax as NoteCreationResult, ay as ShieldedNote, O as TransferStage, I as SwapOrderEvent } from '../transfer-sqS6mJko.js';
2
- export { A as ASPProof, aF as ASP_TREE_DEPTH, aD as IndexerConfig, aC as ProofSystemType, aE as SignTypedDataFn, aB as UPPAccountContextType, aA as UPPAccountProvider, Y as buildASPTree, a2 as computeMultiOriginASPRoot, a5 as computeSingleOriginASPRoot, ae as generateASPProof, ag as generateMultiOriginASPProof, ai as generateSingleOriginASPProof, az as useUPPAccount } from '../transfer-sqS6mJko.js';
1
+ import { ax as NoteCreationResult, ay as ShieldedNote, O as TransferStage, I as SwapOrderEvent } from '../transfer-DvIXqHCr.js';
2
+ export { A as ASPProof, aF as ASP_TREE_DEPTH, aD as IndexerConfig, aC as ProofSystemType, aE as SignTypedDataFn, aB as UPPAccountContextType, aA as UPPAccountProvider, Y as buildASPTree, a2 as computeMultiOriginASPRoot, a5 as computeSingleOriginASPRoot, ae as generateASPProof, ag as generateMultiOriginASPProof, ai as generateSingleOriginASPProof, az as useUPPAccount } from '../transfer-DvIXqHCr.js';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
5
  import { CSSProperties } from 'react';
@@ -253,8 +253,11 @@ interface PoolTransferParams {
253
253
  interface PoolTransferBuildData {
254
254
  /** Circuit used: 'transfer' for UPP 1-in-2-out */
255
255
  circuit: 'transfer';
256
- /** Formatted proof as uint256[8] */
257
- proof: bigint[];
256
+ /** PLONK proof bytes for contract call */
257
+ proof: {
258
+ proofBytes: `0x${string}`;
259
+ publicSignals: bigint[];
260
+ };
258
261
  /** Nullifier */
259
262
  nullifier: Hex;
260
263
  /** Merkle state root */
@@ -333,8 +336,11 @@ interface WithdrawParams {
333
336
  * Withdraw build data - everything needed to call the contract
334
337
  */
335
338
  interface WithdrawBuildData {
336
- /** Formatted proof as uint256[8] */
337
- proof: bigint[];
339
+ /** PLONK proof bytes for contract call */
340
+ proof: {
341
+ proofBytes: `0x${string}`;
342
+ publicSignals: bigint[];
343
+ };
338
344
  /** Nullifier of the note being spent */
339
345
  nullifier: Hex;
340
346
  /** Merkle state root */
@@ -539,8 +545,11 @@ interface SwapConfig {
539
545
  * Build data returned by buildPlaceOrder — everything needed for the contract call
540
546
  */
541
547
  interface PlaceOrderBuildData {
542
- /** Formatted proof as uint256[8] */
543
- proof: bigint[];
548
+ /** PLONK proof bytes for contract call */
549
+ proof: {
550
+ proofBytes: `0x${string}`;
551
+ publicSignals: bigint[];
552
+ };
544
553
  /** Nullifier (= orderId) */
545
554
  nullifier: Hex;
546
555
  /** Merkle state root */
@@ -572,8 +581,11 @@ interface PlaceOrderBuildData {
572
581
  * Build data returned by buildFillOrder
573
582
  */
574
583
  interface FillOrderBuildData {
575
- /** Formatted proof as uint256[8] */
576
- proof: bigint[];
584
+ /** PLONK proof bytes for contract call */
585
+ proof: {
586
+ proofBytes: `0x${string}`;
587
+ publicSignals: bigint[];
588
+ };
577
589
  /** Filler's nullifier */
578
590
  nullifier: Hex;
579
591
  /** Merkle state root */
@@ -642,8 +654,11 @@ interface SplitNoteParams {
642
654
  aspProof?: ASPProofParam;
643
655
  }
644
656
  interface SplitNoteBuildData {
645
- /** Transfer proof for contract call */
646
- proof: bigint[];
657
+ /** PLONK proof bytes for contract call */
658
+ proof: {
659
+ proofBytes: `0x${string}`;
660
+ publicSignals: bigint[];
661
+ };
647
662
  /** Nullifier */
648
663
  nullifier: Hex;
649
664
  /** Merkle state root */
@@ -1,9 +1,9 @@
1
- import { StorableAccountAdapter, init_stealth, stealth_exports, SWAP_ORDER_PLACED_EVENT, filterOrdersByTokenPair, filterOrdersByASP, generateCancelSecret, computeCancelKeyHash, computeGiveAmount, NoteStore } from '../chunk-QKI4QWLT.js';
2
- import { computeSingleOriginASPRoot } from '../chunk-P37MRZ73.js';
3
- export { ASP_TREE_DEPTH, buildASPTree, computeMultiOriginASPRoot, computeSingleOriginASPRoot, generateASPProof, generateMultiOriginASPProof, generateSingleOriginASPProof } from '../chunk-P37MRZ73.js';
1
+ import { StorableAccountAdapter, init_stealth, stealth_exports, SWAP_ORDER_PLACED_EVENT, filterOrdersByTokenPair, filterOrdersByASP, generateCancelSecret, computeCancelKeyHash, computeGiveAmount, NoteStore } from '../chunk-RNUG3EFC.js';
2
+ import { computeSingleOriginASPRoot } from '../chunk-6IEYWJVS.js';
3
+ export { ASP_TREE_DEPTH, buildASPTree, computeMultiOriginASPRoot, computeSingleOriginASPRoot, generateASPProof, generateMultiOriginASPProof, generateSingleOriginASPProof } from '../chunk-6IEYWJVS.js';
4
4
  import { createAutoAdapter } from '../chunk-XV72HNHN.js';
5
- import '../chunk-W77GRBO4.js';
6
- import { init_poseidon, BABYJUBJUB_SUBORDER } from '../chunk-V23OSL25.js';
5
+ import '../chunk-UQIM2KT3.js';
6
+ import { init_poseidon, BABYJUBJUB_SUBORDER } from '../chunk-5QSSX3KR.js';
7
7
  import { __toCommonJS } from '../chunk-Z6ZWNWWR.js';
8
8
  import { createContext, useState, useRef, useEffect, useCallback, useMemo, useContext } from 'react';
9
9
  import { keccak256, toBytes, toHex, getAddress, encodePacked } from 'viem';
@@ -802,11 +802,9 @@ function useUPPAccount() {
802
802
  }
803
803
  async function createHashBasedNote(sdk, amount, spendingSecret, ownerHash, viewingSecret, origin, token) {
804
804
  const blinding = await sdk.randomFieldElement();
805
- const pubkey = await sdk.privateToPublic(spendingSecret);
806
805
  const commitment = await sdk.poseidon([
807
806
  amount,
808
- pubkey.x,
809
- pubkey.y,
807
+ ownerHash,
810
808
  blinding,
811
809
  origin,
812
810
  token
@@ -818,8 +816,6 @@ async function createHashBasedNote(sdk, amount, spendingSecret, ownerHash, viewi
818
816
  commitment,
819
817
  ownerSecret: spendingSecret,
820
818
  ownerHash,
821
- pubkeyX: pubkey.x,
822
- pubkeyY: pubkey.y,
823
819
  blinding,
824
820
  encryptedNote,
825
821
  searchTag,
@@ -1601,16 +1597,16 @@ function usePoolTransfer(config) {
1601
1597
  const recipientNote = await createNoteForSelf(amount, origin, token);
1602
1598
  const changeNote = await createNoteForSelf(changeAmount, origin, token);
1603
1599
  const [transferModule, proofModule, aspModule] = await Promise.all([
1604
- import('../transfer-F6YOQTUL.js'),
1605
- import('../proof-C4YBP6RY.js'),
1606
- import('../asp-ZA3RGN7G.js')
1600
+ import('../transfer-MQMGSXTH.js'),
1601
+ import('../proof-JME3IZTX.js'),
1602
+ import('../asp-72WUGTQE.js')
1607
1603
  ]);
1608
1604
  const {
1609
1605
  syncMerkleTree,
1610
1606
  getMerkleProofsForNotes,
1611
1607
  buildUPPTransferCircuitInputs
1612
1608
  } = transferModule;
1613
- const { generateUPPProof, formatProofForContract } = proofModule;
1609
+ const { generateUPPProof, formatPlonkProofForContract } = proofModule;
1614
1610
  const { generateASPProof: generateASPProof2, DEMO_ASP_ID } = aspModule;
1615
1611
  setStage("syncing_merkle");
1616
1612
  const { tree, leaves } = await syncMerkleTree(cfg.publicClient, cfg.poolAddress);
@@ -1644,20 +1640,10 @@ function usePoolTransfer(config) {
1644
1640
  circuitInputs,
1645
1641
  cfg.circuitBaseUrl ?? "/circuits/"
1646
1642
  );
1647
- const formattedProof = formatProofForContract(proof);
1648
- const proofArray = [
1649
- formattedProof.a[0],
1650
- formattedProof.a[1],
1651
- formattedProof.b[0][0],
1652
- formattedProof.b[0][1],
1653
- formattedProof.b[1][0],
1654
- formattedProof.b[1][1],
1655
- formattedProof.c[0],
1656
- formattedProof.c[1]
1657
- ];
1643
+ const formattedProof = await formatPlonkProofForContract(proof);
1658
1644
  return {
1659
1645
  circuit: "transfer",
1660
- proof: proofArray,
1646
+ proof: formattedProof,
1661
1647
  nullifier: toHex(BigInt(circuitInputs.nullifier), { size: 32 }),
1662
1648
  stateRoot: BigInt(circuitInputs.stateRoot),
1663
1649
  aspRoot: BigInt(circuitInputs.aspRoot),
@@ -1760,12 +1746,12 @@ function useWithdraw(config) {
1760
1746
  const token = BigInt(selectedNote.token);
1761
1747
  setStage("creating_outputs");
1762
1748
  const [transferModule, proofModule, sdk] = await Promise.all([
1763
- import('../transfer-F6YOQTUL.js'),
1764
- import('../proof-C4YBP6RY.js'),
1749
+ import('../transfer-MQMGSXTH.js'),
1750
+ import('../proof-JME3IZTX.js'),
1765
1751
  import('../index.js')
1766
1752
  ]);
1767
1753
  const { syncMerkleTree, getMerkleProofsForNotes } = transferModule;
1768
- const { generateUPPProof, formatProofForContract } = proofModule;
1754
+ const { generateUPPProof, formatPlonkProofForContract } = proofModule;
1769
1755
  setStage("syncing_merkle");
1770
1756
  const { tree, leaves } = await syncMerkleTree(cfg.publicClient, cfg.poolAddress);
1771
1757
  const spendableNote = {
@@ -1830,20 +1816,10 @@ function useWithdraw(config) {
1830
1816
  circuitInputs,
1831
1817
  cfg.circuitBaseUrl ?? "/circuits/"
1832
1818
  );
1833
- const formattedProof = formatProofForContract(proof);
1819
+ const formattedProof = await formatPlonkProofForContract(proof);
1834
1820
  const stateRoot = stateRootBI;
1835
- const proofArray = [
1836
- formattedProof.a[0],
1837
- formattedProof.a[1],
1838
- formattedProof.b[0][0],
1839
- formattedProof.b[0][1],
1840
- formattedProof.b[1][0],
1841
- formattedProof.b[1][1],
1842
- formattedProof.c[0],
1843
- formattedProof.c[1]
1844
- ];
1845
1821
  return {
1846
- proof: proofArray,
1822
+ proof: formattedProof,
1847
1823
  nullifier: toHex(nullifier, { size: 32 }),
1848
1824
  stateRoot,
1849
1825
  aspRoot,
@@ -2140,13 +2116,13 @@ function useSwap(config) {
2140
2116
  }
2141
2117
  setStage("creating_outputs");
2142
2118
  const [transferModule, proofModule, sdk, aspModule] = await Promise.all([
2143
- import('../transfer-F6YOQTUL.js'),
2144
- import('../proof-C4YBP6RY.js'),
2119
+ import('../transfer-MQMGSXTH.js'),
2120
+ import('../proof-JME3IZTX.js'),
2145
2121
  import('../index.js'),
2146
- import('../asp-ZA3RGN7G.js')
2122
+ import('../asp-72WUGTQE.js')
2147
2123
  ]);
2148
2124
  const { syncMerkleTree, getMerkleProofsForNotes } = transferModule;
2149
- const { generateUPPProof, formatProofForContract } = proofModule;
2125
+ const { generateUPPProof, formatPlonkProofForContract } = proofModule;
2150
2126
  const { generateASPProof: generateASPProof2 } = aspModule;
2151
2127
  setStage("syncing_merkle");
2152
2128
  const { tree, leaves } = await syncMerkleTree(cfg.publicClient, cfg.poolAddress);
@@ -2211,23 +2187,13 @@ function useSwap(config) {
2211
2187
  circuitInputs,
2212
2188
  cfg.circuitBaseUrl ?? "/circuits/"
2213
2189
  );
2214
- const formattedProof = formatProofForContract(proof);
2215
- const proofArray = [
2216
- formattedProof.a[0],
2217
- formattedProof.a[1],
2218
- formattedProof.b[0][0],
2219
- formattedProof.b[0][1],
2220
- formattedProof.b[1][0],
2221
- formattedProof.b[1][1],
2222
- formattedProof.c[0],
2223
- formattedProof.c[1]
2224
- ];
2190
+ const formattedProof = await formatPlonkProofForContract(proof);
2225
2191
  const cancelSecret = generateCancelSecret();
2226
2192
  const cancelKeyHash = computeCancelKeyHash(cancelSecret);
2227
2193
  const currentBlock = await cfg.publicClient.getBlockNumber();
2228
2194
  const expiry = currentBlock + expiryBlocks;
2229
2195
  return {
2230
- proof: proofArray,
2196
+ proof: formattedProof,
2231
2197
  nullifier: toHex(nullifier, { size: 32 }),
2232
2198
  stateRoot: stateRootBI,
2233
2199
  aspRoot: aspProofData.aspRoot,
@@ -2292,13 +2258,13 @@ function useSwap(config) {
2292
2258
  }
2293
2259
  setStage("creating_outputs");
2294
2260
  const [transferModule, proofModule, sdk, aspModule] = await Promise.all([
2295
- import('../transfer-F6YOQTUL.js'),
2296
- import('../proof-C4YBP6RY.js'),
2261
+ import('../transfer-MQMGSXTH.js'),
2262
+ import('../proof-JME3IZTX.js'),
2297
2263
  import('../index.js'),
2298
- import('../asp-ZA3RGN7G.js')
2264
+ import('../asp-72WUGTQE.js')
2299
2265
  ]);
2300
2266
  const { syncMerkleTree, getMerkleProofsForNotes } = transferModule;
2301
- const { generateUPPProof, formatProofForContract } = proofModule;
2267
+ const { generateUPPProof, formatPlonkProofForContract } = proofModule;
2302
2268
  const { generateASPProof: generateASPProof2 } = aspModule;
2303
2269
  const fillerOrigin = ethAddress ? BigInt(ethAddress) : BigInt(masterKeys.ownerHash);
2304
2270
  const fillerNoteData = await createNoteForSelf(
@@ -2369,24 +2335,14 @@ function useSwap(config) {
2369
2335
  circuitInputs,
2370
2336
  cfg.circuitBaseUrl ?? "/circuits/"
2371
2337
  );
2372
- const formattedProof = formatProofForContract(proof);
2373
- const proofArray = [
2374
- formattedProof.a[0],
2375
- formattedProof.a[1],
2376
- formattedProof.b[0][0],
2377
- formattedProof.b[0][1],
2378
- formattedProof.b[1][0],
2379
- formattedProof.b[1][1],
2380
- formattedProof.c[0],
2381
- formattedProof.c[1]
2382
- ];
2338
+ const formattedProof = await formatPlonkProofForContract(proof);
2383
2339
  const { encodePacked: encodePacked3 } = await import('viem');
2384
2340
  const packedFillerNote = encodePacked3(
2385
2341
  ["uint64", "uint256", "bytes"],
2386
2342
  [fillerNoteData.searchTag, fillerNoteData.ownerHash, fillerNoteData.encryptedNote]
2387
2343
  );
2388
2344
  return {
2389
- proof: proofArray,
2345
+ proof: formattedProof,
2390
2346
  nullifier: toHex(nullifier, { size: 32 }),
2391
2347
  stateRoot: stateRootBI,
2392
2348
  aspRoot: aspProofData.aspRoot,
@@ -2522,12 +2478,12 @@ function useSwap(config) {
2522
2478
  createNoteForSelf(changeAmount, origin, token)
2523
2479
  ]);
2524
2480
  const [transferModule, proofModule, aspModule] = await Promise.all([
2525
- import('../transfer-F6YOQTUL.js'),
2526
- import('../proof-C4YBP6RY.js'),
2527
- import('../asp-ZA3RGN7G.js')
2481
+ import('../transfer-MQMGSXTH.js'),
2482
+ import('../proof-JME3IZTX.js'),
2483
+ import('../asp-72WUGTQE.js')
2528
2484
  ]);
2529
2485
  const { syncMerkleTree, getMerkleProofsForNotes, buildUPPTransferCircuitInputs } = transferModule;
2530
- const { generateUPPProof, formatProofForContract } = proofModule;
2486
+ const { generateUPPProof, formatPlonkProofForContract } = proofModule;
2531
2487
  const { generateASPProof: generateASPProof2, DEMO_ASP_ID } = aspModule;
2532
2488
  setStage("syncing_merkle");
2533
2489
  const { tree, leaves } = await syncMerkleTree(cfg.publicClient, cfg.poolAddress);
@@ -2557,17 +2513,7 @@ function useSwap(config) {
2557
2513
  circuitInputs,
2558
2514
  cfg.circuitBaseUrl ?? "/circuits/"
2559
2515
  );
2560
- const formattedProof = formatProofForContract(proof);
2561
- const proofArray = [
2562
- formattedProof.a[0],
2563
- formattedProof.a[1],
2564
- formattedProof.b[0][0],
2565
- formattedProof.b[0][1],
2566
- formattedProof.b[1][0],
2567
- formattedProof.b[1][1],
2568
- formattedProof.c[0],
2569
- formattedProof.c[1]
2570
- ];
2516
+ const formattedProof = await formatPlonkProofForContract(proof);
2571
2517
  const { encodePacked: encodePacked3 } = await import('viem');
2572
2518
  const packNote = (n) => encodePacked3(
2573
2519
  ["uint64", "uint256", "bytes"],
@@ -2601,7 +2547,7 @@ function useSwap(config) {
2601
2547
  timestamp: Date.now()
2602
2548
  };
2603
2549
  return {
2604
- proof: proofArray,
2550
+ proof: formattedProof,
2605
2551
  nullifier: toHex(BigInt(circuitInputs.nullifier), { size: 32 }),
2606
2552
  stateRoot: BigInt(circuitInputs.stateRoot),
2607
2553
  aspRoot: BigInt(circuitInputs.aspRoot),