wagmi-extended 2.3.2 → 2.3.4
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/README.md +14 -15
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -70,7 +70,8 @@ import {
|
|
|
70
70
|
useWriteTransactionX,
|
|
71
71
|
setDefaults,
|
|
72
72
|
getDefaults,
|
|
73
|
-
WriteExtendedAsyncParams
|
|
73
|
+
WriteExtendedAsyncParams,
|
|
74
|
+
queryConfig
|
|
74
75
|
} from "wagmi-extended";
|
|
75
76
|
```
|
|
76
77
|
|
|
@@ -108,6 +109,7 @@ await writeContractAsync({
|
|
|
108
109
|
|
|
109
110
|
#### New `writeContractX` method
|
|
110
111
|
|
|
112
|
+
Use `writeContract` if you don't want simulation to happen
|
|
111
113
|
Use `writeContractX` if you need control over the simulation step:
|
|
112
114
|
|
|
113
115
|
```ts
|
|
@@ -117,20 +119,17 @@ const { writeContractX, isPending, errorMessage } = useContractWriteX({
|
|
|
117
119
|
})
|
|
118
120
|
|
|
119
121
|
// simulate + send:
|
|
120
|
-
await writeContractX(
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
},
|
|
132
|
-
/* disableSimulation? */ false
|
|
133
|
-
)
|
|
122
|
+
await writeContractX({
|
|
123
|
+
address: "0xContractAddress",
|
|
124
|
+
abi: MyContractAbi,
|
|
125
|
+
functionName: "executeFunction",
|
|
126
|
+
args: [
|
|
127
|
+
/* ... */
|
|
128
|
+
],
|
|
129
|
+
account: myAddress,
|
|
130
|
+
chain: myChain,
|
|
131
|
+
value: 0n,
|
|
132
|
+
})
|
|
134
133
|
|
|
135
134
|
// send immediately without simulation:
|
|
136
135
|
await writeContractX(params, /* disableSimulation= */ true)
|