@metamask/controller-utils
Advanced tools
Comparing version 9.0.1 to 9.0.2
@@ -10,2 +10,8 @@ # Changelog | ||
## [9.0.2] | ||
### Fixed | ||
- Allow `toChecksumHexAddress` to take and handle non-string inputs again, which was removed in 8.0.4 ([#4046](https://github.com/MetaMask/core/pull/4046)) | ||
## [9.0.1] | ||
@@ -310,3 +316,4 @@ | ||
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/controller-utils@9.0.1...HEAD | ||
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/controller-utils@9.0.2...HEAD | ||
[9.0.2]: https://github.com/MetaMask/core/compare/@metamask/controller-utils@9.0.1...@metamask/controller-utils@9.0.2 | ||
[9.0.1]: https://github.com/MetaMask/core/compare/@metamask/controller-utils@9.0.0...@metamask/controller-utils@9.0.1 | ||
@@ -313,0 +320,0 @@ [9.0.0]: https://github.com/MetaMask/core/compare/@metamask/controller-utils@8.0.4...@metamask/controller-utils@9.0.0 |
@@ -33,3 +33,3 @@ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); | ||
var _chunkRMQ2AQG4js = require('./chunk-RMQ2AQG4.js'); | ||
var _chunkCQEHTNYTjs = require('./chunk-CQEHTNYT.js'); | ||
@@ -126,3 +126,3 @@ | ||
exports.ASSET_TYPES = _chunkAEMFFAHNjs.ASSET_TYPES; exports.ApprovalType = _chunkAEMFFAHNjs.ApprovalType; exports.BNToHex = _chunkRMQ2AQG4js.BNToHex; exports.BUILT_IN_NETWORKS = _chunkAEMFFAHNjs.BUILT_IN_NETWORKS; exports.BuiltInNetworkName = _chunkLGGBBU6Gjs.BuiltInNetworkName; exports.CHAIN_ID_TO_ETHERS_NETWORK_NAME_MAP = _chunkAEMFFAHNjs.CHAIN_ID_TO_ETHERS_NETWORK_NAME_MAP; exports.ChainId = _chunkLGGBBU6Gjs.ChainId; exports.ERC1155 = _chunkAEMFFAHNjs.ERC1155; exports.ERC1155_INTERFACE_ID = _chunkAEMFFAHNjs.ERC1155_INTERFACE_ID; exports.ERC1155_METADATA_URI_INTERFACE_ID = _chunkAEMFFAHNjs.ERC1155_METADATA_URI_INTERFACE_ID; exports.ERC1155_TOKEN_RECEIVER_INTERFACE_ID = _chunkAEMFFAHNjs.ERC1155_TOKEN_RECEIVER_INTERFACE_ID; exports.ERC20 = _chunkAEMFFAHNjs.ERC20; exports.ERC721 = _chunkAEMFFAHNjs.ERC721; exports.ERC721_ENUMERABLE_INTERFACE_ID = _chunkAEMFFAHNjs.ERC721_ENUMERABLE_INTERFACE_ID; exports.ERC721_INTERFACE_ID = _chunkAEMFFAHNjs.ERC721_INTERFACE_ID; exports.ERC721_METADATA_INTERFACE_ID = _chunkAEMFFAHNjs.ERC721_METADATA_INTERFACE_ID; exports.FALL_BACK_VS_CURRENCY = _chunkAEMFFAHNjs.FALL_BACK_VS_CURRENCY; exports.GANACHE_CHAIN_ID = _chunkAEMFFAHNjs.GANACHE_CHAIN_ID; exports.GWEI = _chunkAEMFFAHNjs.GWEI; exports.IPFS_DEFAULT_GATEWAY_URL = _chunkAEMFFAHNjs.IPFS_DEFAULT_GATEWAY_URL; exports.InfuraNetworkType = _chunkLGGBBU6Gjs.InfuraNetworkType; exports.MAX_SAFE_CHAIN_ID = _chunkAEMFFAHNjs.MAX_SAFE_CHAIN_ID; exports.NetworkType = _chunkLGGBBU6Gjs.NetworkType; exports.NetworksTicker = _chunkLGGBBU6Gjs.NetworksTicker; exports.OPENSEA_PROXY_URL = _chunkAEMFFAHNjs.OPENSEA_PROXY_URL; exports.ORIGIN_METAMASK = _chunkAEMFFAHNjs.ORIGIN_METAMASK; exports.RPC = _chunkAEMFFAHNjs.RPC; exports.TESTNET_TICKER_SYMBOLS = _chunkAEMFFAHNjs.TESTNET_TICKER_SYMBOLS; exports.convertHexToDecimal = _chunkRMQ2AQG4js.convertHexToDecimal; exports.detectSIWE = _chunkM6G3ISXGjs.detectSIWE; exports.fetchWithErrorHandling = _chunkRMQ2AQG4js.fetchWithErrorHandling; exports.fractionBN = _chunkRMQ2AQG4js.fractionBN; exports.fromHex = _chunkRMQ2AQG4js.fromHex; exports.getBuyURL = _chunkRMQ2AQG4js.getBuyURL; exports.gweiDecToWEIBN = _chunkRMQ2AQG4js.gweiDecToWEIBN; exports.handleFetch = _chunkRMQ2AQG4js.handleFetch; exports.hexToBN = _chunkRMQ2AQG4js.hexToBN; exports.hexToText = _chunkRMQ2AQG4js.hexToText; exports.isInfuraNetworkType = _chunkLGGBBU6Gjs.isInfuraNetworkType; exports.isNetworkType = _chunkLGGBBU6Gjs.isNetworkType; exports.isNonEmptyArray = _chunkRMQ2AQG4js.isNonEmptyArray; exports.isPlainObject = _chunkRMQ2AQG4js.isPlainObject; exports.isSafeChainId = _chunkRMQ2AQG4js.isSafeChainId; exports.isSmartContractCode = _chunkRMQ2AQG4js.isSmartContractCode; exports.isValidHexAddress = _chunkRMQ2AQG4js.isValidHexAddress; exports.isValidJson = _chunkRMQ2AQG4js.isValidJson; exports.isValidSIWEOrigin = _chunkM6G3ISXGjs.isValidSIWEOrigin; exports.normalizeEnsName = _chunkRMQ2AQG4js.normalizeEnsName; exports.parseDomainParts = _chunkM6G3ISXGjs.parseDomainParts; exports.query = _chunkRMQ2AQG4js.query; exports.safelyExecute = _chunkRMQ2AQG4js.safelyExecute; exports.safelyExecuteWithTimeout = _chunkRMQ2AQG4js.safelyExecuteWithTimeout; exports.successfulFetch = _chunkRMQ2AQG4js.successfulFetch; exports.timeoutFetch = _chunkRMQ2AQG4js.timeoutFetch; exports.toChecksumHexAddress = _chunkRMQ2AQG4js.toChecksumHexAddress; exports.toHex = _chunkRMQ2AQG4js.toHex; exports.weiHexToGweiDec = _chunkRMQ2AQG4js.weiHexToGweiDec; | ||
exports.ASSET_TYPES = _chunkAEMFFAHNjs.ASSET_TYPES; exports.ApprovalType = _chunkAEMFFAHNjs.ApprovalType; exports.BNToHex = _chunkCQEHTNYTjs.BNToHex; exports.BUILT_IN_NETWORKS = _chunkAEMFFAHNjs.BUILT_IN_NETWORKS; exports.BuiltInNetworkName = _chunkLGGBBU6Gjs.BuiltInNetworkName; exports.CHAIN_ID_TO_ETHERS_NETWORK_NAME_MAP = _chunkAEMFFAHNjs.CHAIN_ID_TO_ETHERS_NETWORK_NAME_MAP; exports.ChainId = _chunkLGGBBU6Gjs.ChainId; exports.ERC1155 = _chunkAEMFFAHNjs.ERC1155; exports.ERC1155_INTERFACE_ID = _chunkAEMFFAHNjs.ERC1155_INTERFACE_ID; exports.ERC1155_METADATA_URI_INTERFACE_ID = _chunkAEMFFAHNjs.ERC1155_METADATA_URI_INTERFACE_ID; exports.ERC1155_TOKEN_RECEIVER_INTERFACE_ID = _chunkAEMFFAHNjs.ERC1155_TOKEN_RECEIVER_INTERFACE_ID; exports.ERC20 = _chunkAEMFFAHNjs.ERC20; exports.ERC721 = _chunkAEMFFAHNjs.ERC721; exports.ERC721_ENUMERABLE_INTERFACE_ID = _chunkAEMFFAHNjs.ERC721_ENUMERABLE_INTERFACE_ID; exports.ERC721_INTERFACE_ID = _chunkAEMFFAHNjs.ERC721_INTERFACE_ID; exports.ERC721_METADATA_INTERFACE_ID = _chunkAEMFFAHNjs.ERC721_METADATA_INTERFACE_ID; exports.FALL_BACK_VS_CURRENCY = _chunkAEMFFAHNjs.FALL_BACK_VS_CURRENCY; exports.GANACHE_CHAIN_ID = _chunkAEMFFAHNjs.GANACHE_CHAIN_ID; exports.GWEI = _chunkAEMFFAHNjs.GWEI; exports.IPFS_DEFAULT_GATEWAY_URL = _chunkAEMFFAHNjs.IPFS_DEFAULT_GATEWAY_URL; exports.InfuraNetworkType = _chunkLGGBBU6Gjs.InfuraNetworkType; exports.MAX_SAFE_CHAIN_ID = _chunkAEMFFAHNjs.MAX_SAFE_CHAIN_ID; exports.NetworkType = _chunkLGGBBU6Gjs.NetworkType; exports.NetworksTicker = _chunkLGGBBU6Gjs.NetworksTicker; exports.OPENSEA_PROXY_URL = _chunkAEMFFAHNjs.OPENSEA_PROXY_URL; exports.ORIGIN_METAMASK = _chunkAEMFFAHNjs.ORIGIN_METAMASK; exports.RPC = _chunkAEMFFAHNjs.RPC; exports.TESTNET_TICKER_SYMBOLS = _chunkAEMFFAHNjs.TESTNET_TICKER_SYMBOLS; exports.convertHexToDecimal = _chunkCQEHTNYTjs.convertHexToDecimal; exports.detectSIWE = _chunkM6G3ISXGjs.detectSIWE; exports.fetchWithErrorHandling = _chunkCQEHTNYTjs.fetchWithErrorHandling; exports.fractionBN = _chunkCQEHTNYTjs.fractionBN; exports.fromHex = _chunkCQEHTNYTjs.fromHex; exports.getBuyURL = _chunkCQEHTNYTjs.getBuyURL; exports.gweiDecToWEIBN = _chunkCQEHTNYTjs.gweiDecToWEIBN; exports.handleFetch = _chunkCQEHTNYTjs.handleFetch; exports.hexToBN = _chunkCQEHTNYTjs.hexToBN; exports.hexToText = _chunkCQEHTNYTjs.hexToText; exports.isInfuraNetworkType = _chunkLGGBBU6Gjs.isInfuraNetworkType; exports.isNetworkType = _chunkLGGBBU6Gjs.isNetworkType; exports.isNonEmptyArray = _chunkCQEHTNYTjs.isNonEmptyArray; exports.isPlainObject = _chunkCQEHTNYTjs.isPlainObject; exports.isSafeChainId = _chunkCQEHTNYTjs.isSafeChainId; exports.isSmartContractCode = _chunkCQEHTNYTjs.isSmartContractCode; exports.isValidHexAddress = _chunkCQEHTNYTjs.isValidHexAddress; exports.isValidJson = _chunkCQEHTNYTjs.isValidJson; exports.isValidSIWEOrigin = _chunkM6G3ISXGjs.isValidSIWEOrigin; exports.normalizeEnsName = _chunkCQEHTNYTjs.normalizeEnsName; exports.parseDomainParts = _chunkM6G3ISXGjs.parseDomainParts; exports.query = _chunkCQEHTNYTjs.query; exports.safelyExecute = _chunkCQEHTNYTjs.safelyExecute; exports.safelyExecuteWithTimeout = _chunkCQEHTNYTjs.safelyExecuteWithTimeout; exports.successfulFetch = _chunkCQEHTNYTjs.successfulFetch; exports.timeoutFetch = _chunkCQEHTNYTjs.timeoutFetch; exports.toChecksumHexAddress = _chunkCQEHTNYTjs.toChecksumHexAddress; exports.toHex = _chunkCQEHTNYTjs.toHex; exports.weiHexToGweiDec = _chunkCQEHTNYTjs.weiHexToGweiDec; | ||
//# sourceMappingURL=index.js.map |
@@ -101,9 +101,21 @@ import type EthQuery from '@metamask/eth-query'; | ||
/** | ||
* Convert an address to a checksummed hexidecimal address. | ||
* Convert an address to a checksummed hexadecimal address. | ||
* | ||
* @param address - The address to convert. | ||
* @returns A 0x-prefixed hexidecimal checksummed address, if address is valid. Otherwise original input 0x-prefixe, if address is valid. Otherwise original input 0x-prefixed. | ||
* @returns The address in 0x-prefixed hexadecimal checksummed form if it is valid. | ||
*/ | ||
export declare function toChecksumHexAddress(address: string): string; | ||
/** | ||
* Convert an address to a checksummed hexadecimal address. | ||
* | ||
* Note that this particular overload does nothing. | ||
* | ||
* @param address - A value that is not a string (e.g. `undefined` or `null`). | ||
* @returns The `address` untouched. | ||
* @deprecated This overload is designed to gracefully handle an invalid input | ||
* and is only present for backward compatibility. It may be removed in a future | ||
* major version. Please pass a string to `toChecksumHexAddress` instead. | ||
*/ | ||
export declare function toChecksumHexAddress<T>(address: T): T; | ||
/** | ||
* Validates that the input is a hex address. This utility method is a thin | ||
@@ -110,0 +122,0 @@ * wrapper around @metamask/utils.isValidHexAddress, with the exception that it |
@@ -27,3 +27,3 @@ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); | ||
var _chunkRMQ2AQG4js = require('./chunk-RMQ2AQG4.js'); | ||
var _chunkCQEHTNYTjs = require('./chunk-CQEHTNYT.js'); | ||
require('./chunk-AEMFFAHN.js'); | ||
@@ -57,3 +57,3 @@ require('./chunk-LGGBBU6G.js'); | ||
exports.BNToHex = _chunkRMQ2AQG4js.BNToHex; exports.convertHexToDecimal = _chunkRMQ2AQG4js.convertHexToDecimal; exports.fetchWithErrorHandling = _chunkRMQ2AQG4js.fetchWithErrorHandling; exports.fractionBN = _chunkRMQ2AQG4js.fractionBN; exports.fromHex = _chunkRMQ2AQG4js.fromHex; exports.getBuyURL = _chunkRMQ2AQG4js.getBuyURL; exports.gweiDecToWEIBN = _chunkRMQ2AQG4js.gweiDecToWEIBN; exports.handleFetch = _chunkRMQ2AQG4js.handleFetch; exports.hexToBN = _chunkRMQ2AQG4js.hexToBN; exports.hexToText = _chunkRMQ2AQG4js.hexToText; exports.isNonEmptyArray = _chunkRMQ2AQG4js.isNonEmptyArray; exports.isPlainObject = _chunkRMQ2AQG4js.isPlainObject; exports.isSafeChainId = _chunkRMQ2AQG4js.isSafeChainId; exports.isSmartContractCode = _chunkRMQ2AQG4js.isSmartContractCode; exports.isValidHexAddress = _chunkRMQ2AQG4js.isValidHexAddress; exports.isValidJson = _chunkRMQ2AQG4js.isValidJson; exports.normalizeEnsName = _chunkRMQ2AQG4js.normalizeEnsName; exports.query = _chunkRMQ2AQG4js.query; exports.safelyExecute = _chunkRMQ2AQG4js.safelyExecute; exports.safelyExecuteWithTimeout = _chunkRMQ2AQG4js.safelyExecuteWithTimeout; exports.successfulFetch = _chunkRMQ2AQG4js.successfulFetch; exports.timeoutFetch = _chunkRMQ2AQG4js.timeoutFetch; exports.toChecksumHexAddress = _chunkRMQ2AQG4js.toChecksumHexAddress; exports.toHex = _chunkRMQ2AQG4js.toHex; exports.weiHexToGweiDec = _chunkRMQ2AQG4js.weiHexToGweiDec; | ||
exports.BNToHex = _chunkCQEHTNYTjs.BNToHex; exports.convertHexToDecimal = _chunkCQEHTNYTjs.convertHexToDecimal; exports.fetchWithErrorHandling = _chunkCQEHTNYTjs.fetchWithErrorHandling; exports.fractionBN = _chunkCQEHTNYTjs.fractionBN; exports.fromHex = _chunkCQEHTNYTjs.fromHex; exports.getBuyURL = _chunkCQEHTNYTjs.getBuyURL; exports.gweiDecToWEIBN = _chunkCQEHTNYTjs.gweiDecToWEIBN; exports.handleFetch = _chunkCQEHTNYTjs.handleFetch; exports.hexToBN = _chunkCQEHTNYTjs.hexToBN; exports.hexToText = _chunkCQEHTNYTjs.hexToText; exports.isNonEmptyArray = _chunkCQEHTNYTjs.isNonEmptyArray; exports.isPlainObject = _chunkCQEHTNYTjs.isPlainObject; exports.isSafeChainId = _chunkCQEHTNYTjs.isSafeChainId; exports.isSmartContractCode = _chunkCQEHTNYTjs.isSmartContractCode; exports.isValidHexAddress = _chunkCQEHTNYTjs.isValidHexAddress; exports.isValidJson = _chunkCQEHTNYTjs.isValidJson; exports.normalizeEnsName = _chunkCQEHTNYTjs.normalizeEnsName; exports.query = _chunkCQEHTNYTjs.query; exports.safelyExecute = _chunkCQEHTNYTjs.safelyExecute; exports.safelyExecuteWithTimeout = _chunkCQEHTNYTjs.safelyExecuteWithTimeout; exports.successfulFetch = _chunkCQEHTNYTjs.successfulFetch; exports.timeoutFetch = _chunkCQEHTNYTjs.timeoutFetch; exports.toChecksumHexAddress = _chunkCQEHTNYTjs.toChecksumHexAddress; exports.toHex = _chunkCQEHTNYTjs.toHex; exports.weiHexToGweiDec = _chunkCQEHTNYTjs.weiHexToGweiDec; | ||
//# sourceMappingURL=util.js.map |
{ | ||
"name": "@metamask/controller-utils", | ||
"version": "9.0.1", | ||
"version": "9.0.2", | ||
"description": "Data and convenience functions shared by multiple packages", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
219535
1920