2021-02-04 19:15:23 +01:00
|
|
|
import contractMap from '@metamask/contract-metadata';
|
2020-11-17 18:39:21 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* A normalized list of addresses exported as part of the contractMap in
|
2022-01-07 16:57:33 +01:00
|
|
|
* `@metamask/contract-metadata`. Used primarily to validate if manually entered
|
2020-11-17 18:39:21 +01:00
|
|
|
* contract addresses do not match one of our listed tokens
|
|
|
|
*/
|
|
|
|
export const LISTED_CONTRACT_ADDRESSES = Object.keys(
|
|
|
|
contractMap,
|
2021-02-04 19:15:23 +01:00
|
|
|
).map((address) => address.toLowerCase());
|
2022-07-01 15:58:35 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @typedef {Object} TokenDetails
|
|
|
|
* @property {string} address - The address of the selected 'TOKEN' or
|
|
|
|
* 'COLLECTIBLE' contract.
|
|
|
|
* @property {string} [symbol] - The symbol of the token.
|
|
|
|
* @property {number} [decimals] - The number of decimals of the selected
|
|
|
|
* 'ERC20' asset.
|
|
|
|
* @property {number} [tokenId] - The id of the selected 'COLLECTIBLE' asset.
|
|
|
|
* @property {TokenStandardStrings} [standard] - The standard of the selected
|
|
|
|
* asset.
|
|
|
|
* @property {boolean} [isERC721] - True when the asset is a ERC721 token.
|
|
|
|
*/
|