Skip to content

Commit

Permalink
fix(pol): fixes #131
Browse files Browse the repository at this point in the history
  • Loading branch information
bearpong committed Nov 4, 2024
1 parent 992db73 commit 18c61d0
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 311 deletions.
4 changes: 4 additions & 0 deletions graphql.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ module.exports = {
schema: process.env.NEXT_PUBLIC_CHAIN_BLOCKS_SUBGRAPH_URL,
documents: "./packages/graphql/src/modules/chain/query.ts",
},
pol: {
schema: process.env.NEXT_PUBLIC_POL_SUBGRAPH_URL,
documents: "./packages/graphql/src/modules/pol/query.ts",
},
balancerApi: {
schema: process.env.NEXT_PUBLIC_BALANCER_API_URL,
documents: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const getUserActiveValidators = async ({
throw new Error("pol subgraph uri is not found in config");
}

// TODO: handle more than 1000 validators
const result = await bgtClient.query<GetUserValidatorInformationQuery>({
query: GetUserValidatorInformation,
variables: { address: account.toLowerCase() },
Expand Down
308 changes: 0 additions & 308 deletions packages/graphql/src/modules/dex/codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,223 +34,9 @@ export type Scalars = {
Bytes: { input: any; output: any };
Date: { input: any; output: any };
GqlBigNumber: { input: any; output: any };
/**
* 8 bytes signed integer
*
*/
Int8: { input: any; output: any };
/** The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). */
JSON: { input: any; output: any };
/**
* A string representation of microseconds UNIX timestamp (16 digits)
*
*/
Timestamp: { input: any; output: any };
};

export enum Aggregation_Interval {
Day = "day",
Hour = "hour",
}

export type Block = {
__typename?: "Block";
author: Scalars["Bytes"]["output"];
baseFeePerGas?: Maybe<Scalars["BigInt"]["output"]>;
difficulty: Scalars["BigInt"]["output"];
gasLimit: Scalars["BigInt"]["output"];
gasUsed: Scalars["BigInt"]["output"];
hash: Scalars["Bytes"]["output"];
id: Scalars["ID"]["output"];
number: Scalars["BigInt"]["output"];
parentHash: Scalars["Bytes"]["output"];
receiptsRoot: Scalars["Bytes"]["output"];
size?: Maybe<Scalars["BigInt"]["output"]>;
stateRoot: Scalars["Bytes"]["output"];
timestamp: Scalars["BigInt"]["output"];
totalDifficulty: Scalars["BigInt"]["output"];
transactionsRoot: Scalars["Bytes"]["output"];
unclesHash: Scalars["Bytes"]["output"];
};

export type BlockChangedFilter = {
number_gte: Scalars["Int"]["input"];
};

export type Block_Filter = {
/** Filter for the block changed event. */
_change_block?: InputMaybe<BlockChangedFilter>;
and?: InputMaybe<Array<InputMaybe<Block_Filter>>>;
author?: InputMaybe<Scalars["Bytes"]["input"]>;
author_contains?: InputMaybe<Scalars["Bytes"]["input"]>;
author_gt?: InputMaybe<Scalars["Bytes"]["input"]>;
author_gte?: InputMaybe<Scalars["Bytes"]["input"]>;
author_in?: InputMaybe<Array<Scalars["Bytes"]["input"]>>;
author_lt?: InputMaybe<Scalars["Bytes"]["input"]>;
author_lte?: InputMaybe<Scalars["Bytes"]["input"]>;
author_not?: InputMaybe<Scalars["Bytes"]["input"]>;
author_not_contains?: InputMaybe<Scalars["Bytes"]["input"]>;
author_not_in?: InputMaybe<Array<Scalars["Bytes"]["input"]>>;
baseFeePerGas?: InputMaybe<Scalars["BigInt"]["input"]>;
baseFeePerGas_gt?: InputMaybe<Scalars["BigInt"]["input"]>;
baseFeePerGas_gte?: InputMaybe<Scalars["BigInt"]["input"]>;
baseFeePerGas_in?: InputMaybe<Array<Scalars["BigInt"]["input"]>>;
baseFeePerGas_lt?: InputMaybe<Scalars["BigInt"]["input"]>;
baseFeePerGas_lte?: InputMaybe<Scalars["BigInt"]["input"]>;
baseFeePerGas_not?: InputMaybe<Scalars["BigInt"]["input"]>;
baseFeePerGas_not_in?: InputMaybe<Array<Scalars["BigInt"]["input"]>>;
difficulty?: InputMaybe<Scalars["BigInt"]["input"]>;
difficulty_gt?: InputMaybe<Scalars["BigInt"]["input"]>;
difficulty_gte?: InputMaybe<Scalars["BigInt"]["input"]>;
difficulty_in?: InputMaybe<Array<Scalars["BigInt"]["input"]>>;
difficulty_lt?: InputMaybe<Scalars["BigInt"]["input"]>;
difficulty_lte?: InputMaybe<Scalars["BigInt"]["input"]>;
difficulty_not?: InputMaybe<Scalars["BigInt"]["input"]>;
difficulty_not_in?: InputMaybe<Array<Scalars["BigInt"]["input"]>>;
gasLimit?: InputMaybe<Scalars["BigInt"]["input"]>;
gasLimit_gt?: InputMaybe<Scalars["BigInt"]["input"]>;
gasLimit_gte?: InputMaybe<Scalars["BigInt"]["input"]>;
gasLimit_in?: InputMaybe<Array<Scalars["BigInt"]["input"]>>;
gasLimit_lt?: InputMaybe<Scalars["BigInt"]["input"]>;
gasLimit_lte?: InputMaybe<Scalars["BigInt"]["input"]>;
gasLimit_not?: InputMaybe<Scalars["BigInt"]["input"]>;
gasLimit_not_in?: InputMaybe<Array<Scalars["BigInt"]["input"]>>;
gasUsed?: InputMaybe<Scalars["BigInt"]["input"]>;
gasUsed_gt?: InputMaybe<Scalars["BigInt"]["input"]>;
gasUsed_gte?: InputMaybe<Scalars["BigInt"]["input"]>;
gasUsed_in?: InputMaybe<Array<Scalars["BigInt"]["input"]>>;
gasUsed_lt?: InputMaybe<Scalars["BigInt"]["input"]>;
gasUsed_lte?: InputMaybe<Scalars["BigInt"]["input"]>;
gasUsed_not?: InputMaybe<Scalars["BigInt"]["input"]>;
gasUsed_not_in?: InputMaybe<Array<Scalars["BigInt"]["input"]>>;
hash?: InputMaybe<Scalars["Bytes"]["input"]>;
hash_contains?: InputMaybe<Scalars["Bytes"]["input"]>;
hash_gt?: InputMaybe<Scalars["Bytes"]["input"]>;
hash_gte?: InputMaybe<Scalars["Bytes"]["input"]>;
hash_in?: InputMaybe<Array<Scalars["Bytes"]["input"]>>;
hash_lt?: InputMaybe<Scalars["Bytes"]["input"]>;
hash_lte?: InputMaybe<Scalars["Bytes"]["input"]>;
hash_not?: InputMaybe<Scalars["Bytes"]["input"]>;
hash_not_contains?: InputMaybe<Scalars["Bytes"]["input"]>;
hash_not_in?: InputMaybe<Array<Scalars["Bytes"]["input"]>>;
id?: InputMaybe<Scalars["ID"]["input"]>;
id_gt?: InputMaybe<Scalars["ID"]["input"]>;
id_gte?: InputMaybe<Scalars["ID"]["input"]>;
id_in?: InputMaybe<Array<Scalars["ID"]["input"]>>;
id_lt?: InputMaybe<Scalars["ID"]["input"]>;
id_lte?: InputMaybe<Scalars["ID"]["input"]>;
id_not?: InputMaybe<Scalars["ID"]["input"]>;
id_not_in?: InputMaybe<Array<Scalars["ID"]["input"]>>;
number?: InputMaybe<Scalars["BigInt"]["input"]>;
number_gt?: InputMaybe<Scalars["BigInt"]["input"]>;
number_gte?: InputMaybe<Scalars["BigInt"]["input"]>;
number_in?: InputMaybe<Array<Scalars["BigInt"]["input"]>>;
number_lt?: InputMaybe<Scalars["BigInt"]["input"]>;
number_lte?: InputMaybe<Scalars["BigInt"]["input"]>;
number_not?: InputMaybe<Scalars["BigInt"]["input"]>;
number_not_in?: InputMaybe<Array<Scalars["BigInt"]["input"]>>;
or?: InputMaybe<Array<InputMaybe<Block_Filter>>>;
parentHash?: InputMaybe<Scalars["Bytes"]["input"]>;
parentHash_contains?: InputMaybe<Scalars["Bytes"]["input"]>;
parentHash_gt?: InputMaybe<Scalars["Bytes"]["input"]>;
parentHash_gte?: InputMaybe<Scalars["Bytes"]["input"]>;
parentHash_in?: InputMaybe<Array<Scalars["Bytes"]["input"]>>;
parentHash_lt?: InputMaybe<Scalars["Bytes"]["input"]>;
parentHash_lte?: InputMaybe<Scalars["Bytes"]["input"]>;
parentHash_not?: InputMaybe<Scalars["Bytes"]["input"]>;
parentHash_not_contains?: InputMaybe<Scalars["Bytes"]["input"]>;
parentHash_not_in?: InputMaybe<Array<Scalars["Bytes"]["input"]>>;
receiptsRoot?: InputMaybe<Scalars["Bytes"]["input"]>;
receiptsRoot_contains?: InputMaybe<Scalars["Bytes"]["input"]>;
receiptsRoot_gt?: InputMaybe<Scalars["Bytes"]["input"]>;
receiptsRoot_gte?: InputMaybe<Scalars["Bytes"]["input"]>;
receiptsRoot_in?: InputMaybe<Array<Scalars["Bytes"]["input"]>>;
receiptsRoot_lt?: InputMaybe<Scalars["Bytes"]["input"]>;
receiptsRoot_lte?: InputMaybe<Scalars["Bytes"]["input"]>;
receiptsRoot_not?: InputMaybe<Scalars["Bytes"]["input"]>;
receiptsRoot_not_contains?: InputMaybe<Scalars["Bytes"]["input"]>;
receiptsRoot_not_in?: InputMaybe<Array<Scalars["Bytes"]["input"]>>;
size?: InputMaybe<Scalars["BigInt"]["input"]>;
size_gt?: InputMaybe<Scalars["BigInt"]["input"]>;
size_gte?: InputMaybe<Scalars["BigInt"]["input"]>;
size_in?: InputMaybe<Array<Scalars["BigInt"]["input"]>>;
size_lt?: InputMaybe<Scalars["BigInt"]["input"]>;
size_lte?: InputMaybe<Scalars["BigInt"]["input"]>;
size_not?: InputMaybe<Scalars["BigInt"]["input"]>;
size_not_in?: InputMaybe<Array<Scalars["BigInt"]["input"]>>;
stateRoot?: InputMaybe<Scalars["Bytes"]["input"]>;
stateRoot_contains?: InputMaybe<Scalars["Bytes"]["input"]>;
stateRoot_gt?: InputMaybe<Scalars["Bytes"]["input"]>;
stateRoot_gte?: InputMaybe<Scalars["Bytes"]["input"]>;
stateRoot_in?: InputMaybe<Array<Scalars["Bytes"]["input"]>>;
stateRoot_lt?: InputMaybe<Scalars["Bytes"]["input"]>;
stateRoot_lte?: InputMaybe<Scalars["Bytes"]["input"]>;
stateRoot_not?: InputMaybe<Scalars["Bytes"]["input"]>;
stateRoot_not_contains?: InputMaybe<Scalars["Bytes"]["input"]>;
stateRoot_not_in?: InputMaybe<Array<Scalars["Bytes"]["input"]>>;
timestamp?: InputMaybe<Scalars["BigInt"]["input"]>;
timestamp_gt?: InputMaybe<Scalars["BigInt"]["input"]>;
timestamp_gte?: InputMaybe<Scalars["BigInt"]["input"]>;
timestamp_in?: InputMaybe<Array<Scalars["BigInt"]["input"]>>;
timestamp_lt?: InputMaybe<Scalars["BigInt"]["input"]>;
timestamp_lte?: InputMaybe<Scalars["BigInt"]["input"]>;
timestamp_not?: InputMaybe<Scalars["BigInt"]["input"]>;
timestamp_not_in?: InputMaybe<Array<Scalars["BigInt"]["input"]>>;
totalDifficulty?: InputMaybe<Scalars["BigInt"]["input"]>;
totalDifficulty_gt?: InputMaybe<Scalars["BigInt"]["input"]>;
totalDifficulty_gte?: InputMaybe<Scalars["BigInt"]["input"]>;
totalDifficulty_in?: InputMaybe<Array<Scalars["BigInt"]["input"]>>;
totalDifficulty_lt?: InputMaybe<Scalars["BigInt"]["input"]>;
totalDifficulty_lte?: InputMaybe<Scalars["BigInt"]["input"]>;
totalDifficulty_not?: InputMaybe<Scalars["BigInt"]["input"]>;
totalDifficulty_not_in?: InputMaybe<Array<Scalars["BigInt"]["input"]>>;
transactionsRoot?: InputMaybe<Scalars["Bytes"]["input"]>;
transactionsRoot_contains?: InputMaybe<Scalars["Bytes"]["input"]>;
transactionsRoot_gt?: InputMaybe<Scalars["Bytes"]["input"]>;
transactionsRoot_gte?: InputMaybe<Scalars["Bytes"]["input"]>;
transactionsRoot_in?: InputMaybe<Array<Scalars["Bytes"]["input"]>>;
transactionsRoot_lt?: InputMaybe<Scalars["Bytes"]["input"]>;
transactionsRoot_lte?: InputMaybe<Scalars["Bytes"]["input"]>;
transactionsRoot_not?: InputMaybe<Scalars["Bytes"]["input"]>;
transactionsRoot_not_contains?: InputMaybe<Scalars["Bytes"]["input"]>;
transactionsRoot_not_in?: InputMaybe<Array<Scalars["Bytes"]["input"]>>;
unclesHash?: InputMaybe<Scalars["Bytes"]["input"]>;
unclesHash_contains?: InputMaybe<Scalars["Bytes"]["input"]>;
unclesHash_gt?: InputMaybe<Scalars["Bytes"]["input"]>;
unclesHash_gte?: InputMaybe<Scalars["Bytes"]["input"]>;
unclesHash_in?: InputMaybe<Array<Scalars["Bytes"]["input"]>>;
unclesHash_lt?: InputMaybe<Scalars["Bytes"]["input"]>;
unclesHash_lte?: InputMaybe<Scalars["Bytes"]["input"]>;
unclesHash_not?: InputMaybe<Scalars["Bytes"]["input"]>;
unclesHash_not_contains?: InputMaybe<Scalars["Bytes"]["input"]>;
unclesHash_not_in?: InputMaybe<Array<Scalars["Bytes"]["input"]>>;
};

export type Block_Height = {
hash?: InputMaybe<Scalars["Bytes"]["input"]>;
number?: InputMaybe<Scalars["Int"]["input"]>;
number_gte?: InputMaybe<Scalars["Int"]["input"]>;
};

export enum Block_OrderBy {
Author = "author",
BaseFeePerGas = "baseFeePerGas",
Difficulty = "difficulty",
GasLimit = "gasLimit",
GasUsed = "gasUsed",
Hash = "hash",
Id = "id",
Number = "number",
ParentHash = "parentHash",
ReceiptsRoot = "receiptsRoot",
Size = "size",
StateRoot = "stateRoot",
Timestamp = "timestamp",
TotalDifficulty = "totalDifficulty",
TransactionsRoot = "transactionsRoot",
UnclesHash = "unclesHash",
}

export type GqlBalancePoolAprItem = {
__typename?: "GqlBalancePoolAprItem";
apr: GqlPoolAprValue;
Expand Down Expand Up @@ -2499,20 +2285,10 @@ export type MutationUserSyncBalanceArgs = {
poolId: Scalars["String"]["input"];
};

/** Defines the order direction, either ascending or descending */
export enum OrderDirection {
Asc = "asc",
Desc = "desc",
}

export type Query = {
__typename?: "Query";
/** Access to subgraph metadata */
_meta?: Maybe<_Meta_>;
beetsGetFbeetsRatio: Scalars["String"]["output"];
beetsPoolGetReliquaryFarmSnapshots: Array<GqlReliquaryFarmSnapshot>;
block?: Maybe<Block>;
blocks: Array<Block>;
blocksGetAverageBlockTime: Scalars["Float"]["output"];
blocksGetBlocksPerDay: Scalars["Float"]["output"];
blocksGetBlocksPerSecond: Scalars["Float"]["output"];
Expand Down Expand Up @@ -2621,31 +2397,11 @@ export type Query = {
veBalGetVotingList: Array<GqlVotingPool>;
};

export type Query_MetaArgs = {
block?: InputMaybe<Block_Height>;
};

export type QueryBeetsPoolGetReliquaryFarmSnapshotsArgs = {
id: Scalars["String"]["input"];
range: GqlPoolSnapshotDataRange;
};

export type QueryBlockArgs = {
block?: InputMaybe<Block_Height>;
id: Scalars["ID"]["input"];
subgraphError?: _SubgraphErrorPolicy_;
};

export type QueryBlocksArgs = {
block?: InputMaybe<Block_Height>;
first?: InputMaybe<Scalars["Int"]["input"]>;
orderBy?: InputMaybe<Block_OrderBy>;
orderDirection?: InputMaybe<OrderDirection>;
skip?: InputMaybe<Scalars["Int"]["input"]>;
subgraphError?: _SubgraphErrorPolicy_;
where?: InputMaybe<Block_Filter>;
};

export type QueryContentGetNewsItemsArgs = {
chain?: InputMaybe<GqlChain>;
};
Expand Down Expand Up @@ -2869,76 +2625,12 @@ export type QueryVeBalGetUserBalancesArgs = {
chains?: InputMaybe<Array<GqlChain>>;
};

export type Subscription = {
__typename?: "Subscription";
/** Access to subgraph metadata */
_meta?: Maybe<_Meta_>;
block?: Maybe<Block>;
blocks: Array<Block>;
};

export type Subscription_MetaArgs = {
block?: InputMaybe<Block_Height>;
};

export type SubscriptionBlockArgs = {
block?: InputMaybe<Block_Height>;
id: Scalars["ID"]["input"];
subgraphError?: _SubgraphErrorPolicy_;
};

export type SubscriptionBlocksArgs = {
block?: InputMaybe<Block_Height>;
first?: InputMaybe<Scalars["Int"]["input"]>;
orderBy?: InputMaybe<Block_OrderBy>;
orderDirection?: InputMaybe<OrderDirection>;
skip?: InputMaybe<Scalars["Int"]["input"]>;
subgraphError?: _SubgraphErrorPolicy_;
where?: InputMaybe<Block_Filter>;
};

export type Token = {
__typename?: "Token";
address: Scalars["String"]["output"];
decimals: Scalars["Int"]["output"];
};

export type _Block_ = {
__typename?: "_Block_";
/** The hash of the block */
hash?: Maybe<Scalars["Bytes"]["output"]>;
/** The block number */
number: Scalars["Int"]["output"];
/** The hash of the parent block */
parentHash?: Maybe<Scalars["Bytes"]["output"]>;
/** Integer representation of the timestamp stored in blocks for the chain */
timestamp?: Maybe<Scalars["Int"]["output"]>;
};

/** The type for the top-level _meta field */
export type _Meta_ = {
__typename?: "_Meta_";
/**
* Information about a specific subgraph block. The hash of the block
* will be null if the _meta field has a block constraint that asks for
* a block number. It will be filled if the _meta field has no block constraint
* and therefore asks for the latest block
*
*/
block: _Block_;
/** The deployment ID */
deployment: Scalars["String"]["output"];
/** If `true`, the subgraph encountered indexing errors at some past block */
hasIndexingErrors: Scalars["Boolean"]["output"];
};

export enum _SubgraphErrorPolicy_ {
/** Data will be returned even if the subgraph has indexing errors */
Allow = "allow",
/** If the subgraph has indexing errors, data will be omitted. The default. */
Deny = "deny",
}

export type GetPoolEventsQueryVariables = Exact<{
poolId: Scalars["String"]["input"];
typeIn: Array<GqlPoolEventType> | GqlPoolEventType;
Expand Down
4 changes: 2 additions & 2 deletions packages/graphql/src/modules/pol/codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5506,7 +5506,7 @@ export type GetBgtInflationQueryResult = Apollo.QueryResult<
>;
export const GetUserValidatorInformationDocument = gql`
query GetUserValidatorInformation($address: Bytes!) {
userValidatorInformations(where: {user: $address}) {
userValidatorInformations(where: {user: $address}, first: 1000) {
id
amountQueued
amountDeposited
Expand Down Expand Up @@ -6607,7 +6607,7 @@ export const GetBgtInflation = gql`
`;
export const GetUserValidatorInformation = gql`
query GetUserValidatorInformation($address: Bytes!) {
userValidatorInformations(where: {user: $address}) {
userValidatorInformations(where: {user: $address}, first: 1000) {
id
amountQueued
amountDeposited
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql/src/modules/pol/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default gql`
}
query GetUserValidatorInformation($address: Bytes!) {
userValidatorInformations(where: { user: $address }) {
userValidatorInformations(where: { user: $address }, first: 1000) {
id
amountQueued
amountDeposited
Expand Down

0 comments on commit 18c61d0

Please sign in to comment.