Skip to content

Commit 6f41b3a

Browse files
authored
feat: Add lendingWithdraw type to TransactionController and EarnController (#5936)
### Changes - Add `lendingWithdraw` type to `@metamask/transaction-controller` - Replace hardcoded `"lendingWithdraw"` in `@metamask/earn-controller`
1 parent 13e5f2b commit 6f41b3a

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

packages/earn-controller/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Changed
11+
12+
- Replace hardcoded `"lendingWithdraw"` in `LendingTransactionTypes` with `TransactionType.lendingWithdraw` ([#5936](https://github.com/MetaMask/core/pull/5936))
13+
1014
## [1.0.0]
1115

1216
### Added

packages/earn-controller/src/EarnController.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ const stakingTransactionTypes = new Set<StakingTransactionTypes>([
9898

9999
type LendingTransactionTypes =
100100
| TransactionType.lendingDeposit
101-
| 'lendingWithdraw';
101+
| TransactionType.lendingWithdraw;
102102

103103
const lendingTransactionTypes = new Set<LendingTransactionTypes>([
104104
TransactionType.lendingDeposit,
105-
'lendingWithdraw',
105+
TransactionType.lendingWithdraw,
106106
]);
107107

108108
/**

packages/transaction-controller/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- Add `lendingWithdraw` to `TransactionType` ([#5936](https://github.com/MetaMask/core/pull/5936))
13+
1014
### Fixed
1115

1216
- Avoid coercing `publishBatchHook` to a boolean ([#5934](https://github.com/MetaMask/core/pull/5934))

packages/transaction-controller/src/types.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,11 @@ export enum TransactionType {
678678
*/
679679
lendingDeposit = 'lendingDeposit',
680680

681+
/**
682+
* A transaction that withdraws tokens from a lending contract.
683+
*/
684+
lendingWithdraw = 'lendingWithdraw',
685+
681686
/**
682687
* A transaction for personal sign.
683688
*/

0 commit comments

Comments
 (0)