diff --git a/.prettierignore b/.prettierignore
index ffbc7ade5..16b8bff30 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -7,5 +7,5 @@ __generated__
apps/static/src/assets/devnet-tranches.json
apps/static/src/assets/mainnet-tranches.json
apps/static/src/assets/stagnet1-tranches.json
-apps/static/src/assets/stagnet2-tranches.json
+apps/static/src/assets/stagnet3-tranches.json
apps/static/src/assets/testnet-tranches.json
diff --git a/README.md b/README.md
index 45f24a40d..d245dd5eb 100644
--- a/README.md
+++ b/README.md
@@ -72,7 +72,7 @@ Run `nx serve my-app` for a dev server. Navigate to the port specified in `app/<
In order to generate the schemas for your GraphQL queries, you can run `NX_VEGA_URL=[YOUR URL HERE] nx run types:generate`.
```bash
-export NX_VEGA_URL=https://lb.testnet.vega.xyz/query
+export NX_VEGA_URL=https://api.n11.testnet.vega.xyz/graphql
yarn nx run types:generate
```
diff --git a/apps/explorer-e2e/.env.stagnet2 b/apps/explorer-e2e/.env.stagnet3
similarity index 86%
rename from apps/explorer-e2e/.env.stagnet2
rename to apps/explorer-e2e/.env.stagnet3
index c55daeed5..d48301ed4 100644
--- a/apps/explorer-e2e/.env.stagnet2
+++ b/apps/explorer-e2e/.env.stagnet3
@@ -1,10 +1,10 @@
# App configuration variables
NX_CHAIN_EXPLORER_URL=https://explorer.vega.trading/.netlify/functions/chain-explorer-api
-NX_TENDERMINT_URL=https://n03.stagnet2.vega.xyz/tm
-NX_TENDERMINT_WEBSOCKET_URL=wss://n03.stagnet2.vega.xyz/tm/websocket
-NX_VEGA_URL=https://n03.stagnet2.vega.xyz/query
-NX_VEGA_ENV=STAGNET2
-NX_VEGA_REST=https://n01.stagnet2.vega.xyz/datanode/rest
+NX_TENDERMINT_URL=https://n01.stagnet3.vega.xyz/tm
+NX_TENDERMINT_WEBSOCKET_URL=wss://n01.stagnet3.vega.xyz/tm/websocket
+NX_VEGA_URL=https://n01.stagnet3.vega.xyz/query
+NX_VEGA_ENV=STAGNET3
+NX_VEGA_REST=https://n01.stagnet3.vega.xyz/datanode/rest
# App flags
NX_EXPLORER_ASSETS=1
diff --git a/apps/explorer-e2e/.env.testnet b/apps/explorer-e2e/.env.testnet
index 3b5c6f537..0878cdcd6 100644
--- a/apps/explorer-e2e/.env.testnet
+++ b/apps/explorer-e2e/.env.testnet
@@ -1,10 +1,10 @@
# App configuration variables
NX_CHAIN_EXPLORER_URL=https://explorer.vega.trading/.netlify/functions/chain-explorer-api
-NX_TENDERMINT_URL=https://lb.testnet.vega.xyz/tm
+NX_TENDERMINT_URL=https://tm.n06.testnet.vega.xyz/tm
NX_TENDERMINT_WEBSOCKET_URL=wss://lb.testnet.vega.xyz/tm/websocket
-NX_VEGA_URL=https://lb.testnet.vega.xyz/query
+NX_VEGA_URL=https://api.n11.testnet.vega.xyz/graphql
NX_VEGA_ENV=TESTNET
-NX_VEGA_REST=https://lb.testnet.vega.xyz/datanode/rest
+NX_VEGA_REST=https://api.n11.testnet.vega.xyz
# App flags
NX_EXPLORER_ASSETS=1
diff --git a/apps/explorer-e2e/src/integration/validator.cy.js b/apps/explorer-e2e/src/integration/validator.cy.js
index a97bb7a62..1529670b4 100644
--- a/apps/explorer-e2e/src/integration/validator.cy.js
+++ b/apps/explorer-e2e/src/integration/validator.cy.js
@@ -21,8 +21,7 @@ context('Validator page', function () {
'have.text',
'Tendermint data'
);
- cy.get('[data-testid="vega-header"]').should('have.text', 'Vega data');
- cy.get('[data-testid="vega-data"]').should('not.be.empty');
+ cy.get('[data-testid="tendermint-data"]').should('not.be.empty');
}
});
});
diff --git a/apps/explorer/.env b/apps/explorer/.env
index 844001e0f..455137895 100644
--- a/apps/explorer/.env
+++ b/apps/explorer/.env
@@ -6,13 +6,13 @@ NX_VEGA_ENV=CUSTOM
NX_VEGA_REST=http://localhost:3029
NX_CHAIN_EXPLORER_URL=https://explorer.vega.trading/.netlify/functions/chain-explorer-api
-NX_TENDERMINT_URL=https://lb.testnet.vega.xyz/tm
-NX_TENDERMINT_WEBSOCKET_URL=wss://lb.testnet.vega.xyz/tm/websocket
-NX_VEGA_URL=https://lb.testnet.vega.xyz/query
-NX_VEGA_ENV=TESTNET
-NX_VEGA_REST=https://lb.testnet.vega.xyz/datanode/rest
+NX_TENDERMINT_URL=https://n01.stagnet3.vega.xyz/tm
+NX_TENDERMINT_WEBSOCKET_URL=wss://n01.stagnet3.vega.xyz/tm/websocket
+NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/stagnet3-network.json
+NX_VEGA_URL=https://n01.stagnet3.vega.xyz/query
NX_VEGA_NETWORKS='{"TESTNET":"https://explorer.fairground.wtf","MAINNET":"https://explorer.vega.xyz"}'
-CYPRESS_VEGA_TENDERMINT_URL=https://lb.testnet.vega.xyz/tm
+NX_VEGA_ENV=STAGNET3
+NX_VEGA_REST=https://n01.stagnet3.vega.xyz/datanode/rest
NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions
# App flags
diff --git a/apps/explorer/.env.stagnet2 b/apps/explorer/.env.stagnet3
similarity index 76%
rename from apps/explorer/.env.stagnet2
rename to apps/explorer/.env.stagnet3
index a55708673..b955fba9c 100644
--- a/apps/explorer/.env.stagnet2
+++ b/apps/explorer/.env.stagnet3
@@ -1,10 +1,10 @@
# App configuration variables
NX_CHAIN_EXPLORER_URL=https://explorer.vega.trading/.netlify/functions/chain-explorer-api
-NX_TENDERMINT_URL=https://n03.stagnet2.vega.xyz/tm
-NX_TENDERMINT_WEBSOCKET_URL=wss://n03.stagnet2.vega.xyz/tm/websocket
-NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/stagnet2-network.json
-NX_VEGA_URL=https://n03.stagnet2.vega.xyz/query
+NX_TENDERMINT_URL=https://n01.stagnet3.vega.xyz/tm
+NX_TENDERMINT_WEBSOCKET_URL=wss://n01.stagnet3.vega.xyz/tm/websocket
+NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/stagnet3-network.json
+NX_VEGA_URL=https://n01.stagnet3.vega.xyz/query
NX_VEGA_NETWORKS='{"TESTNET":"https://explorer.fairground.wtf","MAINNET":"https://explorer.vega.xyz"}'
-NX_VEGA_ENV=STAGNET2
-NX_VEGA_REST=https://n01.stagnet2.vega.xyz/datanode/rest
+NX_VEGA_ENV=STAGNET3
+NX_VEGA_REST=https://n01.stagnet3.vega.xyz/datanode/rest
NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions
diff --git a/apps/explorer/.env.testnet b/apps/explorer/.env.testnet
index 68a985352..e162d687f 100644
--- a/apps/explorer/.env.testnet
+++ b/apps/explorer/.env.testnet
@@ -1,10 +1,10 @@
# App configuration variables
NX_CHAIN_EXPLORER_URL=https://explorer.vega.trading/.netlify/functions/chain-explorer-api
-NX_TENDERMINT_URL=https://lb.testnet.vega.xyz/tm
+NX_TENDERMINT_URL=https://tm.n06.testnet.vega.xyz/tm
NX_TENDERMINT_WEBSOCKET_URL=wss://lb.testnet.vega.xyz/tm/websocket
NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/testnet-network.json
-NX_VEGA_URL=https://lb.testnet.vega.xyz/query
+NX_VEGA_URL=https://api.n11.testnet.vega.xyz/graphql
NX_VEGA_NETWORKS='{"TESTNET":"https://explorer.fairground.wtf","MAINNET":"https://explorer.vega.xyz"}'
NX_VEGA_ENV=TESTNET
-NX_VEGA_REST=https://lb.testnet.vega.xyz/datanode/rest
+NX_VEGA_REST=https://api.n11.testnet.vega.xyz
NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions
diff --git a/apps/explorer/README.md b/apps/explorer/README.md
index f16ef2536..5969e2b64 100644
--- a/apps/explorer/README.md
+++ b/apps/explorer/README.md
@@ -36,7 +36,7 @@ Example configurations are provided here:
- [Capsule](./.env.capsule)
- [Testnet](./.env.testnet)
- [Stagnet1](./.env.stagnet1)
-- [Stagnet2](./.env.stagnet2)
+- [Stagnet3](./.env.stagnet3)
For convenience, you can boot the app injecting one of the configurations above by running:
diff --git a/apps/explorer/src/app/lib/apollo-client.tsx b/apps/explorer/src/app/lib/apollo-client.tsx
index 2b2ed69bd..d5de5e727 100644
--- a/apps/explorer/src/app/lib/apollo-client.tsx
+++ b/apps/explorer/src/app/lib/apollo-client.tsx
@@ -6,9 +6,8 @@ export function createClient(base?: string) {
if (!base) {
throw new Error('Base must be passed into createClient!');
}
- const gqlPath = 'query';
- const urlHTTP = new URL(gqlPath, base);
- const urlWS = new URL(gqlPath, base);
+ const urlHTTP = new URL(base);
+ const urlWS = new URL(base);
// Replace http with ws, preserving if its a secure connection eg. https => wss
urlWS.protocol = urlWS.protocol.replace('http', 'ws');
diff --git a/apps/explorer/src/app/routes/assets/__generated__/AssetsQuery.ts b/apps/explorer/src/app/routes/assets/__generated__/AssetsQuery.ts
index a6e9fbab9..7425e42ea 100644
--- a/apps/explorer/src/app/routes/assets/__generated__/AssetsQuery.ts
+++ b/apps/explorer/src/app/routes/assets/__generated__/AssetsQuery.ts
@@ -12,7 +12,7 @@ import { AccountType } from "@vegaprotocol/types";
export interface AssetsQuery_assets_source_ERC20 {
__typename: "ERC20";
/**
- * The address of the erc20 contract
+ * The address of the ERC20 contract
*/
contractAddress: string;
}
@@ -54,7 +54,7 @@ export interface AssetsQuery_assets_infrastructureFeeAccount {
export interface AssetsQuery_assets {
__typename: "Asset";
/**
- * The id of the asset
+ * The ID of the asset
*/
id: string;
/**
@@ -66,11 +66,11 @@ export interface AssetsQuery_assets {
*/
symbol: string;
/**
- * The precision of the asset
+ * 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)
+ * The origin source of the asset (e.g: an ERC20 asset)
*/
source: AssetsQuery_assets_source;
/**
@@ -81,7 +81,7 @@ export interface AssetsQuery_assets {
export interface AssetsQuery {
/**
- * The list of all assets in use in the vega network
+ * The list of all assets in use in the Vega network
*/
assets: AssetsQuery_assets[] | null;
}
diff --git a/apps/explorer/src/app/routes/governance/__generated__/ProposalsQuery.ts b/apps/explorer/src/app/routes/governance/__generated__/ProposalsQuery.ts
index 0b6f0dbec..7e6d2b10b 100644
--- a/apps/explorer/src/app/routes/governance/__generated__/ProposalsQuery.ts
+++ b/apps/explorer/src/app/routes/governance/__generated__/ProposalsQuery.ts
@@ -17,8 +17,8 @@ export interface ProposalsQuery_proposals_party {
id: string;
}
-export interface ProposalsQuery_proposals_terms_change_NewFreeform {
- __typename: "NewFreeform";
+export interface ProposalsQuery_proposals_terms_change_UpdateAsset {
+ __typename: "UpdateAsset" | "NewFreeform";
}
export interface ProposalsQuery_proposals_terms_change_NewMarket_instrument {
@@ -53,7 +53,7 @@ export interface ProposalsQuery_proposals_terms_change_NewAsset_source_BuiltinAs
export interface ProposalsQuery_proposals_terms_change_NewAsset_source_ERC20 {
__typename: "ERC20";
/**
- * The address of the erc20 contract
+ * The address of the ERC20 contract
*/
contractAddress: string;
}
@@ -67,7 +67,7 @@ export interface ProposalsQuery_proposals_terms_change_NewAsset {
*/
symbol: string;
/**
- * the source of the new Asset
+ * The source of the new asset
*/
source: ProposalsQuery_proposals_terms_change_NewAsset_source;
}
@@ -89,7 +89,7 @@ export interface ProposalsQuery_proposals_terms_change_UpdateNetworkParameter {
networkParameter: ProposalsQuery_proposals_terms_change_UpdateNetworkParameter_networkParameter;
}
-export type ProposalsQuery_proposals_terms_change = ProposalsQuery_proposals_terms_change_NewFreeform | ProposalsQuery_proposals_terms_change_NewMarket | ProposalsQuery_proposals_terms_change_UpdateMarket | ProposalsQuery_proposals_terms_change_NewAsset | ProposalsQuery_proposals_terms_change_UpdateNetworkParameter;
+export type ProposalsQuery_proposals_terms_change = ProposalsQuery_proposals_terms_change_UpdateAsset | ProposalsQuery_proposals_terms_change_NewMarket | ProposalsQuery_proposals_terms_change_UpdateMarket | ProposalsQuery_proposals_terms_change_NewAsset | ProposalsQuery_proposals_terms_change_UpdateNetworkParameter;
export interface ProposalsQuery_proposals_terms {
__typename: "ProposalTerms";
@@ -101,8 +101,9 @@ export interface ProposalsQuery_proposals_terms {
/**
* RFC3339Nano time and date when this proposal is executed (if passed). Note that it has to be after closing date time.
* Constrained by "minEnactInSeconds" and "maxEnactInSeconds" network parameters.
+ * Note: Optional as free form proposals do not require it.
*/
- enactmentDatetime: string;
+ enactmentDatetime: string | null;
/**
* Actual change being introduced by the proposal - action the proposal triggers if passed and enacted.
*/
@@ -148,15 +149,15 @@ export interface ProposalsQuery_proposals_votes_yes_votes {
export interface ProposalsQuery_proposals_votes_yes {
__typename: "ProposalVoteSide";
/**
- * Total tokens of governance token from the votes casted for this side
+ * Total number of governance tokens from the votes cast for this side
*/
totalTokens: string;
/**
- * Total number of votes casted for this side
+ * Total number of votes cast for this side
*/
totalNumber: string;
/**
- * All votes casted for this side
+ * All votes cast for this side
*/
votes: ProposalsQuery_proposals_votes_yes_votes[] | null;
}
@@ -200,15 +201,15 @@ export interface ProposalsQuery_proposals_votes_no_votes {
export interface ProposalsQuery_proposals_votes_no {
__typename: "ProposalVoteSide";
/**
- * Total tokens of governance token from the votes casted for this side
+ * Total number of governance tokens from the votes cast for this side
*/
totalTokens: string;
/**
- * Total number of votes casted for this side
+ * Total number of votes cast for this side
*/
totalNumber: string;
/**
- * All votes casted for this side
+ * All votes cast for this side
*/
votes: ProposalsQuery_proposals_votes_no_votes[] | null;
}
@@ -228,11 +229,11 @@ export interface ProposalsQuery_proposals_votes {
export interface ProposalsQuery_proposals {
__typename: "Proposal";
/**
- * Proposal ID that is filled by VEGA once proposal reaches the network
+ * Proposal ID that is filled by Vega once proposal reaches the network
*/
id: string | null;
/**
- * A UUID reference to aid tracking proposals on VEGA
+ * A UUID reference to aid tracking proposals on Vega
*/
reference: string;
/**
@@ -263,7 +264,7 @@ export interface ProposalsQuery_proposals {
export interface ProposalsQuery {
/**
- * All governance proposals in the VEGA network
+ * All governance proposals in the Vega network
*/
proposals: ProposalsQuery_proposals[] | null;
}
diff --git a/apps/explorer/src/app/routes/markets/__generated__/MarketsQuery.ts b/apps/explorer/src/app/routes/markets/__generated__/MarketsQuery.ts
index b2d3e6f96..8d6afc124 100644
--- a/apps/explorer/src/app/routes/markets/__generated__/MarketsQuery.ts
+++ b/apps/explorer/src/app/routes/markets/__generated__/MarketsQuery.ts
@@ -52,7 +52,7 @@ export interface MarketsQuery_markets_tradableInstrument_instrument_product_sett
export interface MarketsQuery_markets_tradableInstrument_instrument_product_settlementAsset {
__typename: "Asset";
/**
- * The id of the asset
+ * The ID of the asset
*/
id: string;
/**
@@ -60,7 +60,7 @@ export interface MarketsQuery_markets_tradableInstrument_instrument_product_sett
*/
name: string;
/**
- * The precision of the asset
+ * 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;
/**
@@ -108,11 +108,11 @@ export interface MarketsQuery_markets_tradableInstrument_riskModel_LogNormalRisk
*/
r: number;
/**
- * sigma parameter
+ * sigma parameter, annualised volatility of the underlying asset, must be a strictly non-negative real number
*/
sigma: number;
/**
- * mu parameter
+ * mu parameter, annualised growth rate of the underlying asset
*/
mu: number;
}
@@ -120,15 +120,15 @@ export interface MarketsQuery_markets_tradableInstrument_riskModel_LogNormalRisk
export interface MarketsQuery_markets_tradableInstrument_riskModel_LogNormalRiskModel {
__typename: "LogNormalRiskModel";
/**
- * Tau parameter of the risk model
+ * Tau parameter of the risk model, projection horizon measured as a year fraction used in the expected shortfall calculation to obtain the maintenance margin, must be a strictly non-negative real number
*/
tau: number;
/**
- * Lambda parameter of the risk model
+ * Lambda parameter of the risk model, probability confidence level used in expected shortfall calculation when obtaining the maintenance margin level, must be strictly greater than 0 and strictly smaller than 1
*/
riskAversionParameter: number;
/**
- * Params for the log normal risk model
+ * Parameters for the log normal risk model
*/
params: MarketsQuery_markets_tradableInstrument_riskModel_LogNormalRiskModel_params;
}
@@ -166,7 +166,7 @@ export interface MarketsQuery_markets_tradableInstrument_marginCalculator_scalin
*/
initialMargin: number;
/**
- * The scaling factor that determines the overflow margin level
+ * the scaling factor that determines the overflow margin level
*/
collateralRelease: number;
}
@@ -182,7 +182,7 @@ export interface MarketsQuery_markets_tradableInstrument_marginCalculator {
export interface MarketsQuery_markets_tradableInstrument {
__typename: "TradableInstrument";
/**
- * An instance of or reference to a fully specified instrument.
+ * An instance of, or reference to, a fully specified instrument.
*/
instrument: MarketsQuery_markets_tradableInstrument_instrument;
/**
@@ -219,7 +219,7 @@ export interface MarketsQuery_markets_priceMonitoringSettings_parameters_trigger
probability: number;
/**
* Price monitoring auction extension duration in seconds should the price
- * breach it's theoretical level over the specified horizon at the specified
+ * breach its theoretical level over the specified horizon at the specified
* probability level (> 0)
*/
auctionExtensionSecs: number;
@@ -239,10 +239,6 @@ export interface MarketsQuery_markets_priceMonitoringSettings {
* Specified a set of PriceMonitoringParameters to be use for price monitoring purposes
*/
parameters: MarketsQuery_markets_priceMonitoringSettings_parameters | null;
- /**
- * How often (in seconds) the price monitoring bounds should be updated
- */
- updateFrequencySecs: number;
}
export interface MarketsQuery_markets_liquidityMonitoringParameters_targetStakeParameters {
@@ -272,7 +268,7 @@ export interface MarketsQuery_markets_liquidityMonitoringParameters {
export interface MarketsQuery_markets_proposal {
__typename: "Proposal";
/**
- * Proposal ID that is filled by VEGA once proposal reaches the network
+ * Proposal ID that is filled by Vega once proposal reaches the network
*/
id: string | null;
}
@@ -280,7 +276,7 @@ export interface MarketsQuery_markets_proposal {
export interface MarketsQuery_markets_accounts_asset {
__typename: "Asset";
/**
- * The id of the asset
+ * The ID of the asset
*/
id: string;
/**
@@ -309,7 +305,7 @@ export interface MarketsQuery_markets_data_priceMonitoringBounds_trigger {
__typename: "PriceMonitoringTrigger";
/**
* Price monitoring auction extension duration in seconds should the price
- * breach it's theoretical level over the specified horizon at the specified
+ * breach its theoretical level over the specified horizon at the specified
* probability level (> 0)
*/
auctionExtensionSecs: number;
@@ -350,15 +346,15 @@ export interface MarketsQuery_markets_data_liquidityProviderFeeShare_party {
export interface MarketsQuery_markets_data_liquidityProviderFeeShare {
__typename: "LiquidityProviderFeeShare";
/**
- * The liquidity provider party id
+ * The liquidity provider party ID
*/
party: MarketsQuery_markets_data_liquidityProviderFeeShare_party;
/**
- * The share own by this liquidity provider (float)
+ * The share owned by this liquidity provider (float)
*/
equityLikeShare: string;
/**
- * the average entry valuation of the liquidity provider for the market
+ * The average entry valuation of the liquidity provider for the market
*/
averageEntryValuation: string;
}
@@ -366,7 +362,7 @@ export interface MarketsQuery_markets_data_liquidityProviderFeeShare {
export interface MarketsQuery_markets_data {
__typename: "MarketData";
/**
- * the mark price (actually an unsigned int)
+ * the mark price (an unsigned integer)
*/
markPrice: string;
/**
@@ -450,7 +446,7 @@ export interface MarketsQuery_markets_data {
*/
suppliedStake: string | null;
/**
- * A list of valid price ranges per associated trigger
+ * a list of valid price ranges per associated trigger
*/
priceMonitoringBounds: MarketsQuery_markets_data_priceMonitoringBounds[] | null;
/**
@@ -478,12 +474,12 @@ export interface MarketsQuery_markets {
*/
fees: MarketsQuery_markets_fees;
/**
- * An instance of or reference to a tradable instrument.
+ * An instance of, or reference to, a tradable instrument.
*/
tradableInstrument: MarketsQuery_markets_tradableInstrument;
/**
* 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)
+ * number denominated in the currency of the market. (uint64)
*
* Examples:
* Currency Balance decimalPlaces Real Balance
@@ -520,7 +516,7 @@ export interface MarketsQuery_markets {
*/
state: MarketState;
/**
- * The proposal which initiated this market
+ * The proposal that initiated this market
*/
proposal: MarketsQuery_markets_proposal | null;
/**
diff --git a/apps/explorer/src/app/routes/markets/index.tsx b/apps/explorer/src/app/routes/markets/index.tsx
index 65fe3e5fb..5f8fe8f4d 100644
--- a/apps/explorer/src/app/routes/markets/index.tsx
+++ b/apps/explorer/src/app/routes/markets/index.tsx
@@ -78,7 +78,6 @@ const MARKETS_QUERY = gql`
auctionExtensionSecs
}
}
- updateFrequencySecs
}
liquidityMonitoringParameters {
triggeringRatio
diff --git a/apps/explorer/src/app/routes/oracles/__generated__/OracleSpecs.ts b/apps/explorer/src/app/routes/oracles/__generated__/OracleSpecs.ts
index 676ebde9b..cecdb1a11 100644
--- a/apps/explorer/src/app/routes/oracles/__generated__/OracleSpecs.ts
+++ b/apps/explorer/src/app/routes/oracles/__generated__/OracleSpecs.ts
@@ -61,7 +61,7 @@ export interface OracleSpecs_oracleSpecs {
*/
status: OracleSpecStatus;
/**
- * id is a hash generated from the OracleSpec data.
+ * ID is a hash generated from the OracleSpec data.
*/
id: string;
/**
diff --git a/apps/explorer/src/app/routes/parties/id/__generated__/PartyAssetsQuery.ts b/apps/explorer/src/app/routes/parties/id/__generated__/PartyAssetsQuery.ts
index cadc28733..8f43167b7 100644
--- a/apps/explorer/src/app/routes/parties/id/__generated__/PartyAssetsQuery.ts
+++ b/apps/explorer/src/app/routes/parties/id/__generated__/PartyAssetsQuery.ts
@@ -12,7 +12,7 @@ import { AccountType } from "@vegaprotocol/types";
export interface PartyAssetsQuery_party_delegations_node {
__typename: "Node";
/**
- * The node url eg n01.vega.xyz
+ * The node URL eg n01.vega.xyz
*/
id: string;
name: string;
@@ -49,7 +49,7 @@ export interface PartyAssetsQuery_party_accounts_asset_source_BuiltinAsset {
export interface PartyAssetsQuery_party_accounts_asset_source_ERC20 {
__typename: "ERC20";
/**
- * The address of the erc20 contract
+ * The address of the ERC20 contract
*/
contractAddress: string;
}
@@ -63,11 +63,11 @@ export interface PartyAssetsQuery_party_accounts_asset {
*/
name: string;
/**
- * The id of the asset
+ * The ID of the asset
*/
id: string;
/**
- * The precision of the asset
+ * 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;
/**
@@ -75,7 +75,7 @@ export interface PartyAssetsQuery_party_accounts_asset {
*/
symbol: string;
/**
- * The origin source of the asset (e.g: an erc20 asset)
+ * The origin source of the asset (e.g: an ERC20 asset)
*/
source: PartyAssetsQuery_party_accounts_asset_source;
}
@@ -115,7 +115,7 @@ export interface PartyAssetsQuery_party {
export interface PartyAssetsQuery {
/**
- * An entity that is trading on the VEGA network
+ * An entity that is trading on the Vega network
*/
party: PartyAssetsQuery_party | null;
}
diff --git a/apps/explorer/src/app/routes/pending/index.tsx b/apps/explorer/src/app/routes/pending/index.tsx
index 07563d51c..88dcf5800 100644
--- a/apps/explorer/src/app/routes/pending/index.tsx
+++ b/apps/explorer/src/app/routes/pending/index.tsx
@@ -17,7 +17,7 @@ const PendingTxs = () => {
{t('Unconfirmed transactions')}
- https://lb.testnet.vega.xyz/tm/unconfirmed_txs
+ https://tm.n06.testnet.vega.xyz/tm/unconfirmed_txs
@@ -190,10 +190,10 @@ export const TradingModeTooltip = ({ market }: TradingModeTooltipProps) => {
}
}
}
- case MarketTradingMode.NoTrading: {
+ case MarketTradingMode.TRADING_MODE_NO_TRADING: {
return <>{t('No trading enabled for this market.')}>;
}
- case MarketTradingMode.BatchAuction:
+ case MarketTradingMode.TRADING_MODE_BATCH_AUCTION:
default: {
return null;
}
diff --git a/apps/trading/lib/__generated__/AssetFields.ts b/apps/trading/lib/__generated__/AssetFields.ts
index b3fcc69e0..8a0b8f28b 100644
--- a/apps/trading/lib/__generated__/AssetFields.ts
+++ b/apps/trading/lib/__generated__/AssetFields.ts
@@ -14,7 +14,7 @@ export interface AssetFields_source_BuiltinAsset {
export interface AssetFields_source_ERC20 {
__typename: "ERC20";
/**
- * The address of the erc20 contract
+ * The address of the ERC20 contract
*/
contractAddress: string;
}
@@ -24,7 +24,7 @@ export type AssetFields_source = AssetFields_source_BuiltinAsset | AssetFields_s
export interface AssetFields {
__typename: "Asset";
/**
- * The id of the asset
+ * The ID of the asset
*/
id: string;
/**
@@ -36,11 +36,11 @@ export interface AssetFields {
*/
name: string;
/**
- * The precision of the asset
+ * 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)
+ * The origin source of the asset (e.g: an ERC20 asset)
*/
source: AssetFields_source;
}
diff --git a/apps/trading/lib/apollo-client.ts b/apps/trading/lib/apollo-client.ts
index 671262243..35dbfc61f 100644
--- a/apps/trading/lib/apollo-client.ts
+++ b/apps/trading/lib/apollo-client.ts
@@ -16,9 +16,8 @@ export function createClient(base?: string) {
if (!base) {
throw new Error('Base must be passed into createClient!');
}
- const gqlPath = 'query';
- const urlHTTP = new URL(gqlPath, base);
- const urlWS = new URL(gqlPath, base);
+ const urlHTTP = new URL(base);
+ const urlWS = new URL(base);
// Replace http with ws, preserving if its a secure connection eg. https => wss
urlWS.protocol = urlWS.protocol.replace('http', 'ws');
diff --git a/apps/trading/pages/markets/[marketId].page.tsx b/apps/trading/pages/markets/[marketId].page.tsx
index 25364135c..3f3ce94c1 100644
--- a/apps/trading/pages/markets/[marketId].page.tsx
+++ b/apps/trading/pages/markets/[marketId].page.tsx
@@ -102,7 +102,7 @@ const MarketPage = ({ id }: { id?: string }) => {
options={{
variables: {
marketId,
- interval: Interval.I1H,
+ interval: Interval.INTERVAL_I1H,
since: yTimestamp,
},
fetchPolicy: 'network-only',
diff --git a/apps/trading/pages/markets/__generated__/Market.ts b/apps/trading/pages/markets/__generated__/Market.ts
index 74a04c52d..a5ed203da 100644
--- a/apps/trading/pages/markets/__generated__/Market.ts
+++ b/apps/trading/pages/markets/__generated__/Market.ts
@@ -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 ID of the associated mark price
*/
market: Market_market_data_market;
/**
@@ -32,7 +32,7 @@ export interface Market_market_data {
*/
auctionEnd: string | null;
/**
- * the mark price (actually an unsigned int)
+ * the mark price (an unsigned integer)
*/
markPrice: string;
/**
@@ -84,7 +84,7 @@ export interface Market_market_tradableInstrument_instrument_metadata {
export interface Market_market_tradableInstrument_instrument_product_settlementAsset {
__typename: "Asset";
/**
- * The id of the asset
+ * The ID of the asset
*/
id: string;
/**
@@ -136,7 +136,7 @@ export interface Market_market_tradableInstrument_instrument {
export interface Market_market_tradableInstrument {
__typename: "TradableInstrument";
/**
- * An instance of or reference to a fully specified instrument.
+ * An instance of, or reference to, a fully specified instrument.
*/
instrument: Market_market_tradableInstrument_instrument;
}
@@ -189,7 +189,7 @@ export interface Market_market {
state: MarketState;
/**
* 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)
+ * number denominated in the currency of the market. (uint64)
*
* Examples:
* Currency Balance decimalPlaces Real Balance
@@ -205,9 +205,10 @@ export interface Market_market {
*/
decimalPlaces: number;
/**
- * positionDecimalPlaces indicated the number of decimal places that an integer must be shifted in order to get a correct size (uint64).
+ * positionDecimalPlaces indicates the number of decimal places that an integer must be shifted in order to get a correct size (uint64).
* i.e. 0 means there are no fractional orders for the market, and order sizes are always whole sizes.
* 2 means sizes given as 10^2 * desired size, e.g. a desired size of 1.23 is represented as 123 in this market.
+ * This sets how big the smallest order / position on the market can be.
*/
positionDecimalPlaces: number;
/**
@@ -215,7 +216,7 @@ export interface Market_market {
*/
data: Market_market_data | null;
/**
- * An instance of or reference to a tradable instrument.
+ * An instance of, or reference to, a tradable instrument.
*/
tradableInstrument: Market_market_tradableInstrument;
/**
@@ -223,14 +224,14 @@ export interface Market_market {
*/
marketTimestamps: Market_market_marketTimestamps;
/**
- * Candles on a market, for the 'last' n candles, at 'interval' seconds as specified by params
+ * Candles on a market, for the 'last' n candles, at 'interval' seconds as specified by parameters
*/
candles: (Market_market_candles | null)[] | null;
}
export interface Market {
/**
- * An instrument that is trading on the VEGA network
+ * An instrument that is trading on the Vega network
*/
market: Market_market | null;
}
diff --git a/apps/trading/pages/markets/trade-grid.tsx b/apps/trading/pages/markets/trade-grid.tsx
index 1ca7e24ee..ed23f9313 100644
--- a/apps/trading/pages/markets/trade-grid.tsx
+++ b/apps/trading/pages/markets/trade-grid.tsx
@@ -119,9 +119,11 @@ export const TradeMarketHeader = ({
{t('Trading mode')}
- {market.tradingMode === MarketTradingMode.MonitoringAuction &&
+ {market.tradingMode ===
+ MarketTradingMode.TRADING_MODE_MONITORING_AUCTION &&
market.data?.trigger &&
- market.data.trigger !== AuctionTrigger.Unspecified
+ market.data.trigger !==
+ AuctionTrigger.AUCTION_TRIGGER_UNSPECIFIED
? `${formatLabel(
market.tradingMode
)} - ${market.data?.trigger.toLowerCase()}`
diff --git a/apps/trading/pages/portfolio/deposit/__generated__/DepositPage.ts b/apps/trading/pages/portfolio/deposit/__generated__/DepositPage.ts
index e2c9a2bf2..b2e16b21c 100644
--- a/apps/trading/pages/portfolio/deposit/__generated__/DepositPage.ts
+++ b/apps/trading/pages/portfolio/deposit/__generated__/DepositPage.ts
@@ -14,7 +14,7 @@ export interface DepositPage_assets_source_BuiltinAsset {
export interface DepositPage_assets_source_ERC20 {
__typename: "ERC20";
/**
- * The address of the erc20 contract
+ * The address of the ERC20 contract
*/
contractAddress: string;
}
@@ -24,7 +24,7 @@ export type DepositPage_assets_source = DepositPage_assets_source_BuiltinAsset |
export interface DepositPage_assets {
__typename: "Asset";
/**
- * The id of the asset
+ * The ID of the asset
*/
id: string;
/**
@@ -36,18 +36,18 @@ export interface DepositPage_assets {
*/
name: string;
/**
- * The precision of the asset
+ * 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)
+ * The origin source of the asset (e.g: an ERC20 asset)
*/
source: DepositPage_assets_source;
}
export interface DepositPage {
/**
- * The list of all assets in use in the vega network
+ * The list of all assets in use in the Vega network
*/
assets: DepositPage_assets[] | null;
}
diff --git a/apps/trading/pages/portfolio/withdraw/__generated__/WithdrawPageQuery.ts b/apps/trading/pages/portfolio/withdraw/__generated__/WithdrawPageQuery.ts
index 73b17a363..c64b4f3ba 100644
--- a/apps/trading/pages/portfolio/withdraw/__generated__/WithdrawPageQuery.ts
+++ b/apps/trading/pages/portfolio/withdraw/__generated__/WithdrawPageQuery.ts
@@ -12,7 +12,7 @@ import { AccountType } from "@vegaprotocol/types";
export interface WithdrawPageQuery_party_withdrawals {
__typename: "Withdrawal";
/**
- * The Vega internal id of the withdrawal
+ * The Vega internal ID of the withdrawal
*/
id: string;
/**
@@ -24,7 +24,7 @@ export interface WithdrawPageQuery_party_withdrawals {
export interface WithdrawPageQuery_party_accounts_asset {
__typename: "Asset";
/**
- * The id of the asset
+ * The ID of the asset
*/
id: string;
/**
@@ -72,7 +72,7 @@ export interface WithdrawPageQuery_assets_source_BuiltinAsset {
export interface WithdrawPageQuery_assets_source_ERC20 {
__typename: "ERC20";
/**
- * The address of the erc20 contract
+ * The address of the ERC20 contract
*/
contractAddress: string;
}
@@ -82,7 +82,7 @@ export type WithdrawPageQuery_assets_source = WithdrawPageQuery_assets_source_Bu
export interface WithdrawPageQuery_assets {
__typename: "Asset";
/**
- * The id of the asset
+ * The ID of the asset
*/
id: string;
/**
@@ -94,22 +94,22 @@ export interface WithdrawPageQuery_assets {
*/
name: string;
/**
- * The precision of the asset
+ * 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)
+ * The origin source of the asset (e.g: an ERC20 asset)
*/
source: WithdrawPageQuery_assets_source;
}
export interface WithdrawPageQuery {
/**
- * An entity that is trading on the VEGA network
+ * An entity that is trading on the Vega network
*/
party: WithdrawPageQuery_party | null;
/**
- * The list of all assets in use in the vega network
+ * The list of all assets in use in the Vega network
*/
assets: WithdrawPageQuery_assets[] | null;
}
diff --git a/libs/accounts/src/lib/__generated__/AccountFields.ts b/libs/accounts/src/lib/__generated__/AccountFields.ts
index 94b155b9a..ef318db37 100644
--- a/libs/accounts/src/lib/__generated__/AccountFields.ts
+++ b/libs/accounts/src/lib/__generated__/AccountFields.ts
@@ -24,7 +24,7 @@ export interface AccountFields_market {
export interface AccountFields_asset {
__typename: "Asset";
/**
- * The id of the asset
+ * The ID of the asset
*/
id: string;
/**
@@ -32,7 +32,7 @@ export interface AccountFields_asset {
*/
symbol: string;
/**
- * The precision of the asset
+ * 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;
}
diff --git a/libs/accounts/src/lib/__generated__/AccountSubscribe.ts b/libs/accounts/src/lib/__generated__/AccountSubscribe.ts
index 72c2b26bf..d874321ec 100644
--- a/libs/accounts/src/lib/__generated__/AccountSubscribe.ts
+++ b/libs/accounts/src/lib/__generated__/AccountSubscribe.ts
@@ -24,7 +24,7 @@ export interface AccountSubscribe_accounts_market {
export interface AccountSubscribe_accounts_asset {
__typename: "Asset";
/**
- * The id of the asset
+ * The ID of the asset
*/
id: string;
/**
@@ -32,7 +32,7 @@ export interface AccountSubscribe_accounts_asset {
*/
symbol: string;
/**
- * The precision of the asset
+ * 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;
}
diff --git a/libs/accounts/src/lib/__generated__/Accounts.ts b/libs/accounts/src/lib/__generated__/Accounts.ts
index 893009d1c..e39ae8d1b 100644
--- a/libs/accounts/src/lib/__generated__/Accounts.ts
+++ b/libs/accounts/src/lib/__generated__/Accounts.ts
@@ -24,7 +24,7 @@ export interface Accounts_party_accounts_market {
export interface Accounts_party_accounts_asset {
__typename: "Asset";
/**
- * The id of the asset
+ * The ID of the asset
*/
id: string;
/**
@@ -32,7 +32,7 @@ export interface Accounts_party_accounts_asset {
*/
symbol: string;
/**
- * The precision of the asset
+ * 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;
}
@@ -71,7 +71,7 @@ export interface Accounts_party {
export interface Accounts {
/**
- * An entity that is trading on the VEGA network
+ * An entity that is trading on the Vega network
*/
party: Accounts_party | null;
}
diff --git a/libs/accounts/src/lib/accounts-table.spec.tsx b/libs/accounts/src/lib/accounts-table.spec.tsx
index 8dda506aa..1cf0953bf 100644
--- a/libs/accounts/src/lib/accounts-table.spec.tsx
+++ b/libs/accounts/src/lib/accounts-table.spec.tsx
@@ -5,7 +5,7 @@ import { AccountType } from '@vegaprotocol/types';
const singleRow: Accounts_party_accounts = {
__typename: 'Account',
- type: AccountType.Margin,
+ type: AccountType.ACCOUNT_TYPE_MARGIN,
balance: '125600000',
market: {
__typename: 'Market',
diff --git a/libs/candles-chart/src/lib/__generated__/Candles.ts b/libs/candles-chart/src/lib/__generated__/Candles.ts
index 118405874..21f13dcbc 100644
--- a/libs/candles-chart/src/lib/__generated__/Candles.ts
+++ b/libs/candles-chart/src/lib/__generated__/Candles.ts
@@ -28,7 +28,7 @@ export interface Candles_market_tradableInstrument_instrument {
export interface Candles_market_tradableInstrument {
__typename: "TradableInstrument";
/**
- * An instance of or reference to a fully specified instrument.
+ * An instance of, or reference to, a fully specified instrument.
*/
instrument: Candles_market_tradableInstrument_instrument;
}
@@ -69,7 +69,7 @@ export interface Candles_market {
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)
+ * number denominated in the currency of the market. (uint64)
*
* Examples:
* Currency Balance decimalPlaces Real Balance
@@ -85,18 +85,18 @@ export interface Candles_market {
*/
decimalPlaces: number;
/**
- * An instance of or reference to a tradable instrument.
+ * 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 params
+ * 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
+ * An instrument that is trading on the Vega network
*/
market: Candles_market | null;
}
diff --git a/libs/candles-chart/src/lib/__generated__/Chart.ts b/libs/candles-chart/src/lib/__generated__/Chart.ts
index 8b204633c..e7dbd0c80 100644
--- a/libs/candles-chart/src/lib/__generated__/Chart.ts
+++ b/libs/candles-chart/src/lib/__generated__/Chart.ts
@@ -26,7 +26,7 @@ export interface Chart_market_data_priceMonitoringBounds {
export interface Chart_market_data {
__typename: "MarketData";
/**
- * A list of valid price ranges per associated trigger
+ * a list of valid price ranges per associated trigger
*/
priceMonitoringBounds: Chart_market_data_priceMonitoringBounds[] | null;
}
@@ -35,7 +35,7 @@ export interface Chart_market {
__typename: "Market";
/**
* 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)
+ * number denominated in the currency of the market. (uint64)
*
* Examples:
* Currency Balance decimalPlaces Real Balance
@@ -58,7 +58,7 @@ export interface Chart_market {
export interface Chart {
/**
- * An instrument that is trading on the VEGA network
+ * An instrument that is trading on the Vega network
*/
market: Chart_market | null;
}
diff --git a/libs/candles-chart/src/lib/data-source.ts b/libs/candles-chart/src/lib/data-source.ts
index 88b5d8f6e..84095bd56 100644
--- a/libs/candles-chart/src/lib/data-source.ts
+++ b/libs/candles-chart/src/lib/data-source.ts
@@ -1,6 +1,7 @@
import type { ApolloClient } from '@apollo/client';
import { gql } from '@apollo/client';
import type { Candle, DataSource } from 'pennant';
+import { Interval as PennantInterval } from 'pennant';
import { addDecimal } from '@vegaprotocol/react-helpers';
import type { Chart, ChartVariables } from './__generated__/Chart';
@@ -13,6 +14,15 @@ import type {
import type { Subscription } from 'zen-observable-ts';
import { Interval } from '@vegaprotocol/types';
+const INTERVAL_TO_PENNANT_MAP = {
+ [PennantInterval.I1M]: Interval.INTERVAL_I1M,
+ [PennantInterval.I5M]: Interval.INTERVAL_I5M,
+ [PennantInterval.I15M]: Interval.INTERVAL_I15M,
+ [PennantInterval.I1H]: Interval.INTERVAL_I1H,
+ [PennantInterval.I6H]: Interval.INTERVAL_I6H,
+ [PennantInterval.I1D]: Interval.INTERVAL_I1D,
+};
+
export const CANDLE_FRAGMENT = gql`
fragment CandleFields on Candle {
datetime
@@ -71,12 +81,12 @@ const CHART_QUERY = gql`
const defaultConfig = {
decimalPlaces: 5,
supportedIntervals: [
- Interval.I1D,
- Interval.I6H,
- Interval.I1H,
- Interval.I15M,
- Interval.I5M,
- Interval.I1M,
+ PennantInterval.I1D,
+ PennantInterval.I6H,
+ PennantInterval.I1H,
+ PennantInterval.I15M,
+ PennantInterval.I5M,
+ PennantInterval.I1M,
],
priceMonitoringBounds: [],
};
@@ -135,12 +145,12 @@ export class VegaDataSource implements DataSource {
return {
decimalPlaces: this._decimalPlaces,
supportedIntervals: [
- Interval.I1D,
- Interval.I6H,
- Interval.I1H,
- Interval.I15M,
- Interval.I5M,
- Interval.I1M,
+ PennantInterval.I1D,
+ PennantInterval.I6H,
+ PennantInterval.I1H,
+ PennantInterval.I15M,
+ PennantInterval.I5M,
+ PennantInterval.I1M,
],
priceMonitoringBounds:
data.market.data.priceMonitoringBounds?.map((bounds) => ({
@@ -166,13 +176,13 @@ export class VegaDataSource implements DataSource {
/**
* Used by the charting library to get historical data.
*/
- async query(interval: Interval, from: string) {
+ async query(interval: PennantInterval, from: string) {
try {
const { data } = await this.client.query({
query: CANDLES_QUERY,
variables: {
marketId: this.marketId,
- interval,
+ interval: INTERVAL_TO_PENNANT_MAP[interval],
since: from,
},
fetchPolicy: 'no-cache',
@@ -198,12 +208,15 @@ export class VegaDataSource implements DataSource {
* Used by the charting library to create a subscription to streaming data.
*/
subscribeData(
- interval: Interval,
+ interval: PennantInterval,
onSubscriptionData: (data: Candle) => void
) {
const res = this.client.subscribe({
query: CANDLES_SUB,
- variables: { marketId: this.marketId, interval },
+ variables: {
+ marketId: this.marketId,
+ interval: INTERVAL_TO_PENNANT_MAP[interval],
+ },
});
this.candlesSub = res.subscribe(({ data }) => {
diff --git a/libs/cypress/src/lib/commands/mock-gql.ts b/libs/cypress/src/lib/commands/mock-gql.ts
index f4ba03b4a..ae41ae4da 100644
--- a/libs/cypress/src/lib/commands/mock-gql.ts
+++ b/libs/cypress/src/lib/commands/mock-gql.ts
@@ -12,8 +12,10 @@ declare global {
export function addMockGQLCommand() {
Cypress.Commands.add('mockGQL', (handler: RouteHandler) => {
- cy.intercept('POST', 'https://lb.testnet.vega.xyz/query', handler).as(
- 'GQL'
- );
+ cy.intercept(
+ 'POST',
+ 'https://api.n11.testnet.vega.xyz/graphql',
+ handler
+ ).as('GQL');
});
}
diff --git a/libs/deal-ticket/src/components/__generated__/DealTicketQuery.ts b/libs/deal-ticket/src/components/__generated__/DealTicketQuery.ts
index 6ef458eb1..283cdaa4d 100644
--- a/libs/deal-ticket/src/components/__generated__/DealTicketQuery.ts
+++ b/libs/deal-ticket/src/components/__generated__/DealTicketQuery.ts
@@ -12,7 +12,7 @@ import { MarketState, MarketTradingMode } from "@vegaprotocol/types";
export interface DealTicketQuery_market_tradableInstrument_instrument_product_settlementAsset {
__typename: "Asset";
/**
- * The id of the asset
+ * The ID of the asset
*/
id: string;
/**
@@ -52,7 +52,7 @@ export interface DealTicketQuery_market_tradableInstrument_instrument {
export interface DealTicketQuery_market_tradableInstrument {
__typename: "TradableInstrument";
/**
- * An instance of or reference to a fully specified instrument.
+ * An instance of, or reference to, a fully specified instrument.
*/
instrument: DealTicketQuery_market_tradableInstrument_instrument;
}
@@ -85,7 +85,7 @@ export interface DealTicketQuery_market {
name: 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)
+ * number denominated in the currency of the market. (uint64)
*
* Examples:
* Currency Balance decimalPlaces Real Balance
@@ -101,9 +101,10 @@ export interface DealTicketQuery_market {
*/
decimalPlaces: number;
/**
- * positionDecimalPlaces indicated the number of decimal places that an integer must be shifted in order to get a correct size (uint64).
+ * positionDecimalPlaces indicates the number of decimal places that an integer must be shifted in order to get a correct size (uint64).
* i.e. 0 means there are no fractional orders for the market, and order sizes are always whole sizes.
* 2 means sizes given as 10^2 * desired size, e.g. a desired size of 1.23 is represented as 123 in this market.
+ * This sets how big the smallest order / position on the market can be.
*/
positionDecimalPlaces: number;
/**
@@ -115,7 +116,7 @@ export interface DealTicketQuery_market {
*/
tradingMode: MarketTradingMode;
/**
- * An instance of or reference to a tradable instrument.
+ * An instance of, or reference to, a tradable instrument.
*/
tradableInstrument: DealTicketQuery_market_tradableInstrument;
/**
@@ -126,7 +127,7 @@ export interface DealTicketQuery_market {
export interface DealTicketQuery {
/**
- * An instrument that is trading on the VEGA network
+ * An instrument that is trading on the Vega network
*/
market: DealTicketQuery_market | null;
}
diff --git a/libs/deal-ticket/src/components/__generated__/MarketInfoQuery.ts b/libs/deal-ticket/src/components/__generated__/MarketInfoQuery.ts
index f9383bb90..cff632bba 100644
--- a/libs/deal-ticket/src/components/__generated__/MarketInfoQuery.ts
+++ b/libs/deal-ticket/src/components/__generated__/MarketInfoQuery.ts
@@ -12,7 +12,7 @@ import { MarketState, MarketTradingMode, AccountType } from "@vegaprotocol/types
export interface MarketInfoQuery_market_accounts_asset {
__typename: "Asset";
/**
- * The id of the asset
+ * The ID of the asset
*/
id: string;
}
@@ -69,7 +69,7 @@ export interface MarketInfoQuery_market_priceMonitoringSettings_parameters_trigg
probability: number;
/**
* Price monitoring auction extension duration in seconds should the price
- * breach it's theoretical level over the specified horizon at the specified
+ * breach its theoretical level over the specified horizon at the specified
* probability level (> 0)
*/
auctionExtensionSecs: number;
@@ -89,10 +89,6 @@ export interface MarketInfoQuery_market_priceMonitoringSettings {
* Specified a set of PriceMonitoringParameters to be use for price monitoring purposes
*/
parameters: MarketInfoQuery_market_priceMonitoringSettings_parameters | null;
- /**
- * How often (in seconds) the price monitoring bounds should be updated
- */
- updateFrequencySecs: number;
}
export interface MarketInfoQuery_market_riskFactors {
@@ -122,11 +118,11 @@ export interface MarketInfoQuery_market_data_market {
export interface MarketInfoQuery_market_data {
__typename: "MarketData";
/**
- * market id of the associated mark price
+ * market ID of the associated mark price
*/
market: MarketInfoQuery_market_data_market;
/**
- * the mark price (actually an unsigned int)
+ * the mark price (an unsigned integer)
*/
markPrice: string;
/**
@@ -190,7 +186,7 @@ export interface MarketInfoQuery_market_tradableInstrument_instrument_metadata {
export interface MarketInfoQuery_market_tradableInstrument_instrument_product_settlementAsset {
__typename: "Asset";
/**
- * The id of the asset
+ * The ID of the asset
*/
id: string;
/**
@@ -206,7 +202,7 @@ export interface MarketInfoQuery_market_tradableInstrument_instrument_product_se
export interface MarketInfoQuery_market_tradableInstrument_instrument_product_oracleSpecForSettlementPrice {
__typename: "OracleSpec";
/**
- * id is a hash generated from the OracleSpec data.
+ * ID is a hash generated from the OracleSpec data.
*/
id: string;
}
@@ -214,7 +210,7 @@ export interface MarketInfoQuery_market_tradableInstrument_instrument_product_or
export interface MarketInfoQuery_market_tradableInstrument_instrument_product_oracleSpecForTradingTermination {
__typename: "OracleSpec";
/**
- * id is a hash generated from the OracleSpec data.
+ * ID is a hash generated from the OracleSpec data.
*/
id: string;
}
@@ -280,11 +276,11 @@ export interface MarketInfoQuery_market_tradableInstrument_riskModel_LogNormalRi
*/
r: number;
/**
- * sigma parameter
+ * sigma parameter, annualised volatility of the underlying asset, must be a strictly non-negative real number
*/
sigma: number;
/**
- * mu parameter
+ * mu parameter, annualised growth rate of the underlying asset
*/
mu: number;
}
@@ -292,15 +288,15 @@ export interface MarketInfoQuery_market_tradableInstrument_riskModel_LogNormalRi
export interface MarketInfoQuery_market_tradableInstrument_riskModel_LogNormalRiskModel {
__typename: "LogNormalRiskModel";
/**
- * Tau parameter of the risk model
+ * Tau parameter of the risk model, projection horizon measured as a year fraction used in the expected shortfall calculation to obtain the maintenance margin, must be a strictly non-negative real number
*/
tau: number;
/**
- * Lambda parameter of the risk model
+ * Lambda parameter of the risk model, probability confidence level used in expected shortfall calculation when obtaining the maintenance margin level, must be strictly greater than 0 and strictly smaller than 1
*/
riskAversionParameter: number;
/**
- * Params for the log normal risk model
+ * Parameters for the log normal risk model
*/
params: MarketInfoQuery_market_tradableInstrument_riskModel_LogNormalRiskModel_params;
}
@@ -330,7 +326,7 @@ export type MarketInfoQuery_market_tradableInstrument_riskModel = MarketInfoQuer
export interface MarketInfoQuery_market_tradableInstrument {
__typename: "TradableInstrument";
/**
- * An instance of or reference to a fully specified instrument.
+ * An instance of, or reference to, a fully specified instrument.
*/
instrument: MarketInfoQuery_market_tradableInstrument_instrument;
/**
@@ -367,7 +363,7 @@ export interface MarketInfoQuery_market {
name: 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)
+ * number denominated in the currency of the market. (uint64)
*
* Examples:
* Currency Balance decimalPlaces Real Balance
@@ -383,9 +379,10 @@ export interface MarketInfoQuery_market {
*/
decimalPlaces: number;
/**
- * positionDecimalPlaces indicated the number of decimal places that an integer must be shifted in order to get a correct size (uint64).
+ * positionDecimalPlaces indicates the number of decimal places that an integer must be shifted in order to get a correct size (uint64).
* i.e. 0 means there are no fractional orders for the market, and order sizes are always whole sizes.
* 2 means sizes given as 10^2 * desired size, e.g. a desired size of 1.23 is represented as 123 in this market.
+ * This sets how big the smallest order / position on the market can be.
*/
positionDecimalPlaces: number;
/**
@@ -421,7 +418,7 @@ export interface MarketInfoQuery_market {
*/
liquidityMonitoringParameters: MarketInfoQuery_market_liquidityMonitoringParameters;
/**
- * An instance of or reference to a tradable instrument.
+ * An instance of, or reference to, a tradable instrument.
*/
tradableInstrument: MarketInfoQuery_market_tradableInstrument;
/**
@@ -432,7 +429,7 @@ export interface MarketInfoQuery_market {
export interface MarketInfoQuery {
/**
- * An instrument that is trading on the VEGA network
+ * An instrument that is trading on the Vega network
*/
market: MarketInfoQuery_market | null;
}
diff --git a/libs/deal-ticket/src/components/__generated__/MarketNames.ts b/libs/deal-ticket/src/components/__generated__/MarketNames.ts
index d0b182a0d..d61c7f220 100644
--- a/libs/deal-ticket/src/components/__generated__/MarketNames.ts
+++ b/libs/deal-ticket/src/components/__generated__/MarketNames.ts
@@ -42,7 +42,7 @@ export interface MarketNames_markets_tradableInstrument_instrument {
export interface MarketNames_markets_tradableInstrument {
__typename: "TradableInstrument";
/**
- * An instance of or reference to a fully specified instrument.
+ * An instance of, or reference to, a fully specified instrument.
*/
instrument: MarketNames_markets_tradableInstrument_instrument;
}
@@ -58,7 +58,7 @@ export interface MarketNames_markets {
*/
name: string;
/**
- * An instance of or reference to a tradable instrument.
+ * An instance of, or reference to, a tradable instrument.
*/
tradableInstrument: MarketNames_markets_tradableInstrument;
}
diff --git a/libs/deal-ticket/src/components/deal-ticket-amount.tsx b/libs/deal-ticket/src/components/deal-ticket-amount.tsx
index f16e8558f..e3f288aeb 100644
--- a/libs/deal-ticket/src/components/deal-ticket-amount.tsx
+++ b/libs/deal-ticket/src/components/deal-ticket-amount.tsx
@@ -1,12 +1,12 @@
import type { UseFormRegister } from 'react-hook-form';
-import { VegaWalletOrderType } from '@vegaprotocol/wallet';
import type { Order } from '@vegaprotocol/orders';
import { DealTicketMarketAmount } from './deal-ticket-market-amount';
import { DealTicketLimitAmount } from './deal-ticket-limit-amount';
import type { DealTicketQuery_market } from './__generated__/DealTicketQuery';
+import { OrderType } from '@vegaprotocol/types';
export interface DealTicketAmountProps {
- orderType: VegaWalletOrderType;
+ orderType: OrderType;
market: DealTicketQuery_market;
register: UseFormRegister;
quoteName: string;
@@ -18,9 +18,9 @@ export const DealTicketAmount = ({
...props
}: DealTicketAmountProps) => {
switch (orderType) {
- case VegaWalletOrderType.Market:
+ case OrderType.TYPE_MARKET:
return ;
- case VegaWalletOrderType.Limit:
+ case OrderType.TYPE_LIMIT:
return ;
default: {
throw new Error('Invalid ticket type');
diff --git a/libs/deal-ticket/src/components/deal-ticket-manager.tsx b/libs/deal-ticket/src/components/deal-ticket-manager.tsx
index e1a0b36fa..736403ed9 100644
--- a/libs/deal-ticket/src/components/deal-ticket-manager.tsx
+++ b/libs/deal-ticket/src/components/deal-ticket-manager.tsx
@@ -52,21 +52,21 @@ export const getOrderDialogTitle = (
}
switch (status) {
- case OrderStatus.Active:
+ case OrderStatus.STATUS_ACTIVE:
return t('Order submitted');
- case OrderStatus.Filled:
+ case OrderStatus.STATUS_FILLED:
return t('Order filled');
- case OrderStatus.PartiallyFilled:
+ case OrderStatus.STATUS_PARTIALLY_FILLED:
return t('Order partially filled');
- case OrderStatus.Parked:
+ case OrderStatus.STATUS_PARKED:
return t('Order parked');
- case OrderStatus.Stopped:
+ case OrderStatus.STATUS_STOPPED:
return t('Order stopped');
- case OrderStatus.Cancelled:
+ case OrderStatus.STATUS_CANCELLED:
return t('Order cancelled');
- case OrderStatus.Expired:
+ case OrderStatus.STATUS_EXPIRED:
return t('Order expired');
- case OrderStatus.Rejected:
+ case OrderStatus.STATUS_REJECTED:
return t('Order rejected');
default:
return t('Submission failed');
@@ -80,16 +80,16 @@ export const getOrderDialogIntent = (
return;
}
switch (status) {
- case OrderStatus.Parked:
- case OrderStatus.Expired:
- case OrderStatus.PartiallyFilled:
+ case OrderStatus.STATUS_PARKED:
+ case OrderStatus.STATUS_EXPIRED:
+ case OrderStatus.STATUS_PARTIALLY_FILLED:
return Intent.Warning;
- case OrderStatus.Rejected:
- case OrderStatus.Stopped:
- case OrderStatus.Cancelled:
+ case OrderStatus.STATUS_REJECTED:
+ case OrderStatus.STATUS_STOPPED:
+ case OrderStatus.STATUS_CANCELLED:
return Intent.Danger;
- case OrderStatus.Filled:
- case OrderStatus.Active:
+ case OrderStatus.STATUS_FILLED:
+ case OrderStatus.STATUS_ACTIVE:
return Intent.Success;
default:
return;
@@ -104,12 +104,12 @@ export const getOrderDialogIcon = (
}
switch (status) {
- case OrderStatus.Parked:
- case OrderStatus.Expired:
+ case OrderStatus.STATUS_PARKED:
+ case OrderStatus.STATUS_EXPIRED:
return ;
- case OrderStatus.Rejected:
- case OrderStatus.Stopped:
- case OrderStatus.Cancelled:
+ case OrderStatus.STATUS_REJECTED:
+ case OrderStatus.STATUS_STOPPED:
+ case OrderStatus.STATUS_CANCELLED:
return ;
default:
return;
diff --git a/libs/deal-ticket/src/components/deal-ticket.spec.tsx b/libs/deal-ticket/src/components/deal-ticket.spec.tsx
index cdb1f78ea..bc7c792e8 100644
--- a/libs/deal-ticket/src/components/deal-ticket.spec.tsx
+++ b/libs/deal-ticket/src/components/deal-ticket.spec.tsx
@@ -1,13 +1,14 @@
-import {
- VegaWalletContext,
- VegaWalletOrderTimeInForce,
- VegaWalletOrderType,
-} from '@vegaprotocol/wallet';
+import { VegaWalletContext } from '@vegaprotocol/wallet';
import { addDecimal } from '@vegaprotocol/react-helpers';
import { fireEvent, render, screen, act } from '@testing-library/react';
import { DealTicket } from './deal-ticket';
import type { DealTicketQuery_market } from './__generated__/DealTicketQuery';
-import { MarketState, MarketTradingMode } from '@vegaprotocol/types';
+import {
+ MarketState,
+ MarketTradingMode,
+ OrderTimeInForce,
+ OrderType,
+} from '@vegaprotocol/types';
import type { Order } from '@vegaprotocol/orders';
const market: DealTicketQuery_market = {
@@ -16,8 +17,8 @@ const market: DealTicketQuery_market = {
name: 'market-name',
decimalPlaces: 2,
positionDecimalPlaces: 1,
- tradingMode: MarketTradingMode.Continuous,
- state: MarketState.Active,
+ tradingMode: MarketTradingMode.TRADING_MODE_CONTINUOUS,
+ state: MarketState.STATE_ACTIVE,
tradableInstrument: {
__typename: 'TradableInstrument',
instrument: {
@@ -65,7 +66,7 @@ describe('DealTicket', () => {
// Assert defaults are used
expect(
- screen.getByTestId(`order-type-${VegaWalletOrderType.Market}-selected`)
+ screen.getByTestId(`order-type-${OrderType.TYPE_MARKET}-selected`)
).toBeInTheDocument();
expect(
screen.queryByTestId('order-side-SIDE_BUY-selected')
@@ -77,7 +78,7 @@ describe('DealTicket', () => {
String(1 / Math.pow(10, market.positionDecimalPlaces))
);
expect(screen.getByTestId('order-tif')).toHaveValue(
- VegaWalletOrderTimeInForce.IOC
+ OrderTimeInForce.TIME_IN_FORCE_IOC
);
// Assert last price is shown
@@ -104,10 +105,10 @@ describe('DealTicket', () => {
expect(screen.getByTestId('order-size')).toHaveDisplayValue('200');
fireEvent.change(screen.getByTestId('order-tif'), {
- target: { value: VegaWalletOrderTimeInForce.IOC },
+ target: { value: OrderTimeInForce.TIME_IN_FORCE_IOC },
});
expect(screen.getByTestId('order-tif')).toHaveValue(
- VegaWalletOrderTimeInForce.IOC
+ OrderTimeInForce.TIME_IN_FORCE_IOC
);
// Switch to limit order
@@ -118,7 +119,7 @@ describe('DealTicket', () => {
// Check all TIF options shown
expect(screen.getByTestId('order-tif').children).toHaveLength(
- Object.keys(VegaWalletOrderTimeInForce).length
+ Object.keys(OrderTimeInForce).length
);
});
@@ -130,40 +131,40 @@ describe('DealTicket', () => {
Array.from(screen.getByTestId('order-tif').children).map(
(o) => o.textContent
)
- ).toEqual(['Immediate or Cancel (IOC)', 'Fill or Kill (FOK)']);
+ ).toEqual(['Fill or Kill (FOK)', 'Immediate or Cancel (IOC)']);
// Switch to limit order and check all TIF options shown
fireEvent.click(screen.getByTestId('order-type-TYPE_LIMIT'));
expect(screen.getByTestId('order-tif').children).toHaveLength(
- Object.keys(VegaWalletOrderTimeInForce).length
+ Object.keys(OrderTimeInForce).length
);
// Change to GTC
fireEvent.change(screen.getByTestId('order-tif'), {
- target: { value: VegaWalletOrderTimeInForce.GTC },
+ target: { value: OrderTimeInForce.TIME_IN_FORCE_GTC },
});
expect(screen.getByTestId('order-tif')).toHaveValue(
- VegaWalletOrderTimeInForce.GTC
+ OrderTimeInForce.TIME_IN_FORCE_GTC
);
// Switch back to market order and TIF should now be IOC
fireEvent.click(screen.getByTestId('order-type-TYPE_MARKET'));
expect(screen.getByTestId('order-tif')).toHaveValue(
- VegaWalletOrderTimeInForce.IOC
+ OrderTimeInForce.TIME_IN_FORCE_IOC
);
// Switch tif to FOK
fireEvent.change(screen.getByTestId('order-tif'), {
- target: { value: VegaWalletOrderTimeInForce.FOK },
+ target: { value: OrderTimeInForce.TIME_IN_FORCE_FOK },
});
expect(screen.getByTestId('order-tif')).toHaveValue(
- VegaWalletOrderTimeInForce.FOK
+ OrderTimeInForce.TIME_IN_FORCE_FOK
);
// Change back to limit and check we are still on FOK
fireEvent.click(screen.getByTestId('order-type-TYPE_LIMIT'));
expect(screen.getByTestId('order-tif')).toHaveValue(
- VegaWalletOrderTimeInForce.GTC
+ OrderTimeInForce.TIME_IN_FORCE_GTC
);
});
});
diff --git a/libs/deal-ticket/src/components/deal-ticket.tsx b/libs/deal-ticket/src/components/deal-ticket.tsx
index 17d6ae993..36ae4b286 100644
--- a/libs/deal-ticket/src/components/deal-ticket.tsx
+++ b/libs/deal-ticket/src/components/deal-ticket.tsx
@@ -1,9 +1,5 @@
import { useCallback } from 'react';
import { useForm, Controller } from 'react-hook-form';
-import {
- VegaWalletOrderType,
- VegaWalletOrderTimeInForce,
-} from '@vegaprotocol/wallet';
import { t, addDecimalsFormatNumber } from '@vegaprotocol/react-helpers';
import { Button, InputError } from '@vegaprotocol/ui-toolkit';
import { TypeSelector } from './type-selector';
@@ -14,6 +10,7 @@ import type { DealTicketQuery_market } from './__generated__/DealTicketQuery';
import { ExpirySelector } from './expiry-selector';
import type { Order } from '@vegaprotocol/orders';
import { getDefaultOrder, useOrderValidation } from '@vegaprotocol/orders';
+import { OrderTimeInForce, OrderType } from '@vegaprotocol/types';
export type TransactionStatus = 'default' | 'pending';
@@ -69,10 +66,10 @@ export const DealTicket = ({
{
- if (type === VegaWalletOrderType.Limit) {
- setValue('timeInForce', VegaWalletOrderTimeInForce.GTC);
+ if (type === OrderType.TYPE_LIMIT) {
+ setValue('timeInForce', OrderTimeInForce.TIME_IN_FORCE_GTC);
} else {
- setValue('timeInForce', VegaWalletOrderTimeInForce.IOC);
+ setValue('timeInForce', OrderTimeInForce.TIME_IN_FORCE_IOC);
}
field.onChange(type);
}}
@@ -111,8 +108,8 @@ export const DealTicket = ({
/>
)}
/>
- {orderType === VegaWalletOrderType.Limit &&
- orderTimeInForce === VegaWalletOrderTimeInForce.GTT && (
+ {orderType === OrderType.TYPE_LIMIT &&
+ orderTimeInForce === OrderTimeInForce.TIME_IN_FORCE_GTT && (
void;
+ value: Side;
+ onSelect: (side: Side) => void;
}
export const SideSelector = ({ value, onSelect }: SideSelectorProps) => {
- const toggles = Object.entries(VegaWalletOrderSide).map(([label, value]) => ({
- label: label === 'Buy' ? 'Long' : 'Short',
- value,
- }));
+ const toggles = [
+ { label: t('Long'), value: Side.SIDE_BUY },
+ { label: t('Short'), value: Side.SIDE_SELL },
+ ];
return (
@@ -21,7 +21,7 @@ export const SideSelector = ({ value, onSelect }: SideSelectorProps) => {
name="order-side"
toggles={toggles}
checkedValue={value}
- onChange={(e) => onSelect(e.target.value as VegaWalletOrderSide)}
+ onChange={(e) => onSelect(e.target.value as Side)}
/>
);
diff --git a/libs/deal-ticket/src/components/time-in-force-selector.tsx b/libs/deal-ticket/src/components/time-in-force-selector.tsx
index 152197644..f4f200be1 100644
--- a/libs/deal-ticket/src/components/time-in-force-selector.tsx
+++ b/libs/deal-ticket/src/components/time-in-force-selector.tsx
@@ -1,31 +1,28 @@
import { FormGroup, Select } from '@vegaprotocol/ui-toolkit';
-import {
- VegaWalletOrderTimeInForce,
- VegaWalletOrderType,
-} from '@vegaprotocol/wallet';
+import { OrderTimeInForce, OrderType } from '@vegaprotocol/types';
import { t } from '@vegaprotocol/react-helpers';
interface TimeInForceSelectorProps {
- value: VegaWalletOrderTimeInForce;
- orderType: VegaWalletOrderType;
- onSelect: (tif: VegaWalletOrderTimeInForce) => void;
+ value: OrderTimeInForce;
+ orderType: OrderType;
+ onSelect: (tif: OrderTimeInForce) => void;
}
// More detail in https://docs.vega.xyz/docs/mainnet/graphql/enums/order-time-in-force
export const timeInForceLabel = (tif: string) => {
switch (tif) {
- case VegaWalletOrderTimeInForce.GTC:
- return t(`Good 'til Cancelled`);
- case VegaWalletOrderTimeInForce.IOC:
- return t('Immediate or Cancel');
- case VegaWalletOrderTimeInForce.FOK:
- return t('Fill or Kill');
- case VegaWalletOrderTimeInForce.GTT:
- return t(`Good 'til Time`);
- case VegaWalletOrderTimeInForce.GFN:
- return t('Good for Normal');
- case VegaWalletOrderTimeInForce.GFA:
- return t('Good for Auction');
+ case OrderTimeInForce.TIME_IN_FORCE_GTC:
+ return t(`Good 'til Cancelled (GTC)`);
+ case OrderTimeInForce.TIME_IN_FORCE_IOC:
+ return t('Immediate or Cancel (IOC)');
+ case OrderTimeInForce.TIME_IN_FORCE_FOK:
+ return t('Fill or Kill (FOK)');
+ case OrderTimeInForce.TIME_IN_FORCE_GTT:
+ return t(`Good 'til Time (GTT)`);
+ case OrderTimeInForce.TIME_IN_FORCE_GFN:
+ return t('Good for Normal (GFN)');
+ case OrderTimeInForce.TIME_IN_FORCE_GFA:
+ return t('Good for Auction (GFA)');
default:
return t(tif);
}
@@ -37,12 +34,12 @@ export const TimeInForceSelector = ({
onSelect,
}: TimeInForceSelectorProps) => {
const options =
- orderType === VegaWalletOrderType.Limit
- ? Object.entries(VegaWalletOrderTimeInForce)
- : Object.entries(VegaWalletOrderTimeInForce).filter(
+ orderType === OrderType.TYPE_LIMIT
+ ? Object.entries(OrderTimeInForce)
+ : Object.entries(OrderTimeInForce).filter(
([_, timeInForce]) =>
- timeInForce === VegaWalletOrderTimeInForce.FOK ||
- timeInForce === VegaWalletOrderTimeInForce.IOC
+ timeInForce === OrderTimeInForce.TIME_IN_FORCE_FOK ||
+ timeInForce === OrderTimeInForce.TIME_IN_FORCE_IOC
);
return (
@@ -50,13 +47,13 @@ export const TimeInForceSelector = ({
diff --git a/libs/deal-ticket/src/components/type-selector.tsx b/libs/deal-ticket/src/components/type-selector.tsx
index b457bfe66..d45ba800a 100644
--- a/libs/deal-ticket/src/components/type-selector.tsx
+++ b/libs/deal-ticket/src/components/type-selector.tsx
@@ -1,17 +1,17 @@
import { FormGroup } from '@vegaprotocol/ui-toolkit';
import { t } from '@vegaprotocol/react-helpers';
-import { VegaWalletOrderType } from '@vegaprotocol/wallet';
+import { OrderType } from '@vegaprotocol/types';
import { Toggle } from '@vegaprotocol/ui-toolkit';
interface TypeSelectorProps {
- value: VegaWalletOrderType;
- onSelect: (type: VegaWalletOrderType) => void;
+ value: OrderType;
+ onSelect: (type: OrderType) => void;
}
-const toggles = Object.entries(VegaWalletOrderType).map(([label, value]) => ({
- label,
- value,
-}));
+const toggles = [
+ { label: t('Market'), value: OrderType.TYPE_MARKET },
+ { label: t('Limit'), value: OrderType.TYPE_LIMIT },
+];
export const TypeSelector = ({ value, onSelect }: TypeSelectorProps) => {
return (
@@ -21,7 +21,7 @@ export const TypeSelector = ({ value, onSelect }: TypeSelectorProps) => {
name="order-type"
toggles={toggles}
checkedValue={value}
- onChange={(e) => onSelect(e.target.value as VegaWalletOrderType)}
+ onChange={(e) => onSelect(e.target.value as OrderType)}
/>
);
diff --git a/libs/deposits/src/lib/__generated__/DepositEvent.ts b/libs/deposits/src/lib/__generated__/DepositEvent.ts
index d8cb0b6b8..aaa0265b2 100644
--- a/libs/deposits/src/lib/__generated__/DepositEvent.ts
+++ b/libs/deposits/src/lib/__generated__/DepositEvent.ts
@@ -16,7 +16,7 @@ export interface DepositEvent_busEvents_event_TimeUpdate {
export interface DepositEvent_busEvents_event_Deposit {
__typename: "Deposit";
/**
- * The Vega internal id of the deposit
+ * The Vega internal ID of the deposit
*/
id: string;
/**
diff --git a/libs/deposits/src/lib/use-submit-deposit.tsx b/libs/deposits/src/lib/use-submit-deposit.tsx
index cae10003d..3b80f82da 100644
--- a/libs/deposits/src/lib/use-submit-deposit.tsx
+++ b/libs/deposits/src/lib/use-submit-deposit.tsx
@@ -76,7 +76,7 @@ export const useSubmitDeposit = () => {
// Note there is a bug in data node where the subscription is not emitted when the status
// changes from 'Open' to 'Finalized' as a result the deposit UI will hang in a pending state right now
// https://github.com/vegaprotocol/data-node/issues/460
- e.event.status === DepositStatus.Finalized
+ e.event.status === DepositStatus.STATUS_FINALIZED
) {
return true;
}
diff --git a/libs/environment/src/hooks/use-environment-errors.spec.tsx b/libs/environment/src/hooks/use-environment-errors.spec.tsx
index 82dc7f792..7c5d9452e 100644
--- a/libs/environment/src/hooks/use-environment-errors.spec.tsx
+++ b/libs/environment/src/hooks/use-environment-errors.spec.tsx
@@ -158,7 +158,8 @@ describe('throws error', () => {
wrapper: MockWrapper,
});
expect(result).toThrow(
- `All keys in NX_VEGA_NETWORKS must represent a valid environment: CUSTOM | TESTNET | STAGNET | STAGNET2 | DEVNET | MAINNET`
+ `Error processing the vega app environment:
+ - All keys in NX_VEGA_NETWORKS must represent a valid environment: CUSTOM | TESTNET | STAGNET | STAGNET3 | DEVNET | MAINNET`
);
});
@@ -181,7 +182,8 @@ describe('throws error', () => {
wrapper: MockWrapper,
});
expect(result).toThrow(
- `NX_VEGA_ENV is invalid, received "undefined" instead of: 'CUSTOM' | 'TESTNET' | 'STAGNET' | 'STAGNET2' | 'DEVNET' | 'MAINNET'`
+ `Error processing the vega app environment:
+ - NX_VEGA_ENV is invalid, received "undefined" instead of: 'CUSTOM' | 'TESTNET' | 'STAGNET' | 'STAGNET3' | 'DEVNET' | 'MAINNET'`
);
});
diff --git a/libs/environment/src/utils/__generated__/BlockTime.ts b/libs/environment/src/utils/__generated__/BlockTime.ts
index 7f6cc2895..40fa9807b 100644
--- a/libs/environment/src/utils/__generated__/BlockTime.ts
+++ b/libs/environment/src/utils/__generated__/BlockTime.ts
@@ -10,7 +10,7 @@
export interface BlockTime_busEvents {
__typename: "BusEvent";
/**
- * the id for this event
+ * the ID for this event
*/
eventId: string;
}
diff --git a/libs/environment/src/utils/__generated__/Statistics.ts b/libs/environment/src/utils/__generated__/Statistics.ts
index 90d1d3ea2..97582021e 100644
--- a/libs/environment/src/utils/__generated__/Statistics.ts
+++ b/libs/environment/src/utils/__generated__/Statistics.ts
@@ -10,7 +10,7 @@
export interface Statistics_statistics {
__typename: "Statistics";
/**
- * Current chain id
+ * Current chain ID
*/
chainId: string;
/**
@@ -21,7 +21,7 @@ export interface Statistics_statistics {
export interface Statistics {
/**
- * get statistics about the vega node
+ * get statistics about the Vega node
*/
statistics: Statistics_statistics;
}
diff --git a/libs/environment/src/utils/apollo-client.tsx b/libs/environment/src/utils/apollo-client.tsx
index 35e6c27bf..684394999 100644
--- a/libs/environment/src/utils/apollo-client.tsx
+++ b/libs/environment/src/utils/apollo-client.tsx
@@ -14,14 +14,12 @@ import { RetryLink } from '@apollo/client/link/retry';
const isBrowser = typeof window !== 'undefined';
-export const GQL_PATH = 'query';
-
export default function createClient(base?: string) {
if (!base) {
throw new Error('Base must be passed into createClient!');
}
- const urlHTTP = new URL(GQL_PATH, base);
- const urlWS = new URL(GQL_PATH, base);
+ const urlHTTP = new URL(base);
+ const urlWS = new URL(base);
// Replace http with ws, preserving if its a secure connection eg. https => wss
urlWS.protocol = urlWS.protocol.replace('http', 'ws');
diff --git a/libs/environment/src/utils/initialize-node.tsx b/libs/environment/src/utils/initialize-node.tsx
index e19a1f023..025ac3dad 100644
--- a/libs/environment/src/utils/initialize-node.tsx
+++ b/libs/environment/src/utils/initialize-node.tsx
@@ -2,10 +2,9 @@ import type { Dispatch } from 'react';
import { ACTIONS } from '../hooks/use-nodes';
import type { Action } from '../hooks/use-nodes';
import { requestNode } from './request-node';
-import { GQL_PATH } from './apollo-client';
const getResponseTime = (url: string) => {
- const requestUrl = new URL(GQL_PATH, url);
+ const requestUrl = new URL(url);
const requests = window.performance.getEntriesByName(requestUrl.href);
const { duration } = (requests.length && requests[requests.length - 1]) || {};
return duration;
diff --git a/libs/environment/src/utils/validate-environment.ts b/libs/environment/src/utils/validate-environment.ts
index d3a659c6d..added30f5 100644
--- a/libs/environment/src/utils/validate-environment.ts
+++ b/libs/environment/src/utils/validate-environment.ts
@@ -7,7 +7,7 @@ export enum Networks {
CUSTOM = 'CUSTOM',
TESTNET = 'TESTNET',
STAGNET = 'STAGNET',
- STAGNET2 = 'STAGNET2',
+ STAGNET3 = 'STAGNET3',
DEVNET = 'DEVNET',
MAINNET = 'MAINNET',
}
diff --git a/libs/fills/src/lib/__generated__/FillFields.ts b/libs/fills/src/lib/__generated__/FillFields.ts
index 426e600ee..39ea81610 100644
--- a/libs/fills/src/lib/__generated__/FillFields.ts
+++ b/libs/fills/src/lib/__generated__/FillFields.ts
@@ -28,15 +28,15 @@ export interface FillFields_seller {
export interface FillFields_buyerFee {
__typename: "TradeFee";
/**
- * The maker fee, aggressive party to the other party (the one who had an order in the book)
+ * The maker fee, paid by the aggressive party to the other party (the one who had an order in the book)
*/
makerFee: string;
/**
- * The infrastructure fee, a fee paid to the node runner to maintain the vega network
+ * The infrastructure fee, a fee paid to the validators to maintain the Vega network
*/
infrastructureFee: string;
/**
- * The fee paid to the market makers to provide liquidity in the market
+ * The fee paid to the liquidity providers that committed liquidity to the market
*/
liquidityFee: string;
}
@@ -44,15 +44,15 @@ export interface FillFields_buyerFee {
export interface FillFields_sellerFee {
__typename: "TradeFee";
/**
- * The maker fee, aggressive party to the other party (the one who had an order in the book)
+ * The maker fee, paid by the aggressive party to the other party (the one who had an order in the book)
*/
makerFee: string;
/**
- * The infrastructure fee, a fee paid to the node runner to maintain the vega network
+ * The infrastructure fee, a fee paid to the validators to maintain the Vega network
*/
infrastructureFee: string;
/**
- * The fee paid to the market makers to provide liquidity in the market
+ * The fee paid to the liquidity providers that committed liquidity to the market
*/
liquidityFee: string;
}
@@ -60,7 +60,7 @@ export interface FillFields_sellerFee {
export interface FillFields_market_tradableInstrument_instrument_product_settlementAsset {
__typename: "Asset";
/**
- * The id of the asset
+ * The ID of the asset
*/
id: string;
/**
@@ -68,7 +68,7 @@ export interface FillFields_market_tradableInstrument_instrument_product_settlem
*/
symbol: string;
/**
- * The precision of the asset
+ * 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;
}
@@ -100,7 +100,7 @@ export interface FillFields_market_tradableInstrument_instrument {
export interface FillFields_market_tradableInstrument {
__typename: "TradableInstrument";
/**
- * An instance of or reference to a fully specified instrument.
+ * An instance of, or reference to, a fully specified instrument.
*/
instrument: FillFields_market_tradableInstrument_instrument;
}
@@ -117,7 +117,7 @@ export interface FillFields_market {
name: 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)
+ * number denominated in the currency of the market. (uint64)
*
* Examples:
* Currency Balance decimalPlaces Real Balance
@@ -133,13 +133,14 @@ export interface FillFields_market {
*/
decimalPlaces: number;
/**
- * positionDecimalPlaces indicated the number of decimal places that an integer must be shifted in order to get a correct size (uint64).
+ * positionDecimalPlaces indicates the number of decimal places that an integer must be shifted in order to get a correct size (uint64).
* i.e. 0 means there are no fractional orders for the market, and order sizes are always whole sizes.
* 2 means sizes given as 10^2 * desired size, e.g. a desired size of 1.23 is represented as 123 in this market.
+ * This sets how big the smallest order / position on the market can be.
*/
positionDecimalPlaces: number;
/**
- * An instance of or reference to a tradable instrument.
+ * An instance of, or reference to, a tradable instrument.
*/
tradableInstrument: FillFields_market_tradableInstrument;
}
diff --git a/libs/fills/src/lib/__generated__/Fills.ts b/libs/fills/src/lib/__generated__/Fills.ts
index a1d40b511..05cc287ca 100644
--- a/libs/fills/src/lib/__generated__/Fills.ts
+++ b/libs/fills/src/lib/__generated__/Fills.ts
@@ -28,15 +28,15 @@ export interface Fills_party_tradesConnection_edges_node_seller {
export interface Fills_party_tradesConnection_edges_node_buyerFee {
__typename: "TradeFee";
/**
- * The maker fee, aggressive party to the other party (the one who had an order in the book)
+ * The maker fee, paid by the aggressive party to the other party (the one who had an order in the book)
*/
makerFee: string;
/**
- * The infrastructure fee, a fee paid to the node runner to maintain the vega network
+ * The infrastructure fee, a fee paid to the validators to maintain the Vega network
*/
infrastructureFee: string;
/**
- * The fee paid to the market makers to provide liquidity in the market
+ * The fee paid to the liquidity providers that committed liquidity to the market
*/
liquidityFee: string;
}
@@ -44,15 +44,15 @@ export interface Fills_party_tradesConnection_edges_node_buyerFee {
export interface Fills_party_tradesConnection_edges_node_sellerFee {
__typename: "TradeFee";
/**
- * The maker fee, aggressive party to the other party (the one who had an order in the book)
+ * The maker fee, paid by the aggressive party to the other party (the one who had an order in the book)
*/
makerFee: string;
/**
- * The infrastructure fee, a fee paid to the node runner to maintain the vega network
+ * The infrastructure fee, a fee paid to the validators to maintain the Vega network
*/
infrastructureFee: string;
/**
- * The fee paid to the market makers to provide liquidity in the market
+ * The fee paid to the liquidity providers that committed liquidity to the market
*/
liquidityFee: string;
}
@@ -60,7 +60,7 @@ export interface Fills_party_tradesConnection_edges_node_sellerFee {
export interface Fills_party_tradesConnection_edges_node_market_tradableInstrument_instrument_product_settlementAsset {
__typename: "Asset";
/**
- * The id of the asset
+ * The ID of the asset
*/
id: string;
/**
@@ -68,7 +68,7 @@ export interface Fills_party_tradesConnection_edges_node_market_tradableInstrume
*/
symbol: string;
/**
- * The precision of the asset
+ * 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;
}
@@ -100,7 +100,7 @@ export interface Fills_party_tradesConnection_edges_node_market_tradableInstrume
export interface Fills_party_tradesConnection_edges_node_market_tradableInstrument {
__typename: "TradableInstrument";
/**
- * An instance of or reference to a fully specified instrument.
+ * An instance of, or reference to, a fully specified instrument.
*/
instrument: Fills_party_tradesConnection_edges_node_market_tradableInstrument_instrument;
}
@@ -117,7 +117,7 @@ export interface Fills_party_tradesConnection_edges_node_market {
name: 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)
+ * number denominated in the currency of the market. (uint64)
*
* Examples:
* Currency Balance decimalPlaces Real Balance
@@ -133,13 +133,14 @@ export interface Fills_party_tradesConnection_edges_node_market {
*/
decimalPlaces: number;
/**
- * positionDecimalPlaces indicated the number of decimal places that an integer must be shifted in order to get a correct size (uint64).
+ * positionDecimalPlaces indicates the number of decimal places that an integer must be shifted in order to get a correct size (uint64).
* i.e. 0 means there are no fractional orders for the market, and order sizes are always whole sizes.
* 2 means sizes given as 10^2 * desired size, e.g. a desired size of 1.23 is represented as 123 in this market.
+ * This sets how big the smallest order / position on the market can be.
*/
positionDecimalPlaces: number;
/**
- * An instance of or reference to a tradable instrument.
+ * An instance of, or reference to, a tradable instrument.
*/
tradableInstrument: Fills_party_tradesConnection_edges_node_market_tradableInstrument;
}
@@ -233,7 +234,7 @@ export interface Fills_party {
export interface Fills {
/**
- * An entity that is trading on the VEGA network
+ * An entity that is trading on the Vega network
*/
party: Fills_party | null;
}
diff --git a/libs/fills/src/lib/__generated__/FillsSub.ts b/libs/fills/src/lib/__generated__/FillsSub.ts
index c1b056cf0..7765a85ed 100644
--- a/libs/fills/src/lib/__generated__/FillsSub.ts
+++ b/libs/fills/src/lib/__generated__/FillsSub.ts
@@ -28,15 +28,15 @@ export interface FillsSub_trades_seller {
export interface FillsSub_trades_buyerFee {
__typename: "TradeFee";
/**
- * The maker fee, aggressive party to the other party (the one who had an order in the book)
+ * The maker fee, paid by the aggressive party to the other party (the one who had an order in the book)
*/
makerFee: string;
/**
- * The infrastructure fee, a fee paid to the node runner to maintain the vega network
+ * The infrastructure fee, a fee paid to the validators to maintain the Vega network
*/
infrastructureFee: string;
/**
- * The fee paid to the market makers to provide liquidity in the market
+ * The fee paid to the liquidity providers that committed liquidity to the market
*/
liquidityFee: string;
}
@@ -44,15 +44,15 @@ export interface FillsSub_trades_buyerFee {
export interface FillsSub_trades_sellerFee {
__typename: "TradeFee";
/**
- * The maker fee, aggressive party to the other party (the one who had an order in the book)
+ * The maker fee, paid by the aggressive party to the other party (the one who had an order in the book)
*/
makerFee: string;
/**
- * The infrastructure fee, a fee paid to the node runner to maintain the vega network
+ * The infrastructure fee, a fee paid to the validators to maintain the Vega network
*/
infrastructureFee: string;
/**
- * The fee paid to the market makers to provide liquidity in the market
+ * The fee paid to the liquidity providers that committed liquidity to the market
*/
liquidityFee: string;
}
@@ -60,7 +60,7 @@ export interface FillsSub_trades_sellerFee {
export interface FillsSub_trades_market_tradableInstrument_instrument_product_settlementAsset {
__typename: "Asset";
/**
- * The id of the asset
+ * The ID of the asset
*/
id: string;
/**
@@ -68,7 +68,7 @@ export interface FillsSub_trades_market_tradableInstrument_instrument_product_se
*/
symbol: string;
/**
- * The precision of the asset
+ * 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;
}
@@ -100,7 +100,7 @@ export interface FillsSub_trades_market_tradableInstrument_instrument {
export interface FillsSub_trades_market_tradableInstrument {
__typename: "TradableInstrument";
/**
- * An instance of or reference to a fully specified instrument.
+ * An instance of, or reference to, a fully specified instrument.
*/
instrument: FillsSub_trades_market_tradableInstrument_instrument;
}
@@ -117,7 +117,7 @@ export interface FillsSub_trades_market {
name: 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)
+ * number denominated in the currency of the market. (uint64)
*
* Examples:
* Currency Balance decimalPlaces Real Balance
@@ -133,13 +133,14 @@ export interface FillsSub_trades_market {
*/
decimalPlaces: number;
/**
- * positionDecimalPlaces indicated the number of decimal places that an integer must be shifted in order to get a correct size (uint64).
+ * positionDecimalPlaces indicates the number of decimal places that an integer must be shifted in order to get a correct size (uint64).
* i.e. 0 means there are no fractional orders for the market, and order sizes are always whole sizes.
* 2 means sizes given as 10^2 * desired size, e.g. a desired size of 1.23 is represented as 123 in this market.
+ * This sets how big the smallest order / position on the market can be.
*/
positionDecimalPlaces: number;
/**
- * An instance of or reference to a tradable instrument.
+ * An instance of, or reference to, a tradable instrument.
*/
tradableInstrument: FillsSub_trades_market_tradableInstrument;
}
diff --git a/libs/fills/src/lib/fills-table.spec.tsx b/libs/fills/src/lib/fills-table.spec.tsx
index db1a71236..25c054124 100644
--- a/libs/fills/src/lib/fills-table.spec.tsx
+++ b/libs/fills/src/lib/fills-table.spec.tsx
@@ -73,7 +73,7 @@ describe('FillsTable', () => {
buyer: {
id: partyId,
},
- aggressor: Side.Sell,
+ aggressor: Side.SIDE_SELL,
buyerFee: {
makerFee: '2',
infrastructureFee: '2',
@@ -110,7 +110,7 @@ describe('FillsTable', () => {
buyer: {
id: partyId,
},
- aggressor: Side.Sell,
+ aggressor: Side.SIDE_SELL,
buyerFee: {
makerFee: '2',
infrastructureFee: '2',
@@ -148,7 +148,7 @@ describe('FillsTable', () => {
seller: {
id: partyId,
},
- aggressor: Side.Sell,
+ aggressor: Side.SIDE_SELL,
sellerFee: {
makerFee: '1',
infrastructureFee: '1',
@@ -186,7 +186,7 @@ describe('FillsTable', () => {
seller: {
id: partyId,
},
- aggressor: Side.Sell,
+ aggressor: Side.SIDE_SELL,
});
const { rerender } = render(
@@ -205,7 +205,7 @@ describe('FillsTable', () => {
seller: {
id: partyId,
},
- aggressor: Side.Buy,
+ aggressor: Side.SIDE_BUY,
});
rerender();
diff --git a/libs/fills/src/lib/fills-table.tsx b/libs/fills/src/lib/fills-table.tsx
index b11ac682a..deee381c0 100644
--- a/libs/fills/src/lib/fills-table.tsx
+++ b/libs/fills/src/lib/fills-table.tsx
@@ -172,13 +172,13 @@ const formatRole = (partyId: string) => {
const taker = t('Taker');
const maker = t('Maker');
if (data?.buyer.id === partyId) {
- if (value === Side.Buy) {
+ if (value === Side.SIDE_BUY) {
return taker;
} else {
return maker;
}
} else if (data?.seller.id === partyId) {
- if (value === Side.Sell) {
+ if (value === Side.SIDE_SELL) {
return taker;
} else {
return maker;
diff --git a/libs/fills/src/lib/test-helpers.ts b/libs/fills/src/lib/test-helpers.ts
index 3862fcb9a..6fde09c43 100644
--- a/libs/fills/src/lib/test-helpers.ts
+++ b/libs/fills/src/lib/test-helpers.ts
@@ -18,7 +18,7 @@ export const generateFills = (override?: PartialDeep): Fills => {
seller: {
id: 'party-id',
},
- aggressor: Side.Sell,
+ aggressor: Side.SIDE_SELL,
buyerFee: {
infrastructureFee: '5000',
},
@@ -32,11 +32,11 @@ export const generateFills = (override?: PartialDeep): Fills => {
seller: {
id: 'party-id',
},
- aggressor: Side.Buy,
+ aggressor: Side.SIDE_BUY,
}),
generateFill({
id: '3',
- aggressor: Side.Sell,
+ aggressor: Side.SIDE_SELL,
market: {
name: 'ETHBTC Quarterly (30 Jun 2022)',
},
@@ -84,7 +84,7 @@ export const generateFill = (
size: '50000',
buyOrder: 'buy-order',
sellOrder: 'sell-order',
- aggressor: Side.Buy,
+ aggressor: Side.SIDE_BUY,
buyer: {
__typename: 'Party',
id: 'buyer-id',
diff --git a/libs/governance/src/lib/proposal-form.spec.tsx b/libs/governance/src/lib/proposal-form.spec.tsx
index d0c3d858e..4760889ce 100644
--- a/libs/governance/src/lib/proposal-form.spec.tsx
+++ b/libs/governance/src/lib/proposal-form.spec.tsx
@@ -31,8 +31,9 @@ describe('ProposalForm', () => {
__typename: 'Proposal',
id: '2fca514cebf9f465ae31ecb4c5721e3a6f5f260425ded887ca50ba15b81a5d50',
reference: 'proposal-reference',
- state: ProposalState.Open,
- rejectionReason: ProposalRejectionReason.CloseTimeTooLate,
+ state: ProposalState.STATE_OPEN,
+ rejectionReason:
+ ProposalRejectionReason.PROPOSAL_ERROR_CLOSE_TIME_TOO_LATE,
errorDetails: 'error-details',
},
},
diff --git a/libs/governance/src/lib/proposals-hooks/__generated__/ProposalEvent.ts b/libs/governance/src/lib/proposals-hooks/__generated__/ProposalEvent.ts
index 76d25e7bf..088e4b4b8 100644
--- a/libs/governance/src/lib/proposals-hooks/__generated__/ProposalEvent.ts
+++ b/libs/governance/src/lib/proposals-hooks/__generated__/ProposalEvent.ts
@@ -16,11 +16,11 @@ export interface ProposalEvent_busEvents_event_TimeUpdate {
export interface ProposalEvent_busEvents_event_Proposal {
__typename: "Proposal";
/**
- * Proposal ID that is filled by VEGA once proposal reaches the network
+ * Proposal ID that is filled by Vega once proposal reaches the network
*/
id: string | null;
/**
- * A UUID reference to aid tracking proposals on VEGA
+ * A UUID reference to aid tracking proposals on Vega
*/
reference: string;
/**
@@ -42,7 +42,7 @@ export type ProposalEvent_busEvents_event = ProposalEvent_busEvents_event_TimeUp
export interface ProposalEvent_busEvents {
__typename: "BusEvent";
/**
- * the type of event we're dealing with
+ * the type of event
*/
type: BusEventType;
/**
diff --git a/libs/governance/src/utils/proposal-dialog-helpers.tsx b/libs/governance/src/utils/proposal-dialog-helpers.tsx
index e94692656..177f19dba 100644
--- a/libs/governance/src/utils/proposal-dialog-helpers.tsx
+++ b/libs/governance/src/utils/proposal-dialog-helpers.tsx
@@ -11,19 +11,19 @@ export const getProposalDialogTitle = (
}
switch (status) {
- case ProposalState.Open:
+ case ProposalState.STATE_OPEN:
return t('Proposal submitted');
- case ProposalState.WaitingForNodeVote:
+ case ProposalState.STATE_WAITING_FOR_NODE_VOTE:
return t('Proposal waiting for node vote');
- case ProposalState.Passed:
+ case ProposalState.STATE_PASSED:
return t('Proposal passed');
- case ProposalState.Enacted:
+ case ProposalState.STATE_ENACTED:
return t('Proposal enacted');
- case ProposalState.Declined:
+ case ProposalState.STATE_DECLINED:
return t('Proposal declined');
- case ProposalState.Rejected:
+ case ProposalState.STATE_REJECTED:
return t('Proposal rejected');
- case ProposalState.Failed:
+ case ProposalState.STATE_FAILED:
return t('Proposal failed');
default:
return t('Submission failed');
@@ -38,15 +38,15 @@ export const getProposalDialogIntent = (
}
switch (status) {
- case ProposalState.Passed:
- case ProposalState.Enacted:
+ case ProposalState.STATE_PASSED:
+ case ProposalState.STATE_ENACTED:
return Intent.Success;
- case ProposalState.Open:
- case ProposalState.WaitingForNodeVote:
+ case ProposalState.STATE_OPEN:
+ case ProposalState.STATE_WAITING_FOR_NODE_VOTE:
return Intent.None;
- case ProposalState.Rejected:
- case ProposalState.Failed:
- case ProposalState.Declined:
+ case ProposalState.STATE_REJECTED:
+ case ProposalState.STATE_FAILED:
+ case ProposalState.STATE_DECLINED:
return Intent.Danger;
default:
return;
@@ -61,12 +61,12 @@ export const getProposalDialogIcon = (
}
switch (status) {
- case ProposalState.Passed:
- case ProposalState.Enacted:
+ case ProposalState.STATE_PASSED:
+ case ProposalState.STATE_ENACTED:
return ;
- case ProposalState.Rejected:
- case ProposalState.Failed:
- case ProposalState.Declined:
+ case ProposalState.STATE_REJECTED:
+ case ProposalState.STATE_FAILED:
+ case ProposalState.STATE_DECLINED:
return ;
default:
return;
diff --git a/libs/market-depth/src/lib/__generated__/MarketDepth.ts b/libs/market-depth/src/lib/__generated__/MarketDepth.ts
index 330302a68..7b043223b 100644
--- a/libs/market-depth/src/lib/__generated__/MarketDepth.ts
+++ b/libs/market-depth/src/lib/__generated__/MarketDepth.ts
@@ -24,7 +24,7 @@ export interface MarketDepth_market_data {
*/
staticMidPrice: string;
/**
- * what state the market is in (auction, continuous etc)
+ * what state the market is in (auction, continuous, etc)
*/
marketTradingMode: MarketTradingMode;
/**
@@ -44,7 +44,7 @@ export interface MarketDepth_market_data {
*/
bestStaticOfferPrice: string;
/**
- * market id of the associated mark price
+ * market ID of the associated mark price
*/
market: MarketDepth_market_data_market;
}
@@ -117,7 +117,7 @@ export interface MarketDepth_market {
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)
+ * number denominated in the currency of the market. (uint64)
*
* Examples:
* Currency Balance decimalPlaces Real Balance
@@ -133,9 +133,10 @@ export interface MarketDepth_market {
*/
decimalPlaces: number;
/**
- * positionDecimalPlaces indicated the number of decimal places that an integer must be shifted in order to get a correct size (uint64).
+ * positionDecimalPlaces indicates the number of decimal places that an integer must be shifted in order to get a correct size (uint64).
* i.e. 0 means there are no fractional orders for the market, and order sizes are always whole sizes.
* 2 means sizes given as 10^2 * desired size, e.g. a desired size of 1.23 is represented as 123 in this market.
+ * This sets how big the smallest order / position on the market can be.
*/
positionDecimalPlaces: number;
/**
@@ -150,7 +151,7 @@ export interface MarketDepth_market {
export interface MarketDepth {
/**
- * An instrument that is trading on the VEGA network
+ * An instrument that is trading on the Vega network
*/
market: MarketDepth_market | null;
}
diff --git a/libs/market-depth/src/lib/__generated__/MarketDepthSubscription.ts b/libs/market-depth/src/lib/__generated__/MarketDepthSubscription.ts
index f38ac4ea9..456b6cc8c 100644
--- a/libs/market-depth/src/lib/__generated__/MarketDepthSubscription.ts
+++ b/libs/market-depth/src/lib/__generated__/MarketDepthSubscription.ts
@@ -24,7 +24,7 @@ export interface MarketDepthSubscription_marketDepthUpdate_market_data {
*/
staticMidPrice: string;
/**
- * what state the market is in (auction, continuous etc)
+ * what state the market is in (auction, continuous, etc)
*/
marketTradingMode: MarketTradingMode;
/**
@@ -44,7 +44,7 @@ export interface MarketDepthSubscription_marketDepthUpdate_market_data {
*/
bestStaticOfferPrice: string;
/**
- * market id of the associated mark price
+ * market ID of the associated mark price
*/
market: MarketDepthSubscription_marketDepthUpdate_market_data_market;
}
@@ -56,9 +56,10 @@ export interface MarketDepthSubscription_marketDepthUpdate_market {
*/
id: string;
/**
- * positionDecimalPlaces indicated the number of decimal places that an integer must be shifted in order to get a correct size (uint64).
+ * positionDecimalPlaces indicates the number of decimal places that an integer must be shifted in order to get a correct size (uint64).
* i.e. 0 means there are no fractional orders for the market, and order sizes are always whole sizes.
* 2 means sizes given as 10^2 * desired size, e.g. a desired size of 1.23 is represented as 123 in this market.
+ * This sets how big the smallest order / position on the market can be.
*/
positionDecimalPlaces: number;
/**
@@ -102,7 +103,7 @@ export interface MarketDepthSubscription_marketDepthUpdate_buy {
export interface MarketDepthSubscription_marketDepthUpdate {
__typename: "MarketDepthUpdate";
/**
- * Market id
+ * Market
*/
market: MarketDepthSubscription_marketDepthUpdate_market;
/**
diff --git a/libs/market-depth/src/lib/orderbook-data.ts b/libs/market-depth/src/lib/orderbook-data.ts
index 8894e6a5a..fa515a464 100644
--- a/libs/market-depth/src/lib/orderbook-data.ts
+++ b/libs/market-depth/src/lib/orderbook-data.ts
@@ -424,8 +424,8 @@ export const generateMockData = ({
staticMidPrice: '',
marketTradingMode:
overlap > 0
- ? MarketTradingMode.BatchAuction
- : MarketTradingMode.Continuous,
+ ? MarketTradingMode.TRADING_MODE_BATCH_AUCTION
+ : MarketTradingMode.TRADING_MODE_CONTINUOUS,
bestStaticBidPrice: bestStaticBidPrice.toString(),
bestStaticOfferPrice: bestStaticOfferPrice.toString(),
indicativePrice: indicativePrice?.toString() ?? '',
diff --git a/libs/market-depth/src/lib/orderbook.tsx b/libs/market-depth/src/lib/orderbook.tsx
index 7b9307ebf..4b0d9130e 100644
--- a/libs/market-depth/src/lib/orderbook.tsx
+++ b/libs/market-depth/src/lib/orderbook.tsx
@@ -330,7 +330,8 @@ export const Orderbook = ({
cumulativeAsk={data.cumulativeVol.ask}
cumulativeRelativeAsk={data.cumulativeVol.relativeAsk}
indicativeVolume={
- marketTradingMode !== MarketTradingMode.Continuous &&
+ marketTradingMode !==
+ MarketTradingMode.TRADING_MODE_CONTINUOUS &&
indicativePrice === data.price
? indicativeVolume
: undefined
diff --git a/libs/market-list/src/lib/__generated__/MarketDataFields.ts b/libs/market-list/src/lib/__generated__/MarketDataFields.ts
index 3cff0c510..44cdd10ac 100644
--- a/libs/market-list/src/lib/__generated__/MarketDataFields.ts
+++ b/libs/market-list/src/lib/__generated__/MarketDataFields.ts
@@ -28,7 +28,7 @@ export interface MarketDataFields_market {
export interface MarketDataFields {
__typename: "MarketData";
/**
- * market id of the associated mark price
+ * market ID of the associated mark price
*/
market: MarketDataFields_market;
/**
@@ -40,7 +40,7 @@ export interface MarketDataFields {
*/
bestOfferPrice: string;
/**
- * the mark price (actually an unsigned int)
+ * the mark price (an unsigned integer)
*/
markPrice: string;
/**
diff --git a/libs/market-list/src/lib/__generated__/MarketDataSub.ts b/libs/market-list/src/lib/__generated__/MarketDataSub.ts
index dcb66d351..c77181ea3 100644
--- a/libs/market-list/src/lib/__generated__/MarketDataSub.ts
+++ b/libs/market-list/src/lib/__generated__/MarketDataSub.ts
@@ -28,7 +28,7 @@ export interface MarketDataSub_marketData_market {
export interface MarketDataSub_marketData {
__typename: "MarketData";
/**
- * market id of the associated mark price
+ * market ID of the associated mark price
*/
market: MarketDataSub_marketData_market;
/**
@@ -40,7 +40,7 @@ export interface MarketDataSub_marketData {
*/
bestOfferPrice: string;
/**
- * the mark price (actually an unsigned int)
+ * the mark price (an unsigned integer)
*/
markPrice: string;
/**
diff --git a/libs/market-list/src/lib/__generated__/MarketList.ts b/libs/market-list/src/lib/__generated__/MarketList.ts
index 7d50683c8..5f56d3975 100644
--- a/libs/market-list/src/lib/__generated__/MarketList.ts
+++ b/libs/market-list/src/lib/__generated__/MarketList.ts
@@ -52,7 +52,7 @@ export interface MarketList_markets_data_market {
export interface MarketList_markets_data {
__typename: "MarketData";
/**
- * market id of the associated mark price
+ * market ID of the associated mark price
*/
market: MarketList_markets_data_market;
/**
@@ -64,7 +64,7 @@ export interface MarketList_markets_data {
*/
bestOfferPrice: string;
/**
- * the mark price (actually an unsigned int)
+ * the mark price (an unsigned integer)
*/
markPrice: string;
/**
@@ -128,7 +128,7 @@ export interface MarketList_markets_tradableInstrument_instrument {
export interface MarketList_markets_tradableInstrument {
__typename: "TradableInstrument";
/**
- * An instance of or reference to a fully specified instrument.
+ * An instance of, or reference to, a fully specified instrument.
*/
instrument: MarketList_markets_tradableInstrument_instrument;
}
@@ -177,7 +177,7 @@ export interface MarketList_markets {
name: 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)
+ * number denominated in the currency of the market. (uint64)
*
* Examples:
* Currency Balance decimalPlaces Real Balance
@@ -193,9 +193,10 @@ export interface MarketList_markets {
*/
decimalPlaces: number;
/**
- * positionDecimalPlaces indicated the number of decimal places that an integer must be shifted in order to get a correct size (uint64).
+ * positionDecimalPlaces indicates the number of decimal places that an integer must be shifted in order to get a correct size (uint64).
* i.e. 0 means there are no fractional orders for the market, and order sizes are always whole sizes.
* 2 means sizes given as 10^2 * desired size, e.g. a desired size of 1.23 is represented as 123 in this market.
+ * This sets how big the smallest order / position on the market can be.
*/
positionDecimalPlaces: number;
/**
@@ -215,7 +216,7 @@ export interface MarketList_markets {
*/
data: MarketList_markets_data | null;
/**
- * An instance of or reference to a tradable instrument.
+ * An instance of, or reference to, a tradable instrument.
*/
tradableInstrument: MarketList_markets_tradableInstrument;
/**
@@ -223,7 +224,7 @@ export interface MarketList_markets {
*/
marketTimestamps: MarketList_markets_marketTimestamps;
/**
- * Candles on a market, for the 'last' n candles, at 'interval' seconds as specified by params
+ * Candles on a market, for the 'last' n candles, at 'interval' seconds as specified by parameters
*/
candles: (MarketList_markets_candles | null)[] | null;
}
diff --git a/libs/market-list/src/lib/components/asset-details-dialog/__generated__/AssetsConnection.ts b/libs/market-list/src/lib/components/asset-details-dialog/__generated__/AssetsConnection.ts
index 04c123868..47a34d4c6 100644
--- a/libs/market-list/src/lib/components/asset-details-dialog/__generated__/AssetsConnection.ts
+++ b/libs/market-list/src/lib/components/asset-details-dialog/__generated__/AssetsConnection.ts
@@ -14,17 +14,17 @@ export interface AssetsConnection_assetsConnection_edges_node_source_BuiltinAsse
export interface AssetsConnection_assetsConnection_edges_node_source_ERC20 {
__typename: "ERC20";
/**
- * The address of the erc20 contract
+ * The address of the ERC20 contract
*/
contractAddress: string;
/**
* The lifetime limits deposit per address
- * Note: this is a temporary measure for restricted mainnet
+ * Note: this is a temporary measure for alpha mainnet
*/
lifetimeLimit: string;
/**
- * The maximum allowed per withdraw
- * Note: this is a temporary measure for restricted mainnet
+ * The maximum allowed per withdrawal
+ * Note: this is a temporary measure for alpha mainnet
*/
withdrawThreshold: string;
}
@@ -34,7 +34,7 @@ export type AssetsConnection_assetsConnection_edges_node_source = AssetsConnecti
export interface AssetsConnection_assetsConnection_edges_node {
__typename: "Asset";
/**
- * The id of the asset
+ * The ID of the asset
*/
id: string;
/**
@@ -46,11 +46,7 @@ export interface AssetsConnection_assetsConnection_edges_node {
*/
symbol: string;
/**
- * The total supply of the market
- */
- totalSupply: string;
- /**
- * The precision of the asset
+ * 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;
/**
@@ -58,7 +54,7 @@ export interface AssetsConnection_assetsConnection_edges_node {
*/
quantum: string;
/**
- * The origin source of the asset (e.g: an erc20 asset)
+ * The origin source of the asset (e.g: an ERC20 asset)
*/
source: AssetsConnection_assetsConnection_edges_node_source;
}
@@ -78,7 +74,7 @@ export interface AssetsConnection_assetsConnection {
export interface AssetsConnection {
/**
- * The list of all assets in use in the vega network or the specified asset if id is provided
+ * The list of all assets in use in the Vega network or the specified asset if ID is provided
*/
assetsConnection: AssetsConnection_assetsConnection;
}
diff --git a/libs/market-list/src/lib/components/asset-details-dialog/asset-details-dialog.spec.tsx b/libs/market-list/src/lib/components/asset-details-dialog/asset-details-dialog.spec.tsx
index 7086f44fc..574e65ccd 100644
--- a/libs/market-list/src/lib/components/asset-details-dialog/asset-details-dialog.spec.tsx
+++ b/libs/market-list/src/lib/components/asset-details-dialog/asset-details-dialog.spec.tsx
@@ -14,7 +14,6 @@ const mockedData = {
id: 'XYZalpha',
name: 'XYZ (α alpha)',
symbol: 'XYZalpha',
- totalSupply: '10000000000000000000000000000',
decimals: 5,
quantum: '1',
source: {
@@ -29,7 +28,6 @@ const mockedData = {
id: 'XYZbeta',
name: 'XYZ (β beta)',
symbol: 'XYZbeta',
- totalSupply: '1000000000',
decimals: 5,
quantum: '1',
source: {
@@ -44,7 +42,6 @@ const mockedData = {
id: 'XYZdelta',
name: 'XYZ (δ delta)',
symbol: 'XYZdelta',
- totalSupply: '1000000000',
decimals: 5,
quantum: '1',
source: {
@@ -59,7 +56,6 @@ const mockedData = {
id: 'XYZepsilon',
name: 'XYZ (ε epsilon)',
symbol: 'XYZepsilon',
- totalSupply: '1000000000',
decimals: 5,
quantum: '1',
source: {
@@ -74,7 +70,6 @@ const mockedData = {
id: 'XYZgamma',
name: 'XYZ (γ gamma)',
symbol: 'XYZgamma',
- totalSupply: '1000000000',
decimals: 5,
quantum: '1',
source: {
@@ -89,7 +84,6 @@ const mockedData = {
id: '2282ffc06a557173d297739305cc69f6444cdbbb1089df7d9aef32bbfd735ba1',
name: 'Tim Token (Vega)',
symbol: 'TIM',
- totalSupply: '1000000000000000000000000000',
decimals: 18,
quantum: '1',
source: {
@@ -107,7 +101,6 @@ const mockedData = {
id: '449dbfb66e7a444c485b4fdc77ddc6bbf81abbf7c8e247ac299c25e9557b99cf',
name: 'Taker Reward Token (Vega)',
symbol: 'TAK',
- totalSupply: '1000000000000000000000000000',
decimals: 18,
quantum: '1',
source: {
@@ -125,7 +118,6 @@ const mockedData = {
id: '5cfa87844724df6069b94e4c8a6f03af21907d7bc251593d08e4251043ee9f7c',
name: 'tBTC TEST',
symbol: 'tBTC',
- totalSupply: '21000000',
decimals: 5,
quantum: '1',
source: {
@@ -143,7 +135,6 @@ const mockedData = {
id: '6d9d35f657589e40ddfb448b7ad4a7463b66efb307527fedd2aa7df1bbd5ea61',
name: 'tDAI TEST',
symbol: 'tDAI',
- totalSupply: '21000000',
decimals: 5,
quantum: '1',
source: {
@@ -161,7 +152,6 @@ const mockedData = {
id: '8b52d4a3a4b0ffe733cddbc2b67be273816cfeb6ca4c8b339bac03ffba08e4e4',
name: 'tEURO TEST',
symbol: 'tEURO',
- totalSupply: '21000000',
decimals: 5,
quantum: '1',
source: {
@@ -179,7 +169,6 @@ const mockedData = {
id: '98032ba34576f8012de9b822e1da3ed4b6223a4f4e05f573002d441ffb4bf314',
name: 'Liquidity Reward Token (Vega)',
symbol: 'LIQ',
- totalSupply: '1000000200000000000000000000',
decimals: 18,
quantum: '1',
source: {
@@ -197,7 +186,6 @@ const mockedData = {
id: '993ed98f4f770d91a796faab1738551193ba45c62341d20597df70fea6704ede',
name: 'tUSDC TEST',
symbol: 'tUSDC',
- totalSupply: '21000000',
decimals: 5,
quantum: '1',
source: {
@@ -215,7 +203,6 @@ const mockedData = {
id: 'ba98cdeeec849a053e60cc03808e91e90d9d2e62425c76a590617b95ad41a066',
name: 'Steve Token (Vega)',
symbol: 'STE',
- totalSupply: '1000000000000000000000000000',
decimals: 18,
quantum: '1',
source: {
@@ -233,7 +220,6 @@ const mockedData = {
id: 'ce3fb1ab0717f0adbce019d7aef53aacdbadefe2d30ad1647b55f134d4072c90',
name: 'Woz Token (Vega)',
symbol: 'WOZ',
- totalSupply: '1000000000000000000000000000',
decimals: 18,
quantum: '1',
source: {
@@ -251,7 +237,6 @@ const mockedData = {
id: 'ebcd94151ae1f0d39a4bde3b21a9c7ae81a80ea4352fb075a92e07608d9c953d',
name: 'Maker Reward Token (Vega)',
symbol: 'MAK',
- totalSupply: '1000000000000000000000000000',
decimals: 18,
quantum: '1',
source: {
@@ -269,7 +254,6 @@ const mockedData = {
id: 'fc7fd956078fb1fc9db5c19b88f0874c4299b2a7639ad05a47a28c0aef291b55',
name: 'Vega (testnet)',
symbol: 'VEGA',
- totalSupply: '64999723000000000000000000',
decimals: 18,
quantum: '1',
source: {
@@ -333,9 +317,6 @@ describe('AssetDetailsDialog', () => {
expect((await screen.findByTestId('name_value')).textContent).toContain(
name
);
- expect(
- (await screen.findByTestId('totalsupply_value')).textContent
- ).toContain(totalSupply);
}
);
});
diff --git a/libs/market-list/src/lib/components/asset-details-dialog/asset-details-dialog.tsx b/libs/market-list/src/lib/components/asset-details-dialog/asset-details-dialog.tsx
index 23042d31b..9702f5c39 100644
--- a/libs/market-list/src/lib/components/asset-details-dialog/asset-details-dialog.tsx
+++ b/libs/market-list/src/lib/components/asset-details-dialog/asset-details-dialog.tsx
@@ -1,5 +1,5 @@
import { gql, useQuery } from '@apollo/client';
-import { formatNumber, t, toBigNum } from '@vegaprotocol/react-helpers';
+import { t } from '@vegaprotocol/react-helpers';
import type { Asset } from '@vegaprotocol/react-helpers';
import {
Button,
@@ -50,7 +50,6 @@ export const ASSETS_CONNECTION_QUERY = gql`
id
name
symbol
- totalSupply
decimals
quantum
source {
@@ -111,12 +110,6 @@ export const AssetDetailsDialog = ({
value: asset.node.quantum,
tooltip: t('The minimum economically meaningful amount in the asset'),
},
- {
- key: 'totalsupply',
- label: t('Total supply'),
- value: formatNumber(toBigNum(asset.node.totalSupply, 0)),
- tooltip: t('Total circulating supply for the asset'),
- },
{
key: 'contractaddress',
label: t('Contract address'),
diff --git a/libs/market-list/src/lib/components/markets-container/market-list-table.tsx b/libs/market-list/src/lib/components/markets-container/market-list-table.tsx
index 30de7b3f0..4aa2d12eb 100644
--- a/libs/market-list/src/lib/components/markets-container/market-list-table.tsx
+++ b/libs/market-list/src/lib/components/markets-container/market-list-table.tsx
@@ -84,9 +84,10 @@ export const MarketListTable = forwardRef((props, ref) => {
if (!value) return value;
const { market, trigger } = value;
return market &&
- market.tradingMode === MarketTradingMode.MonitoringAuction &&
+ market.tradingMode ===
+ MarketTradingMode.TRADING_MODE_MONITORING_AUCTION &&
trigger &&
- trigger !== AuctionTrigger.Unspecified
+ trigger !== AuctionTrigger.AUCTION_TRIGGER_UNSPECIFIED
? `${formatLabel(market.tradingMode)} - ${trigger.toLowerCase()}`
: formatLabel(market?.tradingMode);
}}
diff --git a/libs/market-list/src/lib/components/markets-container/markets-container.tsx b/libs/market-list/src/lib/components/markets-container/markets-container.tsx
index 228ef0711..83d720a88 100644
--- a/libs/market-list/src/lib/components/markets-container/markets-container.tsx
+++ b/libs/market-list/src/lib/components/markets-container/markets-container.tsx
@@ -20,7 +20,7 @@ export const MarketsContainer = () => {
const yesterday = Math.round(new Date().getTime() / 1000) - 24 * 3600;
const yTimestamp = new Date(yesterday * 1000).toISOString();
const variables = useMemo(
- () => ({ interval: Interval.I1H, since: yTimestamp }),
+ () => ({ interval: Interval.INTERVAL_I1H, since: yTimestamp }),
[yTimestamp]
);
@@ -45,7 +45,7 @@ export const MarketsContainer = () => {
const rowsThisBlock = dataRef.current
? dataRef.current
.slice(startRow, endRow)
- .filter((m) => m.data?.market.state !== MarketState.Rejected)
+ .filter((m) => m.data?.market.state !== MarketState.STATE_REJECTED)
: [];
const lastRow = dataRef.current?.length ?? -1;
successCallback(rowsThisBlock, lastRow);
diff --git a/libs/market-list/src/lib/components/select-market-columns.tsx b/libs/market-list/src/lib/components/select-market-columns.tsx
index 43429c087..c3770c86a 100644
--- a/libs/market-list/src/lib/components/select-market-columns.tsx
+++ b/libs/market-list/src/lib/components/select-market-columns.tsx
@@ -294,9 +294,10 @@ export const columns = (market: any, onSelect: (id: string) => void) => {
},
{
value:
- market.tradingMode === MarketTradingMode.MonitoringAuction &&
+ market.tradingMode ===
+ MarketTradingMode.TRADING_MODE_MONITORING_AUCTION &&
market.data?.trigger &&
- market.data.trigger !== AuctionTrigger.Unspecified
+ market.data.trigger !== AuctionTrigger.AUCTION_TRIGGER_UNSPECIFIED
? `${formatLabel(
market.tradingMode
)} - ${market.data?.trigger.toLowerCase()}`
@@ -453,9 +454,10 @@ export const columnsPositionMarkets = (
},
{
value:
- market.tradingMode === MarketTradingMode.MonitoringAuction &&
+ market.tradingMode ===
+ MarketTradingMode.TRADING_MODE_MONITORING_AUCTION &&
market.data?.trigger &&
- market.data.trigger !== AuctionTrigger.Unspecified
+ market.data.trigger !== AuctionTrigger.AUCTION_TRIGGER_UNSPECIFIED
? `${formatLabel(
market.tradingMode
)} - ${market.data?.trigger.toLowerCase()}`
diff --git a/libs/market-list/src/lib/components/select-market.tsx b/libs/market-list/src/lib/components/select-market.tsx
index 2aa27f816..106da8271 100644
--- a/libs/market-list/src/lib/components/select-market.tsx
+++ b/libs/market-list/src/lib/components/select-market.tsx
@@ -125,10 +125,11 @@ export const SelectMarketPopover = ({
const variables = useMemo(() => ({ partyId: keypair?.pub }), [keypair?.pub]);
const { data } = useQuery(MARKET_LIST_QUERY, {
- variables: { interval: Interval.I1H, since: yTimestamp },
+ variables: { interval: Interval.INTERVAL_I1H, since: yTimestamp },
});
const { data: marketDataPositions } = useQuery(POSITION_QUERY, {
variables,
+ skip: !keypair?.pub,
});
const positionMarkets = useMemo(
@@ -231,7 +232,7 @@ export const SelectMarketDialog = ({
};
const { data } = useQuery(MARKET_LIST_QUERY, {
- variables: { interval: Interval.I1H, since: yTimestamp },
+ variables: { interval: Interval.INTERVAL_I1H, since: yTimestamp },
});
return (