Mirror
This repo mirrors from THORChain Gitlab to Github. To contribute, please contact the team and commit to the Gitlab repo:
BEPSwap is UniSwap for BinanceChain. It will be the first go-to market product for THORChain and makes some compromises as to infrastructure and trustlessness. It will only swap BNB and BEP2 assets on Binance Chain using a second layer protocol that moves assets around on BNB accounts.
- Update CI variable for website status Chaosnet: REACT_APP_MAINNET_STATUS=maintenance (or live) Testnet: REACT_APP_WEBSITE_STATUS=maintenance (or live)
- Run CI Action for deploy
- Go to Gitlab pipelines (https://gitlab.com/thorchain/bepswap/bepswap-web-ui/-/pipelines)
- Run deploy action for Chaosnet (or Testnet)
- React / Redux / Redux-Saga
- Ant Design
- Styled-components
- Storybook
- Jest / Enzyme
- ESLint / Prettier
- GitLab CI
yarn
node v12^
Refer .env.sample
REACT_APP_BINANCE_MAINNET_WS_URI = wss://dex.binance.org/api/ws
REACT_APP_BINANCE_TESTNET_WS_URI = wss://testnet-dex.binance.org/api/ws
REACT_APP_BINANCE_MAINNET_URL = https://dex.binance.org/api/v1
REACT_APP_BINANCE_TESTNET_URL = https://testnet-dex.binance.org/api/v1
REACT_APP_MIDGARD_API_URL = https://midgard.bepswap.com
REACT_APP_MIDGARD_TEST_API = https://midgard.bepswap.com
REACT_APP_MIDGARD_CHAOSNET_API_URL = https://chaosnet-midgard.bepswap.com
REACT_APP_WEBSITE_STATUS = live OR maintenance
REACT_APP_MAINNET_STATUS = live OR maintenance
REACT_APP_NET = mainnet OR testnet
yarn install
yarn start
start
: start local development appstart-s
: start local development app with SSL allowedmainnet
: start local development app with mainnet modebuild
: build react projecttest
: unit test with jest / enzymetest:all
: Run entire test suitetest:unit
: unit test with jest / enzymetest:feat
: build the project and run all feature testscy:run
: run cypress tests in isolationstorybook
: run storybook for projectbuild-storybook
: build storybook into the dirbuild/storybook
deploy
: deploy the project on firebaselint
: lint code with eslint ruleslint:watch
: lint watch modeeject
: eject CRA (not recommended)generate:types
: Generate TypeScript types and API function calls for Midgards API endpoints
All types and api function calls for Midgard API are generated by openapi-generator. Whenever an endpoint of Midgards API has been added or updated, all types should be re-generated and changes are commited into the repository.
yarn generate:types
To run the entire test suite
yarn test
yarn test:unit
- Run all unit tests with jest/enzyme, react-test-renderer
To build the project and run all feature tests
yarn test:feat
- Create a new build
- Launch test server on http://localhost:8080 with a simple non-production ready file server
- Run feature tests over the build at http://localhost:8080
To run feature tests against a server set the CYPRESS_baseUrl
env var:
CYPRESS_baseUrl=https://testnet.bepswap.net yarn cy:run
The default is http://localhost:8080
- Run feature tests pointing to given url
To run tests against the local development server use cy:run:dev
First in one terminal window ensure your development server is up:
yarn start
Then in a second terminal run the tests
yarn cy:run:dev
Firebase deploy:
yarn deploy
GitLab CI
- Test
- Deploy
Main Branch:
- master
- useInterval - trigger interval using hooks
- useTimeout - trigger timeout using hooks
- usePrevious - save previous state
- useNetwork - handle all thorchain data and logic
- usePrice - handle pricing logic
- React - React.JS
- Redux - For react global state management
- Styled-components - Style framework
- Storybook - Storybook UI for building components
- firebase - FaaS