@ensdomains/hardhat-toolbox-viem-extended
v0.0.3
Published
Extended Hardhat toolbox for viem
Downloads
7
Keywords
Readme
@ensdomains/hardhat-toolbox-viem-extended
Extended Hardhat toolbox for viem
Setup
- Install
bun add @ensdomains/hardhat-toolbox-viem-extended hardhat @nomicfoundation/hardhat-viem hardhat-deploy
Apply type-extensions patch for
@nomicfoundation/hardhat-viem
Import into hardhat config
import "@ensdomains/hardhat-toolbox-viem-extended";
- (optional) Register your config
const config = {
/* Your config here */
} satisfies HardhatUserConfig;
declare module "@nomicfoundation/hardhat-viem/types.js" {
interface Register {
config: typeof config;
}
}
Registering your config currently enables:
- Typed
getNamedClients()
command
Functions
deploy
Main deploy function.
Parameters:
contractName
: Name of the contractargs
: Argument array for contract constructoroptions
: Options inherited from@nomicfoundation/hardhat-viem
Returns: DeployResult
getContractOrNull
Gets contract, or if none available returns null.
Parameters:
contractName
: Name of the contractclient
: (optional) Keyed client to use
Returns: GetContractReturnType | null
getContract
Gets contract, or if none available throws error.
Parameters:
contractName
: Name of the contractclient
: (optional) Keyed client to use
Returns: GetContractReturnType
waitForTransactionSuccess
Waits for a transaction receipt, and throws error if the transaction reverted.
Parameters:
hash
: Transaction hash
Returns: WaitForTransactionReceiptReturnType
getNamedClients
Gets named accounts as wallet clients, from values defined in config.
Returns: { [key: string]: Client }
getUnnamedClients
Gets all unnamed accounts as wallet clients.
Returns: Client[]