Skip to content

Commit

Permalink
use filteredPairs instead of pairs in settings
Browse files Browse the repository at this point in the history
  • Loading branch information
cfaur09 committed Feb 6, 2025
1 parent 477a493 commit cdee859
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions src/endpoints/mex/mex.settings.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,23 +87,19 @@ export class MexSettingsService {
}

public async getSettingsRaw(): Promise<MexSettings | null> {
const variables = {
offset: 0,
limit: 500,
};



const query = gql`
query ($offset: Int, $limit: Int) {
pairs(offset: $offset, limit: $limit, state: "Active") {
address
query {
filteredPairs(pagination: {first: 500}, filters: {state: ["Active"]}) {
edges {
node {
address
}
}
}
proxy {
address
lockedAssetTokens {
collection
__typename
}
}
farms {
Expand All @@ -119,10 +115,9 @@ export class MexSettingsService {
state
address
}
}
}
wrappingInfo {
address
shard
wrappedToken {
identifier
}
Expand Down Expand Up @@ -151,12 +146,19 @@ export class MexSettingsService {
}
`;

const response = await this.graphQlService.getExchangeServiceData(query, variables);
const response = await this.graphQlService.getExchangeServiceData(query);
if (!response) {
return null;
}

const settings = MexSettings.fromQueryResponse(response);
const transformedResponse = {
...response,
pairs: response.filteredPairs.edges.map((edge: { node: { address: string } }) => ({
address: edge.node.address,
})),
};

const settings = MexSettings.fromQueryResponse(transformedResponse);
return settings;
}

Expand Down

0 comments on commit cdee859

Please sign in to comment.