chore(trading): liquidity provision, change query for set flag live on true (#3335)
This commit is contained in:
parent
bd3b557f3d
commit
2bfc3abd15
@ -57,7 +57,7 @@ fragment LiquidityProvisionFields on LiquidityProvision {
|
|||||||
|
|
||||||
query LiquidityProvisions($marketId: ID!) {
|
query LiquidityProvisions($marketId: ID!) {
|
||||||
market(id: $marketId) {
|
market(id: $marketId) {
|
||||||
liquidityProvisionsConnection {
|
liquidityProvisionsConnection(live: true) {
|
||||||
edges {
|
edges {
|
||||||
node {
|
node {
|
||||||
...LiquidityProvisionFields
|
...LiquidityProvisionFields
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
fragment MarketNode on Market {
|
fragment MarketNode on Market {
|
||||||
id
|
id
|
||||||
liquidityProvisionsConnection {
|
liquidityProvisionsConnection(live: true) {
|
||||||
edges {
|
edges {
|
||||||
node {
|
node {
|
||||||
commitmentAmount
|
commitmentAmount
|
||||||
|
@ -138,7 +138,7 @@ export type MarketLpQueryResult = Apollo.QueryResult<MarketLpQuery, MarketLpQuer
|
|||||||
export const LiquidityProvisionsDocument = gql`
|
export const LiquidityProvisionsDocument = gql`
|
||||||
query LiquidityProvisions($marketId: ID!) {
|
query LiquidityProvisions($marketId: ID!) {
|
||||||
market(id: $marketId) {
|
market(id: $marketId) {
|
||||||
liquidityProvisionsConnection {
|
liquidityProvisionsConnection(live: true) {
|
||||||
edges {
|
edges {
|
||||||
node {
|
node {
|
||||||
...LiquidityProvisionFields
|
...LiquidityProvisionFields
|
||||||
@ -290,4 +290,4 @@ export function useLiquidityProviderFeeShareUpdateSubscription(baseOptions: Apol
|
|||||||
return Apollo.useSubscription<LiquidityProviderFeeShareUpdateSubscription, LiquidityProviderFeeShareUpdateSubscriptionVariables>(LiquidityProviderFeeShareUpdateDocument, options);
|
return Apollo.useSubscription<LiquidityProviderFeeShareUpdateSubscription, LiquidityProviderFeeShareUpdateSubscriptionVariables>(LiquidityProviderFeeShareUpdateDocument, options);
|
||||||
}
|
}
|
||||||
export type LiquidityProviderFeeShareUpdateSubscriptionHookResult = ReturnType<typeof useLiquidityProviderFeeShareUpdateSubscription>;
|
export type LiquidityProviderFeeShareUpdateSubscriptionHookResult = ReturnType<typeof useLiquidityProviderFeeShareUpdateSubscription>;
|
||||||
export type LiquidityProviderFeeShareUpdateSubscriptionResult = Apollo.SubscriptionResult<LiquidityProviderFeeShareUpdateSubscription>;
|
export type LiquidityProviderFeeShareUpdateSubscriptionResult = Apollo.SubscriptionResult<LiquidityProviderFeeShareUpdateSubscription>;
|
||||||
|
@ -13,7 +13,7 @@ export type LiquidityProvisionMarketsQuery = { __typename?: 'Query', marketsConn
|
|||||||
export const MarketNodeFragmentDoc = gql`
|
export const MarketNodeFragmentDoc = gql`
|
||||||
fragment MarketNode on Market {
|
fragment MarketNode on Market {
|
||||||
id
|
id
|
||||||
liquidityProvisionsConnection {
|
liquidityProvisionsConnection(live: true) {
|
||||||
edges {
|
edges {
|
||||||
node {
|
node {
|
||||||
commitmentAmount
|
commitmentAmount
|
||||||
|
@ -65,23 +65,11 @@ export const liquidityProvisionsDataProvider = makeDataProvider<
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
getData: (responseData: LiquidityProvisionsQuery | null) => {
|
getData: (responseData: LiquidityProvisionsQuery | null) => {
|
||||||
// to remove dedupe after core fix https://github.com/vegaprotocol/vega/issues/8043
|
|
||||||
const dedupeArr: string[] = [];
|
|
||||||
return (
|
return (
|
||||||
responseData?.market?.liquidityProvisionsConnection?.edges?.map(
|
responseData?.market?.liquidityProvisionsConnection?.edges?.map(
|
||||||
(e) => e?.node
|
(e) => e?.node
|
||||||
) ?? []
|
) ?? []
|
||||||
).filter((e) => {
|
).filter((e) => !!e) as LiquidityProvisionFieldsFragment[];
|
||||||
if (e) {
|
|
||||||
const id = getId(e);
|
|
||||||
if (dedupeArr.includes(id)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
dedupeArr.push(id);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}) as LiquidityProvisionFieldsFragment[];
|
|
||||||
},
|
},
|
||||||
getDelta: (
|
getDelta: (
|
||||||
subscriptionData: LiquidityProvisionsUpdateSubscription
|
subscriptionData: LiquidityProvisionsUpdateSubscription
|
||||||
|
Loading…
Reference in New Issue
Block a user