@arcium-hq/client 0.8.3 → 0.8.5

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/build/index.d.ts CHANGED
@@ -456,7 +456,7 @@ type Arcium = {
456
456
  "address": "Arcj82pX7HxYKLR92qvgZUAd7vGS1k4hQvAFcPATFdEQ";
457
457
  "metadata": {
458
458
  "name": "arcium";
459
- "version": "0.8.3";
459
+ "version": "0.8.5";
460
460
  "spec": "0.1.0";
461
461
  "description": "The Arcium program";
462
462
  };
@@ -5113,6 +5113,85 @@ type Arcium = {
5113
5113
  }
5114
5114
  ];
5115
5115
  },
5116
+ {
5117
+ "name": "initRecoveryPeerAccount";
5118
+ "discriminator": [
5119
+ 116,
5120
+ 29,
5121
+ 20,
5122
+ 126,
5123
+ 177,
5124
+ 149,
5125
+ 50,
5126
+ 147
5127
+ ];
5128
+ "accounts": [
5129
+ {
5130
+ "name": "signer";
5131
+ "writable": true;
5132
+ "signer": true;
5133
+ },
5134
+ {
5135
+ "name": "recoveryPeerAccount";
5136
+ "writable": true;
5137
+ "pda": {
5138
+ "seeds": [
5139
+ {
5140
+ "kind": "const";
5141
+ "value": [
5142
+ 82,
5143
+ 101,
5144
+ 99,
5145
+ 111,
5146
+ 118,
5147
+ 101,
5148
+ 114,
5149
+ 121,
5150
+ 80,
5151
+ 101,
5152
+ 101,
5153
+ 114,
5154
+ 65,
5155
+ 99,
5156
+ 99,
5157
+ 111,
5158
+ 117,
5159
+ 110,
5160
+ 116
5161
+ ];
5162
+ },
5163
+ {
5164
+ "kind": "arg";
5165
+ "path": "peerOffset";
5166
+ }
5167
+ ];
5168
+ };
5169
+ },
5170
+ {
5171
+ "name": "systemProgram";
5172
+ "address": "11111111111111111111111111111111";
5173
+ }
5174
+ ];
5175
+ "args": [
5176
+ {
5177
+ "name": "peerOffset";
5178
+ "type": "u32";
5179
+ },
5180
+ {
5181
+ "name": "authority";
5182
+ "type": "pubkey";
5183
+ },
5184
+ {
5185
+ "name": "x25519Pubkey";
5186
+ "type": {
5187
+ "array": [
5188
+ "u8",
5189
+ 32
5190
+ ];
5191
+ };
5192
+ }
5193
+ ];
5194
+ },
5116
5195
  {
5117
5196
  "name": "joinCluster";
5118
5197
  "discriminator": [
@@ -7485,29 +7564,41 @@ type Arcium = {
7485
7564
  ];
7486
7565
  "accounts": [
7487
7566
  {
7488
- "name": "nodeSigner";
7567
+ "name": "signer";
7489
7568
  "writable": true;
7490
7569
  "signer": true;
7491
7570
  },
7492
7571
  {
7493
- "name": "node";
7572
+ "name": "recoveryPeerAccount";
7494
7573
  "pda": {
7495
7574
  "seeds": [
7496
7575
  {
7497
7576
  "kind": "const";
7498
7577
  "value": [
7499
- 65,
7578
+ 82,
7579
+ 101,
7580
+ 99,
7581
+ 111,
7582
+ 118,
7583
+ 101,
7500
7584
  114,
7501
- 120,
7502
- 78,
7585
+ 121,
7586
+ 80,
7587
+ 101,
7588
+ 101,
7589
+ 114,
7590
+ 65,
7591
+ 99,
7592
+ 99,
7503
7593
  111,
7504
- 100,
7505
- 101
7594
+ 117,
7595
+ 110,
7596
+ 116
7506
7597
  ];
7507
7598
  },
7508
7599
  {
7509
7600
  "kind": "arg";
7510
- "path": "nodeOffset";
7601
+ "path": "peerOffset";
7511
7602
  }
7512
7603
  ];
7513
7604
  };
@@ -7632,7 +7723,7 @@ type Arcium = {
7632
7723
  "type": "pubkey";
7633
7724
  },
7634
7725
  {
7635
- "name": "nodeOffset";
7726
+ "name": "peerOffset";
7636
7727
  "type": "u32";
7637
7728
  },
7638
7729
  {
@@ -8156,6 +8247,19 @@ type Arcium = {
8156
8247
  183
8157
8248
  ];
8158
8249
  },
8250
+ {
8251
+ "name": "recoveryPeerAccount";
8252
+ "discriminator": [
8253
+ 126,
8254
+ 243,
8255
+ 17,
8256
+ 238,
8257
+ 223,
8258
+ 222,
8259
+ 130,
8260
+ 120
8261
+ ];
8262
+ },
8159
8263
  {
8160
8264
  "name": "smallExecPool";
8161
8265
  "discriminator": [
@@ -9127,7 +9231,7 @@ type Arcium = {
9127
9231
  {
9128
9232
  "name": "x25519Pubkey";
9129
9233
  "docs": [
9130
- "X25519 public key for usage when being a key recovery peer. MUST BE AT byte index 8 - 40"
9234
+ "X25519 public key. MUST BE AT byte index 8 - 40"
9131
9235
  ];
9132
9236
  "type": {
9133
9237
  "array": [
@@ -10734,7 +10838,7 @@ type Arcium = {
10734
10838
  {
10735
10839
  "name": "ip";
10736
10840
  "docs": [
10737
- "[Ipv4Addr], represented by it's 4 octects"
10841
+ "`Ipv4Addr`, represented by its 4 octets"
10738
10842
  ];
10739
10843
  "type": {
10740
10844
  "array": [
@@ -11149,6 +11253,38 @@ type Arcium = {
11149
11253
  ];
11150
11254
  };
11151
11255
  },
11256
+ {
11257
+ "name": "recoveryPeerAccount";
11258
+ "serialization": "bytemuck";
11259
+ "repr": {
11260
+ "kind": "c";
11261
+ };
11262
+ "type": {
11263
+ "kind": "struct";
11264
+ "fields": [
11265
+ {
11266
+ "name": "authority";
11267
+ "type": "pubkey";
11268
+ },
11269
+ {
11270
+ "name": "x25519Pubkey";
11271
+ "docs": [
11272
+ "DO NOT PUT ANYTHING ELSE BEFORE THE X25519_PUBKEY FIELD, IT'S EXPECTED TO BE AT OFFSET 40."
11273
+ ];
11274
+ "type": {
11275
+ "array": [
11276
+ "u8",
11277
+ 32
11278
+ ];
11279
+ };
11280
+ },
11281
+ {
11282
+ "name": "bump";
11283
+ "type": "u8";
11284
+ }
11285
+ ];
11286
+ };
11287
+ },
11152
11288
  {
11153
11289
  "name": "setUnset";
11154
11290
  "docs": [
@@ -11696,17 +11832,17 @@ interface MempoolPriorityFeeStats {
11696
11832
  */
11697
11833
  declare function getMempoolPriorityFeeStats(arciumProgram: anchor.Program<Arcium>, mempoolAddress: PublicKey): Promise<MempoolPriorityFeeStats>;
11698
11834
  /**
11699
- * Fetches and extracts the MXE x25519 public key from the MXE account.
11835
+ * Fetches and extracts the MXE X25519 public key from the MXE account.
11700
11836
  * @param provider - The Anchor provider to use for fetching accounts.
11701
11837
  * @param mxeProgramId - The public key of the MXE program.
11702
- * @returns The MXE's x25519 public key as a Uint8Array, or null if not set.
11838
+ * @returns The MXE's X25519 public key as a Uint8Array, or null if not set.
11703
11839
  */
11704
11840
  declare function getMXEPublicKey(provider: AnchorProvider, mxeProgramId: anchor.web3.PublicKey): Promise<Uint8Array | null>;
11705
11841
  /**
11706
- * Fetches and extracts the MXE arcis ed25519 verifying key from the MXE account.
11842
+ * Fetches and extracts the MXE arcis Ed25519 verifying key from the MXE account.
11707
11843
  * @param provider - The Anchor provider to use for fetching accounts.
11708
11844
  * @param mxeProgramId - The public key of the MXE program.
11709
- * @returns The MXE's arcis ed25519 verifying key as a Uint8Array, or null if not set.
11845
+ * @returns The MXE's arcis Ed25519 verifying key as a Uint8Array, or null if not set.
11710
11846
  */
11711
11847
  declare function getMXEArcisEd25519VerifyingKey(provider: AnchorProvider, mxeProgramId: anchor.web3.PublicKey): Promise<Uint8Array | null>;
11712
11848
  /**
@@ -11731,7 +11867,7 @@ declare function getCircuitState(circuitSource: CircuitSource): CircuitState;
11731
11867
  * @param chunkSize - The number of upload transactions to send in parallel (default: 500).
11732
11868
  * @returns An array of transaction signatures for all upload and finalize transactions.
11733
11869
  */
11734
- declare function uploadCircuit(provider: AnchorProvider, circuitName: string, mxeProgramId: anchor.web3.PublicKey, rawCircuit: Uint8Array, logging?: boolean, chunkSize?: number): Promise<string[]>;
11870
+ declare function uploadCircuit(provider: AnchorProvider, circuitName: string, mxeProgramId: anchor.web3.PublicKey, rawCircuit: Uint8Array, logging?: boolean, chunkSize?: number, confirmOptions?: ConfirmOptions): Promise<string[]>;
11735
11871
  declare function queueKeyRecoveryInit(provider: AnchorProvider, clusterOffset: number, mxeProgramId: anchor.web3.PublicKey, confirmOptions?: ConfirmOptions): Promise<string[]>;
11736
11872
  /**
11737
11873
  * Builds a transaction to finalize a computation definition.
@@ -11765,7 +11901,7 @@ declare function getArciumProgram(provider: AnchorProvider): Program<Arcium>;
11765
11901
  * @param mxeProgramId - The public key of the MXE program to recover.
11766
11902
  * @returns The transaction signature.
11767
11903
  */
11768
- declare function recoverMxe(provider: AnchorProvider, mxeProgramId: anchor.web3.PublicKey): Promise<string>;
11904
+ declare function recoverMxe(provider: AnchorProvider, mxeProgramId: anchor.web3.PublicKey, confirmOptions?: ConfirmOptions): Promise<string>;
11769
11905
  /**
11770
11906
  * Initializes key recovery execution by creating the MxeRecoveryAccount and
11771
11907
  * registering the key_recovery_final computation definition on the backup MXE.
@@ -11775,20 +11911,20 @@ declare function recoverMxe(provider: AnchorProvider, mxeProgramId: anchor.web3.
11775
11911
  * @param backupMxeProgramId - The public key of the backup MXE program that will take over.
11776
11912
  * @returns The transaction signature from part2.
11777
11913
  */
11778
- declare function initKeyRecoveryExecution(provider: AnchorProvider, originalMxeProgramId: anchor.web3.PublicKey, backupMxeProgramId: anchor.web3.PublicKey): Promise<string>;
11914
+ declare function initKeyRecoveryExecution(provider: AnchorProvider, originalMxeProgramId: anchor.web3.PublicKey, backupMxeProgramId: anchor.web3.PublicKey, confirmOptions?: ConfirmOptions): Promise<string>;
11779
11915
  /**
11780
11916
  * Submits a re-encrypted key recovery share from a recovery peer.
11781
- * Recovery peers must decrypt shares using their X25519 private key and re-encrypt
11917
+ * Recovery peers must decrypt shares using their x25519 private key and re-encrypt
11782
11918
  * them for the backup MXE before submission.
11783
11919
  * @param provider - The Anchor provider to use for transactions.
11784
11920
  * @param originalMxeProgramId - The public key of the original MXE program being recovered.
11785
11921
  * @param backupMxeProgramId - The public key of the backup MXE program.
11786
- * @param nodeOffset - The ARX node offset of the recovery peer.
11922
+ * @param peerOffset - The offset of the recovery peer.
11787
11923
  * @param peerIndex - The index of this peer in the recovery peers list.
11788
11924
  * @param share - The re-encrypted share: 5 field elements of 32 bytes each (160 bytes total).
11789
11925
  * @returns The transaction signature.
11790
11926
  */
11791
- declare function submitKeyRecoveryShare(provider: AnchorProvider, originalMxeProgramId: anchor.web3.PublicKey, backupMxeProgramId: anchor.web3.PublicKey, nodeOffset: number, peerIndex: number, share: number[][] | Uint8Array[]): Promise<string>;
11927
+ declare function submitKeyRecoveryShare(provider: AnchorProvider, originalMxeProgramId: anchor.web3.PublicKey, backupMxeProgramId: anchor.web3.PublicKey, peerOffset: number, peerIndex: number, share: number[][] | Uint8Array[], confirmOptions?: ConfirmOptions): Promise<string>;
11792
11928
  /**
11793
11929
  * Finalizes key recovery execution after the submission threshold is met.
11794
11930
  * This queues the key_recovery_finalize MPC computation on the backup cluster.
@@ -11799,7 +11935,7 @@ declare function submitKeyRecoveryShare(provider: AnchorProvider, originalMxePro
11799
11935
  * @param keyRecoveryFinalizeOffset - The computation offset for the key_recovery_finalize computation.
11800
11936
  * @returns The transaction signature.
11801
11937
  */
11802
- declare function finalizeKeyRecoveryExecution(provider: AnchorProvider, originalMxeProgramId: anchor.web3.PublicKey, backupMxeProgramId: anchor.web3.PublicKey, clusterOffset: number, keyRecoveryFinalizeOffset: anchor.BN): Promise<string>;
11938
+ declare function finalizeKeyRecoveryExecution(provider: AnchorProvider, originalMxeProgramId: anchor.web3.PublicKey, backupMxeProgramId: anchor.web3.PublicKey, clusterOffset: number, keyRecoveryFinalizeOffset: anchor.BN, confirmOptions?: ConfirmOptions): Promise<string>;
11803
11939
  /**
11804
11940
  * Initializes an MXE (part 1). Due to Solana's 10KB per-instruction allocation limit,
11805
11941
  * this only partially allocates recovery_cluster_acc.
@@ -11808,7 +11944,7 @@ declare function finalizeKeyRecoveryExecution(provider: AnchorProvider, original
11808
11944
  * @param mxeProgramId - The public key to use as the MXE program ID.
11809
11945
  * @returns The transaction signature.
11810
11946
  */
11811
- declare function initMxePart1(provider: AnchorProvider, mxeProgramId: anchor.web3.PublicKey): Promise<string>;
11947
+ declare function initMxePart1(provider: AnchorProvider, mxeProgramId: anchor.web3.PublicKey, confirmOptions?: ConfirmOptions): Promise<string>;
11812
11948
  /**
11813
11949
  * Finishes MXE initialization (part 2).
11814
11950
  * Reallocates recovery_cluster_acc to full size, initializes recovery_peers,
@@ -11822,7 +11958,7 @@ declare function initMxePart1(provider: AnchorProvider, mxeProgramId: anchor.web
11822
11958
  * @param mxeAuthority - Optional authority for the MXE (defaults to provider.publicKey).
11823
11959
  * @returns The transaction signature.
11824
11960
  */
11825
- 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): Promise<string>;
11961
+ 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>;
11826
11962
 
11827
11963
  /**
11828
11964
  * Structure representing the local Arcium environment variables required for local development or testing.
@@ -11839,19 +11975,23 @@ type ArciumLocalEnv = {
11839
11975
  declare function getArciumEnv(): ArciumLocalEnv;
11840
11976
 
11841
11977
  /**
11842
- * Represents possible error messages that can occur during computation processing or transaction handling.
11843
- */
11844
- type ComputationErrorType = `Transaction ${string} not found` | 'Transaction inner instructions not found' | `Transaction failed with error: ${string}` | 'No log messages found' | 'No queue computation instruction found' | `Invalid computation offset: ${string}` | 'Computation not found in executing pool, might have already executed' | `Error fetching transactions: ${string}` | `Instruction at index ${number} not found` | 'Account keys or program ID index not found' | `No Program ID found for instruction at index ${number}` | 'Max retries reached while searching for transaction';
11845
- /**
11846
- * Waits for the finalization of a computation by listening for the finalizeComputationEvent.
11847
- * Resolves with the transaction signature once the computation is finalized.
11848
- * @param provider - The Anchor provider to use for event listening.
11849
- * @param computationOffset - The offset of the computation to wait for.
11850
- * @param mxeProgramId - The public key of the MXE program.
11851
- * @param commitment - (Optional) The desired finality/commitment level (default: 'confirmed').
11852
- * @returns The transaction signature of the finalization event.
11978
+ * Waits for a computation to finalize by polling the computation account
11979
+ * status via HTTP RPC. Does not use WebSocket subscriptions.
11980
+ *
11981
+ * Polls every 500ms (same as Agave's send_and_confirm_transaction_with_config).
11982
+ * Returns the most recent transaction signature on the computation account
11983
+ * once finalization is detected.
11984
+ *
11985
+ * @param provider - The Anchor provider.
11986
+ * @param computationOffset - The computation offset to wait for.
11987
+ * @param mxeProgramId - The MXE program public key.
11988
+ * @param commitment - Commitment level for RPC calls (default: 'confirmed').
11989
+ * @param timeoutMs - Maximum wait time in milliseconds (default: 120000).
11990
+ * @returns The transaction signature from the finalization.
11991
+ * @throws Error if the MXE account has no cluster assigned.
11992
+ * @throws Error if the computation does not finalize within timeoutMs.
11853
11993
  */
11854
- declare function awaitComputationFinalization(provider: AnchorProvider, computationOffset: BN, mxeProgramId: PublicKey, commitment?: Finality): Promise<string>;
11994
+ declare function awaitComputationFinalization(provider: AnchorProvider, computationOffset: BN, mxeProgramId: PublicKey, commitment?: Finality, timeoutMs?: number): Promise<string>;
11855
11995
 
11856
11996
  /**
11857
11997
  * Returns the public key of the deployed Arcium program on Solana.
@@ -11941,4 +12081,4 @@ declare function getRawCircuitAccAddress(compDefPubkey: PublicKey, rawCircuitInd
11941
12081
  declare function getLookupTableAddress(mxeProgramId: PublicKey, lutOffset: anchor.BN): PublicKey;
11942
12082
 
11943
12083
  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 };
11944
- export type { Arcium as ArciumIdlType, ArciumLocalEnv, CircuitSource, CircuitState, ComputationErrorType, ComputationReference, ExecutingPoolAccount, FieldInfo, FpField, MempoolAccount, MempoolPriorityFeeStats, Packer };
12084
+ export type { Arcium as ArciumIdlType, ArciumLocalEnv, CircuitSource, CircuitState, ComputationReference, ExecutingPoolAccount, FieldInfo, FpField, MempoolAccount, MempoolPriorityFeeStats, Packer };