Skip to content

Instantly share code, notes, and snippets.

@mailtodanish
Created January 14, 2022 06:50
Show Gist options
  • Save mailtodanish/ccf611b8c2282930545271f77b258815 to your computer and use it in GitHub Desktop.
Save mailtodanish/ccf611b8c2282930545271f77b258815 to your computer and use it in GitHub Desktop.
add datum in output transaction
const datums = this.S.PlutusList.new();
const datum = this.S.PlutusData.new_constr_plutus_data(
this.S.ConstrPlutusData.new(
this.S.Int.new_i32(1),
this.S.PlutusList.new()
)
);
datums.add(datum);
console.log("datums", datums);
let t = this.S.TransactionOutput.new(
this.S.Address.from_bech32(ReceiveAddress),
outputValue
);
t.set_data_hash(this.S.hash_plutus_data(datum));
outputs.add(t);
@mailtodanish
Copy link
Author

this.S is "Loader.Cardano." of "@emurgo/cardano-serialization-lib-browser/"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment