@permissionless-technologies/upp-sdk 0.4.7 → 0.4.9
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.
- package/dist/react/index.cjs +14 -17
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +15 -18
- package/dist/react/index.js.map +1 -1
- package/package.json +1 -1
package/dist/react/index.cjs
CHANGED
|
@@ -604,7 +604,7 @@ function UPPAccountProvider({
|
|
|
604
604
|
const ownerSecret = BigInt(note.ownerSecret);
|
|
605
605
|
const commitment = BigInt(note.commitment);
|
|
606
606
|
const nullifier = await sdk2.poseidon([
|
|
607
|
-
ownerSecret
|
|
607
|
+
ownerSecret,
|
|
608
608
|
BigInt(correctLeaf),
|
|
609
609
|
commitment
|
|
610
610
|
]);
|
|
@@ -637,7 +637,7 @@ function UPPAccountProvider({
|
|
|
637
637
|
const ownerSecret = BigInt(note.ownerSecret);
|
|
638
638
|
const commitment = BigInt(note.commitment);
|
|
639
639
|
const nullifier = await sdk2.poseidon([
|
|
640
|
-
ownerSecret
|
|
640
|
+
ownerSecret,
|
|
641
641
|
BigInt(correctLeaf),
|
|
642
642
|
commitment
|
|
643
643
|
]);
|
|
@@ -1769,11 +1769,10 @@ function useWithdraw(config) {
|
|
|
1769
1769
|
const merkleProof = noteProof.proof;
|
|
1770
1770
|
const stateRootBI = merkleProof.root;
|
|
1771
1771
|
const actualLeafIndex = merkleProof.leafIndex;
|
|
1772
|
-
const
|
|
1772
|
+
const inputOwnerHash = chunkHEHXSV47_cjs.computeOwnerHash(BigInt(selectedNote.ownerSecret));
|
|
1773
1773
|
const localCommitment = await sdk.poseidon([
|
|
1774
1774
|
selectedNote.amount,
|
|
1775
|
-
|
|
1776
|
-
inputPubkey.y,
|
|
1775
|
+
inputOwnerHash,
|
|
1777
1776
|
selectedNote.blinding,
|
|
1778
1777
|
BigInt(selectedNote.origin),
|
|
1779
1778
|
BigInt(selectedNote.token)
|
|
@@ -1785,7 +1784,7 @@ function useWithdraw(config) {
|
|
|
1785
1784
|
);
|
|
1786
1785
|
}
|
|
1787
1786
|
const nullifier = await sdk.poseidon([
|
|
1788
|
-
BigInt(selectedNote.ownerSecret)
|
|
1787
|
+
BigInt(selectedNote.ownerSecret),
|
|
1789
1788
|
BigInt(actualLeafIndex),
|
|
1790
1789
|
storedCommitment
|
|
1791
1790
|
]);
|
|
@@ -1801,7 +1800,7 @@ function useWithdraw(config) {
|
|
|
1801
1800
|
// Private inputs - Input Note
|
|
1802
1801
|
// IMPORTANT: Use actualLeafIndex from Merkle proof, not stored leafIndex
|
|
1803
1802
|
inputAmount: selectedNote.amount.toString(),
|
|
1804
|
-
inputOneTimeSecret:
|
|
1803
|
+
inputOneTimeSecret: BigInt(selectedNote.ownerSecret).toString(),
|
|
1805
1804
|
inputBlinding: selectedNote.blinding.toString(),
|
|
1806
1805
|
inputOrigin: origin.toString(),
|
|
1807
1806
|
inputLeafIndex: actualLeafIndex.toString(),
|
|
@@ -2143,11 +2142,10 @@ function useSwap(config) {
|
|
|
2143
2142
|
const stateRootBI = merkleProof.root;
|
|
2144
2143
|
const actualLeafIndex = merkleProof.leafIndex;
|
|
2145
2144
|
setStage("generating_proof");
|
|
2146
|
-
const
|
|
2145
|
+
const inputOwnerHash = chunkHEHXSV47_cjs.computeOwnerHash(BigInt(selectedNote.ownerSecret));
|
|
2147
2146
|
const localCommitment = await sdk.poseidon([
|
|
2148
2147
|
selectedNote.amount,
|
|
2149
|
-
|
|
2150
|
-
inputPubkey.y,
|
|
2148
|
+
inputOwnerHash,
|
|
2151
2149
|
selectedNote.blinding,
|
|
2152
2150
|
origin,
|
|
2153
2151
|
token
|
|
@@ -2159,7 +2157,7 @@ function useSwap(config) {
|
|
|
2159
2157
|
);
|
|
2160
2158
|
}
|
|
2161
2159
|
const nullifier = await sdk.poseidon([
|
|
2162
|
-
BigInt(selectedNote.ownerSecret)
|
|
2160
|
+
BigInt(selectedNote.ownerSecret),
|
|
2163
2161
|
BigInt(actualLeafIndex),
|
|
2164
2162
|
storedCommitment
|
|
2165
2163
|
]);
|
|
@@ -2173,7 +2171,7 @@ function useSwap(config) {
|
|
|
2173
2171
|
token: token.toString(),
|
|
2174
2172
|
isRagequit: "0",
|
|
2175
2173
|
inputAmount: selectedNote.amount.toString(),
|
|
2176
|
-
inputOneTimeSecret:
|
|
2174
|
+
inputOneTimeSecret: BigInt(selectedNote.ownerSecret).toString(),
|
|
2177
2175
|
inputBlinding: selectedNote.blinding.toString(),
|
|
2178
2176
|
inputOrigin: origin.toString(),
|
|
2179
2177
|
inputLeafIndex: actualLeafIndex.toString(),
|
|
@@ -2291,11 +2289,10 @@ function useSwap(config) {
|
|
|
2291
2289
|
const stateRootBI = merkleProof.root;
|
|
2292
2290
|
const actualLeafIndex = merkleProof.leafIndex;
|
|
2293
2291
|
setStage("generating_proof");
|
|
2294
|
-
const
|
|
2292
|
+
const inputOwnerHashF = chunkHEHXSV47_cjs.computeOwnerHash(BigInt(selectedNote.ownerSecret));
|
|
2295
2293
|
const localCommitmentF = await sdk.poseidon([
|
|
2296
2294
|
selectedNote.amount,
|
|
2297
|
-
|
|
2298
|
-
inputPubkeyF.y,
|
|
2295
|
+
inputOwnerHashF,
|
|
2299
2296
|
selectedNote.blinding,
|
|
2300
2297
|
origin,
|
|
2301
2298
|
token
|
|
@@ -2307,7 +2304,7 @@ function useSwap(config) {
|
|
|
2307
2304
|
);
|
|
2308
2305
|
}
|
|
2309
2306
|
const nullifier = await sdk.poseidon([
|
|
2310
|
-
BigInt(selectedNote.ownerSecret)
|
|
2307
|
+
BigInt(selectedNote.ownerSecret),
|
|
2311
2308
|
BigInt(actualLeafIndex),
|
|
2312
2309
|
storedCommitmentF
|
|
2313
2310
|
]);
|
|
@@ -2321,7 +2318,7 @@ function useSwap(config) {
|
|
|
2321
2318
|
token: token.toString(),
|
|
2322
2319
|
isRagequit: "0",
|
|
2323
2320
|
inputAmount: selectedNote.amount.toString(),
|
|
2324
|
-
inputOneTimeSecret:
|
|
2321
|
+
inputOneTimeSecret: BigInt(selectedNote.ownerSecret).toString(),
|
|
2325
2322
|
inputBlinding: selectedNote.blinding.toString(),
|
|
2326
2323
|
inputOrigin: origin.toString(),
|
|
2327
2324
|
inputLeafIndex: actualLeafIndex.toString(),
|