-
Notifications
You must be signed in to change notification settings - Fork 0
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
57dc74c
commit 35b28f4
Showing
56 changed files
with
7,862 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
PORT=3000 | ||
|
||
DB_HOST=localhost | ||
DB_PORT=5432 | ||
DB_DATABASE=oracle-backend | ||
DB_USERNAME=oracle-backend | ||
DB_PASSWORD=oracle-backend | ||
|
||
EVERCLOUD_URL=https://mainnet.evercloud.dev/9de6d46bd6454e6cac0b43aa7c7eaed6/graphql | ||
TWAP_INTERVALS=300,600,900,1800 |
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,25 @@ | ||
module.exports = { | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
project: 'tsconfig.json', | ||
tsconfigRootDir : __dirname, | ||
sourceType: 'module', | ||
}, | ||
plugins: ['@typescript-eslint/eslint-plugin'], | ||
extends: [ | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:prettier/recommended', | ||
], | ||
root: true, | ||
env: { | ||
node: true, | ||
jest: true, | ||
}, | ||
ignorePatterns: ['.eslintrc.js'], | ||
rules: { | ||
'@typescript-eslint/interface-name-prefix': 'off', | ||
'@typescript-eslint/explicit-function-return-type': 'off', | ||
'@typescript-eslint/explicit-module-boundary-types': 'off', | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
}, | ||
}; |
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,35 @@ | ||
# compiled output | ||
/dist | ||
/node_modules | ||
|
||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
pnpm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
lerna-debug.log* | ||
|
||
# OS | ||
.DS_Store | ||
|
||
# Tests | ||
/coverage | ||
/.nyc_output | ||
|
||
# IDEs and editors | ||
/.idea | ||
.project | ||
.classpath | ||
.c9/ | ||
*.launch | ||
.settings/ | ||
*.sublime-workspace | ||
|
||
# IDE - VSCode | ||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json |
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,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
commitlint --edit "$1" |
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,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
yarn lint |
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,4 @@ | ||
{ | ||
"singleQuote": true, | ||
"trailingComma": "all" | ||
} |
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,31 @@ | ||
FROM node:16.17.0-alpine | ||
|
||
RUN apk add --no-cache make python3 git | ||
|
||
WORKDIR /app | ||
|
||
# Sources | ||
COPY src /app/src | ||
|
||
# Install | ||
COPY package.json /app/package.json | ||
COPY yarn.lock /app/yarn.lock | ||
|
||
# Config | ||
COPY ormconfig.js /app/ormconfig.js | ||
COPY tsconfig.json /app/tsconfig.json | ||
COPY tsconfig.build.json /app/tsconfig.build.json | ||
|
||
# Build | ||
RUN yarn | ||
RUN yarn build | ||
|
||
# Clean | ||
RUN rm -rf /app/yarn.lock | ||
RUN rm -rf /app/tsconfig.json | ||
RUN rm -rf /app/tsconfig.build.json | ||
RUN rm -rf /app/src | ||
|
||
EXPOSE 3000 | ||
|
||
CMD yarn start:prod |
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,2 +1 @@ | ||
# oracle-backend | ||
Backend for FlatQube oracle-pairs indexing |
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,5 @@ | ||
{ | ||
"$schema": "https://json.schemastore.org/nest-cli", | ||
"collection": "@nestjs/schematics", | ||
"sourceRoot": "src" | ||
} |
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,11 @@ | ||
module.exports = { | ||
type: 'postgres', | ||
host: process.env.DB_HOST, | ||
port: process.env.DB_PORT, | ||
username: process.env.DB_USERNAME, | ||
password: process.env.DB_PASSWORD, | ||
database: process.env.DB_DATABASE, | ||
entities: ['dist/**/*.entity{.ts,.js}'], | ||
migrations: ['dist/**/*.migration{.ts,.js}'], | ||
migrationsRun: 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 |
---|---|---|
@@ -0,0 +1,81 @@ | ||
{ | ||
"name": "oracle-backend", | ||
"version": "0.0.1", | ||
"description": "Backend for FlatQube oracle-pairs indexing", | ||
"author": "Alexander Kunekov<[email protected]>", | ||
"private": true, | ||
"license": "MIT", | ||
"scripts": { | ||
"prepare": "husky install", | ||
"prebuild": "rimraf dist", | ||
"build": "nest build", | ||
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"", | ||
"start:dev": "nest start --watch", | ||
"start:prod": "node dist/main", | ||
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix" | ||
}, | ||
"dependencies": { | ||
"@nestjs/common": "9.0.0", | ||
"@nestjs/config": "2.2.0", | ||
"@nestjs/core": "9.0.0", | ||
"@nestjs/event-emitter": "1.3.1", | ||
"@nestjs/platform-express": "9.0.0", | ||
"@nestjs/typeorm": "8.0.3", | ||
"bignumber.js": "9.1.0", | ||
"everscale-inpage-provider": "0.3.41", | ||
"everscale-standalone-client": "2.1.1", | ||
"pg": "8.8.0", | ||
"reflect-metadata": "0.1.13", | ||
"rimraf": "3.0.2", | ||
"rxjs": "7.2.0", | ||
"typeorm": "0.2.45" | ||
}, | ||
"devDependencies": { | ||
"@commitlint/cli": "17.0.2", | ||
"@commitlint/config-conventional": "16.2.1", | ||
"@nestjs/cli": "9.0.0", | ||
"@nestjs/schematics": "9.0.0", | ||
"@nestjs/testing": "9.0.0", | ||
"@types/express": "4.17.13", | ||
"@types/jest": "28.1.4", | ||
"@types/node": "16.0.0", | ||
"@types/supertest": "2.0.11", | ||
"@typescript-eslint/eslint-plugin": "5.0.0", | ||
"@typescript-eslint/parser": "5.0.0", | ||
"eslint": "8.0.1", | ||
"eslint-config-prettier": "8.3.0", | ||
"eslint-plugin-prettier": "4.0.0", | ||
"husky": "8.0.1", | ||
"jest": "28.1.2", | ||
"prettier": "2.3.2", | ||
"source-map-support": "0.5.20", | ||
"supertest": "6.1.3", | ||
"ts-jest": "28.0.5", | ||
"ts-loader": "9.2.3", | ||
"ts-node": "10.0.0", | ||
"tsconfig-paths": "4.0.0", | ||
"typescript": "4.3.5" | ||
}, | ||
"jest": { | ||
"moduleFileExtensions": [ | ||
"js", | ||
"json", | ||
"ts" | ||
], | ||
"rootDir": "src", | ||
"testRegex": ".*\\.spec\\.ts$", | ||
"transform": { | ||
"^.+\\.(t|j)s$": "ts-jest" | ||
}, | ||
"collectCoverageFrom": [ | ||
"**/*.(t|j)s" | ||
], | ||
"coverageDirectory": "../coverage", | ||
"testEnvironment": "node" | ||
}, | ||
"commitlint": { | ||
"extends": [ | ||
"@commitlint/config-conventional" | ||
] | ||
} | ||
} |
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 { Module } from '@nestjs/common'; | ||
import { ServiceModule } from './service/service.module'; | ||
import { ClientsModule } from './clients/clients.module'; | ||
import { ConfigModule } from '@nestjs/config'; | ||
import { EventEmitterModule } from '@nestjs/event-emitter'; | ||
import { TypeOrmModule } from '@nestjs/typeorm'; | ||
|
||
@Module({ | ||
imports: [ | ||
TypeOrmModule.forRoot(), | ||
ConfigModule.forRoot({ isGlobal: true }), | ||
EventEmitterModule.forRoot({ wildcard: true }), | ||
ClientsModule, | ||
ServiceModule, | ||
], | ||
}) | ||
export class AppModule {} |
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,9 @@ | ||
import { Module, Global } from '@nestjs/common'; | ||
import { EverscaleService } from './everscale.service'; | ||
|
||
@Global() | ||
@Module({ | ||
providers: [EverscaleService], | ||
exports: [EverscaleService], | ||
}) | ||
export class ClientsModule {} |
Oops, something went wrong.