fix: move off deprecated gql fields (#7269)
This commit is contained in:
parent
652a8305c8
commit
147a9bcbb2
File diff suppressed because it is too large
Load Diff
@ -351,7 +351,7 @@ function parseRemoteActivity(assetActivity: AssetActivityPartsFragment): Activit
|
||||
return parseUniswapXOrder(assetActivity as OrderActivity)
|
||||
}
|
||||
|
||||
const changes = assetActivity.assetChanges.reduce(
|
||||
const changes = assetActivity.details.assetChanges.reduce(
|
||||
(acc: TransactionChanges, assetChange) => {
|
||||
if (assetChange.__typename === 'NftApproval') acc.NftApproval.push(assetChange)
|
||||
else if (assetChange.__typename === 'NftApproveForAll') acc.NftApproveForAll.push(assetChange)
|
||||
@ -377,13 +377,16 @@ function parseRemoteActivity(assetActivity: AssetActivityPartsFragment): Activit
|
||||
status: assetActivity.details.status,
|
||||
timestamp: assetActivity.timestamp,
|
||||
logos: getLogoSrcs(changes),
|
||||
title: assetActivity.type,
|
||||
title: assetActivity.details.type,
|
||||
descriptor: assetActivity.details.to,
|
||||
from: assetActivity.details.from,
|
||||
nonce: assetActivity.details.nonce,
|
||||
}
|
||||
|
||||
const parsedFields = ActivityParserByType[assetActivity.type]?.(changes, assetActivity as TransactionActivity)
|
||||
const parsedFields = ActivityParserByType[assetActivity.details.type]?.(
|
||||
changes,
|
||||
assetActivity as TransactionActivity
|
||||
)
|
||||
return { ...defaultFields, ...parsedFields }
|
||||
} catch (e) {
|
||||
console.error('Failed to parse activity', e, assetActivity)
|
||||
|
@ -110,37 +110,6 @@ fragment TransactionDetailsParts on TransactionDetails {
|
||||
hash
|
||||
nonce
|
||||
status
|
||||
}
|
||||
|
||||
fragment SwapOrderDetailsParts on SwapOrderDetails {
|
||||
id
|
||||
offerer
|
||||
hash
|
||||
orderStatus: status
|
||||
inputToken {
|
||||
...TokenAssetParts
|
||||
}
|
||||
inputTokenQuantity
|
||||
outputToken {
|
||||
...TokenAssetParts
|
||||
}
|
||||
outputTokenQuantity
|
||||
}
|
||||
|
||||
fragment AssetActivityParts on AssetActivity {
|
||||
id
|
||||
timestamp
|
||||
type
|
||||
chain
|
||||
details {
|
||||
__typename
|
||||
... on TransactionDetails {
|
||||
...TransactionDetailsParts
|
||||
}
|
||||
... on SwapOrderDetails {
|
||||
...SwapOrderDetailsParts
|
||||
}
|
||||
}
|
||||
assetChanges {
|
||||
__typename
|
||||
... on TokenTransfer {
|
||||
@ -161,6 +130,36 @@ fragment AssetActivityParts on AssetActivity {
|
||||
}
|
||||
}
|
||||
|
||||
fragment SwapOrderDetailsParts on SwapOrderDetails {
|
||||
id
|
||||
offerer
|
||||
hash
|
||||
orderStatus: status
|
||||
inputToken {
|
||||
...TokenAssetParts
|
||||
}
|
||||
inputTokenQuantity
|
||||
outputToken {
|
||||
...TokenAssetParts
|
||||
}
|
||||
outputTokenQuantity
|
||||
}
|
||||
|
||||
fragment AssetActivityParts on AssetActivity {
|
||||
id
|
||||
timestamp
|
||||
chain
|
||||
details {
|
||||
__typename
|
||||
... on TransactionDetails {
|
||||
...TransactionDetailsParts
|
||||
}
|
||||
... on SwapOrderDetails {
|
||||
...SwapOrderDetailsParts
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# TODO(UniswapX): return to a pagesize of 50 pre-launch
|
||||
query Activity($account: String!) {
|
||||
portfolios(ownerAddresses: [$account]) {
|
||||
|
Loading…
Reference in New Issue
Block a user