@lidofinance/lido-csm-sdk 2.0.0-alpha.64 → 2.0.0-alpha.66

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.
@@ -39,7 +39,8 @@ const MODULE_CONFIG = {
39
39
  [require_contract_names.CONTRACT_NAMES.verifier]: "0xdC5FE1782B6943f318E05230d688713a560063DC",
40
40
  [require_contract_names.CONTRACT_NAMES.hashConsensus]: "0x71093efF8D8599b5fA340D665Ad60fA7C80688e4",
41
41
  [require_contract_names.CONTRACT_NAMES.permissionlessGate]: "0xcF33a38111d0B1246A3F38a838fb41D626B454f0",
42
- [require_contract_names.CONTRACT_NAMES.icsGate]: "0xB314D4A76C457c93150d308787939063F4Cc67E0"
42
+ [require_contract_names.CONTRACT_NAMES.icsGate]: "0xB314D4A76C457c93150d308787939063F4Cc67E0",
43
+ [require_contract_names.CONTRACT_NAMES.idvtcGate]: viem.zeroAddress
43
44
  },
44
45
  moduleId: 3n,
45
46
  deploymentBlockNumber: BigInt("0x13f7326")
@@ -1 +1 @@
1
- {"version":3,"file":"module-config.cjs","names":[],"sources":["../../../src/common/constants/module-config.ts"],"sourcesContent":["import { CHAINS } from '@lidofinance/lido-ethereum-sdk';\nimport { Address, zeroAddress } from 'viem';\n\nimport { CONTRACT_NAMES } from './contract-names';\nimport { MODULE_NAME, PerModule } from './module-name';\nimport { PerSupportedChain } from './supported-chains';\n\ntype ContractAddressMap = { [key in CONTRACT_NAMES]?: Address };\n\ntype ModuleChainConfig = {\n contractAddresses: ContractAddressMap;\n moduleId: bigint;\n deploymentBlockNumber?: bigint;\n};\n\nexport type ModuleConfig = PerSupportedChain<ModuleChainConfig>;\n\nexport const COMMON_ADDRESSES: PerSupportedChain<ContractAddressMap> = {\n [CHAINS.Mainnet]: {\n [CONTRACT_NAMES.stakingRouter]:\n '0xFdDf38947aFB03C621C71b06C9C70bce73f12999',\n [CONTRACT_NAMES.validatorsExitBusOracle]:\n '0x0De4Ea0184c2ad0BacA7183356Aea5B8d5Bf5c6e',\n [CONTRACT_NAMES.withdrawalVault]:\n '0xB9D7934878B5FB9610B3fE8A5e441e8fad7E293f',\n [CONTRACT_NAMES.lidoRewardsVault]:\n '0x388C818CA8B9251b393131C08a736A67ccB19297',\n [CONTRACT_NAMES.stETH]: '0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84',\n [CONTRACT_NAMES.wstETH]: '0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0',\n [CONTRACT_NAMES.smDiscovery]: '0x32893b74064160c626652c2c21a849fdd0bddfd6',\n },\n [CHAINS.Hoodi]: {\n [CONTRACT_NAMES.stakingRouter]:\n '0xCc820558B39ee15C7C45B59390B503b83fb499A8',\n [CONTRACT_NAMES.validatorsExitBusOracle]:\n '0x8664d394C2B3278F26A1B44B967aEf99707eeAB2',\n [CONTRACT_NAMES.withdrawalVault]:\n '0x4473dCDDbf77679A643BdB654dbd86D67F8d32f2',\n [CONTRACT_NAMES.lidoRewardsVault]:\n '0x9b108015fe433F173696Af3Aa0CF7CDb3E104258',\n [CONTRACT_NAMES.stETH]: '0x3508A952176b3c15387C97BE809eaffB1982176a',\n [CONTRACT_NAMES.wstETH]: '0x7E99eE3C66636DE415D2d7C880938F2f40f94De4',\n [CONTRACT_NAMES.smDiscovery]: '0xd4523c0925b2246325dcc1d919f2b84c0bcacad9',\n },\n};\n\nexport const MODULE_CONFIG: PerModule<ModuleConfig> = {\n [MODULE_NAME.CSM]: {\n [CHAINS.Mainnet]: {\n contractAddresses: {\n [CONTRACT_NAMES.csModule]: '0xdA7dE2ECdDfccC6c3AF10108Db212ACBBf9EA83F',\n [CONTRACT_NAMES.accounting]:\n '0x4d72BFF1BeaC69925F8Bd12526a39BAAb069e5Da',\n [CONTRACT_NAMES.ejector]: '0xc72b58aa02E0e98cF8A4a0E9Dce75e763800802C',\n [CONTRACT_NAMES.exitPenalties]:\n '0x06cd61045f958A209a0f8D746e103eCc625f4193',\n [CONTRACT_NAMES.feeDistributor]:\n '0xD99CC66fEC647E68294C6477B40fC7E0F6F618D0',\n [CONTRACT_NAMES.feeOracle]:\n '0x4D4074628678Bd302921c20573EEa1ed38DdF7FB',\n [CONTRACT_NAMES.parametersRegistry]:\n '0x9D28ad303C90DF524BA960d7a2DAC56DcC31e428',\n [CONTRACT_NAMES.validatorStrikes]:\n '0xaa328816027F2D32B9F56d190BC9Fa4A5C07637f',\n [CONTRACT_NAMES.verifier]: '0xdC5FE1782B6943f318E05230d688713a560063DC',\n [CONTRACT_NAMES.hashConsensus]:\n '0x71093efF8D8599b5fA340D665Ad60fA7C80688e4',\n [CONTRACT_NAMES.permissionlessGate]:\n '0xcF33a38111d0B1246A3F38a838fb41D626B454f0',\n [CONTRACT_NAMES.icsGate]: '0xB314D4A76C457c93150d308787939063F4Cc67E0',\n },\n moduleId: 3n,\n deploymentBlockNumber: BigInt('0x13f7326'),\n },\n [CHAINS.Hoodi]: {\n contractAddresses: {\n [CONTRACT_NAMES.csModule]: '0x79CEf36D84743222f37765204Bec41E92a93E59d',\n [CONTRACT_NAMES.accounting]:\n '0xA54b90BA34C5f326BC1485054080994e38FB4C60',\n [CONTRACT_NAMES.ejector]: '0xCAe028378d69D54dc8bF809e6C44CF751F997b80',\n [CONTRACT_NAMES.exitPenalties]:\n '0xD259b31083Be841E5C85b2D481Cfc17C14276800',\n [CONTRACT_NAMES.feeDistributor]:\n '0xaCd9820b0A2229a82dc1A0770307ce5522FF3582',\n [CONTRACT_NAMES.feeOracle]:\n '0xe7314f561B2e72f9543F1004e741bab6Fc51028B',\n [CONTRACT_NAMES.parametersRegistry]:\n '0xA4aD5236963f9Fe4229864712269D8d79B65C5Ad',\n [CONTRACT_NAMES.validatorStrikes]:\n '0x8fBA385C3c334D251eE413e79d4D3890db98693c',\n [CONTRACT_NAMES.verifier]: '0xC96406b0eADdAC5708aFCa04DcCA67BAdC9642Fd',\n [CONTRACT_NAMES.hashConsensus]:\n '0x54f74a10e4397dDeF85C4854d9dfcA129D72C637',\n [CONTRACT_NAMES.permissionlessGate]:\n '0xd7bD8D2A9888D1414c770B35ACF55890B15de26a',\n [CONTRACT_NAMES.icsGate]: '0x10a254E724fe2b7f305F76f3F116a3969c53845f',\n [CONTRACT_NAMES.idvtcGate]:\n '0x887F8512F9998045f4b5993e6eaa6BCfE5F02A94',\n },\n moduleId: 4n,\n deploymentBlockNumber: BigInt('0x1374'),\n },\n },\n\n [MODULE_NAME.CM]: {\n [CHAINS.Mainnet]: {\n contractAddresses: {\n [CONTRACT_NAMES.curatedModule]: zeroAddress,\n [CONTRACT_NAMES.accounting]: zeroAddress,\n [CONTRACT_NAMES.ejector]: zeroAddress,\n [CONTRACT_NAMES.exitPenalties]: zeroAddress,\n [CONTRACT_NAMES.feeDistributor]: zeroAddress,\n [CONTRACT_NAMES.feeOracle]: zeroAddress,\n [CONTRACT_NAMES.parametersRegistry]: zeroAddress,\n [CONTRACT_NAMES.validatorStrikes]: zeroAddress,\n [CONTRACT_NAMES.verifier]: zeroAddress,\n [CONTRACT_NAMES.hashConsensus]: zeroAddress,\n [CONTRACT_NAMES.metaRegistry]: zeroAddress,\n [CONTRACT_NAMES.curatedGatePO]: zeroAddress,\n [CONTRACT_NAMES.curatedGatePTO]: zeroAddress,\n [CONTRACT_NAMES.curatedGatePGO]: zeroAddress,\n [CONTRACT_NAMES.curatedGateDO]: zeroAddress,\n [CONTRACT_NAMES.curatedGateEEO]: zeroAddress,\n [CONTRACT_NAMES.curatedGateIODC]: zeroAddress,\n [CONTRACT_NAMES.curatedGateIODCP]: zeroAddress,\n },\n moduleId: 4n,\n },\n [CHAINS.Hoodi]: {\n contractAddresses: {\n [CONTRACT_NAMES.curatedModule]:\n '0x87EB69Ae51317405FD285efD2326a4a11f6173b9',\n [CONTRACT_NAMES.accounting]:\n '0x7f7356D29aCd915F1934220956c3305808ceB235',\n [CONTRACT_NAMES.ejector]: '0xfDbde2B3554B69C84e0f8d7daB68D390Ff0f4394',\n [CONTRACT_NAMES.exitPenalties]:\n '0xad79e1d3B380cEb1a0e188fBAB91f85A446E9E54',\n [CONTRACT_NAMES.feeDistributor]:\n '0x0ced6de191E2A15f7BBAf9E32307626C9f6BD0Cd',\n [CONTRACT_NAMES.feeOracle]:\n '0x5D2F27000C80f6f7A03015Fd49dB7FEba3fBfa83',\n [CONTRACT_NAMES.parametersRegistry]:\n '0xefb8e4091A75C4828826bf64595F392f87A07b37',\n [CONTRACT_NAMES.validatorStrikes]:\n '0x4c427Ec826F403339719C0FABfb3209e80939eA6',\n [CONTRACT_NAMES.verifier]: '0x209190Ebc2Be80367a15d05e626784Eb94d6A880',\n [CONTRACT_NAMES.hashConsensus]:\n '0x920883908A78c1554f682006a8aB32E62Be09F33',\n [CONTRACT_NAMES.metaRegistry]:\n '0x857289cCBFBc4C134Cc312022a104CD9b38d8AAE',\n [CONTRACT_NAMES.curatedGatePO]:\n '0xF1862d120831eBE31f7202378Ff3Ae63A5658ae3',\n [CONTRACT_NAMES.curatedGatePTO]:\n '0x410A309dF81B782190188CDB3d215729cc6bC1f3',\n [CONTRACT_NAMES.curatedGatePGO]:\n '0xa5A604b172787e017b1b118F02fE54fC1D696519',\n [CONTRACT_NAMES.curatedGateDO]:\n '0xE966874cDB6A4282ED75Cd10439e3799e5531a2D',\n [CONTRACT_NAMES.curatedGateEEO]:\n '0x5c063da03e3f21443716D75a2205EE16706e1153',\n [CONTRACT_NAMES.curatedGateIODC]:\n '0x1cD655Ac53CfE8269DE0DBfc0140B074623C4A6B',\n [CONTRACT_NAMES.curatedGateIODCP]:\n '0x28518be9894C20135F280a9539617783b08a04c7',\n },\n moduleId: 5n,\n deploymentBlockNumber: BigInt('0x28a0f0'),\n },\n },\n};\n"],"mappings":";;;;;;AAiBO,MAAM,mBAA0D;EACpE,+BAAA,OAAO,UAAU;GACf,uBAAA,eAAe,gBACd;GACD,uBAAA,eAAe,0BACd;GACD,uBAAA,eAAe,kBACd;GACD,uBAAA,eAAe,mBACd;GACD,uBAAA,eAAe,QAAQ;G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;KAC5B,uBAAA,eAAe,UAAU,KAAA;KACzB,uBAAA,eAAe,gBAAgB,KAAA;KAC/B,uBAAA,eAAe,iBAAiB,KAAA;KAChC,uBAAA,eAAe,YAAY,KAAA;KAC3B,uBAAA,eAAe,qBAAqB,KAAA;KACpC,uBAAA,eAAe,mBAAmB,KAAA;KAClC,uBAAA,eAAe,WAAW,KAAA;KAC1B,uBAAA,eAAe,gBAAgB,KAAA;KAC/B,uBAAA,eAAe,eAAe,KAAA;KAC9B,uBAAA,eAAe,gBAAgB,KAAA;KAC/B,uBAAA,eAAe,iBAAiB,KAAA;KAChC,uBAAA,eAAe,iBAAiB,KAAA;KAChC,uBAAA,eAAe,gBAAgB,KAAA;KAC/B,uBAAA,eAAe,iBAAiB,KAAA;KAChC,uBAAA,eAAe,kBAAkB,KAAA;KACjC,uBAAA,eAAe,mBAAmB,KAAA;IACrC;GACA,UAAU;GACZ;GACC,+BAAA,OAAO,QAAQ;GACd,mBAAmB;KAChB,uBAAA,eAAe,gBACd;KACD,uBAAA,eAAe,aACd;KACD,uBAAA,eAAe,UAAU;KACzB,uBAAA,eAAe,gBACd;KACD,uBAAA,eAAe,iBACd;KACD,uBAAA,eAAe,YACd;KACD,uBAAA,eAAe,qBACd;KACD,uBAAA,eAAe,mBACd;KACD,uBAAA,eAAe,WAAW;KAC1B,uBAAA,eAAe,gBACd;KACD,uBAAA,eAAe,eACd;KACD,uBAAA,eAAe,gBACd;KACD,uBAAA,eAAe,iBACd;KACD,uBAAA,eAAe,iBACd;KACD,uBAAA,eAAe,gBACd;KACD,uBAAA,eAAe,iBACd;KACD,uBAAA,eAAe,kBACd;KACD,uBAAA,eAAe,mBACd;IACJ;GACA,UAAU;GACV,uBAAuB,OAAO,WAAU;GAC1C;EACF;CACF"}
1
+ {"version":3,"file":"module-config.cjs","names":[],"sources":["../../../src/common/constants/module-config.ts"],"sourcesContent":["import { CHAINS } from '@lidofinance/lido-ethereum-sdk';\nimport { Address, zeroAddress } from 'viem';\n\nimport { CONTRACT_NAMES } from './contract-names';\nimport { MODULE_NAME, PerModule } from './module-name';\nimport { PerSupportedChain } from './supported-chains';\n\ntype ContractAddressMap = { [key in CONTRACT_NAMES]?: Address };\n\ntype ModuleChainConfig = {\n contractAddresses: ContractAddressMap;\n moduleId: bigint;\n deploymentBlockNumber?: bigint;\n};\n\nexport type ModuleConfig = PerSupportedChain<ModuleChainConfig>;\n\nexport const COMMON_ADDRESSES: PerSupportedChain<ContractAddressMap> = {\n [CHAINS.Mainnet]: {\n [CONTRACT_NAMES.stakingRouter]:\n '0xFdDf38947aFB03C621C71b06C9C70bce73f12999',\n [CONTRACT_NAMES.validatorsExitBusOracle]:\n '0x0De4Ea0184c2ad0BacA7183356Aea5B8d5Bf5c6e',\n [CONTRACT_NAMES.withdrawalVault]:\n '0xB9D7934878B5FB9610B3fE8A5e441e8fad7E293f',\n [CONTRACT_NAMES.lidoRewardsVault]:\n '0x388C818CA8B9251b393131C08a736A67ccB19297',\n [CONTRACT_NAMES.stETH]: '0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84',\n [CONTRACT_NAMES.wstETH]: '0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0',\n [CONTRACT_NAMES.smDiscovery]: '0x32893b74064160c626652c2c21a849fdd0bddfd6',\n },\n [CHAINS.Hoodi]: {\n [CONTRACT_NAMES.stakingRouter]:\n '0xCc820558B39ee15C7C45B59390B503b83fb499A8',\n [CONTRACT_NAMES.validatorsExitBusOracle]:\n '0x8664d394C2B3278F26A1B44B967aEf99707eeAB2',\n [CONTRACT_NAMES.withdrawalVault]:\n '0x4473dCDDbf77679A643BdB654dbd86D67F8d32f2',\n [CONTRACT_NAMES.lidoRewardsVault]:\n '0x9b108015fe433F173696Af3Aa0CF7CDb3E104258',\n [CONTRACT_NAMES.stETH]: '0x3508A952176b3c15387C97BE809eaffB1982176a',\n [CONTRACT_NAMES.wstETH]: '0x7E99eE3C66636DE415D2d7C880938F2f40f94De4',\n [CONTRACT_NAMES.smDiscovery]: '0xd4523c0925b2246325dcc1d919f2b84c0bcacad9',\n },\n};\n\nexport const MODULE_CONFIG: PerModule<ModuleConfig> = {\n [MODULE_NAME.CSM]: {\n [CHAINS.Mainnet]: {\n contractAddresses: {\n [CONTRACT_NAMES.csModule]: '0xdA7dE2ECdDfccC6c3AF10108Db212ACBBf9EA83F',\n [CONTRACT_NAMES.accounting]:\n '0x4d72BFF1BeaC69925F8Bd12526a39BAAb069e5Da',\n [CONTRACT_NAMES.ejector]: '0xc72b58aa02E0e98cF8A4a0E9Dce75e763800802C',\n [CONTRACT_NAMES.exitPenalties]:\n '0x06cd61045f958A209a0f8D746e103eCc625f4193',\n [CONTRACT_NAMES.feeDistributor]:\n '0xD99CC66fEC647E68294C6477B40fC7E0F6F618D0',\n [CONTRACT_NAMES.feeOracle]:\n '0x4D4074628678Bd302921c20573EEa1ed38DdF7FB',\n [CONTRACT_NAMES.parametersRegistry]:\n '0x9D28ad303C90DF524BA960d7a2DAC56DcC31e428',\n [CONTRACT_NAMES.validatorStrikes]:\n '0xaa328816027F2D32B9F56d190BC9Fa4A5C07637f',\n [CONTRACT_NAMES.verifier]: '0xdC5FE1782B6943f318E05230d688713a560063DC',\n [CONTRACT_NAMES.hashConsensus]:\n '0x71093efF8D8599b5fA340D665Ad60fA7C80688e4',\n [CONTRACT_NAMES.permissionlessGate]:\n '0xcF33a38111d0B1246A3F38a838fb41D626B454f0',\n [CONTRACT_NAMES.icsGate]: '0xB314D4A76C457c93150d308787939063F4Cc67E0',\n [CONTRACT_NAMES.idvtcGate]: zeroAddress,\n },\n moduleId: 3n,\n deploymentBlockNumber: BigInt('0x13f7326'),\n },\n [CHAINS.Hoodi]: {\n contractAddresses: {\n [CONTRACT_NAMES.csModule]: '0x79CEf36D84743222f37765204Bec41E92a93E59d',\n [CONTRACT_NAMES.accounting]:\n '0xA54b90BA34C5f326BC1485054080994e38FB4C60',\n [CONTRACT_NAMES.ejector]: '0xCAe028378d69D54dc8bF809e6C44CF751F997b80',\n [CONTRACT_NAMES.exitPenalties]:\n '0xD259b31083Be841E5C85b2D481Cfc17C14276800',\n [CONTRACT_NAMES.feeDistributor]:\n '0xaCd9820b0A2229a82dc1A0770307ce5522FF3582',\n [CONTRACT_NAMES.feeOracle]:\n '0xe7314f561B2e72f9543F1004e741bab6Fc51028B',\n [CONTRACT_NAMES.parametersRegistry]:\n '0xA4aD5236963f9Fe4229864712269D8d79B65C5Ad',\n [CONTRACT_NAMES.validatorStrikes]:\n '0x8fBA385C3c334D251eE413e79d4D3890db98693c',\n [CONTRACT_NAMES.verifier]: '0xC96406b0eADdAC5708aFCa04DcCA67BAdC9642Fd',\n [CONTRACT_NAMES.hashConsensus]:\n '0x54f74a10e4397dDeF85C4854d9dfcA129D72C637',\n [CONTRACT_NAMES.permissionlessGate]:\n '0xd7bD8D2A9888D1414c770B35ACF55890B15de26a',\n [CONTRACT_NAMES.icsGate]: '0x10a254E724fe2b7f305F76f3F116a3969c53845f',\n [CONTRACT_NAMES.idvtcGate]:\n '0x887F8512F9998045f4b5993e6eaa6BCfE5F02A94',\n },\n moduleId: 4n,\n deploymentBlockNumber: BigInt('0x1374'),\n },\n },\n\n [MODULE_NAME.CM]: {\n [CHAINS.Mainnet]: {\n contractAddresses: {\n [CONTRACT_NAMES.curatedModule]: zeroAddress,\n [CONTRACT_NAMES.accounting]: zeroAddress,\n [CONTRACT_NAMES.ejector]: zeroAddress,\n [CONTRACT_NAMES.exitPenalties]: zeroAddress,\n [CONTRACT_NAMES.feeDistributor]: zeroAddress,\n [CONTRACT_NAMES.feeOracle]: zeroAddress,\n [CONTRACT_NAMES.parametersRegistry]: zeroAddress,\n [CONTRACT_NAMES.validatorStrikes]: zeroAddress,\n [CONTRACT_NAMES.verifier]: zeroAddress,\n [CONTRACT_NAMES.hashConsensus]: zeroAddress,\n [CONTRACT_NAMES.metaRegistry]: zeroAddress,\n [CONTRACT_NAMES.curatedGatePO]: zeroAddress,\n [CONTRACT_NAMES.curatedGatePTO]: zeroAddress,\n [CONTRACT_NAMES.curatedGatePGO]: zeroAddress,\n [CONTRACT_NAMES.curatedGateDO]: zeroAddress,\n [CONTRACT_NAMES.curatedGateEEO]: zeroAddress,\n [CONTRACT_NAMES.curatedGateIODC]: zeroAddress,\n [CONTRACT_NAMES.curatedGateIODCP]: zeroAddress,\n },\n moduleId: 4n,\n },\n [CHAINS.Hoodi]: {\n contractAddresses: {\n [CONTRACT_NAMES.curatedModule]:\n '0x87EB69Ae51317405FD285efD2326a4a11f6173b9',\n [CONTRACT_NAMES.accounting]:\n '0x7f7356D29aCd915F1934220956c3305808ceB235',\n [CONTRACT_NAMES.ejector]: '0xfDbde2B3554B69C84e0f8d7daB68D390Ff0f4394',\n [CONTRACT_NAMES.exitPenalties]:\n '0xad79e1d3B380cEb1a0e188fBAB91f85A446E9E54',\n [CONTRACT_NAMES.feeDistributor]:\n '0x0ced6de191E2A15f7BBAf9E32307626C9f6BD0Cd',\n [CONTRACT_NAMES.feeOracle]:\n '0x5D2F27000C80f6f7A03015Fd49dB7FEba3fBfa83',\n [CONTRACT_NAMES.parametersRegistry]:\n '0xefb8e4091A75C4828826bf64595F392f87A07b37',\n [CONTRACT_NAMES.validatorStrikes]:\n '0x4c427Ec826F403339719C0FABfb3209e80939eA6',\n [CONTRACT_NAMES.verifier]: '0x209190Ebc2Be80367a15d05e626784Eb94d6A880',\n [CONTRACT_NAMES.hashConsensus]:\n '0x920883908A78c1554f682006a8aB32E62Be09F33',\n [CONTRACT_NAMES.metaRegistry]:\n '0x857289cCBFBc4C134Cc312022a104CD9b38d8AAE',\n [CONTRACT_NAMES.curatedGatePO]:\n '0xF1862d120831eBE31f7202378Ff3Ae63A5658ae3',\n [CONTRACT_NAMES.curatedGatePTO]:\n '0x410A309dF81B782190188CDB3d215729cc6bC1f3',\n [CONTRACT_NAMES.curatedGatePGO]:\n '0xa5A604b172787e017b1b118F02fE54fC1D696519',\n [CONTRACT_NAMES.curatedGateDO]:\n '0xE966874cDB6A4282ED75Cd10439e3799e5531a2D',\n [CONTRACT_NAMES.curatedGateEEO]:\n '0x5c063da03e3f21443716D75a2205EE16706e1153',\n [CONTRACT_NAMES.curatedGateIODC]:\n '0x1cD655Ac53CfE8269DE0DBfc0140B074623C4A6B',\n [CONTRACT_NAMES.curatedGateIODCP]:\n '0x28518be9894C20135F280a9539617783b08a04c7',\n },\n moduleId: 5n,\n deploymentBlockNumber: BigInt('0x28a0f0'),\n },\n },\n};\n"],"mappings":";;;;;;AAiBO,MAAM,mBAA0D;EACpE,+BAAA,OAAO,UAAU;GACf,uBAAA,eAAe,gBACd;GACD,uBAAA,eAAe,0BACd;GACD,uBAAA,eAAe,kBACd;GACD,uBAAA,eAAe,mBACd;GACD,uBAAA,eAAe,QAAQ;GACvB,uBAAA,eAAe,SAAS;GACxB,uBAAA,eAAe,cAAc;EAChC;EACC,+BAAA,OAAO,QAAQ;GACb,uBAAA,eAAe,gBACd;GACD,uBAAA,eAAe,0BACd;GACD,uBAAA,eAAe,kBACd;GACD,uBAAA,eAAe,mBACd;GACD,uBAAA,eAAe,QAAQ;GACvB,uBAAA,eAAe,SAAS;GACxB,uBAAA,eAAe,cAAc;EAChC;CACF;AAEO,MAAM,gBAAyC;EACnD,oBAAA,YAAY,MAAM;GAChB,+BAAA,OAAO,UAAU;GAChB,mBAAmB;KAChB,uBAAA,eAAe,WAAW;KAC1B,uBAAA,eAAe,aACd;KACD,uBAAA,eAAe,UAAU;KACzB,uBAAA,eAAe,gBACd;KACD,uBAAA,eAAe,iBACd;KACD,uBAAA,eAAe,YACd;KACD,uBAAA,eAAe,qBACd;KACD,uBAAA,eAAe,mBACd;KACD,uBAAA,eAAe,WAAW;KAC1B,uBAAA,eAAe,gBACd;KACD,uBAAA,eAAe,qBACd;KACD,uBAAA,eAAe,UAAU;KACzB,uBAAA,eAAe,YAAY,KAAA;IAC9B;GACA,UAAU;GACV,uBAAuB,OAAO,YAAW;GAC3C;GACC,+BAAA,OAAO,QAAQ;GACd,mBAAmB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AAA,eAAe,YACd;KACD,uBAAA,eAAe,qBACd;KACD,uBAAA,eAAe,mBACd;KACD,uBAAA,eAAe,WAAW;KAC1B,uBAAA,eAAe,gBACd;KACD,uBAAA,eAAe,eACd;KACD,uBAAA,eAAe,gBACd;KACD,uBAAA,eAAe,iBACd;KACD,uBAAA,eAAe,iBACd;KACD,uBAAA,eAAe,gBACd;KACD,uBAAA,eAAe,iBACd;KACD,uBAAA,eAAe,kBACd;KACD,uBAAA,eAAe,mBACd;IACJ;GACA,UAAU;GACV,uBAAuB,OAAO,WAAU;GAC1C;EACF;CACF"}
@@ -38,7 +38,8 @@ const MODULE_CONFIG = {
38
38
  [CONTRACT_NAMES.verifier]: "0xdC5FE1782B6943f318E05230d688713a560063DC",
39
39
  [CONTRACT_NAMES.hashConsensus]: "0x71093efF8D8599b5fA340D665Ad60fA7C80688e4",
40
40
  [CONTRACT_NAMES.permissionlessGate]: "0xcF33a38111d0B1246A3F38a838fb41D626B454f0",
41
- [CONTRACT_NAMES.icsGate]: "0xB314D4A76C457c93150d308787939063F4Cc67E0"
41
+ [CONTRACT_NAMES.icsGate]: "0xB314D4A76C457c93150d308787939063F4Cc67E0",
42
+ [CONTRACT_NAMES.idvtcGate]: zeroAddress
42
43
  },
43
44
  moduleId: 3n,
44
45
  deploymentBlockNumber: BigInt("0x13f7326")
@@ -1 +1 @@
1
- {"version":3,"file":"module-config.mjs","names":[],"sources":["../../../src/common/constants/module-config.ts"],"sourcesContent":["import { CHAINS } from '@lidofinance/lido-ethereum-sdk';\nimport { Address, zeroAddress } from 'viem';\n\nimport { CONTRACT_NAMES } from './contract-names';\nimport { MODULE_NAME, PerModule } from './module-name';\nimport { PerSupportedChain } from './supported-chains';\n\ntype ContractAddressMap = { [key in CONTRACT_NAMES]?: Address };\n\ntype ModuleChainConfig = {\n contractAddresses: ContractAddressMap;\n moduleId: bigint;\n deploymentBlockNumber?: bigint;\n};\n\nexport type ModuleConfig = PerSupportedChain<ModuleChainConfig>;\n\nexport const COMMON_ADDRESSES: PerSupportedChain<ContractAddressMap> = {\n [CHAINS.Mainnet]: {\n [CONTRACT_NAMES.stakingRouter]:\n '0xFdDf38947aFB03C621C71b06C9C70bce73f12999',\n [CONTRACT_NAMES.validatorsExitBusOracle]:\n '0x0De4Ea0184c2ad0BacA7183356Aea5B8d5Bf5c6e',\n [CONTRACT_NAMES.withdrawalVault]:\n '0xB9D7934878B5FB9610B3fE8A5e441e8fad7E293f',\n [CONTRACT_NAMES.lidoRewardsVault]:\n '0x388C818CA8B9251b393131C08a736A67ccB19297',\n [CONTRACT_NAMES.stETH]: '0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84',\n [CONTRACT_NAMES.wstETH]: '0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0',\n [CONTRACT_NAMES.smDiscovery]: '0x32893b74064160c626652c2c21a849fdd0bddfd6',\n },\n [CHAINS.Hoodi]: {\n [CONTRACT_NAMES.stakingRouter]:\n '0xCc820558B39ee15C7C45B59390B503b83fb499A8',\n [CONTRACT_NAMES.validatorsExitBusOracle]:\n '0x8664d394C2B3278F26A1B44B967aEf99707eeAB2',\n [CONTRACT_NAMES.withdrawalVault]:\n '0x4473dCDDbf77679A643BdB654dbd86D67F8d32f2',\n [CONTRACT_NAMES.lidoRewardsVault]:\n '0x9b108015fe433F173696Af3Aa0CF7CDb3E104258',\n [CONTRACT_NAMES.stETH]: '0x3508A952176b3c15387C97BE809eaffB1982176a',\n [CONTRACT_NAMES.wstETH]: '0x7E99eE3C66636DE415D2d7C880938F2f40f94De4',\n [CONTRACT_NAMES.smDiscovery]: '0xd4523c0925b2246325dcc1d919f2b84c0bcacad9',\n },\n};\n\nexport const MODULE_CONFIG: PerModule<ModuleConfig> = {\n [MODULE_NAME.CSM]: {\n [CHAINS.Mainnet]: {\n contractAddresses: {\n [CONTRACT_NAMES.csModule]: '0xdA7dE2ECdDfccC6c3AF10108Db212ACBBf9EA83F',\n [CONTRACT_NAMES.accounting]:\n '0x4d72BFF1BeaC69925F8Bd12526a39BAAb069e5Da',\n [CONTRACT_NAMES.ejector]: '0xc72b58aa02E0e98cF8A4a0E9Dce75e763800802C',\n [CONTRACT_NAMES.exitPenalties]:\n '0x06cd61045f958A209a0f8D746e103eCc625f4193',\n [CONTRACT_NAMES.feeDistributor]:\n '0xD99CC66fEC647E68294C6477B40fC7E0F6F618D0',\n [CONTRACT_NAMES.feeOracle]:\n '0x4D4074628678Bd302921c20573EEa1ed38DdF7FB',\n [CONTRACT_NAMES.parametersRegistry]:\n '0x9D28ad303C90DF524BA960d7a2DAC56DcC31e428',\n [CONTRACT_NAMES.validatorStrikes]:\n '0xaa328816027F2D32B9F56d190BC9Fa4A5C07637f',\n [CONTRACT_NAMES.verifier]: '0xdC5FE1782B6943f318E05230d688713a560063DC',\n [CONTRACT_NAMES.hashConsensus]:\n '0x71093efF8D8599b5fA340D665Ad60fA7C80688e4',\n [CONTRACT_NAMES.permissionlessGate]:\n '0xcF33a38111d0B1246A3F38a838fb41D626B454f0',\n [CONTRACT_NAMES.icsGate]: '0xB314D4A76C457c93150d308787939063F4Cc67E0',\n },\n moduleId: 3n,\n deploymentBlockNumber: BigInt('0x13f7326'),\n },\n [CHAINS.Hoodi]: {\n contractAddresses: {\n [CONTRACT_NAMES.csModule]: '0x79CEf36D84743222f37765204Bec41E92a93E59d',\n [CONTRACT_NAMES.accounting]:\n '0xA54b90BA34C5f326BC1485054080994e38FB4C60',\n [CONTRACT_NAMES.ejector]: '0xCAe028378d69D54dc8bF809e6C44CF751F997b80',\n [CONTRACT_NAMES.exitPenalties]:\n '0xD259b31083Be841E5C85b2D481Cfc17C14276800',\n [CONTRACT_NAMES.feeDistributor]:\n '0xaCd9820b0A2229a82dc1A0770307ce5522FF3582',\n [CONTRACT_NAMES.feeOracle]:\n '0xe7314f561B2e72f9543F1004e741bab6Fc51028B',\n [CONTRACT_NAMES.parametersRegistry]:\n '0xA4aD5236963f9Fe4229864712269D8d79B65C5Ad',\n [CONTRACT_NAMES.validatorStrikes]:\n '0x8fBA385C3c334D251eE413e79d4D3890db98693c',\n [CONTRACT_NAMES.verifier]: '0xC96406b0eADdAC5708aFCa04DcCA67BAdC9642Fd',\n [CONTRACT_NAMES.hashConsensus]:\n '0x54f74a10e4397dDeF85C4854d9dfcA129D72C637',\n [CONTRACT_NAMES.permissionlessGate]:\n '0xd7bD8D2A9888D1414c770B35ACF55890B15de26a',\n [CONTRACT_NAMES.icsGate]: '0x10a254E724fe2b7f305F76f3F116a3969c53845f',\n [CONTRACT_NAMES.idvtcGate]:\n '0x887F8512F9998045f4b5993e6eaa6BCfE5F02A94',\n },\n moduleId: 4n,\n deploymentBlockNumber: BigInt('0x1374'),\n },\n },\n\n [MODULE_NAME.CM]: {\n [CHAINS.Mainnet]: {\n contractAddresses: {\n [CONTRACT_NAMES.curatedModule]: zeroAddress,\n [CONTRACT_NAMES.accounting]: zeroAddress,\n [CONTRACT_NAMES.ejector]: zeroAddress,\n [CONTRACT_NAMES.exitPenalties]: zeroAddress,\n [CONTRACT_NAMES.feeDistributor]: zeroAddress,\n [CONTRACT_NAMES.feeOracle]: zeroAddress,\n [CONTRACT_NAMES.parametersRegistry]: zeroAddress,\n [CONTRACT_NAMES.validatorStrikes]: zeroAddress,\n [CONTRACT_NAMES.verifier]: zeroAddress,\n [CONTRACT_NAMES.hashConsensus]: zeroAddress,\n [CONTRACT_NAMES.metaRegistry]: zeroAddress,\n [CONTRACT_NAMES.curatedGatePO]: zeroAddress,\n [CONTRACT_NAMES.curatedGatePTO]: zeroAddress,\n [CONTRACT_NAMES.curatedGatePGO]: zeroAddress,\n [CONTRACT_NAMES.curatedGateDO]: zeroAddress,\n [CONTRACT_NAMES.curatedGateEEO]: zeroAddress,\n [CONTRACT_NAMES.curatedGateIODC]: zeroAddress,\n [CONTRACT_NAMES.curatedGateIODCP]: zeroAddress,\n },\n moduleId: 4n,\n },\n [CHAINS.Hoodi]: {\n contractAddresses: {\n [CONTRACT_NAMES.curatedModule]:\n '0x87EB69Ae51317405FD285efD2326a4a11f6173b9',\n [CONTRACT_NAMES.accounting]:\n '0x7f7356D29aCd915F1934220956c3305808ceB235',\n [CONTRACT_NAMES.ejector]: '0xfDbde2B3554B69C84e0f8d7daB68D390Ff0f4394',\n [CONTRACT_NAMES.exitPenalties]:\n '0xad79e1d3B380cEb1a0e188fBAB91f85A446E9E54',\n [CONTRACT_NAMES.feeDistributor]:\n '0x0ced6de191E2A15f7BBAf9E32307626C9f6BD0Cd',\n [CONTRACT_NAMES.feeOracle]:\n '0x5D2F27000C80f6f7A03015Fd49dB7FEba3fBfa83',\n [CONTRACT_NAMES.parametersRegistry]:\n '0xefb8e4091A75C4828826bf64595F392f87A07b37',\n [CONTRACT_NAMES.validatorStrikes]:\n '0x4c427Ec826F403339719C0FABfb3209e80939eA6',\n [CONTRACT_NAMES.verifier]: '0x209190Ebc2Be80367a15d05e626784Eb94d6A880',\n [CONTRACT_NAMES.hashConsensus]:\n '0x920883908A78c1554f682006a8aB32E62Be09F33',\n [CONTRACT_NAMES.metaRegistry]:\n '0x857289cCBFBc4C134Cc312022a104CD9b38d8AAE',\n [CONTRACT_NAMES.curatedGatePO]:\n '0xF1862d120831eBE31f7202378Ff3Ae63A5658ae3',\n [CONTRACT_NAMES.curatedGatePTO]:\n '0x410A309dF81B782190188CDB3d215729cc6bC1f3',\n [CONTRACT_NAMES.curatedGatePGO]:\n '0xa5A604b172787e017b1b118F02fE54fC1D696519',\n [CONTRACT_NAMES.curatedGateDO]:\n '0xE966874cDB6A4282ED75Cd10439e3799e5531a2D',\n [CONTRACT_NAMES.curatedGateEEO]:\n '0x5c063da03e3f21443716D75a2205EE16706e1153',\n [CONTRACT_NAMES.curatedGateIODC]:\n '0x1cD655Ac53CfE8269DE0DBfc0140B074623C4A6B',\n [CONTRACT_NAMES.curatedGateIODCP]:\n '0x28518be9894C20135F280a9539617783b08a04c7',\n },\n moduleId: 5n,\n deploymentBlockNumber: BigInt('0x28a0f0'),\n },\n },\n};\n"],"mappings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KAC9B,eAAe,gBAAgB;KAC/B,eAAe,iBAAiB;KAChC,eAAe,iBAAiB;KAChC,eAAe,gBAAgB;KAC/B,eAAe,iBAAiB;KAChC,eAAe,kBAAkB;KACjC,eAAe,mBAAmB;IACrC;GACA,UAAU;GACZ;GACC,OAAO,QAAQ;GACd,mBAAmB;KAChB,eAAe,gBACd;KACD,eAAe,aACd;KACD,eAAe,UAAU;KACzB,eAAe,gBACd;KACD,eAAe,iBACd;KACD,eAAe,YACd;KACD,eAAe,qBACd;KACD,eAAe,mBACd;KACD,eAAe,WAAW;KAC1B,eAAe,gBACd;KACD,eAAe,eACd;KACD,eAAe,gBACd;KACD,eAAe,iBACd;KACD,eAAe,iBACd;KACD,eAAe,gBACd;KACD,eAAe,iBACd;KACD,eAAe,kBACd;KACD,eAAe,mBACd;IACJ;GACA,UAAU;GACV,uBAAuB,OAAO,WAAU;GAC1C;EACF;CACF"}
1
+ {"version":3,"file":"module-config.mjs","names":[],"sources":["../../../src/common/constants/module-config.ts"],"sourcesContent":["import { CHAINS } from '@lidofinance/lido-ethereum-sdk';\nimport { Address, zeroAddress } from 'viem';\n\nimport { CONTRACT_NAMES } from './contract-names';\nimport { MODULE_NAME, PerModule } from './module-name';\nimport { PerSupportedChain } from './supported-chains';\n\ntype ContractAddressMap = { [key in CONTRACT_NAMES]?: Address };\n\ntype ModuleChainConfig = {\n contractAddresses: ContractAddressMap;\n moduleId: bigint;\n deploymentBlockNumber?: bigint;\n};\n\nexport type ModuleConfig = PerSupportedChain<ModuleChainConfig>;\n\nexport const COMMON_ADDRESSES: PerSupportedChain<ContractAddressMap> = {\n [CHAINS.Mainnet]: {\n [CONTRACT_NAMES.stakingRouter]:\n '0xFdDf38947aFB03C621C71b06C9C70bce73f12999',\n [CONTRACT_NAMES.validatorsExitBusOracle]:\n '0x0De4Ea0184c2ad0BacA7183356Aea5B8d5Bf5c6e',\n [CONTRACT_NAMES.withdrawalVault]:\n '0xB9D7934878B5FB9610B3fE8A5e441e8fad7E293f',\n [CONTRACT_NAMES.lidoRewardsVault]:\n '0x388C818CA8B9251b393131C08a736A67ccB19297',\n [CONTRACT_NAMES.stETH]: '0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84',\n [CONTRACT_NAMES.wstETH]: '0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0',\n [CONTRACT_NAMES.smDiscovery]: '0x32893b74064160c626652c2c21a849fdd0bddfd6',\n },\n [CHAINS.Hoodi]: {\n [CONTRACT_NAMES.stakingRouter]:\n '0xCc820558B39ee15C7C45B59390B503b83fb499A8',\n [CONTRACT_NAMES.validatorsExitBusOracle]:\n '0x8664d394C2B3278F26A1B44B967aEf99707eeAB2',\n [CONTRACT_NAMES.withdrawalVault]:\n '0x4473dCDDbf77679A643BdB654dbd86D67F8d32f2',\n [CONTRACT_NAMES.lidoRewardsVault]:\n '0x9b108015fe433F173696Af3Aa0CF7CDb3E104258',\n [CONTRACT_NAMES.stETH]: '0x3508A952176b3c15387C97BE809eaffB1982176a',\n [CONTRACT_NAMES.wstETH]: '0x7E99eE3C66636DE415D2d7C880938F2f40f94De4',\n [CONTRACT_NAMES.smDiscovery]: '0xd4523c0925b2246325dcc1d919f2b84c0bcacad9',\n },\n};\n\nexport const MODULE_CONFIG: PerModule<ModuleConfig> = {\n [MODULE_NAME.CSM]: {\n [CHAINS.Mainnet]: {\n contractAddresses: {\n [CONTRACT_NAMES.csModule]: '0xdA7dE2ECdDfccC6c3AF10108Db212ACBBf9EA83F',\n [CONTRACT_NAMES.accounting]:\n '0x4d72BFF1BeaC69925F8Bd12526a39BAAb069e5Da',\n [CONTRACT_NAMES.ejector]: '0xc72b58aa02E0e98cF8A4a0E9Dce75e763800802C',\n [CONTRACT_NAMES.exitPenalties]:\n '0x06cd61045f958A209a0f8D746e103eCc625f4193',\n [CONTRACT_NAMES.feeDistributor]:\n '0xD99CC66fEC647E68294C6477B40fC7E0F6F618D0',\n [CONTRACT_NAMES.feeOracle]:\n '0x4D4074628678Bd302921c20573EEa1ed38DdF7FB',\n [CONTRACT_NAMES.parametersRegistry]:\n '0x9D28ad303C90DF524BA960d7a2DAC56DcC31e428',\n [CONTRACT_NAMES.validatorStrikes]:\n '0xaa328816027F2D32B9F56d190BC9Fa4A5C07637f',\n [CONTRACT_NAMES.verifier]: '0xdC5FE1782B6943f318E05230d688713a560063DC',\n [CONTRACT_NAMES.hashConsensus]:\n '0x71093efF8D8599b5fA340D665Ad60fA7C80688e4',\n [CONTRACT_NAMES.permissionlessGate]:\n '0xcF33a38111d0B1246A3F38a838fb41D626B454f0',\n [CONTRACT_NAMES.icsGate]: '0xB314D4A76C457c93150d308787939063F4Cc67E0',\n [CONTRACT_NAMES.idvtcGate]: zeroAddress,\n },\n moduleId: 3n,\n deploymentBlockNumber: BigInt('0x13f7326'),\n },\n [CHAINS.Hoodi]: {\n contractAddresses: {\n [CONTRACT_NAMES.csModule]: '0x79CEf36D84743222f37765204Bec41E92a93E59d',\n [CONTRACT_NAMES.accounting]:\n '0xA54b90BA34C5f326BC1485054080994e38FB4C60',\n [CONTRACT_NAMES.ejector]: '0xCAe028378d69D54dc8bF809e6C44CF751F997b80',\n [CONTRACT_NAMES.exitPenalties]:\n '0xD259b31083Be841E5C85b2D481Cfc17C14276800',\n [CONTRACT_NAMES.feeDistributor]:\n '0xaCd9820b0A2229a82dc1A0770307ce5522FF3582',\n [CONTRACT_NAMES.feeOracle]:\n '0xe7314f561B2e72f9543F1004e741bab6Fc51028B',\n [CONTRACT_NAMES.parametersRegistry]:\n '0xA4aD5236963f9Fe4229864712269D8d79B65C5Ad',\n [CONTRACT_NAMES.validatorStrikes]:\n '0x8fBA385C3c334D251eE413e79d4D3890db98693c',\n [CONTRACT_NAMES.verifier]: '0xC96406b0eADdAC5708aFCa04DcCA67BAdC9642Fd',\n [CONTRACT_NAMES.hashConsensus]:\n '0x54f74a10e4397dDeF85C4854d9dfcA129D72C637',\n [CONTRACT_NAMES.permissionlessGate]:\n '0xd7bD8D2A9888D1414c770B35ACF55890B15de26a',\n [CONTRACT_NAMES.icsGate]: '0x10a254E724fe2b7f305F76f3F116a3969c53845f',\n [CONTRACT_NAMES.idvtcGate]:\n '0x887F8512F9998045f4b5993e6eaa6BCfE5F02A94',\n },\n moduleId: 4n,\n deploymentBlockNumber: BigInt('0x1374'),\n },\n },\n\n [MODULE_NAME.CM]: {\n [CHAINS.Mainnet]: {\n contractAddresses: {\n [CONTRACT_NAMES.curatedModule]: zeroAddress,\n [CONTRACT_NAMES.accounting]: zeroAddress,\n [CONTRACT_NAMES.ejector]: zeroAddress,\n [CONTRACT_NAMES.exitPenalties]: zeroAddress,\n [CONTRACT_NAMES.feeDistributor]: zeroAddress,\n [CONTRACT_NAMES.feeOracle]: zeroAddress,\n [CONTRACT_NAMES.parametersRegistry]: zeroAddress,\n [CONTRACT_NAMES.validatorStrikes]: zeroAddress,\n [CONTRACT_NAMES.verifier]: zeroAddress,\n [CONTRACT_NAMES.hashConsensus]: zeroAddress,\n [CONTRACT_NAMES.metaRegistry]: zeroAddress,\n [CONTRACT_NAMES.curatedGatePO]: zeroAddress,\n [CONTRACT_NAMES.curatedGatePTO]: zeroAddress,\n [CONTRACT_NAMES.curatedGatePGO]: zeroAddress,\n [CONTRACT_NAMES.curatedGateDO]: zeroAddress,\n [CONTRACT_NAMES.curatedGateEEO]: zeroAddress,\n [CONTRACT_NAMES.curatedGateIODC]: zeroAddress,\n [CONTRACT_NAMES.curatedGateIODCP]: zeroAddress,\n },\n moduleId: 4n,\n },\n [CHAINS.Hoodi]: {\n contractAddresses: {\n [CONTRACT_NAMES.curatedModule]:\n '0x87EB69Ae51317405FD285efD2326a4a11f6173b9',\n [CONTRACT_NAMES.accounting]:\n '0x7f7356D29aCd915F1934220956c3305808ceB235',\n [CONTRACT_NAMES.ejector]: '0xfDbde2B3554B69C84e0f8d7daB68D390Ff0f4394',\n [CONTRACT_NAMES.exitPenalties]:\n '0xad79e1d3B380cEb1a0e188fBAB91f85A446E9E54',\n [CONTRACT_NAMES.feeDistributor]:\n '0x0ced6de191E2A15f7BBAf9E32307626C9f6BD0Cd',\n [CONTRACT_NAMES.feeOracle]:\n '0x5D2F27000C80f6f7A03015Fd49dB7FEba3fBfa83',\n [CONTRACT_NAMES.parametersRegistry]:\n '0xefb8e4091A75C4828826bf64595F392f87A07b37',\n [CONTRACT_NAMES.validatorStrikes]:\n '0x4c427Ec826F403339719C0FABfb3209e80939eA6',\n [CONTRACT_NAMES.verifier]: '0x209190Ebc2Be80367a15d05e626784Eb94d6A880',\n [CONTRACT_NAMES.hashConsensus]:\n '0x920883908A78c1554f682006a8aB32E62Be09F33',\n [CONTRACT_NAMES.metaRegistry]:\n '0x857289cCBFBc4C134Cc312022a104CD9b38d8AAE',\n [CONTRACT_NAMES.curatedGatePO]:\n '0xF1862d120831eBE31f7202378Ff3Ae63A5658ae3',\n [CONTRACT_NAMES.curatedGatePTO]:\n '0x410A309dF81B782190188CDB3d215729cc6bC1f3',\n [CONTRACT_NAMES.curatedGatePGO]:\n '0xa5A604b172787e017b1b118F02fE54fC1D696519',\n [CONTRACT_NAMES.curatedGateDO]:\n '0xE966874cDB6A4282ED75Cd10439e3799e5531a2D',\n [CONTRACT_NAMES.curatedGateEEO]:\n '0x5c063da03e3f21443716D75a2205EE16706e1153',\n [CONTRACT_NAMES.curatedGateIODC]:\n '0x1cD655Ac53CfE8269DE0DBfc0140B074623C4A6B',\n [CONTRACT_NAMES.curatedGateIODCP]:\n '0x28518be9894C20135F280a9539617783b08a04c7',\n },\n moduleId: 5n,\n deploymentBlockNumber: BigInt('0x28a0f0'),\n },\n },\n};\n"],"mappings":";;;;;AAiBO,MAAM,mBAA0D;EACpE,OAAO,UAAU;GACf,eAAe,gBACd;GACD,eAAe,0BACd;GACD,eAAe,kBACd;GACD,eAAe,mBACd;GACD,eAAe,QAAQ;GACvB,eAAe,SAAS;GACxB,eAAe,cAAc;EAChC;EACC,OAAO,QAAQ;GACb,eAAe,gBACd;GACD,eAAe,0BACd;GACD,eAAe,k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ACD,eAAe,aACd;KACD,eAAe,UAAU;KACzB,eAAe,gBACd;KACD,eAAe,iBACd;KACD,eAAe,YACd;KACD,eAAe,qBACd;KACD,eAAe,mBACd;KACD,eAAe,WAAW;KAC1B,eAAe,gBACd;KACD,eAAe,eACd;KACD,eAAe,gBACd;KACD,eAAe,iBACd;KACD,eAAe,iBACd;KACD,eAAe,gBACd;KACD,eAAe,iBACd;KACD,eAAe,kBACd;KACD,eAAe,mBACd;IACJ;GACA,UAAU;GACV,uBAAuB,OAAO,WAAU;GAC1C;EACF;CACF"}
@@ -7899,8 +7899,10 @@ declare class CoreSDK extends CsmSDKCacheable {
7899
7899
  [x: `uint128[${string}]`]: undefined;
7900
7900
  [x: `uint32[${string}]`]: undefined;
7901
7901
  [x: `uint248[${string}]`]: undefined;
7902
- [x: `bytes5[${string}]`]: undefined;
7903
7902
  [x: `bytes2[${string}]`]: undefined;
7903
+ [x: `bytes14[${string}]`]: undefined;
7904
+ [x: `bytes24[${string}]`]: undefined;
7905
+ [x: `bytes5[${string}]`]: undefined;
7904
7906
  [x: `bytes1[${string}]`]: undefined;
7905
7907
  [x: `bytes3[${string}]`]: undefined;
7906
7908
  [x: `bytes7[${string}]`]: undefined;
@@ -7910,7 +7912,6 @@ declare class CoreSDK extends CsmSDKCacheable {
7910
7912
  [x: `bytes22[${string}]`]: undefined;
7911
7913
  [x: `bytes6[${string}]`]: undefined;
7912
7914
  [x: `bytes16[${string}]`]: undefined;
7913
- [x: `bytes14[${string}]`]: undefined;
7914
7915
  [x: `bytes21[${string}]`]: undefined;
7915
7916
  [x: `bytes9[${string}]`]: undefined;
7916
7917
  [x: `bytes28[${string}]`]: undefined;
@@ -7922,7 +7923,6 @@ declare class CoreSDK extends CsmSDKCacheable {
7922
7923
  [x: `bytes19[${string}]`]: undefined;
7923
7924
  [x: `bytes20[${string}]`]: undefined;
7924
7925
  [x: `bytes23[${string}]`]: undefined;
7925
- [x: `bytes24[${string}]`]: undefined;
7926
7926
  [x: `bytes25[${string}]`]: undefined;
7927
7927
  [x: `bytes26[${string}]`]: undefined;
7928
7928
  [x: `bytes27[${string}]`]: undefined;
@@ -7930,6 +7930,7 @@ declare class CoreSDK extends CsmSDKCacheable {
7930
7930
  [x: `bytes30[${string}]`]: undefined;
7931
7931
  [x: `bytes31[${string}]`]: undefined;
7932
7932
  [x: `int[${string}]`]: undefined;
7933
+ [x: `int24[${string}]`]: undefined;
7933
7934
  [x: `int8[${string}]`]: undefined;
7934
7935
  [x: `int144[${string}]`]: undefined;
7935
7936
  [x: `int16[${string}]`]: undefined;
@@ -7937,7 +7938,6 @@ declare class CoreSDK extends CsmSDKCacheable {
7937
7938
  [x: `int96[${string}]`]: undefined;
7938
7939
  [x: `int72[${string}]`]: undefined;
7939
7940
  [x: `int64[${string}]`]: undefined;
7940
- [x: `int24[${string}]`]: undefined;
7941
7941
  [x: `int32[${string}]`]: undefined;
7942
7942
  [x: `int40[${string}]`]: undefined;
7943
7943
  [x: `int48[${string}]`]: undefined;
@@ -8001,8 +8001,10 @@ declare class CoreSDK extends CsmSDKCacheable {
8001
8001
  uint128?: undefined;
8002
8002
  uint32?: undefined;
8003
8003
  uint248?: undefined;
8004
- bytes5?: undefined;
8005
8004
  bytes2?: undefined;
8005
+ bytes14?: undefined;
8006
+ bytes24?: undefined;
8007
+ bytes5?: undefined;
8006
8008
  bytes1?: undefined;
8007
8009
  bytes3?: undefined;
8008
8010
  bytes7?: undefined;
@@ -8012,7 +8014,6 @@ declare class CoreSDK extends CsmSDKCacheable {
8012
8014
  bytes22?: undefined;
8013
8015
  bytes6?: undefined;
8014
8016
  bytes16?: undefined;
8015
- bytes14?: undefined;
8016
8017
  bytes21?: undefined;
8017
8018
  bytes9?: undefined;
8018
8019
  bytes28?: undefined;
@@ -8024,13 +8025,13 @@ declare class CoreSDK extends CsmSDKCacheable {
8024
8025
  bytes19?: undefined;
8025
8026
  bytes20?: undefined;
8026
8027
  bytes23?: undefined;
8027
- bytes24?: undefined;
8028
8028
  bytes25?: undefined;
8029
8029
  bytes26?: undefined;
8030
8030
  bytes27?: undefined;
8031
8031
  bytes29?: undefined;
8032
8032
  bytes30?: undefined;
8033
8033
  bytes31?: undefined;
8034
+ int24?: undefined;
8034
8035
  int8?: undefined;
8035
8036
  int144?: undefined;
8036
8037
  int16?: undefined;
@@ -8038,7 +8039,6 @@ declare class CoreSDK extends CsmSDKCacheable {
8038
8039
  int96?: undefined;
8039
8040
  int72?: undefined;
8040
8041
  int64?: undefined;
8041
- int24?: undefined;
8042
8042
  int32?: undefined;
8043
8043
  int40?: undefined;
8044
8044
  int48?: undefined;
@@ -7899,8 +7899,10 @@ declare class CoreSDK extends CsmSDKCacheable {
7899
7899
  [x: `uint128[${string}]`]: undefined;
7900
7900
  [x: `uint32[${string}]`]: undefined;
7901
7901
  [x: `uint248[${string}]`]: undefined;
7902
- [x: `bytes5[${string}]`]: undefined;
7903
7902
  [x: `bytes2[${string}]`]: undefined;
7903
+ [x: `bytes14[${string}]`]: undefined;
7904
+ [x: `bytes24[${string}]`]: undefined;
7905
+ [x: `bytes5[${string}]`]: undefined;
7904
7906
  [x: `bytes1[${string}]`]: undefined;
7905
7907
  [x: `bytes3[${string}]`]: undefined;
7906
7908
  [x: `bytes7[${string}]`]: undefined;
@@ -7910,7 +7912,6 @@ declare class CoreSDK extends CsmSDKCacheable {
7910
7912
  [x: `bytes22[${string}]`]: undefined;
7911
7913
  [x: `bytes6[${string}]`]: undefined;
7912
7914
  [x: `bytes16[${string}]`]: undefined;
7913
- [x: `bytes14[${string}]`]: undefined;
7914
7915
  [x: `bytes21[${string}]`]: undefined;
7915
7916
  [x: `bytes9[${string}]`]: undefined;
7916
7917
  [x: `bytes28[${string}]`]: undefined;
@@ -7922,7 +7923,6 @@ declare class CoreSDK extends CsmSDKCacheable {
7922
7923
  [x: `bytes19[${string}]`]: undefined;
7923
7924
  [x: `bytes20[${string}]`]: undefined;
7924
7925
  [x: `bytes23[${string}]`]: undefined;
7925
- [x: `bytes24[${string}]`]: undefined;
7926
7926
  [x: `bytes25[${string}]`]: undefined;
7927
7927
  [x: `bytes26[${string}]`]: undefined;
7928
7928
  [x: `bytes27[${string}]`]: undefined;
@@ -7930,6 +7930,7 @@ declare class CoreSDK extends CsmSDKCacheable {
7930
7930
  [x: `bytes30[${string}]`]: undefined;
7931
7931
  [x: `bytes31[${string}]`]: undefined;
7932
7932
  [x: `int[${string}]`]: undefined;
7933
+ [x: `int24[${string}]`]: undefined;
7933
7934
  [x: `int8[${string}]`]: undefined;
7934
7935
  [x: `int144[${string}]`]: undefined;
7935
7936
  [x: `int16[${string}]`]: undefined;
@@ -7937,7 +7938,6 @@ declare class CoreSDK extends CsmSDKCacheable {
7937
7938
  [x: `int96[${string}]`]: undefined;
7938
7939
  [x: `int72[${string}]`]: undefined;
7939
7940
  [x: `int64[${string}]`]: undefined;
7940
- [x: `int24[${string}]`]: undefined;
7941
7941
  [x: `int32[${string}]`]: undefined;
7942
7942
  [x: `int40[${string}]`]: undefined;
7943
7943
  [x: `int48[${string}]`]: undefined;
@@ -8001,8 +8001,10 @@ declare class CoreSDK extends CsmSDKCacheable {
8001
8001
  uint128?: undefined;
8002
8002
  uint32?: undefined;
8003
8003
  uint248?: undefined;
8004
- bytes5?: undefined;
8005
8004
  bytes2?: undefined;
8005
+ bytes14?: undefined;
8006
+ bytes24?: undefined;
8007
+ bytes5?: undefined;
8006
8008
  bytes1?: undefined;
8007
8009
  bytes3?: undefined;
8008
8010
  bytes7?: undefined;
@@ -8012,7 +8014,6 @@ declare class CoreSDK extends CsmSDKCacheable {
8012
8014
  bytes22?: undefined;
8013
8015
  bytes6?: undefined;
8014
8016
  bytes16?: undefined;
8015
- bytes14?: undefined;
8016
8017
  bytes21?: undefined;
8017
8018
  bytes9?: undefined;
8018
8019
  bytes28?: undefined;
@@ -8024,13 +8025,13 @@ declare class CoreSDK extends CsmSDKCacheable {
8024
8025
  bytes19?: undefined;
8025
8026
  bytes20?: undefined;
8026
8027
  bytes23?: undefined;
8027
- bytes24?: undefined;
8028
8028
  bytes25?: undefined;
8029
8029
  bytes26?: undefined;
8030
8030
  bytes27?: undefined;
8031
8031
  bytes29?: undefined;
8032
8032
  bytes30?: undefined;
8033
8033
  bytes31?: undefined;
8034
+ int24?: undefined;
8034
8035
  int8?: undefined;
8035
8036
  int144?: undefined;
8036
8037
  int16?: undefined;
@@ -8038,7 +8039,6 @@ declare class CoreSDK extends CsmSDKCacheable {
8038
8039
  int96?: undefined;
8039
8040
  int72?: undefined;
8040
8041
  int64?: undefined;
8041
- int24?: undefined;
8042
8042
  int32?: undefined;
8043
8043
  int40?: undefined;
8044
8044
  int48?: undefined;
@@ -172,7 +172,7 @@ var DepositDataSDK = class extends (_a = require_csm_sdk_module.CsmSDKModule, _p
172
172
  pubkeys.forEach((pubkey, index) => {
173
173
  if (clKeys.find((k) => require_compare_lowercase.compareLowercase(k.pubkey, pubkey))) errors.push({
174
174
  index,
175
- message: `pubkey already exists as validator on CL`,
175
+ message: `pubkey already exists as a validator on CL`,
176
176
  field: "pubkey",
177
177
  code: require_types$1.ValidationErrorCode.VALIDATOR_EXISTS
178
178
  });
@@ -1 +1 @@
1
- {"version":3,"file":"deposit-data-sdk.cjs","names":[],"sources":["../../src/deposit-data-sdk/deposit-data-sdk.ts"],"sourcesContent":["import { Hex } from 'viem';\nimport { CsmSDKModule } from '../common/class-primitives/csm-sdk-module';\nimport { Cache, ErrorHandler, Logger } from '../common/decorators/index';\nimport { CACHE_MID, CONTRACT_NAMES } from '../common/index';\nimport {\n compareLowercase,\n isHexadecimalString,\n toHexString,\n} from '../common/utils/index';\nimport { KeysCacheSDK } from '../keys-cache-sdk/keys-cache-sdk';\nimport { KeyCacheStatus } from '../keys-cache-sdk/types';\nimport { KeysWithStatusSDK } from '../keys-with-status-sdk/keys-with-status-sdk';\nimport { ModuleSDK } from '../module-sdk/module-sdk';\nimport { PUBKEY_LENGTH } from './constants';\nimport { parseDepositData, removeKey } from './parser';\nimport {\n DepositData,\n ParseResult,\n RemoveKeyResult,\n ValidationError,\n ValidationErrorCode,\n} from './types';\nimport { validateDepositData } from './validator';\n\nexport class DepositDataSDK extends CsmSDKModule<{\n module: ModuleSDK;\n keysWithStatus?: KeysWithStatusSDK;\n keysCache?: KeysCacheSDK;\n}> {\n @Logger('Utils:')\n public parseDepositData(json: string): ParseResult {\n return parseDepositData(json);\n }\n\n @Logger('Utils:')\n public removeKey(json: string, index: number): RemoveKeyResult {\n return removeKey(json, index);\n }\n\n @Logger('Utils:')\n private async getWcPrefix(): Promise<string> {\n const wcType = await this.bus.module.getWithdrawalCredentialsType();\n return wcType.toString(16).padStart(2, '0').padEnd(24, '0');\n }\n\n @Logger('Utils:')\n public async validateDepositData(\n depositData: DepositData[],\n options?: { skipPending?: boolean },\n ): Promise<ValidationError[]> {\n const chainId = this.core.chainId;\n const wc = this.core.getContractAddress(CONTRACT_NAMES.withdrawalVault);\n const [blockNumber, wcPrefix] = await Promise.all([\n this.core.publicClient.getBlockNumber(),\n this.getWcPrefix(),\n ]);\n\n const errors = await validateDepositData(depositData, {\n chainId,\n withdrawalCredentials: wc,\n wcPrefix,\n currentBlockNumber: Number(blockNumber),\n });\n\n if (errors.length) {\n return [...errors];\n }\n\n const pubkeys = depositData.map((data) => data.pubkey);\n\n const duplicateErrors = this.checkCachedKeys(pubkeys, options);\n const uploadedDuplicateErrors = await this.checkUploadedKeys(pubkeys);\n const clErrors = await this.checkClKeys(pubkeys.map(toHexString));\n\n return [\n ...errors,\n ...duplicateErrors,\n ...uploadedDuplicateErrors,\n ...clErrors,\n ];\n }\n\n @Logger('API:')\n @ErrorHandler()\n @Cache(CACHE_MID)\n public async checkUploadedKeys(pubkeys: Hex[]): Promise<ValidationError[]> {\n const keys = await this.bus.keysWithStatus?.getApiKeys(pubkeys);\n const errors: ValidationError[] = [];\n\n if (!keys) return errors;\n\n pubkeys.forEach((pubkey, index) => {\n const isUploaded = keys.find((key) => compareLowercase(key.key, pubkey));\n\n if (isUploaded) {\n errors.push({\n index,\n message: `pubkey was previously submitted`,\n field: 'pubkey',\n code: ValidationErrorCode.PREVIOUSLY_SUBMITTED,\n });\n }\n });\n\n return errors;\n }\n\n @Logger('Utils:')\n @ErrorHandler()\n public checkCachedKeys(\n pubkeys: Hex[],\n options?: { skipPending?: boolean },\n ): ValidationError[] {\n const keysCache = this.bus.keysCache;\n const errors: ValidationError[] = [];\n\n if (!keysCache) return errors;\n\n pubkeys.forEach((pubkey, index) => {\n const status = keysCache.getCacheStatus(pubkey);\n if (!status) return;\n if (status === KeyCacheStatus.PENDING && options?.skipPending) return;\n\n errors.push({\n index,\n field: 'pubkey',\n message: `pubkey already submitted`,\n code:\n status === KeyCacheStatus.CONFIRMED\n ? ValidationErrorCode.CACHED_PUBKEY_CONFIRMED\n : ValidationErrorCode.CACHED_PUBKEY_PENDING,\n });\n });\n\n return errors;\n }\n\n @Logger('API:')\n @ErrorHandler()\n public async checkClKeys(pubkeys: Hex[]): Promise<ValidationError[]> {\n const validPubkeys = pubkeys.filter((p) =>\n isHexadecimalString(p, PUBKEY_LENGTH),\n );\n const clKeys = await this.bus.keysWithStatus?.getClKeys(validPubkeys);\n const errors: ValidationError[] = [];\n\n if (!clKeys) return errors;\n\n pubkeys.forEach((pubkey, index) => {\n const exists = clKeys.find((k) => compareLowercase(k.pubkey, pubkey));\n if (exists) {\n errors.push({\n index,\n message: `pubkey already exists as validator on CL`,\n field: 'pubkey',\n code: ValidationErrorCode.VALIDATOR_EXISTS,\n });\n }\n });\n\n return errors;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA,kBAAA,sBAAA,wBAAA,0BAAA,kBAAA,gBAAA,uBAAA,IAAA;AAwBO,IAAM,iBAAN,eAA6B,KAAA,uBAAA,cAKlC,wBAAA,CAAC,eAAA,OAAO,SAAQ,CAAA,EAKhB,iBAAA,CAAC,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AAA,oBAAoB;IAC3B,CAAA;IAEJ;AAED,SAAO;;;AAxIJ,QAAA,iBAAA,GAAA;AAML,kBAAA,OAAA,GAAO,oBADP,uBALW,eAAA;AAWX,kBAAA,OAAA,GAAO,aADP,gBAVW,eAAA;AAgBX,kBAAA,OAAA,GAAc,eADd,kBAfW,eAAA;AAsBX,kBAAA,OAAA,GAAa,uBADb,0BArBW,eAAA;AA6DX,kBAAA,OAAA,GAAa,qBAHb,wBA1DW,eAAA;AAqFX,kBAAA,OAAA,GAAO,mBAFP,sBAnFW,eAAA;AAmHX,kBAAA,OAAA,GAAa,eAFb,kBAjHW,eAAA;AAAN,oBAAA,OAAM,eAAA"}
1
+ {"version":3,"file":"deposit-data-sdk.cjs","names":[],"sources":["../../src/deposit-data-sdk/deposit-data-sdk.ts"],"sourcesContent":["import { Hex } from 'viem';\nimport { CsmSDKModule } from '../common/class-primitives/csm-sdk-module';\nimport { Cache, ErrorHandler, Logger } from '../common/decorators/index';\nimport { CACHE_MID, CONTRACT_NAMES } from '../common/index';\nimport {\n compareLowercase,\n isHexadecimalString,\n toHexString,\n} from '../common/utils/index';\nimport { KeysCacheSDK } from '../keys-cache-sdk/keys-cache-sdk';\nimport { KeyCacheStatus } from '../keys-cache-sdk/types';\nimport { KeysWithStatusSDK } from '../keys-with-status-sdk/keys-with-status-sdk';\nimport { ModuleSDK } from '../module-sdk/module-sdk';\nimport { PUBKEY_LENGTH } from './constants';\nimport { parseDepositData, removeKey } from './parser';\nimport {\n DepositData,\n ParseResult,\n RemoveKeyResult,\n ValidationError,\n ValidationErrorCode,\n} from './types';\nimport { validateDepositData } from './validator';\n\nexport class DepositDataSDK extends CsmSDKModule<{\n module: ModuleSDK;\n keysWithStatus?: KeysWithStatusSDK;\n keysCache?: KeysCacheSDK;\n}> {\n @Logger('Utils:')\n public parseDepositData(json: string): ParseResult {\n return parseDepositData(json);\n }\n\n @Logger('Utils:')\n public removeKey(json: string, index: number): RemoveKeyResult {\n return removeKey(json, index);\n }\n\n @Logger('Utils:')\n private async getWcPrefix(): Promise<string> {\n const wcType = await this.bus.module.getWithdrawalCredentialsType();\n return wcType.toString(16).padStart(2, '0').padEnd(24, '0');\n }\n\n @Logger('Utils:')\n public async validateDepositData(\n depositData: DepositData[],\n options?: { skipPending?: boolean },\n ): Promise<ValidationError[]> {\n const chainId = this.core.chainId;\n const wc = this.core.getContractAddress(CONTRACT_NAMES.withdrawalVault);\n const [blockNumber, wcPrefix] = await Promise.all([\n this.core.publicClient.getBlockNumber(),\n this.getWcPrefix(),\n ]);\n\n const errors = await validateDepositData(depositData, {\n chainId,\n withdrawalCredentials: wc,\n wcPrefix,\n currentBlockNumber: Number(blockNumber),\n });\n\n if (errors.length) {\n return [...errors];\n }\n\n const pubkeys = depositData.map((data) => data.pubkey);\n\n const duplicateErrors = this.checkCachedKeys(pubkeys, options);\n const uploadedDuplicateErrors = await this.checkUploadedKeys(pubkeys);\n const clErrors = await this.checkClKeys(pubkeys.map(toHexString));\n\n return [\n ...errors,\n ...duplicateErrors,\n ...uploadedDuplicateErrors,\n ...clErrors,\n ];\n }\n\n @Logger('API:')\n @ErrorHandler()\n @Cache(CACHE_MID)\n public async checkUploadedKeys(pubkeys: Hex[]): Promise<ValidationError[]> {\n const keys = await this.bus.keysWithStatus?.getApiKeys(pubkeys);\n const errors: ValidationError[] = [];\n\n if (!keys) return errors;\n\n pubkeys.forEach((pubkey, index) => {\n const isUploaded = keys.find((key) => compareLowercase(key.key, pubkey));\n\n if (isUploaded) {\n errors.push({\n index,\n message: `pubkey was previously submitted`,\n field: 'pubkey',\n code: ValidationErrorCode.PREVIOUSLY_SUBMITTED,\n });\n }\n });\n\n return errors;\n }\n\n @Logger('Utils:')\n @ErrorHandler()\n public checkCachedKeys(\n pubkeys: Hex[],\n options?: { skipPending?: boolean },\n ): ValidationError[] {\n const keysCache = this.bus.keysCache;\n const errors: ValidationError[] = [];\n\n if (!keysCache) return errors;\n\n pubkeys.forEach((pubkey, index) => {\n const status = keysCache.getCacheStatus(pubkey);\n if (!status) return;\n if (status === KeyCacheStatus.PENDING && options?.skipPending) return;\n\n errors.push({\n index,\n field: 'pubkey',\n message: `pubkey already submitted`,\n code:\n status === KeyCacheStatus.CONFIRMED\n ? ValidationErrorCode.CACHED_PUBKEY_CONFIRMED\n : ValidationErrorCode.CACHED_PUBKEY_PENDING,\n });\n });\n\n return errors;\n }\n\n @Logger('API:')\n @ErrorHandler()\n public async checkClKeys(pubkeys: Hex[]): Promise<ValidationError[]> {\n const validPubkeys = pubkeys.filter((p) =>\n isHexadecimalString(p, PUBKEY_LENGTH),\n );\n const clKeys = await this.bus.keysWithStatus?.getClKeys(validPubkeys);\n const errors: ValidationError[] = [];\n\n if (!clKeys) return errors;\n\n pubkeys.forEach((pubkey, index) => {\n const exists = clKeys.find((k) => compareLowercase(k.pubkey, pubkey));\n if (exists) {\n errors.push({\n index,\n message: `pubkey already exists as a validator on CL`,\n field: 'pubkey',\n code: ValidationErrorCode.VALIDATOR_EXISTS,\n });\n }\n });\n\n return errors;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA,kBAAA,sBAAA,wBAAA,0BAAA,kBAAA,gBAAA,uBAAA,IAAA;AAwBO,IAAM,iBAAN,eAA6B,KAAA,uBAAA,cAKlC,wBAAA,CAAC,eAAA,OAAO,SAAQ,CAAA,EAKhB,iBAAA,CAAC,eAAA,OAAO,SAAQ,CAAA,EAKhB,mBAAA,CAAC,eAAA,OAAO,SAAQ,CAAA,EAMhB,2BAAA,CAAC,eAAA,OAAO,SAAQ,CAAA,EAqChB,yBAAA;CAAC,eAAA,OAAO,OAAM;CACb,sBAAA,cAAa;CACb,cAAA,MAAM,wBAAA,UAAS;CAAA,EAuBhB,uBAAA,CAAC,eAAA,OAAO,SAAQ,EACf,sBAAA,cAAa,CAAA,EA6Bd,mBA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A1DW,eAAA;AAqFX,kBAAA,OAAA,GAAO,mBAFP,sBAnFW,eAAA;AAmHX,kBAAA,OAAA,GAAa,eAFb,kBAjHW,eAAA;AAAN,oBAAA,OAAM,eAAA"}
@@ -172,7 +172,7 @@ var DepositDataSDK = class extends (_a = CsmSDKModule, _parseDepositData_dec = [
172
172
  pubkeys.forEach((pubkey, index) => {
173
173
  if (clKeys.find((k) => compareLowercase(k.pubkey, pubkey))) errors.push({
174
174
  index,
175
- message: `pubkey already exists as validator on CL`,
175
+ message: `pubkey already exists as a validator on CL`,
176
176
  field: "pubkey",
177
177
  code: ValidationErrorCode.VALIDATOR_EXISTS
178
178
  });
@@ -1 +1 @@
1
- {"version":3,"file":"deposit-data-sdk.mjs","names":[],"sources":["../../src/deposit-data-sdk/deposit-data-sdk.ts"],"sourcesContent":["import { Hex } from 'viem';\nimport { CsmSDKModule } from '../common/class-primitives/csm-sdk-module';\nimport { Cache, ErrorHandler, Logger } from '../common/decorators/index';\nimport { CACHE_MID, CONTRACT_NAMES } from '../common/index';\nimport {\n compareLowercase,\n isHexadecimalString,\n toHexString,\n} from '../common/utils/index';\nimport { KeysCacheSDK } from '../keys-cache-sdk/keys-cache-sdk';\nimport { KeyCacheStatus } from '../keys-cache-sdk/types';\nimport { KeysWithStatusSDK } from '../keys-with-status-sdk/keys-with-status-sdk';\nimport { ModuleSDK } from '../module-sdk/module-sdk';\nimport { PUBKEY_LENGTH } from './constants';\nimport { parseDepositData, removeKey } from './parser';\nimport {\n DepositData,\n ParseResult,\n RemoveKeyResult,\n ValidationError,\n ValidationErrorCode,\n} from './types';\nimport { validateDepositData } from './validator';\n\nexport class DepositDataSDK extends CsmSDKModule<{\n module: ModuleSDK;\n keysWithStatus?: KeysWithStatusSDK;\n keysCache?: KeysCacheSDK;\n}> {\n @Logger('Utils:')\n public parseDepositData(json: string): ParseResult {\n return parseDepositData(json);\n }\n\n @Logger('Utils:')\n public removeKey(json: string, index: number): RemoveKeyResult {\n return removeKey(json, index);\n }\n\n @Logger('Utils:')\n private async getWcPrefix(): Promise<string> {\n const wcType = await this.bus.module.getWithdrawalCredentialsType();\n return wcType.toString(16).padStart(2, '0').padEnd(24, '0');\n }\n\n @Logger('Utils:')\n public async validateDepositData(\n depositData: DepositData[],\n options?: { skipPending?: boolean },\n ): Promise<ValidationError[]> {\n const chainId = this.core.chainId;\n const wc = this.core.getContractAddress(CONTRACT_NAMES.withdrawalVault);\n const [blockNumber, wcPrefix] = await Promise.all([\n this.core.publicClient.getBlockNumber(),\n this.getWcPrefix(),\n ]);\n\n const errors = await validateDepositData(depositData, {\n chainId,\n withdrawalCredentials: wc,\n wcPrefix,\n currentBlockNumber: Number(blockNumber),\n });\n\n if (errors.length) {\n return [...errors];\n }\n\n const pubkeys = depositData.map((data) => data.pubkey);\n\n const duplicateErrors = this.checkCachedKeys(pubkeys, options);\n const uploadedDuplicateErrors = await this.checkUploadedKeys(pubkeys);\n const clErrors = await this.checkClKeys(pubkeys.map(toHexString));\n\n return [\n ...errors,\n ...duplicateErrors,\n ...uploadedDuplicateErrors,\n ...clErrors,\n ];\n }\n\n @Logger('API:')\n @ErrorHandler()\n @Cache(CACHE_MID)\n public async checkUploadedKeys(pubkeys: Hex[]): Promise<ValidationError[]> {\n const keys = await this.bus.keysWithStatus?.getApiKeys(pubkeys);\n const errors: ValidationError[] = [];\n\n if (!keys) return errors;\n\n pubkeys.forEach((pubkey, index) => {\n const isUploaded = keys.find((key) => compareLowercase(key.key, pubkey));\n\n if (isUploaded) {\n errors.push({\n index,\n message: `pubkey was previously submitted`,\n field: 'pubkey',\n code: ValidationErrorCode.PREVIOUSLY_SUBMITTED,\n });\n }\n });\n\n return errors;\n }\n\n @Logger('Utils:')\n @ErrorHandler()\n public checkCachedKeys(\n pubkeys: Hex[],\n options?: { skipPending?: boolean },\n ): ValidationError[] {\n const keysCache = this.bus.keysCache;\n const errors: ValidationError[] = [];\n\n if (!keysCache) return errors;\n\n pubkeys.forEach((pubkey, index) => {\n const status = keysCache.getCacheStatus(pubkey);\n if (!status) return;\n if (status === KeyCacheStatus.PENDING && options?.skipPending) return;\n\n errors.push({\n index,\n field: 'pubkey',\n message: `pubkey already submitted`,\n code:\n status === KeyCacheStatus.CONFIRMED\n ? ValidationErrorCode.CACHED_PUBKEY_CONFIRMED\n : ValidationErrorCode.CACHED_PUBKEY_PENDING,\n });\n });\n\n return errors;\n }\n\n @Logger('API:')\n @ErrorHandler()\n public async checkClKeys(pubkeys: Hex[]): Promise<ValidationError[]> {\n const validPubkeys = pubkeys.filter((p) =>\n isHexadecimalString(p, PUBKEY_LENGTH),\n );\n const clKeys = await this.bus.keysWithStatus?.getClKeys(validPubkeys);\n const errors: ValidationError[] = [];\n\n if (!clKeys) return errors;\n\n pubkeys.forEach((pubkey, index) => {\n const exists = clKeys.find((k) => compareLowercase(k.pubkey, pubkey));\n if (exists) {\n errors.push({\n index,\n message: `pubkey already exists as validator on CL`,\n field: 'pubkey',\n code: ValidationErrorCode.VALIDATOR_EXISTS,\n });\n }\n });\n\n return errors;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA,kBAAA,sBAAA,wBAAA,0BAAA,kBAAA,gBAAA,uBAAA,IAAA;AAwBO,IAAM,iBAAN,eAA6B,KAAA,cAKlC,wBAAA,CAAC,OAAO,SAAQ,CAAA,EAKhB,iBAAA,CAAC,OAAO,SAAQ,CAAA,EAKhB,mBAAA,CAAC,OAAO,SAAQ,CAAA,EAMhB,2BAAA,CAAC,OAAO,SAAQ,CAAA,EAqChB,yBAAA;CAAC,OAAO,OAAM;CACb,cAAa;CACb,MAAM,UAAS;CAAA,EAuBhB,uBAAA,CAAC,OAAO,SAAQ,EACf,cAAa,CAAA,EA6Bd,mBAAA,CAAC,OAAO,OAAM,EACb,cAAa,CAAA,EAlHoB,IAIjC;CAJI,cAAA;AAA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../../src/deposit-data-sdk/deposit-data-sdk.ts"],"sourcesContent":["import { Hex } from 'viem';\nimport { CsmSDKModule } from '../common/class-primitives/csm-sdk-module';\nimport { Cache, ErrorHandler, Logger } from '../common/decorators/index';\nimport { CACHE_MID, CONTRACT_NAMES } from '../common/index';\nimport {\n compareLowercase,\n isHexadecimalString,\n toHexString,\n} from '../common/utils/index';\nimport { KeysCacheSDK } from '../keys-cache-sdk/keys-cache-sdk';\nimport { KeyCacheStatus } from '../keys-cache-sdk/types';\nimport { KeysWithStatusSDK } from '../keys-with-status-sdk/keys-with-status-sdk';\nimport { ModuleSDK } from '../module-sdk/module-sdk';\nimport { PUBKEY_LENGTH } from './constants';\nimport { parseDepositData, removeKey } from './parser';\nimport {\n DepositData,\n ParseResult,\n RemoveKeyResult,\n ValidationError,\n ValidationErrorCode,\n} from './types';\nimport { validateDepositData } from './validator';\n\nexport class DepositDataSDK extends CsmSDKModule<{\n module: ModuleSDK;\n keysWithStatus?: KeysWithStatusSDK;\n keysCache?: KeysCacheSDK;\n}> {\n @Logger('Utils:')\n public parseDepositData(json: string): ParseResult {\n return parseDepositData(json);\n }\n\n @Logger('Utils:')\n public removeKey(json: string, index: number): RemoveKeyResult {\n return removeKey(json, index);\n }\n\n @Logger('Utils:')\n private async getWcPrefix(): Promise<string> {\n const wcType = await this.bus.module.getWithdrawalCredentialsType();\n return wcType.toString(16).padStart(2, '0').padEnd(24, '0');\n }\n\n @Logger('Utils:')\n public async validateDepositData(\n depositData: DepositData[],\n options?: { skipPending?: boolean },\n ): Promise<ValidationError[]> {\n const chainId = this.core.chainId;\n const wc = this.core.getContractAddress(CONTRACT_NAMES.withdrawalVault);\n const [blockNumber, wcPrefix] = await Promise.all([\n this.core.publicClient.getBlockNumber(),\n this.getWcPrefix(),\n ]);\n\n const errors = await validateDepositData(depositData, {\n chainId,\n withdrawalCredentials: wc,\n wcPrefix,\n currentBlockNumber: Number(blockNumber),\n });\n\n if (errors.length) {\n return [...errors];\n }\n\n const pubkeys = depositData.map((data) => data.pubkey);\n\n const duplicateErrors = this.checkCachedKeys(pubkeys, options);\n const uploadedDuplicateErrors = await this.checkUploadedKeys(pubkeys);\n const clErrors = await this.checkClKeys(pubkeys.map(toHexString));\n\n return [\n ...errors,\n ...duplicateErrors,\n ...uploadedDuplicateErrors,\n ...clErrors,\n ];\n }\n\n @Logger('API:')\n @ErrorHandler()\n @Cache(CACHE_MID)\n public async checkUploadedKeys(pubkeys: Hex[]): Promise<ValidationError[]> {\n const keys = await this.bus.keysWithStatus?.getApiKeys(pubkeys);\n const errors: ValidationError[] = [];\n\n if (!keys) return errors;\n\n pubkeys.forEach((pubkey, index) => {\n const isUploaded = keys.find((key) => compareLowercase(key.key, pubkey));\n\n if (isUploaded) {\n errors.push({\n index,\n message: `pubkey was previously submitted`,\n field: 'pubkey',\n code: ValidationErrorCode.PREVIOUSLY_SUBMITTED,\n });\n }\n });\n\n return errors;\n }\n\n @Logger('Utils:')\n @ErrorHandler()\n public checkCachedKeys(\n pubkeys: Hex[],\n options?: { skipPending?: boolean },\n ): ValidationError[] {\n const keysCache = this.bus.keysCache;\n const errors: ValidationError[] = [];\n\n if (!keysCache) return errors;\n\n pubkeys.forEach((pubkey, index) => {\n const status = keysCache.getCacheStatus(pubkey);\n if (!status) return;\n if (status === KeyCacheStatus.PENDING && options?.skipPending) return;\n\n errors.push({\n index,\n field: 'pubkey',\n message: `pubkey already submitted`,\n code:\n status === KeyCacheStatus.CONFIRMED\n ? ValidationErrorCode.CACHED_PUBKEY_CONFIRMED\n : ValidationErrorCode.CACHED_PUBKEY_PENDING,\n });\n });\n\n return errors;\n }\n\n @Logger('API:')\n @ErrorHandler()\n public async checkClKeys(pubkeys: Hex[]): Promise<ValidationError[]> {\n const validPubkeys = pubkeys.filter((p) =>\n isHexadecimalString(p, PUBKEY_LENGTH),\n );\n const clKeys = await this.bus.keysWithStatus?.getClKeys(validPubkeys);\n const errors: ValidationError[] = [];\n\n if (!clKeys) return errors;\n\n pubkeys.forEach((pubkey, index) => {\n const exists = clKeys.find((k) => compareLowercase(k.pubkey, pubkey));\n if (exists) {\n errors.push({\n index,\n message: `pubkey already exists as a validator on CL`,\n field: 'pubkey',\n code: ValidationErrorCode.VALIDATOR_EXISTS,\n });\n }\n });\n\n return errors;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA,kBAAA,sBAAA,wBAAA,0BAAA,kBAAA,gBAAA,uBAAA,IAAA;AAwBO,IAAM,iBAAN,eAA6B,KAAA,cAKlC,wBAAA,CAAC,OAAO,SAAQ,CAAA,EAKhB,iBAAA,CAAC,OAAO,SAAQ,CAAA,EAKhB,mBAAA,CAAC,OAAO,SAAQ,CAAA,EAMhB,2BAAA,CAAC,OAAO,SAAQ,CAAA,EAqChB,yBAAA;CAAC,OAAO,OAAM;CACb,cAAa;CACb,MAAM,UAAS;CAAA,EAuBhB,uBAAA,CAAC,OAAO,SAAQ,EACf,cAAa,CAAA,EA6Bd,mBAAA,CAAC,OAAO,OAAM,EACb,cAAa,CAAA,EAlHoB,IAIjC;CAJI,cAAA;AAAA,QAAA,GAAA,UAAA;AAAA,oBAAA,OAAA,GAAA,KAAA;;CAME,iBAAiB,MAA2B;AACjD,SAAO,iBAAiB,KAAI;;CAIvB,UAAU,MAAc,OAAgC;AAC7D,SAAO,UAAU,MAAM,MAAK;;CAI9B,MAAc,cAA+B;AAE3C,UADe,MAAM,KAAK,IAAI,OAAO,8BAA6B,EACpD,SAAS,GAAE,CAAE,SAAS,GAAG,IAAG,CAAE,OAAO,IAAI,IAAG;;CAI5D,MAAa,oBACX,aACA,SAC4B;EAC5B,MAAM,UAAU,KAAK,KAAK;EAC1B,MAAM,KAAK,KAAK,KAAK,mBAAmB,eAAe,gBAAe;EACtE,MAAM,CAAC,aAAa,YAAY,MAAM,QAAQ,IAAI,CAChD,KAA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AQ,MACnC,oBAAoB,GAAA,GAAgB,CACtC;EACA,MAAM,SAAS,MAAM,KAAK,IAAI,gBAAgB,UAAU,aAAY;EACpE,MAAM,SAA4B,EAAC;AAEnC,MAAI,CAAC,OAAQ,QAAO;AAEpB,UAAQ,SAAS,QAAQ,UAAU;AAEjC,OADe,OAAO,MAAM,MAAM,iBAAiB,EAAE,QAAQ,OAAO,CAAA,CAElE,QAAO,KAAK;IACV;IACA,SAAS;IACT,OAAO;IACP,MAAM,oBAAoB;IAC3B,CAAA;IAEJ;AAED,SAAO;;;AAxIJ,QAAA,iBAAA,GAAA;AAML,kBAAA,OAAA,GAAO,oBADP,uBALW,eAAA;AAWX,kBAAA,OAAA,GAAO,aADP,gBAVW,eAAA;AAgBX,kBAAA,OAAA,GAAc,eADd,kBAfW,eAAA;AAsBX,kBAAA,OAAA,GAAa,uBADb,0BArBW,eAAA;AA6DX,kBAAA,OAAA,GAAa,qBAHb,wBA1DW,eAAA;AAqFX,kBAAA,OAAA,GAAO,mBAFP,sBAnFW,eAAA;AAmHX,kBAAA,OAAA,GAAa,eAFb,kBAjHW,eAAA;AAAN,oBAAA,OAAM,eAAA"}
@@ -4,6 +4,17 @@ const require_constants = require("./constants.cjs");
4
4
  const normalizeHexInJson = (text) => {
5
5
  return text.replaceAll(/"0x/gm, "\"");
6
6
  };
7
+ const toHexIfPresent = (value) => value ? require_is_hexadecimal_string.toHexString(value) : value;
8
+ const requiredFields = [
9
+ "pubkey",
10
+ "withdrawal_credentials",
11
+ "amount",
12
+ "signature",
13
+ "deposit_message_root",
14
+ "deposit_data_root",
15
+ "fork_version",
16
+ "network_name"
17
+ ];
7
18
  const parseAndValidateJson = (data) => {
8
19
  if (!data || data.trim() === "") return {
9
20
  depositData: [],
@@ -11,7 +22,7 @@ const parseAndValidateJson = (data) => {
11
22
  };
12
23
  if (data.length > 1048576) return {
13
24
  depositData: [],
14
- error: `Deposit data is too big (max ${Math.round(require_constants.MAX_JSON_LENGTH / 1024 / 1024)}MB)`
25
+ error: `Deposit data is too large (max ${Math.round(require_constants.MAX_JSON_LENGTH / 1024 / 1024)}MB)`
15
26
  };
16
27
  let parsed;
17
28
  try {
@@ -22,37 +33,29 @@ const parseAndValidateJson = (data) => {
22
33
  error: "Invalid JSON format"
23
34
  };
24
35
  }
25
- const depositData = (Array.isArray(parsed) ? parsed : [parsed]).map((item) => ({
36
+ const rawItems = Array.isArray(parsed) ? parsed : [parsed];
37
+ for (const [index, item] of rawItems.entries()) if (!item || typeof item !== "object") return {
38
+ depositData: [],
39
+ error: `Item at index ${index} should be an object`
40
+ };
41
+ const depositData = rawItems.map((item) => ({
26
42
  ...item,
27
- pubkey: item.pubkey ? require_is_hexadecimal_string.toHexString(item.pubkey) : item.pubkey,
28
- withdrawal_credentials: item.withdrawal_credentials ? require_is_hexadecimal_string.toHexString(item.withdrawal_credentials) : item.withdrawal_credentials,
29
- signature: item.signature ? require_is_hexadecimal_string.toHexString(item.signature) : item.signature,
30
- deposit_message_root: item.deposit_message_root ? require_is_hexadecimal_string.toHexString(item.deposit_message_root) : item.deposit_message_root,
31
- deposit_data_root: item.deposit_data_root ? require_is_hexadecimal_string.toHexString(item.deposit_data_root) : item.deposit_data_root,
32
- fork_version: item.fork_version ? require_is_hexadecimal_string.toHexString(item.fork_version) : item.fork_version
43
+ pubkey: toHexIfPresent(item.pubkey),
44
+ withdrawal_credentials: toHexIfPresent(item.withdrawal_credentials),
45
+ signature: toHexIfPresent(item.signature),
46
+ deposit_message_root: toHexIfPresent(item.deposit_message_root),
47
+ deposit_data_root: toHexIfPresent(item.deposit_data_root),
48
+ fork_version: toHexIfPresent(item.fork_version),
49
+ network_name: item.network_name || item.eth2_network_name
33
50
  }));
34
51
  if (depositData.length === 0) return {
35
52
  depositData: [],
36
- error: "Should have at least 1 key"
53
+ error: "Deposit data should contain at least 1 key"
54
+ };
55
+ for (const [index, item] of depositData.entries()) for (const field of requiredFields) if (item[field] === void 0 || item[field] === null) return {
56
+ depositData: [],
57
+ error: `Item at index ${index} is missing required field: ${field}`
37
58
  };
38
- for (const [index, item] of depositData.entries()) {
39
- if (!item || typeof item !== "object") return {
40
- depositData: [],
41
- error: `Item at index ${index} should be an object`
42
- };
43
- for (const field of [
44
- "pubkey",
45
- "withdrawal_credentials",
46
- "amount",
47
- "signature",
48
- "deposit_message_root",
49
- "deposit_data_root",
50
- "fork_version"
51
- ]) if (!(field in item)) return {
52
- depositData: [],
53
- error: `Item at index ${index} is missing required field: ${field}`
54
- };
55
- }
56
59
  return { depositData };
57
60
  };
58
61
  const parseDepositData = (jsonDepositData) => {
@@ -1 +1 @@
1
- {"version":3,"file":"parser.cjs","names":[],"sources":["../../src/deposit-data-sdk/parser.ts"],"sourcesContent":["import { toHexString } from '../common/utils/is-hexadecimal-string';\nimport { DepositData, ParseResult, RemoveKeyResult } from './types';\nimport { MAX_JSON_LENGTH } from './constants';\n\n/**\n * Normalizes hex values in JSON by removing '0x' prefixes\n */\nconst normalizeHexInJson = (text: string): string => {\n return text.replaceAll(/\"0x/gm, '\"');\n};\n\n/**\n * Validates and parses JSON string into DepositData array\n * This function combines validation and parsing logic\n */\nconst parseAndValidateJson = (\n data: string,\n): {\n depositData: DepositData[];\n error?: string;\n} => {\n // Check for empty data\n if (!data || data.trim() === '') {\n return {\n depositData: [],\n error: 'Deposit data should not be empty',\n };\n }\n\n // Check size limit\n if (data.length > MAX_JSON_LENGTH) {\n return {\n depositData: [],\n error: `Deposit data is too big (max ${Math.round(MAX_JSON_LENGTH / 1024 / 1024)}MB)`,\n };\n }\n\n // Parse JSON\n let parsed: any;\n try {\n parsed = JSON.parse(data);\n } catch {\n return {\n depositData: [],\n error: 'Invalid JSON format',\n };\n }\n\n // Ensure we have an array and convert hex fields to Hex type\n const rawItems = Array.isArray(parsed) ? parsed : [parsed];\n const depositData: DepositData[] = rawItems.map((item: any) => ({\n ...item,\n pubkey: item.pubkey ? toHexString(item.pubkey) : item.pubkey,\n withdrawal_credentials: item.withdrawal_credentials\n ? toHexString(item.withdrawal_credentials)\n : item.withdrawal_credentials,\n signature: item.signature ? toHexString(item.signature) : item.signature,\n deposit_message_root: item.deposit_message_root\n ? toHexString(item.deposit_message_root)\n : item.deposit_message_root,\n deposit_data_root: item.deposit_data_root\n ? toHexString(item.deposit_data_root)\n : item.deposit_data_root,\n fork_version: item.fork_version\n ? toHexString(item.fork_version)\n : item.fork_version,\n }));\n\n // Validate array is not empty\n if (depositData.length === 0) {\n return {\n depositData: [],\n error: 'Should have at least 1 key',\n };\n }\n\n // Basic validation of each item\n for (const [index, item] of depositData.entries()) {\n if (!item || typeof item !== 'object') {\n return {\n depositData: [],\n error: `Item at index ${index} should be an object`,\n };\n }\n\n // Check for required fields\n const requiredFields = [\n 'pubkey',\n 'withdrawal_credentials',\n 'amount',\n 'signature',\n 'deposit_message_root',\n 'deposit_data_root',\n 'fork_version',\n ];\n\n for (const field of requiredFields) {\n if (!(field in item)) {\n return {\n depositData: [],\n error: `Item at index ${index} is missing required field: ${field}`,\n };\n }\n }\n }\n\n return { depositData };\n};\n\n/**\n * Parse deposit data JSON with comprehensive error handling\n */\nexport const parseDepositData = (jsonDepositData: string): ParseResult => {\n const normalizedJson = normalizeHexInJson(jsonDepositData);\n const result = parseAndValidateJson(normalizedJson);\n\n if (result.error) {\n return {\n success: false,\n error: result.error,\n };\n }\n\n return {\n success: true,\n data: result.depositData,\n };\n};\n\n/**\n * Remove a key at specified index with enhanced error handling\n */\nexport const removeKey = (\n jsonDepositData: string,\n index: number,\n): RemoveKeyResult => {\n // Validate index parameter\n if (!Number.isInteger(index) || index < 0) {\n return {\n success: false,\n error: 'Index must be a non-negative integer',\n };\n }\n\n // Parse the JSON first\n const parseResult = parseDepositData(jsonDepositData);\n if (!parseResult.success || !parseResult.data) {\n return {\n success: false,\n error: parseResult.error || 'Failed to parse deposit data',\n };\n }\n\n const depositData = parseResult.data;\n\n // Validate index is within bounds\n if (index >= depositData.length) {\n return {\n success: false,\n error: `Index ${index} is out of bounds (array length: ${depositData.length})`,\n };\n }\n\n // Remove the item\n const updatedData = [...depositData];\n updatedData.splice(index, 1);\n\n // Return result\n const json =\n updatedData.length > 0 ? JSON.stringify(updatedData, null, 2) : '';\n\n return {\n success: true,\n data: updatedData,\n json,\n };\n};\n"],"mappings":";;;AAOA,MAAM,sBAAsB,SAAyB;AACnD,QAAO,KAAK,WAAW,SAAS,KAAG;;AAOrC,MAAM,wBACJ,SAIG;AAEH,KAAI,CAAC,QAAQ,KAAK,MAAK,KAAM,GAC3B,QAAO;EACL,aAAa,EAAC;EACd,OAAO;EACT;AAIF,KAAI,KAAK,SAAA,QACP,QAAO;EACL,aAAa,EAAC;EACd,OAAO,gCAAgC,KAAK,MAAM,kBAAA,kBAAkB,OAAO,KAAK,CAAA;EAClF;CAIF,IAAI;AACJ,KAAI;AACF,WAAS,KAAK,MAAM,KAAI;SAClB;AACN,SAAO;GACL,aAAa,EAAC;GACd,OAAO;GACT;;CAKF,MAAM,eADW,MAAM,QAAQ,OAAM,GAAI,SAAS,CAAC,OAAM,EACb,KAAK,UAAe;EAC9D,GAAG;EACH,QAAQ,KAAK,SAAS,8BAAA,YAAY,KAAK,OAAM,GAAI,KAAK;EACtD,wBAAwB,KAAK,yBACzB,8BAAA,YAAY,KAAK,uBAAsB,GACvC,KAAK;EACT,WAAW,KAAK,YAAY,8BAAA,YAAY,KAAK,UAAS,GAAI,KAAK;EAC/D,sBAAsB,KAAK,uBACvB,8BAAA,YAAY,KAAK,qBAAoB,GACrC,KAAK;EACT,mBAAmB,KAAK,oBACpB,8BAAA,YAAY,KAAK,kBAAiB,GAClC,KAAK;EACT,cAAc,KAAK,eACf,8BAAA,YAAY,KAAK,aAAY,GAC7B,KAAK;EACX,EAAE;AAGF,KAAI,YAAY,WAAW,EACzB,QAAO;EACL,aAAa,EAAC;EACd,OAAO;EACT;AAIF,MAAA,MAAW,CAAC,OAAO,SAAS,YAAY,SAAQ,EAAG;AACjD,MAAI,CAAC,QAAQ,OAAO,SAAS,SAC3B,QAAO;GACL,aAAa,EAAC;GACd,OAAO,iBAAiB,MAAK;GAC/B;AAcF,OAAA,MAAW,SAVY;GACrB;GACA;GACA;GACA;GACA;GACA;GACA;GACF,CAGE,KAAI,EAAE,SAAS,MACb,QAAO;GACL,aAAa,EAAC;GACd,OAAO,iBAAiB,MAAK,8BAA+B;GAC9D;;AAKN,QAAO,EAAE,aAAY;;AAMhB,MAAM,oBAAoB,oBAAyC;CAExE,MAAM,SAAS,qBADQ,mBAAmB,gBAAe,CACP;AAElD,KAAI,OAAO,MACT,QAAO;EACL,SAAS;EACT,OAAO,OAAO;EAChB;AAGF,QAAO;EACL,SAAS;EACT,MAAM,OAAO;EACf;;AAMK,MAAM,aACX,iBACA,UACoB;AAEpB,KAAI,CAAC,OAAO,UAAU,MAAK,IAAK,QAAQ,EACtC,QAAO;EACL,SAAS;EACT,OAAO;EACT;CAIF,MAAM,cAAc,iBAAiB,gBAAe;AACpD,KAAI,CAAC,YAAY,WAAW,CAAC,YAAY,KACvC,QAAO;EACL,SAAS;EACT,OAAO,YAAY,SAAS;EAC9B;CAGF,MAAM,cAAc,YAAY;AAGhC,KAAI,SAAS,YAAY,OACvB,QAAO;EACL,SAAS;EACT,OAAO,SAAS,MAAK,mCAAoC,YAAY,OAAM;EAC7E;CAIF,MAAM,cAAc,CAAC,GAAG,YAAW;AACnC,aAAY,OAAO,OAAO,EAAC;AAM3B,QAAO;EACL,SAAS;EACT,MAAM;EACN,MALA,YAAY,SAAS,IAAI,KAAK,UAAU,aAAa,MAAM,EAAC,GAAI;EAMlE"}
1
+ {"version":3,"file":"parser.cjs","names":[],"sources":["../../src/deposit-data-sdk/parser.ts"],"sourcesContent":["import { toHexString } from '../common/utils/is-hexadecimal-string';\nimport { DepositData, ParseResult, RemoveKeyResult } from './types';\nimport { MAX_JSON_LENGTH } from './constants';\n\n/**\n * Normalizes hex values in JSON by removing '0x' prefixes\n */\nconst normalizeHexInJson = (text: string): string => {\n return text.replaceAll(/\"0x/gm, '\"');\n};\n\n// Convert a present value to Hex, leaving falsy values untouched for the\n// required-field check below to report.\nconst toHexIfPresent = (value: any) => (value ? toHexString(value) : value);\n\nconst requiredFields: Array<keyof DepositData> = [\n 'pubkey',\n 'withdrawal_credentials',\n 'amount',\n 'signature',\n 'deposit_message_root',\n 'deposit_data_root',\n 'fork_version',\n 'network_name',\n];\n\n/**\n * Validates and parses JSON string into DepositData array\n * This function combines validation and parsing logic\n */\nconst parseAndValidateJson = (\n data: string,\n): {\n depositData: DepositData[];\n error?: string;\n} => {\n // Check for empty data\n if (!data || data.trim() === '') {\n return {\n depositData: [],\n error: 'Deposit data should not be empty',\n };\n }\n\n // Check size limit\n if (data.length > MAX_JSON_LENGTH) {\n return {\n depositData: [],\n error: `Deposit data is too large (max ${Math.round(MAX_JSON_LENGTH / 1024 / 1024)}MB)`,\n };\n }\n\n // Parse JSON\n let parsed: any;\n try {\n parsed = JSON.parse(data);\n } catch {\n return {\n depositData: [],\n error: 'Invalid JSON format',\n };\n }\n\n // Ensure we have an array and convert hex fields to Hex type\n const rawItems = Array.isArray(parsed) ? parsed : [parsed];\n\n // Basic validation of each item\n for (const [index, item] of rawItems.entries()) {\n if (!item || typeof item !== 'object') {\n return {\n depositData: [],\n error: `Item at index ${index} should be an object`,\n };\n }\n }\n\n const depositData: DepositData[] = rawItems.map((item: any) => ({\n ...item,\n pubkey: toHexIfPresent(item.pubkey),\n withdrawal_credentials: toHexIfPresent(item.withdrawal_credentials),\n signature: toHexIfPresent(item.signature),\n deposit_message_root: toHexIfPresent(item.deposit_message_root),\n deposit_data_root: toHexIfPresent(item.deposit_data_root),\n fork_version: toHexIfPresent(item.fork_version),\n network_name: item.network_name || item.eth2_network_name, // Support both v1 and v2 field names\n }));\n\n // Validate array is not empty\n if (depositData.length === 0) {\n return {\n depositData: [],\n error: 'Deposit data should contain at least 1 key',\n };\n }\n\n // Check for required fields\n for (const [index, item] of depositData.entries()) {\n for (const field of requiredFields) {\n if (item[field] === undefined || item[field] === null) {\n return {\n depositData: [],\n error: `Item at index ${index} is missing required field: ${field}`,\n };\n }\n }\n }\n\n return { depositData };\n};\n\n/**\n * Parse deposit data JSON with comprehensive error handling\n */\nexport const parseDepositData = (jsonDepositData: string): ParseResult => {\n const normalizedJson = normalizeHexInJson(jsonDepositData);\n const result = parseAndValidateJson(normalizedJson);\n\n if (result.error) {\n return {\n success: false,\n error: result.error,\n };\n }\n\n return {\n success: true,\n data: result.depositData,\n };\n};\n\n/**\n * Remove a key at specified index with enhanced error handling\n */\nexport const removeKey = (\n jsonDepositData: string,\n index: number,\n): RemoveKeyResult => {\n // Validate index parameter\n if (!Number.isInteger(index) || index < 0) {\n return {\n success: false,\n error: 'Index must be a non-negative integer',\n };\n }\n\n // Parse the JSON first\n const parseResult = parseDepositData(jsonDepositData);\n if (!parseResult.success || !parseResult.data) {\n return {\n success: false,\n error: parseResult.error || 'Failed to parse deposit data',\n };\n }\n\n const depositData = parseResult.data;\n\n // Validate index is within bounds\n if (index >= depositData.length) {\n return {\n success: false,\n error: `Index ${index} is out of bounds (array length: ${depositData.length})`,\n };\n }\n\n // Remove the item\n const updatedData = [...depositData];\n updatedData.splice(index, 1);\n\n // Return result\n const json =\n updatedData.length > 0 ? JSON.stringify(updatedData, null, 2) : '';\n\n return {\n success: true,\n data: updatedData,\n json,\n };\n};\n"],"mappings":";;;AAOA,MAAM,sBAAsB,SAAyB;AACnD,QAAO,KAAK,WAAW,SAAS,KAAG;;AAKrC,MAAM,kBAAkB,UAAgB,QAAQ,8BAAA,YAAY,MAAK,GAAI;AAErE,MAAM,iBAA2C;CAC/C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACF;AAMA,MAAM,wBACJ,SAIG;AAEH,KAAI,CAAC,QAAQ,KAAK,MAAK,KAAM,GAC3B,QAAO;EACL,aAAa,EAAC;EACd,OAAO;EACT;AAIF,KAAI,KAAK,SAAA,QACP,QAAO;EACL,aAAa,EAAC;EACd,OAAO,kCAAkC,KAAK,MAAM,kBAAA,kBAAkB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MAAM,cAAc,iBAAiB,gBAAe;AACpD,KAAI,CAAC,YAAY,WAAW,CAAC,YAAY,KACvC,QAAO;EACL,SAAS;EACT,OAAO,YAAY,SAAS;EAC9B;CAGF,MAAM,cAAc,YAAY;AAGhC,KAAI,SAAS,YAAY,OACvB,QAAO;EACL,SAAS;EACT,OAAO,SAAS,MAAK,mCAAoC,YAAY,OAAM;EAC7E;CAIF,MAAM,cAAc,CAAC,GAAG,YAAW;AACnC,aAAY,OAAO,OAAO,EAAC;AAM3B,QAAO;EACL,SAAS;EACT,MAAM;EACN,MALA,YAAY,SAAS,IAAI,KAAK,UAAU,aAAa,MAAM,EAAC,GAAI;EAMlE"}
@@ -4,6 +4,17 @@ import { MAX_JSON_LENGTH } from "./constants.mjs";
4
4
  const normalizeHexInJson = (text) => {
5
5
  return text.replaceAll(/"0x/gm, "\"");
6
6
  };
7
+ const toHexIfPresent = (value) => value ? toHexString(value) : value;
8
+ const requiredFields = [
9
+ "pubkey",
10
+ "withdrawal_credentials",
11
+ "amount",
12
+ "signature",
13
+ "deposit_message_root",
14
+ "deposit_data_root",
15
+ "fork_version",
16
+ "network_name"
17
+ ];
7
18
  const parseAndValidateJson = (data) => {
8
19
  if (!data || data.trim() === "") return {
9
20
  depositData: [],
@@ -11,7 +22,7 @@ const parseAndValidateJson = (data) => {
11
22
  };
12
23
  if (data.length > 1048576) return {
13
24
  depositData: [],
14
- error: `Deposit data is too big (max ${Math.round(MAX_JSON_LENGTH / 1024 / 1024)}MB)`
25
+ error: `Deposit data is too large (max ${Math.round(MAX_JSON_LENGTH / 1024 / 1024)}MB)`
15
26
  };
16
27
  let parsed;
17
28
  try {
@@ -22,37 +33,29 @@ const parseAndValidateJson = (data) => {
22
33
  error: "Invalid JSON format"
23
34
  };
24
35
  }
25
- const depositData = (Array.isArray(parsed) ? parsed : [parsed]).map((item) => ({
36
+ const rawItems = Array.isArray(parsed) ? parsed : [parsed];
37
+ for (const [index, item] of rawItems.entries()) if (!item || typeof item !== "object") return {
38
+ depositData: [],
39
+ error: `Item at index ${index} should be an object`
40
+ };
41
+ const depositData = rawItems.map((item) => ({
26
42
  ...item,
27
- pubkey: item.pubkey ? toHexString(item.pubkey) : item.pubkey,
28
- withdrawal_credentials: item.withdrawal_credentials ? toHexString(item.withdrawal_credentials) : item.withdrawal_credentials,
29
- signature: item.signature ? toHexString(item.signature) : item.signature,
30
- deposit_message_root: item.deposit_message_root ? toHexString(item.deposit_message_root) : item.deposit_message_root,
31
- deposit_data_root: item.deposit_data_root ? toHexString(item.deposit_data_root) : item.deposit_data_root,
32
- fork_version: item.fork_version ? toHexString(item.fork_version) : item.fork_version
43
+ pubkey: toHexIfPresent(item.pubkey),
44
+ withdrawal_credentials: toHexIfPresent(item.withdrawal_credentials),
45
+ signature: toHexIfPresent(item.signature),
46
+ deposit_message_root: toHexIfPresent(item.deposit_message_root),
47
+ deposit_data_root: toHexIfPresent(item.deposit_data_root),
48
+ fork_version: toHexIfPresent(item.fork_version),
49
+ network_name: item.network_name || item.eth2_network_name
33
50
  }));
34
51
  if (depositData.length === 0) return {
35
52
  depositData: [],
36
- error: "Should have at least 1 key"
53
+ error: "Deposit data should contain at least 1 key"
54
+ };
55
+ for (const [index, item] of depositData.entries()) for (const field of requiredFields) if (item[field] === void 0 || item[field] === null) return {
56
+ depositData: [],
57
+ error: `Item at index ${index} is missing required field: ${field}`
37
58
  };
38
- for (const [index, item] of depositData.entries()) {
39
- if (!item || typeof item !== "object") return {
40
- depositData: [],
41
- error: `Item at index ${index} should be an object`
42
- };
43
- for (const field of [
44
- "pubkey",
45
- "withdrawal_credentials",
46
- "amount",
47
- "signature",
48
- "deposit_message_root",
49
- "deposit_data_root",
50
- "fork_version"
51
- ]) if (!(field in item)) return {
52
- depositData: [],
53
- error: `Item at index ${index} is missing required field: ${field}`
54
- };
55
- }
56
59
  return { depositData };
57
60
  };
58
61
  const parseDepositData = (jsonDepositData) => {
@@ -1 +1 @@
1
- {"version":3,"file":"parser.mjs","names":[],"sources":["../../src/deposit-data-sdk/parser.ts"],"sourcesContent":["import { toHexString } from '../common/utils/is-hexadecimal-string';\nimport { DepositData, ParseResult, RemoveKeyResult } from './types';\nimport { MAX_JSON_LENGTH } from './constants';\n\n/**\n * Normalizes hex values in JSON by removing '0x' prefixes\n */\nconst normalizeHexInJson = (text: string): string => {\n return text.replaceAll(/\"0x/gm, '\"');\n};\n\n/**\n * Validates and parses JSON string into DepositData array\n * This function combines validation and parsing logic\n */\nconst parseAndValidateJson = (\n data: string,\n): {\n depositData: DepositData[];\n error?: string;\n} => {\n // Check for empty data\n if (!data || data.trim() === '') {\n return {\n depositData: [],\n error: 'Deposit data should not be empty',\n };\n }\n\n // Check size limit\n if (data.length > MAX_JSON_LENGTH) {\n return {\n depositData: [],\n error: `Deposit data is too big (max ${Math.round(MAX_JSON_LENGTH / 1024 / 1024)}MB)`,\n };\n }\n\n // Parse JSON\n let parsed: any;\n try {\n parsed = JSON.parse(data);\n } catch {\n return {\n depositData: [],\n error: 'Invalid JSON format',\n };\n }\n\n // Ensure we have an array and convert hex fields to Hex type\n const rawItems = Array.isArray(parsed) ? parsed : [parsed];\n const depositData: DepositData[] = rawItems.map((item: any) => ({\n ...item,\n pubkey: item.pubkey ? toHexString(item.pubkey) : item.pubkey,\n withdrawal_credentials: item.withdrawal_credentials\n ? toHexString(item.withdrawal_credentials)\n : item.withdrawal_credentials,\n signature: item.signature ? toHexString(item.signature) : item.signature,\n deposit_message_root: item.deposit_message_root\n ? toHexString(item.deposit_message_root)\n : item.deposit_message_root,\n deposit_data_root: item.deposit_data_root\n ? toHexString(item.deposit_data_root)\n : item.deposit_data_root,\n fork_version: item.fork_version\n ? toHexString(item.fork_version)\n : item.fork_version,\n }));\n\n // Validate array is not empty\n if (depositData.length === 0) {\n return {\n depositData: [],\n error: 'Should have at least 1 key',\n };\n }\n\n // Basic validation of each item\n for (const [index, item] of depositData.entries()) {\n if (!item || typeof item !== 'object') {\n return {\n depositData: [],\n error: `Item at index ${index} should be an object`,\n };\n }\n\n // Check for required fields\n const requiredFields = [\n 'pubkey',\n 'withdrawal_credentials',\n 'amount',\n 'signature',\n 'deposit_message_root',\n 'deposit_data_root',\n 'fork_version',\n ];\n\n for (const field of requiredFields) {\n if (!(field in item)) {\n return {\n depositData: [],\n error: `Item at index ${index} is missing required field: ${field}`,\n };\n }\n }\n }\n\n return { depositData };\n};\n\n/**\n * Parse deposit data JSON with comprehensive error handling\n */\nexport const parseDepositData = (jsonDepositData: string): ParseResult => {\n const normalizedJson = normalizeHexInJson(jsonDepositData);\n const result = parseAndValidateJson(normalizedJson);\n\n if (result.error) {\n return {\n success: false,\n error: result.error,\n };\n }\n\n return {\n success: true,\n data: result.depositData,\n };\n};\n\n/**\n * Remove a key at specified index with enhanced error handling\n */\nexport const removeKey = (\n jsonDepositData: string,\n index: number,\n): RemoveKeyResult => {\n // Validate index parameter\n if (!Number.isInteger(index) || index < 0) {\n return {\n success: false,\n error: 'Index must be a non-negative integer',\n };\n }\n\n // Parse the JSON first\n const parseResult = parseDepositData(jsonDepositData);\n if (!parseResult.success || !parseResult.data) {\n return {\n success: false,\n error: parseResult.error || 'Failed to parse deposit data',\n };\n }\n\n const depositData = parseResult.data;\n\n // Validate index is within bounds\n if (index >= depositData.length) {\n return {\n success: false,\n error: `Index ${index} is out of bounds (array length: ${depositData.length})`,\n };\n }\n\n // Remove the item\n const updatedData = [...depositData];\n updatedData.splice(index, 1);\n\n // Return result\n const json =\n updatedData.length > 0 ? JSON.stringify(updatedData, null, 2) : '';\n\n return {\n success: true,\n data: updatedData,\n json,\n };\n};\n"],"mappings":";;;AAOA,MAAM,sBAAsB,SAAyB;AACnD,QAAO,KAAK,WAAW,SAAS,KAAG;;AAOrC,MAAM,wBACJ,SAIG;AAEH,KAAI,CAAC,QAAQ,KAAK,MAAK,KAAM,GAC3B,QAAO;EACL,aAAa,EAAC;EACd,OAAO;EACT;AAIF,KAAI,KAAK,SAAA,QACP,QAAO;EACL,aAAa,EAAC;EACd,OAAO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CAAC,OAAO,UAAU,MAAK,IAAK,QAAQ,EACtC,QAAO;EACL,SAAS;EACT,OAAO;EACT;CAIF,MAAM,cAAc,iBAAiB,gBAAe;AACpD,KAAI,CAAC,YAAY,WAAW,CAAC,YAAY,KACvC,QAAO;EACL,SAAS;EACT,OAAO,YAAY,SAAS;EAC9B;CAGF,MAAM,cAAc,YAAY;AAGhC,KAAI,SAAS,YAAY,OACvB,QAAO;EACL,SAAS;EACT,OAAO,SAAS,MAAK,mCAAoC,YAAY,OAAM;EAC7E;CAIF,MAAM,cAAc,CAAC,GAAG,YAAW;AACnC,aAAY,OAAO,OAAO,EAAC;AAM3B,QAAO;EACL,SAAS;EACT,MAAM;EACN,MALA,YAAY,SAAS,IAAI,KAAK,UAAU,aAAa,MAAM,EAAC,GAAI;EAMlE"}
1
+ {"version":3,"file":"parser.mjs","names":[],"sources":["../../src/deposit-data-sdk/parser.ts"],"sourcesContent":["import { toHexString } from '../common/utils/is-hexadecimal-string';\nimport { DepositData, ParseResult, RemoveKeyResult } from './types';\nimport { MAX_JSON_LENGTH } from './constants';\n\n/**\n * Normalizes hex values in JSON by removing '0x' prefixes\n */\nconst normalizeHexInJson = (text: string): string => {\n return text.replaceAll(/\"0x/gm, '\"');\n};\n\n// Convert a present value to Hex, leaving falsy values untouched for the\n// required-field check below to report.\nconst toHexIfPresent = (value: any) => (value ? toHexString(value) : value);\n\nconst requiredFields: Array<keyof DepositData> = [\n 'pubkey',\n 'withdrawal_credentials',\n 'amount',\n 'signature',\n 'deposit_message_root',\n 'deposit_data_root',\n 'fork_version',\n 'network_name',\n];\n\n/**\n * Validates and parses JSON string into DepositData array\n * This function combines validation and parsing logic\n */\nconst parseAndValidateJson = (\n data: string,\n): {\n depositData: DepositData[];\n error?: string;\n} => {\n // Check for empty data\n if (!data || data.trim() === '') {\n return {\n depositData: [],\n error: 'Deposit data should not be empty',\n };\n }\n\n // Check size limit\n if (data.length > MAX_JSON_LENGTH) {\n return {\n depositData: [],\n error: `Deposit data is too large (max ${Math.round(MAX_JSON_LENGTH / 1024 / 1024)}MB)`,\n };\n }\n\n // Parse JSON\n let parsed: any;\n try {\n parsed = JSON.parse(data);\n } catch {\n return {\n depositData: [],\n error: 'Invalid JSON format',\n };\n }\n\n // Ensure we have an array and convert hex fields to Hex type\n const rawItems = Array.isArray(parsed) ? parsed : [parsed];\n\n // Basic validation of each item\n for (const [index, item] of rawItems.entries()) {\n if (!item || typeof item !== 'object') {\n return {\n depositData: [],\n error: `Item at index ${index} should be an object`,\n };\n }\n }\n\n const depositData: DepositData[] = rawItems.map((item: any) => ({\n ...item,\n pubkey: toHexIfPresent(item.pubkey),\n withdrawal_credentials: toHexIfPresent(item.withdrawal_credentials),\n signature: toHexIfPresent(item.signature),\n deposit_message_root: toHexIfPresent(item.deposit_message_root),\n deposit_data_root: toHexIfPresent(item.deposit_data_root),\n fork_version: toHexIfPresent(item.fork_version),\n network_name: item.network_name || item.eth2_network_name, // Support both v1 and v2 field names\n }));\n\n // Validate array is not empty\n if (depositData.length === 0) {\n return {\n depositData: [],\n error: 'Deposit data should contain at least 1 key',\n };\n }\n\n // Check for required fields\n for (const [index, item] of depositData.entries()) {\n for (const field of requiredFields) {\n if (item[field] === undefined || item[field] === null) {\n return {\n depositData: [],\n error: `Item at index ${index} is missing required field: ${field}`,\n };\n }\n }\n }\n\n return { depositData };\n};\n\n/**\n * Parse deposit data JSON with comprehensive error handling\n */\nexport const parseDepositData = (jsonDepositData: string): ParseResult => {\n const normalizedJson = normalizeHexInJson(jsonDepositData);\n const result = parseAndValidateJson(normalizedJson);\n\n if (result.error) {\n return {\n success: false,\n error: result.error,\n };\n }\n\n return {\n success: true,\n data: result.depositData,\n };\n};\n\n/**\n * Remove a key at specified index with enhanced error handling\n */\nexport const removeKey = (\n jsonDepositData: string,\n index: number,\n): RemoveKeyResult => {\n // Validate index parameter\n if (!Number.isInteger(index) || index < 0) {\n return {\n success: false,\n error: 'Index must be a non-negative integer',\n };\n }\n\n // Parse the JSON first\n const parseResult = parseDepositData(jsonDepositData);\n if (!parseResult.success || !parseResult.data) {\n return {\n success: false,\n error: parseResult.error || 'Failed to parse deposit data',\n };\n }\n\n const depositData = parseResult.data;\n\n // Validate index is within bounds\n if (index >= depositData.length) {\n return {\n success: false,\n error: `Index ${index} is out of bounds (array length: ${depositData.length})`,\n };\n }\n\n // Remove the item\n const updatedData = [...depositData];\n updatedData.splice(index, 1);\n\n // Return result\n const json =\n updatedData.length > 0 ? JSON.stringify(updatedData, null, 2) : '';\n\n return {\n success: true,\n data: updatedData,\n json,\n };\n};\n"],"mappings":";;;AAOA,MAAM,sBAAsB,SAAyB;AACnD,QAAO,KAAK,WAAW,SAAS,KAAG;;AAKrC,MAAM,kBAAkB,UAAgB,QAAQ,YAAY,MAAK,GAAI;AAErE,MAAM,iBAA2C;CAC/C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACF;AAMA,MAAM,wBACJ,SAIG;AAEH,KAAI,CAAC,QAAQ,KAAK,MAAK,KAAM,GAC3B,QAAO;EACL,aAAa,EAAC;EACd,OAAO;EACT;AAIF,KAAI,KAAK,SAAA,QACP,QAAO;EACL,aAAa,EAAC;EACd,OAAO,kCAAkC,KAAK,MAAM,kBAAkB,OAAO,KAAK,CAAA;EACpF;CAIF,IAAI;AACJ,KAAI;AACF,WAAS,KAAK,MAAM,KAAI;SAClB;AACN,SAAO;GACL,aAAa,EAAC;GACd,OAAO;GACT;;CAIF,MAAM,WAAW,MAAM,QAAQ,OAAM,GAAI,SAAS,CAAC,OAAM;AAGzD,MAAA,MAAW,CAAC,OAAO,SAAS,SAAS,SAAQ,CAC3C,KAAI,CAAC,QAAQ,OAAO,SAAS,SAC3B,QAAO;EACL,aAAa,EAAC;EACd,OAAO,iBAAiB,MAAK;EAC/B;CAIJ,MAAM,cAA6B,SAAS,KAAK,UAAe;EAC9D,GAAG;EACH,QAAQ,eAAe,KAAK,OAAM;EAClC,wBAAwB,eAAe,KAAK,uBAAsB;EAClE,WAAW,eAAe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sources":["../../src/deposit-data-sdk/types.ts"],"sourcesContent":["import { Hex } from 'viem';\nimport { SUPPORTED_CHAINS } from '../common/index';\n\nexport type DepositDataCommon = {\n pubkey: Hex;\n withdrawal_credentials: Hex;\n amount: number;\n signature: Hex;\n deposit_message_root: Hex;\n deposit_data_root: Hex;\n fork_version: Hex;\n deposit_cli_version: string;\n};\n\nexport type DepositDataV2 = DepositDataCommon & {\n network_name: string;\n};\n\nexport type DepositDataV1 = DepositDataCommon & {\n eth2_network_name: string;\n};\n\nexport type DepositData = DepositDataV2 | DepositDataV1;\n\nexport enum ValidationErrorCode {\n INVALID_PUBKEY = 'INVALID_PUBKEY',\n INVALID_SIGNATURE = 'INVALID_SIGNATURE',\n INVALID_WITHDRAWAL_CREDENTIALS = 'INVALID_WITHDRAWAL_CREDENTIALS',\n UNSUPPORTED_WC_TYPE = 'UNSUPPORTED_WC_TYPE',\n INVALID_AMOUNT = 'INVALID_AMOUNT',\n INVALID_NETWORK = 'INVALID_NETWORK',\n INVALID_FORK_VERSION = 'INVALID_FORK_VERSION',\n INVALID_DEPOSIT_ROOT = 'INVALID_DEPOSIT_ROOT',\n DUPLICATE_PUBKEY = 'DUPLICATE_PUBKEY',\n CACHED_PUBKEY_CONFIRMED = 'CACHED_PUBKEY_CONFIRMED',\n CACHED_PUBKEY_PENDING = 'CACHED_PUBKEY_PENDING',\n PREVIOUSLY_SUBMITTED = 'PREVIOUSLY_SUBMITTED',\n INVALID_BLS_SIGNATURE = 'INVALID_BLS_SIGNATURE',\n MISSING_FIELD = 'MISSING_FIELD',\n INVALID_FORMAT = 'INVALID_FORMAT',\n VALIDATOR_EXISTS = 'VALIDATOR_EXISTS',\n}\n\nexport type ValidationError = {\n index: number;\n field?: string;\n message: string;\n code: ValidationErrorCode;\n};\n\nexport type RemoveKeyResult = {\n success: boolean;\n data?: DepositData[];\n json?: string;\n error?: string;\n};\n\nexport type ParseResult = {\n success: boolean;\n data?: DepositData[];\n error?: string;\n};\n\nexport type ValidationProps = {\n chainId: SUPPORTED_CHAINS;\n withdrawalCredentials: string;\n wcPrefix: string;\n};\n\nexport type ValidationExtendedProps = ValidationProps & {\n currentBlockNumber?: number;\n};\n\nexport type DuplicateProcessingConfig = {\n pubkey: Hex;\n index: number;\n pubkeyMap: Map<Hex, number[]>;\n errors: ValidationError[];\n};\n"],"mappings":";AAwBO,IAAK,sBAAL,kBAAKA,yBAAL;AACLA,sBAAA,oBAAiB;AACjBA,sBAAA,uBAAoB;AACpBA,sBAAA,oCAAiC;AACjCA,sBAAA,yBAAsB;AACtBA,sBAAA,oBAAiB;AACjBA,sBAAA,qBAAkB;AAClBA,sBAAA,0BAAuB;AACvBA,sBAAA,0BAAuB;AACvBA,sBAAA,sBAAmB;AACnBA,sBAAA,6BAA0B;AAC1BA,sBAAA,2BAAwB;AACxBA,sBAAA,0BAAuB;AACvBA,sBAAA,2BAAwB;AACxBA,sBAAA,mBAAgB;AAChBA,sBAAA,oBAAiB;AACjBA,sBAAA,sBAAmB;AAhBT,QAAAA;GAAA,uBAAA,EAAA,CAAA"}
1
+ {"version":3,"file":"types.cjs","names":["ValidationErrorCode"],"sources":["../../src/deposit-data-sdk/types.ts"],"sourcesContent":["import { Hex } from 'viem';\nimport { SUPPORTED_CHAINS } from '../common/index';\n\nexport type DepositData = {\n pubkey: Hex;\n withdrawal_credentials: Hex;\n amount: number;\n signature: Hex;\n deposit_message_root: Hex;\n deposit_data_root: Hex;\n fork_version: Hex;\n network_name: string;\n deposit_cli_version: string;\n};\n\nexport enum ValidationErrorCode {\n INVALID_PUBKEY = 'INVALID_PUBKEY',\n INVALID_SIGNATURE = 'INVALID_SIGNATURE',\n INVALID_WITHDRAWAL_CREDENTIALS = 'INVALID_WITHDRAWAL_CREDENTIALS',\n UNSUPPORTED_WC_TYPE = 'UNSUPPORTED_WC_TYPE',\n INVALID_AMOUNT = 'INVALID_AMOUNT',\n INVALID_NETWORK = 'INVALID_NETWORK',\n INVALID_FORK_VERSION = 'INVALID_FORK_VERSION',\n INVALID_DEPOSIT_ROOT = 'INVALID_DEPOSIT_ROOT',\n DUPLICATE_PUBKEY = 'DUPLICATE_PUBKEY',\n CACHED_PUBKEY_CONFIRMED = 'CACHED_PUBKEY_CONFIRMED',\n CACHED_PUBKEY_PENDING = 'CACHED_PUBKEY_PENDING',\n PREVIOUSLY_SUBMITTED = 'PREVIOUSLY_SUBMITTED',\n INVALID_BLS_SIGNATURE = 'INVALID_BLS_SIGNATURE',\n MISSING_FIELD = 'MISSING_FIELD',\n INVALID_FORMAT = 'INVALID_FORMAT',\n VALIDATOR_EXISTS = 'VALIDATOR_EXISTS',\n}\n\nexport type ValidationError = {\n index: number;\n field?: string;\n message: string;\n code: ValidationErrorCode;\n};\n\nexport type RemoveKeyResult = {\n success: boolean;\n data?: DepositData[];\n json?: string;\n error?: string;\n};\n\nexport type ParseResult = {\n success: boolean;\n data?: DepositData[];\n error?: string;\n};\n\nexport type ValidationProps = {\n chainId: SUPPORTED_CHAINS;\n withdrawalCredentials: string;\n wcPrefix: string;\n};\n\nexport type ValidationExtendedProps = ValidationProps & {\n currentBlockNumber?: number;\n};\n\nexport type DuplicateProcessingConfig = {\n pubkey: Hex;\n index: number;\n pubkeyMap: Map<Hex, number[]>;\n errors: ValidationError[];\n};\n"],"mappings":";AAeO,IAAK,sBAAL,kBAAKA,yBAAL;AACLA,sBAAA,oBAAiB;AACjBA,sBAAA,uBAAoB;AACpBA,sBAAA,oCAAiC;AACjCA,sBAAA,yBAAsB;AACtBA,sBAAA,oBAAiB;AACjBA,sBAAA,qBAAkB;AAClBA,sBAAA,0BAAuB;AACvBA,sBAAA,0BAAuB;AACvBA,sBAAA,sBAAmB;AACnBA,sBAAA,6BAA0B;AAC1BA,sBAAA,2BAAwB;AACxBA,sBAAA,0BAAuB;AACvBA,sBAAA,2BAAwB;AACxBA,sBAAA,mBAAgB;AAChBA,sBAAA,oBAAiB;AACjBA,sBAAA,sBAAmB;AAhBT,QAAAA;GAAA,uBAAA,EAAA,CAAA"}
@@ -2,7 +2,7 @@ import { SUPPORTED_CHAINS } from "../common/constants/supported-chains.cjs";
2
2
  import { Hex } from "viem";
3
3
 
4
4
  //#region src/deposit-data-sdk/types.d.ts
5
- type DepositDataCommon = {
5
+ type DepositData = {
6
6
  pubkey: Hex;
7
7
  withdrawal_credentials: Hex;
8
8
  amount: number;
@@ -10,15 +10,9 @@ type DepositDataCommon = {
10
10
  deposit_message_root: Hex;
11
11
  deposit_data_root: Hex;
12
12
  fork_version: Hex;
13
- deposit_cli_version: string;
14
- };
15
- type DepositDataV2 = DepositDataCommon & {
16
13
  network_name: string;
14
+ deposit_cli_version: string;
17
15
  };
18
- type DepositDataV1 = DepositDataCommon & {
19
- eth2_network_name: string;
20
- };
21
- type DepositData = DepositDataV2 | DepositDataV1;
22
16
  declare enum ValidationErrorCode {
23
17
  INVALID_PUBKEY = "INVALID_PUBKEY",
24
18
  INVALID_SIGNATURE = "INVALID_SIGNATURE",
@@ -69,5 +63,5 @@ type DuplicateProcessingConfig = {
69
63
  errors: ValidationError[];
70
64
  };
71
65
  //#endregion
72
- export { DepositData, DepositDataCommon, DepositDataV1, DepositDataV2, DuplicateProcessingConfig, ParseResult, RemoveKeyResult, ValidationError, ValidationErrorCode, ValidationExtendedProps, ValidationProps };
66
+ export { DepositData, DuplicateProcessingConfig, ParseResult, RemoveKeyResult, ValidationError, ValidationErrorCode, ValidationExtendedProps, ValidationProps };
73
67
  //# sourceMappingURL=types.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.cts","names":[],"sources":["../../src/deposit-data-sdk/types.ts"],"mappings":";;;;KAGY,iBAAA;EACV,MAAA,EAAQ,GAAA;EACR,sBAAA,EAAwB,GAAA;EACxB,MAAA;EACA,SAAA,EAAW,GAAA;EACX,oBAAA,EAAsB,GAAA;EACtB,iBAAA,EAAmB,GAAA;EACnB,YAAA,EAAc,GAAA;EACd,mBAAA;AAAA;AAAA,KAGU,aAAA,GAAgB,iBAAA;EAC1B,YAAA;AAAA;AAAA,KAGU,aAAA,GAAgB,iBAAA;EAC1B,iBAAA;AAAA;AAAA,KAGU,WAAA,GAAc,aAAA,GAAgB,aAAA;AAAA,aAE9B,mBAAA;EACV,cAAA;EACA,iBAAA;EACA,8BAAA;EACA,mBAAA;EACA,cAAA;EACA,eAAA;EACA,oBAAA;EACA,oBAAA;EACA,gBAAA;EACA,uBAAA;EACA,qBAAA;EACA,oBAAA;EACA,qBAAA;EACA,aAAA;EACA,cAAA;EACA,gBAAA;AAAA;AAAA,KAGU,eAAA;EACV,KAAA;EACA,KAAA;EACA,OAAA;EACA,IAAA,EAAM,mBAAA;AAAA;AAAA,KAGI,eAAA;EACV,OAAA;EACA,IAAA,GAAO,WAAA;EACP,IAAA;EACA,KAAA;AAAA;AAAA,KAGU,WAAA;EACV,OAAA;EACA,IAAA,GAAO,WAAA;EACP,KAAA;AAAA;AAAA,KAGU,eAAA;EACV,OAAA,EAAS,gBAAA;EACT,qBAAA;EACA,QAAA;AAAA;AAAA,KAGU,uBAAA,GAA0B,eAAA;EACpC,kBAAA;AAAA;AAAA,KAGU,yBAAA;EACV,MAAA,EAAQ,GAAA;EACR,KAAA;EACA,SAAA,EAAW,GAAA,CAAI,GAAA;EACf,MAAA,EAAQ,eAAA;AAAA"}
1
+ {"version":3,"file":"types.d.cts","names":[],"sources":["../../src/deposit-data-sdk/types.ts"],"mappings":";;;;KAGY,WAAA;EACV,MAAA,EAAQ,GAAA;EACR,sBAAA,EAAwB,GAAA;EACxB,MAAA;EACA,SAAA,EAAW,GAAA;EACX,oBAAA,EAAsB,GAAA;EACtB,iBAAA,EAAmB,GAAA;EACnB,YAAA,EAAc,GAAA;EACd,YAAA;EACA,mBAAA;AAAA;AAAA,aAGU,mBAAA;EACV,cAAA;EACA,iBAAA;EACA,8BAAA;EACA,mBAAA;EACA,cAAA;EACA,eAAA;EACA,oBAAA;EACA,oBAAA;EACA,gBAAA;EACA,uBAAA;EACA,qBAAA;EACA,oBAAA;EACA,qBAAA;EACA,aAAA;EACA,cAAA;EACA,gBAAA;AAAA;AAAA,KAGU,eAAA;EACV,KAAA;EACA,KAAA;EACA,OAAA;EACA,IAAA,EAAM,mBAAA;AAAA;AAAA,KAGI,eAAA;EACV,OAAA;EACA,IAAA,GAAO,WAAA;EACP,IAAA;EACA,KAAA;AAAA;AAAA,KAGU,WAAA;EACV,OAAA;EACA,IAAA,GAAO,WAAA;EACP,KAAA;AAAA;AAAA,KAGU,eAAA;EACV,OAAA,EAAS,gBAAA;EACT,qBAAA;EACA,QAAA;AAAA;AAAA,KAGU,uBAAA,GAA0B,eAAA;EACpC,kBAAA;AAAA;AAAA,KAGU,yBAAA;EACV,MAAA,EAAQ,GAAA;EACR,KAAA;EACA,SAAA,EAAW,GAAA,CAAI,GAAA;EACf,MAAA,EAAQ,eAAA;AAAA"}
@@ -2,7 +2,7 @@ import { SUPPORTED_CHAINS } from "../common/constants/supported-chains.mjs";
2
2
  import { Hex } from "viem";
3
3
 
4
4
  //#region src/deposit-data-sdk/types.d.ts
5
- type DepositDataCommon = {
5
+ type DepositData = {
6
6
  pubkey: Hex;
7
7
  withdrawal_credentials: Hex;
8
8
  amount: number;
@@ -10,15 +10,9 @@ type DepositDataCommon = {
10
10
  deposit_message_root: Hex;
11
11
  deposit_data_root: Hex;
12
12
  fork_version: Hex;
13
- deposit_cli_version: string;
14
- };
15
- type DepositDataV2 = DepositDataCommon & {
16
13
  network_name: string;
14
+ deposit_cli_version: string;
17
15
  };
18
- type DepositDataV1 = DepositDataCommon & {
19
- eth2_network_name: string;
20
- };
21
- type DepositData = DepositDataV2 | DepositDataV1;
22
16
  declare enum ValidationErrorCode {
23
17
  INVALID_PUBKEY = "INVALID_PUBKEY",
24
18
  INVALID_SIGNATURE = "INVALID_SIGNATURE",
@@ -69,5 +63,5 @@ type DuplicateProcessingConfig = {
69
63
  errors: ValidationError[];
70
64
  };
71
65
  //#endregion
72
- export { DepositData, DepositDataCommon, DepositDataV1, DepositDataV2, DuplicateProcessingConfig, ParseResult, RemoveKeyResult, ValidationError, ValidationErrorCode, ValidationExtendedProps, ValidationProps };
66
+ export { DepositData, DuplicateProcessingConfig, ParseResult, RemoveKeyResult, ValidationError, ValidationErrorCode, ValidationExtendedProps, ValidationProps };
73
67
  //# sourceMappingURL=types.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.mts","names":[],"sources":["../../src/deposit-data-sdk/types.ts"],"mappings":";;;;KAGY,iBAAA;EACV,MAAA,EAAQ,GAAA;EACR,sBAAA,EAAwB,GAAA;EACxB,MAAA;EACA,SAAA,EAAW,GAAA;EACX,oBAAA,EAAsB,GAAA;EACtB,iBAAA,EAAmB,GAAA;EACnB,YAAA,EAAc,GAAA;EACd,mBAAA;AAAA;AAAA,KAGU,aAAA,GAAgB,iBAAA;EAC1B,YAAA;AAAA;AAAA,KAGU,aAAA,GAAgB,iBAAA;EAC1B,iBAAA;AAAA;AAAA,KAGU,WAAA,GAAc,aAAA,GAAgB,aAAA;AAAA,aAE9B,mBAAA;EACV,cAAA;EACA,iBAAA;EACA,8BAAA;EACA,mBAAA;EACA,cAAA;EACA,eAAA;EACA,oBAAA;EACA,oBAAA;EACA,gBAAA;EACA,uBAAA;EACA,qBAAA;EACA,oBAAA;EACA,qBAAA;EACA,aAAA;EACA,cAAA;EACA,gBAAA;AAAA;AAAA,KAGU,eAAA;EACV,KAAA;EACA,KAAA;EACA,OAAA;EACA,IAAA,EAAM,mBAAA;AAAA;AAAA,KAGI,eAAA;EACV,OAAA;EACA,IAAA,GAAO,WAAA;EACP,IAAA;EACA,KAAA;AAAA;AAAA,KAGU,WAAA;EACV,OAAA;EACA,IAAA,GAAO,WAAA;EACP,KAAA;AAAA;AAAA,KAGU,eAAA;EACV,OAAA,EAAS,gBAAA;EACT,qBAAA;EACA,QAAA;AAAA;AAAA,KAGU,uBAAA,GAA0B,eAAA;EACpC,kBAAA;AAAA;AAAA,KAGU,yBAAA;EACV,MAAA,EAAQ,GAAA;EACR,KAAA;EACA,SAAA,EAAW,GAAA,CAAI,GAAA;EACf,MAAA,EAAQ,eAAA;AAAA"}
1
+ {"version":3,"file":"types.d.mts","names":[],"sources":["../../src/deposit-data-sdk/types.ts"],"mappings":";;;;KAGY,WAAA;EACV,MAAA,EAAQ,GAAA;EACR,sBAAA,EAAwB,GAAA;EACxB,MAAA;EACA,SAAA,EAAW,GAAA;EACX,oBAAA,EAAsB,GAAA;EACtB,iBAAA,EAAmB,GAAA;EACnB,YAAA,EAAc,GAAA;EACd,YAAA;EACA,mBAAA;AAAA;AAAA,aAGU,mBAAA;EACV,cAAA;EACA,iBAAA;EACA,8BAAA;EACA,mBAAA;EACA,cAAA;EACA,eAAA;EACA,oBAAA;EACA,oBAAA;EACA,gBAAA;EACA,uBAAA;EACA,qBAAA;EACA,oBAAA;EACA,qBAAA;EACA,aAAA;EACA,cAAA;EACA,gBAAA;AAAA;AAAA,KAGU,eAAA;EACV,KAAA;EACA,KAAA;EACA,OAAA;EACA,IAAA,EAAM,mBAAA;AAAA;AAAA,KAGI,eAAA;EACV,OAAA;EACA,IAAA,GAAO,WAAA;EACP,IAAA;EACA,KAAA;AAAA;AAAA,KAGU,WAAA;EACV,OAAA;EACA,IAAA,GAAO,WAAA;EACP,KAAA;AAAA;AAAA,KAGU,eAAA;EACV,OAAA,EAAS,gBAAA;EACT,qBAAA;EACA,QAAA;AAAA;AAAA,KAGU,uBAAA,GAA0B,eAAA;EACpC,kBAAA;AAAA;AAAA,KAGU,yBAAA;EACV,MAAA,EAAQ,GAAA;EACR,KAAA;EACA,SAAA,EAAW,GAAA,CAAI,GAAA;EACf,MAAA,EAAQ,eAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.mjs","names":["ValidationErrorCode"],"sources":["../../src/deposit-data-sdk/types.ts"],"sourcesContent":["import { Hex } from 'viem';\nimport { SUPPORTED_CHAINS } from '../common/index';\n\nexport type DepositDataCommon = {\n pubkey: Hex;\n withdrawal_credentials: Hex;\n amount: number;\n signature: Hex;\n deposit_message_root: Hex;\n deposit_data_root: Hex;\n fork_version: Hex;\n deposit_cli_version: string;\n};\n\nexport type DepositDataV2 = DepositDataCommon & {\n network_name: string;\n};\n\nexport type DepositDataV1 = DepositDataCommon & {\n eth2_network_name: string;\n};\n\nexport type DepositData = DepositDataV2 | DepositDataV1;\n\nexport enum ValidationErrorCode {\n INVALID_PUBKEY = 'INVALID_PUBKEY',\n INVALID_SIGNATURE = 'INVALID_SIGNATURE',\n INVALID_WITHDRAWAL_CREDENTIALS = 'INVALID_WITHDRAWAL_CREDENTIALS',\n UNSUPPORTED_WC_TYPE = 'UNSUPPORTED_WC_TYPE',\n INVALID_AMOUNT = 'INVALID_AMOUNT',\n INVALID_NETWORK = 'INVALID_NETWORK',\n INVALID_FORK_VERSION = 'INVALID_FORK_VERSION',\n INVALID_DEPOSIT_ROOT = 'INVALID_DEPOSIT_ROOT',\n DUPLICATE_PUBKEY = 'DUPLICATE_PUBKEY',\n CACHED_PUBKEY_CONFIRMED = 'CACHED_PUBKEY_CONFIRMED',\n CACHED_PUBKEY_PENDING = 'CACHED_PUBKEY_PENDING',\n PREVIOUSLY_SUBMITTED = 'PREVIOUSLY_SUBMITTED',\n INVALID_BLS_SIGNATURE = 'INVALID_BLS_SIGNATURE',\n MISSING_FIELD = 'MISSING_FIELD',\n INVALID_FORMAT = 'INVALID_FORMAT',\n VALIDATOR_EXISTS = 'VALIDATOR_EXISTS',\n}\n\nexport type ValidationError = {\n index: number;\n field?: string;\n message: string;\n code: ValidationErrorCode;\n};\n\nexport type RemoveKeyResult = {\n success: boolean;\n data?: DepositData[];\n json?: string;\n error?: string;\n};\n\nexport type ParseResult = {\n success: boolean;\n data?: DepositData[];\n error?: string;\n};\n\nexport type ValidationProps = {\n chainId: SUPPORTED_CHAINS;\n withdrawalCredentials: string;\n wcPrefix: string;\n};\n\nexport type ValidationExtendedProps = ValidationProps & {\n currentBlockNumber?: number;\n};\n\nexport type DuplicateProcessingConfig = {\n pubkey: Hex;\n index: number;\n pubkeyMap: Map<Hex, number[]>;\n errors: ValidationError[];\n};\n"],"mappings":";AAwBO,IAAK,sBAAL,kBAAKA,yBAAL;AACLA,sBAAA,oBAAiB;AACjBA,sBAAA,uBAAoB;AACpBA,sBAAA,oCAAiC;AACjCA,sBAAA,yBAAsB;AACtBA,sBAAA,oBAAiB;AACjBA,sBAAA,qBAAkB;AAClBA,sBAAA,0BAAuB;AACvBA,sBAAA,0BAAuB;AACvBA,sBAAA,sBAAmB;AACnBA,sBAAA,6BAA0B;AAC1BA,sBAAA,2BAAwB;AACxBA,sBAAA,0BAAuB;AACvBA,sBAAA,2BAAwB;AACxBA,sBAAA,mBAAgB;AAChBA,sBAAA,oBAAiB;AACjBA,sBAAA,sBAAmB;AAhBT,QAAAA;GAAA,uBAAA,EAAA,CAAA"}
1
+ {"version":3,"file":"types.mjs","names":["ValidationErrorCode"],"sources":["../../src/deposit-data-sdk/types.ts"],"sourcesContent":["import { Hex } from 'viem';\nimport { SUPPORTED_CHAINS } from '../common/index';\n\nexport type DepositData = {\n pubkey: Hex;\n withdrawal_credentials: Hex;\n amount: number;\n signature: Hex;\n deposit_message_root: Hex;\n deposit_data_root: Hex;\n fork_version: Hex;\n network_name: string;\n deposit_cli_version: string;\n};\n\nexport enum ValidationErrorCode {\n INVALID_PUBKEY = 'INVALID_PUBKEY',\n INVALID_SIGNATURE = 'INVALID_SIGNATURE',\n INVALID_WITHDRAWAL_CREDENTIALS = 'INVALID_WITHDRAWAL_CREDENTIALS',\n UNSUPPORTED_WC_TYPE = 'UNSUPPORTED_WC_TYPE',\n INVALID_AMOUNT = 'INVALID_AMOUNT',\n INVALID_NETWORK = 'INVALID_NETWORK',\n INVALID_FORK_VERSION = 'INVALID_FORK_VERSION',\n INVALID_DEPOSIT_ROOT = 'INVALID_DEPOSIT_ROOT',\n DUPLICATE_PUBKEY = 'DUPLICATE_PUBKEY',\n CACHED_PUBKEY_CONFIRMED = 'CACHED_PUBKEY_CONFIRMED',\n CACHED_PUBKEY_PENDING = 'CACHED_PUBKEY_PENDING',\n PREVIOUSLY_SUBMITTED = 'PREVIOUSLY_SUBMITTED',\n INVALID_BLS_SIGNATURE = 'INVALID_BLS_SIGNATURE',\n MISSING_FIELD = 'MISSING_FIELD',\n INVALID_FORMAT = 'INVALID_FORMAT',\n VALIDATOR_EXISTS = 'VALIDATOR_EXISTS',\n}\n\nexport type ValidationError = {\n index: number;\n field?: string;\n message: string;\n code: ValidationErrorCode;\n};\n\nexport type RemoveKeyResult = {\n success: boolean;\n data?: DepositData[];\n json?: string;\n error?: string;\n};\n\nexport type ParseResult = {\n success: boolean;\n data?: DepositData[];\n error?: string;\n};\n\nexport type ValidationProps = {\n chainId: SUPPORTED_CHAINS;\n withdrawalCredentials: string;\n wcPrefix: string;\n};\n\nexport type ValidationExtendedProps = ValidationProps & {\n currentBlockNumber?: number;\n};\n\nexport type DuplicateProcessingConfig = {\n pubkey: Hex;\n index: number;\n pubkeyMap: Map<Hex, number[]>;\n errors: ValidationError[];\n};\n"],"mappings":";AAeO,IAAK,sBAAL,kBAAKA,yBAAL;AACLA,sBAAA,oBAAiB;AACjBA,sBAAA,uBAAoB;AACpBA,sBAAA,oCAAiC;AACjCA,sBAAA,yBAAsB;AACtBA,sBAAA,oBAAiB;AACjBA,sBAAA,qBAAkB;AAClBA,sBAAA,0BAAuB;AACvBA,sBAAA,0BAAuB;AACvBA,sBAAA,sBAAmB;AACnBA,sBAAA,6BAA0B;AAC1BA,sBAAA,2BAAwB;AACxBA,sBAAA,0BAAuB;AACvBA,sBAAA,2BAAwB;AACxBA,sBAAA,mBAAgB;AAChBA,sBAAA,oBAAiB;AACjBA,sBAAA,sBAAmB;AAhBT,QAAAA;GAAA,uBAAA,EAAA,CAAA"}
@@ -9,31 +9,31 @@ const validateBasicFields = (data, index, config) => {
9
9
  if (!require_is_hexadecimal_string.isHexadecimalString(data.pubkey, 96)) errors.push({
10
10
  index,
11
11
  field: "pubkey",
12
- message: "pubkey is not a valid string",
12
+ message: "pubkey is not a valid hex string",
13
13
  code: require_types.ValidationErrorCode.INVALID_PUBKEY
14
14
  });
15
15
  if (!require_is_hexadecimal_string.isHexadecimalString(data.signature, 192)) errors.push({
16
16
  index,
17
17
  field: "signature",
18
- message: "signature is not a valid string",
18
+ message: "signature is not a valid hex string",
19
19
  code: require_types.ValidationErrorCode.INVALID_SIGNATURE
20
20
  });
21
21
  if (!require_is_hexadecimal_string.isHexadecimalString(data.deposit_message_root, 64)) errors.push({
22
22
  index,
23
23
  field: "deposit_message_root",
24
- message: "deposit_message_root is not a valid string",
24
+ message: "deposit_message_root is not a valid hex string",
25
25
  code: require_types.ValidationErrorCode.INVALID_DEPOSIT_ROOT
26
26
  });
27
27
  if (!require_is_hexadecimal_string.isHexadecimalString(data.deposit_data_root, 64)) errors.push({
28
28
  index,
29
29
  field: "deposit_data_root",
30
- message: "deposit_data_root is not a valid string",
30
+ message: "deposit_data_root is not a valid hex string",
31
31
  code: require_types.ValidationErrorCode.INVALID_DEPOSIT_ROOT
32
32
  });
33
33
  if (!require_is_hexadecimal_string.isHexadecimalString(data.withdrawal_credentials, 64)) errors.push({
34
34
  index,
35
35
  field: "withdrawal_credentials",
36
- message: "withdrawal_credentials is not a valid string",
36
+ message: "withdrawal_credentials is not a valid hex string",
37
37
  code: require_types.ValidationErrorCode.INVALID_WITHDRAWAL_CREDENTIALS
38
38
  });
39
39
  else {
@@ -56,14 +56,14 @@ const validateBasicFields = (data, index, config) => {
56
56
  if (data.amount !== 32e9) errors.push({
57
57
  index,
58
58
  field: "amount",
59
- message: "amount is not equal to 32 eth",
59
+ message: "amount is not equal to 32 ETH",
60
60
  code: require_types.ValidationErrorCode.INVALID_AMOUNT
61
61
  });
62
62
  const requiredNetworkName = require_constants.FIXED_NETWORK[config.chainId];
63
- if (!((data.network_name || data.eth2_network_name) === requiredNetworkName)) errors.push({
63
+ if (!(data.network_name === requiredNetworkName)) errors.push({
64
64
  index,
65
65
  field: "network_name",
66
- message: `network_name or eth2_network_name is not equal to ${requiredNetworkName}`,
66
+ message: `network_name is not equal to ${requiredNetworkName}`,
67
67
  code: require_types.ValidationErrorCode.INVALID_NETWORK
68
68
  });
69
69
  const forkVersion = require_constants.FIXED_FORK_VERSION[config.chainId];
@@ -139,7 +139,7 @@ const validateDepositData = async (depositData, options) => {
139
139
  if (!isValid) errors.push({
140
140
  index,
141
141
  field: "signature",
142
- message: "invalid signature",
142
+ message: "signature failed BLS verification",
143
143
  code: require_types.ValidationErrorCode.INVALID_BLS_SIGNATURE
144
144
  });
145
145
  });
@@ -1 +1 @@
1
- {"version":3,"file":"validator.cjs","names":[],"sources":["../../src/deposit-data-sdk/validator.ts"],"sourcesContent":["import { Hex } from 'viem';\nimport { compareLowercase } from '../common/utils/compare-lowercase';\nimport {\n isHexadecimalString,\n toHexString,\n trimHexPrefix,\n} from '../common/utils/index';\nimport {\n DEPOSIT_ROOT_LENGTH,\n FIXED_AMOUNT,\n FIXED_FORK_VERSION,\n FIXED_NETWORK,\n PUBKEY_LENGTH,\n SIGNATURE_LENGTH,\n WITHDRAWAL_CREDENTIALS_LENGTH,\n} from './constants';\nimport { verifyDepositSignature } from './signature';\nimport {\n DepositData,\n DepositDataV1,\n DepositDataV2,\n DuplicateProcessingConfig,\n ValidationError,\n ValidationErrorCode,\n ValidationExtendedProps,\n ValidationProps,\n} from './types';\n\nconst validateBasicFields = (\n data: DepositData,\n index: number,\n config: ValidationProps,\n): ValidationError[] => {\n const errors: ValidationError[] = [];\n\n // Validate pubkey\n if (!isHexadecimalString(data.pubkey, PUBKEY_LENGTH)) {\n errors.push({\n index,\n field: 'pubkey',\n message: 'pubkey is not a valid string',\n code: ValidationErrorCode.INVALID_PUBKEY,\n });\n }\n\n // Validate signature\n if (!isHexadecimalString(data.signature, SIGNATURE_LENGTH)) {\n errors.push({\n index,\n field: 'signature',\n message: 'signature is not a valid string',\n code: ValidationErrorCode.INVALID_SIGNATURE,\n });\n }\n\n // Validate deposit_message_root\n if (!isHexadecimalString(data.deposit_message_root, DEPOSIT_ROOT_LENGTH)) {\n errors.push({\n index,\n field: 'deposit_message_root',\n message: 'deposit_message_root is not a valid string',\n code: ValidationErrorCode.INVALID_DEPOSIT_ROOT,\n });\n }\n\n // Validate deposit_data_root\n if (!isHexadecimalString(data.deposit_data_root, DEPOSIT_ROOT_LENGTH)) {\n errors.push({\n index,\n field: 'deposit_data_root',\n message: 'deposit_data_root is not a valid string',\n code: ValidationErrorCode.INVALID_DEPOSIT_ROOT,\n });\n }\n\n // Validate withdrawal_credentials\n if (\n !isHexadecimalString(\n data.withdrawal_credentials,\n WITHDRAWAL_CREDENTIALS_LENGTH,\n )\n ) {\n errors.push({\n index,\n field: 'withdrawal_credentials',\n message: 'withdrawal_credentials is not a valid string',\n code: ValidationErrorCode.INVALID_WITHDRAWAL_CREDENTIALS,\n });\n } else {\n const wcHex = trimHexPrefix(data.withdrawal_credentials);\n const expectedAddress = trimHexPrefix(config.withdrawalCredentials);\n\n const wcTypeHex = toHexString(config.wcPrefix.replace(/0+$/, ''));\n if (!wcHex.toLowerCase().startsWith(config.wcPrefix.toLowerCase())) {\n errors.push({\n index,\n field: 'withdrawal_credentials',\n message: `wrong key type: only ${wcTypeHex} withdrawal credentials are supported`,\n code: ValidationErrorCode.UNSUPPORTED_WC_TYPE,\n });\n } else if (\n !compareLowercase(wcHex, `${config.wcPrefix}${expectedAddress}`)\n ) {\n errors.push({\n index,\n field: 'withdrawal_credentials',\n message: 'withdrawal_credentials is not the Lido Withdrawal Vault',\n code: ValidationErrorCode.INVALID_WITHDRAWAL_CREDENTIALS,\n });\n }\n }\n\n // Validate amount\n if (data.amount !== FIXED_AMOUNT) {\n errors.push({\n index,\n field: 'amount',\n message: 'amount is not equal to 32 eth',\n code: ValidationErrorCode.INVALID_AMOUNT,\n });\n }\n\n // Validate network name\n const requiredNetworkName = FIXED_NETWORK[config.chainId];\n const networkName =\n (data as DepositDataV2).network_name ||\n (data as DepositDataV1).eth2_network_name;\n\n if (!(networkName === requiredNetworkName)) {\n errors.push({\n index,\n field: 'network_name',\n message: `network_name or eth2_network_name is not equal to ${requiredNetworkName}`,\n code: ValidationErrorCode.INVALID_NETWORK,\n });\n }\n\n // Validate fork version\n const forkVersion = FIXED_FORK_VERSION[config.chainId];\n if (\n data.fork_version !== forkVersion &&\n data.fork_version !== toHexString(forkVersion)\n ) {\n errors.push({\n index,\n field: 'fork_version',\n message: `fork_version is not equal to ${forkVersion}`,\n code: ValidationErrorCode.INVALID_FORK_VERSION,\n });\n }\n\n return errors;\n};\n\nconst processDuplicatePubkey = (config: DuplicateProcessingConfig): void => {\n const existingIndices = config.pubkeyMap.get(config.pubkey);\n if (!existingIndices) {\n config.pubkeyMap.set(config.pubkey, [config.index]);\n return;\n }\n\n existingIndices.push(config.index);\n\n existingIndices.forEach((idx) => {\n const hasExistingError = config.errors.some(\n (e) => e.index === idx && e.code === ValidationErrorCode.DUPLICATE_PUBKEY,\n );\n\n if (hasExistingError) {\n return;\n }\n\n config.errors.push({\n index: idx,\n field: 'pubkey',\n message: 'pubkey is duplicated in deposit data',\n code: ValidationErrorCode.DUPLICATE_PUBKEY,\n });\n });\n};\n\nconst performBasicValidation = (\n depositData: DepositData[],\n config: ValidationProps,\n): ValidationError[] => {\n const errors: ValidationError[] = [];\n const pubkeyMap = new Map<Hex, number[]>();\n\n // Single pass: basic validation + duplicate detection\n for (const [i, data] of depositData.entries()) {\n if (!data) {\n errors.push({\n index: i,\n message: 'deposit data item is missing',\n code: ValidationErrorCode.MISSING_FIELD,\n });\n continue;\n }\n\n // Basic field validation\n const basicErrors = validateBasicFields(data, i, config);\n errors.push(...basicErrors);\n\n // Efficient duplicate detection using Map\n const pubkey = data.pubkey?.toLowerCase() as Hex;\n if (pubkey) {\n processDuplicatePubkey({\n pubkey,\n index: i,\n pubkeyMap,\n errors,\n });\n }\n }\n\n return errors;\n};\n\nexport const validateDepositData = async (\n depositData: DepositData[],\n options: ValidationExtendedProps,\n): Promise<ValidationError[]> => {\n const errors = performBasicValidation(depositData, {\n chainId: options.chainId,\n withdrawalCredentials: options.withdrawalCredentials,\n wcPrefix: options.wcPrefix,\n });\n\n // Parallel signature verification for valid items only\n const signatureVerificationPromises = depositData.map((data, index) => {\n if (!data) {\n return Promise.resolve({ index, isValid: false });\n }\n return verifyDepositSignature(data, options.chainId)\n .then((isValid) => ({ index, isValid }))\n .catch(() => ({ index, isValid: false }));\n });\n\n const signatureResults = await Promise.all(signatureVerificationPromises);\n\n // Process signature verification results\n signatureResults.forEach(({ index, isValid }) => {\n if (!isValid) {\n errors.push({\n index,\n field: 'signature',\n message: 'invalid signature',\n code: ValidationErrorCode.INVALID_BLS_SIGNATURE,\n });\n }\n });\n\n return errors;\n};\n"],"mappings":";;;;;;AA4BA,MAAM,uBACJ,MACA,OACA,WACsB;CACtB,MAAM,SAA4B,EAAC;AAGnC,KAAI,CAAC,8BAAA,oBAAoB,KAAK,QAAA,GAAqB,CACjD,QAAO,KAAK;EACV;EACA,OAAO;EACP,SAAS;EACT,MAAM,cAAA,oBAAoB;EAC3B,CAAA;AAIH,KAAI,CAAC,8BAAA,oBAAoB,KAAK,WAAA,IAA2B,CACvD,QAAO,KAAK;EACV;EACA,OAAO;EACP,SAAS;EACT,MAAM,cAAA,oBAAoB;EAC3B,CAAA;AAIH,KAAI,CAAC,8BAAA,oBAAoB,KAAK,sBAAA,GAAyC,CACrE,QAAO,KAAK;EACV;EACA,OAAO;EACP,SAAS;EACT,MAAM,cAAA,oBAAoB;EAC3B,CAAA;AAIH,KAAI,CAAC,8BAAA,oBAAoB,KAAK,mBAAA,GAAsC,CAClE,QAAO,KAAK;EACV;EACA,OAAO;EACP,SAAS;EACT,MAAM,cAAA,oBAAoB;EAC3B,CAAA;AAIH,KACE,CAAC,8BAAA,oBACC,KAAK,wBAAA,GAEP,CAEA,QAAO,KAAK;EACV;EACA,OAAO;EACP,SAAS;EACT,MAAM,cAAA,oBAAoB;EAC3B,CAAA;MACI;EACL,MAAM,QAAQ,8BAAA,cAAc,KAA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data-sdk/validator.ts"],"sourcesContent":["import { Hex } from 'viem';\nimport { compareLowercase } from '../common/utils/compare-lowercase';\nimport {\n isHexadecimalString,\n toHexString,\n trimHexPrefix,\n} from '../common/utils/index';\nimport {\n DEPOSIT_ROOT_LENGTH,\n FIXED_AMOUNT,\n FIXED_FORK_VERSION,\n FIXED_NETWORK,\n PUBKEY_LENGTH,\n SIGNATURE_LENGTH,\n WITHDRAWAL_CREDENTIALS_LENGTH,\n} from './constants';\nimport { verifyDepositSignature } from './signature';\nimport {\n DepositData,\n DuplicateProcessingConfig,\n ValidationError,\n ValidationErrorCode,\n ValidationExtendedProps,\n ValidationProps,\n} from './types';\n\nconst validateBasicFields = (\n data: DepositData,\n index: number,\n config: ValidationProps,\n): ValidationError[] => {\n const errors: ValidationError[] = [];\n\n // Validate pubkey\n if (!isHexadecimalString(data.pubkey, PUBKEY_LENGTH)) {\n errors.push({\n index,\n field: 'pubkey',\n message: 'pubkey is not a valid hex string',\n code: ValidationErrorCode.INVALID_PUBKEY,\n });\n }\n\n // Validate signature\n if (!isHexadecimalString(data.signature, SIGNATURE_LENGTH)) {\n errors.push({\n index,\n field: 'signature',\n message: 'signature is not a valid hex string',\n code: ValidationErrorCode.INVALID_SIGNATURE,\n });\n }\n\n // Validate deposit_message_root\n if (!isHexadecimalString(data.deposit_message_root, DEPOSIT_ROOT_LENGTH)) {\n errors.push({\n index,\n field: 'deposit_message_root',\n message: 'deposit_message_root is not a valid hex string',\n code: ValidationErrorCode.INVALID_DEPOSIT_ROOT,\n });\n }\n\n // Validate deposit_data_root\n if (!isHexadecimalString(data.deposit_data_root, DEPOSIT_ROOT_LENGTH)) {\n errors.push({\n index,\n field: 'deposit_data_root',\n message: 'deposit_data_root is not a valid hex string',\n code: ValidationErrorCode.INVALID_DEPOSIT_ROOT,\n });\n }\n\n // Validate withdrawal_credentials\n if (\n !isHexadecimalString(\n data.withdrawal_credentials,\n WITHDRAWAL_CREDENTIALS_LENGTH,\n )\n ) {\n errors.push({\n index,\n field: 'withdrawal_credentials',\n message: 'withdrawal_credentials is not a valid hex string',\n code: ValidationErrorCode.INVALID_WITHDRAWAL_CREDENTIALS,\n });\n } else {\n const wcHex = trimHexPrefix(data.withdrawal_credentials);\n const expectedAddress = trimHexPrefix(config.withdrawalCredentials);\n\n const wcTypeHex = toHexString(config.wcPrefix.replace(/0+$/, ''));\n if (!wcHex.toLowerCase().startsWith(config.wcPrefix.toLowerCase())) {\n errors.push({\n index,\n field: 'withdrawal_credentials',\n message: `wrong key type: only ${wcTypeHex} withdrawal credentials are supported`,\n code: ValidationErrorCode.UNSUPPORTED_WC_TYPE,\n });\n } else if (\n !compareLowercase(wcHex, `${config.wcPrefix}${expectedAddress}`)\n ) {\n errors.push({\n index,\n field: 'withdrawal_credentials',\n message: 'withdrawal_credentials is not the Lido Withdrawal Vault',\n code: ValidationErrorCode.INVALID_WITHDRAWAL_CREDENTIALS,\n });\n }\n }\n\n // Validate amount\n if (data.amount !== FIXED_AMOUNT) {\n errors.push({\n index,\n field: 'amount',\n message: 'amount is not equal to 32 ETH',\n code: ValidationErrorCode.INVALID_AMOUNT,\n });\n }\n\n // Validate network name\n const requiredNetworkName = FIXED_NETWORK[config.chainId];\n const networkName = data.network_name;\n\n if (!(networkName === requiredNetworkName)) {\n errors.push({\n index,\n field: 'network_name',\n message: `network_name is not equal to ${requiredNetworkName}`,\n code: ValidationErrorCode.INVALID_NETWORK,\n });\n }\n\n // Validate fork version\n const forkVersion = FIXED_FORK_VERSION[config.chainId];\n if (\n data.fork_version !== forkVersion &&\n data.fork_version !== toHexString(forkVersion)\n ) {\n errors.push({\n index,\n field: 'fork_version',\n message: `fork_version is not equal to ${forkVersion}`,\n code: ValidationErrorCode.INVALID_FORK_VERSION,\n });\n }\n\n return errors;\n};\n\nconst processDuplicatePubkey = (config: DuplicateProcessingConfig): void => {\n const existingIndices = config.pubkeyMap.get(config.pubkey);\n if (!existingIndices) {\n config.pubkeyMap.set(config.pubkey, [config.index]);\n return;\n }\n\n existingIndices.push(config.index);\n\n existingIndices.forEach((idx) => {\n const hasExistingError = config.errors.some(\n (e) => e.index === idx && e.code === ValidationErrorCode.DUPLICATE_PUBKEY,\n );\n\n if (hasExistingError) {\n return;\n }\n\n config.errors.push({\n index: idx,\n field: 'pubkey',\n message: 'pubkey is duplicated in deposit data',\n code: ValidationErrorCode.DUPLICATE_PUBKEY,\n });\n });\n};\n\nconst performBasicValidation = (\n depositData: DepositData[],\n config: ValidationProps,\n): ValidationError[] => {\n const errors: ValidationError[] = [];\n const pubkeyMap = new Map<Hex, number[]>();\n\n // Single pass: basic validation + duplicate detection\n for (const [i, data] of depositData.entries()) {\n if (!data) {\n errors.push({\n index: i,\n message: 'deposit data item is missing',\n code: ValidationErrorCode.MISSING_FIELD,\n });\n continue;\n }\n\n // Basic field validation\n const basicErrors = validateBasicFields(data, i, config);\n errors.push(...basicErrors);\n\n // Efficient duplicate detection using Map\n const pubkey = data.pubkey?.toLowerCase() as Hex;\n if (pubkey) {\n processDuplicatePubkey({\n pubkey,\n index: i,\n pubkeyMap,\n errors,\n });\n }\n }\n\n return errors;\n};\n\nexport const validateDepositData = async (\n depositData: DepositData[],\n options: ValidationExtendedProps,\n): Promise<ValidationError[]> => {\n const errors = performBasicValidation(depositData, {\n chainId: options.chainId,\n withdrawalCredentials: options.withdrawalCredentials,\n wcPrefix: options.wcPrefix,\n });\n\n // Parallel signature verification for valid items only\n const signatureVerificationPromises = depositData.map((data, index) => {\n if (!data) {\n return Promise.resolve({ index, isValid: false });\n }\n return verifyDepositSignature(data, options.chainId)\n .then((isValid) => ({ index, isValid }))\n .catch(() => ({ index, isValid: false }));\n });\n\n const signatureResults = await Promise.all(signatureVerificationPromises);\n\n // Process signature verification results\n signatureResults.forEach(({ index, isValid }) => {\n if (!isValid) {\n errors.push({\n index,\n field: 'signature',\n message: 'signature failed BLS verification',\n code: ValidationErrorCode.INVALID_BLS_SIGNATURE,\n });\n }\n });\n\n return errors;\n};\n"],"mappings":";;;;;;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YAAW;EAG1B,MAAM,SAAS,KAAK,QAAQ,aAAY;AACxC,MAAI,OACF,wBAAuB;GACrB;GACA,OAAO;GACP;GACA;GACD,CAAA;;AAIL,QAAO;;AAGF,MAAM,sBAAsB,OACjC,aACA,YAC+B;CAC/B,MAAM,SAAS,uBAAuB,aAAa;EACjD,SAAS,QAAQ;EACjB,uBAAuB,QAAQ;EAC/B,UAAU,QAAQ;EACnB,CAAA;CAGD,MAAM,gCAAgC,YAAY,KAAK,MAAM,UAAU;AACrE,MAAI,CAAC,KACH,QAAO,QAAQ,QAAQ;GAAE;GAAO,SAAS;GAAO,CAAA;AAElD,SAAO,kBAAA,uBAAuB,MAAM,QAAQ,QAAO,CAChD,MAAM,aAAa;GAAE;GAAO;GAAQ,EAAE,CACtC,aAAa;GAAE;GAAO,SAAS;GAAM,EAAE;GAC3C;AAKD,EAHyB,MAAM,QAAQ,IAAI,8BAA6B,EAGvD,SAAS,EAAE,OAAO,cAAc;AAC/C,MAAI,CAAC,QACH,QAAO,KAAK;GACV;GACA,OAAO;GACP,SAAS;GACT,MAAM,cAAA,oBAAoB;GAC3B,CAAA;GAEJ;AAED,QAAO"}
@@ -9,31 +9,31 @@ const validateBasicFields = (data, index, config) => {
9
9
  if (!isHexadecimalString(data.pubkey, 96)) errors.push({
10
10
  index,
11
11
  field: "pubkey",
12
- message: "pubkey is not a valid string",
12
+ message: "pubkey is not a valid hex string",
13
13
  code: ValidationErrorCode.INVALID_PUBKEY
14
14
  });
15
15
  if (!isHexadecimalString(data.signature, 192)) errors.push({
16
16
  index,
17
17
  field: "signature",
18
- message: "signature is not a valid string",
18
+ message: "signature is not a valid hex string",
19
19
  code: ValidationErrorCode.INVALID_SIGNATURE
20
20
  });
21
21
  if (!isHexadecimalString(data.deposit_message_root, 64)) errors.push({
22
22
  index,
23
23
  field: "deposit_message_root",
24
- message: "deposit_message_root is not a valid string",
24
+ message: "deposit_message_root is not a valid hex string",
25
25
  code: ValidationErrorCode.INVALID_DEPOSIT_ROOT
26
26
  });
27
27
  if (!isHexadecimalString(data.deposit_data_root, 64)) errors.push({
28
28
  index,
29
29
  field: "deposit_data_root",
30
- message: "deposit_data_root is not a valid string",
30
+ message: "deposit_data_root is not a valid hex string",
31
31
  code: ValidationErrorCode.INVALID_DEPOSIT_ROOT
32
32
  });
33
33
  if (!isHexadecimalString(data.withdrawal_credentials, 64)) errors.push({
34
34
  index,
35
35
  field: "withdrawal_credentials",
36
- message: "withdrawal_credentials is not a valid string",
36
+ message: "withdrawal_credentials is not a valid hex string",
37
37
  code: ValidationErrorCode.INVALID_WITHDRAWAL_CREDENTIALS
38
38
  });
39
39
  else {
@@ -56,14 +56,14 @@ const validateBasicFields = (data, index, config) => {
56
56
  if (data.amount !== 32e9) errors.push({
57
57
  index,
58
58
  field: "amount",
59
- message: "amount is not equal to 32 eth",
59
+ message: "amount is not equal to 32 ETH",
60
60
  code: ValidationErrorCode.INVALID_AMOUNT
61
61
  });
62
62
  const requiredNetworkName = FIXED_NETWORK[config.chainId];
63
- if (!((data.network_name || data.eth2_network_name) === requiredNetworkName)) errors.push({
63
+ if (!(data.network_name === requiredNetworkName)) errors.push({
64
64
  index,
65
65
  field: "network_name",
66
- message: `network_name or eth2_network_name is not equal to ${requiredNetworkName}`,
66
+ message: `network_name is not equal to ${requiredNetworkName}`,
67
67
  code: ValidationErrorCode.INVALID_NETWORK
68
68
  });
69
69
  const forkVersion = FIXED_FORK_VERSION[config.chainId];
@@ -139,7 +139,7 @@ const validateDepositData = async (depositData, options) => {
139
139
  if (!isValid) errors.push({
140
140
  index,
141
141
  field: "signature",
142
- message: "invalid signature",
142
+ message: "signature failed BLS verification",
143
143
  code: ValidationErrorCode.INVALID_BLS_SIGNATURE
144
144
  });
145
145
  });
@@ -1 +1 @@
1
- {"version":3,"file":"validator.mjs","names":[],"sources":["../../src/deposit-data-sdk/validator.ts"],"sourcesContent":["import { Hex } from 'viem';\nimport { compareLowercase } from '../common/utils/compare-lowercase';\nimport {\n isHexadecimalString,\n toHexString,\n trimHexPrefix,\n} from '../common/utils/index';\nimport {\n DEPOSIT_ROOT_LENGTH,\n FIXED_AMOUNT,\n FIXED_FORK_VERSION,\n FIXED_NETWORK,\n PUBKEY_LENGTH,\n SIGNATURE_LENGTH,\n WITHDRAWAL_CREDENTIALS_LENGTH,\n} from './constants';\nimport { verifyDepositSignature } from './signature';\nimport {\n DepositData,\n DepositDataV1,\n DepositDataV2,\n DuplicateProcessingConfig,\n ValidationError,\n ValidationErrorCode,\n ValidationExtendedProps,\n ValidationProps,\n} from './types';\n\nconst validateBasicFields = (\n data: DepositData,\n index: number,\n config: ValidationProps,\n): ValidationError[] => {\n const errors: ValidationError[] = [];\n\n // Validate pubkey\n if (!isHexadecimalString(data.pubkey, PUBKEY_LENGTH)) {\n errors.push({\n index,\n field: 'pubkey',\n message: 'pubkey is not a valid string',\n code: ValidationErrorCode.INVALID_PUBKEY,\n });\n }\n\n // Validate signature\n if (!isHexadecimalString(data.signature, SIGNATURE_LENGTH)) {\n errors.push({\n index,\n field: 'signature',\n message: 'signature is not a valid string',\n code: ValidationErrorCode.INVALID_SIGNATURE,\n });\n }\n\n // Validate deposit_message_root\n if (!isHexadecimalString(data.deposit_message_root, DEPOSIT_ROOT_LENGTH)) {\n errors.push({\n index,\n field: 'deposit_message_root',\n message: 'deposit_message_root is not a valid string',\n code: ValidationErrorCode.INVALID_DEPOSIT_ROOT,\n });\n }\n\n // Validate deposit_data_root\n if (!isHexadecimalString(data.deposit_data_root, DEPOSIT_ROOT_LENGTH)) {\n errors.push({\n index,\n field: 'deposit_data_root',\n message: 'deposit_data_root is not a valid string',\n code: ValidationErrorCode.INVALID_DEPOSIT_ROOT,\n });\n }\n\n // Validate withdrawal_credentials\n if (\n !isHexadecimalString(\n data.withdrawal_credentials,\n WITHDRAWAL_CREDENTIALS_LENGTH,\n )\n ) {\n errors.push({\n index,\n field: 'withdrawal_credentials',\n message: 'withdrawal_credentials is not a valid string',\n code: ValidationErrorCode.INVALID_WITHDRAWAL_CREDENTIALS,\n });\n } else {\n const wcHex = trimHexPrefix(data.withdrawal_credentials);\n const expectedAddress = trimHexPrefix(config.withdrawalCredentials);\n\n const wcTypeHex = toHexString(config.wcPrefix.replace(/0+$/, ''));\n if (!wcHex.toLowerCase().startsWith(config.wcPrefix.toLowerCase())) {\n errors.push({\n index,\n field: 'withdrawal_credentials',\n message: `wrong key type: only ${wcTypeHex} withdrawal credentials are supported`,\n code: ValidationErrorCode.UNSUPPORTED_WC_TYPE,\n });\n } else if (\n !compareLowercase(wcHex, `${config.wcPrefix}${expectedAddress}`)\n ) {\n errors.push({\n index,\n field: 'withdrawal_credentials',\n message: 'withdrawal_credentials is not the Lido Withdrawal Vault',\n code: ValidationErrorCode.INVALID_WITHDRAWAL_CREDENTIALS,\n });\n }\n }\n\n // Validate amount\n if (data.amount !== FIXED_AMOUNT) {\n errors.push({\n index,\n field: 'amount',\n message: 'amount is not equal to 32 eth',\n code: ValidationErrorCode.INVALID_AMOUNT,\n });\n }\n\n // Validate network name\n const requiredNetworkName = FIXED_NETWORK[config.chainId];\n const networkName =\n (data as DepositDataV2).network_name ||\n (data as DepositDataV1).eth2_network_name;\n\n if (!(networkName === requiredNetworkName)) {\n errors.push({\n index,\n field: 'network_name',\n message: `network_name or eth2_network_name is not equal to ${requiredNetworkName}`,\n code: ValidationErrorCode.INVALID_NETWORK,\n });\n }\n\n // Validate fork version\n const forkVersion = FIXED_FORK_VERSION[config.chainId];\n if (\n data.fork_version !== forkVersion &&\n data.fork_version !== toHexString(forkVersion)\n ) {\n errors.push({\n index,\n field: 'fork_version',\n message: `fork_version is not equal to ${forkVersion}`,\n code: ValidationErrorCode.INVALID_FORK_VERSION,\n });\n }\n\n return errors;\n};\n\nconst processDuplicatePubkey = (config: DuplicateProcessingConfig): void => {\n const existingIndices = config.pubkeyMap.get(config.pubkey);\n if (!existingIndices) {\n config.pubkeyMap.set(config.pubkey, [config.index]);\n return;\n }\n\n existingIndices.push(config.index);\n\n existingIndices.forEach((idx) => {\n const hasExistingError = config.errors.some(\n (e) => e.index === idx && e.code === ValidationErrorCode.DUPLICATE_PUBKEY,\n );\n\n if (hasExistingError) {\n return;\n }\n\n config.errors.push({\n index: idx,\n field: 'pubkey',\n message: 'pubkey is duplicated in deposit data',\n code: ValidationErrorCode.DUPLICATE_PUBKEY,\n });\n });\n};\n\nconst performBasicValidation = (\n depositData: DepositData[],\n config: ValidationProps,\n): ValidationError[] => {\n const errors: ValidationError[] = [];\n const pubkeyMap = new Map<Hex, number[]>();\n\n // Single pass: basic validation + duplicate detection\n for (const [i, data] of depositData.entries()) {\n if (!data) {\n errors.push({\n index: i,\n message: 'deposit data item is missing',\n code: ValidationErrorCode.MISSING_FIELD,\n });\n continue;\n }\n\n // Basic field validation\n const basicErrors = validateBasicFields(data, i, config);\n errors.push(...basicErrors);\n\n // Efficient duplicate detection using Map\n const pubkey = data.pubkey?.toLowerCase() as Hex;\n if (pubkey) {\n processDuplicatePubkey({\n pubkey,\n index: i,\n pubkeyMap,\n errors,\n });\n }\n }\n\n return errors;\n};\n\nexport const validateDepositData = async (\n depositData: DepositData[],\n options: ValidationExtendedProps,\n): Promise<ValidationError[]> => {\n const errors = performBasicValidation(depositData, {\n chainId: options.chainId,\n withdrawalCredentials: options.withdrawalCredentials,\n wcPrefix: options.wcPrefix,\n });\n\n // Parallel signature verification for valid items only\n const signatureVerificationPromises = depositData.map((data, index) => {\n if (!data) {\n return Promise.resolve({ index, isValid: false });\n }\n return verifyDepositSignature(data, options.chainId)\n .then((isValid) => ({ index, isValid }))\n .catch(() => ({ index, isValid: false }));\n });\n\n const signatureResults = await Promise.all(signatureVerificationPromises);\n\n // Process signature verification results\n signatureResults.forEach(({ index, isValid }) => {\n if (!isValid) {\n errors.push({\n index,\n field: 'signature',\n message: 'invalid signature',\n code: ValidationErrorCode.INVALID_BLS_SIGNATURE,\n });\n }\n });\n\n return errors;\n};\n"],"mappings":";;;;;;AA4BA,MAAM,uBACJ,MACA,OACA,WACsB;C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B,aAAa;EACjD,SAAS,QAAQ;EACjB,uBAAuB,QAAQ;EAC/B,UAAU,QAAQ;EACnB,CAAA;CAGD,MAAM,gCAAgC,YAAY,KAAK,MAAM,UAAU;AACrE,MAAI,CAAC,KACH,QAAO,QAAQ,QAAQ;GAAE;GAAO,SAAS;GAAO,CAAA;AAElD,SAAO,uBAAuB,MAAM,QAAQ,QAAO,CAChD,MAAM,aAAa;GAAE;GAAO;GAAQ,EAAE,CACtC,aAAa;GAAE;GAAO,SAAS;GAAM,EAAE;GAC3C;AAKD,EAHyB,MAAM,QAAQ,IAAI,8BAA6B,EAGvD,SAAS,EAAE,OAAO,cAAc;AAC/C,MAAI,CAAC,QACH,QAAO,KAAK;GACV;GACA,OAAO;GACP,SAAS;GACT,MAAM,oBAAoB;GAC3B,CAAA;GAEJ;AAED,QAAO"}
1
+ {"version":3,"file":"validator.mjs","names":[],"sources":["../../src/deposit-data-sdk/validator.ts"],"sourcesContent":["import { Hex } from 'viem';\nimport { compareLowercase } from '../common/utils/compare-lowercase';\nimport {\n isHexadecimalString,\n toHexString,\n trimHexPrefix,\n} from '../common/utils/index';\nimport {\n DEPOSIT_ROOT_LENGTH,\n FIXED_AMOUNT,\n FIXED_FORK_VERSION,\n FIXED_NETWORK,\n PUBKEY_LENGTH,\n SIGNATURE_LENGTH,\n WITHDRAWAL_CREDENTIALS_LENGTH,\n} from './constants';\nimport { verifyDepositSignature } from './signature';\nimport {\n DepositData,\n DuplicateProcessingConfig,\n ValidationError,\n ValidationErrorCode,\n ValidationExtendedProps,\n ValidationProps,\n} from './types';\n\nconst validateBasicFields = (\n data: DepositData,\n index: number,\n config: ValidationProps,\n): ValidationError[] => {\n const errors: ValidationError[] = [];\n\n // Validate pubkey\n if (!isHexadecimalString(data.pubkey, PUBKEY_LENGTH)) {\n errors.push({\n index,\n field: 'pubkey',\n message: 'pubkey is not a valid hex string',\n code: ValidationErrorCode.INVALID_PUBKEY,\n });\n }\n\n // Validate signature\n if (!isHexadecimalString(data.signature, SIGNATURE_LENGTH)) {\n errors.push({\n index,\n field: 'signature',\n message: 'signature is not a valid hex string',\n code: ValidationErrorCode.INVALID_SIGNATURE,\n });\n }\n\n // Validate deposit_message_root\n if (!isHexadecimalString(data.deposit_message_root, DEPOSIT_ROOT_LENGTH)) {\n errors.push({\n index,\n field: 'deposit_message_root',\n message: 'deposit_message_root is not a valid hex string',\n code: ValidationErrorCode.INVALID_DEPOSIT_ROOT,\n });\n }\n\n // Validate deposit_data_root\n if (!isHexadecimalString(data.deposit_data_root, DEPOSIT_ROOT_LENGTH)) {\n errors.push({\n index,\n field: 'deposit_data_root',\n message: 'deposit_data_root is not a valid hex string',\n code: ValidationErrorCode.INVALID_DEPOSIT_ROOT,\n });\n }\n\n // Validate withdrawal_credentials\n if (\n !isHexadecimalString(\n data.withdrawal_credentials,\n WITHDRAWAL_CREDENTIALS_LENGTH,\n )\n ) {\n errors.push({\n index,\n field: 'withdrawal_credentials',\n message: 'withdrawal_credentials is not a valid hex string',\n code: ValidationErrorCode.INVALID_WITHDRAWAL_CREDENTIALS,\n });\n } else {\n const wcHex = trimHexPrefix(data.withdrawal_credentials);\n const expectedAddress = trimHexPrefix(config.withdrawalCredentials);\n\n const wcTypeHex = toHexString(config.wcPrefix.replace(/0+$/, ''));\n if (!wcHex.toLowerCase().startsWith(config.wcPrefix.toLowerCase())) {\n errors.push({\n index,\n field: 'withdrawal_credentials',\n message: `wrong key type: only ${wcTypeHex} withdrawal credentials are supported`,\n code: ValidationErrorCode.UNSUPPORTED_WC_TYPE,\n });\n } else if (\n !compareLowercase(wcHex, `${config.wcPrefix}${expectedAddress}`)\n ) {\n errors.push({\n index,\n field: 'withdrawal_credentials',\n message: 'withdrawal_credentials is not the Lido Withdrawal Vault',\n code: ValidationErrorCode.INVALID_WITHDRAWAL_CREDENTIALS,\n });\n }\n }\n\n // Validate amount\n if (data.amount !== FIXED_AMOUNT) {\n errors.push({\n index,\n field: 'amount',\n message: 'amount is not equal to 32 ETH',\n code: ValidationErrorCode.INVALID_AMOUNT,\n });\n }\n\n // Validate network name\n const requiredNetworkName = FIXED_NETWORK[config.chainId];\n const networkName = data.network_name;\n\n if (!(networkName === requiredNetworkName)) {\n errors.push({\n index,\n field: 'network_name',\n message: `network_name is not equal to ${requiredNetworkName}`,\n code: ValidationErrorCode.INVALID_NETWORK,\n });\n }\n\n // Validate fork version\n const forkVersion = FIXED_FORK_VERSION[config.chainId];\n if (\n data.fork_version !== forkVersion &&\n data.fork_version !== toHexString(forkVersion)\n ) {\n errors.push({\n index,\n field: 'fork_version',\n message: `fork_version is not equal to ${forkVersion}`,\n code: ValidationErrorCode.INVALID_FORK_VERSION,\n });\n }\n\n return errors;\n};\n\nconst processDuplicatePubkey = (config: DuplicateProcessingConfig): void => {\n const existingIndices = config.pubkeyMap.get(config.pubkey);\n if (!existingIndices) {\n config.pubkeyMap.set(config.pubkey, [config.index]);\n return;\n }\n\n existingIndices.push(config.index);\n\n existingIndices.forEach((idx) => {\n const hasExistingError = config.errors.some(\n (e) => e.index === idx && e.code === ValidationErrorCode.DUPLICATE_PUBKEY,\n );\n\n if (hasExistingError) {\n return;\n }\n\n config.errors.push({\n index: idx,\n field: 'pubkey',\n message: 'pubkey is duplicated in deposit data',\n code: ValidationErrorCode.DUPLICATE_PUBKEY,\n });\n });\n};\n\nconst performBasicValidation = (\n depositData: DepositData[],\n config: ValidationProps,\n): ValidationError[] => {\n const errors: ValidationError[] = [];\n const pubkeyMap = new Map<Hex, number[]>();\n\n // Single pass: basic validation + duplicate detection\n for (const [i, data] of depositData.entries()) {\n if (!data) {\n errors.push({\n index: i,\n message: 'deposit data item is missing',\n code: ValidationErrorCode.MISSING_FIELD,\n });\n continue;\n }\n\n // Basic field validation\n const basicErrors = validateBasicFields(data, i, config);\n errors.push(...basicErrors);\n\n // Efficient duplicate detection using Map\n const pubkey = data.pubkey?.toLowerCase() as Hex;\n if (pubkey) {\n processDuplicatePubkey({\n pubkey,\n index: i,\n pubkeyMap,\n errors,\n });\n }\n }\n\n return errors;\n};\n\nexport const validateDepositData = async (\n depositData: DepositData[],\n options: ValidationExtendedProps,\n): Promise<ValidationError[]> => {\n const errors = performBasicValidation(depositData, {\n chainId: options.chainId,\n withdrawalCredentials: options.withdrawalCredentials,\n wcPrefix: options.wcPrefix,\n });\n\n // Parallel signature verification for valid items only\n const signatureVerificationPromises = depositData.map((data, index) => {\n if (!data) {\n return Promise.resolve({ index, isValid: false });\n }\n return verifyDepositSignature(data, options.chainId)\n .then((isValid) => ({ index, isValid }))\n .catch(() => ({ index, isValid: false }));\n });\n\n const signatureResults = await Promise.all(signatureVerificationPromises);\n\n // Process signature verification results\n signatureResults.forEach(({ index, isValid }) => {\n if (!isValid) {\n errors.push({\n index,\n field: 'signature',\n message: 'signature failed BLS verification',\n code: ValidationErrorCode.INVALID_BLS_SIGNATURE,\n });\n }\n });\n\n return errors;\n};\n"],"mappings":";;;;;;AA0BA,MAAM,uBACJ,MACA,OACA,WACsB;CACtB,MAAM,SAA4B,EAAC;AAGnC,KAAI,CAAC,oBAAoB,KAAK,QAAA,GAAqB,CACjD,QAAO,KAAK;EACV;EACA,OAAO;EACP,SAAS;EACT,MAAM,oBAAoB;EAC3B,CAAA;AAIH,KAAI,CAAC,oBAAoB,KAAK,WAAA,IAA2B,CACvD,QAAO,KAAK;EACV;EACA,OAAO;EACP,SAAS;EACT,MAAM,oBAAoB;EAC3B,CAAA;AAIH,KAAI,CAAC,oBAAoB,KAAK,sBAAA,GAAyC,CACrE,QAAO,KAAK;EACV;EACA,OAAO;EACP,SAAS;EACT,MAAM,oBAAoB;EAC3B,CAAA;AAIH,KAAI,CAAC,oBAAoB,KAAK,mBAAA,GAAsC,CAClE,QAAO,KAAK;EACV;EACA,OAAO;EACP,SAAS;EACT,MAAM,oBAAoB;EAC3B,CAAA;AAIH,KACE,CAAC,oBACC,KAAK,wBAAA,GAEP,CAEA,QAAO,KAAK;EACV;EACA,OAAO;EACP,SAAS;EACT,MAAM,oBAAoB;EAC3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,OAAO,KAAK;GACjB,OAAO;GACP,OAAO;GACP,SAAS;GACT,MAAM,oBAAoB;GAC3B,CAAA;GACF;;AAGH,MAAM,0BACJ,aACA,WACsB;CACtB,MAAM,SAA4B,EAAC;CACnC,MAAM,4BAAY,IAAI,KAAmB;AAGzC,MAAA,MAAW,CAAC,GAAG,SAAS,YAAY,SAAQ,EAAG;AAC7C,MAAI,CAAC,MAAM;AACT,UAAO,KAAK;IACV,OAAO;IACP,SAAS;IACT,MAAM,oBAAoB;IAC3B,CAAA;AACD;;EAIF,MAAM,cAAc,oBAAoB,MAAM,GAAG,OAAM;AACvD,SAAO,KAAK,GAAG,YAAW;EAG1B,MAAM,SAAS,KAAK,QAAQ,aAAY;AACxC,MAAI,OACF,wBAAuB;GACrB;GACA,OAAO;GACP;GACA;GACD,CAAA;;AAIL,QAAO;;AAGF,MAAM,sBAAsB,OACjC,aACA,YAC+B;CAC/B,MAAM,SAAS,uBAAuB,aAAa;EACjD,SAAS,QAAQ;EACjB,uBAAuB,QAAQ;EAC/B,UAAU,QAAQ;EACnB,CAAA;CAGD,MAAM,gCAAgC,YAAY,KAAK,MAAM,UAAU;AACrE,MAAI,CAAC,KACH,QAAO,QAAQ,QAAQ;GAAE;GAAO,SAAS;GAAO,CAAA;AAElD,SAAO,uBAAuB,MAAM,QAAQ,QAAO,CAChD,MAAM,aAAa;GAAE;GAAO;GAAQ,EAAE,CACtC,aAAa;GAAE;GAAO,SAAS;GAAM,EAAE;GAC3C;AAKD,EAHyB,MAAM,QAAQ,IAAI,8BAA6B,EAGvD,SAAS,EAAE,OAAO,cAAc;AAC/C,MAAI,CAAC,QACH,QAAO,KAAK;GACV;GACA,OAAO;GACP,SAAS;GACT,MAAM,oBAAoB;GAC3B,CAAA;GAEJ;AAED,QAAO"}
@@ -1,3 +1,3 @@
1
- import { DepositData, DepositDataCommon, DepositDataV1, DepositDataV2, DuplicateProcessingConfig, ParseResult, RemoveKeyResult, ValidationError, ValidationErrorCode, ValidationExtendedProps, ValidationProps } from "./deposit-data-sdk/types.cjs";
1
+ import { DepositData, DuplicateProcessingConfig, ParseResult, RemoveKeyResult, ValidationError, ValidationErrorCode, ValidationExtendedProps, ValidationProps } from "./deposit-data-sdk/types.cjs";
2
2
  import { DepositDataSDK } from "./deposit-data-sdk/deposit-data-sdk.cjs";
3
- export { DepositData, DepositDataCommon, DepositDataSDK, DepositDataV1, DepositDataV2, DuplicateProcessingConfig, ParseResult, RemoveKeyResult, ValidationError, ValidationErrorCode, ValidationExtendedProps, ValidationProps };
3
+ export { DepositData, DepositDataSDK, DuplicateProcessingConfig, ParseResult, RemoveKeyResult, ValidationError, ValidationErrorCode, ValidationExtendedProps, ValidationProps };
@@ -1,3 +1,3 @@
1
- import { DepositData, DepositDataCommon, DepositDataV1, DepositDataV2, DuplicateProcessingConfig, ParseResult, RemoveKeyResult, ValidationError, ValidationErrorCode, ValidationExtendedProps, ValidationProps } from "./deposit-data-sdk/types.mjs";
1
+ import { DepositData, DuplicateProcessingConfig, ParseResult, RemoveKeyResult, ValidationError, ValidationErrorCode, ValidationExtendedProps, ValidationProps } from "./deposit-data-sdk/types.mjs";
2
2
  import { DepositDataSDK } from "./deposit-data-sdk/deposit-data-sdk.mjs";
3
- export { DepositData, DepositDataCommon, DepositDataSDK, DepositDataV1, DepositDataV2, DuplicateProcessingConfig, ParseResult, RemoveKeyResult, ValidationError, ValidationErrorCode, ValidationExtendedProps, ValidationProps };
3
+ export { DepositData, DepositDataSDK, DuplicateProcessingConfig, ParseResult, RemoveKeyResult, ValidationError, ValidationErrorCode, ValidationExtendedProps, ValidationProps };
package/dist/index.d.cts CHANGED
@@ -70,7 +70,7 @@ import { FindKeysResponse, KeyWithStatus } from "./keys-with-status-sdk/types.cj
70
70
  import { KeysWithStatusSDK } from "./keys-with-status-sdk/keys-with-status-sdk.cjs";
71
71
  import { CsmStatus, ModuleDigest, ModuleOperatorsResponse, ModulesResponse, ShareLimitInfo, ShareLimitStatus } from "./module-sdk/types.cjs";
72
72
  import { ModuleSDK } from "./module-sdk/module-sdk.cjs";
73
- import { DepositData, DepositDataCommon, DepositDataV1, DepositDataV2, DuplicateProcessingConfig, ParseResult, RemoveKeyResult, ValidationError, ValidationErrorCode, ValidationExtendedProps, ValidationProps } from "./deposit-data-sdk/types.cjs";
73
+ import { DepositData, DuplicateProcessingConfig, ParseResult, RemoveKeyResult, ValidationError, ValidationErrorCode, ValidationExtendedProps, ValidationProps } from "./deposit-data-sdk/types.cjs";
74
74
  import { DepositDataSDK } from "./deposit-data-sdk/deposit-data-sdk.cjs";
75
75
  import { NodeOperatorDiscoveryInfo, NodeOperatorLockedBond, Pagination, SearchMode } from "./discovery-sdk/types.cjs";
76
76
  import { DiscoverySDK } from "./discovery-sdk/discovery-sdk.cjs";
@@ -111,4 +111,4 @@ import { epochToSlot, epochToTimestamp, getFrameDuration, getSlotsPerFrame, slot
111
111
  import { byTotalCount, iteratePages, onePage } from "./discovery-sdk/iterate-pages.cjs";
112
112
  import { CreateNodeOperatorInGateProps, GateItem, GateItemEligibility } from "./curated-gates-collection-sdk/types.cjs";
113
113
  import { CuratedGatesCollectionSDK } from "./curated-gates-collection-sdk/curated-gates-collection-sdk.cjs";
114
- export { API_NAME, API_URLS, AccessCondition, AccessLevel, AccountingSDK, AddBondProps, AddBondResult, AddKeysInnerProps, AddKeysProps, AddNodeOperatorProps, AddOperatorBaseProps, AddOperatorNormalized, AddVettedNodeOperatorProps, AddressProof, AddressTreeLeaf, AllowanceProps, AmountAndTokenProps, AmountByKeys, BatchCallReceipt, BatchCallStatus, BatchTransactionRevertedError, BatchTransactionRevertedErrorData, BindedContract, BondAmountByKeysCountProps, BondBalance, BondForNextKeysProps, BondSDK, CACHE_IMMUTABLE, CACHE_LONG, CACHE_MID, CACHE_SHORT, COMMON_ADDRESSES, CONTRACT_BASE_ABI, CONTRACT_NAMES, CURATED_GATES, CallResult, CanPerformContext, CanPerformResult, CancelProps, ChangeRoleProps, CheckOperatorKeysProps, ClaimBondProps, ClaimCurveProps, CleanDepositQueueResult, CommonCallProps, CommonCallPropsWithPermit, CommonTransactionProps, CompensateLockedBondProps, ConfirmRoleProps, ContractAddresses, ContractErrorName, CoreProps, CoreSDK, CreateNodeOperatorInGateProps, CreateNodeOperatorProps, CsmSDKModule, CsmSDKProps, CsmStatus, CuratedGateSDK, CuratedGatesCollectionSDK, CurrentFrameInfo, CurveParameters, DEFAULT_CLEAN_MAX_ITEMS, DEFAULT_IPFS_GATEWAYS, DecodeResultError, DecodeResultErrorData, DecodedExternalOperator, DecodedRevert, DelayedPenaltySDK, DepositData, DepositDataCommon, DepositDataKey, DepositDataSDK, DepositDataV1, DepositDataV2, DepositQueueBatch, DepositQueueBatchInfo, DepositQueuePointer, DepositQueueSDK, DiscoverySDK, DuplicateProcessingConfig, EJECTABLE_EPOCH_COUNT, EJECT_FEE_MIN_LIMIT, EJECT_FEE_MULTIPLIEER, EMPTY_PERMIT, ERROR_CODE, EjectKeysByArrayProps, Erc20Tokens, EventRangeProps, EventsSDK, ExternalOperatorNOR, FeeSplit, FeesMonitoringSDK, FetchFn, FindKeysResponse, FrameConfig, FrameInfo, FrameSDK, GateEligibility, GateItem, GateItemEligibility, GroupInfo, GroupOperators, KEY_STATUS, KEY_TTL_DURATION, KeyCacheEntry, KeyCacheStatus, KeyNumberValueInterval, KeyStrikes, KeyWithStatus, KeyWithStrikes, KeysCacheSDK, KeysCountByBondAmountProps, KeysRecord, KeysSDK, KeysWithStatusSDK, LidoSDKCm, LidoSDKCsm, MAX_BLOCKS_DEPTH_TWO_WEEKS, MAX_EFFECTIVE_BALANCE, MAX_FEE_SPLITS_COUNT, MERKLE_TREE_FALLBACKS, MIN_EFFECTIVE_BALANCE, MODULE_CONFIG, MODULE_CONTRACT, MODULE_NAME, MetaRegistrySDK, MethodAccess, ModuleConfig, ModuleDigest, ModuleOperatorsResponse, ModuleSDK, ModulesResponse, NodeOperator, NodeOperatorDiscoveryInfo, NodeOperatorId, NodeOperatorInfo, NodeOperatorInvite, NodeOperatorInviteInfo, NodeOperatorLockedBond, NodeOperatorShortInfo, NonPendingBlockTag, OPERATOR_TYPE, OPERATOR_TYPE_CURVE_ID, OperatorCurveIdChange, OperatorGroupStakeSummary, OperatorKeysInfo, OperatorMetadata, OperatorRewards, OperatorRewardsHistory, OperatorSDK, OperatorStakeInfo, OperatorStakeSummary, OperatorWeightAndExternalStake, OperatorWithLockedBond, PERCENT_BASIS, PUBKEY_LENGTH_BYTES, Pagination, ParametersSDK, ParseFn, ParseResult, PenaltyCancelled, PenaltyCompensated, PenaltyExpiredLockRemoved, PenaltyRecord, PenaltyRecordWithoutTimestamp, PenaltyReported, PenaltySettled, PerModule, PerSupportedChain, PerToken, PerformOptions, PerformOptionsDecodePartial, PerformOptionsNoSpend, PerformOptionsSpend, PerformTransactionGasLimit, PerformTransactionSendTransaction, PerformanceCoefficients, PermissionlessGateSDK, PermitSignatureShort, Proof, PublicMethods, PullRewardsProps, QueueBatchesPagination, QueueConfig, ROLES, RawDepositQueueBatch, RawDepositQueueBatchWithIndex, RawExternalOperator, ReceiptLike, RelayRegistrationDetails, RemoveKeyResult, RemoveKeysProps, ReportProps, ReportTimestamps, ResetRoleProps, RewardProof, Rewards, RewardsReport, RewardsReportV1, RewardsReportV2, RewardsSDK, RewardsTreeLeaf, RolesSDK, SDKError, SDKErrorProps, SIGNATURE_LENGTH_BYTES, STETH_ROUNDING_THRESHOLD, SUPPORTED_CHAINS, SUPPORTED_CONTRACT_VERSIONS, SdkProps, SearchMode, SetCustomClaimerProps, SetFeeSplitsProps, SetOperatorDataProps, ShareLimitInfo, ShareLimitStatus, SpendOptions, StandardMerkleTreeData, StethPoolData, StrikesConfig, StrikesSDK, StrikesTreeLeaf, SubNodeOperator, SubOperatorStakeSummary, TOKENS, TransactionCallback, TransactionCallbackProps, TransactionCallbackStage, TxSDK, UnlockExpiredLockProps, ValidateFn, ValidationError, ValidationErrorCode, ValidationExtendedProps, ValidationProps, ValidatorInfo, ValidatorInfoIssues, ValidatorRegistration, ValidatorRegistrationResponse, ValidatorRewards, ValidatorRewardsEntity, VersionCheckResult, VettedGateContractName, VettedGateSDK, WithRole, WithToken, appendNodeOperator, bigIntRange, buildCombinedErrorAbi, byTotalCount, calcBondBalance, classifyError, clearEmptyAddress, compareLowercase, convertEthToShares, convertSharesToEth, createMerkleTreeSchema, decodeExternalOperator, decodeExternalOperatorNOR, decodeRevertData, epochToSlot, epochToTimestamp, fetchJson, fetchOneOf, fetchTree, fetchWithFallback, findAddressProof, findKeyInterval, formatDecodedRevert, getCurveIdByOperatorType, getFrameDuration, getNodeOperatorRoles, getOperatorTypeByCurveId, getSlotsPerFrame, invariant, invariantArgument, isBigint, isCapabilitySupported, isDefined, isHexadecimalString, isNotEmptyRoles, isNotUnique, isPropsDefined, isUnique, isValidIpfsCid, iteratePages, mergeRoles, normalizeTrimHex, onError, onRevertEmptyList, onVersionError, onePage, packRoles, parseAddOperatorProps, parseClaimProps, parseCuratedModuleNodeOperatorAddedEvents, parseDepositData, parseNodeOperatorAddedEvents, parseTree, parseValue, prepareCoreProps, requestWithBlockStep, resolveAccess, slotToEpoch, slotToTimestamp, sortByBlockNumber, sortRewardsByRefSlot, splitKeys, timestampToSlot, toHexString, trimHexPrefix, verifyRoot, withKeysCacheCallback, withKeysRemovalCacheCallback, withSDKError };
114
+ export { API_NAME, API_URLS, AccessCondition, AccessLevel, AccountingSDK, AddBondProps, AddBondResult, AddKeysInnerProps, AddKeysProps, AddNodeOperatorProps, AddOperatorBaseProps, AddOperatorNormalized, AddVettedNodeOperatorProps, AddressProof, AddressTreeLeaf, AllowanceProps, AmountAndTokenProps, AmountByKeys, BatchCallReceipt, BatchCallStatus, BatchTransactionRevertedError, BatchTransactionRevertedErrorData, BindedContract, BondAmountByKeysCountProps, BondBalance, BondForNextKeysProps, BondSDK, CACHE_IMMUTABLE, CACHE_LONG, CACHE_MID, CACHE_SHORT, COMMON_ADDRESSES, CONTRACT_BASE_ABI, CONTRACT_NAMES, CURATED_GATES, CallResult, CanPerformContext, CanPerformResult, CancelProps, ChangeRoleProps, CheckOperatorKeysProps, ClaimBondProps, ClaimCurveProps, CleanDepositQueueResult, CommonCallProps, CommonCallPropsWithPermit, CommonTransactionProps, CompensateLockedBondProps, ConfirmRoleProps, ContractAddresses, ContractErrorName, CoreProps, CoreSDK, CreateNodeOperatorInGateProps, CreateNodeOperatorProps, CsmSDKModule, CsmSDKProps, CsmStatus, CuratedGateSDK, CuratedGatesCollectionSDK, CurrentFrameInfo, CurveParameters, DEFAULT_CLEAN_MAX_ITEMS, DEFAULT_IPFS_GATEWAYS, DecodeResultError, DecodeResultErrorData, DecodedExternalOperator, DecodedRevert, DelayedPenaltySDK, DepositData, DepositDataKey, DepositDataSDK, DepositQueueBatch, DepositQueueBatchInfo, DepositQueuePointer, DepositQueueSDK, DiscoverySDK, DuplicateProcessingConfig, EJECTABLE_EPOCH_COUNT, EJECT_FEE_MIN_LIMIT, EJECT_FEE_MULTIPLIEER, EMPTY_PERMIT, ERROR_CODE, EjectKeysByArrayProps, Erc20Tokens, EventRangeProps, EventsSDK, ExternalOperatorNOR, FeeSplit, FeesMonitoringSDK, FetchFn, FindKeysResponse, FrameConfig, FrameInfo, FrameSDK, GateEligibility, GateItem, GateItemEligibility, GroupInfo, GroupOperators, KEY_STATUS, KEY_TTL_DURATION, KeyCacheEntry, KeyCacheStatus, KeyNumberValueInterval, KeyStrikes, KeyWithStatus, KeyWithStrikes, KeysCacheSDK, KeysCountByBondAmountProps, KeysRecord, KeysSDK, KeysWithStatusSDK, LidoSDKCm, LidoSDKCsm, MAX_BLOCKS_DEPTH_TWO_WEEKS, MAX_EFFECTIVE_BALANCE, MAX_FEE_SPLITS_COUNT, MERKLE_TREE_FALLBACKS, MIN_EFFECTIVE_BALANCE, MODULE_CONFIG, MODULE_CONTRACT, MODULE_NAME, MetaRegistrySDK, MethodAccess, ModuleConfig, ModuleDigest, ModuleOperatorsResponse, ModuleSDK, ModulesResponse, NodeOperator, NodeOperatorDiscoveryInfo, NodeOperatorId, NodeOperatorInfo, NodeOperatorInvite, NodeOperatorInviteInfo, NodeOperatorLockedBond, NodeOperatorShortInfo, NonPendingBlockTag, OPERATOR_TYPE, OPERATOR_TYPE_CURVE_ID, OperatorCurveIdChange, OperatorGroupStakeSummary, OperatorKeysInfo, OperatorMetadata, OperatorRewards, OperatorRewardsHistory, OperatorSDK, OperatorStakeInfo, OperatorStakeSummary, OperatorWeightAndExternalStake, OperatorWithLockedBond, PERCENT_BASIS, PUBKEY_LENGTH_BYTES, Pagination, ParametersSDK, ParseFn, ParseResult, PenaltyCancelled, PenaltyCompensated, PenaltyExpiredLockRemoved, PenaltyRecord, PenaltyRecordWithoutTimestamp, PenaltyReported, PenaltySettled, PerModule, PerSupportedChain, PerToken, PerformOptions, PerformOptionsDecodePartial, PerformOptionsNoSpend, PerformOptionsSpend, PerformTransactionGasLimit, PerformTransactionSendTransaction, PerformanceCoefficients, PermissionlessGateSDK, PermitSignatureShort, Proof, PublicMethods, PullRewardsProps, QueueBatchesPagination, QueueConfig, ROLES, RawDepositQueueBatch, RawDepositQueueBatchWithIndex, RawExternalOperator, ReceiptLike, RelayRegistrationDetails, RemoveKeyResult, RemoveKeysProps, ReportProps, ReportTimestamps, ResetRoleProps, RewardProof, Rewards, RewardsReport, RewardsReportV1, RewardsReportV2, RewardsSDK, RewardsTreeLeaf, RolesSDK, SDKError, SDKErrorProps, SIGNATURE_LENGTH_BYTES, STETH_ROUNDING_THRESHOLD, SUPPORTED_CHAINS, SUPPORTED_CONTRACT_VERSIONS, SdkProps, SearchMode, SetCustomClaimerProps, SetFeeSplitsProps, SetOperatorDataProps, ShareLimitInfo, ShareLimitStatus, SpendOptions, StandardMerkleTreeData, StethPoolData, StrikesConfig, StrikesSDK, StrikesTreeLeaf, SubNodeOperator, SubOperatorStakeSummary, TOKENS, TransactionCallback, TransactionCallbackProps, TransactionCallbackStage, TxSDK, UnlockExpiredLockProps, ValidateFn, ValidationError, ValidationErrorCode, ValidationExtendedProps, ValidationProps, ValidatorInfo, ValidatorInfoIssues, ValidatorRegistration, ValidatorRegistrationResponse, ValidatorRewards, ValidatorRewardsEntity, VersionCheckResult, VettedGateContractName, VettedGateSDK, WithRole, WithToken, appendNodeOperator, bigIntRange, buildCombinedErrorAbi, byTotalCount, calcBondBalance, classifyError, clearEmptyAddress, compareLowercase, convertEthToShares, convertSharesToEth, createMerkleTreeSchema, decodeExternalOperator, decodeExternalOperatorNOR, decodeRevertData, epochToSlot, epochToTimestamp, fetchJson, fetchOneOf, fetchTree, fetchWithFallback, findAddressProof, findKeyInterval, formatDecodedRevert, getCurveIdByOperatorType, getFrameDuration, getNodeOperatorRoles, getOperatorTypeByCurveId, getSlotsPerFrame, invariant, invariantArgument, isBigint, isCapabilitySupported, isDefined, isHexadecimalString, isNotEmptyRoles, isNotUnique, isPropsDefined, isUnique, isValidIpfsCid, iteratePages, mergeRoles, normalizeTrimHex, onError, onRevertEmptyList, onVersionError, onePage, packRoles, parseAddOperatorProps, parseClaimProps, parseCuratedModuleNodeOperatorAddedEvents, parseDepositData, parseNodeOperatorAddedEvents, parseTree, parseValue, prepareCoreProps, requestWithBlockStep, resolveAccess, slotToEpoch, slotToTimestamp, sortByBlockNumber, sortRewardsByRefSlot, splitKeys, timestampToSlot, toHexString, trimHexPrefix, verifyRoot, withKeysCacheCallback, withKeysRemovalCacheCallback, withSDKError };
package/dist/index.d.mts CHANGED
@@ -70,7 +70,7 @@ import { FindKeysResponse, KeyWithStatus } from "./keys-with-status-sdk/types.mj
70
70
  import { KeysWithStatusSDK } from "./keys-with-status-sdk/keys-with-status-sdk.mjs";
71
71
  import { CsmStatus, ModuleDigest, ModuleOperatorsResponse, ModulesResponse, ShareLimitInfo, ShareLimitStatus } from "./module-sdk/types.mjs";
72
72
  import { ModuleSDK } from "./module-sdk/module-sdk.mjs";
73
- import { DepositData, DepositDataCommon, DepositDataV1, DepositDataV2, DuplicateProcessingConfig, ParseResult, RemoveKeyResult, ValidationError, ValidationErrorCode, ValidationExtendedProps, ValidationProps } from "./deposit-data-sdk/types.mjs";
73
+ import { DepositData, DuplicateProcessingConfig, ParseResult, RemoveKeyResult, ValidationError, ValidationErrorCode, ValidationExtendedProps, ValidationProps } from "./deposit-data-sdk/types.mjs";
74
74
  import { DepositDataSDK } from "./deposit-data-sdk/deposit-data-sdk.mjs";
75
75
  import { NodeOperatorDiscoveryInfo, NodeOperatorLockedBond, Pagination, SearchMode } from "./discovery-sdk/types.mjs";
76
76
  import { DiscoverySDK } from "./discovery-sdk/discovery-sdk.mjs";
@@ -111,4 +111,4 @@ import { epochToSlot, epochToTimestamp, getFrameDuration, getSlotsPerFrame, slot
111
111
  import { byTotalCount, iteratePages, onePage } from "./discovery-sdk/iterate-pages.mjs";
112
112
  import { CreateNodeOperatorInGateProps, GateItem, GateItemEligibility } from "./curated-gates-collection-sdk/types.mjs";
113
113
  import { CuratedGatesCollectionSDK } from "./curated-gates-collection-sdk/curated-gates-collection-sdk.mjs";
114
- export { API_NAME, API_URLS, AccessCondition, AccessLevel, AccountingSDK, AddBondProps, AddBondResult, AddKeysInnerProps, AddKeysProps, AddNodeOperatorProps, AddOperatorBaseProps, AddOperatorNormalized, AddVettedNodeOperatorProps, AddressProof, AddressTreeLeaf, AllowanceProps, AmountAndTokenProps, AmountByKeys, BatchCallReceipt, BatchCallStatus, BatchTransactionRevertedError, BatchTransactionRevertedErrorData, BindedContract, BondAmountByKeysCountProps, BondBalance, BondForNextKeysProps, BondSDK, CACHE_IMMUTABLE, CACHE_LONG, CACHE_MID, CACHE_SHORT, COMMON_ADDRESSES, CONTRACT_BASE_ABI, CONTRACT_NAMES, CURATED_GATES, CallResult, CanPerformContext, CanPerformResult, CancelProps, ChangeRoleProps, CheckOperatorKeysProps, ClaimBondProps, ClaimCurveProps, CleanDepositQueueResult, CommonCallProps, CommonCallPropsWithPermit, CommonTransactionProps, CompensateLockedBondProps, ConfirmRoleProps, ContractAddresses, ContractErrorName, CoreProps, CoreSDK, CreateNodeOperatorInGateProps, CreateNodeOperatorProps, CsmSDKModule, CsmSDKProps, CsmStatus, CuratedGateSDK, CuratedGatesCollectionSDK, CurrentFrameInfo, CurveParameters, DEFAULT_CLEAN_MAX_ITEMS, DEFAULT_IPFS_GATEWAYS, DecodeResultError, DecodeResultErrorData, DecodedExternalOperator, DecodedRevert, DelayedPenaltySDK, DepositData, DepositDataCommon, DepositDataKey, DepositDataSDK, DepositDataV1, DepositDataV2, DepositQueueBatch, DepositQueueBatchInfo, DepositQueuePointer, DepositQueueSDK, DiscoverySDK, DuplicateProcessingConfig, EJECTABLE_EPOCH_COUNT, EJECT_FEE_MIN_LIMIT, EJECT_FEE_MULTIPLIEER, EMPTY_PERMIT, ERROR_CODE, EjectKeysByArrayProps, Erc20Tokens, EventRangeProps, EventsSDK, ExternalOperatorNOR, FeeSplit, FeesMonitoringSDK, FetchFn, FindKeysResponse, FrameConfig, FrameInfo, FrameSDK, GateEligibility, GateItem, GateItemEligibility, GroupInfo, GroupOperators, KEY_STATUS, KEY_TTL_DURATION, KeyCacheEntry, KeyCacheStatus, KeyNumberValueInterval, KeyStrikes, KeyWithStatus, KeyWithStrikes, KeysCacheSDK, KeysCountByBondAmountProps, KeysRecord, KeysSDK, KeysWithStatusSDK, LidoSDKCm, LidoSDKCsm, MAX_BLOCKS_DEPTH_TWO_WEEKS, MAX_EFFECTIVE_BALANCE, MAX_FEE_SPLITS_COUNT, MERKLE_TREE_FALLBACKS, MIN_EFFECTIVE_BALANCE, MODULE_CONFIG, MODULE_CONTRACT, MODULE_NAME, MetaRegistrySDK, MethodAccess, ModuleConfig, ModuleDigest, ModuleOperatorsResponse, ModuleSDK, ModulesResponse, NodeOperator, NodeOperatorDiscoveryInfo, NodeOperatorId, NodeOperatorInfo, NodeOperatorInvite, NodeOperatorInviteInfo, NodeOperatorLockedBond, NodeOperatorShortInfo, NonPendingBlockTag, OPERATOR_TYPE, OPERATOR_TYPE_CURVE_ID, OperatorCurveIdChange, OperatorGroupStakeSummary, OperatorKeysInfo, OperatorMetadata, OperatorRewards, OperatorRewardsHistory, OperatorSDK, OperatorStakeInfo, OperatorStakeSummary, OperatorWeightAndExternalStake, OperatorWithLockedBond, PERCENT_BASIS, PUBKEY_LENGTH_BYTES, Pagination, ParametersSDK, ParseFn, ParseResult, PenaltyCancelled, PenaltyCompensated, PenaltyExpiredLockRemoved, PenaltyRecord, PenaltyRecordWithoutTimestamp, PenaltyReported, PenaltySettled, PerModule, PerSupportedChain, PerToken, PerformOptions, PerformOptionsDecodePartial, PerformOptionsNoSpend, PerformOptionsSpend, PerformTransactionGasLimit, PerformTransactionSendTransaction, PerformanceCoefficients, PermissionlessGateSDK, PermitSignatureShort, Proof, PublicMethods, PullRewardsProps, QueueBatchesPagination, QueueConfig, ROLES, RawDepositQueueBatch, RawDepositQueueBatchWithIndex, RawExternalOperator, ReceiptLike, RelayRegistrationDetails, RemoveKeyResult, RemoveKeysProps, ReportProps, ReportTimestamps, ResetRoleProps, RewardProof, Rewards, RewardsReport, RewardsReportV1, RewardsReportV2, RewardsSDK, RewardsTreeLeaf, RolesSDK, SDKError, SDKErrorProps, SIGNATURE_LENGTH_BYTES, STETH_ROUNDING_THRESHOLD, SUPPORTED_CHAINS, SUPPORTED_CONTRACT_VERSIONS, SdkProps, SearchMode, SetCustomClaimerProps, SetFeeSplitsProps, SetOperatorDataProps, ShareLimitInfo, ShareLimitStatus, SpendOptions, StandardMerkleTreeData, StethPoolData, StrikesConfig, StrikesSDK, StrikesTreeLeaf, SubNodeOperator, SubOperatorStakeSummary, TOKENS, TransactionCallback, TransactionCallbackProps, TransactionCallbackStage, TxSDK, UnlockExpiredLockProps, ValidateFn, ValidationError, ValidationErrorCode, ValidationExtendedProps, ValidationProps, ValidatorInfo, ValidatorInfoIssues, ValidatorRegistration, ValidatorRegistrationResponse, ValidatorRewards, ValidatorRewardsEntity, VersionCheckResult, VettedGateContractName, VettedGateSDK, WithRole, WithToken, appendNodeOperator, bigIntRange, buildCombinedErrorAbi, byTotalCount, calcBondBalance, classifyError, clearEmptyAddress, compareLowercase, convertEthToShares, convertSharesToEth, createMerkleTreeSchema, decodeExternalOperator, decodeExternalOperatorNOR, decodeRevertData, epochToSlot, epochToTimestamp, fetchJson, fetchOneOf, fetchTree, fetchWithFallback, findAddressProof, findKeyInterval, formatDecodedRevert, getCurveIdByOperatorType, getFrameDuration, getNodeOperatorRoles, getOperatorTypeByCurveId, getSlotsPerFrame, invariant, invariantArgument, isBigint, isCapabilitySupported, isDefined, isHexadecimalString, isNotEmptyRoles, isNotUnique, isPropsDefined, isUnique, isValidIpfsCid, iteratePages, mergeRoles, normalizeTrimHex, onError, onRevertEmptyList, onVersionError, onePage, packRoles, parseAddOperatorProps, parseClaimProps, parseCuratedModuleNodeOperatorAddedEvents, parseDepositData, parseNodeOperatorAddedEvents, parseTree, parseValue, prepareCoreProps, requestWithBlockStep, resolveAccess, slotToEpoch, slotToTimestamp, sortByBlockNumber, sortRewardsByRefSlot, splitKeys, timestampToSlot, toHexString, trimHexPrefix, verifyRoot, withKeysCacheCallback, withKeysRemovalCacheCallback, withSDKError };
114
+ export { API_NAME, API_URLS, AccessCondition, AccessLevel, AccountingSDK, AddBondProps, AddBondResult, AddKeysInnerProps, AddKeysProps, AddNodeOperatorProps, AddOperatorBaseProps, AddOperatorNormalized, AddVettedNodeOperatorProps, AddressProof, AddressTreeLeaf, AllowanceProps, AmountAndTokenProps, AmountByKeys, BatchCallReceipt, BatchCallStatus, BatchTransactionRevertedError, BatchTransactionRevertedErrorData, BindedContract, BondAmountByKeysCountProps, BondBalance, BondForNextKeysProps, BondSDK, CACHE_IMMUTABLE, CACHE_LONG, CACHE_MID, CACHE_SHORT, COMMON_ADDRESSES, CONTRACT_BASE_ABI, CONTRACT_NAMES, CURATED_GATES, CallResult, CanPerformContext, CanPerformResult, CancelProps, ChangeRoleProps, CheckOperatorKeysProps, ClaimBondProps, ClaimCurveProps, CleanDepositQueueResult, CommonCallProps, CommonCallPropsWithPermit, CommonTransactionProps, CompensateLockedBondProps, ConfirmRoleProps, ContractAddresses, ContractErrorName, CoreProps, CoreSDK, CreateNodeOperatorInGateProps, CreateNodeOperatorProps, CsmSDKModule, CsmSDKProps, CsmStatus, CuratedGateSDK, CuratedGatesCollectionSDK, CurrentFrameInfo, CurveParameters, DEFAULT_CLEAN_MAX_ITEMS, DEFAULT_IPFS_GATEWAYS, DecodeResultError, DecodeResultErrorData, DecodedExternalOperator, DecodedRevert, DelayedPenaltySDK, DepositData, DepositDataKey, DepositDataSDK, DepositQueueBatch, DepositQueueBatchInfo, DepositQueuePointer, DepositQueueSDK, DiscoverySDK, DuplicateProcessingConfig, EJECTABLE_EPOCH_COUNT, EJECT_FEE_MIN_LIMIT, EJECT_FEE_MULTIPLIEER, EMPTY_PERMIT, ERROR_CODE, EjectKeysByArrayProps, Erc20Tokens, EventRangeProps, EventsSDK, ExternalOperatorNOR, FeeSplit, FeesMonitoringSDK, FetchFn, FindKeysResponse, FrameConfig, FrameInfo, FrameSDK, GateEligibility, GateItem, GateItemEligibility, GroupInfo, GroupOperators, KEY_STATUS, KEY_TTL_DURATION, KeyCacheEntry, KeyCacheStatus, KeyNumberValueInterval, KeyStrikes, KeyWithStatus, KeyWithStrikes, KeysCacheSDK, KeysCountByBondAmountProps, KeysRecord, KeysSDK, KeysWithStatusSDK, LidoSDKCm, LidoSDKCsm, MAX_BLOCKS_DEPTH_TWO_WEEKS, MAX_EFFECTIVE_BALANCE, MAX_FEE_SPLITS_COUNT, MERKLE_TREE_FALLBACKS, MIN_EFFECTIVE_BALANCE, MODULE_CONFIG, MODULE_CONTRACT, MODULE_NAME, MetaRegistrySDK, MethodAccess, ModuleConfig, ModuleDigest, ModuleOperatorsResponse, ModuleSDK, ModulesResponse, NodeOperator, NodeOperatorDiscoveryInfo, NodeOperatorId, NodeOperatorInfo, NodeOperatorInvite, NodeOperatorInviteInfo, NodeOperatorLockedBond, NodeOperatorShortInfo, NonPendingBlockTag, OPERATOR_TYPE, OPERATOR_TYPE_CURVE_ID, OperatorCurveIdChange, OperatorGroupStakeSummary, OperatorKeysInfo, OperatorMetadata, OperatorRewards, OperatorRewardsHistory, OperatorSDK, OperatorStakeInfo, OperatorStakeSummary, OperatorWeightAndExternalStake, OperatorWithLockedBond, PERCENT_BASIS, PUBKEY_LENGTH_BYTES, Pagination, ParametersSDK, ParseFn, ParseResult, PenaltyCancelled, PenaltyCompensated, PenaltyExpiredLockRemoved, PenaltyRecord, PenaltyRecordWithoutTimestamp, PenaltyReported, PenaltySettled, PerModule, PerSupportedChain, PerToken, PerformOptions, PerformOptionsDecodePartial, PerformOptionsNoSpend, PerformOptionsSpend, PerformTransactionGasLimit, PerformTransactionSendTransaction, PerformanceCoefficients, PermissionlessGateSDK, PermitSignatureShort, Proof, PublicMethods, PullRewardsProps, QueueBatchesPagination, QueueConfig, ROLES, RawDepositQueueBatch, RawDepositQueueBatchWithIndex, RawExternalOperator, ReceiptLike, RelayRegistrationDetails, RemoveKeyResult, RemoveKeysProps, ReportProps, ReportTimestamps, ResetRoleProps, RewardProof, Rewards, RewardsReport, RewardsReportV1, RewardsReportV2, RewardsSDK, RewardsTreeLeaf, RolesSDK, SDKError, SDKErrorProps, SIGNATURE_LENGTH_BYTES, STETH_ROUNDING_THRESHOLD, SUPPORTED_CHAINS, SUPPORTED_CONTRACT_VERSIONS, SdkProps, SearchMode, SetCustomClaimerProps, SetFeeSplitsProps, SetOperatorDataProps, ShareLimitInfo, ShareLimitStatus, SpendOptions, StandardMerkleTreeData, StethPoolData, StrikesConfig, StrikesSDK, StrikesTreeLeaf, SubNodeOperator, SubOperatorStakeSummary, TOKENS, TransactionCallback, TransactionCallbackProps, TransactionCallbackStage, TxSDK, UnlockExpiredLockProps, ValidateFn, ValidationError, ValidationErrorCode, ValidationExtendedProps, ValidationProps, ValidatorInfo, ValidatorInfoIssues, ValidatorRegistration, ValidatorRegistrationResponse, ValidatorRewards, ValidatorRewardsEntity, VersionCheckResult, VettedGateContractName, VettedGateSDK, WithRole, WithToken, appendNodeOperator, bigIntRange, buildCombinedErrorAbi, byTotalCount, calcBondBalance, classifyError, clearEmptyAddress, compareLowercase, convertEthToShares, convertSharesToEth, createMerkleTreeSchema, decodeExternalOperator, decodeExternalOperatorNOR, decodeRevertData, epochToSlot, epochToTimestamp, fetchJson, fetchOneOf, fetchTree, fetchWithFallback, findAddressProof, findKeyInterval, formatDecodedRevert, getCurveIdByOperatorType, getFrameDuration, getNodeOperatorRoles, getOperatorTypeByCurveId, getSlotsPerFrame, invariant, invariantArgument, isBigint, isCapabilitySupported, isDefined, isHexadecimalString, isNotEmptyRoles, isNotUnique, isPropsDefined, isUnique, isValidIpfsCid, iteratePages, mergeRoles, normalizeTrimHex, onError, onRevertEmptyList, onVersionError, onePage, packRoles, parseAddOperatorProps, parseClaimProps, parseCuratedModuleNodeOperatorAddedEvents, parseDepositData, parseNodeOperatorAddedEvents, parseTree, parseValue, prepareCoreProps, requestWithBlockStep, resolveAccess, slotToEpoch, slotToTimestamp, sortByBlockNumber, sortRewardsByRefSlot, splitKeys, timestampToSlot, toHexString, trimHexPrefix, verifyRoot, withKeysCacheCallback, withKeysRemovalCacheCallback, withSDKError };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lidofinance/lido-csm-sdk",
3
- "version": "2.0.0-alpha.64",
3
+ "version": "2.0.0-alpha.66",
4
4
  "license": "GPL-3.0-or-later",
5
5
  "sideEffects": false,
6
6
  "type": "module",