@provablehq/sdk 0.9.16-rc → 0.9.17
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/mainnet/account.d.ts +18 -3
- package/dist/mainnet/browser.d.ts +26 -7
- package/dist/mainnet/browser.js +1198 -248
- package/dist/mainnet/browser.js.map +1 -1
- package/dist/mainnet/keys/keystore/error.d.ts +23 -0
- package/dist/mainnet/keys/keystore/file.d.ts +207 -13
- package/dist/mainnet/keys/keystore/interface.d.ts +85 -0
- package/dist/mainnet/keys/provider/interface.d.ts +170 -0
- package/dist/{testnet/keys/provider/function-key-provider.d.ts → mainnet/keys/provider/memory.d.ts} +14 -180
- package/dist/{testnet/keys/provider/offline-key-provider.d.ts → mainnet/keys/provider/offline.d.ts} +4 -4
- package/dist/mainnet/keys/verifier/interface.d.ts +70 -0
- package/dist/mainnet/keys/verifier/memory.d.ts +37 -0
- package/dist/mainnet/models/cryptoBoxPubkey.d.ts +4 -0
- package/dist/mainnet/models/encryptedProvingRequest.d.ts +4 -0
- package/dist/mainnet/models/provingResponse.d.ts +48 -2
- package/dist/mainnet/models/record-scanner/encryptedRecordsResult.d.ts +7 -0
- package/dist/mainnet/models/record-scanner/encryptedRegistrationRequest.d.ts +8 -0
- package/dist/mainnet/models/record-scanner/error.d.ts +47 -0
- package/dist/mainnet/models/record-scanner/ownedFilter.d.ts +0 -2
- package/dist/mainnet/models/record-scanner/ownedRecordsResult.d.ts +13 -0
- package/dist/mainnet/models/record-scanner/registrationResponse.d.ts +0 -2
- package/dist/mainnet/models/record-scanner/registrationResult.d.ts +9 -0
- package/dist/mainnet/models/record-scanner/revokeResult.d.ts +17 -0
- package/dist/mainnet/models/record-scanner/serialNumbersResult.d.ts +15 -0
- package/dist/mainnet/models/record-scanner/statusResult.d.ts +13 -0
- package/dist/mainnet/models/record-scanner/tagsResult.d.ts +12 -0
- package/dist/mainnet/network-client.d.ts +81 -35
- package/dist/mainnet/node.js +345 -75
- package/dist/mainnet/node.js.map +1 -1
- package/dist/mainnet/program-manager.d.ts +54 -48
- package/dist/mainnet/record-provider.d.ts +7 -7
- package/dist/mainnet/record-scanner.d.ts +247 -31
- package/dist/mainnet/security.d.ts +38 -0
- package/dist/mainnet/utils.d.ts +1 -0
- package/dist/testnet/account.d.ts +18 -3
- package/dist/testnet/browser.d.ts +26 -7
- package/dist/testnet/browser.js +1198 -248
- package/dist/testnet/browser.js.map +1 -1
- package/dist/testnet/keys/keystore/error.d.ts +23 -0
- package/dist/testnet/keys/keystore/file.d.ts +207 -13
- package/dist/testnet/keys/keystore/interface.d.ts +85 -0
- package/dist/testnet/keys/provider/interface.d.ts +170 -0
- package/dist/{mainnet/keys/provider/function-key-provider.d.ts → testnet/keys/provider/memory.d.ts} +14 -180
- package/dist/{mainnet/keys/provider/offline-key-provider.d.ts → testnet/keys/provider/offline.d.ts} +4 -4
- package/dist/testnet/keys/verifier/interface.d.ts +70 -0
- package/dist/testnet/keys/verifier/memory.d.ts +37 -0
- package/dist/testnet/models/cryptoBoxPubkey.d.ts +4 -0
- package/dist/testnet/models/encryptedProvingRequest.d.ts +4 -0
- package/dist/testnet/models/provingResponse.d.ts +48 -2
- package/dist/testnet/models/record-scanner/encryptedRecordsResult.d.ts +7 -0
- package/dist/testnet/models/record-scanner/encryptedRegistrationRequest.d.ts +8 -0
- package/dist/testnet/models/record-scanner/error.d.ts +47 -0
- package/dist/testnet/models/record-scanner/ownedFilter.d.ts +0 -2
- package/dist/testnet/models/record-scanner/ownedRecordsResult.d.ts +13 -0
- package/dist/testnet/models/record-scanner/registrationResponse.d.ts +0 -2
- package/dist/testnet/models/record-scanner/registrationResult.d.ts +9 -0
- package/dist/testnet/models/record-scanner/revokeResult.d.ts +17 -0
- package/dist/testnet/models/record-scanner/serialNumbersResult.d.ts +15 -0
- package/dist/testnet/models/record-scanner/statusResult.d.ts +13 -0
- package/dist/testnet/models/record-scanner/tagsResult.d.ts +12 -0
- package/dist/testnet/network-client.d.ts +81 -35
- package/dist/testnet/node.js +345 -75
- package/dist/testnet/node.js.map +1 -1
- package/dist/testnet/program-manager.d.ts +54 -48
- package/dist/testnet/record-provider.d.ts +7 -7
- package/dist/testnet/record-scanner.d.ts +247 -31
- package/dist/testnet/security.d.ts +38 -0
- package/dist/testnet/utils.d.ts +1 -0
- package/package.json +4 -3
- package/dist/mainnet/keys/keystore/keystore.d.ts +0 -81
- package/dist/mainnet/keys/keystore/memory.d.ts +0 -8
- package/dist/testnet/keys/keystore/keystore.d.ts +0 -81
- package/dist/testnet/keys/keystore/memory.d.ts +0 -8
|
@@ -52,6 +52,21 @@ export declare class Account {
|
|
|
52
52
|
* const account = Account.fromCiphertext(process.env.ciphertext, process.env.password);
|
|
53
53
|
*/
|
|
54
54
|
static fromCiphertext(ciphertext: PrivateKeyCiphertext | string, password: string): Account;
|
|
55
|
+
/**
|
|
56
|
+
* Validates whether the given input is a valid Aleo address.
|
|
57
|
+
* @param {string | Uint8Array} address The address to validate, either as a string or bytes
|
|
58
|
+
* @returns {boolean} True if the address is valid, false otherwise
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* import { Account } from "@provablehq/sdk/testnet.js";
|
|
62
|
+
*
|
|
63
|
+
* const isValid = Account.isValidAddress("aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px");
|
|
64
|
+
* console.log(isValid); // true
|
|
65
|
+
*
|
|
66
|
+
* const isInvalid = Account.isValidAddress("invalid_address");
|
|
67
|
+
* console.log(isInvalid); // false
|
|
68
|
+
*/
|
|
69
|
+
static isValidAddress(address: string | Uint8Array): boolean;
|
|
55
70
|
/**
|
|
56
71
|
* Creates a PrivateKey from the provided parameters.
|
|
57
72
|
* @param {AccountParam} params The parameters containing either a private key string or a seed
|
|
@@ -144,7 +159,7 @@ export declare class Account {
|
|
|
144
159
|
* import { AleoNetworkClient, Account } from "@provablehq/sdk/testnet.js";
|
|
145
160
|
*
|
|
146
161
|
* // Create a connection to the Aleo network and an account
|
|
147
|
-
* const networkClient = new AleoNetworkClient("https://api.
|
|
162
|
+
* const networkClient = new AleoNetworkClient("https://api.provable.com/v2");
|
|
148
163
|
* const account = Account.fromCiphertext(process.env.ciphertext!, process.env.password!);
|
|
149
164
|
*
|
|
150
165
|
* // Get the record ciphertexts from a transaction.
|
|
@@ -171,7 +186,7 @@ export declare class Account {
|
|
|
171
186
|
* import { AleoNetworkClient, Account } from "@provablehq/sdk/testnet.js";
|
|
172
187
|
*
|
|
173
188
|
* // Create a connection to the Aleo network and an account
|
|
174
|
-
* const networkClient = new AleoNetworkClient("https://api.
|
|
189
|
+
* const networkClient = new AleoNetworkClient("https://api.provable.com/v2");
|
|
175
190
|
* const account = Account.fromCiphertext(process.env.ciphertext!, process.env.password!);
|
|
176
191
|
*
|
|
177
192
|
* // Get the record ciphertexts from a transaction.
|
|
@@ -227,7 +242,7 @@ export declare class Account {
|
|
|
227
242
|
* import { AleoNetworkClient, Account } from "@provablehq/sdk/testnet.js";
|
|
228
243
|
*
|
|
229
244
|
* // Create a connection to the Aleo network and an account
|
|
230
|
-
* const networkClient = new AleoNetworkClient("https://api.
|
|
245
|
+
* const networkClient = new AleoNetworkClient("https://api.provable.com/v2");
|
|
231
246
|
* const account = Account.fromCiphertext(process.env.ciphertext!, process.env.password!);
|
|
232
247
|
*
|
|
233
248
|
* // Get the record ciphertexts from a transaction and check ownership of them.
|
|
@@ -4,8 +4,10 @@ import { AleoNetworkClient, ProgramImports } from "./network-client.js";
|
|
|
4
4
|
import { BlockJSON, Header, Metadata } from "./models/blockJSON.js";
|
|
5
5
|
import { CachedKeyPair, FunctionKeyPair } from "./models/keyPair.js";
|
|
6
6
|
import { ConfirmedTransactionJSON } from "./models/confirmed_transaction.js";
|
|
7
|
+
import { CryptoBoxPubKey } from "./models/cryptoBoxPubkey.js";
|
|
7
8
|
import { DeploymentJSON, VerifyingKeys } from "./models/deployment/deploymentJSON.js";
|
|
8
9
|
import { DeploymentObject } from "./models/deployment/deploymentObject.js";
|
|
10
|
+
import { EncryptedProvingRequest } from "./models/encryptedProvingRequest.js";
|
|
9
11
|
import { EncryptedRecord } from "./models/record-provider/encryptedRecord.js";
|
|
10
12
|
import { ExecutionJSON, FeeExecutionJSON } from "./models/execution/executionJSON.js";
|
|
11
13
|
import { ExecutionObject, FeeExecutionObject } from "./models/execution/executionObject.js";
|
|
@@ -25,22 +27,37 @@ import { PlaintextLiteral } from "./models/plaintext/literal.js";
|
|
|
25
27
|
import { PlaintextObject } from "./models/plaintext/plaintext.js";
|
|
26
28
|
import { PlaintextStruct } from "./models/plaintext/struct.js";
|
|
27
29
|
import { ProvingRequestJSON } from "./models/provingRequest.js";
|
|
28
|
-
import { ProvingResponse } from "./models/provingResponse.js";
|
|
30
|
+
import { ProvingResponse, BroadcastResponse, BroadcastResult, ProvingResult, ProvingFailure, ProvingSuccess, ProveApiErrorBody, ProvingRequestError, isProvingResponse, isProveApiErrorBody } from "./models/provingResponse.js";
|
|
29
31
|
import { RatificationJSON } from "./models/ratification.js";
|
|
32
|
+
import { EncryptedRegistrationRequest } from "./models/record-scanner/encryptedRegistrationRequest.js";
|
|
33
|
+
import { EncryptedRecordsResult, EncryptedRecordsSuccess } from "./models/record-scanner/encryptedRecordsResult.js";
|
|
34
|
+
import { DecryptionNotEnabledError, RecordNotFoundError, RecordScannerErrorBody, RecordScannerFailure, RecordScannerRequestError, UUIDError, ViewKeyNotStoredError } from "./models/record-scanner/error.js";
|
|
35
|
+
import { OwnedRecordsResult, OwnedRecordsSuccess } from "./models/record-scanner/ownedRecordsResult.js";
|
|
36
|
+
import { OwnedRecordsResponseFilter } from "./models/record-scanner/ownedRecordsResponseFilter.js";
|
|
37
|
+
import { RegisterResult, RegisterSuccess } from "./models/record-scanner/registrationResult.js";
|
|
38
|
+
import { RegistrationRequest } from "./models/record-scanner/registrationRequest.js";
|
|
39
|
+
import { RegistrationResponse } from "./models/record-scanner/registrationResponse.js";
|
|
40
|
+
import { RevokeResult, RevokeSuccess, RevokeResponse } from "./models/record-scanner/revokeResult.js";
|
|
30
41
|
import { RecordsFilter } from "./models/record-scanner/recordsFilter.js";
|
|
31
42
|
import { RecordsResponseFilter } from "./models/record-scanner/recordsResponseFilter.js";
|
|
43
|
+
import { SerialNumbersResult, SerialNumbersSuccess } from "./models/record-scanner/serialNumbersResult.js";
|
|
44
|
+
import { StatusResponse } from "./models/record-scanner/statusResponse.js";
|
|
45
|
+
import { StatusResult, StatusSuccess } from "./models/record-scanner/statusResult.js";
|
|
46
|
+
import { TagsResult, TagsSuccess } from "./models/record-scanner/tagsResult.js";
|
|
32
47
|
import { RecordSearchParams } from "./models/record-provider/recordSearchParams.js";
|
|
33
48
|
import { SolutionsJSON, SolutionJSON, PartialSolutionJSON } from "./models/solution.js";
|
|
34
49
|
import { TransactionJSON } from "./models/transaction/transactionJSON.js";
|
|
35
50
|
import { TransactionObject } from "./models/transaction/transactionObject.js";
|
|
36
51
|
import { TransitionJSON } from "./models/transition/transitionJSON.js";
|
|
37
52
|
import { TransitionObject } from "./models/transition/transitionObject.js";
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
53
|
+
import { FunctionKeyProvider, KeySearchParams } from "./keys/provider/interface.js";
|
|
54
|
+
import { AleoKeyProvider, AleoKeyProviderParams, AleoKeyProviderInitParams } from "./keys/provider/memory.js";
|
|
55
|
+
import { KeyFingerprint, KeyMetadata, KeyVerificationError, KeyVerifier, sha256Hex } from "./keys/verifier/interface.js";
|
|
56
|
+
import { MemKeyVerifier } from "./keys/verifier/memory.js";
|
|
57
|
+
import { InvalidLocatorError, InvalidLocatorReason, KeyLocator, KeyStore } from "./keys/keystore/interface.js";
|
|
58
|
+
import { OfflineKeyProvider, OfflineSearchParams } from "./keys/provider/offline.js";
|
|
42
59
|
import { BlockHeightSearch, NetworkRecordProvider, RecordProvider } from "./record-provider.js";
|
|
43
|
-
import { RecordScanner } from "./record-scanner.js";
|
|
60
|
+
import { RecordScanner, RecordScannerJWTData, RecordScannerOptions } from "./record-scanner.js";
|
|
44
61
|
import { SealanceMerkleTree } from "./integrations/sealance/merkle-tree.js";
|
|
45
62
|
declare function initializeWasm(): Promise<void>;
|
|
46
63
|
export { ProgramManager, ProvingRequestOptions, ExecuteOptions, FeeAuthorizationOptions, AuthorizationOptions } from "./program-manager.js";
|
|
@@ -48,4 +65,6 @@ export { logAndThrow } from "./utils.js";
|
|
|
48
65
|
export { Address, Authorization, Boolean, BHP256, BHP512, BHP768, BHP1024, Ciphertext, ComputeKey, 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, ProvingKey, ProvingRequest, RecordCiphertext, RecordPlaintext, Signature, Scalar, Transaction, Transition, U8, U16, U32, U64, U128, VerifyingKey, ViewKey, initThreadPool, getOrInitConsensusVersionTestHeights, verifyFunctionExecution, } from "./wasm.js";
|
|
49
66
|
export { initializeWasm };
|
|
50
67
|
export { Key, CREDITS_PROGRAM_KEYS, KEY_STORE, PRIVATE_TRANSFER, PRIVATE_TO_PUBLIC_TRANSFER, PRIVATE_TRANSFER_TYPES, PUBLIC_TRANSFER, PUBLIC_TRANSFER_AS_SIGNER, PUBLIC_TO_PRIVATE_TRANSFER, RECORD_DOMAIN, VALID_TRANSFER_TYPES, } from "./constants.js";
|
|
51
|
-
export { Account, AleoKeyProvider, AleoKeyProviderParams, AleoKeyProviderInitParams, AleoNetworkClient, BlockJSON, BlockHeightSearch, CachedKeyPair, ConfirmedTransactionJSON, DeploymentJSON, DeploymentObject, EncryptedRecord, ExecutionJSON, ExecutionObject, FeeExecutionJSON, FeeExecutionObject, FinalizeJSON, FunctionInput, FunctionObject, FunctionKeyPair, FunctionKeyProvider, Header, ImportedPrograms, ImportedVerifyingKeys, InputJSON, InputObject, KeyStore, KeySearchParams, Metadata, NetworkRecordProvider, OfflineKeyProvider, OfflineSearchParams, OutputJSON, OutputObject, OwnedFilter, OwnedRecord, OwnerJSON, PartialSolutionJSON, PlaintextArray, PlaintextLiteral, PlaintextObject, PlaintextStruct, ProgramImports,
|
|
68
|
+
export { Account, AleoKeyProvider, AleoKeyProviderParams, AleoKeyProviderInitParams, AleoNetworkClient, BlockJSON, BlockHeightSearch, BroadcastResponse, BroadcastResult, CachedKeyPair, ConfirmedTransactionJSON, CryptoBoxPubKey, DeploymentJSON, DeploymentObject, EncryptedProvingRequest, EncryptedRecord, EncryptedRegistrationRequest, EncryptedRecordsResult, EncryptedRecordsSuccess, ExecutionJSON, ExecutionObject, FeeExecutionJSON, FeeExecutionObject, FinalizeJSON, FunctionInput, FunctionObject, FunctionKeyPair, FunctionKeyProvider, Header, isProvingResponse, isProveApiErrorBody, ImportedPrograms, ImportedVerifyingKeys, InputJSON, InputObject, InvalidLocatorError, InvalidLocatorReason, KeyFingerprint, KeyLocator, KeyMetadata, KeyStore, KeyVerificationError, KeyVerifier, MemKeyVerifier, KeySearchParams, Metadata, NetworkRecordProvider, OfflineKeyProvider, OfflineSearchParams, OutputJSON, OutputObject, OwnedFilter, OwnedRecord, OwnedRecordsResult, OwnedRecordsResponseFilter, OwnedRecordsSuccess, OwnerJSON, PartialSolutionJSON, PlaintextArray, PlaintextLiteral, PlaintextObject, PlaintextStruct, ProgramImports, ProveApiErrorBody, ProvingFailure, ProvingRequestError, ProvingRequestJSON, ProvingResult, ProvingSuccess, ProvingResponse, RatificationJSON, RecordsFilter, RecordsResponseFilter, RecordProvider, RecordScanner, RecordScannerErrorBody, RecordScannerFailure, RecordScannerJWTData, RecordScannerOptions, DecryptionNotEnabledError, RecordNotFoundError, RecordScannerRequestError, ViewKeyNotStoredError, RecordSearchParams, RegisterResult, RegisterSuccess, RegistrationRequest, RegistrationResponse, RevokeResult, RevokeSuccess, RevokeResponse, SealanceMerkleTree, SerialNumbersResult, SerialNumbersSuccess, sha256Hex, SolutionJSON, SolutionsJSON, StatusResponse, StatusResult, StatusSuccess, TagsResult, TagsSuccess, TransactionJSON, TransactionObject, TransitionJSON, TransitionObject, UUIDError, VerifyingKeys, };
|
|
69
|
+
export { KeyVerificationError as ChecksumMismatchError, KeyVerifier as FunctionKeyVerifier, } from "./keys/verifier/interface.js";
|
|
70
|
+
export { encryptAuthorization, encryptProvingRequest, encryptViewKey, encryptRegistrationRequest } from "./security.js";
|