mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
Merge branch 'main' into feature/account_page
This commit is contained in:
commit
30f262de33
@ -1,5 +1,5 @@
|
||||
import React, { ReactElement, useEffect, useState } from 'react'
|
||||
import { BestPrice, DDO } from '@oceanprotocol/lib'
|
||||
import { DDO } from '@oceanprotocol/lib'
|
||||
import styles from './Swap.module.css'
|
||||
import TradeInput from './TradeInput'
|
||||
import Button from '../../../atoms/Button'
|
||||
@ -13,6 +13,7 @@ import { useOcean } from '../../../../providers/Ocean'
|
||||
import PriceImpact from './PriceImpact'
|
||||
|
||||
import Decimal from 'decimal.js'
|
||||
import { BestPrice } from '../../../../models/BestPrice'
|
||||
|
||||
Decimal.set({ toExpNeg: -18, precision: 18, rounding: 1 })
|
||||
|
||||
@ -36,7 +37,7 @@ export default function Swap({
|
||||
const { ocean, config } = useOcean()
|
||||
const [oceanItem, setOceanItem] = useState<TradeItem>({
|
||||
amount: '0',
|
||||
token: config.oceanTokenSymbol,
|
||||
token: price.oceanSymbol,
|
||||
maxAmount: '0'
|
||||
})
|
||||
const [dtItem, setDtItem] = useState<TradeItem>({
|
||||
|
@ -79,9 +79,11 @@ const FreQuery = gql`
|
||||
fixedRateExchanges(orderBy: id, where: { datatoken_in: $datatoken_in }) {
|
||||
rate
|
||||
id
|
||||
baseTokenSymbol
|
||||
datatoken {
|
||||
id
|
||||
address
|
||||
symbol
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -92,6 +94,12 @@ const AssetFreQuery = gql`
|
||||
fixedRateExchanges(orderBy: id, where: { datatoken: $datatoken }) {
|
||||
rate
|
||||
id
|
||||
baseTokenSymbol
|
||||
datatoken {
|
||||
id
|
||||
address
|
||||
symbol
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
||||
@ -303,6 +311,7 @@ function transformPriceToBestPrice(
|
||||
value: frePrice[0]?.rate,
|
||||
address: frePrice[0]?.id,
|
||||
exchangeId: frePrice[0]?.id,
|
||||
oceanSymbol: frePrice[0]?.baseTokenSymbol,
|
||||
ocean: 0,
|
||||
datatoken: 0,
|
||||
pools: [],
|
||||
|
Loading…
Reference in New Issue
Block a user