@cloak.dev/sdk 0.2.3-staging.16d1078 → 0.2.3-staging.4f641ea
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.cjs +609 -539
- package/dist/index.d.cts +205 -154
- package/dist/index.d.ts +205 -154
- package/dist/index.js +432 -363
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PublicKey, Transaction, AddressLookupTableAccount, Connection, TransactionInstruction,
|
|
1
|
+
import { PublicKey, Transaction, Keypair, AddressLookupTableAccount, Connection, TransactionInstruction, SendOptions, VersionedTransaction } from '@solana/web3.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The deployed Cloak program.
|
|
@@ -781,6 +781,199 @@ declare class LocalStorageAdapter implements StorageAdapter {
|
|
|
781
781
|
deleteKeys(): void;
|
|
782
782
|
}
|
|
783
783
|
|
|
784
|
+
/**
|
|
785
|
+
* How long the relay accepts a signed request after its `auth_issued_at`
|
|
786
|
+
* (`REQUEST_AUTH_MAX_AGE_SECONDS`, `api/request_auth.rs`).
|
|
787
|
+
*
|
|
788
|
+
* A FIRST-USE request past this window is rejected outright. The expiry exception the relay grants
|
|
789
|
+
* applies only to an exact replay of a request whose durable row already exists, which by
|
|
790
|
+
* definition never happens for a request that has not been accepted once.
|
|
791
|
+
*/
|
|
792
|
+
declare const REQUEST_AUTH_MAX_AGE_SECONDS = 300;
|
|
793
|
+
/**
|
|
794
|
+
* How far ahead of the relay's clock a request may be stamped
|
|
795
|
+
* (`REQUEST_AUTH_MAX_FUTURE_SKEW_SECONDS`, `api/request_auth.rs`).
|
|
796
|
+
*
|
|
797
|
+
* `auth_issued_at` comes from `Date.now()`. On a server that is NTP-disciplined; in a browser it
|
|
798
|
+
* is the user's own machine clock, and a laptop more than 30 seconds fast cannot authenticate at
|
|
799
|
+
* all until its clock is corrected.
|
|
800
|
+
*/
|
|
801
|
+
declare const REQUEST_AUTH_MAX_FUTURE_SKEW_SECONDS = 30;
|
|
802
|
+
/**
|
|
803
|
+
* The exact fields each endpoint signs. Both lists mirror the relay's `*_auth_request` builders and
|
|
804
|
+
* must stay in lockstep with them: adding a field on one side alone silently invalidates every
|
|
805
|
+
* signature, and the failure surfaces as a bare 401 with nothing pointing here.
|
|
806
|
+
*/
|
|
807
|
+
declare const TRANSACT_AUTH_FIELDS: readonly ["encrypted_notes", "max_fee", "mint", "proof_bytes", "public_inputs", "recipient", "recipient_delivery_notes", "risk_quote", "sender"];
|
|
808
|
+
declare const TRANSACT_SWAP_AUTH_FIELDS: readonly ["close_timed_out", "dexes", "encrypted_notes", "exclude_dexes", "max_fee", "min_output_amount", "output_mint", "proof_bytes", "public_inputs", "recipient", "recipient_ata", "refund_blinding", "refund_pubkey", "retry_request_id", "risk_quote", "route_retry_attempts", "sender", "slippage_bps", "swap_max_retries"];
|
|
809
|
+
/**
|
|
810
|
+
* Serialize exactly like the relay's `canonical_json`: keys sorted bytewise, no whitespace.
|
|
811
|
+
*
|
|
812
|
+
* SCOPE. This is the SDK's half of a byte-for-byte agreement with one specific Rust function over
|
|
813
|
+
* one specific schema: the values reachable through {@link TRANSACT_AUTH_FIELDS} and
|
|
814
|
+
* {@link TRANSACT_SWAP_AUTH_FIELDS}, which are ASCII keys over strings, small unsigned integers,
|
|
815
|
+
* booleans, nulls, arrays and plain objects. Inside that schema the two implementations agree.
|
|
816
|
+
*
|
|
817
|
+
* Outside it they need not, so anything that could serialize differently on the two sides is
|
|
818
|
+
* REFUSED here rather than signed into a digest that silently fails to match:
|
|
819
|
+
*
|
|
820
|
+
* - Non-integer, non-finite and beyond-safe-integer numbers. `serde_json` renders an f64 as Rust
|
|
821
|
+
* does (`1e21`) where JavaScript renders `1e+21`, and `0.1 + 0.2` has no single spelling. Every
|
|
822
|
+
* number in both field lists is a small unsigned integer (`slippage_bps`, `route_retry_attempts`,
|
|
823
|
+
* `swap_max_retries`); u64 amounts already travel as decimal STRINGS for exactly this reason.
|
|
824
|
+
* - Functions and symbols as object VALUES. `JSON.stringify` drops such a key from the wire body
|
|
825
|
+
* while it stays in the signed view, so the two digests can never agree.
|
|
826
|
+
*
|
|
827
|
+
* `undefined` is NOT refused: it serializes as `null` here, `JSON.stringify` omits the key on the
|
|
828
|
+
* wire, and every optional field on the relay side is `Option<T>` with `#[serde(default)]`, so the
|
|
829
|
+
* relay sees `null` too. That is the same agreement {@link buildAuthRequest} relies on. The one
|
|
830
|
+
* field where it does not hold is `slippage_bps`, which is why that field is checked by name.
|
|
831
|
+
*
|
|
832
|
+
* `bigint` is accepted and rendered as a bare decimal integer, matching serde's u64/i64 output.
|
|
833
|
+
* Note that such a value cannot also go on the wire: `JSON.stringify` throws on a bigint. Use a
|
|
834
|
+
* decimal string in the body, as every SDK-built body does.
|
|
835
|
+
*/
|
|
836
|
+
declare function canonicalJson(value: unknown): string;
|
|
837
|
+
interface RelayAuthFields {
|
|
838
|
+
sender: string;
|
|
839
|
+
auth_issued_at: string;
|
|
840
|
+
auth_nonce: string;
|
|
841
|
+
auth_signature: string;
|
|
842
|
+
/**
|
|
843
|
+
* How `auth_signature` was produced. Absent means an off-chain message, today's wire. Set to
|
|
844
|
+
* `"transaction"` when the wallet signed the no-op transaction envelope instead
|
|
845
|
+
* (`signRelayAuthPayload`). Not part of the signed view, so it never enters the digest.
|
|
846
|
+
*/
|
|
847
|
+
auth_mode?: RelayAuthMode;
|
|
848
|
+
}
|
|
849
|
+
/**
|
|
850
|
+
* Everything an authenticated request needs EXCEPT the signature: the three fields that go on the
|
|
851
|
+
* wire alongside it, plus the exact bytes to sign.
|
|
852
|
+
*
|
|
853
|
+
* This exists because the holder of the pen is not always a `Keypair`. A browser wallet adapter
|
|
854
|
+
* exposes `signMessage(bytes): Promise<Uint8Array>` and no secret key at all, so the scheme has to
|
|
855
|
+
* be reachable in two halves: build the preimage here, sign it wherever the key actually lives,
|
|
856
|
+
* then put `sender` / `auth_issued_at` / `auth_nonce` and the base64 signature on the body.
|
|
857
|
+
*
|
|
858
|
+
* `message` is a plain ed25519 detached-signature preimage — nothing about the scheme changes
|
|
859
|
+
* between a local keypair and a wallet, only who signs it.
|
|
860
|
+
*/
|
|
861
|
+
interface RelayAuthPreimage {
|
|
862
|
+
sender: string;
|
|
863
|
+
auth_issued_at: string;
|
|
864
|
+
auth_nonce: string;
|
|
865
|
+
message: Uint8Array;
|
|
866
|
+
}
|
|
867
|
+
/**
|
|
868
|
+
* Build the signed view and its preimage for one request, WITHOUT signing.
|
|
869
|
+
*
|
|
870
|
+
* `sender` is bound into the signed view and returned for the body — the relay rejects a request
|
|
871
|
+
* whose authenticated sender is not also present inside the signed payload. It must be the end
|
|
872
|
+
* user's own wallet: `sender` is the key screened for sanctions on a shield-to-shield send, so
|
|
873
|
+
* substituting an ephemeral or service key here moves the screening off the actual user.
|
|
874
|
+
*
|
|
875
|
+
* `nonce` and `issued_at` are generated here, once per call. Callers that re-POST a request must
|
|
876
|
+
* reuse the same preimage rather than rebuilding it, or the relay sees a brand-new request.
|
|
877
|
+
*/
|
|
878
|
+
declare function buildRelayAuthPreimage(endpoint: string, programId: PublicKey, body: Record<string, unknown>, sender: PublicKey, nowSeconds?: number, fields?: readonly string[]): RelayAuthPreimage;
|
|
879
|
+
/**
|
|
880
|
+
* An async message signer standing in for a `Keypair`.
|
|
881
|
+
*
|
|
882
|
+
* A browser wallet adapter has no secret key to hand over — it exposes `signMessage`, and what
|
|
883
|
+
* this scheme needs signed is a plain ed25519 detached signature, which is exactly what that
|
|
884
|
+
* produces. Only the holder of the pen changes.
|
|
885
|
+
*
|
|
886
|
+
* COMPLIANCE — `walletPublicKey` becomes the request's authenticated `sender`, and `sender` is the
|
|
887
|
+
* key screened for sanctions on a shield-to-shield send. It MUST be the end user's own wallet.
|
|
888
|
+
* Putting an ephemeral, service-held or otherwise substituted key here moves the screening onto a
|
|
889
|
+
* key that is not the user: a compliance regression, not a shortcut.
|
|
890
|
+
*/
|
|
891
|
+
interface RelayMessageSigner {
|
|
892
|
+
/** The end user's real wallet. Becomes the authenticated `sender`. Never an ephemeral key. */
|
|
893
|
+
walletPublicKey: PublicKey;
|
|
894
|
+
/** Wallet-adapter `signMessage`; must return the 64-byte ed25519 detached signature. */
|
|
895
|
+
signMessage: (message: Uint8Array) => Promise<Uint8Array>;
|
|
896
|
+
signAuthTransaction?: undefined;
|
|
897
|
+
}
|
|
898
|
+
/**
|
|
899
|
+
* A wallet that cannot sign messages at all (Ledger, Trezor) but can sign a transaction. It signs
|
|
900
|
+
* the deterministic no-op transaction from `buildAuthTransactionMessage` instead; the relay rebuilds
|
|
901
|
+
* the same bytes and verifies against them. See `signRelayAuthPayload`.
|
|
902
|
+
*/
|
|
903
|
+
interface RelayTransactionSigner {
|
|
904
|
+
walletPublicKey: PublicKey;
|
|
905
|
+
/** Wallet-adapter `signTransaction`. Receives a legacy `Transaction` and returns it signed. */
|
|
906
|
+
signAuthTransaction: <T extends Transaction>(transaction: T) => Promise<T>;
|
|
907
|
+
signMessage?: undefined;
|
|
908
|
+
}
|
|
909
|
+
type RelayAuthSigner = RelayMessageSigner | RelayTransactionSigner;
|
|
910
|
+
/** How a relay-auth payload was signed. Mirrors `RelayAuthMode` in the relay's `auth_envelope.rs`. */
|
|
911
|
+
type RelayAuthMode = "message" | "transaction";
|
|
912
|
+
/**
|
|
913
|
+
* The transaction a message-less wallet signs to authenticate a relay payload.
|
|
914
|
+
*
|
|
915
|
+
* Legacy message, one instruction: `sender -> sender`, 0 lamports, System program. The 32-byte
|
|
916
|
+
* `recent_blockhash` slot carries `sha256(payload)`, so the signature binds the payload exactly as
|
|
917
|
+
* a message signature would, through a shape every hardware wallet can sign. It cannot land on
|
|
918
|
+
* chain: the network does not know that "blockhash". It names no Cloak program, endpoint or domain,
|
|
919
|
+
* so it leaks nothing if published. Byte-identical to the relay's `build_auth_transaction_message`;
|
|
920
|
+
* the vector is pinned on both sides.
|
|
921
|
+
*/
|
|
922
|
+
declare function buildAuthTransactionMessage(sender: PublicKey, digest: Uint8Array): Transaction;
|
|
923
|
+
/** The exact bytes the wallet signs for `buildAuthTransactionMessage(sender, digest)`. */
|
|
924
|
+
declare function serializeAuthTransactionMessage(sender: PublicKey, digest: Uint8Array): Uint8Array;
|
|
925
|
+
/**
|
|
926
|
+
* Sign a relay-auth payload with whatever the caller holds: a local `Keypair` or a message signer
|
|
927
|
+
* signs the payload bytes; a transaction-only signer signs the no-op transaction carrying the
|
|
928
|
+
* payload's digest. Returns the 64-byte detached signature and the mode the relay must be told.
|
|
929
|
+
*/
|
|
930
|
+
declare function signRelayAuthPayload(signer: RelayAuthSigner | Keypair, payload: Uint8Array): Promise<{
|
|
931
|
+
signature: Uint8Array;
|
|
932
|
+
mode: RelayAuthMode;
|
|
933
|
+
}>;
|
|
934
|
+
/**
|
|
935
|
+
* Turn a relay rejection into something the person in front of the screen can act on.
|
|
936
|
+
*
|
|
937
|
+
* Every string matched here is an `Error::Unauthorized` from `api/request_auth.rs`, and all of them
|
|
938
|
+
* arrive as the same bare 401. Two of them are not the caller's mistake at all: an approval that
|
|
939
|
+
* sat too long, and a machine clock that is simply wrong. Returns `null` for anything that is not
|
|
940
|
+
* an authentication rejection, so callers can append it only when there is something to add.
|
|
941
|
+
*/
|
|
942
|
+
declare function explainRelayAuthRejection(responseText: string): string | null;
|
|
943
|
+
declare const REQUEST_AUTH_BATCH_DOMAIN = "CLOAK_RELAY_BATCH_AUTH_V1";
|
|
944
|
+
/**
|
|
945
|
+
* How long the relay accepts an item that arrives under a batch signature
|
|
946
|
+
* (`REQUEST_AUTH_BATCH_MAX_AGE_SECONDS`, `api/request_auth.rs`).
|
|
947
|
+
*
|
|
948
|
+
* Longer than the single-request window because one approval now stands in front of N
|
|
949
|
+
* submissions, each confirmed on chain in turn. Every digest is a specific proof over specific
|
|
950
|
+
* nullifiers and every item still burns its own nonce, so the extra time widens nothing except how
|
|
951
|
+
* long the SAME already-approved requests stay submittable.
|
|
952
|
+
*/
|
|
953
|
+
declare const REQUEST_AUTH_BATCH_MAX_AGE_SECONDS = 600;
|
|
954
|
+
/**
|
|
955
|
+
* Most items one batch signature may cover (`REQUEST_AUTH_BATCH_MAX_ITEMS`, `api/request_auth.rs`).
|
|
956
|
+
*
|
|
957
|
+
* The practical bound is lower and comes from the chain, not the relay: every spend appends two
|
|
958
|
+
* roots to the on-chain ring of 100, so N items proved against one root push that root out of the
|
|
959
|
+
* ring by themselves before N reaches 50, and sooner with other traffic. Size a batch as
|
|
960
|
+
* `(100 - expected foreign inserts while it submits) / 2`, and chunk above that.
|
|
961
|
+
*/
|
|
962
|
+
declare const RELAY_BATCH_AUTH_MAX_ITEMS = 64;
|
|
963
|
+
/** The batch envelope an item carries next to its per-request auth fields. Not part of the digest. */
|
|
964
|
+
interface RelayBatchAuthEnvelope {
|
|
965
|
+
/** Lowercase hex sha256 of every item's request-auth message, in the order the wallet signed. */
|
|
966
|
+
digests: string[];
|
|
967
|
+
}
|
|
968
|
+
/** Per-item wire fields under a batch signature: the single-request fields plus the envelope. */
|
|
969
|
+
interface RelayBatchAuthFields extends RelayAuthFields {
|
|
970
|
+
auth_batch: RelayBatchAuthEnvelope;
|
|
971
|
+
}
|
|
972
|
+
/** The digest an item contributes to a batch: sha256 of its request-auth message bytes, hex. */
|
|
973
|
+
declare function relayRequestDigestHex(preimage: RelayAuthPreimage): string;
|
|
974
|
+
/** Build the batch message the wallet signs. Byte-identical to `build_batch_auth_message`. */
|
|
975
|
+
declare function buildRelayBatchAuthMessage(programId: PublicKey, issuedAt: string, digests: readonly string[]): Uint8Array;
|
|
976
|
+
|
|
784
977
|
interface ViewingKeyPair {
|
|
785
978
|
privateKey: Uint8Array;
|
|
786
979
|
publicKey: Uint8Array;
|
|
@@ -858,7 +1051,7 @@ declare const SIGN_IN_MESSAGE = "Cloak: Sign in\n\nSign this message to securely
|
|
|
858
1051
|
* Relay stores nk and derives sk_d per note when exporting.
|
|
859
1052
|
* Registration is authenticated via one-time nonce challenge.
|
|
860
1053
|
*/
|
|
861
|
-
declare function registerViewingKey(relayUrl: string, userPubkey: PublicKey, nk: Uint8Array, signMessage: (message: Uint8Array) => Promise<Uint8Array>): Promise<void>;
|
|
1054
|
+
declare function registerViewingKey(relayUrl: string, userPubkey: PublicKey, nk: Uint8Array, signMessage: ((message: Uint8Array) => Promise<Uint8Array>) | RelayAuthSigner): Promise<void>;
|
|
862
1055
|
|
|
863
1056
|
interface EncryptMetadataContext {
|
|
864
1057
|
userPubkey?: PublicKey | string;
|
|
@@ -2081,7 +2274,7 @@ declare class RelayService {
|
|
|
2081
2274
|
* );
|
|
2082
2275
|
* ```
|
|
2083
2276
|
*/
|
|
2084
|
-
registerViewingKey(userPubkey: string, viewingKey: string, signMessage: (message: Uint8Array) => Promise<Uint8Array>): Promise<boolean>;
|
|
2277
|
+
registerViewingKey(userPubkey: string, viewingKey: string, signMessage: ((message: Uint8Array) => Promise<Uint8Array>) | RelayAuthSigner): Promise<boolean>;
|
|
2085
2278
|
/**
|
|
2086
2279
|
* Fetch relay compliance master public key.
|
|
2087
2280
|
* DEPRECATED: This endpoint is no longer used
|
|
@@ -2633,156 +2826,6 @@ declare function isBrowser(): boolean;
|
|
|
2633
2826
|
*/
|
|
2634
2827
|
declare function isBrowserLike(): boolean;
|
|
2635
2828
|
|
|
2636
|
-
/**
|
|
2637
|
-
* How long the relay accepts a signed request after its `auth_issued_at`
|
|
2638
|
-
* (`REQUEST_AUTH_MAX_AGE_SECONDS`, `api/request_auth.rs`).
|
|
2639
|
-
*
|
|
2640
|
-
* A FIRST-USE request past this window is rejected outright. The expiry exception the relay grants
|
|
2641
|
-
* applies only to an exact replay of a request whose durable row already exists, which by
|
|
2642
|
-
* definition never happens for a request that has not been accepted once.
|
|
2643
|
-
*/
|
|
2644
|
-
declare const REQUEST_AUTH_MAX_AGE_SECONDS = 300;
|
|
2645
|
-
/**
|
|
2646
|
-
* How far ahead of the relay's clock a request may be stamped
|
|
2647
|
-
* (`REQUEST_AUTH_MAX_FUTURE_SKEW_SECONDS`, `api/request_auth.rs`).
|
|
2648
|
-
*
|
|
2649
|
-
* `auth_issued_at` comes from `Date.now()`. On a server that is NTP-disciplined; in a browser it
|
|
2650
|
-
* is the user's own machine clock, and a laptop more than 30 seconds fast cannot authenticate at
|
|
2651
|
-
* all until its clock is corrected.
|
|
2652
|
-
*/
|
|
2653
|
-
declare const REQUEST_AUTH_MAX_FUTURE_SKEW_SECONDS = 30;
|
|
2654
|
-
/**
|
|
2655
|
-
* The exact fields each endpoint signs. Both lists mirror the relay's `*_auth_request` builders and
|
|
2656
|
-
* must stay in lockstep with them: adding a field on one side alone silently invalidates every
|
|
2657
|
-
* signature, and the failure surfaces as a bare 401 with nothing pointing here.
|
|
2658
|
-
*/
|
|
2659
|
-
declare const TRANSACT_AUTH_FIELDS: readonly ["encrypted_notes", "max_fee", "mint", "proof_bytes", "public_inputs", "recipient", "recipient_delivery_notes", "risk_quote", "sender"];
|
|
2660
|
-
declare const TRANSACT_SWAP_AUTH_FIELDS: readonly ["close_timed_out", "dexes", "encrypted_notes", "exclude_dexes", "max_fee", "min_output_amount", "output_mint", "proof_bytes", "public_inputs", "recipient", "recipient_ata", "refund_blinding", "refund_pubkey", "retry_request_id", "risk_quote", "route_retry_attempts", "sender", "slippage_bps", "swap_max_retries"];
|
|
2661
|
-
/**
|
|
2662
|
-
* Serialize exactly like the relay's `canonical_json`: keys sorted bytewise, no whitespace.
|
|
2663
|
-
*
|
|
2664
|
-
* SCOPE. This is the SDK's half of a byte-for-byte agreement with one specific Rust function over
|
|
2665
|
-
* one specific schema: the values reachable through {@link TRANSACT_AUTH_FIELDS} and
|
|
2666
|
-
* {@link TRANSACT_SWAP_AUTH_FIELDS}, which are ASCII keys over strings, small unsigned integers,
|
|
2667
|
-
* booleans, nulls, arrays and plain objects. Inside that schema the two implementations agree.
|
|
2668
|
-
*
|
|
2669
|
-
* Outside it they need not, so anything that could serialize differently on the two sides is
|
|
2670
|
-
* REFUSED here rather than signed into a digest that silently fails to match:
|
|
2671
|
-
*
|
|
2672
|
-
* - Non-integer, non-finite and beyond-safe-integer numbers. `serde_json` renders an f64 as Rust
|
|
2673
|
-
* does (`1e21`) where JavaScript renders `1e+21`, and `0.1 + 0.2` has no single spelling. Every
|
|
2674
|
-
* number in both field lists is a small unsigned integer (`slippage_bps`, `route_retry_attempts`,
|
|
2675
|
-
* `swap_max_retries`); u64 amounts already travel as decimal STRINGS for exactly this reason.
|
|
2676
|
-
* - Functions and symbols as object VALUES. `JSON.stringify` drops such a key from the wire body
|
|
2677
|
-
* while it stays in the signed view, so the two digests can never agree.
|
|
2678
|
-
*
|
|
2679
|
-
* `undefined` is NOT refused: it serializes as `null` here, `JSON.stringify` omits the key on the
|
|
2680
|
-
* wire, and every optional field on the relay side is `Option<T>` with `#[serde(default)]`, so the
|
|
2681
|
-
* relay sees `null` too. That is the same agreement {@link buildAuthRequest} relies on. The one
|
|
2682
|
-
* field where it does not hold is `slippage_bps`, which is why that field is checked by name.
|
|
2683
|
-
*
|
|
2684
|
-
* `bigint` is accepted and rendered as a bare decimal integer, matching serde's u64/i64 output.
|
|
2685
|
-
* Note that such a value cannot also go on the wire: `JSON.stringify` throws on a bigint. Use a
|
|
2686
|
-
* decimal string in the body, as every SDK-built body does.
|
|
2687
|
-
*/
|
|
2688
|
-
declare function canonicalJson(value: unknown): string;
|
|
2689
|
-
interface RelayAuthFields {
|
|
2690
|
-
sender: string;
|
|
2691
|
-
auth_issued_at: string;
|
|
2692
|
-
auth_nonce: string;
|
|
2693
|
-
auth_signature: string;
|
|
2694
|
-
}
|
|
2695
|
-
/**
|
|
2696
|
-
* Everything an authenticated request needs EXCEPT the signature: the three fields that go on the
|
|
2697
|
-
* wire alongside it, plus the exact bytes to sign.
|
|
2698
|
-
*
|
|
2699
|
-
* This exists because the holder of the pen is not always a `Keypair`. A browser wallet adapter
|
|
2700
|
-
* exposes `signMessage(bytes): Promise<Uint8Array>` and no secret key at all, so the scheme has to
|
|
2701
|
-
* be reachable in two halves: build the preimage here, sign it wherever the key actually lives,
|
|
2702
|
-
* then put `sender` / `auth_issued_at` / `auth_nonce` and the base64 signature on the body.
|
|
2703
|
-
*
|
|
2704
|
-
* `message` is a plain ed25519 detached-signature preimage — nothing about the scheme changes
|
|
2705
|
-
* between a local keypair and a wallet, only who signs it.
|
|
2706
|
-
*/
|
|
2707
|
-
interface RelayAuthPreimage {
|
|
2708
|
-
sender: string;
|
|
2709
|
-
auth_issued_at: string;
|
|
2710
|
-
auth_nonce: string;
|
|
2711
|
-
message: Uint8Array;
|
|
2712
|
-
}
|
|
2713
|
-
/**
|
|
2714
|
-
* Build the signed view and its preimage for one request, WITHOUT signing.
|
|
2715
|
-
*
|
|
2716
|
-
* `sender` is bound into the signed view and returned for the body — the relay rejects a request
|
|
2717
|
-
* whose authenticated sender is not also present inside the signed payload. It must be the end
|
|
2718
|
-
* user's own wallet: `sender` is the key screened for sanctions on a shield-to-shield send, so
|
|
2719
|
-
* substituting an ephemeral or service key here moves the screening off the actual user.
|
|
2720
|
-
*
|
|
2721
|
-
* `nonce` and `issued_at` are generated here, once per call. Callers that re-POST a request must
|
|
2722
|
-
* reuse the same preimage rather than rebuilding it, or the relay sees a brand-new request.
|
|
2723
|
-
*/
|
|
2724
|
-
declare function buildRelayAuthPreimage(endpoint: string, programId: PublicKey, body: Record<string, unknown>, sender: PublicKey, nowSeconds?: number, fields?: readonly string[]): RelayAuthPreimage;
|
|
2725
|
-
/**
|
|
2726
|
-
* An async message signer standing in for a `Keypair`.
|
|
2727
|
-
*
|
|
2728
|
-
* A browser wallet adapter has no secret key to hand over — it exposes `signMessage`, and what
|
|
2729
|
-
* this scheme needs signed is a plain ed25519 detached signature, which is exactly what that
|
|
2730
|
-
* produces. Only the holder of the pen changes.
|
|
2731
|
-
*
|
|
2732
|
-
* COMPLIANCE — `walletPublicKey` becomes the request's authenticated `sender`, and `sender` is the
|
|
2733
|
-
* key screened for sanctions on a shield-to-shield send. It MUST be the end user's own wallet.
|
|
2734
|
-
* Putting an ephemeral, service-held or otherwise substituted key here moves the screening onto a
|
|
2735
|
-
* key that is not the user: a compliance regression, not a shortcut.
|
|
2736
|
-
*/
|
|
2737
|
-
interface RelayAuthSigner {
|
|
2738
|
-
/** The end user's real wallet. Becomes the authenticated `sender`. Never an ephemeral key. */
|
|
2739
|
-
walletPublicKey: PublicKey;
|
|
2740
|
-
/** Wallet-adapter `signMessage`; must return the 64-byte ed25519 detached signature. */
|
|
2741
|
-
signMessage: (message: Uint8Array) => Promise<Uint8Array>;
|
|
2742
|
-
}
|
|
2743
|
-
/**
|
|
2744
|
-
* Turn a relay rejection into something the person in front of the screen can act on.
|
|
2745
|
-
*
|
|
2746
|
-
* Every string matched here is an `Error::Unauthorized` from `api/request_auth.rs`, and all of them
|
|
2747
|
-
* arrive as the same bare 401. Two of them are not the caller's mistake at all: an approval that
|
|
2748
|
-
* sat too long, and a machine clock that is simply wrong. Returns `null` for anything that is not
|
|
2749
|
-
* an authentication rejection, so callers can append it only when there is something to add.
|
|
2750
|
-
*/
|
|
2751
|
-
declare function explainRelayAuthRejection(responseText: string): string | null;
|
|
2752
|
-
declare const REQUEST_AUTH_BATCH_DOMAIN = "CLOAK_RELAY_BATCH_AUTH_V1";
|
|
2753
|
-
/**
|
|
2754
|
-
* How long the relay accepts an item that arrives under a batch signature
|
|
2755
|
-
* (`REQUEST_AUTH_BATCH_MAX_AGE_SECONDS`, `api/request_auth.rs`).
|
|
2756
|
-
*
|
|
2757
|
-
* Longer than the single-request window because one approval now stands in front of N
|
|
2758
|
-
* submissions, each confirmed on chain in turn. Every digest is a specific proof over specific
|
|
2759
|
-
* nullifiers and every item still burns its own nonce, so the extra time widens nothing except how
|
|
2760
|
-
* long the SAME already-approved requests stay submittable.
|
|
2761
|
-
*/
|
|
2762
|
-
declare const REQUEST_AUTH_BATCH_MAX_AGE_SECONDS = 600;
|
|
2763
|
-
/**
|
|
2764
|
-
* Most items one batch signature may cover (`REQUEST_AUTH_BATCH_MAX_ITEMS`, `api/request_auth.rs`).
|
|
2765
|
-
*
|
|
2766
|
-
* The practical bound is lower and comes from the chain, not the relay: every spend appends two
|
|
2767
|
-
* roots to the on-chain ring of 100, so N items proved against one root push that root out of the
|
|
2768
|
-
* ring by themselves before N reaches 50, and sooner with other traffic. Size a batch as
|
|
2769
|
-
* `(100 - expected foreign inserts while it submits) / 2`, and chunk above that.
|
|
2770
|
-
*/
|
|
2771
|
-
declare const RELAY_BATCH_AUTH_MAX_ITEMS = 64;
|
|
2772
|
-
/** The batch envelope an item carries next to its per-request auth fields. Not part of the digest. */
|
|
2773
|
-
interface RelayBatchAuthEnvelope {
|
|
2774
|
-
/** Lowercase hex sha256 of every item's request-auth message, in the order the wallet signed. */
|
|
2775
|
-
digests: string[];
|
|
2776
|
-
}
|
|
2777
|
-
/** Per-item wire fields under a batch signature: the single-request fields plus the envelope. */
|
|
2778
|
-
interface RelayBatchAuthFields extends RelayAuthFields {
|
|
2779
|
-
auth_batch: RelayBatchAuthEnvelope;
|
|
2780
|
-
}
|
|
2781
|
-
/** The digest an item contributes to a batch: sha256 of its request-auth message bytes, hex. */
|
|
2782
|
-
declare function relayRequestDigestHex(preimage: RelayAuthPreimage): string;
|
|
2783
|
-
/** Build the batch message the wallet signs. Byte-identical to `build_batch_auth_message`. */
|
|
2784
|
-
declare function buildRelayBatchAuthMessage(programId: PublicKey, issuedAt: string, digests: readonly string[]): Uint8Array;
|
|
2785
|
-
|
|
2786
2829
|
/**
|
|
2787
2830
|
* One wallet approval for a batch of relay requests (CLOAK_RELAY_BATCH_AUTH_V1).
|
|
2788
2831
|
*
|
|
@@ -3148,6 +3191,14 @@ interface TransactOptions {
|
|
|
3148
3191
|
signTransaction?: <T extends Transaction | VersionedTransaction>(transaction: T) => Promise<T>;
|
|
3149
3192
|
/** Wallet adapter signMessage for viewing-key registration auth. */
|
|
3150
3193
|
signMessage?: (message: Uint8Array) => Promise<Uint8Array>;
|
|
3194
|
+
/**
|
|
3195
|
+
* Relay authentication for a wallet that cannot sign messages at all (Ledger, Trezor): the
|
|
3196
|
+
* wallet-adapter `signTransaction`, used to sign a deterministic no-op transaction that carries
|
|
3197
|
+
* the request digest in its blockhash slot instead of signing the text (`relay/payload.ts`,
|
|
3198
|
+
* `buildAuthTransactionMessage`). Also used for viewing-key registration. Requires
|
|
3199
|
+
* `walletPublicKey` (or `depositorPublicKey`). `signMessage` wins when both are present.
|
|
3200
|
+
*/
|
|
3201
|
+
signAuthTransaction?: <T extends Transaction>(transaction: T) => Promise<T>;
|
|
3151
3202
|
/** Public key of the depositor when using signTransaction */
|
|
3152
3203
|
depositorPublicKey?: PublicKey;
|
|
3153
3204
|
/** Wallet public key for relay submissions when depositor keypair isn't used. */
|
|
@@ -5595,4 +5646,4 @@ declare const VERSION = "0.2.3";
|
|
|
5595
5646
|
/** True when scanner supports TransactSwap (tag 1). Check this to verify the correct SDK bundle is loaded. */
|
|
5596
5647
|
declare const SCANNER_SUPPORTS_TRANSACT_SWAP = true;
|
|
5597
5648
|
|
|
5598
|
-
export { BRIDGE_ESCROW_LABEL, 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 CommitmentEntry, type CommitmentsResponse, type CompactChainNote, type ComplianceReport, type ComplianceTxType, type ConfirmSettlementParams, 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 EncryptedMetadataBundle, type EncryptedNote$1 as EncryptedNote, type ErrorCategory, type ExpandedSpendKey, type ExternalFeePayerAdapter, FEE_BUDGET, FIXED_FEE_LAMPORTS, type FundingPlan, type Groth16Proof, InsecureRandomnessError, LAMPORTS_PER_SOL, LocalStorageAdapter, type LogLevel, type Logger, 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, NATIVE_SOL_MINT, type Network, type NoteData, 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 RecoveredChangeNote, type RecoveredChangeNoteRecord, type RecoveredDepositNote, type RecoveredDepositNoteRecord, type RecoveredSwapRefund, 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 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, 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 WalletAdapter, type WalletUtxo, type WithdrawOptions, type WithdrawSubmissionResult, assertDirectSubmissionLanded, assertInputMints, assertTransactionCircuitIntegrity, assessBridgeQuote, bigintToBytes32$1 as bigintToBytes32, bigintToHex, buildMerkleTree, buildMerkleTreeFromChain, buildMerkleTreeFromRelay, buildRecipientDeliveryNotes, buildRelayAuthPreimage, buildRelayBatchAuthMessage, buildTransactRequestBody, bytesToHex, calculateFee, calculateFeeBigint, calculateRelayFee, canRebuildMerkleTreeFromChain, canonicalJson, canonicalPayloadString, chainNoteFromBase64, chainNoteToBase64, classifyPostFailure, classifyRelayError, cleanupReceivingAddress, cleanupStalePendingOperations, clearPendingDeposits, clearPendingWithdrawals, cloakBridgeRail, computeChainNoteHash, computeExtDataHash, computeMerkleRoot, computeProofForLatestDeposit, computeProofFromChain, computeSignature, computeSwapRefundCommitment, computeCommitment as computeUtxoCommitment, computeNullifier as computeUtxoNullifier, confirmTransactSettlement, copyNoteToClipboard, createCloakError, createDepositInstruction, createLogger, createRecoverableChangeUtxo, createRecoverableDepositUtxo, createRelayBatchAuthCoordinator, createUtxo, createZeroUtxo, decryptCompactChainNote, decryptComplianceMetadataWithMasterKey, decryptTransactionMetadata, depositFromDerivedKey, deriveBridgeReceiver, deriveChangeNoteBlinding, deriveDepositNoteSecrets, deriveDiversifiedViewingKey, deriveDiversifier, deriveFundingTargets, deriveInputNullifierPdas, derivePublicKey, deriveSpendKey, deriveSwapRefundAuthorization, deriveUserCompliancePublicKey, deriveUserComplianceScalar, deriveUtxoKeypairFromSpendKey, deriveViewKey, deriveViewingKeyFromNk, deriveViewingKeyFromSpendKey, deriveViewingKeyFromUtxoPrivateKey, deserializeUtxo, detectNetworkFromRpcUrl, discoverSwapRefunds, downloadNote, encodeDeliveryCarrierMemo, encodeNoteSimple, encodeRecipientDeliveryNote, encryptCompactChainNote, encryptNoteForRecipient, encryptTransactionMetadata, encryptTransactionMetadataBundle, expandSpendKey, explainRelayAuthRejection, exportKeys, exportNote, exportWalletKeys, fetchCommitments, fetchRiskQuoteInstruction, fetchRiskQuoteIx, filterNotesByNetwork, filterWithdrawableNotes, findNoteByCommitment, 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, isPlausibleSignature, isReactNative, isRootNotFoundError, isSubmissionOutcomeUnknownResponse, isTerminalFailure, isValidHex, isValidRpcUrl, isValidSolanaAddress, isWithdrawAmountSufficient, isWithdrawable, keypairToAdapter, listBridgeDeposits, loadPendingDeposits, loadPendingWithdrawals, loadVerifiedCircuitArtifacts, matchChangeNote, matchDepositNote, matchSwapRefundLeaf, mayRetry, openRecipientDeliveryNote, parseAmount, parseDeliveryCarrierMemo, parseError, parseNote, parseRelayErrorResponse, parseRelayErrorSignature, parseTransactionError, partialWithdraw, poseidonHash, preflightCheck, preflightNullifiers, prepareEncryptedOutput, prepareEncryptedOutputForRecipient, proofToBytes, pubkeyToFieldElement, pubkeyToLimbs, randomBytes, randomChangeNoteSalt, randomDepositNoteSalt, randomFieldElement, readMerkleTreeState, readRent, recipientDeliveryNoteToBase64, registerViewingKey, relayRequestDigestHex, removePendingDeposit, removePendingWithdrawal, renderAssessment, resolveCircuitsBase, retryDelayMs, savePendingDeposit, savePendingWithdrawal, scanNotesForWallet, scanRecipientDeliveryNotes, scanTransactions, sdkLogger, selectUtxos, sendTransaction, serializeNote, serializeUtxo, setCircuitsPath, setDebugMode, signTransaction, splitTo2Limbs, submitTransactToRelay, sumUtxoAmounts, swapUtxo, swapWithChange, toComplianceReport, transact, transactBatch, 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 };
|
|
5649
|
+
export { BRIDGE_ESCROW_LABEL, 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 CommitmentEntry, type CommitmentsResponse, type CompactChainNote, type ComplianceReport, type ComplianceTxType, type ConfirmSettlementParams, 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 EncryptedMetadataBundle, type EncryptedNote$1 as EncryptedNote, type ErrorCategory, type ExpandedSpendKey, type ExternalFeePayerAdapter, FEE_BUDGET, FIXED_FEE_LAMPORTS, type FundingPlan, type Groth16Proof, InsecureRandomnessError, LAMPORTS_PER_SOL, LocalStorageAdapter, type LogLevel, type Logger, 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, NATIVE_SOL_MINT, type Network, type NoteData, 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 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, type RelayMessageSigner, RelayService, type RelaySubmissionResult, type RelayTransactionSigner, 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 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, 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 WalletAdapter, type WalletUtxo, type WithdrawOptions, type WithdrawSubmissionResult, assertDirectSubmissionLanded, assertInputMints, assertTransactionCircuitIntegrity, assessBridgeQuote, bigintToBytes32$1 as bigintToBytes32, bigintToHex, buildAuthTransactionMessage, buildMerkleTree, buildMerkleTreeFromChain, buildMerkleTreeFromRelay, buildRecipientDeliveryNotes, buildRelayAuthPreimage, buildRelayBatchAuthMessage, buildTransactRequestBody, bytesToHex, calculateFee, calculateFeeBigint, calculateRelayFee, canRebuildMerkleTreeFromChain, canonicalJson, canonicalPayloadString, chainNoteFromBase64, chainNoteToBase64, classifyPostFailure, classifyRelayError, cleanupReceivingAddress, cleanupStalePendingOperations, clearPendingDeposits, clearPendingWithdrawals, cloakBridgeRail, computeChainNoteHash, computeExtDataHash, computeMerkleRoot, computeProofForLatestDeposit, computeProofFromChain, computeSignature, computeSwapRefundCommitment, computeCommitment as computeUtxoCommitment, computeNullifier as computeUtxoNullifier, confirmTransactSettlement, copyNoteToClipboard, createCloakError, createDepositInstruction, createLogger, createRecoverableChangeUtxo, createRecoverableDepositUtxo, createRelayBatchAuthCoordinator, createUtxo, createZeroUtxo, decryptCompactChainNote, decryptComplianceMetadataWithMasterKey, decryptTransactionMetadata, depositFromDerivedKey, deriveBridgeReceiver, deriveChangeNoteBlinding, deriveDepositNoteSecrets, deriveDiversifiedViewingKey, deriveDiversifier, deriveFundingTargets, deriveInputNullifierPdas, derivePublicKey, deriveSpendKey, deriveSwapRefundAuthorization, deriveUserCompliancePublicKey, deriveUserComplianceScalar, deriveUtxoKeypairFromSpendKey, deriveViewKey, deriveViewingKeyFromNk, deriveViewingKeyFromSpendKey, deriveViewingKeyFromUtxoPrivateKey, deserializeUtxo, detectNetworkFromRpcUrl, discoverSwapRefunds, downloadNote, encodeDeliveryCarrierMemo, encodeNoteSimple, encodeRecipientDeliveryNote, encryptCompactChainNote, encryptNoteForRecipient, encryptTransactionMetadata, encryptTransactionMetadataBundle, expandSpendKey, explainRelayAuthRejection, exportKeys, exportNote, exportWalletKeys, fetchCommitments, fetchRiskQuoteInstruction, fetchRiskQuoteIx, filterNotesByNetwork, filterWithdrawableNotes, findNoteByCommitment, 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, isPlausibleSignature, isReactNative, isRootNotFoundError, isSubmissionOutcomeUnknownResponse, isTerminalFailure, isValidHex, isValidRpcUrl, isValidSolanaAddress, isWithdrawAmountSufficient, isWithdrawable, keypairToAdapter, listBridgeDeposits, loadPendingDeposits, loadPendingWithdrawals, loadVerifiedCircuitArtifacts, matchChangeNote, matchDepositNote, matchSwapRefundLeaf, mayRetry, openRecipientDeliveryNote, parseAmount, parseDeliveryCarrierMemo, parseError, parseNote, parseRelayErrorResponse, parseRelayErrorSignature, parseTransactionError, partialWithdraw, poseidonHash, preflightCheck, preflightNullifiers, prepareEncryptedOutput, prepareEncryptedOutputForRecipient, proofToBytes, pubkeyToFieldElement, pubkeyToLimbs, randomBytes, randomChangeNoteSalt, randomDepositNoteSalt, randomFieldElement, readMerkleTreeState, readRent, recipientDeliveryNoteToBase64, registerViewingKey, relayRequestDigestHex, removePendingDeposit, removePendingWithdrawal, renderAssessment, resolveCircuitsBase, retryDelayMs, savePendingDeposit, savePendingWithdrawal, scanNotesForWallet, scanRecipientDeliveryNotes, scanTransactions, sdkLogger, selectUtxos, sendTransaction, serializeAuthTransactionMessage, serializeNote, serializeUtxo, setCircuitsPath, setDebugMode, signRelayAuthPayload, signTransaction, splitTo2Limbs, submitTransactToRelay, sumUtxoAmounts, swapUtxo, swapWithChange, toComplianceReport, transact, transactBatch, 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 };
|