| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Cardano.Wasm.Api.Tx
Synopsis
- data UnsignedTxObject = UnsignedTxObject {
- unsignedTxEra :: Era era
- unsignedTx :: UnsignedTx era
- data SignedTxObject = SignedTxObject (Era era) (SignedTx era)
- newtype ProtocolParamsJSON = ProtocolParamsJSON String
- newTxImpl :: UnsignedTxObject
- newExperimentalEraTxImpl :: (HasCallStack, MonadThrow m) => m UnsignedTxObject
- newConwayTxImpl :: UnsignedTxObject
- addTxInputImpl :: UnsignedTxObject -> TxId -> TxIx -> UnsignedTxObject
- addSimpleTxOutImpl :: (HasCallStack, MonadThrow m) => UnsignedTxObject -> String -> Coin -> m UnsignedTxObject
- appendCertificateToTxImpl :: (HasCallStack, MonadThrow m) => UnsignedTxObject -> String -> m UnsignedTxObject
- estimateMinFeeImpl :: (HasCallStack, MonadThrow m) => UnsignedTxObject -> ProtocolParamsJSON -> Int -> Int -> Int -> m Coin
- setFeeImpl :: UnsignedTxObject -> Coin -> UnsignedTxObject
- signWithPaymentKeyImpl :: UnsignedTxObject -> SigningKey PaymentKey -> SignedTxObject
- alsoSignWithPaymentKeyImpl :: SignedTxObject -> SigningKey PaymentKey -> SignedTxObject
- toCborImpl :: SignedTxObject -> String
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
| |
Instances
| FromJSON UnsignedTxObject Source # | |
Defined in Cardano.Wasm.Api.Tx Methods parseJSON :: Value -> Parser UnsignedTxObject # parseJSONList :: Value -> Parser [UnsignedTxObject] # | |
| ToJSON UnsignedTxObject Source # | |
Defined in Cardano.Wasm.Api.Tx Methods toJSON :: UnsignedTxObject -> Value # toEncoding :: UnsignedTxObject -> Encoding # toJSONList :: [UnsignedTxObject] -> Value # toEncodingList :: [UnsignedTxObject] -> Encoding # omitField :: UnsignedTxObject -> Bool # | |
| Show UnsignedTxObject Source # | |
Defined in Cardano.Wasm.Api.Tx | |
data SignedTxObject Source #
An object representing a signed transaction.
Constructors
| SignedTxObject (Era era) (SignedTx era) |
Instances
| FromJSON SignedTxObject Source # | |
Defined in Cardano.Wasm.Api.Tx Methods parseJSON :: Value -> Parser SignedTxObject # parseJSONList :: Value -> Parser [SignedTxObject] # | |
| ToJSON SignedTxObject Source # | |
Defined in Cardano.Wasm.Api.Tx Methods toJSON :: SignedTxObject -> Value # toEncoding :: SignedTxObject -> Encoding # toJSONList :: [SignedTxObject] -> Value # toEncodingList :: [SignedTxObject] -> Encoding # omitField :: SignedTxObject -> Bool # | |
| Show SignedTxObject Source # | |
Defined in Cardano.Wasm.Api.Tx | |
newtype ProtocolParamsJSON Source #
Constructors
| ProtocolParamsJSON String |
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.
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.