From 2af3b6860352c185c34459c4ff9c260058262d3a Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Thu, 13 Jan 2022 20:10:55 +0000 Subject: [PATCH] migrate PoolTransactions queries --- .../@shared/PoolTransactions/index.tsx | 64 ++++++++++++------- 1 file changed, 40 insertions(+), 24 deletions(-) diff --git a/src/components/@shared/PoolTransactions/index.tsx b/src/components/@shared/PoolTransactions/index.tsx index afdfe09f2..57be3759a 100644 --- a/src/components/@shared/PoolTransactions/index.tsx +++ b/src/components/@shared/PoolTransactions/index.tsx @@ -23,23 +23,31 @@ const txHistoryQueryByPool = gql` poolTransactions( orderBy: timestamp orderDirection: desc - where: { userAddress: $user, poolAddress: $pool } + where: { user: $user, pool: $pool } first: 1000 + subgraphError: deny ) { - tokens { - poolToken { - id - symbol - } + baseToken { + id value - type - tokenAddress + token { + symbol + address + } } + datatoken { + id + value + token { + symbol + address + } + } + type tx - event timestamp - poolAddress { - datatokenAddress + pool { + id } } } @@ -49,23 +57,31 @@ const txHistoryQuery = gql` poolTransactions( orderBy: timestamp orderDirection: desc - where: { userAddress: $user } + where: { user: $user } first: 1000 + subgraphError: deny ) { - tokens { - poolToken { - id - symbol - } + baseToken { + id value - type - tokenAddress + token { + symbol + address + } } + datatoken { + id + value + token { + symbol + address + } + } + type tx - event timestamp - poolAddress { - datatokenAddress + pool { + id } } } @@ -170,9 +186,9 @@ export default function PoolTransactions({ const didList: string[] = [] for (let i = 0; i < data.length; i++) { - const { datatokenAddress } = data[i].poolAddress + const { address } = data[i].datatoken.token const did = web3.utils - .toChecksumAddress(datatokenAddress) + .toChecksumAddress(address) .replace('0x', 'did:op:') didList.push(did) }