Commit c773fdf
chore(runway): cherry-pick feat: gas station support for metamask pay deposits (#23078)
- 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](https://github.com/MetaMask/MetaMask-planning/issues/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 support to pay balance/fee checks, delegates
getGasFeeTokens, updates transaction-pay-controller to v10, and removes
"no gas" token disabling logic.
>
> - **Confirmations > Alerts**:
> - Handle `fees.isSourceGasFeeToken` in
`useInsufficientPayTokenBalanceAlert` to include source network fees in
totals when using a gas-fee token, and skip native-fee insufficiency in
that case.
> - **Utils**:
> - Simplify `getAvailableTokens` by removing native-gas dependency and
disabling logic; no longer sets `disabled`/`disabledMessage`.
> - **Engine Messenger**:
> - Delegate `TransactionController:getGasFeeTokens` to Transaction Pay
controller messenger.
> - **Dependencies**:
> - Bump `@metamask/transaction-pay-controller` to `^10.0.0`.
> - **Tests**:
> - Update alert tests to use persistent mocks and add cases for gas-fee
token behavior; remove test asserting disabled token when no native gas.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
eac80ae. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
[b5472e1](b5472e1)
Co-authored-by: Matthew Walsh <matthew.walsh@consensys.net>
Co-authored-by: João Loureiro <175489935+joaoloureirop@users.noreply.github.com>1 parent c2cea4a commit c773fdf
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 | |
|---|---|---|---|
| |||
8947 | 8947 | | |
8948 | 8948 | | |
8949 | 8949 | | |
8950 | | - | |
8951 | | - | |
8952 | | - | |
| 8950 | + | |
| 8951 | + | |
| 8952 | + | |
8953 | 8953 | | |
8954 | 8954 | | |
8955 | 8955 | | |
| |||
8963 | 8963 | | |
8964 | 8964 | | |
8965 | 8965 | | |
8966 | | - | |
8967 | | - | |
8968 | | - | |
| 8966 | + | |
| 8967 | + | |
| 8968 | + | |
8969 | 8969 | | |
8970 | 8970 | | |
8971 | 8971 | | |
8972 | 8972 | | |
8973 | | - | |
| 8973 | + | |
8974 | 8974 | | |
8975 | 8975 | | |
8976 | 8976 | | |
| |||
34449 | 34449 | | |
34450 | 34450 | | |
34451 | 34451 | | |
34452 | | - | |
| 34452 | + | |
34453 | 34453 | | |
34454 | 34454 | | |
34455 | 34455 | | |
| |||
0 commit comments