Skip to main content
Send Bitcoin instantly between Spark wallets with zero fees.
Transfer Bitcoin

Transfer Bitcoin

Send Bitcoin to another Spark wallet using a simple transfer method. transfer(params) Transfers Bitcoin to another Spark wallet on the Spark network.
const transferResult = await wallet.transfer({
  receiverSparkAddress: "spark1p...", // Recipient's Spark address
  amountSats: 50000,                  // Amount in satoshis
});

console.log("Transfer successful:", transferResult);

Check Transfer Status

Monitor your transfers and track their status using transfer queries and events. getTransfers(limit?, offset?) Gets all transfers for the wallet with optional pagination.
getTransfers() includes Spark transfers, Lightning sends/receives, and cooperative exits. For token transaction details, use queryTokenTransactionsWithFilters().
// Get recent transfers
const transfers = await wallet.getTransfers(10);
console.log("Recent transfers:", transfers.transfers);

// Check specific transfer status
const recentTransfer = transfers.transfers[0];
console.log("Transfer ID:", recentTransfer.id);
console.log("Transfer status:", recentTransfer.status);
console.log("Amount:", recentTransfer.totalValue, "sats");

Real-time Transfer Monitoring

Monitor transfer status in real-time using event listeners.
// Listen for incoming transfer events
wallet.on("transfer:claimed", (transferId, updatedBalance) => {
  console.log(`Incoming transfer ${transferId} claimed! New balance: ${updatedBalance} sats`);
});

// Note: There are no events for outgoing transfers.
// The transfer() method returns immediately when the transfer completes.
The transfer:claimed event only fires for incoming transfers. For outgoing transfers, the transfer() method returns a WalletTransfer object when complete.