mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
add Custom Network Added event (#10484)
This commit is contained in:
parent
aabe653240
commit
1d23b59af3
@ -200,9 +200,9 @@ export default class MetaMetricsController {
|
||||
value,
|
||||
currency,
|
||||
category,
|
||||
network: this.network,
|
||||
network: properties?.network ?? this.network,
|
||||
locale: this.locale,
|
||||
chain_id: this.chainId,
|
||||
chain_id: properties?.chain_id ?? this.chainId,
|
||||
environment_type: environmentType,
|
||||
},
|
||||
context: this._buildContext(referrer, page),
|
||||
|
@ -26,6 +26,7 @@ async function addEthereumChainHandler(
|
||||
findCustomRpcBy,
|
||||
updateRpcTarget,
|
||||
requestUserApproval,
|
||||
sendMetrics,
|
||||
},
|
||||
) {
|
||||
if (!req.params?.[0] || typeof req.params[0] !== 'object') {
|
||||
@ -227,6 +228,27 @@ async function addEthereumChainHandler(
|
||||
}),
|
||||
);
|
||||
|
||||
sendMetrics({
|
||||
event: 'Custom Network Added',
|
||||
category: 'Network',
|
||||
referrer: {
|
||||
url: origin,
|
||||
},
|
||||
sensitiveProperties: {
|
||||
chain_id: _chainId,
|
||||
rpc_url: firstValidRPCUrl,
|
||||
network_name: _chainName,
|
||||
// Including network to override the default network
|
||||
// property included in all events. For RPC type networks
|
||||
// the MetaMetrics controller uses the rpcUrl for the network
|
||||
// property.
|
||||
network: firstValidRPCUrl,
|
||||
symbol: ticker,
|
||||
block_explorer_url: firstValidBlockExplorerUrl,
|
||||
source: 'dapp',
|
||||
},
|
||||
});
|
||||
|
||||
await updateRpcTarget(
|
||||
await requestUserApproval({
|
||||
origin,
|
||||
|
Loading…
Reference in New Issue
Block a user