@exromany/lido-csm-sdk
Version:
[](https://github.com/lidofinance/lido-csm-sdk/blob/main/LICENSE.txt) [](h
199 lines • 7.49 kB
JavaScript
import { AccountingSDK } from './accounting-sdk/accounting-sdk.js';
import { BondSDK } from './bond-sdk/bond-sdk.js';
import { BusRegistry } from './common/class-primitives/bus-registry.js';
import { CONTRACT_NAMES, CSM_CONTRACT_ADDRESSES, CSM_DEPLOYMENT_BLOCK_NUMBERS, CSM_MODULE_IDS, } from './common/index.js';
import { CoreSDK } from './core-sdk/core-sdk.js';
import { DepositDataSDK } from './deposit-data-sdk/deposit-data-sdk.js';
import { DepositQueueSDK } from './deposit-queue-sdk/deposit-queue-sdk.js';
import { EventsSDK } from './events-sdk/events-sdk.js';
import { FeesMonitoringSDK } from './fees-monitoring-sdk/fees-monitoring-sdk.js';
import { FrameSDK } from './frame-sdk/frame-sdk.js';
import { IcsGateSDK } from './ics-gate-sdk/ics-gate-sdk.js';
import { KeysCacheSDK } from './keys-cache-sdk/keys-cache-sdk.js';
import { KeysSDK } from './keys-sdk/keys-sdk.js';
import { KeysWithStatusSDK } from './keys-with-status-sdk/keys-with-status-sdk.js';
import { ModuleSDK } from './module-sdk/module-sdk.js';
import { OperatorSDK } from './operator-sdk/operator-sdk.js';
import { ParametersSDK } from './parameters-sdk/parameters-sdk.js';
import { PermissionlessGateSDK } from './permissionless-gate-sdk/permissionless-gate-sdk.js';
import { RewardsSDK } from './rewards-sdk/rewards-sdk.js';
import { RolesSDK } from './roles-sdk/roles-sdk.js';
import { DiscoverySDK } from './discovery-sdk/discovery-sdk.js';
import { StealingSDK } from './stealing-sdk/stealing-sdk.js';
import { StrikesSDK } from './strikes-sdk/strikes-sdk.js';
import { TxSDK } from './tx-sdk/tx-sdk.js';
export class LidoSDKCsm {
constructor(props) {
Object.defineProperty(this, "core", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "tx", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "module", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "accounting", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "parameters", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "operator", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "rewards", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "keys", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "keysWithStatus", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "keysCache", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "bond", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "roles", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "permissionlessGate", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "icsGate", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "strikes", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "events", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "frame", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "depositQueue", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "depositData", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "stealing", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "discovery", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "feesMonitoring", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
const coreProps = prepareCoreProps(props);
const bus = new BusRegistry();
this.core = new CoreSDK(coreProps);
const commonProps = { ...props, core: this.core, bus };
this.tx = new TxSDK(commonProps, 'tx');
this.module = new ModuleSDK(commonProps, 'module');
this.accounting = new AccountingSDK(commonProps, 'accounting');
this.permissionlessGate = new PermissionlessGateSDK(commonProps);
this.icsGate = new IcsGateSDK(commonProps);
this.parameters = new ParametersSDK(commonProps, 'parameters');
this.operator = new OperatorSDK(commonProps, 'operator');
this.keys = new KeysSDK(commonProps);
this.keysWithStatus = new KeysWithStatusSDK(commonProps, 'keysWithStatus');
this.keysCache = new KeysCacheSDK(commonProps, 'keysCache');
this.bond = new BondSDK(commonProps);
this.roles = new RolesSDK(commonProps);
this.strikes = new StrikesSDK(commonProps, 'strikes');
this.rewards = new RewardsSDK(commonProps);
this.frame = new FrameSDK(commonProps, 'frame');
this.events = new EventsSDK(commonProps, 'events');
this.depositQueue = new DepositQueueSDK(commonProps);
this.depositData = new DepositDataSDK(commonProps);
this.stealing = new StealingSDK(commonProps);
this.feesMonitoring = new FeesMonitoringSDK(commonProps);
this.discovery = new DiscoverySDK(commonProps, 'discovery');
}
}
const prepareCoreProps = (props) => {
const chainId = props.core.chain.id;
return {
...props,
contractAddresses: {
...CSM_CONTRACT_ADDRESSES[chainId],
...props.overridedAddresses,
},
moduleName: CONTRACT_NAMES.csModule,
moduleId: CSM_MODULE_IDS[chainId],
deploymentBlockNumber: CSM_DEPLOYMENT_BLOCK_NUMBERS[chainId],
};
};
//# sourceMappingURL=lido-sdk-csm.js.map