3a27172e04
* feat: add enviromnemt provider to the ui-toolkit * chore: replace etherscan links * chore: wrap trading app into environment provider * chore: move env provider to react-helpers and wrap every app * chore: remove more env variables from libs and replace them with the env hook * fix: lint * fix: update readme with correct formatting command * fix: warnings for web3 hook * fix: wrap warning in conditional, print message only when env keys are missing * fix: incorrect condition on deposit manager fauceting param Co-authored-by: Matthew Russell <mattrussell36@gmail.com> * fix: cleanup token app ethereum config * chore: add better error handling to the useEnvironment hook * fix: lint * fix: formatting * fix: more lint * fix: throw error if required env variables are missing * fix: remove default eth chain id * fix: add back etherscan testid to withdrawals links * fix: imports * fix: try using babel jest for smart contracts test transpilation * fix: uniform ts syntax * chore: set resolveJsonModule in base tsconfig * fix: add missing data-ids for etherscan links Co-authored-by: Matthew Russell <mattrussell36@gmail.com> |
||
---|---|---|
.. | ||
components | ||
lib | ||
pages | ||
public | ||
specs | ||
.env | ||
.env.devnet | ||
.env.mainnet | ||
.env.stagnet1 | ||
.env.stagnet2 | ||
.env.testnet | ||
.eslintrc.json | ||
client.graphql | ||
index.d.ts | ||
jest.config.js | ||
next-env.d.ts | ||
next.config.js | ||
postcss.config.js | ||
project.json | ||
README.md | ||
sentry.client.config.js | ||
sentry.server.config.js | ||
setup-tests.ts | ||
tailwind.config.js | ||
tsconfig.json | ||
tsconfig.spec.json |
Trading
Development
First copy the configuration of the application you are starting:
cp .env.[environment] .env.local
Starting the app:
yarn nx serve explorer
Configuration
Example configurations are provided here:
There are a few different configuration options offered for this app:
Flag | Purpose |
---|---|
NX_VEGA_ENV |
The name of the currently connected vega environment |
NX_VEGA_URL |
The GraphQL query endpoint of a Vega data node |
NX_ETHEREUM_CHAIN_ID |
The ID of the Ethereum chain the currently connected Vega Network uses. E.g. Ropsten (3) for testnet |
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:
yarn nx test trading
To run the UI automation tests with a mocked API, run:
yarn nx run trading-e2e:e2e