Skip to main content
Module

x/lucid/mod.ts>PlutusData

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.
Very Popular
Go to Latest
type alias PlutusData
Re-export
import { type PlutusData } from "https://deno.land/x/lucid@0.5.2/mod.ts";

These are the arguments that conform a BuiltinData in Plutus:

data Data =
  Constr Integer [Data]
| Map [(Data, Data)]
| List [Data]
| I Integer
| B BS.ByteString
  deriving stock (Show, Eq, Ord, Generic)
  deriving anyclass (NFData)

So we can define an arbitrary mapping for these types

bigint -> I
string -> B
Map    -> Map
list   -> List

Note: We need to wrap it in an object to prevent circular references

definition:
| bytes
| bigint
| Array<PlutusData>