Commit Graph

12 Commits

Author SHA1 Message Date
Bartłomiej Głownia
25699b6283
feat(#1643): orders table filtering (#2000)
* feat(#1643): add grid set filter, amend filters in orders table

* feat(#1643): strictly type variables in orders data provider

* feat(#1643): add date range param to orders query

* feat(#1643): add date range filter

* feat(#1643): handle data provider updates after variables change in ag-grid infinite row model

* feat(#1643): fix unit tests

* feat(#1643): use DateRangeFilter in positions table instead of agDateColumnFilter

* feat(#1643): add date range filter support to orders data provider

* feat(#1643): fix update functions

* feat(#1643): remove sortable from orders list columns

* chore: remove console.log
2022-11-10 11:08:13 -08:00
Bartłomiej Głownia
efc1d909b3
chore: ignore apollo errors - to be reverted after API will be fixed (#1407) 2022-09-21 07:00:48 -07:00
Bartłomiej Głownia
3bf5d823ee
chore: stagnet3 api updates (#1321)
* chore: update account, fills and orders subscriptions in data providers

* chore: update account, fills and orders subscriptions in data providers

* fixing console-lite

* fixing types in general - regen

* chore: update account, fills and orders subscriptions in data providers

* fixed console-lite unit tests, uncommented quote name

* chore: update account, fills and orders subscriptions in data providers

* type aligning of assets and proposals

* fixes liquidity data provider

* fixed accounts build errors and unit tests

* regen types, removed market name

* regen types

* fixed positions

* chore: handle updates in derived market provider, update orders

* removed taker fee mapping (renamed to maker fee)

* chore: update account, fills and orders subscriptions in data providers

* chore: update account, fills and orders subscriptions in data providers

* chore: fix Order type

* chore: fix possible null types

* chore: revert order-list.stories.tsx

* chore:  derivedDataProvider fixes

* fills unit tests fixes

* orders unit tests fixes

* added eslint ingore for generated files in liquidity

* added unique key to the list element of simple market toolbar

* changed main-branch-name to develop for pr workflows

* removed redundant waitFor

* increased test timeout to 10s

* removed mocked response

* chore: disable simple market list tests

* chore: fix e2e projects mock types

* feat: [subscription-update] - uncomment some console-lite tests

* cypress: trading-accounts

* chore: replace  market candles with candlesConnection

* chore: ignore gql errors, to be reverted after candlesConnectio n will be fixed

* feat: [subscription-update] - improve wrongly renamed hook

* feat: [subscription-update] - improve wrongly renamed hook

* feat: [subscription-update] - improve wrongly renamed hook 3

* chore: add pagination hangdling to derived data provier

* cypress: trading-fills

* feat: [stagnet3 api update] - remove redundant command in tests

* feat: [stagnet3 api update] - remove redundant command in tests

* chore: fix trading orders e2e tests

* chore: fix console lite e2e mocks

* chore: fix market-trade tests

* chore: use markets only in market selector, change Instrument cache policy

* chore: fix market-selector tests

* feat: [subscription-update] - improve ag grid conf for unit tests

* feat: [subscription-update] - improve ag grid conf for unit tests

* chore: fix candle types in console lite market mocks

* chore: revert error policy ignore

* chore: revert jest timeout

* chore: remove unused AccountFields

* chore: revert remove unused AccountFields

* chore: simplify node subscription probe

* chore: remove unused generated types in candles-chart

* chore: improve useMarketsList mock

* feat: [subscription-update] - increase jest timeout

* feat: [subscription-update] - fix jest timeout

* feat: [subscription-update] - fix jest timeout

* feat: [subscription-update] - try to fix failing test again

* chore: fix candles-chart types

* feat: [subscription-update] - temporary skip failing test

* feat: [subscription-update] - temporary skip failing test

* feat: [subscription-update] - temporary skip failing test

* feat: [subscription-update] - fix failling int test

* feat: [subscription-update] - try to restore commented unit tests

* feat: [subscription-update] - try to restore commented unit tests

* feat: [subscription-update] - improve fixed unit tests

Co-authored-by: asiaznik <artur@vegaprotocol.io>
Co-authored-by: maciek <maciek@vegaprotocol.io>
2022-09-20 08:24:28 -07:00
Bartłomiej Głownia
d0ec016adc
Feature/151 orderbook (#266)
* [#151] Add orderbook

* [#151] Add orderbook components

* [#151] Add market-depth data provider

* [#151] Add orderbook manager

* [#151] handle market depth updates in orderbook manager

* [#151] Fix PageQueryContainer usage of AsyncRenderer

* [#151] Move data handling logig out from orderbook manager

* [#151] Use mocked data, fix data issues

* [#151] Add compact order book data unit tests

* [#151] Add updateData unit tests

* [#151] Add updateCompactedData unit tests

* [#151] update cummulative vol on update, move data ref handling from effect to manager

* [#151] Update cummulative vol on update, fixes

* [#151] Optimieze orderbook ag-grid render

* [#151] Replace ag-grid with orderbook component

* [#151] Use react memo to optimize orderbook rendering

* [#151] Fix cummulative vol computation on compacted data update

* [#151] Add resolution controls

* [#151] Fix cumulative spelling mistake

* [#151] Use number instead of string for cumulative values

* [#151] Expose restart callback in useDataProvider hook

* [#151] Update empty cumulative values

* [#151] Add horizontal line under header in orderbook

* [#151] reuse orderbook data in market-depth chart

* [#151] restart market depth provider on sequenceNumber gap

* [#151] use throttle in orderbook and depth-chart

* [#151] Add comments, refactor data functions

* [#151] Add comments, refactor data functions

* [#151] move orderbook and depth-chart libs to market-depth
2022-04-26 17:26:28 +02: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
7af0efa8d8 Enable @typescript-eslint/consistent-type-imports eslint rule 2022-03-30 13:05:41 +02:00
Matthew Russell
3f62c79f8d colocate querys with libs 2022-03-29 15:52:51 -07: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
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
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
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