Skip to content

Commit

Permalink
Merge pull request #402 from balancer/4.1.1-beta.14
Browse files Browse the repository at this point in the history
4.1.1 beta.14
  • Loading branch information
lgahdl authored Jul 20, 2023
2 parents 87224f8 + bb7db7a commit da0f9f7
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 7 deletions.
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

0 comments on commit da0f9f7

Please sign in to comment.