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

25 lines 739 B
import { ERROR_CODE, invariant } from '@lidofinance/lido-ethereum-sdk'; export 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) { invariant(this.sdks[name], `Module ${name.toString()} not registered`, ERROR_CODE.UNKNOWN_ERROR); return this.sdks[name]; } } //# sourceMappingURL=bus-registry.js.map