@obolnetwork/obol-sdk 2.12.2 → 2.12.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/src/index.js +72 -13
- package/dist/browser/src/index.js.map +1 -1
- package/dist/cjs/src/index.js +73 -13
- package/dist/cjs/src/index.js.map +1 -1
- package/dist/cjs/src/verification/clusterLockValidationWorker.js +39 -8
- package/dist/cjs/src/verification/clusterLockValidationWorker.js.map +1 -1
- package/dist/cjs/src/verification/parallelPool.js +27 -7
- package/dist/cjs/src/verification/parallelPool.js.map +1 -1
- package/dist/esm/src/{chunk-YSXFCSVK.js → chunk-BJWBUH75.js} +39 -8
- package/dist/esm/src/chunk-BJWBUH75.js.map +1 -0
- package/dist/esm/src/{chunk-T74RX3N2.js → chunk-L2GZF5CQ.js} +8 -4
- package/dist/esm/src/chunk-L2GZF5CQ.js.map +1 -0
- package/dist/esm/src/index.js +33 -6
- package/dist/esm/src/index.js.map +1 -1
- package/dist/esm/src/verification/clusterLockValidationWorker.js +9 -3
- package/dist/esm/src/verification/clusterLockValidationWorker.js.map +1 -1
- package/dist/esm/src/verification/parallelPool.js +1 -1
- package/dist/types/src/errors.d.ts +17 -7
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/services.d.ts +6 -3
- package/dist/types/src/verification/parallelPool.d.ts +4 -0
- package/dist/types/src/verification/validationConcurrency.d.ts +11 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/dist/esm/src/chunk-T74RX3N2.js.map +0 -1
- package/dist/esm/src/chunk-YSXFCSVK.js.map +0 -1
- package/dist/types/test/client/ajv.spec.d.ts +0 -1
- package/dist/types/test/client/baseUrl.spec.d.ts +0 -1
- package/dist/types/test/client/methods.spec.d.ts +0 -18
- package/dist/types/test/eoa/eoa.spec.d.ts +0 -1
- package/dist/types/test/exit/ethUtils.spec.d.ts +0 -1
- package/dist/types/test/exit/exit.spec.d.ts +0 -1
- package/dist/types/test/exit/verificationHelpers.spec.d.ts +0 -1
- package/dist/types/test/fixtures.d.ts +0 -359
- package/dist/types/test/incentives/incentives.spec.d.ts +0 -1
- package/dist/types/test/splits/splits.spec.d.ts +0 -1
- package/dist/types/test/verification/parallelPool.spec.d.ts +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/index.ts","../../../src/base.ts","../../../src/ajv.ts","../../../src/schema.ts","../../../src/splits/splitHelpers.ts","../../../src/abi/OWR.ts","../../../src/abi/OVM.ts","../../../src/abi/SplitMain.ts","../../../src/abi/splitV2FactoryAbi.ts","../../../src/abi/Multicall3.ts","../../../src/incentives/incentiveHelpers.ts","../../../src/abi/MerkleDistributorWithDeadline.ts","../../../src/incentives/incentives.ts","../../../src/exits/exit.ts","../../../src/exits/ethUtils.ts","../../../src/exits/verificationHelpers.ts","../../../src/splits/splits.ts","../../../src/eoa/eoaHelpers.ts","../../../src/abi/BatchDeposit.ts","../../../src/eoa/eoa.ts","../../../src/services.ts"],"sourcesContent":["import { v4 as uuidv4 } from 'uuid';\nimport { Base, type BaseConfig } from './base.js';\nimport {\n CONFLICT_ERROR_MSG,\n CreatorConfigHashSigningTypes,\n Domain,\n DKG_ALGORITHM,\n CONFIG_VERSION,\n OperatorConfigHashSigningTypes,\n EnrSigningTypes,\n TERMS_AND_CONDITIONS_VERSION,\n TermsAndConditionsSigningTypes,\n DEFAULT_BASE_VERSION,\n TERMS_AND_CONDITIONS_HASH,\n CHAIN_CONFIGURATION,\n DEFAULT_RETROACTIVE_FUNDING_REWARDS_ONLY_SPLIT,\n OBOL_SDK_EMAIL,\n isChainSupportedForSplitters,\n} from './constants.js';\nimport {\n ConflictError,\n SignerRequiredError,\n UnsupportedChainError,\n} from './errors.js';\nimport {\n type RewardsSplitPayload,\n type ClusterDefinition,\n type ClusterLock,\n type ClusterPayload,\n type OperatorPayload,\n type TotalSplitPayload,\n type ClusterValidator,\n type ETH_ADDRESS,\n type OWRTranches,\n type ProviderType,\n type SignerType,\n} from './types.js';\nimport { clusterConfigOrDefinitionHash } from './verification/common.js';\nimport { validatePayload } from './ajv.js';\nimport {\n definitionSchema,\n operatorPayloadSchema,\n rewardsSplitterPayloadSchema,\n totalSplitterPayloadSchema,\n} from './schema.js';\nimport {\n deploySplitterContract,\n formatSplitRecipients,\n handleDeployOWRAndSplitter,\n predictSplitterAddress,\n getOWRTranches,\n} from './splits/splitHelpers.js';\nimport { isContractAvailable } from './utils.js';\nimport { Incentives } from './incentives/incentives.js';\nimport { Exit } from './exits/exit.js';\nimport { ObolSplits } from './splits/splits.js';\nimport { EOA } from './eoa/eoa.js';\nexport * from './types.js';\nexport * from './services.js';\nexport * from './verification/signature-validator.js';\nexport * from './verification/common.js';\nexport * from './constants.js';\nexport {\n ConflictError,\n ClusterLockValidationTimeoutError,\n InvalidBaseUrlError,\n SignerRequiredError,\n UnsupportedChainError,\n} from './errors.js';\nexport { ALLOWED_OBOL_API_BASE_URLS } from './base.js';\nexport { Incentives } from './incentives/incentives.js';\nexport { Exit } from './exits/exit.js';\nexport { ObolSplits } from './splits/splits.js';\nexport { EOA } from './eoa/eoa.js';\nexport { blsVerify } from './blsUtils.js';\nexport { ENR } from '@chainsafe/enr';\n\n/**\n * Primary entrypoint for the Obol SDK. Use this class to create, manage,\n * and activate Distributed Validators via the Obol API.\n *\n * All operations are namespaced under the client instance:\n * - `client.incentives.*` – claim and query Obol incentives\n * - `client.exit.*` – validate and recombine voluntary exit signatures\n * - `client.splits.*` – deploy OVM / SplitV2 reward-splitting contracts\n * - `client.eoa.*` – EOA withdrawals and batch deposits\n *\n * Cluster lifecycle helpers live directly on the client:\n * - {@link Client.acceptObolLatestTermsAndConditions}\n * - {@link Client.createClusterDefinition}\n * - {@link Client.acceptClusterDefinition}\n * - {@link Client.getClusterDefinition}\n * - {@link Client.getClusterLock}\n * - {@link Client.getClusterLockByHash}\n * - {@link Client.createObolRewardsSplit}\n * - {@link Client.createObolTotalSplit}\n * - {@link Client.getOWRTranches}\n *\n * Supported networks (by `chainId`): Mainnet (1), Hoodi (560048),\n * Gnosis (100), Sepolia (11155111).\n *\n * @example\n * ```typescript\n * import { Client } from \"@obolnetwork/obol-sdk\";\n * import { Wallet } from \"ethers\";\n *\n * const signer = new Wallet(process.env.PRIVATE_KEY!);\n * const client = new Client({ chainId: 560048 }, signer);\n *\n * // 1. Accept terms (required once before creating/updating data)\n * await client.acceptObolLatestTermsAndConditions();\n *\n * // 2. Create a cluster definition\n * const configHash = await client.createClusterDefinition({\n * name: \"my-cluster\",\n * operators: [{ address: \"0x...\" }],\n * validators: [{\n * fee_recipient_address: \"0x...\",\n * withdrawal_address: \"0x...\",\n * }],\n * });\n *\n * // 3. Retrieve the definition\n * const def = await client.getClusterDefinition(configHash);\n * ```\n */\nexport class Client extends Base {\n private readonly signer: SignerType | undefined;\n\n /**\n * Incentives module – claim and query Obol incentive rewards.\n *\n * @see {@link Incentives}\n */\n public incentives: Incentives;\n\n /**\n * Exit module – verify partial exit signatures and recombine exit blobs\n * for distributed validator voluntary exits.\n *\n * @see {@link Exit}\n */\n public exit: Exit;\n\n /**\n * Splits module – deploy OVM and SplitV2 contracts for reward/principal\n * splitting, request withdrawals, and deposit to OVM contracts.\n *\n * @see {@link ObolSplits}\n */\n public splits: ObolSplits;\n\n /**\n * EOA module – request withdrawals and batch-deposit validators\n * via Externally Owned Account contracts.\n *\n * @see {@link EOA}\n */\n public eoa: EOA;\n\n /**\n * The blockchain provider used for on-chain reads.\n * Defaults to `signer.provider` when a signer is supplied.\n */\n public provider: ProviderType | undefined | null;\n\n /**\n * Creates a new Obol SDK client.\n *\n * @param config - Client configuration object.\n * @param config.baseUrl - Obol API base URL. Defaults to `https://api.obol.tech`.\n * Must match one of {@link ALLOWED_OBOL_API_BASE_URLS} (API paths use `/v1/...` separately).\n * @param config.chainId - Target chain ID. Defaults to `560048` (Hoodi).\n * Supported: 1 (Mainnet), 560048 (Hoodi), 100 (Gnosis), 11155111 (Sepolia).\n * @param signer - An ethers `Wallet` or `JsonRpcSigner`. Required for any\n * write operation (creating clusters, deploying splits, claiming incentives).\n * Read-only operations (`getClusterDefinition`, `getClusterLock`) work without a signer.\n * @param provider - An ethers `Provider`. If omitted, falls back to `signer.provider`.\n *\n * @example\n * ```typescript\n * // Minimal read-only client (no signer)\n * const readClient = new Client({ chainId: 1 });\n * const def = await readClient.getClusterDefinition(configHash);\n *\n * // Full client with signer for write operations\n * const client = new Client({ chainId: 560048 }, signer);\n * ```\n */\n constructor(\n config: BaseConfig,\n signer?: SignerType,\n provider?: ProviderType,\n ) {\n super(config);\n this.signer = signer;\n // Use the provided provider, or fall back to signer.provider if available\n this.provider =\n provider ??\n (signer && 'provider' in signer ? signer.provider : undefined);\n this.incentives = new Incentives(\n this.signer,\n this.chainId,\n this.request.bind(this),\n this.provider,\n );\n this.exit = new Exit(this.chainId, this.provider);\n this.splits = new ObolSplits(this.signer, this.chainId, this.provider);\n this.eoa = new EOA(this.signer, this.chainId, this.provider);\n }\n\n /**\n * Accepts the latest Obol terms and conditions.\n *\n * **Must be called once** before any write operation\n * (`createClusterDefinition`, `acceptClusterDefinition`, etc.).\n * Calling it again after acceptance throws a {@link ConflictError}.\n *\n * - Requires a `signer` to be provided at client construction.\n * - Signs an EIP-712 typed-data message; no on-chain transaction is sent.\n * - Idempotent per signer address: once accepted, subsequent calls throw `ConflictError`.\n *\n * @returns A success message string from the Obol API.\n * @throws {SignerRequiredError} If no signer was provided to the client.\n * @throws {ConflictError} If the terms were already accepted by this address.\n *\n * @example\n * ```typescript\n * const message = await client.acceptObolLatestTermsAndConditions();\n * console.log(message); // \"Terms and conditions accepted successfully\"\n * ```\n */\n async acceptObolLatestTermsAndConditions(): Promise<string> {\n if (!this.signer) {\n throw new SignerRequiredError('acceptObolLatestTermsAndConditions');\n }\n\n try {\n const termsAndConditionsHash = TERMS_AND_CONDITIONS_HASH;\n const address = await this.signer.getAddress();\n const termsAndConditionsPayload = {\n address,\n version: TERMS_AND_CONDITIONS_VERSION,\n terms_and_conditions_hash: termsAndConditionsHash,\n fork_version: this.fork_version,\n };\n\n const termsAndConditionsSignature = await this.signer.signTypedData(\n Domain(),\n TermsAndConditionsSigningTypes,\n {\n terms_and_conditions_hash: termsAndConditionsHash,\n version: TERMS_AND_CONDITIONS_VERSION,\n },\n );\n\n const termsAndConditionsResponse: { message: string; success: boolean } =\n await this.request(`/${DEFAULT_BASE_VERSION}/termsAndConditions`, {\n method: 'POST',\n body: JSON.stringify(termsAndConditionsPayload),\n headers: {\n Authorization: `Bearer ${termsAndConditionsSignature}`,\n },\n });\n return termsAndConditionsResponse?.message;\n } catch (err: any) {\n if (err?.message === CONFLICT_ERROR_MSG) {\n throw new ConflictError();\n }\n throw err;\n }\n }\n\n /**\n * Deploys an Optimistic Withdrawal Recipient (OWR) and a Splitter Proxy contract.\n *\n * Use this when the **principal** goes to a single address and only **rewards**\n * are split among recipients. For splitting both principal and rewards, see\n * {@link Client.createObolTotalSplit}.\n *\n * - Requires a `signer` with ETH to pay deployment gas.\n * - Sends one or more on-chain transactions (irreversible).\n * - Automatically appends the Obol Retroactive Funding (RAF) recipient at the\n * configured percentage (default 1%).\n * - Only supported on Mainnet (1) and Hoodi (560048).\n *\n * @param rewardsSplitPayload - Configuration for the OWR and splitter deployment.\n * @returns The deployed OWR address as `withdrawal_address` and the\n * splitter proxy address as `fee_recipient_address`.\n * @throws {SignerRequiredError} If no signer was provided.\n * @throws {UnsupportedChainError} If the chain does not support splitters.\n *\n * @example\n * ```typescript\n * const { withdrawal_address, fee_recipient_address } =\n * await client.createObolRewardsSplit({\n * splitRecipients: [\n * { account: \"0xOperator1...\", percentAllocation: 50 },\n * { account: \"0xOperator2...\", percentAllocation: 49 },\n * ],\n * principalRecipient: \"0xPrincipalAddress...\",\n * etherAmount: 32,\n * });\n * ```\n */\n async createObolRewardsSplit({\n splitRecipients,\n principalRecipient,\n etherAmount,\n ObolRAFSplit = DEFAULT_RETROACTIVE_FUNDING_REWARDS_ONLY_SPLIT,\n distributorFee,\n controllerAddress,\n recoveryAddress,\n }: RewardsSplitPayload): Promise<ClusterValidator> {\n // This method doesnt require T&C signature\n if (!this.signer) {\n throw new SignerRequiredError('createObolRewardsSplit');\n }\n\n const validatedPayload = validatePayload<Required<RewardsSplitPayload>>(\n {\n splitRecipients,\n principalRecipient,\n etherAmount,\n ObolRAFSplit,\n distributorFee,\n controllerAddress,\n recoveryAddress,\n },\n rewardsSplitterPayloadSchema,\n );\n\n // Check if we allow splitters on this chainId\n if (!isChainSupportedForSplitters(this.chainId)) {\n throw new UnsupportedChainError(this.chainId, 'createObolRewardsSplit');\n }\n\n const chainConfig = CHAIN_CONFIGURATION[this.chainId];\n if (!chainConfig?.SPLITMAIN_CONTRACT) {\n throw new UnsupportedChainError(this.chainId, 'createObolRewardsSplit');\n }\n\n const checkSplitMainAddress = await isContractAvailable(\n chainConfig.SPLITMAIN_CONTRACT.address,\n this.signer.provider as ProviderType,\n chainConfig.SPLITMAIN_CONTRACT.bytecode,\n );\n\n const checkMulticall3Address = await isContractAvailable(\n chainConfig.MULTICALL3_CONTRACT.address,\n this.signer.provider as ProviderType,\n chainConfig.MULTICALL3_CONTRACT.bytecode,\n );\n\n const checkOWRFactoryAddress = await isContractAvailable(\n chainConfig.OWR_FACTORY_CONTRACT.address,\n this.signer.provider as ProviderType,\n chainConfig.OWR_FACTORY_CONTRACT.bytecode,\n );\n\n if (\n !checkMulticall3Address ||\n !checkSplitMainAddress ||\n !checkOWRFactoryAddress\n ) {\n throw new Error(\n `Required factory contracts are not available on chain ${this.chainId}. Contact Obol at ${OBOL_SDK_EMAIL}`,\n );\n }\n\n const retroActiveFundingRecipient = {\n account: chainConfig.RETROACTIVE_FUNDING_CONTRACT.address,\n percentAllocation: validatedPayload.ObolRAFSplit,\n };\n\n const copiedSplitRecipients = [...validatedPayload.splitRecipients];\n copiedSplitRecipients.push(retroActiveFundingRecipient);\n\n const { accounts, percentAllocations } = formatSplitRecipients(\n copiedSplitRecipients,\n );\n\n const predictedSplitterAddress = await predictSplitterAddress({\n signer: this.signer,\n accounts,\n percentAllocations,\n chainId: this.chainId,\n distributorFee: validatedPayload.distributorFee,\n controllerAddress: validatedPayload.controllerAddress,\n });\n\n const isSplitterDeployed = await isContractAvailable(\n predictedSplitterAddress,\n this.signer.provider as ProviderType,\n );\n\n const { withdrawal_address, fee_recipient_address } =\n await handleDeployOWRAndSplitter({\n signer: this.signer,\n isSplitterDeployed: !!isSplitterDeployed,\n predictedSplitterAddress,\n accounts,\n percentAllocations,\n principalRecipient: validatedPayload.principalRecipient,\n etherAmount: validatedPayload.etherAmount,\n chainId: this.chainId,\n distributorFee: validatedPayload.distributorFee,\n controllerAddress: validatedPayload.controllerAddress,\n recoveryAddress: validatedPayload.recoveryAddress,\n });\n\n return { withdrawal_address, fee_recipient_address };\n }\n\n /**\n * Deploys a Splitter Proxy contract that splits **both principal and rewards**.\n *\n * Unlike {@link Client.createObolRewardsSplit}, this method does not deploy an\n * OWR – the splitter address is used as both `withdrawal_address` and\n * `fee_recipient_address`.\n *\n * - Requires a `signer` with ETH to pay deployment gas.\n * - Sends an on-chain transaction if the splitter is not already deployed (irreversible).\n * - If the predicted splitter is already deployed, returns the existing address without\n * sending a transaction (idempotent).\n * - Automatically appends the Obol RAF recipient.\n * - Only supported on Mainnet (1) and Hoodi (560048).\n *\n * @param totalSplitPayload - Configuration for the splitter deployment.\n * @returns The splitter address as both `withdrawal_address` and `fee_recipient_address`.\n * @throws {SignerRequiredError} If no signer was provided.\n * @throws {UnsupportedChainError} If the chain does not support splitters.\n * @throws {Error} If required on-chain factory contracts are unavailable.\n *\n * @example\n * ```typescript\n * const { withdrawal_address, fee_recipient_address } =\n * await client.createObolTotalSplit({\n * splitRecipients: [\n * { account: \"0xOperator1...\", percentAllocation: 50 },\n * { account: \"0xOperator2...\", percentAllocation: 49.9 },\n * ],\n * });\n * // withdrawal_address === fee_recipient_address (same splitter)\n * ```\n */\n async createObolTotalSplit({\n splitRecipients,\n ObolRAFSplit,\n distributorFee,\n controllerAddress,\n }: TotalSplitPayload): Promise<ClusterValidator> {\n // This method doesnt require T&C signature\n if (!this.signer) {\n throw new SignerRequiredError('createObolTotalSplit');\n }\n\n const validatedPayload = validatePayload<Required<TotalSplitPayload>>(\n {\n splitRecipients,\n ObolRAFSplit,\n distributorFee,\n controllerAddress,\n },\n totalSplitterPayloadSchema,\n );\n\n // Check if we allow splitters on this chainId\n if (!isChainSupportedForSplitters(this.chainId)) {\n throw new UnsupportedChainError(this.chainId, 'createObolTotalSplit');\n }\n\n const chainConfig = CHAIN_CONFIGURATION[this.chainId];\n if (!chainConfig?.SPLITMAIN_CONTRACT) {\n throw new UnsupportedChainError(this.chainId, 'createObolTotalSplit');\n }\n\n const checkSplitMainAddress = await isContractAvailable(\n chainConfig.SPLITMAIN_CONTRACT.address,\n this.signer.provider as ProviderType,\n chainConfig.SPLITMAIN_CONTRACT.bytecode,\n );\n\n if (!checkSplitMainAddress) {\n throw new Error(\n `Required factory contracts are not available on chain ${this.chainId}. Contact Obol at ${OBOL_SDK_EMAIL}`,\n );\n }\n\n const retroActiveFundingRecipient = {\n account: chainConfig.RETROACTIVE_FUNDING_CONTRACT.address,\n percentAllocation: validatedPayload.ObolRAFSplit,\n };\n\n const copiedSplitRecipients = [...validatedPayload.splitRecipients];\n copiedSplitRecipients.push(retroActiveFundingRecipient);\n\n const { accounts, percentAllocations } = formatSplitRecipients(\n copiedSplitRecipients,\n );\n\n const predictedSplitterAddress = await predictSplitterAddress({\n signer: this.signer,\n accounts,\n percentAllocations,\n chainId: this.chainId,\n distributorFee: validatedPayload.distributorFee,\n controllerAddress: validatedPayload.controllerAddress,\n });\n\n const isSplitterDeployed = await isContractAvailable(\n predictedSplitterAddress,\n this.signer.provider as ProviderType,\n );\n\n if (!isSplitterDeployed) {\n const splitterAddress = await deploySplitterContract({\n signer: this.signer,\n accounts,\n percentAllocations,\n chainId: this.chainId,\n distributorFee: validatedPayload.distributorFee,\n controllerAddress: validatedPayload.controllerAddress,\n });\n return {\n withdrawal_address: splitterAddress,\n fee_recipient_address: splitterAddress,\n };\n }\n\n return {\n withdrawal_address: predictedSplitterAddress,\n fee_recipient_address: predictedSplitterAddress,\n };\n }\n\n /**\n * Reads the tranches of a deployed Optimistic Withdrawal Recipient (OWR) contract.\n *\n * Returns the principal recipient, reward recipient, and staked principal amount\n * configured in the OWR. This is a read-only on-chain call (no transaction sent).\n *\n * - Requires a `signer` (for provider access).\n *\n * @param owrAddress - The Ethereum address of the deployed OWR contract.\n * @returns The OWR tranche data: `principalRecipient`, `rewardRecipient`, and `amountOfPrincipalStake`.\n * @throws {SignerRequiredError} If no signer was provided.\n *\n * @example\n * ```typescript\n * const tranches = await client.getOWRTranches(\"0xOWRAddress...\");\n * console.log(tranches.principalRecipient);\n * console.log(tranches.rewardRecipient);\n * console.log(tranches.amountOfPrincipalStake);\n * ```\n */\n async getOWRTranches(owrAddress: ETH_ADDRESS): Promise<OWRTranches> {\n if (!this.signer) {\n throw new SignerRequiredError('getOWRTranches');\n }\n\n const signer = this.signer;\n return await getOWRTranches({ owrAddress, signer });\n }\n\n /**\n * Creates a new cluster definition and registers it with the Obol API.\n *\n * A cluster definition describes the operators, validators, and configuration\n * for a Distributed Key Generation (DKG) ceremony. After creation, each operator\n * must call {@link Client.acceptClusterDefinition} to join.\n *\n * - Requires {@link Client.acceptObolLatestTermsAndConditions} to have been called first.\n * - Requires a `signer`.\n * - The `config_hash` returned is the unique identifier for this cluster.\n * - Threshold is automatically set to `ceil(2/3 * operators.length)`.\n * - Creating a duplicate cluster throws a {@link ConflictError}.\n *\n * @param newCluster - The cluster configuration payload.\n * @returns The `config_hash` string that uniquely identifies this cluster definition.\n * @throws {SignerRequiredError} If no signer was provided.\n * @throws {ConflictError} If an identical cluster definition already exists.\n *\n * @example\n * ```typescript\n * const configHash = await client.createClusterDefinition({\n * name: \"my-dvt-cluster\",\n * operators: [{ address: \"0xOp1...\" }, { address: \"0xOp2...\" }],\n * validators: [{\n * fee_recipient_address: \"0xFeeRecipient...\",\n * withdrawal_address: \"0xWithdrawal...\",\n * }],\n * });\n * console.log(\"Cluster created:\", configHash);\n * ```\n */\n async createClusterDefinition(newCluster: ClusterPayload): Promise<string> {\n if (!this.signer) {\n throw new SignerRequiredError('createClusterDefinition');\n }\n\n const validatedCluster = validatePayload<ClusterPayload>(\n newCluster,\n definitionSchema,\n );\n\n const clusterConfig: Partial<ClusterDefinition> = {\n ...validatedCluster,\n fork_version: this.fork_version,\n dkg_algorithm: DKG_ALGORITHM,\n version: CONFIG_VERSION,\n uuid: uuidv4(),\n timestamp: new Date().toISOString(),\n threshold: Math.ceil((2 * validatedCluster.operators.length) / 3),\n num_validators: validatedCluster.validators.length,\n };\n try {\n const address = await this.signer.getAddress();\n\n clusterConfig.creator = { address };\n clusterConfig.config_hash = clusterConfigOrDefinitionHash(\n clusterConfig as ClusterDefinition,\n true,\n );\n\n const creatorConfigSignature = await this.signer.signTypedData(\n Domain(this.chainId),\n CreatorConfigHashSigningTypes,\n { creator_config_hash: clusterConfig.config_hash },\n );\n\n const clusterDefinition: ClusterDefinition = await this.request(\n `/${DEFAULT_BASE_VERSION}/definition`,\n {\n method: 'POST',\n body: JSON.stringify(clusterConfig),\n headers: {\n Authorization: `Bearer ${creatorConfigSignature}`,\n 'fork-version': this.fork_version,\n },\n },\n );\n return clusterDefinition?.config_hash;\n } catch (err: any) {\n if (err?.message === CONFLICT_ERROR_MSG) {\n throw new ConflictError();\n }\n throw err;\n }\n }\n\n /**\n * Accepts (joins) an existing cluster definition as an operator.\n *\n * Each operator in the cluster must call this method with their ENR and the\n * cluster's `config_hash` to signal readiness for the DKG ceremony.\n *\n * - Requires a `signer` (the operator's address is derived from it).\n * - Signs two EIP-712 messages: one for the config hash, one for the ENR.\n * - The operator must be listed in the cluster definition's `operators` array.\n *\n * @param operatorPayload - Operator data. Must include `enr` (Ethereum Node Record)\n * and `version` at minimum.\n * @param configHash - The `config_hash` returned by {@link Client.createClusterDefinition}.\n * @returns The updated cluster definition with the operator's acceptance recorded.\n * @throws {SignerRequiredError} If no signer was provided.\n *\n * @example\n * ```typescript\n * const updatedDef = await client.acceptClusterDefinition(\n * { enr: \"enr:-LK4Q...\", version: \"v1.10.0\" },\n * configHash,\n * );\n * ```\n */\n async acceptClusterDefinition(\n operatorPayload: OperatorPayload,\n configHash: string,\n ): Promise<ClusterDefinition> {\n if (!this.signer) {\n throw new SignerRequiredError('acceptClusterDefinition');\n }\n\n const validatedPayload = validatePayload<OperatorPayload>(\n operatorPayload,\n operatorPayloadSchema,\n );\n\n try {\n const address = await this.signer.getAddress();\n\n const operatorConfigSignature = await this.signer.signTypedData(\n Domain(this.chainId),\n OperatorConfigHashSigningTypes,\n { operator_config_hash: configHash },\n );\n const operatorENRSignature = await this.signer.signTypedData(\n Domain(this.chainId),\n EnrSigningTypes,\n { enr: validatedPayload.enr },\n );\n\n const operatorData: OperatorPayload = {\n ...validatedPayload,\n address,\n enr_signature: operatorENRSignature,\n fork_version: this.fork_version,\n };\n const clusterDefinition: ClusterDefinition = await this.request(\n `/${DEFAULT_BASE_VERSION}/definition/${configHash}`,\n {\n method: 'PUT',\n body: JSON.stringify(operatorData),\n headers: {\n Authorization: `Bearer ${operatorConfigSignature}`,\n },\n },\n );\n return clusterDefinition;\n } catch (err: any) {\n throw err;\n }\n }\n\n /**\n * Retrieves a cluster definition by its configuration hash.\n *\n * This is a read-only API call – no signer is required.\n *\n * @param configHash - The `config_hash` returned by {@link Client.createClusterDefinition}.\n * @returns The full cluster definition including operators, validators, and metadata.\n * @throws {Error} If no cluster definition exists for the given hash (404).\n *\n * @example\n * ```typescript\n * const definition = await client.getClusterDefinition(configHash);\n * console.log(definition.name, definition.operators.length);\n * ```\n */\n async getClusterDefinition(configHash: string): Promise<ClusterDefinition> {\n const clusterDefinition: ClusterDefinition = await this.request(\n `/${DEFAULT_BASE_VERSION}/definition/${configHash}`,\n {\n method: 'GET',\n },\n );\n\n return clusterDefinition;\n }\n\n /**\n * Retrieves a cluster lock by the cluster's configuration hash.\n *\n * A cluster lock is generated after a successful DKG ceremony and contains\n * the distributed validators, their public key shares, and deposit data.\n * This is a read-only API call – no signer is required.\n *\n * @param configHash - The `config_hash` from the cluster definition.\n * @returns The cluster lock including distributed validators and deposit data.\n * @throws {Error} If no lock exists for the given config hash (DKG not yet complete, or not found).\n *\n * @example\n * ```typescript\n * const lock = await client.getClusterLock(configHash);\n * console.log(lock.distributed_validators.length);\n * console.log(lock.lock_hash);\n * ```\n */\n async getClusterLock(configHash: string): Promise<ClusterLock> {\n const lock: ClusterLock = await this.request(\n `/${DEFAULT_BASE_VERSION}/lock/configHash/${configHash}`,\n {\n method: 'GET',\n },\n );\n return lock;\n }\n\n /**\n * Retrieves a cluster lock by its lock hash (as opposed to config hash).\n *\n * Use this when you have the `lock_hash` directly rather than the `config_hash`.\n * This is a read-only API call – no signer is required.\n *\n * @param lockHash - The `lock_hash` from a cluster lock.\n * @returns The cluster lock including distributed validators and deposit data.\n * @throws {Error} If no lock exists for the given lock hash (not found).\n *\n * @example\n * ```typescript\n * const lock = await client.getClusterLockByHash(lockHash);\n * console.log(lock.cluster_definition.name);\n * ```\n */\n async getClusterLockByHash(lockHash: string): Promise<ClusterLock> {\n const lock: ClusterLock = await this.request(\n `/${DEFAULT_BASE_VERSION}/lock/${lockHash}`,\n {\n method: 'GET',\n },\n );\n return lock;\n }\n}\n","// src/resources/base.ts\nimport {\n DEFAULT_BASE_URL,\n DEFAULT_CHAIN_ID,\n SDK_VERSION,\n} from './constants.js';\nimport { InvalidBaseUrlError } from './errors.js';\nimport { FORK_MAPPING } from './types.js';\n\n/** Official Obol API base URLs (no path suffix — `/v1` is added per request). */\nexport const ALLOWED_OBOL_API_BASE_URLS = [\n DEFAULT_BASE_URL,\n 'https://obol-api-nonprod-dev.dev.obol.tech',\n 'https://obol-api-nonprod-qa.dev.obol.tech',\n] as const;\n\nexport type AllowedObolApiBaseUrl = (typeof ALLOWED_OBOL_API_BASE_URLS)[number];\n\nconst ALLOWED_BASE_URLS = new Set<string>(ALLOWED_OBOL_API_BASE_URLS);\n\nfunction assertAllowedBaseUrl(baseUrl: string): string {\n let candidate = baseUrl.trim();\n while (candidate.endsWith('/')) {\n candidate = candidate.slice(0, -1);\n }\n if (!ALLOWED_BASE_URLS.has(candidate)) {\n throw new InvalidBaseUrlError(\n `baseUrl must be one of: ${ALLOWED_OBOL_API_BASE_URLS.join(', ')}`,\n );\n }\n return candidate;\n}\n\nexport interface BaseConfig {\n baseUrl?: string;\n chainId?: FORK_MAPPING;\n}\n\nexport abstract class Base {\n baseUrl: string;\n chainId: number;\n fork_version: string;\n\n constructor({\n baseUrl = DEFAULT_BASE_URL,\n chainId = DEFAULT_CHAIN_ID,\n }: BaseConfig) {\n this.baseUrl = assertAllowedBaseUrl(baseUrl);\n this.chainId = chainId;\n this.fork_version = FORK_MAPPING[this.chainId];\n }\n\n protected async request<T>(\n endpoint: string,\n options?: RequestInit,\n ): Promise<T> {\n const url = `${this.baseUrl}${endpoint}`;\n const config = {\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n 'User-Agent': `Obol-SDK/${SDK_VERSION}`,\n ...options?.headers,\n },\n };\n\n try {\n const response = await fetch(url, config);\n if (response.ok) {\n return await response.json();\n } else {\n const errorResponse = await response.json();\n throw errorResponse;\n }\n } catch (e: any) {\n throw e;\n }\n }\n}\n","import addFormats from 'ajv-formats';\nimport addKeywords from 'ajv-keywords';\nimport { parseUnits } from 'ethers';\nimport {\n type OVMRewardsSplitPayload,\n type OVMTotalSplitPayload,\n type RewardsSplitPayload,\n type TotalSplitPayload,\n type OVMRequestWithdrawalPayload,\n} from './types.js';\nimport Ajv from 'ajv';\nimport {\n DEFAULT_RETROACTIVE_FUNDING_REWARDS_ONLY_SPLIT,\n DEFAULT_RETROACTIVE_FUNDING_TOTAL_SPLIT,\n} from './constants.js';\n\nexport const VALID_DEPOSIT_AMOUNTS = [\n parseUnits('1', 'gwei').toString(),\n parseUnits('32', 'gwei').toString(),\n parseUnits('8', 'gwei').toString(),\n parseUnits('256', 'gwei').toString(),\n];\n\nexport const VALID_NON_COMPOUNDING_AMOUNTS = [\n parseUnits('1', 'gwei').toString(),\n parseUnits('32', 'gwei').toString(),\n];\n\nconst calculateTotalPercentage = (\n recipients: Array<{ percentAllocation: number }>,\n): number => {\n return recipients.reduce((acc, curr) => acc + curr.percentAllocation, 0);\n};\n\nconst validateTotalPercentage = (totalPercentage: number): boolean => {\n return totalPercentage === 100;\n};\n\nconst validateTotalPercentageWithRAF = (\n totalPercentage: number,\n rafPercentage: number,\n): boolean => {\n return totalPercentage + rafPercentage === 100;\n};\n\nconst validateRewardsSplitRecipients = (\n _: boolean,\n data: RewardsSplitPayload,\n): boolean => {\n const obolRAFSplit =\n data?.ObolRAFSplit ?? DEFAULT_RETROACTIVE_FUNDING_REWARDS_ONLY_SPLIT;\n const splitPercentage = calculateTotalPercentage(data.splitRecipients);\n return validateTotalPercentageWithRAF(splitPercentage, obolRAFSplit);\n};\n\nconst validateTotalSplitRecipients = (\n _: boolean,\n data: TotalSplitPayload,\n): boolean => {\n const obolRAFSplit =\n data.ObolRAFSplit ?? DEFAULT_RETROACTIVE_FUNDING_TOTAL_SPLIT;\n const splitPercentage = calculateTotalPercentage(data.splitRecipients);\n return validateTotalPercentageWithRAF(splitPercentage, obolRAFSplit);\n};\n\nconst validateUniqueAddresses = (\n _: boolean,\n operators: Array<{ address: string }>,\n): boolean => {\n if (!operators) {\n return false;\n }\n\n if (operators.length < 4) {\n return false;\n }\n\n if (operators.every(op => op.address === '')) {\n return true;\n }\n\n if (operators.some(op => op.address.length !== 42)) {\n return false;\n }\n\n const addresses = operators.map(op => op.address);\n const uniqueAddresses = new Set(addresses);\n const isUnique = uniqueAddresses.size === addresses.length;\n return isUnique;\n};\n\nconst validateOVMRewardsSplitRecipients = (\n _: boolean,\n data: OVMRewardsSplitPayload,\n): boolean => {\n const obolRAFSplit = DEFAULT_RETROACTIVE_FUNDING_REWARDS_ONLY_SPLIT;\n const splitPercentage = calculateTotalPercentage(data.rewardSplitRecipients);\n return validateTotalPercentageWithRAF(splitPercentage, obolRAFSplit);\n};\n\nconst validateOVMTotalSplitRecipients = (\n _: boolean,\n data: OVMTotalSplitPayload,\n): boolean => {\n const splitPercentage = calculateTotalPercentage(\n data.principalSplitRecipients,\n );\n return validateTotalPercentage(splitPercentage);\n};\n\nconst validateOVMRequestWithdrawalPayload = (\n _: boolean,\n data: OVMRequestWithdrawalPayload,\n): boolean => {\n if (!data.pubKeys || !data.amounts) {\n return false;\n }\n\n if (data.pubKeys.length !== data.amounts.length) {\n return false;\n }\n\n // // Validate that all amounts are at least 1,000,000 gwei\n // const minAmount = BigInt(1000000);\n // for (const amountStr of data.amounts) {\n // const minAmount = BigInt(1000000);\n // const amount = BigInt(amountStr);\n // if (amount < minAmount) {\n // return false;\n // }\n // }\n\n return true;\n};\n\nconst ajv = new Ajv({\n allErrors: true,\n useDefaults: true,\n strict: false,\n $data: true,\n});\naddFormats(ajv);\naddKeywords(ajv, ['patternRequired']);\n\najv.addKeyword({\n keyword: 'validateRewardsSplitRecipients',\n validate: validateRewardsSplitRecipients,\n schemaType: 'boolean',\n});\n\najv.addKeyword({\n keyword: 'validateTotalSplitRecipients',\n validate: validateTotalSplitRecipients,\n schemaType: 'boolean',\n});\n\najv.addKeyword({\n keyword: 'validateUniqueAddresses',\n validate: validateUniqueAddresses,\n schemaType: 'boolean',\n});\n\najv.addKeyword({\n keyword: 'validateOVMRewardsSplitRecipients',\n validate: validateOVMRewardsSplitRecipients,\n schemaType: 'boolean',\n});\n\najv.addKeyword({\n keyword: 'validateOVMTotalSplitRecipients',\n validate: validateOVMTotalSplitRecipients,\n schemaType: 'boolean',\n});\n\najv.addKeyword({\n keyword: 'validateOVMRequestWithdrawalPayload',\n validate: validateOVMRequestWithdrawalPayload,\n schemaType: 'boolean',\n});\n\nexport function validatePayload<T>(data: unknown, schema: object): T {\n const validate = ajv.compile<T>(schema);\n const valid = validate(data);\n if (!valid) {\n const errors = validate.errors\n ?.map(e => `${e.instancePath} ${e.message}`)\n .join(', ');\n throw new Error(`Validation failed: ${errors}`);\n }\n return data;\n}\n","import { ZeroAddress } from 'ethers';\nimport {\n DEFAULT_RETROACTIVE_FUNDING_REWARDS_ONLY_SPLIT,\n DEFAULT_RETROACTIVE_FUNDING_TOTAL_SPLIT,\n PRINCIPAL_THRESHOLD,\n} from './constants.js';\nimport { VALID_DEPOSIT_AMOUNTS, VALID_NON_COMPOUNDING_AMOUNTS } from './ajv.js';\n\nexport const operatorPayloadSchema = {\n type: 'object',\n properties: {\n version: { type: 'string' },\n enr: { type: 'string' },\n },\n required: ['version', 'enr'],\n};\n\nexport const definitionSchema = {\n type: 'object',\n properties: {\n name: { type: 'string' },\n operators: {\n type: 'array',\n minItems: 4,\n items: {\n type: 'object',\n properties: {\n address: {\n type: 'string',\n },\n },\n required: ['address'],\n },\n validateUniqueAddresses: true,\n },\n validators: {\n type: 'array',\n minItems: 1,\n items: {\n type: 'object',\n properties: {\n fee_recipient_address: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{40}$',\n },\n withdrawal_address: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{40}$',\n },\n },\n required: ['fee_recipient_address', 'withdrawal_address'],\n },\n },\n deposit_amounts: {\n type: ['array', 'null'],\n items: {\n type: 'string',\n pattern: '^[0-9]+$',\n },\n if: {\n $data: '1/compounding',\n },\n then: {\n items: {\n enum: VALID_DEPOSIT_AMOUNTS,\n },\n },\n else: {\n items: {\n enum: VALID_NON_COMPOUNDING_AMOUNTS,\n },\n },\n default: null,\n },\n compounding: {\n type: 'boolean',\n default: false,\n },\n target_gas_limit: {\n type: 'number',\n minimum: 1,\n default: 36000000,\n },\n consensus_protocol: {\n type: 'string',\n enum: ['qbft', ''],\n default: '',\n },\n },\n required: ['name', 'operators', 'validators'],\n};\n\nexport const totalSplitterPayloadSchema = {\n type: 'object',\n properties: {\n splitRecipients: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n account: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{40}$',\n },\n percentAllocation: { type: 'number' },\n },\n required: ['account', 'percentAllocation'],\n },\n },\n ObolRAFSplit: {\n type: 'number',\n minimum: DEFAULT_RETROACTIVE_FUNDING_TOTAL_SPLIT,\n default: DEFAULT_RETROACTIVE_FUNDING_TOTAL_SPLIT,\n },\n distributorFee: {\n type: 'number',\n maximum: 10,\n multipleOf: 0.01,\n default: 0,\n },\n controllerAddress: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{40}$',\n default: ZeroAddress,\n },\n },\n validateTotalSplitRecipients: true,\n required: ['splitRecipients'],\n};\n\nexport const rewardsSplitterPayloadSchema = {\n type: 'object',\n properties: {\n ...totalSplitterPayloadSchema.properties,\n ObolRAFSplit: {\n type: 'number',\n minimum: DEFAULT_RETROACTIVE_FUNDING_REWARDS_ONLY_SPLIT,\n default: DEFAULT_RETROACTIVE_FUNDING_REWARDS_ONLY_SPLIT,\n },\n recoveryAddress: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{40}$',\n default: ZeroAddress,\n },\n etherAmount: { type: 'number' },\n principalRecipient: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{40}$',\n },\n },\n validateRewardsSplitRecipients: true,\n required: ['splitRecipients', 'principalRecipient', 'etherAmount'],\n};\n\nexport const ovmBaseSplitPayload = {\n rewardSplitRecipients: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n address: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{40}$',\n },\n percentAllocation: { type: 'number' },\n },\n required: ['address', 'percentAllocation'],\n },\n },\n OVMOwnerAddress: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{40}$',\n },\n splitOwnerAddress: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{40}$',\n default: ZeroAddress,\n },\n principalThreshold: {\n type: 'number',\n minimum: 16,\n default: PRINCIPAL_THRESHOLD,\n },\n distributorFeePercent: {\n type: 'number',\n minimum: 0,\n maximum: 10,\n default: 0,\n },\n};\n\nexport const ovmRewardsSplitPayloadSchema = {\n type: 'object',\n properties: {\n ...ovmBaseSplitPayload,\n principalRecipient: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{40}$',\n },\n },\n validateOVMRewardsSplitRecipients: true,\n required: ['rewardSplitRecipients', 'OVMOwnerAddress', 'principalRecipient'],\n};\n\nexport const ovmTotalSplitPayloadSchema = {\n type: 'object',\n properties: {\n ...ovmBaseSplitPayload,\n principalSplitRecipients: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n address: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{40}$',\n },\n percentAllocation: { type: 'number' },\n },\n required: ['address', 'percentAllocation'],\n },\n },\n },\n validateOVMRewardsSplitRecipients: true,\n validateOVMTotalSplitRecipients: true,\n required: [\n 'rewardSplitRecipients',\n 'principalSplitRecipients',\n 'OVMOwnerAddress',\n ],\n};\n\nexport const ovmRequestWithdrawalPayloadSchema = {\n type: 'object',\n properties: {\n withdrawalFees: {\n type: 'string',\n pattern: '^[0-9]+$',\n },\n ovmAddress: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{40}$',\n },\n pubKeys: {\n type: 'array',\n minItems: 1,\n items: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{96}$', // 48 bytes = 96 hex chars + 0x prefix\n },\n },\n amounts: {\n type: 'array',\n minItems: 1,\n items: {\n type: 'string',\n pattern: '^[0-9]+$',\n },\n },\n },\n validateOVMRequestWithdrawalPayload: true,\n required: ['ovmAddress', 'pubKeys', 'amounts', 'withdrawalFees'],\n};\n\nexport const eoaWithdrawalPayloadSchema = {\n type: 'object',\n properties: {\n pubkey: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{96}$', // 48 bytes = 96 hex chars + 0x prefix\n },\n allocation: {\n type: 'number',\n minimum: 0,\n },\n requiredFee: {\n type: 'string',\n pattern: '^[0-9]+$',\n },\n },\n required: ['pubkey', 'allocation', 'requiredFee'],\n};\n\nexport const ovmDepositPayloadSchema = {\n type: 'object',\n properties: {\n ovmAddress: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{40}$',\n },\n deposits: {\n type: 'array',\n minItems: 1,\n items: {\n type: 'object',\n properties: {\n pubkey: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{96}$',\n },\n withdrawal_credentials: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{64}$',\n description: '32 bytes withdrawal credentials',\n },\n signature: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{192}$',\n description: '96 bytes signature (190 hex chars + 0x prefix)',\n },\n deposit_data_root: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{64}$', // 32 bytes = 64 hex chars + 0x prefix\n },\n amount: {\n type: 'string',\n pattern: '^[0-9]+$',\n },\n },\n required: [\n 'pubkey',\n 'withdrawal_credentials',\n 'signature',\n 'deposit_data_root',\n 'amount',\n ],\n },\n },\n },\n required: ['ovmAddress', 'deposits'],\n};\n\nexport const eoaDepositPayloadSchema = {\n type: 'object',\n properties: {\n deposits: {\n type: 'array',\n minItems: 1,\n items: {\n type: 'object',\n properties: {\n pubkey: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{96}$',\n },\n withdrawal_credentials: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{64}$',\n description: '32 bytes withdrawal credentials',\n },\n signature: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{192}$',\n description: '96 bytes signature (190 hex chars + 0x prefix)',\n },\n deposit_data_root: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{64}$', // 32 bytes = 64 hex chars + 0x prefix\n },\n amount: {\n type: 'string',\n pattern: '^[0-9]+$',\n },\n },\n required: [\n 'pubkey',\n 'withdrawal_credentials',\n 'signature',\n 'deposit_data_root',\n 'amount',\n ],\n },\n },\n },\n required: ['deposits'],\n};\n","import {\n type OWRTranches,\n type ClusterValidator,\n type ETH_ADDRESS,\n type SplitRecipient,\n type SignerType,\n type SplitV2Recipient,\n type OVMArgs,\n type ChainConfig,\n} from '../types.js';\nimport {\n Contract,\n Interface,\n parseEther,\n ZeroAddress,\n getAddress as toChecksumAddress,\n} from 'ethers';\nimport { OWRContract, OWRFactoryContract } from '../abi/OWR.js';\nimport { OVMFactoryContract, OVMContract } from '../abi/OVM.js';\nimport { splitMainEthereumAbi } from '../abi/SplitMain.js';\nimport { CHAIN_CONFIGURATION, ETHER_TO_GWEI } from '../constants.js';\nimport { splitV2FactoryAbi } from '../abi/splitV2FactoryAbi.js';\nimport { MultiCall3Contract } from '../abi/Multicall3.js';\n\nconst splitMainContractInterface = new Interface(splitMainEthereumAbi);\nconst owrFactoryContractInterface = new Interface(OWRFactoryContract.abi);\nconst ovmFactoryContractInterface = new Interface(OVMFactoryContract.abi);\nconst splitV2FactoryInterface = new Interface(splitV2FactoryAbi);\n\ntype Call = {\n target: ETH_ADDRESS;\n callData: string;\n};\n\ntype OWRArgs = {\n recoveryAddress: ETH_ADDRESS;\n principalRecipient: ETH_ADDRESS;\n amountOfPrincipalStake: number;\n predictedSplitterAddress: ETH_ADDRESS;\n};\n\ntype SplitArgs = {\n accounts: ETH_ADDRESS[];\n percentAllocations: number[];\n distributorFee: number;\n controllerAddress: ETH_ADDRESS;\n};\n\n// Helper function to extract common recipient formatting logic\nconst formatRecipientsCommon = (\n recipients: SplitRecipient[] | SplitV2Recipient[],\n): {\n sortedRecipients: any[];\n getAddress: (item: any) => string;\n getPercentAllocation: (item: any) => number;\n} => {\n const copiedRecipients = [...recipients];\n\n // Handle both SplitRecipient and SplitV2Recipient types\n const getAddress = (item: any): string => item.account || item.address;\n const getPercentAllocation = (item: any): number => item.percentAllocation;\n\n // Has to be sorted when passed\n copiedRecipients.sort((a, b) => getAddress(a).localeCompare(getAddress(b)));\n\n return {\n sortedRecipients: copiedRecipients,\n getAddress,\n getPercentAllocation,\n };\n};\n\nexport const formatSplitRecipients = (\n recipients: SplitRecipient[],\n): { accounts: ETH_ADDRESS[]; percentAllocations: number[] } => {\n const { sortedRecipients, getAddress, getPercentAllocation } =\n formatRecipientsCommon(recipients);\n\n const accounts = sortedRecipients.map(item => getAddress(item));\n const percentAllocations = sortedRecipients.map(recipient => {\n const splitTostring = (getPercentAllocation(recipient) * 1e4).toFixed(0);\n return parseInt(splitTostring);\n });\n return { accounts, percentAllocations };\n};\n\nexport const predictSplitterAddress = async ({\n signer,\n accounts,\n percentAllocations,\n chainId,\n distributorFee,\n controllerAddress,\n}: {\n signer: SignerType;\n accounts: ETH_ADDRESS[];\n percentAllocations: number[];\n chainId: number;\n distributorFee: number;\n controllerAddress: ETH_ADDRESS;\n}): Promise<ETH_ADDRESS> => {\n try {\n const splitMainContractInstance = new Contract(\n getChainConfig(chainId).SPLITMAIN_CONTRACT.address,\n splitMainEthereumAbi,\n signer,\n );\n\n let predictedSplitterAddress: string;\n\n if (controllerAddress === ZeroAddress) {\n try {\n predictedSplitterAddress =\n await splitMainContractInstance.predictImmutableSplitAddress(\n accounts,\n percentAllocations,\n distributorFee,\n );\n } catch (error: any) {\n throw new Error(\n `Failed to predict immutable splitter address: ${error.message ?? 'Contract call failed'}`,\n );\n }\n } else {\n try {\n // It throws on deployed Immutable splitter\n predictedSplitterAddress =\n await splitMainContractInstance.createSplit.staticCall(\n accounts,\n percentAllocations,\n distributorFee,\n controllerAddress,\n );\n } catch (error: any) {\n throw new Error(\n `Failed to predict mutable splitter address via static call: ${error.message ?? 'Static call failed'}`,\n );\n }\n }\n\n return predictedSplitterAddress;\n } catch (error: any) {\n // Re-throw if it's already our custom error\n if (error.message.includes('Failed to predict')) {\n throw error;\n }\n // Handle unexpected errors\n throw new Error(\n `Unexpected error in predictSplitterAddress: ${error.message ?? 'Unknown contract interaction error'}`,\n );\n }\n};\n\nexport const handleDeployOWRAndSplitter = async ({\n signer,\n isSplitterDeployed,\n predictedSplitterAddress,\n accounts,\n percentAllocations,\n etherAmount,\n principalRecipient,\n chainId,\n distributorFee,\n controllerAddress,\n recoveryAddress,\n}: {\n signer: SignerType;\n isSplitterDeployed: boolean;\n predictedSplitterAddress: ETH_ADDRESS;\n accounts: ETH_ADDRESS[];\n percentAllocations: number[];\n etherAmount: number;\n principalRecipient: ETH_ADDRESS;\n chainId: number;\n distributorFee: number;\n controllerAddress: ETH_ADDRESS;\n recoveryAddress: ETH_ADDRESS;\n}): Promise<ClusterValidator> => {\n try {\n if (isSplitterDeployed) {\n let owrAddress: ETH_ADDRESS;\n try {\n owrAddress = await createOWRContract({\n owrArgs: {\n principalRecipient,\n amountOfPrincipalStake: etherAmount,\n predictedSplitterAddress,\n recoveryAddress,\n },\n signer,\n chainId,\n });\n } catch (error: any) {\n throw new Error(\n `Failed to create OWR contract with existing splitter: ${error.message ?? 'OWR contract creation failed'}`,\n );\n }\n return {\n withdrawal_address: owrAddress,\n fee_recipient_address: predictedSplitterAddress,\n };\n } else {\n let owrAddress: ETH_ADDRESS;\n let splitterAddress: ETH_ADDRESS;\n try {\n const result = await deploySplitterAndOWRContracts({\n owrArgs: {\n principalRecipient,\n amountOfPrincipalStake: etherAmount,\n predictedSplitterAddress,\n recoveryAddress,\n },\n splitterArgs: {\n accounts,\n percentAllocations,\n distributorFee,\n controllerAddress,\n },\n signer,\n chainId,\n });\n owrAddress = result.owrAddress;\n splitterAddress = result.splitterAddress;\n } catch (error: any) {\n throw new Error(\n `Failed to deploy both splitter and OWR contracts: ${error.message ?? 'Multicall3 contract deployment failed'}`,\n );\n }\n\n return {\n withdrawal_address: owrAddress,\n fee_recipient_address: splitterAddress,\n };\n }\n } catch (error: any) {\n // Re-throw if it's already our custom error\n if (error.message.includes('Failed to')) {\n throw error;\n }\n // Handle unexpected errors\n throw new Error(\n `Unexpected error in handleDeployOWRAndSplitter: ${error.message ?? 'Unknown error during contract deployment orchestration'}`,\n );\n }\n};\n\nconst createOWRContract = async ({\n owrArgs,\n signer,\n chainId,\n}: {\n owrArgs: OWRArgs;\n signer: SignerType;\n chainId: number;\n}): Promise<ETH_ADDRESS> => {\n try {\n const OWRFactoryInstance = new Contract(\n getChainConfig(chainId).OWR_FACTORY_CONTRACT.address,\n OWRFactoryContract.abi,\n signer,\n );\n\n let tx;\n try {\n tx = await OWRFactoryInstance.createOWRecipient(\n owrArgs.recoveryAddress,\n owrArgs.principalRecipient,\n owrArgs.predictedSplitterAddress,\n parseEther(owrArgs.amountOfPrincipalStake.toString()),\n );\n } catch (error: any) {\n throw new Error(\n `Failed to submit OWR contract creation transaction: ${error.message ?? 'Transaction submission failed'}`,\n );\n }\n\n let receipt;\n try {\n receipt = await tx.wait();\n } catch (error: any) {\n throw new Error(\n `OWR contract creation transaction failed or was reverted: ${error.message ?? 'Transaction execution failed'}`,\n );\n }\n\n if (!receipt?.logs?.length) {\n throw new Error(\n 'OWR contract creation transaction succeeded but no events were emitted - unable to determine contract address',\n );\n }\n\n const OWRAddressData = receipt.logs[0]?.topics[1];\n if (!OWRAddressData) {\n throw new Error(\n 'OWR contract creation transaction succeeded but contract address could not be extracted from events',\n );\n }\n\n const formattedOWRAddress = '0x' + OWRAddressData.slice(26, 66);\n\n // Basic address validation\n if (\n formattedOWRAddress.length !== 42 ||\n !formattedOWRAddress.startsWith('0x')\n ) {\n throw new Error(\n `Invalid OWR contract address format: ${formattedOWRAddress}`,\n );\n }\n\n return formattedOWRAddress;\n } catch (error: any) {\n // Re-throw if it's already our custom error\n if (\n error.message.includes('Failed to') ||\n error.message.includes('OWR contract') ||\n error.message.includes('Invalid OWR')\n ) {\n throw error;\n }\n // Handle unexpected errors\n throw new Error(\n `Unexpected error in createOWRContract: ${error.message ?? 'Unknown error during OWR contract creation'}`,\n );\n }\n};\n\nexport const deploySplitterContract = async ({\n signer,\n accounts,\n percentAllocations,\n chainId,\n distributorFee,\n controllerAddress,\n}: {\n signer: SignerType;\n accounts: ETH_ADDRESS[];\n percentAllocations: number[];\n chainId: number;\n distributorFee: number;\n controllerAddress: ETH_ADDRESS;\n}): Promise<ETH_ADDRESS> => {\n try {\n const splitMainContractInstance = new Contract(\n getChainConfig(chainId).SPLITMAIN_CONTRACT.address,\n splitMainEthereumAbi,\n signer,\n );\n\n let tx;\n try {\n tx = await splitMainContractInstance.createSplit(\n accounts,\n percentAllocations,\n distributorFee,\n controllerAddress,\n );\n } catch (error: any) {\n throw new Error(\n `Failed to submit splitter contract creation transaction: ${error.message ?? 'Transaction submission failed'}`,\n );\n }\n\n let receipt;\n try {\n receipt = await tx.wait();\n } catch (error: any) {\n throw new Error(\n `Splitter contract creation transaction failed or was reverted: ${error.message ?? 'Transaction execution failed'}`,\n );\n }\n\n if (!receipt?.logs?.length) {\n throw new Error(\n 'Splitter contract creation transaction succeeded but no events were emitted - unable to determine contract address',\n );\n }\n\n const splitterAddressData = receipt.logs[0]?.topics[1];\n if (!splitterAddressData) {\n throw new Error(\n 'Splitter contract creation transaction succeeded but contract address could not be extracted from events',\n );\n }\n\n const formattedSplitterAddress = '0x' + splitterAddressData.slice(26, 66);\n\n // Basic address validation\n if (\n formattedSplitterAddress.length !== 42 ||\n !formattedSplitterAddress.startsWith('0x')\n ) {\n throw new Error(\n `Invalid splitter contract address format: ${formattedSplitterAddress}`,\n );\n }\n\n return formattedSplitterAddress;\n } catch (error: any) {\n // Re-throw if it's already our custom error\n if (\n error.message.includes('Failed to') ||\n error.message.includes('Splitter contract') ||\n error.message.includes('Invalid splitter')\n ) {\n throw error;\n }\n // Handle unexpected errors\n throw new Error(\n `Unexpected error in deploySplitterContract: ${error.message ?? 'Unknown error during splitter contract creation'}`,\n );\n }\n};\n\nexport const deploySplitterAndOWRContracts = async ({\n owrArgs,\n splitterArgs,\n signer,\n chainId,\n}: {\n owrArgs: OWRArgs;\n splitterArgs: SplitArgs;\n signer: SignerType;\n chainId: number;\n}): Promise<{ owrAddress: ETH_ADDRESS; splitterAddress: ETH_ADDRESS }> => {\n const executeCalls: Call[] = [];\n\n const splitTxData = encodeCreateSplitTxData(\n splitterArgs.accounts,\n splitterArgs.percentAllocations,\n splitterArgs.distributorFee,\n splitterArgs.controllerAddress,\n );\n\n const owrTxData = encodeCreateOWRecipientTxData(\n owrArgs.recoveryAddress,\n owrArgs.principalRecipient,\n owrArgs.predictedSplitterAddress,\n owrArgs.amountOfPrincipalStake,\n );\n\n executeCalls.push(\n {\n target: getChainConfig(chainId).SPLITMAIN_CONTRACT.address,\n callData: splitTxData,\n },\n {\n target: getChainConfig(chainId).OWR_FACTORY_CONTRACT.address,\n callData: owrTxData,\n },\n );\n\n const executeMultiCalls = await multicall3(executeCalls, signer, chainId);\n\n const splitAddressData = executeMultiCalls?.logs[0]?.topics[1];\n const formattedSplitterAddress = '0x' + splitAddressData?.slice(26, 66);\n const owrAddressData = executeMultiCalls?.logs[1]?.topics[1];\n const formattedOwrAddress = '0x' + owrAddressData?.slice(26, 66);\n\n return {\n owrAddress: formattedOwrAddress,\n splitterAddress: formattedSplitterAddress,\n };\n};\n\nexport const getOWRTranches = async ({\n owrAddress,\n signer,\n}: {\n owrAddress: ETH_ADDRESS;\n signer: SignerType;\n}): Promise<OWRTranches> => {\n try {\n const owrContract = new Contract(owrAddress, OWRContract.abi, signer);\n\n let res;\n try {\n res = await owrContract.getTranches();\n } catch (error: any) {\n throw new Error(\n `Failed to call getTranches on OWR contract at ${owrAddress}: ${error.message ?? 'Contract call failed'}`,\n );\n }\n\n if (!res) {\n throw new Error(\n `OWR contract at ${owrAddress} returned empty result for getTranches()`,\n );\n }\n\n return {\n principalRecipient: res.principalRecipient,\n rewardRecipient: res.rewardRecipient,\n amountOfPrincipalStake: res.amountOfPrincipalStake,\n };\n } catch (error: any) {\n // Re-throw if it's already our custom error\n if (\n error.message.includes('Failed to') ||\n error.message.includes('OWR contract')\n ) {\n throw error;\n }\n // Handle unexpected errors\n throw new Error(\n `Unexpected error in getOWRTranches: ${error.message ?? 'Unknown error while fetching OWR tranche data'}`,\n );\n }\n};\n\nexport const multicall3 = async (\n calls: Call[],\n signer: SignerType,\n chainId: number,\n): Promise<any> => {\n try {\n const chainConfig = getChainConfig(chainId);\n const multicall3Address = chainConfig.MULTICALL3_CONTRACT.address;\n const multiCall3ContractInstance = new Contract(\n multicall3Address,\n MultiCall3Contract.abi,\n signer,\n );\n\n let tx;\n try {\n tx = await multiCall3ContractInstance.aggregate(calls);\n } catch (error: any) {\n throw new Error(\n `Failed to submit multicall3 transaction: ${error.message ?? 'Transaction submission failed'}`,\n );\n }\n\n let receipt;\n try {\n receipt = await tx.wait();\n } catch (error: any) {\n throw new Error(\n `Multicall3 transaction failed or was reverted: ${error.message ?? 'Transaction execution failed'}`,\n );\n }\n\n if (!receipt) {\n throw new Error(\n 'Multicall3 transaction succeeded but no receipt was returned',\n );\n }\n\n return receipt;\n } catch (error: any) {\n // Re-throw if it's already our custom error\n if (\n error.message.includes('Failed to') ||\n error.message.includes('Multicall3 transaction')\n ) {\n throw error;\n }\n // Handle unexpected errors\n throw new Error(\n `Unexpected error in multicall3: ${error.message ?? 'Unknown error during multicall3 execution'}`,\n );\n }\n};\n\nconst encodeCreateSplitTxData = (\n accounts: ETH_ADDRESS[],\n percentAllocations: number[],\n distributorFee: number,\n controller: ETH_ADDRESS,\n): ETH_ADDRESS => {\n return splitMainContractInterface.encodeFunctionData('createSplit', [\n accounts,\n percentAllocations,\n distributorFee,\n controller,\n ]);\n};\n\nconst encodeCreateOWRecipientTxData = (\n recoveryAddress: ETH_ADDRESS,\n principalRecipient: ETH_ADDRESS,\n rewardRecipient: ETH_ADDRESS,\n amountOfPrincipalStake: number,\n): ETH_ADDRESS => {\n return owrFactoryContractInterface.encodeFunctionData('createOWRecipient', [\n recoveryAddress,\n principalRecipient,\n rewardRecipient,\n parseEther(amountOfPrincipalStake.toString()),\n ]);\n};\n\n// OVM and SplitV2 Helper Functions\n\n// Helper function to format recipients specifically for SplitV2 (returns SplitV2Recipient[])\nexport const formatRecipientsForSplitV2 = (\n splitRecipients: SplitRecipient[] | SplitV2Recipient[],\n): SplitV2Recipient[] => {\n const { sortedRecipients, getAddress, getPercentAllocation } =\n formatRecipientsCommon(splitRecipients);\n\n return sortedRecipients\n .filter(item => getAddress(item) !== '')\n .map(item => ({\n address: getAddress(item),\n percentAllocation: parseFloat(getPercentAllocation(item).toString()),\n }));\n};\n\n// Helper function to create SplitV2 parameters\nconst createSplitV2Params = (\n recipients: SplitV2Recipient[],\n distributorFeePercent: number,\n): {\n recipients: string[];\n allocations: number[];\n totalAllocation: number;\n distributionIncentive: number;\n} => {\n const addresses = recipients.map(r => r.address);\n const allocations = recipients.map(r =>\n Math.floor(r.percentAllocation * 1e4),\n ); // Convert to basis points\n const totalAllocation = allocations.reduce(\n (sum, allocation) => sum + allocation,\n 0,\n );\n\n return {\n recipients: addresses,\n allocations,\n totalAllocation,\n distributionIncentive: distributorFeePercent,\n };\n};\n\nexport const predictSplitV2Address = async ({\n splitOwnerAddress,\n recipients,\n distributorFeePercent,\n salt,\n signer,\n chainId,\n}: {\n splitOwnerAddress: string;\n recipients: SplitV2Recipient[];\n distributorFeePercent: number;\n salt: `0x${string}`;\n signer: SignerType;\n chainId: number;\n}): Promise<string> => {\n try {\n const chainConfig = getChainConfig(chainId);\n if (!chainConfig?.SPLIT_V2_FACTORY_CONTRACT?.address) {\n throw new Error(`SplitV2 Factory not configured for chain ${chainId}`);\n }\n\n const splitV2FactoryContract = new Contract(\n chainConfig.SPLIT_V2_FACTORY_CONTRACT.address,\n splitV2FactoryAbi,\n signer,\n );\n\n const splitParams = createSplitV2Params(recipients, distributorFeePercent);\n\n const predictedAddress = await splitV2FactoryContract[\n 'predictDeterministicAddress((address[],uint256[],uint256,uint16),address,bytes32)'\n ](splitParams, splitOwnerAddress, salt);\n\n return predictedAddress;\n } catch (error: any) {\n throw new Error(\n `Failed to predict SplitV2 address: ${error.message ?? 'SplitV2 contract call failed'}`,\n );\n }\n};\n\nexport const isSplitV2Deployed = async ({\n splitOwnerAddress,\n recipients,\n distributorFeePercent,\n salt,\n signer,\n chainId,\n}: {\n splitOwnerAddress: string;\n recipients: SplitV2Recipient[];\n distributorFeePercent: number;\n salt: `0x${string}`;\n signer: SignerType;\n chainId: number;\n}): Promise<boolean> => {\n try {\n const chainConfig = getChainConfig(chainId);\n if (!chainConfig?.SPLIT_V2_FACTORY_CONTRACT?.address) {\n throw new Error(`SplitV2 Factory not configured for chain ${chainId}`);\n }\n\n const splitV2FactoryContract = new Contract(\n chainConfig.SPLIT_V2_FACTORY_CONTRACT.address,\n splitV2FactoryAbi,\n signer,\n );\n\n const splitParams = createSplitV2Params(recipients, distributorFeePercent);\n\n const [, exists] = await splitV2FactoryContract.isDeployed(\n splitParams,\n splitOwnerAddress,\n salt,\n );\n\n return exists;\n } catch (error: any) {\n // If the check fails, assume it's not deployed\n return false;\n }\n};\n\nexport const deployOVMContract = async ({\n OVMOwnerAddress,\n principalRecipient,\n rewardRecipient,\n principalThreshold,\n signer,\n chainId,\n}: {\n OVMOwnerAddress: string;\n principalRecipient: string;\n rewardRecipient: string;\n principalThreshold: number;\n signer: SignerType;\n chainId: number;\n}): Promise<string> => {\n try {\n const chainConfig = getChainConfig(chainId);\n if (!chainConfig?.OVM_FACTORY_CONTRACT?.address) {\n throw new Error(`OVM Factory not configured for chain ${chainId}`);\n }\n\n const ovmFactoryContract = new Contract(\n chainConfig.OVM_FACTORY_CONTRACT.address,\n OVMFactoryContract.abi,\n signer,\n );\n\n const tx = await ovmFactoryContract.createObolValidatorManager(\n OVMOwnerAddress,\n principalRecipient,\n rewardRecipient,\n principalThreshold * ETHER_TO_GWEI,\n );\n\n const receipt = await tx.wait();\n\n // Extract OVM address from logs\n const ovmAddressLog = receipt?.logs[1]?.topics[1];\n if (!ovmAddressLog) {\n throw new Error('Failed to extract OVM address from transaction logs');\n }\n\n const ovmAddress = '0x' + ovmAddressLog.slice(26, 66);\n return toChecksumAddress(ovmAddress);\n } catch (error: any) {\n throw new Error(\n `Failed to deploy OVM contract: ${error.message ?? 'OVM deployment failed'}`,\n );\n }\n};\n\nexport const deployOVMAndSplitV2 = async ({\n ovmArgs,\n rewardRecipients,\n isRewardsSplitterDeployed,\n distributorFeePercent,\n salt,\n signer,\n chainId,\n principalSplitRecipients,\n isPrincipalSplitDeployed,\n splitOwnerAddress,\n}: {\n ovmArgs: OVMArgs;\n rewardRecipients: SplitV2Recipient[];\n isRewardsSplitterDeployed?: boolean;\n distributorFeePercent: number;\n salt: `0x${string}`;\n signer: SignerType;\n chainId: number;\n principalSplitRecipients?: SplitV2Recipient[];\n isPrincipalSplitDeployed?: boolean;\n splitOwnerAddress: string;\n}): Promise<string> => {\n try {\n const chainConfig = getChainConfig(chainId);\n if (!chainConfig?.OVM_FACTORY_CONTRACT?.address) {\n throw new Error(`OVM Factory not configured for chain ${chainId}`);\n }\n\n if (!chainConfig?.SPLIT_V2_FACTORY_CONTRACT?.address) {\n throw new Error(`SplitV2 Factory not configured for chain ${chainId}`);\n }\n\n const executeCalls: Call[] = [];\n\n if (rewardRecipients && !isRewardsSplitterDeployed) {\n // Create rewards split call data\n const splitParams = createSplitV2Params(\n rewardRecipients,\n distributorFeePercent,\n );\n const rewardsSplitTxData = encodeCreateSplitV2DeterministicTxData(\n splitParams,\n splitOwnerAddress,\n salt,\n );\n\n executeCalls.push({\n target: chainConfig.SPLIT_V2_FACTORY_CONTRACT.address,\n callData: rewardsSplitTxData,\n });\n }\n\n // Create principal split call data if needed (for total split scenario)\n if (principalSplitRecipients && !isPrincipalSplitDeployed) {\n const principalSplitParams = createSplitV2Params(\n principalSplitRecipients,\n distributorFeePercent,\n );\n const principalSplitTxData = encodeCreateSplitV2DeterministicTxData(\n principalSplitParams,\n splitOwnerAddress,\n salt,\n );\n executeCalls.push({\n target: chainConfig.SPLIT_V2_FACTORY_CONTRACT.address,\n callData: principalSplitTxData,\n });\n }\n\n // Create OVM call data\n const ovmTxData = encodeCreateOVMTxData(\n ovmArgs.OVMOwnerAddress,\n ovmArgs.principalRecipient,\n ovmArgs.rewardRecipient,\n ovmArgs.principalThreshold * ETHER_TO_GWEI,\n );\n\n executeCalls.push({\n target: chainConfig.OVM_FACTORY_CONTRACT.address,\n callData: ovmTxData,\n });\n\n // Execute multicall3\n const executeMultiCalls = await multicall3(executeCalls, signer, chainId);\n\n // Extract addresses from events\n let ovmAddress: string | undefined;\n const logsCount = executeMultiCalls?.logs?.length || 0;\n\n if (logsCount === 2) {\n ovmAddress = '0x' + executeMultiCalls?.logs[1]?.topics[1]?.slice(26, 66);\n } else if (logsCount === 5) {\n ovmAddress = '0x' + executeMultiCalls?.logs[4]?.topics[1]?.slice(26, 66);\n } else {\n ovmAddress = '0x' + executeMultiCalls?.logs[7]?.topics[1]?.slice(26, 66);\n }\n if (!ovmAddress) {\n throw new Error(\n 'Failed to extract contract addresses from multicall3 events',\n );\n }\n\n return ovmAddress;\n } catch (error: any) {\n throw new Error(\n `Failed to deploy OVM and SplitV2: ${error.message ?? 'Deployment failed'}`,\n );\n }\n};\n\nconst encodeCreateOVMTxData = (\n OVMOwnerAddress: string,\n principalRecipient: string,\n rewardRecipient: string,\n principalThreshold: number,\n): string => {\n return ovmFactoryContractInterface.encodeFunctionData(\n 'createObolValidatorManager',\n [OVMOwnerAddress, principalRecipient, rewardRecipient, principalThreshold],\n );\n};\n\nconst encodeCreateSplitV2DeterministicTxData = (\n splitParams: {\n recipients: string[];\n allocations: number[];\n totalAllocation: number;\n distributionIncentive: number;\n },\n splitOwnerAddress: string,\n salt: `0x${string}`,\n): string => {\n // creatorAddress can be kept as default https://docs.splits.org/sdk/splits-v2#createsplit\n return splitV2FactoryInterface.encodeFunctionData(\n 'createSplitDeterministic',\n [splitParams, splitOwnerAddress, ZeroAddress, salt],\n );\n};\n\n// Helper function to safely get chain configuration\nconst getChainConfig = (chainId: number): ChainConfig => {\n const config = CHAIN_CONFIGURATION[chainId];\n if (!config) {\n throw new Error(`Chain configuration not found for chain ID ${chainId}`);\n }\n return config;\n};\n\n/**\n * Requests withdrawal from an OVM contract\n * @param ovmAddress - The address of the OVM contract\n * @param pubKeys - Array of validator public keys in bytes format\n * @param amounts - Array of withdrawal amounts in wei (uint64)\n * @param withdrawalFees - Total withdrawal fees in wei\n * @param signer - The signer to use for the transaction\n * @returns Promise that resolves to the transaction hash\n */\nexport const requestWithdrawalFromOVM = async ({\n ovmAddress,\n pubKeys,\n amounts,\n withdrawalFees,\n signer,\n}: {\n ovmAddress: string;\n pubKeys: string[];\n amounts: string[];\n withdrawalFees: string;\n signer: SignerType;\n}): Promise<{ txHash: string }> => {\n try {\n if (pubKeys.length === 0) {\n throw new Error('pubKeys array cannot be empty');\n }\n // Convert string amounts to bigint\n const bigintAmounts = amounts.map(amount => BigInt(amount));\n\n // Calculate maxFeePerWithdrawal as withdrawalFees / pubKeys.length\n const maxFeePerWithdrawal = BigInt(withdrawalFees) / BigInt(pubKeys.length);\n\n // Use ovmAddress as excessFeeRecipient\n const excessFeeRecipient = ovmAddress;\n\n const ovmContract = new Contract(ovmAddress, OVMContract.abi, signer);\n\n const tx = await ovmContract.withdraw(\n pubKeys,\n bigintAmounts,\n maxFeePerWithdrawal,\n excessFeeRecipient,\n {\n value: BigInt(withdrawalFees),\n },\n );\n const receipt = await tx.wait();\n\n return { txHash: receipt.hash };\n } catch (error: unknown) {\n const errorMessage =\n error instanceof Error ? error.message : 'Request withdrawal failed';\n throw new Error(`Failed to request withdrawal from OVM: ${errorMessage}`);\n }\n};\n\n/**\n * Deposits to OVM contract by sending individual transactions for each deposit.\n * @param ovmAddress - The address of the OVM contract\n * @param deposits - Array of deposit objects with all required parameters\n * @param signer - The signer to use for the transaction\n * @returns Promise that resolves to an array of transaction hashes\n */\nexport const depositOVM = async ({\n ovmAddress,\n deposits,\n signer,\n}: {\n ovmAddress: string;\n deposits: Array<{\n pubkey: string;\n withdrawal_credentials: string;\n signature: string;\n deposit_data_root: string;\n amount: string;\n }>;\n signer: SignerType;\n}): Promise<{ txHashes: string[] }> => {\n try {\n const ovmContract = new Contract(ovmAddress, OVMContract.abi, signer);\n const txHashes: string[] = [];\n\n // Process each deposit as a separate transaction\n // Multicall3 cannot be used because it doesn't have the DEPOSIT_ROLE\n for (const deposit of deposits) {\n const tx = await ovmContract.deposit(\n deposit.pubkey,\n deposit.withdrawal_credentials,\n deposit.signature,\n deposit.deposit_data_root,\n {\n value: BigInt(deposit.amount),\n },\n );\n\n const receipt = await tx.wait();\n if (receipt?.hash) {\n txHashes.push(receipt.hash as string);\n }\n }\n\n return { txHashes };\n } catch (error: unknown) {\n const errorMessage =\n error instanceof Error ? error.message : 'Deposit failed';\n throw new Error(`Failed to deposit to OVM: ${errorMessage}`);\n }\n};\n","export const OWRFactoryContract = {\n abi: [\n {\n inputs: [\n {\n internalType: 'string',\n name: '_ensName',\n type: 'string',\n },\n {\n internalType: 'address',\n name: '_ensReverseRegistrar',\n type: 'address',\n },\n {\n internalType: 'address',\n name: '_ensOwner',\n type: 'address',\n },\n ],\n stateMutability: 'nonpayable',\n type: 'constructor',\n },\n {\n inputs: [],\n name: 'Invalid__Recipients',\n type: 'error',\n },\n {\n inputs: [\n {\n internalType: 'uint256',\n name: 'threshold',\n type: 'uint256',\n },\n ],\n name: 'Invalid__ThresholdTooLarge',\n type: 'error',\n },\n {\n inputs: [],\n name: 'Invalid__ZeroThreshold',\n type: 'error',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'owr',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'address',\n name: 'recoveryAddress',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'address',\n name: 'principalRecipient',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'address',\n name: 'rewardRecipient',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'threshold',\n type: 'uint256',\n },\n ],\n name: 'CreateOWRecipient',\n type: 'event',\n },\n {\n inputs: [\n {\n internalType: 'address',\n name: 'recoveryAddress',\n type: 'address',\n },\n {\n internalType: 'address',\n name: 'principalRecipient',\n type: 'address',\n },\n {\n internalType: 'address',\n name: 'rewardRecipient',\n type: 'address',\n },\n {\n internalType: 'uint256',\n name: 'amountOfPrincipalStake',\n type: 'uint256',\n },\n ],\n name: 'createOWRecipient',\n outputs: [\n {\n internalType: 'contract OptimisticWithdrawalRecipient',\n name: 'owr',\n type: 'address',\n },\n ],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'owrImpl',\n outputs: [\n {\n internalType: 'contract OptimisticWithdrawalRecipient',\n name: '',\n type: 'address',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n ],\n};\n\nexport const OWRContract = {\n abi: [\n { inputs: [], stateMutability: 'nonpayable', type: 'constructor' },\n { inputs: [], name: 'InvalidDistribution_TooLarge', type: 'error' },\n {\n inputs: [],\n name: 'InvalidTokenRecovery_InvalidRecipient',\n type: 'error',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: 'uint256',\n name: 'principalPayout',\n type: 'uint256',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'rewardPayout',\n type: 'uint256',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'pullFlowFlag',\n type: 'uint256',\n },\n ],\n name: 'DistributeFunds',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: 'uint256',\n name: 'amount',\n type: 'uint256',\n },\n ],\n name: 'ReceiveETH',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: 'address',\n name: 'recoveryAddressToken',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'address',\n name: 'recipient',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'amount',\n type: 'uint256',\n },\n ],\n name: 'RecoverNonOWRecipientFunds',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: 'address',\n name: 'account',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'amount',\n type: 'uint256',\n },\n ],\n name: 'Withdrawal',\n type: 'event',\n },\n {\n inputs: [],\n name: 'claimedPrincipalFunds',\n outputs: [{ internalType: 'uint128', name: '', type: 'uint128' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'distributeFunds',\n outputs: [],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'distributeFundsPull',\n outputs: [],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'fundsPendingWithdrawal',\n outputs: [{ internalType: 'uint128', name: '', type: 'uint128' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'account', type: 'address' }],\n name: 'getPullBalance',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'getTranches',\n outputs: [\n {\n internalType: 'address',\n name: 'principalRecipient',\n type: 'address',\n },\n { internalType: 'address', name: 'rewardRecipient', type: 'address' },\n {\n internalType: 'uint256',\n name: 'amountOfPrincipalStake',\n type: 'uint256',\n },\n ],\n stateMutability: 'pure',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'nonOWRToken', type: 'address' },\n { internalType: 'address', name: 'recipient', type: 'address' },\n ],\n name: 'recoverFunds',\n outputs: [],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'recoveryAddress',\n outputs: [{ internalType: 'address', name: '', type: 'address' }],\n stateMutability: 'pure',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'account', type: 'address' }],\n name: 'withdraw',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n ],\n};\n","export const OVMFactoryContract = {\n abi: [\n {\n inputs: [\n {\n internalType: 'address',\n name: '_consolidationSystemContract',\n type: 'address',\n },\n {\n internalType: 'address',\n name: '_withdrawalSystemContract',\n type: 'address',\n },\n {\n internalType: 'address',\n name: '_depositSystemContract',\n type: 'address',\n },\n { internalType: 'string', name: '_ensName', type: 'string' },\n {\n internalType: 'address',\n name: '_ensReverseRegistrar',\n type: 'address',\n },\n { internalType: 'address', name: '_ensOwner', type: 'address' },\n ],\n stateMutability: 'nonpayable',\n type: 'constructor',\n },\n { inputs: [], name: 'Invalid_Owner', type: 'error' },\n { inputs: [], name: 'Invalid__Recipients', type: 'error' },\n { inputs: [], name: 'Invalid__ThresholdTooLarge', type: 'error' },\n { inputs: [], name: 'Invalid__ZeroThreshold', type: 'error' },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'ovm',\n type: 'address',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'owner',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'address',\n name: 'beneficiary',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'address',\n name: 'rewardRecipient',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'uint64',\n name: 'principalThreshold',\n type: 'uint64',\n },\n ],\n name: 'CreateObolValidatorManager',\n type: 'event',\n },\n {\n inputs: [],\n name: 'consolidationSystemContract',\n outputs: [{ internalType: 'address', name: '', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'owner', type: 'address' },\n { internalType: 'address', name: 'beneficiary', type: 'address' },\n { internalType: 'address', name: 'rewardRecipient', type: 'address' },\n { internalType: 'uint64', name: 'principalThreshold', type: 'uint64' },\n ],\n name: 'createObolValidatorManager',\n outputs: [\n {\n internalType: 'contract ObolValidatorManager',\n name: 'ovm',\n type: 'address',\n },\n ],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'depositSystemContract',\n outputs: [{ internalType: 'address', name: '', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'withdrawalSystemContract',\n outputs: [{ internalType: 'address', name: '', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n ],\n};\n\nexport const OVMContract = {\n abi: [\n {\n inputs: [\n {\n internalType: 'address',\n name: '_consolidationSystemContract',\n type: 'address',\n },\n {\n internalType: 'address',\n name: '_withdrawalSystemContract',\n type: 'address',\n },\n {\n internalType: 'address',\n name: '_depositSystemContract',\n type: 'address',\n },\n { internalType: 'address', name: '_owner', type: 'address' },\n { internalType: 'address', name: '_beneficiary', type: 'address' },\n { internalType: 'address', name: '_rewardRecipient', type: 'address' },\n { internalType: 'uint64', name: '_principalThreshold', type: 'uint64' },\n ],\n stateMutability: 'nonpayable',\n type: 'constructor',\n },\n { inputs: [], name: 'InvalidConsolidation_Failed', type: 'error' },\n { inputs: [], name: 'InvalidDistribution_TooLarge', type: 'error' },\n { inputs: [], name: 'InvalidRequest_NotEnoughFee', type: 'error' },\n { inputs: [], name: 'InvalidRequest_Params', type: 'error' },\n { inputs: [], name: 'InvalidRequest_SystemGetFee', type: 'error' },\n { inputs: [], name: 'InvalidWithdrawal_Failed', type: 'error' },\n { inputs: [], name: 'NewOwnerIsZeroAddress', type: 'error' },\n { inputs: [], name: 'NoHandoverRequest', type: 'error' },\n { inputs: [], name: 'Unauthorized', type: 'error' },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'newBeneficiary',\n type: 'address',\n },\n ],\n name: 'BeneficiaryUpdated',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: 'bytes',\n name: 'srcPubKey',\n type: 'bytes',\n },\n {\n indexed: false,\n internalType: 'bytes',\n name: 'targetPubKey',\n type: 'bytes',\n },\n {\n indexed: true,\n internalType: 'uint256',\n name: 'fee',\n type: 'uint256',\n },\n ],\n name: 'ConsolidationRequested',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: 'uint256',\n name: 'principalPayout',\n type: 'uint256',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'rewardPayout',\n type: 'uint256',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'pullOrPush',\n type: 'uint256',\n },\n ],\n name: 'DistributeFunds',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'pendingOwner',\n type: 'address',\n },\n ],\n name: 'OwnershipHandoverCanceled',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'pendingOwner',\n type: 'address',\n },\n ],\n name: 'OwnershipHandoverRequested',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'oldOwner',\n type: 'address',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'newOwner',\n type: 'address',\n },\n ],\n name: 'OwnershipTransferred',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: 'uint256',\n name: 'newPrincipalStakeAmount',\n type: 'uint256',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'oldPrincipalStakeAmount',\n type: 'uint256',\n },\n ],\n name: 'PrincipalStakeAmountUpdated',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'account',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'amount',\n type: 'uint256',\n },\n ],\n name: 'PullBalanceWithdrawn',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'nonOVMToken',\n type: 'address',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'recipient',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'amount',\n type: 'uint256',\n },\n ],\n name: 'RecoverNonOVMFunds',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'newRewardRecipient',\n type: 'address',\n },\n ],\n name: 'RewardRecipientUpdated',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'user',\n type: 'address',\n },\n {\n indexed: true,\n internalType: 'uint256',\n name: 'roles',\n type: 'uint256',\n },\n ],\n name: 'RolesUpdated',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'beneficiary',\n type: 'address',\n },\n {\n indexed: true,\n internalType: 'uint256',\n name: 'amount',\n type: 'uint256',\n },\n ],\n name: 'Swept',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'newBeneficiary',\n type: 'address',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'newOwner',\n type: 'address',\n },\n ],\n name: 'Transferred',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'excessFeeRecipient',\n type: 'address',\n },\n {\n indexed: true,\n internalType: 'uint256',\n name: 'excessFee',\n type: 'uint256',\n },\n ],\n name: 'UnsentExcessFee',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: 'bytes',\n name: 'pubKey',\n type: 'bytes',\n },\n {\n indexed: true,\n internalType: 'uint64',\n name: 'amount',\n type: 'uint64',\n },\n {\n indexed: true,\n internalType: 'uint256',\n name: 'fee',\n type: 'uint256',\n },\n ],\n name: 'WithdrawalRequested',\n type: 'event',\n },\n {\n inputs: [],\n name: 'CONSOLIDATION_ROLE',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'DEPOSIT_ROLE',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'RECOVER_FUNDS_ROLE',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'SET_BENEFICIARY_ROLE',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'SET_REWARD_ROLE',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'WITHDRAWAL_ROLE',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'amountOfPrincipalStake',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'cancelOwnershipHandover',\n outputs: [],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'pendingOwner', type: 'address' },\n ],\n name: 'completeOwnershipHandover',\n outputs: [],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [\n {\n components: [\n { internalType: 'bytes[]', name: 'srcPubKeys', type: 'bytes[]' },\n { internalType: 'bytes', name: 'targetPubKey', type: 'bytes' },\n ],\n internalType: 'struct IObolValidatorManager.ConsolidationRequest[]',\n name: 'requests',\n type: 'tuple[]',\n },\n {\n internalType: 'uint256',\n name: 'maxFeePerConsolidation',\n type: 'uint256',\n },\n {\n internalType: 'address',\n name: 'excessFeeRecipient',\n type: 'address',\n },\n ],\n name: 'consolidate',\n outputs: [],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'consolidationSystemContract',\n outputs: [{ internalType: 'address', name: '', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'bytes', name: 'pubkey', type: 'bytes' },\n {\n internalType: 'bytes',\n name: 'withdrawal_credentials',\n type: 'bytes',\n },\n { internalType: 'bytes', name: 'signature', type: 'bytes' },\n { internalType: 'bytes32', name: 'deposit_data_root', type: 'bytes32' },\n ],\n name: 'deposit',\n outputs: [],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'depositSystemContract',\n outputs: [{ internalType: 'address', name: '', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'distributeFunds',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'distributeFundsPull',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'fundsPendingWithdrawal',\n outputs: [{ internalType: 'uint128', name: '', type: 'uint128' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'getBeneficiary',\n outputs: [{ internalType: 'address', name: '', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'account', type: 'address' }],\n name: 'getPullBalance',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'user', type: 'address' },\n { internalType: 'uint256', name: 'roles', type: 'uint256' },\n ],\n name: 'grantRoles',\n outputs: [],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'user', type: 'address' },\n { internalType: 'uint256', name: 'roles', type: 'uint256' },\n ],\n name: 'hasAllRoles',\n outputs: [{ internalType: 'bool', name: '', type: 'bool' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'user', type: 'address' },\n { internalType: 'uint256', name: 'roles', type: 'uint256' },\n ],\n name: 'hasAnyRole',\n outputs: [{ internalType: 'bool', name: '', type: 'bool' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'owner',\n outputs: [{ internalType: 'address', name: 'result', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'pendingOwner', type: 'address' },\n ],\n name: 'ownershipHandoverExpiresAt',\n outputs: [{ internalType: 'uint256', name: 'result', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'principalRecipient',\n outputs: [{ internalType: 'address', name: '', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'principalThreshold',\n outputs: [{ internalType: 'uint64', name: '', type: 'uint64' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'nonOVMToken', type: 'address' },\n { internalType: 'address', name: 'recipient', type: 'address' },\n ],\n name: 'recoverFunds',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'renounceOwnership',\n outputs: [],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'uint256', name: 'roles', type: 'uint256' }],\n name: 'renounceRoles',\n outputs: [],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'requestOwnershipHandover',\n outputs: [],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'user', type: 'address' },\n { internalType: 'uint256', name: 'roles', type: 'uint256' },\n ],\n name: 'revokeRoles',\n outputs: [],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'rewardRecipient',\n outputs: [{ internalType: 'address', name: '', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'user', type: 'address' }],\n name: 'rolesOf',\n outputs: [{ internalType: 'uint256', name: 'roles', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'uint256', name: 'newAmount', type: 'uint256' }],\n name: 'setAmountOfPrincipalStake',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'newBeneficiary', type: 'address' },\n ],\n name: 'setBeneficiary',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n {\n internalType: 'address',\n name: 'newRewardRecipient',\n type: 'address',\n },\n ],\n name: 'setRewardRecipient',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'beneficiary', type: 'address' },\n { internalType: 'uint256', name: 'amount', type: 'uint256' },\n ],\n name: 'sweep',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: '', type: 'address' },\n { internalType: 'uint256', name: '', type: 'uint256' },\n ],\n name: 'sweepToBeneficiaryContract',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'newBeneficiary', type: 'address' },\n { internalType: 'address', name: 'newOwner', type: 'address' },\n ],\n name: 'transfer',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'newOwner', type: 'address' }],\n name: 'transferOwnership',\n outputs: [],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'version',\n outputs: [{ internalType: 'string', name: '', type: 'string' }],\n stateMutability: 'pure',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'bytes[]', name: 'pubKeys', type: 'bytes[]' },\n { internalType: 'uint64[]', name: 'amounts', type: 'uint64[]' },\n {\n internalType: 'uint256',\n name: 'maxFeePerWithdrawal',\n type: 'uint256',\n },\n {\n internalType: 'address',\n name: 'excessFeeRecipient',\n type: 'address',\n },\n ],\n name: 'withdraw',\n outputs: [],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'account', type: 'address' }],\n name: 'withdrawPullBalance',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'withdrawalSystemContract',\n outputs: [{ internalType: 'address', name: '', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n { stateMutability: 'payable', type: 'receive' },\n ],\n};\n","export const splitMainEthereumAbi = [\n { inputs: [], stateMutability: 'nonpayable', type: 'constructor' },\n { inputs: [], name: 'Create2Error', type: 'error' },\n { inputs: [], name: 'CreateError', type: 'error' },\n {\n inputs: [\n { internalType: 'address', name: 'newController', type: 'address' },\n ],\n name: 'InvalidNewController',\n type: 'error',\n },\n {\n inputs: [\n { internalType: 'uint256', name: 'accountsLength', type: 'uint256' },\n { internalType: 'uint256', name: 'allocationsLength', type: 'uint256' },\n ],\n name: 'InvalidSplit__AccountsAndAllocationsMismatch',\n type: 'error',\n },\n {\n inputs: [{ internalType: 'uint256', name: 'index', type: 'uint256' }],\n name: 'InvalidSplit__AccountsOutOfOrder',\n type: 'error',\n },\n {\n inputs: [{ internalType: 'uint256', name: 'index', type: 'uint256' }],\n name: 'InvalidSplit__AllocationMustBePositive',\n type: 'error',\n },\n {\n inputs: [\n { internalType: 'uint32', name: 'allocationsSum', type: 'uint32' },\n ],\n name: 'InvalidSplit__InvalidAllocationsSum',\n type: 'error',\n },\n {\n inputs: [\n { internalType: 'uint32', name: 'distributorFee', type: 'uint32' },\n ],\n name: 'InvalidSplit__InvalidDistributorFee',\n type: 'error',\n },\n {\n inputs: [{ internalType: 'bytes32', name: 'hash', type: 'bytes32' }],\n name: 'InvalidSplit__InvalidHash',\n type: 'error',\n },\n {\n inputs: [\n { internalType: 'uint256', name: 'accountsLength', type: 'uint256' },\n ],\n name: 'InvalidSplit__TooFewAccounts',\n type: 'error',\n },\n {\n inputs: [{ internalType: 'address', name: 'sender', type: 'address' }],\n name: 'Unauthorized',\n type: 'error',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'split',\n type: 'address',\n },\n ],\n name: 'CancelControlTransfer',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'split',\n type: 'address',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'previousController',\n type: 'address',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'newController',\n type: 'address',\n },\n ],\n name: 'ControlTransfer',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'split',\n type: 'address',\n },\n ],\n name: 'CreateSplit',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'split',\n type: 'address',\n },\n {\n indexed: true,\n internalType: 'contract ERC20',\n name: 'token',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'amount',\n type: 'uint256',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'distributorAddress',\n type: 'address',\n },\n ],\n name: 'DistributeERC20',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'split',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'amount',\n type: 'uint256',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'distributorAddress',\n type: 'address',\n },\n ],\n name: 'DistributeETH',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'split',\n type: 'address',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'newPotentialController',\n type: 'address',\n },\n ],\n name: 'InitiateControlTransfer',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'split',\n type: 'address',\n },\n ],\n name: 'UpdateSplit',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'account',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'ethAmount',\n type: 'uint256',\n },\n {\n indexed: false,\n internalType: 'contract ERC20[]',\n name: 'tokens',\n type: 'address[]',\n },\n {\n indexed: false,\n internalType: 'uint256[]',\n name: 'tokenAmounts',\n type: 'uint256[]',\n },\n ],\n name: 'Withdrawal',\n type: 'event',\n },\n {\n inputs: [],\n name: 'PERCENTAGE_SCALE',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'split', type: 'address' }],\n name: 'acceptControl',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'split', type: 'address' }],\n name: 'cancelControlTransfer',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address[]', name: 'accounts', type: 'address[]' },\n {\n internalType: 'uint32[]',\n name: 'percentAllocations',\n type: 'uint32[]',\n },\n { internalType: 'uint32', name: 'distributorFee', type: 'uint32' },\n { internalType: 'address', name: 'controller', type: 'address' },\n ],\n name: 'createSplit',\n outputs: [{ internalType: 'address', name: 'split', type: 'address' }],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'split', type: 'address' },\n { internalType: 'contract ERC20', name: 'token', type: 'address' },\n { internalType: 'address[]', name: 'accounts', type: 'address[]' },\n {\n internalType: 'uint32[]',\n name: 'percentAllocations',\n type: 'uint32[]',\n },\n { internalType: 'uint32', name: 'distributorFee', type: 'uint32' },\n { internalType: 'address', name: 'distributorAddress', type: 'address' },\n ],\n name: 'distributeERC20',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'split', type: 'address' },\n { internalType: 'address[]', name: 'accounts', type: 'address[]' },\n {\n internalType: 'uint32[]',\n name: 'percentAllocations',\n type: 'uint32[]',\n },\n { internalType: 'uint32', name: 'distributorFee', type: 'uint32' },\n { internalType: 'address', name: 'distributorAddress', type: 'address' },\n ],\n name: 'distributeETH',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'split', type: 'address' }],\n name: 'getController',\n outputs: [{ internalType: 'address', name: '', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'account', type: 'address' },\n { internalType: 'contract ERC20', name: 'token', type: 'address' },\n ],\n name: 'getERC20Balance',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'account', type: 'address' }],\n name: 'getETHBalance',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'split', type: 'address' }],\n name: 'getHash',\n outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'split', type: 'address' }],\n name: 'getNewPotentialController',\n outputs: [{ internalType: 'address', name: '', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'split', type: 'address' }],\n name: 'makeSplitImmutable',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address[]', name: 'accounts', type: 'address[]' },\n {\n internalType: 'uint32[]',\n name: 'percentAllocations',\n type: 'uint32[]',\n },\n { internalType: 'uint32', name: 'distributorFee', type: 'uint32' },\n ],\n name: 'predictImmutableSplitAddress',\n outputs: [{ internalType: 'address', name: 'split', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'split', type: 'address' },\n { internalType: 'address', name: 'newController', type: 'address' },\n ],\n name: 'transferControl',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'split', type: 'address' },\n { internalType: 'contract ERC20', name: 'token', type: 'address' },\n { internalType: 'address[]', name: 'accounts', type: 'address[]' },\n {\n internalType: 'uint32[]',\n name: 'percentAllocations',\n type: 'uint32[]',\n },\n { internalType: 'uint32', name: 'distributorFee', type: 'uint32' },\n { internalType: 'address', name: 'distributorAddress', type: 'address' },\n ],\n name: 'updateAndDistributeERC20',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'split', type: 'address' },\n { internalType: 'address[]', name: 'accounts', type: 'address[]' },\n {\n internalType: 'uint32[]',\n name: 'percentAllocations',\n type: 'uint32[]',\n },\n { internalType: 'uint32', name: 'distributorFee', type: 'uint32' },\n { internalType: 'address', name: 'distributorAddress', type: 'address' },\n ],\n name: 'updateAndDistributeETH',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'split', type: 'address' },\n { internalType: 'address[]', name: 'accounts', type: 'address[]' },\n {\n internalType: 'uint32[]',\n name: 'percentAllocations',\n type: 'uint32[]',\n },\n { internalType: 'uint32', name: 'distributorFee', type: 'uint32' },\n ],\n name: 'updateSplit',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'walletImplementation',\n outputs: [{ internalType: 'address', name: '', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'account', type: 'address' },\n { internalType: 'uint256', name: 'withdrawETH', type: 'uint256' },\n { internalType: 'contract ERC20[]', name: 'tokens', type: 'address[]' },\n ],\n name: 'withdraw',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n] as const;\n\nexport const splitMainPolygonAbi = [\n { inputs: [], stateMutability: 'nonpayable', type: 'constructor' },\n { inputs: [], name: 'Create2Error', type: 'error' },\n { inputs: [], name: 'CreateError', type: 'error' },\n {\n inputs: [\n { internalType: 'address', name: 'newController', type: 'address' },\n ],\n name: 'InvalidNewController',\n type: 'error',\n },\n {\n inputs: [\n { internalType: 'uint256', name: 'accountsLength', type: 'uint256' },\n { internalType: 'uint256', name: 'allocationsLength', type: 'uint256' },\n ],\n name: 'InvalidSplit__AccountsAndAllocationsMismatch',\n type: 'error',\n },\n {\n inputs: [{ internalType: 'uint256', name: 'index', type: 'uint256' }],\n name: 'InvalidSplit__AccountsOutOfOrder',\n type: 'error',\n },\n {\n inputs: [{ internalType: 'uint256', name: 'index', type: 'uint256' }],\n name: 'InvalidSplit__AllocationMustBePositive',\n type: 'error',\n },\n {\n inputs: [\n { internalType: 'uint32', name: 'allocationsSum', type: 'uint32' },\n ],\n name: 'InvalidSplit__InvalidAllocationsSum',\n type: 'error',\n },\n {\n inputs: [\n { internalType: 'uint32', name: 'distributorFee', type: 'uint32' },\n ],\n name: 'InvalidSplit__InvalidDistributorFee',\n type: 'error',\n },\n {\n inputs: [{ internalType: 'bytes32', name: 'hash', type: 'bytes32' }],\n name: 'InvalidSplit__InvalidHash',\n type: 'error',\n },\n {\n inputs: [\n { internalType: 'uint256', name: 'accountsLength', type: 'uint256' },\n ],\n name: 'InvalidSplit__TooFewAccounts',\n type: 'error',\n },\n {\n inputs: [{ internalType: 'address', name: 'sender', type: 'address' }],\n name: 'Unauthorized',\n type: 'error',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'split',\n type: 'address',\n },\n ],\n name: 'CancelControlTransfer',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'split',\n type: 'address',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'previousController',\n type: 'address',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'newController',\n type: 'address',\n },\n ],\n name: 'ControlTransfer',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'split',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'address[]',\n name: 'accounts',\n type: 'address[]',\n },\n {\n indexed: false,\n internalType: 'uint32[]',\n name: 'percentAllocations',\n type: 'uint32[]',\n },\n {\n indexed: false,\n internalType: 'uint32',\n name: 'distributorFee',\n type: 'uint32',\n },\n {\n indexed: false,\n internalType: 'address',\n name: 'controller',\n type: 'address',\n },\n ],\n name: 'CreateSplit',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'split',\n type: 'address',\n },\n {\n indexed: true,\n internalType: 'contract ERC20',\n name: 'token',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'amount',\n type: 'uint256',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'distributorAddress',\n type: 'address',\n },\n ],\n name: 'DistributeERC20',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'split',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'amount',\n type: 'uint256',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'distributorAddress',\n type: 'address',\n },\n ],\n name: 'DistributeETH',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'split',\n type: 'address',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'newPotentialController',\n type: 'address',\n },\n ],\n name: 'InitiateControlTransfer',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'split',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'address[]',\n name: 'accounts',\n type: 'address[]',\n },\n {\n indexed: false,\n internalType: 'uint32[]',\n name: 'percentAllocations',\n type: 'uint32[]',\n },\n {\n indexed: false,\n internalType: 'uint32',\n name: 'distributorFee',\n type: 'uint32',\n },\n ],\n name: 'UpdateSplit',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'account',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'ethAmount',\n type: 'uint256',\n },\n {\n indexed: false,\n internalType: 'contract ERC20[]',\n name: 'tokens',\n type: 'address[]',\n },\n {\n indexed: false,\n internalType: 'uint256[]',\n name: 'tokenAmounts',\n type: 'uint256[]',\n },\n ],\n name: 'Withdrawal',\n type: 'event',\n },\n {\n inputs: [],\n name: 'PERCENTAGE_SCALE',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'split', type: 'address' }],\n name: 'acceptControl',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'split', type: 'address' }],\n name: 'cancelControlTransfer',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address[]', name: 'accounts', type: 'address[]' },\n {\n internalType: 'uint32[]',\n name: 'percentAllocations',\n type: 'uint32[]',\n },\n { internalType: 'uint32', name: 'distributorFee', type: 'uint32' },\n { internalType: 'address', name: 'controller', type: 'address' },\n ],\n name: 'createSplit',\n outputs: [{ internalType: 'address', name: 'split', type: 'address' }],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'split', type: 'address' },\n { internalType: 'contract ERC20', name: 'token', type: 'address' },\n { internalType: 'address[]', name: 'accounts', type: 'address[]' },\n {\n internalType: 'uint32[]',\n name: 'percentAllocations',\n type: 'uint32[]',\n },\n { internalType: 'uint32', name: 'distributorFee', type: 'uint32' },\n { internalType: 'address', name: 'distributorAddress', type: 'address' },\n ],\n name: 'distributeERC20',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'split', type: 'address' },\n { internalType: 'address[]', name: 'accounts', type: 'address[]' },\n {\n internalType: 'uint32[]',\n name: 'percentAllocations',\n type: 'uint32[]',\n },\n { internalType: 'uint32', name: 'distributorFee', type: 'uint32' },\n { internalType: 'address', name: 'distributorAddress', type: 'address' },\n ],\n name: 'distributeETH',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'split', type: 'address' }],\n name: 'getController',\n outputs: [{ internalType: 'address', name: '', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'account', type: 'address' },\n { internalType: 'contract ERC20', name: 'token', type: 'address' },\n ],\n name: 'getERC20Balance',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'account', type: 'address' }],\n name: 'getETHBalance',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'split', type: 'address' }],\n name: 'getHash',\n outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'split', type: 'address' }],\n name: 'getNewPotentialController',\n outputs: [{ internalType: 'address', name: '', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'split', type: 'address' }],\n name: 'makeSplitImmutable',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address[]', name: 'accounts', type: 'address[]' },\n {\n internalType: 'uint32[]',\n name: 'percentAllocations',\n type: 'uint32[]',\n },\n { internalType: 'uint32', name: 'distributorFee', type: 'uint32' },\n ],\n name: 'predictImmutableSplitAddress',\n outputs: [{ internalType: 'address', name: 'split', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'split', type: 'address' },\n { internalType: 'address', name: 'newController', type: 'address' },\n ],\n name: 'transferControl',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'split', type: 'address' },\n { internalType: 'contract ERC20', name: 'token', type: 'address' },\n { internalType: 'address[]', name: 'accounts', type: 'address[]' },\n {\n internalType: 'uint32[]',\n name: 'percentAllocations',\n type: 'uint32[]',\n },\n { internalType: 'uint32', name: 'distributorFee', type: 'uint32' },\n { internalType: 'address', name: 'distributorAddress', type: 'address' },\n ],\n name: 'updateAndDistributeERC20',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'split', type: 'address' },\n { internalType: 'address[]', name: 'accounts', type: 'address[]' },\n {\n internalType: 'uint32[]',\n name: 'percentAllocations',\n type: 'uint32[]',\n },\n { internalType: 'uint32', name: 'distributorFee', type: 'uint32' },\n { internalType: 'address', name: 'distributorAddress', type: 'address' },\n ],\n name: 'updateAndDistributeETH',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'split', type: 'address' },\n { internalType: 'address[]', name: 'accounts', type: 'address[]' },\n {\n internalType: 'uint32[]',\n name: 'percentAllocations',\n type: 'uint32[]',\n },\n { internalType: 'uint32', name: 'distributorFee', type: 'uint32' },\n ],\n name: 'updateSplit',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'walletImplementation',\n outputs: [{ internalType: 'address', name: '', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'account', type: 'address' },\n { internalType: 'uint256', name: 'withdrawETH', type: 'uint256' },\n { internalType: 'contract ERC20[]', name: 'tokens', type: 'address[]' },\n ],\n name: 'withdraw',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n] as const;\n","export const splitV2FactoryAbi = [\n {\n inputs: [\n {\n internalType: 'address',\n name: '_splitsWarehouse',\n type: 'address',\n },\n ],\n stateMutability: 'nonpayable',\n type: 'constructor',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'split',\n type: 'address',\n },\n {\n components: [\n {\n internalType: 'address[]',\n name: 'recipients',\n type: 'address[]',\n },\n {\n internalType: 'uint256[]',\n name: 'allocations',\n type: 'uint256[]',\n },\n {\n internalType: 'uint256',\n name: 'totalAllocation',\n type: 'uint256',\n },\n {\n internalType: 'uint16',\n name: 'distributionIncentive',\n type: 'uint16',\n },\n ],\n indexed: false,\n internalType: 'struct SplitV2Lib.Split',\n name: 'splitParams',\n type: 'tuple',\n },\n {\n indexed: false,\n internalType: 'address',\n name: 'owner',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'address',\n name: 'creator',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'bytes32',\n name: 'salt',\n type: 'bytes32',\n },\n ],\n name: 'SplitCreated',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'split',\n type: 'address',\n },\n {\n components: [\n {\n internalType: 'address[]',\n name: 'recipients',\n type: 'address[]',\n },\n {\n internalType: 'uint256[]',\n name: 'allocations',\n type: 'uint256[]',\n },\n {\n internalType: 'uint256',\n name: 'totalAllocation',\n type: 'uint256',\n },\n {\n internalType: 'uint16',\n name: 'distributionIncentive',\n type: 'uint16',\n },\n ],\n indexed: false,\n internalType: 'struct SplitV2Lib.Split',\n name: 'splitParams',\n type: 'tuple',\n },\n {\n indexed: false,\n internalType: 'address',\n name: 'owner',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'address',\n name: 'creator',\n type: 'address',\n },\n ],\n name: 'SplitCreated',\n type: 'event',\n },\n {\n inputs: [],\n name: 'SPLIT_WALLET_IMPLEMENTATION',\n outputs: [\n {\n internalType: 'address',\n name: '',\n type: 'address',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n {\n components: [\n {\n internalType: 'address[]',\n name: 'recipients',\n type: 'address[]',\n },\n {\n internalType: 'uint256[]',\n name: 'allocations',\n type: 'uint256[]',\n },\n {\n internalType: 'uint256',\n name: 'totalAllocation',\n type: 'uint256',\n },\n {\n internalType: 'uint16',\n name: 'distributionIncentive',\n type: 'uint16',\n },\n ],\n internalType: 'struct SplitV2Lib.Split',\n name: '_splitParams',\n type: 'tuple',\n },\n {\n internalType: 'address',\n name: '_owner',\n type: 'address',\n },\n {\n internalType: 'address',\n name: '_creator',\n type: 'address',\n },\n ],\n name: 'createSplit',\n outputs: [\n {\n internalType: 'address',\n name: 'split',\n type: 'address',\n },\n ],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n {\n components: [\n {\n internalType: 'address[]',\n name: 'recipients',\n type: 'address[]',\n },\n {\n internalType: 'uint256[]',\n name: 'allocations',\n type: 'uint256[]',\n },\n {\n internalType: 'uint256',\n name: 'totalAllocation',\n type: 'uint256',\n },\n {\n internalType: 'uint16',\n name: 'distributionIncentive',\n type: 'uint16',\n },\n ],\n internalType: 'struct SplitV2Lib.Split',\n name: '_splitParams',\n type: 'tuple',\n },\n {\n internalType: 'address',\n name: '_owner',\n type: 'address',\n },\n {\n internalType: 'address',\n name: '_creator',\n type: 'address',\n },\n {\n internalType: 'bytes32',\n name: '_salt',\n type: 'bytes32',\n },\n ],\n name: 'createSplitDeterministic',\n outputs: [\n {\n internalType: 'address',\n name: 'split',\n type: 'address',\n },\n ],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n {\n components: [\n {\n internalType: 'address[]',\n name: 'recipients',\n type: 'address[]',\n },\n {\n internalType: 'uint256[]',\n name: 'allocations',\n type: 'uint256[]',\n },\n {\n internalType: 'uint256',\n name: 'totalAllocation',\n type: 'uint256',\n },\n {\n internalType: 'uint16',\n name: 'distributionIncentive',\n type: 'uint16',\n },\n ],\n internalType: 'struct SplitV2Lib.Split',\n name: '_splitParams',\n type: 'tuple',\n },\n {\n internalType: 'address',\n name: '_owner',\n type: 'address',\n },\n {\n internalType: 'bytes32',\n name: '_salt',\n type: 'bytes32',\n },\n ],\n name: 'isDeployed',\n outputs: [\n {\n internalType: 'address',\n name: 'split',\n type: 'address',\n },\n {\n internalType: 'bool',\n name: 'exists',\n type: 'bool',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n {\n internalType: 'bytes32',\n name: '_hash',\n type: 'bytes32',\n },\n ],\n name: 'nonces',\n outputs: [\n {\n internalType: 'uint256',\n name: '',\n type: 'uint256',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n {\n components: [\n {\n internalType: 'address[]',\n name: 'recipients',\n type: 'address[]',\n },\n {\n internalType: 'uint256[]',\n name: 'allocations',\n type: 'uint256[]',\n },\n {\n internalType: 'uint256',\n name: 'totalAllocation',\n type: 'uint256',\n },\n {\n internalType: 'uint16',\n name: 'distributionIncentive',\n type: 'uint16',\n },\n ],\n internalType: 'struct SplitV2Lib.Split',\n name: '_splitParams',\n type: 'tuple',\n },\n {\n internalType: 'address',\n name: '_owner',\n type: 'address',\n },\n ],\n name: 'predictDeterministicAddress',\n outputs: [\n {\n internalType: 'address',\n name: '',\n type: 'address',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n {\n components: [\n {\n internalType: 'address[]',\n name: 'recipients',\n type: 'address[]',\n },\n {\n internalType: 'uint256[]',\n name: 'allocations',\n type: 'uint256[]',\n },\n {\n internalType: 'uint256',\n name: 'totalAllocation',\n type: 'uint256',\n },\n {\n internalType: 'uint16',\n name: 'distributionIncentive',\n type: 'uint16',\n },\n ],\n internalType: 'struct SplitV2Lib.Split',\n name: '_splitParams',\n type: 'tuple',\n },\n {\n internalType: 'address',\n name: '_owner',\n type: 'address',\n },\n {\n internalType: 'bytes32',\n name: '_salt',\n type: 'bytes32',\n },\n ],\n name: 'predictDeterministicAddress',\n outputs: [\n {\n internalType: 'address',\n name: '',\n type: 'address',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n];\n","export const MultiCall3Contract = {\n abi: [\n {\n inputs: [\n {\n components: [\n { internalType: 'address', name: 'target', type: 'address' },\n { internalType: 'bytes', name: 'callData', type: 'bytes' },\n ],\n internalType: 'struct Multicall3.Call[]',\n name: 'calls',\n type: 'tuple[]',\n },\n ],\n name: 'aggregate',\n outputs: [\n { internalType: 'uint256', name: 'blockNumber', type: 'uint256' },\n { internalType: 'bytes[]', name: 'returnData', type: 'bytes[]' },\n ],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [\n {\n components: [\n { internalType: 'address', name: 'target', type: 'address' },\n { internalType: 'bool', name: 'allowFailure', type: 'bool' },\n { internalType: 'bytes', name: 'callData', type: 'bytes' },\n ],\n internalType: 'struct Multicall3.Call3[]',\n name: 'calls',\n type: 'tuple[]',\n },\n ],\n name: 'aggregate3',\n outputs: [\n {\n components: [\n { internalType: 'bool', name: 'success', type: 'bool' },\n { internalType: 'bytes', name: 'returnData', type: 'bytes' },\n ],\n internalType: 'struct Multicall3.Result[]',\n name: 'returnData',\n type: 'tuple[]',\n },\n ],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [\n {\n components: [\n { internalType: 'address', name: 'target', type: 'address' },\n { internalType: 'bool', name: 'allowFailure', type: 'bool' },\n { internalType: 'uint256', name: 'value', type: 'uint256' },\n { internalType: 'bytes', name: 'callData', type: 'bytes' },\n ],\n internalType: 'struct Multicall3.Call3Value[]',\n name: 'calls',\n type: 'tuple[]',\n },\n ],\n name: 'aggregate3Value',\n outputs: [\n {\n components: [\n { internalType: 'bool', name: 'success', type: 'bool' },\n { internalType: 'bytes', name: 'returnData', type: 'bytes' },\n ],\n internalType: 'struct Multicall3.Result[]',\n name: 'returnData',\n type: 'tuple[]',\n },\n ],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [\n {\n components: [\n { internalType: 'address', name: 'target', type: 'address' },\n { internalType: 'bytes', name: 'callData', type: 'bytes' },\n ],\n internalType: 'struct Multicall3.Call[]',\n name: 'calls',\n type: 'tuple[]',\n },\n ],\n name: 'blockAndAggregate',\n outputs: [\n { internalType: 'uint256', name: 'blockNumber', type: 'uint256' },\n { internalType: 'bytes32', name: 'blockHash', type: 'bytes32' },\n {\n components: [\n { internalType: 'bool', name: 'success', type: 'bool' },\n { internalType: 'bytes', name: 'returnData', type: 'bytes' },\n ],\n internalType: 'struct Multicall3.Result[]',\n name: 'returnData',\n type: 'tuple[]',\n },\n ],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'getBasefee',\n outputs: [{ internalType: 'uint256', name: 'basefee', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'uint256', name: 'blockNumber', type: 'uint256' },\n ],\n name: 'getBlockHash',\n outputs: [\n { internalType: 'bytes32', name: 'blockHash', type: 'bytes32' },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'getBlockNumber',\n outputs: [\n { internalType: 'uint256', name: 'blockNumber', type: 'uint256' },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'getChainId',\n outputs: [{ internalType: 'uint256', name: 'chainid', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'getCurrentBlockCoinbase',\n outputs: [{ internalType: 'address', name: 'coinbase', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'getCurrentBlockDifficulty',\n outputs: [\n { internalType: 'uint256', name: 'difficulty', type: 'uint256' },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'getCurrentBlockGasLimit',\n outputs: [{ internalType: 'uint256', name: 'gaslimit', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'getCurrentBlockTimestamp',\n outputs: [\n { internalType: 'uint256', name: 'timestamp', type: 'uint256' },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'addr', type: 'address' }],\n name: 'getEthBalance',\n outputs: [{ internalType: 'uint256', name: 'balance', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'getLastBlockHash',\n outputs: [\n { internalType: 'bytes32', name: 'blockHash', type: 'bytes32' },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'bool', name: 'requireSuccess', type: 'bool' },\n {\n components: [\n { internalType: 'address', name: 'target', type: 'address' },\n { internalType: 'bytes', name: 'callData', type: 'bytes' },\n ],\n internalType: 'struct Multicall3.Call[]',\n name: 'calls',\n type: 'tuple[]',\n },\n ],\n name: 'tryAggregate',\n outputs: [\n {\n components: [\n { internalType: 'bool', name: 'success', type: 'bool' },\n { internalType: 'bytes', name: 'returnData', type: 'bytes' },\n ],\n internalType: 'struct Multicall3.Result[]',\n name: 'returnData',\n type: 'tuple[]',\n },\n ],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'bool', name: 'requireSuccess', type: 'bool' },\n {\n components: [\n { internalType: 'address', name: 'target', type: 'address' },\n { internalType: 'bytes', name: 'callData', type: 'bytes' },\n ],\n internalType: 'struct Multicall3.Call[]',\n name: 'calls',\n type: 'tuple[]',\n },\n ],\n name: 'tryBlockAndAggregate',\n outputs: [\n { internalType: 'uint256', name: 'blockNumber', type: 'uint256' },\n { internalType: 'bytes32', name: 'blockHash', type: 'bytes32' },\n {\n components: [\n { internalType: 'bool', name: 'success', type: 'bool' },\n { internalType: 'bytes', name: 'returnData', type: 'bytes' },\n ],\n internalType: 'struct Multicall3.Result[]',\n name: 'returnData',\n type: 'tuple[]',\n },\n ],\n stateMutability: 'payable',\n type: 'function',\n },\n ],\n};\n","import {\n type ProviderType,\n type SignerType,\n type ETH_ADDRESS,\n} from '../types.js';\nimport { Contract } from 'ethers';\nimport { MerkleDistributorABI } from '../abi/MerkleDistributorWithDeadline.js';\n\nexport const claimIncentivesFromMerkleDistributor = async (incentivesData: {\n signer: SignerType;\n contractAddress: ETH_ADDRESS;\n index: number;\n operatorAddress: ETH_ADDRESS;\n amount: string;\n merkleProof: string[];\n}): Promise<{ txHash: string }> => {\n try {\n const contract = new Contract(\n incentivesData.contractAddress,\n MerkleDistributorABI.abi,\n incentivesData.signer,\n );\n\n const tx = await contract.claim(\n BigInt(incentivesData.index),\n incentivesData.operatorAddress,\n BigInt(incentivesData.amount),\n incentivesData.merkleProof,\n );\n\n const receipt = await tx.wait();\n\n return { txHash: receipt.hash };\n } catch (error: any) {\n console.log('Error claiming incentives:', error);\n throw new Error(`Failed to claim incentives: ${error.message}`);\n }\n};\n\nexport const isClaimedFromMerkleDistributor = async (\n contractAddress: ETH_ADDRESS,\n index: number,\n provider: ProviderType | undefined | null,\n): Promise<boolean> => {\n try {\n const contract = new Contract(\n contractAddress,\n MerkleDistributorABI.abi,\n provider,\n );\n\n const claimed = await contract.isClaimed(BigInt(index));\n\n return claimed;\n } catch (error: any) {\n console.log('Error checking claim status:', error);\n throw new Error(`Failed to check claim status: ${error.message}`);\n }\n};\n","export const MerkleDistributorABI = {\n abi: [\n {\n inputs: [\n { internalType: 'address', name: 'token_', type: 'address' },\n { internalType: 'bytes32', name: 'merkleRoot_', type: 'bytes32' },\n ],\n stateMutability: 'nonpayable',\n type: 'constructor',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: 'uint256',\n name: 'index',\n type: 'uint256',\n },\n {\n indexed: false,\n internalType: 'address',\n name: 'account',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'amount',\n type: 'uint256',\n },\n ],\n name: 'Claimed',\n type: 'event',\n },\n {\n inputs: [\n { internalType: 'uint256', name: 'index', type: 'uint256' },\n { internalType: 'address', name: 'account', type: 'address' },\n { internalType: 'uint256', name: 'amount', type: 'uint256' },\n { internalType: 'bytes32[]', name: 'merkleProof', type: 'bytes32[]' },\n ],\n name: 'claim',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'uint256', name: 'index', type: 'uint256' }],\n name: 'isClaimed',\n outputs: [{ internalType: 'bool', name: '', type: 'bool' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'merkleRoot',\n outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'token',\n outputs: [{ internalType: 'address', name: '', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n ] as const,\n};\n","import { isContractAvailable } from '../utils.js';\nimport {\n type ClaimableIncentives,\n type ETH_ADDRESS,\n FORK_NAMES,\n type ProviderType,\n type SignerType,\n type ClaimIncentivesResponse,\n} from '../types.js';\nimport {\n claimIncentivesFromMerkleDistributor,\n isClaimedFromMerkleDistributor,\n} from './incentiveHelpers.js';\nimport { DEFAULT_BASE_VERSION } from '../constants.js';\nimport { SignerRequiredError } from '../errors.js';\n\n/**\n * Manages Obol incentive rewards – querying eligibility and claiming from\n * on-chain Merkle Distributor contracts.\n *\n * Do not instantiate directly; access via `client.incentives`.\n *\n * @example\n * ```typescript\n * const client = new Client({ chainId: 560048 }, signer);\n *\n * // Check claimable incentives\n * const data = await client.incentives.getIncentivesByAddress(\"0xOperator...\");\n *\n * // Check if already claimed\n * const claimed = await client.incentives.isClaimed(data.contract_address, data.index);\n *\n * // Claim (sends on-chain transaction)\n * const { txHash } = await client.incentives.claimIncentives(\"0xOperator...\");\n * ```\n */\nexport class Incentives {\n private readonly signer: SignerType | undefined;\n public readonly chainId: number;\n private readonly request: (\n endpoint: string,\n options?: RequestInit,\n ) => Promise<any>;\n\n public readonly provider: ProviderType | undefined | null;\n\n constructor(\n signer: SignerType | undefined,\n chainId: number,\n request: (endpoint: string, options?: RequestInit) => Promise<any>,\n provider: ProviderType | undefined | null,\n ) {\n this.signer = signer;\n this.chainId = chainId;\n this.request = request;\n this.provider = provider;\n }\n\n /**\n * Claims Obol incentives from a Merkle Distributor contract for the given address.\n *\n * Automatically fetches incentive data, checks if already claimed, and submits\n * the on-chain claim transaction. Returns `{ txHash: null }` if incentives were\n * already claimed (idempotent).\n *\n * @param address - The operator's Ethereum address to claim incentives for.\n * @returns The transaction hash, or `{ txHash: null }` if already claimed.\n * @throws {SignerRequiredError} If no signer was provided.\n * @throws {Error} If no incentives are found for the address.\n *\n * @example\n * ```typescript\n * const { txHash } = await client.incentives.claimIncentives(\"0xOperator...\");\n * if (txHash) {\n * console.log(\"Claimed:\", txHash);\n * } else {\n * console.log(\"Already claimed\");\n * }\n * ```\n */\n async claimIncentives(address: string): Promise<ClaimIncentivesResponse> {\n if (!this.signer) {\n throw new SignerRequiredError('claimIncentives');\n }\n\n try {\n const incentivesData = await this.getIncentivesByAddress(address);\n\n if (!incentivesData?.contract_address) {\n throw new Error(`No incentives found for address ${address}`);\n }\n\n const isContractDeployed = await isContractAvailable(\n incentivesData.contract_address,\n this.provider as ProviderType,\n );\n\n if (!isContractDeployed) {\n throw new Error(\n `Merkle Distributor contract is not available at address ${incentivesData.contract_address}`,\n );\n }\n\n const claimed = await this.isClaimed(\n incentivesData.contract_address,\n incentivesData.index,\n );\n\n if (claimed) {\n return { txHash: null };\n }\n\n const { txHash } = await claimIncentivesFromMerkleDistributor({\n signer: this.signer,\n contractAddress: incentivesData.contract_address,\n index: incentivesData.index,\n operatorAddress: incentivesData.operator_address,\n amount: incentivesData.amount,\n merkleProof: incentivesData.merkle_proof,\n });\n\n return { txHash };\n } catch (error: any) {\n console.log('Error claiming incentives:', error);\n throw new Error(`Failed to claim incentives: ${error.message}`);\n }\n }\n\n /**\n * Checks whether incentives have already been claimed for a given operator index.\n *\n * Read-only on-chain call – no transaction sent.\n *\n * @param contractAddress - Address of the Merkle Distributor contract.\n * @param index - The operator's index in the Merkle tree (from {@link Incentives.getIncentivesByAddress}).\n * @returns `true` if the incentives at that index have already been claimed.\n *\n * @example\n * ```typescript\n * const claimed = await client.incentives.isClaimed(\n * \"0xMerkleDistributor...\",\n * 42,\n * );\n * ```\n */\n async isClaimed(\n contractAddress: ETH_ADDRESS,\n index: number,\n ): Promise<boolean> {\n return await isClaimedFromMerkleDistributor(\n contractAddress,\n index,\n this.provider,\n );\n }\n\n /**\n * Fetches claimable incentive data for an operator address from the Obol API.\n *\n * The returned data includes the Merkle proof, amount, and contract address\n * needed to claim on-chain. This is a read-only API call.\n *\n * @param address - The operator's Ethereum address.\n * @returns Claimable incentive data including amount, Merkle proof, and contract address.\n * @throws {Error} If no incentives are found for the given address (404).\n *\n * @example\n * ```typescript\n * const incentives = await client.incentives.getIncentivesByAddress(\"0xOperator...\");\n * console.log(incentives.amount, incentives.contract_address);\n * ```\n */\n async getIncentivesByAddress(address: string): Promise<ClaimableIncentives> {\n const network = FORK_NAMES[this.chainId];\n const incentives: ClaimableIncentives = await this.request(\n `/${DEFAULT_BASE_VERSION}/address/incentives/${network}/${address}`,\n {\n method: 'GET',\n },\n );\n return incentives;\n }\n}\n","import { ENR } from '@chainsafe/enr';\nimport * as elliptic from 'elliptic';\nimport { blsVerify, blsAggregateSignatures } from '../blsUtils.js';\nimport {\n ByteVectorType,\n ContainerType,\n fromHexString,\n ListCompositeType,\n UintNumberType,\n} from '@chainsafe/ssz';\nimport type {\n ProviderType,\n ExitClusterConfig,\n ExitValidationPayload,\n ExitValidationBlob,\n ExitValidationMessage,\n SignedExitValidationMessage,\n ExistingExitValidationBlobData,\n FullExitBlob,\n} from '../types.js';\nimport { getCapellaFork, getGenesisValidatorsRoot } from './ethUtils.js';\nimport { computeDomain, signingRoot } from './verificationHelpers.js';\n\n// Constants from obol-api/src/verification/exit.ts (assuming these might be needed or were in the original context)\nconst DOMAIN_VOLUNTARY_EXIT = '0x04000000';\n\n// SSZ Type Definitions (adapted from obol-api/src/verification/exit.ts)\nconst SSZExitMessageType = new ContainerType({\n epoch: new UintNumberType(8),\n validator_index: new UintNumberType(8),\n});\n\nconst SSZPartialExitsPayloadType = new ContainerType({\n partial_exits: new ListCompositeType(\n new ContainerType({\n public_key: new ByteVectorType(48),\n signed_exit_message: new ContainerType({\n message: new ContainerType({\n epoch: new UintNumberType(8),\n validator_index: new UintNumberType(8),\n }),\n signature: new ByteVectorType(96),\n }),\n }),\n 65536,\n ),\n share_idx: new UintNumberType(8),\n});\n\n/**\n * Validates and verifies voluntary exit signatures for Obol distributed validators.\n *\n * Do not instantiate directly; access via `client.exit`.\n *\n * Available methods:\n * - {@link Exit.verifyPartialExitSignature} – verify a BLS partial exit signature\n * - {@link Exit.verifyExitPayloadSignature} – verify an ECDSA exit payload signature\n * - {@link Exit.validateExitBlobs} – validate exit blobs against cluster config\n * - {@link Exit.recombineExitBlobs} – aggregate partial signatures into a full exit blob\n *\n * All methods are read-only (no on-chain transactions). No signer is required.\n *\n * @example\n * ```typescript\n * const client = new Client({ chainId: 1 }, signer, provider);\n *\n * // Verify a partial exit signature\n * const isValid = await client.exit.verifyPartialExitSignature(\n * publicShareKey,\n * signedExitMessage,\n * forkVersion,\n * genesisValidatorsRoot,\n * );\n *\n * // Validate exit blobs for a cluster\n * const validBlobs = await client.exit.validateExitBlobs(\n * clusterConfig,\n * exitsPayload,\n * beaconNodeApiUrl,\n * existingBlobData,\n * );\n * ```\n */\nexport class Exit {\n public readonly chainId: number;\n public readonly provider: ProviderType | undefined | null;\n\n /**\n * Creates a new Exit instance for validator exit operations.\n *\n * @param chainId - The Ethereum chain ID (e.g., 1 for mainnet, 5 for goerli)\n * @param provider - Optional Ethereum provider for blockchain interactions\n *\n * @example\n * ```typescript\n * const client = new Client({ chainId: 1 }, signer, provider);\n * const exit = client.exit; // Access via client, do not instantiate directly\n * ```\n */\n constructor(chainId: number, provider: ProviderType | undefined | null) {\n this.chainId = chainId;\n this.provider = provider;\n }\n\n /**\n * Safely parse a string integer to number, using BigInt to avoid precision loss\n * for large values beyond JavaScript's safe integer limit (2^53 - 1).\n * Throws an error if the value exceeds the safe range for a 64-bit unsigned integer.\n */\n private static safeParseInt(value: string): number {\n const bigIntValue = BigInt(value);\n\n // Check if value is within the range of a 64-bit unsigned integer\n const MAX_UINT64 = BigInt('0xFFFFFFFFFFFFFFFF');\n if (bigIntValue < 0 || bigIntValue > MAX_UINT64) {\n throw new Error(\n `Value ${value} is outside the valid range for a 64-bit unsigned integer`,\n );\n }\n\n // Convert to number - SSZ library should handle values even if they exceed JS safe integer limits\n return Number(bigIntValue);\n }\n\n private static computePartialExitMessageRoot(\n msg: ExitValidationMessage,\n ): Buffer {\n const sszValue = SSZExitMessageType.defaultValue();\n\n sszValue.epoch = Exit.safeParseInt(msg.epoch);\n sszValue.validator_index = Exit.safeParseInt(msg.validator_index);\n return Buffer.from(SSZExitMessageType.hashTreeRoot(sszValue).buffer);\n }\n\n private static computeExitPayloadRoot(exits: ExitValidationPayload): string {\n // Remove sorting since SSZ list ordering guarantees order\n // This eliminates the O(n log n) sort and improves performance\n const sszValue = SSZPartialExitsPayloadType.defaultValue();\n sszValue.partial_exits = exits.partial_exits.map(pe => ({\n public_key: fromHexString(pe.public_key),\n signed_exit_message: {\n message: {\n epoch: Exit.safeParseInt(pe.signed_exit_message.message.epoch),\n validator_index: Exit.safeParseInt(\n pe.signed_exit_message.message.validator_index,\n ),\n },\n signature: fromHexString(pe.signed_exit_message.signature),\n },\n }));\n sszValue.share_idx = exits.share_idx;\n\n return Buffer.from(\n SSZPartialExitsPayloadType.hashTreeRoot(sszValue).buffer,\n ).toString('hex');\n }\n\n /**\n * Verifies a partial exit signature from a distributed validator operator.\n *\n * This method validates that a partial exit signature was correctly signed by the\n * operator's share of the distributed validator's private key. It performs BLS\n * signature verification using the appropriate fork version and genesis validators root.\n *\n * @param publicShareKey - The operator's public share key (BLS public key, hex string with or without 0x prefix)\n * @param signedExitMessage - The signed exit message containing the exit details and signature\n * @param forkVersion - The Ethereum fork version (e.g., \"0x00000000\" for mainnet)\n * @param genesisValidatorsRootString - The genesis validators root for the network (hex string)\n *\n * @returns Promise resolving to true if the signature is valid, false otherwise\n *\n * @throws {Error} When unable to determine the Capella fork version for the given network\n * @throws {Error} When BLS library initialization or verification fails\n *\n * @example\n * ```typescript\n * const isValid = await exit.verifyPartialExitSignature(\n * \"0x1234...abcd\", // operator's public share key\n * {\n * message: { epoch: \"12345\", validator_index: \"67890\" },\n * signature: \"0xabcd...1234\"\n * },\n * \"0x00000000\", // mainnet fork version\n * \"0x4b363db94e286120d76eb905340fdd4e54bfe9f06bf33ff6cf5ad27f511bfe95\"\n * );\n * ```\n */\n async verifyPartialExitSignature(\n publicShareKey: string,\n signedExitMessage: SignedExitValidationMessage,\n forkVersion: string,\n genesisValidatorsRootString: string,\n ): Promise<boolean> {\n const capellaForkVersionString = await getCapellaFork(forkVersion);\n if (!capellaForkVersionString) {\n throw new Error(\n `Could not determine Capella fork version for base fork: ${forkVersion}`,\n );\n }\n\n const partialExitMessageBuffer = Exit.computePartialExitMessageRoot(\n signedExitMessage.message,\n );\n\n const exitDomain = computeDomain(\n fromHexString(DOMAIN_VOLUNTARY_EXIT),\n capellaForkVersionString,\n fromHexString(genesisValidatorsRootString),\n );\n\n const messageSigningRoot = signingRoot(\n exitDomain,\n partialExitMessageBuffer,\n );\n\n return blsVerify(\n fromHexString(publicShareKey),\n messageSigningRoot,\n fromHexString(signedExitMessage.signature),\n );\n }\n\n /**\n * Verifies the exit payload signature using the operator's ENR.\n *\n * This method validates that an exit payload was signed by the correct operator\n * using ECDSA signature verification. The signature is verified against the\n * operator's public key extracted from their ENR (Ethereum Node Record).\n *\n * @param enrString - The operator's ENR string containing their identity and public key\n * @param exitsPayload - The exit validation payload containing partial exits and operator signature\n *\n * @returns Promise resolving to true if the payload signature is valid, false otherwise\n *\n * @throws {Error} When the ENR string is invalid or cannot be decoded\n * @throws {Error} When the signature format is invalid (must be 130 hex characters)\n * @throws {Error} When signature verification encounters an error\n *\n * @example\n * ```typescript\n * const isValid = await exit.verifyExitPayloadSignature(\n * \"enr:-LK4QFo_n0dUm4PKejSOXf8JkSWq5EINV0XhG1zY00d...\", // operator ENR\n * {\n * partial_exits: [exitBlob1, exitBlob2],\n * share_idx: 1,\n * signature: \"0x1234...abcd\" // ECDSA signature (130 hex chars)\n * }\n * );\n * ```\n */\n async verifyExitPayloadSignature(\n enrString: string,\n exitsPayload: ExitValidationPayload,\n ): Promise<boolean> {\n const partialExitsDtoHashRoot = Exit.computeExitPayloadRoot(exitsPayload);\n const ec = new elliptic.ec('secp256k1');\n\n let pubKeyHex;\n try {\n pubKeyHex = ENR.decodeTxt(enrString).publicKey.toString();\n } catch (e: any) {\n throw new Error(\n `Invalid ENR string: ${enrString}. Error: ${e.message ?? String(e)}`,\n );\n }\n\n const sigHex = exitsPayload.signature.startsWith('0x')\n ? exitsPayload.signature.substring(2)\n : exitsPayload.signature;\n\n if (sigHex.length !== 130) {\n throw new Error(\n `Invalid signature length. Expected 130 hex chars (r + s), got ${sigHex.length}`,\n );\n }\n\n const r = sigHex.slice(0, 64);\n const s = sigHex.slice(64, 128);\n\n const enrSignature = { r, s };\n\n try {\n return ec\n .keyFromPublic(pubKeyHex, 'hex')\n .verify(\n partialExitsDtoHashRoot,\n enrSignature as elliptic.ec.SignatureOptions,\n );\n } catch (e: any) {\n throw new Error(\n `Signature verification failed: ${e.message ?? String(e)}`,\n );\n }\n }\n\n private async validateOperatorAndPayload(\n clusterConfig: ExitClusterConfig,\n exitsPayload: ExitValidationPayload,\n ): Promise<string> {\n const operatorIndex = exitsPayload.share_idx - 1;\n if (\n operatorIndex < 0 ||\n operatorIndex >= clusterConfig.definition.operators.length\n ) {\n throw new Error(\n `Invalid share_idx ${exitsPayload.share_idx} for ${clusterConfig.definition.operators.length} operators.`,\n );\n }\n const operatorEnr = clusterConfig.definition.operators[operatorIndex].enr;\n\n const isPayloadSignatureValid = await this.verifyExitPayloadSignature(\n operatorEnr,\n exitsPayload,\n );\n if (!isPayloadSignatureValid) {\n throw new Error('Incorrect payload signature for partial exits.');\n }\n\n return operatorEnr;\n }\n\n private async getNetworkParameters(\n forkVersion: string,\n beaconNodeApiUrl: string,\n ): Promise<{ genesisValidatorsRoot: string; capellaForkVersion: string }> {\n const genesisValidatorsRootString =\n await getGenesisValidatorsRoot(beaconNodeApiUrl);\n if (!genesisValidatorsRootString) {\n throw new Error('Could not retrieve genesis validators root.');\n }\n\n const capellaForkVersionString = await getCapellaFork(forkVersion);\n if (!capellaForkVersionString) {\n throw new Error(\n `Unsupported network: Could not determine Capella fork for ${forkVersion}`,\n );\n }\n\n return {\n genesisValidatorsRoot: genesisValidatorsRootString,\n capellaForkVersion: capellaForkVersionString,\n };\n }\n\n private findValidatorInCluster(\n clusterConfig: ExitClusterConfig,\n publicKey: string,\n operatorIndex: number,\n ): { validator: any; publicShare: string } {\n const validatorInCluster = clusterConfig.distributed_validators.find(\n dv =>\n (dv.distributed_public_key.startsWith('0x')\n ? dv.distributed_public_key\n : '0x' + dv.distributed_public_key\n ).toLowerCase() ===\n (publicKey.startsWith('0x')\n ? publicKey\n : '0x' + publicKey\n ).toLowerCase(),\n );\n\n if (!validatorInCluster) {\n throw new Error(\n `Public key ${publicKey} not found in the cluster's distributed validators.`,\n );\n }\n\n const publicShareForOperator =\n validatorInCluster.public_shares[operatorIndex];\n if (!publicShareForOperator) {\n throw new Error(\n `Public share for operator index ${operatorIndex} not found for validator ${publicKey}`,\n );\n }\n\n return {\n validator: validatorInCluster,\n publicShare: publicShareForOperator,\n };\n }\n\n private async validateExistingBlobData(\n exitBlob: ExitValidationBlob,\n existingBlob: ExistingExitValidationBlobData | null,\n operatorIndex: number,\n ): Promise<boolean> {\n if (!existingBlob) {\n return false;\n }\n\n // Check if existing blob data is for this public key\n const normalizeKey = (key: string): string =>\n (key.startsWith('0x') ? key : '0x' + key).toLowerCase();\n\n if (\n normalizeKey(existingBlob.public_key) !==\n normalizeKey(exitBlob.public_key)\n ) {\n return false; // Existing blob data is for a different validator\n }\n\n if (\n existingBlob.validator_index !==\n exitBlob.signed_exit_message.message.validator_index\n ) {\n throw new Error(\n `Validator index mismatch for already processed exit for public key ${exitBlob.public_key}. Expected ${existingBlob.validator_index}, got ${exitBlob.signed_exit_message.message.validator_index}.`,\n );\n }\n\n const currentEpoch = Exit.safeParseInt(\n exitBlob.signed_exit_message.message.epoch,\n );\n const existingEpoch = Exit.safeParseInt(existingBlob.epoch);\n\n if (currentEpoch < existingEpoch) {\n throw new Error(\n `New exit epoch ${currentEpoch} is not greater than existing exit epoch ${existingEpoch} for validator ${exitBlob.public_key}.`,\n );\n } else if (currentEpoch === existingEpoch) {\n const operatorShareIndexString = String(operatorIndex);\n if (\n existingBlob.shares_exit_data?.[0]?.[operatorShareIndexString]\n ?.partial_exit_signature &&\n existingBlob.shares_exit_data[0][operatorShareIndexString]\n .partial_exit_signature !== exitBlob.signed_exit_message.signature\n ) {\n throw new Error(\n `Signature mismatch for validator ${exitBlob.public_key}, operator index ${operatorIndex} at epoch ${currentEpoch}. Received different signature than existing.`,\n );\n }\n return true; // Already processed\n }\n\n return false;\n }\n\n private async processExitBlob(\n exitBlob: ExitValidationBlob,\n clusterConfig: ExitClusterConfig,\n operatorIndex: number,\n genesisValidatorsRoot: string,\n existingBlobData: ExistingExitValidationBlobData | null,\n ): Promise<ExitValidationBlob | null> {\n const { publicShare } = this.findValidatorInCluster(\n clusterConfig,\n exitBlob.public_key,\n operatorIndex,\n );\n\n const alreadyProcessed = await this.validateExistingBlobData(\n exitBlob,\n existingBlobData,\n operatorIndex,\n );\n\n if (alreadyProcessed) {\n return null;\n }\n\n const isPartialSignatureValid = await this.verifyPartialExitSignature(\n publicShare,\n exitBlob.signed_exit_message,\n clusterConfig.definition.fork_version,\n genesisValidatorsRoot,\n );\n\n if (!isPartialSignatureValid) {\n throw new Error(\n `Invalid partial exit signature for validator ${exitBlob.public_key} by operator index ${operatorIndex}.`,\n );\n }\n\n return exitBlob;\n }\n\n /**\n * Validates exit blobs against cluster configuration and existing data.\n *\n * This method performs comprehensive validation of exit blobs including:\n * - Operator authorization and payload signature verification\n * - Network parameter validation (genesis root, fork version)\n * - Public key validation against cluster configuration\n * - Partial signature verification for each exit blob\n * - Duplicate detection and epoch progression validation\n * - Signature consistency checks for existing exits\n *\n * @param clusterConfig - The cluster configuration containing operators and distributed validators\n * @param exitsPayload - The exit validation payload with partial exits and operator info\n * @param beaconNodeApiUrl - The beacon node API URL for network parameter retrieval\n * @param existingBlobData - Existing exit blob data for duplicate detection, or null if none exists\n *\n * @returns Promise resolving to an array of validated, non-duplicate exit blobs\n *\n * @throws {Error} When share_idx is invalid or out of bounds for the cluster operators\n * @throws {Error} When payload signature verification fails\n * @throws {Error} When network parameters cannot be retrieved or are invalid\n * @throws {Error} When a public key is not found in the cluster's distributed validators\n * @throws {Error} When a partial exit signature is invalid\n * @throws {Error} When exit epoch validation fails (new epoch not greater than existing)\n * @throws {Error} When validator index mismatches with existing data\n * @throws {Error} When signature mismatches for the same epoch and operator\n *\n * @example\n * ```typescript\n * const validExitBlobs = await exit.validateExitBlobs(\n * {\n * definition: {\n * operators: [{ enr: \"enr:-LK4Q...\" }],\n * fork_version: \"0x00000000\",\n * threshold: 1\n * },\n * distributed_validators: [{\n * distributed_public_key: \"0x1234...abcd\",\n * public_shares: [\"0x5678...efgh\"]\n * }]\n * },\n * {\n * partial_exits: [exitBlob],\n * share_idx: 1,\n * signature: \"0x1234...abcd\"\n * },\n * \"http://localhost:5052\",\n * existingBlobData // or null for new exits\n * );\n * ```\n */\n async validateExitBlobs(\n clusterConfig: ExitClusterConfig,\n exitsPayload: ExitValidationPayload,\n beaconNodeApiUrl: string,\n existingBlobData: ExistingExitValidationBlobData | null,\n ): Promise<ExitValidationBlob[]> {\n await this.validateOperatorAndPayload(clusterConfig, exitsPayload);\n\n const { genesisValidatorsRoot } = await this.getNetworkParameters(\n clusterConfig.definition.fork_version,\n beaconNodeApiUrl,\n );\n\n const operatorIndex = exitsPayload.share_idx - 1;\n const validNonDuplicateBlobs: ExitValidationBlob[] = [];\n\n for (const currentExitBlob of exitsPayload.partial_exits) {\n const processedBlob = await this.processExitBlob(\n currentExitBlob,\n clusterConfig,\n operatorIndex,\n genesisValidatorsRoot,\n existingBlobData,\n );\n\n if (processedBlob) {\n validNonDuplicateBlobs.push(processedBlob);\n }\n }\n\n return validNonDuplicateBlobs;\n }\n\n /**\n * Recombines exit blobs into a single exit blob.\n *\n * This method aggregates partial exit signatures from multiple operators into a single exit blob.\n * It ensures that the signatures are properly ordered and aggregated according to the operator indices.\n *\n * @param exitBlob - The existing exit blob data containing partial exit signatures\n *\n * @returns Promise resolving to a single exit blob with aggregated signatures\n *\n * @throws {Error} When no valid signatures are found for aggregation\n * @throws {Error} When signature length is invalid\n * @throws {Error} When signature parsing fails\n *\n * @example\n * ```typescript\n * const aggregatedExitBlob = await exit.recombineExitBlobs(existingBlobData);\n * ```\n */\n async recombineExitBlobs(\n exitBlob: ExistingExitValidationBlobData,\n ): Promise<FullExitBlob> {\n // Map to store signatures by their share index (matching Go's map[int]tbls.Signature)\n const signaturesByIndex = new Map<number, Uint8Array>();\n\n // Extract signatures from shares_exit_data (equivalent to er.Signatures in Go)\n if (!exitBlob.shares_exit_data || exitBlob.shares_exit_data.length === 0) {\n throw new Error('No shares exit data available for aggregation');\n }\n const signaturesMap = exitBlob.shares_exit_data[0] || {};\n for (const [sigIdxStr, sigData] of Object.entries(signaturesMap)) {\n const sigStr = sigData.partial_exit_signature;\n\n if (!sigStr || sigStr.length === 0) {\n // ignore, the associated share index didn't push a partial signature yet\n continue;\n }\n\n if (sigStr.length < 2) {\n throw new Error(`Signature string has invalid size: ${sigStr.length}`);\n }\n\n // Remove 0x prefix and ensure it's 96 bytes (192 hex chars)\n const cleanSigStr = sigStr.startsWith('0x')\n ? sigStr.substring(2)\n : sigStr;\n if (cleanSigStr.length !== 192) {\n throw new Error(\n `Invalid signature length. Expected 192 hex chars (96 bytes), got ${cleanSigStr.length}`,\n );\n }\n\n try {\n const sigBytes = fromHexString(cleanSigStr);\n // Convert string index to number and add 1 (matching Go's sigIdx+1)\n const sigIdx = parseInt(sigIdxStr, 10);\n signaturesByIndex.set(sigIdx + 1, sigBytes);\n } catch (err) {\n throw new Error(`Invalid partial signature: ${String(err)}`);\n }\n }\n\n if (signaturesByIndex.size === 0) {\n throw new Error('No valid signatures found for aggregation');\n }\n\n // Sort by index and extract signatures in correct order\n const sortedIndices = Array.from(signaturesByIndex.keys()).sort(\n (a, b) => a - b,\n );\n const rawSignatures = sortedIndices.map(idx => {\n const signature = signaturesByIndex.get(idx);\n if (signature === undefined) {\n throw new Error(`Missing signature for index ${idx}`);\n }\n return signature;\n });\n\n // Aggregate signatures (equivalent to tbls.ThresholdAggregate in Go)\n const fullSig = blsAggregateSignatures(rawSignatures);\n\n return {\n public_key: exitBlob.public_key,\n signed_exit_message: {\n message: {\n epoch: exitBlob.epoch,\n validator_index: exitBlob.validator_index,\n },\n signature: '0x' + Buffer.from(fullSig).toString('hex'),\n },\n };\n }\n}\n","import { CAPELLA_FORK_MAPPING } from '../constants.js';\n\n/**\n * Retrieves the Capella fork version for a given base fork version.\n * @param fork_version - The base fork version string (e.g., '0x00000000' for mainnet).\n * @returns A promise that resolves to the Capella fork version string, or null if not found.\n */\nexport async function getCapellaFork(\n fork_version: string,\n): Promise<string | null> {\n // Ensure the CAPELLA_FORK_MAPPING uses the base fork_version as key\n if (CAPELLA_FORK_MAPPING[fork_version]) {\n return CAPELLA_FORK_MAPPING[fork_version];\n }\n return null;\n}\n\n/**\n * Fetches the genesis validators root from a beacon node.\n * @param beaconNodeApiUrl - The base URL of the beacon node API (e.g., http://localhost:5052).\n * @returns A promise that resolves to the genesis_validators_root string, or null on error.\n * @throws Will throw an error if the network corresponding to the fork_version is not supported or if the HTTP request fails.\n */\nexport async function getGenesisValidatorsRoot(\n beaconNodeApiUrl: string,\n): Promise<string | null> {\n const genesisEndpoint = `${beaconNodeApiUrl}/eth/v1/beacon/genesis`;\n\n try {\n const response = await fetch(genesisEndpoint, {\n method: 'GET',\n });\n\n const json = await response.json();\n\n if (json.data?.genesis_validators_root) {\n return json.data.genesis_validators_root;\n }\n console.error('Invalid response structure from genesis endpoint', json);\n return null;\n } catch (e: any) {\n console.error(\n `Error fetching genesis validators root from ${genesisEndpoint}:`,\n e,\n );\n const errorMessage = e instanceof Error ? e.message : String(e);\n throw new Error(`Failed to fetch genesis validators root: ${errorMessage}`);\n }\n}\n","import { ContainerType, ByteVectorType, fromHexString } from '@chainsafe/ssz';\n\n// From obol-api/src/verification/common.ts\nexport const GENESIS_VALIDATOR_ROOT_HEX_STRING =\n '0x0000000000000000000000000000000000000000000000000000000000000000'; // Added 0x prefix\n\nconst ForkDataType = new ContainerType({\n currentVersion: new ByteVectorType(4),\n genesisValidatorsRoot: new ByteVectorType(32),\n});\n\nconst SigningRootType = new ContainerType({\n objectRoot: new ByteVectorType(32),\n domain: new ByteVectorType(32),\n});\n\n/**\n * https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#compute_fork_data_root\n * @param currentVersion - Uint8Array of the current fork version.\n * @param genesisValidatorsRoot - Uint8Array of the genesis validators root.\n * @returns Uint8Array - The 32-byte fork data root.\n */\nfunction computeForkDataRoot(\n currentVersion: Uint8Array,\n genesisValidatorsRoot: Uint8Array,\n): Uint8Array {\n const forkDataVal = ForkDataType.defaultValue();\n forkDataVal.currentVersion = currentVersion;\n forkDataVal.genesisValidatorsRoot = genesisValidatorsRoot;\n return Buffer.from(ForkDataType.hashTreeRoot(forkDataVal).buffer);\n}\n\n/**\n * Computes the domain for a given domain type, fork version, and genesis state.\n * https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#compute_domain\n * @param domainType - Uint8Array representing the domain type (e.g., DOMAIN_VOLUNTARY_EXIT).\n * @param forkVersionString - Hex string of the fork version (e.g., Capella fork version).\n * @param genesisValidatorsRootOverride - Optional Uint8Array to override the default genesis validators root.\n * @returns Uint8Array - The 32-byte domain.\n */\nexport function computeDomain(\n domainType: Uint8Array, // Should be 4 bytes\n forkVersionString: string, // Hex string, e.g., '0x03000000'\n genesisValidatorsRootOverride?: Uint8Array, // 32 bytes\n): Uint8Array {\n const forkVersionBytes = fromHexString(\n forkVersionString.substring(2, forkVersionString.length),\n );\n\n if (forkVersionBytes.length !== 4) {\n throw new Error('Fork version must be 4 bytes');\n }\n if (domainType.length !== 4) {\n throw new Error('Domain type must be 4 bytes');\n }\n\n const actualGenesisValidatorsRoot =\n genesisValidatorsRootOverride ??\n fromHexString(GENESIS_VALIDATOR_ROOT_HEX_STRING.substring(2));\n\n if (actualGenesisValidatorsRoot.length !== 32) {\n throw new Error('genesisValidatorsRoot must be 32 bytes');\n }\n const forkDataRoot = computeForkDataRoot(\n forkVersionBytes,\n actualGenesisValidatorsRoot,\n );\n const domain = new Uint8Array(32);\n domain.set(domainType);\n domain.set(forkDataRoot.subarray(0, 28), 4); // Set the remaining 28 bytes from forkDataRoot\n return domain;\n}\n\n/**\n * Computes the signing root for an SSZ object and a domain.\n * https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#compute_signing_root\n * @param sszObjectRoot - Uint8Array of the hash tree root of the SSZ object.\n * @param domain - Uint8Array of the domain.\n * @returns Uint8Array - The 32-byte signing root.\n */\nfunction computeSigningRoot(\n sszObjectRoot: Uint8Array, // Should be 32 bytes\n domain: Uint8Array, // Should be 32 bytes\n): Uint8Array {\n if (sszObjectRoot.length !== 32) {\n throw new Error('SSZ object root must be 32 bytes');\n }\n if (domain.length !== 32) {\n throw new Error('Domain must be 32 bytes');\n }\n\n const val = SigningRootType.defaultValue();\n val.objectRoot = sszObjectRoot;\n val.domain = domain;\n return Buffer.from(SigningRootType.hashTreeRoot(val).buffer);\n}\n\n/**\n * Convenience wrapper for computeSigningRoot.\n * @param domain - Uint8Array of the domain.\n * @param messageBuffer - Buffer of the message (SSZ object root).\n * @returns Uint8Array - The signing root.\n */\nexport function signingRoot(\n domain: Uint8Array,\n messageBuffer: Buffer, // Assumed to be the 32-byte sszObjectRoot\n): Uint8Array {\n const sszObjectRootU8 = Uint8Array.from(messageBuffer);\n return computeSigningRoot(sszObjectRootU8, domain);\n}\n","import {\n formatRecipientsForSplitV2,\n predictSplitV2Address,\n isSplitV2Deployed,\n deployOVMContract,\n deployOVMAndSplitV2,\n requestWithdrawalFromOVM,\n depositOVM,\n} from './splitHelpers.js';\nimport {\n CHAIN_CONFIGURATION,\n SPLITS_V2_SALT,\n DEFAULT_RETROACTIVE_FUNDING_REWARDS_ONLY_SPLIT,\n isChainSupportedForSplitters,\n} from '../constants.js';\nimport { SignerRequiredError, UnsupportedChainError } from '../errors.js';\nimport {\n ovmRewardsSplitPayloadSchema,\n ovmTotalSplitPayloadSchema,\n ovmRequestWithdrawalPayloadSchema,\n ovmDepositPayloadSchema,\n} from '../schema.js';\nimport { validatePayload } from '../ajv.js';\nimport { isContractAvailable } from '../utils.js';\nimport {\n type ClusterValidator,\n type ProviderType,\n type SignerType,\n type OVMRewardsSplitPayload,\n type OVMTotalSplitPayload,\n type OVMRequestWithdrawalPayload,\n type OVMDepositPayload,\n} from '../types.js';\n\n/**\n * Deploys and manages Obol Validator Manager (OVM) and SplitV2 contracts\n * for automated reward and principal splitting among cluster participants.\n *\n * Do not instantiate directly; access via `client.splits`.\n *\n * Available methods:\n * - {@link ObolSplits.createValidatorManagerAndRewardsSplit} – rewards-only split (single principal recipient)\n * - {@link ObolSplits.createValidatorManagerAndTotalSplit} – total split (principal also split)\n * - {@link ObolSplits.requestWithdrawal} – request withdrawal from an OVM contract\n * - {@link ObolSplits.deposit} – deposit to an OVM contract\n *\n * All write methods send on-chain transactions and require a signer with ETH for gas.\n *\n * @example\n * ```typescript\n * const client = new Client({ chainId: 560048 }, signer);\n *\n * const { withdrawal_address, fee_recipient_address } =\n * await client.splits.createValidatorManagerAndRewardsSplit({\n * rewardSplitRecipients: [\n * { address: \"0xOp1...\", percentAllocation: 50 },\n * { address: \"0xOp2...\", percentAllocation: 49 },\n * ],\n * principalRecipient: \"0xPrincipal...\",\n * OVMOwnerAddress: \"0xOwner...\",\n * });\n * ```\n */\nexport class ObolSplits {\n private readonly signer: SignerType | undefined;\n public readonly chainId: number;\n public readonly provider: ProviderType | undefined | null;\n\n constructor(\n signer: SignerType | undefined,\n chainId: number,\n provider: ProviderType | undefined | null,\n ) {\n this.signer = signer;\n this.chainId = chainId;\n this.provider = provider;\n }\n\n /**\n * Deploys an OVM and SplitV2 contract for a **rewards-only** split scenario.\n *\n * Principal goes to a single address; only validator rewards are split among\n * the configured recipients. Automatically appends the Obol RAF recipient.\n *\n * - Sends one or more on-chain transactions (irreversible).\n * - Only supported on chains with OVM factory contracts (Mainnet, Hoodi).\n *\n * @param payload - Configuration for the OVM and SplitV2 deployment.\n * @returns The OVM address as `withdrawal_address` and splitter as `fee_recipient_address`.\n * @throws {SignerRequiredError} If no signer was provided.\n * @throws {UnsupportedChainError} If the chain does not support splitters.\n *\n * @example\n * ```typescript\n * const { withdrawal_address, fee_recipient_address } =\n * await client.splits.createValidatorManagerAndRewardsSplit({\n * rewardSplitRecipients: [\n * { address: \"0xOp1...\", percentAllocation: 50 },\n * { address: \"0xOp2...\", percentAllocation: 49 },\n * ],\n * principalRecipient: \"0xPrincipal...\",\n * OVMOwnerAddress: \"0xOwner...\",\n * });\n * ```\n */\n async createValidatorManagerAndRewardsSplit(\n payload: OVMRewardsSplitPayload,\n ): Promise<ClusterValidator> {\n const salt = SPLITS_V2_SALT;\n if (!this.signer) {\n throw new SignerRequiredError('createValidatorManagerAndRewardsSplit');\n }\n\n const validatedPayload = validatePayload<Required<OVMRewardsSplitPayload>>(\n payload,\n ovmRewardsSplitPayloadSchema,\n );\n\n if (!isChainSupportedForSplitters(this.chainId)) {\n throw new UnsupportedChainError(\n this.chainId,\n 'createValidatorManagerAndRewardsSplit',\n );\n }\n\n const chainConfig = CHAIN_CONFIGURATION[this.chainId];\n if (!chainConfig?.OVM_FACTORY_CONTRACT) {\n throw new UnsupportedChainError(\n this.chainId,\n 'createValidatorManagerAndRewardsSplit',\n );\n }\n\n if (!this.provider) {\n throw new Error(\n 'Provider is required to check OVM factory contract availability',\n );\n }\n const ovmFactoryConfig = chainConfig.OVM_FACTORY_CONTRACT;\n const splitV2FactoryConfig = chainConfig.SPLIT_V2_FACTORY_CONTRACT;\n const multiCall3Config = chainConfig.MULTICALL3_CONTRACT;\n\n if (\n !ovmFactoryConfig?.address ||\n !ovmFactoryConfig?.bytecode ||\n !splitV2FactoryConfig?.address ||\n !splitV2FactoryConfig?.bytecode ||\n !multiCall3Config?.address ||\n !multiCall3Config?.bytecode\n ) {\n throw new UnsupportedChainError(\n this.chainId,\n 'createValidatorManagerAndRewardsSplit',\n );\n }\n\n const checkOVMFactoryContract = await isContractAvailable(\n ovmFactoryConfig.address,\n this.provider,\n ovmFactoryConfig.bytecode,\n );\n\n const checkSplitV2FactoryContract = await isContractAvailable(\n splitV2FactoryConfig.address,\n this.provider,\n splitV2FactoryConfig.bytecode,\n );\n\n const checkMultiCall3Contract = await isContractAvailable(\n multiCall3Config.address,\n this.provider,\n multiCall3Config.bytecode,\n );\n\n if (\n !checkOVMFactoryContract ||\n !checkSplitV2FactoryContract ||\n !checkMultiCall3Contract\n ) {\n throw new Error(\n `Required factory contracts are not available on chain ${this.chainId}`,\n );\n }\n\n const retroActiveFundingRecipient = {\n address: chainConfig.RETROACTIVE_FUNDING_CONTRACT.address,\n percentAllocation: DEFAULT_RETROACTIVE_FUNDING_REWARDS_ONLY_SPLIT,\n };\n\n const copiedRewardsSplitRecipients = [\n ...validatedPayload.rewardSplitRecipients,\n ];\n copiedRewardsSplitRecipients.push(retroActiveFundingRecipient);\n\n // Format recipients for SplitV2\n const rewardRecipients = formatRecipientsForSplitV2(\n copiedRewardsSplitRecipients,\n );\n\n const predictedSplitAddress = await predictSplitV2Address({\n splitOwnerAddress: validatedPayload.splitOwnerAddress,\n recipients: rewardRecipients,\n distributorFeePercent: validatedPayload.distributorFeePercent,\n salt,\n signer: this.signer,\n chainId: this.chainId,\n });\n\n const isRewardSplitterDeployed = await isSplitV2Deployed({\n splitOwnerAddress: validatedPayload.splitOwnerAddress,\n recipients: rewardRecipients,\n distributorFeePercent: validatedPayload.distributorFeePercent,\n salt,\n signer: this.signer,\n chainId: this.chainId,\n });\n\n if (isRewardSplitterDeployed) {\n const ovmAddress = await deployOVMContract({\n OVMOwnerAddress: validatedPayload.OVMOwnerAddress,\n principalRecipient: validatedPayload.principalRecipient,\n rewardRecipient: predictedSplitAddress,\n principalThreshold: validatedPayload.principalThreshold,\n signer: this.signer,\n chainId: this.chainId,\n });\n\n return {\n withdrawal_address: ovmAddress,\n fee_recipient_address: predictedSplitAddress,\n };\n } else {\n const ovmAddress = await deployOVMAndSplitV2({\n ovmArgs: {\n OVMOwnerAddress: validatedPayload.OVMOwnerAddress,\n rewardRecipient: predictedSplitAddress,\n principalRecipient: validatedPayload.principalRecipient,\n principalThreshold: validatedPayload.principalThreshold,\n },\n rewardRecipients,\n isRewardsSplitterDeployed: isRewardSplitterDeployed,\n distributorFeePercent: validatedPayload.distributorFeePercent,\n salt,\n signer: this.signer,\n chainId: this.chainId,\n splitOwnerAddress: validatedPayload.splitOwnerAddress,\n });\n\n return {\n withdrawal_address: ovmAddress,\n fee_recipient_address: predictedSplitAddress,\n };\n }\n }\n\n /**\n * Deploys an OVM and SplitV2 contract for a **total split** scenario.\n *\n * Both principal and rewards are split among recipients via separate SplitV2\n * contracts. Automatically appends the Obol RAF recipient to rewards.\n *\n * - Sends one or more on-chain transactions (irreversible).\n * - Only supported on chains with OVM factory contracts (Mainnet, Hoodi).\n *\n * @param payload - Configuration for the OVM and SplitV2 deployment.\n * @returns The OVM address as `withdrawal_address` and rewards splitter as `fee_recipient_address`.\n * @throws {SignerRequiredError} If no signer was provided.\n * @throws {UnsupportedChainError} If the chain does not support splitters.\n *\n * @example\n * ```typescript\n * const { withdrawal_address, fee_recipient_address } =\n * await client.splits.createValidatorManagerAndTotalSplit({\n * rewardSplitRecipients: [\n * { address: \"0xOp1...\", percentAllocation: 50 },\n * { address: \"0xOp2...\", percentAllocation: 49 },\n * ],\n * principalSplitRecipients: [\n * { address: \"0xOp1...\", percentAllocation: 50 },\n * { address: \"0xOp2...\", percentAllocation: 50 },\n * ],\n * OVMOwnerAddress: \"0xOwner...\",\n * });\n * ```\n */\n async createValidatorManagerAndTotalSplit(\n payload: OVMTotalSplitPayload,\n ): Promise<ClusterValidator> {\n const salt = SPLITS_V2_SALT;\n if (!this.signer) {\n throw new SignerRequiredError('createValidatorManagerAndTotalSplit');\n }\n\n const validatedPayload = validatePayload<Required<OVMTotalSplitPayload>>(\n payload,\n ovmTotalSplitPayloadSchema,\n );\n\n if (!isChainSupportedForSplitters(this.chainId)) {\n throw new UnsupportedChainError(\n this.chainId,\n 'createValidatorManagerAndTotalSplit',\n );\n }\n\n const chainConfig = CHAIN_CONFIGURATION[this.chainId];\n if (!chainConfig?.OVM_FACTORY_CONTRACT) {\n throw new UnsupportedChainError(\n this.chainId,\n 'createValidatorManagerAndTotalSplit',\n );\n }\n\n if (!this.provider) {\n throw new Error(\n 'Provider is required to check OVM factory contract availability',\n );\n }\n\n const ovmFactoryConfig = chainConfig.OVM_FACTORY_CONTRACT;\n const splitV2FactoryConfig = chainConfig.SPLIT_V2_FACTORY_CONTRACT;\n const multiCall3Config = chainConfig.MULTICALL3_CONTRACT;\n\n if (\n !ovmFactoryConfig?.address ||\n !ovmFactoryConfig?.bytecode ||\n !splitV2FactoryConfig?.address ||\n !splitV2FactoryConfig?.bytecode ||\n !multiCall3Config?.address ||\n !multiCall3Config?.bytecode\n ) {\n throw new UnsupportedChainError(\n this.chainId,\n 'createValidatorManagerAndTotalSplit',\n );\n }\n\n const checkOVMFactoryContract = await isContractAvailable(\n ovmFactoryConfig.address,\n this.provider,\n ovmFactoryConfig.bytecode,\n );\n\n const checkSplitV2FactoryContract = await isContractAvailable(\n splitV2FactoryConfig.address,\n this.provider,\n splitV2FactoryConfig.bytecode,\n );\n\n const checkMultiCall3Contract = await isContractAvailable(\n multiCall3Config.address,\n this.provider,\n multiCall3Config.bytecode,\n );\n\n if (\n !checkOVMFactoryContract ||\n !checkSplitV2FactoryContract ||\n !checkMultiCall3Contract\n ) {\n throw new Error(\n `Required factory contracts are not available on chain ${this.chainId}`,\n );\n }\n\n const retroActiveFundingRecipient = {\n address: chainConfig.RETROACTIVE_FUNDING_CONTRACT.address,\n percentAllocation: DEFAULT_RETROACTIVE_FUNDING_REWARDS_ONLY_SPLIT,\n };\n\n const copiedRewardsSplitRecipients = [\n ...validatedPayload.rewardSplitRecipients,\n ];\n copiedRewardsSplitRecipients.push(retroActiveFundingRecipient);\n\n const rewardsRecipients = formatRecipientsForSplitV2(\n copiedRewardsSplitRecipients,\n );\n\n const principalSplitRecipients = formatRecipientsForSplitV2(\n validatedPayload.principalSplitRecipients,\n );\n\n const predictedRewardsSplitAddress = await predictSplitV2Address({\n splitOwnerAddress: validatedPayload.splitOwnerAddress,\n recipients: rewardsRecipients,\n distributorFeePercent: validatedPayload.distributorFeePercent,\n salt,\n signer: this.signer,\n chainId: this.chainId,\n });\n\n const predictedPrincipalSplitAddress = await predictSplitV2Address({\n splitOwnerAddress: validatedPayload.splitOwnerAddress,\n recipients: principalSplitRecipients,\n distributorFeePercent: validatedPayload.distributorFeePercent,\n salt,\n signer: this.signer,\n chainId: this.chainId,\n });\n\n const isRewardsSplitterDeployed = await isSplitV2Deployed({\n splitOwnerAddress: validatedPayload.splitOwnerAddress,\n recipients: rewardsRecipients,\n distributorFeePercent: validatedPayload.distributorFeePercent,\n salt,\n signer: this.signer,\n chainId: this.chainId,\n });\n\n const isPrincipalSplitterDeployed = await isSplitV2Deployed({\n splitOwnerAddress: validatedPayload.splitOwnerAddress,\n recipients: principalSplitRecipients,\n distributorFeePercent: validatedPayload.distributorFeePercent,\n salt,\n signer: this.signer,\n chainId: this.chainId,\n });\n\n if (isRewardsSplitterDeployed && isPrincipalSplitterDeployed) {\n const ovmAddress = await deployOVMContract({\n OVMOwnerAddress: validatedPayload.OVMOwnerAddress,\n principalRecipient: predictedPrincipalSplitAddress,\n rewardRecipient: predictedRewardsSplitAddress,\n principalThreshold: validatedPayload.principalThreshold,\n signer: this.signer,\n chainId: this.chainId,\n });\n\n return {\n withdrawal_address: ovmAddress,\n fee_recipient_address: predictedRewardsSplitAddress,\n };\n } else {\n // Use multicall3 to deploy any contracts that aren't deployed\n const ovmAddress = await deployOVMAndSplitV2({\n ovmArgs: {\n OVMOwnerAddress: validatedPayload.OVMOwnerAddress,\n rewardRecipient: predictedRewardsSplitAddress,\n principalRecipient: predictedPrincipalSplitAddress,\n principalThreshold: validatedPayload.principalThreshold,\n },\n rewardRecipients: rewardsRecipients,\n distributorFeePercent: validatedPayload.distributorFeePercent,\n salt,\n signer: this.signer,\n chainId: this.chainId,\n principalSplitRecipients,\n isPrincipalSplitDeployed: isPrincipalSplitterDeployed,\n splitOwnerAddress: validatedPayload.splitOwnerAddress,\n });\n\n return {\n withdrawal_address: ovmAddress,\n fee_recipient_address: predictedRewardsSplitAddress,\n };\n }\n }\n\n /**\n * Requests withdrawal of validator funds from an OVM contract.\n *\n * Sends an on-chain transaction to the OVM contract requesting withdrawal\n * for the specified validator public keys and amounts.\n *\n * @param payload - Withdrawal request data including OVM address, validator\n * public keys, amounts, and fees.\n * @returns The transaction hash of the withdrawal request.\n * @throws {SignerRequiredError} If no signer was provided.\n *\n * @example\n * ```typescript\n * const { txHash } = await client.splits.requestWithdrawal({\n * ovmAddress: \"0xOVM...\",\n * pubKeys: [\"0xValidatorPubkey...\"],\n * amounts: [\"32000000000\"],\n * withdrawalFees: \"1000000000000000\",\n * });\n * ```\n */\n async requestWithdrawal(\n payload: OVMRequestWithdrawalPayload,\n ): Promise<{ txHash: string }> {\n if (!this.signer) {\n throw new SignerRequiredError('requestWithdrawal');\n }\n // [TBD] need to move ovm verification to sdk method and use it here\n const validatedPayload = validatePayload<OVMRequestWithdrawalPayload>(\n payload,\n ovmRequestWithdrawalPayloadSchema,\n );\n\n return await requestWithdrawalFromOVM({\n ovmAddress: validatedPayload.ovmAddress,\n pubKeys: validatedPayload.pubKeys,\n amounts: validatedPayload.amounts,\n withdrawalFees: validatedPayload.withdrawalFees,\n signer: this.signer,\n });\n }\n\n /**\n * Deposits validators to an OVM contract. Each deposit is sent as a separate\n * on-chain transaction.\n *\n * @param payload - Deposit data including the OVM address and an array of\n * validator deposit objects (pubkey, withdrawal_credentials, signature,\n * deposit_data_root, amount).\n * @returns An array of transaction hashes, one per deposit.\n * @throws {SignerRequiredError} If no signer was provided.\n *\n * @example\n * ```typescript\n * const { txHashes } = await client.splits.deposit({\n * ovmAddress: \"0xOVM...\",\n * deposits: [{\n * pubkey: \"0x...\",\n * withdrawal_credentials: \"0x...\",\n * signature: \"0x...\",\n * deposit_data_root: \"0x...\",\n * amount: \"32000000000000000000\",\n * }],\n * });\n * ```\n */\n async deposit(payload: OVMDepositPayload): Promise<{ txHashes: string[] }> {\n if (!this.signer) {\n throw new SignerRequiredError('deposit');\n }\n\n const validatedPayload = validatePayload<OVMDepositPayload>(\n payload,\n ovmDepositPayloadSchema,\n );\n\n return await depositOVM({\n ovmAddress: validatedPayload.ovmAddress,\n deposits: validatedPayload.deposits,\n signer: this.signer,\n });\n }\n}\n","import { ETHER_TO_GWEI } from '../constants.js';\nimport { type SignerType } from '../types.js';\nimport { Contract } from 'ethers';\nimport { BatchDepositContract } from '../abi/BatchDeposit.js';\n\n/**\n * Helper function to submit withdrawal request for EOA\n */\nexport async function submitEOAWithdrawalRequest({\n pubkey,\n allocation,\n withdrawalAddress,\n withdrawalContractAddress,\n requiredFee,\n chainId,\n signer,\n}: {\n pubkey: string;\n allocation: number;\n withdrawalAddress: string;\n withdrawalContractAddress: string;\n requiredFee: string;\n chainId: number;\n signer: SignerType;\n}): Promise<{ txHash: string | null }> {\n if (!withdrawalAddress) {\n throw new Error('No withdrawal address provided');\n }\n if (allocation === undefined || allocation === null) {\n throw new Error('No allocation provided');\n }\n\n const amountInGwei = BigInt(Math.floor(Number(allocation) * ETHER_TO_GWEI));\n const data = `0x${pubkey.slice(2)}${amountInGwei.toString(16).padStart(16, '0')}`;\n\n const tx = await signer.sendTransaction({\n to: withdrawalContractAddress,\n chainId,\n value: BigInt(requiredFee),\n data: data as `0x${string}`,\n });\n\n const receipt = await tx.wait();\n if (!receipt) return { txHash: null };\n return { txHash: receipt.hash };\n}\n\n/**\n * Helper function to submit batch deposit request for EOA\n */\nexport async function submitEOABatchDeposit({\n deposits,\n batchDepositContractAddress,\n signer,\n}: {\n deposits: Array<{\n pubkey: string;\n withdrawal_credentials: string;\n signature: string;\n deposit_data_root: string;\n amount: string;\n }>;\n batchDepositContractAddress: string;\n signer: SignerType;\n}): Promise<{ txHashes: string[] }> {\n if (!deposits || deposits.length === 0) {\n throw new Error('No deposits provided');\n }\n\n // Create contract instance\n const batchDepositContract = new Contract(\n batchDepositContractAddress,\n BatchDepositContract.abi,\n signer,\n );\n\n const BATCH_SIZE = 500;\n const txHashes: string[] = [];\n\n try {\n // Process deposits in batches of 500\n for (let i = 0; i < deposits.length; i += BATCH_SIZE) {\n const batchDeposits = deposits.slice(i, i + BATCH_SIZE);\n\n // Calculate total value needed for this batch\n const totalValue = batchDeposits.reduce(\n (sum, deposit) => sum + BigInt(deposit.amount),\n BigInt(0),\n );\n\n // Prepare deposit data for this batch\n const depositData = batchDeposits.map(deposit => ({\n pubKey: deposit.pubkey,\n withdrawalCredentials: deposit.withdrawal_credentials,\n signature: deposit.signature,\n depositDataRoot: deposit.deposit_data_root,\n amount: BigInt(deposit.amount),\n }));\n\n // Execute batch deposit for this batch\n const tx = await batchDepositContract.batchDeposit(depositData, {\n value: totalValue,\n });\n\n const receipt = await tx.wait();\n if (receipt?.hash) {\n txHashes.push(receipt.hash as string);\n }\n }\n return { txHashes };\n } catch (error: any) {\n throw new Error(\"Failed to submit batch deposit'}\");\n }\n}\n","export const BatchDepositContract = {\n abi: [\n {\n inputs: [],\n name: 'DepositValueGreaterThan2048ETH',\n type: 'error',\n },\n {\n inputs: [],\n name: 'DepositValueLessThan1ETH',\n type: 'error',\n },\n {\n inputs: [],\n name: 'DepositValueMustBeMultipleOfGwei',\n type: 'error',\n },\n {\n inputs: [],\n name: 'InvalidPubKeyLength',\n type: 'error',\n },\n {\n inputs: [],\n name: 'InvalidSignatureLength',\n type: 'error',\n },\n {\n inputs: [],\n name: 'InvalidWithdrawalCredLength',\n type: 'error',\n },\n {\n inputs: [],\n name: 'MsgValueNotEqualToTotalDepositAmount',\n type: 'error',\n },\n {\n inputs: [],\n name: 'NoDepositsProvided',\n type: 'error',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'bytes',\n name: 'pubKey',\n type: 'bytes',\n },\n {\n indexed: true,\n internalType: 'bytes',\n name: 'withdrawalCredentials',\n type: 'bytes',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'amount',\n type: 'uint256',\n },\n ],\n name: 'ValidatorDeposit',\n type: 'event',\n },\n {\n inputs: [\n {\n components: [\n {\n internalType: 'bytes',\n name: 'pubKey',\n type: 'bytes',\n },\n {\n internalType: 'bytes',\n name: 'withdrawalCredentials',\n type: 'bytes',\n },\n {\n internalType: 'bytes',\n name: 'signature',\n type: 'bytes',\n },\n {\n internalType: 'uint256',\n name: 'amount',\n type: 'uint256',\n },\n ],\n internalType: 'struct IBatchDeposit.Deposit[]',\n name: '_deposits',\n type: 'tuple[]',\n },\n ],\n name: 'batchDeposit',\n outputs: [],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'depositContract',\n outputs: [\n {\n internalType: 'contract IDepositContract',\n name: '',\n type: 'address',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n ],\n};\n","import {\n submitEOAWithdrawalRequest,\n submitEOABatchDeposit,\n} from './eoaHelpers.js';\nimport { validatePayload } from '../ajv.js';\nimport {\n eoaWithdrawalPayloadSchema,\n eoaDepositPayloadSchema,\n} from '../schema.js';\nimport { CHAIN_CONFIGURATION } from '../constants.js';\nimport { SignerRequiredError, UnsupportedChainError } from '../errors.js';\nimport {\n type ProviderType,\n type SignerType,\n type EOAWithdrawalPayload,\n type EOADepositPayload,\n} from '../types.js';\n\n/**\n * Manages Externally Owned Account (EOA) operations: validator withdrawals\n * and batch deposits via on-chain contracts.\n *\n * Do not instantiate directly; access via `client.eoa`.\n *\n * Available methods:\n * - {@link EOA.requestWithdrawal} – request validator withdrawal\n * - {@link EOA.deposit} – batch-deposit validators for gas efficiency\n *\n * All methods send on-chain transactions and require a signer with ETH for gas.\n *\n * @example\n * ```typescript\n * const client = new Client({ chainId: 1 }, signer, provider);\n *\n * // Request withdrawal\n * const { txHash } = await client.eoa.requestWithdrawal({\n * pubkey: \"0xValidatorPubkey...\",\n * allocation: 32,\n * requiredFee: \"1\",\n * });\n *\n * // Batch deposit\n * const { txHashes } = await client.eoa.deposit({\n * deposits: [{ pubkey: \"0x...\", withdrawal_credentials: \"0x...\", ... }],\n * });\n * ```\n */\nexport class EOA {\n private readonly signer: SignerType | undefined;\n public readonly chainId: number;\n public readonly provider: ProviderType | undefined | null;\n\n constructor(\n signer: SignerType | undefined,\n chainId: number,\n provider: ProviderType | undefined | null,\n ) {\n this.signer = signer;\n this.chainId = chainId;\n this.provider = provider;\n }\n\n /**\n * Requests withdrawal of validator funds via the EOA withdrawal contract.\n *\n * Sends an on-chain transaction. Requires both a signer and a provider.\n *\n * @param payload - Withdrawal data including validator `pubkey`, `allocation`\n * (in ETH), and `requiredFee` (in wei).\n * @returns The transaction hash, or `null` if no transaction was needed.\n * @throws {SignerRequiredError} If no signer was provided.\n * @throws {UnsupportedChainError} If the chain has no EOA withdrawal contract.\n *\n * @example\n * ```typescript\n * const { txHash } = await client.eoa.requestWithdrawal({\n * pubkey: \"0xValidatorPubkey...\",\n * allocation: 32,\n * requiredFee: \"1\",\n * });\n * ```\n */\n async requestWithdrawal(\n payload: EOAWithdrawalPayload,\n ): Promise<{ txHash: string | null }> {\n if (!this.signer) {\n throw new SignerRequiredError('requestWithdrawal');\n }\n\n if (!this.provider) {\n throw new Error('Provider is required in requestWithdrawal');\n }\n\n const chainConfig = CHAIN_CONFIGURATION[this.chainId];\n if (!chainConfig?.EOA_WITHDRAWAL_CONTRACT?.address) {\n throw new UnsupportedChainError(this.chainId, 'EOA requestWithdrawal');\n }\n\n const validatedPayload = validatePayload<EOAWithdrawalPayload>(\n payload,\n eoaWithdrawalPayloadSchema,\n );\n\n const withdrawalAddress = await this.signer.getAddress();\n\n return await submitEOAWithdrawalRequest({\n pubkey: validatedPayload.pubkey,\n allocation: validatedPayload.allocation,\n withdrawalAddress,\n withdrawalContractAddress: chainConfig.EOA_WITHDRAWAL_CONTRACT.address,\n requiredFee: validatedPayload.requiredFee,\n chainId: this.chainId,\n signer: this.signer,\n });\n }\n\n /**\n * Batch-deposits validators to the beacon chain via the Pier Two batch\n * deposit contract for gas efficiency.\n *\n * Due to EVM gas limits, it is recommended to deposit at most 500\n * validators per call.\n *\n * @param payload - Deposit data including an array of validator deposit objects.\n * @returns An array of transaction hashes, one per batch.\n * @throws {SignerRequiredError} If no signer was provided.\n * @throws {UnsupportedChainError} If the chain has no batch deposit contract.\n *\n * @example\n * ```typescript\n * const { txHashes } = await client.eoa.deposit({\n * deposits: [{\n * pubkey: \"0x...\",\n * withdrawal_credentials: \"0x...\",\n * deposit_data_root: \"0x...\",\n * signature: \"0x...\",\n * amount: \"32000000000000000000\",\n * }],\n * });\n * ```\n */\n async deposit(payload: EOADepositPayload): Promise<{ txHashes: string[] }> {\n if (!this.signer) {\n throw new SignerRequiredError('deposit');\n }\n\n const chainConfig = CHAIN_CONFIGURATION[this.chainId];\n if (!chainConfig?.BATCH_DEPOSIT_CONTRACT?.address) {\n throw new UnsupportedChainError(this.chainId, 'EOA deposit');\n }\n\n const validatedPayload = validatePayload<EOADepositPayload>(\n payload,\n eoaDepositPayloadSchema,\n );\n\n return await submitEOABatchDeposit({\n deposits: validatedPayload.deposits,\n batchDepositContractAddress: chainConfig.BATCH_DEPOSIT_CONTRACT.address,\n signer: this.signer,\n });\n }\n}\n","import { type SafeRpcUrl, type ClusterLock } from './types.js';\nimport { isValidClusterLock } from './verification/common.js';\nimport { validateClusterLockInWorker } from './verification/parallelPool.js';\n\n/**\n * Verifies the cryptographic validity of a cluster lock.\n *\n * Checks all operator signatures, config hashes, and definition hashes within\n * the lock. Supports both EOA and Safe Wallet signatures.\n *\n * This is a standalone utility – it does **not** require a `Client` instance.\n *\n * **Charon:** this covers cryptographic and structural checks in this SDK only.\n * Charon adds further runtime/protocol rules. `true` here does not guarantee\n * Charon will accept the lock; use Charon or its supported tooling as the\n * final gate before operating a cluster.\n *\n * @param lock - The cluster lock object (e.g. from {@link Client.getClusterLock}).\n * @param safeRpcUrl - Optional RPC URL for Safe Wallet signature verification.\n * If omitted, falls back to the `RPC_MAINNET` / `RPC_HOODI` / etc. env vars.\n * @returns `true` if the lock is cryptographically valid; `false` if invalid\n * (e.g. missing keys, invalid signatures, hash mismatches).\n * @throws `ClusterLockValidationTimeoutError` when whole-lock validation\n * exceeds the SDK worker deadline (typically large clusters). HTTP APIs should map\n * this to **504 Gateway Timeout**.\n *\n * @example\n * ```typescript\n * import { validateClusterLock, Client } from \"@obolnetwork/obol-sdk\";\n *\n * const configHash = \"0x...\"; // your cluster config hash\n * const client = new Client({ chainId: 560048 });\n * const lock = await client.getClusterLock(configHash);\n * const isValid = await validateClusterLock(lock);\n * ```\n */\nexport const validateClusterLock = async (\n lock: ClusterLock,\n safeRpcUrl?: SafeRpcUrl,\n): Promise<boolean> => {\n try {\n const inWorker = await validateClusterLockInWorker(lock, safeRpcUrl);\n if (inWorker !== null) return inWorker;\n return await isValidClusterLock(lock, safeRpcUrl);\n } catch (err: any) {\n throw err;\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,MAAM,cAAc;;;ACUtB,IAAM,6BAA6B;AAAA,EACxC;AAAA,EACA;AAAA,EACA;AACF;AAIA,IAAM,oBAAoB,IAAI,IAAY,0BAA0B;AAEpE,SAAS,qBAAqB,SAAyB;AACrD,MAAI,YAAY,QAAQ,KAAK;AAC7B,SAAO,UAAU,SAAS,GAAG,GAAG;AAC9B,gBAAY,UAAU,MAAM,GAAG,EAAE;AAAA,EACnC;AACA,MAAI,CAAC,kBAAkB,IAAI,SAAS,GAAG;AACrC,UAAM,IAAI;AAAA,MACR,2BAA2B,2BAA2B,KAAK,IAAI,CAAC;AAAA,IAClE;AAAA,EACF;AACA,SAAO;AACT;AAOO,IAAe,OAAf,MAAoB;AAAA,EAKzB,YAAY;AAAA,IACV,UAAU;AAAA,IACV,UAAU;AAAA,EACZ,GAAe;AACb,SAAK,UAAU,qBAAqB,OAAO;AAC3C,SAAK,UAAU;AACf,SAAK,eAAe,aAAa,KAAK,OAAO;AAAA,EAC/C;AAAA,EAEgB,QACd,UACA,SACY;AAAA;AACZ,YAAM,MAAM,GAAG,KAAK,OAAO,GAAG,QAAQ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,eAAe,UAAU;AAAA,UACjD;AAAA,YACE,QAAQ;AAAA,YACR,MAAM,KAAK,UAAU,YAAY;AAAA,YACjC,SAAS;AAAA,cACP,eAAe,UAAU,uBAAuB;AAAA,YAClD;AAAA,UACF;AAAA,QACF;AACA,eAAO;AAAA,MACT,SAAS,KAAU;AACjB,cAAM;AAAA,MACR;AAAA,IACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiBM,qBAAqB,YAAgD;AAAA;AACzE,YAAM,oBAAuC,MAAM,KAAK;AAAA,QACtD,IAAI,oBAAoB,eAAe,UAAU;AAAA,QACjD;AAAA,UACE,QAAQ;AAAA,QACV;AAAA,MACF;AAEA,aAAO;AAAA,IACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAoBM,eAAe,YAA0C;AAAA;AAC7D,YAAM,OAAoB,MAAM,KAAK;AAAA,QACnC,IAAI,oBAAoB,oBAAoB,UAAU;AAAA,QACtD;AAAA,UACE,QAAQ;AAAA,QACV;AAAA,MACF;AACA,aAAO;AAAA,IACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAkBM,qBAAqB,UAAwC;AAAA;AACjE,YAAM,OAAoB,MAAM,KAAK;AAAA,QACnC,IAAI,oBAAoB,SAAS,QAAQ;AAAA,QACzC;AAAA,UACE,QAAQ;AAAA,QACV;AAAA,MACF;AACA,aAAO;AAAA,IACT;AAAA;AACF;","names":["ZeroAddress","ZeroAddress","Contract","Contract","ByteVectorType","ContainerType","fromHexString","signingRoot","ContainerType","ByteVectorType","fromHexString","signingRoot","ec","Contract","Contract"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/index.ts","../../../src/base.ts","../../../src/ajv.ts","../../../src/schema.ts","../../../src/splits/splitHelpers.ts","../../../src/abi/OWR.ts","../../../src/abi/OVM.ts","../../../src/abi/SplitMain.ts","../../../src/abi/splitV2FactoryAbi.ts","../../../src/abi/Multicall3.ts","../../../src/incentives/incentiveHelpers.ts","../../../src/abi/MerkleDistributorWithDeadline.ts","../../../src/incentives/incentives.ts","../../../src/exits/exit.ts","../../../src/exits/ethUtils.ts","../../../src/exits/verificationHelpers.ts","../../../src/splits/splits.ts","../../../src/eoa/eoaHelpers.ts","../../../src/abi/BatchDeposit.ts","../../../src/eoa/eoa.ts","../../../src/verification/validationConcurrency.ts","../../../src/services.ts"],"sourcesContent":["import { v4 as uuidv4 } from 'uuid';\nimport { Base, type BaseConfig } from './base.js';\nimport {\n CONFLICT_ERROR_MSG,\n CreatorConfigHashSigningTypes,\n Domain,\n DKG_ALGORITHM,\n CONFIG_VERSION,\n OperatorConfigHashSigningTypes,\n EnrSigningTypes,\n TERMS_AND_CONDITIONS_VERSION,\n TermsAndConditionsSigningTypes,\n DEFAULT_BASE_VERSION,\n TERMS_AND_CONDITIONS_HASH,\n CHAIN_CONFIGURATION,\n DEFAULT_RETROACTIVE_FUNDING_REWARDS_ONLY_SPLIT,\n OBOL_SDK_EMAIL,\n isChainSupportedForSplitters,\n} from './constants.js';\nimport {\n ConflictError,\n SignerRequiredError,\n UnsupportedChainError,\n} from './errors.js';\nimport {\n type RewardsSplitPayload,\n type ClusterDefinition,\n type ClusterLock,\n type ClusterPayload,\n type OperatorPayload,\n type TotalSplitPayload,\n type ClusterValidator,\n type ETH_ADDRESS,\n type OWRTranches,\n type ProviderType,\n type SignerType,\n} from './types.js';\nimport { clusterConfigOrDefinitionHash } from './verification/common.js';\nimport { validatePayload } from './ajv.js';\nimport {\n definitionSchema,\n operatorPayloadSchema,\n rewardsSplitterPayloadSchema,\n totalSplitterPayloadSchema,\n} from './schema.js';\nimport {\n deploySplitterContract,\n formatSplitRecipients,\n handleDeployOWRAndSplitter,\n predictSplitterAddress,\n getOWRTranches,\n} from './splits/splitHelpers.js';\nimport { isContractAvailable } from './utils.js';\nimport { Incentives } from './incentives/incentives.js';\nimport { Exit } from './exits/exit.js';\nimport { ObolSplits } from './splits/splits.js';\nimport { EOA } from './eoa/eoa.js';\nexport * from './types.js';\nexport * from './services.js';\nexport * from './verification/signature-validator.js';\nexport * from './verification/common.js';\nexport * from './constants.js';\nexport {\n ConflictError,\n ClusterLockValidationBusyError,\n ClusterLockValidationTimeoutError,\n InvalidBaseUrlError,\n SignerRequiredError,\n UnsupportedChainError,\n} from './errors.js';\nexport { ALLOWED_OBOL_API_BASE_URLS } from './base.js';\nexport { Incentives } from './incentives/incentives.js';\nexport { Exit } from './exits/exit.js';\nexport { ObolSplits } from './splits/splits.js';\nexport { EOA } from './eoa/eoa.js';\nexport { blsVerify } from './blsUtils.js';\nexport { ENR } from '@chainsafe/enr';\n\n/**\n * Primary entrypoint for the Obol SDK. Use this class to create, manage,\n * and activate Distributed Validators via the Obol API.\n *\n * All operations are namespaced under the client instance:\n * - `client.incentives.*` – claim and query Obol incentives\n * - `client.exit.*` – validate and recombine voluntary exit signatures\n * - `client.splits.*` – deploy OVM / SplitV2 reward-splitting contracts\n * - `client.eoa.*` – EOA withdrawals and batch deposits\n *\n * Cluster lifecycle helpers live directly on the client:\n * - {@link Client.acceptObolLatestTermsAndConditions}\n * - {@link Client.createClusterDefinition}\n * - {@link Client.acceptClusterDefinition}\n * - {@link Client.getClusterDefinition}\n * - {@link Client.getClusterLock}\n * - {@link Client.getClusterLockByHash}\n * - {@link Client.createObolRewardsSplit}\n * - {@link Client.createObolTotalSplit}\n * - {@link Client.getOWRTranches}\n *\n * Supported networks (by `chainId`): Mainnet (1), Hoodi (560048),\n * Gnosis (100), Sepolia (11155111).\n *\n * @example\n * ```typescript\n * import { Client } from \"@obolnetwork/obol-sdk\";\n * import { Wallet } from \"ethers\";\n *\n * const signer = new Wallet(process.env.PRIVATE_KEY!);\n * const client = new Client({ chainId: 560048 }, signer);\n *\n * // 1. Accept terms (required once before creating/updating data)\n * await client.acceptObolLatestTermsAndConditions();\n *\n * // 2. Create a cluster definition\n * const configHash = await client.createClusterDefinition({\n * name: \"my-cluster\",\n * operators: [{ address: \"0x...\" }],\n * validators: [{\n * fee_recipient_address: \"0x...\",\n * withdrawal_address: \"0x...\",\n * }],\n * });\n *\n * // 3. Retrieve the definition\n * const def = await client.getClusterDefinition(configHash);\n * ```\n */\nexport class Client extends Base {\n private readonly signer: SignerType | undefined;\n\n /**\n * Incentives module – claim and query Obol incentive rewards.\n *\n * @see {@link Incentives}\n */\n public incentives: Incentives;\n\n /**\n * Exit module – verify partial exit signatures and recombine exit blobs\n * for distributed validator voluntary exits.\n *\n * @see {@link Exit}\n */\n public exit: Exit;\n\n /**\n * Splits module – deploy OVM and SplitV2 contracts for reward/principal\n * splitting, request withdrawals, and deposit to OVM contracts.\n *\n * @see {@link ObolSplits}\n */\n public splits: ObolSplits;\n\n /**\n * EOA module – request withdrawals and batch-deposit validators\n * via Externally Owned Account contracts.\n *\n * @see {@link EOA}\n */\n public eoa: EOA;\n\n /**\n * The blockchain provider used for on-chain reads.\n * Defaults to `signer.provider` when a signer is supplied.\n */\n public provider: ProviderType | undefined | null;\n\n /**\n * Creates a new Obol SDK client.\n *\n * @param config - Client configuration object.\n * @param config.baseUrl - Obol API base URL. Defaults to `https://api.obol.tech`.\n * Must match one of {@link ALLOWED_OBOL_API_BASE_URLS} (API paths use `/v1/...` separately).\n * @param config.chainId - Target chain ID. Defaults to `560048` (Hoodi).\n * Supported: 1 (Mainnet), 560048 (Hoodi), 100 (Gnosis), 11155111 (Sepolia).\n * @param signer - An ethers `Wallet` or `JsonRpcSigner`. Required for any\n * write operation (creating clusters, deploying splits, claiming incentives).\n * Read-only operations (`getClusterDefinition`, `getClusterLock`) work without a signer.\n * @param provider - An ethers `Provider`. If omitted, falls back to `signer.provider`.\n *\n * @example\n * ```typescript\n * // Minimal read-only client (no signer)\n * const readClient = new Client({ chainId: 1 });\n * const def = await readClient.getClusterDefinition(configHash);\n *\n * // Full client with signer for write operations\n * const client = new Client({ chainId: 560048 }, signer);\n * ```\n */\n constructor(\n config: BaseConfig,\n signer?: SignerType,\n provider?: ProviderType,\n ) {\n super(config);\n this.signer = signer;\n // Use the provided provider, or fall back to signer.provider if available\n this.provider =\n provider ??\n (signer && 'provider' in signer ? signer.provider : undefined);\n this.incentives = new Incentives(\n this.signer,\n this.chainId,\n this.request.bind(this),\n this.provider,\n );\n this.exit = new Exit(this.chainId, this.provider);\n this.splits = new ObolSplits(this.signer, this.chainId, this.provider);\n this.eoa = new EOA(this.signer, this.chainId, this.provider);\n }\n\n /**\n * Accepts the latest Obol terms and conditions.\n *\n * **Must be called once** before any write operation\n * (`createClusterDefinition`, `acceptClusterDefinition`, etc.).\n * Calling it again after acceptance throws a {@link ConflictError}.\n *\n * - Requires a `signer` to be provided at client construction.\n * - Signs an EIP-712 typed-data message; no on-chain transaction is sent.\n * - Idempotent per signer address: once accepted, subsequent calls throw `ConflictError`.\n *\n * @returns A success message string from the Obol API.\n * @throws {SignerRequiredError} If no signer was provided to the client.\n * @throws {ConflictError} If the terms were already accepted by this address.\n *\n * @example\n * ```typescript\n * const message = await client.acceptObolLatestTermsAndConditions();\n * console.log(message); // \"Terms and conditions accepted successfully\"\n * ```\n */\n async acceptObolLatestTermsAndConditions(): Promise<string> {\n if (!this.signer) {\n throw new SignerRequiredError('acceptObolLatestTermsAndConditions');\n }\n\n try {\n const termsAndConditionsHash = TERMS_AND_CONDITIONS_HASH;\n const address = await this.signer.getAddress();\n const termsAndConditionsPayload = {\n address,\n version: TERMS_AND_CONDITIONS_VERSION,\n terms_and_conditions_hash: termsAndConditionsHash,\n fork_version: this.fork_version,\n };\n\n const termsAndConditionsSignature = await this.signer.signTypedData(\n Domain(),\n TermsAndConditionsSigningTypes,\n {\n terms_and_conditions_hash: termsAndConditionsHash,\n version: TERMS_AND_CONDITIONS_VERSION,\n },\n );\n\n const termsAndConditionsResponse: { message: string; success: boolean } =\n await this.request(`/${DEFAULT_BASE_VERSION}/termsAndConditions`, {\n method: 'POST',\n body: JSON.stringify(termsAndConditionsPayload),\n headers: {\n Authorization: `Bearer ${termsAndConditionsSignature}`,\n },\n });\n return termsAndConditionsResponse?.message;\n } catch (err: any) {\n if (err?.message === CONFLICT_ERROR_MSG) {\n throw new ConflictError();\n }\n throw err;\n }\n }\n\n /**\n * Deploys an Optimistic Withdrawal Recipient (OWR) and a Splitter Proxy contract.\n *\n * Use this when the **principal** goes to a single address and only **rewards**\n * are split among recipients. For splitting both principal and rewards, see\n * {@link Client.createObolTotalSplit}.\n *\n * - Requires a `signer` with ETH to pay deployment gas.\n * - Sends one or more on-chain transactions (irreversible).\n * - Automatically appends the Obol Retroactive Funding (RAF) recipient at the\n * configured percentage (default 1%).\n * - Only supported on Mainnet (1) and Hoodi (560048).\n *\n * @param rewardsSplitPayload - Configuration for the OWR and splitter deployment.\n * @returns The deployed OWR address as `withdrawal_address` and the\n * splitter proxy address as `fee_recipient_address`.\n * @throws {SignerRequiredError} If no signer was provided.\n * @throws {UnsupportedChainError} If the chain does not support splitters.\n *\n * @example\n * ```typescript\n * const { withdrawal_address, fee_recipient_address } =\n * await client.createObolRewardsSplit({\n * splitRecipients: [\n * { account: \"0xOperator1...\", percentAllocation: 50 },\n * { account: \"0xOperator2...\", percentAllocation: 49 },\n * ],\n * principalRecipient: \"0xPrincipalAddress...\",\n * etherAmount: 32,\n * });\n * ```\n */\n async createObolRewardsSplit({\n splitRecipients,\n principalRecipient,\n etherAmount,\n ObolRAFSplit = DEFAULT_RETROACTIVE_FUNDING_REWARDS_ONLY_SPLIT,\n distributorFee,\n controllerAddress,\n recoveryAddress,\n }: RewardsSplitPayload): Promise<ClusterValidator> {\n // This method doesnt require T&C signature\n if (!this.signer) {\n throw new SignerRequiredError('createObolRewardsSplit');\n }\n\n const validatedPayload = validatePayload<Required<RewardsSplitPayload>>(\n {\n splitRecipients,\n principalRecipient,\n etherAmount,\n ObolRAFSplit,\n distributorFee,\n controllerAddress,\n recoveryAddress,\n },\n rewardsSplitterPayloadSchema,\n );\n\n // Check if we allow splitters on this chainId\n if (!isChainSupportedForSplitters(this.chainId)) {\n throw new UnsupportedChainError(this.chainId, 'createObolRewardsSplit');\n }\n\n const chainConfig = CHAIN_CONFIGURATION[this.chainId];\n if (!chainConfig?.SPLITMAIN_CONTRACT) {\n throw new UnsupportedChainError(this.chainId, 'createObolRewardsSplit');\n }\n\n const checkSplitMainAddress = await isContractAvailable(\n chainConfig.SPLITMAIN_CONTRACT.address,\n this.signer.provider as ProviderType,\n chainConfig.SPLITMAIN_CONTRACT.bytecode,\n );\n\n const checkMulticall3Address = await isContractAvailable(\n chainConfig.MULTICALL3_CONTRACT.address,\n this.signer.provider as ProviderType,\n chainConfig.MULTICALL3_CONTRACT.bytecode,\n );\n\n const checkOWRFactoryAddress = await isContractAvailable(\n chainConfig.OWR_FACTORY_CONTRACT.address,\n this.signer.provider as ProviderType,\n chainConfig.OWR_FACTORY_CONTRACT.bytecode,\n );\n\n if (\n !checkMulticall3Address ||\n !checkSplitMainAddress ||\n !checkOWRFactoryAddress\n ) {\n throw new Error(\n `Required factory contracts are not available on chain ${this.chainId}. Contact Obol at ${OBOL_SDK_EMAIL}`,\n );\n }\n\n const retroActiveFundingRecipient = {\n account: chainConfig.RETROACTIVE_FUNDING_CONTRACT.address,\n percentAllocation: validatedPayload.ObolRAFSplit,\n };\n\n const copiedSplitRecipients = [...validatedPayload.splitRecipients];\n copiedSplitRecipients.push(retroActiveFundingRecipient);\n\n const { accounts, percentAllocations } = formatSplitRecipients(\n copiedSplitRecipients,\n );\n\n const predictedSplitterAddress = await predictSplitterAddress({\n signer: this.signer,\n accounts,\n percentAllocations,\n chainId: this.chainId,\n distributorFee: validatedPayload.distributorFee,\n controllerAddress: validatedPayload.controllerAddress,\n });\n\n const isSplitterDeployed = await isContractAvailable(\n predictedSplitterAddress,\n this.signer.provider as ProviderType,\n );\n\n const { withdrawal_address, fee_recipient_address } =\n await handleDeployOWRAndSplitter({\n signer: this.signer,\n isSplitterDeployed: !!isSplitterDeployed,\n predictedSplitterAddress,\n accounts,\n percentAllocations,\n principalRecipient: validatedPayload.principalRecipient,\n etherAmount: validatedPayload.etherAmount,\n chainId: this.chainId,\n distributorFee: validatedPayload.distributorFee,\n controllerAddress: validatedPayload.controllerAddress,\n recoveryAddress: validatedPayload.recoveryAddress,\n });\n\n return { withdrawal_address, fee_recipient_address };\n }\n\n /**\n * Deploys a Splitter Proxy contract that splits **both principal and rewards**.\n *\n * Unlike {@link Client.createObolRewardsSplit}, this method does not deploy an\n * OWR – the splitter address is used as both `withdrawal_address` and\n * `fee_recipient_address`.\n *\n * - Requires a `signer` with ETH to pay deployment gas.\n * - Sends an on-chain transaction if the splitter is not already deployed (irreversible).\n * - If the predicted splitter is already deployed, returns the existing address without\n * sending a transaction (idempotent).\n * - Automatically appends the Obol RAF recipient.\n * - Only supported on Mainnet (1) and Hoodi (560048).\n *\n * @param totalSplitPayload - Configuration for the splitter deployment.\n * @returns The splitter address as both `withdrawal_address` and `fee_recipient_address`.\n * @throws {SignerRequiredError} If no signer was provided.\n * @throws {UnsupportedChainError} If the chain does not support splitters.\n * @throws {Error} If required on-chain factory contracts are unavailable.\n *\n * @example\n * ```typescript\n * const { withdrawal_address, fee_recipient_address } =\n * await client.createObolTotalSplit({\n * splitRecipients: [\n * { account: \"0xOperator1...\", percentAllocation: 50 },\n * { account: \"0xOperator2...\", percentAllocation: 49.9 },\n * ],\n * });\n * // withdrawal_address === fee_recipient_address (same splitter)\n * ```\n */\n async createObolTotalSplit({\n splitRecipients,\n ObolRAFSplit,\n distributorFee,\n controllerAddress,\n }: TotalSplitPayload): Promise<ClusterValidator> {\n // This method doesnt require T&C signature\n if (!this.signer) {\n throw new SignerRequiredError('createObolTotalSplit');\n }\n\n const validatedPayload = validatePayload<Required<TotalSplitPayload>>(\n {\n splitRecipients,\n ObolRAFSplit,\n distributorFee,\n controllerAddress,\n },\n totalSplitterPayloadSchema,\n );\n\n // Check if we allow splitters on this chainId\n if (!isChainSupportedForSplitters(this.chainId)) {\n throw new UnsupportedChainError(this.chainId, 'createObolTotalSplit');\n }\n\n const chainConfig = CHAIN_CONFIGURATION[this.chainId];\n if (!chainConfig?.SPLITMAIN_CONTRACT) {\n throw new UnsupportedChainError(this.chainId, 'createObolTotalSplit');\n }\n\n const checkSplitMainAddress = await isContractAvailable(\n chainConfig.SPLITMAIN_CONTRACT.address,\n this.signer.provider as ProviderType,\n chainConfig.SPLITMAIN_CONTRACT.bytecode,\n );\n\n if (!checkSplitMainAddress) {\n throw new Error(\n `Required factory contracts are not available on chain ${this.chainId}. Contact Obol at ${OBOL_SDK_EMAIL}`,\n );\n }\n\n const retroActiveFundingRecipient = {\n account: chainConfig.RETROACTIVE_FUNDING_CONTRACT.address,\n percentAllocation: validatedPayload.ObolRAFSplit,\n };\n\n const copiedSplitRecipients = [...validatedPayload.splitRecipients];\n copiedSplitRecipients.push(retroActiveFundingRecipient);\n\n const { accounts, percentAllocations } = formatSplitRecipients(\n copiedSplitRecipients,\n );\n\n const predictedSplitterAddress = await predictSplitterAddress({\n signer: this.signer,\n accounts,\n percentAllocations,\n chainId: this.chainId,\n distributorFee: validatedPayload.distributorFee,\n controllerAddress: validatedPayload.controllerAddress,\n });\n\n const isSplitterDeployed = await isContractAvailable(\n predictedSplitterAddress,\n this.signer.provider as ProviderType,\n );\n\n if (!isSplitterDeployed) {\n const splitterAddress = await deploySplitterContract({\n signer: this.signer,\n accounts,\n percentAllocations,\n chainId: this.chainId,\n distributorFee: validatedPayload.distributorFee,\n controllerAddress: validatedPayload.controllerAddress,\n });\n return {\n withdrawal_address: splitterAddress,\n fee_recipient_address: splitterAddress,\n };\n }\n\n return {\n withdrawal_address: predictedSplitterAddress,\n fee_recipient_address: predictedSplitterAddress,\n };\n }\n\n /**\n * Reads the tranches of a deployed Optimistic Withdrawal Recipient (OWR) contract.\n *\n * Returns the principal recipient, reward recipient, and staked principal amount\n * configured in the OWR. This is a read-only on-chain call (no transaction sent).\n *\n * - Requires a `signer` (for provider access).\n *\n * @param owrAddress - The Ethereum address of the deployed OWR contract.\n * @returns The OWR tranche data: `principalRecipient`, `rewardRecipient`, and `amountOfPrincipalStake`.\n * @throws {SignerRequiredError} If no signer was provided.\n *\n * @example\n * ```typescript\n * const tranches = await client.getOWRTranches(\"0xOWRAddress...\");\n * console.log(tranches.principalRecipient);\n * console.log(tranches.rewardRecipient);\n * console.log(tranches.amountOfPrincipalStake);\n * ```\n */\n async getOWRTranches(owrAddress: ETH_ADDRESS): Promise<OWRTranches> {\n if (!this.signer) {\n throw new SignerRequiredError('getOWRTranches');\n }\n\n const signer = this.signer;\n return await getOWRTranches({ owrAddress, signer });\n }\n\n /**\n * Creates a new cluster definition and registers it with the Obol API.\n *\n * A cluster definition describes the operators, validators, and configuration\n * for a Distributed Key Generation (DKG) ceremony. After creation, each operator\n * must call {@link Client.acceptClusterDefinition} to join.\n *\n * - Requires {@link Client.acceptObolLatestTermsAndConditions} to have been called first.\n * - Requires a `signer`.\n * - The `config_hash` returned is the unique identifier for this cluster.\n * - Threshold is automatically set to `ceil(2/3 * operators.length)`.\n * - Creating a duplicate cluster throws a {@link ConflictError}.\n *\n * @param newCluster - The cluster configuration payload.\n * @returns The `config_hash` string that uniquely identifies this cluster definition.\n * @throws {SignerRequiredError} If no signer was provided.\n * @throws {ConflictError} If an identical cluster definition already exists.\n *\n * @example\n * ```typescript\n * const configHash = await client.createClusterDefinition({\n * name: \"my-dvt-cluster\",\n * operators: [{ address: \"0xOp1...\" }, { address: \"0xOp2...\" }],\n * validators: [{\n * fee_recipient_address: \"0xFeeRecipient...\",\n * withdrawal_address: \"0xWithdrawal...\",\n * }],\n * });\n * console.log(\"Cluster created:\", configHash);\n * ```\n */\n async createClusterDefinition(newCluster: ClusterPayload): Promise<string> {\n if (!this.signer) {\n throw new SignerRequiredError('createClusterDefinition');\n }\n\n const validatedCluster = validatePayload<ClusterPayload>(\n newCluster,\n definitionSchema,\n );\n\n const clusterConfig: Partial<ClusterDefinition> = {\n ...validatedCluster,\n fork_version: this.fork_version,\n dkg_algorithm: DKG_ALGORITHM,\n version: CONFIG_VERSION,\n uuid: uuidv4(),\n timestamp: new Date().toISOString(),\n threshold: Math.ceil((2 * validatedCluster.operators.length) / 3),\n num_validators: validatedCluster.validators.length,\n };\n try {\n const address = await this.signer.getAddress();\n\n clusterConfig.creator = { address };\n clusterConfig.config_hash = clusterConfigOrDefinitionHash(\n clusterConfig as ClusterDefinition,\n true,\n );\n\n const creatorConfigSignature = await this.signer.signTypedData(\n Domain(this.chainId),\n CreatorConfigHashSigningTypes,\n { creator_config_hash: clusterConfig.config_hash },\n );\n\n const clusterDefinition: ClusterDefinition = await this.request(\n `/${DEFAULT_BASE_VERSION}/definition`,\n {\n method: 'POST',\n body: JSON.stringify(clusterConfig),\n headers: {\n Authorization: `Bearer ${creatorConfigSignature}`,\n 'fork-version': this.fork_version,\n },\n },\n );\n return clusterDefinition?.config_hash;\n } catch (err: any) {\n if (err?.message === CONFLICT_ERROR_MSG) {\n throw new ConflictError();\n }\n throw err;\n }\n }\n\n /**\n * Accepts (joins) an existing cluster definition as an operator.\n *\n * Each operator in the cluster must call this method with their ENR and the\n * cluster's `config_hash` to signal readiness for the DKG ceremony.\n *\n * - Requires a `signer` (the operator's address is derived from it).\n * - Signs two EIP-712 messages: one for the config hash, one for the ENR.\n * - The operator must be listed in the cluster definition's `operators` array.\n *\n * @param operatorPayload - Operator data. Must include `enr` (Ethereum Node Record)\n * and `version` at minimum.\n * @param configHash - The `config_hash` returned by {@link Client.createClusterDefinition}.\n * @returns The updated cluster definition with the operator's acceptance recorded.\n * @throws {SignerRequiredError} If no signer was provided.\n *\n * @example\n * ```typescript\n * const updatedDef = await client.acceptClusterDefinition(\n * { enr: \"enr:-LK4Q...\", version: \"v1.10.0\" },\n * configHash,\n * );\n * ```\n */\n async acceptClusterDefinition(\n operatorPayload: OperatorPayload,\n configHash: string,\n ): Promise<ClusterDefinition> {\n if (!this.signer) {\n throw new SignerRequiredError('acceptClusterDefinition');\n }\n\n const validatedPayload = validatePayload<OperatorPayload>(\n operatorPayload,\n operatorPayloadSchema,\n );\n\n try {\n const address = await this.signer.getAddress();\n\n const operatorConfigSignature = await this.signer.signTypedData(\n Domain(this.chainId),\n OperatorConfigHashSigningTypes,\n { operator_config_hash: configHash },\n );\n const operatorENRSignature = await this.signer.signTypedData(\n Domain(this.chainId),\n EnrSigningTypes,\n { enr: validatedPayload.enr },\n );\n\n const operatorData: OperatorPayload = {\n ...validatedPayload,\n address,\n enr_signature: operatorENRSignature,\n fork_version: this.fork_version,\n };\n const clusterDefinition: ClusterDefinition = await this.request(\n `/${DEFAULT_BASE_VERSION}/definition/${configHash}`,\n {\n method: 'PUT',\n body: JSON.stringify(operatorData),\n headers: {\n Authorization: `Bearer ${operatorConfigSignature}`,\n },\n },\n );\n return clusterDefinition;\n } catch (err: any) {\n throw err;\n }\n }\n\n /**\n * Retrieves a cluster definition by its configuration hash.\n *\n * This is a read-only API call – no signer is required.\n *\n * @param configHash - The `config_hash` returned by {@link Client.createClusterDefinition}.\n * @returns The full cluster definition including operators, validators, and metadata.\n * @throws {Error} If no cluster definition exists for the given hash (404).\n *\n * @example\n * ```typescript\n * const definition = await client.getClusterDefinition(configHash);\n * console.log(definition.name, definition.operators.length);\n * ```\n */\n async getClusterDefinition(configHash: string): Promise<ClusterDefinition> {\n const clusterDefinition: ClusterDefinition = await this.request(\n `/${DEFAULT_BASE_VERSION}/definition/${configHash}`,\n {\n method: 'GET',\n },\n );\n\n return clusterDefinition;\n }\n\n /**\n * Retrieves a cluster lock by the cluster's configuration hash.\n *\n * A cluster lock is generated after a successful DKG ceremony and contains\n * the distributed validators, their public key shares, and deposit data.\n * This is a read-only API call – no signer is required.\n *\n * @param configHash - The `config_hash` from the cluster definition.\n * @returns The cluster lock including distributed validators and deposit data.\n * @throws {Error} If no lock exists for the given config hash (DKG not yet complete, or not found).\n *\n * @example\n * ```typescript\n * const lock = await client.getClusterLock(configHash);\n * console.log(lock.distributed_validators.length);\n * console.log(lock.lock_hash);\n * ```\n */\n async getClusterLock(configHash: string): Promise<ClusterLock> {\n const lock: ClusterLock = await this.request(\n `/${DEFAULT_BASE_VERSION}/lock/configHash/${configHash}`,\n {\n method: 'GET',\n },\n );\n return lock;\n }\n\n /**\n * Retrieves a cluster lock by its lock hash (as opposed to config hash).\n *\n * Use this when you have the `lock_hash` directly rather than the `config_hash`.\n * This is a read-only API call – no signer is required.\n *\n * @param lockHash - The `lock_hash` from a cluster lock.\n * @returns The cluster lock including distributed validators and deposit data.\n * @throws {Error} If no lock exists for the given lock hash (not found).\n *\n * @example\n * ```typescript\n * const lock = await client.getClusterLockByHash(lockHash);\n * console.log(lock.cluster_definition.name);\n * ```\n */\n async getClusterLockByHash(lockHash: string): Promise<ClusterLock> {\n const lock: ClusterLock = await this.request(\n `/${DEFAULT_BASE_VERSION}/lock/${lockHash}`,\n {\n method: 'GET',\n },\n );\n return lock;\n }\n}\n","// src/resources/base.ts\nimport {\n DEFAULT_BASE_URL,\n DEFAULT_CHAIN_ID,\n SDK_VERSION,\n} from './constants.js';\nimport { InvalidBaseUrlError } from './errors.js';\nimport { FORK_MAPPING } from './types.js';\n\n/** Official Obol API base URLs (no path suffix — `/v1` is added per request). */\nexport const ALLOWED_OBOL_API_BASE_URLS = [\n DEFAULT_BASE_URL,\n 'https://obol-api-nonprod-dev.dev.obol.tech',\n 'https://obol-api-nonprod-qa.dev.obol.tech',\n] as const;\n\nexport type AllowedObolApiBaseUrl = (typeof ALLOWED_OBOL_API_BASE_URLS)[number];\n\nconst ALLOWED_BASE_URLS = new Set<string>(ALLOWED_OBOL_API_BASE_URLS);\n\nfunction assertAllowedBaseUrl(baseUrl: string): string {\n let candidate = baseUrl.trim();\n while (candidate.endsWith('/')) {\n candidate = candidate.slice(0, -1);\n }\n if (!ALLOWED_BASE_URLS.has(candidate)) {\n throw new InvalidBaseUrlError(\n `baseUrl must be one of: ${ALLOWED_OBOL_API_BASE_URLS.join(', ')}`,\n );\n }\n return candidate;\n}\n\nexport interface BaseConfig {\n baseUrl?: string;\n chainId?: FORK_MAPPING;\n}\n\nexport abstract class Base {\n baseUrl: string;\n chainId: number;\n fork_version: string;\n\n constructor({\n baseUrl = DEFAULT_BASE_URL,\n chainId = DEFAULT_CHAIN_ID,\n }: BaseConfig) {\n this.baseUrl = assertAllowedBaseUrl(baseUrl);\n this.chainId = chainId;\n this.fork_version = FORK_MAPPING[this.chainId];\n }\n\n protected async request<T>(\n endpoint: string,\n options?: RequestInit,\n ): Promise<T> {\n const url = `${this.baseUrl}${endpoint}`;\n const config = {\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n 'User-Agent': `Obol-SDK/${SDK_VERSION}`,\n ...options?.headers,\n },\n };\n\n try {\n const response = await fetch(url, config);\n if (response.ok) {\n return await response.json();\n } else {\n const errorResponse = await response.json();\n throw errorResponse;\n }\n } catch (e: any) {\n throw e;\n }\n }\n}\n","import addFormats from 'ajv-formats';\nimport addKeywords from 'ajv-keywords';\nimport { parseUnits } from 'ethers';\nimport {\n type OVMRewardsSplitPayload,\n type OVMTotalSplitPayload,\n type RewardsSplitPayload,\n type TotalSplitPayload,\n type OVMRequestWithdrawalPayload,\n} from './types.js';\nimport Ajv from 'ajv';\nimport {\n DEFAULT_RETROACTIVE_FUNDING_REWARDS_ONLY_SPLIT,\n DEFAULT_RETROACTIVE_FUNDING_TOTAL_SPLIT,\n} from './constants.js';\n\nexport const VALID_DEPOSIT_AMOUNTS = [\n parseUnits('1', 'gwei').toString(),\n parseUnits('32', 'gwei').toString(),\n parseUnits('8', 'gwei').toString(),\n parseUnits('256', 'gwei').toString(),\n];\n\nexport const VALID_NON_COMPOUNDING_AMOUNTS = [\n parseUnits('1', 'gwei').toString(),\n parseUnits('32', 'gwei').toString(),\n];\n\nconst calculateTotalPercentage = (\n recipients: Array<{ percentAllocation: number }>,\n): number => {\n return recipients.reduce((acc, curr) => acc + curr.percentAllocation, 0);\n};\n\nconst validateTotalPercentage = (totalPercentage: number): boolean => {\n return totalPercentage === 100;\n};\n\nconst validateTotalPercentageWithRAF = (\n totalPercentage: number,\n rafPercentage: number,\n): boolean => {\n return totalPercentage + rafPercentage === 100;\n};\n\nconst validateRewardsSplitRecipients = (\n _: boolean,\n data: RewardsSplitPayload,\n): boolean => {\n const obolRAFSplit =\n data?.ObolRAFSplit ?? DEFAULT_RETROACTIVE_FUNDING_REWARDS_ONLY_SPLIT;\n const splitPercentage = calculateTotalPercentage(data.splitRecipients);\n return validateTotalPercentageWithRAF(splitPercentage, obolRAFSplit);\n};\n\nconst validateTotalSplitRecipients = (\n _: boolean,\n data: TotalSplitPayload,\n): boolean => {\n const obolRAFSplit =\n data.ObolRAFSplit ?? DEFAULT_RETROACTIVE_FUNDING_TOTAL_SPLIT;\n const splitPercentage = calculateTotalPercentage(data.splitRecipients);\n return validateTotalPercentageWithRAF(splitPercentage, obolRAFSplit);\n};\n\nconst validateUniqueAddresses = (\n _: boolean,\n operators: Array<{ address: string }>,\n): boolean => {\n if (!operators) {\n return false;\n }\n\n if (operators.length < 4) {\n return false;\n }\n\n if (operators.every(op => op.address === '')) {\n return true;\n }\n\n if (operators.some(op => op.address.length !== 42)) {\n return false;\n }\n\n const addresses = operators.map(op => op.address);\n const uniqueAddresses = new Set(addresses);\n const isUnique = uniqueAddresses.size === addresses.length;\n return isUnique;\n};\n\nconst validateOVMRewardsSplitRecipients = (\n _: boolean,\n data: OVMRewardsSplitPayload,\n): boolean => {\n const obolRAFSplit = DEFAULT_RETROACTIVE_FUNDING_REWARDS_ONLY_SPLIT;\n const splitPercentage = calculateTotalPercentage(data.rewardSplitRecipients);\n return validateTotalPercentageWithRAF(splitPercentage, obolRAFSplit);\n};\n\nconst validateOVMTotalSplitRecipients = (\n _: boolean,\n data: OVMTotalSplitPayload,\n): boolean => {\n const splitPercentage = calculateTotalPercentage(\n data.principalSplitRecipients,\n );\n return validateTotalPercentage(splitPercentage);\n};\n\nconst validateOVMRequestWithdrawalPayload = (\n _: boolean,\n data: OVMRequestWithdrawalPayload,\n): boolean => {\n if (!data.pubKeys || !data.amounts) {\n return false;\n }\n\n if (data.pubKeys.length !== data.amounts.length) {\n return false;\n }\n\n // // Validate that all amounts are at least 1,000,000 gwei\n // const minAmount = BigInt(1000000);\n // for (const amountStr of data.amounts) {\n // const minAmount = BigInt(1000000);\n // const amount = BigInt(amountStr);\n // if (amount < minAmount) {\n // return false;\n // }\n // }\n\n return true;\n};\n\nconst ajv = new Ajv({\n allErrors: true,\n useDefaults: true,\n strict: false,\n $data: true,\n});\naddFormats(ajv);\naddKeywords(ajv, ['patternRequired']);\n\najv.addKeyword({\n keyword: 'validateRewardsSplitRecipients',\n validate: validateRewardsSplitRecipients,\n schemaType: 'boolean',\n});\n\najv.addKeyword({\n keyword: 'validateTotalSplitRecipients',\n validate: validateTotalSplitRecipients,\n schemaType: 'boolean',\n});\n\najv.addKeyword({\n keyword: 'validateUniqueAddresses',\n validate: validateUniqueAddresses,\n schemaType: 'boolean',\n});\n\najv.addKeyword({\n keyword: 'validateOVMRewardsSplitRecipients',\n validate: validateOVMRewardsSplitRecipients,\n schemaType: 'boolean',\n});\n\najv.addKeyword({\n keyword: 'validateOVMTotalSplitRecipients',\n validate: validateOVMTotalSplitRecipients,\n schemaType: 'boolean',\n});\n\najv.addKeyword({\n keyword: 'validateOVMRequestWithdrawalPayload',\n validate: validateOVMRequestWithdrawalPayload,\n schemaType: 'boolean',\n});\n\nexport function validatePayload<T>(data: unknown, schema: object): T {\n const validate = ajv.compile<T>(schema);\n const valid = validate(data);\n if (!valid) {\n const errors = validate.errors\n ?.map(e => `${e.instancePath} ${e.message}`)\n .join(', ');\n throw new Error(`Validation failed: ${errors}`);\n }\n return data;\n}\n","import { ZeroAddress } from 'ethers';\nimport {\n DEFAULT_RETROACTIVE_FUNDING_REWARDS_ONLY_SPLIT,\n DEFAULT_RETROACTIVE_FUNDING_TOTAL_SPLIT,\n PRINCIPAL_THRESHOLD,\n} from './constants.js';\nimport { VALID_DEPOSIT_AMOUNTS, VALID_NON_COMPOUNDING_AMOUNTS } from './ajv.js';\n\nexport const operatorPayloadSchema = {\n type: 'object',\n properties: {\n version: { type: 'string' },\n enr: { type: 'string' },\n },\n required: ['version', 'enr'],\n};\n\nexport const definitionSchema = {\n type: 'object',\n properties: {\n name: { type: 'string' },\n operators: {\n type: 'array',\n minItems: 4,\n items: {\n type: 'object',\n properties: {\n address: {\n type: 'string',\n },\n },\n required: ['address'],\n },\n validateUniqueAddresses: true,\n },\n validators: {\n type: 'array',\n minItems: 1,\n items: {\n type: 'object',\n properties: {\n fee_recipient_address: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{40}$',\n },\n withdrawal_address: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{40}$',\n },\n },\n required: ['fee_recipient_address', 'withdrawal_address'],\n },\n },\n deposit_amounts: {\n type: ['array', 'null'],\n items: {\n type: 'string',\n pattern: '^[0-9]+$',\n },\n if: {\n $data: '1/compounding',\n },\n then: {\n items: {\n enum: VALID_DEPOSIT_AMOUNTS,\n },\n },\n else: {\n items: {\n enum: VALID_NON_COMPOUNDING_AMOUNTS,\n },\n },\n default: null,\n },\n compounding: {\n type: 'boolean',\n default: false,\n },\n target_gas_limit: {\n type: 'number',\n minimum: 1,\n default: 36000000,\n },\n consensus_protocol: {\n type: 'string',\n enum: ['qbft', ''],\n default: '',\n },\n },\n required: ['name', 'operators', 'validators'],\n};\n\nexport const totalSplitterPayloadSchema = {\n type: 'object',\n properties: {\n splitRecipients: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n account: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{40}$',\n },\n percentAllocation: { type: 'number' },\n },\n required: ['account', 'percentAllocation'],\n },\n },\n ObolRAFSplit: {\n type: 'number',\n minimum: DEFAULT_RETROACTIVE_FUNDING_TOTAL_SPLIT,\n default: DEFAULT_RETROACTIVE_FUNDING_TOTAL_SPLIT,\n },\n distributorFee: {\n type: 'number',\n maximum: 10,\n multipleOf: 0.01,\n default: 0,\n },\n controllerAddress: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{40}$',\n default: ZeroAddress,\n },\n },\n validateTotalSplitRecipients: true,\n required: ['splitRecipients'],\n};\n\nexport const rewardsSplitterPayloadSchema = {\n type: 'object',\n properties: {\n ...totalSplitterPayloadSchema.properties,\n ObolRAFSplit: {\n type: 'number',\n minimum: DEFAULT_RETROACTIVE_FUNDING_REWARDS_ONLY_SPLIT,\n default: DEFAULT_RETROACTIVE_FUNDING_REWARDS_ONLY_SPLIT,\n },\n recoveryAddress: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{40}$',\n default: ZeroAddress,\n },\n etherAmount: { type: 'number' },\n principalRecipient: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{40}$',\n },\n },\n validateRewardsSplitRecipients: true,\n required: ['splitRecipients', 'principalRecipient', 'etherAmount'],\n};\n\nexport const ovmBaseSplitPayload = {\n rewardSplitRecipients: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n address: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{40}$',\n },\n percentAllocation: { type: 'number' },\n },\n required: ['address', 'percentAllocation'],\n },\n },\n OVMOwnerAddress: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{40}$',\n },\n splitOwnerAddress: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{40}$',\n default: ZeroAddress,\n },\n principalThreshold: {\n type: 'number',\n minimum: 16,\n default: PRINCIPAL_THRESHOLD,\n },\n distributorFeePercent: {\n type: 'number',\n minimum: 0,\n maximum: 10,\n default: 0,\n },\n};\n\nexport const ovmRewardsSplitPayloadSchema = {\n type: 'object',\n properties: {\n ...ovmBaseSplitPayload,\n principalRecipient: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{40}$',\n },\n },\n validateOVMRewardsSplitRecipients: true,\n required: ['rewardSplitRecipients', 'OVMOwnerAddress', 'principalRecipient'],\n};\n\nexport const ovmTotalSplitPayloadSchema = {\n type: 'object',\n properties: {\n ...ovmBaseSplitPayload,\n principalSplitRecipients: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n address: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{40}$',\n },\n percentAllocation: { type: 'number' },\n },\n required: ['address', 'percentAllocation'],\n },\n },\n },\n validateOVMRewardsSplitRecipients: true,\n validateOVMTotalSplitRecipients: true,\n required: [\n 'rewardSplitRecipients',\n 'principalSplitRecipients',\n 'OVMOwnerAddress',\n ],\n};\n\nexport const ovmRequestWithdrawalPayloadSchema = {\n type: 'object',\n properties: {\n withdrawalFees: {\n type: 'string',\n pattern: '^[0-9]+$',\n },\n ovmAddress: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{40}$',\n },\n pubKeys: {\n type: 'array',\n minItems: 1,\n items: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{96}$', // 48 bytes = 96 hex chars + 0x prefix\n },\n },\n amounts: {\n type: 'array',\n minItems: 1,\n items: {\n type: 'string',\n pattern: '^[0-9]+$',\n },\n },\n },\n validateOVMRequestWithdrawalPayload: true,\n required: ['ovmAddress', 'pubKeys', 'amounts', 'withdrawalFees'],\n};\n\nexport const eoaWithdrawalPayloadSchema = {\n type: 'object',\n properties: {\n pubkey: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{96}$', // 48 bytes = 96 hex chars + 0x prefix\n },\n allocation: {\n type: 'number',\n minimum: 0,\n },\n requiredFee: {\n type: 'string',\n pattern: '^[0-9]+$',\n },\n },\n required: ['pubkey', 'allocation', 'requiredFee'],\n};\n\nexport const ovmDepositPayloadSchema = {\n type: 'object',\n properties: {\n ovmAddress: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{40}$',\n },\n deposits: {\n type: 'array',\n minItems: 1,\n items: {\n type: 'object',\n properties: {\n pubkey: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{96}$',\n },\n withdrawal_credentials: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{64}$',\n description: '32 bytes withdrawal credentials',\n },\n signature: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{192}$',\n description: '96 bytes signature (190 hex chars + 0x prefix)',\n },\n deposit_data_root: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{64}$', // 32 bytes = 64 hex chars + 0x prefix\n },\n amount: {\n type: 'string',\n pattern: '^[0-9]+$',\n },\n },\n required: [\n 'pubkey',\n 'withdrawal_credentials',\n 'signature',\n 'deposit_data_root',\n 'amount',\n ],\n },\n },\n },\n required: ['ovmAddress', 'deposits'],\n};\n\nexport const eoaDepositPayloadSchema = {\n type: 'object',\n properties: {\n deposits: {\n type: 'array',\n minItems: 1,\n items: {\n type: 'object',\n properties: {\n pubkey: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{96}$',\n },\n withdrawal_credentials: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{64}$',\n description: '32 bytes withdrawal credentials',\n },\n signature: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{192}$',\n description: '96 bytes signature (190 hex chars + 0x prefix)',\n },\n deposit_data_root: {\n type: 'string',\n pattern: '^0x[a-fA-F0-9]{64}$', // 32 bytes = 64 hex chars + 0x prefix\n },\n amount: {\n type: 'string',\n pattern: '^[0-9]+$',\n },\n },\n required: [\n 'pubkey',\n 'withdrawal_credentials',\n 'signature',\n 'deposit_data_root',\n 'amount',\n ],\n },\n },\n },\n required: ['deposits'],\n};\n","import {\n type OWRTranches,\n type ClusterValidator,\n type ETH_ADDRESS,\n type SplitRecipient,\n type SignerType,\n type SplitV2Recipient,\n type OVMArgs,\n type ChainConfig,\n} from '../types.js';\nimport {\n Contract,\n Interface,\n parseEther,\n ZeroAddress,\n getAddress as toChecksumAddress,\n} from 'ethers';\nimport { OWRContract, OWRFactoryContract } from '../abi/OWR.js';\nimport { OVMFactoryContract, OVMContract } from '../abi/OVM.js';\nimport { splitMainEthereumAbi } from '../abi/SplitMain.js';\nimport { CHAIN_CONFIGURATION, ETHER_TO_GWEI } from '../constants.js';\nimport { splitV2FactoryAbi } from '../abi/splitV2FactoryAbi.js';\nimport { MultiCall3Contract } from '../abi/Multicall3.js';\n\nconst splitMainContractInterface = new Interface(splitMainEthereumAbi);\nconst owrFactoryContractInterface = new Interface(OWRFactoryContract.abi);\nconst ovmFactoryContractInterface = new Interface(OVMFactoryContract.abi);\nconst splitV2FactoryInterface = new Interface(splitV2FactoryAbi);\n\ntype Call = {\n target: ETH_ADDRESS;\n callData: string;\n};\n\ntype OWRArgs = {\n recoveryAddress: ETH_ADDRESS;\n principalRecipient: ETH_ADDRESS;\n amountOfPrincipalStake: number;\n predictedSplitterAddress: ETH_ADDRESS;\n};\n\ntype SplitArgs = {\n accounts: ETH_ADDRESS[];\n percentAllocations: number[];\n distributorFee: number;\n controllerAddress: ETH_ADDRESS;\n};\n\n// Helper function to extract common recipient formatting logic\nconst formatRecipientsCommon = (\n recipients: SplitRecipient[] | SplitV2Recipient[],\n): {\n sortedRecipients: any[];\n getAddress: (item: any) => string;\n getPercentAllocation: (item: any) => number;\n} => {\n const copiedRecipients = [...recipients];\n\n // Handle both SplitRecipient and SplitV2Recipient types\n const getAddress = (item: any): string => item.account || item.address;\n const getPercentAllocation = (item: any): number => item.percentAllocation;\n\n // Has to be sorted when passed\n copiedRecipients.sort((a, b) => getAddress(a).localeCompare(getAddress(b)));\n\n return {\n sortedRecipients: copiedRecipients,\n getAddress,\n getPercentAllocation,\n };\n};\n\nexport const formatSplitRecipients = (\n recipients: SplitRecipient[],\n): { accounts: ETH_ADDRESS[]; percentAllocations: number[] } => {\n const { sortedRecipients, getAddress, getPercentAllocation } =\n formatRecipientsCommon(recipients);\n\n const accounts = sortedRecipients.map(item => getAddress(item));\n const percentAllocations = sortedRecipients.map(recipient => {\n const splitTostring = (getPercentAllocation(recipient) * 1e4).toFixed(0);\n return parseInt(splitTostring);\n });\n return { accounts, percentAllocations };\n};\n\nexport const predictSplitterAddress = async ({\n signer,\n accounts,\n percentAllocations,\n chainId,\n distributorFee,\n controllerAddress,\n}: {\n signer: SignerType;\n accounts: ETH_ADDRESS[];\n percentAllocations: number[];\n chainId: number;\n distributorFee: number;\n controllerAddress: ETH_ADDRESS;\n}): Promise<ETH_ADDRESS> => {\n try {\n const splitMainContractInstance = new Contract(\n getChainConfig(chainId).SPLITMAIN_CONTRACT.address,\n splitMainEthereumAbi,\n signer,\n );\n\n let predictedSplitterAddress: string;\n\n if (controllerAddress === ZeroAddress) {\n try {\n predictedSplitterAddress =\n await splitMainContractInstance.predictImmutableSplitAddress(\n accounts,\n percentAllocations,\n distributorFee,\n );\n } catch (error: any) {\n throw new Error(\n `Failed to predict immutable splitter address: ${error.message ?? 'Contract call failed'}`,\n );\n }\n } else {\n try {\n // It throws on deployed Immutable splitter\n predictedSplitterAddress =\n await splitMainContractInstance.createSplit.staticCall(\n accounts,\n percentAllocations,\n distributorFee,\n controllerAddress,\n );\n } catch (error: any) {\n throw new Error(\n `Failed to predict mutable splitter address via static call: ${error.message ?? 'Static call failed'}`,\n );\n }\n }\n\n return predictedSplitterAddress;\n } catch (error: any) {\n // Re-throw if it's already our custom error\n if (error.message.includes('Failed to predict')) {\n throw error;\n }\n // Handle unexpected errors\n throw new Error(\n `Unexpected error in predictSplitterAddress: ${error.message ?? 'Unknown contract interaction error'}`,\n );\n }\n};\n\nexport const handleDeployOWRAndSplitter = async ({\n signer,\n isSplitterDeployed,\n predictedSplitterAddress,\n accounts,\n percentAllocations,\n etherAmount,\n principalRecipient,\n chainId,\n distributorFee,\n controllerAddress,\n recoveryAddress,\n}: {\n signer: SignerType;\n isSplitterDeployed: boolean;\n predictedSplitterAddress: ETH_ADDRESS;\n accounts: ETH_ADDRESS[];\n percentAllocations: number[];\n etherAmount: number;\n principalRecipient: ETH_ADDRESS;\n chainId: number;\n distributorFee: number;\n controllerAddress: ETH_ADDRESS;\n recoveryAddress: ETH_ADDRESS;\n}): Promise<ClusterValidator> => {\n try {\n if (isSplitterDeployed) {\n let owrAddress: ETH_ADDRESS;\n try {\n owrAddress = await createOWRContract({\n owrArgs: {\n principalRecipient,\n amountOfPrincipalStake: etherAmount,\n predictedSplitterAddress,\n recoveryAddress,\n },\n signer,\n chainId,\n });\n } catch (error: any) {\n throw new Error(\n `Failed to create OWR contract with existing splitter: ${error.message ?? 'OWR contract creation failed'}`,\n );\n }\n return {\n withdrawal_address: owrAddress,\n fee_recipient_address: predictedSplitterAddress,\n };\n } else {\n let owrAddress: ETH_ADDRESS;\n let splitterAddress: ETH_ADDRESS;\n try {\n const result = await deploySplitterAndOWRContracts({\n owrArgs: {\n principalRecipient,\n amountOfPrincipalStake: etherAmount,\n predictedSplitterAddress,\n recoveryAddress,\n },\n splitterArgs: {\n accounts,\n percentAllocations,\n distributorFee,\n controllerAddress,\n },\n signer,\n chainId,\n });\n owrAddress = result.owrAddress;\n splitterAddress = result.splitterAddress;\n } catch (error: any) {\n throw new Error(\n `Failed to deploy both splitter and OWR contracts: ${error.message ?? 'Multicall3 contract deployment failed'}`,\n );\n }\n\n return {\n withdrawal_address: owrAddress,\n fee_recipient_address: splitterAddress,\n };\n }\n } catch (error: any) {\n // Re-throw if it's already our custom error\n if (error.message.includes('Failed to')) {\n throw error;\n }\n // Handle unexpected errors\n throw new Error(\n `Unexpected error in handleDeployOWRAndSplitter: ${error.message ?? 'Unknown error during contract deployment orchestration'}`,\n );\n }\n};\n\nconst createOWRContract = async ({\n owrArgs,\n signer,\n chainId,\n}: {\n owrArgs: OWRArgs;\n signer: SignerType;\n chainId: number;\n}): Promise<ETH_ADDRESS> => {\n try {\n const OWRFactoryInstance = new Contract(\n getChainConfig(chainId).OWR_FACTORY_CONTRACT.address,\n OWRFactoryContract.abi,\n signer,\n );\n\n let tx;\n try {\n tx = await OWRFactoryInstance.createOWRecipient(\n owrArgs.recoveryAddress,\n owrArgs.principalRecipient,\n owrArgs.predictedSplitterAddress,\n parseEther(owrArgs.amountOfPrincipalStake.toString()),\n );\n } catch (error: any) {\n throw new Error(\n `Failed to submit OWR contract creation transaction: ${error.message ?? 'Transaction submission failed'}`,\n );\n }\n\n let receipt;\n try {\n receipt = await tx.wait();\n } catch (error: any) {\n throw new Error(\n `OWR contract creation transaction failed or was reverted: ${error.message ?? 'Transaction execution failed'}`,\n );\n }\n\n if (!receipt?.logs?.length) {\n throw new Error(\n 'OWR contract creation transaction succeeded but no events were emitted - unable to determine contract address',\n );\n }\n\n const OWRAddressData = receipt.logs[0]?.topics[1];\n if (!OWRAddressData) {\n throw new Error(\n 'OWR contract creation transaction succeeded but contract address could not be extracted from events',\n );\n }\n\n const formattedOWRAddress = '0x' + OWRAddressData.slice(26, 66);\n\n // Basic address validation\n if (\n formattedOWRAddress.length !== 42 ||\n !formattedOWRAddress.startsWith('0x')\n ) {\n throw new Error(\n `Invalid OWR contract address format: ${formattedOWRAddress}`,\n );\n }\n\n return formattedOWRAddress;\n } catch (error: any) {\n // Re-throw if it's already our custom error\n if (\n error.message.includes('Failed to') ||\n error.message.includes('OWR contract') ||\n error.message.includes('Invalid OWR')\n ) {\n throw error;\n }\n // Handle unexpected errors\n throw new Error(\n `Unexpected error in createOWRContract: ${error.message ?? 'Unknown error during OWR contract creation'}`,\n );\n }\n};\n\nexport const deploySplitterContract = async ({\n signer,\n accounts,\n percentAllocations,\n chainId,\n distributorFee,\n controllerAddress,\n}: {\n signer: SignerType;\n accounts: ETH_ADDRESS[];\n percentAllocations: number[];\n chainId: number;\n distributorFee: number;\n controllerAddress: ETH_ADDRESS;\n}): Promise<ETH_ADDRESS> => {\n try {\n const splitMainContractInstance = new Contract(\n getChainConfig(chainId).SPLITMAIN_CONTRACT.address,\n splitMainEthereumAbi,\n signer,\n );\n\n let tx;\n try {\n tx = await splitMainContractInstance.createSplit(\n accounts,\n percentAllocations,\n distributorFee,\n controllerAddress,\n );\n } catch (error: any) {\n throw new Error(\n `Failed to submit splitter contract creation transaction: ${error.message ?? 'Transaction submission failed'}`,\n );\n }\n\n let receipt;\n try {\n receipt = await tx.wait();\n } catch (error: any) {\n throw new Error(\n `Splitter contract creation transaction failed or was reverted: ${error.message ?? 'Transaction execution failed'}`,\n );\n }\n\n if (!receipt?.logs?.length) {\n throw new Error(\n 'Splitter contract creation transaction succeeded but no events were emitted - unable to determine contract address',\n );\n }\n\n const splitterAddressData = receipt.logs[0]?.topics[1];\n if (!splitterAddressData) {\n throw new Error(\n 'Splitter contract creation transaction succeeded but contract address could not be extracted from events',\n );\n }\n\n const formattedSplitterAddress = '0x' + splitterAddressData.slice(26, 66);\n\n // Basic address validation\n if (\n formattedSplitterAddress.length !== 42 ||\n !formattedSplitterAddress.startsWith('0x')\n ) {\n throw new Error(\n `Invalid splitter contract address format: ${formattedSplitterAddress}`,\n );\n }\n\n return formattedSplitterAddress;\n } catch (error: any) {\n // Re-throw if it's already our custom error\n if (\n error.message.includes('Failed to') ||\n error.message.includes('Splitter contract') ||\n error.message.includes('Invalid splitter')\n ) {\n throw error;\n }\n // Handle unexpected errors\n throw new Error(\n `Unexpected error in deploySplitterContract: ${error.message ?? 'Unknown error during splitter contract creation'}`,\n );\n }\n};\n\nexport const deploySplitterAndOWRContracts = async ({\n owrArgs,\n splitterArgs,\n signer,\n chainId,\n}: {\n owrArgs: OWRArgs;\n splitterArgs: SplitArgs;\n signer: SignerType;\n chainId: number;\n}): Promise<{ owrAddress: ETH_ADDRESS; splitterAddress: ETH_ADDRESS }> => {\n const executeCalls: Call[] = [];\n\n const splitTxData = encodeCreateSplitTxData(\n splitterArgs.accounts,\n splitterArgs.percentAllocations,\n splitterArgs.distributorFee,\n splitterArgs.controllerAddress,\n );\n\n const owrTxData = encodeCreateOWRecipientTxData(\n owrArgs.recoveryAddress,\n owrArgs.principalRecipient,\n owrArgs.predictedSplitterAddress,\n owrArgs.amountOfPrincipalStake,\n );\n\n executeCalls.push(\n {\n target: getChainConfig(chainId).SPLITMAIN_CONTRACT.address,\n callData: splitTxData,\n },\n {\n target: getChainConfig(chainId).OWR_FACTORY_CONTRACT.address,\n callData: owrTxData,\n },\n );\n\n const executeMultiCalls = await multicall3(executeCalls, signer, chainId);\n\n const splitAddressData = executeMultiCalls?.logs[0]?.topics[1];\n const formattedSplitterAddress = '0x' + splitAddressData?.slice(26, 66);\n const owrAddressData = executeMultiCalls?.logs[1]?.topics[1];\n const formattedOwrAddress = '0x' + owrAddressData?.slice(26, 66);\n\n return {\n owrAddress: formattedOwrAddress,\n splitterAddress: formattedSplitterAddress,\n };\n};\n\nexport const getOWRTranches = async ({\n owrAddress,\n signer,\n}: {\n owrAddress: ETH_ADDRESS;\n signer: SignerType;\n}): Promise<OWRTranches> => {\n try {\n const owrContract = new Contract(owrAddress, OWRContract.abi, signer);\n\n let res;\n try {\n res = await owrContract.getTranches();\n } catch (error: any) {\n throw new Error(\n `Failed to call getTranches on OWR contract at ${owrAddress}: ${error.message ?? 'Contract call failed'}`,\n );\n }\n\n if (!res) {\n throw new Error(\n `OWR contract at ${owrAddress} returned empty result for getTranches()`,\n );\n }\n\n return {\n principalRecipient: res.principalRecipient,\n rewardRecipient: res.rewardRecipient,\n amountOfPrincipalStake: res.amountOfPrincipalStake,\n };\n } catch (error: any) {\n // Re-throw if it's already our custom error\n if (\n error.message.includes('Failed to') ||\n error.message.includes('OWR contract')\n ) {\n throw error;\n }\n // Handle unexpected errors\n throw new Error(\n `Unexpected error in getOWRTranches: ${error.message ?? 'Unknown error while fetching OWR tranche data'}`,\n );\n }\n};\n\nexport const multicall3 = async (\n calls: Call[],\n signer: SignerType,\n chainId: number,\n): Promise<any> => {\n try {\n const chainConfig = getChainConfig(chainId);\n const multicall3Address = chainConfig.MULTICALL3_CONTRACT.address;\n const multiCall3ContractInstance = new Contract(\n multicall3Address,\n MultiCall3Contract.abi,\n signer,\n );\n\n let tx;\n try {\n tx = await multiCall3ContractInstance.aggregate(calls);\n } catch (error: any) {\n throw new Error(\n `Failed to submit multicall3 transaction: ${error.message ?? 'Transaction submission failed'}`,\n );\n }\n\n let receipt;\n try {\n receipt = await tx.wait();\n } catch (error: any) {\n throw new Error(\n `Multicall3 transaction failed or was reverted: ${error.message ?? 'Transaction execution failed'}`,\n );\n }\n\n if (!receipt) {\n throw new Error(\n 'Multicall3 transaction succeeded but no receipt was returned',\n );\n }\n\n return receipt;\n } catch (error: any) {\n // Re-throw if it's already our custom error\n if (\n error.message.includes('Failed to') ||\n error.message.includes('Multicall3 transaction')\n ) {\n throw error;\n }\n // Handle unexpected errors\n throw new Error(\n `Unexpected error in multicall3: ${error.message ?? 'Unknown error during multicall3 execution'}`,\n );\n }\n};\n\nconst encodeCreateSplitTxData = (\n accounts: ETH_ADDRESS[],\n percentAllocations: number[],\n distributorFee: number,\n controller: ETH_ADDRESS,\n): ETH_ADDRESS => {\n return splitMainContractInterface.encodeFunctionData('createSplit', [\n accounts,\n percentAllocations,\n distributorFee,\n controller,\n ]);\n};\n\nconst encodeCreateOWRecipientTxData = (\n recoveryAddress: ETH_ADDRESS,\n principalRecipient: ETH_ADDRESS,\n rewardRecipient: ETH_ADDRESS,\n amountOfPrincipalStake: number,\n): ETH_ADDRESS => {\n return owrFactoryContractInterface.encodeFunctionData('createOWRecipient', [\n recoveryAddress,\n principalRecipient,\n rewardRecipient,\n parseEther(amountOfPrincipalStake.toString()),\n ]);\n};\n\n// OVM and SplitV2 Helper Functions\n\n// Helper function to format recipients specifically for SplitV2 (returns SplitV2Recipient[])\nexport const formatRecipientsForSplitV2 = (\n splitRecipients: SplitRecipient[] | SplitV2Recipient[],\n): SplitV2Recipient[] => {\n const { sortedRecipients, getAddress, getPercentAllocation } =\n formatRecipientsCommon(splitRecipients);\n\n return sortedRecipients\n .filter(item => getAddress(item) !== '')\n .map(item => ({\n address: getAddress(item),\n percentAllocation: parseFloat(getPercentAllocation(item).toString()),\n }));\n};\n\n// Helper function to create SplitV2 parameters\nconst createSplitV2Params = (\n recipients: SplitV2Recipient[],\n distributorFeePercent: number,\n): {\n recipients: string[];\n allocations: number[];\n totalAllocation: number;\n distributionIncentive: number;\n} => {\n const addresses = recipients.map(r => r.address);\n const allocations = recipients.map(r =>\n Math.floor(r.percentAllocation * 1e4),\n ); // Convert to basis points\n const totalAllocation = allocations.reduce(\n (sum, allocation) => sum + allocation,\n 0,\n );\n\n return {\n recipients: addresses,\n allocations,\n totalAllocation,\n distributionIncentive: distributorFeePercent,\n };\n};\n\nexport const predictSplitV2Address = async ({\n splitOwnerAddress,\n recipients,\n distributorFeePercent,\n salt,\n signer,\n chainId,\n}: {\n splitOwnerAddress: string;\n recipients: SplitV2Recipient[];\n distributorFeePercent: number;\n salt: `0x${string}`;\n signer: SignerType;\n chainId: number;\n}): Promise<string> => {\n try {\n const chainConfig = getChainConfig(chainId);\n if (!chainConfig?.SPLIT_V2_FACTORY_CONTRACT?.address) {\n throw new Error(`SplitV2 Factory not configured for chain ${chainId}`);\n }\n\n const splitV2FactoryContract = new Contract(\n chainConfig.SPLIT_V2_FACTORY_CONTRACT.address,\n splitV2FactoryAbi,\n signer,\n );\n\n const splitParams = createSplitV2Params(recipients, distributorFeePercent);\n\n const predictedAddress = await splitV2FactoryContract[\n 'predictDeterministicAddress((address[],uint256[],uint256,uint16),address,bytes32)'\n ](splitParams, splitOwnerAddress, salt);\n\n return predictedAddress;\n } catch (error: any) {\n throw new Error(\n `Failed to predict SplitV2 address: ${error.message ?? 'SplitV2 contract call failed'}`,\n );\n }\n};\n\nexport const isSplitV2Deployed = async ({\n splitOwnerAddress,\n recipients,\n distributorFeePercent,\n salt,\n signer,\n chainId,\n}: {\n splitOwnerAddress: string;\n recipients: SplitV2Recipient[];\n distributorFeePercent: number;\n salt: `0x${string}`;\n signer: SignerType;\n chainId: number;\n}): Promise<boolean> => {\n try {\n const chainConfig = getChainConfig(chainId);\n if (!chainConfig?.SPLIT_V2_FACTORY_CONTRACT?.address) {\n throw new Error(`SplitV2 Factory not configured for chain ${chainId}`);\n }\n\n const splitV2FactoryContract = new Contract(\n chainConfig.SPLIT_V2_FACTORY_CONTRACT.address,\n splitV2FactoryAbi,\n signer,\n );\n\n const splitParams = createSplitV2Params(recipients, distributorFeePercent);\n\n const [, exists] = await splitV2FactoryContract.isDeployed(\n splitParams,\n splitOwnerAddress,\n salt,\n );\n\n return exists;\n } catch (error: any) {\n // If the check fails, assume it's not deployed\n return false;\n }\n};\n\nexport const deployOVMContract = async ({\n OVMOwnerAddress,\n principalRecipient,\n rewardRecipient,\n principalThreshold,\n signer,\n chainId,\n}: {\n OVMOwnerAddress: string;\n principalRecipient: string;\n rewardRecipient: string;\n principalThreshold: number;\n signer: SignerType;\n chainId: number;\n}): Promise<string> => {\n try {\n const chainConfig = getChainConfig(chainId);\n if (!chainConfig?.OVM_FACTORY_CONTRACT?.address) {\n throw new Error(`OVM Factory not configured for chain ${chainId}`);\n }\n\n const ovmFactoryContract = new Contract(\n chainConfig.OVM_FACTORY_CONTRACT.address,\n OVMFactoryContract.abi,\n signer,\n );\n\n const tx = await ovmFactoryContract.createObolValidatorManager(\n OVMOwnerAddress,\n principalRecipient,\n rewardRecipient,\n principalThreshold * ETHER_TO_GWEI,\n );\n\n const receipt = await tx.wait();\n\n // Extract OVM address from logs\n const ovmAddressLog = receipt?.logs[1]?.topics[1];\n if (!ovmAddressLog) {\n throw new Error('Failed to extract OVM address from transaction logs');\n }\n\n const ovmAddress = '0x' + ovmAddressLog.slice(26, 66);\n return toChecksumAddress(ovmAddress);\n } catch (error: any) {\n throw new Error(\n `Failed to deploy OVM contract: ${error.message ?? 'OVM deployment failed'}`,\n );\n }\n};\n\nexport const deployOVMAndSplitV2 = async ({\n ovmArgs,\n rewardRecipients,\n isRewardsSplitterDeployed,\n distributorFeePercent,\n salt,\n signer,\n chainId,\n principalSplitRecipients,\n isPrincipalSplitDeployed,\n splitOwnerAddress,\n}: {\n ovmArgs: OVMArgs;\n rewardRecipients: SplitV2Recipient[];\n isRewardsSplitterDeployed?: boolean;\n distributorFeePercent: number;\n salt: `0x${string}`;\n signer: SignerType;\n chainId: number;\n principalSplitRecipients?: SplitV2Recipient[];\n isPrincipalSplitDeployed?: boolean;\n splitOwnerAddress: string;\n}): Promise<string> => {\n try {\n const chainConfig = getChainConfig(chainId);\n if (!chainConfig?.OVM_FACTORY_CONTRACT?.address) {\n throw new Error(`OVM Factory not configured for chain ${chainId}`);\n }\n\n if (!chainConfig?.SPLIT_V2_FACTORY_CONTRACT?.address) {\n throw new Error(`SplitV2 Factory not configured for chain ${chainId}`);\n }\n\n const executeCalls: Call[] = [];\n\n if (rewardRecipients && !isRewardsSplitterDeployed) {\n // Create rewards split call data\n const splitParams = createSplitV2Params(\n rewardRecipients,\n distributorFeePercent,\n );\n const rewardsSplitTxData = encodeCreateSplitV2DeterministicTxData(\n splitParams,\n splitOwnerAddress,\n salt,\n );\n\n executeCalls.push({\n target: chainConfig.SPLIT_V2_FACTORY_CONTRACT.address,\n callData: rewardsSplitTxData,\n });\n }\n\n // Create principal split call data if needed (for total split scenario)\n if (principalSplitRecipients && !isPrincipalSplitDeployed) {\n const principalSplitParams = createSplitV2Params(\n principalSplitRecipients,\n distributorFeePercent,\n );\n const principalSplitTxData = encodeCreateSplitV2DeterministicTxData(\n principalSplitParams,\n splitOwnerAddress,\n salt,\n );\n executeCalls.push({\n target: chainConfig.SPLIT_V2_FACTORY_CONTRACT.address,\n callData: principalSplitTxData,\n });\n }\n\n // Create OVM call data\n const ovmTxData = encodeCreateOVMTxData(\n ovmArgs.OVMOwnerAddress,\n ovmArgs.principalRecipient,\n ovmArgs.rewardRecipient,\n ovmArgs.principalThreshold * ETHER_TO_GWEI,\n );\n\n executeCalls.push({\n target: chainConfig.OVM_FACTORY_CONTRACT.address,\n callData: ovmTxData,\n });\n\n // Execute multicall3\n const executeMultiCalls = await multicall3(executeCalls, signer, chainId);\n\n // Extract addresses from events\n let ovmAddress: string | undefined;\n const logsCount = executeMultiCalls?.logs?.length || 0;\n\n if (logsCount === 2) {\n ovmAddress = '0x' + executeMultiCalls?.logs[1]?.topics[1]?.slice(26, 66);\n } else if (logsCount === 5) {\n ovmAddress = '0x' + executeMultiCalls?.logs[4]?.topics[1]?.slice(26, 66);\n } else {\n ovmAddress = '0x' + executeMultiCalls?.logs[7]?.topics[1]?.slice(26, 66);\n }\n if (!ovmAddress) {\n throw new Error(\n 'Failed to extract contract addresses from multicall3 events',\n );\n }\n\n return ovmAddress;\n } catch (error: any) {\n throw new Error(\n `Failed to deploy OVM and SplitV2: ${error.message ?? 'Deployment failed'}`,\n );\n }\n};\n\nconst encodeCreateOVMTxData = (\n OVMOwnerAddress: string,\n principalRecipient: string,\n rewardRecipient: string,\n principalThreshold: number,\n): string => {\n return ovmFactoryContractInterface.encodeFunctionData(\n 'createObolValidatorManager',\n [OVMOwnerAddress, principalRecipient, rewardRecipient, principalThreshold],\n );\n};\n\nconst encodeCreateSplitV2DeterministicTxData = (\n splitParams: {\n recipients: string[];\n allocations: number[];\n totalAllocation: number;\n distributionIncentive: number;\n },\n splitOwnerAddress: string,\n salt: `0x${string}`,\n): string => {\n // creatorAddress can be kept as default https://docs.splits.org/sdk/splits-v2#createsplit\n return splitV2FactoryInterface.encodeFunctionData(\n 'createSplitDeterministic',\n [splitParams, splitOwnerAddress, ZeroAddress, salt],\n );\n};\n\n// Helper function to safely get chain configuration\nconst getChainConfig = (chainId: number): ChainConfig => {\n const config = CHAIN_CONFIGURATION[chainId];\n if (!config) {\n throw new Error(`Chain configuration not found for chain ID ${chainId}`);\n }\n return config;\n};\n\n/**\n * Requests withdrawal from an OVM contract\n * @param ovmAddress - The address of the OVM contract\n * @param pubKeys - Array of validator public keys in bytes format\n * @param amounts - Array of withdrawal amounts in wei (uint64)\n * @param withdrawalFees - Total withdrawal fees in wei\n * @param signer - The signer to use for the transaction\n * @returns Promise that resolves to the transaction hash\n */\nexport const requestWithdrawalFromOVM = async ({\n ovmAddress,\n pubKeys,\n amounts,\n withdrawalFees,\n signer,\n}: {\n ovmAddress: string;\n pubKeys: string[];\n amounts: string[];\n withdrawalFees: string;\n signer: SignerType;\n}): Promise<{ txHash: string }> => {\n try {\n if (pubKeys.length === 0) {\n throw new Error('pubKeys array cannot be empty');\n }\n // Convert string amounts to bigint\n const bigintAmounts = amounts.map(amount => BigInt(amount));\n\n // Calculate maxFeePerWithdrawal as withdrawalFees / pubKeys.length\n const maxFeePerWithdrawal = BigInt(withdrawalFees) / BigInt(pubKeys.length);\n\n // Use ovmAddress as excessFeeRecipient\n const excessFeeRecipient = ovmAddress;\n\n const ovmContract = new Contract(ovmAddress, OVMContract.abi, signer);\n\n const tx = await ovmContract.withdraw(\n pubKeys,\n bigintAmounts,\n maxFeePerWithdrawal,\n excessFeeRecipient,\n {\n value: BigInt(withdrawalFees),\n },\n );\n const receipt = await tx.wait();\n\n return { txHash: receipt.hash };\n } catch (error: unknown) {\n const errorMessage =\n error instanceof Error ? error.message : 'Request withdrawal failed';\n throw new Error(`Failed to request withdrawal from OVM: ${errorMessage}`);\n }\n};\n\n/**\n * Deposits to OVM contract by sending individual transactions for each deposit.\n * @param ovmAddress - The address of the OVM contract\n * @param deposits - Array of deposit objects with all required parameters\n * @param signer - The signer to use for the transaction\n * @returns Promise that resolves to an array of transaction hashes\n */\nexport const depositOVM = async ({\n ovmAddress,\n deposits,\n signer,\n}: {\n ovmAddress: string;\n deposits: Array<{\n pubkey: string;\n withdrawal_credentials: string;\n signature: string;\n deposit_data_root: string;\n amount: string;\n }>;\n signer: SignerType;\n}): Promise<{ txHashes: string[] }> => {\n try {\n const ovmContract = new Contract(ovmAddress, OVMContract.abi, signer);\n const txHashes: string[] = [];\n\n // Process each deposit as a separate transaction\n // Multicall3 cannot be used because it doesn't have the DEPOSIT_ROLE\n for (const deposit of deposits) {\n const tx = await ovmContract.deposit(\n deposit.pubkey,\n deposit.withdrawal_credentials,\n deposit.signature,\n deposit.deposit_data_root,\n {\n value: BigInt(deposit.amount),\n },\n );\n\n const receipt = await tx.wait();\n if (receipt?.hash) {\n txHashes.push(receipt.hash as string);\n }\n }\n\n return { txHashes };\n } catch (error: unknown) {\n const errorMessage =\n error instanceof Error ? error.message : 'Deposit failed';\n throw new Error(`Failed to deposit to OVM: ${errorMessage}`);\n }\n};\n","export const OWRFactoryContract = {\n abi: [\n {\n inputs: [\n {\n internalType: 'string',\n name: '_ensName',\n type: 'string',\n },\n {\n internalType: 'address',\n name: '_ensReverseRegistrar',\n type: 'address',\n },\n {\n internalType: 'address',\n name: '_ensOwner',\n type: 'address',\n },\n ],\n stateMutability: 'nonpayable',\n type: 'constructor',\n },\n {\n inputs: [],\n name: 'Invalid__Recipients',\n type: 'error',\n },\n {\n inputs: [\n {\n internalType: 'uint256',\n name: 'threshold',\n type: 'uint256',\n },\n ],\n name: 'Invalid__ThresholdTooLarge',\n type: 'error',\n },\n {\n inputs: [],\n name: 'Invalid__ZeroThreshold',\n type: 'error',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'owr',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'address',\n name: 'recoveryAddress',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'address',\n name: 'principalRecipient',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'address',\n name: 'rewardRecipient',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'threshold',\n type: 'uint256',\n },\n ],\n name: 'CreateOWRecipient',\n type: 'event',\n },\n {\n inputs: [\n {\n internalType: 'address',\n name: 'recoveryAddress',\n type: 'address',\n },\n {\n internalType: 'address',\n name: 'principalRecipient',\n type: 'address',\n },\n {\n internalType: 'address',\n name: 'rewardRecipient',\n type: 'address',\n },\n {\n internalType: 'uint256',\n name: 'amountOfPrincipalStake',\n type: 'uint256',\n },\n ],\n name: 'createOWRecipient',\n outputs: [\n {\n internalType: 'contract OptimisticWithdrawalRecipient',\n name: 'owr',\n type: 'address',\n },\n ],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'owrImpl',\n outputs: [\n {\n internalType: 'contract OptimisticWithdrawalRecipient',\n name: '',\n type: 'address',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n ],\n};\n\nexport const OWRContract = {\n abi: [\n { inputs: [], stateMutability: 'nonpayable', type: 'constructor' },\n { inputs: [], name: 'InvalidDistribution_TooLarge', type: 'error' },\n {\n inputs: [],\n name: 'InvalidTokenRecovery_InvalidRecipient',\n type: 'error',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: 'uint256',\n name: 'principalPayout',\n type: 'uint256',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'rewardPayout',\n type: 'uint256',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'pullFlowFlag',\n type: 'uint256',\n },\n ],\n name: 'DistributeFunds',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: 'uint256',\n name: 'amount',\n type: 'uint256',\n },\n ],\n name: 'ReceiveETH',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: 'address',\n name: 'recoveryAddressToken',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'address',\n name: 'recipient',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'amount',\n type: 'uint256',\n },\n ],\n name: 'RecoverNonOWRecipientFunds',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: 'address',\n name: 'account',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'amount',\n type: 'uint256',\n },\n ],\n name: 'Withdrawal',\n type: 'event',\n },\n {\n inputs: [],\n name: 'claimedPrincipalFunds',\n outputs: [{ internalType: 'uint128', name: '', type: 'uint128' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'distributeFunds',\n outputs: [],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'distributeFundsPull',\n outputs: [],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'fundsPendingWithdrawal',\n outputs: [{ internalType: 'uint128', name: '', type: 'uint128' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'account', type: 'address' }],\n name: 'getPullBalance',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'getTranches',\n outputs: [\n {\n internalType: 'address',\n name: 'principalRecipient',\n type: 'address',\n },\n { internalType: 'address', name: 'rewardRecipient', type: 'address' },\n {\n internalType: 'uint256',\n name: 'amountOfPrincipalStake',\n type: 'uint256',\n },\n ],\n stateMutability: 'pure',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'nonOWRToken', type: 'address' },\n { internalType: 'address', name: 'recipient', type: 'address' },\n ],\n name: 'recoverFunds',\n outputs: [],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'recoveryAddress',\n outputs: [{ internalType: 'address', name: '', type: 'address' }],\n stateMutability: 'pure',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'account', type: 'address' }],\n name: 'withdraw',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n ],\n};\n","export const OVMFactoryContract = {\n abi: [\n {\n inputs: [\n {\n internalType: 'address',\n name: '_consolidationSystemContract',\n type: 'address',\n },\n {\n internalType: 'address',\n name: '_withdrawalSystemContract',\n type: 'address',\n },\n {\n internalType: 'address',\n name: '_depositSystemContract',\n type: 'address',\n },\n { internalType: 'string', name: '_ensName', type: 'string' },\n {\n internalType: 'address',\n name: '_ensReverseRegistrar',\n type: 'address',\n },\n { internalType: 'address', name: '_ensOwner', type: 'address' },\n ],\n stateMutability: 'nonpayable',\n type: 'constructor',\n },\n { inputs: [], name: 'Invalid_Owner', type: 'error' },\n { inputs: [], name: 'Invalid__Recipients', type: 'error' },\n { inputs: [], name: 'Invalid__ThresholdTooLarge', type: 'error' },\n { inputs: [], name: 'Invalid__ZeroThreshold', type: 'error' },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'ovm',\n type: 'address',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'owner',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'address',\n name: 'beneficiary',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'address',\n name: 'rewardRecipient',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'uint64',\n name: 'principalThreshold',\n type: 'uint64',\n },\n ],\n name: 'CreateObolValidatorManager',\n type: 'event',\n },\n {\n inputs: [],\n name: 'consolidationSystemContract',\n outputs: [{ internalType: 'address', name: '', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'owner', type: 'address' },\n { internalType: 'address', name: 'beneficiary', type: 'address' },\n { internalType: 'address', name: 'rewardRecipient', type: 'address' },\n { internalType: 'uint64', name: 'principalThreshold', type: 'uint64' },\n ],\n name: 'createObolValidatorManager',\n outputs: [\n {\n internalType: 'contract ObolValidatorManager',\n name: 'ovm',\n type: 'address',\n },\n ],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'depositSystemContract',\n outputs: [{ internalType: 'address', name: '', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'withdrawalSystemContract',\n outputs: [{ internalType: 'address', name: '', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n ],\n};\n\nexport const OVMContract = {\n abi: [\n {\n inputs: [\n {\n internalType: 'address',\n name: '_consolidationSystemContract',\n type: 'address',\n },\n {\n internalType: 'address',\n name: '_withdrawalSystemContract',\n type: 'address',\n },\n {\n internalType: 'address',\n name: '_depositSystemContract',\n type: 'address',\n },\n { internalType: 'address', name: '_owner', type: 'address' },\n { internalType: 'address', name: '_beneficiary', type: 'address' },\n { internalType: 'address', name: '_rewardRecipient', type: 'address' },\n { internalType: 'uint64', name: '_principalThreshold', type: 'uint64' },\n ],\n stateMutability: 'nonpayable',\n type: 'constructor',\n },\n { inputs: [], name: 'InvalidConsolidation_Failed', type: 'error' },\n { inputs: [], name: 'InvalidDistribution_TooLarge', type: 'error' },\n { inputs: [], name: 'InvalidRequest_NotEnoughFee', type: 'error' },\n { inputs: [], name: 'InvalidRequest_Params', type: 'error' },\n { inputs: [], name: 'InvalidRequest_SystemGetFee', type: 'error' },\n { inputs: [], name: 'InvalidWithdrawal_Failed', type: 'error' },\n { inputs: [], name: 'NewOwnerIsZeroAddress', type: 'error' },\n { inputs: [], name: 'NoHandoverRequest', type: 'error' },\n { inputs: [], name: 'Unauthorized', type: 'error' },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'newBeneficiary',\n type: 'address',\n },\n ],\n name: 'BeneficiaryUpdated',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: 'bytes',\n name: 'srcPubKey',\n type: 'bytes',\n },\n {\n indexed: false,\n internalType: 'bytes',\n name: 'targetPubKey',\n type: 'bytes',\n },\n {\n indexed: true,\n internalType: 'uint256',\n name: 'fee',\n type: 'uint256',\n },\n ],\n name: 'ConsolidationRequested',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: 'uint256',\n name: 'principalPayout',\n type: 'uint256',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'rewardPayout',\n type: 'uint256',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'pullOrPush',\n type: 'uint256',\n },\n ],\n name: 'DistributeFunds',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'pendingOwner',\n type: 'address',\n },\n ],\n name: 'OwnershipHandoverCanceled',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'pendingOwner',\n type: 'address',\n },\n ],\n name: 'OwnershipHandoverRequested',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'oldOwner',\n type: 'address',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'newOwner',\n type: 'address',\n },\n ],\n name: 'OwnershipTransferred',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: 'uint256',\n name: 'newPrincipalStakeAmount',\n type: 'uint256',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'oldPrincipalStakeAmount',\n type: 'uint256',\n },\n ],\n name: 'PrincipalStakeAmountUpdated',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'account',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'amount',\n type: 'uint256',\n },\n ],\n name: 'PullBalanceWithdrawn',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'nonOVMToken',\n type: 'address',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'recipient',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'amount',\n type: 'uint256',\n },\n ],\n name: 'RecoverNonOVMFunds',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'newRewardRecipient',\n type: 'address',\n },\n ],\n name: 'RewardRecipientUpdated',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'user',\n type: 'address',\n },\n {\n indexed: true,\n internalType: 'uint256',\n name: 'roles',\n type: 'uint256',\n },\n ],\n name: 'RolesUpdated',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'beneficiary',\n type: 'address',\n },\n {\n indexed: true,\n internalType: 'uint256',\n name: 'amount',\n type: 'uint256',\n },\n ],\n name: 'Swept',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'newBeneficiary',\n type: 'address',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'newOwner',\n type: 'address',\n },\n ],\n name: 'Transferred',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'excessFeeRecipient',\n type: 'address',\n },\n {\n indexed: true,\n internalType: 'uint256',\n name: 'excessFee',\n type: 'uint256',\n },\n ],\n name: 'UnsentExcessFee',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: 'bytes',\n name: 'pubKey',\n type: 'bytes',\n },\n {\n indexed: true,\n internalType: 'uint64',\n name: 'amount',\n type: 'uint64',\n },\n {\n indexed: true,\n internalType: 'uint256',\n name: 'fee',\n type: 'uint256',\n },\n ],\n name: 'WithdrawalRequested',\n type: 'event',\n },\n {\n inputs: [],\n name: 'CONSOLIDATION_ROLE',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'DEPOSIT_ROLE',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'RECOVER_FUNDS_ROLE',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'SET_BENEFICIARY_ROLE',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'SET_REWARD_ROLE',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'WITHDRAWAL_ROLE',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'amountOfPrincipalStake',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'cancelOwnershipHandover',\n outputs: [],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'pendingOwner', type: 'address' },\n ],\n name: 'completeOwnershipHandover',\n outputs: [],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [\n {\n components: [\n { internalType: 'bytes[]', name: 'srcPubKeys', type: 'bytes[]' },\n { internalType: 'bytes', name: 'targetPubKey', type: 'bytes' },\n ],\n internalType: 'struct IObolValidatorManager.ConsolidationRequest[]',\n name: 'requests',\n type: 'tuple[]',\n },\n {\n internalType: 'uint256',\n name: 'maxFeePerConsolidation',\n type: 'uint256',\n },\n {\n internalType: 'address',\n name: 'excessFeeRecipient',\n type: 'address',\n },\n ],\n name: 'consolidate',\n outputs: [],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'consolidationSystemContract',\n outputs: [{ internalType: 'address', name: '', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'bytes', name: 'pubkey', type: 'bytes' },\n {\n internalType: 'bytes',\n name: 'withdrawal_credentials',\n type: 'bytes',\n },\n { internalType: 'bytes', name: 'signature', type: 'bytes' },\n { internalType: 'bytes32', name: 'deposit_data_root', type: 'bytes32' },\n ],\n name: 'deposit',\n outputs: [],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'depositSystemContract',\n outputs: [{ internalType: 'address', name: '', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'distributeFunds',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'distributeFundsPull',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'fundsPendingWithdrawal',\n outputs: [{ internalType: 'uint128', name: '', type: 'uint128' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'getBeneficiary',\n outputs: [{ internalType: 'address', name: '', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'account', type: 'address' }],\n name: 'getPullBalance',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'user', type: 'address' },\n { internalType: 'uint256', name: 'roles', type: 'uint256' },\n ],\n name: 'grantRoles',\n outputs: [],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'user', type: 'address' },\n { internalType: 'uint256', name: 'roles', type: 'uint256' },\n ],\n name: 'hasAllRoles',\n outputs: [{ internalType: 'bool', name: '', type: 'bool' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'user', type: 'address' },\n { internalType: 'uint256', name: 'roles', type: 'uint256' },\n ],\n name: 'hasAnyRole',\n outputs: [{ internalType: 'bool', name: '', type: 'bool' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'owner',\n outputs: [{ internalType: 'address', name: 'result', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'pendingOwner', type: 'address' },\n ],\n name: 'ownershipHandoverExpiresAt',\n outputs: [{ internalType: 'uint256', name: 'result', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'principalRecipient',\n outputs: [{ internalType: 'address', name: '', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'principalThreshold',\n outputs: [{ internalType: 'uint64', name: '', type: 'uint64' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'nonOVMToken', type: 'address' },\n { internalType: 'address', name: 'recipient', type: 'address' },\n ],\n name: 'recoverFunds',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'renounceOwnership',\n outputs: [],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'uint256', name: 'roles', type: 'uint256' }],\n name: 'renounceRoles',\n outputs: [],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'requestOwnershipHandover',\n outputs: [],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'user', type: 'address' },\n { internalType: 'uint256', name: 'roles', type: 'uint256' },\n ],\n name: 'revokeRoles',\n outputs: [],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'rewardRecipient',\n outputs: [{ internalType: 'address', name: '', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'user', type: 'address' }],\n name: 'rolesOf',\n outputs: [{ internalType: 'uint256', name: 'roles', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'uint256', name: 'newAmount', type: 'uint256' }],\n name: 'setAmountOfPrincipalStake',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'newBeneficiary', type: 'address' },\n ],\n name: 'setBeneficiary',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n {\n internalType: 'address',\n name: 'newRewardRecipient',\n type: 'address',\n },\n ],\n name: 'setRewardRecipient',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'beneficiary', type: 'address' },\n { internalType: 'uint256', name: 'amount', type: 'uint256' },\n ],\n name: 'sweep',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: '', type: 'address' },\n { internalType: 'uint256', name: '', type: 'uint256' },\n ],\n name: 'sweepToBeneficiaryContract',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'newBeneficiary', type: 'address' },\n { internalType: 'address', name: 'newOwner', type: 'address' },\n ],\n name: 'transfer',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'newOwner', type: 'address' }],\n name: 'transferOwnership',\n outputs: [],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'version',\n outputs: [{ internalType: 'string', name: '', type: 'string' }],\n stateMutability: 'pure',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'bytes[]', name: 'pubKeys', type: 'bytes[]' },\n { internalType: 'uint64[]', name: 'amounts', type: 'uint64[]' },\n {\n internalType: 'uint256',\n name: 'maxFeePerWithdrawal',\n type: 'uint256',\n },\n {\n internalType: 'address',\n name: 'excessFeeRecipient',\n type: 'address',\n },\n ],\n name: 'withdraw',\n outputs: [],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'account', type: 'address' }],\n name: 'withdrawPullBalance',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'withdrawalSystemContract',\n outputs: [{ internalType: 'address', name: '', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n { stateMutability: 'payable', type: 'receive' },\n ],\n};\n","export const splitMainEthereumAbi = [\n { inputs: [], stateMutability: 'nonpayable', type: 'constructor' },\n { inputs: [], name: 'Create2Error', type: 'error' },\n { inputs: [], name: 'CreateError', type: 'error' },\n {\n inputs: [\n { internalType: 'address', name: 'newController', type: 'address' },\n ],\n name: 'InvalidNewController',\n type: 'error',\n },\n {\n inputs: [\n { internalType: 'uint256', name: 'accountsLength', type: 'uint256' },\n { internalType: 'uint256', name: 'allocationsLength', type: 'uint256' },\n ],\n name: 'InvalidSplit__AccountsAndAllocationsMismatch',\n type: 'error',\n },\n {\n inputs: [{ internalType: 'uint256', name: 'index', type: 'uint256' }],\n name: 'InvalidSplit__AccountsOutOfOrder',\n type: 'error',\n },\n {\n inputs: [{ internalType: 'uint256', name: 'index', type: 'uint256' }],\n name: 'InvalidSplit__AllocationMustBePositive',\n type: 'error',\n },\n {\n inputs: [\n { internalType: 'uint32', name: 'allocationsSum', type: 'uint32' },\n ],\n name: 'InvalidSplit__InvalidAllocationsSum',\n type: 'error',\n },\n {\n inputs: [\n { internalType: 'uint32', name: 'distributorFee', type: 'uint32' },\n ],\n name: 'InvalidSplit__InvalidDistributorFee',\n type: 'error',\n },\n {\n inputs: [{ internalType: 'bytes32', name: 'hash', type: 'bytes32' }],\n name: 'InvalidSplit__InvalidHash',\n type: 'error',\n },\n {\n inputs: [\n { internalType: 'uint256', name: 'accountsLength', type: 'uint256' },\n ],\n name: 'InvalidSplit__TooFewAccounts',\n type: 'error',\n },\n {\n inputs: [{ internalType: 'address', name: 'sender', type: 'address' }],\n name: 'Unauthorized',\n type: 'error',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'split',\n type: 'address',\n },\n ],\n name: 'CancelControlTransfer',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'split',\n type: 'address',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'previousController',\n type: 'address',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'newController',\n type: 'address',\n },\n ],\n name: 'ControlTransfer',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'split',\n type: 'address',\n },\n ],\n name: 'CreateSplit',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'split',\n type: 'address',\n },\n {\n indexed: true,\n internalType: 'contract ERC20',\n name: 'token',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'amount',\n type: 'uint256',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'distributorAddress',\n type: 'address',\n },\n ],\n name: 'DistributeERC20',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'split',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'amount',\n type: 'uint256',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'distributorAddress',\n type: 'address',\n },\n ],\n name: 'DistributeETH',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'split',\n type: 'address',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'newPotentialController',\n type: 'address',\n },\n ],\n name: 'InitiateControlTransfer',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'split',\n type: 'address',\n },\n ],\n name: 'UpdateSplit',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'account',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'ethAmount',\n type: 'uint256',\n },\n {\n indexed: false,\n internalType: 'contract ERC20[]',\n name: 'tokens',\n type: 'address[]',\n },\n {\n indexed: false,\n internalType: 'uint256[]',\n name: 'tokenAmounts',\n type: 'uint256[]',\n },\n ],\n name: 'Withdrawal',\n type: 'event',\n },\n {\n inputs: [],\n name: 'PERCENTAGE_SCALE',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'split', type: 'address' }],\n name: 'acceptControl',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'split', type: 'address' }],\n name: 'cancelControlTransfer',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address[]', name: 'accounts', type: 'address[]' },\n {\n internalType: 'uint32[]',\n name: 'percentAllocations',\n type: 'uint32[]',\n },\n { internalType: 'uint32', name: 'distributorFee', type: 'uint32' },\n { internalType: 'address', name: 'controller', type: 'address' },\n ],\n name: 'createSplit',\n outputs: [{ internalType: 'address', name: 'split', type: 'address' }],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'split', type: 'address' },\n { internalType: 'contract ERC20', name: 'token', type: 'address' },\n { internalType: 'address[]', name: 'accounts', type: 'address[]' },\n {\n internalType: 'uint32[]',\n name: 'percentAllocations',\n type: 'uint32[]',\n },\n { internalType: 'uint32', name: 'distributorFee', type: 'uint32' },\n { internalType: 'address', name: 'distributorAddress', type: 'address' },\n ],\n name: 'distributeERC20',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'split', type: 'address' },\n { internalType: 'address[]', name: 'accounts', type: 'address[]' },\n {\n internalType: 'uint32[]',\n name: 'percentAllocations',\n type: 'uint32[]',\n },\n { internalType: 'uint32', name: 'distributorFee', type: 'uint32' },\n { internalType: 'address', name: 'distributorAddress', type: 'address' },\n ],\n name: 'distributeETH',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'split', type: 'address' }],\n name: 'getController',\n outputs: [{ internalType: 'address', name: '', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'account', type: 'address' },\n { internalType: 'contract ERC20', name: 'token', type: 'address' },\n ],\n name: 'getERC20Balance',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'account', type: 'address' }],\n name: 'getETHBalance',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'split', type: 'address' }],\n name: 'getHash',\n outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'split', type: 'address' }],\n name: 'getNewPotentialController',\n outputs: [{ internalType: 'address', name: '', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'split', type: 'address' }],\n name: 'makeSplitImmutable',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address[]', name: 'accounts', type: 'address[]' },\n {\n internalType: 'uint32[]',\n name: 'percentAllocations',\n type: 'uint32[]',\n },\n { internalType: 'uint32', name: 'distributorFee', type: 'uint32' },\n ],\n name: 'predictImmutableSplitAddress',\n outputs: [{ internalType: 'address', name: 'split', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'split', type: 'address' },\n { internalType: 'address', name: 'newController', type: 'address' },\n ],\n name: 'transferControl',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'split', type: 'address' },\n { internalType: 'contract ERC20', name: 'token', type: 'address' },\n { internalType: 'address[]', name: 'accounts', type: 'address[]' },\n {\n internalType: 'uint32[]',\n name: 'percentAllocations',\n type: 'uint32[]',\n },\n { internalType: 'uint32', name: 'distributorFee', type: 'uint32' },\n { internalType: 'address', name: 'distributorAddress', type: 'address' },\n ],\n name: 'updateAndDistributeERC20',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'split', type: 'address' },\n { internalType: 'address[]', name: 'accounts', type: 'address[]' },\n {\n internalType: 'uint32[]',\n name: 'percentAllocations',\n type: 'uint32[]',\n },\n { internalType: 'uint32', name: 'distributorFee', type: 'uint32' },\n { internalType: 'address', name: 'distributorAddress', type: 'address' },\n ],\n name: 'updateAndDistributeETH',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'split', type: 'address' },\n { internalType: 'address[]', name: 'accounts', type: 'address[]' },\n {\n internalType: 'uint32[]',\n name: 'percentAllocations',\n type: 'uint32[]',\n },\n { internalType: 'uint32', name: 'distributorFee', type: 'uint32' },\n ],\n name: 'updateSplit',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'walletImplementation',\n outputs: [{ internalType: 'address', name: '', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'account', type: 'address' },\n { internalType: 'uint256', name: 'withdrawETH', type: 'uint256' },\n { internalType: 'contract ERC20[]', name: 'tokens', type: 'address[]' },\n ],\n name: 'withdraw',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n] as const;\n\nexport const splitMainPolygonAbi = [\n { inputs: [], stateMutability: 'nonpayable', type: 'constructor' },\n { inputs: [], name: 'Create2Error', type: 'error' },\n { inputs: [], name: 'CreateError', type: 'error' },\n {\n inputs: [\n { internalType: 'address', name: 'newController', type: 'address' },\n ],\n name: 'InvalidNewController',\n type: 'error',\n },\n {\n inputs: [\n { internalType: 'uint256', name: 'accountsLength', type: 'uint256' },\n { internalType: 'uint256', name: 'allocationsLength', type: 'uint256' },\n ],\n name: 'InvalidSplit__AccountsAndAllocationsMismatch',\n type: 'error',\n },\n {\n inputs: [{ internalType: 'uint256', name: 'index', type: 'uint256' }],\n name: 'InvalidSplit__AccountsOutOfOrder',\n type: 'error',\n },\n {\n inputs: [{ internalType: 'uint256', name: 'index', type: 'uint256' }],\n name: 'InvalidSplit__AllocationMustBePositive',\n type: 'error',\n },\n {\n inputs: [\n { internalType: 'uint32', name: 'allocationsSum', type: 'uint32' },\n ],\n name: 'InvalidSplit__InvalidAllocationsSum',\n type: 'error',\n },\n {\n inputs: [\n { internalType: 'uint32', name: 'distributorFee', type: 'uint32' },\n ],\n name: 'InvalidSplit__InvalidDistributorFee',\n type: 'error',\n },\n {\n inputs: [{ internalType: 'bytes32', name: 'hash', type: 'bytes32' }],\n name: 'InvalidSplit__InvalidHash',\n type: 'error',\n },\n {\n inputs: [\n { internalType: 'uint256', name: 'accountsLength', type: 'uint256' },\n ],\n name: 'InvalidSplit__TooFewAccounts',\n type: 'error',\n },\n {\n inputs: [{ internalType: 'address', name: 'sender', type: 'address' }],\n name: 'Unauthorized',\n type: 'error',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'split',\n type: 'address',\n },\n ],\n name: 'CancelControlTransfer',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'split',\n type: 'address',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'previousController',\n type: 'address',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'newController',\n type: 'address',\n },\n ],\n name: 'ControlTransfer',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'split',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'address[]',\n name: 'accounts',\n type: 'address[]',\n },\n {\n indexed: false,\n internalType: 'uint32[]',\n name: 'percentAllocations',\n type: 'uint32[]',\n },\n {\n indexed: false,\n internalType: 'uint32',\n name: 'distributorFee',\n type: 'uint32',\n },\n {\n indexed: false,\n internalType: 'address',\n name: 'controller',\n type: 'address',\n },\n ],\n name: 'CreateSplit',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'split',\n type: 'address',\n },\n {\n indexed: true,\n internalType: 'contract ERC20',\n name: 'token',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'amount',\n type: 'uint256',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'distributorAddress',\n type: 'address',\n },\n ],\n name: 'DistributeERC20',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'split',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'amount',\n type: 'uint256',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'distributorAddress',\n type: 'address',\n },\n ],\n name: 'DistributeETH',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'split',\n type: 'address',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'newPotentialController',\n type: 'address',\n },\n ],\n name: 'InitiateControlTransfer',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'split',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'address[]',\n name: 'accounts',\n type: 'address[]',\n },\n {\n indexed: false,\n internalType: 'uint32[]',\n name: 'percentAllocations',\n type: 'uint32[]',\n },\n {\n indexed: false,\n internalType: 'uint32',\n name: 'distributorFee',\n type: 'uint32',\n },\n ],\n name: 'UpdateSplit',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'account',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'ethAmount',\n type: 'uint256',\n },\n {\n indexed: false,\n internalType: 'contract ERC20[]',\n name: 'tokens',\n type: 'address[]',\n },\n {\n indexed: false,\n internalType: 'uint256[]',\n name: 'tokenAmounts',\n type: 'uint256[]',\n },\n ],\n name: 'Withdrawal',\n type: 'event',\n },\n {\n inputs: [],\n name: 'PERCENTAGE_SCALE',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'split', type: 'address' }],\n name: 'acceptControl',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'split', type: 'address' }],\n name: 'cancelControlTransfer',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address[]', name: 'accounts', type: 'address[]' },\n {\n internalType: 'uint32[]',\n name: 'percentAllocations',\n type: 'uint32[]',\n },\n { internalType: 'uint32', name: 'distributorFee', type: 'uint32' },\n { internalType: 'address', name: 'controller', type: 'address' },\n ],\n name: 'createSplit',\n outputs: [{ internalType: 'address', name: 'split', type: 'address' }],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'split', type: 'address' },\n { internalType: 'contract ERC20', name: 'token', type: 'address' },\n { internalType: 'address[]', name: 'accounts', type: 'address[]' },\n {\n internalType: 'uint32[]',\n name: 'percentAllocations',\n type: 'uint32[]',\n },\n { internalType: 'uint32', name: 'distributorFee', type: 'uint32' },\n { internalType: 'address', name: 'distributorAddress', type: 'address' },\n ],\n name: 'distributeERC20',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'split', type: 'address' },\n { internalType: 'address[]', name: 'accounts', type: 'address[]' },\n {\n internalType: 'uint32[]',\n name: 'percentAllocations',\n type: 'uint32[]',\n },\n { internalType: 'uint32', name: 'distributorFee', type: 'uint32' },\n { internalType: 'address', name: 'distributorAddress', type: 'address' },\n ],\n name: 'distributeETH',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'split', type: 'address' }],\n name: 'getController',\n outputs: [{ internalType: 'address', name: '', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'account', type: 'address' },\n { internalType: 'contract ERC20', name: 'token', type: 'address' },\n ],\n name: 'getERC20Balance',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'account', type: 'address' }],\n name: 'getETHBalance',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'split', type: 'address' }],\n name: 'getHash',\n outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'split', type: 'address' }],\n name: 'getNewPotentialController',\n outputs: [{ internalType: 'address', name: '', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'split', type: 'address' }],\n name: 'makeSplitImmutable',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address[]', name: 'accounts', type: 'address[]' },\n {\n internalType: 'uint32[]',\n name: 'percentAllocations',\n type: 'uint32[]',\n },\n { internalType: 'uint32', name: 'distributorFee', type: 'uint32' },\n ],\n name: 'predictImmutableSplitAddress',\n outputs: [{ internalType: 'address', name: 'split', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'split', type: 'address' },\n { internalType: 'address', name: 'newController', type: 'address' },\n ],\n name: 'transferControl',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'split', type: 'address' },\n { internalType: 'contract ERC20', name: 'token', type: 'address' },\n { internalType: 'address[]', name: 'accounts', type: 'address[]' },\n {\n internalType: 'uint32[]',\n name: 'percentAllocations',\n type: 'uint32[]',\n },\n { internalType: 'uint32', name: 'distributorFee', type: 'uint32' },\n { internalType: 'address', name: 'distributorAddress', type: 'address' },\n ],\n name: 'updateAndDistributeERC20',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'split', type: 'address' },\n { internalType: 'address[]', name: 'accounts', type: 'address[]' },\n {\n internalType: 'uint32[]',\n name: 'percentAllocations',\n type: 'uint32[]',\n },\n { internalType: 'uint32', name: 'distributorFee', type: 'uint32' },\n { internalType: 'address', name: 'distributorAddress', type: 'address' },\n ],\n name: 'updateAndDistributeETH',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'split', type: 'address' },\n { internalType: 'address[]', name: 'accounts', type: 'address[]' },\n {\n internalType: 'uint32[]',\n name: 'percentAllocations',\n type: 'uint32[]',\n },\n { internalType: 'uint32', name: 'distributorFee', type: 'uint32' },\n ],\n name: 'updateSplit',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'walletImplementation',\n outputs: [{ internalType: 'address', name: '', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'account', type: 'address' },\n { internalType: 'uint256', name: 'withdrawETH', type: 'uint256' },\n { internalType: 'contract ERC20[]', name: 'tokens', type: 'address[]' },\n ],\n name: 'withdraw',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n] as const;\n","export const splitV2FactoryAbi = [\n {\n inputs: [\n {\n internalType: 'address',\n name: '_splitsWarehouse',\n type: 'address',\n },\n ],\n stateMutability: 'nonpayable',\n type: 'constructor',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'split',\n type: 'address',\n },\n {\n components: [\n {\n internalType: 'address[]',\n name: 'recipients',\n type: 'address[]',\n },\n {\n internalType: 'uint256[]',\n name: 'allocations',\n type: 'uint256[]',\n },\n {\n internalType: 'uint256',\n name: 'totalAllocation',\n type: 'uint256',\n },\n {\n internalType: 'uint16',\n name: 'distributionIncentive',\n type: 'uint16',\n },\n ],\n indexed: false,\n internalType: 'struct SplitV2Lib.Split',\n name: 'splitParams',\n type: 'tuple',\n },\n {\n indexed: false,\n internalType: 'address',\n name: 'owner',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'address',\n name: 'creator',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'bytes32',\n name: 'salt',\n type: 'bytes32',\n },\n ],\n name: 'SplitCreated',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'split',\n type: 'address',\n },\n {\n components: [\n {\n internalType: 'address[]',\n name: 'recipients',\n type: 'address[]',\n },\n {\n internalType: 'uint256[]',\n name: 'allocations',\n type: 'uint256[]',\n },\n {\n internalType: 'uint256',\n name: 'totalAllocation',\n type: 'uint256',\n },\n {\n internalType: 'uint16',\n name: 'distributionIncentive',\n type: 'uint16',\n },\n ],\n indexed: false,\n internalType: 'struct SplitV2Lib.Split',\n name: 'splitParams',\n type: 'tuple',\n },\n {\n indexed: false,\n internalType: 'address',\n name: 'owner',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'address',\n name: 'creator',\n type: 'address',\n },\n ],\n name: 'SplitCreated',\n type: 'event',\n },\n {\n inputs: [],\n name: 'SPLIT_WALLET_IMPLEMENTATION',\n outputs: [\n {\n internalType: 'address',\n name: '',\n type: 'address',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n {\n components: [\n {\n internalType: 'address[]',\n name: 'recipients',\n type: 'address[]',\n },\n {\n internalType: 'uint256[]',\n name: 'allocations',\n type: 'uint256[]',\n },\n {\n internalType: 'uint256',\n name: 'totalAllocation',\n type: 'uint256',\n },\n {\n internalType: 'uint16',\n name: 'distributionIncentive',\n type: 'uint16',\n },\n ],\n internalType: 'struct SplitV2Lib.Split',\n name: '_splitParams',\n type: 'tuple',\n },\n {\n internalType: 'address',\n name: '_owner',\n type: 'address',\n },\n {\n internalType: 'address',\n name: '_creator',\n type: 'address',\n },\n ],\n name: 'createSplit',\n outputs: [\n {\n internalType: 'address',\n name: 'split',\n type: 'address',\n },\n ],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n {\n components: [\n {\n internalType: 'address[]',\n name: 'recipients',\n type: 'address[]',\n },\n {\n internalType: 'uint256[]',\n name: 'allocations',\n type: 'uint256[]',\n },\n {\n internalType: 'uint256',\n name: 'totalAllocation',\n type: 'uint256',\n },\n {\n internalType: 'uint16',\n name: 'distributionIncentive',\n type: 'uint16',\n },\n ],\n internalType: 'struct SplitV2Lib.Split',\n name: '_splitParams',\n type: 'tuple',\n },\n {\n internalType: 'address',\n name: '_owner',\n type: 'address',\n },\n {\n internalType: 'address',\n name: '_creator',\n type: 'address',\n },\n {\n internalType: 'bytes32',\n name: '_salt',\n type: 'bytes32',\n },\n ],\n name: 'createSplitDeterministic',\n outputs: [\n {\n internalType: 'address',\n name: 'split',\n type: 'address',\n },\n ],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n {\n components: [\n {\n internalType: 'address[]',\n name: 'recipients',\n type: 'address[]',\n },\n {\n internalType: 'uint256[]',\n name: 'allocations',\n type: 'uint256[]',\n },\n {\n internalType: 'uint256',\n name: 'totalAllocation',\n type: 'uint256',\n },\n {\n internalType: 'uint16',\n name: 'distributionIncentive',\n type: 'uint16',\n },\n ],\n internalType: 'struct SplitV2Lib.Split',\n name: '_splitParams',\n type: 'tuple',\n },\n {\n internalType: 'address',\n name: '_owner',\n type: 'address',\n },\n {\n internalType: 'bytes32',\n name: '_salt',\n type: 'bytes32',\n },\n ],\n name: 'isDeployed',\n outputs: [\n {\n internalType: 'address',\n name: 'split',\n type: 'address',\n },\n {\n internalType: 'bool',\n name: 'exists',\n type: 'bool',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n {\n internalType: 'bytes32',\n name: '_hash',\n type: 'bytes32',\n },\n ],\n name: 'nonces',\n outputs: [\n {\n internalType: 'uint256',\n name: '',\n type: 'uint256',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n {\n components: [\n {\n internalType: 'address[]',\n name: 'recipients',\n type: 'address[]',\n },\n {\n internalType: 'uint256[]',\n name: 'allocations',\n type: 'uint256[]',\n },\n {\n internalType: 'uint256',\n name: 'totalAllocation',\n type: 'uint256',\n },\n {\n internalType: 'uint16',\n name: 'distributionIncentive',\n type: 'uint16',\n },\n ],\n internalType: 'struct SplitV2Lib.Split',\n name: '_splitParams',\n type: 'tuple',\n },\n {\n internalType: 'address',\n name: '_owner',\n type: 'address',\n },\n ],\n name: 'predictDeterministicAddress',\n outputs: [\n {\n internalType: 'address',\n name: '',\n type: 'address',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n {\n components: [\n {\n internalType: 'address[]',\n name: 'recipients',\n type: 'address[]',\n },\n {\n internalType: 'uint256[]',\n name: 'allocations',\n type: 'uint256[]',\n },\n {\n internalType: 'uint256',\n name: 'totalAllocation',\n type: 'uint256',\n },\n {\n internalType: 'uint16',\n name: 'distributionIncentive',\n type: 'uint16',\n },\n ],\n internalType: 'struct SplitV2Lib.Split',\n name: '_splitParams',\n type: 'tuple',\n },\n {\n internalType: 'address',\n name: '_owner',\n type: 'address',\n },\n {\n internalType: 'bytes32',\n name: '_salt',\n type: 'bytes32',\n },\n ],\n name: 'predictDeterministicAddress',\n outputs: [\n {\n internalType: 'address',\n name: '',\n type: 'address',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n];\n","export const MultiCall3Contract = {\n abi: [\n {\n inputs: [\n {\n components: [\n { internalType: 'address', name: 'target', type: 'address' },\n { internalType: 'bytes', name: 'callData', type: 'bytes' },\n ],\n internalType: 'struct Multicall3.Call[]',\n name: 'calls',\n type: 'tuple[]',\n },\n ],\n name: 'aggregate',\n outputs: [\n { internalType: 'uint256', name: 'blockNumber', type: 'uint256' },\n { internalType: 'bytes[]', name: 'returnData', type: 'bytes[]' },\n ],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [\n {\n components: [\n { internalType: 'address', name: 'target', type: 'address' },\n { internalType: 'bool', name: 'allowFailure', type: 'bool' },\n { internalType: 'bytes', name: 'callData', type: 'bytes' },\n ],\n internalType: 'struct Multicall3.Call3[]',\n name: 'calls',\n type: 'tuple[]',\n },\n ],\n name: 'aggregate3',\n outputs: [\n {\n components: [\n { internalType: 'bool', name: 'success', type: 'bool' },\n { internalType: 'bytes', name: 'returnData', type: 'bytes' },\n ],\n internalType: 'struct Multicall3.Result[]',\n name: 'returnData',\n type: 'tuple[]',\n },\n ],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [\n {\n components: [\n { internalType: 'address', name: 'target', type: 'address' },\n { internalType: 'bool', name: 'allowFailure', type: 'bool' },\n { internalType: 'uint256', name: 'value', type: 'uint256' },\n { internalType: 'bytes', name: 'callData', type: 'bytes' },\n ],\n internalType: 'struct Multicall3.Call3Value[]',\n name: 'calls',\n type: 'tuple[]',\n },\n ],\n name: 'aggregate3Value',\n outputs: [\n {\n components: [\n { internalType: 'bool', name: 'success', type: 'bool' },\n { internalType: 'bytes', name: 'returnData', type: 'bytes' },\n ],\n internalType: 'struct Multicall3.Result[]',\n name: 'returnData',\n type: 'tuple[]',\n },\n ],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [\n {\n components: [\n { internalType: 'address', name: 'target', type: 'address' },\n { internalType: 'bytes', name: 'callData', type: 'bytes' },\n ],\n internalType: 'struct Multicall3.Call[]',\n name: 'calls',\n type: 'tuple[]',\n },\n ],\n name: 'blockAndAggregate',\n outputs: [\n { internalType: 'uint256', name: 'blockNumber', type: 'uint256' },\n { internalType: 'bytes32', name: 'blockHash', type: 'bytes32' },\n {\n components: [\n { internalType: 'bool', name: 'success', type: 'bool' },\n { internalType: 'bytes', name: 'returnData', type: 'bytes' },\n ],\n internalType: 'struct Multicall3.Result[]',\n name: 'returnData',\n type: 'tuple[]',\n },\n ],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'getBasefee',\n outputs: [{ internalType: 'uint256', name: 'basefee', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'uint256', name: 'blockNumber', type: 'uint256' },\n ],\n name: 'getBlockHash',\n outputs: [\n { internalType: 'bytes32', name: 'blockHash', type: 'bytes32' },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'getBlockNumber',\n outputs: [\n { internalType: 'uint256', name: 'blockNumber', type: 'uint256' },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'getChainId',\n outputs: [{ internalType: 'uint256', name: 'chainid', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'getCurrentBlockCoinbase',\n outputs: [{ internalType: 'address', name: 'coinbase', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'getCurrentBlockDifficulty',\n outputs: [\n { internalType: 'uint256', name: 'difficulty', type: 'uint256' },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'getCurrentBlockGasLimit',\n outputs: [{ internalType: 'uint256', name: 'gaslimit', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'getCurrentBlockTimestamp',\n outputs: [\n { internalType: 'uint256', name: 'timestamp', type: 'uint256' },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'addr', type: 'address' }],\n name: 'getEthBalance',\n outputs: [{ internalType: 'uint256', name: 'balance', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'getLastBlockHash',\n outputs: [\n { internalType: 'bytes32', name: 'blockHash', type: 'bytes32' },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'bool', name: 'requireSuccess', type: 'bool' },\n {\n components: [\n { internalType: 'address', name: 'target', type: 'address' },\n { internalType: 'bytes', name: 'callData', type: 'bytes' },\n ],\n internalType: 'struct Multicall3.Call[]',\n name: 'calls',\n type: 'tuple[]',\n },\n ],\n name: 'tryAggregate',\n outputs: [\n {\n components: [\n { internalType: 'bool', name: 'success', type: 'bool' },\n { internalType: 'bytes', name: 'returnData', type: 'bytes' },\n ],\n internalType: 'struct Multicall3.Result[]',\n name: 'returnData',\n type: 'tuple[]',\n },\n ],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'bool', name: 'requireSuccess', type: 'bool' },\n {\n components: [\n { internalType: 'address', name: 'target', type: 'address' },\n { internalType: 'bytes', name: 'callData', type: 'bytes' },\n ],\n internalType: 'struct Multicall3.Call[]',\n name: 'calls',\n type: 'tuple[]',\n },\n ],\n name: 'tryBlockAndAggregate',\n outputs: [\n { internalType: 'uint256', name: 'blockNumber', type: 'uint256' },\n { internalType: 'bytes32', name: 'blockHash', type: 'bytes32' },\n {\n components: [\n { internalType: 'bool', name: 'success', type: 'bool' },\n { internalType: 'bytes', name: 'returnData', type: 'bytes' },\n ],\n internalType: 'struct Multicall3.Result[]',\n name: 'returnData',\n type: 'tuple[]',\n },\n ],\n stateMutability: 'payable',\n type: 'function',\n },\n ],\n};\n","import {\n type ProviderType,\n type SignerType,\n type ETH_ADDRESS,\n} from '../types.js';\nimport { Contract } from 'ethers';\nimport { MerkleDistributorABI } from '../abi/MerkleDistributorWithDeadline.js';\n\nexport const claimIncentivesFromMerkleDistributor = async (incentivesData: {\n signer: SignerType;\n contractAddress: ETH_ADDRESS;\n index: number;\n operatorAddress: ETH_ADDRESS;\n amount: string;\n merkleProof: string[];\n}): Promise<{ txHash: string }> => {\n try {\n const contract = new Contract(\n incentivesData.contractAddress,\n MerkleDistributorABI.abi,\n incentivesData.signer,\n );\n\n const tx = await contract.claim(\n BigInt(incentivesData.index),\n incentivesData.operatorAddress,\n BigInt(incentivesData.amount),\n incentivesData.merkleProof,\n );\n\n const receipt = await tx.wait();\n\n return { txHash: receipt.hash };\n } catch (error: any) {\n console.log('Error claiming incentives:', error);\n throw new Error(`Failed to claim incentives: ${error.message}`);\n }\n};\n\nexport const isClaimedFromMerkleDistributor = async (\n contractAddress: ETH_ADDRESS,\n index: number,\n provider: ProviderType | undefined | null,\n): Promise<boolean> => {\n try {\n const contract = new Contract(\n contractAddress,\n MerkleDistributorABI.abi,\n provider,\n );\n\n const claimed = await contract.isClaimed(BigInt(index));\n\n return claimed;\n } catch (error: any) {\n console.log('Error checking claim status:', error);\n throw new Error(`Failed to check claim status: ${error.message}`);\n }\n};\n","export const MerkleDistributorABI = {\n abi: [\n {\n inputs: [\n { internalType: 'address', name: 'token_', type: 'address' },\n { internalType: 'bytes32', name: 'merkleRoot_', type: 'bytes32' },\n ],\n stateMutability: 'nonpayable',\n type: 'constructor',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: 'uint256',\n name: 'index',\n type: 'uint256',\n },\n {\n indexed: false,\n internalType: 'address',\n name: 'account',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'amount',\n type: 'uint256',\n },\n ],\n name: 'Claimed',\n type: 'event',\n },\n {\n inputs: [\n { internalType: 'uint256', name: 'index', type: 'uint256' },\n { internalType: 'address', name: 'account', type: 'address' },\n { internalType: 'uint256', name: 'amount', type: 'uint256' },\n { internalType: 'bytes32[]', name: 'merkleProof', type: 'bytes32[]' },\n ],\n name: 'claim',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'uint256', name: 'index', type: 'uint256' }],\n name: 'isClaimed',\n outputs: [{ internalType: 'bool', name: '', type: 'bool' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'merkleRoot',\n outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'token',\n outputs: [{ internalType: 'address', name: '', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n ] as const,\n};\n","import { isContractAvailable } from '../utils.js';\nimport {\n type ClaimableIncentives,\n type ETH_ADDRESS,\n FORK_NAMES,\n type ProviderType,\n type SignerType,\n type ClaimIncentivesResponse,\n} from '../types.js';\nimport {\n claimIncentivesFromMerkleDistributor,\n isClaimedFromMerkleDistributor,\n} from './incentiveHelpers.js';\nimport { DEFAULT_BASE_VERSION } from '../constants.js';\nimport { SignerRequiredError } from '../errors.js';\n\n/**\n * Manages Obol incentive rewards – querying eligibility and claiming from\n * on-chain Merkle Distributor contracts.\n *\n * Do not instantiate directly; access via `client.incentives`.\n *\n * @example\n * ```typescript\n * const client = new Client({ chainId: 560048 }, signer);\n *\n * // Check claimable incentives\n * const data = await client.incentives.getIncentivesByAddress(\"0xOperator...\");\n *\n * // Check if already claimed\n * const claimed = await client.incentives.isClaimed(data.contract_address, data.index);\n *\n * // Claim (sends on-chain transaction)\n * const { txHash } = await client.incentives.claimIncentives(\"0xOperator...\");\n * ```\n */\nexport class Incentives {\n private readonly signer: SignerType | undefined;\n public readonly chainId: number;\n private readonly request: (\n endpoint: string,\n options?: RequestInit,\n ) => Promise<any>;\n\n public readonly provider: ProviderType | undefined | null;\n\n constructor(\n signer: SignerType | undefined,\n chainId: number,\n request: (endpoint: string, options?: RequestInit) => Promise<any>,\n provider: ProviderType | undefined | null,\n ) {\n this.signer = signer;\n this.chainId = chainId;\n this.request = request;\n this.provider = provider;\n }\n\n /**\n * Claims Obol incentives from a Merkle Distributor contract for the given address.\n *\n * Automatically fetches incentive data, checks if already claimed, and submits\n * the on-chain claim transaction. Returns `{ txHash: null }` if incentives were\n * already claimed (idempotent).\n *\n * @param address - The operator's Ethereum address to claim incentives for.\n * @returns The transaction hash, or `{ txHash: null }` if already claimed.\n * @throws {SignerRequiredError} If no signer was provided.\n * @throws {Error} If no incentives are found for the address.\n *\n * @example\n * ```typescript\n * const { txHash } = await client.incentives.claimIncentives(\"0xOperator...\");\n * if (txHash) {\n * console.log(\"Claimed:\", txHash);\n * } else {\n * console.log(\"Already claimed\");\n * }\n * ```\n */\n async claimIncentives(address: string): Promise<ClaimIncentivesResponse> {\n if (!this.signer) {\n throw new SignerRequiredError('claimIncentives');\n }\n\n try {\n const incentivesData = await this.getIncentivesByAddress(address);\n\n if (!incentivesData?.contract_address) {\n throw new Error(`No incentives found for address ${address}`);\n }\n\n const isContractDeployed = await isContractAvailable(\n incentivesData.contract_address,\n this.provider as ProviderType,\n );\n\n if (!isContractDeployed) {\n throw new Error(\n `Merkle Distributor contract is not available at address ${incentivesData.contract_address}`,\n );\n }\n\n const claimed = await this.isClaimed(\n incentivesData.contract_address,\n incentivesData.index,\n );\n\n if (claimed) {\n return { txHash: null };\n }\n\n const { txHash } = await claimIncentivesFromMerkleDistributor({\n signer: this.signer,\n contractAddress: incentivesData.contract_address,\n index: incentivesData.index,\n operatorAddress: incentivesData.operator_address,\n amount: incentivesData.amount,\n merkleProof: incentivesData.merkle_proof,\n });\n\n return { txHash };\n } catch (error: any) {\n console.log('Error claiming incentives:', error);\n throw new Error(`Failed to claim incentives: ${error.message}`);\n }\n }\n\n /**\n * Checks whether incentives have already been claimed for a given operator index.\n *\n * Read-only on-chain call – no transaction sent.\n *\n * @param contractAddress - Address of the Merkle Distributor contract.\n * @param index - The operator's index in the Merkle tree (from {@link Incentives.getIncentivesByAddress}).\n * @returns `true` if the incentives at that index have already been claimed.\n *\n * @example\n * ```typescript\n * const claimed = await client.incentives.isClaimed(\n * \"0xMerkleDistributor...\",\n * 42,\n * );\n * ```\n */\n async isClaimed(\n contractAddress: ETH_ADDRESS,\n index: number,\n ): Promise<boolean> {\n return await isClaimedFromMerkleDistributor(\n contractAddress,\n index,\n this.provider,\n );\n }\n\n /**\n * Fetches claimable incentive data for an operator address from the Obol API.\n *\n * The returned data includes the Merkle proof, amount, and contract address\n * needed to claim on-chain. This is a read-only API call.\n *\n * @param address - The operator's Ethereum address.\n * @returns Claimable incentive data including amount, Merkle proof, and contract address.\n * @throws {Error} If no incentives are found for the given address (404).\n *\n * @example\n * ```typescript\n * const incentives = await client.incentives.getIncentivesByAddress(\"0xOperator...\");\n * console.log(incentives.amount, incentives.contract_address);\n * ```\n */\n async getIncentivesByAddress(address: string): Promise<ClaimableIncentives> {\n const network = FORK_NAMES[this.chainId];\n const incentives: ClaimableIncentives = await this.request(\n `/${DEFAULT_BASE_VERSION}/address/incentives/${network}/${address}`,\n {\n method: 'GET',\n },\n );\n return incentives;\n }\n}\n","import { ENR } from '@chainsafe/enr';\nimport * as elliptic from 'elliptic';\nimport { blsVerify, blsAggregateSignatures } from '../blsUtils.js';\nimport {\n ByteVectorType,\n ContainerType,\n fromHexString,\n ListCompositeType,\n UintNumberType,\n} from '@chainsafe/ssz';\nimport type {\n ProviderType,\n ExitClusterConfig,\n ExitValidationPayload,\n ExitValidationBlob,\n ExitValidationMessage,\n SignedExitValidationMessage,\n ExistingExitValidationBlobData,\n FullExitBlob,\n} from '../types.js';\nimport { getCapellaFork, getGenesisValidatorsRoot } from './ethUtils.js';\nimport { computeDomain, signingRoot } from './verificationHelpers.js';\n\n// Constants from obol-api/src/verification/exit.ts (assuming these might be needed or were in the original context)\nconst DOMAIN_VOLUNTARY_EXIT = '0x04000000';\n\n// SSZ Type Definitions (adapted from obol-api/src/verification/exit.ts)\nconst SSZExitMessageType = new ContainerType({\n epoch: new UintNumberType(8),\n validator_index: new UintNumberType(8),\n});\n\nconst SSZPartialExitsPayloadType = new ContainerType({\n partial_exits: new ListCompositeType(\n new ContainerType({\n public_key: new ByteVectorType(48),\n signed_exit_message: new ContainerType({\n message: new ContainerType({\n epoch: new UintNumberType(8),\n validator_index: new UintNumberType(8),\n }),\n signature: new ByteVectorType(96),\n }),\n }),\n 65536,\n ),\n share_idx: new UintNumberType(8),\n});\n\n/**\n * Validates and verifies voluntary exit signatures for Obol distributed validators.\n *\n * Do not instantiate directly; access via `client.exit`.\n *\n * Available methods:\n * - {@link Exit.verifyPartialExitSignature} – verify a BLS partial exit signature\n * - {@link Exit.verifyExitPayloadSignature} – verify an ECDSA exit payload signature\n * - {@link Exit.validateExitBlobs} – validate exit blobs against cluster config\n * - {@link Exit.recombineExitBlobs} – aggregate partial signatures into a full exit blob\n *\n * All methods are read-only (no on-chain transactions). No signer is required.\n *\n * @example\n * ```typescript\n * const client = new Client({ chainId: 1 }, signer, provider);\n *\n * // Verify a partial exit signature\n * const isValid = await client.exit.verifyPartialExitSignature(\n * publicShareKey,\n * signedExitMessage,\n * forkVersion,\n * genesisValidatorsRoot,\n * );\n *\n * // Validate exit blobs for a cluster\n * const validBlobs = await client.exit.validateExitBlobs(\n * clusterConfig,\n * exitsPayload,\n * beaconNodeApiUrl,\n * existingBlobData,\n * );\n * ```\n */\nexport class Exit {\n public readonly chainId: number;\n public readonly provider: ProviderType | undefined | null;\n\n /**\n * Creates a new Exit instance for validator exit operations.\n *\n * @param chainId - The Ethereum chain ID (e.g., 1 for mainnet, 5 for goerli)\n * @param provider - Optional Ethereum provider for blockchain interactions\n *\n * @example\n * ```typescript\n * const client = new Client({ chainId: 1 }, signer, provider);\n * const exit = client.exit; // Access via client, do not instantiate directly\n * ```\n */\n constructor(chainId: number, provider: ProviderType | undefined | null) {\n this.chainId = chainId;\n this.provider = provider;\n }\n\n /**\n * Safely parse a string integer to number, using BigInt to avoid precision loss\n * for large values beyond JavaScript's safe integer limit (2^53 - 1).\n * Throws an error if the value exceeds the safe range for a 64-bit unsigned integer.\n */\n private static safeParseInt(value: string): number {\n const bigIntValue = BigInt(value);\n\n // Check if value is within the range of a 64-bit unsigned integer\n const MAX_UINT64 = BigInt('0xFFFFFFFFFFFFFFFF');\n if (bigIntValue < 0 || bigIntValue > MAX_UINT64) {\n throw new Error(\n `Value ${value} is outside the valid range for a 64-bit unsigned integer`,\n );\n }\n\n // Convert to number - SSZ library should handle values even if they exceed JS safe integer limits\n return Number(bigIntValue);\n }\n\n private static computePartialExitMessageRoot(\n msg: ExitValidationMessage,\n ): Buffer {\n const sszValue = SSZExitMessageType.defaultValue();\n\n sszValue.epoch = Exit.safeParseInt(msg.epoch);\n sszValue.validator_index = Exit.safeParseInt(msg.validator_index);\n return Buffer.from(SSZExitMessageType.hashTreeRoot(sszValue).buffer);\n }\n\n private static computeExitPayloadRoot(exits: ExitValidationPayload): string {\n // Remove sorting since SSZ list ordering guarantees order\n // This eliminates the O(n log n) sort and improves performance\n const sszValue = SSZPartialExitsPayloadType.defaultValue();\n sszValue.partial_exits = exits.partial_exits.map(pe => ({\n public_key: fromHexString(pe.public_key),\n signed_exit_message: {\n message: {\n epoch: Exit.safeParseInt(pe.signed_exit_message.message.epoch),\n validator_index: Exit.safeParseInt(\n pe.signed_exit_message.message.validator_index,\n ),\n },\n signature: fromHexString(pe.signed_exit_message.signature),\n },\n }));\n sszValue.share_idx = exits.share_idx;\n\n return Buffer.from(\n SSZPartialExitsPayloadType.hashTreeRoot(sszValue).buffer,\n ).toString('hex');\n }\n\n /**\n * Verifies a partial exit signature from a distributed validator operator.\n *\n * This method validates that a partial exit signature was correctly signed by the\n * operator's share of the distributed validator's private key. It performs BLS\n * signature verification using the appropriate fork version and genesis validators root.\n *\n * @param publicShareKey - The operator's public share key (BLS public key, hex string with or without 0x prefix)\n * @param signedExitMessage - The signed exit message containing the exit details and signature\n * @param forkVersion - The Ethereum fork version (e.g., \"0x00000000\" for mainnet)\n * @param genesisValidatorsRootString - The genesis validators root for the network (hex string)\n *\n * @returns Promise resolving to true if the signature is valid, false otherwise\n *\n * @throws {Error} When unable to determine the Capella fork version for the given network\n * @throws {Error} When BLS library initialization or verification fails\n *\n * @example\n * ```typescript\n * const isValid = await exit.verifyPartialExitSignature(\n * \"0x1234...abcd\", // operator's public share key\n * {\n * message: { epoch: \"12345\", validator_index: \"67890\" },\n * signature: \"0xabcd...1234\"\n * },\n * \"0x00000000\", // mainnet fork version\n * \"0x4b363db94e286120d76eb905340fdd4e54bfe9f06bf33ff6cf5ad27f511bfe95\"\n * );\n * ```\n */\n async verifyPartialExitSignature(\n publicShareKey: string,\n signedExitMessage: SignedExitValidationMessage,\n forkVersion: string,\n genesisValidatorsRootString: string,\n ): Promise<boolean> {\n const capellaForkVersionString = await getCapellaFork(forkVersion);\n if (!capellaForkVersionString) {\n throw new Error(\n `Could not determine Capella fork version for base fork: ${forkVersion}`,\n );\n }\n\n const partialExitMessageBuffer = Exit.computePartialExitMessageRoot(\n signedExitMessage.message,\n );\n\n const exitDomain = computeDomain(\n fromHexString(DOMAIN_VOLUNTARY_EXIT),\n capellaForkVersionString,\n fromHexString(genesisValidatorsRootString),\n );\n\n const messageSigningRoot = signingRoot(\n exitDomain,\n partialExitMessageBuffer,\n );\n\n return blsVerify(\n fromHexString(publicShareKey),\n messageSigningRoot,\n fromHexString(signedExitMessage.signature),\n );\n }\n\n /**\n * Verifies the exit payload signature using the operator's ENR.\n *\n * This method validates that an exit payload was signed by the correct operator\n * using ECDSA signature verification. The signature is verified against the\n * operator's public key extracted from their ENR (Ethereum Node Record).\n *\n * @param enrString - The operator's ENR string containing their identity and public key\n * @param exitsPayload - The exit validation payload containing partial exits and operator signature\n *\n * @returns Promise resolving to true if the payload signature is valid, false otherwise\n *\n * @throws {Error} When the ENR string is invalid or cannot be decoded\n * @throws {Error} When the signature format is invalid (must be 130 hex characters)\n * @throws {Error} When signature verification encounters an error\n *\n * @example\n * ```typescript\n * const isValid = await exit.verifyExitPayloadSignature(\n * \"enr:-LK4QFo_n0dUm4PKejSOXf8JkSWq5EINV0XhG1zY00d...\", // operator ENR\n * {\n * partial_exits: [exitBlob1, exitBlob2],\n * share_idx: 1,\n * signature: \"0x1234...abcd\" // ECDSA signature (130 hex chars)\n * }\n * );\n * ```\n */\n async verifyExitPayloadSignature(\n enrString: string,\n exitsPayload: ExitValidationPayload,\n ): Promise<boolean> {\n const partialExitsDtoHashRoot = Exit.computeExitPayloadRoot(exitsPayload);\n const ec = new elliptic.ec('secp256k1');\n\n let pubKeyHex;\n try {\n pubKeyHex = ENR.decodeTxt(enrString).publicKey.toString();\n } catch (e: any) {\n throw new Error(\n `Invalid ENR string: ${enrString}. Error: ${e.message ?? String(e)}`,\n );\n }\n\n const sigHex = exitsPayload.signature.startsWith('0x')\n ? exitsPayload.signature.substring(2)\n : exitsPayload.signature;\n\n if (sigHex.length !== 130) {\n throw new Error(\n `Invalid signature length. Expected 130 hex chars (r + s), got ${sigHex.length}`,\n );\n }\n\n const r = sigHex.slice(0, 64);\n const s = sigHex.slice(64, 128);\n\n const enrSignature = { r, s };\n\n try {\n return ec\n .keyFromPublic(pubKeyHex, 'hex')\n .verify(\n partialExitsDtoHashRoot,\n enrSignature as elliptic.ec.SignatureOptions,\n );\n } catch (e: any) {\n throw new Error(\n `Signature verification failed: ${e.message ?? String(e)}`,\n );\n }\n }\n\n private async validateOperatorAndPayload(\n clusterConfig: ExitClusterConfig,\n exitsPayload: ExitValidationPayload,\n ): Promise<string> {\n const operatorIndex = exitsPayload.share_idx - 1;\n if (\n operatorIndex < 0 ||\n operatorIndex >= clusterConfig.definition.operators.length\n ) {\n throw new Error(\n `Invalid share_idx ${exitsPayload.share_idx} for ${clusterConfig.definition.operators.length} operators.`,\n );\n }\n const operatorEnr = clusterConfig.definition.operators[operatorIndex].enr;\n\n const isPayloadSignatureValid = await this.verifyExitPayloadSignature(\n operatorEnr,\n exitsPayload,\n );\n if (!isPayloadSignatureValid) {\n throw new Error('Incorrect payload signature for partial exits.');\n }\n\n return operatorEnr;\n }\n\n private async getNetworkParameters(\n forkVersion: string,\n beaconNodeApiUrl: string,\n ): Promise<{ genesisValidatorsRoot: string; capellaForkVersion: string }> {\n const genesisValidatorsRootString =\n await getGenesisValidatorsRoot(beaconNodeApiUrl);\n if (!genesisValidatorsRootString) {\n throw new Error('Could not retrieve genesis validators root.');\n }\n\n const capellaForkVersionString = await getCapellaFork(forkVersion);\n if (!capellaForkVersionString) {\n throw new Error(\n `Unsupported network: Could not determine Capella fork for ${forkVersion}`,\n );\n }\n\n return {\n genesisValidatorsRoot: genesisValidatorsRootString,\n capellaForkVersion: capellaForkVersionString,\n };\n }\n\n private findValidatorInCluster(\n clusterConfig: ExitClusterConfig,\n publicKey: string,\n operatorIndex: number,\n ): { validator: any; publicShare: string } {\n const validatorInCluster = clusterConfig.distributed_validators.find(\n dv =>\n (dv.distributed_public_key.startsWith('0x')\n ? dv.distributed_public_key\n : '0x' + dv.distributed_public_key\n ).toLowerCase() ===\n (publicKey.startsWith('0x')\n ? publicKey\n : '0x' + publicKey\n ).toLowerCase(),\n );\n\n if (!validatorInCluster) {\n throw new Error(\n `Public key ${publicKey} not found in the cluster's distributed validators.`,\n );\n }\n\n const publicShareForOperator =\n validatorInCluster.public_shares[operatorIndex];\n if (!publicShareForOperator) {\n throw new Error(\n `Public share for operator index ${operatorIndex} not found for validator ${publicKey}`,\n );\n }\n\n return {\n validator: validatorInCluster,\n publicShare: publicShareForOperator,\n };\n }\n\n private async validateExistingBlobData(\n exitBlob: ExitValidationBlob,\n existingBlob: ExistingExitValidationBlobData | null,\n operatorIndex: number,\n ): Promise<boolean> {\n if (!existingBlob) {\n return false;\n }\n\n // Check if existing blob data is for this public key\n const normalizeKey = (key: string): string =>\n (key.startsWith('0x') ? key : '0x' + key).toLowerCase();\n\n if (\n normalizeKey(existingBlob.public_key) !==\n normalizeKey(exitBlob.public_key)\n ) {\n return false; // Existing blob data is for a different validator\n }\n\n if (\n existingBlob.validator_index !==\n exitBlob.signed_exit_message.message.validator_index\n ) {\n throw new Error(\n `Validator index mismatch for already processed exit for public key ${exitBlob.public_key}. Expected ${existingBlob.validator_index}, got ${exitBlob.signed_exit_message.message.validator_index}.`,\n );\n }\n\n const currentEpoch = Exit.safeParseInt(\n exitBlob.signed_exit_message.message.epoch,\n );\n const existingEpoch = Exit.safeParseInt(existingBlob.epoch);\n\n if (currentEpoch < existingEpoch) {\n throw new Error(\n `New exit epoch ${currentEpoch} is not greater than existing exit epoch ${existingEpoch} for validator ${exitBlob.public_key}.`,\n );\n } else if (currentEpoch === existingEpoch) {\n const operatorShareIndexString = String(operatorIndex);\n if (\n existingBlob.shares_exit_data?.[0]?.[operatorShareIndexString]\n ?.partial_exit_signature &&\n existingBlob.shares_exit_data[0][operatorShareIndexString]\n .partial_exit_signature !== exitBlob.signed_exit_message.signature\n ) {\n throw new Error(\n `Signature mismatch for validator ${exitBlob.public_key}, operator index ${operatorIndex} at epoch ${currentEpoch}. Received different signature than existing.`,\n );\n }\n return true; // Already processed\n }\n\n return false;\n }\n\n private async processExitBlob(\n exitBlob: ExitValidationBlob,\n clusterConfig: ExitClusterConfig,\n operatorIndex: number,\n genesisValidatorsRoot: string,\n existingBlobData: ExistingExitValidationBlobData | null,\n ): Promise<ExitValidationBlob | null> {\n const { publicShare } = this.findValidatorInCluster(\n clusterConfig,\n exitBlob.public_key,\n operatorIndex,\n );\n\n const alreadyProcessed = await this.validateExistingBlobData(\n exitBlob,\n existingBlobData,\n operatorIndex,\n );\n\n if (alreadyProcessed) {\n return null;\n }\n\n const isPartialSignatureValid = await this.verifyPartialExitSignature(\n publicShare,\n exitBlob.signed_exit_message,\n clusterConfig.definition.fork_version,\n genesisValidatorsRoot,\n );\n\n if (!isPartialSignatureValid) {\n throw new Error(\n `Invalid partial exit signature for validator ${exitBlob.public_key} by operator index ${operatorIndex}.`,\n );\n }\n\n return exitBlob;\n }\n\n /**\n * Validates exit blobs against cluster configuration and existing data.\n *\n * This method performs comprehensive validation of exit blobs including:\n * - Operator authorization and payload signature verification\n * - Network parameter validation (genesis root, fork version)\n * - Public key validation against cluster configuration\n * - Partial signature verification for each exit blob\n * - Duplicate detection and epoch progression validation\n * - Signature consistency checks for existing exits\n *\n * @param clusterConfig - The cluster configuration containing operators and distributed validators\n * @param exitsPayload - The exit validation payload with partial exits and operator info\n * @param beaconNodeApiUrl - The beacon node API URL for network parameter retrieval\n * @param existingBlobData - Existing exit blob data for duplicate detection, or null if none exists\n *\n * @returns Promise resolving to an array of validated, non-duplicate exit blobs\n *\n * @throws {Error} When share_idx is invalid or out of bounds for the cluster operators\n * @throws {Error} When payload signature verification fails\n * @throws {Error} When network parameters cannot be retrieved or are invalid\n * @throws {Error} When a public key is not found in the cluster's distributed validators\n * @throws {Error} When a partial exit signature is invalid\n * @throws {Error} When exit epoch validation fails (new epoch not greater than existing)\n * @throws {Error} When validator index mismatches with existing data\n * @throws {Error} When signature mismatches for the same epoch and operator\n *\n * @example\n * ```typescript\n * const validExitBlobs = await exit.validateExitBlobs(\n * {\n * definition: {\n * operators: [{ enr: \"enr:-LK4Q...\" }],\n * fork_version: \"0x00000000\",\n * threshold: 1\n * },\n * distributed_validators: [{\n * distributed_public_key: \"0x1234...abcd\",\n * public_shares: [\"0x5678...efgh\"]\n * }]\n * },\n * {\n * partial_exits: [exitBlob],\n * share_idx: 1,\n * signature: \"0x1234...abcd\"\n * },\n * \"http://localhost:5052\",\n * existingBlobData // or null for new exits\n * );\n * ```\n */\n async validateExitBlobs(\n clusterConfig: ExitClusterConfig,\n exitsPayload: ExitValidationPayload,\n beaconNodeApiUrl: string,\n existingBlobData: ExistingExitValidationBlobData | null,\n ): Promise<ExitValidationBlob[]> {\n await this.validateOperatorAndPayload(clusterConfig, exitsPayload);\n\n const { genesisValidatorsRoot } = await this.getNetworkParameters(\n clusterConfig.definition.fork_version,\n beaconNodeApiUrl,\n );\n\n const operatorIndex = exitsPayload.share_idx - 1;\n const validNonDuplicateBlobs: ExitValidationBlob[] = [];\n\n for (const currentExitBlob of exitsPayload.partial_exits) {\n const processedBlob = await this.processExitBlob(\n currentExitBlob,\n clusterConfig,\n operatorIndex,\n genesisValidatorsRoot,\n existingBlobData,\n );\n\n if (processedBlob) {\n validNonDuplicateBlobs.push(processedBlob);\n }\n }\n\n return validNonDuplicateBlobs;\n }\n\n /**\n * Recombines exit blobs into a single exit blob.\n *\n * This method aggregates partial exit signatures from multiple operators into a single exit blob.\n * It ensures that the signatures are properly ordered and aggregated according to the operator indices.\n *\n * @param exitBlob - The existing exit blob data containing partial exit signatures\n *\n * @returns Promise resolving to a single exit blob with aggregated signatures\n *\n * @throws {Error} When no valid signatures are found for aggregation\n * @throws {Error} When signature length is invalid\n * @throws {Error} When signature parsing fails\n *\n * @example\n * ```typescript\n * const aggregatedExitBlob = await exit.recombineExitBlobs(existingBlobData);\n * ```\n */\n async recombineExitBlobs(\n exitBlob: ExistingExitValidationBlobData,\n ): Promise<FullExitBlob> {\n // Map to store signatures by their share index (matching Go's map[int]tbls.Signature)\n const signaturesByIndex = new Map<number, Uint8Array>();\n\n // Extract signatures from shares_exit_data (equivalent to er.Signatures in Go)\n if (!exitBlob.shares_exit_data || exitBlob.shares_exit_data.length === 0) {\n throw new Error('No shares exit data available for aggregation');\n }\n const signaturesMap = exitBlob.shares_exit_data[0] || {};\n for (const [sigIdxStr, sigData] of Object.entries(signaturesMap)) {\n const sigStr = sigData.partial_exit_signature;\n\n if (!sigStr || sigStr.length === 0) {\n // ignore, the associated share index didn't push a partial signature yet\n continue;\n }\n\n if (sigStr.length < 2) {\n throw new Error(`Signature string has invalid size: ${sigStr.length}`);\n }\n\n // Remove 0x prefix and ensure it's 96 bytes (192 hex chars)\n const cleanSigStr = sigStr.startsWith('0x')\n ? sigStr.substring(2)\n : sigStr;\n if (cleanSigStr.length !== 192) {\n throw new Error(\n `Invalid signature length. Expected 192 hex chars (96 bytes), got ${cleanSigStr.length}`,\n );\n }\n\n try {\n const sigBytes = fromHexString(cleanSigStr);\n // Convert string index to number and add 1 (matching Go's sigIdx+1)\n const sigIdx = parseInt(sigIdxStr, 10);\n signaturesByIndex.set(sigIdx + 1, sigBytes);\n } catch (err) {\n throw new Error(`Invalid partial signature: ${String(err)}`);\n }\n }\n\n if (signaturesByIndex.size === 0) {\n throw new Error('No valid signatures found for aggregation');\n }\n\n // Sort by index and extract signatures in correct order\n const sortedIndices = Array.from(signaturesByIndex.keys()).sort(\n (a, b) => a - b,\n );\n const rawSignatures = sortedIndices.map(idx => {\n const signature = signaturesByIndex.get(idx);\n if (signature === undefined) {\n throw new Error(`Missing signature for index ${idx}`);\n }\n return signature;\n });\n\n // Aggregate signatures (equivalent to tbls.ThresholdAggregate in Go)\n const fullSig = blsAggregateSignatures(rawSignatures);\n\n return {\n public_key: exitBlob.public_key,\n signed_exit_message: {\n message: {\n epoch: exitBlob.epoch,\n validator_index: exitBlob.validator_index,\n },\n signature: '0x' + Buffer.from(fullSig).toString('hex'),\n },\n };\n }\n}\n","import { CAPELLA_FORK_MAPPING } from '../constants.js';\n\n/**\n * Retrieves the Capella fork version for a given base fork version.\n * @param fork_version - The base fork version string (e.g., '0x00000000' for mainnet).\n * @returns A promise that resolves to the Capella fork version string, or null if not found.\n */\nexport async function getCapellaFork(\n fork_version: string,\n): Promise<string | null> {\n // Ensure the CAPELLA_FORK_MAPPING uses the base fork_version as key\n if (CAPELLA_FORK_MAPPING[fork_version]) {\n return CAPELLA_FORK_MAPPING[fork_version];\n }\n return null;\n}\n\n/**\n * Fetches the genesis validators root from a beacon node.\n * @param beaconNodeApiUrl - The base URL of the beacon node API (e.g., http://localhost:5052).\n * @returns A promise that resolves to the genesis_validators_root string, or null on error.\n * @throws Will throw an error if the network corresponding to the fork_version is not supported or if the HTTP request fails.\n */\nexport async function getGenesisValidatorsRoot(\n beaconNodeApiUrl: string,\n): Promise<string | null> {\n const genesisEndpoint = `${beaconNodeApiUrl}/eth/v1/beacon/genesis`;\n\n try {\n const response = await fetch(genesisEndpoint, {\n method: 'GET',\n });\n\n const json = await response.json();\n\n if (json.data?.genesis_validators_root) {\n return json.data.genesis_validators_root;\n }\n console.error('Invalid response structure from genesis endpoint', json);\n return null;\n } catch (e: any) {\n console.error(\n `Error fetching genesis validators root from ${genesisEndpoint}:`,\n e,\n );\n const errorMessage = e instanceof Error ? e.message : String(e);\n throw new Error(`Failed to fetch genesis validators root: ${errorMessage}`);\n }\n}\n","import { ContainerType, ByteVectorType, fromHexString } from '@chainsafe/ssz';\n\n// From obol-api/src/verification/common.ts\nexport const GENESIS_VALIDATOR_ROOT_HEX_STRING =\n '0x0000000000000000000000000000000000000000000000000000000000000000'; // Added 0x prefix\n\nconst ForkDataType = new ContainerType({\n currentVersion: new ByteVectorType(4),\n genesisValidatorsRoot: new ByteVectorType(32),\n});\n\nconst SigningRootType = new ContainerType({\n objectRoot: new ByteVectorType(32),\n domain: new ByteVectorType(32),\n});\n\n/**\n * https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#compute_fork_data_root\n * @param currentVersion - Uint8Array of the current fork version.\n * @param genesisValidatorsRoot - Uint8Array of the genesis validators root.\n * @returns Uint8Array - The 32-byte fork data root.\n */\nfunction computeForkDataRoot(\n currentVersion: Uint8Array,\n genesisValidatorsRoot: Uint8Array,\n): Uint8Array {\n const forkDataVal = ForkDataType.defaultValue();\n forkDataVal.currentVersion = currentVersion;\n forkDataVal.genesisValidatorsRoot = genesisValidatorsRoot;\n return Buffer.from(ForkDataType.hashTreeRoot(forkDataVal).buffer);\n}\n\n/**\n * Computes the domain for a given domain type, fork version, and genesis state.\n * https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#compute_domain\n * @param domainType - Uint8Array representing the domain type (e.g., DOMAIN_VOLUNTARY_EXIT).\n * @param forkVersionString - Hex string of the fork version (e.g., Capella fork version).\n * @param genesisValidatorsRootOverride - Optional Uint8Array to override the default genesis validators root.\n * @returns Uint8Array - The 32-byte domain.\n */\nexport function computeDomain(\n domainType: Uint8Array, // Should be 4 bytes\n forkVersionString: string, // Hex string, e.g., '0x03000000'\n genesisValidatorsRootOverride?: Uint8Array, // 32 bytes\n): Uint8Array {\n const forkVersionBytes = fromHexString(\n forkVersionString.substring(2, forkVersionString.length),\n );\n\n if (forkVersionBytes.length !== 4) {\n throw new Error('Fork version must be 4 bytes');\n }\n if (domainType.length !== 4) {\n throw new Error('Domain type must be 4 bytes');\n }\n\n const actualGenesisValidatorsRoot =\n genesisValidatorsRootOverride ??\n fromHexString(GENESIS_VALIDATOR_ROOT_HEX_STRING.substring(2));\n\n if (actualGenesisValidatorsRoot.length !== 32) {\n throw new Error('genesisValidatorsRoot must be 32 bytes');\n }\n const forkDataRoot = computeForkDataRoot(\n forkVersionBytes,\n actualGenesisValidatorsRoot,\n );\n const domain = new Uint8Array(32);\n domain.set(domainType);\n domain.set(forkDataRoot.subarray(0, 28), 4); // Set the remaining 28 bytes from forkDataRoot\n return domain;\n}\n\n/**\n * Computes the signing root for an SSZ object and a domain.\n * https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#compute_signing_root\n * @param sszObjectRoot - Uint8Array of the hash tree root of the SSZ object.\n * @param domain - Uint8Array of the domain.\n * @returns Uint8Array - The 32-byte signing root.\n */\nfunction computeSigningRoot(\n sszObjectRoot: Uint8Array, // Should be 32 bytes\n domain: Uint8Array, // Should be 32 bytes\n): Uint8Array {\n if (sszObjectRoot.length !== 32) {\n throw new Error('SSZ object root must be 32 bytes');\n }\n if (domain.length !== 32) {\n throw new Error('Domain must be 32 bytes');\n }\n\n const val = SigningRootType.defaultValue();\n val.objectRoot = sszObjectRoot;\n val.domain = domain;\n return Buffer.from(SigningRootType.hashTreeRoot(val).buffer);\n}\n\n/**\n * Convenience wrapper for computeSigningRoot.\n * @param domain - Uint8Array of the domain.\n * @param messageBuffer - Buffer of the message (SSZ object root).\n * @returns Uint8Array - The signing root.\n */\nexport function signingRoot(\n domain: Uint8Array,\n messageBuffer: Buffer, // Assumed to be the 32-byte sszObjectRoot\n): Uint8Array {\n const sszObjectRootU8 = Uint8Array.from(messageBuffer);\n return computeSigningRoot(sszObjectRootU8, domain);\n}\n","import {\n formatRecipientsForSplitV2,\n predictSplitV2Address,\n isSplitV2Deployed,\n deployOVMContract,\n deployOVMAndSplitV2,\n requestWithdrawalFromOVM,\n depositOVM,\n} from './splitHelpers.js';\nimport {\n CHAIN_CONFIGURATION,\n SPLITS_V2_SALT,\n DEFAULT_RETROACTIVE_FUNDING_REWARDS_ONLY_SPLIT,\n isChainSupportedForSplitters,\n} from '../constants.js';\nimport { SignerRequiredError, UnsupportedChainError } from '../errors.js';\nimport {\n ovmRewardsSplitPayloadSchema,\n ovmTotalSplitPayloadSchema,\n ovmRequestWithdrawalPayloadSchema,\n ovmDepositPayloadSchema,\n} from '../schema.js';\nimport { validatePayload } from '../ajv.js';\nimport { isContractAvailable } from '../utils.js';\nimport {\n type ClusterValidator,\n type ProviderType,\n type SignerType,\n type OVMRewardsSplitPayload,\n type OVMTotalSplitPayload,\n type OVMRequestWithdrawalPayload,\n type OVMDepositPayload,\n} from '../types.js';\n\n/**\n * Deploys and manages Obol Validator Manager (OVM) and SplitV2 contracts\n * for automated reward and principal splitting among cluster participants.\n *\n * Do not instantiate directly; access via `client.splits`.\n *\n * Available methods:\n * - {@link ObolSplits.createValidatorManagerAndRewardsSplit} – rewards-only split (single principal recipient)\n * - {@link ObolSplits.createValidatorManagerAndTotalSplit} – total split (principal also split)\n * - {@link ObolSplits.requestWithdrawal} – request withdrawal from an OVM contract\n * - {@link ObolSplits.deposit} – deposit to an OVM contract\n *\n * All write methods send on-chain transactions and require a signer with ETH for gas.\n *\n * @example\n * ```typescript\n * const client = new Client({ chainId: 560048 }, signer);\n *\n * const { withdrawal_address, fee_recipient_address } =\n * await client.splits.createValidatorManagerAndRewardsSplit({\n * rewardSplitRecipients: [\n * { address: \"0xOp1...\", percentAllocation: 50 },\n * { address: \"0xOp2...\", percentAllocation: 49 },\n * ],\n * principalRecipient: \"0xPrincipal...\",\n * OVMOwnerAddress: \"0xOwner...\",\n * });\n * ```\n */\nexport class ObolSplits {\n private readonly signer: SignerType | undefined;\n public readonly chainId: number;\n public readonly provider: ProviderType | undefined | null;\n\n constructor(\n signer: SignerType | undefined,\n chainId: number,\n provider: ProviderType | undefined | null,\n ) {\n this.signer = signer;\n this.chainId = chainId;\n this.provider = provider;\n }\n\n /**\n * Deploys an OVM and SplitV2 contract for a **rewards-only** split scenario.\n *\n * Principal goes to a single address; only validator rewards are split among\n * the configured recipients. Automatically appends the Obol RAF recipient.\n *\n * - Sends one or more on-chain transactions (irreversible).\n * - Only supported on chains with OVM factory contracts (Mainnet, Hoodi).\n *\n * @param payload - Configuration for the OVM and SplitV2 deployment.\n * @returns The OVM address as `withdrawal_address` and splitter as `fee_recipient_address`.\n * @throws {SignerRequiredError} If no signer was provided.\n * @throws {UnsupportedChainError} If the chain does not support splitters.\n *\n * @example\n * ```typescript\n * const { withdrawal_address, fee_recipient_address } =\n * await client.splits.createValidatorManagerAndRewardsSplit({\n * rewardSplitRecipients: [\n * { address: \"0xOp1...\", percentAllocation: 50 },\n * { address: \"0xOp2...\", percentAllocation: 49 },\n * ],\n * principalRecipient: \"0xPrincipal...\",\n * OVMOwnerAddress: \"0xOwner...\",\n * });\n * ```\n */\n async createValidatorManagerAndRewardsSplit(\n payload: OVMRewardsSplitPayload,\n ): Promise<ClusterValidator> {\n const salt = SPLITS_V2_SALT;\n if (!this.signer) {\n throw new SignerRequiredError('createValidatorManagerAndRewardsSplit');\n }\n\n const validatedPayload = validatePayload<Required<OVMRewardsSplitPayload>>(\n payload,\n ovmRewardsSplitPayloadSchema,\n );\n\n if (!isChainSupportedForSplitters(this.chainId)) {\n throw new UnsupportedChainError(\n this.chainId,\n 'createValidatorManagerAndRewardsSplit',\n );\n }\n\n const chainConfig = CHAIN_CONFIGURATION[this.chainId];\n if (!chainConfig?.OVM_FACTORY_CONTRACT) {\n throw new UnsupportedChainError(\n this.chainId,\n 'createValidatorManagerAndRewardsSplit',\n );\n }\n\n if (!this.provider) {\n throw new Error(\n 'Provider is required to check OVM factory contract availability',\n );\n }\n const ovmFactoryConfig = chainConfig.OVM_FACTORY_CONTRACT;\n const splitV2FactoryConfig = chainConfig.SPLIT_V2_FACTORY_CONTRACT;\n const multiCall3Config = chainConfig.MULTICALL3_CONTRACT;\n\n if (\n !ovmFactoryConfig?.address ||\n !ovmFactoryConfig?.bytecode ||\n !splitV2FactoryConfig?.address ||\n !splitV2FactoryConfig?.bytecode ||\n !multiCall3Config?.address ||\n !multiCall3Config?.bytecode\n ) {\n throw new UnsupportedChainError(\n this.chainId,\n 'createValidatorManagerAndRewardsSplit',\n );\n }\n\n const checkOVMFactoryContract = await isContractAvailable(\n ovmFactoryConfig.address,\n this.provider,\n ovmFactoryConfig.bytecode,\n );\n\n const checkSplitV2FactoryContract = await isContractAvailable(\n splitV2FactoryConfig.address,\n this.provider,\n splitV2FactoryConfig.bytecode,\n );\n\n const checkMultiCall3Contract = await isContractAvailable(\n multiCall3Config.address,\n this.provider,\n multiCall3Config.bytecode,\n );\n\n if (\n !checkOVMFactoryContract ||\n !checkSplitV2FactoryContract ||\n !checkMultiCall3Contract\n ) {\n throw new Error(\n `Required factory contracts are not available on chain ${this.chainId}`,\n );\n }\n\n const retroActiveFundingRecipient = {\n address: chainConfig.RETROACTIVE_FUNDING_CONTRACT.address,\n percentAllocation: DEFAULT_RETROACTIVE_FUNDING_REWARDS_ONLY_SPLIT,\n };\n\n const copiedRewardsSplitRecipients = [\n ...validatedPayload.rewardSplitRecipients,\n ];\n copiedRewardsSplitRecipients.push(retroActiveFundingRecipient);\n\n // Format recipients for SplitV2\n const rewardRecipients = formatRecipientsForSplitV2(\n copiedRewardsSplitRecipients,\n );\n\n const predictedSplitAddress = await predictSplitV2Address({\n splitOwnerAddress: validatedPayload.splitOwnerAddress,\n recipients: rewardRecipients,\n distributorFeePercent: validatedPayload.distributorFeePercent,\n salt,\n signer: this.signer,\n chainId: this.chainId,\n });\n\n const isRewardSplitterDeployed = await isSplitV2Deployed({\n splitOwnerAddress: validatedPayload.splitOwnerAddress,\n recipients: rewardRecipients,\n distributorFeePercent: validatedPayload.distributorFeePercent,\n salt,\n signer: this.signer,\n chainId: this.chainId,\n });\n\n if (isRewardSplitterDeployed) {\n const ovmAddress = await deployOVMContract({\n OVMOwnerAddress: validatedPayload.OVMOwnerAddress,\n principalRecipient: validatedPayload.principalRecipient,\n rewardRecipient: predictedSplitAddress,\n principalThreshold: validatedPayload.principalThreshold,\n signer: this.signer,\n chainId: this.chainId,\n });\n\n return {\n withdrawal_address: ovmAddress,\n fee_recipient_address: predictedSplitAddress,\n };\n } else {\n const ovmAddress = await deployOVMAndSplitV2({\n ovmArgs: {\n OVMOwnerAddress: validatedPayload.OVMOwnerAddress,\n rewardRecipient: predictedSplitAddress,\n principalRecipient: validatedPayload.principalRecipient,\n principalThreshold: validatedPayload.principalThreshold,\n },\n rewardRecipients,\n isRewardsSplitterDeployed: isRewardSplitterDeployed,\n distributorFeePercent: validatedPayload.distributorFeePercent,\n salt,\n signer: this.signer,\n chainId: this.chainId,\n splitOwnerAddress: validatedPayload.splitOwnerAddress,\n });\n\n return {\n withdrawal_address: ovmAddress,\n fee_recipient_address: predictedSplitAddress,\n };\n }\n }\n\n /**\n * Deploys an OVM and SplitV2 contract for a **total split** scenario.\n *\n * Both principal and rewards are split among recipients via separate SplitV2\n * contracts. Automatically appends the Obol RAF recipient to rewards.\n *\n * - Sends one or more on-chain transactions (irreversible).\n * - Only supported on chains with OVM factory contracts (Mainnet, Hoodi).\n *\n * @param payload - Configuration for the OVM and SplitV2 deployment.\n * @returns The OVM address as `withdrawal_address` and rewards splitter as `fee_recipient_address`.\n * @throws {SignerRequiredError} If no signer was provided.\n * @throws {UnsupportedChainError} If the chain does not support splitters.\n *\n * @example\n * ```typescript\n * const { withdrawal_address, fee_recipient_address } =\n * await client.splits.createValidatorManagerAndTotalSplit({\n * rewardSplitRecipients: [\n * { address: \"0xOp1...\", percentAllocation: 50 },\n * { address: \"0xOp2...\", percentAllocation: 49 },\n * ],\n * principalSplitRecipients: [\n * { address: \"0xOp1...\", percentAllocation: 50 },\n * { address: \"0xOp2...\", percentAllocation: 50 },\n * ],\n * OVMOwnerAddress: \"0xOwner...\",\n * });\n * ```\n */\n async createValidatorManagerAndTotalSplit(\n payload: OVMTotalSplitPayload,\n ): Promise<ClusterValidator> {\n const salt = SPLITS_V2_SALT;\n if (!this.signer) {\n throw new SignerRequiredError('createValidatorManagerAndTotalSplit');\n }\n\n const validatedPayload = validatePayload<Required<OVMTotalSplitPayload>>(\n payload,\n ovmTotalSplitPayloadSchema,\n );\n\n if (!isChainSupportedForSplitters(this.chainId)) {\n throw new UnsupportedChainError(\n this.chainId,\n 'createValidatorManagerAndTotalSplit',\n );\n }\n\n const chainConfig = CHAIN_CONFIGURATION[this.chainId];\n if (!chainConfig?.OVM_FACTORY_CONTRACT) {\n throw new UnsupportedChainError(\n this.chainId,\n 'createValidatorManagerAndTotalSplit',\n );\n }\n\n if (!this.provider) {\n throw new Error(\n 'Provider is required to check OVM factory contract availability',\n );\n }\n\n const ovmFactoryConfig = chainConfig.OVM_FACTORY_CONTRACT;\n const splitV2FactoryConfig = chainConfig.SPLIT_V2_FACTORY_CONTRACT;\n const multiCall3Config = chainConfig.MULTICALL3_CONTRACT;\n\n if (\n !ovmFactoryConfig?.address ||\n !ovmFactoryConfig?.bytecode ||\n !splitV2FactoryConfig?.address ||\n !splitV2FactoryConfig?.bytecode ||\n !multiCall3Config?.address ||\n !multiCall3Config?.bytecode\n ) {\n throw new UnsupportedChainError(\n this.chainId,\n 'createValidatorManagerAndTotalSplit',\n );\n }\n\n const checkOVMFactoryContract = await isContractAvailable(\n ovmFactoryConfig.address,\n this.provider,\n ovmFactoryConfig.bytecode,\n );\n\n const checkSplitV2FactoryContract = await isContractAvailable(\n splitV2FactoryConfig.address,\n this.provider,\n splitV2FactoryConfig.bytecode,\n );\n\n const checkMultiCall3Contract = await isContractAvailable(\n multiCall3Config.address,\n this.provider,\n multiCall3Config.bytecode,\n );\n\n if (\n !checkOVMFactoryContract ||\n !checkSplitV2FactoryContract ||\n !checkMultiCall3Contract\n ) {\n throw new Error(\n `Required factory contracts are not available on chain ${this.chainId}`,\n );\n }\n\n const retroActiveFundingRecipient = {\n address: chainConfig.RETROACTIVE_FUNDING_CONTRACT.address,\n percentAllocation: DEFAULT_RETROACTIVE_FUNDING_REWARDS_ONLY_SPLIT,\n };\n\n const copiedRewardsSplitRecipients = [\n ...validatedPayload.rewardSplitRecipients,\n ];\n copiedRewardsSplitRecipients.push(retroActiveFundingRecipient);\n\n const rewardsRecipients = formatRecipientsForSplitV2(\n copiedRewardsSplitRecipients,\n );\n\n const principalSplitRecipients = formatRecipientsForSplitV2(\n validatedPayload.principalSplitRecipients,\n );\n\n const predictedRewardsSplitAddress = await predictSplitV2Address({\n splitOwnerAddress: validatedPayload.splitOwnerAddress,\n recipients: rewardsRecipients,\n distributorFeePercent: validatedPayload.distributorFeePercent,\n salt,\n signer: this.signer,\n chainId: this.chainId,\n });\n\n const predictedPrincipalSplitAddress = await predictSplitV2Address({\n splitOwnerAddress: validatedPayload.splitOwnerAddress,\n recipients: principalSplitRecipients,\n distributorFeePercent: validatedPayload.distributorFeePercent,\n salt,\n signer: this.signer,\n chainId: this.chainId,\n });\n\n const isRewardsSplitterDeployed = await isSplitV2Deployed({\n splitOwnerAddress: validatedPayload.splitOwnerAddress,\n recipients: rewardsRecipients,\n distributorFeePercent: validatedPayload.distributorFeePercent,\n salt,\n signer: this.signer,\n chainId: this.chainId,\n });\n\n const isPrincipalSplitterDeployed = await isSplitV2Deployed({\n splitOwnerAddress: validatedPayload.splitOwnerAddress,\n recipients: principalSplitRecipients,\n distributorFeePercent: validatedPayload.distributorFeePercent,\n salt,\n signer: this.signer,\n chainId: this.chainId,\n });\n\n if (isRewardsSplitterDeployed && isPrincipalSplitterDeployed) {\n const ovmAddress = await deployOVMContract({\n OVMOwnerAddress: validatedPayload.OVMOwnerAddress,\n principalRecipient: predictedPrincipalSplitAddress,\n rewardRecipient: predictedRewardsSplitAddress,\n principalThreshold: validatedPayload.principalThreshold,\n signer: this.signer,\n chainId: this.chainId,\n });\n\n return {\n withdrawal_address: ovmAddress,\n fee_recipient_address: predictedRewardsSplitAddress,\n };\n } else {\n // Use multicall3 to deploy any contracts that aren't deployed\n const ovmAddress = await deployOVMAndSplitV2({\n ovmArgs: {\n OVMOwnerAddress: validatedPayload.OVMOwnerAddress,\n rewardRecipient: predictedRewardsSplitAddress,\n principalRecipient: predictedPrincipalSplitAddress,\n principalThreshold: validatedPayload.principalThreshold,\n },\n rewardRecipients: rewardsRecipients,\n distributorFeePercent: validatedPayload.distributorFeePercent,\n salt,\n signer: this.signer,\n chainId: this.chainId,\n principalSplitRecipients,\n isPrincipalSplitDeployed: isPrincipalSplitterDeployed,\n splitOwnerAddress: validatedPayload.splitOwnerAddress,\n });\n\n return {\n withdrawal_address: ovmAddress,\n fee_recipient_address: predictedRewardsSplitAddress,\n };\n }\n }\n\n /**\n * Requests withdrawal of validator funds from an OVM contract.\n *\n * Sends an on-chain transaction to the OVM contract requesting withdrawal\n * for the specified validator public keys and amounts.\n *\n * @param payload - Withdrawal request data including OVM address, validator\n * public keys, amounts, and fees.\n * @returns The transaction hash of the withdrawal request.\n * @throws {SignerRequiredError} If no signer was provided.\n *\n * @example\n * ```typescript\n * const { txHash } = await client.splits.requestWithdrawal({\n * ovmAddress: \"0xOVM...\",\n * pubKeys: [\"0xValidatorPubkey...\"],\n * amounts: [\"32000000000\"],\n * withdrawalFees: \"1000000000000000\",\n * });\n * ```\n */\n async requestWithdrawal(\n payload: OVMRequestWithdrawalPayload,\n ): Promise<{ txHash: string }> {\n if (!this.signer) {\n throw new SignerRequiredError('requestWithdrawal');\n }\n // [TBD] need to move ovm verification to sdk method and use it here\n const validatedPayload = validatePayload<OVMRequestWithdrawalPayload>(\n payload,\n ovmRequestWithdrawalPayloadSchema,\n );\n\n return await requestWithdrawalFromOVM({\n ovmAddress: validatedPayload.ovmAddress,\n pubKeys: validatedPayload.pubKeys,\n amounts: validatedPayload.amounts,\n withdrawalFees: validatedPayload.withdrawalFees,\n signer: this.signer,\n });\n }\n\n /**\n * Deposits validators to an OVM contract. Each deposit is sent as a separate\n * on-chain transaction.\n *\n * @param payload - Deposit data including the OVM address and an array of\n * validator deposit objects (pubkey, withdrawal_credentials, signature,\n * deposit_data_root, amount).\n * @returns An array of transaction hashes, one per deposit.\n * @throws {SignerRequiredError} If no signer was provided.\n *\n * @example\n * ```typescript\n * const { txHashes } = await client.splits.deposit({\n * ovmAddress: \"0xOVM...\",\n * deposits: [{\n * pubkey: \"0x...\",\n * withdrawal_credentials: \"0x...\",\n * signature: \"0x...\",\n * deposit_data_root: \"0x...\",\n * amount: \"32000000000000000000\",\n * }],\n * });\n * ```\n */\n async deposit(payload: OVMDepositPayload): Promise<{ txHashes: string[] }> {\n if (!this.signer) {\n throw new SignerRequiredError('deposit');\n }\n\n const validatedPayload = validatePayload<OVMDepositPayload>(\n payload,\n ovmDepositPayloadSchema,\n );\n\n return await depositOVM({\n ovmAddress: validatedPayload.ovmAddress,\n deposits: validatedPayload.deposits,\n signer: this.signer,\n });\n }\n}\n","import { ETHER_TO_GWEI } from '../constants.js';\nimport { type SignerType } from '../types.js';\nimport { Contract } from 'ethers';\nimport { BatchDepositContract } from '../abi/BatchDeposit.js';\n\n/**\n * Helper function to submit withdrawal request for EOA\n */\nexport async function submitEOAWithdrawalRequest({\n pubkey,\n allocation,\n withdrawalAddress,\n withdrawalContractAddress,\n requiredFee,\n chainId,\n signer,\n}: {\n pubkey: string;\n allocation: number;\n withdrawalAddress: string;\n withdrawalContractAddress: string;\n requiredFee: string;\n chainId: number;\n signer: SignerType;\n}): Promise<{ txHash: string | null }> {\n if (!withdrawalAddress) {\n throw new Error('No withdrawal address provided');\n }\n if (allocation === undefined || allocation === null) {\n throw new Error('No allocation provided');\n }\n\n const amountInGwei = BigInt(Math.floor(Number(allocation) * ETHER_TO_GWEI));\n const data = `0x${pubkey.slice(2)}${amountInGwei.toString(16).padStart(16, '0')}`;\n\n const tx = await signer.sendTransaction({\n to: withdrawalContractAddress,\n chainId,\n value: BigInt(requiredFee),\n data: data as `0x${string}`,\n });\n\n const receipt = await tx.wait();\n if (!receipt) return { txHash: null };\n return { txHash: receipt.hash };\n}\n\n/**\n * Helper function to submit batch deposit request for EOA\n */\nexport async function submitEOABatchDeposit({\n deposits,\n batchDepositContractAddress,\n signer,\n}: {\n deposits: Array<{\n pubkey: string;\n withdrawal_credentials: string;\n signature: string;\n deposit_data_root: string;\n amount: string;\n }>;\n batchDepositContractAddress: string;\n signer: SignerType;\n}): Promise<{ txHashes: string[] }> {\n if (!deposits || deposits.length === 0) {\n throw new Error('No deposits provided');\n }\n\n // Create contract instance\n const batchDepositContract = new Contract(\n batchDepositContractAddress,\n BatchDepositContract.abi,\n signer,\n );\n\n const BATCH_SIZE = 500;\n const txHashes: string[] = [];\n\n try {\n // Process deposits in batches of 500\n for (let i = 0; i < deposits.length; i += BATCH_SIZE) {\n const batchDeposits = deposits.slice(i, i + BATCH_SIZE);\n\n // Calculate total value needed for this batch\n const totalValue = batchDeposits.reduce(\n (sum, deposit) => sum + BigInt(deposit.amount),\n BigInt(0),\n );\n\n // Prepare deposit data for this batch\n const depositData = batchDeposits.map(deposit => ({\n pubKey: deposit.pubkey,\n withdrawalCredentials: deposit.withdrawal_credentials,\n signature: deposit.signature,\n depositDataRoot: deposit.deposit_data_root,\n amount: BigInt(deposit.amount),\n }));\n\n // Execute batch deposit for this batch\n const tx = await batchDepositContract.batchDeposit(depositData, {\n value: totalValue,\n });\n\n const receipt = await tx.wait();\n if (receipt?.hash) {\n txHashes.push(receipt.hash as string);\n }\n }\n return { txHashes };\n } catch (error: any) {\n throw new Error(\"Failed to submit batch deposit'}\");\n }\n}\n","export const BatchDepositContract = {\n abi: [\n {\n inputs: [],\n name: 'DepositValueGreaterThan2048ETH',\n type: 'error',\n },\n {\n inputs: [],\n name: 'DepositValueLessThan1ETH',\n type: 'error',\n },\n {\n inputs: [],\n name: 'DepositValueMustBeMultipleOfGwei',\n type: 'error',\n },\n {\n inputs: [],\n name: 'InvalidPubKeyLength',\n type: 'error',\n },\n {\n inputs: [],\n name: 'InvalidSignatureLength',\n type: 'error',\n },\n {\n inputs: [],\n name: 'InvalidWithdrawalCredLength',\n type: 'error',\n },\n {\n inputs: [],\n name: 'MsgValueNotEqualToTotalDepositAmount',\n type: 'error',\n },\n {\n inputs: [],\n name: 'NoDepositsProvided',\n type: 'error',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'bytes',\n name: 'pubKey',\n type: 'bytes',\n },\n {\n indexed: true,\n internalType: 'bytes',\n name: 'withdrawalCredentials',\n type: 'bytes',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'amount',\n type: 'uint256',\n },\n ],\n name: 'ValidatorDeposit',\n type: 'event',\n },\n {\n inputs: [\n {\n components: [\n {\n internalType: 'bytes',\n name: 'pubKey',\n type: 'bytes',\n },\n {\n internalType: 'bytes',\n name: 'withdrawalCredentials',\n type: 'bytes',\n },\n {\n internalType: 'bytes',\n name: 'signature',\n type: 'bytes',\n },\n {\n internalType: 'uint256',\n name: 'amount',\n type: 'uint256',\n },\n ],\n internalType: 'struct IBatchDeposit.Deposit[]',\n name: '_deposits',\n type: 'tuple[]',\n },\n ],\n name: 'batchDeposit',\n outputs: [],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'depositContract',\n outputs: [\n {\n internalType: 'contract IDepositContract',\n name: '',\n type: 'address',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n ],\n};\n","import {\n submitEOAWithdrawalRequest,\n submitEOABatchDeposit,\n} from './eoaHelpers.js';\nimport { validatePayload } from '../ajv.js';\nimport {\n eoaWithdrawalPayloadSchema,\n eoaDepositPayloadSchema,\n} from '../schema.js';\nimport { CHAIN_CONFIGURATION } from '../constants.js';\nimport { SignerRequiredError, UnsupportedChainError } from '../errors.js';\nimport {\n type ProviderType,\n type SignerType,\n type EOAWithdrawalPayload,\n type EOADepositPayload,\n} from '../types.js';\n\n/**\n * Manages Externally Owned Account (EOA) operations: validator withdrawals\n * and batch deposits via on-chain contracts.\n *\n * Do not instantiate directly; access via `client.eoa`.\n *\n * Available methods:\n * - {@link EOA.requestWithdrawal} – request validator withdrawal\n * - {@link EOA.deposit} – batch-deposit validators for gas efficiency\n *\n * All methods send on-chain transactions and require a signer with ETH for gas.\n *\n * @example\n * ```typescript\n * const client = new Client({ chainId: 1 }, signer, provider);\n *\n * // Request withdrawal\n * const { txHash } = await client.eoa.requestWithdrawal({\n * pubkey: \"0xValidatorPubkey...\",\n * allocation: 32,\n * requiredFee: \"1\",\n * });\n *\n * // Batch deposit\n * const { txHashes } = await client.eoa.deposit({\n * deposits: [{ pubkey: \"0x...\", withdrawal_credentials: \"0x...\", ... }],\n * });\n * ```\n */\nexport class EOA {\n private readonly signer: SignerType | undefined;\n public readonly chainId: number;\n public readonly provider: ProviderType | undefined | null;\n\n constructor(\n signer: SignerType | undefined,\n chainId: number,\n provider: ProviderType | undefined | null,\n ) {\n this.signer = signer;\n this.chainId = chainId;\n this.provider = provider;\n }\n\n /**\n * Requests withdrawal of validator funds via the EOA withdrawal contract.\n *\n * Sends an on-chain transaction. Requires both a signer and a provider.\n *\n * @param payload - Withdrawal data including validator `pubkey`, `allocation`\n * (in ETH), and `requiredFee` (in wei).\n * @returns The transaction hash, or `null` if no transaction was needed.\n * @throws {SignerRequiredError} If no signer was provided.\n * @throws {UnsupportedChainError} If the chain has no EOA withdrawal contract.\n *\n * @example\n * ```typescript\n * const { txHash } = await client.eoa.requestWithdrawal({\n * pubkey: \"0xValidatorPubkey...\",\n * allocation: 32,\n * requiredFee: \"1\",\n * });\n * ```\n */\n async requestWithdrawal(\n payload: EOAWithdrawalPayload,\n ): Promise<{ txHash: string | null }> {\n if (!this.signer) {\n throw new SignerRequiredError('requestWithdrawal');\n }\n\n if (!this.provider) {\n throw new Error('Provider is required in requestWithdrawal');\n }\n\n const chainConfig = CHAIN_CONFIGURATION[this.chainId];\n if (!chainConfig?.EOA_WITHDRAWAL_CONTRACT?.address) {\n throw new UnsupportedChainError(this.chainId, 'EOA requestWithdrawal');\n }\n\n const validatedPayload = validatePayload<EOAWithdrawalPayload>(\n payload,\n eoaWithdrawalPayloadSchema,\n );\n\n const withdrawalAddress = await this.signer.getAddress();\n\n return await submitEOAWithdrawalRequest({\n pubkey: validatedPayload.pubkey,\n allocation: validatedPayload.allocation,\n withdrawalAddress,\n withdrawalContractAddress: chainConfig.EOA_WITHDRAWAL_CONTRACT.address,\n requiredFee: validatedPayload.requiredFee,\n chainId: this.chainId,\n signer: this.signer,\n });\n }\n\n /**\n * Batch-deposits validators to the beacon chain via the Pier Two batch\n * deposit contract for gas efficiency.\n *\n * Due to EVM gas limits, it is recommended to deposit at most 500\n * validators per call.\n *\n * @param payload - Deposit data including an array of validator deposit objects.\n * @returns An array of transaction hashes, one per batch.\n * @throws {SignerRequiredError} If no signer was provided.\n * @throws {UnsupportedChainError} If the chain has no batch deposit contract.\n *\n * @example\n * ```typescript\n * const { txHashes } = await client.eoa.deposit({\n * deposits: [{\n * pubkey: \"0x...\",\n * withdrawal_credentials: \"0x...\",\n * deposit_data_root: \"0x...\",\n * signature: \"0x...\",\n * amount: \"32000000000000000000\",\n * }],\n * });\n * ```\n */\n async deposit(payload: EOADepositPayload): Promise<{ txHashes: string[] }> {\n if (!this.signer) {\n throw new SignerRequiredError('deposit');\n }\n\n const chainConfig = CHAIN_CONFIGURATION[this.chainId];\n if (!chainConfig?.BATCH_DEPOSIT_CONTRACT?.address) {\n throw new UnsupportedChainError(this.chainId, 'EOA deposit');\n }\n\n const validatedPayload = validatePayload<EOADepositPayload>(\n payload,\n eoaDepositPayloadSchema,\n );\n\n return await submitEOABatchDeposit({\n deposits: validatedPayload.deposits,\n batchDepositContractAddress: chainConfig.BATCH_DEPOSIT_CONTRACT.address,\n signer: this.signer,\n });\n }\n}\n","import { ClusterLockValidationBusyError } from '../errors.js';\n\n/**\n * Max in-flight `validateClusterLock` calls per process.\n * `0` = unlimited (e.g. tests: `OBOL_SDK_MAX_CONCURRENT_LOCK_VALIDATIONS=0`).\n * Default `2` — tune via env for host CPU (obol-api should set in `.env`).\n */\nexport function getMaxConcurrentLockValidations(): number {\n const raw = process.env.OBOL_SDK_MAX_CONCURRENT_LOCK_VALIDATIONS;\n if (raw === '0') return 0;\n if (raw !== undefined && raw !== '') {\n const n = Number.parseInt(raw, 10);\n if (Number.isFinite(n) && n > 0) return n;\n }\n return 2;\n}\n\nlet activeValidations = 0;\n\n/**\n * Limits parallel lock validation CPU/worker usage process-wide.\n * Rejects immediately when at capacity (no queue — avoids memory growth under flood).\n */\nexport async function withLockValidationConcurrency<T>(\n fn: () => Promise<T>,\n): Promise<T> {\n const max = getMaxConcurrentLockValidations();\n if (max === 0) return await fn();\n\n if (activeValidations >= max) {\n throw new ClusterLockValidationBusyError(max);\n }\n\n activeValidations++;\n try {\n return await fn();\n } finally {\n activeValidations--;\n }\n}\n","import { type SafeRpcUrl, type ClusterLock } from './types.js';\nimport { isValidClusterLock } from './verification/common.js';\nimport { withLockValidationConcurrency } from './verification/validationConcurrency.js';\nimport { validateClusterLockInWorker } from './verification/parallelPool.js';\n\n/**\n * Verifies the cryptographic validity of a cluster lock.\n *\n * Checks all operator signatures, config hashes, and definition hashes within\n * the lock. Supports both EOA and Safe Wallet signatures.\n *\n * This is a standalone utility – it does **not** require a `Client` instance.\n *\n * **Charon:** this covers cryptographic and structural checks in this SDK only.\n * Charon adds further runtime/protocol rules. `true` here does not guarantee\n * Charon will accept the lock; use Charon or its supported tooling as the\n * final gate before operating a cluster.\n *\n * @param lock - The cluster lock object (e.g. from {@link Client.getClusterLock}).\n * @param safeRpcUrl - Optional RPC URL for Safe Wallet signature verification.\n * If omitted, falls back to the `RPC_MAINNET` / `RPC_HOODI` / etc. env vars.\n * @returns `true` if the lock is cryptographically valid; `false` if invalid\n * (e.g. missing keys, invalid signatures, hash mismatches).\n * @throws {@link ClusterLockValidationTimeoutError} when validation exceeds a\n * worker deadline (whole-lock or per-chunk BLS workers on large clusters).\n * HTTP APIs should map this to **504 Gateway Timeout**, not **400**.\n * @throws {@link ClusterLockValidationBusyError} when concurrent validations exceed\n * `OBOL_SDK_MAX_CONCURRENT_LOCK_VALIDATIONS` (default **2**; set `0` for unlimited).\n * HTTP APIs should map this to **503 Service Unavailable**.\n *\n * @example\n * ```typescript\n * import { validateClusterLock, Client } from \"@obolnetwork/obol-sdk\";\n *\n * const configHash = \"0x...\"; // your cluster config hash\n * const client = new Client({ chainId: 560048 });\n * const lock = await client.getClusterLock(configHash);\n * const isValid = await validateClusterLock(lock);\n * ```\n */\nexport const validateClusterLock = async (\n lock: ClusterLock,\n safeRpcUrl?: SafeRpcUrl,\n): Promise<boolean> =>\n await withLockValidationConcurrency(async () => {\n const inWorker = await validateClusterLockInWorker(lock, safeRpcUrl);\n if (inWorker !== null) return inWorker;\n return await isValidClusterLock(lock, safeRpcUrl);\n });\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,MAAM,cAAc;;;ACUtB,IAAM,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A,YACR,MAAM,KAAK,UAAU,YAAY;AAAA,YACjC,SAAS;AAAA,cACP,eAAe,UAAU,uBAAuB;AAAA,YAClD;AAAA,UACF;AAAA,QACF;AACA,eAAO;AAAA,MACT,SAAS,KAAU;AACjB,cAAM;AAAA,MACR;AAAA,IACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiBM,qBAAqB,YAAgD;AAAA;AACzE,YAAM,oBAAuC,MAAM,KAAK;AAAA,QACtD,IAAI,oBAAoB,eAAe,UAAU;AAAA,QACjD;AAAA,UACE,QAAQ;AAAA,QACV;AAAA,MACF;AAEA,aAAO;AAAA,IACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAoBM,eAAe,YAA0C;AAAA;AAC7D,YAAM,OAAoB,MAAM,KAAK;AAAA,QACnC,IAAI,oBAAoB,oBAAoB,UAAU;AAAA,QACtD;AAAA,UACE,QAAQ;AAAA,QACV;AAAA,MACF;AACA,aAAO;AAAA,IACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAkBM,qBAAqB,UAAwC;AAAA;AACjE,YAAM,OAAoB,MAAM,KAAK;AAAA,QACnC,IAAI,oBAAoB,SAAS,QAAQ;AAAA,QACzC;AAAA,UACE,QAAQ;AAAA,QACV;AAAA,MACF;AACA,aAAO;AAAA,IACT;AAAA;AACF;","names":["ZeroAddress","ZeroAddress","Contract","Contract","ByteVectorType","ContainerType","fromHexString","signingRoot","ContainerType","ByteVectorType","fromHexString","signingRoot","ec","Contract","Contract"]}
|