Compare commits
121
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
529a724f6b | ||
|
|
851f721934 | ||
|
|
96821f8f04 | ||
|
|
8d39981eb7 | ||
|
|
fe67a83a96 | ||
|
|
e4756c5d68 | ||
|
|
eeedc19e8b | ||
|
|
d50dc4dbdd | ||
|
|
f96e423e15 | ||
|
|
45a74680c9 | ||
|
|
766012e389 | ||
|
|
d16deb4c19 | ||
|
|
7d5addad2e | ||
|
|
b698bd2e40 | ||
|
|
996a29690f | ||
|
|
5ee54e7cc2 | ||
|
|
6d7a63e0e6 | ||
|
|
5c03450463 | ||
|
|
64c8af8cb0 | ||
|
|
a06b861724 | ||
|
|
e2cde1efb6 | ||
|
|
7b9645a603 | ||
|
|
0352096e78 | ||
|
|
f7a423205c | ||
|
|
866afe0a82 | ||
|
|
6443a7ea35 | ||
|
|
538927fe19 | ||
|
|
4c28bfa60c | ||
|
|
01e2902239 | ||
|
|
7c84e62532 | ||
|
|
c5e33d01f2 | ||
|
|
a2b5f54fb7 | ||
|
|
db2eb4d0dd | ||
|
|
64d327c3f2 | ||
|
|
66bff41e0b | ||
|
|
ec8e4e2b58 | ||
|
|
f6c0031403 | ||
|
|
09e678e151 | ||
|
|
8fde527e05 | ||
|
|
6d484907f7 | ||
|
|
4336e2f1f7 | ||
|
|
2af090f2ba | ||
|
|
7ea69b3a85 | ||
|
|
38a33dddf3 | ||
|
|
4719703481 | ||
|
|
2bed3d5c26 | ||
|
|
0e55e50dc4 | ||
|
|
2b9a002248 | ||
|
|
5ac0917764 | ||
|
|
dbc535ddfc | ||
|
|
f5ec7277bd | ||
|
|
cb59fb741a | ||
|
|
8bf9e17fdd | ||
|
|
9f211bc5ba | ||
|
|
6ddbe5486a | ||
|
|
af42a78bcd | ||
|
|
5ee813e65e | ||
|
|
7ea8544473 | ||
|
|
5f4c7388cd | ||
|
|
1b478364d1 | ||
|
|
24c5afc1dc | ||
|
|
d3079b5cfa | ||
|
|
72236c35e9 | ||
|
|
78b6966e36 | ||
|
|
28a4455f42 | ||
|
|
08b32553a1 | ||
|
|
a76899f581 | ||
|
|
ce8d3adf13 | ||
|
|
56005fa522 | ||
|
|
443732d0df | ||
|
|
f432386398 | ||
|
|
b84f62b73d | ||
|
|
0b75aefeb6 | ||
|
|
5073416e21 | ||
|
|
48f50ce92c | ||
|
|
7e29b30312 | ||
|
|
e6d0c406f2 | ||
|
|
de6575659b | ||
|
|
b9643afed5 | ||
|
|
a332246da3 | ||
|
|
94937f3593 | ||
|
|
7b82882fdc | ||
|
|
d1ec5f5136 | ||
|
|
0add85690b | ||
|
|
38962f397f | ||
|
|
3ef9b9f8af | ||
|
|
49a0cec9df | ||
|
|
6e0df4678d | ||
|
|
50295dc040 | ||
|
|
871bfb0a40 | ||
|
|
e49148b203 | ||
|
|
77453881e4 | ||
|
|
642175d183 | ||
|
|
b45db36f7f | ||
|
|
9846a30475 | ||
|
|
33612d22dc | ||
|
|
07278f15e8 | ||
|
|
4df801f067 | ||
|
|
fd919ebc21 | ||
|
|
c62f189982 | ||
|
|
ed7d9678c0 | ||
|
|
5fb542daf5 | ||
|
|
bdbdf309b6 | ||
|
|
5fde0d3b3e | ||
|
|
1b0780d6ba | ||
|
|
8fa808051a | ||
|
|
f43a59817f | ||
|
|
ab5d3fe2b1 | ||
|
|
e245675a79 | ||
|
|
0ab83d6248 | ||
|
|
2c505c7500 | ||
|
|
b9d031c573 | ||
|
|
f8cd249fe1 | ||
|
|
a3380407b1 | ||
|
|
7c5ac31b73 | ||
|
|
30bc99a455 | ||
|
|
c7560eff7e | ||
|
|
c6e6021f01 | ||
|
|
bacea950fb | ||
|
|
4e38be7763 | ||
|
|
906fbbabc2 |
@@ -22,7 +22,7 @@ NX_WALLETCONNECT_PROJECT_ID=fe8091dc35738863e509fc4947525c72
|
||||
# Cosmic elevator flags
|
||||
NX_SUCCESSOR_MARKETS=true
|
||||
NX_STOP_ORDERS=true
|
||||
NX_ISOLATED_MARGIN=true
|
||||
NX_ISOLATED_MARGIN=false
|
||||
NX_ICEBERG_ORDERS=true
|
||||
NX_METAMASK_SNAPS=true
|
||||
NX_REFERRALS=true
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useT } from '../../lib/use-t';
|
||||
import { addDecimalsFormatNumber, formatNumber } from '@vegaprotocol/utils';
|
||||
import { addDecimalsFormatNumber } from '@vegaprotocol/utils';
|
||||
import classNames from 'classnames';
|
||||
import {
|
||||
type VegaIconSize,
|
||||
@@ -24,9 +24,6 @@ import {
|
||||
type DispatchStrategy,
|
||||
IndividualScopeMapping,
|
||||
IndividualScopeDescriptionMapping,
|
||||
AccountType,
|
||||
DistributionStrategy,
|
||||
IndividualScope,
|
||||
type Asset,
|
||||
} from '@vegaprotocol/types';
|
||||
import { Card } from '../card/card';
|
||||
@@ -65,27 +62,22 @@ export const applyFilter = (
|
||||
filter: Filter
|
||||
) => {
|
||||
const { transfer } = node;
|
||||
|
||||
// if the transfer is a staking reward then it should be displayed
|
||||
if (transfer.toAccountType === AccountType.ACCOUNT_TYPE_GLOBAL_REWARD) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (transfer.kind.__typename !== 'RecurringTransfer') {
|
||||
if (
|
||||
transfer.kind.__typename !== 'RecurringTransfer' ||
|
||||
!transfer.kind.dispatchStrategy?.dispatchMetric
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (
|
||||
(transfer.kind.dispatchStrategy?.dispatchMetric &&
|
||||
DispatchMetricLabels[transfer.kind.dispatchStrategy.dispatchMetric]
|
||||
.toLowerCase()
|
||||
.includes(filter.searchTerm.toLowerCase())) ||
|
||||
DispatchMetricLabels[transfer.kind.dispatchStrategy.dispatchMetric]
|
||||
.toLowerCase()
|
||||
.includes(filter.searchTerm.toLowerCase()) ||
|
||||
transfer.asset?.symbol
|
||||
.toLowerCase()
|
||||
.includes(filter.searchTerm.toLowerCase()) ||
|
||||
(
|
||||
(transfer.kind.dispatchStrategy &&
|
||||
EntityScopeLabelMapping[transfer.kind.dispatchStrategy.entityScope]) ||
|
||||
EntityScopeLabelMapping[transfer.kind.dispatchStrategy.entityScope] ||
|
||||
'Unspecified'
|
||||
)
|
||||
.toLowerCase()
|
||||
@@ -101,7 +93,6 @@ export const applyFilter = (
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
@@ -183,29 +174,6 @@ export const ActiveRewardCard = ({
|
||||
return null;
|
||||
}
|
||||
|
||||
if (
|
||||
!transferNode.transfer.kind.dispatchStrategy &&
|
||||
transferNode.transfer.toAccountType ===
|
||||
AccountType.ACCOUNT_TYPE_GLOBAL_REWARD
|
||||
) {
|
||||
return (
|
||||
<StakingRewardCard
|
||||
colour={CardColour.WHITE}
|
||||
rewardAmount={addDecimalsFormatNumber(
|
||||
transferNode.transfer.amount,
|
||||
transferNode.transfer.asset?.decimals || 0,
|
||||
6
|
||||
)}
|
||||
rewardAsset={transferNode.transfer.asset || undefined}
|
||||
endsIn={
|
||||
transferNode.transfer.kind.endEpoch != null
|
||||
? transferNode.transfer.kind.endEpoch - currentEpoch
|
||||
: undefined
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
let colour =
|
||||
DispatchMetricColourMap[
|
||||
transferNode.transfer.kind.dispatchStrategy.dispatchMetric
|
||||
@@ -350,7 +318,7 @@ const RewardCard = ({
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<span className="border-[0.5px] dark:border-vega-cdark-500 border-vega-clight-500" />
|
||||
<span className="border-[0.5px] border-gray-700" />
|
||||
{/** DISPATCH METRIC */}
|
||||
{dispatchMetricInfo ? (
|
||||
dispatchMetricInfo
|
||||
@@ -387,11 +355,11 @@ const RewardCard = ({
|
||||
</div>
|
||||
{/** DISPATCH METRIC DESCRIPTION */}
|
||||
{dispatchStrategy?.dispatchMetric && (
|
||||
<p className="text-muted text-sm h-[3rem]">
|
||||
<span className="text-muted text-sm h-[3rem]">
|
||||
{t(DispatchMetricDescription[dispatchStrategy?.dispatchMetric])}
|
||||
</p>
|
||||
</span>
|
||||
)}
|
||||
<span className="border-[0.5px] dark:border-vega-cdark-500 border-vega-clight-500" />
|
||||
<span className="border-[0.5px] border-gray-700" />
|
||||
{/** REQUIREMENTS */}
|
||||
{dispatchStrategy && (
|
||||
<RewardRequirements
|
||||
@@ -406,190 +374,6 @@ const RewardCard = ({
|
||||
);
|
||||
};
|
||||
|
||||
const StakingRewardCard = ({
|
||||
colour,
|
||||
rewardAmount,
|
||||
rewardAsset,
|
||||
endsIn,
|
||||
}: {
|
||||
colour: CardColour;
|
||||
rewardAmount: string;
|
||||
/** The asset linked to the dispatch strategy via `dispatchMetricAssetId` property. */
|
||||
rewardAsset?: Asset;
|
||||
/** The number of epochs until the transfer stops. */
|
||||
endsIn?: number;
|
||||
/** The VEGA asset details, required to format the min staking amount. */
|
||||
vegaAsset?: BasicAssetDetails;
|
||||
}) => {
|
||||
const t = useT();
|
||||
return (
|
||||
<div>
|
||||
<div
|
||||
className={classNames(
|
||||
'bg-gradient-to-r col-span-full p-0.5 lg:col-auto h-full',
|
||||
'rounded-lg',
|
||||
CardColourStyles[colour].gradientClassName
|
||||
)}
|
||||
data-testid="active-rewards-card"
|
||||
>
|
||||
<div
|
||||
className={classNames(
|
||||
CardColourStyles[colour].mainClassName,
|
||||
'bg-gradient-to-b bg-vega-clight-800 dark:bg-vega-cdark-800 h-full w-full rounded-md p-4 flex flex-col gap-4'
|
||||
)}
|
||||
>
|
||||
<div className="flex justify-between gap-4">
|
||||
{/** ENTITY SCOPE */}
|
||||
<div className="flex flex-col gap-2 items-center text-center">
|
||||
<EntityIcon entityScope={EntityScope.ENTITY_SCOPE_INDIVIDUALS} />
|
||||
{
|
||||
<span className="text-muted text-xs" data-testid="entity-scope">
|
||||
{EntityScopeLabelMapping[
|
||||
EntityScope.ENTITY_SCOPE_INDIVIDUALS
|
||||
] || t('Unspecified')}
|
||||
</span>
|
||||
}
|
||||
</div>
|
||||
|
||||
{/** AMOUNT AND DISTRIBUTION STRATEGY */}
|
||||
<div className="flex flex-col gap-2 items-center text-center">
|
||||
{/** AMOUNT */}
|
||||
<h3 className="flex flex-col gap-1 text-2xl shrink-1 text-center">
|
||||
<span className="font-glitch" data-testid="reward-value">
|
||||
{rewardAmount}
|
||||
</span>
|
||||
|
||||
<span className="font-alpha">{rewardAsset?.symbol || ''}</span>
|
||||
</h3>
|
||||
|
||||
{/** DISTRIBUTION STRATEGY */}
|
||||
<Tooltip
|
||||
description={t(
|
||||
DistributionStrategyDescriptionMapping[
|
||||
DistributionStrategy.DISTRIBUTION_STRATEGY_PRO_RATA
|
||||
]
|
||||
)}
|
||||
underline={true}
|
||||
>
|
||||
<span className="text-xs" data-testid="distribution-strategy">
|
||||
{
|
||||
DistributionStrategyMapping[
|
||||
DistributionStrategy.DISTRIBUTION_STRATEGY_PRO_RATA
|
||||
]
|
||||
}
|
||||
</span>
|
||||
</Tooltip>
|
||||
</div>
|
||||
|
||||
{/** DISTRIBUTION DELAY */}
|
||||
<div className="flex flex-col gap-2 items-center text-center">
|
||||
<CardIcon
|
||||
iconName={VegaIconNames.LOCK}
|
||||
tooltip={t(
|
||||
'Number of epochs after distribution to delay vesting of rewards by'
|
||||
)}
|
||||
/>
|
||||
<span
|
||||
className="text-muted text-xs whitespace-nowrap"
|
||||
data-testid="locked-for"
|
||||
>
|
||||
{t('numberEpochs', '{{count}} epochs', {
|
||||
count: 0,
|
||||
})}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<span className="border-[0.5px] dark:border-vega-cdark-500 border-vega-clight-500" />
|
||||
{/** DISPATCH METRIC */}
|
||||
{
|
||||
<span data-testid="dispatch-metric-info">
|
||||
{t('Staking rewards')}
|
||||
</span>
|
||||
}
|
||||
<div className="flex items-center gap-8 flex-wrap">
|
||||
{/** ENDS IN */}
|
||||
{endsIn != null && (
|
||||
<span className="flex flex-col">
|
||||
<span className="text-muted text-xs">{t('Ends in')} </span>
|
||||
<span data-testid="ends-in" data-endsin={endsIn}>
|
||||
{endsIn >= 0
|
||||
? t('numberEpochs', '{{count}} epochs', {
|
||||
count: endsIn,
|
||||
})
|
||||
: t('Ended')}
|
||||
</span>
|
||||
</span>
|
||||
)}
|
||||
|
||||
{/** WINDOW LENGTH */}
|
||||
<span className="flex flex-col">
|
||||
<span className="text-muted text-xs">{t('Assessed over')}</span>
|
||||
<span data-testid="assessed-over">
|
||||
{t('numberEpochs', '{{count}} epochs', {
|
||||
count: 1,
|
||||
})}
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
{/** DISPATCH METRIC DESCRIPTION */}
|
||||
{
|
||||
<p className="text-muted text-sm h-[3rem]">
|
||||
{t(
|
||||
'Global staking reward for staking $VEGA on the network via the Governance app'
|
||||
)}
|
||||
</p>
|
||||
}
|
||||
<span className="border-[0.5px] dark:border-vega-cdark-500 border-vega-clight-500" />
|
||||
{/** REQUIREMENTS */}
|
||||
<dl className="flex justify-between flex-wrap items-center gap-3 text-xs">
|
||||
<div className="flex flex-col gap-1">
|
||||
<dt className="flex items-center gap-1 text-muted">
|
||||
{t('Team scope')}
|
||||
</dt>
|
||||
<dd className="flex items-center gap-1" data-testid="scope">
|
||||
<Tooltip
|
||||
description={
|
||||
IndividualScopeDescriptionMapping[
|
||||
IndividualScope.INDIVIDUAL_SCOPE_ALL
|
||||
]
|
||||
}
|
||||
>
|
||||
<span>{t('Individual')}</span>
|
||||
</Tooltip>
|
||||
</dd>
|
||||
</div>
|
||||
|
||||
<div className="flex flex-col gap-1">
|
||||
<dt className="flex items-center gap-1 text-muted">
|
||||
{t('Staked VEGA')}
|
||||
</dt>
|
||||
<dd
|
||||
className="flex items-center gap-1"
|
||||
data-testid="staking-requirement"
|
||||
>
|
||||
{formatNumber(1, 2)}
|
||||
</dd>
|
||||
</div>
|
||||
|
||||
<div className="flex flex-col gap-1">
|
||||
<dt className="flex items-center gap-1 text-muted">
|
||||
{t('Average position')}
|
||||
</dt>
|
||||
<dd
|
||||
className="flex items-center gap-1"
|
||||
data-testid="average-position"
|
||||
>
|
||||
{formatNumber(0, 2)}
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export const DispatchMetricInfo = ({
|
||||
reward,
|
||||
}: {
|
||||
|
||||
@@ -16,7 +16,6 @@ import {
|
||||
EntityScope,
|
||||
IndividualScope,
|
||||
MarketState,
|
||||
AccountType,
|
||||
} from '@vegaprotocol/types';
|
||||
import { type ApolloError } from '@apollo/client';
|
||||
import compact from 'lodash/compact';
|
||||
@@ -47,9 +46,8 @@ export type EnrichedRewardTransfer = RewardTransfer & {
|
||||
*/
|
||||
export const isReward = (node: TransferNode): node is RewardTransfer => {
|
||||
if (
|
||||
(node.transfer.kind.__typename === 'RecurringTransfer' &&
|
||||
node.transfer.kind.dispatchStrategy != null) ||
|
||||
node.transfer.toAccountType === AccountType.ACCOUNT_TYPE_GLOBAL_REWARD
|
||||
node.transfer.kind.__typename === 'RecurringTransfer' &&
|
||||
node.transfer.kind.dispatchStrategy != null
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
@@ -81,13 +79,13 @@ export const isActiveReward = (node: RewardTransfer, currentEpoch: number) => {
|
||||
*/
|
||||
export const isScopedToTeams = (node: EnrichedRewardTransfer) =>
|
||||
// scoped to teams
|
||||
node.transfer.kind.dispatchStrategy?.entityScope ===
|
||||
node.transfer.kind.dispatchStrategy.entityScope ===
|
||||
EntityScope.ENTITY_SCOPE_TEAMS ||
|
||||
// or to individuals
|
||||
(node.transfer.kind.dispatchStrategy?.entityScope ===
|
||||
(node.transfer.kind.dispatchStrategy.entityScope ===
|
||||
EntityScope.ENTITY_SCOPE_INDIVIDUALS &&
|
||||
// but they have to be in a team
|
||||
node.transfer.kind.dispatchStrategy?.individualScope ===
|
||||
node.transfer.kind.dispatchStrategy.individualScope ===
|
||||
IndividualScope.INDIVIDUAL_SCOPE_IN_TEAM);
|
||||
|
||||
/** Retrieves rewards (transfers) */
|
||||
@@ -144,7 +142,6 @@ export const useRewards = ({
|
||||
.filter((node) => (scopeToTeams ? isScopedToTeams(node) : true))
|
||||
// enrich with dispatch asset and markets in scope details
|
||||
.map((node) => {
|
||||
if (!node.transfer.kind.dispatchStrategy) return node;
|
||||
const dispatchAsset =
|
||||
(assets &&
|
||||
assets[node.transfer.kind.dispatchStrategy.dispatchMetricAssetId]) ||
|
||||
@@ -173,7 +170,7 @@ export const useRewards = ({
|
||||
...node,
|
||||
dispatchAsset,
|
||||
isAssetTraded: isAssetTraded != null ? isAssetTraded : undefined,
|
||||
markets: marketsInScope?.length > 0 ? marketsInScope : undefined,
|
||||
markets: marketsInScope.length > 0 ? marketsInScope : undefined,
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ import {
|
||||
ProtocolUpgradeInProgressNotification,
|
||||
ProtocolUpgradeProposalNotification,
|
||||
} from '@vegaprotocol/proposals';
|
||||
import { ViewingBanner } from '../components/viewing-banner';
|
||||
import { Telemetry } from '../components/telemetry';
|
||||
import { SSRLoader } from './ssr-loader';
|
||||
import { PartyActiveOrdersHandler } from './party-active-orders-handler';
|
||||
@@ -76,6 +77,7 @@ function AppBody({ Component }: AppProps) {
|
||||
mode={ProtocolUpgradeCountdownMode.IN_ESTIMATED_TIME_REMAINING}
|
||||
/>
|
||||
<ProtocolUpgradeInProgressNotification />
|
||||
<ViewingBanner />
|
||||
</div>
|
||||
<div data-testid={`pathname-${location.pathname}`}>
|
||||
<Component />
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
import { useMemo } from 'react';
|
||||
import { parseISO, isValid, isAfter } from 'date-fns';
|
||||
import classNames from 'classnames';
|
||||
import { useProposalOfMarketQuery } from '@vegaprotocol/proposals';
|
||||
import {
|
||||
useProposalOfMarketQuery,
|
||||
type ProposalOfMarketQuery,
|
||||
type SingleProposal,
|
||||
} from '@vegaprotocol/proposals';
|
||||
import { DocsLinks } from '@vegaprotocol/environment';
|
||||
import { getDateTimeFormat } from '@vegaprotocol/utils';
|
||||
import * as Schema from '@vegaprotocol/types';
|
||||
@@ -36,21 +40,15 @@ export const TradingModeTooltip = ({
|
||||
marketTradingMode,
|
||||
});
|
||||
|
||||
// We only fetch Proposals (and not BatchProposals)
|
||||
const proposal = proposalData?.proposal as SingleProposal<
|
||||
ProposalOfMarketQuery['proposal']
|
||||
>;
|
||||
|
||||
if (!market || !marketData) {
|
||||
return null;
|
||||
}
|
||||
|
||||
let enactmentDate;
|
||||
const proposal = proposalData?.proposal;
|
||||
|
||||
if (proposal?.__typename === 'Proposal') {
|
||||
enactmentDate = parseISO(proposal.terms.enactmentDatetime);
|
||||
} else if (proposal?.__typename === 'BatchProposal') {
|
||||
const change = proposal.batchTerms?.changes.find(
|
||||
(c) => c?.change.__typename === 'NewMarket'
|
||||
);
|
||||
enactmentDate = change ? parseISO(change.enactmentDatetime) : undefined;
|
||||
}
|
||||
const enactmentDate = parseISO(proposal?.terms.enactmentDatetime);
|
||||
|
||||
const compiledGrid =
|
||||
!skipGrid && compileGridData(t, market, marketData, onSelect);
|
||||
@@ -69,16 +67,14 @@ export const TradingModeTooltip = ({
|
||||
return (
|
||||
<section data-testid="trading-mode-tooltip">
|
||||
<p
|
||||
className={classNames('flex flex-col items-start gap-2', {
|
||||
className={classNames('flex flex-col', {
|
||||
'mb-4': Boolean(compiledGrid),
|
||||
})}
|
||||
>
|
||||
{enactmentDate &&
|
||||
isValid(enactmentDate) &&
|
||||
isAfter(new Date(), enactmentDate) ? (
|
||||
{isValid(enactmentDate) && isAfter(new Date(), enactmentDate) ? (
|
||||
<>
|
||||
<span
|
||||
className="justify-center font-bold"
|
||||
className="justify-center font-bold my-2"
|
||||
data-testid="opening-auction-sub-status"
|
||||
>
|
||||
{`${Schema.MarketTradingModeMapping[marketTradingMode]}: ${t(
|
||||
@@ -95,7 +91,7 @@ export const TradingModeTooltip = ({
|
||||
<>
|
||||
{isValid(enactmentDate) && (
|
||||
<span
|
||||
className="justify-center font-bold"
|
||||
className="justify-center font-bold my-2"
|
||||
data-testid="opening-auction-sub-status"
|
||||
>
|
||||
{`${
|
||||
@@ -113,7 +109,10 @@ export const TradingModeTooltip = ({
|
||||
</>
|
||||
)}
|
||||
{DocsLinks && (
|
||||
<ExternalLink href={DocsLinks.AUCTION_TYPE_OPENING}>
|
||||
<ExternalLink
|
||||
href={DocsLinks.AUCTION_TYPE_OPENING}
|
||||
className="ml-1"
|
||||
>
|
||||
{t('Find out more')}
|
||||
</ExternalLink>
|
||||
)}
|
||||
|
||||
@@ -135,7 +135,6 @@
|
||||
"Governance vote for this market is valid and has been accepted": "Governance vote for this market is valid and has been accepted",
|
||||
"Governance vote has passed and market is awaiting opening auction exit": "Governance vote has passed and market is awaiting opening auction exit",
|
||||
"Governance vote passed to close the market": "Governance vote passed to close the market",
|
||||
"Global staking reward for staking $VEGA on the network via the Governance app": "Global staking reward for staking $VEGA on the network via the Governance app",
|
||||
"Help identify bugs and improve the service by sharing anonymous usage data.": "Help identify bugs and improve the service by sharing anonymous usage data.",
|
||||
"Help us identify bugs and improve Vega Governance by sharing anonymous usage data.": "Help us identify bugs and improve Vega Governance by sharing anonymous usage data.",
|
||||
"Hide closed markets": "Hide closed markets",
|
||||
@@ -368,12 +367,12 @@
|
||||
"TradingView": "TradingView",
|
||||
"Transfer": "Transfer",
|
||||
"Type": "Type",
|
||||
"Staking rewards": "Staking rewards",
|
||||
"Unknown": "Unknown",
|
||||
"Unknown settlement date": "Unknown settlement date",
|
||||
"Update team": "Update team",
|
||||
"URL": "URL",
|
||||
"Use a comma separated list to allow only specific public keys to join the team": "Use a comma separated list to allow only specific public keys to join the team",
|
||||
"Vega chart": "Vega chart",
|
||||
"Vega Reward pot": "Vega Reward pot",
|
||||
"Vega Wallet <0>full featured</0>": "Vega Wallet <0>full featured</0>",
|
||||
"Vega chart": "Vega chart",
|
||||
|
||||
@@ -45,19 +45,6 @@ query ProposalOfMarket($marketId: ID!) {
|
||||
enactmentDatetime
|
||||
}
|
||||
}
|
||||
... on BatchProposal {
|
||||
id
|
||||
batchTerms {
|
||||
changes {
|
||||
enactmentDatetime
|
||||
change {
|
||||
... on NewMarket {
|
||||
__typename
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ export type ProposalOfMarketQueryVariables = Types.Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type ProposalOfMarketQuery = { __typename?: 'Query', proposal?: { __typename?: 'BatchProposal', id?: string | null, batchTerms?: { __typename?: 'BatchProposalTerms', changes: Array<{ __typename?: 'BatchProposalTermsChange', enactmentDatetime?: any | null, change: { __typename?: 'CancelTransfer' } | { __typename?: 'NewAsset' } | { __typename?: 'NewFreeform' } | { __typename: 'NewMarket' } | { __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', enactmentDatetime?: any | null } } | null };
|
||||
export type ProposalOfMarketQuery = { __typename?: 'Query', proposal?: { __typename?: 'BatchProposal' } | { __typename?: 'Proposal', id?: string | null, terms: { __typename?: 'ProposalTerms', enactmentDatetime?: any | null } } | null };
|
||||
|
||||
export type SuccessorMarketProposalDetailsQueryVariables = Types.Exact<{
|
||||
proposalId: Types.Scalars['ID'];
|
||||
@@ -152,19 +152,6 @@ export const ProposalOfMarketDocument = gql`
|
||||
enactmentDatetime
|
||||
}
|
||||
}
|
||||
... on BatchProposal {
|
||||
id
|
||||
batchTerms {
|
||||
changes {
|
||||
enactmentDatetime
|
||||
change {
|
||||
... on NewMarket {
|
||||
__typename
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
Generated
-2
@@ -256,8 +256,6 @@ export type AggregatedLedgerEntry = {
|
||||
toAccountPartyId?: Maybe<Scalars['ID']>;
|
||||
/** Account type, if query was grouped by receiver account type - else null */
|
||||
toAccountType?: Maybe<AccountType>;
|
||||
/** Transfer ID associated with this aggregated ledger entry */
|
||||
transferId: Scalars['ID'];
|
||||
/** Type of the transfer for this ledger entry */
|
||||
transferType?: Maybe<TransferType>;
|
||||
/** RFC3339Nano time from at which this ledger entries records were relevant */
|
||||
|
||||
@@ -199,6 +199,7 @@
|
||||
"flush-promises": "^1.0.2",
|
||||
"glob": "^8.0.3",
|
||||
"husky": "^7.0.4",
|
||||
"inquirer": "^8.0.0",
|
||||
"jest": "29.4.3",
|
||||
"jest-canvas-mock": "^2.3.1",
|
||||
"jest-environment-jsdom": "^29.4.1",
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
const { execSync } = require('child_process');
|
||||
const inquirer = require('inquirer');
|
||||
|
||||
const getTags = (take) => {
|
||||
const tags = execSync(
|
||||
"git for-each-ref --sort=taggerdate --format '%(refname)' refs/tags"
|
||||
)
|
||||
.toString()
|
||||
.trim()
|
||||
.split('\n')
|
||||
.map((t) => t.replace('refs/tags/', ''))
|
||||
.reverse()
|
||||
.slice(0, take);
|
||||
return tags;
|
||||
};
|
||||
|
||||
const getReleaseBranches = () => {
|
||||
const branches = execSync('git branch --remote | grep origin/release/')
|
||||
.toString()
|
||||
.trim()
|
||||
.split('\n')
|
||||
.map((b) => b.trim().replace('origin/release/', ''));
|
||||
return branches;
|
||||
};
|
||||
|
||||
const release = (tag, branch) => {
|
||||
const steps = [
|
||||
`git checkout ${branch}`,
|
||||
'git pull',
|
||||
`git reset --hard ${tag}`,
|
||||
'git push --force',
|
||||
];
|
||||
try {
|
||||
for (const cmd of steps) {
|
||||
const result = execSync(cmd).toString();
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('Could not make a release');
|
||||
}
|
||||
};
|
||||
|
||||
inquirer
|
||||
.prompt([
|
||||
{
|
||||
type: 'list',
|
||||
name: 'tag',
|
||||
message: 'What version would you like to release?',
|
||||
choices: getTags(),
|
||||
},
|
||||
{
|
||||
type: 'checkbox',
|
||||
name: 'envs',
|
||||
message: 'To what environment you wish to release?',
|
||||
choices: ['mainnet', ...getReleaseBranches()],
|
||||
validate(answer) {
|
||||
return answer.length > 0;
|
||||
},
|
||||
},
|
||||
])
|
||||
.then((answers) => {
|
||||
inquirer
|
||||
.prompt({
|
||||
type: 'confirm',
|
||||
name: 'sure',
|
||||
message: `Are you sure? This will release ${
|
||||
answers.tag
|
||||
} to ${answers.envs.join(', ')}`,
|
||||
})
|
||||
.then(() => {
|
||||
for (const env of answers.envs) {
|
||||
const branch = env === 'mainnet' ? 'main' : `release/${env}`;
|
||||
release(answers.tag, branch);
|
||||
}
|
||||
execSync('git checkout develop');
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log('Something went wrong', err.toString());
|
||||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log('Something went wrong', err.toString());
|
||||
});
|
||||
Reference in New Issue
Block a user