Compare commits
32
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
308bd406a6 | ||
|
|
4ffff8a9c7 | ||
|
|
ac4b48610c | ||
|
|
2b28b29820 | ||
|
|
bf5e428460 | ||
|
|
73359e9ff7 | ||
|
|
f34edf1862 | ||
|
|
d8512afb2b | ||
|
|
549e0e004d | ||
|
|
8b08e48840 | ||
|
|
846f9114d8 | ||
|
|
a9216c12a3 | ||
|
|
d85c5d7c1f | ||
|
|
7675fe0ab0 | ||
|
|
bd51564207 | ||
|
|
fac08bc831 | ||
|
|
a34ea77488 | ||
|
|
e50afc64ff | ||
|
|
9f4bf97465 | ||
|
|
dc59f56a6f | ||
|
|
8a9372c88a | ||
|
|
8563625079 | ||
|
|
946ee9423b | ||
|
|
e3aa1e40c8 | ||
|
|
179d34ff40 | ||
|
|
7613a9fa9f | ||
|
|
1beaad5759 | ||
|
|
8958db0612 | ||
|
|
4db77a8e8a | ||
|
|
097cf5da94 | ||
|
|
3f1ea6b83d | ||
|
|
93f41d429f |
@@ -133,7 +133,7 @@ jobs:
|
||||
working-directory: frontend-monorepo
|
||||
|
||||
- name: Run Cypress tests
|
||||
run: yarn nx run ${{ github.event.inputs.project }}:e2e --record --key ${{ secrets.CYPRESS_RECORD_KEY }} --browser chrome
|
||||
run: yarn nx run ${{ github.event.inputs.project }}:e2e --record --key ${{ secrets.CYPRESS_RECORD_KEY }}
|
||||
working-directory: frontend-monorepo
|
||||
env:
|
||||
CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE: ${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }}
|
||||
|
||||
@@ -117,7 +117,7 @@ jobs:
|
||||
working-directory: frontend-monorepo
|
||||
|
||||
- name: Run Cypress tests
|
||||
run: yarn nx run-many --target=e2e --all --record --key ${{ secrets.CYPRESS_RECORD_KEY }} --browser chrome
|
||||
run: yarn nx run-many --target=e2e --all --record --key ${{ secrets.CYPRESS_RECORD_KEY }}
|
||||
working-directory: frontend-monorepo
|
||||
env:
|
||||
CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE: ${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }}
|
||||
|
||||
@@ -130,7 +130,7 @@ jobs:
|
||||
working-directory: frontend-monorepo
|
||||
|
||||
- name: Run Cypress tests
|
||||
run: npx nx affected:e2e --record --key ${{ secrets.CYPRESS_RECORD_KEY }} --browser chrome
|
||||
run: npx nx affected:e2e --record --key ${{ secrets.CYPRESS_RECORD_KEY }}
|
||||
working-directory: frontend-monorepo
|
||||
env:
|
||||
CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE: ${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as Types from '@vegaprotocol/types/types';
|
||||
import { Schema as Types } from '@vegaprotocol/types';
|
||||
|
||||
import { gql } from '@apollo/client';
|
||||
import * as Apollo from '@apollo/client';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as Types from '@vegaprotocol/types/types';
|
||||
import { Schema as Types } from '@vegaprotocol/types';
|
||||
|
||||
import { gql } from '@apollo/client';
|
||||
import * as Apollo from '@apollo/client';
|
||||
|
||||
@@ -68,5 +68,5 @@ export interface Deposits {
|
||||
/**
|
||||
* The list of all assets in use in the Vega network or the specified asset if ID is provided
|
||||
*/
|
||||
assetsConnection: Deposits_assetsConnection;
|
||||
assetsConnection: Deposits_assetsConnection | null;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as Types from '@vegaprotocol/types/types';
|
||||
import { Schema as Types } from '@vegaprotocol/types';
|
||||
|
||||
import { gql } from '@apollo/client';
|
||||
import * as Apollo from '@apollo/client';
|
||||
@@ -6,7 +6,7 @@ const defaultOptions = {} as const;
|
||||
export type DepositsQueryVariables = Types.Exact<{ [key: string]: never; }>;
|
||||
|
||||
|
||||
export type DepositsQuery = { __typename?: 'Query', assetsConnection: { __typename?: 'AssetsConnection', edges?: Array<{ __typename?: 'AssetEdge', node: { __typename?: 'Asset', id: string, name: string, symbol: string, decimals: number, source: { __typename?: 'BuiltinAsset' } | { __typename?: 'ERC20', contractAddress: string } } } | null> | null } };
|
||||
export type DepositsQuery = { __typename?: 'Query', assetsConnection?: { __typename?: 'AssetsConnection', edges?: Array<{ __typename?: 'AssetEdge', node: { __typename?: 'Asset', id: string, name: string, symbol: string, decimals: number, source: { __typename?: 'BuiltinAsset' } | { __typename?: 'ERC20', contractAddress: string } } } | null> | null } | null };
|
||||
|
||||
|
||||
export const DepositsDocument = gql`
|
||||
|
||||
@@ -8,7 +8,7 @@ interface TabBarProps {
|
||||
export const TabBar = ({ className }: TabBarProps) => (
|
||||
<div role="group" aria-label="Tab Bar Navigation Menu" className={className}>
|
||||
<div role="presentation" className="py-[42px]" />
|
||||
<div className="md:hidden fixed bottom-0 left-0 right-0 bg-black py-4 border-t border-neutral-300 dark:border-neutral-700">
|
||||
<div className="md:hidden fixed bottom-0 left-0 right-0 bg-black py-4 border-t border-neutral-300 dark:border-neutral-600">
|
||||
<Nav tabs className="flex justify-evenly items-center" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,20 +1,15 @@
|
||||
fragment SimpleMarketDataFields on MarketData {
|
||||
market {
|
||||
id
|
||||
state
|
||||
}
|
||||
fragment SimpleMarketDataFields on ObservableMarketData {
|
||||
marketId
|
||||
marketState
|
||||
}
|
||||
|
||||
query SimpleMarkets($CandleSince: String!) {
|
||||
markets {
|
||||
id
|
||||
name
|
||||
state
|
||||
data {
|
||||
...SimpleMarketDataFields
|
||||
}
|
||||
tradableInstrument {
|
||||
instrument {
|
||||
name
|
||||
code
|
||||
metadata {
|
||||
tags
|
||||
@@ -37,8 +32,8 @@ query SimpleMarkets($CandleSince: String!) {
|
||||
}
|
||||
}
|
||||
|
||||
subscription SimpleMarketDataSub {
|
||||
marketData {
|
||||
subscription SimpleMarketDataSub($marketIds: [ID!]!) {
|
||||
marketsData(marketIds: $marketIds) {
|
||||
...SimpleMarketDataFields
|
||||
}
|
||||
}
|
||||
|
||||
Generated
-30
@@ -1,30 +0,0 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @generated
|
||||
// This file was automatically generated and should not be edited.
|
||||
|
||||
import { MarketState } from "@vegaprotocol/types";
|
||||
|
||||
// ====================================================
|
||||
// GraphQL fragment: SimpleMarketDataFields
|
||||
// ====================================================
|
||||
|
||||
export interface SimpleMarketDataFields_market {
|
||||
__typename: "Market";
|
||||
/**
|
||||
* Market ID
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* Current state of the market
|
||||
*/
|
||||
state: MarketState;
|
||||
}
|
||||
|
||||
export interface SimpleMarketDataFields {
|
||||
__typename: "MarketData";
|
||||
/**
|
||||
* market ID of the associated mark price
|
||||
*/
|
||||
market: SimpleMarketDataFields_market;
|
||||
}
|
||||
Generated
+10
-14
@@ -9,29 +9,25 @@ import { MarketState } from "@vegaprotocol/types";
|
||||
// GraphQL subscription operation: SimpleMarketDataSub
|
||||
// ====================================================
|
||||
|
||||
export interface SimpleMarketDataSub_marketData_market {
|
||||
__typename: "Market";
|
||||
export interface SimpleMarketDataSub_marketsData {
|
||||
__typename: "ObservableMarketData";
|
||||
/**
|
||||
* Market ID
|
||||
* current state of the market
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* Current state of the market
|
||||
*/
|
||||
state: MarketState;
|
||||
}
|
||||
|
||||
export interface SimpleMarketDataSub_marketData {
|
||||
__typename: "MarketData";
|
||||
marketState: MarketState;
|
||||
/**
|
||||
* market ID of the associated mark price
|
||||
*/
|
||||
market: SimpleMarketDataSub_marketData_market;
|
||||
marketId: string;
|
||||
}
|
||||
|
||||
export interface SimpleMarketDataSub {
|
||||
/**
|
||||
* Subscribe to the mark price changes
|
||||
*/
|
||||
marketData: SimpleMarketDataSub_marketData;
|
||||
marketsData: SimpleMarketDataSub_marketsData[];
|
||||
}
|
||||
|
||||
export interface SimpleMarketDataSubVariables {
|
||||
marketIds: string[];
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as Types from '@vegaprotocol/types/types';
|
||||
import { Schema as Types } from '@vegaprotocol/types';
|
||||
|
||||
import { gql } from '@apollo/client';
|
||||
import * as Apollo from '@apollo/client';
|
||||
|
||||
+16
-18
@@ -1,41 +1,38 @@
|
||||
import * as Types from '@vegaprotocol/types/types';
|
||||
import { Schema as Types } from '@vegaprotocol/types';
|
||||
|
||||
import { gql } from '@apollo/client';
|
||||
import * as Apollo from '@apollo/client';
|
||||
const defaultOptions = {} as const;
|
||||
export type SimpleMarketDataFieldsFragment = { __typename?: 'MarketData', market: { __typename?: 'Market', id: string, state: Types.MarketState } };
|
||||
export type SimpleMarketDataFieldsFragment = { __typename?: 'ObservableMarketData', marketId: string, marketState: Types.MarketState };
|
||||
|
||||
export type SimpleMarketsQueryVariables = Types.Exact<{
|
||||
CandleSince: Types.Scalars['String'];
|
||||
}>;
|
||||
|
||||
|
||||
export type SimpleMarketsQuery = { __typename?: 'Query', markets?: Array<{ __typename?: 'Market', id: string, name: string, state: Types.MarketState, data?: { __typename?: 'MarketData', market: { __typename?: 'Market', id: string, state: Types.MarketState } } | null, tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', code: string, metadata: { __typename?: 'InstrumentMetadata', tags?: Array<string> | null }, product: { __typename: 'Future', quoteName: string, settlementAsset: { __typename?: 'Asset', symbol: string } } } }, candles?: Array<{ __typename?: 'Candle', open: string, close: string } | null> | null }> | null };
|
||||
export type SimpleMarketsQuery = { __typename?: 'Query', markets?: Array<{ __typename?: 'Market', id: string, state: Types.MarketState, tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', name: string, code: string, metadata: { __typename?: 'InstrumentMetadata', tags?: Array<string> | null }, product: { __typename: 'Future', quoteName: string, settlementAsset: { __typename?: 'Asset', symbol: string } } } }, candles?: Array<{ __typename?: 'Candle', open: string, close: string } | null> | null }> | null };
|
||||
|
||||
export type SimpleMarketDataSubSubscriptionVariables = Types.Exact<{ [key: string]: never; }>;
|
||||
export type SimpleMarketDataSubSubscriptionVariables = Types.Exact<{
|
||||
marketIds: Array<Types.Scalars['ID']> | Types.Scalars['ID'];
|
||||
}>;
|
||||
|
||||
|
||||
export type SimpleMarketDataSubSubscription = { __typename?: 'Subscription', marketData: { __typename?: 'MarketData', market: { __typename?: 'Market', id: string, state: Types.MarketState } } };
|
||||
export type SimpleMarketDataSubSubscription = { __typename?: 'Subscription', marketsData: Array<{ __typename?: 'ObservableMarketData', marketId: string, marketState: Types.MarketState }> };
|
||||
|
||||
export const SimpleMarketDataFieldsFragmentDoc = gql`
|
||||
fragment SimpleMarketDataFields on MarketData {
|
||||
market {
|
||||
id
|
||||
state
|
||||
}
|
||||
fragment SimpleMarketDataFields on ObservableMarketData {
|
||||
marketId
|
||||
marketState
|
||||
}
|
||||
`;
|
||||
export const SimpleMarketsDocument = gql`
|
||||
query SimpleMarkets($CandleSince: String!) {
|
||||
markets {
|
||||
id
|
||||
name
|
||||
state
|
||||
data {
|
||||
...SimpleMarketDataFields
|
||||
}
|
||||
tradableInstrument {
|
||||
instrument {
|
||||
name
|
||||
code
|
||||
metadata {
|
||||
tags
|
||||
@@ -57,7 +54,7 @@ export const SimpleMarketsDocument = gql`
|
||||
}
|
||||
}
|
||||
}
|
||||
${SimpleMarketDataFieldsFragmentDoc}`;
|
||||
`;
|
||||
|
||||
/**
|
||||
* __useSimpleMarketsQuery__
|
||||
@@ -87,8 +84,8 @@ export type SimpleMarketsQueryHookResult = ReturnType<typeof useSimpleMarketsQue
|
||||
export type SimpleMarketsLazyQueryHookResult = ReturnType<typeof useSimpleMarketsLazyQuery>;
|
||||
export type SimpleMarketsQueryResult = Apollo.QueryResult<SimpleMarketsQuery, SimpleMarketsQueryVariables>;
|
||||
export const SimpleMarketDataSubDocument = gql`
|
||||
subscription SimpleMarketDataSub {
|
||||
marketData {
|
||||
subscription SimpleMarketDataSub($marketIds: [ID!]!) {
|
||||
marketsData(marketIds: $marketIds) {
|
||||
...SimpleMarketDataFields
|
||||
}
|
||||
}
|
||||
@@ -106,10 +103,11 @@ export const SimpleMarketDataSubDocument = gql`
|
||||
* @example
|
||||
* const { data, loading, error } = useSimpleMarketDataSubSubscription({
|
||||
* variables: {
|
||||
* marketIds: // value for 'marketIds'
|
||||
* },
|
||||
* });
|
||||
*/
|
||||
export function useSimpleMarketDataSubSubscription(baseOptions?: Apollo.SubscriptionHookOptions<SimpleMarketDataSubSubscription, SimpleMarketDataSubSubscriptionVariables>) {
|
||||
export function useSimpleMarketDataSubSubscription(baseOptions: Apollo.SubscriptionHookOptions<SimpleMarketDataSubSubscription, SimpleMarketDataSubSubscriptionVariables>) {
|
||||
const options = {...defaultOptions, ...baseOptions}
|
||||
return Apollo.useSubscription<SimpleMarketDataSubSubscription, SimpleMarketDataSubSubscriptionVariables>(SimpleMarketDataSubDocument, options);
|
||||
}
|
||||
|
||||
@@ -42,12 +42,10 @@ export const MARKETS_QUERY = gql`
|
||||
`;
|
||||
|
||||
const MARKET_DATA_SUB = gql`
|
||||
subscription SimpleMarketDataSub {
|
||||
marketData {
|
||||
market {
|
||||
id
|
||||
state
|
||||
}
|
||||
subscription SimpleMarketDataSub($marketIds: [ID!]!) {
|
||||
marketsData(marketIds: $marketIds) {
|
||||
marketState
|
||||
marketId
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -103,7 +103,7 @@ export interface PartyMarketData_party {
|
||||
/**
|
||||
* Margin levels for a market
|
||||
*/
|
||||
marginsConnection: PartyMarketData_party_marginsConnection;
|
||||
marginsConnection: PartyMarketData_party_marginsConnection | null;
|
||||
}
|
||||
|
||||
export interface PartyMarketData {
|
||||
|
||||
@@ -91,7 +91,7 @@ export interface MarketPositions_party {
|
||||
/**
|
||||
* Trading positions relating to a party
|
||||
*/
|
||||
positionsConnection: MarketPositions_party_positionsConnection;
|
||||
positionsConnection: MarketPositions_party_positionsConnection | null;
|
||||
}
|
||||
|
||||
export interface MarketPositions {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as Types from '@vegaprotocol/types/types';
|
||||
import { Schema as Types } from '@vegaprotocol/types';
|
||||
|
||||
import { gql } from '@apollo/client';
|
||||
import * as Apollo from '@apollo/client';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as Types from '@vegaprotocol/types/types';
|
||||
import { Schema as Types } from '@vegaprotocol/types';
|
||||
|
||||
import { gql } from '@apollo/client';
|
||||
import * as Apollo from '@apollo/client';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as Types from '@vegaprotocol/types/types';
|
||||
import { Schema as Types } from '@vegaprotocol/types';
|
||||
|
||||
import { gql } from '@apollo/client';
|
||||
import * as Apollo from '@apollo/client';
|
||||
@@ -8,7 +8,7 @@ export type MarketPositionsQueryVariables = Types.Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type MarketPositionsQuery = { __typename?: 'Query', party?: { __typename?: 'Party', id: string, accounts?: Array<{ __typename?: 'Account', type: Types.AccountType, balance: string, asset: { __typename?: 'Asset', decimals: number }, market?: { __typename?: 'Market', id: string } | null }> | null, positionsConnection: { __typename?: 'PositionConnection', edges?: Array<{ __typename?: 'PositionEdge', node: { __typename?: 'Position', openVolume: string, market: { __typename?: 'Market', id: string } } }> | null } } | null };
|
||||
export type MarketPositionsQuery = { __typename?: 'Query', party?: { __typename?: 'Party', id: string, accounts?: Array<{ __typename?: 'Account', type: Types.AccountType, balance: string, asset: { __typename?: 'Asset', decimals: number }, market?: { __typename?: 'Market', id: string } | null }> | null, positionsConnection?: { __typename?: 'PositionConnection', edges?: Array<{ __typename?: 'PositionEdge', node: { __typename?: 'Position', openVolume: string, market: { __typename?: 'Market', id: string } } }> | null } | null } | null };
|
||||
|
||||
|
||||
export const MarketPositionsDocument = gql`
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as Types from '@vegaprotocol/types/types';
|
||||
import { Schema as Types } from '@vegaprotocol/types';
|
||||
|
||||
import { gql } from '@apollo/client';
|
||||
import * as Apollo from '@apollo/client';
|
||||
@@ -8,7 +8,7 @@ export type PartyMarketDataQueryVariables = Types.Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type PartyMarketDataQuery = { __typename?: 'Query', party?: { __typename?: 'Party', id: string, accounts?: Array<{ __typename?: 'Account', type: Types.AccountType, balance: string, asset: { __typename?: 'Asset', id: string, decimals: number }, market?: { __typename?: 'Market', id: string } | null }> | null, marginsConnection: { __typename?: 'MarginConnection', edges?: Array<{ __typename?: 'MarginEdge', node: { __typename?: 'MarginLevels', initialLevel: string, maintenanceLevel: string, searchLevel: string, market: { __typename?: 'Market', id: string } } }> | null } } | null };
|
||||
export type PartyMarketDataQuery = { __typename?: 'Query', party?: { __typename?: 'Party', id: string, accounts?: Array<{ __typename?: 'Account', type: Types.AccountType, balance: string, asset: { __typename?: 'Asset', id: string, decimals: number }, market?: { __typename?: 'Market', id: string } | null }> | null, marginsConnection?: { __typename?: 'MarginConnection', edges?: Array<{ __typename?: 'MarginEdge', node: { __typename?: 'MarginLevels', initialLevel: string, maintenanceLevel: string, searchLevel: string, market: { __typename?: 'Market', id: string } } }> | null } | null } | null };
|
||||
|
||||
|
||||
export const PartyMarketDataDocument = gql`
|
||||
|
||||
@@ -96,5 +96,5 @@ export interface AssetsQuery {
|
||||
/**
|
||||
* The list of all assets in use in the Vega network or the specified asset if ID is provided
|
||||
*/
|
||||
assetsConnection: AssetsQuery_assetsConnection;
|
||||
assetsConnection: AssetsQuery_assetsConnection | null;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as Types from '@vegaprotocol/types/types';
|
||||
import { Schema as Types } from '@vegaprotocol/types';
|
||||
|
||||
import { gql } from '@apollo/client';
|
||||
import * as Apollo from '@apollo/client';
|
||||
@@ -6,7 +6,7 @@ const defaultOptions = {} as const;
|
||||
export type AssetsQueryQueryVariables = Types.Exact<{ [key: string]: never; }>;
|
||||
|
||||
|
||||
export type AssetsQueryQuery = { __typename?: 'Query', assetsConnection: { __typename?: 'AssetsConnection', edges?: Array<{ __typename?: 'AssetEdge', node: { __typename?: 'Asset', id: string, name: string, symbol: string, decimals: number, source: { __typename?: 'BuiltinAsset', maxFaucetAmountMint: string } | { __typename?: 'ERC20', contractAddress: string }, infrastructureFeeAccount: { __typename?: 'Account', type: Types.AccountType, balance: string, market?: { __typename?: 'Market', id: string } | null } } } | null> | null } };
|
||||
export type AssetsQueryQuery = { __typename?: 'Query', assetsConnection?: { __typename?: 'AssetsConnection', edges?: Array<{ __typename?: 'AssetEdge', node: { __typename?: 'Asset', id: string, name: string, symbol: string, decimals: number, source: { __typename?: 'BuiltinAsset', maxFaucetAmountMint: string } | { __typename?: 'ERC20', contractAddress: string }, infrastructureFeeAccount: { __typename?: 'Account', type: Types.AccountType, balance: string, market?: { __typename?: 'Market', id: string } | null } } } | null> | null } | null };
|
||||
|
||||
|
||||
export const AssetsQueryDocument = gql`
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import compact from 'lodash/compact';
|
||||
import { gql, useQuery } from '@apollo/client';
|
||||
import { getAssets, t } from '@vegaprotocol/react-helpers';
|
||||
import { t } from '@vegaprotocol/react-helpers';
|
||||
import React from 'react';
|
||||
import { RouteTitle } from '../../components/route-title';
|
||||
import { SubHeading } from '../../components/sub-heading';
|
||||
@@ -39,7 +40,7 @@ export const ASSETS_QUERY = gql`
|
||||
const Assets = () => {
|
||||
const { data } = useQuery<AssetsQuery>(ASSETS_QUERY);
|
||||
|
||||
const assets = getAssets(data);
|
||||
const assets = compact(data?.assetsConnection?.edges).map((e) => e.node);
|
||||
|
||||
return (
|
||||
<section>
|
||||
|
||||
@@ -302,5 +302,5 @@ export interface ProposalsQuery {
|
||||
/**
|
||||
* All governance proposals in the Vega network
|
||||
*/
|
||||
proposalsConnection: ProposalsQuery_proposalsConnection;
|
||||
proposalsConnection: ProposalsQuery_proposalsConnection | null;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as Types from '@vegaprotocol/types/types';
|
||||
import { Schema as Types } from '@vegaprotocol/types';
|
||||
|
||||
import { gql } from '@apollo/client';
|
||||
import * as Apollo from '@apollo/client';
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import compact from 'lodash/compact';
|
||||
import { gql, useQuery } from '@apollo/client';
|
||||
import { t } from '@vegaprotocol/react-helpers';
|
||||
import React from 'react';
|
||||
@@ -99,9 +100,10 @@ const Governance = () => {
|
||||
const { data } = useQuery<ProposalsQuery>(PROPOSALS_QUERY, {
|
||||
errorPolicy: 'ignore',
|
||||
});
|
||||
const proposals = getProposals(
|
||||
data
|
||||
) as ProposalsQuery_proposalsConnection_edges_node[];
|
||||
|
||||
const proposals = compact(data?.proposalsConnection?.edges).map(
|
||||
(e) => e.node
|
||||
);
|
||||
|
||||
if (!data) return null;
|
||||
return (
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
query MarketsQuery {
|
||||
markets {
|
||||
id
|
||||
name
|
||||
fees {
|
||||
factors {
|
||||
makerFee
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as Types from '@vegaprotocol/types/types';
|
||||
import { Schema as Types } from '@vegaprotocol/types';
|
||||
|
||||
import { gql } from '@apollo/client';
|
||||
import * as Apollo from '@apollo/client';
|
||||
@@ -6,14 +6,13 @@ const defaultOptions = {} as const;
|
||||
export type MarketsQueryQueryVariables = Types.Exact<{ [key: string]: never; }>;
|
||||
|
||||
|
||||
export type MarketsQueryQuery = { __typename?: 'Query', markets?: Array<{ __typename?: 'Market', id: string, name: string, decimalPlaces: number, tradingMode: Types.MarketTradingMode, state: Types.MarketState, fees: { __typename?: 'Fees', factors: { __typename?: 'FeeFactors', makerFee: string, infrastructureFee: string, liquidityFee: string } }, tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', name: string, id: string, code: string, metadata: { __typename?: 'InstrumentMetadata', tags?: Array<string> | null }, product: { __typename?: 'Future', settlementAsset: { __typename?: 'Asset', id: string, name: string, decimals: number, globalRewardPoolAccount?: { __typename?: 'Account', balance: string } | null } } }, riskModel: { __typename?: 'LogNormalRiskModel', tau: number, riskAversionParameter: number, params: { __typename?: 'LogNormalModelParams', r: number, sigma: number, mu: number } } | { __typename?: 'SimpleRiskModel', params: { __typename?: 'SimpleRiskModelParams', factorLong: number, factorShort: number } }, marginCalculator?: { __typename?: 'MarginCalculator', scalingFactors: { __typename?: 'ScalingFactors', searchLevel: number, initialMargin: number, collateralRelease: number } } | null }, openingAuction: { __typename?: 'AuctionDuration', durationSecs: number, volume: number }, priceMonitoringSettings: { __typename?: 'PriceMonitoringSettings', parameters?: { __typename?: 'PriceMonitoringParameters', triggers?: Array<{ __typename?: 'PriceMonitoringTrigger', horizonSecs: number, probability: number, auctionExtensionSecs: number }> | null } | null }, liquidityMonitoringParameters: { __typename?: 'LiquidityMonitoringParameters', triggeringRatio: number, targetStakeParameters: { __typename?: 'TargetStakeParameters', timeWindow: number, scalingFactor: number } }, proposal?: { __typename?: 'Proposal', id?: string | null } | null, accounts?: Array<{ __typename?: 'Account', balance: string, type: Types.AccountType, asset: { __typename?: 'Asset', id: string, name: string } }> | null, data?: { __typename?: 'MarketData', markPrice: string, bestBidPrice: string, bestBidVolume: string, bestOfferPrice: string, bestOfferVolume: string, bestStaticBidPrice: string, bestStaticBidVolume: string, bestStaticOfferPrice: string, bestStaticOfferVolume: string, midPrice: string, staticMidPrice: string, timestamp: string, openInterest: string, auctionEnd?: string | null, auctionStart?: string | null, indicativePrice: string, indicativeVolume: string, trigger: Types.AuctionTrigger, extensionTrigger: Types.AuctionTrigger, targetStake?: string | null, suppliedStake?: string | null, marketValueProxy: string, priceMonitoringBounds?: Array<{ __typename?: 'PriceMonitoringBounds', minValidPrice: string, maxValidPrice: string, referencePrice: string, trigger: { __typename?: 'PriceMonitoringTrigger', auctionExtensionSecs: number, probability: number } }> | null, liquidityProviderFeeShare?: Array<{ __typename?: 'LiquidityProviderFeeShare', equityLikeShare: string, averageEntryValuation: string, party: { __typename?: 'Party', id: string } }> | null } | null }> | null };
|
||||
export type MarketsQueryQuery = { __typename?: 'Query', markets?: Array<{ __typename?: 'Market', id: string, decimalPlaces: number, tradingMode: Types.MarketTradingMode, state: Types.MarketState, fees: { __typename?: 'Fees', factors: { __typename?: 'FeeFactors', makerFee: string, infrastructureFee: string, liquidityFee: string } }, tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', name: string, id: string, code: string, metadata: { __typename?: 'InstrumentMetadata', tags?: Array<string> | null }, product: { __typename?: 'Future', settlementAsset: { __typename?: 'Asset', id: string, name: string, decimals: number, globalRewardPoolAccount?: { __typename?: 'Account', balance: string } | null } } }, riskModel: { __typename?: 'LogNormalRiskModel', tau: number, riskAversionParameter: number, params: { __typename?: 'LogNormalModelParams', r: number, sigma: number, mu: number } } | { __typename?: 'SimpleRiskModel', params: { __typename?: 'SimpleRiskModelParams', factorLong: number, factorShort: number } }, marginCalculator?: { __typename?: 'MarginCalculator', scalingFactors: { __typename?: 'ScalingFactors', searchLevel: number, initialMargin: number, collateralRelease: number } } | null }, openingAuction: { __typename?: 'AuctionDuration', durationSecs: number, volume: number }, priceMonitoringSettings: { __typename?: 'PriceMonitoringSettings', parameters?: { __typename?: 'PriceMonitoringParameters', triggers?: Array<{ __typename?: 'PriceMonitoringTrigger', horizonSecs: number, probability: number, auctionExtensionSecs: number }> | null } | null }, liquidityMonitoringParameters: { __typename?: 'LiquidityMonitoringParameters', triggeringRatio: number, targetStakeParameters: { __typename?: 'TargetStakeParameters', timeWindow: number, scalingFactor: number } }, proposal?: { __typename?: 'Proposal', id?: string | null } | null, accounts?: Array<{ __typename?: 'Account', balance: string, type: Types.AccountType, asset: { __typename?: 'Asset', id: string, name: string } }> | null, data?: { __typename?: 'MarketData', markPrice: string, bestBidPrice: string, bestBidVolume: string, bestOfferPrice: string, bestOfferVolume: string, bestStaticBidPrice: string, bestStaticBidVolume: string, bestStaticOfferPrice: string, bestStaticOfferVolume: string, midPrice: string, staticMidPrice: string, timestamp: string, openInterest: string, auctionEnd?: string | null, auctionStart?: string | null, indicativePrice: string, indicativeVolume: string, trigger: Types.AuctionTrigger, extensionTrigger: Types.AuctionTrigger, targetStake?: string | null, suppliedStake?: string | null, marketValueProxy: string, priceMonitoringBounds?: Array<{ __typename?: 'PriceMonitoringBounds', minValidPrice: string, maxValidPrice: string, referencePrice: string, trigger: { __typename?: 'PriceMonitoringTrigger', auctionExtensionSecs: number, probability: number } }> | null, liquidityProviderFeeShare?: Array<{ __typename?: 'LiquidityProviderFeeShare', equityLikeShare: string, averageEntryValuation: string, party: { __typename?: 'Party', id: string } }> | null } | null }> | null };
|
||||
|
||||
|
||||
export const MarketsQueryDocument = gql`
|
||||
query MarketsQuery {
|
||||
markets {
|
||||
id
|
||||
name
|
||||
fees {
|
||||
factors {
|
||||
makerFee
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as Types from '@vegaprotocol/types/types';
|
||||
import { Schema as Types } from '@vegaprotocol/types';
|
||||
|
||||
import { gql } from '@apollo/client';
|
||||
import * as Apollo from '@apollo/client';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as Types from '@vegaprotocol/types/types';
|
||||
import { Schema as Types } from '@vegaprotocol/types';
|
||||
|
||||
import { gql } from '@apollo/client';
|
||||
import * as Apollo from '@apollo/client';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as Types from '@vegaprotocol/types/types';
|
||||
import { Schema as Types } from '@vegaprotocol/types';
|
||||
|
||||
import { gql } from '@apollo/client';
|
||||
import * as Apollo from '@apollo/client';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as Types from '@vegaprotocol/types/types';
|
||||
import { Schema as Types } from '@vegaprotocol/types';
|
||||
|
||||
import { gql } from '@apollo/client';
|
||||
import * as Apollo from '@apollo/client';
|
||||
|
||||
@@ -232,7 +232,7 @@
|
||||
"tranche_end": "2023-12-05T00:00:00.000Z",
|
||||
"total_added": "129999.45",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "107400.667535482563273045",
|
||||
"locked_amount": "106335.413484289455510975",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "129999.45",
|
||||
@@ -298,7 +298,7 @@
|
||||
"tranche_end": "2023-09-03T00:00:00.000Z",
|
||||
"total_added": "52600",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "51841.55657026890076",
|
||||
"locked_amount": "51194.43613013698976",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "2600",
|
||||
@@ -682,7 +682,7 @@
|
||||
"tranche_end": "2023-04-05T00:00:00.000Z",
|
||||
"total_added": "97499.58",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "48572.251650490581330735",
|
||||
"locked_amount": "47527.3366591736311428252",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "97499.58",
|
||||
@@ -715,7 +715,7 @@
|
||||
"tranche_end": "2023-04-05T00:00:00.000Z",
|
||||
"total_added": "135173.4239508",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "66389.88235680293513121919602",
|
||||
"locked_amount": "64961.663960720168133509560356",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "135173.4239508",
|
||||
@@ -748,7 +748,7 @@
|
||||
"tranche_end": "2023-04-05T00:00:00.000Z",
|
||||
"total_added": "32499.86",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "20433.507471441323948224",
|
||||
"locked_amount": "19993.929779310993153618",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "32499.86",
|
||||
@@ -781,7 +781,7 @@
|
||||
"tranche_end": "2023-04-05T00:00:00.000Z",
|
||||
"total_added": "10833.29",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "6650.908399891068142336",
|
||||
"locked_amount": "6507.830126663603897055",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "10833.29",
|
||||
@@ -889,7 +889,7 @@
|
||||
"tranche_end": "2022-11-01T00:00:00.000Z",
|
||||
"total_added": "30000",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "8761.47342995169",
|
||||
"locked_amount": "8029.330842391305",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "7500",
|
||||
@@ -1006,7 +1006,7 @@
|
||||
"tranche_end": "2023-06-02T00:00:00.000Z",
|
||||
"total_added": "1939928.38",
|
||||
"total_removed": "479504.6187210477481",
|
||||
"locked_amount": "1417673.282589751275449374",
|
||||
"locked_amount": "1393806.983975873425857912",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "1852091.69",
|
||||
@@ -1292,7 +1292,7 @@
|
||||
"tranche_end": "2023-02-01T00:00:00.000Z",
|
||||
"total_added": "42500",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "33662.0873590982275",
|
||||
"locked_amount": "32624.88536005434875",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "12500",
|
||||
@@ -2159,7 +2159,7 @@
|
||||
"tranche_end": "2022-09-30T00:00:00.000Z",
|
||||
"total_added": "60916.66666633337",
|
||||
"total_removed": "20696.25757434884556896",
|
||||
"locked_amount": "3395.2508705100692903521684208311",
|
||||
"locked_amount": "2693.8540998784246905956196508555",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "2833.333333",
|
||||
@@ -5892,10 +5892,25 @@
|
||||
"tranche_id": 11,
|
||||
"tranche_start": "2021-09-03T00:00:00.000Z",
|
||||
"tranche_end": "2022-09-03T00:00:00.000Z",
|
||||
"total_added": "35917.000000000000000003",
|
||||
"total_removed": "16791.59106856284",
|
||||
"total_added": "35958.000000000000000003",
|
||||
"total_removed": "17098.49537348884",
|
||||
"locked_amount": "0",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "20",
|
||||
"user": "0x9e02d57941833BB800cF0343b65A3D9dCa935b91",
|
||||
"tx": "0xff09c5e98e22a7b1d26e68f44124c6bfca8c49fb0a7c704ba309def7ac50f4be"
|
||||
},
|
||||
{
|
||||
"amount": "12",
|
||||
"user": "0xBdEF6D978a33cC8E7cf06E659dEd1487953355D2",
|
||||
"tx": "0xf4cf2b397b085b21cbb4bc9213de71bb6fe310704e39e61b9bcb7b2b0602f2f4"
|
||||
},
|
||||
{
|
||||
"amount": "2",
|
||||
"user": "0xEED071df0b6f8C4088b9CfD9f2ADE131C8591613",
|
||||
"tx": "0x0d569e9b901099d43f017945635ad8c2b566ce2290abb2583b018e83df34642b"
|
||||
},
|
||||
{
|
||||
"amount": "15",
|
||||
"user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f",
|
||||
@@ -7426,6 +7441,16 @@
|
||||
"user": "0xd7F6bad6Fc716b889F84a94fEE046188f08988ce",
|
||||
"tx": "0xbdbedb936d857d6897aeb89be44c8dbfdc87993d69b0e9a3cf6aa6fed0fb9e2b"
|
||||
},
|
||||
{
|
||||
"amount": "5",
|
||||
"user": "0x5c95482329D44397d88AC5e1AcE402cFA56837bD",
|
||||
"tx": "0x51ee75107b429e4b28d03503d87dfb8b5989118c14496e2ead9639eccc35a871"
|
||||
},
|
||||
{
|
||||
"amount": "2",
|
||||
"user": "0x5c95482329D44397d88AC5e1AcE402cFA56837bD",
|
||||
"tx": "0x6a2277eca905e60445ee11479edfe603a63c86d2fadb8aae244b314f40986e6a"
|
||||
},
|
||||
{
|
||||
"amount": "30",
|
||||
"user": "0x9646850641B15535e9e46646fbb98907eba83c6c",
|
||||
@@ -11833,6 +11858,21 @@
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "44.915525116",
|
||||
"user": "0x3f626D48C2a6104976A03009cFDB4A48F32fd282",
|
||||
"tx": "0x2d81729f37b9abefd460e8439566e1afd19b395ae58102a523dc192a4d57666a"
|
||||
},
|
||||
{
|
||||
"amount": "9.565809234",
|
||||
"user": "0x9a563fbC59C9058414f89172DA667B2b337215B1",
|
||||
"tx": "0xb25834209752fdf0186cc3d71002fb315cf8dc16f70aad0efe6185d5d6f400b7"
|
||||
},
|
||||
{
|
||||
"amount": "252.422970576",
|
||||
"user": "0x95175E9AEF72e1c5cEbE2766216FD6dAd2B9cDE6",
|
||||
"tx": "0x427c4a75b78bd0988ab9f5f0d65ce4af60f2b1f67a38f7f01ae6306f64ae7498"
|
||||
},
|
||||
{
|
||||
"amount": "13.82033422112",
|
||||
"user": "0xb1169C6daAc76bAcaf0D8f87641Fc38fbabe569F",
|
||||
@@ -12445,6 +12485,51 @@
|
||||
}
|
||||
],
|
||||
"users": [
|
||||
{
|
||||
"address": "0x9e02d57941833BB800cF0343b65A3D9dCa935b91",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "20",
|
||||
"user": "0x9e02d57941833BB800cF0343b65A3D9dCa935b91",
|
||||
"tranche_id": 11,
|
||||
"tx": "0xff09c5e98e22a7b1d26e68f44124c6bfca8c49fb0a7c704ba309def7ac50f4be"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"total_tokens": "20",
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "20"
|
||||
},
|
||||
{
|
||||
"address": "0xBdEF6D978a33cC8E7cf06E659dEd1487953355D2",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "12",
|
||||
"user": "0xBdEF6D978a33cC8E7cf06E659dEd1487953355D2",
|
||||
"tranche_id": 11,
|
||||
"tx": "0xf4cf2b397b085b21cbb4bc9213de71bb6fe310704e39e61b9bcb7b2b0602f2f4"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"total_tokens": "12",
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "12"
|
||||
},
|
||||
{
|
||||
"address": "0xEED071df0b6f8C4088b9CfD9f2ADE131C8591613",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "2",
|
||||
"user": "0xEED071df0b6f8C4088b9CfD9f2ADE131C8591613",
|
||||
"tranche_id": 11,
|
||||
"tx": "0x0d569e9b901099d43f017945635ad8c2b566ce2290abb2583b018e83df34642b"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"total_tokens": "2",
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "2"
|
||||
},
|
||||
{
|
||||
"address": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f",
|
||||
"deposits": [
|
||||
@@ -15909,6 +15994,27 @@
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "7"
|
||||
},
|
||||
{
|
||||
"address": "0x5c95482329D44397d88AC5e1AcE402cFA56837bD",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "5",
|
||||
"user": "0x5c95482329D44397d88AC5e1AcE402cFA56837bD",
|
||||
"tranche_id": 11,
|
||||
"tx": "0x51ee75107b429e4b28d03503d87dfb8b5989118c14496e2ead9639eccc35a871"
|
||||
},
|
||||
{
|
||||
"amount": "2",
|
||||
"user": "0x5c95482329D44397d88AC5e1AcE402cFA56837bD",
|
||||
"tranche_id": 11,
|
||||
"tx": "0x6a2277eca905e60445ee11479edfe603a63c86d2fadb8aae244b314f40986e6a"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"total_tokens": "7",
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "7"
|
||||
},
|
||||
{
|
||||
"address": "0x9646850641B15535e9e46646fbb98907eba83c6c",
|
||||
"deposits": [
|
||||
@@ -19183,6 +19289,12 @@
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "9.565809234",
|
||||
"user": "0x9a563fbC59C9058414f89172DA667B2b337215B1",
|
||||
"tranche_id": 11,
|
||||
"tx": "0xb25834209752fdf0186cc3d71002fb315cf8dc16f70aad0efe6185d5d6f400b7"
|
||||
},
|
||||
{
|
||||
"amount": "5.1102869736",
|
||||
"user": "0x9a563fbC59C9058414f89172DA667B2b337215B1",
|
||||
@@ -19197,8 +19309,8 @@
|
||||
}
|
||||
],
|
||||
"total_tokens": "20",
|
||||
"withdrawn_tokens": "10.434190766",
|
||||
"remaining_tokens": "9.565809234"
|
||||
"withdrawn_tokens": "20",
|
||||
"remaining_tokens": "0"
|
||||
},
|
||||
{
|
||||
"address": "0xF1bfCb79a510faC196c4Da74009Ea67e0926b25f",
|
||||
@@ -22090,6 +22202,12 @@
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "44.915525116",
|
||||
"user": "0x3f626D48C2a6104976A03009cFDB4A48F32fd282",
|
||||
"tranche_id": 11,
|
||||
"tx": "0x2d81729f37b9abefd460e8439566e1afd19b395ae58102a523dc192a4d57666a"
|
||||
},
|
||||
{
|
||||
"amount": "36.75952562",
|
||||
"user": "0x3f626D48C2a6104976A03009cFDB4A48F32fd282",
|
||||
@@ -22116,8 +22234,8 @@
|
||||
}
|
||||
],
|
||||
"total_tokens": "200",
|
||||
"withdrawn_tokens": "155.084474884",
|
||||
"remaining_tokens": "44.915525116"
|
||||
"withdrawn_tokens": "200",
|
||||
"remaining_tokens": "0"
|
||||
},
|
||||
{
|
||||
"address": "0x6f5EBA1eCc26B8f1203a1D32116f286fAd383a2d",
|
||||
@@ -22160,6 +22278,12 @@
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "252.422970576",
|
||||
"user": "0x95175E9AEF72e1c5cEbE2766216FD6dAd2B9cDE6",
|
||||
"tranche_id": 11,
|
||||
"tx": "0x427c4a75b78bd0988ab9f5f0d65ce4af60f2b1f67a38f7f01ae6306f64ae7498"
|
||||
},
|
||||
{
|
||||
"amount": "100.94326484",
|
||||
"user": "0x95175E9AEF72e1c5cEbE2766216FD6dAd2B9cDE6",
|
||||
@@ -22174,8 +22298,8 @@
|
||||
}
|
||||
],
|
||||
"total_tokens": "400",
|
||||
"withdrawn_tokens": "147.577029424",
|
||||
"remaining_tokens": "252.422970576"
|
||||
"withdrawn_tokens": "400",
|
||||
"remaining_tokens": "0"
|
||||
},
|
||||
{
|
||||
"address": "0xc5467213593778E528f0eB8117cc7AFBC5b7491b",
|
||||
@@ -22330,8 +22454,8 @@
|
||||
"tranche_start": "2022-03-05T00:00:00.000Z",
|
||||
"tranche_end": "2023-06-05T00:00:00.000Z",
|
||||
"total_added": "3732368.4671",
|
||||
"total_removed": "202112.7281627920977",
|
||||
"locked_amount": "2202971.57865650302803497768",
|
||||
"total_removed": "204390.7646836173642",
|
||||
"locked_amount": "2166297.38704960471950391605",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "1998.95815",
|
||||
@@ -22520,6 +22644,11 @@
|
||||
"user": "0xE6CacAE56Cca8dFdB7910b5A13578719D4E57DA0",
|
||||
"tx": "0x8d749e9b03d9656e6bb458d20f0ef55b1778785744415241b12f4875b1dc4749"
|
||||
},
|
||||
{
|
||||
"amount": "2278.0365208252665",
|
||||
"user": "0xE6CacAE56Cca8dFdB7910b5A13578719D4E57DA0",
|
||||
"tx": "0x6c2bbcd7abbfd0627b6dc419214ae9d52c3f6755ed5b2ab867ff0aa504ebe70a"
|
||||
},
|
||||
{
|
||||
"amount": "10764.1909763241854",
|
||||
"user": "0xf110D577F07ED846D2308050cc0D6CCC2bf9fb2C",
|
||||
@@ -22673,6 +22802,12 @@
|
||||
"tranche_id": 1,
|
||||
"tx": "0x8d749e9b03d9656e6bb458d20f0ef55b1778785744415241b12f4875b1dc4749"
|
||||
},
|
||||
{
|
||||
"amount": "2278.0365208252665",
|
||||
"user": "0xE6CacAE56Cca8dFdB7910b5A13578719D4E57DA0",
|
||||
"tranche_id": 1,
|
||||
"tx": "0x6c2bbcd7abbfd0627b6dc419214ae9d52c3f6755ed5b2ab867ff0aa504ebe70a"
|
||||
},
|
||||
{
|
||||
"amount": "9453.4744822303375",
|
||||
"user": "0xE6CacAE56Cca8dFdB7910b5A13578719D4E57DA0",
|
||||
@@ -22705,8 +22840,8 @@
|
||||
}
|
||||
],
|
||||
"total_tokens": "187637.95",
|
||||
"withdrawn_tokens": "74870.259332725684",
|
||||
"remaining_tokens": "112767.690667274316"
|
||||
"withdrawn_tokens": "77148.2958535509505",
|
||||
"remaining_tokens": "110489.6541464490495"
|
||||
},
|
||||
{
|
||||
"address": "0x1A71e3ED1996CAbB91bB043f880CE963D601707e",
|
||||
@@ -23187,8 +23322,8 @@
|
||||
"tranche_start": "2022-06-05T00:00:00.000Z",
|
||||
"tranche_end": "2023-12-05T00:00:00.000Z",
|
||||
"total_added": "15870102.715470999700000001",
|
||||
"total_removed": "189184.1028716497150444",
|
||||
"locked_amount": "13111283.3592623650978809746877750463449581",
|
||||
"total_removed": "203050.3452740934272444",
|
||||
"locked_amount": "12981239.0305324649112059509051105297445255",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "16249.93",
|
||||
@@ -23692,6 +23827,31 @@
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "504.652814859004625",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
"tx": "0xaa8f8f3648686e5e54cd714feec5dcbafd6c41cb2bc6fd62ef19466a74b11ab4"
|
||||
},
|
||||
{
|
||||
"amount": "425.14391486681125",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
"tx": "0xc2f65321097ea346926566cb1b8dc49ecc68fd085a86316d5a6bb96408c21332"
|
||||
},
|
||||
{
|
||||
"amount": "425.187841678854375",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
"tx": "0xa75ec8ccff824d09c109e9fdcd99aac9a0eb34562500cd450ed205d57ac8ae45"
|
||||
},
|
||||
{
|
||||
"amount": "262.71599547386325",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
"tx": "0xb4d350dd5fcd3f1617fb1eaac7f77fd973f0275bcc35003934ccc9a4e6140cdb"
|
||||
},
|
||||
{
|
||||
"amount": "226.87960521292",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
"tx": "0xe0040011ab92c3d951d3449fa6159e095b1893639c47fdb1a72aa87c741bdf56"
|
||||
},
|
||||
{
|
||||
"amount": "305.8599694076328",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
@@ -23787,6 +23947,16 @@
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
"tx": "0xf37aa848c357e251da436706cf8976171a8141e31fe3d2b6b90c519fb5e28c6e"
|
||||
},
|
||||
{
|
||||
"amount": "11896.4978839940612",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
"tx": "0xf59861d62aa335573fa03b596b554b43fd958e759ad23301f7cffffb52945c0d"
|
||||
},
|
||||
{
|
||||
"amount": "125.1643463581975",
|
||||
"user": "0xE6CacAE56Cca8dFdB7910b5A13578719D4E57DA0",
|
||||
"tx": "0x87eaac3c9200157a9a8af51edba2a22a199a057e57c7a22c8af0909d5a608f6d"
|
||||
},
|
||||
{
|
||||
"amount": "253.966945001875125",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
@@ -24235,6 +24405,36 @@
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "504.652814859004625",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
"tranche_id": 2,
|
||||
"tx": "0xaa8f8f3648686e5e54cd714feec5dcbafd6c41cb2bc6fd62ef19466a74b11ab4"
|
||||
},
|
||||
{
|
||||
"amount": "425.14391486681125",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
"tranche_id": 2,
|
||||
"tx": "0xc2f65321097ea346926566cb1b8dc49ecc68fd085a86316d5a6bb96408c21332"
|
||||
},
|
||||
{
|
||||
"amount": "425.187841678854375",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
"tranche_id": 2,
|
||||
"tx": "0xa75ec8ccff824d09c109e9fdcd99aac9a0eb34562500cd450ed205d57ac8ae45"
|
||||
},
|
||||
{
|
||||
"amount": "262.71599547386325",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
"tranche_id": 2,
|
||||
"tx": "0xb4d350dd5fcd3f1617fb1eaac7f77fd973f0275bcc35003934ccc9a4e6140cdb"
|
||||
},
|
||||
{
|
||||
"amount": "226.87960521292",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
"tranche_id": 2,
|
||||
"tx": "0xe0040011ab92c3d951d3449fa6159e095b1893639c47fdb1a72aa87c741bdf56"
|
||||
},
|
||||
{
|
||||
"amount": "305.8599694076328",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
@@ -24313,6 +24513,12 @@
|
||||
"tranche_id": 2,
|
||||
"tx": "0xf37aa848c357e251da436706cf8976171a8141e31fe3d2b6b90c519fb5e28c6e"
|
||||
},
|
||||
{
|
||||
"amount": "11896.4978839940612",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
"tranche_id": 2,
|
||||
"tx": "0xf59861d62aa335573fa03b596b554b43fd958e759ad23301f7cffffb52945c0d"
|
||||
},
|
||||
{
|
||||
"amount": "253.966945001875125",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
@@ -24687,8 +24893,8 @@
|
||||
}
|
||||
],
|
||||
"total_tokens": "259998.8875",
|
||||
"withdrawn_tokens": "33394.5217386716073",
|
||||
"remaining_tokens": "226604.3657613283927"
|
||||
"withdrawn_tokens": "47135.599794757122",
|
||||
"remaining_tokens": "212863.287705242878"
|
||||
},
|
||||
{
|
||||
"address": "0x89051CAb67Bc7F8CC44F7e270c6EDaf1EC57676c",
|
||||
@@ -25582,6 +25788,12 @@
|
||||
"tranche_id": 2,
|
||||
"tx": "0x512e9f05b8acfc34d562ab3fa128a36e4f212b3c53bbcfb8bd0270bc81800da0"
|
||||
},
|
||||
{
|
||||
"amount": "125.1643463581975",
|
||||
"user": "0xE6CacAE56Cca8dFdB7910b5A13578719D4E57DA0",
|
||||
"tranche_id": 2,
|
||||
"tx": "0x87eaac3c9200157a9a8af51edba2a22a199a057e57c7a22c8af0909d5a608f6d"
|
||||
},
|
||||
{
|
||||
"amount": "519.4281860825575",
|
||||
"user": "0xE6CacAE56Cca8dFdB7910b5A13578719D4E57DA0",
|
||||
@@ -25602,8 +25814,8 @@
|
||||
}
|
||||
],
|
||||
"total_tokens": "12362.05",
|
||||
"withdrawn_tokens": "2038.1690775099675",
|
||||
"remaining_tokens": "10323.8809224900325"
|
||||
"withdrawn_tokens": "2163.333423868165",
|
||||
"remaining_tokens": "10198.716576131835"
|
||||
},
|
||||
{
|
||||
"address": "0xb091D456d0dFCB94dcba6f355379056C5bb995fC",
|
||||
@@ -26227,8 +26439,8 @@
|
||||
"tranche_start": "2021-11-05T00:00:00.000Z",
|
||||
"tranche_end": "2023-05-05T00:00:00.000Z",
|
||||
"total_added": "14597706.0446472999",
|
||||
"total_removed": "2724259.594291574628633947",
|
||||
"locked_amount": "6382807.854646048048251659490242604",
|
||||
"total_removed": "2764683.361107610704396897",
|
||||
"locked_amount": "6262751.76070348203965915005868418",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "129284.449",
|
||||
@@ -26437,6 +26649,31 @@
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "700.967684681521309",
|
||||
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
|
||||
"tx": "0x90b39e5e04dcd5d2462bebe30b4439f85471a37ca0ee2f8f9b38662544591604"
|
||||
},
|
||||
{
|
||||
"amount": "588.2239383228802295",
|
||||
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
|
||||
"tx": "0x774bb17750d10bb5c5222b6546f8d2cf224accd19753cb62fecbc74eba2221f7"
|
||||
},
|
||||
{
|
||||
"amount": "589.51048019645918825",
|
||||
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
|
||||
"tx": "0x6516c57ea0a2048d0ca87cbc0bee8a7a4fd0ec7a58bc7fbc33bf56e8fe02593d"
|
||||
},
|
||||
{
|
||||
"amount": "365.035475050653914",
|
||||
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
|
||||
"tx": "0x3f54acc3bba8d596eea3553509f34983148ff873565c53d993b2248a89d8c057"
|
||||
},
|
||||
{
|
||||
"amount": "313.53571506354713525",
|
||||
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
|
||||
"tx": "0x5940c1d1266c4aee837eb2a10ea1a42f52182c5fb2d9f4ca10752ec099ddc239"
|
||||
},
|
||||
{
|
||||
"amount": "551.363354573845008",
|
||||
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
|
||||
@@ -26512,6 +26749,16 @@
|
||||
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
|
||||
"tx": "0x453738b2f8fbd7d2c25f32200d27bbd13c15bb92a38879cd6ea854805a5b38bd"
|
||||
},
|
||||
{
|
||||
"amount": "36806.4510907456099182",
|
||||
"user": "0x66827bCD635f2bB1779d68c46aEB16541bCA6ba8",
|
||||
"tx": "0x812fe72d2aa855b5035e0a691d365682ccab0e0160d77e6405f4481841ac70cb"
|
||||
},
|
||||
{
|
||||
"amount": "1060.04243197540406875",
|
||||
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
|
||||
"tx": "0x98bccb30eb3a5a92c35444e40f36bc89cdbf17b9508fa05845a8ca9478aacd9a"
|
||||
},
|
||||
{
|
||||
"amount": "469.2149598263806575",
|
||||
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
|
||||
@@ -28498,6 +28745,36 @@
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "700.967684681521309",
|
||||
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
|
||||
"tranche_id": 3,
|
||||
"tx": "0x90b39e5e04dcd5d2462bebe30b4439f85471a37ca0ee2f8f9b38662544591604"
|
||||
},
|
||||
{
|
||||
"amount": "588.2239383228802295",
|
||||
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
|
||||
"tranche_id": 3,
|
||||
"tx": "0x774bb17750d10bb5c5222b6546f8d2cf224accd19753cb62fecbc74eba2221f7"
|
||||
},
|
||||
{
|
||||
"amount": "589.51048019645918825",
|
||||
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
|
||||
"tranche_id": 3,
|
||||
"tx": "0x6516c57ea0a2048d0ca87cbc0bee8a7a4fd0ec7a58bc7fbc33bf56e8fe02593d"
|
||||
},
|
||||
{
|
||||
"amount": "365.035475050653914",
|
||||
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
|
||||
"tranche_id": 3,
|
||||
"tx": "0x3f54acc3bba8d596eea3553509f34983148ff873565c53d993b2248a89d8c057"
|
||||
},
|
||||
{
|
||||
"amount": "313.53571506354713525",
|
||||
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
|
||||
"tranche_id": 3,
|
||||
"tx": "0x5940c1d1266c4aee837eb2a10ea1a42f52182c5fb2d9f4ca10752ec099ddc239"
|
||||
},
|
||||
{
|
||||
"amount": "551.363354573845008",
|
||||
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
|
||||
@@ -28588,6 +28865,12 @@
|
||||
"tranche_id": 3,
|
||||
"tx": "0x453738b2f8fbd7d2c25f32200d27bbd13c15bb92a38879cd6ea854805a5b38bd"
|
||||
},
|
||||
{
|
||||
"amount": "1060.04243197540406875",
|
||||
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
|
||||
"tranche_id": 3,
|
||||
"tx": "0x98bccb30eb3a5a92c35444e40f36bc89cdbf17b9508fa05845a8ca9478aacd9a"
|
||||
},
|
||||
{
|
||||
"amount": "469.2149598263806575",
|
||||
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
|
||||
@@ -30228,8 +30511,8 @@
|
||||
}
|
||||
],
|
||||
"total_tokens": "359123.469575",
|
||||
"withdrawn_tokens": "201166.39790542606668175",
|
||||
"remaining_tokens": "157957.07166957393331825"
|
||||
"withdrawn_tokens": "204783.7136307165325265",
|
||||
"remaining_tokens": "154339.7559442834674735"
|
||||
},
|
||||
{
|
||||
"address": "0xBdd412797c1B78535Afc5F71503b91fAbD0160fB",
|
||||
@@ -30428,6 +30711,12 @@
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "36806.4510907456099182",
|
||||
"user": "0x66827bCD635f2bB1779d68c46aEB16541bCA6ba8",
|
||||
"tranche_id": 3,
|
||||
"tx": "0x812fe72d2aa855b5035e0a691d365682ccab0e0160d77e6405f4481841ac70cb"
|
||||
},
|
||||
{
|
||||
"amount": "137101.36006182319864782",
|
||||
"user": "0x66827bCD635f2bB1779d68c46aEB16541bCA6ba8",
|
||||
@@ -30646,8 +30935,8 @@
|
||||
}
|
||||
],
|
||||
"total_tokens": "1266324.603486",
|
||||
"withdrawn_tokens": "675973.69081026210943794",
|
||||
"remaining_tokens": "590350.91267573789056206"
|
||||
"withdrawn_tokens": "712780.14190100771935614",
|
||||
"remaining_tokens": "553544.46158499228064386"
|
||||
},
|
||||
{
|
||||
"address": "0xC5d9221EB9c28A69859264c0A2Fe0d3272228296",
|
||||
@@ -31310,8 +31599,8 @@
|
||||
"tranche_start": "2021-10-05T00:00:00.000Z",
|
||||
"tranche_end": "2023-04-05T00:00:00.000Z",
|
||||
"total_added": "5778205.3912159303",
|
||||
"total_removed": "1738566.199331512609572207",
|
||||
"locked_amount": "2204982.46046886546387455623715599",
|
||||
"total_removed": "1773434.744647395163801354",
|
||||
"locked_amount": "2157547.69392106277665067936509808",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "552496.6455",
|
||||
@@ -31455,6 +31744,26 @@
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "6706.456487239706063047",
|
||||
"user": "0xC24da173A250e9Ca5c54870639EbE5f88be5102d",
|
||||
"tx": "0x16d7023014cfb5e7562d6f583c5354dd9f2988ca3a5766539acb3fa0652828bd"
|
||||
},
|
||||
{
|
||||
"amount": "5857.0305210567902251",
|
||||
"user": "0x6ae83EAB68b7112BaD5AfD72d6B24546AbFF137D",
|
||||
"tx": "0xb2b7e68756635897d3d0cc97221a6c9abedce9da7a431baeee6620f15125a7ae"
|
||||
},
|
||||
{
|
||||
"amount": "18665.776068468384566",
|
||||
"user": "0x5565d64f29Ea17355106DF3bA5903Eb793B3e139",
|
||||
"tx": "0x0954f744fc48cdb36187ba72505a5ca1c053d05da816b41230b35d86069fdcb0"
|
||||
},
|
||||
{
|
||||
"amount": "3639.282239117673375",
|
||||
"user": "0xafa64cCa337eFEE0AD827F6C2684e69275226e90",
|
||||
"tx": "0x2a7ebd8748742d3bf0ce4f1ee46c575aa744f0d83915583bbd262f504044d462"
|
||||
},
|
||||
{
|
||||
"amount": "8456.402651116281081",
|
||||
"user": "0xafa64cCa337eFEE0AD827F6C2684e69275226e90",
|
||||
@@ -32200,6 +32509,12 @@
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "5857.0305210567902251",
|
||||
"user": "0x6ae83EAB68b7112BaD5AfD72d6B24546AbFF137D",
|
||||
"tranche_id": 4,
|
||||
"tx": "0xb2b7e68756635897d3d0cc97221a6c9abedce9da7a431baeee6620f15125a7ae"
|
||||
},
|
||||
{
|
||||
"amount": "3732.88753415684792995",
|
||||
"user": "0x6ae83EAB68b7112BaD5AfD72d6B24546AbFF137D",
|
||||
@@ -32244,8 +32559,8 @@
|
||||
}
|
||||
],
|
||||
"total_tokens": "92082.572555",
|
||||
"withdrawn_tokens": "51310.4888289328312056",
|
||||
"remaining_tokens": "40772.0837260671687944"
|
||||
"withdrawn_tokens": "57167.5193499896214307",
|
||||
"remaining_tokens": "34915.0532050103785693"
|
||||
},
|
||||
{
|
||||
"address": "0x1dC9B91DE003fd503F25cB5d114cf0fc68F7aFe6",
|
||||
@@ -32273,6 +32588,12 @@
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "6706.456487239706063047",
|
||||
"user": "0xC24da173A250e9Ca5c54870639EbE5f88be5102d",
|
||||
"tranche_id": 4,
|
||||
"tx": "0x16d7023014cfb5e7562d6f583c5354dd9f2988ca3a5766539acb3fa0652828bd"
|
||||
},
|
||||
{
|
||||
"amount": "22577.531268180478865098",
|
||||
"user": "0xC24da173A250e9Ca5c54870639EbE5f88be5102d",
|
||||
@@ -32335,8 +32656,8 @@
|
||||
}
|
||||
],
|
||||
"total_tokens": "460415.072915097",
|
||||
"withdrawn_tokens": "279128.566868329684778032",
|
||||
"remaining_tokens": "181286.506046767315221968"
|
||||
"withdrawn_tokens": "285835.023355569390841079",
|
||||
"remaining_tokens": "174580.049559527609158921"
|
||||
},
|
||||
{
|
||||
"address": "0xd66e4853c0880df150e7329974715BFC8d2da47D",
|
||||
@@ -32438,6 +32759,12 @@
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "18665.776068468384566",
|
||||
"user": "0x5565d64f29Ea17355106DF3bA5903Eb793B3e139",
|
||||
"tranche_id": 4,
|
||||
"tx": "0x0954f744fc48cdb36187ba72505a5ca1c053d05da816b41230b35d86069fdcb0"
|
||||
},
|
||||
{
|
||||
"amount": "8992.6333376158479344",
|
||||
"user": "0x5565d64f29Ea17355106DF3bA5903Eb793B3e139",
|
||||
@@ -32446,8 +32773,8 @@
|
||||
}
|
||||
],
|
||||
"total_tokens": "44199.81164",
|
||||
"withdrawn_tokens": "8992.6333376158479344",
|
||||
"remaining_tokens": "35207.1783023841520656"
|
||||
"withdrawn_tokens": "27658.4094060842325004",
|
||||
"remaining_tokens": "16541.4022339157674996"
|
||||
},
|
||||
{
|
||||
"address": "0xF5Fb27b912D987B5b6e02A1B1BE0C1F0740E2c6f",
|
||||
@@ -32496,6 +32823,12 @@
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "3639.282239117673375",
|
||||
"user": "0xafa64cCa337eFEE0AD827F6C2684e69275226e90",
|
||||
"tranche_id": 4,
|
||||
"tx": "0x2a7ebd8748742d3bf0ce4f1ee46c575aa744f0d83915583bbd262f504044d462"
|
||||
},
|
||||
{
|
||||
"amount": "8456.402651116281081",
|
||||
"user": "0xafa64cCa337eFEE0AD827F6C2684e69275226e90",
|
||||
@@ -32630,8 +32963,8 @@
|
||||
}
|
||||
],
|
||||
"total_tokens": "331498.5873",
|
||||
"withdrawn_tokens": "203997.978690347971047",
|
||||
"remaining_tokens": "127500.608609652028953"
|
||||
"withdrawn_tokens": "207637.260929465644422",
|
||||
"remaining_tokens": "123861.326370534355578"
|
||||
},
|
||||
{
|
||||
"address": "0x16da609341ed67750A8BCC5AAa2005471006Cd77",
|
||||
@@ -32719,8 +33052,8 @@
|
||||
"tranche_start": "2022-06-05T00:00:00.000Z",
|
||||
"tranche_end": "2023-06-05T00:00:00.000Z",
|
||||
"total_added": "472355.6199999996",
|
||||
"total_removed": "3136.87798919126",
|
||||
"locked_amount": "349073.42438222892223404431456112",
|
||||
"total_removed": "3216.01601557326",
|
||||
"locked_amount": "343262.2040617976027593156164384",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "3000",
|
||||
@@ -39339,6 +39672,16 @@
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "52.731139014",
|
||||
"user": "0x28FC83947F02f59Cb36b40f97f2D32BBC5D00585",
|
||||
"tx": "0xea18c5a1b637f62c07a366ee4622d008e932fdc1cbd0dc2283dc6e623f063381"
|
||||
},
|
||||
{
|
||||
"amount": "26.406887368",
|
||||
"user": "0x4eD2b3c68BB4fda084ce1591a210F4aC8b71234A",
|
||||
"tx": "0x4b4681ea3dedccd5e579f8f32e4d1a35456a1c354f6767d2528edc558034b29a"
|
||||
},
|
||||
{
|
||||
"amount": "44.069926432",
|
||||
"user": "0xfb393Ad714e8014947d9887912DfFB921E8aE74a",
|
||||
@@ -51525,6 +51868,12 @@
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "26.406887368",
|
||||
"user": "0x4eD2b3c68BB4fda084ce1591a210F4aC8b71234A",
|
||||
"tranche_id": 5,
|
||||
"tx": "0x4b4681ea3dedccd5e579f8f32e4d1a35456a1c354f6767d2528edc558034b29a"
|
||||
},
|
||||
{
|
||||
"amount": "19.736364788",
|
||||
"user": "0x4eD2b3c68BB4fda084ce1591a210F4aC8b71234A",
|
||||
@@ -51545,8 +51894,8 @@
|
||||
}
|
||||
],
|
||||
"total_tokens": "400",
|
||||
"withdrawn_tokens": "79.770915776",
|
||||
"remaining_tokens": "320.229084224"
|
||||
"withdrawn_tokens": "106.177803144",
|
||||
"remaining_tokens": "293.822196856"
|
||||
},
|
||||
{
|
||||
"address": "0x5c90765F50629570738fEe7b7FA82ae118f81Ed1",
|
||||
@@ -58129,10 +58478,17 @@
|
||||
"tx": "0xb59405747c8088945a412703637a7b422f3639439ec2ee15e180c0a2a0d71ee4"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "52.731139014",
|
||||
"user": "0x28FC83947F02f59Cb36b40f97f2D32BBC5D00585",
|
||||
"tranche_id": 5,
|
||||
"tx": "0xea18c5a1b637f62c07a366ee4622d008e932fdc1cbd0dc2283dc6e623f063381"
|
||||
}
|
||||
],
|
||||
"total_tokens": "200",
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "200"
|
||||
"withdrawn_tokens": "52.731139014",
|
||||
"remaining_tokens": "147.268860986"
|
||||
},
|
||||
{
|
||||
"address": "0xBef628af8547cE5264835F32487055a7e3dF393D",
|
||||
@@ -59203,7 +59559,7 @@
|
||||
"tranche_start": "2021-12-05T00:00:00.000Z",
|
||||
"tranche_end": "2022-06-05T00:00:00.000Z",
|
||||
"total_added": "171288.42",
|
||||
"total_removed": "52853.8180369557989",
|
||||
"total_removed": "53419.8425587307989",
|
||||
"locked_amount": "0",
|
||||
"deposits": [
|
||||
{
|
||||
@@ -63428,6 +63784,16 @@
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "250",
|
||||
"user": "0x1f2c5E955082614F062b5BaC23DB5C2d345A4701",
|
||||
"tx": "0x25132ae8c2d9315e5810b2fb8fba4de7538d946a71f215e66ba0c6e8fbdbbeab"
|
||||
},
|
||||
{
|
||||
"amount": "250",
|
||||
"user": "0x15908B3180e311a9499CeA6a72961FdAB10B0fAC",
|
||||
"tx": "0x9e63b6aa30c9ba99f6baed25ebda205734c77f687426385a6ab51ddac5861bb2"
|
||||
},
|
||||
{
|
||||
"amount": "50",
|
||||
"user": "0xd69d5334Ec0f1B762e869a42f6C2634238B3BE6A",
|
||||
@@ -63493,6 +63859,11 @@
|
||||
"user": "0x389f68402c3355Af05566faC84914f8E7caabc52",
|
||||
"tx": "0xc50cc4a5edea8eb1aa5ba128913f946b2d549e22fda7923f7d99d2f5250abb5d"
|
||||
},
|
||||
{
|
||||
"amount": "66.024521775",
|
||||
"user": "0x94FB32e3D5b9DDc3DDcaf6F174CAEeF2BCc6a83d",
|
||||
"tx": "0x743ce7162e9552d56cdafbde274472b2165b38b89e356e17df8c68ececa980ba"
|
||||
},
|
||||
{
|
||||
"amount": "250",
|
||||
"user": "0x9A453696D38e0e42b11AC30Be8C3A100eDDA5f53",
|
||||
@@ -69275,6 +69646,12 @@
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "66.024521775",
|
||||
"user": "0x94FB32e3D5b9DDc3DDcaf6F174CAEeF2BCc6a83d",
|
||||
"tranche_id": 6,
|
||||
"tx": "0x743ce7162e9552d56cdafbde274472b2165b38b89e356e17df8c68ececa980ba"
|
||||
},
|
||||
{
|
||||
"amount": "33.975478225",
|
||||
"user": "0x94FB32e3D5b9DDc3DDcaf6F174CAEeF2BCc6a83d",
|
||||
@@ -69283,8 +69660,8 @@
|
||||
}
|
||||
],
|
||||
"total_tokens": "100",
|
||||
"withdrawn_tokens": "33.975478225",
|
||||
"remaining_tokens": "66.024521775"
|
||||
"withdrawn_tokens": "100",
|
||||
"remaining_tokens": "0"
|
||||
},
|
||||
{
|
||||
"address": "0x66014aEc97135793135FDEE169Ed826Ef421d81f",
|
||||
@@ -73478,10 +73855,17 @@
|
||||
"tx": "0x06dfa508f6d82e3ebfc0ff5f3deeab5e36f69c3258e2264b29d3bad4d075c808"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "250",
|
||||
"user": "0x1f2c5E955082614F062b5BaC23DB5C2d345A4701",
|
||||
"tranche_id": 6,
|
||||
"tx": "0x25132ae8c2d9315e5810b2fb8fba4de7538d946a71f215e66ba0c6e8fbdbbeab"
|
||||
}
|
||||
],
|
||||
"total_tokens": "250",
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "250"
|
||||
"withdrawn_tokens": "250",
|
||||
"remaining_tokens": "0"
|
||||
},
|
||||
{
|
||||
"address": "0x40447e8eDee2F8D0088844E35Ff7aD2Bb5fCabfb",
|
||||
@@ -79677,10 +80061,17 @@
|
||||
"tx": "0xe32a466fc780a0fb3fd84a804f622931ebfaf3f428bff0dc6d141270410e75f8"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "250",
|
||||
"user": "0x15908B3180e311a9499CeA6a72961FdAB10B0fAC",
|
||||
"tranche_id": 6,
|
||||
"tx": "0x9e63b6aa30c9ba99f6baed25ebda205734c77f687426385a6ab51ddac5861bb2"
|
||||
}
|
||||
],
|
||||
"total_tokens": "250",
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "250"
|
||||
"withdrawn_tokens": "250",
|
||||
"remaining_tokens": "0"
|
||||
},
|
||||
{
|
||||
"address": "0x48e589D7B3088E571c8D17C03736f482747AD1Ff",
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
"tranche_end": "2022-10-12T00:53:20.000Z",
|
||||
"total_added": "1010.000000000000000001",
|
||||
"total_removed": "668.4622323651",
|
||||
"locked_amount": "93.45709094368336690009253177321156769",
|
||||
"locked_amount": "81.0314903602232870000802291983764587",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "1000",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# App configuration variables
|
||||
NX_VEGA_ENV=TESTNET
|
||||
NX_VEGA_ENV=CUSTOM
|
||||
NX_ETHEREUM_PROVIDER_URL=http://localhost:8545
|
||||
NX_ETHERSCAN_URL=https://ropsten.etherscan.io
|
||||
NX_FAIRGROUND=false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as Types from '@vegaprotocol/types/types';
|
||||
import { Schema as Types } from '@vegaprotocol/types';
|
||||
|
||||
import { gql } from '@apollo/client';
|
||||
import * as Apollo from '@apollo/client';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as Types from '@vegaprotocol/types/types';
|
||||
import { Schema as Types } from '@vegaprotocol/types';
|
||||
|
||||
import { gql } from '@apollo/client';
|
||||
import * as Apollo from '@apollo/client';
|
||||
|
||||
@@ -48,7 +48,7 @@ export interface ProposalFields_terms_change_NewMarket_instrument_futureProduct_
|
||||
export interface ProposalFields_terms_change_NewMarket_instrument_futureProduct {
|
||||
__typename: "FutureProduct";
|
||||
/**
|
||||
* Product asset ID
|
||||
* Product asset
|
||||
*/
|
||||
settlementAsset: ProposalFields_terms_change_NewMarket_instrument_futureProduct_settlementAsset;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as Types from '@vegaprotocol/types/types';
|
||||
import { Schema as Types } from '@vegaprotocol/types';
|
||||
|
||||
import { gql } from '@apollo/client';
|
||||
import * as Apollo from '@apollo/client';
|
||||
@@ -10,7 +10,7 @@ export type ProposalQueryVariables = Types.Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type ProposalQuery = { __typename?: 'Query', proposal: { __typename?: 'Proposal', id?: string | null, reference: string, state: Types.ProposalState, datetime: string, rejectionReason?: Types.ProposalRejectionReason | null, errorDetails?: string | null, party: { __typename?: 'Party', id: string }, terms: { __typename?: 'ProposalTerms', closingDatetime: string, enactmentDatetime?: string | null, change: { __typename: 'NewAsset', name: string, symbol: string, source: { __typename: 'BuiltinAsset', maxFaucetAmountMint: string } | { __typename: 'ERC20', contractAddress: string } } | { __typename?: 'NewFreeform' } | { __typename?: 'NewMarket', decimalPlaces: number, metadata?: Array<string> | null, instrument: { __typename?: 'InstrumentConfiguration', name: string, code: string, futureProduct?: { __typename?: 'FutureProduct', settlementAsset: { __typename?: 'Asset', symbol: string } } | null } } | { __typename?: 'UpdateAsset' } | { __typename?: 'UpdateMarket', marketId: string } | { __typename?: 'UpdateNetworkParameter', networkParameter: { __typename?: 'NetworkParameter', key: string, value: string } } }, votes: { __typename?: 'ProposalVotes', yes: { __typename?: 'ProposalVoteSide', totalTokens: string, totalNumber: string, votes?: Array<{ __typename?: 'Vote', value: Types.VoteValue, datetime: string, party: { __typename?: 'Party', id: string, stake: { __typename?: 'PartyStake', currentStakeAvailable: string } } }> | null }, no: { __typename?: 'ProposalVoteSide', totalTokens: string, totalNumber: string, votes?: Array<{ __typename?: 'Vote', value: Types.VoteValue, datetime: string, party: { __typename?: 'Party', id: string, stake: { __typename?: 'PartyStake', currentStakeAvailable: string } } }> | null } } } };
|
||||
export type ProposalQuery = { __typename?: 'Query', proposal?: { __typename?: 'Proposal', id?: string | null, reference: string, state: Types.ProposalState, datetime: string, rejectionReason?: Types.ProposalRejectionReason | null, errorDetails?: string | null, party: { __typename?: 'Party', id: string }, terms: { __typename?: 'ProposalTerms', closingDatetime: string, enactmentDatetime?: string | null, change: { __typename: 'NewAsset', name: string, symbol: string, source: { __typename: 'BuiltinAsset', maxFaucetAmountMint: string } | { __typename: 'ERC20', contractAddress: string } } | { __typename?: 'NewFreeform' } | { __typename?: 'NewMarket', decimalPlaces: number, metadata?: Array<string> | null, instrument: { __typename?: 'InstrumentConfiguration', name: string, code: string, futureProduct?: { __typename?: 'FutureProduct', settlementAsset: { __typename?: 'Asset', symbol: string } } | null } } | { __typename?: 'UpdateAsset' } | { __typename?: 'UpdateMarket', marketId: string } | { __typename?: 'UpdateNetworkParameter', networkParameter: { __typename?: 'NetworkParameter', key: string, value: string } } }, votes: { __typename?: 'ProposalVotes', yes: { __typename?: 'ProposalVoteSide', totalTokens: string, totalNumber: string, votes?: Array<{ __typename?: 'Vote', value: Types.VoteValue, datetime: string, party: { __typename?: 'Party', id: string, stake: { __typename?: 'PartyStake', currentStakeAvailable: string } } }> | null }, no: { __typename?: 'ProposalVoteSide', totalTokens: string, totalNumber: string, votes?: Array<{ __typename?: 'Vote', value: Types.VoteValue, datetime: string, party: { __typename?: 'Party', id: string, stake: { __typename?: 'PartyStake', currentStakeAvailable: string } } }> | null } } } | null };
|
||||
|
||||
export type ProposalsQueryVariables = Types.Exact<{ [key: string]: never; }>;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import { ProposalVotesTable } from '../proposal-votes-table';
|
||||
import { VoteDetails } from '../vote-details';
|
||||
|
||||
interface ProposalProps {
|
||||
proposal: Proposal_proposal;
|
||||
proposal: Proposal_proposal | null;
|
||||
}
|
||||
|
||||
export const Proposal = ({ proposal }: ProposalProps) => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as Types from '@vegaprotocol/types/types';
|
||||
import { Schema as Types } from '@vegaprotocol/types';
|
||||
|
||||
import { gql } from '@apollo/client';
|
||||
import * as Apollo from '@apollo/client';
|
||||
|
||||
@@ -48,7 +48,7 @@ export interface Proposal_proposal_terms_change_NewMarket_instrument_futureProdu
|
||||
export interface Proposal_proposal_terms_change_NewMarket_instrument_futureProduct {
|
||||
__typename: "FutureProduct";
|
||||
/**
|
||||
* Product asset ID
|
||||
* Product asset
|
||||
*/
|
||||
settlementAsset: Proposal_proposal_terms_change_NewMarket_instrument_futureProduct_settlementAsset;
|
||||
}
|
||||
@@ -318,7 +318,7 @@ export interface Proposal {
|
||||
/**
|
||||
* A governance proposal located by either its ID or reference. If both are set, ID is used.
|
||||
*/
|
||||
proposal: Proposal_proposal;
|
||||
proposal: Proposal_proposal | null;
|
||||
}
|
||||
|
||||
export interface ProposalVariables {
|
||||
|
||||
@@ -48,7 +48,7 @@ export interface Proposals_proposalsConnection_edges_node_terms_change_NewMarket
|
||||
export interface Proposals_proposalsConnection_edges_node_terms_change_NewMarket_instrument_futureProduct {
|
||||
__typename: "FutureProduct";
|
||||
/**
|
||||
* Product asset ID
|
||||
* Product asset
|
||||
*/
|
||||
settlementAsset: Proposals_proposalsConnection_edges_node_terms_change_NewMarket_instrument_futureProduct_settlementAsset;
|
||||
}
|
||||
@@ -334,5 +334,5 @@ export interface Proposals {
|
||||
/**
|
||||
* All governance proposals in the Vega network
|
||||
*/
|
||||
proposalsConnection: Proposals_proposalsConnection;
|
||||
proposalsConnection: Proposals_proposalsConnection | null;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
import compact from 'lodash/compact';
|
||||
import orderBy from 'lodash/orderBy';
|
||||
import { gql, useQuery } from '@apollo/client';
|
||||
import { getNotRejectedProposals } from '@vegaprotocol/governance';
|
||||
import { Callout, Intent, Splash } from '@vegaprotocol/ui-toolkit';
|
||||
import { useMemo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { SplashLoader } from '../../../components/splash-loader';
|
||||
import { ProposalsList } from '../components/proposals-list';
|
||||
import { PROPOSAL_FRAGMENT } from '../proposal-fragment';
|
||||
import type { Proposals } from './__generated__/Proposals';
|
||||
import { ProposalState } from '@vegaprotocol/types';
|
||||
|
||||
export const PROPOSALS_QUERY = gql`
|
||||
${PROPOSAL_FRAGMENT}
|
||||
@@ -30,7 +31,18 @@ export const ProposalsContainer = () => {
|
||||
errorPolicy: 'ignore',
|
||||
});
|
||||
|
||||
const proposals = useMemo(() => getNotRejectedProposals(data), [data]);
|
||||
const proposals = compact(data?.proposalsConnection?.edges)
|
||||
.map((e) => e.node)
|
||||
.filter((p) => p.state !== ProposalState.STATE_REJECTED);
|
||||
const orderedProposals = orderBy(
|
||||
proposals,
|
||||
[
|
||||
(p) => new Date(p.terms.enactmentDatetime || 0).getTime(), // has to be defaulted to 0 because new Date(null).getTime() -> NaN which is first when ordered.
|
||||
(p) => new Date(p.terms.closingDatetime).getTime(),
|
||||
(p) => p.id,
|
||||
],
|
||||
['desc', 'desc', 'desc']
|
||||
);
|
||||
|
||||
if (error) {
|
||||
return (
|
||||
@@ -48,5 +60,5 @@ export const ProposalsContainer = () => {
|
||||
);
|
||||
}
|
||||
|
||||
return <ProposalsList proposals={proposals} />;
|
||||
return <ProposalsList proposals={orderedProposals} />;
|
||||
};
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import compact from 'lodash/compact';
|
||||
import orderBy from 'lodash/orderBy';
|
||||
import { useQuery } from '@apollo/client';
|
||||
import { Callout, Intent, Splash } from '@vegaprotocol/ui-toolkit';
|
||||
import { useMemo } from 'react';
|
||||
@@ -5,15 +7,26 @@ import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { SplashLoader } from '../../../components/splash-loader';
|
||||
import { RejectedProposalsList } from '../components/proposals-list';
|
||||
import { getRejectedProposals } from '@vegaprotocol/governance';
|
||||
import { PROPOSALS_QUERY } from '../proposals';
|
||||
import type { Proposals } from '../proposals/__generated__/Proposals';
|
||||
import { ProposalState } from '@vegaprotocol/types';
|
||||
|
||||
export const RejectedProposalsContainer = () => {
|
||||
const { t } = useTranslation();
|
||||
const { data, loading, error } = useQuery<Proposals>(PROPOSALS_QUERY);
|
||||
|
||||
const proposals = useMemo(() => getRejectedProposals(data), [data]);
|
||||
const proposals = compact(data?.proposalsConnection?.edges)
|
||||
.map((e) => e.node)
|
||||
.filter((p) => p.state === ProposalState.STATE_REJECTED);
|
||||
const orderedProposals = orderBy(
|
||||
proposals,
|
||||
[
|
||||
(p) => new Date(p.terms.enactmentDatetime || 0).getTime(), // has to be defaulted to 0 because new Date(null).getTime() -> NaN which is first when ordered.
|
||||
(p) => new Date(p.terms.closingDatetime).getTime(),
|
||||
(p) => p.id,
|
||||
],
|
||||
['desc', 'desc', 'desc']
|
||||
);
|
||||
|
||||
if (error) {
|
||||
return (
|
||||
@@ -31,5 +44,5 @@ export const RejectedProposalsContainer = () => {
|
||||
);
|
||||
}
|
||||
|
||||
return <RejectedProposalsList proposals={proposals} />;
|
||||
return <RejectedProposalsList proposals={orderedProposals} />;
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as Types from '@vegaprotocol/types/types';
|
||||
import { Schema as Types } from '@vegaprotocol/types';
|
||||
|
||||
import { gql } from '@apollo/client';
|
||||
import * as Apollo from '@apollo/client';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as Types from '@vegaprotocol/types/types';
|
||||
import { Schema as Types } from '@vegaprotocol/types';
|
||||
|
||||
import { gql } from '@apollo/client';
|
||||
import * as Apollo from '@apollo/client';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as Types from '@vegaprotocol/types/types';
|
||||
import { Schema as Types } from '@vegaprotocol/types';
|
||||
|
||||
import { gql } from '@apollo/client';
|
||||
import * as Apollo from '@apollo/client';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as Types from '@vegaprotocol/types/types';
|
||||
import { Schema as Types } from '@vegaprotocol/types';
|
||||
|
||||
import { gql } from '@apollo/client';
|
||||
import * as Apollo from '@apollo/client';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as Types from '@vegaprotocol/types/types';
|
||||
import { Schema as Types } from '@vegaprotocol/types';
|
||||
|
||||
import { gql } from '@apollo/client';
|
||||
import * as Apollo from '@apollo/client';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as Types from '@vegaprotocol/types/types';
|
||||
import { Schema as Types } from '@vegaprotocol/types';
|
||||
|
||||
import { gql } from '@apollo/client';
|
||||
import * as Apollo from '@apollo/client';
|
||||
|
||||
@@ -3,6 +3,10 @@ import { generateDepositPage } from '../support/mocks/generate-deposit-page';
|
||||
import { generateNetworkParameters } from '../support/mocks/generate-network-parameters';
|
||||
|
||||
const connectEthWalletBtn = 'connect-eth-wallet-btn';
|
||||
const assetSelectField = 'select[name="asset"]';
|
||||
const toAddressField = 'input[name="to"]';
|
||||
const amountField = 'input[name="amount"]';
|
||||
const formFieldError = 'input-error-text';
|
||||
|
||||
describe('deposit form validation', () => {
|
||||
beforeEach(() => {
|
||||
@@ -21,11 +25,6 @@ describe('deposit form validation', () => {
|
||||
});
|
||||
|
||||
it('handles empty fields', () => {
|
||||
const assetSelectField = 'select[name="asset"]';
|
||||
const toAddressField = 'input[name="to"]';
|
||||
const amountField = 'input[name="amount"]';
|
||||
const formFieldError = 'input-error-text';
|
||||
|
||||
// Submit form to trigger any empty validaion messages
|
||||
cy.getByTestId('deposit-submit').click();
|
||||
|
||||
@@ -57,6 +56,14 @@ describe('deposit form validation', () => {
|
||||
.should('have.text', 'Insufficient amount in Ethereum wallet');
|
||||
});
|
||||
|
||||
it('unable to select assets not enabled', () => {
|
||||
cy.getByTestId('deposit-submit').click();
|
||||
// Assets not enabled in mocks
|
||||
cy.get(assetSelectField + ' option:contains(Asset 2)').should('not.exist');
|
||||
cy.get(assetSelectField + ' option:contains(Asset 3)').should('not.exist');
|
||||
cy.get(assetSelectField + ' option:contains(Asset 4)').should('not.exist');
|
||||
});
|
||||
|
||||
it('able to disconnect eth wallet', () => {
|
||||
const ethWalletAddress = Cypress.env('ETHEREUM_WALLET_ADDRESS');
|
||||
|
||||
|
||||
@@ -4,14 +4,18 @@ import { mockTradingPage } from '../support/trading';
|
||||
|
||||
describe('home', () => {
|
||||
const selectMarketOverlay = 'select-market-list';
|
||||
beforeEach(() => {
|
||||
cy.mockGQL((req) => {
|
||||
mockTradingPage(req, MarketState.STATE_ACTIVE);
|
||||
});
|
||||
cy.visit('/');
|
||||
});
|
||||
|
||||
describe('default market found', () => {
|
||||
it('redirects to a default market with the landing dialog open', () => {
|
||||
cy.mockGQL((req) => {
|
||||
// Mock all market page queries
|
||||
mockTradingPage(req, MarketState.STATE_ACTIVE);
|
||||
});
|
||||
cy.visit('/');
|
||||
cy.wait('@Market');
|
||||
|
||||
cy.get('main[data-testid="market"]', { timeout: 20000 }).should('exist'); // Wait for page to be rendered to before checking url
|
||||
|
||||
// Overlay should be shown
|
||||
|
||||
@@ -4,6 +4,8 @@ import { mockTradingPage } from '../support/trading';
|
||||
const marketInfoBtn = 'Info';
|
||||
const row = 'key-value-table-row';
|
||||
const marketTitle = 'accordion-title';
|
||||
const link = 'link';
|
||||
const externalLink = 'external-link';
|
||||
|
||||
describe('market info is displayed', () => {
|
||||
before(() => {
|
||||
@@ -25,9 +27,9 @@ describe('market info is displayed', () => {
|
||||
|
||||
it('market price', () => {
|
||||
cy.getByTestId(marketTitle).contains('Market price').click();
|
||||
validateMarketDataRow(0, 'Mark Price', '57.49');
|
||||
validateMarketDataRow(1, 'Best Bid Price', '6,817.65');
|
||||
validateMarketDataRow(2, 'Best Offer Price', '6,817.69');
|
||||
validateMarketDataRow(0, 'Mark Price', '0.05749');
|
||||
validateMarketDataRow(1, 'Best Bid Price', '6.81765 ');
|
||||
validateMarketDataRow(2, 'Best Offer Price', '6.81769 ');
|
||||
});
|
||||
|
||||
it('market volume displayed', () => {
|
||||
@@ -71,11 +73,7 @@ describe('market info is displayed', () => {
|
||||
|
||||
validateMarketDataRow(0, 'Name', 'tBTC TEST');
|
||||
validateMarketDataRow(1, 'Symbol', 'tBTC');
|
||||
validateMarketDataRow(
|
||||
2,
|
||||
'Asset ID',
|
||||
'5cfa87844724df6069b94e4c8a6f03af21907d7bc251593d08e4251043ee9f7c'
|
||||
);
|
||||
validateMarketDataRow(2, 'Asset ID', 'market-0');
|
||||
});
|
||||
|
||||
it('metadata displayed', () => {
|
||||
@@ -88,13 +86,6 @@ describe('market info is displayed', () => {
|
||||
validateMarketDataRow(4, 'Sector', 'crypto');
|
||||
});
|
||||
|
||||
it('risk factors displayed', () => {
|
||||
cy.getByTestId(marketTitle).contains('Risk factors').click();
|
||||
|
||||
validateMarketDataRow(0, 'Short', '0.008571790367285281');
|
||||
validateMarketDataRow(1, 'Long', '0.008508132993273576');
|
||||
});
|
||||
|
||||
it('risk model displayed', () => {
|
||||
cy.getByTestId(marketTitle).contains('Risk model').click();
|
||||
|
||||
@@ -114,9 +105,9 @@ describe('market info is displayed', () => {
|
||||
it('price monitoring bound displayed', () => {
|
||||
cy.getByTestId(marketTitle).contains('Price monitoring bound 1').click();
|
||||
|
||||
validateMarketDataRow(0, 'Min Valid Price', '6,547.01');
|
||||
validateMarketDataRow(1, 'Max Valid Price', '7,973.23');
|
||||
validateMarketDataRow(2, 'Reference Price', '7,226.25');
|
||||
validateMarketDataRow(0, 'Min Valid Price', '6.54701 ');
|
||||
validateMarketDataRow(1, 'Max Valid Price', '7.97323 ');
|
||||
validateMarketDataRow(2, 'Reference Price', '7.22625 ');
|
||||
});
|
||||
|
||||
it('liquidity monitoring parameters displayed', () => {
|
||||
@@ -129,6 +120,16 @@ describe('market info is displayed', () => {
|
||||
validateMarketDataRow(2, 'Scaling Factor', '10');
|
||||
});
|
||||
|
||||
it('liquidity displayed', () => {
|
||||
cy.getByTestId('accordion-toggle').eq(13).click();
|
||||
|
||||
validateMarketDataRow(0, 'Target Stake', '0.56789 tBTC');
|
||||
validateMarketDataRow(1, 'Supplied Stake', '0.56767 tBTC');
|
||||
validateMarketDataRow(2, 'Market Value Proxy', '6.77678 tBTC');
|
||||
|
||||
cy.getByTestId(link).should('have.text', 'View liquidity provision table');
|
||||
});
|
||||
|
||||
it('oracle displayed', () => {
|
||||
cy.getByTestId(marketTitle).contains('Oracle').click();
|
||||
|
||||
@@ -138,16 +139,19 @@ describe('market info is displayed', () => {
|
||||
'Trading Termination Property',
|
||||
'termination.BTC.value'
|
||||
);
|
||||
validateMarketDataRow(
|
||||
2,
|
||||
'Price Oracle',
|
||||
'f028fe5ea7de3890962a05a7163fdde562629af649ed81b8c8902fafb6eef04f'
|
||||
);
|
||||
validateMarketDataRow(
|
||||
3,
|
||||
'Termination Oracle',
|
||||
'f028fe5ea7de3890962a05a7163fdde562629af649ed81b8c8902fafb6eef04f'
|
||||
);
|
||||
|
||||
cy.getByTestId(externalLink)
|
||||
.should('have.attr', 'href')
|
||||
.and('contain', '/oracles');
|
||||
});
|
||||
|
||||
it('proposal displayed', () => {
|
||||
cy.getByTestId(marketTitle).contains('Proposal').click();
|
||||
|
||||
cy.getByTestId(externalLink)
|
||||
.should('have.text', 'View governance proposal')
|
||||
.and('have.attr', 'href')
|
||||
.and('contain', '/governance/market-0');
|
||||
});
|
||||
|
||||
afterEach('close toggle', () => {
|
||||
|
||||
@@ -127,7 +127,7 @@ describe('markets table', () => {
|
||||
}
|
||||
|
||||
function verifyMarketSummaryDisplayed() {
|
||||
const marketSummaryBlock = 'market-summary';
|
||||
const marketSummaryBlock = 'header-summary';
|
||||
const percentageValue = 'price-change-percentage';
|
||||
const priceChangeValue = 'price-change';
|
||||
const tradingVolume = 'trading-volume';
|
||||
|
||||
@@ -83,6 +83,18 @@ describe('withdraw', () => {
|
||||
},
|
||||
});
|
||||
cy.get(assetSelectField).select('Asset 0');
|
||||
cy.getByTestId('balance-available')
|
||||
.should('contain.text', 'Balance available')
|
||||
.find('td')
|
||||
.should('have.text', '1000');
|
||||
cy.getByTestId('withdrawal-threshold')
|
||||
.should('contain.text', 'Delayed withdrawal threshold')
|
||||
.find('td')
|
||||
.should('contain.text', '1m+');
|
||||
cy.getByTestId('delay-time')
|
||||
.should('contain.text', 'Delay time')
|
||||
.find('td')
|
||||
.should('have.text', 'None');
|
||||
cy.get(amountField).clear().type('10');
|
||||
cy.getByTestId(submitWithdrawBtn).click();
|
||||
cy.getByTestId('dialog-title').should(
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import merge from 'lodash/merge';
|
||||
import type { Accounts } from '@vegaprotocol/accounts';
|
||||
import type { AccountsQuery } from '@vegaprotocol/accounts';
|
||||
import { AccountType } from '@vegaprotocol/types';
|
||||
import type { PartialDeep } from 'type-fest';
|
||||
|
||||
export const generateAccounts = (
|
||||
override?: PartialDeep<Accounts>
|
||||
): Accounts => {
|
||||
const defaultAccounts: Accounts = {
|
||||
override?: PartialDeep<AccountsQuery>
|
||||
): AccountsQuery => {
|
||||
const defaultAccounts: AccountsQuery = {
|
||||
party: {
|
||||
__typename: 'Party',
|
||||
id: Cypress.env('VEGA_PUBLIC_KEY'),
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
import merge from 'lodash/merge';
|
||||
import type { PartialDeep } from 'type-fest';
|
||||
import type {
|
||||
Candles,
|
||||
Candles_market_candles,
|
||||
CandlesQuery,
|
||||
CandleFieldsFragment,
|
||||
} from '@vegaprotocol/candles-chart';
|
||||
|
||||
export const generateCandles = (override?: PartialDeep<Candles>): Candles => {
|
||||
const candles: Candles_market_candles[] = [
|
||||
export const generateCandles = (
|
||||
override?: PartialDeep<CandlesQuery>
|
||||
): CandlesQuery => {
|
||||
const candles: CandleFieldsFragment[] = [
|
||||
{
|
||||
datetime: '2022-04-06T09:15:00Z',
|
||||
high: '17481092',
|
||||
|
||||
@@ -1,15 +1,21 @@
|
||||
import merge from 'lodash/merge';
|
||||
import type { PartialDeep } from 'type-fest';
|
||||
import type {
|
||||
Chart,
|
||||
Chart_market_data_priceMonitoringBounds,
|
||||
} from '@vegaprotocol/candles-chart';
|
||||
import type { ChartQuery } from '@vegaprotocol/candles-chart';
|
||||
import type { Schema } from '@vegaprotocol/types';
|
||||
|
||||
export const generateChart = (override?: PartialDeep<Chart>): Chart => {
|
||||
const priceMonitoringBound: Chart_market_data_priceMonitoringBounds = {
|
||||
export const generateChart = (
|
||||
override?: PartialDeep<ChartQuery>
|
||||
): ChartQuery => {
|
||||
const priceMonitoringBound: Schema.PriceMonitoringBounds = {
|
||||
minValidPrice: '16256291',
|
||||
maxValidPrice: '18296869',
|
||||
referencePrice: '17247489',
|
||||
trigger: {
|
||||
__typename: 'PriceMonitoringTrigger',
|
||||
auctionExtensionSecs: 1,
|
||||
horizonSecs: 0,
|
||||
probability: 0,
|
||||
},
|
||||
__typename: 'PriceMonitoringBounds',
|
||||
};
|
||||
const defaultResult = {
|
||||
|
||||
@@ -39,6 +39,51 @@ export const generateDepositPage = (
|
||||
},
|
||||
__typename: 'AssetEdge',
|
||||
},
|
||||
{
|
||||
node: {
|
||||
id: 'asset-2',
|
||||
symbol: 'AST2',
|
||||
name: 'Asset 2',
|
||||
decimals: 5,
|
||||
status: AssetStatus.STATUS_PENDING_LISTING,
|
||||
source: {
|
||||
__typename: 'ERC20',
|
||||
contractAddress: '0x444b9aDA947130Fc320a144cd22bC1641e5c9d82',
|
||||
},
|
||||
__typename: 'Asset',
|
||||
},
|
||||
__typename: 'AssetEdge',
|
||||
},
|
||||
{
|
||||
node: {
|
||||
id: 'asset-3',
|
||||
symbol: 'AST3',
|
||||
name: 'Asset 3',
|
||||
decimals: 5,
|
||||
status: AssetStatus.STATUS_PROPOSED,
|
||||
source: {
|
||||
__typename: 'ERC20',
|
||||
contractAddress: '0x444b9aDA947130Fc320a144cd22bC1641e5c9d83',
|
||||
},
|
||||
__typename: 'Asset',
|
||||
},
|
||||
__typename: 'AssetEdge',
|
||||
},
|
||||
{
|
||||
node: {
|
||||
id: 'asset-4',
|
||||
symbol: 'AST4',
|
||||
name: 'Asset 4',
|
||||
decimals: 5,
|
||||
status: AssetStatus.STATUS_REJECTED,
|
||||
source: {
|
||||
__typename: 'ERC20',
|
||||
contractAddress: '0x444b9aDA947130Fc320a144cd22bC1641e5c9d84',
|
||||
},
|
||||
__typename: 'Asset',
|
||||
},
|
||||
__typename: 'AssetEdge',
|
||||
},
|
||||
],
|
||||
__typename: 'AssetsConnection',
|
||||
},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { MarketInfoQuery } from '@vegaprotocol/deal-ticket';
|
||||
import type { MarketInfoQuery } from '@vegaprotocol/market-info';
|
||||
import {
|
||||
AccountType,
|
||||
AuctionTrigger,
|
||||
@@ -15,7 +15,7 @@ export const generateMarketInfoQuery = (
|
||||
market: {
|
||||
__typename: 'Market',
|
||||
id: 'market-0',
|
||||
decimalPlaces: 2,
|
||||
decimalPlaces: 5,
|
||||
positionDecimalPlaces: 0,
|
||||
state: MarketState.STATE_ACTIVE,
|
||||
tradingMode: MarketTradingMode.TRADING_MODE_CONTINUOUS,
|
||||
@@ -144,10 +144,10 @@ export const generateMarketInfoQuery = (
|
||||
quoteName: 'BTC',
|
||||
settlementAsset: {
|
||||
__typename: 'Asset',
|
||||
id: '5cfa87844724df6069b94e4c8a6f03af21907d7bc251593d08e4251043ee9f7c',
|
||||
id: 'market-0',
|
||||
symbol: 'tBTC',
|
||||
name: 'tBTC TEST',
|
||||
decimals: 1,
|
||||
decimals: 5,
|
||||
},
|
||||
oracleSpecForSettlementPrice: {
|
||||
__typename: 'OracleSpec',
|
||||
|
||||
@@ -58,6 +58,7 @@ export const generateMarket = (override?: PartialDeep<Market>): Market => {
|
||||
},
|
||||
quoteName: 'BTCUSD Monthly',
|
||||
settlementAsset: {
|
||||
decimals: 0,
|
||||
id: '000',
|
||||
symbol: 'USD',
|
||||
name: 'United States Dollar',
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
# App configuration variables
|
||||
NX_VEGA_ENV=TESTNET
|
||||
NX_VEGA_URL=https://api.n09.testnet.vega.xyz/graphql
|
||||
NX_VEGA_URL=https://api.n07.testnet.vega.xyz/graphql
|
||||
NX_ETHEREUM_PROVIDER_URL=https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
|
||||
NX_ETHERSCAN_URL=https://ropsten.etherscan.io
|
||||
NX_VEGA_NETWORKS={\"MAINNET\":\"https://alpha.console.vega.xyz\"}
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
import { Vega } from '../icons/vega';
|
||||
|
||||
export const Footer = () => {
|
||||
return (
|
||||
<footer className="px-4 py-2 text-xs border-t border-neutral-300 dark:border-neutral-700">
|
||||
<footer className="px-4 py-2 text-xs border-t border-default bg-neutral-100 dark:bg-neutral-800">
|
||||
<div className="flex justify-between">
|
||||
<div>Status</div>
|
||||
<Vega className="w-13" />
|
||||
</div>
|
||||
</footer>
|
||||
);
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
import { Tooltip } from '@vegaprotocol/ui-toolkit';
|
||||
import type { ReactElement, ReactNode } from 'react';
|
||||
import { Children } from 'react';
|
||||
import { cloneElement } from 'react';
|
||||
|
||||
interface TradeMarketHeaderProps {
|
||||
title: ReactNode;
|
||||
children: ReactElement[];
|
||||
children: Array<ReactElement | null>;
|
||||
}
|
||||
|
||||
export const Header = ({ title, children }: TradeMarketHeaderProps) => {
|
||||
return (
|
||||
<header className="w-screen xl:px-4 pt-4 border-b border-neutral-300 dark:border-neutral-700">
|
||||
<header className="w-screen xl:px-4 pt-4 border-b border-default">
|
||||
<div className="xl:flex xl:gap-4 items-start">
|
||||
<div className="px-4 mb-2 xl:mb-0 sm:text-lg md:text-xl lg:text-2xl">
|
||||
{title}
|
||||
</div>
|
||||
<div className="mb-4 xl:mb-0">{title}</div>
|
||||
<div
|
||||
data-testid="market-summary"
|
||||
data-testid="header-summary"
|
||||
className="flex flex-nowrap items-start xl:flex-1 w-full overflow-x-auto text-xs "
|
||||
>
|
||||
{Children.map(children, (child, index) => {
|
||||
if (!child) return null;
|
||||
return cloneElement(child, {
|
||||
id: `header-stat-${index}`,
|
||||
});
|
||||
@@ -33,21 +33,25 @@ export const HeaderStat = ({
|
||||
children,
|
||||
heading,
|
||||
id,
|
||||
description,
|
||||
}: {
|
||||
children: ReactNode;
|
||||
heading: string;
|
||||
id?: string;
|
||||
description?: string | ReactNode;
|
||||
}) => {
|
||||
const itemClass =
|
||||
'min-w-min w-[120px] whitespace-nowrap pb-3 px-4 border-l border-neutral-300 dark:border-neutral-700';
|
||||
const itemHeading = 'text-neutral-400';
|
||||
'min-w-min w-[120px] whitespace-nowrap pb-3 px-4 border-l border-default';
|
||||
const itemHeading = 'text-neutral-500 dark:text-neutral-400';
|
||||
|
||||
return (
|
||||
<div className={itemClass}>
|
||||
<div id={id} className={itemHeading}>
|
||||
{heading}
|
||||
</div>
|
||||
<div aria-labelledby={id}>{children}</div>
|
||||
<div id={id}>{heading}</div>
|
||||
<Tooltip description={description}>
|
||||
<div aria-labelledby={id} className={itemHeading}>
|
||||
{children}
|
||||
</div>
|
||||
</Tooltip>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -5,7 +5,8 @@ import { NetworkSwitcher } from '@vegaprotocol/environment';
|
||||
import { t } from '@vegaprotocol/react-helpers';
|
||||
import { useGlobalStore } from '../../stores/global';
|
||||
import { VegaWalletConnectButton } from '../vega-wallet-connect-button';
|
||||
import { ThemeSwitcher, VLogo } from '@vegaprotocol/ui-toolkit';
|
||||
import { ThemeSwitcher } from '@vegaprotocol/ui-toolkit';
|
||||
import { Vega } from '../icons/vega';
|
||||
|
||||
interface NavbarProps {
|
||||
theme: 'light' | 'dark';
|
||||
@@ -19,15 +20,15 @@ export const Navbar = ({ theme, toggleTheme }: NavbarProps) => {
|
||||
}));
|
||||
const tradingPath = marketId ? `/markets/${marketId}` : '/markets';
|
||||
return (
|
||||
<div className="px-4 flex items-stretch border-b border-neutral-300 dark:border-neutral-700 bg-black">
|
||||
<div className="px-4 flex items-stretch border-b border-default bg-black text-white">
|
||||
<div className="flex gap-4 mr-4 items-center h-full">
|
||||
<Link href="/" passHref={true}>
|
||||
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
|
||||
<a>
|
||||
<VLogo className="w-6 h-6 fill-white" />
|
||||
<Vega className="w-13" />
|
||||
</a>
|
||||
</Link>
|
||||
<NetworkSwitcher />
|
||||
<NetworkSwitcher theme="dark" />
|
||||
</div>
|
||||
<nav className="flex items-center">
|
||||
{[
|
||||
@@ -69,7 +70,7 @@ const NavLink = ({ name, path, exact, testId = name }: NavLinkProps) => {
|
||||
router.asPath === path || (!exact && router.asPath.startsWith(path));
|
||||
const linkClasses = classNames('mx-2 py-2 self-end border-b-4', {
|
||||
'border-vega-yellow text-white cursor-default': isActive,
|
||||
'border-transparent text-neutral-400': !isActive,
|
||||
'border-transparent text-neutral-400 hover:text-neutral-300': !isActive,
|
||||
});
|
||||
return (
|
||||
<Link data-testid={testId} href={path} passHref={true}>
|
||||
|
||||
@@ -36,14 +36,17 @@ const MarketDataGrid = ({ grid }: MarketDataGridProps) => {
|
||||
const formatStake = (value: string, market: Market_market) => {
|
||||
const formattedValue = addDecimalsFormatNumber(
|
||||
value,
|
||||
market.positionDecimalPlaces
|
||||
market.tradableInstrument.instrument.product.settlementAsset.decimals
|
||||
);
|
||||
const asset =
|
||||
market.tradableInstrument.instrument.product.settlementAsset.symbol;
|
||||
return `${formattedValue} ${asset}`;
|
||||
};
|
||||
|
||||
const compileGridData = (market: Market_market) => {
|
||||
const compileGridData = (
|
||||
market: Market_market,
|
||||
onSelect?: (id: string) => void
|
||||
) => {
|
||||
const grid: MarketDataGridProps['grid'] = [];
|
||||
const isLiquidityMonitoringAuction =
|
||||
market.tradingMode === MarketTradingMode.TRADING_MODE_MONITORING_AUCTION &&
|
||||
@@ -80,7 +83,7 @@ const compileGridData = (market: Market_market) => {
|
||||
if (isLiquidityMonitoringAuction && market.data?.suppliedStake) {
|
||||
grid.push({
|
||||
label: (
|
||||
<Link href={`/liquidity/${market.id}`} target="_blank">
|
||||
<Link onClick={() => onSelect && onSelect(market.id)}>
|
||||
{t('Current liquidity')}
|
||||
</Link>
|
||||
),
|
||||
@@ -117,9 +120,13 @@ const compileGridData = (market: Market_market) => {
|
||||
|
||||
type TradingModeTooltipProps = {
|
||||
market: Market_market;
|
||||
onSelect?: (marketId: string) => void;
|
||||
};
|
||||
|
||||
export const TradingModeTooltip = ({ market }: TradingModeTooltipProps) => {
|
||||
export const TradingModeTooltip = ({
|
||||
market,
|
||||
onSelect,
|
||||
}: TradingModeTooltipProps) => {
|
||||
switch (market.tradingMode) {
|
||||
case MarketTradingMode.TRADING_MODE_CONTINUOUS: {
|
||||
return (
|
||||
@@ -168,7 +175,7 @@ export const TradingModeTooltip = ({ market }: TradingModeTooltipProps) => {
|
||||
{t('Find out more')}
|
||||
</Link>
|
||||
</p>
|
||||
<MarketDataGrid grid={compileGridData(market)} />
|
||||
<MarketDataGrid grid={compileGridData(market, onSelect)} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,6 @@ export const VegaWalletConnectButton = ({
|
||||
return (
|
||||
<DropdownMenu open={dropdownOpen}>
|
||||
<DropdownMenuTrigger
|
||||
className="text-white"
|
||||
data-testid="manage-vega-wallet"
|
||||
onClick={() => setDropdownOpen((curr) => !curr)}
|
||||
>
|
||||
|
||||
@@ -22,6 +22,7 @@ export function Index() {
|
||||
|
||||
if (marketId) {
|
||||
replace(`/markets/${marketId}`);
|
||||
update({ marketId });
|
||||
}
|
||||
// Fallback to the markets list page
|
||||
else {
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import { LiquidityTable, useLiquidityProvision } from '@vegaprotocol/liquidity';
|
||||
import { t } from '@vegaprotocol/react-helpers';
|
||||
import { addDecimalsFormatNumber, t } from '@vegaprotocol/react-helpers';
|
||||
import { LiquidityProvisionStatus } from '@vegaprotocol/types';
|
||||
import { AsyncRenderer, Tab, Tabs } from '@vegaprotocol/ui-toolkit';
|
||||
import { useVegaWallet } from '@vegaprotocol/wallet';
|
||||
import type { AgGridReact } from 'ag-grid-react';
|
||||
import { Header, HeaderStat } from '../../components/header';
|
||||
import Link from 'next/link';
|
||||
import { useRouter } from 'next/router';
|
||||
import { useRef, useMemo } from 'react';
|
||||
import { tooltipMapping } from '@vegaprotocol/market-info';
|
||||
|
||||
const LiquidityPage = ({ id }: { id?: string }) => {
|
||||
const { query } = useRouter();
|
||||
const { query, push } = useRouter();
|
||||
const { keypair } = useVegaWallet();
|
||||
const gridRef = useRef<AgGridReact | null>(null);
|
||||
|
||||
@@ -20,7 +20,14 @@ const LiquidityPage = ({ id }: { id?: string }) => {
|
||||
id || (Array.isArray(query.marketId) ? query.marketId[0] : query.marketId);
|
||||
|
||||
const {
|
||||
data: { liquidityProviders, suppliedStake, targetStake, code, symbol },
|
||||
data: {
|
||||
liquidityProviders,
|
||||
suppliedStake,
|
||||
targetStake,
|
||||
name,
|
||||
symbol,
|
||||
assetDecimalPlaces,
|
||||
},
|
||||
loading,
|
||||
error,
|
||||
} = useLiquidityProvision({ marketId });
|
||||
@@ -62,16 +69,36 @@ const LiquidityPage = ({ id }: { id?: string }) => {
|
||||
<div className="h-full grid grid-rows-[min-content_1fr]">
|
||||
<Header
|
||||
title={
|
||||
<Link href={`/markets/${marketId}`}>
|
||||
{`${code} ${t('liquidity provision')}`}
|
||||
</Link>
|
||||
<button onClick={() => push(`/markets/${marketId}`)}>{`${name} ${t(
|
||||
'liquidity provision'
|
||||
)}`}</button>
|
||||
}
|
||||
>
|
||||
<HeaderStat heading={t('Target stake')}>
|
||||
<div>{`${targetStake} ${symbol}`}</div>
|
||||
<HeaderStat
|
||||
heading={t('Target stake')}
|
||||
description={tooltipMapping['targetStake']}
|
||||
>
|
||||
<div>
|
||||
{targetStake
|
||||
? `${addDecimalsFormatNumber(
|
||||
targetStake,
|
||||
assetDecimalPlaces ?? 0
|
||||
)} ${symbol}`
|
||||
: '-'}
|
||||
</div>
|
||||
</HeaderStat>
|
||||
<HeaderStat heading={t('Supplied stake')}>
|
||||
<div>{`${suppliedStake} ${symbol}`}</div>
|
||||
<HeaderStat
|
||||
heading={t('Supplied stake')}
|
||||
description={tooltipMapping['suppliedStake']}
|
||||
>
|
||||
<div>
|
||||
{suppliedStake
|
||||
? `${addDecimalsFormatNumber(
|
||||
suppliedStake,
|
||||
assetDecimalPlaces ?? 0
|
||||
)} ${symbol}`
|
||||
: '-'}
|
||||
</div>
|
||||
</HeaderStat>
|
||||
<HeaderStat heading={t('Market ID')}>
|
||||
<div className="break-word">{marketId}</div>
|
||||
@@ -83,13 +110,28 @@ const LiquidityPage = ({ id }: { id?: string }) => {
|
||||
name={t('My liquidity provision')}
|
||||
hidden={!partyId}
|
||||
>
|
||||
<LiquidityTable ref={gridRef} data={myLpEdges} />
|
||||
<LiquidityTable
|
||||
ref={gridRef}
|
||||
data={myLpEdges}
|
||||
symbol={symbol}
|
||||
assetDecimalPlaces={assetDecimalPlaces}
|
||||
/>
|
||||
</Tab>
|
||||
<Tab id={LiquidityTabs.Active} name={t('Active')}>
|
||||
<LiquidityTable ref={gridRef} data={activeEdges} />
|
||||
<LiquidityTable
|
||||
ref={gridRef}
|
||||
data={activeEdges}
|
||||
symbol={symbol}
|
||||
assetDecimalPlaces={assetDecimalPlaces}
|
||||
/>
|
||||
</Tab>
|
||||
<Tab id={LiquidityTabs.Inactive} name={t('Inactive')}>
|
||||
<LiquidityTable ref={gridRef} data={inactiveEdges} />
|
||||
<LiquidityTable
|
||||
ref={gridRef}
|
||||
data={inactiveEdges}
|
||||
symbol={symbol}
|
||||
assetDecimalPlaces={assetDecimalPlaces}
|
||||
/>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
query Market($marketId: ID!, $interval: Interval!, $since: String!) {
|
||||
market(id: $marketId) {
|
||||
id
|
||||
name
|
||||
tradingMode
|
||||
state
|
||||
decimalPlaces
|
||||
@@ -41,6 +40,7 @@ query Market($marketId: ID!, $interval: Interval!, $since: String!) {
|
||||
id
|
||||
symbol
|
||||
name
|
||||
decimals
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,6 +55,7 @@ const MARKET_QUERY = gql`
|
||||
id
|
||||
symbol
|
||||
name
|
||||
decimals
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -83,11 +84,20 @@ const MarketPage = ({ id }: { id?: string }) => {
|
||||
update: store.update,
|
||||
})
|
||||
);
|
||||
const { update: updateStore } = useGlobalStore((store) => ({
|
||||
update: store.update,
|
||||
}));
|
||||
|
||||
// Default to first marketId query item if found
|
||||
const marketId =
|
||||
id || (Array.isArray(query.marketId) ? query.marketId[0] : query.marketId);
|
||||
|
||||
const onSelect = (id: string) => {
|
||||
if (id && id !== marketId) {
|
||||
updateStore({ marketId: id });
|
||||
}
|
||||
};
|
||||
|
||||
// Cache timestamp for yesterday to prevent full unmount of market page when
|
||||
// a rerender occurs
|
||||
const yTimestamp = useMemo(() => {
|
||||
@@ -128,20 +138,16 @@ const MarketPage = ({ id }: { id?: string }) => {
|
||||
return (
|
||||
<>
|
||||
{w > 960 ? (
|
||||
<TradeGrid market={market} />
|
||||
<TradeGrid market={market} onSelect={onSelect} />
|
||||
) : (
|
||||
<TradePanels market={market} />
|
||||
<TradePanels market={market} onSelect={onSelect} />
|
||||
)}
|
||||
<SelectMarketDialog
|
||||
dialogOpen={landingDialog && !riskNoticeDialog}
|
||||
setDialogOpen={(isOpen: boolean) =>
|
||||
update({ landingDialog: isOpen })
|
||||
}
|
||||
onSelect={(marketId: string) => {
|
||||
if (marketId && marketId !== marketId) {
|
||||
update({ marketId });
|
||||
}
|
||||
}}
|
||||
onSelect={onSelect}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
||||
+5
-1
@@ -20,7 +20,7 @@ export interface Market_market_data_market {
|
||||
export interface Market_market_data {
|
||||
__typename: "MarketData";
|
||||
/**
|
||||
* market ID of the associated mark price
|
||||
* market of the associated mark price
|
||||
*/
|
||||
market: Market_market_data_market;
|
||||
/**
|
||||
@@ -103,6 +103,10 @@ export interface Market_market_tradableInstrument_instrument_product_settlementA
|
||||
* The full name of the asset (e.g: Great British Pound)
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The precision of the asset. Should match the decimal precision of the asset on its native chain, e.g: for ERC20 assets, it is often 18
|
||||
*/
|
||||
decimals: number;
|
||||
}
|
||||
|
||||
export interface Market_market_tradableInstrument_instrument_product {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as Types from '@vegaprotocol/types/types';
|
||||
import { Schema as Types } from '@vegaprotocol/types';
|
||||
|
||||
import { gql } from '@apollo/client';
|
||||
import * as Apollo from '@apollo/client';
|
||||
@@ -10,14 +10,13 @@ export type MarketQueryVariables = Types.Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type MarketQuery = { __typename?: 'Query', market?: { __typename?: 'Market', id: string, name: string, tradingMode: Types.MarketTradingMode, state: Types.MarketState, decimalPlaces: number, positionDecimalPlaces: number, data?: { __typename?: 'MarketData', auctionStart?: string | null, auctionEnd?: string | null, markPrice: string, indicativeVolume: string, indicativePrice: string, suppliedStake?: string | null, targetStake?: string | null, bestBidVolume: string, bestOfferVolume: string, bestStaticBidVolume: string, bestStaticOfferVolume: string, trigger: Types.AuctionTrigger, market: { __typename?: 'Market', id: string } } | null, tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', id: string, name: string, code: string, metadata: { __typename?: 'InstrumentMetadata', tags?: Array<string> | null }, product: { __typename?: 'Future', quoteName: string, oracleSpecForTradingTermination: { __typename?: 'OracleSpec', id: string }, settlementAsset: { __typename?: 'Asset', id: string, symbol: string, name: string } } } }, marketTimestamps: { __typename?: 'MarketTimestamps', open?: string | null, close?: string | null }, candles?: Array<{ __typename?: 'Candle', open: string, close: string, volume: string } | null> | null } | null };
|
||||
export type MarketQuery = { __typename?: 'Query', market?: { __typename?: 'Market', id: string, tradingMode: Types.MarketTradingMode, state: Types.MarketState, decimalPlaces: number, positionDecimalPlaces: number, data?: { __typename?: 'MarketData', auctionStart?: string | null, auctionEnd?: string | null, markPrice: string, indicativeVolume: string, indicativePrice: string, suppliedStake?: string | null, targetStake?: string | null, bestBidVolume: string, bestOfferVolume: string, bestStaticBidVolume: string, bestStaticOfferVolume: string, trigger: Types.AuctionTrigger, market: { __typename?: 'Market', id: string } } | null, tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', id: string, name: string, code: string, metadata: { __typename?: 'InstrumentMetadata', tags?: Array<string> | null }, product: { __typename?: 'Future', quoteName: string, oracleSpecForTradingTermination: { __typename?: 'OracleSpec', id: string }, settlementAsset: { __typename?: 'Asset', id: string, symbol: string, name: string, decimals: number } } } }, marketTimestamps: { __typename?: 'MarketTimestamps', open?: string | null, close?: string | null }, candles?: Array<{ __typename?: 'Candle', open: string, close: string, volume: string } | null> | null } | null };
|
||||
|
||||
|
||||
export const MarketDocument = gql`
|
||||
query Market($marketId: ID!, $interval: Interval!, $since: String!) {
|
||||
market(id: $marketId) {
|
||||
id
|
||||
name
|
||||
tradingMode
|
||||
state
|
||||
decimalPlaces
|
||||
@@ -57,6 +56,7 @@ export const MarketDocument = gql`
|
||||
id
|
||||
symbol
|
||||
name
|
||||
decimals
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import {
|
||||
DealTicketContainer,
|
||||
MarketInfoContainer,
|
||||
} from '@vegaprotocol/deal-ticket';
|
||||
import { DealTicketContainer } from '@vegaprotocol/deal-ticket';
|
||||
import { MarketInfoContainer } from '@vegaprotocol/market-info';
|
||||
import { OrderbookContainer } from '@vegaprotocol/market-depth';
|
||||
import { OrderListContainer } from '@vegaprotocol/orders';
|
||||
import { FillsContainer } from '@vegaprotocol/fills';
|
||||
@@ -22,7 +20,6 @@ import {
|
||||
ResizableGrid,
|
||||
ResizableGridPanel,
|
||||
ButtonLink,
|
||||
Tooltip,
|
||||
PriceCellChange,
|
||||
Link,
|
||||
} from '@vegaprotocol/ui-toolkit';
|
||||
@@ -32,7 +29,6 @@ import {
|
||||
t,
|
||||
} from '@vegaprotocol/react-helpers';
|
||||
import { SelectMarketPopover } from '@vegaprotocol/market-list';
|
||||
import { useGlobalStore } from '../../stores';
|
||||
import { useAssetDetailsDialogStore } from '@vegaprotocol/assets';
|
||||
import { useEnvironment } from '@vegaprotocol/environment';
|
||||
import type { CandleClose } from '@vegaprotocol/types';
|
||||
@@ -43,6 +39,8 @@ import {
|
||||
MarketTradingModeMapping,
|
||||
} from '@vegaprotocol/types';
|
||||
import { TradingModeTooltip } from '../../components/trading-mode-tooltip';
|
||||
import { useRouter } from 'next/router';
|
||||
import { Header, HeaderStat } from '../../components/header';
|
||||
|
||||
const TradingViews = {
|
||||
Candles: CandlesChartContainer,
|
||||
@@ -64,15 +62,16 @@ type ExpiryLabelProps = {
|
||||
};
|
||||
|
||||
const ExpiryLabel = ({ market }: ExpiryLabelProps) => {
|
||||
let content = null;
|
||||
if (market.marketTimestamps.close === null) {
|
||||
return <>{t('Not time-based')}</>;
|
||||
content = t('Not time-based');
|
||||
} else {
|
||||
const closeDate = new Date(market.marketTimestamps.close);
|
||||
const isExpired = Date.now() - closeDate.valueOf() > 0;
|
||||
const expiryDate = getDateFormat().format(closeDate);
|
||||
content = `${isExpired ? `${t('Expired')} ` : ''} ${expiryDate}`;
|
||||
}
|
||||
|
||||
const closeDate = new Date(market.marketTimestamps.close);
|
||||
const isExpired = Date.now() - closeDate.valueOf() > 0;
|
||||
const expiryDate = getDateFormat().format(closeDate);
|
||||
|
||||
return <>{`${isExpired ? `${t('Expired')} ` : ''} ${expiryDate}`}</>;
|
||||
return <div data-testid="trading-expiry">{content}</div>;
|
||||
};
|
||||
|
||||
type ExpiryTooltipContentProps = {
|
||||
@@ -110,144 +109,120 @@ const ExpiryTooltipContent = ({
|
||||
|
||||
interface TradeMarketHeaderProps {
|
||||
market: Market_market;
|
||||
onSelect: (marketId: string) => void;
|
||||
}
|
||||
|
||||
export const TradeMarketHeader = ({ market }: TradeMarketHeaderProps) => {
|
||||
export const TradeMarketHeader = ({
|
||||
market,
|
||||
onSelect,
|
||||
}: TradeMarketHeaderProps) => {
|
||||
const { push } = useRouter();
|
||||
const { VEGA_EXPLORER_URL } = useEnvironment();
|
||||
const { setAssetDetailsDialogOpen, setAssetDetailsDialogSymbol } =
|
||||
useAssetDetailsDialogStore();
|
||||
const { update } = useGlobalStore((store) => ({
|
||||
update: store.update,
|
||||
}));
|
||||
|
||||
const onSelect = (marketId: string) => {
|
||||
if (marketId && marketId !== marketId) {
|
||||
update({ marketId });
|
||||
}
|
||||
};
|
||||
|
||||
const candlesClose: string[] = (market?.candles || [])
|
||||
.map((candle) => candle?.close)
|
||||
.filter((c): c is CandleClose => c !== null);
|
||||
const hasExpiry = market.marketTimestamps.close !== null;
|
||||
const symbol =
|
||||
market.tradableInstrument.instrument.product?.settlementAsset?.symbol;
|
||||
|
||||
const itemClass =
|
||||
'min-w-min w-[120px] whitespace-nowrap pb-3 px-4 border-l border-neutral-300 dark:border-neutral-700';
|
||||
const itemHeading = 'text-neutral-400';
|
||||
|
||||
return (
|
||||
<header className="w-screen xl:px-4 pt-4 border-b border-neutral-300 dark:border-neutral-700">
|
||||
<div className="xl:flex xl:gap-4 items-start">
|
||||
<div className="px-4 mb-2 xl:mb-0">
|
||||
<SelectMarketPopover
|
||||
marketName={market.tradableInstrument.instrument.name}
|
||||
onSelect={onSelect}
|
||||
<Header
|
||||
title={
|
||||
<SelectMarketPopover
|
||||
marketName={market.tradableInstrument.instrument.name}
|
||||
onSelect={onSelect}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<HeaderStat
|
||||
heading={t('Expiry')}
|
||||
description={
|
||||
<ExpiryTooltipContent
|
||||
market={market}
|
||||
explorerUrl={VEGA_EXPLORER_URL}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<ExpiryLabel market={market} />
|
||||
</HeaderStat>
|
||||
<HeaderStat heading={t('Change (24h)')}>
|
||||
<PriceCellChange
|
||||
candles={candlesClose}
|
||||
decimalPlaces={market.decimalPlaces}
|
||||
/>
|
||||
</HeaderStat>
|
||||
<HeaderStat heading={t('Volume')}>
|
||||
<div data-testid="trading-volume">
|
||||
{market.data && market.data.indicativeVolume !== '0'
|
||||
? addDecimalsFormatNumber(
|
||||
market.data.indicativeVolume,
|
||||
market.positionDecimalPlaces
|
||||
)
|
||||
: '-'}
|
||||
</div>
|
||||
<div
|
||||
data-testid="market-summary"
|
||||
className="flex flex-nowrap items-start xl:flex-1 w-full overflow-x-auto text-xs "
|
||||
>
|
||||
<div className={itemClass}>
|
||||
<div className={itemHeading}>{t('Expiry')}</div>
|
||||
<Tooltip
|
||||
align="start"
|
||||
description={
|
||||
<ExpiryTooltipContent
|
||||
market={market}
|
||||
explorerUrl={VEGA_EXPLORER_URL}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<div
|
||||
data-testid="trading-expiry"
|
||||
className={classNames({
|
||||
'underline decoration-dashed': !hasExpiry,
|
||||
})}
|
||||
>
|
||||
<ExpiryLabel market={market} />
|
||||
</div>
|
||||
</Tooltip>
|
||||
</div>
|
||||
<div className={itemClass}>
|
||||
<div className={itemHeading}>{t('Change (24h)')}</div>
|
||||
<PriceCellChange
|
||||
candles={candlesClose}
|
||||
decimalPlaces={market.decimalPlaces}
|
||||
/>
|
||||
</div>
|
||||
<div className={itemClass}>
|
||||
<div className={itemHeading}>{t('Volume')}</div>
|
||||
<div data-testid="trading-volume">
|
||||
{market.data && market.data.indicativeVolume !== '0'
|
||||
? addDecimalsFormatNumber(
|
||||
market.data.indicativeVolume,
|
||||
market.positionDecimalPlaces
|
||||
)
|
||||
: '-'}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className={itemClass}>
|
||||
<div className={itemHeading}>{t('Trading mode')}</div>
|
||||
<Tooltip
|
||||
align="start"
|
||||
description={<TradingModeTooltip market={market} />}
|
||||
>
|
||||
<div data-testid="trading-mode">
|
||||
{market.tradingMode ===
|
||||
MarketTradingMode.TRADING_MODE_MONITORING_AUCTION &&
|
||||
market.data?.trigger &&
|
||||
market.data.trigger !==
|
||||
AuctionTrigger.AUCTION_TRIGGER_UNSPECIFIED
|
||||
? `${MarketTradingModeMapping[market.tradingMode]}
|
||||
</HeaderStat>
|
||||
<HeaderStat
|
||||
heading={t('Trading mode')}
|
||||
description={
|
||||
<TradingModeTooltip
|
||||
market={market}
|
||||
onSelect={(marketId: string) => {
|
||||
onSelect(marketId);
|
||||
push(`/liquidity/${marketId}`);
|
||||
}}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<div data-testid="trading-mode">
|
||||
{market.tradingMode ===
|
||||
MarketTradingMode.TRADING_MODE_MONITORING_AUCTION &&
|
||||
market.data?.trigger &&
|
||||
market.data.trigger !== AuctionTrigger.AUCTION_TRIGGER_UNSPECIFIED
|
||||
? `${MarketTradingModeMapping[market.tradingMode]}
|
||||
- ${AuctionTriggerMapping[market.data.trigger]}`
|
||||
: MarketTradingModeMapping[market.tradingMode]}
|
||||
</div>
|
||||
</Tooltip>
|
||||
</div>
|
||||
<div className={itemClass}>
|
||||
<div className={itemHeading}>{t('Price')}</div>
|
||||
<div data-testid="mark-price">
|
||||
{market.data && market.data.markPrice !== '0'
|
||||
? addDecimalsFormatNumber(
|
||||
market.data.markPrice,
|
||||
market.decimalPlaces
|
||||
)
|
||||
: '-'}
|
||||
</div>
|
||||
</div>
|
||||
{symbol && (
|
||||
<div className={itemClass}>
|
||||
<div className={itemHeading}>{t('Settlement asset')}</div>
|
||||
<div data-testid="trading-mode">
|
||||
<ButtonLink
|
||||
onClick={() => {
|
||||
setAssetDetailsDialogOpen(true);
|
||||
setAssetDetailsDialogSymbol(symbol);
|
||||
}}
|
||||
>
|
||||
{symbol}
|
||||
</ButtonLink>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
: MarketTradingModeMapping[market.tradingMode]}
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
</HeaderStat>
|
||||
<HeaderStat heading={t('Price')}>
|
||||
<div data-testid="mark-price">
|
||||
{market.data && market.data.markPrice !== '0'
|
||||
? addDecimalsFormatNumber(
|
||||
market.data.markPrice,
|
||||
market.decimalPlaces
|
||||
)
|
||||
: '-'}
|
||||
</div>
|
||||
</HeaderStat>
|
||||
{symbol ? (
|
||||
<HeaderStat heading={t('Settlement asset')}>
|
||||
<div data-testid="trading-mode">
|
||||
<ButtonLink
|
||||
onClick={() => {
|
||||
setAssetDetailsDialogOpen(true);
|
||||
setAssetDetailsDialogSymbol(symbol);
|
||||
}}
|
||||
>
|
||||
{symbol}
|
||||
</ButtonLink>
|
||||
</div>
|
||||
</HeaderStat>
|
||||
) : null}
|
||||
</Header>
|
||||
);
|
||||
};
|
||||
|
||||
interface TradeGridProps {
|
||||
market: Market_market;
|
||||
onSelect: (marketId: string) => void;
|
||||
}
|
||||
|
||||
export const TradeGrid = ({ market }: TradeGridProps) => {
|
||||
export const TradeGrid = ({ market, onSelect }: TradeGridProps) => {
|
||||
const { push } = useRouter();
|
||||
return (
|
||||
<div className="h-full grid grid-rows-[min-content_1fr]">
|
||||
<TradeMarketHeader market={market} />
|
||||
<TradeMarketHeader market={market} onSelect={onSelect} />
|
||||
<ResizableGrid vertical={true}>
|
||||
<ResizableGridPanel minSize={75} priority={LayoutPriority.High}>
|
||||
<ResizableGrid proportionalLayout={false} minSize={200}>
|
||||
@@ -269,7 +244,7 @@ export const TradeGrid = ({ market }: TradeGridProps) => {
|
||||
</ResizableGridPanel>
|
||||
<ResizableGridPanel
|
||||
priority={LayoutPriority.Low}
|
||||
preferredSize="25%"
|
||||
preferredSize={330}
|
||||
minSize={300}
|
||||
>
|
||||
<TradeGridChild>
|
||||
@@ -278,14 +253,20 @@ export const TradeGrid = ({ market }: TradeGridProps) => {
|
||||
<TradingViews.Ticket marketId={market.id} />
|
||||
</Tab>
|
||||
<Tab id="info" name={t('Info')}>
|
||||
<TradingViews.Info marketId={market.id} />
|
||||
<TradingViews.Info
|
||||
marketId={market.id}
|
||||
onSelect={(id: string) => {
|
||||
onSelect(id);
|
||||
push(`/liquidity/${id}`);
|
||||
}}
|
||||
/>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
</TradeGridChild>
|
||||
</ResizableGridPanel>
|
||||
<ResizableGridPanel
|
||||
priority={LayoutPriority.Low}
|
||||
preferredSize="25%"
|
||||
preferredSize={430}
|
||||
minSize={200}
|
||||
>
|
||||
<TradeGridChild>
|
||||
@@ -303,7 +284,7 @@ export const TradeGrid = ({ market }: TradeGridProps) => {
|
||||
</ResizableGridPanel>
|
||||
<ResizableGridPanel
|
||||
priority={LayoutPriority.Low}
|
||||
preferredSize="33%"
|
||||
preferredSize="25%"
|
||||
minSize={50}
|
||||
>
|
||||
<TradeGridChild>
|
||||
@@ -336,11 +317,7 @@ const TradeGridChild = ({ children }: TradeGridChildProps) => {
|
||||
return (
|
||||
<section className="h-full">
|
||||
<AutoSizer>
|
||||
{({ width, height }) => (
|
||||
<div style={{ width, height }} className="overflow-auto">
|
||||
{children}
|
||||
</div>
|
||||
)}
|
||||
{({ width, height }) => <div style={{ width, height }}>{children}</div>}
|
||||
</AutoSizer>
|
||||
</section>
|
||||
);
|
||||
@@ -348,9 +325,11 @@ const TradeGridChild = ({ children }: TradeGridChildProps) => {
|
||||
|
||||
interface TradePanelsProps {
|
||||
market: Market_market;
|
||||
onSelect: (marketId: string) => void;
|
||||
}
|
||||
|
||||
export const TradePanels = ({ market }: TradePanelsProps) => {
|
||||
export const TradePanels = ({ market, onSelect }: TradePanelsProps) => {
|
||||
const { push } = useRouter();
|
||||
const [view, setView] = useState<TradingView>('Candles');
|
||||
|
||||
const renderView = () => {
|
||||
@@ -360,20 +339,30 @@ export const TradePanels = ({ market }: TradePanelsProps) => {
|
||||
throw new Error(`No component for view: ${view}`);
|
||||
}
|
||||
|
||||
return <Component marketId={market.id} />;
|
||||
return (
|
||||
<Component
|
||||
marketId={market.id}
|
||||
onSelect={(id: string) => {
|
||||
onSelect(id);
|
||||
push(`/liquidity/${id}`);
|
||||
}}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="h-full grid grid-rows-[min-content_1fr_min-content]">
|
||||
<TradeMarketHeader market={market} />
|
||||
<TradeMarketHeader market={market} onSelect={onSelect} />
|
||||
<div className="h-full">
|
||||
<AutoSizer>
|
||||
{({ width, height }) => (
|
||||
<div style={{ width, height }}>{renderView()}</div>
|
||||
<div style={{ width, height }} className="overflow-auto">
|
||||
{renderView()}
|
||||
</div>
|
||||
)}
|
||||
</AutoSizer>
|
||||
</div>
|
||||
<div className="flex flex-nowrap overflow-x-auto max-w-full border-t border-neutral-300 dark:border-neutral-700">
|
||||
<div className="flex flex-nowrap overflow-x-auto max-w-full border-t border-default">
|
||||
{Object.keys(TradingViews).map((key) => {
|
||||
const isActive = view === key;
|
||||
const className = classNames('p-4 min-w-[100px] capitalize', {
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @generated
|
||||
// This file was automatically generated and should not be edited.
|
||||
|
||||
// ====================================================
|
||||
// GraphQL fragment: AssetFields
|
||||
// ====================================================
|
||||
|
||||
export interface AssetFields_source_BuiltinAsset {
|
||||
__typename: "BuiltinAsset";
|
||||
}
|
||||
|
||||
export interface AssetFields_source_ERC20 {
|
||||
__typename: "ERC20";
|
||||
/**
|
||||
* The address of the ERC20 contract
|
||||
*/
|
||||
contractAddress: string;
|
||||
}
|
||||
|
||||
export type AssetFields_source = AssetFields_source_BuiltinAsset | AssetFields_source_ERC20;
|
||||
|
||||
export interface AssetFields {
|
||||
__typename: "Asset";
|
||||
/**
|
||||
* The ID of the asset
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* The symbol of the asset (e.g: GBP)
|
||||
*/
|
||||
symbol: string;
|
||||
/**
|
||||
* The full name of the asset (e.g: Great British Pound)
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The precision of the asset. Should match the decimal precision of the asset on its native chain, e.g: for ERC20 assets, it is often 18
|
||||
*/
|
||||
decimals: number;
|
||||
/**
|
||||
* The origin source of the asset (e.g: an ERC20 asset)
|
||||
*/
|
||||
source: AssetFields_source;
|
||||
}
|
||||
@@ -1,119 +0,0 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @generated
|
||||
// This file was automatically generated and should not be edited.
|
||||
|
||||
import { AccountType } from "@vegaprotocol/types";
|
||||
|
||||
// ====================================================
|
||||
// GraphQL query operation: WithdrawFormQuery
|
||||
// ====================================================
|
||||
|
||||
export interface WithdrawFormQuery_party_withdrawals {
|
||||
__typename: "Withdrawal";
|
||||
/**
|
||||
* The Vega internal ID of the withdrawal
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* Hash of the transaction on the foreign chain
|
||||
*/
|
||||
txHash: string | null;
|
||||
}
|
||||
|
||||
export interface WithdrawFormQuery_party_accounts_asset {
|
||||
__typename: "Asset";
|
||||
/**
|
||||
* The ID of the asset
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* The symbol of the asset (e.g: GBP)
|
||||
*/
|
||||
symbol: string;
|
||||
}
|
||||
|
||||
export interface WithdrawFormQuery_party_accounts {
|
||||
__typename: "Account";
|
||||
/**
|
||||
* Account type (General, Margin, etc)
|
||||
*/
|
||||
type: AccountType;
|
||||
/**
|
||||
* Balance as string - current account balance (approx. as balances can be updated several times per second)
|
||||
*/
|
||||
balance: string;
|
||||
/**
|
||||
* Asset, the 'currency'
|
||||
*/
|
||||
asset: WithdrawFormQuery_party_accounts_asset;
|
||||
}
|
||||
|
||||
export interface WithdrawFormQuery_party {
|
||||
__typename: "Party";
|
||||
/**
|
||||
* Party identifier
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* The list of all withdrawals initiated by the party
|
||||
*/
|
||||
withdrawals: WithdrawFormQuery_party_withdrawals[] | null;
|
||||
/**
|
||||
* Collateral accounts relating to a party
|
||||
*/
|
||||
accounts: WithdrawFormQuery_party_accounts[] | null;
|
||||
}
|
||||
|
||||
export interface WithdrawFormQuery_assets_source_BuiltinAsset {
|
||||
__typename: "BuiltinAsset";
|
||||
}
|
||||
|
||||
export interface WithdrawFormQuery_assets_source_ERC20 {
|
||||
__typename: "ERC20";
|
||||
/**
|
||||
* The address of the ERC20 contract
|
||||
*/
|
||||
contractAddress: string;
|
||||
}
|
||||
|
||||
export type WithdrawFormQuery_assets_source = WithdrawFormQuery_assets_source_BuiltinAsset | WithdrawFormQuery_assets_source_ERC20;
|
||||
|
||||
export interface WithdrawFormQuery_assets {
|
||||
__typename: "Asset";
|
||||
/**
|
||||
* The ID of the asset
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* The symbol of the asset (e.g: GBP)
|
||||
*/
|
||||
symbol: string;
|
||||
/**
|
||||
* The full name of the asset (e.g: Great British Pound)
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The precision of the asset. Should match the decimal precision of the asset on its native chain, e.g: for ERC20 assets, it is often 18
|
||||
*/
|
||||
decimals: number;
|
||||
/**
|
||||
* The origin source of the asset (e.g: an ERC20 asset)
|
||||
*/
|
||||
source: WithdrawFormQuery_assets_source;
|
||||
}
|
||||
|
||||
export interface WithdrawFormQuery {
|
||||
/**
|
||||
* An entity that is trading on the Vega network
|
||||
*/
|
||||
party: WithdrawFormQuery_party | null;
|
||||
/**
|
||||
* The list of all assets in use in the Vega network
|
||||
*/
|
||||
assets: WithdrawFormQuery_assets[] | null;
|
||||
}
|
||||
|
||||
export interface WithdrawFormQueryVariables {
|
||||
partyId: string;
|
||||
}
|
||||
@@ -68,5 +68,5 @@ export interface DepositPage {
|
||||
/**
|
||||
* The list of all assets in use in the Vega network or the specified asset if ID is provided
|
||||
*/
|
||||
assetsConnection: DepositPage_assetsConnection;
|
||||
assetsConnection: DepositPage_assetsConnection | null;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as Types from '@vegaprotocol/types/types';
|
||||
import { Schema as Types } from '@vegaprotocol/types';
|
||||
|
||||
import { gql } from '@apollo/client';
|
||||
import * as Apollo from '@apollo/client';
|
||||
@@ -6,7 +6,7 @@ const defaultOptions = {} as const;
|
||||
export type DepositPageQueryVariables = Types.Exact<{ [key: string]: never; }>;
|
||||
|
||||
|
||||
export type DepositPageQuery = { __typename?: 'Query', assetsConnection: { __typename?: 'AssetsConnection', edges?: Array<{ __typename?: 'AssetEdge', node: { __typename?: 'Asset', id: string, symbol: string, name: string, decimals: number, source: { __typename?: 'BuiltinAsset' } | { __typename?: 'ERC20', contractAddress: string } } } | null> | null } };
|
||||
export type DepositPageQuery = { __typename?: 'Query', assetsConnection?: { __typename?: 'AssetsConnection', edges?: Array<{ __typename?: 'AssetEdge', node: { __typename?: 'Asset', id: string, symbol: string, name: string, decimals: number, source: { __typename?: 'BuiltinAsset' } | { __typename?: 'ERC20', contractAddress: string } } } | null> | null } | null };
|
||||
|
||||
|
||||
export const DepositPageDocument = gql`
|
||||
|
||||
@@ -16,5 +16,9 @@ html {
|
||||
|
||||
html.dark {
|
||||
--focus-border: theme('colors.vega.yellow');
|
||||
--separator-border: theme('colors.neutral.700');
|
||||
--separator-border: theme('colors.neutral.600');
|
||||
}
|
||||
|
||||
.border-default {
|
||||
@apply border-neutral-300 dark:border-neutral-600;
|
||||
}
|
||||
|
||||
@@ -1,34 +1,37 @@
|
||||
fragment AccountFields on Account {
|
||||
fragment AccountFields on AccountUpdate {
|
||||
type
|
||||
balance
|
||||
market {
|
||||
id
|
||||
name
|
||||
}
|
||||
asset {
|
||||
id
|
||||
symbol
|
||||
decimals
|
||||
}
|
||||
assetId
|
||||
marketId
|
||||
}
|
||||
|
||||
query Accounts($partyId: ID!) {
|
||||
party(id: $partyId) {
|
||||
id
|
||||
accountsConnection {
|
||||
edges {
|
||||
node {
|
||||
type
|
||||
balance
|
||||
accounts {
|
||||
type
|
||||
balance
|
||||
market {
|
||||
id
|
||||
tradableInstrument {
|
||||
instrument {
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
asset {
|
||||
id
|
||||
symbol
|
||||
decimals
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
subscription AccountSubscribe($partyId: ID!) {
|
||||
subscription AccountEvents($partyId: ID!) {
|
||||
accounts(partyId: $partyId) {
|
||||
type
|
||||
balance
|
||||
...AccountFields
|
||||
marketId
|
||||
assetId
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @generated
|
||||
// This file was automatically generated and should not be edited.
|
||||
|
||||
import { AccountType } from "@vegaprotocol/types";
|
||||
|
||||
// ====================================================
|
||||
// GraphQL fragment: AccountFields
|
||||
// ====================================================
|
||||
|
||||
export interface AccountFields_market_tradableInstrument_instrument {
|
||||
__typename: "Instrument";
|
||||
/**
|
||||
* Full and fairly descriptive name for the instrument
|
||||
*/
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface AccountFields_market_tradableInstrument {
|
||||
__typename: "TradableInstrument";
|
||||
/**
|
||||
* An instance of, or reference to, a fully specified instrument.
|
||||
*/
|
||||
instrument: AccountFields_market_tradableInstrument_instrument;
|
||||
}
|
||||
|
||||
export interface AccountFields_market {
|
||||
__typename: "Market";
|
||||
/**
|
||||
* Market ID
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* An instance of, or reference to, a tradable instrument.
|
||||
*/
|
||||
tradableInstrument: AccountFields_market_tradableInstrument;
|
||||
}
|
||||
|
||||
export interface AccountFields_asset {
|
||||
__typename: "Asset";
|
||||
/**
|
||||
* The ID of the asset
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* The symbol of the asset (e.g: GBP)
|
||||
*/
|
||||
symbol: string;
|
||||
/**
|
||||
* The precision of the asset. Should match the decimal precision of the asset on its native chain, e.g: for ERC20 assets, it is often 18
|
||||
*/
|
||||
decimals: number;
|
||||
}
|
||||
|
||||
export interface AccountFields {
|
||||
__typename: "Account";
|
||||
/**
|
||||
* Account type (General, Margin, etc)
|
||||
*/
|
||||
type: AccountType;
|
||||
/**
|
||||
* Balance as string - current account balance (approx. as balances can be updated several times per second)
|
||||
*/
|
||||
balance: string;
|
||||
/**
|
||||
* Market (only relevant to margin accounts)
|
||||
*/
|
||||
market: AccountFields_market | null;
|
||||
/**
|
||||
* Asset, the 'currency'
|
||||
*/
|
||||
asset: AccountFields_asset;
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @generated
|
||||
// This file was automatically generated and should not be edited.
|
||||
|
||||
import { AccountType } from "@vegaprotocol/types";
|
||||
|
||||
// ====================================================
|
||||
// GraphQL subscription operation: AccountSubscribe
|
||||
// ====================================================
|
||||
|
||||
export interface AccountSubscribe_accounts_market_tradableInstrument_instrument {
|
||||
__typename: "Instrument";
|
||||
/**
|
||||
* Full and fairly descriptive name for the instrument
|
||||
*/
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface AccountSubscribe_accounts_market_tradableInstrument {
|
||||
__typename: "TradableInstrument";
|
||||
/**
|
||||
* An instance of, or reference to, a fully specified instrument.
|
||||
*/
|
||||
instrument: AccountSubscribe_accounts_market_tradableInstrument_instrument;
|
||||
}
|
||||
|
||||
export interface AccountSubscribe_accounts_market {
|
||||
__typename: "Market";
|
||||
/**
|
||||
* Market ID
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* An instance of, or reference to, a tradable instrument.
|
||||
*/
|
||||
tradableInstrument: AccountSubscribe_accounts_market_tradableInstrument;
|
||||
}
|
||||
|
||||
export interface AccountSubscribe_accounts_asset {
|
||||
__typename: "Asset";
|
||||
/**
|
||||
* The ID of the asset
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* The symbol of the asset (e.g: GBP)
|
||||
*/
|
||||
symbol: string;
|
||||
/**
|
||||
* The precision of the asset. Should match the decimal precision of the asset on its native chain, e.g: for ERC20 assets, it is often 18
|
||||
*/
|
||||
decimals: number;
|
||||
}
|
||||
|
||||
export interface AccountSubscribe_accounts {
|
||||
__typename: "Account";
|
||||
/**
|
||||
* Account type (General, Margin, etc)
|
||||
*/
|
||||
type: AccountType;
|
||||
/**
|
||||
* Balance as string - current account balance (approx. as balances can be updated several times per second)
|
||||
*/
|
||||
balance: string;
|
||||
/**
|
||||
* Market (only relevant to margin accounts)
|
||||
*/
|
||||
market: AccountSubscribe_accounts_market | null;
|
||||
/**
|
||||
* Asset, the 'currency'
|
||||
*/
|
||||
asset: AccountSubscribe_accounts_asset;
|
||||
}
|
||||
|
||||
export interface AccountSubscribe {
|
||||
/**
|
||||
* Subscribe to the accounts updates
|
||||
*/
|
||||
accounts: AccountSubscribe_accounts;
|
||||
}
|
||||
|
||||
export interface AccountSubscribeVariables {
|
||||
partyId: string;
|
||||
}
|
||||
-97
@@ -1,97 +0,0 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @generated
|
||||
// This file was automatically generated and should not be edited.
|
||||
|
||||
import { AccountType } from "@vegaprotocol/types";
|
||||
|
||||
// ====================================================
|
||||
// GraphQL query operation: Accounts
|
||||
// ====================================================
|
||||
|
||||
export interface Accounts_party_accounts_market_tradableInstrument_instrument {
|
||||
__typename: "Instrument";
|
||||
/**
|
||||
* Full and fairly descriptive name for the instrument
|
||||
*/
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface Accounts_party_accounts_market_tradableInstrument {
|
||||
__typename: "TradableInstrument";
|
||||
/**
|
||||
* An instance of, or reference to, a fully specified instrument.
|
||||
*/
|
||||
instrument: Accounts_party_accounts_market_tradableInstrument_instrument;
|
||||
}
|
||||
|
||||
export interface Accounts_party_accounts_market {
|
||||
__typename: "Market";
|
||||
/**
|
||||
* Market ID
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* An instance of, or reference to, a tradable instrument.
|
||||
*/
|
||||
tradableInstrument: Accounts_party_accounts_market_tradableInstrument;
|
||||
}
|
||||
|
||||
export interface Accounts_party_accounts_asset {
|
||||
__typename: "Asset";
|
||||
/**
|
||||
* The ID of the asset
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* The symbol of the asset (e.g: GBP)
|
||||
*/
|
||||
symbol: string;
|
||||
/**
|
||||
* The precision of the asset. Should match the decimal precision of the asset on its native chain, e.g: for ERC20 assets, it is often 18
|
||||
*/
|
||||
decimals: number;
|
||||
}
|
||||
|
||||
export interface Accounts_party_accounts {
|
||||
__typename: "Account";
|
||||
/**
|
||||
* Account type (General, Margin, etc)
|
||||
*/
|
||||
type: AccountType;
|
||||
/**
|
||||
* Balance as string - current account balance (approx. as balances can be updated several times per second)
|
||||
*/
|
||||
balance: string;
|
||||
/**
|
||||
* Market (only relevant to margin accounts)
|
||||
*/
|
||||
market: Accounts_party_accounts_market | null;
|
||||
/**
|
||||
* Asset, the 'currency'
|
||||
*/
|
||||
asset: Accounts_party_accounts_asset;
|
||||
}
|
||||
|
||||
export interface Accounts_party {
|
||||
__typename: "Party";
|
||||
/**
|
||||
* Party identifier
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* Collateral accounts relating to a party
|
||||
*/
|
||||
accounts: Accounts_party_accounts[] | null;
|
||||
}
|
||||
|
||||
export interface Accounts {
|
||||
/**
|
||||
* An entity that is trading on the Vega network
|
||||
*/
|
||||
party: Accounts_party | null;
|
||||
}
|
||||
|
||||
export interface AccountsVariables {
|
||||
partyId: string;
|
||||
}
|
||||
@@ -1,50 +1,52 @@
|
||||
import * as Types from '@vegaprotocol/types/types';
|
||||
import { Schema as Types } from '@vegaprotocol/types';
|
||||
|
||||
import { gql } from '@apollo/client';
|
||||
import * as Apollo from '@apollo/client';
|
||||
const defaultOptions = {} as const;
|
||||
export type AccountFieldsFragment = { __typename?: 'Account', type: Types.AccountType, balance: string, market?: { __typename?: 'Market', id: string, name: string } | null, asset: { __typename?: 'Asset', id: string, symbol: string, decimals: number } };
|
||||
export type AccountFieldsFragment = { __typename?: 'AccountUpdate', type: Types.AccountType, balance: string, assetId: string, marketId?: string | null };
|
||||
|
||||
export type AccountsQueryVariables = Types.Exact<{
|
||||
partyId: Types.Scalars['ID'];
|
||||
}>;
|
||||
|
||||
|
||||
export type AccountsQuery = { __typename?: 'Query', party?: { __typename?: 'Party', id: string, accountsConnection: { __typename?: 'AccountsConnection', edges?: Array<{ __typename?: 'AccountEdge', node: { __typename?: 'Account', type: Types.AccountType, balance: string } } | null> | null } } | null };
|
||||
export type AccountsQuery = { __typename?: 'Query', party?: { __typename?: 'Party', id: string, accounts?: Array<{ __typename?: 'Account', type: Types.AccountType, balance: string, market?: { __typename?: 'Market', id: string, tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', name: string } } } | null, asset: { __typename?: 'Asset', id: string, symbol: string, decimals: number } }> | null } | null };
|
||||
|
||||
export type AccountSubscribeSubscriptionVariables = Types.Exact<{
|
||||
export type AccountEventsSubscriptionVariables = Types.Exact<{
|
||||
partyId: Types.Scalars['ID'];
|
||||
}>;
|
||||
|
||||
|
||||
export type AccountSubscribeSubscription = { __typename?: 'Subscription', accounts: { __typename?: 'Account', type: Types.AccountType, balance: string } };
|
||||
export type AccountEventsSubscription = { __typename?: 'Subscription', accounts: Array<{ __typename?: 'AccountUpdate', marketId?: string | null, assetId: string, type: Types.AccountType, balance: string }> };
|
||||
|
||||
export const AccountFieldsFragmentDoc = gql`
|
||||
fragment AccountFields on Account {
|
||||
fragment AccountFields on AccountUpdate {
|
||||
type
|
||||
balance
|
||||
market {
|
||||
id
|
||||
name
|
||||
}
|
||||
asset {
|
||||
id
|
||||
symbol
|
||||
decimals
|
||||
}
|
||||
assetId
|
||||
marketId
|
||||
}
|
||||
`;
|
||||
export const AccountsDocument = gql`
|
||||
query Accounts($partyId: ID!) {
|
||||
party(id: $partyId) {
|
||||
id
|
||||
accountsConnection {
|
||||
edges {
|
||||
node {
|
||||
type
|
||||
balance
|
||||
accounts {
|
||||
type
|
||||
balance
|
||||
market {
|
||||
id
|
||||
tradableInstrument {
|
||||
instrument {
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
asset {
|
||||
id
|
||||
symbol
|
||||
decimals
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -77,34 +79,35 @@ export function useAccountsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<A
|
||||
export type AccountsQueryHookResult = ReturnType<typeof useAccountsQuery>;
|
||||
export type AccountsLazyQueryHookResult = ReturnType<typeof useAccountsLazyQuery>;
|
||||
export type AccountsQueryResult = Apollo.QueryResult<AccountsQuery, AccountsQueryVariables>;
|
||||
export const AccountSubscribeDocument = gql`
|
||||
subscription AccountSubscribe($partyId: ID!) {
|
||||
export const AccountEventsDocument = gql`
|
||||
subscription AccountEvents($partyId: ID!) {
|
||||
accounts(partyId: $partyId) {
|
||||
type
|
||||
balance
|
||||
...AccountFields
|
||||
marketId
|
||||
assetId
|
||||
}
|
||||
}
|
||||
`;
|
||||
${AccountFieldsFragmentDoc}`;
|
||||
|
||||
/**
|
||||
* __useAccountSubscribeSubscription__
|
||||
* __useAccountEventsSubscription__
|
||||
*
|
||||
* To run a query within a React component, call `useAccountSubscribeSubscription` and pass it any options that fit your needs.
|
||||
* When your component renders, `useAccountSubscribeSubscription` returns an object from Apollo Client that contains loading, error, and data properties
|
||||
* To run a query within a React component, call `useAccountEventsSubscription` and pass it any options that fit your needs.
|
||||
* When your component renders, `useAccountEventsSubscription` returns an object from Apollo Client that contains loading, error, and data properties
|
||||
* you can use to render your UI.
|
||||
*
|
||||
* @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
|
||||
*
|
||||
* @example
|
||||
* const { data, loading, error } = useAccountSubscribeSubscription({
|
||||
* const { data, loading, error } = useAccountEventsSubscription({
|
||||
* variables: {
|
||||
* partyId: // value for 'partyId'
|
||||
* },
|
||||
* });
|
||||
*/
|
||||
export function useAccountSubscribeSubscription(baseOptions: Apollo.SubscriptionHookOptions<AccountSubscribeSubscription, AccountSubscribeSubscriptionVariables>) {
|
||||
export function useAccountEventsSubscription(baseOptions: Apollo.SubscriptionHookOptions<AccountEventsSubscription, AccountEventsSubscriptionVariables>) {
|
||||
const options = {...defaultOptions, ...baseOptions}
|
||||
return Apollo.useSubscription<AccountSubscribeSubscription, AccountSubscribeSubscriptionVariables>(AccountSubscribeDocument, options);
|
||||
return Apollo.useSubscription<AccountEventsSubscription, AccountEventsSubscriptionVariables>(AccountEventsDocument, options);
|
||||
}
|
||||
export type AccountSubscribeSubscriptionHookResult = ReturnType<typeof useAccountSubscribeSubscription>;
|
||||
export type AccountSubscribeSubscriptionResult = Apollo.SubscriptionResult<AccountSubscribeSubscription>;
|
||||
export type AccountEventsSubscriptionHookResult = ReturnType<typeof useAccountEventsSubscription>;
|
||||
export type AccountEventsSubscriptionResult = Apollo.SubscriptionResult<AccountEventsSubscription>;
|
||||
@@ -1,91 +1,91 @@
|
||||
import produce from 'immer';
|
||||
import { gql } from '@apollo/client';
|
||||
import {
|
||||
AccountsDocument,
|
||||
AccountEventsDocument,
|
||||
} from './__generated___/Accounts';
|
||||
import type {
|
||||
Accounts,
|
||||
Accounts_party_accounts,
|
||||
} from './__generated__/Accounts';
|
||||
AccountsQuery,
|
||||
AccountEventsSubscription,
|
||||
AccountFieldsFragment,
|
||||
} from './__generated___/Accounts';
|
||||
import { makeDataProvider } from '@vegaprotocol/react-helpers';
|
||||
import type { AccountType } from '@vegaprotocol/types';
|
||||
|
||||
import type {
|
||||
AccountSubscribe,
|
||||
AccountSubscribe_accounts,
|
||||
} from './__generated__/AccountSubscribe';
|
||||
interface Account {
|
||||
type: AccountType;
|
||||
balance: string;
|
||||
market: {
|
||||
id: string;
|
||||
name: string;
|
||||
} | null;
|
||||
asset: {
|
||||
symbol: string;
|
||||
decimals: number;
|
||||
};
|
||||
}
|
||||
|
||||
const ACCOUNTS_FRAGMENT = gql`
|
||||
fragment AccountFields on Account {
|
||||
type
|
||||
balance
|
||||
market {
|
||||
id
|
||||
tradableInstrument {
|
||||
instrument {
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
asset {
|
||||
id
|
||||
symbol
|
||||
decimals
|
||||
}
|
||||
}
|
||||
`;
|
||||
export const getId = (data: Account) =>
|
||||
`${data.type}-${data.asset.symbol}-${data.market?.id ?? 'null'}`;
|
||||
|
||||
const ACCOUNTS_QUERY = gql`
|
||||
${ACCOUNTS_FRAGMENT}
|
||||
query Accounts($partyId: ID!) {
|
||||
party(id: $partyId) {
|
||||
id
|
||||
accounts {
|
||||
...AccountFields
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const ACCOUNTS_SUB = gql`
|
||||
${ACCOUNTS_FRAGMENT}
|
||||
subscription AccountSubscribe($partyId: ID!) {
|
||||
accounts(partyId: $partyId) {
|
||||
...AccountFields
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const getId = (
|
||||
data: Accounts_party_accounts | AccountSubscribe_accounts
|
||||
) => `${data.type}-${data.asset.symbol}-${data.market?.id ?? 'null'}`;
|
||||
|
||||
const update = (
|
||||
data: Accounts_party_accounts[],
|
||||
delta: AccountSubscribe_accounts
|
||||
) => {
|
||||
const update = (data: Account[], delta: Account[]) => {
|
||||
return produce(data, (draft) => {
|
||||
// @ts-ignore FIXME stagnet3 update
|
||||
const id = getId(delta);
|
||||
const index = draft.findIndex((a) => getId(a) === id);
|
||||
if (index !== -1) {
|
||||
// @ts-ignore FIXME stagnet3 update
|
||||
draft[index] = delta;
|
||||
} else {
|
||||
// @ts-ignore FIXME stagnet3 update
|
||||
draft.push(delta);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const getData = (responseData: Accounts): Accounts_party_accounts[] | null =>
|
||||
responseData.party ? responseData.party.accounts : null;
|
||||
const getDelta = (
|
||||
subscriptionData: AccountSubscribe
|
||||
): AccountSubscribe_accounts => subscriptionData.accounts;
|
||||
const getData = (responseData: AccountsQuery): Account[] | null => {
|
||||
if (!responseData?.party?.accounts?.length) return null;
|
||||
return responseData.party?.accounts?.map((a) => {
|
||||
return {
|
||||
type: a.type,
|
||||
balance: a.balance,
|
||||
market: a.market
|
||||
? {
|
||||
id: a.market.id,
|
||||
name: a.market.tradableInstrument.instrument.name,
|
||||
}
|
||||
: null,
|
||||
asset: {
|
||||
symbol: a.asset.symbol,
|
||||
decimals: a.asset.decimals,
|
||||
},
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
const getDelta = (subscriptionData: AccountEventsSubscription): Account[] => {
|
||||
// return subscriptionData.accounts
|
||||
|
||||
// what to do here?
|
||||
// @ts-ignore how to retrieve market data for each account?
|
||||
return subscriptionData.accounts.map((a) => ({
|
||||
type: a.type,
|
||||
balance: a.balance,
|
||||
asset: {},
|
||||
market: a.marketId ? {} : null,
|
||||
}));
|
||||
};
|
||||
|
||||
export const accountsDataProvider = makeDataProvider<
|
||||
Accounts,
|
||||
Accounts_party_accounts[],
|
||||
AccountSubscribe,
|
||||
AccountSubscribe_accounts
|
||||
AccountsQuery,
|
||||
Account[],
|
||||
AccountEventsSubscription,
|
||||
AccountFieldsFragment
|
||||
>({
|
||||
query: ACCOUNTS_QUERY,
|
||||
subscriptionQuery: ACCOUNTS_SUB,
|
||||
query: AccountsDocument,
|
||||
subscriptionQuery: AccountEventsDocument,
|
||||
// @ts-ignore FIXME stagnet3 update
|
||||
update,
|
||||
getData,
|
||||
// @ts-ignore FIXME stagnet3 update
|
||||
getDelta,
|
||||
});
|
||||
|
||||
@@ -3,8 +3,7 @@ import { produce } from 'immer';
|
||||
import merge from 'lodash/merge';
|
||||
import { AsyncRenderer } from '@vegaprotocol/ui-toolkit';
|
||||
import { useDataProvider, addSummaryRows } from '@vegaprotocol/react-helpers';
|
||||
import type { AccountSubscribe_accounts } from './__generated__/AccountSubscribe';
|
||||
import type { Accounts_party_accounts } from './__generated__/Accounts';
|
||||
import type { AccountFieldsFragment } from './__generated__/Accounts';
|
||||
|
||||
import type { AgGridReact } from 'ag-grid-react';
|
||||
import {
|
||||
@@ -22,17 +21,17 @@ export const AccountsManager = ({ partyId }: AccountsManagerProps) => {
|
||||
const gridRef = useRef<AgGridReact | null>(null);
|
||||
const variables = useMemo(() => ({ partyId }), [partyId]);
|
||||
const update = useCallback(
|
||||
({ delta }: { delta: AccountSubscribe_accounts }) => {
|
||||
const update: Accounts_party_accounts[] = [];
|
||||
const add: Accounts_party_accounts[] = [];
|
||||
({ delta }: { delta: AccountFieldsFragment }) => {
|
||||
const update: AccountFieldsFragment[] = [];
|
||||
const add: AccountFieldsFragment[] = [];
|
||||
if (!gridRef.current?.api) {
|
||||
return false;
|
||||
}
|
||||
const rowNode = gridRef.current.api.getRowNode(getId(delta));
|
||||
if (rowNode) {
|
||||
const updatedData = produce<Accounts_party_accounts>(
|
||||
const updatedData = produce<AccountFieldsFragment>(
|
||||
rowNode.data,
|
||||
(draft: Accounts_party_accounts) => {
|
||||
(draft: AccountFieldsFragment) => {
|
||||
merge(draft, delta);
|
||||
}
|
||||
);
|
||||
@@ -62,8 +61,8 @@ export const AccountsManager = ({ partyId }: AccountsManagerProps) => {
|
||||
[gridRef]
|
||||
);
|
||||
const { data, error, loading } = useDataProvider<
|
||||
Accounts_party_accounts[],
|
||||
AccountSubscribe_accounts
|
||||
AccountFieldsFragment[],
|
||||
AccountFieldsFragment
|
||||
>({ dataProvider: accountsDataProvider, update, variables });
|
||||
return (
|
||||
<AsyncRenderer loading={loading} error={error} data={data}>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import AccountsTable from './accounts-table';
|
||||
import { act, render, screen, waitFor } from '@testing-library/react';
|
||||
import type { Accounts_party_accounts } from './__generated__/Accounts';
|
||||
import type { AccountFieldsFragment } from './__generated__/Accounts';
|
||||
import { AccountType } from '@vegaprotocol/types';
|
||||
|
||||
const singleRow: Accounts_party_accounts = {
|
||||
const singleRow: AccountFieldsFragment = {
|
||||
__typename: 'Account',
|
||||
type: AccountType.ACCOUNT_TYPE_MARGIN,
|
||||
balance: '125600000',
|
||||
|
||||
@@ -14,22 +14,22 @@ import type { SummaryRow } from '@vegaprotocol/react-helpers';
|
||||
import { AgGridDynamic as AgGrid } from '@vegaprotocol/ui-toolkit';
|
||||
import { AgGridColumn } from 'ag-grid-react';
|
||||
import type { AgGridReact } from 'ag-grid-react';
|
||||
import type { Accounts_party_accounts } from './__generated__/Accounts';
|
||||
import type { AccountFieldsFragment } from './__generated__/Accounts';
|
||||
import { getId } from './accounts-data-provider';
|
||||
import { useAssetDetailsDialogStore } from '@vegaprotocol/assets';
|
||||
import type { AccountType } from '@vegaprotocol/types';
|
||||
import { AccountTypeMapping } from '@vegaprotocol/types';
|
||||
|
||||
interface AccountsTableProps {
|
||||
data: Accounts_party_accounts[] | null;
|
||||
data: AccountFieldsFragment[] | null;
|
||||
}
|
||||
|
||||
interface AccountsTableValueFormatterParams extends ValueFormatterParams {
|
||||
data: Accounts_party_accounts;
|
||||
data: AccountFieldsFragment;
|
||||
}
|
||||
|
||||
export const getGroupId = (
|
||||
data: Accounts_party_accounts & SummaryRow,
|
||||
data: AccountFieldsFragment & SummaryRow,
|
||||
columnApi: ColumnApi
|
||||
) => {
|
||||
if (data.__summaryRow) {
|
||||
@@ -44,9 +44,9 @@ export const getGroupId = (
|
||||
};
|
||||
|
||||
export const getGroupSummaryRow = (
|
||||
data: Accounts_party_accounts[],
|
||||
data: AccountFieldsFragment[],
|
||||
columnApi: ColumnApi
|
||||
): Partial<Accounts_party_accounts & SummaryRow> | null => {
|
||||
): Partial<AccountFieldsFragment & SummaryRow> | null => {
|
||||
if (!data.length) {
|
||||
return null;
|
||||
}
|
||||
@@ -67,8 +67,8 @@ export const getGroupSummaryRow = (
|
||||
const comparator = (
|
||||
valueA: string,
|
||||
valueB: string,
|
||||
nodeA: { data: Accounts_party_accounts & SummaryRow },
|
||||
nodeB: { data: Accounts_party_accounts & SummaryRow },
|
||||
nodeA: { data: AccountFieldsFragment & SummaryRow },
|
||||
nodeB: { data: AccountFieldsFragment & SummaryRow },
|
||||
isInverted: boolean
|
||||
) => {
|
||||
if (valueA < valueB) {
|
||||
|
||||
@@ -3,8 +3,7 @@ import {
|
||||
addDecimalsFormatNumber,
|
||||
useDataProvider,
|
||||
} from '@vegaprotocol/react-helpers';
|
||||
import type { AccountSubscribe_accounts } from './__generated__/AccountSubscribe';
|
||||
import type { Accounts_party_accounts } from './__generated__/Accounts';
|
||||
import type { AccountFieldsFragment } from './__generated__/Accounts';
|
||||
|
||||
import { accountsDataProvider } from './accounts-data-provider';
|
||||
|
||||
@@ -16,8 +15,8 @@ interface AssetBalanceProps {
|
||||
export const AssetBalance = ({ partyId, assetSymbol }: AssetBalanceProps) => {
|
||||
const variables = useMemo(() => ({ partyId }), [partyId]);
|
||||
const { data } = useDataProvider<
|
||||
Accounts_party_accounts[],
|
||||
AccountSubscribe_accounts
|
||||
AccountFieldsFragment[],
|
||||
AccountFieldsFragment
|
||||
>({
|
||||
dataProvider: accountsDataProvider,
|
||||
variables,
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
export * from './__generated__/Accounts';
|
||||
export * from './__generated__/AccountFields';
|
||||
export * from './__generated__/AccountSubscribe';
|
||||
export * from './accounts-container';
|
||||
export * from './accounts-data-provider';
|
||||
export * from './accounts-manager';
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @generated
|
||||
// This file was automatically generated and should not be edited.
|
||||
|
||||
// ====================================================
|
||||
// GraphQL query operation: AssetsConnection
|
||||
// ====================================================
|
||||
|
||||
export interface AssetsConnection_assetsConnection_edges_node_source_BuiltinAsset {
|
||||
__typename: "BuiltinAsset";
|
||||
}
|
||||
|
||||
export interface AssetsConnection_assetsConnection_edges_node_source_ERC20 {
|
||||
__typename: "ERC20";
|
||||
/**
|
||||
* The address of the ERC20 contract
|
||||
*/
|
||||
contractAddress: string;
|
||||
/**
|
||||
* The lifetime limits deposit per address
|
||||
* Note: this is a temporary measure for alpha mainnet
|
||||
*/
|
||||
lifetimeLimit: string;
|
||||
/**
|
||||
* The maximum allowed per withdrawal
|
||||
* Note: this is a temporary measure for alpha mainnet
|
||||
*/
|
||||
withdrawThreshold: string;
|
||||
}
|
||||
|
||||
export type AssetsConnection_assetsConnection_edges_node_source = AssetsConnection_assetsConnection_edges_node_source_BuiltinAsset | AssetsConnection_assetsConnection_edges_node_source_ERC20;
|
||||
|
||||
export interface AssetsConnection_assetsConnection_edges_node {
|
||||
__typename: "Asset";
|
||||
/**
|
||||
* The ID of the asset
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* The full name of the asset (e.g: Great British Pound)
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The symbol of the asset (e.g: GBP)
|
||||
*/
|
||||
symbol: string;
|
||||
/**
|
||||
* The precision of the asset. Should match the decimal precision of the asset on its native chain, e.g: for ERC20 assets, it is often 18
|
||||
*/
|
||||
decimals: number;
|
||||
/**
|
||||
* The minimum economically meaningful amount in the asset
|
||||
*/
|
||||
quantum: string;
|
||||
/**
|
||||
* The origin source of the asset (e.g: an ERC20 asset)
|
||||
*/
|
||||
source: AssetsConnection_assetsConnection_edges_node_source;
|
||||
}
|
||||
|
||||
export interface AssetsConnection_assetsConnection_edges {
|
||||
__typename: "AssetEdge";
|
||||
node: AssetsConnection_assetsConnection_edges_node;
|
||||
}
|
||||
|
||||
export interface AssetsConnection_assetsConnection {
|
||||
__typename: "AssetsConnection";
|
||||
/**
|
||||
* The assets
|
||||
*/
|
||||
edges: (AssetsConnection_assetsConnection_edges | null)[] | null;
|
||||
}
|
||||
|
||||
export interface AssetsConnection {
|
||||
/**
|
||||
* The list of all assets in use in the Vega network or the specified asset if ID is provided
|
||||
*/
|
||||
assetsConnection: AssetsConnection_assetsConnection;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as Types from '@vegaprotocol/types/types';
|
||||
import { Schema as Types } from '@vegaprotocol/types';
|
||||
|
||||
import { gql } from '@apollo/client';
|
||||
import * as Apollo from '@apollo/client';
|
||||
@@ -6,7 +6,7 @@ const defaultOptions = {} as const;
|
||||
export type AssetsConnectionQueryVariables = Types.Exact<{ [key: string]: never; }>;
|
||||
|
||||
|
||||
export type AssetsConnectionQuery = { __typename?: 'Query', assetsConnection: { __typename?: 'AssetsConnection', edges?: Array<{ __typename?: 'AssetEdge', node: { __typename?: 'Asset', id: string, name: string, symbol: string, decimals: number, quantum: string, source: { __typename?: 'BuiltinAsset' } | { __typename?: 'ERC20', contractAddress: string, lifetimeLimit: string, withdrawThreshold: string } } } | null> | null } };
|
||||
export type AssetsConnectionQuery = { __typename?: 'Query', assetsConnection?: { __typename?: 'AssetsConnection', edges?: Array<{ __typename?: 'AssetEdge', node: { __typename?: 'Asset', id: string, name: string, symbol: string, decimals: number, quantum: string, source: { __typename?: 'BuiltinAsset' } | { __typename?: 'ERC20', contractAddress: string, lifetimeLimit: string, withdrawThreshold: string } } } | null> | null } | null };
|
||||
|
||||
|
||||
export const AssetsConnectionDocument = gql`
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import { MockedProvider } from '@apollo/react-testing';
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import {
|
||||
AssetDetailsDialog,
|
||||
ASSETS_CONNECTION_QUERY,
|
||||
} from './asset-details-dialog';
|
||||
import { AssetDetailsDialog } from './asset-details-dialog';
|
||||
import { AssetsConnectionDocument } from './__generated__/Assets';
|
||||
|
||||
const mockedData = {
|
||||
data: {
|
||||
@@ -275,7 +273,7 @@ const mockedData = {
|
||||
const mocks = [
|
||||
{
|
||||
request: {
|
||||
query: ASSETS_CONNECTION_QUERY,
|
||||
query: AssetsConnectionDocument,
|
||||
variables: {},
|
||||
},
|
||||
result: mockedData,
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { gql, useQuery } from '@apollo/client';
|
||||
import { t } from '@vegaprotocol/react-helpers';
|
||||
import type { Asset } from '@vegaprotocol/react-helpers';
|
||||
import {
|
||||
@@ -10,11 +9,9 @@ import {
|
||||
Splash,
|
||||
Tooltip,
|
||||
} from '@vegaprotocol/ui-toolkit';
|
||||
import type {
|
||||
AssetsConnection,
|
||||
AssetsConnection_assetsConnection_edges_node_source_ERC20,
|
||||
} from './__generated__/AssetsConnection';
|
||||
import type { Schema } from '@vegaprotocol/types';
|
||||
import create from 'zustand';
|
||||
import { useAssetsConnectionQuery } from './__generated___/Assets';
|
||||
|
||||
export type AssetDetailsDialogStore = {
|
||||
isAssetDetailsDialogOpen: boolean;
|
||||
@@ -43,29 +40,6 @@ type AssetDetails = {
|
||||
tooltip: string;
|
||||
}[];
|
||||
|
||||
export const ASSETS_CONNECTION_QUERY = gql`
|
||||
query AssetsConnection {
|
||||
assetsConnection {
|
||||
edges {
|
||||
node {
|
||||
id
|
||||
name
|
||||
symbol
|
||||
decimals
|
||||
quantum
|
||||
source {
|
||||
... on ERC20 {
|
||||
contractAddress
|
||||
lifetimeLimit
|
||||
withdrawThreshold
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export interface AssetDetailsDialogProps {
|
||||
assetSymbol: string | Asset;
|
||||
open: boolean;
|
||||
@@ -77,10 +51,10 @@ export const AssetDetailsDialog = ({
|
||||
open,
|
||||
onChange,
|
||||
}: AssetDetailsDialogProps) => {
|
||||
const { data } = useQuery<AssetsConnection>(ASSETS_CONNECTION_QUERY);
|
||||
const { data } = useAssetsConnectionQuery();
|
||||
const symbol =
|
||||
typeof assetSymbol === 'string' ? assetSymbol : assetSymbol.symbol;
|
||||
const asset = data?.assetsConnection.edges?.find(
|
||||
const asset = data?.assetsConnection?.edges?.find(
|
||||
(e) => e?.node.symbol === symbol
|
||||
);
|
||||
|
||||
@@ -114,10 +88,7 @@ export const AssetDetailsDialog = ({
|
||||
{
|
||||
key: 'contractaddress',
|
||||
label: t('Contract address'),
|
||||
value: (
|
||||
asset.node
|
||||
.source as AssetsConnection_assetsConnection_edges_node_source_ERC20
|
||||
).contractAddress,
|
||||
value: (asset.node.source as Schema.ERC20).contractAddress,
|
||||
tooltip: t(
|
||||
'The address of the contract for the token, on the ethereum network'
|
||||
),
|
||||
@@ -125,10 +96,7 @@ export const AssetDetailsDialog = ({
|
||||
{
|
||||
key: 'withdrawalthreshold',
|
||||
label: t('Withdrawal threshold'),
|
||||
value: (
|
||||
asset.node
|
||||
.source as AssetsConnection_assetsConnection_edges_node_source_ERC20
|
||||
).withdrawThreshold,
|
||||
value: (asset.node.source as Schema.ERC20).withdrawThreshold,
|
||||
tooltip: t(
|
||||
'The maximum allowed per withdraw note: this is a temporary measure for restricted mainnet'
|
||||
),
|
||||
@@ -136,10 +104,7 @@ export const AssetDetailsDialog = ({
|
||||
{
|
||||
key: 'lifetimelimit',
|
||||
label: t('Lifetime limit'),
|
||||
value: (
|
||||
asset.node
|
||||
.source as AssetsConnection_assetsConnection_edges_node_source_ERC20
|
||||
).lifetimeLimit,
|
||||
value: (asset.node.source as Schema.ERC20).lifetimeLimit,
|
||||
tooltip: t(
|
||||
'The lifetime limits deposit per address note: this is a temporary measure for restricted mainnet'
|
||||
),
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
export * from './__generated__/AssetsConnection';
|
||||
export * from './__generated___/Assets';
|
||||
export * from './asset-details-dialog';
|
||||
|
||||
@@ -24,7 +24,7 @@ query Candles($marketId: ID!, $interval: Interval!, $since: String!) {
|
||||
}
|
||||
}
|
||||
|
||||
subscription CandlesSub($marketId: ID!, $interval: Interval!) {
|
||||
subscription CandlesEvents($marketId: ID!, $interval: Interval!) {
|
||||
candles(marketId: $marketId, interval: $interval) {
|
||||
...CandleFields
|
||||
}
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @generated
|
||||
// This file was automatically generated and should not be edited.
|
||||
|
||||
// ====================================================
|
||||
// GraphQL fragment: CandleFields
|
||||
// ====================================================
|
||||
|
||||
export interface CandleFields {
|
||||
__typename: "Candle";
|
||||
/**
|
||||
* RFC3339Nano formatted date and time for the candle
|
||||
*/
|
||||
datetime: string;
|
||||
/**
|
||||
* High price (uint64)
|
||||
*/
|
||||
high: string;
|
||||
/**
|
||||
* Low price (uint64)
|
||||
*/
|
||||
low: string;
|
||||
/**
|
||||
* Open price (uint64)
|
||||
*/
|
||||
open: string;
|
||||
/**
|
||||
* Close price (uint64)
|
||||
*/
|
||||
close: string;
|
||||
/**
|
||||
* Volume price (uint64)
|
||||
*/
|
||||
volume: string;
|
||||
}
|
||||
+105
-100
@@ -1,108 +1,113 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @generated
|
||||
// This file was automatically generated and should not be edited.
|
||||
import { Schema as Types } from '@vegaprotocol/types';
|
||||
|
||||
import { Interval } from "@vegaprotocol/types";
|
||||
import { gql } from '@apollo/client';
|
||||
import * as Apollo from '@apollo/client';
|
||||
const defaultOptions = {} as const;
|
||||
export type CandleFieldsFragment = { __typename?: 'Candle', datetime: string, high: string, low: string, open: string, close: string, volume: string };
|
||||
|
||||
// ====================================================
|
||||
// GraphQL query operation: Candles
|
||||
// ====================================================
|
||||
export type CandlesQueryVariables = Types.Exact<{
|
||||
marketId: Types.Scalars['ID'];
|
||||
interval: Types.Interval;
|
||||
since: Types.Scalars['String'];
|
||||
}>;
|
||||
|
||||
export interface Candles_market_tradableInstrument_instrument {
|
||||
__typename: "Instrument";
|
||||
/**
|
||||
* Uniquely identify an instrument across all instruments available on Vega (string)
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* Full and fairly descriptive name for the instrument
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* A short non necessarily unique code used to easily describe the instrument (e.g: FX:BTCUSD/DEC18) (string)
|
||||
*/
|
||||
code: string;
|
||||
|
||||
export type CandlesQuery = { __typename?: 'Query', market?: { __typename?: 'Market', id: string, decimalPlaces: number, tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', id: string, name: string, code: string } }, candles?: Array<{ __typename?: 'Candle', datetime: string, high: string, low: string, open: string, close: string, volume: string } | null> | null } | null };
|
||||
|
||||
export type CandlesEventsSubscriptionVariables = Types.Exact<{
|
||||
marketId: Types.Scalars['ID'];
|
||||
interval: Types.Interval;
|
||||
}>;
|
||||
|
||||
|
||||
export type CandlesEventsSubscription = { __typename?: 'Subscription', candles: { __typename?: 'Candle', datetime: string, high: string, low: string, open: string, close: string, volume: string } };
|
||||
|
||||
export const CandleFieldsFragmentDoc = gql`
|
||||
fragment CandleFields on Candle {
|
||||
datetime
|
||||
high
|
||||
low
|
||||
open
|
||||
close
|
||||
volume
|
||||
}
|
||||
|
||||
export interface Candles_market_tradableInstrument {
|
||||
__typename: "TradableInstrument";
|
||||
/**
|
||||
* An instance of, or reference to, a fully specified instrument.
|
||||
*/
|
||||
instrument: Candles_market_tradableInstrument_instrument;
|
||||
`;
|
||||
export const CandlesDocument = gql`
|
||||
query Candles($marketId: ID!, $interval: Interval!, $since: String!) {
|
||||
market(id: $marketId) {
|
||||
id
|
||||
decimalPlaces
|
||||
tradableInstrument {
|
||||
instrument {
|
||||
id
|
||||
name
|
||||
code
|
||||
}
|
||||
}
|
||||
candles(interval: $interval, since: $since) {
|
||||
...CandleFields
|
||||
}
|
||||
}
|
||||
}
|
||||
${CandleFieldsFragmentDoc}`;
|
||||
|
||||
export interface Candles_market_candles {
|
||||
__typename: "Candle";
|
||||
/**
|
||||
* RFC3339Nano formatted date and time for the candle
|
||||
*/
|
||||
datetime: string;
|
||||
/**
|
||||
* High price (uint64)
|
||||
*/
|
||||
high: string;
|
||||
/**
|
||||
* Low price (uint64)
|
||||
*/
|
||||
low: string;
|
||||
/**
|
||||
* Open price (uint64)
|
||||
*/
|
||||
open: string;
|
||||
/**
|
||||
* Close price (uint64)
|
||||
*/
|
||||
close: string;
|
||||
/**
|
||||
* Volume price (uint64)
|
||||
*/
|
||||
volume: string;
|
||||
/**
|
||||
* __useCandlesQuery__
|
||||
*
|
||||
* To run a query within a React component, call `useCandlesQuery` and pass it any options that fit your needs.
|
||||
* When your component renders, `useCandlesQuery` returns an object from Apollo Client that contains loading, error, and data properties
|
||||
* you can use to render your UI.
|
||||
*
|
||||
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
|
||||
*
|
||||
* @example
|
||||
* const { data, loading, error } = useCandlesQuery({
|
||||
* variables: {
|
||||
* marketId: // value for 'marketId'
|
||||
* interval: // value for 'interval'
|
||||
* since: // value for 'since'
|
||||
* },
|
||||
* });
|
||||
*/
|
||||
export function useCandlesQuery(baseOptions: Apollo.QueryHookOptions<CandlesQuery, CandlesQueryVariables>) {
|
||||
const options = {...defaultOptions, ...baseOptions}
|
||||
return Apollo.useQuery<CandlesQuery, CandlesQueryVariables>(CandlesDocument, options);
|
||||
}
|
||||
export function useCandlesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<CandlesQuery, CandlesQueryVariables>) {
|
||||
const options = {...defaultOptions, ...baseOptions}
|
||||
return Apollo.useLazyQuery<CandlesQuery, CandlesQueryVariables>(CandlesDocument, options);
|
||||
}
|
||||
export type CandlesQueryHookResult = ReturnType<typeof useCandlesQuery>;
|
||||
export type CandlesLazyQueryHookResult = ReturnType<typeof useCandlesLazyQuery>;
|
||||
export type CandlesQueryResult = Apollo.QueryResult<CandlesQuery, CandlesQueryVariables>;
|
||||
export const CandlesEventsDocument = gql`
|
||||
subscription CandlesEvents($marketId: ID!, $interval: Interval!) {
|
||||
candles(marketId: $marketId, interval: $interval) {
|
||||
...CandleFields
|
||||
}
|
||||
}
|
||||
${CandleFieldsFragmentDoc}`;
|
||||
|
||||
export interface Candles_market {
|
||||
__typename: "Market";
|
||||
/**
|
||||
* Market ID
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* decimalPlaces indicates the number of decimal places that an integer must be shifted by in order to get a correct
|
||||
* number denominated in the currency of the market. (uint64)
|
||||
*
|
||||
* Examples:
|
||||
* Currency Balance decimalPlaces Real Balance
|
||||
* GBP 100 0 GBP 100
|
||||
* GBP 100 2 GBP 1.00
|
||||
* GBP 100 4 GBP 0.01
|
||||
* GBP 1 4 GBP 0.0001 ( 0.01p )
|
||||
*
|
||||
* GBX (pence) 100 0 GBP 1.00 (100p )
|
||||
* GBX (pence) 100 2 GBP 0.01 ( 1p )
|
||||
* GBX (pence) 100 4 GBP 0.0001 ( 0.01p )
|
||||
* GBX (pence) 1 4 GBP 0.000001 ( 0.0001p)
|
||||
*/
|
||||
decimalPlaces: number;
|
||||
/**
|
||||
* An instance of, or reference to, a tradable instrument.
|
||||
*/
|
||||
tradableInstrument: Candles_market_tradableInstrument;
|
||||
/**
|
||||
* Candles on a market, for the 'last' n candles, at 'interval' seconds as specified by parameters
|
||||
*/
|
||||
candles: (Candles_market_candles | null)[] | null;
|
||||
}
|
||||
|
||||
export interface Candles {
|
||||
/**
|
||||
* An instrument that is trading on the Vega network
|
||||
*/
|
||||
market: Candles_market | null;
|
||||
}
|
||||
|
||||
export interface CandlesVariables {
|
||||
marketId: string;
|
||||
interval: Interval;
|
||||
since: string;
|
||||
}
|
||||
/**
|
||||
* __useCandlesEventsSubscription__
|
||||
*
|
||||
* To run a query within a React component, call `useCandlesEventsSubscription` and pass it any options that fit your needs.
|
||||
* When your component renders, `useCandlesEventsSubscription` returns an object from Apollo Client that contains loading, error, and data properties
|
||||
* you can use to render your UI.
|
||||
*
|
||||
* @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
|
||||
*
|
||||
* @example
|
||||
* const { data, loading, error } = useCandlesEventsSubscription({
|
||||
* variables: {
|
||||
* marketId: // value for 'marketId'
|
||||
* interval: // value for 'interval'
|
||||
* },
|
||||
* });
|
||||
*/
|
||||
export function useCandlesEventsSubscription(baseOptions: Apollo.SubscriptionHookOptions<CandlesEventsSubscription, CandlesEventsSubscriptionVariables>) {
|
||||
const options = {...defaultOptions, ...baseOptions}
|
||||
return Apollo.useSubscription<CandlesEventsSubscription, CandlesEventsSubscriptionVariables>(CandlesEventsDocument, options);
|
||||
}
|
||||
export type CandlesEventsSubscriptionHookResult = ReturnType<typeof useCandlesEventsSubscription>;
|
||||
export type CandlesEventsSubscriptionResult = Apollo.SubscriptionResult<CandlesEventsSubscription>;
|
||||
@@ -1,50 +0,0 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @generated
|
||||
// This file was automatically generated and should not be edited.
|
||||
|
||||
import { Interval } from "@vegaprotocol/types";
|
||||
|
||||
// ====================================================
|
||||
// GraphQL subscription operation: CandlesSub
|
||||
// ====================================================
|
||||
|
||||
export interface CandlesSub_candles {
|
||||
__typename: "Candle";
|
||||
/**
|
||||
* RFC3339Nano formatted date and time for the candle
|
||||
*/
|
||||
datetime: string;
|
||||
/**
|
||||
* High price (uint64)
|
||||
*/
|
||||
high: string;
|
||||
/**
|
||||
* Low price (uint64)
|
||||
*/
|
||||
low: string;
|
||||
/**
|
||||
* Open price (uint64)
|
||||
*/
|
||||
open: string;
|
||||
/**
|
||||
* Close price (uint64)
|
||||
*/
|
||||
close: string;
|
||||
/**
|
||||
* Volume price (uint64)
|
||||
*/
|
||||
volume: string;
|
||||
}
|
||||
|
||||
export interface CandlesSub {
|
||||
/**
|
||||
* Subscribe to the candles updates
|
||||
*/
|
||||
candles: CandlesSub_candles;
|
||||
}
|
||||
|
||||
export interface CandlesSubVariables {
|
||||
marketId: string;
|
||||
interval: Interval;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user