diff --git a/package-lock.json b/package-lock.json index 67be676..7d6f829 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@cirlces-sdk/root", - "version": "0.11.2", + "version": "0.12.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@cirlces-sdk/root", - "version": "0.11.2", + "version": "0.12.1", "license": "MIT", "workspaces": [ "packages/abi-v1", @@ -6531,7 +6531,7 @@ }, "packages/abi-v1": { "name": "@circles-sdk/abi-v1", - "version": "0.11.2", + "version": "0.12.1", "license": "MIT", "dependencies": { "ethers": "^6.13.2" @@ -6542,7 +6542,7 @@ }, "packages/abi-v2": { "name": "@circles-sdk/abi-v2", - "version": "0.11.2", + "version": "0.12.1", "license": "MIT", "dependencies": { "ethers": "^6.13.2" @@ -6553,7 +6553,7 @@ }, "packages/adapter": { "name": "@circles-sdk/adapter", - "version": "0.11.2", + "version": "0.12.1", "license": "MIT", "devDependencies": { "typescript": "^5.3.3" @@ -6561,10 +6561,10 @@ }, "packages/adapter-cometh": { "name": "@circles-sdk/adapter-cometh", - "version": "0.11.2", + "version": "0.12.1", "license": "MIT", "dependencies": { - "@circles-sdk/adapter": "0.11.2", + "@circles-sdk/adapter": "0.12.1", "@cometh/connect-sdk": "1.2.29" }, "devDependencies": { @@ -6573,10 +6573,10 @@ }, "packages/adapter-ethers": { "name": "@circles-sdk/adapter-ethers", - "version": "0.11.2", + "version": "0.12.1", "license": "MIT", "dependencies": { - "@circles-sdk/adapter": "0.11.2", + "@circles-sdk/adapter": "0.12.1", "ethers": "^6.13.2" }, "devDependencies": { @@ -6585,7 +6585,7 @@ }, "packages/adapter-safe": { "name": "@circles-sdk/adapter-safe", - "version": "0.11.2", + "version": "0.12.1", "license": "MIT", "dependencies": { "@circles-sdk/adapter": "^0.10.0", @@ -6598,10 +6598,10 @@ }, "packages/adapter-safe-app": { "name": "@circles-sdk/adapter-safe-app", - "version": "0.11.2", + "version": "0.12.1", "license": "MIT", "dependencies": { - "@circles-sdk/adapter": "0.11.2", + "@circles-sdk/adapter": "0.12.1", "@safe-global/safe-apps-sdk": "^9.1.0" }, "devDependencies": { @@ -6614,10 +6614,10 @@ }, "packages/data": { "name": "@circles-sdk/data", - "version": "0.11.2", + "version": "0.12.1", "license": "MIT", "dependencies": { - "@circles-sdk/utils": "0.11.2" + "@circles-sdk/utils": "0.12.1" }, "devDependencies": { "typescript": "^5.3.3" @@ -6625,10 +6625,10 @@ }, "packages/profiles": { "name": "@circles-sdk/profiles", - "version": "0.11.2", + "version": "0.12.1", "license": "ISC", "dependencies": { - "@circles-sdk/utils": "0.11.2" + "@circles-sdk/utils": "0.12.1" }, "devDependencies": { "typescript": "^5.3.3" @@ -6636,14 +6636,14 @@ }, "packages/sdk": { "name": "@circles-sdk/sdk", - "version": "0.11.2", + "version": "0.12.1", "license": "MIT", "dependencies": { - "@circles-sdk/abi-v1": "0.11.2", - "@circles-sdk/abi-v2": "0.11.2", - "@circles-sdk/adapter-ethers": "0.11.2", - "@circles-sdk/data": "0.11.2", - "@circles-sdk/profiles": "0.11.2", + "@circles-sdk/abi-v1": "0.12.1", + "@circles-sdk/abi-v2": "0.12.1", + "@circles-sdk/adapter-ethers": "0.12.1", + "@circles-sdk/data": "0.12.1", + "@circles-sdk/profiles": "0.12.1", "ethers": "^6.13.2", "multihashes": "^4.0.3" }, @@ -6654,10 +6654,11 @@ }, "packages/utils": { "name": "@circles-sdk/utils", - "version": "0.11.2", + "version": "0.12.1", "license": "MIT", "dependencies": { - "bignumber.js": "^9.1.2" + "bignumber.js": "^9.1.2", + "ethers": "^6.13.2" }, "devDependencies": { "typescript": "^5.3.3" diff --git a/package.json b/package.json index 2ffc697..3344963 100644 --- a/package.json +++ b/package.json @@ -36,5 +36,5 @@ }, "name": "@cirlces-sdk/root", "license": "MIT", - "version": "0.12.0" + "version": "0.12.1" } diff --git a/packages/abi-v1/package.json b/packages/abi-v1/package.json index c0fb5ac..9ad6a6f 100644 --- a/packages/abi-v1/package.json +++ b/packages/abi-v1/package.json @@ -1,6 +1,6 @@ { "name": "@circles-sdk/abi-v1", - "version": "0.12.0", + "version": "0.12.1", "description": "", "type": "module", "main": "./dist/index.js", diff --git a/packages/abi-v2/package.json b/packages/abi-v2/package.json index b08b045..767c3f6 100644 --- a/packages/abi-v2/package.json +++ b/packages/abi-v2/package.json @@ -1,6 +1,6 @@ { "name": "@circles-sdk/abi-v2", - "version": "0.12.0", + "version": "0.12.1", "description": "", "type": "module", "main": "./dist/index.js", diff --git a/packages/adapter-cometh/package.json b/packages/adapter-cometh/package.json index 4c6136f..7912c48 100644 --- a/packages/adapter-cometh/package.json +++ b/packages/adapter-cometh/package.json @@ -1,6 +1,6 @@ { "name": "@circles-sdk/adapter-cometh", - "version": "0.12.0", + "version": "0.12.1", "description": "", "type": "module", "main": "./dist/index.js", @@ -17,7 +17,7 @@ "build": "rollup -c" }, "dependencies": { - "@circles-sdk/adapter": "0.12.0", + "@circles-sdk/adapter": "0.12.1", "@cometh/connect-sdk": "1.2.29" }, "keywords": [], diff --git a/packages/adapter-ethers/package.json b/packages/adapter-ethers/package.json index 419e5c2..e0ee031 100644 --- a/packages/adapter-ethers/package.json +++ b/packages/adapter-ethers/package.json @@ -1,6 +1,6 @@ { "name": "@circles-sdk/adapter-ethers", - "version": "0.12.0", + "version": "0.12.1", "description": "", "type": "module", "main": "./dist/index.js", @@ -18,7 +18,7 @@ }, "dependencies": { "ethers": "^6.13.2", - "@circles-sdk/adapter": "0.12.0" + "@circles-sdk/adapter": "0.12.1" }, "keywords": [], "author": "", diff --git a/packages/adapter-safe-app/package.json b/packages/adapter-safe-app/package.json index 1880ae4..3ead222 100644 --- a/packages/adapter-safe-app/package.json +++ b/packages/adapter-safe-app/package.json @@ -1,6 +1,6 @@ { "name": "@circles-sdk/adapter-safe-app", - "version": "0.12.0", + "version": "0.12.1", "description": "", "type": "module", "main": "./dist/index.js", @@ -17,7 +17,7 @@ "build": "rollup -c" }, "dependencies": { - "@circles-sdk/adapter": "0.12.0", + "@circles-sdk/adapter": "0.12.1", "@safe-global/safe-apps-sdk": "^9.1.0" }, "keywords": [], diff --git a/packages/adapter-safe/package.json b/packages/adapter-safe/package.json index 999b4cc..e50ed31 100644 --- a/packages/adapter-safe/package.json +++ b/packages/adapter-safe/package.json @@ -1,6 +1,6 @@ { "name": "@circles-sdk/adapter-safe", - "version": "0.12.0", + "version": "0.12.1", "description": "", "type": "module", "main": "./dist/index.js", diff --git a/packages/adapter/package.json b/packages/adapter/package.json index 564732f..52d5ac3 100644 --- a/packages/adapter/package.json +++ b/packages/adapter/package.json @@ -1,6 +1,6 @@ { "name": "@circles-sdk/adapter", - "version": "0.12.0", + "version": "0.12.1", "description": "", "type": "module", "main": "./dist/index.js", diff --git a/packages/data/package.json b/packages/data/package.json index 95b6548..9fa8800 100644 --- a/packages/data/package.json +++ b/packages/data/package.json @@ -1,6 +1,6 @@ { "name": "@circles-sdk/data", - "version": "0.12.0", + "version": "0.12.1", "description": "", "type": "module", "main": "./dist/index.js", @@ -17,7 +17,7 @@ "build": "rollup -c" }, "dependencies": { - "@circles-sdk/utils": "0.12.0" + "@circles-sdk/utils": "0.12.1" }, "keywords": [], "author": "", diff --git a/packages/profiles/package.json b/packages/profiles/package.json index dcbfb7d..77fa3be 100644 --- a/packages/profiles/package.json +++ b/packages/profiles/package.json @@ -1,6 +1,6 @@ { "name": "@circles-sdk/profiles", - "version": "0.12.0", + "version": "0.12.1", "description": "", "type": "module", "main": "./dist/index.js", @@ -17,7 +17,7 @@ "build": "rollup -c" }, "dependencies": { - "@circles-sdk/utils": "0.12.0" + "@circles-sdk/utils": "0.12.1" }, "keywords": [], "author": "", diff --git a/packages/sdk/package.json b/packages/sdk/package.json index b0f745b..832a222 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@circles-sdk/sdk", - "version": "0.12.0", + "version": "0.12.1", "description": "", "type": "module", "main": "./dist/index.js", @@ -17,11 +17,11 @@ "author": "", "license": "MIT", "dependencies": { - "@circles-sdk/abi-v1": "0.12.0", - "@circles-sdk/abi-v2": "0.12.0", - "@circles-sdk/data": "0.12.0", - "@circles-sdk/profiles": "0.12.0", - "@circles-sdk/adapter-ethers": "0.12.0", + "@circles-sdk/abi-v1": "0.12.1", + "@circles-sdk/abi-v2": "0.12.1", + "@circles-sdk/data": "0.12.1", + "@circles-sdk/profiles": "0.12.1", + "@circles-sdk/adapter-ethers": "0.12.1", "ethers": "^6.13.2", "multihashes": "^4.0.3" }, diff --git a/packages/tests/test/data/circlesData.test.ts b/packages/tests/test/data/circlesData.test.ts index ed81066..3afec41 100644 --- a/packages/tests/test/data/circlesData.test.ts +++ b/packages/tests/test/data/circlesData.test.ts @@ -37,7 +37,7 @@ describe('CirclesData', () => { const tokenBalanceRows = await circlesData.getTokenBalances('0xc313FE6C294A7aE1818d0e537D7Ca5Ab0ef07F63'); expect(tokenBalanceRows).toBeDefined(); // expect a decimal number (or '0') - expect(tokenBalanceRows[0].balance).toMatch(/^\d+(\.\d+)?$/); + expect(tokenBalanceRows[0].circles).toMatch(/^\d+(\.\d+)?$/); console.log(JSON.stringify(tokenBalanceRows, null, 2)); }); @@ -45,10 +45,10 @@ describe('CirclesData', () => { it('should get the detailed V1 token balances of an address as CRC', async () => { const circlesData = new CirclesData(rpc); - const tokenBalanceRows = await circlesData.getTokenBalances('0xc313FE6C294A7aE1818d0e537D7Ca5Ab0ef07F63', false); + const tokenBalanceRows = await circlesData.getTokenBalances('0xc313FE6C294A7aE1818d0e537D7Ca5Ab0ef07F63'); expect(tokenBalanceRows).toBeDefined(); // expect an integer - expect(tokenBalanceRows[0].balance).toMatch(/^\d+$/); + expect(tokenBalanceRows[0].circles).toMatch(/^\d+$/); console.log(JSON.stringify(tokenBalanceRows, null, 2)); }); @@ -78,10 +78,10 @@ describe('CirclesData', () => { it('should get the detailed V2 token balances of an address as Time Circles', async () => { const circlesData = new CirclesData(rpc); - const tokenBalanceRows = await circlesData.getTokenBalancesV2('0xae3a29a9ff24d0e936a5579bae5c4179c4dff565'); + const tokenBalanceRows = await circlesData.getTokenBalances('0xae3a29a9ff24d0e936a5579bae5c4179c4dff565'); expect(tokenBalanceRows).toBeDefined(); // expect a decimal number (or '0') - expect(tokenBalanceRows[0].balance).toMatch(/^\d+(\.\d+)?$/); + expect(tokenBalanceRows[0].circles).toMatch(/^\d+(\.\d+)?$/); console.log(JSON.stringify(tokenBalanceRows, null, 2)); }); @@ -89,10 +89,10 @@ describe('CirclesData', () => { it('should get the detailed V2 token balances of an address as CRC', async () => { const circlesData = new CirclesData(rpc); - const tokenBalanceRows = await circlesData.getTokenBalancesV2('0xae3a29a9ff24d0e936a5579bae5c4179c4dff565', false); + const tokenBalanceRows = await circlesData.getTokenBalances('0xae3a29a9ff24d0e936a5579bae5c4179c4dff565'); expect(tokenBalanceRows).toBeDefined(); // expect an integer - expect(tokenBalanceRows[0].balance).toMatch(/^\d+$/); + expect(tokenBalanceRows[0].circles).toMatch(/^\d+$/); console.log(JSON.stringify(tokenBalanceRows, null, 2)); }); diff --git a/packages/tests/test/data/circlesQuery.test.ts b/packages/tests/test/data/circlesQuery.test.ts index f24f324..bda5277 100644 --- a/packages/tests/test/data/circlesQuery.test.ts +++ b/packages/tests/test/data/circlesQuery.test.ts @@ -63,7 +63,7 @@ describe('CirclesQuery', () => { expect(pagedQuery.currentPage?.size).toBe(10); expect(pagedQuery.currentPage?.limit).toBe(10); - const page1 = pagedQuery.currentPage.results; + const page1 = pagedQuery.currentPage?.results; console.log('page1', page1); const requestYieldedData2 = await pagedQuery.queryNextPage(); @@ -78,7 +78,7 @@ describe('CirclesQuery', () => { expect(pagedQuery.currentPage?.size).toBe(10); expect(pagedQuery.currentPage?.limit).toBe(10); - const page2 = pagedQuery.currentPage.results; + const page2 = pagedQuery.currentPage?.results; console.log('page2', page2); const requestYieldedData3 = await pagedQuery.queryNextPage(); @@ -88,7 +88,7 @@ describe('CirclesQuery', () => { expect(pagedQuery.currentPage?.results).toBeDefined(); expect(pagedQuery.currentPage?.results.length).toBe(10); - const page3 = pagedQuery.currentPage.results; + const page3 = pagedQuery.currentPage?.results; console.log('page3', page3); const requestYieldedData4 = await pagedQuery.queryNextPage(); @@ -98,7 +98,7 @@ describe('CirclesQuery', () => { expect(pagedQuery.currentPage?.results).toBeDefined(); expect(pagedQuery.currentPage?.results.length).toBe(3); - const page4 = pagedQuery.currentPage.results; + const page4 = pagedQuery.currentPage?.results; console.log('page4', page4); const requestYieldedData5 = await pagedQuery.queryNextPage(); @@ -126,7 +126,7 @@ describe('CirclesQuery', () => { expect(pagedQuery.currentPage?.size).toBe(1); expect(pagedQuery.currentPage?.limit).toBe(1); - const page1 = pagedQuery.currentPage.results; + const page1 = pagedQuery.currentPage?.results; console.log('page1', page1); const requestYieldedData2 = await pagedQuery.queryNextPage(); @@ -141,8 +141,11 @@ describe('CirclesQuery', () => { expect(pagedQuery.currentPage?.size).toBe(1); expect(pagedQuery.currentPage?.limit).toBe(1); - const page2 = pagedQuery.currentPage.results; + const page2 = pagedQuery.currentPage?.results; console.log('page2', page2); + if (!page1 || !page2) { + throw new Error('page1 or page2 is undefined'); + } expect(page1[0]).not.toEqual(page2[0]); expect(page1[0].blockNumber).toBeGreaterThan(page2[0].blockNumber); @@ -189,9 +192,13 @@ describe('CirclesQuery', () => { expect(pagedQuery.currentPage?.size).toBe(1); expect(pagedQuery.currentPage?.limit).toBe(1); - const page1 = pagedQuery.currentPage.results; + const page1 = pagedQuery.currentPage?.results; console.log('page1', page1); + if (!page1) { + throw new Error('page1 is undefined'); + } + // Make sure the results contain only data that matches the filter: page1.forEach(result => { expect(result.user).toBe('0xa318d01a47e200a89691484164ede4504e270cd7'); @@ -201,9 +208,13 @@ describe('CirclesQuery', () => { const requestYieldedData2 = await pagedQuery.queryNextPage(); expect(requestYieldedData2).toBe(true); - const page2 = pagedQuery.currentPage.results; + const page2 = pagedQuery.currentPage?.results; console.log('page2', page2); + if (!page2) { + throw new Error('page2 is undefined'); + } + page2.forEach(result => { expect(result.user).toBe('0xa318d01a47e200a89691484164ede4504e270cd7'); expect(result.blockNumber).toBeLessThanOrEqual(9777990); diff --git a/packages/utils/package.json b/packages/utils/package.json index 5628d4a..fb9514e 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@circles-sdk/utils", - "version": "0.12.0", + "version": "0.12.1", "description": "", "type": "module", "main": "./dist/index.js",