20 lines
725 B
Haskell
20 lines
725 B
Haskell
module ZcashHaskell.Sapling where
|
|
|
|
import C.Zcash
|
|
( rustWrapperIsShielded
|
|
, rustWrapperSaplingCheck
|
|
, rustWrapperSaplingVkDecode
|
|
)
|
|
import qualified Data.ByteString as BS
|
|
|
|
-- | Check if given bytesting is a valid encoded shielded address
|
|
isValidShieldedAddress :: BS.ByteString -> Bool
|
|
isValidShieldedAddress = rustWrapperIsShielded
|
|
|
|
-- | Check if given bytestring is a valid Sapling viewing key
|
|
isValidSaplingViewingKey :: BS.ByteString -> Bool
|
|
isValidSaplingViewingKey = rustWrapperSaplingVkDecode
|
|
|
|
-- | Check if the given bytestring for the Sapling viewing key matches the second bytestring for the address
|
|
matchSaplingAddress :: BS.ByteString -> BS.ByteString -> Bool
|
|
matchSaplingAddress = rustWrapperSaplingCheck
|