UNPKG

@exromany/lido-csm-sdk

Version:

[![GitHub license](https://img.shields.io/github/license/lidofinance/lido-csm-sdk?color=limegreen)](https://github.com/lidofinance/lido-csm-sdk/blob/main/LICENSE.txt) [![Version npm](https://img.shields.io/npm/v/@lidofinance/lido-csm-sdk?label=version)](h

30 lines 1.32 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.parseCuratedModuleNodeOperatorAddedEvents = void 0; const lido_ethereum_sdk_1 = require("@lidofinance/lido-ethereum-sdk"); const viem_1 = require("viem"); const index_js_1 = require("../../abi/index.js"); const NODE_OPERATOR_ADDED_EVENT = (0, viem_1.getAbiItem)({ abi: index_js_1.CuratedModuleAbi, name: 'NodeOperatorAdded', }); const NODE_OPERATOR_ADDED_SIGNATURE = (0, viem_1.toEventHash)(NODE_OPERATOR_ADDED_EVENT); const parseCuratedModuleNodeOperatorAddedEvents = async (receipt) => { for (const log of receipt.logs) { if (log.topics[0] !== NODE_OPERATOR_ADDED_SIGNATURE) continue; const parsedLog = (0, viem_1.decodeEventLog)({ abi: [NODE_OPERATOR_ADDED_EVENT], strict: true, data: log.data, topics: log.topics, }); return parsedLog.args.nodeOperatorId; } throw new lido_ethereum_sdk_1.SDKError({ message: 'could not find NodeOperatorAdded event in transaction', code: lido_ethereum_sdk_1.ERROR_CODE.TRANSACTION_ERROR, }); }; exports.parseCuratedModuleNodeOperatorAddedEvents = parseCuratedModuleNodeOperatorAddedEvents; //# sourceMappingURL=parse-curated-module-node-operator-added-events.js.map