import { PrivacyCash } from 'privacycash';
const client = new PrivacyCash({
RPC_url: 'YOUR_SOLANA_MAINNET_RPC_URL',
owner: 'YOUR_PRIVATE_KEY'
});
async function withdrawSol() {
const recipientAddress = 'RECIPIENT_ADDRESS';
// Withdraw 0.01 SOL
const withdrawRes = await client.withdraw({
lamports: 0.01 * 1_000_000_000,
recipientAddress
});
console.log(withdrawRes);
// Check balance after withdrawal
const privateBalance = await client.getPrivateBalance();
console.log('Balance after withdraw:', privateBalance.lamports / 1_000_000_000, 'SOL');
}
withdrawSol();