Commit b5472e1
authored
feat: cp-7.60.0 gas station support for metamask pay deposits (#23033)
## **Description**
Support EIP-7702 gas station when depositing with MetaMask Pay.
## **Changelog**
CHANGELOG entry: null
## **Related issues**
Fixes:
[#6150](MetaMask/MetaMask-planning#6150)
## **Manual testing steps**
## **Screenshots/Recordings**
### **Before**
### **After**
## **Pre-merge author checklist**
- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Adds gas fee token awareness to insufficient balance alerts,
simplifies available token selection logic, delegates getGasFeeTokens,
and upgrades transaction-pay-controller to v10.
>
> - **Confirmations / Alerts**:
> - Consider `fees.isSourceGasFeeToken` in fee/amount calculations and
source network checks within `useInsufficientPayTokenBalanceAlert`.
> - Add tests covering gas fee token scenarios and adjust mocks
accordingly.
> - **Utils (`transaction-pay`)**:
> - Simplify `getAvailableTokens`: remove "no native gas" disablement
and related i18n; return tokens based on balance/selection/required
status only.
> - Update tests to drop disabled-message case.
> - **Engine / Messenger**:
> - Delegate `TransactionController:getGasFeeTokens` to the Transaction
Pay controller messenger.
> - **Dependencies**:
> - Bump `@metamask/transaction-pay-controller` to `^10.0.0` (lockfile
updated).
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
5a0d198. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 2b1a33a commit b5472e1
File tree
7 files changed
+87
-57
lines changed- app
- components/Views/confirmations
- hooks/alerts
- utils
- core/Engine/messengers/transaction-pay-controller-messenger
7 files changed
+87
-57
lines changedLines changed: 70 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
| 114 | + | |
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
| 137 | + | |
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
| 163 | + | |
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
188 | 222 | | |
189 | 223 | | |
190 | 224 | | |
191 | 225 | | |
192 | | - | |
| 226 | + | |
193 | 227 | | |
194 | 228 | | |
195 | 229 | | |
| |||
212 | 246 | | |
213 | 247 | | |
214 | 248 | | |
215 | | - | |
| 249 | + | |
216 | 250 | | |
217 | 251 | | |
218 | 252 | | |
219 | 253 | | |
220 | | - | |
| 254 | + | |
221 | 255 | | |
222 | 256 | | |
223 | 257 | | |
| |||
230 | 264 | | |
231 | 265 | | |
232 | 266 | | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
233 | 295 | | |
234 | 296 | | |
Lines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
67 | | - | |
| 68 | + | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
71 | | - | |
| 72 | + | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
76 | | - | |
| 77 | + | |
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
80 | | - | |
| 81 | + | |
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
| |||
104 | 105 | | |
105 | 106 | | |
106 | 107 | | |
| 108 | + | |
107 | 109 | | |
108 | 110 | | |
109 | 111 | | |
| 112 | + | |
110 | 113 | | |
111 | 114 | | |
112 | 115 | | |
| |||
Lines changed: 0 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
| |||
200 | 199 | | |
201 | 200 | | |
202 | 201 | | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | 202 | | |
223 | 203 | | |
224 | 204 | | |
| |||
Lines changed: 0 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
16 | 14 | | |
17 | 15 | | |
18 | 16 | | |
| |||
126 | 124 | | |
127 | 125 | | |
128 | 126 | | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | 127 | | |
142 | 128 | | |
143 | | - | |
144 | | - | |
145 | 129 | | |
146 | 130 | | |
147 | 131 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
289 | | - | |
| 289 | + | |
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8965 | 8965 | | |
8966 | 8966 | | |
8967 | 8967 | | |
8968 | | - | |
8969 | | - | |
8970 | | - | |
| 8968 | + | |
| 8969 | + | |
| 8970 | + | |
8971 | 8971 | | |
8972 | 8972 | | |
8973 | 8973 | | |
| |||
8981 | 8981 | | |
8982 | 8982 | | |
8983 | 8983 | | |
8984 | | - | |
8985 | | - | |
8986 | | - | |
| 8984 | + | |
| 8985 | + | |
| 8986 | + | |
8987 | 8987 | | |
8988 | 8988 | | |
8989 | 8989 | | |
8990 | 8990 | | |
8991 | | - | |
| 8991 | + | |
8992 | 8992 | | |
8993 | 8993 | | |
8994 | 8994 | | |
| |||
34467 | 34467 | | |
34468 | 34468 | | |
34469 | 34469 | | |
34470 | | - | |
| 34470 | + | |
34471 | 34471 | | |
34472 | 34472 | | |
34473 | 34473 | | |
| |||
0 commit comments