kuber-3.1.0.0
Safe HaskellNone
LanguageHaskell2010

Cardano.Kuber.Util

Synopsis

Documentation

skeyToAddr :: SigningKey PaymentKey -> NetworkId -> Address ShelleyAddr #

Create enterprise address from SignKey

skeyToAddrInEra :: IsShelleyBasedEra era => SigningKey PaymentKey -> NetworkId -> AddressInEra era #

Create enterprise address from SignKey

pkhToMaybeAddr :: IsShelleyBasedEra era => NetworkId -> PubKeyHash -> Maybe (AddressInEra era) #

convert PubKeyhash (plutus tupe) to corresponding Enterprise address (cardano-api type). Note that the transformation Address - Pkh is not symmetrical for all addresses It's symmetrical for Enterprise addresses (because enterprise addresses have no stake Key in it)

addrToMaybePkh :: Address ShelleyAddr -> Maybe PubKeyHash #

Convert Shelley Address (cardano-api type) to corresponding PubKeyHash (plutus type) Note that the transformation Address - Pkh is not symmetrical for all addresses It's symmetrical for Enterprise addresses (because enterprise addresses have no stake Key in it)

addrInEraToPkh :: MonadFail m => AddressInEra e -> m PubKeyHash #

Convert AddressInEra (cardano-api type) data type to corresponding ScriptHash. Note that the transformation Address - Pkh is not symmetrical for all addresses It's symmetrical for Enterprise addresses (because enterprise addresses have no stake Key in it). Returns Nothing if Address is Byron era address or if it's a PublicKey Addresss.

addressInEraToPaymentKeyHash :: AddressInEra era -> Maybe (Hash PaymentKey) #

Convert AddressInEra (cardano-api type) to Hash PaymentKey (cardano-api type). Will return Nothing if address is an Byron Address

addressNetworkId :: Address ShelleyAddr -> NetworkId #

Get Network Id from address

dataToScriptData :: ToData a1 => a1 -> ScriptData #

Convert (ToData) (i.e. Plutus data) to Cardano.Api's ScriptData structure

toPlutusAssetClass :: AssetId -> AssetClass #

Create Plutus library AssetClass structure from Cardano.Api's AssetId

fromPlutusAddress :: NetworkId -> Address -> Maybe (Address ShelleyAddr) #

Convert Address (plutus type) to Shelley Address (cardano-api type). Address is re-deserialized, which might fail. This is because it's possible to set arbitary byteString as hashes in plutus.

toPlutusAddress :: Address ShelleyAddr -> Address #

Convert Shelley Address (cardano-api type) to Address (plutus type)

toPlutusCredential :: forall (keyrole :: KeyRole) crypto. Credential keyrole crypto -> Credential #

Convert Credential (cardano-api type) to Credential (plutus type)

addrInEraToPlutusAddress :: AddressInEra era -> Address #

Convert AddressInEra (cardano-api type) to Address (plutus type).It calls error internally if the provided address is byron address

addressToPlutusCredential :: Address ShelleyAddr -> Credential #

Extract Payment Credential from Shelley Address (cardano-api type) and return Plutus Credential (plutus type)

utxoListSum :: [(a, TxOut ctx era)] -> Value #

utxoSum :: UTxO era -> Value #

utxoMapSum :: Map a (TxOut ctx era) -> Value #

txoutListSum :: [TxOut ctx era] -> Value #

toHexString :: (FromText a1, ToText (Base16 a2)) => a2 -> a1 #

unHex :: (Functor f, FromText (f (Base16 b)), ToText a) => a -> f b #

getDefaultConnection :: String -> NetworkId -> IO LocalNodeConnectInfo #

If CARDANO_NODE_SOCKET_PATH environment variable is set, return ConnectInfo instance with the path Otherwise CARDANO_HOME or "$HOME.cardano" is used and the socket path becomes "$CARDANO_HOMEnode.socket"