hydra-cardano-api-0.19.0: A Haskell API for Cardano, tailored to the Hydra project.
Safe HaskellSafe-Inferred
LanguageGHC2021

Hydra.Cardano.Api.AddressInEra

Synopsis

Extras

mkVkAddress :: IsShelleyBasedEra era => NetworkId -> VerificationKey PaymentKey -> AddressInEra era Source #

Construct a Shelley-style address from a verification key. This address has no stake rights.

TODO: NetworkId here is an annoying API because it requires a network magic for testnet addresses. Nevertheless, the network magic is only needed for Byron addresses; Shelley addresses use a different kind of network discriminant which is currently fully captured as 'Mainnet | Testnet'.

So, it would be a slightly better DX to use Mainnet | Testnet as an interface here since we are only constructing Shelley addresses.

mkScriptAddress :: forall lang era. (IsShelleyBasedEra era, IsPlutusScriptLanguage lang) => NetworkId -> PlutusScript lang -> AddressInEra era Source #

Construct a Shelley-style address from a Plutus script. This address has no stake rights.

Type Conversions

fromLedgerAddr :: IsShelleyBasedEra era => Addr StandardCrypto -> AddressInEra era Source #

From a ledger Addr to an api AddressInEra

toLedgerAddr :: AddressInEra era -> Addr StandardCrypto Source #

From an api AddressInEra to a ledger Addr

fromPlutusAddress :: IsShelleyBasedEra era => Network -> Address -> AddressInEra era Source #

Convert a plutus Address to an api AddressInEra. NOTE: Requires the Network discriminator (Testnet or Mainnet) because Plutus addresses are stripped off it.