Locking Ada/Token to Script

In this example, we are loking our token with inline datum to script address addr_test1wq40nfjurthn364rvhhzu2y8z3t0d53s2z9sz0303hya3us9a490f. In this example, we are sending 2A to the script address and locking it with null datum. datumHash is the cbor format of datum. You can also use datum instead of datumHash to send the datum directly, but you will have to set inlineDatum to false inside the output object. For more information, please refer to API Reference.

{
"outputs": [
{
"address": "addr_test1wq40nfjurthn364rvhhzu2y8z3t0d53s2z9sz0303hya3us9a490f",
"value": "2A",
"datumHash": "923918e403bf43c34b4ef6b48eb2ee04babed17320d8d1b9ff9ad086e86f44ec"
}
]
}

View Resulting transaction


Similary,

{
"outputs": [
{
"address": "addr_test1wq40nfjurthn364rvhhzu2y8z3t0d53s2z9sz0303hya3us9a490f",
"value": "2A",
"datum": {
"fields": [],
"constructor": 0
},
"inlineDatum": false
}
]
}

View Resulting transaction


© 2023 Kuberide. All Rights Reserved.

Built withfrom 🇳🇵