Skip to content
On this page

Unstake Solana

The unstake namespace contains methods used for sending transactions to unstake tokens. The unique method to the unstake namespace is:

  • unstake(address, lamports): Unstake user tokens.

Unstake Code Example

ts
// Import SDK
import { Solana } from "@everstake/wallet-sdk-solana";

// User wallet address.
const address = "exampleCnpYVG5ukLQsfusLqMGFRm5kJwcNhVdA3NS94";

// The amount that the user wants to unstake.
const lamports = 500000000; // min value 0.01 (SOL)

// Select network: "mainnet-beta" | "devnet"
const network = "mainnet-beta";

// Create SDK instance
const solanaClient = new Solana(network);

const unstake = await solanaClient.unstake(address, lamports);
console.log(unstake); // Raw Transaction Object