@cloak.dev/sdk 0.2.6-staging.4f665f8 → 0.2.6-staging.81e481e

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/index.d.ts CHANGED
@@ -3756,6 +3756,8 @@ interface SubmitTransactToRelayArgs {
3756
3756
  settlementTimeoutMs?: number;
3757
3757
  /** Shorter window used to ask "did it land anyway?" after a terminal relay failure. */
3758
3758
  failureProbeTimeoutMs?: number;
3759
+ /** Stops the wait for the relay's source lease to expire; the chain is still checked after. */
3760
+ signal?: AbortSignal;
3759
3761
  }
3760
3762
  /**
3761
3763
  * POST one logical `/transact` request and REPORT ONLY WHAT THE CHAIN CONFIRMS.
@@ -3870,8 +3872,10 @@ interface UtxoSwapResult extends TransactResult {
3870
3872
  * `SwapState.sol_amount`, = gross swap amount minus the on-chain swap fee). R_fb is an ordinary
3871
3873
  * leaf of the main pool tree, spent with the ordinary `transact()` path. All values are hex.
3872
3874
  *
3873
- * `publicKey` is the wallet's long-lived UTXO public key (`options.ownerUtxoKeypair`), so R_fb is
3874
- * spent with the wallet's own keypair; the private key is deliberately not repeated here. The
3875
+ * `publicKey` is a PER-SWAP public key, derived from `options.ownerUtxoKeypair`'s private key and
3876
+ * the swap's first input nullifier, so no two swaps from one wallet share it and it is not the
3877
+ * wallet's UTXO public key. Spend R_fb with `deriveSwapRefundKeypair(owner, nullifier)`; the
3878
+ * private key is deliberately not repeated here and `nk` cannot produce it. The
3875
3879
  * blinding is derived from the wallet's `nk` and the swap's public first input nullifier
3876
3880
  * (`derivedFromNk` is always true), so `discoverSwapRefunds` finds the leaf again from key
3877
3881
  * material if this object is lost.
@@ -4656,26 +4660,34 @@ declare function matchChangeNote(params: MatchChangeNoteParams): Promise<Recover
4656
4660
  * viewing key and the swap creator's, and found nothing under either.
4657
4661
  *
4658
4662
  * ── The fix, and why it is SDK-only ───────────────────────────────────────────────────────────
4659
- * The refund leaf is owned by the wallet's long-lived UTXO keypair (passed explicitly), and only
4660
- * its BLINDING is derived, as a PRF of the owner's `nk` and the swap's own first input nullifier:
4663
+ * The refund leaf's BLINDING is derived as a PRF of the owner's `nk` and the swap's own first input
4664
+ * nullifier, and its OWNER KEY is derived per swap from the wallet's UTXO private key:
4665
+ *
4666
+ * blinding = BLAKE3("cloak_swap_refund_v1" || nk || nullifier0 || "blinding") -> field
4667
+ * priv = BLAKE3("cloak_swap_refund_v2" || ownerPrivateKey || nullifier0 || "sk_v2") -> field
4668
+ * pub = derivePublicKey(priv)
4661
4669
  *
4662
- * blinding = BLAKE3("cloak_swap_refund_v1" || nk || nullifier0 || "blinding") -> field
4663
- * owner = ownerUtxoKeypair (never derived from nk)
4670
+ * `nullifier0` is published in the TransactSwap public inputs, so a scanner holding `nk` can replay
4671
+ * the blinding for every swap it sees. `refund_pubkey` and `refund_blinding` are ALSO published, in
4672
+ * plain text, in the TransactSwap instruction data (and in SwapState), so a view-only scanner (nk
4673
+ * plus the owner PUBLIC key) reads the per-swap pubkey from there, checks that the published
4674
+ * blinding equals the nk-derived one, and checks that the commitment matches. Spending R_fb needs
4675
+ * `priv`, which needs the owner's private key: `nk` cannot produce it, so the viewing key stays
4676
+ * view-only, and the owner re-derives the spend key from its own private key plus the nullifier.
4664
4677
  *
4665
- * `nullifier0` is published in the TransactSwap public inputs, so a scanner holding `nk` and the
4666
- * wallet's UTXO public key can replay the blinding for every swap it sees, recompute R_fb and match
4667
- * it against the commitment `CloseSwapState` declared. Spending R_fb needs the owner's private key,
4668
- * which `nk` cannot produce, so the viewing key stays view-only. Every R_fb is distinct because the
4669
- * blinding differs per `nullifier0`.
4678
+ * Why not the owner key itself (0.2.6 - 0.2.8)? That shape published the wallet's permanent UTXO
4679
+ * public key as `refund_pubkey` on every swap, so anyone holding a user's receiving key could list
4680
+ * all of that wallet's swaps. A different public key per swap removes the link.
4670
4681
  *
4671
4682
  * This changes NOTHING on chain or in the relay. `refund_pubkey` / `refund_blinding` remain
4672
4683
  * caller-supplied values bound into `computeSwapExtDataHash`; only their provenance changes.
4673
4684
  *
4674
- * ── Legacy refunds ────────────────────────────────────────────────────────────────────────────
4675
- * The first release of this derivation also derived the refund PRIVATE key from `(nk, nullifier0)`.
4676
- * Those refunds are still matched (see {@link deriveLegacySwapRefundAuthorization}) and come back
4677
- * flagged `legacyExposed: true`, because anyone holding `nk` can spend them; an app should migrate
4678
- * them. No API builds a refund in that shape any more.
4685
+ * ── Three refund shapes, all still recognised ─────────────────────────────────────────────────
4686
+ * "per-swap" (0.2.9+) owner = per-swap key from the owner private key (above)
4687
+ * "owner" (0.2.6 - 0.2.8) owner = the wallet's permanent UTXO keypair; linkable across swaps
4688
+ * "legacy-nk" (< 0.2.6) owner key AND blinding from nk; `legacyExposed: true`, because anyone
4689
+ * holding `nk` can spend it. An app should migrate those refunds.
4690
+ * No API builds a refund in the last two shapes any more.
4679
4691
  *
4680
4692
  * ── Guardrails preserved ──────────────────────────────────────────────────────────────────────
4681
4693
  * [H-04 / DD-01] the authorization is rejected unless publicKey and blinding are both non-zero.
@@ -4696,14 +4708,20 @@ interface SwapRefundAuthorization {
4696
4708
  publicKey: bigint;
4697
4709
  blinding: bigint;
4698
4710
  }
4711
+ /** Which key shape owns a refund leaf; see the file header. */
4712
+ type SwapRefundShape = "per-swap" | "owner" | "legacy-nk";
4699
4713
  /** A refund leaf matched back to its owner. */
