All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Add
megaeth-mainnettoBUILT_IN_NETWORKS(#7994)
- Upgrade
@metamask/utilsfrom^11.8.1to^11.9.0(#7511) - Update MegaETH Testnet "v2" RPC constants (#7566)
- Change RPC endpoint from
https://timothy.megaeth.com/rpctohttps://carrot.megaeth.com/rpc
- Change RPC endpoint from
- Add MegaETH Testnet "v2" to various constants, enums, and types (#7272)
- Add
megaeth-testnet-v2toBUILT_IN_NETWORKS - Add
megaeth-testnet-v2toBUILT_IN_CUSTOM_NETWORKS_RPC - Add
MegaETHTestnetV2toBuiltInNetworkNameenum - Add
megaeth-testnet-v2toChainIdtype - Add
MegaETHTestnetV2toNetworksTickerenum - Add
MegaETHTestnetV2toBlockExplorerUrlquasi-enum - Add
MegaETHTestnetV2toNetworkNicknamequasi-enum
- Add
- Deprecate references to MegaETH Testnet "v1" in favor of "v2" (#7272)
- Deprecate
BUILT_IN_CUSTOM_NETWORKS_RPC["megaeth-testnet"] - Deprecate
CustomNetworkType["megaeth-testnet"] - Deprecate
BuiltInNetworkName["megaeth-testnet"] - Deprecate
ChainId["megaeth-testnet"] - Deprecate
NetworksTicker["megaeth-testnet"] - Deprecate
BlockExplorerUrl["megaeth-testnet"] - Deprecate
NetworkNickname["megaeth-testnet"]
- Deprecate
- Add
getCircuitStatemethod toServicePolicy(#7164)- This can be used when working with a chain of services to know whether a service's underlying circuit is open or closed.
- Add
onAvailablemethod toServicePolicy(#7164)- This can be used to listen for the initial successful execution of the service, or the first successful execution after the service becomes degraded or the circuit breaks.
- Add
resetmethod toServicePolicy(#7164)- This can be used when working with a chain of services to reset the state of the circuit breaker policy (e.g. if a primary recovers and we want to reset the failovers).
- Export
CockatielEventEmitterandCockatielFailureReasonfrom Cockatiel (#7164)- These can be used to further transform types for event emitters/listeners.
- Arbitrum, BSC, Optimism, Polygon, and Sei networks to Infura networks (#6972)
- Add
arbitrum-one,bsc-mainnet,optimism-mainnet,polygon-mainnet,sei-mainnettoBUILT_IN_NETWORKS - Add
arbitrum-one,bsc-mainnet,optimism-mainnet,polygon-mainnet,sei-mainnettoInfuraNetworkType - Add
ArbitrumOne,BscMainnet,OptimismMainnet,PolygonMainnet,SeiMainnettoBuiltInNetworkNameenum - Add corresponding chain IDs to
ChainIdtype (0xa4b1, 0x38, 0xa, 0x89, 0x531) - Add
ETG,BNB,ETH,POL,SEItickers toNetworksTickerenum - Add block explorer URLs to
BlockExplorerUrlquasi-enum - Add network nicknames to
NetworkNicknamequasi-enum
- Add
- Bump
@metamask/utilsfrom^11.8.0to^11.8.1(#6708)
- Export
NETWORKS_BYPASSING_VALIDATIONconstant globally . (#6627)
- Add constant
NETWORKS_BYPASSING_VALIDATIONto allow clients to ignore warning messages for specific networks. (#6557) - Add
circuitBreakDurationto the object returned bycreateServicePolicy(#6423)- This is the amount of time that the underlying circuit breaker policy will pause execution of the input function while the circuit is broken.
- Add
getRemainingCircuitOpenDurationto the object returned bycreateServicePolicy(#6423)- This returns the amount of time after which the underlying circuit breaker policy will resume execution of the input function after the circuit reopens.
- Bump
@metamask/utilsfrom^11.4.2to^11.8.0(#6588)
- Update
onDegradedproperty inServicePolicyso that the event listener payload may be an object with either anerrororvalueproperty, which can be used to access the error produced by the last request when the maximum number of retries is exceeded (#6188)- The payload will be empty (i.e. the object will be
undefined) if the degraded event merely represents a slow request. ServicePolicyis the type returned bycreateServicePolicy.- NOTE: Although
errorandvalueare new, optional properties, this change makes an inadvertent breaking change to the signature of the event listener due to how TypeScript compares function types. We have conciously decided not to re-release this change under a major version, so be advised.
- The payload will be empty (i.e. the object will be
- Add convenience variables for calculating the number of milliseconds in a higher unit of time
SECOND/SECONDSMINUTE/MINUTESHOUR/HOURSDAY/DAYS
- Bump
@metamask/utilsfrom^11.2.0to^11.4.2(#6054) - Improve performance of
isValidHexAddressandtoChecksumHexAddress(#6054)- Replace
ethereumjs-utillib with faster@metamask/utilsfunctions - Memoize
isValidHexAddressandtoChecksumHexAddressfunctions
- Replace
- Update
createServicePolicyto reduce circuit break duration from 30 minutes to 2 minutes (#6015)- When hitting an API, this reduces the default duration for which requests to the API are paused when perceived to be unavailable
- Add
TransactionBatchin approval types enum (#5793) - Add Base network to default networks (#5902)
- Add
base-mainnettoBUILT_IN_NETWORKS - Add
base-mainnettoInfuraNetworkType - Add
BaseMainnettoBuiltInNetworkNameenum - Add
base-mainnettoChainIdtype - Add
BaseMainnettoNetworksTickerenum - Add
BaseMainnettoBlockExplorerUrlquasi-enum - Add
BaseMainnettoNetworkNicknamequasi-enum
- Add
- Add
HttpErrorclass for errors representing non-200 HTTP responses (#5809)
- Improved circuit breaker behavior to no longer consider HTTP 4XX responses as service failures (#5798, #5809)
- Changed from using
handleAlltohandleWhen(isServiceFailure)in circuit breaker policy - This ensures that expected error responses (like 405 Method Not Allowed and 429 Rate Limited) don't trigger the circuit breaker
- Changed from using
- Add Monad Testnet to various constants, enums, and types (#5724)
- Add
monad-testnettoBUILT_IN_NETWORKS - Add
monad-testnetandmegaeth-testnettoBUILT_IN_CUSTOM_NETWORKS_RPC - Add
MonadTestnettoBuiltInNetworkNameenum - Add
monad-testnettoChainIdtype - Add
MonadTestnettoNetworksTickerenum - Add
MonadTestnettoBlockExplorerUrlquasi-enum - Add
MonadTestnettoNetworkNicknamequasi-enum
- Add
- Re-export
ConstantBackoffandExponentialBackofffromcockatiel(#5492)- These can be used to customize service policies
- Add optional
backoffoption tocreateServicePolicy(#5492)- This is mainly useful in tests to force the backoff strategy to be constant rather than exponential
- Add
BUILT_IN_CUSTOM_NETWORKS_RPC, which includes MegaETH (#5495) - Add
CustomNetworkTypequasi-enum and type, which includes MegaETH (#5495) - Add
BuiltInNetworkTypetype union, which encompasses all Infura and custom network types (#5495)
- Add MegaETH Testnet to various constants, enums, and types (#5495)
- Add
MEGAETH_TESTNETtoTESTNET_TICKER_SYMBOLS - Add
megaeth-testnettoBUILT_IN_NETWORKS - Add
MegaETHTestnettoBuiltInNetworkNameenum - Add
megaeth-testnettoChainIdtype - Add
MegaETHTestnettoNetworksTickerenum - Add
MegaETHTestnettoBlockExplorerUrlquasi-enum - Add
MegaETHTestnettoNetworkNicknamequasi-enum
- Add
CHAIN_ID_TO_ETHERS_NETWORK_NAME_MAPis now typed asRecord<string, BuiltInNetworkName>rather thanRecord<ChainId, BuiltInNetworkName>(#5495)NetworkTypequasi-enum now includes all keys/values fromCustomNetworkType(#5495)
- Bump
@ethereumjs/utilfrom^8.1.0to^9.1.0(#5347) - Bump
@metamask/utilsfrom^11.1.0to^11.2.0(#5301)
- Add utility function
createServicePolicyfor reducing boilerplate for service classes (#5141, #5154, #5143, #5149, #5188, #5192, #5225)- Export constants
DEFAULT_CIRCUIT_BREAK_DURATION,DEFAULT_DEGRADED_THRESHOLD,DEFAULT_MAX_CONSECUTIVE_FAILURES, andDEFAULT_MAX_RETRIES - Export types
ServicePolicyandCreateServicePolicyOptions - Re-export
BrokenCircuitError,CircuitState,handleAll, andhandleWhenfromcockatiel - Export
CockatielEventtype, an alias of theEventtype fromcockatiel
- Export constants
- Bump
@metamask/utilsfrom^11.0.1to^11.1.0(#5223)
- Bump
@metamask/utilsfrom^10.0.0to^11.0.1(#5080)
- Make implicit peer dependencies explicit (#4974)
- Add the following packages as peer dependencies of this package to satisfy peer dependency requirements from other dependencies:
@babel/runtime@^7.0.0(required by@metamask/ethjs-unit)
- These dependencies really should be present in projects that consume this package (e.g. MetaMask clients), and this change ensures that they now are.
- Furthermore, we are assuming that clients already use these dependencies, since otherwise it would be impossible to consume this package in its entirety or even create a working build. Hence, the addition of these peer dependencies is really a formality and should not be breaking.
- Add the following packages as peer dependencies of this package to satisfy peer dependency requirements from other dependencies:
- Correct ESM-compatible build so that imports of the following packages that re-export other modules via
export *are no longer corrupted: (#5011)bn.jseth-ens-namehashfast-deep-equal
- The
NetworkNicknamefor mainnet is nowEthereum Mainnetinstead ofMainnet. And the display name for Linea is nowLineainstead ofLinea Mainnet. (#4865)
- Move BigNumber.js from devDependencies to dependencies (#4873)
- Bump
@metamask/utilsfrom^9.1.0to^10.0.0(#4831)
- Add
isEqualCaseInsensitivefunction for case-insensitive string comparison (#4811)
- Add types
TraceContext,TraceRequest,TraceCallback(#4655)- Migrated from
@metamask/transaction-controller@36.2.0.
- Migrated from
- Produce and export ESM-compatible TypeScript type declaration files in addition to CommonJS-compatible declaration files (#4648)
- Previously, this package shipped with only one variant of type declaration
files, and these files were only CommonJS-compatible, and the
exportsfield inpackage.jsonlinked to these files. This is an anti-pattern and was rightfully flagged by the "Are the Types Wrong?" tool as "masquerading as CJS". All of the ATTW checks now pass.
- Previously, this package shipped with only one variant of type declaration
files, and these files were only CommonJS-compatible, and the
- Remove chunk files (#4648).
- Previously, the build tool we used to generate JavaScript files extracted common code to "chunk" files. While this was intended to make this package more tree-shakeable, it also made debugging more difficult for our development teams. These chunk files are no longer present.
- Add
BlockExplorerUrlobject and type for looking up the block explorer URL of any Infura network (#4268) - Add
NetworkNicknameobject and type for looking up the common nickname for any Infura network (#4268) - Add
Partializetype for making select keys in an object type optional (#4268) toHexnow supports converting abigintinto a hex string (#4268)
- Add default snap dialog to ApprovalType (#4630)
- Bump TypeScript version to
~5.0.4and setmoduleResolutionoption toNode16(#3645) - Bump
@metamask/utilsfrom^9.0.0to^9.1.0(#4529)
- Bump
@metamask/rpc-errorsfrom6.2.1to^6.3.1(#4516) - Bump
@metamask/utilsfrom^8.3.0to^9.0.0(#4516)
- Add
NFT_API_VERSIONandNFT_API_TIMEOUTconstants (#4312)
- BREAKING: Bump minimum Node version to 18.18 (#3611)
- BREAKING: Remove
EthSignfromApprovalType(#4319)- This represented an
eth_signapproval, but support for that RPC method is being removed, so this is no longer needed.
- This represented an
- BREAKING: Changed price and token API endpoints from
*.metafi.codefi.networkto*.api.cx.metamask.io(#4301)
- Export new constant for the NFT API's url (#4030)
- Add support for wider range of SIWE messages (#4141)
- Bump TypeScript version to ~4.9.5 (#4084)
- Add guards against prototype-polluting assignments (#4041)
- Allow
toChecksumHexAddressto take and handle non-string inputs again, which was removed in 8.0.4 (#4046)
- Fix
typesfield inpackage.json(#4047)
- BREAKING: Add ESM build (#3998)
- It's no longer possible to import files from
./distdirectly.
- It's no longer possible to import files from
- Add support for Linea Sepolia to various constants, types, and type guards (#3995)
- Add
LINEA_SEPOLIAtoTESTNET_TICKER_SYMBOLSconstant - Add
0xe705toCHAIN_ID_TO_ETHERS_NETWORK_NAME_MAPconstant - Add
linea-sepoliatoBUILT_IN_NETWORKSconstant andInfuraNetworkType,NetworkType,ChainId, andNetworksTickertypes - Add
LineaSepoliatoBuiltInNetworkNameenum isNetworkTypeandisInfuraNetworkTypenow returntruewhen given "linea-sepolia"
- Add
- Update
normalizeEnsNameso that it does not attempt to normalize"."(#4006) - Move
bn.jsfromdevDependenciestodependencies(#4023)
- BREAKING: Narrow argument type for
BNToHexandfractionBNfromanytoBNto enhance type safety (#3975) - BREAKING: Narrow argument type for
logOrRethrowErrorfromanytounknownto enhance type safety (#3975) - BREAKING: Narrow argument type for
isNetworkTypefromanytostringto enhance type safety (#3975)
- Replace
ethereumjs-utilwith@ethereumjs/util(#3943)
- Bump
@metamask/ethjs-unitto^0.3.0(#3897)
- Bump
@metamask/utilsto^8.3.0(#3769)
- There are no consumer-facing changes to this package. This version is a part of a synchronized release across all packages in our monorepo.
- BREAKING:
OPENSEA_PROXY_URLnow points to OpenSea's v2 API.OPENSEA_API_URL+OPENSEA_TEST_API_URLhave been removed (#3654)
- BREAKING: Make
safelyExecutegeneric so they preserve types (#3629) - Update
successfulFetchso that a URL instance can now be passed to it (#3600) - Update
handleFetchso that a URL instance can now be passed to it (#3600)
- Add
isInfuraNetworkTypetype guard forInfuraNetworkType(#2055)
- Restore missing dependency
eth-query(#3578)- This was mistakenly recategorized as a devDependency in v6.0.0
- BREAKING: Bump
@metamask/eth-queryto ^4.0.0 (#2028)- This affects
query: thesendAsyncmethod on the given EthQuery must now have a narrower type
- This affects
- Bump
@metamask/utilsfrom ^8.1.0 to ^8.2.0 (#1957) - Change
BUILT_IN_NETWORKSso thatrpcentry now has a dummyticker(#1794) - Replace
ethjs-unit^0.1.6 with@metamask/ethjs-unit^0.2.1 (#2064)
- Move
@metamask/eth-queryfrom a development dependency to a runtime dependency (#1815)
- Bump dependency on
@metamask/utilsto ^8.1.0 (#1639) - Move
eth-rpc-errors@^4.0.2dependency to@metamask/rpc-errors@^6.0.2(#1743)
- Update linea goerli explorer url (#1666)
- Update TypeScript to v4.8.x (#1718)
- BREAKING: Rename
NETWORK_ID_TO_ETHERS_NETWORK_NAME_MAPtoCHAIN_ID_TO_ETHERS_NETWORK_NAME_MAP(#1633)- Change it to a map of
Hexchain ID toBuiltInNetworkName
- Change it to a map of
- BREAKING: Remove
NetworkIdconstant and type (#1633)
- There are no consumer-facing changes to this package. This version is a part of a synchronized release across all packages in our monorepo.
- Replace
eth-query^2.1.2 with@metamask/eth-query^3.0.1 (#1546)
- Add support for Linea networks (#1423)
- Add
LINEA_GOERLItoTESTNET_TICKER_SYMBOLSmap - Add
linea-goerliandlinea-mainnettoBUILT_IN_NETWORKSmap, as well asNetworkType,InfuraNetworkType,ChainId, andNetworkIdenums - Add
LineaGoerliandLineaMainnettoBuiltInNetworkNameenum
- Add
- Add approval types for result pages (#1442)
- Add dependencies
eth-queryandbabel-runtime(#1447)
- Fix bug where query function failed to call built-in EthQuery methods (#1447)
- Add constants
BuiltInNetworkandChainId(#1354) - Add Aurora network to the
ChainIdconstant (#1327) - Add
InfuraNetworkTypeenum (#1264)
- BREAKING: Bump to Node 16 (#1262)
- BREAKING: The
isSafeChainIdchain ID parameter is now typeHexrather thannumber(#1367) - BREAKING: The
ChainIdenum and theGANACHE_CHAIN_IDconstant are now formatted as 0x-prefixed hex strings rather than as decimal strings. (#1367) - The
queryfunction has improved type checks for theethQueryargument (#1266)- This type change could be breaking, but only if you were passing in an invalid
ethQueryparameter. In that circumstance this would have thrown an error at runtime anyway. Effectively this should be non-breaking for any usage that isn't already broken.
- This type change could be breaking, but only if you were passing in an invalid
- Bump @metamask/utils from 5.0.1 to 5.0.2 (#1271)
- BREAKING: Remove
Jsontype (#1370) - BREAKING: Remove
NetworksChainIdconstant (#1354)- Use the new
ChainIdconstant or the pre-existingNetworkIdconstant instead
- Use the new
- BREAKING: Remove localhost network (#1313)
- Remove the entry for localhost from
BUILT_IN_NETWORKS,NetworkType,ChainId, andNetworksTicker
- Remove the entry for localhost from
- BREAKING: Remove
hasPropertyfunction (#1275)- Use the
hasPropertyfunction from@metamask/utilsinstead
- Use the
- BREAKING: Remove constants
MAINNETandTESTNET_TICKER_SYMBOLS(#1132)- These were actually removed in v3.1.0, but are listed here again because that release (and the minor releases following it) have been deprecated due to the breaking change
- We didn't discover this until many releases later, which is why this happened in a minor release
3.4.0 [DEPRECATED]
- add WalletConnect in approval type (#1240)
3.3.0 [DEPRECATED]
- Add Sign-in-with-Ethereum origin validation (#1163)
- Add
NetworkIdenum andNETWORK_ID_TO_ETHERS_NETWORK_NAME_MAPconstant that includes entries for each built-in Infura network (#1170)
3.2.0 [DEPRECATED]
- Improve return type of
toHex(#1195)
3.1.0 [DEPRECATED]
- Add SIWE detection support for PersonalMessageManager (#1139)
- Add
NetworkType(#1132) - Add
isSafeChainId(#1064)
- BREAKING: Remove constants
MAINNETandTESTNET_TICKER_SYMBOLS(#1132)- We didn't discover this until many releases later, which is why this happened in a minor release
- BREAKING: Remove
isomorphic-fetch(#1106)- Consumers must now import
isomorphic-fetchor another polyfill themselves if they are running in an environment withoutfetch
- Consumers must now import
- Add Sepolia-related constants (#1041)
- Update
getBuyURLfunction to return Sepolia faucet for Sepolia network (#1041)
- BREAKING:: Migrate from
metaswaptometafisubdomain for OpenSea proxy (#1060) - Rename this repository to
core(#1031)
- BREAKING: Remove all constants associated with Ropsten, Rinkeby, and Kovan (#1041)
- BREAKING: Remove support for Ropsten, Rinkeby, and Kovan from
getBuyUrlfunction (#1041)
-
Initial release
-
As a result of converting our shared controllers repo into a monorepo (#831), we've created this package from select parts of
@metamask/controllersv33.0.0, namely:src/constants.ts(but see below)src/util.ts(but see below)src/util.test.ts(but see below)NetworkTypeandNetworkChainsIdfromsrc/network/NetworkController.ts(viatypes.ts)
-
ESTIMATE_GAS_ERROR, which used to be exported bysrc/constants.ts, is now available via the@metamask/gas-fee-controllerpackage. -
A number of functions and types that were previously exported by
src/util.tsare now available via other packages. Here's a breakdown of these exports and their new locations:@metamask/assets-controllers:SupportedTokenDetectionNetworksaddUrlProtocolPrefixgetFormattedIpfsUrlgetIpfsCIDv1AndPathisTokenDetectionSupportedForNetworkisTokenListSupportedForNetworkremoveIpfsProtocolPrefixvalidateTokenToWatch
@metamask/message-manager:normalizeMessageDatavalidateSignMessageDatavalidateTypedSignMessageDataV1validateTypedSignMessageDataV3
@metamask/transaction-controller:getEtherscanApiUrlgetIncreasedPriceFromExistinggetIncreasedPriceHexhandleTransactionFetchisEIP1559TransactionisFeeMarketEIP1559ValuesisGasPriceValuenormalizeTransactionvalidateGasValuesvalidateMinimumIncreasevalidateTransaction
All changes listed after this point were applied to this package following the monorepo conversion.
-