@permissionless-technologies/upp-sdk 0.2.1 → 0.3.0

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 (67) hide show
  1. package/dist/chunk-3YZSIYJC.cjs +154 -0
  2. package/dist/chunk-3YZSIYJC.cjs.map +1 -0
  3. package/dist/{chunk-43U5RGYE.cjs → chunk-4N5BH43P.cjs} +2 -2
  4. package/dist/{chunk-43U5RGYE.cjs.map → chunk-4N5BH43P.cjs.map} +1 -1
  5. package/dist/{chunk-C7QQOJ7T.cjs → chunk-52PPS4AT.cjs} +4 -22
  6. package/dist/chunk-52PPS4AT.cjs.map +1 -0
  7. package/dist/{chunk-NUIQHTSA.js → chunk-7F75NGNB.js} +76 -3
  8. package/dist/chunk-7F75NGNB.js.map +1 -0
  9. package/dist/{chunk-SGZZL5AC.js → chunk-GS4UCMW4.js} +4 -20
  10. package/dist/chunk-GS4UCMW4.js.map +1 -0
  11. package/dist/{chunk-64RTC5ML.js → chunk-IU5P5VDV.js} +2 -2
  12. package/dist/{chunk-64RTC5ML.js.map → chunk-IU5P5VDV.js.map} +1 -1
  13. package/dist/{chunk-GXZ3MTCQ.cjs → chunk-IYOR5TCO.cjs} +77 -2
  14. package/dist/chunk-IYOR5TCO.cjs.map +1 -0
  15. package/dist/{chunk-GQV47S3N.cjs → chunk-PTDVGWHU.cjs} +2 -2
  16. package/dist/{chunk-GQV47S3N.cjs.map → chunk-PTDVGWHU.cjs.map} +1 -1
  17. package/dist/{chunk-CZ23JMAQ.js → chunk-QBCLFGMV.js} +3 -3
  18. package/dist/{chunk-CZ23JMAQ.js.map → chunk-QBCLFGMV.js.map} +1 -1
  19. package/dist/{chunk-NCW4AE7L.js → chunk-UAVWYXDN.js} +2 -2
  20. package/dist/chunk-UAVWYXDN.js.map +1 -0
  21. package/dist/{chunk-46GGZ3TC.cjs → chunk-X4DLTVOG.cjs} +3 -3
  22. package/dist/{chunk-46GGZ3TC.cjs.map → chunk-X4DLTVOG.cjs.map} +1 -1
  23. package/dist/chunk-XBNYAAMU.js +140 -0
  24. package/dist/chunk-XBNYAAMU.js.map +1 -0
  25. package/dist/core/index.cjs +67 -61
  26. package/dist/core/index.d.cts +3 -2
  27. package/dist/core/index.d.ts +3 -2
  28. package/dist/core/index.js +5 -3
  29. package/dist/{index-BGvapsJy.d.cts → index-B45-okum.d.cts} +19 -3
  30. package/dist/{index-ChGaGPzP.d.ts → index-BIcvNMPt.d.ts} +19 -3
  31. package/dist/{index-BBzvvrhG.d.ts → index-DwAJBoU7.d.ts} +122 -96
  32. package/dist/{index-C-jSNw6j.d.cts → index-o-Ds3YAq.d.cts} +122 -96
  33. package/dist/index.cjs +123 -70
  34. package/dist/index.cjs.map +1 -1
  35. package/dist/index.d.cts +4 -3
  36. package/dist/index.d.ts +4 -3
  37. package/dist/index.js +6 -5
  38. package/dist/index.js.map +1 -1
  39. package/dist/indexer/index.cjs +6 -6
  40. package/dist/indexer/index.d.cts +6 -5
  41. package/dist/indexer/index.d.ts +6 -5
  42. package/dist/indexer/index.js +1 -1
  43. package/dist/react/index.cjs +107 -102
  44. package/dist/react/index.cjs.map +1 -1
  45. package/dist/react/index.d.cts +2 -2
  46. package/dist/react/index.d.ts +2 -2
  47. package/dist/react/index.js +100 -95
  48. package/dist/react/index.js.map +1 -1
  49. package/dist/stark-BcTD1OaJ.d.cts +185 -0
  50. package/dist/stark-BcTD1OaJ.d.ts +185 -0
  51. package/dist/{transfer-SA4NHNJ7.cjs → transfer-6ZIVZ6JY.cjs} +9 -9
  52. package/dist/{transfer-SA4NHNJ7.cjs.map → transfer-6ZIVZ6JY.cjs.map} +1 -1
  53. package/dist/{transfer-DKZuJnRM.d.cts → transfer-BzyernBd.d.cts} +1 -3
  54. package/dist/{transfer-4OF2JWXX.js → transfer-CDXC3OQW.js} +3 -3
  55. package/dist/{transfer-4OF2JWXX.js.map → transfer-CDXC3OQW.js.map} +1 -1
  56. package/dist/{transfer-BlmbO-Rd.d.ts → transfer-sqS6mJko.d.ts} +1 -3
  57. package/dist/utils/index.cjs +54 -1
  58. package/dist/utils/index.d.cts +2 -0
  59. package/dist/utils/index.d.ts +2 -0
  60. package/dist/utils/index.js +2 -1
  61. package/package.json +1 -1
  62. package/src/deployments/31337.json +1 -1
  63. package/dist/chunk-C7QQOJ7T.cjs.map +0 -1
  64. package/dist/chunk-GXZ3MTCQ.cjs.map +0 -1
  65. package/dist/chunk-NCW4AE7L.js.map +0 -1
  66. package/dist/chunk-NUIQHTSA.js.map +0 -1
  67. package/dist/chunk-SGZZL5AC.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunk43U5RGYE_cjs = require('../chunk-43U5RGYE.cjs');
3
+ var chunk4N5BH43P_cjs = require('../chunk-4N5BH43P.cjs');
4
4
  var chunkERQE57IA_cjs = require('../chunk-ERQE57IA.cjs');
5
5
  require('../chunk-G7VZBCD6.cjs');
6
6
 
@@ -8,23 +8,23 @@ require('../chunk-G7VZBCD6.cjs');
8
8
 
9
9
  Object.defineProperty(exports, "computeSearchTag", {
10
10
  enumerable: true,
11
- get: function () { return chunk43U5RGYE_cjs.computeSearchTag; }
11
+ get: function () { return chunk4N5BH43P_cjs.computeSearchTag; }
12
12
  });
13
13
  Object.defineProperty(exports, "makeRpcIndexer", {
14
14
  enumerable: true,
15
- get: function () { return chunk43U5RGYE_cjs.makeRpcIndexer; }
15
+ get: function () { return chunk4N5BH43P_cjs.makeRpcIndexer; }
16
16
  });
17
17
  Object.defineProperty(exports, "matchesSearchTag", {
18
18
  enumerable: true,
19
- get: function () { return chunk43U5RGYE_cjs.matchesSearchTag; }
19
+ get: function () { return chunk4N5BH43P_cjs.matchesSearchTag; }
20
20
  });
21
21
  Object.defineProperty(exports, "tryDecryptNote", {
22
22
  enumerable: true,
23
- get: function () { return chunk43U5RGYE_cjs.tryDecryptNote; }
23
+ get: function () { return chunk4N5BH43P_cjs.tryDecryptNote; }
24
24
  });
25
25
  Object.defineProperty(exports, "unpackNoteData", {
26
26
  enumerable: true,
27
- get: function () { return chunk43U5RGYE_cjs.unpackNoteData; }
27
+ get: function () { return chunk4N5BH43P_cjs.unpackNoteData; }
28
28
  });
