@obolnetwork/obol-sdk 2.11.4 → 2.11.5-rc.1

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.
Files changed (144) hide show
  1. package/README.md +33 -0
  2. package/dist/browser/src/index.js +18280 -0
  3. package/dist/browser/src/index.js.map +1 -0
  4. package/dist/cjs/src/index.js +17470 -382
  5. package/dist/cjs/src/index.js.map +1 -0
  6. package/dist/esm/src/index.js +17437 -361
  7. package/dist/esm/src/index.js.map +1 -0
  8. package/dist/types/src/constants.d.ts +1 -2
  9. package/dist/types/src/eoa/eoaHelpers.d.ts +1 -1
  10. package/dist/types/src/exits/verificationHelpers.d.ts +0 -2
  11. package/dist/types/src/incentives/incentiveHelpers.d.ts +1 -1
  12. package/dist/types/src/splits/splitHelpers.d.ts +3 -3
  13. package/dist/types/src/utils.d.ts +2 -2
  14. package/dist/types/src/verification/common.d.ts +0 -2
  15. package/dist/types/src/verification/signature-validator.d.ts +4 -4
  16. package/dist/types/src/verification/v1.10.0.d.ts +1 -1
  17. package/dist/types/src/verification/v1.6.0.d.ts +1 -1
  18. package/dist/types/src/verification/v1.7.0.d.ts +1 -1
  19. package/dist/types/src/verification/v1.8.0.d.ts +1 -1
  20. package/dist/types/test/client/methods.spec.d.ts +17 -0
  21. package/dist/types/tsconfig.types.tsbuildinfo +1 -0
  22. package/dist/types/tsup.config.d.ts +2 -0
  23. package/package.json +96 -58
  24. package/dist/cjs/package.json +0 -139
  25. package/dist/cjs/src/abi/BatchDeposit.js +0 -120
  26. package/dist/cjs/src/abi/MerkleDistributorWithDeadline.js +0 -73
  27. package/dist/cjs/src/abi/Multicall3.js +0 -253
  28. package/dist/cjs/src/abi/OVM.js +0 -627
  29. package/dist/cjs/src/abi/OWR.js +0 -304
  30. package/dist/cjs/src/abi/SplitMain.js +0 -929
  31. package/dist/cjs/src/abi/splitV2FactoryAbi.js +0 -420
  32. package/dist/cjs/src/ajv.js +0 -136
  33. package/dist/cjs/src/base.js +0 -42
  34. package/dist/cjs/src/bytecodes.js +0 -19
  35. package/dist/cjs/src/constants.js +0 -272
  36. package/dist/cjs/src/eoa/eoa.js +0 -132
  37. package/dist/cjs/src/eoa/eoaHelpers.js +0 -82
  38. package/dist/cjs/src/errors.js +0 -11
  39. package/dist/cjs/src/exits/ethUtils.js +0 -57
  40. package/dist/cjs/src/exits/exit.js +0 -502
  41. package/dist/cjs/src/exits/verificationHelpers.js +0 -86
  42. package/dist/cjs/src/incentives/incentiveHelpers.js +0 -39
  43. package/dist/cjs/src/incentives/incentives.js +0 -119
  44. package/dist/cjs/src/schema.js +0 -352
  45. package/dist/cjs/src/services.js +0 -33
  46. package/dist/cjs/src/splits/splitHelpers.js +0 -571
  47. package/dist/cjs/src/splits/splits.js +0 -366
  48. package/dist/cjs/src/types.js +0 -29
  49. package/dist/cjs/src/utils.js +0 -77
  50. package/dist/cjs/src/verification/common.js +0 -355
  51. package/dist/cjs/src/verification/signature-validator.js +0 -73
  52. package/dist/cjs/src/verification/sszTypes.js +0 -69
  53. package/dist/cjs/src/verification/termsAndConditions.js +0 -40
  54. package/dist/cjs/src/verification/v1.10.0.js +0 -146
  55. package/dist/cjs/src/verification/v1.6.0.js +0 -149
  56. package/dist/cjs/src/verification/v1.7.0.js +0 -173
  57. package/dist/cjs/src/verification/v1.8.0.js +0 -196
  58. package/dist/cjs/test/client/ajv.spec.js +0 -320
  59. package/dist/cjs/test/client/methods.spec.js +0 -418
  60. package/dist/cjs/test/eoa/eoa.spec.js +0 -176
  61. package/dist/cjs/test/exit/ethUtils.spec.js +0 -83
  62. package/dist/cjs/test/exit/exit.spec.js +0 -399
  63. package/dist/cjs/test/exit/verificationHelpers.spec.js +0 -68
  64. package/dist/cjs/test/fixtures.js +0 -896
  65. package/dist/cjs/test/incentives/incentives.spec.js +0 -202
  66. package/dist/cjs/test/splits/splits.spec.js +0 -402
  67. package/dist/esm/package.json +0 -139
  68. package/dist/esm/src/abi/BatchDeposit.js +0 -117
  69. package/dist/esm/src/abi/MerkleDistributorWithDeadline.js +0 -70
  70. package/dist/esm/src/abi/Multicall3.js +0 -250
  71. package/dist/esm/src/abi/OVM.js +0 -624
  72. package/dist/esm/src/abi/OWR.js +0 -301
  73. package/dist/esm/src/abi/SplitMain.js +0 -926
  74. package/dist/esm/src/abi/splitV2FactoryAbi.js +0 -417
  75. package/dist/esm/src/ajv.js +0 -129
  76. package/dist/esm/src/base.js +0 -38
  77. package/dist/esm/src/bytecodes.js +0 -16
  78. package/dist/esm/src/constants.js +0 -238
  79. package/dist/esm/src/eoa/eoa.js +0 -128
  80. package/dist/esm/src/eoa/eoaHelpers.js +0 -77
  81. package/dist/esm/src/errors.js +0 -7
  82. package/dist/esm/src/exits/ethUtils.js +0 -52
  83. package/dist/esm/src/exits/exit.js +0 -475
  84. package/dist/esm/src/exits/verificationHelpers.js +0 -81
  85. package/dist/esm/src/incentives/incentiveHelpers.js +0 -34
  86. package/dist/esm/src/incentives/incentives.js +0 -115
  87. package/dist/esm/src/schema.js +0 -349
  88. package/dist/esm/src/services.js +0 -29
  89. package/dist/esm/src/splits/splitHelpers.js +0 -554
  90. package/dist/esm/src/splits/splits.js +0 -362
  91. package/dist/esm/src/types.js +0 -26
  92. package/dist/esm/src/utils.js +0 -68
  93. package/dist/esm/src/verification/common.js +0 -319
  94. package/dist/esm/src/verification/signature-validator.js +0 -64
  95. package/dist/esm/src/verification/sszTypes.js +0 -64
  96. package/dist/esm/src/verification/termsAndConditions.js +0 -33
  97. package/dist/esm/src/verification/v1.10.0.js +0 -140
  98. package/dist/esm/src/verification/v1.6.0.js +0 -142
  99. package/dist/esm/src/verification/v1.7.0.js +0 -166
  100. package/dist/esm/src/verification/v1.8.0.js +0 -189
  101. package/dist/esm/test/client/ajv.spec.js +0 -318
  102. package/dist/esm/test/client/methods.spec.js +0 -393
  103. package/dist/esm/test/eoa/eoa.spec.js +0 -174
  104. package/dist/esm/test/exit/ethUtils.spec.js +0 -81
  105. package/dist/esm/test/exit/exit.spec.js +0 -374
  106. package/dist/esm/test/exit/verificationHelpers.spec.js +0 -66
  107. package/dist/esm/test/fixtures.js +0 -893
  108. package/dist/esm/test/incentives/incentives.spec.js +0 -177
  109. package/dist/esm/test/splits/splits.spec.js +0 -400
  110. package/dist/types/src/verification/termsAndConditions.d.ts +0 -1
  111. package/src/abi/BatchDeposit.ts +0 -117
  112. package/src/abi/MerkleDistributorWithDeadline.ts +0 -70
  113. package/src/abi/Multicall3.ts +0 -250
  114. package/src/abi/OVM.ts +0 -624
  115. package/src/abi/OWR.ts +0 -302
  116. package/src/abi/SplitMain.ts +0 -927
  117. package/src/abi/splitV2FactoryAbi.ts +0 -417
  118. package/src/ajv.ts +0 -191
  119. package/src/base.ts +0 -54
  120. package/src/bytecodes.ts +0 -32
  121. package/src/constants.ts +0 -309
  122. package/src/eoa/eoa.ts +0 -153
  123. package/src/eoa/eoaHelpers.ts +0 -112
  124. package/src/errors.ts +0 -8
  125. package/src/exits/ethUtils.ts +0 -49
  126. package/src/exits/exit.ts +0 -661
  127. package/src/exits/verificationHelpers.ts +0 -110
  128. package/src/incentives/incentiveHelpers.ts +0 -55
  129. package/src/incentives/incentives.ts +0 -153
  130. package/src/index.ts +0 -614
  131. package/src/schema.ts +0 -376
  132. package/src/services.ts +0 -24
  133. package/src/splits/splitHelpers.ts +0 -1032
  134. package/src/splits/splits.ts +0 -504
  135. package/src/types.ts +0 -687
  136. package/src/utils.ts +0 -88
  137. package/src/verification/common.ts +0 -532
  138. package/src/verification/signature-validator.ts +0 -103
  139. package/src/verification/sszTypes.ts +0 -88
  140. package/src/verification/termsAndConditions.ts +0 -32
  141. package/src/verification/v1.10.0.ts +0 -245
  142. package/src/verification/v1.6.0.ts +0 -256
  143. package/src/verification/v1.7.0.ts +0 -309
  144. package/src/verification/v1.8.0.ts +0 -340
