@cloak.ag/sdk 1.0.4 → 1.0.6
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/README.md +39 -4
- package/dist/index.cjs +1041 -63
- package/dist/index.d.cts +318 -8
- package/dist/index.d.ts +318 -8
- package/dist/index.js +1025 -63
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -156,7 +156,7 @@ interface CloakConfig {
|
|
|
156
156
|
/**
|
|
157
157
|
* Deposit progress status
|
|
158
158
|
*/
|
|
159
|
-
type DepositStatus = "generating_note" | "creating_transaction" | "simulating" | "sending" | "confirming" | "submitting_to_indexer" | "fetching_proof" | "complete";
|
|
159
|
+
type DepositStatus = "generating_note" | "awaiting_note_acknowledgment" | "note_saved" | "creating_transaction" | "simulating" | "sending" | "confirming" | "submitting_to_indexer" | "fetching_proof" | "complete";
|
|
160
160
|
/**
|
|
161
161
|
* Options for deposit operation
|
|
162
162
|
*/
|
|
@@ -172,12 +172,73 @@ interface DepositOptions {
|
|
|
172
172
|
onTransactionSent?: (signature: string) => void;
|
|
173
173
|
/** Callback when transaction is confirmed */
|
|
174
174
|
onConfirmed?: (signature: string, slot: number) => void;
|
|
175
|
+
/**
|
|
176
|
+
* CRITICAL: Callback when note is generated, BEFORE any on-chain transaction.
|
|
177
|
+
*
|
|
178
|
+
* This is your chance to safely persist the note. If you don't save the note
|
|
179
|
+
* and the deposit succeeds but the browser crashes, your funds could be lost!
|
|
180
|
+
*
|
|
181
|
+
* The callback receives the note with all secrets needed for withdrawal.
|
|
182
|
+
* The deposit will NOT proceed until this callback completes.
|
|
183
|
+
*
|
|
184
|
+
* @example
|
|
185
|
+
* ```typescript
|
|
186
|
+
* onNoteGenerated: async (note) => {
|
|
187
|
+
* // Save to secure storage BEFORE deposit proceeds
|
|
188
|
+
* await localStorage.setItem(`pending_note_${note.commitment}`, JSON.stringify(note));
|
|
189
|
+
* // Or show user a modal to copy/download the note
|
|
190
|
+
* }
|
|
191
|
+
* ```
|
|
192
|
+
*/
|
|
193
|
+
onNoteGenerated?: (note: CloakNote) => Promise<void> | void;
|
|
194
|
+
/**
|
|
195
|
+
* If true, require user to acknowledge the note before proceeding with deposit.
|
|
196
|
+
* When enabled with onNoteGenerated, the deposit will wait for the callback to complete.
|
|
197
|
+
* Default: true when onNoteGenerated is provided
|
|
198
|
+
*/
|
|
199
|
+
requireNoteAcknowledgment?: boolean;
|
|
175
200
|
/** Skip simulation (default: false) */
|
|
176
201
|
skipPreflight?: boolean;
|
|
177
|
-
/**
|
|
202
|
+
/**
|
|
203
|
+
* Compute units to request.
|
|
204
|
+
* - If `optimizeCU` is true, this is ignored and CU is determined via simulation
|
|
205
|
+
* - Otherwise defaults to 40,000 (suitable for typical deposits)
|
|
206
|
+
*/
|
|
178
207
|
computeUnits?: number;
|
|
179
|
-
/**
|
|
208
|
+
/**
|
|
209
|
+
* Enable simulation-based CU optimization.
|
|
210
|
+
* When true, simulates the transaction first to determine actual CU usage,
|
|
211
|
+
* then sets an optimal limit (simulated + 20% buffer).
|
|
212
|
+
*
|
|
213
|
+
* **Note: Only works in keypair mode (Node.js/scripts).**
|
|
214
|
+
* In wallet/browser mode, this is ignored because simulation would require
|
|
215
|
+
* the user to sign twice (simulation + actual tx) which is bad UX.
|
|
216
|
+
*
|
|
217
|
+
* Trade-offs:
|
|
218
|
+
* - ✅ Optimal block scheduling priority
|
|
219
|
+
* - ❌ Adds ~200-500ms latency (extra RPC call)
|
|
220
|
+
* - ❌ Only available in keypair mode
|
|
221
|
+
*
|
|
222
|
+
* Default: false (uses fixed 40K CU which is ~75% efficient for typical deposits)
|
|
223
|
+
*/
|
|
224
|
+
optimizeCU?: boolean;
|
|
225
|
+
/** Priority fee in micro-lamports (default: 10,000) */
|
|
180
226
|
priorityFee?: number;
|
|
227
|
+
/**
|
|
228
|
+
* Loaded accounts data size limit in bytes.
|
|
229
|
+
*
|
|
230
|
+
* Without this, Solana defaults to 64MB which incurs CU overhead
|
|
231
|
+
* (charged at 8 CU per 32KB). Setting a lower limit improves priority.
|
|
232
|
+
*
|
|
233
|
+
* **Note for Cloak deposits:**
|
|
234
|
+
* The Shield Pool program is ~104KB, so the minimum practical limit is ~128KB.
|
|
235
|
+
*
|
|
236
|
+
* Default: 256 * 1024 (256KB) - provides safety margin above program size.
|
|
237
|
+
* Set to 0 to disable (use Solana 64MB default).
|
|
238
|
+
*
|
|
239
|
+
* @see https://www.anza.xyz/blog/cu-optimization-with-setloadedaccountsdatasizelimit
|
|
240
|
+
*/
|
|
241
|
+
loadedAccountsDataSizeLimit?: number;
|
|
181
242
|
/**
|
|
182
243
|
* Optional: Encrypt output for specific recipient's view key
|
|
183
244
|
* If not provided, encrypts for the wallet's own view key (for self-scanning)
|
|
@@ -1339,9 +1400,42 @@ declare function getAddressExplorerUrl(address: string, network?: Network): stri
|
|
|
1339
1400
|
/**
|
|
1340
1401
|
* Error Utilities
|
|
1341
1402
|
*
|
|
1342
|
-
* Helper functions for parsing and presenting user-friendly error messages
|
|
1403
|
+
* Helper functions for parsing and presenting user-friendly error messages.
|
|
1404
|
+
* This is the single source of truth for error codes and messages.
|
|
1343
1405
|
*/
|
|
1344
1406
|
|
|
1407
|
+
/**
|
|
1408
|
+
* Shield Pool Program Error Codes
|
|
1409
|
+
*
|
|
1410
|
+
* Maps on-chain program error codes to user-friendly error messages.
|
|
1411
|
+
* These codes match the program's error enum.
|
|
1412
|
+
*/
|
|
1413
|
+
declare const ShieldPoolErrors: Record<number, string>;
|
|
1414
|
+
/**
|
|
1415
|
+
* Error categories for UI display
|
|
1416
|
+
*/
|
|
1417
|
+
type ErrorCategory = "wallet" | "network" | "validation" | "service" | "transaction" | "unknown";
|
|
1418
|
+
/**
|
|
1419
|
+
* Structured error result for UI
|
|
1420
|
+
*/
|
|
1421
|
+
interface UserFriendlyError {
|
|
1422
|
+
/** User-facing title */
|
|
1423
|
+
title: string;
|
|
1424
|
+
/** User-facing description */
|
|
1425
|
+
message: string;
|
|
1426
|
+
/** Error category for styling */
|
|
1427
|
+
category: ErrorCategory;
|
|
1428
|
+
/** Optional suggestion for the user */
|
|
1429
|
+
suggestion?: string;
|
|
1430
|
+
/** Whether the error is recoverable (user can retry) */
|
|
1431
|
+
recoverable: boolean;
|
|
1432
|
+
/** Original error for debugging (not shown to user) */
|
|
1433
|
+
originalError?: string;
|
|
1434
|
+
}
|
|
1435
|
+
/**
|
|
1436
|
+
* Parse any error and return a user-friendly error object
|
|
1437
|
+
*/
|
|
1438
|
+
declare function parseError(error: unknown): UserFriendlyError;
|
|
1345
1439
|
/**
|
|
1346
1440
|
* Parse transaction error and return user-friendly message
|
|
1347
1441
|
*
|
|
@@ -1479,6 +1573,16 @@ declare class IndexerService {
|
|
|
1479
1573
|
}>;
|
|
1480
1574
|
}
|
|
1481
1575
|
|
|
1576
|
+
/**
|
|
1577
|
+
* Result from submitting a withdrawal that includes the request ID
|
|
1578
|
+
* for potential recovery/resume scenarios
|
|
1579
|
+
*/
|
|
1580
|
+
interface WithdrawSubmissionResult {
|
|
1581
|
+
/** The relay request ID - persist this for recovery */
|
|
1582
|
+
requestId: string;
|
|
1583
|
+
/** The final transaction signature */
|
|
1584
|
+
signature: string;
|
|
1585
|
+
}
|
|
1482
1586
|
/**
|
|
1483
1587
|
* Relay Service Client
|
|
1484
1588
|
*
|
|
@@ -1501,6 +1605,8 @@ declare class RelayService {
|
|
|
1501
1605
|
*
|
|
1502
1606
|
* @param params - Withdrawal parameters
|
|
1503
1607
|
* @param onStatusUpdate - Optional callback for status updates
|
|
1608
|
+
* @param onRequestId - CRITICAL: Callback when request_id is received.
|
|
1609
|
+
* Persist this ID to recover if browser crashes during polling.
|
|
1504
1610
|
* @returns Transaction signature when completed
|
|
1505
1611
|
*
|
|
1506
1612
|
* @example
|
|
@@ -1510,7 +1616,8 @@ declare class RelayService {
|
|
|
1510
1616
|
* publicInputs: { root, nf, outputs_hash, amount },
|
|
1511
1617
|
* outputs: [{ recipient: addr, amount: lamports }],
|
|
1512
1618
|
* feeBps: 50
|
|
1513
|
-
* }, (status) => console.log(`Status: ${status}`)
|
|
1619
|
+
* }, (status) => console.log(`Status: ${status}`),
|
|
1620
|
+
* (requestId) => localStorage.setItem('pending_withdraw', requestId));
|
|
1514
1621
|
* console.log(`Transaction: ${signature}`);
|
|
1515
1622
|
* ```
|
|
1516
1623
|
*/
|
|
@@ -1527,7 +1634,35 @@ declare class RelayService {
|
|
|
1527
1634
|
amount: number;
|
|
1528
1635
|
}>;
|
|
1529
1636
|
feeBps: number;
|
|
1530
|
-
}, onStatusUpdate?: (status: string) => void): Promise<string>;
|
|
1637
|
+
}, onStatusUpdate?: (status: string) => void, onRequestId?: (requestId: string) => void): Promise<string>;
|
|
1638
|
+
/**
|
|
1639
|
+
* Resume polling for a withdrawal that was previously started
|
|
1640
|
+
*
|
|
1641
|
+
* Use this after page reload to check status of a pending withdrawal.
|
|
1642
|
+
* The requestId should have been persisted via the onRequestId callback.
|
|
1643
|
+
*
|
|
1644
|
+
* @param requestId - Request ID from a previous submitWithdraw call
|
|
1645
|
+
* @param onStatusUpdate - Optional callback for status updates
|
|
1646
|
+
* @returns Transaction signature if completed, null if still pending/failed
|
|
1647
|
+
*
|
|
1648
|
+
* @example
|
|
1649
|
+
* ```typescript
|
|
1650
|
+
* // On page load, check for pending withdrawal
|
|
1651
|
+
* const pendingId = localStorage.getItem('pending_withdraw');
|
|
1652
|
+
* if (pendingId) {
|
|
1653
|
+
* const result = await relay.resumeWithdraw(pendingId);
|
|
1654
|
+
* if (result.status === 'completed') {
|
|
1655
|
+
* console.log('Withdrawal completed:', result.signature);
|
|
1656
|
+
* localStorage.removeItem('pending_withdraw');
|
|
1657
|
+
* }
|
|
1658
|
+
* }
|
|
1659
|
+
* ```
|
|
1660
|
+
*/
|
|
1661
|
+
resumeWithdraw(requestId: string, onStatusUpdate?: (status: string) => void): Promise<{
|
|
1662
|
+
status: 'completed' | 'failed' | 'pending';
|
|
1663
|
+
signature?: string;
|
|
1664
|
+
error?: string;
|
|
1665
|
+
}>;
|
|
1531
1666
|
/**
|
|
1532
1667
|
* Poll for withdrawal completion
|
|
1533
1668
|
*
|
|
@@ -1581,7 +1716,7 @@ declare class RelayService {
|
|
|
1581
1716
|
slippage_bps: number;
|
|
1582
1717
|
min_output_amount: number;
|
|
1583
1718
|
};
|
|
1584
|
-
}, onStatusUpdate?: (status: string) => void): Promise<string>;
|
|
1719
|
+
}, onStatusUpdate?: (status: string) => void, onRequestId?: (requestId: string) => void): Promise<string>;
|
|
1585
1720
|
/**
|
|
1586
1721
|
* Get transaction status
|
|
1587
1722
|
*
|
|
@@ -1653,10 +1788,16 @@ declare class DepositRecoveryService {
|
|
|
1653
1788
|
recoverDeposit(options: RecoveryOptions): Promise<RecoveryResult>;
|
|
1654
1789
|
/**
|
|
1655
1790
|
* Check if a deposit already exists in the indexer
|
|
1791
|
+
* Uses the enhanced deposit lookup endpoint with include_proof=true
|
|
1656
1792
|
*
|
|
1657
1793
|
* @private
|
|
1658
1794
|
*/
|
|
1659
1795
|
private checkExistingDeposit;
|
|
1796
|
+
/**
|
|
1797
|
+
* Recover deposit by transaction signature
|
|
1798
|
+
* Uses the indexer's signature lookup endpoint
|
|
1799
|
+
*/
|
|
1800
|
+
recoverBySignature(signature: string): Promise<RecoveryResult>;
|
|
1660
1801
|
/**
|
|
1661
1802
|
* Finalize a deposit via server API (alternative recovery method)
|
|
1662
1803
|
*
|
|
@@ -1879,6 +2020,175 @@ declare function generateWithdrawRegularProof(inputs: WithdrawRegularInputs, cir
|
|
|
1879
2020
|
* @param circuitsPath - Path or URL to circuits directory. In browser, use URL like '/circuits' or full URL.
|
|
1880
2021
|
*/
|
|
1881
2022
|
declare function generateWithdrawSwapProof(inputs: WithdrawSwapInputs, circuitsPath: string): Promise<ProofResult>;
|
|
2023
|
+
/**
|
|
2024
|
+
* Expected circuit hashes for verification
|
|
2025
|
+
* These are computed from the verification key files to ensure circuits match on-chain vkeys
|
|
2026
|
+
*
|
|
2027
|
+
* To regenerate these hashes, run:
|
|
2028
|
+
* node -e "const fs=require('fs'); const data=fs.readFileSync('path/to/vkey.json'); console.log(require('crypto').createHash('sha256').update(data).digest('hex'));"
|
|
2029
|
+
*/
|
|
2030
|
+
declare const EXPECTED_CIRCUIT_HASHES: {
|
|
2031
|
+
withdraw_regular_vkey: string | null;
|
|
2032
|
+
withdraw_swap_vkey: string | null;
|
|
2033
|
+
};
|
|
2034
|
+
/**
|
|
2035
|
+
* Circuit verification result
|
|
2036
|
+
*/
|
|
2037
|
+
interface CircuitVerificationResult {
|
|
2038
|
+
/** Whether verification passed */
|
|
2039
|
+
valid: boolean;
|
|
2040
|
+
/** Which circuit was checked */
|
|
2041
|
+
circuit: 'withdraw_regular' | 'withdraw_swap';
|
|
2042
|
+
/** Error message if verification failed */
|
|
2043
|
+
error?: string;
|
|
2044
|
+
/** Computed hash (for debugging) */
|
|
2045
|
+
computedHash?: string;
|
|
2046
|
+
/** Expected hash (for debugging) */
|
|
2047
|
+
expectedHash?: string;
|
|
2048
|
+
}
|
|
2049
|
+
/**
|
|
2050
|
+
* Verify circuit integrity by checking verification key hashes
|
|
2051
|
+
*
|
|
2052
|
+
* This function fetches the verification key and computes its hash,
|
|
2053
|
+
* then compares against the expected hash embedded in the SDK.
|
|
2054
|
+
*
|
|
2055
|
+
* IMPORTANT: If the hashes don't match, the circuit may produce proofs
|
|
2056
|
+
* that will be rejected by the on-chain verifier!
|
|
2057
|
+
*
|
|
2058
|
+
* @param circuitsPath - Path to circuits directory
|
|
2059
|
+
* @param circuit - Which circuit to verify ('withdraw_regular' or 'withdraw_swap')
|
|
2060
|
+
* @returns Verification result
|
|
2061
|
+
*
|
|
2062
|
+
* @example
|
|
2063
|
+
* ```typescript
|
|
2064
|
+
* const result = await verifyCircuitIntegrity('/circuits', 'withdraw_regular');
|
|
2065
|
+
* if (!result.valid) {
|
|
2066
|
+
* console.error('Circuit verification failed:', result.error);
|
|
2067
|
+
* // Don't proceed with proof generation!
|
|
2068
|
+
* }
|
|
2069
|
+
* ```
|
|
2070
|
+
*/
|
|
2071
|
+
declare function verifyCircuitIntegrity(circuitsPath: string, circuit: 'withdraw_regular' | 'withdraw_swap'): Promise<CircuitVerificationResult>;
|
|
2072
|
+
/**
|
|
2073
|
+
* Verify all circuits before use
|
|
2074
|
+
*
|
|
2075
|
+
* Call this at SDK initialization to ensure circuits are valid.
|
|
2076
|
+
*
|
|
2077
|
+
* @param circuitsPath - Path to circuits directory
|
|
2078
|
+
* @returns Array of verification results (one per circuit)
|
|
2079
|
+
*/
|
|
2080
|
+
declare function verifyAllCircuits(circuitsPath: string): Promise<CircuitVerificationResult[]>;
|
|
2081
|
+
|
|
2082
|
+
/**
|
|
2083
|
+
* Pending Operations Manager
|
|
2084
|
+
*
|
|
2085
|
+
* Utility for persisting pending deposit/withdrawal operations in browser storage.
|
|
2086
|
+
* This enables recovery if the browser crashes or user navigates away mid-operation.
|
|
2087
|
+
*
|
|
2088
|
+
* IMPORTANT: This uses localStorage by default which has security implications.
|
|
2089
|
+
* Notes contain sensitive spending keys - consider using more secure storage
|
|
2090
|
+
* in production (e.g., encrypted IndexedDB, secure enclave).
|
|
2091
|
+
*/
|
|
2092
|
+
|
|
2093
|
+
/**
|
|
2094
|
+
* Pending deposit record
|
|
2095
|
+
*/
|
|
2096
|
+
interface PendingDeposit {
|
|
2097
|
+
/** The note (contains spending secrets!) */
|
|
2098
|
+
note: CloakNote;
|
|
2099
|
+
/** When the deposit was initiated */
|
|
2100
|
+
startedAt: number;
|
|
2101
|
+
/** Transaction signature if available */
|
|
2102
|
+
txSignature?: string;
|
|
2103
|
+
/** Status of the deposit */
|
|
2104
|
+
status: "pending" | "tx_sent" | "confirmed" | "failed";
|
|
2105
|
+
/** Error message if failed */
|
|
2106
|
+
error?: string;
|
|
2107
|
+
}
|
|
2108
|
+
/**
|
|
2109
|
+
* Pending withdrawal record
|
|
2110
|
+
*/
|
|
2111
|
+
interface PendingWithdrawal {
|
|
2112
|
+
/** The relay request ID (for resumption) */
|
|
2113
|
+
requestId: string;
|
|
2114
|
+
/** The note commitment being withdrawn */
|
|
2115
|
+
commitment: string;
|
|
2116
|
+
/** The nullifier being used */
|
|
2117
|
+
nullifier: string;
|
|
2118
|
+
/** When the withdrawal was initiated */
|
|
2119
|
+
startedAt: number;
|
|
2120
|
+
/** Status of the withdrawal */
|
|
2121
|
+
status: "pending" | "processing" | "completed" | "failed";
|
|
2122
|
+
/** Transaction signature if completed */
|
|
2123
|
+
txSignature?: string;
|
|
2124
|
+
/** Error message if failed */
|
|
2125
|
+
error?: string;
|
|
2126
|
+
}
|
|
2127
|
+
/**
|
|
2128
|
+
* Save a pending deposit
|
|
2129
|
+
* Call this BEFORE sending the on-chain transaction to ensure note is persisted
|
|
2130
|
+
*/
|
|
2131
|
+
declare function savePendingDeposit(deposit: PendingDeposit): void;
|
|
2132
|
+
/**
|
|
2133
|
+
* Load all pending deposits
|
|
2134
|
+
*/
|
|
2135
|
+
declare function loadPendingDeposits(): PendingDeposit[];
|
|
2136
|
+
/**
|
|
2137
|
+
* Update a pending deposit status
|
|
2138
|
+
*/
|
|
2139
|
+
declare function updatePendingDeposit(commitment: string, updates: Partial<PendingDeposit>): void;
|
|
2140
|
+
/**
|
|
2141
|
+
* Remove a pending deposit (e.g., after successful confirmation)
|
|
2142
|
+
*/
|
|
2143
|
+
declare function removePendingDeposit(commitment: string): void;
|
|
2144
|
+
/**
|
|
2145
|
+
* Clear all pending deposits
|
|
2146
|
+
*/
|
|
2147
|
+
declare function clearPendingDeposits(): void;
|
|
2148
|
+
/**
|
|
2149
|
+
* Save a pending withdrawal
|
|
2150
|
+
* Call this when you receive the request_id from the relay
|
|
2151
|
+
*/
|
|
2152
|
+
declare function savePendingWithdrawal(withdrawal: PendingWithdrawal): void;
|
|
2153
|
+
/**
|
|
2154
|
+
* Load all pending withdrawals
|
|
2155
|
+
*/
|
|
2156
|
+
declare function loadPendingWithdrawals(): PendingWithdrawal[];
|
|
2157
|
+
/**
|
|
2158
|
+
* Update a pending withdrawal status
|
|
2159
|
+
*/
|
|
2160
|
+
declare function updatePendingWithdrawal(requestId: string, updates: Partial<PendingWithdrawal>): void;
|
|
2161
|
+
/**
|
|
2162
|
+
* Remove a pending withdrawal (e.g., after successful completion)
|
|
2163
|
+
*/
|
|
2164
|
+
declare function removePendingWithdrawal(requestId: string): void;
|
|
2165
|
+
/**
|
|
2166
|
+
* Clear all pending withdrawals
|
|
2167
|
+
*/
|
|
2168
|
+
declare function clearPendingWithdrawals(): void;
|
|
2169
|
+
/**
|
|
2170
|
+
* Check if there are any pending operations that need recovery
|
|
2171
|
+
* Call this on page load to determine if recovery UI should be shown
|
|
2172
|
+
*/
|
|
2173
|
+
declare function hasPendingOperations(): boolean;
|
|
2174
|
+
/**
|
|
2175
|
+
* Get summary of pending operations for recovery UI
|
|
2176
|
+
*/
|
|
2177
|
+
declare function getPendingOperationsSummary(): {
|
|
2178
|
+
deposits: PendingDeposit[];
|
|
2179
|
+
withdrawals: PendingWithdrawal[];
|
|
2180
|
+
totalPending: number;
|
|
2181
|
+
};
|
|
2182
|
+
/**
|
|
2183
|
+
* Clean up stale pending operations
|
|
2184
|
+
* Call this periodically to remove old failed/completed operations
|
|
2185
|
+
*
|
|
2186
|
+
* @param maxAgeMs Maximum age in milliseconds before an operation is removed (default: 24 hours)
|
|
2187
|
+
*/
|
|
2188
|
+
declare function cleanupStalePendingOperations(maxAgeMs?: number): {
|
|
2189
|
+
removedDeposits: number;
|
|
2190
|
+
removedWithdrawals: number;
|
|
2191
|
+
};
|
|
1882
2192
|
|
|
1883
2193
|
/**
|
|
1884
2194
|
* Cloak SDK - TypeScript SDK for Private Transactions on Solana
|
|
@@ -1888,4 +2198,4 @@ declare function generateWithdrawSwapProof(inputs: WithdrawSwapInputs, circuitsP
|
|
|
1888
2198
|
|
|
1889
2199
|
declare const VERSION = "1.0.0";
|
|
1890
2200
|
|
|
1891
|
-
export { CLOAK_PROGRAM_ID, type CloakConfig, CloakError, type CloakKeyPair, type CloakNote, CloakSDK, type DepositInstructionParams, type DepositOptions, DepositRecoveryService, type DepositResult, type DepositStatus, type EncryptedNote, FIXED_FEE_LAMPORTS, type Groth16Proof, IndexerService, LAMPORTS_PER_SOL, LocalStorageAdapter, type MasterKey, type MaxLengthArray, MemoryStorageAdapter, type MerkleProof, type MerkleRootResponse, type Network, type NoteData, type NotesRangeResponse, type ProofResult, type RecoveryOptions, type RecoveryResult, RelayService, type ScanNotesOptions, type ScannedNote, type ShieldPoolPDAs, type SpendKey, type StorageAdapter, type SwapOptions, type SwapParams, type SwapResult, type Transfer, type TransferOptions, type TransferResult, type TxStatus, VARIABLE_FEE_RATE, VERSION, type ViewKey, type WalletAdapter, type WithdrawOptions, type WithdrawRegularInputs, type WithdrawSwapInputs, bigintToBytes32, buildPublicInputsBytes, bytesToHex, calculateFee, calculateRelayFee, computeCommitment, computeMerkleRoot, computeNullifier, computeNullifierAsync, computeNullifierSync, computeOutputsHash, computeOutputsHashAsync, computeOutputsHashSync, computeSwapOutputsHash, computeSwapOutputsHashAsync, computeSwapOutputsHashSync, copyNoteToClipboard, createCloakError, createDepositInstruction, deriveSpendKey, deriveViewKey, detectNetworkFromRpcUrl, downloadNote, encodeNoteSimple, encryptNoteForRecipient, exportKeys, exportNote, exportWalletKeys, filterNotesByNetwork, filterWithdrawableNotes, findNoteByCommitment, formatAmount, formatErrorForLogging, generateCloakKeys, generateCommitment, generateCommitmentAsync, generateMasterSeed, generateNote, generateNoteFromWallet, generateWithdrawRegularProof, generateWithdrawSwapProof, getAddressExplorerUrl, getDistributableAmount, getExplorerUrl, getPublicKey, getPublicViewKey, getRecipientAmount, getRpcUrlForNetwork, getShieldPoolPDAs, getViewKey, hexToBigint, hexToBytes, importKeys, importWalletKeys, isValidHex, isValidRpcUrl, isValidSolanaAddress, isWithdrawable, keypairToAdapter, parseAmount, parseNote, parseTransactionError, poseidonHash, prepareEncryptedOutput, prepareEncryptedOutputForRecipient, proofToBytes, pubkeyToLimbs, randomBytes, scanNotesForWallet, sendTransaction, serializeNote, signTransaction, splitTo2Limbs, tryDecryptNote, updateNoteWithDeposit, validateDepositParams, validateNote, validateOutputsSum, validateTransfers, validateWalletConnected, validateWithdrawableNote };
|
|
2201
|
+
export { CLOAK_PROGRAM_ID, type CircuitVerificationResult, type CloakConfig, CloakError, type CloakKeyPair, type CloakNote, CloakSDK, type DepositInstructionParams, type DepositOptions, DepositRecoveryService, type DepositResult, type DepositStatus, EXPECTED_CIRCUIT_HASHES, type EncryptedNote, type ErrorCategory, FIXED_FEE_LAMPORTS, type Groth16Proof, IndexerService, LAMPORTS_PER_SOL, LocalStorageAdapter, type MasterKey, type MaxLengthArray, MemoryStorageAdapter, type MerkleProof, type MerkleRootResponse, type Network, type NoteData, type NotesRangeResponse, type PendingDeposit, type PendingWithdrawal, type ProofResult, type RecoveryOptions, type RecoveryResult, RelayService, type ScanNotesOptions, type ScannedNote, ShieldPoolErrors, type ShieldPoolPDAs, type SpendKey, type StorageAdapter, type SwapOptions, type SwapParams, type SwapResult, type Transfer, type TransferOptions, type TransferResult, type TxStatus, type UserFriendlyError, VARIABLE_FEE_RATE, VERSION, type ViewKey, type WalletAdapter, type WithdrawOptions, type WithdrawRegularInputs, type WithdrawSubmissionResult, type WithdrawSwapInputs, bigintToBytes32, buildPublicInputsBytes, bytesToHex, calculateFee, calculateRelayFee, cleanupStalePendingOperations, clearPendingDeposits, clearPendingWithdrawals, computeCommitment, computeMerkleRoot, computeNullifier, computeNullifierAsync, computeNullifierSync, computeOutputsHash, computeOutputsHashAsync, computeOutputsHashSync, computeSwapOutputsHash, computeSwapOutputsHashAsync, computeSwapOutputsHashSync, copyNoteToClipboard, createCloakError, createDepositInstruction, deriveSpendKey, deriveViewKey, detectNetworkFromRpcUrl, downloadNote, encodeNoteSimple, encryptNoteForRecipient, exportKeys, exportNote, exportWalletKeys, filterNotesByNetwork, filterWithdrawableNotes, findNoteByCommitment, formatAmount, formatErrorForLogging, generateCloakKeys, generateCommitment, generateCommitmentAsync, generateMasterSeed, generateNote, generateNoteFromWallet, generateWithdrawRegularProof, generateWithdrawSwapProof, getAddressExplorerUrl, getDistributableAmount, getExplorerUrl, getPendingOperationsSummary, getPublicKey, getPublicViewKey, getRecipientAmount, getRpcUrlForNetwork, getShieldPoolPDAs, getViewKey, hasPendingOperations, hexToBigint, hexToBytes, importKeys, importWalletKeys, isValidHex, isValidRpcUrl, isValidSolanaAddress, isWithdrawable, keypairToAdapter, loadPendingDeposits, loadPendingWithdrawals, parseAmount, parseError, parseNote, parseTransactionError, poseidonHash, prepareEncryptedOutput, prepareEncryptedOutputForRecipient, proofToBytes, pubkeyToLimbs, randomBytes, removePendingDeposit, removePendingWithdrawal, savePendingDeposit, savePendingWithdrawal, scanNotesForWallet, sendTransaction, serializeNote, signTransaction, splitTo2Limbs, tryDecryptNote, updateNoteWithDeposit, updatePendingDeposit, updatePendingWithdrawal, validateDepositParams, validateNote, validateOutputsSum, validateTransfers, validateWalletConnected, validateWithdrawableNote, verifyAllCircuits, verifyCircuitIntegrity };
|