ObolSplits
Defined in: splits/splits.ts:42
Internal
ObolSplits can be used for creating and managing Obol splits.
Access it through Client.splits.
Example
const obolClient = new Client(config);
await obolClient.splits.createValidatorManagerAndRewardsSplit(OVMRewardsSplitPayload);
Methods
createValidatorManagerAndRewardsSplit()
createValidatorManagerAndRewardsSplit(
payload):Promise<ClusterValidator>
Defined in: splits/splits.ts:76
Creates an Obol OVM and Pull split configuration for rewards-only scenario.
This method deploys OVM and SplitV2 contracts for managing validator rewards only. Principal is handled by a single address, while rewards are split among recipients.
Parameters
| Parameter | Type | Description |
|---|---|---|
payload | OVMRewardsSplitPayload | Data needed to deploy OVM and SplitV2 |
Returns
Promise<ClusterValidator>
OVM address as withdrawal address and splitter as fee recipient
Remarks
⚠️ Important: If you're storing the private key in an .env file, ensure it is securely managed
and not pushed to version control.
📌 Note: The Obol Validator Manager (OVM) feature is only enabled on Hoodi on launchpad.
Throws
Will throw an error if the splitter configuration is not supported or deployment fails
An example of how to use createValidatorManagerAndRewardsSplit: createValidatorManagerAndRewardsSplit
createValidatorManagerAndTotalSplit()
createValidatorManagerAndTotalSplit(
payload):Promise<ClusterValidator>
Defined in: splits/splits.ts:244
Creates an Obol OVM and Total split configuration for total split scenario.
This method deploys OVM and SplitV2 contracts for managing both validator rewards and principal. Both rewards and principal are split among recipients, with rewards including RAF recipient.
Parameters
| Parameter | Type | Description |
|---|---|---|
payload | OVMTotalSplitPayload | Data needed to deploy OVM and SplitV2 |
Returns
Promise<ClusterValidator>
OVM address as withdrawal address and splitter as fee recipient
Remarks
⚠️ Important: If you're storing the private key in an .env file, ensure it is securely managed
and not pushed to version control.
📌 Note: The Obol Validator Manager (OVM) feature is only enabled on Hoodi on launchpad.
Throws
Will throw an error if the splitter configuration is not supported or deployment fails
An example of how to use createValidatorManagerAndTotalSplit: createValidatorManagerAndTotalSplit
requestWithdrawal()
requestWithdrawal(
payload):Promise<{txHash:string; }>
Defined in: splits/splits.ts:442
Requests withdrawal from an OVM contract.
This method allows requesting withdrawal of validator funds from an OVM contract. The withdrawal request includes OVM address, validator public keys and corresponding withdrawal amounts.
Parameters
| Parameter | Type | Description |
|---|---|---|
payload | OVMRequestWithdrawalPayload | Data needed to request withdrawal |
Returns
Promise<{ txHash: string; }>
Transaction hash of the withdrawal request
Remarks
⚠️ Important: If you're storing the private key in an .env file, ensure it is securely managed
and not pushed to version control.
Throws
Will throw an error if the signer is not provided, OVM address is invalid, or the request fails
An example of how to use requestWithdrawal:
const result = await client.splits.requestWithdrawal({
ovmAddress: '0x1234567890123456789012345678901234567890',
pubKeys: ['0x123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456'],
amounts: ['32000000000'], // 32 ETH in gwei
withdrawalFees: '1000000000000000' // Total fees in wei
});
console.log('Withdrawal requested:', result.txHash);
deposit()
deposit(
payload):Promise<{txHashes:string[]; }>
Defined in: splits/splits.ts:492
Deposits to OVM contract by sending individual transactions for each deposit.
This method allows depositing to an OVM contract. Each deposit is sent as a separate transaction Each deposit includes validator public key, withdrawal credentials, signature, deposit data root, and amount.
Parameters
| Parameter | Type | Description |
|---|---|---|
payload | OVMDepositPayload | Data needed to deposit to OVM |
Returns
Promise<{ txHashes: string[]; }>
Array of transaction hashes, one for each deposit
Remarks
⚠️ Important: If you're storing the private key in an .env file, ensure it is securely managed
and not pushed to version control.
Throws
Will throw an error if the signer is not provided, OVM address is invalid, or the deposit fails
An example of how to use deposit:
const result = await client.splits.deposit({
ovmAddress: '0x1234567890123456789012345678901234567890',
deposits: [{
pubkey: '0x123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456',
withdrawal_credentials: '0x1234567890123456789012345678901234567890',
signature: '0x123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456',
deposit_data_root: '0x1234567890123456789012345678901234567890123456789012345678901234',
amount: '32000000000000000000' // 32 ETH in wei
}]
});
console.log('Deposits completed:', result.txHashes);