Skip to content

Commit

Permalink
fix: static circles conversion v0.12.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jaensen committed Oct 13, 2024
1 parent 1081ada commit 8f669b1
Show file tree
Hide file tree
Showing 17 changed files with 88 additions and 93 deletions.
46 changes: 23 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@
},
"name": "@cirlces-sdk/root",
"license": "MIT",
"version": "0.12.1"
"version": "0.12.2"
}
2 changes: 1 addition & 1 deletion packages/abi-v1/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@circles-sdk/abi-v1",
"version": "0.12.1",
"version": "0.12.2",
"description": "",
"type": "module",
"main": "./dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/abi-v2/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@circles-sdk/abi-v2",
"version": "0.12.1",
"version": "0.12.2",
"description": "",
"type": "module",
"main": "./dist/index.js",
Expand Down
4 changes: 2 additions & 2 deletions packages/adapter-cometh/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@circles-sdk/adapter-cometh",
"version": "0.12.1",
"version": "0.12.2",
"description": "",
"type": "module",
"main": "./dist/index.js",
Expand All @@ -17,7 +17,7 @@
"build": "rollup -c"
},
"dependencies": {
"@circles-sdk/adapter": "0.12.1",
"@circles-sdk/adapter": "0.12.2",
"@cometh/connect-sdk": "1.2.29"
},
"keywords": [],
Expand Down
4 changes: 2 additions & 2 deletions packages/adapter-ethers/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@circles-sdk/adapter-ethers",
"version": "0.12.1",
"version": "0.12.2",
"description": "",
"type": "module",
"main": "./dist/index.js",
Expand All @@ -18,7 +18,7 @@
},
"dependencies": {
"ethers": "^6.13.2",
"@circles-sdk/adapter": "0.12.1"
"@circles-sdk/adapter": "0.12.2"
},
"keywords": [],
"author": "",
Expand Down
4 changes: 2 additions & 2 deletions packages/adapter-safe-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@circles-sdk/adapter-safe-app",
"version": "0.12.1",
"version": "0.12.2",
"description": "",
"type": "module",
"main": "./dist/index.js",
Expand All @@ -17,7 +17,7 @@
"build": "rollup -c"
},
"dependencies": {
"@circles-sdk/adapter": "0.12.1",
"@circles-sdk/adapter": "0.12.2",
"@safe-global/safe-apps-sdk": "^9.1.0"
},
"keywords": [],
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-safe/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@circles-sdk/adapter-safe",
"version": "0.12.1",
"version": "0.12.2",
"description": "",
"type": "module",
"main": "./dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@circles-sdk/adapter",
"version": "0.12.1",
"version": "0.12.2",
"description": "",
"type": "module",
"main": "./dist/index.js",
Expand Down
4 changes: 2 additions & 2 deletions packages/data/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@circles-sdk/data",
"version": "0.12.1",
"version": "0.12.2",
"description": "",
"type": "module",
"main": "./dist/index.js",
Expand All @@ -17,7 +17,7 @@
"build": "rollup -c"
},
"dependencies": {
"@circles-sdk/utils": "0.12.1"
"@circles-sdk/utils": "0.12.2"
},
"keywords": [],
"author": "",
Expand Down
12 changes: 2 additions & 10 deletions packages/data/src/circlesData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import {TokenBalanceRow} from './rows/tokenBalanceRow';
import {CirclesRpc} from './circlesRpc';
import {AvatarRow} from './rows/avatarRow';
import {
attoCirclesToStaticAttoCircles,
attoCirclesToCircles,
attoCirclesToStaticAttoCircles, circlesToAttoCircles,
crcToTc,
hexStringToUint8Array, staticAttoCirclesToAttoCircles,
tcToCrc,
uint8ArrayToCidV0
} from '@circles-sdk/utils';
import {ethers} from 'ethers';
import {TrustRelation, TrustRelationRow} from './rows/trustRelationRow';
import {CirclesDataInterface, GroupQueryParams} from './circlesDataInterface';
import {Observable} from './observable';
Expand Down Expand Up @@ -44,14 +44,6 @@ export type TokenInfo = {
isGroup: boolean
};

export function attoCirclesToCircles(weiBalance: bigint): number {
return parseFloat(ethers.formatEther(weiBalance.toString()));
}

export function circlesToAttoCircles(circlesBalance: number): bigint {
return BigInt(ethers.parseEther(circlesBalance.toFixed(18)).toString());
}

export const TokenTypes: Record<string, TokenInfo> = {
"CrcV1_Signup": {
isErc20: true,
Expand Down
6 changes: 1 addition & 5 deletions packages/data/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import {attoCirclesToCircles} from "./circlesData";

export {PagedQueryResult} from './pagedQuery/pagedQueryResult';
export {Cursor} from './pagedQuery/cursor';
export {CirclesQuery} from './pagedQuery/circlesQuery';
Expand Down Expand Up @@ -52,6 +50,4 @@ export {
} from './events/events';
export {TrustEvent} from "./circlesData";
export {TokenType} from './rows/tokenInfoRow';
export {TrustRelation} from './rows/trustRelationRow';
export {attoCirclesToCircles} from './circlesData';
export {circlesToAttoCircles} from './circlesData';
export {TrustRelation} from './rows/trustRelationRow';
4 changes: 2 additions & 2 deletions packages/profiles/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@circles-sdk/profiles",
"version": "0.12.1",
"version": "0.12.2",
"description": "",
"type": "module",
"main": "./dist/index.js",
Expand All @@ -17,7 +17,7 @@
"build": "rollup -c"
},
"dependencies": {
"@circles-sdk/utils": "0.12.1"
"@circles-sdk/utils": "0.12.2"
},
"keywords": [],
"author": "",
Expand Down
12 changes: 6 additions & 6 deletions packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@circles-sdk/sdk",
"version": "0.12.1",
"version": "0.12.2",
"description": "",
"type": "module",
"main": "./dist/index.js",
Expand All @@ -17,11 +17,11 @@
"author": "",
"license": "MIT",
"dependencies": {
"@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",
"@circles-sdk/abi-v1": "0.12.2",
"@circles-sdk/abi-v2": "0.12.2",
"@circles-sdk/data": "0.12.2",
"@circles-sdk/profiles": "0.12.2",
"@circles-sdk/adapter-ethers": "0.12.2",
"ethers": "^6.13.2",
"multihashes": "^4.0.3"
},
Expand Down
3 changes: 1 addition & 2 deletions packages/sdk/src/v2/v2Avatar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ import {
} from 'ethers';
import {Sdk} from '../sdk';
import {
attoCirclesToCircles,
AvatarRow,
CirclesQuery,
TokenBalanceRow,
TransactionHistoryRow,
TrustRelationRow
} from '@circles-sdk/data';
import {addressToUInt256, cidV0ToUint8Array} from '@circles-sdk/utils';
import { addressToUInt256, attoCirclesToCircles, cidV0ToUint8Array } from '@circles-sdk/utils';
import {Pathfinder} from './pathfinderV2';
import {Profile} from "@circles-sdk/profiles";
import {TokenType} from "@circles-sdk/data/dist/rows/tokenInfoRow";
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@circles-sdk/utils",
"version": "0.12.1",
"version": "0.12.2",
"description": "",
"type": "module",
"main": "./dist/index.js",
Expand Down
Loading

0 comments on commit 8f669b1

Please sign in to comment.