Skill — Copyable reference implementation. Use as-is or customize. See Skills Philosophy.
Planned Implementation
Deposit
Delegation
Withdrawals
Resources
Related
- lido — Get stETH to restake
Restaking ETH and LSTs with EigenLayer
import { EigenLayer } from './EigenLayer.js';
const eigen = EigenLayer({
provider,
strategyManager: STRATEGY_MANAGER,
});
// Deposit stETH into EigenLayer
await eigen.depositIntoStrategy({
strategy: STETH_STRATEGY,
token: STETH,
amount: parseEther('10'),
signer,
});
// Delegate to an operator
await eigen.delegateTo({
operator: OPERATOR_ADDRESS,
signature: { /* EIP-712 signature */ },
signer,
});
// Undelegate
await eigen.undelegate({ signer });
// Queue withdrawal
const withdrawal = await eigen.queueWithdrawal({
strategies: [STETH_STRATEGY],
shares: [shareAmount],
signer,
});
// Complete withdrawal after delay
await eigen.completeQueuedWithdrawal({
withdrawal,
tokens: [STETH],
receiveAsTokens: true,
signer,
});
Was this page helpful?
Suggestions