@@ -1,6 +1,6 @@
1
1
  import { type TypedMessage } from '@metamask/eth-sig-util';
2
2
  import { type TypedDataDomain } from 'ethers';
3
- import { type ChainConfig } from './types';
3
+ import { type ChainConfig } from './types.js';
4
4
  export declare const CONFLICT_ERROR_MSG = "Conflict";
5
5
  export declare const EIP712_DOMAIN_NAME = "Obol";
6
6
  export declare const EIP712_DOMAIN_VERSION = "1";
@@ -104,4 +104,3 @@ export declare const PROVIDER_MAP: Record<number, string>;
104
104
  * Example: Mainnet Capella fork version.
105
105
  */
106
106
  export declare const CAPELLA_FORK_MAPPING: Record<string, string>;
107
- export declare const CHAIN_PUBLIC_RPC_URL: Record<number, string>;
@@ -1,4 +1,4 @@
1
- import { type SignerType, type ProviderType } from '../types';
1
+ import { type SignerType, type ProviderType } from '../types.js';
2
2
  /**
3
3
  * Helper function to submit withdrawal request for EOA
4
4
  */
@@ -1,5 +1,3 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
1
  export declare const GENESIS_VALIDATOR_ROOT_HEX_STRING = "0x0000000000000000000000000000000000000000000000000000000000000000";
