Skip to content

Commit c7f73bd

Browse files
feat: Add SnapInsightsController (#2555)
This PR adds `SnapInsightsController`, which is meant to handle fetching a persistent response from transaction/signature insight Snaps. This controller will temporarily store the insight response, letting the client UI consume it wherever necessary. The controller listens to events from `TransactionController` and `SignatureController` to determine when new signatures or transactions have entered the state. The events immediately trigger requests to any available Snaps. The controller also manages cleaning up its own state as well as the interface state when a confirmation finishes. Most of the controller logic should mirror the implementation currently found in the extension. With the exception that this controller now populates the state as Snaps respond instead of waiting for all the Snaps to load before triggering a state update. Closes #2560
1 parent 1480459 commit c7f73bd

File tree

10 files changed

+1136
-4
lines changed

10 files changed

+1136
-4
lines changed
+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"branches": 92.08,
3-
"functions": 96.77,
4-
"lines": 97.98,
5-
"statements": 97.66
2+
"branches": 92.46,
3+
"functions": 96.91,
4+
"lines": 98.01,
5+
"statements": 97.7
66
}

packages/snaps-controllers/src/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ export * from './snaps';
44
export * from './utils';
55
export * from './cronjob';
66
export * from './interface';
7+
export * from './insights';

0 commit comments

Comments
 (0)