safe-wallet-web icon indicating copy to clipboard operation
safe-wallet-web copied to clipboard

Feat: Native Swaps

Open compojoom opened this issue 1 year ago • 17 comments
trafficstars

What it solves

Resolves #3585

How this PR fixes it

Adds a native swap widget to a new page and shows decoded info for swap orders.

How to test it

  1. Open a Safe
  2. Go to the dashboard
  3. Observe a Swap button in the top right
  4. Observe a Swap button in the Sidebar
  5. Go to the Assets page
  6. Observe a Swap button next to each asset

Screenshots

Checklist

  • [ ] I've tested the branch on mobile 📱
  • [ ] I've documented how it affects the analytics (if at all) 📊
  • [ ] I've written a unit/e2e test for it (if applicable) 🧑‍💻

compojoom avatar Feb 09 '24 10:02 compojoom

Branch preview

✅ Deploy successful!

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

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

github-actions[bot] avatar Feb 09 '24 11:02 github-actions[bot]

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
  • Result: :white_check_mark: success
  • Annotations: 0 total

Report generated by eslint-plus-action

github-actions[bot] avatar Feb 09 '24 11:02 github-actions[bot]

Coverage report

St.:grey_question:
Category Percentage Covered / Total
🟡 Statements
79.19% (-0.13% 🔻)
11626/14682
🔴 Branches
58.16% (-0.56% 🔻)
2754/4735
🟡 Functions
66.19% (-0.26% 🔻)
1860/2810
🟢 Lines
80.53% (-0.06% 🔻)
10479/13012
Show new covered files 🐣
St.:grey_question:
File Statements Branches Functions Lines
🟢
... / swapParamsSlice.ts
63.64% 100% 33.33% 85.71%
🟢
... / swapOrderSlice.ts
87.5% 82.61% 77.78% 89.06%
🟢
... / DataRow.tsx
83.33% 66.67% 100% 100%
🟡
... / index.tsx
71.43% 100% 0% 76.92%
🟢
... / swaps.ts
66.67% 100% 100% 100%
🟡
... / utils.ts
76.67% 65.22% 75% 78.85%
🟡
... / index.tsx
59.26% 0% 0% 66.67%
🟢
... / index.tsx
75% 0% 0% 85.71%
🟡
... / DataTable.tsx
50% 100% 0% 66.67%
🟢
... / index.tsx
88.89% 100% 0% 100%
🟢
... / index.tsx
100% 100% 100% 100%
🟢
... / index.tsx
69.23% 100% 0% 81.82%
🟢
... / useIsExpiredSwap.ts
92.86% 100% 100% 91.67%
🟢
... / index.tsx
57.14% 0% 0% 80%
🔴
... / index.tsx
52.5% 0% 0% 58.33%
🔴
... / index.tsx
38.46% 0% 0% 41.67%
🔴
... / useCustomAppCommunicator.tsx
49.37% 0% 15.79% 49.35%
Show files with reduced coverage 🔻
St.:grey_question:
File Statements Branches Functions Lines
🟡
... / extractTxInfo.ts
78.57% (-4.29% 🔻)
47.5% (+1.79% 🔼)
100%
78.05% (-4.3% 🔻)
🟢 src/utils/chains.ts
91.67% (-8.33% 🔻)
100% 100% 100%
🟢
... / index.tsx
95% (+0.26% 🔼)
90.63% (-5.67% 🔻)
50% 100%
🟢
... / useSafeWalletProvider.tsx
81.82%
63.16% (-1.55% 🔻)
69.23% 83.87%
🟢
... / index.tsx
93.33% (+5.83% 🔼)
50% (-7.14% 🔻)
100% 100%
🟡
... / index.tsx
60% (-2.16% 🔻)
0% 0%
66.67% (-3.03% 🔻)
🟢
... / tx-tracking.ts
93.94% (-2.83% 🔻)
93.75% (-6.25% 🔻)
100%
93.75% (-2.92% 🔻)
🟢
... / index.tsx
100%
90.48% (-2.38% 🔻)
100% 100%
🟡
... / index.tsx
73.53% (+0.2% 🔼)
26.47% (-4.56% 🔻)
42.86% (-7.14% 🔻)
75%
🟡
... / useTransactionType.ts
69.44% (-3.28% 🔻)
42.11% (-3.61% 🔻)
100%
70.59% (-3.61% 🔻)
🟢
... / index.tsx
87.5% (+1.14% 🔼)
50% (-2.94% 🔻)
50%
86.96% (+1.24% 🔼)
🟢
... / index.tsx
89.47% (-4.28% 🔻)
62.5% (-8.93% 🔻)
100%
88.89% (-4.44% 🔻)
🟢
... / useTransactionStatus.ts
88% (-3.3% 🔻)
60% (-6.67% 🔻)
100%
90.91% (-4.09% 🔻)
🔴
... / index.tsx
52.38% (-0.25% 🔻)
0% 0%
55% (-0.56% 🔻)
🟢
... / index.ts
95.45% (-4.55% 🔻)
66.67% 100% 100%

