@obolnetwork/obol-sdk 2.10.0 → 2.10.2

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/README.md CHANGED
@@ -19,7 +19,7 @@ If you're integrating this SDK with a **backend** (e.g., in Node.js), and you st
19
19
 
20
20
  ## ⚡️ Integration with Safe Wallet
21
21
 
22
- When integrating the Obol SDK with a **Safe Wallet**, you can either pass an RPC URL OR provide the `RPC_MAINNET` or `RPC_HOLESKY` or `RPC_GNOSIS` or `RPC_SEPOLIA` environment variable, pointing to the correct network's RPC URL. This is required to interact with Safe kit.
22
+ When integrating the Obol SDK with a **Safe Wallet**, you can either pass an RPC URL OR provide the `RPC_MAINNET` or `RPC_HOLESKY` or `RPC_GNOSIS` or `RPC_SEPOLIA` or `RPC_HOODI` environment variable, pointing to the correct network's RPC URL. This is required to interact with Safe kit.
23
23
 
24
24
 
25
25
  ## Contributing
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@obolnetwork/obol-sdk",
3
- "version": "2.10.0",
3
+ "version": "2.10.2",
4
4
  "description": "A package for creating Distributed Validators using the Obol API.",
5
5
  "bugs": {
6
6
  "url": "https://github.com/obolnetwork/obol-sdk/issues"
@@ -242,6 +242,7 @@ exports.PROVIDER_MAP = {
242
242
  17000: `${process.env.RPC_HOLESKY}`, // Holesky
243
243
  11155111: `${process.env.RPC_SEPOLIA}`, // Sepolia
244
244
  100: `${process.env.RPC_GNOSIS}`, // Gnosis
245
+ 560048: `${process.env.RPC_HOODI}`, // Hoodi
245
246
  };
246
247
  /**
247
248
  * Maps base fork versions to their corresponding Capella fork versions.
@@ -22,16 +22,16 @@ function submitEOAWithdrawalRequest({ pubkey, allocation, withdrawalAddress, wit
22
22
  throw new Error('No allocation provided');
23
23
  const amountInGwei = BigInt(Math.floor(Number(allocation) * constants_1.ETHER_TO_GWEI));
24
24
  const data = `0x${pubkey.slice(2)}${amountInGwei.toString(16).padStart(16, '0')}`;
25
- const { hash } = yield signer.sendTransaction({
25
+ const tx = yield signer.sendTransaction({
26
26
  to: withdrawalContractAddress,
27
27
  chainId,
28
28
  value: BigInt(requiredFee),
29
29
  data: data,
30
30
  });
31
- const txResult = yield provider.getTransactionReceipt(hash);
32
- if (!txResult)
31
+ const receipt = yield tx.wait();
32
+ if (!receipt)
33
33
  return { txHash: null };
34
- return { txHash: txResult === null || txResult === void 0 ? void 0 : txResult.hash };
34
+ return { txHash: receipt.hash };
35
35
  });
36
36
  }
37
37
  exports.submitEOAWithdrawalRequest = submitEOAWithdrawalRequest;
@@ -83,5 +83,16 @@ describe('EOA', () => {
83
83
  };
84
84
  yield expect(eoaUnsupportedChain.requestWithdrawal(mockPayload)).rejects.toThrow('EOA withdrawal contract is not configured for chain 999');
85
85
  }));
86
+ it('should return null txHash when transaction receipt is null', () => __awaiter(void 0, void 0, void 0, function* () {
87
+ const mockPayload = {
88
+ pubkey: '0x123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456',
89
+ allocation: 32,
90
+ requiredFee: '1',
91
+ };
92
+ const mockResult = { txHash: null };
93
+ eoaHelpers_1.submitEOAWithdrawalRequest.mockResolvedValue(mockResult);
94
+ const result = yield eoa.requestWithdrawal(mockPayload);
95
+ expect(result).toEqual(mockResult);
96
+ }));
86
97
  });
87
98
  });
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@obolnetwork/obol-sdk",
3
- "version": "2.10.0",
3
+ "version": "2.10.2",
4
4
  "description": "A package for creating Distributed Validators using the Obol API.",
5
5
  "bugs": {
6
6
  "url": "https://github.com/obolnetwork/obol-sdk/issues"
@@ -208,6 +208,7 @@ export const PROVIDER_MAP = {
208
208
  17000: `${process.env.RPC_HOLESKY}`, // Holesky
209
209
  11155111: `${process.env.RPC_SEPOLIA}`, // Sepolia
210
210
  100: `${process.env.RPC_GNOSIS}`, // Gnosis
211
+ 560048: `${process.env.RPC_HOODI}`, // Hoodi
211
212
  };
212
213
  /**
213
214
  * Maps base fork versions to their corresponding Capella fork versions.
@@ -19,15 +19,15 @@ export function submitEOAWithdrawalRequest({ pubkey, allocation, withdrawalAddre
19
19
  throw new Error('No allocation provided');
20
20
  const amountInGwei = BigInt(Math.floor(Number(allocation) * ETHER_TO_GWEI));
21
21
  const data = `0x${pubkey.slice(2)}${amountInGwei.toString(16).padStart(16, '0')}`;
22
- const { hash } = yield signer.sendTransaction({
22
+ const tx = yield signer.sendTransaction({
23
23
  to: withdrawalContractAddress,
24
24
  chainId,
25
25
  value: BigInt(requiredFee),
26
26
  data: data,
27
27
  });
28
- const txResult = yield provider.getTransactionReceipt(hash);
29
- if (!txResult)
28
+ const receipt = yield tx.wait();
29
+ if (!receipt)
30
30
  return { txHash: null };
31
- return { txHash: txResult === null || txResult === void 0 ? void 0 : txResult.hash };
31
+ return { txHash: receipt.hash };
32
32
  });
33
33
  }
@@ -81,5 +81,16 @@ describe('EOA', () => {
81
81
  };
82
82
  yield expect(eoaUnsupportedChain.requestWithdrawal(mockPayload)).rejects.toThrow('EOA withdrawal contract is not configured for chain 999');
83
83
  }));
84
+ it('should return null txHash when transaction receipt is null', () => __awaiter(void 0, void 0, void 0, function* () {
85
+ const mockPayload = {
86
+ pubkey: '0x123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456',
87
+ allocation: 32,
88
+ requiredFee: '1',
89
+ };
90
+ const mockResult = { txHash: null };
91
+ submitEOAWithdrawalRequest.mockResolvedValue(mockResult);
92
+ const result = yield eoa.requestWithdrawal(mockPayload);
93
+ expect(result).toEqual(mockResult);
94
+ }));
84
95
  });
85
96
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@obolnetwork/obol-sdk",
3
- "version": "2.10.0",
3
+ "version": "2.10.2",
4
4
  "description": "A package for creating Distributed Validators using the Obol API.",
5
5
  "bugs": {
6
6
  "url": "https://github.com/obolnetwork/obol-sdk/issues"
package/src/constants.ts CHANGED
@@ -276,6 +276,7 @@ export const PROVIDER_MAP: Record<number, string> = {
276
276
  17000: `${process.env.RPC_HOLESKY}`, // Holesky
277
277
  11155111: `${process.env.RPC_SEPOLIA}`, // Sepolia
278
278
  100: `${process.env.RPC_GNOSIS}`, // Gnosis
279
+ 560048: `${process.env.RPC_HOODI}`, // Hoodi
279
280
  };
280
281
 
281
282
  /**
@@ -29,15 +29,14 @@ export async function submitEOAWithdrawalRequest({
29
29
  const amountInGwei = BigInt(Math.floor(Number(allocation) * ETHER_TO_GWEI));
30
30
  const data = `0x${pubkey.slice(2)}${amountInGwei.toString(16).padStart(16, '0')}`;
31
31
 
32
- const { hash } = await signer.sendTransaction({
32
+ const tx = await signer.sendTransaction({
33
33
  to: withdrawalContractAddress,
34
34
  chainId,
35
35
  value: BigInt(requiredFee),
36
36
  data: data as `0x${string}`,
37
37
  });
38
38
 
39
- const txResult = await provider.getTransactionReceipt(hash);
40
- if (!txResult) return { txHash: null };
41
-
42
- return { txHash: txResult?.hash };
39
+ const receipt = await tx.wait();
40
+ if (!receipt) return { txHash: null };
41
+ return { txHash: receipt.hash };
43
42
  }