Skip to main content

isOk

Checks if an interaction has a successful status.

Import

You can import the entire package and access the function:


_10
import * as sdk from "@onflow/sdk"
_10
_10
sdk.isOk(ix)

Or import directly the specific function:


_10
import { isOk } from "@onflow/sdk"
_10
_10
isOk(ix)

Usage


_13
import * as fcl from "@onflow/fcl";
_13
import { isOk } from "@onflow/sdk"
_13
_13
// Check if a transaction was successful
_13
const response = await fcl.send([
_13
fcl.transaction`transaction { prepare(account: AuthAccount) {} }`
_13
]);
_13
_13
if (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


Rate this page