@arkade-os/sdk Documentation - v0.4.0-next.8
    Preparing search index...

    Function contractFromArkContract

    • Create a Contract from an arkcontract string.

      This requires a handler to be registered for the contract type.

      Parameters

      • encoded: string

        The arkcontract string

      • options: {
            expiresAt?: number;
            label?: string;
            metadata?: Record<string, unknown>;
            state?: "active" | "inactive";
        } = {}

        Additional options for the contract

      Returns Omit<Contract, "script" | "address"> & { address?: string; script?: string }

      A Contract object

      If the string is invalid or no handler exists for the type

      const contract = contractFromArkContract(
      "arkcontract=vhtlc&sender=ab12...",
      {
      label: "Lightning Receive",
      }
      );