Skip to main content

Bad

Marks an interaction as failed with a specific reason and returns the...

Import

You can import the entire package and access the function:


_10
import * as sdk from "@onflow/sdk"
_10
_10
sdk.Bad(ix, reason)

Or import directly the specific function:


_10
import { Bad } from "@onflow/sdk"
_10
_10
Bad(ix, reason)

Usage


_10
import { Bad, initInteraction } from "@onflow/sdk"
_10
_10
const interaction = initInteraction();
_10
const failedInteraction = Bad(interaction, "Invalid transaction signature");
_10
console.log(failedInteraction.status); // "BAD"
_10
console.log(failedInteraction.reason); // "Invalid transaction signature"

Parameters

ix

  • Type: Interaction
  • Description: The interaction to mark as failed

reason

  • Type: string
  • Description: The reason for the failure

Returns

Interaction


Rate this page