Skip to content

Solana deposits

A Solana-source quote has txKind: 'svm' and a base64 solanaTx. The API builds the versioned transaction; the active Solana wallet reviews and signs it.

import type { PrivateQuote } from '@silentswap/sdk';
 
declare const quote: PrivateQuote;
 
if (!('type' in quote.deposit) && quote.deposit.txKind === 'svm') {
  const encodedTransaction = quote.deposit.solanaTx;
  if (!encodedTransaction) throw new Error('Missing quoted Solana transaction');
 
  // placeOrder validates the payer, then invokes the configured Solana adapter.
  console.log(encodedTransaction, quote.ticket);
}

The SDK requires the adapter address to match inputAddress. Phantom must use Phantom's provider; MetaMask multichain must use its own session. Never fall back to a generic window.solana provider, because that can expose another wallet brand's account.

The SDK accepts the serialized solanaTx and rejects a mismatched payer before the wallet opens.