Safe Haskell | None |
---|---|
Language | Haskell2010 |
TxBuilder
and companion functions- Transaction Inputs
TxSelection
s- Payment functions
- Minting functions
- Reference Inputs
- Extra Vkey Witnesses in Transaction
- Transactoin validity functions
TxSelection
s- Payment functions
- Minting functions
- Reference Inputs
- Extra Vkey Witnesses in Transaction
- Transactoin validity functions
- Transactoin validity functions
- Error Class
- Kontract and ChainApi related API
- Chain info Structures
Synopsis
- type TxBuilder = TxBuilder_ ConwayEra
- data TxBuilder_ era
- class IsShelleyBasedEra era => IsTxBuilderEra era where
- bMaryOnward :: MaryEraOnwards era
- bAlonzoOnward :: AlonzoEraOnwards era
- bBabbageOnward :: BabbageEraOnwards era
- bAllegraOnward :: AllegraEraOnwards era
- bConwayOnward :: Maybe (ConwayEraOnwards era)
- bShelleyBasedEra :: ShelleyBasedEra era
- bCardanoEra :: CardanoEra era
- bAsEra :: AsType era
- txConsumeTxIn :: TxIn -> TxBuilder
- txConsumeUtxo :: TxIn -> TxOut CtxUTxO ConwayEra -> TxBuilder
- txConsumeUtxos :: UTxO ConwayEra -> TxBuilder
- txRedeemTxin :: IsPlutusScript sc => TxIn -> sc -> HashableScriptData -> Maybe ExecutionUnits -> TxBuilder
- txRedeemUtxo :: IsPlutusScript sc => TxIn -> TxOut CtxUTxO ConwayEra -> sc -> HashableScriptData -> Maybe ExecutionUnits -> TxBuilder
- txRedeemUtxoWithDatum :: IsPlutusScript sc => TxIn -> TxOut CtxUTxO ConwayEra -> sc -> HashableScriptData -> HashableScriptData -> Maybe ExecutionUnits -> TxBuilder
- txRedeemUtxoWithReferenceScript :: ScriptReferenceTxIn -> TxIn -> TxOut CtxUTxO ConwayEra -> HashableScriptData -> Maybe ExecutionUnits -> TxBuilder
- txRedeemTxinWithReferenceScript :: ScriptReferenceTxIn -> TxIn -> TxOut CtxUTxO ConwayEra -> HashableScriptData -> Maybe ExecutionUnits -> TxBuilder
- txRedeemUtxoWithDatumAndReferenceScript :: ScriptReferenceTxIn -> TxIn -> TxOut CtxUTxO ConwayEra -> HashableScriptData -> HashableScriptData -> Maybe ExecutionUnits -> TxBuilder
- txRedeemTxinWithDatumAndReferenceScript :: ScriptReferenceTxIn -> TxIn -> TxOut CtxUTxO ConwayEra -> HashableScriptData -> HashableScriptData -> Maybe ExecutionUnits -> TxBuilder
- txWalletAddress :: AddressInEra ConwayEra -> TxBuilder
- txWalletAddresses :: [AddressInEra ConwayEra] -> TxBuilder
- txWalletUtxos :: UTxO ConwayEra -> TxBuilder
- txWalletUtxo :: TxIn -> TxOut CtxUTxO ConwayEra -> TxBuilder
- txWalletSignKey :: SigningKey PaymentKey -> TxBuilder
- txWalletSignKeys :: [SigningKey PaymentKey] -> TxBuilder
- txPayTo :: AddressInEra ConwayEra -> Value -> TxBuilder
- txPayToPkh :: PubKeyHash -> Value -> TxBuilder
- txPayToScript :: AddressInEra ConwayEra -> Value -> Hash ScriptData -> TxBuilder
- txPayToScriptWithData :: AddressInEra ConwayEra -> Value -> HashableScriptData -> TxBuilder
- txPayToScriptWithReference :: IsPlutusScript sc => sc -> Value -> Hash ScriptData -> TxBuilder
- txPayToScriptWithDataAndReference :: IsPlutusScript sc => sc -> Value -> HashableScriptData -> TxBuilder
- txPayToWithReferenceScript :: AddressInEra ConwayEra -> Value -> TxScript -> TxBuilder
- txMintSimpleScript :: SimpleScript -> [(AssetName, Quantity)] -> TxBuilder
- txMintPlutusScript :: IsPlutusScript script => script -> HashableScriptData -> [(AssetName, Quantity)] -> TxBuilder
- txReferenceTxIn :: TxIn -> TxBuilder
- txReferenctUtxo :: TxIn -> TxOut CtxUTxO ConwayEra -> TxBuilder
- txSignBy :: AddressInEra ConwayEra -> TxBuilder
- txSignByPkh :: PubKeyHash -> TxBuilder
- txSign :: SigningKey PaymentKey -> TxBuilder
- txSetFee :: Integer -> TxBuilder
- txChangeAddress :: AddressInEra ConwayEra -> TxBuilder
- txValidFromPosixTime :: POSIXTime -> TxBuilder
- txValidUntilPosixTime :: POSIXTime -> TxBuilder
- txValidPosixTimeRange :: POSIXTime -> POSIXTime -> TxBuilder
- txValidFromSlot :: SlotNo -> TxBuilder
- txValidUntilSlot :: SlotNo -> TxBuilder
- txValidSlotRange :: SlotNo -> SlotNo -> TxBuilder
- txVote :: TxVote ConwayEra -> TxBuilder
- txCertificate :: Certificate ConwayEra -> TxBuilder
- txConsumeTxIn_ :: TxIn -> TxBuilder_ era
- txConsumeUtxo_ :: TxIn -> TxOut CtxUTxO era -> TxBuilder_ era
- txConsumeUtxos_ :: UTxO era -> TxBuilder_ era
- txRedeemTxin_ :: IsPlutusScript sc => TxIn -> sc -> HashableScriptData -> Maybe ExecutionUnits -> TxBuilder_ era
- txRedeemUtxo_ :: IsPlutusScript sc => TxIn -> TxOut CtxUTxO era -> sc -> HashableScriptData -> Maybe ExecutionUnits -> TxBuilder_ era
- txRedeemUtxoWithDatum_ :: IsPlutusScript sc => TxIn -> TxOut CtxUTxO era -> sc -> HashableScriptData -> HashableScriptData -> Maybe ExecutionUnits -> TxBuilder_ era
- txRedeemUtxoWithReferenceScript_ :: ScriptReferenceTxIn -> TxIn -> TxOut CtxUTxO era -> HashableScriptData -> Maybe ExecutionUnits -> TxBuilder_ era
- txRedeemTxinWithReferenceScript_ :: ScriptReferenceTxIn -> TxIn -> TxOut CtxUTxO era -> HashableScriptData -> Maybe ExecutionUnits -> TxBuilder_ era
- txRedeemUtxoWithDatumAndReferenceScript_ :: ScriptReferenceTxIn -> TxIn -> TxOut CtxUTxO era -> HashableScriptData -> HashableScriptData -> Maybe ExecutionUnits -> TxBuilder_ era
- txRedeemTxinWithDatumAndReferenceScript_ :: ScriptReferenceTxIn -> TxIn -> TxOut CtxUTxO era -> HashableScriptData -> HashableScriptData -> Maybe ExecutionUnits -> TxBuilder_ era
- txWalletAddress_ :: AddressInEra era -> TxBuilder_ era
- txWalletAddresses_ :: [AddressInEra era] -> TxBuilder_ era
- txWalletUtxos_ :: UTxO era -> TxBuilder_ era
- txWalletUtxo_ :: TxIn -> TxOut CtxUTxO era -> TxBuilder_ era
- txWalletSignKey_ :: SigningKey PaymentKey -> TxBuilder_ era
- txWalletSignKeys_ :: [SigningKey PaymentKey] -> TxBuilder_ era
- txPayTo_ :: IsTxBuilderEra era => AddressInEra era -> Value -> TxBuilder_ era
- txPayToPkh_ :: PubKeyHash -> Value -> TxBuilder_ era
- txPayToScript_ :: IsTxBuilderEra era => AddressInEra era -> Value -> Hash ScriptData -> TxBuilder_ era
- txPayToScriptWithData_ :: IsTxBuilderEra era => AddressInEra era -> Value -> HashableScriptData -> TxBuilder_ era
- txPayToScriptWithReference_ :: IsPlutusScript sc => sc -> Value -> Hash ScriptData -> TxBuilder_ era
- txPayToScriptWithDataAndReference_ :: IsPlutusScript sc => sc -> Value -> HashableScriptData -> TxBuilder_ era
- txPayToWithReferenceScript_ :: IsTxBuilderEra era => AddressInEra era -> Value -> TxScript -> TxBuilder_ era
- txMintSimpleScript_ :: SimpleScript -> [(AssetName, Quantity)] -> TxBuilder_ era
- txMintPlutusScript_ :: IsPlutusScript script => script -> HashableScriptData -> [(AssetName, Quantity)] -> TxBuilder_ era
- txReferenceTxIn_ :: TxIn -> TxBuilder_ era
- txReferenctUtxo_ :: TxIn -> TxOut CtxUTxO era -> TxBuilder_ era
- txSignBy_ :: AddressInEra era -> TxBuilder_ era
- txSignByPkh_ :: PubKeyHash -> TxBuilder_ era
- txSign_ :: SigningKey PaymentKey -> TxBuilder_ era
- txSetFee_ :: Integer -> TxBuilder_ era
- txChangeAddress_ :: AddressInEra era -> TxBuilder_ era
- txValidFromPosixTime_ :: POSIXTime -> TxBuilder_ era
- txValidUntilPosixTime_ :: POSIXTime -> TxBuilder_ era
- txValidPosixTimeRange_ :: POSIXTime -> POSIXTime -> TxBuilder_ era
- txValidFromSlot_ :: SlotNo -> TxBuilder_ era
- txValidUntilSlot_ :: SlotNo -> TxBuilder_ era
- txValidSlotRange_ :: SlotNo -> SlotNo -> TxBuilder_ era
- txVote_ :: TxVote era -> TxBuilder_ era
- txCertificate_ :: Certificate era -> TxBuilder_ era
- class IsPlutusScript sc
- class IsSimpleScript sc
- data TxScript
- data TxPlutusScript
- data TxSimpleScript = TxSimpleScript SimpleScript
- toTxSimpleScript :: IsSimpleScript sc => sc -> TxSimpleScript
- toTxPlutusScript :: IsPlutusScript sc => sc -> TxPlutusScript
- hashPlutusScript :: TxPlutusScript -> ScriptHash
- plutusScriptAddr :: IsShelleyBasedEra era => TxPlutusScript -> NetworkId -> AddressInEra era
- plutusScriptToScriptAny :: TxPlutusScript -> ScriptInAnyLang
- txScriptPolicyId :: TxScript -> PolicyId
- txScriptAddress :: IsShelleyBasedEra era => TxScript -> NetworkId -> StakeAddressReference -> AddressInEra era
- txScriptHash :: TxScript -> ScriptHash
- hashTxScript :: TxScript -> ScriptHash
- txScriptToScriptAny :: TxScript -> ScriptInAnyLang
- txScriptByteSize :: TxScript -> Int
- data ErrorType
- data FrameworkError
- = FrameworkError { }
- | FrameworkErrors [FrameworkError]
- throwFrameworkError :: Applicative m => Either FrameworkError a -> m a
- data Exception e => Kontract api w e r
- kError :: ErrorType -> String -> Kontract api w FrameworkError r
- kWrapParser :: Either String r -> Kontract api w FrameworkError r
- kGetBackend :: Exception e => Kontract a w e a
- evaluateKontract :: a -> Kontract a w FrameworkError r -> IO (Either FrameworkError r)
- eitherToKontract :: Exception e => Either e r -> Kontract api w e r
- class HasChainQueryAPI a where
- kGetNetworkId :: Kontract a w FrameworkError NetworkId
- kQueryProtocolParams :: IsTxBuilderEra era => Kontract a w FrameworkError (LedgerProtocolParameters era)
- kQuerySystemStart :: Kontract a w FrameworkError SystemStart
- kQueryGenesisParams :: Kontract a w FrameworkError (GenesisParameters ShelleyEra)
- kQueryUtxoByAddress :: IsTxBuilderEra era => Set AddressAny -> Kontract a w FrameworkError (UTxO era)
- kQueryUtxoByTxin :: IsTxBuilderEra era => Set TxIn -> Kontract a w FrameworkError (UTxO era)
- kQueryChainPoint :: Kontract a w FrameworkError ChainPoint
- kQueryCurrentEra :: Kontract a w FrameworkError AnyCardanoEra
- kQueryStakeDeposit :: Set StakeCredential -> Kontract a w FrameworkError (Map StakeCredential Coin)
- kQueryDrepState :: Set (Credential 'DRepRole StandardCrypto) -> Kontract a w FrameworkError (Map (Credential 'DRepRole StandardCrypto) (DRepState StandardCrypto))
- kQueryGovState :: IsTxBuilderEra era => Kontract a w FrameworkError (GovState (ShelleyLedgerEra era))
- kQueryDRepDistribution :: Set (DRep StandardCrypto) -> Kontract a w FrameworkError (Map (DRep StandardCrypto) Coin)
- class HasSubmitApi a where
- kSubmitTx :: InAnyCardanoEra Tx -> Kontract a w FrameworkError ()
- class HasKuberAPI a where
- kTxBuildTxBody :: IsTxBuilderEra era => TxBuilder_ era -> Kontract a w FrameworkError (TxBody era)
- kBuildTx :: IsTxBuilderEra era => TxBuilder_ era -> Kontract a w FrameworkError (Tx era)
- kTimeToSlot :: POSIXTime -> Kontract a w FrameworkError SlotNo
- kSlotToTime :: SlotNo -> Kontract a w FrameworkError POSIXTime
- kEvaluateExUnits :: IsTxBuilderEra era => Tx era -> Kontract a w FrameworkError (Map ScriptWitnessIndex (Either FrameworkError ExecutionUnits))
- kCalculateMinFee :: IsTxBuilderEra era => Tx era -> Kontract a w FrameworkError Coin
- kBuildAndSubmit :: IsTxBuilderEra era => TxBuilder_ era -> Kontract a w FrameworkError (Tx era)
- class HasLocalNodeAPI a where
- newtype ChainConnectInfo = ChainConnectInfo LocalNodeConnectInfo
- data RemoteKuberConnection
- createRemoteKuberConnection :: NetworkId -> UrlString -> Maybe ApiKeyString -> IO RemoteKuberConnection
- createRemoteKuberConnection' :: NetworkId -> BaseUrl -> Maybe ApiKeyString -> IO RemoteKuberConnection
- chainInfoFromEnv :: IO ChainConnectInfo
- chainInfoFromEnv' :: EnvVariable -> IO ChainConnectInfo
- chainInfoMainnet :: IO ChainConnectInfo
- chainInfoTestnet :: IO ChainConnectInfo
- localNodeConnInfo :: NetworkId -> SocketPath -> LocalNodeConnectInfo
- getWorkPath :: [FilePath] -> IO FilePath
- getWorkPathFunc :: IO ([FilePath] -> FilePath)
- getNetworkFromEnv :: EnvVariable -> IO (String, NetworkId)
- updateUtxoEra :: IsTxBuilderEra era => UTxO era1 -> UTxO era
TxBuilder
and companion functions
Transaction Builder Object
type TxBuilder = TxBuilder_ ConwayEra #
TxBuilder
is not to be directly used but, parts of it are constructed using helper functions.
Multiple builder parts can be combined to construct full transaction specification
data TxBuilder_ era #
Instances
IsTxBuilderEra era => FromJSON (TxBuilder_ era) # | |
Defined in Cardano.Kuber.Data.TxBuilderAeson parseJSON :: Value -> Parser (TxBuilder_ era) # parseJSONList :: Value -> Parser [TxBuilder_ era] # omittedField :: Maybe (TxBuilder_ era) # | |
IsTxBuilderEra era => ToJSON (TxBuilder_ era) # | |
Defined in Cardano.Kuber.Data.TxBuilderAeson toJSON :: TxBuilder_ era -> Value # toEncoding :: TxBuilder_ era -> Encoding # toJSONList :: [TxBuilder_ era] -> Value # toEncodingList :: [TxBuilder_ era] -> Encoding # omitField :: TxBuilder_ era -> Bool # | |
Monoid (TxBuilder_ era) # | |
Defined in Cardano.Kuber.Core.TxBuilder mempty :: TxBuilder_ era # mappend :: TxBuilder_ era -> TxBuilder_ era -> TxBuilder_ era # mconcat :: [TxBuilder_ era] -> TxBuilder_ era # | |
Semigroup (TxBuilder_ era) # | |
Defined in Cardano.Kuber.Core.TxBuilder (<>) :: TxBuilder_ era -> TxBuilder_ era -> TxBuilder_ era # sconcat :: NonEmpty (TxBuilder_ era) -> TxBuilder_ era # stimes :: Integral b => b -> TxBuilder_ era -> TxBuilder_ era # |
class IsShelleyBasedEra era => IsTxBuilderEra era where #
bMaryOnward :: MaryEraOnwards era #
bAlonzoOnward :: AlonzoEraOnwards era #
bBabbageOnward :: BabbageEraOnwards era #
bAllegraOnward :: AllegraEraOnwards era #
bConwayOnward :: Maybe (ConwayEraOnwards era) #
bShelleyBasedEra :: ShelleyBasedEra era #
bCardanoEra :: CardanoEra era #
Instances
Transaction Inputs
Add the txin to transaction input
txConsumeTxIn :: TxIn -> TxBuilder #
txConsumeUtxos :: UTxO ConwayEra -> TxBuilder #
txRedeemTxin :: IsPlutusScript sc => TxIn -> sc -> HashableScriptData -> Maybe ExecutionUnits -> TxBuilder #
Add a script utxo-reference containing inline-datum to transaction input. Script code and Reedemer should be passed.
txRedeemUtxo :: IsPlutusScript sc => TxIn -> TxOut CtxUTxO ConwayEra -> sc -> HashableScriptData -> Maybe ExecutionUnits -> TxBuilder #
Add a script utxo containing inline-datum to transaction input. Script code and redeemer should be passed for building transaction.
txRedeemUtxoWithDatum :: IsPlutusScript sc => TxIn -> TxOut CtxUTxO ConwayEra -> sc -> HashableScriptData -> HashableScriptData -> Maybe ExecutionUnits -> TxBuilder #
Add a script utxo containing datum-hash to transaction input . Script code, datum matching datumHash and redeemer should be passed for building transaction.
txRedeemUtxoWithReferenceScript :: ScriptReferenceTxIn -> TxIn -> TxOut CtxUTxO ConwayEra -> HashableScriptData -> Maybe ExecutionUnits -> TxBuilder #
Add a script utxo containing inline-datum to transaction input. Script code is inlined in provided TransactionInput. The script reference input will be automatically added to transaction reference inputs.
txRedeemTxinWithReferenceScript :: ScriptReferenceTxIn -> TxIn -> TxOut CtxUTxO ConwayEra -> HashableScriptData -> Maybe ExecutionUnits -> TxBuilder #
Add a script txIn containing inline-datum to transaction input. Script code is inlined in provided TransactionInput. The script reference input will be automatically added to transaction reference inputs.
txRedeemUtxoWithDatumAndReferenceScript :: ScriptReferenceTxIn -> TxIn -> TxOut CtxUTxO ConwayEra -> HashableScriptData -> HashableScriptData -> Maybe ExecutionUnits -> TxBuilder #
Add a script utxo txin containing datum-hash to transaction input. Script code is inlined in provided TransactionInput. The script reference input will be automatically added to transaction reference inputs.
txRedeemTxinWithDatumAndReferenceScript :: ScriptReferenceTxIn -> TxIn -> TxOut CtxUTxO ConwayEra -> HashableScriptData -> HashableScriptData -> Maybe ExecutionUnits -> TxBuilder #
Add a script utxo containing datum-hash to transaction input. Script code is inlined in provided TransactionInput. The script reference input will be automatically added to transaction reference inputs.
TxSelection
s
TxSelection
s represent Utxos that can be used for balancing a transaction. They will be added to input if required for balancing the transaciton.
Such utxos should be related to user's wallet and
txWalletAddresses :: [AddressInEra ConwayEra] -> TxBuilder #
txWalletUtxos :: UTxO ConwayEra -> TxBuilder #
txWalletSignKey :: SigningKey PaymentKey -> TxBuilder #
add signkey to the selection. All the utxos from the enterprise address of the signkey will be automatically
added to selection too. The TxBuilder
containing signkeys when built to transaction, transaction will contain signatures if their utxo is used.
In order to automatically sign tx for address other than enterprise address, both address and signkey must be present in the builder.
txWalletSignKeys :: [SigningKey PaymentKey] -> TxBuilder #
Payment functions
txPayToPkh :: PubKeyHash -> Value -> TxBuilder #
Pay to the enterprise address of this PublicKeyHash
txPayToScript :: AddressInEra ConwayEra -> Value -> Hash ScriptData -> TxBuilder #
Pay to script address with datumHash
txPayToScriptWithData :: AddressInEra ConwayEra -> Value -> HashableScriptData -> TxBuilder #
Pay to script address and inline the datum in utxo
txPayToScriptWithReference :: IsPlutusScript sc => sc -> Value -> Hash ScriptData -> TxBuilder #
Pay to the script and inline it in the utxo. Script enterprise address is derrived from script hash
txPayToScriptWithDataAndReference :: IsPlutusScript sc => sc -> Value -> HashableScriptData -> TxBuilder #
Pay to script with inline both datum and inline it in datum. Script enterprise address is derrived from script hash
txPayToWithReferenceScript :: AddressInEra ConwayEra -> Value -> TxScript -> TxBuilder #
Pay to address and inline the script in resulting utxo.
Minting functions
txMintSimpleScript :: SimpleScript -> [(AssetName, Quantity)] -> TxBuilder #
Mint token with simple script
txMintPlutusScript :: IsPlutusScript script => script -> HashableScriptData -> [(AssetName, Quantity)] -> TxBuilder #
Mint token with plutus v1 or v2 script
Reference Inputs
txReferenceTxIn :: TxIn -> TxBuilder #
Extra Vkey Witnesses in Transaction
txSignBy :: AddressInEra ConwayEra -> TxBuilder #
Mark this address as txExtraKeyWitness in the transaction object.
txSignByPkh :: PubKeyHash -> TxBuilder #
Mark this PublicKeyhash as txExtraKeyWitness in the transaction object.
txSign :: SigningKey PaymentKey -> TxBuilder #
Explicitly set transaction fee
Change address to send unbalanced value to. If change address is missing, it is automatically selected from one of the wallet addresses.
Transactoin validity functions
txValidPosixTimeRange :: POSIXTime -> POSIXTime -> TxBuilder #
txValidFromSlot :: SlotNo -> TxBuilder #
txValidUntilSlot :: SlotNo -> TxBuilder #
txValidSlotRange :: SlotNo -> SlotNo -> TxBuilder #
txConsumeTxIn_ :: TxIn -> TxBuilder_ era #
txConsumeUtxo_ :: TxIn -> TxOut CtxUTxO era -> TxBuilder_ era #
txConsumeUtxos_ :: UTxO era -> TxBuilder_ era #
txRedeemTxin_ :: IsPlutusScript sc => TxIn -> sc -> HashableScriptData -> Maybe ExecutionUnits -> TxBuilder_ era #
txRedeemUtxo_ :: IsPlutusScript sc => TxIn -> TxOut CtxUTxO era -> sc -> HashableScriptData -> Maybe ExecutionUnits -> TxBuilder_ era #
txRedeemUtxoWithDatum_ :: IsPlutusScript sc => TxIn -> TxOut CtxUTxO era -> sc -> HashableScriptData -> HashableScriptData -> Maybe ExecutionUnits -> TxBuilder_ era #
txRedeemUtxoWithReferenceScript_ :: ScriptReferenceTxIn -> TxIn -> TxOut CtxUTxO era -> HashableScriptData -> Maybe ExecutionUnits -> TxBuilder_ era #
txRedeemTxinWithReferenceScript_ :: ScriptReferenceTxIn -> TxIn -> TxOut CtxUTxO era -> HashableScriptData -> Maybe ExecutionUnits -> TxBuilder_ era #
txRedeemUtxoWithDatumAndReferenceScript_ :: ScriptReferenceTxIn -> TxIn -> TxOut CtxUTxO era -> HashableScriptData -> HashableScriptData -> Maybe ExecutionUnits -> TxBuilder_ era #
txRedeemTxinWithDatumAndReferenceScript_ :: ScriptReferenceTxIn -> TxIn -> TxOut CtxUTxO era -> HashableScriptData -> HashableScriptData -> Maybe ExecutionUnits -> TxBuilder_ era #
TxSelection
s
TxSelection
s represent Utxos that can be used for balancing a transaction. They will be added to input if required for balancing the transaciton.
Such utxos should be related to user's wallet and
txWalletAddress_ :: AddressInEra era -> TxBuilder_ era #
txWalletAddresses_ :: [AddressInEra era] -> TxBuilder_ era #
txWalletUtxos_ :: UTxO era -> TxBuilder_ era #
txWalletUtxo_ :: TxIn -> TxOut CtxUTxO era -> TxBuilder_ era #
txWalletSignKey_ :: SigningKey PaymentKey -> TxBuilder_ era #
txWalletSignKeys_ :: [SigningKey PaymentKey] -> TxBuilder_ era #
Payment functions
txPayTo_ :: IsTxBuilderEra era => AddressInEra era -> Value -> TxBuilder_ era #
txPayToPkh_ :: PubKeyHash -> Value -> TxBuilder_ era #
txPayToScript_ :: IsTxBuilderEra era => AddressInEra era -> Value -> Hash ScriptData -> TxBuilder_ era #
txPayToScriptWithData_ :: IsTxBuilderEra era => AddressInEra era -> Value -> HashableScriptData -> TxBuilder_ era #
txPayToScriptWithReference_ :: IsPlutusScript sc => sc -> Value -> Hash ScriptData -> TxBuilder_ era #
txPayToScriptWithDataAndReference_ :: IsPlutusScript sc => sc -> Value -> HashableScriptData -> TxBuilder_ era #
txPayToWithReferenceScript_ :: IsTxBuilderEra era => AddressInEra era -> Value -> TxScript -> TxBuilder_ era #
Minting functions
txMintSimpleScript_ :: SimpleScript -> [(AssetName, Quantity)] -> TxBuilder_ era #
txMintPlutusScript_ :: IsPlutusScript script => script -> HashableScriptData -> [(AssetName, Quantity)] -> TxBuilder_ era #
Reference Inputs
txReferenceTxIn_ :: TxIn -> TxBuilder_ era #
txReferenctUtxo_ :: TxIn -> TxOut CtxUTxO era -> TxBuilder_ era #
Extra Vkey Witnesses in Transaction
txSignBy_ :: AddressInEra era -> TxBuilder_ era #
txSignByPkh_ :: PubKeyHash -> TxBuilder_ era #
txSign_ :: SigningKey PaymentKey -> TxBuilder_ era #
Explicitly set transaction fee
txSetFee_ :: Integer -> TxBuilder_ era #
Change address to send unbalanced value to. If change address is missing, it is automatically selected from one of the wallet addresses.
txChangeAddress_ :: AddressInEra era -> TxBuilder_ era #
Transactoin validity functions
txValidFromPosixTime_ :: POSIXTime -> TxBuilder_ era #
txValidUntilPosixTime_ :: POSIXTime -> TxBuilder_ era #
txValidPosixTimeRange_ :: POSIXTime -> POSIXTime -> TxBuilder_ era #
txValidFromSlot_ :: SlotNo -> TxBuilder_ era #
txValidUntilSlot_ :: SlotNo -> TxBuilder_ era #
txValidSlotRange_ :: SlotNo -> SlotNo -> TxBuilder_ era #
txVote_ :: TxVote era -> TxBuilder_ era #
txCertificate_ :: Certificate era -> TxBuilder_ era #
Transactoin validity functions
these functions help dealing with plutus validator and cardano-api script types.
class IsPlutusScript sc #
Instances
IsPlutusScript TxPlutusScript # | |
Defined in Cardano.Kuber.Core.TxScript | |
IsPlutusVersion ver => IsPlutusScript (PlutusScript ver) # | |
Defined in Cardano.Kuber.Core.TxScript toTxPlutusScript :: PlutusScript ver -> TxPlutusScript # | |
IsPlutusVersion ver => IsPlutusScript (Script ver) # | |
Defined in Cardano.Kuber.Core.TxScript toTxPlutusScript :: Script ver -> TxPlutusScript # |
class IsSimpleScript sc #
Instances
data TxPlutusScript #
TxPlutusScriptV1 (PlutusScript PlutusScriptV1) | |
TxPlutusScriptV2 (PlutusScript PlutusScriptV2) | |
TxPlutusScriptV3 (PlutusScript PlutusScriptV3) |
Instances
FromJSON TxPlutusScript # | |
Defined in Cardano.Kuber.Data.TxBuilderAeson parseJSON :: Value -> Parser TxPlutusScript # parseJSONList :: Value -> Parser [TxPlutusScript] # | |
ToJSON TxPlutusScript # | |
Defined in Cardano.Kuber.Data.TxBuilderAeson toJSON :: TxPlutusScript -> Value # toEncoding :: TxPlutusScript -> Encoding # toJSONList :: [TxPlutusScript] -> Value # toEncodingList :: [TxPlutusScript] -> Encoding # omitField :: TxPlutusScript -> Bool # | |
Show TxPlutusScript # | |
Defined in Cardano.Kuber.Core.TxScript showsPrec :: Int -> TxPlutusScript -> ShowS # show :: TxPlutusScript -> String # showList :: [TxPlutusScript] -> ShowS # | |
IsPlutusScript TxPlutusScript # | |
Defined in Cardano.Kuber.Core.TxScript |
data TxSimpleScript #
Instances
ToJSON TxSimpleScript # | |
Defined in Cardano.Kuber.Data.TxBuilderAeson toJSON :: TxSimpleScript -> Value # toEncoding :: TxSimpleScript -> Encoding # toJSONList :: [TxSimpleScript] -> Value # toEncodingList :: [TxSimpleScript] -> Encoding # omitField :: TxSimpleScript -> Bool # | |
Show TxSimpleScript # | |
Defined in Cardano.Kuber.Core.TxScript showsPrec :: Int -> TxSimpleScript -> ShowS # show :: TxSimpleScript -> String # showList :: [TxSimpleScript] -> ShowS # | |
IsSimpleScript TxSimpleScript # | |
Defined in Cardano.Kuber.Core.TxScript |
toTxSimpleScript :: IsSimpleScript sc => sc -> TxSimpleScript #
toTxPlutusScript :: IsPlutusScript sc => sc -> TxPlutusScript #
plutusScriptAddr :: IsShelleyBasedEra era => TxPlutusScript -> NetworkId -> AddressInEra era #
txScriptPolicyId :: TxScript -> PolicyId #
txScriptAddress :: IsShelleyBasedEra era => TxScript -> NetworkId -> StakeAddressReference -> AddressInEra era #
txScriptHash :: TxScript -> ScriptHash #
hashTxScript :: TxScript -> ScriptHash #
txScriptByteSize :: TxScript -> Int #
Error Class
data FrameworkError #
Instances
throwFrameworkError :: Applicative m => Either FrameworkError a -> m a #
Kontract and ChainApi related API
data Exception e => Kontract api w e r #
Instances
MonadError FrameworkError (Kontract api w FrameworkError) # | |
Defined in Cardano.Kuber.Core.Kontract throwError :: FrameworkError -> Kontract api w FrameworkError a # catchError :: Kontract api w FrameworkError a -> (FrameworkError -> Kontract api w FrameworkError a) -> Kontract api w FrameworkError a # | |
Exception e => MonadIO (Kontract api w e) # | |
Defined in Cardano.Kuber.Core.Kontract | |
Exception e => Alternative (Kontract api w e) # | |
Exception e => Applicative (Kontract api w e) # | |
Defined in Cardano.Kuber.Core.Kontract pure :: a -> Kontract api w e a # (<*>) :: Kontract api w e (a -> b) -> Kontract api w e a -> Kontract api w e b # liftA2 :: (a -> b -> c) -> Kontract api w e a -> Kontract api w e b -> Kontract api w e c # (*>) :: Kontract api w e a -> Kontract api w e b -> Kontract api w e b # (<*) :: Kontract api w e a -> Kontract api w e b -> Kontract api w e a # | |
Exception e => Functor (Kontract api w e) # | |
Exception e => Monad (Kontract api w e) # | |
kWrapParser :: Either String r -> Kontract api w FrameworkError r #
kGetBackend :: Exception e => Kontract a w e a #
evaluateKontract :: a -> Kontract a w FrameworkError r -> IO (Either FrameworkError r) #
eitherToKontract :: Exception e => Either e r -> Kontract api w e r #
class HasChainQueryAPI a where #
kGetNetworkId :: Kontract a w FrameworkError NetworkId #
kQueryProtocolParams :: IsTxBuilderEra era => Kontract a w FrameworkError (LedgerProtocolParameters era) #
kQuerySystemStart :: Kontract a w FrameworkError SystemStart #
kQueryGenesisParams :: Kontract a w FrameworkError (GenesisParameters ShelleyEra) #
kQueryUtxoByAddress :: IsTxBuilderEra era => Set AddressAny -> Kontract a w FrameworkError (UTxO era) #
kQueryUtxoByTxin :: IsTxBuilderEra era => Set TxIn -> Kontract a w FrameworkError (UTxO era) #
kQueryChainPoint :: Kontract a w FrameworkError ChainPoint #
kQueryCurrentEra :: Kontract a w FrameworkError AnyCardanoEra #
kQueryStakeDeposit :: Set StakeCredential -> Kontract a w FrameworkError (Map StakeCredential Coin) #
kQueryDrepState :: Set (Credential 'DRepRole StandardCrypto) -> Kontract a w FrameworkError (Map (Credential 'DRepRole StandardCrypto) (DRepState StandardCrypto)) #
kQueryGovState :: IsTxBuilderEra era => Kontract a w FrameworkError (GovState (ShelleyLedgerEra era)) #
kQueryDRepDistribution :: Set (DRep StandardCrypto) -> Kontract a w FrameworkError (Map (DRep StandardCrypto) Coin) #
Instances
class HasSubmitApi a where #
kSubmitTx :: InAnyCardanoEra Tx -> Kontract a w FrameworkError () #
Instances
class HasKuberAPI a where #
kTxBuildTxBody :: IsTxBuilderEra era => TxBuilder_ era -> Kontract a w FrameworkError (TxBody era) #
kBuildTx :: IsTxBuilderEra era => TxBuilder_ era -> Kontract a w FrameworkError (Tx era) #
kTimeToSlot :: POSIXTime -> Kontract a w FrameworkError SlotNo #
kSlotToTime :: SlotNo -> Kontract a w FrameworkError POSIXTime #
kEvaluateExUnits :: IsTxBuilderEra era => Tx era -> Kontract a w FrameworkError (Map ScriptWitnessIndex (Either FrameworkError ExecutionUnits)) #
kCalculateMinFee :: IsTxBuilderEra era => Tx era -> Kontract a w FrameworkError Coin #
kBuildAndSubmit :: IsTxBuilderEra era => TxBuilder_ era -> Kontract a w FrameworkError (Tx era) #
Instances
class HasLocalNodeAPI a where #
Chain info Structures
newtype ChainConnectInfo #
Instances
data RemoteKuberConnection #
Instances
createRemoteKuberConnection :: NetworkId -> UrlString -> Maybe ApiKeyString -> IO RemoteKuberConnection #
createRemoteKuberConnection' :: NetworkId -> BaseUrl -> Maybe ApiKeyString -> IO RemoteKuberConnection #
chainInfoFromEnv :: IO ChainConnectInfo #
Using Environment variables determine the NETWORK. NETWORK can be "mainnet", "testnet" or "networkMagic number". If CARDANO_NODE_SOCKET_PATH environment variable is set, the socket path is set to it's value Otherwise CARDANO_HOME or "$HOME.cardano" is used and the socket path becomes "$CARDANO_HOMEnode.socket"
chainInfoFromEnv' :: EnvVariable -> IO ChainConnectInfo #
Read Network value from the environment variable and then determine connection info If CARDANO_NODE_SOCKET_PATH environment variable is set, the socket path is set to it's value Otherwise CARDANO_HOME or "$HOME.cardano" is used and the socket path becomes "$CARDANO_HOMEnode.socket"
getWorkPath :: [FilePath] -> IO FilePath #
get absolute path given a directory or file path relative to work directory. the absolute path is "CARANO_HOME/...paths" value to the path
getWorkPathFunc :: IO ([FilePath] -> FilePath) #
Get WrokPath calculatin Function getWorkPath function can throw errors. The error is only during initialization So if the function succeeds, it returns pure function to calculate filepath which can be reused.
getNetworkFromEnv :: EnvVariable -> IO (String, NetworkId) #
Given environment variable key, read the environmet variable and return network Id. The value maybe network name or network magic.
updateUtxoEra :: IsTxBuilderEra era => UTxO era1 -> UTxO era #