@arcium-hq/client 0.9.2 → 0.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/build/index.cjs +15 -3
  2. package/build/index.mjs +15 -4
  3. package/build/types/arcis/arcisModule.d.ts +26 -0
  4. package/build/types/arcis/arcisModule.d.ts.map +1 -0
  5. package/build/types/arcis/arcisType.d.ts +76 -0
  6. package/build/types/arcis/arcisType.d.ts.map +1 -0
  7. package/build/types/arcis/packer.d.ts +63 -0
  8. package/build/types/arcis/packer.d.ts.map +1 -0
  9. package/build/types/arcis/packing.d.ts +33 -0
  10. package/build/types/arcis/packing.d.ts.map +1 -0
  11. package/build/types/callback.d.ts +21 -0
  12. package/build/types/callback.d.ts.map +1 -0
  13. package/build/types/constants.d.ts +101 -0
  14. package/build/types/constants.d.ts.map +1 -0
  15. package/build/types/cryptography/aes128Cipher.d.ts +14 -0
  16. package/build/types/cryptography/aes128Cipher.d.ts.map +1 -0
  17. package/build/types/cryptography/aes192Cipher.d.ts +14 -0
  18. package/build/types/cryptography/aes192Cipher.d.ts.map +1 -0
  19. package/build/types/cryptography/aes256Cipher.d.ts +14 -0
  20. package/build/types/cryptography/aes256Cipher.d.ts.map +1 -0
  21. package/build/types/cryptography/aesCtrCipher.d.ts +36 -0
  22. package/build/types/cryptography/aesCtrCipher.d.ts.map +1 -0
  23. package/build/types/cryptography/arcisEd25519.d.ts +8 -0
  24. package/build/types/cryptography/arcisEd25519.d.ts.map +1 -0
  25. package/build/types/cryptography/cSplRescueCipher.d.ts +29 -0
  26. package/build/types/cryptography/cSplRescueCipher.d.ts.map +1 -0
  27. package/build/types/cryptography/cryptography.d.ts +38 -0
  28. package/build/types/cryptography/cryptography.d.ts.map +1 -0
  29. package/build/types/cryptography/hkdf.d.ts +37 -0
  30. package/build/types/cryptography/hkdf.d.ts.map +1 -0
  31. package/build/types/cryptography/hmac.d.ts +22 -0
  32. package/build/types/cryptography/hmac.d.ts.map +1 -0
  33. package/build/types/cryptography/rescueCipher.d.ts +29 -0
  34. package/build/types/cryptography/rescueCipher.d.ts.map +1 -0
  35. package/build/types/cryptography/rescueCipherCommon.d.ts +45 -0
  36. package/build/types/cryptography/rescueCipherCommon.d.ts.map +1 -0
  37. package/build/types/cryptography/rescueDesc.d.ts +80 -0
  38. package/build/types/cryptography/rescueDesc.d.ts.map +1 -0
  39. package/build/types/cryptography/rescuePrimeHash.d.ts +23 -0
  40. package/build/types/cryptography/rescuePrimeHash.d.ts.map +1 -0
  41. package/build/types/ctUtils.d.ts +50 -0
  42. package/build/types/ctUtils.d.ts.map +1 -0
  43. package/build/{index.d.ts → types/idl/arcium.d.ts} +5 -901
  44. package/build/types/idl/arcium.d.ts.map +1 -0
  45. package/build/types/idl/arcium_staking.d.ts +4589 -0
  46. package/build/types/idl/arcium_staking.d.ts.map +1 -0
  47. package/build/types/idl/index.d.ts +15 -0
  48. package/build/types/idl/index.d.ts.map +1 -0
  49. package/build/types/index.d.ts +33 -0
  50. package/build/types/index.d.ts.map +1 -0
  51. package/build/types/localEnv.d.ts +15 -0
  52. package/build/types/localEnv.d.ts.map +1 -0
  53. package/build/types/matrix.d.ts +39 -0
  54. package/build/types/matrix.d.ts.map +1 -0
  55. package/build/types/onchain.d.ts +223 -0
  56. package/build/types/onchain.d.ts.map +1 -0
  57. package/build/types/pda.d.ts +89 -0
  58. package/build/types/pda.d.ts.map +1 -0
  59. package/build/types/utils.d.ts +65 -0
  60. package/build/types/utils.d.ts.map +1 -0
  61. package/package.json +6 -6
  62. package/src/arcis/arcisModule.ts +39 -0
  63. package/src/arcis/arcisType.ts +303 -0
  64. package/src/arcis/packer.ts +152 -0
  65. package/src/arcis/packing.ts +115 -0
  66. package/src/callback.ts +101 -0
  67. package/src/constants.ts +104 -0
  68. package/src/cryptography/aes128Cipher.ts +16 -0
  69. package/src/cryptography/aes192Cipher.ts +16 -0
  70. package/src/cryptography/aes256Cipher.ts +16 -0
  71. package/src/cryptography/aesCtrCipher.ts +84 -0
  72. package/src/cryptography/arcisEd25519.ts +96 -0
  73. package/src/cryptography/cSplRescueCipher.ts +41 -0
  74. package/src/cryptography/cryptography.ts +82 -0
  75. package/src/cryptography/hkdf.ts +58 -0
  76. package/src/cryptography/hmac.ts +66 -0
  77. package/src/cryptography/rescueCipher.ts +41 -0
  78. package/src/cryptography/rescueCipherCommon.ts +211 -0
  79. package/src/cryptography/rescueDesc.ts +492 -0
  80. package/src/cryptography/rescuePrimeHash.ts +72 -0
  81. package/src/ctUtils.ts +124 -0
  82. package/src/idl/arcium.json +12281 -0
  83. package/src/idl/arcium.ts +12287 -0
  84. package/src/idl/arcium_staking.json +4582 -0
  85. package/src/idl/arcium_staking.ts +4588 -0
  86. package/src/idl/index.ts +20 -0
  87. package/src/index.ts +32 -0
  88. package/src/localEnv.ts +39 -0
  89. package/src/matrix.ts +215 -0
  90. package/src/onchain.ts +1020 -0
  91. package/src/pda.ts +203 -0
  92. package/src/utils.ts +126 -0
