Skip to content
On this page

Simulate Unstake

The simulate namespace contains method used for simalating transactions on unstake. The unique method to the simulate namespace is:

  • simulateUnstake(address, amount, allowedInterchangeNum, source): Simulates transactions without committing them. It is required, especially for predicting transaction outcomes and gas fees in Ethereum blockchain. The source is a unique identifier provided by the Everstake that allows the Everstake to recognize and verify the origin of the staking transactions.

Simulate Unstake Code Example

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

// User Public Address
const address = '0x7CB380672D37E6Cc2e1dE28616076Cf3Cexample';

// The number of interchanges when unstaking
const allowedInterchangeNum = 1;

// The unique identifier provided by the Everstake
const source = '0';

// Simulate Unstake
const txnRequest = await Ethereum.simulateUnstake(address, amount, allowedInterchangeNum, source);
console.log(txnRequest);