@provablehq/sdk 0.11.9 → 0.11.11

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 (55) hide show
  1. package/dist/mainnet/account.d.cts +3 -3
  2. package/dist/mainnet/account.d.ts +3 -3
  3. package/dist/mainnet/api-auth.d.cts +14 -9
  4. package/dist/mainnet/api-auth.d.ts +14 -9
  5. package/dist/mainnet/browser.cjs +547 -193
  6. package/dist/mainnet/browser.cjs.map +1 -1
  7. package/dist/mainnet/browser.d.cts +1 -1
  8. package/dist/mainnet/browser.d.ts +1 -1
  9. package/dist/mainnet/browser.js +547 -194
  10. package/dist/mainnet/browser.js.map +1 -1
  11. package/dist/mainnet/keys/provider/interface.d.cts +4 -4
  12. package/dist/mainnet/keys/provider/interface.d.ts +4 -4
  13. package/dist/mainnet/keys/provider/memory.d.cts +6 -6
  14. package/dist/mainnet/keys/provider/memory.d.ts +6 -6
  15. package/dist/mainnet/keys/provider/offline.d.cts +1 -1
  16. package/dist/mainnet/keys/provider/offline.d.ts +1 -1
  17. package/dist/mainnet/network-client.d.cts +40 -38
  18. package/dist/mainnet/network-client.d.ts +40 -38
  19. package/dist/mainnet/node.cjs +1 -0
  20. package/dist/mainnet/node.cjs.map +1 -1
  21. package/dist/mainnet/node.js +1 -1
  22. package/dist/mainnet/program-manager.d.cts +134 -37
  23. package/dist/mainnet/program-manager.d.ts +134 -37
  24. package/dist/mainnet/record-provider.d.cts +7 -7
  25. package/dist/mainnet/record-provider.d.ts +7 -7
  26. package/dist/mainnet/record-scanner.d.cts +3 -3
  27. package/dist/mainnet/record-scanner.d.ts +3 -3
  28. package/dist/testnet/account.d.cts +3 -3
  29. package/dist/testnet/account.d.ts +3 -3
  30. package/dist/testnet/api-auth.d.cts +14 -9
  31. package/dist/testnet/api-auth.d.ts +14 -9
  32. package/dist/testnet/browser.cjs +547 -193
  33. package/dist/testnet/browser.cjs.map +1 -1
  34. package/dist/testnet/browser.d.cts +1 -1
  35. package/dist/testnet/browser.d.ts +1 -1
  36. package/dist/testnet/browser.js +547 -194
  37. package/dist/testnet/browser.js.map +1 -1
  38. package/dist/testnet/keys/provider/interface.d.cts +4 -4
  39. package/dist/testnet/keys/provider/interface.d.ts +4 -4
  40. package/dist/testnet/keys/provider/memory.d.cts +6 -6
  41. package/dist/testnet/keys/provider/memory.d.ts +6 -6
  42. package/dist/testnet/keys/provider/offline.d.cts +1 -1
  43. package/dist/testnet/keys/provider/offline.d.ts +1 -1
  44. package/dist/testnet/network-client.d.cts +40 -38
  45. package/dist/testnet/network-client.d.ts +40 -38
  46. package/dist/testnet/node.cjs +1 -0
  47. package/dist/testnet/node.cjs.map +1 -1
  48. package/dist/testnet/node.js +1 -1
  49. package/dist/testnet/program-manager.d.cts +134 -37
  50. package/dist/testnet/program-manager.d.ts +134 -37
  51. package/dist/testnet/record-provider.d.cts +7 -7
  52. package/dist/testnet/record-provider.d.ts +7 -7
  53. package/dist/testnet/record-scanner.d.cts +3 -3
  54. package/dist/testnet/record-scanner.d.ts +3 -3
  55. package/package.json +2 -2
