Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addDydx #1113

Merged
merged 53 commits into from
Mar 21, 2024
Merged

addDydx #1113

Show file tree
Hide file tree
Changes from 51 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
05b0887
fix mobile margin
chalabi2 Jan 24, 2024
0557410
fix margin on staking page
chalabi2 Jan 24, 2024
39a59ab
add more margin to mobile top
chalabi2 Jan 25, 2024
8ee5b15
more mobile resizing, filter intents when <= 0
chalabi2 Jan 25, 2024
29720c4
lint
chalabi2 Jan 25, 2024
3d767fa
better wallet connection messages for assets & gov
chalabi2 Jan 25, 2024
7ac336b
fix
chalabi2 Jan 25, 2024
0feaade
lint
chalabi2 Jan 25, 2024
df0690f
fix title on gov mobile page
chalabi2 Jan 25, 2024
3b3a896
fix wallet errors re add install messages
chalabi2 Jan 26, 2024
c2cac40
sort by APY desc on initial load
chalabi2 Jan 30, 2024
0ab73b3
Merge branch 'main' into fixMobileMargin
Jan 30, 2024
7720749
workflow changes
Jan 30, 2024
7fc6a68
remove unused imports
Jan 30, 2024
ef79d83
add unbonding warning, add revoke option for tokenized shares
chalabi2 Jan 31, 2024
732ccd7
debun, add dydx, add lsm controller
chalabi2 Feb 3, 2024
ce50d4b
fix all errors, double check ignores, broken gov queries
chalabi2 Feb 3, 2024
f60b22d
Add Dydx
chalabi2 Feb 5, 2024
2ecc776
remove unused constants
chalabi2 Feb 5, 2024
685fc4c
remove top validator buttons
chalabi2 Feb 5, 2024
c35c96c
lint
chalabi2 Feb 5, 2024
b70656b
* remove unused assets
chalabi2 Feb 6, 2024
a73276b
restore some images
chalabi2 Feb 6, 2024
b315104
lint
chalabi2 Feb 6, 2024
6290b79
fix random chain-registry bug
chalabi2 Feb 6, 2024
dd737a0
fix ibc
chalabi2 Feb 6, 2024
fc28ed3
increase gas, add times to unbonding table
chalabi2 Feb 6, 2024
c859544
fix gov tx
chalabi2 Feb 7, 2024
c7dc4b0
begin gas estimation, revert interchain-query
chalabi2 Feb 7, 2024
29d6a43
Merge branch 'main' into addDydx
faddat Feb 7, 2024
7ca3760
Merge branch 'main' into addDydx
faddat Feb 24, 2024
a14951d
make back button larger, make reselect validators more clickable
chalabi2 Mar 8, 2024
e7d6458
fix validator table border styles
chalabi2 Mar 8, 2024
57aeb9b
show no matches found for unmatched search term
chalabi2 Mar 8, 2024
346659d
swap to last_redemption_rate for unstaking
chalabi2 Mar 8, 2024
ed93257
better handling for redemption amount
chalabi2 Mar 9, 2024
92ff258
remove unused result const + directly await tx
chalabi2 Mar 9, 2024
1d235b8
codeRabbit suggestions + github security comments
chalabi2 Mar 9, 2024
fb868b9
TODO: fix quicksilverjs to support enable/disable lsm
chalabi2 Mar 9, 2024
983dfcc
remove comment
chalabi2 Mar 11, 2024
92658e8
lint
chalabi2 Mar 11, 2024
946b6a6
readd .env wallet connect
chalabi2 Mar 11, 2024
d68bb47
finalize dydx
chalabi2 Mar 20, 2024
5b93273
fix lsm queries
chalabi2 Mar 21, 2024
fa30679
lint
chalabi2 Mar 21, 2024
0d5f3e0
build
chalabi2 Mar 21, 2024
18256e8
remove xcc warnings
chalabi2 Mar 21, 2024
7190b13
Merge branch 'main' into addDydx
Mar 21, 2024
2793bc4
add dydx unstake notice, fix qasset amount
Mar 21, 2024
2ec0349
fix build issue
Mar 21, 2024
d1cfc90
fix proof_type field
Mar 21, 2024
f577d18
fix proof_type case
Mar 21, 2024
be4ba44
fix proof_ops case
Mar 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions .github/workflows/buildweb.yaml

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/deploytestweb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Web UI Dev Deployment
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
on:
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened]

jobs:
Deploy-Dev:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Vercel CLI
run: npm install --global vercel@^33.2.0 # Replace with the current major version

- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest # or specify a version

- name: Pull Vercel Environment Information
run: vercel pull --yes --token=${{ secrets.VERCEL_TOKEN }}

- name: Build Project Artifacts
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}

- name: Deploy to Vercel Action
uses: BetaHuhn/deploy-to-vercel-action@v1
with:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
ALIAS_DOMAINS: |
{BRANCH}.app-dev.quicksilver.zone
PR_PREVIEW_DOMAIN: "pr-{PR}.app-dev.quicksilver.zone"

65 changes: 0 additions & 65 deletions .github/workflows/devWebUiDeploy.yaml

This file was deleted.

10 changes: 7 additions & 3 deletions web-ui/.env
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,20 @@ NEXT_PUBLIC_MAINNET_LCD_ENDPOINT_SOMMELIER="https://lcd.sommelier-3.quicksilver.
NEXT_PUBLIC_MAINNET_RPC_ENDPOINT_SOMMELIER="https://rpc.sommelier-3.quicksilver.zone"
NEXT_PUBLIC_MAINNET_LCD_ENDPOINT_JUNO="https://lcd.juno-1.quicksilver.zone"
NEXT_PUBLIC_MAINNET_RPC_ENDPOINT_JUNO="https://rpc.juno-1.quicksilver.zone"
NEXT_PUBLIC_MAINNET_LCD_ENDPOINT_DYDX="https://lcd.dydx-mainnet-1.quicksilver.zone"
NEXT_PUBLIC_MAINNET_RPC_ENDPOINT_DYDX="https://rpc.dydx-mainnet-1.quicksilver.zone"
NEXT_PUBLIC_QUICKSILVER_API="https://lcd.quicksilver.zone"
NEXT_PUBLIC_QUICKSILVER_DATA_API="https://data.quicksilver.zone"
ZONE_URL="quicksilver.zone"
APY_ZONES_ENDPOINT = "https://chains.cosmos.directory"
NEXT_PUBLIC_OSMOSIS_API="https://api.osmosis.zone"
NEXT_PUBLIC_WHITELISTED_DENOM="uatom,ustars,uosmo,usomm,uregen"
NEXT_PUBLIC_WHITELISTED_ZONES="osmosis-1,stargaze-1,regen-1,cosmoshub-4,sommelier-3"
NEXT_PUBLIC_WHITELISTED_DENOM="uatom,ustars,uosmo,usomm,uregen,ujuno,udydx"
NEXT_PUBLIC_WHITELISTED_ZONES="osmosis-1,stargaze-1,regen-1,cosmoshub-4,sommelier-3,juno-1,dydx-mainnet-1"
NEXT_PUBLIC_COSMOSHUB_CHAIN_ID=cosmoshub-4
NEXT_PUBLIC_OSMOSIS_CHAIN_ID=osmosis-1
NEXT_PUBLIC_STARGAZE_CHAIN_ID=stargaze-1
NEXT_PUBLIC_REGEN_CHAIN_ID=regen-1
NEXT_PUBLIC_SOMMELIER_CHAIN_ID=sommelier-3
NEXT_PUBLIC_JUNO_CHAIN_ID=juno-1
NEXT_PUBLIC_JUNO_CHAIN_ID=juno-1
NEXT_PUBLIC_DYDX_CHAIN_ID=dydx-mainnet-1
NEXT_PRIVATE_WALLET_CONNECT_TOKEN="41a0749c331d209190beeac1c2530c90"
26 changes: 17 additions & 9 deletions web-ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,33 @@ Please use this Prettier config to format your code before opening a pull reques

Please ensure your IDE is configured to use Typescript v4.9.3

### Development ToDo
### TODO:

**Governance**
**Staking**

- [ ] Add support for Dymension
- [ ] Add more weight options IE `equal`, `custom`, `most votes`, `lowest commission` etc
- [x] Make back button in staking modal larger
- [x] Fix skeleton spam when searching for non existent validator in staking modal

- add liquid staked governance (when its built)
**Governance**

**UI/UX**

- focus on mobile landscape breakpoints, (mainly staking page)
- [ ] Double check breakpoints

**Mobile Menu**

- graphic elements
- [ ] improve mobile menu

**DevOps**

- make onboarding networks seamless
- [ ] Add doc for adding networks

**Has Blockers**

- [ ] Build liquid governance page

