Copyright | 2022-2024 Vergara Technologies |
---|---|
License | MIT |
Maintainer | pitmutt@vergara.tech |
Stability | experimental |
Portability | unknown |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
The types used by the ZcashHaskell library to interact with the Zcash blockchain
Synopsis
- newtype Seed = Seed ByteString
- newtype Phrase = Phrase ByteString
- data Scope
- data RawData = RawData {
- hrp :: !ByteString
- bytes :: !ByteString
- data ZcashNet
- = MainNet
- | TestNet
- | RegTestNet
- type AccountId = Int
- getTransparentPrefix :: ZcashNet -> TransparentType -> (Word8, Word8)
- data CoinType
- getValue :: CoinType -> Word32
- data Transaction = Transaction {
- tx_id :: !HexString
- tx_height :: !Int
- tx_conf :: !Int
- tx_expiry :: !Int
- tx_transpBundle :: !(Maybe TransparentBundle)
- tx_saplingBundle :: !(Maybe SaplingBundle)
- tx_orchardBundle :: !(Maybe OrchardBundle)
- data TransparentBundle = TransparentBundle {}
- fromRawTBundle :: RawTBundle -> Maybe TransparentBundle
- fromRawTxIn :: RawTxIn -> TxIn
- fromRawTxOut :: RawTxOut -> TxOut
- sapExtSpendingKeyHrp :: String
- sapExtFullViewingKeyHrp :: String
- sapPaymentAddressHrp :: String
- sapTestExtSpendingKeyHrp :: String
- sapTestExtFullViewingKeyHrp :: String
- sapTestPaymentAddressHrp :: String
- uniPaymentAddressHrp :: Text
- uniFullViewingKeyHrp :: Text
- uniIncomingViewingKeyHrp :: Text
- uniTestPaymentAddressHrp :: Text
- uniTestFullViewingKeyHrp :: Text
- uniTestIncomingViewingKeyHrp :: Text
- data RpcCall = RpcCall {}
- data RpcResponse r = MakeRpcResponse {}
- data RpcError = RpcError {}
- data BlockResponse = BlockResponse {}
- data RawTxResponse = RawTxResponse {
- rt_id :: !HexString
- rt_hex :: !HexString
- rt_shieldedSpends :: ![ShieldedSpend]
- rt_shieldedOutputs :: ![ByteString]
- rt_orchardActions :: ![OrchardAction]
- rt_blockheight :: !Integer
- rt_confirmations :: !Integer
- rt_blocktime :: !Integer
- data ZebraTxResponse = ZebraTxResponse {}
- data RawZebraTx = RawZebraTx {
- zt_id :: !HexString
- zt_locktime :: !Word32
- zt_expiry :: !Word32
- zt_tBundle :: !RawTBundle
- zt_sBundle :: !RawSBundle
- zt_oBundle :: !RawOBundle
- data RawTBundle = RawTBundle {}
- data RawSBundle = RawSBundle {
- zsb_empty :: !Bool
- zsb_spends :: ![ShieldedSpend]
- zsb_outputs :: ![ShieldedOutput]
- zsb_value :: !Int64
- zsb_sig :: !HexString
- data SaplingBundle = SaplingBundle {
- sbSpends :: ![ShieldedSpend]
- sbOutputs :: ![ShieldedOutput]
- sbValue :: !Int64
- sbSig :: !HexString
- fromRawSBundle :: RawSBundle -> Maybe SaplingBundle
- data RawOBundle = RawOBundle {
- zob_empty :: !Bool
- zob_actions :: ![OrchardAction]
- zob_flags :: !OrchardFlags
- zob_value :: !Int64
- zob_anchor :: !HexString
- zob_proof :: !HexString
- zob_sig :: !HexString
- data OrchardBundle = OrchardBundle {}
- fromRawOBundle :: RawOBundle -> Maybe OrchardBundle
- data OrchardFlags = OrchardFlags {
- of_spends :: !Bool
- of_outputs :: !Bool
- data ZebraGetInfo = ZebraGetInfo {
- zgi_build :: !Text
- zgi_subversion :: !Text
- data ZebraGetBlockChainInfo = ZebraGetBlockChainInfo {}
- data TransparentType
- type TransparentSpendingKey = XPrvKey
- data TransparentAddress = TransparentAddress {
- ta_type :: !TransparentType
- ta_bytes :: !HexString
- data RawTxIn = RawTxIn {
- rti_outpoint :: !RawOutPoint
- rti_script :: !ByteString
- rti_seq :: !Word32
- data RawTxOut = RawTxOut {
- rto_amt :: !Word64
- rto_script :: !ByteString
- data RawOutPoint = RawOutPoint {
- rop_hash :: !ByteString
- rop_n :: !Word32
- newtype SaplingSpendingKey = SaplingSpendingKey ByteString
- newtype SaplingReceiver = SaplingReceiver ByteString
- data ShieldedSpend = ShieldedSpend {}
- data ShieldedOutput = ShieldedOutput {}
- newtype OrchardSpendingKey = OrchardSpendingKey ByteString
- newtype OrchardReceiver = OrchardReceiver ByteString
- data UnifiedAddress = UnifiedAddress {
- ua_net :: !ZcashNet
- o_rec :: !(Maybe OrchardReceiver)
- s_rec :: !(Maybe SaplingReceiver)
- t_rec :: !(Maybe TransparentAddress)
- data RawUA = RawUA {
- raw_net :: !Word8
- raw_o :: !ByteString
- raw_s :: !ByteString
- raw_t :: !ByteString
- raw_to :: !ByteString
- data UnifiedFullViewingKey = UnifiedFullViewingKey {
- net :: !Word8
- o_key :: !ByteString
- s_key :: !ByteString
- t_key :: !ByteString
- data OrchardAction = OrchardAction {}
- data DecodedNote = DecodedNote {
- a_value :: !Int64
- a_recipient :: !ByteString
- a_memo :: !ByteString
- class ToBytes a where
- getBytes :: a -> ByteString
- decodeHexText :: String -> ByteString
General
A seed for generating private keys
Instances
A mnemonic phrase used to derive seeds
Instances
Scope for addresses/receivers
External | Addresses used publically to receive payments |
Internal | Addresses used internally by wallets for change and shielding |
Type to represent data after Bech32 decoding
RawData | |
|
Instances
Type for the different networks of the Zcash blockchain
getTransparentPrefix :: ZcashNet -> TransparentType -> (Word8, Word8) #
Function to get the Base58 prefix for encoding a TransparentAddress
Constants
Type for coin types on the different networks
data Transaction #
A Zcash transaction
Transaction | |
|
Instances
Read Transaction # | |
Defined in ZcashHaskell.Types readsPrec :: Int -> ReadS Transaction # readList :: ReadS [Transaction] # readPrec :: ReadPrec Transaction # readListPrec :: ReadPrec [Transaction] # | |
Show Transaction # | |
Defined in ZcashHaskell.Types showsPrec :: Int -> Transaction -> ShowS # show :: Transaction -> String # showList :: [Transaction] -> ShowS # | |
Eq Transaction # | |
Defined in ZcashHaskell.Types (==) :: Transaction -> Transaction -> Bool # (/=) :: Transaction -> Transaction -> Bool # |
data TransparentBundle #
The transparent portion of a Zcash transaction
Instances
Read TransparentBundle # | |
Defined in ZcashHaskell.Types | |
Show TransparentBundle # | |
Defined in ZcashHaskell.Types showsPrec :: Int -> TransparentBundle -> ShowS # show :: TransparentBundle -> String # showList :: [TransparentBundle] -> ShowS # | |
Eq TransparentBundle # | |
Defined in ZcashHaskell.Types (==) :: TransparentBundle -> TransparentBundle -> Bool # (/=) :: TransparentBundle -> TransparentBundle -> Bool # |
fromRawTBundle :: RawTBundle -> Maybe TransparentBundle #
Read a raw transparent bundle into the Haskell type
fromRawTxIn :: RawTxIn -> TxIn #
fromRawTxOut :: RawTxOut -> TxOut #
Constants for Sapling Human-readable part
Constants for Unified Human-readable part
RPC
A type to model Zcash RPC calls
Instances
ToJSON RpcCall # | |
Generic RpcCall # | |
Show RpcCall # | |
type Rep RpcCall # | |
Defined in ZcashHaskell.Types type Rep RpcCall = D1 ('MetaData "RpcCall" "ZcashHaskell.Types" "zcash-haskell-0.5.3.0-inplace" 'False) (C1 ('MetaCons "RpcCall" 'PrefixI 'True) ((S1 ('MetaSel ('Just "jsonrpc") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "callId") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "method") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "parameters") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [Value])))) |
data RpcResponse r #
A type to model the response of the Zcash RPC
Instances
A type to model the errors from the Zcash RPC
Instances
FromJSON RpcError # | |
Defined in ZcashHaskell.Types | |
ToJSON RpcError # | |
Generic RpcError # | |
Show RpcError # | |
type Rep RpcError # | |
Defined in ZcashHaskell.Types type Rep RpcError = D1 ('MetaData "RpcError" "ZcashHaskell.Types" "zcash-haskell-0.5.3.0-inplace" 'False) (C1 ('MetaCons "RpcError" 'PrefixI 'True) (S1 ('MetaSel ('Just "ecode") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double) :*: S1 ('MetaSel ('Just "emessage") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text))) |
zcashd
data BlockResponse #
Type to represent response from the zcashd
RPC getblock
method
Instances
FromJSON BlockResponse # | |
Defined in ZcashHaskell.Types parseJSON :: Value -> Parser BlockResponse # parseJSONList :: Value -> Parser [BlockResponse] # | |
Show BlockResponse # | |
Defined in ZcashHaskell.Types showsPrec :: Int -> BlockResponse -> ShowS # show :: BlockResponse -> String # showList :: [BlockResponse] -> ShowS # | |
Eq BlockResponse # | |
Defined in ZcashHaskell.Types (==) :: BlockResponse -> BlockResponse -> Bool # (/=) :: BlockResponse -> BlockResponse -> Bool # |
data RawTxResponse #
Type to represent response from the zcashd
RPC getrawtransaction
RawTxResponse | |
|
Instances
FromJSON RawTxResponse # | |
Defined in ZcashHaskell.Sapling parseJSON :: Value -> Parser RawTxResponse # parseJSONList :: Value -> Parser [RawTxResponse] # | |
Read RawTxResponse # | |
Defined in ZcashHaskell.Types readsPrec :: Int -> ReadS RawTxResponse # readList :: ReadS [RawTxResponse] # | |
Show RawTxResponse # | |
Defined in ZcashHaskell.Types showsPrec :: Int -> RawTxResponse -> ShowS # show :: RawTxResponse -> String # showList :: [RawTxResponse] -> ShowS # | |
Eq RawTxResponse # | |
Defined in ZcashHaskell.Types (==) :: RawTxResponse -> RawTxResponse -> Bool # (/=) :: RawTxResponse -> RawTxResponse -> Bool # |
zebrad
data ZebraTxResponse #
Instances
FromJSON ZebraTxResponse # | |
Defined in ZcashHaskell.Types parseJSON :: Value -> Parser ZebraTxResponse # parseJSONList :: Value -> Parser [ZebraTxResponse] # | |
Read ZebraTxResponse # | |
Defined in ZcashHaskell.Types | |
Show ZebraTxResponse # | |
Defined in ZcashHaskell.Types showsPrec :: Int -> ZebraTxResponse -> ShowS # show :: ZebraTxResponse -> String # showList :: [ZebraTxResponse] -> ShowS # | |
Eq ZebraTxResponse # | |
Defined in ZcashHaskell.Types (==) :: ZebraTxResponse -> ZebraTxResponse -> Bool # (/=) :: ZebraTxResponse -> ZebraTxResponse -> Bool # |
data RawZebraTx #
Type to represent a raw deserialized Zebra transaction
RawZebraTx | |
|
Instances
data RawTBundle #
Type for a raw deserialized Zebra transparent bundle
Instances
data RawSBundle #
Type for a raw deserialized Zebra Sapling bundle
RawSBundle | |
|
Instances
data SaplingBundle #
SaplingBundle | |
|
Instances
data RawOBundle #
Type for a raw deseralized Zebra Orchard bundle
RawOBundle | |
|
Instances
data OrchardBundle #
Type for an Orchard Bundle
Instances
data OrchardFlags #
Type for the Orchard bundle flags
OrchardFlags | |
|
Instances
data ZebraGetInfo #
Type for the response from the zebrad
RPC method getinfo
ZebraGetInfo | |
|
Instances
FromJSON ZebraGetInfo # | |
Defined in ZcashHaskell.Types parseJSON :: Value -> Parser ZebraGetInfo # parseJSONList :: Value -> Parser [ZebraGetInfo] # | |
Show ZebraGetInfo # | |
Defined in ZcashHaskell.Types showsPrec :: Int -> ZebraGetInfo -> ShowS # show :: ZebraGetInfo -> String # showList :: [ZebraGetInfo] -> ShowS # | |
Eq ZebraGetInfo # | |
Defined in ZcashHaskell.Types (==) :: ZebraGetInfo -> ZebraGetInfo -> Bool # (/=) :: ZebraGetInfo -> ZebraGetInfo -> Bool # |
data ZebraGetBlockChainInfo #
Type for the response from the zebrad
RPC method getblockchaininfo
Instances
FromJSON ZebraGetBlockChainInfo # | |
Defined in ZcashHaskell.Types | |
Show ZebraGetBlockChainInfo # | |
Defined in ZcashHaskell.Types showsPrec :: Int -> ZebraGetBlockChainInfo -> ShowS # show :: ZebraGetBlockChainInfo -> String # showList :: [ZebraGetBlockChainInfo] -> ShowS # | |
Eq ZebraGetBlockChainInfo # | |
Defined in ZcashHaskell.Types |
Transparent
data TransparentType #
Type to represent the two kinds of transparent addresses
Instances
Read TransparentType # | |
Defined in ZcashHaskell.Types | |
Show TransparentType # | |
Defined in ZcashHaskell.Types showsPrec :: Int -> TransparentType -> ShowS # show :: TransparentType -> String # showList :: [TransparentType] -> ShowS # | |
Eq TransparentType # | |
Defined in ZcashHaskell.Types (==) :: TransparentType -> TransparentType -> Bool # (/=) :: TransparentType -> TransparentType -> Bool # |
type TransparentSpendingKey = XPrvKey #
Type for transparent spending key
data TransparentAddress #
Type to represent a transparent Zcash addresses
Instances
Read TransparentAddress # | |
Defined in ZcashHaskell.Types | |
Show TransparentAddress # | |
Defined in ZcashHaskell.Types showsPrec :: Int -> TransparentAddress -> ShowS # show :: TransparentAddress -> String # showList :: [TransparentAddress] -> ShowS # | |
Eq TransparentAddress # | |
Defined in ZcashHaskell.Types (==) :: TransparentAddress -> TransparentAddress -> Bool # (/=) :: TransparentAddress -> TransparentAddress -> Bool # |
Wrapper types for transparent elements
RawTxIn | |
|
Instances
RawTxOut | |
|
Instances
data RawOutPoint #
RawOutPoint | |
|
Instances
Sapling
newtype SaplingSpendingKey #
A spending key for Sapling
Instances
Read SaplingSpendingKey # | |
Defined in ZcashHaskell.Types | |
Show SaplingSpendingKey # | |
Defined in ZcashHaskell.Types showsPrec :: Int -> SaplingSpendingKey -> ShowS # show :: SaplingSpendingKey -> String # showList :: [SaplingSpendingKey] -> ShowS # | |
Eq SaplingSpendingKey # | |
Defined in ZcashHaskell.Types (==) :: SaplingSpendingKey -> SaplingSpendingKey -> Bool # (/=) :: SaplingSpendingKey -> SaplingSpendingKey -> Bool # | |
ToBytes SaplingSpendingKey # | |
Defined in ZcashHaskell.Types |
newtype SaplingReceiver #
A Sapling receiver
Instances
Read SaplingReceiver # | |
Defined in ZcashHaskell.Types | |
Show SaplingReceiver # | |
Defined in ZcashHaskell.Types showsPrec :: Int -> SaplingReceiver -> ShowS # show :: SaplingReceiver -> String # showList :: [SaplingReceiver] -> ShowS # | |
Eq SaplingReceiver # | |
Defined in ZcashHaskell.Types (==) :: SaplingReceiver -> SaplingReceiver -> Bool # (/=) :: SaplingReceiver -> SaplingReceiver -> Bool # | |
ToBytes SaplingReceiver # | |
Defined in ZcashHaskell.Types getBytes :: SaplingReceiver -> ByteString # |
data ShieldedSpend #
Type to represent a Sapling Shielded Spend as provided by the getrawtransaction
RPC method
Instances
data ShieldedOutput #
Type to represent a Sapling Shielded Output as provided by the getrawtransaction
RPC method of zcashd
.
ShieldedOutput | |
|
Instances
Orchard
newtype OrchardSpendingKey #
A spending key for Orchard
Instances
Read OrchardSpendingKey # | |
Defined in ZcashHaskell.Types | |
Show OrchardSpendingKey # | |
Defined in ZcashHaskell.Types showsPrec :: Int -> OrchardSpendingKey -> ShowS # show :: OrchardSpendingKey -> String # showList :: [OrchardSpendingKey] -> ShowS # | |
Eq OrchardSpendingKey # | |
Defined in ZcashHaskell.Types (==) :: OrchardSpendingKey -> OrchardSpendingKey -> Bool # (/=) :: OrchardSpendingKey -> OrchardSpendingKey -> Bool # | |
ToBytes OrchardSpendingKey # | |
Defined in ZcashHaskell.Types |
newtype OrchardReceiver #
An Orchard receiver
Instances
Read OrchardReceiver # | |
Defined in ZcashHaskell.Types | |
Show OrchardReceiver # | |
Defined in ZcashHaskell.Types showsPrec :: Int -> OrchardReceiver -> ShowS # show :: OrchardReceiver -> String # showList :: [OrchardReceiver] -> ShowS # | |
Eq OrchardReceiver # | |
Defined in ZcashHaskell.Types (==) :: OrchardReceiver -> OrchardReceiver -> Bool # (/=) :: OrchardReceiver -> OrchardReceiver -> Bool # | |
ToBytes OrchardReceiver # | |
Defined in ZcashHaskell.Types getBytes :: OrchardReceiver -> ByteString # |
data UnifiedAddress #
Type to represent a Unified Address
UnifiedAddress | |
|
Instances
Read UnifiedAddress # | |
Defined in ZcashHaskell.Types readsPrec :: Int -> ReadS UnifiedAddress # readList :: ReadS [UnifiedAddress] # | |
Show UnifiedAddress # | |
Defined in ZcashHaskell.Types showsPrec :: Int -> UnifiedAddress -> ShowS # show :: UnifiedAddress -> String # showList :: [UnifiedAddress] -> ShowS # | |
Eq UnifiedAddress # | |
Defined in ZcashHaskell.Types (==) :: UnifiedAddress -> UnifiedAddress -> Bool # (/=) :: UnifiedAddress -> UnifiedAddress -> Bool # |
Helper type for marshalling UAs
RawUA | |
|
Instances
data UnifiedFullViewingKey #
Type to represent a Unified Full Viewing Key
UnifiedFullViewingKey | |
|
Instances
data OrchardAction #
Type to represent an Orchard Action as provided by the getrawtransaction
RPC method of zcashd
, and defined in the Zcash Protocol
OrchardAction | |
|
Instances
data DecodedNote #
Type to represent a decoded note
DecodedNote | |
|
Instances
Classes
Class to represent types with a bytestring representation
getBytes :: a -> ByteString #
Instances
ToBytes OrchardReceiver # | |
Defined in ZcashHaskell.Types getBytes :: OrchardReceiver -> ByteString # | |
ToBytes OrchardSpendingKey # | |
Defined in ZcashHaskell.Types | |
ToBytes Phrase # | |
Defined in ZcashHaskell.Types getBytes :: Phrase -> ByteString # | |
ToBytes SaplingReceiver # | |
Defined in ZcashHaskell.Types getBytes :: SaplingReceiver -> ByteString # | |
ToBytes SaplingSpendingKey # | |
Defined in ZcashHaskell.Types | |
ToBytes Seed # | |
Defined in ZcashHaskell.Types getBytes :: Seed -> ByteString # |
Helpers
decodeHexText :: String -> ByteString #
Helper function to turn a hex-encoded string to bytestring