4700
4714
  interface RecoveredSwapRefund {
4701
4715
  /**
4702
- * The owner keypair. For a current refund this is the `ownerUtxoKeypair` the matcher was given
4703
- * (`privateKey` is `0n` if only the public key was supplied; substitute the wallet's keypair before
4704
- * spending). For a legacy refund it is the nk-derived keypair, complete and spendable.
4716
+ * The key that owns the leaf. `per-swap`: the key derived from the owner private key and the
4717
+ * swap nullifier (`privateKey` is `0n` for a view-only match: the public key is real, but the
4718
+ * spend key needs the owner private key, see {@link deriveSwapRefundKeypair}). `owner`: the
4719
+ * `ownerUtxoKeypair` the matcher was given (`privateKey` `0n` if only the public key was
4720
+ * supplied). `legacy-nk`: the nk-derived keypair, complete and spendable.
4705
4721
  */
4706
4722
  keypair: UtxoKeypair;
4723
+ /** Which of the three shapes matched. */
4724
+ shape: SwapRefundShape;
4707
4725
  blinding: bigint;
4708
4726
  amount: bigint;
4709
4727
  /** R_fb as a field element, identical to the commitment `CloseSwapState` appended. */
@@ -4722,8 +4740,15 @@ interface RecoveredSwapRefund {
4722
4740
  */
4723
4741
  declare function deriveSwapRefundBlinding(viewingKeyNk: Uint8Array, inputNullifier: Uint8Array | bigint): bigint;
4724
4742
  /**
4725
- * The refund authorization `swapUtxo` binds into the swap ext-data hash: the wallet's long-lived
4726
- * UTXO keypair as owner, plus the derived blinding.
4743
+ * The per-swap refund KEYPAIR: a different key for every swap, derived from the owner's private key
4744
+ * and the swap's first input nullifier. `nk` cannot reproduce it. Use this to spend a refund the
4745
+ * swap result reported, or any `per-swap` refund a view-only scan found.
4746
+ */
4747
+ declare function deriveSwapRefundKeypair(ownerUtxoKeypair: UtxoKeypair, inputNullifier: Uint8Array | bigint): Promise<UtxoKeypair>;
4748
+ /**
4749
+ * The refund authorization `swapUtxo` binds into the swap ext-data hash: a per-swap keypair derived
4750
+ * from the wallet's UTXO private key and the swap's first input nullifier, plus the nk-derived
4751
+ * blinding. The public key differs for every swap and differs from the wallet's UTXO public key.
4727
4752
  *
4728
4753
  * `ownerUtxoKeypair` is required and validated. The refund key is never derived from `nk`.
4729
4754
  */
@@ -4750,16 +4775,28 @@ interface MatchSwapRefundLeafParams {
4750
4775
  commitment: bigint | Uint8Array;
4751
4776
  /**
4752
4777
  * The wallet's long-lived UTXO keypair (`privateKey: 0n` is fine for a view-only match). Without
4753
- * it only legacy refunds can be matched.
4778
+ * it only legacy-nk refunds can be matched.
4754
4779
  */
4755
4780
  ownerUtxoKeypair?: UtxoKeypair;
4781
+ /**
4782
+ * `refund_pubkey` as published in the swap's TransactSwap instruction data (bytes 593-624) or its
4783
+ * SwapState. A view-only scanner needs it to match a `per-swap` refund, because it cannot derive
4784
+ * the key. Pass it together with {@link publishedRefundBlinding}.
4785
+ */
4786
+ publishedRefundPubkey?: bigint | Uint8Array;
4787
+ /** `refund_blinding` as published in the same place (bytes 625-656). */
4788
+ publishedRefundBlinding?: bigint | Uint8Array;
4756
4789
  }
4757
4790
  /**
4758
4791
  * Decide whether a public refund leaf belongs to this wallet, and if so return it. Returns `null`
4759
4792
  * for every leaf that is not ours; a scanner runs this against every close it can see.
4760
4793
  *
4761
- * Tries the current shape first (owner = `ownerUtxoKeypair`, blinding from `nk`), then the legacy
4762
- * shape (key and blinding both from `nk`, flagged `legacyExposed`).
4794
+ * Tries, in order: the per-swap shape (published pubkey, or re-derived when the owner private key
4795
+ * is present), the 0.2.6 - 0.2.8 owner-key shape, then the legacy nk shape (`legacyExposed`).
4796
+ * `shape` on the result says which one matched.
4797
+ *
4798
+ * A per-swap match from a view-only scan returns `keypair.privateKey === 0n`; the caller spends it
4799
+ * with {@link deriveSwapRefundKeypair} once it holds the owner private key.
4763
4800
  */
4764
4801
  declare function matchSwapRefundLeaf(params: MatchSwapRefundLeafParams): Promise<RecoveredSwapRefund | null>;
4765
4802
  /** One recovered refund leaf, with the chain coordinates that produced it. */
@@ -4775,9 +4812,11 @@ interface DiscoveredSwapRefund extends RecoveredSwapRefund {
4775
4812
  }
4776
4813
  interface DiscoverSwapRefundsOptions {
4777
4814
  /**
4778
- * The wallet's long-lived UTXO keypair: the owner of every refund leaf built by the current SDK.
4779
- * Required. Pass the real keypair to get spendable results, or `{ privateKey: 0n, publicKey }`
4780
- * for a view-only scan. Legacy (nk-owned) refunds are found either way and flagged
4815
+ * The wallet's long-lived UTXO keypair. Required. Pass the real keypair to get spendable
4816
+ * results (per-swap refunds come back with their derived keypair), or `{ privateKey: 0n,
4817
+ * publicKey }` for a view-only scan: per-swap refunds are then matched from the `refund_pubkey`
4818
+ * published in the swap instruction and come back with `privateKey: 0n` (re-derive it with
4819
+ * `deriveSwapRefundKeypair`). Legacy (nk-owned) refunds are found either way and flagged
4781
4820
  * `legacyExposed`.
4782
4821
  */
4783
4822
  ownerUtxoKeypair: UtxoKeypair;
@@ -4805,7 +4844,7 @@ interface DiscoverSwapRefundsOptions {
4805
4844
  * its owner could not see it under any key they held.
4806
4845
  *
4807
4846
  * FORWARD-LOOKING ONLY. This finds refunds whose blinding was DERIVED from (nk, nullifier0), owned
4808
- * either by the wallet's UTXO keypair (current) or by an nk-derived key (legacy, flagged).
4847
+ * by a per-swap key (0.2.9+), the wallet UTXO key (0.2.6-0.2.8) or an nk-derived key (legacy, flagged).
4809
4848
  * A swap whose refund keypair and blinding were drawn from raw randomness (every swap submitted
4810
4849
  * before that derivation shipped) has no derivation to replay,
4811
4850
  * and no key-only scan can ever recover it. Those secrets existed solely in the caller's in-memory
@@ -5232,6 +5271,28 @@ interface NoteIndexPage {
5232
5271
  rawItems: Uint8Array[];
5233
5272
  /** Items of unknown kinds, skipped by `body_len`. */
5234
5273
  skippedUnknown: number;
5274
+ /**
5275
+ * Position in the page (0-based, unknown and malformed kinds counted) of each entry of `items`,
5276
+ * so `page * NOTE_INDEX_PAGE_SIZE + itemPositions[i]` is the item's real sequence number.
5277
+ */
5278
+ itemPositions: number[];
5279
+ /**
5280
+ * Known-kind items whose body failed that kind's checks and were skipped by `body_len`. Always 0
5281
+ * unless {@link ParseNoteIndexPageOptions.skipMalformedItems} is set (otherwise they throw).
5282
+ */
5283
+ skippedMalformed: number;
5284
+ }
5285
+ /** Options of {@link parseNoteIndexPage}. */
5286
+ interface ParseNoteIndexPageOptions {
5287
+ /**
5288
+ * Skip (and count in `skippedMalformed`) a known-kind item whose body fails that kind's checks,
5289
+ * instead of refusing the whole page. Only the BODY is forgiven: the page header, the item
5290
+ * framing (`kind | body_len` inside the page, no truncation, no trailing bytes) and the hash
5291
+ * chain stay strict, so a skipped item is exactly a hidden item, which an untrusted relay can
5292
+ * already do. `recoverNotesFromIndex` sets it, so that one bad entry cannot abort every
5293
+ * wallet's restore.
5294
+ */
5295
+ skipMalformedItems?: boolean;
5235
5296
  }
5236
5297
  /** Input to {@link encodeNoteIndexPage}. */
5237
5298
  interface EncodeNoteIndexPageParams {
@@ -5249,11 +5310,15 @@ interface EncodeNoteIndexPageParams {
5249
5310
  * other than `expect`, an item whose body_len differs from the exact length of its kind, a note
5250
5311
  * whose version disagrees with its length, an out-of-range ix_tag / note_source, a refund whose mint
5251
5312
  * is not WSOL, an unknown kind longer than 1024 bytes, a truncated item, or trailing bytes.
5313
+ *
5314
+ * With `options.skipMalformedItems`, an item whose body alone is at fault (its framing inside the
5315
+ * page is intact) is skipped and counted in `skippedMalformed` instead; everything else above
5316
+ * still throws.
5252
5317
  */
5253
5318
  declare function parseNoteIndexPage(bytes: Uint8Array, expect?: {
5254
5319
  epoch: bigint;
5255
5320
  page: number;
5256
- }): NoteIndexPage;
5321
+ }, options?: ParseNoteIndexPageOptions): NoteIndexPage;
5257
5322
  /**
5258
5323
  * Parse ONE raw item (`kind | body_len | body`), as kept in `NoteIndexPage.rawItems` and in a
5259
5324
  * persisted cursor. Same strictness as the page parser; unknown kinds are an error here.
@@ -5302,6 +5367,25 @@ declare function encodeNoteIndexPage(params: EncodeNoteIndexPageParams): Uint8Ar
5302
5367
  * A HIDDEN nullifier makes a spent note look unspent; the spend-time `preflightNullifiers` in every
5303
5368
  * spend entry point is what catches that, and it stays mandatory.
5304
5369
  *
5370
+ * What is NOT checked: the proof-bound `chainNoteHash`. An index item does not carry it (nor the
5371
+ * `extDataHash` its preimage needs), and fetching either per transaction would break the one-RPC
5372
+ * budget. It is not needed for (a) to (c): the chain note is AES-GCM under a key HKDF'd from nk
5373
+ * with the item's own `comm0` as salt (`comm1` for a v2 note), so a note written for one
5374
+ * transaction never opens when the relay attaches it to another (a mispaired CLK1 carrier), for its
5375
+ * real owner or anyone else, and whatever does open (a note crafted for the transaction it sits
5376
+ * on, say under a public legacy key) is still held to (b) and (c). The item's other public fields (`publicAmount`,
5377
+ * the nullifiers) feed only derivations whose result must reproduce a published commitment, so a
5378
+ * wrong value there can only make a note fail to match. The cost of a mispairing is therefore
5379
+ * hidden notes (the memo's real owner's, and the paired source's own), never a wrong note, and no
5380
+ * client-side check can recover them: only the relay can pair correctly.
5381
+ *
5382
+ * ── One bad entry never aborts a run ──────────────────────────────────────────────────────────
5383
+ * The index carries what anyone can put on chain, and a legacy viewing key may be public, so a
5384
+ * stranger can write a note that opens for a wallet. An item whose body is malformed (framing
5385
+ * intact), or whose opened contents make a matcher throw, is skipped and counted in
5386
+ * `stats.skipped`, exactly as if it were not this wallet's. Only page-level faults (header,
5387
+ * framing, hash chain, head) still fail the run, since they are not one entry's.
5388
+ *
5305
5389
  * ── The cursor never depends on what the wallet owns (contract property 1) ────────────────────
5306
5390
  * Every run downloads from the persisted cursor page, so that page must be a function of public
5307
5391
  * data only. It is always `floor(complete_pages / 8) * 8` of the head this run saw (or the previous
@@ -5467,6 +5551,14 @@ interface NoteIndexRecoveryStats {
5467
5551
  conflicts: number;
5468
5552
  /** Pending candidates over the carry limit, not carried to the next run. */
5469
5553
  pendingDropped: number;
5554
+ /**
5555
+ * Index entries skipped instead of failing the run (each one is treated as not this wallet's):
5556
+ * an item whose body fails its kind's format checks while its framing in the page is intact, and
5557
+ * an item that opened under this wallet's keys but whose contents no derivation accepts (a chain
5558
+ * note salt of 0 or over 96 bits, or anything else that throws while it is matched). Anyone who
5559
+ * can read a legacy viewing key can write such a note, so none of this may abort a restore.
5560
+ */
5561
+ skipped: number;
5470
5562
  }
5471
5563
  interface RecoverNotesFromIndexResult {
5472
5564
  /** Verified, unspent, owned by `ownerUtxoKeypair`; deduped by (mint, leaf). */
@@ -6366,4 +6458,4 @@ declare const VERSION = "0.2.6";
6366
6458
  /** True when scanner supports TransactSwap (tag 1). Check this to verify the correct SDK bundle is loaded. */
6367
6459
  declare const SCANNER_SUPPORTS_TRANSACT_SWAP = true;
6368
6460
 
6369
- export { BRIDGE_ESCROW_LABEL, BRIDGE_ESCROW_LABEL_V2, BUILD_ALLOWS_LOCAL_ENDPOINTS, type BridgeDeliveryState, type BridgeDeposit, type BridgeDepositState, type BridgeQuoteAssessment, type BridgeQuoteInput, type BridgeRail, type BridgeRailAttestation, type BridgeRailProblem, type BridgeRailQuoteOption, type BridgeRailQuoteRequest, type BridgeRailQuoteResponse, type BridgeRailStatusResult, type BuildRecipientDeliveryNotesParams, CHAIN_NOTE_SALT_BITS, CLEANUP_FEE_BUDGET, CLOAK_PRODUCTION_RELAY_URL, CLOAK_PROGRAM_ID, type ChainNoteTxType, type CircuitVerificationResult, type CleanupResult, type CloakConfig, CloakError, type CloakKeyPair, type CloakNote, type CloakRpc, type CommitmentEntry, type CommitmentsResponse, type CompactChainNote, type ComplianceReport, type ComplianceTxType, type ConfirmSettlementParams, type CreateRecoverableDepositUtxoParams, DEFAULT_CIRCUITS_URL, DEFAULT_TRANSACTION_CIRCUITS_URL, DELIVERY_MEMO_TAG, DELIVERY_REGISTRY_SEED, type DeliveredNote, DepositError, type DepositInstructionParams, type DepositNoteSecrets, type DepositOptions, type DepositOutcome, type DepositRef, type DepositResult, type DepositStatus, type DiscoverOptions, type DiscoverSwapRefundsOptions, type DiscoveredSwapRefund, DoNotRetry, ECONOMIC_MINIMUM, EXPECTED_CIRCUIT_HASHES, type EncodeNoteIndexPageParams, type EncryptedMetadataBundle, type EncryptedNote$1 as EncryptedNote, type ErrorCategory, type ExpandedSpendKey, type ExternalFeePayerAdapter, FEE_BUDGET, FIXED_FEE_LAMPORTS, type FundingPlan, type Groth16Proof, type IndexedRecoveredNote, type IndexedRecoveredNoteKind, InsecureRandomnessError, LAMPORTS_PER_SOL, type LegacyWalletAdapter, type WalletSigner as LegacyWalletSigner, LocalStorageAdapter, type LogLevel, type Logger, type LookupTable, MAINNET_RENT_0, MAINNET_RENT_1, MAX_RECEIVER_INDEX, MERKLE_TREE_HEIGHT, MIN_DEPOSIT_LAMPORTS, MIN_DEPOSIT_SPL_BASE_UNITS, type MasterKey, type MatchChangeNoteParams, type MatchDepositNoteParams, type MatchSwapRefundLeafParams, type MaxLengthArray, MemoryStorageAdapter, type MerkleProof, type MerkleRootResponse, MerkleTree, type MessageSigner, NATIVE_SOL_MINT, NOTE_INDEX_NO_LEAF, NOTE_INDEX_PAGE_SIZE, type Network, type NoteData, type NoteIndexCursor, type NoteIndexDeliveryItem, type NoteIndexFetchOptions, NoteIndexFormatError, type NoteIndexHead, NoteIndexHeadBehindError, type NoteIndexItem, type NoteIndexPage, type NoteIndexRecoveryStats, type NoteIndexSwapRefundItem, type NoteIndexTxItem, ONECLICK_PUBKEY_B58, type OnchainMerkleProof, type ParsedDeliveryCarrier, type PaymasterTopUpExpectation, type PaymasterTopUpResult, type PendingDeposit, type PendingWithdrawal, type PostFailureVerdict, RECIPIENT_DELIVERY_CIPHERTEXT_LEN, RECIPIENT_DELIVERY_EPHEMERAL_PK_LEN, RECIPIENT_DELIVERY_NONCE_LEN, RECIPIENT_DELIVERY_NOTE_BYTES, RECIPIENT_DELIVERY_PLAINTEXT_LEN, RECIPIENT_DELIVERY_TAG_LEN, RELAY_BATCH_AUTH_MAX_ITEMS, RELAY_ORIGIN_ALLOWLIST, REQUEST_AUTH_BATCH_DOMAIN, REQUEST_AUTH_BATCH_MAX_AGE_SECONDS, REQUEST_AUTH_MAX_AGE_SECONDS, REQUEST_AUTH_MAX_FUTURE_SKEW_SECONDS, type RecipientDeliveryNote, type RecoverNotesFromIndexParams, type RecoverNotesFromIndexResult, type RecoveredChangeNote, type RecoveredChangeNoteRecord, type RecoveredDepositNote, type RecoveredDepositNoteRecord, type RecoveredSwapRefund, type RelayAuthMode, type RelayAuthPreimage, type RelayAuthSigner, RelayBatchAuthCoordinator, type RelayBatchAuthCoordinatorOptions, type RelayBatchAuthEnvelope, type RelayBatchAuthFields, type RelayBatchAuthItemHandle, RelayInternalError, RelayService, type RelaySubmissionResult, type RentRates, type RetryHooks, type RiskQuoteInstructionResponse, RootNotFoundError, SCANNER_SUPPORTS_TRANSACT_SWAP, SIGN_IN_MESSAGE, SanctionsQuoteError, type ScanOptions, type ScanRecipientDeliveryOptions, type ScanResult, type ScanSummary, type ScannedTransaction, type SettlementConnection, type SettlementContext, type SettlementStatus, type SettlementVerdict, SettlementVerificationError, ShieldPoolErrors, type ShieldPoolPDAs, SimpleWallet, type SpendKey, type SpendOptions, type StorageAdapter, type SubmitTransactToRelayArgs, type SwapOptions, type SwapParams, type SwapRefundAuthorization, type SwapResult, TERMINAL_FAILURE, TRANSACTION_CIRCUITS_VERSION, TRANSACT_AUTH_FIELDS, TRANSACT_SWAP_AUTH_FIELDS, type TransactBatchItem, type TransactBatchItemOutcome, type TransactBatchOptions, type TransactBatchResult, type TransactOptions, type TransactParams, type TransactRequestBodyParams, type TransactResult, TransactionConfirmationError, type TransactionMetadata, type Transfer, type TransferOptions, type TransferResult, type TxStatus, type UserFriendlyError, type Utxo, UtxoAlreadySpentError, type EncryptedNote as UtxoEncryptedNote, type UtxoKeypair, type UtxoSwapParams, type UtxoSwapResult, UtxoWallet, VARIABLE_FEE_DENOMINATOR, VARIABLE_FEE_NUMERATOR, VARIABLE_FEE_RATE, VERSION, type VerifyUtxosResult, type ViewKey, type ViewingKeyPair, WITHDRAW_FEE_BPS, WITHDRAW_FIXED_FEE, type WalletAdapterBridgeOptions, type WalletSigner$1 as WalletSigner, type WalletUtxo, type Web3Module, type WithdrawOptions, type WithdrawSubmissionResult, accountMeta, addressBytes, addressFromBytes, addressFromPublicKey, assertDirectSubmissionLanded, assertInputMints, assertTransactionCircuitIntegrity, assessBridgeQuote, bigintToBytes32$1 as bigintToBytes32, bigintToHex, buildAuthTransactionMessage, buildMerkleTree, buildMerkleTreeFromChain, buildMerkleTreeFromRelay, buildRecipientDeliveryNotes, buildRelayAuthPreimage, buildRelayBatchAuthMessage, buildTransactRequestBody, buildTransactionMessage, bytesToHex, calculateFee, calculateFeeBigint, calculateRelayFee, canRebuildMerkleTreeFromChain, canonicalJson, canonicalPayloadString, chainNoteFromBase64, chainNoteToBase64, classifyPostFailure, classifyRelayError, cleanupReceivingAddress, cleanupStalePendingOperations, clearPendingDeposits, clearPendingWithdrawals, cloakBridgeRail, computeChainNoteHash, computeExtDataHash, computeMerkleRoot, computeNoteIndexChain, computeProofForLatestDeposit, computeProofFromChain, computeSignature, computeSwapRefundCommitment, computeCommitment as computeUtxoCommitment, computeNullifier as computeUtxoNullifier, confirmSignature, confirmTransactSettlement, copyNoteToClipboard, createCloakError, createCloakRpc, createDepositInstruction, createLogger, createRecoverableChangeUtxo, createRecoverableDepositUtxo, createRelayBatchAuthCoordinator, createUtxo, createZeroUtxo, decryptCompactChainNote, decryptComplianceMetadataWithMasterKey, decryptTransactionMetadata, depositFromDerivedKey, deriveBridgeReceiver, deriveChangeNoteBlinding, deriveDepositNoteBlinding, deriveDiversifiedViewingKey, deriveDiversifier, deriveFundingTargets, deriveInputNullifierPdas, deriveLegacyBridgeReceiver, deriveLegacyDepositNoteSecrets, deriveLegacySwapRefundAuthorization, derivePublicKey, deriveSpendKey, deriveSwapRefundAuthorization, deriveSwapRefundBlinding, deriveUserCompliancePublicKey, deriveUserComplianceScalar, deriveUtxoKeypairFromSpendKey, deriveViewKey, deriveViewingKeyFromNk, deriveViewingKeyFromSpendKey, deriveViewingKeyFromUtxoPrivateKey, deserializeUtxo, detectNetworkFromRpcUrl, discoverSwapRefunds, downloadNote, encodeDeliveryCarrierMemo, encodeNoteIndexItem, encodeNoteIndexPage, encodeNoteSimple, encodeRecipientDeliveryNote, encryptCompactChainNote, encryptNoteForRecipient, encryptTransactionMetadata, encryptTransactionMetadataBundle, expandSpendKey, explainRelayAuthRejection, exportKeys, exportNote, exportWalletKeys, fetchAccountBytes, fetchCommitments, fetchLatestBlockhash, fetchLookupTables, fetchNoteIndexHead, fetchNoteIndexPage, fetchRiskQuoteInstruction, fetchRiskQuoteIx, fetchSignaturesForAddress, filterNotesByNetwork, filterWithdrawableNotes, findNoteByCommitment, findProgramAddress, formatAmount, formatComplianceCsv, formatErrorForLogging, formatSol, fullWithdraw, fundReceiverViaPaymaster, generateCloakKeys, generateCommitmentAsync, generateMasterSeed, generateNoteFromWallet, generateUtxoKeypair, generateViewingKeyPair, getAddressExplorerUrl, getChainNoteRegistryPDA, getCircuitsPath, getDeliveryRegistryPDA, getDistributableAmount, getExplorerUrl, getNkFromUtxoPrivateKey, getNullifierPDA, getPendingOperationsSummary, getPoolAuthorityConfigPDA, getPublicKey, getPublicViewKey, getRecipientAmount, getRpcUrlForNetwork, getShieldPoolPDAs, getSwapStatePDA, getViewKey, hasPendingOperations, hexToBigint$1 as hexToBigint, hexToBytes, importKeys, importWalletKeys, isBrowser, isBrowserLike, isDebugEnabled, isMessageSigner, isPlausibleSignature, isReactNative, isRootNotFoundError, isSubmissionOutcomeUnknownResponse, isTerminalFailure, isValidHex, isValidRpcUrl, isValidSolanaAddress, isWithdrawAmountSufficient, isWithdrawable, listBridgeDeposits, loadPendingDeposits, loadPendingWithdrawals, loadVerifiedCircuitArtifacts, matchChangeNote, matchDepositNote, matchSwapRefundLeaf, mayRetry, messageSignerFromCallback, openRecipientDeliveryNote, parseAmount, parseDeliveryCarrierMemo, parseError, parseNote, parseNoteIndexItem, parseNoteIndexPage, parseRelayErrorResponse, parseRelayErrorSignature, parseTransactionError, partialWithdraw, partiallySignTransaction, poseidonHash, preflightCheck, preflightNullifiers, prepareEncryptedOutput, prepareEncryptedOutputForRecipient, programInstruction, proofToBytes, pubkeyToFieldElement, pubkeyToLimbs, randomBytes, randomChangeNoteSalt, randomDepositNoteSalt, randomFieldElement, readMerkleTreeState, readRent, recipientDeliveryNoteToBase64, recoverNotesFromIndex, registerViewingKey, relayRequestDigestHex, removePendingDeposit, removePendingWithdrawal, renderAssessment, resolveCircuitsBase, retryDelayMs, savePendingDeposit, savePendingWithdrawal, scanNotesForWallet, scanRecipientDeliveryNotes, scanTransactions, sdkLogger, selectUtxos, sendInstructions, sendRawTransaction, sendTransaction, serializeAuthTransactionMessage, serializeNote, serializeUtxo, setCircuitsPath, setDebugMode, signCompiledTransaction, signMessageBytes, signRelayAuthPayload, signTransaction, signerFromKeypair, signerFromSecretKey, signerFromWalletAdapter, splitTo2Limbs, submitTransactToRelay, sumUtxoAmounts, swapUtxo, swapWithChange, toAddress, toComplianceReport, transact, transactBatch, transactionBase64, transactionBytes, transactionFromBytes, transactionWireSize, transfer, truncate, tryDecryptNote, updateNoteWithDeposit, updatePendingDeposit, updatePendingWithdrawal, bigintToBytes32 as utxoBigintToBytes32, utxoEquals, hexToBigint as utxoHexToBigint, validateDepositParams, validateNote, validateOutputsSum, validatePaymasterTopUpTransaction, validateRoot, validateTransfers, validateWalletConnected, validateWithdrawableNote, verifyAllCircuits, verifyCircuitIntegrity, verifyQuoteSignature, verifyUtxos, waitForRoot, withShieldRetries, withTiming, withdrawFeeFor };
6461
+ export { BRIDGE_ESCROW_LABEL, BRIDGE_ESCROW_LABEL_V2, BUILD_ALLOWS_LOCAL_ENDPOINTS, type BridgeDeliveryState, type BridgeDeposit, type BridgeDepositState, type BridgeQuoteAssessment, type BridgeQuoteInput, type BridgeRail, type BridgeRailAttestation, type BridgeRailProblem, type BridgeRailQuoteOption, type BridgeRailQuoteRequest, type BridgeRailQuoteResponse, type BridgeRailStatusResult, type BuildRecipientDeliveryNotesParams, CHAIN_NOTE_SALT_BITS, CLEANUP_FEE_BUDGET, CLOAK_PRODUCTION_RELAY_URL, CLOAK_PROGRAM_ID, type ChainNoteTxType, type CircuitVerificationResult, type CleanupResult, type CloakConfig, CloakError, type CloakKeyPair, type CloakNote, type CloakRpc, type CommitmentEntry, type CommitmentsResponse, type CompactChainNote, type ComplianceReport, type ComplianceTxType, type ConfirmSettlementParams, type CreateRecoverableDepositUtxoParams, DEFAULT_CIRCUITS_URL, DEFAULT_TRANSACTION_CIRCUITS_URL, DELIVERY_MEMO_TAG, DELIVERY_REGISTRY_SEED, type DeliveredNote, DepositError, type DepositInstructionParams, type DepositNoteSecrets, type DepositOptions, type DepositOutcome, type DepositRef, type DepositResult, type DepositStatus, type DiscoverOptions, type DiscoverSwapRefundsOptions, type DiscoveredSwapRefund, DoNotRetry, ECONOMIC_MINIMUM, EXPECTED_CIRCUIT_HASHES, type EncodeNoteIndexPageParams, type EncryptedMetadataBundle, type EncryptedNote$1 as EncryptedNote, type ErrorCategory, type ExpandedSpendKey, type ExternalFeePayerAdapter, FEE_BUDGET, FIXED_FEE_LAMPORTS, type FundingPlan, type Groth16Proof, type IndexedRecoveredNote, type IndexedRecoveredNoteKind, InsecureRandomnessError, LAMPORTS_PER_SOL, type LegacyWalletAdapter, type WalletSigner as LegacyWalletSigner, LocalStorageAdapter, type LogLevel, type Logger, type LookupTable, MAINNET_RENT_0, MAINNET_RENT_1, MAX_RECEIVER_INDEX, MERKLE_TREE_HEIGHT, MIN_DEPOSIT_LAMPORTS, MIN_DEPOSIT_SPL_BASE_UNITS, type MasterKey, type MatchChangeNoteParams, type MatchDepositNoteParams, type MatchSwapRefundLeafParams, type MaxLengthArray, MemoryStorageAdapter, type MerkleProof, type MerkleRootResponse, MerkleTree, type MessageSigner, NATIVE_SOL_MINT, NOTE_INDEX_NO_LEAF, NOTE_INDEX_PAGE_SIZE, type Network, type NoteData, type NoteIndexCursor, type NoteIndexDeliveryItem, type NoteIndexFetchOptions, NoteIndexFormatError, type NoteIndexHead, NoteIndexHeadBehindError, type NoteIndexItem, type NoteIndexPage, type NoteIndexRecoveryStats, type NoteIndexSwapRefundItem, type NoteIndexTxItem, ONECLICK_PUBKEY_B58, type OnchainMerkleProof, type ParseNoteIndexPageOptions, type ParsedDeliveryCarrier, type PaymasterTopUpExpectation, type PaymasterTopUpResult, type PendingDeposit, type PendingWithdrawal, type PostFailureVerdict, RECIPIENT_DELIVERY_CIPHERTEXT_LEN, RECIPIENT_DELIVERY_EPHEMERAL_PK_LEN, RECIPIENT_DELIVERY_NONCE_LEN, RECIPIENT_DELIVERY_NOTE_BYTES, RECIPIENT_DELIVERY_PLAINTEXT_LEN, RECIPIENT_DELIVERY_TAG_LEN, RELAY_BATCH_AUTH_MAX_ITEMS, RELAY_ORIGIN_ALLOWLIST, REQUEST_AUTH_BATCH_DOMAIN, REQUEST_AUTH_BATCH_MAX_AGE_SECONDS, REQUEST_AUTH_MAX_AGE_SECONDS, REQUEST_AUTH_MAX_FUTURE_SKEW_SECONDS, type RecipientDeliveryNote, type RecoverNotesFromIndexParams, type RecoverNotesFromIndexResult, type RecoveredChangeNote, type RecoveredChangeNoteRecord, type RecoveredDepositNote, type RecoveredDepositNoteRecord, type RecoveredSwapRefund, type RelayAuthMode, type RelayAuthPreimage, type RelayAuthSigner, RelayBatchAuthCoordinator, type RelayBatchAuthCoordinatorOptions, type RelayBatchAuthEnvelope, type RelayBatchAuthFields, type RelayBatchAuthItemHandle, RelayInternalError, RelayService, type RelaySubmissionResult, type RentRates, type RetryHooks, type RiskQuoteInstructionResponse, RootNotFoundError, SCANNER_SUPPORTS_TRANSACT_SWAP, SIGN_IN_MESSAGE, SanctionsQuoteError, type ScanOptions, type ScanRecipientDeliveryOptions, type ScanResult, type ScanSummary, type ScannedTransaction, type SettlementConnection, type SettlementContext, type SettlementStatus, type SettlementVerdict, SettlementVerificationError, ShieldPoolErrors, type ShieldPoolPDAs, SimpleWallet, type SpendKey, type SpendOptions, type StorageAdapter, type SubmitTransactToRelayArgs, type SwapOptions, type SwapParams, type SwapRefundAuthorization, type SwapRefundShape, type SwapResult, TERMINAL_FAILURE, TRANSACTION_CIRCUITS_VERSION, TRANSACT_AUTH_FIELDS, TRANSACT_SWAP_AUTH_FIELDS, type TransactBatchItem, type TransactBatchItemOutcome, type TransactBatchOptions, type TransactBatchResult, type TransactOptions, type TransactParams, type TransactRequestBodyParams, type TransactResult, TransactionConfirmationError, type TransactionMetadata, type Transfer, type TransferOptions, type TransferResult, type TxStatus, type UserFriendlyError, type Utxo, UtxoAlreadySpentError, type EncryptedNote as UtxoEncryptedNote, type UtxoKeypair, type UtxoSwapParams, type UtxoSwapResult, UtxoWallet, VARIABLE_FEE_DENOMINATOR, VARIABLE_FEE_NUMERATOR, VARIABLE_FEE_RATE, VERSION, type VerifyUtxosResult, type ViewKey, type ViewingKeyPair, WITHDRAW_FEE_BPS, WITHDRAW_FIXED_FEE, type WalletAdapterBridgeOptions, type WalletSigner$1 as WalletSigner, type WalletUtxo, type Web3Module, type WithdrawOptions, type WithdrawSubmissionResult, accountMeta, addressBytes, addressFromBytes, addressFromPublicKey, assertDirectSubmissionLanded, assertInputMints, assertTransactionCircuitIntegrity, assessBridgeQuote, bigintToBytes32$1 as bigintToBytes32, bigintToHex, buildAuthTransactionMessage, buildMerkleTree, buildMerkleTreeFromChain, buildMerkleTreeFromRelay, buildRecipientDeliveryNotes, buildRelayAuthPreimage, buildRelayBatchAuthMessage, buildTransactRequestBody, buildTransactionMessage, bytesToHex, calculateFee, calculateFeeBigint, calculateRelayFee, canRebuildMerkleTreeFromChain, canonicalJson, canonicalPayloadString, chainNoteFromBase64, chainNoteToBase64, classifyPostFailure, classifyRelayError, cleanupReceivingAddress, cleanupStalePendingOperations, clearPendingDeposits, clearPendingWithdrawals, cloakBridgeRail, computeChainNoteHash, computeExtDataHash, computeMerkleRoot, computeNoteIndexChain, computeProofForLatestDeposit, computeProofFromChain, computeSignature, computeSwapRefundCommitment, computeCommitment as computeUtxoCommitment, computeNullifier as computeUtxoNullifier, confirmSignature, confirmTransactSettlement, copyNoteToClipboard, createCloakError, createCloakRpc, createDepositInstruction, createLogger, createRecoverableChangeUtxo, createRecoverableDepositUtxo, createRelayBatchAuthCoordinator, createUtxo, createZeroUtxo, decryptCompactChainNote, decryptComplianceMetadataWithMasterKey, decryptTransactionMetadata, depositFromDerivedKey, deriveBridgeReceiver, deriveChangeNoteBlinding, deriveDepositNoteBlinding, deriveDiversifiedViewingKey, deriveDiversifier, deriveFundingTargets, deriveInputNullifierPdas, deriveLegacyBridgeReceiver, deriveLegacyDepositNoteSecrets, deriveLegacySwapRefundAuthorization, derivePublicKey, deriveSpendKey, deriveSwapRefundAuthorization, deriveSwapRefundBlinding, deriveSwapRefundKeypair, deriveUserCompliancePublicKey, deriveUserComplianceScalar, deriveUtxoKeypairFromSpendKey, deriveViewKey, deriveViewingKeyFromNk, deriveViewingKeyFromSpendKey, deriveViewingKeyFromUtxoPrivateKey, deserializeUtxo, detectNetworkFromRpcUrl, discoverSwapRefunds, downloadNote, encodeDeliveryCarrierMemo, encodeNoteIndexItem, encodeNoteIndexPage, encodeNoteSimple, encodeRecipientDeliveryNote, encryptCompactChainNote, encryptNoteForRecipient, encryptTransactionMetadata, encryptTransactionMetadataBundle, expandSpendKey, explainRelayAuthRejection, exportKeys, exportNote, exportWalletKeys, fetchAccountBytes, fetchCommitments, fetchLatestBlockhash, fetchLookupTables, fetchNoteIndexHead, fetchNoteIndexPage, fetchRiskQuoteInstruction, fetchRiskQuoteIx, fetchSignaturesForAddress, filterNotesByNetwork, filterWithdrawableNotes, findNoteByCommitment, findProgramAddress, formatAmount, formatComplianceCsv, formatErrorForLogging, formatSol, fullWithdraw, fundReceiverViaPaymaster, generateCloakKeys, generateCommitmentAsync, generateMasterSeed, generateNoteFromWallet, generateUtxoKeypair, generateViewingKeyPair, getAddressExplorerUrl, getChainNoteRegistryPDA, getCircuitsPath, getDeliveryRegistryPDA, getDistributableAmount, getExplorerUrl, getNkFromUtxoPrivateKey, getNullifierPDA, getPendingOperationsSummary, getPoolAuthorityConfigPDA, getPublicKey, getPublicViewKey, getRecipientAmount, getRpcUrlForNetwork, getShieldPoolPDAs, getSwapStatePDA, getViewKey, hasPendingOperations, hexToBigint$1 as hexToBigint, hexToBytes, importKeys, importWalletKeys, isBrowser, isBrowserLike, isDebugEnabled, isMessageSigner, isPlausibleSignature, isReactNative, isRootNotFoundError, isSubmissionOutcomeUnknownResponse, isTerminalFailure, isValidHex, isValidRpcUrl, isValidSolanaAddress, isWithdrawAmountSufficient, isWithdrawable, listBridgeDeposits, loadPendingDeposits, loadPendingWithdrawals, loadVerifiedCircuitArtifacts, matchChangeNote, matchDepositNote, matchSwapRefundLeaf, mayRetry, messageSignerFromCallback, openRecipientDeliveryNote, parseAmount, parseDeliveryCarrierMemo, parseError, parseNote, parseNoteIndexItem, parseNoteIndexPage, parseRelayErrorResponse, parseRelayErrorSignature, parseTransactionError, partialWithdraw, partiallySignTransaction, poseidonHash, preflightCheck, preflightNullifiers, prepareEncryptedOutput, prepareEncryptedOutputForRecipient, programInstruction, proofToBytes, pubkeyToFieldElement, pubkeyToLimbs, randomBytes, randomChangeNoteSalt, randomDepositNoteSalt, randomFieldElement, readMerkleTreeState, readRent, recipientDeliveryNoteToBase64, recoverNotesFromIndex, registerViewingKey, relayRequestDigestHex, removePendingDeposit, removePendingWithdrawal, renderAssessment, resolveCircuitsBase, retryDelayMs, savePendingDeposit, savePendingWithdrawal, scanNotesForWallet, scanRecipientDeliveryNotes, scanTransactions, sdkLogger, selectUtxos, sendInstructions, sendRawTransaction, sendTransaction, serializeAuthTransactionMessage, serializeNote, serializeUtxo, setCircuitsPath, setDebugMode, signCompiledTransaction, signMessageBytes, signRelayAuthPayload, signTransaction, signerFromKeypair, signerFromSecretKey, signerFromWalletAdapter, splitTo2Limbs, submitTransactToRelay, sumUtxoAmounts, swapUtxo, swapWithChange, toAddress, toComplianceReport, transact, transactBatch, transactionBase64, transactionBytes, transactionFromBytes, transactionWireSize, transfer, truncate, tryDecryptNote, updateNoteWithDeposit, updatePendingDeposit, updatePendingWithdrawal, bigintToBytes32 as utxoBigintToBytes32, utxoEquals, hexToBigint as utxoHexToBigint, validateDepositParams, validateNote, validateOutputsSum, validatePaymasterTopUpTransaction, validateRoot, validateTransfers, validateWalletConnected, validateWithdrawableNote, verifyAllCircuits, verifyCircuitIntegrity, verifyQuoteSignature, verifyUtxos, waitForRoot, withShieldRetries, withTiming, withdrawFeeFor };