Commit b02352e8 authored by eddie's avatar eddie Committed by GitHub

fix: dont try to log unserializable objects (#7497)

* fix: dont log unserializable objects to amplitude

* fix: add more fields

* fix: nits

* fix: add chainid
parent 819e2f57
......@@ -150,7 +150,7 @@ export function useMainnetInterfaceMulticall() {
}
export function useV3NFTPositionManagerContract(withSignerIfPossible?: boolean): NonfungiblePositionManager | null {
const { account } = useWeb3React()
const { account, chainId } = useWeb3React()
const contract = useContract<NonfungiblePositionManager>(
NONFUNGIBLE_POSITION_MANAGER_ADDRESSES,
NFTPositionManagerABI,
......@@ -160,10 +160,15 @@ export function useV3NFTPositionManagerContract(withSignerIfPossible?: boolean):
if (contract && account) {
sendAnalyticsEvent(InterfaceEventName.WALLET_PROVIDER_USED, {
source: 'useV3NFTPositionManagerContract',
contract,
contract: {
name: 'V3NonfungiblePositionManager',
address: contract.address,
withSignerIfPossible,
chainId,
},
})
}
}, [account, contract])
}, [account, chainId, contract, withSignerIfPossible])
return contract
}
......
......@@ -20,7 +20,10 @@ function useFeeOnTransferDetectorContract(): FeeOnTransferDetector | null {
if (contract && account) {
sendAnalyticsEvent(InterfaceEventName.WALLET_PROVIDER_USED, {
source: 'useFeeOnTransferDetectorContract',
contract,
contract: {
name: 'FeeOnTransferDetector',
address: FEE_ON_TRANSFER_DETECTOR_ADDRESS,
},
})
}
}, [account, contract])
......
......@@ -89,7 +89,13 @@ export function useTokenFromMapOrNetwork(tokens: TokenMap, tokenAddress?: string
if (tokenFromNetwork) {
sendAnalyticsEvent(InterfaceEventName.WALLET_PROVIDER_USED, {
source: 'useTokenFromActiveNetwork',
token: tokenFromNetwork,
token: {
name: tokenFromNetwork?.name,
symbol: tokenFromNetwork?.symbol,
address: tokenFromNetwork?.address,
isNative: tokenFromNetwork?.isNative,
chainId: tokenFromNetwork?.chainId,
},
})
}
}, [tokenFromNetwork])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment