isBad
Checks if an interaction has a failed status.
Import
You can import the entire package and access the function:
_10import * as sdk from "@onflow/sdk"_10_10sdk.isBad(ix)
Or import directly the specific function:
_10import { isBad } from "@onflow/sdk"_10_10isBad(ix)
Usage
_10import * as fcl from "@onflow/fcl";_10import { isBad, why } from "@onflow/sdk"_10_10const response = await fcl.send([_10 fcl.transaction`transaction { prepare(account: AuthAccount) {} }`_10]);_10_10if (isBad(response)) {_10 console.log("Transaction failed:", why(response));_10}
Parameters
ix
- Type:
Interaction
- Description: The interaction to check
Returns
boolean