@provablehq/sdk 0.10.3 → 0.10.4

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.
@@ -60,7 +60,7 @@ import { BlockHeightSearch, NetworkRecordProvider, RecordProvider } from "./reco
60
60
  import { RecordScanner, RecordScannerJWTData, RecordScannerOptions } from "./record-scanner.js";
61
61
  import { SealanceMerkleTree } from "./integrations/sealance/merkle-tree.js";
62
62
  declare function initializeWasm(): Promise<void>;
63
- export { ProgramManager, ProvingRequestOptions, ExecuteOptions, FeeAuthorizationOptions, AuthorizationOptions, VerificationOptions, BatchVerificationOptions, inputsToFields, verifyProof, verifyBatchProof } from "./program-manager.js";
63
+ export { ProgramManager, ProvingRequestOptions, ExecuteOptions, FeeAuthorizationOptions, AuthorizationOptions, VerificationOptions, BatchVerificationOptions, inputsToFields, verifyProof, verifyBatchProof, programChecksum } from "./program-manager.js";
64
64
  export { logAndThrow, TransportFunction } from "./utils.js";
65
65
  export { Address, Authorization, Boolean, BHP256, BHP512, BHP768, BHP1024, Ciphertext, ComputeKey, DynamicRecord, Execution as FunctionExecution, ExecutionRequest, ExecutionResponse, EncryptionToolkit, Field, GraphKey, Group, I8, I16, I32, I64, I128, OfflineQuery, Pedersen64, Pedersen128, Plaintext, Poseidon2, Poseidon4, Poseidon8, PrivateKey, PrivateKeyCiphertext, Program, ProgramManager as ProgramManagerBase, Proof, ProvingKey, ProvingRequest, RecordCiphertext, RecordPlaintext, Signature, Scalar, stringToField, Transaction, Transition, U8, U16, U32, U64, U128, Value, VerifyingKey, ViewKey, initThreadPool, getOrInitConsensusVersionTestHeights, snarkVerify, snarkVerifyBatch, verifyFunctionExecution, } from "./wasm.js";
66
66
  export { initializeWasm };
@@ -60,7 +60,7 @@ import { BlockHeightSearch, NetworkRecordProvider, RecordProvider } from "./reco
60
60
  import { RecordScanner, RecordScannerJWTData, RecordScannerOptions } from "./record-scanner.js";
61
61
  import { SealanceMerkleTree } from "./integrations/sealance/merkle-tree.js";
62
62
  declare function initializeWasm(): Promise<void>;
63
- export { ProgramManager, ProvingRequestOptions, ExecuteOptions, FeeAuthorizationOptions, AuthorizationOptions, VerificationOptions, BatchVerificationOptions, inputsToFields, verifyProof, verifyBatchProof } from "./program-manager.js";
63
+ export { ProgramManager, ProvingRequestOptions, ExecuteOptions, FeeAuthorizationOptions, AuthorizationOptions, VerificationOptions, BatchVerificationOptions, inputsToFields, verifyProof, verifyBatchProof, programChecksum } from "./program-manager.js";
64
64
  export { logAndThrow, TransportFunction } from "./utils.js";
65
65
  export { Address, Authorization, Boolean, BHP256, BHP512, BHP768, BHP1024, Ciphertext, ComputeKey, DynamicRecord, Execution as FunctionExecution, ExecutionRequest, ExecutionResponse, EncryptionToolkit, Field, GraphKey, Group, I8, I16, I32, I64, I128, OfflineQuery, Pedersen64, Pedersen128, Plaintext, Poseidon2, Poseidon4, Poseidon8, PrivateKey, PrivateKeyCiphertext, Program, ProgramManager as ProgramManagerBase, Proof, ProvingKey, ProvingRequest, RecordCiphertext, RecordPlaintext, Signature, Scalar, stringToField, Transaction, Transition, U8, U16, U32, U64, U128, Value, VerifyingKey, ViewKey, initThreadPool, getOrInitConsensusVersionTestHeights, snarkVerify, snarkVerifyBatch, verifyFunctionExecution, } from "./wasm.js";
66
66
  export { initializeWasm };
