Overview
Make your wallet fully private with a single call. By default, Spark transactions are visible from public endpoints. When you enable privacy mode, your transaction history becomes invisible.
Privacy mode currently applies to Bitcoin transactions only. Token transactions remain visible.
Enable Privacy Mode
setPrivacyEnabled()
Toggle privacy mode on or off for your wallet.
Enable Privacy
Disable Privacy
import { SparkWallet } from "@buildonspark/spark-sdk" ;
const { wallet } = await SparkWallet . initialize ({
mnemonicOrSeed: "your mnemonic here" ,
options: { network: "MAINNET" }
});
// Enable privacy mode
await wallet . setPrivacyEnabled ( true );
console . log ( "Privacy mode enabled. Your transactions are now hidden." );
true to hide transactions from public view, false to make them visible.
The updated wallet settings, including the new privacy state.
Check Current Settings
getWalletSettings()
Query your wallet’s current privacy configuration.
const settings = await wallet . getWalletSettings ();
if ( settings ?. privateEnabled ) {
console . log ( "Privacy mode is ON" );
} else {
console . log ( "Privacy mode is OFF" );
}
Whether privacy mode is currently enabled.
The wallet’s identity public key.
How It Works
When privacy mode is enabled:
Block explorers see nothing. Your address and transactions won’t appear publicly.
Public APIs return empty. Third parties querying your address get no results.
You retain full access. Your wallet can still query all your transactions normally.
Privacy mode controls query visibility, not on-chain data. Your funds remain fully secure and self-custodial regardless of this setting.
API Reference
// Enable or disable privacy mode
await wallet . setPrivacyEnabled ( privacyEnabled : boolean ): Promise < WalletSettings >
// Query current wallet settings
await wallet . getWalletSettings (): Promise < WalletSettings >
WalletSettings Type:
interface WalletSettings {
privateEnabled : boolean ;
ownerIdentityPublicKey : string ;
}