@dojima-wallet/solver-modules
Version:
Modules of different protocols for solvers
263 lines (262 loc) • 11.5 kB
TypeScript
import { TransactionCallback } from "@lidofinance/lido-ethereum-sdk";
export declare class LidoClient {
private sdk;
private provider;
private signer;
private chain;
private rpcUrl;
constructor(privateKey: string, chain: string);
getChain(): {
blockExplorers: {
readonly default: {
readonly name: "Etherscan";
readonly url: "https://etherscan.io";
readonly apiUrl: "https://api.etherscan.io/api";
};
};
contracts: {
readonly ensRegistry: {
readonly address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";
};
readonly ensUniversalResolver: {
readonly address: "0xce01f8eee7E479C928F8919abD53E553a36CeF67";
readonly blockCreated: 19258213;
};
readonly multicall3: {
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
readonly blockCreated: 14353601;
};
};
ensTlds?: readonly string[] | undefined;
id: 1;
name: "Ethereum";
nativeCurrency: {
readonly name: "Ether";
readonly symbol: "ETH";
readonly decimals: 18;
};
rpcUrls: {
readonly default: {
readonly http: readonly ["https://eth.merkle.io"];
};
};
sourceId?: number | undefined | undefined;
testnet?: boolean | undefined | undefined;
custom?: Record<string, unknown> | undefined;
fees?: import("viem").ChainFees<undefined> | undefined;
formatters?: undefined;
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
} | {
blockExplorers: {
readonly default: {
readonly name: "Etherscan";
readonly url: "https://sepolia.etherscan.io";
readonly apiUrl: "https://api-sepolia.etherscan.io/api";
};
};
contracts: {
readonly multicall3: {
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
readonly blockCreated: 751532;
};
readonly ensRegistry: {
readonly address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";
};
readonly ensUniversalResolver: {
readonly address: "0xc8Af999e38273D658BE1b921b88A9Ddf005769cC";
readonly blockCreated: 5317080;
};
};
ensTlds?: readonly string[] | undefined;
id: 11155111;
name: "Sepolia";
nativeCurrency: {
readonly name: "Sepolia Ether";
readonly symbol: "ETH";
readonly decimals: 18;
};
rpcUrls: {
readonly default: {
readonly http: readonly ["https://sepolia.drpc.org"];
};
};
sourceId?: number | undefined | undefined;
testnet: true;
custom?: Record<string, unknown> | undefined;
fees?: import("viem").ChainFees<undefined> | undefined;
formatters?: undefined;
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
} | {
blockExplorers: {
readonly default: {
readonly name: "Etherscan";
readonly url: "https://goerli.etherscan.io";
readonly apiUrl: "https://api-goerli.etherscan.io/api";
};
};
contracts: {
readonly ensRegistry: {
readonly address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";
};
readonly ensUniversalResolver: {
readonly address: "0xfc4AC75C46C914aF5892d6d3eFFcebD7917293F1";
readonly blockCreated: 10339206;
};
readonly multicall3: {
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
readonly blockCreated: 6507670;
};
};
ensTlds?: readonly string[] | undefined;
id: 5;
name: "Goerli";
nativeCurrency: {
readonly name: "Goerli Ether";
readonly symbol: "ETH";
readonly decimals: 18;
};
rpcUrls: {
readonly default: {
readonly http: readonly ["https://5.rpc.thirdweb.com"];
};
};
sourceId?: number | undefined | undefined;
testnet: true;
custom?: Record<string, unknown> | undefined;
fees?: import("viem").ChainFees<undefined> | undefined;
formatters?: undefined;
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
} | {
blockExplorers: {
readonly default: {
readonly name: "Etherscan";
readonly url: "https://holesky.etherscan.io";
readonly apiUrl: "https://api-holesky.etherscan.io/api";
};
};
contracts: {
readonly multicall3: {
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
readonly blockCreated: 77;
};
readonly ensRegistry: {
readonly address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";
readonly blockCreated: 801613;
};
readonly ensUniversalResolver: {
readonly address: "0xa6AC935D4971E3CD133b950aE053bECD16fE7f3b";
readonly blockCreated: 973484;
};
};
ensTlds?: readonly string[] | undefined;
id: 17000;
name: "Holesky";
nativeCurrency: {
readonly name: "Holesky Ether";
readonly symbol: "ETH";
readonly decimals: 18;
};
rpcUrls: {
readonly default: {
readonly http: readonly ["https://ethereum-holesky-rpc.publicnode.com"];
};
};
sourceId?: number | undefined | undefined;
testnet: true;
custom?: Record<string, unknown> | undefined;
fees?: import("viem").ChainFees<undefined> | undefined;
formatters?: undefined;
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
};
getChainId(): number;
private getRpcUrl;
getLastAPR(): Promise<number>;
getSmaAPR(days: number): Promise<number>;
getStETHBalance(address: string): Promise<bigint>;
getWstETHBalance(address: string): Promise<bigint>;
getStethAddress(): Promise<string>;
getWstethAddress(): Promise<string>;
getWithdrawalQueueAddress(): Promise<string>;
getOracleAddress(): Promise<string>;
getAccountingOracleAddress(): Promise<string>;
transferSteth(params: {
amount: string | bigint;
to: `0x${string}`;
from?: `0x${string}`;
callback?: TransactionCallback;
}): Promise<import("@lidofinance/lido-ethereum-sdk").TransactionResult>;
approveSteth(params: {
amount: string | bigint;
to: `0x${string}`;
callback?: TransactionCallback;
}): Promise<import("@lidofinance/lido-ethereum-sdk").TransactionResult>;
getAllowanceSteth(params: {
to: `0x${string}`;
account?: `0x${string}`;
}): Promise<bigint>;
signStethPermit(params: {
amount: bigint;
spender: `0x${string}`;
deadline?: bigint;
}): Promise<import("@lidofinance/lido-ethereum-sdk").PermitSignature>;
transferWsteth(params: {
amount: string | bigint;
to: `0x${string}`;
from?: `0x${string}`;
callback?: TransactionCallback;
}): Promise<import("@lidofinance/lido-ethereum-sdk").TransactionResult>;
approveWsteth(params: {
amount: string | bigint;
to: `0x${string}`;
callback?: TransactionCallback;
}): Promise<import("@lidofinance/lido-ethereum-sdk").TransactionResult>;
getAllowanceWsteth(params: {
to: `0x${string}`;
account?: `0x${string}`;
}): Promise<bigint>;
signWstethPermit(params: {
amount: bigint;
spender: `0x${string}`;
deadline?: bigint;
}): Promise<import("@lidofinance/lido-ethereum-sdk").PermitSignature>;
stakeEth(value: string | bigint, callback?: TransactionCallback, referralAddress?: `0x${string}`): Promise<import("@lidofinance/lido-ethereum-sdk").TransactionResult<import("@lidofinance/lido-ethereum-sdk/dist/types/stake/types").StakeResult>>;
stakeEthPopulateTx(value: string | bigint, referralAddress?: `0x${string}`): Promise<import("@lidofinance/lido-ethereum-sdk").PopulatedTransaction>;
stakeEthSimulateTx(value: string | bigint, referralAddress?: `0x${string}`): Promise<import("viem").WriteContractParameters>;
wrapETH(value: string | bigint, callback?: TransactionCallback): Promise<import("@lidofinance/lido-ethereum-sdk").TransactionResult<import("@lidofinance/lido-ethereum-sdk/dist/types/wrap/types").WrapResults>>;
getStethForWrapAllowance(address: string): Promise<bigint>;
approveStethForWrap(value: string | bigint, callback?: TransactionCallback): Promise<import("@lidofinance/lido-ethereum-sdk").TransactionResult>;
wrapSteth(value: string | bigint, callback?: TransactionCallback): Promise<import("@lidofinance/lido-ethereum-sdk").TransactionResult<import("@lidofinance/lido-ethereum-sdk/dist/types/wrap/types").WrapResults>>;
unwrapWsteth(value: string | bigint, callback?: TransactionCallback): Promise<import("@lidofinance/lido-ethereum-sdk").TransactionResult<import("@lidofinance/lido-ethereum-sdk/dist/types/wrap/types").UnwrapResults>>;
wrapEthEstimateGas(value: string | bigint): Promise<bigint>;
wrapStethPopulateTx(value: string | bigint): Promise<import("@lidofinance/lido-ethereum-sdk").PopulatedTransaction>;
unwrapWstethPopulateTx(value: string | bigint): Promise<import("@lidofinance/lido-ethereum-sdk").PopulatedTransaction>;
private defaultStakeCallback;
getLastRebaseEvent(): Promise<import("@lidofinance/lido-ethereum-sdk").RebaseEvent>;
getFirstRebaseEvent(props: {
days: number;
fromBlockNumber?: bigint;
}): Promise<import("@lidofinance/lido-ethereum-sdk").RebaseEvent>;
getLastRebaseEvents(props: {
count: number;
stepBlock?: number;
}): Promise<import("@lidofinance/lido-ethereum-sdk").RebaseEvent[]>;
requestWithdrawalWithPermit(params: {
requests: readonly bigint[];
token: "stETH" | "wstETH";
permit?: any;
callback?: TransactionCallback;
receiver?: `0x${string}`;
}): Promise<import("@lidofinance/lido-ethereum-sdk").TransactionResult<import("@lidofinance/lido-ethereum-sdk").WithdrawalResult>>;
requestWithdrawal(params: {
requests: readonly bigint[];
token: "stETH" | "wstETH";
callback?: TransactionCallback;
receiver?: `0x${string}`;
}): Promise<import("@lidofinance/lido-ethereum-sdk").TransactionResult<import("@lidofinance/lido-ethereum-sdk").WithdrawalResult>>;
private defaultWithdrawCallback;
claimRequests(params: {
requestsIds: bigint[];
hints?: bigint[];
callback?: TransactionCallback;
}): Promise<import("@lidofinance/lido-ethereum-sdk").TransactionResult<import("@lidofinance/lido-ethereum-sdk").ClaimResult>>;
}