isOk
Checks if an interaction has a successful status.
Import
You can import the entire package and access the function:
_10import * as sdk from "@onflow/sdk"_10_10sdk.isOk(ix)
Or import directly the specific function:
_10import { isOk } from "@onflow/sdk"_10_10isOk(ix)
Usage
_13import * as fcl from "@onflow/fcl";_13import { isOk } from "@onflow/sdk"_13_13// Check if a transaction was successful_13const response = await fcl.send([_13 fcl.transaction`transaction { prepare(account: AuthAccount) {} }`_13]);_13_13if (isOk(response)) {_13 console.log("Transaction was successful");_13} else {_13 console.log("Transaction failed");_13}
Parameters
ix
- Type:
Interaction
- Description: The interaction to check
Returns
boolean