@permissionless-technologies/upp-sdk 0.4.1 → 0.4.3

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 (57) hide show
  1. package/dist/{chunk-Q2E432UK.cjs → chunk-26SZPMEQ.cjs} +12 -12
  2. package/dist/{chunk-Q2E432UK.cjs.map → chunk-26SZPMEQ.cjs.map} +1 -1
  3. package/dist/{chunk-UTAJSERA.cjs → chunk-5BLMSTFQ.cjs} +2 -2
  4. package/dist/chunk-5BLMSTFQ.cjs.map +1 -0
  5. package/dist/{chunk-BZD5KJL3.cjs → chunk-5H2YAPYG.cjs} +14 -24
  6. package/dist/chunk-5H2YAPYG.cjs.map +1 -0
  7. package/dist/{chunk-OBBSIPEK.js → chunk-FCE42WFF.js} +4 -4
  8. package/dist/{chunk-OBBSIPEK.js.map → chunk-FCE42WFF.js.map} +1 -1
  9. package/dist/{chunk-W3HLIKC2.js → chunk-KRLRJ3HN.js} +46 -24
  10. package/dist/chunk-KRLRJ3HN.js.map +1 -0
  11. package/dist/{chunk-CEJN5ZE5.js → chunk-O6ALW7DB.js} +2 -2
  12. package/dist/chunk-O6ALW7DB.js.map +1 -0
  13. package/dist/{chunk-2G22R7AJ.cjs → chunk-RYEYGGE7.cjs} +46 -24
  14. package/dist/chunk-RYEYGGE7.cjs.map +1 -0
  15. package/dist/{chunk-MDF37354.js → chunk-X32ZI7UJ.js} +14 -24
  16. package/dist/chunk-X32ZI7UJ.js.map +1 -0
  17. package/dist/core/index.cjs +29 -29
  18. package/dist/core/index.d.cts +2 -2
  19. package/dist/core/index.d.ts +2 -2
  20. package/dist/core/index.js +5 -5
  21. package/dist/{index-D6nvfm59.d.ts → index--eNkOLiP.d.ts} +1 -1
  22. package/dist/{index-CL4vb3ej.d.cts → index-CRaFsQD3.d.cts} +1 -1
  23. package/dist/{index-CtcXgof_.d.ts → index-Cxm5E-J5.d.ts} +512 -46
  24. package/dist/{index-BgPdYxFS.d.cts → index-Mm_cz6Ie.d.cts} +512 -46
  25. package/dist/index.cjs +829 -231
  26. package/dist/index.cjs.map +1 -1
  27. package/dist/index.d.cts +3 -3
  28. package/dist/index.d.ts +3 -3
  29. package/dist/index.js +646 -48
  30. package/dist/index.js.map +1 -1
  31. package/dist/indexer/index.cjs +6 -6
  32. package/dist/indexer/index.d.cts +5 -5
  33. package/dist/indexer/index.d.ts +5 -5
  34. package/dist/indexer/index.js +1 -1
  35. package/dist/{proof-XR6XE5PJ.cjs → proof-VINVGL4F.cjs} +13 -13
  36. package/dist/{proof-XR6XE5PJ.cjs.map → proof-VINVGL4F.cjs.map} +1 -1
  37. package/dist/{proof-JME3IZTX.js → proof-XQG5DN5N.js} +3 -3
  38. package/dist/{proof-JME3IZTX.js.map → proof-XQG5DN5N.js.map} +1 -1
  39. package/dist/react/index.cjs +12 -13
  40. package/dist/react/index.cjs.map +1 -1
  41. package/dist/react/index.d.cts +7 -7
  42. package/dist/react/index.d.ts +7 -7
  43. package/dist/react/index.js +12 -13
  44. package/dist/react/index.js.map +1 -1
  45. package/dist/{transfer-PB6D5VCW.cjs → transfer-ALSSY3L4.cjs} +11 -11
  46. package/dist/{transfer-PB6D5VCW.cjs.map → transfer-ALSSY3L4.cjs.map} +1 -1
  47. package/dist/{transfer-DvIXqHCr.d.ts → transfer-Crvdq4VN.d.ts} +30 -18
  48. package/dist/{transfer-D111ihqN.d.cts → transfer-CwwsNdGL.d.cts} +30 -18
  49. package/dist/{transfer-MQMGSXTH.js → transfer-Y24QMHJI.js} +5 -5
  50. package/dist/{transfer-MQMGSXTH.js.map → transfer-Y24QMHJI.js.map} +1 -1
  51. package/package.json +1 -1
  52. package/dist/chunk-2G22R7AJ.cjs.map +0 -1
  53. package/dist/chunk-BZD5KJL3.cjs.map +0 -1
  54. package/dist/chunk-CEJN5ZE5.js.map +0 -1
  55. package/dist/chunk-MDF37354.js.map +0 -1
  56. package/dist/chunk-UTAJSERA.cjs.map +0 -1
  57. package/dist/chunk-W3HLIKC2.js.map +0 -1
