Skip to content

Commit d997974

Browse files
committed
fix sdk_action_requested
1 parent eb4cfb2 commit d997974

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/sdk/src/provider/wrapExtensionProvider.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import { MetaMaskInpageProvider } from '@metamask/providers';
2-
import { TrackingEvents } from '@metamask/sdk-communication-layer';
2+
import {
3+
isAnalyticsTrackedRpcMethod,
4+
TrackingEvents,
5+
} from '@metamask/sdk-communication-layer';
6+
import { analytics } from '@metamask/sdk-analytics';
37

48
import { lcAnalyticsRPCs, RPC_METHODS } from '../config';
59
import { MetaMaskSDK } from '../sdk';
@@ -48,6 +52,10 @@ export const wrapExtensionProvider = ({
4852
});
4953
}
5054

55+
if (isAnalyticsTrackedRpcMethod(method)) {
56+
analytics.track('sdk_action_requested', { action: method });
57+
}
58+
5159
if (method === RPC_METHODS.METAMASK_BATCH && Array.isArray(params)) {
5260
return handleBatchMethod({
5361
target,

0 commit comments

Comments
 (0)