Commit Graph

191 Commits

Author SHA1 Message Date
Bartłomiej Głownia
577ba28ae5
chore: fix trading app e2e tests and mocks (#1142)
* chore: fix trading app e2e tests and mocks

* chore: fix e2e build target setup and tsconfigs
2022-08-26 09:41:47 -07:00
Bartłomiej Głownia
93a5f911f5
feat(#993): derived data provider (#1047)
* feat(#473): add positions metrics data provider

* feat(#473) add positions stats

* feat(#473) add positions stats

* feat(#473): add positions stats

* feat(#473): add positions stats

* feat(#473): position metrics, test and refactoring

* feat(#473): add unit tests to positions table

* feat(#473): fix spelling, order positions by updated at desc

* feat(#473): protect from division by 0

* feat(#473): fix trading positions e2e tests

* feat(#473): fix e2e data mocks

* feat(#473): post code review clean up

* feat(#993): dependencies handling in data provider

* feat(#993): fix e2e tests data mocks

* feat(#993): remove position metrics mocks, add market data market id

* feat(#993): add missing mocks, fix combine function

* feat(#993): set loading initially to true, add unit tests

* feat(#993): cleanup, add comments

* feat(#993): remove undefined from client type

* feat(#993): cosmetic changes

* feat:(#993): pass informaton about update callback cause
2022-08-26 08:39:40 -07:00
Joe Tsang
95c1526aa3
Test/994 additional market info (#1172)
* test: additional market info tests

* chore: fix intermittent failing tests

* chore: change wait logic for asserting node
2022-08-26 14:16:28 +01:00
Joe Tsang
9825e8f436
chore: fix deposits test (#1143) 2022-08-25 09:55:25 +01:00
Joe Tsang
750c421ed5
Test/fix trading tests (#1139) 2022-08-25 09:01:20 +01:00
m.ray
f597048c43
feat(#994): market info - price monitoring bounds, calc 24h volume, oracle price & termination IDs etc. (#1050)
* feat: #994 add price monitoring bounds and candles update interface

* fix: move best bid price to diff section

* fix: add insurance pool and calc volume 24h

* feat: display some oracle min info, asset id, insurance pool, move open interest and 24hVol

* fix: add  market-info.cy.ts case

* fix: remove # from numbered price monitoring settings

* fix: add insurance pool test

* fix: format 24hvol

* fix: remove indicativeVolume and oracleSpecBinding from market info

* fix: add oracleSpecBinding back

* Update libs/deal-ticket/src/components/info-market.tsx

Co-authored-by: botond <105208209+notbot00@users.noreply.github.com>

* fix: memo yesterday's timestamp

* fix: memo timestamp on market info

Co-authored-by: botond <105208209+notbot00@users.noreply.github.com>
2022-08-23 12:43:53 -07:00
Dexter Edwards
c70a273e0b
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 15:50:13 -07:00
m.ray
738c93606b
fix: apollo in memory tradable instrument (#1036)
* fix: update appolo client and set key fields for instruments

* fix: use in-memory cache and tradable instrument id

* fix: revert switch case

* fix: add more info in gen  market list for home.cy.ts

* fix: instrument keyfield still false

* fix: revert simple trading app and explorer updates - fixing tests

* fix: remove id from instrument data provider in simple trading app

* fix: remove id from market selector market names query

* Update apps/trading-e2e/src/support/mocks/generate-market-list.ts

* Update apps/trading-e2e/src/support/mocks/generate-market-list.ts

* Update apps/trading-e2e/src/support/mocks/generate-market-list.ts

* Update apps/trading-e2e/src/support/mocks/generate-market-list.ts
2022-08-19 07:39:46 +01:00
Joe Tsang
4756ae597a
test: test for market conditions tool tip (#1054)
* test: test for market conditions tool tip

* fix: failing to click market dropdown
2022-08-18 11:44:07 +01:00
Joe Tsang
88dea2b8b4
Test/30 market dropdown (#1039)
* test: update market tests

* chore: remove old tests

* chore: remove unused string
2022-08-16 08:35:33 +01:00
Bartłomiej Głownia
08b7c9769a
Feature/473 position margin levels (#902)
* feat(#473): add positions metrics data provider

* feat(#473) add positions stats

* feat(#473) add positions stats

* feat(#473): add positions stats

* feat(#473): add positions stats

* feat(#473): position metrics, test and refactoring

* feat(#473): add unit tests to positions table

* feat(#473): fix spelling, order positions by updated at desc

* feat(#473): protect from division by 0

* feat(#473): fix trading positions e2e tests

* feat(#473): fix e2e data mocks

* feat(#473): post code review clean up
2022-08-16 09:18:55 +02:00
m.ray
445897eb2b
fix: use position decimal places for volume and decimal places … (#1026)
* fix: #1025 use position decimal places for volume and decimal places for price and interest

* fix: market-info.cy.ts test

* fix: market-info.cy.ts
2022-08-15 09:42:34 +01:00
PeteWilliams
c8bd9828a0
Chore: Split settlement asset into separate market info section (#1028)
* chore: split settlement asset into seperate market info section

* fix:  market-info.cy.ts test

* fix: market-info.cy.ts

Co-authored-by: Madalina Raicu <madalina@vegaprotocol.io>
2022-08-12 17:49:27 +01:00
m.ray
0523b56e39
feat: market list mega dropdown (rich popover) (#889)
* feat: use MarketList query only

* fix: remove Market.ts from index

* feat: 30 refactor dialog, market list, change query

* feat: #30 add indicativeVolume, total fees, tooltip, large dialog, tooltip accepts html description

* fix: #30 total fees display in tooltip

* fix: #30 toggle title on dialog open

* fix: #30 fix order, price, high, low utils

* fix: #30 fix test for market utils

* feat: #30 add popover with markets to select

* feat: #30 storybook popover

* feat: #30 remove border on trigger and add some other classes

* fix:  #30 fix format check with format:write

* feat: #30 add tooltip on taker fee

* feat: #30 add tooltip on taker fee

* fix: #30 format on select market list

* fix: #30 remove unknown cast in test mock data

* fix: #30 show markets where you have open positions

* fix: #30 double check if open positions

* fix: #30 dialog has only small/large sizes

* feat: #30 add border on trigger and change padding and no wrap

* fix: #30 if fees or factors are not found

* fix: #30 remove markets.cy tests as markets page is now gone

* fix #30 remove view full market list test

* fix: #30 add rotating arrow on market title

* fix: #30 add ease-in-out on popover

* fix: #30 add ease-in-out on popover

* fix: #30 align select a market table

* fix: #30 select a market title

* fix: #30 select a market title

* fix: #30 fix any validateDOMnesting issues

* fix: #30 show loading market data

* fix: #30 add list of header columns

* fix: #30 add list of header columns

* fix: #30 small refactoring after review

* fix: #30 update bold undreline class names

* fix: #30 add large-mobile size

* feat: #30 refactor select markets tables to render array of columns

* fix: #30 remove size from select market dialog

* fix: #30 add extra file for columns

* fix: #30 update formtting

* fix: #30 make sure popup closes on same market navigation

* fix: rename market-utils, add calcCandle methods, store market id on select

* fix: useMemo ondata and marketPositionData + orderbook stories fix

* feat: #30 add open volume positions

* fix: add market summary back

* fix: update formatting

* fix: use currentcolor on arrow

* fix: create all markets page

* fix: add overflow-y auto

* fix: enlarge select market to get started dialog

* fix: revert markets container

* fix: use query to fix flickering on position markets

* fix: edit unordered list in tooltips

* fix: fix tooltip table

* fix: fix home.cy.ts

* chore: skip /markets tests
2022-08-11 12:56:35 +01:00
Joe Tsang
1c4231f6fc
test: remove eth wallet test (#989) 2022-08-11 11:27:45 +01:00
Joe Tsang
22fc0e7ac1
Test/625 market info (#999)
* test: assert edit button

* test: assert edit order btn

* test: update market info mock

* test: tests for market info
2022-08-11 11:26:26 +01:00
Matthew Russell
85d838b9a6
Task/remove vegawallet service (#926)
* feat: improve error handling

* chore: lint

* fix: cypress test incorrect assertion
2022-08-02 07:37:46 +01:00
Dexter Edwards
e275460c76
feat: allow default wallet url to be configured (#875)
* feat: allow default wallet url to be configured

* docs: add docs to environement package
2022-07-27 11:28:29 +01:00
Matthew Russell
a5f9ed90e8
Fix/Order dialog state (#850)
* feat: remove dialog state handling from dialog and split out edit dialog

* feat: add complete state to use-vega-transaction, fix cancel dialog

* feat: add custom dialog content for order submission

* feat: handle custom title and custom intent

* feat: separate components, make order dialog wrapper more generic

* feat: remove dialog wrapper and add icon to dialog

* chore: remove other dialog wrappers and use icon and title props on main dialog

* chore: adjust default color of dialog text

* fix: tests for tx dialog and vega tx hook

* fix: order edit and cancel hook tests

* chore: add edit dialog to stories

* fix: e2e test for deal ticket

* feat: return dialog from hook

* refactor: add use-order-event hook to dedupe bus event logic

* refactor: add custom title and intent to order submit dialog

* chore: remove console logs

* fix: type error due to component being named idalog

* chore: add helper function for converting nanoseconds

* chore: remove capitalization text transform to dialog titles

* chore: remove unused import

* feat: handle titles and intents for cancel and edit

* chore: remove unused var
2022-07-26 14:35:30 +01:00
Joe Tsang
6d4fe1cf66
fix: update mocks (#860) 2022-07-26 12:16:47 +01:00
Bartłomiej Głownia
b88fda787c
Feature/373 pagination of orders (#809)
* feat(#373): switch orders to infinite scroll mode

* feat(#373): fix orders tests

* feat(#218): improve typing in order-list

* feat(#373): add generic getRows for infinite rowModelType
2022-07-21 15:25:37 +02:00
Matthew Russell
065b48535b
fix: withdrawal max threshold (#830)
* chore: fix remaning text for large number

* feat: make use max only use account balance, add custom max messages

* fix: withdraw threshold limit display

* fix: assertions in deposit withdrawy e2e tests
2022-07-21 09:18:57 +01:00
botond
4670d5e6cf
Feat/647 disconnect eth (#813)
* feat: add disconnect feature form ethereum wallet

* fix: unit tests

* fix: format

* fix: format

* fix: e2e withdrawal check

* fix: format again

* fix: eth address in e2e

* fix: env var for eth address
2022-07-20 15:52:53 +01:00
Bartłomiej Głownia
556be89bfd
Feature/218 trades scrolling (#740)
* feat(#218): add skip pagination support to data provider

* feat(#218): add new rows after user scroll top

* feat(#218): add pagination/scroll scenarios to storybook

* feat(#218): switch fills to infinite scroll mode

* feat(#218): switch trades to infinite scroll mode

* feat(#218): fix e2e tests

* feat(#218): set rowModelType to infinite

* feat(#218): fix markets-list

* feat(#218): remove totalCount

* feat(#218): remove totalCount from mocks, revert cypress config

* feat(#218): allow null data in data-provider whan using pagination

* feat(#218): add missing hasNextPage, handle only one page scenario

* feat(#218): improve typing in fills, trades ann market-list tables
2022-07-20 11:37:28 +02:00
Matthew Russell
7c2a84805e
fix(#441): withdraw fixes
* chore: make sure etherscan links open in new tab

* fix: format withdrawal amount correctly in table

* fix: switch to use next Link element so page state not lost

* fix: calc deposit max validation using ethereum storage at

* fix: remaining amount in deposits and refetch allowance

* fix: page background in dark mode

* chore: disable autocomplete for ethaddress

* fix: bump ag grid row size so underline is shown on FF

* fix: expect correctly formatted withdrawal amount

* fix: missing react keys in maps

* fix: complete button text in test

* fix: use sentry/react, fix webpack config path
2022-07-18 22:11:53 +01:00
Joe Tsang
2403f4edc4
Test/471 cancel order (#772)
* test: add assertion for cancel order button

* fix: stop cypress failing test from ResizeObserver exception
2022-07-18 12:54:02 +02:00
m.ray
5c038690c3
fix: filter rejected markets, order when suspended, remove market state from header, show continuous trading (#761)
* fix: #603 filter out rejected markets & dialog lg width

* fix: #609 show trading mode Continuous Trading and hide market state

* fix: #656 modify order validation to trade when suspended

* fix: #656 fix use order validation tests

* fix: #656 format volume no

* fix: format volume with positionDecimalPlaces

* fix: tests don't need to be async

* fix: md:w-[720px] to prevent dialog overflow

* fix: add market state translations

* fix: imprt type validation props

* Update libs/orders/src/lib/order-hooks/use-order-validation.tsx

Co-authored-by: candida-d <62548908+candida-d@users.noreply.github.com>

* Update libs/orders/src/lib/order-hooks/use-order-validation.tsx

Co-authored-by: candida-d <62548908+candida-d@users.noreply.github.com>

* Update libs/orders/src/lib/order-hooks/use-order-validation.tsx

Co-authored-by: candida-d <62548908+candida-d@users.noreply.github.com>

* Update libs/orders/src/lib/order-hooks/use-order-validation.tsx

Co-authored-by: candida-d <62548908+candida-d@users.noreply.github.com>

* Update libs/orders/src/lib/order-hooks/use-order-validation.tsx

Co-authored-by: candida-d <62548908+candida-d@users.noreply.github.com>

* Update libs/orders/src/lib/order-hooks/use-order-validation.spec.tsx

Co-authored-by: candida-d <62548908+candida-d@users.noreply.github.com>

* Update apps/trading/pages/markets/__generated__/Market.ts

Co-authored-by: candida-d <62548908+candida-d@users.noreply.github.com>

* fix: fix warning messages based on feedback

* fix: capitalize trading mode

* fix: capitalize trading mode

* fix: remove line 72 on markets.cy.ts

* fix: don't show trigger if unspecified

* fix: format last price and shrink 0 on warning icon

* fix: order sizes must be whole numbers for this market and input warning size 20

* fix: order sizes must be whole numbers for this market and input warning size 20

* fix: format market list

* fix: remove market state check from markets.cy.ts

* fix: remove market state check from markets.cy.ts

* fix: remove market state check from markets.cy.ts

* Revert "fix: remove market state check from markets.cy.ts"

This reverts commit c9ab55c98a.

* Revert "fix: remove market state check from markets.cy.ts"

This reverts commit be60e56d8a.

* fix: fix markets.cy.ts failing

* fix: fix markets.cy.ts failing

* fix: fix markets.cy.ts failing

* fix: remove extra test from markets.cy.ts

* fix: update extra test from markets.cy.ts

* fix: update extra test from markets.cy.ts

Co-authored-by: candida-d <62548908+candida-d@users.noreply.github.com>
2022-07-16 14:31:47 +01:00
Matthew Russell
ca56d9393a
fix: rename tradesPaged to tradesConnection (#770)
* fix: rename tradesPaged to tradesConnection

* fix: add missing import

* fix: remove config url from trading app so e2e test runs
2022-07-15 12:12:20 +02:00
Matthew Russell
ab77e99f96
fix: withdrawals and depsits (#754)
* feat: handle withdrawal limits

* feat: add withdraw limit ui to withdraw form

* chore: lint error

* fix: mock network param query for e2e tests

* fix: wrong translation in tests

* fix: withdrawals test and revert change in text for trade grid elements

* fix: add check for signature length before progressing withdraw
2022-07-14 17:12:28 +01:00
PeteWilliams
b078fc9aad
chore: ui tweaks (#737)
* chore: change tab panel background and spacing

* chore: prevent tabs shiting on click, bg tweak

* chore: adjust chrome layout/spacing

* chore: fix horizontal alignment when accordion chevron rotates

* chore: adjusting bold levels and making market name pink on light theme

* chore: changing white theme header to black background

* chore: re-ordering bottom tabs

* chore: tweaking font sizes

* chore: adjusting dropdown button hover colour

* chore: colour tweaks for accessibility, plus orderbook column widths

* Remove redundant style

Removed 'bg-white' left by error.

* Setting header text to white

* chore: alterative fix to prevent tabs moving

* chore: fixing header font colours

* chore: adding padding to orderbook

* chore: preventing modal close icon from moving on focus

* chore: remove inner shadow from selectbox

* chore: adding padding to orderbook

* chore: preventing @ sign from moving when changing order type

* chore: fix background colour on smaller responsive view

* chore: fix truncated market header on smaller responsive view

* chore: reorder tabs in smaller responsive view to match standard view

* fix: fix broken test
2022-07-14 17:03:17 +01:00
Joe Tsang
53faf03d43
test: increase resolution in config files (#750)
* test: increase resolution in config files

* fix: failing market list test

* fix: increase timeout for intermittent failing market test
2022-07-14 16:49:20 +01:00
m.ray
07abc2b1eb
Chore/657 refactor wallet and orders libs (#709)
* feat: 470 edit orders hook and @vegaprotocol/vegawallet-service-api-client@0.4.14

* fix: 470 add methods for dialog intent and title

* fix: #657 rename order-list lib to orders

* chore: #657 move hooks to orders lib

* chore: #657 vega tx dialog used for order cancellation and order submission

* chore: #657 use client subscribe and unsubscribe on reset, refactor vegatxdialog

* fix: #657 revert script src=./env-config.js ending

* fix: #657 format project.json

* Update project.json

* fix: #657 cancel all subs and async tasks in useffect cleanup function

* feat: #657 styling updates on vega order dialog

* fix: #657 rename set dialog open and awaiting confirmation dialog update

* fix: #657 updates on cancel order id check

* fix:  #657 fix vega tx dialog test

* fix:  #657 fix cypress trading-deal-tciket test

* fix:  #657 fix data-testid market test

* Update libs/orders/README.md

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

* Update libs/wallet/src/vega-order-transaction-dialog/vega-order-transaction-dialog.tsx

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

* Update libs/wallet/src/vega-transaction-dialog/vega-transaction-dialog.tsx

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

* Update libs/wallet/src/vega-order-transaction-dialog/vega-order-transaction-dialog.tsx

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

* Update libs/wallet/src/vega-order-transaction-dialog/vega-order-transaction-dialog.tsx

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

* fix: #657 remove the magic string and use the ordertype enum from types package

* fix: #657 guarantee that order.id is present at this point or we need to determine the id of the order

* fix: #657 fix translation in dialog

* fix: #657 rename wallet types, delete ticket query, set finalized order null in submit

* fix: #657 fix deal ticket steps test

* fix: #657 remove settings.json

* fix: #657 use order submit in orders lib

* fix: #463 final modal links to block explorer

* fix: #745 long/short instead of buy/sell

* fix: #657 use only one vega tx dialog

* fix: #657 keep ref of subscription and unsubscribe

* fix:  #657 hide cancelled orders

* fix: #657 sub only when id set

* fix: WIP: trying to unsub when order updated

* fix: #745 long/short instead of buy/sell

* fix: ensure observable defined

* fix: #657 remove redundant test

* Update libs/orders/src/lib/order-hooks/use-order-submit.ts

* fix: failing test due to resizeobserver loop limit exceeded

* fix: lint

* fix: #657 fix test resize observer loop limit exceeded

Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com>
Co-authored-by: Matthew Russell <mattrussell36@gmail.com>
Co-authored-by: Joe <joe@vega.xyz>
2022-07-13 15:23:46 +01:00
AndyWhiteVega
86310d7bb1
test: changing config to prevent successful test videos from compress and uploading (#730) 2022-07-08 13:54:56 +01:00
AndyWhiteVega
2757429018
Task/token flow tests (#695)
* test(token-e2e): initial commit

* test(token-e2e): lint

* test: function Enhancements

* test: linting

* test: remove custom command type decs

* test: more tests

* test: linting

* test: working with capsule still needs rounding issues sorting

* test: enhancements

* test: enhancements

* test: check enhancements

* test: add brdige logic

* test: share instance rather than recreating on each test

* test: minor bug fix, add comment

* test: ensure working against capsule

* test: teardown functions in place

* test: linting

* test: completion of first iteration of happy paths

* test: lint

* test: typo change

* test: tweaks

* test: fix merge issues

* test: lint

* test: env variable handling and cleanup

* test: lint

* test: enhancements to logging to aid debugging

* test: lint

* test: ehancements after feedback

* test: lint

* Update apps/token-e2e/src/support/wallet-teardown.functions.js

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

* test: skipping non-essential tests to reduce time

* test: typo

* test: ci test fails coz capsule runs quicker their - disabled this one check to help

* test: reduction of coverage to help PR time

* test: disable infinte scroll test since capsule blockchain data to small

* test: corrected test: staked tokens field value no longer in a fixed state

* test: clearup to stop test bleed across projects plus bugfix

* test: lint

* test: update .env for trading

* Revert "test: update .env for trading"

This reverts commit 741743e4d2.

Co-authored-by: Dexter <dexter.edwards93@gmail.com>
2022-07-08 11:48:51 +01:00
Matthew Russell
8e6c066b99
Feat/462 fills table mvp (no pagination) (#645)
* feat: scaffold fills components

* feat: add query for fills and populate data in basic table

* feat: refactor portfolio page to use grid and add fills container

* feat: add infinite scroll for fills

* feat: try with data provider, get infinite scroll working

* chore: remove infinite scrolling as subsequent pr will add it

* chore: reorder columns

* chore: remove Autosizer from portfolio grid children as its not needed

* chore: move fills tab to the end

* feat: add storybook, format cells

* feat: add unit test for fills table

* feat: convert lib to next lib

* feat: add pagination variables to fills query to only get latest 300

* fix: fills data provider update function to return result of produce

* fix: yarn.lock

* fix: cypress run by moving test helpers

* fix: re add test helpers for unit tests

* fix: global connection tests

* fix: use fills from mocks

* feat: add update handler for fills

* chore: move value formatter functions into module scope
2022-06-30 09:52:25 +02:00
Joe Tsang
288a5d6268
Test/154 market summary (#643)
* chore: additional test ids

* test: additional test for market summary

* chore: move function inside describe block
2022-06-29 13:57:42 +01:00
m.ray
8e25108701
Feat/463 vega transaction component links to block explorer (#666)
* chore: [#471] update @vegaprotocol/vegawallet-service-api-client to 0.4.12

* fix: [#471] set up storybook in order-list lib and add tailwind

* fix: [#471] organize order list components

* chore: [471] pull theme switcher changes

* feat: [#471] add cancel order button

* feat: [#471] initial impl of use order cancel hook

* fix: [#471] fix format of the price in order list

* fix: #471 fix static assets issue when merging

* fix:  #471 refactor order dialog to vega tx dialog

* fix: #471 move use cancel order hook in wallet lib

* fix: [#471] cancel order dialog and hook refactor

* fix: [#471] remove commented code from storybook preview and fix test

* fix: [#471] update order-list.tsx

* fix: [#471] fix update subscription - show order is cancelled

* fix: [#471] fix eslint error

* chore: [#471] refactoring and add tests for dialogs and cancel hook

* fix: #471 add ref to order list table

* fix: #471 add field for cancel fix test

* fix: #471 rename vega-order-transaction-dialog, error handiling, open dialog on finalized order

* fix: #471 sendTx body mandatory

* fix: #471 use BusEventType.Order to check the typename

* fix: #471 revert using BusEventType.Order to check the typename

* Update libs/wallet/src/order-hooks/use-order-cancel.tsx

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

* fix: #471  fix order-list refactoring and fixes

* fix: #471 generate orders added as a mock in order-list

* fix: #471 reset transaction after order updated

* fix: #471 remove unused import useEffect

* fix: #471 generate mock orders

* fix: #471 revert generate mock orders

* feat: #463 modify vega dialog to direct you to the block explorer transaction

* feat: #463 modify compile-environment.ts

* fix: #471 order list price set to display all decimals

* fix: #471 generate orders updates

* Update apps/trading/.env

* fix: #463 add test and remove explorer URL from trading/env.ts

* Update apps/trading/lib/config/env.ts

* fix: #463 update trading deal ticket

* fix: #463 fix test to check href

Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com>
2022-06-29 13:55:49 +01:00
m.ray
0473412487
Feat/471 cancel order (#610)
* chore: [#471] update @vegaprotocol/vegawallet-service-api-client to 0.4.12

* fix: [#471] set up storybook in order-list lib and add tailwind

* fix: [#471] organize order list components

* chore: [471] pull theme switcher changes

* feat: [#471] add cancel order button

* feat: [#471] initial impl of use order cancel hook

* fix: [#471] fix format of the price in order list

* fix: #471 fix static assets issue when merging

* fix:  #471 refactor order dialog to vega tx dialog

* fix: #471 move use cancel order hook in wallet lib

* fix: [#471] cancel order dialog and hook refactor

* fix: [#471] remove commented code from storybook preview and fix test

* fix: [#471] update order-list.tsx

* fix: [#471] fix update subscription - show order is cancelled

* fix: [#471] fix eslint error

* chore: [#471] refactoring and add tests for dialogs and cancel hook

* fix: #471 add ref to order list table

* fix: #471 add field for cancel fix test

* fix: #471 rename vega-order-transaction-dialog, error handiling, open dialog on finalized order

* fix: #471 sendTx body mandatory

* fix: #471 use BusEventType.Order to check the typename

* fix: #471 revert using BusEventType.Order to check the typename

* Update libs/wallet/src/order-hooks/use-order-cancel.tsx

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

* fix: #471  fix order-list refactoring and fixes

* fix: #471 generate orders added as a mock in order-list

* fix: #471 reset transaction after order updated

* fix: #471 remove unused import useEffect

* fix: #471 generate mock orders

* fix: #471 revert generate mock orders

* fix: #471 order list price set to display all decimals

* fix: #471 generate orders updates

* fix: #471 remove unused import

* fix: #471 remove __typename from mock orders genOrder

* Update libs/wallet/src/order-hooks/order-event-query.ts

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

* fix: #471 update order event sub and pull master changes

Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com>
2022-06-29 10:03:20 +01:00
Matthew Russell
eba3b6a5b9
fix: trading e2e mocks
* fix: mock gql query data

* fix: optional chaining for simple market list test, remove cucumber config file
2022-06-28 17:18:00 -07:00
Joe Tsang
46803ce619
test: update to latest Cypress version (10.2.0) (#655)
* test: update to latest Cypress version (10.2.0)

* fix: cypress error on simple trading app
2022-06-28 11:07:31 -07:00
Sam Keen
2302ef4378
feat(#447): 447 - UI toolkit and theme updates
* feat: 447 Refactored 'progress' intent to be 'prompt' as now white. Added yellow 'selected' intent

* feat: 447 Colour consolidation

* feat: 447 Colour consolidation extra renaming

* feat: 447 Fixing specified red colours

* feat: 447 Removed unused darker red

* feat: 447 Documenting additional colours in storybook

* feat: 447 Buttons updated (except 'accent', which will probably get removed when navs built)

* feat: 447 Text inputs updated

* feat:frontend-monorepo-447: Trading nav

* feat:frontend-monorepo-447: Updated toggle button colours

* feat:frontend-monorepo-447: Custom checkboxes

* feat:frontend-monorepo-447: Tweaks to radio buttons

* feat:frontend-monorepo-447: Input dates get dark color scheme in dark mode

* feat:frontend-monorepo-447: Dropdown updates

* feat:frontend-monorepo-447: Icon menu

* feat:frontend-monorepo-447: Focus visual styles moved to focus-visible for radios and toggle

* feat:frontend-monorepo-447: Tweak to focus styles for text input and textarea

* feat:frontend-monorepo-447: Labeled input

* feat:frontend-monorepo-447: Labeled input description red when in error

* feat:frontend-monorepo-447: Tooltip visual update

* feat:frontend-monorepo-447: Added disabled state to checkbox

* feat:frontend-monorepo-447: Custom select with radix

* feat:frontend-monorepo-447: Reverted back to native Select for a11y concerns

* feat:frontend-monorepo-447: Added visual cue for dropdown items when multiple can be selected

* feat:frontend-monorepo-447: Removed shadow from buttons in Explorer where it looked wrong

* feat:frontend-monorepo-447: Added box shadow classes into tailwind theme

* feat:frontend-monorepo-447: Colour primitives documentation updated

* feat:frontend-monorepo-447: Cleaning up box shadow use further

* feat:frontend-monorepo-447: Intents util updated

* feat:frontend-monorepo-447: Dialog component updated

* feat:frontend-monorepo-447: Callout component updated

* feat:frontend-monorepo-447: Adjusted apps to handle toolkit changes

* feat:frontend-monorepo-447: Moved tabs to ui-toolkit and styled

* feat:frontend-monorepo-447: Fixed ui-toolkit tests

* feat:frontend-monorepo-447: Token eth wallet made dark to support new buttons

* feat:frontend-monorepo-447: Ran prettier

* frontend-monorepo-447: Simplified button class functions and exported for use on other elements

* frontend-monorepo-447: Used newly exported button classes on Link elements in eth-wallet

* frontend-monorepo-447: Moved trading nav from ui-toolkit to trading app

* frontend-monorepo-447: Simplified intents and updated stories

* frontend-monorepo-447: Using classnames in requested spot

* frontend-monorepo-447: Removed unnecessary 'asChild' prop on dropdown triggers

* frontend-monorepo-447: Made use of the XPrimitive Radix naming convention

* frontend-monorepo-447: Simplified types in 'getButtonClasses'

* frontend-monorepo-447: Added 'asChild' to dropdown trigger to avoid nested buttons

* frontend-monorepo-447: Moved input label and description into Formgroup component. Refactored based on tweaked structure

* frontend-monorepo-447: Externally linked input label

* frontend-monorepo-447: Adding correct text colours to Intent.None backgrounds

* frontend-monorepo-447: Improved intent function name

* frontend-monorepo-447: Removed new navbar until implementation ticket is picked up

* frontend-monorepo-447: using testing-library/user-event for tab click unit tests

* frontend-monorepo-447: Removed unused button import

* frontend-monorepo-447: Little extra use of classnames in form-group.tsx

* feat: make navbar pink for light mode

* fix: problem with theme not switching when dependent in js on theme value

* fix: bg of row hover

* fix: dont use vega pink for sell red

* fix: type error in generate orders func

* fix: lint

Co-authored-by: Matthew Russell <mattrussell36@gmail.com>
2022-06-23 20:16:01 -07:00
Matthew Russell
d5727baffc
fix(#623): order fixes
* feat: format size and volume with positionDecimalPlaces

* fix: pass in calculated step so client side validation works

* fix: add requested state to order dialog, handle user rejected error

* feat: add test case for user rejecting tx

* feat: add test case for order list fractional sizes

* feat: add test case for fractional volume in positions table

* fix: deal ticket tests imports

* feat: add test case for trades fractional size

* fix: props for orderbook tests

* fix: add missing positionDecimalPlaces fields to mock functions

* fix: improve error handling of service error with type guard
2022-06-23 15:00:58 -07:00
Joe Tsang
a9df2f425d
test: additional test for sorted orders (#613) 2022-06-23 14:56:12 -07:00
m.ray
c78514714b
Fix/602 fix deal ticket component to be reused by both simple trading app and console v2 (#606)
* fix: [#602] fix container - use grid tabs inside trading leaving deal ticket container reusable

* fix: [#602] trade grid fixes tab bounds

* fix: [#602] different queries for deal ticket and info market

* fix: #602 generate deal ticket query fix for tests

* chore: [#602] add generate-market-info-query.ts

* fix: #602 add template side of 4 cols so that all components actually resize - fixes styling

* fix: #602 add aliasQuery
2022-06-22 20:08:12 +01:00
botond
69b19e4b7b
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 16:20:53 -07:00
Matthew Russell
835f86d024
Fix/Trading grid layout fixes (#583)
* fix: move MarketList wait back

* fix: dont wait for MarketList query

* fix: move assertion to actual test body so other tests can run

* fix: ensure page rendered before checking url after redirect

* fix: grid layout

* fix: withdrawals test by giving explicit dates to mocked withdrawals so they are ordered correctly
2022-06-20 16:52:25 -07:00
Matthew Russell
a11efacba1
Chore/Improve trading app mock queries (#582)
* fix: remove supreflous intercepts and use one intercept for all gql queries

* fix: mock vega tx per test, beforeEach not working

* fix: wait for both queries

* fix: move MarketList wait back

* fix: dont wait for MarketList query

* fix: move assertion to actual test body so other tests can run

* fix: ensure page rendered before checking url after redirect
2022-06-20 08:16:47 -07:00
m.ray
675716089a
feat: #155 trading full market details (#549)
* feat: [#155] move grid tab to ui-toolkit and add info component in the tabbed ticket

* feat: [#155] add accordion component + storybook

* feat: [#155] styling updates, unit tests and export ui-toolkit

* feat: [#155] generate deal ticket query and info-market.tsx updates

* feat: [#155] move grid tab to ui-toolkit and add info component in the tabbed ticket

* feat: [#155] add accordion component + storybook

* feat: [#155] styling updates, unit tests and export ui-toolkit

* feat: [#155] generate deal ticket query and info-market.tsx updates

* fix: [#155] styling updates to mimic figma

* fix: [#155] fix trading-e2e generate deal ticket query

* feat: [#155] remove open field, add omits configurable

* fix: [#155] row component in info market

* feat: market info/accordion styling tweaks

* fix: [#155] add risk models and fix readme

* fix: [#155] update  generate deal ticket query to fix test

* fix: [#155] fix cypress test data

Co-authored-by: PeteWilliams <me@petewilliams.info>
2022-06-17 15:56:42 +01:00
Dexter Edwards
bcaab22891
Feat/dockerize frontends (#388)
* feat: unhardcode contract addresses

* fix: linting and tests

* feat: switch contract usage in token app to use unhardcoded addresses

* chore: remove other usage of hard coded contract addresses

* feat: convert contracts to classes, update claim contract to fix circular dependency

* feat: add hard coded contract addresses to contracts page

* fix: misc tidy up

* chore: rename ethers big num conversion func

* fix: remove pending transactions modal

* chore: add single toBigNum function that can accept number string or EthersBignNumber

* chore: delete unused tranche helpers and decimals functions from smart contracts lib

* feat: add faucetable token class

* fix: reset tx state after early exit from approve tx

* feat: re add transaction modal using zustand store

* fix: loader colors for eth wallet

* fix: pass ethereum config to gurantee existence before tx execution

* add docker image for building explorer

* add arg

* env file changes

* add docker file to build env file

* add requirement for env file in explorer

* fix env file syntax

* containers functional

* default to testnet

* make env flag logic consistent in all places

* pre populate env file

* ensure working for all projects

* address PR comment

* generalising env for token

* invert config dependency from ui toolkit

* fix: merge issues

* docs: running containers documentation

* style: lint

* fix: env varibales not being added properly

* chore: fix merge issues

* chore: fix docker file to support new exectutors

* chore: set address on all contracts as a property

* feat: pull token from contract rather than relying on env var

* chore: fix typing

* chore: remove duplicated prop

* chore: don't use chainId

* style: lint

* style: lint

* Merge branch 'master' into feat/dockerize-frontends

* Merge remote-tracking branch 'origin/master' into feat/dockerize-frontends

* test: revert changes to explorer e2e file

* fix: creating client without base causing token to error

* test: fix tests erroring in before hook due to file not being found

* chore: remove node env from configurable flags

Co-authored-by: Matthew Russell <mattrussell36@gmail.com>
2022-06-13 15:39:17 +01:00
Matthew Russell
9941c9bfaa
Fix/trading app tests (#539)
* fix: deposits tests, also convert to basic cypress

* add new home tests which test redirect to trading page and markets page

* chore: replace portfolio page feature with raw cypress

* chore: replace market page feature with raw cypress tests

* chore: replace home page tests with global.ts for wallet connections

* chore: add raw cypress withdrawals tests with mocks

* fix: complete withdrawals prompt and add assertion for it

* chore: remove unnecessary cypress envs now that we are mocking assets

* chore: ignore lint errors temporarily

* chore: add mock for deposit page query, add wait for mocked queries to resolve

* fix: order of waiting for withdraw page query

* fix: validate vega wallet connection

* chore: remove rest of page objects and convert trading page feature to regular cypress

* fix: assertion on transaction dialog after withdrawal

* chore: split withdraw and withdrawals pages into separate files

* chore: split trading tests into own files, connect wallet once for deal ticket

* feat: convert home page tests to raw cypress
2022-06-10 12:00:02 -07:00
AndyWhiteVega
dbae9623a7
Task/305 add consolev2 first screen test (#515)
* test: extract data via graphql in prep for date order checks

* test: linting changes

* test: overlay tests expanded

* test: linting follow up

* test: extra tests and increase timeouts

waiting on pr to improve scoping locators to the dialog and checking columns for content

* test: linting

* test: tweaks required to aid in initial wait

* test: linting

* test: removed a couple of imports not being used

* test: addressing typescript issues

* test: linting

* chore: type errors

* test: tidy up tests after typescript changes

* test: quick fix due to multiple links - using first

going forward it would be better to have ids for wrappers

Co-authored-by: Dexter <dexter.edwards93@gmail.com>
2022-06-10 14:59:26 +01:00
Elmar
fde5149912
feat(console-lite): add trade balance component and hook (#516)
* feat(console-lite): add trade balance component and hook

* feat(console-lite): review fixes

Co-authored-by: Dexter <dexter.edwards93@gmail.com>
2022-06-10 14:55:14 +01:00
Bartłomiej Głownia
d0452aeb81
Feature/303 orderbook improvements (#312)
* [#151] market-depth code cleanup

* [#303] Make ask and bid relative volume bars relative to maximum bid or ask volume

* [#151] align cmulative vol bars to left

* [#151] replace orderbook zoom in zoom out buttons with dropdown

* [#151] fill gaps in orderbook data

* Order book mocks added

* [#151] mark mid price in orderbook

* [303] Show number in orderbook cumulative volume column

* [#808] show indicative uncrossing volume instead of volume if market is in auction mode

* Method for asserting order book style

* [#303] Add test id attributes to orderbook cells

* Cleanup steps after merge

* Order book test passing

* Change method name

* Revert "[#151] fill gaps in orderbook data"

This reverts commit 90ea4e4ab3.

* [#303] Orderbook rows render optimization

* test: update feature with @todo tests

Same tests can be found in Notion

* [#303] Orderbook scroll to mid price

* [#303] orderbook scroll to row pixel perfect alignment

* [#303] Bring back best offer horizontal lines

* [#303] Preserve center price level on row number change, adjust indicativePrice to resoluton

* feat(orderbook): add storybook

Refs: #303

* feat(orderbook): fix no rows handling

Refs: #303

* feat(orderbook): add orderbook stories for auction and continous market

Refs: #303

* feat(orderbook): add stories for empty orderbook

Refs: #303

* feat(orderbook): fix footer position when there is no data

Refs: #303

* feat(orderbook): seperate number of rows for buy and sell in storybook

Refs: #303

* feat(orderbook): keep mid price in middle until user will scroll

Refs: #303

* feat(orderbook): style scrollbar

* feat(orderbook): style scrollbar

* feat(orderbook): adjust gaps

* feat(orderbook): adjust gaps

* test: addition for autofilled order and mid price lines

* fix: lint

* feat(orderbook): make it posiible to write RTL tests

* feat(orderbook): fix price focus, add unit tests

* feat(orderbook): fix price scroll to mid proce, add unit tests

* feat(orderbook): improvements

- fix scrollbar colors in firefox
- bring back resolution dropdown chevron
- hide go to mid button when locked on mid price
- right align ask vol bar
- change grid gap to 5px
- add vertical lines between columns
- display "No data" if theis no orderbook data
- align header labels to right

* feat(orderbook): fix formatting

* feat(orderbook): add 5px gap

* feat(orderbook): improvements after code review

* feat(orderbook): display full height vertical lines

* fix: change in mid position

* feat(orderbook): fix number cannot be converted to BigInt because it is not integer

* feat(orderbook): fix TS2307 in trading-e2e caused by .module.scss import

Co-authored-by: Joe <joe@vega.xyz>
2022-06-10 15:52:39 +02:00
botond
ecda46caa5
Feat/6 Network Switcher (#502)
* 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

* 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

* fix: lint

* fix: lint

Co-authored-by: Joe <joe@vega.xyz>
Co-authored-by: Dexter <dexter.edwards93@gmail.com>
2022-06-10 10:15:38 +01:00
Joe Tsang
f6f62cbc6a
Test/fix revert trading flow (#538)
* test: revert changes made to trading flow and ignore withdrawal history

* test: ignore failing test
2022-06-10 09:40:41 +01:00
Matthew Russell
be3b416176
Fix/Default market and tabs navigation (#518)
* fix: dont use localstorage for navigation, remove query params for tabs

* chore: lint

* fix: revert to using url rather than data test id

* chore: lint

* chore: remove arrow down ref from markets page object
2022-06-08 09:47:31 +01:00
Matthew Russell
e463bbe238
feat(#495): get smart contracts addresses from network params
* feat: unhardcode contract addresses

* fix: linting and tests

* feat: switch contract usage in token app to use unhardcoded addresses

* chore: remove other usage of hard coded contract addresses

* feat: convert contracts to classes, update claim contract to fix circular dependency

* feat: add hard coded contract addresses to contracts page

* fix: misc tidy up

* chore: rename ethers big num conversion func

* fix: remove pending transactions modal

* chore: add single toBigNum function that can accept number string or EthersBignNumber

* chore: delete unused tranche helpers and decimals functions from smart contracts lib

* feat: add faucetable token class

* fix: reset tx state after early exit from approve tx

* feat: re add transaction modal using zustand store

* fix: loader colors for eth wallet

* fix: pass ethereum config to gurantee existence before tx execution

* chore: lint smart contracts lib

* chore: fix web3container to use children and not render prop

* chore: lint

* fix: use background to mock ethereum wallet to avoid mocking globally for every test

* chore: move web3 mock to common steps and call from withdrawals feature tests
2022-06-07 15:08:40 -07:00
Joe Tsang
458e9cafc3
fix: increase timeout (#513) 2022-06-07 13:08:24 +01:00
botond
d4420d6038
Feat/248: portfolio layout (#476)
* feat: add base portfolio layout

* feat: add positions, order list and withdrawals to portfolio page

* feat: add account container to portfolio page plus wallet management improvments

* fix: remove duplication from portfolio page containers

* fix: format and lint

* fix: remove buggy wallet dialog from portfolio page

* fix: deposit e2e test navigation

* fix: temporarily go straight to withdrawal pages

* fix: formatting

* fix: add formatting

Co-authored-by: Joe <joe@vega.xyz>
2022-06-07 10:26:45 +01:00
m.ray
a65c52d7d4
feat: trading page market summary & select markets modal opening from market title & fix: positions table realised PnL (#505)
* feat: [#456] select markets modal opening from market title

* feat: add a global zustand store for managing connect dialogs and landing dialog

* feat: add tests

* feat: [#456] make arrow configurable

* feat: [#456] make arrow configurable

* feat: [#456] trading tab active only on portfolio

* chore: update tranches

Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: [#445] shallow routing from index (#484)

* fix: [#445] shallow routing from index

* fix: [#445] use link to redirect to market - an attempt to fix reload

* fix: [#445] remove stretched link from last link - it makes all the other links unusable

* fix: [#445] fix lint on select market list - remove stretched link

* fix: [#456] put everything in landing folder to avoid conflicts

* fix: remove condition for cypress for auto connecting

* feat: [#456] add global store and fix href routing

* feat: [#456] add global store and fix href routing

* feat: [#456] add one more test

* feat: [#154] pull market data summary

* feat: [#154] move header above the trade grid child sections

* feat: [#154] flex oerflow and styling updates for market summary

* feat: [#154] fix styling

* fix: [154] fix cyp tests and styling

* fix: [#154] fix markets navigation cypress step

* fix: [#154] fix for navigate to markets link

* fix: failing tests from market change

* fix: [#154] set nav items based on market id and show last viewed market on landing

* fix: [#412] invalid decimal place on realised PnL field

* fix: [#154] remove redundant curly braces

* fix: [#154] show hyphen on volume if market data is undefined

Co-authored-by: Matthew Russell <mattrussell36@gmail.com>
Co-authored-by: dexturr <dexturr@users.noreply.github.com>
Co-authored-by: Joe <joe@vega.xyz>
2022-06-06 17:19:56 +01:00
Elmar
aa1475dfb1
feat(console-lite): enabling navigation from market to trade (#498)
* feat(console-lite): enabling navigation from market to trade

* feat(console-lite): add review changes

* feat(console-lite): fix broken test

* feat(console-lite): change import hierarchy external libraries
2022-06-03 12:12:03 +01:00
Matthew Russell
25b67009a6
feat: add a global zustand store for managing dialogs (#494)
* feat: add a global zustand store for managing connect dialogs and landing dialog

* feat: add tests

* fix: remove condition for cypress for auto connecting

* chore: fix assertion in tests for vega wallet text

* fix: add mock for landing dialog markets query

Co-authored-by: madalinaraicu <madalina@vegaprotocol.io>
2022-06-01 15:21:36 +01:00
botond
3a27172e04
feat(#175): ui-toolkit links (#453)
* 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>
2022-05-31 17:30:02 -07:00
botond
bf07dac445
feat(#372): fractional orders (#486)
* feat: add positionDecimalPlaces prop to market query and regenerate types

* feat: add stepper to order amount input

* feat: convert fractions back to integers when submitting the order

* refactor: move order transformations into hooks

* fix: formatting

* fix: simplify toDecimal calculation

* fix: remove redundant function for size calculation

* fix: add new prop to e2e test mock generator

* feat: add tests for order validation

* fix: lint

* chore: add validation to the simple trading app order form

* fix: lint
2022-05-31 15:20:01 -07:00
Joe Tsang
66c18a2b1b
Test/425 withdrawals (#457)
* chore: improve assertions for deposits

* test: validation test passing

* test: withdrawal tests passing

* fix: test failures in CI

* fix: lint

* chore: add env variables

* fix: failing tests due to wallet service not running

* ci: pass automatic cnsent

* ci: init wallet in other directory

* ci: pass home string everywhere

* ci: config is already imported

* fix: failing deposit and nightly run

* ci: port over changes from pr run

* fix: failing network param tests

* fix: assertion

* fix: assertion one last time

Co-authored-by: Dexter <dexter.edwards93@gmail.com>
2022-05-27 10:23:07 +01:00
m.ray
9ab6337e42
Feat/305 add console v2 first view screen (#424)
* [#305] add initial landing dialog on markets page and fix some typos

* [#305] market-list utils and generate schema

* [#305] initial styling of the landing dialog and add arrows

* [#305] routing to markets and add hover and market list tests

* [#305] fix z-index on dialog overlay

* [#305] default market shoulde be oldest market that is currently trading in continuous mode

* [#305] refactor market-list library

* [#305] add arrow unit tests

* Update libs/market-list/src/lib/components/landing/landing-dialog.tsx

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

* Update libs/market-list/src/lib/components/landing/select-market-list.tsx

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

* Update libs/market-list/src/lib/components/landing/select-market-list.tsx

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

* test: fix failing tests from homepage change

* [#305] sort by id after sorting by date

* test: increase timeout for failing tests in CI

* [#305] destructuring all over the place and some code tweaks, arrows and percentage changes

* [#305] update sparkline to show colour

* [#305] fix order of market list

* [#305] stretchedLink class plus a-tag href for navigation - accessibility updates

* [#305] use href only and remove log

* [#305] use bignumber.js for price calculations

* [#305] change to bg-white/50 on dark mode overlay as asked from UX

* [#305] change to bg-white/50 on dark mode overlay as asked from UX

* [#305] toLocaleString fix

* [#305] toLocaleString fix

* [#305] add price-change-cell and use formatNumber

* [#305] add extra test for select market list

* Update apps/trading/specs/index.spec.tsx

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

* [#305] use memo, sort by date and id lodash

Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com>
Co-authored-by: Joe <joe@vega.xyz>
2022-05-23 13:21:54 +01:00
Joe Tsang
aa28f2cac1
chore: update readme and allow env file for local variables (#432)
* chore: update readme and allow env file for local variables
style: lint

* chore: resolved PR comments

* fix: lint and tests failures
2022-05-23 10:05:53 +01:00
Ditmir-Vega
348badca2a
Test/add test for successful deposit (#399)
* add test for successful deposit

* update tests for deposits page to use magic strings

* remove unused variable

* used vegapublickey variable
2022-05-19 16:37:04 +01:00
Matthew Russell
5a00ad8361
fix: flakey cypress test runs (#409)
* fix: wait for aggrid to render before asserting

* fix: mock markets manually and move wait for aggrid to init
2022-05-17 10:07:53 -04:00
Matthew Russell
d8bf887245
chore(#315): Convert token to use wallet lib
* delete token version of vega wallet serivce

* update use-user-vote to use new wallet service

* remove typo

* add further types for transaction submissions, add assets to withdraw page query

* update api client package to get generated types, adjust render logic of withdrawals page

* fix withdrawals list rendering

* update determine id function to not use nodejs buffer

* update service api client so it accepts new tx types

* remove stray logs and formatting

* make filtering erc20 assets the responsibility of the withdraw/deposit lib and not the app

* remove sha3 dep and use js-sha3 and ethers to determine ids

* use hook for fetching withdrawals form lib, add type policy to ensure withdrawal state is updated correctly

* fix: markets page feature
2022-05-17 09:04:41 -04:00
Ditmir-Vega
6bccfaf8ab
Task/252 Eth wallet connection and deposit form validation tests (#309)
* add feature/scenarios for deposits

* add file for auction orders tests

* update feature file for deposits

* update feature tests for deposit

* add feature/scenarios for deposits

* add file for auction orders tests

* update feature file for deposits

* update feature tests for deposit

* add test for wallet not connected

* fix lint warning

* add mock ethereum provider to allow connecting ethereum wallet

* add basic test for required validation errors

* add  aria for input errors for a11y and test targeting, expand submit form helper

* use mnemonic for private key generation, update tests to not submit and just assert validation message updates

* add chain id to cypress config

* update scenario

* remove feature file

* lint fix

* Update apps/trading-e2e/cypress.json

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

* use mnemonic from github secret, update cypress.json env vars to match

* fix typo in test name and mnemonic env var

* update env variables

* update eth wallet mnemonic env

* Update libs/cypress/src/lib/eip1193-bridge.ts

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

* remove unused reference to chainId

* update casing

* chainId reference from cypress.json

* Update apps/trading-e2e/cypress.json

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

* Update apps/trading-e2e/src/support/step_definitions/deposits.step.ts

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

* ignore a known failing step in the test due to wallet connected having approved status

* update testid

* update tests for deposits

* tidy up comments in custom cypress commands

* add comment about eager connect when running in cypress

* update deposits tests

Co-authored-by: Matthew Russell <mattrussell36@gmail.com>
Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com>
2022-05-10 20:37:09 +01:00
Joe Tsang
81ea3fe946
Updated fix for failing market test (#392)
* Add additional checks before and after click

* Change back to use cy.contains

* Add assertion before click

* Change assert

* Remove force

* Add click

* Increase timeout
2022-05-10 09:20:32 +01:00
Joe Tsang
6746d3e003
Fix for failing test in CI (#374)
* Fix for failing test in CI

* Resolve PR comment

* Add check for visible

* Real fix for failing market test
2022-05-06 09:31:28 +01:00
Matthew Russell
3af4e354cd
Mock accounts for trading page (#311)
* move accounts and positions into own feature, add mock for accounts

* use length for expected number of columns

* combine trading feature tests into single trading-page.feature

* add orders scenario for trading page

* fix typo

* move related test cases for orders together
2022-04-29 14:24:15 +01:00
Joe Tsang
448e0ec78f
Test/294 orders list (#301)
* Order mocks generated

* Tests passing with orders
2022-04-27 10:22:37 -07:00
Matthew Russell
29cd7dd2e4
Feat/104 withdraws (#263)
* add withdraw page

* add create page and withdraws lib with basic components

* add create withdrawal functionality, add withdrawal dialog

* re arrange pages so we have a pending page with a list of withdrawals and a withdraw page with the form

* handle withdrawal completion

* add withdraw dialog so withdraw is completed in one flow

* rename and arrange prop getter function to avoid use of any

* tidy up and make eth transaction and vega transaction hooks follow similar patterns

* make complete withdraw hook fetch approval, combine hooks for full flow

* delete unused file

* add accounts to query to get use max withdraw button

* use ag grid fro withdrawals list

* format amount in grid

* ensure party has id field for cache

* update to use t i18n function

* change complete status to better match values of WithdrawalStatus

* add asset lib file for type guard

* share queries for withdraws lib

* move web3 related hooks to the web3 lib and make web3 lib buildable

* add unit test for use-complete-withdraw

* add test for use-withdraw

* add e2e scenarios for withdrawals

* don render custom no withdrawals message and use ag grid prop

* make withdraw form take ethereum account as prop

* add test config, update withdraw form to handle min/max amounts, add unit test for withdraw form

* fix rendering 0 if not pending withdrawals

* use controlled component for select box

* tidy up async parts of tests, add test for withdraw-manager

* update withdraw dialog to use map for different tx states

* add fallback etherscan link, add test for withdraw-dialog.spec.tsx

* rename erc20 query in token app, change page structure to /withdraw and /withdrawals

* change linked vegawallet-service-api-client to newly published version

* ignore not implemented withdrawals e2e tests

* make vega tx pending and requested states the same, for now, until tx confirmation work is done

* Add some unit tests for determine-ids and remove0x

Neither are critical, but both are libs expected to be shared between
projects so some unit tests will hopefully ensure projects all have the
same expectations about how the functions act.

- Add 1 determine-ids test
- Add a few remove-0x tests
- Update determine-ids to use remove-0x
- Add a comment describing why i18n is what it is

* modify cache with client only field for tracking foreign chain progress

* move withdrawals-list to lib, add useWithdrawals hook

* add container component for withdrawals page

* add unit tests for withdrawals-table

* add some tests for use-withdrawals hook

* revert changes to generated files in other libs and apps

* update withdrawals scenarios

* resolve pr comments

* update page containers to use render prop rather than children

* delete unused files

* remove transaction dialog story

Co-authored-by: Ditmir-Vega <ditmir@vega.xyz>
Co-authored-by: Edd <edd@vega.xyz>
2022-04-26 19:51:39 -07:00
Joe Tsang
ceab1cbac4
Test for accounts (#285) 2022-04-26 14:58:52 +01:00
Joe Tsang
cd343cc1fe
UI test for positions table (#290)
* Positions test passing with mocks

* Update position mocks with changes

* Use Cypress env for public key in mock
2022-04-26 14:20:31 +01:00
John Walley
ba19b5acca
Candle/depth chart switcher (#284) 2022-04-25 10:34:07 -07:00
Matthew Russell
899277e6d4
Fixes for workflows (#291)
* change to setting envars rather than passing in via CLI

* update nx to latest patch version

* add env files for token-e2e, fix lint and ts errors

* move generate functions to mocs for trading e2e to avoid violating boundary rules

* add jsx compiler option for trading-e2e

* downgrade nextjs

* add testing-library to types declaration where required
2022-04-22 17:51:18 -07:00
Joe Tsang
f0fdecb490
Test/234 switch public key (#254)
* Test for switching public key

* Add missing variable

* Add background step

* Fix yaml error

* Increase timeout for cy.wait

* Assert pub key using Cypress env variable

* Fix module error

* Add string

* Remove timeout

* Removed react-helper import and added Cypress env variable
2022-04-19 12:12:08 +01:00
Joe Tsang
09e4603eec
Test passing for trades list (#262)
* Test passing for trades list

* Remove log and change file to ts

* Update regex to include different date format
2022-04-19 10:57:08 +01:00
Joe Tsang
753cff95b9
Test/249 convert js files to ts (#255)
* Explorer-e2e files changed to ts

* Files on trading app converted

* Fix type error and update Cypress

* Remove Jquery type

* Update Cypress version in package.json
2022-04-14 09:33:20 +01:00
Matthew Russell
04872522d6
Task/229 Stub api in trading e2e (#211)
* add fixture for markets query

* stub graphql requests

* re-add assertion for tx hash, stub command/sync requests

* refactor to get tests to run with trading page mocked queries

* add test wallet credentials

* split up markets page from trading page

* add portfolio page feature, add market page scenarios

* move hasOperationName helper to support/index

* fix home-page.feature

* fix missing feature step

* Minor changes to BDD steps

* Use in object syntax to get better type safety on hasOperationName helper function

* remove bypass placing orders env var and usage in tests

* use UI_Trading_Test wallet publick key in command/sync mock

* move public key to cypress env

* replace fixtures with generator functions

* colocate query generators with queries

* add custom commands, add index files

* fix dodgy merge, remove duplicate market page feature

* make tsconfig for cypress lib match

* update tsconfig for explorer e2e so commands using merge work

* revert trading step to js

Co-authored-by: Joe <joe@vega.xyz>
2022-04-12 12:04:26 +01:00
Joe Tsang
e92408e31d
Test for market table (#238)
* Test for market table

* Remove old method

* Fix typo

* Add braces and curly lint
2022-04-11 16:35:38 +01:00
Joe Tsang
ac2348ad7e
Remove assertions for placing order in active market (#212)
* Remove assertions for placing order in active market

* Add guards

* Uncomment step
2022-04-06 16:56:40 +01:00
Matthew Russell
814589fd1e
Task/Use commands from cypress lib (#206) 2022-04-04 16:47:27 -07: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
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
Bartłomiej Głownia
355de1a32f Create a Mono-repo for DeFiUI + ui toolkit using nx 2022-02-11 15:02:11 +01:00