Skip to content

Commit

Permalink
fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
chloezxyy committed Nov 22, 2023
1 parent c245272 commit e35a18a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 22 deletions.
16 changes: 8 additions & 8 deletions apps/server/src/MetascanServerApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ export class MetascanServerApp<App extends NestFastifyApplication = NestFastifyA
methods: ['GET', 'PUT', 'POST', 'DELETE'],
maxAge: 60 * 24 * 7,
origin:
process.env.NODE_ENV === 'production'
? [
'https://meta.defiscan.live/',
/https:\/\/([^.]*.\.)*defimetascan\.app/, // allow all subdomains of quantumbridge
/https:\/\/([^.]*.)--defimetascan\.netlify\.app/, // allow all netlify preview deployments
/https?:\/\/localhost(:\d+)?/, // allow localhost connection
]
: '*',
process.env.NODE_ENV === 'production'
? [
'https://meta.defiscan.live/',
/https:\/\/([^.]*.\.)*defimetascan\.app/, // allow all subdomains of quantumbridge
/https:\/\/([^.]*.)--defimetascan\.netlify\.app/, // allow all netlify preview deployments
/https?:\/\/localhost(:\d+)?/, // allow localhost connection
]
: '*',
});
}

Expand Down
4 changes: 2 additions & 2 deletions apps/server/src/faucet/FaucetController.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { CACHE_MANAGER } from '@nestjs/cache-manager';
import { Controller, HttpException, Inject, Param, Post, Query, UseGuards, UseInterceptors} from '@nestjs/common';
import { Controller, HttpException, Inject, Param, Post, Query, UseGuards, UseInterceptors } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { EnvironmentNetwork } from '@waveshq/walletkit-core';
import { TransactionResponse } from 'ethers';

import {RecaptchaGuard} from "../recaptcha/RecaptchaGuard";
import { RecaptchaGuard } from '../recaptcha/RecaptchaGuard';
import { AddressValidationInterceptor } from './AddressValidationInterceptor';
import { DefaultNetworkInterceptor } from './DefaultNetworkInterceptor';
import { FaucetService } from './FaucetService';
Expand Down
4 changes: 2 additions & 2 deletions apps/server/src/faucet/FaucetModule.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {HttpModule} from "@nestjs/axios";
import { HttpModule } from '@nestjs/axios';
import { CacheModule } from '@nestjs/cache-manager';
import { Module } from '@nestjs/common';

import {RecaptchaGuard} from "../recaptcha/RecaptchaGuard";
import { RecaptchaGuard } from '../recaptcha/RecaptchaGuard';
import { FaucetController } from './FaucetController';
import { FaucetService } from './FaucetService';

Expand Down
11 changes: 2 additions & 9 deletions apps/server/src/faucet/FaucetService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,12 @@ export class FaucetService {

private readonly privateKey: string;

constructor(
private configService: ConfigService,
) {
constructor(private configService: ConfigService) {
this.logger = new Logger(FaucetService.name);
this.privateKey = this.configService.getOrThrow('privateKey');
}

async sendFundsToUser(
address: string,
amount: string,
network: EnvironmentNetwork,
): Promise<TransactionResponse> {

async sendFundsToUser(address: string, amount: string, network: EnvironmentNetwork): Promise<TransactionResponse> {
// Send funds to user if recaptcha validation is successful
const evmProviderService = new EVMProviderService(network);
const wallet = new ethers.Wallet(this.privateKey, evmProviderService.provider);
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ async function bootstrap() {
await app.start();
}

void bootstrap();
void bootstrap();

0 comments on commit e35a18a

Please sign in to comment.