Skip to content

Commit 0be311c

Browse files
committed
Merge branch 'staging' of github.com:hop-protocol/hop into production
2 parents 581e911 + b74343c commit 0be311c

Some content is hidden

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

45 files changed

+1540
-236
lines changed

.github/workflows/ui-deploy.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ jobs:
6868
REACT_APP_BLOCKLIST_ENABLED: ${{ vars.REACT_APP_BLOCKLIST_ENABLED }}
6969
REACT_APP_BNC_DAPP_ID: ${{ secrets.REACT_APP_BNC_DAPP_ID }}
7070
REACT_APP_GIT_SHA: ${{ github.sha }}
71+
REACT_APP_ENABLE_SOCKET: ${{ vars.REACT_APP_ENABLE_SOCKET }}
72+
REACT_APP_ENABLE_LIFI: ${{ vars.REACT_APP_ENABLE_LIFI }}
7173
run: pnpm --filter frontend... build
7274

7375
- name: Write commit file

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ pnpm install
3030
pnpm build
3131
```
3232

33+
Clean node_modules and build artifacts
34+
35+
```sh
36+
pnpm clean
37+
```
38+
3339
#### Guidelines for using PNPM workspaces
3440

3541
All commands should be run from the root of the monorepo.

packages/api/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,19 +116,19 @@ Example response
116116
Install dependencies
117117

118118
```sh
119-
npm install
119+
pnpm install
120120
```
121121

122122
Start server
123123

124124
```sh
125-
npm start
125+
pnpm start
126126
```
127127

128128
Build
129129

130130
```sh
131-
npm run build
131+
pnpm run build
132132
```
133133

134134
Available environment variables:

packages/explorer-backend/README.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,37 @@
44
55
## Development
66

7+
Install
8+
9+
```sh
10+
pnpm install
11+
```
12+
13+
Watch
14+
715
```sh
8-
npm run dev
16+
pnpm run dev
917
```
1018

1119
Serve
1220

21+
First run Postgres in seperate terminal:
22+
23+
```sh
24+
cd scripts/
25+
./postgres_dev.sh
26+
```
27+
28+
Then run the server
29+
1330
```sh
14-
npm start
31+
pnpm start
1532
```
1633

1734
Build
1835

1936
```sh
20-
npm run build
37+
pnpm run build
2138
```
2239

2340
Docker build

packages/explorer-frontend/README.md

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,47 @@ This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next
88

99
[https://explorer.hop.exchange/](https://explorer.hop.exchange/)
1010

11-
## Environment variables
11+
## Getting Started
12+
13+
First, run the development server:
14+
15+
```bash
16+
pnpm run dev
17+
```
18+
19+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
20+
21+
## Development
22+
23+
Install
1224

1325
```sh
14-
# (optional) specify tokens/chains to display on dropdowns
15-
NEXT_PUBLIC_ENABLED_TOKENS=USDC,USDT,DAI,MATIC,ETH,WBTC,HOP,SNX,sUSD,rETH,MAGIC
16-
NEXT_PUBLIC_ENABLED_CHAINS=ethereum,gnosis,polygon,arbitrum,optimism,nova,base,linea
26+
pnpm install
1727
```
1828

19-
## Getting Started
29+
Run dev server, connects to live API
2030

21-
First, run the development server:
31+
```bash
32+
pnpm run dev
33+
```
34+
35+
Run dev server, connects to local API from explorer-backend repo
2236

2337
```bash
24-
npm run dev
25-
# or
26-
yarn dev
38+
pnpm run dev:local
2739
```
2840

29-
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
41+
Build
42+
43+
```sh
44+
pnpm build
45+
```
46+
47+
Run built server
48+
49+
```sh
50+
pnpm start
51+
```
3052

3153
You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.
3254

packages/frontend/README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ PUBLIC_URL=.
3131
REACT_APP_IPFS_BUILD=true
3232
REACT_APP_ENABLED_CHAINS=ethereum,polygon,gnosis,optimism,arbitrum
3333
REACT_APP_ENABLED_TOKENS=ETH,USDC,USDT,DAI
34+
REACT_APP_DEPRECATED_POOLS=USDC.e,MAGIC
3435
REACT_APP_NETWORK=goerli
36+
37+
REACT_APP_ENABLE_SOCKET=false
38+
REACT_APP_ENABLE_LIFI=false
3539
```
3640

