Toolkit for building apps that interact with Vega
Go to file
Matthew Russell f244cd07d4
Feat/103 deposits (#143)
* add web3 provider using web3-react package

* add env setup, add guard for incorrect chain id

* add lib for web3-provider

* make wallet and ethereum connect dialogs look more consistent

* add setup tests file for jest-dom

* remove chain id config and just use appChainId prop, add disconnect button to invalid chainId state

* switch handling of connect dialog state to the consuming app

* rename web3-provider package to just web3

* envs for each environment so we can specify chainId

* make web3container enforce connection before rendering childen

* add web3 provider using web3-react package

* make web3container enforce connection before rendering childen

* add container for getting network params

* Move ethereum config query to web3 container

* add basic deposit form elements

* add queries required for deposits, add asset default

* add bridge contract and deposit transaction

* break txhash

* restrict etherscan link props, use etherscan link in transaction dialogs

* use smart-contracts-sdk

* split hooks and components into different files, fix find deposit logic, add styles and progress for tx dialogs

* fix text colors for dark mode

* improve tx dialogs, rename deposit query

* position use buttons, fix select validation

* fix type errors after not being in strict mode, add allowance checking

* add deposit-limits component, fix types now that strict mode is enabled

* make contract hooks have a single instance

* split out dialogs into separate files, fix icon alignment

* improve error types for use transaction hook, add number save min and max for the amount input

* add validation for ethereum and vega addresses

* add unit test for deposit form component

* add icons and shared dialog styles so it better matches order transaction dialog

* fix underline class, reset finalized deposit

* fix type imports, use i18n function, regen types

* only pass contract address to token contract hook

* add vega env, refactor so retrieving asset contract address logic isn't duplicated

* add faucet functionality, combine dialogs into single transaction-dialog

* combine rendering logic into single func of transaction dialog, rever contract hooks to just useMemo

* use to field rather than connected key

* fix props and imports in deposit form test

* share faucetable condition, pass it to token contract

* pass contracts in as params to hooks to avoid multiple contract instances

* refetch balance in wallet after deposit, add comments

* use hook state for tracking deposit via partyid, add test for use ethereum transaction hook

* add deposits lib

* add last smart contract sdk package

* fix asset import in test

* tidy up ts-ignores

* pass arg for faucetable token contract

* add provider url to env vars and use in place of infura id, also update web3-connector to only allow the chain permitted by the app

* add type guard for erc20 assets

* fix intent shadow helper function, use arrow function for isEthereumError

* update etherscan link to use env vars for url base

* rename deposit related hooks to indicate read vs write calls

* move ethereum error class and helpers to react-helpers

* add use-ethereum-read-contract hook to contain fetch logic

* remove unused import

* move validation to lib, add hex check for vega public key

* use map for transaction modal states, pass confirmed prop to transaction dialog for deposits

* remove unused import for classnames
2022-04-06 10:34:51 -07:00
.github/workflows Task/Updated tests to pass when there are no transactions (#145) 2022-04-04 18:20:33 +01:00
.husky rrun nx commands through yarn 2022-03-02 12:21:58 +00:00
.storybook Add storybook/addon-a11y 2022-03-07 13:57:06 -08:00
.vscode Create a Mono-repo for DeFiUI + ui toolkit using nx 2022-02-11 15:02:11 +01:00
apps Feat/103 deposits (#143) 2022-04-06 10:34:51 -07:00
libs Feat/103 deposits (#143) 2022-04-06 10:34:51 -07:00
tools Create a Mono-repo for DeFiUI + ui toolkit using nx 2022-02-11 15:02:11 +01:00
.editorconfig Normalize line endings (#207) 2022-04-06 11:59:51 +01:00
.eslintrc.json Enable @typescript-eslint/consistent-type-imports eslint rule 2022-03-30 13:05:41 +02:00
.gitattributes Normalize line endings (#207) 2022-04-06 11:59:51 +01:00
.gitignore #29 Add market-list-table 2022-03-18 13:13:14 +01:00
.nvmrc Add .nvmrc and engine, set node version to 16.14.0 2022-02-17 13:43:41 +01:00
.prettierignore #29 Add market-list-table 2022-03-18 13:13:14 +01:00
.prettierrc Create a Mono-repo for DeFiUI + ui toolkit using nx 2022-02-11 15:02:11 +01:00
.sentryclirc Chore/sentry (#163) 2022-03-29 18:29:29 +01:00
babel.config.json Create a Mono-repo for DeFiUI + ui toolkit using nx 2022-02-11 15:02:11 +01:00
CODEOWNERS add code owners 2022-02-23 08:53:57 +00:00
ignore-netlify-build.js Task/Strict mode enabled for trading app (#150) 2022-03-28 12:34:45 -07:00
jest.config.js Create a Mono-repo for DeFiUI + ui toolkit using nx 2022-02-11 15:02:11 +01:00
jest.preset.js Create a Mono-repo for DeFiUI + ui toolkit using nx 2022-02-11 15:02:11 +01:00
LICENSE Create a Mono-repo for DeFiUI + ui toolkit using nx 2022-02-11 15:02:11 +01:00
netlify.toml Task/Orders data provider for libs/order-list (#173) 2022-04-04 13:41:19 -07:00
nx.json [#168] Add static app to host AlphaLyrae font 2022-03-31 09:11:29 +02:00
package.json Feat/103 deposits (#143) 2022-04-06 10:34:51 -07:00
README.md Task/73 Update readme 2022-03-14 08:21:26 -07:00
tsconfig.base.json Feat/103 deposits (#143) 2022-04-06 10:34:51 -07:00
workspace.json Feat/103 deposits (#143) 2022-04-06 10:34:51 -07:00
yarn.lock Feat/103 deposits (#143) 2022-04-06 10:34:51 -07:00

Vega front-end monorepo

The front-end monorepo provides a toolkit for building apps that interact with Vega, as well as the apps themselves.

This repository is managed using Nx.

🔎 Applications in this repo

Block explorer

The Vega block explorer provides an interface that allows users to search for and see transactions, blocks, parties, assets, markets and more on the Vega chain.

Trading UI

The trading interface built based on a component toolkit. It will provide a way for participants to interact with markets and provide resources for others to build additional open-source user interfaces.

🧱 Libraries in this repo

UI toolkit

The UI toolkit contains a set of components used to build interfaces that can interact with the Vega protocol, and follow the design style of the project.

Tailwind CSS config

The Tailwind CSS config contains theme that align default config with Vega design system.

💻 Develop

Build

Run nx build my-app to build the project. The build artifacts will be stored in the dist/ directory. Use the --prod flag for a production build.

Run nx serve my-app for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

Running tests

Run nx test my-app to execute the unit tests with Jest, or nx affected:test to execute just unit tests affected by a change.

Similarly nx e2e my-app will execute the end-to-end tests with Cypress., and nx affected:e2e will execute just the end-to-end tests affected by a change.

Further help with Nx

Visit the Nx Documentation to learn more.

📑 License

MIT