@@ -1,5 +1,5 @@
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';
1
+ import { ax as NoteCreationResult, ay as PlonkProofStruct, az as ShieldedNote, O as TransferStage, I as SwapOrderEvent } from '../transfer-CwwsNdGL.cjs';
2
+ export { A as ASPProof, aG as ASP_TREE_DEPTH, aE as IndexerConfig, aD as ProofSystemType, aF as SignTypedDataFn, aC as UPPAccountContextType, aB as UPPAccountProvider, Y as buildASPTree, a2 as computeMultiOriginASPRoot, a5 as computeSingleOriginASPRoot, ae as generateASPProof, ag as generateMultiOriginASPProof, ai as generateSingleOriginASPProof, aA as useUPPAccount } from '../transfer-CwwsNdGL.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';
@@ -255,7 +255,7 @@ interface PoolTransferBuildData {
255
255
  circuit: 'transfer';
256
256
  /** PLONK proof bytes for contract call */
257
257
  proof: {
258
- proofBytes: `0x${string}`;
258
+ proofStruct: PlonkProofStruct;
259
259
  publicSignals: bigint[];
260
260
  };
261
261
  /** Nullifier */
@@ -338,7 +338,7 @@ interface WithdrawParams {
338
338
  interface WithdrawBuildData {
339
339
  /** PLONK proof bytes for contract call */
340
340
  proof: {
341
- proofBytes: `0x${string}`;
341
+ proofStruct: PlonkProofStruct;
342
342
  publicSignals: bigint[];
343
343
  };
344
344
  /** Nullifier of the note being spent */
@@ -547,7 +547,7 @@ interface SwapConfig {
547
547
  interface PlaceOrderBuildData {
548
548
  /** PLONK proof bytes for contract call */
549
549
  proof: {
550
- proofBytes: `0x${string}`;
550
+ proofStruct: PlonkProofStruct;
551
551
  publicSignals: bigint[];
552
552
  };
553
553
  /** Nullifier (= orderId) */
@@ -583,7 +583,7 @@ interface PlaceOrderBuildData {
583
583
  interface FillOrderBuildData {
584
584
  /** PLONK proof bytes for contract call */
585
585
  proof: {
586
- proofBytes: `0x${string}`;
586
+ proofStruct: PlonkProofStruct;
587
587
  publicSignals: bigint[];
588
588
  };
589
589
  /** Filler's nullifier */
@@ -656,7 +656,7 @@ interface SplitNoteParams {
656
656
  interface SplitNoteBuildData {
657
657
  /** PLONK proof bytes for contract call */
658
658
  proof: {
659
- proofBytes: `0x${string}`;
659
+ proofStruct: PlonkProofStruct;
660
660
  publicSignals: bigint[];
661
661
  };
662
662
  /** Nullifier */
@@ -1,5 +1,5 @@
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';
1
+ import { ax as NoteCreationResult, ay as PlonkProofStruct, az as ShieldedNote, O as TransferStage, I as SwapOrderEvent } from '../transfer-Crvdq4VN.js';
2
+ export { A as ASPProof, aG as ASP_TREE_DEPTH, aE as IndexerConfig, aD as ProofSystemType, aF as SignTypedDataFn, aC as UPPAccountContextType, aB as UPPAccountProvider, Y as buildASPTree, a2 as computeMultiOriginASPRoot, a5 as computeSingleOriginASPRoot, ae as generateASPProof, ag as generateMultiOriginASPProof, ai as generateSingleOriginASPProof, aA as useUPPAccount } from '../transfer-Crvdq4VN.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';
@@ -255,7 +255,7 @@ interface PoolTransferBuildData {
255
255
  circuit: 'transfer';
256
256
  /** PLONK proof bytes for contract call */
257
257
  proof: {
258
- proofBytes: `0x${string}`;
258
+ proofStruct: PlonkProofStruct;
259
259
  publicSignals: bigint[];
260
260
  };
261
261
  /** Nullifier */
@@ -338,7 +338,7 @@ interface WithdrawParams {
338
338
  interface WithdrawBuildData {
339
339
  /** PLONK proof bytes for contract call */
340
340
  proof: {
341
- proofBytes: `0x${string}`;
341
+ proofStruct: PlonkProofStruct;
342
342
  publicSignals: bigint[];
343
343
  };
344
344
  /** Nullifier of the note being spent */
@@ -547,7 +547,7 @@ interface SwapConfig {
547
547
  interface PlaceOrderBuildData {
548
548
  /** PLONK proof bytes for contract call */
549
549
  proof: {
550
- proofBytes: `0x${string}`;
550
+ proofStruct: PlonkProofStruct;
551
551
  publicSignals: bigint[];
552
552
  };
553
553
  /** Nullifier (= orderId) */
@@ -583,7 +583,7 @@ interface PlaceOrderBuildData {
583
583
  interface FillOrderBuildData {
584
584
  /** PLONK proof bytes for contract call */
585
585
  proof: {
586
- proofBytes: `0x${string}`;
586
+ proofStruct: PlonkProofStruct;
587
587
  publicSignals: bigint[];
588
588
  };
589
589
  /** Filler's nullifier */
@@ -656,7 +656,7 @@ interface SplitNoteParams {
656
656
  interface SplitNoteBuildData {
657
657
  /** PLONK proof bytes for contract call */
658
658
  proof: {
659
- proofBytes: `0x${string}`;
659
+ proofStruct: PlonkProofStruct;
660
660
  publicSignals: bigint[];
661
661
  };
662
662
  /** Nullifier */
@@ -511,11 +511,10 @@ function UPPAccountProvider({
511
511
  const tokenRaw = "0x" + Array.from(ptBytes.slice(84, 104)).map((b) => b.toString(16).padStart(2, "0")).join("");
512
512
  const origin = getAddress(originRaw);
513
513
  const token = getAddress(tokenRaw);
514
- const pubkey = await sdk.privateToPublic(spendingSecret);
514
+ const ownerHash = await sdk.poseidon([spendingSecret]);
515
515
  const expectedCommitment = await sdk.poseidon([
516
516
  amount,
517
- pubkey.x,
518
- pubkey.y,
517
+ ownerHash,
519
518
  blinding,
520
519
  BigInt(origin),
521
520
  BigInt(token)
@@ -1597,8 +1596,8 @@ function usePoolTransfer(config) {
1597
1596
  const recipientNote = await createNoteForSelf(amount, origin, token);
1598
1597
  const changeNote = await createNoteForSelf(changeAmount, origin, token);
1599
1598
  const [transferModule, proofModule, aspModule] = await Promise.all([
1600
- import('../transfer-MQMGSXTH.js'),
1601
- import('../proof-JME3IZTX.js'),
1599
+ import('../transfer-Y24QMHJI.js'),
1600
+ import('../proof-XQG5DN5N.js'),
1602
1601
  import('../asp-72WUGTQE.js')
1603
1602
  ]);
1604
1603
  const {
@@ -1746,8 +1745,8 @@ function useWithdraw(config) {
1746
1745
  const token = BigInt(selectedNote.token);
1747
1746
  setStage("creating_outputs");
1748
1747
  const [transferModule, proofModule, sdk] = await Promise.all([
1749
- import('../transfer-MQMGSXTH.js'),
1750
- import('../proof-JME3IZTX.js'),
1748
+ import('../transfer-Y24QMHJI.js'),
1749
+ import('../proof-XQG5DN5N.js'),
1751
1750
  import('../index.js')
1752
1751
  ]);
1753
1752
  const { syncMerkleTree, getMerkleProofsForNotes } = transferModule;
@@ -2116,8 +2115,8 @@ function useSwap(config) {
2116
2115
  }
2117
2116
  setStage("creating_outputs");
2118
2117
  const [transferModule, proofModule, sdk, aspModule] = await Promise.all([
2119
- import('../transfer-MQMGSXTH.js'),
2120
- import('../proof-JME3IZTX.js'),
2118
+ import('../transfer-Y24QMHJI.js'),
2119
+ import('../proof-XQG5DN5N.js'),
2121
2120
  import('../index.js'),
2122
2121
  import('../asp-72WUGTQE.js')
2123
2122
  ]);
@@ -2258,8 +2257,8 @@ function useSwap(config) {
2258
2257
  }
2259
2258
  setStage("creating_outputs");
2260
2259
  const [transferModule, proofModule, sdk, aspModule] = await Promise.all([
2261
- import('../transfer-MQMGSXTH.js'),
2262
- import('../proof-JME3IZTX.js'),
2260
+ import('../transfer-Y24QMHJI.js'),
2261
+ import('../proof-XQG5DN5N.js'),
2263
2262
  import('../index.js'),
2264
2263
  import('../asp-72WUGTQE.js')
2265
2264
  ]);
@@ -2478,8 +2477,8 @@ function useSwap(config) {
2478
2477
  createNoteForSelf(changeAmount, origin, token)
2479
2478
  ]);
2480
2479
  const [transferModule, proofModule, aspModule] = await Promise.all([
2481
- import('../transfer-MQMGSXTH.js'),
2482
- import('../proof-JME3IZTX.js'),
2480
+ import('../transfer-Y24QMHJI.js'),
2481
+ import('../proof-XQG5DN5N.js'),
2483
2482
  import('../asp-72WUGTQE.js')
2484
2483
  ]);
2485
2484
  const { syncMerkleTree, getMerkleProofsForNotes, buildUPPTransferCircuitInputs } = transferModule;