Compare commits

..
Author SHA1 Message Date
Bartłomiej Głownia 0acbac3bbd feat(#2323): don't allow cancel all if there are no cancellable orders 2023-01-03 12:00:21 +01:00
mattrussell36 5673620fbd chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-02 06:08:34 +00:00
mattrussell36 41d6940b89 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-02 00:12:58 +00:00
mattrussell36 84150bec8c chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-01 18:08:33 +00:00
mattrussell36 5a311d14c9 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-01 12:08:31 +00:00
mattrussell36 0f152a4b30 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-01 06:05:51 +00:00
mattrussell36 45d8b537a3 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-01 00:14:06 +00:00
mattrussell36 dc41be5715 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-31 18:08:31 +00:00
mattrussell36 a85cf66419 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-31 12:06:36 +00:00
mattrussell36 6e82e917ac chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-31 06:06:27 +00:00
mattrussell36 8dfdccd4aa chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-31 00:09:38 +00:00
Matthew Russell 82833cc06a chore: fix and improve types for market proposal (#2493)
* chore: fix and improve types for market proposal

* chore: remove unused type definition
2022-12-30 10:05:48 -08:00
botondandMatthew Russell aac3799b14 chore: add wallet client (#2462)
* chore: migrate to wallet client

* fix: bump client with new esm release version

* fix: add new no client error

* fix: bump wallet client to 0.1.2 and remove empty params from method calls

* fix: bump wallet client

* fix: format

* fix: reset client on url change

* fix: trading-deal-ticket tests after wallet client added

* fix: amend and cancel order tests, global connect tests

* chore: fix typescript error

* fix: connect wallet before mobile view test for console-lite

Co-authored-by: Matthew Russell <mattrussell36@gmail.com>
2022-12-30 10:05:27 -08:00
mattrussell36 0d1c9ff0f1 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-30 12:07:23 +00:00
Edd f8eec8a056 fix(explorer): fix resizing callout (#2492)
* fix(explorer): prevent layout thrashing on stats page
2022-12-30 11:40:47 +00:00
Edd ee6f26d473 feat(explorer): use block height filter 2022-12-30 09:53:07 +00:00
mattrussell36 de62d2d972 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-30 06:08:01 +00:00
20 changed files with 370 additions and 208 deletions
+1
View File
@@ -4,6 +4,7 @@ NX_TENDERMINT_URL=https://n04.d.vega.xyz/tm
NX_TENDERMINT_WEBSOCKET_URL=wss://n04.d.vega.xyz/tm/websocket
NX_VEGA_URL=https://api.n04.d.vega.xyz/graphql
NX_VEGA_ENV=DEVNET
NX_BLOCK_EXPLORER=https://be.devnet1.vega.xyz/rest
# App flags
NX_EXPLORER_ASSETS=1
+1
View File
@@ -4,6 +4,7 @@ NX_TENDERMINT_URL=https://mainnet-observer-proxy01.ops.vega.xyz/
NX_TENDERMINT_WEBSOCKET_URL=wss://mainnet-observer-proxy01.ops.vega.xyz/websocket
NX_VEGA_URL=https://api.vega.xyz/query
NX_VEGA_ENV=MAINNET
NX_BLOCK_EXPLORER=https://be.explorer.vega.xyz/rest
# App flags
NX_EXPLORER_ASSETS=1
+1
View File
@@ -4,6 +4,7 @@ NX_TENDERMINT_URL=https://tm.n00.stagnet3.vega.xyz
NX_TENDERMINT_WEBSOCKET_URL=wss://tm.n00.stagnet3.vega.xyz/websocket
NX_VEGA_URL=https://api.stagnet3.vega.xyz/graphql
NX_VEGA_ENV=STAGNET3
NX_BLOCK_EXPLORER=https://be.stagnet3.vega.xyz/rest
# App flags
NX_EXPLORER_ASSETS=1
+1
View File
@@ -4,6 +4,7 @@ NX_TENDERMINT_URL=https://tm.n07.testnet.vega.xyz/tm
NX_TENDERMINT_WEBSOCKET_URL=wss://lb.testnet.vega.xyz/tm/websocket
NX_VEGA_URL=https://api.n11.testnet.vega.xyz/graphql
NX_VEGA_ENV=TESTNET
NX_BLOCK_EXPLORER=https://be.testnet.vega.xyz/rest
# App flags
NX_EXPLORER_ASSETS=1
@@ -52,7 +52,8 @@ context('Blocks page', { tags: '@regression' }, function () {
});
});
it('Previous button disabled on first block', function () {
// Skipping - see https://github.com/vegaprotocol/frontend-monorepo/issues/2494
it.skip('Previous button disabled on first block', function () {
cy.get('[data-testid="block-input"]').type('1');
cy.get('[data-testid="go-submit"]').click();
cy.get(previousBlockBtn).find('button').should('be.disabled');
+19 -21
View File
@@ -20,19 +20,18 @@ context('Home Page', function () {
1: 'Height',
2: 'Uptime',
3: 'Total nodes',
4: 'Inactive nodes',
5: 'Total staked',
6: 'Backlog',
7: 'Trades / second',
8: 'Orders / block',
9: 'Orders / second',
10: 'Transactions / block',
11: 'Block time',
12: 'Time',
13: 'App',
14: 'Tendermint',
15: 'Up since',
16: 'Chain ID',
4: 'Total staked',
5: 'Backlog',
6: 'Trades / second',
7: 'Orders / block',
8: 'Orders / second',
9: 'Transactions / block',
10: 'Block time',
11: 'Time',
12: 'App',
13: 'Tendermint',
14: 'Up since',
15: 'Chain ID',
};
cy.get('[data-testid="stats-title"]')
@@ -40,7 +39,7 @@ context('Home Page', function () {
cy.wrap($list).should('have.text', statTitles[index]);
})
.then(($list) => {
cy.wrap($list).should('have.length', 17);
cy.wrap($list).should('have.length', 16);
});
cy.get(statsValue).eq(0).should('have.text', 'CONNECTED');
@@ -50,30 +49,29 @@ context('Home Page', function () {
.invoke('text')
.should('match', /\d+d \d+h \d+m \d+s/i);
cy.get(statsValue).eq(3).should('have.text', '2');
cy.get(statsValue).eq(4).should('have.text', '2');
cy.get(statsValue)
.eq(5)
.eq(4)
.invoke('text')
.should('match', /\d+\.\d\d(?!\d)/i);
cy.get(statsValue).eq(5).should('have.text', '0');
cy.get(statsValue).eq(6).should('have.text', '0');
cy.get(statsValue).eq(7).should('have.text', '0');
cy.get(statsValue).eq(8).should('have.text', '0');
cy.get(statsValue).eq(9).should('have.text', '0');
cy.get(statsValue).eq(9).should('not.be.empty');
cy.get(statsValue).eq(10).should('not.be.empty');
cy.get(statsValue).eq(11).should('not.be.empty');
cy.get(statsValue).eq(12).should('not.be.empty');
if (Cypress.env('NIGHTLY_RUN') != true) {
cy.get(statsValue)
.eq(13)
.eq(12)
.invoke('text')
.should('match', /v\d+\.\d+\.\d+/i);
}
cy.get(statsValue)
.eq(14)
.eq(13)
.invoke('text')
.should('match', /\d+\.\d+\.\d+/i);
cy.get(statsValue).eq(14).should('not.be.empty');
cy.get(statsValue).eq(15).should('not.be.empty');
cy.get(statsValue).eq(16).should('not.be.empty');
});
it('Block height should be updating', function () {
@@ -2,4 +2,3 @@ export { TxList } from './tx-list';
export { TxOrderType } from './tx-order-type';
export { TxsInfiniteList } from './txs-infinite-list';
export { TxsInfiniteListItem } from './txs-infinite-list-item';
export { TxsStatsInfo } from './txs-stats-info';
@@ -1,5 +1,4 @@
import { Routes } from '../../routes/route-names';
import { DATA_SOURCES } from '../../config';
import { RenderFetched } from '../render-fetched';
import { TruncatedLink } from '../truncate/truncated-link';
import { TxOrderType } from './tx-order-type';
@@ -8,6 +7,7 @@ import { t, useFetch } from '@vegaprotocol/react-helpers';
import type { BlockExplorerTransactions } from '../../routes/types/block-explorer-response';
import isNumber from 'lodash/isNumber';
import { ChainResponseCode } from './details/chain-response-code/chain-reponse.code';
import { getTxsDataUrl } from '../../hooks/use-txs-data';
interface TxsPerBlockProps {
blockHeight: string;
@@ -17,15 +17,11 @@ interface TxsPerBlockProps {
const truncateLength = 5;
export const TxsPerBlock = ({ blockHeight, txCount }: TxsPerBlockProps) => {
// TODO after https://github.com/vegaprotocol/vega/pull/6958/files is merged and deployed, use filter
// by block height instead
const filters = `filters[block.height]=${blockHeight}`;
const url = getTxsDataUrl({ limit: txCount.toString(), filters });
const {
state: { data, loading, error },
} = useFetch<BlockExplorerTransactions>(
`${
DATA_SOURCES.blockExplorerUrl
}/transactions?before=${blockHeight.toString()}.0&limit=${txCount}`
);
} = useFetch<BlockExplorerTransactions>(url);
return (
<RenderFetched error={error} loading={loading} className="text-body-large">
@@ -1,77 +0,0 @@
import { t } from '@vegaprotocol/react-helpers';
import { useEffect } from 'react';
import { InfoBlock } from '../../components/info-block';
import { Panel } from '../../components/panel';
import { useExplorerStatsQuery } from './__generated__/Explorer-stats';
import type { ExplorerStatsFieldsFragment } from './__generated__/Explorer-stats';
interface StatsMap {
field: keyof ExplorerStatsFieldsFragment;
label: string;
info: string;
}
export const TXS_STATS_MAP: StatsMap[] = [
{
field: 'averageOrdersPerBlock',
label: t('Orders per block'),
info: t(
'Number of new orders processed in the last block. All orders derived from pegged orders and liquidity commitments count as a single order'
),
},
{
field: 'txPerBlock',
label: t('Transactions per block'),
info: t('Number of transactions processed in the last block'),
},
{
field: 'tradesPerSecond',
label: t('Trades per second'),
info: t('Number of trades processed in the last second'),
},
{
field: 'ordersPerSecond',
label: t('Order per second'),
info: t(
'Number of orders processed in the last second. All orders derived from pegged orders and liquidity commitments count as a single order'
),
},
];
interface TxsStatsInfoProps {
className?: string;
}
export const TxsStatsInfo = ({ className }: TxsStatsInfoProps) => {
const { data, startPolling, stopPolling } = useExplorerStatsQuery();
useEffect(() => {
startPolling(1000);
return () => stopPolling();
});
const gridStyles =
'grid grid-rows-2 gap-4 grid-cols-2 xl:gap-8 xl:grid-rows-1 xl:grid-cols-4';
return (
<Panel className={className}>
<section className={gridStyles}>
{TXS_STATS_MAP.map((field) => {
if (!data?.statistics) {
return null;
}
// Workaround for awkward typing
const title = data.statistics[field.field] || '';
return (
<InfoBlock
subtitle={field.label}
tooltipInfo={field.info}
title={title}
/>
);
})}
</section>
</Panel>
);
};
@@ -1,7 +1,7 @@
import { t } from '@vegaprotocol/react-helpers';
import { RouteTitle } from '../../../components/route-title';
import { BlocksRefetch } from '../../../components/blocks';
import { TxsInfiniteList, TxsStatsInfo } from '../../../components/txs';
import { TxsInfiniteList } from '../../../components/txs';
import { useTxsData } from '../../../hooks/use-txs-data';
import { useDocumentTitle } from '../../../hooks/use-document-title';
@@ -16,7 +16,6 @@ export const TxsList = () => {
<section className="md:p-2 lg:p-4 xl:p-6">
<RouteTitle>{t('Transactions')}</RouteTitle>
<BlocksRefetch refetch={refreshTxs} />
<TxsStatsInfo className="!my-12 py-8" />
<TxsInfiniteList
hasMoreTxs={hasMoreTxs}
areTxsLoading={loading}
+217 -45
View File
@@ -38,7 +38,7 @@
"tranche_end": "2023-06-01T00:00:00.000Z",
"total_added": "2500",
"total_removed": "0",
"locked_amount": "2101.542467948718",
"locked_amount": "2056.9239354395605",
"deposits": [
{
"amount": "2500",
@@ -417,7 +417,7 @@
"tranche_end": "2023-12-05T00:00:00.000Z",
"total_added": "129999.45",
"total_removed": "0",
"locked_amount": "80654.76445420848552798",
"locked_amount": "79884.20240103216316788",
"deposits": [
{
"amount": "129999.45",
@@ -483,7 +483,7 @@
"tranche_end": "2023-09-03T00:00:00.000Z",
"total_added": "52600",
"total_removed": "0",
"locked_amount": "35593.95764840182646",
"locked_amount": "35125.85667808219596",
"deposits": [
{
"amount": "2600",
@@ -656,7 +656,7 @@
"tranche_end": "2023-09-17T00:00:00.000Z",
"total_added": "5000",
"total_removed": "0",
"locked_amount": "3575.2368721461185",
"locked_amount": "3530.740582191781",
"deposits": [
{
"amount": "5000",
@@ -867,7 +867,7 @@
"tranche_end": "2023-04-05T00:00:00.000Z",
"total_added": "97499.58",
"total_removed": "0",
"locked_amount": "22337.0122213305487778646",
"locked_amount": "21581.1626282667083078082",
"deposits": [
{
"amount": "97499.58",
@@ -900,7 +900,7 @@
"tranche_end": "2023-04-05T00:00:00.000Z",
"total_added": "135173.4239508",
"total_removed": "98230.390980249184455396",
"locked_amount": "30530.839382275709150186336568",
"locked_amount": "29497.723480545869946090378948",
"deposits": [
{
"amount": "135173.4239508",
@@ -946,7 +946,7 @@
"tranche_end": "2023-04-05T00:00:00.000Z",
"total_added": "32499.86",
"total_removed": "0",
"locked_amount": "9396.795301945282664652",
"locked_amount": "9078.822430967622302703",
"deposits": [
{
"amount": "32499.86",
@@ -979,7 +979,7 @@
"tranche_end": "2023-04-05T00:00:00.000Z",
"total_added": "10833.29",
"total_removed": "0",
"locked_amount": "3058.5656864399509017977",
"locked_amount": "2955.068602472426406863",
"deposits": [
{
"amount": "10833.29",
@@ -1012,7 +1012,7 @@
"tranche_end": "2023-04-05T00:00:00.000Z",
"total_added": "22749.93",
"total_removed": "0",
"locked_amount": "11433.601654221203906589",
"locked_amount": "11046.706438694370786783",
"deposits": [
{
"amount": "6500",
@@ -1151,7 +1151,7 @@
"tranche_end": "2023-05-01T00:00:00.000Z",
"total_added": "22500",
"total_removed": "2310.007577475",
"locked_amount": "15164.7876381215475",
"locked_amount": "14761.0022444751375",
"deposits": [
{
"amount": "7500",
@@ -1261,7 +1261,7 @@
"tranche_end": "2023-06-02T00:00:00.000Z",
"total_added": "1939928.38",
"total_removed": "928642.9598472029154",
"locked_amount": "818449.3613846688819184868",
"locked_amount": "801185.438247243121453134",
"deposits": [
{
"amount": "1852091.69",
@@ -1613,7 +1613,7 @@
"tranche_end": "2023-02-01T00:00:00.000Z",
"total_added": "42500",
"total_removed": "24434.0787288",
"locked_amount": "7620.50215126811625",
"locked_amount": "6870.23182744565295",
"deposits": [
{
"amount": "12500",
@@ -32067,7 +32067,7 @@
"tranche_end": "2023-06-05T00:00:00.000Z",
"total_added": "3732368.4671",
"total_removed": "431193.2979482613764",
"locked_amount": "1282173.03937512653353077042",
"locked_amount": "1255644.400172541962107718466",
"deposits": [
{
"amount": "1998.95815",
@@ -33303,8 +33303,8 @@
"tranche_start": "2022-06-05T00:00:00.000Z",
"tranche_end": "2023-12-05T00:00:00.000Z",
"total_added": "15870102.715470999700000001",
"total_removed": "513994.56123091191542452",
"locked_amount": "9846190.8598875452874234202340209699026764",
"total_removed": "519142.82799378314109952",
"locked_amount": "9752122.0085766169538295807960789444160584",
"deposits": [
{
"amount": "16249.93",
@@ -33808,6 +33808,26 @@
}
],
"withdrawals": [
{
"amount": "434.254023685890375",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tx": "0xcd3061658585189b7db32710ccbd22291d875124025834e2ed9fd1fd2dc0a813"
},
{
"amount": "533.097878746431625",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tx": "0xdcddb180c5a97188736586ed09475d4354cdf6e8b0b041f26693b3371384da97"
},
{
"amount": "1573.9558",
"user": "0xF4c75FdbAe821C6B5DBB9f001bB23cBA58D1bA37",
"tx": "0x9d2918dd3feec63a8e6f8b777f5e570cd449d0e1c64921f0cd760fb05031c781"
},
{
"amount": "1253.72073256229405",
"user": "0xe3eB4CF43C072658401996b71D43eE26E573562D",
"tx": "0x8600dfffc88429840fddb3360b8b357708c7f6bcabd2bd8c804ee21ace11c416"
},
{
"amount": "1269.616788",
"user": "0xF4c75FdbAe821C6B5DBB9f001bB23cBA58D1bA37",
@@ -33898,6 +33918,16 @@
"user": "0xE6CacAE56Cca8dFdB7910b5A13578719D4E57DA0",
"tx": "0xdbd515fed722081d9e1b03b6930f017f1df6de1cdc738a89a45716448dd708ad"
},
{
"amount": "0",
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
"tx": "0x77f7f390d59f8c85b75ad1db9dabd6dacdaf04b937f8a9e03520fdc3346857e2"
},
{
"amount": "1353.238327876609625",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tx": "0x40012432e4e417e6fb47f2c698fdb157e248ce34242bfa3a48e3755d0015a21d"
},
{
"amount": "930.302108",
"user": "0xF4c75FdbAe821C6B5DBB9f001bB23cBA58D1bA37",
@@ -35156,6 +35186,18 @@
}
],
"withdrawals": [
{
"amount": "434.254023685890375",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tranche_id": 2,
"tx": "0xcd3061658585189b7db32710ccbd22291d875124025834e2ed9fd1fd2dc0a813"
},
{
"amount": "533.097878746431625",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tranche_id": 2,
"tx": "0xdcddb180c5a97188736586ed09475d4354cdf6e8b0b041f26693b3371384da97"
},
{
"amount": "946.199315941372625",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
@@ -35204,6 +35246,12 @@
"tranche_id": 2,
"tx": "0x2e647a56ae1d573955783dfae447261e5dbabf2f61557f2cf9a4f19cdfa9e0ed"
},
{
"amount": "1353.238327876609625",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tranche_id": 2,
"tx": "0x40012432e4e417e6fb47f2c698fdb157e248ce34242bfa3a48e3755d0015a21d"
},
{
"amount": "2074.139541638025125",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
@@ -36094,8 +36142,8 @@
}
],
"total_tokens": "259998.8875",
"withdrawn_tokens": "97631.23734156811425",
"remaining_tokens": "162367.65015843188575"
"withdrawn_tokens": "99951.827571877045875",
"remaining_tokens": "160047.059928122954125"
},
{
"address": "0x89051CAb67Bc7F8CC44F7e270c6EDaf1EC57676c",
@@ -36316,6 +36364,12 @@
}
],
"withdrawals": [
{
"amount": "1253.72073256229405",
"user": "0xe3eB4CF43C072658401996b71D43eE26E573562D",
"tranche_id": 2,
"tx": "0x8600dfffc88429840fddb3360b8b357708c7f6bcabd2bd8c804ee21ace11c416"
},
{
"amount": "1168.32562674918194",
"user": "0xe3eB4CF43C072658401996b71D43eE26E573562D",
@@ -36474,8 +36528,8 @@
}
],
"total_tokens": "150551.801",
"withdrawn_tokens": "56712.0391204239847",
"remaining_tokens": "93839.7618795760153"
"withdrawn_tokens": "57965.75985298627875",
"remaining_tokens": "92586.04114701372125"
},
{
"address": "0x4d982Ab0823fD2f48e934a7be2bb0a5374a26148",
@@ -36677,6 +36731,12 @@
}
],
"withdrawals": [
{
"amount": "1573.9558",
"user": "0xF4c75FdbAe821C6B5DBB9f001bB23cBA58D1bA37",
"tranche_id": 2,
"tx": "0x9d2918dd3feec63a8e6f8b777f5e570cd449d0e1c64921f0cd760fb05031c781"
},
{
"amount": "1269.616788",
"user": "0xF4c75FdbAe821C6B5DBB9f001bB23cBA58D1bA37",
@@ -36805,8 +36865,8 @@
}
],
"total_tokens": "200000",
"withdrawn_tokens": "75341.743544",
"remaining_tokens": "124658.256456"
"withdrawn_tokens": "76915.699344",
"remaining_tokens": "123084.300656"
},
{
"address": "0x1b956E6c00E238194B331eddEFF72Cb5f28A8d01",
@@ -38116,8 +38176,8 @@
"tranche_start": "2021-11-05T00:00:00.000Z",
"tranche_end": "2023-05-05T00:00:00.000Z",
"total_added": "14597706.0446472999",
"total_removed": "3490080.38172369381877728",
"locked_amount": "3368495.307035651738854032761219703",
"total_removed": "3524412.62195988798093986",
"locked_amount": "3281651.544140687935725022233906477",
"deposits": [
{
"amount": "129284.449",
@@ -38326,6 +38386,31 @@
}
],
"withdrawals": [
{
"amount": "12758.73908063512839093",
"user": "0x91715128a71c9C734CDC20E5EdEEeA02E72e428E",
"tx": "0x41db06e3a05adf4be2d61eab5929825225a23051f0aaa5aca1ddd5760e188fa4"
},
{
"amount": "3671.528996246291985",
"user": "0xcc2cf726A84e71301f9079FC177BA946aa98A694",
"tx": "0xbdb207cce4094c7372c7a99f7e851c5d781883d24898fa285ae19eda27b50840"
},
{
"amount": "14686.9255071873432384",
"user": "0x47FbE34Fd93416c63d35544dEE6c6f442Db8513d",
"tx": "0xeda94e6e1582e8045c91d54b11d240bb9e1f49467bd16ae4e89727b5de9b9a82"
},
{
"amount": "762.7902369187144135",
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
"tx": "0x1fd0d4536451cf9f0b80832a66c6d8f4ca2a05f1c96f84f4679c94fd319fb4cb"
},
{
"amount": "738.21651322227936725",
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
"tx": "0x5edbba4195383ca3e47fe551b0579ddba8ce13cc93d455f8d678f6c315a5b297"
},
{
"amount": "1289.16117292541627425",
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
@@ -38376,6 +38461,11 @@
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
"tx": "0x40dc4dbfbf26c199c7cf1be4b281d553d470a830423ff678795585588d1c5cd0"
},
{
"amount": "1714.0399019844047675",
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
"tx": "0x4139309b9927ce8486e61491dd9ba7a31f36cc112dd6446c3d33ad897f14264c"
},
{
"amount": "9158.56255453299474378",
"user": "0x66827bCD635f2bB1779d68c46aEB16541bCA6ba8",
@@ -40942,6 +41032,18 @@
}
],
"withdrawals": [
{
"amount": "762.7902369187144135",
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
"tranche_id": 3,
"tx": "0x1fd0d4536451cf9f0b80832a66c6d8f4ca2a05f1c96f84f4679c94fd319fb4cb"
},
{
"amount": "738.21651322227936725",
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
"tranche_id": 3,
"tx": "0x5edbba4195383ca3e47fe551b0579ddba8ce13cc93d455f8d678f6c315a5b297"
},
{
"amount": "1289.16117292541627425",
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
@@ -40996,6 +41098,12 @@
"tranche_id": 3,
"tx": "0x40dc4dbfbf26c199c7cf1be4b281d553d470a830423ff678795585588d1c5cd0"
},
{
"amount": "1714.0399019844047675",
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
"tranche_id": 3,
"tx": "0x4139309b9927ce8486e61491dd9ba7a31f36cc112dd6446c3d33ad897f14264c"
},
{
"amount": "2874.6686339993457875",
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
@@ -43176,8 +43284,8 @@
}
],
"total_tokens": "359123.469575",
"withdrawn_tokens": "274787.455207805527091",
"remaining_tokens": "84336.014367194472909"
"withdrawn_tokens": "278002.50185993092563925",
"remaining_tokens": "81120.96771506907436075"
},
{
"address": "0xBdd412797c1B78535Afc5F71503b91fAbD0160fB",
@@ -43336,6 +43444,12 @@
}
],
"withdrawals": [
{
"amount": "3671.528996246291985",
"user": "0xcc2cf726A84e71301f9079FC177BA946aa98A694",
"tranche_id": 3,
"tx": "0xbdb207cce4094c7372c7a99f7e851c5d781883d24898fa285ae19eda27b50840"
},
{
"amount": "7412.8453939926209526",
"user": "0xcc2cf726A84e71301f9079FC177BA946aa98A694",
@@ -43380,8 +43494,8 @@
}
],
"total_tokens": "66299.71746",
"withdrawn_tokens": "47451.9402242768950194",
"remaining_tokens": "18847.7772357231049806"
"withdrawn_tokens": "51123.4692205231870044",
"remaining_tokens": "15176.2482394768129956"
},
{
"address": "0x66827bCD635f2bB1779d68c46aEB16541bCA6ba8",
@@ -43782,6 +43896,12 @@
}
],
"withdrawals": [
{
"amount": "14686.9255071873432384",
"user": "0x47FbE34Fd93416c63d35544dEE6c6f442Db8513d",
"tranche_id": 3,
"tx": "0xeda94e6e1582e8045c91d54b11d240bb9e1f49467bd16ae4e89727b5de9b9a82"
},
{
"amount": "29651.7863357455771104",
"user": "0x47FbE34Fd93416c63d35544dEE6c6f442Db8513d",
@@ -43826,8 +43946,8 @@
}
],
"total_tokens": "265198.86984",
"withdrawn_tokens": "189807.4910572575178776",
"remaining_tokens": "75391.3787827424821224"
"withdrawn_tokens": "204494.416564444861116",
"remaining_tokens": "60704.453275555138884"
},
{
"address": "0x35022e6c85B50F4904C7BC7e692A9F3bbEE8D2CE",
@@ -44004,6 +44124,12 @@
}
],
"withdrawals": [
{
"amount": "12758.73908063512839093",
"user": "0x91715128a71c9C734CDC20E5EdEEeA02E72e428E",
"tranche_id": 3,
"tx": "0x41db06e3a05adf4be2d61eab5929825225a23051f0aaa5aca1ddd5760e188fa4"
},
{
"amount": "25760.51683291284616209",
"user": "0x91715128a71c9C734CDC20E5EdEEeA02E72e428E",
@@ -44042,8 +44168,8 @@
}
],
"total_tokens": "230391.5181735",
"withdrawn_tokens": "164894.67179756811481554",
"remaining_tokens": "65496.84637593188518446"
"withdrawn_tokens": "177653.41087820324320647",
"remaining_tokens": "52738.10729529675679353"
},
{
"address": "0xC6b2864fbCD2A8dEC8DEfD1D421bC1E450C370AD",
@@ -44420,8 +44546,8 @@
"tranche_start": "2021-10-05T00:00:00.000Z",
"tranche_end": "2023-04-05T00:00:00.000Z",
"total_added": "5778205.3912159303",
"total_removed": "2479228.813551817124120168",
"locked_amount": "1014009.464759607923552643856300592",
"total_removed": "2488390.855746378035859668",
"locked_amount": "979696.968813102429839924968355447",
"deposits": [
{
"amount": "552496.6455",
@@ -44565,6 +44691,11 @@
}
],
"withdrawals": [
{
"amount": "9162.0421945609117395",
"user": "0x91715128a71c9C734CDC20E5EdEEeA02E72e428E",
"tx": "0xb3ccc6e824ffee15c67e8a0779dac9758deec01360025608c616a78f2670ad15"
},
{
"amount": "4206.439644984274503",
"user": "0xafa64cCa337eFEE0AD827F6C2684e69275226e90",
@@ -45249,6 +45380,12 @@
}
],
"withdrawals": [
{
"amount": "9162.0421945609117395",
"user": "0x91715128a71c9C734CDC20E5EdEEeA02E72e428E",
"tranche_id": 4,
"tx": "0xb3ccc6e824ffee15c67e8a0779dac9758deec01360025608c616a78f2670ad15"
},
{
"amount": "18498.907302984077175",
"user": "0x91715128a71c9C734CDC20E5EdEEeA02E72e428E",
@@ -45287,8 +45424,8 @@
}
],
"total_tokens": "165749.29365",
"withdrawn_tokens": "127806.068231543554428",
"remaining_tokens": "37943.225418456445572"
"withdrawn_tokens": "136968.1104261044661675",
"remaining_tokens": "28781.1832238955338325"
},
{
"address": "0x72e7BB93E73b2885a22CA29c34759361399a5C0e",
@@ -46216,8 +46353,8 @@
"tranche_start": "2022-06-05T00:00:00.000Z",
"tranche_end": "2023-06-05T00:00:00.000Z",
"total_added": "472355.6199999996",
"total_removed": "27394.9180255399005",
"locked_amount": "203167.64730254550148554696803652",
"total_removed": "27768.7412941819005",
"locked_amount": "198964.01779843084889609184830034",
"deposits": [
{
"amount": "3000",
@@ -52836,6 +52973,16 @@
}
],
"withdrawals": [
{
"amount": "229.648541348",
"user": "0x65C13724928ea0AfA68e09c7b70449bB8f6f3Fc8",
"tx": "0x9e93ae11a21aaa47b37494eb70d38c3b56117d894244398f33ba495006e785fd"
},
{
"amount": "115.710343734",
"user": "0x57d7881125E8057B0e8D90B7A2Cc8dACC72F8659",
"tx": "0x9b16067ba1c2dfbb487fb60690c377cd8a500211c2d6d354daadab71d706b381"
},
{
"amount": "20.707914768",
"user": "0x4eD2b3c68BB4fda084ce1591a210F4aC8b71234A",
@@ -52901,6 +53048,11 @@
"user": "0x91Ff7FADb80385D2E25E12F92d211688a550A06C",
"tx": "0x87ae337c9809d80018c3f2c3b90df597bea0b3ac865fb58f8471ff92ebcbadd8"
},
{
"amount": "28.46438356",
"user": "0x7C8D2D8BcFffcD48dBcb65C5Bb7588B66dcD22bb",
"tx": "0x8148604cfba3cabb5229c19cd857c8c47255c1502bddc9871c01b05cf569c691"
},
{
"amount": "199.140778792",
"user": "0x2827B97046558f044ab07c3De0159632f8956472",
@@ -66414,6 +66566,12 @@
}
],
"withdrawals": [
{
"amount": "28.46438356",
"user": "0x7C8D2D8BcFffcD48dBcb65C5Bb7588B66dcD22bb",
"tranche_id": 5,
"tx": "0x8148604cfba3cabb5229c19cd857c8c47255c1502bddc9871c01b05cf569c691"
},
{
"amount": "35.005327244",
"user": "0x7C8D2D8BcFffcD48dBcb65C5Bb7588B66dcD22bb",
@@ -66434,8 +66592,8 @@
}
],
"total_tokens": "400",
"withdrawn_tokens": "199.913685944",
"remaining_tokens": "200.086314056"
"withdrawn_tokens": "228.378069504",
"remaining_tokens": "171.621930496"
},
{
"address": "0xc56F9f1d5f124655FA9CB8f85C7701E13a2fBF4D",
@@ -71867,10 +72025,17 @@
"tx": "0xc8541da6a57f410b6faba47a5e5184bae700193b7bd042914fffc562114d92f5"
}
],
"withdrawals": [],
"withdrawals": [
{
"amount": "229.648541348",
"user": "0x65C13724928ea0AfA68e09c7b70449bB8f6f3Fc8",
"tranche_id": 5,
"tx": "0x9e93ae11a21aaa47b37494eb70d38c3b56117d894244398f33ba495006e785fd"
}
],
"total_tokens": "400",
"withdrawn_tokens": "0",
"remaining_tokens": "400"
"withdrawn_tokens": "229.648541348",
"remaining_tokens": "170.351458652"
},
{
"address": "0x4FF4255c498e844cE78F9F9aD46913A20A1642b4",
@@ -73823,10 +73988,17 @@
"tx": "0xe32a466fc780a0fb3fd84a804f622931ebfaf3f428bff0dc6d141270410e75f8"
}
],
"withdrawals": [],
"withdrawals": [
{
"amount": "115.710343734",
"user": "0x57d7881125E8057B0e8D90B7A2Cc8dACC72F8659",
"tranche_id": 5,
"tx": "0x9b16067ba1c2dfbb487fb60690c377cd8a500211c2d6d354daadab71d706b381"
}
],
"total_tokens": "200",
"withdrawn_tokens": "0",
"remaining_tokens": "200"
"withdrawn_tokens": "115.710343734",
"remaining_tokens": "84.289656266"
},
{
"address": "0x89F3Db3ce23E58A3C416D5930d7E806d80E4F1FF",
@@ -31,7 +31,7 @@ describe('orders list', { tags: '@smoke' }, () => {
cy.getByTestId('Orders').click();
cy.connectVegaWallet();
cy.wait('@Orders').then(() => {
expect(subscriptionMocks.OrdersUpdate).to.be.calledOnce;
expect(subscriptionMocks.OrdersUpdate).to.be.calledTwice;
});
cy.wait('@Markets');
});
@@ -129,7 +129,7 @@ describe('subscribe orders', { tags: '@smoke' }, () => {
cy.getByTestId('Orders').click();
cy.connectVegaWallet();
cy.wait('@Orders').then(() => {
expect(subscriptionMocks.OrdersUpdate).to.be.calledOnce;
expect(subscriptionMocks.OrdersUpdate).to.be.calledTwice;
});
});
const orderId = '1234567890';
@@ -345,7 +345,7 @@ describe('amend and cancel order', { tags: '@smoke' }, () => {
cy.getByTestId('Orders').click();
cy.connectVegaWallet();
cy.wait('@Orders').then(() => {
expect(subscriptionMocks.OrdersUpdate).to.be.calledOnce;
expect(subscriptionMocks.OrdersUpdate).to.be.calledTwice;
});
cy.mockVegaWalletTransaction();
});
@@ -31,7 +31,7 @@ const compileData = (data?: StatsQuery) => {
value.forEach((x) => {
const stat = {
...x,
value: statData,
value: statData || '-',
};
stat.promoted ? acc.promoted.push(stat) : acc.table.push(stat);
@@ -75,7 +75,7 @@ export const StatsManager = ({ className }: StatsManagerProps) => {
return (
<PromotedStatsItem
title={stat.title}
value={stat.value}
value={stat.value || '-'}
formatter={stat.formatter}
goodThreshold={stat.goodThreshold}
description={stat.description}
@@ -92,7 +92,7 @@ export const StatsManager = ({ className }: StatsManagerProps) => {
return (
<TableRow
title={stat.title}
value={stat.value}
value={stat.value || '-'}
formatter={stat.formatter}
goodThreshold={stat.goodThreshold}
description={stat.description}
+6 -12
View File
@@ -48,13 +48,7 @@ export const statsFields: { [key in keyof Stats]: StatFields[] } = {
description: t('The total number of nodes registered on the network'),
},
],
inactiveNodes: [
{
title: t('Inactive nodes'),
goodThreshold: (totalInactive: number) => totalInactive < 1,
description: t('Nodes that are registered but not validating'),
},
],
inactiveNodes: [],
stakedTotal: [
{
title: t('Total staked'),
@@ -174,11 +168,11 @@ export const statsFields: { [key in keyof Stats]: StatFields[] } = {
title: t('Uptime'),
formatter: (t: string) => {
if (!t) {
return;
return '-';
}
const date = new Date(t);
if (!isValidDate(date)) {
return;
return '-';
}
const secSinceStart = (new Date().getTime() - date.getTime()) / 1000;
const days = Math.floor(secSinceStart / 60 / 60 / 24);
@@ -194,13 +188,13 @@ export const statsFields: { [key in keyof Stats]: StatFields[] } = {
title: t('Up since'),
formatter: (t: string) => {
if (!t) {
return;
return '-';
}
const date = new Date(t);
if (!isValidDate(date)) {
return;
return '-';
}
return getDateTimeFormat().format(date);
return getDateTimeFormat().format(date) || '-';
},
description: t('Genesis'),
},
@@ -16,6 +16,7 @@ import {
} from '../mocks/generate-orders';
const defaultProps: OrderListTableProps = {
hasActiveOrder: true,
rowData: [],
setEditOrder: jest.fn(),
cancel: jest.fn(),
@@ -17,6 +17,7 @@ const Template: Story = (args) => {
return (
<div style={{ height: 1000 }}>
<OrderListTable
hasActiveOrder
rowData={args.data}
cancel={cancel}
cancelAll={cancel}
@@ -46,6 +47,7 @@ const Template2: Story = (args) => {
<>
<div style={{ height: 1000 }}>
<OrderListTable
hasActiveOrder
rowData={args.data}
cancel={cancel}
cancelAll={cancel}
@@ -24,6 +24,7 @@ import BigNumber from 'bignumber.js';
import { forwardRef, useState } from 'react';
import type { TypedDataAgGrid } from '@vegaprotocol/ui-toolkit';
import { useOrderCancel } from '../../order-hooks/use-order-cancel';
import { useHasActiveOrder } from '../../order-hooks/use-has-active-order';
import { useOrderEdit } from '../../order-hooks/use-order-edit';
import { OrderFeedback } from '../order-feedback';
import { OrderEditDialog } from './order-edit-dialog';
@@ -78,11 +79,13 @@ export const OrderList = forwardRef<AgGridReact, OrderListProps>(
const [editOrder, setEditOrder] = useState<Order | null>(null);
const orderCancel = useOrderCancel();
const orderEdit = useOrderEdit(editOrder);
const hasActiveOrder = useHasActiveOrder(props.marketId);
return (
<>
<OrderListTable
{...props}
hasActiveOrder={hasActiveOrder}
cancelAll={() => {
orderCancel.cancel({
marketId: props.marketId,
@@ -144,11 +147,12 @@ export const OrderList = forwardRef<AgGridReact, OrderListProps>(
export type OrderListTableProps = OrderListProps & {
cancel: (order: Order) => void;
cancelAll: () => void;
hasActiveOrder: boolean;
setEditOrder: (order: Order) => void;
};
export const OrderListTable = forwardRef<AgGridReact, OrderListTableProps>(
({ cancel, cancelAll, setEditOrder, ...props }, ref) => {
({ cancel, cancelAll, setEditOrder, hasActiveOrder, ...props }, ref) => {
return (
<AgGrid
ref={ref}
@@ -365,15 +369,17 @@ export const OrderListTable = forwardRef<AgGridReact, OrderListTableProps>(
cellRenderer={({ data, node }: VegaICellRendererParams<Order>) => {
if (node?.rowPinned) {
return (
<div className="flex gap-2 items-center h-full justify-end">
<Button
size="xs"
data-testid="cancelAll"
onClick={() => cancelAll()}
>
{t('Cancel all')}
</Button>
</div>
hasActiveOrder && (
<div className="flex gap-2 items-center h-full justify-end">
<Button
size="xs"
data-testid="cancelAll"
onClick={() => cancelAll()}
>
{t('Cancel all')}
</Button>
</div>
)
);
}
if (isOrderAmendable(data)) {
+1
View File
@@ -1,4 +1,5 @@
export * from './__generated__/OrderEvent';
export * from './use-has-active-order';
export * from './use-order-cancel';
export * from './use-order-submit';
export * from './use-order-edit';
@@ -0,0 +1,47 @@
import { useState, useEffect, useMemo } from 'react';
import {
useOrdersUpdateSubscription,
useOrdersQuery,
} from '../components/order-data-provider/__generated__/Orders';
import { useVegaWallet } from '@vegaprotocol/wallet';
import * as Schema from '@vegaprotocol/types';
export const useHasActiveOrder = (marketId?: string) => {
const { pubKey } = useVegaWallet();
const skip = !pubKey;
const [hasActiveOrder, setHasActiveOrder] = useState(false);
const subscriptionVariables = useMemo(
() => ({
partyId: pubKey || '',
marketId,
}),
[pubKey, marketId]
);
const queryVariables = useMemo(
() => ({
...subscriptionVariables,
pagination: { first: 1 },
filter: { status: [Schema.OrderStatus.STATUS_ACTIVE] },
}),
[subscriptionVariables]
);
const { refetch, data, loading } = useOrdersQuery({
variables: queryVariables,
fetchPolicy: 'no-cache',
skip,
});
useEffect(() => {
if (!loading && data) {
setHasActiveOrder(!!data.party?.ordersConnection?.edges?.length);
}
}, [loading, data]);
useOrdersUpdateSubscription({
variables: subscriptionVariables,
onData: () => refetch(),
skip,
});
return hasActiveOrder;
};
+44 -25
View File
@@ -76,13 +76,13 @@ interface ProposalNewMarketTerms {
changes: {
decimalPlaces: string;
positionDecimalPlaces: string;
lpPriceRange: string;
instrument: {
name: string;
code: string;
future: {
settlementAsset: string;
quoteName: string;
settlementPriceDecimals: number;
dataSourceSpecForSettlementData: DataSourceSpec;
dataSourceSpecForTradingTermination: DataSourceSpec;
dataSourceSpecBinding: DataSourceSpecBinding;
@@ -100,12 +100,6 @@ interface ProposalNewMarketTerms {
};
logNormal: LogNormal;
};
liquidityCommitment: {
commitmentAmount: string;
fee: string;
buys: Buy[];
sells: Buy[];
};
};
closingTimestamp: number;
enactmentTimestamp: number;
@@ -184,35 +178,66 @@ interface ProposalUpdateAssetTerms {
}
interface DataSourceSpecBinding {
settlementPriceProperty: string;
settlementDataProperty: string;
tradingTerminationProperty: string;
}
interface DataSourceSpec {
config: {
signers: Signer[];
filters: Filter[];
interface InternalDataSourceSpec {
internal: {
time: {
conditions: Condition[];
};
};
}
interface ExternalDataSourceSpec {
external: {
oracle: {
signers: Signer[];
filters: Filter[];
};
};
}
type DataSourceSpec = InternalDataSourceSpec | ExternalDataSourceSpec;
type Signer =
| {
address: string;
ethAddress: {
address: string;
};
}
| {
key: string;
pubKey: {
key: string;
};
};
interface Filter {
key: {
name: string;
type: string;
};
key: DefaultFilterKey | IntegerFilterKey;
conditions?: Condition[];
}
interface DefaultFilterKey {
name: string;
type: 'TYPE_DECIMAL' | 'TYPE_BOOLEAN' | 'TYPE_TIMESTAMP' | 'TYPE_STRING';
}
interface IntegerFilterKey {
name: string;
type: 'TYPE_INTEGER';
numberDecimalPlaces: string;
}
type ConditionOperator =
| 'OPERATOR_EQUALS'
| 'OPERATOR_GREATER_THAN'
| 'OPERATOR_GREATER_THAN_OR_EQUAL'
| 'OPERATOR_LESS_THAN'
| 'OPERATOR_LESS_THAN_OR_EQUAL';
interface Condition {
operator: string;
operator: ConditionOperator;
value: string;
}
@@ -236,12 +261,6 @@ interface Trigger {
auctionExtension: string;
}
interface Buy {
offset: string;
proportion: number;
reference: string;
}
export interface ProposalSubmission {
rationale: {
description: string;