Test suite run success

1464 tests passing in 202 suites.

Report generated by 🧪jest coverage report action from 330d73e916012ff038b60cdbe711c17a25d439c8

github-actions[bot] avatar Feb 09 '24 11:02 github-actions[bot]

📦 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 1011.96 KB (🟡 +1.51 KB)
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!

New Page Added

The following page was added to the bundle from the code in this PR:

Page Size (compressed) First Load
/swap 28.25 KB 1.02 MB

Thirteen 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 50.02 KB (🟡 +3.47 KB) 1.04 MB
/apps/custom 41.64 KB (🟡 +3.47 KB) 1.03 MB
/apps/open 84.88 KB (🟡 +10.85 KB) 1.07 MB
/balances 30.58 KB (🟡 +724 B) 1.02 MB
/home 63.54 KB (🟡 +3.83 KB) 1.05 MB
/new-safe/create 32.23 KB (🟡 +6 B) 1.02 MB
/new-safe/load 18.35 KB (🟡 +6 B) 1.01 MB
/settings/safe-apps 25.33 KB (🟡 +3.47 KB) 1.01 MB
/transactions 108.02 KB (🟡 +6.57 KB) 1.09 MB
/transactions/history 107.99 KB (🟡 +6.57 KB) 1.09 MB
/transactions/messages 67.81 KB (🟡 +6.56 KB) 1.05 MB
/transactions/queue 63.12 KB (🟡 +6.57 KB) 1.05 MB
/transactions/tx 52.95 KB (🟡 +6.57 KB) 1.04 MB
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] avatar Feb 09 '24 11:02 github-actions[bot]

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
  • Result: :white_check_mark: success
  • Annotations: 0 total

Report generated by eslint-plus-action

github-actions[bot] avatar Mar 07 '24 16:03 github-actions[bot]

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
  • Result: :white_check_mark: success
  • Annotations: 0 total

Report generated by eslint-plus-action

github-actions[bot] avatar Apr 08 '24 14:04 github-actions[bot]

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
  • Result: :white_check_mark: success
  • Annotations: 0 total

Report generated by eslint-plus-action

github-actions[bot] avatar Apr 10 '24 10:04 github-actions[bot]

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
  • Result: :white_check_mark: success
  • Annotations: 0 total

Report generated by eslint-plus-action

github-actions[bot] avatar Apr 16 '24 08:04 github-actions[bot]

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
  • Result: :white_check_mark: success
  • Annotations: 0 total

Report generated by eslint-plus-action

github-actions[bot] avatar Apr 17 '24 10:04 github-actions[bot]

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
  • Result: :white_check_mark: success
  • Annotations: 0 total

Report generated by eslint-plus-action

github-actions[bot] avatar Apr 18 '24 11:04 github-actions[bot]

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
  • Result: :white_check_mark: success
  • Annotations: 0 total

Report generated by eslint-plus-action

github-actions[bot] avatar Apr 22 '24 10:04 github-actions[bot]

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
  • Result: :white_check_mark: success
  • Annotations: 0 total

Report generated by eslint-plus-action

github-actions[bot] avatar Apr 26 '24 13:04 github-actions[bot]

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
  • Result: :white_check_mark: success
  • Annotations: 0 total

Report generated by eslint-plus-action

github-actions[bot] avatar Apr 29 '24 14:04 github-actions[bot]

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
  • Result: :white_check_mark: success
  • Annotations: 0 total

Report generated by eslint-plus-action

github-actions[bot] avatar May 01 '24 16:05 github-actions[bot]

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
  • Result: :white_check_mark: success
  • Annotations: 0 total

Report generated by eslint-plus-action

github-actions[bot] avatar May 02 '24 20:05 github-actions[bot]

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
  • Result: :white_check_mark: success
  • Annotations: 0 total

Report generated by eslint-plus-action

github-actions[bot] avatar May 03 '24 15:05 github-actions[bot]

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
  • Result: :white_check_mark: success
  • Annotations: 0 total

Report generated by eslint-plus-action

github-actions[bot] avatar May 06 '24 12:05 github-actions[bot]

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
  • Result: :white_check_mark: success
  • Annotations: 0 total

Report generated by eslint-plus-action

github-actions[bot] avatar May 08 '24 11:05 github-actions[bot]

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
  • Result: :white_check_mark: success
  • Annotations: 0 total

Report generated by eslint-plus-action

github-actions[bot] avatar May 08 '24 16:05 github-actions[bot]