@@ -29,11 +29,12 @@ export async function deployContract(
29
29
) : Promise < GetContractReturnType > {
30
30
const {
31
31
walletClient : configWalletClient ,
32
+ publicClient : configPublicClient ,
32
33
confirmations,
33
34
...deployContractParameters
34
35
} = config ;
35
36
const [ publicClient , walletClient , contractArtifact ] = await Promise . all ( [
36
- getPublicClient ( network . provider ) ,
37
+ configPublicClient ?? getPublicClient ( network . provider ) ,
37
38
configWalletClient ??
38
39
getDefaultWalletClient ( network . provider , network . name ) ,
39
40
artifacts . readArtifact ( contractName ) ,
@@ -119,10 +120,13 @@ export async function sendDeploymentTransaction(
119
120
contract : GetContractReturnType ;
120
121
deploymentTransaction : GetTransactionReturnType ;
121
122
} > {
122
- const { walletClient : configWalletClient , ...deployContractParameters } =
123
- config ;
123
+ const {
124
+ walletClient : configWalletClient ,
125
+ publicClient : configPublicClient ,
126
+ ...deployContractParameters
127
+ } = config ;
124
128
const [ publicClient , walletClient , contractArtifact ] = await Promise . all ( [
125
- getPublicClient ( network . provider ) ,
129
+ configPublicClient ?? getPublicClient ( network . provider ) ,
126
130
configWalletClient ??
127
131
getDefaultWalletClient ( network . provider , network . name ) ,
128
132
artifacts . readArtifact ( contractName ) ,
@@ -198,7 +202,7 @@ export async function getContractAt(
198
202
config : GetContractAtConfig = { }
199
203
) : Promise < GetContractReturnType > {
200
204
const [ publicClient , walletClient , contractArtifact ] = await Promise . all ( [
201
- getPublicClient ( network . provider ) ,
205
+ config . publicClient ?? getPublicClient ( network . provider ) ,
202
206
config . walletClient ??
203
207
getDefaultWalletClient ( network . provider , network . name ) ,
204
208
artifacts . readArtifact ( contractName ) ,
0 commit comments