Copyright | 2022-2024 Vergara Technologies LLC |
---|---|
License | MIT |
Maintainer | pitmutt@vergara.tech |
Stability | experimental |
Portability | unknown |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
A set of functions to assist in the handling of elements of the Zcash protocol, allowing for decoding of memos, addresses and viewing keys.
Synopsis
- decodeBech32 :: ByteString -> RawData
- encodeBech32m :: ByteString -> ByteString -> Text
- encodeBech32 :: ByteString -> ByteString -> Text
- f4Jumble :: ByteString -> ByteString
- f4UnJumble :: ByteString -> ByteString
- makeZcashCall :: (MonadIO m, FromJSON a) => ByteString -> ByteString -> Text -> [Value] -> m (Response a)
- makeZebraCall :: FromJSON a => Text -> Int -> Text -> [Value] -> IO (Either String a)
- getBlockTime :: HexString -> Int
- readZebraTransaction :: HexString -> Maybe RawZebraTx
- createTransaction :: Maybe SaplingCommitmentTree -> Maybe OrchardCommitmentTree -> [TransparentTxSpend] -> [SaplingTxSpend] -> [OrchardTxSpend] -> [OutgoingNote] -> ZcashNet -> Int -> Bool -> Either TxError HexString
Utility functions
decodeBech32 :: ByteString -> RawData #
Decode the given bytestring using Bech32
encodeBech32m :: ByteString -> ByteString -> Text #
Encode the given Human Readable Part and bytestring as a Bech32m string
encodeBech32 :: ByteString -> ByteString -> Text #
Encode the given Human Readable Part and bytestring as a Bech32 string
f4Jumble :: ByteString -> ByteString #
Apply the F4Jumble transformation to the given bytestring
f4UnJumble :: ByteString -> ByteString #
Apply the inverse F4Jumble transformation to the given bytestring
Node interaction
makeZcashCall :: (MonadIO m, FromJSON a) => ByteString -> ByteString -> Text -> [Value] -> m (Response a) #
Make a Zcash RPC call
:: FromJSON a | |
=> Text | Hostname for |
-> Int | Port for |
-> Text | RPC method to call |
-> [Value] | List of parameters |
-> IO (Either String a) |
Make a Zebra RPC call
getBlockTime :: HexString -> Int #
:: Maybe SaplingCommitmentTree | to obtain the Sapling anchor |
-> Maybe OrchardCommitmentTree | to obtain the Orchard anchor |
-> [TransparentTxSpend] | the list of transparent notes to spend |
-> [SaplingTxSpend] | the list of Sapling notes to spend |
-> [OrchardTxSpend] | the list of Orchard notes to spend |
-> [OutgoingNote] | the list of outgoing notes, including change notes |
-> ZcashNet | the network to be used |
-> Int | target block height |
-> Bool | True to build, False to estimate fee |
-> Either TxError HexString |