-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cc7250d
commit 1e9ba7e
Showing
34 changed files
with
483 additions
and
324 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
{ | ||
"arrowParens": "avoid", | ||
"bracketSpacing": true, | ||
"printWidth": 120, | ||
"trailingComma": "all", | ||
"singleQuote": false | ||
} | ||
"singleQuote": true, | ||
"trailingComma": "all" | ||
} |
10 changes: 5 additions & 5 deletions
10
packages/apps/fortune/recording-oracle/src/app.controller.spec.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,15 +1,15 @@ | ||
import { AppController } from "./app.controller"; | ||
import { AppController } from './app.controller'; | ||
|
||
describe("AppController", () => { | ||
describe('AppController', () => { | ||
let appController: AppController; | ||
|
||
beforeEach(() => { | ||
appController = new AppController(); | ||
}); | ||
|
||
describe("Health Check", () => { | ||
it("should return OK", async () => { | ||
expect(await appController.health()).toBe("OK"); | ||
describe('Health Check', () => { | ||
it('should return OK', async () => { | ||
expect(await appController.health()).toBe('OK'); | ||
}); | ||
}); | ||
}); |
14 changes: 7 additions & 7 deletions
14
packages/apps/fortune/recording-oracle/src/app.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 |
---|---|---|
@@ -1,14 +1,14 @@ | ||
import { Controller, Get } from "@nestjs/common"; | ||
import { ApiTags } from "@nestjs/swagger"; | ||
import { Controller, Get } from '@nestjs/common'; | ||
import { ApiTags } from '@nestjs/swagger'; | ||
|
||
import { Public } from "@/common/decorators"; | ||
import { Public } from '@/common/decorators'; | ||
|
||
@Controller("/") | ||
@Controller('/') | ||
export class AppController { | ||
@Public() | ||
@Get("/") | ||
@ApiTags("Health Check") | ||
@Get('/') | ||
@ApiTags('Health Check') | ||
public health(): string { | ||
return "OK"; | ||
return 'OK'; | ||
} | ||
} |
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
8 changes: 4 additions & 4 deletions
8
packages/apps/fortune/recording-oracle/src/common/config/index.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,4 +1,4 @@ | ||
export * from "./web3"; | ||
export * from "./server"; | ||
export * from "./s3"; | ||
export * from "./validation"; | ||
export * from './web3'; | ||
export * from './server'; | ||
export * from './s3'; | ||
export * from './validation'; |
6 changes: 3 additions & 3 deletions
6
packages/apps/fortune/recording-oracle/src/common/config/s3.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
4 changes: 2 additions & 2 deletions
4
packages/apps/fortune/recording-oracle/src/common/config/server.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
42 changes: 21 additions & 21 deletions
42
packages/apps/fortune/recording-oracle/src/common/config/validation.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,36 +1,36 @@ | ||
import * as Joi from "joi"; | ||
import * as Joi from 'joi'; | ||
|
||
export const ConfigNames = { | ||
NODE_ENV: "NODE_ENV", | ||
HOST: "HOST", | ||
PORT: "PORT", | ||
FE_URL: "FE_URL", | ||
SESSION_SECRET: "SESSION_SECRET", | ||
WEB3_PRIVATE_KEY: "WEB3_PRIVATE_KEY", | ||
REPUTATION_ORACLE_WEBHOOK_URL: "REPUTATION_ORACLE_WEBHOOK_URL", | ||
S3_ENDPOINT: "S3_ENDPOINT", | ||
S3_PORT: "S3_PORT", | ||
S3_ACCESS_KEY: "S3_ACCESS_KEY", | ||
S3_SECRET_KEY: "S3_SECRET_KEY", | ||
S3_BACKET: "S3_BACKET", | ||
S3_USE_SSL: "S3_USE_SSL", | ||
NODE_ENV: 'NODE_ENV', | ||
HOST: 'HOST', | ||
PORT: 'PORT', | ||
FE_URL: 'FE_URL', | ||
SESSION_SECRET: 'SESSION_SECRET', | ||
WEB3_PRIVATE_KEY: 'WEB3_PRIVATE_KEY', | ||
REPUTATION_ORACLE_WEBHOOK_URL: 'REPUTATION_ORACLE_WEBHOOK_URL', | ||
S3_ENDPOINT: 'S3_ENDPOINT', | ||
S3_PORT: 'S3_PORT', | ||
S3_ACCESS_KEY: 'S3_ACCESS_KEY', | ||
S3_SECRET_KEY: 'S3_SECRET_KEY', | ||
S3_BACKET: 'S3_BACKET', | ||
S3_USE_SSL: 'S3_USE_SSL', | ||
}; | ||
|
||
export const envValidator = Joi.object({ | ||
// General | ||
NODE_ENV: Joi.string().default("development"), | ||
HOST: Joi.string().default("localhost"), | ||
NODE_ENV: Joi.string().default('development'), | ||
HOST: Joi.string().default('localhost'), | ||
PORT: Joi.string().default(5000), | ||
FE_URL: Joi.string().default("http://localhost:3001"), | ||
SESSION_SECRET: Joi.string().default("session_key"), | ||
FE_URL: Joi.string().default('http://localhost:3001'), | ||
SESSION_SECRET: Joi.string().default('session_key'), | ||
// Web3 | ||
WEB3_PRIVATE_KEY: Joi.string().required(), | ||
REPUTATION_ORACLE_WEBHOOK_URL: Joi.string().default("http://localhost:4005"), | ||
REPUTATION_ORACLE_WEBHOOK_URL: Joi.string().default('http://localhost:4005'), | ||
// S3 | ||
S3_ENDPOINT: Joi.string().default("127.0.0.1"), | ||
S3_ENDPOINT: Joi.string().default('127.0.0.1'), | ||
S3_PORT: Joi.string().default(9000), | ||
S3_ACCESS_KEY: Joi.string().required(), | ||
S3_SECRET_KEY: Joi.string().required(), | ||
S3_BACKET: Joi.string().default("solution"), | ||
S3_BACKET: Joi.string().default('solution'), | ||
S3_USE_SSL: Joi.string().default(false), | ||
}); |
4 changes: 2 additions & 2 deletions
4
packages/apps/fortune/recording-oracle/src/common/config/web3.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
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
18 changes: 10 additions & 8 deletions
18
packages/apps/fortune/recording-oracle/src/common/constants/networks.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,30 +1,32 @@ | ||
import { NetworkMapDto } from "../interfaces/network"; | ||
import { NetworkMapDto } from '../interfaces/network'; | ||
|
||
export const networkMap: NetworkMapDto = { | ||
polygon: { | ||
chainId: 137, | ||
rpcUrl: "https://polygon-mainnet.g.alchemy.com/v2/0Lorh5KRkGl5FsRwy2epTg8fEFFoqUfY", | ||
rpcUrl: | ||
'https://polygon-mainnet.g.alchemy.com/v2/0Lorh5KRkGl5FsRwy2epTg8fEFFoqUfY', | ||
}, | ||
bsc: { | ||
chainId: 56, | ||
rpcUrl: "https://bsc-dataseed1.binance.org/", | ||
rpcUrl: 'https://bsc-dataseed1.binance.org/', | ||
}, | ||
mumbai: { | ||
chainId: 80001, | ||
rpcUrl: "https://polygon-mumbai.g.alchemy.com/v2/vKNSJzJf6SW2sdW-05bgFwoyFxUrMzii", | ||
rpcUrl: | ||
'https://polygon-mumbai.g.alchemy.com/v2/vKNSJzJf6SW2sdW-05bgFwoyFxUrMzii', | ||
}, | ||
goerli: { | ||
chainId: 5, | ||
rpcUrl: "https://goerli.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161", | ||
rpcUrl: 'https://goerli.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161', | ||
}, | ||
moonbeam: { | ||
chainId: 1284, | ||
rpcUrl: "https://rpc.api.moonbeam.network", | ||
rpcUrl: 'https://rpc.api.moonbeam.network', | ||
}, | ||
bsctest: { | ||
chainId: 97, | ||
rpcUrl: "https://data-seed-prebsc-1-s1.binance.org:8545/", | ||
rpcUrl: 'https://data-seed-prebsc-1-s1.binance.org:8545/', | ||
}, | ||
}; | ||
|
||
export const networks = Object.values(networkMap).map(network => network); | ||
export const networks = Object.values(networkMap).map((network) => network); |
2 changes: 1 addition & 1 deletion
2
packages/apps/fortune/recording-oracle/src/common/decorators/index.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 +1 @@ | ||
export * from "./public"; | ||
export * from './public'; |
5 changes: 3 additions & 2 deletions
5
packages/apps/fortune/recording-oracle/src/common/decorators/public.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,4 +1,5 @@ | ||
import { SetMetadata } from "@nestjs/common"; | ||
import { SetMetadata } from '@nestjs/common'; | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
export const Public = (): ((target: any, key?: any, descriptor?: any) => any) => SetMetadata("isPublic", true); | ||
export const Public = (): ((target: any, key?: any, descriptor?: any) => any) => | ||
SetMetadata('isPublic', true); |
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,3 @@ | ||
export enum JobRequestType { | ||
FORTUNE = "FORTUNE", | ||
FORTUNE = 'FORTUNE', | ||
} |
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
2 changes: 1 addition & 1 deletion
2
packages/apps/fortune/recording-oracle/src/common/filter/index.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 +1 @@ | ||
export * from "./global-exceptions.filter"; | ||
export * from './global-exceptions.filter'; |
4 changes: 2 additions & 2 deletions
4
packages/apps/fortune/recording-oracle/src/common/interfaces/job.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
2 changes: 1 addition & 1 deletion
2
packages/apps/fortune/recording-oracle/src/common/pipes/index.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 +1 @@ | ||
export * from "./validation"; | ||
export * from './validation'; |
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
18 changes: 9 additions & 9 deletions
18
packages/apps/fortune/recording-oracle/src/common/validators/ethers.spec.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
Oops, something went wrong.