cardano-transactions-1.0.0: Library utilities for constructing and signing Cardano transactions.

Safe HaskellNone
LanguageHaskell2010

Data.UTxO.Transaction.Cardano.Shelley

Contents

Synopsis

Initialization

mkInit Source #

Arguments

:: NetworkId

A network tag, Mainnet or Testnet with NetworkMagic specified

-> SlotNo

A ttl expressed in slot number counted from the beginning of blockchain

-> Fee

fee of tx as taken when constructing change outputs

-> Init Shelley 

Construct a payment Init for Shelley from primitive types.

examples:

>>> mkInit Mainnet 430000
>>> mkInit (Testnet (NetworkMagic 1234)) 430000

Since: 2.0.0

Types

newtype Fee Source #

A type isomorphic to Integer to represent fees.

Constructors

Fee 

Fields

Instances
Eq Fee Source # 
Instance details

Defined in Data.UTxO.Transaction.Cardano.Shelley

Methods

(==) :: Fee -> Fee -> Bool #

(/=) :: Fee -> Fee -> Bool #

Num Fee Source # 
Instance details

Defined in Data.UTxO.Transaction.Cardano.Shelley

Methods

(+) :: Fee -> Fee -> Fee #

(-) :: Fee -> Fee -> Fee #

(*) :: Fee -> Fee -> Fee #

negate :: Fee -> Fee #

abs :: Fee -> Fee #

signum :: Fee -> Fee #

fromInteger :: Integer -> Fee #

Show Fee Source # 
Instance details

Defined in Data.UTxO.Transaction.Cardano.Shelley

Methods

showsPrec :: Int -> Fee -> ShowS #

show :: Fee -> String #

showList :: [Fee] -> ShowS #

Constructing Primitives

mkInput Source #

Arguments

:: Word32

Input index.

-> ByteString

Input transaction id. See also: fromBase16.

-> Maybe (Input Shelley) 

Construct a payment Input for Shelley from primitive types.

example:

>>> mkInput 14 =<< fromBase16 "3b402651...aad1c0b7"
Just (Input ...)

Since: 2.0.0

mkOutput Source #

Arguments

:: Natural

Output value, in Lovelace (1 Ada = 1e6 Lovelace).

-> ByteString

Output Address. See also: fromBase58, fromBase16, fromBech32.

-> Maybe (Output Shelley) 

Construct a payment Output for Shelley from primitive types.

example:

>>> mkOutput 42 =<< fromBase58 "Ae2tdPwU...DnXy319f"
>>> mkOutput 42 =<< fromBech32 "addr1sjc...6s3xvu5g"
>>> mkOutput 42 =<< fromBase16 "42bf330c...ba5b947e"
Just (Output ...)

Since: 2.0.0

mkShelleySignKey Source #

Arguments

:: ByteString

A extended address private key and its chain code. The key must be 96 bytes long, internally made of two concatenated parts:

BYTES = PRV | CC
PRV   = 64OCTET  # a 64 bytes Ed25519 extended private key
CC    = 32OCTET  # a 32 bytes chain code

See also: fromBech32.

-> Maybe (SignKey Shelley) 

Construct a SignKey for Shelley from primitive types. This is for Shelley era keys.

example:

>>> mkShelleySignKey =<< fromBech32 "xprv13f0ve...nu4v4h875l"
Just (SignKey ...)

Since: 2.0.0

mkByronSignKey Source #

Arguments

:: AddrAttributes

Address attributes, obtained from a Byron address. See also: mkAddrAttributes

-> ByteString

A extended address private key and its chain code. The key must be 96 bytes long, internally made of two concatenated parts:

BYTES = PRV | CC
PRV   = 64OCTET  # a 64 bytes Ed25519 extended private key
CC    = 32OCTET  # a 32 bytes chain code

See also: fromBase16.

-> Maybe (SignKey Shelley) 

Construct a SignKey for Shelley from primitive types. This is for Byron era keys.

example:

>>> let (Just addr) = fromBase58 "DdzFFzCqrh...Dwg3SiaHiEL"
>>> mkByronSignKey addr =<< fromBech32 "xprv13f0ve...nu4v4h875l"
Just (SignKey ...)

Since: 2.0.0

mkAddrAttributes Source #

Arguments

:: ByteString

A Byron address, as a raw ByteString.

-> Maybe AddrAttributes 

Extract address attributes from an address, if they exists (i.e. if the address is a bootstrap / Byron address).

example:

>>> let (Just addr) = fromBase58 "DdzFFzCqrh...Dwg3SiaHiEL"
>>> mkAddrAttributes addr
Just (AddrAttributes ...)

Since: 2.0.0