Skip to content
On this page

Unlock Aptos

The unlock namespace contains method used for sending transactions on unlocking. The unique method to the unlock namespace is:

  • unlock(token, address, amount): Unlocks user tokens. The user can only unlock more than 10 APT and must have more than or equal to 10 APT in the active stake.If a user possesses 15 APT, they are only able to unlock the entire amount. This is due to the fact that the condition specifying the remaining active stake must be equal to or greater than 10 APT is not met when unlocking just 10 APT.

Unstake Code Example

ts
// Import SDK
import { Aptos } from '@everstake/wallet-sdk';

// User Public Address
const address = '0x1bae2a9343bd546e14c5e696b45be50b7d215bb627949e1e5f82470bee9bdb62';
// Token ID.
const token = process.env.TOKEN; // 3155f389-d943-4966-8e18-f159c2a6ef66

// The amount that the user unlock
const amount = 10;

// Unlock - return Raw Transaction
const txnRequest = await Aptos.unstake(token, address, amount);
console.log(txnRequest); // Raw Transaction Object