mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
Get valid pool transaction link (#1268)
* get transactions link * cleanup Co-authored-by: ClaudiaHolhos <claudia@oceanprotocol.com>
This commit is contained in:
parent
2e74d42edb
commit
b9ee145aed
@ -9,6 +9,7 @@ import { fetchDataForMultipleChains } from '@utils/subgraph'
|
|||||||
import { useSiteMetadata } from '@hooks/useSiteMetadata'
|
import { useSiteMetadata } from '@hooks/useSiteMetadata'
|
||||||
import NetworkName from '@shared/NetworkName'
|
import NetworkName from '@shared/NetworkName'
|
||||||
import { getAssetsFromDtList } from '@utils/aquarius'
|
import { getAssetsFromDtList } from '@utils/aquarius'
|
||||||
|
import { getAsset } from '../../Profile/History/PoolShares/_utils'
|
||||||
import { CancelToken } from 'axios'
|
import { CancelToken } from 'axios'
|
||||||
import Title from './Title'
|
import Title from './Title'
|
||||||
import styles from './index.module.css'
|
import styles from './index.module.css'
|
||||||
@ -180,8 +181,8 @@ export default function PoolTransactions({
|
|||||||
for (let i = 0; i < data.length; i++) {
|
for (let i = 0; i < data.length; i++) {
|
||||||
poolTransactions.push({
|
poolTransactions.push({
|
||||||
...data[i],
|
...data[i],
|
||||||
networkId: ddoList[i]?.chainId,
|
networkId: getAsset(ddoList, data[i].datatoken.address).chainId,
|
||||||
asset: ddoList[i]
|
asset: getAsset(ddoList, data[i].datatoken.address)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const sortedTransactions = poolTransactions.sort(
|
const sortedTransactions = poolTransactions.sort(
|
||||||
|
@ -5,7 +5,7 @@ import { PoolShares_poolShares as PoolShare } from '../../../../@types/subgraph/
|
|||||||
import { AssetPoolShare } from '.'
|
import { AssetPoolShare } from '.'
|
||||||
import { Asset } from '@oceanprotocol/lib'
|
import { Asset } from '@oceanprotocol/lib'
|
||||||
|
|
||||||
function getAsset(items: Asset[], datatoken: string): Asset {
|
export function getAsset(items: Asset[], datatoken: string): Asset {
|
||||||
for (let i = 0; i < items.length; i++) {
|
for (let i = 0; i < items.length; i++) {
|
||||||
if (
|
if (
|
||||||
items[i].datatokens[0].address.toLowerCase() === datatoken.toLowerCase()
|
items[i].datatokens[0].address.toLowerCase() === datatoken.toLowerCase()
|
||||||
@ -36,7 +36,6 @@ export async function getAssetsFromPoolShares(
|
|||||||
data[i].pool.totalShares,
|
data[i].pool.totalShares,
|
||||||
data[i].pool.baseTokenLiquidity
|
data[i].pool.baseTokenLiquidity
|
||||||
)
|
)
|
||||||
console.log(data[i].pool.datatoken.address, userLiquidity)
|
|
||||||
assetList.push({
|
assetList.push({
|
||||||
poolShare: data[i],
|
poolShare: data[i],
|
||||||
userLiquidity,
|
userLiquidity,
|
||||||
|
Loading…
Reference in New Issue
Block a user