wagmi-extended 2.3.1 → 2.3.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/README.md +13 -15
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -84,7 +84,7 @@ The `useContractWriteX` hook wraps Wagmi’s `useWriteContract` with extra featu
|
|
|
84
84
|
|
|
85
85
|
- **Receipt waiting**: always waits for the transaction receipt before resolving.
|
|
86
86
|
- **Logging control**: disable console logging if you wish.
|
|
87
|
-
- **Query invalidation**: automatically invalidates queries after receipt, either by explicit keys or by predicate.
|
|
87
|
+
- **Query invalidation**: automatically invalidates queries after receipt, either by explicit keys or by predicate. Invalidation by predicate is first executed.
|
|
88
88
|
|
|
89
89
|
#### Original `writeContractAsync`
|
|
90
90
|
|
|
@@ -108,6 +108,7 @@ await writeContractAsync({
|
|
|
108
108
|
|
|
109
109
|
#### New `writeContractX` method
|
|
110
110
|
|
|
111
|
+
Use `writeContract` if you don't want simulation to happen
|
|
111
112
|
Use `writeContractX` if you need control over the simulation step:
|
|
112
113
|
|
|
113
114
|
```ts
|
|
@@ -117,20 +118,17 @@ const { writeContractX, isPending, errorMessage } = useContractWriteX({
|
|
|
117
118
|
})
|
|
118
119
|
|
|
119
120
|
// simulate + send:
|
|
120
|
-
await writeContractX(
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
},
|
|
132
|
-
/* disableSimulation? */ false
|
|
133
|
-
)
|
|
121
|
+
await writeContractX({
|
|
122
|
+
address: "0xContractAddress",
|
|
123
|
+
abi: MyContractAbi,
|
|
124
|
+
functionName: "executeFunction",
|
|
125
|
+
args: [
|
|
126
|
+
/* ... */
|
|
127
|
+
],
|
|
128
|
+
account: myAddress,
|
|
129
|
+
chain: myChain,
|
|
130
|
+
value: 0n,
|
|
131
|
+
})
|
|
134
132
|
|
|
135
133
|
// send immediately without simulation:
|
|
136
134
|
await writeContractX(params, /* disableSimulation= */ true)
|