diff --git a/components/common/Header.tsx b/components/common/Header.tsx index 53beed3..47fe438 100644 --- a/components/common/Header.tsx +++ b/components/common/Header.tsx @@ -1,15 +1,19 @@ -import { Link, Box, Button, Icon, Text, useTheme, useColorModeValue } from '@interchain-ui/react'; -import { dependencies } from '@/config'; +import { + Box, + Button, + Icon, + Text, + useColorModeValue, + useTheme, +} from "@interchain-ui/react"; -const stacks = ['Cosmos Kit', 'Next.js']; - -const osmojs = dependencies[0]; +const stacks = ["Cosmos Kit", "Next.js"]; export function Header() { const { theme, setTheme } = useTheme(); const toggleColorMode = () => { - setTheme(theme === 'light' ? 'dark' : 'light'); + setTheme(theme === "light" ? "dark" : "light"); }; return ( @@ -23,7 +27,7 @@ export function Header() { }} onClick={toggleColorMode} > - + @@ -31,9 +35,9 @@ export function Header() { Create Cosmos App @@ -41,32 +45,19 @@ export function Header() { Welcome to  - {stacks.join(' + ')} - {' + '} - - - {osmojs.name} - + {stacks.join(" + ")} ); -} \ No newline at end of file +} diff --git a/components/index.tsx b/components/index.tsx index d177e9d..99302e1 100644 --- a/components/index.tsx +++ b/components/index.tsx @@ -1,4 +1,3 @@ -export * from './swap'; -export * from './common'; -export * from './wallet'; -export * from './Main'; \ No newline at end of file +export * from "./common"; +export * from "./wallet"; +export * from "./Main"; diff --git a/components/swap/Swap.tsx b/components/swap/Swap.tsx deleted file mode 100644 index a082daa..0000000 --- a/components/swap/Swap.tsx +++ /dev/null @@ -1,110 +0,0 @@ -import BigNumber from 'bignumber.js'; -import { Box, Divider, Spinner, useColorModeValue } from '@interchain-ui/react'; -import { Swap as ISwap } from '@/hooks'; -import { - Token, - TokenList, - SwapButton, - SwapFromTo, - SwapDetails, - SwapSlippage, - SwapInfoProps, - SwapRouteStep, -} from '.'; - -export type SwapProps = { - from?: Token; - to?: Token; - swap: ISwap; - info: SwapInfoProps; - steps: SwapRouteStep[]; - tokens: TokenList; - amount?: string; - loading?: boolean; - swapping?: boolean; - slippage?: number; - buttonText?: string; - buttonDisabled?: boolean; - onFlip?: () => void; - onToChange?: (token: Token) => void; - onFromChange?: (token: Token) => void; - onSwapButtonClick?: () => void; - onAmountChange?: (amount: string) => void; - onSlippageChange?: (tolerance: number) => void; -}; - -export function Swap({ - from = {} as Token, - to = {} as Token, - swap, - info, - steps = [], - tokens, - amount = '0', - loading = false, - swapping = false, - slippage, - buttonText = 'Swap', - buttonDisabled = false, - onFlip = () => {}, - onToChange = () => {}, - onFromChange = () => {}, - onAmountChange = () => {}, - onSwapButtonClick = () => {}, - onSlippageChange = () => {}, -}: SwapProps) { - const isDetailsExpandable = new BigNumber(amount).gt(0) && Boolean(info); - - return ( - - - - - - - - - - - ); -} diff --git a/components/swap/SwapButton.tsx b/components/swap/SwapButton.tsx deleted file mode 100644 index 1e9337f..0000000 --- a/components/swap/SwapButton.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import { Button } from '@interchain-ui/react'; - -export type SwapButtonProps = { - text?: string - disabled?: boolean - onClick?: () => void -} - -export function SwapButton({ - text = 'Swap', - disabled = false, - onClick = () => {}, -}: SwapButtonProps) { - return ( - - ) -} \ No newline at end of file diff --git a/components/swap/SwapDetails.tsx b/components/swap/SwapDetails.tsx deleted file mode 100644 index 4a420a5..0000000 --- a/components/swap/SwapDetails.tsx +++ /dev/null @@ -1,45 +0,0 @@ -import { useState } from 'react'; -import { Box, IconButton } from '@interchain-ui/react'; -import { Token, SwapPrice, SwapRoute, SwapRouteStep, SwapInfo, SwapInfoProps } from '.'; - -export type SwapDetailsProps = { - to: Token; - from: Token; - info: SwapInfoProps; - steps: SwapRouteStep[]; - expandable?: boolean -} - -export function SwapDetails({ - to, - from, - info = {} as SwapInfoProps, - steps = [], - expandable = false -}: SwapDetailsProps) { - const [isOpen, setIsOpen] = useState(false); - - return ( - - - - setIsOpen(v => !v)} - intent={isOpen ? "tertiary" : "text"} - /> - - - - - - - ) -} \ No newline at end of file diff --git a/components/swap/SwapFromTo.tsx b/components/swap/SwapFromTo.tsx deleted file mode 100644 index fcc5528..0000000 --- a/components/swap/SwapFromTo.tsx +++ /dev/null @@ -1,89 +0,0 @@ -import { useState } from 'react'; -import { Box, Stack, IconButton, IconName, useColorModeValue } from '@interchain-ui/react'; -import { Token, TokenList, SwapTokenInput } from '.'; -import { Swap } from '@/hooks'; - -export type SwapFromToProps = { - from: Token - to: Token - swap: Swap - tokens: TokenList - amount?: string - onFlip?: () => void - onToChange?: (token: Token) => void - onFromChange?: (token: Token) => void - onAmountChange?: (amount: string) => void -} - -export function SwapFromTo({ from, to, swap, tokens, amount = '0', onFlip, onToChange, onFromChange, onAmountChange = () => {} }: SwapFromToProps) { - return ( - - onAmountChange(String(Number(from.amount) / 2))} - onMaxButtonClick={() => onAmountChange(String(from.amount))} - onTokenSelected={onFromChange} - onAmountChange={onAmountChange} - /> - - - - - - ) -} - -export type SwapSwitchProps = { - onClick?: () => void -} - -export function SwapSwitch({ - onClick = () => {}, -}) { - const [icon, setIcon] = useState("arrowDownLine") - return ( - - - setIcon("arrowLeftRightLine")} - onHoverEnd={() => setIcon("arrowDownLine")} - /> - - - ) -} \ No newline at end of file diff --git a/components/swap/SwapInfo.tsx b/components/swap/SwapInfo.tsx deleted file mode 100644 index 28e5b4a..0000000 --- a/components/swap/SwapInfo.tsx +++ /dev/null @@ -1,47 +0,0 @@ -import { Box, Text, Stack } from '@interchain-ui/react'; - -export type SwapInfoProps = { - priceImpact: string; - swapFee: { - value: string; - percent: string; - }; - expectedOutput: string; - minimumReceived?: string; -}; - -export function SwapInfo({ - swapFee, - priceImpact, - expectedOutput, - minimumReceived, -}: SwapInfoProps) { - return ( - - - Price Impact - - {priceImpact} - - - - Swap Fee ({swapFee?.percent}) - - {swapFee?.value} - - - - Expected Output - - {expectedOutput} - - - - Minimum received after slippage - - {minimumReceived} - - - - ); -} diff --git a/components/swap/SwapPrice.tsx b/components/swap/SwapPrice.tsx deleted file mode 100644 index ff4eb69..0000000 --- a/components/swap/SwapPrice.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import BigNumber from 'bignumber.js'; -import { Box, Text, Stack } from '@interchain-ui/react'; -import { Token } from '.'; - -export type SwapPriceProps = { - from: Token - to: Token -} - -export function SwapPrice({ - from, to -}: SwapPriceProps) { - - const n = from.price && to.price - ? new BigNumber(from.price).dividedBy(to.price).decimalPlaces(6).toString() - : '...' - - return ( - - Price - { from.price && to.price ? - - - {`1 ${from.symbol} = ${n} ${to.symbol}`} - - - ~ ${`${from.price}`} - - : null} - - ) -} \ No newline at end of file diff --git a/components/swap/SwapRoute.tsx b/components/swap/SwapRoute.tsx deleted file mode 100644 index bb354b0..0000000 --- a/components/swap/SwapRoute.tsx +++ /dev/null @@ -1,67 +0,0 @@ -import { Fragment } from 'react'; -import { Box, Text, Stack, useColorModeValue } from '@interchain-ui/react'; -import { Token } from '.'; - -export type SwapRouteStep = { - poolId: string; - swapFee: string; - base: Token; - quote: Token; -}; - -export type SwapRouteProps = { - from: Token; - to: Token; - steps?: SwapRouteStep[]; -}; - -export function SwapRoute({ from, to, steps = [] }: SwapRouteProps) { - return ( - - - Route - - - - {from.symbol} - - - {steps.map((route: SwapRouteStep) => ( - // @ts-ignore - - - {route.base.symbol} - - {route.quote.symbol} - - - - {route?.swapFee} - - - - ))} - - {to.symbol} - - - - ); -} - -export function Dashes() { - return ( - - ) -} diff --git a/components/swap/SwapSlippage.tsx b/components/swap/SwapSlippage.tsx deleted file mode 100644 index 5627cde..0000000 --- a/components/swap/SwapSlippage.tsx +++ /dev/null @@ -1,73 +0,0 @@ -import { useState } from 'react'; -import { Box, Text, Stack, Button, IconButton } from '@interchain-ui/react'; -import { Slippages } from '.'; - -export type SwapSlippageProps = { - slippage?: number; - slippages?: number[]; - onChange?: (tolerance: number) => void; -} - -export function SwapSlippage(props: SwapSlippageProps) { - return ( - - Slippage tolerance - - - ) -} - -export function SwapSlippageTolerance({ - slippage = 1, - slippages = Slippages, - onChange, -}: SwapSlippageProps) { - const [isOpen, setIsOpen] = useState(false); - - function onSlippageChange(slippage: number) { - setIsOpen(false); - onChange?.(slippage); - } - - return ( - - - - {slippage}% - - setIsOpen(true)} /> - - - - - {slippages.map((percent) => ( - - ))} - - setIsOpen(false)} /> - - - - ) -} \ No newline at end of file diff --git a/components/swap/SwapTokenInput.tsx b/components/swap/SwapTokenInput.tsx deleted file mode 100644 index 6b5aa61..0000000 --- a/components/swap/SwapTokenInput.tsx +++ /dev/null @@ -1,155 +0,0 @@ -import { useTheme, Box, Text, Stack, Button, ButtonProps, ChainSwapCombobox, ComboboxOption, useColorModeValue } from '@interchain-ui/react'; -import { Token } from '.'; - -export function AmountButton({ children, onClick }: ButtonProps) { - const attrs = { - style: { - color: '#fff', - backgroundColor: useColorModeValue('#A2AEBB', '#434B55') - } - }; - return ( - - ) -} - -export type SwapTokenInputProps = { - token?: Token - tokens?: Token[] - title?: string - amount?: string - $value?: string - disabled?: boolean - balanceLabel?: string - showBalance?: boolean - showMaxButton?: boolean - showHalfButton?: boolean - onAmountChange?: (amount: string) => void - onTokenSelected?: (token: Token) => void - onMaxButtonClick?: () => void - onHalfButtonClick?: () => void -} - -export function SwapTokenInput({ - title = '', - token= {} as Token, - tokens = [], - amount = '0', - $value = '$0', - disabled = false, - balanceLabel = 'Available', - showBalance = false, - showMaxButton = false, - showHalfButton = false, - onAmountChange = () => {}, - onTokenSelected = () => {}, - onMaxButtonClick = () => {}, - onHalfButtonClick = () => {}, -}: SwapTokenInputProps) { - const options = tokens.map(({ logo, chain, amount, symbol, $value }) => ({ - amount, - iconUrl: logo, - name: chain?.pretty_name, - tokenName: symbol, - notionalValue: $value, - })) as ComboboxOption[] - - const { colorMode } = useTheme(); - - const current = token?.denom ? { - amount: token.amount, - iconUrl: token.logo, - name: token.chain?.pretty_name, - tokenName: token.symbol, - notionalValue: token.$value, - } as ComboboxOption : options[0] - - function onItemSelected(item: ComboboxOption) { - onTokenSelected(tokens.find(({ symbol }) => symbol === item.tokenName) as Token) - } - - const addon = ( - - {disabled - ? {amount} - : onAmountChange(e.target.value)} - style={{ - width: '100%', - fontFamily: 'monospace', - color: colorMode === 'dark' ? 'rgb(238, 242, 248)' : 'rgb(44, 49, 55)', - border: 0, outline: 'none', - appearance: 'none', - fontSize: '22px', - textAlign: 'right', - background: 'transparent' - }} - /> - } - - - {`≈ ${$value}`} - - - - ) - - return ( - - - {title} - - {showBalance ? <> - - {balanceLabel} - - - {token.amount} - - : null} - - {showHalfButton ? Half : null} - {showMaxButton ? Max : null} - - - - - {options.length > 0 ? - - - : null} - - ) -} \ No newline at end of file diff --git a/components/swap/index.ts b/components/swap/index.ts deleted file mode 100644 index 62174e0..0000000 --- a/components/swap/index.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { Coin } from '@cosmjs/stargate'; -import { Asset, Chain } from '@chain-registry/types'; -import { CoinDenom } from '@osmonauts/math/types'; - -export * from './Swap'; -export * from './SwapInfo'; -export * from './SwapPrice'; -export * from './SwapRoute'; -export * from './SwapButton'; -export * from './SwapFromTo'; -export * from './SwapDetails'; -export * from './SwapSlippage'; -export * from './SwapTokenInput'; - -export const Slippages = [1, 2.5, 3, 5]; - -export type Token = { - logo?: string - denom: string - asset?: Asset - chain?: Chain - price?: number - symbol: string - amount?: string - value?: string - $value?: string - balance?: Coin -} - -export type TokenList = Token[] & { - rest: Token[] - hash: Record -} \ No newline at end of file diff --git a/config/assets.ts b/config/assets.ts deleted file mode 100644 index 0f8f467..0000000 --- a/config/assets.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { chains } from 'chain-registry'; -import { Asset } from '@chain-registry/types'; -import { Denom } from '@chain-registry/utils'; -import { CoinGeckoId } from '@/hooks'; -import { defaultChainName } from '@/config'; -import { asset_lists } from "@chain-registry/assets" -import { assets } from "chain-registry" - -export type Assets = Asset[] & { - WithCoinGeckoId: Asset[]; - CoinGeckoIds: CoinGeckoId[]; - CoinDenomToAsset: Record; - CoinGeckoIdToAsset: Record; -} - -let osmosisAssets: Asset[] = [] -// assets from @chain-registry/assets -const chainInfo = asset_lists.find(({ chain_name }) => chain_name === 'osmosis') -if (Array.isArray(chainInfo?.assets)) { - osmosisAssets = [...chainInfo?.assets] -} -// assets from chain-registry -let chainInfo2 = assets.find(({ chain_name }) => chain_name === 'osmosis') -if (Array.isArray(chainInfo2?.assets)) { - osmosisAssets = [...osmosisAssets, ...chainInfo2.assets] -} - -export const OsmosisAssets = [ - ...osmosisAssets -].filter(({ type_asset }) => type_asset !== 'ics20') as Assets; - -OsmosisAssets.WithCoinGeckoId = OsmosisAssets - .filter(({ coingecko_id }) => Boolean(coingecko_id)); - -OsmosisAssets.CoinGeckoIds = OsmosisAssets.WithCoinGeckoId - .map(({ coingecko_id }) => coingecko_id) as CoinGeckoId[]; - -OsmosisAssets.CoinGeckoIdToAsset = OsmosisAssets.WithCoinGeckoId - .reduce((cache, asset) => ({ ...cache, [asset.coingecko_id!]: asset }), {}) - -OsmosisAssets.CoinDenomToAsset = OsmosisAssets - .reduce((cache, asset) => ({ ...cache, [asset.base]: asset }), {}); - -function getChainByDenom(denom: Denom) { - let chainName = ''; - if (chainInfo2?.assets.find(({ base }) => base === denom)) { - chainName = defaultChainName; - } else { - const asset = chainInfo?.assets.find(({ base }) => base === denom); - chainName = asset?.traces?.[0].counterparty.chain_name || ''; - } - return chainName - ? chains.find(({ chain_name }) => chain_name === chainName) - : null -} - -export const Osmosis = { - getChainByDenom, - Assets: OsmosisAssets -} \ No newline at end of file diff --git a/config/index.ts b/config/index.ts index e2c8846..8156f2d 100644 --- a/config/index.ts +++ b/config/index.ts @@ -1,3 +1 @@ -export * from './assets'; -export * from './defaults'; -export * from './projects'; \ No newline at end of file +export * from "./defaults"; diff --git a/config/projects.ts b/config/projects.ts deleted file mode 100644 index 5ef45ef..0000000 --- a/config/projects.ts +++ /dev/null @@ -1,56 +0,0 @@ -export type Project = { - name: string; - desc: string; - link: string; -} - -export const products: Project[] = [ - { - name: 'Cosmos Kit', - desc: 'A wallet adapter for react with mobile WalletConnect support for the Cosmos ecosystem.', - link: 'https://github.com/cosmology-tech/cosmos-kit', - }, - { - name: 'Telescope', - desc: 'A TypeScript Transpiler for Cosmos Protobufs to generate libraries for Cosmos blockchains.', - link: 'https://github.com/cosmology-tech/telescope', - }, - { - name: 'TS Codegen', - desc: 'The quickest and easiest way to convert CosmWasm Contracts into dev-friendly TypeScript classes.', - link: 'https://github.com/CosmWasm/ts-codegen', - }, - { - name: 'CosmWasm Academy', - desc: 'Master CosmWasm and build your secure, multi-chain dApp on any CosmWasm chain!', - link: 'https://academy.cosmwasm.com/', - }, - { - name: 'Chain Registry', - desc: 'Get chain and asset list information from the npm package for the Official Cosmos chain registry.', - link: 'https://github.com/cosmology-tech/chain-registry', - }, - { - name: 'Videos', - desc: 'How-to videos from the official Cosmology website, with learning resources for building in Cosmos.', - link: 'https://cosmology.zone/learn', - }, -]; - -export const dependencies: Project[] = [ - { - name: 'OsmoJS', - desc: 'OsmosJS makes it easy to compose and broadcast Osmosis and Cosmos messages', - link: 'https://github.com/osmosis-labs/osmojs', - }, - { - name: 'Interchain UI', - desc: 'A simple, modular and cross-framework Component Library for Cosmos', - link: 'https://cosmology.zone/components', - }, - { - name: 'Next.js', - desc: 'A React Framework supports hybrid static & server rendering.', - link: 'https://nextjs.org/', - }, -]; diff --git a/hooks/index.ts b/hooks/index.ts index bdedc52..f349c46 100644 --- a/hooks/index.ts +++ b/hooks/index.ts @@ -1,10 +1,5 @@ -export * from './useTx'; -export * from './useSwap'; -export * from './usePools'; -export * from './usePrices'; -export * from './useBalances'; -export * from './useQueryHooks'; - +export * from "./useBalances"; +export * from "./useTx"; // Fix TypeError: Do not know how to serialize a BigInt // cosmos.bank.v1beta1.useAllBalances({ @@ -21,4 +16,4 @@ export function paginate(limit = 100n, offset = 0n) { countTotal: true, reverse: false, }; -} \ No newline at end of file +} diff --git a/hooks/usePools.ts b/hooks/usePools.ts deleted file mode 100644 index 616dcab..0000000 --- a/hooks/usePools.ts +++ /dev/null @@ -1,171 +0,0 @@ -import { UseQueryResult } from '@tanstack/react-query'; -import { PriceHash } from '@osmonauts/math/types'; -// import { Pool } from 'osmo-query/dist/codegen/osmosis/gamm/pool-models/balancer/balancerPool'; -import { Pool } from 'osmojs/osmosis/gamm/v1beta1/balancerPool' -import { defaultChainName, Osmosis } from "@/config"; -import { paginate, useQueryHooks } from "@/hooks"; - -export type Pools = ReturnType; - -export type PoolList = Pool[] & { - priced: Pool[]; -} - -export function usePools(prices: PriceHash = {}) { - const { osmosis, isReady } = useQueryHooks(defaultChainName); - const query: UseQueryResult<{ pools: Pool[] }> = osmosis.gamm.v1beta1.usePools( - { - request: { - pagination: paginate(5000n), - }, - options: { - enabled: isReady, - staleTime: Infinity, - }, - } - ); - - const all = query.data?.pools || []; - const map = all.reduce((map, pool) => (map.set(pool.id, pool)), new Map()) - const stableswap = all.filter(({ $typeUrl }) => $typeUrl?.includes('stableswap')) || []; - const freefloat = (all.filter(({ $typeUrl }) => !$typeUrl?.includes('stableswap')) || []) as PoolList; - - freefloat.priced = freefloat.filter(({ poolAssets }) => - poolAssets.every(({ token }) => - prices[token.denom] && Osmosis.Assets.CoinDenomToAsset[token.denom])); - - return { query, all, map, freefloat, stableswap } -} - -// What query.data looks like: -// { -// "pools": [ -// { -// "$typeUrl": "/osmosis.gamm.v1beta1.Pool", -// "address": "osmo1mw0ac6rwlp5r8wapwk3zs6g29h8fcscxqakdzw9emkne6c8wjp9q0t3v8t", -// "id": "1", -// "poolParams": { -// "swapFee": "0.002", -// "exitFee": "0" -// }, -// "futurePoolGovernor": "24h", -// "totalShares": { -// "denom": "gamm/pool/1", -// "amount": "111821403347144698250152229" -// }, -// "poolAssets": [ -// { -// "token": { -// "denom": "ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2", -// "amount": "818861561574" -// }, -// "weight": "536870912000000" -// }, -// { -// "token": { -// "denom": "uosmo", -// "amount": "22649818509522" -// }, -// "weight": "536870912000000" -// } -// ], -// "totalWeight": "1073741824000000" -// }, -// { -// "$typeUrl": "/osmosis.gamm.v1beta1.Pool", -// "address": "osmo1500hy75krs9e8t50aav6fahk8sxhajn9ctp40qwvvn8tcprkk6wszun4a5", -// "id": "2", -// "poolParams": { -// "swapFee": "0.005", -// "exitFee": "0" -// }, -// "futurePoolGovernor": "24h", -// "totalShares": { -// "denom": "gamm/pool/2", -// "amount": "177673458733981827330189071" -// }, -// "poolAssets": [ -// { -// "token": { -// "denom": "uion", -// "amount": "453966264" -// }, -// "weight": "858993459200000" -// }, -// { -// "token": { -// "denom": "uosmo", -// "amount": "89600840294" -// }, -// "weight": "214748364800000" -// } -// ], -// "totalWeight": "1073741824000000" -// }, -// { -// "$typeUrl": "/osmosis.gamm.v1beta1.Pool", -// "address": "osmo1c9gj5nwxhuh2gz7wwg4r8e8tw8v7ggy9lh2hu7kkdgh0t450754qh9cpvd", -// "id": "3", -// "poolParams": { -// "swapFee": "0.002", -// "exitFee": "0" -// }, -// "futurePoolGovernor": "24h", -// "totalShares": { -// "denom": "gamm/pool/3", -// "amount": "53836098892478268478896011" -// }, -// "poolAssets": [ -// { -// "token": { -// "denom": "ibc/1480B8FD20AD5FCAE81EA87584D269547DD4D436843C1D20F15E00EB64743EF4", -// "amount": "551533931292" -// }, -// "weight": "536870912000000" -// }, -// { -// "token": { -// "denom": "uosmo", -// "amount": "1972439451246" -// }, -// "weight": "536870912000000" -// } -// ], -// "totalWeight": "1073741824000000" -// }, -// ... -// { -// "$typeUrl": "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool", -// "address": "osmo1ccjfm7gpa37mc9zwq553p0ttzq3ga5g6jzarz37lcq4qlnsdcxhsghcv3y", -// "id": "810", -// "poolParams": { -// "swapFee": "0.003", -// "exitFee": "0" -// }, -// "futurePoolGovernor": "", -// "totalShares": { -// "denom": "gamm/pool/810", -// "amount": "1917808387404168955247" -// }, -// "poolLiquidity": [ -// { -// "denom": "ibc/5DD1F95ED336014D00CE2520977EC71566D282F9749170ADC83A392E0EA7426A", -// "amount": "12905697414911" -// }, -// { -// "denom": "ibc/987C17B11ABC2B20019178ACE62929FE9840202CE79498E29FE8E5CB02B7C0A4", -// "amount": "12760839351518" -// } -// ], -// "scalingFactors": [ -// "100000", -// "136789" -// ], -// "scalingFactorController": "osmo1k8c2m5cn322akk5wy8lpt87dd2f4yh9afcd7af" -// }, -// ], -// "pagination": { -// "nextKey": {}, -// "total": "1115" -// } -// } \ No newline at end of file diff --git a/hooks/usePrices.ts b/hooks/usePrices.ts deleted file mode 100644 index 536fefa..0000000 --- a/hooks/usePrices.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { useQuery, UseQueryResult } from "@tanstack/react-query"; -import { DenomPriceMap } from '@chain-registry/utils'; -import { Osmosis } from "@/config"; - -export type CoinGeckoId = string; -export type CoinGeckoPrice = { usd: number }; -export type CoinGeckoResponse = Record; -// What CoinGeckoResponse looks like: -// { -// "agoric": { -// "usd": 0.088756 -// }, -// "cosmos": { -// "usd": 6.22 -// }, -// "white-whale": { -// "usd": 0.0110436 -// } -// } - -async function fetchPrices(coinGeckoIds: CoinGeckoId[]): Promise { - const url = `https://api.coingecko.com/api/v3/simple/price?ids=${coinGeckoIds.join()}&vs_currencies=usd`; - return await fetch(url).then((res) => res.json()); -} - -function toPriceHash(prices: CoinGeckoResponse = {}): DenomPriceMap { - return Object.entries(prices).reduce((result, [id, price]) => ({ - ...result, - [Osmosis.Assets.CoinGeckoIdToAsset[id]!.base]: price.usd, - }), {}); -} - -export function usePrices() { - const query = useQuery({ - queryKey: ['prices'], - queryFn: () => fetchPrices(Osmosis.Assets.CoinGeckoIds), - staleTime: Infinity - }); - - return { query, ...toPriceHash(query.data) } as DenomPriceMap & { query: UseQueryResult }; -} - -// Waht prices: PriceHash looks like: -// { -// "ibc/2DA9C149E9AD2BD27FEFA635458FB37093C256C1A940392634A16BEA45262604": 0.089011, -// "ibc/BB0AFE2AFBD6E883690DAE4B9168EAC2B306BCC9C9292DACBB4152BBB08DB25F": 0.01194281, -// ... -// "uion": 75.55, -// "uosmo": 0.228555 -// } \ No newline at end of file diff --git a/hooks/useQueryHooks.ts b/hooks/useQueryHooks.ts deleted file mode 100644 index ffaadd2..0000000 --- a/hooks/useQueryHooks.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { useChain } from '@cosmos-kit/react'; -import { useRpcClient, useRpcEndpoint, createRpcQueryHooks } from 'osmo-query'; - -export function useQueryHooks(chainName: string, extraKey?: string) { - const { address, getRpcEndpoint } = useChain(chainName); - - const rpcEndpointQuery = useRpcEndpoint({ - getter: getRpcEndpoint, - options: { - enabled: Boolean(address), - staleTime: Infinity, - queryKeyHashFn: (queryKey) => - JSON.stringify([...queryKey, chainName].concat(extraKey ? [extraKey] : [])), - } - }); - - const rpcClientQuery = useRpcClient({ - rpcEndpoint: rpcEndpointQuery.data || '', - options: { - enabled: Boolean(address) && Boolean(rpcEndpointQuery.data), - staleTime: Infinity, - queryKeyHashFn: (queryKey) => - JSON.stringify(JSON.stringify(extraKey ? [...queryKey, extraKey] : queryKey)) - } - }); - - const { cosmos, osmosis } = createRpcQueryHooks({ - rpc: rpcClientQuery.data - }); - - const isReady = Boolean(address) && Boolean(rpcClientQuery.data); - const isFetching = rpcEndpointQuery.isFetching || rpcClientQuery.isFetching; - - return { cosmos, osmosis, isReady, isFetching } -} \ No newline at end of file diff --git a/hooks/useSwap.tsx b/hooks/useSwap.tsx deleted file mode 100644 index 254d01d..0000000 --- a/hooks/useSwap.tsx +++ /dev/null @@ -1,650 +0,0 @@ -import BigNumber from "bignumber.js"; -import { coin } from '@cosmjs/amino'; -import { Coin } from "@cosmjs/stargate"; -import { FEES, osmosis } from "osmo-query"; -import { useEffect, useState } from "react"; -import { useChain } from "@cosmos-kit/react"; -import { Text } from '@interchain-ui/react'; -import { toast } from '@interchain-ui/react'; -import { Asset } from "@chain-registry/types"; -import { CoinDenom, PrettyPair } from "@osmonauts/math/types"; -import { SwapAmountInRoute } from "osmo-query/dist/codegen/osmosis/poolmanager/v1beta1/swap_route"; -import { convertBaseUnitToDisplayUnit, convertBaseUnitToDollarValue, DenomPriceMap, getExponentByDenom } from "@chain-registry/utils"; -import { makePoolPairs, getRoutesForTrade, calcPriceImpactGivenIn, calcPriceImpactGivenOut, calcAmountWithSlippage } from "@osmonauts/math"; -import { Token, Slippages, TokenList, SwapInfoProps } from "@/components/swap"; -import { Pools, usePools, usePrices, useBalances, useTx } from "@/hooks"; -import { defaultChainName, Osmosis } from "@/config"; -import { assets } from 'chain-registry'; -import { getLogo, integer, removeDuplicateAssetSymbols } from "@/utils"; - -let osmosisAssets = assets.filter(a => a.chain_name === 'osmosis') -osmosisAssets.forEach(osmosisAsset => { - // Fix Ambiguity Error: 2 items found key:symbol value:FURY chainName:undefined. - osmosisAsset.assets = removeDuplicateAssetSymbols(osmosisAsset.assets) -}) - -export type Swap = { - to: Token - from: Token - slippage: number -} - -export function useSwap() { - const { tx } = useTx(defaultChainName); - const { address, isWalletConnected } = useChain(defaultChainName); - - const [to, setTo] = useState(); - // The selected To token. - // to.amount is the balance of the To token in display units (atom, osmo...) - - const [from, setFrom] = useState(); - // The selected From token. - // from.amount is the balance of the From token in display units (atom, osmo ...) - - const [amount, setAmount] = useState("0"); - // amount is the amount of From token to swap (user input) - - const [slippage, setSlippage] = useState(Slippages[0]); - const [isSwapping, setIsSwapping] = useState(false); - - const balances = useBalances(); - const prices = usePrices(); - const pools = usePools(prices); - - const pairs = makePoolPairs(osmosisAssets, pools.freefloat.priced, prices); // see pairs data structure at file bottom - const denoms = denomsInPairs(pairs); - const tokens = newTokens(denoms, prices, balances.hash, from, to); - - const swap = newSwap(from!, to!, amount, prices, slippage); - // swap.from.amount is the same as amount - // sawp.to.amount is the amount of To token that user will get without slippage - - const routes = newRoutes(swap, pairs); - const info = newSwapInfo(swap, pools, routes); - const steps = newSwapSteps(swap, pools, routes); - - const isLoading = pools.query.isLoading || prices.query.isLoading || balances.query.isLoading; - const isZeroAmount = new BigNumber(amount).lte(0); - const isRoutesEmpty = routes.length === 0; - const isInsufficientBalance = new BigNumber(amount).gt(from?.amount || '0'); - const isSwapDisabled = isLoading || isSwapping || isZeroAmount || isRoutesEmpty || isInsufficientBalance; - - useEffect(() => { - isWalletConnected ? null : setAmount('0'); - }, [isWalletConnected]) - - useEffect(() => { - if (tokens.length < 2) return; - setFrom((prev) => prev ? tokens.hash[prev.denom] : tokens[0]); - setTo((prev) => prev ? tokens.hash[prev.denom] : tokens[1]); - }, [pools.query.data, prices.query.data, balances.query.data]); - - function onFlip() { - if (from?.denom && to?.denom) { - setFrom(to); - setTo(from); - setAmount(swap.to.amount || '0'); - } - } - - function onAmountChange(amount: string) { - if (/^0[0-9]*$/.test(amount)) return setAmount('0'); - if (/^0\.0*$/.test(amount)) return setAmount(amount); - - const num = new BigNumber(amount); - const max = from?.amount || '0'; - const val = Number(amount) >= 0 && num.gte(0) ? num.gt(max) ? max : amount : '0'; - setAmount(val); - } - - async function onSwap() { - if (!address || isLoading || isZeroAmount || isInsufficientBalance || isRoutesEmpty) return; - - setIsSwapping(true); - const msg = newSwapMessage(swap, address, routes); - const fee = FEES.osmosis.swapExactAmountIn(); - const res = await tx([msg], { fee }); - setIsSwapping(false) - - if (res.error) { - // will be simple as toast.error(res.errorMsg) when interchain-ui fixs the text overflow issue - const error = {res.errorMsg} - toast.error(error); - console.log(res.response); - console.log(res.error.message); - } else if (res.isSuccess) { - setAmount('0'); - toast.success('Swap successful'); - balances.query.refetch(); - } - } - - return { - to, setTo, from, setFrom, swap, info, - pools, prices, tokens, balances, routes, steps, - amount, slippage, setSlippage, onFlip, onSwap, onAmountChange, - isLoading, isSwapping, isZeroAmount, isRoutesEmpty, - isSwapDisabled, isWalletConnected, isInsufficientBalance - } -} - -export function newSwap( - from: Token, - to: Token, - amount = '0', - prices: DenomPriceMap = {}, - slippage = Slippages[0] -) { - const swap: Swap = { - to: { denom: '', symbol: '', amount: '0', value: '0', $value: '$0' }, - from: { denom: '', symbol: '', amount: '0', value: '0', $value: '$0' }, - slippage - }; - - if (from && to && prices[from.denom] && prices[to.denom]) { - swap.from.denom = from.denom; - swap.from.symbol = from.symbol; - swap.from.amount = amount; - swap.from.value = new BigNumber(amount).multipliedBy(prices[from.denom]).toString(); - swap.from.$value = `\$${new BigNumber(swap.from.value).decimalPlaces(2).toString()}`; - swap.to.denom = to.denom; - swap.to.symbol = to.symbol; - swap.to.amount = new BigNumber(swap.from.value).div(prices[to.denom]).decimalPlaces(6).toString(); - swap.to.value = swap.from.value; - swap.to.$value = `\$${new BigNumber(swap.to.value).decimalPlaces(2).toString()}`; - } - - return swap; -} - -export function newTokens( - denoms: CoinDenom[] = [], - prices: DenomPriceMap = {}, - balances: Record = {}, - from?: Token, - to?: Token -) { - const tokens = denoms.map((denom) => { - const asset = Osmosis.Assets.CoinDenomToAsset[denom]; - const logo = getLogo(asset); - const balance = balances[asset.base]; - const value = balance ? convertBaseUnitToDollarValue(osmosisAssets, prices, asset.symbol, balance.amount) : '0'; - return { - logo, - asset, - denom, - value, - price: prices[asset.base], - chain: Osmosis.getChainByDenom(denom), - symbol: asset.symbol, - amount: balance ? convertBaseUnitToDisplayUnit(osmosisAssets, asset.symbol, balance.amount) : '0', - $value: balance ? `\$${new BigNumber(value).decimalPlaces(2).toString()}` : '$0', - balance: balances[asset.base], - } as Token - }).sort((a, b) => (new BigNumber(a.value!).lt(b.value!) ? 1 : -1)) as TokenList - - tokens.rest = tokens.filter((token) => token.denom !== from?.denom && token.denom !== to?.denom); - tokens.hash = tokens.reduce((acc, token) => ({ ...acc, [token.denom]: token }), {}) as Record; - - return tokens; -} - -export function newCoin(token: Token) { - return { - denom: token.denom, - amount: new BigNumber(token.amount || '0') - .shiftedBy(getExponentByDenom(osmosisAssets, token.denom) || 0).toString() - } -} - -export function newRoutes(swap: Swap, pairs: PrettyPair[]) { - if (!swap.from.denom || !swap.to.denom) return []; - const trade = { - sell: newCoin(swap.from), - buy: newCoin(swap.to), - } - return getRoutesForTrade(osmosisAssets, { trade, pairs }); -} - -export function denomsInPairs(pairs: PrettyPair[]) { - return Array.from(new Set(pairs.map((pair) => ([pair.baseAddress, pair.quoteAddress])).flat())); -} - -export function calcPriceImpact( - swap: Swap, - pools: Pools, - routes: SwapAmountInRoute[] = [] -) { - if (new BigNumber(swap.from.amount || '0').isEqualTo(0) || routes.length === 0) return '0'; - - const to = newCoin(swap.to); - const from = newCoin(swap.from); - - if (routes.length === 1) { - return calcPriceImpactGivenIn(from, to.denom, pools.map.get(routes[0].poolId)!) - } - - const toRoute = routes.find((route) => route.tokenOutDenom === to.denom)!; - const fromRoute = routes.find((route) => route.tokenOutDenom !== to.denom)!; - return new BigNumber( - calcPriceImpactGivenIn(from, fromRoute.tokenOutDenom, pools.map.get(fromRoute.poolId)!) - ).plus( - calcPriceImpactGivenOut(to, fromRoute.tokenOutDenom, pools.map.get(toRoute.poolId)!) - ).toString() -} - -export function calcSwapFee(pools: Pools, routes: SwapAmountInRoute[] = [] -) { - if (routes.length === 0) return '0'; - return routes.reduce((total, route) => { - const pool = pools.map.get(route.poolId)!; - return new BigNumber(total).plus(pool.poolParams.swapFee).toString(); - }, '0'); -} - -export function newSwapInfo( - swap: Swap, - pools: Pools, - routes: SwapAmountInRoute[] = [] -) { - if (routes.length === 0) return null; - - const to = newCoin(swap.to); - - const priceImpact = new BigNumber(calcPriceImpact(swap, pools, routes)); - const priceImpactPercent = priceImpact.decimalPlaces(5).shiftedBy(2); - const priceImpactPercentString = priceImpactPercent.toString() + '%'; - const swapFee = calcSwapFee(pools, routes); - const swapFeeValue = new BigNumber(swap.from.value || '0').multipliedBy(swapFee).decimalPlaces(2, BigNumber.ROUND_DOWN); - const swapFeePercent = new BigNumber(swapFee).shiftedBy(2) - const swapFeePercentString = swapFeePercent.toString() + '%'; - - const info = { - priceImpact: { - number: priceImpact, - percent: { number: priceImpactPercent, string: priceImpactPercentString }, - display: priceImpactPercent.gte(0.001) ? priceImpactPercentString : '< 0.001%', - }, - swapFee: { - value: swapFeeValue, - $value: `\$${swapFeeValue.decimalPlaces(2).toString()}`, - number: new BigNumber(swapFee), - percent: { number: swapFeePercent, string: swapFeePercentString } - }, - expectedOutput: new BigNumber(swap.to.amount!).decimalPlaces(6).toString(), - minimumReceived: new BigNumber( - convertBaseUnitToDisplayUnit( - osmosisAssets, swap.to.symbol, calcAmountWithSlippage(to.amount, swap.slippage) - )).decimalPlaces(6).toString(), - display: {} as SwapInfoProps - } - - // Pad expectedOutput and minimumReceived to the same length - const maxLength = Math.max(info.expectedOutput.length, info.minimumReceived.length); - info.expectedOutput = info.expectedOutput.padEnd(maxLength, '0'); - info.minimumReceived = info.minimumReceived.padEnd(maxLength, '0'); - - info.display = { - priceImpact: info.priceImpact.display, - swapFee: { - value: `≈ ${swapFeeValue.gt(0.01) ? info.swapFee.$value : '< \$0.01'}`, - percent: swapFeePercentString - }, - expectedOutput: `≈ ${info.expectedOutput!} ${swap.to.symbol}`, - minimumReceived: `${info.minimumReceived} ${swap.to.symbol}` - } - - return info; -} - -export function newSwapSteps(swap: Swap, pools: Pools, routes: SwapAmountInRoute[] = []) { - return routes.map((route) => newSwapStep(swap, route, pools)); -} - -export function newSwapStep(swap: Swap, route: SwapAmountInRoute, pools: Pools) { - const token = (asset: Asset) => - ({ logo: getLogo(asset), denom: asset.base, symbol: asset.symbol }) - - const pool = pools.map.get(route.poolId)!; - - let base, quote; - if (route.tokenOutDenom === swap.to.denom) { - base = Osmosis.Assets.CoinDenomToAsset[ - pool.poolAssets.find(({ token }) => token.denom !== swap.to.denom)!.token.denom - ]; - quote = Osmosis.Assets.CoinDenomToAsset[swap.to.denom]; - } else { - base = Osmosis.Assets.CoinDenomToAsset[swap.from.denom]; - quote = Osmosis.Assets.CoinDenomToAsset[route.tokenOutDenom]; - } - return { - poolId: route.poolId.toString(), - swapFee: new BigNumber(pool.poolParams.swapFee).shiftedBy(2).toString() + '%', - base: token(base), - quote: token(quote), - } -} - -function newSwapMessage(swap: Swap, sender: string, routes: SwapAmountInRoute[]) { - const { swapExactAmountIn } = osmosis.gamm.v1beta1.MessageComposer.withTypeUrl; - return swapExactAmountIn({ - sender, - routes, - tokenIn: coin(integer(newCoin(swap.from).amount), swap.from.denom), - tokenOutMinAmount: integer(calcAmountWithSlippage(newCoin(swap.to).amount, swap.slippage)), - }); -} - -// What pairs looks like: -// [ -// { -// "poolId": "1", -// "poolAddress": "osmo1mw0ac6rwlp5r8wapwk3zs6g29h8fcscxqakdzw9emkne6c8wjp9q0t3v8t", -// "baseName": "atom", -// "baseSymbol": "ATOM", -// "baseAddress": "ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2", -// "quoteName": "osmo", -// "quoteSymbol": "OSMO", -// "quoteAddress": "uosmo" -// }, -// { -// "poolId": "3", -// "poolAddress": "osmo1c9gj5nwxhuh2gz7wwg4r8e8tw8v7ggy9lh2hu7kkdgh0t450754qh9cpvd", -// "baseName": "akt", -// "baseSymbol": "AKT", -// "baseAddress": "ibc/1480B8FD20AD5FCAE81EA87584D269547DD4D436843C1D20F15E00EB64743EF4", -// "quoteName": "osmo", -// "quoteSymbol": "OSMO", -// "quoteAddress": "uosmo" -// }, -// { -// "poolId": "4", -// "poolAddress": "osmo1lzwv0glchfcw0fpwzdwfdsepmvluv6z6eh4qunxdml33sj06q3yq7xwtde", -// "baseName": "akt", -// "baseSymbol": "AKT", -// "baseAddress": "ibc/1480B8FD20AD5FCAE81EA87584D269547DD4D436843C1D20F15E00EB64743EF4", -// "quoteName": "atom", -// "quoteSymbol": "ATOM", -// "quoteAddress": "ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2" -// }, -// { -// "poolId": "9", -// "poolAddress": "osmo19fm8jtzyw8ujsnsqm5rznudn8fhhkykjh4ra8rvx9lsfslw2pc2sp36h3r", -// "baseName": "cro", -// "baseSymbol": "CRO", -// "baseAddress": "ibc/E6931F78057F7CC5DA0FD6CEF82FF39373A6E0452BF1FD76910B93292CF356C1", -// "quoteName": "osmo", -// "quoteSymbol": "OSMO", -// "quoteAddress": "uosmo" -// }, -// { -// "poolId": "10", -// "poolAddress": "osmo1krp38zzc3zz5as9ndqkyskhkzv6x9e30ckcq5g4lcsu5wpwcqy0sa3dea2", -// "baseName": "atom", -// "baseSymbol": "ATOM", -// "baseAddress": "ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2", -// "quoteName": "cro", -// "quoteSymbol": "CRO", -// "quoteAddress": "ibc/E6931F78057F7CC5DA0FD6CEF82FF39373A6E0452BF1FD76910B93292CF356C1" -// }, -// { -// "poolId": "481", -// "poolAddress": "osmo1y3ptmx57hvu7au6s9r3fxq00856896unkdyqaump7vedag248l0qc03asg", -// "baseName": "eur", -// "baseSymbol": "EEUR", -// "baseAddress": "ibc/5973C068568365FFF40DEDCF1A1CB7582B6116B731CD31A12231AE25E20B871F", -// "quoteName": "osmo", -// "quoteSymbol": "OSMO", -// "quoteAddress": "uosmo" -// }, -// { -// "poolId": "497", -// "poolAddress": "osmo1h7yfu7x4qsv2urnkl4kzydgxegdfyjdry5ee4xzj98jwz0uh07rqdkmprr", -// "baseName": "juno", -// "baseSymbol": "JUNO", -// "baseAddress": "ibc/46B44899322F3CD854D2D46DEEF881958467CDD4B3B10086DA49296BBED94BED", -// "quoteName": "osmo", -// "quoteSymbol": "OSMO", -// "quoteAddress": "uosmo" -// }, -// { -// "poolId": "498", -// "poolAddress": "osmo1tusadtwjnzzyakm94t5gjqr4dlkdcp63hctlql6xvslvkf7kkdws5lfyxc", -// "baseName": "atom", -// "baseSymbol": "ATOM", -// "baseAddress": "ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2", -// "quoteName": "juno", -// "quoteSymbol": "JUNO", -// "quoteAddress": "ibc/46B44899322F3CD854D2D46DEEF881958467CDD4B3B10086DA49296BBED94BED" -// }, -// { -// "poolId": "560", -// "poolAddress": "osmo10d8ddsydag5xrnl2kacmkjtdxddstvz4jvraqqpf6ss2n7fy6lkqw4sx2f", -// "baseName": "ust", -// "baseSymbol": "USTC", -// "baseAddress": "ibc/BE1BB42D4BE3C30D50B68D7C41DB4DFCE9678E8EF8C539F6E6A9345048894FCC", -// "quoteName": "osmo", -// "quoteSymbol": "OSMO", -// "quoteAddress": "uosmo" -// }, -// { -// "poolId": "571", -// "poolAddress": "osmo1y6gvkz0qu93h7zgkrrhr6fqye5ny9ddpm9az2l5kjr0mmw9n48mqpmcnnv", -// "baseName": "bcna", -// "baseSymbol": "BCNA", -// "baseAddress": "ibc/D805F1DA50D31B96E4282C1D4181EDDFB1A44A598BFF5666F4B43E4B8BEA95A5", -// "quoteName": "osmo", -// "quoteSymbol": "OSMO", -// "quoteAddress": "uosmo" -// }, -// { -// "poolId": "572", -// "poolAddress": "osmo108scuudnnhe70xuwa2etuyxffexexak6rflvsczj9n4fhrz92ajs9zudge", -// "baseName": "atom", -// "baseSymbol": "ATOM", -// "baseAddress": "ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2", -// "quoteName": "bcna", -// "quoteSymbol": "BCNA", -// "quoteAddress": "ibc/D805F1DA50D31B96E4282C1D4181EDDFB1A44A598BFF5666F4B43E4B8BEA95A5" -// }, -// { -// "poolId": "584", -// "poolAddress": "osmo1l265e7cug3tk3eugex8hpq2adk5drdecxzp6lsytn6dls6jpjkssvp9zqe", -// "baseName": "scrt", -// "baseSymbol": "SCRT", -// "baseAddress": "ibc/0954E1C28EB7AF5B72D24F3BC2B47BBB2FDF91BDDFD57B74B99E133AED40972A", -// "quoteName": "osmo", -// "quoteSymbol": "OSMO", -// "quoteAddress": "uosmo" -// }, -// { -// "poolId": "585", -// "poolAddress": "osmo1amh63u7vgtrak5rmetdjrl67jhl6rate05r792ywyxzp5jt6eq7sx5uphr", -// "baseName": "scrt", -// "baseSymbol": "SCRT", -// "baseAddress": "ibc/0954E1C28EB7AF5B72D24F3BC2B47BBB2FDF91BDDFD57B74B99E133AED40972A", -// "quoteName": "atom", -// "quoteSymbol": "ATOM", -// "quoteAddress": "ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2" -// }, -// { -// "poolId": "586", -// "poolAddress": "osmo18lw3t03dmyv6975kzjgacezvaafflz5aepmqrqqc8y494gwwwpmq9vm7p8", -// "baseName": "med", -// "baseSymbol": "MED", -// "baseAddress": "ibc/3BCCC93AD5DF58D11A6F8A05FA8BC801CBA0BA61A981F57E91B8B598BF8061CB", -// "quoteName": "osmo", -// "quoteSymbol": "OSMO", -// "quoteAddress": "uosmo" -// }, -// { -// "poolId": "587", -// "poolAddress": "osmo1y3g6lwd5p72z5uxgm4z6wy7asyg53wg83np7mg3cz2wnf9zhl69q8shlnd", -// "baseName": "atom", -// "baseSymbol": "ATOM", -// "baseAddress": "ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2", -// "quoteName": "med", -// "quoteSymbol": "MED", -// "quoteAddress": "ibc/3BCCC93AD5DF58D11A6F8A05FA8BC801CBA0BA61A981F57E91B8B598BF8061CB" -// }, -// { -// "poolId": "604", -// "poolAddress": "osmo1thscstwxp87g0ygh7le3h92f9ff4sel9y9d2eysa25p43yf43rysk7jp93", -// "baseName": "stars", -// "baseSymbol": "STARS", -// "baseAddress": "ibc/987C17B11ABC2B20019178ACE62929FE9840202CE79498E29FE8E5CB02B7C0A4", -// "quoteName": "osmo", -// "quoteSymbol": "OSMO", -// "quoteAddress": "uosmo" -// }, -// { -// "poolId": "611", -// "poolAddress": "osmo1ejaswj8lcyh0zgnes8zt45e0w7tqm4mrxr74sfwgpdh72shp58ms4fdqsk", -// "baseName": "atom", -// "baseSymbol": "ATOM", -// "baseAddress": "ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2", -// "quoteName": "stars", -// "quoteSymbol": "STARS", -// "quoteAddress": "ibc/987C17B11ABC2B20019178ACE62929FE9840202CE79498E29FE8E5CB02B7C0A4" -// }, -// { -// "poolId": "678", -// "poolAddress": "osmo10venxtvdglryxkdmvjr8wa6n3ugja40rewddlxtg0pr30vmkf47sllgslg", -// "baseName": "usdc", -// "baseSymbol": "USDC", -// "baseAddress": "ibc/D189335C6E4A68B513C10AB227BF1C1D38C746766278BA3EEB4FB14124F1D858", -// "quoteName": "osmo", -// "quoteSymbol": "OSMO", -// "quoteAddress": "uosmo" -// }, -// { -// "poolId": "681", -// "poolAddress": "osmo1u66wkjthdjxnavklpef7yzasdrvvqhckmhkqsw8uwlad3uaktr3qvny8k4", -// "baseName": "fet", -// "baseSymbol": "FET", -// "baseAddress": "ibc/5D1F516200EE8C6B2354102143B78A2DEDA25EDE771AC0F8DC3C1837C8FD4447", -// "quoteName": "osmo", -// "quoteSymbol": "OSMO", -// "quoteAddress": "uosmo" -// }, -// { -// "poolId": "722", -// "poolAddress": "osmo102ryca72c5ktx2ruzt8ag6mvtczdqeuvm82l09vd5uq597e7hn7sqgw28l", -// "baseName": "evmos", -// "baseSymbol": "EVMOS", -// "baseAddress": "ibc/6AE98883D4D5D5FF9E50D7130F1305DA2FFA0C652D1DD9C123657C6B4EB2DF8A", -// "quoteName": "osmo", -// "quoteSymbol": "OSMO", -// "quoteAddress": "uosmo" -// }, -// { -// "poolId": "725", -// "poolAddress": "osmo1uxqg4sr2yqvamc96n4kwkgna6nmmgtypfdn2gjhvwgymuunq3qlswyrdhg", -// "baseName": "INJ", -// "baseSymbol": "INJ", -// "baseAddress": "ibc/64BA6E31FE887D66C6F8F31C7B1A80C7CA179239677B4088BB55F5EA07DBE273", -// "quoteName": "osmo", -// "quoteSymbol": "OSMO", -// "quoteAddress": "uosmo" -// }, -// { -// "poolId": "796", -// "poolAddress": "osmo1rmhusclghxyvyxr9kq4nuum9pvsgplfpuvq0x5d0ufaaxrwkefqsardn6n", -// "baseName": "cudos", -// "baseSymbol": "CUDOS", -// "baseAddress": "ibc/E09ED39F390EC51FA9F3F69BEA08B5BBE6A48B3057B2B1C3467FAAE9E58B021B", -// "quoteName": "osmo", -// "quoteSymbol": "OSMO", -// "quoteAddress": "uosmo" -// }, -// { -// "poolId": "803", -// "poolAddress": "osmo1tg2k5rxex7zhzh3rcvmy6a2yfvw8446ezk7utz8j80vmkrpjve2qljc6hk", -// "baseName": "atom", -// "baseSymbol": "ATOM", -// "baseAddress": "ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2", -// "quoteName": "statom", -// "quoteSymbol": "stATOM", -// "quoteAddress": "ibc/C140AFD542AE77BD7DCC83F13FDD8C5E5BB8C4929785E6EC2F4C636F98F17901" -// }, -// { -// "poolId": "806", -// "poolAddress": "osmo1x0ptme5tp8r2qw8gsypg3qftfwfpt2hdk4jyvp7gryywmg5l9fsqvhs8fk", -// "baseName": "strd", -// "baseSymbol": "STRD", -// "baseAddress": "ibc/A8CA5EE328FA10C9519DF6057DA1F69682D28F7D0F5CCC7ECB72E3DCA2D157A4", -// "quoteName": "osmo", -// "quoteSymbol": "OSMO", -// "quoteAddress": "uosmo" -// }, -// { -// "poolId": "808", -// "poolAddress": "osmo16cr2suh8wxyd3rdj24s7qe4kr2lnjxmm0495j07tl06jclnwfa2qqs58qg", -// "baseName": "seasy", -// "baseSymbol": "SEASY", -// "baseAddress": "ibc/18A676A074F73B9B42DA4F9DFC8E5AEF334C9A6636DDEC8D34682F52F1DECDF6", -// "quoteName": "osmo", -// "quoteSymbol": "OSMO", -// "quoteAddress": "uosmo" -// }, -// { -// "poolId": "812", -// "poolAddress": "osmo1ag2w5l8av9msvzhks4vyd920r9lzaesekes6yg3vykp9fch5n22sk6er50", -// "baseName": "axl", -// "baseSymbol": "AXL", -// "baseAddress": "ibc/903A61A498756EA560B85A85132D3AEE21B5DEDD41213725D22ABF276EA6945E", -// "quoteName": "osmo", -// "quoteSymbol": "OSMO", -// "quoteAddress": "uosmo" -// }, -// { -// "poolId": "832", -// "poolAddress": "osmo1q7ul5yz2ma5mjj8vkf5njjz859wk4u90ley2emfx8th4xyx6fg7se0z4hn", -// "baseName": "jkl", -// "baseSymbol": "JKL", -// "baseAddress": "ibc/8E697BDABE97ACE8773C6DF7402B2D1D5104DD1EEABE12608E3469B7F64C15BA", -// "quoteName": "osmo", -// "quoteSymbol": "OSMO", -// "quoteAddress": "uosmo" -// }, -// { -// "poolId": "907", -// "poolAddress": "osmo1752ysawy2adr7td9an30a8pkk8ngrvcq3tan08lvnar3s7f82y5s4dt8fs", -// "baseName": "mars", -// "baseSymbol": "MARS", -// "baseAddress": "ibc/573FCD90FACEE750F55A8864EF7D38265F07E5A9273FA0E8DAFD39951332B580", -// "quoteName": "osmo", -// "quoteSymbol": "OSMO", -// "quoteAddress": "uosmo" -// }, -// { -// "poolId": "960", -// "poolAddress": "osmo1wpmkhdwjermkp3u6cg6zdjw4vwvd0awjc63m7e86fptra9cjqw0qcp6vtj", -// "baseName": "whale", -// "baseSymbol": "WHALE", -// "baseAddress": "ibc/EDD6F0D66BCD49C1084FB2C35353B4ACD7B9191117CE63671B61320548F7C89D", -// "quoteName": "osmo", -// "quoteSymbol": "OSMO", -// "quoteAddress": "uosmo" -// }, -// { -// "poolId": "972", -// "poolAddress": "osmo10fczpczlj82fm8ce6cnun3j46gganul9dtxj506ldpxnekszjyuq4snyk4", -// "baseName": "regen", -// "baseSymbol": "REGEN", -// "baseAddress": "ibc/1DCC8A6CB5689018431323953344A9F6CC4D0BFB261E88C9F7777372C10CD076", -// "quoteName": "nct", -// "quoteSymbol": "NCT", -// "quoteAddress": "ibc/A76EB6ECF4E3E2D4A23C526FD1B48FDD42F171B206C9D2758EF778A7826ADD68" -// }, -// { -// "poolId": "1041", -// "poolAddress": "osmo1v5dnjxx2a9dm9v7vnza3wphakrz9tnfhtcm5at0chflmsnkfl40qxx7fjn", -// "baseName": "usdc", -// "baseSymbol": "USDC", -// "baseAddress": "ibc/D189335C6E4A68B513C10AB227BF1C1D38C746766278BA3EEB4FB14124F1D858", -// "quoteName": "nls", -// "quoteSymbol": "NLS", -// "quoteAddress": "ibc/D9AFCECDD361D38302AA66EB3BAC23B95234832C51D12489DC451FA2B7C72782" -// } -// ] \ No newline at end of file diff --git a/public/sw.js.map b/public/sw.js.map index d9219de..8aa818b 100644 --- a/public/sw.js.map +++ b/public/sw.js.map @@ -1 +1 @@ -{"version":3,"file":"sw.js","sources":["../../../../../../private/var/folders/wf/xlsnsyxn70504y3gn_v1l0km0000gn/T/07c5e5ddb9aa0d08a15966d999e35626/sw.js"],"sourcesContent":["import {registerRoute as workbox_routing_registerRoute} from '/Users/kamleshparikarath/projects/assetmantle/codebase/aminamesnew/node_modules/workbox-routing/registerRoute.mjs';\nimport {NetworkFirst as workbox_strategies_NetworkFirst} from '/Users/kamleshparikarath/projects/assetmantle/codebase/aminamesnew/node_modules/workbox-strategies/NetworkFirst.mjs';\nimport {NetworkOnly as workbox_strategies_NetworkOnly} from '/Users/kamleshparikarath/projects/assetmantle/codebase/aminamesnew/node_modules/workbox-strategies/NetworkOnly.mjs';\nimport {clientsClaim as workbox_core_clientsClaim} from '/Users/kamleshparikarath/projects/assetmantle/codebase/aminamesnew/node_modules/workbox-core/clientsClaim.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\nimportScripts(\n \n);\n\n\n\n\n\n\n\nself.skipWaiting();\n\nworkbox_core_clientsClaim();\n\n\n\nworkbox_routing_registerRoute(\"/\", new workbox_strategies_NetworkFirst({ \"cacheName\":\"start-url\", plugins: [{ cacheWillUpdate: async ({ response: e })=>e && \"opaqueredirect\" === e.type ? new Response(e.body, { status: 200, statusText: \"OK\", headers: e.headers }) : e }] }), 'GET');\nworkbox_routing_registerRoute(/.*/i, new workbox_strategies_NetworkOnly({ \"cacheName\":\"dev\", plugins: [] }), 'GET');\n\n\n\n\n"],"names":["importScripts","self","skipWaiting","workbox_core_clientsClaim","workbox_routing_registerRoute","workbox_strategies_NetworkFirst","plugins","cacheWillUpdate","response","e","type","Response","body","status","statusText","headers","workbox_strategies_NetworkOnly"],"mappings":"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"} \ No newline at end of file +{"version":3,"file":"sw.js","sources":["../../../../../../private/var/folders/wf/xlsnsyxn70504y3gn_v1l0km0000gn/T/3de76e5a320ce4bb0af80f26280f04ff/sw.js"],"sourcesContent":["import {registerRoute as workbox_routing_registerRoute} from '/Users/kamleshparikarath/projects/assetmantle/codebase/aminamesnew/node_modules/workbox-routing/registerRoute.mjs';\nimport {NetworkFirst as workbox_strategies_NetworkFirst} from '/Users/kamleshparikarath/projects/assetmantle/codebase/aminamesnew/node_modules/workbox-strategies/NetworkFirst.mjs';\nimport {NetworkOnly as workbox_strategies_NetworkOnly} from '/Users/kamleshparikarath/projects/assetmantle/codebase/aminamesnew/node_modules/workbox-strategies/NetworkOnly.mjs';\nimport {clientsClaim as workbox_core_clientsClaim} from '/Users/kamleshparikarath/projects/assetmantle/codebase/aminamesnew/node_modules/workbox-core/clientsClaim.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\nimportScripts(\n \n);\n\n\n\n\n\n\n\nself.skipWaiting();\n\nworkbox_core_clientsClaim();\n\n\n\nworkbox_routing_registerRoute(\"/\", new workbox_strategies_NetworkFirst({ \"cacheName\":\"start-url\", plugins: [{ cacheWillUpdate: async ({ response: e })=>e && \"opaqueredirect\" === e.type ? new Response(e.body, { status: 200, statusText: \"OK\", headers: e.headers }) : e }] }), 'GET');\nworkbox_routing_registerRoute(/.*/i, new workbox_strategies_NetworkOnly({ \"cacheName\":\"dev\", plugins: [] }), 'GET');\n\n\n\n\n"],"names":["importScripts","self","skipWaiting","workbox_core_clientsClaim","workbox_routing_registerRoute","workbox_strategies_NetworkFirst","plugins","cacheWillUpdate","response","e","type","Response","body","status","statusText","headers","workbox_strategies_NetworkOnly"],"mappings":"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"} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 61581e4..893a53a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,11 @@ { "compilerOptions": { "target": "ES2020", - "lib": ["dom", "dom.iterable", "esnext"], + "lib": [ + "dom", + "dom.iterable", + "esnext" + ], "allowJs": true, "skipLibCheck": true, "strict": true, @@ -16,9 +20,23 @@ "incremental": true, "baseUrl": ".", "paths": { - "@/*": ["*"] - } + "@/*": [ + "*" + ] + }, + "plugins": [ + { + "name": "next" + } + ] }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], - "exclude": ["node_modules"] + "include": [ + "next-env.d.ts", + "**/*.ts", + "**/*.tsx", + ".next/types/**/*.ts" + ], + "exclude": [ + "node_modules" + ] }