From e975b55b65f3fa63471811935497243f7a4b9338 Mon Sep 17 00:00:00 2001 From: mattrussell36 Date: Wed, 22 Jun 2022 18:05:41 +0000 Subject: [PATCH 01/31] chore: update tranches Signed-off-by: github-actions[bot] --- apps/static/src/assets/mainnet-tranches.json | 45 ++++++++++++------- apps/static/src/assets/stagnet1-tranches.json | 4 +- apps/static/src/assets/testnet-tranches.json | 2 +- 3 files changed, 31 insertions(+), 20 deletions(-) diff --git a/apps/static/src/assets/mainnet-tranches.json b/apps/static/src/assets/mainnet-tranches.json index 02e0f1730..73daa341b 100644 --- a/apps/static/src/assets/mainnet-tranches.json +++ b/apps/static/src/assets/mainnet-tranches.json @@ -38,7 +38,7 @@ "tranche_end": "2023-12-05T00:00:00.000Z", "total_added": "129999.45", "total_removed": "0", - "locked_amount": "125847.249906896297139465", + "locked_amount": "125787.765120377764387935", "deposits": [ { "amount": "129999.45", @@ -488,7 +488,7 @@ "tranche_end": "2023-04-05T00:00:00.000Z", "total_added": "97499.58", "total_removed": "0", - "locked_amount": "66666.63057997215661197", + "locked_amount": "66608.28154565599688874", "deposits": [ { "amount": "97499.58", @@ -521,7 +521,7 @@ "tranche_end": "2023-04-05T00:00:00.000Z", "total_added": "135173.4239508", "total_removed": "0", - "locked_amount": "91121.77448920241599915064844", + "locked_amount": "91042.02143283273708528770988", "deposits": [ { "amount": "135173.4239508", @@ -554,7 +554,7 @@ "tranche_end": "2023-04-05T00:00:00.000Z", "total_added": "32499.86", "total_removed": "0", - "locked_amount": "28045.500213863789588014", + "locked_amount": "28020.953782760903521982", "deposits": [ { "amount": "32499.86", @@ -587,7 +587,7 @@ "tranche_end": "2023-04-05T00:00:00.000Z", "total_added": "10833.29", "total_removed": "0", - "locked_amount": "9128.538172520424723312", + "locked_amount": "9120.54854738936608206", "deposits": [ { "amount": "10833.29", @@ -675,7 +675,7 @@ "tranche_end": "2022-11-01T00:00:00.000Z", "total_added": "22500", "total_removed": "0", - "locked_amount": "16079.77241847825975", + "locked_amount": "16049.10977128622925", "deposits": [ { "amount": "15000", @@ -761,7 +761,7 @@ "tranche_end": "2023-06-02T00:00:00.000Z", "total_added": "1939928.38", "total_removed": "0", - "locked_amount": "1830956.520319353226245706", + "locked_amount": "1829623.803793709439418552", "deposits": [ { "amount": "1852091.69", @@ -1777,7 +1777,7 @@ "tranche_end": "2022-09-30T00:00:00.000Z", "total_added": "60916.66666633337", "total_removed": "18323.723696937179372649", - "locked_amount": "15541.060867673757124652184217191", + "locked_amount": "15501.894213372763635961637393573", "deposits": [ { "amount": "2833.333333", @@ -5195,7 +5195,7 @@ "tranche_end": "2022-09-03T00:00:00.000Z", "total_added": "19455.000000000000000003", "total_removed": "5052.45813105178", - "locked_amount": "3864.17904680365295175059586415525114155", + "locked_amount": "3850.81360492770145890059380317732115674", "deposits": [ { "amount": "75", @@ -14079,7 +14079,7 @@ "tranche_end": "2023-06-05T00:00:00.000Z", "total_added": "3732368.4671", "total_removed": "74162.9780761646031", - "locked_amount": "2838044.0251062046717742172", + "locked_amount": "2835996.10380890249685996302", "deposits": [ { "amount": "1998.95815", @@ -14792,7 +14792,7 @@ "tranche_end": "2023-12-05T00:00:00.000Z", "total_added": "15788853.065470999700000001", "total_removed": "5923.782558947259825", - "locked_amount": "15284554.9536832239111747473350177541524737", + "locked_amount": "15277330.3342408183946136994462047969356583", "deposits": [ { "amount": "16249.93", @@ -16832,8 +16832,8 @@ "tranche_start": "2021-11-05T00:00:00.000Z", "tranche_end": "2023-05-05T00:00:00.000Z", "total_added": "14597706.0446472999", - "total_removed": "2068423.077146290360122272", - "locked_amount": "8461771.6695419306722268828527521", + "total_removed": "2069005.858022564157472772", + "locked_amount": "8455067.62452053677250787835395576", "deposits": [ { "amount": "129284.449", @@ -17047,6 +17047,11 @@ "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b", "tx": "0xa7bccea82ef34f1943bc5243ef75909d8ae81c45e67862b9c68b0a7532edc833" }, + { + "amount": "582.7808762737973505", + "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b", + "tx": "0xcdbefdbd89a68d401dd21553cded39ee57bb5a7c6f3203ed6971e625f90c8b9d" + }, { "amount": "652.48254356494551875", "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b", @@ -18629,6 +18634,12 @@ "tranche_id": 3, "tx": "0xa7bccea82ef34f1943bc5243ef75909d8ae81c45e67862b9c68b0a7532edc833" }, + { + "amount": "582.7808762737973505", + "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b", + "tranche_id": 3, + "tx": "0xcdbefdbd89a68d401dd21553cded39ee57bb5a7c6f3203ed6971e625f90c8b9d" + }, { "amount": "652.48254356494551875", "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b", @@ -19867,8 +19878,8 @@ } ], "total_tokens": "359123.469575", - "withdrawn_tokens": "150390.162087073825163", - "remaining_tokens": "208733.307487926174837" + "withdrawn_tokens": "150972.9429633476225135", + "remaining_tokens": "208150.5266116523774865" }, { "address": "0xBdd412797c1B78535Afc5F71503b91fAbD0160fB", @@ -20859,7 +20870,7 @@ "tranche_end": "2023-04-05T00:00:00.000Z", "total_added": "5778205.3912159303", "total_removed": "1390546.591547348229906227", - "locked_amount": "3026393.75946481397995019109643517", + "locked_amount": "3023744.95073113416560658928344952", "deposits": [ { "amount": "552496.6455", @@ -21982,7 +21993,7 @@ "tranche_end": "2023-06-05T00:00:00.000Z", "total_added": "472355.6199999996", "total_removed": "0", - "locked_amount": "449704.29872935272705903095281584", + "locked_amount": "449379.79389337799655934401014712", "deposits": [ { "amount": "3000", diff --git a/apps/static/src/assets/stagnet1-tranches.json b/apps/static/src/assets/stagnet1-tranches.json index 94c0b4d99..c76e603cb 100644 --- a/apps/static/src/assets/stagnet1-tranches.json +++ b/apps/static/src/assets/stagnet1-tranches.json @@ -38,7 +38,7 @@ "tranche_end": "2022-11-26T13:48:10.000Z", "total_added": "100", "total_removed": "0", - "locked_amount": "43.033418949771685", + "locked_amount": "42.96472919837646", "deposits": [ { "amount": "100", @@ -242,7 +242,7 @@ "tranche_end": "2022-10-12T00:53:20.000Z", "total_added": "1100", "total_removed": "673.04388635", - "locked_amount": "336.1295630390665", + "locked_amount": "335.373975773718904", "deposits": [ { "amount": "1000", diff --git a/apps/static/src/assets/testnet-tranches.json b/apps/static/src/assets/testnet-tranches.json index c3f1cc794..a150dc2ea 100644 --- a/apps/static/src/assets/testnet-tranches.json +++ b/apps/static/src/assets/testnet-tranches.json @@ -69,7 +69,7 @@ "tranche_end": "2022-10-12T00:53:20.000Z", "total_added": "1010.000000000000000001", "total_removed": "668.4622323651", - "locked_amount": "308.628053335870150000305572330035515", + "locked_amount": "307.93428684677826640030488543252156264", "deposits": [ { "amount": "1000", From c78514714b092fc33952b8730ea9040bdf1216eb Mon Sep 17 00:00:00 2001 From: "m.ray" <16125548+MadalinaRaicu@users.noreply.github.com> Date: Wed, 22 Jun 2022 20:08:12 +0100 Subject: [PATCH 02/31] 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 --- .../deal-ticket/deal-ticket-container.tsx | 1 - .../page-templates/template-sidebar.tsx | 2 +- .../mocks/generate-deal-ticket-query.ts | 55 --- .../mocks/generate-market-info-query.ts | 100 ++++++ apps/trading-e2e/src/support/trading.ts | 6 + apps/trading/pages/markets/trade-grid.tsx | 25 +- .../__generated__/DealTicketQuery.ts | 192 ----------- .../__generated__/MarketInfoQuery.ts | 324 ++++++++++++++++++ .../src/components/__generated__/index.ts | 1 + .../src/components/deal-ticket-container.tsx | 112 +----- .../src/components/info-market.tsx | 116 ++++++- 11 files changed, 578 insertions(+), 356 deletions(-) create mode 100644 apps/trading-e2e/src/support/mocks/generate-market-info-query.ts create mode 100644 libs/deal-ticket/src/components/__generated__/MarketInfoQuery.ts diff --git a/apps/simple-trading-app/src/app/components/deal-ticket/deal-ticket-container.tsx b/apps/simple-trading-app/src/app/components/deal-ticket/deal-ticket-container.tsx index 0889af306..14cda9ae5 100644 --- a/apps/simple-trading-app/src/app/components/deal-ticket/deal-ticket-container.tsx +++ b/apps/simple-trading-app/src/app/components/deal-ticket/deal-ticket-container.tsx @@ -7,7 +7,6 @@ import { DealTicketSteps } from './deal-ticket-steps'; import { useVegaWallet } from '@vegaprotocol/wallet'; import { gql, useQuery } from '@apollo/client'; import { DealTicketBalance } from './deal-ticket-balance'; -import * as React from 'react'; import type { PartyBalanceQuery } from './__generated__/PartyBalanceQuery'; const tempEmptyText =

Please select a market from the markets page

; diff --git a/apps/token/src/components/page-templates/template-sidebar.tsx b/apps/token/src/components/page-templates/template-sidebar.tsx index 971ce54cc..8df528c2f 100644 --- a/apps/token/src/components/page-templates/template-sidebar.tsx +++ b/apps/token/src/components/page-templates/template-sidebar.tsx @@ -12,7 +12,7 @@ export function TemplateSidebar({ children, sidebar }: TemplateSidebarProps) {
diff --git a/apps/explorer/src/app/components/search/search.tsx b/apps/explorer/src/app/components/search/search.tsx index 3c33ffb47..ea4e9e932 100644 --- a/apps/explorer/src/app/components/search/search.tsx +++ b/apps/explorer/src/app/components/search/search.tsx @@ -75,7 +75,12 @@ export const Search = () => { )} - diff --git a/apps/simple-trading-app/src/app/components/drawer/drawer-toggle.tsx b/apps/simple-trading-app/src/app/components/drawer/drawer-toggle.tsx index a9fbc02b7..aec0e1c18 100644 --- a/apps/simple-trading-app/src/app/components/drawer/drawer-toggle.tsx +++ b/apps/simple-trading-app/src/app/components/drawer/drawer-toggle.tsx @@ -35,7 +35,7 @@ export const DrawerToggle = ({ }, [variant]); return ( - ); diff --git a/apps/simple-trading-app/src/app/components/simple-market-list/simple-market-list.tsx b/apps/simple-trading-app/src/app/components/simple-market-list/simple-market-list.tsx index 831470e8d..f5ae85aab 100644 --- a/apps/simple-trading-app/src/app/components/simple-market-list/simple-market-list.tsx +++ b/apps/simple-trading-app/src/app/components/simple-market-list/simple-market-list.tsx @@ -101,7 +101,7 @@ const SimpleMarketList = () => {
diff --git a/apps/simple-trading-app/src/app/components/stepper/stepper.tsx b/apps/simple-trading-app/src/app/components/stepper/stepper.tsx index 3a9bb0006..3d099ffa5 100644 --- a/apps/simple-trading-app/src/app/components/stepper/stepper.tsx +++ b/apps/simple-trading-app/src/app/components/stepper/stepper.tsx @@ -70,7 +70,7 @@ export default ({ steps }: StepperProps) => { {index === steps.length - 1 ? 'Finish' : 'Continue'} @@ -215,7 +220,8 @@ export const EthWallet = () => { {account ? ( ) : ( - + )} {account && ( diff --git a/apps/token/src/components/locked-progress/locked-progress.tsx b/apps/token/src/components/locked-progress/locked-progress.tsx index 3c12cb031..c1cf2cc3b 100644 --- a/apps/token/src/components/locked-progress/locked-progress.tsx +++ b/apps/token/src/components/locked-progress/locked-progress.tsx @@ -1,8 +1,8 @@ import React from 'react'; - import { formatNumber } from '../../lib/format-number'; import type { BigNumber } from '../../lib/bignumber'; import { theme } from '@vegaprotocol/tailwindcss-config'; +import classnames from 'classnames'; const Colors = theme.colors; @@ -14,9 +14,10 @@ const ProgressContents = ({ children: React.ReactNode; }) => (
{children}
@@ -25,17 +26,22 @@ const ProgressContents = ({ const ProgressIndicator = ({ bgColor, side, + light, }: { bgColor: string; side: 'left' | 'right'; + light: boolean; }) => ( ); @@ -73,7 +79,7 @@ export const LockedProgress = ({ leftLabel, rightLabel, leftColor = Colors.vega.pink, - rightColor = Colors.green.DEFAULT, + rightColor = Colors.vega.green, light = false, }: LockedProgressProps) => { const lockedPercentage = React.useMemo(() => { @@ -85,19 +91,28 @@ export const LockedProgress = ({ }, [total, unlocked]); return ( -
-
+ <> +
- + {leftLabel} {rightLabel} - + @@ -105,6 +120,6 @@ export const LockedProgress = ({ {formatNumber(locked, 2)} {formatNumber(unlocked, 2)} -
+ ); }; diff --git a/apps/token/src/components/vega-wallet/vega-wallet.tsx b/apps/token/src/components/vega-wallet/vega-wallet.tsx index 79b582949..307e6f392 100644 --- a/apps/token/src/components/vega-wallet/vega-wallet.tsx +++ b/apps/token/src/components/vega-wallet/vega-wallet.tsx @@ -180,15 +180,15 @@ const VegaWalletConnected = ({ vegaKeys }: VegaWalletConnectedProps) => {
))} - - + + - - + + diff --git a/apps/token/src/index.html b/apps/token/src/index.html index 6396c83af..33627cdd5 100644 --- a/apps/token/src/index.html +++ b/apps/token/src/index.html @@ -1,5 +1,5 @@ - + diff --git a/apps/token/src/routes/claim/target-address-mismatch.tsx b/apps/token/src/routes/claim/target-address-mismatch.tsx index 6f5e9eb7c..23069ac69 100644 --- a/apps/token/src/routes/claim/target-address-mismatch.tsx +++ b/apps/token/src/routes/claim/target-address-mismatch.tsx @@ -25,7 +25,7 @@ export const TargetAddressMismatch = ({ }} components={{ bold: , - red: , + red: , }} />

diff --git a/apps/token/src/routes/staking/staking-node.tsx b/apps/token/src/routes/staking/staking-node.tsx index a29452b4b..9724c73bb 100644 --- a/apps/token/src/routes/staking/staking-node.tsx +++ b/apps/token/src/routes/staking/staking-node.tsx @@ -88,7 +88,9 @@ export const StakingNode = ({ vegaKey, data }: StakingNodeProps) => { if (!nodeInfo) { return ( - {t('stakingNodeNotFound', { node })} + + {t('stakingNodeNotFound', { node })} + ); } diff --git a/apps/token/src/routes/tranches/tranche-progress.tsx b/apps/token/src/routes/tranches/tranche-progress.tsx index 213f5b66c..fb970e685 100644 --- a/apps/token/src/routes/tranches/tranche-progress.tsx +++ b/apps/token/src/routes/tranches/tranche-progress.tsx @@ -40,7 +40,7 @@ export const TrancheProgress = ({ {t('Redeemed')} diff --git a/apps/token/src/routes/tranches/vesting-chart.tsx b/apps/token/src/routes/tranches/vesting-chart.tsx index 767d38ce5..d838ec296 100644 --- a/apps/token/src/routes/tranches/vesting-chart.tsx +++ b/apps/token/src/routes/tranches/vesting-chart.tsx @@ -36,7 +36,7 @@ export const VestingChart = () => { ['pink', Colors.vega.pink], ['green', Colors.vega.green], ['orange', Colors.orange], - ['yellow', Colors.yellow.DEFAULT], + ['yellow', Colors.vega.yellow], ].map(([key, color]) => ( @@ -119,7 +119,7 @@ export const VestingChart = () => { dot={false} type="monotone" dataKey="publicSale" - stroke={Colors.yellow.DEFAULT} + stroke={Colors.vega.yellow} fill="url(#yellow)" yAxisId={0} strokeWidth={2} diff --git a/apps/trading-e2e/src/support/mocks/generate-orders.ts b/apps/trading-e2e/src/support/mocks/generate-orders.ts index 3e5bc8946..6c7219f62 100644 --- a/apps/trading-e2e/src/support/mocks/generate-orders.ts +++ b/apps/trading-e2e/src/support/mocks/generate-orders.ts @@ -76,6 +76,7 @@ export const generateOrders = (override?: PartialDeep): Orders => { id: 'c6f4337b31ed57a961969c3ba10297b369d01b9e75a4cbb96db4fc62886444e6', name: 'BTCUSD Monthly (30 Jun 2022)', decimalPlaces: 5, + positionDecimalPlaces: 0, tradableInstrument: { __typename: 'TradableInstrument', instrument: { diff --git a/apps/trading/components/navbar/navbar.tsx b/apps/trading/components/navbar/navbar.tsx index 1384dc92f..801f5ac8b 100644 --- a/apps/trading/components/navbar/navbar.tsx +++ b/apps/trading/components/navbar/navbar.tsx @@ -1,8 +1,8 @@ import { useRouter } from 'next/router'; import { Vega } from '../icons/vega'; import Link from 'next/link'; -import { AnchorButton } from '@vegaprotocol/ui-toolkit'; import { t } from '@vegaprotocol/react-helpers'; +import classNames from 'classnames'; export const Navbar = () => { return ( @@ -33,14 +33,17 @@ const NavLink = ({ name, path, exact, testId = name }: NavLinkProps) => { const router = useRouter(); const isActive = router.asPath === path || (!exact && router.asPath.startsWith(path)); + const linkClasses = classNames( + 'px-16 py-6 border-0 self-end', + 'uppercase xs:text-ui sm:text-body-large md:text-h5 lg:text-h4', + { + 'bg-vega-pink dark:bg-vega-yellow text-white dark:text-black': isActive, + 'text-black dark:text-white': !isActive, + } + ); return ( - - {name} - + + {name} + ); }; diff --git a/apps/trading/pages/_app.page.tsx b/apps/trading/pages/_app.page.tsx index 38aaf4014..e5e10d23a 100644 --- a/apps/trading/pages/_app.page.tsx +++ b/apps/trading/pages/_app.page.tsx @@ -24,84 +24,80 @@ function AppBody({ Component, pageProps }: AppProps) { const { push } = useRouter(); const store = useGlobalStore(); const { VEGA_NETWORKS } = useEnvironment(); - const [, toggleTheme] = useThemeSwitcher(); + const [theme, toggleTheme] = useThemeSwitcher(); return ( -
- -
- -
- { - store.setVegaWalletConnectDialog(open); - }} - setManageDialog={(open) => { - store.setVegaWalletManageDialog(open); - }} - /> - + +
+ +
+ +
+ { + store.setVegaWalletConnectDialog(open); + }} + setManageDialog={(open) => { + store.setVegaWalletManageDialog(open); + }} + /> + +
-
-
- {/* @ts-ignore conflict between @types/react and nextjs internal types */} - -
- store.setVegaWalletConnectDialog(open)} - /> - store.setVegaWalletManageDialog(open)} - /> - store.setVegaNetworkSwitcherDialog(open)} - onConnect={({ network }) => { - if (VEGA_NETWORKS[network]) { - push(VEGA_NETWORKS[network] ?? ''); - } - }} - /> - -
+
+ {/* @ts-ignore conflict between @types/react and nextjs internal types */} + +
+ store.setVegaWalletConnectDialog(open)} + /> + store.setVegaWalletManageDialog(open)} + /> + store.setVegaNetworkSwitcherDialog(open)} + onConnect={({ network }) => { + if (VEGA_NETWORKS[network]) { + push(VEGA_NETWORKS[network] ?? ''); + } + }} + /> + +
+ ); } function VegaTradingApp(props: AppProps) { - const [theme] = useThemeSwitcher(); - return ( - - - - - {t('Welcome to Vega trading!')} - - - {['1', 'true'].includes( - process.env['NX_USE_ENV_OVERRIDES'] || '' - ) ? ( - /* eslint-disable-next-line @next/next/no-sync-scripts */ -