UNPKG

@temple-wallet/everstake-wallet-sdk

Version:

Everstake Wallet SDK for Javascript

1,602 lines (1,591 loc) 112 kB
import { HttpTransport, FallbackTransport, Abi, PublicClient } from 'viem'; import BigNumber from 'bignumber.js'; /** * Copyright (c) 2025, Everstake. * Licensed under the BSD-3-Clause License. See LICENSE file for details. */ /** * `WalletSDKError` is a custom error class that extends the built-in `Error` class. * It provides additional properties for error handling within the Wallet SDK. * * @remarks * This class is needed to provide additional context for errors, such as a code * and the original error, if any. * * @public * * @param message - The error message. * @param code - A string representing the error code. * @param originalError - The original error that caused this error, if any. */ declare class WalletSDKError extends Error { code: string; originalError?: Error | undefined; constructor(message: string, code: string, originalError?: Error | undefined); } /** * `Blockchain` is an abstract class that provides a structure for blockchain-specific classes. * It includes methods for error handling and throwing errors. * * @remarks * This class should be extended by classes that implement blockchain-specific functionality. * The extending classes should provide their own `ERROR_MESSAGES` and `ORIGINAL_ERROR_MESSAGES`. * * @property ERROR_MESSAGES - An object that maps error codes to error messages. * @property ORIGINAL_ERROR_MESSAGES - An object that maps original error messages to user-friendly error messages. * * * **/ declare abstract class Blockchain { protected abstract ERROR_MESSAGES: { [key: string]: string; }; protected abstract ORIGINAL_ERROR_MESSAGES: { [key: string]: string; }; /** * Handles errors that occur within the Ethereum class. * * @param {keyof typeof ERROR_MESSAGES} code - The error code associated with the error. * @param {Error | WalletSDKError | unknown} originalError - The original error that was thrown. * * If the original error is an instance of WalletSDKError, it is thrown as is. * If the original error is an instance of the built-in Error class, a new WalletSDKError is thrown with the original error as the cause. * If the original error is not an instance of WalletSDKError or Error, a new WalletSDKError is thrown with a generic message and code. */ handleError(code: keyof typeof this.ERROR_MESSAGES, originalError: Error | WalletSDKError | unknown): never; /** * Throws a WalletSDKError with a specified error code and message. * * @param {keyof typeof ERROR_MESSAGES} code - The error code associated with the error. * @param {...string[]} values - The values to be inserted into the error message. * * The method retrieves the error message template associated with the provided code from the ERROR_MESSAGES object. * It then replaces placeholders in the message template with provided values and throws a WalletSDKError with the final message and the provided code. */ throwError(code: keyof typeof this.ERROR_MESSAGES, ...values: string[]): never; /** * Check if the URL is valid * * @param {string} url - URL * @returns a bool type result. * */ isValidURL(url: string): boolean; } /** * Copyright (c) 2025, Everstake. * Licensed under the BSD-3-Clause License. See LICENSE file for details. */ type HexString$2 = `0x${string}`; type Network = 'testnet' | 'mainnet'; type Transaction = { from: HexString$2; to: HexString$2; value: BigNumber; gasLimit: number; data: HexString$2; }; type BoostedQueue = { lastBlock: number; balance: string; }; /** * Copyright (c) 2025, Everstake. * Licensed under the BSD-3-Clause License. See LICENSE file for details. */ /** * The `Berrachain` class extends the `Blockchain` class and provides methods for interacting with the Berrachain network. * * It allows you to select a network, initialize it, and retrieve the balance of the contract. * * @property {string} validator - The address of the validator. * @property {PublicClient} client - The PublicClient instance used for interacting with the Ethereum network. * @property {Contract} btg - The BTG contract instance. * @property ERROR_MESSAGES - The error messages for the Berrachain class. * @property ORIGINAL_ERROR_MESSAGES - The original error messages for the Berrachain class. * */ declare class Berrachain extends Blockchain { private validator; private client; private btg; private readonly network; protected ERROR_MESSAGES: { NETWORK_ERR: string; ADDRESS_FORMAT_ERROR: string; BALANCE_ERROR: string; BOOSTED_ERROR: string; BOOSTS_ERROR: string; BOOST_QUEUE_ERROR: string; NOT_AVAILABLE_NETWORK: string; ACTIVATE_BOOST_ERROR: string; CANCEL_BOOST_ERROR: string; DROP_BOOST_ERROR: string; BOOST_ERROR: string; QUEUE_DROP_BOOST_ERROR: string; CANCEL_DROP_BOOST_ERROR: string; }; protected ORIGINAL_ERROR_MESSAGES: {}; constructor(network: Network | undefined, rpcOrTransport: string | HttpTransport | FallbackTransport); /** * Retrieves the balance of the user by address * * @param address - The staker address * @returns A Promise that resolves to the balance. * * @throws Will throw an error if the contract call fails. */ balanceOf(address: HexString$2): Promise<string>; /** * Retrieves the boosted stake of the user by address * * @param address - The staker address * @returns A Promise that resolves to the boosted stake. * * @throws Will throw an error if the contract call fails. */ getStake(address: HexString$2): Promise<string>; /** * Retrieves all uses boosts by address * * @param address - The staker address * @returns A Promise that resolves to the ball user's boosts. * * @throws Will throw an error if the contract call fails. */ getStakes(address: HexString$2): Promise<number>; /** * Retrieves info about user's boost queue by address * * @param address - The staker address * @returns A Promise that resolves to the balance in queue. * * @throws Will throw an error if the contract call fails. */ getStakeInQueue(address: HexString$2): Promise<BoostedQueue>; getUnstakeInQueue(address: HexString$2): Promise<BoostedQueue>; getActivateBoostDelay(): Promise<number>; getBlockNumber(): Promise<bigint>; /** * Creates a transaction data for boost activation * * @param address - The staker address * @returns A Promise that resolves to the transaction data * * @throws Will throw an error if the contract call fails. */ activateStake(address: HexString$2): Promise<Transaction>; /** * Creates a transaction data for canceling boost queue * * @param address - The staker address * @param amount - The amount of boost * @returns A Promise that resolves to the transaction data * * @throws Will throw an error if the contract call fails. */ cancelStakeInQueue(address: string, amount: string): Promise<Transaction>; /** * Creates a transaction data for drop boost (unstake) * * @param address - The staker address * @param amount - The amount of boost (doesn't use for mainnet) * @returns A Promise that resolves to the transaction data * * @throws Will throw an error if the contract call fails. */ unstake(address: string): Promise<Transaction>; /** * Creates a transaction data for boost (staking) * * @param address - The staker address * @param amount - The amount of boost * @returns A Promise that resolves to the transaction data * * @throws Will throw an error if the contract call fails. */ stake(address: string, amount: string): Promise<Transaction>; /** * Creates a transaction data for queue drop boost (unstake queue) * * @param address - The staker address * @param amount - The amount of boost * @returns A Promise that resolves to the transaction data * * @throws Will throw an error if the contract call fails. */ queueUnstake(address: HexString$2, amount: string): Promise<Transaction>; /** * Creates a transaction data for cancel drop boost (cancel unstake queue) * * @param address - The staker address * @param amount - The amount of boost * @returns A Promise that resolves to the transaction data * * @throws Will throw an error if the contract call fails. */ cancelUnstake(address: HexString$2, amount: string): Promise<Transaction>; private getTransaction; /** * Calculates the gas limit by adding a predefined BERA_GAS_RESERVE to the given gas consumption. * * @param gasConsumption - The amount of gas consumed. * * @returns The calculated gas limit as a number. */ private calculateGasLimit; } /** * Copyright (c) 2025, Everstake. * Licensed under the BSD-3-Clause License. See LICENSE file for details. */ declare const ABI_CONTRACT_ACCOUNTING: readonly [{ readonly inputs: readonly [{ readonly internalType: "string"; readonly name: "field"; readonly type: "string"; }]; readonly name: "InvalidParam"; readonly type: "error"; }, { readonly inputs: readonly [{ readonly internalType: "string"; readonly name: "field"; readonly type: "string"; }]; readonly name: "InvalidValue"; readonly type: "error"; }, { readonly inputs: readonly [{ readonly internalType: "string"; readonly name: "field"; readonly type: "string"; }]; readonly name: "ZeroValue"; readonly type: "error"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: false; readonly internalType: "uint256"; readonly name: "round"; readonly type: "uint256"; }]; readonly name: "ActivateRound"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: false; readonly internalType: "address"; readonly name: "staker"; readonly type: "address"; }, { readonly indexed: false; readonly internalType: "uint256"; readonly name: "value"; readonly type: "uint256"; }]; readonly name: "AddWithdrawRequest"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: false; readonly internalType: "uint256"; readonly name: "value"; readonly type: "uint256"; }]; readonly name: "Autocompound"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: false; readonly internalType: "int256"; readonly name: ""; readonly type: "int256"; }]; readonly name: "ChangeExpectValidatorsToStop"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: false; readonly internalType: "uint256"; readonly name: "value"; readonly type: "uint256"; }]; readonly name: "ClaimPoolFee"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: false; readonly internalType: "address"; readonly name: "staker"; readonly type: "address"; }, { readonly indexed: false; readonly internalType: "uint256"; readonly name: "value"; readonly type: "uint256"; }]; readonly name: "ClaimWithdrawRequest"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: false; readonly internalType: "address"; readonly name: "staker"; readonly type: "address"; }, { readonly indexed: false; readonly internalType: "uint256"; readonly name: "value"; readonly type: "uint256"; }]; readonly name: "DepositPending"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: false; readonly internalType: "uint256"; readonly name: "newFee"; readonly type: "uint256"; }]; readonly name: "FeeUpdated"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: false; readonly internalType: "address"; readonly name: "oldGovernor"; readonly type: "address"; }, { readonly indexed: false; readonly internalType: "address"; readonly name: "newGovernor"; readonly type: "address"; }]; readonly name: "GovernorChanged"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: false; readonly internalType: "uint8"; readonly name: "version"; readonly type: "uint8"; }]; readonly name: "Initialized"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: false; readonly internalType: "address"; readonly name: "staker"; readonly type: "address"; }, { readonly indexed: false; readonly internalType: "uint256"; readonly name: "value"; readonly type: "uint256"; }]; readonly name: "InterchangeDeposit"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: false; readonly internalType: "address"; readonly name: "staker"; readonly type: "address"; }, { readonly indexed: false; readonly internalType: "uint256"; readonly name: "value"; readonly type: "uint256"; }]; readonly name: "InterchangeWithdraw"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: true; readonly internalType: "address"; readonly name: "previousOwner"; readonly type: "address"; }, { readonly indexed: true; readonly internalType: "address"; readonly name: "newOwner"; readonly type: "address"; }]; readonly name: "OwnershipTransferred"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: true; readonly internalType: "address"; readonly name: "superAdmin"; readonly type: "address"; }]; readonly name: "SetSuperAdmin"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: false; readonly internalType: "uint256"; readonly name: "rewarderBalance"; readonly type: "uint256"; }, { readonly indexed: false; readonly internalType: "uint256"; readonly name: "reward"; readonly type: "uint256"; }, { readonly indexed: false; readonly internalType: "uint256"; readonly name: "fee"; readonly type: "uint256"; }]; readonly name: "Update"; readonly type: "event"; }, { readonly inputs: readonly []; readonly name: "BEACON_AMOUNT"; readonly outputs: readonly [{ readonly internalType: "uint256"; readonly name: ""; readonly type: "uint256"; }]; readonly stateMutability: "view"; readonly type: "function"; }, { readonly inputs: readonly []; readonly name: "FEE_DENOMINATOR"; readonly outputs: readonly [{ readonly internalType: "uint256"; readonly name: ""; readonly type: "uint256"; }]; readonly stateMutability: "view"; readonly type: "function"; }, { readonly inputs: readonly []; readonly name: "governor"; readonly outputs: readonly [{ readonly internalType: "address"; readonly name: ""; readonly type: "address"; }]; readonly stateMutability: "view"; readonly type: "function"; }, { readonly inputs: readonly []; readonly name: "owner"; readonly outputs: readonly [{ readonly internalType: "address"; readonly name: ""; readonly type: "address"; }]; readonly stateMutability: "view"; readonly type: "function"; }, { readonly inputs: readonly []; readonly name: "renounceOwnership"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "address"; readonly name: "value"; readonly type: "address"; }]; readonly name: "setSuperAdmin"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly []; readonly name: "superAdmin"; readonly outputs: readonly [{ readonly internalType: "address"; readonly name: ""; readonly type: "address"; }]; readonly stateMutability: "view"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "address"; readonly name: "newOwner"; readonly type: "address"; }]; readonly name: "transferOwnership"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "uint256"; readonly name: "poolFee"; readonly type: "uint256"; }, { readonly internalType: "address"; readonly name: "rewardsTreasury"; readonly type: "address"; }, { readonly internalType: "address"; readonly name: "withdrawTreasury"; readonly type: "address"; }, { readonly internalType: "address"; readonly name: "accountingGovernor"; readonly type: "address"; }]; readonly name: "initialize"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "address"; readonly name: "account"; readonly type: "address"; }, { readonly internalType: "uint256"; readonly name: "depositToPendingValue"; readonly type: "uint256"; }]; readonly name: "deposit"; readonly outputs: readonly [{ readonly internalType: "uint256"; readonly name: "interchangedAmount"; readonly type: "uint256"; }, { readonly internalType: "uint256"; readonly name: "activatedSlots"; readonly type: "uint256"; }]; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly []; readonly name: "balance"; readonly outputs: readonly [{ readonly internalType: "uint256"; readonly name: ""; readonly type: "uint256"; }]; readonly stateMutability: "view"; readonly type: "function"; }, { readonly inputs: readonly []; readonly name: "pendingDepositedBalance"; readonly outputs: readonly [{ readonly internalType: "uint256"; readonly name: ""; readonly type: "uint256"; }]; readonly stateMutability: "view"; readonly type: "function"; }, { readonly inputs: readonly []; readonly name: "pendingBalance"; readonly outputs: readonly [{ readonly internalType: "uint256"; readonly name: ""; readonly type: "uint256"; }]; readonly stateMutability: "view"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "address"; readonly name: "account"; readonly type: "address"; }]; readonly name: "autocompoundBalanceOf"; readonly outputs: readonly [{ readonly internalType: "uint256"; readonly name: "autocompoundBalance"; readonly type: "uint256"; }]; readonly stateMutability: "view"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "address"; readonly name: "account"; readonly type: "address"; }]; readonly name: "depositedBalanceOf"; readonly outputs: readonly [{ readonly internalType: "uint256"; readonly name: ""; readonly type: "uint256"; }]; readonly stateMutability: "view"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "address"; readonly name: "account"; readonly type: "address"; }]; readonly name: "pendingDepositedBalanceOf"; readonly outputs: readonly [{ readonly internalType: "uint256"; readonly name: ""; readonly type: "uint256"; }]; readonly stateMutability: "view"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "address"; readonly name: "account"; readonly type: "address"; }]; readonly name: "pendingBalanceOf"; readonly outputs: readonly [{ readonly internalType: "uint256"; readonly name: ""; readonly type: "uint256"; }]; readonly stateMutability: "view"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "address"; readonly name: "account"; readonly type: "address"; }, { readonly internalType: "uint256"; readonly name: "amount"; readonly type: "uint256"; }]; readonly name: "withdrawPending"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "address"; readonly name: "staker"; readonly type: "address"; }, { readonly internalType: "uint256"; readonly name: "value"; readonly type: "uint256"; }]; readonly name: "withdraw"; readonly outputs: readonly [{ readonly internalType: "uint256"; readonly name: "withdrawFromPendingAmount"; readonly type: "uint256"; }]; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly []; readonly name: "claimPoolFee"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly []; readonly name: "getPoolFee"; readonly outputs: readonly [{ readonly internalType: "uint256"; readonly name: ""; readonly type: "uint256"; }]; readonly stateMutability: "view"; readonly type: "function"; }, { readonly inputs: readonly []; readonly name: "feeBalance"; readonly outputs: readonly [{ readonly internalType: "uint256"; readonly name: ""; readonly type: "uint256"; }]; readonly stateMutability: "view"; readonly type: "function"; }, { readonly inputs: readonly []; readonly name: "update"; readonly outputs: readonly [{ readonly internalType: "bool"; readonly name: ""; readonly type: "bool"; }]; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "uint256"; readonly name: "feeValue"; readonly type: "uint256"; }]; readonly name: "setFee"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly []; readonly name: "autocompound"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly []; readonly name: "pendingRestakedRewards"; readonly outputs: readonly [{ readonly internalType: "uint256"; readonly name: "amount"; readonly type: "uint256"; }]; readonly stateMutability: "view"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "address"; readonly name: "account"; readonly type: "address"; }]; readonly name: "pendingRestakedRewardOf"; readonly outputs: readonly [{ readonly internalType: "uint256"; readonly name: "amount"; readonly type: "uint256"; }]; readonly stateMutability: "view"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "address"; readonly name: "account"; readonly type: "address"; }]; readonly name: "restakedRewardOf"; readonly outputs: readonly [{ readonly internalType: "uint256"; readonly name: ""; readonly type: "uint256"; }]; readonly stateMutability: "view"; readonly type: "function"; }, { readonly inputs: readonly []; readonly name: "withdrawRequestQueueParams"; readonly outputs: readonly [{ readonly internalType: "uint256"; readonly name: ""; readonly type: "uint256"; }, { readonly internalType: "uint256"; readonly name: ""; readonly type: "uint256"; }, { readonly internalType: "uint256"; readonly name: ""; readonly type: "uint256"; }, { readonly internalType: "uint256"; readonly name: ""; readonly type: "uint256"; }]; readonly stateMutability: "view"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "address"; readonly name: "staker"; readonly type: "address"; }]; readonly name: "withdrawRequest"; readonly outputs: readonly [{ readonly internalType: "uint256"; readonly name: ""; readonly type: "uint256"; }, { readonly internalType: "uint256"; readonly name: ""; readonly type: "uint256"; }]; readonly stateMutability: "view"; readonly type: "function"; }, { readonly inputs: readonly []; readonly name: "claimWithdrawRequest"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly []; readonly name: "readyforAutocompoundRewardsAmount"; readonly outputs: readonly [{ readonly internalType: "uint256"; readonly name: "unclaimedReward"; readonly type: "uint256"; }]; readonly stateMutability: "view"; readonly type: "function"; }, { readonly inputs: readonly []; readonly name: "closeValidatorsStat"; readonly outputs: readonly [{ readonly internalType: "uint256"; readonly name: ""; readonly type: "uint256"; }]; readonly stateMutability: "view"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "uint256"; readonly name: "stakeAmount"; readonly type: "uint256"; }]; readonly name: "setMinRestakeAmount"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "uint256"; readonly name: "activatedValidatorNum"; readonly type: "uint256"; }]; readonly name: "activateValidators"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }]; declare const ABI_CONTRACT_POOL: readonly [{ readonly inputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "constructor"; }, { readonly inputs: readonly [{ readonly internalType: "string"; readonly name: "field"; readonly type: "string"; }]; readonly name: "InvalidAmount"; readonly type: "error"; }, { readonly inputs: readonly [{ readonly internalType: "string"; readonly name: "field"; readonly type: "string"; }]; readonly name: "InvalidParam"; readonly type: "error"; }, { readonly inputs: readonly [{ readonly internalType: "string"; readonly name: "field"; readonly type: "string"; }]; readonly name: "InvalidValue"; readonly type: "error"; }, { readonly inputs: readonly [{ readonly internalType: "string"; readonly name: "field"; readonly type: "string"; }]; readonly name: "Paused"; readonly type: "error"; }, { readonly inputs: readonly [{ readonly internalType: "string"; readonly name: "field"; readonly type: "string"; }]; readonly name: "ZeroValue"; readonly type: "error"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: false; readonly internalType: "address"; readonly name: "oldGovernor"; readonly type: "address"; }, { readonly indexed: false; readonly internalType: "address"; readonly name: "newGovernor"; readonly type: "address"; }]; readonly name: "GovernorChanged"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: false; readonly internalType: "uint8"; readonly name: "version"; readonly type: "uint8"; }]; readonly name: "Initialized"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: true; readonly internalType: "address"; readonly name: "previousOwner"; readonly type: "address"; }, { readonly indexed: true; readonly internalType: "address"; readonly name: "newOwner"; readonly type: "address"; }]; readonly name: "OwnershipTransferStarted"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: true; readonly internalType: "address"; readonly name: "previousOwner"; readonly type: "address"; }, { readonly indexed: true; readonly internalType: "address"; readonly name: "newOwner"; readonly type: "address"; }]; readonly name: "OwnershipTransferred"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: false; readonly internalType: "bool"; readonly name: ""; readonly type: "bool"; }]; readonly name: "PauseStaking"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: false; readonly internalType: "bool"; readonly name: ""; readonly type: "bool"; }]; readonly name: "PauseWithdraw"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: false; readonly internalType: "bytes"; readonly name: "oldPendingValidatorPubKey"; readonly type: "bytes"; }, { readonly indexed: false; readonly internalType: "bytes"; readonly name: "newPendingValidatorPubKey"; readonly type: "bytes"; }]; readonly name: "PendingValidatorReplaced"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: false; readonly internalType: "uint256"; readonly name: ""; readonly type: "uint256"; }]; readonly name: "Restake"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: false; readonly internalType: "uint256"; readonly name: "value"; readonly type: "uint256"; }]; readonly name: "SetMinStakeAmount"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: true; readonly internalType: "address"; readonly name: "superAdmin"; readonly type: "address"; }]; readonly name: "SetSuperAdmin"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: true; readonly internalType: "address"; readonly name: "staker"; readonly type: "address"; }, { readonly indexed: false; readonly internalType: "uint256"; readonly name: "value"; readonly type: "uint256"; }]; readonly name: "StakeActivated"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: true; readonly internalType: "address"; readonly name: "staker"; readonly type: "address"; }, { readonly indexed: false; readonly internalType: "uint256"; readonly name: "value"; readonly type: "uint256"; }, { readonly indexed: false; readonly internalType: "uint64"; readonly name: "source"; readonly type: "uint64"; }]; readonly name: "StakeAdded"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: false; readonly internalType: "address"; readonly name: "staker"; readonly type: "address"; }, { readonly indexed: false; readonly internalType: "uint256"; readonly name: "value"; readonly type: "uint256"; }]; readonly name: "StakeCanceled"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: false; readonly internalType: "bytes"; readonly name: "validator"; readonly type: "bytes"; }]; readonly name: "StakeDeposited"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: true; readonly internalType: "address"; readonly name: "staker"; readonly type: "address"; }, { readonly indexed: false; readonly internalType: "uint256"; readonly name: "value"; readonly type: "uint256"; }, { readonly indexed: false; readonly internalType: "uint64"; readonly name: "source"; readonly type: "uint64"; }]; readonly name: "Unstake"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: false; readonly internalType: "bytes"; readonly name: "validator"; readonly type: "bytes"; }]; readonly name: "ValidatorMarkedAsExited"; readonly type: "event"; }, { readonly inputs: readonly []; readonly name: "BEACON_AMOUNT"; readonly outputs: readonly [{ readonly internalType: "uint256"; readonly name: ""; readonly type: "uint256"; }]; readonly stateMutability: "view"; readonly type: "function"; }, { readonly inputs: readonly []; readonly name: "acceptOwnership"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly []; readonly name: "governor"; readonly outputs: readonly [{ readonly internalType: "address"; readonly name: ""; readonly type: "address"; }]; readonly stateMutability: "view"; readonly type: "function"; }, { readonly inputs: readonly []; readonly name: "owner"; readonly outputs: readonly [{ readonly internalType: "address"; readonly name: ""; readonly type: "address"; }]; readonly stateMutability: "view"; readonly type: "function"; }, { readonly inputs: readonly []; readonly name: "pendingOwner"; readonly outputs: readonly [{ readonly internalType: "address"; readonly name: ""; readonly type: "address"; }]; readonly stateMutability: "view"; readonly type: "function"; }, { readonly inputs: readonly []; readonly name: "renounceOwnership"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "address"; readonly name: "value"; readonly type: "address"; }]; readonly name: "setSuperAdmin"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly []; readonly name: "superAdmin"; readonly outputs: readonly [{ readonly internalType: "address"; readonly name: ""; readonly type: "address"; }]; readonly stateMutability: "view"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "address"; readonly name: "newOwner"; readonly type: "address"; }]; readonly name: "transferOwnership"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "address"; readonly name: "depositContract"; readonly type: "address"; }, { readonly internalType: "address"; readonly name: "accountingContract"; readonly type: "address"; }, { readonly internalType: "address"; readonly name: "withdrawTreasury"; readonly type: "address"; }, { readonly internalType: "address"; readonly name: "rewardsTreasury"; readonly type: "address"; }, { readonly internalType: "address"; readonly name: "poolGovernor"; readonly type: "address"; }]; readonly name: "initialize"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "uint64"; readonly name: "source"; readonly type: "uint64"; }]; readonly name: "stake"; readonly outputs: readonly []; readonly stateMutability: "payable"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "uint256"; readonly name: "amount"; readonly type: "uint256"; }]; readonly name: "unstakePending"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "uint256"; readonly name: "value"; readonly type: "uint256"; }, { readonly internalType: "uint16"; readonly name: "allowedInterchangeNum"; readonly type: "uint16"; }, { readonly internalType: "uint64"; readonly name: "source"; readonly type: "uint64"; }]; readonly name: "unstake"; readonly outputs: readonly [{ readonly internalType: "uint256"; readonly name: "unstakeFromPendingValue"; readonly type: "uint256"; }]; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly []; readonly name: "activateStake"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "uint256"; readonly name: "activatedSlots"; readonly type: "uint256"; }]; readonly name: "restake"; readonly outputs: readonly []; readonly stateMutability: "payable"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly components: readonly [{ readonly internalType: "bytes"; readonly name: "pubkey"; readonly type: "bytes"; }, { readonly internalType: "bytes"; readonly name: "signature"; readonly type: "bytes"; }, { readonly internalType: "bytes32"; readonly name: "deposit_data_root"; readonly type: "bytes32"; }]; readonly internalType: "struct ValidatorList.DepositData[]"; readonly name: "pendingValidators"; readonly type: "tuple[]"; }]; readonly name: "setPendingValidators"; readonly outputs: readonly [{ readonly internalType: "bool"; readonly name: ""; readonly type: "bool"; }]; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly []; readonly name: "getPendingValidatorCount"; readonly outputs: readonly [{ readonly internalType: "uint256"; readonly name: ""; readonly type: "uint256"; }]; readonly stateMutability: "view"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "uint256"; readonly name: "index"; readonly type: "uint256"; }]; readonly name: "getPendingValidator"; readonly outputs: readonly [{ readonly internalType: "bytes"; readonly name: ""; readonly type: "bytes"; }]; readonly stateMutability: "view"; readonly type: "function"; }, { readonly inputs: readonly []; readonly name: "getValidatorCount"; readonly outputs: readonly [{ readonly internalType: "uint256"; readonly name: ""; readonly type: "uint256"; }]; readonly stateMutability: "view"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "uint256"; readonly name: "index"; readonly type: "uint256"; }]; readonly name: "getValidator"; readonly outputs: readonly [{ readonly internalType: "bytes"; readonly name: ""; readonly type: "bytes"; }, { readonly internalType: "enum ValidatorList.ValidatorStatus"; readonly name: ""; readonly type: "uint8"; }]; readonly stateMutability: "view"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "uint256"; readonly name: "index"; readonly type: "uint256"; }, { readonly components: readonly [{ readonly internalType: "bytes"; readonly name: "pubkey"; readonly type: "bytes"; }, { readonly internalType: "bytes"; readonly name: "signature"; readonly type: "bytes"; }, { readonly internalType: "bytes32"; readonly name: "deposit_data_root"; readonly type: "bytes32"; }]; readonly internalType: "struct ValidatorList.DepositData"; readonly name: "pendingValidator"; readonly type: "tuple"; }]; readonly name: "replacePendingValidator"; readonly outputs: readonly [{ readonly internalType: "bool"; readonly name: ""; readonly type: "bool"; }]; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "uint256"; readonly name: "num"; readonly type: "uint256"; }]; readonly name: "markValidatorsAsExited"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "uint256"; readonly name: "index"; readonly type: "uint256"; }]; readonly name: "markValidatorAsExited"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly []; readonly name: "reorderPending"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "bool"; readonly name: "pause"; readonly type: "bool"; }]; readonly name: "pauseStaking"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "bool"; readonly name: "pause"; readonly type: "bool"; }]; readonly name: "pauseWithdraw"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "address"; readonly name: "newGovernor"; readonly type: "address"; }]; readonly name: "setGovernor"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly []; readonly name: "minStakeAmount"; readonly outputs: readonly [{ readonly internalType: "uint256"; readonly name: ""; readonly type: "uint256"; }]; readonly stateMutability: "view"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "uint256"; readonly name: "stakeAmount"; readonly type: "uint256"; }]; readonly name: "setMinStakeAmount"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }]; /** * Copyright (c) 2025, Everstake. * Licensed under the BSD-3-Clause License. See LICENSE file for details. */ type HexString$1 = `0x${string}`; type EthNetworkType = 'mainnet' | 'holesky'; interface EthNetworkAddresses { addressContractAccounting: HexString$1; addressContractPool: HexString$1; addressContractWithdrawTreasury: HexString$1; rpcUrl: string; } type EthNetworkAddressesMap = { [K in EthNetworkType]: EthNetworkAddresses; }; type EthTransaction = { from: HexString$1; to: HexString$1; value: BigNumber; gasLimit: number; data: HexString$1; }; declare enum ValidatorStatus { Unknown = 0, Pending = 1, Deposited = 2 } interface AggregatedBalances { [key: string]: string; } /** * Copyright (c) 2025, Everstake. * Licensed under the BSD-3-Clause License. See LICENSE file for details. */ interface ContractProps$1<T extends Abi> { abi: T; address: HexString$1; } /** * The `Ethereum` class extends the `Blockchain` class and provides methods for interacting with the Ethereum network. * * It allows you to select a network, initialize it, and retrieve the balance of the contract. * * @property {PublicClient} client - The PublicClient instance used for interacting with the Ethereum network. * @property {string} addressContractWithdrawTreasury - The address of the withdraw treasury contract. * @property {ContractProps} contractAccounting - The accounting contract props. * @property {ContractProps} contractPool - The pool contract props. * @property ERROR_MESSAGES - The error messages for the Ethereum class. * @property ORIGINAL_ERROR_MESSAGES - The original error messages for the Ethereum class. * */ declare class Ethereum extends Blockchain { addressContractWithdrawTreasury: string; contractAccounting: ContractProps$1<typeof ABI_CONTRACT_ACCOUNTING>; contractPool: ContractProps$1<typeof ABI_CONTRACT_POOL>; client: PublicClient; private minAmount; protected ERROR_MESSAGES: { BALANCE_ERROR: string; PENDING_BALANCE_ERROR: string; PENDING_DEPOSITED_BALANCE_ERROR: string; PENDING_RESTAKED_REWARDS_ERROR: string; READY_FOR_AUTOCOMPOUND_REWARDS_AMOUNT_ERROR: string; PENDING_BALANCE_OF_ERROR: string; PENDING_DEPOSITED_BALANCE_OF_ERROR: string; DEPOSITED_BALANCE_OF_ERROR: string; PENDING_RESTAKED_REWARD_OF_ERROR: string; RESTAKED_REWARD_OF_ERROR: string; GET_POOL_FEE_ERROR: string; MIN_STAKE_AMOUNT_ERROR: string; GET_VALIDATOR_ERROR: string; GET_VALIDATOR_COUNT_ERROR: string; GET_PENDING_VALIDATOR_ERROR: string; GET_PENDING_VALIDATOR_COUNT_ERROR: string; ACTIVATE_STAKE_ERROR: string; MIN_AMOUNT_ERROR: string; UNSTAKE_PENDING_ERROR: string; INSUFFICIENT_PENDING_BALANCE_ERROR: string; ZERO_UNSTAKE_MESSAGE: string; AMOUNT_GREATER_THAN_PENDING_BALANCE_ERROR: string; NETWORK_NOT_SUPPORTED: string; NO_REWARDS_MESSAGE: string; AUTOCOMPOUND_ERROR: string; AUTOCOMPOUND_BALANCE_OF_ERROR: string; WITHDRAW_REQUEST_QUEUE_PARAMS_ERROR: string; WITHDRAW_REQUEST_ERROR: string; ZERO_UNSTAKE_ERROR: string; NOT_FILLED_UNSTAKE_MESSAGE: string; WRONG_TYPE_MESSAGE: string; CLAIM_WITHDRAW_REQUEST_ERROR: string; CLOSE_VALIDATORS_STAT_ERROR: string; STAKE_ERROR: string; UNSTAKE_ERROR: string; SIMULATE_UNSTAKE_ERROR: string; MAX_AMOUNT_FOR_UNSTAKE_ERROR: string; ADDRESS_FORMAT_ERROR: string; USER_BALANCES_ERROR: string; POOL_BALANCES_ERROR: string; }; protected ORIGINAL_ERROR_MESSAGES: { 'InvalidValue: remainder': string; 'InvalidValue: amount': string; 'InvalidValue: pending balance': string; 'ZeroValue: pending': string; 'ZeroValue: claim': string; 'InvalidParam: index': string; 'InvalidParam: caller': string; 'I