@permissionless-technologies/upp-sdk 0.3.1 → 0.3.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.
- package/dist/{chunk-4EDTZQ44.js → chunk-A4NHQ3ZY.js} +2 -2
- package/dist/{chunk-4EDTZQ44.js.map → chunk-A4NHQ3ZY.js.map} +1 -1
- package/dist/{chunk-4EMXHMJ5.cjs → chunk-DDO3H7SO.cjs} +2 -2
- package/dist/{chunk-4EMXHMJ5.cjs.map → chunk-DDO3H7SO.cjs.map} +1 -1
- package/dist/{chunk-IYOR5TCO.cjs → chunk-KXPZUBPI.cjs} +19 -6
- package/dist/chunk-KXPZUBPI.cjs.map +1 -0
- package/dist/{chunk-GS4UCMW4.js → chunk-OD2SDC4L.js} +3 -3
- package/dist/{chunk-GS4UCMW4.js.map → chunk-OD2SDC4L.js.map} +1 -1
- package/dist/{chunk-7F75NGNB.js → chunk-QKI4QWLT.js} +19 -6
- package/dist/chunk-QKI4QWLT.js.map +1 -0
- package/dist/{chunk-52PPS4AT.cjs → chunk-SJDPDHSD.cjs} +4 -4
- package/dist/{chunk-52PPS4AT.cjs.map → chunk-SJDPDHSD.cjs.map} +1 -1
- package/dist/{chunk-56LZ2RV6.js → chunk-SZ2ATSYI.js} +3 -3
- package/dist/{chunk-56LZ2RV6.js.map → chunk-SZ2ATSYI.js.map} +1 -1
- package/dist/{chunk-4MOXKZSE.cjs → chunk-YCUDP7Q4.cjs} +3 -3
- package/dist/{chunk-4MOXKZSE.cjs.map → chunk-YCUDP7Q4.cjs.map} +1 -1
- package/dist/core/index.cjs +55 -55
- package/dist/core/index.js +3 -3
- package/dist/index.cjs +63 -63
- package/dist/index.js +4 -4
- package/dist/indexer/index.cjs +6 -6
- package/dist/indexer/index.js +1 -1
- package/dist/react/index.cjs +24 -17
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +14 -7
- package/dist/react/index.js.map +1 -1
- package/dist/{transfer-4GJJTWMH.js → transfer-3QFLYTOI.js} +3 -3
- package/dist/{transfer-4GJJTWMH.js.map → transfer-3QFLYTOI.js.map} +1 -1
- package/dist/{transfer-CLBDOA63.cjs → transfer-USRM46JZ.cjs} +9 -9
- package/dist/{transfer-CLBDOA63.cjs.map → transfer-USRM46JZ.cjs.map} +1 -1
- package/package.json +1 -1
- package/src/deployments/31337.json +1 -1
- package/dist/chunk-7F75NGNB.js.map +0 -1
- package/dist/chunk-IYOR5TCO.cjs.map +0 -1
package/dist/react/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StorableAccountAdapter, init_stealth, stealth_exports, SWAP_ORDER_PLACED_EVENT, filterOrdersByTokenPair, filterOrdersByASP, generateCancelSecret, computeCancelKeyHash, computeGiveAmount, NoteStore } from '../chunk-
|
|
1
|
+
import { StorableAccountAdapter, init_stealth, stealth_exports, SWAP_ORDER_PLACED_EVENT, filterOrdersByTokenPair, filterOrdersByASP, generateCancelSecret, computeCancelKeyHash, computeGiveAmount, NoteStore } from '../chunk-QKI4QWLT.js';
|
|
2
2
|
import { computeSingleOriginASPRoot } from '../chunk-P37MRZ73.js';
|
|
3
3
|
export { ASP_TREE_DEPTH, buildASPTree, computeMultiOriginASPRoot, computeSingleOriginASPRoot, generateASPProof, generateMultiOriginASPProof, generateSingleOriginASPProof } from '../chunk-P37MRZ73.js';
|
|
4
4
|
import { createAutoAdapter } from '../chunk-XV72HNHN.js';
|
|
@@ -371,8 +371,9 @@ function UPPAccountProvider({
|
|
|
371
371
|
false,
|
|
372
372
|
["decrypt"]
|
|
373
373
|
);
|
|
374
|
+
const currentStore = noteStoreRef.current;
|
|
374
375
|
const existingCommitments = new Set(
|
|
375
|
-
notes.map((n) => n.commitment.toLowerCase())
|
|
376
|
+
(currentStore ? currentStore.getNotes() : notes).map((n) => n.commitment.toLowerCase())
|
|
376
377
|
);
|
|
377
378
|
const candidates = [];
|
|
378
379
|
console.log("[syncNotes] Scanning contract:", contractAddress, "\u2014 existing:", existingCommitments.size, "notes");
|
|
@@ -696,6 +697,12 @@ function UPPAccountProvider({
|
|
|
696
697
|
}
|
|
697
698
|
};
|
|
698
699
|
}, [liveSyncInterval]);
|
|
700
|
+
useEffect(() => {
|
|
701
|
+
const contractAddr = indexerConfig?.contractAddress;
|
|
702
|
+
if (!masterKeys || !publicClientProp || !contractAddr) return;
|
|
703
|
+
startLiveSync(contractAddr, publicClientProp);
|
|
704
|
+
return () => stopLiveSync();
|
|
705
|
+
}, [masterKeys, publicClientProp, indexerConfig?.contractAddress]);
|
|
699
706
|
const ownerHashHex = masterKeys ? toHex(masterKeys.ownerHash, { size: 32 }) : null;
|
|
700
707
|
const stealthAddress = useMemo(() => {
|
|
701
708
|
if (!masterKeys) return null;
|
|
@@ -1560,7 +1567,7 @@ function usePoolTransfer(config) {
|
|
|
1560
1567
|
const recipientNote = await createNoteForSelf(amount, origin, token);
|
|
1561
1568
|
const changeNote = await createNoteForSelf(changeAmount, origin, token);
|
|
1562
1569
|
const [transferModule, proofModule, aspModule] = await Promise.all([
|
|
1563
|
-
import('../transfer-
|
|
1570
|
+
import('../transfer-3QFLYTOI.js'),
|
|
1564
1571
|
import('../proof-C4YBP6RY.js'),
|
|
1565
1572
|
import('../asp-ZA3RGN7G.js')
|
|
1566
1573
|
]);
|
|
@@ -1719,7 +1726,7 @@ function useWithdraw(config) {
|
|
|
1719
1726
|
const token = BigInt(selectedNote.token);
|
|
1720
1727
|
setStage("creating_outputs");
|
|
1721
1728
|
const [transferModule, proofModule, sdk] = await Promise.all([
|
|
1722
|
-
import('../transfer-
|
|
1729
|
+
import('../transfer-3QFLYTOI.js'),
|
|
1723
1730
|
import('../proof-C4YBP6RY.js'),
|
|
1724
1731
|
import('../index.js')
|
|
1725
1732
|
]);
|
|
@@ -2098,7 +2105,7 @@ function useSwap(config) {
|
|
|
2098
2105
|
}
|
|
2099
2106
|
setStage("creating_outputs");
|
|
2100
2107
|
const [transferModule, proofModule, sdk, aspModule] = await Promise.all([
|
|
2101
|
-
import('../transfer-
|
|
2108
|
+
import('../transfer-3QFLYTOI.js'),
|
|
2102
2109
|
import('../proof-C4YBP6RY.js'),
|
|
2103
2110
|
import('../index.js'),
|
|
2104
2111
|
import('../asp-ZA3RGN7G.js')
|
|
@@ -2250,7 +2257,7 @@ function useSwap(config) {
|
|
|
2250
2257
|
}
|
|
2251
2258
|
setStage("creating_outputs");
|
|
2252
2259
|
const [transferModule, proofModule, sdk, aspModule] = await Promise.all([
|
|
2253
|
-
import('../transfer-
|
|
2260
|
+
import('../transfer-3QFLYTOI.js'),
|
|
2254
2261
|
import('../proof-C4YBP6RY.js'),
|
|
2255
2262
|
import('../index.js'),
|
|
2256
2263
|
import('../asp-ZA3RGN7G.js')
|
|
@@ -2480,7 +2487,7 @@ function useSwap(config) {
|
|
|
2480
2487
|
createNoteForSelf(changeAmount, origin, token)
|
|
2481
2488
|
]);
|
|
2482
2489
|
const [transferModule, proofModule, aspModule] = await Promise.all([
|
|
2483
|
-
import('../transfer-
|
|
2490
|
+
import('../transfer-3QFLYTOI.js'),
|
|
2484
2491
|
import('../proof-C4YBP6RY.js'),
|
|
2485
2492
|
import('../asp-ZA3RGN7G.js')
|
|
2486
2493
|
]);
|