-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/add_script
- Loading branch information
Showing
78 changed files
with
558 additions
and
537 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
packages/api/src/address/dtos/filterAddressTransfersOptions.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { ApiPropertyOptional } from "@nestjs/swagger"; | ||
import { IsOptional } from "class-validator"; | ||
import { TransferType } from "../../transfer/transfer.entity"; | ||
|
||
export class FilterAddressTransfersOptionsDto { | ||
@ApiPropertyOptional({ | ||
description: "Transfer type to filter transfers by", | ||
example: TransferType.Transfer, | ||
enum: TransferType, | ||
}) | ||
@IsOptional() | ||
public readonly type?: TransferType; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from "./account.dto"; | ||
export * from "./baseAddress.dto"; | ||
export * from "./contract.dto"; | ||
export * from "./filterAddressTransfersOptions.dto"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
packages/api/src/config/docs/constants.testnet-goerli.json
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,35 @@ | ||
import { Controller, Get } from "@nestjs/common"; | ||
import { Logger, Controller, Get, BeforeApplicationShutdown } from "@nestjs/common"; | ||
import { HealthCheckService, TypeOrmHealthIndicator, HealthCheck, HealthCheckResult } from "@nestjs/terminus"; | ||
import { ApiExcludeController } from "@nestjs/swagger"; | ||
import { ConfigService } from "@nestjs/config"; | ||
import { setTimeout } from "node:timers/promises"; | ||
|
||
@ApiExcludeController() | ||
@Controller(["health", "ready"]) | ||
export class HealthController { | ||
export class HealthController implements BeforeApplicationShutdown { | ||
private readonly logger: Logger; | ||
private readonly gracefulShutdownTimeoutMs: number; | ||
|
||
constructor( | ||
private readonly healthCheckService: HealthCheckService, | ||
private readonly dbHealthChecker: TypeOrmHealthIndicator | ||
) {} | ||
private readonly dbHealthChecker: TypeOrmHealthIndicator, | ||
configService: ConfigService | ||
) { | ||
this.logger = new Logger(HealthController.name); | ||
this.gracefulShutdownTimeoutMs = configService.get<number>("gracefulShutdownTimeoutMs"); | ||
} | ||
|
||
@Get() | ||
@HealthCheck() | ||
public async check(): Promise<HealthCheckResult> { | ||
return await this.healthCheckService.check([() => this.dbHealthChecker.pingCheck("database")]); | ||
} | ||
|
||
public async beforeApplicationShutdown(signal?: string): Promise<void> { | ||
if (this.gracefulShutdownTimeoutMs && signal === "SIGTERM") { | ||
this.logger.debug(`Awaiting ${this.gracefulShutdownTimeoutMs}ms before shutdown`); | ||
await setTimeout(this.gracefulShutdownTimeoutMs); | ||
this.logger.debug(`Timeout reached, shutting down now`); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.