Caravan Documentation
    Preparing search index...

    Class UnsupportedInteraction

    Class used for describing an unsupported interaction.

    • Always returns false when the isSupported method is called.

    • Has a keystore state unsupported message at the error level.

    • Throws errors when attempting to call API methods such as run, request, and parse.

    import {UnsupportedInteraction} from "@caravan/wallets";
    const interaction = new UnsupportedInteraction({text: "failure text", code: "fail"});
    console.log(interaction.isSupported()); // false

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    code: string
    environment: Parser
    text: string

    Methods

    • Return messages filtered by the given options.

      Multiple options can be given at once to filter along multiple dimensions.

      Parameters

      • __namedParameters: MessageMethodArgs

      Returns Message[]

      import {PENDING, ACTIVE} from "@caravan/bitcoin";
      // Create any interaction instance
      interaction.messages().forEach(msg => console.log(msg));
      { code: "device.connect", state: "pending", level: "info", text: "Please plug in your device."}
      { code: "device.active", state: "active", level: "info", text: "Communicating with your device..."}
      { code: "device.active.warning", state: "active", level: "warning", text: "Your device will warn you about...", version: "2.x"}
      interaction.messagesFor({state: PENDING}).forEach(msg => console.log(msg));
      { code: "device.connect", state: "pending", level: "info", text: "Please plug in your device."}
      interaction.messagesFor({code: ACTIVE}).forEach(msg => console.log(msg));
      { code: "device.active", state: "active", level: "info", text: "Communicating with your device..."}
      { code: "device.active.warning", state: "active", level: "warning", text: "Your device will warn you about...", version: "2.x"}
      interaction.messagesFor({version: /^2/}).forEach(msg => console.log(msg));
      { code: "device.active", state: "active", level: "warning", text: "Your device will warn you about...", version: "2.x"}