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

    Function encodeArkContract

    • Encode a contract to the arkcontract string format.

      Format: arkcontract={type}&{key1}={value1}&{key2}={value2}...

      This format is compatible with NArk and allows contracts to be shared/imported across different Ark implementations.

      Parameters

      Returns string

      const contract: Contract = {
      type: "vhtlc",
      params: { sender: "ab12...", receiver: "cd34...", ... },
      // ...
      };

      const encoded = encodeArkContract(contract);
      // "arkcontract=vhtlc&sender=ab12...&receiver=cd34...&..."