-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6a249e4
commit 5ab5356
Showing
1,376 changed files
with
45,856 additions
and
19,738 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ __mocks__ | |
*.inc | ||
*.json | ||
*.md | ||
*.test.ts | ||
*.yml | ||
babel.config.js | ||
build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
diff --git a/android/rninfo.gradle b/android/rninfo.gradle | ||
index c09d2af1d219a4134dc0301e9270aef568730d2b..f1b887cf5dcf56c2f66fff3e6f1b674d48704dac 100644 | ||
--- a/android/rninfo.gradle | ||
+++ b/android/rninfo.gradle | ||
@@ -3,7 +3,8 @@ import groovy.json.JsonSlurper | ||
def getRNVersion = { workingDir -> | ||
println("RNInfo: workingDir=$workingDir") | ||
def jsonSlurper = new JsonSlurper() | ||
- def packageFile = "$workingDir/../node_modules/react-native/package.json" | ||
+ // Fixes patch to node_modules in monorepo project | ||
+ def packageFile = "$workingDir/../../../node_modules/react-native/package.json" | ||
println("RNInfo: reading $packageFile") | ||
Map<String, Object> packageJSON = jsonSlurper.parse(new File(packageFile)) | ||
String rnVersion = packageJSON.get('version') |
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,9 @@ | ||
IPFS hash of the deployment: | ||
- CIDv0: `QmdnXm6P6JYgiiW7hLc8cFmDMQYLE2WuZWAw6JMhxzQTby` | ||
- CIDv1: `bafybeihfqcgfsnr2ocpxfqatxukii6i6vzrv2vjxm7qwnsxemv7sskmudq` | ||
|
||
The latest release is always mirrored at [app.uniswap.org](https://app.uniswap.org). | ||
|
||
You can also access the Uniswap Interface from an IPFS gateway. | ||
**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. | ||
**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). | ||
Your Uniswap settings are never remembered across different URLs. | ||
|
||
IPFS gateways: | ||
- https://bafybeihfqcgfsnr2ocpxfqatxukii6i6vzrv2vjxm7qwnsxemv7sskmudq.ipfs.dweb.link/ | ||
- https://bafybeihfqcgfsnr2ocpxfqatxukii6i6vzrv2vjxm7qwnsxemv7sskmudq.ipfs.cf-ipfs.com/ | ||
- [ipfs://QmdnXm6P6JYgiiW7hLc8cFmDMQYLE2WuZWAw6JMhxzQTby/](ipfs://QmdnXm6P6JYgiiW7hLc8cFmDMQYLE2WuZWAw6JMhxzQTby/) | ||
|
||
### 5.40.1 (2024-07-15) | ||
|
||
|
||
### Bug Fixes | ||
|
||
* **web:** [ext-gtm] Remove outline on button on pageload - prod (#10194) 623eeca | ||
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. | ||
|
||
- Connect to thousands of onchain apps across Ethereum, Base, Arbitrum and many other EVM blockchains | ||
- Explore tokens directly on Uniswap, one of the most trusted DeFi protocols with over $2 trillion in volume | ||
- View all of your crypto assets without switching, across Ethereum and other EVM-compatible blockchains | ||
- Easily create a new wallet or import your existing wallet | ||
- Safely send and receive crypto tokens with other wallets | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
web/5.40.1 | ||
extension/1.0.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
ignores: [ | ||
# Dependencies that depcheck thinks are unused but are actually used | ||
"react-native-web", | ||
"jest-environment-jsdom", | ||
"webpack-cli", | ||
# Dependencies that depcheck thinks are missing but are actually present or never used | ||
## Internal packages / workspaces | ||
"src", | ||
"tsconfig", | ||
# Webpack plugins | ||
"@svgr/webpack", | ||
"tamagui-loader", | ||
"esbuild-loader", | ||
"swc-loader", | ||
## Testing | ||
"@testing-library/dom", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
jest-setup.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
module.exports = { | ||
root: true, | ||
extends: ['@uniswap/eslint-config/native'], | ||
ignorePatterns: ['node_modules', 'dist', '.turbo', 'build', '.eslintrc.js', 'webpack.config.js', 'webpack.dev.config.js', 'manifest.json'], | ||
parserOptions: { | ||
project: 'tsconfig.json', | ||
tsconfigRootDir: __dirname, | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
ecmaVersion: 2018, | ||
sourceType: 'module', | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['*.ts', '*.tsx'], | ||
rules: { | ||
'no-relative-import-paths/no-relative-import-paths': [ | ||
'error', | ||
{ | ||
allowSameFolder: false, | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
rules: {}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dev | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? | ||
|
||
.tamagui | ||
|
||
# Sentry Config File | ||
.env.sentry-build-plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Uniswap Extension | ||
|
||
## Developer Quickstart | ||
|
||
### Running the extension locally | ||
|
||
To run the extension, run the following from the top level of the monorepo: | ||
|
||
```bash | ||
yarn | ||
yarn extension start | ||
``` | ||
|
||
### Environment variables | ||
|
||
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. | ||
|
||
### Loading the extension into Chrome | ||
|
||
1. Go to **chrome://extensions** | ||
2. At the top right, turn on **Developer mode** | ||
3. Click **Load unpacked** | ||
4. Find and select the extension folder (apps/extension/dev) | ||
|
||
## Running the extension locally with an absolute path (for testing scantastic) | ||
|
||
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. | ||
|
||
To run the extension, run the following from the top level of the monorepo: | ||
|
||
Mac: | ||
|
||
```bash | ||
yarn | ||
yarn extension start:absolute | ||
``` | ||
|
||
Windows: | ||
|
||
```bash | ||
yarn | ||
yarn extension start:absolute:windows | ||
``` | ||
|
||
1. Go to **chrome://extensions** | ||
2. At the top right, turn on **Developer mode** | ||
3. Click **Load unpacked** | ||
4. Find and select the extension folder with an absolute path (`/Users/Shared/stretch` on Mac and `C:/ProgramData/stretch` on Windows) | ||
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. | ||
|
||
## Migrations | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import 'utilities/src/logger/mocks' | ||
|
||
import { chrome } from 'jest-chrome' | ||
import { AppearanceSettingType } from 'wallet/src/features/appearance/slice' | ||
import { TextEncoder, TextDecoder } from 'util'; | ||
|
||
process.env.IS_UNISWAP_EXTENSION = true | ||
|
||
global.TextEncoder = TextEncoder; | ||
global.TextDecoder = TextDecoder; | ||
|
||
const ignoreLogs = { | ||
error: [ | ||
// We need to use _persist property to ensure that the state is properly | ||
// rehydrated (https://github.com/Uniswap/universe/pull/7502/files#r1566259088) | ||
'Unexpected key "_persist" found in previous state received by the reducer.' | ||
] | ||
} | ||
|
||
// Ignore certain logs that are expected during tests. | ||
Object.entries(ignoreLogs).forEach(([method, messages]) => { | ||
const key = method | ||
const originalMethod = console[key] | ||
console[key] = ((...args) => { | ||
if (messages.some((message) => args.some((arg) => typeof arg === 'string' && arg.startsWith(message)))) { | ||
return | ||
} | ||
originalMethod(...args) | ||
}) | ||
}) | ||
|
||
globalThis.matchMedia = | ||
globalThis.matchMedia || | ||
((query) => { | ||
const reducedMotion = query.match(/prefers-reduced-motion: ([a-zA-Z0-9-]+)/) | ||
|
||
return { | ||
// Needed for reanimated to disable reduced motion warning in tests | ||
matches: reducedMotion ? reducedMotion[1] === 'no-preference' : false, | ||
addListener: jest.fn(), | ||
addEventListener: jest.fn(), | ||
removeEventListener: jest.fn(), | ||
} | ||
}) | ||
|
||
require('react-native-reanimated').setUpTests() | ||
|
||
global.chrome = chrome | ||
|
||
jest.mock('src/app/navigation/utils', () => ({ | ||
useExtensionNavigation: () => ({ | ||
navigateTo: jest.fn(), | ||
navigateBack: jest.fn(), | ||
}) | ||
})) | ||
|
||
jest.mock('wallet/src/features/focus/useIsFocused', () => { | ||
return jest.fn().mockReturnValue(true) | ||
}) | ||
|
||
const mockAppearanceSetting = AppearanceSettingType.System | ||
jest.mock('wallet/src/features/appearance/hooks', () => { | ||
return { | ||
useCurrentAppearanceSetting: () => mockAppearanceSetting, | ||
} | ||
}) | ||
jest.mock('wallet/src/features/appearance/hooks', () => { | ||
return { | ||
useSelectedColorScheme: () => 'light', | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
const preset = require('../../config/jest-presets/jest/jest-preset') | ||
|
||
const fileExtensions = [ | ||
'eot', | ||
'gif', | ||
'jpeg', | ||
'jpg', | ||
'otf', | ||
'png', | ||
'ttf', | ||
'woff', | ||
'woff2', | ||
'mp4', | ||
] | ||
|
||
module.exports = { | ||
...preset, | ||
preset: 'jest-expo', | ||
transform: { | ||
'^.+\\.(t|j)sx?$': [ | ||
'babel-jest', | ||
{ | ||
configFile: './src/test/babel.config.js', | ||
} | ||
], | ||
}, | ||
moduleNameMapper: { | ||
...preset.moduleNameMapper, | ||
'^react-native$': 'react-native-web', | ||
}, | ||
moduleFileExtensions: [ | ||
'web.js', | ||
'web.jsx', | ||
'web.ts', | ||
'web.tsx', | ||
...fileExtensions, | ||
...preset.moduleFileExtensions, | ||
], | ||
resolver: "<rootDir>/src/test/jest-resolver.js", | ||
displayName: 'Extension Wallet', | ||
collectCoverageFrom: [ | ||
'src/app/**/*.{js,ts,tsx}', | ||
'src/background/**/*.{js,ts,tsx}', | ||
'src/contentScript/**/*.{js,ts,tsx}', | ||
'!src/**/*.stories.**', | ||
'!**/node_modules/**', | ||
], | ||
coverageThreshold: { | ||
global: { | ||
lines: 0, | ||
}, | ||
}, | ||
setupFiles: [ | ||
'../../config/jest-presets/jest/setup.js', | ||
'./jest-setup.js', | ||
'../../node_modules/react-native-gesture-handler/jestSetup.js', | ||
], | ||
} |
Oops, something went wrong.