1
0
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:
claudiaHash 2022-03-28 17:57:16 +03:00 committed by GitHub
parent 2e74d42edb
commit b9ee145aed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -9,6 +9,7 @@ import { fetchDataForMultipleChains } from '@utils/subgraph'
import { useSiteMetadata } from '@hooks/useSiteMetadata'
import NetworkName from '@shared/NetworkName'
import { getAssetsFromDtList } from '@utils/aquarius'
import { getAsset } from '../../Profile/History/PoolShares/_utils'
import { CancelToken } from 'axios'
import Title from './Title'
import styles from './index.module.css'
@ -180,8 +181,8 @@ export default function PoolTransactions({
for (let i = 0; i < data.length; i++) {
poolTransactions.push({
...data[i],
networkId: ddoList[i]?.chainId,
asset: ddoList[i]
networkId: getAsset(ddoList, data[i].datatoken.address).chainId,
asset: getAsset(ddoList, data[i].datatoken.address)
})
}
const sortedTransactions = poolTransactions.sort(

View File

@ -5,7 +5,7 @@ import { PoolShares_poolShares as PoolShare } from '../../../../@types/subgraph/
import { AssetPoolShare } from '.'
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++) {
if (
items[i].datatokens[0].address.toLowerCase() === datatoken.toLowerCase()
@ -36,7 +36,6 @@ export async function getAssetsFromPoolShares(
data[i].pool.totalShares,
data[i].pool.baseTokenLiquidity
)
console.log(data[i].pool.datatoken.address, userLiquidity)
assetList.push({
poolShare: data[i],
userLiquidity,