cardano-wasm:cardano-wasi-lib
Safe HaskellNone
LanguageHaskell2010

Cardano.Wasm.Api.Tx

Synopsis

Documentation

data UnsignedTxObject Source #

An object representing a transaction that is being built and has not been signed yet. It abstracts over the era of the transaction. It is meant to be an opaque object in the JavaScript API.

Constructors

UnsignedTxObject 

Fields

data SignedTxObject Source #

An object representing a signed transaction.

Constructors

SignedTxObject (Era era) (SignedTx era) 

Instances

Instances details
FromJSON SignedTxObject Source # 
Instance details

Defined in Cardano.Wasm.Api.Tx

Methods

parseJSON :: Value -> Parser SignedTxObject #

parseJSONList :: Value -> Parser [SignedTxObject] #

omittedField :: Maybe SignedTxObject #

ToJSON SignedTxObject Source # 
Instance details

Defined in Cardano.Wasm.Api.Tx

Show SignedTxObject Source # 
Instance details

Defined in Cardano.Wasm.Api.Tx

newTxImpl :: UnsignedTxObject Source #

Create a new unsigned transaction object for making a transaction in the current era.

newExperimentalEraTxImpl :: (HasCallStack, MonadThrow m) => m UnsignedTxObject Source #

Create a new unsigned transaction object for making a transaction in the current experimental era.

newConwayTxImpl :: UnsignedTxObject Source #

Create a new unsigned transaction object for making a Conway era transaction.

addTxInputImpl :: UnsignedTxObject -> TxId -> TxIx -> UnsignedTxObject Source #

Add a simple transaction input to an unsigned transaction object.

addSimpleTxOutImpl :: (HasCallStack, MonadThrow m) => UnsignedTxObject -> String -> Coin -> m UnsignedTxObject Source #

Add a simple transaction output to an unsigned transaction object. It takes a destination address and an amount in lovelaces.

appendCertificateToTxImpl :: (HasCallStack, MonadThrow m) => UnsignedTxObject -> String -> m UnsignedTxObject Source #

Append a certificate (in CBOR hex string format) to an unsigned transaction object.

estimateMinFeeImpl Source #

Arguments

:: (HasCallStack, MonadThrow m) 
=> UnsignedTxObject

The unsigned transaction object to estimate fees for.

-> ProtocolParamsJSON

The JSON for the protocol parameters of the correct era and network.

-> Int

The number of key witnesses still to be added to the transaction.

-> Int

The number of Byron key witnesses still to be added to the transaction.

-> Int

The total size in bytes of reference scripts

-> m Coin 

Estimate min fees for an unsigned transaction object.

setFeeImpl :: UnsignedTxObject -> Coin -> UnsignedTxObject Source #

Set the fee for an unsigned transaction object.

signWithPaymentKeyImpl :: UnsignedTxObject -> SigningKey PaymentKey -> SignedTxObject Source #

Sign an unsigned transaction using a payment key.

alsoSignWithPaymentKeyImpl :: SignedTxObject -> SigningKey PaymentKey -> SignedTxObject Source #

Add an extra signature to an already signed transaction using a payment key.

toCborImpl :: SignedTxObject -> String Source #

Convert a signed transaction object to a base16 encoded string of its CBOR representation.