|
5 | 5 | [clojure.string :as string]
|
6 | 6 | [status-im.constants :as constants]
|
7 | 7 | [status-im.contexts.wallet.collectible.utils :as collectible-utils]
|
| 8 | + [status-im.contexts.wallet.send.transaction-settings.core :as transaction-settings] |
8 | 9 | [status-im.contexts.wallet.send.utils :as send-utils]
|
9 | 10 | [utils.collection :as utils.collection]
|
10 | 11 | [utils.money :as money]
|
|
229 | 230 |
|
230 | 231 | (defn new->old-route-path
|
231 | 232 | [new-path]
|
232 |
| - (let [to-bignumber (fn [k] (-> new-path k money/bignumber))] |
| 233 | + (let [to-bignumber (fn [k] (-> new-path k money/bignumber)) |
| 234 | + suggested-levels-for-max-fees-per-gas (:suggested-levels-for-max-fees-per-gas new-path)] |
233 | 235 | {:approval-fee (to-bignumber :approval-fee)
|
234 | 236 | :approval-l-1-fee (to-bignumber :approval-l-1-fee)
|
235 | 237 | :bonder-fees (to-bignumber :tx-bonder-fees)
|
|
238 | 240 | :amount-in-locked (:amount-in-locked new-path)
|
239 | 241 | :amount-in (:amount-in new-path)
|
240 | 242 | :max-amount-in (:max-amount-in new-path)
|
241 |
| - :gas-fees {:gas-price "0" |
242 |
| - :base-fee (send-utils/convert-to-gwei (:tx-base-fee |
243 |
| - new-path) |
244 |
| - precision) |
| 243 | + :gas-fees {:gas-price "0" |
| 244 | + :base-fee (send-utils/convert-to-gwei (:tx-base-fee |
| 245 | + new-path) |
| 246 | + precision) |
245 | 247 | :max-priority-fee-per-gas (send-utils/convert-to-gwei (:tx-priority-fee
|
246 | 248 | new-path)
|
247 | 249 | precision)
|
248 |
| - :max-fee-per-gas-low (send-utils/convert-to-gwei |
249 |
| - (get-in |
250 |
| - new-path |
251 |
| - [:suggested-levels-for-max-fees-per-gas |
252 |
| - :low]) |
253 |
| - precision) |
254 |
| - :max-fee-per-gas-medium (send-utils/convert-to-gwei |
255 |
| - (get-in |
256 |
| - new-path |
257 |
| - [:suggested-levels-for-max-fees-per-gas |
258 |
| - :medium]) |
259 |
| - precision) |
260 |
| - :max-fee-per-gas-high (send-utils/convert-to-gwei |
261 |
| - (get-in |
262 |
| - new-path |
263 |
| - [:suggested-levels-for-max-fees-per-gas |
264 |
| - :high]) |
265 |
| - precision) |
266 |
| - :l-1-gas-fee (send-utils/convert-to-gwei (:tx-l-1-fee |
267 |
| - new-path) |
268 |
| - precision) |
269 |
| - :eip-1559-enabled true} |
| 250 | + :l-1-gas-fee (send-utils/convert-to-gwei (:tx-l-1-fee |
| 251 | + new-path) |
| 252 | + precision) |
| 253 | + :eip-1559-enabled true |
| 254 | + :tx-max-fees-per-gas (send-utils/convert-to-gwei |
| 255 | + (:tx-max-fees-per-gas |
| 256 | + new-path) |
| 257 | + precision) |
| 258 | + :suggested-gas-fees-for-setting |
| 259 | + {:tx-fee-mode/normal (send-utils/convert-to-gwei |
| 260 | + (:low |
| 261 | + suggested-levels-for-max-fees-per-gas) |
| 262 | + precision) |
| 263 | + :tx-fee-mode/fast (send-utils/convert-to-gwei |
| 264 | + (:medium |
| 265 | + suggested-levels-for-max-fees-per-gas) |
| 266 | + precision) |
| 267 | + :tx-fee-mode/urgent (send-utils/convert-to-gwei |
| 268 | + (:high |
| 269 | + suggested-levels-for-max-fees-per-gas) |
| 270 | + precision)}} |
270 | 271 | :bridge-name (:processor-name new-path)
|
271 | 272 | :amount-out (:amount-out new-path)
|
272 | 273 | :approval-contract-address (:approval-contract-address new-path)
|
|
275 | 276 | :to (:to-chain new-path)
|
276 | 277 | :approval-amount-required (:approval-amount-required new-path)
|
277 | 278 | ;; :cost () ;; tbd not used on desktop
|
278 |
| - :gas-amount (:tx-gas-amount new-path)})) |
| 279 | + :gas-amount (:tx-gas-amount new-path) |
| 280 | + :router-input-params-uuid (:router-input-params-uuid new-path) |
| 281 | + :tx-fee-mode (transaction-settings/gas-rate->tx-fee-mode (:tx-gas-fee-mode |
| 282 | + new-path))})) |
279 | 283 |
|
280 | 284 | (defn tokens-never-loaded?
|
281 | 285 | [db]
|
|
0 commit comments