Skip to content

Commit 9558638

Browse files
authored
Emit a new "smartTransactionConfirmationDone" event (#424)
1 parent 4df1a7b commit 9558638

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/SmartTransactionsController.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,18 @@ export type SmartTransactionsControllerSmartTransactionEvent = {
149149
payload: [SmartTransaction];
150150
};
151151

152+
export type SmartTransactionsControllerSmartTransactionConfirmationDoneEvent = {
153+
type: 'SmartTransactionsController:smartTransactionConfirmationDone';
154+
payload: [SmartTransaction];
155+
};
156+
152157
/**
153158
* The events that {@link SmartTransactionsController} can emit.
154159
*/
155160
export type SmartTransactionsControllerEvents =
156161
| SmartTransactionsControllerStateChangeEvent
157-
| SmartTransactionsControllerSmartTransactionEvent;
162+
| SmartTransactionsControllerSmartTransactionEvent
163+
| SmartTransactionsControllerSmartTransactionConfirmationDoneEvent;
158164

159165
export type AllowedEvents = NetworkControllerStateChangeEvent;
160166

@@ -682,6 +688,11 @@ export default class SmartTransactionsController extends StaticIntervalPollingCo
682688
category: MetaMetricsEventCategory.Transactions,
683689
});
684690
console.error('confirm error', error);
691+
} finally {
692+
this.messagingSystem.publish(
693+
`SmartTransactionsController:smartTransactionConfirmationDone`,
694+
smartTransaction,
695+
);
685696
}
686697
}
687698

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ export type {
66
SmartTransactionsControllerActions,
77
SmartTransactionsControllerStateChangeEvent,
88
SmartTransactionsControllerSmartTransactionEvent,
9+
SmartTransactionsControllerSmartTransactionConfirmationDoneEvent,
910
SmartTransactionsControllerEvents,
1011
} from './SmartTransactionsController';

0 commit comments

Comments
 (0)