4
2
  /**
5
3
  * Computes the domain for a given domain type, fork version, and genesis state.
@@ -1,4 +1,4 @@
1
- import { type ProviderType, type SignerType, type ETH_ADDRESS } from '../types';
1
+ import { type ProviderType, type SignerType, type ETH_ADDRESS } from '../types.js';
2
2
  export declare const claimIncentivesFromMerkleDistributor: (incentivesData: {
3
3
  signer: SignerType;
4
4
  contractAddress: ETH_ADDRESS;
@@ -90,13 +90,13 @@ export declare const deployOVMContract: ({ OVMOwnerAddress, principalRecipient,
90
90
  export declare const deployOVMAndSplitV2: ({ ovmArgs, rewardRecipients, isRewardsSplitterDeployed, distributorFeePercent, salt, signer, chainId, principalSplitRecipients, isPrincipalSplitDeployed, splitOwnerAddress, }: {
91
91
  ovmArgs: OVMArgs;
92
92
  rewardRecipients: SplitV2Recipient[];
93
- isRewardsSplitterDeployed?: boolean | undefined;
93
+ isRewardsSplitterDeployed?: boolean;
94
94
  distributorFeePercent: number;
95
95
  salt: `0x${string}`;
96
96
  signer: SignerType;
97
97
  chainId: number;
98
- principalSplitRecipients?: SplitV2Recipient[] | undefined;
99
- isPrincipalSplitDeployed?: boolean | undefined;
98
+ principalSplitRecipients?: SplitV2Recipient[];
99
+ isPrincipalSplitDeployed?: boolean;
100
100
  splitOwnerAddress: string;
101
101
  }) => Promise<string>;
102
102
  /**
@@ -1,6 +1,6 @@
1
1
  import { ethers } from 'ethers';
2
- import { DefinitionFlow } from './constants';
3
- import { type ProviderType, type ClusterDefinition } from './types';
2
+ import { DefinitionFlow } from './constants.js';
3
+ import { type ProviderType, type ClusterDefinition } from './types.js';
4
4
  export declare const hexWithout0x: (hex: string) => string;
5
5
  export declare const strToUint8Array: (str: string) => Uint8Array;
6
6
  export declare const definitionFlow: (clusterDefinition: ClusterDefinition) => DefinitionFlow | null;
@@ -1,5 +1,3 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
1
  import { type ClusterDefinition, type ClusterLock, type DepositData, type DistributedValidator, type SafeRpcUrl } from '../types.js';
4
2
  /**
5
3
  * @param cluster The cluster configuration or the cluster definition
@@ -1,12 +1,12 @@
1
1
  import { type TypedMessage } from '@metamask/eth-sig-util';
2
- import { type EIP712TypedData } from '@safe-global/safe-core-sdk-types';
3
- import { type SafeRpcUrl } from '../types';
2
+ import { type EIP712TypedData } from '@safe-global/types-kit';
3
+ import { type SafeRpcUrl } from '../types.js';
4
4
  export declare const validateAddressSignature: ({ address, token, data, chainId, safeRpcUrl, }: {
5
5
  address: string;
6
6
  token: string;
7
7
  data: TypedMessage<any>;
8
8
  chainId: number;
9
- safeRpcUrl?: string | undefined;
9
+ safeRpcUrl?: SafeRpcUrl;
10
10
  }) => Promise<boolean>;
11
11
  export declare const validateEOASignature: ({ token, data, address, }: {
12
12
  token: string;
@@ -18,5 +18,5 @@ export declare const validateSmartContractSignature: ({ token, data, address, ch
18
18
  data: EIP712TypedData;
19
19
  address: string;
20
20
  chainId: number;
21
- safeRpcUrl?: string | undefined;
21
+ safeRpcUrl?: SafeRpcUrl;
22
22
  }) => Promise<boolean>;
@@ -34,5 +34,5 @@ export declare const hashClusterDefinitionV1X10: (cluster: ClusterDefinition, co
34
34
  * @returns The lock hash in of the corresponding cluster
35
35
  */
36
36
  export declare const hashClusterLockV1X10: (cluster: ClusterLock) => string;
37
- export declare const verifyDVV1X10: (clusterLock: ClusterLock) => boolean;
37
+ export declare const verifyDVV1X10: (clusterLock: ClusterLock) => Promise<boolean>;
38
38
  export {};
@@ -30,5 +30,5 @@ export declare const hashClusterDefinitionV1X6: (cluster: ClusterDefinition, con
30
30
  * @returns The lock hash in of the corresponding cluster
31
31
  */
32
32
  export declare const hashClusterLockV1X6: (cluster: ClusterLock) => string;
33
- export declare const verifyDVV1X6: (clusterLock: ClusterLock) => boolean;
33
+ export declare const verifyDVV1X6: (clusterLock: ClusterLock) => Promise<boolean>;
34
34
  export {};
@@ -30,5 +30,5 @@ export declare const hashClusterDefinitionV1X7: (cluster: ClusterDefinition, con
30
30
  * @returns The lock hash in of the corresponding cluster
31
31
  */
32
32
  export declare const hashClusterLockV1X7: (cluster: ClusterLock) => string;
33
- export declare const verifyDVV1X7: (clusterLock: ClusterLock) => boolean;
33
+ export declare const verifyDVV1X7: (clusterLock: ClusterLock) => Promise<boolean>;
34
34
  export {};
@@ -31,5 +31,5 @@ export declare const hashClusterDefinitionV1X8: (cluster: ClusterDefinition, con
31
31
  * @returns The lock hash in of the corresponding cluster
32
32
  */
33
33
  export declare const hashClusterLockV1X8: (cluster: ClusterLock) => string;
34
- export declare const verifyDVV1X8: (clusterLock: ClusterLock) => boolean;
34
+ export declare const verifyDVV1X8: (clusterLock: ClusterLock) => Promise<boolean>;
35
35
  export {};
@@ -1 +1,18 @@
1
1
  export {};
2
+ /**
3
+ * Note: Tests for createObolRewardsSplit and createObolTotalSplit are in the e2e test suite
4
+ * See: test/sdk-package/cluster.spec.ts
5
+ *
6
+ * These methods require real blockchain interactions (contract deployments) which cannot be
7
+ * effectively mocked in unit tests with Jest 29 + ESM. The e2e tests cover:
8
+ *
9
+ * createObolRewardsSplit:
10
+ * - Deploy OWR and splitter with various configurations
11
+ * - Tests: signer validation, chainId validation, recipient validation, ObolRAFSplit validation,
12
+ * contract deployment, address prediction, and tranches retrieval
13
+ *
14
+ * createObolTotalSplit:
15
+ * - Deploy splitter contracts with various configurations
16
+ * - Tests: same recipients return same addresses, different configs return different addresses,
17
+ * distributorFee and controllerAddress parameters
18
+ */
@@ -0,0 +1 @@
1
+ {"root":["../../tsup.config.ts","../../src/ajv.ts","../../src/base.ts","../../src/bytecodes.ts","../../src/constants.ts","../../src/errors.ts","../../src/index.ts","../../src/schema.ts","../../src/services.ts","../../src/types.ts","../../src/utils.ts","../../src/abi/BatchDeposit.ts","../../src/abi/MerkleDistributorWithDeadline.ts","../../src/abi/Multicall3.ts","../../src/abi/OVM.ts","../../src/abi/OWR.ts","../../src/abi/SplitMain.ts","../../src/abi/splitV2FactoryAbi.ts","../../src/eoa/eoa.ts","../../src/eoa/eoaHelpers.ts","../../src/exits/ethUtils.ts","../../src/exits/exit.ts","../../src/exits/verificationHelpers.ts","../../src/incentives/incentiveHelpers.ts","../../src/incentives/incentives.ts","../../src/splits/splitHelpers.ts","../../src/splits/splits.ts","../../src/verification/common.ts","../../src/verification/signature-validator.ts","../../src/verification/sszTypes.ts","../../src/verification/v1.10.0.ts","../../src/verification/v1.6.0.ts","../../src/verification/v1.7.0.ts","../../src/verification/v1.8.0.ts","../../test/fixtures.ts","../../test/client/ajv.spec.ts","../../test/client/methods.spec.ts","../../test/eoa/eoa.spec.ts","../../test/exit/ethUtils.spec.ts","../../test/exit/exit.spec.ts","../../test/exit/verificationHelpers.spec.ts","../../test/incentives/incentives.spec.ts","../../test/splits/splits.spec.ts"],"version":"5.9.3"}
@@ -0,0 +1,2 @@
1
+ declare const _default: import("tsup").Options | import("tsup").Options[] | ((overrideOptions: import("tsup").Options) => import("tsup").Options | import("tsup").Options[] | Promise<import("tsup").Options | import("tsup").Options[]>);
2
+ export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@obolnetwork/obol-sdk",
3
- "version": "2.11.4",
3
+ "version": "2.11.5-rc.1",
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"
@@ -12,23 +12,39 @@
12
12
  "Ethereum"
13
13
  ],
14
14
  "scripts": {
15
- "compile": "tsc -b ./tsconfig.cjs.json ./tsconfig.esm.json ./tsconfig.types.json",
16
15
  "build:clean": "rm -rf ./dist",
17
- "build": "npm-run-all build:clean compile",
18
- "test": "jest test/**/*.spec.ts --testPathIgnorePatterns=test/sdk-package/",
16
+ "build": "npm-run-all build:clean build:tsup",
17
+ "build:tsup": "tsup && tsc -b ./tsconfig.types.json",
18
+ "test": "NODE_OPTIONS=--experimental-vm-modules jest test/**/**.spec.ts --testPathIgnorePatterns=test/sdk-package/",
19
19
  "generate-typedoc": "typedoc",
20
20
  "npm:publish": "npm publish --tag latest",
21
+ "npm:publish:next": "npm publish --tag next",
21
22
  "release": "release-it",
22
23
  "release:dry": "release-it --dry-run --no-npm",
23
- "lint": "eslint \"{src,test}/**/*.{js,ts}\" --fix",
24
- "lint-ci": "eslint \"{src,test}/**/*.{js,ts}\"",
25
- "prettier-ci": "prettier --check \"{src,test}/**/*.{js,ts}\"",
26
- "prettier": "prettier --write \"{src,test}/**/*.{js,ts}\"",
24
+ "lint": "eslint \"{src}/**/*.{js,ts}\" --fix",
25
+ "lint-ci": "eslint ./src --ext .ts,.js",
26
+ "prettier-ci": "prettier --check ./src --ext .ts,.js",
27
+ "prettier": "prettier --write \"{src}/**/*.{js,ts}\"",
27
28
  "docs": "typedoc"
28
29
  },
29
30
  "main": "./dist/cjs/src/index.js",
30
31
  "module": "./dist/esm/src/index.js",
32
+ "browser": "./dist/browser/src/index.js",
31
33
  "typings": "./dist/types/src/index.d.ts",
34
+ "exports": {
35
+ ".": {
36
+ "types": "./dist/types/src/index.d.ts",
37
+ "browser": {
38
+ "import": "./dist/browser/src/index.js",
39
+ "default": "./dist/browser/src/index.js"
40
+ },
41
+ "node": {
42
+ "import": "./dist/esm/src/index.js",
43
+ "require": "./dist/cjs/src/index.js"
44
+ },
45
+ "default": "./dist/esm/src/index.js"
46
+ }
47
+ },
32
48
  "author": "Obol Labs (https://obol.org)",
33
49
  "repository": {
34
50
  "type": "git",
@@ -41,50 +57,49 @@
41
57
  },
42
58
  "dependencies": {
43
59
  "@chainsafe/bls": "6.0.3",
44
- "@chainsafe/blst": "^0.2.9",
45
- "@chainsafe/discv5": "^0.5.1",
60
+ "@chainsafe/blst": "^0.2.0",
61
+ "@chainsafe/enr": "^5.0.1",
46
62
  "@chainsafe/ssz": "^0.14.0",
47
- "@metamask/eth-sig-util": "^7.0.1",
48
- "@safe-global/protocol-kit": "4.1.1",
49
- "@safe-global/safe-core-sdk-types": "5.1.0",
50
- "@types/pdf-parse": "^1.1.4",
51
- "ajv": "^8.12.0",
63
+ "@metamask/eth-sig-util": "^8.2.0",
64
+ "@safe-global/protocol-kit": "6.1.1",
65
+ "@safe-global/types-kit": "^3.0.0",
66
+ "ajv": "^8.17.1",
52
67
  "ajv-formats": "^3.0.1",
53
68
  "ajv-keywords": "^5.1.0",
54
- "cross-fetch": "^3.1.5",
55
- "dotenv": "^16.4.7",
56
- "elliptic": "^6.5.4",
57
- "eslint-config-standard-with-typescript": "^43.0.1",
58
- "eslint-plugin-import": "^2.29.1",
59
- "eslint-plugin-n": "^16.6.2",
60
- "eslint-plugin-promise": "^6.1.1",
61
- "ethers": "^6.13.5",
62
- "nock": "^13.5.3",
63
- "pdf-parse": "^1.1.1",
64
- "semver": "^7.6.0",
65
- "typescript-eslint": "^7.1.0",
69
+ "cross-fetch": "^4.1.0",
70
+ "dotenv": "^17.2.2",
71
+ "elliptic": "^6.6.1",
72
+ "ethers": "^6.15.0",
73
+ "semver": "^7.7.2",
66
74
  "uuid": "^9.0.0"
67
75
  },
68
76
  "devDependencies": {
69
- "@release-it/conventional-changelog": "^8.0.1",
77
+ "@release-it/conventional-changelog": "^10.0.1",
70
78
  "@types/elliptic": "^6.4.18",
71
- "@types/jest": "^28.1.8",
72
- "@types/node": "^20.2.5",
73
- "@types/semver": "^7.5.8",
79
+ "@types/jest": "^29.5.12",
80
+ "@types/node": "^24.5.2",
81
+ "@types/semver": "^7.7.1",
74
82
  "@types/uuid": "^9.0.1",
75
- "eslint": "^8.57.0",
76
- "husky": "^9.0.11",
77
- "jest": "^28.1.3",
78
- "lint-staged": "^15.2.2",
79
- "msw": "^2.2.1",
83
+ "@typescript-eslint/eslint-plugin": "^6.21.0",
84
+ "@typescript-eslint/parser": "^6.21.0",
85
+ "eslint": "8.57.0",
86
+ "eslint-config-standard-with-typescript": "^43.0.1",
87
+ "eslint-plugin-import": "^2.32.0",
88
+ "eslint-plugin-n": "^16.0.0",
89
+ "eslint-plugin-promise": "^6.0.0",
90
+ "husky": "^9.1.7",
91
+ "jest": "^29.7.0",
92
+ "lint-staged": "^16.2.3",
93
+ "msw": "^2.11.3",
94
+ "nock": "^14.0.10",
80
95
  "npm-run-all": "^4.1.5",
81
- "prettier": "^3.2.5",
82
- "release-it": "^17.2.1",
83
- "ts-jest": "^28.0.8",
84
- "tsup": "^6.7.0",
85
- "typedoc": "^0.28.0",
86
- "typedoc-plugin-markdown": "^4.5.2",
87
- "typescript": "~5.3.3"
96
+ "prettier": "^3.6.2",
97
+ "release-it": "^19.0.5",
98
+ "ts-jest": "^29.1.5",
99
+ "tsup": "^8.5.0",
100
+ "typedoc": "^0.28.13",
101
+ "typedoc-plugin-markdown": "^4.9.0",
102
+ "typescript": "~5.9.2"
88
103
  },
89
104
  "engines": {
90
105
  "node": ">= 16"
@@ -92,8 +107,7 @@
92
107
  "files": [
93
108
  "package.json",
94
109
  "README.md",
95
- "dist",
96
- "src"
110
+ "dist"
97
111
  ],
98
112
  "release-it": {
99
113
  "git": {
@@ -118,22 +132,46 @@
118
132
  }
119
133
  },
120
134
  "jest": {
135
+ "preset": "ts-jest/presets/default-esm",
136
+ "extensionsToTreatAsEsm": [
137
+ ".ts"
138
+ ],
121
139
  "transform": {
122
- "\\.[jt]sx?$": "ts-jest"
123
- },
124
- "globals": {
125
- "ts-jest": {
126
- "useESM": true
127
- }
140
+ "^.+\\.tsx?$": [
141
+ "ts-jest",
142
+ {
143
+ "useESM": true,
144
+ "tsconfig": {
145
+ "module": "esnext",
146
+ "target": "es2020",
147
+ "moduleResolution": "node"
148
+ }
149
+ }
150
+ ]
128
151
  },
129
152
  "moduleNameMapper": {
130
- "^bn.js$": "<rootDir>/node_modules/bn.js",
131
- "^asn1.js$": "<rootDir>/node_modules/asn1.js",
132
- "^hash.js$": "<rootDir>/node_modules/hash.js",
133
- "^(\\.\\.?\\/.+)\\.js$": "$1"
153
+ "^(\\.\\.?\\/.+)\\.js$": "$1",
154
+ "^(\\.\\.?\\/.+)$": "$1"
134
155
  },
135
- "extensionsToTreatAsEsm": [
136
- ".ts"
137
- ]
156
+ "moduleFileExtensions": [
157
+ "ts",
158
+ "tsx",
159
+ "js",
160
+ "jsx",
161
+ "json"
162
+ ],
163
+ "transformIgnorePatterns": [
164
+ "node_modules/(?!(@chainsafe|ethers|msw|until-async|bn.js|asn1.js|hash.js)/)"
165
+ ],
166
+ "testEnvironment": "node",
167
+ "testPathIgnorePatterns": [
168
+ "<rootDir>/dist/",
169
+ "<rootDir>/node_modules/"
170
+ ],
171
+ "roots": [
172
+ "<rootDir>/src",
173
+ "<rootDir>/test"
174
+ ],
175
+ "maxWorkers": "50%"
138
176
  }
139
177
  }
@@ -1,139 +0,0 @@
1
- {
2
- "name": "@obolnetwork/obol-sdk",
3
- "version": "2.11.4",
4
- "description": "A package for creating Distributed Validators using the Obol API.",
5
- "bugs": {
6
- "url": "https://github.com/obolnetwork/obol-sdk/issues"
7
- },
8
- "homepage": "https://docs.obol.org/",
9
- "keywords": [
10
- "Obol",
11
- "Distributed Validators",
12
- "Ethereum"
13
- ],
14
- "scripts": {
15
- "compile": "tsc -b ./tsconfig.cjs.json ./tsconfig.esm.json ./tsconfig.types.json",
16
- "build:clean": "rm -rf ./dist",
17
- "build": "npm-run-all build:clean compile",
18
- "test": "jest test/**/*.spec.ts --testPathIgnorePatterns=test/sdk-package/",
19
- "generate-typedoc": "typedoc",
20
- "npm:publish": "npm publish --tag latest",
21
- "release": "release-it",
22
- "release:dry": "release-it --dry-run --no-npm",
23
- "lint": "eslint \"{src,test}/**/*.{js,ts}\" --fix",
24
- "lint-ci": "eslint \"{src,test}/**/*.{js,ts}\"",
25
- "prettier-ci": "prettier --check \"{src,test}/**/*.{js,ts}\"",
26
- "prettier": "prettier --write \"{src,test}/**/*.{js,ts}\"",
27
- "docs": "typedoc"
28
- },
29
- "main": "./dist/cjs/src/index.js",
30
- "module": "./dist/esm/src/index.js",
31
- "typings": "./dist/types/src/index.d.ts",
32
- "author": "Obol Labs (https://obol.org)",
33
- "repository": {
34
- "type": "git",
35
- "url": "git+https://github.com/obolnetwork/obol-sdk.git"
36
- },
37
- "license": "ISC",
38
- "publishConfig": {
39
- "registry": "https://registry.npmjs.org/",
40
- "access": "public"
41
- },
42
- "dependencies": {
43
- "@chainsafe/bls": "6.0.3",
44
- "@chainsafe/blst": "^0.2.9",
45
- "@chainsafe/discv5": "^0.5.1",
46
- "@chainsafe/ssz": "^0.14.0",
47
- "@metamask/eth-sig-util": "^7.0.1",
48
- "@safe-global/protocol-kit": "4.1.1",
49
- "@safe-global/safe-core-sdk-types": "5.1.0",
50
- "@types/pdf-parse": "^1.1.4",
51
- "ajv": "^8.12.0",
52
- "ajv-formats": "^3.0.1",
53
- "ajv-keywords": "^5.1.0",
54
- "cross-fetch": "^3.1.5",
55
- "dotenv": "^16.4.7",
56
- "elliptic": "^6.5.4",
57
- "eslint-config-standard-with-typescript": "^43.0.1",
58
- "eslint-plugin-import": "^2.29.1",
59
- "eslint-plugin-n": "^16.6.2",
60
- "eslint-plugin-promise": "^6.1.1",
61
- "ethers": "^6.13.5",
62
- "nock": "^13.5.3",
63
- "pdf-parse": "^1.1.1",
64
- "semver": "^7.6.0",
65
- "typescript-eslint": "^7.1.0",
66
- "uuid": "^9.0.0"
67
- },
68
- "devDependencies": {
69
- "@release-it/conventional-changelog": "^8.0.1",
70
- "@types/elliptic": "^6.4.18",
71
- "@types/jest": "^28.1.8",
72
- "@types/node": "^20.2.5",
73
- "@types/semver": "^7.5.8",
74
- "@types/uuid": "^9.0.1",
75
- "eslint": "^8.57.0",
76
- "husky": "^9.0.11",
77
- "jest": "^28.1.3",
78
- "lint-staged": "^15.2.2",
79
- "msw": "^2.2.1",
80
- "npm-run-all": "^4.1.5",
81
- "prettier": "^3.2.5",
82
- "release-it": "^17.2.1",
83
- "ts-jest": "^28.0.8",
84
- "tsup": "^6.7.0",
85
- "typedoc": "^0.28.0",
86
- "typedoc-plugin-markdown": "^4.5.2",
87
- "typescript": "~5.3.3"
88
- },
89
- "engines": {
90
- "node": ">= 16"
91
- },
92
- "files": [
93
- "package.json",
94
- "README.md",
95
- "dist",
96
- "src"
97
- ],
98
- "release-it": {
99
- "git": {
100
- "changelog": "npx auto-changelog --stdout --commit-limit false --unreleased --template https://raw.githubusercontent.com/release-it/release-it/main/templates/changelog-compact.hbs",
101
- "commitMessage": "chore(release): v${version}",
102
- "push": true,
103
- "commit": true,
104
- "tag": true,
105
- "requireCommits": false,
106
- "requireCleanWorkingDir": false
107
- },
108
- "github": {
109
- "release": true,
110
- "draft": true
111
- },
112
- "npm": {
113
- "publish": false,
114
- "ignoreVersion": false
115
- },
116
- "hooks": {
117
- "after:bump": "npx auto-changelog -p --hide-credit"
118
- }
119
- },
120
- "jest": {
121
- "transform": {
122
- "\\.[jt]sx?$": "ts-jest"
123
- },
124
- "globals": {
125
- "ts-jest": {
126
- "useESM": true
127
- }
128
- },
129
- "moduleNameMapper": {
130
- "^bn.js$": "<rootDir>/node_modules/bn.js",
131
- "^asn1.js$": "<rootDir>/node_modules/asn1.js",
132
- "^hash.js$": "<rootDir>/node_modules/hash.js",
133
- "^(\\.\\.?\\/.+)\\.js$": "$1"
134
- },
135
- "extensionsToTreatAsEsm": [
136
- ".ts"
137
- ]
138
- }
139
- }
@@ -1,120 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BatchDepositContract = void 0;
4
- exports.BatchDepositContract = {
5
- abi: [
6
- {
7
- inputs: [],
8
- name: 'DepositValueGreaterThan2048ETH',
9
- type: 'error',
10
- },
11
- {
12
- inputs: [],
13
- name: 'DepositValueLessThan1ETH',
14
- type: 'error',
15
- },
16
- {
17
- inputs: [],
18
- name: 'DepositValueMustBeMultipleOfGwei',
19
- type: 'error',
20
- },
21
- {
22
- inputs: [],
23
- name: 'InvalidPubKeyLength',
24
- type: 'error',
25
- },
26
- {
27
- inputs: [],
28
- name: 'InvalidSignatureLength',
29
- type: 'error',
30
- },
31
- {
32
- inputs: [],
33
- name: 'InvalidWithdrawalCredLength',
34
- type: 'error',
35
- },
36
- {
37
- inputs: [],
38
- name: 'MsgValueNotEqualToTotalDepositAmount',
39
- type: 'error',
40
- },
41
- {
42
- inputs: [],
43
- name: 'NoDepositsProvided',
44
- type: 'error',
45
- },
46
- {
47
- anonymous: false,
48
- inputs: [
49
- {
50
- indexed: true,
51
- internalType: 'bytes',
52
- name: 'pubKey',
53
- type: 'bytes',
54
- },
55
- {
56
- indexed: true,
57
- internalType: 'bytes',
58
- name: 'withdrawalCredentials',
59
- type: 'bytes',
60
- },
61
- {
62
- indexed: false,
63
- internalType: 'uint256',
64
- name: 'amount',
65
- type: 'uint256',
66
- },
67
- ],
68
- name: 'ValidatorDeposit',
69
- type: 'event',
70
- },
71
- {
72
- inputs: [
73
- {
74
- components: [
75
- {
76
- internalType: 'bytes',
77
- name: 'pubKey',
78
- type: 'bytes',
79
- },
80
- {
81
- internalType: 'bytes',
82
- name: 'withdrawalCredentials',
83
- type: 'bytes',
84
- },
85
- {
86
- internalType: 'bytes',
87
- name: 'signature',
88
- type: 'bytes',
89
- },
90
- {
91
- internalType: 'uint256',
92
- name: 'amount',
93
- type: 'uint256',
94
- },
95
- ],
96
- internalType: 'struct IBatchDeposit.Deposit[]',
97
- name: '_deposits',
98
- type: 'tuple[]',
99
- },
100
- ],
101
- name: 'batchDeposit',
102
- outputs: [],
103
- stateMutability: 'payable',
104
- type: 'function',
105
- },
106
- {
107
- inputs: [],
108
- name: 'depositContract',
109
- outputs: [
110
- {
111
- internalType: 'contract IDepositContract',
112
- name: '',
113
- type: 'address',
114
- },
115
- ],
116
- stateMutability: 'view',
117
- type: 'function',
118
- },
119
- ],
120
- };