Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@catalist-nestjs/consensus
Advanced tools
NestJS Consensus Layer API Module for Catalist Finance projects. Part of [Catalist NestJS Modules](https://github.com/blockarchivelabs/catalist-nestjs-modules/#readme)
NestJS Consensus Layer API Module for Catalist Finance projects. Part of Catalist NestJS Modules
yarn add @catalist-nestjs/consensus
The types used in the API methods are based on Eth2Spec. To update them use the script:
./generate.sh
This module depends on FetchModule
from @catalist-nestjs/fetch
, so you need to provide it as a global module or import it into ConsensusModule
.
// Import
import { Module } from '@nestjs/common';
import { ConsensusModule } from '@catalist-nestjs/consensus';
import { FetchModule } from '@catalist-nestjs/fetch';
import { MyService } from './my.service';
@Module({
imports: [ConsensusModule.forFeature({ imports: [FetchModule] })],
providers: [MyService],
exports: [MyService],
})
export class MyModule {}
// Usage
import { ConsensusService } from '@catalist-nestjs/consensus';
export class MyService {
constructor(private consensusService: ConsensusService) {}
async myMethod() {
return await this.consensusService.getGenesis();
}
}
import { Module } from '@nestjs/common';
import { ConsensusModule } from '@catalist-nestjs/consensus';
import { FetchModule } from '@catalist-nestjs/fetch';
@Module({
imports: [FetchModule.forRoot(), ConsensusModule.forRoot()],
})
export class MyModule {}
import { Module } from '@nestjs/common';
import { ConsensusModule } from '@catalist-nestjs/consensus';
import { FetchModule } from '@catalist-nestjs/fetch';
import { ConfigModule, ConfigService } from './my.service';
@Module({
imports: [
ConfigModule.forRoot(),
FetchModule.forRoot(),
ConsensusModule.forRootAsync({
async useFactory(configService: ConfigService) {
return { pollingInterval: configService.pollingInterval };
},
inject: [ConfigService],
}),
],
})
export class MyModule {}
Methods support fetch options
:
// Usage
import { ConsensusService } from '@catalist-nestjs/consensus';
export class MyService {
constructor(private consensusService: ConsensusService) {}
async myMethod() {
return await this.consensusService.getGenesis({
options: { headers: { 'x-header-foo': 'bar' } },
});
}
}
Subscribe to head blocks:
import { ConsensusService } from '@catalist-nestjs/consensus';
export class MyService {
constructor(private consensusService: ConsensusService) {
this.consensusService.subscribe((error, data) => {
console.log(error, data);
});
}
}
Subscribe to finalized blocks:
import { ConsensusService } from '@catalist-nestjs/consensus';
export class MyService {
constructor(private consensusService: ConsensusService) {
this.consensusService.subscribe(
(error, data) => {
console.log(error, data);
},
{ blockId: 'finalized' },
);
}
}
FAQs
NestJS Consensus Layer API Module for Catalist Finance projects. Part of [Catalist NestJS Modules](https://github.com/blockarchivelabs/catalist-nestjs-modules/#readme)
We found that @catalist-nestjs/consensus demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.