Skip to content

Commit

Permalink
Release (#148)
Browse files Browse the repository at this point in the history
* fix: lp asset issue on new position form

* fix: wrong pool_id handing on manage_liquidity page

* fix: lint issue

* fix: style issue

* fix: style issue

* feat: add chain info in url

* fix: useQueriesDataSelector hooks

* feat: load pools without wallet connection

* fix: update logic of onChainChange function

* fix: remove duplicated coinhall api call

* fix: infinite loop issue on pools page

* fix: typo issue of error

* fix: update onChainChange function for wallet connect

* docs: replace secuirty email contacts

* fix: lp asset issue on new position form (#131)

* fix: lp asset issue on new position form

* fix: wrong pool_id handing on manage_liquidity page

* fix: lint issue

* fix: style issue

* fix: style issue

* fix: loading issue on vaults (#128)

* feat:add chain info on add_liquidity/manage_liquidity features (#134)

* feat: add chain info on manage_liquidity url

* feat: add chain info on new_position url

* feat: add chain info on new_position url

* feat: enhance pool routing with chain info

* feat: enhance new_position url with chain info

* fix: replace currentChainId with currentChainName

* feat: implement swap default tokens

* fix: minor lint and style issue

* fix: lint and style issue

* fix: swapform alignment issue (#135)

* fix:flashloan misalignment issue (#136)

* fix: misalignment issue of flashloan json editor form

* fix: vertical alignment issue

* feat: wallet auto connect (#142)

* feat: injective integration; Test and mainnet (#121)

* feat(inj): Start on inj integration

* feat: Add injective testnet chain_info and pools

* feat: Injective integration chain and pool; swaps not working yet

* fix: Update testnet rpc for now with one that has cors issues

* feat: Add other vaults and pools

* working simulation on injective

* feat: updates for injective client integration; also run prettier

* feat:injective poc, frontend not working yet but a tx was done

* injective added

* fix:inj to cw20 direct

* fix: Inj to cw20 direct, cw20 to inj and router txes

* fix: fix: multiple messages in post, cw20 swap

* feat: Prep for injective mainnet

* feat: Injective Mainnet info; swaps working, withdraw lp, balances

* fix: Provide and withdraw LP now working

* fix: Update DEFAULT_GAS to 2million

* fix: Remove injective poc stuff

* fix: reduce gas limit

* fixed swp rate message and injective catch error

* fix few issues listed in slack

* fix: Update decimal conversion on provide lp

* fix funds issue on LP

* clean console and fix  banner and loading state

* fix depost message on vault

* coming soon, coinhall and atom price off fix

* fix mange lp cta cutting off

* fix flashloan on injective

* fix: Update codeowners, there needs to be two

* fix: Run prettier to fixup code

Co-authored-by: Vinod Hum <[email protected]>

* feat: add mobile not support modal on mobile devices (#140)

* feat: add price field on injective pools (#141)

* feat: add price field on injective pools

* feat: add dollar sign

* feat: load pools without wallet connection

* fix: remove duplicated coinhall api call

* fix: infinite loop issue on pools page

* fix: minor issue

* chore: fix codeowners

* fix: lp asset issue on new position form (#131)

* fix: lp asset issue on new position form

* fix: wrong pool_id handing on manage_liquidity page

* fix: lint issue

* fix: style issue

* fix: style issue

* feat: add chain info on flash loan page

* feat: add chain info on flashloan page

* feat: add routes with chain info for swap and flashloan pages

* feat: add chain info on vault new_position and manage_position routes

* feat: fix lint and style issues

* chore: fix lint and style issue

* fix: implement dynamic routing from chain change

* fix: route redirection issue on vault depositForm

* chore: add / in vault routes

* fix: vault route redirection issue with chain info

* fix: routing issue on vaults/new_position and vaults/manage_position routes

* fix: swap routing issue

* fix: issue on pools/manage_liquidity route

* fix: routing issue

* feat: implement automatic wallet connect feature

* feat: improve chain auto change feature

* fix: routing issue on flashloan page

* fix: routing issue

* fix: update getPathName function

* fix: update pool routing

* fix: remove unused code

* fix: lint issue

* fix: new_position routing issue

* fix: vault/new_position routing issue

* fix: used code

* fix: vaults/manage_position issue

* fix: /vaults routing issue

* fix: routing issue on pools/manage_liquidity

* fix: update wallet auto connect feature

* fix: lint issue

* fix: default routing issue

* fix: add initial disconnect feature

* fix: remove unused code

* fix: rename inj to injective

* fix: update disconnect logic

* fix: pool loading issue

* fix: swap default token issue on testnet

* fix: error for chihuahua testnet

* fix: default token issue of new_position feature on testnet

* fix: update defaultToknes for new_position

* fix: lint issue

* fix: cosmwasm client init issue

Co-authored-by: 0xFable <[email protected]>
Co-authored-by: Vinod Hum <[email protected]>
Co-authored-by: sencom <[email protected]>

* leap integration (#147)

* leap integration

* fix multiple connect

* fix: logic of resetWalletConnection function

* fix: conflict and lint issues

* fix: price value issue on comdex pools

* fix: wallet reconnect issue

* fix: error message

* fix: wallet connect issue from page reload

* fix: redirect issue

* fix: remove dollar sign from comdex atom pool

* removed pools requted (#153)

* fix: leap wallet logo issue

* fix: leap wallet logo issue

* fix: typo issue on juno-axlUSDC pool

* fix: manage_liquidity routing issue

* fix: lint issue

* fix: add comdex default tokens

* fix: remove unused param

Co-authored-by: daiki saito <[email protected]>
Co-authored-by: optisman <[email protected]>
Co-authored-by: 0xFable <[email protected]>
Co-authored-by: Vinod Hum <[email protected]>
Co-authored-by: Chandra <[email protected]>
  • Loading branch information
6 people authored Jan 20, 2023
1 parent 2a9045e commit f19b85a
Show file tree
Hide file tree
Showing 79 changed files with 1,302 additions and 865 deletions.
4 changes: 2 additions & 2 deletions components/Layout/RadialGradient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ const backgrounds = {
'injective-888':
'linear-gradient(90deg, rgba(60, 205, 100, 0.25) 2.83%, rgba(82, 206, 252, 0.50) 97.47%)',
'comdex-1':
'linear-gradient(90deg, rgba(60, 205, 100, 0.25) 2.83%, rgba(250, 64, 74, 0.50) 97.47%)',
'linear-gradient(90deg, rgba(60, 205, 100, 0.25) 2.83%, rgba(250, 64, 74, 0.50) 97.47%)',
'comdex-test2':
'linear-gradient(90deg, rgba(60, 205, 100, 0.25) 2.83%, rgba(250, 64, 74, 0.50) 97.47%)',
'linear-gradient(90deg, rgba(60, 205, 100, 0.25) 2.83%, rgba(250, 64, 74, 0.50) 97.47%)',
}

const RadialGradient: FC = () => {
Expand Down
72 changes: 43 additions & 29 deletions components/Navbar/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
} from '@chakra-ui/react'
import { useWallet } from '@terra-money/wallet-provider'
import BurgerIcon from 'components/icons/BurgerIcon'
import { useChains } from 'hooks/useChainInfo'
import { useRecoilState } from 'recoil'
import { walletState, WalletStatusType } from 'state/atoms/walletAtoms'

Expand All @@ -25,51 +26,56 @@ import DrawerLink from './DrawerLink'
import Logo from './Logo'
import NavbarLink from './NavbarLink'

const links = [
{
lable: 'Swap',
link: '/swap',
},
{
lable: 'Pools',
link: '/pools',
},
{
lable: 'Flashloan',
link: '/flashloan',
},
{
lable: 'Vaults',
link: '/vaults',
},
// {
// lable: "Chart",
// link: "/chart"
// },
]

const Navbar = ({}) => {
const { disconnect } = useWallet()
const [{ key, chainId, network, activeWallet }, setWalletState] =
useRecoilState(walletState)
const chains = useChains()
const {
isOpen: isOpenModal,
onOpen: onOpenModal,
onClose: onCloseModal,
} = useDisclosure()
const { isOpen, onOpen, onClose } = useDisclosure()

function resetWalletConnection() {
const resetWalletConnection = () => {
setWalletState({
status: WalletStatusType.idle,
address: '',
key: null,
client: null,
network: network,
chainId: chainId,
activeWallet: 'keplr',
network,
chainId,
activeWallet: activeWallet || 'keplr',
})
disconnect()
}
const links = [
{
lable: 'Swap',
link: '/swap',
},
{
lable: 'Pools',
link: '/pools',
},
{
lable: 'Flashloan',
link: '/flashloan',
},
{
lable: 'Vaults',
link: '/vaults',
},
// {
// lable: "Chart",
// link: "/chart"
// },
]

const currenChain = chains.find((row) => row.chainId === chainId)
const currentChainName = currenChain?.label.toLowerCase()

return (
<Box py={{ base: '4', md: '10' }} px={{ base: '4', md: '10' }}>
Expand All @@ -85,10 +91,14 @@ const Navbar = ({}) => {
</Box>
<Card paddingX={10} gap={6}>
{links.map(({ lable, link }) => (
<NavbarLink key={lable} text={lable} href={link} />
<NavbarLink
key={lable}
text={lable}
href={`/${currentChainName}${link}`}
/>
))}
</Card>
<HStack flex="1" spacing="6" justify="flex-end" py="3">
<HStack flex="1" spacing="6" justify="flex-end">
<Wallet
connected={Boolean(key?.name)}
walletName={key?.name}
Expand All @@ -98,7 +108,11 @@ const Navbar = ({}) => {
onOpenModal={onOpenModal}
onCloseModal={onCloseModal}
/>
<WalletModal isOpenModal={isOpenModal} onCloseModal={onCloseModal} />
<WalletModal
isOpenModal={isOpenModal}
onCloseModal={onCloseModal}
chainId={chainId}
/>
</HStack>
</Flex>
<Flex
Expand Down
124 changes: 62 additions & 62 deletions components/Pages/Flashloan/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,73 +2,73 @@ import { Box } from '@chakra-ui/react'
import styled from '@emotion/styled'

const JSONEditorInput = styled(Box)`
/* dark styling of the editor */
.ace-jsoneditor .ace_scroller {
background-color: #1C1C1C;
}
.ace-jsoneditor .ace_gutter {
// background-color: #424242;
background-color: #1C1C1C;
color: #FAFAFA
}
div.jsoneditor-value.jsoneditor-string {
color: red;
}
.ace-jsoneditor .ace_marker-layer .ace_active-line, .ace-jsoneditor .ace_gutter-active-line {
// background: #3CCD64;
background: #1C1C1C;
color: #3CCD64 ;
}
.ace-jsoneditor .ace_cursor {
border-left : 2px solid #3CCD64
}
.ace-jsoneditor .ace_variable{
color: #FAFAFA;
}
.ace-jsoneditor .ace_marker-layer .ace_selection {
background: #3CCD64 ;
color: white;
}
.ace_fold-widget {
color: #3CCD64
}
div.jsoneditor, div.jsoneditor-menu {
border-color: #1C1C1C;
}
div.jsoneditor-value.jsoneditor-string, div.jsoneditor textarea.jsoneditor-text{
color: color: #FAFAFA;
}
.ace-jsoneditor .ace_string {
color : #3b8aee;
}
/* dark styling of the editor */
div.jsoneditor-value.jsoneditor-number {
color: #ee422e;
}
.ace-jsoneditor .ace_scroller {
background-color: #1C1C1C;
}
.ace-jsoneditor .ace_gutter {
// background-color: #424242;
background-color: #1C1C1C;
color: #FAFAFA
}
div.jsoneditor-value.jsoneditor-string {
color: red;
}
.ace-jsoneditor .ace_marker-layer .ace_active-line, .ace-jsoneditor .ace_gutter-active-line {
// background: #3CCD64;
background: #1C1C1C;
color: #3CCD64 ;
}
.ace-jsoneditor .ace_cursor {
border-left : 2px solid #3CCD64
}
.ace-jsoneditor .ace_variable{
color: #FAFAFA;
}
.ace-jsoneditor .ace_marker-layer .ace_selection {
background: #3CCD64 ;
color: white;
}
.ace_fold-widget {
color: #3CCD64
}
div.jsoneditor, div.jsoneditor-menu {
border-color: #1C1C1C;
}
div.jsoneditor-value.jsoneditor-string, div.jsoneditor textarea.jsoneditor-text{
color: color: #FAFAFA;
}
.ace-jsoneditor .ace_string {
color : #3b8aee;
}
div.jsoneditor-value.jsoneditor-boolean {
color: #ff8c00;
}
div.jsoneditor-value.jsoneditor-number {
color: #ee422e;
}
div.jsoneditor-value.jsoneditor-null {
color: #004ed0;
}
div.jsoneditor-value.jsoneditor-boolean {
color: #ff8c00;
}
div.jsoneditor-value.jsoneditor-color-value {
color: #1a1a1a;
}
div.jsoneditor-value.jsoneditor-null {
color: #004ed0;
}
div.jsoneditor-value.jsoneditor-color-value {
color: #1a1a1a;
}
div.jsoneditor-value.jsoneditor-invalid {
color: #1a1a1a;
}
.ace-jsoneditor .ace_indent-guide {
background: unset;
}
.ace-jsoneditor .ace_marker-layer .ace_bracket {
// bracket border
}
div.jsoneditor-value.jsoneditor-invalid {
color: #1a1a1a;
}
.ace-jsoneditor .ace_indent-guide {
background: unset;
}
.ace-jsoneditor .ace_marker-layer .ace_bracket {
// bracket border
margin-left: 0px;
margin-top: 0px;
}
`

type Props = {
Expand Down
17 changes: 16 additions & 1 deletion components/Pages/Flashloan/Flashloan.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
import { FC, useEffect } from 'react'

import { Box, HStack, Text, VStack } from '@chakra-ui/react'
import { useChains } from 'hooks/useChainInfo'
import { useRouter } from 'next/router'
import { useRecoilValue } from 'recoil'
import { walletState } from 'state/atoms/walletAtoms'

import FlashloanForm from './FlashloanForm'

const Flashloan = () => {
const Flashloan: FC = () => {
const { chainId } = useRecoilValue(walletState)
const router = useRouter()
const chains = useChains()
const chainIdParam = router.query.chainId as string
const currenChain = chains.find((row) => row.chainId === chainId)

if (!currenChain || currenChain.label.toLowerCase() !== chainIdParam)
return null

return (
<VStack width={{ base: '100%', md: '722px' }} alignItems="center">
<Box>
Expand Down
22 changes: 9 additions & 13 deletions components/Pages/Flashloan/FlashloanForm.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useEffect, useRef, useState, useMemo } from 'react'
import { useEffect, useMemo, useRef, useState } from 'react'
import { MdOutlineFormatIndentDecrease } from 'react-icons/md'

import { Box, Button, Flex, HStack, Text, VStack } from '@chakra-ui/react'
Expand Down Expand Up @@ -134,13 +134,11 @@ function FlashloanForm({}: Props) {
alignItems="center"
>
<Box>
<Text alignSelf="flex-start"> JSON to execute the trade</Text>
<Text alignSelf="flex-start">JSON to execute the trade</Text>
</Box>
{/* <Error message={error || tx?.error} /> */}
</HStack>

<Editor containerRef={containerRef} />

<HStack justify="space-between" width="full" p={4} alignItems="center">
<HStack>
<Button
Expand All @@ -152,15 +150,13 @@ function FlashloanForm({}: Props) {
</Button>
<UploadFile handleChange={handleChange} />
{/* <Button
variant='outline'
isLoading={
tx?.txStep == TxStep.Estimating
}
disabled={!!error}
onClick={() => tx?.simulate()}
>
{tx?.buttonLabel || 'Simulate'}
</Button> */}
variant="outline"
isLoading={tx?.txStep == TxStep.Estimating}
disabled={!!error}
onClick={() => tx?.simulate()}
>
{tx?.buttonLabel || 'Simulate'}
</Button> */}
</HStack>

<Button
Expand Down
2 changes: 1 addition & 1 deletion components/Pages/ManageLiquidity/DepositForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { WalletStatusType } from '../../../state/atoms/walletAtoms'
import { TokenItemState } from './lpAtoms'

type Props = {
connected: WalletStatusType
connected?: WalletStatusType
tokenA: TokenItemState
tokenB: TokenItemState
tx: any
Expand Down
Loading

0 comments on commit f19b85a

Please sign in to comment.