atlas-cardano-0.6.3: Application backend for Plutus smart contracts on Cardano
Copyright(c) 2024 GYELD GMBH
LicenseApache 2.0
Maintainer[email protected]
Stabilitydevelop
Safe HaskellSafe-Inferred
LanguageGHC2021

GeniusYield.Types.Script.SimpleScript

Description

 
Synopsis

Docspec setup

>>> :set -XOverloadedStrings -XTypeApplications
>>> 
>>> import GeniusYield.Types
>>> import Data.Set qualified as Set

Simple script

data GYSimpleScript #

A simple (aka native / timelock) script that can be used in a transaction.

readSimpleScriptFilePathIO GYSimpleScript #

Read a GYSimpleScript represented as JSON from a file.

getTotalKeysInSimpleScriptGYSimpleScriptSet GYPaymentKeyHash #

Get the total number of unique GYPaymentKeyHash mentioned in a GYSimpleScript.

This is useful for estimating the number of signatures required for a transaction.

>>> reqSigA = RequireSignature "e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38a"
>>> reqSigB = RequireSignature "e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38b"
>>> reqSigC = RequireSignature "e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38c"
>>> reqSigD = RequireSignature "e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d"
>>> reqSigE = RequireSignature "e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38e"
>>> Set.size $ getTotalKeysInSimpleScript $ RequireMOf 2 [RequireAllOf [reqSigA, reqSigB, reqSigC], RequireAnyOf [reqSigA, reqSigD], reqSigE]
5