@provablehq/sdk 0.10.5 → 0.10.6-rc.1

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 (67) hide show
  1. package/dist/mainnet/browser.cjs +927 -357
  2. package/dist/mainnet/browser.cjs.map +1 -1
  3. package/dist/mainnet/browser.d.cts +6 -4
  4. package/dist/mainnet/browser.d.ts +6 -4
  5. package/dist/mainnet/browser.js +923 -364
  6. package/dist/mainnet/browser.js.map +1 -1
  7. package/dist/mainnet/keys/keystore/indexeddb.d.cts +49 -0
  8. package/dist/mainnet/keys/keystore/indexeddb.d.ts +49 -0
  9. package/dist/mainnet/keys/provider/memory.d.cts +1 -1
  10. package/dist/mainnet/keys/provider/memory.d.ts +1 -1
  11. package/dist/mainnet/models/record-scanner/error.d.cts +1 -1
  12. package/dist/mainnet/models/record-scanner/error.d.ts +1 -1
  13. package/dist/mainnet/models/record-scanner/registrationResult.d.cts +1 -1
  14. package/dist/mainnet/models/record-scanner/registrationResult.d.ts +1 -1
  15. package/dist/mainnet/network-client.d.cts +17 -1
  16. package/dist/mainnet/network-client.d.ts +17 -1
  17. package/dist/mainnet/node.cjs +11 -0
  18. package/dist/mainnet/node.cjs.map +1 -1
  19. package/dist/mainnet/node.js +2 -2
  20. package/dist/mainnet/program-manager.d.cts +61 -1
  21. package/dist/mainnet/program-manager.d.ts +61 -1
  22. package/dist/mainnet/record-scanner.d.cts +2 -10
  23. package/dist/mainnet/record-scanner.d.ts +2 -10
  24. package/dist/mainnet/utils/index.d.cts +3 -0
  25. package/dist/mainnet/utils/index.d.ts +3 -0
  26. package/dist/mainnet/utils/logger.d.cts +30 -0
  27. package/dist/mainnet/utils/logger.d.ts +30 -0
  28. package/dist/mainnet/wasm.d.cts +1 -1
  29. package/dist/mainnet/wasm.d.ts +1 -1
  30. package/dist/testnet/browser.cjs +927 -357
  31. package/dist/testnet/browser.cjs.map +1 -1
  32. package/dist/testnet/browser.d.cts +6 -4
  33. package/dist/testnet/browser.d.ts +6 -4
  34. package/dist/testnet/browser.js +923 -364
  35. package/dist/testnet/browser.js.map +1 -1
  36. package/dist/testnet/keys/keystore/indexeddb.d.cts +49 -0
  37. package/dist/testnet/keys/keystore/indexeddb.d.ts +49 -0
  38. package/dist/testnet/keys/provider/memory.d.cts +1 -1
  39. package/dist/testnet/keys/provider/memory.d.ts +1 -1
  40. package/dist/testnet/models/record-scanner/error.d.cts +1 -1
  41. package/dist/testnet/models/record-scanner/error.d.ts +1 -1
  42. package/dist/testnet/models/record-scanner/registrationResult.d.cts +1 -1
  43. package/dist/testnet/models/record-scanner/registrationResult.d.ts +1 -1
  44. package/dist/testnet/network-client.d.cts +17 -1
  45. package/dist/testnet/network-client.d.ts +17 -1
  46. package/dist/testnet/node.cjs +11 -0
  47. package/dist/testnet/node.cjs.map +1 -1
  48. package/dist/testnet/node.js +2 -2
  49. package/dist/testnet/program-manager.d.cts +61 -1
  50. package/dist/testnet/program-manager.d.ts +61 -1
  51. package/dist/testnet/record-scanner.d.cts +2 -10
  52. package/dist/testnet/record-scanner.d.ts +2 -10
  53. package/dist/testnet/utils/index.d.cts +3 -0
  54. package/dist/testnet/utils/index.d.ts +3 -0
  55. package/dist/testnet/utils/logger.d.cts +30 -0
  56. package/dist/testnet/utils/logger.d.ts +30 -0
  57. package/dist/testnet/wasm.d.cts +1 -1
  58. package/dist/testnet/wasm.d.ts +1 -1
  59. package/package.json +2 -2
  60. package/dist/mainnet/models/record-scanner/registrationRequest.d.cts +0 -13
  61. package/dist/mainnet/models/record-scanner/registrationRequest.d.ts +0 -13
  62. package/dist/testnet/models/record-scanner/registrationRequest.d.cts +0 -13
  63. package/dist/testnet/models/record-scanner/registrationRequest.d.ts +0 -13
  64. /package/dist/mainnet/{utils.d.cts → utils/utils.d.cts} +0 -0
  65. /package/dist/mainnet/{utils.d.ts → utils/utils.d.ts} +0 -0
  66. /package/dist/testnet/{utils.d.cts → utils/utils.d.cts} +0 -0
  67. /package/dist/testnet/{utils.d.ts → utils/utils.d.ts} +0 -0
