Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.1.1 beta.14 #402

Merged
merged 3 commits into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ yarn-error.log
.DS_Store
.env
dist/
cache/
cache/
.idea/
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@balancer-labs/sor",
"version": "4.1.1-beta.13",
"version": "4.1.1-beta.14",
"license": "GPL-3.0-only",
"main": "dist/index.js",
"module": "dist/index.esm.js",
Expand Down
10 changes: 8 additions & 2 deletions src/poolCacher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,15 @@ export class PoolCacher {
* @param {GraphQLArgs} queryArgs - Optional query arguments to pass to pool data service.
* @returns {boolean} True if pools fetched successfully, False if not.
*/
public async fetchPools(queryArgs?: GraphQLArgs): Promise<boolean> {
public async fetchPools(
queryArgs?: GraphQLArgs,
chunkSize?: number
): Promise<boolean> {
try {
this.pools = await this.poolDataService.getPools(queryArgs);
this.pools = await this.poolDataService.getPools(
queryArgs,
chunkSize
);
this._finishedFetching = true;
return true;
} catch (err) {
Expand Down
5 changes: 4 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,10 @@ export interface TokenPriceService {
}

export interface PoolDataService {
getPools(query?: GraphQLArgs): Promise<SubgraphPoolBase[]>;
getPools(
query?: GraphQLArgs,
chunkSize?: number
): Promise<SubgraphPoolBase[]>;
}

export type FundManagement = {
Expand Down
7 changes: 5 additions & 2 deletions src/wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,11 @@ export class SOR {
* fetchPools Retrieves pools information and saves to internal pools cache.
* @returns {boolean} True if pools fetched successfully, False if not.
*/
async fetchPools(queryArgs?: GraphQLArgs): Promise<boolean> {
return this.poolCacher.fetchPools(queryArgs);
async fetchPools(
queryArgs?: GraphQLArgs,
chunkSize?: number
): Promise<boolean> {
return this.poolCacher.fetchPools(queryArgs, chunkSize);
}

/**
Expand Down
Loading