@@ -1,553 +1,14 @@
1
- import { IField } from '@noble/curves/abstract/modular';
2
- import { CurveFn } from '@noble/curves/abstract/edwards';
3
- import * as anchor from '@coral-xyz/anchor';
4
- import { AnchorProvider, Program, BN } from '@coral-xyz/anchor';
5
- import { PublicKey, ConfirmOptions, Finality } from '@solana/web3.js';
6
- export { x25519 } from '@noble/curves/ed25519';
7
-
8
- /**
9
- * Scalar field prime modulus for Curve25519: 2^252 + 27742317777372353535851937790883648493
10
- */
11
- declare const CURVE25519_SCALAR_FIELD_MODULUS: bigint;
12
- /**
13
- * Generate a random value within the field bound by q.
14
- * @param q - Upper bound (exclusive) for the random value.
15
- * @returns Random bigint value between 0 and q-1.
16
- */
17
- declare function generateRandomFieldElem(q: bigint): bigint;
18
- /**
19
- * Compute the positive modulo of a over m.
20
- * @param a - Dividend.
21
- * @param m - Modulus.
22
- * @returns Positive remainder of a mod m.
23
- */
24
- declare function positiveModulo(a: bigint, m: bigint): bigint;
25
- /**
26
- * Serialize a bigint to a little-endian Uint8Array of the specified length.
27
- * @param val - Bigint value to serialize.
28
- * @param lengthInBytes - Desired length of the output array.
29
- * @returns Serialized value as a Uint8Array.
30
- * @throws Error if the value is too large for the specified length.
31
- */
32
- declare function serializeLE(val: bigint, lengthInBytes: number): Uint8Array;
33
- /**
34
- * Deserialize a little-endian Uint8Array to a bigint.
35
- * @param bytes - Uint8Array to deserialize.
36
- * @returns Deserialized bigint value.
37
- */
38
- declare function deserializeLE(bytes: Uint8Array): bigint;
39
- /**
40
- * Compute the SHA-256 hash of an array of Uint8Arrays.
41
- * @param byteArrays - Arrays to hash.
42
- * @returns SHA-256 hash as a Buffer.
43
- */
44
- declare function sha256(byteArrays: Uint8Array[]): Buffer;
45
-
46
- /**
47
- * Matrix operations for MPC field arithmetic.
48
- * Used internally by Rescue cipher. Not part of public API.
49
- * @internal
50
- */
51
- declare class Matrix {
52
- field: FpField;
53
- data: readonly bigint[][];
54
- constructor(field: FpField, data: readonly bigint[][]);
55
- /**
56
- * Matrix multiplication between `this` and `rhs`.
57
- */
58
- matMul(rhs: Matrix): Matrix;
59
- /**
60
- * Element-wise addition between `this` and `rhs`.
61
- */
62
- add(rhs: Matrix, ct?: boolean): Matrix;
63
- /**
64
- * Element-wise subtraction between `this` and `rhs`.
65
- */
66
- sub(rhs: Matrix, ct?: boolean): Matrix;
67
- /**
68
- * Raises each element of `this` to the power `e`.
69
- */
70
- pow(e: bigint): Matrix;
71
- /**
72
- * Compute the determinant using Gauss elimination.
73
- * Match the determinant implementation in Arcis.
74
- */
75
- det(): bigint;
76
- is_square(): boolean;
77
- }
78
- /**
79
- * Generate random matrix for testing.
80
- * @internal
81
- */
82
- declare function randMatrix(field: FpField, nrows: number, ncols: number): Matrix;
83
-
84
- /**
85
- * Represents the operational mode for the Rescue cryptographic primitive.
86
- * Can be either a block cipher mode with a key, or a hash function mode with parameters.
87
- */
88
- type RescueMode = BlockCipher | HashFunction;
89
- /**
90
- * Block cipher mode configuration for Rescue.
91
- * Use a key for encryption/decryption operations.
92
- */
93
- type BlockCipher = {
94
- kind: 'cipher';
95
- key: bigint[];
96
- };
97
- /**
98
- * Hash function mode configuration for Rescue.
99
- * @param m - Rate (number of field elements absorbed per round).
100
- * @param capacity - Capacity (number of field elements in the state that are not directly accessible).
101
- */
102
- type HashFunction = {
103
- kind: 'hash';
104
- m: number;
105
- capacity: number;
106
- };
107
- /**
108
- * Field type.
109
- */
110
- type FpField = IField<bigint>;
111
- /**
112
- * Curve25519 base field as an IField instance.
113
- */
114
- declare const CURVE25519_BASE_FIELD: FpField;
115
- /**
116
- * Curve25519 scalar field as an IField instance.
117
- */
118
- declare const CURVE25519_SCALAR_FIELD: FpField;
119
- /**
120
- * Description and parameters for the Rescue cipher or hash function, including round constants, MDS matrix, and key schedule.
121
- * See: https://tosc.iacr.org/index.php/ToSC/article/view/8695/8287
122
- */
123
- declare class RescueDesc {
124
- mode: RescueMode;
125
- field: FpField;
126
- alpha: bigint;
127
- alphaInverse: bigint;
128
- nRounds: number;
129
- m: number;
130
- mdsMat: Matrix;
131
- mdsMatInverse: Matrix;
132
- roundKeys: Matrix[];
133
- /**
134
- * Construct a RescueDesc for a given field and mode (cipher or hash).
135
- * Initialize round constants, MDS matrix, and key schedule.
136
- * @param field - Field to use (e.g., CURVE25519_BASE_FIELD).
137
- * @param mode - Mode: block cipher or hash function.
138
- */
139
- constructor(field: FpField, mode: RescueMode);
140
- /**
141
- * Sample round constants for the Rescue permutation, using SHAKE256.
142
- * @param nRounds - Number of rounds.
143
- * @returns Array of round constant matrices.
144
- */
145
- sampleConstants(nRounds: number): Matrix[];
146
- /**
147
- * Apply the Rescue permutation to a state matrix.
148
- * @param state - Input state matrix.
149
- * @returns Permuted state matrix.
150
- */
151
- permute(state: Matrix): Matrix;
152
- /**
153
- * Apply the inverse Rescue permutation to a state matrix.
154
- * @param state - Input state matrix.
155
- * @returns Inverse-permuted state matrix.
156
- */
157
- permuteInverse(state: Matrix): Matrix;
158
- }
159
- declare function toVec(data: bigint[]): bigint[][];
160
-
161
- /**
162
- * The Rescue cipher in Counter (CTR) mode, with a fixed block size m = 5.
163
- * See: https://tosc.iacr.org/index.php/ToSC/article/view/8695/8287
164
- */
165
- declare class RescueCipherCommon {
166
- desc: RescueDesc;
167
- /**
168
- * Construct a RescueCipherCommon instance using a shared secret.
169
- * The key is derived using RescuePrimeHash and used to initialize the RescueDesc.
170
- * @param sharedSecret - Shared secret to derive the cipher key from.
171
- */
172
- constructor(sharedSecret: Uint8Array, field: FpField);
173
- /**
174
- * Encrypt the plaintext vector in Counter (CTR) mode (raw, returns bigints).
175
- * @param plaintext - Array of plaintext bigints to encrypt.
176
- * @param nonce - 16-byte nonce for CTR mode.
177
- * @returns Ciphertext as an array of bigints.
178
- * @throws Error if the nonce is not 16 bytes long.
179
- */
180
- encrypt_raw(plaintext: bigint[], nonce: Uint8Array): bigint[];
181
- /**
182
- * Encrypt the plaintext vector in Counter (CTR) mode and serialize each block.
183
- * @param plaintext - Array of plaintext bigints to encrypt.
184
- * @param nonce - 16-byte nonce for CTR mode.
185
- * @returns Ciphertext as an array of arrays of numbers (each 32 bytes).
186
- */
187
- encrypt(plaintext: bigint[], nonce: Uint8Array): number[][];
188
- /**
189
- * Decrypt the ciphertext vector in Counter (CTR) mode (raw, expects bigints).
190
- * @param ciphertext - Array of ciphertext bigints to decrypt.
191
- * @param nonce - 16-byte nonce for CTR mode.
192
- * @returns Decrypted plaintext as an array of bigints.
193
- * @throws Error if the nonce is not 16 bytes long.
194
- */
195
- decrypt_raw(ciphertext: bigint[], nonce: Uint8Array): bigint[];
196
- /**
197
- * Deserialize and decrypt the ciphertext vector in Counter (CTR) mode.
198
- * @param ciphertext - Array of arrays of numbers (each 32 bytes) to decrypt.
199
- * @param nonce - 16-byte nonce for CTR mode.
200
- * @returns Decrypted plaintext as an array of bigints.
201
- */
202
- decrypt(ciphertext: number[][], nonce: Uint8Array): bigint[];
203
- }
204
-
205
- /**
206
- * The Rescue cipher over Curve25519's base field in Counter (CTR) mode, with a fixed block size m = 5.
207
- * See: https://tosc.iacr.org/index.php/ToSC/article/view/8695/8287
208
- */
209
- declare class RescueCipher {
210
- cipher: RescueCipherCommon;
211
- /**
212
- * Construct a RescueCipher instance using a shared secret.
213
- * The key is derived using RescuePrimeHash and used to initialize the RescueDesc.
214
- * @param sharedSecret - Shared secret to derive the cipher key from.
215
- */
216
- constructor(sharedSecret: Uint8Array);
217
- /**
218
- * Encrypt the plaintext vector in Counter (CTR) mode and serialize each block.
219
- * @param plaintext - Array of plaintext bigints to encrypt.
220
- * @param nonce - 16-byte nonce for CTR mode.
221
- * @returns Ciphertext as an array of arrays of numbers (each 32 bytes).
222
- */
223
- encrypt(plaintext: bigint[], nonce: Uint8Array): number[][];
224
- /**
225
- * Deserialize and decrypt the ciphertext vector in Counter (CTR) mode.
226
- * @param ciphertext - Array of arrays of numbers (each 32 bytes) to decrypt.
227
- * @param nonce - 16-byte nonce for CTR mode.
228
- * @returns Decrypted plaintext as an array of bigints.
229
- */
230
- decrypt(ciphertext: number[][], nonce: Uint8Array): bigint[];
231
- }
232
-
233
- /**
234
- * The Rescue cipher over Curve25519's scalar field in Counter (CTR) mode, with a fixed block size m = 5.
235
- * See: https://tosc.iacr.org/index.php/ToSC/article/view/8695/8287
236
- */
237
- declare class CSplRescueCipher {
238
- cipher: RescueCipherCommon;
239
- /**
240
- * Construct a CSplRescueCipher instance using a shared secret.
241
- * The key is derived using RescuePrimeHash and used to initialize the RescueDesc.
242
- * @param sharedSecret - Shared secret to derive the cipher key from.
243
- */
244
- constructor(sharedSecret: Uint8Array);
245
- /**
246
- * Encrypt the plaintext vector in Counter (CTR) mode and serialize each block.
247
- * @param plaintext - Array of plaintext bigints to encrypt.
248
- * @param nonce - 16-byte nonce for CTR mode.
249
- * @returns Ciphertext as an array of arrays of numbers (each 32 bytes).
250
- */
251
- encrypt(plaintext: bigint[], nonce: Uint8Array): number[][];
252
- /**
253
- * Deserialize and decrypt the ciphertext vector in Counter (CTR) mode.
254
- * @param ciphertext - Array of arrays of numbers (each 32 bytes) to decrypt.
255
- * @param nonce - 16-byte nonce for CTR mode.
256
- * @returns Decrypted plaintext as an array of bigints.
257
- */
258
- decrypt(ciphertext: number[][], nonce: Uint8Array): bigint[];
259
- }
260
-
261
- /**
262
- * The Rescue-Prime hash function, as described in https://eprint.iacr.org/2020/1143.pdf, offering 256 bits
263
- * of security against collision, preimage and second-preimage attacks for any field of size at least 102 bits.
264
- * We use the sponge construction with fixed rate = 7 and capacity = 5 (i.e., m = 12), and truncate the
265
- * output to 5 field elements.
266
- */
267
- declare class RescuePrimeHash {
268
- desc: RescueDesc;
269
- rate: number;
270
- digestLength: number;
271
- /**
272
- * Construct a RescuePrimeHash instance with rate = 7 and capacity = 5.
273
- */
274
- constructor(field: FpField);
275
- /**
276
- * Compute the Rescue-Prime hash of a message, with padding as described in Algorithm 2 of the paper.
277
- * @param message - Input message as an array of bigints.
278
- * @returns Hash output as an array of bigints (length = digestLength).
279
- */
280
- digest(message: bigint[]): bigint[];
281
- }
282
-
283
- /**
284
- * Ed25519 curve instance using SHA3-512 for hashing, suitable for MPC (ArcisEd25519 signature scheme).
285
- * This is essentially Ed25519 but with SHA3-512 instead of SHA-512 for lower multiplicative depth.
286
- * See: https://datatracker.ietf.org/doc/html/rfc8032#section-5.1
287
- */
288
- declare const arcisEd25519: CurveFn;
289
-
290
- /**
291
- * Supported AES key sizes in bits.
292
- */
293
- type AesKeyBits = 128 | 192 | 256;
294
- /**
295
- * Generic AES cipher in Counter (CTR) mode, using SHA3-256 to derive the key from a shared secret.
296
- * See: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38a.pdf (Section 6.5) for details on CTR mode.
297
- */
298
- declare class AesCtrCipher {
299
- protected key: Uint8Array;
300
- private readonly keyBits;
301
- /**
302
- * Construct an AES cipher instance using a shared secret.
303
- * The key is derived using SHA3-256.
304
- * @param sharedSecret - Shared secret to derive the AES key from.
305
- * @param keyBits - AES key size in bits (128, 192, or 256).
306
- */
307
- constructor(sharedSecret: Uint8Array, keyBits: AesKeyBits);
308
- /**
309
- * Encrypt the plaintext array in Counter (CTR) mode.
310
- * @param plaintext - Data to encrypt.
311
- * @param nonce - 8-byte nonce for CTR mode.
312
- * @returns Encrypted ciphertext as a Uint8Array.
313
- * @throws Error if the nonce is not 8 bytes long.
314
- */
315
- encrypt(plaintext: Uint8Array, nonce: Uint8Array): Uint8Array;
316
- /**
317
- * Decrypt the ciphertext array in Counter (CTR) mode.
318
- * @param ciphertext - Data to decrypt.
319
- * @param nonce - 8-byte nonce for CTR mode.
320
- * @returns Decrypted plaintext as a Uint8Array.
321
- * @throws Error if the nonce is not 8 bytes long.
322
- */
323
- decrypt(ciphertext: Uint8Array, nonce: Uint8Array): Uint8Array;
324
- }
325
-
326
- /**
327
- * AES-128 cipher in Counter (CTR) mode, using SHA3-256 to derive the key from a shared secret.
328
- * See: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38a.pdf (Section 6.5) for details on CTR mode.
329
- */
330
- declare class Aes128Cipher extends AesCtrCipher {
331
- /**
332
- * Construct an AES-128 cipher instance using a shared secret.
333
- * The key is derived using SHA3-256.
334
- * @param sharedSecret - Shared secret to derive the AES key from.
335
- */
336
- constructor(sharedSecret: Uint8Array);
337
- }
338
-
339
- /**
340
- * AES-192 cipher in Counter (CTR) mode, using SHA3-256 to derive the key from a shared secret.
341
- * See: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38a.pdf (Section 6.5) for details on CTR mode.
342
- */
343
- declare class Aes192Cipher extends AesCtrCipher {
344
- /**
345
- * Construct an AES-192 cipher instance using a shared secret.
346
- * The key is derived using SHA3-256.
347
- * @param sharedSecret - Shared secret to derive the AES key from.
348
- */
349
- constructor(sharedSecret: Uint8Array);
350
- }
351
-
352
- /**
353
- * AES-256 cipher in Counter (CTR) mode, using SHA3-256 to derive the key from a shared secret.
354
- * See: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38a.pdf (Section 6.5) for details on CTR mode.
355
- */
356
- declare class Aes256Cipher extends AesCtrCipher {
357
- /**
358
- * Construct an AES-256 cipher instance using a shared secret.
359
- * The key is derived using SHA3-256.
360
- * @param sharedSecret - Shared secret to derive the AES key from.
361
- */
362
- constructor(sharedSecret: Uint8Array);
363
- }
364
-
365
- /**
366
- * Size descriptor for a single field in circuit packing.
367
- * A "full" field occupies an entire slot; partial fields are bin-packed together.
368
- * @internal
369
- */
370
- declare class DataSize {
371
- /** Whether this field occupies a full slot. */
372
- isFull: boolean;
373
- /** Bit width of the field (0 if full). */
374
- size: number;
375
- /** Original index in the fields array. */
376
- index: number;
377
- constructor(index: number, size?: number);
378
- }
379
-
380
- /**
381
- * Field definition for circuit input/output packing.
382
- * Pass an array of these to {@link createPacker} to create a type-safe packer.
383
- *
384
- * @example
385
- * import { FieldInfo } from '@arcium-hq/client';
386
- *
387
- * const fields: FieldInfo[] = [
388
- * { name: 'amount', type: { Integer: { signed: false, width: 64 } } },
389
- * { name: 'active', type: 'Bool' },
390
- * ];
391
- */
392
- interface FieldInfo {
393
- /** Field name matching the circuit parameter. For array types, use indexed notation (`bytes[0]`, `bytes[1]`) - the packer groups these back into arrays on unpack. */
394
- name: string;
395
- /** Field type: Integer with sign/width, Bool, FullInteger (256-bit), Float, or Pubkey. */
396
- type: {
397
- Integer: {
398
- signed: boolean;
399
- width: number;
400
- };
401
- } | 'Bool' | 'FullInteger' | 'Float' | 'Pubkey';
402
- }
403
- declare enum ArcisValueKind {
404
- Integer = 0,
405
- FullInteger = 1,
406
- Bool = 2,
407
- Float = 3,
408
- Pubkey = 4
409
- }
410
- /**
411
- * Integer type metadata. Used internally by packer.
412
- * @internal
413
- */
414
- declare class IntegerInfo {
415
- signed: boolean;
416
- width: bigint;
417
- constructor(signed: boolean, width: bigint);
418
- static fromJson(json: {
419
- "signed": boolean;
420
- "width": number;
421
- }): IntegerInfo;
422
- minValue(): bigint;
423
- isWithinBounds(b: bigint): boolean;
424
- name(): string;
425
- }
426
- /**
427
- * Runtime field representation. Used internally by packer.
428
- * @internal
429
- */
430
- declare class ArcisValueField {
431
- name: string;
432
- kind: ArcisValueKind;
433
- info: IntegerInfo | undefined;
434
- constructor(name: string, kind: ArcisValueKind, info?: IntegerInfo);
435
- static fromJson(json: unknown): ArcisValueField;
436
- toBigInt(arg: unknown): bigint;
437
- fromBigInt(arg: bigint): boolean | number | bigint | Uint8Array;
438
- static fromFieldInfo(info: FieldInfo): ArcisValueField;
439
- toDataSize(index: number): DataSize;
440
- }
441
- /**
442
- * Type container for pack/unpack operations. Used internally by packer.
443
- * @internal
444
- */
445
- declare class ArcisType {
446
- name: string;
447
- fields: ArcisValueField[];
448
- constructor(name: string, fields: ArcisValueField[]);
449
- pack(rawData: unknown[]): bigint[];
450
- unpack(packed: bigint[]): (boolean | number | bigint | Uint8Array)[];
451
- static fromJson(name: string, json: unknown): ArcisType;
452
- }
453
-
454
- /**
455
- * Container for circuit type definitions.
456
- * Loaded from generated JSON files by build tools -- not typically used directly.
457
- * @internal
458
- */
459
- declare class ArcisModule {
460
- /** Map of type name to parsed ArcisType. */
461
- types: {
462
- [typeName: string]: ArcisType;
463
- };
464
- constructor(types: {
465
- [typeName: string]: ArcisType;
466
- });
467
- /**
468
- * Parse module from JSON object (as produced by the Arcium compiler).
469
- * @param json - Raw JSON object with type name keys.
470
- */
471
- static fromJson(json: unknown): ArcisModule;
472
- /**
473
- * Load module from a JSON file on disk.
474
- * @param path - Absolute or relative path to the JSON file.
475
- */
476
- static loadFromFile(path: string): ArcisModule;
477
- }
478
-
479
- /**
480
- * Type-safe packer for converting between TypeScript objects and circuit-compatible bigint arrays.
481
- *
482
- * @template TInput - Input object type with field names as keys
483
- * @template TOutput - Output object type (typically same structure as input)
484
- */
485
- interface Packer<TInput, TOutput> {
486
- /**
487
- * Pack input values into bigint array for circuit execution.
488
- * @param data - Object with field values matching the packer's field definitions.
489
- * @returns Packed bigint array ready for encryption.
490
- * @throws Error if a required field is missing.
491
- */
492
- pack(data: TInput): bigint[];
493
- /**
494
- * Unpack circuit output back to typed object.
495
- * @param packed - Bigint array from decrypted circuit output.
496
- * @returns Typed object with field values.
497
- */
498
- unpack(packed: bigint[]): TOutput;
499
- }
500
- /** Extracts base field name from array-indexed names: "bytes[0]" -> "bytes" */
501
- type ExtractBaseName<T extends string> = T extends `${infer Base}[${string}]` ? Base : T;
502
- /** Extracts all base field names from a readonly FieldInfo array. */
503
- type FieldBaseNames<T extends readonly FieldInfo[]> = ExtractBaseName<T[number]['name']>;
504
- /**
505
- * Validates that field base names match TInput keys. Returns `never` on mismatch.
506
- * Only validates when using `as const`; skipped if types widen to `string`.
507
- */
508
- type ValidateFieldNames<TInput, TFields extends readonly FieldInfo[]> = string extends FieldBaseNames<TFields> ? TFields : FieldBaseNames<TFields> extends keyof TInput ? TFields : never;
509
- /**
510
- * Create a type-safe packer from field definitions.
511
- *
512
- * Use `as const` on the fields array to enable compile-time field name validation.
513
- *
514
- * @param fields - Array of {@link FieldInfo} objects defining each field's name and type.
515
- * @param typeName - Optional name for debugging (default: 'Packer').
516
- * @returns Packer instance with pack() and unpack() methods.
517
- * @throws TypeError if field types don't match expected values during pack/unpack.
518
- * @throws RangeError if array index is out of bounds.
519
- *
520
- * @example
521
- * import { createPacker } from '@arcium-hq/client';
522
- *
523
- * // Define fields matching your circuit's input type
524
- * const fields = [
525
- * { name: 'a', type: { Integer: { signed: false, width: 32 } } },
526
- * { name: 'b', type: { Integer: { signed: false, width: 32 } } },
527
- * ] as const;
528
- *
529
- * // Create packer with explicit input/output types
530
- * const packer = createPacker<{ a: number; b: number }, { a: bigint; b: bigint }>(fields);
531
- *
532
- * // Pack values for circuit input
533
- * const packed = packer.pack({ a: 10, b: 20 });
534
- *
535
- * // Unpack circuit output (from decrypted computation result)
536
- * const result = packer.unpack(decryptedOutput);
537
- */
538
- declare function createPacker<TInput extends Record<string, unknown>, TOutput extends Record<string, unknown>, const TFields extends readonly FieldInfo[] = readonly FieldInfo[]>(fields: TFields & ValidateFieldNames<TInput, TFields>, typeName?: string): Packer<TInput, TOutput>;
539
-
540
1
  /**
541
2
  * Program IDL in camelCase format in order to be used in JS/TS.
542
3
  *
543
4
  * Note that this is only a type helper and is not the actual IDL. The original
544
5
  * IDL can be found at `target/idl/arcium.json`.
545
6
  */
