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

qs 2.0 ui #910

Merged
merged 57 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
0189ec3
Initial commit (via bun create)
chalabi2 Sep 20, 2023
faaa372
bun-qs
chalabi2 Sep 20, 2023
ae07994
update readme for bun
chalabi2 Sep 20, 2023
85bec5e
remove broken query call
chalabi2 Sep 20, 2023
0c684f1
add export
chalabi2 Sep 20, 2023
96e25dc
add deploy work flow
chalabi2 Sep 20, 2023
f00c30e
update deploy.yml
chalabi2 Sep 20, 2023
57dfed2
update deploy.yml
chalabi2 Sep 20, 2023
edeb140
syntax error
chalabi2 Sep 21, 2023
4bf0d7d
add homepage
chalabi2 Sep 21, 2023
dec1320
fix module exports
chalabi2 Sep 21, 2023
fbc3738
fix module export path for gh pages
chalabi2 Sep 21, 2023
26c8659
change image paths for gh pages
chalabi2 Sep 21, 2023
25185ac
center return button
chalabi2 Sep 21, 2023
b8e38e8
organize modal structure
chalabi2 Sep 21, 2023
96014b0
fix balance
chalabi2 Sep 21, 2023
6d1cf07
add bun server for potential backend
chalabi2 Sep 21, 2023
d0c6f7f
add
chalabi2 Sep 21, 2023
86908d0
remove yarn lock
chalabi2 Sep 21, 2023
1a09af7
*change network select menu *fix nav menu selection color change
chalabi2 Sep 22, 2023
d3c3f02
* Follow [issue](https://github.com/oven-sh/bun/issues/5891)
chalabi2 Sep 22, 2023
9ac66d9
remove useless ignore
chalabi2 Sep 22, 2023
9efd0b1
*swap to testnet
chalabi2 Sep 22, 2023
e9aa74e
rough swap to grpcGatewayClient
chalabi2 Sep 23, 2023
36347a3
add state management for intent tx
chalabi2 Sep 26, 2023
d5f3cc7
deploy test
chalabi2 Dec 4, 2023
14c8daf
deployment test
chalabi2 Dec 4, 2023
9bc31db
ignore errors
chalabi2 Dec 4, 2023
4fcd8b4
ts ignore
chalabi2 Dec 4, 2023
a94a7d6
add apr fetch
chalabi2 Dec 6, 2023
de84335
- add zone query
chalabi2 Dec 6, 2023
b50659d
- staking fixes
chalabi2 Dec 6, 2023
255dcca
fix inputs
chalabi2 Dec 7, 2023
496da23
working staking tx
chalabi2 Dec 7, 2023
4fb9f10
fix intent memo
chalabi2 Dec 7, 2023
134b9b5
- fix input number handling
chalabi2 Dec 7, 2023
398a964
finish stakingTx
chalabi2 Dec 8, 2023
de9e0d2
- custom weight updates
chalabi2 Dec 8, 2023
3a36016
- finish unstaking tx
chalabi2 Dec 9, 2023
94a6025
- start mobile
chalabi2 Dec 9, 2023
b38b1c2
- makeshit usechains
chalabi2 Dec 10, 2023
cdff067
- staking ui updates
chalabi2 Dec 10, 2023
7834184
- add mobile menu
chalabi2 Dec 10, 2023
662cc94
- gov revert
chalabi2 Dec 10, 2023
13548e7
update todo
chalabi2 Dec 10, 2023
ce047f6
update actions branch
chalabi2 Dec 10, 2023
e488fae
finish gov reversion
chalabi2 Dec 10, 2023
93525e9
- loading state ideas
chalabi2 Dec 11, 2023
b1a4d47
add rough assets page
chalabi2 Dec 16, 2023
faa4e53
finish assets mock
chalabi2 Dec 17, 2023
788f085
- asset page components
chalabi2 Dec 18, 2023
f691186
portfolio box queries
chalabi2 Dec 19, 2023
6972625
fix portfolio percentages
chalabi2 Dec 19, 2023
b7ae469
portfolio stuff
chalabi2 Dec 19, 2023
ffe6cab
move into folder that is now empty in qs repo
faddat Dec 19, 2023
2042644
Merge remote-tracking branch 'fadui/faddat/movement' into HEAD
faddat Dec 19, 2023
212940e
add chalabi's work with the commit history
faddat Dec 19, 2023
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
1 change: 0 additions & 1 deletion .github/workflows/buildtest.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# This is a basic workflow that is manually triggered

name: build and test

# Controls when the action will run. Workflow runs when manually triggered using the UI
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/testuideploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Test Deploy to GitHub Pages

on:
push:
paths:
- web-ui/**

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3

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

- name: Install Dependencies
run: bun install

- name: Build Project
run: bun run build

- name: Export Project
run: bun export

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./out
12 changes: 12 additions & 0 deletions web-ui/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
NEXT_PUBLIC_CHAIN_ENV="preprod"
NEXT_PUBLIC_QUICKSILVER_API="https://lcd.quicksilver.zone"
NEXT_PUBLIC_QUICKSILVER_DATA_API="https://data.quicksilver.zone"
ZONE_URL="quicksilver.zone"
REACT_APP_WHITELISTED_ZONES="osmosis-1,stargaze-1,regen-1,cosmoshub-4,sommelier-3"
REACT_APP_ENABLE_UNBONDING="true"
REACT_APP_ENABLE_SET_INTENT="true"
REACT_APP_ENABLE_CLAIMS="true"
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"
21 changes: 21 additions & 0 deletions web-ui/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"extends": "next/core-web-vitals",
"plugins": ["import"],
"rules": {
"import/order": [
"error",
{
"groups": [
["builtin", "external"],
"internal",
["parent", "sibling", "index"]
],
"newlines-between": "always",
"alphabetize": {
"order": "asc",
"caseInsensitive": true
}
}
]
}
}
37 changes: 37 additions & 0 deletions web-ui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env*.local
.vscode

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
7 changes: 7 additions & 0 deletions web-ui/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"semi": true,
"trailingComma": "all",
"singleQuote": true,
"printWidth": 140,
"tabWidth": 2
}
19 changes: 19 additions & 0 deletions web-ui/LISCENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Unauthorized production use of this software, via any platform, is strictly prohibited.

Proprietary and confidential.

Terms and Conditions:

1. You may not use, modify, copy, or distribute this software with the intent to launch it publicly without express written permission from the author.

2. You may not reverse-engineer, decompile, or disassemble the software.

3. You may not sublicense or create derivative works based on the software.

4. Use of this software without agreement to these terms is unauthorized use and subject to legal action.

5. The author makes no warranties or representations about the software's fitness for any particular purpose. You use the software at your own risk.

Contact Information:

For permission to use the software or any other inquiries, contact the author at [email protected].
64 changes: 64 additions & 0 deletions web-ui/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
This is the Quicksilver Liquid Staking App bootstrapped with [`create-cosmos-app`](https://github.com/cosmology-tech/create-cosmos-app) and re-templated to work with Bun.

## Getting Started

First, install the packages and run the development server:

```bash
bun install && bun run dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the webpage.

## Making Contributions

Please work on a branch with a title that reflects what you aim to contribute and open a pull request to the `main` branch.

### Dependencies

Please use this Prettier config to format your code before opening a pull request.

```
{
"semi": true,
"trailingComma": "all",
"singleQuote": true,
"printWidth": 80,
"tabWidth": 2
}

```

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

### Development ToDo

**Staking Page**

- figure out a better way to fit the custom weight Ui into the modal.

- need to handle number displays better, sometimes they show NaN or undefined but quickly render

- need to update any QS endpoints that will potentially be outdated with the coming of 1.4

**UI/UX**

- customize wallet connect modal

- threejs liquid metal sphere landing page

- Mobile breakpoints

**Defi**

- design

- build

**Assets**

- design

- build

**Mobile Menu**
Binary file added web-ui/bun.lockb
Binary file not shown.
174 changes: 174 additions & 0 deletions web-ui/components/Assets/assetsGrid.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
import { Box, SimpleGrid, VStack, Text, Button, Divider, useColorModeValue, HStack, Flex, Grid, GridItem } from '@chakra-ui/react';
import React from 'react';

interface AssetCardProps {
assetName: string;
balance: string;
apy: string;
nativeAssetName: string;
}

const AssetCard: React.FC<AssetCardProps> = ({ assetName, balance, apy, nativeAssetName }) => {
return (
<VStack bg={'rgba(255,255,255,0.1)'} p={4} boxShadow="lg" align="center" spacing={4} borderRadius="lg">
<VStack w="full" align="center" alignItems={'center'} spacing={3}>
<HStack w="full" justify="space-between">
<Text fontWeight="bold" fontSize={'xl'} isTruncated>
{assetName}
</Text>
<HStack>
<Text fontSize="xs" fontWeight="light" isTruncated>
APY:
</Text>
<Text fontSize="md" fontWeight="bold" isTruncated>
{apy}
</Text>
</HStack>
</HStack>
<Divider />
<Grid mt={4} templateColumns="repeat(2, 1fr)" gap={4} w="full">
<GridItem>
<Text fontSize="md" textAlign="left">
ON QUICKSILVER:
</Text>
</GridItem>
<GridItem>
<Text fontSize="md" textAlign="right" fontWeight="semibold">
{balance}
</Text>
</GridItem>
<GridItem>
<Text fontSize="md" textAlign="left">
NON-NATIVE:
</Text>
</GridItem>
<GridItem>
<Text fontSize="md" textAlign="right" fontWeight="semibold">
{balance}
</Text>
</GridItem>
</Grid>
</VStack>

<HStack borderBottom="1px" borderBottomColor="complimentary.900" w="full" pb={4} pt={4} spacing={2}>
<Button
_active={{
transform: 'scale(0.95)',
color: 'complimentary.800',
}}
_hover={{
bgColor: 'rgba(255,128,0, 0.25)',
color: 'complimentary.300',
}}
color="white"
flex={1}
size="sm"
variant="outline"
>
Deposit
</Button>
<Button
_active={{
transform: 'scale(0.95)',
color: 'complimentary.800',
}}
_hover={{
bgColor: 'rgba(255,128,0, 0.25)',
color: 'complimentary.300',
}}
color="white"
flex={1}
size="sm"
variant="outline"
>
Withdraw
</Button>
</HStack>
<HStack w="full" justify="space-between">
<VStack>
<Text fontWeight="bold" fontSize={'xl'} isTruncated>
{nativeAssetName}
</Text>
<Divider />
</VStack>
<VStack>
<Text fontSize="md" fontWeight="bold" isTruncated></Text>
<Text fontSize="xs" fontWeight="light" isTruncated></Text>
</VStack>
</HStack>
<Grid templateColumns="repeat(2, 1fr)" gap={4} w="full">
<GridItem>
<Text fontSize="md" textAlign="left">
ON QUICKSILVER:
</Text>
</GridItem>
<GridItem>
<Text fontSize="md" textAlign="right" fontWeight="semibold">
{balance}
</Text>
</GridItem>
</Grid>
<HStack w="full" pb={4} pt={4} spacing={2}>
<Button
_active={{
transform: 'scale(0.95)',
color: 'complimentary.800',
}}
_hover={{
bgColor: 'rgba(255,128,0, 0.25)',
color: 'complimentary.300',
}}
flex={1}
size="sm"
variant="solid"
>
Deposit
</Button>
<Button
_active={{
transform: 'scale(0.95)',
color: 'complimentary.800',
}}
_hover={{
bgColor: 'rgba(255,128,0, 0.25)',
color: 'complimentary.300',
}}
flex={1}
size="sm"
variant="solid"
>
Withdraw
</Button>
</HStack>
</VStack>
);
};

const AssetsGrid = () => {
const assets = [
{ name: 'qATOM', balance: '0.123', apy: '12.34%', native: 'ATOM' },
{ name: 'qREGEN', balance: '0.123', apy: '12.34%', native: 'REGEN' },
{ name: 'qOSMO', balance: '0.123', apy: '12.34%', native: 'OSMO' },
{ name: 'qSTARS', balance: '0.123', apy: '12.34%', native: 'STARS' },
{ name: 'qSOMM', balance: '0.123', apy: '12.34%', native: 'SOMM' },
];

return (
<>
<Text fontSize="xl" fontWeight="bold" color="white" mb={4}>
Assets (qAssets + Native Balance)
</Text>
<Box overflowX="auto" w="full">
<Flex gap="8">
{assets.map((asset, index) => (
<Box key={index} minW="350px">
{' '}
<AssetCard assetName={asset.name} nativeAssetName={asset.native} balance={asset.balance} apy={asset.apy} />
</Box>
))}
</Flex>
</Box>
</>
);
};
export default AssetsGrid;
Loading
Loading