From bb2cf88bfe1bfa57c4b9782e9b92e18f49f45977 Mon Sep 17 00:00:00 2001 From: Luiz Gustavo Abou Hatem De Liz Date: Tue, 18 Jul 2023 20:50:43 -0300 Subject: [PATCH 1/2] adding .idea folder to gitignore; adding chunk size to fetch pools funcionality; --- .gitignore | 3 ++- src/poolCacher.ts | 10 ++++++++-- src/types.ts | 5 ++++- src/wrapper.ts | 7 +++++-- 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 4462d889..58f9e1fc 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ yarn-error.log .DS_Store .env dist/ -cache/ \ No newline at end of file +cache/ +.idea/ \ No newline at end of file diff --git a/src/poolCacher.ts b/src/poolCacher.ts index 7e8a5a5a..7214c609 100644 --- a/src/poolCacher.ts +++ b/src/poolCacher.ts @@ -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 { + public async fetchPools( + queryArgs?: GraphQLArgs, + chunkSize?: number + ): Promise { try { - this.pools = await this.poolDataService.getPools(queryArgs); + this.pools = await this.poolDataService.getPools( + queryArgs, + chunkSize + ); this._finishedFetching = true; return true; } catch (err) { diff --git a/src/types.ts b/src/types.ts index a24029a8..e98c8cf6 100644 --- a/src/types.ts +++ b/src/types.ts @@ -275,7 +275,10 @@ export interface TokenPriceService { } export interface PoolDataService { - getPools(query?: GraphQLArgs): Promise; + getPools( + query?: GraphQLArgs, + chunkSize?: number + ): Promise; } export type FundManagement = { diff --git a/src/wrapper.ts b/src/wrapper.ts index 558144c2..873d60b3 100644 --- a/src/wrapper.ts +++ b/src/wrapper.ts @@ -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 { - return this.poolCacher.fetchPools(queryArgs); + async fetchPools( + queryArgs?: GraphQLArgs, + chunkSize?: number + ): Promise { + return this.poolCacher.fetchPools(queryArgs, chunkSize); } /** From bb7db7ae69ee9fe50f70af949bd8231f77fa59be Mon Sep 17 00:00:00 2001 From: Luiz Gustavo Abou Hatem De Liz Date: Thu, 20 Jul 2023 18:42:57 -0300 Subject: [PATCH 2/2] Changing package version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6352de61..02a159cc 100644 --- a/package.json +++ b/package.json @@ -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",