Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export default App;`.trim();
} ${poapPluginEnabled ? '@justweb3/poap-plugin' : ''} ${
efpPluginEnabled ? '@justweb3/efp-plugin' : ''
} ${dentityPluginEnabled ? '@justweb3/dentity-plugin' : ''}
@justweb3/widget viem wagmi @rainbow-me/rainbowkit @tanstack/react-query ethers`;
@justweb3/widget viem wagmi @rainbow-me/rainbowkit @tanstack/react-query`;
}, [
dentityPluginEnabled,
efpPluginEnabled,
Expand Down
14 changes: 13 additions & 1 deletion apps/console/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
"resolveJsonModule": true,
"isolatedModules": true,
"incremental": true,
"target": "ESNext",
"downlevelIteration": true,
"skipLibCheck": true,
"composite": false,
"module": "ESNext",
"moduleResolution": "Bundler",
"plugins": [
{
"name": "next"
Expand Down Expand Up @@ -41,5 +47,11 @@
".next/types/**/*.ts",
"../../dist/dist/apps/console/types/**/*.ts"
],
"exclude": ["node_modules", "jest.config.ts", "**/*.spec.ts", "**/*.test.ts"]
"exclude": [
"node_modules",
"**/node_modules/**",
"jest.config.ts",
"**/*.spec.ts",
"**/*.test.ts"
]
}
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
"cropperjs": "1.6.2",
"dotenv": "16.4.5",
"embla-carousel-react": "8.3.0",
"ethers": "6.11.1",
"express": "4.18.1",
"express-session": "1.18.0",
"input-otp": "1.2.4",
Expand All @@ -83,7 +82,7 @@
"tailwindcss-animate": "1.0.7",
"tslib": "2.3.0",
"vaul": "1.1.1",
"viem": "^2.35.0",
"viem": "^2.48.0",
"vite-plugin-dts": "3.7.3",
"wagmi": "2.14.16"
},
Expand Down
3 changes: 1 addition & 2 deletions packages/@justaname.id/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
},
"peerDependencies": {
"@tanstack/react-query": "^5.x",
"ethers": "^5.6.8 || ^6.0.8",
"react": ">=17",
"viem": "2.x",
"viem": "^2.48.0",
"wagmi": "2.x"
},
"devDependencies": {
Expand Down
51 changes: 0 additions & 51 deletions packages/@justaname.id/react/src/lib/helpers/ethersCompat.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { resolveDefaultChain } from './resolveDefaultChain';

describe('resolveDefaultChain', () => {
it('returns undefined when chainId is undefined (no wallet connected)', () => {
// Regression: previously `!chainId === undefined` was always false, causing
// an undefined chainId to silently fall through to mainnet — which then
// locked the SDK into mainnet config when the user intended Sepolia.
expect(resolveDefaultChain(undefined)).toBeUndefined();
});

it('passes through mainnet (1)', () => {
expect(resolveDefaultChain(1)).toBe(1);
});

it('passes through Sepolia (11155111)', () => {
expect(resolveDefaultChain(11155111)).toBe(11155111);
});

it('falls back to mainnet for unsupported chains', () => {
expect(resolveDefaultChain(137)).toBe(1);
expect(resolveDefaultChain(10)).toBe(1);
expect(resolveDefaultChain(42161)).toBe(1);
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { ChainId } from '@justaname.id/sdk';

/**
* Resolves the wagmi-provided chainId to a supported JustaName ChainId.
*
* - Returns `undefined` when no chain is available (wallet not connected yet);
* callers should defer SDK initialization until a chain resolves.
* - Returns `1` (mainnet) for any chainId that is not one of the two
* officially supported networks (1, 11155111).
* - Otherwise passes the chainId through unchanged.
*/
export const resolveDefaultChain = (
chainId: number | undefined
): ChainId | undefined => {
if (chainId === undefined) return undefined;
if (chainId !== 1 && chainId !== 11155111) return 1;
return chainId;
};
1 change: 0 additions & 1 deletion packages/@justaname.id/react/src/lib/hooks/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export * from './account';
export * from './ens';
export * from './mApp';
export * from './uploadMedia';
export * from './records';
export * from './resolver';
Expand Down
5 changes: 0 additions & 5 deletions packages/@justaname.id/react/src/lib/hooks/mApp/index.ts

This file was deleted.

This file was deleted.

This file was deleted.

70 changes: 0 additions & 70 deletions packages/@justaname.id/react/src/lib/hooks/mApp/useEnabledMApps.ts

This file was deleted.

Loading
Loading