Skip to content

sendPrivateSPLTransfer()

SIP Protocol API Reference v0.7.4


SIP Protocol API Reference / sendPrivateSPLTransfer

sendPrivateSPLTransfer(params): Promise<SolanaPrivateTransferResult>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:15644

Send SPL tokens privately to a stealth address

This function:

  1. Generates a one-time stealth address from recipient’s meta-address
  2. Creates/gets Associated Token Account for the stealth address
  3. Transfers tokens to the stealth address
  4. Adds memo with ephemeral key for recipient scanning

SolanaPrivateTransferParams

Transfer parameters

Promise<SolanaPrivateTransferResult>

Transfer result with stealth address and explorer URL

import { sendPrivateSPLTransfer } from '@sip-protocol/sdk'
const result = await sendPrivateSPLTransfer({
connection,
sender: wallet.publicKey,
senderTokenAccount: senderATA,
recipientMetaAddress: {
chain: 'solana',
spendingKey: '0x...',
viewingKey: '0x...',
},
mint: new PublicKey('EPjFWdd5...'), // USDC
amount: 5_000_000n, // 5 USDC (6 decimals)
signTransaction: wallet.signTransaction,
})
console.log('Sent to:', result.stealthAddress)
console.log('View on Solscan:', result.explorerUrl)