Go to file
Linkie Link 0bc3dcc687
Main update (#801)
* fix: fixed transaction messages (#792)

* Open Source + Docker image (#793)

* feat: added dummy charting library

* feat: added docker workflow

* feat: remove tests and code-coverage

* feat: added final TradingView fallback

* env: set private to false

* fix: added production env

* env: added README and LICENSE

* env: cleanup variables

* env: add license field

* env: finish docker setup

* fix: updated the description of the dummy data

* docker: update actions to node 20 (#796)

* docker: added v2 prefix to tags

* perps: trading fee + expected price (#800)

* env: updated dependencies (#799)

* update docker CI to node 20 (#797)

* fix: fixed transaction messages (#792)

* Open Source + Docker image (#793)

* feat: added dummy charting library

* feat: added docker workflow

* feat: remove tests and code-coverage

* feat: added final TradingView fallback

* env: set private to false

* fix: added production env

* env: added README and LICENSE

* env: cleanup variables

* env: add license field

* env: finish docker setup

* fix: updated the description of the dummy data

* docker: update actions to node 20 (#796)

* docker: added v2 prefix to tags

* env: updated dependencies

---------

Co-authored-by: Bob van der Helm <34470358+bobthebuidlr@users.noreply.github.com>
2024-02-13 17:30:04 +01:00
.github update docker CI to node 20 (#797) 2024-02-13 13:54:00 +01:00
.vscode Upgrade next (#100) 2023-02-24 09:47:27 +01:00
public List milkTIA (#757) 2024-01-31 14:37:31 +01:00
src Main update (#801) 2024-02-13 17:30:04 +01:00
.dockerignore v2.2.2 OS (#794) 2024-02-13 11:33:13 +01:00
.env v2.2.2 OS (#794) 2024-02-13 11:33:13 +01:00
.env.example v2.2.2 OS (#794) 2024-02-13 11:33:13 +01:00
.env.production v2.2.2 OS (#794) 2024-02-13 11:33:13 +01:00
.eslintignore [task] add LTV to vault tables (#381) 2023-08-21 14:02:32 +03:00
.eslintrc.json feat: refactored the toast responses (#442) 2023-09-11 10:35:13 +02:00
.gitignore v2.2.2 OS (#794) 2024-02-13 11:33:13 +01:00
.prettierignore v2.0.1 (#579) 2023-10-24 16:41:40 +02:00
.prettierrc feat: refactored the toast responses (#442) 2023-09-11 10:35:13 +02:00
Dockerfile v2.2.2 OS (#794) 2024-02-13 11:33:13 +01:00
entrypoint.sh v2.2.2 OS (#794) 2024-02-13 11:33:13 +01:00
generate_types.sh Withdraw assets from account (#43) 2022-11-07 16:36:12 +00:00
install_charting_library.js v2.2.2 OS (#794) 2024-02-13 11:33:13 +01:00
install_charting_library.sh v2.2.2 OS (#794) 2024-02-13 11:33:13 +01:00
install_dummy_charting_library.sh v2.2.2 OS (#794) 2024-02-13 11:33:13 +01:00
LICENSE v2.2.2 OS (#794) 2024-02-13 11:33:13 +01:00
next-config.patch v2.2.2 OS (#794) 2024-02-13 11:33:13 +01:00
next.config.js v2.2.2 OS (#794) 2024-02-13 11:33:13 +01:00
package.json Main update (#801) 2024-02-13 17:30:04 +01:00
postcss.config.js initial setup wip 2022-09-02 15:30:58 +01:00
README.md v2.2.2 OS (#794) 2024-02-13 11:33:13 +01:00
sentry.client.config.js WIP (#12) 2022-09-29 20:21:31 +01:00
sentry.properties sentry setup 2022-09-02 22:29:22 +01:00
sentry.server.config.js WIP (#12) 2022-09-29 20:21:31 +01:00
tailwind.config.js Morph summary (#763) 2024-02-06 10:05:42 +01:00
tsconfig.json Websocket implementation (#726) 2024-01-12 09:07:55 +01:00
vercel.json Env update (#113) 2023-03-09 10:26:16 +01:00
yarn.lock Main update (#801) 2024-02-13 17:30:04 +01:00

Mars Protocol v2 Outpost Frontend

mars-banner-1200w

1. Web App

This project is a NextJS. React application.

The project utilises React hooks, functional components, Zustand for state management, and useSWR for general data fetching and management.

Styles are handled with Tailwind.

Typescript is added and utilised (but optional if you want to create .jsx or .tsx files).

2. Deployment

Start web server

yarn && yarn dev

2.1 Custom node endpoints using Docker

We allow the use of environment variables to be passed to the Docker container to specify custom endpoints for the app. The variables are:

Variable Description Default
URL_OSMOSIS_REST The Osmosis node REST endpoint to use https://lcd-osmosis.blockapsis.com/
URL_OSMOSIS_RPC The Osmosis node RPC endpoint to use https://rpc-osmosis.blockapsis.com/
WALLET_CONNECT_ID Your projects WalletConnect v2 ID 0x0x0x0x0x0x0x0x0x0x0x0x0x0x0x0x0x0x0x0x

Sample Docker run command

This command will start the container in interactive mode with port 3000 bound to localhost and print logs to stdout.

docker run -it -p 3000:3000 \
      -e URL_OSMOSIS_REST=https://lcd-osmosis.blockapsis.com/ \
      -e URL_OSMOSIS_RPC=https://rpc-osmosis.blockapsis.com/ \
      -e WALLET_CONNECT_ID=0x0x0x0x0x0x0x0x0x0x0x0x0x0x0x0x0x0x0x0x marsprotocol/interface:latest

2.2 Custom node endpoints using non-Docker deployments

Copy .env.example to .env and modify the values to suit your needs.

2.2.1 TradingView library

The Outpost UI has a TradingView implementation, to display charts for the listed assets.

TradingView only works on non-docker deployments (e.g. via vercel). As the docker image already has a fallback installed and can not be updated on docker run

If you are running the UI on a node based server, add the following environment variables to install TradingView.

CHARTING_LIBRARY_USERNAME=YOUR_GIT_USERNAME
CHARTING_LIBRARY_ACCESS_TOKEN=YOUR_TRADING_VIEW_ACCESS_TOKEN
CHARTING_LIBRARY_REPOSITORY=github.com/tradingview/charting_library/

NOTE: You'll also need to have an active TradingView license to obtain those credentials

4. Development practices

4.1 Data orchestration

Data is handled with a combination of container components, useSWR and a caching mechanism. API hooks are responsible for syncing the application state.

5. Contributing

We welcome and encourage contributions! Please create a pull request with as much information about the work you did and what your motivation/intention was.

6. License

Contents of this repository are open source under the Mars Protocol Web Application License Agreement.