@umbra-privacy/sdk 2.1.0 → 3.0.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.
- package/dist/{chunk-GP26R377.js → chunk-AUNYA6JP.js} +2 -2
- package/dist/chunk-AUNYA6JP.js.map +1 -0
- package/dist/{chunk-BL6WXLPV.cjs → chunk-KCHHJKQN.cjs} +2 -2
- package/dist/chunk-KCHHJKQN.cjs.map +1 -0
- package/dist/{chunk-KMRROOME.js → chunk-YA66JLHI.js} +9 -4
- package/dist/chunk-YA66JLHI.js.map +1 -0
- package/dist/{chunk-3LS5P32X.cjs → chunk-YFUGKMNS.cjs} +9 -4
- package/dist/chunk-YFUGKMNS.cjs.map +1 -0
- package/dist/{client-Cb53GYes.d.cts → client-Baxe29tj.d.cts} +128 -51
- package/dist/{client-CJ5S6Qln.d.ts → client-Cqv_5hHQ.d.ts} +128 -51
- package/dist/constants/index.cjs +1 -1
- package/dist/constants/index.js +1 -1
- package/dist/crypto/index.cjs +142 -142
- package/dist/crypto/index.d.cts +1 -1
- package/dist/crypto/index.d.ts +1 -1
- package/dist/crypto/index.js +1 -1
- package/dist/errors/index.cjs +28 -28
- package/dist/errors/index.d.cts +1 -1
- package/dist/errors/index.d.ts +1 -1
- package/dist/errors/index.js +1 -1
- package/dist/{errors-DAIrstEL.d.cts → errors-BqAlwXfh.d.cts} +3 -5
- package/dist/{errors-DPNMfyh0.d.ts → errors-Crx4Jf9K.d.ts} +3 -5
- package/dist/{index-B5wNTNZr.d.cts → index-BRLHQNe9.d.cts} +27 -12
- package/dist/{index-Cd76ZBHA.d.ts → index-gpTrCX61.d.ts} +27 -12
- package/dist/index.cjs +825 -1078
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -263
- package/dist/index.d.ts +12 -263
- package/dist/index.js +330 -579
- package/dist/index.js.map +1 -1
- package/dist/indexer-NHZDFABY.js +311 -0
- package/dist/indexer-NHZDFABY.js.map +1 -0
- package/dist/indexer-XOUBVRNU.cjs +316 -0
- package/dist/indexer-XOUBVRNU.cjs.map +1 -0
- package/dist/interfaces/index.d.cts +2 -2
- package/dist/interfaces/index.d.ts +2 -2
- package/dist/solana/index.d.cts +2 -2
- package/dist/solana/index.d.ts +2 -2
- package/dist/{transaction-forwarder-Dme9whAc.d.ts → transaction-forwarder-Cv3OlsaZ.d.ts} +1 -1
- package/dist/{transaction-forwarder-0GZRKXIr.d.cts → transaction-forwarder-DH07CEkG.d.cts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-3LS5P32X.cjs.map +0 -1
- package/dist/chunk-BL6WXLPV.cjs.map +0 -1
- package/dist/chunk-GP26R377.js.map +0 -1
- package/dist/chunk-KMRROOME.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
var chunkNKVMSABR_cjs = require('./chunk-NKVMSABR.cjs');
|
|
4
4
|
var chunk43JEHY7D_cjs = require('./chunk-43JEHY7D.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunkYFUGKMNS_cjs = require('./chunk-YFUGKMNS.cjs');
|
|
6
6
|
var chunkZY3TSHMJ_cjs = require('./chunk-ZY3TSHMJ.cjs');
|
|
7
7
|
var chunkUEI7SYH6_cjs = require('./chunk-UEI7SYH6.cjs');
|
|
8
8
|
require('./chunk-TQQZGNOI.cjs');
|
|
9
|
-
var
|
|
9
|
+
var chunkKCHHJKQN_cjs = require('./chunk-KCHHJKQN.cjs');
|
|
10
10
|
var chunkYEZBTYCP_cjs = require('./chunk-YEZBTYCP.cjs');
|
|
11
11
|
var chunkY55PYKXH_cjs = require('./chunk-Y55PYKXH.cjs');
|
|
12
12
|
require('./chunk-DMPMQ74B.cjs');
|
|
@@ -21,11 +21,59 @@ var chunkPK6SKIKE_cjs = require('./chunk-PK6SKIKE.cjs');
|
|
|
21
21
|
var sha3Addons_js = require('@noble/hashes/sha3-addons.js');
|
|
22
22
|
var kit = require('@solana/kit');
|
|
23
23
|
var arciumCodama = require('@umbra-privacy/arcium-codama');
|
|
24
|
-
var indexerReadServiceClient = require('@umbra-privacy/indexer-read-service-client');
|
|
25
24
|
var ed25519_js = require('@noble/curves/ed25519.js');
|
|
26
25
|
var sha3_js = require('@noble/hashes/sha3.js');
|
|
27
26
|
var umbraCodama = require('@umbra-privacy/umbra-codama');
|
|
28
27
|
|
|
28
|
+
// src/umbra/constants.ts
|
|
29
|
+
var UMBRA_MESSAGE_TO_SIGN = `Umbra Protocol – User Consent & Acknowledgement
|
|
30
|
+
|
|
31
|
+
Please read carefully before continuing. Umbra is a non-custodial, open-source protocol. Umbra does not hold, control, manage, or access your digital assets, private keys, viewing keys, transactions, or personal data. All interactions with the Umbra protocol occur through autonomous smart contracts and wallet-signed transactions executed directly on the blockchain.
|
|
32
|
+
|
|
33
|
+
By using the Umbra protocol, you acknowledge and agree that:
|
|
34
|
+
|
|
35
|
+
1. You are solely responsible for managing your wallet, private keys, privacy settings, viewing key disclosures, and any transactions or interactions you authorize.
|
|
36
|
+
2. Blockchain transactions are generally irreversible, and smart contracts may contain bugs, vulnerabilities, or unintended behavior.
|
|
37
|
+
3. Errors, misuse, misconfiguration, third-party tools, relayers, or loss of keys may result in permanent and unrecoverable loss of assets or privacy.
|
|
38
|
+
4. Privacy features are designed to enhance confidentiality but do not guarantee absolute or unconditional anonymity.
|
|
39
|
+
5. Transactions may involve independent relayers or third-party infrastructure that Umbra does not operate, control, or supervise.
|
|
40
|
+
6. By clicking "I Agree", you confirm that you have read, understood, and accepted all applicable terms, policies, risk disclosures, notices, and other documentation governing your access to and use of the Umbra protocol, as published or made available by Umbra from time to time.
|
|
41
|
+
|
|
42
|
+
You acknowledge that such documentation may be updated or modified, and that continued access to or use of the Umbra Protocol constitutes acceptance of the then-current versions. If you do not agree, do not proceed and discontinue use of the Umbra protocol.`;
|
|
43
|
+
var FEE_OFFSETS = {
|
|
44
|
+
/**
|
|
45
|
+
* Offset used in `FeeVault` PDA derivation for the unified protocol fees pool.
|
|
46
|
+
*
|
|
47
|
+
* @remarks
|
|
48
|
+
* Passed as the final seed to `findProtocolFeeVaultPda` and
|
|
49
|
+
* `findRelayerFeeVaultPda`. Currently `0n`.
|
|
50
|
+
*
|
|
51
|
+
* @readonly
|
|
52
|
+
*/
|
|
53
|
+
PROTOCOL_FEES_POOL: 0n,
|
|
54
|
+
/**
|
|
55
|
+
* Offset used in `FeeSchedule` PDA derivation.
|
|
56
|
+
*
|
|
57
|
+
* @remarks
|
|
58
|
+
* Passed as the final seed to `findFeeSchedulePda`. Currently `0n`.
|
|
59
|
+
*
|
|
60
|
+
* @readonly
|
|
61
|
+
*/
|
|
62
|
+
PROTOCOL_FEES_CONFIG: 0n,
|
|
63
|
+
/**
|
|
64
|
+
* Offset used in relayer fee configuration PDA derivation.
|
|
65
|
+
*
|
|
66
|
+
* @remarks
|
|
67
|
+
* Passed as the offset seed when looking up the relayer's fee configuration account.
|
|
68
|
+
* Currently `0n`.
|
|
69
|
+
*
|
|
70
|
+
* @readonly
|
|
71
|
+
*/
|
|
72
|
+
RELAYER_FEES_CONFIG: 0n
|
|
73
|
+
};
|
|
74
|
+
var BPS_DIVISOR = 16384n;
|
|
75
|
+
|
|
76
|
+
// src/common/storage.ts
|
|
29
77
|
function getDefaultMasterSeedStorage() {
|
|
30
78
|
let cachedSeed = null;
|
|
31
79
|
return {
|
|
@@ -46,8 +94,7 @@ var MASTER_SEED_DOMAIN = new TextEncoder().encode("Umbra Privacy - MasterSeedGen
|
|
|
46
94
|
var SEED_PERSONALIZATION = new TextEncoder().encode("umbra/1.0.0|kmac256/1.0.0|kdf/1.0.0|seed");
|
|
47
95
|
function getDefaultMasterSeedGenerator(signer) {
|
|
48
96
|
return async () => {
|
|
49
|
-
const
|
|
50
|
-
const messageBytes = new TextEncoder().encode(message);
|
|
97
|
+
const messageBytes = new TextEncoder().encode(UMBRA_MESSAGE_TO_SIGN);
|
|
51
98
|
const signature = await signer.signMessage(messageBytes);
|
|
52
99
|
const seed = sha3Addons_js.kmac256(
|
|
53
100
|
MASTER_SEED_DOMAIN,
|
|
@@ -93,7 +140,10 @@ function notificationValueToEncodedAccount(address, value) {
|
|
|
93
140
|
chunkPK6SKIKE_cjs.__name(notificationValueToEncodedAccount, "notificationValueToEncodedAccount");
|
|
94
141
|
function checkAborted(signal) {
|
|
95
142
|
if (signal?.aborted) {
|
|
96
|
-
throw new
|
|
143
|
+
throw new chunkKCHHJKQN_cjs.ComputationMonitorError(
|
|
144
|
+
"timeout",
|
|
145
|
+
"Computation monitoring cancelled via AbortSignal"
|
|
146
|
+
);
|
|
97
147
|
}
|
|
98
148
|
}
|
|
99
149
|
chunkPK6SKIKE_cjs.__name(checkAborted, "checkAborted");
|
|
@@ -118,15 +168,15 @@ async function retrieveCallbackTransactionSignature(rpc, computationAddress) {
|
|
|
118
168
|
return sig;
|
|
119
169
|
}
|
|
120
170
|
}
|
|
121
|
-
throw new
|
|
171
|
+
throw new chunkKCHHJKQN_cjs.ComputationMonitorError(
|
|
122
172
|
"signature-retrieval",
|
|
123
173
|
`No successful callback transaction found (checked ${String(DEFAULT_SIGNATURE_RETRIEVAL_LIMIT)} signatures)`
|
|
124
174
|
);
|
|
125
175
|
} catch (error) {
|
|
126
|
-
if (error instanceof
|
|
176
|
+
if (error instanceof chunkKCHHJKQN_cjs.ComputationMonitorError) {
|
|
127
177
|
throw error;
|
|
128
178
|
}
|
|
129
|
-
throw new
|
|
179
|
+
throw new chunkKCHHJKQN_cjs.ComputationMonitorError(
|
|
130
180
|
"signature-retrieval",
|
|
131
181
|
"Failed to retrieve callback transaction signature",
|
|
132
182
|
error instanceof Error ? error : void 0
|
|
@@ -155,6 +205,13 @@ function buildPrunedResult(startTime, queuedSlot, currentSlot, onProgress) {
|
|
|
155
205
|
};
|
|
156
206
|
}
|
|
157
207
|
chunkPK6SKIKE_cjs.__name(buildPrunedResult, "buildPrunedResult");
|
|
208
|
+
function buildTimedOutResult(startTime) {
|
|
209
|
+
return {
|
|
210
|
+
status: "timed-out",
|
|
211
|
+
elapsedMs: Date.now() - startTime
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
chunkPK6SKIKE_cjs.__name(buildTimedOutResult, "buildTimedOutResult");
|
|
158
215
|
function getWebsocketComputationMonitor(config, deps) {
|
|
159
216
|
const { rpcUrl, rpcSubscriptionsUrl } = config;
|
|
160
217
|
const {
|
|
@@ -163,7 +220,7 @@ function getWebsocketComputationMonitor(config, deps) {
|
|
|
163
220
|
} = deps ?? {};
|
|
164
221
|
const rpc = createRpc(rpcUrl);
|
|
165
222
|
const rpcSubscriptions = createRpcSubscriptions(rpcSubscriptionsUrl);
|
|
166
|
-
async function
|
|
223
|
+
async function prepareMonitor(computationAddress, options) {
|
|
167
224
|
const {
|
|
168
225
|
maxSlotWindow = DEFAULT_MAX_SLOT_WINDOW,
|
|
169
226
|
safetyTimeoutMs = DEFAULT_SAFETY_TIMEOUT_MS,
|
|
@@ -172,126 +229,128 @@ function getWebsocketComputationMonitor(config, deps) {
|
|
|
172
229
|
commitment = "confirmed",
|
|
173
230
|
signal: externalSignal
|
|
174
231
|
} = options ?? {};
|
|
175
|
-
const startTime = Date.now();
|
|
176
|
-
let queuedSlot = null;
|
|
177
|
-
try {
|
|
178
|
-
const currentAccount = await kit.fetchEncodedAccount(rpc, computationAddress, { commitment });
|
|
179
|
-
if (currentAccount.exists) {
|
|
180
|
-
const decoded = arciumCodama.decodeComputationAccount(currentAccount);
|
|
181
|
-
queuedSlot = decoded.data.slot;
|
|
182
|
-
if (decoded.data.status === arciumCodama.ComputationStatus.Finalized) {
|
|
183
|
-
return buildFinalizedResult(
|
|
184
|
-
rpc,
|
|
185
|
-
computationAddress,
|
|
186
|
-
startTime,
|
|
187
|
-
queuedSlot,
|
|
188
|
-
shouldRetrieveSignature,
|
|
189
|
-
onProgress
|
|
190
|
-
);
|
|
191
|
-
}
|
|
192
|
-
onProgress?.({ type: "queued", queuedSlot });
|
|
193
|
-
const currentSlot = await fetchCurrentSlot(rpc, commitment);
|
|
194
|
-
if (isSlotWindowExceeded(queuedSlot, currentSlot, maxSlotWindow)) {
|
|
195
|
-
return buildPrunedResult(startTime, queuedSlot, currentSlot, onProgress);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
} catch (error) {
|
|
199
|
-
if (error instanceof chunkBL6WXLPV_cjs.ComputationMonitorError) {
|
|
200
|
-
throw error;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
checkAborted(externalSignal);
|
|
204
232
|
const abortController = new AbortController();
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
if (queuedSlot !== null) {
|
|
211
|
-
const capturedQueuedSlot = queuedSlot;
|
|
212
|
-
slotCheckIntervalId = setInterval(async () => {
|
|
213
|
-
try {
|
|
214
|
-
const currentSlot = await fetchCurrentSlot(rpc, commitment);
|
|
215
|
-
if (isSlotWindowExceeded(capturedQueuedSlot, currentSlot, maxSlotWindow)) {
|
|
216
|
-
pruneDetected = buildPrunedResult(startTime, capturedQueuedSlot, currentSlot, onProgress);
|
|
217
|
-
abortController.abort();
|
|
218
|
-
}
|
|
219
|
-
} catch {
|
|
220
|
-
}
|
|
221
|
-
}, 5e3);
|
|
233
|
+
let cleaned = false;
|
|
234
|
+
function cleanup() {
|
|
235
|
+
if (cleaned) return;
|
|
236
|
+
cleaned = true;
|
|
237
|
+
abortController.abort();
|
|
222
238
|
}
|
|
239
|
+
chunkPK6SKIKE_cjs.__name(cleanup, "cleanup");
|
|
240
|
+
let notifications;
|
|
223
241
|
try {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
242
|
+
notifications = await rpcSubscriptions.accountNotifications(computationAddress, { encoding: "base64", commitment }).subscribe({ abortSignal: abortController.signal });
|
|
243
|
+
} catch (error) {
|
|
244
|
+
cleanup();
|
|
245
|
+
throw new chunkKCHHJKQN_cjs.ComputationMonitorError(
|
|
246
|
+
"subscription",
|
|
247
|
+
"Failed to establish WebSocket subscription",
|
|
248
|
+
error instanceof Error ? error : void 0
|
|
249
|
+
);
|
|
250
|
+
}
|
|
251
|
+
async function awaitComputation() {
|
|
252
|
+
const startTime = Date.now();
|
|
253
|
+
let queuedSlot = null;
|
|
254
|
+
let receivedFirstNotification = false;
|
|
255
|
+
checkAborted(externalSignal);
|
|
256
|
+
const safetyTimeoutId = setTimeout(() => abortController.abort(), safetyTimeoutMs);
|
|
257
|
+
const onExternalAbort = /* @__PURE__ */ chunkPK6SKIKE_cjs.__name(() => abortController.abort(), "onExternalAbort");
|
|
258
|
+
externalSignal?.addEventListener("abort", onExternalAbort, { once: true });
|
|
259
|
+
let slotCheckIntervalId = null;
|
|
260
|
+
let pruneDetected = null;
|
|
261
|
+
try {
|
|
262
|
+
for await (const notification of notifications) {
|
|
263
|
+
try {
|
|
264
|
+
const encodedAccount = notificationValueToEncodedAccount(
|
|
239
265
|
computationAddress,
|
|
240
|
-
|
|
241
|
-
queuedSlot,
|
|
242
|
-
shouldRetrieveSignature,
|
|
243
|
-
onProgress
|
|
266
|
+
notification.value
|
|
244
267
|
);
|
|
268
|
+
const decoded = arciumCodama.decodeComputationAccount(encodedAccount);
|
|
269
|
+
if (!receivedFirstNotification) {
|
|
270
|
+
receivedFirstNotification = true;
|
|
271
|
+
queuedSlot = decoded.data.slot;
|
|
272
|
+
const capturedQueuedSlot = queuedSlot;
|
|
273
|
+
slotCheckIntervalId = setInterval(async () => {
|
|
274
|
+
try {
|
|
275
|
+
const currentSlot = await fetchCurrentSlot(rpc, commitment);
|
|
276
|
+
if (isSlotWindowExceeded(capturedQueuedSlot, currentSlot, maxSlotWindow)) {
|
|
277
|
+
pruneDetected = buildPrunedResult(
|
|
278
|
+
startTime,
|
|
279
|
+
capturedQueuedSlot,
|
|
280
|
+
currentSlot,
|
|
281
|
+
onProgress
|
|
282
|
+
);
|
|
283
|
+
abortController.abort();
|
|
284
|
+
}
|
|
285
|
+
} catch {
|
|
286
|
+
}
|
|
287
|
+
}, 5e3);
|
|
288
|
+
if (decoded.data.status === arciumCodama.ComputationStatus.Finalized) {
|
|
289
|
+
return buildFinalizedResult(
|
|
290
|
+
rpc,
|
|
291
|
+
computationAddress,
|
|
292
|
+
startTime,
|
|
293
|
+
queuedSlot,
|
|
294
|
+
shouldRetrieveSignature,
|
|
295
|
+
onProgress
|
|
296
|
+
);
|
|
297
|
+
}
|
|
298
|
+
continue;
|
|
299
|
+
}
|
|
300
|
+
if (decoded.data.status === arciumCodama.ComputationStatus.Finalized) {
|
|
301
|
+
return buildFinalizedResult(
|
|
302
|
+
rpc,
|
|
303
|
+
computationAddress,
|
|
304
|
+
startTime,
|
|
305
|
+
queuedSlot,
|
|
306
|
+
shouldRetrieveSignature,
|
|
307
|
+
onProgress
|
|
308
|
+
);
|
|
309
|
+
}
|
|
310
|
+
} catch {
|
|
311
|
+
continue;
|
|
245
312
|
}
|
|
246
|
-
} catch {
|
|
247
|
-
continue;
|
|
248
313
|
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
`Safety timeout: computation monitoring exceeded ${String(safetyTimeoutMs)}ms`
|
|
314
|
+
if (pruneDetected) {
|
|
315
|
+
return pruneDetected;
|
|
316
|
+
}
|
|
317
|
+
return buildTimedOutResult(startTime);
|
|
318
|
+
} catch (error) {
|
|
319
|
+
if (error instanceof chunkKCHHJKQN_cjs.ComputationMonitorError) {
|
|
320
|
+
throw error;
|
|
321
|
+
}
|
|
322
|
+
if (pruneDetected) {
|
|
323
|
+
return pruneDetected;
|
|
324
|
+
}
|
|
325
|
+
if (abortController.signal.aborted) {
|
|
326
|
+
return buildTimedOutResult(startTime);
|
|
327
|
+
}
|
|
328
|
+
throw new chunkKCHHJKQN_cjs.ComputationMonitorError(
|
|
329
|
+
"subscription",
|
|
330
|
+
"WebSocket subscription failed",
|
|
331
|
+
error instanceof Error ? error : void 0
|
|
268
332
|
);
|
|
333
|
+
} finally {
|
|
334
|
+
clearTimeout(safetyTimeoutId);
|
|
335
|
+
if (slotCheckIntervalId !== null) {
|
|
336
|
+
clearInterval(slotCheckIntervalId);
|
|
337
|
+
}
|
|
338
|
+
externalSignal?.removeEventListener("abort", onExternalAbort);
|
|
339
|
+
cleanup();
|
|
269
340
|
}
|
|
270
|
-
throw new chunkBL6WXLPV_cjs.ComputationMonitorError(
|
|
271
|
-
"subscription",
|
|
272
|
-
"WebSocket subscription failed",
|
|
273
|
-
error instanceof Error ? error : void 0
|
|
274
|
-
);
|
|
275
|
-
} finally {
|
|
276
|
-
clearTimeout(safetyTimeoutId);
|
|
277
|
-
if (slotCheckIntervalId !== null) {
|
|
278
|
-
clearInterval(slotCheckIntervalId);
|
|
279
|
-
}
|
|
280
|
-
externalSignal?.removeEventListener("abort", onExternalAbort);
|
|
281
|
-
abortController.abort();
|
|
282
341
|
}
|
|
342
|
+
chunkPK6SKIKE_cjs.__name(awaitComputation, "awaitComputation");
|
|
343
|
+
return { awaitComputation, cleanup };
|
|
283
344
|
}
|
|
284
|
-
chunkPK6SKIKE_cjs.__name(
|
|
285
|
-
return {
|
|
286
|
-
awaitComputation: monitorComputation
|
|
287
|
-
};
|
|
345
|
+
chunkPK6SKIKE_cjs.__name(prepareMonitor, "prepareMonitor");
|
|
346
|
+
return { prepareMonitor };
|
|
288
347
|
}
|
|
289
348
|
chunkPK6SKIKE_cjs.__name(getWebsocketComputationMonitor, "getWebsocketComputationMonitor");
|
|
290
349
|
function getPollingComputationMonitor(config, deps) {
|
|
291
350
|
const { rpcUrl } = config;
|
|
292
351
|
const { createRpc = kit.createSolanaRpc } = deps ?? {};
|
|
293
352
|
const rpc = createRpc(rpcUrl);
|
|
294
|
-
async function
|
|
353
|
+
async function prepareMonitor(computationAddress, options) {
|
|
295
354
|
const {
|
|
296
355
|
maxSlotWindow = DEFAULT_MAX_SLOT_WINDOW,
|
|
297
356
|
safetyTimeoutMs = DEFAULT_SAFETY_TIMEOUT_MS,
|
|
@@ -301,360 +360,77 @@ function getPollingComputationMonitor(config, deps) {
|
|
|
301
360
|
commitment = "confirmed",
|
|
302
361
|
signal: externalSignal
|
|
303
362
|
} = options ?? {};
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
if (
|
|
315
|
-
|
|
316
|
-
continue;
|
|
317
|
-
}
|
|
318
|
-
const decoded = arciumCodama.decodeComputationAccount(maybeAccount);
|
|
319
|
-
if (queuedSlot === null) {
|
|
320
|
-
queuedSlot = decoded.data.slot;
|
|
321
|
-
}
|
|
322
|
-
if (!queuedEventFired && decoded.data.status === arciumCodama.ComputationStatus.Queued) {
|
|
323
|
-
onProgress?.({ type: "queued", queuedSlot });
|
|
324
|
-
queuedEventFired = true;
|
|
325
|
-
}
|
|
326
|
-
if (decoded.data.status === arciumCodama.ComputationStatus.Finalized) {
|
|
327
|
-
return buildFinalizedResult(
|
|
328
|
-
rpc,
|
|
329
|
-
computationAddress,
|
|
330
|
-
startTime,
|
|
331
|
-
queuedSlot,
|
|
332
|
-
shouldRetrieveSignature,
|
|
333
|
-
onProgress
|
|
334
|
-
);
|
|
335
|
-
}
|
|
336
|
-
if (isSlotWindowExceeded(queuedSlot, currentSlot, maxSlotWindow)) {
|
|
337
|
-
return buildPrunedResult(startTime, queuedSlot, currentSlot, onProgress);
|
|
363
|
+
let aborted = false;
|
|
364
|
+
function cleanup() {
|
|
365
|
+
aborted = true;
|
|
366
|
+
}
|
|
367
|
+
chunkPK6SKIKE_cjs.__name(cleanup, "cleanup");
|
|
368
|
+
async function awaitComputation() {
|
|
369
|
+
const startTime = Date.now();
|
|
370
|
+
let queuedSlot = null;
|
|
371
|
+
let receivedFirstDecode = false;
|
|
372
|
+
while (Date.now() - startTime < safetyTimeoutMs) {
|
|
373
|
+
if (aborted) {
|
|
374
|
+
return buildTimedOutResult(startTime);
|
|
338
375
|
}
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
376
|
+
checkAborted(externalSignal);
|
|
377
|
+
try {
|
|
378
|
+
const [maybeAccount, currentSlot] = await Promise.all([
|
|
379
|
+
kit.fetchEncodedAccount(rpc, computationAddress, { commitment }),
|
|
380
|
+
fetchCurrentSlot(rpc, commitment)
|
|
381
|
+
]);
|
|
382
|
+
if (!maybeAccount.exists) {
|
|
383
|
+
await chunkENVYYEM4_cjs.sleep(pollingIntervalMs);
|
|
384
|
+
continue;
|
|
385
|
+
}
|
|
386
|
+
const decoded = arciumCodama.decodeComputationAccount(maybeAccount);
|
|
387
|
+
if (queuedSlot === null) {
|
|
388
|
+
queuedSlot = decoded.data.slot;
|
|
389
|
+
}
|
|
390
|
+
if (!receivedFirstDecode) {
|
|
391
|
+
receivedFirstDecode = true;
|
|
392
|
+
if (decoded.data.status === arciumCodama.ComputationStatus.Finalized) {
|
|
393
|
+
return buildFinalizedResult(
|
|
394
|
+
rpc,
|
|
395
|
+
computationAddress,
|
|
396
|
+
startTime,
|
|
397
|
+
queuedSlot,
|
|
398
|
+
shouldRetrieveSignature,
|
|
399
|
+
onProgress
|
|
400
|
+
);
|
|
401
|
+
}
|
|
402
|
+
await chunkENVYYEM4_cjs.sleep(pollingIntervalMs);
|
|
403
|
+
continue;
|
|
404
|
+
}
|
|
405
|
+
if (decoded.data.status === arciumCodama.ComputationStatus.Finalized) {
|
|
406
|
+
return buildFinalizedResult(
|
|
407
|
+
rpc,
|
|
408
|
+
computationAddress,
|
|
409
|
+
startTime,
|
|
410
|
+
queuedSlot,
|
|
411
|
+
shouldRetrieveSignature,
|
|
412
|
+
onProgress
|
|
413
|
+
);
|
|
414
|
+
}
|
|
415
|
+
if (isSlotWindowExceeded(queuedSlot, currentSlot, maxSlotWindow)) {
|
|
416
|
+
return buildPrunedResult(startTime, queuedSlot, currentSlot, onProgress);
|
|
417
|
+
}
|
|
418
|
+
} catch (error) {
|
|
419
|
+
if (error instanceof chunkKCHHJKQN_cjs.ComputationMonitorError) {
|
|
420
|
+
throw error;
|
|
421
|
+
}
|
|
342
422
|
}
|
|
423
|
+
await chunkENVYYEM4_cjs.sleep(pollingIntervalMs);
|
|
343
424
|
}
|
|
344
|
-
|
|
425
|
+
return buildTimedOutResult(startTime);
|
|
345
426
|
}
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
`Safety timeout: computation monitoring exceeded ${String(safetyTimeoutMs)}ms`
|
|
349
|
-
);
|
|
427
|
+
chunkPK6SKIKE_cjs.__name(awaitComputation, "awaitComputation");
|
|
428
|
+
return { awaitComputation, cleanup };
|
|
350
429
|
}
|
|
351
|
-
chunkPK6SKIKE_cjs.__name(
|
|
352
|
-
return {
|
|
353
|
-
awaitComputation: monitorComputation
|
|
354
|
-
};
|
|
430
|
+
chunkPK6SKIKE_cjs.__name(prepareMonitor, "prepareMonitor");
|
|
431
|
+
return { prepareMonitor };
|
|
355
432
|
}
|
|
356
433
|
chunkPK6SKIKE_cjs.__name(getPollingComputationMonitor, "getPollingComputationMonitor");
|
|
357
|
-
var DEFAULT_UTXO_LIMIT = 1000n;
|
|
358
|
-
var MAX_UTXO_LIMIT = 5000n;
|
|
359
|
-
var IndexerError = class _IndexerError extends Error {
|
|
360
|
-
static {
|
|
361
|
-
chunkPK6SKIKE_cjs.__name(this, "IndexerError");
|
|
362
|
-
}
|
|
363
|
-
/**
|
|
364
|
-
* The indexer operation that failed.
|
|
365
|
-
*
|
|
366
|
-
* @remarks
|
|
367
|
-
* This is a short camelCase label identifying which high-level operation
|
|
368
|
-
* triggered the error (e.g. `"fetchMerkleProof"`, `"fetchUtxoData"`,
|
|
369
|
-
* `"base64Conversion"`).
|
|
370
|
-
*
|
|
371
|
-
* @readonly
|
|
372
|
-
*/
|
|
373
|
-
operation;
|
|
374
|
-
/**
|
|
375
|
-
* HTTP status code if available.
|
|
376
|
-
*
|
|
377
|
-
* @remarks
|
|
378
|
-
* Present when the server responded with an HTTP error (4xx or 5xx).
|
|
379
|
-
* `undefined` for transport-level failures such as network timeouts or
|
|
380
|
-
* DNS resolution failures.
|
|
381
|
-
*
|
|
382
|
-
* @readonly
|
|
383
|
-
*/
|
|
384
|
-
statusCode;
|
|
385
|
-
/**
|
|
386
|
-
* Creates a new IndexerError.
|
|
387
|
-
*
|
|
388
|
-
* @param operation - The operation that failed (e.g. `"fetchMerkleProof"`)
|
|
389
|
-
* @param message - Descriptive error message for display to users or logs
|
|
390
|
-
* @param statusCode - Optional HTTP status code (undefined for network failures)
|
|
391
|
-
* @param cause - Optional underlying error that triggered this one
|
|
392
|
-
*/
|
|
393
|
-
constructor(operation, message, statusCode, cause) {
|
|
394
|
-
super(`Indexer operation '${operation}' failed: ${message}`);
|
|
395
|
-
this.name = "IndexerError";
|
|
396
|
-
this.operation = operation;
|
|
397
|
-
this.statusCode = statusCode;
|
|
398
|
-
this.cause = cause;
|
|
399
|
-
if (Error.captureStackTrace !== void 0) {
|
|
400
|
-
Error.captureStackTrace(this, _IndexerError);
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
};
|
|
404
|
-
function base64ToBytes(base64) {
|
|
405
|
-
if (typeof Buffer !== "undefined") {
|
|
406
|
-
return Buffer.from(base64, "base64");
|
|
407
|
-
}
|
|
408
|
-
const binaryString = atob(base64);
|
|
409
|
-
const bytes = new Uint8Array(binaryString.length);
|
|
410
|
-
for (let index = 0; index < binaryString.length; index++) {
|
|
411
|
-
bytes[index] = binaryString.codePointAt(index) ?? 0;
|
|
412
|
-
}
|
|
413
|
-
return bytes;
|
|
414
|
-
}
|
|
415
|
-
chunkPK6SKIKE_cjs.__name(base64ToBytes, "base64ToBytes");
|
|
416
|
-
function base64ToU256LeBytes(base64) {
|
|
417
|
-
const bytes = base64ToBytes(base64);
|
|
418
|
-
if (bytes.length !== 32) {
|
|
419
|
-
throw new IndexerError(
|
|
420
|
-
"base64Conversion",
|
|
421
|
-
`Invalid byte length: expected 32 bytes, got ${String(bytes.length)}`
|
|
422
|
-
);
|
|
423
|
-
}
|
|
424
|
-
chunkLTCKPTZC_cjs.assertU256LeBytes(bytes);
|
|
425
|
-
return bytes;
|
|
426
|
-
}
|
|
427
|
-
chunkPK6SKIKE_cjs.__name(base64ToU256LeBytes, "base64ToU256LeBytes");
|
|
428
|
-
function base64ToX25519PublicKey(base64) {
|
|
429
|
-
const bytes = base64ToBytes(base64);
|
|
430
|
-
if (bytes.length !== 32) {
|
|
431
|
-
throw new IndexerError(
|
|
432
|
-
"base64Conversion",
|
|
433
|
-
`Invalid X25519 public key length: expected 32 bytes, got ${String(bytes.length)}`
|
|
434
|
-
);
|
|
435
|
-
}
|
|
436
|
-
return bytes;
|
|
437
|
-
}
|
|
438
|
-
chunkPK6SKIKE_cjs.__name(base64ToX25519PublicKey, "base64ToX25519PublicKey");
|
|
439
|
-
function base64ToAesCiphertext(base64) {
|
|
440
|
-
return base64ToBytes(base64);
|
|
441
|
-
}
|
|
442
|
-
chunkPK6SKIKE_cjs.__name(base64ToAesCiphertext, "base64ToAesCiphertext");
|
|
443
|
-
function splitAddressBase64(base64) {
|
|
444
|
-
const bytes = base64ToBytes(base64);
|
|
445
|
-
if (bytes.length !== 32) {
|
|
446
|
-
throw new IndexerError(
|
|
447
|
-
"addressSplit",
|
|
448
|
-
`Invalid address length: expected 32 bytes, got ${String(bytes.length)}`
|
|
449
|
-
);
|
|
450
|
-
}
|
|
451
|
-
const lowBytes = bytes.slice(0, 16);
|
|
452
|
-
const highBytes = bytes.slice(16, 32);
|
|
453
|
-
chunkLTCKPTZC_cjs.assertU128LeBytes(lowBytes);
|
|
454
|
-
chunkLTCKPTZC_cjs.assertU128LeBytes(highBytes);
|
|
455
|
-
return {
|
|
456
|
-
low: chunk5GUSMQ74_cjs.decodeU128LeBytesToU128(lowBytes),
|
|
457
|
-
high: chunk5GUSMQ74_cjs.decodeU128LeBytesToU128(highBytes)
|
|
458
|
-
};
|
|
459
|
-
}
|
|
460
|
-
chunkPK6SKIKE_cjs.__name(splitAddressBase64, "splitAddressBase64");
|
|
461
|
-
function getMerkleProofFetcher(args, deps) {
|
|
462
|
-
const { apiEndpoint } = args;
|
|
463
|
-
const client = new indexerReadServiceClient.ReadServiceClient({ endpoint: apiEndpoint, fetch: deps?.fetch });
|
|
464
|
-
return /* @__PURE__ */ chunkPK6SKIKE_cjs.__name(async function fetchMerkleProof(treeIndex, insertionIndices) {
|
|
465
|
-
if (insertionIndices.length === 0) {
|
|
466
|
-
return /* @__PURE__ */ new Map();
|
|
467
|
-
}
|
|
468
|
-
if (treeIndex < 0n) {
|
|
469
|
-
throw new IndexerError(
|
|
470
|
-
"fetchMerkleProof",
|
|
471
|
-
`Invalid tree index: ${String(treeIndex)}. Must be non-negative.`
|
|
472
|
-
);
|
|
473
|
-
}
|
|
474
|
-
const results = /* @__PURE__ */ new Map();
|
|
475
|
-
const fetchPromises = insertionIndices.map(async (insertionIndex) => {
|
|
476
|
-
if (insertionIndex < 0n) {
|
|
477
|
-
throw new IndexerError(
|
|
478
|
-
"fetchMerkleProof",
|
|
479
|
-
`Invalid insertion index: ${String(insertionIndex)}. Must be non-negative.`
|
|
480
|
-
);
|
|
481
|
-
}
|
|
482
|
-
let data;
|
|
483
|
-
try {
|
|
484
|
-
data = await client.getProof(treeIndex, insertionIndex);
|
|
485
|
-
} catch (error) {
|
|
486
|
-
throw new IndexerError(
|
|
487
|
-
"fetchMerkleProof",
|
|
488
|
-
`Failed to fetch proof for leaf ${String(insertionIndex)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
489
|
-
void 0,
|
|
490
|
-
error instanceof Error ? error : void 0
|
|
491
|
-
);
|
|
492
|
-
}
|
|
493
|
-
const merkleRoot = base64ToU256LeBytes(data.root);
|
|
494
|
-
const merklePath = data.proof.map((hash) => base64ToU256LeBytes(hash));
|
|
495
|
-
const leaf = base64ToU256LeBytes(data.leaf);
|
|
496
|
-
return {
|
|
497
|
-
insertionIndex,
|
|
498
|
-
data: {
|
|
499
|
-
merkleRoot,
|
|
500
|
-
treeIndex: data.tree_index,
|
|
501
|
-
insertionIndex: data.insertion_index,
|
|
502
|
-
merklePath,
|
|
503
|
-
leaf
|
|
504
|
-
}
|
|
505
|
-
};
|
|
506
|
-
});
|
|
507
|
-
const proofResults = await Promise.all(fetchPromises);
|
|
508
|
-
for (const { insertionIndex, data } of proofResults) {
|
|
509
|
-
results.set(insertionIndex, data);
|
|
510
|
-
}
|
|
511
|
-
return results;
|
|
512
|
-
}, "fetchMerkleProof");
|
|
513
|
-
}
|
|
514
|
-
chunkPK6SKIKE_cjs.__name(getMerkleProofFetcher, "getMerkleProofFetcher");
|
|
515
|
-
function getBatchMerkleProofFetcher(args, deps) {
|
|
516
|
-
const { apiEndpoint } = args;
|
|
517
|
-
const client = new indexerReadServiceClient.ReadServiceClient({ endpoint: apiEndpoint, fetch: deps?.fetch });
|
|
518
|
-
return /* @__PURE__ */ chunkPK6SKIKE_cjs.__name(async function fetchBatchMerkleProof(treeIndex, insertionIndices) {
|
|
519
|
-
if (insertionIndices.length === 0) {
|
|
520
|
-
return { root: new Uint8Array(32), proofs: /* @__PURE__ */ new Map() };
|
|
521
|
-
}
|
|
522
|
-
if (treeIndex < 0n) {
|
|
523
|
-
throw new IndexerError(
|
|
524
|
-
"fetchBatchMerkleProof",
|
|
525
|
-
`Invalid tree index: ${String(treeIndex)}. Must be non-negative.`
|
|
526
|
-
);
|
|
527
|
-
}
|
|
528
|
-
for (const idx of insertionIndices) {
|
|
529
|
-
if (idx < 0n) {
|
|
530
|
-
throw new IndexerError(
|
|
531
|
-
"fetchBatchMerkleProof",
|
|
532
|
-
`Invalid insertion index: ${String(idx)}. Must be non-negative.`
|
|
533
|
-
);
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
let data;
|
|
537
|
-
try {
|
|
538
|
-
data = await client.getBatchProof(
|
|
539
|
-
treeIndex,
|
|
540
|
-
insertionIndices.map((idx) => BigInt(idx))
|
|
541
|
-
);
|
|
542
|
-
} catch (error) {
|
|
543
|
-
throw new IndexerError(
|
|
544
|
-
"fetchBatchMerkleProof",
|
|
545
|
-
`Failed to fetch batch proofs: ${error instanceof Error ? error.message : String(error)}`,
|
|
546
|
-
void 0,
|
|
547
|
-
error instanceof Error ? error : void 0
|
|
548
|
-
);
|
|
549
|
-
}
|
|
550
|
-
const root = base64ToU256LeBytes(data.root);
|
|
551
|
-
const proofs = /* @__PURE__ */ new Map();
|
|
552
|
-
for (const entry of data.proofs) {
|
|
553
|
-
proofs.set(entry.insertion_index, {
|
|
554
|
-
merklePath: entry.proof.map((hash) => base64ToU256LeBytes(hash)),
|
|
555
|
-
leaf: base64ToU256LeBytes(entry.leaf)
|
|
556
|
-
});
|
|
557
|
-
}
|
|
558
|
-
return { root, proofs };
|
|
559
|
-
}, "fetchBatchMerkleProof");
|
|
560
|
-
}
|
|
561
|
-
chunkPK6SKIKE_cjs.__name(getBatchMerkleProofFetcher, "getBatchMerkleProofFetcher");
|
|
562
|
-
function getUtxoDataFetcher(args, deps) {
|
|
563
|
-
const { apiEndpoint } = args;
|
|
564
|
-
const client = new indexerReadServiceClient.ReadServiceClient({ endpoint: apiEndpoint, fetch: deps?.fetch });
|
|
565
|
-
return /* @__PURE__ */ chunkPK6SKIKE_cjs.__name(async function fetchUtxoData(startIndex, endIndex, limit) {
|
|
566
|
-
if (startIndex < 0n) {
|
|
567
|
-
throw new IndexerError(
|
|
568
|
-
"fetchUtxoData",
|
|
569
|
-
`Invalid start index: ${String(startIndex)}. Must be non-negative.`
|
|
570
|
-
);
|
|
571
|
-
}
|
|
572
|
-
if (endIndex !== void 0 && endIndex < startIndex) {
|
|
573
|
-
throw new IndexerError(
|
|
574
|
-
"fetchUtxoData",
|
|
575
|
-
`Invalid end index: ${String(endIndex)}. Must be >= start index (${String(startIndex)}).`
|
|
576
|
-
);
|
|
577
|
-
}
|
|
578
|
-
const effectiveLimit = limit ?? DEFAULT_UTXO_LIMIT;
|
|
579
|
-
if (effectiveLimit < 1n || effectiveLimit > MAX_UTXO_LIMIT) {
|
|
580
|
-
throw new IndexerError(
|
|
581
|
-
"fetchUtxoData",
|
|
582
|
-
`Invalid limit: ${String(effectiveLimit)}. Must be between 1 and ${String(MAX_UTXO_LIMIT)}.`
|
|
583
|
-
);
|
|
584
|
-
}
|
|
585
|
-
let response;
|
|
586
|
-
try {
|
|
587
|
-
response = await client.getUtxoData({
|
|
588
|
-
start: startIndex,
|
|
589
|
-
end: endIndex,
|
|
590
|
-
limit: effectiveLimit
|
|
591
|
-
});
|
|
592
|
-
} catch (error) {
|
|
593
|
-
throw new IndexerError(
|
|
594
|
-
"fetchUtxoData",
|
|
595
|
-
`Network error: ${error instanceof Error ? error.message : String(error)}`,
|
|
596
|
-
void 0,
|
|
597
|
-
error instanceof Error ? error : void 0
|
|
598
|
-
);
|
|
599
|
-
}
|
|
600
|
-
const items = /* @__PURE__ */ new Map();
|
|
601
|
-
for (const item of response.items) {
|
|
602
|
-
try {
|
|
603
|
-
const senderAddress = splitAddressBase64(item.h1_sender_address);
|
|
604
|
-
const mintAddress = splitAddressBase64(item.h1_mint_address);
|
|
605
|
-
const timestamp = {
|
|
606
|
-
year: item.h1_year,
|
|
607
|
-
month: item.h1_month,
|
|
608
|
-
day: item.h1_day,
|
|
609
|
-
hour: item.h1_hour,
|
|
610
|
-
minute: item.h1_minute,
|
|
611
|
-
second: item.h1_second
|
|
612
|
-
};
|
|
613
|
-
const h1Components = {
|
|
614
|
-
version: BigInt(item.h1_version),
|
|
615
|
-
commitmentIndex: BigInt(item.h1_commitment_index),
|
|
616
|
-
senderAddressLow: senderAddress.low,
|
|
617
|
-
senderAddressHigh: senderAddress.high,
|
|
618
|
-
relayerFixedSolFees: item.h1_relayer_fixed_sol_fees,
|
|
619
|
-
mintAddressLow: mintAddress.low,
|
|
620
|
-
mintAddressHigh: mintAddress.high,
|
|
621
|
-
timestamp,
|
|
622
|
-
poolVolumeSpl: item.h1_pool_volume_spl,
|
|
623
|
-
poolVolumeSol: item.h1_pool_volume_sol
|
|
624
|
-
};
|
|
625
|
-
const utxoItem = {
|
|
626
|
-
absoluteIndex: item.absolute_index,
|
|
627
|
-
treeIndex: item.tree_index,
|
|
628
|
-
insertionIndex: item.insertion_index,
|
|
629
|
-
finalCommitment: base64ToU256LeBytes(item.final_commitment),
|
|
630
|
-
h1Components,
|
|
631
|
-
h1Hash: base64ToU256LeBytes(item.h1_hash),
|
|
632
|
-
h2Hash: base64ToU256LeBytes(item.h2_hash),
|
|
633
|
-
aesEncryptedData: base64ToAesCiphertext(item.aes_encrypted_data),
|
|
634
|
-
depositorX25519PublicKey: base64ToX25519PublicKey(item.depositor_x25519_public_key),
|
|
635
|
-
timestamp: item.timestamp,
|
|
636
|
-
slot: item.slot,
|
|
637
|
-
eventType: item.event_type
|
|
638
|
-
};
|
|
639
|
-
items.set(item.insertion_index, utxoItem);
|
|
640
|
-
} catch (error) {
|
|
641
|
-
throw new IndexerError(
|
|
642
|
-
"fetchUtxoData",
|
|
643
|
-
`Failed to parse UTXO data for index ${String(item.absolute_index)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
644
|
-
void 0,
|
|
645
|
-
error instanceof Error ? error : void 0
|
|
646
|
-
);
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
return {
|
|
650
|
-
items,
|
|
651
|
-
hasMore: response.has_more,
|
|
652
|
-
nextCursor: response.next_cursor ?? void 0,
|
|
653
|
-
totalCount: response.total_count
|
|
654
|
-
};
|
|
655
|
-
}, "fetchUtxoData");
|
|
656
|
-
}
|
|
657
|
-
chunkPK6SKIKE_cjs.__name(getUtxoDataFetcher, "getUtxoDataFetcher");
|
|
658
434
|
|
|
659
435
|
// src/umbra/client.ts
|
|
660
436
|
var notImplementedGenerator = /* @__PURE__ */ chunkPK6SKIKE_cjs.__name(async () => {
|
|
@@ -698,15 +474,15 @@ async function getUmbraClient(args, deps) {
|
|
|
698
474
|
rpcUrl,
|
|
699
475
|
rpcSubscriptionsUrl
|
|
700
476
|
});
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
apiEndpoint: indexerApiEndpoint
|
|
709
|
-
}
|
|
477
|
+
let fetchMerkleProof;
|
|
478
|
+
let fetchBatchMerkleProof;
|
|
479
|
+
let fetchUtxoData;
|
|
480
|
+
if (indexerApiEndpoint !== void 0 && indexerApiEndpoint !== "") {
|
|
481
|
+
const { getMerkleProofFetcher, getBatchMerkleProofFetcher, getUtxoDataFetcher } = await import('./indexer-XOUBVRNU.cjs');
|
|
482
|
+
fetchMerkleProof = getMerkleProofFetcher({ apiEndpoint: indexerApiEndpoint });
|
|
483
|
+
fetchBatchMerkleProof = getBatchMerkleProofFetcher({ apiEndpoint: indexerApiEndpoint });
|
|
484
|
+
fetchUtxoData = getUtxoDataFetcher({ apiEndpoint: indexerApiEndpoint });
|
|
485
|
+
}
|
|
710
486
|
const defaultMasterSeedStorage = getDefaultMasterSeedStorage();
|
|
711
487
|
const defaultMasterSeedGenerator = getDefaultMasterSeedGenerator(signer);
|
|
712
488
|
const masterSeedLoad = deps?.masterSeedStorage?.load ?? defaultMasterSeedStorage.load;
|
|
@@ -803,59 +579,11 @@ async function getUmbraClient(args, deps) {
|
|
|
803
579
|
}
|
|
804
580
|
chunkPK6SKIKE_cjs.__name(getUmbraClient, "getUmbraClient");
|
|
805
581
|
|
|
806
|
-
// src/umbra/constants.ts
|
|
807
|
-
var UMBRA_MESSAGE_TO_SIGN = `Umbra Protocol – User Consent & Acknowledgement
|
|
808
|
-
|
|
809
|
-
Please read carefully before continuing. Umbra is a non-custodial, open-source protocol. Umbra does not hold, control, manage, or access your digital assets, private keys, viewing keys, transactions, or personal data. All interactions with the Umbra protocol occur through autonomous smart contracts and wallet-signed transactions executed directly on the blockchain.
|
|
810
|
-
|
|
811
|
-
By using the Umbra protocol, you acknowledge and agree that:
|
|
812
|
-
|
|
813
|
-
1. You are solely responsible for managing your wallet, private keys, privacy settings, viewing key disclosures, and any transactions or interactions you authorize.
|
|
814
|
-
2. Blockchain transactions are generally irreversible, and smart contracts may contain bugs, vulnerabilities, or unintended behavior.
|
|
815
|
-
3. Errors, misuse, misconfiguration, third-party tools, relayers, or loss of keys may result in permanent and unrecoverable loss of assets or privacy.
|
|
816
|
-
4. Privacy features are designed to enhance confidentiality but do not guarantee absolute or unconditional anonymity.
|
|
817
|
-
5. Transactions may involve independent relayers or third-party infrastructure that Umbra does not operate, control, or supervise.
|
|
818
|
-
6. By clicking "I Agree", you confirm that you have read, understood, and accepted all applicable terms, policies, risk disclosures, notices, and other documentation governing your access to and use of the Umbra protocol, as published or made available by Umbra from time to time.
|
|
819
|
-
|
|
820
|
-
You acknowledge that such documentation may be updated or modified, and that continued access to or use of the Umbra Protocol constitutes acceptance of the then-current versions. If you do not agree, do not proceed and discontinue use of the Umbra protocol.`;
|
|
821
|
-
var FEE_OFFSETS = {
|
|
822
|
-
/**
|
|
823
|
-
* Offset used in `FeeVault` PDA derivation for the unified protocol fees pool.
|
|
824
|
-
*
|
|
825
|
-
* @remarks
|
|
826
|
-
* Passed as the final seed to `findProtocolFeeVaultPda` and
|
|
827
|
-
* `findRelayerFeeVaultPda`. Currently `0n`.
|
|
828
|
-
*
|
|
829
|
-
* @readonly
|
|
830
|
-
*/
|
|
831
|
-
PROTOCOL_FEES_POOL: 0n,
|
|
832
|
-
/**
|
|
833
|
-
* Offset used in `FeeSchedule` PDA derivation.
|
|
834
|
-
*
|
|
835
|
-
* @remarks
|
|
836
|
-
* Passed as the final seed to `findFeeSchedulePda`. Currently `0n`.
|
|
837
|
-
*
|
|
838
|
-
* @readonly
|
|
839
|
-
*/
|
|
840
|
-
PROTOCOL_FEES_CONFIG: 0n,
|
|
841
|
-
/**
|
|
842
|
-
* Offset used in relayer fee configuration PDA derivation.
|
|
843
|
-
*
|
|
844
|
-
* @remarks
|
|
845
|
-
* Passed as the offset seed when looking up the relayer's fee configuration account.
|
|
846
|
-
* Currently `0n`.
|
|
847
|
-
*
|
|
848
|
-
* @readonly
|
|
849
|
-
*/
|
|
850
|
-
RELAYER_FEES_CONFIG: 0n
|
|
851
|
-
};
|
|
852
|
-
var BPS_DIVISOR = 16384n;
|
|
853
|
-
|
|
854
582
|
// src/umbra/fee-provider.ts
|
|
855
583
|
var TREE_DEPTH = 4;
|
|
856
584
|
var MAX_LEAVES = 1 << TREE_DEPTH;
|
|
857
585
|
async function computeLeafHash(slab) {
|
|
858
|
-
const aggregator =
|
|
586
|
+
const aggregator = chunkYFUGKMNS_cjs.getPoseidonAggregator();
|
|
859
587
|
return await aggregator([
|
|
860
588
|
slab.amountLowerBound,
|
|
861
589
|
slab.amountUpperBound,
|
|
@@ -870,7 +598,7 @@ async function buildFullTree(slabs) {
|
|
|
870
598
|
`Too many fee slabs: ${String(slabs.length)} (max ${String(MAX_LEAVES)})`
|
|
871
599
|
);
|
|
872
600
|
}
|
|
873
|
-
const hasher =
|
|
601
|
+
const hasher = chunkYFUGKMNS_cjs.getPoseidonHasher();
|
|
874
602
|
const leafHashes = Array.from({ length: MAX_LEAVES }, () => 0n);
|
|
875
603
|
for (const [index, slab] of slabs.entries()) {
|
|
876
604
|
leafHashes[index] = await computeLeafHash(slab);
|
|
@@ -1106,7 +834,7 @@ function enrichWithMerkleProof(scannedUtxos, batchProof) {
|
|
|
1106
834
|
return scannedUtxos.map((utxo) => {
|
|
1107
835
|
const proofEntry = batchProof.proofs.get(utxo.insertionIndex);
|
|
1108
836
|
if (proofEntry === void 0) {
|
|
1109
|
-
throw new
|
|
837
|
+
throw new chunkKCHHJKQN_cjs.FetchUtxosError(
|
|
1110
838
|
"proof-enrichment",
|
|
1111
839
|
`Missing proof for insertion index ${String(utxo.insertionIndex)}`
|
|
1112
840
|
);
|
|
@@ -1138,32 +866,32 @@ chunkPK6SKIKE_cjs.__name(enrichWithMerkleProof, "enrichWithMerkleProof");
|
|
|
1138
866
|
function getClaimableUtxoScannerFunction(args, deps) {
|
|
1139
867
|
const { client } = args;
|
|
1140
868
|
if (client.fetchUtxoData === void 0) {
|
|
1141
|
-
throw new
|
|
869
|
+
throw new chunkKCHHJKQN_cjs.FetchUtxosError(
|
|
1142
870
|
"initialization",
|
|
1143
871
|
"Client must have fetchUtxoData configured for UTXO discovery. Provide indexerApiEndpoint when creating the client."
|
|
1144
872
|
);
|
|
1145
873
|
}
|
|
1146
874
|
const fetchUtxoData = deps?.fetchUtxoData ?? client.fetchUtxoData;
|
|
1147
|
-
const aesDecryptor = deps?.aesDecryptor ??
|
|
875
|
+
const aesDecryptor = deps?.aesDecryptor ?? chunkYFUGKMNS_cjs.getAesDecryptor();
|
|
1148
876
|
const x25519GetSharedSecret = deps?.x25519GetSharedSecret ?? ((privateKey, publicKey) => ed25519_js.x25519.getSharedSecret(privateKey, publicKey));
|
|
1149
|
-
const mvkX25519KeypairDeriver =
|
|
877
|
+
const mvkX25519KeypairDeriver = chunkYFUGKMNS_cjs.getUserAccountX25519KeypairDeriver({
|
|
1150
878
|
client
|
|
1151
879
|
});
|
|
1152
880
|
return /* @__PURE__ */ chunkPK6SKIKE_cjs.__name(async function fetchClaimableUtxos(treeIndex, startInsertionIndex, endInsertionIndex) {
|
|
1153
881
|
if (treeIndex < 0n) {
|
|
1154
|
-
throw new
|
|
882
|
+
throw new chunkKCHHJKQN_cjs.FetchUtxosError(
|
|
1155
883
|
"validation",
|
|
1156
884
|
`Invalid tree index: ${String(treeIndex)}. Must be non-negative.`
|
|
1157
885
|
);
|
|
1158
886
|
}
|
|
1159
887
|
if (startInsertionIndex < 0n) {
|
|
1160
|
-
throw new
|
|
888
|
+
throw new chunkKCHHJKQN_cjs.FetchUtxosError(
|
|
1161
889
|
"validation",
|
|
1162
890
|
`Invalid start insertion index: ${String(startInsertionIndex)}. Must be non-negative.`
|
|
1163
891
|
);
|
|
1164
892
|
}
|
|
1165
893
|
if (endInsertionIndex !== void 0 && endInsertionIndex < startInsertionIndex) {
|
|
1166
|
-
throw new
|
|
894
|
+
throw new chunkKCHHJKQN_cjs.FetchUtxosError(
|
|
1167
895
|
"validation",
|
|
1168
896
|
`Invalid end insertion index: ${String(endInsertionIndex)}. Must be >= start index.`
|
|
1169
897
|
);
|
|
@@ -1174,8 +902,8 @@ function getClaimableUtxoScannerFunction(args, deps) {
|
|
|
1174
902
|
clientX25519PrivateKey = keypairResult.x25519Keypair.privateKey;
|
|
1175
903
|
chunkLTCKPTZC_cjs.assertX25519PrivateKey(clientX25519PrivateKey);
|
|
1176
904
|
} catch (error) {
|
|
1177
|
-
if (error instanceof
|
|
1178
|
-
throw new
|
|
905
|
+
if (error instanceof chunkKCHHJKQN_cjs.FetchUtxosError) throw error;
|
|
906
|
+
throw new chunkKCHHJKQN_cjs.FetchUtxosError(
|
|
1179
907
|
"key-derivation",
|
|
1180
908
|
`Failed to derive X25519 private key: ${error instanceof Error ? error.message : String(error)}`,
|
|
1181
909
|
error instanceof Error ? error : void 0
|
|
@@ -1193,13 +921,14 @@ function getClaimableUtxoScannerFunction(args, deps) {
|
|
|
1193
921
|
try {
|
|
1194
922
|
result = await fetchUtxoData(cursor, absoluteEndIndex, DEFAULT_PAGINATION_LIMIT);
|
|
1195
923
|
} catch (error) {
|
|
1196
|
-
if (error instanceof
|
|
1197
|
-
throw new
|
|
924
|
+
if (error instanceof chunkKCHHJKQN_cjs.FetchUtxosError) throw error;
|
|
925
|
+
throw new chunkKCHHJKQN_cjs.FetchUtxosError(
|
|
1198
926
|
"indexer-fetch",
|
|
1199
927
|
`Failed to fetch UTXO data from indexer: ${error instanceof Error ? error.message : String(error)}`,
|
|
1200
928
|
error instanceof Error ? error : void 0
|
|
1201
929
|
);
|
|
1202
930
|
}
|
|
931
|
+
const treeUtxos = [];
|
|
1203
932
|
for (const [, utxo] of result.items) {
|
|
1204
933
|
if (utxo.treeIndex !== treeIndex) {
|
|
1205
934
|
continue;
|
|
@@ -1207,12 +936,14 @@ function getClaimableUtxoScannerFunction(args, deps) {
|
|
|
1207
936
|
if (lastSeenInsertionIndex === null || utxo.insertionIndex > lastSeenInsertionIndex) {
|
|
1208
937
|
lastSeenInsertionIndex = utxo.insertionIndex;
|
|
1209
938
|
}
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
x25519GetSharedSecret
|
|
1215
|
-
)
|
|
939
|
+
treeUtxos.push(utxo);
|
|
940
|
+
}
|
|
941
|
+
const decryptedResults = await Promise.all(
|
|
942
|
+
treeUtxos.map(
|
|
943
|
+
(utxo) => tryDecryptUtxo(utxo, clientX25519PrivateKey, aesDecryptor, x25519GetSharedSecret)
|
|
944
|
+
)
|
|
945
|
+
);
|
|
946
|
+
for (const decrypted of decryptedResults) {
|
|
1216
947
|
if (decrypted !== null) {
|
|
1217
948
|
allDecrypted.push(decrypted);
|
|
1218
949
|
}
|
|
@@ -1498,10 +1229,10 @@ async function processUtxoInBatch(args, deps) {
|
|
|
1498
1229
|
depositModifiedGenerationIndexBytes[index2] = Number(indexValue & 0xffn);
|
|
1499
1230
|
indexValue >>= 8n;
|
|
1500
1231
|
}
|
|
1501
|
-
const nullifier =
|
|
1232
|
+
const nullifier = chunkYFUGKMNS_cjs.deriveNullifierFromModifiedGenerationIndex(
|
|
1502
1233
|
depositModifiedGenerationIndexBytes
|
|
1503
1234
|
);
|
|
1504
|
-
const randomSecret =
|
|
1235
|
+
const randomSecret = chunkYFUGKMNS_cjs.deriveRandomSecretFromModifiedGenerationIndex(
|
|
1505
1236
|
depositModifiedGenerationIndexBytes
|
|
1506
1237
|
);
|
|
1507
1238
|
perLeafNullifiers.push(nullifier);
|
|
@@ -1678,7 +1409,7 @@ async function processUtxoInBatch(args, deps) {
|
|
|
1678
1409
|
const blindingFactorOffset = chunk5GUSMQ74_cjs.decodeU256BeBytesToU256(
|
|
1679
1410
|
blindingFactorOffsetBytes
|
|
1680
1411
|
);
|
|
1681
|
-
const blindingFactor =
|
|
1412
|
+
const blindingFactor = chunkYFUGKMNS_cjs.deriveKeystreamBlindingFactor(blindingFactorOffset);
|
|
1682
1413
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(
|
|
1683
1414
|
blindingFactor,
|
|
1684
1415
|
`linkerKeystreamBlindingFactor[${String(leafIndex)}][${String(keyIndex)}]`
|
|
@@ -1758,7 +1489,7 @@ async function processUtxoInBatch(args, deps) {
|
|
|
1758
1489
|
}
|
|
1759
1490
|
const nullifierHashesAggregatedHash = await poseidonAggregator(nullifierHashes);
|
|
1760
1491
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(nullifierHashesAggregatedHash, "nullifierHashesAggregatedHash");
|
|
1761
|
-
const rcEncryptor =
|
|
1492
|
+
const rcEncryptor = chunkYFUGKMNS_cjs.getRescueEncryptorFromPrivateKey(clientX25519PrivateKey, {
|
|
1762
1493
|
umbraX25519PublicKey: networkConfig.mxePubkey
|
|
1763
1494
|
});
|
|
1764
1495
|
const randomFactorBytes = sha3Addons_js.kmac256(
|
|
@@ -1826,7 +1557,7 @@ async function processUtxoInBatch(args, deps) {
|
|
|
1826
1557
|
chunkLTCKPTZC_cjs.assertCurve25519FieldElement(rcEncryptedMvkHigh, "rcEncryptedMvkHigh");
|
|
1827
1558
|
chunkLTCKPTZC_cjs.assertCurve25519FieldElement(rcEncryptedRandomFactorLow, "rcEncryptedRandomFactorLow");
|
|
1828
1559
|
chunkLTCKPTZC_cjs.assertCurve25519FieldElement(rcEncryptedRandomFactorHigh, "rcEncryptedRandomFactorHigh");
|
|
1829
|
-
const rcKeyGenerator =
|
|
1560
|
+
const rcKeyGenerator = chunkYFUGKMNS_cjs.getRescueKeyGeneratorFromPrivateKey(clientX25519PrivateKey, {
|
|
1830
1561
|
umbraX25519PublicKey: networkConfig.mxePubkey
|
|
1831
1562
|
});
|
|
1832
1563
|
const rcCounters = [
|
|
@@ -1893,7 +1624,7 @@ async function processUtxoInBatch(args, deps) {
|
|
|
1893
1624
|
rescueEncryptionCommitmentBlindingFactorOffsetBytes
|
|
1894
1625
|
);
|
|
1895
1626
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(blindingFactorForRescueCommitment, "blindingFactorForRescueCommitment");
|
|
1896
|
-
const rescueEncryptionCommitmentGenerator =
|
|
1627
|
+
const rescueEncryptionCommitmentGenerator = chunkYFUGKMNS_cjs.getRescueCommitmentGenerator();
|
|
1897
1628
|
const getRcKey = /* @__PURE__ */ chunkPK6SKIKE_cjs.__name((counter) => {
|
|
1898
1629
|
const key = rcKeys.get(counter);
|
|
1899
1630
|
if (key === void 0) {
|
|
@@ -1964,7 +1695,7 @@ async function processUtxoInBatch(args, deps) {
|
|
|
1964
1695
|
const fiatShamirChallenge = fiatShamirChallengeGenerator(fiatShamirInputBytes);
|
|
1965
1696
|
chunkLTCKPTZC_cjs.assertCurve25519FieldElement(fiatShamirChallenge, "fiatShamirChallenge");
|
|
1966
1697
|
const fiatShamirChallengeLimbs = chunkZY3TSHMJ_cjs.convertU256ToBase85Limbs(fiatShamirChallenge);
|
|
1967
|
-
const modulePow =
|
|
1698
|
+
const modulePow = chunkYFUGKMNS_cjs.getModuloPowCurve25519Function();
|
|
1968
1699
|
const challengeSquared = modulePow(fiatShamirChallenge, 2n);
|
|
1969
1700
|
const challengeCubed = modulePow(fiatShamirChallenge, 3n);
|
|
1970
1701
|
const challengeToFourth = modulePow(fiatShamirChallenge, 4n);
|
|
@@ -2047,7 +1778,7 @@ async function processUtxoInBatch(args, deps) {
|
|
|
2047
1778
|
inverseForKeysForRandomFactorHighLimbs,
|
|
2048
1779
|
"inverseForKeysForRandomFactorHighLimbs"
|
|
2049
1780
|
);
|
|
2050
|
-
const polynomialEvaluator =
|
|
1781
|
+
const polynomialEvaluator = chunkYFUGKMNS_cjs.getPolynomialEvaluatorFunction();
|
|
2051
1782
|
const polynomialEvaluationResultScalar = polynomialEvaluator(
|
|
2052
1783
|
[
|
|
2053
1784
|
chunkZY3TSHMJ_cjs.createCurve25519FieldElement(finalAmount),
|
|
@@ -2495,19 +2226,19 @@ function getReceiverClaimableUtxoToEncryptedBalanceClaimerFunction(args, deps) {
|
|
|
2495
2226
|
const pollingIntervalMs = deps.pollingIntervalMs ?? 3e3;
|
|
2496
2227
|
const timeoutMs = deps.timeoutMs ?? 12e4;
|
|
2497
2228
|
const onProgress = deps.onProgress;
|
|
2498
|
-
const masterViewingKeyGenerator = deps.keys?.masterViewingKeyGenerator ??
|
|
2499
|
-
const masterViewingKeyBlindingFactorGenerator = deps.keys?.masterViewingKeyBlindingFactorGenerator ??
|
|
2500
|
-
const poseidonPrivateKeyGenerator = deps.keys?.poseidonPrivateKeyGenerator ??
|
|
2501
|
-
const poseidonBlindingFactorGenerator = deps.keys?.poseidonBlindingFactorGenerator ??
|
|
2502
|
-
const secondViewingKeyGenerator = deps.keys?.secondViewingKeyGenerator ??
|
|
2503
|
-
const mvkX25519KeypairDeriver = deps.keys?.mvkX25519KeypairDeriver ??
|
|
2504
|
-
const poseidonHasher = deps.crypto?.poseidonHasher ??
|
|
2505
|
-
const poseidonAggregator = deps.crypto?.poseidonAggregator ??
|
|
2506
|
-
const poseidonEncryptor = deps.crypto?.poseidonEncryptor ??
|
|
2507
|
-
const poseidonKeystreamGeneratorFunction = deps.crypto?.poseidonKeystreamGenerator ??
|
|
2508
|
-
const userCommitmentGeneratorFunction = deps.crypto?.userCommitmentGenerator ??
|
|
2509
|
-
const keystreamCommitmentGeneratorFunction = deps.crypto?.keystreamCommitmentGenerator ??
|
|
2510
|
-
const fiatShamirChallengeGeneratorFunction = deps.crypto?.fiatShamirChallengeGenerator ??
|
|
2229
|
+
const masterViewingKeyGenerator = deps.keys?.masterViewingKeyGenerator ?? chunkYFUGKMNS_cjs.getMasterViewingKeyDeriver({ client });
|
|
2230
|
+
const masterViewingKeyBlindingFactorGenerator = deps.keys?.masterViewingKeyBlindingFactorGenerator ?? chunkYFUGKMNS_cjs.getMasterViewingKeyBlindingFactorDeriver({ client });
|
|
2231
|
+
const poseidonPrivateKeyGenerator = deps.keys?.poseidonPrivateKeyGenerator ?? chunkYFUGKMNS_cjs.getPoseidonPrivateKeyDeriver({ client });
|
|
2232
|
+
const poseidonBlindingFactorGenerator = deps.keys?.poseidonBlindingFactorGenerator ?? chunkYFUGKMNS_cjs.getPoseidonBlindingFactorDeriver({ client });
|
|
2233
|
+
const secondViewingKeyGenerator = deps.keys?.secondViewingKeyGenerator ?? chunkYFUGKMNS_cjs.getSecondViewingKeyDeriver({ client });
|
|
2234
|
+
const mvkX25519KeypairDeriver = deps.keys?.mvkX25519KeypairDeriver ?? chunkYFUGKMNS_cjs.getUserAccountX25519KeypairDeriver({ client });
|
|
2235
|
+
const poseidonHasher = deps.crypto?.poseidonHasher ?? chunkYFUGKMNS_cjs.getPoseidonHasher();
|
|
2236
|
+
const poseidonAggregator = deps.crypto?.poseidonAggregator ?? chunkYFUGKMNS_cjs.getPoseidonAggregator();
|
|
2237
|
+
const poseidonEncryptor = deps.crypto?.poseidonEncryptor ?? chunkYFUGKMNS_cjs.getPoseidonEncryptor();
|
|
2238
|
+
const poseidonKeystreamGeneratorFunction = deps.crypto?.poseidonKeystreamGenerator ?? chunkYFUGKMNS_cjs.getPoseidonKeystreamGenerator();
|
|
2239
|
+
const userCommitmentGeneratorFunction = deps.crypto?.userCommitmentGenerator ?? chunkYFUGKMNS_cjs.getUserCommitmentGeneratorFunction();
|
|
2240
|
+
const keystreamCommitmentGeneratorFunction = deps.crypto?.keystreamCommitmentGenerator ?? chunkYFUGKMNS_cjs.getKeystreamCommitmentGenerator();
|
|
2241
|
+
const fiatShamirChallengeGeneratorFunction = deps.crypto?.fiatShamirChallengeGenerator ?? chunkYFUGKMNS_cjs.getFiatShamirChallengeGeneratorFunction();
|
|
2511
2242
|
const generateRandomU2562 = deps.random?.generateRandomU256 ?? chunkZY3TSHMJ_cjs.generateRandomU256;
|
|
2512
2243
|
const generateRandomU1282 = deps.random?.generateRandomU128 ?? chunkZY3TSHMJ_cjs.generateRandomU128;
|
|
2513
2244
|
return async (utxos, optionalData, microLamportsPerAcu) => {
|
|
@@ -2598,16 +2329,16 @@ function getReceiverClaimableUtxoToEncryptedBalanceClaimerFunction(args, deps) {
|
|
|
2598
2329
|
batches: resultsByBatch
|
|
2599
2330
|
};
|
|
2600
2331
|
} catch (error) {
|
|
2601
|
-
if (error instanceof
|
|
2332
|
+
if (error instanceof chunkKCHHJKQN_cjs.ClaimUtxoError) {
|
|
2602
2333
|
throw error;
|
|
2603
2334
|
}
|
|
2604
2335
|
if (error instanceof chunkFSK2ICMB_cjs.CryptographyError) {
|
|
2605
|
-
throw new
|
|
2336
|
+
throw new chunkKCHHJKQN_cjs.ClaimUtxoError("zk-proof-generation", error.message, error);
|
|
2606
2337
|
}
|
|
2607
|
-
if (error instanceof
|
|
2608
|
-
throw new
|
|
2338
|
+
if (error instanceof chunkKCHHJKQN_cjs.RpcError) {
|
|
2339
|
+
throw new chunkKCHHJKQN_cjs.ClaimUtxoError("initialization", error.message, error);
|
|
2609
2340
|
}
|
|
2610
|
-
throw new
|
|
2341
|
+
throw new chunkKCHHJKQN_cjs.ClaimUtxoError(
|
|
2611
2342
|
"transaction-send",
|
|
2612
2343
|
error instanceof Error ? error.message : String(error),
|
|
2613
2344
|
error instanceof Error ? error : void 0
|
|
@@ -2811,7 +2542,7 @@ async function processUtxoInBatch2(args, deps) {
|
|
|
2811
2542
|
depositModifiedGenerationIndexBytes[index] = Number(indexValueForExpansion & 0xffn);
|
|
2812
2543
|
indexValueForExpansion >>= 8n;
|
|
2813
2544
|
}
|
|
2814
|
-
const expandedModifiedGenerationIndex =
|
|
2545
|
+
const expandedModifiedGenerationIndex = chunkYFUGKMNS_cjs.expandModifiedGenerationIndex(
|
|
2815
2546
|
depositModifiedGenerationIndexBytes
|
|
2816
2547
|
);
|
|
2817
2548
|
let ephemeralOffset = 0n;
|
|
@@ -2883,10 +2614,10 @@ async function processUtxoInBatch2(args, deps) {
|
|
|
2883
2614
|
depositModifiedGenerationIndexBytes2[index2] = Number(indexValue & 0xffn);
|
|
2884
2615
|
indexValue >>= 8n;
|
|
2885
2616
|
}
|
|
2886
|
-
const nullifier =
|
|
2617
|
+
const nullifier = chunkYFUGKMNS_cjs.deriveNullifierFromModifiedGenerationIndex(
|
|
2887
2618
|
depositModifiedGenerationIndexBytes2
|
|
2888
2619
|
);
|
|
2889
|
-
const randomSecret =
|
|
2620
|
+
const randomSecret = chunkYFUGKMNS_cjs.deriveRandomSecretFromModifiedGenerationIndex(
|
|
2890
2621
|
depositModifiedGenerationIndexBytes2
|
|
2891
2622
|
);
|
|
2892
2623
|
perLeafNullifiers.push(nullifier);
|
|
@@ -3063,7 +2794,7 @@ async function processUtxoInBatch2(args, deps) {
|
|
|
3063
2794
|
const blindingFactorOffset = chunk5GUSMQ74_cjs.decodeU256BeBytesToU256(
|
|
3064
2795
|
blindingFactorOffsetBytes
|
|
3065
2796
|
);
|
|
3066
|
-
const blindingFactor =
|
|
2797
|
+
const blindingFactor = chunkYFUGKMNS_cjs.deriveKeystreamBlindingFactor(blindingFactorOffset);
|
|
3067
2798
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(
|
|
3068
2799
|
blindingFactor,
|
|
3069
2800
|
`linkerKeystreamBlindingFactor[${String(leafIndex)}][${String(keyIndex)}]`
|
|
@@ -3142,7 +2873,7 @@ async function processUtxoInBatch2(args, deps) {
|
|
|
3142
2873
|
}
|
|
3143
2874
|
const nullifierHashesAggregatedHash = await poseidonAggregator(nullifierHashes);
|
|
3144
2875
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(nullifierHashesAggregatedHash, "nullifierHashesAggregatedHash");
|
|
3145
|
-
const rcEncryptor =
|
|
2876
|
+
const rcEncryptor = chunkYFUGKMNS_cjs.getRescueEncryptorFromPrivateKey(clientX25519PrivateKey, {
|
|
3146
2877
|
umbraX25519PublicKey: networkConfig.mxePubkey
|
|
3147
2878
|
});
|
|
3148
2879
|
const randomFactorBytes = sha3Addons_js.kmac256(
|
|
@@ -3210,7 +2941,7 @@ async function processUtxoInBatch2(args, deps) {
|
|
|
3210
2941
|
chunkLTCKPTZC_cjs.assertCurve25519FieldElement(rcEncryptedMvkHigh, "rcEncryptedMvkHigh");
|
|
3211
2942
|
chunkLTCKPTZC_cjs.assertCurve25519FieldElement(rcEncryptedRandomFactorLow, "rcEncryptedRandomFactorLow");
|
|
3212
2943
|
chunkLTCKPTZC_cjs.assertCurve25519FieldElement(rcEncryptedRandomFactorHigh, "rcEncryptedRandomFactorHigh");
|
|
3213
|
-
const rcKeyGenerator =
|
|
2944
|
+
const rcKeyGenerator = chunkYFUGKMNS_cjs.getRescueKeyGeneratorFromPrivateKey(clientX25519PrivateKey, {
|
|
3214
2945
|
umbraX25519PublicKey: networkConfig.mxePubkey
|
|
3215
2946
|
});
|
|
3216
2947
|
const rcCounters = [
|
|
@@ -3277,7 +3008,7 @@ async function processUtxoInBatch2(args, deps) {
|
|
|
3277
3008
|
rescueEncryptionCommitmentBlindingFactorOffsetBytes
|
|
3278
3009
|
);
|
|
3279
3010
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(blindingFactorForRescueCommitment, "blindingFactorForRescueCommitment");
|
|
3280
|
-
const rescueEncryptionCommitmentGenerator =
|
|
3011
|
+
const rescueEncryptionCommitmentGenerator = chunkYFUGKMNS_cjs.getRescueCommitmentGenerator();
|
|
3281
3012
|
const rcEncryptionCommitment = await rescueEncryptionCommitmentGenerator(
|
|
3282
3013
|
[
|
|
3283
3014
|
rcEncryptedFinalAmount,
|
|
@@ -3337,7 +3068,7 @@ async function processUtxoInBatch2(args, deps) {
|
|
|
3337
3068
|
const fiatShamirChallenge = fiatShamirChallengeGenerator(fiatShamirInputBytes);
|
|
3338
3069
|
chunkLTCKPTZC_cjs.assertCurve25519FieldElement(fiatShamirChallenge, "fiatShamirChallenge");
|
|
3339
3070
|
const fiatShamirChallengeLimbs = chunkZY3TSHMJ_cjs.convertU256ToBase85Limbs(fiatShamirChallenge);
|
|
3340
|
-
const modulePow =
|
|
3071
|
+
const modulePow = chunkYFUGKMNS_cjs.getModuloPowCurve25519Function();
|
|
3341
3072
|
const challengeSquared = modulePow(fiatShamirChallenge, 2n);
|
|
3342
3073
|
const challengeCubed = modulePow(fiatShamirChallenge, 3n);
|
|
3343
3074
|
const challengeToFourth = modulePow(fiatShamirChallenge, 4n);
|
|
@@ -3424,7 +3155,7 @@ async function processUtxoInBatch2(args, deps) {
|
|
|
3424
3155
|
inverseForKeysForRandomFactorHighLimbs,
|
|
3425
3156
|
"inverseForKeysForRandomFactorHighLimbs"
|
|
3426
3157
|
);
|
|
3427
|
-
const polynomialEvaluator =
|
|
3158
|
+
const polynomialEvaluator = chunkYFUGKMNS_cjs.getPolynomialEvaluatorFunction();
|
|
3428
3159
|
const polynomialEvaluationResultScalar = polynomialEvaluator(
|
|
3429
3160
|
[
|
|
3430
3161
|
chunkZY3TSHMJ_cjs.createCurve25519FieldElement(finalAmount),
|
|
@@ -3846,22 +3577,22 @@ function getSelfClaimableUtxoToEncryptedBalanceClaimerFunction(args, deps) {
|
|
|
3846
3577
|
const pollingIntervalMs = deps.pollingIntervalMs ?? 3e3;
|
|
3847
3578
|
const timeoutMs = deps.timeoutMs ?? 12e4;
|
|
3848
3579
|
const onProgress = deps.onProgress;
|
|
3849
|
-
const ephemeralUtxoMvkGenerator = deps.keys?.ephemeralUtxoMasterViewingKeyDeriver ??
|
|
3850
|
-
const ephemeralUtxoMvkBlindingFactorGenerator = deps.keys?.ephemeralUtxoMasterViewingKeyBlindingFactorDeriver ??
|
|
3580
|
+
const ephemeralUtxoMvkGenerator = deps.keys?.ephemeralUtxoMasterViewingKeyDeriver ?? chunkYFUGKMNS_cjs.getEphemeralUtxoMasterViewingKeyDeriver({ client });
|
|
3581
|
+
const ephemeralUtxoMvkBlindingFactorGenerator = deps.keys?.ephemeralUtxoMasterViewingKeyBlindingFactorDeriver ?? chunkYFUGKMNS_cjs.getEphemeralUtxoMasterViewingKeyBlindingFactorDeriver({
|
|
3851
3582
|
client
|
|
3852
3583
|
});
|
|
3853
|
-
const ephemeralUtxoPoseidonKeyGenerator = deps.keys?.ephemeralUtxoPoseidonKeyGenerator ??
|
|
3854
|
-
const ephemeralUtxoPoseidonKeyBlindingFactorGenerator = deps.keys?.ephemeralUtxoPoseidonKeyBlindingFactorGenerator ??
|
|
3584
|
+
const ephemeralUtxoPoseidonKeyGenerator = deps.keys?.ephemeralUtxoPoseidonKeyGenerator ?? chunkYFUGKMNS_cjs.getEphemeralUtxoPoseidonPrivateKeyDeriver({ client });
|
|
3585
|
+
const ephemeralUtxoPoseidonKeyBlindingFactorGenerator = deps.keys?.ephemeralUtxoPoseidonKeyBlindingFactorGenerator ?? chunkYFUGKMNS_cjs.getEphemeralUtxoPoseidonPrivateKeyBlindingFactorDeriver({
|
|
3855
3586
|
client
|
|
3856
3587
|
});
|
|
3857
|
-
const mvkX25519KeypairDeriver = deps.keys?.mvkX25519KeypairDeriver ??
|
|
3858
|
-
const poseidonHasher = deps.crypto?.poseidonHasher ??
|
|
3859
|
-
const poseidonAggregator = deps.crypto?.poseidonAggregator ??
|
|
3860
|
-
const poseidonEncryptor = deps.crypto?.poseidonEncryptor ??
|
|
3861
|
-
const poseidonKeystreamGeneratorFunction = deps.crypto?.poseidonKeystreamGenerator ??
|
|
3862
|
-
const userCommitmentGeneratorFunction = deps.crypto?.userCommitmentGenerator ??
|
|
3863
|
-
const keystreamCommitmentGeneratorFunction = deps.crypto?.keystreamCommitmentGenerator ??
|
|
3864
|
-
const fiatShamirChallengeGeneratorFunction = deps.crypto?.fiatShamirChallengeGenerator ??
|
|
3588
|
+
const mvkX25519KeypairDeriver = deps.keys?.mvkX25519KeypairDeriver ?? chunkYFUGKMNS_cjs.getUserAccountX25519KeypairDeriver({ client });
|
|
3589
|
+
const poseidonHasher = deps.crypto?.poseidonHasher ?? chunkYFUGKMNS_cjs.getPoseidonHasher();
|
|
3590
|
+
const poseidonAggregator = deps.crypto?.poseidonAggregator ?? chunkYFUGKMNS_cjs.getPoseidonAggregator();
|
|
3591
|
+
const poseidonEncryptor = deps.crypto?.poseidonEncryptor ?? chunkYFUGKMNS_cjs.getPoseidonEncryptor();
|
|
3592
|
+
const poseidonKeystreamGeneratorFunction = deps.crypto?.poseidonKeystreamGenerator ?? chunkYFUGKMNS_cjs.getPoseidonKeystreamGenerator();
|
|
3593
|
+
const userCommitmentGeneratorFunction = deps.crypto?.userCommitmentGenerator ?? chunkYFUGKMNS_cjs.getUserCommitmentGeneratorFunction();
|
|
3594
|
+
const keystreamCommitmentGeneratorFunction = deps.crypto?.keystreamCommitmentGenerator ?? chunkYFUGKMNS_cjs.getKeystreamCommitmentGenerator();
|
|
3595
|
+
const fiatShamirChallengeGeneratorFunction = deps.crypto?.fiatShamirChallengeGenerator ?? chunkYFUGKMNS_cjs.getFiatShamirChallengeGeneratorFunction();
|
|
3865
3596
|
const generateRandomU2562 = deps.random?.generateRandomU256 ?? chunkZY3TSHMJ_cjs.generateRandomU256;
|
|
3866
3597
|
const generateRandomU1282 = deps.random?.generateRandomU128 ?? chunkZY3TSHMJ_cjs.generateRandomU128;
|
|
3867
3598
|
return async (utxos, optionalData, microLamportsPerAcu) => {
|
|
@@ -3951,16 +3682,16 @@ function getSelfClaimableUtxoToEncryptedBalanceClaimerFunction(args, deps) {
|
|
|
3951
3682
|
batches: resultsByBatch
|
|
3952
3683
|
};
|
|
3953
3684
|
} catch (error) {
|
|
3954
|
-
if (error instanceof
|
|
3685
|
+
if (error instanceof chunkKCHHJKQN_cjs.ClaimUtxoError) {
|
|
3955
3686
|
throw error;
|
|
3956
3687
|
}
|
|
3957
3688
|
if (error instanceof chunkFSK2ICMB_cjs.CryptographyError) {
|
|
3958
|
-
throw new
|
|
3689
|
+
throw new chunkKCHHJKQN_cjs.ClaimUtxoError("zk-proof-generation", error.message, error);
|
|
3959
3690
|
}
|
|
3960
|
-
if (error instanceof
|
|
3961
|
-
throw new
|
|
3691
|
+
if (error instanceof chunkKCHHJKQN_cjs.RpcError) {
|
|
3692
|
+
throw new chunkKCHHJKQN_cjs.ClaimUtxoError("initialization", error.message, error);
|
|
3962
3693
|
}
|
|
3963
|
-
throw new
|
|
3694
|
+
throw new chunkKCHHJKQN_cjs.ClaimUtxoError(
|
|
3964
3695
|
"transaction-send",
|
|
3965
3696
|
error instanceof Error ? error.message : String(error),
|
|
3966
3697
|
error instanceof Error ? error : void 0
|
|
@@ -4163,7 +3894,7 @@ async function processUtxoInBatch3(args, deps) {
|
|
|
4163
3894
|
depositModifiedGenerationIndexBytes[index] = Number(indexValueForExpansion & 0xffn);
|
|
4164
3895
|
indexValueForExpansion >>= 8n;
|
|
4165
3896
|
}
|
|
4166
|
-
const expandedModifiedGenerationIndex =
|
|
3897
|
+
const expandedModifiedGenerationIndex = chunkYFUGKMNS_cjs.expandModifiedGenerationIndex(
|
|
4167
3898
|
depositModifiedGenerationIndexBytes
|
|
4168
3899
|
);
|
|
4169
3900
|
let ephemeralOffset = 0n;
|
|
@@ -4235,10 +3966,10 @@ async function processUtxoInBatch3(args, deps) {
|
|
|
4235
3966
|
depositModifiedGenerationIndexBytes2[index2] = Number(indexValue & 0xffn);
|
|
4236
3967
|
indexValue >>= 8n;
|
|
4237
3968
|
}
|
|
4238
|
-
const nullifier =
|
|
3969
|
+
const nullifier = chunkYFUGKMNS_cjs.deriveNullifierFromModifiedGenerationIndex(
|
|
4239
3970
|
depositModifiedGenerationIndexBytes2
|
|
4240
3971
|
);
|
|
4241
|
-
const randomSecret =
|
|
3972
|
+
const randomSecret = chunkYFUGKMNS_cjs.deriveRandomSecretFromModifiedGenerationIndex(
|
|
4242
3973
|
depositModifiedGenerationIndexBytes2
|
|
4243
3974
|
);
|
|
4244
3975
|
perLeafNullifiers.push(nullifier);
|
|
@@ -4359,7 +4090,7 @@ async function processUtxoInBatch3(args, deps) {
|
|
|
4359
4090
|
const blindingFactorOffset = chunk5GUSMQ74_cjs.decodeU256BeBytesToU256(
|
|
4360
4091
|
blindingFactorOffsetBytes
|
|
4361
4092
|
);
|
|
4362
|
-
const blindingFactor =
|
|
4093
|
+
const blindingFactor = chunkYFUGKMNS_cjs.deriveKeystreamBlindingFactor(blindingFactorOffset);
|
|
4363
4094
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(
|
|
4364
4095
|
blindingFactor,
|
|
4365
4096
|
`linkerKeystreamBlindingFactor[${String(leafIndex)}][${String(keyIndex)}]`
|
|
@@ -4438,7 +4169,7 @@ async function processUtxoInBatch3(args, deps) {
|
|
|
4438
4169
|
}
|
|
4439
4170
|
const nullifierHashesAggregatedHash = await poseidonAggregator(nullifierHashes);
|
|
4440
4171
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(nullifierHashesAggregatedHash, "nullifierHashesAggregatedHash");
|
|
4441
|
-
const rcEncryptor =
|
|
4172
|
+
const rcEncryptor = chunkYFUGKMNS_cjs.getRescueEncryptorFromPrivateKey(clientX25519PrivateKey, {
|
|
4442
4173
|
umbraX25519PublicKey: networkConfig.mxePubkey
|
|
4443
4174
|
});
|
|
4444
4175
|
const randomFactorBytes = sha3Addons_js.kmac256(
|
|
@@ -4501,7 +4232,7 @@ async function processUtxoInBatch3(args, deps) {
|
|
|
4501
4232
|
chunkLTCKPTZC_cjs.assertCurve25519FieldElement(rcEncryptedMvkHigh, "rcEncryptedMvkHigh");
|
|
4502
4233
|
chunkLTCKPTZC_cjs.assertCurve25519FieldElement(rcEncryptedRandomFactorLow, "rcEncryptedRandomFactorLow");
|
|
4503
4234
|
chunkLTCKPTZC_cjs.assertCurve25519FieldElement(rcEncryptedRandomFactorHigh, "rcEncryptedRandomFactorHigh");
|
|
4504
|
-
const rcKeyGenerator =
|
|
4235
|
+
const rcKeyGenerator = chunkYFUGKMNS_cjs.getRescueKeyGeneratorFromPrivateKey(clientX25519PrivateKey, {
|
|
4505
4236
|
umbraX25519PublicKey: networkConfig.mxePubkey
|
|
4506
4237
|
});
|
|
4507
4238
|
const rcCounters = [
|
|
@@ -4549,7 +4280,7 @@ async function processUtxoInBatch3(args, deps) {
|
|
|
4549
4280
|
rescueEncryptionCommitmentBlindingFactorOffsetBytes
|
|
4550
4281
|
);
|
|
4551
4282
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(blindingFactorForRescueCommitment, "blindingFactorForRescueCommitment");
|
|
4552
|
-
const rescueEncryptionCommitmentGenerator =
|
|
4283
|
+
const rescueEncryptionCommitmentGenerator = chunkYFUGKMNS_cjs.getRescueCommitmentGenerator();
|
|
4553
4284
|
const rcEncryptionCommitment = await rescueEncryptionCommitmentGenerator(
|
|
4554
4285
|
[
|
|
4555
4286
|
rcEncryptedMvkLow,
|
|
@@ -4600,7 +4331,7 @@ async function processUtxoInBatch3(args, deps) {
|
|
|
4600
4331
|
const fiatShamirChallenge = fiatShamirChallengeGenerator(fiatShamirInputBytes);
|
|
4601
4332
|
chunkLTCKPTZC_cjs.assertCurve25519FieldElement(fiatShamirChallenge, "fiatShamirChallenge");
|
|
4602
4333
|
const fiatShamirChallengeLimbs = chunkZY3TSHMJ_cjs.convertU256ToBase85Limbs(fiatShamirChallenge);
|
|
4603
|
-
const modulePow =
|
|
4334
|
+
const modulePow = chunkYFUGKMNS_cjs.getModuloPowCurve25519Function();
|
|
4604
4335
|
const challengeSquared = modulePow(fiatShamirChallenge, 2n);
|
|
4605
4336
|
chunkLTCKPTZC_cjs.assertCurve25519FieldElement(challengeSquared, "challengeSquared");
|
|
4606
4337
|
const challengeSquaredLimbs = chunkZY3TSHMJ_cjs.convertU256ToBase85Limbs(challengeSquared);
|
|
@@ -4650,7 +4381,7 @@ async function processUtxoInBatch3(args, deps) {
|
|
|
4650
4381
|
inverseForKeysForRandomFactorHighLimbs,
|
|
4651
4382
|
"inverseForKeysForRandomFactorHighLimbs"
|
|
4652
4383
|
);
|
|
4653
|
-
const polynomialEvaluator =
|
|
4384
|
+
const polynomialEvaluator = chunkYFUGKMNS_cjs.getPolynomialEvaluatorFunction();
|
|
4654
4385
|
const polynomialEvaluationResultScalar = polynomialEvaluator(
|
|
4655
4386
|
[ephemeralMvkLow, ephemeralMvkHigh, randomFactorForPolynomialCommitment],
|
|
4656
4387
|
fiatShamirChallenge
|
|
@@ -4991,21 +4722,21 @@ function getSelfClaimableUtxoToPublicBalanceClaimerFunction(args, deps) {
|
|
|
4991
4722
|
const pollingIntervalMs = deps.pollingIntervalMs ?? 3e3;
|
|
4992
4723
|
const timeoutMs = deps.timeoutMs ?? 12e4;
|
|
4993
4724
|
const onProgress = deps.onProgress;
|
|
4994
|
-
const ephemeralUtxoMvkGenerator = deps.keys?.ephemeralUtxoMasterViewingKeyDeriver ??
|
|
4995
|
-
const ephemeralUtxoMvkBlindingFactorGenerator = deps.keys?.ephemeralUtxoMasterViewingKeyBlindingFactorDeriver ??
|
|
4725
|
+
const ephemeralUtxoMvkGenerator = deps.keys?.ephemeralUtxoMasterViewingKeyDeriver ?? chunkYFUGKMNS_cjs.getEphemeralUtxoMasterViewingKeyDeriver({ client });
|
|
4726
|
+
const ephemeralUtxoMvkBlindingFactorGenerator = deps.keys?.ephemeralUtxoMasterViewingKeyBlindingFactorDeriver ?? chunkYFUGKMNS_cjs.getEphemeralUtxoMasterViewingKeyBlindingFactorDeriver({
|
|
4996
4727
|
client
|
|
4997
4728
|
});
|
|
4998
|
-
const ephemeralUtxoPoseidonKeyGenerator = deps.keys?.ephemeralUtxoPoseidonKeyGenerator ??
|
|
4999
|
-
const ephemeralUtxoPoseidonKeyBlindingFactorGenerator = deps.keys?.ephemeralUtxoPoseidonKeyBlindingFactorGenerator ??
|
|
4729
|
+
const ephemeralUtxoPoseidonKeyGenerator = deps.keys?.ephemeralUtxoPoseidonKeyGenerator ?? chunkYFUGKMNS_cjs.getEphemeralUtxoPoseidonPrivateKeyDeriver({ client });
|
|
4730
|
+
const ephemeralUtxoPoseidonKeyBlindingFactorGenerator = deps.keys?.ephemeralUtxoPoseidonKeyBlindingFactorGenerator ?? chunkYFUGKMNS_cjs.getEphemeralUtxoPoseidonPrivateKeyBlindingFactorDeriver({
|
|
5000
4731
|
client
|
|
5001
4732
|
});
|
|
5002
|
-
const poseidonHasher = deps.crypto?.poseidonHasher ??
|
|
5003
|
-
const poseidonAggregator = deps.crypto?.poseidonAggregator ??
|
|
5004
|
-
const poseidonEncryptor = deps.crypto?.poseidonEncryptor ??
|
|
5005
|
-
const poseidonKeystreamGeneratorFunction = deps.crypto?.poseidonKeystreamGenerator ??
|
|
5006
|
-
const userCommitmentGeneratorFunction = deps.crypto?.userCommitmentGenerator ??
|
|
5007
|
-
const keystreamCommitmentGeneratorFunction = deps.crypto?.keystreamCommitmentGenerator ??
|
|
5008
|
-
const fiatShamirChallengeGeneratorFunction = deps.crypto?.fiatShamirChallengeGenerator ??
|
|
4733
|
+
const poseidonHasher = deps.crypto?.poseidonHasher ?? chunkYFUGKMNS_cjs.getPoseidonHasher();
|
|
4734
|
+
const poseidonAggregator = deps.crypto?.poseidonAggregator ?? chunkYFUGKMNS_cjs.getPoseidonAggregator();
|
|
4735
|
+
const poseidonEncryptor = deps.crypto?.poseidonEncryptor ?? chunkYFUGKMNS_cjs.getPoseidonEncryptor();
|
|
4736
|
+
const poseidonKeystreamGeneratorFunction = deps.crypto?.poseidonKeystreamGenerator ?? chunkYFUGKMNS_cjs.getPoseidonKeystreamGenerator();
|
|
4737
|
+
const userCommitmentGeneratorFunction = deps.crypto?.userCommitmentGenerator ?? chunkYFUGKMNS_cjs.getUserCommitmentGeneratorFunction();
|
|
4738
|
+
const keystreamCommitmentGeneratorFunction = deps.crypto?.keystreamCommitmentGenerator ?? chunkYFUGKMNS_cjs.getKeystreamCommitmentGenerator();
|
|
4739
|
+
const fiatShamirChallengeGeneratorFunction = deps.crypto?.fiatShamirChallengeGenerator ?? chunkYFUGKMNS_cjs.getFiatShamirChallengeGeneratorFunction();
|
|
5009
4740
|
const generateRandomU2562 = deps.random?.generateRandomU256 ?? chunkZY3TSHMJ_cjs.generateRandomU256;
|
|
5010
4741
|
const generateRandomU1282 = deps.random?.generateRandomU128 ?? chunkZY3TSHMJ_cjs.generateRandomU128;
|
|
5011
4742
|
const protocolFeeProviderFn = deps.fees?.protocolFeeProvider ?? getHardcodedClaimUtxoProtocolFeeProvider();
|
|
@@ -5017,7 +4748,7 @@ function getSelfClaimableUtxoToPublicBalanceClaimerFunction(args, deps) {
|
|
|
5017
4748
|
}
|
|
5018
4749
|
const masterSeedBytes = await client.masterSeed.getMasterSeed();
|
|
5019
4750
|
const generationIndex = providedGenerationIndex ?? generateRandomU2562();
|
|
5020
|
-
const mvkX25519KeypairDeriver = deps.keys?.mvkX25519KeypairDeriver ??
|
|
4751
|
+
const mvkX25519KeypairDeriver = deps.keys?.mvkX25519KeypairDeriver ?? chunkYFUGKMNS_cjs.getUserAccountX25519KeypairDeriver({ client });
|
|
5021
4752
|
const keypairResult = await mvkX25519KeypairDeriver();
|
|
5022
4753
|
const clientX25519PrivateKey = keypairResult.x25519Keypair.privateKey;
|
|
5023
4754
|
const clientX25519PublicKey = keypairResult.x25519Keypair.publicKey;
|
|
@@ -5100,16 +4831,16 @@ function getSelfClaimableUtxoToPublicBalanceClaimerFunction(args, deps) {
|
|
|
5100
4831
|
batches: resultsByBatch
|
|
5101
4832
|
};
|
|
5102
4833
|
} catch (error) {
|
|
5103
|
-
if (error instanceof
|
|
4834
|
+
if (error instanceof chunkKCHHJKQN_cjs.ClaimUtxoError) {
|
|
5104
4835
|
throw error;
|
|
5105
4836
|
}
|
|
5106
4837
|
if (error instanceof chunkFSK2ICMB_cjs.CryptographyError) {
|
|
5107
|
-
throw new
|
|
4838
|
+
throw new chunkKCHHJKQN_cjs.ClaimUtxoError("zk-proof-generation", error.message, error);
|
|
5108
4839
|
}
|
|
5109
|
-
if (error instanceof
|
|
5110
|
-
throw new
|
|
4840
|
+
if (error instanceof chunkKCHHJKQN_cjs.RpcError) {
|
|
4841
|
+
throw new chunkKCHHJKQN_cjs.ClaimUtxoError("initialization", error.message, error);
|
|
5111
4842
|
}
|
|
5112
|
-
throw new
|
|
4843
|
+
throw new chunkKCHHJKQN_cjs.ClaimUtxoError(
|
|
5113
4844
|
"transaction-send",
|
|
5114
4845
|
error instanceof Error ? error.message : String(error),
|
|
5115
4846
|
error instanceof Error ? error : void 0
|
|
@@ -5124,7 +4855,7 @@ function getComplianceGrantIssuerFunction(args, deps) {
|
|
|
5124
4855
|
const { signer } = client;
|
|
5125
4856
|
const getLatestBlockhash = deps?.rpc?.blockhashProvider ?? client.blockhashProvider;
|
|
5126
4857
|
const transactionForwarder = deps?.rpc?.transactionForwarder ?? client.transactionForwarder;
|
|
5127
|
-
const masterViewingKeyX25519KeypairDeriver = deps?.keys?.masterViewingKeyX25519KeypairDeriver ??
|
|
4858
|
+
const masterViewingKeyX25519KeypairDeriver = deps?.keys?.masterViewingKeyX25519KeypairDeriver ?? chunkYFUGKMNS_cjs.getMasterViewingKeyX25519KeypairDeriver({ client });
|
|
5128
4859
|
return /* @__PURE__ */ chunkPK6SKIKE_cjs.__name(async function createUserGrantedComplianceGrant(receiver, granterX25519, receiverX25519, nonce, optionalData, callbacks) {
|
|
5129
4860
|
const userAddress = signer.address;
|
|
5130
4861
|
const programId = client.networkConfig.programId;
|
|
@@ -5168,7 +4899,7 @@ function getComplianceGrantRevokerFunction(args, deps) {
|
|
|
5168
4899
|
const { signer } = client;
|
|
5169
4900
|
const getLatestBlockhash = deps?.rpc?.blockhashProvider ?? client.blockhashProvider;
|
|
5170
4901
|
const transactionForwarder = deps?.rpc?.transactionForwarder ?? client.transactionForwarder;
|
|
5171
|
-
const masterViewingKeyX25519KeypairDeriver = deps?.keys?.masterViewingKeyX25519KeypairDeriver ??
|
|
4902
|
+
const masterViewingKeyX25519KeypairDeriver = deps?.keys?.masterViewingKeyX25519KeypairDeriver ?? chunkYFUGKMNS_cjs.getMasterViewingKeyX25519KeypairDeriver({ client });
|
|
5172
4903
|
return /* @__PURE__ */ chunkPK6SKIKE_cjs.__name(async function deleteUserGrantedComplianceGrant(receiver, granterX25519, receiverX25519, nonce, optionalData, callbacks) {
|
|
5173
4904
|
const userAddress = signer.address;
|
|
5174
4905
|
const programId = client.networkConfig.programId;
|
|
@@ -5667,19 +5398,19 @@ function getNetworkEncryptionToSharedEncryptionConverterFunction(args, deps) {
|
|
|
5667
5398
|
}
|
|
5668
5399
|
return { converted, skipped };
|
|
5669
5400
|
} catch (error) {
|
|
5670
|
-
if (error instanceof
|
|
5401
|
+
if (error instanceof chunkKCHHJKQN_cjs.ConversionError) {
|
|
5671
5402
|
throw error;
|
|
5672
5403
|
}
|
|
5673
|
-
if (error instanceof
|
|
5674
|
-
throw new
|
|
5404
|
+
if (error instanceof chunkKCHHJKQN_cjs.TransactionSigningError) {
|
|
5405
|
+
throw new chunkKCHHJKQN_cjs.ConversionError("transaction-sign", error.message, error);
|
|
5675
5406
|
}
|
|
5676
|
-
if (error instanceof
|
|
5677
|
-
throw new
|
|
5407
|
+
if (error instanceof chunkKCHHJKQN_cjs.TransactionError) {
|
|
5408
|
+
throw new chunkKCHHJKQN_cjs.ConversionError("transaction-send", error.message, error);
|
|
5678
5409
|
}
|
|
5679
|
-
if (error instanceof
|
|
5680
|
-
throw new
|
|
5410
|
+
if (error instanceof chunkKCHHJKQN_cjs.RpcError) {
|
|
5411
|
+
throw new chunkKCHHJKQN_cjs.ConversionError("account-fetch", error.message, error);
|
|
5681
5412
|
}
|
|
5682
|
-
throw new
|
|
5413
|
+
throw new chunkKCHHJKQN_cjs.ConversionError(
|
|
5683
5414
|
"transaction-send",
|
|
5684
5415
|
error instanceof Error ? error.message : String(error),
|
|
5685
5416
|
error instanceof Error ? error : void 0
|
|
@@ -5704,7 +5435,7 @@ function getMintEncryptionKeyRotatorFunction(args, deps) {
|
|
|
5704
5435
|
const accountInfoProvider = deps?.rpc?.accountInfoProvider ?? client.accountInfoProvider;
|
|
5705
5436
|
const getLatestBlockhash = deps?.rpc?.blockhashProvider ?? client.blockhashProvider;
|
|
5706
5437
|
const transactionForwarder = deps?.rpc?.transactionForwarder ?? client.transactionForwarder;
|
|
5707
|
-
const mintX25519KeypairDeriver = deps?.keys?.mintX25519KeypairDeriver ??
|
|
5438
|
+
const mintX25519KeypairDeriver = deps?.keys?.mintX25519KeypairDeriver ?? chunkYFUGKMNS_cjs.getMintX25519KeypairDeriver({ client });
|
|
5708
5439
|
return /* @__PURE__ */ chunkPK6SKIKE_cjs.__name(async function rotateMintX25519EncryptionKey(mint, optionalData, callbacks, microLamportsPerAcu, options) {
|
|
5709
5440
|
const accountInfoCommitment = options?.accountInfoCommitment ?? "confirmed";
|
|
5710
5441
|
const userAddress = signer.address;
|
|
@@ -5843,71 +5574,85 @@ async function signTransactionMessage(signer, transactionMessage) {
|
|
|
5843
5574
|
chunkPK6SKIKE_cjs.__name(signTransactionMessage, "signTransactionMessage");
|
|
5844
5575
|
async function forwardAndMonitor(config, signedTransaction, callbacks, awaitCallback) {
|
|
5845
5576
|
const { transactionForwarder, computationMonitor } = config;
|
|
5846
|
-
|
|
5847
|
-
|
|
5848
|
-
|
|
5849
|
-
|
|
5850
|
-
|
|
5851
|
-
|
|
5852
|
-
|
|
5853
|
-
|
|
5854
|
-
|
|
5855
|
-
|
|
5856
|
-
|
|
5857
|
-
|
|
5858
|
-
|
|
5859
|
-
|
|
5577
|
+
const txSignature = kit.getSignatureFromTransaction(
|
|
5578
|
+
signedTransaction
|
|
5579
|
+
);
|
|
5580
|
+
let prepared;
|
|
5581
|
+
if (awaitCallback !== void 0) {
|
|
5582
|
+
if (computationMonitor === void 0) {
|
|
5583
|
+
throw new Error(
|
|
5584
|
+
"awaitCallback was provided but no computationMonitor is configured on the client. Pass a computationMonitor when creating the Umbra client, or omit awaitCallback to use fire-and-forget mode."
|
|
5585
|
+
);
|
|
5586
|
+
}
|
|
5587
|
+
const baseMonitorOptions = {
|
|
5588
|
+
maxSlotWindow: awaitCallback.maxSlotWindow,
|
|
5589
|
+
safetyTimeoutMs: awaitCallback.safetyTimeoutMs,
|
|
5590
|
+
onProgress: awaitCallback.onProgress,
|
|
5591
|
+
commitment: awaitCallback.computationMonitorCommitment ?? "confirmed",
|
|
5592
|
+
retrieveCallbackSignature: awaitCallback.retrieveCallbackSignature ?? false
|
|
5593
|
+
};
|
|
5594
|
+
prepared = await computationMonitor.prepareMonitor(
|
|
5595
|
+
awaitCallback.computationAccountAddress,
|
|
5596
|
+
baseMonitorOptions
|
|
5860
5597
|
);
|
|
5861
5598
|
}
|
|
5862
|
-
|
|
5863
|
-
|
|
5864
|
-
|
|
5865
|
-
|
|
5866
|
-
|
|
5867
|
-
|
|
5868
|
-
|
|
5869
|
-
|
|
5870
|
-
|
|
5871
|
-
|
|
5872
|
-
|
|
5873
|
-
|
|
5874
|
-
|
|
5875
|
-
|
|
5876
|
-
|
|
5877
|
-
|
|
5878
|
-
|
|
5879
|
-
|
|
5880
|
-
|
|
5881
|
-
|
|
5882
|
-
|
|
5883
|
-
|
|
5884
|
-
|
|
5885
|
-
|
|
5886
|
-
|
|
5887
|
-
|
|
5888
|
-
|
|
5889
|
-
|
|
5890
|
-
|
|
5891
|
-
|
|
5892
|
-
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
|
|
5896
|
-
)
|
|
5897
|
-
|
|
5898
|
-
|
|
5899
|
-
} catch (error) {
|
|
5900
|
-
rentClaimError = error instanceof Error ? error.message : String(error);
|
|
5599
|
+
try {
|
|
5600
|
+
if (callbacks?.pre !== void 0) {
|
|
5601
|
+
await callbacks.pre(signedTransaction);
|
|
5602
|
+
}
|
|
5603
|
+
await transactionForwarder.forwardSequentially([signedTransaction]);
|
|
5604
|
+
if (callbacks?.post !== void 0) {
|
|
5605
|
+
await callbacks.post(signedTransaction, txSignature);
|
|
5606
|
+
}
|
|
5607
|
+
if (prepared === void 0 || awaitCallback === void 0) {
|
|
5608
|
+
return { signature: txSignature, signedTransaction };
|
|
5609
|
+
}
|
|
5610
|
+
const callbackResult = await prepared.awaitComputation();
|
|
5611
|
+
let rentClaimSignature;
|
|
5612
|
+
let rentClaimError;
|
|
5613
|
+
if (awaitCallback.reclaimComputationRent !== false) {
|
|
5614
|
+
if (awaitCallback.computationOffset === void 0 || awaitCallback.clusterOffset === void 0) {
|
|
5615
|
+
rentClaimError = "Rent reclaim skipped: computationOffset or clusterOffset was not provided by the service";
|
|
5616
|
+
} else {
|
|
5617
|
+
try {
|
|
5618
|
+
const noopSigner = kit.createNoopSigner(config.signer.address);
|
|
5619
|
+
const rentClaimIx = arciumCodama.getClaimComputationRentInstruction({
|
|
5620
|
+
signer: noopSigner,
|
|
5621
|
+
comp: awaitCallback.computationAccountAddress,
|
|
5622
|
+
compOffset: awaitCallback.computationOffset,
|
|
5623
|
+
clusterOffset: awaitCallback.clusterOffset
|
|
5624
|
+
});
|
|
5625
|
+
const rentClaimBlockhash = await config.getLatestBlockhash({
|
|
5626
|
+
commitment: awaitCallback.rentReclaimBlockhashCommitment ?? "confirmed"
|
|
5627
|
+
});
|
|
5628
|
+
const rentClaimTxMsg = buildTransactionMessage(config.signer, rentClaimBlockhash, [
|
|
5629
|
+
rentClaimIx
|
|
5630
|
+
]);
|
|
5631
|
+
const rentClaimTx = await signTransactionMessage(config.signer, rentClaimTxMsg);
|
|
5632
|
+
rentClaimSignature = await config.transactionForwarder.fireAndForget(rentClaimTx);
|
|
5633
|
+
} catch (error) {
|
|
5634
|
+
rentClaimError = error instanceof Error ? error.message : String(error);
|
|
5635
|
+
}
|
|
5901
5636
|
}
|
|
5902
5637
|
}
|
|
5638
|
+
return {
|
|
5639
|
+
signature: txSignature,
|
|
5640
|
+
signedTransaction,
|
|
5641
|
+
callbackResult,
|
|
5642
|
+
rentClaimSignature,
|
|
5643
|
+
rentClaimError
|
|
5644
|
+
};
|
|
5645
|
+
} finally {
|
|
5646
|
+
prepared?.cleanup();
|
|
5903
5647
|
}
|
|
5904
|
-
return { signature: txSignature, signedTransaction, callbackResult, rentClaimSignature, rentClaimError };
|
|
5905
5648
|
}
|
|
5906
5649
|
chunkPK6SKIKE_cjs.__name(forwardAndMonitor, "forwardAndMonitor");
|
|
5907
5650
|
async function executeComputationTransaction(config, options, awaitCallback) {
|
|
5908
5651
|
const { signer, getLatestBlockhash } = config;
|
|
5909
5652
|
const { instruction, preInstructions, altEntry, callbacks, blockhashCommitment } = options;
|
|
5910
|
-
const latestBlockhash = await getLatestBlockhash({
|
|
5653
|
+
const latestBlockhash = await getLatestBlockhash({
|
|
5654
|
+
commitment: blockhashCommitment ?? "confirmed"
|
|
5655
|
+
});
|
|
5911
5656
|
const allInstructions = preInstructions === void 0 ? [instruction] : [...preInstructions, instruction];
|
|
5912
5657
|
const transactionMessage = buildTransactionMessage(
|
|
5913
5658
|
signer,
|
|
@@ -5964,6 +5709,7 @@ function getPublicBalanceToEncryptedBalanceDirectDepositorFunction(args, deps) {
|
|
|
5964
5709
|
if ("callbackResult" in result) {
|
|
5965
5710
|
return {
|
|
5966
5711
|
queueSignature: result.signature,
|
|
5712
|
+
callbackStatus: result.callbackResult.status,
|
|
5967
5713
|
callbackSignature: "callbackSignature" in result.callbackResult ? result.callbackResult.callbackSignature : void 0,
|
|
5968
5714
|
callbackElapsedMs: result.callbackResult.elapsedMs,
|
|
5969
5715
|
rentClaimSignature: result.rentClaimSignature,
|
|
@@ -5972,10 +5718,10 @@ function getPublicBalanceToEncryptedBalanceDirectDepositorFunction(args, deps) {
|
|
|
5972
5718
|
}
|
|
5973
5719
|
return { queueSignature: result.signature };
|
|
5974
5720
|
} catch (error) {
|
|
5975
|
-
if (error instanceof
|
|
5721
|
+
if (error instanceof chunkKCHHJKQN_cjs.EncryptedDepositError) {
|
|
5976
5722
|
throw error;
|
|
5977
5723
|
}
|
|
5978
|
-
throw new
|
|
5724
|
+
throw new chunkKCHHJKQN_cjs.EncryptedDepositError(
|
|
5979
5725
|
"transaction-send",
|
|
5980
5726
|
`Transaction execution failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
5981
5727
|
error instanceof Error ? error : void 0
|
|
@@ -5990,27 +5736,27 @@ function getPublicBalanceToEncryptedBalanceDirectDepositorFunction(args, deps) {
|
|
|
5990
5736
|
const optionalData = options?.optionalData ?? new Uint8Array(32);
|
|
5991
5737
|
try {
|
|
5992
5738
|
if (destinationAddress.trim().length === 0) {
|
|
5993
|
-
throw new
|
|
5739
|
+
throw new chunkKCHHJKQN_cjs.EncryptedDepositError(
|
|
5994
5740
|
"validation",
|
|
5995
5741
|
"Invalid destinationAddress: must be a non-empty string"
|
|
5996
5742
|
);
|
|
5997
5743
|
}
|
|
5998
5744
|
if (mint.trim().length === 0) {
|
|
5999
|
-
throw new
|
|
5745
|
+
throw new chunkKCHHJKQN_cjs.EncryptedDepositError("validation", "Invalid mint: must be a non-empty string");
|
|
6000
5746
|
}
|
|
6001
5747
|
chunkLTCKPTZC_cjs.assertU64(transferAmount);
|
|
6002
5748
|
if (transferAmount <= 0n) {
|
|
6003
|
-
throw new
|
|
5749
|
+
throw new chunkKCHHJKQN_cjs.EncryptedDepositError(
|
|
6004
5750
|
"validation",
|
|
6005
5751
|
"Invalid transferAmount: must be greater than zero"
|
|
6006
5752
|
);
|
|
6007
5753
|
}
|
|
6008
5754
|
chunkLTCKPTZC_cjs.assertOptionalData32(optionalData, "optionalData");
|
|
6009
5755
|
} catch (error) {
|
|
6010
|
-
if (error instanceof
|
|
5756
|
+
if (error instanceof chunkKCHHJKQN_cjs.EncryptedDepositError) {
|
|
6011
5757
|
throw error;
|
|
6012
5758
|
}
|
|
6013
|
-
throw new
|
|
5759
|
+
throw new chunkKCHHJKQN_cjs.EncryptedDepositError(
|
|
6014
5760
|
"validation",
|
|
6015
5761
|
error instanceof Error ? error.message : String(error),
|
|
6016
5762
|
error instanceof Error ? error : void 0
|
|
@@ -6022,7 +5768,7 @@ function getPublicBalanceToEncryptedBalanceDirectDepositorFunction(args, deps) {
|
|
|
6022
5768
|
const mintAccountMap = await accountInfoProvider([mint], { commitment: accountInfoCommitment });
|
|
6023
5769
|
const mintAccount = mintAccountMap.get(mint);
|
|
6024
5770
|
if (mintAccount?.exists !== true) {
|
|
6025
|
-
throw new
|
|
5771
|
+
throw new chunkKCHHJKQN_cjs.EncryptedDepositError("mint-fetch", `Mint account not found: ${mint}`);
|
|
6026
5772
|
}
|
|
6027
5773
|
mintOwner = mintAccount.programAddress;
|
|
6028
5774
|
if (mintOwner === chunk43JEHY7D_cjs.TOKEN_2022_PROGRAM_ID) {
|
|
@@ -6035,7 +5781,7 @@ function getPublicBalanceToEncryptedBalanceDirectDepositorFunction(args, deps) {
|
|
|
6035
5781
|
const transferFee = chunkZY3TSHMJ_cjs.calculateTransferFee(feeConfig, epochInfo.epoch, transferAmount);
|
|
6036
5782
|
const calculatedDepositAmount = transferAmount - transferFee;
|
|
6037
5783
|
if (calculatedDepositAmount <= 0n) {
|
|
6038
|
-
throw new
|
|
5784
|
+
throw new chunkKCHHJKQN_cjs.EncryptedDepositError(
|
|
6039
5785
|
"fee-calculation",
|
|
6040
5786
|
`Transfer fee (${String(transferFee)}) exceeds or equals transfer amount (${String(transferAmount)}). Deposit amount must be greater than zero.`
|
|
6041
5787
|
);
|
|
@@ -6046,16 +5792,16 @@ function getPublicBalanceToEncryptedBalanceDirectDepositorFunction(args, deps) {
|
|
|
6046
5792
|
} else if (mintOwner === chunk43JEHY7D_cjs.SPL_TOKEN_PROGRAM_ID) {
|
|
6047
5793
|
depositAmount = transferAmount;
|
|
6048
5794
|
} else {
|
|
6049
|
-
throw new
|
|
5795
|
+
throw new chunkKCHHJKQN_cjs.EncryptedDepositError(
|
|
6050
5796
|
"mint-fetch",
|
|
6051
5797
|
`Unknown token program: ${mintOwner}. Expected SPL Token (${chunk43JEHY7D_cjs.SPL_TOKEN_PROGRAM_ID}) or Token-2022 (${chunk43JEHY7D_cjs.TOKEN_2022_PROGRAM_ID})`
|
|
6052
5798
|
);
|
|
6053
5799
|
}
|
|
6054
5800
|
} catch (error) {
|
|
6055
|
-
if (error instanceof
|
|
5801
|
+
if (error instanceof chunkKCHHJKQN_cjs.EncryptedDepositError) {
|
|
6056
5802
|
throw error;
|
|
6057
5803
|
}
|
|
6058
|
-
throw new
|
|
5804
|
+
throw new chunkKCHHJKQN_cjs.EncryptedDepositError(
|
|
6059
5805
|
"mint-fetch",
|
|
6060
5806
|
`Failed to fetch mint account: ${error instanceof Error ? error.message : String(error)}`,
|
|
6061
5807
|
error instanceof Error ? error : void 0
|
|
@@ -6069,7 +5815,7 @@ function getPublicBalanceToEncryptedBalanceDirectDepositorFunction(args, deps) {
|
|
|
6069
5815
|
chunkUEI7SYH6_cjs.findEncryptedUserAccountPda(destinationAddress, client.networkConfig.programId)
|
|
6070
5816
|
]);
|
|
6071
5817
|
} catch (error) {
|
|
6072
|
-
throw new
|
|
5818
|
+
throw new chunkKCHHJKQN_cjs.EncryptedDepositError(
|
|
6073
5819
|
"pda-derivation",
|
|
6074
5820
|
`Failed to derive PDA addresses: ${error instanceof Error ? error.message : String(error)}`,
|
|
6075
5821
|
error instanceof Error ? error : void 0
|
|
@@ -6087,13 +5833,13 @@ function getPublicBalanceToEncryptedBalanceDirectDepositorFunction(args, deps) {
|
|
|
6087
5833
|
const encodedUserAccount = accountMap.get(encryptedUserAccountPda);
|
|
6088
5834
|
const encodedTokenAccount = accountMap.get(encryptedTokenAccountPda);
|
|
6089
5835
|
if (encodedUserAccount === void 0) {
|
|
6090
|
-
throw new
|
|
5836
|
+
throw new chunkKCHHJKQN_cjs.EncryptedDepositError(
|
|
6091
5837
|
"account-fetch",
|
|
6092
5838
|
`Failed to fetch account info for user PDA: ${encryptedUserAccountPda}`
|
|
6093
5839
|
);
|
|
6094
5840
|
}
|
|
6095
5841
|
if (encodedTokenAccount === void 0) {
|
|
6096
|
-
throw new
|
|
5842
|
+
throw new chunkKCHHJKQN_cjs.EncryptedDepositError(
|
|
6097
5843
|
"account-fetch",
|
|
6098
5844
|
`Failed to fetch account info for token PDA: ${encryptedTokenAccountPda}`
|
|
6099
5845
|
);
|
|
@@ -6104,10 +5850,10 @@ function getPublicBalanceToEncryptedBalanceDirectDepositorFunction(args, deps) {
|
|
|
6104
5850
|
accountMap.get(client.networkConfig.mxeAccountAddress)
|
|
6105
5851
|
);
|
|
6106
5852
|
} catch (error) {
|
|
6107
|
-
if (error instanceof
|
|
5853
|
+
if (error instanceof chunkKCHHJKQN_cjs.EncryptedDepositError) {
|
|
6108
5854
|
throw error;
|
|
6109
5855
|
}
|
|
6110
|
-
throw new
|
|
5856
|
+
throw new chunkKCHHJKQN_cjs.EncryptedDepositError(
|
|
6111
5857
|
"account-fetch",
|
|
6112
5858
|
`Failed to fetch accounts: ${error instanceof Error ? error.message : String(error)}`,
|
|
6113
5859
|
error instanceof Error ? error : void 0
|
|
@@ -6183,7 +5929,7 @@ function getPublicBalanceToEncryptedBalanceDirectDepositorFunction(args, deps) {
|
|
|
6183
5929
|
}
|
|
6184
5930
|
} else {
|
|
6185
5931
|
if (tokenExists && isBalanceInitialised && isSharedMode) {
|
|
6186
|
-
throw new
|
|
5932
|
+
throw new chunkKCHHJKQN_cjs.EncryptedDepositError(
|
|
6187
5933
|
"validation",
|
|
6188
5934
|
"Invalid state: Token account is in Shared mode but user has no X25519 key registered"
|
|
6189
5935
|
);
|
|
@@ -6291,17 +6037,17 @@ function getPublicBalanceToEncryptedBalanceDirectDepositorFunction(args, deps) {
|
|
|
6291
6037
|
break;
|
|
6292
6038
|
}
|
|
6293
6039
|
default: {
|
|
6294
|
-
throw new
|
|
6040
|
+
throw new chunkKCHHJKQN_cjs.EncryptedDepositError(
|
|
6295
6041
|
"instruction-build",
|
|
6296
6042
|
`Unknown instruction variant: ${String(instructionVariant)}`
|
|
6297
6043
|
);
|
|
6298
6044
|
}
|
|
6299
6045
|
}
|
|
6300
6046
|
} catch (error) {
|
|
6301
|
-
if (error instanceof
|
|
6047
|
+
if (error instanceof chunkKCHHJKQN_cjs.EncryptedDepositError) {
|
|
6302
6048
|
throw error;
|
|
6303
6049
|
}
|
|
6304
|
-
throw new
|
|
6050
|
+
throw new chunkKCHHJKQN_cjs.EncryptedDepositError(
|
|
6305
6051
|
"instruction-build",
|
|
6306
6052
|
`Failed to build instruction: ${error instanceof Error ? error.message : String(error)}`,
|
|
6307
6053
|
error instanceof Error ? error : void 0
|
|
@@ -6373,32 +6119,32 @@ function getEncryptedBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
6373
6119
|
const factoryCloseProofAccountCallbacks = deps.hooks?.closeProofAccount;
|
|
6374
6120
|
const factoryCreateProofAccountCallbacks = deps.hooks?.createProofAccount;
|
|
6375
6121
|
const factoryCreateUtxoCallbacks = deps.hooks?.createUtxo;
|
|
6376
|
-
const masterViewingKeyGenerator = deps.keys?.masterViewingKeyGenerator ??
|
|
6377
|
-
const masterViewingKeyBlindingFactorGenerator = deps.keys?.masterViewingKeyBlindingFactorGenerator ??
|
|
6378
|
-
const poseidonPrivateKeyGenerator = deps.keys?.poseidonPrivateKeyGenerator ??
|
|
6379
|
-
const poseidonBlindingFactorGenerator = deps.keys?.poseidonBlindingFactorGenerator ??
|
|
6380
|
-
const mvkX25519KeypairDeriver = deps.keys?.mvkX25519KeypairDeriver ??
|
|
6381
|
-
const secondViewingKeyGenerator = deps.keys?.secondViewingKeyGenerator ??
|
|
6382
|
-
const ephemeralUtxoMvkGenerator = deps.keys?.ephemeralUtxoMasterViewingKeyDeriver ??
|
|
6383
|
-
const ephemeralUtxoMvkBlindingFactorGenerator = deps.keys?.ephemeralUtxoMasterViewingKeyBlindingFactorDeriver ??
|
|
6122
|
+
const masterViewingKeyGenerator = deps.keys?.masterViewingKeyGenerator ?? chunkYFUGKMNS_cjs.getMasterViewingKeyDeriver({ client });
|
|
6123
|
+
const masterViewingKeyBlindingFactorGenerator = deps.keys?.masterViewingKeyBlindingFactorGenerator ?? chunkYFUGKMNS_cjs.getMasterViewingKeyBlindingFactorDeriver({ client });
|
|
6124
|
+
const poseidonPrivateKeyGenerator = deps.keys?.poseidonPrivateKeyGenerator ?? chunkYFUGKMNS_cjs.getPoseidonPrivateKeyDeriver({ client });
|
|
6125
|
+
const poseidonBlindingFactorGenerator = deps.keys?.poseidonBlindingFactorGenerator ?? chunkYFUGKMNS_cjs.getPoseidonBlindingFactorDeriver({ client });
|
|
6126
|
+
const mvkX25519KeypairDeriver = deps.keys?.mvkX25519KeypairDeriver ?? chunkYFUGKMNS_cjs.getUserAccountX25519KeypairDeriver({ client });
|
|
6127
|
+
const secondViewingKeyGenerator = deps.keys?.secondViewingKeyGenerator ?? chunkYFUGKMNS_cjs.getSecondViewingKeyDeriver({ client });
|
|
6128
|
+
const ephemeralUtxoMvkGenerator = deps.keys?.ephemeralUtxoMasterViewingKeyDeriver ?? chunkYFUGKMNS_cjs.getEphemeralUtxoMasterViewingKeyDeriver({ client });
|
|
6129
|
+
const ephemeralUtxoMvkBlindingFactorGenerator = deps.keys?.ephemeralUtxoMasterViewingKeyBlindingFactorDeriver ?? chunkYFUGKMNS_cjs.getEphemeralUtxoMasterViewingKeyBlindingFactorDeriver({
|
|
6384
6130
|
client
|
|
6385
6131
|
});
|
|
6386
|
-
const ephemeralUtxoPoseidonKeyGenerator = deps.keys?.ephemeralUtxoPoseidonKeyGenerator ??
|
|
6387
|
-
const ephemeralUtxoPoseidonKeyBlindingFactorGenerator = deps.keys?.ephemeralUtxoPoseidonKeyBlindingFactorGenerator ??
|
|
6132
|
+
const ephemeralUtxoPoseidonKeyGenerator = deps.keys?.ephemeralUtxoPoseidonKeyGenerator ?? chunkYFUGKMNS_cjs.getEphemeralUtxoPoseidonPrivateKeyDeriver({ client });
|
|
6133
|
+
const ephemeralUtxoPoseidonKeyBlindingFactorGenerator = deps.keys?.ephemeralUtxoPoseidonKeyBlindingFactorGenerator ?? chunkYFUGKMNS_cjs.getEphemeralUtxoPoseidonPrivateKeyBlindingFactorDeriver({
|
|
6388
6134
|
client
|
|
6389
6135
|
});
|
|
6390
|
-
const poseidonKeystreamBlindingFactorGenerator = deps.keys?.poseidonKeystreamBlindingFactorGenerator ??
|
|
6391
|
-
const poseidonEncryptor = deps.crypto?.poseidonEncryptor ??
|
|
6392
|
-
const poseidonKeystreamGenerator = deps.crypto?.poseidonKeystreamGenerator ??
|
|
6393
|
-
const h2Generator = deps.crypto?.h2Generator ??
|
|
6394
|
-
const keystreamCommitmentGenerator = deps.crypto?.keystreamCommitmentGenerator ??
|
|
6395
|
-
const userCommitmentGenerator =
|
|
6396
|
-
const rescueEncryptionCommitmentGenerator =
|
|
6397
|
-
const poseidonAggregator =
|
|
6398
|
-
const fiatShamirChallengeGenerator =
|
|
6399
|
-
const challengePowersFunction =
|
|
6400
|
-
const polynomialEvaluator =
|
|
6401
|
-
const aesEncryptor = deps.crypto?.aesEncryptor ??
|
|
6136
|
+
const poseidonKeystreamBlindingFactorGenerator = deps.keys?.poseidonKeystreamBlindingFactorGenerator ?? chunkYFUGKMNS_cjs.getPoseidonKeystreamBlindingFactorDeriver({ client });
|
|
6137
|
+
const poseidonEncryptor = deps.crypto?.poseidonEncryptor ?? chunkYFUGKMNS_cjs.getPoseidonEncryptor();
|
|
6138
|
+
const poseidonKeystreamGenerator = deps.crypto?.poseidonKeystreamGenerator ?? chunkYFUGKMNS_cjs.getPoseidonKeystreamGenerator();
|
|
6139
|
+
const h2Generator = deps.crypto?.h2Generator ?? chunkYFUGKMNS_cjs.getUtxoCommitmentHashGenerator();
|
|
6140
|
+
const keystreamCommitmentGenerator = deps.crypto?.keystreamCommitmentGenerator ?? chunkYFUGKMNS_cjs.getKeystreamCommitmentGenerator();
|
|
6141
|
+
const userCommitmentGenerator = chunkYFUGKMNS_cjs.getUserCommitmentGeneratorFunction();
|
|
6142
|
+
const rescueEncryptionCommitmentGenerator = chunkYFUGKMNS_cjs.getRescueCommitmentGenerator();
|
|
6143
|
+
const poseidonAggregator = chunkYFUGKMNS_cjs.getPoseidonAggregator();
|
|
6144
|
+
const fiatShamirChallengeGenerator = chunkYFUGKMNS_cjs.getFiatShamirChallengeGeneratorFunction();
|
|
6145
|
+
const challengePowersFunction = chunkYFUGKMNS_cjs.getChallengePowersFunction();
|
|
6146
|
+
const polynomialEvaluator = chunkYFUGKMNS_cjs.getPolynomialEvaluatorFunction();
|
|
6147
|
+
const aesEncryptor = deps.crypto?.aesEncryptor ?? chunkYFUGKMNS_cjs.getAesEncryptor();
|
|
6402
6148
|
const generateRandomU256Function = deps.random?.generateRandomU256 ?? chunkZY3TSHMJ_cjs.generateRandomU256;
|
|
6403
6149
|
const generateComputationOffsetFunction = deps.random?.generateComputationOffset ?? chunkZY3TSHMJ_cjs.generateComputationOffset;
|
|
6404
6150
|
return /* @__PURE__ */ chunkPK6SKIKE_cjs.__name(async function createSelfClaimableUtxo(args2, options) {
|
|
@@ -6426,12 +6172,12 @@ function getEncryptedBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
6426
6172
|
masterSeed,
|
|
6427
6173
|
{ dkLen: 16, personalization: generationIndexBytes }
|
|
6428
6174
|
);
|
|
6429
|
-
const expandedModifiedGenerationIndex =
|
|
6175
|
+
const expandedModifiedGenerationIndex = chunkYFUGKMNS_cjs.expandModifiedGenerationIndex(modifiedGenerationIndex);
|
|
6430
6176
|
let expandedModifiedGenerationIndexU256 = 0n;
|
|
6431
6177
|
for (let index = 0; index < 32; index++) {
|
|
6432
6178
|
expandedModifiedGenerationIndexU256 |= BigInt(expandedModifiedGenerationIndex[index]) << BigInt(index * 8);
|
|
6433
6179
|
}
|
|
6434
|
-
const proofAccountOffsetBytes =
|
|
6180
|
+
const proofAccountOffsetBytes = chunkYFUGKMNS_cjs.deriveProofAccountOffsetFromModifiedGenerationIndex(modifiedGenerationIndex);
|
|
6435
6181
|
let proofAccountOffset = 0n;
|
|
6436
6182
|
for (let index = 0; index < 16; index++) {
|
|
6437
6183
|
proofAccountOffset |= BigInt(proofAccountOffsetBytes[index]) << BigInt(index * 8);
|
|
@@ -6497,9 +6243,9 @@ function getEncryptedBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
6497
6243
|
);
|
|
6498
6244
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(senderUserCommitment);
|
|
6499
6245
|
const ephemeralOffset = expandedModifiedGenerationIndexU256;
|
|
6500
|
-
const randomSecret =
|
|
6246
|
+
const randomSecret = chunkYFUGKMNS_cjs.deriveRandomSecretFromModifiedGenerationIndex(modifiedGenerationIndex);
|
|
6501
6247
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(randomSecret);
|
|
6502
|
-
const nullifier =
|
|
6248
|
+
const nullifier = chunkYFUGKMNS_cjs.deriveNullifierFromModifiedGenerationIndex(modifiedGenerationIndex);
|
|
6503
6249
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(nullifier);
|
|
6504
6250
|
const ephemeralMasterViewingKey = await ephemeralUtxoMvkGenerator(ephemeralOffset);
|
|
6505
6251
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(ephemeralMasterViewingKey);
|
|
@@ -6590,10 +6336,10 @@ function getEncryptedBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
6590
6336
|
const clientX25519PrivateKey = keypairResult.x25519Keypair.privateKey;
|
|
6591
6337
|
chunkLTCKPTZC_cjs.assertX25519PrivateKey(clientX25519PrivateKey);
|
|
6592
6338
|
const clientX25519PublicKey = keypairResult.x25519Keypair.publicKey;
|
|
6593
|
-
const rcEncryptor =
|
|
6339
|
+
const rcEncryptor = chunkYFUGKMNS_cjs.getRescueEncryptorFromPrivateKey(clientX25519PrivateKey, {
|
|
6594
6340
|
umbraX25519PublicKey: client.networkConfig.mxePubkey
|
|
6595
6341
|
});
|
|
6596
|
-
const randomFactorForPolynomialCommitment =
|
|
6342
|
+
const randomFactorForPolynomialCommitment = chunkYFUGKMNS_cjs.deriveRandomFactorForPolynomialCommitmentFromModifiedGenerationIndex(
|
|
6597
6343
|
modifiedGenerationIndex
|
|
6598
6344
|
);
|
|
6599
6345
|
chunkLTCKPTZC_cjs.assertU256(randomFactorForPolynomialCommitment);
|
|
@@ -6629,7 +6375,7 @@ function getEncryptedBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
6629
6375
|
chunkLTCKPTZC_cjs.assertRcCiphertext(rcEncryptedProtocolFees);
|
|
6630
6376
|
chunkLTCKPTZC_cjs.assertRcCiphertext(rcEncryptedRandomFactorLow);
|
|
6631
6377
|
chunkLTCKPTZC_cjs.assertRcCiphertext(rcEncryptedRandomFactorHigh);
|
|
6632
|
-
const rcKeyGenerator =
|
|
6378
|
+
const rcKeyGenerator = chunkYFUGKMNS_cjs.getRescueKeyGeneratorFromPrivateKey(clientX25519PrivateKey, {
|
|
6633
6379
|
umbraX25519PublicKey: client.networkConfig.mxePubkey
|
|
6634
6380
|
});
|
|
6635
6381
|
const rcEncryptionKeys = await rcKeyGenerator(
|
|
@@ -6682,7 +6428,7 @@ function getEncryptedBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
6682
6428
|
const rcEncryptionKeyForRandomFactorHighAsLimbs = chunkZY3TSHMJ_cjs.convertU256ToBase85Limbs(
|
|
6683
6429
|
toU256(rcEncryptionKeyForRandomFactorHigh)
|
|
6684
6430
|
);
|
|
6685
|
-
const rescueEncryptionCommitmentBlindingFactor =
|
|
6431
|
+
const rescueEncryptionCommitmentBlindingFactor = chunkYFUGKMNS_cjs.deriveRescueEncryptionCommitmentBlindingFactorFromModifiedGenerationIndex(
|
|
6686
6432
|
modifiedGenerationIndex
|
|
6687
6433
|
);
|
|
6688
6434
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(rescueEncryptionCommitmentBlindingFactor);
|
|
@@ -7064,7 +6810,7 @@ function getEncryptedBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
7064
6810
|
try {
|
|
7065
6811
|
latestBlockhashData = await getLatestBlockhash();
|
|
7066
6812
|
} catch (error) {
|
|
7067
|
-
throw new
|
|
6813
|
+
throw new chunkKCHHJKQN_cjs.RpcError(
|
|
7068
6814
|
`Failed to fetch latest blockhash: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
7069
6815
|
{ cause: error }
|
|
7070
6816
|
);
|
|
@@ -7080,7 +6826,7 @@ function getEncryptedBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
7080
6826
|
const transaction = kit.compileTransaction(transactionMessage);
|
|
7081
6827
|
const signedTransaction = await client.signer.signTransaction(transaction);
|
|
7082
6828
|
if (!isSignedTransaction(signedTransaction)) {
|
|
7083
|
-
throw new
|
|
6829
|
+
throw new chunkKCHHJKQN_cjs.TransactionError(`${instructionName}: Transaction was not properly signed`);
|
|
7084
6830
|
}
|
|
7085
6831
|
const result2 = await forwardAndMonitor(
|
|
7086
6832
|
executorConfig,
|
|
@@ -7095,6 +6841,7 @@ function getEncryptedBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
7095
6841
|
return {
|
|
7096
6842
|
signedTransaction: result2.signedTransaction,
|
|
7097
6843
|
signature: result2.signature,
|
|
6844
|
+
callbackStatus: callbackResult?.status,
|
|
7098
6845
|
callbackSignature,
|
|
7099
6846
|
callbackElapsedMs: callbackResult?.elapsedMs,
|
|
7100
6847
|
rentClaimSignature,
|
|
@@ -7273,6 +7020,7 @@ function getEncryptedBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
7273
7020
|
closeProofAccountSignature: closeResult?.signature,
|
|
7274
7021
|
createProofAccountSignature: proofAccountResult.signature,
|
|
7275
7022
|
queueSignature: utxoResult.signature,
|
|
7023
|
+
callbackStatus: utxoResult.callbackStatus,
|
|
7276
7024
|
callbackSignature: utxoResult.callbackSignature,
|
|
7277
7025
|
callbackElapsedMs: utxoResult.callbackElapsedMs,
|
|
7278
7026
|
rentClaimSignature: utxoResult.rentClaimSignature,
|
|
@@ -7280,22 +7028,22 @@ function getEncryptedBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
7280
7028
|
};
|
|
7281
7029
|
return result;
|
|
7282
7030
|
} catch (error) {
|
|
7283
|
-
if (error instanceof
|
|
7031
|
+
if (error instanceof chunkKCHHJKQN_cjs.CreateUtxoError) {
|
|
7284
7032
|
throw error;
|
|
7285
7033
|
}
|
|
7286
|
-
if (error instanceof
|
|
7287
|
-
throw new
|
|
7034
|
+
if (error instanceof chunkKCHHJKQN_cjs.TransactionSigningError) {
|
|
7035
|
+
throw new chunkKCHHJKQN_cjs.CreateUtxoError("transaction-sign", error.message, error);
|
|
7288
7036
|
}
|
|
7289
7037
|
if (error instanceof chunkFSK2ICMB_cjs.CryptographyError) {
|
|
7290
|
-
throw new
|
|
7038
|
+
throw new chunkKCHHJKQN_cjs.CreateUtxoError("zk-proof-generation", error.message, error);
|
|
7291
7039
|
}
|
|
7292
|
-
if (error instanceof
|
|
7293
|
-
throw new
|
|
7040
|
+
if (error instanceof chunkKCHHJKQN_cjs.TransactionError) {
|
|
7041
|
+
throw new chunkKCHHJKQN_cjs.CreateUtxoError("transaction-send", error.message, error);
|
|
7294
7042
|
}
|
|
7295
|
-
if (error instanceof
|
|
7296
|
-
throw new
|
|
7043
|
+
if (error instanceof chunkKCHHJKQN_cjs.RpcError) {
|
|
7044
|
+
throw new chunkKCHHJKQN_cjs.CreateUtxoError("account-fetch", error.message, error);
|
|
7297
7045
|
}
|
|
7298
|
-
throw new
|
|
7046
|
+
throw new chunkKCHHJKQN_cjs.CreateUtxoError(
|
|
7299
7047
|
"transaction-send",
|
|
7300
7048
|
error instanceof Error ? error.message : String(error),
|
|
7301
7049
|
error instanceof Error ? error : void 0
|
|
@@ -7361,24 +7109,24 @@ function getEncryptedBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
7361
7109
|
const factoryCloseProofAccountCallbacks = deps.hooks?.closeProofAccount;
|
|
7362
7110
|
const factoryCreateProofAccountCallbacks = deps.hooks?.createProofAccount;
|
|
7363
7111
|
const factoryCreateUtxoCallbacks = deps.hooks?.createUtxo;
|
|
7364
|
-
const masterViewingKeyGenerator = deps.keys?.masterViewingKeyGenerator ??
|
|
7365
|
-
const masterViewingKeyBlindingFactorGenerator = deps.keys?.masterViewingKeyBlindingFactorGenerator ??
|
|
7366
|
-
const poseidonPrivateKeyGenerator = deps.keys?.poseidonPrivateKeyGenerator ??
|
|
7367
|
-
const poseidonBlindingFactorGenerator = deps.keys?.poseidonBlindingFactorGenerator ??
|
|
7368
|
-
const mvkX25519KeypairDeriver = deps.keys?.mvkX25519KeypairDeriver ??
|
|
7369
|
-
const secondViewingKeyGenerator = deps.keys?.secondViewingKeyGenerator ??
|
|
7370
|
-
const poseidonKeystreamBlindingFactorGenerator = deps.keys?.poseidonKeystreamBlindingFactorGenerator ??
|
|
7371
|
-
const poseidonEncryptor = deps.crypto?.poseidonEncryptor ??
|
|
7372
|
-
const poseidonKeystreamGenerator = deps.crypto?.poseidonKeystreamGenerator ??
|
|
7373
|
-
const h2Generator = deps.crypto?.h2Generator ??
|
|
7374
|
-
const keystreamCommitmentGenerator = deps.crypto?.keystreamCommitmentGenerator ??
|
|
7375
|
-
const userCommitmentGenerator =
|
|
7376
|
-
const rescueEncryptionCommitmentGenerator =
|
|
7377
|
-
const poseidonAggregator =
|
|
7378
|
-
const fiatShamirChallengeGenerator =
|
|
7379
|
-
const challengePowersFunction =
|
|
7380
|
-
const polynomialEvaluator =
|
|
7381
|
-
const aesEncryptor = deps.crypto?.aesEncryptor ??
|
|
7112
|
+
const masterViewingKeyGenerator = deps.keys?.masterViewingKeyGenerator ?? chunkYFUGKMNS_cjs.getMasterViewingKeyDeriver({ client });
|
|
7113
|
+
const masterViewingKeyBlindingFactorGenerator = deps.keys?.masterViewingKeyBlindingFactorGenerator ?? chunkYFUGKMNS_cjs.getMasterViewingKeyBlindingFactorDeriver({ client });
|
|
7114
|
+
const poseidonPrivateKeyGenerator = deps.keys?.poseidonPrivateKeyGenerator ?? chunkYFUGKMNS_cjs.getPoseidonPrivateKeyDeriver({ client });
|
|
7115
|
+
const poseidonBlindingFactorGenerator = deps.keys?.poseidonBlindingFactorGenerator ?? chunkYFUGKMNS_cjs.getPoseidonBlindingFactorDeriver({ client });
|
|
7116
|
+
const mvkX25519KeypairDeriver = deps.keys?.mvkX25519KeypairDeriver ?? chunkYFUGKMNS_cjs.getUserAccountX25519KeypairDeriver({ client });
|
|
7117
|
+
const secondViewingKeyGenerator = deps.keys?.secondViewingKeyGenerator ?? chunkYFUGKMNS_cjs.getSecondViewingKeyDeriver({ client });
|
|
7118
|
+
const poseidonKeystreamBlindingFactorGenerator = deps.keys?.poseidonKeystreamBlindingFactorGenerator ?? chunkYFUGKMNS_cjs.getPoseidonKeystreamBlindingFactorDeriver({ client });
|
|
7119
|
+
const poseidonEncryptor = deps.crypto?.poseidonEncryptor ?? chunkYFUGKMNS_cjs.getPoseidonEncryptor();
|
|
7120
|
+
const poseidonKeystreamGenerator = deps.crypto?.poseidonKeystreamGenerator ?? chunkYFUGKMNS_cjs.getPoseidonKeystreamGenerator();
|
|
7121
|
+
const h2Generator = deps.crypto?.h2Generator ?? chunkYFUGKMNS_cjs.getUtxoCommitmentHashGenerator();
|
|
7122
|
+
const keystreamCommitmentGenerator = deps.crypto?.keystreamCommitmentGenerator ?? chunkYFUGKMNS_cjs.getKeystreamCommitmentGenerator();
|
|
7123
|
+
const userCommitmentGenerator = chunkYFUGKMNS_cjs.getUserCommitmentGeneratorFunction();
|
|
7124
|
+
const rescueEncryptionCommitmentGenerator = chunkYFUGKMNS_cjs.getRescueCommitmentGenerator();
|
|
7125
|
+
const poseidonAggregator = chunkYFUGKMNS_cjs.getPoseidonAggregator();
|
|
7126
|
+
const fiatShamirChallengeGenerator = chunkYFUGKMNS_cjs.getFiatShamirChallengeGeneratorFunction();
|
|
7127
|
+
const challengePowersFunction = chunkYFUGKMNS_cjs.getChallengePowersFunction();
|
|
7128
|
+
const polynomialEvaluator = chunkYFUGKMNS_cjs.getPolynomialEvaluatorFunction();
|
|
7129
|
+
const aesEncryptor = deps.crypto?.aesEncryptor ?? chunkYFUGKMNS_cjs.getAesEncryptor();
|
|
7382
7130
|
const generateRandomU256Function = deps.random?.generateRandomU256 ?? chunkZY3TSHMJ_cjs.generateRandomU256;
|
|
7383
7131
|
const generateComputationOffsetFunction = deps.random?.generateComputationOffset ?? chunkZY3TSHMJ_cjs.generateComputationOffset;
|
|
7384
7132
|
return /* @__PURE__ */ chunkPK6SKIKE_cjs.__name(async function createReceiverClaimableUtxo(args2, options) {
|
|
@@ -7402,12 +7150,12 @@ function getEncryptedBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
7402
7150
|
masterSeed,
|
|
7403
7151
|
{ dkLen: 16, personalization: generationIndexBytes }
|
|
7404
7152
|
);
|
|
7405
|
-
const expandedModifiedGenerationIndex =
|
|
7153
|
+
const expandedModifiedGenerationIndex = chunkYFUGKMNS_cjs.expandModifiedGenerationIndex(modifiedGenerationIndex);
|
|
7406
7154
|
let _expandedModifiedGenerationIndexU256 = 0n;
|
|
7407
7155
|
for (let index = 0; index < 32; index++) {
|
|
7408
7156
|
_expandedModifiedGenerationIndexU256 |= BigInt(expandedModifiedGenerationIndex[index]) << BigInt(index * 8);
|
|
7409
7157
|
}
|
|
7410
|
-
const proofAccountOffsetBytes =
|
|
7158
|
+
const proofAccountOffsetBytes = chunkYFUGKMNS_cjs.deriveProofAccountOffsetFromModifiedGenerationIndex(modifiedGenerationIndex);
|
|
7411
7159
|
let proofAccountOffset = 0n;
|
|
7412
7160
|
for (let index = 0; index < 16; index++) {
|
|
7413
7161
|
proofAccountOffset |= BigInt(proofAccountOffsetBytes[index]) << BigInt(index * 8);
|
|
@@ -7501,9 +7249,9 @@ function getEncryptedBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
7501
7249
|
senderPrivateKeyBlindingFactor
|
|
7502
7250
|
);
|
|
7503
7251
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(senderUserCommitment);
|
|
7504
|
-
const randomSecret =
|
|
7252
|
+
const randomSecret = chunkYFUGKMNS_cjs.deriveRandomSecretFromModifiedGenerationIndex(modifiedGenerationIndex);
|
|
7505
7253
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(randomSecret);
|
|
7506
|
-
const nullifier =
|
|
7254
|
+
const nullifier = chunkYFUGKMNS_cjs.deriveNullifierFromModifiedGenerationIndex(modifiedGenerationIndex);
|
|
7507
7255
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(nullifier);
|
|
7508
7256
|
const unlockingUserCommitment = receiverUserCommitment;
|
|
7509
7257
|
const h2Hash = await h2Generator.generateH2({
|
|
@@ -7580,10 +7328,10 @@ function getEncryptedBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
7580
7328
|
const clientX25519PrivateKey = keypairResult.x25519Keypair.privateKey;
|
|
7581
7329
|
chunkLTCKPTZC_cjs.assertX25519PrivateKey(clientX25519PrivateKey);
|
|
7582
7330
|
const clientX25519PublicKey = keypairResult.x25519Keypair.publicKey;
|
|
7583
|
-
const rcEncryptor =
|
|
7331
|
+
const rcEncryptor = chunkYFUGKMNS_cjs.getRescueEncryptorFromPrivateKey(clientX25519PrivateKey, {
|
|
7584
7332
|
umbraX25519PublicKey: client.networkConfig.mxePubkey
|
|
7585
7333
|
});
|
|
7586
|
-
const randomFactorForPolynomialCommitment =
|
|
7334
|
+
const randomFactorForPolynomialCommitment = chunkYFUGKMNS_cjs.deriveRandomFactorForPolynomialCommitmentFromModifiedGenerationIndex(
|
|
7587
7335
|
modifiedGenerationIndex
|
|
7588
7336
|
);
|
|
7589
7337
|
chunkLTCKPTZC_cjs.assertU256(randomFactorForPolynomialCommitment);
|
|
@@ -7619,7 +7367,7 @@ function getEncryptedBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
7619
7367
|
chunkLTCKPTZC_cjs.assertRcCiphertext(rcEncryptedProtocolFees);
|
|
7620
7368
|
chunkLTCKPTZC_cjs.assertRcCiphertext(rcEncryptedRandomFactorLow);
|
|
7621
7369
|
chunkLTCKPTZC_cjs.assertRcCiphertext(rcEncryptedRandomFactorHigh);
|
|
7622
|
-
const rcKeyGenerator =
|
|
7370
|
+
const rcKeyGenerator = chunkYFUGKMNS_cjs.getRescueKeyGeneratorFromPrivateKey(clientX25519PrivateKey, {
|
|
7623
7371
|
umbraX25519PublicKey: client.networkConfig.mxePubkey
|
|
7624
7372
|
});
|
|
7625
7373
|
const rcEncryptionKeys = await rcKeyGenerator(
|
|
@@ -7672,7 +7420,7 @@ function getEncryptedBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
7672
7420
|
const rcEncryptionKeyForRandomFactorHighAsLimbs = chunkZY3TSHMJ_cjs.convertU256ToBase85Limbs(
|
|
7673
7421
|
toU2562(rcEncryptionKeyForRandomFactorHigh)
|
|
7674
7422
|
);
|
|
7675
|
-
const rescueEncryptionCommitmentBlindingFactor =
|
|
7423
|
+
const rescueEncryptionCommitmentBlindingFactor = chunkYFUGKMNS_cjs.deriveRescueEncryptionCommitmentBlindingFactorFromModifiedGenerationIndex(
|
|
7676
7424
|
modifiedGenerationIndex
|
|
7677
7425
|
);
|
|
7678
7426
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(rescueEncryptionCommitmentBlindingFactor);
|
|
@@ -8054,7 +7802,7 @@ function getEncryptedBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8054
7802
|
try {
|
|
8055
7803
|
latestBlockhashData = await getLatestBlockhash();
|
|
8056
7804
|
} catch (error) {
|
|
8057
|
-
throw new
|
|
7805
|
+
throw new chunkKCHHJKQN_cjs.RpcError(
|
|
8058
7806
|
`Failed to fetch latest blockhash: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
8059
7807
|
{ cause: error }
|
|
8060
7808
|
);
|
|
@@ -8070,7 +7818,7 @@ function getEncryptedBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8070
7818
|
const transaction = kit.compileTransaction(transactionMessage);
|
|
8071
7819
|
const signedTransaction = await client.signer.signTransaction(transaction);
|
|
8072
7820
|
if (!isSignedTransaction2(signedTransaction)) {
|
|
8073
|
-
throw new
|
|
7821
|
+
throw new chunkKCHHJKQN_cjs.TransactionError(`${instructionName}: Transaction was not properly signed`);
|
|
8074
7822
|
}
|
|
8075
7823
|
const result2 = await forwardAndMonitor(
|
|
8076
7824
|
executorConfig,
|
|
@@ -8085,6 +7833,7 @@ function getEncryptedBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8085
7833
|
return {
|
|
8086
7834
|
signedTransaction: result2.signedTransaction,
|
|
8087
7835
|
signature: result2.signature,
|
|
7836
|
+
callbackStatus: callbackResult?.status,
|
|
8088
7837
|
callbackSignature,
|
|
8089
7838
|
callbackElapsedMs: callbackResult?.elapsedMs,
|
|
8090
7839
|
rentClaimSignature,
|
|
@@ -8259,6 +8008,7 @@ function getEncryptedBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8259
8008
|
closeProofAccountSignature: closeResult?.signature,
|
|
8260
8009
|
createProofAccountSignature: proofAccountResult.signature,
|
|
8261
8010
|
queueSignature: utxoResult.signature,
|
|
8011
|
+
callbackStatus: utxoResult.callbackStatus,
|
|
8262
8012
|
callbackSignature: utxoResult.callbackSignature,
|
|
8263
8013
|
callbackElapsedMs: utxoResult.callbackElapsedMs,
|
|
8264
8014
|
rentClaimSignature: utxoResult.rentClaimSignature,
|
|
@@ -8266,22 +8016,22 @@ function getEncryptedBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8266
8016
|
};
|
|
8267
8017
|
return result;
|
|
8268
8018
|
} catch (error) {
|
|
8269
|
-
if (error instanceof
|
|
8019
|
+
if (error instanceof chunkKCHHJKQN_cjs.CreateUtxoError) {
|
|
8270
8020
|
throw error;
|
|
8271
8021
|
}
|
|
8272
|
-
if (error instanceof
|
|
8273
|
-
throw new
|
|
8022
|
+
if (error instanceof chunkKCHHJKQN_cjs.TransactionSigningError) {
|
|
8023
|
+
throw new chunkKCHHJKQN_cjs.CreateUtxoError("transaction-sign", error.message, error);
|
|
8274
8024
|
}
|
|
8275
8025
|
if (error instanceof chunkFSK2ICMB_cjs.CryptographyError) {
|
|
8276
|
-
throw new
|
|
8026
|
+
throw new chunkKCHHJKQN_cjs.CreateUtxoError("zk-proof-generation", error.message, error);
|
|
8277
8027
|
}
|
|
8278
|
-
if (error instanceof
|
|
8279
|
-
throw new
|
|
8028
|
+
if (error instanceof chunkKCHHJKQN_cjs.TransactionError) {
|
|
8029
|
+
throw new chunkKCHHJKQN_cjs.CreateUtxoError("transaction-send", error.message, error);
|
|
8280
8030
|
}
|
|
8281
|
-
if (error instanceof
|
|
8282
|
-
throw new
|
|
8031
|
+
if (error instanceof chunkKCHHJKQN_cjs.RpcError) {
|
|
8032
|
+
throw new chunkKCHHJKQN_cjs.CreateUtxoError("account-fetch", error.message, error);
|
|
8283
8033
|
}
|
|
8284
|
-
throw new
|
|
8034
|
+
throw new chunkKCHHJKQN_cjs.CreateUtxoError(
|
|
8285
8035
|
"transaction-send",
|
|
8286
8036
|
error instanceof Error ? error.message : String(error),
|
|
8287
8037
|
error instanceof Error ? error : void 0
|
|
@@ -8315,24 +8065,24 @@ function getPublicBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8315
8065
|
const transactionForwarder = deps.rpc?.transactionForwarder ?? client.transactionForwarder;
|
|
8316
8066
|
const factoryCreateUtxoCallbacks = deps.hooks?.createUtxo;
|
|
8317
8067
|
const getEpochInfo = deps.rpc?.epochInfo ?? client.epochInfoProvider;
|
|
8318
|
-
const masterViewingKeyGenerator = deps.keys?.masterViewingKeyGenerator ??
|
|
8319
|
-
const masterViewingKeyBlindingFactorGenerator = deps.keys?.masterViewingKeyBlindingFactorGenerator ??
|
|
8320
|
-
const poseidonPrivateKeyGenerator = deps.keys?.poseidonPrivateKeyGenerator ??
|
|
8321
|
-
const poseidonBlindingFactorGenerator = deps.keys?.poseidonBlindingFactorGenerator ??
|
|
8322
|
-
const mvkX25519KeypairDeriver = deps.keys?.mvkX25519KeypairDeriver ??
|
|
8323
|
-
const secondViewingKeyGenerator = deps.keys?.secondViewingKeyGenerator ??
|
|
8324
|
-
const ephemeralUtxoMvkGenerator = deps.keys?.ephemeralUtxoMasterViewingKeyDeriver ??
|
|
8325
|
-
const ephemeralUtxoMvkBlindingFactorGenerator = deps.keys?.ephemeralUtxoMasterViewingKeyBlindingFactorDeriver ??
|
|
8326
|
-
const ephemeralUtxoPoseidonKeyGenerator = deps.keys?.ephemeralUtxoPoseidonKeyGenerator ??
|
|
8327
|
-
const ephemeralUtxoPoseidonKeyBlindingFactorGenerator = deps.keys?.ephemeralUtxoPoseidonKeyBlindingFactorGenerator ??
|
|
8328
|
-
const poseidonKeystreamBlindingFactorGenerator = deps.keys?.poseidonKeystreamBlindingFactorGenerator ??
|
|
8329
|
-
const poseidonEncryptor = deps.crypto?.poseidonEncryptor ??
|
|
8330
|
-
const poseidonKeystreamGenerator = deps.crypto?.poseidonKeystreamGenerator ??
|
|
8331
|
-
const h2Generator = deps.crypto?.h2Generator ??
|
|
8332
|
-
const keystreamCommitmentGenerator = deps.crypto?.keystreamCommitmentGenerator ??
|
|
8333
|
-
const userCommitmentGenerator =
|
|
8334
|
-
const poseidonAggregator =
|
|
8335
|
-
const aesEncryptor = deps.crypto?.aesEncryptor ??
|
|
8068
|
+
const masterViewingKeyGenerator = deps.keys?.masterViewingKeyGenerator ?? chunkYFUGKMNS_cjs.getMasterViewingKeyDeriver({ client });
|
|
8069
|
+
const masterViewingKeyBlindingFactorGenerator = deps.keys?.masterViewingKeyBlindingFactorGenerator ?? chunkYFUGKMNS_cjs.getMasterViewingKeyBlindingFactorDeriver({ client });
|
|
8070
|
+
const poseidonPrivateKeyGenerator = deps.keys?.poseidonPrivateKeyGenerator ?? chunkYFUGKMNS_cjs.getPoseidonPrivateKeyDeriver({ client });
|
|
8071
|
+
const poseidonBlindingFactorGenerator = deps.keys?.poseidonBlindingFactorGenerator ?? chunkYFUGKMNS_cjs.getPoseidonBlindingFactorDeriver({ client });
|
|
8072
|
+
const mvkX25519KeypairDeriver = deps.keys?.mvkX25519KeypairDeriver ?? chunkYFUGKMNS_cjs.getUserAccountX25519KeypairDeriver({ client });
|
|
8073
|
+
const secondViewingKeyGenerator = deps.keys?.secondViewingKeyGenerator ?? chunkYFUGKMNS_cjs.getSecondViewingKeyDeriver({ client });
|
|
8074
|
+
const ephemeralUtxoMvkGenerator = deps.keys?.ephemeralUtxoMasterViewingKeyDeriver ?? chunkYFUGKMNS_cjs.getEphemeralUtxoMasterViewingKeyDeriver({ client });
|
|
8075
|
+
const ephemeralUtxoMvkBlindingFactorGenerator = deps.keys?.ephemeralUtxoMasterViewingKeyBlindingFactorDeriver ?? chunkYFUGKMNS_cjs.getEphemeralUtxoMasterViewingKeyBlindingFactorDeriver({ client });
|
|
8076
|
+
const ephemeralUtxoPoseidonKeyGenerator = deps.keys?.ephemeralUtxoPoseidonKeyGenerator ?? chunkYFUGKMNS_cjs.getEphemeralUtxoPoseidonPrivateKeyDeriver({ client });
|
|
8077
|
+
const ephemeralUtxoPoseidonKeyBlindingFactorGenerator = deps.keys?.ephemeralUtxoPoseidonKeyBlindingFactorGenerator ?? chunkYFUGKMNS_cjs.getEphemeralUtxoPoseidonPrivateKeyBlindingFactorDeriver({ client });
|
|
8078
|
+
const poseidonKeystreamBlindingFactorGenerator = deps.keys?.poseidonKeystreamBlindingFactorGenerator ?? chunkYFUGKMNS_cjs.getPoseidonKeystreamBlindingFactorDeriver({ client });
|
|
8079
|
+
const poseidonEncryptor = deps.crypto?.poseidonEncryptor ?? chunkYFUGKMNS_cjs.getPoseidonEncryptor();
|
|
8080
|
+
const poseidonKeystreamGenerator = deps.crypto?.poseidonKeystreamGenerator ?? chunkYFUGKMNS_cjs.getPoseidonKeystreamGenerator();
|
|
8081
|
+
const h2Generator = deps.crypto?.h2Generator ?? chunkYFUGKMNS_cjs.getUtxoCommitmentHashGenerator();
|
|
8082
|
+
const keystreamCommitmentGenerator = deps.crypto?.keystreamCommitmentGenerator ?? chunkYFUGKMNS_cjs.getKeystreamCommitmentGenerator();
|
|
8083
|
+
const userCommitmentGenerator = chunkYFUGKMNS_cjs.getUserCommitmentGeneratorFunction();
|
|
8084
|
+
const poseidonAggregator = chunkYFUGKMNS_cjs.getPoseidonAggregator();
|
|
8085
|
+
const aesEncryptor = deps.crypto?.aesEncryptor ?? chunkYFUGKMNS_cjs.getAesEncryptor();
|
|
8336
8086
|
const generateRandomU256Function = deps.random?.generateRandomU256 ?? chunkZY3TSHMJ_cjs.generateRandomU256;
|
|
8337
8087
|
return /* @__PURE__ */ chunkPK6SKIKE_cjs.__name(async function createSelfClaimableUtxoFromPublicBalance(args2, options) {
|
|
8338
8088
|
const accountInfoCommitment = options?.accountInfoCommitment ?? "confirmed";
|
|
@@ -8355,12 +8105,12 @@ function getPublicBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8355
8105
|
masterSeed,
|
|
8356
8106
|
{ dkLen: 16, personalization: generationIndexBytes }
|
|
8357
8107
|
);
|
|
8358
|
-
const proofAccountOffsetBytes =
|
|
8108
|
+
const proofAccountOffsetBytes = chunkYFUGKMNS_cjs.deriveProofAccountOffsetFromModifiedGenerationIndex(modifiedGenerationIndex);
|
|
8359
8109
|
let proofAccountOffset = 0n;
|
|
8360
8110
|
for (let index = 0; index < 16; index++) {
|
|
8361
8111
|
proofAccountOffset |= BigInt(proofAccountOffsetBytes[index]) << BigInt(index * 8);
|
|
8362
8112
|
}
|
|
8363
|
-
const expandedModifiedGenerationIndex =
|
|
8113
|
+
const expandedModifiedGenerationIndex = chunkYFUGKMNS_cjs.expandModifiedGenerationIndex(modifiedGenerationIndex);
|
|
8364
8114
|
let expandedModifiedGenerationIndexU256 = 0n;
|
|
8365
8115
|
for (let index = 0; index < 32; index++) {
|
|
8366
8116
|
expandedModifiedGenerationIndexU256 |= BigInt(expandedModifiedGenerationIndex[index]) << BigInt(index * 8);
|
|
@@ -8373,7 +8123,7 @@ function getPublicBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8373
8123
|
], { commitment: accountInfoCommitment });
|
|
8374
8124
|
const mintAccount = mintAccountMap.get(mint);
|
|
8375
8125
|
if (mintAccount?.exists !== true) {
|
|
8376
|
-
throw new
|
|
8126
|
+
throw new chunkKCHHJKQN_cjs.TransactionError(`Mint account not found: ${mint}`);
|
|
8377
8127
|
}
|
|
8378
8128
|
const clusterOffset = chunkZY3TSHMJ_cjs.extractClusterOffsetFromMxeAccount(
|
|
8379
8129
|
mintAccountMap.get(client.networkConfig.mxeAccountAddress)
|
|
@@ -8389,7 +8139,7 @@ function getPublicBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8389
8139
|
const transferFee = chunkZY3TSHMJ_cjs.calculateTransferFee(feeConfig, epochInfo.epoch, amount);
|
|
8390
8140
|
actualReceived = amount - transferFee;
|
|
8391
8141
|
if (actualReceived <= 0n) {
|
|
8392
|
-
throw new
|
|
8142
|
+
throw new chunkKCHHJKQN_cjs.TransactionError(
|
|
8393
8143
|
`Transfer fee (${String(transferFee)}) exceeds or equals transfer amount (${String(amount)}).`
|
|
8394
8144
|
);
|
|
8395
8145
|
}
|
|
@@ -8399,7 +8149,7 @@ function getPublicBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8399
8149
|
actualReceived = amount;
|
|
8400
8150
|
mintTokenProgram = chunk43JEHY7D_cjs.SPL_TOKEN_PROGRAM_ID;
|
|
8401
8151
|
} else {
|
|
8402
|
-
throw new
|
|
8152
|
+
throw new chunkKCHHJKQN_cjs.TransactionError(
|
|
8403
8153
|
`Unknown token program: ${mintOwner}. Expected SPL Token or Token-2022.`
|
|
8404
8154
|
);
|
|
8405
8155
|
}
|
|
@@ -8412,7 +8162,7 @@ function getPublicBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8412
8162
|
const totalProtocolFees = baseFeesInSpl + commissionFee;
|
|
8413
8163
|
const netDepositAmount = actualReceived - totalProtocolFees;
|
|
8414
8164
|
if (netDepositAmount <= 0n) {
|
|
8415
|
-
throw new
|
|
8165
|
+
throw new chunkKCHHJKQN_cjs.TransactionError(
|
|
8416
8166
|
`Net deposit amount is zero or negative after fees. Transfer amount: ${String(amount)}, actual received: ${String(actualReceived)}, protocol fees: ${String(totalProtocolFees)}.`
|
|
8417
8167
|
);
|
|
8418
8168
|
}
|
|
@@ -8466,9 +8216,9 @@ function getPublicBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8466
8216
|
);
|
|
8467
8217
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(senderUserCommitment);
|
|
8468
8218
|
const ephemeralOffset = expandedModifiedGenerationIndexU256;
|
|
8469
|
-
const randomSecret =
|
|
8219
|
+
const randomSecret = chunkYFUGKMNS_cjs.deriveRandomSecretFromModifiedGenerationIndex(modifiedGenerationIndex);
|
|
8470
8220
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(randomSecret);
|
|
8471
|
-
const nullifier =
|
|
8221
|
+
const nullifier = chunkYFUGKMNS_cjs.deriveNullifierFromModifiedGenerationIndex(modifiedGenerationIndex);
|
|
8472
8222
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(nullifier);
|
|
8473
8223
|
const ephemeralMasterViewingKey = await ephemeralUtxoMvkGenerator(ephemeralOffset);
|
|
8474
8224
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(ephemeralMasterViewingKey);
|
|
@@ -8665,7 +8415,7 @@ function getPublicBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8665
8415
|
try {
|
|
8666
8416
|
latestBlockhashData = await getLatestBlockhash();
|
|
8667
8417
|
} catch (error) {
|
|
8668
|
-
throw new
|
|
8418
|
+
throw new chunkKCHHJKQN_cjs.RpcError(
|
|
8669
8419
|
`Failed to fetch latest blockhash: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
8670
8420
|
{ cause: error }
|
|
8671
8421
|
);
|
|
@@ -8688,7 +8438,7 @@ function getPublicBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8688
8438
|
const transaction = kit.compileTransaction(transactionMessage);
|
|
8689
8439
|
const signed = await client.signer.signTransaction(transaction);
|
|
8690
8440
|
if (!isSignedTransaction3(signed)) {
|
|
8691
|
-
throw new
|
|
8441
|
+
throw new chunkKCHHJKQN_cjs.TransactionError(
|
|
8692
8442
|
`${instructionName}: Transaction was not properly signed`
|
|
8693
8443
|
);
|
|
8694
8444
|
}
|
|
@@ -8696,7 +8446,7 @@ function getPublicBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8696
8446
|
try {
|
|
8697
8447
|
await transactionForwarder.forwardSequentially([signed]);
|
|
8698
8448
|
} catch (error) {
|
|
8699
|
-
throw new
|
|
8449
|
+
throw new chunkKCHHJKQN_cjs.TransactionError(
|
|
8700
8450
|
`${instructionName}: Failed to send transaction: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
8701
8451
|
{ cause: error }
|
|
8702
8452
|
);
|
|
@@ -8794,22 +8544,22 @@ function getPublicBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8794
8544
|
createUtxoSignature: depositResult.signature
|
|
8795
8545
|
};
|
|
8796
8546
|
} catch (error) {
|
|
8797
|
-
if (error instanceof
|
|
8547
|
+
if (error instanceof chunkKCHHJKQN_cjs.CreateUtxoError) {
|
|
8798
8548
|
throw error;
|
|
8799
8549
|
}
|
|
8800
|
-
if (error instanceof
|
|
8801
|
-
throw new
|
|
8550
|
+
if (error instanceof chunkKCHHJKQN_cjs.TransactionSigningError) {
|
|
8551
|
+
throw new chunkKCHHJKQN_cjs.CreateUtxoError("transaction-sign", error.message, error);
|
|
8802
8552
|
}
|
|
8803
8553
|
if (error instanceof chunkFSK2ICMB_cjs.CryptographyError) {
|
|
8804
|
-
throw new
|
|
8554
|
+
throw new chunkKCHHJKQN_cjs.CreateUtxoError("zk-proof-generation", error.message, error);
|
|
8805
8555
|
}
|
|
8806
|
-
if (error instanceof
|
|
8807
|
-
throw new
|
|
8556
|
+
if (error instanceof chunkKCHHJKQN_cjs.TransactionError) {
|
|
8557
|
+
throw new chunkKCHHJKQN_cjs.CreateUtxoError("transaction-send", error.message, error);
|
|
8808
8558
|
}
|
|
8809
|
-
if (error instanceof
|
|
8810
|
-
throw new
|
|
8559
|
+
if (error instanceof chunkKCHHJKQN_cjs.RpcError) {
|
|
8560
|
+
throw new chunkKCHHJKQN_cjs.CreateUtxoError("account-fetch", error.message, error);
|
|
8811
8561
|
}
|
|
8812
|
-
throw new
|
|
8562
|
+
throw new chunkKCHHJKQN_cjs.CreateUtxoError(
|
|
8813
8563
|
"transaction-send",
|
|
8814
8564
|
error instanceof Error ? error.message : String(error),
|
|
8815
8565
|
error instanceof Error ? error : void 0
|
|
@@ -8843,20 +8593,20 @@ function getPublicBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8843
8593
|
const transactionForwarder = deps.rpc?.transactionForwarder ?? client.transactionForwarder;
|
|
8844
8594
|
const factoryCreateUtxoCallbacks = deps.hooks?.createUtxo;
|
|
8845
8595
|
const getEpochInfo = deps.rpc?.epochInfo ?? client.epochInfoProvider;
|
|
8846
|
-
const masterViewingKeyGenerator = deps.keys?.masterViewingKeyGenerator ??
|
|
8847
|
-
const masterViewingKeyBlindingFactorGenerator = deps.keys?.masterViewingKeyBlindingFactorGenerator ??
|
|
8848
|
-
const poseidonPrivateKeyGenerator = deps.keys?.poseidonPrivateKeyGenerator ??
|
|
8849
|
-
const poseidonBlindingFactorGenerator = deps.keys?.poseidonBlindingFactorGenerator ??
|
|
8850
|
-
const mvkX25519KeypairDeriver = deps.keys?.mvkX25519KeypairDeriver ??
|
|
8851
|
-
const secondViewingKeyGenerator = deps.keys?.secondViewingKeyGenerator ??
|
|
8852
|
-
const poseidonKeystreamBlindingFactorGenerator = deps.keys?.poseidonKeystreamBlindingFactorGenerator ??
|
|
8853
|
-
const poseidonEncryptor = deps.crypto?.poseidonEncryptor ??
|
|
8854
|
-
const poseidonKeystreamGenerator = deps.crypto?.poseidonKeystreamGenerator ??
|
|
8855
|
-
const h2Generator = deps.crypto?.h2Generator ??
|
|
8856
|
-
const keystreamCommitmentGenerator = deps.crypto?.keystreamCommitmentGenerator ??
|
|
8857
|
-
const userCommitmentGenerator =
|
|
8858
|
-
const poseidonAggregator =
|
|
8859
|
-
const aesEncryptor = deps.crypto?.aesEncryptor ??
|
|
8596
|
+
const masterViewingKeyGenerator = deps.keys?.masterViewingKeyGenerator ?? chunkYFUGKMNS_cjs.getMasterViewingKeyDeriver({ client });
|
|
8597
|
+
const masterViewingKeyBlindingFactorGenerator = deps.keys?.masterViewingKeyBlindingFactorGenerator ?? chunkYFUGKMNS_cjs.getMasterViewingKeyBlindingFactorDeriver({ client });
|
|
8598
|
+
const poseidonPrivateKeyGenerator = deps.keys?.poseidonPrivateKeyGenerator ?? chunkYFUGKMNS_cjs.getPoseidonPrivateKeyDeriver({ client });
|
|
8599
|
+
const poseidonBlindingFactorGenerator = deps.keys?.poseidonBlindingFactorGenerator ?? chunkYFUGKMNS_cjs.getPoseidonBlindingFactorDeriver({ client });
|
|
8600
|
+
const mvkX25519KeypairDeriver = deps.keys?.mvkX25519KeypairDeriver ?? chunkYFUGKMNS_cjs.getUserAccountX25519KeypairDeriver({ client });
|
|
8601
|
+
const secondViewingKeyGenerator = deps.keys?.secondViewingKeyGenerator ?? chunkYFUGKMNS_cjs.getSecondViewingKeyDeriver({ client });
|
|
8602
|
+
const poseidonKeystreamBlindingFactorGenerator = deps.keys?.poseidonKeystreamBlindingFactorGenerator ?? chunkYFUGKMNS_cjs.getPoseidonKeystreamBlindingFactorDeriver({ client });
|
|
8603
|
+
const poseidonEncryptor = deps.crypto?.poseidonEncryptor ?? chunkYFUGKMNS_cjs.getPoseidonEncryptor();
|
|
8604
|
+
const poseidonKeystreamGenerator = deps.crypto?.poseidonKeystreamGenerator ?? chunkYFUGKMNS_cjs.getPoseidonKeystreamGenerator();
|
|
8605
|
+
const h2Generator = deps.crypto?.h2Generator ?? chunkYFUGKMNS_cjs.getUtxoCommitmentHashGenerator();
|
|
8606
|
+
const keystreamCommitmentGenerator = deps.crypto?.keystreamCommitmentGenerator ?? chunkYFUGKMNS_cjs.getKeystreamCommitmentGenerator();
|
|
8607
|
+
const userCommitmentGenerator = chunkYFUGKMNS_cjs.getUserCommitmentGeneratorFunction();
|
|
8608
|
+
const poseidonAggregator = chunkYFUGKMNS_cjs.getPoseidonAggregator();
|
|
8609
|
+
const aesEncryptor = deps.crypto?.aesEncryptor ?? chunkYFUGKMNS_cjs.getAesEncryptor();
|
|
8860
8610
|
const generateRandomU256Function = deps.random?.generateRandomU256 ?? chunkZY3TSHMJ_cjs.generateRandomU256;
|
|
8861
8611
|
return /* @__PURE__ */ chunkPK6SKIKE_cjs.__name(async function createReceiverClaimableUtxoFromPublicBalance(args2, options) {
|
|
8862
8612
|
const accountInfoCommitment = options?.accountInfoCommitment ?? "confirmed";
|
|
@@ -8879,7 +8629,7 @@ function getPublicBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8879
8629
|
masterSeed,
|
|
8880
8630
|
{ dkLen: 16, personalization: generationIndexBytes }
|
|
8881
8631
|
);
|
|
8882
|
-
const proofAccountOffsetBytes =
|
|
8632
|
+
const proofAccountOffsetBytes = chunkYFUGKMNS_cjs.deriveProofAccountOffsetFromModifiedGenerationIndex(modifiedGenerationIndex);
|
|
8883
8633
|
let proofAccountOffset = 0n;
|
|
8884
8634
|
for (let index = 0; index < 16; index++) {
|
|
8885
8635
|
proofAccountOffset |= BigInt(proofAccountOffsetBytes[index]) << BigInt(index * 8);
|
|
@@ -8920,7 +8670,7 @@ function getPublicBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8920
8670
|
const mintAccountMap = await accountInfoProvider([mint], { commitment: accountInfoCommitment });
|
|
8921
8671
|
const mintAccount = mintAccountMap.get(mint);
|
|
8922
8672
|
if (mintAccount?.exists !== true) {
|
|
8923
|
-
throw new
|
|
8673
|
+
throw new chunkKCHHJKQN_cjs.TransactionError(`Mint account not found: ${mint}`);
|
|
8924
8674
|
}
|
|
8925
8675
|
const mintOwner = mintAccount.programAddress;
|
|
8926
8676
|
if (mintOwner === chunk43JEHY7D_cjs.TOKEN_2022_PROGRAM_ID) {
|
|
@@ -8933,7 +8683,7 @@ function getPublicBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8933
8683
|
const transferFee = chunkZY3TSHMJ_cjs.calculateTransferFee(feeConfig, epochInfo.epoch, amount);
|
|
8934
8684
|
actualReceived = amount - transferFee;
|
|
8935
8685
|
if (actualReceived <= 0n) {
|
|
8936
|
-
throw new
|
|
8686
|
+
throw new chunkKCHHJKQN_cjs.TransactionError(
|
|
8937
8687
|
`Transfer fee (${String(transferFee)}) exceeds or equals transfer amount (${String(amount)}).`
|
|
8938
8688
|
);
|
|
8939
8689
|
}
|
|
@@ -8943,7 +8693,7 @@ function getPublicBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8943
8693
|
actualReceived = amount;
|
|
8944
8694
|
mintTokenProgram = chunk43JEHY7D_cjs.SPL_TOKEN_PROGRAM_ID;
|
|
8945
8695
|
} else {
|
|
8946
|
-
throw new
|
|
8696
|
+
throw new chunkKCHHJKQN_cjs.TransactionError(
|
|
8947
8697
|
`Unknown token program: ${mintOwner}. Expected SPL Token or Token-2022.`
|
|
8948
8698
|
);
|
|
8949
8699
|
}
|
|
@@ -8956,7 +8706,7 @@ function getPublicBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8956
8706
|
const totalProtocolFees = baseFeesInSpl + commissionFee;
|
|
8957
8707
|
const netDepositAmount = actualReceived - totalProtocolFees;
|
|
8958
8708
|
if (netDepositAmount <= 0n) {
|
|
8959
|
-
throw new
|
|
8709
|
+
throw new chunkKCHHJKQN_cjs.TransactionError(
|
|
8960
8710
|
`Net deposit amount is zero or negative after fees. Transfer amount: ${String(amount)}, actual received: ${String(actualReceived)}, protocol fees: ${String(totalProtocolFees)}.`
|
|
8961
8711
|
);
|
|
8962
8712
|
}
|
|
@@ -9009,9 +8759,9 @@ function getPublicBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
9009
8759
|
senderPrivateKeyBlindingFactor
|
|
9010
8760
|
);
|
|
9011
8761
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(senderUserCommitment);
|
|
9012
|
-
const randomSecret =
|
|
8762
|
+
const randomSecret = chunkYFUGKMNS_cjs.deriveRandomSecretFromModifiedGenerationIndex(modifiedGenerationIndex);
|
|
9013
8763
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(randomSecret);
|
|
9014
|
-
const nullifier =
|
|
8764
|
+
const nullifier = chunkYFUGKMNS_cjs.deriveNullifierFromModifiedGenerationIndex(modifiedGenerationIndex);
|
|
9015
8765
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(nullifier);
|
|
9016
8766
|
const h2Hash = await h2Generator.generateH2({
|
|
9017
8767
|
amount: toBn254FieldElement4(netDepositAmount),
|
|
@@ -9195,7 +8945,7 @@ function getPublicBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
9195
8945
|
try {
|
|
9196
8946
|
latestBlockhashData = await getLatestBlockhash();
|
|
9197
8947
|
} catch (error) {
|
|
9198
|
-
throw new
|
|
8948
|
+
throw new chunkKCHHJKQN_cjs.RpcError(
|
|
9199
8949
|
`Failed to fetch latest blockhash: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
9200
8950
|
{ cause: error }
|
|
9201
8951
|
);
|
|
@@ -9218,7 +8968,7 @@ function getPublicBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
9218
8968
|
const transaction = kit.compileTransaction(transactionMessage);
|
|
9219
8969
|
const signed = await client.signer.signTransaction(transaction);
|
|
9220
8970
|
if (!isSignedTransaction4(signed)) {
|
|
9221
|
-
throw new
|
|
8971
|
+
throw new chunkKCHHJKQN_cjs.TransactionError(
|
|
9222
8972
|
`${instructionName}: Transaction was not properly signed`
|
|
9223
8973
|
);
|
|
9224
8974
|
}
|
|
@@ -9226,7 +8976,7 @@ function getPublicBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
9226
8976
|
try {
|
|
9227
8977
|
await transactionForwarder.forwardSequentially([signed]);
|
|
9228
8978
|
} catch (error) {
|
|
9229
|
-
throw new
|
|
8979
|
+
throw new chunkKCHHJKQN_cjs.TransactionError(
|
|
9230
8980
|
`${instructionName}: Failed to send transaction: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
9231
8981
|
{ cause: error }
|
|
9232
8982
|
);
|
|
@@ -9320,22 +9070,22 @@ function getPublicBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
9320
9070
|
createUtxoSignature: depositResult.signature
|
|
9321
9071
|
};
|
|
9322
9072
|
} catch (error) {
|
|
9323
|
-
if (error instanceof
|
|
9073
|
+
if (error instanceof chunkKCHHJKQN_cjs.CreateUtxoError) {
|
|
9324
9074
|
throw error;
|
|
9325
9075
|
}
|
|
9326
|
-
if (error instanceof
|
|
9327
|
-
throw new
|
|
9076
|
+
if (error instanceof chunkKCHHJKQN_cjs.TransactionSigningError) {
|
|
9077
|
+
throw new chunkKCHHJKQN_cjs.CreateUtxoError("transaction-sign", error.message, error);
|
|
9328
9078
|
}
|
|
9329
9079
|
if (error instanceof chunkFSK2ICMB_cjs.CryptographyError) {
|
|
9330
|
-
throw new
|
|
9080
|
+
throw new chunkKCHHJKQN_cjs.CreateUtxoError("zk-proof-generation", error.message, error);
|
|
9331
9081
|
}
|
|
9332
|
-
if (error instanceof
|
|
9333
|
-
throw new
|
|
9082
|
+
if (error instanceof chunkKCHHJKQN_cjs.TransactionError) {
|
|
9083
|
+
throw new chunkKCHHJKQN_cjs.CreateUtxoError("transaction-send", error.message, error);
|
|
9334
9084
|
}
|
|
9335
|
-
if (error instanceof
|
|
9336
|
-
throw new
|
|
9085
|
+
if (error instanceof chunkKCHHJKQN_cjs.RpcError) {
|
|
9086
|
+
throw new chunkKCHHJKQN_cjs.CreateUtxoError("account-fetch", error.message, error);
|
|
9337
9087
|
}
|
|
9338
|
-
throw new
|
|
9088
|
+
throw new chunkKCHHJKQN_cjs.CreateUtxoError(
|
|
9339
9089
|
"transaction-send",
|
|
9340
9090
|
error instanceof Error ? error.message : String(error),
|
|
9341
9091
|
error instanceof Error ? error : void 0
|
|
@@ -9376,7 +9126,7 @@ function getEncryptedBalanceQuerierFunction(args, deps) {
|
|
|
9376
9126
|
const { client } = args;
|
|
9377
9127
|
const userAddress = client.signer.address;
|
|
9378
9128
|
const accountInfoProvider = deps?.accountInfoProvider ?? client.accountInfoProvider;
|
|
9379
|
-
const tokenX25519KeypairDeriver =
|
|
9129
|
+
const tokenX25519KeypairDeriver = chunkYFUGKMNS_cjs.getUserAccountX25519KeypairDeriver({
|
|
9380
9130
|
client
|
|
9381
9131
|
});
|
|
9382
9132
|
let cachedDecryptor = null;
|
|
@@ -9389,14 +9139,14 @@ function getEncryptedBalanceQuerierFunction(args, deps) {
|
|
|
9389
9139
|
try {
|
|
9390
9140
|
keypairResult = await tokenX25519KeypairDeriver();
|
|
9391
9141
|
} catch (error) {
|
|
9392
|
-
throw new
|
|
9142
|
+
throw new chunkKCHHJKQN_cjs.QueryError(
|
|
9393
9143
|
"key-derivation",
|
|
9394
9144
|
`Failed to derive X25519 keypair: ${error instanceof Error ? error.message : String(error)}`,
|
|
9395
9145
|
error instanceof Error ? error : void 0
|
|
9396
9146
|
);
|
|
9397
9147
|
}
|
|
9398
9148
|
const x25519PrivateKey = keypairResult.x25519Keypair.privateKey;
|
|
9399
|
-
cachedDecryptor =
|
|
9149
|
+
cachedDecryptor = chunkYFUGKMNS_cjs.getRescueDecryptorFromPrivateKey(x25519PrivateKey, {
|
|
9400
9150
|
umbraX25519PublicKey: client.networkConfig.mxePubkey
|
|
9401
9151
|
});
|
|
9402
9152
|
}
|
|
@@ -9422,7 +9172,7 @@ function getEncryptedBalanceQuerierFunction(args, deps) {
|
|
|
9422
9172
|
}))
|
|
9423
9173
|
);
|
|
9424
9174
|
} catch (error) {
|
|
9425
|
-
throw new
|
|
9175
|
+
throw new chunkKCHHJKQN_cjs.QueryError(
|
|
9426
9176
|
"pda-derivation",
|
|
9427
9177
|
`Failed to derive token account PDAs: ${error instanceof Error ? error.message : String(error)}`,
|
|
9428
9178
|
error instanceof Error ? error : void 0
|
|
@@ -9438,7 +9188,7 @@ function getEncryptedBalanceQuerierFunction(args, deps) {
|
|
|
9438
9188
|
try {
|
|
9439
9189
|
accountMap = await accountInfoProvider(pdas);
|
|
9440
9190
|
} catch (error) {
|
|
9441
|
-
throw new
|
|
9191
|
+
throw new chunkKCHHJKQN_cjs.QueryError(
|
|
9442
9192
|
"account-fetch",
|
|
9443
9193
|
`Failed to fetch token account data: ${error instanceof Error ? error.message : String(error)}`,
|
|
9444
9194
|
error instanceof Error ? error : void 0
|
|
@@ -9456,7 +9206,7 @@ function getEncryptedBalanceQuerierFunction(args, deps) {
|
|
|
9456
9206
|
maybeAccount
|
|
9457
9207
|
);
|
|
9458
9208
|
} catch (error) {
|
|
9459
|
-
throw new
|
|
9209
|
+
throw new chunkKCHHJKQN_cjs.QueryError(
|
|
9460
9210
|
"account-decode",
|
|
9461
9211
|
`Failed to decode token account data for mint ${mint}: ${error instanceof Error ? error.message : String(error)}`,
|
|
9462
9212
|
error instanceof Error ? error : void 0
|
|
@@ -9478,7 +9228,7 @@ function getEncryptedBalanceQuerierFunction(args, deps) {
|
|
|
9478
9228
|
try {
|
|
9479
9229
|
plaintexts = await rcDecryptor([balanceCiphertext], nonce);
|
|
9480
9230
|
} catch (error) {
|
|
9481
|
-
throw new
|
|
9231
|
+
throw new chunkKCHHJKQN_cjs.QueryError(
|
|
9482
9232
|
"decryption",
|
|
9483
9233
|
`Failed to decrypt balance for mint ${mint}: ${error instanceof Error ? error.message : String(error)}`,
|
|
9484
9234
|
error instanceof Error ? error : void 0
|
|
@@ -9544,7 +9294,7 @@ function getUserAccountQuerierFunction(args, deps) {
|
|
|
9544
9294
|
try {
|
|
9545
9295
|
userAccountPda = await chunkUEI7SYH6_cjs.findEncryptedUserAccountPda(userAddress, umbraProgram);
|
|
9546
9296
|
} catch (error) {
|
|
9547
|
-
throw new
|
|
9297
|
+
throw new chunkKCHHJKQN_cjs.QueryError(
|
|
9548
9298
|
"pda-derivation",
|
|
9549
9299
|
`Failed to derive user account PDA: ${error instanceof Error ? error.message : String(error)}`,
|
|
9550
9300
|
error instanceof Error ? error : void 0
|
|
@@ -9554,7 +9304,7 @@ function getUserAccountQuerierFunction(args, deps) {
|
|
|
9554
9304
|
try {
|
|
9555
9305
|
accountMap = await accountInfoProvider([userAccountPda], { commitment: accountInfoCommitment });
|
|
9556
9306
|
} catch (error) {
|
|
9557
|
-
throw new
|
|
9307
|
+
throw new chunkKCHHJKQN_cjs.QueryError(
|
|
9558
9308
|
"account-fetch",
|
|
9559
9309
|
`Failed to fetch user account data: ${error instanceof Error ? error.message : String(error)}`,
|
|
9560
9310
|
error instanceof Error ? error : void 0
|
|
@@ -9571,7 +9321,7 @@ function getUserAccountQuerierFunction(args, deps) {
|
|
|
9571
9321
|
);
|
|
9572
9322
|
sdkAccount = convertToSdkTypes(decodedAccount.data);
|
|
9573
9323
|
} catch (error) {
|
|
9574
|
-
throw new
|
|
9324
|
+
throw new chunkKCHHJKQN_cjs.QueryError(
|
|
9575
9325
|
"account-decode",
|
|
9576
9326
|
`Failed to decode user account data: ${error instanceof Error ? error.message : String(error)}`,
|
|
9577
9327
|
error instanceof Error ? error : void 0
|
|
@@ -9590,7 +9340,7 @@ function getStagedSolRecovererFunction(args, deps) {
|
|
|
9590
9340
|
return /* @__PURE__ */ chunkPK6SKIKE_cjs.__name(async function claimStagedSolFromPool(mint, amount, destination, optionalData, callbacks) {
|
|
9591
9341
|
const userAddress = signer.address;
|
|
9592
9342
|
if (amount === 0n) {
|
|
9593
|
-
throw new
|
|
9343
|
+
throw new chunkKCHHJKQN_cjs.TransactionError("amount must be greater than zero");
|
|
9594
9344
|
}
|
|
9595
9345
|
const noopSigner = kit.createNoopSigner(userAddress);
|
|
9596
9346
|
const instruction = await umbraCodama.getClaimStagedSolFromPoolInstructionAsync({
|
|
@@ -9629,7 +9379,7 @@ function getStagedSplRecovererFunction(args, deps) {
|
|
|
9629
9379
|
return /* @__PURE__ */ chunkPK6SKIKE_cjs.__name(async function claimStagedSplFromPool(mint, amount, destinationAta, optionalData, callbacks) {
|
|
9630
9380
|
const userAddress = signer.address;
|
|
9631
9381
|
if (amount === 0n) {
|
|
9632
|
-
throw new
|
|
9382
|
+
throw new chunkKCHHJKQN_cjs.TransactionError("amount must be greater than zero");
|
|
9633
9383
|
}
|
|
9634
9384
|
const noopSigner = kit.createNoopSigner(userAddress);
|
|
9635
9385
|
const instruction = await umbraCodama.getClaimStagedSplFromPoolInstructionAsync({
|
|
@@ -9667,28 +9417,28 @@ function getUserRegistrationFunction(args, deps) {
|
|
|
9667
9417
|
const accountInfoProvider = deps?.rpc?.accountInfoProvider ?? client.accountInfoProvider;
|
|
9668
9418
|
const getLatestBlockhash = deps?.rpc?.blockhashProvider ?? client.blockhashProvider;
|
|
9669
9419
|
const transactionForwarder = deps?.rpc?.transactionForwarder ?? client.transactionForwarder;
|
|
9670
|
-
const userAccountX25519KeypairDeriver = deps?.keys?.userAccountX25519KeypairDeriver ??
|
|
9671
|
-
const masterViewingKeyEncryptingX25519KeypairDeriver = deps?.keys?.masterViewingKeyEncryptingX25519KeypairDeriver ??
|
|
9672
|
-
const masterViewingKeyGenerator = deps?.keys?.masterViewingKeyGenerator ??
|
|
9673
|
-
const masterViewingKeyBlindingFactorGenerator = deps?.keys?.masterViewingKeyBlindingFactorGenerator ??
|
|
9674
|
-
const poseidonPrivateKeyGenerator = deps?.keys?.poseidonPrivateKeyGenerator ??
|
|
9675
|
-
const poseidonBlindingFactorGenerator = deps?.keys?.poseidonBlindingFactorGenerator ??
|
|
9676
|
-
const rescueCommitmentBlindingFactorGenerator = deps?.crypto?.rescueCommitmentBlindingFactorGenerator ??
|
|
9420
|
+
const userAccountX25519KeypairDeriver = deps?.keys?.userAccountX25519KeypairDeriver ?? chunkYFUGKMNS_cjs.getUserAccountX25519KeypairDeriver({ client });
|
|
9421
|
+
const masterViewingKeyEncryptingX25519KeypairDeriver = deps?.keys?.masterViewingKeyEncryptingX25519KeypairDeriver ?? chunkYFUGKMNS_cjs.getMasterViewingKeyX25519KeypairDeriver({ client });
|
|
9422
|
+
const masterViewingKeyGenerator = deps?.keys?.masterViewingKeyGenerator ?? chunkYFUGKMNS_cjs.getMasterViewingKeyDeriver({ client });
|
|
9423
|
+
const masterViewingKeyBlindingFactorGenerator = deps?.keys?.masterViewingKeyBlindingFactorGenerator ?? chunkYFUGKMNS_cjs.getMasterViewingKeyBlindingFactorDeriver({ client });
|
|
9424
|
+
const poseidonPrivateKeyGenerator = deps?.keys?.poseidonPrivateKeyGenerator ?? chunkYFUGKMNS_cjs.getPoseidonPrivateKeyDeriver({ client });
|
|
9425
|
+
const poseidonBlindingFactorGenerator = deps?.keys?.poseidonBlindingFactorGenerator ?? chunkYFUGKMNS_cjs.getPoseidonBlindingFactorDeriver({ client });
|
|
9426
|
+
const rescueCommitmentBlindingFactorGenerator = deps?.crypto?.rescueCommitmentBlindingFactorGenerator ?? chunkYFUGKMNS_cjs.getRescueCommitmentBlindingFactorDeriver({
|
|
9677
9427
|
client
|
|
9678
9428
|
});
|
|
9679
|
-
const randomFactorGenerator = deps?.crypto?.randomFactorGenerator ??
|
|
9680
|
-
const getRcKeyGenerator = deps?.crypto?.getRcKeyGenerator ?? ((pk) =>
|
|
9429
|
+
const randomFactorGenerator = deps?.crypto?.randomFactorGenerator ?? chunkYFUGKMNS_cjs.getPolynomialCommitmentFactorDeriver({ client });
|
|
9430
|
+
const getRcKeyGenerator = deps?.crypto?.getRcKeyGenerator ?? ((pk) => chunkYFUGKMNS_cjs.getRescueKeyGeneratorFromPrivateKey(pk, {
|
|
9681
9431
|
umbraX25519PublicKey: client.networkConfig.mxePubkey
|
|
9682
9432
|
}));
|
|
9683
|
-
const getRcEncryptor = deps?.crypto?.getRcEncryptor ?? ((pk) =>
|
|
9433
|
+
const getRcEncryptor = deps?.crypto?.getRcEncryptor ?? ((pk) => chunkYFUGKMNS_cjs.getRescueEncryptorWithNonceFromPrivateKey(pk, {
|
|
9684
9434
|
umbraX25519PublicKey: client.networkConfig.mxePubkey
|
|
9685
9435
|
}));
|
|
9686
|
-
const rescueCommitmentGenerator = deps?.crypto?.rescueCommitmentGenerator ??
|
|
9687
|
-
const userCommitmentGenerator = deps?.crypto?.userCommitmentGenerator ??
|
|
9688
|
-
const fiatShamirChallengeGenerator = deps?.crypto?.fiatShamirChallengeGenerator ??
|
|
9689
|
-
const challengePowersFunction = deps?.crypto?.challengePowersFunction ??
|
|
9690
|
-
const polynomialEvaluator = deps?.crypto?.polynomialEvaluator ??
|
|
9691
|
-
const poseidonAggregator = deps?.crypto?.poseidonAggregator ??
|
|
9436
|
+
const rescueCommitmentGenerator = deps?.crypto?.rescueCommitmentGenerator ?? chunkYFUGKMNS_cjs.getRescueCommitmentGenerator();
|
|
9437
|
+
const userCommitmentGenerator = deps?.crypto?.userCommitmentGenerator ?? chunkYFUGKMNS_cjs.getUserCommitmentGeneratorFunction();
|
|
9438
|
+
const fiatShamirChallengeGenerator = deps?.crypto?.fiatShamirChallengeGenerator ?? chunkYFUGKMNS_cjs.getFiatShamirChallengeGeneratorFunction();
|
|
9439
|
+
const challengePowersFunction = deps?.crypto?.challengePowersFunction ?? chunkYFUGKMNS_cjs.getChallengePowersFunction();
|
|
9440
|
+
const polynomialEvaluator = deps?.crypto?.polynomialEvaluator ?? chunkYFUGKMNS_cjs.getPolynomialEvaluatorFunction();
|
|
9441
|
+
const poseidonAggregator = deps?.crypto?.poseidonAggregator ?? chunkYFUGKMNS_cjs.getPoseidonAggregator();
|
|
9692
9442
|
const bn254ModuleInverter = deps?.crypto?.bn254ModInverter ?? chunkY55PYKXH_cjs.getBn254ModularInverter();
|
|
9693
9443
|
const computeLimbwiseSumInverse = deps?.crypto?.computeLimbwiseSumInverse ?? chunkY55PYKXH_cjs.computeBn254LimbwiseSumInverse;
|
|
9694
9444
|
const zkProver = deps?.zkProver;
|
|
@@ -10256,25 +10006,25 @@ function getUserRegistrationFunction(args, deps) {
|
|
|
10256
10006
|
}
|
|
10257
10007
|
return signatures;
|
|
10258
10008
|
} catch (error) {
|
|
10259
|
-
if (error instanceof
|
|
10009
|
+
if (error instanceof chunkKCHHJKQN_cjs.RegistrationError) {
|
|
10260
10010
|
throw error;
|
|
10261
10011
|
}
|
|
10262
|
-
if (error instanceof
|
|
10263
|
-
throw new
|
|
10012
|
+
if (error instanceof chunkKCHHJKQN_cjs.MasterSeedSigningRejectedError) {
|
|
10013
|
+
throw new chunkKCHHJKQN_cjs.RegistrationError("master-seed-derivation", error.message, error);
|
|
10264
10014
|
}
|
|
10265
|
-
if (error instanceof
|
|
10266
|
-
throw new
|
|
10015
|
+
if (error instanceof chunkKCHHJKQN_cjs.TransactionSigningError) {
|
|
10016
|
+
throw new chunkKCHHJKQN_cjs.RegistrationError("transaction-sign", error.message, error);
|
|
10267
10017
|
}
|
|
10268
10018
|
if (error instanceof chunkFSK2ICMB_cjs.CryptographyError) {
|
|
10269
|
-
throw new
|
|
10019
|
+
throw new chunkKCHHJKQN_cjs.RegistrationError("zk-proof-generation", error.message, error);
|
|
10270
10020
|
}
|
|
10271
|
-
if (error instanceof
|
|
10272
|
-
throw new
|
|
10021
|
+
if (error instanceof chunkKCHHJKQN_cjs.TransactionError) {
|
|
10022
|
+
throw new chunkKCHHJKQN_cjs.RegistrationError("transaction-send", error.message, error);
|
|
10273
10023
|
}
|
|
10274
|
-
if (error instanceof
|
|
10275
|
-
throw new
|
|
10024
|
+
if (error instanceof chunkKCHHJKQN_cjs.RpcError) {
|
|
10025
|
+
throw new chunkKCHHJKQN_cjs.RegistrationError("account-fetch", error.message, error);
|
|
10276
10026
|
}
|
|
10277
|
-
throw new
|
|
10027
|
+
throw new chunkKCHHJKQN_cjs.RegistrationError(
|
|
10278
10028
|
"transaction-send",
|
|
10279
10029
|
error instanceof Error ? error.message : String(error),
|
|
10280
10030
|
error instanceof Error ? error : void 0
|
|
@@ -10304,10 +10054,10 @@ function getUserEntropySeedRotatorFunction(args, deps) {
|
|
|
10304
10054
|
return /* @__PURE__ */ chunkPK6SKIKE_cjs.__name(async function updateRandomGenerationSeed(newSeed, optionalData, callbacks) {
|
|
10305
10055
|
const userAddress = signer.address;
|
|
10306
10056
|
if (newSeed.length !== 32) {
|
|
10307
|
-
throw new
|
|
10057
|
+
throw new chunkKCHHJKQN_cjs.TransactionError("newSeed must be exactly 32 bytes");
|
|
10308
10058
|
}
|
|
10309
10059
|
if (newSeed.every((b) => b === 0)) {
|
|
10310
|
-
throw new
|
|
10060
|
+
throw new chunkKCHHJKQN_cjs.TransactionError("newSeed must not be all zeros");
|
|
10311
10061
|
}
|
|
10312
10062
|
const noopSigner = kit.createNoopSigner(userAddress);
|
|
10313
10063
|
const instruction = await umbraCodama.getUpdateRandomGenerationSeedInstructionAsync({
|
|
@@ -10344,10 +10094,10 @@ function getTokenEntropySeedRotatorFunction(args, deps) {
|
|
|
10344
10094
|
return /* @__PURE__ */ chunkPK6SKIKE_cjs.__name(async function updateTokenAccountRandomGenerationSeed(mint, newSeed, optionalData, callbacks) {
|
|
10345
10095
|
const userAddress = signer.address;
|
|
10346
10096
|
if (newSeed.length !== 32) {
|
|
10347
|
-
throw new
|
|
10097
|
+
throw new chunkKCHHJKQN_cjs.TransactionError("newSeed must be exactly 32 bytes");
|
|
10348
10098
|
}
|
|
10349
10099
|
if (newSeed.every((b) => b === 0)) {
|
|
10350
|
-
throw new
|
|
10100
|
+
throw new chunkKCHHJKQN_cjs.TransactionError("newSeed must not be all zeros");
|
|
10351
10101
|
}
|
|
10352
10102
|
const noopSigner = kit.createNoopSigner(userAddress);
|
|
10353
10103
|
const instruction = await umbraCodama.getUpdateTokenAccountRandomGenerationSeedInstructionAsync({
|
|
@@ -10378,22 +10128,22 @@ function getTokenEntropySeedRotatorFunction(args, deps) {
|
|
|
10378
10128
|
chunkPK6SKIKE_cjs.__name(getTokenEntropySeedRotatorFunction, "getTokenEntropySeedRotatorFunction");
|
|
10379
10129
|
function assertValidClient(client) {
|
|
10380
10130
|
if (client === void 0 || client === null) {
|
|
10381
|
-
throw new
|
|
10131
|
+
throw new chunkKCHHJKQN_cjs.EncryptedWithdrawalError("initialization", "client is required");
|
|
10382
10132
|
}
|
|
10383
10133
|
}
|
|
10384
10134
|
chunkPK6SKIKE_cjs.__name(assertValidClient, "assertValidClient");
|
|
10385
10135
|
function assertValidSigner(signer) {
|
|
10386
10136
|
if (signer === void 0 || signer === null) {
|
|
10387
|
-
throw new
|
|
10137
|
+
throw new chunkKCHHJKQN_cjs.EncryptedWithdrawalError("initialization", "client.signer is required");
|
|
10388
10138
|
}
|
|
10389
10139
|
if (typeof signer.address !== "string" || signer.address.trim().length === 0) {
|
|
10390
|
-
throw new
|
|
10140
|
+
throw new chunkKCHHJKQN_cjs.EncryptedWithdrawalError(
|
|
10391
10141
|
"initialization",
|
|
10392
10142
|
"client.signer.address must be a non-empty string"
|
|
10393
10143
|
);
|
|
10394
10144
|
}
|
|
10395
10145
|
if (typeof signer.signTransaction !== "function") {
|
|
10396
|
-
throw new
|
|
10146
|
+
throw new chunkKCHHJKQN_cjs.EncryptedWithdrawalError(
|
|
10397
10147
|
"initialization",
|
|
10398
10148
|
"client.signer.signTransaction must be a function"
|
|
10399
10149
|
);
|
|
@@ -10402,16 +10152,16 @@ function assertValidSigner(signer) {
|
|
|
10402
10152
|
chunkPK6SKIKE_cjs.__name(assertValidSigner, "assertValidSigner");
|
|
10403
10153
|
function assertValidBlockhashProvider(provider) {
|
|
10404
10154
|
if (typeof provider !== "function") {
|
|
10405
|
-
throw new
|
|
10155
|
+
throw new chunkKCHHJKQN_cjs.EncryptedWithdrawalError("initialization", "getLatestBlockhash must be a function");
|
|
10406
10156
|
}
|
|
10407
10157
|
}
|
|
10408
10158
|
chunkPK6SKIKE_cjs.__name(assertValidBlockhashProvider, "assertValidBlockhashProvider");
|
|
10409
10159
|
function assertValidTransactionForwarder(forwarder) {
|
|
10410
10160
|
if (forwarder === void 0 || forwarder === null) {
|
|
10411
|
-
throw new
|
|
10161
|
+
throw new chunkKCHHJKQN_cjs.EncryptedWithdrawalError("initialization", "transactionForwarder is required");
|
|
10412
10162
|
}
|
|
10413
10163
|
if (typeof forwarder.forwardSequentially !== "function") {
|
|
10414
|
-
throw new
|
|
10164
|
+
throw new chunkKCHHJKQN_cjs.EncryptedWithdrawalError(
|
|
10415
10165
|
"initialization",
|
|
10416
10166
|
"transactionForwarder.forwardSequentially must be a function"
|
|
10417
10167
|
);
|
|
@@ -10420,7 +10170,7 @@ function assertValidTransactionForwarder(forwarder) {
|
|
|
10420
10170
|
chunkPK6SKIKE_cjs.__name(assertValidTransactionForwarder, "assertValidTransactionForwarder");
|
|
10421
10171
|
function assertValidAddress(address, name) {
|
|
10422
10172
|
if (typeof address !== "string" || address.trim().length === 0) {
|
|
10423
|
-
throw new
|
|
10173
|
+
throw new chunkKCHHJKQN_cjs.EncryptedWithdrawalError("validation", `Invalid ${name}: must be a non-empty string`);
|
|
10424
10174
|
}
|
|
10425
10175
|
}
|
|
10426
10176
|
chunkPK6SKIKE_cjs.__name(assertValidAddress, "assertValidAddress");
|
|
@@ -10436,7 +10186,7 @@ function assertValidArciumAccounts(accounts) {
|
|
|
10436
10186
|
for (const accountName of requiredAccounts) {
|
|
10437
10187
|
const account = accounts[accountName];
|
|
10438
10188
|
if (typeof account !== "string" || account.trim().length === 0) {
|
|
10439
|
-
throw new
|
|
10189
|
+
throw new chunkKCHHJKQN_cjs.EncryptedWithdrawalError(
|
|
10440
10190
|
"pda-derivation",
|
|
10441
10191
|
`Failed to derive ${accountName}: account address is invalid`
|
|
10442
10192
|
);
|
|
@@ -10477,6 +10227,7 @@ function getEncryptedBalanceToPublicBalanceDirectWithdrawerFunction(args, deps)
|
|
|
10477
10227
|
if ("callbackResult" in result) {
|
|
10478
10228
|
return {
|
|
10479
10229
|
queueSignature: result.signature,
|
|
10230
|
+
callbackStatus: result.callbackResult.status,
|
|
10480
10231
|
callbackSignature: "callbackSignature" in result.callbackResult ? result.callbackResult.callbackSignature : void 0,
|
|
10481
10232
|
callbackElapsedMs: result.callbackResult.elapsedMs,
|
|
10482
10233
|
rentClaimSignature: result.rentClaimSignature,
|
|
@@ -10485,10 +10236,10 @@ function getEncryptedBalanceToPublicBalanceDirectWithdrawerFunction(args, deps)
|
|
|
10485
10236
|
}
|
|
10486
10237
|
return { queueSignature: result.signature };
|
|
10487
10238
|
} catch (error) {
|
|
10488
|
-
if (error instanceof
|
|
10239
|
+
if (error instanceof chunkKCHHJKQN_cjs.EncryptedWithdrawalError) {
|
|
10489
10240
|
throw error;
|
|
10490
10241
|
}
|
|
10491
|
-
throw new
|
|
10242
|
+
throw new chunkKCHHJKQN_cjs.EncryptedWithdrawalError(
|
|
10492
10243
|
"transaction-send",
|
|
10493
10244
|
`Transaction execution failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
10494
10245
|
error instanceof Error ? error : void 0
|
|
@@ -10505,17 +10256,17 @@ function getEncryptedBalanceToPublicBalanceDirectWithdrawerFunction(args, deps)
|
|
|
10505
10256
|
assertValidAddress(mint, "mint");
|
|
10506
10257
|
chunkLTCKPTZC_cjs.assertU64(withdrawalAmount);
|
|
10507
10258
|
if (withdrawalAmount <= 0n) {
|
|
10508
|
-
throw new
|
|
10259
|
+
throw new chunkKCHHJKQN_cjs.EncryptedWithdrawalError(
|
|
10509
10260
|
"validation",
|
|
10510
10261
|
"Invalid withdrawalAmount: must be greater than zero"
|
|
10511
10262
|
);
|
|
10512
10263
|
}
|
|
10513
10264
|
chunkLTCKPTZC_cjs.assertOptionalData32(optionalData, "optionalData");
|
|
10514
10265
|
} catch (error) {
|
|
10515
|
-
if (error instanceof
|
|
10266
|
+
if (error instanceof chunkKCHHJKQN_cjs.EncryptedWithdrawalError) {
|
|
10516
10267
|
throw error;
|
|
10517
10268
|
}
|
|
10518
|
-
throw new
|
|
10269
|
+
throw new chunkKCHHJKQN_cjs.EncryptedWithdrawalError(
|
|
10519
10270
|
"validation",
|
|
10520
10271
|
error instanceof Error ? error.message : String(error),
|
|
10521
10272
|
error instanceof Error ? error : void 0
|
|
@@ -10527,11 +10278,11 @@ function getEncryptedBalanceToPublicBalanceDirectWithdrawerFunction(args, deps)
|
|
|
10527
10278
|
const mintAccountMap = await accountInfoProvider([mint, client.networkConfig.mxeAccountAddress], { commitment: accountInfoCommitment });
|
|
10528
10279
|
const mintAccount = mintAccountMap.get(mint);
|
|
10529
10280
|
if (mintAccount?.exists !== true) {
|
|
10530
|
-
throw new
|
|
10281
|
+
throw new chunkKCHHJKQN_cjs.EncryptedWithdrawalError("mint-fetch", `Mint account not found: ${mint}`);
|
|
10531
10282
|
}
|
|
10532
10283
|
const mintOwner = mintAccount.programAddress;
|
|
10533
10284
|
if (mintOwner !== chunk43JEHY7D_cjs.SPL_TOKEN_PROGRAM_ID && mintOwner !== chunk43JEHY7D_cjs.TOKEN_2022_PROGRAM_ID) {
|
|
10534
|
-
throw new
|
|
10285
|
+
throw new chunkKCHHJKQN_cjs.EncryptedWithdrawalError(
|
|
10535
10286
|
"mint-fetch",
|
|
10536
10287
|
`Unknown token program: ${mintOwner}. Expected SPL Token (${chunk43JEHY7D_cjs.SPL_TOKEN_PROGRAM_ID}) or Token-2022 (${chunk43JEHY7D_cjs.TOKEN_2022_PROGRAM_ID})`
|
|
10537
10288
|
);
|
|
@@ -10541,10 +10292,10 @@ function getEncryptedBalanceToPublicBalanceDirectWithdrawerFunction(args, deps)
|
|
|
10541
10292
|
mintAccountMap.get(client.networkConfig.mxeAccountAddress)
|
|
10542
10293
|
);
|
|
10543
10294
|
} catch (error) {
|
|
10544
|
-
if (error instanceof
|
|
10295
|
+
if (error instanceof chunkKCHHJKQN_cjs.EncryptedWithdrawalError) {
|
|
10545
10296
|
throw error;
|
|
10546
10297
|
}
|
|
10547
|
-
throw new
|
|
10298
|
+
throw new chunkKCHHJKQN_cjs.EncryptedWithdrawalError(
|
|
10548
10299
|
"mint-fetch",
|
|
10549
10300
|
`Failed to fetch mint account: ${error instanceof Error ? error.message : String(error)}`,
|
|
10550
10301
|
error instanceof Error ? error : void 0
|
|
@@ -10561,7 +10312,7 @@ function getEncryptedBalanceToPublicBalanceDirectWithdrawerFunction(args, deps)
|
|
|
10561
10312
|
"withdraw_from_shared_balance_into_public_balance_v11"
|
|
10562
10313
|
);
|
|
10563
10314
|
} catch (error) {
|
|
10564
|
-
throw new
|
|
10315
|
+
throw new chunkKCHHJKQN_cjs.EncryptedWithdrawalError(
|
|
10565
10316
|
"pda-derivation",
|
|
10566
10317
|
`Failed to get Arcium account addresses: ${error instanceof Error ? error.message : String(error)}`,
|
|
10567
10318
|
error instanceof Error ? error : void 0
|
|
@@ -10609,17 +10360,17 @@ function getEncryptedBalanceToPublicBalanceDirectWithdrawerFunction(args, deps)
|
|
|
10609
10360
|
...feeSlabResultToInstructionFields(protocolFeeConfig)
|
|
10610
10361
|
}, { programAddress: client.networkConfig.programId });
|
|
10611
10362
|
} catch (error) {
|
|
10612
|
-
if (error instanceof
|
|
10363
|
+
if (error instanceof chunkKCHHJKQN_cjs.EncryptedWithdrawalError) {
|
|
10613
10364
|
throw error;
|
|
10614
10365
|
}
|
|
10615
|
-
throw new
|
|
10366
|
+
throw new chunkKCHHJKQN_cjs.EncryptedWithdrawalError(
|
|
10616
10367
|
"instruction-build",
|
|
10617
10368
|
`Failed to build withdrawal instruction: ${error instanceof Error ? error.message : String(error)}`,
|
|
10618
10369
|
error instanceof Error ? error : void 0
|
|
10619
10370
|
);
|
|
10620
10371
|
}
|
|
10621
10372
|
if (instruction === void 0 || instruction === null) {
|
|
10622
|
-
throw new
|
|
10373
|
+
throw new chunkKCHHJKQN_cjs.EncryptedWithdrawalError(
|
|
10623
10374
|
"instruction-build",
|
|
10624
10375
|
"getWithdrawFromSharedBalanceIntoPublicBalanceV11InstructionAsync returned null or undefined"
|
|
10625
10376
|
);
|
|
@@ -10651,639 +10402,639 @@ Object.defineProperty(exports, "pollClaimUntilTerminal", {
|
|
|
10651
10402
|
});
|
|
10652
10403
|
Object.defineProperty(exports, "AES_AUTH_TAG_LENGTH", {
|
|
10653
10404
|
enumerable: true,
|
|
10654
|
-
get: function () { return
|
|
10405
|
+
get: function () { return chunkYFUGKMNS_cjs.AES_AUTH_TAG_LENGTH; }
|
|
10655
10406
|
});
|
|
10656
10407
|
Object.defineProperty(exports, "AES_IV_LENGTH", {
|
|
10657
10408
|
enumerable: true,
|
|
10658
|
-
get: function () { return
|
|
10409
|
+
get: function () { return chunkYFUGKMNS_cjs.AES_IV_LENGTH; }
|
|
10659
10410
|
});
|
|
10660
10411
|
Object.defineProperty(exports, "AES_KEY_LENGTH", {
|
|
10661
10412
|
enumerable: true,
|
|
10662
|
-
get: function () { return
|
|
10413
|
+
get: function () { return chunkYFUGKMNS_cjs.AES_KEY_LENGTH; }
|
|
10663
10414
|
});
|
|
10664
10415
|
Object.defineProperty(exports, "AES_METADATA_OVERHEAD", {
|
|
10665
10416
|
enumerable: true,
|
|
10666
|
-
get: function () { return
|
|
10417
|
+
get: function () { return chunkYFUGKMNS_cjs.AES_METADATA_OVERHEAD; }
|
|
10667
10418
|
});
|
|
10668
10419
|
Object.defineProperty(exports, "ALPHA", {
|
|
10669
10420
|
enumerable: true,
|
|
10670
|
-
get: function () { return
|
|
10421
|
+
get: function () { return chunkYFUGKMNS_cjs.ALPHA; }
|
|
10671
10422
|
});
|
|
10672
10423
|
Object.defineProperty(exports, "ALPHA_INVERSE", {
|
|
10673
10424
|
enumerable: true,
|
|
10674
|
-
get: function () { return
|
|
10425
|
+
get: function () { return chunkYFUGKMNS_cjs.ALPHA_INVERSE; }
|
|
10675
10426
|
});
|
|
10676
10427
|
Object.defineProperty(exports, "BASE85_LIMB_MAX", {
|
|
10677
10428
|
enumerable: true,
|
|
10678
|
-
get: function () { return
|
|
10429
|
+
get: function () { return chunkYFUGKMNS_cjs.BASE85_LIMB_MAX; }
|
|
10679
10430
|
});
|
|
10680
10431
|
Object.defineProperty(exports, "BLOCK_SIZE", {
|
|
10681
10432
|
enumerable: true,
|
|
10682
|
-
get: function () { return
|
|
10433
|
+
get: function () { return chunkYFUGKMNS_cjs.BLOCK_SIZE; }
|
|
10683
10434
|
});
|
|
10684
10435
|
Object.defineProperty(exports, "CIPHER_ROUND_COUNT", {
|
|
10685
10436
|
enumerable: true,
|
|
10686
|
-
get: function () { return
|
|
10437
|
+
get: function () { return chunkYFUGKMNS_cjs.CIPHER_ROUND_COUNT; }
|
|
10687
10438
|
});
|
|
10688
10439
|
Object.defineProperty(exports, "FIELD_ELEMENT_BYTE_LENGTH", {
|
|
10689
10440
|
enumerable: true,
|
|
10690
|
-
get: function () { return
|
|
10441
|
+
get: function () { return chunkYFUGKMNS_cjs.FIELD_ELEMENT_BYTE_LENGTH; }
|
|
10691
10442
|
});
|
|
10692
10443
|
Object.defineProperty(exports, "FIELD_PRIME", {
|
|
10693
10444
|
enumerable: true,
|
|
10694
|
-
get: function () { return
|
|
10445
|
+
get: function () { return chunkYFUGKMNS_cjs.FIELD_PRIME; }
|
|
10695
10446
|
});
|
|
10696
10447
|
Object.defineProperty(exports, "GROTH16_G1_BYTE_LENGTH", {
|
|
10697
10448
|
enumerable: true,
|
|
10698
|
-
get: function () { return
|
|
10449
|
+
get: function () { return chunkYFUGKMNS_cjs.GROTH16_G1_BYTE_LENGTH; }
|
|
10699
10450
|
});
|
|
10700
10451
|
Object.defineProperty(exports, "GROTH16_G2_BYTE_LENGTH", {
|
|
10701
10452
|
enumerable: true,
|
|
10702
|
-
get: function () { return
|
|
10453
|
+
get: function () { return chunkYFUGKMNS_cjs.GROTH16_G2_BYTE_LENGTH; }
|
|
10703
10454
|
});
|
|
10704
10455
|
Object.defineProperty(exports, "HASH_CAPACITY", {
|
|
10705
10456
|
enumerable: true,
|
|
10706
|
-
get: function () { return
|
|
10457
|
+
get: function () { return chunkYFUGKMNS_cjs.HASH_CAPACITY; }
|
|
10707
10458
|
});
|
|
10708
10459
|
Object.defineProperty(exports, "HASH_DIGEST_LENGTH", {
|
|
10709
10460
|
enumerable: true,
|
|
10710
|
-
get: function () { return
|
|
10461
|
+
get: function () { return chunkYFUGKMNS_cjs.HASH_DIGEST_LENGTH; }
|
|
10711
10462
|
});
|
|
10712
10463
|
Object.defineProperty(exports, "HASH_RATE", {
|
|
10713
10464
|
enumerable: true,
|
|
10714
|
-
get: function () { return
|
|
10465
|
+
get: function () { return chunkYFUGKMNS_cjs.HASH_RATE; }
|
|
10715
10466
|
});
|
|
10716
10467
|
Object.defineProperty(exports, "HASH_ROUND_COUNT", {
|
|
10717
10468
|
enumerable: true,
|
|
10718
|
-
get: function () { return
|
|
10469
|
+
get: function () { return chunkYFUGKMNS_cjs.HASH_ROUND_COUNT; }
|
|
10719
10470
|
});
|
|
10720
10471
|
Object.defineProperty(exports, "HASH_STATE_SIZE", {
|
|
10721
10472
|
enumerable: true,
|
|
10722
|
-
get: function () { return
|
|
10473
|
+
get: function () { return chunkYFUGKMNS_cjs.HASH_STATE_SIZE; }
|
|
10723
10474
|
});
|
|
10724
10475
|
Object.defineProperty(exports, "MASTER_VIEWING_KEY_MAX", {
|
|
10725
10476
|
enumerable: true,
|
|
10726
|
-
get: function () { return
|
|
10477
|
+
get: function () { return chunkYFUGKMNS_cjs.MASTER_VIEWING_KEY_MAX; }
|
|
10727
10478
|
});
|
|
10728
10479
|
Object.defineProperty(exports, "MAX_AGGREGATOR_INPUTS", {
|
|
10729
10480
|
enumerable: true,
|
|
10730
|
-
get: function () { return
|
|
10481
|
+
get: function () { return chunkYFUGKMNS_cjs.MAX_AGGREGATOR_INPUTS; }
|
|
10731
10482
|
});
|
|
10732
10483
|
Object.defineProperty(exports, "MAX_POSEIDON_INPUTS", {
|
|
10733
10484
|
enumerable: true,
|
|
10734
|
-
get: function () { return
|
|
10485
|
+
get: function () { return chunkYFUGKMNS_cjs.MAX_POSEIDON_INPUTS; }
|
|
10735
10486
|
});
|
|
10736
10487
|
Object.defineProperty(exports, "MAX_PRF_SEEDS", {
|
|
10737
10488
|
enumerable: true,
|
|
10738
|
-
get: function () { return
|
|
10489
|
+
get: function () { return chunkYFUGKMNS_cjs.MAX_PRF_SEEDS; }
|
|
10739
10490
|
});
|
|
10740
10491
|
Object.defineProperty(exports, "NONCE_BYTES", {
|
|
10741
10492
|
enumerable: true,
|
|
10742
|
-
get: function () { return
|
|
10493
|
+
get: function () { return chunkYFUGKMNS_cjs.NONCE_BYTES; }
|
|
10743
10494
|
});
|
|
10744
10495
|
Object.defineProperty(exports, "OPTIONAL_DATA_BYTE_LENGTH", {
|
|
10745
10496
|
enumerable: true,
|
|
10746
|
-
get: function () { return
|
|
10497
|
+
get: function () { return chunkYFUGKMNS_cjs.OPTIONAL_DATA_BYTE_LENGTH; }
|
|
10747
10498
|
});
|
|
10748
10499
|
Object.defineProperty(exports, "PRECOMPUTED_FIELD_INVERSES", {
|
|
10749
10500
|
enumerable: true,
|
|
10750
|
-
get: function () { return
|
|
10501
|
+
get: function () { return chunkYFUGKMNS_cjs.PRECOMPUTED_FIELD_INVERSES; }
|
|
10751
10502
|
});
|
|
10752
10503
|
Object.defineProperty(exports, "REDUCTION_CONST", {
|
|
10753
10504
|
enumerable: true,
|
|
10754
|
-
get: function () { return
|
|
10505
|
+
get: function () { return chunkYFUGKMNS_cjs.REDUCTION_CONST; }
|
|
10755
10506
|
});
|
|
10756
10507
|
Object.defineProperty(exports, "SAMPLE_BUFFER_BYTE_LENGTH", {
|
|
10757
10508
|
enumerable: true,
|
|
10758
|
-
get: function () { return
|
|
10509
|
+
get: function () { return chunkYFUGKMNS_cjs.SAMPLE_BUFFER_BYTE_LENGTH; }
|
|
10759
10510
|
});
|
|
10760
10511
|
Object.defineProperty(exports, "SECRET_BYTES", {
|
|
10761
10512
|
enumerable: true,
|
|
10762
|
-
get: function () { return
|
|
10513
|
+
get: function () { return chunkYFUGKMNS_cjs.SECRET_BYTES; }
|
|
10763
10514
|
});
|
|
10764
10515
|
Object.defineProperty(exports, "SHAKE256_CIPHER_SEED", {
|
|
10765
10516
|
enumerable: true,
|
|
10766
|
-
get: function () { return
|
|
10517
|
+
get: function () { return chunkYFUGKMNS_cjs.SHAKE256_CIPHER_SEED; }
|
|
10767
10518
|
});
|
|
10768
10519
|
Object.defineProperty(exports, "X25519_BYTE_LENGTH", {
|
|
10769
10520
|
enumerable: true,
|
|
10770
|
-
get: function () { return
|
|
10521
|
+
get: function () { return chunkYFUGKMNS_cjs.X25519_BYTE_LENGTH; }
|
|
10771
10522
|
});
|
|
10772
10523
|
Object.defineProperty(exports, "ZK_PROOF_BYTE_LENGTH", {
|
|
10773
10524
|
enumerable: true,
|
|
10774
|
-
get: function () { return
|
|
10525
|
+
get: function () { return chunkYFUGKMNS_cjs.ZK_PROOF_BYTE_LENGTH; }
|
|
10775
10526
|
});
|
|
10776
10527
|
Object.defineProperty(exports, "assertAesCiphertextWithMetadata", {
|
|
10777
10528
|
enumerable: true,
|
|
10778
|
-
get: function () { return
|
|
10529
|
+
get: function () { return chunkYFUGKMNS_cjs.assertAesCiphertextWithMetadata; }
|
|
10779
10530
|
});
|
|
10780
10531
|
Object.defineProperty(exports, "assertAesKey", {
|
|
10781
10532
|
enumerable: true,
|
|
10782
|
-
get: function () { return
|
|
10533
|
+
get: function () { return chunkYFUGKMNS_cjs.assertAesKey; }
|
|
10783
10534
|
});
|
|
10784
10535
|
Object.defineProperty(exports, "assertAesPlaintext", {
|
|
10785
10536
|
enumerable: true,
|
|
10786
|
-
get: function () { return
|
|
10537
|
+
get: function () { return chunkYFUGKMNS_cjs.assertAesPlaintext; }
|
|
10787
10538
|
});
|
|
10788
10539
|
Object.defineProperty(exports, "assertBase85Limb", {
|
|
10789
10540
|
enumerable: true,
|
|
10790
|
-
get: function () { return
|
|
10541
|
+
get: function () { return chunkYFUGKMNS_cjs.assertBase85Limb; }
|
|
10791
10542
|
});
|
|
10792
10543
|
Object.defineProperty(exports, "assertCurve25519KeypairResult", {
|
|
10793
10544
|
enumerable: true,
|
|
10794
|
-
get: function () { return
|
|
10545
|
+
get: function () { return chunkYFUGKMNS_cjs.assertCurve25519KeypairResult; }
|
|
10795
10546
|
});
|
|
10796
10547
|
Object.defineProperty(exports, "assertDailyViewingKey", {
|
|
10797
10548
|
enumerable: true,
|
|
10798
|
-
get: function () { return
|
|
10549
|
+
get: function () { return chunkYFUGKMNS_cjs.assertDailyViewingKey; }
|
|
10799
10550
|
});
|
|
10800
10551
|
Object.defineProperty(exports, "assertEd25519Keypair", {
|
|
10801
10552
|
enumerable: true,
|
|
10802
|
-
get: function () { return
|
|
10553
|
+
get: function () { return chunkYFUGKMNS_cjs.assertEd25519Keypair; }
|
|
10803
10554
|
});
|
|
10804
10555
|
Object.defineProperty(exports, "assertGenerationSeed", {
|
|
10805
10556
|
enumerable: true,
|
|
10806
|
-
get: function () { return
|
|
10557
|
+
get: function () { return chunkYFUGKMNS_cjs.assertGenerationSeed; }
|
|
10807
10558
|
});
|
|
10808
10559
|
Object.defineProperty(exports, "assertGroth16ProofA", {
|
|
10809
10560
|
enumerable: true,
|
|
10810
|
-
get: function () { return
|
|
10561
|
+
get: function () { return chunkYFUGKMNS_cjs.assertGroth16ProofA; }
|
|
10811
10562
|
});
|
|
10812
10563
|
Object.defineProperty(exports, "assertGroth16ProofB", {
|
|
10813
10564
|
enumerable: true,
|
|
10814
|
-
get: function () { return
|
|
10565
|
+
get: function () { return chunkYFUGKMNS_cjs.assertGroth16ProofB; }
|
|
10815
10566
|
});
|
|
10816
10567
|
Object.defineProperty(exports, "assertGroth16ProofC", {
|
|
10817
10568
|
enumerable: true,
|
|
10818
|
-
get: function () { return
|
|
10569
|
+
get: function () { return chunkYFUGKMNS_cjs.assertGroth16ProofC; }
|
|
10819
10570
|
});
|
|
10820
10571
|
Object.defineProperty(exports, "assertHourlyViewingKey", {
|
|
10821
10572
|
enumerable: true,
|
|
10822
|
-
get: function () { return
|
|
10573
|
+
get: function () { return chunkYFUGKMNS_cjs.assertHourlyViewingKey; }
|
|
10823
10574
|
});
|
|
10824
10575
|
Object.defineProperty(exports, "assertKeccak256Hash", {
|
|
10825
10576
|
enumerable: true,
|
|
10826
|
-
get: function () { return
|
|
10577
|
+
get: function () { return chunkYFUGKMNS_cjs.assertKeccak256Hash; }
|
|
10827
10578
|
});
|
|
10828
10579
|
Object.defineProperty(exports, "assertKeccak512Hash", {
|
|
10829
10580
|
enumerable: true,
|
|
10830
|
-
get: function () { return
|
|
10581
|
+
get: function () { return chunkYFUGKMNS_cjs.assertKeccak512Hash; }
|
|
10831
10582
|
});
|
|
10832
10583
|
Object.defineProperty(exports, "assertMasterSeed", {
|
|
10833
10584
|
enumerable: true,
|
|
10834
|
-
get: function () { return
|
|
10585
|
+
get: function () { return chunkYFUGKMNS_cjs.assertMasterSeed; }
|
|
10835
10586
|
});
|
|
10836
10587
|
Object.defineProperty(exports, "assertMasterViewingKey", {
|
|
10837
10588
|
enumerable: true,
|
|
10838
|
-
get: function () { return
|
|
10589
|
+
get: function () { return chunkYFUGKMNS_cjs.assertMasterViewingKey; }
|
|
10839
10590
|
});
|
|
10840
10591
|
Object.defineProperty(exports, "assertMintViewingKey", {
|
|
10841
10592
|
enumerable: true,
|
|
10842
|
-
get: function () { return
|
|
10593
|
+
get: function () { return chunkYFUGKMNS_cjs.assertMintViewingKey; }
|
|
10843
10594
|
});
|
|
10844
10595
|
Object.defineProperty(exports, "assertMinuteViewingKey", {
|
|
10845
10596
|
enumerable: true,
|
|
10846
|
-
get: function () { return
|
|
10597
|
+
get: function () { return chunkYFUGKMNS_cjs.assertMinuteViewingKey; }
|
|
10847
10598
|
});
|
|
10848
10599
|
Object.defineProperty(exports, "assertMonthlyViewingKey", {
|
|
10849
10600
|
enumerable: true,
|
|
10850
|
-
get: function () { return
|
|
10601
|
+
get: function () { return chunkYFUGKMNS_cjs.assertMonthlyViewingKey; }
|
|
10851
10602
|
});
|
|
10852
10603
|
Object.defineProperty(exports, "assertOptionalData32", {
|
|
10853
10604
|
enumerable: true,
|
|
10854
|
-
get: function () { return
|
|
10605
|
+
get: function () { return chunkYFUGKMNS_cjs.assertOptionalData32; }
|
|
10855
10606
|
});
|
|
10856
10607
|
Object.defineProperty(exports, "assertPoseidonCiphertext", {
|
|
10857
10608
|
enumerable: true,
|
|
10858
|
-
get: function () { return
|
|
10609
|
+
get: function () { return chunkYFUGKMNS_cjs.assertPoseidonCiphertext; }
|
|
10859
10610
|
});
|
|
10860
10611
|
Object.defineProperty(exports, "assertPoseidonCounter", {
|
|
10861
10612
|
enumerable: true,
|
|
10862
|
-
get: function () { return
|
|
10613
|
+
get: function () { return chunkYFUGKMNS_cjs.assertPoseidonCounter; }
|
|
10863
10614
|
});
|
|
10864
10615
|
Object.defineProperty(exports, "assertPoseidonHash", {
|
|
10865
10616
|
enumerable: true,
|
|
10866
|
-
get: function () { return
|
|
10617
|
+
get: function () { return chunkYFUGKMNS_cjs.assertPoseidonHash; }
|
|
10867
10618
|
});
|
|
10868
10619
|
Object.defineProperty(exports, "assertPoseidonKey", {
|
|
10869
10620
|
enumerable: true,
|
|
10870
|
-
get: function () { return
|
|
10621
|
+
get: function () { return chunkYFUGKMNS_cjs.assertPoseidonKey; }
|
|
10871
10622
|
});
|
|
10872
10623
|
Object.defineProperty(exports, "assertPoseidonKeystream", {
|
|
10873
10624
|
enumerable: true,
|
|
10874
|
-
get: function () { return
|
|
10625
|
+
get: function () { return chunkYFUGKMNS_cjs.assertPoseidonKeystream; }
|
|
10875
10626
|
});
|
|
10876
10627
|
Object.defineProperty(exports, "assertPoseidonPlaintext", {
|
|
10877
10628
|
enumerable: true,
|
|
10878
|
-
get: function () { return
|
|
10629
|
+
get: function () { return chunkYFUGKMNS_cjs.assertPoseidonPlaintext; }
|
|
10879
10630
|
});
|
|
10880
10631
|
Object.defineProperty(exports, "assertRcCiphertext", {
|
|
10881
10632
|
enumerable: true,
|
|
10882
|
-
get: function () { return
|
|
10633
|
+
get: function () { return chunkYFUGKMNS_cjs.assertRcCiphertext; }
|
|
10883
10634
|
});
|
|
10884
10635
|
Object.defineProperty(exports, "assertRcCounter", {
|
|
10885
10636
|
enumerable: true,
|
|
10886
|
-
get: function () { return
|
|
10637
|
+
get: function () { return chunkYFUGKMNS_cjs.assertRcCounter; }
|
|
10887
10638
|
});
|
|
10888
10639
|
Object.defineProperty(exports, "assertRcEncryptionNonce", {
|
|
10889
10640
|
enumerable: true,
|
|
10890
|
-
get: function () { return
|
|
10641
|
+
get: function () { return chunkYFUGKMNS_cjs.assertRcEncryptionNonce; }
|
|
10891
10642
|
});
|
|
10892
10643
|
Object.defineProperty(exports, "assertRcKey", {
|
|
10893
10644
|
enumerable: true,
|
|
10894
|
-
get: function () { return
|
|
10645
|
+
get: function () { return chunkYFUGKMNS_cjs.assertRcKey; }
|
|
10895
10646
|
});
|
|
10896
10647
|
Object.defineProperty(exports, "assertRcPlaintext", {
|
|
10897
10648
|
enumerable: true,
|
|
10898
|
-
get: function () { return
|
|
10649
|
+
get: function () { return chunkYFUGKMNS_cjs.assertRcPlaintext; }
|
|
10899
10650
|
});
|
|
10900
10651
|
Object.defineProperty(exports, "assertSecondViewingKey", {
|
|
10901
10652
|
enumerable: true,
|
|
10902
|
-
get: function () { return
|
|
10653
|
+
get: function () { return chunkYFUGKMNS_cjs.assertSecondViewingKey; }
|
|
10903
10654
|
});
|
|
10904
10655
|
Object.defineProperty(exports, "assertSharedSecret", {
|
|
10905
10656
|
enumerable: true,
|
|
10906
|
-
get: function () { return
|
|
10657
|
+
get: function () { return chunkYFUGKMNS_cjs.assertSharedSecret; }
|
|
10907
10658
|
});
|
|
10908
10659
|
Object.defineProperty(exports, "assertX25519Bytes", {
|
|
10909
10660
|
enumerable: true,
|
|
10910
|
-
get: function () { return
|
|
10661
|
+
get: function () { return chunkYFUGKMNS_cjs.assertX25519Bytes; }
|
|
10911
10662
|
});
|
|
10912
10663
|
Object.defineProperty(exports, "assertX25519Keypair", {
|
|
10913
10664
|
enumerable: true,
|
|
10914
|
-
get: function () { return
|
|
10665
|
+
get: function () { return chunkYFUGKMNS_cjs.assertX25519Keypair; }
|
|
10915
10666
|
});
|
|
10916
10667
|
Object.defineProperty(exports, "assertX25519PrivateKey", {
|
|
10917
10668
|
enumerable: true,
|
|
10918
|
-
get: function () { return
|
|
10669
|
+
get: function () { return chunkYFUGKMNS_cjs.assertX25519PrivateKey; }
|
|
10919
10670
|
});
|
|
10920
10671
|
Object.defineProperty(exports, "assertX25519PublicKey", {
|
|
10921
10672
|
enumerable: true,
|
|
10922
|
-
get: function () { return
|
|
10673
|
+
get: function () { return chunkYFUGKMNS_cjs.assertX25519PublicKey; }
|
|
10923
10674
|
});
|
|
10924
10675
|
Object.defineProperty(exports, "assertYearlyViewingKey", {
|
|
10925
10676
|
enumerable: true,
|
|
10926
|
-
get: function () { return
|
|
10677
|
+
get: function () { return chunkYFUGKMNS_cjs.assertYearlyViewingKey; }
|
|
10927
10678
|
});
|
|
10928
10679
|
Object.defineProperty(exports, "assertZkProofBytes", {
|
|
10929
10680
|
enumerable: true,
|
|
10930
|
-
get: function () { return
|
|
10681
|
+
get: function () { return chunkYFUGKMNS_cjs.assertZkProofBytes; }
|
|
10931
10682
|
});
|
|
10932
10683
|
Object.defineProperty(exports, "buildPersonalizationString", {
|
|
10933
10684
|
enumerable: true,
|
|
10934
|
-
get: function () { return
|
|
10685
|
+
get: function () { return chunkYFUGKMNS_cjs.buildPersonalizationString; }
|
|
10935
10686
|
});
|
|
10936
10687
|
Object.defineProperty(exports, "defaultAesDecryptor", {
|
|
10937
10688
|
enumerable: true,
|
|
10938
|
-
get: function () { return
|
|
10689
|
+
get: function () { return chunkYFUGKMNS_cjs.defaultAesDecryptor; }
|
|
10939
10690
|
});
|
|
10940
10691
|
Object.defineProperty(exports, "defaultAesEncryptor", {
|
|
10941
10692
|
enumerable: true,
|
|
10942
|
-
get: function () { return
|
|
10693
|
+
get: function () { return chunkYFUGKMNS_cjs.defaultAesEncryptor; }
|
|
10943
10694
|
});
|
|
10944
10695
|
Object.defineProperty(exports, "deriveBn254FieldElementFromKeccak512", {
|
|
10945
10696
|
enumerable: true,
|
|
10946
|
-
get: function () { return
|
|
10697
|
+
get: function () { return chunkYFUGKMNS_cjs.deriveBn254FieldElementFromKeccak512; }
|
|
10947
10698
|
});
|
|
10948
10699
|
Object.defineProperty(exports, "deriveEphemeralMasterViewingKey", {
|
|
10949
10700
|
enumerable: true,
|
|
10950
|
-
get: function () { return
|
|
10701
|
+
get: function () { return chunkYFUGKMNS_cjs.deriveEphemeralMasterViewingKey; }
|
|
10951
10702
|
});
|
|
10952
10703
|
Object.defineProperty(exports, "deriveEphemeralMasterViewingKeyBlindingFactor", {
|
|
10953
10704
|
enumerable: true,
|
|
10954
|
-
get: function () { return
|
|
10705
|
+
get: function () { return chunkYFUGKMNS_cjs.deriveEphemeralMasterViewingKeyBlindingFactor; }
|
|
10955
10706
|
});
|
|
10956
10707
|
Object.defineProperty(exports, "deriveEphemeralPoseidonPrivateKey", {
|
|
10957
10708
|
enumerable: true,
|
|
10958
|
-
get: function () { return
|
|
10709
|
+
get: function () { return chunkYFUGKMNS_cjs.deriveEphemeralPoseidonPrivateKey; }
|
|
10959
10710
|
});
|
|
10960
10711
|
Object.defineProperty(exports, "deriveEphemeralPoseidonPrivateKeyBlindingFactor", {
|
|
10961
10712
|
enumerable: true,
|
|
10962
|
-
get: function () { return
|
|
10713
|
+
get: function () { return chunkYFUGKMNS_cjs.deriveEphemeralPoseidonPrivateKeyBlindingFactor; }
|
|
10963
10714
|
});
|
|
10964
10715
|
Object.defineProperty(exports, "deriveKeystreamBlindingFactor", {
|
|
10965
10716
|
enumerable: true,
|
|
10966
|
-
get: function () { return
|
|
10717
|
+
get: function () { return chunkYFUGKMNS_cjs.deriveKeystreamBlindingFactor; }
|
|
10967
10718
|
});
|
|
10968
10719
|
Object.defineProperty(exports, "deriveModifiedGenerationIndexForReceiverClaim", {
|
|
10969
10720
|
enumerable: true,
|
|
10970
|
-
get: function () { return
|
|
10721
|
+
get: function () { return chunkYFUGKMNS_cjs.deriveModifiedGenerationIndexForReceiverClaim; }
|
|
10971
10722
|
});
|
|
10972
10723
|
Object.defineProperty(exports, "deriveModifiedGenerationIndexForSenderClaim", {
|
|
10973
10724
|
enumerable: true,
|
|
10974
|
-
get: function () { return
|
|
10725
|
+
get: function () { return chunkYFUGKMNS_cjs.deriveModifiedGenerationIndexForSenderClaim; }
|
|
10975
10726
|
});
|
|
10976
10727
|
Object.defineProperty(exports, "deriveNullifierFromModifiedGenerationIndex", {
|
|
10977
10728
|
enumerable: true,
|
|
10978
|
-
get: function () { return
|
|
10729
|
+
get: function () { return chunkYFUGKMNS_cjs.deriveNullifierFromModifiedGenerationIndex; }
|
|
10979
10730
|
});
|
|
10980
10731
|
Object.defineProperty(exports, "deriveProofAccountOffsetFromModifiedGenerationIndex", {
|
|
10981
10732
|
enumerable: true,
|
|
10982
|
-
get: function () { return
|
|
10733
|
+
get: function () { return chunkYFUGKMNS_cjs.deriveProofAccountOffsetFromModifiedGenerationIndex; }
|
|
10983
10734
|
});
|
|
10984
10735
|
Object.defineProperty(exports, "deriveRandomFactorForPolynomialCommitmentFromModifiedGenerationIndex", {
|
|
10985
10736
|
enumerable: true,
|
|
10986
|
-
get: function () { return
|
|
10737
|
+
get: function () { return chunkYFUGKMNS_cjs.deriveRandomFactorForPolynomialCommitmentFromModifiedGenerationIndex; }
|
|
10987
10738
|
});
|
|
10988
10739
|
Object.defineProperty(exports, "deriveRandomSecretFromModifiedGenerationIndex", {
|
|
10989
10740
|
enumerable: true,
|
|
10990
|
-
get: function () { return
|
|
10741
|
+
get: function () { return chunkYFUGKMNS_cjs.deriveRandomSecretFromModifiedGenerationIndex; }
|
|
10991
10742
|
});
|
|
10992
10743
|
Object.defineProperty(exports, "deriveRescueEncryptionCommitmentBlindingFactorFromModifiedGenerationIndex", {
|
|
10993
10744
|
enumerable: true,
|
|
10994
|
-
get: function () { return
|
|
10745
|
+
get: function () { return chunkYFUGKMNS_cjs.deriveRescueEncryptionCommitmentBlindingFactorFromModifiedGenerationIndex; }
|
|
10995
10746
|
});
|
|
10996
10747
|
Object.defineProperty(exports, "expandModifiedGenerationIndex", {
|
|
10997
10748
|
enumerable: true,
|
|
10998
|
-
get: function () { return
|
|
10749
|
+
get: function () { return chunkYFUGKMNS_cjs.expandModifiedGenerationIndex; }
|
|
10999
10750
|
});
|
|
11000
10751
|
Object.defineProperty(exports, "getAesDecryptor", {
|
|
11001
10752
|
enumerable: true,
|
|
11002
|
-
get: function () { return
|
|
10753
|
+
get: function () { return chunkYFUGKMNS_cjs.getAesDecryptor; }
|
|
11003
10754
|
});
|
|
11004
10755
|
Object.defineProperty(exports, "getAesEncryptor", {
|
|
11005
10756
|
enumerable: true,
|
|
11006
|
-
get: function () { return
|
|
10757
|
+
get: function () { return chunkYFUGKMNS_cjs.getAesEncryptor; }
|
|
11007
10758
|
});
|
|
11008
10759
|
Object.defineProperty(exports, "getBn254FieldElementFromKeccak512Deriver", {
|
|
11009
10760
|
enumerable: true,
|
|
11010
|
-
get: function () { return
|
|
10761
|
+
get: function () { return chunkYFUGKMNS_cjs.getBn254FieldElementFromKeccak512Deriver; }
|
|
11011
10762
|
});
|
|
11012
10763
|
Object.defineProperty(exports, "getChallengePowersFunction", {
|
|
11013
10764
|
enumerable: true,
|
|
11014
|
-
get: function () { return
|
|
10765
|
+
get: function () { return chunkYFUGKMNS_cjs.getChallengePowersFunction; }
|
|
11015
10766
|
});
|
|
11016
10767
|
Object.defineProperty(exports, "getDailyViewingKeyDeriver", {
|
|
11017
10768
|
enumerable: true,
|
|
11018
|
-
get: function () { return
|
|
10769
|
+
get: function () { return chunkYFUGKMNS_cjs.getDailyViewingKeyDeriver; }
|
|
11019
10770
|
});
|
|
11020
10771
|
Object.defineProperty(exports, "getEphemeralMasterSeedDeriver", {
|
|
11021
10772
|
enumerable: true,
|
|
11022
|
-
get: function () { return
|
|
10773
|
+
get: function () { return chunkYFUGKMNS_cjs.getEphemeralMasterSeedDeriver; }
|
|
11023
10774
|
});
|
|
11024
10775
|
Object.defineProperty(exports, "getEphemeralRescueCommitmentBlindingFactorDeriver", {
|
|
11025
10776
|
enumerable: true,
|
|
11026
|
-
get: function () { return
|
|
10777
|
+
get: function () { return chunkYFUGKMNS_cjs.getEphemeralRescueCommitmentBlindingFactorDeriver; }
|
|
11027
10778
|
});
|
|
11028
10779
|
Object.defineProperty(exports, "getEphemeralUtxoH2RandomSecretDeriver", {
|
|
11029
10780
|
enumerable: true,
|
|
11030
|
-
get: function () { return
|
|
10781
|
+
get: function () { return chunkYFUGKMNS_cjs.getEphemeralUtxoH2RandomSecretDeriver; }
|
|
11031
10782
|
});
|
|
11032
10783
|
Object.defineProperty(exports, "getEphemeralUtxoMasterViewingKeyBlindingFactorDeriver", {
|
|
11033
10784
|
enumerable: true,
|
|
11034
|
-
get: function () { return
|
|
10785
|
+
get: function () { return chunkYFUGKMNS_cjs.getEphemeralUtxoMasterViewingKeyBlindingFactorDeriver; }
|
|
11035
10786
|
});
|
|
11036
10787
|
Object.defineProperty(exports, "getEphemeralUtxoMasterViewingKeyDeriver", {
|
|
11037
10788
|
enumerable: true,
|
|
11038
|
-
get: function () { return
|
|
10789
|
+
get: function () { return chunkYFUGKMNS_cjs.getEphemeralUtxoMasterViewingKeyDeriver; }
|
|
11039
10790
|
});
|
|
11040
10791
|
Object.defineProperty(exports, "getEphemeralUtxoNullifierDeriver", {
|
|
11041
10792
|
enumerable: true,
|
|
11042
|
-
get: function () { return
|
|
10793
|
+
get: function () { return chunkYFUGKMNS_cjs.getEphemeralUtxoNullifierDeriver; }
|
|
11043
10794
|
});
|
|
11044
10795
|
Object.defineProperty(exports, "getEphemeralUtxoPoseidonPrivateKeyBlindingFactorDeriver", {
|
|
11045
10796
|
enumerable: true,
|
|
11046
|
-
get: function () { return
|
|
10797
|
+
get: function () { return chunkYFUGKMNS_cjs.getEphemeralUtxoPoseidonPrivateKeyBlindingFactorDeriver; }
|
|
11047
10798
|
});
|
|
11048
10799
|
Object.defineProperty(exports, "getEphemeralUtxoPoseidonPrivateKeyDeriver", {
|
|
11049
10800
|
enumerable: true,
|
|
11050
|
-
get: function () { return
|
|
10801
|
+
get: function () { return chunkYFUGKMNS_cjs.getEphemeralUtxoPoseidonPrivateKeyDeriver; }
|
|
11051
10802
|
});
|
|
11052
10803
|
Object.defineProperty(exports, "getFiatShamirChallengeGeneratorFunction", {
|
|
11053
10804
|
enumerable: true,
|
|
11054
|
-
get: function () { return
|
|
10805
|
+
get: function () { return chunkYFUGKMNS_cjs.getFiatShamirChallengeGeneratorFunction; }
|
|
11055
10806
|
});
|
|
11056
10807
|
Object.defineProperty(exports, "getFieldArithmetic", {
|
|
11057
10808
|
enumerable: true,
|
|
11058
|
-
get: function () { return
|
|
10809
|
+
get: function () { return chunkYFUGKMNS_cjs.getFieldArithmetic; }
|
|
11059
10810
|
});
|
|
11060
10811
|
Object.defineProperty(exports, "getHourlyViewingKeyDeriver", {
|
|
11061
10812
|
enumerable: true,
|
|
11062
|
-
get: function () { return
|
|
10813
|
+
get: function () { return chunkYFUGKMNS_cjs.getHourlyViewingKeyDeriver; }
|
|
11063
10814
|
});
|
|
11064
10815
|
Object.defineProperty(exports, "getKeystreamCommitmentGenerator", {
|
|
11065
10816
|
enumerable: true,
|
|
11066
|
-
get: function () { return
|
|
10817
|
+
get: function () { return chunkYFUGKMNS_cjs.getKeystreamCommitmentGenerator; }
|
|
11067
10818
|
});
|
|
11068
10819
|
Object.defineProperty(exports, "getMasterSeedBasedFieldElementDeriver", {
|
|
11069
10820
|
enumerable: true,
|
|
11070
|
-
get: function () { return
|
|
10821
|
+
get: function () { return chunkYFUGKMNS_cjs.getMasterSeedBasedFieldElementDeriver; }
|
|
11071
10822
|
});
|
|
11072
10823
|
Object.defineProperty(exports, "getMasterViewingKeyBlindingFactorDeriver", {
|
|
11073
10824
|
enumerable: true,
|
|
11074
|
-
get: function () { return
|
|
10825
|
+
get: function () { return chunkYFUGKMNS_cjs.getMasterViewingKeyBlindingFactorDeriver; }
|
|
11075
10826
|
});
|
|
11076
10827
|
Object.defineProperty(exports, "getMasterViewingKeyDeriver", {
|
|
11077
10828
|
enumerable: true,
|
|
11078
|
-
get: function () { return
|
|
10829
|
+
get: function () { return chunkYFUGKMNS_cjs.getMasterViewingKeyDeriver; }
|
|
11079
10830
|
});
|
|
11080
10831
|
Object.defineProperty(exports, "getMasterViewingKeyX25519KeypairDeriver", {
|
|
11081
10832
|
enumerable: true,
|
|
11082
|
-
get: function () { return
|
|
10833
|
+
get: function () { return chunkYFUGKMNS_cjs.getMasterViewingKeyX25519KeypairDeriver; }
|
|
11083
10834
|
});
|
|
11084
10835
|
Object.defineProperty(exports, "getMintViewingKeyDeriver", {
|
|
11085
10836
|
enumerable: true,
|
|
11086
|
-
get: function () { return
|
|
10837
|
+
get: function () { return chunkYFUGKMNS_cjs.getMintViewingKeyDeriver; }
|
|
11087
10838
|
});
|
|
11088
10839
|
Object.defineProperty(exports, "getMintX25519KeypairDeriver", {
|
|
11089
10840
|
enumerable: true,
|
|
11090
|
-
get: function () { return
|
|
10841
|
+
get: function () { return chunkYFUGKMNS_cjs.getMintX25519KeypairDeriver; }
|
|
11091
10842
|
});
|
|
11092
10843
|
Object.defineProperty(exports, "getMinuteViewingKeyDeriver", {
|
|
11093
10844
|
enumerable: true,
|
|
11094
|
-
get: function () { return
|
|
10845
|
+
get: function () { return chunkYFUGKMNS_cjs.getMinuteViewingKeyDeriver; }
|
|
11095
10846
|
});
|
|
11096
10847
|
Object.defineProperty(exports, "getModuloPowCurve25519Function", {
|
|
11097
10848
|
enumerable: true,
|
|
11098
|
-
get: function () { return
|
|
10849
|
+
get: function () { return chunkYFUGKMNS_cjs.getModuloPowCurve25519Function; }
|
|
11099
10850
|
});
|
|
11100
10851
|
Object.defineProperty(exports, "getMonthlyViewingKeyDeriver", {
|
|
11101
10852
|
enumerable: true,
|
|
11102
|
-
get: function () { return
|
|
10853
|
+
get: function () { return chunkYFUGKMNS_cjs.getMonthlyViewingKeyDeriver; }
|
|
11103
10854
|
});
|
|
11104
10855
|
Object.defineProperty(exports, "getPersonalizationStringBuilder", {
|
|
11105
10856
|
enumerable: true,
|
|
11106
|
-
get: function () { return
|
|
10857
|
+
get: function () { return chunkYFUGKMNS_cjs.getPersonalizationStringBuilder; }
|
|
11107
10858
|
});
|
|
11108
10859
|
Object.defineProperty(exports, "getPolynomialCommitmentFactorDeriver", {
|
|
11109
10860
|
enumerable: true,
|
|
11110
|
-
get: function () { return
|
|
10861
|
+
get: function () { return chunkYFUGKMNS_cjs.getPolynomialCommitmentFactorDeriver; }
|
|
11111
10862
|
});
|
|
11112
10863
|
Object.defineProperty(exports, "getPolynomialEvaluatorFunction", {
|
|
11113
10864
|
enumerable: true,
|
|
11114
|
-
get: function () { return
|
|
10865
|
+
get: function () { return chunkYFUGKMNS_cjs.getPolynomialEvaluatorFunction; }
|
|
11115
10866
|
});
|
|
11116
10867
|
Object.defineProperty(exports, "getPoseidonAggregator", {
|
|
11117
10868
|
enumerable: true,
|
|
11118
|
-
get: function () { return
|
|
10869
|
+
get: function () { return chunkYFUGKMNS_cjs.getPoseidonAggregator; }
|
|
11119
10870
|
});
|
|
11120
10871
|
Object.defineProperty(exports, "getPoseidonBlindingFactorDeriver", {
|
|
11121
10872
|
enumerable: true,
|
|
11122
|
-
get: function () { return
|
|
10873
|
+
get: function () { return chunkYFUGKMNS_cjs.getPoseidonBlindingFactorDeriver; }
|
|
11123
10874
|
});
|
|
11124
10875
|
Object.defineProperty(exports, "getPoseidonDecryptor", {
|
|
11125
10876
|
enumerable: true,
|
|
11126
|
-
get: function () { return
|
|
10877
|
+
get: function () { return chunkYFUGKMNS_cjs.getPoseidonDecryptor; }
|
|
11127
10878
|
});
|
|
11128
10879
|
Object.defineProperty(exports, "getPoseidonEncryptor", {
|
|
11129
10880
|
enumerable: true,
|
|
11130
|
-
get: function () { return
|
|
10881
|
+
get: function () { return chunkYFUGKMNS_cjs.getPoseidonEncryptor; }
|
|
11131
10882
|
});
|
|
11132
10883
|
Object.defineProperty(exports, "getPoseidonHasher", {
|
|
11133
10884
|
enumerable: true,
|
|
11134
|
-
get: function () { return
|
|
10885
|
+
get: function () { return chunkYFUGKMNS_cjs.getPoseidonHasher; }
|
|
11135
10886
|
});
|
|
11136
10887
|
Object.defineProperty(exports, "getPoseidonKeystreamBlindingFactorDeriver", {
|
|
11137
10888
|
enumerable: true,
|
|
11138
|
-
get: function () { return
|
|
10889
|
+
get: function () { return chunkYFUGKMNS_cjs.getPoseidonKeystreamBlindingFactorDeriver; }
|
|
11139
10890
|
});
|
|
11140
10891
|
Object.defineProperty(exports, "getPoseidonKeystreamGenerator", {
|
|
11141
10892
|
enumerable: true,
|
|
11142
|
-
get: function () { return
|
|
10893
|
+
get: function () { return chunkYFUGKMNS_cjs.getPoseidonKeystreamGenerator; }
|
|
11143
10894
|
});
|
|
11144
10895
|
Object.defineProperty(exports, "getPoseidonPrf", {
|
|
11145
10896
|
enumerable: true,
|
|
11146
|
-
get: function () { return
|
|
10897
|
+
get: function () { return chunkYFUGKMNS_cjs.getPoseidonPrf; }
|
|
11147
10898
|
});
|
|
11148
10899
|
Object.defineProperty(exports, "getPoseidonPrivateKeyDeriver", {
|
|
11149
10900
|
enumerable: true,
|
|
11150
|
-
get: function () { return
|
|
10901
|
+
get: function () { return chunkYFUGKMNS_cjs.getPoseidonPrivateKeyDeriver; }
|
|
11151
10902
|
});
|
|
11152
10903
|
Object.defineProperty(exports, "getPseudorandomU512Deriver", {
|
|
11153
10904
|
enumerable: true,
|
|
11154
|
-
get: function () { return
|
|
10905
|
+
get: function () { return chunkYFUGKMNS_cjs.getPseudorandomU512Deriver; }
|
|
11155
10906
|
});
|
|
11156
10907
|
Object.defineProperty(exports, "getRescueCipher", {
|
|
11157
10908
|
enumerable: true,
|
|
11158
|
-
get: function () { return
|
|
10909
|
+
get: function () { return chunkYFUGKMNS_cjs.getRescueCipher; }
|
|
11159
10910
|
});
|
|
11160
10911
|
Object.defineProperty(exports, "getRescueCipherFromKeyPair", {
|
|
11161
10912
|
enumerable: true,
|
|
11162
|
-
get: function () { return
|
|
10913
|
+
get: function () { return chunkYFUGKMNS_cjs.getRescueCipherFromKeyPair; }
|
|
11163
10914
|
});
|
|
11164
10915
|
Object.defineProperty(exports, "getRescueCipherInstance", {
|
|
11165
10916
|
enumerable: true,
|
|
11166
|
-
get: function () { return
|
|
10917
|
+
get: function () { return chunkYFUGKMNS_cjs.getRescueCipherInstance; }
|
|
11167
10918
|
});
|
|
11168
10919
|
Object.defineProperty(exports, "getRescueCommitmentBlindingFactorDeriver", {
|
|
11169
10920
|
enumerable: true,
|
|
11170
|
-
get: function () { return
|
|
10921
|
+
get: function () { return chunkYFUGKMNS_cjs.getRescueCommitmentBlindingFactorDeriver; }
|
|
11171
10922
|
});
|
|
11172
10923
|
Object.defineProperty(exports, "getRescueCommitmentGenerator", {
|
|
11173
10924
|
enumerable: true,
|
|
11174
|
-
get: function () { return
|
|
10925
|
+
get: function () { return chunkYFUGKMNS_cjs.getRescueCommitmentGenerator; }
|
|
11175
10926
|
});
|
|
11176
10927
|
Object.defineProperty(exports, "getRescueDecryptorFromPrivateKey", {
|
|
11177
10928
|
enumerable: true,
|
|
11178
|
-
get: function () { return
|
|
10929
|
+
get: function () { return chunkYFUGKMNS_cjs.getRescueDecryptorFromPrivateKey; }
|
|
11179
10930
|
});
|
|
11180
10931
|
Object.defineProperty(exports, "getRescueEncryptorFromPrivateKey", {
|
|
11181
10932
|
enumerable: true,
|
|
11182
|
-
get: function () { return
|
|
10933
|
+
get: function () { return chunkYFUGKMNS_cjs.getRescueEncryptorFromPrivateKey; }
|
|
11183
10934
|
});
|
|
11184
10935
|
Object.defineProperty(exports, "getRescueEncryptorWithNonceFromPrivateKey", {
|
|
11185
10936
|
enumerable: true,
|
|
11186
|
-
get: function () { return
|
|
10937
|
+
get: function () { return chunkYFUGKMNS_cjs.getRescueEncryptorWithNonceFromPrivateKey; }
|
|
11187
10938
|
});
|
|
11188
10939
|
Object.defineProperty(exports, "getRescueKeyGeneratorFromPrivateKey", {
|
|
11189
10940
|
enumerable: true,
|
|
11190
|
-
get: function () { return
|
|
10941
|
+
get: function () { return chunkYFUGKMNS_cjs.getRescueKeyGeneratorFromPrivateKey; }
|
|
11191
10942
|
});
|
|
11192
10943
|
Object.defineProperty(exports, "getRescuePrimeHashFunction", {
|
|
11193
10944
|
enumerable: true,
|
|
11194
|
-
get: function () { return
|
|
10945
|
+
get: function () { return chunkYFUGKMNS_cjs.getRescuePrimeHashFunction; }
|
|
11195
10946
|
});
|
|
11196
10947
|
Object.defineProperty(exports, "getSecondViewingKeyDeriver", {
|
|
11197
10948
|
enumerable: true,
|
|
11198
|
-
get: function () { return
|
|
10949
|
+
get: function () { return chunkYFUGKMNS_cjs.getSecondViewingKeyDeriver; }
|
|
11199
10950
|
});
|
|
11200
10951
|
Object.defineProperty(exports, "getUserAccountX25519KeypairDeriver", {
|
|
11201
10952
|
enumerable: true,
|
|
11202
|
-
get: function () { return
|
|
10953
|
+
get: function () { return chunkYFUGKMNS_cjs.getUserAccountX25519KeypairDeriver; }
|
|
11203
10954
|
});
|
|
11204
10955
|
Object.defineProperty(exports, "getUserCommitmentGeneratorFunction", {
|
|
11205
10956
|
enumerable: true,
|
|
11206
|
-
get: function () { return
|
|
10957
|
+
get: function () { return chunkYFUGKMNS_cjs.getUserCommitmentGeneratorFunction; }
|
|
11207
10958
|
});
|
|
11208
10959
|
Object.defineProperty(exports, "getUtxoCommitmentHashGenerator", {
|
|
11209
10960
|
enumerable: true,
|
|
11210
|
-
get: function () { return
|
|
10961
|
+
get: function () { return chunkYFUGKMNS_cjs.getUtxoCommitmentHashGenerator; }
|
|
11211
10962
|
});
|
|
11212
10963
|
Object.defineProperty(exports, "getYearlyViewingKeyDeriver", {
|
|
11213
10964
|
enumerable: true,
|
|
11214
|
-
get: function () { return
|
|
10965
|
+
get: function () { return chunkYFUGKMNS_cjs.getYearlyViewingKeyDeriver; }
|
|
11215
10966
|
});
|
|
11216
10967
|
Object.defineProperty(exports, "ClaimUtxoError", {
|
|
11217
10968
|
enumerable: true,
|
|
11218
|
-
get: function () { return
|
|
10969
|
+
get: function () { return chunkKCHHJKQN_cjs.ClaimUtxoError; }
|
|
11219
10970
|
});
|
|
11220
10971
|
Object.defineProperty(exports, "ComputationMonitorError", {
|
|
11221
10972
|
enumerable: true,
|
|
11222
|
-
get: function () { return
|
|
10973
|
+
get: function () { return chunkKCHHJKQN_cjs.ComputationMonitorError; }
|
|
11223
10974
|
});
|
|
11224
10975
|
Object.defineProperty(exports, "ConversionError", {
|
|
11225
10976
|
enumerable: true,
|
|
11226
|
-
get: function () { return
|
|
10977
|
+
get: function () { return chunkKCHHJKQN_cjs.ConversionError; }
|
|
11227
10978
|
});
|
|
11228
10979
|
Object.defineProperty(exports, "CreateUtxoError", {
|
|
11229
10980
|
enumerable: true,
|
|
11230
|
-
get: function () { return
|
|
10981
|
+
get: function () { return chunkKCHHJKQN_cjs.CreateUtxoError; }
|
|
11231
10982
|
});
|
|
11232
10983
|
Object.defineProperty(exports, "EncryptedDepositError", {
|
|
11233
10984
|
enumerable: true,
|
|
11234
|
-
get: function () { return
|
|
10985
|
+
get: function () { return chunkKCHHJKQN_cjs.EncryptedDepositError; }
|
|
11235
10986
|
});
|
|
11236
10987
|
Object.defineProperty(exports, "EncryptedWithdrawalError", {
|
|
11237
10988
|
enumerable: true,
|
|
11238
|
-
get: function () { return
|
|
10989
|
+
get: function () { return chunkKCHHJKQN_cjs.EncryptedWithdrawalError; }
|
|
11239
10990
|
});
|
|
11240
10991
|
Object.defineProperty(exports, "FetchUtxosError", {
|
|
11241
10992
|
enumerable: true,
|
|
11242
|
-
get: function () { return
|
|
10993
|
+
get: function () { return chunkKCHHJKQN_cjs.FetchUtxosError; }
|
|
11243
10994
|
});
|
|
11244
10995
|
Object.defineProperty(exports, "QueryError", {
|
|
11245
10996
|
enumerable: true,
|
|
11246
|
-
get: function () { return
|
|
10997
|
+
get: function () { return chunkKCHHJKQN_cjs.QueryError; }
|
|
11247
10998
|
});
|
|
11248
10999
|
Object.defineProperty(exports, "RegistrationError", {
|
|
11249
11000
|
enumerable: true,
|
|
11250
|
-
get: function () { return
|
|
11001
|
+
get: function () { return chunkKCHHJKQN_cjs.RegistrationError; }
|
|
11251
11002
|
});
|
|
11252
11003
|
Object.defineProperty(exports, "isClaimUtxoError", {
|
|
11253
11004
|
enumerable: true,
|
|
11254
|
-
get: function () { return
|
|
11005
|
+
get: function () { return chunkKCHHJKQN_cjs.isClaimUtxoError; }
|
|
11255
11006
|
});
|
|
11256
11007
|
Object.defineProperty(exports, "isComputationMonitorError", {
|
|
11257
11008
|
enumerable: true,
|
|
11258
|
-
get: function () { return
|
|
11009
|
+
get: function () { return chunkKCHHJKQN_cjs.isComputationMonitorError; }
|
|
11259
11010
|
});
|
|
11260
11011
|
Object.defineProperty(exports, "isConversionError", {
|
|
11261
11012
|
enumerable: true,
|
|
11262
|
-
get: function () { return
|
|
11013
|
+
get: function () { return chunkKCHHJKQN_cjs.isConversionError; }
|
|
11263
11014
|
});
|
|
11264
11015
|
Object.defineProperty(exports, "isCreateUtxoError", {
|
|
11265
11016
|
enumerable: true,
|
|
11266
|
-
get: function () { return
|
|
11017
|
+
get: function () { return chunkKCHHJKQN_cjs.isCreateUtxoError; }
|
|
11267
11018
|
});
|
|
11268
11019
|
Object.defineProperty(exports, "isEncryptedDepositError", {
|
|
11269
11020
|
enumerable: true,
|
|
11270
|
-
get: function () { return
|
|
11021
|
+
get: function () { return chunkKCHHJKQN_cjs.isEncryptedDepositError; }
|
|
11271
11022
|
});
|
|
11272
11023
|
Object.defineProperty(exports, "isEncryptedWithdrawalError", {
|
|
11273
11024
|
enumerable: true,
|
|
11274
|
-
get: function () { return
|
|
11025
|
+
get: function () { return chunkKCHHJKQN_cjs.isEncryptedWithdrawalError; }
|
|
11275
11026
|
});
|
|
11276
11027
|
Object.defineProperty(exports, "isFetchUtxosError", {
|
|
11277
11028
|
enumerable: true,
|
|
11278
|
-
get: function () { return
|
|
11029
|
+
get: function () { return chunkKCHHJKQN_cjs.isFetchUtxosError; }
|
|
11279
11030
|
});
|
|
11280
11031
|
Object.defineProperty(exports, "isQueryError", {
|
|
11281
11032
|
enumerable: true,
|
|
11282
|
-
get: function () { return
|
|
11033
|
+
get: function () { return chunkKCHHJKQN_cjs.isQueryError; }
|
|
11283
11034
|
});
|
|
11284
11035
|
Object.defineProperty(exports, "isRegistrationError", {
|
|
11285
11036
|
enumerable: true,
|
|
11286
|
-
get: function () { return
|
|
11037
|
+
get: function () { return chunkKCHHJKQN_cjs.isRegistrationError; }
|
|
11287
11038
|
});
|
|
11288
11039
|
Object.defineProperty(exports, "bn254Add", {
|
|
11289
11040
|
enumerable: true,
|
|
@@ -11427,7 +11178,6 @@ exports.DEFAULT_POLLING_INTERVAL_MS = DEFAULT_POLLING_INTERVAL_MS;
|
|
|
11427
11178
|
exports.DEFAULT_SAFETY_TIMEOUT_MS = DEFAULT_SAFETY_TIMEOUT_MS;
|
|
11428
11179
|
exports.DEFAULT_SIGNATURE_RETRIEVAL_LIMIT = DEFAULT_SIGNATURE_RETRIEVAL_LIMIT;
|
|
11429
11180
|
exports.FEE_OFFSETS = FEE_OFFSETS;
|
|
11430
|
-
exports.IndexerError = IndexerError;
|
|
11431
11181
|
exports.UMBRA_MESSAGE_TO_SIGN = UMBRA_MESSAGE_TO_SIGN;
|
|
11432
11182
|
exports.buildTransactionMessage = buildTransactionMessage;
|
|
11433
11183
|
exports.calculateFee = calculateFee;
|
|
@@ -11437,7 +11187,6 @@ exports.extractMerklePath = extractMerklePath;
|
|
|
11437
11187
|
exports.extractSignatures = extractSignatures;
|
|
11438
11188
|
exports.feeSlabResultToInstructionFields = feeSlabResultToInstructionFields;
|
|
11439
11189
|
exports.forwardAndMonitor = forwardAndMonitor;
|
|
11440
|
-
exports.getBatchMerkleProofFetcher = getBatchMerkleProofFetcher;
|
|
11441
11190
|
exports.getClaimableUtxoScannerFunction = getClaimableUtxoScannerFunction;
|
|
11442
11191
|
exports.getComplianceGrantIssuerFunction = getComplianceGrantIssuerFunction;
|
|
11443
11192
|
exports.getComplianceGrantRevokerFunction = getComplianceGrantRevokerFunction;
|
|
@@ -11455,7 +11204,6 @@ exports.getHardcodedCreateUtxoProtocolFeeProvider = getHardcodedCreateUtxoProtoc
|
|
|
11455
11204
|
exports.getHardcodedDepositProtocolFeeProvider = getHardcodedDepositProtocolFeeProvider;
|
|
11456
11205
|
exports.getHardcodedWithdrawalProtocolFeeProvider = getHardcodedWithdrawalProtocolFeeProvider;
|
|
11457
11206
|
exports.getMasterViewingKeyRotatorFunction = getMasterViewingKeyRotatorFunction;
|
|
11458
|
-
exports.getMerkleProofFetcher = getMerkleProofFetcher;
|
|
11459
11207
|
exports.getMintEncryptionKeyRotatorFunction = getMintEncryptionKeyRotatorFunction;
|
|
11460
11208
|
exports.getNetworkCiphertextReencryptorForNetworkGrantFunction = getNetworkCiphertextReencryptorForNetworkGrantFunction;
|
|
11461
11209
|
exports.getNetworkComplianceGrantQuerierFunction = getNetworkComplianceGrantQuerierFunction;
|
|
@@ -11479,7 +11227,6 @@ exports.getUserComplianceGrantQuerierFunction = getUserComplianceGrantQuerierFun
|
|
|
11479
11227
|
exports.getUserEncryptionKeyRotatorFunction = getUserEncryptionKeyRotatorFunction;
|
|
11480
11228
|
exports.getUserEntropySeedRotatorFunction = getUserEntropySeedRotatorFunction;
|
|
11481
11229
|
exports.getUserRegistrationFunction = getUserRegistrationFunction;
|
|
11482
|
-
exports.getUtxoDataFetcher = getUtxoDataFetcher;
|
|
11483
11230
|
exports.getWebsocketComputationMonitor = getWebsocketComputationMonitor;
|
|
11484
11231
|
exports.leafIndexToPathIndices = leafIndexToPathIndices;
|
|
11485
11232
|
exports.protocolFeeSlabResultToInstructionFields = protocolFeeSlabResultToInstructionFields;
|