Skip to content

Commit 5ea4794

Browse files
committed
initiated migration
1 parent d1d4eab commit 5ea4794

29 files changed

+9252
-12893
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
# production
1212
/build
13+
/src/lib
1314

1415
# misc
1516
.DS_Store

eslint.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ export default tseslint.config(
2525
],
2626
"@typescript-eslint/no-explicit-any": "off",
2727
"@typescript-eslint/ban-ts-comment": "off",
28-
"no-debugger":"off",
28+
"no-debugger": "off",
2929
"@typescript-eslint/no-unused-vars": "off",
3030
"react-refresh/only-export-components": "off",
3131
"react-hooks/exhaustive-deps": "off",
32+
"react-hooks/set-state-in-effect": "off",
3233
"@typescript-eslint/no-unused-expressions": "off"
3334
}
3435
}

package-lock.json

Lines changed: 8920 additions & 12131 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 57 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -32,64 +32,78 @@
3232
"react-query": "4.0.0-beta.23"
3333
},
3434
"dependencies": {
35-
"@apollo/client": "^3.9.1",
36-
"@aut-labs/abi-types": "^0.0.88-dev",
37-
"@aut-labs/connector": "^0.0.205",
35+
"@apollo/client": "^4.0.7",
36+
"@aut-labs/abi-types": "^0.0.89-dev",
37+
"@aut-labs/connector": "^0.0.219",
3838
"@aut-labs/d-aut": "^1.0.206-dev",
39-
"@aut-labs/sdk": "^0.0.230-dev",
40-
"@emotion/react": "^11.11.3",
41-
"@emotion/styled": "^11.11.0",
42-
"@mui/icons-material": "^5.15.7",
43-
"@mui/lab": "^5.0.0-alpha.163",
44-
"@mui/material": "^5.15.7",
45-
"@reduxjs/toolkit": "^2.1.0",
46-
"@tanstack/react-query": "^5.56.2",
47-
"axios": "^1.6.7",
39+
"@aut-labs/sdk": "^0.0.231-dev",
40+
"@emotion/react": "^11.14.0",
41+
"@emotion/styled": "^11.14.1",
42+
"@mui/icons-material": "^7.3.4",
43+
"@mui/lab": "^7.0.1-beta.18",
44+
"@mui/material": "^7.3.4",
45+
"@mui/styles": "^6.5.0",
46+
"@reduxjs/toolkit": "^2.9.1",
47+
"@tanstack/react-query": "^5.90.5",
48+
"@web3auth/base": "^8.12.4",
49+
"@web3auth/ethereum-provider": "^8.12.4",
50+
"@web3auth/modal": "^8.12.7",
51+
"@web3auth/openlogin-adapter": "^8.12.4",
52+
"@web3auth/wallet-services-plugin": "^8.12.5",
53+
"@web3auth/web3auth-wagmi-connector": "^6.0.0",
54+
"axios": "^1.12.2",
4855
"buffer": "^6.0.3",
49-
"clsx": "^2.1.0",
50-
"date-fns": "^3.3.1",
51-
"ethers": "^6.13.2",
52-
"graphql": "^16.8.1",
53-
"react": "^18.2.0",
56+
"clsx": "^2.1.1",
57+
"date-fns": "^4.1.0",
58+
"dateformat": "^5.0.3",
59+
"ethers": "^6.15.0",
60+
"graphql": "^16.11.0",
61+
"jss": "^10.10.0",
62+
"react": "^19.2.0",
5463
"react-copy-to-clipboard": "^5.1.0",
55-
"react-dom": "^18.2.0",
56-
"react-dropzone": "^14.2.3",
64+
"react-cropper": "^2.3.3",
65+
"react-dom": "^19.2.0",
66+
"react-dropzone": "^14.3.8",
5767
"react-helmet": "^6.1.0",
58-
"react-hook-form": "^7.49.3",
59-
"react-lines-ellipsis": "^0.15.4",
68+
"react-hook-form": "^7.65.0",
69+
"react-is": "^19.2.0",
70+
"react-lines-ellipsis": "^0.16.1",
6071
"react-lottie-player": "^2.1.0",
6172
"react-mui-confirm": "^1.0.1",
6273
"react-perfect-scrollbar": "^1.5.8",
63-
"react-redux": "^9.1.0",
64-
"react-router-dom": "^6.21.3",
65-
"react-share": "~5.0.3",
66-
"recharts": "^2.12.7",
67-
"reselect": "^5.1.0",
74+
"react-redux": "^9.2.0",
75+
"react-router-dom": "^7.9.4",
76+
"react-share": "~5.2.2",
77+
"recharts": "^3.3.0",
78+
"reselect": "^5.1.1",
6879
"rrweb": "^1.1.3",
69-
"viem": "^2.21.11",
70-
"wagmi": "^2.12.13"
80+
"siwe": "^3.0.0",
81+
"viem": "^2.38.3",
82+
"wagmi": "^2.18.1"
7183
},
7284
"devDependencies": {
73-
"@testing-library/jest-dom": "~6.4.1",
74-
"@testing-library/react": "~14.2.1",
75-
"@testing-library/user-event": "~14.5.2",
85+
"@testing-library/jest-dom": "~6.9.1",
86+
"@testing-library/react": "~16.3.0",
87+
"@testing-library/user-event": "~14.6.1",
88+
"@types/dateformat": "^5.0.3",
89+
"@types/react-cropper": "^1.3.7",
7690
"@types/react-helmet": "^6.1.11",
77-
"@typescript-eslint/eslint-plugin": "^8.6.0",
78-
"@typescript-eslint/parser": "^8.6.0",
91+
"@typescript-eslint/eslint-plugin": "^8.46.1",
92+
"@typescript-eslint/parser": "^8.46.1",
7993
"@vitejs/plugin-react": "^4.3.1",
80-
"eslint": "^9.9.0",
81-
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
82-
"eslint-plugin-react-refresh": "^0.4.9",
83-
"globals": "^15.9.0",
84-
"prettier": "3.3.3",
94+
"eslint": "^9.37.0",
95+
"eslint-plugin-react-hooks": "^7.0.0",
96+
"eslint-plugin-react-refresh": "^0.4.24",
97+
"globals": "^16.4.0",
98+
"prettier": "3.6.2",
8599
"redux-logger": "^3.0.6",
86-
"sass-embedded": "^1.79.3",
87-
"typescript": "^5.5.3",
88-
"typescript-eslint": "^8.0.1",
100+
"sass-embedded": "^1.93.2",
101+
"typescript": "^5.9.3",
102+
"typescript-eslint": "^8.46.1",
89103
"vite": "^5.4.1",
90104
"vite-plugin-eslint": "^1.8.1",
91105
"vite-plugin-node-polyfills": "^0.22.0",
92106
"vite-plugin-svgr": "^4.2.0",
93-
"web-vitals": "^3.5.2"
107+
"web-vitals": "^5.1.0"
94108
}
95-
}
109+
}

