mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
migrate PoolTransactions queries
This commit is contained in:
parent
18d7223297
commit
2af3b68603
@ -23,23 +23,31 @@ const txHistoryQueryByPool = gql`
|
|||||||
poolTransactions(
|
poolTransactions(
|
||||||
orderBy: timestamp
|
orderBy: timestamp
|
||||||
orderDirection: desc
|
orderDirection: desc
|
||||||
where: { userAddress: $user, poolAddress: $pool }
|
where: { user: $user, pool: $pool }
|
||||||
first: 1000
|
first: 1000
|
||||||
|
subgraphError: deny
|
||||||
) {
|
) {
|
||||||
tokens {
|
baseToken {
|
||||||
poolToken {
|
id
|
||||||
id
|
|
||||||
symbol
|
|
||||||
}
|
|
||||||
value
|
value
|
||||||
type
|
token {
|
||||||
tokenAddress
|
symbol
|
||||||
|
address
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
datatoken {
|
||||||
|
id
|
||||||
|
value
|
||||||
|
token {
|
||||||
|
symbol
|
||||||
|
address
|
||||||
|
}
|
||||||
|
}
|
||||||
|
type
|
||||||
tx
|
tx
|
||||||
event
|
|
||||||
timestamp
|
timestamp
|
||||||
poolAddress {
|
pool {
|
||||||
datatokenAddress
|
id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -49,23 +57,31 @@ const txHistoryQuery = gql`
|
|||||||
poolTransactions(
|
poolTransactions(
|
||||||
orderBy: timestamp
|
orderBy: timestamp
|
||||||
orderDirection: desc
|
orderDirection: desc
|
||||||
where: { userAddress: $user }
|
where: { user: $user }
|
||||||
first: 1000
|
first: 1000
|
||||||
|
subgraphError: deny
|
||||||
) {
|
) {
|
||||||
tokens {
|
baseToken {
|
||||||
poolToken {
|
id
|
||||||
id
|
|
||||||
symbol
|
|
||||||
}
|
|
||||||
value
|
value
|
||||||
type
|
token {
|
||||||
tokenAddress
|
symbol
|
||||||
|
address
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
datatoken {
|
||||||
|
id
|
||||||
|
value
|
||||||
|
token {
|
||||||
|
symbol
|
||||||
|
address
|
||||||
|
}
|
||||||
|
}
|
||||||
|
type
|
||||||
tx
|
tx
|
||||||
event
|
|
||||||
timestamp
|
timestamp
|
||||||
poolAddress {
|
pool {
|
||||||
datatokenAddress
|
id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -170,9 +186,9 @@ export default function PoolTransactions({
|
|||||||
const didList: string[] = []
|
const didList: string[] = []
|
||||||
|
|
||||||
for (let i = 0; i < data.length; i++) {
|
for (let i = 0; i < data.length; i++) {
|
||||||
const { datatokenAddress } = data[i].poolAddress
|
const { address } = data[i].datatoken.token
|
||||||
const did = web3.utils
|
const did = web3.utils
|
||||||
.toChecksumAddress(datatokenAddress)
|
.toChecksumAddress(address)
|
||||||
.replace('0x', 'did:op:')
|
.replace('0x', 'did:op:')
|
||||||
didList.push(did)
|
didList.push(did)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user