Queue Unstake BGT
The queue unstake
method creates unsigned transaction for adding drop to a queue (unstake). It is a first step of unstaking process
queueUnstake(address, amount)
: queue drop (unstake) specific amount of boost
js
import {Berrachain} from '@everstake/wallet-sdk-berrachain';
import Web3 from 'web3';
const rpc = 'https://some-berrachain-rpc.com';
const privateKey = "1a...02";
const web3 = new Web3(rpc);
// your account
const account = web3.eth.accounts.privateKeyToAccount(privateKey);
// create instance of Berrachain class
const berrachain = new Berrachain('testnet', rpc);
// drop (unstake) amount
const amount = '0.00000001';
const txDetails = await bera.queueUnstake(account.address, amount);
const nonce = await web3.eth.getTransactionCount(account.address);
const tx = { ...txDetails, nonce };
const signedTx = await web3.eth.accounts.signTransaction(tx, privateKey);
if (signedTx.rawTransaction) {
const receipt = await web3.eth.sendSignedTransaction(signedTx.rawTransaction);
console.log("Transaction receipt:", receipt);
}