Skip to content

Commit

Permalink
paiment to wallets directly without walletPKHash
Browse files Browse the repository at this point in the history
  • Loading branch information
mmontin committed May 10, 2024
1 parent 870f205 commit 402cd7d
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/Cooked/Skeleton.hs
Original file line number Diff line number Diff line change
Expand Up @@ -612,12 +612,21 @@ txSkelOutTypedDatum = Api.fromBuiltinData . Api.getDatum <=< txSkelOutUntypedDat

-- ** Smart constructors for transaction outputs

class HasPubKeyHash a where
toPubKeyHash :: a -> Api.PubKeyHash

instance HasPubKeyHash Api.PubKeyHash where
toPubKeyHash = id

instance HasPubKeyHash Wallet where
toPubKeyHash = walletPKHash

-- | Pay a certain value to a public key.
paysPK :: Api.PubKeyHash -> Api.Value -> TxSkelOut
paysPK pkh value =
paysPK :: (HasPubKeyHash a) => a -> Api.Value -> TxSkelOut
paysPK a value =
Pays
( ConcreteOutput
pkh
(toPubKeyHash a)
Nothing
value
TxSkelOutNoDatum
Expand Down

0 comments on commit 402cd7d

Please sign in to comment.