You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
to avoid code duplication I want to create a universal send helper that should accept contract ABI, function name and arguments.
But I suck at defining types for this function. The publicClient.simulateContract yells that type of functionName is incompatible and I do not understand how to fix it.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
to avoid code duplication I want to create a universal send helper that should accept contract ABI, function name and arguments.
But I suck at defining types for this function. The
publicClient.simulateContract
yells that type offunctionName
is incompatible and I do not understand how to fix it.Maybe someone solved already the same?
Please take a look at the following code. Also, I have create a codesanbox with the same code: https://codesandbox.io/s/fervent-darwin-jsxs86?file=/src/index.ts:0-1305
Beta Was this translation helpful? Give feedback.
All reactions