Commit Graph

238 Commits

Author SHA1 Message Date
John Walley
f721a21d0f
Feat/129 pennant chart (#214)
* initial commit for adding chartt lib with pennant chart

* add pennant package, fix dynamic import of chart

* use updated pennant library

* Create separate chart and depth-chart libs

* Remove leftover generated files

* Use more targeted queries and subscriptions

* Fix jestConfig value for depth-chart

* Add jest-canvas-mock

* Refactor updateDepthUpdate function

* Add updateDpethUpdate test

* Add jest-canvas-mock to chart tests

* Avoid using any type in test

* Use correct casing for gql queries and subscriptions

* Make ButtonRadio generic in option value type

* Add padding and margin to chart container

* Remove unused subscriptions and methods from data source

* Use correct React imports

Co-authored-by: Matthew Russell <mattrussell36@gmail.com>
2022-04-08 10:49:45 -07:00
Matthew Russell
98c1fc82f7
Feat/152 Trade list MVP (#217)
* add trades lib with data provider

* add trades table and cell color logic

* ensure we only show last 50 rows

* add test for table columns and formatting

* update trades table to get cells using col-id

* fix linting

* use default function param for fetchpolicy
2022-04-07 06:41:57 -07:00
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
Bartłomiej Głownia
6cbc701384
[#168] Use static resources from static.vega.xyz (#205) 2022-04-06 11:36:36 +01:00
Matthew Russell
018e5fe139
Task/33 add sentry to trading (#189)
* add sentry setup, add VEGA_ENV to env files

* rename custom error page

* capture exception for eager connect

* add link to setup docs in comment

* add browser tracing plugin

* define sentry auth token once

* enable sourcemaps on build

* use correct sentry config property
2022-04-04 12:45:40 -07:00
Joe Tsang
205f4124f1
Test/deal ticket tests (#161)
* scaffold dealticket package, remove trading views from react-helpers

* add deal ticket component, add intent utils, expand dialog and form group styles

* add splash component, show market not found message if market doesnt exist

* tidy up error handling

* add handleError method for vega tx hook

* add better testname for provider test, flesh out tests a bit more for deal ticket

* Add unit tests for useVegaTransaction and useOrderSubmit hooks

* add wrapper component for order dialog styles

* add vega styled loader to ui toolkit and use in order dialog

* add title prop to order dialog

* split limit and market tickets into own files

* add button radio component

* revert dialog styles

* move splash component to ui-toolkit, add story

* convert intent to enum

* Make button always type=button unless type prop is passed

* inline filter logic for tif selector

* add date-fns, add datetime to helpers

* add order types to wallet package, make price undefined if order type is market

* use enums in deal ticket logic

* tidy up order state by moving submit and transaction hooks out of deal ticket

* add comment for dialog styles

* remove decimal from price input

* add types package, delete old generated types from trading project

* rename types package to graphql

* update generate command to point to correct locations

* fix use order submit test

* BDD and navigation tests passing

* Remove commented steps

* Steps up to placing order

* Date picker and date-fns update

* Vega connector wallet tests

* Passing up to request sent, updated date picker

* Tests for sell orders and errors

* Update market feature

* Fix failing tests

* Update wallet login

* Readded tx hash assertion and remaining tests

* Add CI wallet import

* Update .github/workflows/cypress.yml

Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com>

* Resolved PR comments

* Fix yaml error

* Attempt to fix failing tests in CI

* Run Cypress in Chrome

* Add reload if public key error displayed

* Fix wallet name

* Add force click and waits

* Increase timeout for deal ticket page

* Removed network list from yaml and using input error id

* Increase timeout to 8 seconds

* Re add deleted test id

Co-authored-by: Matthew Russell <mattrussell36@gmail.com>
Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com>
2022-04-04 16:11:27 +01:00
Matthew Russell
15551b65e5
Feat/83 switching vega key (#156)
* add manage dialog to wallet lib, add it to trading app

* add test for wallet button

* add tests for manage dialog

* move tooltip to ui-toolkit, add copy with tooltip component for manage dialog

* add better labelling

* add tooltip story

* add story for copy-with-tooltip

* add tests for tooltip and copy-with-tooltip

* move useFakeTimers call to beforeAll

* adjust design of manage dialog

* fix linting issues
2022-03-31 10:16:30 -07:00
Matthew Russell
4899d1bce8
Task/Mark translations (#174)
* add dummy i18n translate function to market text that will need translation in future

* add i18n function to aria-labels
2022-03-30 18:08:25 -07:00
Bartłomiej Głownia
7af0efa8d8 Enable @typescript-eslint/consistent-type-imports eslint rule 2022-03-30 13:05:41 +02:00
Matthew Russell
d3d28947ea tidy up deal ticket query and market page query 2022-03-29 16:19:23 -07:00
Matthew Russell
edce1c7869 rename graphql dir to types 2022-03-29 16:03:27 -07:00
Matthew Russell
3f62c79f8d colocate querys with libs 2022-03-29 15:52:51 -07:00
Bartłomiej Głownia
9c42f54331 [#128] Fix type issues 2022-03-29 19:31:00 +02:00
Bartłomiej Głownia
444f1b6584 [#128] Capitalize types in position queries 2022-03-29 19:13:01 +02:00
Bartłomiej Głownia
a68bce9ed1 [#108] replace assign-deep with loadash/merge 2022-03-29 19:13:00 +02:00
Bartłomiej Głownia
e3a1142579 [#128] Add variales handling in data provider 2022-03-29 19:13:00 +02:00
Bartłomiej Głownia
aec5d54820 [#128] add <Positions/> component to trade-grid, add useDataProvider hook 2022-03-29 19:12:45 +02:00
Bartłomiej Głownia
95f66ccd9b [#128] Make market data provider generic 2022-03-29 18:57:10 +02:00
Sam Keen
47e703c558
Merge pull request #149 from vegaprotocol/feat/113-stats-use-theme-switch-hook-and-ui
Feat/113 stats use theme switch hook and UI
2022-03-29 12:49:05 +01:00
Matthew Russell
d4652b3dd8
Task/Strict mode enabled for trading app (#150)
* enable strict mode and fix resulting type errors

* fix print affected command

* remove assign-deep and use lodash/merge, fix some type errors after enabling strict mode
2022-03-28 12:34:45 -07:00
sam-keen
e308a923c2 Moved the theme switcher hook into a shared lib 2022-03-25 16:45:12 +00:00
Bartłomiej Głownia
ddb0681fb5
Merge branch 'master' into feature/29-market-list-table-improvments 2022-03-25 15:31:49 +01:00
Matthew Russell
8e9c2e4080
Feat/105 Web3 Setup (#119)
* add deposit page

* 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

* remove .env file for now, will complete as own ticket

* 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

* remove fallback to testnet for apollo client creation

* make web3container enforce connection before rendering childen

* move infura id to env var
2022-03-25 00:44:10 -07:00
Matthew Russell
ed8db76af7
Task/AgGrid and responsive nav font size (#130)
* add custom properties to style ag grid tables

* use theme styles, make nav text sizes responsive

* move row and header heights to parent

* use max-w-full
2022-03-24 11:08:57 -07:00
Bartłomiej Głownia
fae1b8a5ee Cleanup after tests of ag-grid optimization 2022-03-24 18:29:56 +01:00
Bartłomiej Głownia
1db7919875 Code style fixes 2022-03-24 14:29:51 +01:00
Bartłomiej Głownia
f2e297ce39 Cleaup after use-markets hook 2022-03-24 14:29:49 +01:00
Bartłomiej Głownia
4698e532c1 Use data markets data provider instead of use-markets hook 2022-03-24 14:29:12 +01:00
Bartłomiej Głownia
2c28c9dd2d Test ag-grid optimization approach 2022-03-24 14:27:00 +01:00
Bartłomiej Głownia
319d3adf23 Unmount singleton hook if no consumers left 2022-03-24 14:22:46 +01:00
Matthew Russell
6ad2a7676e
Feat/84 Order list (#89)
* scaffold dealticket package, remove trading views from react-helpers

* add deal ticket component, add intent utils, expand dialog and form group styles

* add splash component, show market not found message if market doesnt exist

* tidy up error handling

* add handleError method for vega tx hook

* add better testname for provider test, flesh out tests a bit more for deal ticket

* Add unit tests for useVegaTransaction and useOrderSubmit hooks

* add wrapper component for order dialog styles

* add vega styled loader to ui toolkit and use in order dialog

* add title prop to order dialog

* add button radio component

* revert dialog styles

* move splash component to ui-toolkit, add story

* convert intent to enum

* add date-fns, add datetime to helpers

* add order types to wallet package, make price undefined if order type is market

* tidy up order state by moving submit and transaction hooks out of deal ticket

* add types package, delete old generated types from trading project

* rename types package to graphql

* add order list container and order list component

* add test setup for useOrders

* add test for use-orders hook

* tidy unnecessary diff

* regen types and use them in order-list, also change to use applytransaction hook for orderlist grid

* make order table columns resizable

* make market table not have highlightable cells, use splash for orders errors and loading states, unit test for orderlist container

* add tests for order list table

* show rejection reason and expires at depending on status and tif

* add decimal places to query

* only update row if data has changed, add test coverage

* add setup tests file to avoid importing jest-dom for every test, add async-renderer component to handle fetch ui logic

* install all of lodash but import individually to get tree shaking

* add setup tests file for orderlist package

* add missing fields to use orders spec mock order

* fix act warnings in index page test

* fix casing of app import

* remove react-singleton-hook, simplify side formatting

* fix linting errors
2022-03-23 12:08:10 -07:00
Bartłomiej Głownia
3e69e53c4e #29 Add market-list-table 2022-03-18 13:13:14 +01:00
Matthew Russell
313e6e1217
Feat/63 Deal ticket (#82)
* scaffold dealticket package, remove trading views from react-helpers

* add deal ticket component, add intent utils, expand dialog and form group styles

* add splash component, show market not found message if market doesnt exist

* tidy up error handling

* add handleError method for vega tx hook

* add better testname for provider test, flesh out tests a bit more for deal ticket

* Add unit tests for useVegaTransaction and useOrderSubmit hooks

* add wrapper component for order dialog styles

* add vega styled loader to ui toolkit and use in order dialog

* add title prop to order dialog

* split limit and market tickets into own files

* add button radio component

* revert dialog styles

* move splash component to ui-toolkit, add story

* convert intent to enum

* Make button always type=button unless type prop is passed

* inline filter logic for tif selector

* add date-fns, add datetime to helpers

* add order types to wallet package, make price undefined if order type is market

* use enums in deal ticket logic

* tidy up order state by moving submit and transaction hooks out of deal ticket

* add comment for dialog styles

* remove decimal from price input

* add types package, delete old generated types from trading project

* rename types package to graphql

* update generate command to point to correct locations

* fix use order submit test

* use intent shadow helper

* remove date-fns and format manually, update submit button error to use input-error

* remove stray console.log
2022-03-17 12:35:46 -07:00
Dexter Edwards
7b4437f407
regenerate based on new API client (#86)
* regenerate based on new API client

* lint

* run projects on different ports
2022-03-17 09:09:48 +00:00
Bartłomiej Głownia
8a829964be
Feature/38 data grid component (#77)
* Add ag-grid

* Add lazy loaded ag-grid component

* Add theme context, move VegaWallet to separate lib

* Fix trading app cypress configuration

* Lazy load ag-grid theme css files

* Encapsulate theme switch hook
2022-03-14 14:18:11 +01:00
Matthew Russell
deb4570ebe fix dark theme for trading grid 2022-03-10 21:19:44 -08:00
Matthew Russell
634075e015 remove unused hook from index page 2022-03-10 21:09:34 -08:00
Matthew Russell
dbe9e9504f fix navbar styles 2022-03-10 21:03:02 -08:00
Matthew Russell
141ef8224b tidy up _app move logic to hooks and add component files for vega connect button and app loader 2022-03-10 20:51:05 -08:00
Matthew Russell
a47e4526bb fix vega connect button alignment 2022-03-10 20:51:05 -08:00
Matthew Russell
1859fef75c fix invalid syntax 2022-03-10 20:51:05 -08:00
Matthew Russell
fdc5e68158 tidy up storage keys in wallet provider 2022-03-10 20:51:05 -08:00
Matthew Russell
9bffb15c2a use compoments from ui-toolkit, minor style changes 2022-03-10 20:51:05 -08:00
Matthew Russell
0b3bf269b6 tidy styles and tailwind config 2022-03-10 20:51:05 -08:00
Matthew Russell
473f74adca fix styles after rebase 2022-03-10 20:51:05 -08:00
Matthew Russell
d1f44589cc add nav item for home and use pubkey on portfolio page 2022-03-10 20:51:05 -08:00
Matthew Russell
3f9f97b1fa fix navbar and default select value 2022-03-10 20:51:05 -08:00
Matthew Russell
ac4f833360 make manager component not take children 2022-03-10 20:51:05 -08:00
Matthew Russell
e92e708cf1 add vega wallet manager component and re add current single pubkey to provider state 2022-03-10 20:51:05 -08:00
Matthew Russell
84af6177ad update eager connect hook and make app concerned with selected pubkey, refactor token to be stored as object 2022-03-10 20:51:05 -08:00
Matthew Russell
195fff27ab remove react helper/ui-toolkit demo components 2022-03-10 20:51:05 -08:00
Matthew Russell
bb485d5783 add useEagerConnect hook 2022-03-10 20:51:05 -08:00
Matthew Russell
59d0beebe2 add current key selector, fix revoke token/disconnect 2022-03-10 20:51:05 -08:00
Matthew Russell
fba3101753 refactor so that consuming app chooses to render modal and what connectors to use 2022-03-10 20:51:05 -08:00
Matthew Russell
ff24a4a3ba add dialog to ui-toolkit, add functionality to provider to render connect dialog and connectors ui 2022-03-10 20:51:05 -08:00
Bartłomiej Głownia
da37ecf72d Improve market page and tabs look and feel 2022-03-09 16:09:17 -08:00
Bartłomiej Głownia
ebbd50edf3 Setup dark and light theme in trading app 2022-03-09 16:09:17 -08:00
Bartłomiej Głownia
e8a795461d Add theme switcher component 2022-03-09 16:09:17 -08:00
Matthew Russell
351cd77f84 move trading views to react helpers 2022-03-02 12:21:35 -08:00
Matthew Russell
eed2f08bc9 use already installed lodash.debounce, destructuring 2022-03-02 12:21:35 -08:00
Matthew Russell
026dd0f2c3 move View type to trading-compoments, tidy comments 2022-03-02 12:21:35 -08:00
Matthew Russell
da80f8848c fix render loop 2022-03-02 12:21:35 -08:00
Matthew Russell
a66ac23122 use radix for tab functionality 2022-03-02 12:21:35 -08:00
Matthew Russell
ed095d002d split out components into seprate files 2022-03-02 12:21:35 -08:00
Matthew Russell
82cdd245c3 use first tab as default, use state for tabs and an effect to update 2022-03-02 12:21:35 -08:00
Matthew Russell
5c0d21578f use page query container for market list page, add styles to center loading and error message 2022-03-02 12:21:35 -08:00
Matthew Russell
72db4029ea add page query container component 2022-03-02 12:21:35 -08:00
Matthew Russell
ca4bbbac85 adjust text size for desktop view 2022-03-02 12:21:35 -08:00
Matthew Russell
1bb24bbaed fix typo in market list links 2022-03-02 12:21:35 -08:00
Matthew Russell
375697a18a use bg colors from theme 2022-03-02 12:21:35 -08:00
Matthew Russell
62187b38dd add hook to get window size 2022-03-02 12:21:35 -08:00
Matthew Russell
99855e6d65 add basic mobile version 2022-03-02 12:21:35 -08:00
Matthew Russell
9324fb7613 adjust padding of tab buttons 2022-03-02 12:21:35 -08:00
Matthew Russell
623c75aebb adjust grid, use market name 2022-03-02 12:21:35 -08:00
Matthew Russell
15c5a15a28 add aria labels for tabs 2022-03-02 12:21:35 -08:00
Matthew Russell
54bbe421bc make tab content scrollable 2022-03-02 12:21:35 -08:00
Matthew Russell
261f033d9a make tabs use url query string 2022-03-02 12:21:35 -08:00
Matthew Russell
e76f633493 tabs implementation for trading interface 2022-03-02 12:21:35 -08:00
Matthew Russell
a7256e04b3 skip query if market not defined 2022-03-02 12:21:35 -08:00
Matthew Russell
d1bf044d3d add pages extends so generated query files are ignored by nextjs 2022-03-02 12:21:35 -08:00
Matthew Russell
63c1af9760 add apollo setup for trading app 2022-03-02 12:21:35 -08:00
Matthew Russell
6ee4a4da72 make navbar use tailwind, remove nx html 2022-02-23 18:08:31 -08:00
Bartłomiej Głownia
290f5c68ad Extract tailwindcss config to libs 2022-02-23 16:29:07 -08:00
Bartłomiej Głownia
a9a780100a Setup tailwind.css in apps/trading 2022-02-23 16:29:07 -08:00
Matthew Russell
8ea74311be add basic navbar component 2022-02-21 07:36:06 -08:00
Matthew Russell
c312b00bb9 add markets and portfolio pages 2022-02-21 07:36:06 -08:00
Bartłomiej Głownia
8a09f57bd4 Fix build and lint errors 2022-02-14 17:16:21 +01:00
Bartłomiej Głownia
355de1a32f Create a Mono-repo for DeFiUI + ui toolkit using nx 2022-02-11 15:02:11 +01:00