@@ -1,4 +1,4 @@
1
- import { TransportFunction } from "./utils.js";
1
+ import { TransportFunction } from "./utils/utils.js";
2
2
  import { EncryptedRecord } from "./models/record-provider/encryptedRecord.js";
3
3
  import { CryptoBoxPubKey } from "./models/cryptoBoxPubkey.js";
4
4
  import { OwnedFilter } from "./models/record-scanner/ownedFilter.js";
@@ -62,7 +62,7 @@ export interface RecordScannerOptions {
62
62
  * const recordScanner = new RecordScanner({ url: "https://record-scanner.aleo.org" });
63
63
  * recordScanner.setAccount(account);
64
64
  * recordScanner.setApiKey("example-api-key");
65
- * const result = await recordScanner.register(viewKey, 0);
65
+ * const result = await recordScanner.registerEncrypted(viewKey, 0);
66
66
  * if (result.ok) { const uuid = result.data.uuid; }
67
67
  *
68
68
  * const filter = {
@@ -200,14 +200,6 @@ declare class RecordScanner implements RecordProvider {
200
200
  * @throws Re-throws err when it is not a RecordScannerRequestError.
201
201
  */
202
202
  private handleRequestError;
203
- /**
204
- * Register the account with the record scanning service (unencrypted POST /register). Does not throw if a valid error response from the record scanner is received; returns a result object instead.
205
- *
206
- * @param {ViewKey} viewKey The view key to register.
207
- * @param {number} startBlock The block height to start scanning from.
208
- * @returns {Promise<RegisterResult>} `{ ok: true, data }` on success, or `{ ok: false, status, error }` on failure.
209
- */
210
- register(viewKey: ViewKey, startBlock: number): Promise<RegisterResult>;
211
203
  /**
212
204
  * Fetches an ephemeral public key from the record scanning service for use with registerEncrypted.
213
205
  * Follows the same pattern as the delegated proving service /pubkey endpoint.
@@ -0,0 +1,3 @@
1
+ export { logger, setLogLevel, getLogLevel } from "./logger.js";
2
+ export type { LogLevel } from "./logger.js";
3
+ export { logAndThrow, retryWithBackoff, environment, isNode, TransportFunction, defaultTransport } from "./utils.js";
@@ -0,0 +1,3 @@
1
+ export { logger, setLogLevel, getLogLevel } from "./logger.js";
2
+ export type { LogLevel } from "./logger.js";
3
+ export { logAndThrow, retryWithBackoff, environment, isNode, TransportFunction, defaultTransport } from "./utils.js";
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Log levels in ascending severity. Each level includes all levels above it.
3
+ * "silent" suppresses all output. "debug" enables everything.
4
+ *
5
+ * @example
6
+ * import { setLogLevel } from "@provablehq/sdk";
7
+ * setLogLevel("silent"); // suppress all SDK logging
8
+ */
9
+ export type LogLevel = "silent" | "error" | "warn" | "info" | "debug";
10
+ /**
11
+ * Set the SDK log level. Levels are hierarchical:
12
+ * - "silent" — suppress all SDK logging
13
+ * - "error" — only errors
14
+ * - "warn" — errors + warnings
15
+ * - "info" — errors + warnings + info (default)
16
+ * - "debug" — everything including debug traces
17
+ */
18
+ export declare function setLogLevel(level: LogLevel): void;
19
+ /** Returns the current SDK log level. */
20
+ export declare function getLogLevel(): LogLevel;
21
+ /**
22
+ * SDK logger object following console.log/warn/error/debug syntax.
23
+ * Respects the current log level set via setLogLevel().
24
+ */
25
+ export declare const logger: {
26
+ log(...args: unknown[]): void;
27
+ warn(...args: unknown[]): void;
28
+ error(...args: unknown[]): void;
29
+ debug(...args: unknown[]): void;
30
+ };
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Log levels in ascending severity. Each level includes all levels above it.
3
+ * "silent" suppresses all output. "debug" enables everything.
4
+ *
5
+ * @example
6
+ * import { setLogLevel } from "@provablehq/sdk";
7
+ * setLogLevel("silent"); // suppress all SDK logging
8
+ */
9
+ export type LogLevel = "silent" | "error" | "warn" | "info" | "debug";
10
+ /**
11
+ * Set the SDK log level. Levels are hierarchical:
12
+ * - "silent" — suppress all SDK logging
13
+ * - "error" — only errors
14
+ * - "warn" — errors + warnings
15
+ * - "info" — errors + warnings + info (default)
16
+ * - "debug" — everything including debug traces
17
+ */
18
+ export declare function setLogLevel(level: LogLevel): void;
19
+ /** Returns the current SDK log level. */
20
+ export declare function getLogLevel(): LogLevel;
21
+ /**
22
+ * SDK logger object following console.log/warn/error/debug syntax.
23
+ * Respects the current log level set via setLogLevel().
24
+ */
25
+ export declare const logger: {
26
+ log(...args: unknown[]): void;
27
+ warn(...args: unknown[]): void;
28
+ error(...args: unknown[]): void;
29
+ debug(...args: unknown[]): void;
30
+ };
@@ -1 +1 @@
1
- export { Address, Authorization, Boolean, BHP256, BHP512, BHP768, BHP1024, Ciphertext, ComputeKey, DynamicRecord, EncryptionToolkit, ExecutionRequest, Execution, ExecutionResponse, Field, GraphKey, Group, I8, I16, I32, I64, I128, CallbackQuery, OfflineQuery, QueryOption, Metadata, Pedersen64, Pedersen128, Plaintext, Poseidon2, Poseidon4, Poseidon8, PrivateKey, PrivateKeyCiphertext, Program, ProgramManager, Proof, ProvingKey, ProvingRequest, RecordCiphertext, RecordPlaintext, Scalar, Signature, stringToField, Transaction, Transition, U8, U16, U32, U64, U128, Value, VerifyingKey, ViewKey, initThreadPool, getOrInitConsensusVersionTestHeights, snarkVerify, snarkVerifyBatch, verifyFunctionExecution, } from "@provablehq/wasm/testnet.js";
1
+ export { Address, Authorization, Boolean, BHP256, BHP512, BHP768, BHP1024, Ciphertext, ComputeKey, DynamicRecord, EncryptionToolkit, ExecutionRequest, Execution, ExecutionResponse, Field, GraphKey, Group, I8, I16, I32, I64, I128, CallbackQuery, OfflineQuery, QueryOption, Metadata, Pedersen64, Pedersen128, Plaintext, Poseidon2, Poseidon4, Poseidon8, PrivateKey, PrivateKeyCiphertext, Program, ProgramImports as ProgramImportsBuilder, ProgramManager, Proof, ProvingKey, ProvingRequest, RecordCiphertext, RecordPlaintext, Scalar, Signature, stringToField, Transaction, Transition, U8, U16, U32, U64, U128, Value, VerifyingKey, ViewKey, initThreadPool, getOrInitConsensusVersionTestHeights, snarkVerify, snarkVerifyBatch, verifyFunctionExecution, } from "@provablehq/wasm/testnet.js";
@@ -1 +1 @@
1
- export { Address, Authorization, Boolean, BHP256, BHP512, BHP768, BHP1024, Ciphertext, ComputeKey, DynamicRecord, EncryptionToolkit, ExecutionRequest, Execution, ExecutionResponse, Field, GraphKey, Group, I8, I16, I32, I64, I128, CallbackQuery, OfflineQuery, QueryOption, Metadata, Pedersen64, Pedersen128, Plaintext, Poseidon2, Poseidon4, Poseidon8, PrivateKey, PrivateKeyCiphertext, Program, ProgramManager, Proof, ProvingKey, ProvingRequest, RecordCiphertext, RecordPlaintext, Scalar, Signature, stringToField, Transaction, Transition, U8, U16, U32, U64, U128, Value, VerifyingKey, ViewKey, initThreadPool, getOrInitConsensusVersionTestHeights, snarkVerify, snarkVerifyBatch, verifyFunctionExecution, } from "@provablehq/wasm/testnet.js";
1
+ export { Address, Authorization, Boolean, BHP256, BHP512, BHP768, BHP1024, Ciphertext, ComputeKey, DynamicRecord, EncryptionToolkit, ExecutionRequest, Execution, ExecutionResponse, Field, GraphKey, Group, I8, I16, I32, I64, I128, CallbackQuery, OfflineQuery, QueryOption, Metadata, Pedersen64, Pedersen128, Plaintext, Poseidon2, Poseidon4, Poseidon8, PrivateKey, PrivateKeyCiphertext, Program, ProgramImports as ProgramImportsBuilder, ProgramManager, Proof, ProvingKey, ProvingRequest, RecordCiphertext, RecordPlaintext, Scalar, Signature, stringToField, Transaction, Transition, U8, U16, U32, U64, U128, Value, VerifyingKey, ViewKey, initThreadPool, getOrInitConsensusVersionTestHeights, snarkVerify, snarkVerifyBatch, verifyFunctionExecution, } from "@provablehq/wasm/testnet.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@provablehq/sdk",
3
- "version": "0.10.5",
3
+ "version": "0.10.6-rc.1",
4
4
  "description": "A Software Development Kit (SDK) for Zero-Knowledge Transactions",
5
5
  "collaborators": [
6
6
  "The Provable Team"
@@ -91,7 +91,7 @@
91
91
  },
92
92
  "homepage": "https://github.com/ProvableHQ/sdk#readme",
93
93
  "dependencies": {
94
- "@provablehq/wasm": "^0.10.5",
94
+ "@provablehq/wasm": "^0.10.6-rc.1",
95
95
  "@scure/base": "^2.0.0",
96
96
  "@serenity-kit/noble-sodium": "0.2.3",
97
97
  "comlink": "^4.4.2",
@@ -1,13 +0,0 @@
1
- /**
2
- * RegistrationRequest is a type that represents a request to register an account's view key with a record scanning service.
3
- *
4
- * @example
5
- * const registrationRequest: RegistrationRequest = {
6
- * view_key: "AViewKey1ccEt8A2Ryva5rxnKcAbn7wgTaTsb79tzkKHFpeKsm9NX",
7
- * start: 123456,
8
- * }
9
- */
10
- export type RegistrationRequest = {
11
- view_key: string;
12
- start: number;
13
- };
@@ -1,13 +0,0 @@
1
- /**
2
- * RegistrationRequest is a type that represents a request to register an account's view key with a record scanning service.
3
- *
4
- * @example
5
- * const registrationRequest: RegistrationRequest = {
6
- * view_key: "AViewKey1ccEt8A2Ryva5rxnKcAbn7wgTaTsb79tzkKHFpeKsm9NX",
7
- * start: 123456,
8
- * }
9
- */
10
- export type RegistrationRequest = {
11
- view_key: string;
12
- start: number;
13
- };
@@ -1,13 +0,0 @@
1
- /**
2
- * RegistrationRequest is a type that represents a request to register an account's view key with a record scanning service.
3
- *
4
- * @example
5
- * const registrationRequest: RegistrationRequest = {
6
- * view_key: "AViewKey1ccEt8A2Ryva5rxnKcAbn7wgTaTsb79tzkKHFpeKsm9NX",
7
- * start: 123456,
8
- * }
9
- */
10
- export type RegistrationRequest = {
11
- view_key: string;
12
- start: number;
13
- };
@@ -1,13 +0,0 @@
1
- /**
2
- * RegistrationRequest is a type that represents a request to register an account's view key with a record scanning service.
3
- *
4
- * @example
5
- * const registrationRequest: RegistrationRequest = {
6
- * view_key: "AViewKey1ccEt8A2Ryva5rxnKcAbn7wgTaTsb79tzkKHFpeKsm9NX",
7
- * start: 123456,
8
- * }
9
- */
10
- export type RegistrationRequest = {
11
- view_key: string;
12
- start: number;
13
- };
File without changes
File without changes
File without changes
File without changes