safe-global / safe-wallet-web

Safe{Wallet} – smart contract wallet for Ethereum (ex-Gnosis Safe multisig)
https://app.safe.global
GNU General Public License v3.0
311 stars 360 forks source link

Feat swaps fees [SW-34] #3880

Closed compojoom closed 1 day ago

compojoom commented 6 days ago

What it solves

Swaps now support dynamic fees.

How to test it

Navigate to the swaps widget - enter different amounts to sell. The applied fee should depend on the fiat amount swapped.

Screenshots

Checklist

notion-workspace[bot] commented 6 days ago

Implement a fee tier

github-actions[bot] commented 6 days ago

Branch preview

βœ… Deploy successful!

Website: https://feat_swaps_fees--walletweb.review.5afe.dev/home?safe=eth:0xA77DE01e157f9f57C7c4A326eeE9C4874D0598b6

Storybook: https://feat_swaps_fees--walletweb.review.5afe.dev/storybook/

github-actions[bot] commented 6 days ago

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A

Report generated by eslint-plus-action

github-actions[bot] commented 6 days ago

πŸ“¦ Next.js Bundle Analysis for safe-wallet-web

This analysis was generated by the Next.js Bundle Analysis action. πŸ€–

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 1000.51 KB (🟑 +339 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Seven Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load
/apps/open 53.29 KB (🟒 -144 B) 1.03 MB
/swap 549 B (🟒 -29.56 KB) 1001.05 KB
/transactions 73.42 KB (🟑 +1 B) 1.05 MB
/transactions/history 73.39 KB (🟑 +1 B) 1.05 MB
/transactions/messages 37.93 KB (🟑 +1 B) 1.01 MB
/transactions/queue 31.01 KB (🟑 +1 B) 1.01 MB
/transactions/tx 20.78 KB (🟑 +1 B) 1021.29 KB
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this.

github-actions[bot] commented 6 days ago

Coverage report

St.:grey_question:
Category Percentage Covered / Total
🟑 Statements
78.71% (-0.21% πŸ”»)
11437/14530
πŸ”΄ Branches
58.02% (-0.01% πŸ”»)
2771/4776
🟑 Functions
65.7% (-0.17% πŸ”»)
1833/2790
🟒 Lines
80.12% (-0.2% πŸ”»)
10311/12870
Show new covered files 🐣
|
St.:grey_question:
| File | Statements | Branches | Functions | Lines | | :-: | :- | :- | :- | :- | :- | | 🟒 |
`...` / types.ts
| 100% | 100% | 100% | 100% | | 🟒 |
`...` / fee.ts
| 100% | 92.86% | 100% | 100% | | 🟒 |
`...` / stablecoins.ts
| 100% | 100% | 100% | 100% | | 🟑 |
`...` / OrderFeeConfirmationView.tsx
| 66.67% | 100% | 0% | 75% | | 🟒 |
`...` / index.tsx
| 75% | 100% | 0% | 100% | | πŸ”΄ |
`...` / SurplusFee.tsx
| 35.71% | 0% | 0% | 38.46% |
Show files with reduced coverage πŸ”»
|
St.:grey_question:
| File | Statements | Branches | Functions | Lines | | :-: | :- | :- | :- | :- | :- | | 🟒 |
`...` / safeTheme.ts
|
90.7% (-2.33% πŸ”»)
| 50% |
90% (-3.33% πŸ”»)
|
92.68% (-2.44% πŸ”»)
| | 🟒 |
`...` / swapParamsSlice.ts
|
66.67% (+3.03% πŸ”Ό)
| 100% |
0% (-33.33% πŸ”»)
|
87.5% (+1.79% πŸ”Ό)
| | 🟑 |
`...` / utils.ts
|
73.03% (-7.98% πŸ”»)
|
56.25% (-10.42% πŸ”»)
|
70.59% (-9.41% πŸ”»)
|
75.64% (-6.97% πŸ”»)
| | 🟒 |
`...` / SignMessage.tsx
|
91.18% (-0.25% πŸ”»)
|
77.27% (-4.36% πŸ”»)
| 69.23% |
91.92% (-0.24% πŸ”»)
| | 🟒 |
`...` / index.tsx
| 97.06% |
78.95% (-5.26% πŸ”»)
| 100% | 96.67% | | πŸ”΄ |
`...` / index.tsx
|
52.38% (-16.37% πŸ”»)
| 0% | 0% |
55% (-18.33% πŸ”»)
|

Test suite run success

1417 tests passing in 196 suites.

Report generated by πŸ§ͺjest coverage report action from cce6acc4bf9cced3d7250291189c3b564f206b12

github-actions[bot] commented 2 days ago

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A

Report generated by eslint-plus-action