1.12.0 • Published 2 months ago
@lido-nestjs/execution v1.12.0
Execution layer (Eth1 RPC Provider)
NestJS Logger for Lido Finance projects. Part of Lido NestJS Modules
Install
yarn add @lido-nestjs/execution
Usage
Basic usage
// Import
import { Injectable, Module } from '@nestjs/common';
import { FallbackProviderModule } from '@lido-nestjs/execution';
import { MyService } from './my.service';
@Module({
imports: [
LoggerModule.forRoot({}),
FallbackProviderModule.forRoot({
imports: [],
urls: ['http://localhost:8545', 'http://fallback:8545'],
network: 1,
}),
],
providers: [MyService],
exports: [MyService],
})
export class MyModule {}
// Usage
import { SimpleFallbackJsonRpcBatchProvider } from '@lido-nestjs/execution';
@Injectable
export class MyService {
constructor(private provider: SimpleFallbackJsonRpcBatchProvider) {}
async doSomeWork() {
return await this.provider.getBlock(1000);
}
}
Async usage
import { Module } from '@nestjs/common';
import { FallbackProviderModule } from '@lido-nestjs/execution';
import { ConfigModule, ConfigService } from './my.service';
@Module({
imports: [
ConfigModule.forRoot(), // exports ConfigService
FetchModule.forRoot(),
FallbackProviderModule.forRootAsync({
async useFactory(configService: ConfigService) {
return {
urls: configService.urls,
network: configService.network,
};
},
inject: [ConfigService],
}),
],
})
export class MyModule {}
// Usage
import { SimpleFallbackJsonRpcBatchProvider } from '@lido-nestjs/execution';
@Injectable
export class MyService {
constructor(private provider: SimpleFallbackJsonRpcBatchProvider) {}
async doSomeWork() {
return await this.provider.getBlock(1000);
}
}
1.12.0
2 months ago
1.11.1
11 months ago
1.11.0
1 year ago
1.9.3
1 year ago
1.10.1
1 year ago
1.10.0
1 year ago
1.9.1
1 year ago
1.9.0
1 year ago
1.9.2
1 year ago
1.8.2
1 year ago
1.8.1
1 year ago
1.8.3
1 year ago
1.8.0
2 years ago
1.7.2
2 years ago
1.7.1
2 years ago
1.7.0
2 years ago
1.6.0
2 years ago
1.5.0
2 years ago
1.4.0
2 years ago
1.3.0
2 years ago
1.2.0
2 years ago
1.1.0
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago