@obolnetwork/obol-sdk 2.11.7 → 2.11.9
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 +26 -43
- package/dist/browser/src/index.js.map +1 -1
- package/dist/cjs/src/index.js +26 -43
- package/dist/cjs/src/index.js.map +1 -1
- package/dist/esm/src/index.js +26 -43
- package/dist/esm/src/index.js.map +1 -1
- package/dist/types/src/splits/splitHelpers.d.ts +2 -3
- package/dist/types/src/splits/splits.d.ts +7 -3
- package/package.json +1 -1
|
@@ -92,7 +92,7 @@ import { v4 as uuidv4 } from "uuid";
|
|
|
92
92
|
// package.json
|
|
93
93
|
var package_default = {
|
|
94
94
|
name: "@obolnetwork/obol-sdk",
|
|
95
|
-
version: "2.11.
|
|
95
|
+
version: "2.11.9",
|
|
96
96
|
description: "A package for creating Distributed Validators using the Obol API.",
|
|
97
97
|
bugs: {
|
|
98
98
|
url: "https://github.com/obolnetwork/obol-sdk/issues"
|
|
@@ -632,7 +632,7 @@ var isContractAvailable = (contractAddress, provider, bytecode) => __async(null,
|
|
|
632
632
|
if (bytecode) {
|
|
633
633
|
return !!code2 && code2 === bytecode;
|
|
634
634
|
}
|
|
635
|
-
return !!code2 && code2 !== "0x" && code2 !== "0x0";
|
|
635
|
+
return !!code2 && code2 !== "0x" && code2 !== "0x0" && !code2.startsWith("0xef0100");
|
|
636
636
|
});
|
|
637
637
|
var getProvider = (chainId, rpcUrl) => {
|
|
638
638
|
const resolvedRpcUrl = rpcUrl != null ? rpcUrl : PROVIDER_MAP[chainId];
|
|
@@ -12496,7 +12496,9 @@ var validateEOASignature = ({
|
|
|
12496
12496
|
try {
|
|
12497
12497
|
const sig = ethers2.Signature.from(token);
|
|
12498
12498
|
const digest2 = TypedDataUtils.eip712Hash(data, SignTypedDataVersion.V4);
|
|
12499
|
-
|
|
12499
|
+
const recovered = ethers2.getAddress(ethers2.recoverAddress(digest2, sig));
|
|
12500
|
+
const normalizedAddress = ethers2.getAddress(address);
|
|
12501
|
+
return recovered === normalizedAddress;
|
|
12500
12502
|
} catch (err) {
|
|
12501
12503
|
console.error(`validate EOA Signature error: ${err}`);
|
|
12502
12504
|
throw err;
|
|
@@ -16377,43 +16379,23 @@ var requestWithdrawalFromOVM = (_0) => __async(null, [_0], function* ({
|
|
|
16377
16379
|
throw new Error(`Failed to request withdrawal from OVM: ${errorMessage}`);
|
|
16378
16380
|
}
|
|
16379
16381
|
});
|
|
16380
|
-
var
|
|
16382
|
+
var depositOVM = (_0) => __async(null, [_0], function* ({
|
|
16381
16383
|
ovmAddress,
|
|
16382
16384
|
deposits,
|
|
16383
|
-
signer
|
|
16384
|
-
chainId
|
|
16385
|
+
signer
|
|
16385
16386
|
}) {
|
|
16386
16387
|
try {
|
|
16387
16388
|
const ovmContract = new Contract(ovmAddress, OVMContract.abi, signer);
|
|
16388
|
-
const chainConfig = getChainConfig(chainId);
|
|
16389
|
-
const multicall3Address = chainConfig.MULTICALL3_CONTRACT.address;
|
|
16390
|
-
const multiCall3ContractInstance = new Contract(
|
|
16391
|
-
multicall3Address,
|
|
16392
|
-
MultiCall3Contract.abi,
|
|
16393
|
-
signer
|
|
16394
|
-
);
|
|
16395
|
-
const BATCH_SIZE = 500;
|
|
16396
16389
|
const txHashes = [];
|
|
16397
|
-
for (
|
|
16398
|
-
const
|
|
16399
|
-
|
|
16400
|
-
|
|
16401
|
-
|
|
16402
|
-
|
|
16403
|
-
|
|
16404
|
-
deposit.
|
|
16405
|
-
|
|
16406
|
-
deposit.deposit_data_root
|
|
16407
|
-
]),
|
|
16408
|
-
value: BigInt(deposit.amount)
|
|
16409
|
-
}));
|
|
16410
|
-
const totalBatchValue = callsWithValue.reduce(
|
|
16411
|
-
(sum, c) => sum + c.value,
|
|
16412
|
-
BigInt(0)
|
|
16413
|
-
);
|
|
16414
|
-
const tx = yield multiCall3ContractInstance.aggregate3Value(
|
|
16415
|
-
callsWithValue,
|
|
16416
|
-
{ value: totalBatchValue }
|
|
16390
|
+
for (const deposit of deposits) {
|
|
16391
|
+
const tx = yield ovmContract.deposit(
|
|
16392
|
+
deposit.pubkey,
|
|
16393
|
+
deposit.withdrawal_credentials,
|
|
16394
|
+
deposit.signature,
|
|
16395
|
+
deposit.deposit_data_root,
|
|
16396
|
+
{
|
|
16397
|
+
value: BigInt(deposit.amount)
|
|
16398
|
+
}
|
|
16417
16399
|
);
|
|
16418
16400
|
const receipt = yield tx.wait();
|
|
16419
16401
|
if (receipt == null ? void 0 : receipt.hash) {
|
|
@@ -16423,9 +16405,7 @@ var depositWithMulticall3 = (_0) => __async(null, [_0], function* ({
|
|
|
16423
16405
|
return { txHashes };
|
|
16424
16406
|
} catch (error) {
|
|
16425
16407
|
const errorMessage = error instanceof Error ? error.message : "Deposit failed";
|
|
16426
|
-
throw new Error(
|
|
16427
|
-
`Failed to deposit to OVM with multicall3: ${errorMessage}`
|
|
16428
|
-
);
|
|
16408
|
+
throw new Error(`Failed to deposit to OVM: ${errorMessage}`);
|
|
16429
16409
|
}
|
|
16430
16410
|
});
|
|
16431
16411
|
|
|
@@ -17245,6 +17225,8 @@ var ObolSplits = class {
|
|
|
17245
17225
|
* **⚠️ Important:** If you're storing the private key in an `.env` file, ensure it is securely managed
|
|
17246
17226
|
* and not pushed to version control.
|
|
17247
17227
|
*
|
|
17228
|
+
* **📌 Note:** The Obol Validator Manager (OVM) feature is only enabled on Hoodi on launchpad.
|
|
17229
|
+
*
|
|
17248
17230
|
* @param {OVMRewardsSplitPayload} payload - Data needed to deploy OVM and SplitV2
|
|
17249
17231
|
* @returns {Promise<ClusterValidator>} OVM address as withdrawal address and splitter as fee recipient
|
|
17250
17232
|
* @throws Will throw an error if the splitter configuration is not supported or deployment fails
|
|
@@ -17381,6 +17363,8 @@ var ObolSplits = class {
|
|
|
17381
17363
|
* **⚠️ Important:** If you're storing the private key in an `.env` file, ensure it is securely managed
|
|
17382
17364
|
* and not pushed to version control.
|
|
17383
17365
|
*
|
|
17366
|
+
* **📌 Note:** The Obol Validator Manager (OVM) feature is only enabled on Hoodi on launchpad.
|
|
17367
|
+
*
|
|
17384
17368
|
* @param {OVMTotalSplitPayload} payload - Data needed to deploy OVM and SplitV2
|
|
17385
17369
|
* @returns {Promise<ClusterValidator>} OVM address as withdrawal address and splitter as fee recipient
|
|
17386
17370
|
* @throws Will throw an error if the splitter configuration is not supported or deployment fails
|
|
@@ -17571,9 +17555,9 @@ var ObolSplits = class {
|
|
|
17571
17555
|
});
|
|
17572
17556
|
}
|
|
17573
17557
|
/**
|
|
17574
|
-
* Deposits to OVM contract
|
|
17558
|
+
* Deposits to OVM contract by sending individual transactions for each deposit.
|
|
17575
17559
|
*
|
|
17576
|
-
* This method allows depositing to an OVM contract
|
|
17560
|
+
* This method allows depositing to an OVM contract. Each deposit is sent as a separate transaction
|
|
17577
17561
|
* Each deposit includes validator public key, withdrawal credentials, signature, deposit data root, and amount.
|
|
17578
17562
|
*
|
|
17579
17563
|
* @remarks
|
|
@@ -17581,7 +17565,7 @@ var ObolSplits = class {
|
|
|
17581
17565
|
* and not pushed to version control.
|
|
17582
17566
|
*
|
|
17583
17567
|
* @param {OVMDepositPayload} payload - Data needed to deposit to OVM
|
|
17584
|
-
* @returns {Promise<{txHashes: string[]}>} Array of transaction hashes for
|
|
17568
|
+
* @returns {Promise<{txHashes: string[]}>} Array of transaction hashes, one for each deposit
|
|
17585
17569
|
* @throws Will throw an error if the signer is not provided, OVM address is invalid, or the deposit fails
|
|
17586
17570
|
*
|
|
17587
17571
|
* An example of how to use deposit:
|
|
@@ -17608,11 +17592,10 @@ var ObolSplits = class {
|
|
|
17608
17592
|
payload,
|
|
17609
17593
|
ovmDepositPayloadSchema
|
|
17610
17594
|
);
|
|
17611
|
-
return yield
|
|
17595
|
+
return yield depositOVM({
|
|
17612
17596
|
ovmAddress: validatedPayload.ovmAddress,
|
|
17613
17597
|
deposits: validatedPayload.deposits,
|
|
17614
|
-
signer: this.signer
|
|
17615
|
-
chainId: this.chainId
|
|
17598
|
+
signer: this.signer
|
|
17616
17599
|
});
|
|
17617
17600
|
});
|
|
17618
17601
|
}
|