diff --git a/cardano-api/src/Cardano/Api/Address.hs b/cardano-api/src/Cardano/Api/Address.hs index c193222b054..88bb881e457 100644 --- a/cardano-api/src/Cardano/Api/Address.hs +++ b/cardano-api/src/Cardano/Api/Address.hs @@ -55,6 +55,7 @@ module Cardano.Api.Address ( toShelleyStakeAddr, toShelleyStakeCredential, fromShelleyAddr, + fromShelleyAddrIsSbe, fromShelleyPaymentCredential, fromShelleyStakeAddr, fromShelleyStakeCredential, @@ -593,6 +594,15 @@ toShelleyStakeReference (StakeAddressByPointer ptr) = toShelleyStakeReference NoStakeAddress = Shelley.StakeRefNull +fromShelleyAddrIsSbe :: IsShelleyBasedEra era + => Shelley.Addr StandardCrypto -> AddressInEra era +fromShelleyAddrIsSbe (Shelley.AddrBootstrap (Shelley.BootstrapAddress addr)) = + AddressInEra ByronAddressInAnyEra (ByronAddress addr) + +fromShelleyAddrIsSbe (Shelley.Addr nw pc scr) = + AddressInEra + (ShelleyAddressInEra shelleyBasedEra) + (ShelleyAddress nw pc scr) fromShelleyAddr :: ShelleyBasedEra era diff --git a/cardano-api/src/Cardano/Api/Shelley.hs b/cardano-api/src/Cardano/Api/Shelley.hs index 39d599fb246..61e042c6e29 100644 --- a/cardano-api/src/Cardano/Api/Shelley.hs +++ b/cardano-api/src/Cardano/Api/Shelley.hs @@ -24,6 +24,7 @@ module Cardano.Api.Shelley Address(ShelleyAddress), toShelleyAddr, fromShelleyAddr, + fromShelleyAddrIsSbe, toShelleyStakeCredential, fromShelleyStakeCredential, NetworkId(Mainnet, Testnet),