@@ -171,7 +171,7 @@ export declare class Account {
171
171
  * import { AleoNetworkClient, Account } from "@provablehq/sdk/testnet.js";
172
172
  *
173
173
  * // Create a connection to the Aleo network and an account
174
- * const networkClient = new AleoNetworkClient("https://api.provable.com/v2");
174
+ * const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2");
175
175
  * const account = Account.fromCiphertext(process.env.ciphertext!, process.env.password!);
176
176
  *
177
177
  * // Get the record ciphertexts from a transaction.
@@ -198,7 +198,7 @@ export declare class Account {
198
198
  * import { AleoNetworkClient, Account } from "@provablehq/sdk/testnet.js";
199
199
  *
200
200
  * // Create a connection to the Aleo network and an account
201
- * const networkClient = new AleoNetworkClient("https://api.provable.com/v2");
201
+ * const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2");
202
202
  * const account = Account.fromCiphertext(process.env.ciphertext!, process.env.password!);
203
203
  *
204
204
  * // Get the record ciphertexts from a transaction.
@@ -254,7 +254,7 @@ export declare class Account {
254
254
  * import { AleoNetworkClient, Account } from "@provablehq/sdk/testnet.js";
255
255
  *
256
256
  * // Create a connection to the Aleo network and an account
257
- * const networkClient = new AleoNetworkClient("https://api.provable.com/v2");
257
+ * const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2");
258
258
  * const account = Account.fromCiphertext(process.env.ciphertext!, process.env.password!);
259
259
  *
260
260
  * // Get the record ciphertexts from a transaction and check ownership of them.
@@ -171,7 +171,7 @@ export declare class Account {
171
171
  * import { AleoNetworkClient, Account } from "@provablehq/sdk/testnet.js";
172
172
  *
173
173
  * // Create a connection to the Aleo network and an account
174
- * const networkClient = new AleoNetworkClient("https://api.provable.com/v2");
174
+ * const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2");
175
175
  * const account = Account.fromCiphertext(process.env.ciphertext!, process.env.password!);
176
176
  *
177
177
  * // Get the record ciphertexts from a transaction.
@@ -198,7 +198,7 @@ export declare class Account {
198
198
  * import { AleoNetworkClient, Account } from "@provablehq/sdk/testnet.js";
199
199
  *
200
200
  * // Create a connection to the Aleo network and an account
201
- * const networkClient = new AleoNetworkClient("https://api.provable.com/v2");
201
+ * const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2");
202
202
  * const account = Account.fromCiphertext(process.env.ciphertext!, process.env.password!);
203
203
  *
204
204
  * // Get the record ciphertexts from a transaction.
@@ -254,7 +254,7 @@ export declare class Account {
254
254
  * import { AleoNetworkClient, Account } from "@provablehq/sdk/testnet.js";
255
255
  *
256
256
  * // Create a connection to the Aleo network and an account
257
- * const networkClient = new AleoNetworkClient("https://api.provable.com/v2");
257
+ * const networkClient = new AleoNetworkClient("https://edge.provable.com/api/v2");
258
258
  * const account = Account.fromCiphertext(process.env.ciphertext!, process.env.password!);
259
259
  *
260
260
  * // Get the record ciphertexts from a transaction and check ownership of them.
@@ -14,15 +14,18 @@ export declare const DEFAULT_API_KEY_HEADER = "X-API-Key";
14
14
  /**
15
15
  * Authentication configuration for Provable API services.
16
16
  *
17
- * Two live modes exist, matching the two gateways:
18
- * - `jwt` (api.provable.com): the apiKey + consumerId pair mints a short-lived JWT at
19
- * `/jwts/{consumerId}` which is sent as an `Authorization` header and refreshed near expiry.
20
- * - `api-key` (edge.provable.com): a provisioned key is sent verbatim on every request in a
17
+ * The SDK targets edge.provable.com/api by default. That gateway is unauthenticated: it never
18
+ * mints or accepts JWTs, and a provisioned key is optional. The legacy api.provable.com gateway
19
+ * authenticates with JWTs. The modes map onto the gateways as follows:
20
+ * - `none`: requests carry no auth headers of their own. This is the default for edge, and
21
+ * nothing ever calls `/jwts`. A token injected via `setJwtData` is still sent — the
22
+ * session-driven pattern, where an external session owns minting and hands a fresh token in.
23
+ * - `api-key`: edge with a provisioned key. The key is sent verbatim on every request in a
21
24
  * header (default `X-API-Key`). There is no registration, minting, or refresh in this mode;
22
25
  * a 401 means the key is invalid or revoked and retrying cannot help.
23
- * - `none`: requests carry no auth headers of their own. A token injected via
24
- * `setJwtData` is still sent — the session-driven pattern, where an external
25
- * session owns minting and hands a fresh token in before each request.
26
+ * - `jwt`: api.provable.com. The apiKey + consumerId pair mints a short-lived JWT at
27
+ * `/jwts/{consumerId}` which is sent as an `Authorization` header and refreshed near expiry.
28
+ * Edge has no `/jwts` route, so do not point a `jwt` configuration at it.
26
29
  */
27
30
  export type ApiAuthConfig = {
28
31
  mode: "jwt";
@@ -52,10 +55,12 @@ export interface LegacyAuthOptions {
52
55
  /**
53
56
  * Normalize legacy auth options into an explicit {@link ApiAuthConfig}.
54
57
  *
55
- * Rules, preserving the pre-mode behavior of both clients:
58
+ * Rules:
56
59
  * - An explicit `auth` wins. Combining it with legacy fields throws — the caller's intent
57
60
  * is ambiguous and guessing hides misconfiguration.
58
- * - A string `apiKey` (with or without `consumerId`) or a bare `jwtData` selects `jwt` mode.
61
+ * - A string `apiKey` on its own selects `api-key` mode with the default header: nothing can
62
+ * mint a JWT without a `consumerId`, so a lone key is a provisioned edge key.
63
+ * - A string `apiKey` with a `consumerId`, or a bare `jwtData`, selects `jwt` mode.
59
64
  * - An `{ header, value }` apiKey selects `api-key` mode with that header. Combining it with
60
65
  * a `consumerId` throws: keyed auth has no consumer and the pair would silently pick one.
61
66
  * - Nothing configured selects `none`.
@@ -14,15 +14,18 @@ export declare const DEFAULT_API_KEY_HEADER = "X-API-Key";
14
14
  /**
15
15
  * Authentication configuration for Provable API services.
16
16
  *
17
- * Two live modes exist, matching the two gateways:
18
- * - `jwt` (api.provable.com): the apiKey + consumerId pair mints a short-lived JWT at
19
- * `/jwts/{consumerId}` which is sent as an `Authorization` header and refreshed near expiry.
20
- * - `api-key` (edge.provable.com): a provisioned key is sent verbatim on every request in a
17
+ * The SDK targets edge.provable.com/api by default. That gateway is unauthenticated: it never
18
+ * mints or accepts JWTs, and a provisioned key is optional. The legacy api.provable.com gateway
19
+ * authenticates with JWTs. The modes map onto the gateways as follows:
20
+ * - `none`: requests carry no auth headers of their own. This is the default for edge, and
21
+ * nothing ever calls `/jwts`. A token injected via `setJwtData` is still sent — the
22
+ * session-driven pattern, where an external session owns minting and hands a fresh token in.
23
+ * - `api-key`: edge with a provisioned key. The key is sent verbatim on every request in a
21
24
  * header (default `X-API-Key`). There is no registration, minting, or refresh in this mode;
22
25
  * a 401 means the key is invalid or revoked and retrying cannot help.
23
- * - `none`: requests carry no auth headers of their own. A token injected via
24
- * `setJwtData` is still sent — the session-driven pattern, where an external
25
- * session owns minting and hands a fresh token in before each request.
26
+ * - `jwt`: api.provable.com. The apiKey + consumerId pair mints a short-lived JWT at
27
+ * `/jwts/{consumerId}` which is sent as an `Authorization` header and refreshed near expiry.
28
+ * Edge has no `/jwts` route, so do not point a `jwt` configuration at it.
26
29
  */
27
30
  export type ApiAuthConfig = {
28
31
  mode: "jwt";
@@ -52,10 +55,12 @@ export interface LegacyAuthOptions {
52
55
  /**
53
56
  * Normalize legacy auth options into an explicit {@link ApiAuthConfig}.
54
57
  *
55
- * Rules, preserving the pre-mode behavior of both clients:
58
+ * Rules:
56
59
  * - An explicit `auth` wins. Combining it with legacy fields throws — the caller's intent
57
60
  * is ambiguous and guessing hides misconfiguration.
58
- * - A string `apiKey` (with or without `consumerId`) or a bare `jwtData` selects `jwt` mode.
61
+ * - A string `apiKey` on its own selects `api-key` mode with the default header: nothing can
62
+ * mint a JWT without a `consumerId`, so a lone key is a provisioned edge key.
63
+ * - A string `apiKey` with a `consumerId`, or a bare `jwtData`, selects `jwt` mode.
59
64
  * - An `{ header, value }` apiKey selects `api-key` mode with that header. Combining it with
60
65
  * a `consumerId` throws: keyed auth has no consumer and the pair would silently pick one.
61
66
  * - Nothing configured selects `none`.