Skip to content

Commit 443f7f7

Browse files
committed
Only query read functions for read-contract action
1 parent f583e2d commit 443f7f7

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

components/workflow/config/action-config-renderer.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,12 @@ function AbiFunctionSelectField({
137137
return [];
138138
}
139139

140-
// Extract all functions from the ABI
140+
// Extract only read-only functions (view/pure) from the ABI
141141
return abi
142-
.filter((item) => item.type === "function")
142+
.filter((item) =>
143+
item.type === "function" &&
144+
(item.stateMutability === "view" || item.stateMutability === "pure")
145+
)
143146
.map((func) => {
144147
const inputs = func.inputs || [];
145148
const params = inputs
@@ -177,7 +180,7 @@ function AbiFunctionSelectField({
177180
<SelectContent>
178181
{functions.map((func) => (
179182
<SelectItem key={func.name} value={func.name}>
180-
<div className="flex flex-col">
183+
<div className="flex flex-col items-start">
181184
<span>{func.label}</span>
182185
<span className="text-muted-foreground text-xs">
183186
{func.stateMutability}

0 commit comments

Comments
 (0)