**Blockers**
**Assets**

- main net reward current & epoch queries
- update grantee address in query & tx
- [ ] Fix the way queries for networks and entries in components are created. Rather than defining one for each network, create a function that iterates through the .env entry or liveNetworks call for live networks and creates the queries and components for each. `pages/assets.tsx`
134 changes: 134 additions & 0 deletions web-ui/addNetworks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
# Adding Networks

This document will guide you through the process of adding networks to the web UI.

## Table of Contents

- [.env](#.env)
- [Files](#files)
- [Queries](#queries)
- [Components](#components)

### .env

You will need to add a couple of environment variables to the `.env` file in the root of the project. These variables are used to configure the networks that are available to the user and the endpoints that the web UI will use to interact with the blockchain.

**Example .env file additions**

```bash
NEXT_PUBLIC_MAINNET_LCD_ENDPOINT_NETWORK_NAME="REST_ENDPOINT" # change `NETWORK_NAME`, `REST_ENDPOINT` to the name & endpoint of the network you are adding.
NEXT_PUBLIC_MAINNET_RPC_ENDPOINT_NETWORK_NAME="RPC_ENDPOINT" # change `NETWORK_NAME` and `RPC_ENDPOINT` to the name & endpoint of the network you are adding.

NEXT_PUBLIC_WHITELISTED_DENOM="uatom,ustars,uosmo,usomm,uregen,ujuno,udydx,NEW_UDENOM" # change `NEW_UDENOM` to the appropriate denom for the network you are adding.
NEXT_PUBLIC_WHITELISTED_ZONES="osmosis-1,stargaze-1,regen-1,cosmoshub-4,sommelier-3,juno-1,dydx-mainnet-1,NEW_CHAIN_ID" # change `NEW_CHAIN_ID` to the appropriate chain_id for the network you are adding.

NEXT_PUBLIC_CHAIN_NAME_CHAIN_ID="CHAIN_ID" # change `CHAIN_ID` to the appropriate chain_id for the network you are adding.
```

### Files

There are various files that will require updates to add a new network to the web UI. These files include:

- `hooks/useGrpcQueryClient.ts`
- `hooks/useRpcQueryClient.ts`
- `pages/_app.tsx`
-

### Queries & Signing

The web UI uses tanstack react-query for data fetching and cosmology for query client building. You will need to add a new entry in `hooks/useGrpcQueryClient.ts` & `hooks/useRpcQueryClient.ts` in order to fetch data for your additional network.

Here we rely on the entries in the `.env` file to determine which endpoint to use for the network we are fetching data for so be sure to use the correct endpoint or the query will be broken.

**Example useGrpcQueryClient.ts**

```typescript
const endpoints: { [key: string]: string | undefined } = {
quicksilver:
env === 'testnet' ? process.env.NEXT_PUBLIC_TESTNET_LCD_ENDPOINT_QUICKSILVER : process.env.NEXT_PUBLIC_MAINNET_LCD_ENDPOINT_QUICKSILVER,
cosmoshub:
env === 'testnet' ? process.env.NEXT_PUBLIC_TESTNET_LCD_ENDPOINT_COSMOSHUB : process.env.NEXT_PUBLIC_MAINNET_LCD_ENDPOINT_COSMOSHUB,
sommelier:
env === 'testnet' ? process.env.NEXT_PUBLIC_TESTNET_LCD_ENDPOINT_SOMMELIER : process.env.NEXT_PUBLIC_MAINNET_LCD_ENDPOINT_SOMMELIER,
stargaze:
env === 'testnet' ? process.env.NEXT_PUBLIC_TESTNET_LCD_ENDPOINT_STARGAZE : process.env.NEXT_PUBLIC_MAINNET_LCD_ENDPOINT_STARGAZE,
regen: env === 'testnet' ? process.env.NEXT_PUBLIC_TESTNET_LCD_ENDPOINT_REGEN : process.env.NEXT_PUBLIC_MAINNET_LCD_ENDPOINT_REGEN,
osmosis: env === 'testnet' ? process.env.NEXT_PUBLIC_TESTNET_LCD_ENDPOINT_OSMOSIS : process.env.NEXT_PUBLIC_MAINNET_LCD_ENDPOINT_OSMOSIS,
juno: env === 'testnet' ? process.env.NEXT_PUBLIC_TESTNET_LCD_ENDPOINT_JUNO : process.env.NEXT_PUBLIC_MAINNET_LCD_ENDPOINT_JUNO,
dydx: env === 'testnet' ? process.env.NEXT_PUBLIC_TESTNET_LCD_ENDPOINT_DYDX : process.env.NEXT_PUBLIC_MAINNET_LCD_ENDPOINT_DYDX,
NEW_NETWORK:
env === 'testnet' ? process.env.NEXT_PUBLIC_TESTNET_LCD_ENDPOINT_NEW_NETWORK : process.env.NEXT_PUBLIC_MAINNET_LCD_ENDPOINT_NEW_NETWORK,
};
```

**Example useRpcQueryClient.ts**

```typescript
const endpoints: { [key: string]: string | undefined } = {
quicksilver: env === 'testnet' ? process.env.TESTNET_RPC_ENDPOINT_QUICKSILVER : process.env.MAINNET_RPC_ENDPOINT_QUICKSILVER,
cosmoshub: env === 'testnet' ? process.env.TESTNET_RPC_ENDPOINT_COSMOSHUB : process.env.MAINNET_RPC_ENDPOINT_COSMOSHUB,
sommelier: env === 'testnet' ? process.env.TESTNET_RPC_ENDPOINT_SOMMELIER : process.env.MAINNET_RPC_ENDPOINT_SOMMELIER,
stargaze: env === 'testnet' ? process.env.TESTNET_RPC_ENDPOINT_STARGAZE : process.env.MAINNET_RP_ENDPOINTC_STARGAZE,
regen: env === 'testnet' ? process.env.TESTNET_RPC_ENDPOINT_REGEN : process.env.MAINNET_RPC_ENDPOINT_REGEN,
osmosis: env === 'testnet' ? process.env.TESTNET_RPC_ENDPOINT_OSMOSIS : process.env.MAINNET_RPC_ENDPOINT_OSMOSIS,
juno: env === 'testnet' ? process.env.TESTNET_RPC_ENDPOINT_JUNO : process.env.MAINNET_RPC_ENDPOINT_JUNO,
dydx: env === 'testnet' ? process.env.TESTNET_RPC_ENDPOINT_DYDX : process.env.MAINNET_RPC_ENDPOINT_DYDX,
NEW_NETWORK: env === 'testnet' ? process.env.TESTNET_RPC_ENDPOINT_NEW_NETWORK : process.env.MAINNET_RPC_ENDPOINT_NEW_NETWORK,
};
```

For signing we must update the `pages/_app.tsx` file to include the new network in the `ChainProvider` `endpointOptions` array. This array is used to determine which endpoints to use.

```typescript
endpointOptions={{
isLazy: true,
endpoints: {
quicksilver: {
rpc: [rpcEndpoints.quicksilver ?? ''],
rest: [lcdEndpoints.quicksilver ?? ''],
},
quicksilvertestnet: {
rest: ['https://lcd.test.quicksilver.zone/'],
rpc: ['https://rpc.test.quicksilver.zone'],
},
cosmoshub: {
rpc: [rpcEndpoints.cosmoshub ?? ''],
rest: [lcdEndpoints.cosmoshub ?? ''],
},
sommelier: {
rpc: [rpcEndpoints.sommelier ?? ''],
rest: [lcdEndpoints.sommelier ?? ''],
},
stargaze: {
rpc: [rpcEndpoints.stargaze ?? ''],
rest: [lcdEndpoints.stargaze ?? ''],
},
regen: {
rpc: [rpcEndpoints.regen ?? ''],
rest: [lcdEndpoints.regen ?? ''],
},
osmosis: {
rpc: [rpcEndpoints.osmosis ?? ''],
rest: [lcdEndpoints.osmosis ?? ''],
},
osmosistestnet: {
rpc: [rpcEndpoints.osmosis ?? ''],
rest: [lcdEndpoints.osmosis ?? ''],
},
umee: {
rpc: ['https://rpc-umee-ia.cosmosia.notional.ventures/'],
rest: ['https://api-umee-ia.cosmosia.notional.ventures/'],
},
dydx: {
rpc: [rpcEndpoints.dydx ?? ''],
rest: [lcdEndpoints.dydx ?? ''],
},
NEW_NETWORK: {
rpc: [rpcEndpoints.NEW_NETWORK ?? ''],
rest: [lcdEndpoints.NEW_NETWORK ?? ''],
},
},
}}
```

### Components
Binary file modified web-ui/bun.lockb
Binary file not shown.
Loading
Loading