@lidofinance/lido-ethereum-sdk
Version:
<div style="display: flex;" align="center"> <h1 align="center">Lido Ethereum SDK</h1> </div>
373 lines • 13.5 kB
TypeScript
import { type Address } from 'viem';
import { TransactionResult } from '../core/index.js';
import type { AccountValue, EtherValue, NoTxOptions } from '../core/types.js';
import { LidoSDKModule } from '../common/class-primitives/sdk-module.js';
import type { BatchSharesToStethValue, StethShareContractType, SharesTotalSupplyResult, SharesTransferProps } from './types.js';
export declare class LidoSDKShares extends LidoSDKModule {
static readonly PRECISION: bigint;
contractAddressStETH(): Promise<Address>;
getContractStETHshares(): Promise<StethShareContractType>;
balance(address?: AccountValue): Promise<bigint>;
transfer({ account: accountProp, to, amount: _amount, callback, from: _from, ...rest }: SharesTransferProps): Promise<TransactionResult>;
populateTransfer({ account: accountProp, to, amount: _amount, from: _from, }: NoTxOptions<SharesTransferProps>): Promise<{
to: `0x${string}`;
from: `0x${string}`;
data: `0x${string}`;
}>;
simulateTransfer({ account: _account, to, amount: _amount, from: _from, }: NoTxOptions<SharesTransferProps>): Promise<import("viem").SimulateContractReturnType<readonly [{
readonly anonymous: false;
readonly inputs: readonly [{
readonly indexed: true;
readonly name: "from";
readonly type: "address";
}, {
readonly indexed: true;
readonly name: "to";
readonly type: "address";
}, {
readonly indexed: false;
readonly name: "sharesValue";
readonly type: "uint256";
}];
readonly name: "TransferShares";
readonly type: "event";
}, {
readonly constant: true;
readonly inputs: readonly [{
readonly name: "_account";
readonly type: "address";
}];
readonly name: "sharesOf";
readonly outputs: readonly [{
readonly name: "";
readonly type: "uint256";
}];
readonly payable: false;
readonly stateMutability: "view";
readonly type: "function";
}, {
readonly constant: true;
readonly inputs: readonly [{
readonly name: "_ethAmount";
readonly type: "uint256";
}];
readonly name: "getSharesByPooledEth";
readonly outputs: readonly [{
readonly name: "";
readonly type: "uint256";
}];
readonly payable: false;
readonly stateMutability: "view";
readonly type: "function";
}, {
readonly constant: true;
readonly inputs: readonly [{
readonly name: "_sharesAmount";
readonly type: "uint256";
}];
readonly name: "getPooledEthByShares";
readonly outputs: readonly [{
readonly name: "";
readonly type: "uint256";
}];
readonly payable: false;
readonly stateMutability: "view";
readonly type: "function";
}, {
readonly constant: true;
readonly inputs: readonly [];
readonly name: "getTotalShares";
readonly outputs: readonly [{
readonly name: "";
readonly type: "uint256";
}];
readonly payable: false;
readonly stateMutability: "view";
readonly type: "function";
}, {
readonly constant: true;
readonly inputs: readonly [];
readonly name: "getTotalPooledEther";
readonly outputs: readonly [{
readonly name: "";
readonly type: "uint256";
}];
readonly payable: false;
readonly stateMutability: "view";
readonly type: "function";
}, {
readonly constant: true;
readonly inputs: readonly [{
readonly name: "_account";
readonly type: "address";
}];
readonly name: "sharesOf";
readonly outputs: readonly [{
readonly name: "";
readonly type: "uint256";
}];
readonly payable: false;
readonly stateMutability: "view";
readonly type: "function";
}, {
readonly constant: false;
readonly inputs: readonly [{
readonly name: "_sender";
readonly type: "address";
}, {
readonly name: "_recipient";
readonly type: "address";
}, {
readonly name: "_sharesAmount";
readonly type: "uint256";
}];
readonly name: "transferSharesFrom";
readonly outputs: readonly [{
readonly name: "";
readonly type: "uint256";
}];
readonly payable: false;
readonly stateMutability: "nonpayable";
readonly type: "function";
}, {
readonly constant: false;
readonly inputs: readonly [{
readonly name: "_recipient";
readonly type: "address";
}, {
readonly name: "_sharesAmount";
readonly type: "uint256";
}];
readonly name: "transferShares";
readonly outputs: readonly [{
readonly name: "";
readonly type: "uint256";
}];
readonly payable: false;
readonly stateMutability: "nonpayable";
readonly type: "function";
}, {
readonly constant: true;
readonly inputs: readonly [];
readonly name: "getExternalShares";
readonly outputs: readonly [{
readonly name: "";
readonly type: "uint256";
}];
readonly payable: false;
readonly stateMutability: "view";
readonly type: "function";
}, {
readonly constant: true;
readonly inputs: readonly [];
readonly name: "getMaxMintableExternalShares";
readonly outputs: readonly [{
readonly name: "";
readonly type: "uint256";
}];
readonly payable: false;
readonly stateMutability: "view";
readonly type: "function";
}, {
readonly constant: true;
readonly inputs: readonly [{
readonly name: "_sharesAmount";
readonly type: "uint256";
}];
readonly name: "getPooledEthBySharesRoundUp";
readonly outputs: readonly [{
readonly name: "";
readonly type: "uint256";
}];
readonly payable: false;
readonly stateMutability: "view";
readonly type: "function";
}], "transferSharesFrom", readonly [_sender: `0x${string}`, _recipient: `0x${string}`, _sharesAmount: bigint], import("viem").Chain | undefined, import("viem").Account | undefined, undefined, import("viem").JsonRpcAccount> | import("viem").SimulateContractReturnType<readonly [{
readonly anonymous: false;
readonly inputs: readonly [{
readonly indexed: true;
readonly name: "from";
readonly type: "address";
}, {
readonly indexed: true;
readonly name: "to";
readonly type: "address";
}, {
readonly indexed: false;
readonly name: "sharesValue";
readonly type: "uint256";
}];
readonly name: "TransferShares";
readonly type: "event";
}, {
readonly constant: true;
readonly inputs: readonly [{
readonly name: "_account";
readonly type: "address";
}];
readonly name: "sharesOf";
readonly outputs: readonly [{
readonly name: "";
readonly type: "uint256";
}];
readonly payable: false;
readonly stateMutability: "view";
readonly type: "function";
}, {
readonly constant: true;
readonly inputs: readonly [{
readonly name: "_ethAmount";
readonly type: "uint256";
}];
readonly name: "getSharesByPooledEth";
readonly outputs: readonly [{
readonly name: "";
readonly type: "uint256";
}];
readonly payable: false;
readonly stateMutability: "view";
readonly type: "function";
}, {
readonly constant: true;
readonly inputs: readonly [{
readonly name: "_sharesAmount";
readonly type: "uint256";
}];
readonly name: "getPooledEthByShares";
readonly outputs: readonly [{
readonly name: "";
readonly type: "uint256";
}];
readonly payable: false;
readonly stateMutability: "view";
readonly type: "function";
}, {
readonly constant: true;
readonly inputs: readonly [];
readonly name: "getTotalShares";
readonly outputs: readonly [{
readonly name: "";
readonly type: "uint256";
}];
readonly payable: false;
readonly stateMutability: "view";
readonly type: "function";
}, {
readonly constant: true;
readonly inputs: readonly [];
readonly name: "getTotalPooledEther";
readonly outputs: readonly [{
readonly name: "";
readonly type: "uint256";
}];
readonly payable: false;
readonly stateMutability: "view";
readonly type: "function";
}, {
readonly constant: true;
readonly inputs: readonly [{
readonly name: "_account";
readonly type: "address";
}];
readonly name: "sharesOf";
readonly outputs: readonly [{
readonly name: "";
readonly type: "uint256";
}];
readonly payable: false;
readonly stateMutability: "view";
readonly type: "function";
}, {
readonly constant: false;
readonly inputs: readonly [{
readonly name: "_sender";
readonly type: "address";
}, {
readonly name: "_recipient";
readonly type: "address";
}, {
readonly name: "_sharesAmount";
readonly type: "uint256";
}];
readonly name: "transferSharesFrom";
readonly outputs: readonly [{
readonly name: "";
readonly type: "uint256";
}];
readonly payable: false;
readonly stateMutability: "nonpayable";
readonly type: "function";
}, {
readonly constant: false;
readonly inputs: readonly [{
readonly name: "_recipient";
readonly type: "address";
}, {
readonly name: "_sharesAmount";
readonly type: "uint256";
}];
readonly name: "transferShares";
readonly outputs: readonly [{
readonly name: "";
readonly type: "uint256";
}];
readonly payable: false;
readonly stateMutability: "nonpayable";
readonly type: "function";
}, {
readonly constant: true;
readonly inputs: readonly [];
readonly name: "getExternalShares";
readonly outputs: readonly [{
readonly name: "";
readonly type: "uint256";
}];
readonly payable: false;
readonly stateMutability: "view";
readonly type: "function";
}, {
readonly constant: true;
readonly inputs: readonly [];
readonly name: "getMaxMintableExternalShares";
readonly outputs: readonly [{
readonly name: "";
readonly type: "uint256";
}];
readonly payable: false;
readonly stateMutability: "view";
readonly type: "function";
}, {
readonly constant: true;
readonly inputs: readonly [{
readonly name: "_sharesAmount";
readonly type: "uint256";
}];
readonly name: "getPooledEthBySharesRoundUp";
readonly outputs: readonly [{
readonly name: "";
readonly type: "uint256";
}];
readonly payable: false;
readonly stateMutability: "view";
readonly type: "function";
}], "transferShares", readonly [_recipient: `0x${string}`, _sharesAmount: bigint], import("viem").Chain | undefined, import("viem").Account | undefined, undefined, import("viem").JsonRpcAccount>>;
convertToShares(stethAmount: EtherValue): Promise<bigint>;
convertToSteth(sharesAmount: EtherValue): Promise<bigint>;
convertBatchSharesToSteth(sharesAmounts: BatchSharesToStethValue[], shareRateValues?: SharesTotalSupplyResult): Promise<bigint[]>;
convertBatchStethToShares(stethAmounts: EtherValue[], shareRateValues?: SharesTotalSupplyResult): Promise<bigint[]>;
/**
* Off-chain replica of StETH.getSharesByPooledEth from contracts/0.4.24/StETH.sol.
*/
getSharesByPooledEth(stethAmount: bigint, shareRateValues?: SharesTotalSupplyResult): Promise<bigint>;
/**
* Off-chain replica of StETH.getPooledEthByShares from contracts/0.4.24/StETH.sol.
*/
getPooledEthByShares(sharesAmount: bigint, shareRateValues?: SharesTotalSupplyResult): Promise<bigint>;
/**
* Off-chain replica of StETH.getPooledEthBySharesRoundUp from contracts/0.4.24/StETH.sol.
*/
getPooledEthBySharesRoundUp(sharesAmount: bigint, shareRateValues?: SharesTotalSupplyResult): Promise<bigint>;
getTotalSupply(): Promise<SharesTotalSupplyResult>;
getShareRate(): Promise<number>;
}
//# sourceMappingURL=shares.d.ts.map