@@ -862,7 +862,7 @@ class AleoNetworkClient {
862
862
  else {
863
863
  this.headers = {
864
864
  // This is replaced by the actual version by a Rollup plugin
865
- "X-Aleo-SDK-Version": "0.10.3",
865
+ "X-Aleo-SDK-Version": "0.10.4",
866
866
  "X-Aleo-environment": environment(),
867
867
  };
868
868
  }
@@ -878,7 +878,7 @@ class AleoNetworkClient {
878
878
  else {
879
879
  this.headers = {
880
880
  // This is replaced by the actual version by a Rollup plugin
881
- "X-Aleo-SDK-Version": "0.10.3",
881
+ "X-Aleo-SDK-Version": "0.10.4",
882
882
  "X-Aleo-environment": environment(),
883
883
  };
884
884
  }
@@ -8026,6 +8026,28 @@ function verifyBatchProof(options) {
8026
8026
  proof.free();
8027
8027
  }
8028
8028
  }
8029
+ /**
8030
+ * Get the checksum of an Aleo program.
8031
+ *
8032
+ * @param {string | Program} program Program string or Program object
8033
+ * @returns {Uint8Array} The keccak256 checksum of the program as a 32-byte Uint8Array
8034
+ *
8035
+ * @example
8036
+ * import { programChecksum } from "@provablehq/sdk/mainnet.js";
8037
+ *
8038
+ * const checksum = programChecksum("program foo.aleo; ...");
8039
+ */
8040
+ function programChecksum(program) {
8041
+ const owned = typeof program === "string" ? Program.fromString(program) : undefined;
8042
+ const p = owned ?? program;
8043
+ try {
8044
+ return p.toChecksum();
8045
+ }
8046
+ finally {
8047
+ if (owned)
8048
+ owned.free();
8049
+ }
8050
+ }
8029
8051
 
8030
8052
  // ---------------------------------------------------------------------------
8031
8053
  // Converters
@@ -8223,5 +8245,5 @@ async function initializeWasm() {
8223
8245
  console.warn("initializeWasm is deprecated, you no longer need to use it");
8224
8246
  }
8225
8247
 
8226
- export { Account, AleoKeyProvider, AleoKeyProviderParams, AleoNetworkClient, BlockHeightSearch, CREDITS_PROGRAM_KEYS, KeyVerificationError as ChecksumMismatchError, DecryptionNotEnabledError, InvalidLocatorError, KEY_STORE, KeyVerificationError, MemKeyVerifier, 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, buildExecutionRequestFromExternallySignedData, computeExternalSigningInputs, encryptAuthorization, encryptProvingRequest, encryptRegistrationRequest, encryptViewKey, initializeWasm, inputsToFields, isInputIdStrategy, isProveApiErrorBody, isProvingResponse, isRecordViewKeyStrategy, isViewKeyStrategy, logAndThrow, provingKeyLocator, sha256Hex, toAddress, toField, toGroup, toSignature, toViewKey, translationKeyLocator, verifyBatchProof, verifyProof, verifyingKeyLocator, zeroizeBytes };
8248
+ export { Account, AleoKeyProvider, AleoKeyProviderParams, AleoNetworkClient, BlockHeightSearch, CREDITS_PROGRAM_KEYS, KeyVerificationError as ChecksumMismatchError, DecryptionNotEnabledError, InvalidLocatorError, KEY_STORE, KeyVerificationError, MemKeyVerifier, 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, buildExecutionRequestFromExternallySignedData, computeExternalSigningInputs, encryptAuthorization, encryptProvingRequest, encryptRegistrationRequest, encryptViewKey, initializeWasm, inputsToFields, isInputIdStrategy, isProveApiErrorBody, isProvingResponse, isRecordViewKeyStrategy, isViewKeyStrategy, logAndThrow, programChecksum, provingKeyLocator, sha256Hex, toAddress, toField, toGroup, toSignature, toViewKey, translationKeyLocator, verifyBatchProof, verifyProof, verifyingKeyLocator, zeroizeBytes };
8227
8249
  //# sourceMappingURL=browser.js.map