- Prepare the withdrawal transaction.
- Sign and broadcast the transaction.
1
Prepare withdrawal transaction
Create a serialized transaction to initiate the withdrawal process utilizing the functionalities of P2P smart contract and send it as a POST request to /api/v1/eth/staking/direct/tx/withdrawal.Example request:
pubkeys— list of validators public keys.
serializeTx— serialized unsigned transaction.to— recipient address for this transaction.gasLimit— maximum gas limit for this block.data— transaction data.value— amount this transaction is sending in Wei.chainId— chain ID this transaction is authorized on, as specified by EIP-155.type— EIP-2718 type of this transaction envelope.maxFeePerGas— maximum price per unit of gas this transaction will pay for the combined EIP-1559 block’s base fee and this transaction’s priority fee in Wei.maxPriorityFeePerGas— price per unit of gas in Wei, which is added to the EIP-1559 block’s base fee. This added fee is used to incentivize miners to prioritize this transaction.
P2P smart contracts
Mainnet0x4E1224f513048e18e7a1883985B45dc0Fe1D917eHoodi 0x158f2bbEf21CF9F92Cf4A294999BA422948c8242SourceAudit2
Sign and broadcast transaction
Use the following example of the code to sign and broadcast the withdrawal transaction.