-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an endpoint to retrieve all valid networks (#839)
- Loading branch information
Showing
4 changed files
with
48 additions
and
7 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
packages/apps/job-launcher/server/src/modules/web3/web3.controller.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,17 @@ | ||
import { Controller, Get } from '@nestjs/common'; | ||
import { Public } from '../../common/decorators'; | ||
import { ApiTags } from '@nestjs/swagger'; | ||
import { Web3Service } from './web3.service'; | ||
import { ChainId } from '@human-protocol/sdk'; | ||
|
||
@ApiTags('Web3') | ||
@Controller('/web3') | ||
export class Web3Controller { | ||
constructor(private readonly web3Service: Web3Service) {} | ||
|
||
@Public() | ||
@Get('/networks') | ||
getValidChains(): ChainId[] { | ||
return this.web3Service.getValidChains(); | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
packages/apps/job-launcher/server/src/modules/web3/web3.module.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 |
---|---|---|
@@ -1,10 +1,12 @@ | ||
import { Logger, Module } from '@nestjs/common'; | ||
import { Web3Service } from './web3.service'; | ||
import { ConfigModule } from '@nestjs/config'; | ||
import { Web3Controller } from './web3.controller'; | ||
|
||
@Module({ | ||
imports: [ConfigModule], | ||
providers: [Web3Service], | ||
exports: [Web3Service], | ||
controllers: [Web3Controller], | ||
}) | ||
export class Web3Module {} |
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
a1b21ab
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
job-launcher-server – ./packages/apps/job-launcher/server
job-launcher-server-nine.vercel.app
job-launcher-server-humanprotocol.vercel.app
job-launcher-server-git-develop-humanprotocol.vercel.app