vega-frontend-monorepo/apps/trading/README.md

58 lines
1.8 KiB
Markdown
Raw Normal View History

## Trading
## Development
First copy the configuration of the application you are starting:
```bash
cp .env.[environment] .env.local
```
Starting the app:
```bash
yarn nx serve explorer
```
### Configuration
Example configurations are provided here:
- [Mainnet](./.env.mainnet)
- [Devnet](./.env.devnet)
- [Testnet](./.env.testnet)
- [Stagnet1](./.env.stagnet1)
feat: 0.54.0 (#949) * chore: remove stagnet2, add stagnet3 * fix: types for transaction order submission (#932) * test: add night runs again (#917) Co-authored-by: Rado <rado@vegaprotocol.io> * chore: update tranches Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Feat/893 anchor per network param (#907) * feat: highlight network param targeted by anchor * Feat/893: Highlighted key-value row colours * Feat/893: Removed unneeded important bangs Co-authored-by: sam-keen <samuel.kleinmann@gmail.com> * Fix/687: Jump to block input should not allow negative block numbers or 0 (#918) * Fix/687: Jump to block input should not allow negative block numbers * Fix/687: Jump to block input should have a minimum of 1 * fix: text and theme icon colors (#920) * Fix/eager connection (#923) * fix: eager connect * chore: add comment for eslint disable * chore: update tranches Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * chore: update tranches Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * chore: update tranches Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * chore: update tranches Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * chore: update tranches Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * chore: update tranches Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * chore: update tranches Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * chore: update tranches Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * chore: update tranches Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * chore: update tranches Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * chore: update tranches Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Task/Remove vegawallet service api client (#916) * chore: remove generated vegawallet client code and implement in rest connector * feat: add zod validation * feat: handle specific auth/token delete case * feat: make withdraw dialog match vega tx dialog * fix: response stub to be right shape, add content type to requests * chore: revert unrelated classname change * feat: [console-lite] - fixes in order margin calcs (#891) * feat: [console-lite] - fixes in order margin calcs * feat: [console-lite] - fixes in order margin calcs - fix decimals * feat: [console-lite] - fixes in order margin calcs - add unit tests * feat: [console-lite] - fixes in order margin calcs - improve cals * feat: [console-lite] - fixes in order margin calcs - improve cals * feat: [console-lite] - fixes in order margin calcs - more improvements Co-authored-by: maciek <maciek@vegaprotocol.io> * fix: make check link unclickable while loading (#928) * fix: make check link unclickable while loading * fix: format * chore: update tranches Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * fix/904: Validators sorting (#913) * fix(790): gap between orderbook headers and tabs (#929) * feat: show correct reward type (#930) * chore: update tranches Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * chore: update tranches Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * chore: update tranches Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Task/remove vegawallet service (#926) * feat: improve error handling * chore: lint * fix: cypress test incorrect assertion * chore: update tranches Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * chore: update tranches Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * chore: update tranches Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * chore: update tranches Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * fix: order transaction types Co-authored-by: Radosław Szpiech <szpiechrados@gmail.com> Co-authored-by: Rado <rado@vegaprotocol.io> Co-authored-by: mattrussell36 <mattrussell36@users.noreply.github.com> Co-authored-by: Edd <edd@vega.xyz> Co-authored-by: sam-keen <samuel.kleinmann@gmail.com> Co-authored-by: Sam Keen <samuel@vegaprotocol.io> Co-authored-by: Matthew Russell <mattrussell36@gmail.com> Co-authored-by: macqbat <kubat.maciek@gmail.com> Co-authored-by: maciek <maciek@vegaprotocol.io> Co-authored-by: asiaznik <artur.siaznik@gmail.com> Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com> * test: fix test import * chore: resolve bad merge files * chore: begin enum changes * test: fix the majority of the tests * test: fix tests * style: lint * fix: update enums * fix: adjusted tests to updated enums * ci: bump capsule * fix: temporarily skip failing staking tests * ci: revert capsule changes * test: fix tests for stats * chore: merge few changes and api updates to stagnet3 updates branch (#1100) * chore: merge few changes and api updates to stagnet3 updates branch * chore: [console-lite] - fast fix in unit test Co-authored-by: maciek <maciek@vegaprotocol.io> * test: fix broken test * chore: change to use the new nodes rather than load balancer * style: formatting * style: formatting * chore: fix env file * fix: don't assume GQL URL path * fix: skip positions query if there is no part * fix: simple trading app test Co-authored-by: botond <105208209+notbot00@users.noreply.github.com> Co-authored-by: Radosław Szpiech <szpiechrados@gmail.com> Co-authored-by: Rado <rado@vegaprotocol.io> Co-authored-by: mattrussell36 <mattrussell36@users.noreply.github.com> Co-authored-by: Edd <edd@vega.xyz> Co-authored-by: sam-keen <samuel.kleinmann@gmail.com> Co-authored-by: Sam Keen <samuel@vegaprotocol.io> Co-authored-by: Matthew Russell <mattrussell36@gmail.com> Co-authored-by: macqbat <kubat.maciek@gmail.com> Co-authored-by: maciek <maciek@vegaprotocol.io> Co-authored-by: asiaznik <artur.siaznik@gmail.com> Co-authored-by: Joe <joe@vega.xyz> Co-authored-by: m.ray <16125548+MadalinaRaicu@users.noreply.github.com>
2022-08-22 22:50:13 +00:00
- [Stagnet3](./.env.stagnet3)
Feat/675: Git info (#683) * feat: add network-switcher lib * feat: add env variables for some deployed app urls * feat: add network processing to environment hoook * refactor: network handling * refactor: remove dialog from provider and add env setter * feat: add network switcher dialog to the trading app * refactor: add network redirect to dialog connect callback * fix: lint * feat: add network configuration files to static app * feat: update environments to use config file instead of static node url * refactor: split out network switcher utils * refactor: split up environment hook * fix: jsonify env variable for possible networks * fix: add formatter file * feat: add network loader component * feat: add network loader to the trading app * fix: assign correct global state to network swicther * feat: add status modal * feat: add network-switcher lib * feat: add env variables for some deployed app urls * feat: add network processing to environment hoook * refactor: network handling * refactor: remove dialog from provider and add env setter * feat: add network switcher dialog to the trading app * refactor: add network redirect to dialog connect callback * fix: lint * fix: jsonify env variable for possible networks * fix: add formatter file * fix: assign correct global state to network swicther * fix: failing tests from UI changes * feat: add environment validation * feat: add runtime validation for network configs * fix: readd node urls to envs to avoid breaking the apps for now * chore: rename network swicther lib to environmnet * fix: lint * feat: add tests for config hook * feat: add environment hook tests * fix: lint * fix: lint * feat: add environment hook tests * feat: add storage tests * fix: formet * feat: improve loading states * fix: format * fix: use router instead of window location * fix: rearrange network loader props and components * fix: remove FC type * fix: env validation * fix: untangle returns in network loader * fix: add teardown for env and localstorage * fix: add custom to env networks * fix: lint * fix: format * fix: lint * fix: remove env provider from simple trading app * fix: remove failing promise hacks * fix: some leftover format files * fix: remove network switcher from tsconf * fix: move Networks to libs/environment * fix: add defaults for ether env vars * feat: add tests for default ether env vars * fix: remove chain id env var from web3 container * fix: remove chain id from the environment * fix: format * fix: lint token * fix: lint env * fix: add comment to callout hack * fix: lint token again * fix: remove skip * fix: move addresses to token app * fix: improve schema validation errors and fix token app * fix: lint * fix: format * fix: format * fix: add network loaders to apps * fix: format * fix: remove logs * fix: cypress process errors * fix: change network loader hierarchy in token * fix: remove stray console.log * fix: revert test changes in simple trading app * fix: prefix env vars with NX Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com> * fix: improve schema validation errors and fix token app * fix: format * fix: disable lint rules for catch block any types * fix: format again * fix: remove redundant process.platform injections * fix: format * feat: add explorer footer * fix: format * feat: add custom executor for next * feat: adjust footer links and add custom executors * fix: lint and format * fix: format again * fix: add explicit github feedback url * fix: create footer lib * feat: add footer to token app * fix: add compiled file to ignore * fix: make lozenge styling more flexible when no variant specified * fix: remove schema duplication for third party executors * fix: add missing intent variant for the lozenge * fix: move commit hash in footer down two positions * fix: revert breaking schema removals * fix: format * chore: rename footer to network-info * fix: format Co-authored-by: Joe <joe@vega.xyz> Co-authored-by: Matthew Russell <mattrussell36@gmail.com> Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com>
2022-07-06 15:53:35 +00:00
For convenience, you can boot the app injecting one of the configurations above by running:
```bash
yarn nx run token:serve --env={env} # e.g. stagnet1
```
There are a few different configuration options offered for this app:
feat(#507): Node Discovery * feat: add network-switcher lib * feat: add env variables for some deployed app urls * feat: add network processing to environment hoook * refactor: network handling * refactor: remove dialog from provider and add env setter * feat: add network switcher dialog to the trading app * refactor: add network redirect to dialog connect callback * fix: lint * feat: add network configuration files to static app * feat: update environments to use config file instead of static node url * refactor: split out network switcher utils * refactor: split up environment hook * fix: jsonify env variable for possible networks * fix: add formatter file * feat: add network loader component * feat: add network loader to the trading app * fix: assign correct global state to network swicther * feat: add status modal * feat: add network-switcher lib * feat: add env variables for some deployed app urls * feat: add network processing to environment hoook * refactor: network handling * refactor: remove dialog from provider and add env setter * feat: add network switcher dialog to the trading app * refactor: add network redirect to dialog connect callback * fix: lint * fix: jsonify env variable for possible networks * fix: add formatter file * fix: assign correct global state to network swicther * fix: failing tests from UI changes * feat: add environment validation * feat: add runtime validation for network configs * fix: readd node urls to envs to avoid breaking the apps for now * chore: rename network swicther lib to environmnet * fix: lint * feat: add tests for config hook * feat: add environment hook tests * fix: lint * fix: lint * feat: add environment hook tests * feat: add storage tests * fix: formet * feat: improve loading states * fix: format * fix: use router instead of window location * fix: rearrange network loader props and components * fix: remove FC type * fix: env validation * fix: untangle returns in network loader * fix: add teardown for env and localstorage * fix: add custom to env networks * fix: lint * fix: format * fix: lint * fix: remove env provider from simple trading app * fix: remove failing promise hacks * fix: some leftover format files * fix: remove network switcher from tsconf * fix: move Networks to libs/environment * fix: add defaults for ether env vars * feat: add tests for default ether env vars * fix: remove chain id env var from web3 container * fix: remove chain id from the environment * fix: format * fix: lint token * fix: lint env * fix: add comment to callout hack * fix: lint token again * fix: remove skip * fix: move addresses to token app * fix: improve schema validation errors and fix token app * fix: lint * fix: format * fix: format * fix: add network loaders to apps * fix: format * fix: remove logs * fix: cypress process errors * fix: change network loader hierarchy in token * fix: remove stray console.log * fix: revert test changes in simple trading app * fix: prefix env vars with NX Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com> * fix: improve schema validation errors and fix token app * fix: format * fix: disable lint rules for catch block any types * fix: format again * fix: remove redundant process.platform injections * fix: format Co-authored-by: Joe <joe@vega.xyz> Co-authored-by: Matthew Russell <mattrussell36@gmail.com> Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com>
2022-06-21 23:20:53 +00:00
The network configuration for the app
| **Flag** | **Purpose** |
| -------------------------- | -------------------------------------------------------------------------------------------------------- |
| `NX_VEGA_ENV` | The name of the currently connected vega environment |
feat(#507): Node Discovery * feat: add network-switcher lib * feat: add env variables for some deployed app urls * feat: add network processing to environment hoook * refactor: network handling * refactor: remove dialog from provider and add env setter * feat: add network switcher dialog to the trading app * refactor: add network redirect to dialog connect callback * fix: lint * feat: add network configuration files to static app * feat: update environments to use config file instead of static node url * refactor: split out network switcher utils * refactor: split up environment hook * fix: jsonify env variable for possible networks * fix: add formatter file * feat: add network loader component * feat: add network loader to the trading app * fix: assign correct global state to network swicther * feat: add status modal * feat: add network-switcher lib * feat: add env variables for some deployed app urls * feat: add network processing to environment hoook * refactor: network handling * refactor: remove dialog from provider and add env setter * feat: add network switcher dialog to the trading app * refactor: add network redirect to dialog connect callback * fix: lint * fix: jsonify env variable for possible networks * fix: add formatter file * fix: assign correct global state to network swicther * fix: failing tests from UI changes * feat: add environment validation * feat: add runtime validation for network configs * fix: readd node urls to envs to avoid breaking the apps for now * chore: rename network swicther lib to environmnet * fix: lint * feat: add tests for config hook * feat: add environment hook tests * fix: lint * fix: lint * feat: add environment hook tests * feat: add storage tests * fix: formet * feat: improve loading states * fix: format * fix: use router instead of window location * fix: rearrange network loader props and components * fix: remove FC type * fix: env validation * fix: untangle returns in network loader * fix: add teardown for env and localstorage * fix: add custom to env networks * fix: lint * fix: format * fix: lint * fix: remove env provider from simple trading app * fix: remove failing promise hacks * fix: some leftover format files * fix: remove network switcher from tsconf * fix: move Networks to libs/environment * fix: add defaults for ether env vars * feat: add tests for default ether env vars * fix: remove chain id env var from web3 container * fix: remove chain id from the environment * fix: format * fix: lint token * fix: lint env * fix: add comment to callout hack * fix: lint token again * fix: remove skip * fix: move addresses to token app * fix: improve schema validation errors and fix token app * fix: lint * fix: format * fix: format * fix: add network loaders to apps * fix: format * fix: remove logs * fix: cypress process errors * fix: change network loader hierarchy in token * fix: remove stray console.log * fix: revert test changes in simple trading app * fix: prefix env vars with NX Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com> * fix: improve schema validation errors and fix token app * fix: format * fix: disable lint rules for catch block any types * fix: format again * fix: remove redundant process.platform injections * fix: format Co-authored-by: Joe <joe@vega.xyz> Co-authored-by: Matthew Russell <mattrussell36@gmail.com> Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com>
2022-06-21 23:20:53 +00:00
| `NX_VEGA_CONFIG_URL` | The network configuration for the app |
| `NX_VEGA_URL` | The GraphQL query endpoint of a [Vega data node](https://github.com/vegaprotocol/networks#data-node) |
| `NX_ETHEREUM_PROVIDER_URL` | The Ethereum Provider URL for getting data from the Ethereum network, for example Infura or a local node |
| `NX_ETHERSCAN_URL` | The Etherscan URL to link Ethereum transactions to |
## Testing
To run the minimal set of unit tests, run the following:
```bash
yarn nx test trading
```
To run the UI automation tests with a mocked API, run:
```bash
yarn nx run trading-e2e:e2e
```