@provablehq/sdk 0.9.17 → 0.9.18

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.
@@ -0,0 +1,2 @@
1
+ interface KeyHolder {
2
+ }
@@ -3,7 +3,7 @@ import * as fs from 'node:fs/promises';
3
3
  import * as $fs from 'node:fs';
4
4
  import * as path from 'path';
5
5
  import { MemKeyVerifier, InvalidLocatorError } from './browser.js';
6
- export { Account, AleoKeyProvider, AleoKeyProviderParams, AleoNetworkClient, BlockHeightSearch, CREDITS_PROGRAM_KEYS, KeyVerificationError as ChecksumMismatchError, DecryptionNotEnabledError, KEY_STORE, KeyVerificationError, NetworkRecordProvider, OfflineKeyProvider, OfflineSearchParams, PRIVATE_TO_PUBLIC_TRANSFER, PRIVATE_TRANSFER, PRIVATE_TRANSFER_TYPES, PUBLIC_TO_PRIVATE_TRANSFER, PUBLIC_TRANSFER, PUBLIC_TRANSFER_AS_SIGNER, ProgramManager, RECORD_DOMAIN, RecordNotFoundError, RecordScanner, RecordScannerRequestError, SealanceMerkleTree, UUIDError, VALID_TRANSFER_TYPES, ViewKeyNotStoredError, encryptAuthorization, encryptProvingRequest, encryptRegistrationRequest, encryptViewKey, initializeWasm, isProveApiErrorBody, isProvingResponse, logAndThrow, sha256Hex } from './browser.js';
6
+ export { Account, AleoKeyProvider, AleoKeyProviderParams, AleoNetworkClient, BlockHeightSearch, CREDITS_PROGRAM_KEYS, KeyVerificationError as ChecksumMismatchError, DecryptionNotEnabledError, KEY_STORE, KeyVerificationError, NetworkRecordProvider, OfflineKeyProvider, OfflineSearchParams, PRIVATE_TO_PUBLIC_TRANSFER, PRIVATE_TRANSFER, PRIVATE_TRANSFER_TYPES, PUBLIC_TO_PRIVATE_TRANSFER, PUBLIC_TRANSFER, PUBLIC_TRANSFER_AS_SIGNER, ProgramManager, RECORD_DOMAIN, RecordNotFoundError, RecordScanner, RecordScannerRequestError, SealanceMerkleTree, UUIDError, VALID_TRANSFER_TYPES, ViewKeyNotStoredError, encryptAuthorization, encryptProvingRequest, encryptRegistrationRequest, encryptViewKey, initializeWasm, isProveApiErrorBody, isProvingResponse, logAndThrow, sha256Hex, zeroizeBytes } from './browser.js';
7
7
  import { ProvingKey, VerifyingKey } from '@provablehq/wasm/testnet.js';
8
8
  export { Address, Authorization, BHP1024, BHP256, BHP512, BHP768, Boolean, Ciphertext, ComputeKey, EncryptionToolkit, ExecutionRequest, ExecutionResponse, Field, Execution as FunctionExecution, GraphKey, Group, I128, I16, I32, I64, I8, OfflineQuery, Pedersen128, Pedersen64, Plaintext, Poseidon2, Poseidon4, Poseidon8, PrivateKey, PrivateKeyCiphertext, Program, ProgramManager as ProgramManagerBase, ProvingKey, ProvingRequest, RecordCiphertext, RecordPlaintext, Scalar, Signature, Transaction, Transition, U128, U16, U32, U64, U8, VerifyingKey, ViewKey, getOrInitConsensusVersionTestHeights, initThreadPool, verifyFunctionExecution } from '@provablehq/wasm/testnet.js';
9
9
  import 'core-js/proposals/json-parse-with-source.js';
@@ -1370,7 +1370,7 @@ declare class ProgramManager {
1370
1370
  * import { AleoKeyProvider, getOrInitConsensusVersionTestHeights, ProgramManager, NetworkRecordProvider } from "@provablehq/sdk/mainnet.js";
1371
1371
  *
1372
1372
  * // Initialize the development consensus heights in order to work with devnode.
1373
- * getOrInitConsensusVersionTestHeights("0,1,2,3,4,5,6,7,8,9,10,11");
1373
+ * getOrInitConsensusVersionTestHeights("0,1,2,3,4,5,6,7,8,9,10,11,12");
1374
1374
  *
1375
1375
  * // Create a new NetworkClient and RecordProvider.
1376
1376
  * const recordProvider = new NetworkRecordProvider(account, networkClient);
@@ -1411,7 +1411,7 @@ declare class ProgramManager {
1411
1411
  * import { ProgramManager, NetworkRecordProvider, getOrInitConsensusVersionTestHeights } from "@provablehq/sdk/mainnet.js";
1412
1412
  *
1413
1413
  * // Initialize the development consensus heights in order to work with a local devnode.
1414
- * getOrInitConsensusVersionTestHeights("0,1,2,3,4,5,6,7,8,9,10,11");
1414
+ * getOrInitConsensusVersionTestHeights("0,1,2,3,4,5,6,7,8,9,10,11,12");
1415
1415
  *
1416
1416
  * // Create a new NetworkClient, and RecordProvider
1417
1417
  * const recordProvider = new NetworkRecordProvider(account, networkClient);
@@ -36,3 +36,27 @@ export declare function encryptViewKey(publicKey: string, viewKey: ViewKey): str
36
36
  * @returns {string} the encrypted view key in RFC 4648 standard Base64.
37
37
  */
38
38
  export declare function encryptRegistrationRequest(publicKey: string, viewKey: ViewKey, start: number): string;
39
+ /**
40
+ * Best-effort zeroization of a byte array by overwriting all bytes with zeros.
41
+ * Use this to clear sensitive data (e.g., key bytes) from memory when working
42
+ * with Uint8Array representations of keys or other secrets.
43
+ *
44
+ * This is best-effort in JavaScript — the JIT compiler could theoretically
45
+ * elide the fill if the array is never read again (though current engines
46
+ * do not). For deterministic zeroization of key material, use
47
+ * `Account.destroy()` or call `.free()` on key objects (PrivateKey, ViewKey,
48
+ * ComputeKey, GraphKey) whose Rust Drop implementations zeroize memory
49
+ * before deallocation.
50
+ *
51
+ * Note: This cannot zeroize JavaScript strings, which are immutable and managed
52
+ * by the garbage collector. Prefer using byte array representations of sensitive
53
+ * data over strings whenever possible.
54
+ *
55
+ * @param {Uint8Array} bytes The byte array to zeroize
56
+ *
57
+ * @example
58
+ * const keyBytes = privateKey.toBytesLe();
59
+ * // ... use keyBytes ...
60
+ * zeroizeBytes(keyBytes); // Overwrite with zeros when done
61
+ */
62
+ export declare function zeroizeBytes(bytes: Uint8Array): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@provablehq/sdk",
3
- "version": "0.9.17",
3
+ "version": "0.9.18",
4
4
  "description": "A Software Development Kit (SDK) for Zero-Knowledge Transactions",
5
5
  "collaborators": [
6
6
  "The Provable Team"
@@ -51,7 +51,7 @@
51
51
  },
52
52
  "homepage": "https://github.com/ProvableHQ/sdk#readme",
53
53
  "dependencies": {
54
- "@provablehq/wasm": "^0.9.17",
54
+ "@provablehq/wasm": "^0.9.18",
55
55
  "@scure/base": "^2.0.0",
56
56
  "comlink": "^4.4.2",
57
57
  "core-js": "^3.40.0",