@nomicfoundation/hardhat-viem 3.0.1 → 3.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @nomicfoundation/hardhat-viem
|
|
2
2
|
|
|
3
|
+
## 3.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 6674b00: Bump `hardhat-utils` major
|
|
8
|
+
|
|
9
|
+
## 3.0.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 2bc18b2: Bumped `viem` version across all packages [7861](https://github.com/NomicFoundation/hardhat/pull/7861).
|
|
14
|
+
|
|
3
15
|
## 3.0.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# hardhat-viem
|
|
2
2
|
|
|
3
|
-
This plugin integrates [viem](https://viem.sh) into Hardhat, adding a `viem` object to each
|
|
3
|
+
This plugin integrates [viem](https://viem.sh) into Hardhat, adding a `viem` object to each Network Connection.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
-
> This plugin is part of the [Viem Hardhat Toolbox](https://hardhat.org/plugins/nomicfoundation-hardhat-toolbox-viem). If you
|
|
7
|
+
> This plugin is part of the [Viem Hardhat Toolbox](https://hardhat.org/plugins/nomicfoundation-hardhat-toolbox-viem). If you're using that toolbox, there's nothing else you need to do.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Install the plugin with this command:
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
12
|
npm install --save-dev @nomicfoundation/hardhat-viem
|
|
@@ -25,7 +25,7 @@ export default defineConfig({
|
|
|
25
25
|
|
|
26
26
|
## Usage
|
|
27
27
|
|
|
28
|
-
This plugin adds a `viem` property to each
|
|
28
|
+
This plugin adds a `viem` property to each Network Connection:
|
|
29
29
|
|
|
30
30
|
```ts
|
|
31
31
|
import { network } from "hardhat";
|
|
@@ -41,3 +41,144 @@ console.log(await counter.read.x());
|
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
To learn more about using viem with Hardhat, read [our guide](https://hardhat.org/docs/learn-more/using-viem).
|
|
44
|
+
|
|
45
|
+
### Clients
|
|
46
|
+
|
|
47
|
+
Viem provides a set of interfaces to interact with the blockchain called **clients**. There are three types:
|
|
48
|
+
|
|
49
|
+
- **Public clients** fetch node information from the public JSON-RPC API, like blocks or account balances.
|
|
50
|
+
- **Wallet clients** interact with Ethereum Accounts for tasks like transactions and message signing.
|
|
51
|
+
- **Test clients** perform actions that are only available in development nodes.
|
|
52
|
+
|
|
53
|
+
The `viem` object in the Network Connection has methods that make it easy to build clients attached to the current network.
|
|
54
|
+
|
|
55
|
+
#### Public clients
|
|
56
|
+
|
|
57
|
+
Get a public client using the `getPublicClient` method:
|
|
58
|
+
|
|
59
|
+
```ts
|
|
60
|
+
const publicClient = await viem.getPublicClient();
|
|
61
|
+
console.log(await publicClient.getBlockNumber());
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Learn more about public clients in the [viem documentation](https://viem.sh/docs/clients/public).
|
|
65
|
+
|
|
66
|
+
#### Wallet clients
|
|
67
|
+
|
|
68
|
+
There are two methods related to wallet clients:
|
|
69
|
+
|
|
70
|
+
- `getWalletClients`: returns an array of wallet clients for all the accounts configured for the network.
|
|
71
|
+
- `getWalletClient`: receives an address and returns a wallet client for that address.
|
|
72
|
+
|
|
73
|
+
```ts
|
|
74
|
+
const [walletClient] = await viem.getWalletClients();
|
|
75
|
+
await walletClient.sendTransaction(/* ... */);
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Learn more about wallet clients in the [viem documentation](https://viem.sh/docs/clients/wallet).
|
|
79
|
+
|
|
80
|
+
#### Test clients
|
|
81
|
+
|
|
82
|
+
Get a test client using the `getTestClient` method:
|
|
83
|
+
|
|
84
|
+
```ts
|
|
85
|
+
const testClient = await viem.getTestClient();
|
|
86
|
+
await testClient.mine({ blocks: 10 });
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Learn more about test clients in the [viem documentation](https://viem.sh/docs/clients/test).
|
|
90
|
+
|
|
91
|
+
#### Overriding client options
|
|
92
|
+
|
|
93
|
+
All the methods to get clients accept an optional parameter to override the default client options. For example, to create a public client with a different polling interval:
|
|
94
|
+
|
|
95
|
+
```ts
|
|
96
|
+
const publicClient = await viem.getPublicClient({
|
|
97
|
+
pollingInterval: 5000,
|
|
98
|
+
});
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
These options are the same as the ones used when creating clients with viem directly. Check the [viem documentation](https://viem.sh/docs/clients/intro) to learn more about the available options in each case.
|
|
102
|
+
|
|
103
|
+
### Contracts
|
|
104
|
+
|
|
105
|
+
Viem has support for [contract instances](https://viem.sh/docs/contract/getContract), type-safe interfaces for interacting with contracts. This plugin makes it easy to create instances for contracts in your project.
|
|
106
|
+
|
|
107
|
+
#### Deploying contracts
|
|
108
|
+
|
|
109
|
+
The `viem` object in the Network Connection has a `deployContract` method that deploys a contract by its name:
|
|
110
|
+
|
|
111
|
+
```ts
|
|
112
|
+
const counter = await viem.deployContract("Counter");
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
If your contract requires constructor arguments, pass them as the second parameter:
|
|
116
|
+
|
|
117
|
+
```ts
|
|
118
|
+
const myContract = await viem.deployContract("MyContract", ["Arg1", 123]);
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
The `deployContract` method waits until the deployment transaction is mined and returns the contract instance. If you want to get the deployment transaction, or if you want to have the contract instance without waiting for the deployment to be mined, use the `sendDeploymentTransaction` method:
|
|
122
|
+
|
|
123
|
+
```ts
|
|
124
|
+
const { contract: counter, deploymentTransaction } =
|
|
125
|
+
await viem.sendDeploymentTransaction("Counter");
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
#### Getting existing contracts
|
|
129
|
+
|
|
130
|
+
To get an instance of an already deployed contract, use the `getContractAt` method, passing the contract name and address:
|
|
131
|
+
|
|
132
|
+
```ts
|
|
133
|
+
const counter = await viem.getContractAt("Counter", "0x...");
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## API
|
|
137
|
+
|
|
138
|
+
The `viem` object added to the Network Connection has the following methods.
|
|
139
|
+
|
|
140
|
+
### `getPublicClient(publicClientConfig?)`
|
|
141
|
+
|
|
142
|
+
Returns a viem public client connected to the current network. Optionally pass a configuration object to override the default client options.
|
|
143
|
+
|
|
144
|
+
### `getWalletClient(address, walletClientConfig?)`
|
|
145
|
+
|
|
146
|
+
Receives an address and returns a viem wallet client for that address. Optionally pass a configuration object to override the default client options.
|
|
147
|
+
|
|
148
|
+
### `getWalletClients(walletClientConfig?)`
|
|
149
|
+
|
|
150
|
+
Returns an array of viem wallet clients for all the accounts configured for the current network. Optionally pass a configuration object to override the default client options.
|
|
151
|
+
|
|
152
|
+
### `getTestClient(testClientConfig?)`
|
|
153
|
+
|
|
154
|
+
Returns a viem test client connected to the current network. Optionally pass a configuration object to override the default client options.
|
|
155
|
+
|
|
156
|
+
### `deployContract(contractName, constructorArgs?, deployContractConfig?)`
|
|
157
|
+
|
|
158
|
+
Deploys a contract by its name. Optionally pass an array of constructor arguments and a configuration object for the deployment.
|
|
159
|
+
|
|
160
|
+
The configuration object supports the following properties:
|
|
161
|
+
|
|
162
|
+
- `confirmations`: the number of confirmations to wait after the deployment transaction is mined. Default is `1`.
|
|
163
|
+
- `libraries`: an object specifying the libraries to link in the contract.
|
|
164
|
+
- `client`: an object with two properties, `public` and `wallet`, that specify the public and wallet clients to use with the returned contract. At least one of them must be provided.
|
|
165
|
+
- `gas`: the gas limit for the transaction.
|
|
166
|
+
- `gasPrice`: the gas price for the transaction.
|
|
167
|
+
- `maxFeePerGas`: the maximum fee per gas for the transaction.
|
|
168
|
+
- `maxPriorityFeePerGas`: the maximum priority fee per gas for the transaction.
|
|
169
|
+
- `value`: the value to send with the transaction, in wei.
|
|
170
|
+
|
|
171
|
+
### `sendDeploymentTransaction(contractName, constructorArgs?, sendDeploymentContractConfig?)`
|
|
172
|
+
|
|
173
|
+
Same as `deployContract`, but doesn't wait for the deployment to be mined, and returns an object with two properties:
|
|
174
|
+
|
|
175
|
+
- `contract`: the contract instance, which is available even before the transaction is mined.
|
|
176
|
+
- `deploymentTransaction`: the deployment transaction.
|
|
177
|
+
|
|
178
|
+
The optional configuration object has the same properties as the one in `deployContract`, except for `confirmations`, which is not applicable here.
|
|
179
|
+
|
|
180
|
+
### `getContractAt(contractName, address, getContractConfig?)`
|
|
181
|
+
|
|
182
|
+
Returns a contract instance for an already deployed contract. Provide the contract name and address. Optionally pass a configuration object with the following properties:
|
|
183
|
+
|
|
184
|
+
- `client`: an object with two properties, `public` and `wallet`, that specify the public and wallet clients to use with the returned contract. At least one of them must be provided.
|
|
@@ -2,8 +2,8 @@ import type { ContractReturnType, DeployContractConfig, GetContractAtConfig, Get
|
|
|
2
2
|
import type { ArtifactManager } from "hardhat/types/artifacts";
|
|
3
3
|
import type { EthereumProvider } from "hardhat/types/providers";
|
|
4
4
|
import type { Address as ViemAddress } from "viem";
|
|
5
|
-
export declare function deployContract<ContractName extends string>(provider: EthereumProvider, artifactManager: ArtifactManager, contractName: ContractName, constructorArgs?: unknown[], deployContractConfig?: DeployContractConfig): Promise<ContractReturnType<ContractName>>;
|
|
6
|
-
export declare function sendDeploymentTransaction<ContractName extends string>(provider: EthereumProvider, artifactManager: ArtifactManager, contractName: ContractName, constructorArgs?: unknown[], sendDeploymentTransactionConfig?: SendDeploymentTransactionConfig): Promise<{
|
|
5
|
+
export declare function deployContract<ContractName extends string>(provider: EthereumProvider, artifactManager: ArtifactManager, contractName: ContractName, constructorArgs?: readonly unknown[], deployContractConfig?: DeployContractConfig): Promise<ContractReturnType<ContractName>>;
|
|
6
|
+
export declare function sendDeploymentTransaction<ContractName extends string>(provider: EthereumProvider, artifactManager: ArtifactManager, contractName: ContractName, constructorArgs?: readonly unknown[], sendDeploymentTransactionConfig?: SendDeploymentTransactionConfig): Promise<{
|
|
7
7
|
contract: ContractReturnType<ContractName>;
|
|
8
8
|
deploymentTransaction: GetTransactionReturnType;
|
|
9
9
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../../src/internal/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,wBAAwB,EAGxB,+BAA+B,EAEhC,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAkB,OAAO,IAAI,WAAW,EAAE,MAAM,MAAM,CAAC;AAUnE,wBAAsB,cAAc,CAAC,YAAY,SAAS,MAAM,EAC9D,QAAQ,EAAE,gBAAgB,EAC1B,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,YAAY,EAC1B,eAAe,GAAE,OAAO,EAAO,
|
|
1
|
+
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../../src/internal/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,wBAAwB,EAGxB,+BAA+B,EAEhC,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAkB,OAAO,IAAI,WAAW,EAAE,MAAM,MAAM,CAAC;AAUnE,wBAAsB,cAAc,CAAC,YAAY,SAAS,MAAM,EAC9D,QAAQ,EAAE,gBAAgB,EAC1B,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,YAAY,EAC1B,eAAe,GAAE,SAAS,OAAO,EAAO,EACxC,oBAAoB,GAAE,oBAAyB,GAC9C,OAAO,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC,CAiF3C;AAED,wBAAsB,yBAAyB,CAAC,YAAY,SAAS,MAAM,EACzE,QAAQ,EAAE,gBAAgB,EAC1B,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,YAAY,EAC1B,eAAe,GAAE,SAAS,OAAO,EAAO,EACxC,+BAA+B,GAAE,+BAAoC,GACpE,OAAO,CAAC;IACT,QAAQ,EAAE,kBAAkB,CAAC,YAAY,CAAC,CAAC;IAC3C,qBAAqB,EAAE,wBAAwB,CAAC;CACjD,CAAC,CAoDD;AAED,wBAAsB,aAAa,CAAC,YAAY,SAAS,MAAM,EAC7D,QAAQ,EAAE,gBAAgB,EAC1B,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,WAAW,EACpB,mBAAmB,GAAE,mBAAwB,GAC5C,OAAO,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC,CAe3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../../src/internal/contracts.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAEvD,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEvE,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,QAA0B,EAC1B,eAAgC,EAChC,YAA0B,EAC1B,
|
|
1
|
+
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../../src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AQ,GAAG,qBAAqB,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IACxD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,WAAW,CAAC,KAAK,CAAC,CAAC;QAEnB,MAAM,IAAI,YAAY,CACpB,YAAY,CAAC,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,sBAAsB,EAC/D;YACE,YAAY;YACZ,KAAK,EAAE,KAAK,CAAC,OAAO;SACrB,EACD,KAAK,CACN,CAAC;IACJ,CAAC;IAED,OAAO;QACL,GAAG,EAAE,QAAQ,CAAC,GAAG;QACjB,QAAQ;KACT,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nomicfoundation/hardhat-viem",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3",
|
|
4
4
|
"description": "Hardhat plugin for viem",
|
|
5
5
|
"homepage": "https://github.com/nomicfoundation/hardhat/tree/v-next/v-next/hardhat-viem",
|
|
6
6
|
"repository": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
],
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@nomicfoundation/hardhat-node-test-reporter": "^3.0.0",
|
|
35
|
-
"@types/node": "^
|
|
35
|
+
"@types/node": "^22.0.0",
|
|
36
36
|
"c8": "^9.1.0",
|
|
37
37
|
"eslint": "9.25.1",
|
|
38
38
|
"expect-type": "^1.2.1",
|
|
@@ -40,16 +40,17 @@
|
|
|
40
40
|
"rimraf": "^5.0.5",
|
|
41
41
|
"tsx": "^4.19.3",
|
|
42
42
|
"typescript": "~5.8.0",
|
|
43
|
-
"viem": "^2.
|
|
44
|
-
"
|
|
43
|
+
"viem": "^2.43.0",
|
|
44
|
+
"hardhat": "^3.0.0",
|
|
45
|
+
"@nomicfoundation/hardhat-test-utils": "^2.0.2"
|
|
45
46
|
},
|
|
46
47
|
"dependencies": {
|
|
47
|
-
"@nomicfoundation/hardhat-errors": "^3.0.
|
|
48
|
-
"@nomicfoundation/hardhat-utils": "^
|
|
48
|
+
"@nomicfoundation/hardhat-errors": "^3.0.7",
|
|
49
|
+
"@nomicfoundation/hardhat-utils": "^4.0.0"
|
|
49
50
|
},
|
|
50
51
|
"peerDependencies": {
|
|
51
52
|
"hardhat": "^3.0.0",
|
|
52
|
-
"viem": "^2.
|
|
53
|
+
"viem": "^2.43.0"
|
|
53
54
|
},
|
|
54
55
|
"scripts": {
|
|
55
56
|
"lint": "pnpm prettier --check && pnpm eslint",
|
|
@@ -25,7 +25,7 @@ export async function deployContract<ContractName extends string>(
|
|
|
25
25
|
provider: EthereumProvider,
|
|
26
26
|
artifactManager: ArtifactManager,
|
|
27
27
|
contractName: ContractName,
|
|
28
|
-
constructorArgs: unknown[] = [],
|
|
28
|
+
constructorArgs: readonly unknown[] = [],
|
|
29
29
|
deployContractConfig: DeployContractConfig = {},
|
|
30
30
|
): Promise<ContractReturnType<ContractName>> {
|
|
31
31
|
const {
|
|
@@ -114,7 +114,7 @@ export async function sendDeploymentTransaction<ContractName extends string>(
|
|
|
114
114
|
provider: EthereumProvider,
|
|
115
115
|
artifactManager: ArtifactManager,
|
|
116
116
|
contractName: ContractName,
|
|
117
|
-
constructorArgs: unknown[] = [],
|
|
117
|
+
constructorArgs: readonly unknown[] = [],
|
|
118
118
|
sendDeploymentTransactionConfig: SendDeploymentTransactionConfig = {},
|
|
119
119
|
): Promise<{
|
|
120
120
|
contract: ContractReturnType<ContractName>;
|