@umbra-privacy/sdk 2.1.1 → 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 +816 -1072
- 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 +321 -573
- 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,8 +921,8 @@ 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
|
|
@@ -1501,10 +1229,10 @@ async function processUtxoInBatch(args, deps) {
|
|
|
1501
1229
|
depositModifiedGenerationIndexBytes[index2] = Number(indexValue & 0xffn);
|
|
1502
1230
|
indexValue >>= 8n;
|
|
1503
1231
|
}
|
|
1504
|
-
const nullifier =
|
|
1232
|
+
const nullifier = chunkYFUGKMNS_cjs.deriveNullifierFromModifiedGenerationIndex(
|
|
1505
1233
|
depositModifiedGenerationIndexBytes
|
|
1506
1234
|
);
|
|
1507
|
-
const randomSecret =
|
|
1235
|
+
const randomSecret = chunkYFUGKMNS_cjs.deriveRandomSecretFromModifiedGenerationIndex(
|
|
1508
1236
|
depositModifiedGenerationIndexBytes
|
|
1509
1237
|
);
|
|
1510
1238
|
perLeafNullifiers.push(nullifier);
|
|
@@ -1681,7 +1409,7 @@ async function processUtxoInBatch(args, deps) {
|
|
|
1681
1409
|
const blindingFactorOffset = chunk5GUSMQ74_cjs.decodeU256BeBytesToU256(
|
|
1682
1410
|
blindingFactorOffsetBytes
|
|
1683
1411
|
);
|
|
1684
|
-
const blindingFactor =
|
|
1412
|
+
const blindingFactor = chunkYFUGKMNS_cjs.deriveKeystreamBlindingFactor(blindingFactorOffset);
|
|
1685
1413
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(
|
|
1686
1414
|
blindingFactor,
|
|
1687
1415
|
`linkerKeystreamBlindingFactor[${String(leafIndex)}][${String(keyIndex)}]`
|
|
@@ -1761,7 +1489,7 @@ async function processUtxoInBatch(args, deps) {
|
|
|
1761
1489
|
}
|
|
1762
1490
|
const nullifierHashesAggregatedHash = await poseidonAggregator(nullifierHashes);
|
|
1763
1491
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(nullifierHashesAggregatedHash, "nullifierHashesAggregatedHash");
|
|
1764
|
-
const rcEncryptor =
|
|
1492
|
+
const rcEncryptor = chunkYFUGKMNS_cjs.getRescueEncryptorFromPrivateKey(clientX25519PrivateKey, {
|
|
1765
1493
|
umbraX25519PublicKey: networkConfig.mxePubkey
|
|
1766
1494
|
});
|
|
1767
1495
|
const randomFactorBytes = sha3Addons_js.kmac256(
|
|
@@ -1829,7 +1557,7 @@ async function processUtxoInBatch(args, deps) {
|
|
|
1829
1557
|
chunkLTCKPTZC_cjs.assertCurve25519FieldElement(rcEncryptedMvkHigh, "rcEncryptedMvkHigh");
|
|
1830
1558
|
chunkLTCKPTZC_cjs.assertCurve25519FieldElement(rcEncryptedRandomFactorLow, "rcEncryptedRandomFactorLow");
|
|
1831
1559
|
chunkLTCKPTZC_cjs.assertCurve25519FieldElement(rcEncryptedRandomFactorHigh, "rcEncryptedRandomFactorHigh");
|
|
1832
|
-
const rcKeyGenerator =
|
|
1560
|
+
const rcKeyGenerator = chunkYFUGKMNS_cjs.getRescueKeyGeneratorFromPrivateKey(clientX25519PrivateKey, {
|
|
1833
1561
|
umbraX25519PublicKey: networkConfig.mxePubkey
|
|
1834
1562
|
});
|
|
1835
1563
|
const rcCounters = [
|
|
@@ -1896,7 +1624,7 @@ async function processUtxoInBatch(args, deps) {
|
|
|
1896
1624
|
rescueEncryptionCommitmentBlindingFactorOffsetBytes
|
|
1897
1625
|
);
|
|
1898
1626
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(blindingFactorForRescueCommitment, "blindingFactorForRescueCommitment");
|
|
1899
|
-
const rescueEncryptionCommitmentGenerator =
|
|
1627
|
+
const rescueEncryptionCommitmentGenerator = chunkYFUGKMNS_cjs.getRescueCommitmentGenerator();
|
|
1900
1628
|
const getRcKey = /* @__PURE__ */ chunkPK6SKIKE_cjs.__name((counter) => {
|
|
1901
1629
|
const key = rcKeys.get(counter);
|
|
1902
1630
|
if (key === void 0) {
|
|
@@ -1967,7 +1695,7 @@ async function processUtxoInBatch(args, deps) {
|
|
|
1967
1695
|
const fiatShamirChallenge = fiatShamirChallengeGenerator(fiatShamirInputBytes);
|
|
1968
1696
|
chunkLTCKPTZC_cjs.assertCurve25519FieldElement(fiatShamirChallenge, "fiatShamirChallenge");
|
|
1969
1697
|
const fiatShamirChallengeLimbs = chunkZY3TSHMJ_cjs.convertU256ToBase85Limbs(fiatShamirChallenge);
|
|
1970
|
-
const modulePow =
|
|
1698
|
+
const modulePow = chunkYFUGKMNS_cjs.getModuloPowCurve25519Function();
|
|
1971
1699
|
const challengeSquared = modulePow(fiatShamirChallenge, 2n);
|
|
1972
1700
|
const challengeCubed = modulePow(fiatShamirChallenge, 3n);
|
|
1973
1701
|
const challengeToFourth = modulePow(fiatShamirChallenge, 4n);
|
|
@@ -2050,7 +1778,7 @@ async function processUtxoInBatch(args, deps) {
|
|
|
2050
1778
|
inverseForKeysForRandomFactorHighLimbs,
|
|
2051
1779
|
"inverseForKeysForRandomFactorHighLimbs"
|
|
2052
1780
|
);
|
|
2053
|
-
const polynomialEvaluator =
|
|
1781
|
+
const polynomialEvaluator = chunkYFUGKMNS_cjs.getPolynomialEvaluatorFunction();
|
|
2054
1782
|
const polynomialEvaluationResultScalar = polynomialEvaluator(
|
|
2055
1783
|
[
|
|
2056
1784
|
chunkZY3TSHMJ_cjs.createCurve25519FieldElement(finalAmount),
|
|
@@ -2498,19 +2226,19 @@ function getReceiverClaimableUtxoToEncryptedBalanceClaimerFunction(args, deps) {
|
|
|
2498
2226
|
const pollingIntervalMs = deps.pollingIntervalMs ?? 3e3;
|
|
2499
2227
|
const timeoutMs = deps.timeoutMs ?? 12e4;
|
|
2500
2228
|
const onProgress = deps.onProgress;
|
|
2501
|
-
const masterViewingKeyGenerator = deps.keys?.masterViewingKeyGenerator ??
|
|
2502
|
-
const masterViewingKeyBlindingFactorGenerator = deps.keys?.masterViewingKeyBlindingFactorGenerator ??
|
|
2503
|
-
const poseidonPrivateKeyGenerator = deps.keys?.poseidonPrivateKeyGenerator ??
|
|
2504
|
-
const poseidonBlindingFactorGenerator = deps.keys?.poseidonBlindingFactorGenerator ??
|
|
2505
|
-
const secondViewingKeyGenerator = deps.keys?.secondViewingKeyGenerator ??
|
|
2506
|
-
const mvkX25519KeypairDeriver = deps.keys?.mvkX25519KeypairDeriver ??
|
|
2507
|
-
const poseidonHasher = deps.crypto?.poseidonHasher ??
|
|
2508
|
-
const poseidonAggregator = deps.crypto?.poseidonAggregator ??
|
|
2509
|
-
const poseidonEncryptor = deps.crypto?.poseidonEncryptor ??
|
|
2510
|
-
const poseidonKeystreamGeneratorFunction = deps.crypto?.poseidonKeystreamGenerator ??
|
|
2511
|
-
const userCommitmentGeneratorFunction = deps.crypto?.userCommitmentGenerator ??
|
|
2512
|
-
const keystreamCommitmentGeneratorFunction = deps.crypto?.keystreamCommitmentGenerator ??
|
|
2513
|
-
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();
|
|
2514
2242
|
const generateRandomU2562 = deps.random?.generateRandomU256 ?? chunkZY3TSHMJ_cjs.generateRandomU256;
|
|
2515
2243
|
const generateRandomU1282 = deps.random?.generateRandomU128 ?? chunkZY3TSHMJ_cjs.generateRandomU128;
|
|
2516
2244
|
return async (utxos, optionalData, microLamportsPerAcu) => {
|
|
@@ -2601,16 +2329,16 @@ function getReceiverClaimableUtxoToEncryptedBalanceClaimerFunction(args, deps) {
|
|
|
2601
2329
|
batches: resultsByBatch
|
|
2602
2330
|
};
|
|
2603
2331
|
} catch (error) {
|
|
2604
|
-
if (error instanceof
|
|
2332
|
+
if (error instanceof chunkKCHHJKQN_cjs.ClaimUtxoError) {
|
|
2605
2333
|
throw error;
|
|
2606
2334
|
}
|
|
2607
2335
|
if (error instanceof chunkFSK2ICMB_cjs.CryptographyError) {
|
|
2608
|
-
throw new
|
|
2336
|
+
throw new chunkKCHHJKQN_cjs.ClaimUtxoError("zk-proof-generation", error.message, error);
|
|
2609
2337
|
}
|
|
2610
|
-
if (error instanceof
|
|
2611
|
-
throw new
|
|
2338
|
+
if (error instanceof chunkKCHHJKQN_cjs.RpcError) {
|
|
2339
|
+
throw new chunkKCHHJKQN_cjs.ClaimUtxoError("initialization", error.message, error);
|
|
2612
2340
|
}
|
|
2613
|
-
throw new
|
|
2341
|
+
throw new chunkKCHHJKQN_cjs.ClaimUtxoError(
|
|
2614
2342
|
"transaction-send",
|
|
2615
2343
|
error instanceof Error ? error.message : String(error),
|
|
2616
2344
|
error instanceof Error ? error : void 0
|
|
@@ -2814,7 +2542,7 @@ async function processUtxoInBatch2(args, deps) {
|
|
|
2814
2542
|
depositModifiedGenerationIndexBytes[index] = Number(indexValueForExpansion & 0xffn);
|
|
2815
2543
|
indexValueForExpansion >>= 8n;
|
|
2816
2544
|
}
|
|
2817
|
-
const expandedModifiedGenerationIndex =
|
|
2545
|
+
const expandedModifiedGenerationIndex = chunkYFUGKMNS_cjs.expandModifiedGenerationIndex(
|
|
2818
2546
|
depositModifiedGenerationIndexBytes
|
|
2819
2547
|
);
|
|
2820
2548
|
let ephemeralOffset = 0n;
|
|
@@ -2886,10 +2614,10 @@ async function processUtxoInBatch2(args, deps) {
|
|
|
2886
2614
|
depositModifiedGenerationIndexBytes2[index2] = Number(indexValue & 0xffn);
|
|
2887
2615
|
indexValue >>= 8n;
|
|
2888
2616
|
}
|
|
2889
|
-
const nullifier =
|
|
2617
|
+
const nullifier = chunkYFUGKMNS_cjs.deriveNullifierFromModifiedGenerationIndex(
|
|
2890
2618
|
depositModifiedGenerationIndexBytes2
|
|
2891
2619
|
);
|
|
2892
|
-
const randomSecret =
|
|
2620
|
+
const randomSecret = chunkYFUGKMNS_cjs.deriveRandomSecretFromModifiedGenerationIndex(
|
|
2893
2621
|
depositModifiedGenerationIndexBytes2
|
|
2894
2622
|
);
|
|
2895
2623
|
perLeafNullifiers.push(nullifier);
|
|
@@ -3066,7 +2794,7 @@ async function processUtxoInBatch2(args, deps) {
|
|
|
3066
2794
|
const blindingFactorOffset = chunk5GUSMQ74_cjs.decodeU256BeBytesToU256(
|
|
3067
2795
|
blindingFactorOffsetBytes
|
|
3068
2796
|
);
|
|
3069
|
-
const blindingFactor =
|
|
2797
|
+
const blindingFactor = chunkYFUGKMNS_cjs.deriveKeystreamBlindingFactor(blindingFactorOffset);
|
|
3070
2798
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(
|
|
3071
2799
|
blindingFactor,
|
|
3072
2800
|
`linkerKeystreamBlindingFactor[${String(leafIndex)}][${String(keyIndex)}]`
|
|
@@ -3145,7 +2873,7 @@ async function processUtxoInBatch2(args, deps) {
|
|
|
3145
2873
|
}
|
|
3146
2874
|
const nullifierHashesAggregatedHash = await poseidonAggregator(nullifierHashes);
|
|
3147
2875
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(nullifierHashesAggregatedHash, "nullifierHashesAggregatedHash");
|
|
3148
|
-
const rcEncryptor =
|
|
2876
|
+
const rcEncryptor = chunkYFUGKMNS_cjs.getRescueEncryptorFromPrivateKey(clientX25519PrivateKey, {
|
|
3149
2877
|
umbraX25519PublicKey: networkConfig.mxePubkey
|
|
3150
2878
|
});
|
|
3151
2879
|
const randomFactorBytes = sha3Addons_js.kmac256(
|
|
@@ -3213,7 +2941,7 @@ async function processUtxoInBatch2(args, deps) {
|
|
|
3213
2941
|
chunkLTCKPTZC_cjs.assertCurve25519FieldElement(rcEncryptedMvkHigh, "rcEncryptedMvkHigh");
|
|
3214
2942
|
chunkLTCKPTZC_cjs.assertCurve25519FieldElement(rcEncryptedRandomFactorLow, "rcEncryptedRandomFactorLow");
|
|
3215
2943
|
chunkLTCKPTZC_cjs.assertCurve25519FieldElement(rcEncryptedRandomFactorHigh, "rcEncryptedRandomFactorHigh");
|
|
3216
|
-
const rcKeyGenerator =
|
|
2944
|
+
const rcKeyGenerator = chunkYFUGKMNS_cjs.getRescueKeyGeneratorFromPrivateKey(clientX25519PrivateKey, {
|
|
3217
2945
|
umbraX25519PublicKey: networkConfig.mxePubkey
|
|
3218
2946
|
});
|
|
3219
2947
|
const rcCounters = [
|
|
@@ -3280,7 +3008,7 @@ async function processUtxoInBatch2(args, deps) {
|
|
|
3280
3008
|
rescueEncryptionCommitmentBlindingFactorOffsetBytes
|
|
3281
3009
|
);
|
|
3282
3010
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(blindingFactorForRescueCommitment, "blindingFactorForRescueCommitment");
|
|
3283
|
-
const rescueEncryptionCommitmentGenerator =
|
|
3011
|
+
const rescueEncryptionCommitmentGenerator = chunkYFUGKMNS_cjs.getRescueCommitmentGenerator();
|
|
3284
3012
|
const rcEncryptionCommitment = await rescueEncryptionCommitmentGenerator(
|
|
3285
3013
|
[
|
|
3286
3014
|
rcEncryptedFinalAmount,
|
|
@@ -3340,7 +3068,7 @@ async function processUtxoInBatch2(args, deps) {
|
|
|
3340
3068
|
const fiatShamirChallenge = fiatShamirChallengeGenerator(fiatShamirInputBytes);
|
|
3341
3069
|
chunkLTCKPTZC_cjs.assertCurve25519FieldElement(fiatShamirChallenge, "fiatShamirChallenge");
|
|
3342
3070
|
const fiatShamirChallengeLimbs = chunkZY3TSHMJ_cjs.convertU256ToBase85Limbs(fiatShamirChallenge);
|
|
3343
|
-
const modulePow =
|
|
3071
|
+
const modulePow = chunkYFUGKMNS_cjs.getModuloPowCurve25519Function();
|
|
3344
3072
|
const challengeSquared = modulePow(fiatShamirChallenge, 2n);
|
|
3345
3073
|
const challengeCubed = modulePow(fiatShamirChallenge, 3n);
|
|
3346
3074
|
const challengeToFourth = modulePow(fiatShamirChallenge, 4n);
|
|
@@ -3427,7 +3155,7 @@ async function processUtxoInBatch2(args, deps) {
|
|
|
3427
3155
|
inverseForKeysForRandomFactorHighLimbs,
|
|
3428
3156
|
"inverseForKeysForRandomFactorHighLimbs"
|
|
3429
3157
|
);
|
|
3430
|
-
const polynomialEvaluator =
|
|
3158
|
+
const polynomialEvaluator = chunkYFUGKMNS_cjs.getPolynomialEvaluatorFunction();
|
|
3431
3159
|
const polynomialEvaluationResultScalar = polynomialEvaluator(
|
|
3432
3160
|
[
|
|
3433
3161
|
chunkZY3TSHMJ_cjs.createCurve25519FieldElement(finalAmount),
|
|
@@ -3849,22 +3577,22 @@ function getSelfClaimableUtxoToEncryptedBalanceClaimerFunction(args, deps) {
|
|
|
3849
3577
|
const pollingIntervalMs = deps.pollingIntervalMs ?? 3e3;
|
|
3850
3578
|
const timeoutMs = deps.timeoutMs ?? 12e4;
|
|
3851
3579
|
const onProgress = deps.onProgress;
|
|
3852
|
-
const ephemeralUtxoMvkGenerator = deps.keys?.ephemeralUtxoMasterViewingKeyDeriver ??
|
|
3853
|
-
const ephemeralUtxoMvkBlindingFactorGenerator = deps.keys?.ephemeralUtxoMasterViewingKeyBlindingFactorDeriver ??
|
|
3580
|
+
const ephemeralUtxoMvkGenerator = deps.keys?.ephemeralUtxoMasterViewingKeyDeriver ?? chunkYFUGKMNS_cjs.getEphemeralUtxoMasterViewingKeyDeriver({ client });
|
|
3581
|
+
const ephemeralUtxoMvkBlindingFactorGenerator = deps.keys?.ephemeralUtxoMasterViewingKeyBlindingFactorDeriver ?? chunkYFUGKMNS_cjs.getEphemeralUtxoMasterViewingKeyBlindingFactorDeriver({
|
|
3854
3582
|
client
|
|
3855
3583
|
});
|
|
3856
|
-
const ephemeralUtxoPoseidonKeyGenerator = deps.keys?.ephemeralUtxoPoseidonKeyGenerator ??
|
|
3857
|
-
const ephemeralUtxoPoseidonKeyBlindingFactorGenerator = deps.keys?.ephemeralUtxoPoseidonKeyBlindingFactorGenerator ??
|
|
3584
|
+
const ephemeralUtxoPoseidonKeyGenerator = deps.keys?.ephemeralUtxoPoseidonKeyGenerator ?? chunkYFUGKMNS_cjs.getEphemeralUtxoPoseidonPrivateKeyDeriver({ client });
|
|
3585
|
+
const ephemeralUtxoPoseidonKeyBlindingFactorGenerator = deps.keys?.ephemeralUtxoPoseidonKeyBlindingFactorGenerator ?? chunkYFUGKMNS_cjs.getEphemeralUtxoPoseidonPrivateKeyBlindingFactorDeriver({
|
|
3858
3586
|
client
|
|
3859
3587
|
});
|
|
3860
|
-
const mvkX25519KeypairDeriver = deps.keys?.mvkX25519KeypairDeriver ??
|
|
3861
|
-
const poseidonHasher = deps.crypto?.poseidonHasher ??
|
|
3862
|
-
const poseidonAggregator = deps.crypto?.poseidonAggregator ??
|
|
3863
|
-
const poseidonEncryptor = deps.crypto?.poseidonEncryptor ??
|
|
3864
|
-
const poseidonKeystreamGeneratorFunction = deps.crypto?.poseidonKeystreamGenerator ??
|
|
3865
|
-
const userCommitmentGeneratorFunction = deps.crypto?.userCommitmentGenerator ??
|
|
3866
|
-
const keystreamCommitmentGeneratorFunction = deps.crypto?.keystreamCommitmentGenerator ??
|
|
3867
|
-
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();
|
|
3868
3596
|
const generateRandomU2562 = deps.random?.generateRandomU256 ?? chunkZY3TSHMJ_cjs.generateRandomU256;
|
|
3869
3597
|
const generateRandomU1282 = deps.random?.generateRandomU128 ?? chunkZY3TSHMJ_cjs.generateRandomU128;
|
|
3870
3598
|
return async (utxos, optionalData, microLamportsPerAcu) => {
|
|
@@ -3954,16 +3682,16 @@ function getSelfClaimableUtxoToEncryptedBalanceClaimerFunction(args, deps) {
|
|
|
3954
3682
|
batches: resultsByBatch
|
|
3955
3683
|
};
|
|
3956
3684
|
} catch (error) {
|
|
3957
|
-
if (error instanceof
|
|
3685
|
+
if (error instanceof chunkKCHHJKQN_cjs.ClaimUtxoError) {
|
|
3958
3686
|
throw error;
|
|
3959
3687
|
}
|
|
3960
3688
|
if (error instanceof chunkFSK2ICMB_cjs.CryptographyError) {
|
|
3961
|
-
throw new
|
|
3689
|
+
throw new chunkKCHHJKQN_cjs.ClaimUtxoError("zk-proof-generation", error.message, error);
|
|
3962
3690
|
}
|
|
3963
|
-
if (error instanceof
|
|
3964
|
-
throw new
|
|
3691
|
+
if (error instanceof chunkKCHHJKQN_cjs.RpcError) {
|
|
3692
|
+
throw new chunkKCHHJKQN_cjs.ClaimUtxoError("initialization", error.message, error);
|
|
3965
3693
|
}
|
|
3966
|
-
throw new
|
|
3694
|
+
throw new chunkKCHHJKQN_cjs.ClaimUtxoError(
|
|
3967
3695
|
"transaction-send",
|
|
3968
3696
|
error instanceof Error ? error.message : String(error),
|
|
3969
3697
|
error instanceof Error ? error : void 0
|
|
@@ -4166,7 +3894,7 @@ async function processUtxoInBatch3(args, deps) {
|
|
|
4166
3894
|
depositModifiedGenerationIndexBytes[index] = Number(indexValueForExpansion & 0xffn);
|
|
4167
3895
|
indexValueForExpansion >>= 8n;
|
|
4168
3896
|
}
|
|
4169
|
-
const expandedModifiedGenerationIndex =
|
|
3897
|
+
const expandedModifiedGenerationIndex = chunkYFUGKMNS_cjs.expandModifiedGenerationIndex(
|
|
4170
3898
|
depositModifiedGenerationIndexBytes
|
|
4171
3899
|
);
|
|
4172
3900
|
let ephemeralOffset = 0n;
|
|
@@ -4238,10 +3966,10 @@ async function processUtxoInBatch3(args, deps) {
|
|
|
4238
3966
|
depositModifiedGenerationIndexBytes2[index2] = Number(indexValue & 0xffn);
|
|
4239
3967
|
indexValue >>= 8n;
|
|
4240
3968
|
}
|
|
4241
|
-
const nullifier =
|
|
3969
|
+
const nullifier = chunkYFUGKMNS_cjs.deriveNullifierFromModifiedGenerationIndex(
|
|
4242
3970
|
depositModifiedGenerationIndexBytes2
|
|
4243
3971
|
);
|
|
4244
|
-
const randomSecret =
|
|
3972
|
+
const randomSecret = chunkYFUGKMNS_cjs.deriveRandomSecretFromModifiedGenerationIndex(
|
|
4245
3973
|
depositModifiedGenerationIndexBytes2
|
|
4246
3974
|
);
|
|
4247
3975
|
perLeafNullifiers.push(nullifier);
|
|
@@ -4362,7 +4090,7 @@ async function processUtxoInBatch3(args, deps) {
|
|
|
4362
4090
|
const blindingFactorOffset = chunk5GUSMQ74_cjs.decodeU256BeBytesToU256(
|
|
4363
4091
|
blindingFactorOffsetBytes
|
|
4364
4092
|
);
|
|
4365
|
-
const blindingFactor =
|
|
4093
|
+
const blindingFactor = chunkYFUGKMNS_cjs.deriveKeystreamBlindingFactor(blindingFactorOffset);
|
|
4366
4094
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(
|
|
4367
4095
|
blindingFactor,
|
|
4368
4096
|
`linkerKeystreamBlindingFactor[${String(leafIndex)}][${String(keyIndex)}]`
|
|
@@ -4441,7 +4169,7 @@ async function processUtxoInBatch3(args, deps) {
|
|
|
4441
4169
|
}
|
|
4442
4170
|
const nullifierHashesAggregatedHash = await poseidonAggregator(nullifierHashes);
|
|
4443
4171
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(nullifierHashesAggregatedHash, "nullifierHashesAggregatedHash");
|
|
4444
|
-
const rcEncryptor =
|
|
4172
|
+
const rcEncryptor = chunkYFUGKMNS_cjs.getRescueEncryptorFromPrivateKey(clientX25519PrivateKey, {
|
|
4445
4173
|
umbraX25519PublicKey: networkConfig.mxePubkey
|
|
4446
4174
|
});
|
|
4447
4175
|
const randomFactorBytes = sha3Addons_js.kmac256(
|
|
@@ -4504,7 +4232,7 @@ async function processUtxoInBatch3(args, deps) {
|
|
|
4504
4232
|
chunkLTCKPTZC_cjs.assertCurve25519FieldElement(rcEncryptedMvkHigh, "rcEncryptedMvkHigh");
|
|
4505
4233
|
chunkLTCKPTZC_cjs.assertCurve25519FieldElement(rcEncryptedRandomFactorLow, "rcEncryptedRandomFactorLow");
|
|
4506
4234
|
chunkLTCKPTZC_cjs.assertCurve25519FieldElement(rcEncryptedRandomFactorHigh, "rcEncryptedRandomFactorHigh");
|
|
4507
|
-
const rcKeyGenerator =
|
|
4235
|
+
const rcKeyGenerator = chunkYFUGKMNS_cjs.getRescueKeyGeneratorFromPrivateKey(clientX25519PrivateKey, {
|
|
4508
4236
|
umbraX25519PublicKey: networkConfig.mxePubkey
|
|
4509
4237
|
});
|
|
4510
4238
|
const rcCounters = [
|
|
@@ -4552,7 +4280,7 @@ async function processUtxoInBatch3(args, deps) {
|
|
|
4552
4280
|
rescueEncryptionCommitmentBlindingFactorOffsetBytes
|
|
4553
4281
|
);
|
|
4554
4282
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(blindingFactorForRescueCommitment, "blindingFactorForRescueCommitment");
|
|
4555
|
-
const rescueEncryptionCommitmentGenerator =
|
|
4283
|
+
const rescueEncryptionCommitmentGenerator = chunkYFUGKMNS_cjs.getRescueCommitmentGenerator();
|
|
4556
4284
|
const rcEncryptionCommitment = await rescueEncryptionCommitmentGenerator(
|
|
4557
4285
|
[
|
|
4558
4286
|
rcEncryptedMvkLow,
|
|
@@ -4603,7 +4331,7 @@ async function processUtxoInBatch3(args, deps) {
|
|
|
4603
4331
|
const fiatShamirChallenge = fiatShamirChallengeGenerator(fiatShamirInputBytes);
|
|
4604
4332
|
chunkLTCKPTZC_cjs.assertCurve25519FieldElement(fiatShamirChallenge, "fiatShamirChallenge");
|
|
4605
4333
|
const fiatShamirChallengeLimbs = chunkZY3TSHMJ_cjs.convertU256ToBase85Limbs(fiatShamirChallenge);
|
|
4606
|
-
const modulePow =
|
|
4334
|
+
const modulePow = chunkYFUGKMNS_cjs.getModuloPowCurve25519Function();
|
|
4607
4335
|
const challengeSquared = modulePow(fiatShamirChallenge, 2n);
|
|
4608
4336
|
chunkLTCKPTZC_cjs.assertCurve25519FieldElement(challengeSquared, "challengeSquared");
|
|
4609
4337
|
const challengeSquaredLimbs = chunkZY3TSHMJ_cjs.convertU256ToBase85Limbs(challengeSquared);
|
|
@@ -4653,7 +4381,7 @@ async function processUtxoInBatch3(args, deps) {
|
|
|
4653
4381
|
inverseForKeysForRandomFactorHighLimbs,
|
|
4654
4382
|
"inverseForKeysForRandomFactorHighLimbs"
|
|
4655
4383
|
);
|
|
4656
|
-
const polynomialEvaluator =
|
|
4384
|
+
const polynomialEvaluator = chunkYFUGKMNS_cjs.getPolynomialEvaluatorFunction();
|
|
4657
4385
|
const polynomialEvaluationResultScalar = polynomialEvaluator(
|
|
4658
4386
|
[ephemeralMvkLow, ephemeralMvkHigh, randomFactorForPolynomialCommitment],
|
|
4659
4387
|
fiatShamirChallenge
|
|
@@ -4994,21 +4722,21 @@ function getSelfClaimableUtxoToPublicBalanceClaimerFunction(args, deps) {
|
|
|
4994
4722
|
const pollingIntervalMs = deps.pollingIntervalMs ?? 3e3;
|
|
4995
4723
|
const timeoutMs = deps.timeoutMs ?? 12e4;
|
|
4996
4724
|
const onProgress = deps.onProgress;
|
|
4997
|
-
const ephemeralUtxoMvkGenerator = deps.keys?.ephemeralUtxoMasterViewingKeyDeriver ??
|
|
4998
|
-
const ephemeralUtxoMvkBlindingFactorGenerator = deps.keys?.ephemeralUtxoMasterViewingKeyBlindingFactorDeriver ??
|
|
4725
|
+
const ephemeralUtxoMvkGenerator = deps.keys?.ephemeralUtxoMasterViewingKeyDeriver ?? chunkYFUGKMNS_cjs.getEphemeralUtxoMasterViewingKeyDeriver({ client });
|
|
4726
|
+
const ephemeralUtxoMvkBlindingFactorGenerator = deps.keys?.ephemeralUtxoMasterViewingKeyBlindingFactorDeriver ?? chunkYFUGKMNS_cjs.getEphemeralUtxoMasterViewingKeyBlindingFactorDeriver({
|
|
4999
4727
|
client
|
|
5000
4728
|
});
|
|
5001
|
-
const ephemeralUtxoPoseidonKeyGenerator = deps.keys?.ephemeralUtxoPoseidonKeyGenerator ??
|
|
5002
|
-
const ephemeralUtxoPoseidonKeyBlindingFactorGenerator = deps.keys?.ephemeralUtxoPoseidonKeyBlindingFactorGenerator ??
|
|
4729
|
+
const ephemeralUtxoPoseidonKeyGenerator = deps.keys?.ephemeralUtxoPoseidonKeyGenerator ?? chunkYFUGKMNS_cjs.getEphemeralUtxoPoseidonPrivateKeyDeriver({ client });
|
|
4730
|
+
const ephemeralUtxoPoseidonKeyBlindingFactorGenerator = deps.keys?.ephemeralUtxoPoseidonKeyBlindingFactorGenerator ?? chunkYFUGKMNS_cjs.getEphemeralUtxoPoseidonPrivateKeyBlindingFactorDeriver({
|
|
5003
4731
|
client
|
|
5004
4732
|
});
|
|
5005
|
-
const poseidonHasher = deps.crypto?.poseidonHasher ??
|
|
5006
|
-
const poseidonAggregator = deps.crypto?.poseidonAggregator ??
|
|
5007
|
-
const poseidonEncryptor = deps.crypto?.poseidonEncryptor ??
|
|
5008
|
-
const poseidonKeystreamGeneratorFunction = deps.crypto?.poseidonKeystreamGenerator ??
|
|
5009
|
-
const userCommitmentGeneratorFunction = deps.crypto?.userCommitmentGenerator ??
|
|
5010
|
-
const keystreamCommitmentGeneratorFunction = deps.crypto?.keystreamCommitmentGenerator ??
|
|
5011
|
-
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();
|
|
5012
4740
|
const generateRandomU2562 = deps.random?.generateRandomU256 ?? chunkZY3TSHMJ_cjs.generateRandomU256;
|
|
5013
4741
|
const generateRandomU1282 = deps.random?.generateRandomU128 ?? chunkZY3TSHMJ_cjs.generateRandomU128;
|
|
5014
4742
|
const protocolFeeProviderFn = deps.fees?.protocolFeeProvider ?? getHardcodedClaimUtxoProtocolFeeProvider();
|
|
@@ -5020,7 +4748,7 @@ function getSelfClaimableUtxoToPublicBalanceClaimerFunction(args, deps) {
|
|
|
5020
4748
|
}
|
|
5021
4749
|
const masterSeedBytes = await client.masterSeed.getMasterSeed();
|
|
5022
4750
|
const generationIndex = providedGenerationIndex ?? generateRandomU2562();
|
|
5023
|
-
const mvkX25519KeypairDeriver = deps.keys?.mvkX25519KeypairDeriver ??
|
|
4751
|
+
const mvkX25519KeypairDeriver = deps.keys?.mvkX25519KeypairDeriver ?? chunkYFUGKMNS_cjs.getUserAccountX25519KeypairDeriver({ client });
|
|
5024
4752
|
const keypairResult = await mvkX25519KeypairDeriver();
|
|
5025
4753
|
const clientX25519PrivateKey = keypairResult.x25519Keypair.privateKey;
|
|
5026
4754
|
const clientX25519PublicKey = keypairResult.x25519Keypair.publicKey;
|
|
@@ -5103,16 +4831,16 @@ function getSelfClaimableUtxoToPublicBalanceClaimerFunction(args, deps) {
|
|
|
5103
4831
|
batches: resultsByBatch
|
|
5104
4832
|
};
|
|
5105
4833
|
} catch (error) {
|
|
5106
|
-
if (error instanceof
|
|
4834
|
+
if (error instanceof chunkKCHHJKQN_cjs.ClaimUtxoError) {
|
|
5107
4835
|
throw error;
|
|
5108
4836
|
}
|
|
5109
4837
|
if (error instanceof chunkFSK2ICMB_cjs.CryptographyError) {
|
|
5110
|
-
throw new
|
|
4838
|
+
throw new chunkKCHHJKQN_cjs.ClaimUtxoError("zk-proof-generation", error.message, error);
|
|
5111
4839
|
}
|
|
5112
|
-
if (error instanceof
|
|
5113
|
-
throw new
|
|
4840
|
+
if (error instanceof chunkKCHHJKQN_cjs.RpcError) {
|
|
4841
|
+
throw new chunkKCHHJKQN_cjs.ClaimUtxoError("initialization", error.message, error);
|
|
5114
4842
|
}
|
|
5115
|
-
throw new
|
|
4843
|
+
throw new chunkKCHHJKQN_cjs.ClaimUtxoError(
|
|
5116
4844
|
"transaction-send",
|
|
5117
4845
|
error instanceof Error ? error.message : String(error),
|
|
5118
4846
|
error instanceof Error ? error : void 0
|
|
@@ -5127,7 +4855,7 @@ function getComplianceGrantIssuerFunction(args, deps) {
|
|
|
5127
4855
|
const { signer } = client;
|
|
5128
4856
|
const getLatestBlockhash = deps?.rpc?.blockhashProvider ?? client.blockhashProvider;
|
|
5129
4857
|
const transactionForwarder = deps?.rpc?.transactionForwarder ?? client.transactionForwarder;
|
|
5130
|
-
const masterViewingKeyX25519KeypairDeriver = deps?.keys?.masterViewingKeyX25519KeypairDeriver ??
|
|
4858
|
+
const masterViewingKeyX25519KeypairDeriver = deps?.keys?.masterViewingKeyX25519KeypairDeriver ?? chunkYFUGKMNS_cjs.getMasterViewingKeyX25519KeypairDeriver({ client });
|
|
5131
4859
|
return /* @__PURE__ */ chunkPK6SKIKE_cjs.__name(async function createUserGrantedComplianceGrant(receiver, granterX25519, receiverX25519, nonce, optionalData, callbacks) {
|
|
5132
4860
|
const userAddress = signer.address;
|
|
5133
4861
|
const programId = client.networkConfig.programId;
|
|
@@ -5171,7 +4899,7 @@ function getComplianceGrantRevokerFunction(args, deps) {
|
|
|
5171
4899
|
const { signer } = client;
|
|
5172
4900
|
const getLatestBlockhash = deps?.rpc?.blockhashProvider ?? client.blockhashProvider;
|
|
5173
4901
|
const transactionForwarder = deps?.rpc?.transactionForwarder ?? client.transactionForwarder;
|
|
5174
|
-
const masterViewingKeyX25519KeypairDeriver = deps?.keys?.masterViewingKeyX25519KeypairDeriver ??
|
|
4902
|
+
const masterViewingKeyX25519KeypairDeriver = deps?.keys?.masterViewingKeyX25519KeypairDeriver ?? chunkYFUGKMNS_cjs.getMasterViewingKeyX25519KeypairDeriver({ client });
|
|
5175
4903
|
return /* @__PURE__ */ chunkPK6SKIKE_cjs.__name(async function deleteUserGrantedComplianceGrant(receiver, granterX25519, receiverX25519, nonce, optionalData, callbacks) {
|
|
5176
4904
|
const userAddress = signer.address;
|
|
5177
4905
|
const programId = client.networkConfig.programId;
|
|
@@ -5670,19 +5398,19 @@ function getNetworkEncryptionToSharedEncryptionConverterFunction(args, deps) {
|
|
|
5670
5398
|
}
|
|
5671
5399
|
return { converted, skipped };
|
|
5672
5400
|
} catch (error) {
|
|
5673
|
-
if (error instanceof
|
|
5401
|
+
if (error instanceof chunkKCHHJKQN_cjs.ConversionError) {
|
|
5674
5402
|
throw error;
|
|
5675
5403
|
}
|
|
5676
|
-
if (error instanceof
|
|
5677
|
-
throw new
|
|
5404
|
+
if (error instanceof chunkKCHHJKQN_cjs.TransactionSigningError) {
|
|
5405
|
+
throw new chunkKCHHJKQN_cjs.ConversionError("transaction-sign", error.message, error);
|
|
5678
5406
|
}
|
|
5679
|
-
if (error instanceof
|
|
5680
|
-
throw new
|
|
5407
|
+
if (error instanceof chunkKCHHJKQN_cjs.TransactionError) {
|
|
5408
|
+
throw new chunkKCHHJKQN_cjs.ConversionError("transaction-send", error.message, error);
|
|
5681
5409
|
}
|
|
5682
|
-
if (error instanceof
|
|
5683
|
-
throw new
|
|
5410
|
+
if (error instanceof chunkKCHHJKQN_cjs.RpcError) {
|
|
5411
|
+
throw new chunkKCHHJKQN_cjs.ConversionError("account-fetch", error.message, error);
|
|
5684
5412
|
}
|
|
5685
|
-
throw new
|
|
5413
|
+
throw new chunkKCHHJKQN_cjs.ConversionError(
|
|
5686
5414
|
"transaction-send",
|
|
5687
5415
|
error instanceof Error ? error.message : String(error),
|
|
5688
5416
|
error instanceof Error ? error : void 0
|
|
@@ -5707,7 +5435,7 @@ function getMintEncryptionKeyRotatorFunction(args, deps) {
|
|
|
5707
5435
|
const accountInfoProvider = deps?.rpc?.accountInfoProvider ?? client.accountInfoProvider;
|
|
5708
5436
|
const getLatestBlockhash = deps?.rpc?.blockhashProvider ?? client.blockhashProvider;
|
|
5709
5437
|
const transactionForwarder = deps?.rpc?.transactionForwarder ?? client.transactionForwarder;
|
|
5710
|
-
const mintX25519KeypairDeriver = deps?.keys?.mintX25519KeypairDeriver ??
|
|
5438
|
+
const mintX25519KeypairDeriver = deps?.keys?.mintX25519KeypairDeriver ?? chunkYFUGKMNS_cjs.getMintX25519KeypairDeriver({ client });
|
|
5711
5439
|
return /* @__PURE__ */ chunkPK6SKIKE_cjs.__name(async function rotateMintX25519EncryptionKey(mint, optionalData, callbacks, microLamportsPerAcu, options) {
|
|
5712
5440
|
const accountInfoCommitment = options?.accountInfoCommitment ?? "confirmed";
|
|
5713
5441
|
const userAddress = signer.address;
|
|
@@ -5846,71 +5574,85 @@ async function signTransactionMessage(signer, transactionMessage) {
|
|
|
5846
5574
|
chunkPK6SKIKE_cjs.__name(signTransactionMessage, "signTransactionMessage");
|
|
5847
5575
|
async function forwardAndMonitor(config, signedTransaction, callbacks, awaitCallback) {
|
|
5848
5576
|
const { transactionForwarder, computationMonitor } = config;
|
|
5849
|
-
|
|
5850
|
-
|
|
5851
|
-
|
|
5852
|
-
|
|
5853
|
-
|
|
5854
|
-
|
|
5855
|
-
|
|
5856
|
-
|
|
5857
|
-
|
|
5858
|
-
|
|
5859
|
-
|
|
5860
|
-
|
|
5861
|
-
|
|
5862
|
-
|
|
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
|
|
5863
5597
|
);
|
|
5864
5598
|
}
|
|
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
|
-
)
|
|
5900
|
-
|
|
5901
|
-
|
|
5902
|
-
} catch (error) {
|
|
5903
|
-
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
|
+
}
|
|
5904
5636
|
}
|
|
5905
5637
|
}
|
|
5638
|
+
return {
|
|
5639
|
+
signature: txSignature,
|
|
5640
|
+
signedTransaction,
|
|
5641
|
+
callbackResult,
|
|
5642
|
+
rentClaimSignature,
|
|
5643
|
+
rentClaimError
|
|
5644
|
+
};
|
|
5645
|
+
} finally {
|
|
5646
|
+
prepared?.cleanup();
|
|
5906
5647
|
}
|
|
5907
|
-
return { signature: txSignature, signedTransaction, callbackResult, rentClaimSignature, rentClaimError };
|
|
5908
5648
|
}
|
|
5909
5649
|
chunkPK6SKIKE_cjs.__name(forwardAndMonitor, "forwardAndMonitor");
|
|
5910
5650
|
async function executeComputationTransaction(config, options, awaitCallback) {
|
|
5911
5651
|
const { signer, getLatestBlockhash } = config;
|
|
5912
5652
|
const { instruction, preInstructions, altEntry, callbacks, blockhashCommitment } = options;
|
|
5913
|
-
const latestBlockhash = await getLatestBlockhash({
|
|
5653
|
+
const latestBlockhash = await getLatestBlockhash({
|
|
5654
|
+
commitment: blockhashCommitment ?? "confirmed"
|
|
5655
|
+
});
|
|
5914
5656
|
const allInstructions = preInstructions === void 0 ? [instruction] : [...preInstructions, instruction];
|
|
5915
5657
|
const transactionMessage = buildTransactionMessage(
|
|
5916
5658
|
signer,
|
|
@@ -5967,6 +5709,7 @@ function getPublicBalanceToEncryptedBalanceDirectDepositorFunction(args, deps) {
|
|
|
5967
5709
|
if ("callbackResult" in result) {
|
|
5968
5710
|
return {
|
|
5969
5711
|
queueSignature: result.signature,
|
|
5712
|
+
callbackStatus: result.callbackResult.status,
|
|
5970
5713
|
callbackSignature: "callbackSignature" in result.callbackResult ? result.callbackResult.callbackSignature : void 0,
|
|
5971
5714
|
callbackElapsedMs: result.callbackResult.elapsedMs,
|
|
5972
5715
|
rentClaimSignature: result.rentClaimSignature,
|
|
@@ -5975,10 +5718,10 @@ function getPublicBalanceToEncryptedBalanceDirectDepositorFunction(args, deps) {
|
|
|
5975
5718
|
}
|
|
5976
5719
|
return { queueSignature: result.signature };
|
|
5977
5720
|
} catch (error) {
|
|
5978
|
-
if (error instanceof
|
|
5721
|
+
if (error instanceof chunkKCHHJKQN_cjs.EncryptedDepositError) {
|
|
5979
5722
|
throw error;
|
|
5980
5723
|
}
|
|
5981
|
-
throw new
|
|
5724
|
+
throw new chunkKCHHJKQN_cjs.EncryptedDepositError(
|
|
5982
5725
|
"transaction-send",
|
|
5983
5726
|
`Transaction execution failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
5984
5727
|
error instanceof Error ? error : void 0
|
|
@@ -5993,27 +5736,27 @@ function getPublicBalanceToEncryptedBalanceDirectDepositorFunction(args, deps) {
|
|
|
5993
5736
|
const optionalData = options?.optionalData ?? new Uint8Array(32);
|
|
5994
5737
|
try {
|
|
5995
5738
|
if (destinationAddress.trim().length === 0) {
|
|
5996
|
-
throw new
|
|
5739
|
+
throw new chunkKCHHJKQN_cjs.EncryptedDepositError(
|
|
5997
5740
|
"validation",
|
|
5998
5741
|
"Invalid destinationAddress: must be a non-empty string"
|
|
5999
5742
|
);
|
|
6000
5743
|
}
|
|
6001
5744
|
if (mint.trim().length === 0) {
|
|
6002
|
-
throw new
|
|
5745
|
+
throw new chunkKCHHJKQN_cjs.EncryptedDepositError("validation", "Invalid mint: must be a non-empty string");
|
|
6003
5746
|
}
|
|
6004
5747
|
chunkLTCKPTZC_cjs.assertU64(transferAmount);
|
|
6005
5748
|
if (transferAmount <= 0n) {
|
|
6006
|
-
throw new
|
|
5749
|
+
throw new chunkKCHHJKQN_cjs.EncryptedDepositError(
|
|
6007
5750
|
"validation",
|
|
6008
5751
|
"Invalid transferAmount: must be greater than zero"
|
|
6009
5752
|
);
|
|
6010
5753
|
}
|
|
6011
5754
|
chunkLTCKPTZC_cjs.assertOptionalData32(optionalData, "optionalData");
|
|
6012
5755
|
} catch (error) {
|
|
6013
|
-
if (error instanceof
|
|
5756
|
+
if (error instanceof chunkKCHHJKQN_cjs.EncryptedDepositError) {
|
|
6014
5757
|
throw error;
|
|
6015
5758
|
}
|
|
6016
|
-
throw new
|
|
5759
|
+
throw new chunkKCHHJKQN_cjs.EncryptedDepositError(
|
|
6017
5760
|
"validation",
|
|
6018
5761
|
error instanceof Error ? error.message : String(error),
|
|
6019
5762
|
error instanceof Error ? error : void 0
|
|
@@ -6025,7 +5768,7 @@ function getPublicBalanceToEncryptedBalanceDirectDepositorFunction(args, deps) {
|
|
|
6025
5768
|
const mintAccountMap = await accountInfoProvider([mint], { commitment: accountInfoCommitment });
|
|
6026
5769
|
const mintAccount = mintAccountMap.get(mint);
|
|
6027
5770
|
if (mintAccount?.exists !== true) {
|
|
6028
|
-
throw new
|
|
5771
|
+
throw new chunkKCHHJKQN_cjs.EncryptedDepositError("mint-fetch", `Mint account not found: ${mint}`);
|
|
6029
5772
|
}
|
|
6030
5773
|
mintOwner = mintAccount.programAddress;
|
|
6031
5774
|
if (mintOwner === chunk43JEHY7D_cjs.TOKEN_2022_PROGRAM_ID) {
|
|
@@ -6038,7 +5781,7 @@ function getPublicBalanceToEncryptedBalanceDirectDepositorFunction(args, deps) {
|
|
|
6038
5781
|
const transferFee = chunkZY3TSHMJ_cjs.calculateTransferFee(feeConfig, epochInfo.epoch, transferAmount);
|
|
6039
5782
|
const calculatedDepositAmount = transferAmount - transferFee;
|
|
6040
5783
|
if (calculatedDepositAmount <= 0n) {
|
|
6041
|
-
throw new
|
|
5784
|
+
throw new chunkKCHHJKQN_cjs.EncryptedDepositError(
|
|
6042
5785
|
"fee-calculation",
|
|
6043
5786
|
`Transfer fee (${String(transferFee)}) exceeds or equals transfer amount (${String(transferAmount)}). Deposit amount must be greater than zero.`
|
|
6044
5787
|
);
|
|
@@ -6049,16 +5792,16 @@ function getPublicBalanceToEncryptedBalanceDirectDepositorFunction(args, deps) {
|
|
|
6049
5792
|
} else if (mintOwner === chunk43JEHY7D_cjs.SPL_TOKEN_PROGRAM_ID) {
|
|
6050
5793
|
depositAmount = transferAmount;
|
|
6051
5794
|
} else {
|
|
6052
|
-
throw new
|
|
5795
|
+
throw new chunkKCHHJKQN_cjs.EncryptedDepositError(
|
|
6053
5796
|
"mint-fetch",
|
|
6054
5797
|
`Unknown token program: ${mintOwner}. Expected SPL Token (${chunk43JEHY7D_cjs.SPL_TOKEN_PROGRAM_ID}) or Token-2022 (${chunk43JEHY7D_cjs.TOKEN_2022_PROGRAM_ID})`
|
|
6055
5798
|
);
|
|
6056
5799
|
}
|
|
6057
5800
|
} catch (error) {
|
|
6058
|
-
if (error instanceof
|
|
5801
|
+
if (error instanceof chunkKCHHJKQN_cjs.EncryptedDepositError) {
|
|
6059
5802
|
throw error;
|
|
6060
5803
|
}
|
|
6061
|
-
throw new
|
|
5804
|
+
throw new chunkKCHHJKQN_cjs.EncryptedDepositError(
|
|
6062
5805
|
"mint-fetch",
|
|
6063
5806
|
`Failed to fetch mint account: ${error instanceof Error ? error.message : String(error)}`,
|
|
6064
5807
|
error instanceof Error ? error : void 0
|
|
@@ -6072,7 +5815,7 @@ function getPublicBalanceToEncryptedBalanceDirectDepositorFunction(args, deps) {
|
|
|
6072
5815
|
chunkUEI7SYH6_cjs.findEncryptedUserAccountPda(destinationAddress, client.networkConfig.programId)
|
|
6073
5816
|
]);
|
|
6074
5817
|
} catch (error) {
|
|
6075
|
-
throw new
|
|
5818
|
+
throw new chunkKCHHJKQN_cjs.EncryptedDepositError(
|
|
6076
5819
|
"pda-derivation",
|
|
6077
5820
|
`Failed to derive PDA addresses: ${error instanceof Error ? error.message : String(error)}`,
|
|
6078
5821
|
error instanceof Error ? error : void 0
|
|
@@ -6090,13 +5833,13 @@ function getPublicBalanceToEncryptedBalanceDirectDepositorFunction(args, deps) {
|
|
|
6090
5833
|
const encodedUserAccount = accountMap.get(encryptedUserAccountPda);
|
|
6091
5834
|
const encodedTokenAccount = accountMap.get(encryptedTokenAccountPda);
|
|
6092
5835
|
if (encodedUserAccount === void 0) {
|
|
6093
|
-
throw new
|
|
5836
|
+
throw new chunkKCHHJKQN_cjs.EncryptedDepositError(
|
|
6094
5837
|
"account-fetch",
|
|
6095
5838
|
`Failed to fetch account info for user PDA: ${encryptedUserAccountPda}`
|
|
6096
5839
|
);
|
|
6097
5840
|
}
|
|
6098
5841
|
if (encodedTokenAccount === void 0) {
|
|
6099
|
-
throw new
|
|
5842
|
+
throw new chunkKCHHJKQN_cjs.EncryptedDepositError(
|
|
6100
5843
|
"account-fetch",
|
|
6101
5844
|
`Failed to fetch account info for token PDA: ${encryptedTokenAccountPda}`
|
|
6102
5845
|
);
|
|
@@ -6107,10 +5850,10 @@ function getPublicBalanceToEncryptedBalanceDirectDepositorFunction(args, deps) {
|
|
|
6107
5850
|
accountMap.get(client.networkConfig.mxeAccountAddress)
|
|
6108
5851
|
);
|
|
6109
5852
|
} catch (error) {
|
|
6110
|
-
if (error instanceof
|
|
5853
|
+
if (error instanceof chunkKCHHJKQN_cjs.EncryptedDepositError) {
|
|
6111
5854
|
throw error;
|
|
6112
5855
|
}
|
|
6113
|
-
throw new
|
|
5856
|
+
throw new chunkKCHHJKQN_cjs.EncryptedDepositError(
|
|
6114
5857
|
"account-fetch",
|
|
6115
5858
|
`Failed to fetch accounts: ${error instanceof Error ? error.message : String(error)}`,
|
|
6116
5859
|
error instanceof Error ? error : void 0
|
|
@@ -6186,7 +5929,7 @@ function getPublicBalanceToEncryptedBalanceDirectDepositorFunction(args, deps) {
|
|
|
6186
5929
|
}
|
|
6187
5930
|
} else {
|
|
6188
5931
|
if (tokenExists && isBalanceInitialised && isSharedMode) {
|
|
6189
|
-
throw new
|
|
5932
|
+
throw new chunkKCHHJKQN_cjs.EncryptedDepositError(
|
|
6190
5933
|
"validation",
|
|
6191
5934
|
"Invalid state: Token account is in Shared mode but user has no X25519 key registered"
|
|
6192
5935
|
);
|
|
@@ -6294,17 +6037,17 @@ function getPublicBalanceToEncryptedBalanceDirectDepositorFunction(args, deps) {
|
|
|
6294
6037
|
break;
|
|
6295
6038
|
}
|
|
6296
6039
|
default: {
|
|
6297
|
-
throw new
|
|
6040
|
+
throw new chunkKCHHJKQN_cjs.EncryptedDepositError(
|
|
6298
6041
|
"instruction-build",
|
|
6299
6042
|
`Unknown instruction variant: ${String(instructionVariant)}`
|
|
6300
6043
|
);
|
|
6301
6044
|
}
|
|
6302
6045
|
}
|
|
6303
6046
|
} catch (error) {
|
|
6304
|
-
if (error instanceof
|
|
6047
|
+
if (error instanceof chunkKCHHJKQN_cjs.EncryptedDepositError) {
|
|
6305
6048
|
throw error;
|
|
6306
6049
|
}
|
|
6307
|
-
throw new
|
|
6050
|
+
throw new chunkKCHHJKQN_cjs.EncryptedDepositError(
|
|
6308
6051
|
"instruction-build",
|
|
6309
6052
|
`Failed to build instruction: ${error instanceof Error ? error.message : String(error)}`,
|
|
6310
6053
|
error instanceof Error ? error : void 0
|
|
@@ -6376,32 +6119,32 @@ function getEncryptedBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
6376
6119
|
const factoryCloseProofAccountCallbacks = deps.hooks?.closeProofAccount;
|
|
6377
6120
|
const factoryCreateProofAccountCallbacks = deps.hooks?.createProofAccount;
|
|
6378
6121
|
const factoryCreateUtxoCallbacks = deps.hooks?.createUtxo;
|
|
6379
|
-
const masterViewingKeyGenerator = deps.keys?.masterViewingKeyGenerator ??
|
|
6380
|
-
const masterViewingKeyBlindingFactorGenerator = deps.keys?.masterViewingKeyBlindingFactorGenerator ??
|
|
6381
|
-
const poseidonPrivateKeyGenerator = deps.keys?.poseidonPrivateKeyGenerator ??
|
|
6382
|
-
const poseidonBlindingFactorGenerator = deps.keys?.poseidonBlindingFactorGenerator ??
|
|
6383
|
-
const mvkX25519KeypairDeriver = deps.keys?.mvkX25519KeypairDeriver ??
|
|
6384
|
-
const secondViewingKeyGenerator = deps.keys?.secondViewingKeyGenerator ??
|
|
6385
|
-
const ephemeralUtxoMvkGenerator = deps.keys?.ephemeralUtxoMasterViewingKeyDeriver ??
|
|
6386
|
-
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({
|
|
6387
6130
|
client
|
|
6388
6131
|
});
|
|
6389
|
-
const ephemeralUtxoPoseidonKeyGenerator = deps.keys?.ephemeralUtxoPoseidonKeyGenerator ??
|
|
6390
|
-
const ephemeralUtxoPoseidonKeyBlindingFactorGenerator = deps.keys?.ephemeralUtxoPoseidonKeyBlindingFactorGenerator ??
|
|
6132
|
+
const ephemeralUtxoPoseidonKeyGenerator = deps.keys?.ephemeralUtxoPoseidonKeyGenerator ?? chunkYFUGKMNS_cjs.getEphemeralUtxoPoseidonPrivateKeyDeriver({ client });
|
|
6133
|
+
const ephemeralUtxoPoseidonKeyBlindingFactorGenerator = deps.keys?.ephemeralUtxoPoseidonKeyBlindingFactorGenerator ?? chunkYFUGKMNS_cjs.getEphemeralUtxoPoseidonPrivateKeyBlindingFactorDeriver({
|
|
6391
6134
|
client
|
|
6392
6135
|
});
|
|
6393
|
-
const poseidonKeystreamBlindingFactorGenerator = deps.keys?.poseidonKeystreamBlindingFactorGenerator ??
|
|
6394
|
-
const poseidonEncryptor = deps.crypto?.poseidonEncryptor ??
|
|
6395
|
-
const poseidonKeystreamGenerator = deps.crypto?.poseidonKeystreamGenerator ??
|
|
6396
|
-
const h2Generator = deps.crypto?.h2Generator ??
|
|
6397
|
-
const keystreamCommitmentGenerator = deps.crypto?.keystreamCommitmentGenerator ??
|
|
6398
|
-
const userCommitmentGenerator =
|
|
6399
|
-
const rescueEncryptionCommitmentGenerator =
|
|
6400
|
-
const poseidonAggregator =
|
|
6401
|
-
const fiatShamirChallengeGenerator =
|
|
6402
|
-
const challengePowersFunction =
|
|
6403
|
-
const polynomialEvaluator =
|
|
6404
|
-
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();
|
|
6405
6148
|
const generateRandomU256Function = deps.random?.generateRandomU256 ?? chunkZY3TSHMJ_cjs.generateRandomU256;
|
|
6406
6149
|
const generateComputationOffsetFunction = deps.random?.generateComputationOffset ?? chunkZY3TSHMJ_cjs.generateComputationOffset;
|
|
6407
6150
|
return /* @__PURE__ */ chunkPK6SKIKE_cjs.__name(async function createSelfClaimableUtxo(args2, options) {
|
|
@@ -6429,12 +6172,12 @@ function getEncryptedBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
6429
6172
|
masterSeed,
|
|
6430
6173
|
{ dkLen: 16, personalization: generationIndexBytes }
|
|
6431
6174
|
);
|
|
6432
|
-
const expandedModifiedGenerationIndex =
|
|
6175
|
+
const expandedModifiedGenerationIndex = chunkYFUGKMNS_cjs.expandModifiedGenerationIndex(modifiedGenerationIndex);
|
|
6433
6176
|
let expandedModifiedGenerationIndexU256 = 0n;
|
|
6434
6177
|
for (let index = 0; index < 32; index++) {
|
|
6435
6178
|
expandedModifiedGenerationIndexU256 |= BigInt(expandedModifiedGenerationIndex[index]) << BigInt(index * 8);
|
|
6436
6179
|
}
|
|
6437
|
-
const proofAccountOffsetBytes =
|
|
6180
|
+
const proofAccountOffsetBytes = chunkYFUGKMNS_cjs.deriveProofAccountOffsetFromModifiedGenerationIndex(modifiedGenerationIndex);
|
|
6438
6181
|
let proofAccountOffset = 0n;
|
|
6439
6182
|
for (let index = 0; index < 16; index++) {
|
|
6440
6183
|
proofAccountOffset |= BigInt(proofAccountOffsetBytes[index]) << BigInt(index * 8);
|
|
@@ -6500,9 +6243,9 @@ function getEncryptedBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
6500
6243
|
);
|
|
6501
6244
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(senderUserCommitment);
|
|
6502
6245
|
const ephemeralOffset = expandedModifiedGenerationIndexU256;
|
|
6503
|
-
const randomSecret =
|
|
6246
|
+
const randomSecret = chunkYFUGKMNS_cjs.deriveRandomSecretFromModifiedGenerationIndex(modifiedGenerationIndex);
|
|
6504
6247
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(randomSecret);
|
|
6505
|
-
const nullifier =
|
|
6248
|
+
const nullifier = chunkYFUGKMNS_cjs.deriveNullifierFromModifiedGenerationIndex(modifiedGenerationIndex);
|
|
6506
6249
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(nullifier);
|
|
6507
6250
|
const ephemeralMasterViewingKey = await ephemeralUtxoMvkGenerator(ephemeralOffset);
|
|
6508
6251
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(ephemeralMasterViewingKey);
|
|
@@ -6593,10 +6336,10 @@ function getEncryptedBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
6593
6336
|
const clientX25519PrivateKey = keypairResult.x25519Keypair.privateKey;
|
|
6594
6337
|
chunkLTCKPTZC_cjs.assertX25519PrivateKey(clientX25519PrivateKey);
|
|
6595
6338
|
const clientX25519PublicKey = keypairResult.x25519Keypair.publicKey;
|
|
6596
|
-
const rcEncryptor =
|
|
6339
|
+
const rcEncryptor = chunkYFUGKMNS_cjs.getRescueEncryptorFromPrivateKey(clientX25519PrivateKey, {
|
|
6597
6340
|
umbraX25519PublicKey: client.networkConfig.mxePubkey
|
|
6598
6341
|
});
|
|
6599
|
-
const randomFactorForPolynomialCommitment =
|
|
6342
|
+
const randomFactorForPolynomialCommitment = chunkYFUGKMNS_cjs.deriveRandomFactorForPolynomialCommitmentFromModifiedGenerationIndex(
|
|
6600
6343
|
modifiedGenerationIndex
|
|
6601
6344
|
);
|
|
6602
6345
|
chunkLTCKPTZC_cjs.assertU256(randomFactorForPolynomialCommitment);
|
|
@@ -6632,7 +6375,7 @@ function getEncryptedBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
6632
6375
|
chunkLTCKPTZC_cjs.assertRcCiphertext(rcEncryptedProtocolFees);
|
|
6633
6376
|
chunkLTCKPTZC_cjs.assertRcCiphertext(rcEncryptedRandomFactorLow);
|
|
6634
6377
|
chunkLTCKPTZC_cjs.assertRcCiphertext(rcEncryptedRandomFactorHigh);
|
|
6635
|
-
const rcKeyGenerator =
|
|
6378
|
+
const rcKeyGenerator = chunkYFUGKMNS_cjs.getRescueKeyGeneratorFromPrivateKey(clientX25519PrivateKey, {
|
|
6636
6379
|
umbraX25519PublicKey: client.networkConfig.mxePubkey
|
|
6637
6380
|
});
|
|
6638
6381
|
const rcEncryptionKeys = await rcKeyGenerator(
|
|
@@ -6685,7 +6428,7 @@ function getEncryptedBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
6685
6428
|
const rcEncryptionKeyForRandomFactorHighAsLimbs = chunkZY3TSHMJ_cjs.convertU256ToBase85Limbs(
|
|
6686
6429
|
toU256(rcEncryptionKeyForRandomFactorHigh)
|
|
6687
6430
|
);
|
|
6688
|
-
const rescueEncryptionCommitmentBlindingFactor =
|
|
6431
|
+
const rescueEncryptionCommitmentBlindingFactor = chunkYFUGKMNS_cjs.deriveRescueEncryptionCommitmentBlindingFactorFromModifiedGenerationIndex(
|
|
6689
6432
|
modifiedGenerationIndex
|
|
6690
6433
|
);
|
|
6691
6434
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(rescueEncryptionCommitmentBlindingFactor);
|
|
@@ -7067,7 +6810,7 @@ function getEncryptedBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
7067
6810
|
try {
|
|
7068
6811
|
latestBlockhashData = await getLatestBlockhash();
|
|
7069
6812
|
} catch (error) {
|
|
7070
|
-
throw new
|
|
6813
|
+
throw new chunkKCHHJKQN_cjs.RpcError(
|
|
7071
6814
|
`Failed to fetch latest blockhash: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
7072
6815
|
{ cause: error }
|
|
7073
6816
|
);
|
|
@@ -7083,7 +6826,7 @@ function getEncryptedBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
7083
6826
|
const transaction = kit.compileTransaction(transactionMessage);
|
|
7084
6827
|
const signedTransaction = await client.signer.signTransaction(transaction);
|
|
7085
6828
|
if (!isSignedTransaction(signedTransaction)) {
|
|
7086
|
-
throw new
|
|
6829
|
+
throw new chunkKCHHJKQN_cjs.TransactionError(`${instructionName}: Transaction was not properly signed`);
|
|
7087
6830
|
}
|
|
7088
6831
|
const result2 = await forwardAndMonitor(
|
|
7089
6832
|
executorConfig,
|
|
@@ -7098,6 +6841,7 @@ function getEncryptedBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
7098
6841
|
return {
|
|
7099
6842
|
signedTransaction: result2.signedTransaction,
|
|
7100
6843
|
signature: result2.signature,
|
|
6844
|
+
callbackStatus: callbackResult?.status,
|
|
7101
6845
|
callbackSignature,
|
|
7102
6846
|
callbackElapsedMs: callbackResult?.elapsedMs,
|
|
7103
6847
|
rentClaimSignature,
|
|
@@ -7276,6 +7020,7 @@ function getEncryptedBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
7276
7020
|
closeProofAccountSignature: closeResult?.signature,
|
|
7277
7021
|
createProofAccountSignature: proofAccountResult.signature,
|
|
7278
7022
|
queueSignature: utxoResult.signature,
|
|
7023
|
+
callbackStatus: utxoResult.callbackStatus,
|
|
7279
7024
|
callbackSignature: utxoResult.callbackSignature,
|
|
7280
7025
|
callbackElapsedMs: utxoResult.callbackElapsedMs,
|
|
7281
7026
|
rentClaimSignature: utxoResult.rentClaimSignature,
|
|
@@ -7283,22 +7028,22 @@ function getEncryptedBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
7283
7028
|
};
|
|
7284
7029
|
return result;
|
|
7285
7030
|
} catch (error) {
|
|
7286
|
-
if (error instanceof
|
|
7031
|
+
if (error instanceof chunkKCHHJKQN_cjs.CreateUtxoError) {
|
|
7287
7032
|
throw error;
|
|
7288
7033
|
}
|
|
7289
|
-
if (error instanceof
|
|
7290
|
-
throw new
|
|
7034
|
+
if (error instanceof chunkKCHHJKQN_cjs.TransactionSigningError) {
|
|
7035
|
+
throw new chunkKCHHJKQN_cjs.CreateUtxoError("transaction-sign", error.message, error);
|
|
7291
7036
|
}
|
|
7292
7037
|
if (error instanceof chunkFSK2ICMB_cjs.CryptographyError) {
|
|
7293
|
-
throw new
|
|
7038
|
+
throw new chunkKCHHJKQN_cjs.CreateUtxoError("zk-proof-generation", error.message, error);
|
|
7294
7039
|
}
|
|
7295
|
-
if (error instanceof
|
|
7296
|
-
throw new
|
|
7040
|
+
if (error instanceof chunkKCHHJKQN_cjs.TransactionError) {
|
|
7041
|
+
throw new chunkKCHHJKQN_cjs.CreateUtxoError("transaction-send", error.message, error);
|
|
7297
7042
|
}
|
|
7298
|
-
if (error instanceof
|
|
7299
|
-
throw new
|
|
7043
|
+
if (error instanceof chunkKCHHJKQN_cjs.RpcError) {
|
|
7044
|
+
throw new chunkKCHHJKQN_cjs.CreateUtxoError("account-fetch", error.message, error);
|
|
7300
7045
|
}
|
|
7301
|
-
throw new
|
|
7046
|
+
throw new chunkKCHHJKQN_cjs.CreateUtxoError(
|
|
7302
7047
|
"transaction-send",
|
|
7303
7048
|
error instanceof Error ? error.message : String(error),
|
|
7304
7049
|
error instanceof Error ? error : void 0
|
|
@@ -7364,24 +7109,24 @@ function getEncryptedBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
7364
7109
|
const factoryCloseProofAccountCallbacks = deps.hooks?.closeProofAccount;
|
|
7365
7110
|
const factoryCreateProofAccountCallbacks = deps.hooks?.createProofAccount;
|
|
7366
7111
|
const factoryCreateUtxoCallbacks = deps.hooks?.createUtxo;
|
|
7367
|
-
const masterViewingKeyGenerator = deps.keys?.masterViewingKeyGenerator ??
|
|
7368
|
-
const masterViewingKeyBlindingFactorGenerator = deps.keys?.masterViewingKeyBlindingFactorGenerator ??
|
|
7369
|
-
const poseidonPrivateKeyGenerator = deps.keys?.poseidonPrivateKeyGenerator ??
|
|
7370
|
-
const poseidonBlindingFactorGenerator = deps.keys?.poseidonBlindingFactorGenerator ??
|
|
7371
|
-
const mvkX25519KeypairDeriver = deps.keys?.mvkX25519KeypairDeriver ??
|
|
7372
|
-
const secondViewingKeyGenerator = deps.keys?.secondViewingKeyGenerator ??
|
|
7373
|
-
const poseidonKeystreamBlindingFactorGenerator = deps.keys?.poseidonKeystreamBlindingFactorGenerator ??
|
|
7374
|
-
const poseidonEncryptor = deps.crypto?.poseidonEncryptor ??
|
|
7375
|
-
const poseidonKeystreamGenerator = deps.crypto?.poseidonKeystreamGenerator ??
|
|
7376
|
-
const h2Generator = deps.crypto?.h2Generator ??
|
|
7377
|
-
const keystreamCommitmentGenerator = deps.crypto?.keystreamCommitmentGenerator ??
|
|
7378
|
-
const userCommitmentGenerator =
|
|
7379
|
-
const rescueEncryptionCommitmentGenerator =
|
|
7380
|
-
const poseidonAggregator =
|
|
7381
|
-
const fiatShamirChallengeGenerator =
|
|
7382
|
-
const challengePowersFunction =
|
|
7383
|
-
const polynomialEvaluator =
|
|
7384
|
-
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();
|
|
7385
7130
|
const generateRandomU256Function = deps.random?.generateRandomU256 ?? chunkZY3TSHMJ_cjs.generateRandomU256;
|
|
7386
7131
|
const generateComputationOffsetFunction = deps.random?.generateComputationOffset ?? chunkZY3TSHMJ_cjs.generateComputationOffset;
|
|
7387
7132
|
return /* @__PURE__ */ chunkPK6SKIKE_cjs.__name(async function createReceiverClaimableUtxo(args2, options) {
|
|
@@ -7405,12 +7150,12 @@ function getEncryptedBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
7405
7150
|
masterSeed,
|
|
7406
7151
|
{ dkLen: 16, personalization: generationIndexBytes }
|
|
7407
7152
|
);
|
|
7408
|
-
const expandedModifiedGenerationIndex =
|
|
7153
|
+
const expandedModifiedGenerationIndex = chunkYFUGKMNS_cjs.expandModifiedGenerationIndex(modifiedGenerationIndex);
|
|
7409
7154
|
let _expandedModifiedGenerationIndexU256 = 0n;
|
|
7410
7155
|
for (let index = 0; index < 32; index++) {
|
|
7411
7156
|
_expandedModifiedGenerationIndexU256 |= BigInt(expandedModifiedGenerationIndex[index]) << BigInt(index * 8);
|
|
7412
7157
|
}
|
|
7413
|
-
const proofAccountOffsetBytes =
|
|
7158
|
+
const proofAccountOffsetBytes = chunkYFUGKMNS_cjs.deriveProofAccountOffsetFromModifiedGenerationIndex(modifiedGenerationIndex);
|
|
7414
7159
|
let proofAccountOffset = 0n;
|
|
7415
7160
|
for (let index = 0; index < 16; index++) {
|
|
7416
7161
|
proofAccountOffset |= BigInt(proofAccountOffsetBytes[index]) << BigInt(index * 8);
|
|
@@ -7504,9 +7249,9 @@ function getEncryptedBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
7504
7249
|
senderPrivateKeyBlindingFactor
|
|
7505
7250
|
);
|
|
7506
7251
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(senderUserCommitment);
|
|
7507
|
-
const randomSecret =
|
|
7252
|
+
const randomSecret = chunkYFUGKMNS_cjs.deriveRandomSecretFromModifiedGenerationIndex(modifiedGenerationIndex);
|
|
7508
7253
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(randomSecret);
|
|
7509
|
-
const nullifier =
|
|
7254
|
+
const nullifier = chunkYFUGKMNS_cjs.deriveNullifierFromModifiedGenerationIndex(modifiedGenerationIndex);
|
|
7510
7255
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(nullifier);
|
|
7511
7256
|
const unlockingUserCommitment = receiverUserCommitment;
|
|
7512
7257
|
const h2Hash = await h2Generator.generateH2({
|
|
@@ -7583,10 +7328,10 @@ function getEncryptedBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
7583
7328
|
const clientX25519PrivateKey = keypairResult.x25519Keypair.privateKey;
|
|
7584
7329
|
chunkLTCKPTZC_cjs.assertX25519PrivateKey(clientX25519PrivateKey);
|
|
7585
7330
|
const clientX25519PublicKey = keypairResult.x25519Keypair.publicKey;
|
|
7586
|
-
const rcEncryptor =
|
|
7331
|
+
const rcEncryptor = chunkYFUGKMNS_cjs.getRescueEncryptorFromPrivateKey(clientX25519PrivateKey, {
|
|
7587
7332
|
umbraX25519PublicKey: client.networkConfig.mxePubkey
|
|
7588
7333
|
});
|
|
7589
|
-
const randomFactorForPolynomialCommitment =
|
|
7334
|
+
const randomFactorForPolynomialCommitment = chunkYFUGKMNS_cjs.deriveRandomFactorForPolynomialCommitmentFromModifiedGenerationIndex(
|
|
7590
7335
|
modifiedGenerationIndex
|
|
7591
7336
|
);
|
|
7592
7337
|
chunkLTCKPTZC_cjs.assertU256(randomFactorForPolynomialCommitment);
|
|
@@ -7622,7 +7367,7 @@ function getEncryptedBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
7622
7367
|
chunkLTCKPTZC_cjs.assertRcCiphertext(rcEncryptedProtocolFees);
|
|
7623
7368
|
chunkLTCKPTZC_cjs.assertRcCiphertext(rcEncryptedRandomFactorLow);
|
|
7624
7369
|
chunkLTCKPTZC_cjs.assertRcCiphertext(rcEncryptedRandomFactorHigh);
|
|
7625
|
-
const rcKeyGenerator =
|
|
7370
|
+
const rcKeyGenerator = chunkYFUGKMNS_cjs.getRescueKeyGeneratorFromPrivateKey(clientX25519PrivateKey, {
|
|
7626
7371
|
umbraX25519PublicKey: client.networkConfig.mxePubkey
|
|
7627
7372
|
});
|
|
7628
7373
|
const rcEncryptionKeys = await rcKeyGenerator(
|
|
@@ -7675,7 +7420,7 @@ function getEncryptedBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
7675
7420
|
const rcEncryptionKeyForRandomFactorHighAsLimbs = chunkZY3TSHMJ_cjs.convertU256ToBase85Limbs(
|
|
7676
7421
|
toU2562(rcEncryptionKeyForRandomFactorHigh)
|
|
7677
7422
|
);
|
|
7678
|
-
const rescueEncryptionCommitmentBlindingFactor =
|
|
7423
|
+
const rescueEncryptionCommitmentBlindingFactor = chunkYFUGKMNS_cjs.deriveRescueEncryptionCommitmentBlindingFactorFromModifiedGenerationIndex(
|
|
7679
7424
|
modifiedGenerationIndex
|
|
7680
7425
|
);
|
|
7681
7426
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(rescueEncryptionCommitmentBlindingFactor);
|
|
@@ -8057,7 +7802,7 @@ function getEncryptedBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8057
7802
|
try {
|
|
8058
7803
|
latestBlockhashData = await getLatestBlockhash();
|
|
8059
7804
|
} catch (error) {
|
|
8060
|
-
throw new
|
|
7805
|
+
throw new chunkKCHHJKQN_cjs.RpcError(
|
|
8061
7806
|
`Failed to fetch latest blockhash: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
8062
7807
|
{ cause: error }
|
|
8063
7808
|
);
|
|
@@ -8073,7 +7818,7 @@ function getEncryptedBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8073
7818
|
const transaction = kit.compileTransaction(transactionMessage);
|
|
8074
7819
|
const signedTransaction = await client.signer.signTransaction(transaction);
|
|
8075
7820
|
if (!isSignedTransaction2(signedTransaction)) {
|
|
8076
|
-
throw new
|
|
7821
|
+
throw new chunkKCHHJKQN_cjs.TransactionError(`${instructionName}: Transaction was not properly signed`);
|
|
8077
7822
|
}
|
|
8078
7823
|
const result2 = await forwardAndMonitor(
|
|
8079
7824
|
executorConfig,
|
|
@@ -8088,6 +7833,7 @@ function getEncryptedBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8088
7833
|
return {
|
|
8089
7834
|
signedTransaction: result2.signedTransaction,
|
|
8090
7835
|
signature: result2.signature,
|
|
7836
|
+
callbackStatus: callbackResult?.status,
|
|
8091
7837
|
callbackSignature,
|
|
8092
7838
|
callbackElapsedMs: callbackResult?.elapsedMs,
|
|
8093
7839
|
rentClaimSignature,
|
|
@@ -8262,6 +8008,7 @@ function getEncryptedBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8262
8008
|
closeProofAccountSignature: closeResult?.signature,
|
|
8263
8009
|
createProofAccountSignature: proofAccountResult.signature,
|
|
8264
8010
|
queueSignature: utxoResult.signature,
|
|
8011
|
+
callbackStatus: utxoResult.callbackStatus,
|
|
8265
8012
|
callbackSignature: utxoResult.callbackSignature,
|
|
8266
8013
|
callbackElapsedMs: utxoResult.callbackElapsedMs,
|
|
8267
8014
|
rentClaimSignature: utxoResult.rentClaimSignature,
|
|
@@ -8269,22 +8016,22 @@ function getEncryptedBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8269
8016
|
};
|
|
8270
8017
|
return result;
|
|
8271
8018
|
} catch (error) {
|
|
8272
|
-
if (error instanceof
|
|
8019
|
+
if (error instanceof chunkKCHHJKQN_cjs.CreateUtxoError) {
|
|
8273
8020
|
throw error;
|
|
8274
8021
|
}
|
|
8275
|
-
if (error instanceof
|
|
8276
|
-
throw new
|
|
8022
|
+
if (error instanceof chunkKCHHJKQN_cjs.TransactionSigningError) {
|
|
8023
|
+
throw new chunkKCHHJKQN_cjs.CreateUtxoError("transaction-sign", error.message, error);
|
|
8277
8024
|
}
|
|
8278
8025
|
if (error instanceof chunkFSK2ICMB_cjs.CryptographyError) {
|
|
8279
|
-
throw new
|
|
8026
|
+
throw new chunkKCHHJKQN_cjs.CreateUtxoError("zk-proof-generation", error.message, error);
|
|
8280
8027
|
}
|
|
8281
|
-
if (error instanceof
|
|
8282
|
-
throw new
|
|
8028
|
+
if (error instanceof chunkKCHHJKQN_cjs.TransactionError) {
|
|
8029
|
+
throw new chunkKCHHJKQN_cjs.CreateUtxoError("transaction-send", error.message, error);
|
|
8283
8030
|
}
|
|
8284
|
-
if (error instanceof
|
|
8285
|
-
throw new
|
|
8031
|
+
if (error instanceof chunkKCHHJKQN_cjs.RpcError) {
|
|
8032
|
+
throw new chunkKCHHJKQN_cjs.CreateUtxoError("account-fetch", error.message, error);
|
|
8286
8033
|
}
|
|
8287
|
-
throw new
|
|
8034
|
+
throw new chunkKCHHJKQN_cjs.CreateUtxoError(
|
|
8288
8035
|
"transaction-send",
|
|
8289
8036
|
error instanceof Error ? error.message : String(error),
|
|
8290
8037
|
error instanceof Error ? error : void 0
|
|
@@ -8318,24 +8065,24 @@ function getPublicBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8318
8065
|
const transactionForwarder = deps.rpc?.transactionForwarder ?? client.transactionForwarder;
|
|
8319
8066
|
const factoryCreateUtxoCallbacks = deps.hooks?.createUtxo;
|
|
8320
8067
|
const getEpochInfo = deps.rpc?.epochInfo ?? client.epochInfoProvider;
|
|
8321
|
-
const masterViewingKeyGenerator = deps.keys?.masterViewingKeyGenerator ??
|
|
8322
|
-
const masterViewingKeyBlindingFactorGenerator = deps.keys?.masterViewingKeyBlindingFactorGenerator ??
|
|
8323
|
-
const poseidonPrivateKeyGenerator = deps.keys?.poseidonPrivateKeyGenerator ??
|
|
8324
|
-
const poseidonBlindingFactorGenerator = deps.keys?.poseidonBlindingFactorGenerator ??
|
|
8325
|
-
const mvkX25519KeypairDeriver = deps.keys?.mvkX25519KeypairDeriver ??
|
|
8326
|
-
const secondViewingKeyGenerator = deps.keys?.secondViewingKeyGenerator ??
|
|
8327
|
-
const ephemeralUtxoMvkGenerator = deps.keys?.ephemeralUtxoMasterViewingKeyDeriver ??
|
|
8328
|
-
const ephemeralUtxoMvkBlindingFactorGenerator = deps.keys?.ephemeralUtxoMasterViewingKeyBlindingFactorDeriver ??
|
|
8329
|
-
const ephemeralUtxoPoseidonKeyGenerator = deps.keys?.ephemeralUtxoPoseidonKeyGenerator ??
|
|
8330
|
-
const ephemeralUtxoPoseidonKeyBlindingFactorGenerator = deps.keys?.ephemeralUtxoPoseidonKeyBlindingFactorGenerator ??
|
|
8331
|
-
const poseidonKeystreamBlindingFactorGenerator = deps.keys?.poseidonKeystreamBlindingFactorGenerator ??
|
|
8332
|
-
const poseidonEncryptor = deps.crypto?.poseidonEncryptor ??
|
|
8333
|
-
const poseidonKeystreamGenerator = deps.crypto?.poseidonKeystreamGenerator ??
|
|
8334
|
-
const h2Generator = deps.crypto?.h2Generator ??
|
|
8335
|
-
const keystreamCommitmentGenerator = deps.crypto?.keystreamCommitmentGenerator ??
|
|
8336
|
-
const userCommitmentGenerator =
|
|
8337
|
-
const poseidonAggregator =
|
|
8338
|
-
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();
|
|
8339
8086
|
const generateRandomU256Function = deps.random?.generateRandomU256 ?? chunkZY3TSHMJ_cjs.generateRandomU256;
|
|
8340
8087
|
return /* @__PURE__ */ chunkPK6SKIKE_cjs.__name(async function createSelfClaimableUtxoFromPublicBalance(args2, options) {
|
|
8341
8088
|
const accountInfoCommitment = options?.accountInfoCommitment ?? "confirmed";
|
|
@@ -8358,12 +8105,12 @@ function getPublicBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8358
8105
|
masterSeed,
|
|
8359
8106
|
{ dkLen: 16, personalization: generationIndexBytes }
|
|
8360
8107
|
);
|
|
8361
|
-
const proofAccountOffsetBytes =
|
|
8108
|
+
const proofAccountOffsetBytes = chunkYFUGKMNS_cjs.deriveProofAccountOffsetFromModifiedGenerationIndex(modifiedGenerationIndex);
|
|
8362
8109
|
let proofAccountOffset = 0n;
|
|
8363
8110
|
for (let index = 0; index < 16; index++) {
|
|
8364
8111
|
proofAccountOffset |= BigInt(proofAccountOffsetBytes[index]) << BigInt(index * 8);
|
|
8365
8112
|
}
|
|
8366
|
-
const expandedModifiedGenerationIndex =
|
|
8113
|
+
const expandedModifiedGenerationIndex = chunkYFUGKMNS_cjs.expandModifiedGenerationIndex(modifiedGenerationIndex);
|
|
8367
8114
|
let expandedModifiedGenerationIndexU256 = 0n;
|
|
8368
8115
|
for (let index = 0; index < 32; index++) {
|
|
8369
8116
|
expandedModifiedGenerationIndexU256 |= BigInt(expandedModifiedGenerationIndex[index]) << BigInt(index * 8);
|
|
@@ -8376,7 +8123,7 @@ function getPublicBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8376
8123
|
], { commitment: accountInfoCommitment });
|
|
8377
8124
|
const mintAccount = mintAccountMap.get(mint);
|
|
8378
8125
|
if (mintAccount?.exists !== true) {
|
|
8379
|
-
throw new
|
|
8126
|
+
throw new chunkKCHHJKQN_cjs.TransactionError(`Mint account not found: ${mint}`);
|
|
8380
8127
|
}
|
|
8381
8128
|
const clusterOffset = chunkZY3TSHMJ_cjs.extractClusterOffsetFromMxeAccount(
|
|
8382
8129
|
mintAccountMap.get(client.networkConfig.mxeAccountAddress)
|
|
@@ -8392,7 +8139,7 @@ function getPublicBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8392
8139
|
const transferFee = chunkZY3TSHMJ_cjs.calculateTransferFee(feeConfig, epochInfo.epoch, amount);
|
|
8393
8140
|
actualReceived = amount - transferFee;
|
|
8394
8141
|
if (actualReceived <= 0n) {
|
|
8395
|
-
throw new
|
|
8142
|
+
throw new chunkKCHHJKQN_cjs.TransactionError(
|
|
8396
8143
|
`Transfer fee (${String(transferFee)}) exceeds or equals transfer amount (${String(amount)}).`
|
|
8397
8144
|
);
|
|
8398
8145
|
}
|
|
@@ -8402,7 +8149,7 @@ function getPublicBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8402
8149
|
actualReceived = amount;
|
|
8403
8150
|
mintTokenProgram = chunk43JEHY7D_cjs.SPL_TOKEN_PROGRAM_ID;
|
|
8404
8151
|
} else {
|
|
8405
|
-
throw new
|
|
8152
|
+
throw new chunkKCHHJKQN_cjs.TransactionError(
|
|
8406
8153
|
`Unknown token program: ${mintOwner}. Expected SPL Token or Token-2022.`
|
|
8407
8154
|
);
|
|
8408
8155
|
}
|
|
@@ -8415,7 +8162,7 @@ function getPublicBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8415
8162
|
const totalProtocolFees = baseFeesInSpl + commissionFee;
|
|
8416
8163
|
const netDepositAmount = actualReceived - totalProtocolFees;
|
|
8417
8164
|
if (netDepositAmount <= 0n) {
|
|
8418
|
-
throw new
|
|
8165
|
+
throw new chunkKCHHJKQN_cjs.TransactionError(
|
|
8419
8166
|
`Net deposit amount is zero or negative after fees. Transfer amount: ${String(amount)}, actual received: ${String(actualReceived)}, protocol fees: ${String(totalProtocolFees)}.`
|
|
8420
8167
|
);
|
|
8421
8168
|
}
|
|
@@ -8469,9 +8216,9 @@ function getPublicBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8469
8216
|
);
|
|
8470
8217
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(senderUserCommitment);
|
|
8471
8218
|
const ephemeralOffset = expandedModifiedGenerationIndexU256;
|
|
8472
|
-
const randomSecret =
|
|
8219
|
+
const randomSecret = chunkYFUGKMNS_cjs.deriveRandomSecretFromModifiedGenerationIndex(modifiedGenerationIndex);
|
|
8473
8220
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(randomSecret);
|
|
8474
|
-
const nullifier =
|
|
8221
|
+
const nullifier = chunkYFUGKMNS_cjs.deriveNullifierFromModifiedGenerationIndex(modifiedGenerationIndex);
|
|
8475
8222
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(nullifier);
|
|
8476
8223
|
const ephemeralMasterViewingKey = await ephemeralUtxoMvkGenerator(ephemeralOffset);
|
|
8477
8224
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(ephemeralMasterViewingKey);
|
|
@@ -8668,7 +8415,7 @@ function getPublicBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8668
8415
|
try {
|
|
8669
8416
|
latestBlockhashData = await getLatestBlockhash();
|
|
8670
8417
|
} catch (error) {
|
|
8671
|
-
throw new
|
|
8418
|
+
throw new chunkKCHHJKQN_cjs.RpcError(
|
|
8672
8419
|
`Failed to fetch latest blockhash: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
8673
8420
|
{ cause: error }
|
|
8674
8421
|
);
|
|
@@ -8691,7 +8438,7 @@ function getPublicBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8691
8438
|
const transaction = kit.compileTransaction(transactionMessage);
|
|
8692
8439
|
const signed = await client.signer.signTransaction(transaction);
|
|
8693
8440
|
if (!isSignedTransaction3(signed)) {
|
|
8694
|
-
throw new
|
|
8441
|
+
throw new chunkKCHHJKQN_cjs.TransactionError(
|
|
8695
8442
|
`${instructionName}: Transaction was not properly signed`
|
|
8696
8443
|
);
|
|
8697
8444
|
}
|
|
@@ -8699,7 +8446,7 @@ function getPublicBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8699
8446
|
try {
|
|
8700
8447
|
await transactionForwarder.forwardSequentially([signed]);
|
|
8701
8448
|
} catch (error) {
|
|
8702
|
-
throw new
|
|
8449
|
+
throw new chunkKCHHJKQN_cjs.TransactionError(
|
|
8703
8450
|
`${instructionName}: Failed to send transaction: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
8704
8451
|
{ cause: error }
|
|
8705
8452
|
);
|
|
@@ -8797,22 +8544,22 @@ function getPublicBalanceToSelfClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8797
8544
|
createUtxoSignature: depositResult.signature
|
|
8798
8545
|
};
|
|
8799
8546
|
} catch (error) {
|
|
8800
|
-
if (error instanceof
|
|
8547
|
+
if (error instanceof chunkKCHHJKQN_cjs.CreateUtxoError) {
|
|
8801
8548
|
throw error;
|
|
8802
8549
|
}
|
|
8803
|
-
if (error instanceof
|
|
8804
|
-
throw new
|
|
8550
|
+
if (error instanceof chunkKCHHJKQN_cjs.TransactionSigningError) {
|
|
8551
|
+
throw new chunkKCHHJKQN_cjs.CreateUtxoError("transaction-sign", error.message, error);
|
|
8805
8552
|
}
|
|
8806
8553
|
if (error instanceof chunkFSK2ICMB_cjs.CryptographyError) {
|
|
8807
|
-
throw new
|
|
8554
|
+
throw new chunkKCHHJKQN_cjs.CreateUtxoError("zk-proof-generation", error.message, error);
|
|
8808
8555
|
}
|
|
8809
|
-
if (error instanceof
|
|
8810
|
-
throw new
|
|
8556
|
+
if (error instanceof chunkKCHHJKQN_cjs.TransactionError) {
|
|
8557
|
+
throw new chunkKCHHJKQN_cjs.CreateUtxoError("transaction-send", error.message, error);
|
|
8811
8558
|
}
|
|
8812
|
-
if (error instanceof
|
|
8813
|
-
throw new
|
|
8559
|
+
if (error instanceof chunkKCHHJKQN_cjs.RpcError) {
|
|
8560
|
+
throw new chunkKCHHJKQN_cjs.CreateUtxoError("account-fetch", error.message, error);
|
|
8814
8561
|
}
|
|
8815
|
-
throw new
|
|
8562
|
+
throw new chunkKCHHJKQN_cjs.CreateUtxoError(
|
|
8816
8563
|
"transaction-send",
|
|
8817
8564
|
error instanceof Error ? error.message : String(error),
|
|
8818
8565
|
error instanceof Error ? error : void 0
|
|
@@ -8846,20 +8593,20 @@ function getPublicBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8846
8593
|
const transactionForwarder = deps.rpc?.transactionForwarder ?? client.transactionForwarder;
|
|
8847
8594
|
const factoryCreateUtxoCallbacks = deps.hooks?.createUtxo;
|
|
8848
8595
|
const getEpochInfo = deps.rpc?.epochInfo ?? client.epochInfoProvider;
|
|
8849
|
-
const masterViewingKeyGenerator = deps.keys?.masterViewingKeyGenerator ??
|
|
8850
|
-
const masterViewingKeyBlindingFactorGenerator = deps.keys?.masterViewingKeyBlindingFactorGenerator ??
|
|
8851
|
-
const poseidonPrivateKeyGenerator = deps.keys?.poseidonPrivateKeyGenerator ??
|
|
8852
|
-
const poseidonBlindingFactorGenerator = deps.keys?.poseidonBlindingFactorGenerator ??
|
|
8853
|
-
const mvkX25519KeypairDeriver = deps.keys?.mvkX25519KeypairDeriver ??
|
|
8854
|
-
const secondViewingKeyGenerator = deps.keys?.secondViewingKeyGenerator ??
|
|
8855
|
-
const poseidonKeystreamBlindingFactorGenerator = deps.keys?.poseidonKeystreamBlindingFactorGenerator ??
|
|
8856
|
-
const poseidonEncryptor = deps.crypto?.poseidonEncryptor ??
|
|
8857
|
-
const poseidonKeystreamGenerator = deps.crypto?.poseidonKeystreamGenerator ??
|
|
8858
|
-
const h2Generator = deps.crypto?.h2Generator ??
|
|
8859
|
-
const keystreamCommitmentGenerator = deps.crypto?.keystreamCommitmentGenerator ??
|
|
8860
|
-
const userCommitmentGenerator =
|
|
8861
|
-
const poseidonAggregator =
|
|
8862
|
-
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();
|
|
8863
8610
|
const generateRandomU256Function = deps.random?.generateRandomU256 ?? chunkZY3TSHMJ_cjs.generateRandomU256;
|
|
8864
8611
|
return /* @__PURE__ */ chunkPK6SKIKE_cjs.__name(async function createReceiverClaimableUtxoFromPublicBalance(args2, options) {
|
|
8865
8612
|
const accountInfoCommitment = options?.accountInfoCommitment ?? "confirmed";
|
|
@@ -8882,7 +8629,7 @@ function getPublicBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8882
8629
|
masterSeed,
|
|
8883
8630
|
{ dkLen: 16, personalization: generationIndexBytes }
|
|
8884
8631
|
);
|
|
8885
|
-
const proofAccountOffsetBytes =
|
|
8632
|
+
const proofAccountOffsetBytes = chunkYFUGKMNS_cjs.deriveProofAccountOffsetFromModifiedGenerationIndex(modifiedGenerationIndex);
|
|
8886
8633
|
let proofAccountOffset = 0n;
|
|
8887
8634
|
for (let index = 0; index < 16; index++) {
|
|
8888
8635
|
proofAccountOffset |= BigInt(proofAccountOffsetBytes[index]) << BigInt(index * 8);
|
|
@@ -8923,7 +8670,7 @@ function getPublicBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8923
8670
|
const mintAccountMap = await accountInfoProvider([mint], { commitment: accountInfoCommitment });
|
|
8924
8671
|
const mintAccount = mintAccountMap.get(mint);
|
|
8925
8672
|
if (mintAccount?.exists !== true) {
|
|
8926
|
-
throw new
|
|
8673
|
+
throw new chunkKCHHJKQN_cjs.TransactionError(`Mint account not found: ${mint}`);
|
|
8927
8674
|
}
|
|
8928
8675
|
const mintOwner = mintAccount.programAddress;
|
|
8929
8676
|
if (mintOwner === chunk43JEHY7D_cjs.TOKEN_2022_PROGRAM_ID) {
|
|
@@ -8936,7 +8683,7 @@ function getPublicBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8936
8683
|
const transferFee = chunkZY3TSHMJ_cjs.calculateTransferFee(feeConfig, epochInfo.epoch, amount);
|
|
8937
8684
|
actualReceived = amount - transferFee;
|
|
8938
8685
|
if (actualReceived <= 0n) {
|
|
8939
|
-
throw new
|
|
8686
|
+
throw new chunkKCHHJKQN_cjs.TransactionError(
|
|
8940
8687
|
`Transfer fee (${String(transferFee)}) exceeds or equals transfer amount (${String(amount)}).`
|
|
8941
8688
|
);
|
|
8942
8689
|
}
|
|
@@ -8946,7 +8693,7 @@ function getPublicBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8946
8693
|
actualReceived = amount;
|
|
8947
8694
|
mintTokenProgram = chunk43JEHY7D_cjs.SPL_TOKEN_PROGRAM_ID;
|
|
8948
8695
|
} else {
|
|
8949
|
-
throw new
|
|
8696
|
+
throw new chunkKCHHJKQN_cjs.TransactionError(
|
|
8950
8697
|
`Unknown token program: ${mintOwner}. Expected SPL Token or Token-2022.`
|
|
8951
8698
|
);
|
|
8952
8699
|
}
|
|
@@ -8959,7 +8706,7 @@ function getPublicBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
8959
8706
|
const totalProtocolFees = baseFeesInSpl + commissionFee;
|
|
8960
8707
|
const netDepositAmount = actualReceived - totalProtocolFees;
|
|
8961
8708
|
if (netDepositAmount <= 0n) {
|
|
8962
|
-
throw new
|
|
8709
|
+
throw new chunkKCHHJKQN_cjs.TransactionError(
|
|
8963
8710
|
`Net deposit amount is zero or negative after fees. Transfer amount: ${String(amount)}, actual received: ${String(actualReceived)}, protocol fees: ${String(totalProtocolFees)}.`
|
|
8964
8711
|
);
|
|
8965
8712
|
}
|
|
@@ -9012,9 +8759,9 @@ function getPublicBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
9012
8759
|
senderPrivateKeyBlindingFactor
|
|
9013
8760
|
);
|
|
9014
8761
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(senderUserCommitment);
|
|
9015
|
-
const randomSecret =
|
|
8762
|
+
const randomSecret = chunkYFUGKMNS_cjs.deriveRandomSecretFromModifiedGenerationIndex(modifiedGenerationIndex);
|
|
9016
8763
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(randomSecret);
|
|
9017
|
-
const nullifier =
|
|
8764
|
+
const nullifier = chunkYFUGKMNS_cjs.deriveNullifierFromModifiedGenerationIndex(modifiedGenerationIndex);
|
|
9018
8765
|
chunkLTCKPTZC_cjs.assertBn254FieldElement(nullifier);
|
|
9019
8766
|
const h2Hash = await h2Generator.generateH2({
|
|
9020
8767
|
amount: toBn254FieldElement4(netDepositAmount),
|
|
@@ -9198,7 +8945,7 @@ function getPublicBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
9198
8945
|
try {
|
|
9199
8946
|
latestBlockhashData = await getLatestBlockhash();
|
|
9200
8947
|
} catch (error) {
|
|
9201
|
-
throw new
|
|
8948
|
+
throw new chunkKCHHJKQN_cjs.RpcError(
|
|
9202
8949
|
`Failed to fetch latest blockhash: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
9203
8950
|
{ cause: error }
|
|
9204
8951
|
);
|
|
@@ -9221,7 +8968,7 @@ function getPublicBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
9221
8968
|
const transaction = kit.compileTransaction(transactionMessage);
|
|
9222
8969
|
const signed = await client.signer.signTransaction(transaction);
|
|
9223
8970
|
if (!isSignedTransaction4(signed)) {
|
|
9224
|
-
throw new
|
|
8971
|
+
throw new chunkKCHHJKQN_cjs.TransactionError(
|
|
9225
8972
|
`${instructionName}: Transaction was not properly signed`
|
|
9226
8973
|
);
|
|
9227
8974
|
}
|
|
@@ -9229,7 +8976,7 @@ function getPublicBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
9229
8976
|
try {
|
|
9230
8977
|
await transactionForwarder.forwardSequentially([signed]);
|
|
9231
8978
|
} catch (error) {
|
|
9232
|
-
throw new
|
|
8979
|
+
throw new chunkKCHHJKQN_cjs.TransactionError(
|
|
9233
8980
|
`${instructionName}: Failed to send transaction: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
9234
8981
|
{ cause: error }
|
|
9235
8982
|
);
|
|
@@ -9323,22 +9070,22 @@ function getPublicBalanceToReceiverClaimableUtxoCreatorFunction(args, deps) {
|
|
|
9323
9070
|
createUtxoSignature: depositResult.signature
|
|
9324
9071
|
};
|
|
9325
9072
|
} catch (error) {
|
|
9326
|
-
if (error instanceof
|
|
9073
|
+
if (error instanceof chunkKCHHJKQN_cjs.CreateUtxoError) {
|
|
9327
9074
|
throw error;
|
|
9328
9075
|
}
|
|
9329
|
-
if (error instanceof
|
|
9330
|
-
throw new
|
|
9076
|
+
if (error instanceof chunkKCHHJKQN_cjs.TransactionSigningError) {
|
|
9077
|
+
throw new chunkKCHHJKQN_cjs.CreateUtxoError("transaction-sign", error.message, error);
|
|
9331
9078
|
}
|
|
9332
9079
|
if (error instanceof chunkFSK2ICMB_cjs.CryptographyError) {
|
|
9333
|
-
throw new
|
|
9080
|
+
throw new chunkKCHHJKQN_cjs.CreateUtxoError("zk-proof-generation", error.message, error);
|
|
9334
9081
|
}
|
|
9335
|
-
if (error instanceof
|
|
9336
|
-
throw new
|
|
9082
|
+
if (error instanceof chunkKCHHJKQN_cjs.TransactionError) {
|
|
9083
|
+
throw new chunkKCHHJKQN_cjs.CreateUtxoError("transaction-send", error.message, error);
|
|
9337
9084
|
}
|
|
9338
|
-
if (error instanceof
|
|
9339
|
-
throw new
|
|
9085
|
+
if (error instanceof chunkKCHHJKQN_cjs.RpcError) {
|
|
9086
|
+
throw new chunkKCHHJKQN_cjs.CreateUtxoError("account-fetch", error.message, error);
|
|
9340
9087
|
}
|
|
9341
|
-
throw new
|
|
9088
|
+
throw new chunkKCHHJKQN_cjs.CreateUtxoError(
|
|
9342
9089
|
"transaction-send",
|
|
9343
9090
|
error instanceof Error ? error.message : String(error),
|
|
9344
9091
|
error instanceof Error ? error : void 0
|
|
@@ -9379,7 +9126,7 @@ function getEncryptedBalanceQuerierFunction(args, deps) {
|
|
|
9379
9126
|
const { client } = args;
|
|
9380
9127
|
const userAddress = client.signer.address;
|
|
9381
9128
|
const accountInfoProvider = deps?.accountInfoProvider ?? client.accountInfoProvider;
|
|
9382
|
-
const tokenX25519KeypairDeriver =
|
|
9129
|
+
const tokenX25519KeypairDeriver = chunkYFUGKMNS_cjs.getUserAccountX25519KeypairDeriver({
|
|
9383
9130
|
client
|
|
9384
9131
|
});
|
|
9385
9132
|
let cachedDecryptor = null;
|
|
@@ -9392,14 +9139,14 @@ function getEncryptedBalanceQuerierFunction(args, deps) {
|
|
|
9392
9139
|
try {
|
|
9393
9140
|
keypairResult = await tokenX25519KeypairDeriver();
|
|
9394
9141
|
} catch (error) {
|
|
9395
|
-
throw new
|
|
9142
|
+
throw new chunkKCHHJKQN_cjs.QueryError(
|
|
9396
9143
|
"key-derivation",
|
|
9397
9144
|
`Failed to derive X25519 keypair: ${error instanceof Error ? error.message : String(error)}`,
|
|
9398
9145
|
error instanceof Error ? error : void 0
|
|
9399
9146
|
);
|
|
9400
9147
|
}
|
|
9401
9148
|
const x25519PrivateKey = keypairResult.x25519Keypair.privateKey;
|
|
9402
|
-
cachedDecryptor =
|
|
9149
|
+
cachedDecryptor = chunkYFUGKMNS_cjs.getRescueDecryptorFromPrivateKey(x25519PrivateKey, {
|
|
9403
9150
|
umbraX25519PublicKey: client.networkConfig.mxePubkey
|
|
9404
9151
|
});
|
|
9405
9152
|
}
|
|
@@ -9425,7 +9172,7 @@ function getEncryptedBalanceQuerierFunction(args, deps) {
|
|
|
9425
9172
|
}))
|
|
9426
9173
|
);
|
|
9427
9174
|
} catch (error) {
|
|
9428
|
-
throw new
|
|
9175
|
+
throw new chunkKCHHJKQN_cjs.QueryError(
|
|
9429
9176
|
"pda-derivation",
|
|
9430
9177
|
`Failed to derive token account PDAs: ${error instanceof Error ? error.message : String(error)}`,
|
|
9431
9178
|
error instanceof Error ? error : void 0
|
|
@@ -9441,7 +9188,7 @@ function getEncryptedBalanceQuerierFunction(args, deps) {
|
|
|
9441
9188
|
try {
|
|
9442
9189
|
accountMap = await accountInfoProvider(pdas);
|
|
9443
9190
|
} catch (error) {
|
|
9444
|
-
throw new
|
|
9191
|
+
throw new chunkKCHHJKQN_cjs.QueryError(
|
|
9445
9192
|
"account-fetch",
|
|
9446
9193
|
`Failed to fetch token account data: ${error instanceof Error ? error.message : String(error)}`,
|
|
9447
9194
|
error instanceof Error ? error : void 0
|
|
@@ -9459,7 +9206,7 @@ function getEncryptedBalanceQuerierFunction(args, deps) {
|
|
|
9459
9206
|
maybeAccount
|
|
9460
9207
|
);
|
|
9461
9208
|
} catch (error) {
|
|
9462
|
-
throw new
|
|
9209
|
+
throw new chunkKCHHJKQN_cjs.QueryError(
|
|
9463
9210
|
"account-decode",
|
|
9464
9211
|
`Failed to decode token account data for mint ${mint}: ${error instanceof Error ? error.message : String(error)}`,
|
|
9465
9212
|
error instanceof Error ? error : void 0
|
|
@@ -9481,7 +9228,7 @@ function getEncryptedBalanceQuerierFunction(args, deps) {
|
|
|
9481
9228
|
try {
|
|
9482
9229
|
plaintexts = await rcDecryptor([balanceCiphertext], nonce);
|
|
9483
9230
|
} catch (error) {
|
|
9484
|
-
throw new
|
|
9231
|
+
throw new chunkKCHHJKQN_cjs.QueryError(
|
|
9485
9232
|
"decryption",
|
|
9486
9233
|
`Failed to decrypt balance for mint ${mint}: ${error instanceof Error ? error.message : String(error)}`,
|
|
9487
9234
|
error instanceof Error ? error : void 0
|
|
@@ -9547,7 +9294,7 @@ function getUserAccountQuerierFunction(args, deps) {
|
|
|
9547
9294
|
try {
|
|
9548
9295
|
userAccountPda = await chunkUEI7SYH6_cjs.findEncryptedUserAccountPda(userAddress, umbraProgram);
|
|
9549
9296
|
} catch (error) {
|
|
9550
|
-
throw new
|
|
9297
|
+
throw new chunkKCHHJKQN_cjs.QueryError(
|
|
9551
9298
|
"pda-derivation",
|
|
9552
9299
|
`Failed to derive user account PDA: ${error instanceof Error ? error.message : String(error)}`,
|
|
9553
9300
|
error instanceof Error ? error : void 0
|
|
@@ -9557,7 +9304,7 @@ function getUserAccountQuerierFunction(args, deps) {
|
|
|
9557
9304
|
try {
|
|
9558
9305
|
accountMap = await accountInfoProvider([userAccountPda], { commitment: accountInfoCommitment });
|
|
9559
9306
|
} catch (error) {
|
|
9560
|
-
throw new
|
|
9307
|
+
throw new chunkKCHHJKQN_cjs.QueryError(
|
|
9561
9308
|
"account-fetch",
|
|
9562
9309
|
`Failed to fetch user account data: ${error instanceof Error ? error.message : String(error)}`,
|
|
9563
9310
|
error instanceof Error ? error : void 0
|
|
@@ -9574,7 +9321,7 @@ function getUserAccountQuerierFunction(args, deps) {
|
|
|
9574
9321
|
);
|
|
9575
9322
|
sdkAccount = convertToSdkTypes(decodedAccount.data);
|
|
9576
9323
|
} catch (error) {
|
|
9577
|
-
throw new
|
|
9324
|
+
throw new chunkKCHHJKQN_cjs.QueryError(
|
|
9578
9325
|
"account-decode",
|
|
9579
9326
|
`Failed to decode user account data: ${error instanceof Error ? error.message : String(error)}`,
|
|
9580
9327
|
error instanceof Error ? error : void 0
|
|
@@ -9593,7 +9340,7 @@ function getStagedSolRecovererFunction(args, deps) {
|
|
|
9593
9340
|
return /* @__PURE__ */ chunkPK6SKIKE_cjs.__name(async function claimStagedSolFromPool(mint, amount, destination, optionalData, callbacks) {
|
|
9594
9341
|
const userAddress = signer.address;
|
|
9595
9342
|
if (amount === 0n) {
|
|
9596
|
-
throw new
|
|
9343
|
+
throw new chunkKCHHJKQN_cjs.TransactionError("amount must be greater than zero");
|
|
9597
9344
|
}
|
|
9598
9345
|
const noopSigner = kit.createNoopSigner(userAddress);
|
|
9599
9346
|
const instruction = await umbraCodama.getClaimStagedSolFromPoolInstructionAsync({
|
|
@@ -9632,7 +9379,7 @@ function getStagedSplRecovererFunction(args, deps) {
|
|
|
9632
9379
|
return /* @__PURE__ */ chunkPK6SKIKE_cjs.__name(async function claimStagedSplFromPool(mint, amount, destinationAta, optionalData, callbacks) {
|
|
9633
9380
|
const userAddress = signer.address;
|
|
9634
9381
|
if (amount === 0n) {
|
|
9635
|
-
throw new
|
|
9382
|
+
throw new chunkKCHHJKQN_cjs.TransactionError("amount must be greater than zero");
|
|
9636
9383
|
}
|
|
9637
9384
|
const noopSigner = kit.createNoopSigner(userAddress);
|
|
9638
9385
|
const instruction = await umbraCodama.getClaimStagedSplFromPoolInstructionAsync({
|
|
@@ -9670,28 +9417,28 @@ function getUserRegistrationFunction(args, deps) {
|
|
|
9670
9417
|
const accountInfoProvider = deps?.rpc?.accountInfoProvider ?? client.accountInfoProvider;
|
|
9671
9418
|
const getLatestBlockhash = deps?.rpc?.blockhashProvider ?? client.blockhashProvider;
|
|
9672
9419
|
const transactionForwarder = deps?.rpc?.transactionForwarder ?? client.transactionForwarder;
|
|
9673
|
-
const userAccountX25519KeypairDeriver = deps?.keys?.userAccountX25519KeypairDeriver ??
|
|
9674
|
-
const masterViewingKeyEncryptingX25519KeypairDeriver = deps?.keys?.masterViewingKeyEncryptingX25519KeypairDeriver ??
|
|
9675
|
-
const masterViewingKeyGenerator = deps?.keys?.masterViewingKeyGenerator ??
|
|
9676
|
-
const masterViewingKeyBlindingFactorGenerator = deps?.keys?.masterViewingKeyBlindingFactorGenerator ??
|
|
9677
|
-
const poseidonPrivateKeyGenerator = deps?.keys?.poseidonPrivateKeyGenerator ??
|
|
9678
|
-
const poseidonBlindingFactorGenerator = deps?.keys?.poseidonBlindingFactorGenerator ??
|
|
9679
|
-
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({
|
|
9680
9427
|
client
|
|
9681
9428
|
});
|
|
9682
|
-
const randomFactorGenerator = deps?.crypto?.randomFactorGenerator ??
|
|
9683
|
-
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, {
|
|
9684
9431
|
umbraX25519PublicKey: client.networkConfig.mxePubkey
|
|
9685
9432
|
}));
|
|
9686
|
-
const getRcEncryptor = deps?.crypto?.getRcEncryptor ?? ((pk) =>
|
|
9433
|
+
const getRcEncryptor = deps?.crypto?.getRcEncryptor ?? ((pk) => chunkYFUGKMNS_cjs.getRescueEncryptorWithNonceFromPrivateKey(pk, {
|
|
9687
9434
|
umbraX25519PublicKey: client.networkConfig.mxePubkey
|
|
9688
9435
|
}));
|
|
9689
|
-
const rescueCommitmentGenerator = deps?.crypto?.rescueCommitmentGenerator ??
|
|
9690
|
-
const userCommitmentGenerator = deps?.crypto?.userCommitmentGenerator ??
|
|
9691
|
-
const fiatShamirChallengeGenerator = deps?.crypto?.fiatShamirChallengeGenerator ??
|
|
9692
|
-
const challengePowersFunction = deps?.crypto?.challengePowersFunction ??
|
|
9693
|
-
const polynomialEvaluator = deps?.crypto?.polynomialEvaluator ??
|
|
9694
|
-
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();
|
|
9695
9442
|
const bn254ModuleInverter = deps?.crypto?.bn254ModInverter ?? chunkY55PYKXH_cjs.getBn254ModularInverter();
|
|
9696
9443
|
const computeLimbwiseSumInverse = deps?.crypto?.computeLimbwiseSumInverse ?? chunkY55PYKXH_cjs.computeBn254LimbwiseSumInverse;
|
|
9697
9444
|
const zkProver = deps?.zkProver;
|
|
@@ -10259,25 +10006,25 @@ function getUserRegistrationFunction(args, deps) {
|
|
|
10259
10006
|
}
|
|
10260
10007
|
return signatures;
|
|
10261
10008
|
} catch (error) {
|
|
10262
|
-
if (error instanceof
|
|
10009
|
+
if (error instanceof chunkKCHHJKQN_cjs.RegistrationError) {
|
|
10263
10010
|
throw error;
|
|
10264
10011
|
}
|
|
10265
|
-
if (error instanceof
|
|
10266
|
-
throw new
|
|
10012
|
+
if (error instanceof chunkKCHHJKQN_cjs.MasterSeedSigningRejectedError) {
|
|
10013
|
+
throw new chunkKCHHJKQN_cjs.RegistrationError("master-seed-derivation", error.message, error);
|
|
10267
10014
|
}
|
|
10268
|
-
if (error instanceof
|
|
10269
|
-
throw new
|
|
10015
|
+
if (error instanceof chunkKCHHJKQN_cjs.TransactionSigningError) {
|
|
10016
|
+
throw new chunkKCHHJKQN_cjs.RegistrationError("transaction-sign", error.message, error);
|
|
10270
10017
|
}
|
|
10271
10018
|
if (error instanceof chunkFSK2ICMB_cjs.CryptographyError) {
|
|
10272
|
-
throw new
|
|
10019
|
+
throw new chunkKCHHJKQN_cjs.RegistrationError("zk-proof-generation", error.message, error);
|
|
10273
10020
|
}
|
|
10274
|
-
if (error instanceof
|
|
10275
|
-
throw new
|
|
10021
|
+
if (error instanceof chunkKCHHJKQN_cjs.TransactionError) {
|
|
10022
|
+
throw new chunkKCHHJKQN_cjs.RegistrationError("transaction-send", error.message, error);
|
|
10276
10023
|
}
|
|
10277
|
-
if (error instanceof
|
|
10278
|
-
throw new
|
|
10024
|
+
if (error instanceof chunkKCHHJKQN_cjs.RpcError) {
|
|
10025
|
+
throw new chunkKCHHJKQN_cjs.RegistrationError("account-fetch", error.message, error);
|
|
10279
10026
|
}
|
|
10280
|
-
throw new
|
|
10027
|
+
throw new chunkKCHHJKQN_cjs.RegistrationError(
|
|
10281
10028
|
"transaction-send",
|
|
10282
10029
|
error instanceof Error ? error.message : String(error),
|
|
10283
10030
|
error instanceof Error ? error : void 0
|
|
@@ -10307,10 +10054,10 @@ function getUserEntropySeedRotatorFunction(args, deps) {
|
|
|
10307
10054
|
return /* @__PURE__ */ chunkPK6SKIKE_cjs.__name(async function updateRandomGenerationSeed(newSeed, optionalData, callbacks) {
|
|
10308
10055
|
const userAddress = signer.address;
|
|
10309
10056
|
if (newSeed.length !== 32) {
|
|
10310
|
-
throw new
|
|
10057
|
+
throw new chunkKCHHJKQN_cjs.TransactionError("newSeed must be exactly 32 bytes");
|
|
10311
10058
|
}
|
|
10312
10059
|
if (newSeed.every((b) => b === 0)) {
|
|
10313
|
-
throw new
|
|
10060
|
+
throw new chunkKCHHJKQN_cjs.TransactionError("newSeed must not be all zeros");
|
|
10314
10061
|
}
|
|
10315
10062
|
const noopSigner = kit.createNoopSigner(userAddress);
|
|
10316
10063
|
const instruction = await umbraCodama.getUpdateRandomGenerationSeedInstructionAsync({
|
|
@@ -10347,10 +10094,10 @@ function getTokenEntropySeedRotatorFunction(args, deps) {
|
|
|
10347
10094
|
return /* @__PURE__ */ chunkPK6SKIKE_cjs.__name(async function updateTokenAccountRandomGenerationSeed(mint, newSeed, optionalData, callbacks) {
|
|
10348
10095
|
const userAddress = signer.address;
|
|
10349
10096
|
if (newSeed.length !== 32) {
|
|
10350
|
-
throw new
|
|
10097
|
+
throw new chunkKCHHJKQN_cjs.TransactionError("newSeed must be exactly 32 bytes");
|
|
10351
10098
|
}
|
|
10352
10099
|
if (newSeed.every((b) => b === 0)) {
|
|
10353
|
-
throw new
|
|
10100
|
+
throw new chunkKCHHJKQN_cjs.TransactionError("newSeed must not be all zeros");
|
|
10354
10101
|
}
|
|
10355
10102
|
const noopSigner = kit.createNoopSigner(userAddress);
|
|
10356
10103
|
const instruction = await umbraCodama.getUpdateTokenAccountRandomGenerationSeedInstructionAsync({
|
|
@@ -10381,22 +10128,22 @@ function getTokenEntropySeedRotatorFunction(args, deps) {
|
|
|
10381
10128
|
chunkPK6SKIKE_cjs.__name(getTokenEntropySeedRotatorFunction, "getTokenEntropySeedRotatorFunction");
|
|
10382
10129
|
function assertValidClient(client) {
|
|
10383
10130
|
if (client === void 0 || client === null) {
|
|
10384
|
-
throw new
|
|
10131
|
+
throw new chunkKCHHJKQN_cjs.EncryptedWithdrawalError("initialization", "client is required");
|
|
10385
10132
|
}
|
|
10386
10133
|
}
|
|
10387
10134
|
chunkPK6SKIKE_cjs.__name(assertValidClient, "assertValidClient");
|
|
10388
10135
|
function assertValidSigner(signer) {
|
|
10389
10136
|
if (signer === void 0 || signer === null) {
|
|
10390
|
-
throw new
|
|
10137
|
+
throw new chunkKCHHJKQN_cjs.EncryptedWithdrawalError("initialization", "client.signer is required");
|
|
10391
10138
|
}
|
|
10392
10139
|
if (typeof signer.address !== "string" || signer.address.trim().length === 0) {
|
|
10393
|
-
throw new
|
|
10140
|
+
throw new chunkKCHHJKQN_cjs.EncryptedWithdrawalError(
|
|
10394
10141
|
"initialization",
|
|
10395
10142
|
"client.signer.address must be a non-empty string"
|
|
10396
10143
|
);
|
|
10397
10144
|
}
|
|
10398
10145
|
if (typeof signer.signTransaction !== "function") {
|
|
10399
|
-
throw new
|
|
10146
|
+
throw new chunkKCHHJKQN_cjs.EncryptedWithdrawalError(
|
|
10400
10147
|
"initialization",
|
|
10401
10148
|
"client.signer.signTransaction must be a function"
|
|
10402
10149
|
);
|
|
@@ -10405,16 +10152,16 @@ function assertValidSigner(signer) {
|
|
|
10405
10152
|
chunkPK6SKIKE_cjs.__name(assertValidSigner, "assertValidSigner");
|
|
10406
10153
|
function assertValidBlockhashProvider(provider) {
|
|
10407
10154
|
if (typeof provider !== "function") {
|
|
10408
|
-
throw new
|
|
10155
|
+
throw new chunkKCHHJKQN_cjs.EncryptedWithdrawalError("initialization", "getLatestBlockhash must be a function");
|
|
10409
10156
|
}
|
|
10410
10157
|
}
|
|
10411
10158
|
chunkPK6SKIKE_cjs.__name(assertValidBlockhashProvider, "assertValidBlockhashProvider");
|
|
10412
10159
|
function assertValidTransactionForwarder(forwarder) {
|
|
10413
10160
|
if (forwarder === void 0 || forwarder === null) {
|
|
10414
|
-
throw new
|
|
10161
|
+
throw new chunkKCHHJKQN_cjs.EncryptedWithdrawalError("initialization", "transactionForwarder is required");
|
|
10415
10162
|
}
|
|
10416
10163
|
if (typeof forwarder.forwardSequentially !== "function") {
|
|
10417
|
-
throw new
|
|
10164
|
+
throw new chunkKCHHJKQN_cjs.EncryptedWithdrawalError(
|
|
10418
10165
|
"initialization",
|
|
10419
10166
|
"transactionForwarder.forwardSequentially must be a function"
|
|
10420
10167
|
);
|
|
@@ -10423,7 +10170,7 @@ function assertValidTransactionForwarder(forwarder) {
|
|
|
10423
10170
|
chunkPK6SKIKE_cjs.__name(assertValidTransactionForwarder, "assertValidTransactionForwarder");
|
|
10424
10171
|
function assertValidAddress(address, name) {
|
|
10425
10172
|
if (typeof address !== "string" || address.trim().length === 0) {
|
|
10426
|
-
throw new
|
|
10173
|
+
throw new chunkKCHHJKQN_cjs.EncryptedWithdrawalError("validation", `Invalid ${name}: must be a non-empty string`);
|
|
10427
10174
|
}
|
|
10428
10175
|
}
|
|
10429
10176
|
chunkPK6SKIKE_cjs.__name(assertValidAddress, "assertValidAddress");
|
|
@@ -10439,7 +10186,7 @@ function assertValidArciumAccounts(accounts) {
|
|
|
10439
10186
|
for (const accountName of requiredAccounts) {
|
|
10440
10187
|
const account = accounts[accountName];
|
|
10441
10188
|
if (typeof account !== "string" || account.trim().length === 0) {
|
|
10442
|
-
throw new
|
|
10189
|
+
throw new chunkKCHHJKQN_cjs.EncryptedWithdrawalError(
|
|
10443
10190
|
"pda-derivation",
|
|
10444
10191
|
`Failed to derive ${accountName}: account address is invalid`
|
|
10445
10192
|
);
|
|
@@ -10480,6 +10227,7 @@ function getEncryptedBalanceToPublicBalanceDirectWithdrawerFunction(args, deps)
|
|
|
10480
10227
|
if ("callbackResult" in result) {
|
|
10481
10228
|
return {
|
|
10482
10229
|
queueSignature: result.signature,
|
|
10230
|
+
callbackStatus: result.callbackResult.status,
|
|
10483
10231
|
callbackSignature: "callbackSignature" in result.callbackResult ? result.callbackResult.callbackSignature : void 0,
|
|
10484
10232
|
callbackElapsedMs: result.callbackResult.elapsedMs,
|
|
10485
10233
|
rentClaimSignature: result.rentClaimSignature,
|
|
@@ -10488,10 +10236,10 @@ function getEncryptedBalanceToPublicBalanceDirectWithdrawerFunction(args, deps)
|
|
|
10488
10236
|
}
|
|
10489
10237
|
return { queueSignature: result.signature };
|
|
10490
10238
|
} catch (error) {
|
|
10491
|
-
if (error instanceof
|
|
10239
|
+
if (error instanceof chunkKCHHJKQN_cjs.EncryptedWithdrawalError) {
|
|
10492
10240
|
throw error;
|
|
10493
10241
|
}
|
|
10494
|
-
throw new
|
|
10242
|
+
throw new chunkKCHHJKQN_cjs.EncryptedWithdrawalError(
|
|
10495
10243
|
"transaction-send",
|
|
10496
10244
|
`Transaction execution failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
10497
10245
|
error instanceof Error ? error : void 0
|
|
@@ -10508,17 +10256,17 @@ function getEncryptedBalanceToPublicBalanceDirectWithdrawerFunction(args, deps)
|
|
|
10508
10256
|
assertValidAddress(mint, "mint");
|
|
10509
10257
|
chunkLTCKPTZC_cjs.assertU64(withdrawalAmount);
|
|
10510
10258
|
if (withdrawalAmount <= 0n) {
|
|
10511
|
-
throw new
|
|
10259
|
+
throw new chunkKCHHJKQN_cjs.EncryptedWithdrawalError(
|
|
10512
10260
|
"validation",
|
|
10513
10261
|
"Invalid withdrawalAmount: must be greater than zero"
|
|
10514
10262
|
);
|
|
10515
10263
|
}
|
|
10516
10264
|
chunkLTCKPTZC_cjs.assertOptionalData32(optionalData, "optionalData");
|
|
10517
10265
|
} catch (error) {
|
|
10518
|
-
if (error instanceof
|
|
10266
|
+
if (error instanceof chunkKCHHJKQN_cjs.EncryptedWithdrawalError) {
|
|
10519
10267
|
throw error;
|
|
10520
10268
|
}
|
|
10521
|
-
throw new
|
|
10269
|
+
throw new chunkKCHHJKQN_cjs.EncryptedWithdrawalError(
|
|
10522
10270
|
"validation",
|
|
10523
10271
|
error instanceof Error ? error.message : String(error),
|
|
10524
10272
|
error instanceof Error ? error : void 0
|
|
@@ -10530,11 +10278,11 @@ function getEncryptedBalanceToPublicBalanceDirectWithdrawerFunction(args, deps)
|
|
|
10530
10278
|
const mintAccountMap = await accountInfoProvider([mint, client.networkConfig.mxeAccountAddress], { commitment: accountInfoCommitment });
|
|
10531
10279
|
const mintAccount = mintAccountMap.get(mint);
|
|
10532
10280
|
if (mintAccount?.exists !== true) {
|
|
10533
|
-
throw new
|
|
10281
|
+
throw new chunkKCHHJKQN_cjs.EncryptedWithdrawalError("mint-fetch", `Mint account not found: ${mint}`);
|
|
10534
10282
|
}
|
|
10535
10283
|
const mintOwner = mintAccount.programAddress;
|
|
10536
10284
|
if (mintOwner !== chunk43JEHY7D_cjs.SPL_TOKEN_PROGRAM_ID && mintOwner !== chunk43JEHY7D_cjs.TOKEN_2022_PROGRAM_ID) {
|
|
10537
|
-
throw new
|
|
10285
|
+
throw new chunkKCHHJKQN_cjs.EncryptedWithdrawalError(
|
|
10538
10286
|
"mint-fetch",
|
|
10539
10287
|
`Unknown token program: ${mintOwner}. Expected SPL Token (${chunk43JEHY7D_cjs.SPL_TOKEN_PROGRAM_ID}) or Token-2022 (${chunk43JEHY7D_cjs.TOKEN_2022_PROGRAM_ID})`
|
|
10540
10288
|
);
|
|
@@ -10544,10 +10292,10 @@ function getEncryptedBalanceToPublicBalanceDirectWithdrawerFunction(args, deps)
|
|
|
10544
10292
|
mintAccountMap.get(client.networkConfig.mxeAccountAddress)
|
|
10545
10293
|
);
|
|
10546
10294
|
} catch (error) {
|
|
10547
|
-
if (error instanceof
|
|
10295
|
+
if (error instanceof chunkKCHHJKQN_cjs.EncryptedWithdrawalError) {
|
|
10548
10296
|
throw error;
|
|
10549
10297
|
}
|
|
10550
|
-
throw new
|
|
10298
|
+
throw new chunkKCHHJKQN_cjs.EncryptedWithdrawalError(
|
|
10551
10299
|
"mint-fetch",
|
|
10552
10300
|
`Failed to fetch mint account: ${error instanceof Error ? error.message : String(error)}`,
|
|
10553
10301
|
error instanceof Error ? error : void 0
|
|
@@ -10564,7 +10312,7 @@ function getEncryptedBalanceToPublicBalanceDirectWithdrawerFunction(args, deps)
|
|
|
10564
10312
|
"withdraw_from_shared_balance_into_public_balance_v11"
|
|
10565
10313
|
);
|
|
10566
10314
|
} catch (error) {
|
|
10567
|
-
throw new
|
|
10315
|
+
throw new chunkKCHHJKQN_cjs.EncryptedWithdrawalError(
|
|
10568
10316
|
"pda-derivation",
|
|
10569
10317
|
`Failed to get Arcium account addresses: ${error instanceof Error ? error.message : String(error)}`,
|
|
10570
10318
|
error instanceof Error ? error : void 0
|
|
@@ -10612,17 +10360,17 @@ function getEncryptedBalanceToPublicBalanceDirectWithdrawerFunction(args, deps)
|
|
|
10612
10360
|
...feeSlabResultToInstructionFields(protocolFeeConfig)
|
|
10613
10361
|
}, { programAddress: client.networkConfig.programId });
|
|
10614
10362
|
} catch (error) {
|
|
10615
|
-
if (error instanceof
|
|
10363
|
+
if (error instanceof chunkKCHHJKQN_cjs.EncryptedWithdrawalError) {
|
|
10616
10364
|
throw error;
|
|
10617
10365
|
}
|
|
10618
|
-
throw new
|
|
10366
|
+
throw new chunkKCHHJKQN_cjs.EncryptedWithdrawalError(
|
|
10619
10367
|
"instruction-build",
|
|
10620
10368
|
`Failed to build withdrawal instruction: ${error instanceof Error ? error.message : String(error)}`,
|
|
10621
10369
|
error instanceof Error ? error : void 0
|
|
10622
10370
|
);
|
|
10623
10371
|
}
|
|
10624
10372
|
if (instruction === void 0 || instruction === null) {
|
|
10625
|
-
throw new
|
|
10373
|
+
throw new chunkKCHHJKQN_cjs.EncryptedWithdrawalError(
|
|
10626
10374
|
"instruction-build",
|
|
10627
10375
|
"getWithdrawFromSharedBalanceIntoPublicBalanceV11InstructionAsync returned null or undefined"
|
|
10628
10376
|
);
|
|
@@ -10654,639 +10402,639 @@ Object.defineProperty(exports, "pollClaimUntilTerminal", {
|
|
|
10654
10402
|
});
|
|
10655
10403
|
Object.defineProperty(exports, "AES_AUTH_TAG_LENGTH", {
|
|
10656
10404
|
enumerable: true,
|
|
10657
|
-
get: function () { return
|
|
10405
|
+
get: function () { return chunkYFUGKMNS_cjs.AES_AUTH_TAG_LENGTH; }
|
|
10658
10406
|
});
|
|
10659
10407
|
Object.defineProperty(exports, "AES_IV_LENGTH", {
|
|
10660
10408
|
enumerable: true,
|
|
10661
|
-
get: function () { return
|
|
10409
|
+
get: function () { return chunkYFUGKMNS_cjs.AES_IV_LENGTH; }
|
|
10662
10410
|
});
|
|
10663
10411
|
Object.defineProperty(exports, "AES_KEY_LENGTH", {
|
|
10664
10412
|
enumerable: true,
|
|
10665
|
-
get: function () { return
|
|
10413
|
+
get: function () { return chunkYFUGKMNS_cjs.AES_KEY_LENGTH; }
|
|
10666
10414
|
});
|
|
10667
10415
|
Object.defineProperty(exports, "AES_METADATA_OVERHEAD", {
|
|
10668
10416
|
enumerable: true,
|
|
10669
|
-
get: function () { return
|
|
10417
|
+
get: function () { return chunkYFUGKMNS_cjs.AES_METADATA_OVERHEAD; }
|
|
10670
10418
|
});
|
|
10671
10419
|
Object.defineProperty(exports, "ALPHA", {
|
|
10672
10420
|
enumerable: true,
|
|
10673
|
-
get: function () { return
|
|
10421
|
+
get: function () { return chunkYFUGKMNS_cjs.ALPHA; }
|
|
10674
10422
|
});
|
|
10675
10423
|
Object.defineProperty(exports, "ALPHA_INVERSE", {
|
|
10676
10424
|
enumerable: true,
|
|
10677
|
-
get: function () { return
|
|
10425
|
+
get: function () { return chunkYFUGKMNS_cjs.ALPHA_INVERSE; }
|
|
10678
10426
|
});
|
|
10679
10427
|
Object.defineProperty(exports, "BASE85_LIMB_MAX", {
|
|
10680
10428
|
enumerable: true,
|
|
10681
|
-
get: function () { return
|
|
10429
|
+
get: function () { return chunkYFUGKMNS_cjs.BASE85_LIMB_MAX; }
|
|
10682
10430
|
});
|
|
10683
10431
|
Object.defineProperty(exports, "BLOCK_SIZE", {
|
|
10684
10432
|
enumerable: true,
|
|
10685
|
-
get: function () { return
|
|
10433
|
+
get: function () { return chunkYFUGKMNS_cjs.BLOCK_SIZE; }
|
|
10686
10434
|
});
|
|
10687
10435
|
Object.defineProperty(exports, "CIPHER_ROUND_COUNT", {
|
|
10688
10436
|
enumerable: true,
|
|
10689
|
-
get: function () { return
|
|
10437
|
+
get: function () { return chunkYFUGKMNS_cjs.CIPHER_ROUND_COUNT; }
|
|
10690
10438
|
});
|
|
10691
10439
|
Object.defineProperty(exports, "FIELD_ELEMENT_BYTE_LENGTH", {
|
|
10692
10440
|
enumerable: true,
|
|
10693
|
-
get: function () { return
|
|
10441
|
+
get: function () { return chunkYFUGKMNS_cjs.FIELD_ELEMENT_BYTE_LENGTH; }
|
|
10694
10442
|
});
|
|
10695
10443
|
Object.defineProperty(exports, "FIELD_PRIME", {
|
|
10696
10444
|
enumerable: true,
|
|
10697
|
-
get: function () { return
|
|
10445
|
+
get: function () { return chunkYFUGKMNS_cjs.FIELD_PRIME; }
|
|
10698
10446
|
});
|
|
10699
10447
|
Object.defineProperty(exports, "GROTH16_G1_BYTE_LENGTH", {
|
|
10700
10448
|
enumerable: true,
|
|
10701
|
-
get: function () { return
|
|
10449
|
+
get: function () { return chunkYFUGKMNS_cjs.GROTH16_G1_BYTE_LENGTH; }
|
|
10702
10450
|
});
|
|
10703
10451
|
Object.defineProperty(exports, "GROTH16_G2_BYTE_LENGTH", {
|
|
10704
10452
|
enumerable: true,
|
|
10705
|
-
get: function () { return
|
|
10453
|
+
get: function () { return chunkYFUGKMNS_cjs.GROTH16_G2_BYTE_LENGTH; }
|
|
10706
10454
|
});
|
|
10707
10455
|
Object.defineProperty(exports, "HASH_CAPACITY", {
|
|
10708
10456
|
enumerable: true,
|
|
10709
|
-
get: function () { return
|
|
10457
|
+
get: function () { return chunkYFUGKMNS_cjs.HASH_CAPACITY; }
|
|
10710
10458
|
});
|
|
10711
10459
|
Object.defineProperty(exports, "HASH_DIGEST_LENGTH", {
|
|
10712
10460
|
enumerable: true,
|
|
10713
|
-
get: function () { return
|
|
10461
|
+
get: function () { return chunkYFUGKMNS_cjs.HASH_DIGEST_LENGTH; }
|
|
10714
10462
|
});
|
|
10715
10463
|
Object.defineProperty(exports, "HASH_RATE", {
|
|
10716
10464
|
enumerable: true,
|
|
10717
|
-
get: function () { return
|
|
10465
|
+
get: function () { return chunkYFUGKMNS_cjs.HASH_RATE; }
|
|
10718
10466
|
});
|
|
10719
10467
|
Object.defineProperty(exports, "HASH_ROUND_COUNT", {
|
|
10720
10468
|
enumerable: true,
|
|
10721
|
-
get: function () { return
|
|
10469
|
+
get: function () { return chunkYFUGKMNS_cjs.HASH_ROUND_COUNT; }
|
|
10722
10470
|
});
|
|
10723
10471
|
Object.defineProperty(exports, "HASH_STATE_SIZE", {
|
|
10724
10472
|
enumerable: true,
|
|
10725
|
-
get: function () { return
|
|
10473
|
+
get: function () { return chunkYFUGKMNS_cjs.HASH_STATE_SIZE; }
|
|
10726
10474
|
});
|
|
10727
10475
|
Object.defineProperty(exports, "MASTER_VIEWING_KEY_MAX", {
|
|
10728
10476
|
enumerable: true,
|
|
10729
|
-
get: function () { return
|
|
10477
|
+
get: function () { return chunkYFUGKMNS_cjs.MASTER_VIEWING_KEY_MAX; }
|
|
10730
10478
|
});
|
|
10731
10479
|
Object.defineProperty(exports, "MAX_AGGREGATOR_INPUTS", {
|
|
10732
10480
|
enumerable: true,
|
|
10733
|
-
get: function () { return
|
|
10481
|
+
get: function () { return chunkYFUGKMNS_cjs.MAX_AGGREGATOR_INPUTS; }
|
|
10734
10482
|
});
|
|
10735
10483
|
Object.defineProperty(exports, "MAX_POSEIDON_INPUTS", {
|
|
10736
10484
|
enumerable: true,
|
|
10737
|
-
get: function () { return
|
|
10485
|
+
get: function () { return chunkYFUGKMNS_cjs.MAX_POSEIDON_INPUTS; }
|
|
10738
10486
|
});
|
|
10739
10487
|
Object.defineProperty(exports, "MAX_PRF_SEEDS", {
|
|
10740
10488
|
enumerable: true,
|
|
10741
|
-
get: function () { return
|
|
10489
|
+
get: function () { return chunkYFUGKMNS_cjs.MAX_PRF_SEEDS; }
|
|
10742
10490
|
});
|
|
10743
10491
|
Object.defineProperty(exports, "NONCE_BYTES", {
|
|
10744
10492
|
enumerable: true,
|
|
10745
|
-
get: function () { return
|
|
10493
|
+
get: function () { return chunkYFUGKMNS_cjs.NONCE_BYTES; }
|
|
10746
10494
|
});
|
|
10747
10495
|
Object.defineProperty(exports, "OPTIONAL_DATA_BYTE_LENGTH", {
|
|
10748
10496
|
enumerable: true,
|
|
10749
|
-
get: function () { return
|
|
10497
|
+
get: function () { return chunkYFUGKMNS_cjs.OPTIONAL_DATA_BYTE_LENGTH; }
|
|
10750
10498
|
});
|
|
10751
10499
|
Object.defineProperty(exports, "PRECOMPUTED_FIELD_INVERSES", {
|
|
10752
10500
|
enumerable: true,
|
|
10753
|
-
get: function () { return
|
|
10501
|
+
get: function () { return chunkYFUGKMNS_cjs.PRECOMPUTED_FIELD_INVERSES; }
|
|
10754
10502
|
});
|
|
10755
10503
|
Object.defineProperty(exports, "REDUCTION_CONST", {
|
|
10756
10504
|
enumerable: true,
|
|
10757
|
-
get: function () { return
|
|
10505
|
+
get: function () { return chunkYFUGKMNS_cjs.REDUCTION_CONST; }
|
|
10758
10506
|
});
|
|
10759
10507
|
Object.defineProperty(exports, "SAMPLE_BUFFER_BYTE_LENGTH", {
|
|
10760
10508
|
enumerable: true,
|
|
10761
|
-
get: function () { return
|
|
10509
|
+
get: function () { return chunkYFUGKMNS_cjs.SAMPLE_BUFFER_BYTE_LENGTH; }
|
|
10762
10510
|
});
|
|
10763
10511
|
Object.defineProperty(exports, "SECRET_BYTES", {
|
|
10764
10512
|
enumerable: true,
|
|
10765
|
-
get: function () { return
|
|
10513
|
+
get: function () { return chunkYFUGKMNS_cjs.SECRET_BYTES; }
|
|
10766
10514
|
});
|
|
10767
10515
|
Object.defineProperty(exports, "SHAKE256_CIPHER_SEED", {
|
|
10768
10516
|
enumerable: true,
|
|
10769
|
-
get: function () { return
|
|
10517
|
+
get: function () { return chunkYFUGKMNS_cjs.SHAKE256_CIPHER_SEED; }
|
|
10770
10518
|
});
|
|
10771
10519
|
Object.defineProperty(exports, "X25519_BYTE_LENGTH", {
|
|
10772
10520
|
enumerable: true,
|
|
10773
|
-
get: function () { return
|
|
10521
|
+
get: function () { return chunkYFUGKMNS_cjs.X25519_BYTE_LENGTH; }
|
|
10774
10522
|
});
|
|
10775
10523
|
Object.defineProperty(exports, "ZK_PROOF_BYTE_LENGTH", {
|
|
10776
10524
|
enumerable: true,
|
|
10777
|
-
get: function () { return
|
|
10525
|
+
get: function () { return chunkYFUGKMNS_cjs.ZK_PROOF_BYTE_LENGTH; }
|
|
10778
10526
|
});
|
|
10779
10527
|
Object.defineProperty(exports, "assertAesCiphertextWithMetadata", {
|
|
10780
10528
|
enumerable: true,
|
|
10781
|
-
get: function () { return
|
|
10529
|
+
get: function () { return chunkYFUGKMNS_cjs.assertAesCiphertextWithMetadata; }
|
|
10782
10530
|
});
|
|
10783
10531
|
Object.defineProperty(exports, "assertAesKey", {
|
|
10784
10532
|
enumerable: true,
|
|
10785
|
-
get: function () { return
|
|
10533
|
+
get: function () { return chunkYFUGKMNS_cjs.assertAesKey; }
|
|
10786
10534
|
});
|
|
10787
10535
|
Object.defineProperty(exports, "assertAesPlaintext", {
|
|
10788
10536
|
enumerable: true,
|
|
10789
|
-
get: function () { return
|
|
10537
|
+
get: function () { return chunkYFUGKMNS_cjs.assertAesPlaintext; }
|
|
10790
10538
|
});
|
|
10791
10539
|
Object.defineProperty(exports, "assertBase85Limb", {
|
|
10792
10540
|
enumerable: true,
|
|
10793
|
-
get: function () { return
|
|
10541
|
+
get: function () { return chunkYFUGKMNS_cjs.assertBase85Limb; }
|
|
10794
10542
|
});
|
|
10795
10543
|
Object.defineProperty(exports, "assertCurve25519KeypairResult", {
|
|
10796
10544
|
enumerable: true,
|
|
10797
|
-
get: function () { return
|
|
10545
|
+
get: function () { return chunkYFUGKMNS_cjs.assertCurve25519KeypairResult; }
|
|
10798
10546
|
});
|
|
10799
10547
|
Object.defineProperty(exports, "assertDailyViewingKey", {
|
|
10800
10548
|
enumerable: true,
|
|
10801
|
-
get: function () { return
|
|
10549
|
+
get: function () { return chunkYFUGKMNS_cjs.assertDailyViewingKey; }
|
|
10802
10550
|
});
|
|
10803
10551
|
Object.defineProperty(exports, "assertEd25519Keypair", {
|
|
10804
10552
|
enumerable: true,
|
|
10805
|
-
get: function () { return
|
|
10553
|
+
get: function () { return chunkYFUGKMNS_cjs.assertEd25519Keypair; }
|
|
10806
10554
|
});
|
|
10807
10555
|
Object.defineProperty(exports, "assertGenerationSeed", {
|
|
10808
10556
|
enumerable: true,
|
|
10809
|
-
get: function () { return
|
|
10557
|
+
get: function () { return chunkYFUGKMNS_cjs.assertGenerationSeed; }
|
|
10810
10558
|
});
|
|
10811
10559
|
Object.defineProperty(exports, "assertGroth16ProofA", {
|
|
10812
10560
|
enumerable: true,
|
|
10813
|
-
get: function () { return
|
|
10561
|
+
get: function () { return chunkYFUGKMNS_cjs.assertGroth16ProofA; }
|
|
10814
10562
|
});
|
|
10815
10563
|
Object.defineProperty(exports, "assertGroth16ProofB", {
|
|
10816
10564
|
enumerable: true,
|
|
10817
|
-
get: function () { return
|
|
10565
|
+
get: function () { return chunkYFUGKMNS_cjs.assertGroth16ProofB; }
|
|
10818
10566
|
});
|
|
10819
10567
|
Object.defineProperty(exports, "assertGroth16ProofC", {
|
|
10820
10568
|
enumerable: true,
|
|
10821
|
-
get: function () { return
|
|
10569
|
+
get: function () { return chunkYFUGKMNS_cjs.assertGroth16ProofC; }
|
|
10822
10570
|
});
|
|
10823
10571
|
Object.defineProperty(exports, "assertHourlyViewingKey", {
|
|
10824
10572
|
enumerable: true,
|
|
10825
|
-
get: function () { return
|
|
10573
|
+
get: function () { return chunkYFUGKMNS_cjs.assertHourlyViewingKey; }
|
|
10826
10574
|
});
|
|
10827
10575
|
Object.defineProperty(exports, "assertKeccak256Hash", {
|
|
10828
10576
|
enumerable: true,
|
|
10829
|
-
get: function () { return
|
|
10577
|
+
get: function () { return chunkYFUGKMNS_cjs.assertKeccak256Hash; }
|
|
10830
10578
|
});
|
|
10831
10579
|
Object.defineProperty(exports, "assertKeccak512Hash", {
|
|
10832
10580
|
enumerable: true,
|
|
10833
|
-
get: function () { return
|
|
10581
|
+
get: function () { return chunkYFUGKMNS_cjs.assertKeccak512Hash; }
|
|
10834
10582
|
});
|
|
10835
10583
|
Object.defineProperty(exports, "assertMasterSeed", {
|
|
10836
10584
|
enumerable: true,
|
|
10837
|
-
get: function () { return
|
|
10585
|
+
get: function () { return chunkYFUGKMNS_cjs.assertMasterSeed; }
|
|
10838
10586
|
});
|
|
10839
10587
|
Object.defineProperty(exports, "assertMasterViewingKey", {
|
|
10840
10588
|
enumerable: true,
|
|
10841
|
-
get: function () { return
|
|
10589
|
+
get: function () { return chunkYFUGKMNS_cjs.assertMasterViewingKey; }
|
|
10842
10590
|
});
|
|
10843
10591
|
Object.defineProperty(exports, "assertMintViewingKey", {
|
|
10844
10592
|
enumerable: true,
|
|
10845
|
-
get: function () { return
|
|
10593
|
+
get: function () { return chunkYFUGKMNS_cjs.assertMintViewingKey; }
|
|
10846
10594
|
});
|
|
10847
10595
|
Object.defineProperty(exports, "assertMinuteViewingKey", {
|
|
10848
10596
|
enumerable: true,
|
|
10849
|
-
get: function () { return
|
|
10597
|
+
get: function () { return chunkYFUGKMNS_cjs.assertMinuteViewingKey; }
|
|
10850
10598
|
});
|
|
10851
10599
|
Object.defineProperty(exports, "assertMonthlyViewingKey", {
|
|
10852
10600
|
enumerable: true,
|
|
10853
|
-
get: function () { return
|
|
10601
|
+
get: function () { return chunkYFUGKMNS_cjs.assertMonthlyViewingKey; }
|
|
10854
10602
|
});
|
|
10855
10603
|
Object.defineProperty(exports, "assertOptionalData32", {
|
|
10856
10604
|
enumerable: true,
|
|
10857
|
-
get: function () { return
|
|
10605
|
+
get: function () { return chunkYFUGKMNS_cjs.assertOptionalData32; }
|
|
10858
10606
|
});
|
|
10859
10607
|
Object.defineProperty(exports, "assertPoseidonCiphertext", {
|
|
10860
10608
|
enumerable: true,
|
|
10861
|
-
get: function () { return
|
|
10609
|
+
get: function () { return chunkYFUGKMNS_cjs.assertPoseidonCiphertext; }
|
|
10862
10610
|
});
|
|
10863
10611
|
Object.defineProperty(exports, "assertPoseidonCounter", {
|
|
10864
10612
|
enumerable: true,
|
|
10865
|
-
get: function () { return
|
|
10613
|
+
get: function () { return chunkYFUGKMNS_cjs.assertPoseidonCounter; }
|
|
10866
10614
|
});
|
|
10867
10615
|
Object.defineProperty(exports, "assertPoseidonHash", {
|
|
10868
10616
|
enumerable: true,
|
|
10869
|
-
get: function () { return
|
|
10617
|
+
get: function () { return chunkYFUGKMNS_cjs.assertPoseidonHash; }
|
|
10870
10618
|
});
|
|
10871
10619
|
Object.defineProperty(exports, "assertPoseidonKey", {
|
|
10872
10620
|
enumerable: true,
|
|
10873
|
-
get: function () { return
|
|
10621
|
+
get: function () { return chunkYFUGKMNS_cjs.assertPoseidonKey; }
|
|
10874
10622
|
});
|
|
10875
10623
|
Object.defineProperty(exports, "assertPoseidonKeystream", {
|
|
10876
10624
|
enumerable: true,
|
|
10877
|
-
get: function () { return
|
|
10625
|
+
get: function () { return chunkYFUGKMNS_cjs.assertPoseidonKeystream; }
|
|
10878
10626
|
});
|
|
10879
10627
|
Object.defineProperty(exports, "assertPoseidonPlaintext", {
|
|
10880
10628
|
enumerable: true,
|
|
10881
|
-
get: function () { return
|
|
10629
|
+
get: function () { return chunkYFUGKMNS_cjs.assertPoseidonPlaintext; }
|
|
10882
10630
|
});
|
|
10883
10631
|
Object.defineProperty(exports, "assertRcCiphertext", {
|
|
10884
10632
|
enumerable: true,
|
|
10885
|
-
get: function () { return
|
|
10633
|
+
get: function () { return chunkYFUGKMNS_cjs.assertRcCiphertext; }
|
|
10886
10634
|
});
|
|
10887
10635
|
Object.defineProperty(exports, "assertRcCounter", {
|
|
10888
10636
|
enumerable: true,
|
|
10889
|
-
get: function () { return
|
|
10637
|
+
get: function () { return chunkYFUGKMNS_cjs.assertRcCounter; }
|
|
10890
10638
|
});
|
|
10891
10639
|
Object.defineProperty(exports, "assertRcEncryptionNonce", {
|
|
10892
10640
|
enumerable: true,
|
|
10893
|
-
get: function () { return
|
|
10641
|
+
get: function () { return chunkYFUGKMNS_cjs.assertRcEncryptionNonce; }
|
|
10894
10642
|
});
|
|
10895
10643
|
Object.defineProperty(exports, "assertRcKey", {
|
|
10896
10644
|
enumerable: true,
|
|
10897
|
-
get: function () { return
|
|
10645
|
+
get: function () { return chunkYFUGKMNS_cjs.assertRcKey; }
|
|
10898
10646
|
});
|
|
10899
10647
|
Object.defineProperty(exports, "assertRcPlaintext", {
|
|
10900
10648
|
enumerable: true,
|
|
10901
|
-
get: function () { return
|
|
10649
|
+
get: function () { return chunkYFUGKMNS_cjs.assertRcPlaintext; }
|
|
10902
10650
|
});
|
|
10903
10651
|
Object.defineProperty(exports, "assertSecondViewingKey", {
|
|
10904
10652
|
enumerable: true,
|
|
10905
|
-
get: function () { return
|
|
10653
|
+
get: function () { return chunkYFUGKMNS_cjs.assertSecondViewingKey; }
|
|
10906
10654
|
});
|
|
10907
10655
|
Object.defineProperty(exports, "assertSharedSecret", {
|
|
10908
10656
|
enumerable: true,
|
|
10909
|
-
get: function () { return
|
|
10657
|
+
get: function () { return chunkYFUGKMNS_cjs.assertSharedSecret; }
|
|
10910
10658
|
});
|
|
10911
10659
|
Object.defineProperty(exports, "assertX25519Bytes", {
|
|
10912
10660
|
enumerable: true,
|
|
10913
|
-
get: function () { return
|
|
10661
|
+
get: function () { return chunkYFUGKMNS_cjs.assertX25519Bytes; }
|
|
10914
10662
|
});
|
|
10915
10663
|
Object.defineProperty(exports, "assertX25519Keypair", {
|
|
10916
10664
|
enumerable: true,
|
|
10917
|
-
get: function () { return
|
|
10665
|
+
get: function () { return chunkYFUGKMNS_cjs.assertX25519Keypair; }
|
|
10918
10666
|
});
|
|
10919
10667
|
Object.defineProperty(exports, "assertX25519PrivateKey", {
|
|
10920
10668
|
enumerable: true,
|
|
10921
|
-
get: function () { return
|
|
10669
|
+
get: function () { return chunkYFUGKMNS_cjs.assertX25519PrivateKey; }
|
|
10922
10670
|
});
|
|
10923
10671
|
Object.defineProperty(exports, "assertX25519PublicKey", {
|
|
10924
10672
|
enumerable: true,
|
|
10925
|
-
get: function () { return
|
|
10673
|
+
get: function () { return chunkYFUGKMNS_cjs.assertX25519PublicKey; }
|
|
10926
10674
|
});
|
|
10927
10675
|
Object.defineProperty(exports, "assertYearlyViewingKey", {
|
|
10928
10676
|
enumerable: true,
|
|
10929
|
-
get: function () { return
|
|
10677
|
+
get: function () { return chunkYFUGKMNS_cjs.assertYearlyViewingKey; }
|
|
10930
10678
|
});
|
|
10931
10679
|
Object.defineProperty(exports, "assertZkProofBytes", {
|
|
10932
10680
|
enumerable: true,
|
|
10933
|
-
get: function () { return
|
|
10681
|
+
get: function () { return chunkYFUGKMNS_cjs.assertZkProofBytes; }
|
|
10934
10682
|
});
|
|
10935
10683
|
Object.defineProperty(exports, "buildPersonalizationString", {
|
|
10936
10684
|
enumerable: true,
|
|
10937
|
-
get: function () { return
|
|
10685
|
+
get: function () { return chunkYFUGKMNS_cjs.buildPersonalizationString; }
|
|
10938
10686
|
});
|
|
10939
10687
|
Object.defineProperty(exports, "defaultAesDecryptor", {
|
|
10940
10688
|
enumerable: true,
|
|
10941
|
-
get: function () { return
|
|
10689
|
+
get: function () { return chunkYFUGKMNS_cjs.defaultAesDecryptor; }
|
|
10942
10690
|
});
|
|
10943
10691
|
Object.defineProperty(exports, "defaultAesEncryptor", {
|
|
10944
10692
|
enumerable: true,
|
|
10945
|
-
get: function () { return
|
|
10693
|
+
get: function () { return chunkYFUGKMNS_cjs.defaultAesEncryptor; }
|
|
10946
10694
|
});
|
|
10947
10695
|
Object.defineProperty(exports, "deriveBn254FieldElementFromKeccak512", {
|
|
10948
10696
|
enumerable: true,
|
|
10949
|
-
get: function () { return
|
|
10697
|
+
get: function () { return chunkYFUGKMNS_cjs.deriveBn254FieldElementFromKeccak512; }
|
|
10950
10698
|
});
|
|
10951
10699
|
Object.defineProperty(exports, "deriveEphemeralMasterViewingKey", {
|
|
10952
10700
|
enumerable: true,
|
|
10953
|
-
get: function () { return
|
|
10701
|
+
get: function () { return chunkYFUGKMNS_cjs.deriveEphemeralMasterViewingKey; }
|
|
10954
10702
|
});
|
|
10955
10703
|
Object.defineProperty(exports, "deriveEphemeralMasterViewingKeyBlindingFactor", {
|
|
10956
10704
|
enumerable: true,
|
|
10957
|
-
get: function () { return
|
|
10705
|
+
get: function () { return chunkYFUGKMNS_cjs.deriveEphemeralMasterViewingKeyBlindingFactor; }
|
|
10958
10706
|
});
|
|
10959
10707
|
Object.defineProperty(exports, "deriveEphemeralPoseidonPrivateKey", {
|
|
10960
10708
|
enumerable: true,
|
|
10961
|
-
get: function () { return
|
|
10709
|
+
get: function () { return chunkYFUGKMNS_cjs.deriveEphemeralPoseidonPrivateKey; }
|
|
10962
10710
|
});
|
|
10963
10711
|
Object.defineProperty(exports, "deriveEphemeralPoseidonPrivateKeyBlindingFactor", {
|
|
10964
10712
|
enumerable: true,
|
|
10965
|
-
get: function () { return
|
|
10713
|
+
get: function () { return chunkYFUGKMNS_cjs.deriveEphemeralPoseidonPrivateKeyBlindingFactor; }
|
|
10966
10714
|
});
|
|
10967
10715
|
Object.defineProperty(exports, "deriveKeystreamBlindingFactor", {
|
|
10968
10716
|
enumerable: true,
|
|
10969
|
-
get: function () { return
|
|
10717
|
+
get: function () { return chunkYFUGKMNS_cjs.deriveKeystreamBlindingFactor; }
|
|
10970
10718
|
});
|
|
10971
10719
|
Object.defineProperty(exports, "deriveModifiedGenerationIndexForReceiverClaim", {
|
|
10972
10720
|
enumerable: true,
|
|
10973
|
-
get: function () { return
|
|
10721
|
+
get: function () { return chunkYFUGKMNS_cjs.deriveModifiedGenerationIndexForReceiverClaim; }
|
|
10974
10722
|
});
|
|
10975
10723
|
Object.defineProperty(exports, "deriveModifiedGenerationIndexForSenderClaim", {
|
|
10976
10724
|
enumerable: true,
|
|
10977
|
-
get: function () { return
|
|
10725
|
+
get: function () { return chunkYFUGKMNS_cjs.deriveModifiedGenerationIndexForSenderClaim; }
|
|
10978
10726
|
});
|
|
10979
10727
|
Object.defineProperty(exports, "deriveNullifierFromModifiedGenerationIndex", {
|
|
10980
10728
|
enumerable: true,
|
|
10981
|
-
get: function () { return
|
|
10729
|
+
get: function () { return chunkYFUGKMNS_cjs.deriveNullifierFromModifiedGenerationIndex; }
|
|
10982
10730
|
});
|
|
10983
10731
|
Object.defineProperty(exports, "deriveProofAccountOffsetFromModifiedGenerationIndex", {
|
|
10984
10732
|
enumerable: true,
|
|
10985
|
-
get: function () { return
|
|
10733
|
+
get: function () { return chunkYFUGKMNS_cjs.deriveProofAccountOffsetFromModifiedGenerationIndex; }
|
|
10986
10734
|
});
|
|
10987
10735
|
Object.defineProperty(exports, "deriveRandomFactorForPolynomialCommitmentFromModifiedGenerationIndex", {
|
|
10988
10736
|
enumerable: true,
|
|
10989
|
-
get: function () { return
|
|
10737
|
+
get: function () { return chunkYFUGKMNS_cjs.deriveRandomFactorForPolynomialCommitmentFromModifiedGenerationIndex; }
|
|
10990
10738
|
});
|
|
10991
10739
|
Object.defineProperty(exports, "deriveRandomSecretFromModifiedGenerationIndex", {
|
|
10992
10740
|
enumerable: true,
|
|
10993
|
-
get: function () { return
|
|
10741
|
+
get: function () { return chunkYFUGKMNS_cjs.deriveRandomSecretFromModifiedGenerationIndex; }
|
|
10994
10742
|
});
|
|
10995
10743
|
Object.defineProperty(exports, "deriveRescueEncryptionCommitmentBlindingFactorFromModifiedGenerationIndex", {
|
|
10996
10744
|
enumerable: true,
|
|
10997
|
-
get: function () { return
|
|
10745
|
+
get: function () { return chunkYFUGKMNS_cjs.deriveRescueEncryptionCommitmentBlindingFactorFromModifiedGenerationIndex; }
|
|
10998
10746
|
});
|
|
10999
10747
|
Object.defineProperty(exports, "expandModifiedGenerationIndex", {
|
|
11000
10748
|
enumerable: true,
|
|
11001
|
-
get: function () { return
|
|
10749
|
+
get: function () { return chunkYFUGKMNS_cjs.expandModifiedGenerationIndex; }
|
|
11002
10750
|
});
|
|
11003
10751
|
Object.defineProperty(exports, "getAesDecryptor", {
|
|
11004
10752
|
enumerable: true,
|
|
11005
|
-
get: function () { return
|
|
10753
|
+
get: function () { return chunkYFUGKMNS_cjs.getAesDecryptor; }
|
|
11006
10754
|
});
|
|
11007
10755
|
Object.defineProperty(exports, "getAesEncryptor", {
|
|
11008
10756
|
enumerable: true,
|
|
11009
|
-
get: function () { return
|
|
10757
|
+
get: function () { return chunkYFUGKMNS_cjs.getAesEncryptor; }
|
|
11010
10758
|
});
|
|
11011
10759
|
Object.defineProperty(exports, "getBn254FieldElementFromKeccak512Deriver", {
|
|
11012
10760
|
enumerable: true,
|
|
11013
|
-
get: function () { return
|
|
10761
|
+
get: function () { return chunkYFUGKMNS_cjs.getBn254FieldElementFromKeccak512Deriver; }
|
|
11014
10762
|
});
|
|
11015
10763
|
Object.defineProperty(exports, "getChallengePowersFunction", {
|
|
11016
10764
|
enumerable: true,
|
|
11017
|
-
get: function () { return
|
|
10765
|
+
get: function () { return chunkYFUGKMNS_cjs.getChallengePowersFunction; }
|
|
11018
10766
|
});
|
|
11019
10767
|
Object.defineProperty(exports, "getDailyViewingKeyDeriver", {
|
|
11020
10768
|
enumerable: true,
|
|
11021
|
-
get: function () { return
|
|
10769
|
+
get: function () { return chunkYFUGKMNS_cjs.getDailyViewingKeyDeriver; }
|
|
11022
10770
|
});
|
|
11023
10771
|
Object.defineProperty(exports, "getEphemeralMasterSeedDeriver", {
|
|
11024
10772
|
enumerable: true,
|
|
11025
|
-
get: function () { return
|
|
10773
|
+
get: function () { return chunkYFUGKMNS_cjs.getEphemeralMasterSeedDeriver; }
|
|
11026
10774
|
});
|
|
11027
10775
|
Object.defineProperty(exports, "getEphemeralRescueCommitmentBlindingFactorDeriver", {
|
|
11028
10776
|
enumerable: true,
|
|
11029
|
-
get: function () { return
|
|
10777
|
+
get: function () { return chunkYFUGKMNS_cjs.getEphemeralRescueCommitmentBlindingFactorDeriver; }
|
|
11030
10778
|
});
|
|
11031
10779
|
Object.defineProperty(exports, "getEphemeralUtxoH2RandomSecretDeriver", {
|
|
11032
10780
|
enumerable: true,
|
|
11033
|
-
get: function () { return
|
|
10781
|
+
get: function () { return chunkYFUGKMNS_cjs.getEphemeralUtxoH2RandomSecretDeriver; }
|
|
11034
10782
|
});
|
|
11035
10783
|
Object.defineProperty(exports, "getEphemeralUtxoMasterViewingKeyBlindingFactorDeriver", {
|
|
11036
10784
|
enumerable: true,
|
|
11037
|
-
get: function () { return
|
|
10785
|
+
get: function () { return chunkYFUGKMNS_cjs.getEphemeralUtxoMasterViewingKeyBlindingFactorDeriver; }
|
|
11038
10786
|
});
|
|
11039
10787
|
Object.defineProperty(exports, "getEphemeralUtxoMasterViewingKeyDeriver", {
|
|
11040
10788
|
enumerable: true,
|
|
11041
|
-
get: function () { return
|
|
10789
|
+
get: function () { return chunkYFUGKMNS_cjs.getEphemeralUtxoMasterViewingKeyDeriver; }
|
|
11042
10790
|
});
|
|
11043
10791
|
Object.defineProperty(exports, "getEphemeralUtxoNullifierDeriver", {
|
|
11044
10792
|
enumerable: true,
|
|
11045
|
-
get: function () { return
|
|
10793
|
+
get: function () { return chunkYFUGKMNS_cjs.getEphemeralUtxoNullifierDeriver; }
|
|
11046
10794
|
});
|
|
11047
10795
|
Object.defineProperty(exports, "getEphemeralUtxoPoseidonPrivateKeyBlindingFactorDeriver", {
|
|
11048
10796
|
enumerable: true,
|
|
11049
|
-
get: function () { return
|
|
10797
|
+
get: function () { return chunkYFUGKMNS_cjs.getEphemeralUtxoPoseidonPrivateKeyBlindingFactorDeriver; }
|
|
11050
10798
|
});
|
|
11051
10799
|
Object.defineProperty(exports, "getEphemeralUtxoPoseidonPrivateKeyDeriver", {
|
|
11052
10800
|
enumerable: true,
|
|
11053
|
-
get: function () { return
|
|
10801
|
+
get: function () { return chunkYFUGKMNS_cjs.getEphemeralUtxoPoseidonPrivateKeyDeriver; }
|
|
11054
10802
|
});
|
|
11055
10803
|
Object.defineProperty(exports, "getFiatShamirChallengeGeneratorFunction", {
|
|
11056
10804
|
enumerable: true,
|
|
11057
|
-
get: function () { return
|
|
10805
|
+
get: function () { return chunkYFUGKMNS_cjs.getFiatShamirChallengeGeneratorFunction; }
|
|
11058
10806
|
});
|
|
11059
10807
|
Object.defineProperty(exports, "getFieldArithmetic", {
|
|
11060
10808
|
enumerable: true,
|
|
11061
|
-
get: function () { return
|
|
10809
|
+
get: function () { return chunkYFUGKMNS_cjs.getFieldArithmetic; }
|
|
11062
10810
|
});
|
|
11063
10811
|
Object.defineProperty(exports, "getHourlyViewingKeyDeriver", {
|
|
11064
10812
|
enumerable: true,
|
|
11065
|
-
get: function () { return
|
|
10813
|
+
get: function () { return chunkYFUGKMNS_cjs.getHourlyViewingKeyDeriver; }
|
|
11066
10814
|
});
|
|
11067
10815
|
Object.defineProperty(exports, "getKeystreamCommitmentGenerator", {
|
|
11068
10816
|
enumerable: true,
|
|
11069
|
-
get: function () { return
|
|
10817
|
+
get: function () { return chunkYFUGKMNS_cjs.getKeystreamCommitmentGenerator; }
|
|
11070
10818
|
});
|
|
11071
10819
|
Object.defineProperty(exports, "getMasterSeedBasedFieldElementDeriver", {
|
|
11072
10820
|
enumerable: true,
|
|
11073
|
-
get: function () { return
|
|
10821
|
+
get: function () { return chunkYFUGKMNS_cjs.getMasterSeedBasedFieldElementDeriver; }
|
|
11074
10822
|
});
|
|
11075
10823
|
Object.defineProperty(exports, "getMasterViewingKeyBlindingFactorDeriver", {
|
|
11076
10824
|
enumerable: true,
|
|
11077
|
-
get: function () { return
|
|
10825
|
+
get: function () { return chunkYFUGKMNS_cjs.getMasterViewingKeyBlindingFactorDeriver; }
|
|
11078
10826
|
});
|
|
11079
10827
|
Object.defineProperty(exports, "getMasterViewingKeyDeriver", {
|
|
11080
10828
|
enumerable: true,
|
|
11081
|
-
get: function () { return
|
|
10829
|
+
get: function () { return chunkYFUGKMNS_cjs.getMasterViewingKeyDeriver; }
|
|
11082
10830
|
});
|
|
11083
10831
|
Object.defineProperty(exports, "getMasterViewingKeyX25519KeypairDeriver", {
|
|
11084
10832
|
enumerable: true,
|
|
11085
|
-
get: function () { return
|
|
10833
|
+
get: function () { return chunkYFUGKMNS_cjs.getMasterViewingKeyX25519KeypairDeriver; }
|
|
11086
10834
|
});
|
|
11087
10835
|
Object.defineProperty(exports, "getMintViewingKeyDeriver", {
|
|
11088
10836
|
enumerable: true,
|
|
11089
|
-
get: function () { return
|
|
10837
|
+
get: function () { return chunkYFUGKMNS_cjs.getMintViewingKeyDeriver; }
|
|
11090
10838
|
});
|
|
11091
10839
|
Object.defineProperty(exports, "getMintX25519KeypairDeriver", {
|
|
11092
10840
|
enumerable: true,
|
|
11093
|
-
get: function () { return
|
|
10841
|
+
get: function () { return chunkYFUGKMNS_cjs.getMintX25519KeypairDeriver; }
|
|
11094
10842
|
});
|
|
11095
10843
|
Object.defineProperty(exports, "getMinuteViewingKeyDeriver", {
|
|
11096
10844
|
enumerable: true,
|
|
11097
|
-
get: function () { return
|
|
10845
|
+
get: function () { return chunkYFUGKMNS_cjs.getMinuteViewingKeyDeriver; }
|
|
11098
10846
|
});
|
|
11099
10847
|
Object.defineProperty(exports, "getModuloPowCurve25519Function", {
|
|
11100
10848
|
enumerable: true,
|
|
11101
|
-
get: function () { return
|
|
10849
|
+
get: function () { return chunkYFUGKMNS_cjs.getModuloPowCurve25519Function; }
|
|
11102
10850
|
});
|
|
11103
10851
|
Object.defineProperty(exports, "getMonthlyViewingKeyDeriver", {
|
|
11104
10852
|
enumerable: true,
|
|
11105
|
-
get: function () { return
|
|
10853
|
+
get: function () { return chunkYFUGKMNS_cjs.getMonthlyViewingKeyDeriver; }
|
|
11106
10854
|
});
|
|
11107
10855
|
Object.defineProperty(exports, "getPersonalizationStringBuilder", {
|
|
11108
10856
|
enumerable: true,
|
|
11109
|
-
get: function () { return
|
|
10857
|
+
get: function () { return chunkYFUGKMNS_cjs.getPersonalizationStringBuilder; }
|
|
11110
10858
|
});
|
|
11111
10859
|
Object.defineProperty(exports, "getPolynomialCommitmentFactorDeriver", {
|
|
11112
10860
|
enumerable: true,
|
|
11113
|
-
get: function () { return
|
|
10861
|
+
get: function () { return chunkYFUGKMNS_cjs.getPolynomialCommitmentFactorDeriver; }
|
|
11114
10862
|
});
|
|
11115
10863
|
Object.defineProperty(exports, "getPolynomialEvaluatorFunction", {
|
|
11116
10864
|
enumerable: true,
|
|
11117
|
-
get: function () { return
|
|
10865
|
+
get: function () { return chunkYFUGKMNS_cjs.getPolynomialEvaluatorFunction; }
|
|
11118
10866
|
});
|
|
11119
10867
|
Object.defineProperty(exports, "getPoseidonAggregator", {
|
|
11120
10868
|
enumerable: true,
|
|
11121
|
-
get: function () { return
|
|
10869
|
+
get: function () { return chunkYFUGKMNS_cjs.getPoseidonAggregator; }
|
|
11122
10870
|
});
|
|
11123
10871
|
Object.defineProperty(exports, "getPoseidonBlindingFactorDeriver", {
|
|
11124
10872
|
enumerable: true,
|
|
11125
|
-
get: function () { return
|
|
10873
|
+
get: function () { return chunkYFUGKMNS_cjs.getPoseidonBlindingFactorDeriver; }
|
|
11126
10874
|
});
|
|
11127
10875
|
Object.defineProperty(exports, "getPoseidonDecryptor", {
|
|
11128
10876
|
enumerable: true,
|
|
11129
|
-
get: function () { return
|
|
10877
|
+
get: function () { return chunkYFUGKMNS_cjs.getPoseidonDecryptor; }
|
|
11130
10878
|
});
|
|
11131
10879
|
Object.defineProperty(exports, "getPoseidonEncryptor", {
|
|
11132
10880
|
enumerable: true,
|
|
11133
|
-
get: function () { return
|
|
10881
|
+
get: function () { return chunkYFUGKMNS_cjs.getPoseidonEncryptor; }
|
|
11134
10882
|
});
|
|
11135
10883
|
Object.defineProperty(exports, "getPoseidonHasher", {
|
|
11136
10884
|
enumerable: true,
|
|
11137
|
-
get: function () { return
|
|
10885
|
+
get: function () { return chunkYFUGKMNS_cjs.getPoseidonHasher; }
|
|
11138
10886
|
});
|
|
11139
10887
|
Object.defineProperty(exports, "getPoseidonKeystreamBlindingFactorDeriver", {
|
|
11140
10888
|
enumerable: true,
|
|
11141
|
-
get: function () { return
|
|
10889
|
+
get: function () { return chunkYFUGKMNS_cjs.getPoseidonKeystreamBlindingFactorDeriver; }
|
|
11142
10890
|
});
|
|
11143
10891
|
Object.defineProperty(exports, "getPoseidonKeystreamGenerator", {
|
|
11144
10892
|
enumerable: true,
|
|
11145
|
-
get: function () { return
|
|
10893
|
+
get: function () { return chunkYFUGKMNS_cjs.getPoseidonKeystreamGenerator; }
|
|
11146
10894
|
});
|
|
11147
10895
|
Object.defineProperty(exports, "getPoseidonPrf", {
|
|
11148
10896
|
enumerable: true,
|
|
11149
|
-
get: function () { return
|
|
10897
|
+
get: function () { return chunkYFUGKMNS_cjs.getPoseidonPrf; }
|
|
11150
10898
|
});
|
|
11151
10899
|
Object.defineProperty(exports, "getPoseidonPrivateKeyDeriver", {
|
|
11152
10900
|
enumerable: true,
|
|
11153
|
-
get: function () { return
|
|
10901
|
+
get: function () { return chunkYFUGKMNS_cjs.getPoseidonPrivateKeyDeriver; }
|
|
11154
10902
|
});
|
|
11155
10903
|
Object.defineProperty(exports, "getPseudorandomU512Deriver", {
|
|
11156
10904
|
enumerable: true,
|
|
11157
|
-
get: function () { return
|
|
10905
|
+
get: function () { return chunkYFUGKMNS_cjs.getPseudorandomU512Deriver; }
|
|
11158
10906
|
});
|
|
11159
10907
|
Object.defineProperty(exports, "getRescueCipher", {
|
|
11160
10908
|
enumerable: true,
|
|
11161
|
-
get: function () { return
|
|
10909
|
+
get: function () { return chunkYFUGKMNS_cjs.getRescueCipher; }
|
|
11162
10910
|
});
|
|
11163
10911
|
Object.defineProperty(exports, "getRescueCipherFromKeyPair", {
|
|
11164
10912
|
enumerable: true,
|
|
11165
|
-
get: function () { return
|
|
10913
|
+
get: function () { return chunkYFUGKMNS_cjs.getRescueCipherFromKeyPair; }
|
|
11166
10914
|
});
|
|
11167
10915
|
Object.defineProperty(exports, "getRescueCipherInstance", {
|
|
11168
10916
|
enumerable: true,
|
|
11169
|
-
get: function () { return
|
|
10917
|
+
get: function () { return chunkYFUGKMNS_cjs.getRescueCipherInstance; }
|
|
11170
10918
|
});
|
|
11171
10919
|
Object.defineProperty(exports, "getRescueCommitmentBlindingFactorDeriver", {
|
|
11172
10920
|
enumerable: true,
|
|
11173
|
-
get: function () { return
|
|
10921
|
+
get: function () { return chunkYFUGKMNS_cjs.getRescueCommitmentBlindingFactorDeriver; }
|
|
11174
10922
|
});
|
|
11175
10923
|
Object.defineProperty(exports, "getRescueCommitmentGenerator", {
|
|
11176
10924
|
enumerable: true,
|
|
11177
|
-
get: function () { return
|
|
10925
|
+
get: function () { return chunkYFUGKMNS_cjs.getRescueCommitmentGenerator; }
|
|
11178
10926
|
});
|
|
11179
10927
|
Object.defineProperty(exports, "getRescueDecryptorFromPrivateKey", {
|
|
11180
10928
|
enumerable: true,
|
|
11181
|
-
get: function () { return
|
|
10929
|
+
get: function () { return chunkYFUGKMNS_cjs.getRescueDecryptorFromPrivateKey; }
|
|
11182
10930
|
});
|
|
11183
10931
|
Object.defineProperty(exports, "getRescueEncryptorFromPrivateKey", {
|
|
11184
10932
|
enumerable: true,
|
|
11185
|
-
get: function () { return
|
|
10933
|
+
get: function () { return chunkYFUGKMNS_cjs.getRescueEncryptorFromPrivateKey; }
|
|
11186
10934
|
});
|
|
11187
10935
|
Object.defineProperty(exports, "getRescueEncryptorWithNonceFromPrivateKey", {
|
|
11188
10936
|
enumerable: true,
|
|
11189
|
-
get: function () { return
|
|
10937
|
+
get: function () { return chunkYFUGKMNS_cjs.getRescueEncryptorWithNonceFromPrivateKey; }
|
|
11190
10938
|
});
|
|
11191
10939
|
Object.defineProperty(exports, "getRescueKeyGeneratorFromPrivateKey", {
|
|
11192
10940
|
enumerable: true,
|
|
11193
|
-
get: function () { return
|
|
10941
|
+
get: function () { return chunkYFUGKMNS_cjs.getRescueKeyGeneratorFromPrivateKey; }
|
|
11194
10942
|
});
|
|
11195
10943
|
Object.defineProperty(exports, "getRescuePrimeHashFunction", {
|
|
11196
10944
|
enumerable: true,
|
|
11197
|
-
get: function () { return
|
|
10945
|
+
get: function () { return chunkYFUGKMNS_cjs.getRescuePrimeHashFunction; }
|
|
11198
10946
|
});
|
|
11199
10947
|
Object.defineProperty(exports, "getSecondViewingKeyDeriver", {
|
|
11200
10948
|
enumerable: true,
|
|
11201
|
-
get: function () { return
|
|
10949
|
+
get: function () { return chunkYFUGKMNS_cjs.getSecondViewingKeyDeriver; }
|
|
11202
10950
|
});
|
|
11203
10951
|
Object.defineProperty(exports, "getUserAccountX25519KeypairDeriver", {
|
|
11204
10952
|
enumerable: true,
|
|
11205
|
-
get: function () { return
|
|
10953
|
+
get: function () { return chunkYFUGKMNS_cjs.getUserAccountX25519KeypairDeriver; }
|
|
11206
10954
|
});
|
|
11207
10955
|
Object.defineProperty(exports, "getUserCommitmentGeneratorFunction", {
|
|
11208
10956
|
enumerable: true,
|
|
11209
|
-
get: function () { return
|
|
10957
|
+
get: function () { return chunkYFUGKMNS_cjs.getUserCommitmentGeneratorFunction; }
|
|
11210
10958
|
});
|
|
11211
10959
|
Object.defineProperty(exports, "getUtxoCommitmentHashGenerator", {
|
|
11212
10960
|
enumerable: true,
|
|
11213
|
-
get: function () { return
|
|
10961
|
+
get: function () { return chunkYFUGKMNS_cjs.getUtxoCommitmentHashGenerator; }
|
|
11214
10962
|
});
|
|
11215
10963
|
Object.defineProperty(exports, "getYearlyViewingKeyDeriver", {
|
|
11216
10964
|
enumerable: true,
|
|
11217
|
-
get: function () { return
|
|
10965
|
+
get: function () { return chunkYFUGKMNS_cjs.getYearlyViewingKeyDeriver; }
|
|
11218
10966
|
});
|
|
11219
10967
|
Object.defineProperty(exports, "ClaimUtxoError", {
|
|
11220
10968
|
enumerable: true,
|
|
11221
|
-
get: function () { return
|
|
10969
|
+
get: function () { return chunkKCHHJKQN_cjs.ClaimUtxoError; }
|
|
11222
10970
|
});
|
|
11223
10971
|
Object.defineProperty(exports, "ComputationMonitorError", {
|
|
11224
10972
|
enumerable: true,
|
|
11225
|
-
get: function () { return
|
|
10973
|
+
get: function () { return chunkKCHHJKQN_cjs.ComputationMonitorError; }
|
|
11226
10974
|
});
|
|
11227
10975
|
Object.defineProperty(exports, "ConversionError", {
|
|
11228
10976
|
enumerable: true,
|
|
11229
|
-
get: function () { return
|
|
10977
|
+
get: function () { return chunkKCHHJKQN_cjs.ConversionError; }
|
|
11230
10978
|
});
|
|
11231
10979
|
Object.defineProperty(exports, "CreateUtxoError", {
|
|
11232
10980
|
enumerable: true,
|
|
11233
|
-
get: function () { return
|
|
10981
|
+
get: function () { return chunkKCHHJKQN_cjs.CreateUtxoError; }
|
|
11234
10982
|
});
|
|
11235
10983
|
Object.defineProperty(exports, "EncryptedDepositError", {
|
|
11236
10984
|
enumerable: true,
|
|
11237
|
-
get: function () { return
|
|
10985
|
+
get: function () { return chunkKCHHJKQN_cjs.EncryptedDepositError; }
|
|
11238
10986
|
});
|
|
11239
10987
|
Object.defineProperty(exports, "EncryptedWithdrawalError", {
|
|
11240
10988
|
enumerable: true,
|
|
11241
|
-
get: function () { return
|
|
10989
|
+
get: function () { return chunkKCHHJKQN_cjs.EncryptedWithdrawalError; }
|
|
11242
10990
|
});
|
|
11243
10991
|
Object.defineProperty(exports, "FetchUtxosError", {
|
|
11244
10992
|
enumerable: true,
|
|
11245
|
-
get: function () { return
|
|
10993
|
+
get: function () { return chunkKCHHJKQN_cjs.FetchUtxosError; }
|
|
11246
10994
|
});
|
|
11247
10995
|
Object.defineProperty(exports, "QueryError", {
|
|
11248
10996
|
enumerable: true,
|
|
11249
|
-
get: function () { return
|
|
10997
|
+
get: function () { return chunkKCHHJKQN_cjs.QueryError; }
|
|
11250
10998
|
});
|
|
11251
10999
|
Object.defineProperty(exports, "RegistrationError", {
|
|
11252
11000
|
enumerable: true,
|
|
11253
|
-
get: function () { return
|
|
11001
|
+
get: function () { return chunkKCHHJKQN_cjs.RegistrationError; }
|
|
11254
11002
|
});
|
|
11255
11003
|
Object.defineProperty(exports, "isClaimUtxoError", {
|
|
11256
11004
|
enumerable: true,
|
|
11257
|
-
get: function () { return
|
|
11005
|
+
get: function () { return chunkKCHHJKQN_cjs.isClaimUtxoError; }
|
|
11258
11006
|
});
|
|
11259
11007
|
Object.defineProperty(exports, "isComputationMonitorError", {
|
|
11260
11008
|
enumerable: true,
|
|
11261
|
-
get: function () { return
|
|
11009
|
+
get: function () { return chunkKCHHJKQN_cjs.isComputationMonitorError; }
|
|
11262
11010
|
});
|
|
11263
11011
|
Object.defineProperty(exports, "isConversionError", {
|
|
11264
11012
|
enumerable: true,
|
|
11265
|
-
get: function () { return
|
|
11013
|
+
get: function () { return chunkKCHHJKQN_cjs.isConversionError; }
|
|
11266
11014
|
});
|
|
11267
11015
|
Object.defineProperty(exports, "isCreateUtxoError", {
|
|
11268
11016
|
enumerable: true,
|
|
11269
|
-
get: function () { return
|
|
11017
|
+
get: function () { return chunkKCHHJKQN_cjs.isCreateUtxoError; }
|
|
11270
11018
|
});
|
|
11271
11019
|
Object.defineProperty(exports, "isEncryptedDepositError", {
|
|
11272
11020
|
enumerable: true,
|
|
11273
|
-
get: function () { return
|
|
11021
|
+
get: function () { return chunkKCHHJKQN_cjs.isEncryptedDepositError; }
|
|
11274
11022
|
});
|
|
11275
11023
|
Object.defineProperty(exports, "isEncryptedWithdrawalError", {
|
|
11276
11024
|
enumerable: true,
|
|
11277
|
-
get: function () { return
|
|
11025
|
+
get: function () { return chunkKCHHJKQN_cjs.isEncryptedWithdrawalError; }
|
|
11278
11026
|
});
|
|
11279
11027
|
Object.defineProperty(exports, "isFetchUtxosError", {
|
|
11280
11028
|
enumerable: true,
|
|
11281
|
-
get: function () { return
|
|
11029
|
+
get: function () { return chunkKCHHJKQN_cjs.isFetchUtxosError; }
|
|
11282
11030
|
});
|
|
11283
11031
|
Object.defineProperty(exports, "isQueryError", {
|
|
11284
11032
|
enumerable: true,
|
|
11285
|
-
get: function () { return
|
|
11033
|
+
get: function () { return chunkKCHHJKQN_cjs.isQueryError; }
|
|
11286
11034
|
});
|
|
11287
11035
|
Object.defineProperty(exports, "isRegistrationError", {
|
|
11288
11036
|
enumerable: true,
|
|
11289
|
-
get: function () { return
|
|
11037
|
+
get: function () { return chunkKCHHJKQN_cjs.isRegistrationError; }
|
|
11290
11038
|
});
|
|
11291
11039
|
Object.defineProperty(exports, "bn254Add", {
|
|
11292
11040
|
enumerable: true,
|
|
@@ -11430,7 +11178,6 @@ exports.DEFAULT_POLLING_INTERVAL_MS = DEFAULT_POLLING_INTERVAL_MS;
|
|
|
11430
11178
|
exports.DEFAULT_SAFETY_TIMEOUT_MS = DEFAULT_SAFETY_TIMEOUT_MS;
|
|
11431
11179
|
exports.DEFAULT_SIGNATURE_RETRIEVAL_LIMIT = DEFAULT_SIGNATURE_RETRIEVAL_LIMIT;
|
|
11432
11180
|
exports.FEE_OFFSETS = FEE_OFFSETS;
|
|
11433
|
-
exports.IndexerError = IndexerError;
|
|
11434
11181
|
exports.UMBRA_MESSAGE_TO_SIGN = UMBRA_MESSAGE_TO_SIGN;
|
|
11435
11182
|
exports.buildTransactionMessage = buildTransactionMessage;
|
|
11436
11183
|
exports.calculateFee = calculateFee;
|
|
@@ -11440,7 +11187,6 @@ exports.extractMerklePath = extractMerklePath;
|
|
|
11440
11187
|
exports.extractSignatures = extractSignatures;
|
|
11441
11188
|
exports.feeSlabResultToInstructionFields = feeSlabResultToInstructionFields;
|
|
11442
11189
|
exports.forwardAndMonitor = forwardAndMonitor;
|
|
11443
|
-
exports.getBatchMerkleProofFetcher = getBatchMerkleProofFetcher;
|
|
11444
11190
|
exports.getClaimableUtxoScannerFunction = getClaimableUtxoScannerFunction;
|
|
11445
11191
|
exports.getComplianceGrantIssuerFunction = getComplianceGrantIssuerFunction;
|
|
11446
11192
|
exports.getComplianceGrantRevokerFunction = getComplianceGrantRevokerFunction;
|
|
@@ -11458,7 +11204,6 @@ exports.getHardcodedCreateUtxoProtocolFeeProvider = getHardcodedCreateUtxoProtoc
|
|
|
11458
11204
|
exports.getHardcodedDepositProtocolFeeProvider = getHardcodedDepositProtocolFeeProvider;
|
|
11459
11205
|
exports.getHardcodedWithdrawalProtocolFeeProvider = getHardcodedWithdrawalProtocolFeeProvider;
|
|
11460
11206
|
exports.getMasterViewingKeyRotatorFunction = getMasterViewingKeyRotatorFunction;
|
|
11461
|
-
exports.getMerkleProofFetcher = getMerkleProofFetcher;
|
|
11462
11207
|
exports.getMintEncryptionKeyRotatorFunction = getMintEncryptionKeyRotatorFunction;
|
|
11463
11208
|
exports.getNetworkCiphertextReencryptorForNetworkGrantFunction = getNetworkCiphertextReencryptorForNetworkGrantFunction;
|
|
11464
11209
|
exports.getNetworkComplianceGrantQuerierFunction = getNetworkComplianceGrantQuerierFunction;
|
|
@@ -11482,7 +11227,6 @@ exports.getUserComplianceGrantQuerierFunction = getUserComplianceGrantQuerierFun
|
|
|
11482
11227
|
exports.getUserEncryptionKeyRotatorFunction = getUserEncryptionKeyRotatorFunction;
|
|
11483
11228
|
exports.getUserEntropySeedRotatorFunction = getUserEntropySeedRotatorFunction;
|
|
11484
11229
|
exports.getUserRegistrationFunction = getUserRegistrationFunction;
|
|
11485
|
-
exports.getUtxoDataFetcher = getUtxoDataFetcher;
|
|
11486
11230
|
exports.getWebsocketComputationMonitor = getWebsocketComputationMonitor;
|
|
11487
11231
|
exports.leafIndexToPathIndices = leafIndexToPathIndices;
|
|
11488
11232
|
exports.protocolFeeSlabResultToInstructionFields = protocolFeeSlabResultToInstructionFields;
|