-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6762 from vegaprotocol/chore/release-v0.27.0
chore(trading,governance,explorer): release v0.27.0
- Loading branch information
Showing
82 changed files
with
3,265 additions
and
1,563 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
apps/explorer/src/app/components/txs/details/amm/amm-liquidity-parameters.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 92 additions & 0 deletions
92
apps/explorer/src/app/components/txs/details/tx-amm-amend.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
60
apps/explorer/src/app/components/txs/details/tx-amm-cancel.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
91
apps/explorer/src/app/components/txs/details/tx-amm-submit.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.