29
29
  Object.defineProperty(exports, "createAutoAdapter", {
30
30
  enumerable: true,
@@ -1,15 +1,16 @@
1
- import { S as StorageAdapter } from '../index-C-jSNw6j.cjs';
2
- export { C as CommitmentInsertedArgs, a as IndexedNote, I as Indexer, f as IndexerState, L as LiveSyncConfig, b as NoteFilters, N as NoteStatus, j as NullifiedArgs, R as RpcIndexerConfig, h as SerializedNote, i as StealthTransactArgs, e as SyncConfig, d as SyncProgress, c as SyncResult, g as SyncState } from '../index-C-jSNw6j.cjs';
3
- import { _ as ___index_js } from '../index-BGvapsJy.cjs';
4
- export { m as makeRpcIndexer } from '../index-BGvapsJy.cjs';
1
+ import { S as StorageAdapter } from '../index-o-Ds3YAq.cjs';
2
+ export { C as CommitmentInsertedArgs, a as IndexedNote, I as Indexer, f as IndexerState, L as LiveSyncConfig, b as NoteFilters, N as NoteStatus, j as NullifiedArgs, R as RpcIndexerConfig, h as SerializedNote, i as StealthTransactArgs, e as SyncConfig, d as SyncProgress, c as SyncResult, g as SyncState } from '../index-o-Ds3YAq.cjs';
3
+ import { _ as ___index_js } from '../index-B45-okum.cjs';
4
+ export { m as makeRpcIndexer } from '../index-B45-okum.cjs';
5
5
  import { Hex } from 'viem';
6
6
  import { P as Point } from '../merkle-mteVOlDf.cjs';
7
- import '../transfer-DKZuJnRM.cjs';
7
+ import '../transfer-BzyernBd.cjs';
8
8
  import '../keccak-m31-B_AqBbRF.cjs';
9
9
  import '@permissionless-technologies/upc-sdk';
10
10
  import 'react/jsx-runtime';
11
11
  import 'react';
12
12
  import '../types-CJSbxv4q.cjs';
13
+ import '../stark-BcTD1OaJ.cjs';
13
14
  import '../keys/index.cjs';
14
15
  import '../utils/index.cjs';
15
16
 
@@ -1,15 +1,16 @@
1
- import { S as StorageAdapter } from '../index-BBzvvrhG.js';
2
- export { C as CommitmentInsertedArgs, a as IndexedNote, I as Indexer, f as IndexerState, L as LiveSyncConfig, b as NoteFilters, N as NoteStatus, j as NullifiedArgs, R as RpcIndexerConfig, h as SerializedNote, i as StealthTransactArgs, e as SyncConfig, d as SyncProgress, c as SyncResult, g as SyncState } from '../index-BBzvvrhG.js';
3
- import { _ as ___index_js } from '../index-ChGaGPzP.js';
4
- export { m as makeRpcIndexer } from '../index-ChGaGPzP.js';
1
+ import { S as StorageAdapter } from '../index-DwAJBoU7.js';
2
+ export { C as CommitmentInsertedArgs, a as IndexedNote, I as Indexer, f as IndexerState, L as LiveSyncConfig, b as NoteFilters, N as NoteStatus, j as NullifiedArgs, R as RpcIndexerConfig, h as SerializedNote, i as StealthTransactArgs, e as SyncConfig, d as SyncProgress, c as SyncResult, g as SyncState } from '../index-DwAJBoU7.js';
3
+ import { _ as ___index_js } from '../index-BIcvNMPt.js';
4
+ export { m as makeRpcIndexer } from '../index-BIcvNMPt.js';
5
5
  import { Hex } from 'viem';
6
6
  import { P as Point } from '../merkle-mteVOlDf.js';
7
- import '../transfer-BlmbO-Rd.js';
7
+ import '../transfer-sqS6mJko.js';
8
8
  import '../keccak-m31-B_AqBbRF.js';
9
9
  import '@permissionless-technologies/upc-sdk';
10
10
  import 'react/jsx-runtime';
11
11
  import 'react';
12
12
  import '../types-mLybMxNR.js';
13
+ import '../stark-BcTD1OaJ.js';
13
14
  import '../keys/index.js';
14
15
  import '../utils/index.js';
15
16
 
@@ -1,4 +1,4 @@
1
- export { computeSearchTag, makeRpcIndexer, matchesSearchTag, tryDecryptNote, unpackNoteData } from '../chunk-64RTC5ML.js';
1
+ export { computeSearchTag, makeRpcIndexer, matchesSearchTag, tryDecryptNote, unpackNoteData } from '../chunk-IU5P5VDV.js';
2
2
  export { createAutoAdapter, createIndexedDBAdapter, createLocalStorageAdapter, createMemoryAdapter, indexedDBAdapter, localStorageAdapter, memoryAdapter } from '../chunk-XV72HNHN.js';
3
3
  import '../chunk-Z6ZWNWWR.js';
4
4
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkGXZ3MTCQ_cjs = require('../chunk-GXZ3MTCQ.cjs');
3
+ var chunkIYOR5TCO_cjs = require('../chunk-IYOR5TCO.cjs');
4
4
  var chunkNDM5EJEV_cjs = require('../chunk-NDM5EJEV.cjs');
5
5
  var chunkERQE57IA_cjs = require('../chunk-ERQE57IA.cjs');
6
6
  require('../chunk-3HQ7A6ZM.cjs');
@@ -90,98 +90,103 @@ function UPPAccountProvider({
90
90
  const unwatchRef = react.useRef(null);
91
91
  const syncPromiseRef = react.useRef(null);
92
92
  const noteStoreRef = react.useRef(null);
93
+ const accountAdapterRef = react.useRef(null);
93
94
  react.useEffect(() => {
94
95
  loadSDK().then(() => setCryptoReady(true));
95
96
  }, []);
96
97
  react.useEffect(() => {
97
98
  let noteStoreUnsub = null;
99
+ let cancelled = false;
98
100
  if (typeof window === "undefined") return;
99
101
  if (!ethAddress || !cryptoReady) {
100
102
  setMasterKeys(null);
101
103
  setStarkMasterKeys(null);
102
104
  setNotes([]);
103
105
  noteStoreRef.current = null;
106
+ accountAdapterRef.current = null;
104
107
  return;
105
108
  }
106
- const saved = localStorage.getItem(getStorageKey(ethAddress));
107
- if (saved) {
108
- try {
109
- const parsed = JSON.parse(saved);
110
- if (!parsed.starkSecret || !parsed.spendingSecret) {
111
- console.log("[UPPAccount] Invalid account data, clearing...");
112
- localStorage.removeItem(getStorageKey(ethAddress));
113
- setMasterKeys(null);
114
- setStarkMasterKeys(null);
115
- setNotes([]);
116
- return;
117
- }
118
- const keys = {
119
- spendingSecret: BigInt(parsed.spendingSecret),
120
- ownerHash: BigInt(parsed.ownerHash),
121
- viewingSecret: BigInt(parsed.viewingSecret),
122
- viewingHash: BigInt(parsed.viewingHash)
123
- };
124
- setMasterKeys(keys);
125
- if (parsed.starkSecret) {
126
- const starkKeys = {
127
- starkSecret: parsed.starkSecret.map((s) => BigInt(s)),
128
- starkOwnerHash: parsed.starkOwnerHash.map((s) => BigInt(s)),
129
- starkViewingSecret: parsed.starkViewingSecret.map((s) => BigInt(s)),
130
- starkViewingHash: parsed.starkViewingHash.map((s) => BigInt(s))
131
- };
132
- setStarkMasterKeys(starkKeys);
109
+ const accountStorage = chunkERQE57IA_cjs.createAutoAdapter(`upp_account`);
110
+ const adapter = new chunkIYOR5TCO_cjs.StorableAccountAdapter(accountStorage, ethAddress);
111
+ accountAdapterRef.current = adapter;
112
+ const legacyKey = getStorageKey(ethAddress);
113
+ const legacySaved = typeof window !== "undefined" ? localStorage.getItem(legacyKey) : null;
114
+ const init = async () => {
115
+ let account = await adapter.load();
116
+ if (!account && legacySaved) {
117
+ try {
118
+ const parsed = JSON.parse(legacySaved);
119
+ if (parsed.spendingSecret && parsed.starkSecret) {
120
+ const keys = {
121
+ spendingSecret: BigInt(parsed.spendingSecret),
122
+ ownerHash: BigInt(parsed.ownerHash),
123
+ viewingSecret: BigInt(parsed.viewingSecret),
124
+ viewingHash: BigInt(parsed.viewingHash)
125
+ };
126
+ const starkKeys = {
127
+ starkSecret: parsed.starkSecret.map((s) => BigInt(s)),
128
+ starkOwnerHash: parsed.starkOwnerHash.map((s) => BigInt(s)),
129
+ starkViewingSecret: parsed.starkViewingSecret.map((s) => BigInt(s)),
130
+ starkViewingHash: parsed.starkViewingHash.map((s) => BigInt(s))
131
+ };
132
+ await adapter.save(keys, starkKeys);
133
+ account = { keys, starkKeys };
134
+ console.log("[UPPAccount] Migrated account from legacy localStorage");
135
+ }
136
+ } catch {
133
137
  }
134
- const ownerHashHex2 = viem.toHex(keys.ownerHash, { size: 32 });
135
- const storagePrefix = `upp_${chainId}_${ownerHashHex2.slice(0, 12)}`;
136
- const storage = chunkERQE57IA_cjs.createAutoAdapter(storagePrefix);
137
- const store = new chunkGXZ3MTCQ_cjs.NoteStore(storage, "notes");
138
- noteStoreRef.current = store;
139
- noteStoreUnsub = store.onChange(() => {
140
- setNotes([...store.getNotes()]);
141
- });
142
- store.load().then(() => {
143
- if (store.getNotes().length === 0) {
144
- const legacyKey = getNotesStorageKey(chainId, ownerHashHex2.slice(0, 12));
145
- const legacyNotes = localStorage.getItem(legacyKey);
146
- if (legacyNotes) {
147
- try {
148
- const parsed2 = JSON.parse(legacyNotes);
149
- const migrated = parsed2.map((n) => ({
150
- ...n,
151
- amount: BigInt(n.amount),
152
- blinding: BigInt(n.blinding),
153
- origin: n.origin ?? "0x0000000000000000000000000000000000000000",
154
- token: n.token ?? "0x0000000000000000000000000000000000000000",
155
- proofSystem: n.proofSystem ?? "snark"
156
- }));
157
- store.addNotes(migrated);
158
- store.persist();
159
- console.log(`[NoteStore] Migrated ${migrated.length} legacy notes`);
160
- } catch {
161
- }
162
- }
138
+ }
139
+ if (cancelled) return;
140
+ if (!account) {
141
+ setMasterKeys(null);
142
+ setStarkMasterKeys(null);
143
+ setNotes([]);
144
+ return;
145
+ }
146
+ setMasterKeys(account.keys);
147
+ if (account.starkKeys) setStarkMasterKeys(account.starkKeys);
148
+ const ownerHashHex2 = viem.toHex(account.keys.ownerHash, { size: 32 });
149
+ const storagePrefix = `upp_${chainId}_${ownerHashHex2.slice(0, 12)}`;
150
+ const noteStorage = chunkERQE57IA_cjs.createAutoAdapter(storagePrefix);
151
+ const store = new chunkIYOR5TCO_cjs.NoteStore(noteStorage, "notes");
152
+ noteStoreRef.current = store;
153
+ noteStoreUnsub = store.onChange(() => {
154
+ if (!cancelled) setNotes([...store.getNotes()]);
155
+ });
156
+ await store.load();
157
+ if (store.getNotes().length === 0) {
158
+ const legacyNotesKey = getNotesStorageKey(chainId, ownerHashHex2.slice(0, 12));
159
+ const legacyNotes = typeof window !== "undefined" ? localStorage.getItem(legacyNotesKey) : null;
160
+ if (legacyNotes) {
161
+ try {
162
+ const parsed = JSON.parse(legacyNotes);
163
+ const migrated = parsed.map((n) => ({
164
+ ...n,
165
+ amount: BigInt(n.amount),
166
+ blinding: BigInt(n.blinding),
167
+ origin: n.origin ?? "0x0000000000000000000000000000000000000000",
168
+ token: n.token ?? "0x0000000000000000000000000000000000000000",
169
+ proofSystem: n.proofSystem ?? "snark"
170
+ }));
171
+ store.addNotes(migrated);
172
+ await store.persist();
173
+ console.log(`[NoteStore] Migrated ${migrated.length} legacy notes`);
174
+ } catch {
163
175
  }
164
- setNotes([...store.getNotes()]);
165
- });
166
- if (publicClientProp) {
167
- checkChainFingerprint(chainId, publicClientProp).then((valid) => {
168
- if (!valid) {
169
- console.log(`[UPPAccount] Chain ${chainId} was reset \u2014 clearing stale notes`);
170
- store.clear();
171
- const legacyKey = getNotesStorageKey(chainId, ownerHashHex2.slice(0, 12));
172
- localStorage.removeItem(legacyKey);
173
- }
174
- });
175
176
  }
176
- } catch (e) {
177
- console.error("Failed to load saved account:", e);
178
177
  }
179
- } else {
180
- setMasterKeys(null);
181
- setStarkMasterKeys(null);
182
- setNotes([]);
183
- }
178
+ if (!cancelled) setNotes([...store.getNotes()]);
179
+ if (publicClientProp) {
180
+ const valid = await checkChainFingerprint(chainId, publicClientProp);
181
+ if (!valid && !cancelled) {
182
+ console.log(`[UPPAccount] Chain ${chainId} was reset \u2014 clearing stale notes`);
183
+ await store.clear();
184
+ }
185
+ }
186
+ };
187
+ init().catch((e) => console.error("Failed to load account:", e));
184
188
  return () => {
189
+ cancelled = true;
185
190
  if (noteStoreUnsub) noteStoreUnsub();
186
191
  };
187
192
  }, [ethAddress, cryptoReady, chainId, publicClientProp]);
@@ -204,18 +209,10 @@ function UPPAccountProvider({
204
209
  setMasterKeys(keys);
205
210
  setStarkMasterKeys(starkKeys);
206
211
  setNotes([]);
207
- const serialized = {
208
- version: 3,
209
- spendingSecret: viem.toHex(keys.spendingSecret, { size: 32 }),
210
- ownerHash: viem.toHex(keys.ownerHash, { size: 32 }),
211
- viewingSecret: viem.toHex(keys.viewingSecret, { size: 32 }),
212
- viewingHash: viem.toHex(keys.viewingHash, { size: 32 }),
213
- starkSecret: starkKeys.starkSecret.map((v) => v.toString()),
214
- starkOwnerHash: starkKeys.starkOwnerHash.map((v) => v.toString()),
215
- starkViewingSecret: starkKeys.starkViewingSecret.map((v) => v.toString()),
216
- starkViewingHash: starkKeys.starkViewingHash.map((v) => v.toString())
217
- };
218
- localStorage.setItem(getStorageKey(ethAddress), JSON.stringify(serialized));
212
+ const adapter = accountAdapterRef.current;
213
+ if (adapter) {
214
+ await adapter.save(keys, starkKeys);
215
+ }
219
216
  } finally {
220
217
  setIsLoading(false);
221
218
  }
@@ -253,13 +250,21 @@ function UPPAccountProvider({
253
250
  const logout = react.useCallback(() => {
254
251
  noteStoreRef.current?.clear().catch(console.error);
255
252
  noteStoreRef.current = null;
253
+ accountAdapterRef.current?.clear().catch(console.error);
254
+ accountAdapterRef.current = null;
256
255
  if (masterKeys) {
257
256
  const ownerHashHex2 = viem.toHex(masterKeys.ownerHash, { size: 32 });
258
257
  const notesKey = getNotesStorageKey(chainId, ownerHashHex2.slice(0, 12));
259
- localStorage.removeItem(notesKey);
258
+ try {
259
+ localStorage.removeItem(notesKey);
260
+ } catch {
261
+ }
260
262
  }
261
263
  if (ethAddress) {
262
- localStorage.removeItem(getStorageKey(ethAddress));
264
+ try {
265
+ localStorage.removeItem(getStorageKey(ethAddress));
266
+ } catch {
267
+ }
263
268
  }
264
269
  setMasterKeys(null);
265
270
  setStarkMasterKeys(null);
@@ -696,7 +701,7 @@ function UPPAccountProvider({
696
701
  const stealthAddress = react.useMemo(() => {
697
702
  if (!masterKeys) return null;
698
703
  try {
699
- const { encodeStealthAddress } = (chunkGXZ3MTCQ_cjs.init_stealth(), chunkG7VZBCD6_cjs.__toCommonJS(chunkGXZ3MTCQ_cjs.stealth_exports));
704
+ const { encodeStealthAddress } = (chunkIYOR5TCO_cjs.init_stealth(), chunkG7VZBCD6_cjs.__toCommonJS(chunkIYOR5TCO_cjs.stealth_exports));
700
705
  return encodeStealthAddress(masterKeys.ownerHash, masterKeys.viewingHash);
701
706
  } catch {
702
707
  return null;
@@ -705,7 +710,7 @@ function UPPAccountProvider({
705
710
  const starkStealthAddress = react.useMemo(() => {
706
711
  if (!starkMasterKeys) return null;
707
712
  try {
708
- const { encodeStarkStealthAddress } = (chunkGXZ3MTCQ_cjs.init_stealth(), chunkG7VZBCD6_cjs.__toCommonJS(chunkGXZ3MTCQ_cjs.stealth_exports));
713
+ const { encodeStarkStealthAddress } = (chunkIYOR5TCO_cjs.init_stealth(), chunkG7VZBCD6_cjs.__toCommonJS(chunkIYOR5TCO_cjs.stealth_exports));
709
714
  return encodeStarkStealthAddress(starkMasterKeys.starkOwnerHash, starkMasterKeys.starkViewingHash);
710
715
  } catch {
711
716
  return null;
@@ -1556,7 +1561,7 @@ function usePoolTransfer(config) {
1556
1561
  const recipientNote = await createNoteForSelf(amount, origin, token);
1557
1562
  const changeNote = await createNoteForSelf(changeAmount, origin, token);
1558
1563
  const [transferModule, proofModule, aspModule] = await Promise.all([
1559
- import('../transfer-SA4NHNJ7.cjs'),
1564
+ import('../transfer-6ZIVZ6JY.cjs'),
1560
1565
  import('../proof-5OECB3RQ.cjs'),
1561
1566
  import('../asp-TXSAFFD3.cjs')
1562
1567
  ]);
@@ -1715,7 +1720,7 @@ function useWithdraw(config) {
1715
1720
  const token = BigInt(selectedNote.token);
1716
1721
  setStage("creating_outputs");
1717
1722
  const [transferModule, proofModule, sdk] = await Promise.all([
1718
- import('../transfer-SA4NHNJ7.cjs'),
1723
+ import('../transfer-6ZIVZ6JY.cjs'),
1719
1724
  import('../proof-5OECB3RQ.cjs'),
1720
1725
  import('../index.cjs')
1721
1726
  ]);
@@ -1978,7 +1983,7 @@ function useSwapOrderBook(config) {
1978
1983
  try {
1979
1984
  const logs = await config.publicClient.getLogs({
1980
1985
  address: config.poolAddress,
1981
- event: chunkGXZ3MTCQ_cjs.SWAP_ORDER_PLACED_EVENT,
1986
+ event: chunkIYOR5TCO_cjs.SWAP_ORDER_PLACED_EVENT,
1982
1987
  fromBlock: config.fromBlock ?? 0n,
1983
1988
  toBlock: "latest"
1984
1989
  });
@@ -1994,10 +1999,10 @@ function useSwapOrderBook(config) {
1994
1999
  blockNumber: log.blockNumber ?? 0n
1995
2000
  }));
1996
2001
  if (config.sellToken && config.buyToken) {
1997
- parsedOrders = chunkGXZ3MTCQ_cjs.filterOrdersByTokenPair(parsedOrders, config.sellToken, config.buyToken);
2002
+ parsedOrders = chunkIYOR5TCO_cjs.filterOrdersByTokenPair(parsedOrders, config.sellToken, config.buyToken);
1998
2003
  }
1999
2004
  if (config.acceptableAspIds && config.acceptableAspIds.length > 0) {
2000
- parsedOrders = chunkGXZ3MTCQ_cjs.filterOrdersByASP(parsedOrders, config.acceptableAspIds);
2005
+ parsedOrders = chunkIYOR5TCO_cjs.filterOrdersByASP(parsedOrders, config.acceptableAspIds);
2001
2006
  }
2002
2007
  const enriched = [];
2003
2008
  for (const order of parsedOrders) {
@@ -2094,7 +2099,7 @@ function useSwap(config) {
2094
2099
  }
2095
2100
  setStage("creating_outputs");
2096
2101
  const [transferModule, proofModule, sdk, aspModule] = await Promise.all([
2097
- import('../transfer-SA4NHNJ7.cjs'),
2102
+ import('../transfer-6ZIVZ6JY.cjs'),
2098
2103
  import('../proof-5OECB3RQ.cjs'),
2099
2104
  import('../index.cjs'),
2100
2105
  import('../asp-TXSAFFD3.cjs')
@@ -2176,8 +2181,8 @@ function useSwap(config) {
2176
2181
  formattedProof.c[0],
2177
2182
  formattedProof.c[1]
2178
2183
  ];
2179
- const cancelSecret = chunkGXZ3MTCQ_cjs.generateCancelSecret();
2180
- const cancelKeyHash = chunkGXZ3MTCQ_cjs.computeCancelKeyHash(cancelSecret);
2184
+ const cancelSecret = chunkIYOR5TCO_cjs.generateCancelSecret();
2185
+ const cancelKeyHash = chunkIYOR5TCO_cjs.computeCancelKeyHash(cancelSecret);
2181
2186
  const currentBlock = await cfg.publicClient.getBlockNumber();
2182
2187
  const expiry = currentBlock + expiryBlocks;
2183
2188
  return {
@@ -2225,7 +2230,7 @@ function useSwap(config) {
2225
2230
  noteOverride
2226
2231
  } = params;
2227
2232
  const cfg = configRef.current;
2228
- const giveAmount = chunkGXZ3MTCQ_cjs.computeGiveAmount(takeAmount, rate);
2233
+ const giveAmount = chunkIYOR5TCO_cjs.computeGiveAmount(takeAmount, rate);
2229
2234
  setStage("selecting_notes");
2230
2235
  let selectedNote;
2231
2236
  if (noteOverride) {
@@ -2246,7 +2251,7 @@ function useSwap(config) {
2246
2251
  }
2247
2252
  setStage("creating_outputs");
2248
2253
  const [transferModule, proofModule, sdk, aspModule] = await Promise.all([
2249
- import('../transfer-SA4NHNJ7.cjs'),
2254
+ import('../transfer-6ZIVZ6JY.cjs'),
2250
2255
  import('../proof-5OECB3RQ.cjs'),
2251
2256
  import('../index.cjs'),
2252
2257
  import('../asp-TXSAFFD3.cjs')
@@ -2476,7 +2481,7 @@ function useSwap(config) {
2476
2481
  createNoteForSelf(changeAmount, origin, token)
2477
2482
  ]);
2478
2483
  const [transferModule, proofModule, aspModule] = await Promise.all([
2479
- import('../transfer-SA4NHNJ7.cjs'),
2484
+ import('../transfer-6ZIVZ6JY.cjs'),
2480
2485
  import('../proof-5OECB3RQ.cjs'),
2481
2486
  import('../asp-TXSAFFD3.cjs')
2482
2487
  ]);