Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/lucid/src/plutus/mod.ts>Data

Lucid is a library, which allows you to create Cardano transactions and off-chain code for your Plutus contracts in JavaScript, Deno and Node.js.
Go to Latest
class Data
import { Data } from "https://deno.land/x/lucid@0.7.7/src/plutus/mod.ts";

Static Methods

Convert Cbor encoded data to PlutusData

Convert conveniently a Json object (e.g. Metadata) to PlutusData. Note: Constructor cannot be used here.

to(plutusData: PlutusData): Datum | Redeemer

Convert PlutusData to Cbor encoded data

toJson(plutusData: PlutusData): Json

Convert PlutusData to a Json object. Note: Constructor cannot be used here, also only bytes/integers as Json keys.