Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions packages/transaction-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Expose missing public `TransactionController` methods through its messenger ([#8690](https://github.com/MetaMask/core/pull/8690))
- The following actions are now available:
- `TransactionController:updateSecurityAlertResponse`
- `TransactionController:updatePreviousGasParams`
- `TransactionController:updateRequiredTransactionIds`
- `TransactionController:updateSelectedGasFeeToken`
- `TransactionController:updateTransactionGasFees`
- Corresponding action types are available as well.

## [65.1.0]

### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,17 @@ export type TransactionControllerUpdateTransactionAction = {
handler: TransactionController['updateTransaction'];
};

/**
* Update the security alert response for a transaction.
*
* @param transactionId - ID of the transaction.
* @param securityAlertResponse - The new security alert response for the transaction.
*/
export type TransactionControllerUpdateSecurityAlertResponseAction = {
type: `TransactionController:updateSecurityAlertResponse`;
handler: TransactionController['updateSecurityAlertResponse'];
};

/**
* Remove transactions from state.
*
Expand All @@ -185,6 +196,44 @@ export type TransactionControllerConfirmExternalTransactionAction = {
handler: TransactionController['confirmExternalTransaction'];
};

/**
* Update the gas values of a transaction.
*
* @param transactionId - The ID of the transaction to update.
* @param gasValues - Gas values to update.
* @param gasValues.gas - Same as transaction.gasLimit.
* @param gasValues.gasLimit - Maxmimum number of units of gas to use for this transaction.
* @param gasValues.gasPrice - Price per gas for legacy transactions.
* @param gasValues.maxPriorityFeePerGas - Maximum amount per gas to give to validator as incentive.
* @param gasValues.maxFeePerGas - Maximum amount per gas to pay for the transaction, including the priority fee.
* @param gasValues.estimateUsed - Which estimate level was used.
* @param gasValues.estimateSuggested - Which estimate level that the API suggested.
* @param gasValues.defaultGasEstimates - The default estimate for gas.
* @param gasValues.originalGasEstimate - Original estimate for gas.
* @param gasValues.userEditedGasLimit - The gas limit supplied by user.
* @param gasValues.userFeeLevel - Estimate level user selected.
* @returns The updated transactionMeta.
*/
export type TransactionControllerUpdateTransactionGasFeesAction = {
type: `TransactionController:updateTransactionGasFees`;
handler: TransactionController['updateTransactionGasFees'];
};

/**
* Update the previous gas values of a transaction.
*
* @param transactionId - The ID of the transaction to update.
* @param previousGas - Previous gas values to update.
* @param previousGas.gasLimit - Maximum number of units of gas to use for this transaction.
* @param previousGas.maxFeePerGas - Maximum amount per gas to pay for the transaction, including the priority fee.
* @param previousGas.maxPriorityFeePerGas - Maximum amount per gas to give to validator as incentive.
* @returns The updated transactionMeta.
*/
export type TransactionControllerUpdatePreviousGasParamsAction = {
type: `TransactionController:updatePreviousGasParams`;
handler: TransactionController['updatePreviousGasParams'];
};

/**
* Acquires a nonce lock for the given address on the specified network,
* ensuring that nonces are assigned sequentially without conflicts.
Expand Down Expand Up @@ -331,6 +380,30 @@ export type TransactionControllerUpdateAtomicBatchDataAction = {
handler: TransactionController['updateAtomicBatchData'];
};

/**
* Update the selected gas fee token for a transaction.
*
* @param transactionId - The ID of the transaction to update.
* @param contractAddress - The contract address of the selected gas fee token.
*/
export type TransactionControllerUpdateSelectedGasFeeTokenAction = {
type: `TransactionController:updateSelectedGasFeeToken`;
handler: TransactionController['updateSelectedGasFeeToken'];
};

/**
* Update the required transaction IDs for a transaction.
*
* @param request - The request object.
* @param request.transactionId - The ID of the transaction to update.
* @param request.requiredTransactionIds - The additional required transaction IDs.
* @param request.append - Whether to append the IDs to any existing values. Defaults to true.
*/
export type TransactionControllerUpdateRequiredTransactionIdsAction = {
type: `TransactionController:updateRequiredTransactionIds`;
handler: TransactionController['updateRequiredTransactionIds'];
};

/**
* Emulate a new transaction.
*
Expand Down Expand Up @@ -379,8 +452,11 @@ export type TransactionControllerMethodActions =
| TransactionControllerEstimateGasBatchAction
| TransactionControllerEstimateGasBufferedAction
| TransactionControllerUpdateTransactionAction
| TransactionControllerUpdateSecurityAlertResponseAction
| TransactionControllerWipeTransactionsAction
| TransactionControllerConfirmExternalTransactionAction
| TransactionControllerUpdateTransactionGasFeesAction
| TransactionControllerUpdatePreviousGasParamsAction
| TransactionControllerGetNonceLockAction
| TransactionControllerUpdateEditableParamsAction
| TransactionControllerSetTransactionActiveAction
Expand All @@ -392,6 +468,8 @@ export type TransactionControllerMethodActions =
| TransactionControllerClearUnapprovedTransactionsAction
| TransactionControllerAbortTransactionSigningAction
| TransactionControllerUpdateAtomicBatchDataAction
| TransactionControllerUpdateSelectedGasFeeTokenAction
| TransactionControllerUpdateRequiredTransactionIdsAction
| TransactionControllerEmulateNewTransactionAction
| TransactionControllerEmulateTransactionUpdateAction
| TransactionControllerGetGasFeeTokensAction;
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,12 @@ const MESSENGER_EXPOSED_METHODS = [
'updateCustodialTransaction',
'updateEditableParams',
'updateIncomingTransactions',
'updatePreviousGasParams',
'updateRequiredTransactionIds',
'updateSecurityAlertResponse',
'updateSelectedGasFeeToken',
'updateTransaction',
'updateTransactionGasFees',
'wipeTransactions',
] as const;

Expand Down
5 changes: 5 additions & 0 deletions packages/transaction-controller/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ export type {
TransactionControllerAbortTransactionSigningAction,
TransactionControllerUpdateAtomicBatchDataAction,
TransactionControllerWipeTransactionsAction,
TransactionControllerUpdateSecurityAlertResponseAction,
TransactionControllerUpdateTransactionGasFeesAction,
TransactionControllerUpdatePreviousGasParamsAction,
TransactionControllerUpdateSelectedGasFeeTokenAction,
TransactionControllerUpdateRequiredTransactionIdsAction,
} from './TransactionController-method-action-types';
export {
CANCEL_RATE,
Expand Down
Loading