546
- type Arcium = {
7
+ export type Arcium = {
547
8
  "address": "Arcj82pX7HxYKLR92qvgZUAd7vGS1k4hQvAFcPATFdEQ";
548
9
  "metadata": {
549
10
  "name": "arcium";
550
- "version": "0.9.2";
11
+ "version": "0.9.3";
551
12
  "spec": "0.1.0";
552
13
  "description": "The Arcium program";
553
14
  };
@@ -10866,7 +10327,7 @@ type Arcium = {
10866
10327
  "name": "acccountAccessInfo";
10867
10328
  };
10868
10329
  },
10869
- 13
10330
+ 15
10870
10331
  ];
10871
10332
  };
10872
10333
  },
@@ -10875,7 +10336,7 @@ type Arcium = {
10875
10336
  "type": {
10876
10337
  "array": [
10877
10338
  "u8",
10878
- 6
10339
+ 2
10879
10340
  ];
10880
10341
  };
10881
10342
  }
@@ -12824,361 +12285,4 @@ type Arcium = {
12824
12285
  }
12825
12286
  ];
12826
12287
  };
12827
-
12828
- declare const ARCIUM_IDL: Arcium;
12829
- /**
12830
- * The deployed address of the Arcium program, as specified in the IDL.
12831
- */
12832
- declare const ARCIUM_ADDR: "Arcj82pX7HxYKLR92qvgZUAd7vGS1k4hQvAFcPATFdEQ";
12833
-
12834
- /**
12835
- * Reference to a computation in a mempool or executing pool.
12836
- * Contains the computation offset and priority fee information.
12837
- */
12838
- type ComputationReference = anchor.IdlTypes<Arcium>['computationReference'];
12839
- /**
12840
- * Check if a computation reference is null (all zeros).
12841
- * @param ref - Computation reference to check.
12842
- * @returns true if the reference is null, false otherwise.
12843
- */
12844
- declare function isNullRef(ref: ComputationReference): boolean;
12845
-
12846
- /**
12847
- * Represents a mempool account of any size (tiny, small, medium, or large).
12848
- * Mempools store pending computations prioritized by fee, with a time-to-live of 180 slots.
12849
- * Each size supports different maximum heap capacities:
12850
- * - Tiny: 1 computation
12851
- * - Small: 3 computations
12852
- * - Medium: 10 computations
12853
- * - Large: 100 computations
12854
- */
12855
- type MempoolAccount = anchor.IdlTypes<Arcium>['tinyMempool'] | anchor.IdlTypes<Arcium>['smallMempool'] | anchor.IdlTypes<Arcium>['mediumMempool'] | anchor.IdlTypes<Arcium>['largeMempool'];
12856
- /**
12857
- * Represents an executing pool account of any size (tiny, small, medium, or large).
12858
- * Executing pools manage parallel computation execution with account locking.
12859
- * Each size supports different maximum parallel computations:
12860
- * - Tiny: 1 parallel computation
12861
- * - Small: 3 parallel computations
12862
- * - Medium: 10 parallel computations
12863
- * - Large: 100 parallel computations
12864
- */
12865
- type ExecutingPoolAccount = anchor.IdlTypes<Arcium>['tinyExecPool'] | anchor.IdlTypes<Arcium>['smallExecPool'] | anchor.IdlTypes<Arcium>['mediumExecPool'] | anchor.IdlTypes<Arcium>['largeExecPool'];
12866
- /**
12867
- * IDL-generated type for circuit source location.
12868
- * Discriminated union with variants: local, onChain, offChain.
12869
- */
12870
- type CircuitSource = anchor.IdlTypes<Arcium>['circuitSource'];
12871
- /**
12872
- * Fetch and decode the mempool account info for any mempool account size.
12873
- * @param provider - Anchor provider to use for fetching accounts.
12874
- * @param mempoolAccPubkey - Public key of the mempool account.
12875
- * @returns Decoded mempool account info.
12876
- * @throws Error if the account cannot be fetched or the discriminator is unknown.
12877
- */
12878
- declare function getMempoolAccInfo(provider: AnchorProvider, mempoolAccPubkey: anchor.web3.PublicKey): Promise<MempoolAccount>;
12879
- /**
12880
- * Fetch and decode the executing pool account info for any pool size.
12881
- * @param provider - Anchor provider to use for fetching accounts.
12882
- * @param executingPoolAccPubkey - Public key of the executing pool account.
12883
- * @returns Decoded executing pool account info.
12884
- * @throws Error if the account cannot be fetched or the discriminator is unknown.
12885
- */
12886
- declare function getExecutingPoolAccInfo(provider: AnchorProvider, executingPoolAccPubkey: anchor.web3.PublicKey): Promise<ExecutingPoolAccount>;
12887
- /**
12888
- * Return all computation references in the mempool for a given account.
12889
- * Only non-stake computations are included.
12890
- * @param arciumProgram - Anchor program instance.
12891
- * @param address - Public key of the mempool account.
12892
- * @returns Array of ComputationReference objects.
12893
- */
12894
- declare function getComputationsInMempool(arciumProgram: anchor.Program<Arcium>, address: PublicKey): Promise<ComputationReference[]>;
12895
- /**
12896
- * Statistics about priority fees for computations in a mempool.
12897
- * @property mean - Average priority fee across all computations.
12898
- * @property median - Middle value of priority fees when sorted.
12899
- * @property min - Lowest priority fee in the mempool.
12900
- * @property max - Highest priority fee in the mempool.
12901
- * @property count - Total number of computations in the mempool.
12902
- */
12903
- interface MempoolPriorityFeeStats {
12904
- mean: anchor.BN;
12905
- median: anchor.BN;
12906
- min: anchor.BN;
12907
- max: anchor.BN;
12908
- count: number;
12909
- }
12910
- /**
12911
- * Calculate priority fee statistics for computations in a mempool.
12912
- * @param arciumProgram - Anchor program instance.
12913
- * @param mempoolAddress - Public key of the mempool account.
12914
- * @returns Priority fee statistics (mean, median, min, max, count).
12915
- */
12916
- declare function getMempoolPriorityFeeStats(arciumProgram: anchor.Program<Arcium>, mempoolAddress: PublicKey): Promise<MempoolPriorityFeeStats>;
12917
- /**
12918
- * Fetch and extract the MXE X25519 public key from the MXE account.
12919
- * @param provider - Anchor provider to use for fetching accounts.
12920
- * @param mxeProgramId - Public key of the MXE program.
12921
- * @returns MXE's X25519 public key as a Uint8Array, or null if not set.
12922
- */
12923
- declare function getMXEPublicKey(provider: AnchorProvider, mxeProgramId: anchor.web3.PublicKey): Promise<Uint8Array | null>;
12924
- /**
12925
- * Fetch and extract the MXE arcis Ed25519 verifying key from the MXE account.
12926
- * @param provider - Anchor provider to use for fetching accounts.
12927
- * @param mxeProgramId - Public key of the MXE program.
12928
- * @returns MXE's arcis Ed25519 verifying key as a Uint8Array, or null if not set.
12929
- */
12930
- declare function getMXEArcisEd25519VerifyingKey(provider: AnchorProvider, mxeProgramId: anchor.web3.PublicKey): Promise<Uint8Array | null>;
12931
- /**
12932
- * Represents the current state of a circuit's on-chain presence.
12933
- * @internal Used by `uploadCircuit` - most users don't need this directly.
12934
- */
12935
- type CircuitState = 'OnchainPending' | 'OnchainFinalized' | 'Offchain';
12936
- /**
12937
- * Determine the current state of a circuit based on its on-chain configuration.
12938
- * @internal Called internally by `uploadCircuit` - most users don't need this directly.
12939
- * @param circuitSource - circuitSource field from ComputationDefinitionAccount.
12940
- * @returns Current state of the circuit.
12941
- */
12942
- declare function getCircuitState(circuitSource: CircuitSource): CircuitState;
12943
- /**
12944
- * Upload a circuit to the blockchain, splitting it into multiple accounts if necessary.
12945
- * @param provider - Anchor provider to use for transactions.
12946
- * @param circuitName - Name of the circuit.
12947
- * @param mxeProgramId - Public key of the MXE program.
12948
- * @param rawCircuit - Raw circuit data as a Uint8Array.
12949
- * @param logging - Whether to log progress (default: true).
12950
- * @param chunkSize - Number of upload transactions to send in parallel (default: 500).
12951
- * @param confirmOptions - Transaction confirmation options.
12952
- * @returns Array of transaction signatures for all upload and finalize transactions.
12953
- */
12954
- declare function uploadCircuit(provider: AnchorProvider, circuitName: string, mxeProgramId: anchor.web3.PublicKey, rawCircuit: Uint8Array, logging?: boolean, chunkSize?: number, confirmOptions?: ConfirmOptions): Promise<string[]>;
12955
- /**
12956
- * Queue a key recovery initialization for an MXE on a given cluster.
12957
- * @param provider - Anchor provider for signing and sending.
12958
- * @param clusterOffset - Cluster offset to recover keys from.
12959
- * @param mxeProgramId - Public key of the MXE program.
12960
- * @param confirmOptions - Transaction confirmation options.
12961
- * @returns Array of transaction signatures.
12962
- */
12963
- declare function queueKeyRecoveryInit(provider: AnchorProvider, clusterOffset: number, mxeProgramId: anchor.web3.PublicKey, confirmOptions?: ConfirmOptions): Promise<string[]>;
12964
- /**
12965
- * Build a transaction to finalize a computation definition.
12966
- * @param provider - Anchor provider to use for transactions.
12967
- * @param compDefOffset - Offset of the computation definition.
12968
- * @param mxeProgramId - Public key of the MXE program.
12969
- * @returns Transaction to finalize the computation definition.
12970
- */
12971
- declare function buildFinalizeCompDefTx(provider: AnchorProvider, compDefOffset: number, mxeProgramId: anchor.web3.PublicKey): Promise<anchor.web3.Transaction>;
12972
- /**
12973
- * Return the base seed for an Arcium account, given its name.
12974
- * @param accName - Name of the account.
12975
- * @returns Base seed as a Uint8Array.
12976
- */
12977
- declare function getArciumAccountBaseSeed(accName: string): Uint8Array;
12978
- /**
12979
- * Compute the offset for a computation definition account, based on the circuit name.
12980
- * @param circuitName - Name of the circuit.
12981
- * @returns Offset as a 4-byte Uint8Array.
12982
- */
12983
- declare function getCompDefAccOffset(circuitName: string): Uint8Array;
12984
- /**
12985
- * Return an Anchor program instance for the Arcium program.
12986
- * @param provider - Anchor provider to use.
12987
- * @returns Anchor program instance for Arcium.
12988
- */
12989
- declare function getArciumProgram(provider: AnchorProvider): Program<Arcium>;
12990
- /**
12991
- * Set an MXE to Recovery status, initiating the key recovery process.
12992
- * @param provider - Anchor provider to use for transactions.
12993
- * @param mxeProgramId - Public key of the MXE program to recover.
12994
- * @param confirmOptions - Transaction confirmation options.
12995
- * @returns Transaction signature.
12996
- */
12997
- declare function recoverMxe(provider: AnchorProvider, mxeProgramId: anchor.web3.PublicKey, confirmOptions?: ConfirmOptions): Promise<string>;
12998
- /**
12999
- * Initialize key recovery execution by creating the MxeRecoveryAccount and
13000
- * registering the key_recovery_final computation definition on the backup MXE.
13001
- * This is split into two parts due to Solana's 10KB per-instruction allocation limit.
13002
- * @param provider - Anchor provider to use for transactions.
13003
- * @param originalMxeProgramId - Public key of the original MXE program being recovered.
13004
- * @param backupMxeProgramId - Public key of the backup MXE program that will take over.
13005
- * @param confirmOptions - Transaction confirmation options.
13006
- * @returns Transaction signature from part2.
13007
- */
13008
- declare function initKeyRecoveryExecution(provider: AnchorProvider, originalMxeProgramId: anchor.web3.PublicKey, backupMxeProgramId: anchor.web3.PublicKey, confirmOptions?: ConfirmOptions): Promise<string>;
13009
- /**
13010
- * Submit a re-encrypted key recovery share from a recovery peer.
13011
- * Recovery peers must decrypt shares using their x25519 private key and re-encrypt
13012
- * them for the backup MXE before submission.
13013
- * @param provider - Anchor provider to use for transactions.
13014
- * @param originalMxeProgramId - Public key of the original MXE program being recovered.
13015
- * @param backupMxeProgramId - Public key of the backup MXE program.
13016
- * @param peerOffset - Offset of the recovery peer.
13017
- * @param peerIndex - Index of this peer in the recovery peers list.
13018
- * @param share - Re-encrypted share: 5 field elements of 32 bytes each (160 bytes total).
13019
- * @param confirmOptions - Transaction confirmation options.
13020
- * @returns Transaction signature.
13021
- */
13022
- declare function submitKeyRecoveryShare(provider: AnchorProvider, originalMxeProgramId: anchor.web3.PublicKey, backupMxeProgramId: anchor.web3.PublicKey, peerOffset: number, peerIndex: number, share: number[][] | Uint8Array[], confirmOptions?: ConfirmOptions): Promise<string>;
13023
- /**
13024
- * Finalize key recovery execution after the submission threshold is met.
13025
- * This queues the key_recovery_finalize MPC computation on the backup cluster.
13026
- * @param provider - Anchor provider to use for transactions.
13027
- * @param originalMxeProgramId - Public key of the original MXE program being recovered.
13028
- * @param backupMxeProgramId - Public key of the backup MXE program.
13029
- * @param clusterOffset - Cluster offset where the backup MXE is deployed.
13030
- * @param keyRecoveryFinalizeOffset - Computation offset for the key_recovery_finalize computation.
13031
- * @param confirmOptions - Transaction confirmation options.
13032
- * @returns Transaction signature.
13033
- */
13034
- declare function finalizeKeyRecoveryExecution(provider: AnchorProvider, originalMxeProgramId: anchor.web3.PublicKey, backupMxeProgramId: anchor.web3.PublicKey, clusterOffset: number, keyRecoveryFinalizeOffset: anchor.BN, confirmOptions?: ConfirmOptions): Promise<string>;
13035
- /**
13036
- * Initialize an MXE (part 1). Due to Solana's 10KB per-instruction allocation limit,
13037
- * this only partially allocates recovery_cluster_acc.
13038
- * Call initMxePart2 afterwards to finish allocation and add keygen to mempool.
13039
- * @param provider - Anchor provider to use for transactions.
13040
- * @param mxeProgramId - Public key to use as the MXE program ID.
13041
- * @param confirmOptions - Transaction confirmation options.
13042
- * @returns Transaction signature.
13043
- */
13044
- declare function initMxePart1(provider: AnchorProvider, mxeProgramId: anchor.web3.PublicKey, confirmOptions?: ConfirmOptions): Promise<string>;
13045
- /**
13046
- * Finish MXE initialization (part 2).
13047
- * Reallocate recovery_cluster_acc to full size, initialize recovery_peers,
13048
- * and add the keygen computation to the mempool.
13049
- * @param provider - Anchor provider to use for transactions.
13050
- * @param clusterOffset - Cluster offset to associate with the MXE.
13051
- * @param mxeProgramId - Public key to use as the MXE program ID.
13052
- * @param recoveryPeers - Array of 100 node offsets for recovery peers (0 for unused slots).
13053
- * @param keygenOffset - Computation offset for the keygen computation.
13054
- * @param keyRecoveryInitOffset - Computation offset for the key_recovery_init computation.
13055
- * @param lutOffset - Lookup table offset for the MXE's address lookup table.
13056
- * @param mxeAuthority - Optional authority for the MXE (defaults to provider.publicKey).
13057
- * @param confirmOptions - Transaction confirmation options.
13058
- * @returns Transaction signature.
13059
- */
13060
- declare function initMxePart2(provider: AnchorProvider, clusterOffset: number, mxeProgramId: anchor.web3.PublicKey, recoveryPeers: number[], keygenOffset: anchor.BN, keyRecoveryInitOffset: anchor.BN, lutOffset: anchor.BN, mxeAuthority?: anchor.web3.PublicKey, confirmOptions?: ConfirmOptions): Promise<string>;
13061
-
13062
- /**
13063
- * Structure representing the local Arcium environment variables required for local development or testing.
13064
- */
13065
- type ArciumLocalEnv = {
13066
- arciumClusterOffset: number;
13067
- arciumBackupClusterOffset: number;
13068
- };
13069
- /**
13070
- * Read local Arcium environment information from environment variables.
13071
- * Only available in Node.js and when testing locally.
13072
- * @returns Local Arcium environment configuration.
13073
- * @throws Error if called in a browser or if required environment variables are missing or invalid.
13074
- */
13075
- declare function getArciumEnv(): ArciumLocalEnv;
13076
-
13077
- /**
13078
- * Wait for a computation to finalize by polling the computation account
13079
- * status via HTTP RPC. Does not use WebSocket subscriptions.
13080
- *
13081
- * Polls every 500ms (same as Agave's send_and_confirm_transaction_with_config).
13082
- * Return the most recent transaction signature on the computation account
13083
- * once finalization is detected.
13084
- *
13085
- * @param provider - Anchor provider.
13086
- * @param computationOffset - Computation offset to wait for.
13087
- * @param mxeProgramId - MXE program public key.
13088
- * @param commitment - Commitment level for RPC calls (default: 'confirmed').
13089
- * @param timeoutMs - Maximum wait time in milliseconds (default: 120000).
13090
- * @returns Transaction signature from the finalization.
13091
- * @throws Error if the MXE account has no cluster assigned.
13092
- * @throws Error if the computation does not finalize within timeoutMs.
13093
- */
13094
- declare function awaitComputationFinalization(provider: AnchorProvider, computationOffset: BN, mxeProgramId: PublicKey, commitment?: Finality, timeoutMs?: number): Promise<string>;
13095
-
13096
- /**
13097
- * Return the public key of the deployed Arcium program on Solana.
13098
- * @returns Arcium program's public key.
13099
- */
13100
- declare function getArciumProgramId(): PublicKey;
13101
- /**
13102
- * Derive the computation account address for a given cluster and computation offset.
13103
- * @param clusterOffset - Offset of the cluster this computation will be executed by.
13104
- * @param computationOffset - Computation offset as an anchor.BN.
13105
- * @returns Derived computation account public key.
13106
- */
13107
- declare function getComputationAccAddress(clusterOffset: number, computationOffset: anchor.BN): PublicKey;
13108
- /**
13109
- * Derive the mempool account address for a given cluster.
13110
- * @param clusterOffset - Offset of the cluster.
13111
- * @returns Derived mempool account public key.
13112
- */
13113
- declare function getMempoolAccAddress(clusterOffset: number): PublicKey;
13114
- /**
13115
- * Derive the executing pool account address for a given cluster.
13116
- * @param clusterOffset - Offset of the cluster.
13117
- * @returns Derived executing pool account public key.
13118
- */
13119
- declare function getExecutingPoolAccAddress(clusterOffset: number): PublicKey;
13120
- /**
13121
- * Derive the fee pool account address.
13122
- * @returns Derived fee pool account public key.
13123
- */
13124
- declare function getFeePoolAccAddress(): PublicKey;
13125
- /**
13126
- * Derive the clock account address.
13127
- * @returns Derived clock account public key.
13128
- */
13129
- declare function getClockAccAddress(): PublicKey;
13130
- /**
13131
- * Derive the cluster account address for a given offset.
13132
- * @param clusterOffset - Cluster offset as a number.
13133
- * @returns Derived cluster account public key.
13134
- */
13135
- declare function getClusterAccAddress(clusterOffset: number): PublicKey;
13136
- /**
13137
- * Derive the ArxNode account address for a given offset.
13138
- * @param nodeOffset - ArxNode offset as a number.
13139
- * @returns Derived ArxNode account public key.
13140
- */
13141
- declare function getArxNodeAccAddress(nodeOffset: number): PublicKey;
13142
- /**
13143
- * Derive the MXE account address for a given MXE program ID.
13144
- * @param mxeProgramId - Public key of the MXE program.
13145
- * @returns Derived MXE account public key.
13146
- */
13147
- declare function getMXEAccAddress(mxeProgramId: PublicKey): PublicKey;
13148
- /**
13149
- * Derive the computation definition account address for a given MXE program ID and offset.
13150
- * @param mxeProgramId - Public key of the MXE program.
13151
- * @param compDefOffset - Computation definition offset as a number.
13152
- * @returns Derived computation definition account public key.
13153
- */
13154
- declare function getCompDefAccAddress(mxeProgramId: PublicKey, compDefOffset: number): PublicKey;
13155
- /**
13156
- * Derive the recovery cluster account address for a given MXE program ID.
13157
- * @param mxeProgramId - Public key of the MXE program.
13158
- * @returns Derived recovery cluster account public key.
13159
- */
13160
- declare function getRecoveryClusterAccAddress(mxeProgramId: PublicKey): PublicKey;
13161
- /**
13162
- * Derive the MXE recovery account address for a key recovery session.
13163
- * @param backupMxeProgramId - Public key of the backup MXE program that will take over.
13164
- * @param originalMxeProgramId - Public key of the original MXE program being recovered.
13165
- * @returns Derived MXE recovery account public key.
13166
- */
13167
- declare function getMxeRecoveryAccAddress(backupMxeProgramId: PublicKey, originalMxeProgramId: PublicKey): PublicKey;
13168
- /**
13169
- * Derive the raw circuit account address for a given computation definition and index.
13170
- * @param compDefPubkey - Public key of the computation definition account.
13171
- * @param rawCircuitIndex - Index of the raw circuit account (0-based).
13172
- * @returns Derived raw circuit account public key.
13173
- */
13174
- declare function getRawCircuitAccAddress(compDefPubkey: PublicKey, rawCircuitIndex: number): PublicKey;
13175
- /**
13176
- * Derive the address lookup table address for an MXE program.
13177
- * @param mxeProgramId - Public key of the MXE program.
13178
- * @param lutOffset - Index of the lookup table, to be fetched from the mxe account.
13179
- * @returns Derived address lookup table public key.
13180
- */
13181
- declare function getLookupTableAddress(mxeProgramId: PublicKey, lutOffset: anchor.BN): PublicKey;
13182
-
13183
- export { ARCIUM_ADDR, ARCIUM_IDL, Aes128Cipher, Aes192Cipher, Aes256Cipher, ArcisModule, ArcisType, ArcisValueField, CSplRescueCipher, CURVE25519_BASE_FIELD, CURVE25519_SCALAR_FIELD, CURVE25519_SCALAR_FIELD_MODULUS, IntegerInfo, Matrix, RescueCipher, RescueDesc, RescuePrimeHash, arcisEd25519, awaitComputationFinalization, buildFinalizeCompDefTx, createPacker, deserializeLE, finalizeKeyRecoveryExecution, generateRandomFieldElem, getArciumAccountBaseSeed, getArciumEnv, getArciumProgram, getArciumProgramId, getArxNodeAccAddress, getCircuitState, getClockAccAddress, getClusterAccAddress, getCompDefAccAddress, getCompDefAccOffset, getComputationAccAddress, getComputationsInMempool, getExecutingPoolAccAddress, getExecutingPoolAccInfo, getFeePoolAccAddress, getLookupTableAddress, getMXEAccAddress, getMXEArcisEd25519VerifyingKey, getMXEPublicKey, getMempoolAccAddress, getMempoolAccInfo, getMempoolPriorityFeeStats, getMxeRecoveryAccAddress, getRawCircuitAccAddress, getRecoveryClusterAccAddress, initKeyRecoveryExecution, initMxePart1, initMxePart2, isNullRef, positiveModulo, queueKeyRecoveryInit, randMatrix, recoverMxe, serializeLE, sha256, submitKeyRecoveryShare, toVec, uploadCircuit };
13184
- export type { Arcium as ArciumIdlType, ArciumLocalEnv, CircuitSource, CircuitState, ComputationReference, ExecutingPoolAccount, FieldInfo, FpField, MempoolAccount, MempoolPriorityFeeStats, Packer };
12288
+ //# sourceMappingURL=arcium.d.ts.map