Skip to content

Commit 747427a

Browse files
committed
merge helix-ui-2.0
1 parent e52387b commit 747427a

File tree

230 files changed

+41078
-59
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

230 files changed

+41078
-59
lines changed

.github/workflows/ci.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
7+
jobs:
8+
build:
9+
name: CI
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
14+
- name: Install
15+
run: npm install
16+
17+
- name: Lint and Test
18+
run: |
19+
npm run lint
20+
npm run test
21+
22+
- name: Build
23+
run: |
24+
npm run build:apps
25+
npm run build:apps:test

.github/workflows/deploy-dev.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Deploy development
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
deploy-package:
8+
name: Deploy package
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
13+
- uses: actions/checkout@v3
14+
with:
15+
repository: darwinia-network/devops
16+
path: .github
17+
18+
- uses: ./.github/actions/smart-vercel
19+
name: Deploy helix
20+
with:
21+
vercel_token: ${{ secrets.VERCEL_TOKEN }}
22+
vercel_group: itering
23+
preview_output: true
24+
alias_domain: "helix-dev"
25+
project_name: "helix-apps"
26+
script_run: false
27+
dist_path: .
28+
enable_notify_slack: true
29+
slack_channel: helix-ui
30+
slack_webhook: ${{ secrets.SLACK_INCOMING_WEBHOOK_URL }}
31+
32+
- uses: ./.github/actions/smart-vercel
33+
name: Deploy helix (test)
34+
with:
35+
vercel_token: ${{ secrets.VERCEL_TOKEN }}
36+
vercel_group: itering
37+
preview_output: true
38+
alias_domain: "helix-dev-test"
39+
project_name: "helix-apps-test"
40+
script_run: false
41+
dist_path: .
42+
enable_notify_slack: true
43+
slack_channel: helix-ui
44+
slack_webhook: ${{ secrets.SLACK_INCOMING_WEBHOOK_URL }}

.github/workflows/deploy-prd.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Deploy production
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
deploy-package:
10+
name: Deploy package
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- uses: actions/checkout@v3
16+
with:
17+
repository: darwinia-network/devops
18+
path: .github
19+
20+
- uses: ./.github/actions/smart-vercel
21+
name: Deploy helix
22+
with:
23+
vercel_token: ${{ secrets.VERCEL_TOKEN }}
24+
vercel_group: itering
25+
preview_output: true
26+
prod_mode: true
27+
project_name: "helix-apps"
28+
script_run: false
29+
dist_path: .
30+
enable_notify_slack: true
31+
slack_channel: helix-ui
32+
slack_webhook: ${{ secrets.SLACK_INCOMING_WEBHOOK_URL }}
33+
34+
- uses: ./.github/actions/smart-vercel
35+
name: Deploy helix (test)
36+
with:
37+
vercel_token: ${{ secrets.VERCEL_TOKEN }}
38+
vercel_group: itering
39+
preview_output: true
40+
alias_domain: "testnet.helixbridge.app"
41+
project_name: "helix-apps-test"
42+
script_run: false
43+
dist_path: .
44+
enable_notify_slack: true
45+
slack_channel: helix-ui
46+
slack_webhook: ${{ secrets.SLACK_INCOMING_WEBHOOK_URL }}

.github/workflows/deploy-stg.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Deploy staging
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
jobs:
9+
deploy-package:
10+
name: Deploy package
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- uses: actions/checkout@v3
16+
with:
17+
repository: darwinia-network/devops
18+
path: .github
19+
20+
- uses: ./.github/actions/smart-vercel
21+
name: Deploy helix
22+
with:
23+
vercel_token: ${{ secrets.VERCEL_TOKEN }}
24+
vercel_group: itering
25+
preview_output: true
26+
alias_domain: "helix-stg"
27+
project_name: "helix-apps"
28+
script_run: false
29+
dist_path: .
30+
enable_notify_slack: true
31+
slack_channel: helix-ui
32+
slack_webhook: ${{ secrets.SLACK_INCOMING_WEBHOOK_URL }}
33+
34+
- uses: ./.github/actions/smart-vercel
35+
name: Deploy helix (test)
36+
with:
37+
vercel_token: ${{ secrets.VERCEL_TOKEN }}
38+
vercel_group: itering
39+
preview_output: true
40+
alias_domain: "helix-stg-test"
41+
project_name: "helix-apps-test"
42+
script_run: false
43+
dist_path: .
44+
enable_notify_slack: true
45+
slack_channel: helix-ui
46+
slack_webhook: ${{ secrets.SLACK_INCOMING_WEBHOOK_URL }}

.gitignore

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
node_modules
5+
.pnp
6+
.pnp.js
7+
8+
# testing
9+
coverage
10+
11+
# next.js
12+
.next/
13+
.swc/
14+
out/
15+
16+
# production
17+
build
18+
dist
19+
20+
# misc
21+
.DS_Store
22+
*.pem
23+
24+
# debug
25+
npm-debug.log*
26+
yarn-debug.log*
27+
yarn-error.log*
28+
29+
# local env files
30+
.env*.local
31+
32+
# vercel
33+
.vercel
34+
35+
# typescript
36+
*.tsbuildinfo
37+
next-env.d.ts

.husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx lint-staged

.lintstagedrc.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const path = require("path");
2+
3+
const buildAppsEslintCommand = (filenames) =>
4+
`npm run lint -w apps -- --fix --file ${filenames.map((f) => path.relative("packages/apps", f)).join(" --file ")}`;
5+
6+
module.exports = {
7+
"packages/apps/src/**/*.{js,jsx,ts,tsx}": [buildAppsEslintCommand],
8+
"**/*.{js,jsx,ts,tsx,json}": "prettier --write",
9+
};

.prettierignore

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# dependencies
2+
node_modules
3+
.pnp
4+
.pnp.js
5+
6+
# testing
7+
coverage
8+
9+
# next.js
10+
.next/
11+
out/
12+
13+
# production
14+
build
15+
dist
16+
17+
# misc
18+
.DS_Store
19+
*.pem
20+
21+
# debug
22+
npm-debug.log*
23+
yarn-debug.log*
24+
yarn-error.log*
25+
26+
# local env files
27+
.env*.local
28+
29+
# vercel
30+
.vercel
31+
32+
# typescript
33+
*.tsbuildinfo
34+
next-env.d.ts

.prettierrc.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"printWidth": 120,
3+
"plugins": ["prettier-plugin-tailwindcss"]
4+
}

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 helix-bridge
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+9-59
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,18 @@
1-
# Helix Bridge
1+
# Helix Bridge UI
22

3-
## DEPLOYMENTS
3+
❤️ Perform cross-chain transfers through Helix Bridge.
44

55
### Production
66

7-
helix: https://helixbridge.app
8-
helix test: https://helix-apps-test.vercel.app
7+
- mainnet: https://helixbridge.app/
8+
- testnet: https://testnet.helixbridge.app/
99

1010
### Staging
1111

12-
helix: https://helix-stg.vercel.app
13-
helix test: https://helix-stg-test.vercel.app/
12+
- mainnet: https://helix-stg.vercel.app/
13+
- testnet: https://helix-stg-test.vercel.app/
1414

15-
## HOW TO ADD A BRIDGE
15+
### Development
1616

17-
### Step-1: Generate bridge
18-
19-
Go to `package/apps/` and run `yarn init:bridge`
20-
21-
Under the `bridges/[BRIDGE_TYPE]` folder, you will find a new bridge folder which created by the script
22-
23-
Update files below under the apps project:
24-
25-
1. `bridges/[BRIDGE_TYPE]/[YOU_BRIDGE]/model/bridge.ts` Update the generated type if needed
26-
1. `bridges/[BRIDGE_TYPE]/[YOU_BRIDGE]/config/bridge.ts` Update bridge configuration
27-
1. `config/bridge.ts` Add bridge to the corresponding bridge array.
28-
1. `bridges/bridges.ts` Add the bridge class to the constructor array.
29-
30-
### Step-2: Check network
31-
32-
`shared/config/network/` Add network configuration if needed:
33-
34-
1. `shared/model/network.ts` Update network type
35-
1. `shared/config/network/` Add network configuration
36-
1. `shared/config/theme.ts` Update theme configuration
37-
1. `shared/config/network/networks.ts` Add network
38-
39-
Make sure the token exists on the network configuration:
40-
41-
1. add the token config if not exist
42-
1. update the cross field for the token if exist
43-
44-
### Step-3: Unit test
45-
46-
Run `yarn test:apps:unit` under the project root, fix the failed test suits.
47-
48-
> After the steps above completed, you can find the tokens in the token selection list, and next what you need to do is complete the transfer function.
49-
50-
### Step-4: Complete bridge development
51-
52-
##### [YOUR BRIDGE]/*.tsx
53-
54-
Adjust the type parameter of <b>CrossToken</b>. <b>ChainConfig</b> is just a base type. You can find all supported chain types at <b>packages/shared/model/network/config.ts</b>
55-
56-
In most cases you do not need to modify this component, if you need to, feel free to do it here.
57-
58-
##### [YOUR BRIDGE]/utils/bridge.ts
59-
60-
Adjust the Bridge's second and third type parameters. <b>ChainConfig</b> is just a base type. You can find all supported chain types at <b>packages/shared/model/network/config.ts</b>
61-
62-
Implement the methods needed for the generated bridge class, this should be your main job.
63-
64-
### Step-5: Complete record detail page
65-
66-
If the bridge that you created is helix type, you will find a new record file created `pages/records/helix/[BRIDGE_NAME]/[id].tsx`, check and update the transfer process.
67-
68-
For other types of bridges, you can skip this step.
17+
- mainnet: https://helix-dev.vercel.app/
18+
- testnet: https://helix-dev-test.vercel.app/

0 commit comments

Comments
 (0)