Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6bcae926f5 | ||
|
|
1d721dc748 | ||
|
|
1d71a839b3 | ||
|
|
6344074574 |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 547 B |
|
Before Width: | Height: | Size: 1.5 KiB |
@@ -1,22 +0,0 @@
|
||||
{
|
||||
"name": "Vega Protocol - Trading",
|
||||
"short_name": "Console",
|
||||
"description": "Vega Protocol - Trading dApp",
|
||||
"start_url": "/",
|
||||
"display": "standalone",
|
||||
"orientation": "portrait",
|
||||
"theme_color": "#000000",
|
||||
"background_color": "#ffffff",
|
||||
"icons": [
|
||||
{
|
||||
"src": "favicon.ico",
|
||||
"sizes": "64x64 32x32 24x24 16x16",
|
||||
"type": "image/x-icon"
|
||||
},
|
||||
{
|
||||
"src": "logo192.png",
|
||||
"type": "image/png",
|
||||
"sizes": "192x192"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -4,11 +4,10 @@ export default function Document() {
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
{/*
|
||||
meta tags
|
||||
- next advised against using _document for this, so they exist in our
|
||||
- single page index.page.tsx
|
||||
*/}
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1.0, user-scalable=no"
|
||||
/>
|
||||
|
||||
{/* preload fonts */}
|
||||
<link
|
||||
@@ -18,15 +17,38 @@ export default function Document() {
|
||||
type="font/woff"
|
||||
/>
|
||||
|
||||
<link
|
||||
rel="preload"
|
||||
href="/AlphaLyrae.woff2"
|
||||
as="font"
|
||||
type="font/woff2"
|
||||
/>
|
||||
|
||||
{/* icons */}
|
||||
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
|
||||
<link rel="apple-touch-icon" content="/favicon.ico" />
|
||||
<link
|
||||
rel="apple-touch-icon"
|
||||
sizes="180x180"
|
||||
href="/apple-touch-icon.png"
|
||||
/>
|
||||
<link
|
||||
rel="icon"
|
||||
type="image/png"
|
||||
sizes="32x32"
|
||||
href="/favicon-32x32.png"
|
||||
/>
|
||||
<link
|
||||
rel="icon"
|
||||
type="image/png"
|
||||
sizes="16x16"
|
||||
href="/favicon-16x16.png"
|
||||
/>
|
||||
|
||||
{/* scripts */}
|
||||
<script src="/theme-setter.js" type="text/javascript" async />
|
||||
|
||||
{/* manifest */}
|
||||
<link rel="manifest" href="/apps/trading/public/manifest.json" />
|
||||
<link rel="manifest" href="/manifest.json" />
|
||||
</Head>
|
||||
<Html>
|
||||
<body
|
||||
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 8.7 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 265 B |
|
After Width: | Height: | Size: 281 B |
|
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 15 KiB |
@@ -9,14 +9,14 @@
|
||||
"background_color": "#ffffff",
|
||||
"icons": [
|
||||
{
|
||||
"src": "favicon.ico",
|
||||
"sizes": "64x64 32x32 24x24 16x16",
|
||||
"type": "image/x-icon"
|
||||
"src": "/android-chrome-192x192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png"
|
||||
},
|
||||
{
|
||||
"src": "cover.png",
|
||||
"type": "image/png",
|
||||
"sizes": "192x192"
|
||||
"src": "/android-chrome-512x512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ import type {
|
||||
EthCallSpec,
|
||||
MarketTradingMode,
|
||||
SignerKind,
|
||||
SuccessorConfiguration,
|
||||
} from '@vegaprotocol/types';
|
||||
import {
|
||||
ConditionOperatorMapping,
|
||||
@@ -69,11 +70,7 @@ import {
|
||||
useSuccessorMarketIdsQuery,
|
||||
useSuccessorMarketQuery,
|
||||
} from '../../__generated__';
|
||||
import {
|
||||
useSuccessorMarketProposalDetailsQuery,
|
||||
type SuccessorMarketProposalDetailsQuery,
|
||||
type SingleProposal,
|
||||
} from '@vegaprotocol/proposals';
|
||||
import { useSuccessorMarketProposalDetailsQuery } from '@vegaprotocol/proposals';
|
||||
import { getQuoteName, getAsset } from '../../market-utils';
|
||||
import classNames from 'classnames';
|
||||
import compact from 'lodash/compact';
|
||||
@@ -254,15 +251,27 @@ export const KeyDetailsInfoPanel = ({
|
||||
skip: !featureFlags.SUCCESSOR_MARKETS || !market.proposal?.id,
|
||||
});
|
||||
|
||||
const successorProposal = successorProposalDetails?.proposal as
|
||||
| SingleProposal<SuccessorMarketProposalDetailsQuery['proposal']>
|
||||
| undefined;
|
||||
let successorConfiguration: SuccessorConfiguration | false = false;
|
||||
|
||||
const successorConfiguration =
|
||||
successorProposal?.terms.change.__typename === 'NewMarket' &&
|
||||
successorProposal.terms.change.successorConfiguration?.__typename ===
|
||||
'SuccessorConfiguration' &&
|
||||
successorProposal.terms.change.successorConfiguration;
|
||||
if (successorProposalDetails?.proposal?.__typename === 'Proposal') {
|
||||
successorConfiguration =
|
||||
successorProposalDetails.proposal.terms.change.__typename ===
|
||||
'NewMarket' &&
|
||||
successorProposalDetails.proposal.terms.change.successorConfiguration
|
||||
?.__typename === 'SuccessorConfiguration' &&
|
||||
successorProposalDetails.proposal.terms.change.successorConfiguration;
|
||||
} else if (
|
||||
successorProposalDetails?.proposal?.__typename === 'BatchProposal'
|
||||
) {
|
||||
const subTerms = successorProposalDetails.proposal.batchTerms?.changes.find(
|
||||
(c) => c?.change.__typename === 'NewMarket'
|
||||
);
|
||||
successorConfiguration =
|
||||
subTerms?.change.__typename === 'NewMarket' &&
|
||||
subTerms?.change.successorConfiguration?.__typename ===
|
||||
'SuccessorConfiguration' &&
|
||||
subTerms?.change?.successorConfiguration;
|
||||
}
|
||||
|
||||
// The following queries are needed as the parent market could also have been a successor market.
|
||||
// Note: the parent market is only passed to this component if the successor markets flag is enabled,
|
||||
@@ -281,9 +290,27 @@ export const KeyDetailsInfoPanel = ({
|
||||
},
|
||||
skip: !parentMarket?.proposal?.id,
|
||||
});
|
||||
const parentProposal = parentSuccessorProposalDetails?.proposal as
|
||||
| SingleProposal<SuccessorMarketProposalDetailsQuery['proposal']>
|
||||
| undefined;
|
||||
|
||||
let parentSuccessorConfig: SuccessorConfiguration | undefined = undefined;
|
||||
|
||||
if (parentSuccessorProposalDetails?.proposal?.__typename === 'Proposal') {
|
||||
const parentProposal = parentSuccessorProposalDetails?.proposal;
|
||||
parentSuccessorConfig =
|
||||
parentProposal.terms.change.__typename === 'NewMarket'
|
||||
? parentProposal.terms.change.successorConfiguration || undefined
|
||||
: undefined;
|
||||
} else if (
|
||||
parentSuccessorProposalDetails?.proposal?.__typename === 'BatchProposal'
|
||||
) {
|
||||
const subTerms =
|
||||
parentSuccessorProposalDetails.proposal.batchTerms?.changes.find(
|
||||
(c) => c?.change.__typename === 'NewMarket'
|
||||
);
|
||||
parentSuccessorConfig =
|
||||
subTerms?.change.__typename === 'NewMarket'
|
||||
? subTerms.change.successorConfiguration || undefined
|
||||
: undefined;
|
||||
}
|
||||
|
||||
const assetDecimals = getAsset(market).decimals;
|
||||
|
||||
@@ -339,10 +366,7 @@ export const KeyDetailsInfoPanel = ({
|
||||
parentMarket && {
|
||||
name: parentMarket?.tradableInstrument?.instrument?.name,
|
||||
parentMarketID: grandparentMarketIdData?.market?.parentMarketID,
|
||||
insurancePoolFraction:
|
||||
parentProposal?.terms.change.__typename === 'NewMarket' &&
|
||||
parentProposal?.terms.change.successorConfiguration
|
||||
?.insurancePoolFraction,
|
||||
insurancePoolFraction: parentSuccessorConfig?.insurancePoolFraction,
|
||||
status:
|
||||
parentMarket?.state && MarketStateMapping[parentMarket.state],
|
||||
tradingMode:
|
||||
|
||||
@@ -68,6 +68,7 @@ query SuccessorMarketProposalDetails($proposalId: ID!) {
|
||||
terms {
|
||||
change {
|
||||
... on NewMarket {
|
||||
__typename
|
||||
successorConfiguration {
|
||||
parentMarketId
|
||||
insurancePoolFraction
|
||||
@@ -76,6 +77,22 @@ query SuccessorMarketProposalDetails($proposalId: ID!) {
|
||||
}
|
||||
}
|
||||
}
|
||||
... on BatchProposal {
|
||||
id
|
||||
batchTerms {
|
||||
changes {
|
||||
change {
|
||||
... on NewMarket {
|
||||
__typename
|
||||
successorConfiguration {
|
||||
parentMarketId
|
||||
insurancePoolFraction
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ export type SuccessorMarketProposalDetailsQueryVariables = Types.Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type SuccessorMarketProposalDetailsQuery = { __typename?: 'Query', proposal?: { __typename?: 'BatchProposal' } | { __typename?: 'Proposal', id?: string | null, terms: { __typename?: 'ProposalTerms', change: { __typename?: 'CancelTransfer' } | { __typename?: 'NewAsset' } | { __typename?: 'NewFreeform' } | { __typename?: 'NewMarket', successorConfiguration?: { __typename?: 'SuccessorConfiguration', parentMarketId: string, insurancePoolFraction: string } | null } | { __typename?: 'NewSpotMarket' } | { __typename?: 'NewTransfer' } | { __typename?: 'UpdateAsset' } | { __typename?: 'UpdateMarket' } | { __typename?: 'UpdateMarketState' } | { __typename?: 'UpdateNetworkParameter' } | { __typename?: 'UpdateReferralProgram' } | { __typename?: 'UpdateSpotMarket' } | { __typename?: 'UpdateVolumeDiscountProgram' } } } | null };
|
||||
export type SuccessorMarketProposalDetailsQuery = { __typename?: 'Query', proposal?: { __typename?: 'BatchProposal', id?: string | null, batchTerms?: { __typename?: 'BatchProposalTerms', changes: Array<{ __typename?: 'BatchProposalTermsChange', change: { __typename?: 'CancelTransfer' } | { __typename?: 'NewAsset' } | { __typename?: 'NewFreeform' } | { __typename: 'NewMarket', successorConfiguration?: { __typename?: 'SuccessorConfiguration', parentMarketId: string, insurancePoolFraction: string } | null } | { __typename?: 'NewSpotMarket' } | { __typename?: 'NewTransfer' } | { __typename?: 'UpdateAsset' } | { __typename?: 'UpdateMarket' } | { __typename?: 'UpdateMarketState' } | { __typename?: 'UpdateNetworkParameter' } | { __typename?: 'UpdateReferralProgram' } | { __typename?: 'UpdateSpotMarket' } | { __typename?: 'UpdateVolumeDiscountProgram' } } | null> } | null } | { __typename?: 'Proposal', id?: string | null, terms: { __typename?: 'ProposalTerms', change: { __typename?: 'CancelTransfer' } | { __typename?: 'NewAsset' } | { __typename?: 'NewFreeform' } | { __typename: 'NewMarket', successorConfiguration?: { __typename?: 'SuccessorConfiguration', parentMarketId: string, insurancePoolFraction: string } | null } | { __typename?: 'NewSpotMarket' } | { __typename?: 'NewTransfer' } | { __typename?: 'UpdateAsset' } | { __typename?: 'UpdateMarket' } | { __typename?: 'UpdateMarketState' } | { __typename?: 'UpdateNetworkParameter' } | { __typename?: 'UpdateReferralProgram' } | { __typename?: 'UpdateSpotMarket' } | { __typename?: 'UpdateVolumeDiscountProgram' } } } | null };
|
||||
|
||||
export type InstrumentDetailsQueryVariables = Types.Exact<{
|
||||
marketId: Types.Scalars['ID'];
|
||||
@@ -204,6 +204,7 @@ export const SuccessorMarketProposalDetailsDocument = gql`
|
||||
terms {
|
||||
change {
|
||||
... on NewMarket {
|
||||
__typename
|
||||
successorConfiguration {
|
||||
parentMarketId
|
||||
insurancePoolFraction
|
||||
@@ -212,6 +213,22 @@ export const SuccessorMarketProposalDetailsDocument = gql`
|
||||
}
|
||||
}
|
||||
}
|
||||
... on BatchProposal {
|
||||
id
|
||||
batchTerms {
|
||||
changes {
|
||||
change {
|
||||
... on NewMarket {
|
||||
__typename
|
||||
successorConfiguration {
|
||||
parentMarketId
|
||||
insurancePoolFraction
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||