src/App.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,12 @@ function App() {
2828
const isParticipationScorePage = location.pathname === "/playground";
2929

3030
useEffect(() => {
31+
console.log('App useEffect triggered, isParticipationScorePage:', isParticipationScorePage);
3132
if (!isParticipationScorePage) {
33+
console.log('Fetching app config...');
3234
getAppConfig()
3335
.then(async (res) => {
36+
console.log('App config fetched successfully:', res);
3437
dispatch(setNetworks(res));
3538
const sdk = new AutSDK({
3639
enableDebug: environment.env === EnvMode.Development,
@@ -40,13 +43,17 @@ function App() {
4043
gatewayUrl: environment.ipfsGatewayUrl
4144
}
4245
});
46+
console.log('AutSDK initialized');
4347
setLoading(false);
4448
})
45-
.catch(() => {
49+
.catch((error) => {
50+
console.error('Error fetching app config:', error);
4651
setLoading(false);
4752
setError(true);
4853
});
4954
} else {
55+
console.log('Participation score page, setting loading to false');
56+
// eslint-disable-next-line react-hooks/set-state-in-effect
5057
setLoading(false);
5158
}
5259
}, [isParticipationScorePage]);

src/AutWallet.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { memo, useEffect, useRef } from "react";
22
import { Init } from "@aut-labs/d-aut";
33
import { AutWalletConnector, useAutConnector } from "@aut-labs/connector";
44
import { useSelector } from "react-redux";
5-
import { NetworkConfig } from "@api/network.config";
5+
import { NetworkConfig } from "@aut-labs/d-aut/types/network";
66
import { RequiredQueryParams } from "@api/RequiredQueryParams";
77
import { MultiSigner } from "@aut-labs/sdk/dist/models/models";
88
import { hubUpdateState } from "@store/Hub/hub.reducer";

src/api/aut.api.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ export const getHubSigil = async (hubAddress: string): Promise<string> => {
1515
if (sigilCache[hubAddress]) {
1616
return sigilCache[hubAddress];
1717
}
18-
return axios
19-
.get(`${environment.apiUrl}/user/generateSigil/${hubAddress}`)
20-
.then(({ data }) => {
21-
sigilCache[hubAddress] = data.sigil;
22-
return data.sigil;
23-
});
18+
try {
19+
const response = await axios.get(`${environment.apiUrl}/user/generateSigil/${hubAddress}`);
20+
sigilCache[hubAddress] = response.data.sigil;
21+
return response.data.sigil;
22+
} catch (error) {
23+
console.error('Error fetching hub sigil:', error);
24+
throw error;
25+
}
2426
};

src/api/hub.api.ts

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,15 @@ export const fetchHubsAndAutIDs = async (
4848
}
4949
}
5050
`;
51-
const response = await apolloClient.query<any>({
52-
query
53-
});
51+
let response;
52+
try {
53+
response = await apolloClient.query<any>({
54+
query
55+
});
56+
} catch (error) {
57+
console.error('Error fetching hubs and autIDs:', error);
58+
throw error;
59+
}
5460

5561
const fetchHubsMetadata = () => {
5662
return response.data.hubs.map(
@@ -74,9 +80,14 @@ export const fetchHubsAndAutIDs = async (
7480
deployer,
7581
members: [],
7682
address,
77-
domain
83+
domain,
84+
roles: [],
85+
marketTemplate: undefined,
86+
prestige: 0,
87+
absoluteValue: 0,
88+
market: undefined
7889
}
79-
} as HubOSHub);
90+
} as any);
8091
}
8192
);
8293
};
@@ -108,7 +119,8 @@ export const fetchHubsAndAutIDs = async (
108119
isAdmin: false
109120
})
110121
),
111-
network: null
122+
network: null,
123+
tokenId: id
112124
}
113125
});
114126
});
@@ -388,7 +400,7 @@ export const setArchetype = async (
388400
try {
389401
const sdk = await AutSDK.getInstance();
390402
body.hub.properties.archetype = body.archetype;
391-
const updatedHub = HubOSHub.updateHubNFT(body.hub);
403+
const updatedHub = body.hub; // HubOSHub.updateHubNFT(body);
392404
const uri = await sdk.client.sendJSONToIPFS(updatedHub as any);
393405
const hubService = sdk.initService<Hub>(Hub, body.hub.properties.address);
394406
const result = await hubService.contract.metadata.setMetadataUri(uri);
@@ -411,7 +423,7 @@ export const setArchetype = async (
411423
export const updateHub = async (body: HubOSHub, api: BaseQueryApi) => {
412424
try {
413425
const sdk = await AutSDK.getInstance();
414-
const updatedHub = HubOSHub.updateHubNFT(body);
426+
const updatedHub = body; // HubOSHub.updateHubNFT(body);
415427
const uri = await sdk.client.sendJSONToIPFS(updatedHub as any);
416428
console.log("uri", uri);
417429
const hubService: Hub = sdk.initService<Hub>(Hub, body.properties.address);

src/api/hub.model.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,19 @@ export const MarketTemplates = [
4444
export class HubProperties extends BaseHubProperties {
4545
members: HubOSAutID[];
4646
metadataUri: string;
47+
contract: string;
48+
archetype: { default: any };
49+
market: number;
50+
socials: any[];
4751

4852
constructor(data: HubProperties) {
4953
super(data);
5054
this.members = data.members;
5155
this.metadataUri = data.metadataUri;
56+
this.contract = data.contract;
57+
this.archetype = data.archetype;
58+
this.market = data.market;
59+
this.socials = data.socials;
5260
}
5361
}
5462

src/api/network.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export interface NetworkContracts {
77
autIDAddress: string;
88
hubRegistryAddress: string;
99
taskRegistryAddress: string;
10+
[key: string]: string | undefined;
1011
}
1112

1213
export interface NetworkConfig {

0 commit comments

Comments
 (0)