Skip to content

Commit

Permalink
Merge pull request #6762 from vegaprotocol/chore/release-v0.27.0
Browse files Browse the repository at this point in the history
chore(trading,governance,explorer): release v0.27.0
  • Loading branch information
mattrussell36 authored Aug 7, 2024
2 parents 7c1cd7d + 6365043 commit 1c1810e
Show file tree
Hide file tree
Showing 82 changed files with 3,265 additions and 1,563 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cypress-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ jobs:
steps:
- name: Install vega & vegacapsule
run: |
sudo install-vega v0.76.8
sudo install-vegacapsule v0.76.8
sudo install-vega v0.77.6
sudo install-vegacapsule v0.77.6
# Checks if skip cache was requested
- name: Set skip-nx-cache flag
Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"executor": "nx:run-commands",
"options": {
"commands": [
"npx openapi-typescript https://raw.githubusercontent.com/vegaprotocol/documentation/main/specs/v0.76.0/blockexplorer.openapi.json --output apps/explorer/src/types/explorer.d.ts --immutable-types"
"npx openapi-typescript https://raw.githubusercontent.com/vegaprotocol/documentation/main/specs/v0.77.0/blockexplorer.openapi.json --output apps/explorer/src/types/explorer.d.ts --immutable"
]
}
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import { t } from '@vegaprotocol/i18n';
import type { components } from '../../../../../types/explorer';
import PriceInMarket from '../../../price-in-market/price-in-market';

interface ConcentratedLiquidityParametersProps {
parameters: ConcentratedLiquidityParameters;
marketId: string;
}

export type ConcentratedLiquidityParameters =
components['schemas']['v1SubmitAMMConcentratedLiquidityParameters'];

