-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #306 from mstable/feat/dhedge-v1-withdraw-app
Feat/dhedge v1 withdraw app
- Loading branch information
Showing
126 changed files
with
6,378 additions
and
8 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,6 +1,7 @@ | ||
{ | ||
"projects": { | ||
"lts": "apps-lts", | ||
"mstable": "frontend-7e17f" | ||
"mstable": "frontend-7e17f", | ||
"dhedge": "dhedge-v1-withdraw" | ||
} | ||
} |
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,59 @@ | ||
name: dHEDGE Dev | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'apps/dhedge/**' | ||
- 'libs/dhedge/**' | ||
- 'libs/shared/**' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} | ||
|
||
jobs: | ||
build_and_publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
name: Checkout [main] | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-node@v3 | ||
name: Setup node | ||
with: | ||
node-version: 18 | ||
cache: 'yarn' | ||
|
||
- name: Install jq | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install jq | ||
- run: yarn install --frozen-lockfile | ||
name: Install dependencies | ||
|
||
- name: Build | ||
env: | ||
alchemyMain: ${{ secrets.ALCHEMY_FALLBACK_API_KEY }} | ||
alchemyFallback: ${{ secrets.ALCHEMY_FALLBACK_API_KEY }} | ||
run: NX_ALCHEMY_MAIN_API_KEY=$alchemyMain NX_ALCHEMY_FALLBACK_API_KEY=$alchemyFallback yarn nx build dhedge | ||
|
||
- name: Copy Firebase dHEDGE to Firebase | ||
run: cp firebase.dhedge.json firebase.json | ||
|
||
- name: Firebase deploy | ||
uses: FirebaseExtended/action-hosting-deploy@v0 | ||
with: | ||
repoToken: '${{ secrets.GITHUB_TOKEN }}' | ||
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_DHEDGE }}' | ||
expires: 30d | ||
projectId: dhedge-v1-withdraw | ||
channelId: dev |
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,47 @@ | ||
name: dHEDGE Main | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
env: | ||
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} | ||
|
||
jobs: | ||
build_and_publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
name: Checkout [main] | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-node@v3 | ||
name: Setup node | ||
with: | ||
node-version: 18 | ||
cache: 'yarn' | ||
|
||
- name: Install jq | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install jq | ||
- run: yarn install --frozen-lockfile | ||
name: Install dependencies | ||
|
||
- name: Build | ||
env: | ||
alchemyMain: ${{ secrets.ALCHEMY_MAIN_API_KEY }} | ||
alchemyFallback: ${{ secrets.ALCHEMY_FALLBACK_API_KEY }} | ||
run: NX_ALCHEMY_MAIN_API_KEY=$alchemyMain NX_ALCHEMY_FALLBACK_API_KEY=$alchemyFallback yarn nx build dhedge | ||
|
||
- name: Copy Firebase dHEDGE to Firebase | ||
run: cp firebase.dhedge.json firebase.json | ||
|
||
- name: Firebase deploy | ||
uses: FirebaseExtended/action-hosting-deploy@v0 | ||
with: | ||
repoToken: '${{ secrets.GITHUB_TOKEN }}' | ||
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_DHEDGE }}' | ||
projectId: dhedge-v1-withdraw | ||
channelId: live |
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,59 @@ | ||
name: dHEDGE preview | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- 'apps/dhedge/**' | ||
- 'libs/dhedge/**' | ||
- 'libs/shared/**' | ||
- 'package.json' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} | ||
|
||
jobs: | ||
build_and_publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
name: Checkout | ||
|
||
- uses: actions/setup-node@v3 | ||
name: Setup node | ||
with: | ||
node-version: 18 | ||
cache: 'yarn' | ||
|
||
- name: webfactory/ssh-agent | ||
uses: webfactory/[email protected] | ||
with: | ||
'ssh-private-key': '${{ secrets.SSH_PRIVATE_KEY }}' | ||
|
||
- name: Install jq | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install jq | ||
- run: yarn install --frozen-lockfile | ||
name: Install dependencies | ||
|
||
- name: Build | ||
env: | ||
alchemyMain: ${{ secrets.ALCHEMY_FALLBACK_API_KEY }} | ||
alchemyFallback: ${{ secrets.ALCHEMY_FALLBACK_API_KEY }} | ||
run: NX_ALCHEMY_MAIN_API_KEY=$alchemyMain NX_ALCHEMY_FALLBACK_API_KEY=$alchemyFallback yarn nx build dhedge | ||
|
||
- name: Copy Firebase dHEDGE to Firebase | ||
run: cp firebase.dhedge.json firebase.json | ||
|
||
- name: Firebase deploy | ||
uses: FirebaseExtended/action-hosting-deploy@v0 | ||
with: | ||
repoToken: '${{ secrets.GITHUB_TOKEN }}' | ||
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_DHEDGE }}' | ||
expires: 8d | ||
projectId: dhedge-v1-withdraw |
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,18 @@ | ||
{ | ||
"extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"], | ||
"ignorePatterns": ["!**/*"], | ||
"overrides": [ | ||
{ | ||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.ts", "*.tsx"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.js", "*.jsx"], | ||
"rules": {} | ||
} | ||
] | ||
} |
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,15 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>dHEDGE V1 Deprecation App</title> | ||
<base href="/" /> | ||
|
||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<link rel="icon" type="image/x-icon" href="/favicon.ico" /> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
</body> | ||
</html> |
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,99 @@ | ||
{ | ||
"name": "dhedge", | ||
"$schema": "../../node_modules/nx/schemas/project-schema.json", | ||
"sourceRoot": "apps/dhedge/src", | ||
"projectType": "application", | ||
"targets": { | ||
"build": { | ||
"executor": "@nrwl/vite:build", | ||
"outputs": ["{options.outputPath}"], | ||
"defaultConfiguration": "production", | ||
"options": { | ||
"outputPath": "dist/apps/dhedge", | ||
"dependsOn": ["^build", "i18n-compile"] | ||
}, | ||
"configurations": { | ||
"development": { | ||
"mode": "development" | ||
}, | ||
"production": { | ||
"mode": "production" | ||
} | ||
} | ||
}, | ||
"serve": { | ||
"executor": "@nrwl/vite:dev-server", | ||
"defaultConfiguration": "development", | ||
"options": { | ||
"buildTarget": "dhedge:build" | ||
}, | ||
"configurations": { | ||
"development": { | ||
"buildTarget": "dhedge:build:development", | ||
"hmr": true | ||
}, | ||
"production": { | ||
"buildTarget": "dhedge:build:production", | ||
"hmr": false | ||
} | ||
} | ||
}, | ||
"preview": { | ||
"executor": "@nrwl/vite:preview-server", | ||
"defaultConfiguration": "development", | ||
"options": { | ||
"buildTarget": "dhedge:build" | ||
}, | ||
"configurations": { | ||
"development": { | ||
"buildTarget": "dhedge:build:development" | ||
}, | ||
"production": { | ||
"buildTarget": "dhedge:build:production" | ||
} | ||
} | ||
}, | ||
"test": { | ||
"executor": "@nrwl/vite:test", | ||
"outputs": ["coverage/apps/dhedge"], | ||
"options": { | ||
"passWithNoTests": true, | ||
"reportsDirectory": "../../coverage/apps/dhedge" | ||
} | ||
}, | ||
"lint": { | ||
"executor": "@nrwl/linter:eslint", | ||
"outputs": ["{options.outputFile}"], | ||
"options": { | ||
"lintFilePatterns": ["apps/dhedge/**/*.{ts,tsx,js,jsx}"] | ||
} | ||
}, | ||
"i18n-extract": { | ||
"executor": "nx:run-commands", | ||
"options": { | ||
"commands": [ | ||
"yarn run formatjs extract 'apps/dhedge/src/**/*.{ts,tsx}' --out-file i18n-extractions/apps-dhedge.json --id-interpolation-pattern '[sha512:contenthash:base64:6]'" | ||
] | ||
} | ||
}, | ||
"i18n-clear": { | ||
"executor": "nx:run-commands", | ||
"options": { | ||
"commands": ["yarn rimraf i18n-extractions"] | ||
} | ||
}, | ||
"i18n-compile": { | ||
"executor": "nx:run-commands", | ||
"dependsOn": ["i18n-clear", "i18n-extract", "^i18n-extract"], | ||
"options": { | ||
"commands": [ | ||
"jq -rs 'reduce .[] as $item ({}; . * $item)' i18n-extractions/* > apps/dhedge/i18n/en.json", | ||
"yarn run formatjs compile apps/dhedge/i18n/en.json --ast --out-file apps/dhedge/src/assets/lang/en.json", | ||
"yarn run nx format:write --files apps/dhedge/src/assets/lang/*.json" | ||
], | ||
"parallel": false | ||
} | ||
} | ||
}, | ||
"tags": [] | ||
} |
Binary file not shown.
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,34 @@ | ||
import { Withdraw } from '@frontend/dhedge-withdraw'; | ||
import { Stack } from '@mui/material'; | ||
|
||
import { Footer } from './components/Footer'; | ||
import { Topnav } from './components/Topnav'; | ||
|
||
export const App = () => { | ||
return ( | ||
<Stack | ||
direction="column" | ||
sx={{ | ||
width: 1, | ||
height: 1, | ||
}} | ||
> | ||
<Topnav /> | ||
<Stack | ||
direction="column" | ||
sx={(theme) => ({ | ||
width: 1, | ||
height: 1, | ||
pb: { xs: 2, md: 4 }, | ||
px: theme.mixins.paddings.page.paddingX, | ||
minHeight: '84vh', | ||
})} | ||
> | ||
<Withdraw /> | ||
</Stack> | ||
<Footer | ||
sx={(theme) => ({ py: 4, px: theme.mixins.paddings.page.paddingX })} | ||
/> | ||
</Stack> | ||
); | ||
}; |
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,12 @@ | ||
import { initializeApp } from 'firebase/app'; | ||
|
||
const firebaseConfig = Object.freeze({ | ||
apiKey: 'AIzaSyBi3nU0ysQmIqPHumwSaaUzxq8i9xOuP_c', | ||
authDomain: 'apps-lts.firebaseapp.com', | ||
projectId: 'apps-lts', | ||
storageBucket: 'apps-lts.appspot.com', | ||
messagingSenderId: '558241704832', | ||
appId: '1:558241704832:web:baad7ec7c6061efdd32f65', | ||
measurementId: 'G-R1530ER4M9', | ||
}); | ||
export const firebaseApp = initializeApp(firebaseConfig); |
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,3 @@ | ||
export * from './react-query'; | ||
export * from './wagmi'; | ||
export * from './google-analytics'; |
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,15 @@ | ||
import { QueryClient } from '@tanstack/react-query'; | ||
|
||
const DEFAULT_STALE_TIME = 0; | ||
const DEFAULT_CACHE_TIME = 1000 * 60 * 60 * 24; // 24 hours | ||
|
||
export const reactQueryClient = new QueryClient({ | ||
defaultOptions: { | ||
queries: { | ||
refetchOnWindowFocus: false, | ||
staleTime: DEFAULT_STALE_TIME, | ||
cacheTime: DEFAULT_CACHE_TIME, | ||
retry: false, | ||
}, | ||
}, | ||
}); |
Oops, something went wrong.