Skip to content

Commit 5ab5356

Browse files
ci(release): publish latest release
1 parent 6a249e4 commit 5ab5356

File tree

1,376 files changed

+45856
-19738
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,376 files changed

+45856
-19738
lines changed

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ __mocks__
1414
*.inc
1515
*.json
1616
*.md
17+
*.test.ts
1718
*.yml
1819
babel.config.js
1920
build
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
diff --git a/android/rninfo.gradle b/android/rninfo.gradle
2+
index c09d2af1d219a4134dc0301e9270aef568730d2b..f1b887cf5dcf56c2f66fff3e6f1b674d48704dac 100644
3+
--- a/android/rninfo.gradle
4+
+++ b/android/rninfo.gradle
5+
@@ -3,7 +3,8 @@ import groovy.json.JsonSlurper
6+
def getRNVersion = { workingDir ->
7+
println("RNInfo: workingDir=$workingDir")
8+
def jsonSlurper = new JsonSlurper()
9+
- def packageFile = "$workingDir/../node_modules/react-native/package.json"
10+
+ // Fixes patch to node_modules in monorepo project
11+
+ def packageFile = "$workingDir/../../../node_modules/react-native/package.json"
12+
println("RNInfo: reading $packageFile")
13+
Map<String, Object> packageJSON = jsonSlurper.parse(new File(packageFile))
14+
String rnVersion = packageJSON.get('version')
-2.15 KB
Binary file not shown.

CODEOWNERS

-1
This file was deleted.

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ An open source repository for all Uniswap front end interfaces maintained by Uni
55
## Interfaces
66

77
- Web: [app.uniswap.org](https://app.uniswap.org)
8-
- Wallet: [wallet.uniswap.org](https://wallet.uniswap.org)
8+
- Wallet (mobile + extension): [wallet.uniswap.org](https://wallet.uniswap.org)
99

1010
## Socials / Contact
1111

@@ -31,6 +31,7 @@ For instructions per application or package, see the README published for each a
3131

3232
- [Web](apps/web/README.md)
3333
- [Mobile](apps/mobile/README.md)
34+
- [Extension](apps/extension/README.md)
3435

3536
## Releases
3637

@@ -43,7 +44,7 @@ Translations for our applications are done through [crowdin](https://crowdin.com
4344
| App | Coverage |
4445
| ------- | -------- |
4546
| web | [![Crowdin](https://badges.crowdin.net/uniswap-interface/localized.svg)](https://crowdin.com/project/uniswap-interface) |
46-
| mobile | [![Crowdin](https://badges.crowdin.net/uniswap-wallet/localized.svg)](https://crowdin.com/project/uniswap-wallet) |
47+
| wallet | [![Crowdin](https://badges.crowdin.net/uniswap-wallet/localized.svg)](https://crowdin.com/project/uniswap-wallet) |
4748

4849
## 🗂 Directory Structure
4950

RELEASE

+7-22
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,9 @@
1-
IPFS hash of the deployment:
2-
- CIDv0: `QmdnXm6P6JYgiiW7hLc8cFmDMQYLE2WuZWAw6JMhxzQTby`
3-
- CIDv1: `bafybeihfqcgfsnr2ocpxfqatxukii6i6vzrv2vjxm7qwnsxemv7sskmudq`
4-
5-
The latest release is always mirrored at [app.uniswap.org](https://app.uniswap.org).
6-
7-
You can also access the Uniswap Interface from an IPFS gateway.
8-
**BEWARE**: The Uniswap interface uses [`localStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage) to remember your settings, such as which tokens you have imported.
9-
**You should always use an IPFS gateway that enforces origin separation**, or our hosted deployment of the latest release at [app.uniswap.org](https://app.uniswap.org).
10-
Your Uniswap settings are never remembered across different URLs.
11-
12-
IPFS gateways:
13-
- https://bafybeihfqcgfsnr2ocpxfqatxukii6i6vzrv2vjxm7qwnsxemv7sskmudq.ipfs.dweb.link/
14-
- https://bafybeihfqcgfsnr2ocpxfqatxukii6i6vzrv2vjxm7qwnsxemv7sskmudq.ipfs.cf-ipfs.com/
15-
- [ipfs://QmdnXm6P6JYgiiW7hLc8cFmDMQYLE2WuZWAw6JMhxzQTby/](ipfs://QmdnXm6P6JYgiiW7hLc8cFmDMQYLE2WuZWAw6JMhxzQTby/)
16-
17-
### 5.40.1 (2024-07-15)
18-
19-
20-
### Bug Fixes
21-
22-
* **web:** [ext-gtm] Remove outline on button on pageload - prod (#10194) 623eeca
1+
Developed by Uniswap Labs, the Uniswap Extension allows you to access and explore onchain apps while maintaining full control of your crypto assets. The Uniswap Extension is the first wallet extension to live in your browser’s sidebar, persisting no matter where you are on the web. So you can explore crypto without obstructing your window or losing your place.
232

3+
- Connect to thousands of onchain apps across Ethereum, Base, Arbitrum and many other EVM blockchains
4+
- Explore tokens directly on Uniswap, one of the most trusted DeFi protocols with over $2 trillion in volume
5+
- View all of your crypto assets without switching, across Ethereum and other EVM-compatible blockchains
6+
- Easily create a new wallet or import your existing wallet
7+
- Safely send and receive crypto tokens with other wallets
248

9+
The Uniswap Extension’s source code is audited by the security firm Trail of Bits as an added measure to ensure that your crypto assets are safe.

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
web/5.40.1
1+
extension/1.0.3

apps/extension/.depcheckrc

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
ignores: [
2+
# Dependencies that depcheck thinks are unused but are actually used
3+
"react-native-web",
4+
"jest-environment-jsdom",
5+
"webpack-cli",
6+
# Dependencies that depcheck thinks are missing but are actually present or never used
7+
## Internal packages / workspaces
8+
"src",
9+
"tsconfig",
10+
# Webpack plugins
11+
"@svgr/webpack",
12+
"tamagui-loader",
13+
"esbuild-loader",
14+
"swc-loader",
15+
## Testing
16+
"@testing-library/dom",
17+
]

apps/extension/.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
jest-setup.js

apps/extension/.eslintrc.js

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
module.exports = {
2+
root: true,
3+
extends: ['@uniswap/eslint-config/native'],
4+
ignorePatterns: ['node_modules', 'dist', '.turbo', 'build', '.eslintrc.js', 'webpack.config.js', 'webpack.dev.config.js', 'manifest.json'],
5+
parserOptions: {
6+
project: 'tsconfig.json',
7+
tsconfigRootDir: __dirname,
8+
ecmaFeatures: {
9+
jsx: true,
10+
},
11+
ecmaVersion: 2018,
12+
sourceType: 'module',
13+
},
14+
overrides: [
15+
{
16+
files: ['*.ts', '*.tsx'],
17+
rules: {
18+
'no-relative-import-paths/no-relative-import-paths': [
19+
'error',
20+
{
21+
allowSameFolder: false,
22+
},
23+
],
24+
},
25+
},
26+
],
27+
rules: {},
28+
}

apps/extension/.gitignore

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dev
12+
dist
13+
dist-ssr
14+
*.local
15+
16+
# Editor directories and files
17+
.vscode/*
18+
!.vscode/extensions.json
19+
.idea
20+
.DS_Store
21+
*.suo
22+
*.ntvs*
23+
*.njsproj
24+
*.sln
25+
*.sw?
26+
27+
.tamagui
28+
29+
# Sentry Config File
30+
.env.sentry-build-plugin

apps/extension/README.md

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Uniswap Extension
2+
3+
## Developer Quickstart
4+
5+
### Running the extension locally
6+
7+
To run the extension, run the following from the top level of the monorepo:
8+
9+
```bash
10+
yarn
11+
yarn extension start
12+
```
13+
14+
### Environment variables
15+
16+
You need to get the environment variables from 1password in order to get full functionality. Run the command `yarn extension env:local:download` to copy them to your root folder.
17+
18+
### Loading the extension into Chrome
19+
20+
1. Go to **chrome://extensions**
21+
2. At the top right, turn on **Developer mode**
22+
3. Click **Load unpacked**
23+
4. Find and select the extension folder (apps/extension/dev)
24+
25+
## Running the extension locally with an absolute path (for testing scantastic)
26+
27+
Our scantastic API requires a consistent origin header so the build must be loaded from an absolute path. This works because Chrome generates a consistent ID for the extension based on the path it was loaded from.
28+
29+
To run the extension, run the following from the top level of the monorepo:
30+
31+
Mac:
32+
33+
```bash
34+
yarn
35+
yarn extension start:absolute
36+
```
37+
38+
Windows:
39+
40+
```bash
41+
yarn
42+
yarn extension start:absolute:windows
43+
```
44+
45+
1. Go to **chrome://extensions**
46+
2. At the top right, turn on **Developer mode**
47+
3. Click **Load unpacked**
48+
4. Find and select the extension folder with an absolute path (`/Users/Shared/stretch` on Mac and `C:/ProgramData/stretch` on Windows)
49+
5. Your chrome extension url should be `chrome-extension://ceofpnbcmdjbibjjdniemjemmgaibeih` on Mac and `chrome-extension://ffogefanhjekjafbpofianlhkonejcoe` on Windows. The backend allows this origin and the ID will be consistently generated based off an absolute path that is consistent on all machines.
50+
51+
## Migrations
52+
53+
We use `redux-persist` to persist the Redux state between user sessions. Most of this state is shared between the mobile app and the extension. Please review the [Wallet Migrations README](../../packages/wallet/src/state//README.md) for details on how to write migrations when you add or remove anything from the Redux state structure.

apps/extension/jest-setup.js

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import 'utilities/src/logger/mocks'
2+
3+
import { chrome } from 'jest-chrome'
4+
import { AppearanceSettingType } from 'wallet/src/features/appearance/slice'
5+
import { TextEncoder, TextDecoder } from 'util';
6+
7+
process.env.IS_UNISWAP_EXTENSION = true
8+
9+
global.TextEncoder = TextEncoder;
10+
global.TextDecoder = TextDecoder;
11+
12+
const ignoreLogs = {
13+
error: [
14+
// We need to use _persist property to ensure that the state is properly
15+
// rehydrated (https://github.com/Uniswap/universe/pull/7502/files#r1566259088)
16+
'Unexpected key "_persist" found in previous state received by the reducer.'
17+
]
18+
}
19+
20+
// Ignore certain logs that are expected during tests.
21+
Object.entries(ignoreLogs).forEach(([method, messages]) => {
22+
const key = method
23+
const originalMethod = console[key]
24+
console[key] = ((...args) => {
25+
if (messages.some((message) => args.some((arg) => typeof arg === 'string' && arg.startsWith(message)))) {
26+
return
27+
}
28+
originalMethod(...args)
29+
})
30+
})
31+
32+
globalThis.matchMedia =
33+
globalThis.matchMedia ||
34+
((query) => {
35+
const reducedMotion = query.match(/prefers-reduced-motion: ([a-zA-Z0-9-]+)/)
36+
37+
return {
38+
// Needed for reanimated to disable reduced motion warning in tests
39+
matches: reducedMotion ? reducedMotion[1] === 'no-preference' : false,
40+
addListener: jest.fn(),
41+
addEventListener: jest.fn(),
42+
removeEventListener: jest.fn(),
43+
}
44+
})
45+
46+
require('react-native-reanimated').setUpTests()
47+
48+
global.chrome = chrome
49+
50+
jest.mock('src/app/navigation/utils', () => ({
51+
useExtensionNavigation: () => ({
52+
navigateTo: jest.fn(),
53+
navigateBack: jest.fn(),
54+
})
55+
}))
56+
57+
jest.mock('wallet/src/features/focus/useIsFocused', () => {
58+
return jest.fn().mockReturnValue(true)
59+
})
60+
61+
const mockAppearanceSetting = AppearanceSettingType.System
62+
jest.mock('wallet/src/features/appearance/hooks', () => {
63+
return {
64+
useCurrentAppearanceSetting: () => mockAppearanceSetting,
65+
}
66+
})
67+
jest.mock('wallet/src/features/appearance/hooks', () => {
68+
return {
69+
useSelectedColorScheme: () => 'light',
70+
}
71+
})

apps/extension/jest.config.js

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
const preset = require('../../config/jest-presets/jest/jest-preset')
2+
3+
const fileExtensions = [
4+
'eot',
5+
'gif',
6+
'jpeg',
7+
'jpg',
8+
'otf',
9+
'png',
10+
'ttf',
11+
'woff',
12+
'woff2',
13+
'mp4',
14+
]
15+
16+
module.exports = {
17+
...preset,
18+
preset: 'jest-expo',
19+
transform: {
20+
'^.+\\.(t|j)sx?$': [
21+
'babel-jest',
22+
{
23+
configFile: './src/test/babel.config.js',
24+
}
25+
],
26+
},
27+
moduleNameMapper: {
28+
...preset.moduleNameMapper,
29+
'^react-native$': 'react-native-web',
30+
},
31+
moduleFileExtensions: [
32+
'web.js',
33+
'web.jsx',
34+
'web.ts',
35+
'web.tsx',
36+
...fileExtensions,
37+
...preset.moduleFileExtensions,
38+
],
39+
resolver: "<rootDir>/src/test/jest-resolver.js",
40+
displayName: 'Extension Wallet',
41+
collectCoverageFrom: [
42+
'src/app/**/*.{js,ts,tsx}',
43+
'src/background/**/*.{js,ts,tsx}',
44+
'src/contentScript/**/*.{js,ts,tsx}',
45+
'!src/**/*.stories.**',
46+
'!**/node_modules/**',
47+
],
48+
coverageThreshold: {
49+
global: {
50+
lines: 0,
51+
},
52+
},
53+
setupFiles: [
54+
'../../config/jest-presets/jest/setup.js',
55+
'./jest-setup.js',
56+
'../../node_modules/react-native-gesture-handler/jestSetup.js',
57+
],
58+
}

0 commit comments

Comments
 (0)