Skip to content

Instantly share code, notes, and snippets.

@mailtodanish
Created January 14, 2022 07:53
Show Gist options
  • Save mailtodanish/9098f962a2ee3efa04766eae8551d65a to your computer and use it in GitHub Desktop.
Save mailtodanish/9098f962a2ee3efa04766eae8551d65a to your computer and use it in GitHub Desktop.
create datum.json using Plutus
//using cardano-serialization-lib
const plutusList = CSL.PlutusList.new();
plutusList.add(CSL.PlutusData.new_bytes(Buffer.from('3f7826896a48c593598465a096d63606ceb8206', 'hex')));
plutusList.add(CSL.PlutusData.new_integer(CSL.BigInt.from_str('1888')));
plutusList.add(CSL.PlutusData.new_integer(CSL.BigInt.from_str('1')));
CSL.PlutusData.new_constr_plutus_data(CSL.ConstrPlutusData.new(CSL.Int.new_i32(0), plutusList));
'''
{
"constructor":0,
"fields":
[
{
"bytes":"3f7826896a48c593598465a096d63606ceb8206"
},
{
"int":1888
},
{
"int":1
}
]
}
'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment