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

29 lines 918 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BusRegistry = void 0; const lido_ethereum_sdk_1 = require("@lidofinance/lido-ethereum-sdk"); class BusRegistry { constructor() { Object.defineProperty(this, "sdks", { enumerable: true, configurable: true, writable: true, value: {} }); } register(sdk, name) { if (this.sdks[name]) { throw new Error(`Module ${name.toString()} already registered`); } this.sdks[name] = sdk; } get(name) { return this.sdks[name]; } getOrThrow(name) { (0, lido_ethereum_sdk_1.invariant)(this.sdks[name], `Module ${name.toString()} not registered`, lido_ethereum_sdk_1.ERROR_CODE.UNKNOWN_ERROR); return this.sdks[name]; } } exports.BusRegistry = BusRegistry; //# sourceMappingURL=bus-registry.js.map