I'm trying to deploy a smart contract on cardano-cli after its implementation on plutus playground.
Imagine that I have:
data TradeDatum = StartBid | Bid TradeDetails | Offer TradeDetails
deriving (Generic, ToJSON, FromJSON)
data TradeDetails = TradeDetails
{ tradeOwner :: !PubKeyHash
, budId :: !BuiltinByteString
, requestedAmount :: !Integer
} deriving (Generic, ToJSON, FromJSON)
How can I write this in an example JSON to submit on cardano-cli? I saw an example with int: 42,
{
"constructor": 0,
"fields": {int: 42}
}
but I really don't know.
- How can I define the different types?
- Inside the tradedetails, how can I define? and for example, how to express the pubkeyhash?
Can you give me an exmaple? There are some tutorials with the types of data that I can write inside the JSON (like int)?
Thanks.