Version 3.0.0
Breaking Changes
Hardhat config functions have been renamed
// Hardhat related functions now live inside the `hardhatConfig` object
- import { hardhatConfigNetworks, hardhatEtherscan } from '@api3/chains';
+ import { hardhatConfig } from '@api3/chains';
// Networks
- hardhatConfigNetworks();
+ hardhatConfig.networks();
// Etherscan
- hardhatEtherscan();
+ hardhatConfig.etherscan();
The result of this is that you should now be able to import and use these values without any additional configuration.
// hardhat.config.js
const api3Chains = require('@api3/chains');
const etherscan = api3Chains.hardhatConfig.etherscan();
const networks = api3Chains.hardhatConfig.networks();
module. exports = {
...,
networks,
etherscan,
};
getEnvVariables renamed and moved to hardhatConfig
- import { getEnvVariables } from '@api3/chains';
+ import { hardhatConfig } from '@api3/chains';
// Usage
- getEnvVariables();
+ hardhatConfig.getEnvVariableNames();
Environment variable names updated
Environment variables now use a chain alias that has been converted to upper snake case
// before
getEnvVariables();
// ['MNEMONIC', 'ETHERSCAN_API_KEY_arbitrum-goerli-testnet', ...]
// after
hardhatConfig.getEnvVariableNames();
// ['MNEMONIC', 'ETHERSCAN_API_KEY_ARBITRUM_GOERLI_TESTNET', ...]
Removed
getChainByAlias
has been removed. UseCHAINS.find((chain) => chain.alias === alias)
in your code instead- Removed the
yarn env:write
script. CallhardhatConfig.getEnvVariableNames();
and implement the code to write to a file instead.
Non-breaking Changes
Etherscan API key values
When calling hardhatConfig.etherscan()
, apiKey
values will attempt to be sourced from process.env
where the keys matches the values output from hardhatConfig.getEnvVariableNames();
. If no environment variable is found, it will output the apiKey
values as NOT_FOUND
.
testnet
boolean added to each chain
Each chain now has a new boolean field called testnet
to indicate whether or not it is a testnet chain.
Updated Chains
boba-moonbeam
has been removed.