🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@lido-nestjs/offchain-key-storage-client

Package Overview
Dependencies
Maintainers
3
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lido-nestjs/offchain-key-storage-client

Library provide interface for storing Node operator's key in IPFS and preparing merkle tree and proofs. Part of [Lido NestJS Modules](https://github.com/lidofinance/lido-nestjs-modules/#readme).

latest
Source
npmnpm
Version
1.1.1
Version published
Maintainers
3
Created
Source

Library for storing keys in IPFS and creating merkle tree

Library provide interface for storing Node operator's key in IPFS and preparing merkle tree and proofs. Part of Lido NestJS Modules.

Install

yarn add @lido-nestjs/offchain-key-storage-client

Ipfs

Usage

This module depends on IpfsModule from @lido-nestjs/ipfs-http-client, so you need to provide it as a global module or import it into IpfsNopKeysModule.

IpfsModule

// global IpfsModule usage

@Module({
  imports: [
    ConfigModule,
    // FetchModule.forRoot(),
    IpfsModule.forRootAsync({
      imports: [CustomFetchModule],
      async useFactory(config: ConfigService) {
        return {
          url: config.get('URL'),
          username: config.get('USERNAME'),
          password: config.get('PASSWORD'),
        };
      },
      inject: [ConfigService],
    }),
    IpfsNopKeysModule.forRoot(),
  ],
})
export class MyModule {}

// IpfsModule as deps of IpfsNopKeysModule

@Module({
  imports: [
    ConfigModule,
    // FetchModule.forRoot(),
    IpfsNopKeysModule.forRoot({
      imports: [
        IpfsModule.forRootAsync({
          imports: [CustomFetchModule],
          async useFactory(config: ConfigService) {
            return {
              url: config.get('URL'),
              username: config.get('USERNAME'),
              password: config.get('PASSWORD'),
            };
          },
          inject: [ConfigService],
        }),
      ],
    }),
  ],
})
export class MyModule {}

NopMerkleTree

// Import
import { Module } from '@nestjs/common';
import { NopMerkleTreeModule } from '@lido-nestjs/offchain-key-storage-client';
import { MyService } from './my.service';

@Module({
  imports: [NopMerkleTreeModule],
  providers: [MyService],
  exports: [MyService],
})
export class MyModule {}

// Usage
import {
  NopMerkleTreeService,
  KeySignBuffer,
} from '@lido-nestjs/offchain-key-storage-client';

export class MyService {
  constructor(private nopMerkleTreeService: NopMerkleTreeService) {}

  myMethod(data: KeySignBuffer[]) {
    return this.nopMerkleTreeService.createTree(data);
  }
}

Example of usage this library https://github.com/lidofinance/lido-offchain-key-lib-test.git

Keywords

lido

FAQs

Package last updated on 11 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts