@provablehq/sdk 0.10.2 → 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.
- package/dist/dynamic/browser.cjs +12 -0
- package/dist/dynamic/browser.d.cts +8 -0
- package/dist/dynamic/browser.d.ts +2 -2
- package/dist/dynamic/node.cjs +12 -0
- package/dist/dynamic/node.d.cts +8 -0
- package/dist/dynamic/node.d.ts +2 -2
- package/dist/mainnet/account.d.cts +347 -0
- package/dist/mainnet/browser.cjs +8530 -0
- package/dist/mainnet/browser.cjs.map +1 -0
- package/dist/mainnet/browser.d.cts +72 -0
- package/dist/mainnet/browser.d.ts +3 -3
- package/dist/mainnet/browser.js +78 -32
- package/dist/mainnet/browser.js.map +1 -1
- package/dist/mainnet/constants.d.cts +40 -0
- package/dist/mainnet/external-signing.d.cts +76 -0
- package/dist/mainnet/integrations/sealance/merkle-tree.d.cts +192 -0
- package/dist/mainnet/keys/keystore/error.d.cts +24 -0
- package/dist/mainnet/keys/keystore/file.d.cts +177 -0
- package/dist/mainnet/keys/keystore/interface.d.cts +161 -0
- package/dist/mainnet/keys/provider/interface.d.cts +170 -0
- package/dist/mainnet/keys/provider/memory.d.cts +213 -0
- package/dist/mainnet/keys/provider/memory.d.ts +6 -2
- package/dist/mainnet/keys/provider/offline.d.cts +365 -0
- package/dist/mainnet/keys/verifier/interface.d.cts +70 -0
- package/dist/mainnet/keys/verifier/memory.d.cts +37 -0
- package/dist/mainnet/keys/verifier/memory.d.ts +1 -1
- package/dist/mainnet/models/authorization.d.cts +6 -0
- package/dist/mainnet/models/authorization.d.ts +2 -2
- package/dist/mainnet/models/blockJSON.d.cts +33 -0
- package/dist/mainnet/models/confirmed_transaction.d.cts +9 -0
- package/dist/mainnet/models/cryptoBoxPubkey.d.cts +4 -0
- package/dist/mainnet/models/deployment/deploymentJSON.d.cts +6 -0
- package/dist/mainnet/models/deployment/deploymentObject.d.cts +6 -0
- package/dist/mainnet/models/encryptedProvingRequest.d.cts +4 -0
- package/dist/mainnet/models/execution/executionJSON.d.cts +11 -0
- package/dist/mainnet/models/execution/executionObject.d.cts +11 -0
- package/dist/mainnet/models/external-signing.d.cts +123 -0
- package/dist/mainnet/models/finalizeJSON.d.cts +6 -0
- package/dist/mainnet/models/functionInput.d.cts +7 -0
- package/dist/mainnet/models/functionObject.d.cts +8 -0
- package/dist/mainnet/models/imports.d.cts +7 -0
- package/dist/mainnet/models/input/inputJSON.d.cts +10 -0
- package/dist/mainnet/models/input/inputObject.d.cts +15 -0
- package/dist/mainnet/models/inputID.d.cts +4 -0
- package/dist/mainnet/models/keyPair.d.cts +4 -0
- package/dist/mainnet/models/output/outputJSON.d.cts +7 -0
- package/dist/mainnet/models/output/outputObject.d.cts +18 -0
- package/dist/mainnet/models/owner/ownerJSON.d.cts +4 -0
- package/dist/mainnet/models/owner/ownerObject.d.cts +5 -0
- package/dist/mainnet/models/plaintext/array.d.cts +3 -0
- package/dist/mainnet/models/plaintext/literal.d.cts +1 -0
- package/dist/mainnet/models/plaintext/plaintext.d.cts +5 -0
- package/dist/mainnet/models/plaintext/struct.d.cts +5 -0
- package/dist/mainnet/models/provingRequest.d.cts +6 -0
- package/dist/mainnet/models/provingRequest.d.ts +1 -1
- package/dist/mainnet/models/provingResponse.d.cts +51 -0
- package/dist/mainnet/models/ratification.d.cts +4 -0
- package/dist/mainnet/models/record-provider/encryptedRecord.d.cts +58 -0
- package/dist/mainnet/models/record-provider/ownedRecord.d.cts +60 -0
- package/dist/mainnet/models/record-provider/recordSearchParams.d.cts +19 -0
- package/dist/mainnet/models/record-scanner/encryptedRecordsResult.d.cts +7 -0
- package/dist/mainnet/models/record-scanner/encryptedRegistrationRequest.d.cts +8 -0
- package/dist/mainnet/models/record-scanner/error.d.cts +47 -0
- package/dist/mainnet/models/record-scanner/error.d.ts +1 -1
- package/dist/mainnet/models/record-scanner/ownedFilter.d.cts +22 -0
- package/dist/mainnet/models/record-scanner/ownedFilter.d.ts +3 -3
- package/dist/mainnet/models/record-scanner/ownedRecordsResponseFilter.d.cts +42 -0
- package/dist/mainnet/models/record-scanner/ownedRecordsResult.d.cts +13 -0
- package/dist/mainnet/models/record-scanner/recordsFilter.d.cts +35 -0
- package/dist/mainnet/models/record-scanner/recordsFilter.d.ts +2 -2
- package/dist/mainnet/models/record-scanner/recordsResponseFilter.d.cts +42 -0
- package/dist/mainnet/models/record-scanner/registrationRequest.d.cts +13 -0
- package/dist/mainnet/models/record-scanner/registrationResponse.d.cts +13 -0
- package/dist/mainnet/models/record-scanner/registrationResult.d.cts +9 -0
- package/dist/mainnet/models/record-scanner/revokeResult.d.cts +17 -0
- package/dist/mainnet/models/record-scanner/serialNumbersResult.d.cts +15 -0
- package/dist/mainnet/models/record-scanner/statusResponse.d.cts +13 -0
- package/dist/mainnet/models/record-scanner/statusResult.d.cts +13 -0
- package/dist/mainnet/models/record-scanner/tagsResult.d.cts +12 -0
- package/dist/mainnet/models/request.d.cts +14 -0
- package/dist/mainnet/models/request.d.ts +1 -1
- package/dist/mainnet/models/solution.d.cts +14 -0
- package/dist/mainnet/models/transaction/transactionJSON.d.cts +11 -0
- package/dist/mainnet/models/transaction/transactionObject.d.cts +14 -0
- package/dist/mainnet/models/transition/transitionJSON.d.cts +13 -0
- package/dist/mainnet/models/transition/transitionObject.d.cts +15 -0
- package/dist/mainnet/network-client.d.cts +850 -0
- package/dist/mainnet/network-client.d.ts +3 -0
- package/dist/mainnet/node-polyfill.cjs +238 -0
- package/dist/mainnet/node-polyfill.cjs.map +1 -0
- package/dist/mainnet/node-polyfill.d.cts +5 -0
- package/dist/mainnet/node-polyfill.js +1 -1
- package/dist/mainnet/node-polyfill.js.map +1 -1
- package/dist/mainnet/node.cjs +686 -0
- package/dist/mainnet/node.cjs.map +1 -0
- package/dist/mainnet/node.d.cts +3 -0
- package/dist/mainnet/node.js +2 -2
- package/dist/mainnet/polyfill/crypto.d.cts +1 -0
- package/dist/mainnet/polyfill/fetch.d.cts +1 -0
- package/dist/mainnet/polyfill/shared.d.cts +1 -0
- package/dist/mainnet/polyfill/worker.d.cts +1 -0
- package/dist/mainnet/polyfill/xmlhttprequest.d.cts +1 -0
- package/dist/mainnet/program-manager.d.cts +1600 -0
- package/dist/mainnet/program-manager.d.ts +13 -1
- package/dist/mainnet/record-provider.d.cts +274 -0
- package/dist/mainnet/record-scanner.d.cts +371 -0
- package/dist/mainnet/record-scanner.d.ts +9 -6
- package/dist/mainnet/security.d.cts +62 -0
- package/dist/mainnet/security.d.ts +5 -5
- package/dist/mainnet/utils.d.cts +23 -0
- package/dist/mainnet/utils.d.ts +10 -2
- package/dist/mainnet/wasm.d.cts +1 -0
- package/dist/testnet/account.d.cts +347 -0
- package/dist/testnet/browser.cjs +8530 -0
- package/dist/testnet/browser.cjs.map +1 -0
- package/dist/testnet/browser.d.cts +72 -0
- package/dist/testnet/browser.d.ts +3 -3
- package/dist/testnet/browser.js +78 -32
- package/dist/testnet/browser.js.map +1 -1
- package/dist/testnet/constants.d.cts +40 -0
- package/dist/testnet/external-signing.d.cts +76 -0
- package/dist/testnet/integrations/sealance/merkle-tree.d.cts +192 -0
- package/dist/testnet/keys/keystore/error.d.cts +24 -0
- package/dist/testnet/keys/keystore/file.d.cts +177 -0
- package/dist/testnet/keys/keystore/interface.d.cts +161 -0
- package/dist/testnet/keys/provider/interface.d.cts +170 -0
- package/dist/testnet/keys/provider/memory.d.cts +213 -0
- package/dist/testnet/keys/provider/memory.d.ts +6 -2
- package/dist/testnet/keys/provider/offline.d.cts +365 -0
- package/dist/testnet/keys/verifier/interface.d.cts +70 -0
- package/dist/testnet/keys/verifier/memory.d.cts +37 -0
- package/dist/testnet/keys/verifier/memory.d.ts +1 -1
- package/dist/testnet/models/authorization.d.cts +6 -0
- package/dist/testnet/models/authorization.d.ts +2 -2
- package/dist/testnet/models/blockJSON.d.cts +33 -0
- package/dist/testnet/models/confirmed_transaction.d.cts +9 -0
- package/dist/testnet/models/cryptoBoxPubkey.d.cts +4 -0
- package/dist/testnet/models/deployment/deploymentJSON.d.cts +6 -0
- package/dist/testnet/models/deployment/deploymentObject.d.cts +6 -0
- package/dist/testnet/models/encryptedProvingRequest.d.cts +4 -0
- package/dist/testnet/models/execution/executionJSON.d.cts +11 -0
- package/dist/testnet/models/execution/executionObject.d.cts +11 -0
- package/dist/testnet/models/external-signing.d.cts +123 -0
- package/dist/testnet/models/finalizeJSON.d.cts +6 -0
- package/dist/testnet/models/functionInput.d.cts +7 -0
- package/dist/testnet/models/functionObject.d.cts +8 -0
- package/dist/testnet/models/imports.d.cts +7 -0
- package/dist/testnet/models/input/inputJSON.d.cts +10 -0
- package/dist/testnet/models/input/inputObject.d.cts +15 -0
- package/dist/testnet/models/inputID.d.cts +4 -0
- package/dist/testnet/models/keyPair.d.cts +4 -0
- package/dist/testnet/models/output/outputJSON.d.cts +7 -0
- package/dist/testnet/models/output/outputObject.d.cts +18 -0
- package/dist/testnet/models/owner/ownerJSON.d.cts +4 -0
- package/dist/testnet/models/owner/ownerObject.d.cts +5 -0
- package/dist/testnet/models/plaintext/array.d.cts +3 -0
- package/dist/testnet/models/plaintext/literal.d.cts +1 -0
- package/dist/testnet/models/plaintext/plaintext.d.cts +5 -0
- package/dist/testnet/models/plaintext/struct.d.cts +5 -0
- package/dist/testnet/models/provingRequest.d.cts +6 -0
- package/dist/testnet/models/provingRequest.d.ts +1 -1
- package/dist/testnet/models/provingResponse.d.cts +51 -0
- package/dist/testnet/models/ratification.d.cts +4 -0
- package/dist/testnet/models/record-provider/encryptedRecord.d.cts +58 -0
- package/dist/testnet/models/record-provider/ownedRecord.d.cts +60 -0
- package/dist/testnet/models/record-provider/recordSearchParams.d.cts +19 -0
- package/dist/testnet/models/record-scanner/encryptedRecordsResult.d.cts +7 -0
- package/dist/testnet/models/record-scanner/encryptedRegistrationRequest.d.cts +8 -0
- package/dist/testnet/models/record-scanner/error.d.cts +47 -0
- package/dist/testnet/models/record-scanner/error.d.ts +1 -1
- package/dist/testnet/models/record-scanner/ownedFilter.d.cts +22 -0
- package/dist/testnet/models/record-scanner/ownedFilter.d.ts +3 -3
- package/dist/testnet/models/record-scanner/ownedRecordsResponseFilter.d.cts +42 -0
- package/dist/testnet/models/record-scanner/ownedRecordsResult.d.cts +13 -0
- package/dist/testnet/models/record-scanner/recordsFilter.d.cts +35 -0
- package/dist/testnet/models/record-scanner/recordsFilter.d.ts +2 -2
- package/dist/testnet/models/record-scanner/recordsResponseFilter.d.cts +42 -0
- package/dist/testnet/models/record-scanner/registrationRequest.d.cts +13 -0
- package/dist/testnet/models/record-scanner/registrationResponse.d.cts +13 -0
- package/dist/testnet/models/record-scanner/registrationResult.d.cts +9 -0
- package/dist/testnet/models/record-scanner/revokeResult.d.cts +17 -0
- package/dist/testnet/models/record-scanner/serialNumbersResult.d.cts +15 -0
- package/dist/testnet/models/record-scanner/statusResponse.d.cts +13 -0
- package/dist/testnet/models/record-scanner/statusResult.d.cts +13 -0
- package/dist/testnet/models/record-scanner/tagsResult.d.cts +12 -0
- package/dist/testnet/models/request.d.cts +14 -0
- package/dist/testnet/models/request.d.ts +1 -1
- package/dist/testnet/models/solution.d.cts +14 -0
- package/dist/testnet/models/transaction/transactionJSON.d.cts +11 -0
- package/dist/testnet/models/transaction/transactionObject.d.cts +14 -0
- package/dist/testnet/models/transition/transitionJSON.d.cts +13 -0
- package/dist/testnet/models/transition/transitionObject.d.cts +15 -0
- package/dist/testnet/network-client.d.cts +850 -0
- package/dist/testnet/network-client.d.ts +3 -0
- package/dist/testnet/node-polyfill.cjs +238 -0
- package/dist/testnet/node-polyfill.cjs.map +1 -0
- package/dist/testnet/node-polyfill.d.cts +5 -0
- package/dist/testnet/node-polyfill.js +1 -1
- package/dist/testnet/node-polyfill.js.map +1 -1
- package/dist/testnet/node.cjs +686 -0
- package/dist/testnet/node.cjs.map +1 -0
- package/dist/testnet/node.d.cts +3 -0
- package/dist/testnet/node.js +2 -2
- package/dist/testnet/polyfill/crypto.d.cts +1 -0
- package/dist/testnet/polyfill/fetch.d.cts +1 -0
- package/dist/testnet/polyfill/shared.d.cts +1 -0
- package/dist/testnet/polyfill/worker.d.cts +1 -0
- package/dist/testnet/polyfill/xmlhttprequest.d.cts +1 -0
- package/dist/testnet/program-manager.d.cts +1600 -0
- package/dist/testnet/program-manager.d.ts +13 -1
- package/dist/testnet/record-provider.d.cts +274 -0
- package/dist/testnet/record-scanner.d.cts +371 -0
- package/dist/testnet/record-scanner.d.ts +9 -6
- package/dist/testnet/security.d.cts +62 -0
- package/dist/testnet/security.d.ts +5 -5
- package/dist/testnet/utils.d.cts +23 -0
- package/dist/testnet/utils.d.ts +10 -2
- package/dist/testnet/wasm.d.cts +1 -0
- package/package.json +51 -9
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TransportFunction } from "./utils.js";
|
|
2
|
+
import { EncryptedRecord } from "./models/record-provider/encryptedRecord.js";
|
|
2
3
|
import { CryptoBoxPubKey } from "./models/cryptoBoxPubkey.js";
|
|
3
|
-
import { OwnedFilter } from "./models/record-scanner/ownedFilter";
|
|
4
|
-
import { OwnedRecord } from "./models/record-provider/ownedRecord";
|
|
5
|
-
import { RecordProvider } from "./record-provider";
|
|
6
|
-
import { Field, ViewKey } from "./wasm";
|
|
7
|
-
import { RecordsFilter } from "./models/record-scanner/recordsFilter";
|
|
4
|
+
import { OwnedFilter } from "./models/record-scanner/ownedFilter.js";
|
|
5
|
+
import { OwnedRecord } from "./models/record-provider/ownedRecord.js";
|
|
6
|
+
import { RecordProvider } from "./record-provider.js";
|
|
7
|
+
import { Field, ViewKey } from "./wasm.js";
|
|
8
|
+
import { RecordsFilter } from "./models/record-scanner/recordsFilter.js";
|
|
8
9
|
import { RegisterResult } from "./models/record-scanner/registrationResult.js";
|
|
9
10
|
import { RevokeResult } from "./models/record-scanner/revokeResult.js";
|
|
10
11
|
import { TagsResult } from "./models/record-scanner/tagsResult.js";
|
|
@@ -49,6 +50,7 @@ export interface RecordScannerOptions {
|
|
|
49
50
|
cacheViewKeysOnRegister?: boolean;
|
|
50
51
|
autoReRegister?: boolean;
|
|
51
52
|
decryptEnabled?: boolean;
|
|
53
|
+
transport?: TransportFunction;
|
|
52
54
|
}
|
|
53
55
|
/**
|
|
54
56
|
* RecordScanner is a RecordProvider implementation that uses Provable's confidential record scanning service to find
|
|
@@ -104,6 +106,7 @@ declare class RecordScanner implements RecordProvider {
|
|
|
104
106
|
private viewKeys?;
|
|
105
107
|
private autoReRegister?;
|
|
106
108
|
private decryptEnabled?;
|
|
109
|
+
transport: TransportFunction;
|
|
107
110
|
account?: Account | undefined;
|
|
108
111
|
/**
|
|
109
112
|
* @param {RecordScannerOptions} options Configuration for the record scanner.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { ViewKey, Authorization, ProvingRequest } from "./wasm.js";
|
|
2
|
+
/**
|
|
3
|
+
* Encrypt an authorization with a cryptobox X25519 public key (libsodium-compatible wire format).
|
|
4
|
+
*
|
|
5
|
+
* @param {string} publicKey The cryptobox X25519 public key to encrypt with (encoded in RFC 4648 standard Base64).
|
|
6
|
+
* @param {Authorization} authorization the authorization to encrypt.
|
|
7
|
+
*
|
|
8
|
+
* @returns {string} the encrypted authorization in RFC 4648 standard Base64.
|
|
9
|
+
*/
|
|
10
|
+
export declare function encryptAuthorization(publicKey: string, authorization: Authorization): string;
|
|
11
|
+
/**
|
|
12
|
+
* Encrypt a ProvingRequest with a cryptobox X25519 public key (libsodium-compatible wire format).
|
|
13
|
+
*
|
|
14
|
+
* @param {string} publicKey The cryptobox X25519 public key to encrypt with (encoded in RFC 4648 standard Base64).
|
|
15
|
+
* @param {ProvingRequest} provingRequest the ProvingRequest to encrypt.
|
|
16
|
+
*
|
|
17
|
+
* @returns {string} the encrypted ProvingRequest in RFC 4648 standard Base64.
|
|
18
|
+
*/
|
|
19
|
+
export declare function encryptProvingRequest(publicKey: string, provingRequest: ProvingRequest): string;
|
|
20
|
+
/**
|
|
21
|
+
* Encrypt a view key with a cryptobox X25519 public key (libsodium-compatible wire format).
|
|
22
|
+
*
|
|
23
|
+
* @param {string} publicKey The cryptobox X25519 public key to encrypt with (encoded in RFC 4648 standard Base64).
|
|
24
|
+
* @param {ViewKey} viewKey the view key to encrypt.
|
|
25
|
+
*
|
|
26
|
+
* @returns {string} the encrypted view key in RFC 4648 standard Base64.
|
|
27
|
+
*/
|
|
28
|
+
export declare function encryptViewKey(publicKey: string, viewKey: ViewKey): string;
|
|
29
|
+
/**
|
|
30
|
+
* Encrypt a record scanner registration request.
|
|
31
|
+
*
|
|
32
|
+
* @param {string} publicKey The cryptobox X25519 public key to encrypt with (encoded in RFC 4648 standard Base64).
|
|
33
|
+
* @param {ViewKey} viewKey the view key to encrypt.
|
|
34
|
+
* @param {number} start the start height of the registration request.
|
|
35
|
+
*
|
|
36
|
+
* @returns {string} the encrypted view key in RFC 4648 standard Base64.
|
|
37
|
+
*/
|
|
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;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ViewKey, Authorization, ProvingRequest } from "
|
|
1
|
+
import { ViewKey, Authorization, ProvingRequest } from "./wasm.js";
|
|
2
2
|
/**
|
|
3
|
-
* Encrypt an authorization with a
|
|
3
|
+
* Encrypt an authorization with a cryptobox X25519 public key (libsodium-compatible wire format).
|
|
4
4
|
*
|
|
5
5
|
* @param {string} publicKey The cryptobox X25519 public key to encrypt with (encoded in RFC 4648 standard Base64).
|
|
6
6
|
* @param {Authorization} authorization the authorization to encrypt.
|
|
@@ -9,16 +9,16 @@ import { ViewKey, Authorization, ProvingRequest } from "@provablehq/wasm";
|
|
|
9
9
|
*/
|
|
10
10
|
export declare function encryptAuthorization(publicKey: string, authorization: Authorization): string;
|
|
11
11
|
/**
|
|
12
|
-
* Encrypt a ProvingRequest with a
|
|
12
|
+
* Encrypt a ProvingRequest with a cryptobox X25519 public key (libsodium-compatible wire format).
|
|
13
13
|
*
|
|
14
14
|
* @param {string} publicKey The cryptobox X25519 public key to encrypt with (encoded in RFC 4648 standard Base64).
|
|
15
|
-
* @param {
|
|
15
|
+
* @param {ProvingRequest} provingRequest the ProvingRequest to encrypt.
|
|
16
16
|
*
|
|
17
17
|
* @returns {string} the encrypted ProvingRequest in RFC 4648 standard Base64.
|
|
18
18
|
*/
|
|
19
19
|
export declare function encryptProvingRequest(publicKey: string, provingRequest: ProvingRequest): string;
|
|
20
20
|
/**
|
|
21
|
-
* Encrypt a view key with a
|
|
21
|
+
* Encrypt a view key with a cryptobox X25519 public key (libsodium-compatible wire format).
|
|
22
22
|
*
|
|
23
23
|
* @param {string} publicKey The cryptobox X25519 public key to encrypt with (encoded in RFC 4648 standard Base64).
|
|
24
24
|
* @param {ViewKey} viewKey the view key to encrypt.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare function isNode(): boolean;
|
|
2
|
+
export declare function environment(): "chrome" | "firefox" | "safari" | "edge" | "opera" | "browser" | "node" | "unknown";
|
|
3
|
+
export declare function logAndThrow(message: string): never;
|
|
4
|
+
/**
|
|
5
|
+
* A function matching the global `fetch` signature. Consumers can provide
|
|
6
|
+
* their own implementation to inject custom HTTP agents, mTLS certificates,
|
|
7
|
+
* timeouts, or logging.
|
|
8
|
+
*/
|
|
9
|
+
export type TransportFunction = typeof fetch;
|
|
10
|
+
/** Default transport — wraps global fetch to avoid illegal-invocation errors in browsers. */
|
|
11
|
+
export declare const defaultTransport: TransportFunction;
|
|
12
|
+
export declare function parseJSON(json: string): any;
|
|
13
|
+
export declare function get(url: URL | string, options?: RequestInit, transport?: TransportFunction): Promise<Response>;
|
|
14
|
+
export declare function post(url: URL | string, options: RequestInit, transport?: TransportFunction): Promise<Response>;
|
|
15
|
+
type RetryOptions = {
|
|
16
|
+
maxAttempts?: number;
|
|
17
|
+
baseDelay?: number;
|
|
18
|
+
jitter?: number;
|
|
19
|
+
retryOnStatus?: number[];
|
|
20
|
+
shouldRetry?: (err: any) => boolean;
|
|
21
|
+
};
|
|
22
|
+
export declare function retryWithBackoff<T>(fn: () => Promise<T>, { maxAttempts, baseDelay, jitter, retryOnStatus, shouldRetry, }?: RetryOptions): Promise<T>;
|
|
23
|
+
export {};
|
package/dist/testnet/utils.d.ts
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
export declare function isNode(): boolean;
|
|
2
2
|
export declare function environment(): "chrome" | "firefox" | "safari" | "edge" | "opera" | "browser" | "node" | "unknown";
|
|
3
3
|
export declare function logAndThrow(message: string): never;
|
|
4
|
+
/**
|
|
5
|
+
* A function matching the global `fetch` signature. Consumers can provide
|
|
6
|
+
* their own implementation to inject custom HTTP agents, mTLS certificates,
|
|
7
|
+
* timeouts, or logging.
|
|
8
|
+
*/
|
|
9
|
+
export type TransportFunction = typeof fetch;
|
|
10
|
+
/** Default transport — wraps global fetch to avoid illegal-invocation errors in browsers. */
|
|
11
|
+
export declare const defaultTransport: TransportFunction;
|
|
4
12
|
export declare function parseJSON(json: string): any;
|
|
5
|
-
export declare function get(url: URL | string, options?: RequestInit): Promise<Response>;
|
|
6
|
-
export declare function post(url: URL | string, options: RequestInit): Promise<Response>;
|
|
13
|
+
export declare function get(url: URL | string, options?: RequestInit, transport?: TransportFunction): Promise<Response>;
|
|
14
|
+
export declare function post(url: URL | string, options: RequestInit, transport?: TransportFunction): Promise<Response>;
|
|
7
15
|
type RetryOptions = {
|
|
8
16
|
maxAttempts?: number;
|
|
9
17
|
baseDelay?: number;
|
|
@@ -0,0 +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, OfflineQuery, 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";
|
package/package.json
CHANGED
|
@@ -1,29 +1,66 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@provablehq/sdk",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.4",
|
|
4
4
|
"description": "A Software Development Kit (SDK) for Zero-Knowledge Transactions",
|
|
5
5
|
"collaborators": [
|
|
6
6
|
"The Provable Team"
|
|
7
7
|
],
|
|
8
8
|
"license": "GPL-3.0",
|
|
9
9
|
"type": "module",
|
|
10
|
-
"main": "./dist/testnet/node.
|
|
10
|
+
"main": "./dist/testnet/node.cjs",
|
|
11
|
+
"module": "./dist/testnet/node.js",
|
|
11
12
|
"browser": "./dist/testnet/browser.js",
|
|
12
13
|
"exports": {
|
|
13
14
|
".": {
|
|
14
|
-
"node":
|
|
15
|
+
"node": {
|
|
16
|
+
"types": {
|
|
17
|
+
"import": "./dist/testnet/node.d.ts",
|
|
18
|
+
"require": "./dist/testnet/node.d.cts"
|
|
19
|
+
},
|
|
20
|
+
"import": "./dist/testnet/node.js",
|
|
21
|
+
"require": "./dist/testnet/node.cjs",
|
|
22
|
+
"default": "./dist/testnet/node.js"
|
|
23
|
+
},
|
|
24
|
+
"types": "./dist/testnet/browser.d.ts",
|
|
15
25
|
"default": "./dist/testnet/browser.js"
|
|
16
26
|
},
|
|
17
27
|
"./testnet.js": {
|
|
18
|
-
"node":
|
|
28
|
+
"node": {
|
|
29
|
+
"types": {
|
|
30
|
+
"import": "./dist/testnet/node.d.ts",
|
|
31
|
+
"require": "./dist/testnet/node.d.cts"
|
|
32
|
+
},
|
|
33
|
+
"import": "./dist/testnet/node.js",
|
|
34
|
+
"require": "./dist/testnet/node.cjs",
|
|
35
|
+
"default": "./dist/testnet/node.js"
|
|
36
|
+
},
|
|
37
|
+
"types": "./dist/testnet/browser.d.ts",
|
|
19
38
|
"default": "./dist/testnet/browser.js"
|
|
20
39
|
},
|
|
21
40
|
"./mainnet.js": {
|
|
22
|
-
"node":
|
|
41
|
+
"node": {
|
|
42
|
+
"types": {
|
|
43
|
+
"import": "./dist/mainnet/node.d.ts",
|
|
44
|
+
"require": "./dist/mainnet/node.d.cts"
|
|
45
|
+
},
|
|
46
|
+
"import": "./dist/mainnet/node.js",
|
|
47
|
+
"require": "./dist/mainnet/node.cjs",
|
|
48
|
+
"default": "./dist/mainnet/node.js"
|
|
49
|
+
},
|
|
50
|
+
"types": "./dist/mainnet/browser.d.ts",
|
|
23
51
|
"default": "./dist/mainnet/browser.js"
|
|
24
52
|
},
|
|
25
53
|
"./dynamic.js": {
|
|
26
|
-
"node":
|
|
54
|
+
"node": {
|
|
55
|
+
"types": {
|
|
56
|
+
"import": "./dist/dynamic/node.d.ts",
|
|
57
|
+
"require": "./dist/dynamic/node.d.cts"
|
|
58
|
+
},
|
|
59
|
+
"import": "./dist/dynamic/node.js",
|
|
60
|
+
"require": "./dist/dynamic/node.cjs",
|
|
61
|
+
"default": "./dist/dynamic/node.js"
|
|
62
|
+
},
|
|
63
|
+
"types": "./dist/dynamic/browser.d.ts",
|
|
27
64
|
"default": "./dist/dynamic/browser.js"
|
|
28
65
|
}
|
|
29
66
|
},
|
|
@@ -34,7 +71,10 @@
|
|
|
34
71
|
],
|
|
35
72
|
"scripts": {
|
|
36
73
|
"build": "rimraf dist && rollup -c rollup.config.js",
|
|
37
|
-
"test": "rimraf tmp && rollup -c rollup.test.js && mocha tmp/**/*.test.js --timeout 60000 && RUN_SKIPPED=true mocha tmp/**/wasm.test.js --timeout 60000 --grep Consensus"
|
|
74
|
+
"test": "rimraf tmp && rollup -c rollup.test.js && mocha tmp/**/*.test.js --timeout 60000 && RUN_SKIPPED=true mocha tmp/**/wasm.test.js --timeout 60000 --grep Consensus",
|
|
75
|
+
"test:attw": "yarn pack --filename /tmp/provablehq-sdk-attw.tgz && attw /tmp/provablehq-sdk-attw.tgz --profile=node16",
|
|
76
|
+
"test:cjs": "node tests/cjs-smoke/smoke.cjs",
|
|
77
|
+
"test:cjs:pack": "node tests/cjs-smoke/pack-install.cjs"
|
|
38
78
|
},
|
|
39
79
|
"repository": {
|
|
40
80
|
"type": "git",
|
|
@@ -51,15 +91,16 @@
|
|
|
51
91
|
},
|
|
52
92
|
"homepage": "https://github.com/ProvableHQ/sdk#readme",
|
|
53
93
|
"dependencies": {
|
|
54
|
-
"@provablehq/wasm": "^0.10.
|
|
94
|
+
"@provablehq/wasm": "^0.10.4",
|
|
55
95
|
"@scure/base": "^2.0.0",
|
|
96
|
+
"@serenity-kit/noble-sodium": "0.2.3",
|
|
56
97
|
"comlink": "^4.4.2",
|
|
57
98
|
"core-js": "^3.40.0",
|
|
58
|
-
"libsodium-wrappers": "^0.8.2",
|
|
59
99
|
"mime": "^4.0.6",
|
|
60
100
|
"xmlhttprequest-ssl": "^4.0.0"
|
|
61
101
|
},
|
|
62
102
|
"devDependencies": {
|
|
103
|
+
"@arethetypeswrong/cli": "^0.18.2",
|
|
63
104
|
"@rollup/plugin-replace": "^6.0.2",
|
|
64
105
|
"@types/chai": "^5.0.1",
|
|
65
106
|
"@types/mocha": "^10.0.10",
|
|
@@ -76,6 +117,7 @@
|
|
|
76
117
|
"glob": "^11.0.1",
|
|
77
118
|
"jsdoc": "^4.0.4",
|
|
78
119
|
"kis-jsdoc-plugin": "^2.2.1",
|
|
120
|
+
"libsodium-wrappers": "^0.8.2",
|
|
79
121
|
"mocha": "^11.1.0",
|
|
80
122
|
"prettier": "3.4.2",
|
|
81
123
|
"rimraf": "^6.0.1",
|