Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate app & implement web3modal #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Crocodile Labs, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
121 changes: 98 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,106 @@
# React + TypeScript + Vite
<a id='top'></a>

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
# Introduction
Welcome to the Ambient Finance platform! Please [click here](https://ambient.finance/) to launch the web app.

Currently, two official plugins are available:
# Table of Contents

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
1. [Instructions for Use](#instructions-for-use)
2. [Contributions](#contributions)
3. [Version Notes](#version-notes)
4. [Contact](#contact)

## Expanding the ESLint configuration
# Instructions for Use

If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
### Dev Mode

- Configure the top-level `parserOptions` property like this:
Clone the repo and use `yarn start` to run the Ambient UI in development mode.

```js
export default {
// other rules...
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
}
```
Open [http://localhost:3000](http://localhost:3000) to view it in a browser.

- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
# ambi-vite
Note: Node v16+ is required

### Environmental Variables

Configure your build environment by adding a dotfile (e.g. `.env.local`) with variable definitions to the top level directory before starting the server. Please reference `.gitignore` in the root directory for dotfile naming conventions.

#### Chain IDs

This allows the app to interface with different networks as defined in the SDK (not all deployments support all networks).

Format: `VITE_CHAIN_IDS=0x1,0x82750,0x5`

Notes:
* `0x1` → Ethereum Mainnet
* `0x82750` → Scroll (Ethereum L2 ZK Rollup)
* `0x5` → Görli Testnet

#### Infura

This is a key for the Infura API which is used to pull metadata from on-chain.

Format: `VITE_INFURA_KEY=*********************`

Notes:
* Please use your own Infura key for development purposes.

[Back to Top](#top)

# Contributions

Contributions are always welcome! Feel free to open a GitHub Issue or Pull Request.

Please see the docs for our coding style guide: https://github.com/CrocSwap/ambient-ts-app/tree/develop/docs

[Back to Top](#top)

# Version Notes
Release notes for app versions.

Quick Links: [1.7](#version-17) (Current) | [1.6](#version-16) | [1.5](#version-15)

### version 1.7
Summary:
* Added automatic gas cost estimate updates and estimate displays in the trade modules on Scroll
* Fixed value calculations for non-default (ETH/USDC) tokens
* Fixed display of ENS name resolutions in trade tables
* Fixed missing chart in transaction details on mobile devices

Code changes are viewable on GitHub [Link](https://github.com/CrocSwap/ambient-ts-app/pull/3269)

### version 1.6
Summary:
* Added the ability to switch to the Scroll network and a test network (Görli) using the network selector in the page header
* Added an external link to [Canto](https://beta.canto.io/lp) in the network selector
* Updated the pool initialization form to enable additionally minting of an initial liquidity position
* Fixed a bug preventing approvals of certain tokens (thanks [busimus](https://github.com/busimus)!)
* Added the ability to annotate the price charts with trend lines and horizontal rays
* Added USD $ value estimation calculations to the token selectors in the swap/limit/pool modules based on CoinGecko

Code changes are viewable on GitHub [Link](https://github.com/CrocSwap/ambient-ts-app/pull/3225)

### version 1.5
Summary:
* Refactored styling for easier future updates to add customizability.

Code changes are viewable on GitHub [Link](https://github.com/CrocSwap/ambient-ts-app/pull/3039)

[Back to Top](#top)

# Contact

### Social Media

* [Twitter](https://twitter.com/ambient_finance "Ambient Finance on Twitter")
* [Discord](https://discord.com/invite/ambient-finance "Ambient Finance on Discord")
* [Medium](https://crocswap.medium.com/ "Crocodile Labs on Medium")
* [Corporate Site](https://www.crocswap.com/ "About Crocodile Labs")

### People

* [Doug Colkitt](mailto:[email protected] "email Doug") is the Founder & CEO of Crocodile Labs
* [Ben Wolski](mailto:[email protected] "email Ben") manages the CI/CD pipeline and production releases
* [Vee](mailto:[email protected] "email Vee") is our Community Manager and handles external communications
* [Emily](mailto:[email protected] "email Emily") is the primary caretaker of this document

[Back to Top](#top)
238 changes: 238 additions & 0 deletions build/ambient-token-list.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,238 @@
{
"name": "Ambient Token List",
"logoURI": "https://ambient.finance/rings_192.png",
"timestamp": "2022-03-17T15:02:53.363Z",
"version": {
"major": 1,
"minor": 0,
"patch": 0
},
"tags": {},
"keywords": ["ambient", "default"],
"tokens": [
{
"name": "Native Ether",
"address": "0x0000000000000000000000000000000000000000",
"symbol": "ETH",
"decimals": 18,
"chainId": 1,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png"
},
{
"name": "USDCoin",
"address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"symbol": "USDC",
"decimals": 6,
"chainId": 1,
"logoURI": "https://assets.coingecko.com/coins/images/6319/thumb/USD_Coin_icon.png"
},
{
"name": "Native Ether",
"address": "0x0000000000000000000000000000000000000000",
"symbol": "ETH",
"decimals": 18,
"chainId": 81457,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png"
},
{
"name": "USDB",
"address": "0x4300000000000000000000000000000000000003",
"symbol": "USDB",
"decimals": 18,
"chainId": 81457,
"logoURI": "https://assets-global.website-files.com/65a6baa1a3f8ed336f415cb4/65c67f0ebf2f6a1bd0feb13c_usdb-icon-yellow.png"
},
{
"name": "Native Ether",
"address": "0x0000000000000000000000000000000000000000",
"symbol": "ETH",
"decimals": 18,
"chainId": 168587773,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png"
},
{
"name": "USDB",
"address": "0x4200000000000000000000000000000000000022",
"symbol": "USDB",
"decimals": 18,
"chainId": 168587773,
"logoURI": "https://assets-global.website-files.com/65a6baa1a3f8ed336f415cb4/65c67f0ebf2f6a1bd0feb13c_usdb-icon-yellow.png"
},
{
"name": "Native Ether",
"address": "0x0000000000000000000000000000000000000000",
"symbol": "ETH",
"decimals": 18,
"chainId": 81457,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png"
},
{
"name": "USDB",
"address": "0x4300000000000000000000000000000000000003",
"symbol": "USDB",
"decimals": 18,
"chainId": 81457,
"logoURI": "https://assets-global.website-files.com/65a6baa1a3f8ed336f415cb4/65c67f0ebf2f6a1bd0feb13c_usdb-icon-yellow.png"
},
{
"name": "Wrapped BTC",
"address": "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",
"symbol": "WBTC",
"decimals": 8,
"chainId": 1,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/logo.png"
},
{
"name": "Pepe",
"address": "0x6982508145454Ce325dDbE47a25d4ec3d2311933",
"symbol": "PEPE",
"decimals": 18,
"chainId": 1,
"logoURI": "https://assets.coingecko.com/coins/images/29850/large/pepe-token.jpeg?1682922725"
},
{
"address": "0x6B175474E89094C44Da98b954EedeAC495271d0F",
"chainId": 1,
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B175474E89094C44Da98b954EedeAC495271d0F/logo.png",
"name": "Dai Stablecoin",
"symbol": "DAI"
},
{
"name": "Native Ether",
"address": "0x0000000000000000000000000000000000000000",
"symbol": "ETH",
"decimals": 18,
"chainId": 5,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png"
},
{
"name": "USDCoin",
"address": "0xD87Ba7A50B2E7E660f678A895E4B72E7CB4CCd9C",
"symbol": "USDC",
"decimals": 6,
"chainId": 5,
"logoURI": "https://assets.coingecko.com/coins/images/6319/thumb/USD_Coin_icon.png"
},
{
"name": "Wrapped BTC",
"address": "0xC04B0d3107736C32e19F1c62b2aF67BE61d63a05",
"symbol": "WBTC",
"decimals": 8,
"chainId": 5,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/logo.png"
},
{
"name": "Native Ether",
"address": "0x0000000000000000000000000000000000000000",
"symbol": "ETH",
"decimals": 18,
"chainId": 421613,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png"
},
{
"name": "USDCoin",
"address": "0xc944b73fba33a773a4a07340333a3184a70af1ae",
"symbol": "USDC",
"decimals": 6,
"chainId": 421613,
"logoURI": "https://assets.coingecko.com/coins/images/6319/thumb/USD_Coin_icon.png"
},
{
"name": "Native Ether",
"address": "0x0000000000000000000000000000000000000000",
"symbol": "ETH",
"decimals": 18,
"chainId": 534351,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png"
},
{
"name": "USDCoin",
"address": "0x4D65fB724CEd0CFC6ABFD03231C9CDC2C36A587B",
"symbol": "USDC",
"decimals": 6,
"chainId": 534351,
"logoURI": "https://assets.coingecko.com/coins/images/6319/thumb/USD_Coin_icon.png"
},
{
"name": "Native Ether",
"address": "0x0000000000000000000000000000000000000000",
"symbol": "ETH",
"decimals": 18,
"chainId": 534352,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png"
},
{
"name": "USDCoin",
"address": "0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4",
"symbol": "USDC",
"decimals": 6,
"chainId": 534352,
"logoURI": "https://assets.coingecko.com/coins/images/6319/thumb/USD_Coin_icon.png"
},
{
"name": "Native Ether",
"address": "0x0000000000000000000000000000000000000000",
"symbol": "ETH",
"decimals": 18,
"chainId": 11155111,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png"
},
{
"name": "USDCoin",
"address": "0x60bBA138A74C5e7326885De5090700626950d509",
"symbol": "USDC",
"decimals": 6,
"chainId": 11155111,
"logoURI": "https://assets.coingecko.com/coins/images/6319/thumb/USD_Coin_icon.png"
},
{
"name": "Wrapped BTC",
"address": "0xCA97CC9c1a1dfA54A252DaAFE9b5Cd1E16C81328",
"symbol": "WBTC",
"decimals": 8,
"chainId": 11155111,
"logoURI": "https://scroll-tech.github.io/token-list/data/WBTC/logo.svg"
},
{
"name": "Tether",
"chainId": 534352,
"address": "0xf55BEC9cafDbE8730f096Aa55dad6D22d44099Df",
"symbol": "USDT",
"decimals": 6,
"logoURI": "https://scroll-tech.github.io/token-list/data/USDT/logo.svg"
},
{
"name": "Wrapped BTC",
"chainId": 534352,
"address": "0x3C1BCa5a656e69edCD0D4E36BEbb3FcDAcA60Cf1",
"symbol": "WBTC",
"decimals": 8,
"logoURI": "https://scroll-tech.github.io/token-list/data/WBTC/logo.svg"
},
{
"name": "Wrapped BTC",
"chainId": 534351,
"address": "0xb3B942b6d4a4858838aAb8f94DdaEdd479CD1594",
"symbol": "WBTC",
"decimals": 8,
"logoURI": "https://scroll-tech.github.io/token-list/data/WBTC/logo.svg"
},
{
"name": "Wrapped stETH",
"address": "0xf610A9dfB7C89644979b4A0f27063E9e7d7Cda32",
"symbol": "wstETH",
"decimals": 18,
"chainId": 534352,
"logoURI": "https://scroll-tech.github.io/token-list/data/wstETH/logo.svg"
},
{
"name": "Dai Stablecoin",
"address": "0xcA77eB3fEFe3725Dc33bccB54eDEFc3D9f764f97",
"chainId": 534352,
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B175474E89094C44Da98b954EedeAC495271d0F/logo.png",
"symbol": "DAI"
}
]
}
File renamed without changes
Binary file added build/ambient_logo_200x200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/android-chrome-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/android-chrome-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading