MetaMask / metamask-docs

Developer documentation for MetaMask
https://docs.metamask.io
Apache License 2.0
632 stars 905 forks source link

TypeScript Definitions: Define the `MMError` Type #1347

Closed subhamkumarr closed 3 weeks ago

subhamkumarr commented 3 weeks ago

Description:

In Wallet Create a React dapp with local state

Steps to Reproduce

Expected Behavior

The MMError type should be defined in a TypeScript definition file, providing clear structure and attributes that an MMError object should have.

Suggested Solution

Define the MMError type with appropriate properties. For example:

  code: number;
  message: string;
  [key: string]: any; 

This type definition should be placed in a relevant TypeScript definition file, such as types.ts, or in a global declaration file if applicable.

Additional Context

Including the MMError type definition will help improve code clarity and type safety, ensuring that all developers working on the project have a clear understanding of the structure and attributes of an MMError object.

subhamkumarr commented 3 weeks ago

@alexandratran, could you assign me this?

alexandratran commented 3 weeks ago

@subhamkumarr MMError is defined in the Vite environment variable file in step 2: https://docs.metamask.io/wallet/tutorials/react-dapp-local-state/#2-import-eip-6963-interfaces