From 18b622edd74e74aed31dc044d85e75624f08e311 Mon Sep 17 00:00:00 2001 From: dexturr Date: Tue, 7 Jun 2022 08:08:29 +0000 Subject: [PATCH 1/2] chore: update tranches Signed-off-by: github-actions[bot] --- apps/static/src/assets/mainnet-tranches.json | 173 ++++++++++++++---- apps/static/src/assets/stagnet1-tranches.json | 4 +- 2 files changed, 136 insertions(+), 41 deletions(-) diff --git a/apps/static/src/assets/mainnet-tranches.json b/apps/static/src/assets/mainnet-tranches.json index 008d40ff9..8e883eb4c 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": "129682.36162978697785023", + "locked_amount": "129444.52681890269686566", "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": "70428.517923311130372024", + "locked_amount": "70195.22412914844148698", "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": "96263.62502479102429967123688", + "locked_amount": "95944.7526846639458443835832", "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": "29628.061254886910252894", + "locked_amount": "29529.91858445099991019", "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": "9643.646434564611031407", + "locked_amount": "9611.701947691653720404", "deposits": [ { "amount": "10833.29", @@ -675,7 +675,7 @@ "tranche_end": "2022-11-01T00:00:00.000Z", "total_added": "22500", "total_removed": "0", - "locked_amount": "18056.6590240036215", + "locked_amount": "17934.06221693840475", "deposits": [ { "amount": "15000", @@ -761,7 +761,7 @@ "tranche_end": "2023-06-02T00:00:00.000Z", "total_added": "1939928.38", "total_removed": "0", - "locked_amount": "1916879.612086597542469696", + "locked_amount": "1911551.08354358756368137", "deposits": [ { "amount": "1852091.69", @@ -1777,7 +1777,7 @@ "tranche_end": "2022-09-30T00:00:00.000Z", "total_added": "60916.66666633337", "total_removed": "17896.108295511846757997", - "locked_amount": "18066.219044199191697914984957962", + "locked_amount": "17909.6211245656664631173828909605", "deposits": [ { "amount": "2833.333333", @@ -5052,7 +5052,7 @@ "tranche_end": "2022-09-03T00:00:00.000Z", "total_added": "15073.000000000000000003", "total_removed": "2905.98379934253", - "locked_amount": "3661.43177476534672755072873982115677305", + "locked_amount": "3620.0297768581945964007204995243531204", "deposits": [ { "amount": "10", @@ -12929,7 +12929,7 @@ "tranche_end": "2023-06-05T00:00:00.000Z", "total_added": "3732368.4671", "total_removed": "74162.9780761646031", - "locked_amount": "2970077.9019092314063579103", + "locked_amount": "2961889.80873522203511981118", "deposits": [ { "amount": "1998.95815", @@ -13642,7 +13642,7 @@ "tranche_end": "2023-12-05T00:00:00.000Z", "total_added": "15788853.065470999700000001", "total_removed": "0", - "locked_amount": "15750341.6587991785653755639256064283711814", + "locked_amount": "15721455.8528753381544497845048217020856988", "deposits": [ { "amount": "16249.93", @@ -15593,8 +15593,8 @@ "tranche_start": "2021-11-05T00:00:00.000Z", "tranche_end": "2023-05-05T00:00:00.000Z", "total_added": "14597706.0446472999", - "total_removed": "2039274.435730582717034572", - "locked_amount": "8893995.82561804098467636432418579", + "total_removed": "2040741.482328946820515322", + "locked_amount": "8867191.40430055827121812084261657", "deposits": [ { "amount": "129284.449", @@ -15808,6 +15808,11 @@ "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b", "tx": "0x4a972ce40877c56aaa0fb53f479666723bf6a89ea9df5a18ffeffb2580d416d4" }, + { + "amount": "1467.04659836410348075", + "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b", + "tx": "0x0014532478275404cdb672384ad9bf4dc4202b7ccd60682b7d8bfd5b997d3c00" + }, { "amount": "1384.357697656285885", "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b", @@ -17290,6 +17295,12 @@ "tranche_id": 3, "tx": "0x4a972ce40877c56aaa0fb53f479666723bf6a89ea9df5a18ffeffb2580d416d4" }, + { + "amount": "1467.04659836410348075", + "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b", + "tranche_id": 3, + "tx": "0x0014532478275404cdb672384ad9bf4dc4202b7ccd60682b7d8bfd5b997d3c00" + }, { "amount": "1384.357697656285885", "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b", @@ -18414,8 +18425,8 @@ } ], "total_tokens": "359123.469575", - "withdrawn_tokens": "139027.708785966936364", - "remaining_tokens": "220095.760789033063636" + "withdrawn_tokens": "140494.75538433103984475", + "remaining_tokens": "218628.71419066896015525" }, { "address": "0xBdd412797c1B78535Afc5F71503b91fAbD0160fB", @@ -19400,7 +19411,7 @@ "tranche_end": "2023-04-05T00:00:00.000Z", "total_added": "5778205.3912159303", "total_removed": "1341050.833974497576969742", - "locked_amount": "3197168.13760041683379941673182373", + "locked_amount": "3186577.54862608898743900152867561", "deposits": [ { "amount": "552496.6455", @@ -20456,7 +20467,7 @@ "tranche_end": "2023-06-05T00:00:00.000Z", "total_added": "472355.6199999996", "total_removed": "0", - "locked_amount": "470625.82124660851890028549873164", + "locked_amount": "469328.37107805075503164173921864", "deposits": [ { "amount": "3000", @@ -46109,7 +46120,7 @@ "tranche_start": "2021-12-05T00:00:00.000Z", "tranche_end": "2022-06-05T00:00:00.000Z", "total_added": "171288.42", - "total_removed": "20783.0438075488377", + "total_removed": "22821.6538075488377", "locked_amount": "0", "deposits": [ { @@ -50444,6 +50455,41 @@ "user": "0xe8F33102aDD808E841268E4161326C76A3D31d24", "tx": "0xaf108d45b68929af7d63e571bf6f4d9d2415437c95470d70d70786398aa192ab" }, + { + "amount": "38.61", + "user": "0xc67f35d101E06b627C389Acc93B5A58f2401d8B2", + "tx": "0x64d4740ffd946ab9df19e4bbcd488f18c8ff678a8ff0728867b518eed9c311f8" + }, + { + "amount": "750", + "user": "0x351cc2560C870f01B099B106Be22C0073Fce10B2", + "tx": "0x240e21e1e2ff7d746cf1e9bd854f6d5c169c46719b19f81a35f54d4b3ce57ba8" + }, + { + "amount": "250", + "user": "0xB0B91feF5E4Af34F727797079DCDa5CCAc817a4B", + "tx": "0x196601e5862ffbaee16bb13eb14e81a2de792d10af46c5fd41df7f7168e04c64" + }, + { + "amount": "250", + "user": "0xe9bA7506Dc9a35C1fa39cBDafDcb97436f855F50", + "tx": "0x9d5168d3cfda592b844c945f528dc5d7dd45154d723c844d7daa63592aaed972" + }, + { + "amount": "250", + "user": "0xCeac14c2f5F30ac130CeaEC761ef270a47935Deb", + "tx": "0x8b8f8373f9441bd1120b1887c28df43589feaf019bd5f4e38ddafbe492aaf429" + }, + { + "amount": "250", + "user": "0x64C5E5fF5B1B356820C58A35bb59e3Bb51ccF8ec", + "tx": "0xcdf9b890cc4d67e26023f39fd0b356c6c13a745231a93c771b56b8b91b587a42" + }, + { + "amount": "250", + "user": "0x22771eDF88B1cec6E8849Af5c3C140FAc3EAcA5C", + "tx": "0x4b565d215b1149dad23489678d7b51688e35e919039b6f8b221992c733888e19" + }, { "amount": "65.56208982", "user": "0x36d345DCEB35816AD557355fA51E7C99FEE7d18E", @@ -56723,10 +56769,17 @@ "tx": "0xc7dd4c2b995cc486fcd8b7892cd79f8fb393ada004dc68cf66ec82d99b35763c" } ], - "withdrawals": [], + "withdrawals": [ + { + "amount": "250", + "user": "0x22771eDF88B1cec6E8849Af5c3C140FAc3EAcA5C", + "tranche_id": 6, + "tx": "0x4b565d215b1149dad23489678d7b51688e35e919039b6f8b221992c733888e19" + } + ], "total_tokens": "250", - "withdrawn_tokens": "0", - "remaining_tokens": "250" + "withdrawn_tokens": "250", + "remaining_tokens": "0" }, { "address": "0x4C252a25e38D39b1754981405D87c7FfEf1EC9F8", @@ -58450,10 +58503,17 @@ "tx": "0xadc25e73736cd85e84fee16f2d7ee41f16f7deb83a52ceb82b327974063964f7" } ], - "withdrawals": [], + "withdrawals": [ + { + "amount": "250", + "user": "0xCeac14c2f5F30ac130CeaEC761ef270a47935Deb", + "tranche_id": 6, + "tx": "0x8b8f8373f9441bd1120b1887c28df43589feaf019bd5f4e38ddafbe492aaf429" + } + ], "total_tokens": "250", - "withdrawn_tokens": "0", - "remaining_tokens": "250" + "withdrawn_tokens": "250", + "remaining_tokens": "0" }, { "address": "0x247DF149E73F6E7028C00701fAbf567a65B22a84", @@ -58546,10 +58606,17 @@ "tx": "0xadc25e73736cd85e84fee16f2d7ee41f16f7deb83a52ceb82b327974063964f7" } ], - "withdrawals": [], + "withdrawals": [ + { + "amount": "250", + "user": "0xB0B91feF5E4Af34F727797079DCDa5CCAc817a4B", + "tranche_id": 6, + "tx": "0x196601e5862ffbaee16bb13eb14e81a2de792d10af46c5fd41df7f7168e04c64" + } + ], "total_tokens": "250", - "withdrawn_tokens": "0", - "remaining_tokens": "250" + "withdrawn_tokens": "250", + "remaining_tokens": "0" }, { "address": "0xe9bA7506Dc9a35C1fa39cBDafDcb97436f855F50", @@ -58561,10 +58628,17 @@ "tx": "0xadc25e73736cd85e84fee16f2d7ee41f16f7deb83a52ceb82b327974063964f7" } ], - "withdrawals": [], + "withdrawals": [ + { + "amount": "250", + "user": "0xe9bA7506Dc9a35C1fa39cBDafDcb97436f855F50", + "tranche_id": 6, + "tx": "0x9d5168d3cfda592b844c945f528dc5d7dd45154d723c844d7daa63592aaed972" + } + ], "total_tokens": "250", - "withdrawn_tokens": "0", - "remaining_tokens": "250" + "withdrawn_tokens": "250", + "remaining_tokens": "0" }, { "address": "0x9F5e23E5Ecd7946F63d41F54b192f01e7b7c4131", @@ -62011,10 +62085,17 @@ "tx": "0xd23813c30e93f3867eaa257b7aef7052a050b1ee1c1a90102a3f40c5d989fe82" } ], - "withdrawals": [], + "withdrawals": [ + { + "amount": "38.61", + "user": "0xc67f35d101E06b627C389Acc93B5A58f2401d8B2", + "tranche_id": 6, + "tx": "0x64d4740ffd946ab9df19e4bbcd488f18c8ff678a8ff0728867b518eed9c311f8" + } + ], "total_tokens": "38.61", - "withdrawn_tokens": "0", - "remaining_tokens": "38.61" + "withdrawn_tokens": "38.61", + "remaining_tokens": "0" }, { "address": "0x395DCE8839BC7A807EF43117E75Ee06B9057C519", @@ -62238,10 +62319,17 @@ "tx": "0x3a0390dffa4280c286016566b29c62e4cec36c6504f7ac3d1de80d22b2903008" } ], - "withdrawals": [], + "withdrawals": [ + { + "amount": "750", + "user": "0x351cc2560C870f01B099B106Be22C0073Fce10B2", + "tranche_id": 6, + "tx": "0x240e21e1e2ff7d746cf1e9bd854f6d5c169c46719b19f81a35f54d4b3ce57ba8" + } + ], "total_tokens": "750", - "withdrawn_tokens": "0", - "remaining_tokens": "750" + "withdrawn_tokens": "750", + "remaining_tokens": "0" }, { "address": "0x788E6b02258307aD05bE5C8756060f248CE3585d", @@ -64415,10 +64503,17 @@ "tx": "0xe32a466fc780a0fb3fd84a804f622931ebfaf3f428bff0dc6d141270410e75f8" } ], - "withdrawals": [], + "withdrawals": [ + { + "amount": "250", + "user": "0x64C5E5fF5B1B356820C58A35bb59e3Bb51ccF8ec", + "tranche_id": 6, + "tx": "0xcdf9b890cc4d67e26023f39fd0b356c6c13a745231a93c771b56b8b91b587a42" + } + ], "total_tokens": "250", - "withdrawn_tokens": "0", - "remaining_tokens": "250" + "withdrawn_tokens": "250", + "remaining_tokens": "0" }, { "address": "0x8CDdfe6828f97543A09849A2c1fB972F0e32A785", diff --git a/apps/static/src/assets/stagnet1-tranches.json b/apps/static/src/assets/stagnet1-tranches.json index e1eaf383e..ac492c4ca 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": "47.46261732623034", + "locked_amount": "47.187921740233385", "deposits": [ { "amount": "100", @@ -242,7 +242,7 @@ "tranche_end": "2022-10-12T00:53:20.000Z", "total_added": "100", "total_removed": "0", - "locked_amount": "34.98643138001015", + "locked_amount": "34.71173579401319", "deposits": [ { "amount": "100", From d4420d6038e40f46845b5d3b22e038fcacd0424c Mon Sep 17 00:00:00 2001 From: botond <105208209+notbot00@users.noreply.github.com> Date: Tue, 7 Jun 2022 10:26:45 +0100 Subject: [PATCH 2/2] 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 --- .../src/support/pages/deposits-page.ts | 3 +- .../step_definitions/withdrawals.step.ts | 13 ++- .../grid-tabs}/grid-tabs.tsx | 4 +- apps/trading/components/grid-tabs/index.ts | 1 + apps/trading/pages/markets/trade-grid.tsx | 2 +- apps/trading/pages/portfolio/index.page.tsx | 102 ++++++++++++------ .../portfolio/withdrawals/index.page.tsx | 4 +- ...ontainer.tsx => withdrawals-container.tsx} | 2 +- 8 files changed, 88 insertions(+), 43 deletions(-) rename apps/trading/{pages/markets => components/grid-tabs}/grid-tabs.tsx (95%) create mode 100644 apps/trading/components/grid-tabs/index.ts rename apps/trading/pages/portfolio/withdrawals/{withdrawals-page-container.tsx => withdrawals-container.tsx} (92%) diff --git a/apps/trading-e2e/src/support/pages/deposits-page.ts b/apps/trading-e2e/src/support/pages/deposits-page.ts index 4072046b6..fbb965696 100644 --- a/apps/trading-e2e/src/support/pages/deposits-page.ts +++ b/apps/trading-e2e/src/support/pages/deposits-page.ts @@ -7,8 +7,7 @@ export default class DepositsPage extends BasePage { amountError = '[role="alert"][aria-describedby="amount"]'; navigateToDeposits() { - cy.visit('/portfolio'); - cy.get(`a[href='/portfolio/deposit']`).click(); + cy.visit('/portfolio/deposit'); cy.url().should('include', '/portfolio/deposit'); cy.getByTestId('deposit-form').should('be.visible'); } diff --git a/apps/trading-e2e/src/support/step_definitions/withdrawals.step.ts b/apps/trading-e2e/src/support/step_definitions/withdrawals.step.ts index 169f8fb1a..2d12cc4bc 100644 --- a/apps/trading-e2e/src/support/step_definitions/withdrawals.step.ts +++ b/apps/trading-e2e/src/support/step_definitions/withdrawals.step.ts @@ -11,13 +11,18 @@ Given('I navigate to withdrawal page', () => { cy.visit('/'); portfolioPage.closeDialog(); marketPage.validateMarketsAreDisplayed(); - portfolioPage.navigateToPortfolio(); - portfolioPage.navigateToWithdraw(); + + // portfolioPage.navigateToPortfolio(); + // portfolioPage.navigateToWithdraw(); + // Navigation functions commented out due to button being removed and not added back in yet + cy.visit('/portfolio/withdraw'); }); Given('I navigate to withdrawals page', () => { - portfolioPage.navigateToPortfolio(); - portfolioPage.navigateToWithdrawals(); + // portfolioPage.navigateToPortfolio(); + // portfolioPage.navigateToWithdrawals(); + // Navigation functions commented out due to button being removed and not added back in yet + cy.visit('/portfolio/withdrawals'); }); When('I clear ethereum address', () => { diff --git a/apps/trading/pages/markets/grid-tabs.tsx b/apps/trading/components/grid-tabs/grid-tabs.tsx similarity index 95% rename from apps/trading/pages/markets/grid-tabs.tsx rename to apps/trading/components/grid-tabs/grid-tabs.tsx index d92b84f4a..e8b938561 100644 --- a/apps/trading/pages/markets/grid-tabs.tsx +++ b/apps/trading/components/grid-tabs/grid-tabs.tsx @@ -50,7 +50,7 @@ export const GridTabs = ({ children, group }: GridTabsProps) => { 'text-black dark:text-vega-yellow': isActive, 'bg-white dark:bg-black': isActive, 'text-black dark:text-white': !isActive, - 'bg-black-10 dark:bg-white-10': !isActive, + 'bg-black-10 dark:bg-white-25': !isActive, }); return ( { ); })} -
+
{Children.map(children, (child) => { diff --git a/apps/trading/components/grid-tabs/index.ts b/apps/trading/components/grid-tabs/index.ts new file mode 100644 index 000000000..67e97632b --- /dev/null +++ b/apps/trading/components/grid-tabs/index.ts @@ -0,0 +1 @@ +export * from './grid-tabs'; diff --git a/apps/trading/pages/markets/trade-grid.tsx b/apps/trading/pages/markets/trade-grid.tsx index 7e6eb7fed..18f865e3f 100644 --- a/apps/trading/pages/markets/trade-grid.tsx +++ b/apps/trading/pages/markets/trade-grid.tsx @@ -2,7 +2,6 @@ import classNames from 'classnames'; import AutoSizer from 'react-virtualized-auto-sizer'; import type { ReactNode } from 'react'; import { useState } from 'react'; -import { GridTab, GridTabs } from './grid-tabs'; import { DealTicketContainer } from '@vegaprotocol/deal-ticket'; import { OrderListContainer } from '@vegaprotocol/order-list'; import { TradesContainer } from '@vegaprotocol/trades'; @@ -13,6 +12,7 @@ import { t } from '@vegaprotocol/react-helpers'; import { AccountsContainer } from '@vegaprotocol/accounts'; import { DepthChartContainer } from '@vegaprotocol/market-depth'; import { CandlesChartContainer } from '@vegaprotocol/candles-chart'; +import { GridTab, GridTabs } from '../../components/grid-tabs'; import { SelectMarketDialog } from '@vegaprotocol/market-list'; import { ArrowDown, PriceCellChange } from '@vegaprotocol/ui-toolkit'; import type { CandleClose } from '@vegaprotocol/types'; diff --git a/apps/trading/pages/portfolio/index.page.tsx b/apps/trading/pages/portfolio/index.page.tsx index 9843a3048..fd1618e6e 100644 --- a/apps/trading/pages/portfolio/index.page.tsx +++ b/apps/trading/pages/portfolio/index.page.tsx @@ -1,39 +1,79 @@ +import { Web3Container } from '../../components/web3-container'; import { t } from '@vegaprotocol/react-helpers'; +import { PositionsContainer } from '@vegaprotocol/positions'; +import { OrderListContainer } from '@vegaprotocol/order-list'; +import { AccountsContainer } from '@vegaprotocol/accounts'; import { AnchorButton } from '@vegaprotocol/ui-toolkit'; +import { WithdrawalsContainer } from './withdrawals/withdrawals-container'; +import { GridTab, GridTabs } from '../../components/grid-tabs'; + const Portfolio = () => { + const tabClassName = 'p-[16px] pl-[316px]'; + return ( -
-

{t('Portfolio')}

-
- - {t('Deposit')} - - - {t('Deposit tEURO')} - -
-
- - {t('View Withdrawals')} - - - {t('Withdraw')} - - - {t('Withdraw tEURO')} - -
-
+ ( +
+
+ +
+ + +
+

+ {t('Positions')} +

+ +
+
+ +
+

+ {t('Orders')} +

+ +
+
+ +
+

+ {t('Fills')} +

+
+
+ +
+

+ {t('History')} +

+
+
+
+
+
+
+ + + + + + + {t('Deposit')} + + + + + + +
+
+ )} + /> ); }; diff --git a/apps/trading/pages/portfolio/withdrawals/index.page.tsx b/apps/trading/pages/portfolio/withdrawals/index.page.tsx index 6132d1f68..2c6af9058 100644 --- a/apps/trading/pages/portfolio/withdrawals/index.page.tsx +++ b/apps/trading/pages/portfolio/withdrawals/index.page.tsx @@ -2,7 +2,7 @@ import { t } from '@vegaprotocol/react-helpers'; import { AnchorButton } from '@vegaprotocol/ui-toolkit'; import { VegaWalletContainer } from '../../../components/vega-wallet-container'; import { Web3Container } from '../../../components/web3-container'; -import { WithdrawalsPageContainer } from './withdrawals-page-container'; +import { WithdrawalsContainer } from './withdrawals-container'; const Withdrawals = () => { return ( @@ -16,7 +16,7 @@ const Withdrawals = () => { {t('Start withdrawal')} - +
)} /> diff --git a/apps/trading/pages/portfolio/withdrawals/withdrawals-page-container.tsx b/apps/trading/pages/portfolio/withdrawals/withdrawals-container.tsx similarity index 92% rename from apps/trading/pages/portfolio/withdrawals/withdrawals-page-container.tsx rename to apps/trading/pages/portfolio/withdrawals/withdrawals-container.tsx index ab0646809..3c735708a 100644 --- a/apps/trading/pages/portfolio/withdrawals/withdrawals-page-container.tsx +++ b/apps/trading/pages/portfolio/withdrawals/withdrawals-container.tsx @@ -2,7 +2,7 @@ import orderBy from 'lodash/orderBy'; import { AsyncRenderer } from '@vegaprotocol/ui-toolkit'; import { useWithdrawals, WithdrawalsTable } from '@vegaprotocol/withdraws'; -export const WithdrawalsPageContainer = () => { +export const WithdrawalsContainer = () => { const { data, loading, error } = useWithdrawals(); return (