/**
* Cancel an existing AMM
*/
export const ConcentratedLiquidityParametersDetails = ({
parameters,
marketId,
}: ConcentratedLiquidityParametersProps) => {
if (!parameters) {
return null;
}

return (
<table>
<thead>
<tr className="bold">
<th align="left" className="pr-2">
{t('Bound')}
</th>
<th className="px-4">{t('Leverage at price')}</th>
<th className="px-2">{t('Price')}</th>
</tr>
</thead>
{parameters.upperBound && (
<tr>
<td className="pr-2" title={t('Upper bound')} align="center">
{t('Upper bound')}
</td>
<td align="center">{parameters.leverageAtUpperBound}×</td>
<td className="px-4" align="right">
<PriceInMarket marketId={marketId} price={parameters.upperBound} />
</td>
</tr>
)}
{parameters.base && (
<tr>
<td className="pr-2" title={t('Base price')}>
{t('Base')}
</td>
<td></td>
<td className="px-4" align="right">
<PriceInMarket marketId={marketId} price={parameters.base} />
</td>
</tr>
)}
{parameters.lowerBound && (
<tr>
<td className="pr-2" title={t('Lower bound')} align="center">
{t('Lower bound')}
</td>
<td align="center">{parameters.leverageAtLowerBound}×</td>
<td className="px-4" align="right">
<PriceInMarket marketId={marketId} price={parameters.lowerBound} />
</td>
</tr>
)}
</table>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -220,4 +220,5 @@ const individualScopeLabels: Record<
INDIVIDUAL_SCOPE_ALL: '',
INDIVIDUAL_SCOPE_IN_TEAM: '(in team)',
INDIVIDUAL_SCOPE_NOT_IN_TEAM: '(not in team)',
INDIVIDUAL_SCOPE_AMM: '(AMM)',
};
92 changes: 92 additions & 0 deletions apps/explorer/src/app/components/txs/details/tx-amm-amend.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
import { t } from '@vegaprotocol/i18n';
import type { BlockExplorerTransactionResult } from '../../../routes/types/block-explorer-response';
import { MarketLink } from '../../links/';
import type { TendermintBlocksResponse } from '../../../routes/blocks/tendermint-blocks-response';
import { TxDetailsShared } from './shared/tx-details-shared';
import { TableCell, TableRow, TableWithTbody } from '../../table';
import type { components } from '../../../../types/explorer';
import PriceInMarket from '../../price-in-market/price-in-market';
import { ConcentratedLiquidityParametersDetails } from './amm/amm-liquidity-parameters';

interface TxDetailsAMMAmendProps {
txData: BlockExplorerTransactionResult | undefined;
pubKey: string | undefined;
blockData: TendermintBlocksResponse | undefined;
}

export type Amend = components['schemas']['v1AmendAMM'];

/**
* Amends an AMM config for a user. Basically the same as create,
* but more likely to have fields omitted.
*/
export const TxDetailsAMMAmend = ({
txData,
pubKey,
blockData,
}: TxDetailsAMMAmendProps) => {
if (!txData || !txData.command.amendAmm) {
return <>{t('Awaiting Block Explorer transaction details')}</>;
}

const cmd: Amend = txData.command.amendAmm;
const {
marketId,
commitmentAmount,
proposedFee,
slippageTolerance,
concentratedLiquidityParameters,
} = cmd;

return (
<TableWithTbody className="mb-8" allowWrap={true}>
<TxDetailsShared txData={txData} pubKey={pubKey} blockData={blockData} />
{marketId && (
<TableRow modifier="bordered">
<TableCell>{t('Market')}</TableCell>
<TableCell>
<MarketLink id={marketId} />
</TableCell>
</TableRow>
)}
{commitmentAmount && marketId && (
<TableRow modifier="bordered">
<TableCell>{t('Amount')}</TableCell>
<TableCell>
<PriceInMarket marketId={marketId} price={commitmentAmount} />
</TableCell>
</TableRow>
)}

{proposedFee && marketId && (
<TableRow modifier="bordered">
<TableCell>{t('Proposed Fee')}</TableCell>
<TableCell>
<PriceInMarket marketId={marketId} price={proposedFee} />
</TableCell>
</TableRow>
)}

{slippageTolerance && marketId && (
<TableRow modifier="bordered">
<TableCell>{t('Slippage tolerance')}</TableCell>
<TableCell>
<PriceInMarket marketId={marketId} price={slippageTolerance} />
</TableCell>
</TableRow>
)}

{concentratedLiquidityParameters && marketId && (
<TableRow modifier="bordered">
<TableCell>{t('Liquidity parameters')}</TableCell>
<TableCell>
<ConcentratedLiquidityParametersDetails
marketId={marketId}
parameters={concentratedLiquidityParameters}
/>
</TableCell>
</TableRow>
)}
</TableWithTbody>
);
};
60 changes: 60 additions & 0 deletions apps/explorer/src/app/components/txs/details/tx-amm-cancel.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import { t } from '@vegaprotocol/i18n';
import type { BlockExplorerTransactionResult } from '../../../routes/types/block-explorer-response';
import { MarketLink } from '../../links/';
import type { TendermintBlocksResponse } from '../../../routes/blocks/tendermint-blocks-response';
import { TxDetailsShared } from './shared/tx-details-shared';
import { TableCell, TableRow, TableWithTbody } from '../../table';
import type { components } from '../../../../types/explorer';

interface TxDetailsAMMCancelProps {
txData: BlockExplorerTransactionResult | undefined;
pubKey: string | undefined;
blockData: TendermintBlocksResponse | undefined;
}

export type Method = components['schemas']['v1CancelAMMMethod'];

export const MethodLabels: Record<Method, string> = {
METHOD_UNSPECIFIED: 'Unspecified',
METHOD_IMMEDIATE: 'Immediate',
METHOD_REDUCE_ONLY: 'Reduce Only',
};

/**
* Cancel an existing AMM
*/
export const TxDetailsAMMCancel = ({
txData,
pubKey,
blockData,
}: TxDetailsAMMCancelProps) => {
if (!txData || !txData.command.cancelAmm) {
return <>{t('Awaiting Block Explorer transaction details')}</>;
}

const cmd: components['schemas']['v1CancelAMM'] = txData.command.cancelAmm;
const marketId: string | undefined = cmd.marketId;
const method: Method | undefined = cmd.method;

return (
<TableWithTbody className="mb-8" allowWrap={true}>
<TxDetailsShared txData={txData} pubKey={pubKey} blockData={blockData} />
{marketId && (
<TableRow modifier="bordered">
<TableCell>{t('Market')}</TableCell>
<TableCell>
<MarketLink id={marketId} />
</TableCell>
</TableRow>
)}
{method && (
<TableRow modifier="bordered">
<TableCell>{t('Method')}</TableCell>
<TableCell>
<code>{MethodLabels[method]}</code>
</TableCell>
</TableRow>
)}
</TableWithTbody>
);
};
91 changes: 91 additions & 0 deletions apps/explorer/src/app/components/txs/details/tx-amm-submit.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
import { t } from '@vegaprotocol/i18n';
import type { BlockExplorerTransactionResult } from '../../../routes/types/block-explorer-response';
import { MarketLink } from '../../links/';
import type { TendermintBlocksResponse } from '../../../routes/blocks/tendermint-blocks-response';
import { TxDetailsShared } from './shared/tx-details-shared';
import { TableCell, TableRow, TableWithTbody } from '../../table';
import type { components } from '../../../../types/explorer';
import PriceInMarket from '../../price-in-market/price-in-market';
import { ConcentratedLiquidityParametersDetails } from './amm/amm-liquidity-parameters';

interface TxDetailsAMMSubmitProps {
txData: BlockExplorerTransactionResult | undefined;
pubKey: string | undefined;
blockData: TendermintBlocksResponse | undefined;
}

export type Submit = components['schemas']['v1SubmitAMM'];

/**
* Create an AMM account for a user
*/
export const TxDetailsAMMSubmit = ({
txData,
pubKey,
blockData,
}: TxDetailsAMMSubmitProps) => {
if (!txData || !txData.command.submitAmm) {
return <>{t('Awaiting Block Explorer transaction details')}</>;
}

const cmd: Submit = txData.command.submitAmm;
const {
marketId,
commitmentAmount,
proposedFee,
slippageTolerance,
concentratedLiquidityParameters,
} = cmd;

return (
<TableWithTbody className="mb-8" allowWrap={true}>
<TxDetailsShared txData={txData} pubKey={pubKey} blockData={blockData} />
{marketId && (
<TableRow modifier="bordered">
<TableCell>{t('Market')}</TableCell>
<TableCell>
<MarketLink id={marketId} />
</TableCell>
</TableRow>
)}
{commitmentAmount && marketId && (
<TableRow modifier="bordered">
<TableCell>{t('Amount')}</TableCell>
<TableCell>
<PriceInMarket marketId={marketId} price={commitmentAmount} />
</TableCell>
</TableRow>
)}

{proposedFee && marketId && (
<TableRow modifier="bordered">
<TableCell>{t('Proposed Fee')}</TableCell>
<TableCell>
<PriceInMarket marketId={marketId} price={proposedFee} />
</TableCell>
</TableRow>
)}

{slippageTolerance && marketId && (
<TableRow modifier="bordered">
<TableCell>{t('Slippage tolerance')}</TableCell>
<TableCell>
<PriceInMarket marketId={marketId} price={slippageTolerance} />
</TableCell>
</TableRow>
)}

{concentratedLiquidityParameters && marketId && (
<TableRow modifier="bordered">
<TableCell>{t('Liquidity parameters')}</TableCell>
<TableCell>
<ConcentratedLiquidityParametersDetails
marketId={marketId}
parameters={concentratedLiquidityParameters}
/>
</TableCell>
</TableRow>
)}
</TableWithTbody>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ interface TxDetailsDataSubmissionProps {
}

/**
* Someone cancelled an order
* Oracle Data arriving
*/
export const TxDetailsDataSubmission = ({
txData,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ import { TxDetailsJoinTeam } from './tx-join-team';
import { TxDetailsUpdateMarginMode } from './tx-update-margin-mode';
import { TxBatchProposal } from './tx-batch-proposal';
import { TxDetailsUpdatePartyProfile } from './proposal/tx-update-party-profile';
import { TxDetailsAMMCancel } from './tx-amm-cancel';
import { TxDetailsAMMSubmit } from './tx-amm-submit';
import { TxDetailsAMMAmend } from './tx-amm-amend';

interface TxDetailsWrapperProps {
txData: BlockExplorerTransactionResult | undefined;
Expand Down Expand Up @@ -142,6 +145,12 @@ function getTransactionComponent(txData?: BlockExplorerTransactionResult) {
return TxBatchProposal;
case 'Update Party Profile':
return TxDetailsUpdatePartyProfile;
case 'Cancel AMM':
return TxDetailsAMMCancel;
case 'Submit AMM':
return TxDetailsAMMSubmit;
case 'Amend AMM':
return TxDetailsAMMAmend;
default:
return TxDetailsGeneric;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface TxDetailsOrderAmendProps {
}

/**
* Someone cancelled an order
* Amending an existing order
*/
export const TxDetailsOrderAmend = ({
txData,
Expand Down
Loading

0 comments on commit 1c1810e

Please sign in to comment.