Skip to content

Commit 17578d7

Browse files
committed
add Address::is_liquid
User code can already compare against AddressParams, but it seems more easy to find a method to check if the address is liquid. Even thoug is less general because you can't discriminate between elements and liquid testnet, most of the time wallets are interested only in the mainnet or not discrimination.
1 parent 85604b0 commit 17578d7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/address.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,11 @@ impl Address {
223223
self.blinding_pubkey.is_some()
224224
}
225225

226+
/// Return if the address is for the Liquid network
227+
pub fn is_liquid(&self) -> bool {
228+
self.params == &AddressParams::LIQUID
229+
}
230+
226231
/// Creates a pay to (compressed) public key hash address from a public key
227232
/// This is the preferred non-witness type address
228233
#[inline]

0 commit comments

Comments
 (0)