Privacy API Reference
Privacy API Reference
APIs for integrating with Macro's privacy features.
Privacy Profiles API
Detect and respect Privacy Profiles:
macro_getCurrentProfile
Get information about active profile.
const profile = await ethereum.request({
method: 'macro_getCurrentProfile'
});
// Returns:
// {
// name: 'Work',
// id: 'profile_xyz',
// color: '#3B82F6',
// type: 'work' // 'work' | 'degen' | 'anon' | 'custom'
// }Use case: Adapt UI based on profile type.
VPN API
Check and suggest VPN usage:
macro_getVPNStatus
macro_suggestVPN
Suggest user enable VPN (doesn't force).
User sees: Non-intrusive suggestion to enable VPN.
Signing Policy API
Integrate with signing sandbox:
macro_getSigningPolicy
Get current policy for your dApp.
macro_requestTransactionPreview
Request transaction preview before sending.
Use case: Show preview in your UI before requesting signature.
Privacy Mixer API
Integrate mixer functionality:
macro_getMixerStatus
Check mixer availability.
macro_estimateMixerFee
Estimate mixing fee.
Private Swap API
MEV-protected swaps:
macro_estimatePrivateSwap
Estimate swap outcome.
Best Practices
When using privacy APIs:
Request privacy features, don't require them
Explain why privacy features benefit the user
Provide graceful fallback if feature unavailable
Respect user's privacy settings
Don't fingerprint or track users who use privacy features
Performance Optimization Guide
Last updated