3741
To disable certain routes, use this environment variable, for example this disables gnosis→anyDestination anyToken route and optimism→arbitrum USDC route:
@@ -46,12 +50,14 @@ Build distribution build:
4650
pnpm build
4751
```
4852

53+
Allowed environment variable need be configured in `vite.config.ts` and in at the root `.github/workflows/ui-deploy.yml` for the build to work correctly.
54+
4955
## Deployments
5056

5157
| Branch | Network | URL | Release | Description |
5258
| ------------ | ------- | ---------------------------------------------------- | -------- | ------------------------------------------- |
5359
| `production` | mainnet | [app.hop.exchange](https://app.hop.exchange) | Stable | Production mainnet environment |
54-
| `mainnet` | mainnet | [mainnet.hop.exchange](https://mainnet.hop.exchange) | Beta | Mainnet pre-release environment |
55-
| `preprod` | mainnet | [preprod.hop.exchange](https://preprod.hop.exchange) | Beta | Alternative mainnet pre-release environment |
56-
| `develop` | mainnet | [dev.hop.exchange](https://dev.hop.exchange) | Unstable | Unstable mainnet staging environment |
57-
| `goerli` | kovan | [goerli.hop.exchange](https://goerli.hop.exchange) | Stable | Goerli staging environment |
60+
| `staging` | mainnet | [mainnet.hop.exchange](https://mainnet.hop.exchange) | Beta | Mainnet pre-release environment |
61+
| (deprecated) `preprod` | mainnet | [preprod.hop.exchange](https://preprod.hop.exchange) | Beta | Alternative mainnet pre-release environment |
62+
| (deprecated) `develop` | mainnet | [dev.hop.exchange](https://dev.hop.exchange) | Unstable | Unstable mainnet staging environment |
63+
| (deprecated) `goerli` | goerli | [goerli.hop.exchange](https://goerli.hop.exchange) | Stable | Goerli staging environment |

packages/frontend/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@hop-protocol/frontend",
3-
"version": "0.0.33",
3+
"version": "0.0.35",
44
"description": "Hop Protocol Frontend",
55
"author": "Authereum Labs, Inc.",
66
"license": "MIT",
@@ -20,13 +20,19 @@
2020
"deploy:local": "git stash && yarn build && yarn deploy"
2121
},
2222
"dependencies": {
23+
"@arbitrum/sdk": "4.0.3",
24+
"@consensys/linea-sdk": "0.1.6",
2325
"@emotion/react": "11.10.5",
2426
"@emotion/styled": "11.11.0",
27+
"@eth-optimism/sdk": "3.3.2",
2528
"@ethersproject/abi": "5.7.0",
2629
"@ethersproject/providers": "5.7.2",
2730
"@gnosis.pm/safe-apps-react-sdk": "4.6.2",
2831
"@gnosis.pm/safe-apps-sdk": "7.8.0",
2932
"@hop-protocol/sdk": "workspace:*",
33+
"@maticnetwork/maticjs": "3.5.0",
34+
"@maticnetwork/maticjs-ethers": "1.0.3",
35+
"@maticnetwork/maticjs-pos-zkevm": "npm:@maticnetwork/[email protected]",
3036
"@mui/icons-material": "5.15.6",
3137
"@mui/lab": "5.0.0-alpha.162",
3238
"@mui/material": "5.15.6",
@@ -69,13 +75,7 @@
6975
"use-async-memo": "1.2.4",
7076
"usehooks-ts": "2.9.1",
7177
"vite-plugin-svgr": "4.2.0",
72-
"web-vitals": "0.2.4",
73-
"@arbitrum/sdk": "3.4.1",
74-
"@eth-optimism/sdk": "3.3.2",
75-
"@maticnetwork/maticjs": "3.5.0",
76-
"@maticnetwork/maticjs-ethers": "1.0.3",
77-
"@maticnetwork/maticjs-pos-zkevm": "npm:@maticnetwork/[email protected]",
78-
"@consensys/linea-sdk": "0.1.6"
78+
"web-vitals": "0.2.4"
7979
},
8080
"devDependencies": {
8181
"@testing-library/jest-dom": "5.17.0",

packages/frontend/src/components/Header/TxPill.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import Box from '@mui/material/Box'
2-
import CircularProgress from '@mui/material/CircularProgress'
32
import React, { useEffect, useState } from 'react'
43
import { Circle } from '#components/ui/Circle.js'
54
import { Icon } from '#components/ui/Icon.js'
@@ -28,6 +27,8 @@ const useStyles = makeStyles(theme => ({
2827
},
2928
}))
3029

30+
const showPendingTxs = true
31+
3132
export const TxPill = () => {
3233
const { accountDetails, txHistory } = useApp()
3334
const transactions = txHistory?.transactions
@@ -52,9 +53,9 @@ export const TxPill = () => {
5253

5354
return (
5455
<div className={styles.root}>
55-
{numPendingTxs > 0 ? (
56+
{showPendingTxs && numPendingTxs > 0 ? (
5657
<StyledButton flat onClick={handleClick}>
57-
{numPendingTxs > 3 ? "3+" : numPendingTxs} Pending <CircularProgress size={18} className={styles.spinner} />
58+
{numPendingTxs > 3 ? "3+" : numPendingTxs} Pending
5859
</StyledButton>
5960
) : (
6061
<StyledButton

packages/frontend/src/config/config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,3 +120,6 @@ for (const chain in WaitConfirmations) {
120120
export { rpcProviderOverrides }
121121

122122
export const walletConnectProjectId = '651b16cdb6b0f490f68e0c4c5f5c35ce' // This is is meant to be public
123+
124+
export const enableSocket = process.env.REACT_APP_ENABLE_SOCKET === 'true'
125+
export const enableLifi = process.env.REACT_APP_ENABLE_LIFI === 'true'

packages/frontend/src/contexts/AppContext/AppContext.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import useTxHistory, { TxHistory } from '#contexts/AppContext/useTxHistory.js'
99
import { AccountDetails, useAccountDetails } from '#contexts/AppContext/useAccountDetails.js'
1010
import { Hop, HopBridge } from '@hop-protocol/sdk'
1111
import { TxConfirm, useTxConfirm } from '#contexts/AppContext/useTxConfirm.js'
12-
import { blocklist, reactAppNetwork, rpcProviderOverrides } from '#config/index.js'
12+
import { blocklist, reactAppNetwork, rpcProviderOverrides, enableSocket, enableLifi } from '#config/index.js'
1313
import { allNetworks as networks } from '#config/networks.js'
1414
import { useTheme } from '@mui/styles'
1515
import { useWeb3Context } from '#contexts/Web3Context.js'
@@ -41,7 +41,9 @@ const AppContextProvider: FC<{ children: ReactNode }> = ({ children }) => {
4141
blocklist,
4242
chainProviders: {
4343
...rpcProviderOverrides,
44-
}
44+
},
45+
enableSocket,
46+
enableLifi
4547
})
4648
return hop
4749
}, [provider])

0 commit comments

Comments
 (0)