diff --git a/.changeset/big-olives-ring.md b/.changeset/big-olives-ring.md new file mode 100644 index 0000000000..fb3db7ab1f --- /dev/null +++ b/.changeset/big-olives-ring.md @@ -0,0 +1,23 @@ +--- +'@reown/appkit-utils': patch +'@reown/appkit': patch +'@reown/appkit-adapter-bitcoin': patch +'@reown/appkit-adapter-ethers': patch +'@reown/appkit-adapter-ethers5': patch +'@reown/appkit-adapter-solana': patch +'@reown/appkit-adapter-wagmi': patch +'@reown/appkit-cdn': patch +'@reown/appkit-cli': patch +'@reown/appkit-common': patch +'@reown/appkit-core': patch +'@reown/appkit-experimental': patch +'@reown/appkit-polyfills': patch +'@reown/appkit-scaffold-ui': patch +'@reown/appkit-siwe': patch +'@reown/appkit-siwx': patch +'@reown/appkit-ui': patch +'@reown/appkit-wallet': patch +'@reown/appkit-wallet-button': patch +--- + +Added an error message for when the user provides an invalid project id. \ No newline at end of file diff --git a/packages/appkit-utils/src/ErrorUtil.ts b/packages/appkit-utils/src/ErrorUtil.ts index 00d9737897..198f0c5c94 100644 --- a/packages/appkit-utils/src/ErrorUtil.ts +++ b/packages/appkit-utils/src/ErrorUtil.ts @@ -7,6 +7,10 @@ export const ErrorUtil = { JWT_VALIDATION_ERROR: { message: 'JWT validation error: JWT Token is not yet valid', alertErrorKey: 'JWT_TOKEN_NOT_VALID' + }, + INVALID_KEY: { + message: 'Unauthorized: invalid key', + alertErrorKey: 'INVALID_PROJECT_ID' } }, ALERT_ERRORS: { @@ -32,6 +36,10 @@ export const ErrorUtil = { longMessage: 'Invalid session found on UniversalProvider - please check your time settings and connect again' }, + INVALID_PROJECT_ID: { + shortMessage: 'Invalid App Configuration', + longMessage: 'Invalid Project ID - update configuration' + }, PROJECT_ID_NOT_CONFIGURED: { shortMessage: 'Project ID Not Configured', longMessage: 'Project ID Not Configured - update configuration on cloud.reown.com' diff --git a/packages/appkit/tests/appkit.test.ts b/packages/appkit/tests/appkit.test.ts index 6586b7832a..e40a265a0f 100644 --- a/packages/appkit/tests/appkit.test.ts +++ b/packages/appkit/tests/appkit.test.ts @@ -1421,6 +1421,11 @@ describe('Base', () => { alert: ErrorUtil.ALERT_ERRORS.JWT_TOKEN_NOT_VALID, message: 'WebSocket connection closed abnormally with code: 3000 (JWT validation error: JWT Token is not yet valid:)' + }, + { + alert: ErrorUtil.ALERT_ERRORS.INVALID_PROJECT_ID, + message: + 'Uncaught Error: WebSocket connection closed abnormally with code: 3000 (Unauthorized: invalid key)' } ]