A React hook for calling a contract message on each new block and decoding a successful response or receiving an error. This is similar to useCall, except that there is no send() function in the response. The contract message will automatically be called on each new block. See useCall to learn about more shared features.
See useink/utils helpers for compatible functions that work well with this hook.
{
isSubmitting: boolean;
result?: {
ok: true;
value: {
raw: ContractExecResult;
decoded: T; // The response is decoded using contract Metadata, and of type `T`
} | {
ok: false;
// error is set if a contract panics or has a failed assert(), or some other pallet errors.
error: DispatchError | undefined;
}
}
}