Skip to content

Commit

Permalink
fix base sepolia
Browse files Browse the repository at this point in the history
  • Loading branch information
cyri113 committed Nov 27, 2024
1 parent 1fa453b commit 697705e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ import { RpcModule } from './rpc.module';
imports: [RabbitMQModule, RpcModule],
providers: [AppService],
})
export class AppModule { }
export class AppModule {}
2 changes: 1 addition & 1 deletion src/app.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class AppService implements OnModuleInit, OnModuleDestroy {
constructor(
readonly rabbitmqService: RabbitMQService,
readonly rpcService: RpcService,
) { }
) {}

onModuleInit() {
try {
Expand Down
2 changes: 1 addition & 1 deletion src/rabbitmq.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import RabbitMQ from '@togethercrew.dev/tc-messagebroker';
export class RabbitMQService implements OnModuleInit {
private readonly logger = new Logger(RabbitMQService.name);

constructor(private readonly configService: ConfigService) { }
constructor(private readonly configService: ConfigService) {}

async onModuleInit() {
const uri = this.configService.get<string>('rmq.uri');
Expand Down
2 changes: 1 addition & 1 deletion src/rpc.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ import { RpcService } from './rpc.service';
providers: [RpcService],
exports: [RpcService],
})
export class RpcModule { }
export class RpcModule {}
8 changes: 6 additions & 2 deletions src/rpc.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
import { Injectable, OnModuleInit, Logger } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { fallback, http, Transport } from 'viem';
import { arbitrumSepolia, mainnet, sepolia } from 'viem/chains';
import { arbitrumSepolia, baseSepolia, mainnet, sepolia } from 'viem/chains';

@Injectable()
export class RpcService implements OnModuleInit {
private readonly logger = new Logger(RpcService.name);
private transport = {};

constructor(private readonly configService: ConfigService) { }
constructor(private readonly configService: ConfigService) {}

async onModuleInit() {
const alchemyApiKey = this.configService.get<string>('rpc.alchemyApiKey');
Expand All @@ -28,6 +28,10 @@ export class RpcService implements OnModuleInit {
http(`https://arb-sepolia.g.alchemy.com/v2/${alchemyApiKey}`),
http(`https://arbitrum-sepolia.infura.io/v3/${infuraApiKey}`),
]),
[baseSepolia.id]: fallback([
http(`https://base-sepolia.g.alchemy.com/v2/${alchemyApiKey}`),
http(`https://base-sepolia.infura.io/v3/${infuraApiKey}`),
]),
};
}

Expand Down

0 comments on commit 697705e

Please sign in to comment.