Bad
Marks an interaction as failed with a specific reason and returns the...
Import
You can import the entire package and access the function:
_10import * as sdk from "@onflow/sdk"_10_10sdk.Bad(ix, reason)
Or import directly the specific function:
_10import { Bad } from "@onflow/sdk"_10_10Bad(ix, reason)
Usage
_10import { Bad, initInteraction } from "@onflow/sdk"_10_10const interaction = initInteraction();_10const failedInteraction = Bad(interaction, "Invalid transaction signature");_10console.log(failedInteraction.status); // "BAD"_10console.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