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

x/lucid/src/core/core.ts>Core.PlutusDatumSchema

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
variable Core.PlutusDatumSchema
import { Core } from "https://deno.land/x/lucid@0.7.7/src/core/core.ts";
const { PlutusDatumSchema } = Core;

JSON <-> PlutusData conversion schemas. Follows ScriptDataJsonSchema in cardano-cli defined at: https://github.com/input-output-hk/cardano-node/blob/master/cardano-api/src/Cardano/Api/ScriptData.hs#L254

All methods here have the following restrictions due to limitations on dependencies:

  • JSON numbers above u64::MAX (positive) or below i64::MIN (negative) will throw errors
  • Hex strings for bytes don't accept odd-length (half-byte) strings. cardano-cli seems to support these however but it seems to be different than just 0-padding on either side when tested so proceed with caution