Skip to content

Bitcoin and Litecoin deposits

SilentSwap supports two UTXO deposit shapes.

Pay-in address

A utxo deposit is an external transfer. Show the exact address, currency, and amount. The funds may come from a wallet or exchange.

import {
  isUtxoDeposit,
  type PrivateQuote,
  type SilentSwapClient,
} from '@silentswap/sdk';
 
declare const client: SilentSwapClient;
declare const quote: PrivateQuote;
 
if (isUtxoDeposit(quote.deposit)) {
  const payment = {
    address: quote.deposit.payinAddress,
    amount: quote.deposit.expectedAmount,
    currency: quote.deposit.currency,
  };
 
  const order = await client.placeOrder(quote);
  console.log(payment, order.reference);
}

Without a matching wallet capability, placeOrder returns awaiting-external-deposit with the same pay-in instructions.

Bitcoin PSBT

A btc-psbt deposit spends the quoted refundTo account's UTXOs. The SDK audits every output, the refund address, inputs, absolute fee, and fee rate before invoking the Bitcoin adapter. The adapter receives the decoded audit so it can display the exact spend.

If signing or broadcast fails, keep the ticket and the rejection capability so the UI can recover or explicitly abandon the still-unfunded order.